Browse Source

修改bug

695593266@qq.com 2 months ago
parent
commit
c8d583e057

+ 3 - 3
manifest.json

@@ -2,7 +2,7 @@
     "name" : "智慧工厂",
     "appid" : "__UNI__45B3907",
     "description" : "",
-    "versionName" : "V1.0.3.58",
+    "versionName" : "V1.0.3.62",
     "versionCode" : "100",
     "transformPx" : false,
     "h5" : {
@@ -10,13 +10,13 @@
             "proxy" : {
                 "/api" : {
                     // "target" : "http://192.168.1.110:18086/",
-                    "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://110.41.182.105/api/",
                     // "target": "http://116.63.185.248:80/api",
                     // "target" : "http://192.168.1.251:18186/",
-                    // "target" : "http://aiot.zoomwin.com.cn:51007/api",
+                    "target" : "http://aiot.zoomwin.com.cn:51001/api",
                     "changeOrigin" : true,
                     "secure" : false,
                     "pathRewrite" : {

+ 100 - 15
pages/home/wt/components/outStorageWarehouseApply/taskForm.vue

@@ -195,7 +195,13 @@
             <view class="label">包装数量:</view>
           </u-col>
           <u-col span="9">
-            <view class="value">{{ row.packingQuantityDisplay || "—" }}</view>
+            <view class="value">{{
+              formatValueWithUnit(
+                row.packingQuantityDisplay,
+                row.packingQuantity,
+                row.packingUnit,
+              )
+            }}</view>
           </u-col>
         </u-row>
         <u-row>
@@ -203,7 +209,13 @@
             <view class="label">计量数量:</view>
           </u-col>
           <u-col span="9">
-            <view class="value">{{ row.measureQuantityDisplay || "—" }}</view>
+            <view class="value">{{
+              formatValueWithUnit(
+                row.measureQuantityDisplay,
+                row.measureQuantity,
+                row.measureUnit,
+              )
+            }}</view>
           </u-col>
         </u-row>
         <u-row>
@@ -211,7 +223,9 @@
             <view class="label">重量:</view>
           </u-col>
           <u-col span="9">
-            <view class="value">{{ row.weightDisplay || "—" }}</view>
+            <view class="value">{{
+              formatValueWithUnit(row.weightDisplay, row.weight, row.weightUnit)
+            }}</view>
           </u-col>
         </u-row>
         <u-row>
@@ -319,7 +333,13 @@
             <view class="label">包装数量:</view>
           </u-col>
           <u-col span="9">
-            <view class="value">{{ row.packingQuantityDisplay || "—" }}</view>
+            <view class="value">{{
+              formatValueWithUnit(
+                row.packingQuantityDisplay,
+                row.packingQuantity,
+                row.packingUnit,
+              )
+            }}</view>
           </u-col>
         </u-row>
         <u-row>
@@ -327,7 +347,13 @@
             <view class="label">计量数量:</view>
           </u-col>
           <u-col span="9">
-            <view class="value">{{ row.measureQuantityDisplay || "—" }}</view>
+            <view class="value">{{
+              formatValueWithUnit(
+                row.measureQuantityDisplay,
+                row.measureQuantity,
+                row.measureUnit,
+              )
+            }}</view>
           </u-col>
         </u-row>
         <u-row>
@@ -335,7 +361,9 @@
             <view class="label">重量:</view>
           </u-col>
           <u-col span="9">
-            <view class="value">{{ row.weightDisplay || "—" }}</view>
+            <view class="value">{{
+              formatValueWithUnit(row.weightDisplay, row.weight, row.weightUnit)
+            }}</view>
           </u-col>
         </u-row>
         <u-row>
@@ -571,6 +599,12 @@ export default {
     this.updateStickyPlaceholderHeight();
   },
   methods: {
+    padNumber(n) {
+      return n < 10 ? `0${n}` : String(n);
+    },
+    arrayIncludes(list, value) {
+      return Array.isArray(list) && list.indexOf(value) !== -1;
+    },
     initStickyTop() {
       try {
         const systemInfo = uni.getSystemInfoSync();
@@ -603,6 +637,16 @@ export default {
       return val || "—";
     },
 
+    formatValueWithUnit(displayValue, value, unit) {
+      if (displayValue || displayValue === 0 || displayValue === "0") {
+        return String(displayValue);
+      }
+      if (value === null || value === undefined || value === "") {
+        return "—";
+      }
+      return `${value}${unit || ""}`;
+    },
+
     async loadAssetTypeMapping() {
       try {
         const data = await allCategoryLevel();
@@ -678,7 +722,7 @@ export default {
 
     getNowFormatDate() {
       const now = new Date();
-      const pad = (n) => String(n).padStart(2, "0");
+      const pad = (n) => this.padNumber(n);
       this.formData.storageTime = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())} ${pad(now.getHours())}:${pad(now.getMinutes())}:${pad(now.getSeconds())}`;
     },
 
@@ -864,7 +908,7 @@ export default {
             brandNum: item.brandNum || "",
             batchNo: this.isDetail
               ? detail.batchNo || batchNo
-              : [1, 3, 6].includes(this.bizType)
+              : this.arrayIncludes([1, 3, 6], this.bizType)
                 ? detailList[0]?.batchNo || batchNo
                 : batchNo,
             packingQuantity,
@@ -905,6 +949,7 @@ export default {
         });
 
         await this.buildPackingList(batchNo);
+        console.log("this.productList", this.productList);
         this.formData.outInDetailList = this.productList;
       } catch (e) {
         console.warn("初始化产品数据失败", e);
@@ -960,9 +1005,9 @@ export default {
         ];
       });
 
-      this.packingList = this.productList.flatMap(
-        (p) => p.outInDetailRecordRequestList,
-      );
+      this.packingList = this.productList.reduce((list, product) => {
+        return list.concat(product.outInDetailRecordRequestList || []);
+      }, []);
       this.formData.outInDetailList = this.productList;
     },
 
@@ -1008,14 +1053,14 @@ export default {
 
     _getNowDateStr() {
       const now = new Date();
-      const pad = (n) => String(n).padStart(2, "0");
+      const pad = (n) => this.padNumber(n);
       return `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())} ${pad(now.getHours())}:${pad(now.getMinutes())}:${pad(now.getSeconds())}`;
     },
 
     _isNonSplitUnit(unit) {
       if (!unit) return false;
       const u = unit.toUpperCase();
-      return ["KG", "G", "L", "ML"].includes(u) || unit === "立方";
+      return this.arrayIncludes(["KG", "G", "L", "ML"], u) || unit === "立方";
     },
 
     async buildPackingList(batchNo) {
@@ -1220,9 +1265,24 @@ export default {
                 modelKey: product.modelKey || "",
                 colorKey: product.colorKey || "",
                 packingUnit: packingUnit,
+                packingQuantityDisplay: this.formatValueWithUnit(
+                  "",
+                  packingQuantity,
+                  packingUnit,
+                ),
                 measureQuantity: measureQuantity,
                 measureUnit: measureUnit,
+                measureQuantityDisplay: this.formatValueWithUnit(
+                  "",
+                  measureQuantity,
+                  measureUnit,
+                ),
                 weight: weight,
+                weightDisplay: this.formatValueWithUnit(
+                  "",
+                  weight,
+                  product.weightUnit || "",
+                ),
                 packingSpecificationOption:
                   product.packingSpecificationOption || [],
                 weightUnit: product.weightUnit || "",
@@ -1254,8 +1314,18 @@ export default {
               if (remainder > 0 && packingEntries.length > 0) {
                 const lastEntry = packingEntries[packingEntries.length - 1];
                 lastEntry.measureQuantity = remainder;
+                lastEntry.measureQuantityDisplay = this.formatValueWithUnit(
+                  "",
+                  remainder,
+                  lastEntry.measureUnit,
+                );
                 if (product.singleWeight) {
                   lastEntry.weight = product.singleWeight * remainder;
+                  lastEntry.weightDisplay = this.formatValueWithUnit(
+                    "",
+                    lastEntry.weight,
+                    lastEntry.weightUnit,
+                  );
                 }
               }
             }
@@ -1341,12 +1411,27 @@ export default {
               "",
             packingQuantity: 1,
             packingUnit: item.packingUnit || "",
+            packingQuantityDisplay: this.formatValueWithUnit(
+              "",
+              1,
+              item.packingUnit || "",
+            ),
             measureQuantity: item.quantity || item.measureQuantity || 0,
             measureUnit: item.measuringUnit || item.measureUnit || "",
+            measureQuantityDisplay: this.formatValueWithUnit(
+              "",
+              item.quantity || item.measureQuantity || 0,
+              item.measuringUnit || item.measureUnit || "",
+            ),
             supplierCode: item.supplierCode || "",
             supplierId: item.supplierId || "",
             supplierName: item.supplierName || "",
             weight: item.packingWeight || 0,
+            weightDisplay: this.formatValueWithUnit(
+              "",
+              item.packingWeight || 0,
+              item.weightUnit || product0.weightUnit || "",
+            ),
             singleWeight: item.singleWeight || 0,
             pricingWay: item.pricingWay || "",
             weightUnit: item.weightUnit || product0.weightUnit || "",
@@ -1391,7 +1476,7 @@ export default {
       const _packingList = this.packingList.map((packingItem) => {
         let _workOrderId = null;
         let _taskId = null;
-        if ([1].includes(this.bizType)) {
+        if (this.arrayIncludes([1], this.bizType)) {
           _workOrderId = detailList[0]?.workOrderId;
           _taskId = detailList[0]?.taskId;
         }
@@ -1443,7 +1528,7 @@ export default {
         const ids = item.warehouseIds || [];
         const names = item.warehouseNames || [];
         ids.forEach((id, idx) => {
-          if (id && !warehouseId.includes(id)) {
+          if (id && warehouseId.indexOf(id) === -1) {
             warehouseId.push(id);
             warehouseName.push(names[idx] || "");
           }

+ 84 - 6
pages/home/wt/components/productionWarehousing/taskForm.vue

@@ -195,7 +195,13 @@
             <view class="label">包装数量:</view>
           </u-col>
           <u-col span="9">
-            <view class="value">{{ row.packingQuantityDisplay || "—" }}</view>
+            <view class="value">{{
+              formatValueWithUnit(
+                row.packingQuantityDisplay,
+                row.packingQuantity,
+                row.packingUnit,
+              )
+            }}</view>
           </u-col>
         </u-row>
         <u-row>
@@ -203,7 +209,13 @@
             <view class="label">计量数量:</view>
           </u-col>
           <u-col span="9">
-            <view class="value">{{ row.measureQuantityDisplay || "—" }}</view>
+            <view class="value">{{
+              formatValueWithUnit(
+                row.measureQuantityDisplay,
+                row.measureQuantity,
+                row.measureUnit,
+              )
+            }}</view>
           </u-col>
         </u-row>
         <u-row>
@@ -211,7 +223,9 @@
             <view class="label">重量:</view>
           </u-col>
           <u-col span="9">
-            <view class="value">{{ row.weightDisplay || "—" }}</view>
+            <view class="value">{{
+              formatValueWithUnit(row.weightDisplay, row.weight, row.weightUnit)
+            }}</view>
           </u-col>
         </u-row>
         <u-row>
@@ -319,7 +333,13 @@
             <view class="label">包装数量:</view>
           </u-col>
           <u-col span="9">
-            <view class="value">{{ row.packingQuantityDisplay || "—" }}</view>
+            <view class="value">{{
+              formatValueWithUnit(
+                row.packingQuantityDisplay,
+                row.packingQuantity,
+                row.packingUnit,
+              )
+            }}</view>
           </u-col>
         </u-row>
         <u-row>
@@ -327,7 +347,13 @@
             <view class="label">计量数量:</view>
           </u-col>
           <u-col span="9">
-            <view class="value">{{ row.measureQuantityDisplay || "—" }}</view>
+            <view class="value">{{
+              formatValueWithUnit(
+                row.measureQuantityDisplay,
+                row.measureQuantity,
+                row.measureUnit,
+              )
+            }}</view>
           </u-col>
         </u-row>
         <u-row>
@@ -335,7 +361,9 @@
             <view class="label">重量:</view>
           </u-col>
           <u-col span="9">
-            <view class="value">{{ row.weightDisplay || "—" }}</view>
+            <view class="value">{{
+              formatValueWithUnit(row.weightDisplay, row.weight, row.weightUnit)
+            }}</view>
           </u-col>
         </u-row>
         <u-row>
@@ -603,6 +631,16 @@ export default {
       return val || "—";
     },
 
+    formatValueWithUnit(displayValue, value, unit) {
+      if (displayValue || displayValue === 0 || displayValue === "0") {
+        return String(displayValue);
+      }
+      if (value === null || value === undefined || value === "") {
+        return "—";
+      }
+      return `${value}${unit || ""}`;
+    },
+
     async loadAssetTypeMapping() {
       try {
         const data = await allCategoryLevel();
@@ -1217,12 +1255,27 @@ export default {
                 batchNo: product.batchNo || batchNo,
                 packageNo: packageNos[i]?.onlyCode || "",
                 packingQuantity: packingQuantity,
+                packingQuantityDisplay: this.formatValueWithUnit(
+                  "",
+                  packingQuantity,
+                  packingUnit,
+                ),
                 modelKey: product.modelKey || "",
                 colorKey: product.colorKey || "",
                 packingUnit: packingUnit,
                 measureQuantity: measureQuantity,
                 measureUnit: measureUnit,
+                measureQuantityDisplay: this.formatValueWithUnit(
+                  "",
+                  measureQuantity,
+                  measureUnit,
+                ),
                 weight: weight,
+                weightDisplay: this.formatValueWithUnit(
+                  "",
+                  weight,
+                  product.weightUnit || "",
+                ),
                 packingSpecificationOption:
                   product.packingSpecificationOption || [],
                 weightUnit: product.weightUnit || "",
@@ -1254,8 +1307,18 @@ export default {
               if (remainder > 0 && packingEntries.length > 0) {
                 const lastEntry = packingEntries[packingEntries.length - 1];
                 lastEntry.measureQuantity = remainder;
+                lastEntry.measureQuantityDisplay = this.formatValueWithUnit(
+                  "",
+                  remainder,
+                  lastEntry.measureUnit,
+                );
                 if (product.singleWeight) {
                   lastEntry.weight = product.singleWeight * remainder;
+                  lastEntry.weightDisplay = this.formatValueWithUnit(
+                    "",
+                    lastEntry.weight,
+                    lastEntry.weightUnit,
+                  );
                 }
               }
             }
@@ -1341,12 +1404,27 @@ export default {
               "",
             packingQuantity: 1,
             packingUnit: item.packingUnit || "",
+            packingQuantityDisplay: this.formatValueWithUnit(
+              "",
+              1,
+              item.packingUnit || "",
+            ),
             measureQuantity: item.quantity || item.measureQuantity || 0,
             measureUnit: item.measuringUnit || item.measureUnit || "",
+            measureQuantityDisplay: this.formatValueWithUnit(
+              "",
+              item.quantity || item.measureQuantity || 0,
+              item.measuringUnit || item.measureUnit || "",
+            ),
             supplierCode: item.supplierCode || "",
             supplierId: item.supplierId || "",
             supplierName: item.supplierName || "",
             weight: item.packingWeight || 0,
+            weightDisplay: this.formatValueWithUnit(
+              "",
+              item.packingWeight || 0,
+              item.weightUnit || product0.weightUnit || "",
+            ),
             singleWeight: item.singleWeight || 0,
             pricingWay: item.pricingWay || "",
             weightUnit: item.weightUnit || product0.weightUnit || "",

+ 12 - 3
pages/pda/picking/bill/components/outInstanceBom.vue

@@ -69,11 +69,16 @@ import { tableHeader } from "./outCommon.js";
 import { queryOutWordDetail } from "@/api/pda/picking.js";
 import { typeName } from "@/pages/pda/feeding/common.js";
 export default {
-  props: ["item"],
+  props: {
+    item: {
+      type: Object,
+      default: () => ({}),
+    },
+  },
   data() {
     return {
       typeName,
-      outWorkList: null,
+      outWorkList: [],
     };
   },
 
@@ -83,10 +88,14 @@ export default {
 
   methods: {
     async getOutWorkList() {
+      if (!this.item?.pickOrderId) {
+        this.outWorkList = [];
+        return;
+      }
       await queryOutWordDetail({
         pickOrderId: this.item.pickOrderId,
       }).then((res) => {
-        this.outWorkList = res;
+        this.outWorkList = Array.isArray(res) ? res : [];
       });
     },
 

+ 25 - 8
pages/pda/picking/bill/index.vue

@@ -5,10 +5,11 @@
       statusBar="true"
       left-icon="back"
       :title="title"
-      background-color="#F7F9FA"
-      color="#000"
+      background-color="#157A2C"
+      color="#fff"
       @clickLeft="back"
     ></uni-nav-bar>
+    <!-- <view class="nav-placeholder"></view> -->
 
     <view class="list_box" v-for="(item, idx) in dataList" :key="idx">
       <view class="card_box cx-sc">
@@ -16,7 +17,7 @@
           <view class="item">
             <view class="lable rx-cc" style="color: #157a2c">领料单号</view>
             <view class="content rx-bc" style="color: #157a2c">
-              {{ item.code }}
+              {{ pickOrderCodeSafe(item) }}
             </view>
           </view>
           <view class="item">
@@ -180,7 +181,7 @@ export default {
     return {
       ids: [],
       dataList: [],
-      title: null,
+      title: "",
       status: 1,
       item: null,
     };
@@ -188,7 +189,8 @@ export default {
 
   onLoad(option) {
     this.status = option.status || 1;
-    console.log(option.id, "optionoptionoption");
+    console.log(option.status, "optionoptionoption");
+
     if (option.item) {
       this.title =
         option.status == 1 ? "领料详情" : option.status == 2 ? " 出库详情" : "";
@@ -200,6 +202,7 @@ export default {
           ? [parsed]
           : [];
     } else {
+      this.title = "领料详情";
       this.ids = [option.id];
       this.getList();
     }
@@ -264,6 +267,15 @@ export default {
       console.log(item, "itemitemitem");
       return Array.isArray(item?.detailList) ? item.detailList : [];
     },
+    pickOrderCodeSafe(item) {
+      return (
+        item?.code ||
+        item?.pickCode ||
+        item?.pickOrderCode ||
+        item?.orderCode ||
+        "--"
+      );
+    },
 
     scrolltolower() {},
 
@@ -278,15 +290,20 @@ export default {
 
 <style lang="scss" scoped>
 .content-box {
-  /* 让页面按内容自然撑开,避免内部列表被压缩 */
   min-height: 100vh;
   display: flex;
   flex-direction: column;
+  box-sizing: border-box;
+}
+
+.nav-placeholder {
+  /* 给 fixed 导航栏预留高度,避免真机上首屏第一行被遮住 */
+  height: calc(var(--status-bar-height) + 88rpx);
+  flex-shrink: 0;
 }
 
 .list_box {
-  /* 不再参与 flex 等分高度,每个单据块按内容自适应 */
-  padding: 16rpx 0;
+  padding: 16rpx 0 0;
 }
 
 .bottom-wrapper {

+ 4 - 4
pages/pda/picking/details.vue

@@ -5,8 +5,8 @@
       statusBar="true"
       left-icon="back"
       title="领料"
-      background-color="#F7F9FA"
-      color="#404446"
+      background-color="#157A2C"
+      color="#fff"
       @clickLeft="back"
     ></uni-nav-bar>
     <u-button
@@ -489,7 +489,7 @@ export default {
             this.$set(
               this.List[index][key][i],
               "warehouseId",
-              this.warehouseId
+              this.warehouseId,
             );
           });
         }
@@ -768,7 +768,7 @@ export default {
         this.$set(
           this.List[index].pickList[idx],
           "demandQuantity",
-          Number(item.availableCountBase)
+          Number(item.availableCountBase),
         );
         const idsList = [];
         item.warehouseList.forEach((it) => {

+ 39 - 31
pages/pda/workOrder/extrusionMolding/index.vue

@@ -81,12 +81,12 @@
           <text class="lable">牌号</text>
           <text>{{ info.brandNo }}</text>
         </view>
-		
+
         <view class="item_list rx-bc">
           <text class="lable">规格</text>
           <text>{{ info.specification }}</text>
         </view>
-		
+
         <view class="item_list rx-bc">
           <text class="lable">型号</text>
           <text>{{ info.model }}</text>
@@ -278,15 +278,23 @@ export default {
   },
   computed: {
     isFeedStatus() {
-      const currentStep = this.stepsList?.[this.currentStepIndex]
+      const currentStep = this.stepsList?.[this.currentStepIndex];
       // 投料状态 0未投料 1已投料 2已报工
-      return this.feedStatusOption.find(item => item.value === currentStep?.feedStatus)?.label || ''
+      return (
+        this.feedStatusOption.find(
+          (item) => item.value === currentStep?.feedStatus,
+        )?.label || ""
+      );
     },
     isPickingStatus() {
-      const currentStep = this.stepsList?.[this.currentStepIndex]
+      const currentStep = this.stepsList?.[this.currentStepIndex];
       // 领料状态 0未领料 1领料中2已出库3已驳回
-      return this.pickStatusOption.find(item => item.value === currentStep?.pickStatus)?.label || ''
-    }
+      return (
+        this.pickStatusOption.find(
+          (item) => item.value === currentStep?.pickStatus,
+        )?.label || ""
+      );
+    },
   },
   data() {
     return {
@@ -314,36 +322,36 @@ export default {
       currentStepIndex: 0, // 当前步骤索引
       pickStatusOption: [
         {
-          label: '未领料',
-          value: 0
+          label: "未领料",
+          value: 0,
         },
         {
-          label: '领料中',
-          value: 1
+          label: "领料中",
+          value: 1,
         },
         {
-          label: '已出库',
-          value: 2
+          label: "已出库",
+          value: 2,
         },
         {
-          label: '已驳回',
-          value: 3
-        }
+          label: "已驳回",
+          value: 3,
+        },
       ],
       feedStatusOption: [
         {
-          label: '未投料',
-          value: 0
+          label: "未投料",
+          value: 0,
         },
         {
-          label: '已投料',
-          value: 1
+          label: "已投料",
+          value: 1,
         },
         {
-          label: '已报工',
-          value: 2
-        }
-      ]
+          label: "已报工",
+          value: 2,
+        },
+      ],
     };
   },
 
@@ -411,8 +419,8 @@ export default {
           let id = this.currentTaskId || this.taskId;
 
           if (f.taskId == id) {
-            (this.currentType = f.type),
-              (this.existOutsource = f.existOutsource);
+            ((this.currentType = f.type),
+              (this.existOutsource = f.existOutsource));
             this.controlReportMethod = f.controlReportMethod;
             this.currentStepIndex = f.index;
           }
@@ -428,7 +436,7 @@ export default {
 
     // 点击工序列表
     selectStep(item) {
-      console.log('item', item)
+      console.log("item", item);
       this.currentTaskId = item.taskId;
       this.currentTaskName = item.taskTypeName;
       this.existOutsource = item.existOutsource;
@@ -490,7 +498,7 @@ export default {
           url = "/pages/pda/feeding/details";
           let _arr = JSON.stringify([this.info.id]);
           url += `?arr=${encodeURIComponent(
-            _arr
+            _arr,
           )}&taskId=${taskId}&taskName=${taskName}&type=${type}&feedNeedEquipment=${
             this.feedNeedEquipment
           }`;
@@ -504,7 +512,7 @@ export default {
             url = "/pages/pda/feeding/details";
             let _arr = JSON.stringify([this.info.id]);
             url += `?arr=${encodeURIComponent(
-              _arr
+              _arr,
             )}&taskId=${taskId}&taskName=${taskName}&type=${type}&feedNeedEquipment=${
               this.feedNeedEquipment
             }&taskType=${this.currentType}`;
@@ -513,7 +521,7 @@ export default {
             url = "/pages/pda/feeding/details";
             let _arr = JSON.stringify([this.info.id]);
             url += `?arr=${encodeURIComponent(
-              _arr
+              _arr,
             )}&taskId=${taskId}&taskName=${taskName}&type=${type}&feedNeedEquipment=${
               this.feedNeedEquipment
             }&taskType=${this.currentType}`;
@@ -604,7 +612,7 @@ export default {
         url = "/pages/pda/picking/details";
         let _arr = JSON.stringify([this.info.id]);
         url += `?arr=${encodeURIComponent(
-          _arr
+          _arr,
         )}&taskId=${taskId}&isOutsource=1`;
         uni.navigateTo({
           url,