Commit 0efdbd58 by 杨明

员工群发

1 parent d4baac8b
......@@ -927,7 +927,8 @@ export const inviteStatusList = [
export const contentTypeList = [
{ confId: 1, confValue: "图文" },
{ confId: 2, confValue: "视频" },
{ confId: 3, confValue: "pdf" }
{ confId: 3, confValue: "pdf" },
{ confId: 4, confValue: "优秀话术" }
]
// 内容管理-员工群发-发送状态
......
<template>
<d2-dialog
:is-visible="dialogVisible"
class="accountDailog"
title="选择门店"
width="720px"
@confirmDialog="handleAddConfirm"
@closeDialog="handleClose"
>
<div class="tableBox">
<div style="padding: 10px 50px">
<el-input
v-model="realSearchForm.merchantName"
placeholder="搜索员工名称"
maxlength="20"
clearable
size="small"
style="width: 300px; margin-right: 12px"
/>
<el-button size="small" type="primary" @click="searchList">
查询
</el-button>
</div>
<d2-table
ref="merchantTable"
:search-form="realSearchForm"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
>
</d2-table>
</div>
</d2-dialog>
</template>
<script>
import { getAllMerchantList, getMerchantListByScene } from "@api/contentManager"
export default {
name: "SelectGoodsTypeDialog",
props: {
config: {
type: Object,
require: true
},
dialogVisible: {
type: Boolean,
default: false
},
selectedRecord: {
type: Array,
default: () => []
}
},
data() {
return {
getListApi: getAllMerchantList,
realSearchForm: {
merchantName: ""
},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
mutiSelectUniqueKey: "id",
mutiSelectName: "merchantIndex",
tableColumns: [
{
label: "员工名称",
prop: "merchantName"
},
{
label: "员工手机号",
prop: "merchantName"
}
]
}
}
},
mounted() {},
methods: {
recoverySelection(list) {
var exitIds = this.selectedRecord.map((item) => +item.merchantId)
console.log(exitIds)
list.forEach((item) => {
console.log(item.merchantId, "item.merchantId")
exitIds.includes(item.merchantId) &&
this.$refs.merchantTable.$refs.merchantIndexMutiTable.toggleRowSelection(
item,
true
)
})
},
beforeSearchFn() {
return new Promise((resolve) => {
if (this.config.scene == 0 || this.config.scene == 4) {
this.getListApi = getAllMerchantList
} else {
this.getListApi = getMerchantListByScene
this.realSearchForm.scene = this.config.scene
}
resolve()
})
},
setTableFinishFun(data) {
this.$nextTick(() => {
this.recoverySelection(data)
})
},
searchList() {
this.$refs?.merchantTable?.refreshTable(true, true)
},
handleAddConfirm() {
const selectItemList =
this.$refs.merchantTable?.mutiSelectArr?.[
this.tableParams.mutiSelectName
] || []
if (selectItemList.length) {
this.$emit("confirmDialogFn", selectItemList)
} else {
this.$message.error("请选择员工")
}
},
handleClose() {
this.$emit("closeDialogFn")
}
}
}
</script>
<style></style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!