Browse Source

采购退货 新增 完结单据 功能

chenrui 3 years ago
parent
commit
28df76585a
2 changed files with 42 additions and 4 deletions
  1. 11 1
      src/api/purchaseReturn.js
  2. 31 3
      src/views/purchasingManagement/purchaseReturn/list.vue

+ 11 - 1
src/api/purchaseReturn.js

@@ -121,4 +121,14 @@ export const purchaseReturnDetailExport = params => {
     method: 'get',
     responseType: 'blob'
   })
-}
+}
+//  采购退货 完结单据
+export const purchaseReturnFinishBill = (params) => {
+  const url = `/purchaseReturn/finishBill/${params.sn}`
+  delete params.sn
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 31 - 3
src/views/purchasingManagement/purchaseReturn/list.vue

@@ -88,6 +88,13 @@
             @click="handleWarehouse(record)"
             class="button-primary"
             id="bulkReturnGoodsList-warehouse-btn">生成出库单</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state == 'CHECKED' && $hasPermissions('B_purchaseReturnFinishBill')"
+            @click="handleFinishBill(record)"
+            class="button-primary"
+            id="bulkReturnGoodsList-warehouse-btn">完结单据</a-button>
           <a-button
             size="small"
             type="link"
@@ -95,7 +102,7 @@
             v-if="(record.state == 'WAIT_SUBMIT' || record.state == 'AUDIT_REJECT') && $hasPermissions('B_purchaseReturnDel')"
             @click="handleDel(record)"
             id="purchaseReturnList-del-btn">删除</a-button>
-          <span v-if="!((record.state == 'WAIT_SUBMIT' || record.state == 'AUDIT_REJECT') && ($hasPermissions('B_purchaseReturnEdit') || $hasPermissions('B_purchaseReturnDel'))) && !(record.state == 'CHECKED' && $hasPermissions('B_purchaseReturnOutStock'))">--</span>
+          <span v-if="!((record.state == 'WAIT_SUBMIT' || record.state == 'AUDIT_REJECT') && ($hasPermissions('B_purchaseReturnEdit') || $hasPermissions('B_purchaseReturnDel'))) && !(record.state == 'CHECKED' && ($hasPermissions('B_purchaseReturnOutStock') || $hasPermissions('B_purchaseReturnFinishBill')))">--</span>
         </template>
       </s-table>
     </a-spin>
@@ -107,7 +114,7 @@ import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { purchaseTargetList } from '@/api/purchase'
 import getDate from '@/libs/getDate.js'
-import { purchaseReturnList, purchaseReturnSave, purchaseReturnDel, purchaseReturnOutStockBill } from '@/api/purchaseReturn'
+import { purchaseReturnList, purchaseReturnSave, purchaseReturnDel, purchaseReturnOutStockBill, purchaseReturnFinishBill } from '@/api/purchaseReturn'
 export default {
   components: { STable, VSelect, rangeDate },
   data () {
@@ -233,7 +240,7 @@ export default {
         })
       }
     },
-    //  入库
+    //  生成出库单
     handleWarehouse (row) {
       const _this = this
       this.$confirm({
@@ -254,6 +261,27 @@ export default {
         }
       })
     },
+    //  完结单据
+    handleFinishBill (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定要完结该单据吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          purchaseReturnFinishBill({ sn: row.purchaseReturnSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
     getParentDealer () {
       purchaseTargetList({ purchaseTargetType: 'SUPPLIER_SYS' }).then(res => {
         if (res.status == 200) {