Преглед изворни кода

fix: 提货列表作废、取消接口插分

Howie пре 2 година
родитељ
комит
8cbb2859ac
2 измењених фајлова са 30 додато и 8 уклоњено
  1. 9 2
      src/api/supply/pickup.js
  2. 21 6
      src/views/supply/pickup/pickup_list.vue

+ 9 - 2
src/api/supply/pickup.js

@@ -225,8 +225,7 @@ export function checkPassword(params) {
     params
   })
 }
-
-// 增加打印次数
+// 提货单取消
 export function cancelData(params) {
   return request({
     url: '/pick/delete',
@@ -234,6 +233,14 @@ export function cancelData(params) {
     params
   })
 }
+// 提货单作废
+export function cancelDeleteDa(params) {
+  return request({
+    url: '/pick/deleteDa',
+    method: 'post',
+    params
+  })
+}
 // 订单查询物流
 export function getListOrderTrack(params) {
   return request({

+ 21 - 6
src/views/supply/pickup/pickup_list.vue

@@ -19,7 +19,7 @@
 import TemplatePage from '@/components/template/template-page-1.vue'
 import Popu from '@/components/template/popu.vue'
 
-import { getPickupList, cancelData, getPickupManList, pickListV2, pickListV2Export } from '@/api/supply/pickup'
+import { getPickupList, cancelData,cancelDeleteDa, getPickupManList, pickListV2, pickListV2Export } from '@/api/supply/pickup'
 import { getWarehouseList } from '@/api/supply/engin'
 import PickupForm from '@/views/supply/pickup/components/pickup_form'
 
@@ -162,12 +162,27 @@ export default {
             ((this.isDealer && !row.printNum) || !this.isDealer) ? (
                 <el-popconfirm
                   onOnConfirm={async() => {
-                    this.handleCancel(row.id)
+                    this.handleCancel(row.id, cancelDeleteDa)
                   }}
-                  title={`是否确定需要${row.printNum ? '作废' : '取消'}该项内容?`}
+                  title={`是否确定需要作废该项内容?`}
                 >
                   <el-button slot='reference' size='mini' type='text'>
-                    {row.printNum ? '作废' : '取消'}
+                    作废
+                  </el-button>
+                </el-popconfirm>
+              ) : (
+                ''
+              )}
+              {this.$checkBtnRole('cancelDelete', this.$route.meta.roles) &&
+            ((this.isDealer && !row.printNum) || !this.isDealer) ? (
+                <el-popconfirm
+                  onOnConfirm={async() => {
+                    this.handleCancel(row.id, cancelData)
+                  }}
+                  title={`是否确定需要取消该项内容?`}
+                >
+                  <el-button slot='reference' size='mini' type='text'>
+                    取消
                   </el-button>
                 </el-popconfirm>
               ) : (
@@ -274,8 +289,8 @@ export default {
     },
 
     // 取消/作废
-    handleCancel(id) {
-      cancelData({ id }).then(res => {
+    handleCancel(id, fn) {
+      fn({ id }).then(res => {
         this.$successMsg()
         // this.getList()
         this.$refs.pageRef.refreshList()