Commit 6c5b06a0 by 杨明

fixed

1 parent 57810959
......@@ -301,16 +301,12 @@ export default {
const splitStr = file.name.split('.')
const fileUrl = splitStr[splitStr.length - 1] + '@' + arrBase64[1]
this.$apis.common.pictureUpload({ file: fileUrl }).then(res => {
console.log(res)
if (res) {
this.importName = file.name
this.exportUrl = res
this.handleSaveImport()
}
this.$refs.file.value = ''
this.downloadStatus = false
this.percentage = 0
clearInterval(this.setInter)
})
}
},
......@@ -329,6 +325,9 @@ export default {
this.importName = ''
this.exportUrl = ''
}
this.downloadStatus = false
this.percentage = 0
clearInterval(this.setInter)
})
},
handleReset(scope) {
......@@ -359,6 +358,7 @@ export default {
handleSure: utils.debounce(function() {
this.$refs['addForm'].validate(valid => {
if (valid) {
this.addLoading = true
let params = this.addForm
params.configDetailRpcRequests = this.tableData
if (this.exportUrl) {
......@@ -377,6 +377,7 @@ export default {
activityParams = 'activityInsert'
}
this.$apis.activity[activityParams](params).then(res => {
this.addLoading = false
if (res) {
this.$router.push('/activityConfig/index')
}
......
<template>
<div class="ly-emotion">
<slot></slot>
</div>
</template>
<script>
import emoji from '@/utils/emo'
export default {
name: 'ly-emotion',
mounted() {
const name = this.$el.innerHTML
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(name)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
let imgHTML = `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
this.$nextTick(() => {
this.$el.innerHTML = imgHTML
})
}
}
</script>
<style scoped>
.ly-emotion {
display: inline-block;
}
.ly-static-emotion {
width: 24px;
height: 24px;
display: inline-block;
}
</style>
<template>
<div>
<div class="emotion-box" :style="{ height: height + 'px' }">
<div class="emotion-box-line" v-for="(line, i) in list" :key="i">
<emotion class="emotion-item" v-for="(item, i) in line" :key="i" @click.native="clickHandler(item)">{{ item }}</emotion>
</div>
</div>
</div>
</template>
<script>
import emoji from '@/utils/emo'
import Emotion from './Emotion'
export default {
props: {
height: {
type: Number,
default: 200
}
},
data() {
return {
list: emoji
}
},
methods: {
clickHandler(i) {
let emotion = `${i}`
this.$emit('emotion', emotion)
}
},
components: {
Emotion
}
}
</script>
<style scoped lang="scss">
.emotion-box {
z-index: 2004;
background-color: #fff;
border-radius: 2px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.15);
width: 300px;
box-sizing: border-box;
padding: 5px;
overflow: hidden;
overflow-y: auto;
}
.emotion-box-line {
display: flex;
}
.emotion-item {
flex: 1;
text-align: center;
cursor: pointer;
line-height: 23px;
/deep/ {
img {
width: 24px;
-webkit-user-select: none;
cursor: default;
pointer-events: none;
}
}
}
</style>
......@@ -149,15 +149,15 @@ export default {
// funName: 'link',
// text: '车主朋友,您好!<br>我是您的福利官,欢迎您领取电子质保卡,<br>请点击下方链接进行领取及查看:<br><span style="color:#409eff;">https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/</span><br>祝您用车愉快!<br>'
// },
{
name: '素材',
type: 'material',
funName: 'material',
groupListApi: this.$apis.welcomeword.getGroupListApi,
materialListApi: this.$apis.welcomeword.getMaterialListApi,
// videoNo: true
pdfNo: true
},
// {
// name: '素材',
// type: 'material',
// funName: 'material',
// groupListApi: this.$apis.welcomeword.getGroupListApi,
// materialListApi: this.$apis.welcomeword.getMaterialListApi,
// // videoNo: true
// pdfNo: true
// },
{
name: '模板',
type: 'message',
......
<template>
<div class="select-emp-panel">
<div class="scrm-p10 emp-tree-panel">
<div class="popper-arrow"></div>
<div
class="emp-scroll-panel"
:style="{
height: treeHeight + 'px'
}"
>
<div class="tree-title">所在门店/部门</div>
<el-tree v-loading="loading" :data="listTree" :expand-on-click-node="false" highlight-current :props="defaultProps" @node-click="handleNodeClick"></el-tree>
</div>
</div>
<el-col
class="scrm-p10 emp-table-panel"
:style="{
height: treeHeight + 20 + 'px'
}"
>
<GLTable v-loading="loading" ref="saleTable" :tableData="tableEmpData" :tableParams="tableParams" :hasNum="false" :hasPage="false" @selectionTable="selectionTable"></GLTable>
</el-col>
</div>
</template>
<script>
export default {
name: 'selectEmp',
props: ['selectData', 'islord'],
data() {
return {
treeHeight: 0,
staffName: '',
listTree: [],
defaultProps: {
children: 'children',
label: 'departmentName'
},
// 表格参数
tableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'salelist',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: '姓名',
prop: 'staffName'
},
{
label: '职务',
prop: 'staffTitle'
}
]
},
tableEmpData: [],
currentArr: [],
loading: true
}
},
methods: {
selectionTable(val) {
this.$emit('selectTable', val)
},
listDepartmentTree() {
const params = { merchantId: 10001001, addChildrensFlag: true }
if (this.islord) {
params.islord = this.islord
}
params.isHavCustomer = true
this.$apis.customerTransform.listDepartmentTree(params).then(res => {
this.listTree = res
this.loading = false
if (this.listTree.length) {
this.listTree[0].entmicroStaffResponses = this.getEmployee(this.listTree)
this.currentArr = this.$common.utils.deepClone(this.listTree[0].entmicroStaffResponses)
}
if (this.selectData && this.selectData.length) {
this.selectData.forEach(i => {
const row = this.getEmployee(this.listTree).find(j => j.id == i.staffId)
this.clearSelect(row)
})
}
this.$nextTick(() => {
document.getElementsByClassName('el-tree-node__expand-icon')[0].click()
document.getElementsByClassName('el-tree-node__content')[0].click()
})
})
},
clearSelect(row) {
this.$refs.saleTable.$refs.salelistMutiTable.toggleRowSelection(row)
},
clearSelection() {
this.$refs.saleTable.$refs.salelistMutiTable.clearSelection()
},
handleNodeClick(data) {
this.departmentId = data.id
this.tableEmpData = data.entmicroStaffResponses
// this.currentArr = this.$common.utils.deepClone(data.entmicroStaffResponses)
// this.listEntmicroStaff()
},
getEmployee(d, arr = []) {
d.forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
const flag = arr.find(m => m.id == j.id)
if (!flag) {
arr.push(j)
}
})
}
if (i.children) {
this.getEmployee(i.children, arr)
}
})
return arr
},
searchTable(search) {
const arr = []
if (this.currentArr && this.currentArr.length != 0) {
this.currentArr.forEach(item => {
if (item.staffName.indexOf(search) != -1) {
arr.push(item)
}
})
}
this.tableEmpData = arr
}
// listEntmicroStaff(staffName) {
// let params = {
// departmentId: this.departmentId,
// staffName: staffName ? staffName : this.staffName,
// merchantid: this.$globalState.session.merchantId
// }
// this.$apis.emp.listEntmicroStaff(params).then(res => {
// this.tableEmpData = res
// })
// }
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.treeHeight = clientHeight - 650
this.listDepartmentTree()
}
}
</script>
<style scoped lang="scss">
.select-emp-panel {
display: flex;
.emp-tree-panel {
margin-top: 10px;
width: 200px;
position: relative;
background: #ffffff;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
border: 1px solid #e4e7ed;
.emp-scroll-panel {
min-height: 200px;
overflow: auto;
box-sizing: border-box;
}
.popper-arrow {
border-top-width: 0;
border-width: 6px;
position: absolute;
top: -12px;
left: 30px;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-bottom-color: #e4e7ed;
&:after {
content: ' ';
border-width: 6px;
top: 1px;
margin-left: -6px;
border-top-width: 0;
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-bottom-color: #fff;
}
}
}
.emp-table-panel {
flex: 1;
min-height: 200px;
overflow: auto;
margin-top: 10px;
background: #ffffff;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
border: 1px solid #e4e7ed;
/deep/ .el-checkbox__input.is-disabled .el-checkbox__inner {
background-color: #999999;
}
}
.emp-tree-panel {
margin-right: 10px;
font-size: 15px;
/deep/ .el-tree-node:focus > .el-tree-node__content {
color: #5850ff;
background: #f2f5fa;
}
}
.tree-title {
font-size: 16px;
font-weight: 500;
color: #333333;
line-height: 14px;
padding: 10px;
}
}
</style>
<template>
<div class="member-wrapper">
<div class="member-left">
<div class="member-title">
预选
<span>共{{ chatGroupCount }}个群聊,{{ tableEmpData.length }}个群主成员</span>
</div>
<div class="member-content">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item style="margin-bottom: 0">
<span class="lord-label" slot="label">所在门店/部门</span>
<el-popover ref="popover" placement="bottom" width="215" trigger="click" v-model="popoverVisible" @show="onShowPopover" @hide="onHidePopover">
<el-tree class="select-tree" :data="treeData" :props="defaultProps" default-expand-all @node-click="handleNodeClick"></el-tree>
<el-input v-model="searchForm.department" slot="reference" :size="size" readonly style="width: 215px" placeholder="请选择所在门店/部门" :class="{ rotate: popoverVisible }" suffix-icon="el-icon-arrow-down" @keyup.enter.native="search"></el-input>
</el-popover>
</el-form-item>
<el-form-item label="姓名" style="margin-bottom: 0">
<el-input :size="size" v-model.trim="searchForm.lordName" @keyup.enter.native="search" clearable placeholder="请输入姓名搜索"></el-input>
</el-form-item>
<el-form-item style="margin-bottom: 0">
<span class="lord-label" slot="label">跟进专员类型</span>
<el-select v-model="searchForm.followerId" style="width: 215px" :size="size" placeholder="请选择">
<el-option v-for="item in followTypeList" :key="item.id" :label="item.followName" :value="item.id"></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item>
<el-checkbox v-model="searchForm.checked">仅看跟进专员</el-checkbox>
</el-form-item>-->
<el-form-item label style="margin-bottom: 0; margin-left: 40px">
<el-button :size="size" @click="handleReset">重置</el-button>
<el-button type="primary" :size="size" @click="search">搜索</el-button>
</el-form-item>
</el-form>
<div class="table-content" style="max-height: 456px">
<GLTable v-loading="loading" ref="empTable" :tableData="tableEmpData" :tableParams="tableParams" :hasNum="false" :hasPage="false" :noDataImg="url" @selectionTable="selectionTable" @row-click="rowClick">
<div slot="staffName" slot-scope="scope">
<span>{{ scope.scope.staffName }}</span>
<span class="staff-title" v-show="scope.scope.staffTitle">{{ scope.scope.staffTitle }}</span>
</div>
</GLTable>
</div>
</div>
</div>
<div class="member-right">
<div class="member-title">已选</div>
<div class="member-name">成员名称({{ innerTags.length }}项)</div>
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(tag)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
</div>
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'SelectLord',
props: ['selectData'],
data() {
return {
url: url,
searchForm: {},
checked: '',
treeData: [],
defaultProps: {
children: 'children',
label: 'departmentName'
},
popoverVisible: false,
loading: false,
// 表格参数
tableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'salelist',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: '姓名',
prop: 'staffName',
addHtml: 'staffName'
},
{
label: '所在门店/部门',
prop: 'departmentName'
},
{
label: '跟进专员类型',
prop: 'followerTypeName',
formatter: cellValue => {
return cellValue.followerTypeName ? cellValue.followerTypeName : '-'
}
},
{
label: '群数量',
prop: 'chatCount'
}
]
},
tableEmpData: [],
allTreeData: [],
currentTreeData: [],
innerTags: [],
followTypeList: [],
chatGroupCount: 0
}
},
mounted() {
this.getFindLordGroup({}, true)
this.getFollowerType()
this.listDepartmentTree()
},
methods: {
selectionTable(val) {
this.innerTags = val
},
// 清空搜索条件
resetSearch() {
this.searchForm = {}
this.tableEmpData = this.allTreeData
},
// 显示时触发
onShowPopover() {
this.popoverVisible = true
},
// 隐藏时触发
onHidePopover() {
this.popoverVisible = false
},
getFindLordGroup(params, isFirst) {
this.$apis.customerTransform.findLordGroup(params).then(res => {
this.loading = false
if (res) {
this.tableEmpData = res
this.tableEmpData.map(item => (this.chatGroupCount += item.chatCount))
this.$refs.empTable.tableHeightValues = this.tableEmpData.length ? '' : '230px'
if (isFirst && this.selectData && this.selectData.length) {
this.selectData.forEach(item => {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
})
}
} else {
this.treeData = []
}
})
},
listDepartmentTree() {
const params = { addChildrensFlag: true }
params.islord = true
this.$apis.customerTransform.listDepartmentTree(params).then(res => {
this.treeData = res
})
},
handleNodeClick(data) {
this.searchForm.department = data.departmentName
this.currentTreeData = data
this.onHidePopover()
},
getEmployee(d, arr = []) {
d.reverse().forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
const flag = arr.find(m => m.id == j.id)
if (!flag) {
arr.push(j)
}
})
}
if (i.children) {
this.getEmployee(i.children, arr)
}
})
return arr
},
search() {
this.getFindLordGroup(this.searchForm)
},
remove(item) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
},
rowClick(row) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(row)
},
getFollowerType() {
this.$apis.customerTransform.followerType({}).then(res => {
this.followTypeList = res
})
},
handleReset() {
this.searchForm = {}
this.search()
}
}
}
</script>
<style lang="scss">
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg);
}
.select-tree {
max-height: 400px;
overflow-y: scroll;
}
.staff-title {
position: relative;
font-size: 12px;
padding: 0 10px;
line-height: 12px;
color: #999;
&::before {
content: '';
position: absolute;
top: 50%;
left: 5px;
transform: translateY(-50%);
display: inline-block;
width: 1px;
height: 12px;
background-color: #999;
}
}
.lord-label {
display: inline-block;
width: 110px;
}
.member-wrapper {
display: flex;
.member-title {
font-size: 16px;
font-weight: 600;
line-height: 22px;
margin-bottom: 6px;
span {
display: inline-block;
padding-left: 5px;
font-size: 12px;
color: #999;
font-weight: 500;
}
}
.member-left {
width: 800px;
.member-content {
border: 1px solid #eee;
border-bottom: none;
.member-form {
padding: 10px 20px;
}
.table-content {
max-height: 456px;
overflow: auto;
border: 1px solid #eee;
}
}
.member-checked {
text-align: right;
margin-top: 10px;
}
}
.member-right {
width: 286px;
margin-left: 14px;
.member-name {
font-size: 14px;
color: #333;
line-height: 20px;
padding: 18px;
border: 1px solid #eee;
}
}
}
.tag-box {
height: 100%;
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
border: 1px solid #eee;
border-top: none;
box-sizing: border-box;
color: #606266;
display: inline-block;
padding: 8px 10px;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
height: calc(100% - 86px);
display: flex;
align-items: center;
max-height: 500px;
overflow: auto;
// margin-bottom: 10px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
}
.el-tag {
margin-right: 10px;
line-height: 22px;
margin-bottom: 5px;
height: 24px;
}
</style>
......@@ -196,7 +196,7 @@ export default {
listDepartmentTree(isFollowerStaff) {
const params = { addChildrensFlag: true }
this.loading = true
params.isHavCustomer = true
params.isHavCustomer = false
params.isFollowerStaff = isFollowerStaff
this.$apis.custom.listDepartmentTree(params).then(res => {
console.log(res)
......
<!-- 树形搜索 -->
<template>
<div>
<el-popover ref="popover" placement="bottom-start" trigger="click" v-model="popoverVisible" :disabled="targetItem.isDisabled" @show="onShowPopover" @hide="onHidePopover">
<el-tree ref="tree" class="select-tree" highlight-current default-expand-all node-key="id" :expand-on-click-node="isExpand" :style="`min-width: ${treeWidth}`" :data="treeData" :current-node-key="form[targetItem.name]" :props="defaultProps" :filter-node-method="handleFilterNode" @current-change="handleNodeClick"></el-tree>
<el-input slot="reference" ref="input" v-model="form[targetItem.nameLabel]" clearable :disabled="targetItem.isDisabled" :style="`width: ${width}px`" :class="{ rotate: popoverVisible }" suffix-icon="el-icon-arrow-down" :placeholder="'请选择' + targetItem.label" @change="handleClear"></el-input>
</el-popover>
</div>
</template>
<script>
export default {
name: 'SelectTree',
data() {
return {
isExpand: false,
// 树状菜单显示状态
popoverVisible: false,
treeWidth: 'auto'
}
},
props: {
// 输入框宽度
width: String,
form: {
type: Object,
default: () => {}
},
targetItem: {
type: Object,
default: () => {}
},
treeData: {
type: Array,
default: () => []
},
defaultProps: {
type: Object,
default: () => ({
parent: 'parentId',
value: 'id',
label: 'menuName',
children: 'childlist'
})
}
},
watch: {
form(val) {
if (this.form[this.targetItem.name]) {
this.form[this.targetItem.nameLabel] = this.queryTree(this.treeData, this.form[this.targetItem.name])
this.$nextTick().then(() => {
this.$refs.tree.setCheckedKeys([this.form[this.targetItem.name]])
})
}
}
},
created() {
// 获取输入框宽度同步至树状菜单宽度
this.$nextTick(() => {
this.treeWidth = `${(this.width || this.$refs.input.$refs.input.clientWidth) - 24}px`
})
},
mounted() {
if (this.form[this.targetItem.name]) {
// console.log(this.treeData)
// console.log(this.form)
this.form[this.targetItem.nameLabel] = this.queryTree(this.treeData, this.form[this.targetItem.name])
this.$nextTick().then(() => {
this.$refs.tree.setCheckedKeys([this.form[this.targetItem.name]])
})
}
},
methods: {
// 显示时触发
onShowPopover() {
this.popoverVisible = true
this.$refs.tree.filter(false)
},
// 隐藏时触发
onHidePopover() {
this.popoverVisible = false
},
// 树节点过滤方法
handleFilterNode(query, data) {
if (!query) return true
return data[this.defaultProps.label].indexOf(query) !== -1
},
handleNodeClick(val) {
this.$emit('selected', { val: val, targetItem: this.targetItem, formName: this.targetItem.formName })
this.onHidePopover()
},
handleClear(val) {
this.$emit('selected', { val: val, targetItem: this.targetItem, formName: this.targetItem.formName })
window.event.stopPropagation()
},
// 搜索树状数据中的 ID
queryTree(tree, id) {
let stark = []
stark = stark.concat(tree)
while (stark.length) {
const temp = stark.shift()
if (temp[this.defaultProps.children]) {
stark = stark.concat(temp[this.defaultProps.children])
}
if (temp[this.defaultProps.value] === id) {
return temp[this.defaultProps.label]
}
}
return
}
}
}
</script>
<style>
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg);
}
.select-tree {
max-height: 400px;
overflow-y: scroll;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!