|
|
|
@ -287,6 +287,7 @@ export default { |
|
|
|
], |
|
|
|
goodsDetail: {}, |
|
|
|
detailGoodsId: "", |
|
|
|
actionReason: "", |
|
|
|
detailCommentList: [], |
|
|
|
detailCommentTotal: 0, |
|
|
|
detailCommentQuery: { pageNum: 1, pageSize: 10 }, |
|
|
|
@ -301,14 +302,16 @@ export default { |
|
|
|
{ title: "价格", key: "price", width: 90 }, |
|
|
|
{ title: "审核", key: "auditStatus", width: 110, render: (h, p) => h("Tag", { props: { color: this.auditColor(p.row.auditStatus) } }, this.auditText(p.row.auditStatus)) }, |
|
|
|
{ title: "状态", key: "status", width: 100, render: (h, p) => h("Tag", { props: { color: this.goodsStatusColor(p.row.status) } }, this.goodsStatusText(p.row.status)) }, |
|
|
|
{ title: "排名", key: "rankOrder", width: 80, render: (h, p) => h("span", p.row.rankOrder == null ? "" : p.row.rankOrder) }, |
|
|
|
{ title: "举报", key: "complaintCount", width: 80 }, |
|
|
|
{ title: "浏览", key: "browseCount", width: 80 }, |
|
|
|
{ title: "发布时间", key: "createTime", minWidth: 150 }, |
|
|
|
{ title: "操作", width: 250, fixed: "right", render: (h, p) => { |
|
|
|
{ title: "操作", width: 310, fixed: "right", render: (h, p) => { |
|
|
|
if (p.row.status == 3) return h("span", ""); |
|
|
|
return h("div", [ |
|
|
|
/* h("Button", { props: { type: "success", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.handleGoods(p.row, 1, "审核已处理") } }, "已处理"), */ |
|
|
|
h("Button", { props: { type: "info", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.viewGoodsDetail(p.row) } }, "详情"), |
|
|
|
h("Button", { props: { type: "success", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.changeGoodsRank(p.row) } }, "排名"), |
|
|
|
h("Button", { props: { type: "warning", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.handleGoods(p.row, 2, "强制下架") } }, "下架"), |
|
|
|
h("Button", { props: { type: "primary", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.handleGoods(p.row, 1, "恢复上架") } }, "恢复") |
|
|
|
]); |
|
|
|
@ -521,6 +524,7 @@ export default { |
|
|
|
return "green"; |
|
|
|
}, |
|
|
|
handleGoods(row, status, title) { |
|
|
|
this.actionReason = ""; |
|
|
|
this.$Modal.confirm({ |
|
|
|
title, |
|
|
|
render: (h) => h("Input", { props: { autofocus: true, placeholder: "请输入原因" }, on: { input: val => this.actionReason = val } }), |
|
|
|
@ -532,6 +536,34 @@ export default { |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
changeGoodsRank(row) { |
|
|
|
this.actionReason = row.rankOrder == null ? "" : String(row.rankOrder); |
|
|
|
this.$Modal.confirm({ |
|
|
|
title: "设置排名", |
|
|
|
render: (h) => h("Input", { |
|
|
|
props: { autofocus: true, placeholder: "请输入正整数排名,留空则清空排名", value: this.actionReason }, |
|
|
|
on: { input: val => this.actionReason = val } |
|
|
|
}), |
|
|
|
onOk: () => { |
|
|
|
const value = (this.actionReason || "").trim(); |
|
|
|
const params = { goodsId: row.id }; |
|
|
|
if (value === "") { |
|
|
|
params.clearRankOrder = true; |
|
|
|
} else { |
|
|
|
const rankOrder = Number(value); |
|
|
|
if (!Number.isInteger(rankOrder) || rankOrder < 1) { |
|
|
|
this.$Message.warning("请输入大于0的整数排名"); |
|
|
|
return; |
|
|
|
} |
|
|
|
params.rankOrder = rankOrder; |
|
|
|
} |
|
|
|
fishGoodsStatus(params).then(() => { |
|
|
|
this.$Message.success("排名设置成功"); |
|
|
|
this.loadGoods(); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
openCategory(row = {}) { |
|
|
|
this.categoryForm = { regionId: this.resolveRegionId(), ...row, statusBool: row.status !== 0 }; |
|
|
|
this.categoryModal = true; |
|
|
|
|