examineAdd.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. <!-- 安全检查-开展检查 -->
  2. <template>
  3. <view class="examine">
  4. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  5. <view class="basics">
  6. <view class="basics_li">
  7. <view class="basics_li_l">实验室</view>
  8. <view class="basics_li_r lab_r">
  9. <input class="picker-text" @click="popupClick(1)" type="text" disabled v-model="form.fjNumber" placeholder="请选择房间" placeholder-style="font-size: 30rpx;color:#333;">
  10. <view class="img-box" @click.stop="saoCode">
  11. <img src="@/images/Version3.3.3/icon_aqjc_sm.png">
  12. </view>
  13. </view>
  14. </view>
  15. <view class="basics_li">
  16. <view class="basics_li_l">学院</view>
  17. <picker @change="collegeChange" :value="collegeIndex" :range="collegeArray" class="scope_r">
  18. <view class="basics_li_r college_r">
  19. <view>{{form.deptName?form.deptName:'选择学院'}}</view>
  20. <img src="@/images/Version3.3.3/icon_06.png">
  21. </view>
  22. </picker>
  23. </view>
  24. <view class="basics_li">
  25. <view class="basics_li_l">楼栋</view>
  26. <view class="basics_li_r building_r">
  27. <input class="picker-text" type="text" disabled v-model="form.fjNumber" placeholder="选择实验室后自动匹配" placeholder-style="font-size: 30rpx;color:#333;">
  28. </view>
  29. </view>
  30. <view class="basics_li">
  31. <view class="basics_li_l">检查类型</view>
  32. <picker @change="categoryChange" :value="categoryIndex" :range="categoryArray" class="scope_r">
  33. <view class="basics_li_r college_r">
  34. <view>{{categoryArray[categoryIndex]}}</view>
  35. <img src="@/images/Version3.3.3/icon_06.png">
  36. </view>
  37. </picker>
  38. </view>
  39. <view class="basics_li">
  40. <view class="basics_li_l">计划标题</view>
  41. <picker @change="planChange" :value="planIndex" :range="planArray" class="scope_r">
  42. <view class="basics_li_r college_r">
  43. <view>{{planArray[planIndex]}}</view>
  44. <img src="@/images/Version3.3.3/icon_06.png">
  45. </view>
  46. </picker>
  47. </view>
  48. </view>
  49. <view class="attachment">
  50. <view class="attachment_t">
  51. <text>材料附件</text>
  52. <text>点击文件标题查看</text>
  53. </view>
  54. <view class="attachment_li">
  55. <img src="@/images/Version3.3.3/icon_djc_wj.png"/>
  56. <text>文件标题文件标题</text>
  57. <img class="attachment_li_del" src="@/images/Version3.3.3/icon_fjgk_sc.png"/>
  58. </view>
  59. </view>
  60. <view class="inspect">
  61. <view class="inspect_li">
  62. <view class="inspect_li_l">检查结果</view>
  63. <picker @change="resultChange" :value="resultIndex" :range="resultArray" class="scope_r">
  64. <view class="inspect_li_r college_r">
  65. <view>{{resultArray[resultIndex]}}</view>
  66. <img src="@/images/Version3.3.3/icon_06.png">
  67. </view>
  68. </picker>
  69. </view>
  70. <view class="inspect_li" v-if="form.inspectResult==0">
  71. <view class="inspect_li_l">整改日期</view>
  72. <picker mode="date" @change="startChange(form,$event)">
  73. <view class="inspect_li_r date_r">
  74. <input disabled class="picker-text" type="text" v-model="form.startTime" placeholder="请选择日期" placeholder-style="font-size: 30rpx;color:#333;">
  75. <img src="@/images/Version3.3.3/icon_rl.png">
  76. </view>
  77. </picker>
  78. </view>
  79. <view class="inspect_li" v-if="form.inspectResult==0">
  80. <view class="inspect_li_l">整改通知</view>
  81. <view class="inform_r">
  82. <view v-for="(item,index) in informArray" :key="index" @click="tabClick(index)"><text :class="informIndex==index?'checked':'inform_r_l' "></text><text class="inform_r_r">{{item}}</text></view>
  83. </view>
  84. </view>
  85. </view>
  86. </scroll-view>
  87. <!-- 房间选择弹出层 -->
  88. <view class="popup-max-box" v-if="popupType">
  89. <view class="popup-null" @click="popupClick(2)"></view>
  90. <view class="popup-big-box">
  91. <view class="popup-input-box">
  92. <input type="text" maxlength="10" v-model="room" placeholder="请输入房间号">
  93. <view @click="getSelectInfoByRoom">搜索</view>
  94. </view>
  95. <view class="popup-for-max-box">
  96. <view class="popup-for-null" v-if="!roomList[0]">暂无数据</view>
  97. <view class="popup-for-box" v-for="(item,index) in roomList" :key="index">
  98. <view class="name-p">{{item.name}} ({{item.room}})</view>
  99. <view class="button-p" @click="popupClickItem(item)">确定</view>
  100. </view>
  101. </view>
  102. </view>
  103. </view>
  104. <view class="bottom_btn" @click="handleClick('nextStep')" v-if="form.inspectResult==0">下一步</view>
  105. <view class="bottom_btn" @click="handleClick('subBtn')" v-if="form.inspectResult==1">提交</view>
  106. </view>
  107. </template>
  108. <script>
  109. import { config } from '@/api/request/config.js'
  110. import { getSelectInfoByRoom,conditionCollegeInfo,subjectList,getCheckPlanBySubId} from '@/api/index.js'
  111. export default {
  112. name: "rectifyList",
  113. components: {
  114. },
  115. data() {
  116. return {
  117. pageType:0,
  118. //列表请求参数
  119. getData:{
  120. pageNum:1,
  121. pageSize:20,
  122. },
  123. form:{
  124. name:'',
  125. startTime:'',
  126. inspectResult:0,//检查结果
  127. },
  128. collegeIndex :0,
  129. collegeArray:[],
  130. categoryIndex :0,
  131. categoryArray:['校级巡查','院级巡查'],
  132. planIndex :0,
  133. planArray:[],
  134. planList:[],
  135. resultIndex :0,
  136. resultArray:['不符合','符合'],
  137. informIndex:0,
  138. informArray:['整改告知书','整改通知书'],
  139. //房间弹层 状态
  140. popupType:false,
  141. //房间搜索字段
  142. room:"",
  143. roomList:[],
  144. }
  145. },
  146. onLoad(option) {
  147. },
  148. onShow() {
  149. },
  150. mounted(){
  151. this.conditionCollegeInfo();
  152. },
  153. methods: {
  154. //滚动事件
  155. scrollGet(){},
  156. handleClick(doType){
  157. let self=this;
  158. if( doType=='nextStep'){//下一步
  159. uni.redirectTo({
  160. url: '/pages/pages_safetyExamine/examineManage/examineAddTow'
  161. });
  162. }else if(doType=='subBtn'){//提交
  163. }
  164. },
  165. //查询学院列表
  166. async conditionCollegeInfo(){
  167. let _this = this;
  168. const {data} = await conditionCollegeInfo();
  169. if(data.code == 200){
  170. for(let i=0;i<data.data.length;i++){
  171. _this.collegeArray.push(data.data[i].deptName)
  172. }
  173. _this.collegeList=data.data;
  174. }
  175. },
  176. //根据实验室id查询该实验室有关计划
  177. async getCheckPlanBySubId(subId){
  178. let _this = this;
  179. const {data} = await getCheckPlanBySubId({'subId':subId});
  180. if(data.code == 200){
  181. for(let i=0;i<data.data.length;i++){
  182. _this.planArray.push(data.data[i].title)
  183. }
  184. _this.planList=data.data;
  185. }
  186. },
  187. collegeChange(e){
  188. this.collegeIndex = e.target.value;
  189. this.form.deptId=this.collegeList[e.target.value].deptId
  190. this.form.deptName=this.collegeList[e.target.value].deptName
  191. },
  192. categoryChange(e){
  193. this.categoryIndex = e.target.value;
  194. },
  195. planChange(e){
  196. this.planIndex = e.target.value;
  197. },
  198. resultChange(e){
  199. this.resultIndex = e.target.value;
  200. this.form.inspectResult=e.target.value;
  201. },
  202. //开始时间选中事件
  203. startChange(form,e){
  204. form.startTime=e.target.value
  205. },
  206. //顶部tab点击
  207. tabClick(index) {
  208. this.informIndex = index;
  209. },
  210. //搜索房间弹层开关
  211. popupClick(type){
  212. if(type == 1){
  213. this.room = "";
  214. this.roomList = [];
  215. this.popupType = true;
  216. }else if(type == 2){
  217. this.popupType = false;
  218. }
  219. },
  220. //搜索房间接口
  221. async getSelectInfoByRoom(){
  222. let self = this;
  223. if(!this.room){
  224. uni.showToast({
  225. title: '请输入要搜索房间号',
  226. icon:"none",
  227. mask:true,
  228. duration: 2000
  229. });
  230. return
  231. }
  232. const {data} = await getSelectInfoByRoom(this.room);
  233. if(data.code==200){
  234. if(data.data[0]){
  235. this.roomList = data.data;
  236. }else{
  237. uni.showToast({
  238. title: '未找到相关房间',
  239. icon:"none",
  240. mask:true,
  241. duration: 2000
  242. });
  243. }
  244. }
  245. },
  246. //确认搜索房间
  247. popupClickItem(item){
  248. this.$set(this.form,"fjNumber",item.room)
  249. this.$set(this.form,"deptName",item.deptName)
  250. this.$set(this.form,"buildingId",item.building)
  251. this.$set(this.form,"deptId",item.deptId)
  252. this.$set(this.form,"laboratoryId",item.id)
  253. this.$set(this.form,"buildingName",item.buildName)
  254. this.$set(this.form,"laboratoryName",item.name)
  255. this.$set(this.form,"fzrId",item.userId)
  256. this.$set(this.form,"fzrName",item.safeUserName)
  257. this.$set(this.form,"fzrLxfs",item.safeUserPhone)
  258. this.popupType = false;
  259. this.getCheckPlanBySubId(item.id)
  260. },
  261. //调用摄像头
  262. saoCode(){
  263. let self = this;
  264. uni.scanCode({
  265. onlyFromCamera: true,
  266. success: function (res) {
  267. if(res.result.indexOf("code") != -1 && res.result.indexOf("-") != -1 && res.result.indexOf("&") != -1){
  268. let codeRoom = "";
  269. let newList = res.result.split("?")[1].split("&")
  270. let list = newList[0].split("=")[1].split("-")
  271. codeRoom = list[1];
  272. if(codeRoom){
  273. self.roomList = [];
  274. self.room = codeRoom;
  275. self.getSelectInfoByRoom();
  276. self.popupType = true;
  277. }else{
  278. uni.showToast({
  279. title: '请扫描正确的二维码',
  280. icon:"none",
  281. mask:true,
  282. duration: 2000
  283. });
  284. }
  285. }else{
  286. uni.showToast({
  287. title: '请扫描正确的二维码',
  288. icon:"none",
  289. mask:true,
  290. duration: 2000
  291. });
  292. }
  293. }
  294. });
  295. },
  296. }
  297. }
  298. </script>
  299. <style lang="stylus" scoped>
  300. .examine{
  301. height:100%;
  302. display flex;
  303. box-sizing: border-box;
  304. .info-max-box{
  305. flex: 1;
  306. overflow: scroll;
  307. padding: 20rpx 0rpx 128rpx;
  308. box-sizing: border-box;
  309. }
  310. .basics{
  311. margin: 0 30rpx;
  312. width: 690rpx;
  313. height: 562rpx;
  314. background: #FFFFFF;
  315. border-radius: 20rpx;
  316. padding: 30rpx 28rpx 0;
  317. box-sizing: border-box;
  318. .basics_li{
  319. display: flex;
  320. justify-content: flex-start;
  321. margin-bottom: 24rpx;
  322. .basics_li_l{
  323. width: 146rpx;
  324. text-align: left;
  325. font-size: 30rpx;
  326. font-family: PingFang SC-Medium, PingFang SC;
  327. font-weight: 400;
  328. color: #333333;
  329. line-height: 80rpx;
  330. }
  331. .basics_li_r{
  332. width: 486rpx;
  333. height: 80rpx;
  334. border-radius: 10rpx;
  335. opacity: 1;
  336. border: 1rpx solid #E0E0E0;
  337. padding-left: 20rpx;
  338. box-sizing: border-box;
  339. }
  340. /* 学院 */
  341. .college_r{
  342. width: 486rpx;
  343. height: 80rpx;
  344. border-radius: 10rpx;
  345. border: 1rpx solid #E0E0E0;
  346. display: flex;
  347. justify-content: flex-start;
  348. align-items: center;
  349. >view{
  350. flex:1;
  351. line-height:80rpx;
  352. font-size: 30rpx;
  353. font-family: PingFang SC-Medium, PingFang SC;
  354. font-weight: 400;
  355. color: #333333;
  356. line-height: 80rpx;
  357. }
  358. >img{
  359. width: 14rpx;
  360. height: 8rpx;
  361. margin-right: 30rpx;
  362. }
  363. }
  364. /* 实验室 */
  365. .lab_r{
  366. width: 486rpx;
  367. height: 80rpx;
  368. display: flex;
  369. justify-content: flex-start;
  370. .picker-text{
  371. width: 438rpx;
  372. height: 80rpx;
  373. }
  374. .img-box{
  375. width: 48rpx;
  376. >img{
  377. width:30rpx;
  378. height:28rpx;
  379. margin:16rpx 18rpx 0 0;
  380. }
  381. }
  382. }
  383. /* 楼栋 */
  384. .building_r{
  385. width: 486rpx;
  386. height: 80rpx;
  387. >input{
  388. height: 80rpx;
  389. font-size: 30rpx;
  390. font-family: PingFang SC-Medium, PingFang SC;
  391. font-weight: 400;
  392. color: #333333;
  393. line-height: 80rpx;
  394. }
  395. }
  396. }
  397. }
  398. .attachment{
  399. width: 690rpx;
  400. background: #FFFFFF;
  401. border-radius: 20rpx;
  402. margin: 20rpx 30rpx 0;
  403. padding-bottom: 32rpx;
  404. box-sizing: border-box;
  405. .attachment_t{
  406. border-bottom: 1rpx solid #D8D8D8;
  407. >text:nth-of-type(1){
  408. font-size: 30rpx;
  409. font-family: PingFang SC-Medium, PingFang SC;
  410. font-weight: 400;
  411. color: #333333;
  412. line-height: 110rpx;
  413. margin-left: 28rpx;
  414. }
  415. >text:nth-of-type(2){
  416. font-size: 30rpx;
  417. font-family: PingFang SC-Medium, PingFang SC;
  418. font-weight: 400;
  419. color: #999999;
  420. line-height: 110rpx;
  421. margin-left: 24rpx;
  422. }
  423. }
  424. .attachment_li{
  425. height: 40rpx;
  426. display: flex;
  427. justify-content: flex-start;
  428. align-items: center;
  429. margin-top: 32rpx;
  430. >img{
  431. width: 30rpx;
  432. height: 26rpx;
  433. margin-right: 20rpx;
  434. margin-left: 50rpx;
  435. }
  436. >text{
  437. flex: 1;
  438. font-size: 28rpx;
  439. font-family: PingFang SC-Medium, PingFang SC;
  440. font-weight: 400;
  441. color: #0183FA;
  442. line-height: 40rpx;
  443. white-space: nowrap;
  444. overflow: hidden;
  445. text-overflow: ellipsis;
  446. }
  447. .attachment_li_del{
  448. width: 30rpx;
  449. height: 30rpx;
  450. }
  451. }
  452. }
  453. .inspect{
  454. margin: 20rpx 30rpx 0;
  455. width: 690rpx;
  456. height: auto;
  457. background: #FFFFFF;
  458. border-radius: 20rpx;
  459. padding: 40rpx 28rpx 20rpx;
  460. box-sizing: border-box;
  461. .inspect_li{
  462. display: flex;
  463. justify-content: flex-start;
  464. margin-bottom: 24rpx;
  465. .inspect_li_l{
  466. width: 146rpx;
  467. text-align: left;
  468. font-size: 30rpx;
  469. font-family: PingFang SC-Medium, PingFang SC;
  470. font-weight: 400;
  471. color: #333333;
  472. line-height: 80rpx;
  473. }
  474. .inspect_li_r{
  475. width: 486rpx;
  476. height: 80rpx;
  477. border-radius: 10rpx;
  478. opacity: 1;
  479. border: 1rpx solid #E0E0E0;
  480. padding-left: 20rpx;
  481. box-sizing: border-box;
  482. }
  483. .college_r{
  484. width: 486rpx;
  485. height: 80rpx;
  486. border-radius: 10rpx;
  487. border: 1rpx solid #E0E0E0;
  488. display: flex;
  489. justify-content: flex-start;
  490. align-items: center;
  491. >view{
  492. flex:1;
  493. line-height:80rpx;
  494. font-size: 30rpx;
  495. font-family: PingFang SC-Medium, PingFang SC;
  496. font-weight: 400;
  497. color: #333333;
  498. line-height: 80rpx;
  499. }
  500. >img{
  501. width: 14rpx;
  502. height: 8rpx;
  503. margin-right: 30rpx;
  504. }
  505. }
  506. /* 整改日期 */
  507. .date_r{
  508. width: 486rpx;
  509. height: 80rpx;
  510. display: flex;
  511. justify-content: flex-start;
  512. .picker-text{
  513. width: 438rpx;
  514. height: 80rpx;
  515. }
  516. >img{
  517. width:30rpx;
  518. height:28rpx;
  519. margin:16rpx 18rpx 0 0;
  520. }
  521. }
  522. /* 整改通知 */
  523. .inform_r{
  524. width: 486rpx;
  525. height: 80rpx;
  526. padding-left: 20rpx;
  527. box-sizing: border-box;
  528. display: flex;
  529. justify-content: flex-start;
  530. align-items: center;
  531. >view{
  532. display: flex;
  533. justify-content: flex-start;
  534. align-items: center;
  535. margin-right: 24rpx;
  536. .inform_r_l{
  537. display: inline-block;
  538. width: 30rpx;
  539. height: 30rpx;
  540. border-radius: 50%;
  541. border: 1rpx solid #E0E0E0;
  542. margin-right: 14rpx;
  543. }
  544. .inform_r_r{
  545. font-size: 30rpx;
  546. font-family: PingFang SC-Medium, PingFang SC;
  547. font-weight: 400;
  548. color: #333333;
  549. line-height: 80rpx;
  550. }
  551. .checked{
  552. display: inline-block;
  553. width: 30rpx;
  554. height: 30rpx;
  555. border-radius: 50%;
  556. border: 1rpx solid #0183FA;
  557. margin-right: 14rpx;
  558. position: relative;
  559. }
  560. .checked::after{
  561. content: '';
  562. position: absolute;
  563. top: 5rpx;
  564. left:5rpx;
  565. width: 20rpx;
  566. height: 20rpx;
  567. border-radius: 50%;
  568. background: #0183FA;
  569. }
  570. }
  571. }
  572. }
  573. }
  574. .popup-max-box{
  575. z-index:10;
  576. height:100%;
  577. width:100%;
  578. position fixed;
  579. background rgba(0,0,0,0.2)
  580. display flex;
  581. flex-direction column
  582. .popup-null{
  583. flex:1;
  584. }
  585. .popup-big-box{
  586. border-top-left-radius:20rpx;
  587. border-top-right-radius:20rpx;
  588. background #fff
  589. .popup-input-box{
  590. padding:30rpx 20rpx;
  591. display:flex;
  592. input{
  593. flex:1;
  594. height:70rpx;
  595. border:1rpx solid #e0e0e0;
  596. border-radius:10rpx;
  597. margin-right:20rpx;
  598. padding:0 20rpx;
  599. }
  600. view{
  601. background #0183FA
  602. color:#fff;
  603. border-radius:10rpx;
  604. width:140rpx;
  605. line-height:70rpx;
  606. text-align center;
  607. font-size:28rpx;
  608. }
  609. }
  610. .popup-for-max-box{
  611. margin:0 20rpx 30rpx;
  612. height:600rpx;
  613. overflow-y scroll;
  614. .popup-for-null{
  615. line-height:100rpx;
  616. text-align center
  617. color:#999;
  618. }
  619. .popup-for-box{
  620. display:flex;
  621. padding:10px 0;
  622. .name-p{
  623. flex:1;
  624. line-height:60rpx;
  625. }
  626. .button-p{
  627. background #0183FA
  628. color:#fff;
  629. text-align center
  630. width:100rpx;
  631. line-height:60rpx;
  632. height:60rpx;
  633. border-radius:10rpx;
  634. }
  635. }
  636. }
  637. }
  638. }
  639. .bottom_btn{
  640. position: fixed;
  641. bottom: 26rpx;
  642. left: 30rpx;
  643. font-size: 30rpx;
  644. font-family: PingFang SC-Medium, PingFang SC;
  645. font-weight: 400;
  646. color: #FFFFFF;
  647. line-height: 90rpx;
  648. width: 690rpx;
  649. height: 90rpx;
  650. background: #0183FA;
  651. border-radius: 20rpx;
  652. text-align: center;
  653. }
  654. }
  655. </style>