examineAdd.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262
  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. 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. }
  444. }
  445. },
  446. //查询学院列表
  447. async listDepartments(){
  448. let _this = this;
  449. const {data} = await listDepartments();
  450. if(data.code == 200){
  451. for(let i=0;i<data.data.length;i++){
  452. _this.collegeArray.push(data.data[i].deptName)
  453. }
  454. _this.collegeList=data.data;
  455. }
  456. },
  457. //根据实验室id查询该实验室有关计划
  458. async getCheckPlanBySubId(subId){
  459. let _this = this;
  460. const {data} = await getCheckPlanBySubId({'subId':subId});
  461. if(data.code == 200){
  462. if(data.data.length>0){
  463. let titleList = [];
  464. let list = [];
  465. for(let i=0;i<data.data.length;i++){
  466. if(data.data[i].isSelfData==1){
  467. titleList.push(data.data[i].title)
  468. list.push(data.data[i]);
  469. }
  470. }
  471. this.$set(this.form,'id','');
  472. this.$set(this.form,'title','');
  473. this.$set(this,'planArray',titleList);
  474. this.$set(this,'planList',list);
  475. _this.isCustom=true;
  476. _this.form.checkType=null;
  477. }else{
  478. _this.isCustom=false;
  479. _this.form.checkType=2;
  480. }
  481. }
  482. },
  483. //查询楼栋
  484. async buildFloorGetlist(){
  485. let _this = this;
  486. const {data} = await buildFloorGetlist({type:2});
  487. if(data.code == 200){
  488. let idList = [];
  489. let nameList = [];
  490. for(let i=0;i<data.rows.length;i++){
  491. idList.push(data.rows[i].id)
  492. nameList.push(data.rows[i].name)
  493. }
  494. this.$set(this,"buildingList",idList)
  495. this.$set(this,"buildingArray",nameList)
  496. }
  497. },
  498. //楼栋选中
  499. buildingChange(e){
  500. this.form.buildId=this.buildingList[e.target.value]
  501. this.form.buildName=this.buildingArray[e.target.value]
  502. this.buildBySubList(this.buildingList[e.target.value]);
  503. },
  504. //根据楼栋ID查询实验室列表
  505. async buildBySubList(buildId){
  506. let self = this;
  507. const {data} = await buildBySubList({buildId:buildId});
  508. if(data.code == 200){
  509. this.$set(this.form,'subIds','')
  510. this.$set(this.form,'subjectName','')
  511. this.$set(this,'room','')
  512. this.$set(this,'roomList',data.data);
  513. }
  514. },
  515. //学院选中
  516. collegeChange(e){
  517. this.collegeIndex = e.target.value;
  518. this.form.deptId=this.collegeList[e.target.value].deptId
  519. this.form.collegeName=this.collegeList[e.target.value].deptName
  520. console.log()
  521. this.buildFloorGetlist(this.form.deptId)
  522. },
  523. //检查类型
  524. categoryChange(e){
  525. this.categoryIndex = e.target.value;
  526. if(e.target.value==0){
  527. this.form.checkType=1
  528. }else if(e.target.value==1){
  529. this.form.checkType=2
  530. }
  531. },
  532. //计划
  533. planChange(e){
  534. this.planIndex = e.target.value;
  535. this.form.id=this.planList[e.target.value].id
  536. console.log('e',this.planList[e.target.value].id);
  537. console.log('this.planList[e.target.value].id',this.planList[e.target.value].id);
  538. this.findCheckManage('check',this.planList[e.target.value].id);
  539. // this.form.title=this.planList[e.target.value].title
  540. // this.form.checkPlanId=this.planList[e.target.value].checkPlanId
  541. // this.form.subIds=this.planList[e.target.value].subId;
  542. // this.form.subjectName=this.planList[e.target.value].subjectName;
  543. // this.form.deptId=this.planList[e.target.value].deptId;
  544. // this.form.collegeName=this.planList[e.target.value].collegeName;
  545. // this.form.buildId=this.planList[e.target.value].buildId;
  546. // this.form.buildName=this.planList[e.target.value].buildName;
  547. // this.form.checkType=this.planList[e.target.value].checkType;
  548. // this.form.cycleStartTime=this.planList[e.target.value].cycleStartTime;
  549. // this.form.cycleEndTime=this.planList[e.target.value].cycleEndTime;
  550. },
  551. resultChange(e){
  552. this.resultIndex = e.target.value;
  553. if(e.target.value==0){
  554. this.form.checkResult=1;
  555. }else if(e.target.value==1){
  556. this.form.checkResult=0;
  557. }
  558. },
  559. //开始时间选中事件
  560. rectifyDeadline(form,e){
  561. form.rectifyDeadline=e.target.value
  562. },
  563. //整改通知
  564. tabClick(index) {
  565. this.informIndex = index;
  566. if(index==0){
  567. this.rectifyNotice='1';
  568. }else if(index==1){
  569. this.rectifyNotice='2';
  570. }
  571. },
  572. //搜索房间弹层开关
  573. popupClick(type){
  574. if(type == 1){
  575. if(this.addDisabledType){
  576. return
  577. }
  578. this.popupType = true;
  579. }else if(type == 2){
  580. this.popupType = false;
  581. }
  582. },
  583. //扫一扫进入通过id查询实验室列表
  584. async getByIdLaboratoryList(){
  585. let self = this;
  586. const {data} = await buildBySub({'searchValue':this.room});
  587. if(data.code==200){
  588. if(data.data[0]){
  589. this.laboratoryList = data.data;
  590. data.data.forEach(function(item){
  591. if(self.form.subIds==item.id){
  592. self.form.subjectName=item.name;
  593. self.form.deptId=item.deptId;
  594. self.form.buildId=item.buildId;
  595. self.form.roomNumber=item.room;
  596. }
  597. })
  598. //获取学院名称
  599. for(let i=0;i<this.collegeList.length;i++){
  600. if(this.collegeList[i].deptId==self.form.deptId){
  601. this.$set(this.form,"collegeName",this.collegeList[i].deptName)
  602. }
  603. }
  604. //请求楼栋数据
  605. this.buildFloorGetlist(self.form.deptId)
  606. }
  607. }
  608. },
  609. //搜索房间接口
  610. async buildBySub(){
  611. let self = this;
  612. if(!this.room){
  613. uni.showToast({
  614. title: '请输入要搜索关键词',
  615. icon:"none",
  616. mask:true,
  617. duration: 2000
  618. });
  619. return
  620. }
  621. const {data} = await buildBySub({'searchValue':this.room});
  622. if(data.code==200){
  623. if(data.data[0]){
  624. this.roomList = data.data;
  625. }else{
  626. uni.showToast({
  627. title: '未找到相关实验室',
  628. icon:"none",
  629. mask:true,
  630. duration: 2000
  631. });
  632. }
  633. }
  634. },
  635. //确认搜索房间
  636. popupClickItem(item){
  637. console.log('item',item)
  638. this.$set(this.form,"subIds",item.id)
  639. this.$set(this.form,"subjectName",item.name)
  640. this.$set(this.form,"deptId",item.deptId)
  641. this.$set(this.form,"buildId",item.buildId)
  642. this.$set(this.form,"roomNumber",item.room)
  643. this.$set(this.form,'title','');
  644. this.$set(this.form,'id','');
  645. this.$set(this.form,'checkType',2);
  646. this.$set(this.form,'checkResult',1);
  647. this.$set(this.form,'rectifyDeadline','');
  648. this.$set(this,'informIndex',0);
  649. this.$set(this.form,'cycleStartTime','');
  650. this.$set(this.form,'cycleEndTime','');
  651. this.$set(this.form,'checkHazardDtoList',[{
  652. voiceRemark:[],//语音备忘存储
  653. hazardLevel:2,//隐患等级
  654. hazardLevelName:'一般隐患',//隐患等级
  655. hazardCheckCode:'', //检查项目code序号
  656. hazardCheckName:'', //检查项目名称
  657. hazardCheckPro:'', //最后一级的id
  658. hazardCheckPoint:'',// 检查要点
  659. hazardDescribe:'', //隐患描述
  660. uploadDtoList:[],//隐患照片
  661. }]);
  662. //匹配学院名称
  663. for(let i=0;i<this.collegeList.length;i++){
  664. if(this.collegeList[i].deptId==item.deptId){
  665. this.$set(this.form,"collegeName",this.collegeList[i].deptName)
  666. }
  667. }
  668. //匹配楼栋名称
  669. for(let i=0;i<this.buildingList.length;i++){
  670. if(this.buildingList[i]==item.buildId){
  671. this.$set(this.form,"buildName",this.buildingArray[i])
  672. }
  673. }
  674. this.popupType = false;
  675. this.getCheckPlanBySubId(item.id)
  676. },
  677. //调用摄像头
  678. saoCode(){
  679. let self = this;
  680. uni.scanCode({
  681. onlyFromCamera: true,
  682. success: function (res) {
  683. if(res.result.indexOf("code") != -1 && res.result.indexOf("-") != -1 && res.result.indexOf("&") != -1){
  684. let codeRoom = "";
  685. let newList = res.result.split("?")[1].split("&")
  686. let list = newList[0].split("=")[1].split("-")
  687. codeRoom = list[1];
  688. if(codeRoom){
  689. self.roomList = [];
  690. self.room = codeRoom;
  691. self.buildBySub();
  692. self.popupType = true;
  693. }else{
  694. uni.showToast({
  695. title: '请扫描正确的二维码',
  696. icon:"none",
  697. mask:true,
  698. duration: 2000
  699. });
  700. }
  701. }else{
  702. uni.showToast({
  703. title: '请扫描正确的二维码',
  704. icon:"none",
  705. mask:true,
  706. duration: 2000
  707. });
  708. }
  709. }
  710. });
  711. },
  712. //提交
  713. async submitForm(){
  714. let self = this;
  715. this.form.manageStatus=2;
  716. let obj=self.form;
  717. //复合的情况下,删除隐患项
  718. obj.checkHazardDtoList=[];
  719. if(self.form.id){
  720. const {data} = await checkManageUpdate(obj);
  721. if(data.code == 200){
  722. uni.showToast({
  723. title: '提交成功',
  724. icon:"none",
  725. mask:true,
  726. duration: 2000
  727. });
  728. uni.redirectTo({
  729. url: '/pages_safetyExamine/examineManage/examineList?pageType='+this.form.checkType
  730. });
  731. }
  732. }else{
  733. const {data} = await checkManageAdd(obj);
  734. if(data.code == 200){
  735. uni.showToast({
  736. title: '提交成功',
  737. icon:"none",
  738. mask:true,
  739. duration: 2000
  740. });
  741. uni.redirectTo({
  742. url: '/pages_safetyExamine/examineManage/examineList?pageType='+this.form.checkType
  743. });
  744. }
  745. }
  746. },
  747. }
  748. }
  749. </script>
  750. <style lang="stylus" scoped>
  751. .examine{
  752. height:100%;
  753. display flex;
  754. box-sizing: border-box;
  755. .info-max-box{
  756. flex: 1;
  757. overflow: scroll;
  758. padding: 20rpx 0rpx 128rpx;
  759. box-sizing: border-box;
  760. }
  761. .addDisabled{
  762. background-color: #f5f5f5;
  763. }
  764. .basics{
  765. margin: 0 30rpx;
  766. width: 690rpx;
  767. height: 740rpx;
  768. background: #FFFFFF;
  769. border-radius: 20rpx;
  770. padding: 30rpx 28rpx 0;
  771. box-sizing: border-box;
  772. .basics_li{
  773. display: flex;
  774. justify-content: flex-start;
  775. margin-bottom: 24rpx;
  776. .basics_li_l{
  777. width: 146rpx;
  778. text-align: left;
  779. font-size: 30rpx;
  780. font-family: PingFang SC-Medium, PingFang SC;
  781. font-weight: 400;
  782. color: #333333;
  783. line-height: 80rpx;
  784. }
  785. .basics_li_r{
  786. width: 486rpx;
  787. height: 80rpx;
  788. border-radius: 10rpx;
  789. opacity: 1;
  790. border: 1rpx solid #E0E0E0;
  791. padding-left: 20rpx;
  792. box-sizing: border-box;
  793. }
  794. /* 学院 */
  795. .college_r{
  796. width: 486rpx;
  797. height: 80rpx;
  798. border-radius: 10rpx;
  799. border: 1rpx solid #E0E0E0;
  800. display: flex;
  801. justify-content: flex-start;
  802. align-items: center;
  803. >view{
  804. flex:1;
  805. line-height:80rpx;
  806. font-size: 30rpx;
  807. font-family: PingFang SC-Medium, PingFang SC;
  808. font-weight: 400;
  809. color: #333333;
  810. line-height: 80rpx;
  811. white-space: nowrap;
  812. overflow: hidden;
  813. text-overflow: ellipsis;
  814. }
  815. >img{
  816. width: 14rpx;
  817. height: 8rpx;
  818. margin-right: 30rpx;
  819. }
  820. }
  821. /* 实验室 */
  822. .lab_r{
  823. width: 486rpx;
  824. height: 80rpx;
  825. display: flex;
  826. justify-content: flex-start;
  827. .picker-text{
  828. width: 438rpx;
  829. height: 80rpx;
  830. }
  831. .img-box{
  832. width: 48rpx;
  833. >img{
  834. width:30rpx;
  835. height:28rpx;
  836. margin:26rpx 18rpx 0 0;
  837. }
  838. }
  839. }
  840. /* 楼栋 */
  841. .building_r{
  842. width: 486rpx;
  843. height: 80rpx;
  844. >input{
  845. height: 80rpx;
  846. font-size: 30rpx;
  847. font-family: PingFang SC-Medium, PingFang SC;
  848. font-weight: 400;
  849. color: #333333;
  850. line-height: 80rpx;
  851. }
  852. }
  853. }
  854. .period{
  855. display: flex;
  856. justify-content: flex-start;
  857. align-items: center;
  858. margin-bottom: 24rpx;
  859. .period_l{
  860. width: 146rpx;
  861. font-size: 30rpx;
  862. font-family: PingFang SC-Medium, PingFang SC;
  863. font-weight: 400;
  864. color: #333333;
  865. line-height: 42rpx;
  866. text-align: left;
  867. }
  868. .period_r{
  869. width: 490rpx;
  870. height: 80rpx;
  871. border-radius: 10rpx;
  872. border: 1rpx solid #E0E0E0;
  873. display: flex;
  874. justify-content: flex-start;
  875. align-items: center;
  876. .picker-text{
  877. font-size: 30rpx;
  878. font-family: PingFang SC-Medium, PingFang SC;
  879. font-weight: 400;
  880. color: #333;
  881. line-height: 80rpx;
  882. width: 230rpx;
  883. text-align: center;
  884. }
  885. .picker-text2{
  886. font-size: 30rpx;
  887. font-family: PingFang SC-Medium, PingFang SC;
  888. font-weight: 400;
  889. color: #333;
  890. line-height: 80rpx;
  891. width: 230rpx;
  892. text-align: center;
  893. }
  894. }
  895. }
  896. .custom{
  897. width: 150rpx;
  898. height: 60rpx;
  899. border-radius: 10rpx 10rpx 10rpx 10rpx;
  900. opacity: 1;
  901. border: 1rpx solid #0183FA;
  902. font-size: 26rpx;
  903. font-family: PingFang SC-Medium, PingFang SC;
  904. font-weight: 400;
  905. color: #0183FA;
  906. line-height: 60rpx;
  907. text-align: center;
  908. float: right;
  909. }
  910. }
  911. .attachment{
  912. width: 690rpx;
  913. background: #FFFFFF;
  914. border-radius: 20rpx;
  915. margin: 20rpx 30rpx 0;
  916. padding-bottom: 32rpx;
  917. box-sizing: border-box;
  918. .attachment_t{
  919. border-bottom: 1rpx solid #D8D8D8;
  920. >text:nth-of-type(1){
  921. font-size: 30rpx;
  922. font-family: PingFang SC-Medium, PingFang SC;
  923. font-weight: 400;
  924. color: #333333;
  925. line-height: 110rpx;
  926. margin-left: 28rpx;
  927. }
  928. >text:nth-of-type(2){
  929. font-size: 30rpx;
  930. font-family: PingFang SC-Medium, PingFang SC;
  931. font-weight: 400;
  932. color: #999999;
  933. line-height: 110rpx;
  934. margin-left: 24rpx;
  935. }
  936. }
  937. .attachment_li{
  938. height: 40rpx;
  939. display: flex;
  940. justify-content: flex-start;
  941. align-items: center;
  942. margin-top: 32rpx;
  943. >img{
  944. width: 30rpx;
  945. height: 26rpx;
  946. margin-right: 20rpx;
  947. margin-left: 50rpx;
  948. }
  949. >text{
  950. flex: 1;
  951. font-size: 28rpx;
  952. font-family: PingFang SC-Medium, PingFang SC;
  953. font-weight: 400;
  954. color: #0183FA;
  955. line-height: 40rpx;
  956. white-space: nowrap;
  957. overflow: hidden;
  958. text-overflow: ellipsis;
  959. }
  960. .attachment_li_del{
  961. width: 30rpx;
  962. height: 30rpx;
  963. }
  964. }
  965. }
  966. .inspect{
  967. margin: 20rpx 30rpx 0;
  968. width: 690rpx;
  969. height: auto;
  970. background: #FFFFFF;
  971. border-radius: 20rpx;
  972. padding: 40rpx 28rpx 20rpx;
  973. box-sizing: border-box;
  974. .inspect_li{
  975. display: flex;
  976. justify-content: flex-start;
  977. margin-bottom: 24rpx;
  978. .inspect_li_l{
  979. width: 146rpx;
  980. text-align: left;
  981. font-size: 30rpx;
  982. font-family: PingFang SC-Medium, PingFang SC;
  983. font-weight: 400;
  984. color: #333333;
  985. line-height: 80rpx;
  986. }
  987. .inspect_li_r{
  988. width: 486rpx;
  989. height: 80rpx;
  990. border-radius: 10rpx;
  991. opacity: 1;
  992. border: 1rpx solid #E0E0E0;
  993. padding-left: 20rpx;
  994. box-sizing: border-box;
  995. }
  996. .college_r{
  997. width: 486rpx;
  998. height: 80rpx;
  999. border-radius: 10rpx;
  1000. border: 1rpx solid #E0E0E0;
  1001. display: flex;
  1002. justify-content: flex-start;
  1003. align-items: center;
  1004. >view{
  1005. flex:1;
  1006. line-height:80rpx;
  1007. font-size: 30rpx;
  1008. font-family: PingFang SC-Medium, PingFang SC;
  1009. font-weight: 400;
  1010. color: #333333;
  1011. line-height: 80rpx;
  1012. }
  1013. >img{
  1014. width: 14rpx;
  1015. height: 8rpx;
  1016. margin-right: 30rpx;
  1017. }
  1018. }
  1019. /* 整改日期 */
  1020. .date_r{
  1021. width: 486rpx;
  1022. height: 80rpx;
  1023. display: flex;
  1024. justify-content: flex-start;
  1025. .picker-text{
  1026. width: 438rpx;
  1027. height: 80rpx;
  1028. }
  1029. >img{
  1030. width:30rpx;
  1031. height:28rpx;
  1032. margin:16rpx 18rpx 0 0;
  1033. }
  1034. }
  1035. /* 整改通知 */
  1036. .inform_r{
  1037. width: 486rpx;
  1038. height: 80rpx;
  1039. padding-left: 20rpx;
  1040. box-sizing: border-box;
  1041. display: flex;
  1042. justify-content: flex-start;
  1043. align-items: center;
  1044. >view{
  1045. display: flex;
  1046. justify-content: flex-start;
  1047. align-items: center;
  1048. margin-right: 24rpx;
  1049. .inform_r_l{
  1050. display: inline-block;
  1051. width: 30rpx;
  1052. height: 30rpx;
  1053. border-radius: 50%;
  1054. border: 1rpx solid #E0E0E0;
  1055. margin-right: 14rpx;
  1056. }
  1057. .inform_r_r{
  1058. font-size: 30rpx;
  1059. font-family: PingFang SC-Medium, PingFang SC;
  1060. font-weight: 400;
  1061. color: #333333;
  1062. line-height: 80rpx;
  1063. }
  1064. .checked{
  1065. display: inline-block;
  1066. width: 30rpx;
  1067. height: 30rpx;
  1068. border-radius: 50%;
  1069. border: 1rpx solid #0183FA;
  1070. margin-right: 14rpx;
  1071. position: relative;
  1072. }
  1073. .checked::after{
  1074. content: '';
  1075. position: absolute;
  1076. top: 5rpx;
  1077. left:5rpx;
  1078. width: 20rpx;
  1079. height: 20rpx;
  1080. border-radius: 50%;
  1081. background: #0183FA;
  1082. }
  1083. }
  1084. }
  1085. }
  1086. }
  1087. .popup-max-box{
  1088. z-index:10;
  1089. height:100%;
  1090. width:100%;
  1091. position fixed;
  1092. background rgba(0,0,0,0.2)
  1093. display flex;
  1094. flex-direction column
  1095. .popup-null{
  1096. flex:1;
  1097. }
  1098. .popup-big-box{
  1099. border-top-left-radius:20rpx;
  1100. border-top-right-radius:20rpx;
  1101. background #fff
  1102. .popup-input-box{
  1103. padding:30rpx 20rpx;
  1104. display:flex;
  1105. input{
  1106. flex:1;
  1107. height:70rpx;
  1108. border:1rpx solid #e0e0e0;
  1109. border-radius:10rpx;
  1110. margin-right:20rpx;
  1111. padding:0 20rpx;
  1112. }
  1113. view{
  1114. background #0183FA
  1115. color:#fff;
  1116. border-radius:10rpx;
  1117. width:140rpx;
  1118. line-height:70rpx;
  1119. text-align center;
  1120. font-size:28rpx;
  1121. }
  1122. }
  1123. .popup-for-max-box{
  1124. margin:0 20rpx 30rpx;
  1125. height:600rpx;
  1126. overflow-y scroll;
  1127. .popup-for-null{
  1128. line-height:100rpx;
  1129. text-align center
  1130. color:#999;
  1131. }
  1132. .popup-for-box{
  1133. display:flex;
  1134. padding:10px 0;
  1135. .name-p{
  1136. flex:1;
  1137. line-height:60rpx;
  1138. }
  1139. .button-p{
  1140. background #0183FA
  1141. color:#fff;
  1142. text-align center
  1143. width:100rpx;
  1144. line-height:60rpx;
  1145. height:60rpx;
  1146. border-radius:10rpx;
  1147. }
  1148. }
  1149. }
  1150. }
  1151. }
  1152. /* 计划标题 */
  1153. .inspect_name{
  1154. .popup-content{
  1155. width: 750rpx;
  1156. height: 350rpx;
  1157. background: #FFFFFF;
  1158. border-radius: 10rpx 10rpx 0px 0px;
  1159. padding :0 50rpx;
  1160. box-sizing :border-box;
  1161. overflow :hidden;
  1162. .inspect_name_t{
  1163. margin-top:66rpx;
  1164. padding: 0 30rpx;
  1165. box-sizing: border-box;
  1166. >input{
  1167. width:100%;
  1168. height:80rpx;
  1169. border: 2rpx solid #E0E0E0;
  1170. color:#A2A2A2;
  1171. font-size:28rpx;
  1172. line-height 80rpx
  1173. border-radius:10rpx;
  1174. padding: 0 20rpx;
  1175. box-sizing: border-box;
  1176. }
  1177. }
  1178. .inspect_name_b{
  1179. margin-top :64rpx;
  1180. display: flex;
  1181. justify-content: center;
  1182. >text:nth-of-type(1){
  1183. width: 160rpx;
  1184. height: 60rpx;
  1185. border-radius: 40rpx;
  1186. font-size: 30rpx;
  1187. font-family: PingFang SC;
  1188. font-weight: 500;
  1189. color: #333333;
  1190. line-height: 60rpx;
  1191. text-align :center;
  1192. margin-right: 120rpx;
  1193. border: 2rpx solid #e0e0e0;
  1194. }
  1195. >text:nth-of-type(2){
  1196. width: 160rpx;
  1197. height: 60rpx;
  1198. background: linear-gradient(-35deg, #309CFF, #0183FA);
  1199. border-radius: 40rpx;
  1200. font-size: 30rpx;
  1201. font-family: PingFang SC;
  1202. font-weight: 500;
  1203. color: #FFFFFF;
  1204. line-height: 60rpx;
  1205. text-align :center;
  1206. }
  1207. }
  1208. }
  1209. }
  1210. .bottom_btn{
  1211. position: fixed;
  1212. bottom: 26rpx;
  1213. left: 30rpx;
  1214. font-size: 30rpx;
  1215. font-family: PingFang SC-Medium, PingFang SC;
  1216. font-weight: 400;
  1217. color: #FFFFFF;
  1218. line-height: 90rpx;
  1219. width: 690rpx;
  1220. height: 90rpx;
  1221. background: #0183FA;
  1222. border-radius: 20rpx;
  1223. text-align: center;
  1224. }
  1225. }
  1226. </style>