Commit d1d185e1 by 张权

服务专家开发

1 parent 02e29a5d
......@@ -27,7 +27,29 @@ function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, max
}
}
const liveStatusList = [{
function downloadIamge(imgsrc, name = new Date().getTime()) {
//下载图片地址和图片名
var image = new Image()
// 解决跨域 Canvas 污染问题
image.setAttribute('crossOrigin', 'anonymous')
image.onload = function() {
var canvas = document.createElement('canvas')
canvas.width = image.width
canvas.height = image.height
var context = canvas.getContext('2d')
context.drawImage(image, 0, 0, image.width, image.height)
var url = canvas.toDataURL('image/png') //得到图片的base64编码数据
var a = document.createElement('a') // 生成一个a元素
var event = new MouseEvent('click') // 创建一个单击事件
a.download = name || 'photo' // 设置图片名称
a.href = url // 将生成的URL设置为a.href属性
a.dispatchEvent(event) // 触发a的单击事件
}
image.src = imgsrc
}
const liveStatusList = [
{
confId: '101',
confName: '直播中'
},
......@@ -57,7 +79,8 @@ const liveStatusList = [{
}
]
const auditStatusList = [{
const auditStatusList = [
{
confId: 0,
confName: '未审核'
},
......@@ -75,4 +98,4 @@ const auditStatusList = [{
}
]
export { limitPrice, liveStatusList, auditStatusList }
\ No newline at end of file
export { limitPrice, liveStatusList, auditStatusList, downloadIamge }
......@@ -5,6 +5,10 @@
预选
<span>仅筛选有外部客户联系人的成员</span>
</div> -->
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="本企业员工" name="1"></el-tab-pane>
<el-tab-pane label="外部企业员工" name="2"></el-tab-pane>
</el-tabs>
<div class="member-content">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item label="所在门店/部门" style="margin-bottom: 0;">
......@@ -33,15 +37,30 @@
<span class="staff-title" v-show="scope.scope.staffTitle">{{ scope.scope.staffTitle }}</span>
</div>
</GLTable>
<!-- <GLTable v-loading="loading" ref="empTable" :tableData="tableEmpData" :tableParams="tableParams" :hasNum="false" :hasPage="false" :noDataImg="url" @row-click="rowClick">
<div slot="radio" slot-scope="scope">
<el-radio v-model="selectPerson" :label="scope.scope">&nbsp;</el-radio>
</div>
<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 class="member-checked">
<div v-if="activeName == 1" class="member-checked">
<div class="name">
已选择:{{ selectPerson && selectPerson.staffName }}
<span v-if="selectPerson && selectPerson.staffTitle" style="font-size:12px;">|&nbsp;{{ selectPerson && selectPerson.staffTitle }}</span>
</div>
<el-checkbox v-model="checked" @change="checkChange">仅看跟进专员</el-checkbox>
</div>
<div class="member-checked" v-else>
<span class="name">
<span class="el-icon-warning"></span>
<span style="color:#666;">选择一个渠道活码,将该员工设定为客户加微对象。</span>
</span>
</div>
</div>
<!-- <div class="member-right">
<div class="member-title">已选</div>
......@@ -67,6 +86,7 @@ export default {
return {
url: url,
size: 'small',
activeName: '1',
selectPerson: null,
searchForm: {},
checked: '',
......@@ -123,6 +143,8 @@ export default {
this.listDepartmentTree(false)
},
methods: {
//切换tab栏
handleClick() {},
selectionTable(val) {
this.innerTags = val
// this.$emit('selectTable', val)
......@@ -259,6 +281,13 @@ export default {
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg);
}
/deep/ .el-tabs__header {
margin-bottom: 0;
}
/deep/.el-tabs__nav-wrap::after {
height: 1px;
background-color: #e5e5e5;
}
.select-tree {
max-height: 400px;
overflow-y: scroll;
......@@ -320,6 +349,7 @@ export default {
justify-content: space-between;
font-size: 14px;
margin-top: 12px;
height: 20px;
.name {
display: flex;
align-items: center;
......
......@@ -45,6 +45,7 @@
<div class="btn-group">
<div class="add-btn" v-for="item in btnList" :key="item.id">
<!-- <i class="el-icon-circle-plus-outline"></i> -->
<template v-if="!item.isHide">
<img :src="require(`@/assets/guestCustom/add-${item.type}.png`)" alt v-if="item.id == 1" @click="selectEmotion" />
<img :src="require(`@/assets/guestCustom/add-${item.type}.png`)" v-else alt />
<span v-if="item.id == 1" @click.stop="selectEmotion">{{ item.name }}</span>
......@@ -52,6 +53,7 @@
<input v-if="item.type == 'img'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input upload-img" :accept="item.accept || 'image/png, image/jpeg, image/jpg'" @change="e => handleImgChange(e, item)" />
<input v-else-if="item.type == 'video'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input" :accept="item.accept || 'video/*'" @change="e => handleVideoChange(e, item)" />
<el-link v-else-if="item.type == 'link' || item.type == 'nickname' || item.type == 'acivity'" style="opacity: 0" @click="handleFun(item.funName)">{{ item.name }}</el-link>
</template>
</div>
</div>
</div>
......
......@@ -5,7 +5,32 @@
<span class="tip">该配置页面用于配置「精品升级」小程序质保卡客户拉新,配置订单类型后,客户扫码质保卡活码即可添加员工企微号。</span>
</div>
<div class="detail-wrap">
<el-form class="form" ref="form" :model="basicForm" label-width="112px">
<glsx-combi-form class="form" ref="form" :formRules="basicRule" labelWidth="154px" defaultWidth="474px" :formObj="basicForm" :formData="basicFormData">
<div slot="staffSlot">
<span v-if="selectPerson.staffName" class="tag-info">
<i class="el-icon-user-solid person"></i>
<span class="client name">{{ selectPerson.staffName }}</span>
<i class="el-icon-close del" @click="delPerson"></i>
</span>
<el-button class="checkNumber" v-else size="small" icon="el-icon-plus" @click="openMembers">
选择成员
</el-button>
<span v-if="selectPerson.departmentName" class="depart-name">{{ selectPerson.departmentName }}</span>
</div>
<div slot="welcomeSlot">
<WelcomeWords ref="welcome" :btnList="btnList" :eventBus="eventBus"></WelcomeWords>
<div class="tips-text">
<p>当「精品升级」小程序提交升级订单时,</p>
<p>
客户扫描订单质保码添加
<span style="color:#409eff">{{ ' ' }}{{ selectPerson.staffName || '待选择' }}</span>
,
</p>
<p>客户添加成功自动推送欢迎语,建议插入质保链接。</p>
</div>
</div>
</glsx-combi-form>
<!-- <el-form class="form" ref="form" :model="basicForm" label-width="112px">
<el-form-item label="客户类型:">
<span class="client">{{ clientType }}</span>
</el-form-item>
......@@ -21,7 +46,6 @@
<span v-if="selectPerson && selectPerson.departmentName" class="depart-name">{{ selectPerson && selectPerson.departmentName }}</span>
</el-form-item>
<el-form-item label="欢迎语:">
<!-- <label slot="label" class="required">群发内容</label> -->
<WelcomeWords ref="welcome" :btnList="btnList" :eventBus="eventBus"></WelcomeWords>
<div class="tips-text">
<p>当「精品升级」小程序提交升级订单时,</p>
......@@ -33,7 +57,7 @@
<p>客户添加成功自动推送欢迎语,建议插入质保链接。</p>
</div>
</el-form-item>
</el-form>
</el-form> -->
</div>
<glsx-dialog class="numberDialog" :title="'选择成员'" btnSize="small" :width="'850px'" :isVisible="membersVisible" @confirmDialog="handleConfirm" @closeDialog="membersVisible = !membersVisible">
<SelectMember ref="membersForm" v-if="membersVisible" :selectData="selectData"></SelectMember>
......@@ -51,20 +75,27 @@ import emoji from '@/util/emo'
import WelcomeWords from './components/welcomeWords.vue'
import SelectMember from './components/selectMember.vue'
import glsxDialog from '@/components/glsx-dialog/index.vue'
// import glsxCombiForm from '@/components/glsx-combi-form'
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'expert_detail',
components: {
WelcomeWords,
SelectMember,
glsxDialog
glsxDialog,
glsxCombiForm
},
data() {
return {
size: 'small',
eventBus: new Vue(),
clientType: '升级客户',
expertId: '',
routeInfo: {},
expertTypeList: [],
basicRule: {
businessType: [{ required: true, message: '请选择客户类型', trigger: 'change' }],
staffId: [{ required: true, message: '请选择指定成员', trigger: 'change' }],
expertType: [{ required: true, message: '请选择专家类型', trigger: 'change' }]
},
btnList: [
{
id: 1,
......@@ -91,51 +122,106 @@ export default {
name: '活动',
type: 'acivity',
funName: 'activity'
}
},
// {
// id: 5,
// name: '模板',
// type: 'nickname',
// funName: 'message'
// },
// {
// id: 6,
// name: '插入质保链接',
// type: 'link',
// funName: 'link'
// }
{
id: 6,
name: '插入质保链接',
type: 'link',
funName: 'link',
isHide: true
}
],
membersVisible: false,
selectData: [],
basicForm: {},
selectPerson: null,
numberTypeList: []
}
basicForm: {
businessType: 1,
staffId: '',
expertType: 1,
staffUserId: ''
},
mounted() {
const urlParam = this.$route.params
let param = JSON.parse(urlParam.id)
this.clientType = param.clientType
if (this.clientType == '升级客户') {
let obj = {
id: 6,
name: '插入质保链接',
type: 'link',
funName: 'link'
selectPerson: {},
numberTypeList: [],
basicFormData: [
{
label: '专家类型',
name: 'expertType',
type: 'select',
optionList: [],
optionId: 'dictValue',
optionLabel: 'dictLabel',
isClear: true
},
{
label: '客户类型',
name: 'businessType',
type: 'select',
optionList: [],
optionId: 'dictValue',
optionLabel: 'dictLabel',
isClear: true
},
{
label: '指定成员',
name: 'staffId',
addHtml: 'staffSlot'
},
{
label: '欢迎语',
name: '',
addHtml: 'welcomeSlot'
}
this.btnList.push(obj)
]
}
},
watch: {
'basicForm.businessType': {
handler(nVal) {
if (nVal) {
this.btnList.find(item => item.id == 6).isHide = nVal != 1
}
if (param.expertId) {
this.expertId = param.expertId
this.getDetail(param.expertId)
},
immediate: true
},
selectPerson: {
handler(val) {
console.log(val)
this.basicForm.staffId = val.staffId || ''
this.basicForm.staffUserId = val.userId || ''
},
deep: true
}
},
created() {
this.getTypeList()
},
mounted() {
const urlParam = this.$route.params
this.routeInfo = JSON.parse(urlParam.id)
console.log(this.routeInfo, 456456)
if (this.routeInfo.expertId) {
this.getDetail(this.routeInfo.expertId)
}
},
methods: {
getTypeList() {
this.$apis.expert.getMenberType({ dictType: 'operation_type' }).then(res => {
if (res) {
this.numberTypeList = res
let target = this.basicFormData.find(item => item.name === 'businessType')
target.optionList = res
}
})
this.$apis.expert.getMenberType({ dictType: 'expert_type' }).then(res => {
if (res) {
this.expertTypeList = res
let target = this.basicFormData.find(item => item.name === 'expertType')
target.optionList = res
}
})
},
......@@ -144,12 +230,13 @@ export default {
if (res?.id) {
this.selectPerson = res
this.$refs.welcome.setDetail(res.welcomeInfo)
this.clientType = res.businessTypeName
this.basicForm.businessType = res.businessType
this.basicForm.expertType = res.expertType
}
})
},
delPerson() {
this.selectPerson = null
this.selectPerson = {}
},
// 成员弹窗
handleConfirm() {
......@@ -176,13 +263,12 @@ export default {
})
},
handleSave() {
if (!this.selectPerson?.staffId) {
return this.$message.error('请选择轻改专家')
}
this.$refs.form.$refs.formRef.validate(valid => {
if (valid) {
let preList = [...this.$refs.welcome.previewList]
preList.forEach(item => {
if (item.attType == 1 && !item.attContent.trim()) {
item.attContent = '\n'
item.attContent = '\n' //欢迎语textArea为空时传换行符
} else if (item.attType == 1) {
item.attContent = item.attContent.replaceAll('@昵称', '[@昵称]')
}
......@@ -194,19 +280,26 @@ export default {
return item.attType == 1
})
if (!typeItem) {
preList.unshift({ attType: '1', attContent: '\n' })
preList.unshift({ attType: '1', attContent: '\n' }) //欢迎语textArea为空时传换行符
}
// const targetItem = this.numberTypeList.find(item => {
// return item.dictLabel == this.clientType
// })
// let params = {
// businessType: targetItem.dictValue,
// staffId: this.selectPerson.staffId,
// // welcomeInfo: this.$refs.welcome.previewList
// welcomeInfo: preList
// }
let params = { ...this.basicForm }
params.welcomeInfo = preList
console.log(params, 'params')
let API = this.routeInfo.expertId ? this.$apis.expert.editExpert : this.$apis.expert.saveExpert
if (this.routeInfo.expertId) {
params.id = this.routeInfo.expertId
params.businessUuid = this.routeInfo.businessUuid
params.configId = this.routeInfo.configId
}
const targetItem = this.numberTypeList.find(item => {
return item.dictLabel == this.clientType
})
let params = {
businessType: targetItem.dictValue,
staffId: this.selectPerson.staffId,
// welcomeInfo: this.$refs.welcome.previewList
welcomeInfo: preList
}
let API = this.expertId ? this.$apis.expert.editExpert : this.$apis.expert.saveExpert
if (this.expertId) params.id = this.expertId
API(params).then(res => {
if (res) {
this.$message({
......@@ -218,6 +311,8 @@ export default {
})
}
})
}
})
},
handleCancel() {
this.$router.push({
......@@ -315,11 +410,7 @@ export default {
}
.form {
/deep/.el-form-item {
&:nth-child(-n + 2) {
height: 36px;
}
// height: 36px;
line-height: 36px;
display: block;
margin-bottom: 20px;
& > .el-form-item__label {
padding: 0;
......
......@@ -15,7 +15,7 @@
</div>
<div class="container">
<div class="number">
<GLCombiForm ref="showSearch" @handleOk="handleSearch" @handleRest="handleReset" labelWidth="100px" defaultWidth="210px" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData"></GLCombiForm>
<GLCombiForm ref="showSearch" @handleOk="handleSearch" @handleRest="handleReset" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData" :rowNumber="3"></GLCombiForm>
</div>
<!-- 表格区域 开始 -->
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!