Commit 20bc335e by chenwq

提交

1 parent 32fa2cca
......@@ -97,9 +97,9 @@
<el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</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-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>
</template>
......
......@@ -40,6 +40,7 @@ export default {
searchForm: {},
customerList: [],
heightBox: 200,
maxCustNum: 200,
// 搜索
searchFormData: [
{
......@@ -171,17 +172,10 @@ export default {
recoverySelected() {
this.$nextTick(() => {
this.selectedCustomerList.forEach(row => {
var idx = this.tableList.findIndex(k => k.id == row.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)
if (this.selectedCustomerList.length >= this.maxCustNum) {
let selectIds = this.selectedCustomerList.map(item => item.id)
this.tableList.forEach((row, idx) => {
if (!tableIds.includes(row.id)) {
if (!selectIds.includes(row.id)) {
this.tableParams.checkSelectVal.push(row.id)
this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], false)
}
......@@ -195,13 +189,18 @@ export default {
handleSelectionTable(val) {
let currentList = JSON.parse(JSON.stringify(this.selectedCustomerList))
let tableIds = this.tableList.map(item => item.id)
this.selectedCustomerList = JSON.parse(JSON.stringify(val))
var selectIds = this.selectedCustomerList.map(item => item.id)
currentList.forEach(item => {
if (!selectIds.includes(item.id) && !tableIds.includes(item.id)) {
var selectIds = currentList.map(item => item.id)
var selectedIds = val.map(item => item.id)
val.forEach(item => {
if (!selectIds.includes(item.id) && tableIds.includes(item.id) && this.selectedCustomerList.length < this.maxCustNum) {
this.selectedCustomerList.push(item)
}
})
currentList.forEach((item, idx) => {
if (!selectedIds.includes(item.id)) {
this.selectedCustomerList.splice(idx, 1)
}
})
this.recoverySelected()
},
......
......@@ -96,7 +96,10 @@ export default {
tableColumns: [
{
label: '客户名称',
prop: 'customerName'
prop: 'customerName',
formatter: cellValue => {
return cellValue.customerName || '-'
}
},
{
label: '客户手机号',
......@@ -118,7 +121,7 @@ export default {
}
},
{
label: '初次查看事件',
label: '初次查看时间',
prop: 'firstViewDate',
formatter: cellValue => {
return cellValue.firstViewDate ? dayjs(cellValue.firstViewDate).format('YYYY-MM-DD HH:mm:ss') : '未查看'
......@@ -128,7 +131,7 @@ export default {
label: '查看次数',
prop: 'viewCount',
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!