Explorar el Código

功能完善bug修复

lucw hace 7 meses
padre
commit
673a90a114

+ 218 - 18
src/views/batchRecord/components/editModal.vue

@@ -275,6 +275,70 @@
           </el-col>
         </el-row>
 
+        <header-title
+          v-if="
+            form.reportWorkType == '2' && form.produceTaskId && form.pickDetails
+          "
+          title="物品清单"
+          style="margin-top: 20px"
+        ></header-title>
+
+        <ele-pro-table
+          v-if="
+            form.reportWorkType == '2' && form.produceTaskId && form.pickDetails
+          "
+          ref="table"
+          row-key="id"
+          :columns="materialColumns"
+          :datasource="form.pickDetails"
+          cache-key="prenatal-examination-material-list-table-2510231107"
+          autoAmendPage
+          :needPage="false"
+          @refresh="getListByWorkOrderId"
+        >
+          <!-- <template v-slot:toolbar>
+            <el-button type="primary" @click="openMaterialModal"
+              >添加物料</el-button
+            >
+          </template> -->
+
+          <!-- <template v-slot:reportQuantity="{ row }">
+            <el-input-number
+              size="small"
+              v-model.number="row.reportQuantity"
+              controls-position="right"
+              :min="0"
+              :max="row.feedQuantity"
+            ></el-input-number>
+          </template>
+          <template v-slot:qualifiedQuantity="{ row }">
+            <el-input-number
+              size="small"
+              v-model.number="row.qualifiedQuantity"
+              controls-position="right"
+              :min="0"
+              :max="qualifiedQuantityMax(row)"
+            ></el-input-number>
+          </template>
+          <template v-slot:noQualifiedQuantity="{ row }">
+            <el-input-number
+              size="small"
+              v-model.number="row.noQualifiedQuantity"
+              controls-position="right"
+              :min="0"
+              :max="noQualifiedQuantityMax(row)"
+            ></el-input-number>
+          </template>
+          <template v-slot:msg="{ row }">
+            <el-input
+              v-model="row.msg"
+              type="textarea"
+              rows="1"
+              autosize
+            ></el-input>
+          </template> -->
+        </ele-pro-table>
+
         <header-title
           v-if="form.executeMethod == 2"
           title="检查项目"
@@ -375,19 +439,6 @@
             </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
@@ -525,13 +576,15 @@
   import programRulesDialog from '@/views/produce/components/prenatalExamination/programRulesDialog.vue';
   import releaseRulesDialog from '@/views/produce/components/prenatalExamination/releaseRulesDialog.vue';
   import taskDialog from '@/views/produce/components/prenatalExamination/taskDialog.vue';
-  import { saveOrUpdate } from '@/api/producetaskrecordrulesrecord/index';
   import { getById } from '@/api/produceOrder/index.js';
   import EquipmentDialog from './EquipmentDialog.vue';
   import { recordRulesDetailPage } from '@/api/recordRules/index.js';
   import SelectUser from '@/components/select/SelectUser/index.vue';
   import toolModal from './toolModal.vue';
-  import { getById as producetaskrulerecordGetById } from '@/api/producetaskrecordrulesrecord/index.js';
+  import {
+    getById as producetaskrulerecordGetById,
+    queryListByWorkOrderId
+  } from '@/api/producetaskrecordrulesrecord/index.js';
   import bpmDetail from '@/views/bpm/processInstance/detail.vue';
   import bpmTask from '@/components/bpmTask/bpmTask.vue';
 
@@ -609,7 +662,9 @@
         // 是否临时执行
         isTempRecord: 1,
         // 记录规则详情
-        details: []
+        details: [],
+        // 物品清单
+        pickDetails: []
       };
 
       return {
@@ -695,7 +750,138 @@
           { key: 'main', name: '事项信息' },
           { key: 'bpm', name: '流程详情' }
         ],
-        activeComp: 'main'
+        activeComp: 'main',
+        // 物料清单表头
+        materialColumns: [
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center'
+          },
+          {
+            label: '领料类型',
+            prop: 'categoryLevelNamePath',
+            minWidth: 120
+          },
+          {
+            label: '物料编码',
+            prop: 'categoryCode',
+            minWidth: 120
+          },
+          {
+            label: '物料名称',
+            prop: 'categoryName',
+            minWidth: 120
+          },
+          {
+            label: '工序名称',
+            prop: 'produceTaskName',
+            minWidth: 120
+          },
+          {
+            label: '领料数量',
+            prop: 'pickQuantity',
+            minWidth: 120,
+            formatter: (row) => {
+              return (row.pickQuantity || 0) + (row.pickUnit || '');
+            }
+          },
+          {
+            label: '出库数量',
+            prop: 'outStorageQuantity',
+            minWidth: 120,
+            formatter: (row) => {
+              return (row.outStorageQuantity || 0) + (row.outStorageUnit || '');
+            }
+          },
+          {
+            label: '投料数量',
+            prop: 'feedQuantity',
+            minWidth: 120,
+            formatter: (row) => {
+              return (row.feedQuantity || 0) + (row.feedUnit || '');
+            }
+          },
+          {
+            label: '当次报工数量',
+            prop: 'reportQuantity',
+            minWidth: 160,
+            slot: 'reportQuantity',
+            formatter: (row) => {
+              return (
+                (row.reportQuantity == null ? '' : row.reportQuantity) +
+                (row.feedUnit || '')
+              );
+            }
+          },
+          {
+            label: '当次合格数量',
+            prop: 'qualifiedQuantity',
+            minWidth: 160,
+            slot: 'qualifiedQuantity',
+            formatter: (row) => {
+              return (
+                (row.qualifiedQuantity == null ? '' : row.qualifiedQuantity) +
+                (row.feedUnit || '')
+              );
+            }
+          },
+          {
+            label: '当次不合格数量',
+            prop: 'noQualifiedQuantity',
+            minWidth: 160,
+            slot: 'noQualifiedQuantity',
+            formatter: (row) => {
+              return (
+                (row.noQualifiedQuantity == null
+                  ? ''
+                  : row.noQualifiedQuantity) + (row.feedUnit || '')
+              );
+            }
+          },
+          {
+            label: '不合格原因',
+            prop: 'msg',
+            minWidth: 160,
+            slot: 'msg'
+          },
+          {
+            label: '已报工数量',
+            prop: 'sumReportQuantity',
+            minWidth: 120,
+            formatter(row) {
+              return (row.sumReportQuantity || 0) + row.feedUnit;
+            }
+          },
+          {
+            label: '未报工数量',
+            prop: 'noReportQuantity',
+            minWidth: 120,
+            formatter(row) {
+              if (row.sumReportQuantity != null) {
+                return row.feedQuantity - row.sumReportQuantity + row.feedUnit;
+              }
+              return `${row.feedQuantity}${row.feedUnit || ''}`;
+            }
+          },
+          {
+            label: '合格总数',
+            prop: 'sumQualifiedQuantity',
+            minWidth: 120,
+            formatter(row) {
+              return (row.sumQualifiedQuantity || 0) + (row.feedUnit || '');
+            }
+          },
+          {
+            label: '不合格总数',
+            prop: 'sumNoQualifiedQuantity',
+            minWidth: 120,
+            formatter(row) {
+              return (row.sumNoQualifiedQuantity || 0) + (row.feedUnit || '');
+            }
+          }
+        ]
       };
     },
     computed: {
@@ -762,6 +948,7 @@
           };
         });
         console.log('this.form', this.form);
+        this.getListByWorkOrderId();
       },
       // 查询规则详情
       async getRulesDetias() {
@@ -803,7 +990,7 @@
         this.form.ruleName = '';
         this.form.details = [];
         this.$nextTick(() => {
-          this.$refs.formRef.clearValidate()
+          this.$refs.formRef.clearValidate();
         });
       },
       // 去选择设备
@@ -1036,6 +1223,19 @@
       clearTool(row) {
         row.tools = [];
         row.toolNames = '';
+      },
+      async getListByWorkOrderId() {
+        if (!this.form.produceTaskId) return;
+        // 查询物料信息
+        const materialList = await queryListByWorkOrderId({
+          workOrderId: this.form.workOrderId,
+          recordId: this.form.id,
+          produceTaskId: this.form.produceTaskId,
+          ruleId: this.form.ruleId
+        });
+
+        console.log('materialList 物料信息', materialList);
+        this.form.pickDetails = materialList;
       }
     }
   };

+ 6 - 1
src/views/batchRecord/components/list.vue

@@ -198,7 +198,7 @@
             }
           },
           {
-            label: '执行方式',
+            label: '配置执行方式',
             prop: 'executeMethod',
             minWidth: 150,
             formatter: (row) => {
@@ -213,6 +213,11 @@
               return row.ruleName || row.itemTaskName;
             }
           },
+          {
+            label: '记录执行方式',
+            prop: 'recordRulesExecuteMethodName',
+            minWidth: 180
+          },
           {
             label: '状态',
             minWidth: 80,

+ 1 - 1
src/views/produce/components/footBtn.vue

@@ -299,7 +299,7 @@
           if (this.isPreProductionResult) {
             for (let key in this.isPreProductionResult) {
               let obj = this.disableObj[key];
-              if (!this.isPreProductionResult[key]) {
+              if (!this.isPreProductionResult[key] && obj) {
                 // 未完成
                 if (obj.buts.includes(i.name) && !i.disable) {
                   return {

+ 12 - 1
src/views/produce/components/prenatalExamination/index.vue

@@ -2,7 +2,7 @@
   <el-dialog
     title="报工"
     :visible.sync="dialogVisible"
-    width="500px"
+    width="600px"
     :before-close="handleClose"
   >
     <div>
@@ -22,6 +22,8 @@
         >
           <div class="circle">{{ index + 1 }}</div>
           <div class="desc">{{ item.ruleName || item.itemTaskName }}</div>
+          <div class="methods">{{ item.recordRulesExecuteMethodName }}</div>
+
           <el-button
             :type="item.executeStatus == 0 ? 'primary' : 'default'"
             class="status-btn"
@@ -194,6 +196,15 @@
       flex: 1;
       font-size: 14px;
       color: #333;
+      max-width: 300px;
+      white-space: pre-line;
+      word-break: break-all;
+    }
+
+    .methods {
+      max-width: 90px;
+      white-space: pre-line;
+      word-break: break-all;
     }
 
     .status-btn {

+ 29 - 60
src/views/produce/components/prenatalExamination/releaseRulesDialog.vue

@@ -174,7 +174,7 @@
                 <div style="width: 40px; box-sizing: border-box">
                   <el-form-item>
                     <DictSelection
-                      dictName="单位"
+                      dictName="检查有效期单位"
                       clearable
                       v-model="addForm.checkValidityUnit"
                       placeholder="单位"
@@ -189,6 +189,15 @@
         </el-col>
       </el-row>
       <el-row>
+        <el-col v-if="addForm.recordRulesExecuteMethodName" :span="8">
+          <el-form-item label="执行方式" required>
+            <el-input
+              v-model="addForm.recordRulesExecuteMethodName"
+              placeholder="自动带出"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
         <el-col :span="8">
           <el-form-item label="结论" required prop="conclution">
             <el-radio-group
@@ -269,26 +278,12 @@
       }`"
     ></header-title>
 
-    <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"
-      >
-      </el-tab-pane>
-    </el-tabs>
-
     <ele-pro-table
       v-loading="loading"
       ref="table"
       row-key="id"
       :columns="detailsColumns"
-      :datasource="rulesDetails"
+      :datasource="addForm.details"
       cacheKey="mes-releaseRulesDialong-2510281408"
       :needPage="false"
     >
@@ -372,9 +367,7 @@
       >
       <template v-slot:checkResult="{ row }">
         <div>
-          <el-radio-group
-            v-model="row.checkResult"
-          >
+          <el-radio-group v-model="row.checkResult">
             <el-radio :label="1">合格</el-radio>
             <el-radio :label="0">不合格</el-radio>
           </el-radio-group>
@@ -456,9 +449,12 @@
   import { getTeam } from '@/api/produce/job.js';
   import materialModal from './materialModal.vue';
   import { getFactoryarea } from '@/api/aps/index';
+  import dictMixins from '@/mixins/dictMixins';
+  import tableColumnsMixin from '@/mixins/tableColumnsMixin';
 
   export default {
     components: { SelectUser, toolModal, materialModal },
+    mixins: [dictMixins, tableColumnsMixin],
     emits: ['reload'],
     props: {
       isTempRecord: {
@@ -528,7 +524,9 @@
         // 班组id
         teamId: '',
         // 物料字段name
-        pickDetails: []
+        pickDetails: [],
+        recordRulesExecuteMethodId: null,
+        recordRulesExecuteMethodName: ''
       };
 
       return {
@@ -730,25 +728,19 @@
             }
           }
         ],
-        activeExecuteMethodTitle: '',
-        executeMethodTitleList: [],
         workshopAreaList: []
       };
     },
     computed: {
       title() {
-        if (this.ruleInfo) {
-          switch (this.ruleInfo.classify) {
-            case 1:
-              return '清场清洁类记录表';
-            case 2:
-              return '车间环境类记录表';
-
-            default:
-              return '设备检测类记录表';
-          }
+        if (this.addForm.recordRulesClassify) {
+          const dictValue = this.getDictValue(
+            '记录规则类型',
+            this.addForm.recordRulesClassify
+          );
+          return dictValue + '记录表';
         }
-        return '记录表';
+        return '记录表';
       },
       activeTeamUserList() {
         return this.teamUserList.filter((user) =>
@@ -815,14 +807,6 @@
           });
         }
         return list;
-      },
-      rulesDetails() {
-        if (this.executeMethodTitleList.length) {
-          return this.addForm.details.filter(
-            (item) => item.executeMethodTitle == this.activeExecuteMethodTitle
-          );
-        }
-        return this.addForm.details;
       }
     },
     mounted() {
@@ -868,6 +852,10 @@
           this.addForm.workOrderCode = workOrderInfo.code;
           this.addForm.workOrderId = workOrderInfo.id;
           this.addForm.brandNo = productionInfo.brandNo;
+          this.addForm.recordRulesExecuteMethodId =
+            productionInfo.recordRulesExecuteMethodId;
+          this.addForm.recordRulesExecuteMethodName =
+            productionInfo.recordRulesExecuteMethodName;
 
           // 临时添加存在规则详情
 
@@ -908,16 +896,6 @@
           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(
@@ -994,21 +972,12 @@
             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;