examineAdd.vue 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168
  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="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.rectifyDeadline){
  256. uni.showToast({
  257. title: '整改日期不能为空!',
  258. icon:"none",
  259. mask:true,
  260. duration: 2000
  261. });
  262. return
  263. }
  264. if( doType=='nextStep'){//下一步
  265. uni.navigateTo({
  266. url: '/pages_safetyExamine/examineManage/examineAddTow?form='+encodeURIComponent(JSON.stringify(this.form))
  267. });
  268. }
  269. },
  270. customFun(){
  271. let self=this;
  272. self.isCustom=!self.isCustom
  273. if(self.isCustom){//自定义
  274. if(self.planArray.length<=0){
  275. uni.showToast({
  276. title: '该实验室暂无可选择计划!',
  277. icon:"none",
  278. mask:true,
  279. duration: 2000
  280. });
  281. return
  282. }
  283. self.form.title='';
  284. self.form.checkType='';
  285. self.form.cycleStartTime='';
  286. self.form.cycleEndTime='';
  287. }else{//选择计划
  288. self.form.title='';
  289. self.form.cycleStartTime='';
  290. self.form.cycleEndTime='';
  291. self.form.checkType=2;
  292. self.$refs.popup.open()
  293. }
  294. },
  295. titleCancel(){
  296. let self=this;
  297. self.$refs.popup.close()
  298. },
  299. titleConfirm(){
  300. let self=this;
  301. this.form.title=this.customTitle;
  302. self.$refs.popup.close()
  303. },
  304. //开始时间选中事件
  305. startChange(form,e){
  306. if(new Date(e.target.value).getTime()>new Date(form.cycleEndTime).getTime()){
  307. uni.showToast({
  308. title: '结束时间不能小于开始时间',
  309. icon:"none",
  310. mask:true,
  311. duration: 2000
  312. });
  313. }else{
  314. form.cycleStartTime=e.target.value
  315. }
  316. console.log(e.target.value)
  317. console.log(form.cycleStartTime)
  318. },
  319. //结束时间选中事件
  320. endChange(form,e){
  321. if(new Date(form.cycleStartTime).getTime()>new Date(e.target.value).getTime()){
  322. uni.showToast({
  323. title: '结束时间不能小于开始时间',
  324. icon:"none",
  325. mask:true,
  326. duration: 2000
  327. });
  328. }else{
  329. form.cycleEndTime=e.target.value
  330. }
  331. },
  332. //获取当前日期函数
  333. getNowFormatDate() {
  334. let date = new Date(),
  335. year = date.getFullYear(), //获取完整的年份(4位)
  336. month = date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
  337. strDate = date.getDate() // 获取当前日(1-31)
  338. if (month < 10) month = `0${month}` // 如果月份是个位数,在前面补0
  339. if (strDate < 10) strDate = `0${strDate}` // 如果日是个位数,在前面补0
  340. return `${year}-${month}-${strDate}`
  341. },
  342. //详情
  343. async findCheckManage(){
  344. let _this = this;
  345. const {data} = await findCheckManage({id:this.id});
  346. if(data.code == 200){
  347. this.form.id=data.data.id;
  348. this.form.checkPlanId=data.data.checkPlanId;
  349. this.form.subIds=data.data.subId;
  350. this.form.subjectName=data.data.subjectName;
  351. this.form.title=data.data.title;
  352. this.form.deptId=data.data.deptId;
  353. this.form.collegeName=data.data.collegeName;
  354. this.form.buildId=data.data.buildId;
  355. this.form.buildName=data.data.buildName;
  356. this.form.checkType=data.data.checkType;
  357. this.form.roomNumber=data.data.roomNumber;
  358. this.form.checkResult=data.data.checkResult==null?'1':data.data.checkResult;
  359. this.form.rectifyDeadline=data.data.rectifyDeadline;
  360. this.form.rectifyNotice=data.data.rectifyNotice==null?'1':data.data.rectifyNotice;
  361. if(data.data.checkHazardDtoList.length>0){//隐患项
  362. this.form.checkHazardDtoList=data.data.checkHazardDtoList;
  363. //语音备注
  364. for(let i=0;i<this.form.checkHazardDtoList.length;i++){
  365. if(this.form.checkHazardDtoList[i].voiceRemark){
  366. this.form.checkHazardDtoList[i].voiceRemark=JSON.parse(this.form.checkHazardDtoList[i].voiceRemark)
  367. }else{
  368. this.form.checkHazardDtoList[i].voiceRemark=[];
  369. }
  370. }
  371. }else{
  372. this.form.checkHazardDtoList[0].voiceRemark=[];
  373. }
  374. //根据实验室id查询实验室计划
  375. if(data.data.subId){
  376. this.form.cycleStartTime=data.data.cycleStartTime;
  377. this.form.cycleEndTime=data.data.cycleEndTime;
  378. this.getCheckPlanBySubId(data.data.subId)
  379. }
  380. console.log(this.form)
  381. }
  382. },
  383. //查询学院列表
  384. async listDepartments(){
  385. let _this = this;
  386. const {data} = await listDepartments();
  387. if(data.code == 200){
  388. for(let i=0;i<data.data.length;i++){
  389. _this.collegeArray.push(data.data[i].deptName)
  390. }
  391. _this.collegeList=data.data;
  392. }
  393. },
  394. //根据实验室id查询该实验室有关计划
  395. async getCheckPlanBySubId(subId){
  396. let _this = this;
  397. _this.planArray=[];
  398. const {data} = await getCheckPlanBySubId({'subId':subId});
  399. if(data.code == 200){
  400. if(data.data.length>0){
  401. for(let i=0;i<data.data.length;i++){
  402. if(data.data[i].isSelfData==1){
  403. _this.planArray.push(data.data[i].title)
  404. _this.planList.push(data.data[i]);
  405. }
  406. }
  407. }else{
  408. _this.isCustom=false;
  409. _this.form.checkType=2;
  410. }
  411. }
  412. },
  413. //根据学院id查询楼栋
  414. async getBuildingList(deptId){
  415. let _this = this;
  416. const {data} = await getBuildingList(deptId);
  417. if(data.code == 200){
  418. console.log(_this.form.buildId)
  419. for(let i=0;i<data.data.length;i++){
  420. _this.buildingArray.push(data.data[i].deptName)
  421. if(_this.form.buildId==data.data[i].deptId){
  422. this.$set(this.form,"buildName",data.data[i].deptName)
  423. }
  424. }
  425. console.log(_this.form.buildName)
  426. _this.buildingList=data.data;
  427. }
  428. },
  429. //楼栋选中
  430. buildingChange(e){
  431. this.form.buildId=this.buildingList[e.target.value].deptId
  432. this.form.buildName=this.buildingList[e.target.value].deptName
  433. },
  434. //学院选中
  435. collegeChange(e){
  436. this.collegeIndex = e.target.value;
  437. this.form.deptId=this.collegeList[e.target.value].deptId
  438. this.form.collegeName=this.collegeList[e.target.value].deptName
  439. console.log()
  440. this.getBuildingList(this.form.deptId)
  441. },
  442. //检查类型
  443. categoryChange(e){
  444. this.categoryIndex = e.target.value;
  445. if(e.target.value==0){
  446. this.form.checkType=1
  447. }else if(e.target.value==1){
  448. this.form.checkType=2
  449. }
  450. },
  451. //计划
  452. planChange(e){
  453. this.planIndex = e.target.value;
  454. this.form.id=this.planList[e.target.value].id
  455. this.form.title=this.planList[e.target.value].title
  456. this.form.checkPlanId=this.planList[e.target.value].checkPlanId
  457. this.form.subIds=this.planList[e.target.value].subId;
  458. this.form.subjectName=this.planList[e.target.value].subjectName;
  459. this.form.deptId=this.planList[e.target.value].deptId;
  460. this.form.collegeName=this.planList[e.target.value].collegeName;
  461. this.form.buildId=this.planList[e.target.value].buildId;
  462. this.form.buildName=this.planList[e.target.value].buildName;
  463. this.form.checkType=this.planList[e.target.value].checkType;
  464. this.form.cycleStartTime=this.planList[e.target.value].cycleStartTime;
  465. this.form.cycleEndTime=this.planList[e.target.value].cycleEndTime;
  466. },
  467. resultChange(e){
  468. this.resultIndex = e.target.value;
  469. if(e.target.value==0){
  470. this.form.checkResult=1;
  471. }else if(e.target.value==1){
  472. this.form.checkResult=0;
  473. }
  474. },
  475. //开始时间选中事件
  476. rectifyDeadline(form,e){
  477. form.rectifyDeadline=e.target.value
  478. },
  479. //整改通知
  480. tabClick(index) {
  481. this.informIndex = index;
  482. if(index==0){
  483. this.rectifyNotice='1';
  484. }else if(index==1){
  485. this.rectifyNotice='2';
  486. }
  487. },
  488. //搜索房间弹层开关
  489. popupClick(type){
  490. if(type == 1){
  491. this.room = "";
  492. this.roomList = [];
  493. this.popupType = true;
  494. }else if(type == 2){
  495. this.popupType = false;
  496. }
  497. },
  498. //扫一扫进入通过id查询实验室列表
  499. async getByIdLaboratoryList(){
  500. let self = this;
  501. const {data} = await buildBySub({'searchValue':this.room});
  502. if(data.code==200){
  503. if(data.data[0]){
  504. this.laboratoryList = data.data;
  505. data.data.forEach(function(item){
  506. if(self.form.subIds==item.id){
  507. self.form.subjectName=item.name;
  508. self.form.deptId=item.deptId;
  509. self.form.buildId=item.buildId;
  510. self.form.roomNumber=item.room;
  511. }
  512. })
  513. //获取学院名称
  514. for(let i=0;i<this.collegeList.length;i++){
  515. if(this.collegeList[i].deptId==self.form.deptId){
  516. this.$set(this.form,"collegeName",this.collegeList[i].deptName)
  517. }
  518. }
  519. //请求楼栋数据
  520. this.getBuildingList(self.form.deptId)
  521. }
  522. }
  523. },
  524. //搜索房间接口
  525. async buildBySub(){
  526. let self = this;
  527. if(!this.room){
  528. uni.showToast({
  529. title: '请输入要搜索关键词',
  530. icon:"none",
  531. mask:true,
  532. duration: 2000
  533. });
  534. return
  535. }
  536. const {data} = await buildBySub({'searchValue':this.room});
  537. if(data.code==200){
  538. if(data.data[0]){
  539. this.roomList = data.data;
  540. }else{
  541. uni.showToast({
  542. title: '未找到相关实验室',
  543. icon:"none",
  544. mask:true,
  545. duration: 2000
  546. });
  547. }
  548. }
  549. },
  550. //确认搜索房间
  551. popupClickItem(item){
  552. this.$set(this.form,"subIds",item.id)
  553. this.$set(this.form,"subjectName",item.name)
  554. this.$set(this.form,"deptId",item.deptId)
  555. this.$set(this.form,"buildId",item.buildId)
  556. this.$set(this.form,"roomNumber",item.room)
  557. //获取学院名称
  558. for(let i=0;i<this.collegeList.length;i++){
  559. if(this.collegeList[i].deptId==item.deptId){
  560. this.$set(this.form,"collegeName",this.collegeList[i].deptName)
  561. }
  562. }
  563. //请求楼栋数据
  564. this.getBuildingList(item.deptId)
  565. this.popupType = false;
  566. this.getCheckPlanBySubId(item.id)
  567. },
  568. //调用摄像头
  569. saoCode(){
  570. let self = this;
  571. uni.scanCode({
  572. onlyFromCamera: true,
  573. success: function (res) {
  574. if(res.result.indexOf("code") != -1 && res.result.indexOf("-") != -1 && res.result.indexOf("&") != -1){
  575. let codeRoom = "";
  576. let newList = res.result.split("?")[1].split("&")
  577. let list = newList[0].split("=")[1].split("-")
  578. codeRoom = list[1];
  579. if(codeRoom){
  580. self.roomList = [];
  581. self.room = codeRoom;
  582. self.buildBySub();
  583. self.popupType = true;
  584. }else{
  585. uni.showToast({
  586. title: '请扫描正确的二维码',
  587. icon:"none",
  588. mask:true,
  589. duration: 2000
  590. });
  591. }
  592. }else{
  593. uni.showToast({
  594. title: '请扫描正确的二维码',
  595. icon:"none",
  596. mask:true,
  597. duration: 2000
  598. });
  599. }
  600. }
  601. });
  602. },
  603. //提交
  604. async submitForm(){
  605. let self = this;
  606. if(this.currentDate<this.form.cycleStartTime){
  607. uni.showToast({
  608. title: '当前时间不在计划周期内',
  609. icon:"none",
  610. mask:true,
  611. duration: 2000
  612. });
  613. return
  614. }
  615. this.form.manageStatus=2;
  616. let obj=self.form;
  617. //复合的情况下,删除隐患项
  618. obj.checkHazardDtoList=[];
  619. if(self.form.id){
  620. const {data} = await checkManageUpdate(obj);
  621. if(data.code == 200){
  622. uni.showToast({
  623. title: '提交成功',
  624. icon:"none",
  625. mask:true,
  626. duration: 2000
  627. });
  628. uni.redirectTo({
  629. url: '/pages_safetyExamine/examineManage/examineList?pageType='+this.form.checkType
  630. });
  631. }
  632. }else{
  633. const {data} = await checkManageAdd(obj);
  634. if(data.code == 200){
  635. uni.showToast({
  636. title: '提交成功',
  637. icon:"none",
  638. mask:true,
  639. duration: 2000
  640. });
  641. uni.redirectTo({
  642. url: '/pages_safetyExamine/examineManage/examineList?pageType='+this.form.checkType
  643. });
  644. }
  645. }
  646. },
  647. }
  648. }
  649. </script>
  650. <style lang="stylus" scoped>
  651. .examine{
  652. height:100%;
  653. display flex;
  654. box-sizing: border-box;
  655. .info-max-box{
  656. flex: 1;
  657. overflow: scroll;
  658. padding: 20rpx 0rpx 128rpx;
  659. box-sizing: border-box;
  660. }
  661. .basics{
  662. margin: 0 30rpx;
  663. width: 690rpx;
  664. height: 740rpx;
  665. background: #FFFFFF;
  666. border-radius: 20rpx;
  667. padding: 30rpx 28rpx 0;
  668. box-sizing: border-box;
  669. .basics_li{
  670. display: flex;
  671. justify-content: flex-start;
  672. margin-bottom: 24rpx;
  673. .basics_li_l{
  674. width: 146rpx;
  675. text-align: left;
  676. font-size: 30rpx;
  677. font-family: PingFang SC-Medium, PingFang SC;
  678. font-weight: 400;
  679. color: #333333;
  680. line-height: 80rpx;
  681. }
  682. .basics_li_r{
  683. width: 486rpx;
  684. height: 80rpx;
  685. border-radius: 10rpx;
  686. opacity: 1;
  687. border: 1rpx solid #E0E0E0;
  688. padding-left: 20rpx;
  689. box-sizing: border-box;
  690. }
  691. /* 学院 */
  692. .college_r{
  693. width: 486rpx;
  694. height: 80rpx;
  695. border-radius: 10rpx;
  696. border: 1rpx solid #E0E0E0;
  697. display: flex;
  698. justify-content: flex-start;
  699. align-items: center;
  700. >view{
  701. flex:1;
  702. line-height:80rpx;
  703. font-size: 30rpx;
  704. font-family: PingFang SC-Medium, PingFang SC;
  705. font-weight: 400;
  706. color: #333333;
  707. line-height: 80rpx;
  708. white-space: nowrap;
  709. overflow: hidden;
  710. text-overflow: ellipsis;
  711. }
  712. >img{
  713. width: 14rpx;
  714. height: 8rpx;
  715. margin-right: 30rpx;
  716. }
  717. }
  718. /* 实验室 */
  719. .lab_r{
  720. width: 486rpx;
  721. height: 80rpx;
  722. display: flex;
  723. justify-content: flex-start;
  724. .picker-text{
  725. width: 438rpx;
  726. height: 80rpx;
  727. }
  728. .img-box{
  729. width: 48rpx;
  730. >img{
  731. width:30rpx;
  732. height:28rpx;
  733. margin:26rpx 18rpx 0 0;
  734. }
  735. }
  736. }
  737. /* 楼栋 */
  738. .building_r{
  739. width: 486rpx;
  740. height: 80rpx;
  741. >input{
  742. height: 80rpx;
  743. font-size: 30rpx;
  744. font-family: PingFang SC-Medium, PingFang SC;
  745. font-weight: 400;
  746. color: #333333;
  747. line-height: 80rpx;
  748. }
  749. }
  750. }
  751. .period{
  752. display: flex;
  753. justify-content: flex-start;
  754. align-items: center;
  755. margin-bottom: 24rpx;
  756. .period_l{
  757. width: 146rpx;
  758. font-size: 30rpx;
  759. font-family: PingFang SC-Medium, PingFang SC;
  760. font-weight: 400;
  761. color: #333333;
  762. line-height: 42rpx;
  763. text-align: left;
  764. }
  765. .period_r{
  766. width: 490rpx;
  767. height: 80rpx;
  768. border-radius: 10rpx;
  769. border: 1rpx solid #E0E0E0;
  770. display: flex;
  771. justify-content: flex-start;
  772. align-items: center;
  773. .picker-text{
  774. font-size: 30rpx;
  775. font-family: PingFang SC-Medium, PingFang SC;
  776. font-weight: 400;
  777. color: #333;
  778. line-height: 80rpx;
  779. width: 230rpx;
  780. text-align: center;
  781. }
  782. .picker-text2{
  783. font-size: 30rpx;
  784. font-family: PingFang SC-Medium, PingFang SC;
  785. font-weight: 400;
  786. color: #333;
  787. line-height: 80rpx;
  788. width: 230rpx;
  789. text-align: center;
  790. }
  791. }
  792. }
  793. .custom{
  794. width: 150rpx;
  795. height: 60rpx;
  796. border-radius: 10rpx 10rpx 10rpx 10rpx;
  797. opacity: 1;
  798. border: 1rpx solid #0183FA;
  799. font-size: 26rpx;
  800. font-family: PingFang SC-Medium, PingFang SC;
  801. font-weight: 400;
  802. color: #0183FA;
  803. line-height: 60rpx;
  804. text-align: center;
  805. float: right;
  806. }
  807. }
  808. .attachment{
  809. width: 690rpx;
  810. background: #FFFFFF;
  811. border-radius: 20rpx;
  812. margin: 20rpx 30rpx 0;
  813. padding-bottom: 32rpx;
  814. box-sizing: border-box;
  815. .attachment_t{
  816. border-bottom: 1rpx solid #D8D8D8;
  817. >text:nth-of-type(1){
  818. font-size: 30rpx;
  819. font-family: PingFang SC-Medium, PingFang SC;
  820. font-weight: 400;
  821. color: #333333;
  822. line-height: 110rpx;
  823. margin-left: 28rpx;
  824. }
  825. >text:nth-of-type(2){
  826. font-size: 30rpx;
  827. font-family: PingFang SC-Medium, PingFang SC;
  828. font-weight: 400;
  829. color: #999999;
  830. line-height: 110rpx;
  831. margin-left: 24rpx;
  832. }
  833. }
  834. .attachment_li{
  835. height: 40rpx;
  836. display: flex;
  837. justify-content: flex-start;
  838. align-items: center;
  839. margin-top: 32rpx;
  840. >img{
  841. width: 30rpx;
  842. height: 26rpx;
  843. margin-right: 20rpx;
  844. margin-left: 50rpx;
  845. }
  846. >text{
  847. flex: 1;
  848. font-size: 28rpx;
  849. font-family: PingFang SC-Medium, PingFang SC;
  850. font-weight: 400;
  851. color: #0183FA;
  852. line-height: 40rpx;
  853. white-space: nowrap;
  854. overflow: hidden;
  855. text-overflow: ellipsis;
  856. }
  857. .attachment_li_del{
  858. width: 30rpx;
  859. height: 30rpx;
  860. }
  861. }
  862. }
  863. .inspect{
  864. margin: 20rpx 30rpx 0;
  865. width: 690rpx;
  866. height: auto;
  867. background: #FFFFFF;
  868. border-radius: 20rpx;
  869. padding: 40rpx 28rpx 20rpx;
  870. box-sizing: border-box;
  871. .inspect_li{
  872. display: flex;
  873. justify-content: flex-start;
  874. margin-bottom: 24rpx;
  875. .inspect_li_l{
  876. width: 146rpx;
  877. text-align: left;
  878. font-size: 30rpx;
  879. font-family: PingFang SC-Medium, PingFang SC;
  880. font-weight: 400;
  881. color: #333333;
  882. line-height: 80rpx;
  883. }
  884. .inspect_li_r{
  885. width: 486rpx;
  886. height: 80rpx;
  887. border-radius: 10rpx;
  888. opacity: 1;
  889. border: 1rpx solid #E0E0E0;
  890. padding-left: 20rpx;
  891. box-sizing: border-box;
  892. }
  893. .college_r{
  894. width: 486rpx;
  895. height: 80rpx;
  896. border-radius: 10rpx;
  897. border: 1rpx solid #E0E0E0;
  898. display: flex;
  899. justify-content: flex-start;
  900. align-items: center;
  901. >view{
  902. flex:1;
  903. line-height:80rpx;
  904. font-size: 30rpx;
  905. font-family: PingFang SC-Medium, PingFang SC;
  906. font-weight: 400;
  907. color: #333333;
  908. line-height: 80rpx;
  909. }
  910. >img{
  911. width: 14rpx;
  912. height: 8rpx;
  913. margin-right: 30rpx;
  914. }
  915. }
  916. /* 整改日期 */
  917. .date_r{
  918. width: 486rpx;
  919. height: 80rpx;
  920. display: flex;
  921. justify-content: flex-start;
  922. .picker-text{
  923. width: 438rpx;
  924. height: 80rpx;
  925. }
  926. >img{
  927. width:30rpx;
  928. height:28rpx;
  929. margin:16rpx 18rpx 0 0;
  930. }
  931. }
  932. /* 整改通知 */
  933. .inform_r{
  934. width: 486rpx;
  935. height: 80rpx;
  936. padding-left: 20rpx;
  937. box-sizing: border-box;
  938. display: flex;
  939. justify-content: flex-start;
  940. align-items: center;
  941. >view{
  942. display: flex;
  943. justify-content: flex-start;
  944. align-items: center;
  945. margin-right: 24rpx;
  946. .inform_r_l{
  947. display: inline-block;
  948. width: 30rpx;
  949. height: 30rpx;
  950. border-radius: 50%;
  951. border: 1rpx solid #E0E0E0;
  952. margin-right: 14rpx;
  953. }
  954. .inform_r_r{
  955. font-size: 30rpx;
  956. font-family: PingFang SC-Medium, PingFang SC;
  957. font-weight: 400;
  958. color: #333333;
  959. line-height: 80rpx;
  960. }
  961. .checked{
  962. display: inline-block;
  963. width: 30rpx;
  964. height: 30rpx;
  965. border-radius: 50%;
  966. border: 1rpx solid #0183FA;
  967. margin-right: 14rpx;
  968. position: relative;
  969. }
  970. .checked::after{
  971. content: '';
  972. position: absolute;
  973. top: 5rpx;
  974. left:5rpx;
  975. width: 20rpx;
  976. height: 20rpx;
  977. border-radius: 50%;
  978. background: #0183FA;
  979. }
  980. }
  981. }
  982. }
  983. }
  984. .popup-max-box{
  985. z-index:10;
  986. height:100%;
  987. width:100%;
  988. position fixed;
  989. background rgba(0,0,0,0.2)
  990. display flex;
  991. flex-direction column
  992. .popup-null{
  993. flex:1;
  994. }
  995. .popup-big-box{
  996. border-top-left-radius:20rpx;
  997. border-top-right-radius:20rpx;
  998. background #fff
  999. .popup-input-box{
  1000. padding:30rpx 20rpx;
  1001. display:flex;
  1002. input{
  1003. flex:1;
  1004. height:70rpx;
  1005. border:1rpx solid #e0e0e0;
  1006. border-radius:10rpx;
  1007. margin-right:20rpx;
  1008. padding:0 20rpx;
  1009. }
  1010. view{
  1011. background #0183FA
  1012. color:#fff;
  1013. border-radius:10rpx;
  1014. width:140rpx;
  1015. line-height:70rpx;
  1016. text-align center;
  1017. font-size:28rpx;
  1018. }
  1019. }
  1020. .popup-for-max-box{
  1021. margin:0 20rpx 30rpx;
  1022. height:600rpx;
  1023. overflow-y scroll;
  1024. .popup-for-null{
  1025. line-height:100rpx;
  1026. text-align center
  1027. color:#999;
  1028. }
  1029. .popup-for-box{
  1030. display:flex;
  1031. padding:10px 0;
  1032. .name-p{
  1033. flex:1;
  1034. line-height:60rpx;
  1035. }
  1036. .button-p{
  1037. background #0183FA
  1038. color:#fff;
  1039. text-align center
  1040. width:100rpx;
  1041. line-height:60rpx;
  1042. height:60rpx;
  1043. border-radius:10rpx;
  1044. }
  1045. }
  1046. }
  1047. }
  1048. }
  1049. /* 计划标题 */
  1050. .inspect_name{
  1051. .popup-content{
  1052. width: 750rpx;
  1053. height: 350rpx;
  1054. background: #FFFFFF;
  1055. border-radius: 10rpx 10rpx 0px 0px;
  1056. padding :0 50rpx;
  1057. box-sizing :border-box;
  1058. overflow :hidden;
  1059. .inspect_name_t{
  1060. margin-top:66rpx;
  1061. padding: 0 30rpx;
  1062. box-sizing: border-box;
  1063. >input{
  1064. width:100%;
  1065. height:80rpx;
  1066. border: 2rpx solid #E0E0E0;
  1067. color:#A2A2A2;
  1068. font-size:28rpx;
  1069. line-height 80rpx
  1070. border-radius:10rpx;
  1071. padding: 0 20rpx;
  1072. box-sizing: border-box;
  1073. }
  1074. }
  1075. .inspect_name_b{
  1076. margin-top :64rpx;
  1077. display: flex;
  1078. justify-content: center;
  1079. >text:nth-of-type(1){
  1080. width: 160rpx;
  1081. height: 60rpx;
  1082. border-radius: 40rpx;
  1083. font-size: 30rpx;
  1084. font-family: PingFang SC;
  1085. font-weight: 500;
  1086. color: #333333;
  1087. line-height: 60rpx;
  1088. text-align :center;
  1089. margin-right: 120rpx;
  1090. border: 2rpx solid #e0e0e0;
  1091. }
  1092. >text:nth-of-type(2){
  1093. width: 160rpx;
  1094. height: 60rpx;
  1095. background: linear-gradient(-35deg, #309CFF, #0183FA);
  1096. border-radius: 40rpx;
  1097. font-size: 30rpx;
  1098. font-family: PingFang SC;
  1099. font-weight: 500;
  1100. color: #FFFFFF;
  1101. line-height: 60rpx;
  1102. text-align :center;
  1103. }
  1104. }
  1105. }
  1106. }
  1107. .bottom_btn{
  1108. position: fixed;
  1109. bottom: 26rpx;
  1110. left: 30rpx;
  1111. font-size: 30rpx;
  1112. font-family: PingFang SC-Medium, PingFang SC;
  1113. font-weight: 400;
  1114. color: #FFFFFF;
  1115. line-height: 90rpx;
  1116. width: 690rpx;
  1117. height: 90rpx;
  1118. background: #0183FA;
  1119. border-radius: 20rpx;
  1120. text-align: center;
  1121. }
  1122. }
  1123. </style>