Commit 26c8e49d by 杨北旺

内容管理

1 parent 1fb3b917
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
type: "", type: "",
scene: "", scene: "",
showChannel: "", showChannel: "",
showMerchant: "", merchantId: "",
status: "" status: ""
}, },
showFormData: [ showFormData: [
...@@ -115,7 +115,7 @@ export default { ...@@ -115,7 +115,7 @@ export default {
}, },
{ {
label: "可见门店", label: "可见门店",
name: "showMerchant", name: "merchantId",
type: "select", type: "select",
optionList: [], optionList: [],
optionId: "merchantNo", optionId: "merchantNo",
...@@ -144,7 +144,7 @@ export default { ...@@ -144,7 +144,7 @@ export default {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list", listName: "list",
mutiSelectUniqueKey: "id", mutiSelectUniqueKey: "id",
mutiSelectName: "title", mutiSelectName: "contentIndex",
tableOption: { tableOption: {
width: "170" width: "170"
}, },
...@@ -233,6 +233,8 @@ export default { ...@@ -233,6 +233,8 @@ export default {
var params = { currentPage: 1, pageSize: 100, merchantIdName: "" } var params = { currentPage: 1, pageSize: 100, merchantIdName: "" }
getMerchantList(params).then((res) => { getMerchantList(params).then((res) => {
this.getBaseData(res.list) this.getBaseData(res.list)
}).catch(()=>{
this.getBaseData([])
}) })
}, },
...@@ -257,7 +259,7 @@ export default { ...@@ -257,7 +259,7 @@ export default {
this.baseData[item.optionsName] this.baseData[item.optionsName]
) )
} }
if (item.type === "select" && item.name === "showMerchant") { if (item.type === "select" && item.name === "merchantId") {
res.unshift({ res.unshift({
merchantNo: "", merchantNo: "",
merchantName: "全部" merchantName: "全部"
...@@ -294,6 +296,21 @@ export default { ...@@ -294,6 +296,21 @@ export default {
}) })
}, },
mutiStartOrStop(type) { mutiStartOrStop(type) {
let selectedData = []
console.log(this.$refs.contentTable.mutiSelectArr);
if (this.$refs.contentTable.mutiSelectArr.contentIndex) {
selectedData = this.$refs.contentTable.mutiSelectArr.contentIndex
}
let status = selectedData.map(v => { return v.status }) || []
if (status.includes(0) || !selectedData.length) { // 包含0草稿 未选择
this.$message({
message: `请选择${type==2?'已停用':'已开启'}的内容`,
type: 'warning',
showClose: true
})
return false
}
const title = const title =
type == 2 type == 2
? "停用内容,对应的渠道和门店将无法查看该内容" ? "停用内容,对应的渠道和门店将无法查看该内容"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!