lilei 2 vuotta sitten
vanhempi
commit
d9e13b9f98

+ 8 - 0
src/api/sendBill.js

@@ -23,6 +23,14 @@ export const getCustomerInfo = params => {
     method: 'post'
   })
 }
+// 发货前校验销售单
+export const validateStockOut = params => {
+  return axios({
+    url: '/sendBill/validateStockOut',
+    data: params,
+    method: 'post'
+  })
+}
 // 发货单列表分页查询
 export const sendBillQueryPageList = (params) => {
   const url = `/sendBill/queryPage/${params.pageNo}/${params.pageSize}`

+ 13 - 11
src/views/salesManagement/outboundOrder/list.vue

@@ -176,7 +176,7 @@ import allocationDetailModal from '@/views/allocationManagement/transferOut/deta
 import sendGoodModal from './sendGoodModal.vue'
 import { STable, VSelect } from '@/components'
 import { stockOutList, stockOutOut } from '@/api/stockOut'
-import { getCustomerInfo } from '@/api/sendBill'
+import { getCustomerInfo, validateStockOut } from '@/api/sendBill'
 export default {
   name: 'OutboundOrderList',
   mixins: [commonMixin],
@@ -382,18 +382,20 @@ export default {
         }
       })
     },
-    // 发货/批量发货
-    getCustome (data, stockOutSnList) {
+    // 获取客户信息
+    async getCustome (data, stockOutSnList) {
       const _this = this
-      this.spinning = true
-      getCustomerInfo({ stockOutSnList: stockOutSnList }).then(res => {
-        if (res.status == 200) {
-          _this.showDetailModal = true
-          _this.$refs.detailModal.setData(data, res.data)
-          _this.spinning = false
-        }
-      })
+      const customer = await getCustomerInfo({ stockOutSnList: stockOutSnList })
+      const validRet = await validateStockOut({ stockOutSnList, ...customer.data })
+      if (validRet.status == 200) {
+        _this.showDetailModal = true
+        _this.$refs.detailModal.setData(data, customer.data)
+        _this.spinning = false
+      } else {
+        // _this.$message.error(validRet.message)
+      }
     },
+    // 发货/批量发货
     handleSendGood (row) {
       const _this = this
       let stockOutSnList = []

+ 2 - 1
src/views/salesManagement/outboundOrder/sendGoodModal.vue

@@ -377,6 +377,7 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         _this.form.sendBillDetailList = _this.tableData
         if (valid) {
+          console.log(_this.form, this.isEdit)
           if (_this.form.sendBillDetailList.length == 0) {
             _this.$message.info('请新增发货明细!')
             return false
@@ -389,7 +390,7 @@ export default {
             _this.$message.info('请输入费用!')
             return false
           }
-          console.log(_this.form, this.isEdit)
+
           const baseUrl = this.isEdit ? sendBillUpdate : sendBillInsert
           _this.spinning = true
           baseUrl(_this.form).then(res => {