许成详 6 年之前
父節點
當前提交
0b88efe91a

+ 3
- 2
src/pages/system/goodsManager/goodsSpecManager/edit.vue 查看文件

@@ -45,7 +45,7 @@ export default {
45 45
     getInfo () { // 获取规格信息
46 46
       this.$ajax(this.$api.goodsManager.getGoodsSpecById.url, {
47 47
         method: this.$api.goodsManager.getGoodsSpecById.method,
48
-        data: { id: this.$route.query.id }
48
+        urlData: {id: this.$route.query.id}
49 49
       }).then(res => {
50 50
         this.postData = res
51 51
       })
@@ -60,7 +60,8 @@ export default {
60 60
       }
61 61
       this.$ajax(this.$api.goodsManager.editGoodsSpec.url, {
62 62
         method: this.$api.goodsManager.editGoodsSpec.method,
63
-        data: this.postData
63
+        data: this.postData,
64
+        urlData: {id: this.postData.SpecId}
64 65
       }).then(res => {
65 66
         this.$message({
66 67
           type: 'success',

+ 12
- 6
src/pages/system/goodsManager/goodsSpecManager/index.vue 查看文件

@@ -115,18 +115,24 @@ export default {
115 115
       this.getList()
116 116
     },
117 117
     handleEdit (index, row) { // 编辑
118
-      this.$router.push({ name: 'editGoodsSpec', query: {id: row.SpecId} })
118
+      this.$router.push({ name: 'editGoodsSpec', query: { id: row.SpecId } })
119 119
     },
120 120
     handleDelete (index, row) { // 删除
121
-      console.log(index, row)
122
-      this.$confirm('确认删除此渠道?', '提示', {
121
+      let name = '确认删除规格“' + row.SpecName + '”?'
122
+      this.$confirm(name, '提示', {
123 123
         confirmButtonText: '确定',
124 124
         cancelButtonText: '取消',
125 125
         type: 'warning'
126 126
       }).then(() => {
127
-        this.$message({
128
-          type: 'success',
129
-          message: '删除成功!'
127
+        this.$ajax(this.$api.goodsManager.deleteGoodsSpec.url, {
128
+          method: this.$api.goodsManager.deleteGoodsSpec.method,
129
+          urlData: { id: row.SpecId }
130
+        }).then(res => {
131
+          this.$message({
132
+            type: 'success',
133
+            message: '删除成功!'
134
+          })
135
+          this.search()
130 136
         })
131 137
       }).catch(() => {
132 138
         this.$message({

+ 4
- 0
src/util/api.js 查看文件

@@ -28,6 +28,10 @@ const $api = {
28 28
     editGoodsSpec: { // 编辑商品规格
29 29
       method: 'put',
30 30
       url: `${baseUrl}/common/spec/goods/:id`
31
+    },
32
+    deleteGoodsSpec: { // 删除商品规格
33
+      method: 'DELETE',
34
+      url: `${baseUrl}/common/spec/goods/:id`
31 35
     }
32 36
   },
33 37
   cms: {