Browse Source

禅道bug修复:2967、2956、2954、2952、2949、2948、2963

lucw 8 months ago
parent
commit
f7009aa134

+ 2 - 0
src/views/rulesManagement/releaseRules/components/ProductModal.vue

@@ -166,6 +166,8 @@
             this.$refs.table.setSelectedRows([]);
           });
         }
+        // 刷新表格
+        this.reload();
         console.log('this.selection', this.selection);
       },
       handleClose() {

+ 0 - 7
src/views/rulesManagement/releaseRules/components/historyModal.vue

@@ -99,13 +99,6 @@
               return `${row.bigVersion}${row.versionMark}${row.smallVersion}`;
             }
           },
-          {
-            prop: 'fromName',
-            label: '来源版本',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 150
-          },
           {
             prop: 'startDate',
             label: '启用日期',

+ 74 - 21
src/views/rulesManagement/releaseRules/components/permitAdd.vue

@@ -224,6 +224,7 @@
           >
             <template v-slot:action="{ row }">
               <el-link
+                v-if="type != 'detail'"
                 type="danger"
                 :underline="false"
                 icon="el-icon-delete"
@@ -272,14 +273,29 @@
         :cache-key="cacheKeyUrl"
       >
         <template v-slot:toolbar>
-          <el-button
-            type="primary"
-            icon="el-icon-plus"
-            class="ele-btn-icon"
-            @click="addRow"
-          >
-            新建
-          </el-button>
+          <div style="display: flex; align-items: center; gap: 10px">
+            <el-button
+              type="primary"
+              icon="el-icon-plus"
+              class="ele-btn-icon"
+              @click="addRow"
+            >
+              新建
+            </el-button>
+
+            <el-form-item
+              v-if="formData.executeMethodTitle"
+              label="编辑执行方式:"
+              label-width="110px"
+              style="margin-bottom: 0"
+            >
+              <el-input
+                type="text"
+                :disabled="formData.executeMethodTitle == '无执行方式'"
+                v-model="executeMethodTitleComputed"
+              />
+            </el-form-item>
+          </div>
         </template>
 
         <template v-slot:paramType="{ row }">
@@ -437,18 +453,20 @@
         </template>
 
         <template v-slot:executeMethodTitle="{ row }">
-          <el-select v-model="row.executeMethodTitle" clearable size="mini">
+          <!-- <el-select v-model="row.executeMethodTitle" clearable size="mini">
             <el-option
               v-for="item in formData.executeMethodList"
               :key="item"
               :label="item"
               :value="item"
             ></el-option>
-          </el-select>
+          </el-select> -->
+          {{ row.executeMethodTitle }}
         </template>
 
         <template v-slot:action="{ row }">
           <el-link
+            v-if="type != 'detail'"
             type="danger"
             :underline="false"
             icon="el-icon-delete"
@@ -622,7 +640,7 @@
             label: '执行方式',
             align: 'center',
             slot: 'executeMethodTitle',
-            minWidth: 180
+            minWidth: 110
           },
           {
             columnKey: 'action',
@@ -636,7 +654,7 @@
         ];
       },
       versionText() {
-        if (this.type == 'clone') {
+        if (this.type == 'change') {
           return '系统自动生成';
         }
         return (
@@ -701,6 +719,34 @@
         } else {
           return this.formData.details;
         }
+      },
+      executeMethodTitleComputed: {
+        get() {
+          return this.formData.executeMethodTitle;
+        },
+        set(value) {
+          // 更改 明细表的 executeMethodTitle
+          this.formData.details = this.formData.details.map((i) => {
+            if (i.executeMethodTitle == this.formData.executeMethodTitle) {
+              return {
+                ...i,
+                executeMethodTitle: value
+              };
+            }
+            return i;
+          });
+
+          this.formData.executeMethodList = this.formData.executeMethodList.map(
+            (i) => {
+              if (i == this.formData.executeMethodTitle) {
+                return value;
+              }
+              return i;
+            }
+          );
+
+          this.formData.executeMethodTitle = value;
+        }
       }
     },
     data() {
@@ -822,11 +868,12 @@
         this.type = type;
         console.log('type', type, row);
 
-        if (type == 'edit' || type == 'detail') {
-          this.getDetils(row.id);
-        }
-
-        if (type == 'clone') {
+        if (
+          type == 'edit' ||
+          type == 'detail' ||
+          type == 'change' ||
+          type == 'clone'
+        ) {
           this.getDetils(row.id);
         }
 
@@ -925,12 +972,18 @@
           this.formData.classify = this.formData.classify + '';
           this.formData.reportWorkType = this.formData.reportWorkType + '';
 
-          if (this.type == 'clone') {
+          if (this.type == 'change') {
             this.formData.name = this.formData.name + '-副本';
 
             this.formData.fromId = id;
             this.formData.id = null;
           }
+
+          if (this.type == 'clone') {
+            this.formData.fromId = null;
+            this.formData.id = null;
+          }
+
           this.loading = false;
         } catch (error) {
           this.loading = false;
@@ -984,7 +1037,7 @@
               const exists = this.formData.details.some(
                 (detail) => detail.executeMethodTitle === item
               );
-              if (!exists) {
+              if (!exists && item != '无执行方式') {
                 this.$message.warning(
                   `请为执行方式 "${item}" 添加至少一条规则项`
                 );
@@ -1005,9 +1058,9 @@
 
             const body = this.formatBody();
 
-            if (this.type == 'add') {
+            if (this.type == 'add' || this.type == 'clone') {
               await recordrulesSave(body);
-            } else if (this.type == 'clone') {
+            } else if (this.type == 'change') {
               await recordrulesUpdateVersion(body);
             } else {
               // 编辑

+ 52 - 22
src/views/rulesManagement/releaseRules/components/processModal.vue

@@ -19,6 +19,14 @@
         :selection.sync="selection"
         row-key="id"
       >
+        <template v-slot:radio="{ row }">
+          <el-radio
+            v-model="currentId"
+            :label="row.id"
+            @change="radioChagne(row)"
+            >{{ '' }}</el-radio
+          >
+        </template>
       </ele-pro-table>
     </el-card>
 
@@ -43,22 +51,10 @@
         default: false
       }
     },
-    data() {
-      return {
-        visible: false,
-        title: '选择工序',
-
-        // 表格列配置
-        columns: [
-          {
-            columnKey: 'selection',
-            type: 'selection',
-            width: 45,
-            align: 'center',
-            reserveSelection: true,
-            fixed: 'left'
-          },
-
+    computed: {
+      // 表格列配置
+      columns() {
+        const arr = [
           {
             prop: 'code',
             label: '工序编码',
@@ -88,10 +84,38 @@
             showOverflowTooltip: true,
             minWidth: 110
           }
-        ],
+        ];
 
+        // 如果多选,添加选择列
+        if (this.multiple) {
+          arr.unshift({
+            columnKey: 'selection',
+            type: 'selection',
+            width: 50,
+            align: 'center',
+            reserveSelection: true,
+            fixed: 'left'
+          });
+        } else {
+          arr.unshift({
+            width: 50,
+            align: 'center',
+            fixed: 'left',
+            slot: 'radio'
+          });
+        }
+
+        return arr;
+      }
+    },
+    data() {
+      return {
+        visible: false,
+        title: '选择工序',
         // 表格选中数据
-        selection: []
+        selection: [],
+        currentId: null,
+        currentObject: null
       };
     },
 
@@ -145,18 +169,24 @@
         this.visible = false;
       },
       selected() {
-        if (!this.selection.length) {
+        if (this.multiple && !this.selection.length) {
           this.$message.warning('请选择工序');
           return;
         }
-        if (!this.multiple && this.selection.length > 1) {
-          return this.$message.warning('只能选择一项');
+
+        if (!this.multiple && !this.currentObject) {
+          this.$message.warning('请选择工序');
+          return;
         }
+
         this.$emit(
           'chooseProcess',
-          this.multiple ? this.selection : this.selection[0]
+          this.multiple ? this.selection : this.currentObject
         );
         this.handleClose();
+      },
+      radioChagne(e) {
+        this.currentObject = e;
       }
     }
   };

+ 13 - 4
src/views/rulesManagement/releaseRules/index.vue

@@ -22,11 +22,20 @@
         <!-- <template v-slot:status="{ row }"> </template> -->
         <template v-slot:action="{ row }">
           <el-link
-            v-if="row.publishStatus === 1"
+            type="primary"
+            :underline="false"
+            icon="el-icon-document-copy"
+            @click="addPermit(row, 'clone', '克隆记录规则')"
+          >
+            克隆
+          </el-link>
+
+          <el-link
+            v-if="row.publishStatus === 1 && !row.isUpdatedVersion"
             type="success"
             :underline="false"
             icon="el-icon-finished"
-            @click="addPermit(row, 'clone', '变更记录规则')"
+            @click="addPermit(row, 'change', '变更记录规则')"
           >
             变更
           </el-link>
@@ -170,7 +179,7 @@
             showOverflowTooltip: true,
             minWidth: 110,
             formatter: (row) => {
-              return `${row.bigVersion}${row.versionMark}${row.smallVersion}`;
+              return `${row.versionSymbol}${row.bigVersion}${row.versionMark}${row.smallVersion}`;
             }
           },
           {
@@ -258,7 +267,7 @@
           {
             columnKey: 'action',
             label: '操作',
-            width: 230,
+            width: 260,
             align: 'center',
             resizable: false,
             slot: 'action',

+ 34 - 2
src/views/versionManage/components/addOrEditDialog.vue

@@ -61,6 +61,21 @@
           </el-form-item>
         </el-col>
       </el-row>
+      <el-row :gutter="12">
+        <el-col :span="16">
+          <el-form-item label="版本符号" prop="symbol">
+            <el-input
+              v-model="form.symbol"
+              :disabled="type == 'view'"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <span style="margin-left: 10px; line-height: 38px; color: red"
+            >默认字母V,字母A-Z</span
+          >
+        </el-col>
+      </el-row>
       <el-row :gutter="12">
         <el-col :span="16">
           <el-form-item label="大版本采用" prop="bigVersionType">
@@ -192,7 +207,8 @@
           mark: '.',
           smallVersion: '1',
           smallVersionNum: 1,
-          changeType: 1
+          changeType: 1,
+          symbol: 'V'
         }
       };
     },
@@ -200,7 +216,9 @@
       getExample() {
         let value =
           this.form.bigVersion || (this.form.bigVersionType == 1 ? 'A' : '1');
-        return value + this.form.mark + this.form.smallVersion;
+        return (
+          this.form.symbol + value + this.form.mark + this.form.smallVersion
+        );
       },
       rules() {
         return {
@@ -225,6 +243,20 @@
           smallVersion: [
             { required: true, message: '请输入', trigger: 'blur' },
             { validator: this.versionNumValidate, trigger: ['blur', 'change'] }
+          ],
+          symbol: [
+            {
+              required: false,
+              validator(rule, value, callback) {
+                if (!value) callback();
+                let regex = /[A-Z]/;
+                if (!regex.test(value)) {
+                  callback(new Error('输入格式错误'));
+                }
+                callback();
+              },
+              trigger: 'blur'
+            }
           ]
         };
       }

+ 3 - 1
src/views/versionManage/index.vue

@@ -194,7 +194,9 @@
             showOverflowTooltip: true,
             align: 'center',
             formatter: (_row, _column, cellValue) => {
-              return _row.bigVersion + _row.mark + _row.smallVersion;
+              return (
+                _row.symbol + _row.bigVersion + _row.mark + _row.smallVersion
+              );
             },
             minWidth: 120
           },

File diff suppressed because it is too large
+ 294 - 294
yarn.lock


Some files were not shown because too many files changed in this diff