فهرست منبع

对接撤回、删除按钮

damon227 5 ماه پیش
والد
کامیت
e5b3b8bb89

+ 8 - 0
src/api/cus.js

@@ -65,6 +65,14 @@ export function revoke (data) {
   })
 }
 
+export function del (data) {
+  return request({
+    url: request.adornUrl(`/biz-service/flow/cusContractReview/delete`),
+    method: 'post',
+    data: data
+  })
+}
+
 // 客户列表
 export function getCusList (param) {
   return request({

+ 18 - 0
src/api/finance.js

@@ -138,3 +138,21 @@ export function getPurchaseInvoiceDetail (id) {
     method: 'get'
   })
 }
+
+// 撤销
+export function revoke (data) {
+  return request({
+    url: request.adornUrl(`/biz-service/finance/revoke`),
+    method: 'post',
+    data: data
+  })
+}
+
+// 删除
+export function del (data) {
+  return request({
+    url: request.adornUrl(`/biz-service/finance/delete`),
+    method: 'post',
+    data: data
+  })
+}

+ 18 - 0
src/api/quality.js

@@ -42,3 +42,21 @@ export function getUnqList (params) {
     params: params
   })
 }
+
+// 删除不合格品审理单
+export function del (data) {
+  return request({
+    url: request.adornUrl(`/biz-service/disqualification/delete`),
+    method: 'post',
+    data
+  })
+}
+
+// 删除首件
+export function delFirst (data) {
+  return request({
+    url: request.adornUrl(`/biz-service/first/delete`),
+    method: 'post',
+    data
+  })
+}

+ 9 - 0
src/api/quoted.js

@@ -34,3 +34,12 @@ export function updateFinish (data) {
     data: data
   })
 }
+
+// 删除
+export function del (data) {
+  return request({
+    url: request.adornUrl(`/biz-service/quoted/delete`),
+    method: 'post',
+    data: data
+  })
+}

+ 28 - 1
src/api/sale.js

@@ -20,7 +20,16 @@ export function getPurchaseDetail (id) {
 // 撤回
 export function revokePurchase (data) {
   return request({
-    url: request.adornUrl(`/biz-service/purchase/revoke`),
+    url: request.adornUrl(`/biz-service/purchaseDetail/revoke`),
+    method: 'post',
+    data
+  })
+}
+
+// 删除
+export function del (data) {
+  return request({
+    url: request.adornUrl(`/biz-service/purchaseDetail/delete`),
     method: 'post',
     data
   })
@@ -196,3 +205,21 @@ export function revokeOrder (data) {
     data
   })
 }
+
+// 删除委外
+export function delOutsource (data) {
+  return request({
+    url: request.adornUrl(`/biz-service/purCommDetail/delete`),
+    method: 'post',
+    data
+  })
+}
+
+// 撤销委外
+export function revokeOutsource (data) {
+  return request({
+    url: request.adornUrl(`/biz-service/purCommDetail/revoke`),
+    method: 'post',
+    data
+  })
+}

+ 26 - 0
src/api/warehouse.js

@@ -118,6 +118,14 @@ export function revokeInOutBound (data) {
     data
   })
 }
+// 删除
+export function delInOutBound (data) {
+  return request({
+    url: request.adornUrl(`/biz-service/in-out-bound-ctl/delete`),
+    method: 'post',
+    data
+  })
+}
 // 模板出库查询
 export function getTemplateList (params) {
   return request({
@@ -236,3 +244,21 @@ export function infoByNameAndCode (params) {
     params
   })
 }
+
+// 撤回盘点
+export function revokeInventory (data) {
+  return request({
+    url: request.adornUrl(`/biz-service/inventory-checking-ctl/revoke`),
+    method: 'post',
+    data
+  })
+}
+
+// 删除盘点
+export function delInventory (data) {
+  return request({
+    url: request.adornUrl(`/biz-service/inventory-checking-ctl/delete`),
+    method: 'post',
+    data
+  })
+}

+ 35 - 3
src/views/modules/cus/contract.vue

@@ -104,8 +104,9 @@
           label="操作">
           <template slot-scope="scope">
             <el-button v-if="isAuth('cus:contract:info')" type="text" size="small" @click="detailHandle(scope.row.reId)">查看</el-button>
-            <el-button v-if="isAuth('cus:contract:revoke') && (scope.row.state === '1' || scope.row.state === '2')" type="text" size="small" @click="cancelContract(scope.row)">撤回</el-button>
+            <el-button v-if="isAuth('cus:contract:revoke') && (scope.row.state === '1')" type="text" size="small" @click="cancelContract(scope.row)">撤回</el-button>
             <el-button v-if="isAuth('cus:contract:submit') && (scope.row.state === '0')" type="text" size="small" @click="addOrUpdateHandle(scope.row.reId, false)">编辑</el-button>
+            <el-button v-if="isAuth('cus:contract:submit') && (scope.row.state === '0')" type="text" size="small" @click="deleteHandle(scope.row.reId)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -129,7 +130,7 @@
   import AddOrUpdate from './contract-add-or-update'
   import Detail from './contract-detail'
   import { getDictList } from '@/api/dict'
-  import { revoke } from '@/api/cus'
+  import { revoke, del } from '@/api/cus'
   export default {
     name: 'contract',
     components: {
@@ -232,7 +233,7 @@
                 type: 'success',
                 duration: 1500,
                 onClose: () => {
-                  this.getDataList()
+                  this.search()
                 }
               })
             } else {
@@ -241,6 +242,37 @@
           })
         }).catch(() => {})
       },
+      // 删除
+      deleteHandle (id) {
+        this.$confirm('是否确认要删除?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          del({reIds: [id]}).then(({data}) => {
+            if (data && data.code === '200') {
+              this.$message({
+                type: 'success',
+                message: '删除成功!',
+                duration: 1500,
+                onClose: () => {
+                  this.search()
+                }
+              })
+            } else {
+              this.$message({
+                type: 'error',
+                message: data.msg
+              })
+            }
+          })
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消删除'
+          })
+        })
+      },
       // 转换属性“类别”
       typeFormat (row) {
         if (this.options) {

+ 38 - 1
src/views/modules/cus/quoted.vue

@@ -266,6 +266,13 @@
               @click="revokeHandle(scope.row.priceId)"
               >撤回</el-button
             >
+            <el-button
+              v-if="isAuth('quoted:price:revoke') && Number(scope.row.approveState) === 0 && Number(scope.row.state) === 1"
+              type="text"
+              size="small"
+              @click="deleteHandle(scope.row.priceId)"
+              >删除</el-button
+            >
             <el-button
               v-if="isAuth('quoted:price:updateFirst') && Number(scope.row.approveState) === 3 && (Number(scope.row.state) === 1 || Number(scope.row.state) === 2)"
               type="text"
@@ -343,7 +350,7 @@
 
 <script>
 import OrgComponent from '../common/org-component'
-import {getList, revoke, updateFinish} from '@/api/quoted'
+import {getList, revoke, updateFinish, del} from '@/api/quoted'
 import QuotedAddOrUpdate from './quoted-add-or-update'
 import {productTypeOption, approveStateOption, projectStateOption, writeStateOption} from '@/utils/enums'
 import QuotedPrice from './quoted-price'
@@ -478,6 +485,36 @@ export default {
         })
       })
     },
+    deleteHandle (priceId) {
+      this.$confirm('是否确认要删除?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        del({priceIds: [priceId]}).then(({data}) => {
+          if (data && data.code === '200') {
+            this.$message({
+              type: 'success',
+              message: '删除成功!',
+              duration: 1500,
+              onClose: () => {
+                this.queryData()
+              }
+            })
+          } else {
+            this.$message({
+              type: 'error',
+              message: data.msg
+            })
+          }
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        })
+      })
+    },
     resultHandle (priceId) {
       this.resultVisible = true
       this.$nextTick(() => {

+ 65 - 1
src/views/modules/finance/expense.vue

@@ -107,6 +107,8 @@
           <template slot-scope="scope">
             <el-button v-if="isAuth('fin:expense:info')" type="text" size="small" @click="detailHandle(scope.row.submitExpenseId)">详情</el-button>
             <el-button v-if="isAuth('fin:expense:update') && scope.row.approvalState.toString() === '1'" type="text" size="small" @click="addOrUpdateHandle(scope.row.submitExpenseId, false)">编辑</el-button>
+            <el-button v-if="isAuth('fin:expense:update') && scope.row.approvalState.toString() === '1'" type="text" size="small" @click="revokeHandle(scope.row.submitExpenseId)">撤销</el-button>
+            <el-button v-if="isAuth('fin:expense:update') && scope.row.approvalState.toString() === '0'" type="text" size="small" @click="deleteHandle(scope.row.submitExpenseId)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -132,7 +134,7 @@
   import AddOrUpdate from './expense-add-or-update'
   import Detail from './expense-detail'
   import PreviewComponent from '../common/preview-component'
-  import { getExpenseList } from '@/api/finance'
+  import { getExpenseList, revoke, del } from '@/api/finance'
 
   export default {
     name: 'customer',
@@ -246,6 +248,68 @@
           this.$refs.addOrUpdate.init(id, disable)
         })
       },
+      // 撤销
+      revokeHandle (id) {
+        this.$confirm('是否确认要撤回?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          revoke({id}).then(({data}) => {
+            if (data && data.code === '200') {
+              this.$message({
+                type: 'success',
+                message: '撤回成功!',
+                duration: 1500,
+                onClose: () => {
+                  this.search()
+                }
+              })
+            } else {
+              this.$message({
+                type: 'error',
+                message: data.msg
+              })
+            }
+          })
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消撤回'
+          })
+        })
+      },
+      // 删除
+      deleteHandle (id) {
+        this.$confirm('是否确认要删除?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          del({ids: [id]}).then(({data}) => {
+            if (data && data.code === '200') {
+              this.$message({
+                type: 'success',
+                message: '删除成功!',
+                duration: 1500,
+                onClose: () => {
+                  this.search()
+                }
+              })
+            } else {
+              this.$message({
+                type: 'error',
+                message: data.msg
+              })
+            }
+          })
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消删除'
+          })
+        })
+      },
       // 查看页
       detailHandle (id) {
         this.detailVisible = true

+ 38 - 1
src/views/modules/quality/disqualification.vue

@@ -343,6 +343,13 @@
               @click="verifyHandle(scope.row)"
               >验证</el-button
             >
+            <el-button
+              v-if="isAuth('disqualification:invoices:update') && Number(scope.row.approveState) === 0"
+              type="text"
+              size="small"
+              @click="deleteHandle(scope.row.invoicesId)"
+              >删除</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -365,7 +372,7 @@
 </template>
 
 <script>
-import {getDisList} from '@/api/quality'
+import {getDisList, del} from '@/api/quality'
 import QualityDisqualificationUpdate from './disqualification-update'
 import QualityDisqualificationDispose from './disqualification-dispose'
 import QualityDisqualificationVerify from './disqualification-verify'
@@ -472,6 +479,36 @@ export default {
       this.$nextTick(() => {
         this.$refs.detail.init(id)
       })
+    },
+    deleteHandle (id) {
+      this.$confirm('是否确认要删除?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        del({invoicesIds: [id]}).then(({data}) => {
+          if (data && data.code === '200') {
+            this.$message({
+              type: 'success',
+              message: '删除成功!',
+              duration: 1500,
+              onClose: () => {
+                this.search()
+              }
+            })
+          } else {
+            this.$message({
+              type: 'error',
+              message: data.msg
+            })
+          }
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        })
+      })
     }
   }
 }

+ 38 - 1
src/views/modules/quality/first.vue

@@ -208,6 +208,13 @@
               @click="updateHandle(scope.row)"
               >上传</el-button
             >
+            <el-button
+              v-if="isAuth('first:authenticate:update')"
+              type="text"
+              size="small"
+              @click="deleteHandle(scope.row.authenticateId)"
+              >删除</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -229,7 +236,7 @@
 </template>
 
 <script>
-import {getList} from '@/api/quality'
+import {getList, delFirst} from '@/api/quality'
 import QualityFirstUpdate from './first-update'
 import AttachDetailDialog from '../common/attach-detail-dialog'
 import {approveStateOption} from '@/utils/enums'
@@ -317,6 +324,36 @@ export default {
       this.$nextTick(() => {
         this.$refs.detail.init(id)
       })
+    },
+    deleteHandle (id) {
+      this.$confirm('是否确认要删除?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        delFirst({authenticateIds: [id]}).then(({data}) => {
+          if (data && data.code === '200') {
+            this.$message({
+              type: 'success',
+              message: '删除成功!',
+              duration: 1500,
+              onClose: () => {
+                this.search()
+              }
+            })
+          } else {
+            this.$message({
+              type: 'error',
+              message: data.msg
+            })
+          }
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        })
+      })
     }
   }
 }

+ 36 - 7
src/views/modules/sale/outsource.vue

@@ -258,7 +258,9 @@
             <el-button v-if="isAuth('pur:commDetail:updatePurCommissionDetail') && (Number(scope.row.approvalState) === 3) && (Number(scope.row.purchaseState) === 1)" type="text" size="small" @click="outsourceHandle(scope.row)">委外</el-button>
             <el-button v-if="isAuth('pur:commDetail:infoPutIn') && (Number(scope.row.approvalState) === 3) && (Number(scope.row.purchaseState) === 2||(Number(scope.row.purchaseState) === 5))" type="text" size="small" @click="inBound(scope.row)">入库</el-button>
             <el-button v-if="isAuth('pur:commDetail:infoPutInAgain') && (Number(scope.row.approvalState) === 3) && (Number(scope.row.purchaseState) === 5)" type="text" size="small" @click="inBound(scope.row)">再次入库</el-button>
-          <el-button type="text" size="small" @click="exportHandle(scope.row.purchaseId)">导出</el-button>
+            <el-button type="text" size="small" @click="exportHandle(scope.row.purchaseId)">导出</el-button>
+            <el-button v-if="isAuth('pur:commDetail:update') && (Number(scope.row.approvalState) === 1)" type="text" size="small" @click="revokeHandle(scope.row.purchaseId)">撤回</el-button>
+            <el-button v-if="isAuth('pur:commDetail:update') && (Number(scope.row.approvalState) === 0)" type="text" size="small" @click="deleteHandle(scope.row.purchaseId)">删除</el-button>
 
           </template>
         </el-table-column>
@@ -291,7 +293,7 @@
 import Vue from 'vue'
 import AddOrUpdate from './outsource-add-or-update'
 import Detail from './outsource-detail'
-import { getOutsourceList } from '@/api/sale'
+import { getOutsourceList, delOutsource, revokeOutsource } from '@/api/sale'
 import AttachDetail from '../common/attach-detail'
 import NoticeChangeSetting from './outsource-notice-change-setting'
 import ChangeForm from '../cus/contract-record-change'
@@ -426,11 +428,7 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        this.$http({
-          url: this.$http.adornUrl(`/biz-service/cusContractBook/delete`),
-          method: 'DELETE',
-          data: ids
-        }).then(({data}) => {
+        delOutsource({purchaseIds: [id]}).then(({data}) => {
           if (data && data.code === '200') {
             this.$message({
               message: '操作成功',
@@ -468,6 +466,37 @@ export default {
         this.$refs.addOrUpdate.init(id)
       })
     },
+    // 撤回
+    revokeHandle (id) {
+      this.$confirm('是否确认要撤回?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        revokeOutsource({id}).then(({data}) => {
+          if (data && data.code === '200') {
+            this.$message({
+              type: 'success',
+              message: '撤回成功!',
+              duration: 1500,
+              onClose: () => {
+                this.search()
+              }
+            })
+          } else {
+            this.$message({
+              type: 'error',
+              message: data.msg
+            })
+          }
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消撤回'
+        })
+      })
+    },
     // 变更
     changeHandle (id) {
       this.changeFormVisible = true

+ 34 - 1
src/views/modules/sale/purchase.vue

@@ -230,6 +230,8 @@
             <el-button v-if="isAuth('purchase:detail:infoPutIn') && (Number(scope.row.approvalState) === 3  && (Number(scope.row.purchaseState) === 2 || Number(scope.row.purchaseState) === 5))" type="text" size="small" @click="inboundHandle(scope.row)">入库</el-button>
             <el-button v-if="isAuth('purchase:detail:infoPutInAgain') && (Number(scope.row.purchaseState) === 5)" type="text" size="small" @click="inboundHandle(scope.row.procurementId)">再次入库</el-button>
             <el-button type="text" size="small" @click="exportHandle(scope.row.procurementId)">导出</el-button>
+            <el-button v-if="isAuth('purchase:detail:update') && (Number(scope.row.approvalState) === 1)" type="text" size="small" @click="revokeHandle(scope.row.procurementId)">撤回</el-button>
+            <el-button v-if="isAuth('purchase:detail:update') && (Number(scope.row.approvalState) === 0)" type="text" size="small" @click="deleteHandle(scope.row.procurementId)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -262,7 +264,7 @@
   import Operate from './purchase-operate'
   import Inbound from '../warehouse/stock-order-inbound'
   import { getDictList } from '@/api/dict'
-  import { getPurchaseList, revokePurchase } from '@/api/sale'
+  import { getPurchaseList, revokePurchase, del } from '@/api/sale'
   import NoticeChangeSetting from './purchase-notice-change-setting'
   import AmountMaskSetting from './purchase-amount-mask-setting'
   import Vue from 'vue'
@@ -457,6 +459,37 @@
           this.$refs.inbound.init(0, false, dataForm)
         })
       },
+      // 删除
+      deleteHandle (priceId) {
+        this.$confirm('是否确认要删除?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          del({priceIds: [priceId]}).then(({data}) => {
+            if (data && data.code === '200') {
+              this.$message({
+                type: 'success',
+                message: '删除成功!',
+                duration: 1500,
+                onClose: () => {
+                  this.search()
+                }
+              })
+            } else {
+              this.$message({
+                type: 'error',
+                message: data.msg
+              })
+            }
+          })
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消删除'
+          })
+        })
+      },
       // 变更通知人设置
       setNoticeChangeHandel () {
         this.noticeChangeAttachVisible = true

+ 57 - 1
src/views/modules/warehouse/inventory.vue

@@ -120,6 +120,8 @@
             <el-button v-if="isAuth('wh:inventory:export') && Number(scope.row.state) === 0" type="text" size="small" @click="exportExcel(scope.row.inventoryId)">导出</el-button>
             <el-button v-if="isAuth('wh:inventory:import') && Number(scope.row.state) === 0" type="text" size="small" @click="importExcel(scope.row.inventoryId)">导入</el-button>
 <!--            <el-button v-if="isAuth('wh:inventory:start') && Number(scope.row.state) === 0" type="text" size="small" @click="addOrUpdateHandle(scope.row.inventoryId, false)">盘点</el-button>-->
+            <el-button v-if="isAuth('wh:inventory:info') && Number(scope.row.state) === 1" type="text" size="small" @click="revokeHandle(scope.row.inventoryId)">撤回</el-button>
+            <el-button v-if="isAuth('wh:inventory:info') && Number(scope.row.state) === 0" type="text" size="small" @click="deleteHandle(scope.row.inventoryId)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -148,7 +150,7 @@
   import inventoryAdd from './inventory-add'
   import inventoryBegin from './inventory-begin'
   import Detail from './inventory-detail'
-  import {getInventoryList} from '@/api/warehouse'
+  import {getInventoryList, revokeInventory, delInventory} from '@/api/warehouse'
   import PreviewComponent from '@/views/modules/common/preview-component'
   import Vue from 'vue'
 
@@ -286,6 +288,60 @@ export default {
         this.importInventoryId = inventoryId
         this.$refs.fileRef.dispatchEvent(new MouseEvent('click'))
       },
+      revokeHandle (inventoryId) {
+        this.$confirm('是否确认要撤回?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          revokeInventory({inventoryId}).then(({data}) => {
+            if (data && data.code === '200') {
+              this.$message({
+                message: '撤回成功',
+                type: 'success',
+                duration: 1500,
+                onClose: () => {
+                  this.queryData()
+                }
+              })
+            } else {
+              this.$message.error(data.msg)
+            }
+          })
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消撤回'
+          })
+        })
+      },
+      deleteHandle (inventoryId) {
+        this.$confirm('是否确认要删除?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          delInventory({inventoryIds: [inventoryId]}).then(({data}) => {
+            if (data && data.code === '200') {
+              this.$message({
+                message: '删除成功',
+                type: 'success',
+                duration: 1500,
+                onClose: () => {
+                  this.queryData()
+                }
+              })
+            } else {
+              this.$message.error(data.msg)
+            }
+          })
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消删除'
+          })
+        })
+      },
       fileChange (e) {
         const file = e.target.files[0]
         const formData = new FormData()

+ 54 - 19
src/views/modules/warehouse/stock-order.vue

@@ -123,7 +123,8 @@
             <el-button v-if="isAuth('wh:inon:info')" type="text" size="small" @click="detailHandle(scope.row.id)">查看</el-button>
             <el-button v-if="false" type="text" size="small" @click="exportItem(scope.row.id)">导出</el-button>
             <el-button v-if="isAuth('wh:in:editor') && (Number(scope.row.state) === 0 || Number(scope.row.state) === 4)" type="text" size="small" @click="editBound(scope.row.id)">编辑</el-button>
-            <el-button v-if="isAuth('wh:in:revoke') && (Number(scope.row.state) === 1 || Number(scope.row.state) === 2)" type="text" size="small" @click="cancelItem(scope.row)">撤回</el-button>
+            <el-button v-if="isAuth('wh:in:revoke') && (Number(scope.row.state) === 1)" type="text" size="small" @click="cancelItem(scope.row)">撤回</el-button>
+            <el-button v-if="isAuth('wh:in:editor') && (Number(scope.row.state) === 0)" type="text" size="small" @click="deleteHandle(scope.row)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -149,7 +150,7 @@
   import StockOrderInbound from './stock-order-inbound'
   import StockOrderOutbound from './stock-order-outbound'
   import Detail from './stock-order-detail'
-  import { revokeInOutBound } from '@/api/warehouse'
+  import { revokeInOutBound, delInOutBound } from '@/api/warehouse'
 
   export default {
     name: 'stock-order',
@@ -285,23 +286,57 @@
       },
       // 撤回
       async cancelItem (row) {
-        if (row.state === '0') {
-          this.$message.warning('不允许撤回,请先提交!')
-          return
-        }
-        await revokeInOutBound({'id': row.id}).then(({data}) => {
-          if (data && data.code === '200') {
-            this.$message({
-              message: '操作成功',
-              type: 'success',
-              duration: 1500,
-              onClose: () => {
-                this.getDataList()
-              }
-            })
-          } else {
-            this.$message.error(data.msg)
-          }
+        this.$confirm('是否确认要撤回?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          revokeInOutBound({'id': row.id}).then(({data}) => {
+            if (data && data.code === '200') {
+              this.$message({
+                message: '撤回成功',
+                type: 'success',
+                duration: 1500,
+                onClose: () => {
+                  this.queryData()
+                }
+              })
+            } else {
+              this.$message.error(data.msg)
+            }
+          })
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消撤回'
+          })
+        })
+      },
+      deleteHandle (row) {
+        this.$confirm('是否确认要删除?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          delInOutBound({ids: [row.id]}).then(({data}) => {
+            if (data && data.code === '200') {
+              this.$message({
+                message: '删除成功',
+                type: 'success',
+                duration: 1500,
+                onClose: () => {
+                  this.queryData()
+                }
+              })
+            } else {
+              this.$message.error(data.msg)
+            }
+          })
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消删除'
+          })
         })
       },
       detailHandle (id) {