Commit 1f3a1cbb by test

bug fixed

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