S0025136190 3 недель назад
Родитель
Сommit
0ea11bd353
1 измененных файлов с 13 добавлено и 4 удалено
  1. 13 4
      src/views/system/auditConfig/index.vue

+ 13 - 4
src/views/system/auditConfig/index.vue

@@ -92,7 +92,7 @@
           <el-input type="number" v-model="currentForm.nodeOrder" placeholder="请输入审核顺序" :disabled="false" />
         </el-form-item>
         <el-form-item label="审核人" prop="approver">
-          <el-select v-model="currentForm.approver" placeholder="请选择审核人" filterable  >
+          <el-select v-model="currentForm.approver" multiple placeholder="请选择审核人" filterable  >
             <el-option v-for="item in userList" :key="item.userId" :label="item.userName" :value="item.userId" />
           </el-select>
           <!-- <div style="display: flex; align-items: center; gap: 10px">
@@ -226,6 +226,7 @@ export default {
       listUser(this.queryUserParams).then(response => {
         this.userList = response.rows;
         this.userTotal = response.total;
+
       });
     },
 
@@ -366,7 +367,8 @@ export default {
       // this.queryUserParams.userId = row.approver;
       this.approverOptions = [];
       this.getUserList();
-      this.currentForm.approver = row.approver;
+
+      this.currentForm.approver = row.approverList;
       this.currentForm.nodeOrder = row.nodeOrder;
       this.currentForm.id = row.id;
       // getConfig(id).then(response => {
@@ -381,14 +383,21 @@ export default {
     submitForm() {
       this.$refs["currentForm"].validate(valid => {
         if (valid) {
+          // 创建表单副本,避免直接修改原始数据
+          const submitForm = { ...this.currentForm };
+          console.log("123123");
+          // 如果 approval 是数组,转换为逗号分隔的字符串
+          if (Array.isArray(submitForm.approver)) {
+            submitForm.approver = submitForm.approver.join(',');
+          }
           if (this.currentForm.id != null) {
-            updateConfig(this.currentForm).then(response => {
+            updateConfig(submitForm).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
-            addConfig(this.currentForm).then(response => {
+            addConfig(submitForm).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();