Преглед изворни кода

Merge branch 'dev' into test

xieyong пре 1 месец
родитељ
комит
08974f4629

+ 19 - 15
src/views/produce/components/jobBooking/components/batchSemiProductJobBom.vue

@@ -384,7 +384,7 @@
           style="color: #67c23a"
           @click="openReduceLoss(row, $index)"
           v-if="!row.extInfo.isLoss && item.currentTaskDiagram.isFirstTask != 1"
-          >减损</el-link
+          >增加</el-link
         >
 
         <el-link
@@ -423,7 +423,7 @@
             )
           "
           v-else-if="row.extInfo.isLoss == 3"
-          >减损撤回</el-link
+          >撤回</el-link
         >
         <el-link type="warning" @click="getCancle($index)" v-else>取消</el-link>
         <el-link type="danger" @click="getDelete($index)" v-if="!isChoose"
@@ -741,7 +741,7 @@
     </el-dialog>
 
     <el-dialog
-      title="减损数"
+      title="增加数"
       :visible.sync="reduceLossVisible"
       v-if="reduceLossVisible"
       width="30%"
@@ -757,7 +757,7 @@
         <el-form-item label="批次号">
           <el-input v-model="reduceLossForm.batchNo" style="width: 220px"></el-input>
         </el-form-item>
-        <el-form-item label="减损数">
+        <el-form-item label="增加数">
           <el-input
             v-model="reduceLossForm.quantity"
             style="width: 220px"
@@ -1265,13 +1265,13 @@
           {
             minWidth: 100,
             prop: 'extInfo.isLoss',
-            label: '是否损耗',
+            label: '是否增减',
             align: 'center',
             showOverflowTooltip: true,
             formatter: (row) => {
-              if (row.extInfo.isLoss == 3) return '已损耗';
+              if (row.extInfo.isLoss == 3) return '增加';
               return row.extInfo.isLoss && row.extInfo.isLoss == 1
-                ? '是'
+                ? '损耗'
                 : '否';
             }
           },
@@ -1292,7 +1292,7 @@
           {
             columnKey: 'action',
             label: '操作',
-            width: 180,
+            width: 250,
             align: 'center',
             resizable: false,
             slot: 'action',
@@ -2072,8 +2072,8 @@
 
       async getReduceLossParam() {
         if (this.reduceLossForm.quantity) {
-          if (Number(this.reduceLossData.feedQuantity) == 0) {
-            this.$message.warning('减损数不能为0');
+          if (Number(this.reduceLossData.feedQuantity) <= 0) {
+            this.$message.warning('增加数不能小于0');
             return;
           }
 
@@ -2081,7 +2081,7 @@
             Number(this.reduceLossData.feedQuantity) <
             Number(this.reduceLossForm.quantity)
           ) {
-            this.$message.warning('减损数不能大于数量');
+            this.$message.warning('增加数不能大于数量');
             return;
           }
 
@@ -2100,20 +2100,24 @@
             });
 
             if (dataList.length != 0) {
-              this.refreshReduceLossData(dataList);
+              this.refreshReduceLossData(dataList,'add');
             }
           });
         }
         this.reduceLossVisible = false;
       },
 
-      refreshReduceLossData(list) {
+      refreshReduceLossData(list,type) {
         const number = this.sub(
           Number(this.list[this.reduceLossIndex].feedQuantity),
           Number(this.reduceLossForm.quantity)
         );
-        this.list[this.reduceLossIndex].extInfo.sourceQuantity = number;
-        this.list[this.reduceLossIndex].feedQuantity = number;
+        
+        if(!type) {
+          this.list[this.reduceLossIndex].extInfo.sourceQuantity = number;
+          this.list[this.reduceLossIndex].feedQuantity = number;
+        }
+        
         this.list[this.reduceLossIndex].extInfo.newWeight =
           (Number(this.list[this.reduceLossIndex].extInfo.newWeight) * 100000) /
             100000 -

+ 5 - 4
src/views/produce/components/jobBooking/components/jobBom.vue

@@ -265,9 +265,6 @@
               ? product.filter((it) => it.confirm == 1)
               : product;
 
-            const isLoss = (item) =>
-              item.extInfo.isLoss == 1 || item.extInfo.isLoss == 3;
-
             const isFormed = (item) => {
               const { isQualified, notType } = item.extInfo;
               return (
@@ -285,8 +282,12 @@
               (acc, item) => {
                 const qty = getQty(item);
 
-                if (isLoss(item)) {
+                if (item.extInfo.isLoss == 1) {
+                  // 损耗计入损耗数量
                   acc.lossNum = this.add(acc.lossNum, qty);
+                } else if (item.extInfo.isLoss == 3) {
+                  // 增加: formedNum 增加(在合格品数量上添加输入的数量)
+                  acc.formedNum = this.add(acc.formedNum, qty);
                 } else if (isFormed(item)) {
                   acc.formedNum = this.add(acc.formedNum, qty);
                 } else {

+ 32 - 21
src/views/produceOrder/workReport.vue

@@ -101,12 +101,7 @@
                       @click="handIdx(row.flatIndex, row.item)"
                     >
                       <div class="route-node-name">
-                        {{ row.item.taskTypeName
-                        }}<span
-                          v-if="row.flatIndex === desIndex"
-                          class="route-node-tag"
-                          >此处</span
-                        >
+                        {{ row.item.taskTypeName }}
                       </div>
                       <div
                         v-if="showTaskTeamName(row.item)"
@@ -115,6 +110,10 @@
                         {{ getTaskTeamName(row.item) }}
                       </div>
                     </div>
+                    <span
+                      v-if="row.flatIndex === desIndex"
+                      class="route-node-tag"
+                    >此处</span>
                   </div>
                 </div>
               </div>
@@ -443,7 +442,7 @@
         activeIndex: 0,
         desIndex: 0,
         errorIndex: 10000,
-        stepNodeH: 50, // 每个工序节点的行高
+        stepNodeH: 38, // 每个工序节点的行高
         stepConnectorW: 12, // 列间连接线 SVG 的最小宽度
         connectorViewW: 56, // 连接线 SVG 的实际宽度(自适应测量)
         drawer: false,
@@ -1916,9 +1915,12 @@
   }
 
   .route-node-row {
+    position: relative;
     display: flex;
     align-items: center;
     justify-content: center;
+    width: 100px;
+    box-sizing: border-box;
   }
 
   .route-node {
@@ -1926,15 +1928,18 @@
     flex-direction: column;
     align-items: center;
     justify-content: center;
-    min-width: 84px;
-    max-width: 160px;
-    min-height: 38px;
-    padding: 3px 12px;
+    width: 100%;
+    height: 100%;
+    min-width: 0;
+    max-width: none;
+    min-height: 0;
+    padding: 2px 8px;
     background: #ffffff;
     border: 2px solid #c0c4cc;
     border-radius: 2px;
     cursor: pointer;
     box-sizing: border-box;
+    overflow: hidden;
     transition: border-color 0.2s, box-shadow 0.2s;
 
     &:hover {
@@ -1969,10 +1974,13 @@
 
   // 并行工序节点(isParallel == 1):更紧凑
   .route-node.is-compact {
-    min-width: 64px;
-    max-width: 110px;
-    min-height: 28px;
-    padding: 1px 8px;
+    width: 100%;
+    height: 100%;
+    min-width: 0;
+    max-width: none;
+    min-height: 0;
+    padding: 1px 6px;
+    overflow: hidden;
 
     .route-node-name {
       font-size: 12px;
@@ -1989,9 +1997,9 @@
   }
 
   .route-node-name {
-    font-size: 13px;
+    font-size: 12px;
     font-weight: 500;
-    line-height: 1.35;
+    line-height: 1.3;
     color: #303133;
     text-align: center;
     word-break: break-all;
@@ -2000,22 +2008,25 @@
   .route-node-team {
     margin-top: 2px;
     color: #606266;
-    font-size: 11px;
+    font-size: 10px;
     line-height: 1.2;
     text-align: center;
     word-break: break-all;
   }
 
   .route-node-tag {
-    display: inline-block;
-    margin-left: 4px;
+    position: absolute;
+    top: 100%;
+    left: 50%;
+    transform: translateX(-50%);
+    margin-top: 6px;
     padding: 0 6px;
     font-size: 11px;
     line-height: 16px;
     color: #ffffff;
     background: #1890ff;
     border-radius: 8px;
-    vertical-align: middle;
+    white-space: nowrap;
   }
 
   ::v-deep .el-tabs__content {