lion 3 weeks ago
parent 96e853a1e2
commit 3945676628

@ -251,6 +251,56 @@
></rollback>
<el-backtop></el-backtop>
<!-- 更改时间 -->
<el-dialog
title="请选择时间"
:visible.sync="isShowTime"
:close-on-click-modal="false"
width="30%"
>
<!-- 日期时间选择器 -->
<el-date-picker
v-model="selectedDateTime"
type="datetime"
placeholder="选择日期时间"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
:clearable="false"
style="width: 100%"
></el-date-picker>
<div slot="footer" class="dialog-footer">
<el-button @click="isShowTime = false,timeId='',selectedDateTime='',selectedDateType=''">取消</el-button>
<el-button type="primary" @click="updateTime"></el-button>
</div>
</el-dialog>
<!-- 更改承办人员 -->
<el-dialog
title="请选择承办人员"
:visible.sync="isShowUserDialog"
:close-on-click-modal="false"
width="30%"
>
<!-- 用户选择下拉框 -->
<el-select
v-model="selectedUserId"
placeholder="请选择承办人员"
filterable
style="width: 100%"
>
<el-option
v-for="user in userList"
:key="user.id"
:label="user.name"
:value="user.id"
></el-option>
</el-select>
<div slot="footer" class="dialog-footer">
<el-button @click="isShowUserDialog = false,currentRowId='',selectedUserId=''">取消</el-button>
<el-button type="primary" @click="updateUser"></el-button>
</div>
</el-dialog>
<!-- 打开支出 详情 -->
<vxe-modal
v-model="isShowModal"
@ -282,6 +332,7 @@ import assign from "./components/assign.vue";
import forward from "./components/forward.vue";
import rollback from "./components/rollback.vue";
import { generateRandomString } from '@/utils'
import { userListNoAuth} from "@/api/common";
import {
create,
deal,
@ -313,6 +364,14 @@ export default {
isShowRollback: false,
isShowForward: false,
isShowAssign: false,
timeId: '',
isShowTime: false,
selectedDateTime: '',
selectedDateType: '',
isShowUserDialog: false,
selectedUserId: '',
userList: [],
currentRowId: '',
info: [],
config: {},
writeableFields: [],
@ -889,23 +948,61 @@ 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 }) => {
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: row.id,
date: value,
date_type: column.field
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: {

@ -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(){

Loading…
Cancel
Save