qa-prevention-gwj-first-app/pages/application/high-risk-work/lifting-safety-work/work-unit-manager/detail.vue

500 lines
16 KiB
Vue
Raw Normal View History

2023-11-07 09:43:46 +08:00
<template>
<view>
<cu-custom bgColor="bg-gradual-blueness" :isBack="true">
<block slot="backText">返回</block>
<block slot="content">作业单位负责人审核</block>
</cu-custom>
<view class="form">
<view class="wui-form-list">
<view class="cu-form-group">
<view class="title">编号</view>
{{ form.NUMBERING }}
</view>
<view class="cu-form-group">
<view class="title">吊装地点</view>
{{ form.HOISTING_LOCATION }}
</view>
<view class="cu-form-group">
<view class="title">吊装机具</view>
{{ form.HOISTING_EQUIPMENT }}
</view>
<view class="cu-form-group">
<view class="title">吊装作业负责人部门</view>
{{ form.LIFTING_OPERATION_MANAGER_DEPARTMENT_NAME }}
</view>
<view class="cu-form-group">
<view class="title">吊装作业负责人</view>
{{ form.LIFTING_OPERATION_MANAGER_NAME }}
</view>
<view class="cu-form-group">
<view class="title">安全监护人部门</view>
{{ form.SAFETY_GUARDIAN_DEPARTMENT_NAME }}
</view>
<view class="cu-form-group">
<view class="title">安全监护人</view>
{{ form.SAFETY_GUARDIAN_NAME }}
</view>
<view class="cu-form-group">
<view class="title">起重司机</view>
</view>
<view class="cu-form-group">
<uni-table border stripe emptyText="暂无更多数据" style="flex:1;margin: 20upx 0">
<uni-tr>
<uni-td>姓名</uni-td>
<uni-td>作业证号</uni-td>
</uni-tr>
<uni-tr v-for="(item,index) in form.CRANE_DRIVER_NAME" :key="item">
<uni-td>{{ form.CRANE_DRIVER_NAME[index] }}</uni-td>
<uni-td>{{ form.CRANE_DRIVER_NUMBER[index] }}</uni-td>
</uni-tr>
</uni-table>
</view>
<view class="cu-form-group">
<view class="title">作业开始时间</view>
{{ form.JOB_START_TIME }}
</view>
<view class="cu-form-group">
<view class="title">作业结束时间</view>
{{ form.JOB_END_TIME }}
</view>
<view class="cu-form-group">
<view class="title">指挥工</view>
{{ form.COMMANDER_NAME }}
</view>
<view class="cu-form-group">
<view class="title">吊装作业内容</view>
{{ form.HOISTING_WORK_CONTENT }}
</view>
<view class="cu-form-group">
<view class="title">起吊重物质量</view>
{{ form.LIFTING_WEIGHT }}
</view>
<view class="cu-form-group" v-if="form.WORK_LONGITUDE">
<view class="title">作业地点经度</view>
<view>{{form.WORK_LONGITUDE}}</view>
</view>
<view class="cu-form-group" v-if="form.WORK_LATITUDE">
<view class="title">作业地点纬度</view>
<view>{{form.WORK_LATITUDE}}</view>
</view>
<view style="padding: 20upx">
<uni-table border stripe emptyText="暂无更多数据">
<uni-tr>
<uni-th align="center" style="font-weight: bold;width: 100upx">序号</uni-th>
<uni-th align="center" style="font-weight: bold">安全措施</uni-th>
<uni-th align="center" style="font-weight: bold;width: 180upx">操作</uni-th>
</uni-tr>
<uni-tr v-for="(item,index) in measuresList" :key="item.PROTECTIVE_MEASURES">
<uni-td>{{ index + 1 }}</uni-td>
<uni-td>{{ item.PROTECTIVE_MEASURES }}</uni-td>
<uni-td>{{ item.STATUS == 1 ? '符合' : '不符合' }} </uni-td>
</uni-tr>
</uni-table>
</view>
<view class="cu-form-group">
<view class="title">补充措施</view>
<button class="cu-btn round bg-blue" @click="addSupplementaryMeasures"></button>
</view>
<view class="ace-content" v-show="oldSupplementaryMeasures && oldSupplementaryMeasures.length > 0">
<view class="add_pard_item" v-for="(item,index) of oldSupplementaryMeasures" :key="index">
<view v-if="validStr(oldSupplementaryMeasures[index])" class="cu-form-textarea">
<textarea disabled v-model="oldSupplementaryMeasures[index]"></textarea>
</view>
</view>
</view>
<view class="ace-content">
<view class="add_pard_item" v-for="(item,index) of SupplementaryMeasures" :key="index">
<view class="add_pard_del" @click="removeSupplementaryMeasures(index)">
<text class="cuIcon-roundclosefill text-red f40"></text>
</view>
<view class="cu-form-textarea">
<textarea placeholder="请输入补充措施..." v-model="SupplementaryMeasures[index]"></textarea>
</view>
</view>
</view>
<view class="cu-form-textarea">
<view class="cu-form-title">作业负责人意见:</view>
<textarea v-model="form.CONSTRUCTION_JOB_MANAGER_OPINION" disabled placeholder="请输入作业负责人意见"></textarea>
</view>
<view class="cu-form-group">
<view class="title">作业负责人签字</view>
<view>
<view>
<image :src="baseImgPath + form.CONSTRUCTION_JOB_MANAGER_SIGNER_PATH" style="width: 330upx;height: 260upx"></image>
</view>
<view style="text-align: center">{{form.CONSTRUCTION_JOB_MANAGER_SIGNER_TIME}}</view>
</view>
</view>
<view class="cu-form-textarea">
<view class="cu-form-title">作业单位负责人意见:</view>
<textarea v-model="form.WORK_UNIT_MANAGER_OPINION" placeholder="请输入作业单位负责人意见"></textarea>
</view>
<view class="cu-form-group" style="border: none;">
<view class="title">签字</view>
<button class="cu-btn bg-green shadow" @tap="modalShow = true" data-target="Modal">手写签字</button>
</view>
<view class="cu-bar bg-white" v-show="imgList && imgList.length > 0">
<view class="action">
签字照片
</view>
</view>
<view class="cu-form-group" v-show="imgList && imgList.length > 0">
<view class="grid col-4 grid-square flex-sub">
<view style="width: 60%;" class="bg-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="aspectFill"></image>
<view class="cu-tag bg-red" @tap.stop="DelImg" data-type="0" :data-index="index">
<text class='cuIcon-close'></text>
</view>
</view>
</view>
</view>
<view class="cu-modal" :class="{'show':modalShow}">
<sign @confirm="subCanvas" @cancel="modalShow = false"></sign>
</view>
</view>
</view>
<view class="cu-bar btn-group" style="margin-top: 30upx;">
<button class="cu-btn bg-blue margin-tb-sm lg" @click="$noMultipleClicks(goSubmit,'-3')"></button>
<button class="cu-btn bg-green margin-tb-sm lg" @click="$noMultipleClicks(goSubmit,'3')"></button>
</view>
<view class="padding flex flex-direction"></view>
</view>
</template>
<script>
import {
basePath,
loginSession,
baseImgPath,
loginUser,
formatDate
} from '@/common/tool.js';
import sign from '@/components/sign/sign.vue';
export default {
components: {
sign,
},
data() {
return {
baseImgPath,
noClick: true,
form: {
HOISTING_ID: '',
APPLY_DEPARTMENT_ID: '',
APPLY_DEPARTMENT_NAME: '',
APPLY_USER_ID: '',
APPLY_USER_NAME: '',
NUMBERING: '',
HOISTING_LOCATION: '',
HOISTING_EQUIPMENT: '',
LIFTING_OPERATION_MANAGER_DEPARTMENT_NAME: '',
LIFTING_OPERATION_MANAGER_DEPARTMENT_ID: '',
LIFTING_OPERATION_MANAGER_NAME: '',
LIFTING_OPERATION_MANAGER_INDEX: '',
LIFTING_OPERATION_MANAGER_ID: '',
SAFETY_GUARDIAN_DEPARTMENT_NAME: '',
SAFETY_GUARDIAN_DEPARTMENT_ID: '',
SAFETY_GUARDIAN_NAME: '',
SAFETY_GUARDIAN_INDEX: '',
SAFETY_GUARDIAN_ID: '',
CRANE_DRIVER_NAME: [],
CRANE_DRIVER_ID: [],
CRANE_DRIVER_NUMBER: [],
JOB_START_TIME: '',
JOB_END_TIME: '',
COMMANDER_INDEX: '',
COMMANDER_NAME: '',
COMMANDER_ID: '',
HOISTING_WORK_CONTENT: '',
LIFTING_WEIGHT: '',
CONSTRUCTION_JOB_MANAGER_DEPARTMENT_NAME: '',
CONSTRUCTION_JOB_MANAGER_DEPARTMENT_ID: '',
CONSTRUCTION_JOB_MANAGER_INDEX: '',
CONSTRUCTION_JOB_MANAGER_NAME: '',
CONSTRUCTION_JOB_MANAGER_ID: '',
WORK_UNIT_MANAGER_DEPARTMENT_NAME: '',
WORK_UNIT_MANAGER_DEPARTMENT_ID: '',
WORK_UNIT_MANAGER_NAME: '',
WORK_UNIT_MANAGER_INDEX: '',
WORK_UNIT_MANAGER_ID: '',
WORK_UNIT_MANAGER_OPINION: '',
BRANCH_APPROVER_DEPARTMENT_NAME: '',
BRANCH_APPROVER_DEPARTMENT_ID: '',
BRANCH_APPROVER_NAME: '',
BRANCH_APPROVER_INDEX: '',
BRANCH_APPROVER_ID: '',
WORK_LOCATION: '',
WORK_LONGITUDE: '',
WORK_LATITUDE: '',
OTHER_PROTECTIVE_MEASURES: ''
},
rules: [
{name: 'WORK_UNIT_MANAGER_OPINION', message: '请输入作业单位负责人意见'},
],
measuresList: [],
oldSupplementaryMeasures: [],
SupplementaryMeasures: [],
imgList: [],
modalShow: false,
}
},
onLoad(event) {
this.form.HOISTING_ID = event.id
this.getData();
loginSession();
},
methods: {
getData() {
var _this = this;
uni.showLoading({
title: '请稍候'
})
uni.request({
url: basePath + '/app/hoisting/goEdit',
method: 'POST',
header: {
'Content-type': 'application/x-www-form-urlencoded'
},
data: {
HOISTING_ID: _this.form.HOISTING_ID,
},
success: (res) => {
if ("success" == res.data.result) {
_this.form = Object.assign(_this.form, res.data.pd);
_this.measuresList = res.data.measuresList
if (!_this.form.CRANE_DRIVER_ID) {
_this.$set( _this.form, 'CRANE_DRIVER_ID', [] )
} else {
_this.form.CRANE_DRIVER_ID = _this.form.CRANE_DRIVER_ID.split(',')
}
if (!_this.form.CRANE_DRIVER_NAME) {
_this.$set( _this.form, 'CRANE_DRIVER_NAME', [] )
} else {
_this.form.CRANE_DRIVER_NAME = _this.form.CRANE_DRIVER_NAME.split(',')
}
if (!_this.form.CRANE_DRIVER_NUMBER) {
_this.$set( _this.form, 'CRANE_DRIVER_NUMBER', [] )
} else {
_this.form.CRANE_DRIVER_NUMBER = _this.form.CRANE_DRIVER_NUMBER.split(',')
}
if (_this.form.OTHER_PROTECTIVE_MEASURES) {
this.oldSupplementaryMeasures = _this.form.OTHER_PROTECTIVE_MEASURES.split(';_;')
}
this.forbidEdit = true;
uni.hideLoading();
} else if ("exception" == res.data.result) {
uni.showToast({
title: '错误',
duration: 2000
});
}
}
});
},
goSubmit(STATUS) {
let required = true
this.rules.map(({name,message}) => {
if (!this.form[name]) {
uni.showToast({
icon: 'none',
title: message,
duration: 1500
});
required = false
}
})
if (!required) {
return
}
if(STATUS === '3') {
if (this.imgList.length === 0) {
uni.showToast({
icon: 'none',
title: '请签字',
duration: 1500
});
return;
}
}
this.$set(this.form, 'APPLY_STATUS', STATUS)
this.$set(this.form, 'OPERATOR', loginUser.USER_ID)
this.$set(this.form, 'ACTION_USER', loginUser.NAME)
var _this = this;
if(STATUS === '3') {
if (this.SupplementaryMeasures.length > 0) {
this.form.OTHER_PROTECTIVE_MEASURES = this.form.OTHER_PROTECTIVE_MEASURES + ';_;' + '作业单位负责人:' + this.SupplementaryMeasures.join(';') + "。"
}
uni.showLoading({
title: '请稍候'
})
uni.uploadFile({
url: basePath + "/app/hoisting/editStatus",
filePath: _this.imgList[0].filePath,
name: 'FFILE',
formData: this.form,
success: (res) => {
uni.showToast({
icon: 'none',
title: '保存成功',
duration: 2000
});
_this.goback()
},
fail: (err) => {
uni.hideLoading();
uni.showModal({
content: err.errMsg,
showCancel: false
});
}
})
}else{
uni.request({
url: basePath + "/app/hoisting/editStatus",
method: 'POST',
dataType: 'json',
header:{
'Content-type':'application/x-www-form-urlencoded'
},
data: this.form,
success: (res) => {
uni.showToast({
icon:'none',
title: '打回成功',
duration: 2000
});
_this.goback()
},
fail: (err) => {
uni.hideLoading();
uni.showModal({
content: err.errMsg,
showCancel: false
});
}
})
}
},
addSupplementaryMeasures() {
this.SupplementaryMeasures.push('')
},
removeSupplementaryMeasures (i) {
var _this = this;
uni.showModal({
title: '提示',
cancelText: '确认',
confirmText: '取消',
content: '确定删除补充措施吗?',
success: function (res) {
if (res.cancel) {
_this.SupplementaryMeasures.splice(i, 1)
}
}
});
},
subCanvas (e) {
this.imgList.splice(0, this.imgList.length);
this.imgList.push(e);
this.$set(this.form, 'SIGNER_TIME', formatDate(new Date(), 'yyyy-MM-dd hh:mm'))
this.modalShow = false;
},
ViewImage (e) {
let files = [];
for (var i = 0; i < this.imgList.length; i++) {
files.push(this.imgList[i].filePath)
}
uni.previewImage({
urls: files,
current: e.currentTarget.dataset.url
});
},
DelImg (e) {
var _this = this;
let i = e.currentTarget.dataset.index
uni.showModal({
title: '提示',
content: '确定要删除这张图片吗?',
cancelColor: "#000000",
cancelText: '取消',
confirmText: '确定',
success: res => {
if (res.confirm) {
_this.imgList.splice(i, 1)
}
}
})
},
goback() {
uni.navigateBack({
delta: 1
});
uni.hideLoading();
},
}
}
</script>
<style>
.right_icon {
position: relative;
padding-right: 36upx;
width: 200upx;
text-align: right;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.right_icon ::after {
font-family: cuIcon;
display: block;
content: "\e6a3";
position: absolute;
font-size: 17px;
color: #8799a3;
line-height: 50px;
width: 30px;
text-align: center;
top: -28upx;
bottom: 0;
right: -22upx;
margin: auto;
}
.modal_content {
display: flex;
text-align: left;
}
.modal_left {
flex-basis: 50%;
padding: 50upx 20upx;
border-right: 1px solid #000000;
}
.modal_right {
flex-basis: 50%;
padding: 50upx;
}
.modal_left_title, .modal_right_title {
font-size: 16px;
color: #000000;
font-weight: 700;
}
.checkbox-item {
display: flex;
align-items: center;
padding: 0 30upx;
min-height: 100upx;
background-color: #ffffff;
border-bottom: 1upx solid #ddd;
}
.checkbox-item:last-child {
border-bottom: none;
}
</style>