Commit 072827ba by 张权

详情

1 parent 85517313
......@@ -38,7 +38,7 @@
<div class="member-checked">
<span class="name">
已选择:{{ selectPerson && selectPerson.staffName }}
<span style="font-size:12px;">|&nbsp;{{ selectPerson && selectPerson.staffTitle }}</span>
<span v-if="selectPerson && selectPerson.staffTitle" style="font-size:12px;">|&nbsp;{{ selectPerson && selectPerson.staffTitle }}</span>
</span>
<el-checkbox v-model="checked" @change="checkChange">仅看跟进专员</el-checkbox>
</div>
......
......@@ -125,8 +125,10 @@ export default {
},
addCardLink() {
let textarea = document.getElementsByClassName('w-textarea_input')[0].innerHTML
textarea = textarea + '<br>车主朋友,您好!<br>我是您的福利官,欢迎您领取电子质保卡,<br>请点击下方链接进行领取及查看:<br><span style="color:#409eff;">https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/</span><br>祝您用车愉快!<br>'
document.getElementsByClassName('w-textarea_input')[0].innerHTML = textarea
let span = document.createElement('span')
let text = '<br>车主朋友,您好!<br>我是您的福利官,欢迎您领取电子质保卡,<br>请点击下方链接进行领取及查看:<br><span style="color:#409eff;">https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/</span><br>祝您用车愉快!<br>'
span.innerHTML = text
var myText = document.createTextNode(textarea)
// console.log(textarea[0].childNodes, textarea[0]?.childNodes?.length)
// let pnode = document.createElement('span')
// let arr = ['车主朋友,您好!\n我是您的福利官,欢迎您领取电子质保卡,\n请点击下方链接进行领取及查看:\n', 'https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/', '\n祝您用车愉快!\n']
......@@ -139,7 +141,7 @@ export default {
// if (index == 1) node.setAttribute('style', 'color:#409eff;')
// pnode.appendChild(node)
// })
// this.insertNode(pnode)
this.insertNode(span)
},
addNode() {
let target = this.$refs.wTextareaContent
......
......@@ -158,6 +158,35 @@ export default {
this.eventBus.$emit('update', this.previewList)
},
methods: {
setTextarea(val) {
// let val = '[鄙视]@昵称@昵称[鄙视][做哼][ ]车主朋友,您好!我是您的福利官,欢迎您领取电子质保卡,请点击下方链接进行领取及查看:https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/祝您用车愉快!'
let reg1 = /\[(.+?)\]/gi
let arr = val.match(reg1) || []
console.log(arr, 456)
const list = emoji.flat(Infinity)
arr.forEach(item => {
let str = item.slice(1, item.length - 1)
if (list.indexOf(str) > -1) {
let index = list.indexOf(str) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
let img = `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
console.log(123456)
val = val.replaceAll(item, img)
}
})
val = val.replaceAll('@昵称', '<wise>@昵称</wise>')
let welcomeStr = '车主朋友,您好!我是您的福利官,欢迎您领取电子质保卡,请点击下方链接进行领取及查看:https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/祝您用车愉快!'
let text = '<br>车主朋友,您好!<br>我是您的福利官,欢迎您领取电子质保卡,<br>请点击下方链接进行领取及查看:<br><span style="color:#409eff;">https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/</span><br>祝您用车愉快!<br>'
val = val.replaceAll(welcomeStr, text)
console.log(val)
let span = document.createElement('span')
span.innerHTML = val
this.$refs.textContent.insertNode(span)
},
selectEmotion() {
this.emotionStatus = !this.emotionStatus
},
......@@ -170,7 +199,7 @@ export default {
} else if (index >= 10 && index < 100) {
index = '0' + index
}
console.log(list)
console.log(list, index, i)
this.$refs.textContent.addImg(`https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png`)
},
updateText(val) {
......
......@@ -35,7 +35,7 @@
</el-form-item>
</el-form>
</div>
<glsx-dialog :title="'选择成员'" btnSize="small" :width="'850px'" :isVisible="membersVisible" @confirmDialog="handleConfirm" @closeDialog="membersVisible = !membersVisible">
<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>
</glsx-dialog>
<div class="my-footer btn-box box">
......@@ -64,6 +64,7 @@ export default {
size: 'small',
eventBus: new Vue(),
clientType: 1,
expertId: '',
btnList: [
{
id: 1,
......@@ -115,8 +116,9 @@ export default {
console.log(urlParam, 79)
let param = JSON.parse(urlParam.id)
this.clientType = param.clientType
console.log(param.expertId)
if (param.expertId) {
this.expertId = param.expertId
this.getDetail(param.expertId)
}
},
......@@ -124,6 +126,14 @@ export default {
getDetail(id) {
this.$apis.expert.expertDetail({ id }).then(res => {
console.log(res)
if (res?.id) {
this.selectPerson = res
res.welcomeInfo.forEach(item => {
if (item.attType == 1) {
this.$refs.welcome.setTextarea(item.attContent)
}
})
}
})
},
delPerson() {
......@@ -145,7 +155,15 @@ export default {
openMembers() {
this.membersVisible = !this.membersVisible
},
edit() {
this.$apis.expert.editExpert().then(res => {
if (res) {
this.$router.push({
path: '/expert/index'
})
}
})
},
handleSave() {
console.log(this.selectPerson)
console.log(this.$refs.welcome.previewList)
......@@ -157,14 +175,25 @@ export default {
staffId: this.selectPerson.staffId,
welcomeInfo: this.$refs.welcome.previewList
}
this.$apis.expert.saveExpert(params).then(res => {
let API = this.expertId ? this.$apis.expert.editExpert : this.$apis.expert.saveExpert
if (this.expertId) params.id = this.expertId
API(params).then(res => {
console.log(res)
if (res) {
this.$message({
type: 'success',
message: '提交成功'
})
this.$router.push({
path: '/expert/index'
})
}
})
},
handleCancel() {
this.$router.push({
path: '/expert/index'
})
}
}
}
......@@ -172,26 +201,29 @@ export default {
<style lang="scss" scoped>
.expert-detail {
background-color: #fff;
height: calc(100% - 80px);
/deep/ .el-dialog__header {
height: 56px;
padding: 0 24px;
line-height: 56px;
font-size: 18px;
font-weight: 600;
color: #000000;
}
/deep/ .el-dialog__body {
padding-top: 0;
}
height: calc(100vh - 144px);
.numberDialog {
/deep/ .el-dialog__header {
height: 56px;
padding: 0 24px;
line-height: 56px;
font-size: 18px;
font-weight: 600;
color: #000000;
}
/deep/ .el-dialog__body {
padding-top: 0;
}
/deep/ .el-dialog__footer > div {
display: flex;
flex-direction: row-reverse;
.el-button:first-child {
margin-left: 16px;
/deep/ .el-dialog__footer > div {
display: flex;
flex-direction: row-reverse;
.el-button:first-child {
margin-left: 16px;
}
}
}
.header {
height: 56px;
font-size: 16px;
......
......@@ -36,7 +36,7 @@
</span>
<div class="table-btns" slot="table-btns" slot-scope="scope">
<el-button fn="编辑" type="text" @click="selectClientType(scope.scope.businessType, scope.scope.id)">编辑</el-button>
<el-button fn="编辑" type="text" @click="handleDel(scope)">删除</el-button>
<el-button fn="编辑" type="text" @click="handleDel(scope.scope)">删除</el-button>
</div>
</GLTable>
<div v-if="!hasData" class="default-box">
......@@ -259,8 +259,8 @@ export default {
if (this.showClientType) this.showClientType = false
if (this.showCenterClientType) this.showCenterClientType = false
},
changStatus(state, id) {
this.$apis.expert.editExpert({ id, state: state == 0 ? -1 : 0 }).then(res => {
changStatus(status, id) {
this.$apis.expert.editExpert({ id, status: status == 0 ? -1 : 0 }).then(res => {
if (res) {
this.handleSearch()
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!