From ee92cb0a9c300090df99df9ba3c28d23880227d7 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Thu, 18 Sep 2025 14:39:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E6=9B=B4=E6=94=B9=E6=97=A5?= =?UTF-8?q?=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/flow/components/payMx.vue | 26 ++++++--- src/views/flow/create.vue | 78 ++++++++++++++++++++------ src/views/flow/detailCommon.vue | 76 +++++++++++++++++++++----- src/views/flow/edit.vue | 76 +++++++++++++++++++++----- src/views/flow/list.vue | 85 +++++++++++++++++++++++------ 5 files changed, 269 insertions(+), 72 deletions(-) diff --git a/src/views/flow/components/payMx.vue b/src/views/flow/components/payMx.vue index 04c168c..1e36b6e 100644 --- a/src/views/flow/components/payMx.vue +++ b/src/views/flow/components/payMx.vue @@ -282,14 +282,22 @@ import {getToken} from "@/utils/auth"; }) console.log('this.list', this.list) - // 组装逗号分隔的 flow_id / id 字符串用于 getItemNum - const ids = (this.payList || []) - .map(i => i && (i.id)) - .filter(id => !!id) - .join(',') + // 组装逗号分隔的明细 id 字符串用于 getItemNum(从 payList 的 data.caigoumingxi 中提取) + const ids = [] + ;(this.payList || []).forEach(pay => { + try { + const subList = JSON.parse(pay?.data?.caigoumingxi || '[]') + subList.forEach(item => { + if (item && item.id) ids.push(item.id) + }) + } catch(e) { + // 忽略解析错误 + } + }) + const idsStr = ids.join(',') - if (ids) { - await this.getItemNum(ids) + if (idsStr) { + await this.getItemNum(idsStr) } // 获取字段配置:取第一条的 sub_custom_model_id @@ -371,13 +379,13 @@ import {getToken} from "@/utils/auth"; async getItemNum(id) { try { const item = await getItems({ - flow_id: id + wuzicaigou_item_id: id }) console.log("item", item) if (item.length > 0) { const itemMap = new Map(); item.forEach(item => { - itemMap.set(item.wuzicaigou_item_id, item.total_num); + itemMap.set(item.wuzicaigou_item_id, parseFloat(item.total_num)); }); // 遍历合并后的 list,根据 id 从 Map 中获取 total_num 并赋值给 hasPayNum this.list.forEach(row => { diff --git a/src/views/flow/create.vue b/src/views/flow/create.vue index 50fbf2e..8f57d25 100644 --- a/src/views/flow/create.vue +++ b/src/views/flow/create.vue @@ -271,6 +271,29 @@ frameborder="0" /> + + + + + + + @@ -307,6 +330,10 @@ export default { }, data() { return { + timeId:'', + isShowTime:false, + selectedDateTime:'', + selectedDateType:'', isShowModal:false, contractUrl:'', printKey: 0, @@ -828,7 +855,7 @@ export default { } }) } - + } console.log("copyForm",copyForm,this.fields) console.log("this.writeableFields",this.writeableFields) @@ -889,24 +916,43 @@ export default { async cellDblclickEvent({ row, column }) { // if(this.$store.state.user.username !== 'admin') return + if(!this.$store.state.user.roles.includes("全局流程监管")) return if(column.field === 'created_at' || column.field === 'updated_at') { - this.$prompt('请输入时间', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - inputPattern: /^(?:19|20)[0-9][0-9]-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:[0-2][1-9])|(?:[1-3][0-1])) (?:(?:[0-2][0-3])|(?:[0-1][0-9])):[0-5][0-9]:[0-5][0-9]$/, - inputErrorMessage: '时间格式不正确' - }).then(({ value }) => { - updateNodeTime({ - id: row.id, - date: value, - date_type: column.field - }).then(_ => { - this.$message.success('更新成功') - this.getConfig() - }) - }) + this.timeId = row.id + this.selectedDateType = column.field + this.selectedDateTime = row[column.field] + this.isShowTime = true + // this.$prompt('请输入时间', '提示', { + // confirmButtonText: '确定', + // cancelButtonText: '取消', + // inputPattern: /^(?:19|20)[0-9][0-9]-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:[0-2][1-9])|(?:[1-3][0-1])) (?:(?:[0-2][0-3])|(?:[0-1][0-9])):[0-5][0-9]:[0-5][0-9]$/, + // inputErrorMessage: '时间格式不正确' + // }).then(({ value }) => { + // updateNodeTime({ + // id: row.id, + // date: value, + // date_type: column.field + // }).then(_ => { + // this.$message.success('更新成功') + // this.getConfig() + // }) + // }) } }, + updateTime(){ + updateNodeTime({ + id: this.timeId, + date: this.selectedDateTime, + date_type:this.selectedDateType, + }).then((_) => { + this.$message.success("更新成功"); + this.timeId = '' + this.selectedDateTime = '' + this.selectedDateType = '' + this.isShowTime = false + this.getConfig() + }); + }, }, computed: { device() { diff --git a/src/views/flow/detailCommon.vue b/src/views/flow/detailCommon.vue index b8272c6..960a888 100644 --- a/src/views/flow/detailCommon.vue +++ b/src/views/flow/detailCommon.vue @@ -213,6 +213,29 @@ > + + + + + + + @@ -248,6 +271,10 @@ export default { }, data() { return { + timeId:'', + isShowTime:false, + selectedDateTime:'', + selectedDateType:'', printKey: 0, isShowRollback: false, isShowForward: false, @@ -805,24 +832,43 @@ export default { async cellDblclickEvent({ row, column }) { // if(this.$store.state.user.username !== 'admin') return + if(!this.$store.state.user.roles.includes("全局流程监管")) return if(column.field === 'created_at' || column.field === 'updated_at') { - this.$prompt('请输入时间', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - inputPattern: /^(?:19|20)[0-9][0-9]-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:[0-2][1-9])|(?:[1-3][0-1])) (?:(?:[0-2][0-3])|(?:[0-1][0-9])):[0-5][0-9]:[0-5][0-9]$/, - inputErrorMessage: '时间格式不正确' - }).then(({ value }) => { - updateNodeTime({ - id: row.id, - date: value, - date_type: column.field - }).then(_ => { - this.$message.success('更新成功') - this.getConfig() - }) - }) + this.timeId = row.id + this.selectedDateType = column.field + this.selectedDateTime = row[column.field] + this.isShowTime = true + // this.$prompt('请输入时间', '提示', { + // confirmButtonText: '确定', + // cancelButtonText: '取消', + // inputPattern: /^(?:19|20)[0-9][0-9]-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:[0-2][1-9])|(?:[1-3][0-1])) (?:(?:[0-2][0-3])|(?:[0-1][0-9])):[0-5][0-9]:[0-5][0-9]$/, + // inputErrorMessage: '时间格式不正确' + // }).then(({ value }) => { + // updateNodeTime({ + // id: row.id, + // date: value, + // date_type: column.field + // }).then(_ => { + // this.$message.success('更新成功') + // this.getConfig() + // }) + // }) } }, + updateTime(){ + updateNodeTime({ + id: this.timeId, + date: this.selectedDateTime, + date_type:this.selectedDateType, + }).then((_) => { + this.$message.success("更新成功"); + this.timeId = '' + this.selectedDateTime = '' + this.selectedDateType = '' + this.isShowTime = false + this.getConfig() + }); + }, }, computed: { device() { diff --git a/src/views/flow/edit.vue b/src/views/flow/edit.vue index 3d14ca2..14d0347 100644 --- a/src/views/flow/edit.vue +++ b/src/views/flow/edit.vue @@ -196,6 +196,29 @@ + + + + + + + @@ -223,6 +246,10 @@ export default { }, data() { return { + timeId:'', + isShowTime:false, + selectedDateTime:'', + selectedDateType:'', printKey: 0, isShowRollback: false, isShowForward: false, @@ -627,24 +654,43 @@ export default { async cellDblclickEvent({ row, column }) { // if(this.$store.state.user.username !== 'admin') return + if(!this.$store.state.user.roles.includes("全局流程监管")) return if(column.field === 'created_at' || column.field === 'updated_at') { - this.$prompt('请输入时间', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - inputPattern: /^(?:19|20)[0-9][0-9]-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:[0-2][1-9])|(?:[1-3][0-1])) (?:(?:[0-2][0-3])|(?:[0-1][0-9])):[0-5][0-9]:[0-5][0-9]$/, - inputErrorMessage: '时间格式不正确' - }).then(({ value }) => { - updateNodeTime({ - id: row.id, - date: value, - date_type: column.field - }).then(_ => { - this.$message.success('更新成功') - this.getConfig() - }) - }) + this.timeId = row.id + this.selectedDateType = column.field + this.selectedDateTime = row[column.field] + this.isShowTime = true + // this.$prompt('请输入时间', '提示', { + // confirmButtonText: '确定', + // cancelButtonText: '取消', + // inputPattern: /^(?:19|20)[0-9][0-9]-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:[0-2][1-9])|(?:[1-3][0-1])) (?:(?:[0-2][0-3])|(?:[0-1][0-9])):[0-5][0-9]:[0-5][0-9]$/, + // inputErrorMessage: '时间格式不正确' + // }).then(({ value }) => { + // updateNodeTime({ + // id: row.id, + // date: value, + // date_type: column.field + // }).then(_ => { + // this.$message.success('更新成功') + // this.getConfig() + // }) + // }) } }, + updateTime(){ + updateNodeTime({ + id: this.timeId, + date: this.selectedDateTime, + date_type:this.selectedDateType, + }).then((_) => { + this.$message.success("更新成功"); + this.timeId = '' + this.selectedDateTime = '' + this.selectedDateType = '' + this.isShowTime = false + this.getConfig() + }); + }, }, computed: { device() { diff --git a/src/views/flow/list.vue b/src/views/flow/list.vue index 0843a42..49e7554 100644 --- a/src/views/flow/list.vue +++ b/src/views/flow/list.vue @@ -620,6 +620,8 @@ " :total="total" > + + @@ -641,6 +643,29 @@ :is-show.sync="isShowFieldExport" :select="select" /> + + + + + + + @@ -675,6 +700,10 @@ export default { data() { return { isShowFieldExport: false, + timeId:'', + isShowTime:false, + selectedDateTime:'', + selectedDateType:'', can_pay:'', beforeList:[], todoTotal: [], @@ -851,7 +880,7 @@ export default { // 选择明细 async toOutPay(row) { // this.$refs.payMx.payId = row.id; - this.$refs.payMx.payList = row; + this.$refs.payMx.payList = [row]; this.isShowPay = true; }, // 批量支付 @@ -1025,25 +1054,47 @@ export default { }, async cellDblclickEvent({ row, column }) { - if (this.$store.state.user.username !== "admin") return; + // if (this.$store.state.user.username !== "admin") return; + if(!this.$store.state.user.roles.includes("全局流程监管")) return + if (column.field === "created_at" || column.field === "updated_at") { - this.$prompt("请输入时间", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - inputPattern: - /^(?:19|20)[0-9][0-9]-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:[0-2][1-9])|(?:[1-3][0-1])) (?:(?:[0-2][0-3])|(?:[0-1][0-9])):[0-5][0-9]:[0-5][0-9]$/, - inputErrorMessage: "时间格式不正确", - }).then(({ value }) => { - updateFlowTime({ - id: row.id, - date: value, - }).then((_) => { - this.$message.success("更新成功"); - this.getList(); - }); - }); + this.timeId = row.id + this.selectedDateType = column.field + this.selectedDateTime = row[column.field] + this.isShowTime = true + // this.$prompt("请输入时间", "提示", { + // confirmButtonText: "确定", + // cancelButtonText: "取消", + // inputType:'datetime', + // inputPattern: + // /^(?:19|20)[0-9][0-9]-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:[0-2][1-9])|(?:[1-3][0-1])) (?:(?:[0-2][0-3])|(?:[0-1][0-9])):[0-5][0-9]:[0-5][0-9]$/, + // inputErrorMessage: "时间格式不正确", + // }).then(({ value }) => { + // updateFlowTime({ + // id: row.id, + // date: value, + // }).then((_) => { + // this.$message.success("更新成功"); + // this.getList(); + // }); + // }); + } }, + updateTime(){ + updateFlowTime({ + id: this.timeId, + date: this.selectedDateTime, + date_type:this.selectedDateType, + }).then((_) => { + this.$message.success("更新成功"); + this.timeId = '' + this.selectedDateTime = '' + this.selectedDateType = '' + this.isShowTime = false + this.getList(); + }); + }, checkboxChange() { const reserveRecords =