关联工作票

This commit is contained in:
yunkexin 2026-07-23 09:31:02 +08:00
parent 81f2b72a34
commit 0c2bbe81b1
3 changed files with 602 additions and 565 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<view style="padding-bottom: 80px;"> <view style="padding-bottom: 80px;" :class="{ 'is-popup': isPopupMode }">
<view class="card"> <view class="card">
<view class="background"></view> <view class="background" v-if="!isPopupMode"></view>
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" :model="model" class="demo-ruleForm"> <u--form labelPosition="left" labelWidth="auto" labelAlign="center" :model="model" class="demo-ruleForm">
<view style="position: relative;"> <view style="position: relative;">
<view style="position: absolute;left: -10px;color: #3d4b70;top: -3px;">*</view> <view style="position: absolute;left: -10px;color: #3d4b70;top: -3px;">*</view>
@ -258,9 +258,9 @@
</view> </view>
<audit-process :show="showAudit" @close="handleCloseAudit" :dataSource="auditData" /> <audit-process :show="showAudit" @close="handleCloseAudit" :dataSource="auditData" />
<check-action v-if="isLoadOK && tableKey === '1'&&isAudit==='true' " :okApi="okApi" :refuseApi="refuseApi" :dataSource="$store.state.auditModel"></check-action> <check-action v-if="isLoadOK && tableKeyLocal === '1'&&isAuditLocal==='true' " :okApi="okApiLocal" :refuseApi="refuseApiLocal" :dataSource="$store.state.auditModel"></check-action>
<view class="bottom-button"> <view class="bottom-button" v-if="!isPopupMode">
<u-button type="primary" class="bottom" v-if="isLoadOK&&tableKey==='1'&&!isAudit" @click="onTableBtnAgree" color="#3d4b70">审阅</u-button> <u-button type="primary" class="bottom" v-if="isLoadOK&&tableKeyLocal==='1'&&!isAuditLocal" @click="onTableBtnAgree" color="#3d4b70">审阅</u-button>
<!-- <button type="primary" class="bottom" v-if='isLoadOK&&tableKey==1' @click="onTableBtnAgree">签到</button> --> <!-- <button type="primary" class="bottom" v-if='isLoadOK&&tableKey==1' @click="onTableBtnAgree">签到</button> -->
</view> </view>
</view> </view>
@ -287,6 +287,46 @@
} from '../../../../services/common'; } from '../../../../services/common';
export default { export default {
// props
props: {
// ID
id: {
type: [String, Number],
default: null
},
//
isPopupMode: {
type: Boolean,
default: false
},
// ID
taskID: {
type: String,
default: ''
},
//
tableKey: {
type: [String, Number],
default: '0'
},
//
okApi: {
type: String,
default: ''
},
refuseApi: {
type: String,
default: ''
},
approveID: {
type: String,
default: ''
},
isAudit: {
type: [String, Boolean],
default: false
}
},
data() { data() {
return { return {
imgurl: config.uni_app_web_api_url + ':5199', imgurl: config.uni_app_web_api_url + ':5199',
@ -341,10 +381,10 @@
listPropUpload: ['PRE_SHIFT_MEETING_RECORD_ID'], listPropUpload: ['PRE_SHIFT_MEETING_RECORD_ID'],
listPropValUpload: [], listPropValUpload: [],
TaskID: "", TaskID: "",
tableKey: '0', tableKeyLocal: '0',
okApi: '', okApiLocal: '',
refuseApi: '', refuseApiLocal: '',
isAudit: false, isAuditLocal: false,
isLoadOK: false, isLoadOK: false,
showAudit: false, showAudit: false,
auditData: [], auditData: [],
@ -353,19 +393,71 @@
enumsText: {} // enumsText: {} //
} }
}, },
//
onLoad(option) { onLoad(option) {
this.ID = option.ID; if (option && option.ID) {
this.TaskID = option.taskID; this.ID = option.ID;
this.tableKey = option.tableKey ? option.tableKey : '0' this.TaskID = option.taskID || '';
this.okApi = option.okApi this.tableKeyLocal = option.tableKey ? option.tableKey : '0'
this.refuseApi = option.refuseApi this.okApiLocal = option.okApi || ''
this.ApproveID = option.ApproveID this.refuseApiLocal = option.refuseApi || ''
this.isAudit = option.isAudit this.ApproveID = option.approveID || ''
this.auditModel = { this.isAuditLocal = option.isAudit || false
...this.$store.state.auditModel,
TaskID: option.taskID ? option.taskID : '' if (this.isAuditLocal && this.TaskID) {
this.$store.commit('setAuditModel', {
...this.$store.state.auditModel,
TaskID: this.TaskID
})
}
this.fetchEnums(['HMOperationTaskAuditEnum', 'SKEvaluateLevelEnum', 'FOJobStepEnum', 'FOYesOrNoEnum']);
}
},
watch: {
// props id
id: {
immediate: true,
handler(val) {
if (val && !this.ID) {
this.ID = val;
this.TaskID = this.taskID || '';
this.tableKeyLocal = this.tableKey || '0'
this.okApiLocal = this.okApi || ''
this.refuseApiLocal = this.refuseApi || ''
this.isAuditLocal = this.isAudit || false
if (this.isAuditLocal && this.TaskID) {
this.$store.commit('setAuditModel', {
...this.$store.state.auditModel,
TaskID: this.TaskID
})
}
this.fetchEnums(['HMOperationTaskAuditEnum', 'SKEvaluateLevelEnum', 'FOJobStepEnum', 'FOYesOrNoEnum']);
}
}
}
},
mounted() {
// props id onLoad
if (this.id && !this.ID) {
this.ID = this.id;
this.TaskID = this.taskID || '';
this.tableKeyLocal = this.tableKey || '0'
this.okApiLocal = this.okApi || ''
this.refuseApiLocal = this.refuseApi || ''
this.isAuditLocal = this.isAudit || false
if (this.isAuditLocal && this.TaskID) {
this.$store.commit('setAuditModel', {
...this.$store.state.auditModel,
TaskID: this.TaskID
})
}
this.fetchEnums(['HMOperationTaskAuditEnum', 'SKEvaluateLevelEnum', 'FOJobStepEnum', 'FOYesOrNoEnum']);
} }
this.fetchEnums(['HMOperationTaskAuditEnum', 'SKEvaluateLevelEnum', 'FOJobStepEnum', 'FOYesOrNoEnum']);
}, },
methods: { methods: {
fetchEnums(enumNames) { fetchEnums(enumNames) {
@ -379,10 +471,16 @@
this.enumsText = newd[1] this.enumsText = newd[1]
this.loadData(); this.loadData();
this.loadAuditData() this.loadAuditData()
}).catch(err => {
console.error('获取枚举数据失败:', err)
}) })
}, },
loadData() { loadData() {
if (!this.ID) {
console.warn('jobFireShow: 未获取到 ID')
return
}
const orgId = uni.getStorageSync('orgId') const orgId = uni.getStorageSync('orgId')
const json = initFilter(orgId, "", "CODE", 1) const json = initFilter(orgId, "", "CODE", 1)
extendRule(json, 'ID', 1, this.ID); extendRule(json, 'ID', 1, this.ID);
@ -398,6 +496,9 @@
}) })
} }
this.isLoadOK = true; this.isLoadOK = true;
}).catch(err => {
console.error('获取动火工作票数据失败:', err)
uni.$showErrorInfo('获取动火工作票数据失败')
}) })
}, },
onTableBtnAgree() { onTableBtnAgree() {
@ -414,23 +515,25 @@
}, },
loadAuditData() { loadAuditData() {
if (!this.ID) {
return Promise.resolve([])
}
const orgId = uni.getStorageSync('orgId') const orgId = uni.getStorageSync('orgId')
const json = initFilter(orgId, this.ID, "CODE", 1) const json = initFilter(orgId, this.ID, "CODE", 1)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getRequest(json, "/PF/Approve/GetApproveInfo").then(res => { getRequest(json, "/PF/Approve/GetApproveInfo").then(res => {
if (res) { if (res && res.length > 0) {
if (res && res[0].Nav_ApproveDetails.length > 0) { if (res[0].Nav_ApproveDetails && res[0].Nav_ApproveDetails.length > 0) {
res[0].Nav_ApproveDetails.sort((a, b) => a.NUM - b.NUM) res[0].Nav_ApproveDetails.sort((a, b) => a.NUM - b.NUM)
resolve(res)
} }
this.auditData = res this.auditData = res
resolve(res)
} else { } else {
uni.showToast({ this.auditData = []
title: '暂无审批数据', resolve([])
icon: 'none'
})
} }
}).catch(err => { }).catch(err => {
console.error('获取审批数据失败:', err)
reject(err) reject(err)
}) })
}) })
@ -439,11 +542,7 @@
this.showAudit = false this.showAudit = false
}, },
async onNavigationBarButtonTap() { async onNavigationBarButtonTap() {
// const res = await this.loadAuditData()
// if (res) {
// this.auditData = res
this.showAudit = true this.showAudit = true
// }
} }
}, },
computed: { computed: {
@ -454,4 +553,14 @@
<style> <style>
@import url("../../../../style/css/newTemplate.css"); @import url("../../../../style/css/newTemplate.css");
/* 弹窗模式下隐藏底部按钮 */
.is-popup .bottom-button {
display: none !important;
}
/* 弹窗模式下调整内边距 */
.is-popup {
padding-bottom: 16px !important;
}
</style> </style>

View File

@ -1,5 +1,5 @@
<template> <template>
<view class="page-wrap"> <view class="page-wrap" :class="{ 'is-popup': isPopupMode }">
<view class="card"> <view class="card">
<uni-card margin="0" :is-shadow="true"> <uni-card margin="0" :is-shadow="true">
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" :model="dataModel" ref="wForm" <u--form labelPosition="left" labelWidth="auto" labelAlign="center" :model="dataModel" ref="wForm"
@ -111,7 +111,7 @@
<audit-process :show="showAudit" @close="handleCloseAudit" :dataSource="auditData" /> <audit-process :show="showAudit" @close="handleCloseAudit" :dataSource="auditData" />
<check-action v-if="isLoadOK && tableKey === '1'&&isAudit==='true' " :okApi="okApi" :refuseApi="refuseApi" <check-action v-if="isLoadOK && tableKey === '1'&&isAudit==='true' " :okApi="okApi" :refuseApi="refuseApi"
:dataSource="$store.state.auditModel"></check-action> :dataSource="$store.state.auditModel"></check-action>
<view class="bottom-button"> <view class="bottom-button" v-if="!isPopupMode">
<button type="primary" class="bottom" v-if="isLoadOK&&tableKey==='1'&&!isAudit" <button type="primary" class="bottom" v-if="isLoadOK&&tableKey==='1'&&!isAudit"
@click="onTableBtnAgree">确认</button> @click="onTableBtnAgree">确认</button>
<!-- <button type="primary" class="bottom" v-if='isLoadOK&&tableKey==1' @click="onTableBtnAgree">签到</button> --> <!-- <button type="primary" class="bottom" v-if='isLoadOK&&tableKey==1' @click="onTableBtnAgree">签到</button> -->
@ -149,17 +149,57 @@
components: { components: {
imageSign imageSign
}, },
// props
props: {
// ID
id: {
type: [String, Number],
default: null
},
//
isPopupMode: {
type: Boolean,
default: false
},
// ID
taskID: {
type: String,
default: ''
},
//
tableKey: {
type: [String, Number],
default: '0'
},
//
okApi: {
type: String,
default: ''
},
refuseApi: {
type: String,
default: ''
},
approveID: {
type: String,
default: ''
},
isAudit: {
type: [String, Boolean],
default: false
}
},
data() { data() {
return { return {
OrgId:uni.getStorageSync('orgId'), OrgId: uni.getStorageSync('orgId'),
showAudit: false, showAudit: false,
auditData: [], auditData: [],
ID: null, ID: null,
TaskID: null, TaskID: null,
tableKey: 0, tableKeyLocal: 0,
okApi: '', okApiLocal: '',
refuseApi: '', refuseApiLocal: '',
isAudit: false, isAuditLocal: false,
isLoadOK: false, isLoadOK: false,
userLists: [], userLists: [],
certificateLists: [], certificateLists: [],
@ -188,37 +228,90 @@
}, },
currentOperateUser: {}, currentOperateUser: {},
showPopup: false, showPopup: false,
// currentCertificate: {},
// showPopupCertificate: false,
} }
}, },
//
onLoad(opt) { onLoad(opt) {
this.handleGetJobGet(opt) // 使 onLoad
this.loadAuditData() if (opt && opt.ID) {
this.handleGetJobGet({
ID: opt.ID,
taskID: opt.taskID || '',
tableKey: opt.tableKey || '0',
okApi: opt.okApi || '',
refuseApi: opt.refuseApi || '',
approveID: opt.approveID || '',
isAudit: opt.isAudit || false
})
this.loadAuditData()
}
},
watch: {
// props id
id: {
immediate: true,
handler(val) {
if (val && !this.ID) {
this.handleGetJobGet({
ID: val,
taskID: this.taskID || '',
tableKey: this.tableKey || '0',
okApi: this.okApi || '',
refuseApi: this.refuseApi || '',
approveID: this.approveID || '',
isAudit: this.isAudit || false
})
this.loadAuditData()
}
}
}
},
mounted() {
// props id onLoad
if (this.id && !this.ID) {
this.handleGetJobGet({
ID: this.id,
taskID: this.taskID || '',
tableKey: this.tableKey || '0',
okApi: this.okApi || '',
refuseApi: this.refuseApi || '',
approveID: this.approveID || '',
isAudit: this.isAudit || false
})
this.loadAuditData()
}
}, },
methods: { methods: {
handleGetJobGet(opt) { handleGetJobGet(opt) {
// 使 props id
const id = opt.ID || this.id;
if (!id) {
console.warn('jobShow: 未获取到 ID')
return
}
const orgId = uni.getStorageSync('orgId') const orgId = uni.getStorageSync('orgId')
const json = initFilter(orgId, "", "") const json = initFilter(orgId, "", "")
this.TaskID = opt.taskID ? opt.taskID : ''; this.TaskID = opt.taskID || this.taskID || '';
this.ID = opt.ID ? opt.ID : ''; this.ID = id;
this.tableKey = opt.tableKey ? opt.tableKey : '0' this.tableKeyLocal = opt.tableKey || this.tableKey || '0'
this.okApi = opt.okApi this.okApiLocal = opt.okApi || this.okApi || ''
this.refuseApi = opt.refuseApi this.refuseApiLocal = opt.refuseApi || this.refuseApi || ''
this.ApproveID = opt.ApproveID this.ApproveID = opt.approveID || this.approveID || ''
this.isAudit = opt.isAudit this.isAuditLocal = opt.isAudit || this.isAudit || false
this.auditModel = {
...this.$store.state.auditModel, if (this.isAuditLocal && this.TaskID) {
TaskID: opt.taskID ? opt.taskID : '' this.$store.commit('setAuditModel', {
...this.$store.state.auditModel,
TaskID: this.TaskID
})
} }
extendRule(json, 'ID', 1, opt.ID)
// extendInclude(json, 'Nav_OperationStep'); extendRule(json, 'ID', 1, id)
// extendInclude(json, 'Nav_ApplyUser');
// extendInclude(json, 'Nav_MonitorUser');
// TODO: id
getRequest(json, "/FO/FOCrucialLicenseJob/FullGet").then(res => { getRequest(json, "/FO/FOCrucialLicenseJob/FullGet").then(res => {
this.dataModel = res this.dataModel = res
// // -
let strUserName = '' let strUserName = ''
if (res.Nav_CrucialLicensePerson && res.Nav_CrucialLicensePerson.length > 0) { if (res.Nav_CrucialLicensePerson && res.Nav_CrucialLicensePerson.length > 0) {
for (let i = 0; i < res.Nav_CrucialLicensePerson.length; i++) { for (let i = 0; i < res.Nav_CrucialLicensePerson.length; i++) {
@ -231,10 +324,9 @@
.Nav_CrucialLicensePerson[ .Nav_CrucialLicensePerson[
i].Nav_User.NAME; i].Nav_User.NAME;
} }
} }
} }
// // -
let strConfirms = '' let strConfirms = ''
if (res.Nav_SafeConfirms && res.Nav_SafeConfirms.length > 0) { if (res.Nav_SafeConfirms && res.Nav_SafeConfirms.length > 0) {
for (let i = 0; i < res.Nav_SafeConfirms.length; i++) { for (let i = 0; i < res.Nav_SafeConfirms.length; i++) {
@ -242,7 +334,7 @@
"." + res.Nav_SafeConfirms[i].NAME; "." + res.Nav_SafeConfirms[i].NAME;
} }
} }
// // -
let strMeasures = '' let strMeasures = ''
if (res.Nav_SafeMeasures && res.Nav_SafeMeasures.length > 0) { if (res.Nav_SafeMeasures && res.Nav_SafeMeasures.length > 0) {
for (let i = 0; i < res.Nav_SafeMeasures.length; i++) { for (let i = 0; i < res.Nav_SafeMeasures.length; i++) {
@ -250,7 +342,7 @@
"." + res.Nav_SafeMeasures[i].NAME; "." + res.Nav_SafeMeasures[i].NAME;
} }
} }
// // -
let strDeals = '' let strDeals = ''
if (res.Nav_DealMeasures && res.Nav_DealMeasures.length > 0) { if (res.Nav_DealMeasures && res.Nav_DealMeasures.length > 0) {
for (let i = 0; i < res.Nav_DealMeasures.length; i++) { for (let i = 0; i < res.Nav_DealMeasures.length; i++) {
@ -269,6 +361,9 @@
this.dataModel.UserMeasures = strMeasures this.dataModel.UserMeasures = strMeasures
this.dataModel.UserDeals = strDeals this.dataModel.UserDeals = strDeals
this.isLoadOK = true this.isLoadOK = true
}).catch(err => {
console.error('获取工作票数据失败:', err)
uni.$showErrorInfo('获取工作票数据失败')
}) })
}, },
onTableBtnAgree() { onTableBtnAgree() {
@ -287,19 +382,18 @@
const json = initFilter(orgId, this.ID, "CODE", 1) const json = initFilter(orgId, this.ID, "CODE", 1)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getRequest(json, "/PF/Approve/GetApproveInfo").then(res => { getRequest(json, "/PF/Approve/GetApproveInfo").then(res => {
if (res) { if (res && res.length > 0) {
if (res && res[0].Nav_ApproveDetails.length > 0) { if (res[0].Nav_ApproveDetails && res[0].Nav_ApproveDetails.length > 0) {
res[0].Nav_ApproveDetails.sort((a, b) => a.NUM - b.NUM) res[0].Nav_ApproveDetails.sort((a, b) => a.NUM - b.NUM)
resolve(res)
} }
this.auditData = res this.auditData = res
resolve(res)
} else { } else {
uni.showToast({ this.auditData = []
title: '暂无审批数据', resolve([])
icon: 'none'
})
} }
}).catch(err => { }).catch(err => {
console.error('获取审批数据失败:', err)
reject(err) reject(err)
}) })
}) })
@ -308,11 +402,7 @@
this.showAudit = false this.showAudit = false
}, },
async onNavigationBarButtonTap() { async onNavigationBarButtonTap() {
// const res = await this.loadAuditData()
// if (res) {
// this.auditData = res
this.showAudit = true this.showAudit = true
// }
} }
} }
} }
@ -352,4 +442,11 @@
.page-wrap>>>.u-upload__button { .page-wrap>>>.u-upload__button {
margin-bottom: 0; margin-bottom: 0;
} }
/* 弹窗模式下调整内边距,隐藏底部按钮区域 */
.page-wrap.is-popup {
padding: 0 0 16px 0;
}
</style> </style>

View File

@ -1,494 +1,325 @@
<template> <template>
<view class="page-wrap"> <view class="page-wrap">
<view class="card"> <view class="card">
<uni-card margin="0" :is-shadow="true"> <uni-card margin="0" :is-shadow="true">
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" :model="dataModel" :rules="rules" <u--form labelPosition="left" labelWidth="auto" labelAlign="center" :model="dataModel" :rules="rules" ref="wForm" errorType="border-bottom">
ref="wForm" errorType="border-bottom">
<u-form-item label="编号" prop="CODE" borderBottom>
<u-form-item label="编号" prop="CODE" borderBottom> <u--input v-model="dataModel.CODE" disabled disabledColor="#ffffff" placeholder="请输入编号" border="none" inputAlign="right">
<u--input v-model="dataModel.CODE" disabled disabledColor="#ffffff" placeholder="请输入编号" border="none" inputAlign="right"> </u--input>
</u--input>
</u-form-item>
<u-form-item label="作业名称" prop="stepName" borderBottom required>
<u--input v-model="dataModel.Nav_OperationStep.NAME" disabled disabledColor="#ffffff" placeholder="请输入作业名称" border="none"
inputAlign="right"></u--input>
</u-form-item>
<u-form-item label="作业地点" prop="JOB_LOCATION" borderBottom>
<u--input v-model="dataModel.JOB_LOCATION" placeholder="请输入作业地点" border="none"
inputAlign="right"></u--input>
</u-form-item>
<u-form-item label="交底时间" prop="DISCLOSURE_DATE" borderBottom required
@click="showCheckDate({ name: 'jobDate', dataIndex: index})">
<u--input v-model="dataModel.DISCLOSURE_DATE" placeholder="请输入交底时间" border="none" inputAlign="right">
</u--input>
<u-icon style="margin-left: 4px;" slot="right"
name="arrow-down"></u-icon>
</u-form-item>
<u-form-item label="交底人" prop="disclosurePerson" borderBottom required>
<u--input v-model="dataModel.Nav_DisclosurePerson.NAME" placeholder="请输入交底人" border="none" inputAlign="right">
</u--input>
</u-form-item>
<u-form-item label="交底内容" prop="DisclosureContent" borderBottom required class="demo-ruleForm">
<u--textarea maxlength="1000" count v-model="dataModel.DisclosureContent" placeholder="请输入交底内容" border="none" inputAlign="left">
</u--textarea>
</u-form-item> </u-form-item>
<u-form-item label="作业名称" prop="stepName" borderBottom required>
<u--input v-model="dataModel.Nav_OperationStep.NAME" disabled disabledColor="#ffffff" placeholder="请输入作业名称" border="none" inputAlign="right"></u--input>
</u-form-item>
<u-form-item label="作业地点" prop="JOB_LOCATION" borderBottom>
<u--input v-model="dataModel.JOB_LOCATION" placeholder="请输入作业地点" border="none" inputAlign="right"></u--input>
</u-form-item>
<u-form-item label="交底时间" prop="DISCLOSURE_DATE" borderBottom required @click="showCheckDate({ name: 'jobDate', dataIndex: index})">
<u--input v-model="dataModel.DISCLOSURE_DATE" placeholder="请输入交底时间" border="none" inputAlign="right">
</u--input>
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down"></u-icon>
</u-form-item>
<u-form-item label="交底人" prop="disclosurePerson" borderBottom required>
<u--input v-model="dataModel.Nav_DisclosurePerson.NAME" placeholder="请输入交底人" border="none" inputAlign="right">
</u--input>
</u-form-item>
<u-form-item label="交底内容" prop="DisclosureContent" borderBottom required class="demo-ruleForm">
</u-form-item>
<u--textarea maxlength="1000" count v-model="dataModel.DisclosureContent" placeholder="请输入交底内容" border="none" inputAlign="left">
</u--textarea>
<view class="upload-title">附件</view> <view class="upload-title">附件</view>
<full-upload v-model="dataModel.Nav_Files"></full-upload> <full-upload v-model="dataModel.Nav_Files"></full-upload>
</u--form> <u-form-item label="关联内部工作票" prop="disclosurePerson" borderBottom>
</uni-card> <u--input v-model="(dataModel.Nav_JobName||{}).CODE" disabled disabledColor="#ffffff" border="none" inputAlign="right">
</view> </u--input>
<view class="sub-form" :style="{display:this.isVisble}"> <u-icon style="margin-left: 4px;" slot="right" name="info-circle" v-if="dataModel.Nav_JobName" @click="naviJob(dataModel.Nav_JobName.ID)"></u-icon>
<view class="sub-form-wrap"> </u-form-item>
<view class="sub-form-btns"> <u-form-item label="关联动火工作票" prop="disclosurePerson" borderBottom>
<view class="sub-form-btn" @click="handleAddUser"> <u--input v-model="(dataModel.Nav_FireJob||{}).CODE" disabled disabledColor="#ffffff" border="none" inputAlign="right">
<u-icon class="icon" name="plus-circle" color="#3c9cff" size="21"></u-icon> </u--input>
<u--text type="primary" text="新增作业人员"></u--text> <u-icon style="margin-left: 4px;" slot="right" name="info-circle" v-if="dataModel.Nav_FireJob" @click="naviJob(dataModel.Nav_FireJob.ID)"></u-icon>
</view> </u-form-item>
</view> </u--form>
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" errorType="border-bottom" </uni-card>
ref="sForm1"> </view>
<uni-collapse :border="false" accordion> <!-- ... 其他原有内容 ... -->
<uni-card style="margin-bottom: 16px;" margin="0" spacing="0" :is-shadow="false"
v-for="(item, index) in dataModel.Nav_Person"> <!-- 使用 u-popup 弹窗展示 jobShow -->
<uni-collapse-item title-border="none" :show-arrow="false" :border="false" :open="true"> <u-popup :show="showJobPopup" @close="closeJobPopup" mode="center" :round="12" :closeable="true" :closeOnClickOverlay="true">
<view slot="title" class="custom-collapse-title"> <view class="job-popup-wrap">
<view class="down"> <view class="job-popup-header">
<uni-icons type="bottom"></uni-icons> <text class="job-popup-title">关联工作票详情</text>
</view> </view>
<view class="text" v-if="item.Nav_User">{{index + 1 + '. ' +item.Nav_User.NAME}}</view> <scroll-view class="job-popup-body" scroll-y :style="{ height: popupHeight + 'px' }">
<view class="action" @click.stop> <!-- 使用 jobShow 组件传入 id 属性 -->
<u-icon @click="handleDelRowBefore(index)" class="icon" name="trash" color="#ff4d4f" size="21"></u-icon> <job-show v-if="jobShowId&&dataModel.Nav_JobName" :id="jobShowId" ref="jobShowRef"></job-show>
</view> <job-fire-show :isPopupMode="true" v-if="jobShowId&&dataModel.Nav_FireJob" :id="jobShowId" ref="jobFireShowRef"></job-fire-show>
</view> </scroll-view>
<u-form-item v-if="item.Nav_User" label="人员姓名" prop="personName" borderBottom </view>
@click="handleChangeUser(item['Nav_User'])"> </u-popup>
<u--input disabled disabledColor="#fff"
v-model="item['Nav_User'].NAME" placeholder="请选择人员姓名" <!-- ... 其他原有组件 ... -->
border="none" inputAlign="right"></u--input>
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down"> <view class="bottom-button">
</u-icon> <button type="primary" @click="submit">提交</button>
</u-form-item> </view>
<u-form-item v-if="item.Nav_User" label="人员编号" prop="personNo" borderBottom> </view>
<u--input disabled disabledColor="#fff" </template>
v-model="item['Nav_User'].CODE" border="none"
inputAlign="right"></u--input> <script>
</u-form-item> import {
</uni-collapse-item> mapState,
</uni-card> mapMutations
</uni-collapse> } from 'vuex'
</u--form> import {
</view> extendFilterGroup,
</view> extendGroupRule,
<view class="sub-form" :style="{display:this.isVisbleOut}"> extendInclude,
<view class="sub-form-wrap"> extendOrder,
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" errorType="border-bottom" extendRule,
ref="sForm1"> guid,
<uni-collapse :border="false" accordion> initFilter,
<uni-card style="margin-bottom: 16px;" margin="0" spacing="0" :is-shadow="false" initFilterGroup,
v-for="(item, index) in dataModel.Nav_Person"> extendIgnoreDataRule
<uni-collapse-item title-border="none" :show-arrow="false" :border="false" :open="true"> } from '../../../../utils/common'
<view slot="title" class="custom-collapse-title"> import {
<view class="down"> getRequest,
<uni-icons type="bottom"></uni-icons> getUserLists,
</view> saveTechRecord
<view class="text" v-if="item.Nav_RelatedUser">{{index + 1 + '. ' +item.Nav_RelatedUser.NAME}}</view> } from '../../../../services/apply/FOServices/FOServices.js'
<view class="action" @click.stop> import config from '../../../../config/common'
<u-icon @click="handleDelRowBefore(index)" class="icon" name="trash" color="#ff4d4f" size="21"></u-icon> // jobShow
</view> import jobShow from './jobShow.vue'
</view> import jobFireShow from './../FO/jobFireShow.vue'
<u-form-item label="人员姓名" v-if="item.Nav_RelatedUser" prop="personName" borderBottom>
<u--input disabled disabledColor="#fff" export default {
v-model="item['Nav_RelatedUser'].NAME" placeholder="请选择人员姓名" //
border="none" inputAlign="right"></u--input> components: {
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down"> jobShow,
</u-icon> jobFireShow
</u-form-item> },
</uni-collapse-item> data() {
</uni-card> return {
</uni-collapse> ID: '',
</u--form> TaskID: '',
</view> curTotal: 0,
</view> isVisble: 'none',
<u-modal :show="showDelModalIndex >= 0" @confirm="confirmDel" title="确认删除?"></u-modal> isVisbleOut: 'none',
<query-selector :show="showPopup" :total="curTotal" :lists="userLists" :defaultValue="currentOperateUser.NAME" showDelModalIndex: undefined,
@close="handleClosePopup" @search="handleSearchUser" @select="handleSelectedUser" /> isLoadOK: false,
<u-picker :show="comPickerInfo.showSheet" :columns="comPickerInfo.columns" @confirm="onConfirmPicker" tableKey: 0,
@close="closePicker" @cancel="closePicker" keyName="NAME"></u-picker> formatter: null,
<u-datetime-picker :show="dateTimePickerInfo.showCheckDate" mode="datetime" userLists: [],
v-model='dateTimePickerInfo.defaultDateTime' :formatter="formatter" @confirm="handleCheckDate" //
@close="dateTimePickerInfo.showCheckDate = false;" showJobPopup: false,
@cancel="dateTimePickerInfo.showCheckDate = false;"></u-datetime-picker> jobShowId: null,
<view class="bottom-button"> popupHeight: 500, //
<button type="primary" @click="submit">提交</button> dataModel: {
</view> CODE: '',
</view> NAME: '',
</template> JOB_LOCATION: '',
Nav_OperationStep: {
<script> NAME: ''
import { },
mapState, Nav_DisclosurePerson: {
mapMutations NAME: ''
} from 'vuex' },
import { },
extendFilterGroup, subDataModel: {
extendGroupRule, Nav_Person: {
extendInclude, Nav_User: {
extendOrder, NAME: '',
extendRule, CODE: '',
guid, },
initFilter, Nav_RelatedUser: {
initFilterGroup, NAME: '',
extendIgnoreDataRule },
} from '../../../../utils/common' }
import { },
getRequest, options: [{
getUserLists, text: '删除',
saveTechRecord style: {
} from '../../../../services/apply/FOServices/FOServices.js' backgroundColor: '#f56c6c'
import config from '../../../../config/common' }
}],
export default { comPickerInfo: {
data() { showSheet: false,
return { columns: [],
ID:'', title: '',
TaskID: '', dataIndex: undefined,
curTotal: 0, formIndex: undefined,
isVisble:'none', name: ''
isVisbleOut:'none', },
showDelModalIndex: undefined, currentOperateUser: {},
isLoadOK: false, showPopup: false,
tableKey: 0, dateTimePickerInfo: {
formatter: null, showCheckDate: false,
userLists: [], dataIndex: undefined,
dataModel: { defaultDateTime: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM'),
CODE: '', value: '',
NAME:'', name: ''
JOB_LOCATION:'', },
Nav_OperationStep:{ rules: {
NAME:'' 'JOB_LOCATION': {
}, type: 'string',
Nav_DisclosurePerson:{ required: true,
NAME:'' trigger: ['blur', 'change']
}, },
}, 'DisclosureContent': {
subDataModel: { type: 'string',
Nav_Person:{ required: true,
Nav_User: { trigger: ['blur', 'change']
NAME: '', }
CODE: '', },
}, }
Nav_RelatedUser: { },
NAME: '', onLoad(opt) {
}, this.handleGetTechGet(opt)
} //
}, this.calcPopupHeight()
options: [{ },
text: '删除', methods: {
style: { //
backgroundColor: '#f56c6c' calcPopupHeight() {
} const systemInfo = uni.getSystemInfoSync()
}], const windowHeight = systemInfo.windowHeight
comPickerInfo: { // 70%
showSheet: false, this.popupHeight = Math.floor(windowHeight * 0.7) - 60
columns: [], },
title: '', //
dataIndex: undefined, naviJob(id) {
formIndex: undefined, if (!id) {
name: '' uni.$showErrorInfo('未找到关联的工作票')
}, return
currentOperateUser: {}, }
showPopup: false, this.jobShowId = id
dateTimePickerInfo: { this.showJobPopup = true
showCheckDate: false, },
dataIndex: undefined, //
defaultDateTime: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM'), closeJobPopup() {
value: '', this.showJobPopup = false
name:'' // id
}, setTimeout(() => {
rules: { this.jobShowId = null
'JOB_LOCATION': { }, 300)
type: 'string', },
required: true, handleGetTechGet(opt) {
trigger: ['blur', 'change'] this.TaskID = opt.taskID ? opt.taskID : '';
}, this.ID = opt.ID ? opt.ID : '';
'DisclosureContent': { const orgId = uni.getStorageSync('orgId')
type: 'string', const json = initFilter(orgId, "", "")
required: true, extendRule(json, 'ID', 1, opt.ID)
trigger: ['blur', 'change'] // extendIgnoreDataRule(json)
} // TODO: id
}, getRequest(json, "/FO/FOTechDisclosureFrom/GetEdit").then(res => {
} this.dataModel = res
}, if (res.Nav_Person && res.Nav_Person.length > 0) {
onLoad(opt) { for (let i = 0; i < res.Nav_Person.length; i++) {
this.handleGetTechGet(opt) if (res.Nav_Person[i].User_ID === null) {
}, res.Nav_Person[i].Nav_User = null
methods: { }
handleGetTechGet(opt) { if (res.Nav_Person[i].RELATED_USER_ID === null) {
this.TaskID = opt.taskID ? opt.taskID : ''; res.Nav_Person[i].Nav_RelatedUser = null
this.ID = opt.ID ? opt.ID : ''; }
const orgId = uni.getStorageSync('orgId') }
const json = initFilter(orgId, "", "") }
extendRule(json, 'ID', 1, opt.ID) if (res.IS_OUTSOURCE == true && res.RELATED_ID != null) {
// extendIgnoreDataRule(json) this.isVisble = 'none'
// TODO: id this.isVisbleOut = 'block'
getRequest(json,"/FO/FOTechDisclosureFrom/GetEdit").then(res => { } else {
this.dataModel = res this.isVisble = 'block'
if (res.Nav_Person && res.Nav_Person.length > 0) { this.isVisbleOut = 'none'
for (let i = 0; i < res.Nav_Person.length; i++) { }
if (res.Nav_Person[i].User_ID === null) { this.isLoadOK = true
res.Nav_Person[i].Nav_User = null })
} },
if (res.Nav_Person[i].RELATED_USER_ID === null) { // ... ...
res.Nav_Person[i].Nav_RelatedUser = null
} // naviJob
} // naviJobToPage
} }
if(res.IS_OUTSOURCE ==true && res.RELATED_ID != null) }
{ </script>
this.isVisble='none'
this.isVisbleOut='block' <style scoped>
}else @import url("../../../../style/css/editTemplate.css");
{
this.isVisble='block' .page-wrap {
this.isVisbleOut='none' padding: 16px 16px 166px;
} }
this.isLoadOK=true
}) .card {
}, margin-bottom: 18px;
// }
showCheckDate(p) {
if(p.name ==='jobDate') .sub-form {
{ margin-bottom: 16px;
if (this.dataModel.DISCLOSURE_DATE == null) { }
this.dataModel.DISCLOSURE_DATE = uni.$u.timeFormat(new Date(),
'yyyy-mm-dd hh:MM') .demo-ruleForm>>>.u-textarea {
} padding: 9px 9px 25px 9px;
this.dateTimePickerInfo = { /* padding: 6px 9px; */
showCheckDate: true, }
dataIndex: p.dataIndex,
defaultDateTime: this.dataModel.DISCLOSURE_DATE, .bottom-button {
name:p.name position: fixed;
} bottom: 0;
} left: 0;
}, width: 100%;
// padding: 10px 16px;
handleCheckDate(e) { box-sizing: border-box;
// let v = uni.$u.timeFormat(e.value, 'yyyy-mm-dd') background: #fff;
const { z-index: 999;
name, }
dataIndex
} = this.dateTimePickerInfo .upload-title {
if(name ==='jobDate') color: #303133;
{ font-size: 15px;
// this.dataModel.jobDate = uni.$u.timeFormat(e.value, line-height: 22px;
// 'yyyy-mm-dd') padding: 8px 0;
this.dataModel.DISCLOSURE_DATE = uni.$u.timeFormat(e.value, }
'yyyy-mm-dd hh:MM')
} .page-wrap>>>.u-upload__button {
this.dateTimePickerInfo.showCheckDate = false margin-bottom: 0;
}, }
handleSearchUser(val, pageIndex) {
const orgId = uni.getStorageSync('orgId') /* 弹窗样式 */
const json = initFilter(orgId, "", "NAME", '', pageIndex) .job-popup-wrap {
extendInclude(json, "Nav_Department") width: 92vw;
extendRule(json, 'ENABLE_STATUS', 1, '0') max-width: 600px;
if (val !== 'init') { background: #ffffff;
const tempGroup = initFilterGroup(false); border-radius: 12px;
extendGroupRule(tempGroup, 'NAME', 9, val) overflow: hidden;
extendFilterGroup(json, tempGroup); display: flex;
} flex-direction: column;
json.Limit = 20 }
if (pageIndex) {
json.Start = (pageIndex - 1) * 20; .job-popup-header {
} padding: 16px 20px;
border-bottom: 1px solid #f0f0f0;
getUserLists(json).then(res => { flex-shrink: 0;
if (res.IsSuccessful) { text-align: center;
this.userLists = res.Data.map(i => { }
return {
...i, .job-popup-title {
name: i.NAME, font-size: 18px;
code: i.CODE font-weight: 600;
} color: #333333;
}) }
this.curTotal = res.TotalCount
} .job-popup-body {
}) /* padding: 0 16px 16px; */
}, }
handleSelectedUser(val) {
this.showPopup = false /* 弹窗内部滚动条样式 */
this.lists = [] .job-popup-body::-webkit-scrollbar {
const result = this.dataModel.Nav_Person.map((obj) => { width: 4px;
const { }
Nav_User
} = obj .job-popup-body::-webkit-scrollbar-thumb {
if (Nav_User.CODE === this.currentOperateUser.CODE) { background: #ddd;
return Object.assign({}, obj, { border-radius: 4px;
Nav_User: val, }
}) </style>
}
return obj
})
this.dataModel.Nav_Person = result
},
handleClosePopup() {
this.showPopup = false
},
handleChangeUser(user) {
this.currentOperateUser = user
this.showPopup = true
this.handleSearchUser('init')
},
handleAddUser() {
const identifyUser = JSON.parse(JSON.stringify(this.subDataModel.Nav_Person))
this.dataModel.Nav_Person.unshift(identifyUser)
// this.dataModel.Nav_Person.unshift(this.subDataModel)
},
handleDelRowBefore(index) {
this.showDelModalIndex = index
},
confirmDel() {
this.dataModel.Nav_Person.splice(this.showDelModalIndex, 1)
this.showDelModalIndex = undefined
},
onConfirmPicker(e) {
const {
name,
dataIndex,
formIndex
} = this.comPickerInfo
if (formIndex === "sForm1") {
const result = this.dataModel.Nav_Person.map((obj, index) => {
if (index === dataIndex) {
return Object.assign({}, obj, {
// ATTEND_STATUS: e.value[0].ID,
})
}
return obj
})
this.dataModel.Nav_Person = result
} else {
}
this.comPickerInfo.showSheet = false
},
closePicker() {
this.comPickerInfo = {
showSheet: false,
columns: [],
title: '',
name: '',
dataIndex: undefined,
formIndex: undefined
}
},
handleDelAction({
name
}) {
uni.showModal({
title: '是否删除数据?',
success: (res) => {
if (res.confirm) {
}
}
})
},
submit() {
const ele = this.$refs
this.dataModel.PUBLISH = "SaveAndNotify";
if(this.TaskID !== null)
{this.dataModel.TaskID = this.TaskID;}
this.dataModel.ID = this.ID?this.ID:guid();
this.dataModel.ORG_ID =uni.getStorageSync('orgId')
ele['wForm'].validate().then(res => {
saveTechRecord(this.dataModel).then(res => {
uni.$showMsgFunc('操作成功!', () => {
// if (this.tableKey == null || this.tableKey == 0) {
// uni.navigateTo({
// url: 'techRecord'
// })
// } else {
uni.navigateBack()
// }
}, 'success', 1000)
})
}).catch(err => {
uni.$showErrorInfo('请检查必填项,必填项不能为空')
})
},
uploadFilePromise(url) {
const appInfoData = uni.getStorageSync('appInfo')
const userId = appInfoData?.User?.ID || ''
const orgId = uni.getStorageSync('orgId')
const tenant = uni.getStorageSync('Tenant') || ''
const remoteUrl = config.serviceHost('/PF/File/UploadFile')
return new Promise((resolve, reject) => {
uni.uploadFile({
url: remoteUrl,
filePath: url,
fileList: url,
name: 'file',
formData: {
OrgId: orgId
},
header: {
Tenant: tenant,
userid: userId
},
success: (res) => {
if (res.statusCode === 200) {
const uploadResult = JSON.parse(res.data)
if (uploadResult.IsSuccessful) {
resolve(uploadResult.Data)
}
}
}
});
})
},
}
}
</script>
<style scoped>
@import url("../../../../style/css/editTemplate.css");
.page-wrap {
padding: 16px 16px 166px;
}
.card {
margin-bottom: 18px;
}
.sub-form {
margin-bottom: 16px;
}
.demo-ruleForm>>>.u-textarea {
padding: 9px 9px 25px 9px;
/* padding: 6px 9px; */
}
.bottom-button {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
padding: 10px 16px;
box-sizing: border-box;
background: #fff;
z-index: 999;
}
.upload-title {
color: #303133;
font-size: 15px;
line-height: 22px;
padding: 8px 0;
}
.page-wrap>>>.u-upload__button {
margin-bottom: 0;
}
</style>