qa-prevention-gwj-first-app/pages/application/eight-assignments/hotwork/on-site-jurisdiction/detail.vue

664 lines
30 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<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>
<view class="wui-form-list">
<view class="cu-form-group">
<view class="title">现场负责人部门:</view>
{{form.SITE_LEADER_DEPARTMENT_NAME}}
</view>
<view class="cu-form-group">
<view class="title">现场负责人:</view>
{{form.SITE_LEADER_NAME}}
</view>
<view class="cu-form-group">
<view class="title">现场负责人手机号:</view>
{{form.SITE_LEADER_PHONE}}
</view>
</view>
<view class="wui-form-list">
<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="cu-form-group">-->
<!-- <view class="title" style="height: auto;">-->
<!-- <view>动火前现场管辖</view>-->
<!-- <view>部门:</view>-->
<!-- </view>-->
<!-- <view class="picker-tree-box">-->
<!-- <view class="picker-tree" @tap="showZgTree">-->
<!-- {{ form.HOT_WORK_BEFORE_UNIT_LEADER_DEPARTMENT_NAME || '请选择' }}-->
<!-- </view>-->
<!-- </view>-->
<!-- <tki-tree ref="tkiTree" :selectParent=true :range="treeNode" rangeKey="name" @confirm="zgtreeConfirm"-->
<!-- @cancel="zgtreeCancel"></tki-tree>-->
<!-- </view>-->
<!-- <view class="cu-form-group" v-if="form.HOT_WORK_BEFORE_UNIT_LEADER_DEPARTMENT_NAME">-->
<!-- <view class="title">负责人:</view>-->
<!-- <picker @change="hotWorkBeforeUnitLeaderChange" :value="form.HOT_WORK_BEFORE_UNIT_LEADER_INDEX"-->
<!-- :range="hotWorkBeforeUnitLeaderList" range-key="NAME">-->
<!-- <view class="picker">-->
<!-- {{ form.HOT_WORK_BEFORE_UNIT_LEADER_NAME || '请选择' }}-->
<!-- </view>-->
<!-- </picker>-->
<!-- </view>-->
<!-- <view class="cu-form-group" v-if="form.HOT_WORK_BEFORE_UNIT_LEADER_PHONE">-->
<!-- <view class="title">负责人电话:</view>-->
<!-- {{ form.HOT_WORK_BEFORE_UNIT_LEADER_PHONE }}-->
<!-- </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,
loginUser,
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: '',
APPLY_DEPARTMENT_NAME: '',
APPLY_USER_NAME: '',
JOB_NUMBER: '',
APPLICATION_DATE: '',
JOB_TYPE_INDEX: '',
JOB_TYPE_ID: '',
JOB_TYPE_NAME: '',
HOT_WORK_POSITION: '',
HOT_WORK_METHOD_ID: '',
HOT_WORK_METHOD_NAME: '',
HOT_WORK_LEVEL_INDEX: '',
HOT_WORK_LEVEL_ID: '',
HOT_WORK_LEVEL_NAME: '',
HOT_WORK_APPLICATION_DEPARTMENT_ID: '',
HOT_WORK_APPLICATION_DEPARTMENT_NAME: '',
DEPARTMENT_PERSONNEL_ID: '',
DEPARTMENT_PERSONNEL_NAME: '',
JOB_CONTENT: '',
SITE_LEADER_ID: '',
SITE_LEADER_NAME: '',
SITE_LEADER_PHONE: '',
SUPERVISOR_OF_HOT_WORK_UNIT: '',
HOT_WORK_TIME: '',
WORK_LONGITUDE: '',
WORK_LATITUDE: '',
HOT_WORK_UNIT_LEADER_ID: '',
HOT_WORK_UNIT_LEADER_NAME: '',
UNIT_LEADER_ID: '',
UNIT_LEADER_NAME: '',
PROJECT_UNIT_LEADER_ID: '',
PROJECT_UNIT_LEADER_NAME: '',
HOT_WORK_PERMIT_ISSUING_UNIT: '',
HOT_WORK_OPERATOR_NAME: [],
OPINION: '',
UNIT_PRINCIPAL: '',
UNIT_PRINCIPAL_TIME: '',
CONTRACTING_UNIT: '',
CONTRACTING_UNIT_TIME: '',
HOT_WORK_BEFORE_UNIT_LEADER_DEPARTMENT_ID: '',
HOT_WORK_BEFORE_UNIT_LEADER_DEPARTMENT_NAME: '',
HOT_WORK_BEFORE_UNIT_LEADER_INDEX: '',
HOT_WORK_BEFORE_UNIT_LEADER_ID: '',
HOT_WORK_BEFORE_UNIT_LEADER_NAME: '',
HOT_WORK_BEFORE_UNIT_LEADER_PHONE: '',
},
measureList: [],
imgList: [],
modalShow: false,
submitType: '',
hotWorkBeforeUnitLeaderList: [],
treeNode: [],
// 其他安全措施
oldOtherMeasure: [],
otherMeasure: [],
}
},
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;
this.oldOtherMeasure = res.data.safetymethodrecordList
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.form.HOT_WORK_BEFORE_UNIT_LEADER_ID) {
// uni.showToast({
// title: '请选择动火前现场管辖单位人',
// duration: 2000
// });
// return;
// }
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: '3',
loginDeptId: loginUser.DEPARTMENT_ID,
loginUserName: loginUser.NAME,
OTHERMEASURE: _this.otherMeasure.join(","),
},
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',
loginUserName: loginUser.NAME,
},
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) {
// if(submitType === 2 && this.form.HOT_WORK_BEFORE_UNIT_LEADER_ID == undefined ||this.form.HOT_WORK_BEFORE_UNIT_LEADER_ID == ''){
// uni.showToast({
// icon: 'none',
// title: '请选择动火前现场管辖负责人',
// duration: 1500
// });
// return;
// }
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();
},
//新增其他安全措施
addOther: function () {
var _this = this;
let o = '';
_this.otherMeasure.push(o);
},
//删除其他安全措施
// removeOldMeasure (i) {
// var _this = this;
// uni.showModal({
// title: '提示',
// cancelText: '确认',
// confirmText: '取消',
// content: '确定删除其他安全措施吗?',
// success: function (res) {
// if (res.cancel) {
// _this.oldOtherMeasure.splice(i, 1)
// }
// }
// });
// },
//删除其他安全措施
removeMeasure(i) {
var _this = this;
uni.showModal({
title: '提示',
cancelText: '确认',
confirmText: '取消',
content: '确定删除其他安全措施吗?',
success: function (res) {
if (res.cancel) {
_this.otherMeasure.splice(i, 1)
}
}
});
},
}
}
</script>
<style lang="scss" scoped>
.handCenter {
margin: 0 40 upx;
.textarea {
padding: 40 upx 0;
}
}
</style>