Commit 1f3a1cbb by test

bug fixed

1 parent 26b9c021
<script> <script>
import { getTree, getList } from '@/api/organization' import { getTree, getList } from '@/api/organization'
import { createUniqueString } from '@/utils' import { createUniqueString } from '@/utils'
export default { export default {
name: 'SelectUser', name: 'SelectUser',
components: {}, components: {},
props: { props: {
// 添加标签显隐 // 添加标签显隐
visible: { visible: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
title: { title: {
type: String, type: String,
default: '组织架构' default: '组织架构',
}, },
// 是否 只选择叶子节点(人员节点)/禁止选择父节点(部门节点) // 是否 只选择叶子节点(人员节点)/禁止选择父节点(部门节点)
isOnlyLeaf: { isOnlyLeaf: {
type: Boolean, type: Boolean,
default: true default: true,
}, },
// 是否单选 // 是否单选
isSigleSelect: { isSigleSelect: {
type: Boolean, type: Boolean,
default: false default: false,
},
defaultValues: {
type: Array,
default: () => []
},
destroyOnClose: Boolean
}, },
defaultValues: { data () {
type: Array, let isOnlyLeaf = this.isOnlyLeaf
default: () => [] return {
} treeData: [],
}, userList: [],
data() { defaultProps: {
let isOnlyLeaf = this.isOnlyLeaf label: 'name',
return { children: 'children',
treeData: [], disabled (data, node) {
userList: [], return isOnlyLeaf && !data.userId
defaultProps: { },
label: 'name', isLeaf (data, node) {
children: 'children', return !data.id
disabled(data, node) { },
return isOnlyLeaf && !data.userId
}, },
isLeaf(data, node) {
return !!data.userId
}
}
}
},
watch: {},
computed: {
Pvisible: {
get() {
// this.getTree();
return this.visible
},
set(val) {
this.$emit('update:visible', val)
} }
}, },
defaultCheckedKeys() { watch: {
const checkedList = [] defaultValues (value) {
const checkedUserList = [] if (this.$refs.tree) this.$refs.tree.setCheckedKeys([])
if (!Array.isArray(this.defaultValues) || this.defaultValues.length == 0) {
this.userList = []
} else {
this.defaultValues.forEach((i) => {
const id = this.isOnlyLeaf ? i.userId : i.userId || i.id
if (id) {
checkedList.push(id)
checkedUserList.push(i)
}
})
this.userList = checkedUserList
} }
return checkedList },
} computed: {
}, Pvisible: {
created() {}, get () {
mounted() {}, // this.getTree();
methods: { return this.visible
loadNode(node, resolve) { },
if (node.level === 0) { set (val) {
if (!Array.isArray(this.defaultValues) || this.defaultValues.length == 0) { this.$emit('update:visible', val)
},
},
defaultCheckedKeys () {
const checkedList = []
const checkedUserList = []
if (
!Array.isArray(this.defaultValues) ||
this.defaultValues.length == 0
) {
this.userList = [] this.userList = []
} } else {
getTree().then(({ data }) => { this.defaultValues.forEach(i => {
data.forEach((element) => { const id = this.isOnlyLeaf ? i.userId : (i.userId || i.id)
element.key = createUniqueString() if (id) {
}) checkedList.push(id)
let _data = this.handleTree(data) checkedUserList.push(i)
// console.log('d', data) }
resolve(_data)
// api.getList({ department: _data[0].id }).then(({ rows, total }) => {
// _data && rows.unshift(..._data);
// resolve(rows);
// });
})
} else {
getList({ department: node.data.id, isActivate: 1 }).then(({ rows }) => {
rows.forEach((element) => {
element.key = createUniqueString()
}) })
node.data.children && rows.push(...node.data.children) this.userList = checkedUserList
resolve(rows) }
}) return checkedList
} }
}, },
// 选择变化 created () { },
handleCheckChange(data, checked, indeterminate) { mounted () { },
// debugger methods: {
if (checked) { loadNode (node, resolve) {
if (this.isSigleSelect) { if (node.level === 0) {
// 单选情况 if (!Array.isArray(this.defaultValues) ||
this.$refs.tree.setCheckedKeys([data.key]) this.defaultValues.length == 0
) {
this.userList = []
}
getTree().then(({ data }) => {
// data.forEach((element) => {
// element.key = createUniqueString()
// })
let _data = this.handleTree(data)
resolve(_data)
// api.getList({ department: _data[0].id }).then(({ rows, total }) => {
// _data && rows.unshift(..._data);
// resolve(rows);
// });
})
} else {
getList({ department: node.data.id, isActivate: 1 }).then(
({ rows }) => {
// rows.forEach((element) => {
// element.key = createUniqueString()
// })
node.data.children && rows.push(...node.data.children)
resolve(rows)
}
)
} }
if (this.isOnlyLeaf) { },
if (data.userId) { handleTree (data) {
this.userList.push(data) return data.map(i => {
if (i.id) {
i.userId = i.id
i.isParty = true
}
return i
})
},
// 选择变化
handleCheckChange (data, checked, indeterminate) {
// console.log(arguments)
if (checked) {
if (this.isSigleSelect) {
// 单选情况
this.$refs.tree.setCheckedKeys([data.userId])
}
if (this.isOnlyLeaf) {
if (data.userId && !data.isParty) {
this.userList.push(data)
}
} else {
const isExist = this.userList.findIndex(i => i.userId === data.userId) > -1
!isExist && this.userList.push(data)
} }
} else { } else {
this.userList.push(data) // let index = this.userList.indexOf(data)
let index = this.userList.findIndex(i => i.userId === data.userId)
index > -1 && this.userList.splice(index, 1)
} }
} else { // console.log(data, checked, indeterminate);
let index = this.userList.indexOf(data) },
// 确 定
submit () {
this.Pvisible = false
this.$emit('success', [...this.userList])
},
// 取消选择
cancle (key) {
this.$refs.tree.setChecked(key, false)
let index = this.userList.findIndex(i => i.userId === key)
index > -1 && this.userList.splice(index, 1) index > -1 && this.userList.splice(index, 1)
} let order = this.defaultValues.findIndex(i => i.userId === key)
// console.log(data, checked, indeterminate); order > -1 && this.defaultValues.splice(order, 1)
}, },
// 确 定
submit() {
this.Pvisible = false
this.$emit('success', this.userList)
}, },
// 取消选择
cancle(key) {
this.$refs.tree.setChecked(key, false)
}
} }
}
</script> </script>
setChecked
<template> <template>
<el-dialog :title="title" :visible.sync="Pvisible" :close-on-click-modal="false"> <el-dialog :title="title" :visible.sync="Pvisible" :destroy-on-close="destroyOnClose">
<el-row :gutter="20"> <el-row :gutter="20">
<!--部门数据-->
<el-col :span="12" :xs="24"> <el-col :span="12" :xs="24">
<div class="head-container"> <div class="head-container">
<!-- <div>部门架构</div> --> <el-tree node-key="userId" ref="tree" lazy accordion show-checkbox :check-on-click-node="false" :expand-on-click-node="true" :default-checked-keys="defaultCheckedKeys" :load="loadNode" :props="defaultProps" :check-strictly="!isOnlyLeaf" @check-change="handleCheckChange"></el-tree>
<!-- :filter-node-method="filterNode" -->
<el-tree
node-key="key"
ref="tree"
lazy
accordion
show-checkbox
:check-on-click-node="false"
:expand-on-click-node="true"
:load="loadNode"
:props="defaultProps"
:default-checked-keys="defaultCheckedKeys"
:check-strictly="!isOnlyLeaf"
@check-change="handleCheckChange"
></el-tree>
</div> </div>
</el-col> </el-col>
<!--用户数据-->
<el-col :span="12" :xs="24" class="user-list"> <el-col :span="12" :xs="24" class="user-list">
<el-row :gutter="10">选择人员列表</el-row> <el-row :gutter="10">选择人员列表</el-row>
<el-row v-for="(item, index) in userList" :key="index"> <el-row v-for="(item, index) in userList" :key="index">
<i class="el-icon-user-solid"></i> <i class="el-icon-user-solid"></i>
{{ item.name }} {{ item.name }}
<i class="el-icon-minus fr cp" title="取消选择" @click="cancle(item.key)"></i> <i class="el-icon-minus fr cp" title="取消选择" @click="cancle(item.userId)"></i>
</el-row> </el-row>
</el-col> </el-col>
</el-row> </el-row>
...@@ -182,9 +189,9 @@ setChecked ...@@ -182,9 +189,9 @@ setChecked
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.user-list { .user-list {
.el-row { .el-row {
line-height: 26px; line-height: 26px;
}
} }
}
</style> </style>
...@@ -402,7 +402,7 @@ ...@@ -402,7 +402,7 @@
/** 获取欢迎语列表 */ /** 获取欢迎语列表 */
getWelList () { getWelList () {
this.welLoading = true this.welLoading = true
getList(this, this.welQuery).then(({ rows }) => { getList(this.welQuery).then(({ rows }) => {
this.welList = rows this.welList = rows
this.$refs.table.$forceUpdate() this.$refs.table.$forceUpdate()
this.welLoading = false this.welLoading = false
......
...@@ -199,7 +199,7 @@ ...@@ -199,7 +199,7 @@
weEmpleCodeUseScops: [], weEmpleCodeUseScops: [],
empleCodeRosterDto: [ empleCodeRosterDto: [
{ {
type: 1, type: 0,
weEmpleCodeUseScops: [], // 员工 weEmpleCodeUseScops: [], // 员工
weekday: [1, 2, 3, 4, 5, 6, 7], // 周期 weekday: [1, 2, 3, 4, 5, 6, 7], // 周期
qrRuleType: 2, qrRuleType: 2,
...@@ -590,7 +590,7 @@ ...@@ -590,7 +590,7 @@
this.codeForm.empleCodeRosterDto.push({ this.codeForm.empleCodeRosterDto.push({
weEmpleCodeUseScops: [], // 员工 weEmpleCodeUseScops: [], // 员工
weekday: [], // 周期 weekday: [], // 周期
type: 2, type: 1,
startDate: '', // 开始时间 startDate: '', // 开始时间
endDate: '', // 结束时间 endDate: '', // 结束时间
}) })
...@@ -630,9 +630,8 @@ ...@@ -630,9 +630,8 @@
} }
myObj.attachments.push(...data.materialMsgList) myObj.attachments.push(...data.materialMsgList)
if (this.codeForm.qrRuleType === 1) { if (this.codeForm.qrRuleType === 1) {
console.log(this.codeForm)
let obj = { let obj = {
type: 1, type: 0,
scopeId: this.codeForm.weEmpleCodeUseScops[0].scopeId ? this.codeForm.weEmpleCodeUseScops[0].scopeId : '', scopeId: this.codeForm.weEmpleCodeUseScops[0].scopeId ? this.codeForm.weEmpleCodeUseScops[0].scopeId : '',
userIds: this.codeForm.weEmpleCodeUseScops.map(dd => dd.businessId) userIds: this.codeForm.weEmpleCodeUseScops.map(dd => dd.businessId)
} }
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
methods: { methods: {
editFn () { editFn () {
this.$router.push({ this.$router.push({
path: '/wechat/drainageCode/staff/' + 'add', path: '/drainageCode/' + 'staffAdd',
query: { query: {
id: this.form.id id: this.form.id
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<div class="item-list"> <div class="item-list">
<div class="item" :class="{'active': groupIndex == key}" v-for="(group, key) in groupList" :key="group.id" @click="switchGroup(key, group)"> <div class="item" :class="{'active': groupIndex == key}" v-for="(group, key) in groupList" :key="group.id" @click="switchGroup(key, group)">
<div class="name">{{ group.name }}</div> <div class="name">{{ group.name }}</div>
<el-dropdown v-if="groupIndex == key" class="dropdown" @command="onGroupCommand($event, group)"> <el-dropdown v-if="groupIndex == key && group.flag === 0" class="dropdown" @command="onGroupCommand($event, group)">
<span class="dot"> <span class="dot">
<!-- <img :src="require('@/assets/drainageCode/more.png')" alt=""> --> <!-- <img :src="require('@/assets/drainageCode/more.png')" alt=""> -->
<i class="el-icon-more"></i> <i class="el-icon-more"></i>
...@@ -177,6 +177,8 @@ ...@@ -177,6 +177,8 @@
groupId: '', groupId: '',
qrName: '', // 活码名称 qrName: '', // 活码名称
qrUserName: undefined, qrUserName: undefined,
orderByColumn: 'wqc.create_time',
isAsc: 'desc'
}, },
userArray: [], // 选择人员 userArray: [], // 选择人员
userArrayStr: "", userArrayStr: "",
......
...@@ -41,9 +41,13 @@ ...@@ -41,9 +41,13 @@
computed: {}, computed: {},
created () { created () {
this.form.id = this.$route.query.id this.form.id = this.$route.query.id
let data = JSON.parse(localStorage.getItem('obj')) if (this.form.id) {
this.form = Object.assign(this.form, data) let data = JSON.parse(localStorage.getItem('obj'))
this.form.welcomeMsgTplType = this.form.welcomeMsgTplType.toString() this.form = Object.assign(this.form, data)
this.form.welcomeMsgTplType = this.form.welcomeMsgTplType.toString()
} else {
this.form.welcomeMsgTplType = this.$route.query.welcomeMsgTplType
}
this.name = this.form.welcomeMsgTplType === '1' ? '活码' : this.form.welcomeMsgTplType === '2' ? '员工' : '入群' this.name = this.form.welcomeMsgTplType === '1' ? '活码' : this.form.welcomeMsgTplType === '2' ? '员工' : '入群'
this.type = this.form.id ? '编辑' : '新建' this.type = this.form.id ? '编辑' : '新建'
this.$route.meta.title = (this.form.id ? '编辑' : '新建') + '欢迎语' this.$route.meta.title = (this.form.id ? '编辑' : '新建') + '欢迎语'
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="欢迎语" align="center" prop="welcomeMsg" min-width="250" show-overflow-tooltip/> <el-table-column label="欢迎语" align="center" prop="welcomeMsg" min-width="250" show-overflow-tooltip/>
<el-table-column v-if="type === '2'" label="员工" prop="userNames" align="center"></el-table-column>
<el-table-column label="创建人" align="center" prop="createBy" /> <el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="创建时间" align="center" prop="createTime" /> <el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
...@@ -148,11 +149,11 @@ ...@@ -148,11 +149,11 @@
goRoute (data) { goRoute (data) {
let query = {} let query = {}
if (data) { if (data) {
localStorage.setItem('obj', JSON.stringify(data))
query.id = data.id query.id = data.id
} else { } else {
query.welcomeMsgTplType = this.type query.welcomeMsgTplType = this.type
} }
localStorage.setItem('obj', JSON.stringify(data))
this.$router.push({ this.$router.push({
path: '/drainageCode/welcomeAdd', path: '/drainageCode/welcomeAdd',
query: query query: query
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<el-step title="群发内容"></el-step> <el-step title="群发内容"></el-step>
</el-steps> </el-steps>
</div> </div>
<div v-if="currentActive === 1"> <div class="g-card g-pad20" v-if="currentActive === 1">
<el-form style="width: 60%;" ref="form" :model="form" :rules="rules" label-width="100px"> <el-form style="width: 60%;margin:0 auto;" ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="群发类型" required prop="chatType"> <el-form-item label="群发类型" required prop="chatType">
<el-radio-group v-model="form.chatType"> <el-radio-group v-model="form.chatType">
<el-radio :label=1>群发客户</el-radio> <el-radio :label=1>群发客户</el-radio>
...@@ -283,7 +283,6 @@ ...@@ -283,7 +283,6 @@
nextStep () { nextStep () {
this.$refs.form.validate(validate => { this.$refs.form.validate(validate => {
if (!validate) return if (!validate) return
if (this.form.chatType === 1) { if (this.form.chatType === 1) {
let data = { let data = {
userIds: '', userIds: '',
...@@ -302,7 +301,11 @@ ...@@ -302,7 +301,11 @@
data.trackState = this.form.trackState data.trackState = this.form.trackState
getCustomerList(data).then(res => { getCustomerList(data).then(res => {
this.form.customerList = res.data this.form.customerList = res.data
this.currentActive = 2 if (res.data && res.data.length) {
this.currentActive = 2
} else {
this.msgError('未找到可发送客户!')
}
}) })
} else { } else {
this.currentActive = 2 this.currentActive = 2
......
...@@ -168,14 +168,14 @@ ...@@ -168,14 +168,14 @@
}, },
queryMember: { queryMember: {
userName: '', userName: '',
msgId: '', msgTemplateId: '',
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
status: '' status: ''
}, },
queryCustomer: { queryCustomer: {
customerName: '', customerName: '',
msgId: '', msgTemplateId: '',
status: '', status: '',
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
...@@ -201,8 +201,8 @@ ...@@ -201,8 +201,8 @@
computed: {}, computed: {},
created () { created () {
this.msgId = this.$route.query.id this.msgId = this.$route.query.id
this.queryMember.msgId = this.msgId this.queryMember.msgTemplateId = this.msgId
this.queryCustomer.msgId = this.msgId this.queryCustomer.msgTemplateId = this.msgId
this.getDetail() this.getDetail()
this.getMemberList() this.getMemberList()
this.getCustomerList() this.getCustomerList()
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="发送类型" prop="timedTask"> <el-form-item label="发送类型" prop="isTask">
<el-select v-model="query.isTask" placeholder="请选择发送类型" size="mini"> <el-select v-model="query.isTask" placeholder="请选择发送类型" size="mini">
<el-option v-for="(value, key, index) in timedTask" :label="value" :value="key" :key="index"> <el-option v-for="(value, key, index) in timedTask" :label="value" :value="key" :key="index">
</el-option> </el-option>
...@@ -46,8 +46,8 @@ ...@@ -46,8 +46,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<!-- v-hasPermi="['enterpriseWechat:view']" --> <!-- v-hasPermi="['enterpriseWechat:view']" -->
<el-button size="mini" type="text" @click="goRoute(scope.row.id, 'detail')">详情</el-button> <el-button size="mini" type="text" @click="goRoute(scope.row.id, 'detail')">详情</el-button>
<el-divider v-if="scope.row.isTask === 1" direction="vertical"></el-divider> <el-divider v-if="scope.row.isTask === 1 && scope.row.status === 0" direction="vertical"></el-divider>
<el-button size="mini" v-if="scope.row.isTask === 1" type="text" @click="cancelSend(scope.row)">取消发送</el-button> <el-button size="mini" v-if="scope.row.isTask === 1 && scope.row.status === 0" type="text" @click="cancelSend(scope.row)">取消发送</el-button>
<!-- <el-button v-hasPermi="['enterpriseWechat:edit']" size="mini" type="text" disabled="" <!-- <el-button v-hasPermi="['enterpriseWechat:edit']" size="mini" type="text" disabled=""
@click="goRoute(scope.row, 1)">编辑</el-button> @click="goRoute(scope.row, 1)">编辑</el-button>
<el-button v-hasPermi="['enterpriseWechat:edit']" size="mini" type="text" <el-button v-hasPermi="['enterpriseWechat:edit']" size="mini" type="text"
...@@ -89,7 +89,9 @@ ...@@ -89,7 +89,9 @@
pageSize: 10, pageSize: 10,
content: undefined, content: undefined,
chatType: undefined, chatType: undefined,
isTask: undefined isTask: undefined,
orderByColumn: 'create_time',
isAsc: 'desc'
}, },
pushType: { pushType: {
1: '发给客户', 1: '发给客户',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!