examineAdd.vue 31 KB

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