|
@@ -39,16 +39,19 @@
|
|
|
|
|
|
<view class="basics_li">
|
|
|
<view class="basics_li_l">计划标题</view>
|
|
|
- <picker @change="planChange" :value="planIndex" :range="planArray" class="scope_r">
|
|
|
+ <picker v-if="isCustom" @change="planChange" :value="planIndex" :range="planArray" class="scope_r">
|
|
|
<view class="basics_li_r college_r">
|
|
|
<view>{{form.title?form.title:'选择计划标题'}}</view>
|
|
|
<img src="@/pages_safetyExamine/images/icon_06.png">
|
|
|
</view>
|
|
|
</picker>
|
|
|
+ <view v-if="!isCustom" class="basics_li_r college_r">
|
|
|
+ <input type="text" v-model="form.title" placeholder="输入计划标题">
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="basics_li">
|
|
|
<view class="basics_li_l">检查类型</view>
|
|
|
- <picker @change="categoryChange" :value="categoryIndex" :disabled="isCustom" :range="categoryArray" class="scope_r">
|
|
|
+ <picker @change="categoryChange" :value="categoryIndex" disabled :range="categoryArray" class="scope_r">
|
|
|
<view class="basics_li_r college_r">
|
|
|
<view>{{form.checkType?(form.checkType==1?'校院巡查':'实验室自查'):'选择检查类型'}}</view>
|
|
|
<img src="@/pages_safetyExamine/images/icon_06.png">
|
|
@@ -81,7 +84,7 @@
|
|
|
</view>
|
|
|
<view class="inspect_li" v-if="form.checkResult==0">
|
|
|
<view class="inspect_li_l">整改日期</view>
|
|
|
- <picker mode="date" @change="rectifyDeadline(form,$event)">
|
|
|
+ <picker mode="date" @change="rectifyDeadline(form,$event)" :start="currentDate">
|
|
|
<view class="inspect_li_r date_r">
|
|
|
<input disabled class="picker-text" type="text" v-model="form.rectifyDeadline" placeholder="请选择日期" placeholder-style="font-size: 30rpx;color:#333;">
|
|
|
<img src="@/pages_safetyExamine/images/icon_rl.png">
|
|
@@ -101,7 +104,7 @@
|
|
|
<view class="popup-null" @click="popupClick(2)"></view>
|
|
|
<view class="popup-big-box">
|
|
|
<view class="popup-input-box">
|
|
|
- <input type="text" maxlength="10" v-model="room" placeholder="请输入房间号">
|
|
|
+ <input type="text" maxlength="10" v-model="room" placeholder="请输入关键字">
|
|
|
<view @click="buildBySub">搜索</view>
|
|
|
</view>
|
|
|
<view class="popup-for-max-box">
|
|
@@ -134,7 +137,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { config } from '@/api/request/config.js'
|
|
|
-import { buildBySub,listDepartments,subjectList,getCheckPlanBySubId,checkManageAdd,findCheckManage,getBuildingList} from '@/api/index.js'
|
|
|
+import { buildBySub,listDepartments,subjectList,getCheckPlanBySubId,checkManageUpdate,checkManageAdd,findCheckManage,getBuildingList} from '@/api/index.js'
|
|
|
export default {
|
|
|
name: "rectifyList",
|
|
|
components: {
|
|
@@ -154,7 +157,7 @@ export default {
|
|
|
id:'',
|
|
|
checkPlanId:'',
|
|
|
manageStatus:'',//保存1 提交2
|
|
|
- subId:'',//实验室
|
|
|
+ subIds:'',//实验室
|
|
|
subjectName:'',
|
|
|
title:'',//计划标题
|
|
|
deptId:'',//学院
|
|
@@ -163,7 +166,7 @@ export default {
|
|
|
buildName:'',
|
|
|
roomNumber:'',//房间号
|
|
|
checkType:'',// 检查类型(1校院巡查 2实验室自查)
|
|
|
- checkResult:'1',// 检查结果 0不符合 1符合
|
|
|
+ checkResult:1,// 检查结果 0不符合 1符合
|
|
|
rectifyDeadline:'',//整改期限
|
|
|
rectifyNotice:'1',//整改通知(1整改告知书 2整改通知书)
|
|
|
cycleStartTime:'',
|
|
@@ -206,9 +209,29 @@ export default {
|
|
|
buildingList:[],
|
|
|
//扫一扫进入
|
|
|
laboratoryList:[],
|
|
|
+ currentDate:'',//当前日期
|
|
|
}
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
+ //通过微信扫一扫进入
|
|
|
+ if(option.q){
|
|
|
+
|
|
|
+ let text = decodeURIComponent(option.q)
|
|
|
+ console.log('text',text)
|
|
|
+ let codeId = "";
|
|
|
+ let newList = text.split("?")[1].split("&")
|
|
|
+ let list = newList[0].split("=")[1].split("-")
|
|
|
+ codeId = list[0];
|
|
|
+ uni.showToast({
|
|
|
+ title: codeId,
|
|
|
+ icon:"none",
|
|
|
+ mask:true,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ this.form.subIds=codeId
|
|
|
+ this.getCheckPlanBySubId(codeId)
|
|
|
+ this.getByIdLaboratoryList();
|
|
|
+ }
|
|
|
if(option.id){
|
|
|
this.id=option.id
|
|
|
this.findCheckManage()
|
|
@@ -218,7 +241,7 @@ export default {
|
|
|
}
|
|
|
//通过实验室id查询计划
|
|
|
if(option.subId){
|
|
|
- this.form.subId=option.subId
|
|
|
+ this.form.subIds=option.subId
|
|
|
this.getCheckPlanBySubId(option.subId)
|
|
|
this.getByIdLaboratoryList();
|
|
|
}
|
|
@@ -228,6 +251,8 @@ export default {
|
|
|
|
|
|
},
|
|
|
mounted(){
|
|
|
+ //获取当前日期
|
|
|
+ this.currentDate=this.getNowFormatDate()
|
|
|
this.listDepartments();
|
|
|
|
|
|
},
|
|
@@ -236,6 +261,15 @@ export default {
|
|
|
scrollGet(){},
|
|
|
handleClick(doType){
|
|
|
let self=this;
|
|
|
+ if(!this.form.rectifyDeadline){
|
|
|
+ uni.showToast({
|
|
|
+ title: '整改日期不能为空!',
|
|
|
+ icon:"none",
|
|
|
+ mask:true,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
if( doType=='nextStep'){//下一步
|
|
|
uni.redirectTo({
|
|
|
url: '/pages_safetyExamine/examineManage/examineAddTow?form='+encodeURIComponent(JSON.stringify(this.form))
|
|
@@ -252,12 +286,13 @@ export default {
|
|
|
self.form.checkType='';
|
|
|
self.form.cycleStartTime='';
|
|
|
self.form.cycleEndTime='';
|
|
|
+
|
|
|
}else{//选择计划
|
|
|
|
|
|
self.form.title='';
|
|
|
- self.form.checkType='';
|
|
|
self.form.cycleStartTime='';
|
|
|
self.form.cycleEndTime='';
|
|
|
+ self.form.checkType=2;
|
|
|
self.$refs.popup.open()
|
|
|
}
|
|
|
},
|
|
@@ -288,7 +323,7 @@ export default {
|
|
|
},
|
|
|
//结束时间选中事件
|
|
|
endChange(form,e){
|
|
|
- if(new Date(form.cycleStartTime).getTime()>=new Date(e.target.value).getTime()){
|
|
|
+ if(new Date(form.cycleStartTime).getTime()>new Date(e.target.value).getTime()){
|
|
|
uni.showToast({
|
|
|
title: '结束时间不能小于开始时间',
|
|
|
icon:"none",
|
|
@@ -299,6 +334,17 @@ export default {
|
|
|
form.cycleEndTime=e.target.value
|
|
|
}
|
|
|
},
|
|
|
+ //获取当前日期函数
|
|
|
+ getNowFormatDate() {
|
|
|
+ let date = new Date(),
|
|
|
+ year = date.getFullYear(), //获取完整的年份(4位)
|
|
|
+ month = date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
|
|
|
+ strDate = date.getDate() // 获取当前日(1-31)
|
|
|
+ if (month < 10) month = `0${month}` // 如果月份是个位数,在前面补0
|
|
|
+ if (strDate < 10) strDate = `0${strDate}` // 如果日是个位数,在前面补0
|
|
|
+
|
|
|
+ return `${year}-${month}-${strDate}`
|
|
|
+ },
|
|
|
//详情
|
|
|
async findCheckManage(){
|
|
|
let _this = this;
|
|
@@ -306,7 +352,7 @@ export default {
|
|
|
if(data.code == 200){
|
|
|
this.form.id=data.data.id;
|
|
|
this.form.checkPlanId=data.data.checkPlanId;
|
|
|
- this.form.subId=data.data.subId;
|
|
|
+ this.form.subIds=data.data.subId;
|
|
|
this.form.subjectName=data.data.subjectName;
|
|
|
this.form.title=data.data.title;
|
|
|
this.form.deptId=data.data.deptId;
|
|
@@ -331,7 +377,6 @@ export default {
|
|
|
}else{
|
|
|
this.form.checkHazardDtoList[0].voiceRemark=[];
|
|
|
}
|
|
|
- this.form.id=data.data.id;
|
|
|
//根据实验室id查询实验室计划
|
|
|
if(data.data.subId){
|
|
|
this.form.cycleStartTime=data.data.cycleStartTime;
|
|
@@ -356,12 +401,18 @@ export default {
|
|
|
//根据实验室id查询该实验室有关计划
|
|
|
async getCheckPlanBySubId(subId){
|
|
|
let _this = this;
|
|
|
+ _this.planArray=[];
|
|
|
const {data} = await getCheckPlanBySubId({'subId':subId});
|
|
|
if(data.code == 200){
|
|
|
- for(let i=0;i<data.data.length;i++){
|
|
|
- _this.planArray.push(data.data[i].title)
|
|
|
+ if(data.data.length>0){
|
|
|
+ for(let i=0;i<data.data.length;i++){
|
|
|
+ _this.planArray.push(data.data[i].title)
|
|
|
+ }
|
|
|
+ _this.planList=data.data;
|
|
|
+ }else{
|
|
|
+ _this.isCustom=false;
|
|
|
+ _this.form.checkType=2;
|
|
|
}
|
|
|
- _this.planList=data.data;
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -407,20 +458,20 @@ export default {
|
|
|
//计划
|
|
|
planChange(e){
|
|
|
this.planIndex = e.target.value;
|
|
|
+ this.form.id=this.planList[e.target.value].id
|
|
|
this.form.title=this.planList[e.target.value].title
|
|
|
- this.form.checkPlanId=this.planList[e.target.value].id
|
|
|
+ this.form.checkPlanId=this.planList[e.target.value].checkPlanId
|
|
|
|
|
|
- this.form.subId=this.planList[e.target.value].subId;
|
|
|
+ this.form.subIds=this.planList[e.target.value].subId;
|
|
|
this.form.subjectName=this.planList[e.target.value].subjectName;
|
|
|
this.form.deptId=this.planList[e.target.value].deptId;
|
|
|
this.form.collegeName=this.planList[e.target.value].collegeName;
|
|
|
this.form.buildId=this.planList[e.target.value].buildId;
|
|
|
this.form.buildName=this.planList[e.target.value].buildName;
|
|
|
this.form.checkType=this.planList[e.target.value].checkType;
|
|
|
- this.form.checkResult=this.planList[e.target.value].checkResult==null?'1':data.data.checkResult;
|
|
|
this.form.cycleStartTime=this.planList[e.target.value].cycleStartTime;
|
|
|
this.form.cycleEndTime=this.planList[e.target.value].cycleEndTime;
|
|
|
- this.form.cycleEndTime=this.planList[e.target.value].cycleEndTime;
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -437,6 +488,7 @@ export default {
|
|
|
//开始时间选中事件
|
|
|
rectifyDeadline(form,e){
|
|
|
form.rectifyDeadline=e.target.value
|
|
|
+
|
|
|
},
|
|
|
//整改通知
|
|
|
tabClick(index) {
|
|
@@ -466,7 +518,7 @@ export default {
|
|
|
if(data.data[0]){
|
|
|
this.laboratoryList = data.data;
|
|
|
data.data.forEach(function(item){
|
|
|
- if(self.form.subId==item.id){
|
|
|
+ if(self.form.subIds==item.id){
|
|
|
self.form.subjectName=item.name;
|
|
|
self.form.deptId=item.deptId;
|
|
|
self.form.buildId=item.buildId;
|
|
@@ -513,7 +565,7 @@ export default {
|
|
|
},
|
|
|
//确认搜索房间
|
|
|
popupClickItem(item){
|
|
|
- this.$set(this.form,"subId",item.id)
|
|
|
+ this.$set(this.form,"subIds",item.id)
|
|
|
this.$set(this.form,"subjectName",item.name)
|
|
|
this.$set(this.form,"deptId",item.deptId)
|
|
|
this.$set(this.form,"buildId",item.buildId)
|
|
@@ -567,20 +619,39 @@ export default {
|
|
|
},
|
|
|
//提交
|
|
|
async submitForm(){
|
|
|
- let _this = this;
|
|
|
+ let self = this;
|
|
|
this.form.manageStatus=2;
|
|
|
- const {data} = await checkManageAdd(_this.form);
|
|
|
- if(data.code == 200){
|
|
|
- uni.showToast({
|
|
|
- title: '提交成功',
|
|
|
- icon:"none",
|
|
|
- mask:true,
|
|
|
- duration: 2000
|
|
|
- });
|
|
|
- uni.redirectTo({
|
|
|
- url: '/pages_safetyExamine/examineManage/examineList'
|
|
|
- });
|
|
|
+ let obj=self.form;
|
|
|
+ //复合的情况下,删除隐患项
|
|
|
+ obj.checkHazardDtoList=[];
|
|
|
+ if(self.form.checkPlanId){
|
|
|
+ const {data} = await checkManageUpdate(obj);
|
|
|
+ if(data.code == 200){
|
|
|
+ uni.showToast({
|
|
|
+ title: '提交成功',
|
|
|
+ icon:"none",
|
|
|
+ mask:true,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages_safetyExamine/examineManage/examineList?pageType='+this.form.checkType
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ const {data} = await checkManageAdd(obj);
|
|
|
+ if(data.code == 200){
|
|
|
+ uni.showToast({
|
|
|
+ title: '提交成功',
|
|
|
+ icon:"none",
|
|
|
+ mask:true,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages_safetyExamine/examineManage/examineList?pageType='+this.form.checkType
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
},
|
|
|
}
|
|
|
}
|