Commit de77daa2 by 10_noah@other.ren

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

parent 21b3b089
......@@ -21,26 +21,28 @@ export const tableOption = {
"valueFormat": 'yyyy-MM-dd',
"format": 'yyyy-MM-dd',
},
{
"type": "input",
"label": "商品ID",
"prop": "id",
span: 12,
"search": true,
showColumn: false
},
// {
// "type": "input",
// "label": "商品ID",
// "prop": "id",
// span: 12,
// "search": true,
// showColumn: false
// },
{
"type": "input",
"label": "商品ID",
"prop": "goodsId",
span: 12,
"search": true,
"searchSpan":9,
},
{
"type": "input",
"label": "商品名称",
"prop": "goodsName",
"search": true,
"searchSpan":7,
},
{
"listType": 'picture-img',
......@@ -48,14 +50,14 @@ export const tableOption = {
"label": "商品列表图",
"prop": "goodsImage",
},
{
"type": "select",
"label": "商品分类",
"prop": "classifyId",
"span": 12,
showColumn: false,
"dicUrl": "/general/mallClassify/dropDownBox",
},
// {
// "type": "select",
// "label": "商品分类",
// "prop": "classifyId",
// "span": 12,
// "showColumn": false,
// "dicUrl": "/general/mallClassify/dropDownBox",
// },
{
"type": "input",
"label": "商品分类",
......@@ -78,10 +80,10 @@ export const tableOption = {
"type": "select",
"label": "状态",
"prop": "state",
"showColumn": false,
"search": true,
"showColumn":false,
dicUrl: "/admin/merchantMallGoods/getMerchantStateOptions",
"searchSpan":9,
"dicUrl": "/admin/merchantMallGoods/getMerchantStateOptions",
},
{
"type": "input",
......@@ -92,10 +94,11 @@ export const tableOption = {
"type": "select",
"label": "审核状态",
"prop": "auditState",
"showColumn": false,
"search": true,
"showColumn":false,
dicUrl: "/admin/merchantMallGoods/getMerchantAuditStateOptions",
},
"searchSpan":7,
"dicUrl": "/admin/merchantMallGoods/getMerchantAuditStateOptions",
},
{
"type": "input",
"label": "审核状态",
......
......@@ -11,7 +11,7 @@
<el-form-item label="商品名称" prop="goodsName" >
<el-input v-model="form.goodsName"
placeholder="输入商品名称"
maxlength="100"
maxlength="50"
show-word-limit
style="width: 230px;"></el-input>
</el-form-item>
......
......@@ -148,30 +148,32 @@
this.$message.error('请选择项进行上架')
return
}
let a = d.map(r => { return r.stateName }).join(',')
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;
}else {
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)
})
for(let j=0;j<d.length;j++){
let obj= d[j]
if(obj.state==1){
this.$message.error("商品ID:"+obj.goodsId+" 已上架")
return ;
}
if(obj.state==3){
this.$message.error("商品ID:"+obj.goodsId+" 被平台下架,请先进行修改")
return ;
}
if(obj.state==0){
this.$message.error("商品ID:"+obj.goodsId+" 审核中,请勿重复提交")
return ;
}
}
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() {
......@@ -181,32 +183,33 @@
return
}
let a = d.map(r => { return r.stateName }).join(',')
if(a.search('有效') != -1){
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)
})
}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;
for(let j=0;j<d.length;j++){
let obj= d[j]
if(obj.state==0){
this.$message.error("商品ID:"+obj.goodsId+" 审核中,不能下架")
return ;
}
if(obj.state==2){
this.$message.error("商品ID:"+obj.goodsId+" 已下架")
return ;
}
if(obj.state==3){
this.$message.error("商品ID:"+obj.goodsId+" 已被平台下架")
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