From a2eeba84bed5de1c19b74279ee7f096b5eff5528 Mon Sep 17 00:00:00 2001
From: yuxc <653031404@qq.com>
Date: 星期三, 13 九月 2023 11:50:00 +0800
Subject: [PATCH] 1、加载分类的时候提示没有编码规则错误,同时处理由此导致的RMDataTransmitObject未初始化保存问题,在创建bean时就进行了初始化。
---
Source/UBCS-WEB/src/components/template/SetPersonnel.vue | 146 ++++++++++++++++++++----------------------------
1 files changed, 61 insertions(+), 85 deletions(-)
diff --git a/Source/UBCS-WEB/src/components/template/SetPersonnel.vue b/Source/UBCS-WEB/src/components/template/SetPersonnel.vue
index 531ae26..64ec3ec 100644
--- a/Source/UBCS-WEB/src/components/template/SetPersonnel.vue
+++ b/Source/UBCS-WEB/src/components/template/SetPersonnel.vue
@@ -1,5 +1,5 @@
<template>
- <el-dialog :title="title" :visible.sync="dialogVisible" append-to-body="true" width="30%">
+ <el-dialog :title="title" :visible.sync="dialogVisible" append-to-body="true" class="avue-dialog avue-dialog--top" top="-3%" width="30%">
<el-tag v-for="tag in tags" :key="tag" closable disable-transitions effect="Plain" size="medium"
@click="handleClickTag(tag)" @close="handleCloseTag(tag)">
<span> {{ tag.name }}</span>
@@ -24,7 +24,7 @@
</div>
<el-form :model="collectParam" class="demo-form-inline" label-position="left" label-width="auto">
<el-form-item :label="item.taskName" v-for="(item, index) in initFrom" :key="index">
- <el-select style="width: 80%;" filterable v-model="collectParam.flowTaskUsers[index]['userId']"
+ <el-select style="width: 100%;" filterable v-model="collectParam.flowTaskUsers[index]['userId']"
:placeholder="item.taskName" @change="handleSelect($event, index)">
<el-option :label="key.userNames" :value="key.userId" v-for="(key, keyi) in typeName"
:key="keyi"></el-option>
@@ -39,62 +39,65 @@
</template>
<script>
import { personnelInit, personnelCollect, cancelCollect, personnelSave, personnelDict } from '@/api/template/setPersonnel.js'
+import { dateFormat } from "@/util/date";
export default {
name: 'SetPersonnel',
props: {
- // 鏄惁鎵撳紑
- visible: {
- typeof: Boolean,
- default: false
- },
- // 鏍囬
- title: {
- typeof: String,
- default: '娴佺▼瀹℃壒'
- },
- // 鍙傛暟锛氶�夋嫨鐨刬d锛屽涓互鏁扮粍鏂瑰紡浼犻�掞細['id','id']锛屾ā鏉縤d锛屾ā鏉跨敤閫旓紝娴佺▼鍚嶅瓧锛屾祦绋嬫ā鏉�,
- // flowTemplate锛�
- // vars锛歰bject鏍煎紡锛屽悕瀛椾负vars锛岄噷闈ey閿�硷紝鑷繁闅忔剰
- parameter: {
- typeof: Object,
- default: () => { }
- },
- parameterKeys: {
- typeof: Object,
- default: () => {
- return {
- ids: 'ids',
- flowTemplate: 'flowTemplate',
- code: 'code',
- type: 'type'
- }
- }
+ // 鏄惁鎵撳紑
+ visible: {
+ typeof: Boolean,
+ default: false
+ },
+ // 鏍囬
+ title: {
+ typeof: String,
+ default: '娴佺▼瀹℃壒'
+ },
+ // 鍙傛暟锛氶�夋嫨鐨刬d锛屽涓互鏁扮粍鏂瑰紡浼犻�掞細['id','id']锛屾ā鏉縤d锛屾ā鏉跨敤閫旓紝娴佺▼鍚嶅瓧锛屾祦绋嬫ā鏉�,
+ // flowTemplate锛�
+ // vars锛歰bject鏍煎紡锛屽悕瀛椾负vars锛岄噷闈ey閿�硷紝鑷繁闅忔剰
+ parameter: {
+ typeof: Object,
+ default: () => {
}
-
+ },
+ parameterKeys: {
+ typeof: Object,
+ default: () => {
+ return {
+ ids: 'ids',
+ processName: 'processName',
+ code: 'code',
+ type: 'type',
+ btmtype: 'btmtype'
+ }
+ }
+ }
},
watch: {
- visible(n) {
- this.dialogVisible = n;
- if (n) {
- this.apiInit()
- this.apiDict()
- }
+ visible(n) {
+ this.dialogVisible = n;
+ if (n) {
+ this.apiInit()
+ this.apiDict()
+ }
+ },
+ dialogVisible(n) {
+ this.$emit('update:visible', n)
+ },
+ users: {
+ handler(val) {
+ this.collectParam.flowTaskUsers = val
},
- dialogVisible(n) {
- this.$emit('update:visible', n)
+ deep: true,
+ immediate: true
+ },
+ parameter: {
+ handler(newval, oldval) {
+ this.saveParam = Object.assign({processName:'',processDesc: ''},newval) ;
},
- users:{
- handler(val){
- this.collectParam.flowTaskUsers = val
- },
- deep:true,
- immediate:true
- },
- parameter:{
- handler(newval,oldval){
- this.saveParam=newval
- },deep:true,
- immediate:true
+ deep: true,
+ immediate: true
}
},
data() {
@@ -109,8 +112,8 @@
users: [],
rules: {
processName: [
- { required: true, message: '妯℃澘鍚嶇О涓嶈兘涓虹┖', trigger: 'blur' },
- { min: 1, max: 20, message: '闀垮害鍦� 3 鍒� 20 涓瓧绗�', trigger: 'blur' }
+ { required: true, message: '娴佺▼鍚嶇О涓嶈兘涓虹┖', trigger: 'blur' },
+ { min: 3, max: 50, message: '闀垮害鍦� 3 鍒� 50 涓瓧绗�', trigger: 'blur' }
]
}
}
@@ -121,14 +124,6 @@
created() {
},
methods: {
- setSaveParam() {
- return {
- processName: this.parameter[this.parameterKeys.flowTemplate],
- topName: this.title,
- ids: this.parameter[this.parameterKeys.ids],
- vars:this.parameter['vars']
- }
- },
userIndex(arr1) {
return this.initFrom.findIndex(i => i.taskId === arr1)
},
@@ -141,18 +136,13 @@
let flowTaskUsers = response.data.data.user
this.collectParam = { modelKey, templateId, flowTaskUsers: flowTaskUsers }
this.users = response.data.data.user
- console.log(this.collectParam)
- console.log('this.saveParam.before',this.saveParam)
this.saveParam = { ...this.saveParam, modelKey, templateId, modelName }
- console.log('this.saveParam',this.saveParam)
if (this.tags.length !== 0) this.handleClickTag(this.tags[0])
}
},
async apiDict() {
const response = await personnelDict()
- console.log(response)
if (response.status === 200) {
- console.log(response)
const data = response.data.data
this.typeName = data.map(item => {
const { account, deptName, id, realName } = item
@@ -167,12 +157,9 @@
confirmButtonText: '纭畾',
cancelButtonText: '鍙栨秷',
}).then(async ({ value }) => {
- console.log(this.users)
this.collectParam.flowTaskUsers = this.users
this.collectParam = { ...this.collectParam, name: value }
- console.log(this.collectParam)
const response = await personnelCollect(this.collectParam)
- console.log(response)
if (response.status === 200) {
this.$nextTick(() => {
this.apiInit()
@@ -185,7 +172,6 @@
async canCollect(name) {
const response = await cancelCollect({ name: name })
if (response.status === 200) {
- console.log(response)
this.apiInit()
this.isCollent = true
this.$message({
@@ -197,22 +183,18 @@
async apiSave() {
try {
const len = this.collectParam.flowTaskUsers.length
- console.log(this.collectParam.flowTaskUsers)
- console.log(len == 0)
- console.log(len != this.initFrom.length)
- console.log('saveParam',this.saveParam)
if (len == 0 && len != this.initFrom.length) {
this.$message({
type: "error",
message: "璇烽�夋嫨鑺傜偣锛�"
});
} else {
- const {modelKey,modelName,processDesc,processName,templateId,topName,vars,ids} = this.saveParam
- const vals= {modelKey,modelName,processDesc,processName,templateId,topName,ids,...vars}
- console.log('vals',vals);
+ const {modelKey,modelName,processDesc,processName,templateId,topName,vars,ids,btmtype} = this.saveParam
+ let vals= {modelKey,modelName,processDesc,processName,templateId,topName,ids,btmtype,...vars}
+ vals.oids=ids;
+ vals.createTime=dateFormat(new Date(), "yyyy-MM-dd hh:mm:ss")
const response = await personnelSave({ variables:vals, flowTaskUsers: this.collectParam.flowTaskUsers, })
if (response.status === 200) {
- console.log(response)
this.$message({
type: 'success',
message: response.data.msg
@@ -223,13 +205,10 @@
}
} catch {
- console.error('鎺ュ彛璋冪敤澶辫触')
+ this.$message.error('鎺ュ彛璋冪敤澶辫触')
}
},
handleClickTag(event) {
- console.log(event.flowTaskUsers)
-
- console.log(this.collectParam.flowTaskUsers)
let flowTaskUsers = this.collectParam.flowTaskUsers
this.collectParam.flowTaskUsers = flowTaskUsers.map((item, index) => {
for (let i = 0; i < event.flowTaskUsers.length; i++) {
@@ -256,16 +235,13 @@
// this.collectParam.flowTaskUsers = {...this.collectParam.flowTaskUsers,userId,userName}
},
handleCloseTag(event) {
- console.log(event)
this.canCollect(event.name)
},
handleSelect(event, index) {
const res = this.typeName.find(item => item.userId === event)
const { userName } = res
- console.log(this.users)
this.$set(this.users, index, { ... this.collectParam.flowTaskUsers[index], userName })
// this.users[index] = { ... this.collectParam.flowTaskUsers[index], userName }
- console.log(this.users)
},
done() {
this.dialogVisible = false
@@ -274,7 +250,6 @@
this.done()
},
handleConfirm() {
- console.log(this.saveParam)
this.apiSave()
}
}
@@ -305,4 +280,5 @@
justify-content: end;
padding-bottom: 10px;
}
+
</style>
--
Gitblit v1.9.3