Commit 8f5c3630 by 胡悦

修复回显问题

1 parent 38f193b0
......@@ -14,7 +14,7 @@
"echarts": "^5.2.0",
"element-ui": "^2.4.5",
"glsx-common": "^1.4.6",
"glsx-components": "^1.1.2",
"glsx-components": "^1.1.8",
"glsx-table": "^1.1.0",
"sha1": "^1.1.1",
"vue": "^2.6.10",
......
......@@ -63,8 +63,8 @@
<el-button type="primary" @click="handleSubmit">确定</el-button>
<el-button type="primary" @click="handleCancel">取消</el-button>
</div>
<basic-dialog :title="'选择成员'" :width="'712px'" :isVisible="membersVisible" @confirmDialog="handleConfirm" @closeDialog="membersVisible = !membersVisible">
<SelectMembers :selectData="selectData" ref="membersForm"></SelectMembers>
<basic-dialog :title="'选择成员'" :width="'712px'" :isVisible="membersVisible" @confirmDialog="handleConfirm" @closeDialog="handleClose">
<SelectMembers :selectData.sync="selectData" ref="membersForm"></SelectMembers>
</basic-dialog>
</div>
</template>
......@@ -143,16 +143,30 @@ export default {
selectData: []
}
},
watch: {
$route(val) {
console.log(val.params)
if (val.params) {
const id = val.params.id
if (id && id != -1) {
this.getDetail(id)
} else {
if (this.$refs.groupForm) this.$refs.groupForm.clearValidate()
this.selectData = []
console.log('this.basicForm', this.basicForm, 'this.selectData', this.selectData)
}
}
}
},
mounted() {
console.log(this.$route.params)
if (this.$route.params) {
const id = this.$route.params.id
if (id != -1) this.getDetail(id)
}
// // let clientHeight = document.documentElement.clientHeight
// this.footerLeft = document.querySelector('.base-container-right').offsetLeft
// this.footerWidth = document.documentElement.clientWidth - this.footerLeft
// // this.boxHeight = clientHeight - 200
let clientHeight = document.documentElement.clientHeight
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.boxHeight = clientHeight - 200
},
methods: {
openMembers() {
......@@ -182,8 +196,7 @@ export default {
const params = {
attachmentList: this.basicForm.attachmentList,
orgName: this.basicForm.orgName,
groupName: this.basicForm.groupName,
merchantId: 1
groupName: this.basicForm.groupName
}
params.userList = this.basicForm.userList.map(item => {
if (this.basicForm.group.staffId == item.staffId) {
......@@ -227,23 +240,27 @@ export default {
},
getDetail(id) {
this.$apis.groupGuest.detail({ id }).then(res => {
this.basicForm = {
orgName: res.orgName,
groupName: res.groupName,
id: res.id,
merchantId: 1,
userList: res.userList,
attachmentList: res.attachmentList
if (res) {
this.basicForm = {
orgName: res.orgName,
groupName: res.groupName,
id: res.id,
merchantId: 1,
userList: res.userList,
attachmentList: res.attachmentList
}
this.$refs.welcome.updateList(res.attachmentList)
this.selectData = res.userList
if (this.selectData.find(i => i.masterStatus == 1)) this.basicForm.group = this.selectData.find(i => i.masterStatus == 1)
}
this.$refs.welcome.updateList(res.attachmentList)
this.selectData = res.userList
if (this.selectData.find(i => i.masterStatus == 1)) this.basicForm.group = this.selectData.find(i => i.masterStatus == 1)
// this.group = {}
})
},
handleCancel() {
this.$router.go(-1)
// this.$router.push({ path: '/guestGroup/index' })
this.basicForm = {}
this.$refs.welcome.updateList([])
this.selectData = []
},
remove(val) {
this.$refs.membersForm.remove(val)
......@@ -259,6 +276,10 @@ export default {
// if (this.$refs.membersForm.group.id) {
this.openMembers()
// }
},
handleClose() {
this.openMembers()
this.selectData = []
}
}
}
......
......@@ -73,12 +73,27 @@ export default {
employeeList: []
}
},
watch: {
selectData(val) {
console.log(val)
if (val.length == 0) {
this.clearSelection()
} else {
val.forEach(i => {
const row = this.getEmployee(this.listTree).find(j => j.staffId == i.staffId)
console.log(row)
this.clearSelect(row)
// if (i.masterStatus == 1) this.group = i
})
}
}
},
methods: {
selectionTable(val) {
console.log(val)
console.log(val, this.group)
this.$emit('selectTable', val)
this.allGroup = val
const hasGroup = val.find(item => item.id == this.group.id)
const hasGroup = val.find(item => item.staffId == this.group.staffId)
if (!hasGroup) {
this.cancelGroup()
}
......@@ -87,7 +102,7 @@ export default {
this.$apis.groupGuest.listDepartmentTree({ merchantId: 10001001, addChildrensFlag: true }).then(res => {
this.listTree = res
this.listTree[0].entmicroStaffResponses = this.getEmployee(this.listTree)
console.log(this.listTree)
console.log(this.listTree, this.selectData)
this.selectData.forEach(i => {
const row = this.getEmployee(this.listTree).find(j => j.staffId == i.staffId)
console.log(row)
......@@ -118,7 +133,7 @@ export default {
selectGroup(data) {
console.log(data)
this.group = data
const obj = this.allGroup.find(item => item.id == data.id)
const obj = this.allGroup.find(item => item.staffId == data.staffId)
if (!obj) this.$refs.saleTable.$refs.salelistMutiTable.toggleRowSelection(data)
this.$emit('group', this.group)
},
......
......@@ -13,7 +13,7 @@
</div>
<div>
<div class="select-sale-panel">
<select-emp :selectData="selectData" @group="handlGroup" @selectTable="selectTable" ref="selectEmpTabel"></select-emp>
<select-emp :selectData.sync="selectData" @group="handlGroup" @selectTable="selectTable" ref="selectEmpTabel"></select-emp>
<div class="popper__arrow"></div>
</div>
</div>
......@@ -44,6 +44,12 @@ export default {
group: {}
}
},
watch: {
selectData(val) {
console.log(val, '====')
this.selectData = val
}
},
methods: {
init() {
this.newTag = ''
......@@ -55,7 +61,6 @@ export default {
}
},
selectTable(val) {
console.log(val)
this.innerTags = val
},
foucusTagInput() {
......
......@@ -4,7 +4,7 @@
<div class="content">
<div class="content-bg">
<el-input type="textarea" :rows="9" maxlength="600" show-word-limit v-model="text" @input="textInput" placeholder="请输入内容"></el-input>
<div v-for="itm in previewList" :key="itm.id">
<div v-for="(itm, index) in previewList" :key="itm.id">
<div class="welcome-file" v-if="itm.attType != 1">
<template v-if="itm.attType == 2">
<img src="@/assets/guestCustom/icon-img.png" alt="" />
......@@ -289,6 +289,8 @@ export default {
}
},
close(index) {
console.log(index)
// this.previewList
this.previewList.splice(index, 1)
this.eventBus.$emit('update', this.previewList)
},
......@@ -324,6 +326,8 @@ export default {
const obj = val.find(item => item.attType == 1)
if (obj) {
this.text = obj.attContent
} else {
this.text = ''
}
}
}
......
......@@ -14,7 +14,7 @@
</span>
</search-form>
<!-- 表格区域 开始 -->
<GLTable ref="gueastGroup" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
<GLTable ref="gueastGroup" @setTableFinishFun="setTableFinishFun" :noDataImg="url" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
<div slot="entmicro-name" class="entmicro" slot-scope="scope">
<span v-for="(i, index) in scope.scope.userList" :key="index">{{ i.staffName }}({{ i.departmentName }});</span>
</div>
......@@ -32,9 +32,11 @@
</template>
<script>
import url from '@/assets/clientDataOverview/nodata.png'
export default {
data() {
return {
url: url,
searchForm: {},
searchFormData: [
{
......@@ -176,9 +178,13 @@ export default {
]
}
},
mounted() {
this.searchTable()
watch: {
$route(val) {
console.log(val)
if (val.path == '/guestGroup/index') this.searchTable()
}
},
mounted() {},
methods: {
//搜索表格
searchTable() {
......@@ -235,6 +241,11 @@ export default {
default:
console.log('gaocuole')
}
},
setTableFinishFun() {
if (!this.$refs.gueastGroup.data.length) {
this.$refs.gueastGroup.setTableHeightFun()
}
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!