yusheng 11 mesiacov pred
rodič
commit
2fdb03d3ef

+ 44 - 3
src/BIZComponents/inventoryTableDetails.vue

@@ -82,6 +82,7 @@
   import timeDialog from '@/components/timeDialog/index.vue';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import { levelList } from '@/enum/dict.js';
+  import { getInventoryTotalAPI } from '@/api/wms';
 
   const dayjs = require('dayjs');
 
@@ -130,6 +131,11 @@
       isOrderNo: {
         type: Boolean,
         default: false
+      },
+      //显示库存
+      isWms:{
+        type: Boolean,
+        default: false
       }
     },
     data() {
@@ -148,6 +154,10 @@
           width: 1,
           show: false
         };
+        let wmsColumn= {
+          width: 1,
+          show: false
+        };
         if (this.isOrderNo) {
           orderColumn = {
             minWidth: 200,
@@ -157,6 +167,15 @@
             align: 'center'
           };
         }
+        if(this.isWms){
+          wmsColumn= {
+            minWidth: 160,
+            prop: 'availableCountBase',
+            label: '库存数量',
+            showOverflowTooltip: true,
+            align: 'center'
+          };
+        }
         return [
           {
             width: 45,
@@ -240,7 +259,7 @@
             headerSlot: 'headerTotalCount',
             align: 'center'
           },
-
+          wmsColumn,
           {
             width: 120,
             prop: 'measuringUnit',
@@ -372,7 +391,8 @@
             prop: 'goodsLevel',
             label: '物品级别',
             formatter: (_row, _column, cellValue) => {
-              return levelList.find(item=>item.value==_row.goodsLevel)?.label
+              return levelList.find((item) => item.value == _row.goodsLevel)
+                ?.label;
             },
             align: 'center'
           },
@@ -680,7 +700,28 @@
               data.discountTotalPrice ||
               data?.contractVO?.discountTotalPrice;
           }
-          // this.setDeliveryDays();
+          if (this.isWms) {
+            let codeList = this.form.datasource
+              .filter((item) => item.productCode)
+              .map((item) => item.productCode);
+            //获取仓库库存
+            let inventoryTotalList = await getInventoryTotalAPI(codeList);
+            this.form.datasource
+              .filter((item) => item.productCode)
+              .forEach((item, index) => {
+                let find =
+                  inventoryTotalList.find(
+                    (key) => key.code == item.productCode
+                  ) || {};
+                this.form.datasource;
+                this.$set(
+                  this.form.datasource[index],
+                  'availableCountBase',
+                  find.availableCountBase
+                );
+              });
+          }
+
           this.supplierObj = await this.getSupplierObj(
             productList,
             'productId'

+ 1 - 0
src/views/saleManage/saleOrder/components/darwerComponents/saleOrderInfo.vue

@@ -172,6 +172,7 @@
       :isDiscountTotalPrice="true"
       :isArrivalWay="true"
       pageName="send"
+      :isWms="true"
     ></inventoryTabledetail>
     <headerTitle title="类型清单" v-if="form.needProduce == 4"></headerTitle>
     <typeList

+ 138 - 123
src/views/saleManage/saleOrder/components/searchTable.vue

@@ -3,128 +3,143 @@
   <seekPage :seekList="seekList" :formLength="3" @search="search"></seekPage>
 </template>
 <script>
-import { reviewStatusSelect, saleOrderProgressStatusEnum } from '@/enum/dict';
-export default {
-  data() {
-    return {};
-  },
-  computed: {
-    // 表格列配置
-    seekList() {
-      return [
-        {
-          label: '关键字:',
-          value: 'searchName',
-          type: 'input',
-          placeholder: '订单编码/客户名称/合同编号/产品名称'
-        },
-        {
-          label: '订单编码:',
-          value: 'orderNo',
-          type: 'input',
-          placeholder: ''
-        },
-        {
-          label: '客户名称:',
-          value: 'partaName',
-          type: 'input',
-          placeholder: ''
-        },
-        {
-          label: '合同编号:',
-          value: 'contractNumber',
-          width: 380,
-          type: 'input',
-          placeholder: ''
-        },
-        {
-          label: '产品名称:',
-          value: 'productName',
-          width: 380,
-          type: 'input',
-          placeholder: ''
-        },
-        {
-          label: '编码',
-          value: 'productCode',
-          width: 380,
-          type: 'input',
-          placeholder: '请输入'
-        },
-        {
-          label: '生产编号',
-          value: 'productionCodes',
-          width: 380,
-          type: 'input',
-          placeholder: ''
-        },
-        // {
-        //   label: '项目名称:',
-        //   value: 'productCode',
-        //   width: 380,
-        //   type: 'input',
-        //   width: 380,
-        //   placeholder: ''
-        // },
-        {
-          label: '订单类型',
-          value: 'needProduce',
-          width: 380,
-          type: 'select',
-          planList: [
-            {
-              label: '生产性订单',
-              value: '1'
-            },
-            { label: '无客户生产性订单', value: '2' },
-            { label: '库存式订单', value: '0' },
-            { label: '不定向订单', value: '4' }
-          ],
-          width: 380,
-          placeholder: ''
-        },
-        {
-          label: '审核状态',
-          value: 'orderStatus',
-          type: 'select',
-          planList: reviewStatusSelect,
-          width: 380,
-          placeholder: ''
-        },
-        {
-          label: '订单进度',
-          value: 'progress',
-          type: 'select',
-          planList: saleOrderProgressStatusEnum,
-          width: 380,
-          placeholder: ''
-        },
-        {
-          label: '创建人:',
-          value: 'createUserName',
-          width: 380,
-          type: 'input',
-          placeholder: '请输入'
-        },
-        {
-          label: '创建时间:',
-          value: 'createTime',
-          type: 'date',
-          dateType: 'datetimerange',
-          placeholder: '',
-          width: 380,
-          valueAr: ['createTimeStart', 'createTimeEnd']
-        }
-      ];
+  import { reviewStatusSelect, saleOrderProgressStatusEnum } from '@/enum/dict';
+  export default {
+    data() {
+      return {};
+    },
+    computed: {
+      // 表格列配置
+      seekList() {
+        return [
+          {
+            label: '关键字:',
+            value: 'searchName',
+            type: 'input',
+            placeholder: '订单编码/客户名称/合同编号/产品名称'
+          },
+          {
+            label: '订单编码:',
+            value: 'orderNo',
+            type: 'input',
+            placeholder: ''
+          },
+
+          {
+            label: '客户名称:',
+            value: 'partaName',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '库存状态',
+            value: 'hasStock',
+            width: 380,
+            type: 'select',
+            planList: [
+              {
+                label: '有库存',
+                value: 1
+              },
+              { label: '无库存', value: 0 }
+            ]
+          },
+
+          {
+            label: '合同编号:',
+            value: 'contractNumber',
+            width: 380,
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '产品名称:',
+            value: 'productName',
+            width: 380,
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '编码',
+            value: 'productCode',
+            width: 380,
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '生产编号',
+            value: 'productionCodes',
+            width: 380,
+            type: 'input',
+            placeholder: ''
+          },
+          // {
+          //   label: '项目名称:',
+          //   value: 'productCode',
+          //   width: 380,
+          //   type: 'input',
+          //   width: 380,
+          //   placeholder: ''
+          // },
+          {
+            label: '订单类型',
+            value: 'needProduce',
+            width: 380,
+            type: 'select',
+            planList: [
+              {
+                label: '生产性订单',
+                value: '1'
+              },
+              { label: '无客户生产性订单', value: '2' },
+              { label: '库存式订单', value: '0' },
+              { label: '不定向订单', value: '4' }
+            ],
+            width: 380,
+            placeholder: ''
+          },
+          {
+            label: '审核状态',
+            value: 'orderStatus',
+            type: 'select',
+            planList: reviewStatusSelect,
+            width: 380,
+            placeholder: ''
+          },
+          {
+            label: '订单进度',
+            value: 'progress',
+            type: 'select',
+            planList: saleOrderProgressStatusEnum,
+            width: 380,
+            placeholder: ''
+          },
+          {
+            label: '创建人:',
+            value: 'createUserName',
+            width: 380,
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '创建时间:',
+            value: 'createTime',
+            type: 'date',
+            dateType: 'datetimerange',
+            placeholder: '',
+            width: 380,
+            valueAr: ['createTimeStart', 'createTimeEnd']
+          }
+        ];
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search(e) {
+        this.$emit('search', {
+          ...e
+        });
+      }
     }
-  },
-  methods: {
-    /* 搜索 */
-    search(e) {
-      this.$emit('search', {
-        ...e
-      });
-    }
-  }
-};
+  };
 </script>

+ 60 - 7
src/views/saleManage/saleOrder/index.vue

@@ -255,6 +255,7 @@
       v-if="processSubmitDialogFlag"
       ref="processSubmitDialogRef"
       @reload="reload"
+      :callBack="callBack"
     ></process-submit-dialog>
     <addInvoiceManage
       :add-or-edit-dialog-flag.sync="addOrEditDialogFlag1"
@@ -269,6 +270,7 @@
       fileName="销售订单导入模板"
       apiUrl="/eom/saleorder/importFile"
     />
+    <bomDialog ref="bomDialogRef" @handleSubmit="bomDialogSuccess"></bomDialog>
   </div>
 </template>
 
@@ -279,6 +281,7 @@
   import invoiceConfirm from './invoiceConfirm/index.vue';
   import detailDialog from './components/detailDialog.vue';
   import exceptionList from './exceptionManagement/exceptionList';
+  import bomDialog from './components/bomDialog';
 
   import drawer from './components/drawer.vue';
   import contractrDetail from '@/views/contractManage/contractBook/components/detailDialog.vue';
@@ -295,7 +298,9 @@
     deleteInformation,
     getSaleOrderDetail,
     getTableList,
-    saleOrderReminder
+    saleOrderReminder,
+    getByRepeatBomAttribute,
+    saveOrderBomList
   } from '@/api/saleManage/saleorder';
   import { exportSaleorder } from '@/api/system/file/index.js';
   import dictMixins from '@/mixins/dictMixins';
@@ -331,7 +336,8 @@
       addInvoiceManage,
       palletManagement,
       exportButton,
-      importDialog
+      importDialog,
+      bomDialog
     },
     //客户管理数据
     props: {
@@ -362,7 +368,8 @@
         processSubmitDialogFlag: false, // 加载状态
         addOrEditDialogFlag1: false,
         params: {},
-
+        tableList: [],
+        current: null,
         cacheKeyUrl: 'eos-c2e9664a-saleManage-saleOrder',
         isRequired: true
       };
@@ -374,7 +381,7 @@
         code: 'order_person_info'
       }).then((res) => {
         console.log(res);
-        
+
         this.isRequired = Boolean(0);
       });
 
@@ -511,7 +518,23 @@
             showOverflowTooltip: true,
             minWidth: 140
           },
-
+          {
+            prop: 'inventoryQuantity',
+            label: '库存数',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'inventoryQuantity',
+            label: '库存状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140,
+            formatter: (_row, _column, cellValue) => {
+              return _row.inventoryQuantity ? '有库存' : '无库存';
+            }
+          },
           {
             prop: 'saleTypeName',
             label: '销售类型',
@@ -756,12 +779,12 @@
 
       //查看详情
       openorderDetail(row) {
-        // this.$refs.contactDetailDialogRef.open(row);
         this.$refs.drawerRef.open(row);
       },
       async saleOrderSubmit(id) {
         this.$refs.addDialogRef && this.$refs.addDialogRef.cancel();
         const data = await getSaleOrderDetail(id);
+
         this.processSubmitDialogFlag = true;
         let businessType =
           data.needProduce == 1
@@ -785,8 +808,38 @@
           this.$refs.processSubmitDialogRef.init(params);
         });
       },
-      saleOrderSubmitOrGenerate(res) {
+      async callBack() {
+        return 0
+        if (!this.current.generatePurchase && !this.current.generateProduce) {
+          return 0;
+        }
+        const code = saveOrderBomList({
+          categoryDTOList: this.tableList || [],
+          orderId: this.current.id
+        });
+        return code;
+      },
+
+      async saleOrderSubmitOrGenerate(res) {
         this.saleOrderSubmit(res.id);
+        return
+        this.tableList = [];
+        this.current = res;
+        if (!res.generatePurchase && !res.generateProduce) {
+          this.saleOrderSubmit(res.id);
+        } else {
+          const data = await getByRepeatBomAttribute(res.id);
+          if (data && data.length) {
+            this.$refs.bomDialogRef.open(data);
+            return;
+          }
+          this.saleOrderSubmit(res.id);
+        }
+      },
+      bomDialogSuccess(tableList) {
+        this.tableList = tableList;
+        // this.callBack()
+        this.saleOrderSubmit(this.current.id);
       },
       //生成
       handleAutoGenerate(id, isAuto = false) {