Jelajahi Sumber

品检调试

lilei 3 tahun lalu
induk
melakukan
19514c6e1c

+ 3 - 3
src/api/allocateReturn.js

@@ -73,11 +73,11 @@ export const allocateReturnSubmit = params => {
   })
 }
 
-// 调拨退货品检
+// 调拨退货品检批量处理
 export const allocateReturnCheck = params => {
   return axios({
-    url: '/allocateReturn/check',
-    data: params,
+    url: `/allocReturnDetail/check/${params.allocateReturnSn}/${params.allocateCheckType}`,
+    data: params.list,
     method: 'post'
   })
 }

+ 1 - 1
src/utils/request.js

@@ -9,7 +9,7 @@ import { VueAxios } from './axios'
 // 创建 axios 实例
 const service = axios.create({
   baseURL: process.env.VUE_APP_API_BASE_URL, // api base_url
-  timeout: 60000 // 请求超时时间
+  timeout: 1000000 // 请求超时时间
 })
 
 const err = (error) => {

+ 29 - 40
src/views/allocationManagement/transferReturn/check.vue

@@ -10,8 +10,8 @@
       </a-page-header>
       <a-card size="small" :bordered="false" class="salesReturnCheck-cont">
         <div>
-          <a-button type="primary" :loading="loading" class="button-info" @click="backStock">批量返库</a-button>
-          <a-button v-if="grabFlag==1" type="default" :loading="loading" class="button-info" @click="toPlBad">批量坏件</a-button>
+          <a-button type="primary" :loading="loading" class="button-info" @click="backStock('BATCH_BACK','批量返库')">批量返库</a-button>
+          <a-button v-if="grabFlag==1" type="default" :loading="loading" class="button-info" @click="backStock('BATCH_BAD','批量坏件')">批量坏件</a-button>
         </div>
         <!-- 已选配件列表 -->
         <s-table
@@ -62,7 +62,7 @@ import { STable, VSelect } from '@/components'
 import {
   allocReturnDetailQueryPage,
   allocateReturnQueryBySn,
-  allocReturnDetailUpdate,
+  allocateReturnSubmit,
   allocateReturnCheck
 } from '@/api/allocateReturn'
 export default {
@@ -99,7 +99,7 @@ export default {
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
-              data.list[i].badQty = data.list[i].returnQty
+              data.list[i].badQty = data.list[i].badQty || data.list[i].badQty == 0 ? data.list[i].badQty : data.list[i].returnQty
               data.list[i].backStockQty = data.list[i].backStockQty || 0
               data.list[i].backStockQtyBackups = data.list[i].backStockQty
             }
@@ -140,31 +140,8 @@ export default {
     handleBack () {
       this.$router.push({ name: 'transferReturnList', query: { closeLastOldTab: true } })
     },
-    // 批量坏件
-    toPlBad () {
-      const _this = this
-      if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
-        _this.$message.warning('请先选择产品!')
-        return
-      }
-      this.$confirm({
-        title: '提示',
-        content: '确认要批量坏件吗?',
-        centered: true,
-        onOk () {
-          const obj = []
-          _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
-            obj.push({
-              allocateReturnDetailSn: item.allocateReturnDetailSn,
-              badQty: item.badQty
-            })
-          })
-          _this.submitCheck(obj)
-        }
-      })
-    },
     // 批量返库
-    backStock () {
+    backStock (type, msg) {
       const _this = this
       if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
         _this.$message.warning('请先选择产品!')
@@ -172,37 +149,49 @@ export default {
       }
       this.$confirm({
         title: '提示',
-        content: '确认要批量返库吗?',
+        content: '确认要' + msg + '吗?',
         centered: true,
         onOk () {
           const obj = []
           _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
-            obj.push({
-              allocateReturnDetailSn: item.allocateReturnDetailSn,
-              backStockQty: item.backStockQty
-            })
+            // 抓单
+            if (_this.grabFlag == 1) {
+              obj.push({
+                allocateSn: item.allocateSn,
+                productSn: item.productSn,
+                price: item.price
+              })
+            } else {
+              obj.push({
+                allocateReturnDetailSn: item.allocateReturnDetailSn
+              })
+            }
           })
-          _this.submitCheck(obj)
+          _this.submitCheck(obj, type)
         }
       })
     },
-    // 已选产品  blur
+    // 不抓单,修改返库数量
     onCellBlur (val, record) {
       //  光标移出,值发生改变再调用编辑接口
       if (val && val != record.backStockQtyBackups) {
         this.submitCheck([{
           allocateReturnDetailSn: record.allocateReturnDetailSn,
           backStockQty: record.backStockQty
-        }])
+        }], 'CUSTOM')
       } else {
         record.backStockQty = record.backStockQtyBackups
       }
     },
     // 修改坏件或退货数量
-    submitCheck (data) {
+    submitCheck (data, allocateCheckType) {
       this.loading = true
       this.spinning = true
-      allocateReturnCheck(data).then(res => {
+      allocateReturnCheck({
+        allocateReturnSn: this.orderSn,
+        allocateCheckType: allocateCheckType,
+        list: data
+      }).then(res => {
         if (res.status == 200) {
           this.resetSearchForm(true)
           this.$message.success(res.message)
@@ -226,10 +215,10 @@ export default {
       this.$refs.table.refresh(!!flag)
       this.getOrderDetail()
     },
-    // 品检
+    // 品检提交
     handleSubmit () {
       this.spinning = true
-      allocateReturnCheck({ allocateReturnSn: this.orderSn }).then(res => {
+      allocateReturnSubmit({ allocateReturnSn: this.orderSn }).then(res => {
         if (res.status == 200) {
           this.handleBack()
           this.$message.success(res.message)