Selaa lähdekoodia

调试增发减法接口

asd123a20 2 vuotta sitten
vanhempi
commit
b2f5dd29f7
2 muutettua tiedostoa jossa 12 lisäystä ja 9 poistoa
  1. 10 7
      src/views/goods/voucher/index.vue
  2. 2 2
      vue.config.js

+ 10 - 7
src/views/goods/voucher/index.vue

@@ -28,6 +28,7 @@
       <el-table-column label="名称" align="center" prop="name" />
       <el-table-column label="种类" align="center" prop="categoryText" />
       <el-table-column label="可兑换群体" align="center" prop="tags" />
+      <el-table-column label="发放数量" align="center" prop="count" />
       <el-table-column label="面额" align="center" prop="money" />
       <el-table-column label="需要积分" align="center" prop="integral" />
       <el-table-column label="创建时间" align="center" prop="createTime" width="180">
@@ -153,20 +154,22 @@ export default {
   methods: {
     // 减发
     handleReduce(e) {
+      const _this = this;
       this.$modal.prompt('请输入减发数量').then(({ value }) => {
-        return updateNumber({ discountId: e.discountId, type: 'plus', count: value });
+        return updateNumber({ discountId: e.discountId, type: 'minus', count: value });
       }).then(() => {
-        this.query();
-        this.$modal.msgSuccess("减发成功");
+        _this.getList();
+        _this.$modal.msgSuccess("减发成功");
       }).catch(() => {});
     },
     // 增发
     handleIncrease(e) {
+      const _this = this;
       this.$modal.prompt('请输入增发数量').then(({ value }) => {
-        return updateNumber({ discountId: e.discountId, type: 'minus', count: value });
-      }).then(() => {
-        this.query();
-        this.$modal.msgSuccess("增发成功");
+        return updateNumber({ discountId: e.discountId, type: 'plus', count: value });
+      }).then((res) => {
+        _this.getList();
+        _this.$modal.msgSuccess("增发成功");
       }).catch(() => {});
     },
     /** 查询检测代金券管理列表 */

+ 2 - 2
vue.config.js

@@ -39,7 +39,7 @@ module.exports = {
       [process.env.VUE_APP_BASE_API]: {
         // target: `http://fuyu.scapp.cn/prod-api/`,
         // target: `https://fuyu.cc-lotus.info`,
-        target: `http://192.168.0.18:8080`,
+        target: `http://192.168.0.19:8080`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''
@@ -50,7 +50,7 @@ module.exports = {
         changeOrigin: true,
       },
       '/profile/': {
-        target: `http://192.168.0.18:8080`,
+        target: `http://192.168.0.19:8080`,
         changeOrigin: true,
       },
     },