فهرست منبع

去除单位必填

yusheng 10 ماه پیش
والد
کامیت
babc4bfbf6

+ 21 - 6
src/BIZComponents/inventoryTable.vue

@@ -680,11 +680,7 @@
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.' + countObj.unitIdKey"
-          :rules="{
-            required: isTotalCount ? true : false,
-            message: '请选择单位',
-            trigger: 'change'
-          }"
+
         >
           <el-select
             v-model="scope.row[countObj.unitIdKey]"
@@ -1039,7 +1035,7 @@
             prop: 'saleUnit',
             label: '单位',
             slot: 'saleUnit',
-            headerSlot: 'headerTotalCount',
+            // headerSlot: 'headerTotalCount',
             align: 'center'
           },
           {
@@ -1832,6 +1828,25 @@
             'packingSpecification',
             item.extField.packingSpecification
           );
+
+          this.$set(
+            parasm,
+            'packageDispositionList',
+            item.packageDispositionList
+          );
+          if (item.packageDispositionList?.length) {
+            this.$set(
+              parasm,
+              this.countObj.unitIdKey,
+              item.packageDispositionList[0].id
+            );
+            this.$set(
+              parasm,
+              this.countObj.unitKey,
+              item.packageDispositionList[0].conversionUnit
+            );
+          }
+
           this.$set(parasm, 'customerMark', this.customerMark);
           if (item.purchaseOrigins?.length > 0) {
             item.purchaseOrigins = item.purchaseOrigins.map((val) => val + '');

+ 31 - 19
src/BIZComponents/selectStockLedger/selectStockLedgerDialog.vue

@@ -68,7 +68,11 @@
 </template>
 
 <script>
-  import { getOutindetailtwoList, getTreeByGroup } from '@/api/wms';
+  import {
+    getOutindetailtwoList,
+    getTreeByGroup,
+    getCategoryPackageDisposition
+  } from '@/api/wms';
   import ItemSearch from './item-search.vue';
   import { contactQueryByCategoryIdsAPI } from '@/api/saleManage/contact';
 
@@ -257,22 +261,22 @@
         }
       },
       async getSupplierObj(productList, queryName) {
-      try {
-        let categoryIds = productList
-          .filter((item) => item.id)
-          .map((item) => item.id);
-        if (categoryIds.length > 0) {
-          return await contactQueryByCategoryIdsAPI({
-            categoryIds,
-            isQueryEE: 1
-          });
-        } else {
+        try {
+          let categoryIds = productList
+            .filter((item) => item.id)
+            .map((item) => item.id);
+          if (categoryIds.length > 0) {
+            return await contactQueryByCategoryIdsAPI({
+              categoryIds,
+              isQueryEE: 1
+            });
+          } else {
+            return Promise.resolve({});
+          }
+        } catch (e) {
           return Promise.resolve({});
         }
-      } catch (e) {
-        return Promise.resolve({});
-      }
-    },
+      },
       // 单击获取id
       cellClick(row) {
         if (this.currentIndex == -1) return;
@@ -319,14 +323,22 @@
             }
           });
         }
+        let idList = list.map((item) => item.categoryId);
+
+        // 获取包装规格
+        let packingSpecification = await getCategoryPackageDisposition({
+          categoryIds: idList
+        });
+
         list.forEach((item, index) => {
           item.productName = item.categoryName;
           item.productCode = item.categoryCode;
           item.productCategoryName = '';
           item.productBrand = item.brandNum;
-          item.provenance = item.provenance||[];
-          // item.warehouseName = item.warehouseList[0].warehouse_name;
-          // item.warehouseId = item.warehouseList[0].warehouse_id;
+          item.provenance = item.provenance || [];
+          item['packageDispositionList'] = packingSpecification
+            .filter((ite) => item.categoryId == ite.categoryId && ite.conversionUnit)
+            .sort((a, b) => a.sort - b.sort);
           this.$set(list[index], 'totalCount', 1);
           // item.totalCount = 1;
           item.measuringUnit = item.measureUnit;
@@ -337,7 +349,7 @@
 
           // item.specification = item.specification;
         });
-        this.$emit('changeParent',list, this.currentIndex);
+        this.$emit('changeParent', list, this.currentIndex);
         this.handleClose();
       }
     }

+ 17 - 14
src/BIZComponents/setProduct.js

@@ -1,18 +1,21 @@
 import Vue from 'vue';
 
 //改变数量
-export function changeCount(row, countObj,noDiscountSingle) {
+export function changeCount(row, countObj, noDiscountSingle) {
   let total = row[countObj.countKey] || 0;
   let data = row;
-  let endIndex = row.packageDispositionList.findIndex(
-    (ite) => row[countObj.unitIdKey] == ite.id
-  );
-  for (; 0 < endIndex; endIndex--) {
-    total = Vue.prototype.$math.format(
-      row.packageDispositionList[endIndex].packageCell * total,
-      14
+  if (row.packageDispositionList) {
+    let endIndex = row.packageDispositionList.findIndex(
+      (ite) => row[countObj.unitIdKey] == ite.id
     );
+    for (; 0 < endIndex; endIndex--) {
+      total = Vue.prototype.$math.format(
+        row.packageDispositionList[endIndex].packageCell * total,
+        14
+      );
+    }
   }
+
   data['totalCount'] = total;
   data['discountSinglePrice'] = !noDiscountSingle
     ? data.singlePrice
@@ -41,14 +44,14 @@ function setWeight(row) {
     row['totalWeight'] = 0;
   }
 }
-export function getAllPrice(arr){
+export function getAllPrice(arr) {
   let sum = 0;
-  arr.forEach(item=>{
-    if(item.totalPrice){
-      sum+=Number(item.totalPrice)
+  arr.forEach((item) => {
+    if (item.totalPrice) {
+      sum += Number(item.totalPrice);
     }
-  })
-  return sum
+  });
+  return sum;
 }
 // //计算不含税单价
 // function getNotaxSinglePrice(row) {

+ 1 - 6
src/views/purchasingManage/inquiryManage/components/inquiryTable.vue

@@ -325,11 +325,7 @@
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'resultList.' + scope.$index + '.purchaseUnitId'"
-          :rules="{
-            required: true,
-            message: '请选择单位',
-            trigger: 'change'
-          }"
+  
         >
           <el-select
             v-model="scope.row.purchaseUnitId"
@@ -568,7 +564,6 @@
             prop: 'purchaseUnit',
             label: '单位',
             slot: 'purchaseUnit',
-            headerSlot: 'isRequired',
             align: 'center'
           },
           {

+ 1 - 6
src/views/purchasingManage/purchaseNeedManage/components/inventoryTable.vue

@@ -355,11 +355,7 @@
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.purchaseUnitId'"
-          :rules="{
-            required: true,
-            message: '请选择单位',
-            trigger: 'change'
-          }"
+
         >
           <el-select
             v-model="scope.row.purchaseUnitId"
@@ -513,7 +509,6 @@
             prop: 'purchaseUnit',
             label: '单位',
             slot: 'purchaseUnit',
-            headerSlot: 'headerTotalCount',
             align: 'center'
           },
           {

+ 1 - 6
src/views/purchasingManage/purchaseOrder/components/inventoryTable.vue

@@ -482,11 +482,7 @@
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.purchaseUnitId'"
-          :rules="{
-            required: true,
-            message: '请选择单位',
-            trigger: 'change'
-          }"
+   
         >
           <el-select
             v-model="scope.row.purchaseUnitId"
@@ -687,7 +683,6 @@
             prop: 'purchaseUnit',
             label: '单位',
             slot: 'purchaseUnit',
-            headerSlot: 'headerTotalCount',
             align: 'center'
           },
           {

+ 1 - 6
src/views/purchasingManage/purchaseOrder/invoice/components/inventoryTable.vue

@@ -263,11 +263,7 @@
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.purchaseUnitId'"
-          :rules="{
-            required: true,
-            message: '请选择单位',
-            trigger: 'change'
-          }"
+ 
         >
           <el-select
             v-model="scope.row.purchaseUnitId"
@@ -546,7 +542,6 @@
             prop: 'purchaseUnit',
             label: '单位',
             slot: 'purchaseUnit',
-            headerSlot: 'headerTotalCount',
             align: 'center'
           },
           {

+ 1 - 6
src/views/purchasingManage/purchaseOrder/outSourceSend/components/inventoryTable.vue

@@ -186,11 +186,7 @@
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.purchaseUnitId'"
-          :rules="{
-            required: true,
-            message: '请选择单位',
-            trigger: 'change'
-          }"
+       
         >
           <el-select
             v-model="scope.row.purchaseUnitId"
@@ -407,7 +403,6 @@
             prop: 'purchaseUnit',
             label: '单位',
             slot: 'purchaseUnit',
-            headerSlot: 'headerTotalCount',
             align: 'center'
           },
           {

+ 1 - 6
src/views/purchasingManage/purchasePlanManage/components/inventoryTable.vue

@@ -414,11 +414,7 @@
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.purchaseUnitId'"
-          :rules="{
-            required: true,
-            message: '请选择单位',
-            trigger: 'change'
-          }"
+   
         >
           <el-select
             v-model="scope.row.purchaseUnitId"
@@ -609,7 +605,6 @@
             prop: 'purchaseUnit',
             label: '单位',
             slot: 'purchaseUnit',
-            headerSlot: 'headerTotalCount',
             align: 'center'
           },
           {

+ 1 - 6
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -309,11 +309,7 @@
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.saleUnitId'"
-          :rules="{
-            required: true,
-            message: '请选择单位',
-            trigger: 'change'
-          }"
+  
         >
           <el-select
             v-model="scope.row.saleUnitId"
@@ -644,7 +640,6 @@
             prop: 'saleCount',
             label: '数量',
             slot: 'saleCount',
-            headerSlot: 'headerTotalCount',
             align: 'center'
           },
           {