Преглед на файлове

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-mes into dengfei

695593266@qq.com преди 7 месеца
родител
ревизия
1ac20a01c2

+ 1 - 1
src/api/recordRules/index.js

@@ -30,7 +30,7 @@ export async function recordrulesPage(body) {
 // 规则记录分页查询 过程监测 /main/recordrules/notProduceTaskConfigRecordRulesPage
 export async function recordrulesNotProduceTaskConfigRecordRulesPage(body) {
   const res = await request.post(
-    `/main/recordrules/notProduceTaskConfigRecordRulesPage`,
+    `/main/recordrules/processInspectionRecordRulesPage`,
     body
   );
   if (res.data.code == 0) {

+ 1 - 1
src/components/bpmTask/bpmTask.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-row v-loading="tasksLoad">
+  <el-row v-bind="$attrs" v-loading="tasksLoad">
     <bpmSubmit
       v-if="currenItem"
       @handleAudit="handleAudit"

+ 0 - 7
src/components/selectReleaseRules/search.vue

@@ -37,13 +37,6 @@
             type: 'select',
             placeholder: '记录规则分类',
             planList: this.typeList
-          },
-          {
-            label: '模块分类',
-            value: 'reportWorkType',
-            type: 'select',
-            placeholder: '模块分类',
-            planList: this.reportWorkTypeList
           }
           //,
           // {

+ 69 - 34
src/components/selectReleaseRules/select-release-rules.vue

@@ -4,7 +4,7 @@
     :append-to-body="true"
     :close-on-click-modal="false"
     custom-class="ele-dialog-form"
-    title="选择记录规则"
+    title="选择记录事项"
     @update:visible="updateVisible"
     :maxable="true"
     width="90%"
@@ -17,6 +17,16 @@
         :datasource="datasource"
         :selection.sync="selection"
       >
+        <!-- 单选列 -->
+        <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>
@@ -40,34 +50,27 @@
     components: { search },
     mixins: [tabMixins, dictMixins],
     props: {
-      // 是否多选
-      multiple: {
+      // NotProduceTaskConfig bool 是否排除已配置的记录规则 过程监测传true
+      notProduceTaskConfig: {
         type: Boolean,
         default: false
       },
-      // NotProduceTaskConfig bool 是否排除已配置的记录规则 过程监测传true
-      notProduceTaskConfig: {
+      // 是否多选
+      multiple: {
         type: Boolean,
         default: false
       }
     },
     computed: {
       columns() {
-        return [
+        const list = [
           {
             columnKey: 'index',
             label: '序号',
             type: 'index',
             width: 55,
             align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'left'
-          },
-          {
-            width: 45,
-            type: 'selection',
-            columnKey: 'selection',
-            align: 'center'
+            showOverflowTooltip: true
           },
           {
             prop: 'code',
@@ -110,7 +113,7 @@
             showOverflowTooltip: true,
             minWidth: 110,
             formatter: (row) => {
-              return row.version ? `V${row.version.toFixed(1)}` : '';
+              return `${row.versionSymbol}${row.bigVersion}${row.versionMark}${row.smallVersion}`;
             }
           },
           {
@@ -190,24 +193,54 @@
             }
           }
         ];
+
+        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;
       }
     },
     data() {
       return {
         loading: false,
         visible: false,
-        selection: []
+        selection: [],
+        produceTaskId: '',
+        reportWorkType: '', // 记录规则报工类型 产前、过程、产后
+        currentRowId: null,
+        currentRow: null
       };
     },
-    mounted() {
+    created() {
       this.requestDict('记录规则类型');
       this.requestDict('规则周期');
     },
     methods: {
-      open() {
+      open(reportWorkType, produceTaskId) {
+        console.log('reportWorkType', reportWorkType);
+        console.log('produceTaskId', produceTaskId);
+
         this.visible = true;
         this.selection = [];
-        this.reload({}); // 刷新表格
+        this.currentRowId = null;
+        this.currentRow = null;
+        this.reportWorkType = reportWorkType || '';
+        this.produceTaskId = produceTaskId || '';
+        this.reload(); // 刷新表格
       },
       updateVisible(val) {
         this.visible = val;
@@ -217,7 +250,6 @@
         const API = this.notProduceTaskConfig
           ? recordrulesNotProduceTaskConfigRecordRulesPage
           : recordrulesPage;
-
         return API({
           pageNum: page,
           size: limit,
@@ -225,34 +257,37 @@
           publishStatus: 1,
           // 启用
           enable: 1,
-          ...where
+          ...where,
+          reportWorkType: this.reportWorkType,
+          produceTaskId: this.produceTaskId
         });
       },
       /* 刷新表格 */
       reload(where) {
         this.$refs.tableRef?.reload({
           page: 1, // 已发布
-          publishStatus: 1,
-          // 启用
-          enable: 1,
           where
         });
       },
       confirmSelection() {
-        if (this.selection.length == 0) {
-          this.$message.warning('请选择记录规则!');
+        if (this.multiple && this.selection.length === 0) {
+          this.$message.warning('请选择记录规则');
           return;
         }
-        if (this.multiple) {
-          this.$emit('chooseRules', this.selection);
-        } else {
-          if (this.selection.length > 1) {
-            this.$message.warning('只能选择一条记录规则');
-            return;
-          }
-          this.$emit('chooseRules', this.selection[0]);
+
+        if (!this.multiple && !this.currentRow) {
+          this.$message.warning('请先选择记录规则');
+          return;
         }
+
+        this.$emit(
+          'chooseRules',
+          this.multiple ? this.selection : this.currentRow
+        );
         this.visible = false;
+      },
+      radioChange(_, row) {
+        this.currentRow = row;
       }
     }
   };

+ 99 - 16
src/views/batchRecord/components/editModal.vue

@@ -9,7 +9,34 @@
     width="80%"
   >
     <div>
-      <el-form ref="formRef" :model="form" :rules="rules" label-width="130px">
+      <div
+        class="switch"
+        v-if="details && details.processInstanceId"
+        :maxable="true"
+        style="margin-bottom: 20px"
+      >
+        <div class="switch_left">
+          <ul>
+            <li
+              v-for="item in tabOptions"
+              :key="item.key"
+              :class="{ active: activeComp == item.key }"
+              @click="activeComp = item.key"
+            >
+              {{ item.name }}
+            </li>
+          </ul>
+        </div>
+      </div>
+
+      <el-form
+        v-if="activeComp == 'main'"
+        ref="formRef"
+        :model="form"
+        :rules="rules"
+        label-width="130px"
+        :disabled="type == 'detail'"
+      >
         <header-title title="事项信息"></header-title>
         <el-row style="margin-bottom: 20px">
           <el-col :span="8">
@@ -25,7 +52,6 @@
             <el-form-item label="类型" required prop="itemType">
               <DictSelection
                 dictName="记录规则事项类型"
-                clearable
                 v-model="form.itemType"
                 @change="itemTypeChange"
               >
@@ -36,7 +62,6 @@
             <el-form-item label="执行方式" required prop="executeMethod">
               <DictSelection
                 dictName="记录规则执行方式"
-                clearable
                 v-model="form.executeMethod"
                 disabled
               >
@@ -155,7 +180,7 @@
                   v-for="item in produceTaskList"
                   :key="item.taskId"
                   :label="item.taskTypeName"
-                  :value="item.taskId"
+                  :value="item.sourceTaskId"
                 >
                 </el-option>
               </el-select>
@@ -271,7 +296,10 @@
               </template>
             </el-table-column>
 
-            <el-table-column v-if="form.recordRulesClassify != '4'" label="检查工具">
+            <el-table-column
+              v-if="form.recordRulesClassify != '4'"
+              label="检查工具"
+            >
               <template slot-scope="{ row }">
                 <el-link :underline="false" style="cursor: pointer">
                   <div class="ele-cell">
@@ -289,7 +317,10 @@
               </template>
             </el-table-column>
 
-            <el-table-column v-if="form.recordRulesClassify != '4'" label="检查人">
+            <el-table-column
+              v-if="form.recordRulesClassify != '4'"
+              label="检查人"
+            >
               <template slot-scope="scope">
                 <div
                   @click="openSelectUser(scope.row)"
@@ -300,7 +331,10 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column v-if="form.recordRulesClassify != '4'" label="检查情况">
+            <el-table-column
+              v-if="form.recordRulesClassify != '4'"
+              label="检查情况"
+            >
               <template slot-scope="scope">
                 <div>
                   <el-radio-group v-model="scope.row.checkStatus">
@@ -326,7 +360,10 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column v-if="form.recordRulesClassify != '4'" label="检查结果">
+            <el-table-column
+              v-if="form.recordRulesClassify != '4'"
+              label="检查结果"
+            >
               <template slot-scope="scope">
                 <div>
                   <el-radio-group v-model="scope.row.checkResult">
@@ -338,7 +375,26 @@
             </el-table-column>
           </el-table>
         </div>
+
+        <!-- 底部审批 -->
+        <!-- <el-row
+          v-if="details && details.processInstanceId"
+          style="margin-top: 40px"
+        >
+          <bpmTask
+            v-if="details.processInstanceId"
+            :id="details.processInstanceId"
+            :businessId="details.id"
+            :gutter="20"
+          ></bpmTask>
+        </el-row> -->
       </el-form>
+
+      <bpmDetail
+        v-if="activeComp == 'bpm' && details && details.processInstanceId"
+        :id="details.processInstanceId"
+      >
+      </bpmDetail>
     </div>
 
     <template v-if="type == 'detail'" v-slot:footer>
@@ -476,6 +532,8 @@
   import SelectUser from '@/components/select/SelectUser/index.vue';
   import toolModal from './toolModal.vue';
   import { getById as producetaskrulerecordGetById } from '@/api/producetaskrecordrulesrecord/index.js';
+  import bpmDetail from '@/views/bpm/processInstance/detail.vue';
+  import bpmTask from '@/components/bpmTask/bpmTask.vue';
 
   export default {
     name: 'editModal',
@@ -490,7 +548,9 @@
       EquipmentDialog,
       taskDialog,
       SelectUser,
-      toolModal
+      toolModal,
+      bpmDetail,
+      bpmTask
     },
     props: {
       // 1-产前准备,2-过程监测,3-产后检查
@@ -502,6 +562,7 @@
     data() {
       const formBaseData = {
         id: null,
+        code: '',
         // 设备id
         deviceId: null,
         //设备名称
@@ -628,7 +689,13 @@
               trigger: 'blur'
             }
           ]
-        }
+        },
+        details: null,
+        tabOptions: [
+          { key: 'main', name: '事项信息' },
+          { key: 'bpm', name: '流程详情' }
+        ],
+        activeComp: 'main'
       };
     },
     computed: {
@@ -657,7 +724,7 @@
         this.type = type;
         if (type == 'add') {
           this.title = `新增${this.reportWorkTypeName}事项`;
-        } else if (type == 'edit' || type == 'detail') {
+        } else if (type == 'edit') {
           this.title = `编辑${this.reportWorkTypeName}事项`;
           this.form.workOrderId = data.workOrderId;
           this.form.id = data.id;
@@ -668,6 +735,16 @@
             this.getWorkOrderById(this.form.workOrderId);
             this.getDetias();
           }
+        } else if (type == 'detail') {
+          this.title = `${this.reportWorkTypeName}事项`;
+          this.form.workOrderId = data.workOrderId;
+          this.form.id = data.id;
+          if (this.form.workOrderId) {
+            this.getProductTaskList(this.form.workOrderId);
+            // 根据工单id 获取详情
+            this.getWorkOrderById(this.form.workOrderId);
+            this.getDetias();
+          }
         } else {
         }
         this.visible = true;
@@ -676,6 +753,7 @@
       async getDetias() {
         const data = await producetaskrulerecordGetById(this.form.id);
         data.tools = data.tools || [];
+        this.details = data;
         this.$util.assignObject(this.form, data);
         this.form.details = this.form.details.map((i) => {
           return {
@@ -712,8 +790,11 @@
       handleClose() {
         this.form = JSON.parse(JSON.stringify(this.formBaseData));
         this.produceTaskList = [];
-        this.$refs.formRef && this.$refs.formRef.resetFields();
-        this.visible = false;
+        this.details = null;
+        this.$nextTick(() => {
+          this.$refs.formRef.clearValidate();
+          this.visible = false;
+        });
       },
       // 修改规则事项类型
       itemTypeChange() {
@@ -724,6 +805,7 @@
       },
       // 去选择设备
       selectDeviceId() {
+        if (this.type == 'detail') return;
         this.$refs.deviceSelectDialog.open([]);
       },
       // 设备选
@@ -734,7 +816,8 @@
       },
       // 去选择记录规则
       selectReleaseId() {
-        this.$refs.selectReleaseRulesRef.open();
+        if (this.type == 'detail') return;
+        this.$refs.selectReleaseRulesRef.open(this.reportWorkType);
       },
       // 选择记录规则
       chooseReleaseRules(rules) {
@@ -818,7 +901,7 @@
       // 选择工序
       produceTaskIdChange() {
         const prodceTask = this.produceTaskList.find(
-          (i) => i.taskId == this.form.produceTaskId
+          (i) => i.sourceTaskId == this.form.produceTaskId
         );
         if (prodceTask) {
           this.form.produceTaskName = prodceTask.taskTypeName;
@@ -914,7 +997,7 @@
 
         return userList
           .map((i) => {
-            return i.groupName + '-' + i.userName;
+            return (i.groupName || i.teamName) + '-' + i.userName;
           })
           .join(',');
       },

+ 12 - 4
src/views/batchRecord/components/list.vue

@@ -65,7 +65,16 @@
           :underline="false"
           @click="execute(row)"
         >
-          执行
+          报工
+        </el-link>
+
+        <el-link
+          v-if="row.approvalStatus === 0"
+          type="primary"
+          :underline="false"
+          @click="openApproval(row)"
+        >
+          提交
         </el-link>
 
         <el-popconfirm
@@ -103,13 +112,13 @@
 
     <taskDialog ref="taskDialogRef" @reload="reload" :isTempRecord="1" />
 
-    <!-- <process-submit-dialog
+    <process-submit-dialog
       :processSubmitDialogFlag.sync="processSubmitDialogFlag"
       v-if="processSubmitDialogFlag"
       ref="processSubmitDialogRef"
       @reload="reload"
       :isNotNeedProcess="false"
-    ></process-submit-dialog> -->
+    ></process-submit-dialog>
   </el-card>
 </template>
 
@@ -377,7 +386,6 @@
               businessCode: row.code
             }
           };
-          console.log('1', 1);
           this.$refs.processSubmitDialogRef.init(params);
         });
       },

+ 5 - 5
src/views/checklistManagement/checklist.vue

@@ -132,17 +132,17 @@
             }
           },
           {
-            prop: 'code1',
+            prop: 'code',
             label: '生产工单号',
             align: 'center',
             minWidth: 110,
             showOverflowTooltip: true,
             formatter: (row) => {
-              return row.orders.map((i) => i.id).join(', ');
+              return row.orders.map((i) => i.workOrderCode).join(', ');
             }
           },
           {
-            prop: 'code2',
+            prop: 'formingNum',
             label: '数量',
             align: 'center',
             minWidth: 110,
@@ -152,7 +152,7 @@
             }
           },
           {
-            prop: 'code3',
+            prop: 'specification',
             label: '规格',
             align: 'center',
             minWidth: 110,
@@ -292,7 +292,7 @@
       // 提交审批
       openApproval(row) {
         console.log('row', row);
-        // this.processSubmitDialogFlag = true;
+        this.processSubmitDialogFlag = true;
         this.$nextTick(async () => {
           let params = {
             businessId: row.id,

+ 14 - 4
src/views/checklistManagement/components/checkDetails.vue

@@ -9,7 +9,7 @@
     width="80%"
   >
     <div
-      v-if="type == 'detail' || type == 'edit'"
+      v-if="(type == 'detail' || type == 'edit') && form.processInstanceId"
       class="switch"
       :maxable="true"
       style="margin-bottom: 20px"
@@ -406,7 +406,14 @@
           },
           {
             prop: 'formingNum',
-            label: '数量',
+            label: '要求生产数量',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'formedNum',
+            label: '实际生产数量',
             align: 'center',
             minWidth: 110,
             showOverflowTooltip: true
@@ -513,9 +520,12 @@
       },
       // 关闭时清理表单
       handleClose() {
-        this.visible = false;
         this.form = JSON.parse(JSON.stringify(this.formBaseData));
-        this.$refs.formRef && this.$refs.formRef.resetFields();
+        this.activeComp = 'main';
+        this.$nextTick(() => {
+          this.$refs.formRef.clearValidate();
+          this.visible = false;
+        });
       },
       // 提交
       submit(type) {

+ 2 - 2
src/views/produce/components/prenatalExamination/index.vue

@@ -92,11 +92,11 @@
       executeStatusTest(status) {
         switch (status) {
           case 0:
-            return '未执行';
+            return '未报工';
           case 1:
             return '执行中';
           default:
-            return '已执行';
+            return '已报工';
         }
       },
       // 获取数据

+ 0 - 6
src/views/produce/components/prenatalExamination/materialModal.vue

@@ -74,12 +74,6 @@
             columnKey: 'index',
             align: 'center'
           },
-          {
-            label: '批次号',
-            prop: 'batchNo',
-            minWidth: 120
-          },
-
           {
             label: '领料类型',
             prop: 'categoryLevelNamePath',

+ 213 - 108
src/views/produce/components/prenatalExamination/releaseRulesDialog.vue

@@ -180,7 +180,10 @@
       <el-row>
         <el-col :span="8">
           <el-form-item label="结论" required prop="conclution">
-            <el-radio-group v-model="addForm.conclution">
+            <el-radio-group
+              v-model="addForm.conclution"
+              @change="conclutionChange"
+            >
               <el-radio :label="1">合格</el-radio>
               <el-radio :label="2">不合格</el-radio>
             </el-radio-group>
@@ -189,9 +192,13 @@
       </el-row>
     </el-form>
 
-    <header-title title="物料清单"></header-title>
+    <header-title
+      v-if="addForm.reportWorkType == '2' && addForm.produceTaskId"
+      title="物料清单"
+    ></header-title>
 
     <ele-pro-table
+      v-if="addForm.reportWorkType == '2' && addForm.produceTaskId"
       ref="table"
       row-key="id"
       :columns="materialColumns"
@@ -244,107 +251,109 @@
       </template>
     </ele-pro-table>
 
-    <header-title title="检查项目"></header-title>
+    <header-title
+      title="检查项目"
+      :style="`margin-top: ${
+        addForm.reportWorkType == '2' && addForm.produceTaskId ? '20px' : '0px'
+      }`"
+    ></header-title>
 
-    <!-- 表格 -->
-    <el-table v-loading="loading" :data="addForm.details" style="width: 100%">
-      <el-table-column type="index" label="序号" width="50"> </el-table-column>
-      <el-table-column label="检查内容">
-        <template slot-scope="scope">
-          <div v-if="addForm.recordRulesClassify == 4">
-            {{ scope.row.productName || scope.row.name }}
-          </div>
-          <div v-else>
-            {{ scope.row.paramValue }}
-          </div>
-        </template>
-      </el-table-column>
-
-      <el-table-column
-        v-if="addForm.recordRulesClassify != '4'"
-        label="检查工具"
+    <el-tabs
+      v-if="executeMethodTitleList.length"
+      v-model="activeExecuteMethodTitle"
+      type="card"
+    >
+      <el-tab-pane
+        v-for="i in executeMethodTitleList"
+        :label="i"
+        :name="i"
+        :key="i"
       >
-        <template slot-scope="{ row }">
-          <el-link :underline="false" style="cursor: pointer">
-            <div class="ele-cell">
-              <div @click="handleAdd(row)">
-                {{ row.toolNames ? row.toolNames : '请选择' }}
-              </div>
-              <i
-                v-if="!row.toolNames"
-                class="el-icon-arrow-down"
-                @click="handleAdd(row)"
-              ></i>
-              <i v-else class="el-icon-close" @click="clearTool(row)"></i>
-            </div>
-          </el-link>
-        </template>
-      </el-table-column>
+      </el-tab-pane>
+    </el-tabs>
 
-      <el-table-column v-if="addForm.recordRulesClassify != '4'" label="检查人">
-        <template slot-scope="scope">
-          <div>
-            <el-select
-              v-model="scope.row.checkUsersIds"
-              placeholder="请选择检查人"
-              filterable
-              multiple
-              @change="checkUsersIdsChange(scope.row)"
-            >
-              <el-option
-                v-for="item in activeTeamUserList"
-                :label="item.name"
-                :value="item.id"
-                :key="item.id"
-              >
-              </el-option>
-            </el-select>
-          </div>
-        </template>
-      </el-table-column>
-      <el-table-column
-        v-if="addForm.recordRulesClassify != '4'"
-        label="检查情况"
-      >
-        <template slot-scope="scope">
-          <div>
-            <el-radio-group v-model="scope.row.checkStatus">
-              <el-radio :label="1">已检查</el-radio>
-              <el-radio :label="0">未检查</el-radio>
-            </el-radio-group>
+    <ele-pro-table
+      v-loading="loading"
+      ref="table"
+      row-key="id"
+      :columns="detailsColumns"
+      :datasource="rulesDetails"
+      cacheKey="mes-releaseRulesDialong-2510281408"
+      :needPage="false"
+    >
+      <template v-slot:paramValue="{ row }">
+        <div v-if="addForm.recordRulesClassify == 4">
+          {{ row.productName || row.name }}
+        </div>
+        <div v-else>
+          {{ row.paramValue }}
+        </div>
+      </template>
+      <template v-slot:toolNames="{ row }">
+        <el-link :underline="false" style="cursor: pointer">
+          <div class="ele-cell">
+            <div @click="handleAdd(row)">
+              {{ row.toolNames ? row.toolNames : '请选择' }}
+            </div>
+            <i
+              v-if="!row.toolNames"
+              class="el-icon-arrow-down"
+              @click="handleAdd(row)"
+            ></i>
+            <i v-else class="el-icon-close" @click="clearTool(row)"></i>
           </div>
-        </template>
-      </el-table-column>
-      <el-table-column label="描述">
-        <template slot-scope="scope">
-          <div>
-            <el-input
-              type="text"
-              :rows="1"
-              placeholder="请输入"
-              v-model="scope.row.errorMsg"
+        </el-link>
+      </template>
+      <template v-slot:checkUsersIds="{ row }">
+        <div>
+          <el-select
+            v-model="row.checkUsersIds"
+            placeholder="请选择检查人"
+            filterable
+            multiple
+            @change="checkUsersIdsChange(row)"
+          >
+            <el-option
+              v-for="item in activeTeamUserList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
             >
-              <template v-if="scope.row.unitName" slot="append">
-                <div>{{ scope.row.unitName }}</div>
-              </template>
-            </el-input>
-          </div>
-        </template>
-      </el-table-column>
-      <el-table-column
-        v-if="addForm.recordRulesClassify != '4'"
-        label="检查结果"
+            </el-option>
+          </el-select>
+        </div>
+      </template>
+      <template v-slot:checkStatus="{ row }">
+        <div>
+          <el-radio-group v-model="row.checkStatus">
+            <el-radio :label="1">已检查</el-radio>
+            <el-radio :label="0">未检查</el-radio>
+          </el-radio-group>
+        </div>
+      </template>
+      <template v-slot:errorMsg="{ row }">
+        <div>
+          <el-input
+            type="text"
+            :rows="1"
+            placeholder="请输入"
+            v-model="row.errorMsg"
+          >
+            <template v-if="row.unitName" slot="append">
+              <div>{{ row.unitName }}</div>
+            </template>
+          </el-input>
+        </div></template
       >
-        <template slot-scope="scope">
-          <div>
-            <el-radio-group v-model="scope.row.checkResult">
-              <el-radio :label="1">合格</el-radio>
-              <el-radio :label="0">不合格</el-radio>
-            </el-radio-group>
-          </div>
-        </template>
-      </el-table-column>
-    </el-table>
+      <template v-slot:checkResult="{ row }">
+        <div>
+          <el-radio-group v-model="row.checkResult">
+            <el-radio :label="1">合格</el-radio>
+            <el-radio :label="0">不合格</el-radio>
+          </el-radio-group>
+        </div>
+      </template>
+    </ele-pro-table>
 
     <!-- 底部按钮 -->
     <template #footer>
@@ -589,12 +598,6 @@
             columnKey: 'index',
             align: 'center'
           },
-          {
-            label: '批次号',
-            prop: 'batchNo',
-            minWidth: 120
-          },
-
           {
             label: '领料类型',
             prop: 'categoryLevelNamePath',
@@ -700,7 +703,9 @@
               return (row.sumNoQualifiedQuantity || 0) + (row.feedUnit || '');
             }
           }
-        ]
+        ],
+        activeExecuteMethodTitle: '',
+        executeMethodTitleList: []
       };
     },
     computed: {
@@ -722,6 +727,75 @@
         return this.teamUserList.filter((user) =>
           this.addForm.executeUsersIds.includes(user.id)
         );
+      },
+      // 规则详情表头
+      detailsColumns() {
+        let list = [
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center'
+          },
+          {
+            label: '检查内容',
+            prop: 'paramValue',
+            minWidth: 120,
+            slot: 'paramValue'
+          }
+        ];
+
+        if (this.addForm.recordRulesClassify != '4') {
+          list = [
+            ...list,
+            {
+              label: '检查工具',
+              prop: 'toolNames',
+              minWidth: 120,
+              slot: 'toolNames'
+            },
+            {
+              label: '检查人',
+              prop: 'checkUsersIds',
+              minWidth: 120,
+              slot: 'checkUsersIds'
+            },
+            {
+              label: '检查情况',
+              prop: 'checkStatus',
+              minWidth: 120,
+              slot: 'checkStatus'
+            },
+            {
+              label: '描述',
+              prop: 'errorMsg',
+              minWidth: 120,
+              slot: 'errorMsg'
+            },
+            {
+              label: '检查结果',
+              prop: 'checkResult',
+              minWidth: 120,
+              slot: 'checkResult'
+            }
+          ];
+        } else {
+          list.push({
+            label: '描述',
+            prop: 'errorMsg',
+            minWidth: 120,
+            slot: 'errorMsg'
+          });
+        }
+        return list;
+      },
+      rulesDetails() {
+        if (this.executeMethodTitleList.length) {
+          return this.addForm.details.filter(
+            (item) => item.executeMethodTitle == this.activeExecuteMethodTitle
+          );
+        }
+        return this.addForm.details;
       }
     },
     mounted() {
@@ -756,7 +830,8 @@
           this.addForm.produceRoutingName = workOrderInfo.produceRoutingName;
           this.addForm.produceTaskConfigId = productionInfo.produceTaskConfigId;
           this.addForm.produceTaskId = productionInfo.produceTaskId;
-          this.addForm.produceTaskName = productionInfo.produceTaskName;
+          this.addForm.produceTaskName =
+            productionInfo.produceTaskName || workOrderInfo.taskName;
           this.addForm.productCode = workOrderInfo.productCode;
           this.addForm.productModel = workOrderInfo.model;
           this.addForm.productName = workOrderInfo.productName;
@@ -805,6 +880,16 @@
           this.addForm.recordRulesClassify += '';
           if (this.addForm.details?.length == 0) {
             this.getRuleList();
+          } else {
+            // 分组
+            let executeMethodTitleList = this.addForm.details
+              .map((i) => i.executeMethodTitle)
+              .filter((i) => i);
+
+            this.executeMethodTitleList = [...new Set(executeMethodTitleList)];
+
+            this.activeExecuteMethodTitle =
+              this.executeMethodTitleList[0] || '';
           }
 
           this.addForm.executeUsersIds = this.addForm.executeUsers.map(
@@ -833,11 +918,12 @@
       },
       // 物料信息查询
       async getListByWorkOrderId() {
+        if (!this.productionInfo.produceTaskId) return;
         // 查询物料信息
         const materialList = await queryListByWorkOrderId({
           workOrderId: this.addForm.workOrderId,
           recordId: this.productionInfo.recordId,
-          produceTaskInstanceId: this.workOrderInfo.taskId,
+          produceTaskId: this.productionInfo.produceTaskId,
           ruleId: this.addForm.ruleId
         });
 
@@ -856,8 +942,6 @@
           this.addForm.ruleName = this.ruleInfo.name;
           this.addForm.deviceId = this.ruleInfo.deviceId;
           this.addForm.deviceName = this.ruleInfo.deviceName;
-          this.addForm.produceTaskName =
-            this.ruleInfo.produceTaskConfigs[0]?.produceTaskName;
         }
       },
       // 查询记录规则 事项列表
@@ -882,11 +966,21 @@
             toolNames: i.tools.map((i) => i.toolName).join(',')
           };
         });
+        let executeMethodTitleList = this.addForm.details
+          .map((i) => i.executeMethodTitle)
+          .filter((i) => i);
+
+        this.executeMethodTitleList = [...new Set(executeMethodTitleList)];
+
+        this.activeExecuteMethodTitle = this.executeMethodTitleList[0] || '';
+
         console.log('this.addForm 添加规则', this.addForm, list);
       },
       handleBeforeClose() {
         this.addForm = JSON.parse(JSON.stringify(this.formDate));
         console.log('this.$refs.ruleFormRef', this.addForm);
+        this.activeExecuteMethodTitle = '';
+        this.executeMethodTitleList = [];
         this.$nextTick(() => {
           this.$refs.ruleFormRef.clearValidate();
           this.visible = false;
@@ -1178,6 +1272,17 @@
       },
       noQualifiedQuantityMax(row) {
         return row.reportQuantity - row.qualifiedQuantity;
+      },
+      // 结论修改-同步
+      conclutionChange() {
+        this.addForm.details = this.addForm.details.map((i) => {
+          if (!i.checkStatus) {
+            i.checkStatus = 1;
+          }
+          i.checkResult = this.addForm.conclution == 1 ? 1 : 0;
+
+          return i;
+        });
       }
     }
   };

+ 2 - 2
vue.config.js

@@ -33,12 +33,12 @@ module.exports = {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
         // target: 'http://124.71.68.31:50001',
-        target: 'http://192.168.1.125:18086',
+        // target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.116:18086', // 赵沙金
-        // target: 'http://192.168.1.251:18086', // 开发环境
+        target: 'http://192.168.1.251:18086', // 开发环境
         // target: 'http://192.168.1.103:18086',192.168.1.116
         // target: 'http://192.168.1.144:18086',
         // target: 'http://192.168.1.30:18086',