Commit 20bc335e by chenwq

提交

1 parent 32fa2cca
...@@ -97,9 +97,9 @@ ...@@ -97,9 +97,9 @@
<el-button type="primary" @click="handleConfirm">确定</el-button> <el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button> <el-button type="default" @click="handleCancel">取消</el-button>
</div> </div>
<select-Crowd v-if="isCrowdCustVisible" :dialogVisible="isCrowdCustVisible" :selectedCrowdList="customerDataList[0].list" @handleCrowdCustClose="handleCrowdCustClose" @handleCrowdCustConfirm="handleDialogConfirm"></select-Crowd> <select-Crowd v-if="isCrowdCustVisible" :dialogVisible="isCrowdCustVisible" :selectedCrowdList="JSON.parse(JSON.stringify(customerDataList[0].list))" @handleCrowdCustClose="handleCrowdCustClose" @handleCrowdCustConfirm="handleDialogConfirm"></select-Crowd>
<select-tag ref="selectTagForm" @tagSelected="handleDialogConfirm" :dialogVisible="isTagVisible"></select-tag> <select-tag ref="selectTagForm" @tagSelected="handleDialogConfirm" :dialogVisible="isTagVisible"></select-tag>
<select-customer v-if="isAppointCustVisible" :dialogVisible="isAppointCustVisible" :selectedCustomerList="customerDataList[2].list" @handleAppointCustClose="handleAppointCustClose" @handleAppointCustConfirm="handleDialogConfirm"></select-customer> <select-customer v-if="isAppointCustVisible" :dialogVisible="isAppointCustVisible" :selectedCustomerList="JSON.parse(JSON.stringify(customerDataList[2].list))" @handleAppointCustClose="handleAppointCustClose" @handleAppointCustConfirm="handleDialogConfirm"></select-customer>
</div> </div>
</template> </template>
......
...@@ -40,6 +40,7 @@ export default { ...@@ -40,6 +40,7 @@ export default {
searchForm: {}, searchForm: {},
customerList: [], customerList: [],
heightBox: 200, heightBox: 200,
maxCustNum: 200,
// 搜索 // 搜索
searchFormData: [ searchFormData: [
{ {
...@@ -171,17 +172,10 @@ export default { ...@@ -171,17 +172,10 @@ export default {
recoverySelected() { recoverySelected() {
this.$nextTick(() => { this.$nextTick(() => {
this.selectedCustomerList.forEach(row => { if (this.selectedCustomerList.length >= this.maxCustNum) {
var idx = this.tableList.findIndex(k => k.id == row.id) let selectIds = this.selectedCustomerList.map(item => item.id)
if (idx != -1) {
this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], true)
}
})
if (this.selectedCustomerList.length >= 5) {
let tableIds = this.selectedCustomerList.map(item => item.id)
console.log(tableIds)
this.tableList.forEach((row, idx) => { this.tableList.forEach((row, idx) => {
if (!tableIds.includes(row.id)) { if (!selectIds.includes(row.id)) {
this.tableParams.checkSelectVal.push(row.id) this.tableParams.checkSelectVal.push(row.id)
this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], false) this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], false)
} }
...@@ -195,13 +189,18 @@ export default { ...@@ -195,13 +189,18 @@ export default {
handleSelectionTable(val) { handleSelectionTable(val) {
let currentList = JSON.parse(JSON.stringify(this.selectedCustomerList)) let currentList = JSON.parse(JSON.stringify(this.selectedCustomerList))
let tableIds = this.tableList.map(item => item.id) let tableIds = this.tableList.map(item => item.id)
this.selectedCustomerList = JSON.parse(JSON.stringify(val)) var selectIds = currentList.map(item => item.id)
var selectIds = this.selectedCustomerList.map(item => item.id) var selectedIds = val.map(item => item.id)
currentList.forEach(item => { val.forEach(item => {
if (!selectIds.includes(item.id) && !tableIds.includes(item.id)) { if (!selectIds.includes(item.id) && tableIds.includes(item.id) && this.selectedCustomerList.length < this.maxCustNum) {
this.selectedCustomerList.push(item) this.selectedCustomerList.push(item)
} }
}) })
currentList.forEach((item, idx) => {
if (!selectedIds.includes(item.id)) {
this.selectedCustomerList.splice(idx, 1)
}
})
this.recoverySelected() this.recoverySelected()
}, },
......
...@@ -96,7 +96,10 @@ export default { ...@@ -96,7 +96,10 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '客户名称', label: '客户名称',
prop: 'customerName' prop: 'customerName',
formatter: cellValue => {
return cellValue.customerName || '-'
}
}, },
{ {
label: '客户手机号', label: '客户手机号',
...@@ -118,7 +121,7 @@ export default { ...@@ -118,7 +121,7 @@ export default {
} }
}, },
{ {
label: '初次查看事件', label: '初次查看时间',
prop: 'firstViewDate', prop: 'firstViewDate',
formatter: cellValue => { formatter: cellValue => {
return cellValue.firstViewDate ? dayjs(cellValue.firstViewDate).format('YYYY-MM-DD HH:mm:ss') : '未查看' return cellValue.firstViewDate ? dayjs(cellValue.firstViewDate).format('YYYY-MM-DD HH:mm:ss') : '未查看'
...@@ -128,7 +131,7 @@ export default { ...@@ -128,7 +131,7 @@ export default {
label: '查看次数', label: '查看次数',
prop: 'viewCount', prop: 'viewCount',
formatter: cellValue => { formatter: cellValue => {
return cellValue.viewCount || '-' return cellValue.viewCount || '0'
} }
} }
// { // {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!