qa-prevention-gwj-first-app/pages/application/eight-assignments/hotwork/hot-work-front-unit/detail.vue

524 lines
22 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.APPLY_DEPARTMENT_NAME }}
</view>
<view class="cu-form-group">
<view class="title">申请办理人</view>
{{ form.APPLY_USER_NAME }}
</view>
<view class="cu-form-group">
<view class="title">作业编号</view>
{{form.JOB_NUMBER}}
</view>
<view class="cu-form-group">
<view class="title">申请日期</view>
{{ form.APPLICATION_DATE }}
</view>
<view class="cu-form-group">
<view class="title">作业类型</view>
{{ form.JOB_TYPE_NAME }}
</view>
<view class="cu-form-group">
<view class="title">动火部位</view>
{{form.HOT_WORK_POSITION}}
</view>
<view class="cu-form-group">
<view class="title">动火方法</view>
{{ form.HOT_WORK_METHOD_NAME}}
</view>
<view class="cu-form-group">
<view class="title">动火等级</view>
{{ form.HOT_WORK_LEVEL_NAME}}
</view>
<view class="cu-form-group">
<view class="title">动火开始时间</view>
{{ form.HOT_WORK_TIME_START }}
</view>
<view class="cu-form-group">
<view class="title">动火结束时间</view>
{{ form.HOT_WORK_TIME_END }}
</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 class="cu-form-group">
<view class="title">作业内容</view>
{{form.JOB_CONTENT}}
</view>
<view class="cu-form-group">
<view class="title">作业内容</view>
{{form.JOB_CONTENT}}
</view>
<view class="cu-form-group">
<view class="title">动火操作人</view>
<uni-table border stripe emptyText="暂无更多数据" style="flex:1;margin: 20upx 0">
<uni-tr></uni-tr>
<uni-tr v-for="item in form.HOT_WORK_OPERATOR_NAME" :key="item">
<uni-td>{{ item }}</uni-td>
</uni-tr>
</uni-table>
</view>
<view class="cu-form-group">
<view class="title">动火监火人</view>
{{form.SUPERVISOR_OF_HOT_WORK_UNIT}}
</view>
</view>
<view class="wui-form-list">
<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 measureList" :key="item.PROTECTIVE_MEASURES">
<uni-td>{{ index + 1 }}</uni-td>
<uni-td>
<view style="margin-bottom: 20upx;">
{{item.PROTECTIVE_MEASURES}}
</view>
<view class="wui-border" v-if="item.QUESTION1 || item.QUESTION2 || item.QUESTION3 || item.QUESTION4">
<view class="cu-form-group" v-if="item.QUESTION1">
<view class="title">{{item.QUESTION1}}</view>
<input name="input" disabled v-model="item.ANSWER1" placeholder="请输入"></input>
</view>
<view class="cu-form-group" v-if="item.QUESTION2">
<view class="title">{{item.QUESTION2}}</view>
<input name="input" disabled v-model="item.ANSWER2" placeholder="请输入"></input>
</view>
<view class="cu-form-group" v-if="item.QUESTION3">
<view class="title">{{item.QUESTION3}}</view>
<input name="input" disabled v-model="item.ANSWER3" placeholder="请输入"></input>
</view>
<view class="cu-form-group" v-if="item.QUESTION4">
<view class="title">{{item.QUESTION4}}</view>
<input name="input" disabled v-model="item.ANSWER4" placeholder="请输入"></input>
</view>
</view>
</uni-td>
<uni-td>符合</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
<view class="wui-form-list">
<view class="cu-form-group">
<view class="title">其他安全措施</view>
<button class="cu-btn round bg-blue" @click="addOther"></button>
</view>
<view class="ace-content" v-show="oldOtherMeasure && oldOtherMeasure.length > 0">
<view class="add_pard_item" v-for="(item,index) of oldOtherMeasure">
<!-- <view v-if="!forbidEdit" class="add_pard_del" @click="removeOldMeasure(index)">
<text class="cuIcon-roundclosefill text-red f40"></text>
</view> -->
<view class="cu-form-textarea">
<textarea disabled="true" placeholder="请输入其他安全措施..." v-model="item.CONTENT"></textarea>
</view>
</view>
</view>
<view class="ace-content" v-show="otherMeasure && otherMeasure.length > 0">
<view class="add_pard_item" v-for="(item,index) of otherMeasure">
<view class="add_pard_del" @click="removeMeasure(index)">
<text class="cuIcon-roundclosefill text-red f40"></text>
</view>
<view class="cu-form-textarea">
<textarea placeholder="请输入其他安全措施..." v-model="otherMeasure[index]"></textarea>
</view>
</view>
</view>
</view>
<view class="wui-form-list" v-if="form.IS_GAS_TESTING =='1'">
<view class="wui-form-list">
<view class="cu-form-group">
<view class="title">气体分析人</view>
{{form.GAS_TESTING_USER_NAME}}
<button class="cu-btn bg-blue margin-tb-sm sm" @click.stop="$noMultipleClicks(goToGasDelay,form.HOTWORKAPPLICATION_ID)">气体检测信息</button>
</view>
</view>
</view>
<view class="wui-form-list">
<view class="wui-form-list">
<view class="cu-form-group">
<view class="title">动火单位负责人</view>
<view>
<view>
<image :src="baseImgPath + form.HOT_WORK_USER_PRINCIPAL" style="width: 330upx;height: 260upx"></image>
</view>
<view style="text-align: center">{{form.HOT_WORK_USER_PRINCIPAL_TIME}}</view>
</view>
</view>
</view>
</view>
<view class="wui-form-list" v-if="form.JOB_TYPE_INDEX =='1'">
<view class="wui-form-list">
<view class="cu-form-group">
<view class="title">项目发包单位</view>
<view>
<view>
<image :src="baseImgPath + form.PROJECT_UNIT_LEADER_PRINCIPAL" style="width: 330upx;height: 260upx"></image>
</view>
<view style="text-align: center">{{form.PROJECT_UNIT_LEADER_PRINCIPAL_TIME}}</view>
</view>
</view>
</view>
</view>
<view class="wui-form-list">
<view class="wui-form-list">
<view class="cu-form-group">
<view class="title">现场管辖单位负责人</view>
<view>
<view>
<image :src="baseImgPath + form.UNIT_LEADER_PRINCIPAL" style="width: 330upx;height: 260upx"></image>
</view>
<view style="text-align: center">{{form.UNIT_LEADER_PRINCIPAL_TIME}}</view>
</view>
</view>
</view>
</view>
</view>
<view class="cu-bar btn-group" style="margin-top: 30upx;">
<button class="cu-btn bg-grey margin-tb-sm lg" @click="confirmType(1)"></button>
<button class="cu-btn bg-green margin-tb-sm lg" @click="confirmType(2)"></button>
</view>
<view class="padding flex flex-direction"></view>
<view :class="['cu-modal',{'show':modalShow}]">
<sign @confirm="subCanvas" @cancel="modalShow = false" v-if="submitType === 2"></sign>
<view class="cu-dialog" v-if="submitType === 1">
<view class="cu-bar bg-white justify-end">
<view class="content">打回意见</view>
<view class="action" @tap="modalShow = false">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view>
<view class="wrapper">
<view class="handCenter">
<textarea class="textarea" v-model="form.OPINION" placeholder="请输入打回意见"></textarea>
</view>
</view>
</view>
<view class="cu-bar bg-white justify-end">
<view class="action">
<button class="cu-btn line-green text-green" @click="modalShow = false">取消</button>
<button class="cu-btn bg-green margin-left" @click="$noMultipleClicks(goSubmit)"></button>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
basePath,
loginUserId,
loginSession,
corpinfoId,
baseImgPath
} from '@/common/tool.js';
import sign from '@/components/sign/sign.vue';
import tkiTree from "@/components/select-tree/select-tree.vue"
export default {
components: {
sign,
tkiTree
},
data() {
return {
baseImgPath,
noClick: true,
form: {
HOTWORKAPPLICATION_ID: '',
},
measureList: [],
imgList:[],
modalShow: false,
submitType: '',
hotWorkBeforeUnitLeaderList: [],
treeNode: [],
}
},
onLoad(event) {
this.form.HOTWORKAPPLICATION_ID = event.id
this.getData();
loginSession();
this.getMeasureList();
this.getDept();
},
methods: {
getData() {
var _this = this;
uni.showLoading({
title: '请稍候'
})
uni.request({
url: basePath + '/app/hotworkapplication/goEdit',
method: 'POST',
header: {
'Content-type': 'application/x-www-form-urlencoded'
},
data: {
HOTWORKAPPLICATION_ID: _this.form.HOTWORKAPPLICATION_ID,
},
success: (res) => {
if ("success" == res.data.result) {
this.form = res.data.pd;
let HOT_WORK_OPERATOR_NAME = res.data.pd.HOT_WORK_OPERATOR_NAME
this.form.HOT_WORK_OPERATOR_NAME = HOT_WORK_OPERATOR_NAME.substring(0, HOT_WORK_OPERATOR_NAME.length - 1).split(',');
uni.hideLoading();
} else if ("exception" == res.data.result) {
uni.showToast({
title: '错误',
duration: 2000
});
}
}
});
},
goSubmit() {
var _this = this;
if(this.submitType === 2){
if(this.imgList.length === 0){
uni.showToast({
icon: 'none',
title: '请签字',
duration: 1500
});
return;
}
uni.showLoading({
title: '请稍候'
})
uni.uploadFile({
url: basePath + "/app/hotworkapplication/editOpinion",
filePath: _this.imgList[0].filePath,
name: 'FFILE',
formData: {
...this.form,
TYPE:this.submitType,
loginUserId: loginUserId,
CORPINFO_ID :corpinfoId,
STATE:'4'
},
success: (res) => {
uni.hideLoading();
var resJson = JSON.parse(res.data)
if(resJson.result =='success'){
uni.showToast({
icon: 'none',
title: '保存成功',
duration: 2000
});
_this.goback()
}else{
uni.showToast({
icon: 'none',
title: resJson.msg,
duration: 1500,
});
setTimeout(function () {
_this.goback()
}, 1500);
}
},
fail: (err) => {
uni.hideLoading();
uni.showModal({
content: err.errMsg,
showCancel: false
});
}
})
}
if(this.submitType === 1){
uni.showLoading({
title: '请稍候'
})
uni.request({
url: basePath + "/app/hotworkapplication/editOpinion",
method: 'POST',
dataType: 'json',
header: {
'Content-type': 'application/x-www-form-urlencoded'
},
data: {
...this.form,
TYPE:this.submitType,
loginUserId: loginUserId,
CORPINFO_ID :corpinfoId,
STATE:'4'
},
success: (res) => {
let resJson = res.data
if(resJson.result =='success'){
uni.showToast({
icon: 'none',
title: '保存成功',
duration: 2000
});
_this.goback()
}else{
uni.showToast({
icon: 'none',
title: resJson.msg,
duration: 1500
});
_this.goback()
}
},
fail: (err) => {
uni.hideLoading();
uni.showModal({
content: err.errMsg,
showCancel: false
});
}
})
}
},
getMeasureList(){
var _this = this
uni.request({
url: basePath + '/app/hotworkapplication/listAllMeasures',
method: 'POST',
dataType: 'json',
header: {
'Content-type': 'application/x-www-form-urlencoded'
},
data: {
HOTWORKAPPLICATION_ID: _this.form.HOTWORKAPPLICATION_ID
},
success: (res) => {
this.measureList = res.data.varList
}
})
},
getDept(){
let _this = this;
uni.request({
url: basePath + '/app/sys/listTree', //部门下拉接口
method: 'POST',
dataType: 'json',
header: {
'Content-type': 'application/x-www-form-urlencoded'
},
data: {
CORPINFO_ID: corpinfoId,
},
success: (res) => {
if ("success" == res.data.result) {
_this.treeNode = eval(res.data.zTreeNodes);
} else {
uni.showToast({
title: res.data.message,
duration: 2000
});
}
}
});
},
hotWorkBeforeUnitLeaderChange(e) {
this.$set(this.form, 'HOT_WORK_BEFORE_UNIT_LEADER_INDEX', e.detail.value)
this.$set(this.form, 'HOT_WORK_BEFORE_UNIT_LEADER_ID', this.hotWorkBeforeUnitLeaderList[e.detail.value].USER_ID)
this.$set(this.form, 'HOT_WORK_BEFORE_UNIT_LEADER_NAME', this.hotWorkBeforeUnitLeaderList[e.detail.value].NAME)
this.$set(this.form, 'HOT_WORK_BEFORE_UNIT_LEADER_PHONE', this.hotWorkBeforeUnitLeaderList[e.detail.value].USERNAME)
},
confirmType(submitType){
this.imgList = [];
this.submitType = submitType;
this.modalShow = true
},
subCanvas(e) {
this.imgList.push(e);
this.modalShow = false;
this.$nextTick(() => {
this.$noMultipleClicks(this.goSubmit);
});
},
showZgTree() {
this.$refs.tkiTree._show();
},
zgtreeConfirm(e) {
this.$set(this.form, 'HOT_WORK_BEFORE_UNIT_LEADER_DEPARTMENT_ID', e[0].id)
this.$set(this.form, 'HOT_WORK_BEFORE_UNIT_LEADER_DEPARTMENT_NAME', e[0].name)
this.$set(this.form, 'HOT_WORK_BEFORE_UNIT_LEADER_INDEX', '')
this.$set(this.form, 'HOT_WORK_BEFORE_UNIT_LEADER_ID', '')
this.$set(this.form, 'HOT_WORK_BEFORE_UNIT_LEADER_NAME', '')
this.$set(this.form, 'HOT_WORK_BEFORE_UNIT_LEADER_PHONE', '')
this.getUserList(e[0].id);
},
zgtreeCancel(e) {
this.isUps = false;
},
getUserList(DEPARTMENT_ID) {
//发送 post 请求
var _this = this;
uni.request({
method: 'POST',
dataType: 'json',
header: {
'Content-type': 'application/x-www-form-urlencoded'
},
url: basePath + '/app/sys/listUser',
data: {
DEPARTMENT_ID, NOMAIN:'1',
tm: new Date().getTime()
},
success: function (res) {
if ("success" == res.data.result) {
_this.hotWorkBeforeUnitLeaderList = res.data.userList;
} else {
uni.showToast({
title: res.data.message,
duration: 2000
});
}
}
})
},
goToGasDelay(id){
uni.navigateTo({
url: '/pages/application/eight-assignments/hotwork/gasAnalysis/delay?id=' + id
});
},
goback() {
uni.navigateBack({
delta: 1
});
uni.hideLoading();
},
}
}
</script>
<style lang="scss" scoped>
.handCenter{
margin: 0 40upx;
.textarea{
padding: 40upx 0;
}
}
</style>