yusheng 1 anno fa
parent
commit
6c6555cf50

+ 13 - 8
src/BIZComponents/product-list.vue

@@ -185,7 +185,10 @@
   } from '@/api/saleManage/quotation';
   import searchProduct from './searchProduct.vue';
   import productTree from '@/components/productTree';
-  import { getInventoryTotalAPI,getCategoryPackageDisposition } from '@/api/wms';
+  import {
+    getInventoryTotalAPI,
+    getCategoryPackageDisposition
+  } from '@/api/wms';
   import cBomList from './cBom-list.vue';
   import { getByCode } from '@/api/system/dictionary-data';
   import { contactQueryByCategoryIdsAPI } from '@/api/saleManage/contact';
@@ -522,7 +525,6 @@
           if (categoryIds.length > 0) {
             return await contactQueryByCategoryIdsAPI({
               categoryIds,
-              isQueryEE: 1
             });
           } else {
             return Promise.resolve({});
@@ -569,20 +571,23 @@
         if (this.isSupplier) {
           let supplierList = await this.getSupplierObj(list);
           list.forEach((item) => {
+            item['supplierList'] = supplierList[item.id];
             item['entrustedEnterpriseIdList'] = supplierList[item.id];
-            if (supplierList[item.id]?.length === 1) {
+            if (supplierList[item.id]?.length) {
               item['entrustedEnterpriseId'] = supplierList[item.id][0].id;
+              item['supplierCode'] = supplierList[item.id][0].code;
+              item['supplierId'] = supplierList[item.id][0].id;
+              item['supplierName'] = supplierList[item.id][0].name;
             }
           });
         }
         // 获取包装规格
-        let packingSpecification =
-          await getCategoryPackageDisposition({
-            categoryIds: idList
-          });
+        let packingSpecification = await getCategoryPackageDisposition({
+          categoryIds: idList
+        });
         list.forEach((item) => {
           item['packageDispositionList'] = packingSpecification
-            .filter((ite) => item.id == ite.categoryId&&ite.conversionUnit)
+            .filter((ite) => item.id == ite.categoryId && ite.conversionUnit)
             .sort((a, b) => a.sort - b.sort);
         });
 

+ 8 - 3
src/views/contractManage/contractBook/index.vue

@@ -118,7 +118,10 @@
                 </el-link>
 
                 <jimureport
-                  v-if="[2].includes(row.status)&&$hasPermission('eom:contractBook:print')"
+                  v-if="
+                    [2].includes(row.status) &&
+                    $hasPermission('eom:contractBook:print')
+                  "
                   :businessId="row.id"
                   businessCode="erpcontractprint"
                   style="margin-left: 5px"
@@ -443,7 +446,7 @@
         ],
         cacheKeyUrl: 'eos-2310d377-contract-contractBook',
         curNodeData: {},
-        isRequired: true,
+        isRequired: true
       };
     },
     computed: {},
@@ -454,7 +457,9 @@
       parameterGetByCode({
         code: 'order_person_info'
       }).then((res) => {
-        this.isRequired = Boolean(res.value);
+        if (res.value) {
+          this.isRequired = res.value === '1';
+        }
       });
 
       if (this.$route.query.isView) {

+ 1 - 1
src/views/purchasingManage/inquiryManage/components/addDialog.vue

@@ -331,7 +331,7 @@
             }
             item.supplierList = supplierObj[item.productId] || [];
             if (item.supplierList?.length) {
-              item.supplierIds = [item.supplierList[0].id];
+              item.supplierIds =item.supplierId?[item.supplierId]:[item.supplierList[0].id];
               // this.supplierSelect(item);
             }
           });

+ 4 - 3
src/views/purchasingManage/purchaseNeedManage/components/addDialog.vue

@@ -37,7 +37,6 @@
               >
               </el-option>
             </el-select>
-   
           </el-form-item>
         </el-col>
         <el-col :span="12">
@@ -231,7 +230,7 @@
       inventoryTable,
       deptSelect,
       parentList,
-      personSelect,
+      personSelect
       // fileMain,
     },
     data() {
@@ -356,8 +355,10 @@
         const data = await getDetail(id);
         this.loading = false;
         if (data) {
+        
+          this.form = data;
+
           this.$nextTick(() => {
-            this.form = data;
             // if (data.files !== '') {
             //   this.$set(this.form, 'files', data?.files);
             // }

+ 16 - 7
src/views/purchasingManage/purchaseNeedManage/components/detailDialog.vue

@@ -285,6 +285,13 @@
             label: '待采数量',
             align: 'center'
           },
+          {
+            width: 100,
+            prop: 'measuringUnit',
+            label: '计量单位',
+            slot: 'measuringUnit',
+            align: 'center'
+          },
           {
             minWidth: 120,
             prop: 'taskName',
@@ -299,6 +306,14 @@
             slot: 'batchNo',
             align: 'center'
           },
+          {
+            width: 180,
+            prop: 'supplierName',
+            label: '供应商',
+            slot: 'supplierName',
+            // headerSlot: 'headerSupplierName',
+            align: 'center'
+          },
           {
             prop: 'provenance',
             label: '产地',
@@ -314,13 +329,7 @@
                 : '';
             }
           },
-          {
-            width: 100,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit',
-            align: 'center'
-          },
+
           {
             width: 130,
             prop: 'modelType',

+ 69 - 8
src/views/purchasingManage/purchaseNeedManage/components/inventoryTable.vue

@@ -307,6 +307,26 @@
           </DictSelection>
         </el-form-item>
       </template>
+      <template v-slot:supplierName="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.supplierName'"
+          :rules="{
+            trigger: 'change',
+            message: '请选择供应商'
+          }"
+        >
+          <el-select v-model="scope.row.supplierId" clearable filterable>
+            <el-option
+              v-for="i in scope.row.supplierList"
+              :key="i.id"
+              :value="i.id"
+              :label="i.name"
+              @click.native="getSupInfo(i, scope.$index)"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </template>
       <template v-slot:goodsLevel="{ row, $index }">
         <el-form-item :prop="'datasource.' + $index + '.goodsLevel'">
           <el-select v-model="row.goodsLevel" style="width: 100%">
@@ -355,7 +375,6 @@
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.purchaseUnitId'"
-
         >
           <el-select
             v-model="scope.row.purchaseUnitId"
@@ -394,6 +413,7 @@
       :is-get-inventory-total="true"
       @changeParent="changeParent"
       :is-show-c-bom="true"
+      :isSupplier="true"
       @getSelectionCbom="getSelectionCbom"
     ></product-list>
     <head-list ref="headRef" @changeParent="changeAnswer"></head-list>
@@ -423,6 +443,7 @@
   import tabMixins from '@/mixins/tableColumnsMixin';
   import { levelList } from '@/enum/dict.js';
   import { changeCount } from '@/BIZComponents/setProduct.js';
+  import { contactQueryByCategoryIdsAPI } from '@/api/saleManage/contact';
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -577,6 +598,14 @@
             slot: 'batchNo',
             align: 'center'
           },
+          {
+            width: 180,
+            prop: 'supplierName',
+            label: '供应商',
+            slot: 'supplierName',
+            // headerSlot: 'headerSupplierName',
+            align: 'center'
+          },
           {
             prop: 'provenance',
             label: '产地',
@@ -676,6 +705,11 @@
       this.requestDict('生产类型');
     },
     methods: {
+      getSupInfo(obj, index) {
+        this.$set(this.form.datasource[index], 'supplierCode', obj.code);
+        this.$set(this.form.datasource[index], 'supplierId', obj.id);
+        this.$set(this.form.datasource[index], 'supplierName', obj.name);
+      },
       // 返回列表数据
       getTableValue() {
         let comitDatasource = this.form.datasource;
@@ -688,23 +722,34 @@
         });
         return comitDatasource;
       },
-      //修改回显
+
       async putTableValue(data) {
         if (data && data?.length) {
           this.form.datasource = data.map((item, index) => {
             item.key = index + 1;
             return item;
           });
+
           //获取仓库库存
-          let codeList = this.form.datasource
+          let productId = this.form.datasource
+            .filter((item) => item.productCode)
+            .map((item) => item.productId);
+          let productCode = this.form.datasource
             .filter((item) => item.productCode)
             .map((item) => item.productCode);
-          if (codeList.length) {
-            let inventoryTotalList = await getInventoryTotalAPI(codeList);
-
+          if (productId) {
+            let inventoryTotalList = await getInventoryTotalAPI(productCode);
+            let supplierObj = await contactQueryByCategoryIdsAPI({
+              categoryIds: productId
+            });
             this.form.datasource
               .filter((item) => item.productCode)
               .forEach((item, index) => {
+                this.$set(
+                  this.form.datasource[index],
+                  'supplierList',
+                  supplierObj[item.productId] || []
+                );
                 let find =
                   inventoryTotalList.find(
                     (key) => key.code == item.productCode
@@ -795,13 +840,21 @@
           this.$set(parasm, 'produceType', item.componentAttribute);
           this.$set(parasm, 'approvalNumber', item.extField?.approvalNumber);
           this.$set(parasm, 'goodsLevel', item.level);
+          this.$set(parasm, 'supplierList', item.supplierList);
+          this.$set(parasm, 'supplierCode', item.supplierCode);
+          this.$set(parasm, 'supplierId', item.supplierId);
+          this.$set(parasm, 'supplierName', item.supplierName);
           this.$set(
             parasm,
             'packageDispositionList',
             item.packageDispositionList
           );
           if (item.packageDispositionList?.length) {
-            this.$set(parasm, 'purchaseUnitId', item.packageDispositionList[0].id);
+            this.$set(
+              parasm,
+              'purchaseUnitId',
+              item.packageDispositionList[0].id
+            );
             this.$set(
               parasm,
               'purchaseUnit',
@@ -892,6 +945,10 @@
           this.$set(parasm, 'imgCode', item.imgCode);
           this.$set(parasm, 'produceType', item.componentAttribute);
           this.$set(parasm, 'approvalNumber', item.extField?.approvalNumber);
+          this.$set(parasm, 'supplierList', item.supplierList);
+          this.$set(parasm, 'supplierCode', item.supplierCode);
+          this.$set(parasm, 'supplierId', item.supplierId);
+          this.$set(parasm, 'supplierName', item.supplierName);
           this.$set(
             parasm,
             'packingSpecification',
@@ -903,7 +960,11 @@
             item.packageDispositionList
           );
           if (item.packageDispositionList?.length) {
-            this.$set(parasm, 'purchaseUnitId', item.packageDispositionList[0].id);
+            this.$set(
+              parasm,
+              'purchaseUnitId',
+              item.packageDispositionList[0].id
+            );
             this.$set(
               parasm,
               'purchaseUnit',

+ 3 - 1
src/views/purchasingManage/purchaseOrder/index.vue

@@ -511,7 +511,9 @@
       parameterGetByCode({
         code: 'order_person_info'
       }).then((res) => {
-        this.isRequired = Boolean(res.value);
+        if (res.value) {
+          this.isRequired = res.value === '1';
+        }
       });
     },
     methods: {

+ 16 - 13
src/views/purchasingManage/purchasePlanManage/components/addDialog.vue

@@ -110,7 +110,7 @@
         </el-col>
 
         <el-col :span="8">
-          <el-form-item prop="remark" label="是否接受拆单" >
+          <el-form-item prop="remark" label="是否接受拆单">
             <el-radio-group
               v-model="form.acceptUnpack"
               :disabled="!!form.requirementCode"
@@ -122,7 +122,7 @@
           </el-form-item>
         </el-col>
         <el-col :span="8">
-          <el-form-item prop="remark" label="是否需要核价" >
+          <el-form-item prop="remark" label="是否需要核价">
             <el-radio-group v-model="form.needInquiry">
               <el-radio v-for="item in needInquiryList" :label="item.value">{{
                 item.label
@@ -131,7 +131,7 @@
           </el-form-item>
         </el-col>
         <el-col :span="8">
-          <el-form-item prop="remark" label="是否自动生成订单" >
+          <el-form-item prop="remark" label="是否自动生成订单">
             <el-radio-group v-model="form.isGenerateOrder">
               <el-radio :label="1">是</el-radio>
               <el-radio :label="0">否</el-radio>
@@ -139,7 +139,7 @@
           </el-form-item>
         </el-col>
         <el-col :span="8">
-          <el-form-item prop="remark" label="是否自动生成合同" >
+          <el-form-item prop="remark" label="是否自动生成合同">
             <el-radio-group v-model="form.isGenerateContract">
               <el-radio :label="1">是</el-radio>
               <el-radio :label="0">否</el-radio>
@@ -182,7 +182,9 @@
           :needInquiry="form.needInquiry"
           ref="inventoryTable"
           :sourceType="form.sourceType"
-          :isSupplier="Boolean(form.isGenerateOrder==1||form.isGenerateContract==1)"
+          :isSupplier="
+            Boolean(form.isGenerateOrder == 1 || form.isGenerateContract == 1)
+          "
         ></inventoryTable>
       </el-tab-pane>
       <el-tab-pane
@@ -256,7 +258,6 @@
   import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
   import { orderSourceType, requirementSourceType } from '@/enum/dict';
   import { getWarehouseListByIds } from '@/api/purchasingManage/returnGoods';
-
   export default {
     props: {
       categoryTreeList: Array,
@@ -299,8 +300,8 @@
         acceptUnpack: 1,
         needInquiry: 1,
         isFirstProcess: 0,
-        isGenerateOrder:0,
-        isGenerateContract:0,
+        isGenerateOrder: 0,
+        isGenerateContract: 0
       };
 
       return {
@@ -346,7 +347,7 @@
             value: 0
           }
         ],
- 
+
         rules: {
           responsibleName: [
             { required: true, message: '请选择责任人', trigger: 'change' }
@@ -436,8 +437,10 @@
       async getplanData(id) {
         this.loading = true;
         let data = await getplanDetail(id);
+
         this.loading = false;
         if (data) {
+
           this.form = data;
 
           this.$nextTick(() => {
@@ -468,9 +471,9 @@
                 this.form.requirementId = data[key];
               }
             }
-            data.detailList.forEach(item=>{
-              delete item.id
-            })
+            data.detailList.forEach((item) => {
+              delete item.id;
+            });
             this.$refs.inventoryTable &&
               this.$refs.inventoryTable.putTableValue(data.detailList);
             // 根据部门获取人员
@@ -649,7 +652,7 @@
             variables: {
               businessCode: data.planCode,
               businessName: data.planName,
-              storemanIds:storemanIds.toString(),
+              storemanIds: storemanIds.toString(),
               businessType: data.sourceTypeName
             }
             // callBackMethodType : '1',

+ 91 - 64
src/views/purchasingManage/purchasePlanManage/components/inventoryTable.vue

@@ -323,12 +323,15 @@
             message: '请选择供应商'
           }"
         >
-          <el-input
-            clearable
-            @click.native="(e) => handleGetSup(e, scope.row, scope.$index)"
-            v-model="scope.row.supplierName"
-            placeholder="请输入"
-          ></el-input>
+          <el-select v-model="scope.row.supplierId" clearable filterable>
+            <el-option
+              v-for="i in scope.row.supplierList"
+              :key="i.id"
+              :value="i.id"
+              :label="i.name"
+              @click.native="getSupInfo(i, scope.$index)"
+            ></el-option>
+          </el-select>
         </el-form-item>
       </template>
       <template v-slot:provenance="scope">
@@ -414,7 +417,6 @@
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.purchaseUnitId'"
-   
         >
           <el-select
             v-model="scope.row.purchaseUnitId"
@@ -465,14 +467,15 @@
       @changeParent="changeParent"
       :is-show-c-bom="true"
       @getSelectionCbom="getSelectionCbom"
+      :isSupplier="true"
     ></product-list>
     <head-list ref="headRef" @changeParent="changeAnswer"></head-list>
     <timeDialog @chooseTime="chooseTime" ref="timeDialogRef"></timeDialog>
-    <supplierList
+    <!-- <supplierList
       ref="supplierListRef"
       :classType="2"
       @changeParent="getSupInfo"
-    ></supplierList>
+    ></supplierList> -->
     <taskinstance-dialog
       ref="taskinstanceDialogRef"
       v-if="taskinstanceDialogFlag"
@@ -489,7 +492,7 @@
   import headList from '@/BIZComponents/user-select/user-select.vue';
   import timeDialog from '@/components/timeDialog/index.vue';
   import { copyObj } from '@/utils/util';
-  import supplierList from '@/views/purchasingManage/supplierManage/components/parentList.vue';
+  // import supplierList from '@/views/purchasingManage/supplierManage/components/parentList.vue';
   import { getInventoryTotalAPI } from '@/api/wms';
   // import fileMain from '@/components/addDoc/index.vue';
   import taskinstanceDialog from '@/BIZComponents/procedure/taskinstanceDialog.vue';
@@ -499,6 +502,7 @@
   import warehouseAll from '@/BIZComponents/warehouseAll.vue';
   import { levelList } from '@/enum/dict.js';
   import { changeCount } from '@/BIZComponents/setProduct.js';
+  import { contactQueryByCategoryIdsAPI } from '@/api/saleManage/contact';
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -518,7 +522,7 @@
     components: {
       taskinstanceDialog,
       // fileMain,
-      supplierList,
+      // supplierList,
       productList,
       fileUpload,
       headList,
@@ -622,6 +626,14 @@
             // headerSlot: 'headerTotalCount',
             align: 'center'
           },
+          {
+            width: 100,
+            prop: 'measuringUnit',
+            label: '计量单位',
+            slot: 'measuringUnit',
+            align: 'center'
+          },
+
           {
             minWidth: 120,
             prop: 'goodsLevel',
@@ -676,7 +688,7 @@
           },
 
           {
-            width: 130,
+            width: 180,
             prop: 'supplierName',
             label: '供应商',
             slot: 'supplierName',
@@ -750,14 +762,6 @@
             }
           },
 
-          {
-            width: 100,
-            prop: 'measuringUnit',
-            label: '单位',
-            slot: 'measuringUnit',
-            align: 'center'
-          },
-
           {
             width: 220,
             prop: 'remark',
@@ -874,15 +878,36 @@
             };
             this.form.datasource.push(item);
           });
-          let codeList = this.form.datasource.map((item) => item.productCode);
+          console.log(this.form.datasource, 'this.form.datasource');
           //获取仓库库存
-          let inventoryTotalList = await getInventoryTotalAPI(codeList);
-          this.form.datasource.forEach((item) => {
-            let find =
-              inventoryTotalList.find((key) => key.code == item.productCode) ||
-              {};
-            item.availableCountBase = find.availableCountBase;
-          });
+          let productId = this.form.datasource
+            .filter((item) => item.productCode)
+            .map((item) => item.productId);
+          let productCode = this.form.datasource
+            .filter((item) => item.productCode)
+            .map((item) => item.productCode);
+          if (productId?.length) {
+            let inventoryTotalList = await getInventoryTotalAPI(productCode);
+            let supplierObj = await contactQueryByCategoryIdsAPI({
+              categoryIds: productId
+            });
+            this.form.datasource.forEach((item, index) => {
+              this.$set(
+                this.form.datasource[index],
+                'supplierList',
+                supplierObj[item.productId] || []
+              );
+              let find =
+                inventoryTotalList.find(
+                  (key) => key.code == item.productCode
+                ) || {};
+              this.$set(
+                this.form.datasource[index],
+                'availableCountBase',
+                find.availableCountBase
+              );
+            });
+          }
           this.$refs.table.reload();
         }
       },
@@ -924,40 +949,23 @@
           });
         }
       },
-      //获取供应商信息
-      handleGetSup(e, row, index) {
-        this.curIndex = index;
-        if (e.target.nodeName == 'I') {
-          this.$set(this.form.datasource[this.curIndex], 'supplierCode', '');
-          this.$set(this.form.datasource[this.curIndex], 'supplierId', '');
-          this.$set(this.form.datasource[this.curIndex], 'supplierName', '');
-          return;
-        }
-        let item = { id: row.supplierId };
-        this.$refs.supplierListRef.open(item);
-      },
+      // //获取供应商信息
+      // handleGetSup(e, row, index) {
+      //   this.curIndex = index;
+      //   if (e.target.nodeName == 'I') {
+      //     this.$set(this.form.datasource[this.curIndex], 'supplierCode', '');
+      //     this.$set(this.form.datasource[this.curIndex], 'supplierId', '');
+      //     this.$set(this.form.datasource[this.curIndex], 'supplierName', '');
+      //     return;
+      //   }
+      //   let item = { id: row.supplierId };
+      //   this.$refs.supplierListRef.open(item);
+      // },
       //选择供应商信息回调
-      getSupInfo(obj) {
-        let params = {
-          supplierCode: obj.code,
-          supplierId: obj.id,
-          supplierName: obj.name
-        };
-        this.$set(
-          this.form.datasource[this.curIndex],
-          'supplierCode',
-          params.supplierCode
-        );
-        this.$set(
-          this.form.datasource[this.curIndex],
-          'supplierId',
-          params.supplierId
-        );
-        this.$set(
-          this.form.datasource[this.curIndex],
-          'supplierName',
-          params.supplierName
-        );
+      getSupInfo(obj, index) {
+        this.$set(this.form.datasource[index], 'supplierCode', obj.code);
+        this.$set(this.form.datasource[index], 'supplierId', obj.id);
+        this.$set(this.form.datasource[index], 'supplierName', obj.name);
       },
       async warehouseChange(index, row) {
         const data = this.warehouseList.find(
@@ -1016,6 +1024,11 @@
           this.$set(parasm, 'singleWeight', item.roughWeight);
           this.$set(parasm, 'goodsLevel', item.level);
           this.$set(parasm, 'approvalNumber', item.extField.approvalNumber);
+          this.$set(parasm, 'supplierList', item.supplierList);
+          this.$set(parasm, 'supplierCode', item.supplierCode);
+          this.$set(parasm, 'supplierId', item.supplierId);
+          this.$set(parasm, 'supplierName', item.supplierName);
+
           this.$set(
             parasm,
             'packingSpecification',
@@ -1027,7 +1040,11 @@
             item.packageDispositionList
           );
           if (item.packageDispositionList?.length) {
-            this.$set(parasm, 'purchaseUnitId', item.packageDispositionList[0].id);
+            this.$set(
+              parasm,
+              'purchaseUnitId',
+              item.packageDispositionList[0].id
+            );
             this.$set(
               parasm,
               'purchaseUnit',
@@ -1035,6 +1052,7 @@
             );
           }
           this.$set(parasm, 'provenance', item.purchaseOrigins || []);
+
           if (idx == -1) {
             this.form.datasource.push(row);
           }
@@ -1070,7 +1088,10 @@
           this.$set(parasm, 'specification', item.specification);
           this.$set(parasm, 'singleWeight', item.netWeight);
           row['arrivalWay'] = row.arrivalWay || 1;
-
+          this.$set(parasm, 'supplierList', item.supplierList);
+          this.$set(parasm, 'supplierCode', item.supplierCode);
+          this.$set(parasm, 'supplierId', item.supplierId);
+          this.$set(parasm, 'supplierName', item.supplierName);
           this.$set(parasm, 'remark', '');
           this.$set(parasm, 'imgCode', item.imgCode);
           this.$set(parasm, 'produceType', item.componentAttribute);
@@ -1086,7 +1107,11 @@
             item.packageDispositionList
           );
           if (item.packageDispositionList?.length) {
-            this.$set(parasm, 'purchaseUnitId', item.packageDispositionList[0].id);
+            this.$set(
+              parasm,
+              'purchaseUnitId',
+              item.packageDispositionList[0].id
+            );
             this.$set(
               parasm,
               'purchaseUnit',
@@ -1096,6 +1121,8 @@
           if (item.purchaseOrigins?.length > 0) {
             item.purchaseOrigins = item.purchaseOrigins.map((val) => val + '');
           }
+          console.log(parasm);
+          console.log(item);
           this.$set(parasm, 'provenance', item.purchaseOrigins || []);
           if (idx == -1) {
             this.form.datasource.push(row);

+ 20 - 8
src/views/saleManage/saleOrder/index.vue

@@ -169,7 +169,10 @@
                   v-if="
                     [2].includes(row.orderStatus) &&
                     row.needProduce != 2 &&
-                    $hasPermission('eom:saleordersendrecord:save')
+                    $hasPermission('eom:saleordersendrecord:save') &&
+                    ((isTotalCount == '1' &&
+                      ![800, 1000].includes(row.progress)) ||
+                      isTotalCount == 0)
                   "
                 >
                   创建发货单
@@ -382,7 +385,8 @@
         tableList: [],
         current: null,
         cacheKeyUrl: 'eos-c2e9664a-saleManage-saleOrder',
-        isRequired: true
+        isRequired: true,
+        isTotalCount: '0'
       };
     },
 
@@ -391,11 +395,16 @@
       parameterGetByCode({
         code: 'order_person_info'
       }).then((res) => {
-        console.log(res);
-
-        this.isRequired = Boolean(0);
+        if (res.value) {
+          this.isRequired = res.value === '1';
+        }
+      });
+      //销售发货数量是否限制不能大于采购总数//0否 1是
+      parameterGetByCode({
+        code: 'saleOrder_invoice_productList_totalCount'
+      }).then((res) => {
+        this.isTotalCount ='1';
       });
-
       // if (!('Notification' in window)) {
       //   console.log('此浏览器不支持桌面通知');
       // } else if (Notification.permission === 'granted') {
@@ -543,7 +552,7 @@
             showOverflowTooltip: true,
             minWidth: 140,
             formatter: (_row, _column, cellValue) => {
-              return _row.inventoryQuantity ? '有库存' : '无库存';
+              return _row.inventoryQuantity>0 ? '有库存' : '无库存';
             }
           },
           {
@@ -715,7 +724,10 @@
         if (new Set(saleTypeS).size != 1) {
           return this.$message.warning('请选择相同销售类型的订单!');
         }
-
+        let processObj = this.selection.filter((item) => item.progress == 800);
+        if (processObj?.length&&this.isTotalCount=='1') {
+          return this.$message.warning('订单'+processObj.map(item=>item.orderNo).toString()+'已全部发货,不能创建发货单');
+        }
         if (
           this.selection.filter((item) => item.needProduce == 4)?.length &&
           this.selection.filter((item) => item.needProduce == 4)?.length !=

+ 16 - 2
src/views/saleManage/saleOrder/invoice/components/addInvoiceDialog.vue

@@ -128,6 +128,7 @@
           @replaceTableChange="replaceTableChange"
           :needProduce="saleOrderValue.needProduce"
           :typeIds="saleOrderValue.typedetailIds"
+          :isTotalCount="isTotalCount"
         ></inventoryTable>
       </el-tab-pane>
       <el-tab-pane label="托盘清单" name="second">
@@ -170,6 +171,7 @@
       @changeParent="changeOrder"
       :contactData="contactData"
       :isAll="true"
+      :isTotalCount="isTotalCount"
     ></orderListDialog>
     <!--  受托发货单  -->
     <entrusted-receive-dialog
@@ -219,6 +221,7 @@
   import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
   import { carBookPageListAPI } from '@/api/transportManager/carBook';
   import { projectsGetByIdAPI } from '@/api/pro';
+  import { parameterGetByCode } from '@/api/main/index.js';
 
   export default {
     mixins: [dictMixins],
@@ -312,7 +315,8 @@
         loading: false,
         // 是否是修改
         isUpdate: false,
-        businessId: ''
+        businessId: '',
+        isTotalCount: 0
       };
     },
     computed: {
@@ -322,6 +326,15 @@
     },
 
     methods: {
+      //销售发货数量是否限制不能大于采购总数//0否 1是
+      parameterGetByCode() {
+        parameterGetByCode({
+          code: 'saleOrder_invoice_productList_totalCount'
+        }).then((res) => {
+          this.isTotalCount = res.value;
+        });
+      },
+
       //选择订单回调
       changeOrder(obj) {
         this.form = Object.assign({}, this.form, {
@@ -485,7 +498,7 @@
             data.productList.forEach((item) => {
               item['tempId'] = item.id;
             });
-            data.carNo=data.carNo?data.carNo.split(','):[]
+            data.carNo = data.carNo ? data.carNo.split(',') : [];
             this.form = data;
             this.$refs.inventoryTableref &&
               this.$refs.inventoryTableref.putTableValue(data.productList);
@@ -611,6 +624,7 @@
       //打开新增编辑弹框
       async open(type, row, orderId) {
         this.title = type === 'add' ? '新增发货单' : '修改';
+        this.parameterGetByCode();
         this.visible = true;
         this.carList = await carBookPageListAPI({ pageNum: 1, size: 100 });
 

+ 5 - 13
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -399,7 +399,6 @@
   import selectStockLedgerDialog from '@/BIZComponents/selectStockLedger/selectStockLedgerDialog.vue'; //库存台账
   import BIZproductList from '@/BIZComponents/product-list.vue';
   import { lbjtList } from '@/enum/dict.js';
-  import { parameterGetByCode } from '@/api/main/index.js';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import { levelList } from '@/enum/dict.js';
   import { changeCount, getAllPrice } from '@/BIZComponents/setProduct.js';
@@ -418,6 +417,9 @@
       typeIds: {
         type: Array,
         default: () => []
+      },
+      isTotalCount: {
+        default: 0
       }
     },
     components: {
@@ -493,18 +495,12 @@
           datasource: []
         },
         rules: {},
-        isTotalCount: 0
       };
     },
     created() {
       this.requestDict('产地');
       this.requestDict('生产类型');
-      //销售发货数量是否限制不能大于采购总数//0否 1是
-      parameterGetByCode({
-        code: 'saleOrder_invoice_productList_totalCount'
-      }).then((res) => {
-        this.isTotalCount = res.value;
-      });
+
     },
     computed: {
       canHandl() {
@@ -916,11 +912,7 @@
         this.changeCount(row, index);
       },
       packingChange(item, index) {
-        this.$set(
-          this.form.datasource[index],
-          'saleUnit',
-          item.conversionUnit
-        );
+        this.$set(this.form.datasource[index], 'saleUnit', item.conversionUnit);
       },
       //改变数量
       // changeCount() {

+ 9 - 5
src/views/saleManage/saleOrder/invoice/components/orderListDialog.vue

@@ -78,6 +78,9 @@
       isMy: {
         type: Boolean,
         default: false
+      },
+      isTotalCount: {
+        default: 0
       }
     },
     data() {
@@ -174,7 +177,7 @@
             showOverflowTooltip: true,
             minWidth: 200
           },
-         
+
           {
             prop: 'partaName',
             label: '客户名称',
@@ -209,7 +212,7 @@
             showOverflowTooltip: true,
             minWidth: 140,
             formatter: (_row, _column, cellValue) => {
-              return _row.inventoryQuantity ? '有库存' : '无库存';
+              return _row.inventoryQuantity>0 ? '有库存' : '无库存';
             }
           },
           {
@@ -267,20 +270,21 @@
 
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
-        let orderStatus=2
+        let orderStatus = 2;
         if (this.contactData.id) {
           where['contactId'] = this.contactData.id;
         }
         if (this.isMy) {
           where['currentUserId'] = this.user.info.userId;
-          orderStatus=''
+          orderStatus = '';
         }
         return getTableList({
           pageNum: page,
           size: limit,
           ...where,
           orderStatus,
-          ...this.searchParams
+          ...this.searchParams,
+          isNoSendDone:this.isTotalCount
         });
       },