فهرست منبع

配置事项功能修改

lucw 8 ماه پیش
والد
کامیت
f98ccff48c
1فایلهای تغییر یافته به همراه16 افزوده شده و 7 حذف شده
  1. 16 7
      src/views/technology/production/components/user-setting-matter-add.vue

+ 16 - 7
src/views/technology/production/components/user-setting-matter-add.vue

@@ -4,7 +4,7 @@
     :append-to-body="true"
     :close-on-click-modal="false"
     custom-class="ele-dialog-form"
-    title="添加事项"
+    :title="title"
     @update:visible="updateVisible"
     :maxable="true"
     :before-close="handleClose"
@@ -185,7 +185,9 @@
         rulesName: '',
         // 任务id
         taskId: null,
-        itemTaskName: ''
+        itemTaskName: '',
+        // 是否执行中
+        isUsing: 0
       };
 
       return {
@@ -222,7 +224,8 @@
         executeMethodOptions: [],
         // 记录规则事项类型,参考字典项:record_rules_item_type
         itemTypeOptions: [],
-        dialogLoading: false
+        dialogLoading: false,
+        title: '新增事项'
       };
     },
     methods: {
@@ -236,9 +239,11 @@
       },
       openAdd() {
         this.type = 'add';
+        this.title = '新增事项';
         this.visible = true;
       },
       openEdit(row) {
+        this.title = '编辑事项';
         console.log('row', row);
         this.type = 'edit';
         this.visible = true;
@@ -267,6 +272,12 @@
       },
       confirm() {
         console.log('this.formData', this.formData);
+
+        if (this.formData.isUsing) {
+          this.$message.warning('当前事项正在执行中,无法修改');
+          return;
+        }
+
         // 验证表单
         this.$refs.formRef.validate((valid) => {
           if (valid) {
@@ -287,11 +298,9 @@
       },
       // 关闭清空formData
       handleClose() {
-        this.visible = false;
         this.formData = JSON.parse(JSON.stringify(this.formBaseData));
-        this.$nextTick(() => {
-          this.$refs.formRef.clearValidate();
-        });
+        this.$refs.formRef?.clearValidate();
+        this.visible = false;
       },
       // 去选择记录规则
       selectReleaseId() {