瀏覽代碼

修改代金券增发减发

asd123a20 2 年之前
父節點
當前提交
ae8bbfed7a
共有 2 個文件被更改,包括 4 次插入5 次删除
  1. 2 3
      src/api/goods/voucher/index.js
  2. 2 2
      src/views/goods/voucher/index.vue

+ 2 - 3
src/api/goods/voucher/index.js

@@ -47,9 +47,8 @@ export function delVoucher(data) {
 // 修改代金券数量
 export function updateNumber(data) {
   return request({
-    url: '/goods/voucher/number',
-    method: 'put',
-    data
+    url: `/discount/stock/${data.discountId}/${data.type}?count=${data.count}`,
+    method: 'put'
   })
 }
 

+ 2 - 2
src/views/goods/voucher/index.vue

@@ -154,7 +154,7 @@ export default {
     // 减发
     handleReduce(e) {
       this.$modal.prompt('请输入减发数量').then(({ value }) => {
-        return updateNumber({ discountId: e.discountId, type: 'delete', comment: value });
+        return updateNumber({ discountId: e.discountId, type: 'plus', count: value });
       }).then(() => {
         this.query();
         this.$modal.msgSuccess("减发成功");
@@ -163,7 +163,7 @@ export default {
     // 增发
     handleIncrease(e) {
       this.$modal.prompt('请输入增发数量').then(({ value }) => {
-        return updateNumber({ discountId: e.discountId, type: 'add', comment: value });
+        return updateNumber({ discountId: e.discountId, type: 'minus', count: value });
       }).then(() => {
         this.query();
         this.$modal.msgSuccess("增发成功");