Commit 072827ba by 张权

详情

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