factory_mp_old/pages/home/detail/ticketHandle.vue

949 lines
23 KiB
Vue
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="ticket-handle">
<uni-nav-bar @clickLeft="goBack()" class="nav-bar" height="110rpx" leftWidth="200rpx" leftText="工单审批"
leftIcon="left" border backgroundColor="#2cade8" color="#fff" fixed statusBar shadow></uni-nav-bar>
<block v-if="cateType==='visit'">
<view class="ticket-info">
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">工单流水号</text>
</view>
<view class="form-right">
<input type="text" v-model="ticketDetail.sn" maxlength="50" placeholder="请输入" />
</view>
</view>
</view>
<view class="ticket-info">
<view class="form-content ">
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">作业名称</text>
</view>
<view class="form-right">
<input type="text" v-model="oplDetail.name" maxlength="50" placeholder="请输入" />
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">开始时间</text>
</view>
<view class="form-right form-date">
<picker mode="date" :value="formData.start_time" @change="bindStartDateChange">
<view class="uni-input">{{formData.start_time}}</view>
</picker>
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">结束时间</text>
</view>
<view class="form-right form-date">
<picker mode="date" :value="formData.end_time" @change="bindEndDateChange">
<view class="uni-input">{{formData.end_time}}</view>
</picker>
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">状态</text>
</view>
<view class="form-right">
<input type="text" v-model="formData.place" maxlength="50" placeholder="请输入" />
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">作业区域</text>
</view>
<view class="form-right">
<input type="text" v-model="formData.place" maxlength="50" placeholder="请输入" />
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">业务部门</text>
</view>
<view class="form-right">
<input type="text" v-model="formData.place" maxlength="50" placeholder="请输入" />
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">部门协调员</text>
</view>
<view class="form-right">
<input type="text" v-model="formData.place" maxlength="50" placeholder="请输入" />
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">属地部门</text>
</view>
<view class="form-right">
<input type="text" v-model="formData.place" maxlength="50" placeholder="请输入" />
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left-text">
<text class="star">*</text>
<text>审批意见</text>
</view>
<textarea class="apply-reason-text" v-model="formData.name" maxlength="250" placeholder="请输入" />
</view>
<view class="btn">
<button type="default" class="save-btn">同意</button>
</view>
</view>
</view>
</block>
<block v-if="cateType==='rparty'">
<view class="ticket-info">
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">工单流水号</text>
</view>
<view class="form-right">
<input type="text" v-model="ticketDetail.sn" maxlength="50" placeholder="请输入" />
</view>
</view>
</view>
<view class="ticket-info">
<view class="form-content ">
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">作业名称</text>
</view>
<view class="form-right">
<input type="text" v-model="oplDetail.name" maxlength="50" placeholder="请输入" />
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">开始时间</text>
</view>
<view class="form-right form-date">
<picker mode="date" :value="formData.start_time" @change="bindStartDateChange">
<view class="uni-input">{{formData.start_time}}</view>
</picker>
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">结束时间</text>
</view>
<view class="form-right form-date">
<picker mode="date" :value="formData.end_time" @change="bindEndDateChange">
<view class="uni-input">{{formData.end_time}}</view>
</picker>
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">状态</text>
</view>
<view class="form-right">
<input type="text" v-model="formData.place" maxlength="50" placeholder="请输入" />
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">作业区域</text>
</view>
<view class="form-right">
<input type="text" v-model="formData.place" maxlength="50" placeholder="请输入" />
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">业务部门</text>
</view>
<view class="form-right">
<input type="text" v-model="formData.place" maxlength="50" placeholder="请输入" />
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">部门协调员</text>
</view>
<view class="form-right">
<input type="text" v-model="formData.place" maxlength="50" placeholder="请输入" />
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">属地部门</text>
</view>
<view class="form-right">
<input type="text" v-model="formData.place" maxlength="50" placeholder="请输入" />
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left-text">
<text class="star">*</text>
<text>审批意见</text>
</view>
<textarea class="apply-reason-text" v-model="formData.name" maxlength="250" placeholder="请输入" />
</view>
<view class="btn">
<button type="default" class="save-btn">同意</button>
</view>
</view>
</view>
</block>
<block v-else>
<view class="ticket-info">
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">工单流水号</text>
</view>
<view class="form-right">
<view>{{ticketDetail.sn}}</view>
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">工单名称</text>
</view>
<view class="form-right">
<view>{{oplDetail.ticket_.title}}</view>
</view>
</view>
<view class="form-item">
<view class="form-left">
<text class="form-left-text">工单状态</text>
</view>
<view class="form-right">
<view>{{oplDetail.ticket_.state_.name}}</view>
</view>
</view>
</view>
<view class="ticket-info">
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">作业名称</text>
</view>
<view class="form-right">
<view>{{oplDetail.operation_.name}}</view>
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">具体地点</text>
</view>
<view class="form-right">
<view>{{oplDetail.operation_.place}}</view>
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">作业状态</text>
</view>
<view class="form-right">
<view>{{state_[oplDetail.operation_.state]}}</view>
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">生产状态</text>
</view>
<view class="form-right">
<view>{{oplDetail.operation_.state_work }}</view>
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">作业区域</text>
</view>
<view class="form-right">
<view>{{oplDetail.operation_.area_.name}}</view>
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">业务部门</text>
</view>
<view class="form-right">
<view>{{oplDetail.operation_.dept_bus_.name}}</view>
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">属地部门</text>
</view>
<view class="form-right">
<view>{{oplDetail.operation_.dept_ter_.name}}</view>
</view>
</view>
<view class="form-item ">
<view class="form-left">
<text class="form-left-text">部门协调员</text>
</view>
<view class="form-right">
<view>{{oplDetail.operation_.coordinator_.name}}</view>
</view>
</view>
</view>
<view class="ticket-info">
<view class="form-content ">
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">开始时间</text>
</view>
<view class="form-right form-date">
<view>{{oplDetail.start_time}}</view>
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">结束时间</text>
</view>
<view class="form-right form-date">
<view>{{oplDetail.end_time}}</view>
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">作业级别</text>
</view>
<view class="form-right">
<view>{{oplDetail.level}}</view>
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">作业部门</text>
</view>
<view class="form-right">
<view>{{oplDetail.dept_do_.name}}</view>
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">作业负责人</text>
</view>
<view class="form-right">
<view>{{oplDetail.charger_.name}}</view>
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">作业监护人</text>
</view>
<view class="form-right">
<view>{{oplDetail.monitor_.name}}</view>
</view>
</view>
<view class="form-item border-bottom">
<view class="form-left">
<text class="form-left-text">风险分析</text>
</view>
<view class="form-right">
<text v-for="item in oplDetail.risks_checked_" :key="item.id">{{ item.name}}|</text>
</view>
</view>
<view class="form-item">
<view class="form-left">
<text class="form-left-text">控制措施</text>
</view>
<view class="form-right">
<text v-for="item in oplDetail.measures_checked_" :key="item.id">{{ item.name}}|</text>
</view>
</view>
</view>
</view>
</block>
<view class="ticket-info">
<view class="form-item" style="height: 300rpx;">
<view class="form-left-text">
<text class="star">*</text>
<text>审批意见</text>
</view>
<textarea class="apply-reason-text" v-model="form.name" maxlength="250" placeholder="请输入" />
</view>
<view class="btn" style="display: flex;justify-content: space-between;">
<view class="left-content">
<button class="handleBtn" type="primary" @click="addNode">加签</button>
<button class="handleBtn" v-if="ticketDetail.state_&&ticketDetail.state_.enable_deliver"
type="primary" plain @click="deliverNode">转交
</button>
</view>
<view class="right-time">
<button v-for="item in operationBtn" :key="item.id" class="handleBtn"
:type="item.attribute_type===2?'danger':'primary'" @click="operationSubmit(item.id)">
{{item.name}}
</button>
</view>
<!-- <button type="default" class="save-btn">同意</button> -->
</view>
</view>
</view>
</template>
<script>
var that;
var promise;
export default {
name: "fafangbaogao_apply",
watch: {
/* 文件下载监听 */
lsDownLoadImg(newVal, oldVal) {
let val = newVal;
if (String(newVal).indexOf(",") > -1) {
val = String(newVal).split(",")[0] === "true";
}
this.$set(this.downFiles, 'downLoadImg' + this.lsFileId, val)
},
/* 文件下载监听 */
principal(newVal, oldVal) {
if (!this.itemId) {
if (oldVal.roleId === undefined && newVal.roleId !== undefined) {
this.formData.itemInfo.applicationDept = newVal.deptId
this.formData.applicationDept = newVal.deptId
}
}
},
},
data() {
const currentDate = this.getDate({
format: true
})
return {
form: {
suggestion: '',
close_note: '',
close_dos: ''
},
ticketId: null,
cateType: null,
operation: null,
projectId: null,
date: currentDate,
detail: false,
isDisabled: false,
btnShow: true,
lsId: "",
sta: null,
eventStatus: "",
execId: '',
// 2022年3月20日
result: [],
// 文件进度
imgFlag: false,
//文件下载
downFiles: {},
timeShow: false,
// 发布网站
releaseWeb: [],
ticketDetail: {},
visitDetail: {},
rpjDetail: {},
oplDetail: {},
opreationDetail: {},
operationBtn: {},
createTimeFromShow: false,
createTimeFromList: [],
createTimeFromCon: '',
depRange: [{
label: "name1",
id: 1
}, {
label: "name2",
id: 2
}],
range: [{
value: 0,
text: "运行"
},
{
value: 1,
text: "停机"
},
{
value: 2,
text: "检修"
},
],
dataTree: [{
text: "曲阳金隅",
value: "1",
children: [{
text: "设计部",
value: "11",
children: [{
text: "设计一部",
value: "111"
},
{
text: "设计一部",
value: "112"
}
]
},
{
text: "12生产部",
value: "12"
}
]
}],
purpose_: {
10: "参观",
20: "拜访",
30: "面试",
40: "开会"
},
rpjType_: {
10: "建筑施工",
20: "设备设施检维修",
30: "保安保洁服务",
40: "其他",
},
state_: {
10: "创建中",
20: "审批中",
30: "待入厂",
40: "进行中",
50: "已完成",
},
}
},
computed: {
startDate() {
return this.getDate('start');
},
endDate() {
return this.getDate('end');
}
},
onLoad(params) {
// debugger;
console.log(params)
that = this;
that.ticketId = params.ticketId;
that.projectId = params.projectId;
that.cateType = params.cateType;
that.operation = params.operation;
},
onShow() {
if (this.cateType === 'visit') {
this.getVisit();
} else if (this.cateType === 'rparty') {
this.getRpj();
} else {
if (this.operation !== null) {
this.getOperation();
this.getOpl();
} else {
this.getOpl();
}
// this.getCloseDos();
}
this.getticketItem();
this.getBtns();
},
methods: {
//工单详情
getticketItem() {
this.$u.api.getTicketItem(this.ticketId).then((res) => {
this.ticketDetail = res;
});
},
//访客详情
getVisit() {
this.$u.api.getVisit(this.ticketId).then(res => {
this.visitDetail = res;
})
},
//入厂项目详情
getRpj() {
this.$u.api.getRpj(this.projectId).then((res) => {
// debugger;
this.rpjDetail = res;
});
},
//作业详情
getOperation() {
// debugger;
this.$u.api.getOpreation(this.operation).then((res) => {
// debugger;
this.opreationDetail = res;
});
},
//许可证详情
getOpl() {
this.$u.api.getOpl(this.projectId).then((res) => {
// debugger;
this.oplDetail = res;
});
},
//获取应有的流转
getBtns() {
this.$u.api.getTicketTransitions(this.ticketId).then(res => {
this.operationBtn = res;
})
},
onnodeclick(e) {
console.log(e);
},
onpopupopened(e) {
console.log('popupopened');
},
onpopupclosed(e) {
console.log('popupclosed');
},
onchange(e) {
console.log('onchange:', e);
},
getDate(type) {
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
if (type === 'start') {
year = year - 60;
} else if (type === 'end') {
year = year + 2;
}
month = month > 9 ? month : '0' + month;
day = day > 9 ? day : '0' + day;
return `${year}-${month}-${day}`;
},
bindStartDateChange: function(e) {
this.formData.start_time = e.detail.value
},
bindEndDateChange: function(e) {
this.formData.end_time = e.detail.value
},
happenTimeFun(num) { //时间戳数据处理
let date = new Date(num);
//时间戳为10位需*1000时间戳为13位的话不需乘1000
let y = date.getFullYear();
let MM = date.getMonth() + 1;
MM = MM < 10 ? ('0' + MM) : MM; //月补0
let d = date.getDate();
d = d < 10 ? ('0' + d) : d; //天补0
let h = date.getHours();
h = h < 10 ? ('0' + h) : h; //小时补0
let m = date.getMinutes();
m = m < 10 ? ('0' + m) : m; //分钟补0
let s = date.getSeconds();
s = s < 10 ? ('0' + s) : s; //秒补0
//         return y + '-' + MM + '-' + d + ' ' + h + ':' + m+ ':' + s;
return y + '-' + MM + '-' + d;
},
createTimeToFn(e) {
that.formData.createTimeTo = e.year + '-' + e.month + '-' + e.day;
},
createTimeFromYesFn(e) {
console.log(e)
var index = e[0]
that.formData.createTimeFrom = that.createTimeFromList[index].id
that.createTimeFromCon = that.createTimeFromList[index].label
},
onSubmit(type) {
if (!this.paramsCheck()) return;
if (this.detail && !this.formData.id) {
uni.showToast({
title: '缺少pkid',
icon: "none"
})
return;
}
this._updatePrintList(this.formData, type);
},
publishChange(e) {
var i = e.detail.value;
that.publishRangeCon = that.publishRange[i].name;
that.formData.scopeOfPublication = that.publishRange[i].id;
},
goBack() {
uni.navigateBack({
delta: 1
})
},
operationSubmit(id) {
let params = new Object();
params.transition = id;
params.ticket_data = {};
params.suggestion = this.form.suggestion;
if (this.ticketDetail.state_.name === '作业负责人关闭') {
params.ticket_data.close_note = this.form.close_note;
params.ticket_data.close_dos = this.form.close_dos;
}
this.$API.wf.ticket.ticketHandle.req(this.ticketId, params).then(res => {
if (res.err_msg) {} else {
this.$router.push("dutywork");
}
})
},
}
}
</script>
<style scoped>
.handleBtn {
height: 80rpx;
line-height: 80rpx;
font-size: 32rpx;
}
.ticket-handle {
background-color: #f3fbff;
padding-bottom: 227rpx;
}
/*
>>>.uni-status-bar {
height: 0 !important;
} */
>>>.uni-navbar-btn-text text {
font-size: 32rpx !important;
}
.ticket-info {
width: 720rpx;
margin: 0 auto;
background-color: #FFFFFF;
border-radius: 10rpx;
padding: 25rpx 32rpx;
box-sizing: border-box;
margin-top: 24rpx;
}
.border-bottom {
border-bottom: 1rpx solid #eeeeee;
}
.star {
color: red;
}
.top-title-text {
padding-left: 24rpx;
position: relative;
font-family: PingFang-SC-Medium;
font-size: 34rpx;
line-height: 72rpx;
color: #383838;
}
.top-title-text::before {
content: "";
width: 6rpx;
height: 29rpx;
background-image: linear-gradient(90deg, #164cc3 0%, #2c6fd9 100%);
border-radius: 3rpx;
display: block;
position: absolute;
left: -4rpx;
top: 22rpx;
}
.form-item {
/* display: flex; */
font-family: PingFang-SC-Medium;
font-size: 30rpx;
/* line-height: 97rpx; */
min-height: 100rpx;
display: flex;
flex-wrap: wrap;
align-items: center;
}
.form-left-text {
color: #212121;
margin-bottom: 33rpx;
}
.form-left {
/* min-width: 160rpx; */
/* width: 100%; */
}
.form-right {
margin-left: 20rpx;
flex: 1;
color: #414141;
}
.form-right input {
/* height: 100%; */
/* height: 60rpx; */
font-size: 30rpx;
}
.form-date>>>.uni-date__x-input {
height: 97rpx;
font-size: 30rpx;
}
.form-date>>>.uni-icons {
display: none;
}
.ticket-handle>>>uni-input {
/* height: 100%; */
font-size: 30rpx;
}
.apply-reason-text {
width: 653rpx;
height: 179rpx;
background-color: #f6f8fc;
border: solid 1rpx #e5e5e5;
margin-top: 21rpx;
padding: 14rpx 24rpx;
font-size: 26rpx;
box-sizing: border-box;
}
.apply_require {
margin-top: 0rpx !important;
}
.file-list {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
padding-top: 13rpx;
}
.file-wrap {
margin-top: 20rpx;
margin-right: 20rpx;
}
.file-item {
width: 155rpx;
height: 155rpx;
border: solid 1rpx #e5e5e5;
text-align: center;
display: flex;
align-items: center;
position: relative;
}
.file-content {
width: 100%;
}
.file-item .file-icon {
width: 37rpx;
height: 37rpx;
}
.file-item .file-name {
font-family: PingFang-SC-Regular;
font-size: 20rpx;
line-height: 17rpx;
color: #313131;
margin-top: 11rpx;
padding: 10rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.file-item>>>.uni-icons {
width: 26rpx;
height: 26rpx;
position: absolute;
right: -8rpx;
top: -22rpx;
/*
background-color: #d81e06;
border-radius: 50%;
font-size: 20rpx !important;
padding: 5rpx;
*/
box-sizing: border-box;
}
.form-right {
flex: 1;
color: #414141;
}
/*部门*/
uni-data-picker {
width: 100%;
border: none !important;
}
.my-data-picker>>>.input-value-border {
border: none !important;
}
>>>.input-value {
font-size: 30rpx !important;
;
}
.my-data-picker uni-data-picker {
width: 100% !important;
}
.my-data-picker {
width: 100%;
display: flex;
align-items: center;
margin-left: -10rpx;
}
/* 主体 */
>>>.uni-navbar__header,
>>>.uni-status-bar {
background-image: linear-gradient(90deg, #164cc3 0%, #2c6fd9 100%), linear-gradient(#e60012, #e60012) !important;
}
.title {
font-size: 14px;
font-weight: bold;
margin: 20px 0 5px 0;
}
.data-pickerview {
height: 400px;
border: 1px #e5e5e5 solid;
}
.popper__arrow {
top: -6px;
left: 50%;
margin-right: 3px;
border-top-width: 0;
border-bottom-color: #EBEEF5;
}
.popper__arrow {
top: -6px;
left: 50%;
margin-right: 3px;
border-top-width: 0;
border-bottom-color: #EBEEF5;
}
</style>