Commit eb287a02 by 前端

Merge branch 'SAAS+V4.51.1-0415' of http://192.168.3.233:8090/saas_plus/dj-car-l…

…ife-system into SAAS+V4.51.1-0415
2 parents fec32db0 61af887e
......@@ -250,6 +250,14 @@ export function getCustomerInfoDetail(data) {
data.method = `dj.api.mindworkplate.customervisit.getCustomerInfoDetail`
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")
}
/** 标签列表 */
export function findAllTags(data = {}) {
......@@ -261,4 +269,4 @@ export function findAllTags(data = {}) {
export function findAllLevel(data = {}) {
data.method = `dj.api.material.scenemarket.findAllLevel`
return request(data, "post")
}
\ No newline at end of file
}
......@@ -1170,7 +1170,13 @@ export const teaching_storeTypeOpt = [
{ confId: 0, confValue: "老店" },
{ confId: 1, confValue: "新店" }
]
// 话术业务场景
export const channelTypeList = [
{ confId: 1, confValue: "企业微信" },
{ confId: 2, confValue: "展业app" }
]
// 预警管理 所属业务
export const businessSceneOpt = [
{ confId: 0, confValue: "延保" },
......
......@@ -118,76 +118,113 @@
<el-form-item
label-width="120px"
label="员工对象:"
prop="customerDataList"
prop="selectStaffType"
>
<el-button
v-show="
formData.customerDataList.length == 0 ||
formData.customerDataList.every(
(item) => item.labelList.length == 0
)
"
class="screeningCustomers default-blue-btn el-icon-plus m-t-10"
size="small"
@click="viewMembers()"
>
去选择
</el-button>
<div
v-show="
formData.customerDataList.length != 0 &&
formData.customerDataList.some(
(item) => item.labelList.length !== 0
)
"
>
<div class="customer-box m-t-10">
<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
v-for="(subItem, subIdx) in formData.customerDataList"
:key="subIdx"
>
<el-tag
v-for="(k, n) in subItem.labelList"
:key="n"
class="customer-tag"
<div>
<el-radio-group v-model="formData.selectStaffType">
<el-radio
:label="item.type"
v-for="item in empTypeList"
:key="item.type"
>{{ item.label }}</el-radio
>
</el-radio-group>
</div>
<template v-if="getEmpType.btn">
<el-button class="radio-box" size="small" @click="addEmp"
>添加{{ getEmpType.btn }}</el-button
>
<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-column fixed="right" label="操作" width="120">
<template slot-scope="scope">
<el-button
@click.native.prevent="
deleteRow(scope.$index, empTableData)
"
type="text"
size="small"
type="info"
:closable="true"
:disable-transitions="false"
@close="handleDeleteCustomer(n, subIdx)"
>
<span
>{{ subItem.labelGroup.name }}:{{ k.name }}</span
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div
v-show="
formData.customerDataList.length != 0 &&
formData.customerDataList.some(
(item) => item.labelList.length !== 0
)
"
>
<div class="customer-box m-t-10">
<div class="el-input-tag input-tag-wrapper">
<div>
<div
v-for="(subItem, subIdx) in formData.customerDataList"
:key="subIdx"
>
<el-tag
v-for="(k, n) in subItem.labelList"
:key="n"
class="customer-tag"
size="small"
type="info"
:closable="true"
:disable-transitions="false"
@close="handleDeleteCustomer(n, subIdx)"
>
</el-tag>
<span
>{{ subItem.labelGroup.name }}:{{ k.name }}</span
>
</el-tag>
</div>
</div>
</div>
</div>
</div>
<div class="m-t-10 screeningCustomers">
<el-button type="text" @click="handleSelectCustomer()"
>编辑</el-button
>
<el-button type="text" @click="handleResetCustomer()"
>重置</el-button
<div class="customer-title">
发送员工:预估{{ estimatedNumberOfPeople || 0 }}
人
<el-button
type="text"
:loading="customerLoading"
@click="handlePopStaff"
>
<span v-if="!customerLoading && estimatedNumberOfPeople"
>查看明细</span
>
</el-button>
</div>
</div>
</template>
</el-form-item>
</el-form>
</div>
......@@ -227,6 +264,16 @@
>
</el-date-picker>
</el-form-item>
<el-form-item
label-width="120px"
label="发送渠道:"
prop="sendChannelType"
>
<el-radio-group v-model="formData.sendChannelType">
<el-radio :label="1">企业微信</el-radio>
<el-radio :label="2">展业助手</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</div>
</div>
......@@ -286,12 +333,23 @@
<el-dialog :visible.sync="lookImgVisible">
<img width="100%" :src="dialogObj.url" alt="图片" />
</el-dialog>
<select-tag
<component
:is="getEmpType.componentName"
:labelTypesStr="'企业标签'"
:relateStoreVisible="groupVisible"
:dialogVisible="groupVisible"
:config="{
scene: 2
}"
ref="selectTagForm"
@tagSelected="handleDialogConfirm"
:dialogVisible="isTagVisible"
:labelTypesStr="'企业标签'"
></select-tag>
@closeDialogFn="closeGroupDialog"
:storeSelected="empTableData"
:selectedRecord="empTableData"
@handleRelateStoreClose="closeGroupDialog"
@handleRelateStoreConfirm="confirmGroup"
@confirmDialogFn="confirmGroup"
></component>
</d2-container>
</template>
......@@ -302,27 +360,59 @@ import selectTag from "./components/selectTag"
import preview from "./components/preview"
import uploadPdf from "./components/uploadPdf"
import tableDialog from "./components/tableDialog"
import brandDialog from "./components/brandDialog"
import merchantDialog from "./components/merchantDialog"
import previewEffectDialog from "./components/previewEffectDialog"
import { getList, getAccountMerchantList } from "@/api/merchant"
import textBox from "@/components/glsx-combi-form/textBox"
import {
insertOrUpdate,
contentManagerTaskById,
getListLabelStaffPage
getListLabelStaffPage,
listMerchantStaffPage,
listBrandStaffPage
} from "@api/contentManager"
export default {
name: "SopContentAdd",
components: {
brandDialog,
glsxPreview: preview,
uploadPdf,
tableDialog,
previewEffectDialog,
merchantDialog,
textBox,
selectTag: selectTag
},
data() {
return {
empTableData: [],
empTypeList: [
{
label: "员工标签",
type: 1,
btn: "标签",
componentName: "selectTag"
},
{
label: "指令门店",
type: 2,
btn: "门店",
componentName: "merchantDialog"
},
{
label: "指令品牌",
type: 3,
btn: "品牌",
componentName: "brandDialog"
},
{
label: "全部员工",
type: 4
}
],
loading: false,
groupVisible: false,
type: 1,
estimatedNumberOfPeople: "",
customerDataList: [],
......@@ -398,7 +488,9 @@ export default {
sendTime: "",
formData: [],
customerDataList: [],
content: ""
content: "",
selectStaffType: 1,
sendChannelType: 1
},
rules: {
title: [{ required: true, message: "请输入标题", trigger: "change" }],
......@@ -502,6 +594,11 @@ export default {
}
},
watch: {
"formData.selectStaffType"() {
this.empTableData = []
this.estimatedNumberOfPeople = 0
this.formData.customerDataList = []
},
"formData.sendTime"(selectTime) {
const selectedDate = new Date(selectTime)
const selectedDateWithoutTime = new Date(
......@@ -575,7 +672,14 @@ export default {
// }
// }
},
computed: {
getEmpType() {
const val = this.empTypeList.find(
(i) => i.type == this.formData.selectStaffType
)
return val || this.empTypeList[0]
}
},
mounted() {
const { id } = this.$route.query
this.routeInfo = this.$route.query
......@@ -585,6 +689,10 @@ export default {
},
methods: {
deleteRow(index, rows) {
rows.splice(index, 1)
this.getCustomerList()
},
getSelectableRange() {
const currentDate = new Date()
currentDate.setMinutes(currentDate.getMinutes() + 30)
......@@ -595,6 +703,7 @@ export default {
this.customerLoading = true
this.getCustomerByTagList("filtrate")
},
handlePopStaff() {
this.relateStoreVisible = true
},
......@@ -624,7 +733,6 @@ export default {
}
// params.labelInfoList = params.labelInfoList || []
this.storeSearchForm.labelInfoList = params.labelInfoList || []
console.log(params, "params")
params.labelInfoList.length &&
getListLabelStaffPage(params)
......@@ -640,19 +748,57 @@ export default {
handleDialogConfirm(val) {
this.formData.customerDataList = val
this.customerLoading = true
this.getList = getListLabelStaffPage
this.getCustomerByTagList("filtrate")
},
closeGroupDialog() {
this.groupVisible = false
},
confirmGroup(val) {
this.empTableData = val
this.groupVisible = false
this.getCustomerList()
},
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
})
},
addEmp() {
if (this.getEmpType.type == 1) {
this.viewMembers()
} else {
this.groupVisible = true
this.$refs.selectTagForm.searchList &&
this.$refs.selectTagForm.searchList()
this.$refs.selectTagForm.getSelectingList &&
this.$refs.selectTagForm.getSelectingList()
}
},
// 查看群发人数
viewMembers() {
this.handleSelectCustomer()
},
handleResetCustomer() {
this.formData.customerDataList = []
this.customerLoading = false
this.estimatedNumberOfPeople = ""
this.$refs.selectTagForm.labelTreeRetSelect = []
},
handleSelectCustomer() {
this.isTagVisible = !this.isTagVisible
this.$refs.selectTagForm.init(
......@@ -724,13 +870,37 @@ export default {
this.formData[key] = res[key]
}
}
this.formData.customerDataList = this.transformLabelList(
res.labelList
)
this.$nextTick(() => {
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()
}
if (this.formData.selectStaffType == 1) {
this.formData.customerDataList = this.transformLabelList(
res.labelList
)
this.getCustomerByTagList("filtrate")
}
})
// 初始化 富文本内容
this.formData.contentType == 1 && this.handleTextBoxFocus()
this.getCustomerByTagList("filtrate")
}
})
},
......@@ -837,6 +1007,16 @@ export default {
commitFn(type) {
const params = this.getParams(type)
params.saveDraft = !Boolean(type)
const selectStaffValue = {}
this.empTableData.forEach((i) => {
if (i.merchantId) {
selectStaffValue[i.merchantId] = i.merchantName
}
if (i.id) {
selectStaffValue[i.id] = i.label
}
})
params.selectStaffValue = JSON.stringify(selectStaffValue)
// const _api = params.id ? updateContent : addContent
this.loading = true
insertOrUpdate(params).then((res) => {
......@@ -1019,10 +1199,16 @@ export default {
.publish-info {
padding: 16px 20px;
}
.radio-box {
margin-bottom: 10px;
}
.btn-class {
background: #f8f8f8;
}
}
.emp-table-box {
width: 567px;
}
.customer-box {
width: 567px;
background-color: #fff;
......
......@@ -7,7 +7,8 @@
btn-ok-label="确定"
@confirmDialog="handleRelateStoreConfirm"
@closeDialog="handleRelateStoreClose"
class="relateStore">
class="relateStore"
>
<el-form :model="storeSearchForm" ref="relate" :inline="true">
<el-form-item label="品牌名称:">
<el-input
......@@ -15,7 +16,8 @@
placeholder="品牌名称"
max-length="20"
@keydown.native="handleStoreInput"
clearable />
clearable
/>
</el-form-item>
<el-button type="primary" @click="handleCurrentChange(1)">搜索</el-button>
</el-form>
......@@ -28,7 +30,8 @@
class="table"
border
@select="handleChange"
@select-all="handleAll">
@select-all="handleAll"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column prop="label" label="品牌名称" align="center">
</el-table-column>
......@@ -40,13 +43,15 @@
:current-page.sync="currentPage"
:page-size="pageSize"
layout="total, prev, pager, next"
:total="total" />
:total="total"
/>
</div>
<el-table
class="tableBox table"
:data="selectedData"
border
height="464px">
height="464px"
>
<el-table-column prop="merchantName" label="品牌名称" align="center">
<template slot-scope="scope">
<span>{{ scope.row.label }}</span>
......@@ -57,7 +62,8 @@
<el-button
class="el-icon-delete"
@click="handleDelete(scope.row)"
type="text" />
type="text"
/>
</template>
</el-table-column>
</el-table>
......@@ -102,6 +108,7 @@ export default {
var exitIds = this.selectedData.map((item) => item.id)
this.selectingData.forEach((item) => {
exitIds.includes(item.id) &&
this.$refs.seletingTable &&
this.$refs.seletingTable.toggleRowSelection(item, true)
})
},
......@@ -123,8 +130,8 @@ export default {
addOrDelete
? this.selectedData.push(row)
: (this.selectedData = this.selectedData.filter(
(item) => item.id !== row.id
))
(item) => item.id !== row.id
))
},
handleAll(selection) {
this.selectingData.forEach((item) => {
......
......@@ -5,7 +5,8 @@
title="选择门店"
width="720px"
@confirmDialog="handleAddConfirm"
@closeDialog="handleClose">
@closeDialog="handleClose"
>
<div class="tableBox">
<div style="padding: 10px 50px">
<el-input
......@@ -14,7 +15,8 @@
maxlength="20"
clearable
size="small"
style="width: 300px; margin-right: 12px" />
style="width: 300px; margin-right: 12px"
/>
<el-button size="small" type="primary" @click="searchList">
查询
</el-button>
......@@ -24,7 +26,9 @@
:search-form="realSearchForm"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn">
:before-search-fn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
>
</d2-table>
</div>
</d2-dialog>
......@@ -75,6 +79,21 @@ export default {
},
mounted() {},
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() {
return new Promise((resolve) => {
if (this.config.scene == 0 || this.config.scene == 4) {
......@@ -86,6 +105,11 @@ export default {
resolve()
})
},
setTableFinishFun(data) {
this.$nextTick(() => {
this.recoverySelection(data)
})
},
searchList() {
this.$refs?.merchantTable?.refreshTable(true, true)
},
......
......@@ -333,7 +333,7 @@ export default {
}
}
</script>
<style scoped lang="scss" >
<style scoped lang="scss">
// .dialog-jump {
// color: #5850ff;
// float: left;
......
......@@ -84,7 +84,9 @@
</el-tooltip>
</div>
<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
v-show="!!selectNum"
......@@ -176,6 +178,18 @@ export default {
}
},
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) {
this.labelGroupName = ""
this.labelTreeRetSelect = []
......@@ -362,6 +376,7 @@ export default {
},
//选中
handleCheckedChange(value, index, status) {
console.log(value, index, status)
let checkedCount = value.length
this.labelTreeRets[index].checkAll =
checkedCount === this.labelTreeRets[index].labelList.length
......@@ -386,7 +401,7 @@ export default {
}
</script>
<style scoped lang="scss" >
<style scoped lang="scss">
.select-tag {
.label-box {
margin-left: 42px;
......@@ -453,7 +468,13 @@ export default {
font-weight: 400;
color: #333333;
line-height: 20px;
padding-left: 20px !important;
padding: 0 20px !important;
display: flex;
span {
margin-left: auto;
cursor: pointer;
color: #5579bd;
}
}
}
.tag-title {
......
<!-- 关联门店弹窗 -->
<template>
<d2-dialog
:title="title"
:is-visible.sync="relateStoreVisible"
width="50%"
btn-ok-label="确定"
@confirmDialog="handleRelateStoreConfirm"
@closeDialog="handleRelateStoreClose"
class="relateStore"
>
<slot />
<el-row class="tableCon">
<div class="tableBox">
<!-- height="300px" -->
<el-table
ref="seletingTable"
:data="selectingData"
class="table"
border
v-loading="$store.state.d2admin.loading.value"
>
<el-table-column label="序号" type="index" align="center" width="60">
<template slot-scope="scope">{{
(pageNum - 1) * pageSize + scope.$index + 1
}}</template>
</el-table-column>
<!-- @select="handleChange"
@select-all="handleAll" -->
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<!-- <el-table-column prop="merchantName" label="门店名称" align="center">
</el-table-column> -->
<el-table-column prop="staffName" label="员工名称" align="center">
</el-table-column>
<el-table-column prop="phoneNumber" label="手机号" align="center">
</el-table-column>
</el-table>
<el-pagination
small
background
@current-change="handleCurrentChange"
:current-page.sync="pageNum"
:page-size="pageSize"
layout="total, prev, pager, next"
:total="total"
/>
</div>
</el-row>
</d2-dialog>
</template>
<script>
export default {
name: "SelectEmployees",
data() {
return {
selectedData: [],
selectingData: [],
// 分页
total: 0,
pageNum: 1,
pageSize: 10
}
},
props: {
title: {
type: String,
default: "驻店员工"
},
relateStoreVisible: {
type: Boolean,
default: false
},
storeApi: {
type: Function,
default: () => {}
},
storeSelected: {
type: Array,
default: () => []
},
storeSearchForm: {
type: Object,
default: () => {}
},
merchantIds: {
type: Array,
default: () => []
}
},
mounted() {
this.selectedData = this.storeSelected
this.getSelectingList()
console.log(this.selectedData, "---------")
},
methods: {
recoverySelection() {
var exitIds = this.selectedData.map((item) => item.staffUuid)
this.selectingData.forEach((item) => {
exitIds.includes(item.staffUuid) &&
this.$refs.seletingTable.toggleRowSelection(item, true)
})
},
getSelectingList() {
const _storeSearchForm = this.storeSearchForm
// 会员权益/积分商城获取账户中心所有门店 接口不同 接口新增查询参数merchantName 不需单独处理
// if ([0, 4].includes(this.selectedScene)) {
// // 会员权益,积分商城场景查询门店名称参数
// _storeSearchForm.merchantIdName = _storeSearchForm.merchantName // 账户中心所有门店接口查询条件
// }
console.log(this.storeSearchForm, "this.storeSearchForm")
this.storeSearchForm.labelInfoList.length &&
this.storeApi({
...this.storeSearchForm,
pageNum: this.pageNum,
pageSize: this.pageSize
// merchantNoList: this.merchantIds
}).then((res) => {
// res?.forEach((val) => {
// 账户中心门店返回商户号字段是merchantNo
// if (val.merchantNo) val.merchantId = Number(val.merchantNo)
// val?.sceneList?.forEach((subVal) => {
// if (subVal.scene == this.selectedScene) {
// val.yqMerchantId = subVal?.yqMerchant?.merchantId || "-"
// val.yqMerchantName = subVal?.yqMerchant?.merchantName || "-"
// }
// })
// })
this.selectingData = res.list
this.total = res.total
this.$nextTick(() => {
this.recoverySelection()
})
})
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(
(item) => item.staffUuid === row.staffUuid
)
addOrDelete
? this.selectedData.push(row)
: (this.selectedData = this.selectedData.filter(
(item) => item.staffUuid !== row.staffUuid
))
},
handleAll(selection) {
this.selectingData.forEach((item) => {
var isExit = this.selectedData.findIndex(
(subItem) => subItem.staffUuid === item.staffUuid
)
if (selection.length && isExit === -1) {
this.selectedData.push(item)
} else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1)
}
})
},
handleDelete(row) {
this.selectedData = this.selectedData.filter(
(item) => item.staffUuid !== row.staffUuid
)
const obj = this.selectingData.find((v) => v.staffUuid == row.staffUuid)
this.$refs.seletingTable.toggleRowSelection(obj)
},
handleCurrentChange(val) {
this.pageNum = val
this.getSelectingList()
},
handleRelateStoreConfirm() {
this.$emit("handleRelateStoreConfirm", this.selectedData)
},
handleRelateStoreClose() {
this.$emit("handleRelateStoreClose")
}
}
}
</script>
<style lang="scss">
.relateStore .table {
margin: 0 auto 20px !important;
width: 98%;
}
.relateStore .tableCon {
margin-top: 20px;
display: flex;
.tableBox {
flex: 1;
}
}
.service-store .relateStore .el-table .cell,
.d2-form .relateStore .el-table .cell {
line-height: 26px !important;
}
.service-store .relateStore .el-table--medium td,
.d2-form .relateStore .el-table--medium td {
padding: 6px 8px !important;
}
.relateStore .red {
color: red;
}
.relateStore .tip-icon {
position: absolute;
display: inline-block;
height: 10px;
width: 10px;
line-height: 10px;
color: #ffffff;
background-color: red;
border: 1px solid red;
border-radius: 50%;
cursor: pointer;
font-size: 6px;
margin-left: 2px;
}
</style>
<!-- 关联门店弹窗 -->
<template>
<d2-dialog
:title="title"
:is-visible.sync="relateStoreVisible"
width="50%"
btn-ok-label="确定"
@confirmDialog="handleRelateStoreConfirm"
@closeDialog="handleRelateStoreClose"
class="relateStore"
>
<slot />
<el-row class="tableCon">
<div class="tableBox">
<!-- height="300px" -->
<el-table
ref="seletingTable"
:data="selectingData"
class="table"
border
v-loading="$store.state.d2admin.loading.value"
>
<el-table-column label="序号" type="index" align="center" width="60">
<template slot-scope="scope">{{
(pageNum - 1) * pageSize + scope.$index + 1
}}</template>
</el-table-column>
<!-- @select="handleChange"
@select-all="handleAll" -->
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<!-- <el-table-column prop="merchantName" label="门店名称" align="center">
</el-table-column> -->
<el-table-column prop="staffName" label="员工名称" align="center">
</el-table-column>
<el-table-column prop="phoneNumber" label="手机号" align="center">
</el-table-column>
</el-table>
<el-pagination
small
background
@current-change="handleCurrentChange"
:current-page.sync="pageNum"
:page-size="pageSize"
layout="total, prev, pager, next"
:total="total"
/>
</div>
</el-row>
</d2-dialog>
</template>
<script>
export default {
name: "SelectEmployees",
data() {
return {
selectedData: [],
selectingData: [],
// 分页
total: 0,
pageNum: 1,
pageSize: 10
}
},
props: {
title: {
type: String,
default: "驻店员工"
},
relateStoreVisible: {
type: Boolean,
default: false
},
storeApi: {
type: Function,
default: () => {}
},
storeSelected: {
type: Array,
default: () => []
},
storeSearchForm: {
type: Object,
default: () => {}
},
merchantIds: {
type: Array,
default: () => []
}
},
mounted() {
this.selectedData = this.storeSelected
this.getSelectingList()
console.log(this.selectedData, "---------")
},
methods: {
recoverySelection() {
var exitIds = this.selectedData.map((item) => item.staffUuid)
this.selectingData.forEach((item) => {
exitIds.includes(item.staffUuid) &&
this.$refs.seletingTable.toggleRowSelection(item, true)
})
},
getSelectingList() {
const _storeSearchForm = this.storeSearchForm
// 会员权益/积分商城获取账户中心所有门店 接口不同 接口新增查询参数merchantName 不需单独处理
// if ([0, 4].includes(this.selectedScene)) {
// // 会员权益,积分商城场景查询门店名称参数
// _storeSearchForm.merchantIdName = _storeSearchForm.merchantName // 账户中心所有门店接口查询条件
// }
console.log(this.storeSearchForm, "this.storeSearchForm")
this.storeApi({
...this.storeSearchForm,
pageNum: this.pageNum,
pageSize: this.pageSize
// merchantNoList: this.merchantIds
}).then((res) => {
// res?.forEach((val) => {
// 账户中心门店返回商户号字段是merchantNo
// if (val.merchantNo) val.merchantId = Number(val.merchantNo)
// val?.sceneList?.forEach((subVal) => {
// if (subVal.scene == this.selectedScene) {
// val.yqMerchantId = subVal?.yqMerchant?.merchantId || "-"
// val.yqMerchantName = subVal?.yqMerchant?.merchantName || "-"
// }
// })
// })
this.selectingData = res.list
this.total = res.total
this.$nextTick(() => {
this.recoverySelection()
})
})
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(
(item) => item.staffUuid === row.staffUuid
)
addOrDelete
? this.selectedData.push(row)
: (this.selectedData = this.selectedData.filter(
(item) => item.staffUuid !== row.staffUuid
))
},
handleAll(selection) {
this.selectingData.forEach((item) => {
var isExit = this.selectedData.findIndex(
(subItem) => subItem.staffUuid === item.staffUuid
)
if (selection.length && isExit === -1) {
this.selectedData.push(item)
} else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1)
}
})
},
handleDelete(row) {
this.selectedData = this.selectedData.filter(
(item) => item.staffUuid !== row.staffUuid
)
const obj = this.selectingData.find((v) => v.staffUuid == row.staffUuid)
this.$refs.seletingTable.toggleRowSelection(obj)
},
handleCurrentChange(val) {
this.pageNum = val
this.getSelectingList()
},
handleRelateStoreConfirm() {
this.$emit("handleRelateStoreConfirm", this.selectedData)
},
handleRelateStoreClose() {
this.$emit("handleRelateStoreClose")
}
}
}
</script>
<style lang="scss">
.relateStore .table {
margin: 0 auto 20px !important;
width: 98%;
}
.relateStore .tableCon {
margin-top: 20px;
display: flex;
.tableBox {
flex: 1;
}
}
.service-store .relateStore .el-table .cell,
.d2-form .relateStore .el-table .cell {
line-height: 26px !important;
}
.service-store .relateStore .el-table--medium td,
.d2-form .relateStore .el-table--medium td {
padding: 6px 8px !important;
}
.relateStore .red {
color: red;
}
.relateStore .tip-icon {
position: absolute;
display: inline-block;
height: 10px;
width: 10px;
line-height: 10px;
color: #ffffff;
background-color: red;
border: 1px solid red;
border-radius: 50%;
cursor: pointer;
font-size: 6px;
margin-left: 2px;
}
</style>
......@@ -15,12 +15,12 @@
<div v-else-if="item.type == 'list'" class="table-box">
<!-- 表格数据 -->
<div class="table-title">
{{
{{ orderInfo.showMerchant ?
orderInfo.showMerchant == 1
? "指定品牌"
: orderInfo.showMerchant == 2
? "指定门店"
: "全部门店"
: "全部门店": "-"
}}
</div>
<el-table v-if="orderInfo.showMerchant" :data="orderInfo[item.prop]" border :header-cell-style="{
......@@ -217,7 +217,7 @@
<div v-if="sceneConfig" class="file-box">
<div @click="toOpenPDF(i)" class="file-box-inner">
<img class="icon" src="../../assets/pdf.png" />
<div class="title-desc">{{ orderInfo.title }}.pdf</div>
<div class="title-desc">{{ orderInfo.detailInfos[0].imageName }}</div>
</div>
</div>
</div>
......
......@@ -73,49 +73,90 @@
<div class="main-box">
<div class="cell">
<div class="label">员工对象:</div>
<div
v-show="
formData.customerDataList.length != 0 &&
formData.customerDataList.some(
(item) => item.labelList.length !== 0
)
"
>
<div class="customer-box m-t-10">
<div class="el-input-tag input-tag-wrapper">
<div class="customer-title">
发送员工:预估
<el-button
type="text"
:loading="customerLoading"
@click="handlePopStaff"
<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"
>
<span v-if="!customerLoading">{{
estimatedNumberOfPeople
}}</span>
</el-button>
人
</div>
<div>
<div
v-for="(subItem, subIdx) in formData.customerDataList"
:key="subIdx"
</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-tag
v-for="(k, n) in subItem.labelList"
:key="n"
class="customer-tag"
size="small"
type="info"
:disable-transitions="false"
@close="handleDeleteCustomer(n, subIdx)"
>
<span>{{ subItem.labelGroup.name }}:{{ k.name }}</span>
</el-tag>
</el-table-column>
</el-table>
</div>
<div
v-show="
formData.customerDataList &&
formData.customerDataList.length != 0 &&
formData.customerDataList.some(
(item) => item.labelList.length !== 0
)
"
>
<div class="customer-box m-t-10">
<div class="el-input-tag input-tag-wrapper">
<div>
<div
v-for="(subItem, subIdx) in formData.customerDataList"
:key="subIdx"
>
<el-tag
v-for="(k, n) in subItem.labelList"
:key="n"
class="customer-tag"
size="small"
type="info"
:closable="true"
:disable-transitions="false"
@close="handleDeleteCustomer(n, subIdx)"
>
<span
>{{ subItem.labelGroup.name }}:{{ k.name }}</span
>
</el-tag>
</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>
......@@ -132,6 +173,12 @@
{{ formData[item.prop] || "--" }}
</div>
</div>
<div class="cell">
<div class="label">发送渠道:</div>
<div class="value">
{{ formData.sendChannelType == 1 ? "企业微信" : "展业助手" }}
</div>
</div>
</div>
</div>
<p style="text-align: center">
......@@ -176,7 +223,9 @@ import { Util, deepClone } from "@/common/util"
import tableDialog from "./components/tableDialog"
import {
contentManagerTaskById,
getListLabelStaffPage
getListLabelStaffPage,
listMerchantStaffPage,
listBrandStaffPage
} from "@api/contentManager"
import previewEffectDialog from "./components/previewEffectDialog"
import textBox from "@/components/glsx-combi-form/textBox"
......@@ -189,6 +238,31 @@ export default {
},
data() {
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: [
{
label: "标题:",
......@@ -239,7 +313,8 @@ export default {
sendTime: "",
// formData: [],
customerDataList: [],
content: ""
content: "",
selectStaffType: ""
},
showImageView: false,
customerLoading: false,
......@@ -264,6 +339,9 @@ export default {
handleStoreInput(e) {
e.keyCode === 13 && this.handleSearchStore()
},
getStaffVal(type) {
return this.empTypeList.find((i) => i.type == type)?.label
},
// 门店弹窗点击查询
handleSearchStore() {
this.$refs.formRelateStore.handleCurrentChange(1)
......@@ -294,6 +372,30 @@ export default {
handlePopStaff() {
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) {
let params = {}
if (type == "filtrate") {
......@@ -381,13 +483,34 @@ export default {
this.formData[key] = res[key]
}
}
this.formData.customerDataList = this.transformLabelList(
res.labelList
)
// 初始化 富文本内容
this.formData.contentType == 1 && this.handleTextBoxFocus()
this.getCustomerByTagList("filtrate")
if (this.formData.selectStaffType == 1) {
this.formData.customerDataList = this.transformLabelList(
res.labelList
)
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) => {
......@@ -614,6 +737,9 @@ export default {
.img-size {
cursor: pointer;
}
.emp-table-box {
width: 567px;
}
.customer-box {
width: 567px;
background-color: #fff;
......
......@@ -65,7 +65,11 @@
<script>
import { Util, deepClone } from "@/common/util"
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 { contentManagerTaskPage, deleteTaskById } from "@api/contentManager"
// import addDialog from './components/addDialog'
......@@ -109,6 +113,15 @@ export default {
optionId: "confId",
optionLabel: "confValue",
optionsName: "sendStatusList"
},
{
label: "发送渠道",
name: "sendChannelType",
type: "select",
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "channelTypeList"
}
],
getListApi: contentManagerTaskPage,
......@@ -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: "发送时间",
prop: "sendTime",
width: "150px",
......@@ -177,7 +200,8 @@ export default {
},
baseData: {
contentTypeList: deepClone(contentTypeList),
sendStatusList: deepClone(sendStatusList)
sendStatusList: deepClone(sendStatusList),
channelTypeList: deepClone(channelTypeList)
},
infos: [],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!