Procházet zdrojové kódy

物料功能完善

lucw před 7 měsíci
rodič
revize
e83e78880c

+ 21 - 0
src/api/producetaskrecordrulesrecord/index.js

@@ -109,3 +109,24 @@ export async function resetSubmit(body) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+// /mes/workorder/inStoreageRecord
+export async function inStoreageRecord(body) {
+  const res = await request.post('/mes/workorder/inStoreageRecord', body);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// /mes/workorder/listProduceTaskAndFormNum
+export async function listProduceTaskAndFormNum(body) {
+  const res = await request.post(
+    '/mes/workorder/listProduceTaskAndFormNum',
+    body
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 0 - 1
src/views/batchRecord/components/editModal.vue

@@ -523,7 +523,6 @@
           :bomCategoryId="workOrderInfo.bomCategoryId"
           :outputType="form.outputType"
           :categoryId="workOrderInfo.categoryId"
-          :record-id="form.id"
           @refresh="getListByWorkOrderId"
         ></material>
         <header-title

+ 18 - 13
src/views/batchRecord/components/statistics.vue

@@ -273,7 +273,7 @@
           <!-- 公式 -->
           <template v-else-if="row[index].paramType == 9">
             <div style="display: flex">
-              <el-input-number
+              <el-input
                 v-model="row[index].value"
                 :placeholder="
                   row[index].formula
@@ -282,7 +282,7 @@
                 "
                 disabled
                 @input="handleDataChange(row)"
-              ></el-input-number>
+              ></el-input>
               <div style="width: 80px; height: 100%; flex-shrink: 0">
                 <DictSelection
                   v-model="row[index].unit"
@@ -316,10 +316,10 @@
 
 <script>
   import {
-    getAllRoutingTaskList,
-    getPickAndFeed
+    listProduceTaskAndFormNum,
+    getPickAndFeed,
+    inStoreageRecord
   } from '@/api/producetaskrecordrulesrecord/index';
-  import fix from 'highlight.js/lib/languages/fix';
 
   export default {
     props: {
@@ -623,15 +623,20 @@
 
         if (this.workOrderId) {
           // 并发获取工序任务列表和物料数据
-          let [routingTaskObj, pickAndFeedList] = await Promise.all([
-            getAllRoutingTaskList({ routingId: this.routingId }),
-            getPickAndFeed({
-              workOrderId: this.workOrderId,
-              bomCategoryId: this.bomCategoryId
-            })
-          ]);
+          let [routingTaskObj, pickAndFeedList, inStoreageRecordList] =
+            await Promise.all([
+              listProduceTaskAndFormNum({ workOrderId: this.workOrderId }),
+              getPickAndFeed({
+                workOrderId: this.workOrderId,
+                bomCategoryId: this.bomCategoryId
+              }),
+              inStoreageRecord({
+                workOrderId: this.workOrderId
+              })
+            ]);
           pickAndFeed = pickAndFeedList || [];
           routingTaskList = routingTaskObj?.list || [];
+          console.log('inStoreageRecordList', inStoreageRecordList);
         }
 
         console.log('routingTaskList 工序数据', routingTaskList);
@@ -719,7 +724,7 @@
 
             data.unshift({
               title: '工序名称',
-              value: task.taskInstanceName,
+              value: task.name || task.taskInstanceName,
               formula: '',
               unit: '',
               // 仅展示不计算和输入

+ 8 - 0
src/views/produce/components/prenatalExamination/material.vue

@@ -393,6 +393,7 @@
                   let needQuantity =
                     (outputItem.sumReportQuantity + outputItem.reportQuantity) *
                     count;
+                  if (needQuantity < 0) needQuantity = 0;
                   return needQuantity + (row.unit || '');
                 }
               }
@@ -574,6 +575,7 @@
       },
       setMaterialQuotaInfo() {
         console.log('this.materialQuotaInfo', this.materialQuotaInfo);
+
         if (this.materialQuotaInfo && this.materialQuotaInfo.standardOutput) {
           const sumItem = this.sumOutputDetails.find(
             (i) =>
@@ -607,6 +609,8 @@
             }
           ];
           this.$emit('update:outputDetails', this.localOutputDetails);
+        } else {
+          this.$message.warning('未配置BOM标准产出信息');
         }
       },
       // 获取bom的产出清单
@@ -617,6 +621,10 @@
             this.produceTaskId
           );
           console.log('this.materialQuotaInfo', data);
+          if (JSON.stringify(data) === '{}') {
+            this.materialQuotaInfo = null;
+            return;
+          }
           this.materialQuotaInfo = data;
         }
       },