Commit 7bde4862 by 前端

员工群发

1 parent af59fbf7
...@@ -250,3 +250,11 @@ export function getCustomerInfoDetail(data) { ...@@ -250,3 +250,11 @@ export function getCustomerInfoDetail(data) {
data.method = `dj.api.mindworkplate.customervisit.getCustomerInfoDetail` data.method = `dj.api.mindworkplate.customervisit.getCustomerInfoDetail`
return request(data, "post") return request(data, "post")
} }
export function listMerchantStaffPage(data) {
data.method = `dj.api.smartcarlife.contentManagerTask.listMerchantStaffPage`
return request(data, "post")
}
export function listBrandStaffPage(data) {
data.method = `dj.api.smartcarlife.contentManagerTask.listBrandStaffPage`
return request(data, "post")
}
...@@ -983,7 +983,7 @@ export const filterOpt = [ ...@@ -983,7 +983,7 @@ export const filterOpt = [
{ confId: 2, confValue: "待我处理的" }, { confId: 2, confValue: "待我处理的" },
{ confId: 3, confValue: "我处理过的" } { confId: 3, confValue: "我处理过的" }
] ]
export const supervisorStatuOpt=[ export const supervisorStatuOpt = [
{ confId: 1, confValue: "已跟进" }, { confId: 1, confValue: "已跟进" },
{ confId: 0, confValue: "未跟进" } { confId: 0, confValue: "未跟进" }
] ]
...@@ -1123,3 +1123,8 @@ export const outputValue_operTypeOpt = [ ...@@ -1123,3 +1123,8 @@ export const outputValue_operTypeOpt = [
{ confId: 2, confValue: "修改" }, { confId: 2, confValue: "修改" },
{ confId: 3, confValue: "删除" } { confId: 3, confValue: "删除" }
] ]
export const channelTypeList = [
{ confId: 1, confValue: "企业微信" },
{ confId: 2, confValue: "展业app" }
]
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
btn-ok-label="确定" btn-ok-label="确定"
@confirmDialog="handleRelateStoreConfirm" @confirmDialog="handleRelateStoreConfirm"
@closeDialog="handleRelateStoreClose" @closeDialog="handleRelateStoreClose"
class="relateStore"> class="relateStore"
>
<el-form :model="storeSearchForm" ref="relate" :inline="true"> <el-form :model="storeSearchForm" ref="relate" :inline="true">
<el-form-item label="品牌名称:"> <el-form-item label="品牌名称:">
<el-input <el-input
...@@ -15,7 +16,8 @@ ...@@ -15,7 +16,8 @@
placeholder="品牌名称" placeholder="品牌名称"
max-length="20" max-length="20"
@keydown.native="handleStoreInput" @keydown.native="handleStoreInput"
clearable /> clearable
/>
</el-form-item> </el-form-item>
<el-button type="primary" @click="handleCurrentChange(1)">搜索</el-button> <el-button type="primary" @click="handleCurrentChange(1)">搜索</el-button>
</el-form> </el-form>
...@@ -28,7 +30,8 @@ ...@@ -28,7 +30,8 @@
class="table" class="table"
border border
@select="handleChange" @select="handleChange"
@select-all="handleAll"> @select-all="handleAll"
>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column prop="label" label="品牌名称" align="center"> <el-table-column prop="label" label="品牌名称" align="center">
</el-table-column> </el-table-column>
...@@ -40,13 +43,15 @@ ...@@ -40,13 +43,15 @@
:current-page.sync="currentPage" :current-page.sync="currentPage"
:page-size="pageSize" :page-size="pageSize"
layout="total, prev, pager, next" layout="total, prev, pager, next"
:total="total" /> :total="total"
/>
</div> </div>
<el-table <el-table
class="tableBox table" class="tableBox table"
:data="selectedData" :data="selectedData"
border border
height="464px"> height="464px"
>
<el-table-column prop="merchantName" label="品牌名称" align="center"> <el-table-column prop="merchantName" label="品牌名称" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.label }}</span> <span>{{ scope.row.label }}</span>
...@@ -57,7 +62,8 @@ ...@@ -57,7 +62,8 @@
<el-button <el-button
class="el-icon-delete" class="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
type="text" /> type="text"
/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -102,6 +108,7 @@ export default { ...@@ -102,6 +108,7 @@ export default {
var exitIds = this.selectedData.map((item) => item.id) var exitIds = this.selectedData.map((item) => item.id)
this.selectingData.forEach((item) => { this.selectingData.forEach((item) => {
exitIds.includes(item.id) && exitIds.includes(item.id) &&
this.$refs.seletingTable &&
this.$refs.seletingTable.toggleRowSelection(item, true) this.$refs.seletingTable.toggleRowSelection(item, true)
}) })
}, },
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
title="选择门店" title="选择门店"
width="720px" width="720px"
@confirmDialog="handleAddConfirm" @confirmDialog="handleAddConfirm"
@closeDialog="handleClose"> @closeDialog="handleClose"
>
<div class="tableBox"> <div class="tableBox">
<div style="padding: 10px 50px"> <div style="padding: 10px 50px">
<el-input <el-input
...@@ -14,7 +15,8 @@ ...@@ -14,7 +15,8 @@
maxlength="20" maxlength="20"
clearable clearable
size="small" size="small"
style="width: 300px; margin-right: 12px" /> style="width: 300px; margin-right: 12px"
/>
<el-button size="small" type="primary" @click="searchList"> <el-button size="small" type="primary" @click="searchList">
查询 查询
</el-button> </el-button>
...@@ -24,7 +26,9 @@ ...@@ -24,7 +26,9 @@
:search-form="realSearchForm" :search-form="realSearchForm"
:table-params="tableParams" :table-params="tableParams"
:get-list-api="getListApi" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn"> :before-search-fn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
>
</d2-table> </d2-table>
</div> </div>
</d2-dialog> </d2-dialog>
...@@ -75,6 +79,21 @@ export default { ...@@ -75,6 +79,21 @@ export default {
}, },
mounted() {}, mounted() {},
methods: { methods: {
recoverySelection(list) {
var exitIds = this.selectedRecord.map((item) => item.merchantId)
console.log(
"this.$refs.merchantTable.toggleRowSelection",
this.$refs.merchantTable.$refs.merchantIndexMutiTable.toggleRowSelection
)
list.forEach((item) => {
console.log(exitIds.includes(item.merchantId + ""))
exitIds.includes(item.merchantId + "") &&
this.$refs.merchantTable.$refs.merchantIndexMutiTable.toggleRowSelection(
item,
true
)
})
},
beforeSearchFn() { beforeSearchFn() {
return new Promise((resolve) => { return new Promise((resolve) => {
if (this.config.scene == 0 || this.config.scene == 4) { if (this.config.scene == 0 || this.config.scene == 4) {
...@@ -86,6 +105,11 @@ export default { ...@@ -86,6 +105,11 @@ export default {
resolve() resolve()
}) })
}, },
setTableFinishFun(data) {
this.$nextTick(() => {
this.recoverySelection(data)
})
},
searchList() { searchList() {
this.$refs?.merchantTable?.refreshTable(true, true) this.$refs?.merchantTable?.refreshTable(true, true)
}, },
......
...@@ -333,7 +333,7 @@ export default { ...@@ -333,7 +333,7 @@ export default {
} }
} }
</script> </script>
<style scoped lang="scss" > <style scoped lang="scss">
// .dialog-jump { // .dialog-jump {
// color: #5850ff; // color: #5850ff;
// float: left; // float: left;
......
...@@ -84,7 +84,9 @@ ...@@ -84,7 +84,9 @@
</el-tooltip> </el-tooltip>
</div> </div>
<div class="tag-select-box"> <div class="tag-select-box">
<div class="tag-box-header">标签名称({{ selectNum }}项)</div> <div class="tag-box-header">
标签名称({{ selectNum }}项)<span @click="clearTag">清空</span>
</div>
<div class="tag-selected-box" :style="{ height: heightBox + 'px' }"> <div class="tag-selected-box" :style="{ height: heightBox + 'px' }">
<div <div
v-show="!!selectNum" v-show="!!selectNum"
...@@ -176,6 +178,18 @@ export default { ...@@ -176,6 +178,18 @@ export default {
} }
}, },
methods: { methods: {
clearTag() {
this.labelTreeRets.forEach((i) => {
i.checked = false
i.tagChecked = []
i.isIndeterminate = false
i.checkAll = false
})
this.labelTreeRetSelect.forEach((i) => {
i.tagChecked = []
})
this.selectNum = 0
},
init(item) { init(item) {
this.labelGroupName = "" this.labelGroupName = ""
this.labelTreeRetSelect = [] this.labelTreeRetSelect = []
...@@ -362,6 +376,7 @@ export default { ...@@ -362,6 +376,7 @@ export default {
}, },
//选中 //选中
handleCheckedChange(value, index, status) { handleCheckedChange(value, index, status) {
console.log(value, index, status)
let checkedCount = value.length let checkedCount = value.length
this.labelTreeRets[index].checkAll = this.labelTreeRets[index].checkAll =
checkedCount === this.labelTreeRets[index].labelList.length checkedCount === this.labelTreeRets[index].labelList.length
...@@ -386,7 +401,7 @@ export default { ...@@ -386,7 +401,7 @@ export default {
} }
</script> </script>
<style scoped lang="scss" > <style scoped lang="scss">
.select-tag { .select-tag {
.label-box { .label-box {
margin-left: 42px; margin-left: 42px;
...@@ -453,7 +468,13 @@ export default { ...@@ -453,7 +468,13 @@ export default {
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
line-height: 20px; line-height: 20px;
padding-left: 20px !important; padding: 0 20px !important;
display: flex;
span {
margin-left: auto;
cursor: pointer;
color: #5579bd;
}
} }
} }
.tag-title { .tag-title {
......
...@@ -112,7 +112,6 @@ export default { ...@@ -112,7 +112,6 @@ export default {
// _storeSearchForm.merchantIdName = _storeSearchForm.merchantName // 账户中心所有门店接口查询条件 // _storeSearchForm.merchantIdName = _storeSearchForm.merchantName // 账户中心所有门店接口查询条件
// } // }
console.log(this.storeSearchForm, "this.storeSearchForm") console.log(this.storeSearchForm, "this.storeSearchForm")
this.storeSearchForm.labelInfoList.length &&
this.storeApi({ this.storeApi({
...this.storeSearchForm, ...this.storeSearchForm,
pageNum: this.pageNum, pageNum: this.pageNum,
......
...@@ -73,8 +73,43 @@ ...@@ -73,8 +73,43 @@
<div class="main-box"> <div class="main-box">
<div class="cell"> <div class="cell">
<div class="label">员工对象:</div> <div class="label">员工对象:</div>
<div>
<div class="label m-b-10">
{{ getStaffVal(formData.selectStaffType) }}
</div>
<template>
<div
class="emp-table-box"
v-if="
[2, 3].includes(formData.selectStaffType) &&
empTableData.length
"
>
<el-table :data="empTableData" style="width: 100%">
<el-table-column type="index" width="50"> </el-table-column>
<el-table-column
prop="merchantName"
label="门店名称"
v-if="formData.selectStaffType == 2"
>
</el-table-column>
<el-table-column
prop="merchantId"
v-if="formData.selectStaffType == 2"
label="门店号"
width="100"
></el-table-column>
<el-table-column
prop="label"
v-if="formData.selectStaffType == 3"
label="品牌名称"
>
</el-table-column>
</el-table>
</div>
<div <div
v-show=" v-show="
formData.customerDataList &&
formData.customerDataList.length != 0 && formData.customerDataList.length != 0 &&
formData.customerDataList.some( formData.customerDataList.some(
(item) => item.labelList.length !== 0 (item) => item.labelList.length !== 0
...@@ -83,19 +118,6 @@ ...@@ -83,19 +118,6 @@
> >
<div class="customer-box m-t-10"> <div class="customer-box m-t-10">
<div class="el-input-tag input-tag-wrapper"> <div class="el-input-tag input-tag-wrapper">
<div class="customer-title">
发送员工:预估
<el-button
type="text"
:loading="customerLoading"
@click="handlePopStaff"
>
<span v-if="!customerLoading">{{
estimatedNumberOfPeople
}}</span>
</el-button>
人
</div>
<div> <div>
<div <div
v-for="(subItem, subIdx) in formData.customerDataList" v-for="(subItem, subIdx) in formData.customerDataList"
...@@ -107,16 +129,35 @@ ...@@ -107,16 +129,35 @@
class="customer-tag" class="customer-tag"
size="small" size="small"
type="info" type="info"
:closable="true"
:disable-transitions="false" :disable-transitions="false"
@close="handleDeleteCustomer(n, subIdx)" @close="handleDeleteCustomer(n, subIdx)"
> >
<span>{{ subItem.labelGroup.name }}:{{ k.name }}</span> <span
>{{ subItem.labelGroup.name }}:{{ k.name }}</span
>
</el-tag> </el-tag>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="customer-title">
发送员工:预估{{ estimatedNumberOfPeople || 0 }}
人
<el-button
type="text"
:loading="customerLoading"
@click="handlePopStaff"
>
<span v-if="!customerLoading && estimatedNumberOfPeople"
>查看明细</span
>
</el-button>
</div>
</template>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -132,6 +173,12 @@ ...@@ -132,6 +173,12 @@
{{ formData[item.prop] || "--" }} {{ formData[item.prop] || "--" }}
</div> </div>
</div> </div>
<div class="cell">
<div class="label">发送渠道:</div>
<div class="value">
{{ formData.sendChannelType == 1 ? "企业微信" : "展业助手" }}
</div>
</div>
</div> </div>
</div> </div>
<p style="text-align: center"> <p style="text-align: center">
...@@ -176,7 +223,9 @@ import { Util, deepClone } from "@/common/util" ...@@ -176,7 +223,9 @@ import { Util, deepClone } from "@/common/util"
import tableDialog from "./components/tableDialog" import tableDialog from "./components/tableDialog"
import { import {
contentManagerTaskById, contentManagerTaskById,
getListLabelStaffPage getListLabelStaffPage,
listMerchantStaffPage,
listBrandStaffPage
} from "@api/contentManager" } from "@api/contentManager"
import previewEffectDialog from "./components/previewEffectDialog" import previewEffectDialog from "./components/previewEffectDialog"
import textBox from "@/components/glsx-combi-form/textBox" import textBox from "@/components/glsx-combi-form/textBox"
...@@ -189,6 +238,31 @@ export default { ...@@ -189,6 +238,31 @@ export default {
}, },
data() { data() {
return { return {
empTableData: [],
empTypeList: [
{
label: "员工标签",
type: 1,
btn: "标签",
componentName: "selectTag"
},
{
label: "指令门店",
type: 2,
btn: "门店",
componentName: "merchantDialog"
},
{
label: "指令品牌",
type: 3,
btn: "品牌",
componentName: "brandDialog"
},
{
label: "全部员工",
type: 4
}
],
contentListData: [ contentListData: [
{ {
label: "标题:", label: "标题:",
...@@ -239,7 +313,8 @@ export default { ...@@ -239,7 +313,8 @@ export default {
sendTime: "", sendTime: "",
// formData: [], // formData: [],
customerDataList: [], customerDataList: [],
content: "" content: "",
selectStaffType: ""
}, },
showImageView: false, showImageView: false,
customerLoading: false, customerLoading: false,
...@@ -264,6 +339,9 @@ export default { ...@@ -264,6 +339,9 @@ export default {
handleStoreInput(e) { handleStoreInput(e) {
e.keyCode === 13 && this.handleSearchStore() e.keyCode === 13 && this.handleSearchStore()
}, },
getStaffVal(type) {
return this.empTypeList.find((i) => i.type == type)?.label
},
// 门店弹窗点击查询 // 门店弹窗点击查询
handleSearchStore() { handleSearchStore() {
this.$refs.formRelateStore.handleCurrentChange(1) this.$refs.formRelateStore.handleCurrentChange(1)
...@@ -294,6 +372,30 @@ export default { ...@@ -294,6 +372,30 @@ export default {
handlePopStaff() { handlePopStaff() {
this.relateStoreVisible = true this.relateStoreVisible = true
}, },
getCustomerList() {
const merchantIds = this.empTableData.map((item) => item.merchantId)
const brandIds = this.empTableData.map((item) => item.id)
if (!merchantIds.length && !brandIds.length) {
this.estimatedNumberOfPeople = 0
return
}
const params = {
pageSize: 999999,
merchantIds,
brandIds,
pageNum: 1
}
this.getList =
this.formData.selectStaffType == 2
? listMerchantStaffPage
: listBrandStaffPage
this.storeSearchForm = params
this.customerLoading = true
this.getList(params).then((res) => {
this.estimatedNumberOfPeople = res?.total || 0
this.customerLoading = false
})
},
getCustomerByTagList(type) { getCustomerByTagList(type) {
let params = {} let params = {}
if (type == "filtrate") { if (type == "filtrate") {
...@@ -381,14 +483,35 @@ export default { ...@@ -381,14 +483,35 @@ export default {
this.formData[key] = res[key] this.formData[key] = res[key]
} }
} }
this.formData.customerDataList = this.transformLabelList(
res.labelList
)
// 初始化 富文本内容 // 初始化 富文本内容
this.formData.contentType == 1 && this.handleTextBoxFocus() this.formData.contentType == 1 && this.handleTextBoxFocus()
if (this.formData.selectStaffType == 1) {
this.formData.customerDataList = this.transformLabelList(
res.labelList
)
this.getCustomerByTagList("filtrate") this.getCustomerByTagList("filtrate")
} }
const selectStaffValue = JSON.parse(res.selectStaffValue || "{}")
if (this.formData.selectStaffType == 2) {
for (let [key, value] of Object.entries(selectStaffValue)) {
this.empTableData.push({
merchantId: key,
merchantName: value
})
}
this.getCustomerList()
}
if (this.formData.selectStaffType == 3) {
for (let [key, value] of Object.entries(selectStaffValue)) {
this.empTableData.push({
id: key,
label: value
})
}
this.getCustomerList()
}
}
}) })
// contentManagerTaskById({ id }).then((res) => { // contentManagerTaskById({ id }).then((res) => {
// const typeNameMap = { // const typeNameMap = {
...@@ -614,6 +737,9 @@ export default { ...@@ -614,6 +737,9 @@ export default {
.img-size { .img-size {
cursor: pointer; cursor: pointer;
} }
.emp-table-box {
width: 567px;
}
.customer-box { .customer-box {
width: 567px; width: 567px;
background-color: #fff; background-color: #fff;
......
...@@ -65,7 +65,11 @@ ...@@ -65,7 +65,11 @@
<script> <script>
import { Util, deepClone } from "@/common/util" import { Util, deepClone } from "@/common/util"
import { mapActions, mapState } from "vuex" import { mapActions, mapState } from "vuex"
import { contentTypeList, sendStatusList } from "@/common/constants.js" import {
contentTypeList,
sendStatusList,
channelTypeList
} from "@/common/constants.js"
// import { rewithdraw } from '@api/withdrawalManage' // import { rewithdraw } from '@api/withdrawalManage'
import { contentManagerTaskPage, deleteTaskById } from "@api/contentManager" import { contentManagerTaskPage, deleteTaskById } from "@api/contentManager"
// import addDialog from './components/addDialog' // import addDialog from './components/addDialog'
...@@ -109,6 +113,15 @@ export default { ...@@ -109,6 +113,15 @@ export default {
optionId: "confId", optionId: "confId",
optionLabel: "confValue", optionLabel: "confValue",
optionsName: "sendStatusList" optionsName: "sendStatusList"
},
{
label: "发送渠道",
name: "sendChannelType",
type: "select",
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "channelTypeList"
} }
], ],
getListApi: contentManagerTaskPage, getListApi: contentManagerTaskPage,
...@@ -134,6 +147,16 @@ export default { ...@@ -134,6 +147,16 @@ export default {
} }
}, },
{ {
label: "发送渠道",
prop: "sendChannelType",
width: "100px",
formatter: (cellValue) => {
return this.baseData.channelTypeList.find(
(item) => item.confId === cellValue.sendChannelType
)?.confValue
}
},
{
label: "发送时间", label: "发送时间",
prop: "sendTime", prop: "sendTime",
width: "150px", width: "150px",
...@@ -177,7 +200,8 @@ export default { ...@@ -177,7 +200,8 @@ export default {
}, },
baseData: { baseData: {
contentTypeList: deepClone(contentTypeList), contentTypeList: deepClone(contentTypeList),
sendStatusList: deepClone(sendStatusList) sendStatusList: deepClone(sendStatusList),
channelTypeList: deepClone(channelTypeList)
}, },
infos: [], infos: [],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!