examineAdd.vue 29 KB

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