Commit 85517313 by 张权

联调接口

1 parent 06cf3148
...@@ -20,4 +20,44 @@ const getMerchantTree = params => { ...@@ -20,4 +20,44 @@ const getMerchantTree = params => {
}) })
} }
export default { getExpertList, getMerchantTree } const saveExpert = params => {
params.method = 'entmicro.api.operation.save'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const delExpert = params => {
params.method = 'entmicro.api.operation.delete'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const editExpert = params => {
params.method = 'entmicro.api.operation.update'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const expertDetail = params => {
params.method = 'entmicro.api.operation.detail'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getExpertList, getMerchantTree, saveExpert, delExpert, editExpert, expertDetail }
...@@ -124,20 +124,22 @@ export default { ...@@ -124,20 +124,22 @@ export default {
console.log(textarea[0].childNodes, textarea[0]?.childNodes?.length) console.log(textarea[0].childNodes, textarea[0]?.childNodes?.length)
}, },
addCardLink() { addCardLink() {
let textarea = document.getElementsByClassName('w-textarea_input') let textarea = document.getElementsByClassName('w-textarea_input')[0].innerHTML
console.log(textarea[0].childNodes, textarea[0]?.childNodes?.length) textarea = textarea + '<br>车主朋友,您好!<br>我是您的福利官,欢迎您领取电子质保卡,<br>请点击下方链接进行领取及查看:<br><span style="color:#409eff;">https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/</span><br>祝您用车愉快!<br>'
let pnode = document.createElement('span') document.getElementsByClassName('w-textarea_input')[0].innerHTML = textarea
let arr = ['车主朋友,您好!\n我是您的福利官,欢迎您领取电子质保卡,\n请点击下方链接进行领取及查看:\n', 'https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/', '\n祝您用车愉快!'] // console.log(textarea[0].childNodes, textarea[0]?.childNodes?.length)
if (textarea[0]?.childNodes?.length && (textarea[0]?.childNodes?.length != 1 || textarea[0]?.childNodes[0]?.nodeName != 'BR')) { // let pnode = document.createElement('span')
arr[0] = '\n' + arr[0] // let arr = ['车主朋友,您好!\n我是您的福利官,欢迎您领取电子质保卡,\n请点击下方链接进行领取及查看:\n', 'https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/', '\n祝您用车愉快!\n']
} // if (textarea[0]?.childNodes?.length && (textarea[0]?.childNodes?.length != 1 || textarea[0]?.childNodes[0]?.nodeName != 'BR')) {
arr.forEach((item, index) => { // arr[0] = '\n' + arr[0]
let node = document.createElement('span') // }
node.innerText = item // arr.forEach((item, index) => {
if (index == 1) node.setAttribute('style', 'color:#409eff;') // let node = document.createElement('span')
pnode.appendChild(node) // node.innerText = item
}) // if (index == 1) node.setAttribute('style', 'color:#409eff;')
this.insertNode(pnode) // pnode.appendChild(node)
// })
// this.insertNode(pnode)
}, },
addNode() { addNode() {
let target = this.$refs.wTextareaContent let target = this.$refs.wTextareaContent
......
...@@ -170,6 +170,7 @@ export default { ...@@ -170,6 +170,7 @@ export default {
} else if (index >= 10 && index < 100) { } else if (index >= 10 && index < 100) {
index = '0' + index index = '0' + index
} }
console.log(list)
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) {
......
...@@ -115,9 +115,17 @@ export default { ...@@ -115,9 +115,17 @@ 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) {
this.getDetail(param.expertId)
}
}, },
methods: { methods: {
addConfig() {}, getDetail(id) {
this.$apis.expert.expertDetail({ id }).then(res => {
console.log(res)
})
},
delPerson() { delPerson() {
this.selectPerson = null this.selectPerson = null
}, },
...@@ -136,6 +144,27 @@ export default { ...@@ -136,6 +144,27 @@ export default {
}, },
openMembers() { openMembers() {
this.membersVisible = !this.membersVisible this.membersVisible = !this.membersVisible
},
handleSave() {
console.log(this.selectPerson)
console.log(this.$refs.welcome.previewList)
if (!this.selectPerson?.staffId) {
return this.$message.error('请选择轻改专家')
}
let params = {
businessType: this.clientType == 1 ? 0 : -1,
staffId: this.selectPerson.staffId,
welcomeInfo: this.$refs.welcome.previewList
}
this.$apis.expert.saveExpert(params).then(res => {
console.log(res)
if (res) {
this.$router.push({
path: '/expert/index'
})
}
})
} }
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="expert-container"> <div class="expert-container">
<div> <div>
<div class="btn-area"> <div class="btn-area">
<GLButton id="clientBtn" :size="size" fn="新增配置" type="primary" @click.stop="addConfig(1)"> <GLButton id="clientBtn" :size="size" fn="新增配置" type="primary" @click.stop="addConfig('top')">
新增配置 新增配置
<i class="el-icon-arrow-down"></i> <i class="el-icon-arrow-down"></i>
</GLButton> </GLButton>
...@@ -25,25 +25,34 @@ ...@@ -25,25 +25,34 @@
</el-cascader> </el-cascader>
</div> </div>
<span slot="footer" class="footer-btns"> <span slot="footer" class="footer-btns">
<el-button :size="size" type="primary" @click="handleSearch">查询{{ isNotData }}</el-button> <el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" class="resetBtn" @click="handleReset">重置</el-button> <el-button :size="size" class="resetBtn" @click="handleReset">重置</el-button>
</span> </span>
</glsx-combi-form> </glsx-combi-form>
<GLTable ref="expertTable" :hasNum="false" :pageConf="batchPageConf" :searchForm="batchListSearch" :tableParams="batchTableParams" :getListApi="getListApi"> <GLTable :class="[{ hasDataTable: !hasData }]" ref="expertTable" :hasNum="false" :pageConf="batchPageConf" :searchForm="batchListSearch" :tableParams="batchTableParams" :getListApi="getListApi">
<span slot="status" slot-scope="scope"> <span slot="status" slot-scope="scope">
<el-switch :value="scope.scope.status == 0" active-color="#5850ff" inactive-color="#eee" @change="changStatus(scope.scope.status, scope.scope.id)"></el-switch> <el-switch :value="scope.scope.status == 0" active-color="#5850ff" inactive-color="#eee" @change="changStatus(scope.scope.status, scope.scope.id)"></el-switch>
{{ scope.scope.status == 1 ? '禁用' : '启用' }} {{ scope.scope.status == 0 ? '启用' : '禁用' }}
</span> </span>
<div class="table-btns" slot="table-btns" slot-scope="scope"> <div class="table-btns" slot="table-btns" slot-scope="scope">
<GLButton fn="编辑" type="text" @click="addConfig(scope)">编辑</GLButton> <el-button fn="编辑" type="text" @click="selectClientType(scope.scope.businessType, scope.scope.id)">编辑</el-button>
<GLButton fn="编辑" type="text" @click="addConfig(2)">删除</GLButton> <el-button fn="编辑" type="text" @click="handleDel(scope)">删除</el-button>
</div> </div>
<!-- <div slot="additionalContent" class="default-box"> </GLTable>
<div v-if="!hasData" class="default-box">
<img class="default-img" :src="imagBaseURL + 'serviceser.png'" alt="" /> <img class="default-img" :src="imagBaseURL + 'serviceser.png'" alt="" />
<span class="tip">用于「精品升级」客户线上化,配置轻改专家成员,可通过精品升级的质保卡活码拉新。</span> <span class="tip">用于「精品升级」客户线上化,配置轻改专家成员,可通过精品升级的质保卡活码拉新。</span>
<GLButton :size="size" fn="新增配置" icon="el-icon-plus" type="primary" @click="addConfig(1)">配置门店轻改专家</GLButton> <div class="btn-area">
</div> --> <GLButton id="clientBtn" :size="size" fn="新增配置" type="primary" @click.stop="addConfig('center')">
</GLTable> 新增配置
<i class="el-icon-arrow-down"></i>
</GLButton>
<ul v-if="showCenterClientType" class="client">
<li @click.stop="selectClientType(1)">升级客户</li>
<li @click.stop="selectClientType(2)">战败客户</li>
</ul>
</div>
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -65,9 +74,11 @@ export default { ...@@ -65,9 +74,11 @@ export default {
children: 'children', children: 'children',
checkStrictly: true checkStrictly: true
}, },
hasData: false,
size: 'small', size: 'small',
getListApi: this.$apis.expert.getExpertList, getListApi: this.$apis.expert.getExpertList,
showClientType: false, showClientType: false,
showCenterClientType: false,
batchPageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }, batchPageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
batchListSearch: { batchListSearch: {
departmentId: '', departmentId: '',
...@@ -140,7 +151,7 @@ export default { ...@@ -140,7 +151,7 @@ export default {
prop: 'businessType', prop: 'businessType',
width: 200, width: 200,
formatter: cellValue => { formatter: cellValue => {
return cellValue.priceSection == -1 ? '战败客户' : '升级客户' return cellValue.businessType == -1 ? '战败客户' : '升级客户'
} }
}, },
{ {
...@@ -173,6 +184,7 @@ export default { ...@@ -173,6 +184,7 @@ export default {
computed: {}, computed: {},
created() { created() {
this.getMerchantList() this.getMerchantList()
this.isEmptyTable()
}, },
mounted() { mounted() {
document.getElementById('app').addEventListener('click', this.setClientType) document.getElementById('app').addEventListener('click', this.setClientType)
...@@ -183,7 +195,6 @@ export default { ...@@ -183,7 +195,6 @@ export default {
methods: { methods: {
// 获取当前选择的商户 // 获取当前选择的商户
getCurMerchant(val) { getCurMerchant(val) {
console.log(val, 7897)
let id = val[val.length - 1] let id = val[val.length - 1]
this.batchListSearch.departmentId = id this.batchListSearch.departmentId = id
// let labels = this.$refs.cascaderRef1.getCheckedNodes()[0].pathLabels // let labels = this.$refs.cascaderRef1.getCheckedNodes()[0].pathLabels
...@@ -194,6 +205,37 @@ export default { ...@@ -194,6 +205,37 @@ export default {
// } // }
// this.$refs.cascaderRef1.dropDownVisible = false // this.$refs.cascaderRef1.dropDownVisible = false
}, },
handleDel({ id }) {
this.$confirm('是否确认删除?', '退单', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
customClass: 'customConfirm'
}).then(() => {
this.$apis.expert.delExpert({ id }).then(res => {
console.log(res)
if (res) {
this.handleSearch()
this.$message({
type: 'success',
message: '删除成功!'
})
}
})
})
},
isEmptyTable() {
let params = {
departmentId: '',
staffName: '',
businessType: '',
pageSize: 10,
pageNum: 1
}
this.$apis.expert.getExpertList(params).then(res => {
this.hasData = !!res?.data?.length
})
},
getMerchantList() { getMerchantList() {
this.$apis.expert.getMerchantTree({}).then(res => { this.$apis.expert.getMerchantTree({}).then(res => {
this.shopList = this.traverse(2, res, 'entmicroName', 'merchantAccountLevel') this.shopList = this.traverse(2, res, 'entmicroName', 'merchantAccountLevel')
...@@ -215,35 +257,29 @@ export default { ...@@ -215,35 +257,29 @@ export default {
}, },
setClientType() { setClientType() {
if (this.showClientType) this.showClientType = false if (this.showClientType) this.showClientType = false
if (this.showCenterClientType) this.showCenterClientType = false
}, },
changStatus(openFlag, id) { changStatus(state, id) {
let ids = [] this.$apis.expert.editExpert({ id, state: state == 0 ? -1 : 0 }).then(res => {
ids.push(id) if (res) {
let target = 'openConfigs' this.handleSearch()
if (openFlag == 1) {
target = 'closeConfigs'
}
let params = { ids }
this.$apis.openconfig[target](params).then(({ code, message }) => {
if (code == 0) {
this.$message({
message: '操作成功!',
type: 'success'
})
this.$refs.table.refreshTable()
} else {
this.$message.error(message)
} }
}) })
}, },
addConfig() { addConfig(area) {
if (area == 'top') {
this.showClientType = true this.showClientType = true
} else {
this.showCenterClientType = true
}
}, },
goDetail() { goDetail() {
this.$router.push({ path: '/expert/detail/5' }) this.$router.push({ path: '/expert/detail/5' })
}, },
selectClientType(type, id) { selectClientType(type, id) {
this.showCenterClientType = false
this.showClientType = false this.showClientType = false
let paraFormat = { let paraFormat = {
clientType: type clientType: type
} }
...@@ -279,6 +315,13 @@ export default { ...@@ -279,6 +315,13 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/ .hasDataTable {
.el-table__empty-block,
.el-pagination {
display: none;
}
}
.btn-area { .btn-area {
display: inline-block; display: inline-block;
position: relative; position: relative;
...@@ -320,11 +363,10 @@ export default { ...@@ -320,11 +363,10 @@ export default {
margin-left: 16px; margin-left: 16px;
} }
.expert-wrap { .expert-wrap {
position: relative;
margin-top: 16px; margin-top: 16px;
padding: 20px 20px 0; padding: 20px 20px 0;
background-color: #fff; background-color: #fff;
// height: calc(100vh - 148px); height: calc(100vh - 148px);
.select_wrapper { .select_wrapper {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -339,11 +381,6 @@ export default { ...@@ -339,11 +381,6 @@ export default {
} }
} }
.default-box { .default-box {
width: 624px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!