特殊作业选择安全确实确认人

pull/5/head
chenxinying 2024-02-29 11:22:06 +08:00
parent c88c0719a4
commit dc33f7c9e1
11 changed files with 1288 additions and 713 deletions

View File

@ -5,7 +5,7 @@
<view :style="{padding: this.CustomBar + 15 + 'px 15px 15px 15px'}">
<checkbox-group @change="change">
<view v-for="(item,index) in withSelectMeasuresList" :key="index" style="display: flex;margin-top: 15upx">
<checkbox :value="item.BUS_BREAKGROUND_MEASURES_ID" :checked="item.check"/>
<checkbox :value="item[rowKey]" :checked="item.check"/>
<view style="padding-left: 10upx;">{{ item.PROTECTIVE_MEASURES }}</view>
</view>
</checkbox-group>
@ -46,6 +46,11 @@ export default {
type: Number,
required: true,
default: 0
},
rowKey: {
type: String,
required: true,
default: ''
}
},
data() {
@ -89,7 +94,7 @@ export default {
if (allSelectedMeasuresList.length > 0) {
for (let i = 0; i < allSelectedMeasuresList.length; i++) {
for (let j = 0; j < withSelectMeasuresList.length; j++) {
if (allSelectedMeasuresList[i].BUS_BREAKGROUND_MEASURES_ID === withSelectMeasuresList[j].BUS_BREAKGROUND_MEASURES_ID) {
if (allSelectedMeasuresList[i][this.rowKey] === withSelectMeasuresList[j][this.rowKey]) {
withSelectMeasuresList.splice(j, 1)
}
}
@ -113,7 +118,7 @@ export default {
const withSelectMeasuresList = this.withSelectMeasuresList
for (let i = 0; i < selectValue.length; i++) {
for (let j = 0; j < withSelectMeasuresList.length; j++) {
if (selectValue[i] === withSelectMeasuresList[j].BUS_BREAKGROUND_MEASURES_ID) {
if (selectValue[i] === withSelectMeasuresList[j][this.rowKey]) {
value.push(withSelectMeasuresList[j])
}
}

View File

@ -8,68 +8,80 @@
<view class="form">
<detail v-if="pd.BLINDBOARD_ID" :blindboardId="pd.BLINDBOARD_ID" :showMeasures="false"></detail>
<view class="wui-form-list" style="padding-top: 20upx;">
<view class="wui-title" style="margin-left: 20upx;">
<text class="text-semi">安全防护措施</text>
</view>
<view class="wui-table" style="padding: 0 20upx;">
<uni-table name='measuresList' border stripe emptyText="暂无更多数据" >
<!-- 表头行 -->
<uni-tr>
<uni-th align="center" style="font-weight: bold;">主要安全措施</uni-th>
</uni-tr>
<template v-for="(item,index) in measuresList">
<uni-tr>
<uni-td>
<view style="margin-bottom: 20upx;">
{{item.PROTECTIVE_MEASURES}}
</view>
<view class="cu-form-group" >
<view class="title">确认单位</view>
<view class="picker-tree-box">
<view class="picker-tree" @tap="showDeptTree(index)">{{measuresList[index].DEPARTMENT_NAME?measuresList[index].DEPARTMENT_NAME:''}}</view>
<view class="wui-form-list" style="padding-top: 20upx;">
<view class="wui-title" style="margin-left: 20upx;display: flex;justify-content: space-between;align-items: center">
<text class="text-semi">安全防护措施</text>
<button class="cu-btn round bg-blue" @click="addMeasuresListCopy" style="margin-right: 20upx;">添加</button>
</view>
<view>
<view class="add_pard_item" v-for="(item,index) in measuresListCopy" :key="item.id">
<view class="add_pard_del" @click="removeMeasuresListCopy(index)" v-if="index !== 0">
<text class="cuIcon-roundclosefill text-red f40"></text>
</view>
<view class="cu-form-group" >
<view class="title">确认单位</view>
<view class="picker-tree-box">
<view class="picker-tree" @tap="showDeptTree(index)">
{{item.DEPARTMENT_NAME?item.DEPARTMENT_NAME:'请选择'}}
</view>
<tki-tree :ref="'tkiTree'+index"
:selectParent=true
:range="treeNode"
rangeKey="name"
@confirm="deptTreeConfirm($event,index)"
@cancel="deptTreeCancel($event,index)"></tki-tree>
</view>
<view class="cu-form-group" >
<view class="title">确认人</view>
<picker @change="pickerUser($event,index)" :value="item.userIndex" :range="item.userList" range-key="NAME" :disabled="item.userList.length == 0" @click="isBlankList(index)">
<view class="picker">
{{measuresList[index].USER_NAME?measuresList[index].USER_NAME:'请选择'}}
</view>
</picker>
</view>
</uni-td>
</uni-tr>
</template>
</uni-table>
</view>
</view>
<tki-tree
:ref="'tkiTree'+index"
:selectParent=true
:range="treeNode"
rangeKey="name"
@confirm="deptTreeConfirm($event,index)"
@cancel="deptTreeCancel($event,index)">
</tki-tree>
</view>
<view class="cu-form-group" >
<view class="title">确认人</view>
<picker
@change="pickerUser($event,index)"
:value="item.userIndex"
:range="item.userList"
range-key="NAME"
:disabled="item.userList.length === 0"
@click="isBlankList(index)"
>
<view class="picker">
{{item.USER_NAME?item.USER_NAME:'请选择'}}
</view>
</picker>
</view>
<view class="measures cu-form-group">
<view style="flex: 1">
<view style="margin-top: 10upx;display: flex;justify-content: space-between;align-items: center">
<view class="title">安全措施</view>
<view>
<button class="cu-btn round bg-blue" @click="fnSelectMeasures(index)"></button>
</view>
</view>
<view class="content" v-for="(item1,index1) in item.selectMeasures" :key="index1">
{{index1+1}} . {{item1.PROTECTIVE_MEASURES}}
</view>
</view>
</view>
</view>
</view>
<view class="wui-sign" >
<view class="title"></view>
<button class="cu-btn bg-green shadow" @tap="showModal" data-target="Modal">手写签字</button>
<view class="title"></view>
<button class="cu-btn bg-green shadow" @tap="showModal" data-target="Modal">手写签字</button>
</view>
<view class="wui-sign-box" v-show="imgList && imgList.length > 0">
<view class="sign-title">
签字照片
</view>
<view class="wui-sign-cotent">
<view class="sign-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" data-type="0" :data-url="imgList[index].filePath">
<image :src="imgList[index].filePath" mode="aspectFit"></image>
<view class="sign-title">
签字照片
</view>
<view class="wui-sign-cotent">
<view class="sign-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" data-type="0" :data-url="imgList[index].filePath">
<image :src="imgList[index].filePath" mode="aspectFit"></image>
</view>
</view>
</view>
</view>
<view class="cu-modal" :class="modalName=='Modal'?'show':''">
<writing-board @confirm="subCanvas" @cancel="hideModal"></writing-board>
<writing-board @confirm="subCanvas" @cancel="hideModal"></writing-board>
</view>
</view>
</view>
</view>
<view class="cu-bar btn-group" style="margin-top: 30upx;">
<button class="cu-btn bg-red margin-tb-sm lg" @click="$noMultipleClicks(goSubmit,'-1')"> </button>
@ -78,6 +90,7 @@
<view class="padding flex flex-direction">
</view>
</scroll-view>
<select-measures :measures-list="measuresList" v-model="measuresListCopy" :visible.sync="selectMeasuresShow" :index="selectMeasuresIndex" row-key="BUS_BLINDBOARD_MEASURES_ID"/>
</view>
</template>
@ -90,9 +103,10 @@
import gcoord from '@/common/gcoord.js'
import ruiDatePicker from '@/components/rattenking-dtpicker/rattenking-dtpicker.vue';
import detail from '@/pages/application/blindboard/blindboard-detail/index'
import selectMeasures from "@/components/select_measures/index.vue";
export default {
components: {
tkiTree,ruiDatePicker,writingBoard,detail
tkiTree,ruiDatePicker,writingBoard,detail,selectMeasures
},
data() {
return {
@ -102,6 +116,9 @@
treeNode:[],//
pd:{},//
measuresList:[],
measuresListCopy:[],
selectMeasuresShow:false,
selectMeasuresIndex:-1,
modalName:null,
imgList:[],
}
@ -112,6 +129,7 @@
//
this.getDept();
this.getMeasures();
this.addMeasuresListCopy();
loginSession();
},
methods: {
@ -145,8 +163,72 @@
}
});
},
addMeasuresListCopy(){
this.measuresListCopy.push({
id:Math.random(),
DEPARTMENT_ID:'',
DEPARTMENT_NAME:'',
USER_ID:'',
USER_NAME:'',
userList:[],
userIndex:-1,
selectMeasures:[]
})
},
removeMeasuresListCopy(index){
this.measuresListCopy.splice(index,1)
},
fnSelectMeasures(index){
this.selectMeasuresShow = true
this.selectMeasuresIndex = index
},
goSubmit(APPLY_STATUS){
showDeptTree(index) {
this.isUps=true
this.$refs['tkiTree'+index][0]._show();
},
deptTreeConfirm(e,i) {
this.isUps=false;
this.measuresListCopy[i].DEPARTMENT_ID=e[0].id;
this.measuresListCopy[i].DEPARTMENT_NAME=e[0].name;
this.measuresListCopy[i].USER_ID = ''
this.measuresListCopy[i].USER_NAME = ''
this.getUserList(e[0].id,i);
},
deptTreeCancel(e) {
this.isUps=false;
},
pickerUser(e,i) {
for (let j = 0; j < this.measuresListCopy.length; j++) {
if(this.measuresListCopy[j].USER_ID === this.measuresListCopy[i].userList[e.detail.value].USER_ID && i !== j){
uni.showToast({
icon: 'none',
title: '确认人不能重复',
duration: 1500
});
return;
}
}
this.measuresListCopy[i].userIndex = e.detail.value;
this.measuresListCopy[i].USER_ID=this.measuresListCopy[i].userList[e.detail.value].USER_ID;
this.measuresListCopy[i].USER_NAME=this.measuresListCopy[i].userList[e.detail.value].NAME;
this.$forceUpdate();//
},
isBlankList(i) {
if (this.measuresListCopy[i].userList.length == 0) {
uni.showToast({
icon: 'none',
title: '请先选择确认单位',
duration: 1500
})
}
},
goSubmit(APPLY_STATUS){
var _this = this;
uni.showLoading({
title: '请稍候'
@ -160,8 +242,8 @@
return;
}
if(APPLY_STATUS == 1){
for (let i = 0; i < this.measuresList.length; i++) {
const measures = this.measuresList[i]
for (let i = 0; i < this.measuresListCopy.length; i++) {
const measures = this.measuresListCopy[i]
if(!measures.USER_ID){
uni.showToast({
icon: 'none',
@ -170,18 +252,38 @@
});
return;
}
if(measures.selectMeasures.length === 0){
uni.showToast({
icon: 'none',
title: '第'+(i+1)+'项未选择安全措施',
duration: 1500
});
return;
}
}
}
const formData={}
var files = [];
var signtime = [];
const signers = this.measuresList.map(item => {
return {
BUS_BLINDBOARD_MEASURES_ID: item.BUS_BLINDBOARD_MEASURES_ID,
USER_ID: item.USER_ID
}
})
var signers = [];
for (let i = 0; i < this.measuresListCopy.length; i++) {
const measures = this.measuresListCopy[i]
for (let j = 0; j < measures.selectMeasures.length; j++) {
signers.push({
BUS_BLINDBOARD_MEASURES_ID: measures.selectMeasures[j].BUS_BLINDBOARD_MEASURES_ID,
USER_ID: measures.USER_ID
})
}
}
if(signers.length !== this.measuresList.length){
uni.showToast({
icon: 'none',
title: '请为每个安全措施选择确认人',
duration: 1500
});
return;
}
this.uploadImgFaults(files,signtime)
formData.BLINDBOARD_ID = _this.pd.BLINDBOARD_ID
formData.SIGNTIME = signtime.join(",")
@ -270,40 +372,6 @@
});
},
showDeptTree(index) {
this.isUps=true
this.$refs['tkiTree'+index][0]._show();
},
deptTreeConfirm(e,i) {
this.isUps=false;
this.measuresList[i].DEPARTMENT_ID=e[0].id;
this.measuresList[i].DEPARTMENT_NAME=e[0].name;
this.measuresList[i].USER_ID = ''
this.measuresList[i].USER_NAME = ''
this.getUserList(e[0].id,i);
},
deptTreeCancel(e) {
this.isUps=false;
},
pickerUser(e,i) {
this.measuresList[i].userIndex = e.detail.value;
this.measuresList[i].USER_ID=this.measuresList[i].userList[e.detail.value].USER_ID;
this.measuresList[i].USER_NAME=this.measuresList[i].userList[e.detail.value].NAME;
this.$forceUpdate();//
},
isBlankList(i) {
if (this.measuresList[i].userList.length == 0) {
uni.showToast({
icon: 'none',
title: '请先选择确认单位',
duration: 1500
})
}
},
//
getUserList(dept,i){
@ -324,7 +392,7 @@
},
success: function(res){
if("success" == res.data.result){
_this.measuresList[i].userList = res.data.userList;
_this.measuresListCopy[i].userList = res.data.userList;
}else{
uni.showToast({
title: res.data.message,
@ -372,5 +440,19 @@
</script>
<style>
.measures{
padding-left: 16px;
padding-right: 16px;
.title{
font-weight: bold;
color: #000000;
font-size: 14px;
}
.content{
font-size: 14px;
color: #000000;
margin-top: 5px;
margin-bottom: 5px;
}
}
</style>

View File

@ -90,7 +90,7 @@
<view class="padding flex flex-direction">
</view>
</scroll-view>
<select-measures :measures-list="measuresList" v-model="measuresListCopy" :visible.sync="selectMeasuresShow" :index="selectMeasuresIndex"/>
<select-measures :measures-list="measuresList" v-model="measuresListCopy" :visible.sync="selectMeasuresShow" :index="selectMeasuresIndex" row-key="BUS_BREAKGROUND_MEASURES_ID"/>
</view>
</template>

View File

@ -6,70 +6,82 @@
</cu-custom>
<scroll-view scroll-y="false" >
<view class="form">
<detail v-if="pd.CONFINEDSPACE_ID" :confinedspaceId="pd.CONFINEDSPACE_ID" :showMeasures="false"></detail>
<detail v-if="pd.CONFINEDSPACE_ID" :confinedspaceId="pd.CONFINEDSPACE_ID" :showMeasures="false"></detail>
<view class="wui-form-list" style="padding-top: 20upx;">
<view class="wui-title" style="margin-left: 20upx;">
<text class="text-semi">安全防护措施</text>
</view>
<view class="wui-table" style="padding: 0 20upx;">
<uni-table name='measuresList' border stripe emptyText="暂无更多数据" >
<!-- 表头行 -->
<uni-tr>
<uni-th align="center" style="font-weight: bold;">主要安全措施</uni-th>
</uni-tr>
<template v-for="(item,index) in measuresList">
<uni-tr>
<uni-td>
<view style="margin-bottom: 20upx;">
{{item.PROTECTIVE_MEASURES}}
</view>
<view class="cu-form-group" >
<view class="title">确认单位</view>
<view class="picker-tree-box">
<view class="picker-tree" @tap="showDeptTree(index)">{{measuresList[index].DEPARTMENT_NAME?measuresList[index].DEPARTMENT_NAME:''}}</view>
<view class="wui-form-list" style="padding-top: 20upx;">
<view class="wui-title" style="margin-left: 20upx;display: flex;justify-content: space-between;align-items: center">
<text class="text-semi">安全防护措施</text>
<button class="cu-btn round bg-blue" @click="addMeasuresListCopy" style="margin-right: 20upx;">添加</button>
</view>
<view>
<view class="add_pard_item" v-for="(item,index) in measuresListCopy" :key="item.id">
<view class="add_pard_del" @click="removeMeasuresListCopy(index)" v-if="index !== 0">
<text class="cuIcon-roundclosefill text-red f40"></text>
</view>
<view class="cu-form-group" >
<view class="title">确认单位</view>
<view class="picker-tree-box">
<view class="picker-tree" @tap="showDeptTree(index)">
{{item.DEPARTMENT_NAME?item.DEPARTMENT_NAME:'请选择'}}
</view>
<tki-tree :ref="'tkiTree'+index"
:selectParent=true
:range="treeNode"
rangeKey="name"
@confirm="deptTreeConfirm($event,index)"
@cancel="deptTreeCancel($event,index)"></tki-tree>
</view>
<view class="cu-form-group" >
<view class="title">确认人</view>
<picker @change="pickerUser($event,index)" :value="item.userIndex" :range="item.userList" range-key="NAME" :disabled="item.userList.length == 0" @click="isBlankList(index)">
<view class="picker">
{{measuresList[index].USER_NAME?measuresList[index].USER_NAME:'请选择'}}
</view>
</picker>
</view>
</uni-td>
</uni-tr>
</template>
</uni-table>
</view>
</view>
<tki-tree
:ref="'tkiTree'+index"
:selectParent=true
:range="treeNode"
rangeKey="name"
@confirm="deptTreeConfirm($event,index)"
@cancel="deptTreeCancel($event,index)">
</tki-tree>
</view>
<view class="cu-form-group" >
<view class="title">确认人</view>
<picker
@change="pickerUser($event,index)"
:value="item.userIndex"
:range="item.userList"
range-key="NAME"
:disabled="item.userList.length === 0"
@click="isBlankList(index)"
>
<view class="picker">
{{item.USER_NAME?item.USER_NAME:'请选择'}}
</view>
</picker>
</view>
<view class="measures cu-form-group">
<view style="flex: 1">
<view style="margin-top: 10upx;display: flex;justify-content: space-between;align-items: center">
<view class="title">安全措施</view>
<view>
<button class="cu-btn round bg-blue" @click="fnSelectMeasures(index)"></button>
</view>
</view>
<view class="content" v-for="(item1,index1) in item.selectMeasures" :key="index1">
{{index1+1}} . {{item1.PROTECTIVE_MEASURES}}
</view>
</view>
</view>
</view>
</view>
<view class="wui-sign" >
<view class="title"></view>
<button class="cu-btn bg-green shadow" @tap="showModal" data-target="Modal">手写签字</button>
<view class="title"></view>
<button class="cu-btn bg-green shadow" @tap="showModal" data-target="Modal">手写签字</button>
</view>
<view class="wui-sign-box" v-show="imgList && imgList.length > 0">
<view class="sign-title">
签字照片
</view>
<view class="wui-sign-cotent">
<view class="sign-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" data-type="0" :data-url="imgList[index].filePath">
<image :src="imgList[index].filePath" mode="aspectFit"></image>
<view class="sign-title">
签字照片
</view>
<view class="wui-sign-cotent">
<view class="sign-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" data-type="0" :data-url="imgList[index].filePath">
<image :src="imgList[index].filePath" mode="aspectFit"></image>
</view>
</view>
</view>
</view>
<view class="cu-modal" :class="modalName=='Modal'?'show':''">
<writing-board @confirm="subCanvas" @cancel="hideModal"></writing-board>
<writing-board @confirm="subCanvas" @cancel="hideModal"></writing-board>
</view>
</view>
</view>
</view>
<view class="cu-bar btn-group" style="margin-top: 30upx;">
<button class="cu-btn bg-red margin-tb-sm lg" @click="$noMultipleClicks(goSubmit,'-1')"> </button>
@ -78,7 +90,8 @@
<view class="padding flex flex-direction">
</view>
</scroll-view>
</view>
<select-measures :measures-list="measuresList" v-model="measuresListCopy" :visible.sync="selectMeasuresShow" :index="selectMeasuresIndex" row-key="BUS_CONFINEDSPACE_MEASURES_ID"/>
</view>
</template>
<script>
@ -90,9 +103,11 @@
import gcoord from '@/common/gcoord.js'
import ruiDatePicker from '@/components/rattenking-dtpicker/rattenking-dtpicker.vue';
import detail from '@/pages/application/confinedspace/confinedspace-detail/index'
export default {
import selectMeasures from "@/components/select_measures/index.vue";
export default {
components: {
tkiTree,ruiDatePicker,writingBoard,detail
tkiTree,ruiDatePicker,writingBoard,detail,selectMeasures
},
data() {
return {
@ -102,6 +117,9 @@
treeNode:[],//
pd:{},//
measuresList:[],
measuresListCopy:[],
selectMeasuresShow:false,
selectMeasuresIndex:-1,
modalName:null,
imgList:[],
}
@ -112,6 +130,7 @@
//
this.getDept();
this.getMeasures();
this.addMeasuresListCopy();
loginSession();
},
methods: {
@ -121,6 +140,70 @@
url: '/pages/application/confinedspace/confinedspace-gas/gas-list?CONFINEDSPACE_ID='+e
});
},
addMeasuresListCopy(){
this.measuresListCopy.push({
id:Math.random(),
DEPARTMENT_ID:'',
DEPARTMENT_NAME:'',
USER_ID:'',
USER_NAME:'',
userList:[],
userIndex:-1,
selectMeasures:[]
})
},
removeMeasuresListCopy(index){
this.measuresListCopy.splice(index,1)
},
fnSelectMeasures(index){
this.selectMeasuresShow = true
this.selectMeasuresIndex = index
},
showDeptTree(index) {
this.isUps=true
this.$refs['tkiTree'+index][0]._show();
},
deptTreeConfirm(e,i) {
this.isUps=false;
this.measuresListCopy[i].DEPARTMENT_ID=e[0].id;
this.measuresListCopy[i].DEPARTMENT_NAME=e[0].name;
this.measuresListCopy[i].USER_ID = ''
this.measuresListCopy[i].USER_NAME = ''
this.getUserList(e[0].id,i);
},
deptTreeCancel(e) {
this.isUps=false;
},
pickerUser(e,i) {
for (let j = 0; j < this.measuresListCopy.length; j++) {
if(this.measuresListCopy[j].USER_ID === this.measuresListCopy[i].userList[e.detail.value].USER_ID && i !== j){
uni.showToast({
icon: 'none',
title: '确认人不能重复',
duration: 1500
});
return;
}
}
this.measuresListCopy[i].userIndex = e.detail.value;
this.measuresListCopy[i].USER_ID=this.measuresListCopy[i].userList[e.detail.value].USER_ID;
this.measuresListCopy[i].USER_NAME=this.measuresListCopy[i].userList[e.detail.value].NAME;
this.$forceUpdate();//
},
isBlankList(i) {
if (this.measuresListCopy[i].userList.length == 0) {
uni.showToast({
icon: 'none',
title: '请先选择确认单位',
duration: 1500
})
}
},
getData() {
var _this = this;
uni.showLoading({
@ -165,8 +248,8 @@
return;
}
if(APPLY_STATUS == 1){
for (let i = 0; i < this.measuresList.length; i++) {
const measures = this.measuresList[i]
for (let i = 0; i < this.measuresListCopy.length; i++) {
const measures = this.measuresListCopy[i]
if(!measures.USER_ID){
uni.showToast({
icon: 'none',
@ -175,17 +258,37 @@
});
return;
}
if(measures.selectMeasures.length === 0){
uni.showToast({
icon: 'none',
title: '第'+(i+1)+'项未选择安全措施',
duration: 1500
});
return;
}
}
}
const formData={}
var files = [];
var signtime = [];
const signers = this.measuresList.map(item => {
return {
BUS_CONFINEDSPACE_MEASURES_ID: item.BUS_CONFINEDSPACE_MEASURES_ID,
USER_ID: item.USER_ID
}
})
var signers = [];
for (let i = 0; i < this.measuresListCopy.length; i++) {
const measures = this.measuresListCopy[i]
for (let j = 0; j < measures.selectMeasures.length; j++) {
signers.push({
BUS_CONFINEDSPACE_MEASURES_ID: measures.selectMeasures[j].BUS_CONFINEDSPACE_MEASURES_ID,
USER_ID: measures.USER_ID
})
}
}
if(signers.length !== this.measuresList.length){
uni.showToast({
icon: 'none',
title: '请为每个安全措施选择确认人',
duration: 1500
});
return;
}
this.uploadImgFaults(files,signtime)
formData.CONFINEDSPACE_ID = _this.pd.CONFINEDSPACE_ID
formData.SIGNTIME = signtime.join(",")
@ -273,40 +376,6 @@
});
},
showDeptTree(index) {
this.isUps=true
this.$refs['tkiTree'+index][0]._show();
},
deptTreeConfirm(e,i) {
this.isUps=false;
this.measuresList[i].DEPARTMENT_ID=e[0].id;
this.measuresList[i].DEPARTMENT_NAME=e[0].name;
this.measuresList[i].USER_ID = ''
this.measuresList[i].USER_NAME = ''
this.getUserList(e[0].id,i);
},
deptTreeCancel(e) {
this.isUps=false;
},
pickerUser(e,i) {
this.measuresList[i].userIndex = e.detail.value;
this.measuresList[i].USER_ID=this.measuresList[i].userList[e.detail.value].USER_ID;
this.measuresList[i].USER_NAME=this.measuresList[i].userList[e.detail.value].NAME;
this.$forceUpdate();//
},
isBlankList(i) {
if (this.measuresList[i].userList.length == 0) {
uni.showToast({
icon: 'none',
title: '请先选择确认单位',
duration: 1500
})
}
},
//
getUserList(dept,i){
@ -327,7 +396,7 @@
},
success: function(res){
if("success" == res.data.result){
_this.measuresList[i].userList = res.data.userList;
_this.measuresListCopy[i].userList = res.data.userList;
}else{
uni.showToast({
title: res.data.message,
@ -375,5 +444,19 @@
</script>
<style>
.measures{
padding-left: 16px;
padding-right: 16px;
.title{
font-weight: bold;
color: #000000;
font-size: 14px;
}
.content{
font-size: 14px;
color: #000000;
margin-top: 5px;
margin-bottom: 5px;
}
}
</style>

View File

@ -8,68 +8,80 @@
<view class="form">
<detail v-if="pd.CUTROAD_ID" :cutroadId="pd.CUTROAD_ID" :showMeasures="false"></detail>
<view class="wui-form-list" style="padding-top: 20upx;">
<view class="wui-title" style="margin-left: 20upx;">
<text class="text-semi">安全防护措施</text>
</view>
<view class="wui-table" style="padding: 0 20upx;">
<uni-table name='measuresList' border stripe emptyText="暂无更多数据" >
<!-- 表头行 -->
<uni-tr>
<uni-th align="center" style="font-weight: bold;">主要安全措施</uni-th>
</uni-tr>
<template v-for="(item,index) in measuresList">
<uni-tr>
<uni-td>
<view style="margin-bottom: 20upx;">
{{item.PROTECTIVE_MEASURES}}
</view>
<view class="cu-form-group" >
<view class="title">确认单位</view>
<view class="picker-tree-box">
<view class="picker-tree" @tap="showDeptTree(index)">{{measuresList[index].DEPARTMENT_NAME?measuresList[index].DEPARTMENT_NAME:''}}</view>
<view class="wui-form-list" style="padding-top: 20upx;">
<view class="wui-title" style="margin-left: 20upx;display: flex;justify-content: space-between;align-items: center">
<text class="text-semi">安全防护措施</text>
<button class="cu-btn round bg-blue" @click="addMeasuresListCopy" style="margin-right: 20upx;">添加</button>
</view>
<view>
<view class="add_pard_item" v-for="(item,index) in measuresListCopy" :key="item.id">
<view class="add_pard_del" @click="removeMeasuresListCopy(index)" v-if="index !== 0">
<text class="cuIcon-roundclosefill text-red f40"></text>
</view>
<view class="cu-form-group" >
<view class="title">确认单位</view>
<view class="picker-tree-box">
<view class="picker-tree" @tap="showDeptTree(index)">
{{item.DEPARTMENT_NAME?item.DEPARTMENT_NAME:'请选择'}}
</view>
<tki-tree :ref="'tkiTree'+index"
:selectParent=true
:range="treeNode"
rangeKey="name"
@confirm="deptTreeConfirm($event,index)"
@cancel="deptTreeCancel($event,index)"></tki-tree>
</view>
<view class="cu-form-group" >
<view class="title">确认人</view>
<picker @change="pickerUser($event,index)" :value="item.userIndex" :range="item.userList" range-key="NAME" :disabled="item.userList.length == 0" @click="isBlankList(index)">
<view class="picker">
{{measuresList[index].USER_NAME?measuresList[index].USER_NAME:'请选择'}}
</view>
</picker>
</view>
</uni-td>
</uni-tr>
</template>
</uni-table>
</view>
</view>
<tki-tree
:ref="'tkiTree'+index"
:selectParent=true
:range="treeNode"
rangeKey="name"
@confirm="deptTreeConfirm($event,index)"
@cancel="deptTreeCancel($event,index)">
</tki-tree>
</view>
<view class="cu-form-group" >
<view class="title">确认人</view>
<picker
@change="pickerUser($event,index)"
:value="item.userIndex"
:range="item.userList"
range-key="NAME"
:disabled="item.userList.length === 0"
@click="isBlankList(index)"
>
<view class="picker">
{{item.USER_NAME?item.USER_NAME:'请选择'}}
</view>
</picker>
</view>
<view class="measures cu-form-group">
<view style="flex: 1">
<view style="margin-top: 10upx;display: flex;justify-content: space-between;align-items: center">
<view class="title">安全措施</view>
<view>
<button class="cu-btn round bg-blue" @click="fnSelectMeasures(index)"></button>
</view>
</view>
<view class="content" v-for="(item1,index1) in item.selectMeasures" :key="index1">
{{index1+1}} . {{item1.PROTECTIVE_MEASURES}}
</view>
</view>
</view>
</view>
</view>
<view class="wui-sign" >
<view class="title"></view>
<button class="cu-btn bg-green shadow" @tap="showModal" data-target="Modal">手写签字</button>
<view class="title"></view>
<button class="cu-btn bg-green shadow" @tap="showModal" data-target="Modal">手写签字</button>
</view>
<view class="wui-sign-box" v-show="imgList && imgList.length > 0">
<view class="sign-title">
签字照片
</view>
<view class="wui-sign-cotent">
<view class="sign-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" data-type="0" :data-url="imgList[index].filePath">
<image :src="imgList[index].filePath" mode="aspectFit"></image>
<view class="sign-title">
签字照片
</view>
<view class="wui-sign-cotent">
<view class="sign-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" data-type="0" :data-url="imgList[index].filePath">
<image :src="imgList[index].filePath" mode="aspectFit"></image>
</view>
</view>
</view>
</view>
<view class="cu-modal" :class="modalName=='Modal'?'show':''">
<writing-board @confirm="subCanvas" @cancel="hideModal"></writing-board>
<writing-board @confirm="subCanvas" @cancel="hideModal"></writing-board>
</view>
</view>
</view>
</view>
<view class="cu-bar btn-group" style="margin-top: 30upx;">
<button class="cu-btn bg-red margin-tb-sm lg" @click="$noMultipleClicks(goSubmit,'-1')"> </button>
@ -78,7 +90,8 @@
<view class="padding flex flex-direction">
</view>
</scroll-view>
</view>
<select-measures :measures-list="measuresList" v-model="measuresListCopy" :visible.sync="selectMeasuresShow" :index="selectMeasuresIndex" row-key="BUS_CUTROAD_MEASURES_ID"/>
</view>
</template>
<script>
@ -89,10 +102,12 @@
import writingBoard from "@/components/writing-board/writing-board.vue"
import gcoord from '@/common/gcoord.js'
import ruiDatePicker from '@/components/rattenking-dtpicker/rattenking-dtpicker.vue';
import detail from '@/pages/application/cutroad/cutroad-detail/index'
export default {
import detail from '@/pages/application/cutroad/cutroad-detail/index'
import selectMeasures from "@/components/select_measures/index.vue";
export default {
components: {
tkiTree,ruiDatePicker,writingBoard,detail
tkiTree,ruiDatePicker,writingBoard,detail,selectMeasures
},
data() {
return {
@ -102,6 +117,9 @@
treeNode:[],//
pd:{},//
measuresList:[],
measuresListCopy:[],
selectMeasuresShow:false,
selectMeasuresIndex:-1,
modalName:null,
imgList:[],
}
@ -112,6 +130,7 @@
//
this.getDept();
this.getMeasures();
this.addMeasuresListCopy();
loginSession();
},
methods: {
@ -160,8 +179,8 @@
return;
}
if(APPLY_STATUS == 1){
for (let i = 0; i < this.measuresList.length; i++) {
const measures = this.measuresList[i]
for (let i = 0; i < this.measuresListCopy.length; i++) {
const measures = this.measuresListCopy[i]
if(!measures.USER_ID){
uni.showToast({
icon: 'none',
@ -170,17 +189,37 @@
});
return;
}
if(measures.selectMeasures.length === 0){
uni.showToast({
icon: 'none',
title: '第'+(i+1)+'项未选择安全措施',
duration: 1500
});
return;
}
}
}
const formData={}
var files = [];
var signtime = [];
const signers = this.measuresList.map(item => {
return {
BUS_CUTROAD_MEASURES_ID: item.BUS_CUTROAD_MEASURES_ID,
USER_ID: item.USER_ID
}
})
var signers = [];
for (let i = 0; i < this.measuresListCopy.length; i++) {
const measures = this.measuresListCopy[i]
for (let j = 0; j < measures.selectMeasures.length; j++) {
signers.push({
BUS_CUTROAD_MEASURES_ID: measures.selectMeasures[j].BUS_CUTROAD_MEASURES_ID,
USER_ID: measures.USER_ID
})
}
}
if(signers.length !== this.measuresList.length){
uni.showToast({
icon: 'none',
title: '请为每个安全措施选择确认人',
duration: 1500
});
return;
}
this.uploadImgFaults(files,signtime)
formData.CUTROAD_ID = _this.pd.CUTROAD_ID
formData.SIGNTIME = signtime.join(",")
@ -268,41 +307,70 @@
});
},
showDeptTree(index) {
this.isUps=true
this.$refs['tkiTree'+index][0]._show();
},
addMeasuresListCopy(){
this.measuresListCopy.push({
id:Math.random(),
DEPARTMENT_ID:'',
DEPARTMENT_NAME:'',
USER_ID:'',
USER_NAME:'',
userList:[],
userIndex:-1,
selectMeasures:[]
})
},
removeMeasuresListCopy(index){
this.measuresListCopy.splice(index,1)
},
fnSelectMeasures(index){
this.selectMeasuresShow = true
this.selectMeasuresIndex = index
},
deptTreeConfirm(e,i) {
this.isUps=false;
this.measuresList[i].DEPARTMENT_ID=e[0].id;
this.measuresList[i].DEPARTMENT_NAME=e[0].name;
this.measuresList[i].USER_ID = ''
this.measuresList[i].USER_NAME = ''
this.getUserList(e[0].id,i);
},
showDeptTree(index) {
this.isUps=true
this.$refs['tkiTree'+index][0]._show();
},
deptTreeCancel(e) {
this.isUps=false;
},
deptTreeConfirm(e,i) {
this.isUps=false;
this.measuresListCopy[i].DEPARTMENT_ID=e[0].id;
this.measuresListCopy[i].DEPARTMENT_NAME=e[0].name;
this.measuresListCopy[i].USER_ID = ''
this.measuresListCopy[i].USER_NAME = ''
this.getUserList(e[0].id,i);
},
pickerUser(e,i) {
this.measuresList[i].userIndex = e.detail.value;
this.measuresList[i].USER_ID=this.measuresList[i].userList[e.detail.value].USER_ID;
this.measuresList[i].USER_NAME=this.measuresList[i].userList[e.detail.value].NAME;
this.$forceUpdate();//
},
deptTreeCancel(e) {
this.isUps=false;
},
isBlankList(i) {
if (this.measuresList[i].userList.length == 0) {
uni.showToast({
icon: 'none',
title: '请先选择确认单位',
duration: 1500
})
}
},
pickerUser(e,i) {
for (let j = 0; j < this.measuresListCopy.length; j++) {
if(this.measuresListCopy[j].USER_ID === this.measuresListCopy[i].userList[e.detail.value].USER_ID && i !== j){
uni.showToast({
icon: 'none',
title: '确认人不能重复',
duration: 1500
});
return;
}
}
this.measuresListCopy[i].userIndex = e.detail.value;
this.measuresListCopy[i].USER_ID=this.measuresListCopy[i].userList[e.detail.value].USER_ID;
this.measuresListCopy[i].USER_NAME=this.measuresListCopy[i].userList[e.detail.value].NAME;
this.$forceUpdate();//
},
isBlankList(i) {
if (this.measuresListCopy[i].userList.length == 0) {
uni.showToast({
icon: 'none',
title: '请先选择确认单位',
duration: 1500
})
}
},
//
getUserList(dept,i){
// post
@ -322,7 +390,7 @@
},
success: function(res){
if("success" == res.data.result){
_this.measuresList[i].userList = res.data.userList;
_this.measuresListCopy[i].userList = res.data.userList;
}else{
uni.showToast({
title: res.data.message,
@ -344,7 +412,7 @@
},
//
subCanvas(e) {
e.SIGNER_TIME = formatDate(new Date(), 'yyyy-MM-dd hh:mm')
e.SIGNER_TIME = formatDate(new Date(), 'yyyy-MM-dd hh:mm')
this.imgList.splice(0,this.imgList.length);
this.imgList.push(e);
this.hideModal()
@ -370,5 +438,19 @@
</script>
<style>
.measures{
padding-left: 16px;
padding-right: 16px;
.title{
font-weight: bold;
color: #000000;
font-size: 14px;
}
.content{
font-size: 14px;
color: #000000;
margin-top: 5px;
margin-bottom: 5px;
}
}
</style>

View File

@ -2,7 +2,7 @@
<view>
<cu-custom bgColor="bg-gradual-blueness" :isBack="true" :isRingt="true">
<block slot="backText">返回</block>
<block slot="content">高危作业</block>
<block slot="content">特殊作业</block>
</cu-custom>
<view class="apps-box">

View File

@ -6,70 +6,82 @@
</cu-custom>
<scroll-view scroll-y="false" >
<view class="form">
<detail v-if="pd.ELECTRICITY_ID" :electricityId="pd.ELECTRICITY_ID" :showMeasures="false"></detail>
<detail v-if="pd.ELECTRICITY_ID" :electricityId="pd.ELECTRICITY_ID" :showMeasures="false"></detail>
<view class="wui-form-list" style="padding-top: 20upx;">
<view class="wui-title" style="margin-left: 20upx;">
<text class="text-semi">安全防护措施</text>
</view>
<view class="wui-table" style="padding: 0 20upx;">
<uni-table name='measuresList' border stripe emptyText="暂无更多数据" >
<!-- 表头行 -->
<uni-tr>
<uni-th align="center" style="font-weight: bold;">主要安全措施</uni-th>
</uni-tr>
<template v-for="(item,index) in measuresList">
<uni-tr>
<uni-td>
<view style="margin-bottom: 20upx;">
{{item.PROTECTIVE_MEASURES}}
</view>
<view class="cu-form-group" >
<view class="title">确认单位</view>
<view class="picker-tree-box">
<view class="picker-tree" @tap="showDeptTree(index)">{{measuresList[index].DEPARTMENT_NAME?measuresList[index].DEPARTMENT_NAME:''}}</view>
<view class="wui-form-list" style="padding-top: 20upx;">
<view class="wui-title" style="margin-left: 20upx;display: flex;justify-content: space-between;align-items: center">
<text class="text-semi">安全防护措施</text>
<button class="cu-btn round bg-blue" @click="addMeasuresListCopy" style="margin-right: 20upx;">添加</button>
</view>
<view>
<view class="add_pard_item" v-for="(item,index) in measuresListCopy" :key="item.id">
<view class="add_pard_del" @click="removeMeasuresListCopy(index)" v-if="index !== 0">
<text class="cuIcon-roundclosefill text-red f40"></text>
</view>
<view class="cu-form-group" >
<view class="title">确认单位</view>
<view class="picker-tree-box">
<view class="picker-tree" @tap="showDeptTree(index)">
{{item.DEPARTMENT_NAME?item.DEPARTMENT_NAME:'请选择'}}
</view>
<tki-tree :ref="'tkiTree'+index"
:selectParent=true
:range="treeNode"
rangeKey="name"
@confirm="deptTreeConfirm($event,index)"
@cancel="deptTreeCancel($event,index)"></tki-tree>
</view>
<view class="cu-form-group" >
<view class="title">确认人</view>
<picker @change="pickerUser($event,index)" :value="item.userIndex" :range="item.userList" range-key="NAME" :disabled="item.userList.length == 0" @click="isBlankList(index)">
<view class="picker">
{{measuresList[index].USER_NAME?measuresList[index].USER_NAME:'请选择'}}
</view>
</picker>
</view>
</uni-td>
</uni-tr>
</template>
</uni-table>
</view>
</view>
<tki-tree
:ref="'tkiTree'+index"
:selectParent=true
:range="treeNode"
rangeKey="name"
@confirm="deptTreeConfirm($event,index)"
@cancel="deptTreeCancel($event,index)">
</tki-tree>
</view>
<view class="cu-form-group" >
<view class="title">确认人</view>
<picker
@change="pickerUser($event,index)"
:value="item.userIndex"
:range="item.userList"
range-key="NAME"
:disabled="item.userList.length === 0"
@click="isBlankList(index)"
>
<view class="picker">
{{item.USER_NAME?item.USER_NAME:'请选择'}}
</view>
</picker>
</view>
<view class="measures cu-form-group">
<view style="flex: 1">
<view style="margin-top: 10upx;display: flex;justify-content: space-between;align-items: center">
<view class="title">安全措施</view>
<view>
<button class="cu-btn round bg-blue" @click="fnSelectMeasures(index)"></button>
</view>
</view>
<view class="content" v-for="(item1,index1) in item.selectMeasures" :key="index1">
{{index1+1}} . {{item1.PROTECTIVE_MEASURES}}
</view>
</view>
</view>
</view>
</view>
<view class="wui-sign" >
<view class="title"></view>
<button class="cu-btn bg-green shadow" @tap="showModal" data-target="Modal">手写签字</button>
<view class="title"></view>
<button class="cu-btn bg-green shadow" @tap="showModal" data-target="Modal">手写签字</button>
</view>
<view class="wui-sign-box" v-show="imgList && imgList.length > 0">
<view class="sign-title">
签字照片
</view>
<view class="wui-sign-cotent">
<view class="sign-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" data-type="0" :data-url="imgList[index].filePath">
<image :src="imgList[index].filePath" mode="aspectFit"></image>
<view class="sign-title">
签字照片
</view>
<view class="wui-sign-cotent">
<view class="sign-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" data-type="0" :data-url="imgList[index].filePath">
<image :src="imgList[index].filePath" mode="aspectFit"></image>
</view>
</view>
</view>
</view>
<view class="cu-modal" :class="modalName=='Modal'?'show':''">
<writing-board @confirm="subCanvas" @cancel="hideModal"></writing-board>
<writing-board @confirm="subCanvas" @cancel="hideModal"></writing-board>
</view>
</view>
</view>
</view>
<view class="cu-bar btn-group" style="margin-top: 30upx;">
<button class="cu-btn bg-red margin-tb-sm lg" @click="$noMultipleClicks(goSubmit,'-1')"> </button>
@ -78,7 +90,8 @@
<view class="padding flex flex-direction">
</view>
</scroll-view>
</view>
<select-measures :measures-list="measuresList" v-model="measuresListCopy" :visible.sync="selectMeasuresShow" :index="selectMeasuresIndex" row-key="BUS_ELECTRICITY_MEASURES_ID"/>
</view>
</template>
<script>
@ -90,9 +103,11 @@
import gcoord from '@/common/gcoord.js'
import ruiDatePicker from '@/components/rattenking-dtpicker/rattenking-dtpicker.vue';
import detail from '@/pages/application/electricity/electricity-detail/index'
export default {
import selectMeasures from "@/components/select_measures/index.vue";
export default {
components: {
tkiTree,ruiDatePicker,writingBoard,detail
tkiTree,ruiDatePicker,writingBoard,detail,selectMeasures
},
data() {
return {
@ -102,6 +117,9 @@
treeNode:[],//
pd:{},//
measuresList:[],
measuresListCopy:[],
selectMeasuresShow:false,
selectMeasuresIndex:-1,
modalName:null,
imgList:[],
}
@ -112,6 +130,7 @@
//
this.getDept();
this.getMeasures();
this.addMeasuresListCopy();
loginSession();
},
methods: {
@ -165,8 +184,8 @@
return;
}
if(APPLY_STATUS == 1){
for (let i = 0; i < this.measuresList.length; i++) {
const measures = this.measuresList[i]
for (let i = 0; i < this.measuresListCopy.length; i++) {
const measures = this.measuresListCopy[i]
if(!measures.USER_ID){
uni.showToast({
icon: 'none',
@ -175,17 +194,37 @@
});
return;
}
if(measures.selectMeasures.length === 0){
uni.showToast({
icon: 'none',
title: '第'+(i+1)+'项未选择安全措施',
duration: 1500
});
return;
}
}
}
const formData={}
var files = [];
var signtime = [];
const signers = this.measuresList.map(item => {
return {
BUS_ELECTRICITY_MEASURES_ID: item.BUS_ELECTRICITY_MEASURES_ID,
USER_ID: item.USER_ID
}
})
var signers = [];
for (let i = 0; i < this.measuresListCopy.length; i++) {
const measures = this.measuresListCopy[i]
for (let j = 0; j < measures.selectMeasures.length; j++) {
signers.push({
BUS_ELECTRICITY_MEASURES_ID: measures.selectMeasures[j].BUS_ELECTRICITY_MEASURES_ID,
USER_ID: measures.USER_ID
})
}
}
if(signers.length !== this.measuresList.length){
uni.showToast({
icon: 'none',
title: '请为每个安全措施选择确认人',
duration: 1500
});
return;
}
this.uploadImgFaults(files,signtime)
formData.ELECTRICITY_ID = _this.pd.ELECTRICITY_ID
formData.SIGNTIME = signtime.join(",")
@ -273,41 +312,70 @@
});
},
showDeptTree(index) {
this.isUps=true
this.$refs['tkiTree'+index][0]._show();
},
addMeasuresListCopy(){
this.measuresListCopy.push({
id:Math.random(),
DEPARTMENT_ID:'',
DEPARTMENT_NAME:'',
USER_ID:'',
USER_NAME:'',
userList:[],
userIndex:-1,
selectMeasures:[]
})
},
removeMeasuresListCopy(index){
this.measuresListCopy.splice(index,1)
},
fnSelectMeasures(index){
this.selectMeasuresShow = true
this.selectMeasuresIndex = index
},
deptTreeConfirm(e,i) {
this.isUps=false;
this.measuresList[i].DEPARTMENT_ID=e[0].id;
this.measuresList[i].DEPARTMENT_NAME=e[0].name;
this.measuresList[i].USER_ID = ''
this.measuresList[i].USER_NAME = ''
this.getUserList(e[0].id,i);
},
showDeptTree(index) {
this.isUps=true
this.$refs['tkiTree'+index][0]._show();
},
deptTreeCancel(e) {
this.isUps=false;
},
deptTreeConfirm(e,i) {
this.isUps=false;
this.measuresListCopy[i].DEPARTMENT_ID=e[0].id;
this.measuresListCopy[i].DEPARTMENT_NAME=e[0].name;
this.measuresListCopy[i].USER_ID = ''
this.measuresListCopy[i].USER_NAME = ''
this.getUserList(e[0].id,i);
},
pickerUser(e,i) {
this.measuresList[i].userIndex = e.detail.value;
this.measuresList[i].USER_ID=this.measuresList[i].userList[e.detail.value].USER_ID;
this.measuresList[i].USER_NAME=this.measuresList[i].userList[e.detail.value].NAME;
this.$forceUpdate();//
},
deptTreeCancel(e) {
this.isUps=false;
},
isBlankList(i) {
if (this.measuresList[i].userList.length == 0) {
uni.showToast({
icon: 'none',
title: '请先选择确认单位',
duration: 1500
})
}
},
pickerUser(e,i) {
for (let j = 0; j < this.measuresListCopy.length; j++) {
if(this.measuresListCopy[j].USER_ID === this.measuresListCopy[i].userList[e.detail.value].USER_ID && i !== j){
uni.showToast({
icon: 'none',
title: '确认人不能重复',
duration: 1500
});
return;
}
}
this.measuresListCopy[i].userIndex = e.detail.value;
this.measuresListCopy[i].USER_ID=this.measuresListCopy[i].userList[e.detail.value].USER_ID;
this.measuresListCopy[i].USER_NAME=this.measuresListCopy[i].userList[e.detail.value].NAME;
this.$forceUpdate();//
},
isBlankList(i) {
if (this.measuresListCopy[i].userList.length == 0) {
uni.showToast({
icon: 'none',
title: '请先选择确认单位',
duration: 1500
})
}
},
//
getUserList(dept,i){
// post
@ -327,7 +395,7 @@
},
success: function(res){
if("success" == res.data.result){
_this.measuresList[i].userList = res.data.userList;
_this.measuresListCopy[i].userList = res.data.userList;
}else{
uni.showToast({
title: res.data.message,
@ -375,5 +443,19 @@
</script>
<style>
.measures{
padding-left: 16px;
padding-right: 16px;
.title{
font-weight: bold;
color: #000000;
font-size: 14px;
}
.content{
font-size: 14px;
color: #000000;
margin-top: 5px;
margin-bottom: 5px;
}
}
</style>

View File

@ -8,68 +8,80 @@
<view class="form">
<detail v-if="pd.HIGHWORK_ID" :highworkId="pd.HIGHWORK_ID" :showMeasures="false"></detail>
<view class="wui-form-list" style="padding-top: 20upx;">
<view class="wui-title" style="margin-left: 20upx;">
<text class="text-semi">安全防护措施</text>
</view>
<view class="wui-table" style="padding: 0 20upx;">
<uni-table name='measuresList' border stripe emptyText="暂无更多数据" >
<!-- 表头行 -->
<uni-tr>
<uni-th align="center" style="font-weight: bold;">主要安全措施</uni-th>
</uni-tr>
<template v-for="(item,index) in measuresList">
<uni-tr>
<uni-td>
<view style="margin-bottom: 20upx;">
{{item.PROTECTIVE_MEASURES}}
</view>
<view class="cu-form-group" >
<view class="title">确认单位</view>
<view class="picker-tree-box">
<view class="picker-tree" @tap="showDeptTree(index)">{{measuresList[index].DEPARTMENT_NAME?measuresList[index].DEPARTMENT_NAME:''}}</view>
<view class="wui-form-list" style="padding-top: 20upx;">
<view class="wui-title" style="margin-left: 20upx;display: flex;justify-content: space-between;align-items: center">
<text class="text-semi">安全防护措施</text>
<button class="cu-btn round bg-blue" @click="addMeasuresListCopy" style="margin-right: 20upx;">添加</button>
</view>
<view>
<view class="add_pard_item" v-for="(item,index) in measuresListCopy" :key="item.id">
<view class="add_pard_del" @click="removeMeasuresListCopy(index)" v-if="index !== 0">
<text class="cuIcon-roundclosefill text-red f40"></text>
</view>
<view class="cu-form-group" >
<view class="title">确认单位</view>
<view class="picker-tree-box">
<view class="picker-tree" @tap="showDeptTree(index)">
{{item.DEPARTMENT_NAME?item.DEPARTMENT_NAME:'请选择'}}
</view>
<tki-tree :ref="'tkiTree'+index"
:selectParent=true
:range="treeNode"
rangeKey="name"
@confirm="deptTreeConfirm($event,index)"
@cancel="deptTreeCancel($event,index)"></tki-tree>
</view>
<view class="cu-form-group" >
<view class="title">确认人</view>
<picker @change="pickerUser($event,index)" :value="item.userIndex" :range="item.userList" range-key="NAME" :disabled="item.userList.length == 0" @click="isBlankList(index)">
<view class="picker">
{{measuresList[index].USER_NAME?measuresList[index].USER_NAME:'请选择'}}
</view>
</picker>
</view>
</uni-td>
</uni-tr>
</template>
</uni-table>
</view>
</view>
<tki-tree
:ref="'tkiTree'+index"
:selectParent=true
:range="treeNode"
rangeKey="name"
@confirm="deptTreeConfirm($event,index)"
@cancel="deptTreeCancel($event,index)">
</tki-tree>
</view>
<view class="cu-form-group" >
<view class="title">确认人</view>
<picker
@change="pickerUser($event,index)"
:value="item.userIndex"
:range="item.userList"
range-key="NAME"
:disabled="item.userList.length === 0"
@click="isBlankList(index)"
>
<view class="picker">
{{item.USER_NAME?item.USER_NAME:'请选择'}}
</view>
</picker>
</view>
<view class="measures cu-form-group">
<view style="flex: 1">
<view style="margin-top: 10upx;display: flex;justify-content: space-between;align-items: center">
<view class="title">安全措施</view>
<view>
<button class="cu-btn round bg-blue" @click="fnSelectMeasures(index)"></button>
</view>
</view>
<view class="content" v-for="(item1,index1) in item.selectMeasures" :key="index1">
{{index1+1}} . {{item1.PROTECTIVE_MEASURES}}
</view>
</view>
</view>
</view>
</view>
<view class="wui-sign" >
<view class="title"></view>
<button class="cu-btn bg-green shadow" @tap="showModal" data-target="Modal">手写签字</button>
<view class="title"></view>
<button class="cu-btn bg-green shadow" @tap="showModal" data-target="Modal">手写签字</button>
</view>
<view class="wui-sign-box" v-show="imgList && imgList.length > 0">
<view class="sign-title">
签字照片
</view>
<view class="wui-sign-cotent">
<view class="sign-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" data-type="0" :data-url="imgList[index].filePath">
<image :src="imgList[index].filePath" mode="aspectFit"></image>
<view class="sign-title">
签字照片
</view>
<view class="wui-sign-cotent">
<view class="sign-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" data-type="0" :data-url="imgList[index].filePath">
<image :src="imgList[index].filePath" mode="aspectFit"></image>
</view>
</view>
</view>
</view>
<view class="cu-modal" :class="modalName=='Modal'?'show':''">
<writing-board @confirm="subCanvas" @cancel="hideModal"></writing-board>
<writing-board @confirm="subCanvas" @cancel="hideModal"></writing-board>
</view>
</view>
</view>
</view>
<view class="cu-bar btn-group" style="margin-top: 30upx;">
<button class="cu-btn bg-red margin-tb-sm lg" @click="$noMultipleClicks(goSubmit,'-1')"> </button>
@ -78,7 +90,9 @@
<view class="padding flex flex-direction">
</view>
</scroll-view>
</view>
<select-measures :measures-list="measuresList" v-model="measuresListCopy" :visible.sync="selectMeasuresShow" :index="selectMeasuresIndex" row-key="BUS_HIGHWORK_MEASURES_ID"/>
</view>
</template>
<script>
@ -90,9 +104,11 @@
import gcoord from '@/common/gcoord.js'
import ruiDatePicker from '@/components/rattenking-dtpicker/rattenking-dtpicker.vue';
import detail from '@/pages/application/highwork/highwork-detail/index'
export default {
import selectMeasures from "@/components/select_measures/index.vue";
export default {
components: {
tkiTree,ruiDatePicker,writingBoard,detail
tkiTree,ruiDatePicker,writingBoard,detail,selectMeasures
},
data() {
return {
@ -102,6 +118,9 @@
treeNode:[],//
pd:{},//
measuresList:[],
measuresListCopy:[],
selectMeasuresShow:false,
selectMeasuresIndex:-1,
modalName:null,
imgList:[],
}
@ -112,15 +131,12 @@
//
this.getDept();
this.getMeasures();
loginSession();
this.addMeasuresListCopy();
loginSession();
},
methods: {
//
goToDetail(e) {
uni.navigateTo({
url: '/pages/application/highwork/highwork-gas/gas-list?HIGHWORK_ID='+e
});
},
getData() {
var _this = this;
uni.showLoading({
@ -165,8 +181,8 @@
return;
}
if(APPLY_STATUS == 1){
for (let i = 0; i < this.measuresList.length; i++) {
const measures = this.measuresList[i]
for (let i = 0; i < this.measuresListCopy.length; i++) {
const measures = this.measuresListCopy[i]
if(!measures.USER_ID){
uni.showToast({
icon: 'none',
@ -175,17 +191,37 @@
});
return;
}
if(measures.selectMeasures.length === 0){
uni.showToast({
icon: 'none',
title: '第'+(i+1)+'项未选择安全措施',
duration: 1500
});
return;
}
}
}
const formData={}
var files = [];
var signtime = [];
const signers = this.measuresList.map(item => {
return {
BUS_HIGHWORK_MEASURES_ID: item.BUS_HIGHWORK_MEASURES_ID,
USER_ID: item.USER_ID
}
})
var signers = [];
for (let i = 0; i < this.measuresListCopy.length; i++) {
const measures = this.measuresListCopy[i]
for (let j = 0; j < measures.selectMeasures.length; j++) {
signers.push({
BUS_HIGHWORK_MEASURES_ID: measures.selectMeasures[j].BUS_HIGHWORK_MEASURES_ID,
USER_ID: measures.USER_ID
})
}
}
if(signers.length !== this.measuresList.length){
uni.showToast({
icon: 'none',
title: '请为每个安全措施选择确认人',
duration: 1500
});
return;
}
this.uploadImgFaults(files,signtime)
formData.HIGHWORK_ID = _this.pd.HIGHWORK_ID
formData.SIGNTIME = signtime.join(",")
@ -272,41 +308,70 @@
}
});
},
addMeasuresListCopy(){
this.measuresListCopy.push({
id:Math.random(),
DEPARTMENT_ID:'',
DEPARTMENT_NAME:'',
USER_ID:'',
USER_NAME:'',
userList:[],
userIndex:-1,
selectMeasures:[]
})
},
removeMeasuresListCopy(index){
this.measuresListCopy.splice(index,1)
},
fnSelectMeasures(index){
this.selectMeasuresShow = true
this.selectMeasuresIndex = index
},
showDeptTree(index) {
this.isUps=true
this.$refs['tkiTree'+index][0]._show();
},
showDeptTree(index) {
this.isUps=true
this.$refs['tkiTree'+index][0]._show();
},
deptTreeConfirm(e,i) {
this.isUps=false;
this.measuresList[i].DEPARTMENT_ID=e[0].id;
this.measuresList[i].DEPARTMENT_NAME=e[0].name;
this.measuresList[i].USER_ID = ''
this.measuresList[i].USER_NAME = ''
this.getUserList(e[0].id,i);
},
deptTreeConfirm(e,i) {
this.isUps=false;
this.measuresListCopy[i].DEPARTMENT_ID=e[0].id;
this.measuresListCopy[i].DEPARTMENT_NAME=e[0].name;
this.measuresListCopy[i].USER_ID = ''
this.measuresListCopy[i].USER_NAME = ''
this.getUserList(e[0].id,i);
},
deptTreeCancel(e) {
this.isUps=false;
},
deptTreeCancel(e) {
this.isUps=false;
},
pickerUser(e,i) {
this.measuresList[i].userIndex = e.detail.value;
this.measuresList[i].USER_ID=this.measuresList[i].userList[e.detail.value].USER_ID;
this.measuresList[i].USER_NAME=this.measuresList[i].userList[e.detail.value].NAME;
this.$forceUpdate();//
},
pickerUser(e,i) {
for (let j = 0; j < this.measuresListCopy.length; j++) {
if(this.measuresListCopy[j].USER_ID === this.measuresListCopy[i].userList[e.detail.value].USER_ID && i !== j){
uni.showToast({
icon: 'none',
title: '确认人不能重复',
duration: 1500
});
return;
}
}
this.measuresListCopy[i].userIndex = e.detail.value;
this.measuresListCopy[i].USER_ID=this.measuresListCopy[i].userList[e.detail.value].USER_ID;
this.measuresListCopy[i].USER_NAME=this.measuresListCopy[i].userList[e.detail.value].NAME;
this.$forceUpdate();//
},
isBlankList(i) {
if (this.measuresList[i].userList.length == 0) {
uni.showToast({
icon: 'none',
title: '请先选择确认单位',
duration: 1500
})
}
},
isBlankList(i) {
if (this.measuresListCopy[i].userList.length == 0) {
uni.showToast({
icon: 'none',
title: '请先选择确认单位',
duration: 1500
})
}
},
//
getUserList(dept,i){
@ -327,7 +392,7 @@
},
success: function(res){
if("success" == res.data.result){
_this.measuresList[i].userList = res.data.userList;
_this.measuresListCopy[i].userList = res.data.userList;
}else{
uni.showToast({
title: res.data.message,
@ -349,7 +414,7 @@
},
//
subCanvas(e) {
e.SIGNER_TIME = formatDate(new Date(), 'yyyy-MM-dd hh:mm')
e.SIGNER_TIME = formatDate(new Date(), 'yyyy-MM-dd hh:mm')
this.imgList.splice(0,this.imgList.length);
this.imgList.push(e);
this.hideModal()
@ -375,5 +440,19 @@
</script>
<style>
.measures{
padding-left: 16px;
padding-right: 16px;
.title{
font-weight: bold;
color: #000000;
font-size: 14px;
}
.content{
font-size: 14px;
color: #000000;
margin-top: 5px;
margin-bottom: 5px;
}
}
</style>

View File

@ -8,68 +8,80 @@
<view class="form">
<detail v-if="pd.HOISTING_ID" :hoistingId="pd.HOISTING_ID" :showMeasures="false"></detail>
<view class="wui-form-list" style="padding-top: 20upx;">
<view class="wui-title" style="margin-left: 20upx;">
<text class="text-semi">安全防护措施</text>
</view>
<view class="wui-table" style="padding: 0 20upx;">
<uni-table name='measuresList' border stripe emptyText="暂无更多数据" >
<!-- 表头行 -->
<uni-tr>
<uni-th align="center" style="font-weight: bold;">主要安全措施</uni-th>
</uni-tr>
<template v-for="(item,index) in measuresList">
<uni-tr>
<uni-td>
<view style="margin-bottom: 20upx;">
{{item.PROTECTIVE_MEASURES}}
</view>
<view class="cu-form-group" >
<view class="title">确认单位</view>
<view class="picker-tree-box">
<view class="picker-tree" @tap="showDeptTree(index)">{{measuresList[index].DEPARTMENT_NAME?measuresList[index].DEPARTMENT_NAME:''}}</view>
<view class="wui-form-list" style="padding-top: 20upx;">
<view class="wui-title" style="margin-left: 20upx;display: flex;justify-content: space-between;align-items: center">
<text class="text-semi">安全防护措施</text>
<button class="cu-btn round bg-blue" @click="addMeasuresListCopy" style="margin-right: 20upx;">添加</button>
</view>
<view>
<view class="add_pard_item" v-for="(item,index) in measuresListCopy" :key="item.id">
<view class="add_pard_del" @click="removeMeasuresListCopy(index)" v-if="index !== 0">
<text class="cuIcon-roundclosefill text-red f40"></text>
</view>
<view class="cu-form-group" >
<view class="title">确认单位</view>
<view class="picker-tree-box">
<view class="picker-tree" @tap="showDeptTree(index)">
{{item.DEPARTMENT_NAME?item.DEPARTMENT_NAME:'请选择'}}
</view>
<tki-tree :ref="'tkiTree'+index"
:selectParent=true
:range="treeNode"
rangeKey="name"
@confirm="deptTreeConfirm($event,index)"
@cancel="deptTreeCancel($event,index)"></tki-tree>
</view>
<view class="cu-form-group" >
<view class="title">确认人</view>
<picker @change="pickerUser($event,index)" :value="item.userIndex" :range="item.userList" range-key="NAME" :disabled="item.userList.length == 0" @click="isBlankList(index)">
<view class="picker">
{{measuresList[index].USER_NAME?measuresList[index].USER_NAME:'请选择'}}
</view>
</picker>
</view>
</uni-td>
</uni-tr>
</template>
</uni-table>
</view>
</view>
<tki-tree
:ref="'tkiTree'+index"
:selectParent=true
:range="treeNode"
rangeKey="name"
@confirm="deptTreeConfirm($event,index)"
@cancel="deptTreeCancel($event,index)">
</tki-tree>
</view>
<view class="cu-form-group" >
<view class="title">确认人</view>
<picker
@change="pickerUser($event,index)"
:value="item.userIndex"
:range="item.userList"
range-key="NAME"
:disabled="item.userList.length === 0"
@click="isBlankList(index)"
>
<view class="picker">
{{item.USER_NAME?item.USER_NAME:'请选择'}}
</view>
</picker>
</view>
<view class="measures cu-form-group">
<view style="flex: 1">
<view style="margin-top: 10upx;display: flex;justify-content: space-between;align-items: center">
<view class="title">安全措施</view>
<view>
<button class="cu-btn round bg-blue" @click="fnSelectMeasures(index)"></button>
</view>
</view>
<view class="content" v-for="(item1,index1) in item.selectMeasures" :key="index1">
{{index1+1}} . {{item1.PROTECTIVE_MEASURES}}
</view>
</view>
</view>
</view>
</view>
<view class="wui-sign" >
<view class="title"></view>
<button class="cu-btn bg-green shadow" @tap="showModal" data-target="Modal">手写签字</button>
<view class="title"></view>
<button class="cu-btn bg-green shadow" @tap="showModal" data-target="Modal">手写签字</button>
</view>
<view class="wui-sign-box" v-show="imgList && imgList.length > 0">
<view class="sign-title">
签字照片
</view>
<view class="wui-sign-cotent">
<view class="sign-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" data-type="0" :data-url="imgList[index].filePath">
<image :src="imgList[index].filePath" mode="aspectFit"></image>
<view class="sign-title">
签字照片
</view>
<view class="wui-sign-cotent">
<view class="sign-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" data-type="0" :data-url="imgList[index].filePath">
<image :src="imgList[index].filePath" mode="aspectFit"></image>
</view>
</view>
</view>
</view>
<view class="cu-modal" :class="modalName=='Modal'?'show':''">
<writing-board @confirm="subCanvas" @cancel="hideModal"></writing-board>
<writing-board @confirm="subCanvas" @cancel="hideModal"></writing-board>
</view>
</view>
</view>
</view>
<view class="cu-bar btn-group" style="margin-top: 30upx;">
<button class="cu-btn bg-red margin-tb-sm lg" @click="$noMultipleClicks(goSubmit,'-1')"> </button>
@ -78,7 +90,8 @@
<view class="padding flex flex-direction">
</view>
</scroll-view>
</view>
<select-measures :measures-list="measuresList" v-model="measuresListCopy" :visible.sync="selectMeasuresShow" :index="selectMeasuresIndex" row-key="BUS_HOISTING_MEASURES_ID"/>
</view>
</template>
<script>
@ -90,9 +103,11 @@
import gcoord from '@/common/gcoord.js'
import ruiDatePicker from '@/components/rattenking-dtpicker/rattenking-dtpicker.vue';
import detail from '@/pages/application/hoisting/hoisting-detail/index'
export default {
import selectMeasures from "@/components/select_measures/index.vue";
export default {
components: {
tkiTree,ruiDatePicker,writingBoard,detail
tkiTree,ruiDatePicker,writingBoard,detail,selectMeasures
},
data() {
return {
@ -102,6 +117,9 @@
treeNode:[],//
pd:{},//
measuresList:[],
measuresListCopy:[],
selectMeasuresShow:false,
selectMeasuresIndex:-1,
modalName:null,
imgList:[],
}
@ -112,15 +130,12 @@
//
this.getDept();
this.getMeasures();
loginSession();
this.addMeasuresListCopy();
loginSession();
},
methods: {
//
goToDetail(e) {
uni.navigateTo({
url: '/pages/application/hoisting/hoisting-gas/gas-list?HOISTING_ID='+e
});
},
getData() {
var _this = this;
uni.showLoading({
@ -165,8 +180,8 @@
return;
}
if(APPLY_STATUS == 1){
for (let i = 0; i < this.measuresList.length; i++) {
const measures = this.measuresList[i]
for (let i = 0; i < this.measuresListCopy.length; i++) {
const measures = this.measuresListCopy[i]
if(!measures.USER_ID){
uni.showToast({
icon: 'none',
@ -175,17 +190,37 @@
});
return;
}
if(measures.selectMeasures.length === 0){
uni.showToast({
icon: 'none',
title: '第'+(i+1)+'项未选择安全措施',
duration: 1500
});
return;
}
}
}
const formData={}
var files = [];
var signtime = [];
const signers = this.measuresList.map(item => {
return {
BUS_HOISTING_MEASURES_ID: item.BUS_HOISTING_MEASURES_ID,
USER_ID: item.USER_ID
}
})
var signers = [];
for (let i = 0; i < this.measuresListCopy.length; i++) {
const measures = this.measuresListCopy[i]
for (let j = 0; j < measures.selectMeasures.length; j++) {
signers.push({
BUS_HOISTING_MEASURES_ID: measures.selectMeasures[j].BUS_HOISTING_MEASURES_ID,
USER_ID: measures.USER_ID
})
}
}
if(signers.length !== this.measuresList.length){
uni.showToast({
icon: 'none',
title: '请为每个安全措施选择确认人',
duration: 1500
});
return;
}
this.uploadImgFaults(files,signtime)
formData.HOISTING_ID = _this.pd.HOISTING_ID
formData.SIGNTIME = signtime.join(",")
@ -273,40 +308,70 @@
});
},
showDeptTree(index) {
this.isUps=true
this.$refs['tkiTree'+index][0]._show();
},
addMeasuresListCopy(){
this.measuresListCopy.push({
id:Math.random(),
DEPARTMENT_ID:'',
DEPARTMENT_NAME:'',
USER_ID:'',
USER_NAME:'',
userList:[],
userIndex:-1,
selectMeasures:[]
})
},
removeMeasuresListCopy(index){
this.measuresListCopy.splice(index,1)
},
fnSelectMeasures(index){
this.selectMeasuresShow = true
this.selectMeasuresIndex = index
},
deptTreeConfirm(e,i) {
this.isUps=false;
this.measuresList[i].DEPARTMENT_ID=e[0].id;
this.measuresList[i].DEPARTMENT_NAME=e[0].name;
this.measuresList[i].USER_ID = ''
this.measuresList[i].USER_NAME = ''
this.getUserList(e[0].id,i);
},
showDeptTree(index) {
this.isUps=true
this.$refs['tkiTree'+index][0]._show();
},
deptTreeCancel(e) {
this.isUps=false;
},
deptTreeConfirm(e,i) {
this.isUps=false;
this.measuresListCopy[i].DEPARTMENT_ID=e[0].id;
this.measuresListCopy[i].DEPARTMENT_NAME=e[0].name;
this.measuresListCopy[i].USER_ID = ''
this.measuresListCopy[i].USER_NAME = ''
this.getUserList(e[0].id,i);
},
pickerUser(e,i) {
this.measuresList[i].userIndex = e.detail.value;
this.measuresList[i].USER_ID=this.measuresList[i].userList[e.detail.value].USER_ID;
this.measuresList[i].USER_NAME=this.measuresList[i].userList[e.detail.value].NAME;
this.$forceUpdate();//
},
deptTreeCancel(e) {
this.isUps=false;
},
isBlankList(i) {
if (this.measuresList[i].userList.length == 0) {
uni.showToast({
icon: 'none',
title: '请先选择确认单位',
duration: 1500
})
}
},
pickerUser(e,i) {
for (let j = 0; j < this.measuresListCopy.length; j++) {
if(this.measuresListCopy[j].USER_ID === this.measuresListCopy[i].userList[e.detail.value].USER_ID && i !== j){
uni.showToast({
icon: 'none',
title: '确认人不能重复',
duration: 1500
});
return;
}
}
this.measuresListCopy[i].userIndex = e.detail.value;
this.measuresListCopy[i].USER_ID=this.measuresListCopy[i].userList[e.detail.value].USER_ID;
this.measuresListCopy[i].USER_NAME=this.measuresListCopy[i].userList[e.detail.value].NAME;
this.$forceUpdate();//
},
isBlankList(i) {
if (this.measuresListCopy[i].userList.length == 0) {
uni.showToast({
icon: 'none',
title: '请先选择确认单位',
duration: 1500
})
}
},
//
getUserList(dept,i){
@ -327,7 +392,7 @@
},
success: function(res){
if("success" == res.data.result){
_this.measuresList[i].userList = res.data.userList;
_this.measuresListCopy[i].userList = res.data.userList;
}else{
uni.showToast({
title: res.data.message,
@ -375,5 +440,19 @@
</script>
<style>
.measures{
padding-left: 16px;
padding-right: 16px;
.title{
font-weight: bold;
color: #000000;
font-size: 14px;
}
.content{
font-size: 14px;
color: #000000;
margin-top: 5px;
margin-bottom: 5px;
}
}
</style>

View File

@ -6,70 +6,82 @@
</cu-custom>
<scroll-view scroll-y="false" >
<view class="form">
<detail v-if="pd.HOTWORK_ID" :hotworkId="pd.HOTWORK_ID" :showMeasures="false"></detail>
<detail v-if="pd.HOTWORK_ID" :hotworkId="pd.HOTWORK_ID" :showMeasures="false"></detail>
<view class="wui-form-list" style="padding-top: 20upx;">
<view class="wui-title" style="margin-left: 20upx;">
<text class="text-semi">安全防护措施</text>
</view>
<view class="wui-table" style="padding: 0 20upx;">
<uni-table name='measuresList' border stripe emptyText="暂无更多数据" >
<!-- 表头行 -->
<uni-tr>
<uni-th align="center" style="font-weight: bold;">主要安全措施</uni-th>
</uni-tr>
<template v-for="(item,index) in measuresList">
<uni-tr>
<uni-td>
<view style="margin-bottom: 20upx;">
{{item.PROTECTIVE_MEASURES}}
</view>
<view class="cu-form-group" >
<view class="title">确认单位</view>
<view class="picker-tree-box">
<view class="picker-tree" @tap="showDeptTree(index)">{{measuresList[index].DEPARTMENT_NAME?measuresList[index].DEPARTMENT_NAME:''}}</view>
<view class="wui-form-list" style="padding-top: 20upx;">
<view class="wui-title" style="margin-left: 20upx;display: flex;justify-content: space-between;align-items: center">
<text class="text-semi">安全防护措施</text>
<button class="cu-btn round bg-blue" @click="addMeasuresListCopy" style="margin-right: 20upx;">添加</button>
</view>
<view>
<view class="add_pard_item" v-for="(item,index) in measuresListCopy" :key="item.id">
<view class="add_pard_del" @click="removeMeasuresListCopy(index)" v-if="index !== 0">
<text class="cuIcon-roundclosefill text-red f40"></text>
</view>
<view class="cu-form-group" >
<view class="title">确认单位</view>
<view class="picker-tree-box">
<view class="picker-tree" @tap="showDeptTree(index)">
{{item.DEPARTMENT_NAME?item.DEPARTMENT_NAME:'请选择'}}
</view>
<tki-tree :ref="'tkiTree'+index"
:selectParent=true
:range="treeNode"
rangeKey="name"
@confirm="deptTreeConfirm($event,index)"
@cancel="deptTreeCancel($event,index)"></tki-tree>
</view>
<view class="cu-form-group" >
<view class="title">确认人</view>
<picker @change="pickerUser($event,index)" :value="item.userIndex" :range="item.userList" range-key="NAME" :disabled="item.userList.length == 0" @click="isBlankList(index)">
<view class="picker">
{{measuresList[index].USER_NAME?measuresList[index].USER_NAME:'请选择'}}
</view>
</picker>
</view>
</uni-td>
</uni-tr>
</template>
</uni-table>
</view>
</view>
<tki-tree
:ref="'tkiTree'+index"
:selectParent=true
:range="treeNode"
rangeKey="name"
@confirm="deptTreeConfirm($event,index)"
@cancel="deptTreeCancel($event,index)">
</tki-tree>
</view>
<view class="cu-form-group" >
<view class="title">确认人</view>
<picker
@change="pickerUser($event,index)"
:value="item.userIndex"
:range="item.userList"
range-key="NAME"
:disabled="item.userList.length === 0"
@click="isBlankList(index)"
>
<view class="picker">
{{item.USER_NAME?item.USER_NAME:'请选择'}}
</view>
</picker>
</view>
<view class="measures cu-form-group">
<view style="flex: 1">
<view style="margin-top: 10upx;display: flex;justify-content: space-between;align-items: center">
<view class="title">安全措施</view>
<view>
<button class="cu-btn round bg-blue" @click="fnSelectMeasures(index)"></button>
</view>
</view>
<view class="content" v-for="(item1,index1) in item.selectMeasures" :key="index1">
{{index1+1}} . {{item1.PROTECTIVE_MEASURES}}
</view>
</view>
</view>
</view>
</view>
<view class="wui-sign" >
<view class="title"></view>
<button class="cu-btn bg-green shadow" @tap="showModal" data-target="Modal">手写签字</button>
<view class="title"></view>
<button class="cu-btn bg-green shadow" @tap="showModal" data-target="Modal">手写签字</button>
</view>
<view class="wui-sign-box" v-show="imgList && imgList.length > 0">
<view class="sign-title">
签字照片
</view>
<view class="wui-sign-cotent">
<view class="sign-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" data-type="0" :data-url="imgList[index].filePath">
<image :src="imgList[index].filePath" mode="aspectFit"></image>
<view class="sign-title">
签字照片
</view>
<view class="wui-sign-cotent">
<view class="sign-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" data-type="0" :data-url="imgList[index].filePath">
<image :src="imgList[index].filePath" mode="aspectFit"></image>
</view>
</view>
</view>
</view>
<view class="cu-modal" :class="modalName=='Modal'?'show':''">
<writing-board @confirm="subCanvas" @cancel="hideModal"></writing-board>
<writing-board @confirm="subCanvas" @cancel="hideModal"></writing-board>
</view>
</view>
</view>
</view>
<view class="cu-bar btn-group" style="margin-top: 30upx;">
<button class="cu-btn bg-red margin-tb-sm lg" @click="$noMultipleClicks(goSubmit,'-1')"> </button>
@ -78,7 +90,9 @@
<view class="padding flex flex-direction">
</view>
</scroll-view>
</view>
<select-measures :measures-list="measuresList" v-model="measuresListCopy" :visible.sync="selectMeasuresShow" :index="selectMeasuresIndex" row-key="BUS_HOTWORK_MEASURES_ID"/>
</view>
</template>
<script>
@ -90,9 +104,11 @@
import gcoord from '@/common/gcoord.js'
import ruiDatePicker from '@/components/rattenking-dtpicker/rattenking-dtpicker.vue';
import detail from '@/pages/application/hotwork/hotwork-detail/index'
export default {
import selectMeasures from "@/components/select_measures/index.vue";
export default {
components: {
tkiTree,ruiDatePicker,writingBoard,detail
tkiTree,ruiDatePicker,writingBoard,detail,selectMeasures
},
data() {
return {
@ -102,6 +118,9 @@
treeNode:[],//
pd:{},//
measuresList:[],
measuresListCopy:[],
selectMeasuresShow:false,
selectMeasuresIndex:-1,
modalName:null,
imgList:[],
}
@ -112,7 +131,8 @@
//
this.getDept();
this.getMeasures();
loginSession();
this.addMeasuresListCopy();
loginSession();
},
methods: {
//
@ -165,8 +185,8 @@
return;
}
if(APPLY_STATUS == 1){
for (let i = 0; i < this.measuresList.length; i++) {
const measures = this.measuresList[i]
for (let i = 0; i < this.measuresListCopy.length; i++) {
const measures = this.measuresListCopy[i]
if(!measures.USER_ID){
uni.showToast({
icon: 'none',
@ -175,17 +195,37 @@
});
return;
}
if(measures.selectMeasures.length === 0){
uni.showToast({
icon: 'none',
title: '第'+(i+1)+'项未选择安全措施',
duration: 1500
});
return;
}
}
}
const formData={}
var files = [];
var signtime = [];
const signers = this.measuresList.map(item => {
return {
BUS_HOTWORK_MEASURES_ID: item.BUS_HOTWORK_MEASURES_ID,
USER_ID: item.USER_ID
}
})
var signers = [];
for (let i = 0; i < this.measuresListCopy.length; i++) {
const measures = this.measuresListCopy[i]
for (let j = 0; j < measures.selectMeasures.length; j++) {
signers.push({
BUS_HOTWORK_MEASURES_ID: measures.selectMeasures[j].BUS_HOTWORK_MEASURES_ID,
USER_ID: measures.USER_ID
})
}
}
if(signers.length !== this.measuresList.length){
uni.showToast({
icon: 'none',
title: '请为每个安全措施选择确认人',
duration: 1500
});
return;
}
this.uploadImgFaults(files,signtime)
formData.HOTWORK_ID = _this.pd.HOTWORK_ID
formData.SIGNTIME = signtime.join(",")
@ -272,41 +312,70 @@
}
});
},
addMeasuresListCopy(){
this.measuresListCopy.push({
id:Math.random(),
DEPARTMENT_ID:'',
DEPARTMENT_NAME:'',
USER_ID:'',
USER_NAME:'',
userList:[],
userIndex:-1,
selectMeasures:[]
})
},
removeMeasuresListCopy(index){
this.measuresListCopy.splice(index,1)
},
fnSelectMeasures(index){
this.selectMeasuresShow = true
this.selectMeasuresIndex = index
},
showDeptTree(index) {
this.isUps=true
this.$refs['tkiTree'+index][0]._show();
},
showDeptTree(index) {
this.isUps=true
this.$refs['tkiTree'+index][0]._show();
},
deptTreeConfirm(e,i) {
this.isUps=false;
this.measuresList[i].DEPARTMENT_ID=e[0].id;
this.measuresList[i].DEPARTMENT_NAME=e[0].name;
this.measuresList[i].USER_ID = ''
this.measuresList[i].USER_NAME = ''
this.getUserList(e[0].id,i);
},
deptTreeConfirm(e,i) {
this.isUps=false;
this.measuresListCopy[i].DEPARTMENT_ID=e[0].id;
this.measuresListCopy[i].DEPARTMENT_NAME=e[0].name;
this.measuresListCopy[i].USER_ID = ''
this.measuresListCopy[i].USER_NAME = ''
this.getUserList(e[0].id,i);
},
deptTreeCancel(e) {
this.isUps=false;
},
deptTreeCancel(e) {
this.isUps=false;
},
pickerUser(e,i) {
this.measuresList[i].userIndex = e.detail.value;
this.measuresList[i].USER_ID=this.measuresList[i].userList[e.detail.value].USER_ID;
this.measuresList[i].USER_NAME=this.measuresList[i].userList[e.detail.value].NAME;
this.$forceUpdate();//
},
pickerUser(e,i) {
for (let j = 0; j < this.measuresListCopy.length; j++) {
if(this.measuresListCopy[j].USER_ID === this.measuresListCopy[i].userList[e.detail.value].USER_ID && i !== j){
uni.showToast({
icon: 'none',
title: '确认人不能重复',
duration: 1500
});
return;
}
}
this.measuresListCopy[i].userIndex = e.detail.value;
this.measuresListCopy[i].USER_ID=this.measuresListCopy[i].userList[e.detail.value].USER_ID;
this.measuresListCopy[i].USER_NAME=this.measuresListCopy[i].userList[e.detail.value].NAME;
this.$forceUpdate();//
},
isBlankList(i) {
if (this.measuresList[i].userList.length == 0) {
uni.showToast({
icon: 'none',
title: '请先选择确认单位',
duration: 1500
})
}
},
isBlankList(i) {
if (this.measuresListCopy[i].userList.length == 0) {
uni.showToast({
icon: 'none',
title: '请先选择确认单位',
duration: 1500
})
}
},
//
getUserList(dept,i){
@ -327,7 +396,7 @@
},
success: function(res){
if("success" == res.data.result){
_this.measuresList[i].userList = res.data.userList;
_this.measuresListCopy[i].userList = res.data.userList;
}else{
uni.showToast({
title: res.data.message,
@ -375,5 +444,19 @@
</script>
<style>
.measures{
padding-left: 16px;
padding-right: 16px;
.title{
font-weight: bold;
color: #000000;
font-size: 14px;
}
.content{
font-size: 14px;
color: #000000;
margin-top: 5px;
margin-bottom: 5px;
}
}
</style>

View File

@ -110,7 +110,7 @@
<view v-if="eight_work_count>0" class="cu-tag badge">{{ eight_work_count }}</view>
</view>
<view class="text">
<text>高危作业</text>
<text>特殊作业</text>
</view>
</navigator>