examineAdd.vue 16 KB

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