|
@@ -4,12 +4,12 @@
|
|
<scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
|
|
<scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
|
|
<viwe class="list">
|
|
<viwe class="list">
|
|
<view class="title">不符合项</view>
|
|
<view class="title">不符合项</view>
|
|
- <view class="check-for-big-box" v-for="(item,index) in form.detailsList" :key="index">
|
|
|
|
|
|
+ <view class="check-for-big-box" v-for="(item,index) in form.checkHazardDtoList" :key="index">
|
|
<view class="grade">
|
|
<view class="grade">
|
|
<view class="grade_l">隐患等级:</view>
|
|
<view class="grade_l">隐患等级:</view>
|
|
<picker @change="gradeChange(item,$event)" :value="gradeIndex" :range="gradeArray" class="scope_r">
|
|
<picker @change="gradeChange(item,$event)" :value="gradeIndex" :range="gradeArray" class="scope_r">
|
|
<view class="grade_r">
|
|
<view class="grade_r">
|
|
- <view>{{item.grade}}</view>
|
|
|
|
|
|
+ <view>{{item.hazardLevel==0?'一般隐患':(item.hazardLevel==1?'重大隐患':'问题管理')}}</view>
|
|
<img src="@/images/Version3.3.3/icon_06.png">
|
|
<img src="@/images/Version3.3.3/icon_06.png">
|
|
</view>
|
|
</view>
|
|
</picker>
|
|
</picker>
|
|
@@ -17,27 +17,27 @@
|
|
<view class="project" v-if="checkOptionList.length>0">
|
|
<view class="project" v-if="checkOptionList.length>0">
|
|
<view class="project_l">检查项目:</view>
|
|
<view class="project_l">检查项目:</view>
|
|
<uni-data-picker :ellipsis="false" :localdata="checkOptionList[index]" :map="{text:'name',value:'id'}"
|
|
<uni-data-picker :ellipsis="false" :localdata="checkOptionList[index]" :map="{text:'name',value:'id'}"
|
|
- popup-title="请选择所属目录" @change="(e)=>onchange(e,index)" @nodeclick="onnodeclick"
|
|
|
|
|
|
+ popup-title="请选择所属目录" @change="(e)=>onchange(e,index)" @nodeclick="onnodeclick()"
|
|
ref="uniDataPicker" :addType="true" :addIndex="index">
|
|
ref="uniDataPicker" :addType="true" :addIndex="index">
|
|
- <view class="project_r">{{item.jcxName?item.jcxName:'请选择检查项'}}</view>
|
|
|
|
|
|
+ <view class="project_r">{{item.hazardCheckName?item.hazardCheckName:'请选择检查项'}}</view>
|
|
</uni-data-picker>
|
|
</uni-data-picker>
|
|
</view>
|
|
</view>
|
|
<view class="point">
|
|
<view class="point">
|
|
<view class="point_l">检查要点:</view>
|
|
<view class="point_l">检查要点:</view>
|
|
- <textarea class="point_r" type="text" v-model="item.yhMs" maxlength="50" placeholder="未查到此项检查要点,可在此输入添加" placeholder-style="font-size:28rpx;color:#999;"></textarea>
|
|
|
|
|
|
+ <textarea class="point_r" type="text" v-model="item.hazardCheckPoint" maxlength="50" placeholder="未查到此项检查要点,可在此输入添加" placeholder-style="font-size:28rpx;color:#999;"></textarea>
|
|
</view>
|
|
</view>
|
|
<view class="check-for-input-max-box">
|
|
<view class="check-for-input-max-box">
|
|
<view class="left-title-p">隐患描述:</view>
|
|
<view class="left-title-p">隐患描述:</view>
|
|
- <textarea type="text" v-model="item.yhMs" maxlength="50" placeholder="请输入隐患描述" placeholder-style="font-size:28rpx;color:#999;"></textarea>
|
|
|
|
|
|
+ <textarea type="text" v-model="item.hazardDescribe" maxlength="50" placeholder="请输入隐患描述" placeholder-style="font-size:28rpx;color:#999;"></textarea>
|
|
</view>
|
|
</view>
|
|
<view class="check-for-img-max-box">
|
|
<view class="check-for-img-max-box">
|
|
<view class="left-title-p">隐患照片(最多上传5张):</view>
|
|
<view class="left-title-p">隐患照片(最多上传5张):</view>
|
|
<view class="right-img-box">
|
|
<view class="right-img-box">
|
|
- <view class="img-box" v-for="(imgUrl,imgIndex) in item.yhImg" :key="imgIndex">
|
|
|
|
- <img class="img-data" :src="configURL+imgUrl">
|
|
|
|
|
|
+ <view class="img-box" v-for="(imgItem,imgIndex) in item.uploadDtoList" :key="imgIndex">
|
|
|
|
+ <img class="img-data" :src="configURL+imgItem.fileUrl">
|
|
<img class="position-img" src="@/pages_manage/images/icon_ssp_closure.png" @click="delImg(index,imgIndex)">
|
|
<img class="position-img" src="@/pages_manage/images/icon_ssp_closure.png" @click="delImg(index,imgIndex)">
|
|
</view>
|
|
</view>
|
|
- <img class="add-button" src="@/pages_manage/images/icon_07.png" @click="selectImage(item)" v-if="item.yhImg.length<5">
|
|
|
|
|
|
+ <img class="add-button" src="@/pages_manage/images/icon_07.png" @click="selectImage(item)" v-if="item.uploadDtoList.length<5">
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="voice">
|
|
<view class="voice">
|
|
@@ -45,12 +45,12 @@
|
|
<view class="voice_t_l">语音备注:</view>
|
|
<view class="voice_t_l">语音备注:</view>
|
|
<img class="voice_t_r" src="@/images/Version3.3.3/icon_ksjc_yysr.png" @longpress.stop="recordButton(item,$event)" @touchmove.stop="cancelButton" @touchend.stop="sendButton(item,$event)">
|
|
<img class="voice_t_r" src="@/images/Version3.3.3/icon_ksjc_yysr.png" @longpress.stop="recordButton(item,$event)" @touchmove.stop="cancelButton" @touchend.stop="sendButton(item,$event)">
|
|
</view>
|
|
</view>
|
|
- <view class="voice_b" v-for="(voiceItem,voiceIndex) in item.voice" :key="voiceIndex">
|
|
|
|
|
|
+ <view class="voice_b" v-for="(voiceItem,voiceIndex) in item.voiceRemark" :key="voiceIndex">
|
|
<view class="voice_b_l" @tap="voicePlay(voiceItem.url)"><img class="add-button" src="@/pages_manage/images/icon_yyt.png"/>{{voiceItem.times}}″</view>
|
|
<view class="voice_b_l" @tap="voicePlay(voiceItem.url)"><img class="add-button" src="@/pages_manage/images/icon_yyt.png"/>{{voiceItem.times}}″</view>
|
|
<img class="voice_b_r" src="@/pages_manage/images/Version2.3/icon_sczl_sc.png" @tap="voiceDele(index,voiceIndex)"/>
|
|
<img class="voice_b_r" src="@/pages_manage/images/Version2.3/icon_sczl_sc.png" @tap="voiceDele(index,voiceIndex)"/>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="check-for-big-box-position-img-box" v-if="form.detailsList.length>1" @click="delDetailsList(index)">
|
|
|
|
|
|
+ <view class="check-for-big-box-position-img-box" v-if="form.checkHazardDtoList.length>1" @click="delDetailsList(index)">
|
|
<img src="@/pages_manage/images/icon_ssp_closure.png">
|
|
<img src="@/pages_manage/images/icon_ssp_closure.png">
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -66,7 +66,7 @@
|
|
<script>
|
|
<script>
|
|
const myaudio = uni.createInnerAudioContext();
|
|
const myaudio = uni.createInnerAudioContext();
|
|
import { config } from '@/api/request/config.js'
|
|
import { config } from '@/api/request/config.js'
|
|
- import { checkRecordAddC,checkRecordAdd,getSelectInfoByRoom, checkOptionList, treeselect,treeDepselect, addTempCheckOption,recordDettailsList,checkRecordUpdate } from '@/api/index.js'
|
|
|
|
|
|
+ import {checkOptionListNew,treeDepselect,checkManageAdd} from '@/api/index.js'
|
|
export default {
|
|
export default {
|
|
name: "startChecking",
|
|
name: "startChecking",
|
|
data() {
|
|
data() {
|
|
@@ -74,33 +74,36 @@
|
|
|
|
|
|
configURL:config.base_url,
|
|
configURL:config.base_url,
|
|
id:"",
|
|
id:"",
|
|
- //新增项or固有
|
|
|
|
- isLingshi:0,
|
|
|
|
//页面子状态
|
|
//页面子状态
|
|
minPageType:1,
|
|
minPageType:1,
|
|
//临时存储隐患信息ID
|
|
//临时存储隐患信息ID
|
|
hiddenDangerIdList:[],
|
|
hiddenDangerIdList:[],
|
|
//数据
|
|
//数据
|
|
form:{
|
|
form:{
|
|
- checkName:'',//检查名称
|
|
|
|
- fjNumber:"",
|
|
|
|
- buildingId:"",
|
|
|
|
- buildingName:"",
|
|
|
|
- laboratoryId:"",
|
|
|
|
- laboratoryName:"",
|
|
|
|
- fzrId:"",
|
|
|
|
- fzrName:"",
|
|
|
|
- fzrLxfs:"",
|
|
|
|
- jcDw:"",
|
|
|
|
- detailsList:[
|
|
|
|
|
|
+ id:'',
|
|
|
|
+ checkPlanId:'',
|
|
|
|
+ manageStatus:'',//保存1 提交2
|
|
|
|
+ subId:'',//实验室
|
|
|
|
+ subjectName:'',
|
|
|
|
+ title:'',//计划标题
|
|
|
|
+ deptId:'',//学院
|
|
|
|
+ collegeName:'',
|
|
|
|
+ buildId:'',//楼栋
|
|
|
|
+ buildName:'',
|
|
|
|
+ checkType:'',// 检查类型(1校院巡查 2实验室自查)
|
|
|
|
+ checkResult:'1',// 检查结果 0不符合 1符合
|
|
|
|
+ rectifyDeadline:'',//整改期限
|
|
|
|
+ rectifyNotice:'1',//整改通知(1整改告知书 2整改通知书)
|
|
|
|
+ checkHazardDtoList:[
|
|
{
|
|
{
|
|
- isLingshi:0,
|
|
|
|
- yhImg:[],
|
|
|
|
- voice:[],//语音备忘存储
|
|
|
|
- yhMs:"",
|
|
|
|
- jcxId:"",
|
|
|
|
- jcxName:"",
|
|
|
|
- grade:'一般隐患',//隐患等级
|
|
|
|
|
|
+ voiceRemark:[],//语音备忘存储
|
|
|
|
+ hazardLevel:'0',//隐患等级
|
|
|
|
+ hazardCheckCode:'', //检查项目code序号
|
|
|
|
+ hazardCheckName:'', //检查项目名称
|
|
|
|
+ hazardCheckPro:'', //最后一级的id
|
|
|
|
+ hazardCheckPoint:'',// 检查要点
|
|
|
|
+ hazardDescribe:'', //隐患描述
|
|
|
|
+ uploadDtoList:[],//隐患照片
|
|
}
|
|
}
|
|
],
|
|
],
|
|
},
|
|
},
|
|
@@ -112,7 +115,6 @@
|
|
searchNullType:true,
|
|
searchNullType:true,
|
|
//检查项
|
|
//检查项
|
|
checkOptionList:[],
|
|
checkOptionList:[],
|
|
- checkOptionListExamination:[],
|
|
|
|
//新增检查项
|
|
//新增检查项
|
|
openIndex:"",
|
|
openIndex:"",
|
|
open:false,
|
|
open:false,
|
|
@@ -129,28 +131,23 @@
|
|
recorderManager : wx.getRecorderManager(),
|
|
recorderManager : wx.getRecorderManager(),
|
|
temporaryData:[],
|
|
temporaryData:[],
|
|
gradeIndex :0,
|
|
gradeIndex :0,
|
|
- gradeArray:['一般隐患','重大隐患'],
|
|
|
|
|
|
+ gradeArray:['一般隐患','重大隐患','问题管理'],
|
|
bottomBtnList:['上一步','保存','提交'],
|
|
bottomBtnList:['上一步','保存','提交'],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
- this.getCheckOptionListTwo();
|
|
|
|
- this.treeselect();
|
|
|
|
- if(option.id){
|
|
|
|
- this.id = option.id;
|
|
|
|
- this.getInfo();
|
|
|
|
- }else{
|
|
|
|
- this.getCheckOptionList();
|
|
|
|
|
|
+ if(option.form){
|
|
|
|
+ this.form=JSON.parse(decodeURIComponent(option.form));
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ this.getCheckOptionList();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
//隐患等级
|
|
//隐患等级
|
|
gradeChange(item,e){
|
|
gradeChange(item,e){
|
|
- item.grade=this.gradeArray[e.target.value]
|
|
|
|
|
|
+ item.hazardLevel=e.target.value
|
|
|
|
+
|
|
},
|
|
},
|
|
//语音备忘播放
|
|
//语音备忘播放
|
|
async voicePlay(item){
|
|
async voicePlay(item){
|
|
@@ -168,7 +165,7 @@
|
|
success (res) {
|
|
success (res) {
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
console.log('用户点击确定')
|
|
console.log('用户点击确定')
|
|
- self.form.detailsList[index].voice.splice(voiceIndex,1);
|
|
|
|
|
|
+ self.form.checkHazardDtoList[index].voiceRemark.splice(voiceIndex,1);
|
|
self.$forceUpdate();
|
|
self.$forceUpdate();
|
|
} else if (res.cancel) {
|
|
} else if (res.cancel) {
|
|
console.log('用户点击取消')
|
|
console.log('用户点击取消')
|
|
@@ -182,7 +179,7 @@
|
|
recordButton(item,e){
|
|
recordButton(item,e){
|
|
console.log("按下")
|
|
console.log("按下")
|
|
let self = this;
|
|
let self = this;
|
|
- if(item.voice.length>=5){
|
|
|
|
|
|
+ if(item.voiceRemark.length>=5){
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '语音备忘最多只能上传5条',
|
|
title: '语音备忘最多只能上传5条',
|
|
icon:"none",
|
|
icon:"none",
|
|
@@ -277,7 +274,7 @@
|
|
console.log("上传成功",res)
|
|
console.log("上传成功",res)
|
|
console.log(item)
|
|
console.log(item)
|
|
let seconds = Math.round((parseInt(times) % (1000 * 60)) / 1000);
|
|
let seconds = Math.round((parseInt(times) % (1000 * 60)) / 1000);
|
|
- item.voice.push({'times':seconds,'url':res.data.url})
|
|
|
|
|
|
+ item.voiceRemark.push({'times':seconds,'url':res.data.url})
|
|
console.log(JSON.stringify(self.voice))
|
|
console.log(JSON.stringify(self.voice))
|
|
//self.textParseUrlIps(res.data.url);
|
|
//self.textParseUrlIps(res.data.url);
|
|
// self.newData.imgList.push(res.data.url);
|
|
// self.newData.imgList.push(res.data.url);
|
|
@@ -297,17 +294,37 @@
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**************************检查项***************************/
|
|
|
|
+
|
|
|
|
+ //获取检查项
|
|
|
|
+ async getCheckOptionList() {
|
|
|
|
+ const {data} = await checkOptionListNew();
|
|
|
|
+ if(data.code == 200){
|
|
|
|
+ let list = this.getTreeData(data.data);
|
|
|
|
+ this.checkOptionList.push(JSON.parse(JSON.stringify(list)));
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ getTreeData(data){
|
|
|
|
+ for(var i=0;i<data.length>0;i++){
|
|
|
|
+ if(data[i].children == null||data[i].children.length<=0){
|
|
|
|
+ // children若为空数组,则将children设为undefined
|
|
|
|
+ data[i].children = undefined;
|
|
|
|
+ }else {
|
|
|
|
+ // children若不为空数组,则继续 递归调用 本方法
|
|
|
|
+ this.getTreeData(data[i].children);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return data;
|
|
|
|
+ },
|
|
|
|
+ /**************************搜索项***************************/
|
|
//搜索特定检查项
|
|
//搜索特定检查项
|
|
async searchClick(text,index){
|
|
async searchClick(text,index){
|
|
console.log("搜索text",text);
|
|
console.log("搜索text",text);
|
|
console.log("搜索index",index);
|
|
console.log("搜索index",index);
|
|
- let newObj = {
|
|
|
|
- level:4,
|
|
|
|
- searchValue:text
|
|
|
|
- }
|
|
|
|
- const {data} = await checkOptionList(newObj);
|
|
|
|
|
|
+ const {data} = await checkOptionListNew({'searchValue':text});
|
|
if(data.code == 200){
|
|
if(data.code == 200){
|
|
-
|
|
|
|
if(data.data[0]){
|
|
if(data.data[0]){
|
|
let list = JSON.parse(JSON.stringify(this.checkOptionList));
|
|
let list = JSON.parse(JSON.stringify(this.checkOptionList));
|
|
list[index] = this.getTreeData(data.data);
|
|
list[index] = this.getTreeData(data.data);
|
|
@@ -327,12 +344,8 @@
|
|
//重置检查项
|
|
//重置检查项
|
|
async resetClick(index){
|
|
async resetClick(index){
|
|
console.log("重置index",index);
|
|
console.log("重置index",index);
|
|
- let newObj = {
|
|
|
|
- level:4,
|
|
|
|
- }
|
|
|
|
- const {data} = await checkOptionList(newObj);
|
|
|
|
|
|
+ const {data} = await checkOptionListNew();
|
|
if(data.code == 200){
|
|
if(data.code == 200){
|
|
-
|
|
|
|
let list = JSON.parse(JSON.stringify(this.checkOptionList));
|
|
let list = JSON.parse(JSON.stringify(this.checkOptionList));
|
|
list[index] = this.getTreeData(data.data);
|
|
list[index] = this.getTreeData(data.data);
|
|
this.$set(this,'checkOptionList',JSON.parse(JSON.stringify(list)))
|
|
this.$set(this,'checkOptionList',JSON.parse(JSON.stringify(list)))
|
|
@@ -340,75 +353,39 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
- /**************************检查项***************************/
|
|
|
|
-
|
|
|
|
- //获取检查项
|
|
|
|
- async getCheckOptionList() {
|
|
|
|
- let newObj = {
|
|
|
|
- level:4,
|
|
|
|
- }
|
|
|
|
- const {data} = await checkOptionList(newObj);
|
|
|
|
- if(data.code == 200){
|
|
|
|
-
|
|
|
|
- let list = this.getTreeData(data.data);
|
|
|
|
- this.checkOptionList.push(JSON.parse(JSON.stringify(list)));
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- async getCheckOptionListTwo() {
|
|
|
|
- let newObj = {
|
|
|
|
- level:3,
|
|
|
|
- }
|
|
|
|
- const {data} = await checkOptionList(newObj);
|
|
|
|
- if(data.code == 200){
|
|
|
|
- let list = this.getTreeData(data.data);
|
|
|
|
- this.checkOptionListExamination = JSON.parse(JSON.stringify(list));
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- async treeselect() {
|
|
|
|
|
|
+ //选中固有检查项(新)
|
|
|
|
+ onchange(e,index) {
|
|
let self = this;
|
|
let self = this;
|
|
- const {data} = await treeselect({});
|
|
|
|
- if(data.code == 200){
|
|
|
|
- let list = [];
|
|
|
|
- for(let i=0;i<data.data[0].children.length;i++){
|
|
|
|
- let obj = {
|
|
|
|
- id:data.data[0].children[i].id,
|
|
|
|
- label:data.data[0].children[i].label,
|
|
|
|
- }
|
|
|
|
- if(data.data[0].children[i].children){
|
|
|
|
- for(let o=0;o<data.data[0].children[i].children.length;o++){
|
|
|
|
- let obj = {
|
|
|
|
- id:data.data[0].children[i].children[o].id,
|
|
|
|
- label:data.data[0].children[i].children[o].label,
|
|
|
|
- }
|
|
|
|
- self.inspectionUnitArray.push(data.data[0].children[i].children[o].label)
|
|
|
|
- list.push(obj);
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- self.inspectionUnitArray.push(data.data[0].children[i].label)
|
|
|
|
- list.push(obj);
|
|
|
|
- }
|
|
|
|
|
|
+ //hazardCheckCode:'', //检查项目code序号
|
|
|
|
+ //hazardCheckName:'', //检查项目名称
|
|
|
|
+ //hazardCheckPro:'', //最后一级的id
|
|
|
|
+ let jcxSstkNum=this.getTreeName(this.checkOptionList[0],e.detail.value[e.detail.value.length-1].value)
|
|
|
|
+ this.$set(this.form.checkHazardDtoList[index],'hazardCheckPro',e.detail.value[e.detail.value.length-1].value);
|
|
|
|
+ this.$set(this.form.checkHazardDtoList[index],'hazardCheckCode',jcxSstkNum);
|
|
|
|
+ this.$set(this.form.checkHazardDtoList[index],'hazardCheckName',e.detail.value[e.detail.value.length-1].text);
|
|
|
|
+ },
|
|
|
|
+ //根据id查找父元素
|
|
|
|
+ getTreeName(list,id){
|
|
|
|
+ let _this=this
|
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
|
+ let a=list[i]
|
|
|
|
+ if(a.id===id){
|
|
|
|
+ return a.code
|
|
|
|
+ }else{
|
|
|
|
+ if(a.children && a.children.length>0){
|
|
|
|
+ let res=_this.getTreeName(a.children,id)
|
|
|
|
+ if(res){
|
|
|
|
+ return res
|
|
}
|
|
}
|
|
- this.inspectionUnitArrayData = list;
|
|
|
|
}
|
|
}
|
|
- },
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- getTreeData(data){
|
|
|
|
- for(var i=0;i<data.length>0;i++){
|
|
|
|
- if(data[i].children == null||data[i].children.length<=0){
|
|
|
|
- // children若为空数组,则将children设为undefined
|
|
|
|
- data[i].children = undefined;
|
|
|
|
- }else {
|
|
|
|
- // children若不为空数组,则继续 递归调用 本方法
|
|
|
|
- this.getTreeData(data[i].children);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return data;
|
|
|
|
},
|
|
},
|
|
|
|
+ onnodeclick(node) {},
|
|
// 图片上传
|
|
// 图片上传
|
|
selectImage(item) {
|
|
selectImage(item) {
|
|
let self = this;
|
|
let self = this;
|
|
- if(item.yhImg.length>4){
|
|
|
|
|
|
+ if(item.uploadDtoList.length>4){
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '最多上传5张图片',
|
|
title: '最多上传5张图片',
|
|
icon:"none",
|
|
icon:"none",
|
|
@@ -444,7 +421,7 @@
|
|
success: (uploadFileRes) => {
|
|
success: (uploadFileRes) => {
|
|
let res = JSON.parse(uploadFileRes.data);
|
|
let res = JSON.parse(uploadFileRes.data);
|
|
if(res.code == 200){
|
|
if(res.code == 200){
|
|
- item.yhImg.push(res.data.url);
|
|
|
|
|
|
+ item.uploadDtoList.push({'fileUrl':res.data.url,'fileName':res.data.name});
|
|
console.log(res.data.url)
|
|
console.log(res.data.url)
|
|
}else{
|
|
}else{
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -463,12 +440,12 @@
|
|
},
|
|
},
|
|
//删除图片
|
|
//删除图片
|
|
delImg(index,minIndex){
|
|
delImg(index,minIndex){
|
|
- this.form.detailsList[index].yhImg.splice(minIndex,1);
|
|
|
|
|
|
+ this.form.checkHazardDtoList[index].uploadDtoList.splice(minIndex,1);
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
},
|
|
},
|
|
//添加隐患
|
|
//添加隐患
|
|
addDanger(){
|
|
addDanger(){
|
|
- if(this.form.detailsList.length>19){
|
|
|
|
|
|
+ if(this.form.checkHazardDtoList.length>19){
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: '最多添加20个隐患',
|
|
title: '最多添加20个隐患',
|
|
icon:"none",
|
|
icon:"none",
|
|
@@ -478,22 +455,23 @@
|
|
return
|
|
return
|
|
}
|
|
}
|
|
let obj = {
|
|
let obj = {
|
|
- isLingshi:0,
|
|
|
|
- yhImg:[],
|
|
|
|
- voice:[],
|
|
|
|
- yhMs:"",
|
|
|
|
- jcxId:"",
|
|
|
|
- jcxName:"",
|
|
|
|
- grade:"一般隐患",
|
|
|
|
|
|
+ voiceRemark:[],//语音备忘存储
|
|
|
|
+ hazardLevel:'0',//隐患等级
|
|
|
|
+ hazardCheckCode:'', //检查项目code序号
|
|
|
|
+ hazardCheckName:'', //检查项目名称
|
|
|
|
+ hazardCheckPro:'', //最后一级的id
|
|
|
|
+ hazardCheckPoint:'',// 检查要点
|
|
|
|
+ hazardDescribe:'', //隐患描述
|
|
|
|
+ uploadDtoList:[],//隐患照片
|
|
}
|
|
}
|
|
- this.form.detailsList.push(obj);
|
|
|
|
|
|
+ this.form.checkHazardDtoList.push(obj);
|
|
this.getCheckOptionList();
|
|
this.getCheckOptionList();
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
},
|
|
},
|
|
//删除隐患
|
|
//删除隐患
|
|
delDetailsList(index){
|
|
delDetailsList(index){
|
|
- this.hiddenDangerIdList.push(this.form.detailsList[index].id)
|
|
|
|
- this.form.detailsList.splice(index,1);
|
|
|
|
|
|
+ this.hiddenDangerIdList.push(this.form.checkHazardDtoList[index].id)
|
|
|
|
+ this.form.checkHazardDtoList.splice(index,1);
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
},
|
|
},
|
|
//子页面切换
|
|
//子页面切换
|
|
@@ -503,87 +481,50 @@
|
|
uni.redirectTo({
|
|
uni.redirectTo({
|
|
url: '/pages/pages_safetyExamine/examineManage/examineAdd?form='+encodeURIComponent(JSON.stringify(this.form))
|
|
url: '/pages/pages_safetyExamine/examineManage/examineAdd?form='+encodeURIComponent(JSON.stringify(this.form))
|
|
});
|
|
});
|
|
- }else if(index == 2 || index ==3){
|
|
|
|
|
|
+ }else if(index == 1 || index == 2){
|
|
|
|
+ this.form.manageStatus=index;//1保存 2提交
|
|
|
|
+ for(let i=0;i<self.form.checkHazardDtoList.length;i++){
|
|
|
|
+ let num = i+1;
|
|
|
|
+ if(!self.form.checkHazardDtoList[i].hazardCheckName){
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '第'+num+'未选择隐患项',
|
|
|
|
+ icon:"none",
|
|
|
|
+ mask:true,
|
|
|
|
+ duration: 2000
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }else if(!self.form.checkHazardDtoList[i].hazardDescribe && self.form.checkHazardDtoList[i].voiceRemark.length<=0){
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '请输入第'+num+'项隐患描述!',
|
|
|
|
+ icon:"none",
|
|
|
|
+ mask:true,
|
|
|
|
+ duration: 2000
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.submitForm();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //提交
|
|
|
|
+ async submitForm(){
|
|
|
|
+ let _this = this;
|
|
|
|
+
|
|
|
|
+ const {data} = await checkManageAdd(_this.form);
|
|
|
|
+ if(data.code == 200){
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '提交成功',
|
|
|
|
+ icon:"none",
|
|
|
|
+ mask:true,
|
|
|
|
+ duration: 2000
|
|
|
|
+ });
|
|
uni.redirectTo({
|
|
uni.redirectTo({
|
|
url: '/pages/pages_safetyExamine/examineManage/examineList?form='+encodeURIComponent(JSON.stringify(this.form))
|
|
url: '/pages/pages_safetyExamine/examineManage/examineList?form='+encodeURIComponent(JSON.stringify(this.form))
|
|
});
|
|
});
|
|
- // for(let i=0;i<self.form.detailsList.length;i++){
|
|
|
|
- // let num = i+1;
|
|
|
|
- // if(!self.form.detailsList[i].jcxName){
|
|
|
|
- // uni.showToast({
|
|
|
|
- // title: '第'+num+'未选择隐患项',
|
|
|
|
- // icon:"none",
|
|
|
|
- // mask:true,
|
|
|
|
- // duration: 2000
|
|
|
|
- // });
|
|
|
|
- // return
|
|
|
|
- // }else if(!self.form.detailsList[i].yhMs && self.form.detailsList[i].voice.length<=0){
|
|
|
|
- // uni.showToast({
|
|
|
|
- // title: '请输入第'+num+'项隐患描述!',
|
|
|
|
- // icon:"none",
|
|
|
|
- // mask:true,
|
|
|
|
- // duration: 2000
|
|
|
|
- // });
|
|
|
|
- // return
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
}
|
|
}
|
|
- },
|
|
|
|
|
|
+ },
|
|
|
|
|
|
- /**************************搜索项***************************/
|
|
|
|
|
|
|
|
- //选中固有检查项(新)
|
|
|
|
- onchange(e,index) {
|
|
|
|
- let self = this;
|
|
|
|
- let val = e.detail.value[e.detail.value.length-1].value
|
|
|
|
- let num = 0;
|
|
|
|
- for(let i=0;i<self.temporaryIdList.length;i++){
|
|
|
|
- if(self.temporaryIdList[i] == val){
|
|
|
|
- num++
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if(num == 0){
|
|
|
|
- this.$set(this.form.detailsList[index],'isLingshi',0);
|
|
|
|
- }else{
|
|
|
|
- this.$set(this.form.detailsList[index],'isLingshi',1);
|
|
|
|
- }
|
|
|
|
- let list = [];
|
|
|
|
- let listName=[];
|
|
|
|
- for(let i=0;i<e.detail.value.length;i++){
|
|
|
|
- list.push(e.detail.value[i].value)
|
|
|
|
-
|
|
|
|
- if(i<3){
|
|
|
|
- listName.push(e.detail.value[i].text)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- let jcxSstkNum=this.getTreeName(this.checkOptionList[0],e.detail.value[e.detail.value.length-1].value)
|
|
|
|
-
|
|
|
|
- this.$set(this.form.detailsList[index],'jcxSstkNum',jcxSstkNum);
|
|
|
|
- this.$set(this.form.detailsList[index],'jcxId',list);
|
|
|
|
- this.$set(this.form.detailsList[index],'jcxSstkMs',listName.join('-'));
|
|
|
|
- this.$set(this.form.detailsList[index],'jcxName',e.detail.value[e.detail.value.length-1].text);
|
|
|
|
- },
|
|
|
|
- //根据id查找父元素
|
|
|
|
- getTreeName(list,id){
|
|
|
|
- let _this=this
|
|
|
|
- for (let i = 0; i < list.length; i++) {
|
|
|
|
- let a=list[i]
|
|
|
|
- if(a.id===id){
|
|
|
|
- return a.code
|
|
|
|
- }else{
|
|
|
|
- if(a.children && a.children.length>0){
|
|
|
|
- let res=_this.getTreeName(a.children,id)
|
|
|
|
- if(res){
|
|
|
|
- return res
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- onnodeclick(node) {
|
|
|
|
- console.log("node",node)
|
|
|
|
- },
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|