Commit 8ef73502 by 胡悦

提交一客一群

1 parent f9a02d95
......@@ -37,18 +37,18 @@
</el-form-item>
</el-form>
<!-- 编辑入群欢迎语 -->
<div class="title">编辑入群欢迎语</div>
<div>
<!-- <div class="title">编辑入群欢迎语</div> -->
<!-- <div>
<el-form :model="basicForm" label-width="120px">
<el-form-item label="入群欢迎语">
<WelcomeWords ref="welcome" :eventBus="eventBus"></WelcomeWords>
</el-form-item>
</el-form>
</div>
</div> -->
</div>
<div class="preview">
<!-- <div class="preview">
<Preview :eventBus="eventBus"></Preview>
</div>
</div> -->
</div>
</div>
</div>
......@@ -70,14 +70,14 @@
<script>
import Vue from 'vue'
import WelcomeWords from './components/welcomeWords.vue'
// import WelcomeWords from './components/welcomeWords.vue'
import SelectMembers from './components/selectMembers.vue'
import Preview from './components/preview.vue'
// import Preview from './components/preview.vue'
export default {
components: {
WelcomeWords,
SelectMembers,
Preview
// WelcomeWords,
SelectMembers
// Preview
},
data() {
const validatorUser = (rule, value, callback) => {
......@@ -158,9 +158,6 @@ export default {
if (this.basicForm.userList && this.basicForm.userList.length != 0) {
this.basicForm.userList.map(item => {
if (item.masterStatus == 1) {
this.basicForm.group = item
this.$refs.membersForm.handlGroup(item, true)
// this.$refs.membersForm.group = item
this.selectData = this.basicForm.userList
}
})
......@@ -179,17 +176,10 @@ export default {
orgName: this.basicForm.orgName,
groupName: this.basicForm.groupName
}
if (this.$refs.welcome.previewList) params.attachmentList = this.$refs.welcome.previewList
// if (this.$refs.welcome.previewList) params.attachmentList = this.$refs.welcome.previewList
params.userList = this.basicForm.userList.map(item => {
if (this.basicForm.group.staffId == item.staffId) {
return {
staffId: item.staffId,
masterStatus: 1
}
} else {
return {
staffId: item.staffId
}
return {
staffId: item.staffId
}
})
console.log(params)
......@@ -226,13 +216,12 @@ export default {
groupName: res.groupName,
id: res.id,
merchantId: 1,
userList: res.userList,
attachmentList: res.attachmentList
userList: res.userList
// attachmentList: res.attachmentList
}
this.$refs.welcome.updateList(res.attachmentList)
// this.$refs.welcome.updateList(res.attachmentList)
this.selectData = res.userList
console.log(res.userList.find(i => i.masterStatus == 1))
if (res.userList.find(i => i.masterStatus == 1)) this.basicForm.group = this.$common.utils.deepClone(res.userList.find(i => i.masterStatus == 1))
}
})
},
......@@ -240,7 +229,7 @@ export default {
// this.$router.go(-1)
this.$router.push({ path: '/guestGroup/index' })
this.basicForm = {}
this.$refs.welcome.updateList([])
// this.$refs.welcome.updateList([])
this.selectData = []
},
remove(val, idx) {
......@@ -268,14 +257,7 @@ export default {
})
} else {
this.$refs.membersForm.resetSearch()
console.log(this.$refs.membersForm.group)
this.basicForm.userList = this.$refs.membersForm.innerTags
if (!this.$refs.membersForm.group.id) {
this.basicForm.group = this.basicForm.userList[0]
this.$refs.membersForm.handlGroup(this.basicForm.userList[0], true)
} else {
this.basicForm.group = this.$refs.membersForm.group
}
this.openMembers()
}
},
......@@ -323,7 +305,8 @@ export default {
display: inline-flex;
width: 100%;
padding-bottom: 30px;
align-items: flex-end;
// align-items: flex-end;
height: calc(100vh - 250px);
justify-content: space-between;
.info-content {
width: calc(100% - 360px);
......
......@@ -18,12 +18,7 @@
height: treeHeight + 20 + 'px'
}"
>
<GLTable :key="key" ref="saleTable" v-loading="loading" :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>
<GLTable :key="key" ref="saleTable" v-loading="loading" :tableData="tableEmpData" :tableParams="tableParams" :hasNum="false" :hasPage="false" @selectionTable="selectionTable"></GLTable>
</el-col>
</div>
</template>
......@@ -59,11 +54,6 @@ export default {
{
label: '职务',
prop: 'staffTitle'
},
{
label: '',
prop: 'optionBtns',
addHtml: 'optionBtns'
}
]
},
......@@ -78,7 +68,6 @@ export default {
watch: {
selectData: {
handler(val) {
console.log(this.group)
console.log(val)
if (val.length == 0) {
this.clearSelection()
......@@ -90,7 +79,6 @@ export default {
this.clearSelect(row)
})
})
this.group = val.find(i => i.masterStatus == 1)
}
},
immediate: true
......@@ -98,20 +86,8 @@ export default {
},
methods: {
selectionTable(val) {
console.log(val, this.group, this.isFirst)
this.$emit('selectTable', val)
this.allGroup = val
const hasGroup = val.find(item => item.staffId == this.group.staffId)
if (!hasGroup) {
this.cancelGroup()
}
// if (val && !this.isFirst) {
// val.forEach(i => {
// const row = this.getEmployee(this.listTree).find(j => j.staffId == i.staffId)
// console.log(row)
// this.clearSelect(row)
// })
// }
},
listDepartmentTree() {
this.$apis.groupGuest.listDepartmentTree({ merchantId: 10001001, addChildrensFlag: true }).then(res => {
......@@ -130,10 +106,6 @@ export default {
})
document.getElementsByClassName('el-tree-node__expand-icon')[0].click()
document.getElementsByClassName('el-tree-node__content')[0].click()
if (this.selectData.find(i => i.masterStatus == 1)) {
this.group = this.selectData.find(i => i.masterStatus == 1)
this.$emit('group', this.group)
}
})
})
},
......@@ -149,20 +121,6 @@ export default {
this.currentArr = this.$common.utils.deepClone(data.entmicroStaffResponses)
// this.listEntmicroStaff()
},
selectGroup(data, flag = false) {
console.log(data)
this.group = data
// 标识是否从父组件修改
if (!flag) {
const obj = this.allGroup.find(item => item.staffId == data.staffId)
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) {
......
......@@ -13,14 +13,11 @@
</div>
<div>
<div class="select-sale-panel">
<select-emp :key="key" :selectData.sync="selectData" @group="handlGroup" @selectTable="selectTable" ref="selectEmpTabel"></select-emp>
<select-emp :key="key" :selectData.sync="selectData" @selectTable="selectTable" ref="selectEmpTabel"></select-emp>
<div class="popper__arrow"></div>
</div>
</div>
</el-form-item>
<el-form-item label="群主">
<el-tag v-show="group.staffName" closable @close="cancelGroup">{{ group.staffName }}</el-tag>
</el-form-item>
</el-form>
</div>
</template>
......@@ -40,8 +37,7 @@ export default {
// empTypeValue: '',
newTag: '',
innerTags: [],
dialog_temp: {},
group: {}
dialog_temp: {}
}
},
watch: {
......@@ -82,17 +78,6 @@ export default {
resetSearch() {
this.newTag = ''
this.$refs.selectEmpTabel.searchTable()
},
handlGroup(val, flag = false) {
console.log(val, '=-=-=-=-=')
this.group = val
// 标识从父组件修改
if (flag) {
this.$refs.selectEmpTabel.selectGroup(val, true)
}
},
cancelGroup() {
this.$refs.selectEmpTabel.cancelGroup()
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!