Commit 46ea7f67 by 胡悦

提交一客一群

1 parent 0f5d368a
......@@ -63,7 +63,7 @@
<el-button type="primary" @click="handleCancel">取消</el-button>
</div>
<basic-dialog :title="'选择成员'" :width="'712px'" :isVisible="membersVisible" @confirmDialog="handleConfirm" @closeDialog="handleClose">
<SelectMembers :key="key" :selectData.sync="selectData" ref="membersForm"></SelectMembers>
<SelectMembers v-if="membersVisible" :key="key" :selectData.sync="selectData" ref="membersForm"></SelectMembers>
</basic-dialog>
</div>
</template>
......@@ -150,27 +150,25 @@ export default {
methods: {
openMembers() {
this.membersVisible = !this.membersVisible
if (this.membersVisible && this.$route.params.id) {
this.$nextTick(() => {
this.key = new Date()
console.log(this.$refs.membersForm)
this.$refs.membersForm.selectTable(this.basicForm.userList)
if (this.basicForm.userList && this.basicForm.userList.length != 0) {
this.basicForm.userList.map(item => {
if (item.masterStatus == 1) {
this.selectData = this.basicForm.userList
}
})
}
})
}
// if (this.membersVisible && this.$route.params.id) {
// this.$nextTick(() => {
// this.key = new Date()
// console.log(this.$refs.membersForm)
// this.$refs.membersForm.selectTable(this.basicForm.userList)
// if (this.basicForm.userList && this.basicForm.userList.length != 0) {
// this.basicForm.userList.map(item => {
// if (item.masterStatus == 1) {
// this.selectData = this.basicForm.userList
// }
// })
// }
// })
// }
},
handleSubmit() {
// const previewList = this.$refs.welcome.previewList
this.$refs.basicForm.validate(valid => {
if (valid) {
console.log(this.basicForm, '111')
console.log(this.basicForm, '122211')
const params = {
// attachmentList: this.$refs.welcome.previewList,
orgName: this.basicForm.orgName,
......@@ -240,6 +238,8 @@ export default {
this.key = new Date()
} else {
this.basicForm.userList.splice(idx, 1)
this.selectData = this.basicForm.userList
this.key = new Date()
}
},
// 成员弹窗
......@@ -256,14 +256,15 @@ export default {
message: '必须配置两个及以上成员'
})
} else {
this.$refs.membersForm.resetSearch()
// this.$refs.membersForm.resetSearch()
this.basicForm.userList = this.$refs.membersForm.innerTags
this.selectData = this.basicForm.userList
this.openMembers()
}
},
handleClose() {
// this.openMembers()
this.$refs.membersForm.resetSearch()
// this.$refs.membersForm.resetSearch()
this.membersVisible = false
// if (this.$route.params.id) {
// this.$nextTick(() => {
......
......@@ -2,14 +2,18 @@
<div class="select-emp-panel">
<div class="scrm-p10 emp-tree-panel">
<div class="popper-arrow"></div>
<div
class="emp-scroll-panel"
:style="{
<div class="emp-scroll-panel" :style="{
height: treeHeight + 'px'
}"
>
}">
<div class="tree-title">所在门店/部门</div>
<el-tree v-loading="loading" :data="listTree" :expand-on-click-node="false" highlight-current :props="defaultProps" @node-click="handleNodeClick"></el-tree>
<el-tree
v-loading="loading"
:data="listTree"
:expand-on-click-node="false"
highlight-current
:props="defaultProps"
@node-click="handleNodeClick"
></el-tree>
</div>
</div>
<el-col
......@@ -18,20 +22,27 @@
height: treeHeight + 20 + 'px'
}"
>
<GLTable :key="key" ref="saleTable" v-loading="loading" :tableData="tableEmpData" :tableParams="tableParams" :hasNum="false" :hasPage="false" @selectionTable="selectionTable"></GLTable>
<GLTable
v-loading="loading"
ref="saleTable"
:tableData="tableEmpData"
:tableParams="tableParams"
:hasNum="false"
:hasPage="false"
@selectionTable="selectionTable"
></GLTable>
</el-col>
</div>
</template>
<script>
export default {
name: 'selectEmp',
props: ['selectData', 'key'],
props: ['selectData', 'islord'],
data() {
return {
treeHeight: 0,
staffName: '',
listTree: [],
isFirst: true,
defaultProps: {
children: 'children',
label: 'departmentName'
......@@ -58,58 +69,38 @@ export default {
]
},
tableEmpData: [],
group: {},
allGroup: [],
employeeList: [],
loading: true,
currentArr: []
}
},
watch: {
selectData: {
handler(val) {
console.log(val)
if (val.length == 0) {
this.clearSelection()
} else {
this.$nextTick(() => {
val.forEach(i => {
const row = this.getEmployee(this.listTree).find(j => j.staffId == i.staffId)
console.log(row)
this.clearSelect(row)
})
})
}
},
immediate: true
currentArr: [],
loading: true
}
},
methods: {
selectionTable(val) {
this.$emit('selectTable', val)
this.allGroup = val
},
listDepartmentTree() {
this.$apis.groupGuest.listDepartmentTree({ merchantId: 10001001, addChildrensFlag: true }).then(res => {
const params = { merchantId: 10001001, addChildrensFlag: true }
if (this.islord) {
params.islord = this.islord
}
this.$apis.groupGuest.listDepartmentTree(params).then(res => {
this.listTree = res
this.loading = false
this.isFirst = false
this.listTree[0].entmicroStaffResponses = this.getEmployee(this.listTree)
console.log(this.listTree, this.selectData)
// this.listTree[0].entmicroStaffResponses = this.getEmployee(this.listTree)
console.log(this.listTree)
this.currentArr = this.$common.utils.deepClone(this.listTree[0].entmicroStaffResponses)
this.gruop = this.selectData.find(i => i.masterStatus == 1)
this.selectData.forEach(i => {
const row = this.getEmployee(this.listTree).find(j => j.id == i.staffId)
console.log(row)
this.clearSelect(row)
})
this.$nextTick(() => {
this.selectData.forEach(i => {
const row = this.getEmployee(this.listTree).find(j => j.staffId == i.staffId)
console.log(row)
this.clearSelect(row)
})
document.getElementsByClassName('el-tree-node__expand-icon')[0].click()
document.getElementsByClassName('el-tree-node__content')[0].click()
})
})
},
clearSelect(row) {
console.log(row, '2222')
this.$refs.saleTable.$refs.salelistMutiTable.toggleRowSelection(row)
},
clearSelection() {
......@@ -135,8 +126,8 @@ export default {
return arr
},
searchTable(search) {
let arr = []
if (search) {
const arr = []
if (this.currentArr && this.currentArr.length != 0) {
this.currentArr.forEach(item => {
console.log(item.staffName.indexOf(search) != -1)
if (item.staffName.indexOf(search) != -1) {
......@@ -144,19 +135,26 @@ export default {
arr.push(item)
}
})
} else {
arr = this.$common.utils.deepClone(this.listTree[0].entmicroStaffResponses)
}
this.tableEmpData = arr
}
},
created() {
this.listDepartmentTree()
// 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() {
console.log('islord', this.islord)
let clientHeight = document.documentElement.clientHeight
this.treeHeight = clientHeight - 800
console.log(this.selectData, '.....')
this.treeHeight = clientHeight - 650
this.listDepartmentTree()
}
}
</script>
......
......@@ -4,16 +4,33 @@
<el-form-item label="请选择成员">
<div class="sale-select">
<div class="el-input-tag input-tag-wrapper" @click="foucusTagInput">
<el-tag v-for="(tag, idx) in innerTags" :key="idx" closable :disable-transitions="false" @close="remove(tag)">
{{ tag.staffName }}
</el-tag>
<el-input size="small" v-model.trim="newTag" placeholder="选择员工" @input="inputTag" style="outline: none; border: none"></el-input>
<el-tag
v-for="(tag, idx) in innerTags"
:key="idx"
closable
:disable-transitions="false"
@close="remove(tag)"
>{{ tag.staffName }}</el-tag>
<el-input
size="small"
v-model.trim="newTag"
placeholder="选择员工"
@input="inputTag"
style="outline: none; border: none"
></el-input>
</div>
<div>
<el-button size="small" class="sale-select-btn" type="primary" @click="searchEmp">查询</el-button>
</div>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="searchEmp">查询</el-button></div>
</div>
<div>
<div class="select-sale-panel">
<select-emp :key="key" :selectData.sync="selectData" @selectTable="selectTable" ref="selectEmpTabel"></select-emp>
<select-emp
:selectData="selectData"
:islord="islord"
@selectTable="selectTable"
ref="selectEmpTabel"
></select-emp>
<div class="popper__arrow"></div>
</div>
</div>
......@@ -25,7 +42,7 @@
import selectEmp from './selectEmp.vue'
export default {
name: 'SelectMembers',
props: ['selectData', 'key'],
props: ['selectData', 'islord'],
components: {
selectEmp
},
......@@ -40,12 +57,6 @@ export default {
dialog_temp: {}
}
},
watch: {
selectData(val) {
console.log(val, '====')
this.selectData = val
}
},
methods: {
init() {
this.newTag = ''
......@@ -72,13 +83,29 @@ export default {
},
//查询
searchEmp() {
console.log(this.newTag)
this.$refs.selectEmpTabel.searchTable(this.newTag)
},
resetSearch() {
this.newTag = ''
this.$refs.selectEmpTabel.searchTable()
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() {
console.log(111)
// this.listEntFollowerType()
}
}
</script>
......@@ -149,8 +176,6 @@ export default {
width: 100%;
display: flex;
align-items: center;
max-height: 64px;
overflow: auto;
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
......@@ -164,7 +189,7 @@ export default {
}
}
.el-tag {
margin: 3px 4px 3px 0;
margin-right: 4px;
height: 26px;
line-height: 24px;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!