朱鑫波 пре 1 година
родитељ
комит
37e2cd800f
3 измењених фајлова са 39 додато и 1 уклоњено
  1. 9 0
      src/api/goodsManagement/goods.js
  2. 1 1
      src/utils/request.js
  3. 29 0
      src/views/goodsManagement/goodslist.vue

+ 9 - 0
src/api/goodsManagement/goods.js

@@ -239,6 +239,15 @@ export function editRuleIdByItemId(query) {
     })
 }
 
+// 删除关联商品
+export function removeRelateByItemId(query) {
+    return request({
+        url: 'item/removeRelateByItemId',
+        method: 'get',
+        params: query
+    })
+}
+
 
 //  达人详情
 export function getPromoterInfo(query) {

+ 1 - 1
src/utils/request.js

@@ -18,7 +18,7 @@ const service = axios.create({
   // http://ruixuan.api.tjyourong.com.cn 线上
   // http://192.168.0.195:9003 测试
   // http://192.168.1.143:9003 西安
-  // http://192.168.1.180:9003 蒙蒙
+  // http://192.168.0.228:9003 蒙蒙
   baseURL: 'http://ruixuan.api.tjyourong.com.cn',
   // 超时
   timeout: 300000

+ 29 - 0
src/views/goodsManagement/goodslist.vue

@@ -697,6 +697,22 @@
             }}</span>
           </template>
         </el-table-column>
+        <el-table-column
+          label="操作"
+          align="center"
+          class-name="small-padding fixed-width"
+          width="200px"
+        >
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              @click="removeItem(scope.row)"
+              :disabled="associationItemId == scope.row.itemId"
+              >撤销
+            </el-button>
+          </template>
+        </el-table-column>
       </el-table>
     </el-dialog>
     <!-- 结算规则列表 -->
@@ -789,6 +805,7 @@ import {
   getRuleListNoPage,
   getRuleDetailByRuleId,
   editRuleIdByItemId,
+  removeRelateByItemId,
 } from "@/api/goodsManagement/goods";
 import selectTree from "./selectTree.vue";
 import textEditor from "./textEditor.vue";
@@ -818,6 +835,7 @@ export default {
       loading: true,
       // 选中数组
       ids: null,
+      idElse: null,
       // 非单个禁用
       single: true,
       // 非多个禁用
@@ -1058,6 +1076,16 @@ export default {
     },
   },
   methods: {
+    removeItem(item) {
+      removeRelateByItemId({ itemId: item.itemId })
+        .then((res) => {
+          this.$message.success("撤销成功");
+          this.showItemList(this.idElse);
+        })
+        .catch(() => {
+          this.$message.error("出错了,请联系管理员");
+        });
+    },
     lookDetail(item) {
       getRuleDetailByRuleId({ ruleId: item.ruleId }).then((res) => {
         this.ruleVisible = true;
@@ -1068,6 +1096,7 @@ export default {
     showItemList(item) {
       getListByRelateId({ relateId: item.relateId })
         .then((res) => {
+          this.idElse = item;
           this.associationListVisible = true;
           this.associationList = res.data;
           this.associationItemId = item.itemId;