Browse Source

下级创建

lilei 3 năm trước cách đây
mục cha
commit
e9ebb3d19f

+ 0 - 2
src/libs/JGPrint.js

@@ -262,7 +262,6 @@ export const jGPrint = function (data, type, printerType, taskName) {
     }
     // pdf 打印预览
     if (type == 'preview') { 
-	  console.log('1-1-1')
       store.commit('SET_pdfPrintList', data.data)
       store.commit('SET_showPdfPrint', data.data)
       store.commit('SET_printTaskName', taskName)
@@ -271,7 +270,6 @@ export const jGPrint = function (data, type, printerType, taskName) {
         // 选择打印机
         const isDefault = store.state.app.printUseDefault
         if(isDefault == '0'){
-		  console.log('2-2-2')
           store.commit('SET_pdfPrintList', data.data)
           store.commit('SET_showSelectPrint', true)
           store.commit('SET_printTaskName', taskName)

+ 1 - 1
src/utils/request.js

@@ -27,7 +27,7 @@ const err = (error) => {
   // 业务错误提示
   if (error.response) {
     const status = error.response.status
-    if ((status == 503 || status == 500)) {
+    if (status.indexOf('5')>=0) {
       notification.destroy()
       notification.error({
         message: '提示',

+ 43 - 33
src/views/salesManagement/salesQuery/edit.vue

@@ -332,41 +332,37 @@ export default {
         this.getOrderDetail(true)
       }
     },
-    // 已选产品 销售数量  blur
-    qtyBlur (val, record) {
+    // 非下级创建的单据,修改数量时校验库存
+    validStock (val, record) {
       const _this = this
-      this.dataSource = record || []
-      if (val && val != record.qtyBackups) {
-        this.spinning = true
-        //  校验库存
-        stockByProductSn({ productSn: record.productSn }).then(res => {
-          if (res.status == 200) {
-            if (res.data && (!res.data.currentStockQty || val <= res.data.currentStockQty)) {
-              _this.changeQty(record)
-            } else {
-              this.$confirm({
-                title: '提示',
-                content: '库存不足,确认添加为急件吗?',
-                centered: true,
-                closable: true,
-                onOk () {
-                  _this.changeQty(record)
-                },
-                onCancel () {
-                  record.qty = record.qtyBackups
-                  _this.spinning = false
-                }
-              })
-            }
+      this.spinning = true
+      //  校验库存
+      stockByProductSn({ productSn: record.productSn }).then(res => {
+        if (res.status == 200) {
+          if (res.data && (!res.data.currentStockQty || val <= res.data.currentStockQty)) {
+            _this.changeQty(record)
           } else {
-            this.spinning = false
-            record.qty = record.qtyBackups
+            this.$confirm({
+              title: '提示',
+              content: '库存不足,确认添加为急件吗?',
+              centered: true,
+              closable: true,
+              onOk () {
+                _this.changeQty(record)
+              },
+              onCancel () {
+                record.qty = record.qtyBackups
+                _this.spinning = false
+              }
+            })
           }
-        })
-      } else {
-        record.qty = record.qtyBackups
-      }
+        } else {
+          this.spinning = false
+          record.qty = record.qtyBackups
+        }
+      })
     },
+    // 修改已选产品数量
     changeQty (record) {
       salesDetailUpdateQty({
         id: record.id,
@@ -383,7 +379,21 @@ export default {
         this.spinning = false
       })
     },
-    // 已选产品 售价  blur
+    // 已选产品 销售数量 input 输入框 blur
+    qtyBlur (val, record) {
+      this.dataSource = record || []
+      if (val && val != record.qtyBackups) {
+        // 非下级创建的单据,修改数量时校验库存
+        if (!this.isSuperEdit) {
+          this.validStock(val, record)
+        } else {
+          this.changeQty(record)
+        }
+      } else {
+        record.qty = record.qtyBackups
+      }
+    },
+    // 已选产品 售价 input 输入框 blur
     priceBlur (val, record) {
       this.dataSource = record || []
       //  光标移出,值发生改变再调用编辑接口
@@ -550,7 +560,7 @@ export default {
         }
       }
       // 库存不足时
-      if (row.currentQty < row.salesNums) {
+      if (row.currentQty < row.salesNums && !this.isSuperEdit) {
         _this.$confirm({
           title: '提示',
           content: '库存不足,确认添加为急件吗?',

+ 9 - 3
src/views/salesManagement/salesQuery/productSalesRecordModal.vue

@@ -10,6 +10,10 @@
       @cancel="isShow=false"
       :width="960">
       <div>
+        <div style="padding: 0 0 10px 0;line-height: 24px;" v-if="baseData">
+          <div>产品名称:{{ baseData.productName }}</div>
+          <div>产品编码:{{ baseData.productCode }}</div>
+        </div>
         <a-tabs size="small" type="card" v-model="curTab" @change="callback">
           <a-tab-pane key="1" tab="当前客户">
           </a-tab-pane>
@@ -84,12 +88,13 @@ export default {
         total: 0, //  分页总条数
         current: 1,
         pageSize: 20
-      }
+      },
+      baseData: null
     }
   },
   methods: {
     //  获取详情
-    getDetail (buyerSn, productSn) {
+    getDetail (buyerSn, productSn, row) {
       this.buyerSn = buyerSn
       if (this.curTab == 1) {
         this.queryParam.buyerSn = buyerSn
@@ -98,6 +103,7 @@ export default {
       }
       this.queryParam.productSn = productSn
       this.handelSearch(1)
+      this.baseData = row
     },
     // 查询列表
     handelSearch (pageNo) {
@@ -136,7 +142,7 @@ export default {
     },
     callback (key) {
       this.curTab = key
-      this.getDetail(this.buyerSn, this.queryParam.productSn)
+      this.getDetail(this.buyerSn, this.queryParam.productSn, this.baseData)
     }
   },
   watch: {

+ 1 - 1
src/views/salesManagement/salesQuery/queryPart.vue

@@ -420,7 +420,7 @@ export default {
     // 销售记录
     handleDetail (row) {
       this.openModal = true
-      this.$refs.salseRecord.getDetail(this.buyerSn, row.productSn)
+      this.$refs.salseRecord.getDetail(this.buyerSn, row.productSn, row)
     },
     //  关闭弹框
     closeModal () {