examineAdd.vue 32 KB

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