Explorar el Código

功能调整bug修复

lucw hace 7 meses
padre
commit
3c57d14a2e

+ 1 - 1
src/components/common/seekPage.vue

@@ -197,7 +197,7 @@
         type: Array,
         default: () => []
       },
-      keyValue:''
+      keyValue: ''
     },
 
     components: {},

+ 1 - 1
src/mixins/dictMixins.js

@@ -8,7 +8,7 @@ export default {
     };
   },
   computed: {
-    ...mapGetters(['getDictValue', 'dict', 'getDict'])
+    ...mapGetters(['getDictValue', 'dict', 'getDict', 'getDictListByName'])
   },
   methods: {
     ...mapActions('dict', ['requestDict'])

+ 12 - 2
src/views/indicator/definition.vue

@@ -91,8 +91,18 @@
       seekList() {
         return [
           {
-            label: '工单编码:',
-            value: 'workOrderCode',
+            label: '业务类型',
+            value: 'businessType',
+            type: 'select',
+            placeholder: '请输入',
+            planList: this.allEnable.map((item) => ({
+              label: item.businessName,
+              value: item.businessType
+            }))
+          },
+          {
+            label: '考核指标',
+            value: 'indicatorName',
             type: 'input',
             placeholder: '请输入'
           }

+ 1 - 1
src/views/rulesManagement/components/MaterialAdd.vue

@@ -14,7 +14,7 @@
         width="244px"
         allow-collapse
         :right-style="{ overflow: 'hidden' }"
-      >
+      >   
         <div class="ele-border-lighter split-layout-right-content">
           <el-tree
             :data="treeList"

+ 19 - 2
src/views/rulesManagement/recordrulesexecutemethod/index.vue

@@ -54,6 +54,7 @@
     recordrulesexecutemethodPage,
     recordrulesexecutemethodDelete
   } from '@/api/recordrulesexecutemethod/index';
+  import producetask from '@/api/technology/production';
 
   export default {
     mixins: [dictMixins, tableColumnsMixin],
@@ -125,7 +126,8 @@
             showOverflowTooltip: true
           }
         ],
-        cacheKeyUrl: 'mes-2510301052-recordrulesexecutemethod-table'
+        cacheKeyUrl: 'mes-2510301052-recordrulesexecutemethod-table',
+        produceTaskList: []
       };
     },
     computed: {
@@ -142,7 +144,7 @@
             value: 'produceTaskId',
             type: 'select',
             placeholder: '请选择',
-            planList: []
+            planList: this.produceTaskList
           },
           {
             label: '状态:',
@@ -163,6 +165,9 @@
         ];
       }
     },
+    created() {
+      this.getProduceTaskList();
+    },
     methods: {
       // 刷新表格
       reload(where = {}) {
@@ -191,6 +196,18 @@
         await recordrulesexecutemethodDelete([row.id]);
         this.$message.success('删除成功');
         this.reload();
+      },
+      // 查询工序列表
+      async getProduceTaskList(name = '') {
+        const res = await producetask.list({
+          pageNum: 1,
+          size: 999,
+          name
+        });
+        this.produceTaskList = res.list.map((item) => ({
+          label: item.workCenterName + '-' + item.name,
+          value: item.id
+        }));
       }
     }
   };

+ 7 - 3
src/views/rulesManagement/releaseRules/components/permitAdd.vue

@@ -407,7 +407,11 @@
 
     <toolModal ref="toolModalRef" @chooseModal="chooseModal" />
 
-    <toolModal ref="toolModalTowRef" @chooseModal="chooseModalProduct" />
+    <toolModal
+      ref="toolModalTowRef"
+      @chooseModal="chooseModalProduct"
+      :multiple="false"
+    />
 
     <MaterialAdd
       ref="deviceSelectDialog"
@@ -1071,8 +1075,8 @@
       },
       chooseModalProduct(current) {
         console.log('current', current);
-        this.currentRow.productName = current[0].name;
-        this.currentRow.productCode = current[0].code;
+        this.currentRow.productName = current.name;
+        this.currentRow.productCode = current.code;
         console.log('this.currentRow', this.currentRow);
       },
       // 清空产品

+ 80 - 34
src/views/rulesManagement/releaseRules/components/toolModal.vue

@@ -40,6 +40,16 @@
             :selection.sync="selection"
             row-key="id"
           >
+            <template #radio="{ row }">
+              <el-radio
+                v-model="currentId"
+                :label="row.id"
+                @change="current = row"
+                class="radio"
+              >
+                <i></i>
+              </el-radio>
+            </template>
           </ele-pro-table>
         </template>
       </ele-split-layout>
@@ -59,6 +69,13 @@
     components: {
       ProductSearch
     },
+    props: {
+      // 是否多选
+      multiple: {
+        type: Boolean,
+        default: true
+      }
+    },
     computed: {
       seekList() {
         return [
@@ -81,38 +98,10 @@
             placeholder: '请输入'
           }
         ];
-      }
-    },
-    data() {
-      return {
-        visible: false,
-        title: '选择工具',
-
-        categoryLevelId: null,
-        categoryId: 1,
-        treeList: [],
-        treeLoading: false,
-
-        defaultProps: {
-          children: 'children',
-          label: 'name'
-        },
-        type: null,
-
-        // 表格列配置
-        columns: [
-          {
-            columnKey: 'selection',
-            type: 'selection',
-            width: 45,
-            align: 'center',
-            selectable: (row, index) => {
-              return !this.processData.some((it) => row.id == it.categoryId);
-            },
-            reserveSelection: true,
-            fixed: 'left'
-          },
-
+      },
+      // 表格列配置
+      columns() {
+        const list = [
           {
             label: '物料名称',
             prop: 'name'
@@ -156,12 +145,52 @@
             label: '数量',
             prop: 'count'
           }
-        ],
+        ];
+        if (this.multiple) {
+          list.unshift({
+            columnKey: 'selection',
+            type: 'selection',
+            width: 45,
+            align: 'center',
+            selectable: (row, index) => {
+              return !this.processData.some((it) => row.id == it.categoryId);
+            },
+            reserveSelection: true,
+            fixed: 'left'
+          });
+        } else {
+          list.unshift({
+            prop: 'radio',
+            slot: 'radio',
+            width: 50,
+            align: 'center',
+            fixed: 'left'
+          });
+        }
+        return list;
+      }
+    },
+    data() {
+      return {
+        visible: false,
+        title: '选择工具',
+
+        categoryLevelId: null,
+        categoryId: 1,
+        treeList: [],
+        treeLoading: false,
+
+        defaultProps: {
+          children: 'children',
+          label: 'name'
+        },
+        type: null,
 
         // 表格选中数据
         selection: [],
 
         processData: [],
+        currentId: '',
         current: null
       };
     },
@@ -222,11 +251,22 @@
       },
 
       handleClose() {
-        this.visible = false;
         this.$refs.table.setSelectedRows([]);
         this.selection = [];
+        this.current = null;
+        this.currentId = '';
+        this.visible = false;
       },
       selected() {
+        if (!this.multiple) {
+          if (!this.current) {
+            this.$message.error('请选择数据');
+            return;
+          }
+          this.$emit('chooseModal', this.current);
+          return this.handleClose();
+        }
+
         let _arr = [];
         if (!this.selection.length) {
           this.$message.error('请至少选择一条数据');
@@ -258,4 +298,10 @@
   .ml60 {
     margin-left: 60px;
   }
+
+  :deep(.radio) {
+    .el-radio__label {
+      padding: 0;
+    }
+  }
 </style>

+ 39 - 0
src/views/technology/production/components/user-edit.vue

@@ -511,6 +511,42 @@
             </el-radio-group>
           </el-form-item>
         </el-col>
+        <el-col :span="12">
+          <el-form-item label="是否投料后再过程监测:" label-width="200px">
+            <el-radio-group v-model="form.isFeedCheckProduction">
+              <el-radio
+                :label="item.value"
+                v-for="(item, i) in radioList"
+                :key="i"
+                >{{ item.name }}</el-radio
+              >
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="是否限制过程监测后再报工:" label-width="200px">
+            <el-radio-group v-model="form.isPostCheckProduction">
+              <el-radio
+                :label="item.value"
+                v-for="(item, i) in radioList"
+                :key="i"
+                >{{ item.name }}</el-radio
+              >
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="否产后检查后再报工:" label-width="200px">
+            <el-radio-group v-model="form.isFinalCheckProduction">
+              <el-radio
+                :label="item.value"
+                v-for="(item, i) in radioList"
+                :key="i"
+                >{{ item.name }}</el-radio
+              >
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
 
@@ -579,6 +615,9 @@
           feedNeedQuality: '',
           isReportProcessProduce: '',
           isPrenatalPreProduction: '',
+          isFeedCheckProduction: '',
+          isPostCheckProduction: '',
+          isFinalCheckProduction: '',
           sort: null,
           intervalTime: {
             nextShortPreTime: '', // 时间单位转换后的下一个短周期的时间,格式为YYYY-MM-DDTHH'

+ 65 - 44
src/views/technology/production/components/user-setting-matter-process.vue

@@ -265,56 +265,16 @@
         );
       },
       openEditMatter(row) {
+        this.currentEditRow = row;
         this.$refs.userSettingMatterAddRef.openEdit(row);
       },
       addMatter(matter, rules) {
         const id = 'tem' + new Date().getTime();
         console.log('matter', matter, rules);
 
-        if (matter.itemType == '2') {
-          const any = this.matterList.some((i) => i.rulesId == matter.rulesId);
-
-          if (any) {
-            return this.$message.warning(
-              `“${matter.rulesName}”记录规则已存在,请勿重复添加`
-            );
-          }
-
-          // 是否存在记录规则
-          const ruleItem = this.matterList.find((i) => i.itemType == '2');
-
-          if (
-            ruleItem &&
-            ruleItem.recordRulesClassify != matter.recordRulesClassify
-          ) {
-            const ruleItemClassName = this.getDictValue(
-              '记录规则类型',
-              ruleItem.recordRulesClassify
-            );
-            return this.$message.warning(
-              `已存在“${ruleItemClassName}”记录规则分类,请勿添加不同规则分类`
-            );
-          }
-
-          // 判断是否存在同一分类
-          const exists = this.matterList
-            .filter((i) => i.itemType == '2')
-            .some(
-              (item) =>
-                item.recordRulesClassify == matter.recordRulesClassify &&
-                item.recordRulesExecuteMethodId == rules.executeMethodId &&
-                rules.executeMethodId != null
-            );
-
-          if (exists) {
-            const className = this.getDictValue(
-              '记录规则类型',
-              matter.recordRulesClassify
-            );
-            return this.$message.warning(
-              `已存在“${className}”记录规则分类“${rules.executeMethodName}”,请勿重复添加`
-            );
-          }
+        // 校验事项是否重复
+        if (!this.validateMatter(matter, rules)) {
+          return;
         }
 
         matter.produceTaskConfigRuleDetails = rules?.details || [];
@@ -344,6 +304,11 @@
       editMatter(matter, rules) {
         console.log('matter', matter);
 
+        // 校验事项是否重复
+        if (!this.validateMatter(matter, rules, this.currentEditRow?.id)) {
+          return;
+        }
+
         // 编辑事项
         this.matterList = this.matterList.map((item) => {
           if (item.id === matter.id) {
@@ -377,6 +342,62 @@
         }
         this.handleSort();
       },
+      // 校验事项是否重复
+      validateMatter(matter, rules, currentId) {
+        if (matter.itemType == '2') {
+          const any = this.matterList
+            .filter((i) => i.id !== currentId)
+            .some((i) => i.rulesId == matter.rulesId);
+
+          if (any) {
+            this.$message.warning(
+              `“${matter.rulesName}”记录规则已存在,请勿重复添加`
+            );
+            return false;
+          }
+
+          // 是否存在记录规则
+          const ruleItem = this.matterList.find(
+            (i) => i.itemType == '2' && i.id !== currentId
+          );
+
+          if (
+            ruleItem &&
+            ruleItem.recordRulesClassify != matter.recordRulesClassify
+          ) {
+            const ruleItemClassName = this.getDictValue(
+              '记录规则类型',
+              ruleItem.recordRulesClassify
+            );
+            this.$message.warning(
+              `已存在“${ruleItemClassName}”记录规则分类,请勿添加不同规则分类`
+            );
+            return false;
+          }
+
+          // 判断是否存在同一分类
+          const exists = this.matterList
+            .filter((i) => i.itemType == '2' && i.id !== currentId)
+            .some(
+              (item) =>
+                item.recordRulesClassify == matter.recordRulesClassify &&
+                item.recordRulesExecuteMethodId == rules.executeMethodId &&
+                rules.executeMethodId != null
+            );
+
+          if (exists) {
+            const className = this.getDictValue(
+              '记录规则类型',
+              matter.recordRulesClassify
+            );
+            this.$message.warning(
+              `已存在“${className}”记录规则分类“${rules.executeMethodName}”,请勿重复添加`
+            );
+            return false;
+          }
+        }
+        return true;
+      },
       // 事项排序 根据matterList的顺序
       handleSort() {
         this.matterList = this.matterList.map((item, index) => {