From 32722b0a47690cf5200b4af84259e7e4cea592eb Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Mon, 10 Nov 2025 05:53:27 +0800 Subject: [PATCH] =?UTF-8?q?v1.9=20=E4=BC=98=E5=8C=96=E5=8A=9E=E5=85=AC?= =?UTF-8?q?=E5=92=8C=E5=90=88=E5=90=8C=E6=B5=8B=E8=AF=95=20=E9=83=A8?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/workflowManageApi.js | 2 +- .../contract/ContractChangeMainBody.vue | 2 +- src/i18n/contractI18n.js | 3 + src/views/contract/contractDetail.vue | 2 +- .../contract/contractDetailChangeLang.js | 12 + .../contract/expirationContractManageList.vue | 2 +- src/views/oa/editExamineStaffList.vue | 3 +- src/views/oa/printOwnerVotingList.vue | 236 +++++++++++------- src/views/oa/visitManageList.vue | 3 +- src/views/system/operateDataLogLang.js | 30 +-- src/views/system/workflowManageList.vue | 1 + .../system/workflowSettingManageList.vue | 117 +++++++-- 12 files changed, 267 insertions(+), 146 deletions(-) diff --git a/src/api/system/workflowManageApi.js b/src/api/system/workflowManageApi.js index 314d6bc06..9cc7e2322 100644 --- a/src/api/system/workflowManageApi.js +++ b/src/api/system/workflowManageApi.js @@ -35,7 +35,7 @@ export function listWorkflowImage(params) { } }).then(response => { const res = response.data - if (res.code !== '0') { + if (res.code != 0) { reject(new Error(res.msg)) return } diff --git a/src/components/contract/ContractChangeMainBody.vue b/src/components/contract/ContractChangeMainBody.vue index 0dc12cd81..69f40143d 100644 --- a/src/components/contract/ContractChangeMainBody.vue +++ b/src/components/contract/ContractChangeMainBody.vue @@ -1,6 +1,6 @@  @@ -125,7 +141,8 @@ export default { describle: '', startNodeFinish: 'Y', steps: [] - } + }, + currentSelectTarget: null } }, created() { @@ -133,6 +150,10 @@ export default { this._initWorkflowSettingInfo() }, methods: { + generateId() { + return `id-${Date.now()}-${Math.random().toString(36).substr(2, 6)}` + }, + async _initWorkflowSettingInfo() { const flowId = this.$route.query.flowId @@ -159,8 +180,39 @@ export default { }, _freshResStep(data) { - // 处理步骤数据的逻辑 - console.log(data) + if (!data) { + this.workflowSettingInfo.steps = [] + return + } + + this.workflowSettingInfo.describle = data.describle || '' + if (data.startNodeFinish) { + this.workflowSettingInfo.startNodeFinish = data.startNodeFinish + } + + const workflowSteps = Array.isArray(data.workflowSteps) ? data.workflowSteps : [] + const steps = workflowSteps.map((step, index) => { + const staffList = Array.isArray(step.workflowStepStaffs) ? step.workflowStepStaffs : [] + const mainStaff = staffList[0] || {} + + const subStaff = staffList.slice(1).map(staff => ({ + id: staff.id || this.generateId(), + staffId: staff.staffId || staff.userId || '', + staffName: staff.staffName || staff.userName || staff.name || '', + staffRole: staff.staffRole || '' + })) + + return { + seq: index, + staffId: mainStaff.staffId || mainStaff.userId || '', + staffName: mainStaff.staffName || mainStaff.userName || mainStaff.name || '', + staffRole: mainStaff.staffRole || '', + type: String(step.type || '2'), + subStaff + } + }) + + this.workflowSettingInfo.steps = steps }, addWorkflowStep() { @@ -176,11 +228,19 @@ export default { chooseStaff(item) { item.from = this._getStaffFromType() - this.$refs.selectStaff.open(item) + this.currentSelectTarget = item + this.$refs.selectStaff.open() }, _getStaffFromType() { - // 根据flowType返回对应的from值 + const type = this.workflowSettingInfo.flowType + if (['30003', '40004', '70007', '80008'].includes(type)) { + return 'purchase' + } + if (['50005', '60006'].includes(type)) { + return 'contract' + } + return '' }, _goBack() { @@ -195,7 +255,7 @@ export default { addStaff(step) { step.subStaff.push({ - id: this.$uuid(), + id: this.generateId(), staffId: '', staffName: '', staffRole: '1001' @@ -212,8 +272,17 @@ export default { } }, - handleStaffSelected(staffs) { - console.log(staffs) + handleStaffSelected(staff) { + if (!this.currentSelectTarget) { + return + } + const target = this.currentSelectTarget + this.$set(target, 'staffId', staff.staffId || staff.userId || '') + this.$set(target, 'staffName', staff.staffName || staff.userName || staff.name || '') + if (staff.staffRole) { + this.$set(target, 'staffRole', staff.staffRole) + } + this.currentSelectTarget = null }, async saveWorkflowSettingInfo() { @@ -250,6 +319,22 @@ export default { >* { margin-right: 15px; } + + .radio-group { + display: inline-flex; + align-items: center; + margin-right: 15px; + + .radio-item { + display: inline-flex; + align-items: center; + margin-right: 12px; + + input { + margin-right: 4px; + } + } + } } .sub-staff-item {