Commit 5acd95c0 by 胡悦

提交一客一群

1 parent 6d1f54ff
......@@ -8,10 +8,60 @@
*/
import { http } from '@/main'
const URL = '/rop-scrm-entmicro/router'
const PATH = 'org.ore.api.one.'
const PATH = 'org.ore.api.one.template.'
const templateList = params => {
params.method = `${PATH}template.list`
params.method = `${PATH}list`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const insert = params => {
params.method = `${PATH}insert`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const update = params => {
params.method = `${PATH}update`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const detail = params => {
params.method = `${PATH}detail`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const status = params => {
params.method = `${PATH}status`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const listDepartmentTree = params => {
params.method = 'cn.com.glsx.entmicro.department.listDepartmentTree'
return http({
url: URL,
method: 'GET',
......@@ -21,5 +71,10 @@ const templateList = params => {
}
export default {
templateList
templateList,
insert,
detail,
status,
update,
listDepartmentTree
}
......@@ -23,7 +23,7 @@ module.exports = {
*/
request: {
// baseURL: 'http://scrm.test.glsx.com.cn', // 测试
baseURL: 'http://192.168.1.65:8064',
baseURL: 'http://192.168.2.42:8064',
// 设置超时时间
timeout: 180000,
// 携带凭证
......
......@@ -25,11 +25,11 @@ VueRouter.prototype.push = function push(location) {
// }
function getRoutes(routesData) {
return routesData.reduce((routes, route) => {
routes.push({ ...route, component: () => import('@/views' + route.path + '.vue') })
return routes
routes.push({ ...route, component: () => import('@/views' + route.compath + '.vue') })
return routes
}, [])
}
export {
export {
VueRouter,
routes,
getRoutes
......
......@@ -10,15 +10,16 @@
import Vue from 'vue'
import { message } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
import { GLButton,GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { GLButton, GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { Http, utils } from 'glsx-common'
import render from './render'
import { routes } from '@/router'
export async function start() {
if (window.__POWERED_BY_QIANKUN__) return
const { response, request, sign, secret } = await fetchConfig(true)
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: 'mini-f27a0943-8fbf-4b21-a7a1-8e82a117ba39-rop' } })
Vue.use(GLButton,GLTable, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: 'mini-3ab7a37c-3bfa-4a83-bbf8-9e59c6e10330-rop' } })
Vue.prototype.$http_common = new Http({ response, signWay: "md5", request: 'http://qcdidicb.glsx.net:7060', sign, secret, alert: message.error, headers: { token: 'mini-3ab7a37c-3bfa-4a83-bbf8-9e59c6e10330-rop' } })
Vue.use(GLButton, GLTable, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
render('/', routes)
}
......@@ -3,26 +3,30 @@
<div class="preview-content">
<div class="preview-time">{{ currentTime }}</div>
<div class="preview-info" v-for="item in previewList" :key="item.id">
<img class="avatar" src="../../../assets/logo.png" alt="" />
<template v-if="item.type == 'text'">
<div class="preview-text text">{{ item.content }}</div>
<img class="avatar" src="@/assets/logo.png" alt="" />
<template v-if="item.attType == 1">
<div class="preview-text text">{{ item.attContent }}</div>
</template>
<template v-else-if="item.type == 'link'">
<template v-else-if="item.attType == 4">
<div class="preview-text preview-link">
{{ item.url }}
<img src="../../../assets/guestCustom/preview-link.png" alt="" />
{{ item.attContent.url }}
<img src="@/assets/guestCustom/preview-link.png" alt="" />
</div>
</template>
<template v-else-if="item.type == 'img'">
<el-image style="width: 100px" :src="item.url" fit="contain"></el-image>
<template v-else-if="item.attType == 2">
<el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image>
</template>
<template v-else-if="item.type == 'applet'">
<template v-else-if="item.attType == 3">
<!-- <el-image style="width: 100px" :src="item.attContent" fit="contain"></el-image> -->
<video style="width: 100px" :src="item.attContent"></video>
</template>
<template v-else-if="item.attType == 5">
<div class="preview-text text preview-applet">
<div class="preview-applet-title">
<img :src="item.appleIcon" alt="" />
<span>{{ item.title }}</span>
<img :src="item.attContent.picUrl" alt="" />
<span>{{ item.attContent.title }}</span>
</div>
{{ item.content }}
{{ item.attContent.page }}
</div>
</template>
</div>
......@@ -88,10 +92,11 @@ export default {
}
.preview-text {
position: relative;
max-width: 190px;
max-width: 169px;
color: #333;
background-color: #fff;
border-radius: 4px;
word-wrap: break-word;
}
.text {
font-size: 16px;
......
......@@ -18,13 +18,19 @@
height: treeHeight + 20 + 'px'
}"
>
<GLTable ref="saleTable" :tableData="tableEmpData" :tableParams="tableParams" :hasNum="false" :hasPage="false" @selectionTable="selectionTable"></GLTable>
<GLTable ref="saleTable" :tableData="tableEmpData" :tableParams="tableParams" :hasNum="false" :hasPage="false" @selectionTable="selectionTable">
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" v-show="!group.staffName" @click="selectGroup(scope.scope)">设为群主</el-button>
<el-button type="text" v-show="group.staffName && scope.scope.staffName == group.staffName" @click="cancelGroup">取消群主</el-button>
</div>
</GLTable>
</el-col>
</div>
</template>
<script>
export default {
name: 'selectEmp',
props: ['selectData'],
data() {
return {
treeHeight: 0,
......@@ -52,19 +58,41 @@ export default {
{
label: '职务',
prop: 'staffTitle'
},
{
label: '',
prop: 'optionBtns',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
tableEmpData: []
tableEmpData: [],
group: {},
allGroup: [],
employeeList: []
}
},
methods: {
selectionTable(val) {
console.log(val)
this.$emit('selectTable', val)
this.allGroup = val
const hasGroup = val.find(item => item.id == this.group.id)
if (!hasGroup) {
this.cancelGroup()
}
},
listDepartmentTree() {
this.$apis.emp.listDepartmentTree({ id: 1 }).then(res => {
this.$apis.groupGuest.listDepartmentTree({ merchantId: 10001001, addChildrensFlag: true }).then(res => {
this.listTree = res
this.listTree[0].entmicroStaffResponses = this.getEmployee(this.listTree)
console.log(this.listTree)
this.selectData.forEach(i => {
const row = this.getEmployee(this.listTree).find(j => j.id == i.staffId)
console.log(row)
this.clearSelect(row)
})
this.$nextTick(() => {
document.getElementsByClassName('el-tree-node__expand-icon')[0].click()
document.getElementsByClassName('el-tree-node__content')[0].click()
......@@ -72,30 +100,59 @@ export default {
})
},
clearSelect(row) {
console.log(row, '2222')
this.$refs.saleTable.$refs.salelistMutiTable.toggleRowSelection(row)
},
clearSelection() {
console.log(2222)
this.$refs.saleTable.$refs.salelistMutiTable.clearSelection()
},
handleNodeClick(data) {
this.departmentId = data.id
this.listEntmicroStaff()
this.tableEmpData = data.entmicroStaffResponses
// this.listEntmicroStaff()
},
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
selectGroup(data) {
console.log(data)
this.group = data
const obj = this.allGroup.find(item => item.id == data.id)
if (!obj) this.$refs.saleTable.$refs.salelistMutiTable.toggleRowSelection(data)
this.$emit('group', this.group)
},
cancelGroup() {
this.group = {}
this.$emit('group', this.group)
},
getEmployee(d, arr = []) {
d.forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
arr.push(j)
})
}
if (i.children) {
this.getEmployee(i.children, arr)
}
})
return 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 - 450
this.listDepartmentTree()
console.log(this.selectData, '.....')
}
}
</script>
......
......@@ -13,28 +13,14 @@
</div>
<div>
<div class="select-sale-panel">
<select-emp @selectTable="selectTable" ref="selectEmpTabel"></select-emp>
<select-emp :selectData="selectData" @group="handlGroup" @selectTable="selectTable" ref="selectEmpTabel"></select-emp>
<div class="popper__arrow"></div>
</div>
</div>
</el-form-item>
<el-form-item label="请选择跟进员工类型">
<div class="emp-type">
<div @click="handleType(index)" :class="{ checked: typeIndex == index }" class="emp-type-btn" v-for="(item, index) in empType" :key="index">
{{ item.followName }}
<i class="el-icon-error" @click="delEmpType(item, index)" v-if="!item.commonFlag"></i>
</div>
</div>
<div class="sale-select">
<el-input size="small" v-model="empTypeValue" placeholder="添加类型名称" maxlength="8" show-word-limit></el-input>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="addEmpType">新增</el-button></div>
</div>
<div class="sale-type-desc">跟进员工类型最多新增30个,已新增{{ empType.length - 3 }}个</div>
<el-form-item label="群主">
<el-tag v-show="group.staffName" closable @close="cancelGroup">{{ group.staffName }}</el-tag>
</el-form-item>
<!-- <el-form-item style="text-align: center">
<el-button @click="onCancel" size="small">取消</el-button>
<el-button type="primary" @click="onSubmit" size="small">确定</el-button>
</el-form-item> -->
</el-form>
</div>
</template>
......@@ -42,6 +28,7 @@
import selectEmp from './selectEmp.vue'
export default {
name: 'SelectMembers',
props: ['selectData'],
components: {
selectEmp
},
......@@ -50,10 +37,11 @@ export default {
addForm: {},
typeIndex: 0,
empType: [],
empTypeValue: '',
// empTypeValue: '',
newTag: '',
innerTags: [],
dialog_temp: {}
dialog_temp: {},
group: {}
}
},
methods: {
......@@ -67,16 +55,9 @@ export default {
}
},
selectTable(val) {
console.log(val)
this.innerTags = val
},
listEntFollowerType() {
this.$apis.emp.listEntFollowerType({ merchantId: this.$globalState.session.merchantId }).then(res => {
this.empType = res
})
},
handleType(index) {
this.typeIndex = index
},
foucusTagInput() {
if (this.readOnly || !this.$el.querySelector('.tag-input')) {
return
......@@ -85,58 +66,33 @@ export default {
}
},
remove(row) {
console.log(row, '111')
this.$refs.selectEmpTabel.clearSelect(row)
},
//查询
searchEmp() {
this.$refs.selectEmpTabel.listEntmicroStaff(this.newTag)
this.$refs.selectEmpTabel.listDepartmentTree(this.newTag)
},
addEmpType() {
if (!this.empTypeValue) {
this.$message.error('请输入类型名称')
return
}
if (this.empType.length == 33) {
this.$message.error('跟进员工类型最多新增30个')
handlGroup(val) {
console.log(val)
this.group = val
},
cancelGroup() {
this.$refs.selectEmpTabel.cancelGroup()
},
onSubmit() {
if (this.innerTags.length == 0) {
this.$message({
message: '请选择成员',
type: 'error'
})
return
}
let params = {
followName: this.empTypeValue,
merchantid: this.$globalState.session.merchantId
}
this.$apis.emp.saveFollowerType(params).then(res => {
this.listEntFollowerType()
})
this.empTypeValue = ''
},
delEmpType(item, index) {
this.$apis.emp.deleteFollowerType({ id: item.id }).then(res => {
if (res) {
this.listEntFollowerType()
this.typeIndex = 0
}
let userIds = []
this.innerTags.forEach(item => {
userIds.push(item.userId)
})
}
// onSubmit() {
// if (this.innerTags.length == 0) {
// this.$message({
// message: '请选择员工',
// type: 'error'
// })
// return
// }
// let userIds = []
// this.innerTags.forEach(item => {
// userIds.push(item.userId)
// })
// this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds)
// },
// onCancel() {
// this.$emit('closeDrawer')
// }
},
mounted() {
this.listEntFollowerType()
}
}
</script>
......
......@@ -8,18 +8,18 @@
</div>
<div class="container">
<search-form class="searchTop border-shadow" :formModel="searchForm" :formList="searchFormData" @searchTable="searchTable" @syncClick="syncClick">
<search-form class="searchTop border-shadow" :formModel="searchForm" :formList="searchFormData">
<span class="inline-b" slot="form-slot">
<el-button type="primary" @click="searchTable">查询</el-button>
</span>
</search-form>
<!-- 表格区域 开始 -->
<GLTable ref="gueastGroup" :tableData="tableData" :searchForm="searchFormData" :tableParams="tableParams" :pageConf="pageConf">
<GLTable ref="gueastGroup" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
<div slot="entmicro-name" class="entmicro" slot-scope="scope">
<span v-for="(i, index) in scope.scope.userList" :key="index">{{ i.name }}({{ i.tips }});</span>
<span v-for="(i, index) in scope.scope.userList" :key="index">{{ i.staffName }}({{ i.departmentName }});</span>
</div>
<span slot="status" slot-scope="scope">
<span class="statusText" :class="{ 'red-text': scope.scope.status === '2', 'green-text': scope.scope.status === '1' }">{{ statusText(scope.scope.status) }}</span>
<span class="statusText" :class="{ 'red-text': scope.scope.status === '2', 'green-text': scope.scope.status === '1' }">{{ scope.scope.status == '1' ? '启用' : '停用' }}</span>
</span>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="btnClick('edit', scope.scope)">修改</el-button>
......@@ -40,7 +40,7 @@ export default {
{
type: 'input',
inputType: 'text',
prop: 'orgName',
prop: 'groupName',
label: '组名',
placeholder: '请输入组名搜索'
}
......@@ -48,7 +48,7 @@ export default {
// 表格
getListApi: this.$apis.groupGuest.templateList,
tableParams: {
listName: 'data',
listName: '',
tableOption: false,
otherOptions: {
label: '启用开关'
......@@ -180,17 +180,13 @@ export default {
//搜索表格
searchTable() {
console.log(this.searchForm)
// this.$refs.gueastGroup.refreshTable()
},
statusText(val) {
console.log(val)
return val === '1' ? '启用' : '停用'
this.$refs.gueastGroup.refreshTable()
},
btnClick(name, rowData) {
console.log(name)
switch (name) {
case 'create':
this.$router.push('/guestGroup/add/' + 1)
this.$router.push('/guestGroup/add/' + -1)
break
case 'edit':
this.$router.push('/guestGroup/add/' + rowData.id)
......@@ -202,10 +198,29 @@ export default {
type: 'warning'
})
.then(() => {
this.$message({
type: 'success',
message: '操作成功!'
})
const params = {
id: rowData.id,
status: rowData.status == 1 ? 2 : 1,
merchantId: 1
}
this.$apis.groupGuest
.status(params)
.then(res => {
console.log(res)
if (res) {
this.searchTable()
this.$message({
type: 'success',
message: '操作成功!'
})
}
})
.catch(err => {
this.$message({
type: 'error',
message: err.message
})
})
})
.catch(() => {
this.$message({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!