|
@@ -9,7 +9,7 @@
|
|
</view>
|
|
</view>
|
|
<view class="items-b">< {{newData.hazardCheckCode2}} {{newData.hazardCheckName2}} <</view>
|
|
<view class="items-b">< {{newData.hazardCheckCode2}} {{newData.hazardCheckName2}} <</view>
|
|
</view>
|
|
</view>
|
|
- <view class="items-number" >此检查项在当前实验室累计出现<text>{{hazardCheckNum}}</text>次隐患</view>
|
|
|
|
|
|
+ <view class="items-number">此检查项在当前实验室累计出现<text>{{hazardCheckNum}}</text>次隐患</view>
|
|
<view class="list">
|
|
<view class="list">
|
|
<view class="list-li">
|
|
<view class="list-li">
|
|
<view>检查要点</view>
|
|
<view>检查要点</view>
|
|
@@ -32,8 +32,8 @@
|
|
<img src="@/pages_safetyCheck/images/icon_06.png">
|
|
<img src="@/pages_safetyCheck/images/icon_06.png">
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <textarea v-if="!form.checkFlag" class="describe" type="text" v-model="form.hazardDescribe" maxlength="200"
|
|
|
|
- placeholder="请填写隐患描述" placeholder-style="font-size:24rpx;color:#999;"></textarea>
|
|
|
|
|
|
+ <textarea v-if="!form.checkFlag" class="describe" type="text" v-model="form.hazardDescribe"
|
|
|
|
+ maxlength="200" placeholder="请填写隐患描述" placeholder-style="font-size:24rpx;color:#999;"></textarea>
|
|
<view v-if="!form.checkFlag" class="check-for-img-max-box">
|
|
<view v-if="!form.checkFlag" class="check-for-img-max-box">
|
|
<view class="left-title-p"></view>
|
|
<view class="left-title-p"></view>
|
|
<view class="right-img-box">
|
|
<view class="right-img-box">
|
|
@@ -43,7 +43,7 @@
|
|
@click="delImg(imgIndex)">
|
|
@click="delImg(imgIndex)">
|
|
</view>
|
|
</view>
|
|
<img class="add-button" src="@/pages_safetyCheck/images/img_ssp_pz@1x.png"
|
|
<img class="add-button" src="@/pages_safetyCheck/images/img_ssp_pz@1x.png"
|
|
- @click="selectImage()" v-if="form.photoList.length<5">
|
|
|
|
|
|
+ @click="selectImage()" v-if="form.photoList.length<6">
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -52,7 +52,8 @@
|
|
<view class="voice_t_t" v-if="!form.voiceList[0]">语音备注:(选填)</view>
|
|
<view class="voice_t_t" v-if="!form.voiceList[0]">语音备注:(选填)</view>
|
|
<view class="voice_t_b" v-if="form.voiceList[0]">语音备注:({{form.voiceList.length}})</view>
|
|
<view class="voice_t_b" v-if="form.voiceList[0]">语音备注:({{form.voiceList.length}})</view>
|
|
</view>
|
|
</view>
|
|
- <view class="voice_b" v-if="form.voiceList[0]" v-for="(voiceItem,voiceIndex) in form.voiceList" :key="voiceIndex">
|
|
|
|
|
|
+ <view class="voice_b" v-if="form.voiceList[0]" v-for="(voiceItem,voiceIndex) in form.voiceList"
|
|
|
|
+ :key="voiceIndex">
|
|
<view class="voice_b_l" @tap="voicePlay(voiceItem.fileUrl)">
|
|
<view class="voice_b_l" @tap="voicePlay(voiceItem.fileUrl)">
|
|
<img class="add-button" src="@/pages_safetyCheck/images//icon_yybz_yy.png" />
|
|
<img class="add-button" src="@/pages_safetyCheck/images//icon_yybz_yy.png" />
|
|
{{voiceItem.fileLength}}″
|
|
{{voiceItem.fileLength}}″
|
|
@@ -77,7 +78,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
- const myaudio = uni.createInnerAudioContext();
|
|
|
|
|
|
+ const myaudio = uni.createInnerAudioContext();
|
|
import {
|
|
import {
|
|
config
|
|
config
|
|
} from '@/api/request/config.js'
|
|
} from '@/api/request/config.js'
|
|
@@ -112,28 +113,28 @@
|
|
checked: true,
|
|
checked: true,
|
|
},
|
|
},
|
|
],
|
|
],
|
|
- pageType:'',
|
|
|
|
- itemsStatus:'',
|
|
|
|
|
|
+ pageType: '',
|
|
|
|
+ itemsStatus: '',
|
|
setOptionId: '', //检查项id
|
|
setOptionId: '', //检查项id
|
|
manageId: '', //检查管理id
|
|
manageId: '', //检查管理id
|
|
subId: '',
|
|
subId: '',
|
|
hazardCheckPro: '',
|
|
hazardCheckPro: '',
|
|
- hazardCheckNum:0,
|
|
|
|
|
|
+ hazardCheckNum: 0,
|
|
sendLock: true, //发送锁,当为true时上锁,false时解锁发送
|
|
sendLock: true, //发送锁,当为true时上锁,false时解锁发送
|
|
recorderManager: wx.getRecorderManager(),
|
|
recorderManager: wx.getRecorderManager(),
|
|
- optionData:null,
|
|
|
|
|
|
+ optionData: null,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
let optionData = JSON.parse(decodeURIComponent(option.infoData));
|
|
let optionData = JSON.parse(decodeURIComponent(option.infoData));
|
|
- console.log('新增',optionData)
|
|
|
|
|
|
+ console.log('新增', optionData)
|
|
uni.setNavigationBarTitle({
|
|
uni.setNavigationBarTitle({
|
|
title: optionData.subName + '(' + (optionData.pageType == 0 ? optionData.roomNum : optionData
|
|
title: optionData.subName + '(' + (optionData.pageType == 0 ? optionData.roomNum : optionData
|
|
.subRoom) + ')'
|
|
.subRoom) + ')'
|
|
})
|
|
})
|
|
this.$set(this, 'pageType', optionData.pageType);
|
|
this.$set(this, 'pageType', optionData.pageType);
|
|
this.$set(this, 'itemsStatus', optionData.itemsStatus);
|
|
this.$set(this, 'itemsStatus', optionData.itemsStatus);
|
|
-
|
|
|
|
|
|
+
|
|
this.$set(this, 'setOptionId', optionData.setOptionId);
|
|
this.$set(this, 'setOptionId', optionData.setOptionId);
|
|
this.$set(this, 'manageId', optionData.manageId);
|
|
this.$set(this, 'manageId', optionData.manageId);
|
|
this.$set(this, 'subId', optionData.subId);
|
|
this.$set(this, 'subId', optionData.subId);
|
|
@@ -145,25 +146,25 @@
|
|
|
|
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- if(this.pageType==0){
|
|
|
|
|
|
+ if (this.pageType == 0) {
|
|
//检查
|
|
//检查
|
|
- if(this.itemsStatus==0 || this.itemsStatus==1){
|
|
|
|
|
|
+ if (this.itemsStatus == 0 || this.itemsStatus == 1) {
|
|
//开始检查-提交的详情
|
|
//开始检查-提交的详情
|
|
this.securityAppCheckPlanCheckInfo();
|
|
this.securityAppCheckPlanCheckInfo();
|
|
- }else if(this.itemsStatus==2){
|
|
|
|
|
|
+ } else if (this.itemsStatus == 2) {
|
|
//保存草稿详情
|
|
//保存草稿详情
|
|
this.securityDraftFindBySetOptionId();
|
|
this.securityDraftFindBySetOptionId();
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.securityAppCheckPhotoGetCheckNumBySub();
|
|
this.securityAppCheckPhotoGetCheckNumBySub();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
hiddenDangerClick(row) {
|
|
hiddenDangerClick(row) {
|
|
- if(!this.hiddenDangerRecordStatus){
|
|
|
|
|
|
+ if (!this.hiddenDangerRecordStatus) {
|
|
let infoData = this.optionData;
|
|
let infoData = this.optionData;
|
|
- infoData.hiddenDangerRecordStatus = true;//判断是否跳转隐患列表
|
|
|
|
|
|
+ infoData.hiddenDangerRecordStatus = true; //判断是否跳转隐患列表
|
|
uni.redirectTo({
|
|
uni.redirectTo({
|
|
url: '/pages_safetyCheck/views/inspectManage/hiddenDangerRecord?infoData=' +
|
|
url: '/pages_safetyCheck/views/inspectManage/hiddenDangerRecord?infoData=' +
|
|
encodeURIComponent(JSON.stringify(infoData))
|
|
encodeURIComponent(JSON.stringify(infoData))
|
|
@@ -182,11 +183,11 @@
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
this.$set(this, 'newData', data.data);
|
|
this.$set(this, 'newData', data.data);
|
|
//编辑的时候
|
|
//编辑的时候
|
|
- this.$set(this.form, 'checkFlag', data.data.checkFlag?data.data.checkFlag:false);
|
|
|
|
- this.$set(this.form, 'hazardDescribe', data.data.hazardDescribe?data.data.hazardDescribe:'');
|
|
|
|
- this.$set(this.form, 'photoList', data.data.photoList?data.data.photoList:[]);
|
|
|
|
- this.$set(this.form, 'voiceList', data.data.voiceList?data.data.voiceList:[]);
|
|
|
|
-
|
|
|
|
|
|
+ this.$set(this.form, 'checkFlag', data.data.checkFlag ? data.data.checkFlag : false);
|
|
|
|
+ this.$set(this.form, 'hazardDescribe', data.data.hazardDescribe ? data.data.hazardDescribe : '');
|
|
|
|
+ this.$set(this.form, 'photoList', data.data.photoList ? data.data.photoList : []);
|
|
|
|
+ this.$set(this.form, 'voiceList', data.data.voiceList ? data.data.voiceList : []);
|
|
|
|
+
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//获取草稿详情
|
|
//获取草稿详情
|
|
@@ -201,10 +202,10 @@
|
|
//编辑的时候
|
|
//编辑的时候
|
|
this.$set(this, 'newData', data.data);
|
|
this.$set(this, 'newData', data.data);
|
|
this.$set(this.newData, 'checkPlanSetVoList', this.optionData.checkPlanSetVoList);
|
|
this.$set(this.newData, 'checkPlanSetVoList', this.optionData.checkPlanSetVoList);
|
|
- this.$set(this.form, 'checkFlag', data.data.checkFlag?data.data.checkFlag:false);
|
|
|
|
- this.$set(this.form, 'hazardDescribe', data.data.hazardDescribe?data.data.hazardDescribe:'');
|
|
|
|
- this.$set(this.form, 'photoList', data.data.photoList?data.data.photoList:[]);
|
|
|
|
- this.$set(this.form, 'voiceList', data.data.voiceList?data.data.voiceList:[]);
|
|
|
|
|
|
+ this.$set(this.form, 'checkFlag', data.data.checkFlag ? data.data.checkFlag : false);
|
|
|
|
+ this.$set(this.form, 'hazardDescribe', data.data.hazardDescribe ? data.data.hazardDescribe : '');
|
|
|
|
+ this.$set(this.form, 'photoList', data.data.photoList ? data.data.photoList : []);
|
|
|
|
+ this.$set(this.form, 'voiceList', data.data.voiceList ? data.data.voiceList : []);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//获取检查项在当前实验室出现的次数
|
|
//获取检查项在当前实验室出现的次数
|
|
@@ -223,10 +224,10 @@
|
|
},
|
|
},
|
|
//提交
|
|
//提交
|
|
async submitForm(status) {
|
|
async submitForm(status) {
|
|
-
|
|
|
|
|
|
+
|
|
console.log(this.form.checkFlag)
|
|
console.log(this.form.checkFlag)
|
|
- if(!this.form.checkFlag){
|
|
|
|
- if(!this.form.hazardDescribe){
|
|
|
|
|
|
+ if (!this.form.checkFlag) {
|
|
|
|
+ if (!this.form.hazardDescribe) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '请填写隐患描述!',
|
|
title: '请填写隐患描述!',
|
|
icon: "none",
|
|
icon: "none",
|
|
@@ -235,7 +236,7 @@
|
|
});
|
|
});
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(!this.form.photoList[0] && !this.form.checkFlag){
|
|
|
|
|
|
+ if (!this.form.photoList[0] && !this.form.checkFlag) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '请选择现场照片!',
|
|
title: '请选择现场照片!',
|
|
icon: "none",
|
|
icon: "none",
|
|
@@ -257,14 +258,14 @@
|
|
data
|
|
data
|
|
} = await securityAppCheckSetOptionCheckCommit(obj);
|
|
} = await securityAppCheckSetOptionCheckCommit(obj);
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
- if(status==1){
|
|
|
|
|
|
+ if (status == 1) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '保存成功!',
|
|
title: '保存成功!',
|
|
icon: "none",
|
|
icon: "none",
|
|
mask: true,
|
|
mask: true,
|
|
duration: 2000
|
|
duration: 2000
|
|
});
|
|
});
|
|
- }else if(status==2){
|
|
|
|
|
|
+ } else if (status == 2) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '提交成功!',
|
|
title: '提交成功!',
|
|
icon: "none",
|
|
icon: "none",
|
|
@@ -273,10 +274,11 @@
|
|
});
|
|
});
|
|
}
|
|
}
|
|
let infoData = this.optionData;
|
|
let infoData = this.optionData;
|
|
- infoData.itemsStatus = status==1?2:0;
|
|
|
|
|
|
+ infoData.itemsStatus = status == 1 ? 2 : 0;
|
|
uni.redirectTo({
|
|
uni.redirectTo({
|
|
- url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail?infoData=' + encodeURIComponent(JSON
|
|
|
|
- .stringify(infoData))
|
|
|
|
|
|
+ url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail?infoData=' +
|
|
|
|
+ encodeURIComponent(JSON
|
|
|
|
+ .stringify(infoData))
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -303,9 +305,9 @@
|
|
/******图片上传******/
|
|
/******图片上传******/
|
|
selectImage() {
|
|
selectImage() {
|
|
let self = this;
|
|
let self = this;
|
|
- if (this.form.photoList.length > 4) {
|
|
|
|
|
|
+ if (this.form.photoList.length > 5) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
- title: '最多上传5张图片',
|
|
|
|
|
|
+ title: '最多上传6张图片',
|
|
icon: "none",
|
|
icon: "none",
|
|
mask: true,
|
|
mask: true,
|
|
duration: 2000
|
|
duration: 2000
|
|
@@ -313,12 +315,15 @@
|
|
return
|
|
return
|
|
}
|
|
}
|
|
wx.chooseImage({
|
|
wx.chooseImage({
|
|
- count: 1,
|
|
|
|
|
|
+ count: 6,
|
|
sizeType: ["original", "compressed"],
|
|
sizeType: ["original", "compressed"],
|
|
sourceType: ["album", "camera"],
|
|
sourceType: ["album", "camera"],
|
|
success: function(res) {
|
|
success: function(res) {
|
|
- let tempFilePaths = res.tempFilePaths[0];
|
|
|
|
- self.uploadImg(tempFilePaths);
|
|
|
|
|
|
+ if (res.tempFilePaths[0]) {
|
|
|
|
+ res.tempFilePaths.forEach(function(item, index) {
|
|
|
|
+ self.uploadImg(item);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -707,6 +712,10 @@
|
|
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
|
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
|
margin: 0 10rpx 10rpx 0;
|
|
margin: 0 10rpx 10rpx 0;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ >img:nth-of-type(4) {
|
|
|
|
+ margin-right: 0;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
.describe {
|
|
.describe {
|
|
@@ -733,12 +742,16 @@
|
|
}
|
|
}
|
|
|
|
|
|
.right-img-box {
|
|
.right-img-box {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
+
|
|
.img-box {
|
|
.img-box {
|
|
display inline-block;
|
|
display inline-block;
|
|
height: 150rpx;
|
|
height: 150rpx;
|
|
width: 150rpx;
|
|
width: 150rpx;
|
|
position relative;
|
|
position relative;
|
|
- margin: 0 14rpx 20rpx 0;
|
|
|
|
|
|
+ margin: 0 10rpx 20rpx 0;
|
|
border-radius 10rpx;
|
|
border-radius 10rpx;
|
|
overflow hidden;
|
|
overflow hidden;
|
|
|
|
|
|
@@ -756,7 +769,7 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- .img-box:nth-of-type(3n+3) {
|
|
|
|
|
|
+ .img-box:nth-of-type(4n+4) {
|
|
margin-right: 0rpx;
|
|
margin-right: 0rpx;
|
|
}
|
|
}
|
|
|
|
|