Commit 24252609 authored by xiejb's avatar xiejb

高级搜索 折叠效果

parent 39d07795
......@@ -182,7 +182,7 @@ export default {
const removeItem = {
'beforeP': item.db_source,
'middleP': process.env.appRealDb,
'afterP': this.supplier.org,
'afterP': this.getSupplierArray(),
'saler': item.erp_user
}
companyList.push(removeItem)
......@@ -243,6 +243,14 @@ export default {
_this.finished = true
})
},
// 获取供应商数组ID
getSupplierArray () {
const supplierList = []
this.supplier.forEach(item => {
supplierList.push(item.org)
})
return supplierList
},
/// 判断数值是否为空
isJudgeStrNull(val) {
if (val !== null && val !== undefined && val !== '') {
......
......@@ -28,16 +28,16 @@
:error.sync="error"
:offset="10"
@load="onLoad">
<van-radio-group v-model="checked">
<van-checkbox-group v-model="checkedList">
<van-cell-group>
<van-cell :title="titleInitial(item)" clickable @click="itemClick(item,index)" v-for="(item,index) in postDataList"
:key="index">
<template #right-icon>
<van-radio :name="item.comPartyId" />
<van-checkbox :name="item.comPartyId" />
</template>
</van-cell>
</van-cell-group>
</van-radio-group>
</van-checkbox-group>
</van-list>
</van-pull-refresh>
</div>
......@@ -71,7 +71,8 @@ export default {
pageSize: 10,
postDataList: [],
checked: '',
choosedPost: {}
checkedList: [],
choosedPost: []
}
},
computed: {
......@@ -90,8 +91,8 @@ export default {
default: () => []
},
customer: {
type: Object,
default: () => {}
type: Array,
default: () => []
},
// 货主
consignor: {
......@@ -113,8 +114,12 @@ export default {
this.postShow = val
if (val) {
this.postDataList = []
this.checkedList = []
this.choosedPost = JSON.parse(JSON.stringify(this.customer))
this.checked = !this.customer.comPartyId ? '' : this.customer.comPartyId
// this.checked = !this.customer.comPartyId ? '' : this.customer.comPartyId
this.customer.forEach((res)=>{
this.checkedList.push(res.comPartyId)
})
// console.log(this.checked)
this.currentPage = 1
this.onLoad()
......@@ -153,7 +158,7 @@ export default {
this.$emit('cancleclick')
},
onConfirmClick() {
if (!this.choosedPost.comPartyId) {
if (!this.choosedPost.length === 0) {
Dialog.alert({
title: '温馨提示',
message: '请选择选项!'
......@@ -168,8 +173,15 @@ export default {
})
},
itemClick(item, index) {
this.checked = item.comPartyId
this.choosedPost = item
// this.checked = item.comPartyId
// this.choosedPost = item
if(this.checkedList.indexOf(item.comPartyId) > -1) {
this.choosedPost.splice(this.checkedList.indexOf(item.comPartyId),1)
this.checkedList.splice(this.checkedList.indexOf(item.comPartyId),1)
} else {
this.checkedList.push(item.comPartyId)
this.choosedPost.push(item)
}
},
onRefresh() {
// 刷新接口
......
......@@ -42,9 +42,20 @@
</van-collapse-item>
</van-collapse>
</div>
<div class="high-info" @click="showPost('client')">
<div class="high-info">
<!-- <div class="title font-bold font-16"><span style="color: red;">* </span>客户</div> -->
<!-- <div :class="isSelectConsignorSupplier === true ? 'nom inputInfo': 'select inputInfo'" contenteditable="false" placeholder="请选择客户">{{client}}</div> -->
<van-collapse v-model="clientNames">
<van-collapse-item name="1">
<template #title>
<div class="title font-bold font-16"><span style="color: red;">* </span>客户</div>
<div :class="isSelectConsignorSupplier === true ? 'nom inputInfo': 'select inputInfo'" contenteditable="false" placeholder="请选择客户">{{client}}</div>
</template>
<div @click="showPost('client')" v-if="moreSearchInfo.client.length === 0" :class="isSelectConsignorSupplier === true ? 'nom inputInfo': 'select inputInfo'" contenteditable="false" placeholder="请选择客户"
>{{client}}</div>
<div v-for="(item,index) in moreSearchInfo.client" :key="index" @click="showPost('client')" :class="isSelectConsignorSupplier === true ? 'nom inputInfo': 'select inputInfo'" contenteditable="false" placeholder="请选择客户"
>{{clientInfoStitching(item)}}</div>
</van-collapse-item>
</van-collapse>
</div>
<div class="high-info" @click="showPost('orderNo')">
<div class="title font-bold font-16">请输入订单号</div>
......@@ -55,7 +66,6 @@
<div class="title font-bold font-16">商品</div>
<div :class="isSelectClient === true ? 'nom inputInfo': 'select inputInfo'" contenteditable="false" placeholder="请选择商品">{{goods}}</div>
</div>
</div>
<div class="action-bottom">
<van-button type="default" @click="onCleanClick">重置</van-button>
......@@ -159,7 +169,8 @@ export default {
// }
],
consignorNames: ['1'],
supplierNames: ['1']
supplierNames: ['1'],
clientNames: ['1']
}
},
computed: {
......@@ -222,7 +233,7 @@ export default {
},
// 货主与供应商是否选择
isSelectClient () {
if (!this.moreSearchInfo.client.comPartyId) {
if (this.moreSearchInfo.client.length === 0) {
return false
}
return true
......@@ -244,7 +255,7 @@ export default {
supplier: [], // 供应商
consignor: [], // 货主
goods: '', // 商品
client: '', // 客户
client: [], // 客户
orderNo: '', // 订单号
time: {
start: getFormateDate(new Date(), 'yyyy-MM-dd'),
......@@ -298,7 +309,7 @@ export default {
supplier: [], // 供应商
consignor: [], // 货主
goods: '', // 商品
client: '', // 客户
client: [], // 客户
orderNo: '',
time: {
start: getFormateDate(new Date(), 'yyyy-MM-dd'),
......@@ -310,7 +321,6 @@ export default {
// this.moreSearchShow = false
this.$emit('onclean', this.moreSearchInfo)
},
showPost(type) {
if (type !== 'consignor') {
if (this.moreSearchInfo.consignor.length === 0) {
......@@ -322,7 +332,7 @@ export default {
this.$toast('请先选择供应商!')
return
}
if (type !== 'client' && !this.moreSearchInfo.client.comPartyId) {
if (type !== 'client' && this.moreSearchInfo.client.length === 0) {
this.$toast('请先选择客户!')
return
}
......@@ -351,7 +361,7 @@ export default {
this.moreSearchInfo.supplier = data.value
this.chinfo.supplier = this.moreSearchInfo.supplier.comPartyId
this.moreSearchInfo.goods = ''
this.moreSearchInfo.client = ''
this.moreSearchInfo.client = []
break;
case data.page === 'goods':
this.moreSearchInfo.goods = data.value
......@@ -359,7 +369,7 @@ export default {
case data.page === 'consignor':
this.moreSearchInfo.supplier = []
this.moreSearchInfo.goods = ''
this.moreSearchInfo.client = ''
this.moreSearchInfo.client = []
this.moreSearchInfo.consignor = data.value
break;
case data.page === 'client':
......@@ -404,6 +414,10 @@ export default {
}
return str
},
// 客户信息拼接
clientInfoStitching(model) {
return model.comPartyId + '/(' + model.partyOpcode + ')/' + model.partyName
},
// 供应商信息拼接
supplierInfoStitching(model) {
return model.partyName
......
......@@ -58,7 +58,7 @@ export default {
supplier: [], // 供应商
consignor: [], // 货主
goods: '', // 商品
client: '', // 客户
client: [], // 客户
orderNo: '',
time: {
start: getFormateDate(new Date(), 'yyyy-MM-dd'),
......
......@@ -245,7 +245,7 @@ export default {
_this.moreSearchInfo.consignor.forEach(item => {
const model = {
'businessType': '',
'clientID': this.getArray(_this.moreSearchInfo.client.comPartyId), // 客户编码
'clientID': this.getClientValueArray(_this.moreSearchInfo.client), // 客户编码
'endDate': _this.moreSearchInfo.time.end, // 结束时间
'startDate': _this.moreSearchInfo.time.start, // 开始时间
'goodsCode': !_this.moreSearchInfo.goods.goodsOpcode ? '':_this.moreSearchInfo.goods.goodsOpcode, // 商品代码
......@@ -271,7 +271,7 @@ export default {
'sourceDb': !item.ownerid ? '':item.ownerid, // 数据来源
'sourceOrderNo': '', // 来源订单号(网上订单号)
'sourceSystem': '', // 订单来源 来源订单号和订单来源必须同时不为空
'supplierId': this.getValueArray(_this.moreSearchInfo.supplier) // 供应商(部门)编码
'supplierId': this.getSupplierValueArray(_this.moreSearchInfo.supplier) // 供应商(部门)编码
}
dataList.push(model)
})
......@@ -285,8 +285,16 @@ export default {
}
return []
},
// 返回数据数组
getValueArray (array) {
// 返回客户数据数组
getClientValueArray (array) {
const vaueArray = []
array.forEach(item => {
vaueArray.push(item.comPartyId)
})
return vaueArray
},
// 返回供应商数据数组
getSupplierValueArray (array) {
const vaueArray = []
array.forEach(item => {
vaueArray.push(item.org)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment