|
@@ -2,14 +2,14 @@
|
|
|
<template>
|
|
|
<view class="inspectAdd">
|
|
|
<scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
|
|
|
- <view class="tip">第一次检查</view>
|
|
|
+ <view class="tip">{{newData.checkName}}</view>
|
|
|
<view class="items">
|
|
|
<view class="items-t">
|
|
|
- <view class="items-t-r">{{newData.data3}}</view>
|
|
|
+ <view class="items-t-r">{{newData.hazardCheckCode}} {{newData.hazardCheckName}}</view>
|
|
|
</view>
|
|
|
- <view class="items-b">< {{newData.data4}} <</view>
|
|
|
+ <view class="items-b">< {{newData.hazardCheckCode2}} {{newData.hazardCheckName2}} <</view>
|
|
|
</view>
|
|
|
- <view class="items-number">此检查项在当前实验室累计出现<text>{{newData.data5}}</text>次隐患</view>
|
|
|
+ <view class="items-number">此检查项在当前实验室累计出现<text>{{newData.hazardCheckNum}}</text>次隐患</view>
|
|
|
<view class="list">
|
|
|
<view class="list-li">
|
|
|
<view>检查要点</view>
|
|
@@ -17,7 +17,14 @@
|
|
|
<img src="@/pages_safetyCheck/images/icon_06.png">
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="hidden-content">{{newData.data6}}
|
|
|
+ <view class="hidden-content">{{newData.hazardCheckPoint}}
|
|
|
+ </view>
|
|
|
+ <view class="radio_group">
|
|
|
+ <view class="radio" v-for="(item,index) in radioList" :key="index" @click="radioClick(item)">
|
|
|
+ <img v-if="!item.checked" src="@/pages_safetyCheck/images/icon_aqjc_5.png">
|
|
|
+ <img v-if="item.checked" src="@/pages_safetyCheck/images/icon_aqjc_6.png">
|
|
|
+ <text>{{item.name}}</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="list-li">
|
|
|
<view>检查隐患</view>
|
|
@@ -25,32 +32,30 @@
|
|
|
<img src="@/pages_safetyCheck/images/icon_06.png">
|
|
|
</view>
|
|
|
</view>
|
|
|
- <textarea class="describe" type="text" v-model="form.rectifyDescribe" maxlength="200"
|
|
|
+ <textarea class="describe" type="text" v-model="form.hazardDescribe" maxlength="200"
|
|
|
placeholder="请填写隐患描述" placeholder-style="font-size:24rpx;color:#999;"></textarea>
|
|
|
<view class="check-for-img-max-box">
|
|
|
<view class="left-title-p"></view>
|
|
|
<view class="right-img-box">
|
|
|
- <view class="img-box" v-for="(imgUrl,imgIndex) in form.imgDtoList" :key="imgIndex">
|
|
|
+ <view class="img-box" v-for="(imgUrl,imgIndex) in form.photoList" :key="imgIndex">
|
|
|
<img class="img-data" :src="baseUrl+imgUrl.fileUrl">
|
|
|
<img class="position-img" src="@/pages_safetyCheck/images/icon_ssp_closure.png"
|
|
|
@click="delImg(imgIndex)">
|
|
|
</view>
|
|
|
<img class="add-button" src="@/pages_safetyCheck/images/img_ssp_pz@1x.png"
|
|
|
- @click="selectImage()" v-if="form.imgDtoList.length<5">
|
|
|
+ @click="selectImage()" v-if="form.photoList.length<5">
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="voice">
|
|
|
<view class="voice_t">
|
|
|
- <view class="voice_t_l">语音备注:(选填)</view>
|
|
|
- <!-- <img class="voice_t_r" src="@/pages_safetyExamine/images/icon_ksjc_yysr.png"
|
|
|
- @longpress.stop="recordButton(item,$event)" @touchmove.stop="cancelButton"
|
|
|
- @touchend.stop="sendButton(item,$event)"> -->
|
|
|
+ <view class="voice_t_t" v-if="!voiceList[0]">语音备注:(选填)</view>
|
|
|
+ <view class="voice_t_b" v-if="voiceList[0]">语音备注:({{voiceList.length}})</view>
|
|
|
</view>
|
|
|
- <view class="voice_b" v-for="(voiceItem,voiceIndex) in voiceList" :key="voiceIndex">
|
|
|
- <view class="voice_b_l" @tap="voicePlay(voiceItem.url)">
|
|
|
+ <view class="voice_b" v-if="voiceList[0]" v-for="(voiceItem,voiceIndex) in voiceList" :key="voiceIndex">
|
|
|
+ <view class="voice_b_l" @tap="voicePlay(voiceItem.fileUrl)">
|
|
|
<img class="add-button" src="@/pages_safetyCheck/images//icon_yybz_yy.png" />
|
|
|
- {{voiceItem.times}}″
|
|
|
+ {{voiceItem.fileLength}}″
|
|
|
</view>
|
|
|
<img class="voice_b_r" src="@/pages_safetyCheck/images/icon_yybz_sc.png"
|
|
|
@tap="voiceDele('',voiceIndex)" />
|
|
@@ -64,9 +69,8 @@
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
<view class="sub-btn">
|
|
|
- <view>保存草稿</view>
|
|
|
- <view>符合</view>
|
|
|
- <view>不符合</view>
|
|
|
+ <view @click="submitForm(1)">保存草稿</view>
|
|
|
+ <view @click="submitForm(2)">提交</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
@@ -76,6 +80,11 @@
|
|
|
import {
|
|
|
config
|
|
|
} from '@/api/request/config.js'
|
|
|
+ import {
|
|
|
+ securityAppCheckPlanCheckInfo,
|
|
|
+ securityAppCheckSetOptionCheckCommit,
|
|
|
+ securityAppCheckPhotoGetCheckNumBySub,
|
|
|
+ } from '@/pages_safetyCheck/api/index.js'
|
|
|
export default {
|
|
|
name: "inspectAdd",
|
|
|
components: {
|
|
@@ -85,44 +94,130 @@
|
|
|
return {
|
|
|
baseUrl: config.base_url,
|
|
|
form: {
|
|
|
- imgDtoList: [],
|
|
|
- },
|
|
|
- newData: {
|
|
|
- data1: '实验室名称(房间号)',
|
|
|
- data2: '学院单位名称',
|
|
|
- data3: '1.1.1 检查项检查项检查项检查',
|
|
|
- data4: '1.1 检查项检查项检查项检查项检查项检查项',
|
|
|
- data5: '19',
|
|
|
- data6: '(1)有学校相关会议(校务会议、党委常委会会议等)纪要,内容包含实验室安全工作。',
|
|
|
- data7: '内容内容内容内容内容内容内容内容内容内容内容内内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容',
|
|
|
- data8: '李瑶瑶',
|
|
|
- data9: '2024-01-01',
|
|
|
- data10: '计划标题计划标题计划标题计划标题计划标题计标题计划标题计划标题',
|
|
|
- data11: ['校级检查', '全面检查', '交叉检查'],
|
|
|
- rectificationStatus: 0, //整改状态 0待整改 1暂无法整改 2已整改
|
|
|
+ checkFlag: 0,
|
|
|
+ photoList: [],
|
|
|
},
|
|
|
- voiceList: [{
|
|
|
- 'times': '10',
|
|
|
- 'url': '2312312'
|
|
|
- }, ],
|
|
|
+ newData: {},
|
|
|
+ radioList: [{
|
|
|
+ id: 1,
|
|
|
+ name: '符合',
|
|
|
+ checked: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 0,
|
|
|
+ name: '不符合',
|
|
|
+ checked: true,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ voiceList: [],
|
|
|
+ setOptionId: '', //检查项id
|
|
|
+ manageId: '', //检查管理id
|
|
|
+ subId: '',
|
|
|
+ hazardCheckPro: '',
|
|
|
+ sendLock: true, //发送锁,当为true时上锁,false时解锁发送
|
|
|
+ recorderManager: wx.getRecorderManager(),
|
|
|
}
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
- //this.$set(this, 'newData', JSON.parse(decodeURIComponent(option.infoData)));
|
|
|
+ let optionData = JSON.parse(decodeURIComponent(option.infoData));
|
|
|
+ this.$set(this, 'setOptionId', optionData.setOptionId);
|
|
|
+ this.$set(this, 'manageId', optionData.manageId);
|
|
|
+ this.$set(this, 'subId', optionData.subId);
|
|
|
+ this.$set(this, 'hazardCheckPro', optionData.hazardCheckPro);
|
|
|
+
|
|
|
},
|
|
|
onShow() {
|
|
|
|
|
|
},
|
|
|
mounted() {
|
|
|
-
|
|
|
+ this.securityAppCheckPlanCheckInfo();
|
|
|
+ this.securityAppCheckPhotoGetCheckNumBySub();
|
|
|
},
|
|
|
methods: {
|
|
|
+ //获取详情
|
|
|
+ async securityAppCheckPlanCheckInfo() {
|
|
|
+ let obj = {
|
|
|
+ setOptionId: this.setOptionId,
|
|
|
+ manageId: this.manageId,
|
|
|
+ }
|
|
|
+ const {
|
|
|
+ data
|
|
|
+ } = await securityAppCheckPlanCheckInfo(obj);
|
|
|
+ if (data.code == 200) {
|
|
|
+ this.$set(this, 'newData', data.data);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //获取检查项在当前实验室出现的次数
|
|
|
+ async securityAppCheckPhotoGetCheckNumBySub() {
|
|
|
+ let obj = {
|
|
|
+ subId: this.subId,
|
|
|
+ hazardCheckPro: this.hazardCheckPro,
|
|
|
+ }
|
|
|
+ const {
|
|
|
+ data
|
|
|
+ } = await securityAppCheckPhotoGetCheckNumBySub(obj);
|
|
|
+ if (data.code == 200) {
|
|
|
+ this.$set(this.newData, 'hazardCheckNum', data.data);
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //提交
|
|
|
+ async submitForm(status) {
|
|
|
+ let obj = {
|
|
|
+ checkFlag: this.form.checkFlag,
|
|
|
+ checkStatus: status == 1 ? 2 : 1,
|
|
|
+ hazardDescribe: this.form.hazardDescribe,
|
|
|
+ setOptionId: this.setOptionId,
|
|
|
+ photoList: this.form.photoList,
|
|
|
+ voiceList: this.voiceList,
|
|
|
+ }
|
|
|
+ const {
|
|
|
+ data
|
|
|
+ } = await securityAppCheckSetOptionCheckCommit(obj);
|
|
|
+ if (data.code == 200) {
|
|
|
+ if(status==1){
|
|
|
+ uni.showToast({
|
|
|
+ title: '保存成功!',
|
|
|
+ icon: "none",
|
|
|
+ mask: true,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }else if(status==2){
|
|
|
+ uni.showToast({
|
|
|
+ title: '提交成功!',
|
|
|
+ icon: "none",
|
|
|
+ mask: true,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
//滚动事件
|
|
|
scrollGet() {},
|
|
|
+ //单选按钮
|
|
|
+ radioClick(d) {
|
|
|
+ let self = this;
|
|
|
+ d.checked = !d.checked
|
|
|
+ if (d.checked) {
|
|
|
+ //如果有选中的,循环把其他选中的取消
|
|
|
+ this.radioList.forEach(function(item) {
|
|
|
+ if (item.id == d.id) {
|
|
|
+ self.$set(self.form, 'checkFlag', item.id);
|
|
|
+ } else {
|
|
|
+ item.checked = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
/******图片上传******/
|
|
|
selectImage() {
|
|
|
let self = this;
|
|
|
- if (this.form.imgDtoList.length > 4) {
|
|
|
+ if (this.form.photoList.length > 4) {
|
|
|
uni.showToast({
|
|
|
title: '最多上传5张图片',
|
|
|
icon: "none",
|
|
@@ -160,7 +255,7 @@
|
|
|
success: (uploadFileRes) => {
|
|
|
let res = JSON.parse(uploadFileRes.data);
|
|
|
if (res.code == 200) {
|
|
|
- this.form.imgDtoList.push({
|
|
|
+ this.form.photoList.push({
|
|
|
'fileUrl': res.data.url,
|
|
|
'fileName': res.data.name
|
|
|
});
|
|
@@ -182,7 +277,7 @@
|
|
|
},
|
|
|
//删除图片
|
|
|
delImg(minIndex) {
|
|
|
- this.form.imgDtoList.splice(minIndex, 1);
|
|
|
+ this.form.photoList.splice(minIndex, 1);
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
/******语音备注 *******/
|
|
@@ -317,8 +412,9 @@
|
|
|
console.log(item)
|
|
|
let seconds = Math.round((parseInt(times) % (1000 * 60)) / 1000);
|
|
|
this.voiceList.push({
|
|
|
- 'times': seconds,
|
|
|
- 'url': res.data.url
|
|
|
+ 'fileLength': seconds,
|
|
|
+ 'fileUrl': res.data.url,
|
|
|
+ 'fileName': res.data.name
|
|
|
})
|
|
|
console.log(JSON.stringify(self.voice))
|
|
|
//self.textParseUrlIps(res.data.url);
|
|
@@ -373,7 +469,7 @@
|
|
|
text-align: center;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
.items {
|
|
|
width: 690rpx;
|
|
|
min-height: 165rpx;
|
|
@@ -596,35 +692,74 @@
|
|
|
.list-li:last-of-type {
|
|
|
border: none;
|
|
|
}
|
|
|
+
|
|
|
+ .radio_group {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+ padding: 32rpx 30rpx 22rpx 30rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border-bottom: 1rpx solid #E0E0E0;
|
|
|
+
|
|
|
+ .radio {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ >img {
|
|
|
+ width: 30rpx;
|
|
|
+ height: 30rpx;
|
|
|
+ margin-right: 34rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ >text {
|
|
|
+ font-size: 30rpx;
|
|
|
+ color: #333333;
|
|
|
+ line-height: 42rpx;
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .radio:nth-of-type(1) {
|
|
|
+ margin-right: 54rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/* 语音备注 */
|
|
|
.voice {
|
|
|
width: 690rpx;
|
|
|
- min-height: 440rpx;
|
|
|
+ min-height: 100rpx;
|
|
|
background: #FFFFFF;
|
|
|
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
|
|
- margin: 20rpx 30rpx;
|
|
|
- padding: 30rpx;
|
|
|
+ margin: 0rpx 30rpx;
|
|
|
+ padding: 0 30rpx;
|
|
|
box-sizing: border-box;
|
|
|
+ overflow: hidden;
|
|
|
|
|
|
.voice_t {
|
|
|
- height: 80rpx;
|
|
|
+ height: 100rpx;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
|
|
|
- .voice_t_l {
|
|
|
+ .voice_t_t {
|
|
|
+ width: 100%;
|
|
|
font-size: 30rpx;
|
|
|
font-family: PingFang SC-Medium, PingFang SC;
|
|
|
font-weight: 400;
|
|
|
color: #333333;
|
|
|
- line-height: 80rpx;
|
|
|
+ line-height: 100rpx;
|
|
|
+ text-align: center;
|
|
|
}
|
|
|
|
|
|
- .voice_t_r {
|
|
|
- width: 170rpx;
|
|
|
- height: 50rpx;
|
|
|
+ .voice_t_b {
|
|
|
+ width: 100%;
|
|
|
+ font-size: 30rpx;
|
|
|
+ font-family: PingFang SC-Medium, PingFang SC;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #333333;
|
|
|
+ line-height: 100rpx;
|
|
|
+ text-align: left;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -632,7 +767,7 @@
|
|
|
display flex;
|
|
|
justify-content flex-start;
|
|
|
align-items center;
|
|
|
- margin-bottom: 30rpx;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
|
|
|
.voice_b_l {
|
|
|
width: 400rpx;
|
|
@@ -665,8 +800,9 @@
|
|
|
.voice-btn {
|
|
|
width: 150rpx;
|
|
|
height: 150rpx;
|
|
|
- position: relative;
|
|
|
- margin: 62rpx 0 0 238rpx;
|
|
|
+ position: fixed;
|
|
|
+ right: 24rpx;
|
|
|
+ bottom: 176rpx;
|
|
|
|
|
|
>img {
|
|
|
width: 150rpx;
|
|
@@ -696,9 +832,9 @@
|
|
|
bottom: 30rpx;
|
|
|
|
|
|
>view:nth-of-type(1) {
|
|
|
- width: 230rpx;
|
|
|
+ width: 345rpx;
|
|
|
height: 100rpx;
|
|
|
- background: #009519;
|
|
|
+ background: #FF8C00;
|
|
|
border-radius: 50rpx 0rpx 0rpx 50rpx;
|
|
|
font-size: 30rpx;
|
|
|
color: #FFFFFF;
|
|
@@ -707,20 +843,9 @@
|
|
|
}
|
|
|
|
|
|
>view:nth-of-type(2) {
|
|
|
- width: 230rpx;
|
|
|
+ width: 345rpx;
|
|
|
height: 100rpx;
|
|
|
background: #0183FA;
|
|
|
- border-radius: 0rpx 0rpx 0rpx 0rpx;
|
|
|
- font-size: 30rpx;
|
|
|
- color: #FFFFFF;
|
|
|
- line-height: 100rpx;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
-
|
|
|
- >view:nth-of-type(3) {
|
|
|
- width: 230rpx;
|
|
|
- height: 100rpx;
|
|
|
- background: #FF8C00;
|
|
|
border-radius: 0rpx 50rpx 50rpx 0rpx;
|
|
|
font-size: 30rpx;
|
|
|
color: #FFFFFF;
|