From 39456766280323ab245c5e6087b5847b29c5534b Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Mon, 17 Nov 2025 14:27:51 +0800 Subject: [PATCH] up --- src/views/flow/create.vue | 125 +++++++++++++++++++++++++++++++++----- src/views/flow/list.vue | 35 +++++------ 2 files changed, 129 insertions(+), 31 deletions(-) diff --git a/src/views/flow/create.vue b/src/views/flow/create.vue index 16c2af2..faaf0a2 100644 --- a/src/views/flow/create.vue +++ b/src/views/flow/create.vue @@ -251,6 +251,56 @@ > + + + + + + + + + + + + + + + + { - 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 + } + if(column.field === "user.name"){ + this.currentRowId = row.id + this.selectedUserId = row.user ? row.user.id : '' + this.isShowUserDialog = true + this.getUserList() + } + }, + 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() + }) + }, + async getUserList() { + try { + const userRes = await userListNoAuth({ + page: 1, + rows: 9999, }) + this.userList = userRes.data || [] + } catch (err) { + console.error(err) + this.$message.error('获取用户列表失败') } }, + updateUser() { + if (!this.selectedUserId) { + this.$message.warning('请选择承办人员') + return + } + updateNodeTime({ + id: this.currentRowId, + user_id: this.selectedUserId + }).then(_ => { + this.$message.success('更新成功') + this.currentRowId = '' + this.selectedUserId = '' + this.isShowUserDialog = false + this.getConfig() + }) + }, }, computed: { device() { diff --git a/src/views/flow/list.vue b/src/views/flow/list.vue index 01aec96..845fc32 100644 --- a/src/views/flow/list.vue +++ b/src/views/flow/list.vue @@ -678,6 +678,7 @@ import { updateFlowTime, todoTotal, fieldConfig, + save as saveFlow, } from "@/api/flow"; import moment from "moment/moment"; import ListPopover from "./components/ListPopover.vue"; @@ -1058,6 +1059,7 @@ export default { async cellDblclickEvent({ row, column }) { // if (this.$store.state.user.username !== "admin") return; + console.log(row,column.field) if(!this.$store.state.user.roles.includes("全局流程监管")) return if (column.field === "created_at" || column.field === "updated_at") { @@ -1065,23 +1067,22 @@ export default { 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(); - // }); - // }); - + } + if (column.field === 'no') { + this.$prompt("请输入编号", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + inputType: "text", + inputPattern: /^[^\s]+$/, + inputErrorMessage: "编号不能为空", + }).then(({ value }) => { + saveFlow(row.id,{ + no: value, + }).then((_) => { + this.$message.success("更新成功"); + this.getList(); + }); + }); } }, updateTime(){