Commit 7732827b by cpa

商家端删除逻辑补充

parent 37148dfd
......@@ -144,7 +144,6 @@
</basic-container>
</div>
</template>
<script>
......
......@@ -2,7 +2,7 @@ import request from '@/router/axios'
export function getClassifyDropDown() {
return request({
url: '/admin/mallGoodsSpec/dropDownBox',
url: 'admin/merchantMallGoods/merchantDropDownBox',
method: 'get'
})
}
......
......@@ -136,21 +136,7 @@
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) {
this.selectedData = r
......@@ -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() {
......@@ -233,10 +240,7 @@
}
let a = d.map(r => { return r.stateName }).join(',')
if(a.search('有效') != -1){
this.$message.error('只能删除下架/平台下架商品')
return;
}else {
if(a.search('下架') != -1 || a.search('平台下架') != -1){
let ids = d.map(r => { return r.id }).join(',')
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
......@@ -249,6 +253,9 @@
this.$refs.crud.toggleSelection();
this.refreshChange();
})
}else {
this.$message.error('只能删除下架/平台下架商品')
return;
}
},
......
......@@ -327,6 +327,7 @@
},
// 删除
handleDel: function (row, index) {
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
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