lucw преди 8 месеца
родител
ревизия
e93e7d2e36

+ 1 - 1
src/components/Dict/DictSelection.vue

@@ -3,10 +3,10 @@
     v-model="selectVal"
     :disabled="isProhibit"
     style="width: 100%"
-    v-bind="$attrs"
     v-on="$listeners"
     filterable
     clearable
+    v-bind="$attrs"
   >
     <el-option
       v-for="item in dictList"

+ 56 - 64
src/views/rulesManagement/releaseRules/components/permitAdd.vue

@@ -104,6 +104,18 @@
           </el-form-item>
         </el-col>
       </el-row>
+      <el-row style="margin-bottom: 10px">
+        <el-col :span="8">
+          <el-form-item label="模块分类" required prop="reportWorkType">
+            <dict-selection
+              v-model="formData.reportWorkType"
+              dictName="记录规则报工类型"
+              placeholder="请选择模块"
+              :clearable="false"
+            ></dict-selection>
+          </el-form-item>
+        </el-col>
+      </el-row>
       <el-row style="margin-bottom: 10px">
         <el-col :span="24">
           <el-form-item label="周期" prop="frequencyValue" required>
@@ -452,40 +464,45 @@
       }
     },
     data() {
+      const formDateBase = {
+        id: null,
+        classify: null,
+        deviceId: null,
+        deviceName: '',
+        frequencyUnit: 2,
+        frequencyValue: null,
+        name: '',
+        recordRulesDetailList: [
+          {
+            id: 0,
+            defaultValue: '',
+            maxValue: null,
+            minValue: null,
+            paramType: null,
+            paramValue: null,
+            remark: '',
+            symbol: null,
+            tools: [],
+            unitName: null,
+            productName: '',
+            productCode: ''
+          }
+        ],
+        recordRulesCycleList: [],
+        startDate: null,
+        stopDate: null,
+        version: 1,
+        code: '',
+        fromId: null,
+        // 模块分类 参考字典项:record_rules_report_work_type
+        reportWorkType: '1'
+      };
+
       return {
         dialogTitle: '',
         visible: false,
-        formData: {
-          id: null,
-          classify: null,
-          deviceId: null,
-          deviceName: '',
-          frequencyUnit: 2,
-          frequencyValue: null,
-          name: '',
-          recordRulesDetailList: [
-            {
-              id: 0,
-              defaultValue: '',
-              maxValue: null,
-              minValue: null,
-              paramType: null,
-              paramValue: null,
-              remark: '',
-              symbol: null,
-              tools: [],
-              unitName: null,
-              productName: '',
-              productCode: ''
-            }
-          ],
-          recordRulesCycleList: [],
-          startDate: null,
-          stopDate: null,
-          version: 1,
-          code: '',
-          fromId: null
-        },
+        formDateBase,
+        formData: JSON.parse(JSON.stringify(formDateBase)),
         formRules: {
           name: [
             { required: true, message: '请输入规则名称', trigger: 'blur' }
@@ -513,6 +530,10 @@
           ],
           deviceName: [
             { required: true, message: '请输入选择设备', trigger: 'blur' }
+          ],
+          reportWorkType: [
+            { required: true, message: '请选择模块分类', trigger: 'change' },
+            { required: true, message: '请选择模块分类', trigger: 'blur' }
           ]
         },
         recordSheet: [], // 记录表
@@ -520,7 +541,8 @@
         dataIndex: null,
         showEdit: false,
         btnLoading: false,
-        currentRow: null
+        currentRow: null,
+        type: ''
       };
     },
     mounted() {
@@ -539,6 +561,7 @@
           this.formData.startDate = new Date(row.startDate);
           this.formData.stopDate = new Date(row.stopDate);
           this.formData.classify = this.formData.classify + '';
+          this.formData.reportWorkType = this.formData.reportWorkType + '';
 
           this.recordrulesDetailPage(row);
           this.recordrulesCyclePage(row);
@@ -591,38 +614,7 @@
         this.visible = false;
         this.$refs['formRef'].resetFields();
         // 清空表单数据
-        this.formData = {
-          id: null,
-          classify: null,
-          deviceId: null,
-          deviceName: '',
-          frequencyUnit: null,
-          frequencyValue: null,
-          name: '',
-          recordRulesDetailList: [
-            {
-              id: 0,
-              defaultValue: '',
-              maxValue: null,
-              minValue: null,
-              paramType: null,
-              paramValue: null,
-              remark: '',
-              symbol: null,
-              toolCodes: null,
-              tools: [],
-              unitName: null,
-              productName: '',
-              productCode: ''
-            }
-          ],
-          recordRulesCycleList: [],
-          startDate: null,
-          stopDate: null,
-          version: 1,
-          code: '',
-          fromId: null
-        };
+        this.formData = JSON.parse(JSON.stringify(this.formDateBase));
       },
       // 保存
       confirm() {

+ 4 - 0
src/views/technology/production/components/user-setting-matter.vue

@@ -180,6 +180,10 @@
       },
       // 删除事项
       async delMatter(row) {
+        if (row.isUsing) {
+          return this.$message.warning('事项正在使用中,无法删除');
+        }
+
         // 事项列表过滤
         this.matterList = this.matterList.filter((item) => item.id !== row.id);
         // 如果是临时id,直接前端删除