Commit de77daa2 by 10_noah@other.ren

商品管理 上架下架问题修改

parent 21b3b089
...@@ -21,26 +21,28 @@ export const tableOption = { ...@@ -21,26 +21,28 @@ export const tableOption = {
"valueFormat": 'yyyy-MM-dd', "valueFormat": 'yyyy-MM-dd',
"format": 'yyyy-MM-dd', "format": 'yyyy-MM-dd',
}, },
{ // {
"type": "input", // "type": "input",
"label": "商品ID", // "label": "商品ID",
"prop": "id", // "prop": "id",
span: 12, // span: 12,
"search": true, // "search": true,
showColumn: false // showColumn: false
}, // },
{ {
"type": "input", "type": "input",
"label": "商品ID", "label": "商品ID",
"prop": "goodsId", "prop": "goodsId",
span: 12, span: 12,
"search": true, "search": true,
"searchSpan":9,
}, },
{ {
"type": "input", "type": "input",
"label": "商品名称", "label": "商品名称",
"prop": "goodsName", "prop": "goodsName",
"search": true, "search": true,
"searchSpan":7,
}, },
{ {
"listType": 'picture-img', "listType": 'picture-img',
...@@ -48,14 +50,14 @@ export const tableOption = { ...@@ -48,14 +50,14 @@ export const tableOption = {
"label": "商品列表图", "label": "商品列表图",
"prop": "goodsImage", "prop": "goodsImage",
}, },
{ // {
"type": "select", // "type": "select",
"label": "商品分类", // "label": "商品分类",
"prop": "classifyId", // "prop": "classifyId",
"span": 12, // "span": 12,
showColumn: false, // "showColumn": false,
"dicUrl": "/general/mallClassify/dropDownBox", // "dicUrl": "/general/mallClassify/dropDownBox",
}, // },
{ {
"type": "input", "type": "input",
"label": "商品分类", "label": "商品分类",
...@@ -78,10 +80,10 @@ export const tableOption = { ...@@ -78,10 +80,10 @@ export const tableOption = {
"type": "select", "type": "select",
"label": "状态", "label": "状态",
"prop": "state", "prop": "state",
"showColumn": false,
"search": true, "search": true,
"showColumn":false, "searchSpan":9,
dicUrl: "/admin/merchantMallGoods/getMerchantStateOptions", "dicUrl": "/admin/merchantMallGoods/getMerchantStateOptions",
}, },
{ {
"type": "input", "type": "input",
...@@ -92,10 +94,11 @@ export const tableOption = { ...@@ -92,10 +94,11 @@ export const tableOption = {
"type": "select", "type": "select",
"label": "审核状态", "label": "审核状态",
"prop": "auditState", "prop": "auditState",
"showColumn": false,
"search": true, "search": true,
"showColumn":false, "searchSpan":7,
dicUrl: "/admin/merchantMallGoods/getMerchantAuditStateOptions", "dicUrl": "/admin/merchantMallGoods/getMerchantAuditStateOptions",
}, },
{ {
"type": "input", "type": "input",
"label": "审核状态", "label": "审核状态",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<el-form-item label="商品名称" prop="goodsName" > <el-form-item label="商品名称" prop="goodsName" >
<el-input v-model="form.goodsName" <el-input v-model="form.goodsName"
placeholder="输入商品名称" placeholder="输入商品名称"
maxlength="100" maxlength="50"
show-word-limit show-word-limit
style="width: 230px;"></el-input> style="width: 230px;"></el-input>
</el-form-item> </el-form-item>
......
...@@ -148,30 +148,32 @@ ...@@ -148,30 +148,32 @@
this.$message.error('请选择项进行上架') this.$message.error('请选择项进行上架')
return return
} }
let a = d.map(r => { return r.stateName }).join(',') for(let j=0;j<d.length;j++){
if(a.search('审核中') != -1){ let obj= d[j]
this.$message.error('只作用于商家下架的商品,已经上架正在审核') if(obj.state==1){
return; this.$message.error("商品ID:"+obj.goodsId+" 已上架")
}else if (a.search('平台下架') != -1){ return ;
this.$message.error('只作用于商家下架的商品,平台下架商品。') }
return; if(obj.state==3){
}else if(a.search('有效') != -1) { this.$message.error("商品ID:"+obj.goodsId+" 被平台下架,请先进行修改")
this.$message.error('只作用于商家下架的商品,商品已经上架。') return ;
return; }
}else { if(obj.state==0){
let ids = d.map(r => { return r.id }).join(',') this.$message.error("商品ID:"+obj.goodsId+" 审核中,请勿重复提交")
this.$confirm('请确认是否上架已勾选的商品', '提示', { return ;
confirmButtonText: '确定', }
cancelButtonText: '取消',
type: 'warning'
}).then(function () {
return isUpon({ids: ids})
}).then(data => {
this.$message.success('上架成功')
this.getList(this.page)
})
} }
let ids = d.map(r => { return r.id }).join(',')
this.$confirm('请确认是否上架选中的商品?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function () {
return isUpon({ids: ids})
}).then(data => {
this.$message.success('上架成功')
this.getList(this.page)
})
}, },
// 批量 下架 // 批量 下架
batchIsNotUpon() { batchIsNotUpon() {
...@@ -181,32 +183,33 @@ ...@@ -181,32 +183,33 @@
return return
} }
let a = d.map(r => { return r.stateName }).join(',') for(let j=0;j<d.length;j++){
if(a.search('有效') != -1){ let obj= d[j]
let ids = d.map(r => { return r.id }).join(',') if(obj.state==0){
this.$confirm('商品正在审核,是否确认下架', '提示', { this.$message.error("商品ID:"+obj.goodsId+" 审核中,不能下架")
confirmButtonText: '确定', return ;
cancelButtonText: '取消', }
type: 'error' if(obj.state==2){
}).then(function () { this.$message.error("商品ID:"+obj.goodsId+" 已下架")
return isNotUpon({ids: ids}) return ;
}).then(data => { }
this.$message.success('下架成功') if(obj.state==3){
this.getList(this.page) this.$message.error("商品ID:"+obj.goodsId+" 已被平台下架")
}) return ;
}else if(a.search('下架') != -1){ }
this.$message.error('可作用于上架,商品已经下架。')
return;
}else if(a.search('平台下架') != -1){
this.$message.error('可作用于上架,商品审核拒绝。')
return;
}else if(a.search('审核中') != -1){
this.$message.error('可作用于上架,商品正在审核。')
return;
} }
let ids = d.map(r => { return r.id }).join(',')
this.$confirm('请确认是否下架选中的商品?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'error'
}).then(function () {
return isNotUpon({ids: ids})
}).then(data => {
this.$message.success('下架成功')
this.getList(this.page)
})
}, },
// 删除 // 删除
......
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