examineAdd.vue 29 KB

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