addPage.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <!-- 权限申请新增 -->
  2. <template>
  3. <view class="permissionApplyAddPage">
  4. <view class="check-big-box">
  5. <view class="check-text-p">*</view>
  6. <view class="check-title-p">所需权限</view>
  7. <view class="check-box" @click="checkButton(1)">
  8. <img v-if="!newData.checkType1" class="left-box" :src="imagesUrl('commonality/icon_12.png')">
  9. <img v-if="newData.checkType1" class="left-box" :src="imagesUrl('commonality/icon_13.png')">
  10. <view>回收报备</view>
  11. </view>
  12. <view class="check-box" @click="checkButton(2)">
  13. <img v-if="!newData.checkType2" class="left-box" :src="imagesUrl('commonality/icon_12.png')">
  14. <img v-if="newData.checkType2" class="left-box" :src="imagesUrl('commonality/icon_13.png')">
  15. <view>称重登记</view>
  16. </view>
  17. </view>
  18. <view class="check-big-box">
  19. <view class="check-text-p">*</view>
  20. <view class="check-title-p">申请实验室</view>
  21. <input @click="inputClick(2)" v-model="subject.subName" class="picker-input-box" disabled type="text"
  22. placeholder="请选择实验室">
  23. </view>
  24. <view style="margin-top:60rpx;height:160rpx;">
  25. <view class="text-color-p" v-if="subject.subName">基础信息:{{subject.deptName}}{{subject.buidName}}{{subject.forllName}}</view>
  26. <view class="text-color-p" v-if="subject.subName">实验室负责人:{{subject.adminName}}</view>
  27. </view>
  28. <view class="submit-button-p" @click="submitButton()">立 即 申 请</view>
  29. <!-- 实验室选择页面 -->
  30. <view class="pageTwo" v-if="pageType == 2">
  31. <view class="pageTwo-input-box">
  32. <input type="text" placeholder="请输入实验室名称/房间号" v-model="subjectName">
  33. <view @click="subjectList">查找</view>
  34. </view>
  35. <view class="for-max-box">
  36. <view class="for-null-text" v-if="!searchList[0]">{{nullText}}</view>
  37. <view class="for-box" v-for="(item,index) in searchList" :key="index">
  38. <view class="button-text-view">{{item.subName}}{{item.roomNum?'('+item.roomNum+')':''}}</view>
  39. <view class="button-big-view">
  40. <view class="button-null-view"></view>
  41. <view class="button-view" @click="checkClick(item)">选择</view>
  42. <view class="button-null-view"></view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="out-button" @click="inputClick(1)">返回</view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. import {
  52. systemMineGetListByPower,
  53. } from '@/pages_student/api/index.js'
  54. import {
  55. demo1,
  56. demo2
  57. } from '@/pages_hazardousWasteRecycling/api/index.js'
  58. export default {
  59. data() {
  60. return {
  61. pageType:1,
  62. //搜索回的实验室列表
  63. searchList: [],
  64. subject:{},
  65. //实验室名称
  66. subjectName: "",
  67. //暂无数据提示
  68. nullText: "请输入实验室名称进行搜索",
  69. newData:{
  70. checkType1:true,
  71. checkType2:true
  72. },
  73. }
  74. },
  75. onLoad(option) {
  76. },
  77. onShow() {
  78. },
  79. mounted() {
  80. },
  81. methods: {
  82. checkButton(type){
  83. if(type == 1){
  84. this.$set(this.newData,'checkType1',!this.newData.checkType1)
  85. }else if(type == 2){
  86. this.$set(this.newData,'checkType2',!this.newData.checkType2)
  87. }
  88. },
  89. submitButton(){
  90. console.log('this,',this.newData)
  91. },
  92. //选择搜索页面
  93. inputClick(type) {
  94. if (this.pageType != type) {
  95. this.pageType = type;
  96. this.$set(this, "subjectName", '');
  97. this.$set(this, "searchList", []);
  98. }
  99. },
  100. //查询实验室
  101. async subjectList() {
  102. if(!this.subjectName){
  103. uni.showToast({
  104. title: '请输入实验室名称/房间号',
  105. icon: "none",
  106. mask: true,
  107. duration: 2000
  108. });
  109. return
  110. }
  111. const {
  112. data
  113. } = await systemMineGetListByPower({
  114. searchValue: this.subjectName
  115. })
  116. if (data.code == 200) {
  117. this.searchList = data.data;
  118. if (!data.data[0]) {
  119. this.nullText = "暂无数据"
  120. }
  121. }
  122. },
  123. //实验室选择
  124. checkClick(item) {
  125. this.$set(this, "subject", item);
  126. this.inputClick(1);
  127. },
  128. },
  129. }
  130. </script>
  131. <style lang="stylus" scoped>
  132. .permissionApplyAddPage{
  133. height: 100%;
  134. display flex;
  135. flex-direction column;
  136. background-color: #fff;
  137. .check-big-box{
  138. display: flex;
  139. padding:0 40rpx;
  140. margin-top:30rpx;
  141. .check-text-p{
  142. color:#FF6A6A;
  143. height:80rpx;
  144. line-height:80rpx;
  145. }
  146. .check-title-p{
  147. font-size:32rpx;
  148. height:80rpx;
  149. line-height:80rpx;
  150. }
  151. .check-box{
  152. display: flex;
  153. font-size:32rpx;
  154. margin-left:40rpx;
  155. img{
  156. width:40rpx;
  157. height:40rpx;
  158. margin-top:21rpx;
  159. }
  160. view{
  161. margin-left:20rpx;
  162. height:80rpx;
  163. line-height:80rpx;
  164. }
  165. }
  166. .picker-input-box{
  167. padding: 0 20rpx;
  168. display flex;
  169. height: 80rpx;
  170. width: 400rpx;
  171. border: 1rpx solid #a2a2a2;
  172. border-radius: 10rpx;
  173. margin: 0 20rpx;
  174. }
  175. }
  176. .text-color-p{
  177. color:#666;
  178. margin:0 50rpx;
  179. line-height:80rpx;
  180. }
  181. .submit-button-p{
  182. background-color:#0183FA;
  183. color:#fff;
  184. width:400rpx;
  185. height:80rpx;
  186. line-height:80rpx;
  187. text-align: center;
  188. font-size:30rpx;
  189. margin:20rpx 175rpx;
  190. border-radius:10rpx;
  191. }
  192. .pageTwo {
  193. flex: 1;
  194. display flex;
  195. flex-direction column;
  196. overflow-y hidden;
  197. position: absolute;
  198. height: 100%;
  199. z-index: 100;
  200. background-color: #fff;
  201. .pageTwo-input-box {
  202. display flex;
  203. padding: 20rpx 25rpx;
  204. background #fff;
  205. margin-bottom: 20rpx;
  206. input {
  207. padding: 0 20rpx;
  208. width: 460rpx;
  209. line-height: 80rpx;
  210. height: 80rpx;
  211. border-top: 1rpx solid #a2a2a2;
  212. border-left: 1rpx solid #a2a2a2;
  213. border-bottom: 1rpx solid #a2a2a2;
  214. border-bottom-left-radius: 10rpx;
  215. border-top-left-radius: 10rpx;
  216. }
  217. view {
  218. width: 200rpx;
  219. line-height: 80rpx;
  220. height: 80rpx;
  221. border: 1rpx solid #007AFF;
  222. color: #fff;
  223. background #007AFF;
  224. text-align center;
  225. border-top-right-radius: 10rpx;
  226. border-bottom-right-radius: 10rpx;
  227. }
  228. }
  229. .for-max-box {
  230. background #fff;
  231. flex: 1;
  232. overflow-y scroll;
  233. .for-box:nth-child(1) {
  234. border: none;
  235. }
  236. .for-null-text {
  237. text-align center;
  238. line-height: 100rpx;
  239. color: #999;
  240. }
  241. .for-box {
  242. border-top: 1rpx solid #dedede;
  243. display: flex;
  244. .button-text-view {
  245. padding: 35rpx 35rpx 35rpx 20rpx;
  246. width:560rpx;
  247. }
  248. .button-big-view {
  249. padding: 20rpx 0 20rpx 0 ;
  250. width: 100rpx;
  251. display: flex;
  252. flex-direction: column;
  253. .button-null-view{
  254. flex:1;
  255. }
  256. .button-view{
  257. line-height:60rpx;
  258. width: 100rpx;
  259. text-align center;
  260. border-radius: 10rpx;
  261. background #007AFF;
  262. color: #fff;
  263. }
  264. }
  265. }
  266. }
  267. .out-button {
  268. width: 650rpx;
  269. height: 100rpx;
  270. line-height: 100rpx;
  271. margin: 20rpx 50rpx;
  272. text-align center;
  273. font-size: 32rpx;
  274. color: #fff;
  275. background #999;
  276. border-radius: 20rpx;
  277. }
  278. }
  279. }
  280. </style>