Commit b98d30a5 by 胡悦

一客一群修复bug

1 parent c93f7f33
......@@ -13,7 +13,7 @@
<el-form :model="basicForm" :rules="basicRules" ref="basicForm" label-width="124px">
<el-form-item label="自定义群名" prop="groupName">
<el-input
v-model="basicForm.groupName"
v-model.trim="basicForm.groupName"
size="small"
placeholder="为群聊设个自定义组名,如“VIP服务群”"
maxlength="10"
......@@ -24,11 +24,10 @@
v-model="basicForm.groupNameRule"
style="line-height: 40px; font-size: 14px; max-width: 600px;"
>
<el-radio
v-for="(rule, index) in nameRules"
:label="rule.id"
:key="index"
>{{ rule.rule }}<span class="rule-tips">{{rule.tips}}</span></el-radio>
<el-radio v-for="(rule, index) in nameRules" :label="rule.id" :key="index">
{{ rule.rule }}
<span class="rule-tips">{{rule.tips}}</span>
</el-radio>
</el-radio-group>
<!-- <div class="form-tips">群聊名称后缀将以日期及序号进行累加,如“新车售后一组211011-1群”</div> -->
</el-form-item>
......@@ -90,7 +89,6 @@
</div>
</div>
</div>
</el-form-item>
</el-form>
<!-- 编辑入群欢迎语 -->
......@@ -120,15 +118,15 @@
<el-button @click="handleCancel">取消</el-button>
</div>
<basic-dialog
:title="'选择成员'"
:width="'1142px'"
:isVisible="membersVisible"
@confirmDialog="handleConfirm"
@closeDialog="membersVisible = !membersVisible"
>
<!-- <SelectMembers islord="false" :selectData="selectData" ref="membersForm"></SelectMembers> -->
<SelectMember ref="membersForm" v-if="membersVisible" :selectData="selectData"></SelectMember>
</basic-dialog>
:title="'选择成员'"
:width="'1142px'"
:isVisible="membersVisible"
@confirmDialog="handleConfirm"
@closeDialog="membersVisible = !membersVisible"
>
<!-- <SelectMembers islord="false" :selectData="selectData" ref="membersForm"></SelectMembers> -->
<SelectMember ref="membersForm" v-if="membersVisible" :selectData="selectData" :followData="followData"></SelectMember>
</basic-dialog>
<!-- <SelectMember ref="membersForm"></SelectMember> -->
<select-follow @selectTable="selectTable" ref="selectEmpForm"></select-follow>
</div>
......@@ -151,28 +149,28 @@ export default {
data() {
const validatorUser = (rule, value, callback) => {
console.log(this.basicForm.userList)
const followList = this.basicForm.followList
let userList = []
if (this.basicForm.userList && this.basicForm.userList.length) {
userList = this.basicForm.followList.concat(this.basicForm.userList)
const followList = this.basicForm.followList
let userList = []
if (this.basicForm.userList && this.basicForm.userList.length) {
userList = this.basicForm.followList.concat(this.basicForm.userList)
} else {
userList = this.basicForm.followList
}
console.log(userList)
if (!this.basicForm.followList.length) {
callback(new Error('请选择跟进专员'))
} else {
console.log(this.basicForm.followList)
if (userList.length < 2) {
this.$message({
type: 'error',
message: '必须配置2个及以上成员'
})
// callback(new Error('必须配置2个及以上成员'))
} else {
userList = this.basicForm.followList
}
console.log(userList)
if (!this.basicForm.followList.length) {
callback(new Error('请选择跟进专员'))
} else {
console.log(this.basicForm.followList)
if (userList.length < 2) {
this.$message({
type: 'error',
message: '必须配置2个及以上成员'
})
// callback(new Error('必须配置2个及以上成员'))
} else {
callback()
}
callback()
}
}
}
// const nameVaild = (rule, value, callback) => {
// console.log(this.$route.params.id)
......@@ -215,7 +213,7 @@ export default {
{
rule: '自定义群名',
id: 0
},
}
],
basicRules: {
groupName: [
......@@ -233,6 +231,7 @@ export default {
followkey: new Date(),
previewFlag: false,
selectData: [],
followData: [],
editStatus: false,
// 跟进专员
followVisible: false
......@@ -244,14 +243,13 @@ export default {
this.editStatus = true
},
deep: true
},
}
// membersVisible(val) {
// console.log(val)
// if (!val) {
// this.$refs.membersForm.resetSearch()
// }
// }
},
mounted() {
if (this.$route.params) {
......@@ -275,55 +273,55 @@ export default {
console.log(this.basicForm)
this.$refs.basicForm.validate(valid => {
if (valid) {
const params = {
groupName: this.basicForm.groupName,
groupNameRule: this.basicForm.groupNameRule
}
const followList = this.basicForm.followList.map(item => {
return {
staffId: item.staffId,
staffName: item.staffName,
follow: 1
const params = {
groupName: this.basicForm.groupName,
groupNameRule: this.basicForm.groupNameRule
}
})
let memberList = []
if (this.basicForm.userList && this.basicForm.userList.map.length) {
memberList = this.basicForm.userList.map(i => {
const followList = this.basicForm.followList.map(item => {
return {
staffId: i.staffId,
staffName: i.staffName,
follow: 0
staffId: item.staffId,
staffName: item.staffName,
follow: 1
}
})
}
params.userList = followList.concat(memberList)
let apiName = 'insert'
if (this.basicForm.id) {
apiName = 'update'
params.id = this.basicForm.id
}
console.log(params)
this.$apis.groupGuest[apiName](params)
.then(res => {
if (res) {
let memberList = []
if (this.basicForm.userList && this.basicForm.userList.map.length) {
memberList = this.basicForm.userList.map(i => {
return {
staffId: i.staffId,
staffName: i.staffName,
follow: 0
}
})
}
params.userList = followList.concat(memberList)
let apiName = 'insert'
if (this.basicForm.id) {
apiName = 'update'
params.id = this.basicForm.id
}
console.log(params)
this.$apis.groupGuest[apiName](params)
.then(res => {
if (res) {
this.$message({
type: 'success',
message: '操作成功!'
})
this.$router.push('/guestGroup/index')
} else {
this.$message({
type: 'error',
message: '操作失败'
})
}
})
.catch(err => {
this.$message({
type: 'success',
message: '操作成功!'
type: 'error',
message: err.message
})
this.$router.push('/guestGroup/index')
} else {
this.$message({
type: 'error',
message: '操作失败'
})
}
})
.catch(err => {
this.$message({
type: 'error',
message: err.message
})
})
}
})
},
......@@ -378,9 +376,9 @@ export default {
},
// 成员弹窗
handleConfirm() {
this.basicForm.userList = this.$refs.membersForm.innerTags
this.selectData = this.basicForm.userList
this.openMembers()
this.basicForm.userList = this.$refs.membersForm.innerTags
this.selectData = this.basicForm.userList
this.openMembers()
},
handleClose() {
this.membersVisible = false
......@@ -392,10 +390,12 @@ export default {
staffName: item.staffName
}
})
this.followData = this.basicForm.followList.map(i => i.staffId)
this.followkey = new Date()
},
removeFollow(idx) {
this.basicForm.followList.splice(idx, 1)
this.followData = this.basicForm.followList.map(i => i.staffId)
this.followkey = new Date()
}
}
......
......@@ -54,6 +54,7 @@
</el-form>
<div class="table-content">
<GLTable
:key="key"
v-loading="loading"
ref="empTable"
:tableData="tableEmpData"
......@@ -73,7 +74,7 @@
</div>
<!-- <div class="member-checked">
<el-checkbox v-model="searchForm.checked">仅看跟进专员</el-checkbox>
</div> -->
</div>-->
</div>
<div class="member-right">
<div class="member-title">已选</div>
......@@ -98,11 +99,10 @@
</template>
<script>
import url from "@/assets/empty.png"
import url from '@/assets/empty.png'
export default {
name: 'SelectMember',
props: ['selectData'],
props: ['selectData', 'followData'],
data() {
return {
url: url,
......@@ -139,17 +139,17 @@ export default {
tableEmpData: [],
allTreeData: [],
currentTreeData: [],
innerTags: []
innerTags: [],
key: new Date()
}
},
mounted() {
this.listDepartmentTree()
},
methods: {
selectionTable(val) {
console.log(val)
this.innerTags = val
// this.$emit('selectTable', val)
},
// 清空搜索条件
resetSearch() {
......@@ -171,10 +171,8 @@ export default {
params.islord = this.islord
}
this.loading = true
console.log(this.selectData)
// params.isHavCustomer = true
params.isHavCustomer = true
this.$apis.groupGuest.listDepartmentTree(params).then(res => {
console.log(res)
this.loading = false
if (res) {
this.tableEmpData = this.getEmployee(res)
......@@ -187,13 +185,14 @@ export default {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
})
}
this.tableParams.checkSelectVal = this.followData
this.key = new Date()
} else {
this.treeData = []
}
})
},
handleNodeClick(data) {
console.log(data)
this.searchForm.department = data.departmentName
this.currentTreeData = data
this.onHidePopover()
......@@ -219,8 +218,6 @@ export default {
const data = this.currentTreeData
const keyword = this.searchForm.name
let arr = []
// this.loading = true
console.log(keyword, data, this.tableEmpData)
if (data instanceof Array) {
data.forEach(i => {
if (i.staffName.indexOf(keyword) != -1) {
......@@ -266,6 +263,7 @@ export default {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
},
rowClick(row) {
if (this.followData.find(i => i == row.id)) return
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(row)
}
}
......
......@@ -8,11 +8,13 @@
<div class="content">
<div class="group-name flex">
<div class="avator">
<img src="@/assets/guestCustom/chat-logo.png" alt="" />
<img src="@/assets/guestCustom/chat-logo.png" alt />
</div>
<div class="group-name-info">
<div>{{groupInfo.groupName}}</div>
<div class="group-name-info-count">{{groupInfo.userList ? groupInfo.userList.length : 0}}人</div>
<div
class="group-name-info-count"
>{{groupInfo.userList ? groupInfo.userList.length : 0}}人</div>
</div>
</div>
<div class="text-info">
......@@ -38,7 +40,12 @@
<el-popover placement="top" width="600" trigger="hover">
<span slot="reference">...({{ followList.length }})</span>
<div class="entmicro-hover">
<el-tag type="info" v-for="(i, index) in followList" :key="index" :disable-transitions="false">
<el-tag
type="info"
v-for="(i, index) in followList"
:key="index"
:disable-transitions="false"
>
<i class="el-icon-user-solid"></i>
{{ i.staffName }}{{ i.departmentName ? `(${i.departmentName})` : '' }}
</el-tag>
......@@ -60,7 +67,12 @@
<el-popover placement="top" width="600" trigger="hover">
<span slot="reference">...({{ memberList.length }})</span>
<div class="entmicro-hover">
<el-tag type="info" v-for="(i, index) in memberList" :key="index" :disable-transitions="false">
<el-tag
type="info"
v-for="(i, index) in memberList"
:key="index"
:disable-transitions="false"
>
<i class="el-icon-user-solid"></i>
{{ i.staffName }}{{ i.departmentName ? `(${i.departmentName})` : '' }}
</el-tag>
......@@ -82,15 +94,28 @@
</div>
<div class="text-info">更新于:{{currentTime}}</div>
</div>
<GLTable class="table" :searchForm="searchForm" ref="groupDetail" :hasNum="false" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :noDataImg="url" :pageConf="pageConf" :tableParams="tableParams" :tableData="tableData">
<GLTable
class="table"
:searchForm="searchForm"
ref="groupDetail"
:hasNum="false"
:getListApi="getListApi"
:beforeSearchFn="beforeSearchFn"
:noDataImg="url"
:pageConf="pageConf"
:tableParams="tableParams"
:tableData="tableData"
>
<span slot="customerName" slot-scope="scope">
<div class="customer">
<!-- <div class="customer-img">
<img src="@/assets/guestCustom/chat-logo.png" alt="" />
</div> -->
</div>-->
<div class="customer-name">
{{ scope.scope.customerName }}
<label class="origin">{{ WECHANT_TYPE[scope.scope.type]}}</label>
<label
class="origin"
>{{ WECHANT_TYPE[scope.scope.type]}}</label>
</div>
</div>
</span>
......@@ -101,8 +126,11 @@
</el-tag>
</div>
<span slot="status" class="table-status" slot-scope="scope">
<span class="statusText" :class="{ 'red-text': scope.scope.delFlag === '-1' }">{{ scope.scope.delFlag == '0' ? '使用' : '解散于' }}</span>
<span v-if="scope.scope.delFlag === '-1'" class="gray-text">{{ scope.scope.cancelTime }}</span>
<span
class="statusText"
:class="{ 'red-text': scope.scope.delFlag == '-1' }"
>{{ scope.scope.delFlag == '0' ? '使用' : '解散于' }}</span>
<span v-if="scope.scope.delFlag == '-1'" class="gray-text">{{ scope.scope.disMiss }}</span>
</span>
</GLTable>
</div>
......@@ -113,7 +141,7 @@
width: footerWidth + 'px'
}"
>
<el-button @click="handleCancel">取消</el-button>
<el-button @click="handleCancel" type="primary">取消</el-button>
</div>
</div>
</template>
......@@ -171,7 +199,7 @@ export default {
},
{
label: '现群名称',
prop: 'groupName',
prop: 'chatName',
align: 'left'
},
{
......@@ -390,7 +418,7 @@ export default {
//更新数据
refreshData() {
this.$refs.groupDetail.refreshTable()
this.$set(this, 'currentTime', dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'))
this.$set(this, 'currentTime', dayjs(new Date()).format('YYYY-MM-DD HH:mm'))
},
setTableFinishFun() {
if (this.$refs.groupDetail.data && !this.$refs.groupDetail.data.length) {
......@@ -399,11 +427,11 @@ export default {
},
getGroupList(id) {
// const id = this.userId
this.$apis.groupGuest.detail({id}).then(res => {
this.$apis.groupGuest.detail({ id }).then(res => {
if (res) {
this.followList = []
this.memberList = []
this.currentTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
this.currentTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm')
this.groupInfo = res
if (res.userList && res.userList.length) {
res.userList.forEach(item => {
......@@ -614,5 +642,4 @@ i {
background: #ffffff;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
</style>
\ No newline at end of file
......@@ -71,7 +71,7 @@
</span>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<!-- <el-button type="text" @click="btnClick('edit', scope.scope)">修改</el-button>
<el-button type="text" @click="btnClick('detail', scope.scope)">查看详情</el-button> -->
<el-button type="text" @click="btnClick('detail', scope.scope)">查看详情</el-button>-->
<GLButton type="text" @click="btnClick('edit', scope.scope)" fn="修改群组">修改</GLButton>
<GLButton
type="text"
......@@ -82,7 +82,7 @@
<!-- <el-button
type="text"
@click="btnClick('status', scope.scope)"
>{{ scope.scope.status == 1 ? '停用' : '启用' }}</el-button> -->
>{{ scope.scope.status == 1 ? '停用' : '启用' }}</el-button>-->
</div>
</GLTable>
<!-- 表格区域 end -->
......@@ -245,7 +245,7 @@ export default {
// }
// },
mounted() {
// this.wxTips()
this.wxTips()
},
methods: {
wxTips() {
......@@ -270,6 +270,9 @@ export default {
})
})
},
jumpWx() {
this.$history.push('/settings/enterpriseWechat/index')
},
//搜索表格
searchTable() {
this.$refs.gueastGroup.refreshTable()
......@@ -277,7 +280,7 @@ export default {
btnClick(name, rowData) {
switch (name) {
case 'create':
this.$router.push('/guestGroup/add/-1')
this.$router.push('/guestGroup/add')
break
case 'edit':
this.$router.push('/guestGroup/add/' + rowData.id)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!