lucw 6 сар өмнө
parent
commit
f1f1d5ecb6

+ 310 - 0
src/components/selectRecordPlan/selectRecordPlan.vue

@@ -0,0 +1,310 @@
+<template>
+  <ele-modal
+    :visible="visible"
+    :append-to-body="true"
+    :close-on-click-modal="false"
+    custom-class="ele-dialog-form"
+    title="记录计划配置"
+    @update:visible="updateVisible"
+    :maxable="true"
+    width="90%"
+    :before-close="handleClose"
+  >
+    <el-card shadow="never" v-loading="loading">
+      <seekPage :seekList="seekList" @search="reload" :maxLength="4"></seekPage>
+      <ele-pro-table
+        ref="tableRef"
+        :columns="columns"
+        :datasource="datasource"
+        :selection.sync="selection"
+        cache-key="select-selectRecordPlan-table-2511261424"
+      >
+        <!-- 单选列 -->
+        <template v-slot:radio="{ row }">
+          <el-radio
+            class="radio"
+            v-model="currentRowId"
+            :label="row.id"
+            @change="radioChange($event, row)"
+          >
+            <i> </i>
+          </el-radio>
+        </template>
+      </ele-pro-table>
+    </el-card>
+    <template v-slot:footer>
+      <el-button type="primary" @click="confirmSelection"> 选择 </el-button>
+
+      <el-button @click="visible = false">关闭</el-button>
+    </template>
+  </ele-modal>
+</template>
+
+<script>
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import dictMixins from '@/mixins/dictMixins';
+  import { recordrulesPlanConfigPage } from '@/api/recordrules/index.js';
+
+  export default {
+    components: {},
+    mixins: [tabMixins, dictMixins],
+    props: {
+      // 是否多选
+      multiple: {
+        type: Boolean,
+        default: false
+      },
+      // 默认 筛选条件
+      where: {
+        type: Object,
+        default: () => ({
+          // 生效
+          status: '1'
+        })
+      }
+    },
+    computed: {
+      columns() {
+        const list = [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '计划配置单号',
+            align: 'center',
+            minWidth: 130,
+            slot: 'code'
+          },
+          {
+            prop: 'name',
+            label: '计划配置名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'ruleName',
+            label: '记录规则名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (row) => {
+              return row.list.map((i) => i.ruleName).join(',');
+            }
+          },
+          {
+            prop: '',
+            label: '记录部门',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (row) => {
+              if (row.type == 0) {
+                return row.executeUser.map((i) => i.groupName).join(',');
+              }
+              return '';
+            }
+          },
+          {
+            prop: '',
+            label: '负责人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (row) => {
+              if (row.type == 0) {
+                return row.executeUser.map((i) => i.userName).join(',');
+              }
+              return '';
+            }
+          },
+          {
+            prop: 'executeUser',
+            label: '班组',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (row) => {
+              if (row.type == 1) {
+                return row.executeUser.map((i) => i.teamName).join(',');
+              }
+              return '';
+            }
+          },
+          {
+            prop: '',
+            label: '记录对象',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (row) => {
+              return row.list
+                .map((i) => i.workshops.map((i) => i.workshopName))
+                .flat()
+                .join(',');
+            }
+          },
+          {
+            prop: 'autoOrder',
+            label: '自动派单',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (row) => {
+              return row.autoOrder ? '是' : '否';
+            }
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (row) => {
+              return row.status ? '开启' : '关闭';
+            }
+          },
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 220,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ];
+
+        if (this.multiple) {
+          list.unshift({
+            type: 'selection',
+            width: 50,
+            align: 'center',
+            fixed: 'left'
+          });
+        } else {
+          list.unshift({
+            prop: 'radio',
+            width: 50,
+            align: 'center',
+            fixed: 'left',
+            slot: 'radio'
+          });
+        }
+
+        return list;
+      },
+      seekList() {
+        return [
+          {
+            label: '计划配置名称:',
+            value: 'name',
+            type: 'input',
+            placeholder: '计划配置名称'
+          },
+          {
+            label: '规则名称:',
+            value: 'ruleName',
+            type: 'input',
+            placeholder: '规则名称'
+          }
+        ];
+      }
+    },
+    data() {
+      return {
+        loading: false,
+        visible: false,
+        selection: [],
+        produceTaskId: '',
+        reportWorkType: '', // 事项报工类型 产前、过程、产后
+        currentRowId: null,
+        currentRow: null
+      };
+    },
+    created() {},
+    methods: {
+      open() {
+        this.visible = true;
+        this.reload(); // 刷新表格
+      },
+      updateVisible(val) {
+        this.visible = val;
+      },
+      /* 表格数据源 */
+      datasource({ page, limit, where }) {
+        return this.getList({
+          pageNum: page,
+          size: limit,
+          ...where,
+          ...this.where
+        });
+      },
+      async getList(body) {
+        const data = await recordrulesPlanConfigPage(body);
+        data.list = data.list.map((item) => {
+          // children 改名
+          item.list = item.children;
+          delete item.children;
+          return item;
+        });
+        return data;
+      },
+      /* 刷新表格 */
+      reload(where = {}) {
+        this.$refs.tableRef?.reload({
+          page: 1, // 已发布
+          where
+        });
+      },
+      confirmSelection() {
+        if (this.multiple && this.selection.length === 0) {
+          this.$message.warning('请先选择事项');
+          return;
+        }
+
+        if (!this.multiple && !this.currentRow) {
+          this.$message.warning('请先选择事项');
+          return;
+        }
+
+        this.$emit(
+          'chooseRules',
+          this.multiple ? this.selection : this.currentRow
+        );
+        this.handleClose();
+      },
+      radioChange(_, row) {
+        this.currentRow = row;
+      },
+      handleClose() {
+        this.selection = [];
+        this.currentRowId = null;
+        this.currentRow = null;
+        this.visible = false;
+      }
+    }
+  };
+</script>

+ 18 - 12
src/views/rulesManagement/components/programRulesDialog.vue

@@ -105,21 +105,21 @@
                 <el-table-column label="序号" type="index" width="50">
                 </el-table-column>
                 <el-table-column label="设备名称" align="center" prop="name">
-                  <template slot-scope="{ row, $index }">
+                  <template slot-scope="{ row }">
                     <template>
                       {{ row.name }}
                     </template>
                   </template>
                 </el-table-column>
                 <el-table-column label="编号" align="center" prop="codeNumber">
-                  <template slot-scope="{ row, $index }">
+                  <template slot-scope="{ row }">
                     <template>
                       {{ row.codeNumber }}
                     </template>
                   </template>
                 </el-table-column>
                 <el-table-column label="固资编码" align="center" prop="fixCode">
-                  <template slot-scope="{ row, $index }">
+                  <template slot-scope="{ row }">
                     <template>
                       {{ row.fixCode }}
                     </template>
@@ -588,6 +588,7 @@ export default {
                 ruleMatters: item.ruleItems
               };
             });
+            const planConfigAddOrUpdatePOListIds = planConfigAddOrUpdatePOList.map(i=> i.id)
             console.log(planConfigAddOrUpdatePOList);
             let boolen = planConfigAddOrUpdatePOList.every(
               (item) => item.deviceInfo.length > 0
@@ -898,23 +899,28 @@ export default {
       // this.ruleIdList[e.index].ruleItems = this._getMatterRulesDetails(this.ruleId)
     },
 
-    removeTab(targetName) {
+    removeTab(targetRuleId) {
       this.$confirm('是否删除当前工序?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       })
         .then(() => {
-          this.ruleIdList.forEach((e, index) => {
-            if (e.ruleId == targetName) {
-              this.ruleIdList.splice(index, 1);
-              this.$nextTick(() => {
-                if (this.ruleIdList.length == 1) {
-                  this.tabsValue = this.ruleIdList[0].ruleId;
-                }
-              });
+          console.log('targetName', targetRuleId);
+          console.log('this.ruleIdList', this.ruleIdList)
+
+          this.ruleIdList = this.ruleIdList.filter(
+            (item) => item.ruleId != targetRuleId
+          );
+
+          console.log('this.ruleIdList', this.ruleIdList)
+
+          this.$nextTick(() => {
+            if (this.ruleIdList.length == 1) {
+              this.tabsValue = this.ruleIdList[0].ruleId;
             }
           });
+
         })
         .catch(() => { });
     },

+ 1 - 0
src/views/rulesManagement/recordPlan/components/programRulesDialog.vue

@@ -877,6 +877,7 @@
         const data = await recordrulesPlanConfigGetById(id);
         console.log('记录计划配置详情', data);
         this.$util.assignObject(this.addForm, data);
+        this.addForm.urgent = this.addForm.urgent + '';
         // 处理回显数据
         if (this.addForm.type === 0) {
           // 个人

+ 199 - 116
src/views/rulesManagement/releaseRules/components/permitAdd.vue

@@ -21,47 +21,86 @@
       <el-row>
         <el-col :span="8">
           <el-form-item label="行业类别" prop="industryType">
-            <dict-selection
+            <el-select
               v-model="formData.industryType"
-              dictName="行业类别"
               placeholder="请选择行业类别"
-            />
+              style="width: 100%"
+              @change="industryTypeChange"
+            >
+              <el-option
+                v-for="item in industryTypeList"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              />
+            </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="业务分类" prop="businessType">
-            <dict-selection
+            <el-select
               v-model="formData.businessType"
-              dictName="业务类型"
               placeholder="请选择业务分类"
-            />
+              style="width: 100%"
+              @change="businessTypeChange"
+            >
+              <el-option
+                v-for="item in businessTypeList"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              />
+            </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="模块划分" prop="reportWorkType">
-            <dict-selection
+            <el-select
               v-model="formData.reportWorkType"
-              dictName="记录规则报工类型"
               placeholder="请选择模块划分"
-            />
+              style="width: 100%"
+              @change="reportWorkTypeChange"
+            >
+              <el-option
+                v-for="item in reportWorkTypeList"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              />
+            </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="应用场景" prop="classify">
-            <dict-selection
+            <el-select
               v-model="formData.classify"
-              dictName="记录规则类型"
               placeholder="请选择应用场景"
-            />
+              style="width: 100%"
+              @change="classifyChange"
+            >
+              <el-option
+                v-for="item in classifyList"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              />
+            </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="模板样式" prop="recordTemplateStyle">
-            <dict-selection
+            <el-select
               v-model="formData.recordTemplateStyle"
-              dictName="记录表模板样式"
               placeholder="请选择模板样式"
-            />
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in recordTemplateStyleList"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              />
+            </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="8">
@@ -575,6 +614,7 @@
   import processModal from './processModal.vue';
   import ProductModalCorrelation from './ProductModal.vue';
   import { recordrulesexecutemethodPage } from '@/api/recordrulesexecutemethod/index';
+  import { businessTypeList } from '@/views/regulationManagement/components/util';
 
   export default {
     mixins: [dictMixins],
@@ -768,6 +808,125 @@
         } else {
           return this.formData.details;
         }
+      },
+      // 根据typeList 计算行业类型列表
+      //       {
+      //     "id": "1991058936943173633",
+      //     "createTime": "2025-11-19 16:20:17",
+      //     "createUserId": "1881891196703911938",
+      //     "industryType": 1,
+      //     "industryName": "工程机械",
+      //     "businessType": 1,
+      //     "businessName": "生产",
+      //     "reportWorkType": 1,
+      //     "reportWorkName": "产前准备",
+      //     "sceneType": 1,
+      //     "sceneName": "清场清洁",
+      //     "templateStyleType": 1,
+      //     "templateStyleName": "通用模板",
+      //     "tenantId": "1",
+      //     "deptId": "1",
+      //     "factoriesId": "1916747066214232065"
+      // }
+      industryTypeList() {
+        const seen = new Set();
+        const res = [];
+        for (const i of this.typeList || []) {
+          const key = String(i.industryType);
+          if (!seen.has(key)) {
+            seen.add(key);
+            res.push({
+              label: i.industryName,
+              value: key
+            });
+          }
+        }
+        return res;
+      },
+      // 根据typeList和formData.industryType计算业务分类列表
+      businessTypeList() {
+        const seen = new Set();
+        const res = [];
+        const list = this.typeList.filter(
+          (i) => i.industryType == this.formData.industryType
+        );
+        for (const i of list || []) {
+          const key = String(i.businessType);
+          if (!seen.has(key)) {
+            seen.add(key);
+            res.push({
+              label: i.businessName,
+              value: key
+            });
+          }
+        }
+        return res;
+      },
+      // 根据typeList和formData.industryType、formData.businessType计算模块划分列表
+      reportWorkTypeList() {
+        const seen = new Set();
+        const res = [];
+        const list = this.typeList.filter(
+          (i) =>
+            i.industryType == this.formData.industryType &&
+            i.businessType == this.formData.businessType
+        );
+        for (const i of list || []) {
+          const key = String(i.reportWorkType);
+          if (!seen.has(key)) {
+            seen.add(key);
+            res.push({
+              label: i.reportWorkName,
+              value: key
+            });
+          }
+        }
+        return res;
+      },
+      // 根据typeList和formData.industryType、formData.businessType、formData.reportWorkType计算应用场景列表
+      classifyList() {
+        const seen = new Set();
+        const res = [];
+        const list = this.typeList.filter(
+          (i) =>
+            i.industryType == this.formData.industryType &&
+            i.businessType == this.formData.businessType &&
+            i.reportWorkType == this.formData.reportWorkType
+        );
+        for (const i of list || []) {
+          const key = String(i.sceneType);
+          if (!seen.has(key)) {
+            seen.add(key);
+            res.push({
+              label: i.sceneName,
+              value: key
+            });
+          }
+        }
+        return res;
+      },
+      // 根据typeList和formData.industryType、formData.businessType、formData.reportWorkType、formData.classify计算模板样式列表
+      recordTemplateStyleList() {
+        const seen = new Set();
+        const res = [];
+        const list = this.typeList.filter(
+          (i) =>
+            i.industryType == this.formData.industryType &&
+            i.businessType == this.formData.businessType &&
+            i.reportWorkType == this.formData.reportWorkType &&
+            i.sceneType == this.formData.classify
+        );
+        for (const i of list || []) {
+          const key = String(i.templateStyleType);
+          if (!seen.has(key)) {
+            seen.add(key);
+            res.push({
+              label: i.templateStyleName,
+              value: key
+            });
+          }
+        }
+        return res;
       }
     },
     data() {
@@ -885,13 +1044,15 @@
           { label: '物料统计', value: '2' },
           { label: '工序统计', value: '3' }
         ],
-        opSelectOptions: ['+', '-', '*', '/', '%', '(', ')']
+        opSelectOptions: ['+', '-', '*', '/', '%', '(', ')'],
+        typeList: []
       };
     },
     mounted() {
       this.getByCodeData();
       this.getProductCategory();
       console.log('this.formData 2233', this.formData);
+      this.getTypeList();
     },
     methods: {
       open(row, type, title) {
@@ -899,6 +1060,8 @@
         this.type = type;
         console.log('type', type, row);
 
+        this.getTypeList();
+
         if (
           type == 'edit' ||
           type == 'detail' ||
@@ -1729,106 +1892,26 @@
           size: 99999
         });
 
-        console.log('type list', list);
-
-        const industryMap = new Map();
-
-        list.forEach((item) => {
-          // industry
-          let industryNode = industryMap.get(item.industryType);
-          if (!industryNode) {
-            industryNode = {
-              id: 'industry-' + item.industryType,
-              type: 'industry',
-              value: item.industryType,
-              label: item.industryName,
-              children: [],
-              item,
-              _businessMap: new Map()
-            };
-            industryMap.set(item.industryType, industryNode);
-          }
-
-          // business
-          let businessNode = industryNode._businessMap.get(item.businessType);
-          if (!businessNode) {
-            businessNode = {
-              id: `business-${item.industryType}-${item.businessType}`,
-              type: 'business',
-              value: item.businessType,
-              label: item.businessName,
-              children: [],
-              item,
-              _reportMap: new Map()
-            };
-            industryNode._businessMap.set(item.businessType, businessNode);
-            industryNode.children.push(businessNode);
-          }
-
-          // reportWork
-          let reportNode = businessNode._reportMap.get(item.reportWorkType);
-          if (!reportNode) {
-            reportNode = {
-              id: `report-${item.industryType}-${item.businessType}-${item.reportWorkType}`,
-              type: 'reportWork',
-              value: item.reportWorkType,
-              label: item.reportWorkName,
-              children: [],
-              item,
-              _sceneMap: new Map()
-            };
-            businessNode._reportMap.set(item.reportWorkType, reportNode);
-            businessNode.children.push(reportNode);
-          }
-
-          // scene
-          let sceneNode = reportNode._sceneMap.get(item.sceneType);
-          if (!sceneNode) {
-            sceneNode = {
-              id: `scene-${item.industryType}-${item.businessType}-${item.reportWorkType}-${item.sceneType}`,
-              type: 'scene',
-              value: item.sceneType,
-              label: item.sceneName,
-              children: [],
-              item,
-              _templateMap: new Map()
-            };
-            reportNode._sceneMap.set(item.sceneType, sceneNode);
-            reportNode.children.push(sceneNode);
-          }
-
-          // template style
-          let templateNode = sceneNode._templateMap.get(item.templateStyleType);
-          if (!templateNode) {
-            templateNode = {
-              id: `template-${item.industryType}-${item.businessType}-${item.reportWorkType}-${item.sceneType}-${item.templateStyleType}`,
-              type: 'templateStyle',
-              value: item.templateStyleType,
-              label: item.templateStyleName,
-              item,
-              children: []
-            };
-            sceneNode._templateMap.set(item.templateStyleType, templateNode);
-            sceneNode.children.push(templateNode);
-          }
-
-          // 原始数据
-          templateNode.item = item;
-        });
-
-        const clean = (node) => {
-          delete node._businessMap;
-          delete node._reportMap;
-          delete node._sceneMap;
-          delete node._templateMap;
-          node.children && node.children.forEach(clean);
-        };
-
-        const tree = Array.from(industryMap.values());
-        tree.forEach(clean);
-
-        this.typeTree = tree; // 结果树
-        console.log('typeTree', this.typeTree);
+        this.typeList = list;
+        console.log('this.typeList', this.typeList);
+      },
+      industryTypeChange() {
+        this.formData.businessType = '';
+        this.formData.reportWorkType = '';
+        this.formData.classify = '';
+        this.formData.recordTemplateStyle = '';
+      },
+      businessTypeChange() {
+        this.formData.reportWorkType = '';
+        this.formData.classify = '';
+        this.formData.recordTemplateStyle = '';
+      },
+      reportWorkTypeChange() {
+        this.formData.classify = '';
+        this.formData.recordTemplateStyle = '';
+      },
+      classifyChange() {
+        this.formData.recordTemplateStyle = '';
       }
     }
   };

+ 0 - 1
src/views/rulesManagement/releaseRules/index.vue

@@ -201,7 +201,6 @@
     recordrulesRevokePublish,
     recordrulesTypePage,
     recordrulesTypeDeletes,
-    recordrulesTypeSave
   } from '@/api/recordrules/index';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import dictMixins from '@/mixins/dictMixins';

+ 60 - 3
src/views/technology/production/components/user-setting-matter-add.vue

@@ -75,7 +75,7 @@
       </el-form-item>
 
       <el-form-item
-        v-if="formData.itemType == '2'"
+        v-if="formData.itemType == '2' && formData.executeMethod == '2'"
         label="关联记录规则"
         required
         prop="rulesName"
@@ -94,6 +94,26 @@
         </div>
       </el-form-item>
 
+      <el-form-item
+        v-if="formData.itemType == '2' && formData.executeMethod == '1'"
+        label="关联记录计划"
+        required
+        prop="planConfigName"
+      >
+        <div class="mask-box" @click="openSelectPlanRules">
+          <el-input
+            v-model="formData.planConfigName"
+            placeholder="请选择记录计划配置"
+            size="small"
+            :readonly="true"
+          >
+            <template #append>
+              <el-button size="small">记录计划配置</el-button>
+            </template>
+          </el-input>
+        </div>
+      </el-form-item>
+
       <el-form-item
         v-if="formData.itemType == '1'"
         label="关联计划规则"
@@ -153,6 +173,11 @@
       ref="selectPlanRulesRef"
       @chooseRules="choosePlanRules"
     ></selectPlanRules>
+
+    <selectRecordPlan
+      ref="selectRecordPlanRef"
+      @chooseRules="chooseRecordPlan"
+    ></selectRecordPlan>
   </ele-modal>
 </template>
 
@@ -164,6 +189,7 @@
   import selectMatterRules from '@/components/selectMatterRules/select-matter-rules.vue';
   import selectReleaseRules from '@/components/selectReleaseRules/select-release-rules.vue';
   import selectPlanRules from '@/components/selectPlanRules/selectPlanRules.vue';
+  import selectRecordPlan from '@/components/selectRecordPlan/selectRecordPlan.vue';
 
   export default {
     name: 'UserSettingMatter',
@@ -180,13 +206,26 @@
       MaterialAdd,
       selectMatterRules,
       selectReleaseRules,
-      selectPlanRules
+      selectPlanRules,
+      selectRecordPlan
     },
     computed: {
       executeMethodDict() {
         const list = this.getDictListByName('记录规则执行方式') || [];
 
-        if (this.formData.itemType == '1' || this.formData.itemType == '2') {
+        if (this.formData.itemType == '1') {
+          // 过程控制 只能选择按事项执行
+          return list.map((item) => {
+            if (item.label == '任务驱动' || item.label == '表单填写') {
+              item.disabled = true;
+            } else {
+              item.disabled = false;
+            }
+            return item;
+          });
+        }
+
+        if (this.formData.itemType == '2') {
           // 过程控制 只能选择按事项执行
           return list.map((item) => {
             if (item.label == '任务驱动') {
@@ -235,6 +274,7 @@
         recordRulesClassify: '', // 记录规则分类
         planConfigId: null, // 计划配置id
         planConfigName: '', // 计划配置名称
+        planConfigCode: '', // 计划配置名称
         dayRange: 1 // 查询范围
       };
 
@@ -311,6 +351,7 @@
         this.formData.rulesName = '';
         this.formData.planConfigId = null;
         this.formData.planConfigName = '';
+        this.formData.planConfigCode = '';
 
         this.$nextTick(() => {
           this.$refs.formRef.clearValidate();
@@ -404,6 +445,7 @@
         if (this.type == 'details') {
           return;
         }
+
         this.$refs.selectReleaseRulesRef.open(
           this.formData.reportWorkType,
           this.formData.produceTaskId
@@ -431,6 +473,21 @@
         this.ruleInfo = rules;
         this.formData.planConfigId = rules.id || null;
         this.formData.planConfigName = rules.name || '';
+        this.formData.planConfigCode = rules.code || '';
+      },
+      // 选择记录计划配置
+      openSelectPlanRules() {
+        if (this.type == 'details') {
+          return;
+        }
+        this.$refs.selectRecordPlanRef.open();
+      },
+      // 选择记录计划配置
+      chooseRecordPlan(rules) {
+        console.log('rules', rules);
+        this.formData.planConfigId = rules.id || null;
+        this.formData.planConfigName = rules.name || '';
+        this.formData.planConfigCode = rules.code || '';
       }
     }
   };

+ 19 - 3
src/views/technology/production/components/user-setting-matter-process.vue

@@ -358,10 +358,23 @@
           }
         }
 
-        if (matter.itemType == '2') {
+        if (matter.itemType == '2' && matter.executeMethod == '1') {
           const any = this.matterList
             .filter((i) => i.id !== currentId)
-            .some((i) => i.rulesId == matter.rulesId);
+            .some((i) => i.planConfigId == matter.planConfigId);
+
+          if (any) {
+            this.$message.warning(
+              `“${matter.planConfigName}”记录计划已存在,请勿重复添加`
+            );
+            return false;
+          }
+        }
+
+        if (matter.itemType == '2' && matter.executeMethod == '2') {
+          const any = this.matterList
+            .filter((i) => i.id !== currentId)
+            .some((i) => i.rulesId == matter.rulesId && matter.rulesId);
 
           if (any) {
             this.$message.warning(
@@ -372,7 +385,10 @@
 
           // 是否存在记录规则
           const ruleItem = this.matterList.find(
-            (i) => i.itemType == '2' && i.id !== currentId
+            (i) =>
+              i.itemType == '2' &&
+              i.executeMethod == rules.executeMethod &&
+              i.id !== currentId
           );
 
           if (

+ 10 - 3
src/views/technology/production/components/user-setting-matter.vue

@@ -259,11 +259,16 @@
                   item.planConfigId == matter.planConfigId &&
                   item.produceTaskId == task.id
                 );
-              } else if (item.itemType == 2) {
+              } else if (item.itemType == 2 && item.executeMethod == 2) {
                 return (
                   item.recordRulesClassify == matter.recordRulesClassify &&
                   item.produceTaskId == task.id
                 );
+              } else if (item.itemType == 2 && item.executeMethod == 1) {
+                return (
+                  item.planConfigId == matter.planConfigId &&
+                  item.produceTaskId == task.id
+                );
               } else {
                 return (
                   item.itemTaskName == matter.itemTaskName &&
@@ -292,8 +297,10 @@
             let msg = '';
             if (matter.itemType == 1) {
               msg = `计划规则【${matter.planConfigName}】`;
-            } else if (matter.itemType == 2) {
-              msg = `分类规则【${className}】`;
+            } else if (matter.itemType == 2 && matter.executeMethod == 2) {
+              msg = `分类规则【${className || ''}】`;
+            } else if (matter.itemType == 2 && matter.executeMethod == 1) {
+              msg = `记录计划【${matter.planConfigName}】`;
             } else {
               msg = `任务确认【${matter.itemTaskName}】`;
             }