examineAdd.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225
  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.subjectName" placeholder="请选择房间" placeholder-style="font-size: 30rpx;color:#333;">
  10. <view class="img-box" @click.stop="saoCode">
  11. <img src="@/pages_safetyExamine/images/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.collegeName?form.collegeName:'选择学院'}}</view>
  20. <img src="@/pages_safetyExamine/images/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.buildName" 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="buildingChange" :value="collegeIndex" :range="buildingArray" class="scope_r">
  33. <view class="basics_li_r college_r">
  34. <view>{{form.buildName?form.buildName:'选择楼栋'}}</view>
  35. <img src="@/pages_safetyExamine/images/icon_06.png">
  36. </view>
  37. </picker>
  38. </view>
  39. <view class="basics_li">
  40. <view class="basics_li_l">计划标题</view>
  41. <picker v-if="isCustom" @change="planChange" :value="planIndex" :range="planArray" class="scope_r">
  42. <view class="basics_li_r college_r">
  43. <view>{{form.title?form.title:'选择计划标题'}}</view>
  44. <img src="@/pages_safetyExamine/images/icon_06.png">
  45. </view>
  46. </picker>
  47. <view v-if="!isCustom" class="basics_li_r college_r">
  48. <input type="text" v-model="form.title" placeholder="输入计划标题">
  49. </view>
  50. </view>
  51. <view class="basics_li" style="justify-content: flex-end;">
  52. <view class="custom" @click="customFun">{{isCustom?'自定义输入':'选择计划'}}</view>
  53. </view>
  54. <view class="basics_li">
  55. <view class="basics_li_l">检查类型</view>
  56. <picker @change="categoryChange" :value="categoryIndex" disabled :range="categoryArray" class="scope_r">
  57. <view class="basics_li_r college_r">
  58. <view>{{form.checkType?(form.checkType==1?'校院巡查':'实验室自查'):'选择检查类型'}}</view>
  59. <img src="@/pages_safetyExamine/images/icon_06.png">
  60. </view>
  61. </picker>
  62. </view>
  63. <view class="period">
  64. <view class="period_l">计划周期</view>
  65. <view class="period_r">
  66. <picker mode="date" @change="startChange(form,$event)" :disabled="isCustom">
  67. <input class="picker-text" disabled type="text" v-model="form.cycleStartTime" placeholder="开始时间">
  68. </picker>
  69. <view>至</view>
  70. <picker mode="date" @change="endChange(form,$event)" :disabled="isCustom">
  71. <input class="picker-text2" disabled type="text" v-model="form.cycleEndTime" placeholder="结束时间">
  72. </picker>
  73. </view>
  74. </view>
  75. </view>
  76. <view class="inspect">
  77. <view class="inspect_li">
  78. <view class="inspect_li_l">检查结果</view>
  79. <picker @change="resultChange" :value="resultIndex" :range="resultArray" class="scope_r">
  80. <view class="inspect_li_r college_r">
  81. <view>{{form.checkResult==1?'符合':'不符合'}}</view>
  82. <img src="@/pages_safetyExamine/images/icon_06.png">
  83. </view>
  84. </picker>
  85. </view>
  86. <view class="inspect_li" v-if="form.checkResult==0">
  87. <view class="inspect_li_l">整改日期</view>
  88. <picker mode="date" @change="rectifyDeadline(form,$event)" :start="currentDate">
  89. <view class="inspect_li_r date_r">
  90. <input disabled class="picker-text" type="text" v-model="form.rectifyDeadline" placeholder="请选择日期" placeholder-style="font-size: 30rpx;color:#333;">
  91. <img src="@/pages_safetyExamine/images/icon_rl.png">
  92. </view>
  93. </picker>
  94. </view>
  95. <view class="inspect_li" v-if="form.checkResult==0">
  96. <view class="inspect_li_l">整改通知</view>
  97. <view class="inform_r">
  98. <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>
  99. </view>
  100. </view>
  101. </view>
  102. </scroll-view>
  103. <!-- 房间选择弹出层 -->
  104. <view class="popup-max-box" v-if="popupType">
  105. <view class="popup-null" @click="popupClick(2)"></view>
  106. <view class="popup-big-box">
  107. <view class="popup-input-box">
  108. <input type="text" maxlength="10" v-model="room" placeholder="请输入关键字">
  109. <view @click="buildBySub">搜索</view>
  110. </view>
  111. <view class="popup-for-max-box">
  112. <view class="popup-for-null" v-if="!roomList[0]">暂无数据</view>
  113. <view class="popup-for-box" v-for="(item,index) in roomList" :key="index">
  114. <view class="name-p">{{item.name}}</view>
  115. <view class="button-p" @click="popupClickItem(item)">确定</view>
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. <!-- 检查名称弹窗 -->
  121. <uni-popup ref="popup" class="inspect_name" type="bottom">
  122. <view class="popup-content">
  123. <view class="inspect_name_t">
  124. <input type="text" v-model="customTitle" maxlength="20" placeholder="请输入计划标题"/>
  125. </view>
  126. <view class="inspect_name_b">
  127. <text @click="titleCancel()">取消</text>
  128. <text @click="titleConfirm()">确定</text>
  129. </view>
  130. </view>
  131. </uni-popup>
  132. <view class="bottom_btn" @click="handleClick('nextStep')" v-if="form.checkResult==0">下一步</view>
  133. <view class="bottom_btn" @click="handleClick('submitForm')" v-if="form.checkResult==1">提交</view>
  134. </view>
  135. </template>
  136. <script>
  137. import { config } from '@/api/request/config.js'
  138. import { buildBySub,listDepartments,subjectList,getCheckPlanBySubId,checkManageUpdate,checkManageAdd,findCheckManage,getBuildingList} from '@/api/index.js'
  139. export default {
  140. name: "rectifyList",
  141. components: {
  142. },
  143. data() {
  144. return {
  145. id:'',
  146. pageType:0,
  147. //列表请求参数
  148. getData:{
  149. pageNum:1,
  150. pageSize:20,
  151. },
  152. customTitle:'',
  153. form:{
  154. id:'',
  155. checkPlanId:'',
  156. manageStatus:'',//保存1 提交2
  157. subIds:'',//实验室
  158. subjectName:'',
  159. title:'',//计划标题
  160. deptId:'',//学院
  161. collegeName:'',
  162. buildId:'',//楼栋
  163. buildName:'',
  164. roomNumber:'',//房间号
  165. checkType:'',// 检查类型(1校院巡查 2实验室自查)
  166. checkResult:1,// 检查结果 0不符合 1符合
  167. rectifyDeadline:'',//整改期限
  168. rectifyNotice:'1',//整改通知(1整改告知书 2整改通知书)
  169. cycleStartTime:'',
  170. cycleEndTime:'',
  171. checkHazardDtoList:[
  172. {
  173. voiceRemark:[],//语音备忘存储
  174. hazardLevel:2,//隐患等级
  175. hazardLevelName:'一般隐患',//隐患等级
  176. hazardCheckCode:'', //检查项目code序号
  177. hazardCheckName:'', //检查项目名称
  178. hazardCheckPro:'', //最后一级的id
  179. hazardCheckPoint:'',// 检查要点
  180. hazardDescribe:'', //隐患描述
  181. uploadDtoList:[],//隐患照片
  182. }
  183. ],
  184. },
  185. collegeIndex :0,
  186. collegeArray:[],
  187. categoryIndex :0,
  188. categoryArray:['校院巡查','实验室自查'],
  189. planIndex :0,
  190. planArray:[],
  191. planList:[],
  192. resultIndex :0,
  193. resultArray:['符合','不符合'],
  194. informIndex:0,
  195. informArray:['整改告知书','整改通知书'],
  196. //房间弹层 状态
  197. popupType:false,
  198. //房间搜索字段
  199. room:"",
  200. roomList:[],
  201. item:{},
  202. isCustom:true,
  203. buildingArray:[],
  204. buildingList:[],
  205. //扫一扫进入
  206. laboratoryList:[],
  207. currentDate:'',//当前日期
  208. }
  209. },
  210. onLoad(option) {
  211. //通过微信扫一扫进入
  212. if(option.q){
  213. let text = decodeURIComponent(option.q)
  214. console.log('text',text)
  215. let codeId = "";
  216. let newList = text.split("?")[1].split("&")
  217. let list = newList[0].split("=")[1].split("-")
  218. codeId = list[0];
  219. uni.showToast({
  220. title: codeId,
  221. icon:"none",
  222. mask:true,
  223. duration: 2000
  224. });
  225. this.form.subIds=codeId
  226. this.getCheckPlanBySubId(codeId)
  227. this.getByIdLaboratoryList();
  228. }
  229. if(option.id){
  230. this.id=option.id
  231. this.findCheckManage()
  232. }
  233. if(option.form){
  234. this.form=JSON.parse(decodeURIComponent(option.form));
  235. }
  236. //通过实验室id查询计划
  237. if(option.subId){
  238. this.form.subIds=option.subId
  239. this.getCheckPlanBySubId(option.subId)
  240. this.getByIdLaboratoryList();
  241. }
  242. },
  243. onShow() {
  244. },
  245. mounted(){
  246. //获取当前日期
  247. this.currentDate=this.getNowFormatDate()
  248. this.listDepartments();
  249. },
  250. methods: {
  251. //滚动事件
  252. scrollGet(){},
  253. handleClick(doType){
  254. let self=this;
  255. if(!this.form.subIds){
  256. uni.showToast({
  257. title: '请选择实验室!',
  258. icon:"none",
  259. mask:true,
  260. duration: 2000
  261. });
  262. return
  263. }
  264. if(!this.form.deptId){
  265. uni.showToast({
  266. title: '请选择学院!',
  267. icon:"none",
  268. mask:true,
  269. duration: 2000
  270. });
  271. return
  272. }
  273. if(!this.form.buildId){
  274. uni.showToast({
  275. title: '请选择楼栋!',
  276. icon:"none",
  277. mask:true,
  278. duration: 2000
  279. });
  280. return
  281. }
  282. if(!this.form.title){
  283. if(!this.isCustom){
  284. uni.showToast({
  285. title: '请输入计划标题!',
  286. icon:"none",
  287. mask:true,
  288. duration: 2000
  289. });
  290. }else{
  291. uni.showToast({
  292. title: '请选择计划标题!',
  293. icon:"none",
  294. mask:true,
  295. duration: 2000
  296. });
  297. }
  298. return
  299. }
  300. if(!this.form.cycleStartTime || !this.form.cycleEndTime){
  301. uni.showToast({
  302. title: '请选择计划周期!',
  303. icon:"none",
  304. mask:true,
  305. duration: 2000
  306. });
  307. return
  308. }
  309. if(this.currentDate<this.form.cycleStartTime){
  310. uni.showToast({
  311. title: '当前时间不在计划周期内',
  312. icon:"none",
  313. mask:true,
  314. duration: 2000
  315. });
  316. return
  317. }
  318. if( doType=='nextStep'){//下一步
  319. if(!this.form.rectifyDeadline){
  320. uni.showToast({
  321. title: '整改日期不能为空!',
  322. icon:"none",
  323. mask:true,
  324. duration: 2000
  325. });
  326. return
  327. }
  328. uni.navigateTo({
  329. url: '/pages_safetyExamine/examineManage/examineAddTow?form='+encodeURIComponent(JSON.stringify(this.form))
  330. });
  331. }else if(doType=='submitForm'){
  332. self.submitForm()
  333. }
  334. },
  335. customFun(){
  336. let self=this;
  337. self.isCustom=!self.isCustom
  338. if(self.isCustom){//自定义
  339. if(self.planArray.length<=0){
  340. uni.showToast({
  341. title: '该实验室暂无可选择计划!',
  342. icon:"none",
  343. mask:true,
  344. duration: 2000
  345. });
  346. return
  347. }
  348. self.form.title='';
  349. self.form.checkType='';
  350. self.form.cycleStartTime='';
  351. self.form.cycleEndTime='';
  352. }else{//选择计划
  353. self.form.title='';
  354. self.form.cycleStartTime='';
  355. self.form.cycleEndTime='';
  356. self.form.checkType=2;
  357. self.$refs.popup.open()
  358. }
  359. },
  360. titleCancel(){
  361. let self=this;
  362. self.$refs.popup.close()
  363. },
  364. titleConfirm(){
  365. let self=this;
  366. this.form.title=this.customTitle;
  367. self.$refs.popup.close()
  368. },
  369. //开始时间选中事件
  370. startChange(form,e){
  371. if(new Date(e.target.value).getTime()>new Date(form.cycleEndTime).getTime()){
  372. uni.showToast({
  373. title: '结束时间不能小于开始时间',
  374. icon:"none",
  375. mask:true,
  376. duration: 2000
  377. });
  378. }else{
  379. form.cycleStartTime=e.target.value
  380. }
  381. console.log(e.target.value)
  382. console.log(form.cycleStartTime)
  383. },
  384. //结束时间选中事件
  385. endChange(form,e){
  386. if(new Date(form.cycleStartTime).getTime()>new Date(e.target.value).getTime()){
  387. uni.showToast({
  388. title: '结束时间不能小于开始时间',
  389. icon:"none",
  390. mask:true,
  391. duration: 2000
  392. });
  393. }else{
  394. form.cycleEndTime=e.target.value
  395. }
  396. },
  397. //获取当前日期函数
  398. getNowFormatDate() {
  399. let date = new Date(),
  400. year = date.getFullYear(), //获取完整的年份(4位)
  401. month = date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
  402. strDate = date.getDate() // 获取当前日(1-31)
  403. if (month < 10) month = `0${month}` // 如果月份是个位数,在前面补0
  404. if (strDate < 10) strDate = `0${strDate}` // 如果日是个位数,在前面补0
  405. return `${year}-${month}-${strDate}`
  406. },
  407. //详情
  408. async findCheckManage(){
  409. let _this = this;
  410. const {data} = await findCheckManage({id:this.id});
  411. if(data.code == 200){
  412. this.form.id=data.data.id;
  413. this.form.checkPlanId=data.data.checkPlanId;
  414. this.form.subIds=data.data.subId;
  415. this.form.subjectName=data.data.subjectName;
  416. this.form.title=data.data.title;
  417. this.form.deptId=data.data.deptId;
  418. this.form.collegeName=data.data.collegeName;
  419. this.form.buildId=data.data.buildId;
  420. this.form.buildName=data.data.buildName;
  421. this.form.checkType=data.data.checkType;
  422. this.form.roomNumber=data.data.roomNumber;
  423. this.form.checkResult=data.data.checkResult==null?'1':data.data.checkResult;
  424. this.form.rectifyDeadline=data.data.rectifyDeadline;
  425. this.form.rectifyNotice=data.data.rectifyNotice==null?'1':data.data.rectifyNotice;
  426. if(data.data.checkHazardDtoList.length>0){//隐患项
  427. this.form.checkHazardDtoList=data.data.checkHazardDtoList;
  428. //语音备注
  429. for(let i=0;i<this.form.checkHazardDtoList.length;i++){
  430. if(this.form.checkHazardDtoList[i].voiceRemark){
  431. this.form.checkHazardDtoList[i].voiceRemark=JSON.parse(this.form.checkHazardDtoList[i].voiceRemark)
  432. }else{
  433. this.form.checkHazardDtoList[i].voiceRemark=[];
  434. }
  435. }
  436. }else{
  437. this.form.checkHazardDtoList[0].voiceRemark=[];
  438. }
  439. //根据实验室id查询实验室计划
  440. if(data.data.subId){
  441. this.form.cycleStartTime=data.data.cycleStartTime;
  442. this.form.cycleEndTime=data.data.cycleEndTime;
  443. this.getCheckPlanBySubId(data.data.subId)
  444. }
  445. console.log(this.form)
  446. }
  447. },
  448. //查询学院列表
  449. async listDepartments(){
  450. let _this = this;
  451. const {data} = await listDepartments();
  452. if(data.code == 200){
  453. for(let i=0;i<data.data.length;i++){
  454. _this.collegeArray.push(data.data[i].deptName)
  455. }
  456. _this.collegeList=data.data;
  457. }
  458. },
  459. //根据实验室id查询该实验室有关计划
  460. async getCheckPlanBySubId(subId){
  461. let _this = this;
  462. _this.planArray=[];
  463. const {data} = await getCheckPlanBySubId({'subId':subId});
  464. if(data.code == 200){
  465. if(data.data.length>0){
  466. for(let i=0;i<data.data.length;i++){
  467. if(data.data[i].isSelfData==1){
  468. _this.planArray.push(data.data[i].title)
  469. _this.planList.push(data.data[i]);
  470. }
  471. }
  472. }else{
  473. _this.isCustom=false;
  474. _this.form.checkType=2;
  475. }
  476. }
  477. },
  478. //根据学院id查询楼栋
  479. async getBuildingList(deptId){
  480. let _this = this;
  481. const {data} = await getBuildingList(deptId);
  482. if(data.code == 200){
  483. console.log(_this.form.buildId)
  484. for(let i=0;i<data.data.length;i++){
  485. _this.buildingArray.push(data.data[i].deptName)
  486. if(_this.form.buildId==data.data[i].deptId){
  487. this.$set(this.form,"buildName",data.data[i].deptName)
  488. }
  489. }
  490. console.log(_this.form.buildName)
  491. _this.buildingList=data.data;
  492. }
  493. },
  494. //楼栋选中
  495. buildingChange(e){
  496. this.form.buildId=this.buildingList[e.target.value].deptId
  497. this.form.buildName=this.buildingList[e.target.value].deptName
  498. },
  499. //学院选中
  500. collegeChange(e){
  501. this.collegeIndex = e.target.value;
  502. this.form.deptId=this.collegeList[e.target.value].deptId
  503. this.form.collegeName=this.collegeList[e.target.value].deptName
  504. console.log()
  505. this.getBuildingList(this.form.deptId)
  506. },
  507. //检查类型
  508. categoryChange(e){
  509. this.categoryIndex = e.target.value;
  510. if(e.target.value==0){
  511. this.form.checkType=1
  512. }else if(e.target.value==1){
  513. this.form.checkType=2
  514. }
  515. },
  516. //计划
  517. planChange(e){
  518. this.planIndex = e.target.value;
  519. this.form.id=this.planList[e.target.value].id
  520. this.form.title=this.planList[e.target.value].title
  521. this.form.checkPlanId=this.planList[e.target.value].checkPlanId
  522. this.form.subIds=this.planList[e.target.value].subId;
  523. this.form.subjectName=this.planList[e.target.value].subjectName;
  524. this.form.deptId=this.planList[e.target.value].deptId;
  525. this.form.collegeName=this.planList[e.target.value].collegeName;
  526. this.form.buildId=this.planList[e.target.value].buildId;
  527. this.form.buildName=this.planList[e.target.value].buildName;
  528. this.form.checkType=this.planList[e.target.value].checkType;
  529. this.form.cycleStartTime=this.planList[e.target.value].cycleStartTime;
  530. this.form.cycleEndTime=this.planList[e.target.value].cycleEndTime;
  531. },
  532. resultChange(e){
  533. this.resultIndex = e.target.value;
  534. if(e.target.value==0){
  535. this.form.checkResult=1;
  536. }else if(e.target.value==1){
  537. this.form.checkResult=0;
  538. }
  539. },
  540. //开始时间选中事件
  541. rectifyDeadline(form,e){
  542. form.rectifyDeadline=e.target.value
  543. },
  544. //整改通知
  545. tabClick(index) {
  546. this.informIndex = index;
  547. if(index==0){
  548. this.rectifyNotice='1';
  549. }else if(index==1){
  550. this.rectifyNotice='2';
  551. }
  552. },
  553. //搜索房间弹层开关
  554. popupClick(type){
  555. if(type == 1){
  556. this.room = "";
  557. this.roomList = [];
  558. this.popupType = true;
  559. }else if(type == 2){
  560. this.popupType = false;
  561. }
  562. },
  563. //扫一扫进入通过id查询实验室列表
  564. async getByIdLaboratoryList(){
  565. let self = this;
  566. const {data} = await buildBySub({'searchValue':this.room});
  567. if(data.code==200){
  568. if(data.data[0]){
  569. this.laboratoryList = data.data;
  570. data.data.forEach(function(item){
  571. if(self.form.subIds==item.id){
  572. self.form.subjectName=item.name;
  573. self.form.deptId=item.deptId;
  574. self.form.buildId=item.buildId;
  575. self.form.roomNumber=item.room;
  576. }
  577. })
  578. //获取学院名称
  579. for(let i=0;i<this.collegeList.length;i++){
  580. if(this.collegeList[i].deptId==self.form.deptId){
  581. this.$set(this.form,"collegeName",this.collegeList[i].deptName)
  582. }
  583. }
  584. //请求楼栋数据
  585. this.getBuildingList(self.form.deptId)
  586. }
  587. }
  588. },
  589. //搜索房间接口
  590. async buildBySub(){
  591. let self = this;
  592. if(!this.room){
  593. uni.showToast({
  594. title: '请输入要搜索关键词',
  595. icon:"none",
  596. mask:true,
  597. duration: 2000
  598. });
  599. return
  600. }
  601. const {data} = await buildBySub({'searchValue':this.room});
  602. if(data.code==200){
  603. if(data.data[0]){
  604. this.roomList = data.data;
  605. }else{
  606. uni.showToast({
  607. title: '未找到相关实验室',
  608. icon:"none",
  609. mask:true,
  610. duration: 2000
  611. });
  612. }
  613. }
  614. },
  615. //确认搜索房间
  616. popupClickItem(item){
  617. this.$set(this.form,"subIds",item.id)
  618. this.$set(this.form,"subjectName",item.name)
  619. this.$set(this.form,"deptId",item.deptId)
  620. this.$set(this.form,"buildId",item.buildId)
  621. this.$set(this.form,"roomNumber",item.room)
  622. //获取学院名称
  623. for(let i=0;i<this.collegeList.length;i++){
  624. if(this.collegeList[i].deptId==item.deptId){
  625. this.$set(this.form,"collegeName",this.collegeList[i].deptName)
  626. }
  627. }
  628. //请求楼栋数据
  629. this.getBuildingList(item.deptId)
  630. this.popupType = false;
  631. this.getCheckPlanBySubId(item.id)
  632. },
  633. //调用摄像头
  634. saoCode(){
  635. let self = this;
  636. uni.scanCode({
  637. onlyFromCamera: true,
  638. success: function (res) {
  639. if(res.result.indexOf("code") != -1 && res.result.indexOf("-") != -1 && res.result.indexOf("&") != -1){
  640. let codeRoom = "";
  641. let newList = res.result.split("?")[1].split("&")
  642. let list = newList[0].split("=")[1].split("-")
  643. codeRoom = list[1];
  644. if(codeRoom){
  645. self.roomList = [];
  646. self.room = codeRoom;
  647. self.buildBySub();
  648. self.popupType = true;
  649. }else{
  650. uni.showToast({
  651. title: '请扫描正确的二维码',
  652. icon:"none",
  653. mask:true,
  654. duration: 2000
  655. });
  656. }
  657. }else{
  658. uni.showToast({
  659. title: '请扫描正确的二维码',
  660. icon:"none",
  661. mask:true,
  662. duration: 2000
  663. });
  664. }
  665. }
  666. });
  667. },
  668. //提交
  669. async submitForm(){
  670. let self = this;
  671. this.form.manageStatus=2;
  672. let obj=self.form;
  673. //复合的情况下,删除隐患项
  674. obj.checkHazardDtoList=[];
  675. if(self.form.id){
  676. const {data} = await checkManageUpdate(obj);
  677. if(data.code == 200){
  678. uni.showToast({
  679. title: '提交成功',
  680. icon:"none",
  681. mask:true,
  682. duration: 2000
  683. });
  684. uni.redirectTo({
  685. url: '/pages_safetyExamine/examineManage/examineList?pageType='+this.form.checkType
  686. });
  687. }
  688. }else{
  689. const {data} = await checkManageAdd(obj);
  690. if(data.code == 200){
  691. uni.showToast({
  692. title: '提交成功',
  693. icon:"none",
  694. mask:true,
  695. duration: 2000
  696. });
  697. uni.redirectTo({
  698. url: '/pages_safetyExamine/examineManage/examineList?pageType='+this.form.checkType
  699. });
  700. }
  701. }
  702. },
  703. }
  704. }
  705. </script>
  706. <style lang="stylus" scoped>
  707. .examine{
  708. height:100%;
  709. display flex;
  710. box-sizing: border-box;
  711. .info-max-box{
  712. flex: 1;
  713. overflow: scroll;
  714. padding: 20rpx 0rpx 128rpx;
  715. box-sizing: border-box;
  716. }
  717. .basics{
  718. margin: 0 30rpx;
  719. width: 690rpx;
  720. height: 740rpx;
  721. background: #FFFFFF;
  722. border-radius: 20rpx;
  723. padding: 30rpx 28rpx 0;
  724. box-sizing: border-box;
  725. .basics_li{
  726. display: flex;
  727. justify-content: flex-start;
  728. margin-bottom: 24rpx;
  729. .basics_li_l{
  730. width: 146rpx;
  731. text-align: left;
  732. font-size: 30rpx;
  733. font-family: PingFang SC-Medium, PingFang SC;
  734. font-weight: 400;
  735. color: #333333;
  736. line-height: 80rpx;
  737. }
  738. .basics_li_r{
  739. width: 486rpx;
  740. height: 80rpx;
  741. border-radius: 10rpx;
  742. opacity: 1;
  743. border: 1rpx solid #E0E0E0;
  744. padding-left: 20rpx;
  745. box-sizing: border-box;
  746. }
  747. /* 学院 */
  748. .college_r{
  749. width: 486rpx;
  750. height: 80rpx;
  751. border-radius: 10rpx;
  752. border: 1rpx solid #E0E0E0;
  753. display: flex;
  754. justify-content: flex-start;
  755. align-items: center;
  756. >view{
  757. flex:1;
  758. line-height:80rpx;
  759. font-size: 30rpx;
  760. font-family: PingFang SC-Medium, PingFang SC;
  761. font-weight: 400;
  762. color: #333333;
  763. line-height: 80rpx;
  764. white-space: nowrap;
  765. overflow: hidden;
  766. text-overflow: ellipsis;
  767. }
  768. >img{
  769. width: 14rpx;
  770. height: 8rpx;
  771. margin-right: 30rpx;
  772. }
  773. }
  774. /* 实验室 */
  775. .lab_r{
  776. width: 486rpx;
  777. height: 80rpx;
  778. display: flex;
  779. justify-content: flex-start;
  780. .picker-text{
  781. width: 438rpx;
  782. height: 80rpx;
  783. }
  784. .img-box{
  785. width: 48rpx;
  786. >img{
  787. width:30rpx;
  788. height:28rpx;
  789. margin:26rpx 18rpx 0 0;
  790. }
  791. }
  792. }
  793. /* 楼栋 */
  794. .building_r{
  795. width: 486rpx;
  796. height: 80rpx;
  797. >input{
  798. height: 80rpx;
  799. font-size: 30rpx;
  800. font-family: PingFang SC-Medium, PingFang SC;
  801. font-weight: 400;
  802. color: #333333;
  803. line-height: 80rpx;
  804. }
  805. }
  806. }
  807. .period{
  808. display: flex;
  809. justify-content: flex-start;
  810. align-items: center;
  811. margin-bottom: 24rpx;
  812. .period_l{
  813. width: 146rpx;
  814. font-size: 30rpx;
  815. font-family: PingFang SC-Medium, PingFang SC;
  816. font-weight: 400;
  817. color: #333333;
  818. line-height: 42rpx;
  819. text-align: left;
  820. }
  821. .period_r{
  822. width: 490rpx;
  823. height: 80rpx;
  824. border-radius: 10rpx;
  825. border: 1rpx solid #E0E0E0;
  826. display: flex;
  827. justify-content: flex-start;
  828. align-items: center;
  829. .picker-text{
  830. font-size: 30rpx;
  831. font-family: PingFang SC-Medium, PingFang SC;
  832. font-weight: 400;
  833. color: #333;
  834. line-height: 80rpx;
  835. width: 230rpx;
  836. text-align: center;
  837. }
  838. .picker-text2{
  839. font-size: 30rpx;
  840. font-family: PingFang SC-Medium, PingFang SC;
  841. font-weight: 400;
  842. color: #333;
  843. line-height: 80rpx;
  844. width: 230rpx;
  845. text-align: center;
  846. }
  847. }
  848. }
  849. .custom{
  850. width: 150rpx;
  851. height: 60rpx;
  852. border-radius: 10rpx 10rpx 10rpx 10rpx;
  853. opacity: 1;
  854. border: 1rpx solid #0183FA;
  855. font-size: 26rpx;
  856. font-family: PingFang SC-Medium, PingFang SC;
  857. font-weight: 400;
  858. color: #0183FA;
  859. line-height: 60rpx;
  860. text-align: center;
  861. float: right;
  862. }
  863. }
  864. .attachment{
  865. width: 690rpx;
  866. background: #FFFFFF;
  867. border-radius: 20rpx;
  868. margin: 20rpx 30rpx 0;
  869. padding-bottom: 32rpx;
  870. box-sizing: border-box;
  871. .attachment_t{
  872. border-bottom: 1rpx solid #D8D8D8;
  873. >text:nth-of-type(1){
  874. font-size: 30rpx;
  875. font-family: PingFang SC-Medium, PingFang SC;
  876. font-weight: 400;
  877. color: #333333;
  878. line-height: 110rpx;
  879. margin-left: 28rpx;
  880. }
  881. >text:nth-of-type(2){
  882. font-size: 30rpx;
  883. font-family: PingFang SC-Medium, PingFang SC;
  884. font-weight: 400;
  885. color: #999999;
  886. line-height: 110rpx;
  887. margin-left: 24rpx;
  888. }
  889. }
  890. .attachment_li{
  891. height: 40rpx;
  892. display: flex;
  893. justify-content: flex-start;
  894. align-items: center;
  895. margin-top: 32rpx;
  896. >img{
  897. width: 30rpx;
  898. height: 26rpx;
  899. margin-right: 20rpx;
  900. margin-left: 50rpx;
  901. }
  902. >text{
  903. flex: 1;
  904. font-size: 28rpx;
  905. font-family: PingFang SC-Medium, PingFang SC;
  906. font-weight: 400;
  907. color: #0183FA;
  908. line-height: 40rpx;
  909. white-space: nowrap;
  910. overflow: hidden;
  911. text-overflow: ellipsis;
  912. }
  913. .attachment_li_del{
  914. width: 30rpx;
  915. height: 30rpx;
  916. }
  917. }
  918. }
  919. .inspect{
  920. margin: 20rpx 30rpx 0;
  921. width: 690rpx;
  922. height: auto;
  923. background: #FFFFFF;
  924. border-radius: 20rpx;
  925. padding: 40rpx 28rpx 20rpx;
  926. box-sizing: border-box;
  927. .inspect_li{
  928. display: flex;
  929. justify-content: flex-start;
  930. margin-bottom: 24rpx;
  931. .inspect_li_l{
  932. width: 146rpx;
  933. text-align: left;
  934. font-size: 30rpx;
  935. font-family: PingFang SC-Medium, PingFang SC;
  936. font-weight: 400;
  937. color: #333333;
  938. line-height: 80rpx;
  939. }
  940. .inspect_li_r{
  941. width: 486rpx;
  942. height: 80rpx;
  943. border-radius: 10rpx;
  944. opacity: 1;
  945. border: 1rpx solid #E0E0E0;
  946. padding-left: 20rpx;
  947. box-sizing: border-box;
  948. }
  949. .college_r{
  950. width: 486rpx;
  951. height: 80rpx;
  952. border-radius: 10rpx;
  953. border: 1rpx solid #E0E0E0;
  954. display: flex;
  955. justify-content: flex-start;
  956. align-items: center;
  957. >view{
  958. flex:1;
  959. line-height:80rpx;
  960. font-size: 30rpx;
  961. font-family: PingFang SC-Medium, PingFang SC;
  962. font-weight: 400;
  963. color: #333333;
  964. line-height: 80rpx;
  965. }
  966. >img{
  967. width: 14rpx;
  968. height: 8rpx;
  969. margin-right: 30rpx;
  970. }
  971. }
  972. /* 整改日期 */
  973. .date_r{
  974. width: 486rpx;
  975. height: 80rpx;
  976. display: flex;
  977. justify-content: flex-start;
  978. .picker-text{
  979. width: 438rpx;
  980. height: 80rpx;
  981. }
  982. >img{
  983. width:30rpx;
  984. height:28rpx;
  985. margin:16rpx 18rpx 0 0;
  986. }
  987. }
  988. /* 整改通知 */
  989. .inform_r{
  990. width: 486rpx;
  991. height: 80rpx;
  992. padding-left: 20rpx;
  993. box-sizing: border-box;
  994. display: flex;
  995. justify-content: flex-start;
  996. align-items: center;
  997. >view{
  998. display: flex;
  999. justify-content: flex-start;
  1000. align-items: center;
  1001. margin-right: 24rpx;
  1002. .inform_r_l{
  1003. display: inline-block;
  1004. width: 30rpx;
  1005. height: 30rpx;
  1006. border-radius: 50%;
  1007. border: 1rpx solid #E0E0E0;
  1008. margin-right: 14rpx;
  1009. }
  1010. .inform_r_r{
  1011. font-size: 30rpx;
  1012. font-family: PingFang SC-Medium, PingFang SC;
  1013. font-weight: 400;
  1014. color: #333333;
  1015. line-height: 80rpx;
  1016. }
  1017. .checked{
  1018. display: inline-block;
  1019. width: 30rpx;
  1020. height: 30rpx;
  1021. border-radius: 50%;
  1022. border: 1rpx solid #0183FA;
  1023. margin-right: 14rpx;
  1024. position: relative;
  1025. }
  1026. .checked::after{
  1027. content: '';
  1028. position: absolute;
  1029. top: 5rpx;
  1030. left:5rpx;
  1031. width: 20rpx;
  1032. height: 20rpx;
  1033. border-radius: 50%;
  1034. background: #0183FA;
  1035. }
  1036. }
  1037. }
  1038. }
  1039. }
  1040. .popup-max-box{
  1041. z-index:10;
  1042. height:100%;
  1043. width:100%;
  1044. position fixed;
  1045. background rgba(0,0,0,0.2)
  1046. display flex;
  1047. flex-direction column
  1048. .popup-null{
  1049. flex:1;
  1050. }
  1051. .popup-big-box{
  1052. border-top-left-radius:20rpx;
  1053. border-top-right-radius:20rpx;
  1054. background #fff
  1055. .popup-input-box{
  1056. padding:30rpx 20rpx;
  1057. display:flex;
  1058. input{
  1059. flex:1;
  1060. height:70rpx;
  1061. border:1rpx solid #e0e0e0;
  1062. border-radius:10rpx;
  1063. margin-right:20rpx;
  1064. padding:0 20rpx;
  1065. }
  1066. view{
  1067. background #0183FA
  1068. color:#fff;
  1069. border-radius:10rpx;
  1070. width:140rpx;
  1071. line-height:70rpx;
  1072. text-align center;
  1073. font-size:28rpx;
  1074. }
  1075. }
  1076. .popup-for-max-box{
  1077. margin:0 20rpx 30rpx;
  1078. height:600rpx;
  1079. overflow-y scroll;
  1080. .popup-for-null{
  1081. line-height:100rpx;
  1082. text-align center
  1083. color:#999;
  1084. }
  1085. .popup-for-box{
  1086. display:flex;
  1087. padding:10px 0;
  1088. .name-p{
  1089. flex:1;
  1090. line-height:60rpx;
  1091. }
  1092. .button-p{
  1093. background #0183FA
  1094. color:#fff;
  1095. text-align center
  1096. width:100rpx;
  1097. line-height:60rpx;
  1098. height:60rpx;
  1099. border-radius:10rpx;
  1100. }
  1101. }
  1102. }
  1103. }
  1104. }
  1105. /* 计划标题 */
  1106. .inspect_name{
  1107. .popup-content{
  1108. width: 750rpx;
  1109. height: 350rpx;
  1110. background: #FFFFFF;
  1111. border-radius: 10rpx 10rpx 0px 0px;
  1112. padding :0 50rpx;
  1113. box-sizing :border-box;
  1114. overflow :hidden;
  1115. .inspect_name_t{
  1116. margin-top:66rpx;
  1117. padding: 0 30rpx;
  1118. box-sizing: border-box;
  1119. >input{
  1120. width:100%;
  1121. height:80rpx;
  1122. border: 2rpx solid #E0E0E0;
  1123. color:#A2A2A2;
  1124. font-size:28rpx;
  1125. line-height 80rpx
  1126. border-radius:10rpx;
  1127. padding: 0 20rpx;
  1128. box-sizing: border-box;
  1129. }
  1130. }
  1131. .inspect_name_b{
  1132. margin-top :64rpx;
  1133. display: flex;
  1134. justify-content: center;
  1135. >text:nth-of-type(1){
  1136. width: 160rpx;
  1137. height: 60rpx;
  1138. border-radius: 40rpx;
  1139. font-size: 30rpx;
  1140. font-family: PingFang SC;
  1141. font-weight: 500;
  1142. color: #333333;
  1143. line-height: 60rpx;
  1144. text-align :center;
  1145. margin-right: 120rpx;
  1146. border: 2rpx solid #e0e0e0;
  1147. }
  1148. >text:nth-of-type(2){
  1149. width: 160rpx;
  1150. height: 60rpx;
  1151. background: linear-gradient(-35deg, #309CFF, #0183FA);
  1152. border-radius: 40rpx;
  1153. font-size: 30rpx;
  1154. font-family: PingFang SC;
  1155. font-weight: 500;
  1156. color: #FFFFFF;
  1157. line-height: 60rpx;
  1158. text-align :center;
  1159. }
  1160. }
  1161. }
  1162. }
  1163. .bottom_btn{
  1164. position: fixed;
  1165. bottom: 26rpx;
  1166. left: 30rpx;
  1167. font-size: 30rpx;
  1168. font-family: PingFang SC-Medium, PingFang SC;
  1169. font-weight: 400;
  1170. color: #FFFFFF;
  1171. line-height: 90rpx;
  1172. width: 690rpx;
  1173. height: 90rpx;
  1174. background: #0183FA;
  1175. border-radius: 20rpx;
  1176. text-align: center;
  1177. }
  1178. }
  1179. </style>