Commit 7732827b by cpa

商家端删除逻辑补充

parent 37148dfd
...@@ -144,7 +144,6 @@ ...@@ -144,7 +144,6 @@
</basic-container> </basic-container>
</div> </div>
</template> </template>
<script> <script>
......
...@@ -2,7 +2,7 @@ import request from '@/router/axios' ...@@ -2,7 +2,7 @@ import request from '@/router/axios'
export function getClassifyDropDown() { export function getClassifyDropDown() {
return request({ return request({
url: '/admin/mallGoodsSpec/dropDownBox', url: 'admin/merchantMallGoods/merchantDropDownBox',
method: 'get' method: 'get'
}) })
} }
......
...@@ -136,21 +136,7 @@ ...@@ -136,21 +136,7 @@
this.tableLoading = false this.tableLoading = false
}) })
}, },
// 删除
handleDel: function (row, index) {
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function () {
return delObj({
ids:row.id
})
}).then(data => {
this.$message.success('删除成功')
this.getList(this.page)
})
},
// 选择事件(多选事件) // 选择事件(多选事件)
onSelectionChange(r) { onSelectionChange(r) {
this.selectedData = r this.selectedData = r
...@@ -223,6 +209,27 @@ ...@@ -223,6 +209,27 @@
}, },
// 删除
handleDel: function (row, index) {
if(row.stateName==='下架' || row.stateName==='平台下架'){
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function () {
return delObj({
ids:row.id
})
}).then(data => {
this.$message.success('删除成功')
this.getList(this.page)
})
}else {
this.$message.error('只能删除下架/平台下架商品')
return;
}
},
// 批量删除 // 批量删除
handleDelBatch() { handleDelBatch() {
...@@ -233,10 +240,7 @@ ...@@ -233,10 +240,7 @@
} }
let a = d.map(r => { return r.stateName }).join(',') let a = d.map(r => { return r.stateName }).join(',')
if(a.search('有效') != -1){ if(a.search('下架') != -1 || a.search('平台下架') != -1){
this.$message.error('只能删除下架/平台下架商品')
return;
}else {
let ids = d.map(r => { return r.id }).join(',') let ids = d.map(r => { return r.id }).join(',')
this.$confirm('是否确认删除?', '提示', { this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -249,6 +253,9 @@ ...@@ -249,6 +253,9 @@
this.$refs.crud.toggleSelection(); this.$refs.crud.toggleSelection();
this.refreshChange(); this.refreshChange();
}) })
}else {
this.$message.error('只能删除下架/平台下架商品')
return;
} }
}, },
......
...@@ -327,6 +327,7 @@ ...@@ -327,6 +327,7 @@
}, },
// 删除 // 删除
handleDel: function (row, index) { handleDel: function (row, index) {
this.$confirm('是否确认删除?', '提示', { this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment