uu
This commit is contained in:
parent
c4f93bca30
commit
8a889597ea
@ -127,8 +127,8 @@ const setAddresModalParam = (data = {})=> {
|
||||
// - 转换list的key val
|
||||
const transListKeyTitle = ({ valKey = '', titleKey = '', list = [] })=> {
|
||||
list.map(t=> {
|
||||
t.title = t[titleKey]
|
||||
t.val = t[valKey]
|
||||
t.title = t[titleKey] || t.title
|
||||
t.val = t[valKey] || t.val
|
||||
})
|
||||
return list
|
||||
}
|
||||
|
||||
@ -36,6 +36,11 @@
|
||||
return []
|
||||
}
|
||||
},
|
||||
checkedList: {
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
value: {
|
||||
default () {
|
||||
return []
|
||||
@ -93,13 +98,18 @@
|
||||
this.$emit('onItemClick', { curItem, index, checked: checkedVal.indexOf(curItem.val)>-1 })
|
||||
},
|
||||
changeTabCheck(checkedVal) {
|
||||
let oldVal = checkedVal
|
||||
let val = oldVal
|
||||
let value = checkedVal
|
||||
let allList = this.list.concat(this.checkedList)
|
||||
let checkedList = []
|
||||
checkedVal.map(val=> {
|
||||
let item = allList.filter(t=> t.val == val)[0]
|
||||
checkedList.push(item)
|
||||
})
|
||||
if (this.type == typeEnum.single) {
|
||||
val = checkedVal[0]
|
||||
value = checkedVal[0]
|
||||
}
|
||||
this.$emit('onChange', val)
|
||||
this.$emit('update:value', val)
|
||||
this.$emit('onChange', value, checkedList)
|
||||
this.$emit('update:value', value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<view class="">
|
||||
<view class="">
|
||||
<tpx-checkitems :list="list" :value="value" v-slot="dlCurrent" :min-checked="minChecked" :type="type"
|
||||
@onChange="handleDataItemChange"
|
||||
:checkedList="checkedList" @onChange="handleDataItemChange"
|
||||
>
|
||||
<view slot :class="`slt-item ${dlCurrent.checked?'active':''}`">
|
||||
<u-row justify="between">
|
||||
@ -50,6 +50,11 @@
|
||||
return ''
|
||||
}
|
||||
},
|
||||
checkedList: {
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
list: {
|
||||
default () {
|
||||
return []
|
||||
@ -69,9 +74,10 @@
|
||||
unmounted() {},
|
||||
|
||||
methods: {
|
||||
handleDataItemChange(val) {
|
||||
this.$emit('onChange', val)
|
||||
handleDataItemChange(val, checkedList) {
|
||||
this.$emit('onChange', val, checkedList)
|
||||
this.$emit('update:value', val)
|
||||
this.$emit('update:checkedList', checkedList)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<view :class="contClass" :style="styles">
|
||||
<u-row custom-style="width: 100%;">
|
||||
<view style="flex: 1;">
|
||||
<u-text :text="leftText" size="28"></u-text>
|
||||
<u-text :text="leftText" size="28" :lines="1"></u-text>
|
||||
</view>
|
||||
<u-row>
|
||||
<u-icon size="22" :name="`${show?'arrow-up':'arrow-down'}`" color="#333"></u-icon>
|
||||
@ -19,7 +19,11 @@
|
||||
if (this.value) {
|
||||
const curItem = this.list.filter(item => item.val == this.value)[0] || {}
|
||||
curItem.title && (str = curItem.title)
|
||||
} else {
|
||||
}
|
||||
if(!str && Array.isArray(this.checkedList)) {
|
||||
str = this.checkedList.map(t=> t.title).join(',')
|
||||
}
|
||||
if(!str) {
|
||||
str = this.placeholder
|
||||
}
|
||||
return str
|
||||
@ -67,7 +71,12 @@
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
checkedList: {
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
@ -2,14 +2,16 @@
|
||||
<view @click.stop="handleRootClick" class="" style="position: relative;">
|
||||
<view @click="handleSelectSwitch">
|
||||
<slot v-if="$slots.default"></slot>
|
||||
<default-select-input v-else :placeholder="placeholder" :show="show" :list="filDataList" :value="value" :isWhite="isWhite" :customStyle="customStyle"></default-select-input>
|
||||
<default-select-input v-else :placeholder="placeholder" :show="show" :list="filDataList" :value="value" :isWhite="isWhite"
|
||||
:checkedList="filDatacheckedList" :customStyle="customStyle"
|
||||
></default-select-input>
|
||||
</view>
|
||||
|
||||
<view v-if="mode == modeEnum.sheet">
|
||||
<tpx-dialog :show="show" :title="placeholder" @onClose="handleSelectSwitch">
|
||||
<view style="height: calc(60vh);">
|
||||
<tpx-scroll-view :resObject="filResObject" :searchParam="searchParam" :getListFun="getListFun" size="sm" :showLoadedAll="false" @onListChange="onListChange">
|
||||
<content-items :value="value" :list="filDataList" :minChecked="minChecked" :type="type"
|
||||
<content-items :value="value" :list="filDataList" :checkedList="filDatacheckedList" :minChecked="minChecked" :type="type"
|
||||
@onChange="handleDataItemChange"
|
||||
></content-items>
|
||||
</tpx-scroll-view>
|
||||
@ -51,6 +53,13 @@
|
||||
}
|
||||
return list
|
||||
},
|
||||
filDatacheckedList() {
|
||||
let list = (this.getListFun ? this.resObject.checkedList : this.checkedList) || []
|
||||
if(this.transKeyVal) {
|
||||
list = transListKeyTitle({ ...this.transKeyVal, list: list })
|
||||
}
|
||||
return list
|
||||
},
|
||||
filResObject() {
|
||||
let res = this.getListFun ? this.resObject : { list: this.list, total: this.list.length }
|
||||
return res
|
||||
@ -106,6 +115,11 @@
|
||||
return []
|
||||
}
|
||||
},
|
||||
checkedList: {
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
searchParam: {
|
||||
default () {
|
||||
return {}
|
||||
@ -164,9 +178,16 @@
|
||||
// this.$emit('update:show', !this.show)
|
||||
this.show = !this.show
|
||||
},
|
||||
handleDataItemChange(val) {
|
||||
this.$emit('onChange', val)
|
||||
handleDataItemChange(val, checkedList) {
|
||||
this.$emit('onChange', val, checkedList)
|
||||
this.$emit('update:value', val)
|
||||
this.$emit('update:checkedList', checkedList)
|
||||
if(this.resObject) {
|
||||
this.$emit('update:resObject', {
|
||||
...this.resObject,
|
||||
checkedList
|
||||
})
|
||||
}
|
||||
if(this.type == "single") {
|
||||
this.handleSelectSwitch()
|
||||
}
|
||||
|
||||
@ -8,13 +8,18 @@
|
||||
title() {
|
||||
let title = this.value
|
||||
let val = this.value
|
||||
!val && this.list && (title = '-');
|
||||
if(val && this.list) {
|
||||
if(!Array.isArray() && val.split) {
|
||||
if(!Array.isArray(val) && val.split) {
|
||||
val = val.split(",")
|
||||
}
|
||||
title = this.list.filter(t=> t.val == val || (val.indexOf && val.indexOf(t.val) > -1)).map(t=> t.title).join(",")
|
||||
}
|
||||
if(Array.isArray(this.checkedList)) {
|
||||
val = this.checkedList.map(t=> t.title).join(',')
|
||||
}
|
||||
if((!title || title?.length == 0) && (this.list || this.checkedList?.length == 0)) {
|
||||
title = '-'
|
||||
}
|
||||
return title
|
||||
}
|
||||
},
|
||||
@ -23,6 +28,8 @@
|
||||
},
|
||||
list: {
|
||||
},
|
||||
checkedList: {
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
<template v-if="!$slots.right">
|
||||
<u-text align="right" margin="0 12rpx 0 0" size="26"
|
||||
:text="title"></u-text>
|
||||
<u-icon v-if="list" size="26" name="arrow-right" color="#333"></u-icon>
|
||||
<u-icon v-if="list || checkedList" size="26" name="arrow-right" color="#333"></u-icon>
|
||||
</template>
|
||||
<slot name="right"></slot>
|
||||
</u-row>
|
||||
@ -23,13 +23,18 @@
|
||||
title() {
|
||||
let title = this.value
|
||||
let val = this.value
|
||||
!val && this.list && (title = '请选择');
|
||||
if(val && this.list) {
|
||||
if(!Array.isArray() && val.split) {
|
||||
if(!Array.isArray(val) && val.split) {
|
||||
val = val.split(",")
|
||||
}
|
||||
title = this.list.filter(t=> t.val == val || (val.indexOf && val.indexOf(t.val) > -1)).map(t=> t.title).join(",")
|
||||
}
|
||||
if(Array.isArray(this.checkedList)) {
|
||||
title = this.checkedList.map(t=> t.title).join(',')
|
||||
}
|
||||
if((!title || title?.length == 0) && (this.list || this.checkedList?.length == 0)) {
|
||||
title = '请选择'
|
||||
}
|
||||
return title
|
||||
}
|
||||
},
|
||||
@ -48,6 +53,8 @@
|
||||
},
|
||||
list: {
|
||||
},
|
||||
checkedList: {
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
<tpx-select v-model:value="submitParam.transLine" v-model:resObject="wayRes" :getListFun="getTransLineList" :transKeyVal="{valKey: 'lineCode',titleKey: 'lineName'}"
|
||||
:searchParam="waySearchParam" @onChange="handleWayChange" placeholder="请选择路线"
|
||||
>
|
||||
<tpx-text-item label="线路" :value="submitParam.transLine" :list="wayRes.list"></tpx-text-item>
|
||||
<tpx-text-item label="线路" :checkedList="wayRes.checkedList"></tpx-text-item>
|
||||
</tpx-select>
|
||||
</view>
|
||||
</template>
|
||||
@ -53,7 +53,7 @@
|
||||
<tpx-select v-model:value="submitParam.productType" v-model:resObject="productRes" :getListFun="getTransProductList" :transKeyVal="{valKey: 'prodCode',titleKey: 'prodName'}" :isWhite="true"
|
||||
:searchParam="productSearchParam" placeholder="请选择产品类型"
|
||||
>
|
||||
<tpx-text-item label="产品类型" :value="submitParam.productType" :list="productRes.list"></tpx-text-item>
|
||||
<tpx-text-item label="产品类型" :checkedList="productRes.checkedList"></tpx-text-item>
|
||||
</tpx-select>
|
||||
</view>
|
||||
</template>
|
||||
@ -84,13 +84,13 @@
|
||||
|
||||
<view class="yunf-input-item">
|
||||
<tpx-select v-model:value="submitParam.operateEmployeeCode" v-model:resObject="caozuoRes" :getListFun="getOpStaffList" :transKeyVal="{valKey: 'empCode',titleKey: 'empName'}" placeholder="请选择操作员">
|
||||
<tpx-text-item label="操作员" :value="submitParam.operateEmployeeCode" :list="caozuoRes.list" ></tpx-text-item>
|
||||
<tpx-text-item label="操作员" :checkedList="caozuoRes.checkedList" ></tpx-text-item>
|
||||
</tpx-select>
|
||||
</view>
|
||||
|
||||
<view class="yunf-input-item">
|
||||
<tpx-select v-model:value="submitParam.takePieceEmployeeCode" v-model:resObject="shoupaiRes" :getListFun="getRSDStaffList" :transKeyVal="{valKey: 'empCode',titleKey: 'empName'}" placeholder="请选择收派员">
|
||||
<tpx-text-item label="收派员" :value="submitParam.takePieceEmployeeCode" :list="shoupaiRes.list"></tpx-text-item>
|
||||
<tpx-text-item label="收派员" :checkedList="shoupaiRes.checkedList"></tpx-text-item>
|
||||
</tpx-select>
|
||||
</view>
|
||||
|
||||
@ -106,7 +106,7 @@
|
||||
<tpx-select v-model:value="submitParam.custNo" v-model:resObject="yuejieRes" :getListFun="getMonthpayAccountList" :transKeyVal="{valKey: 'custNo',titleKey: 'custName'}"
|
||||
@onChange="handleYueJieSelect" placeholder="请选择月结账户"
|
||||
>
|
||||
<tpx-text-item label="月结账户" :value="submitParam.custNo" :list="yuejieRes.list"></tpx-text-item>
|
||||
<tpx-text-item label="月结账户" :checkedList="yuejieRes.checkedList"></tpx-text-item>
|
||||
</tpx-select>
|
||||
</view>
|
||||
|
||||
@ -128,7 +128,7 @@
|
||||
<tpx-select v-model:value="submitParam.destinationCode" v-model:resObject="destPostRes" :getListFun="getDestPositionList" :transKeyVal="{valKey: 'destCode',titleKey: 'destName'}" :isWhite="true"
|
||||
:searchParam="destPostParam" @onChange="handleDestPostChange" placeholder="请选择目的地"
|
||||
>
|
||||
<tpx-text-item label="目的地" :value="submitParam.destinationCode" :list="destPostRes.list"></tpx-text-item>
|
||||
<tpx-text-item label="目的地" :checkedList="destPostRes.checkedList"></tpx-text-item>
|
||||
</tpx-select>
|
||||
</view>
|
||||
|
||||
@ -140,7 +140,7 @@
|
||||
<tpx-select v-model:value="submitParam.warehouseInNo" v-model:resObject="wareRes" :getListFun="getWarehouseInList" :transKeyVal="{valKey: 'inNo',titleKey: 'inNo'}" :isWhite="true"
|
||||
searchParam="" type="multiple" placeholder="请选择进仓单" minChecked="0"
|
||||
>
|
||||
<tpx-text-item label="进仓单" :value="submitParam.warehouseInNo" :list="wareRes.list"></tpx-text-item>
|
||||
<tpx-text-item label="进仓单" :checkedList="wareRes.checkedList"></tpx-text-item>
|
||||
</tpx-select>
|
||||
</view>
|
||||
|
||||
@ -295,14 +295,14 @@
|
||||
billCode: '', // 运单id
|
||||
orderSn: '', // 订单id
|
||||
},
|
||||
kehuRes: { list: [] },
|
||||
wayRes: { list: [] },
|
||||
productRes: { list: [] },
|
||||
caozuoRes: { list: [] },
|
||||
shoupaiRes: { list: [] },
|
||||
yuejieRes: { list: [] },
|
||||
destPostRes: { list: [] },
|
||||
wareRes: { list: [] },
|
||||
kehuRes: { list: [], checkedList: [] },
|
||||
wayRes: { list: [], checkedList: [] },
|
||||
productRes: { list: [], checkedList: [] },
|
||||
caozuoRes: { list: [], checkedList: [] },
|
||||
shoupaiRes: { list: [], checkedList: [] },
|
||||
yuejieRes: { list: [], checkedList: [] },
|
||||
destPostRes: { list: [], checkedList: [] },
|
||||
wareRes: { list: [], checkedList: [] },
|
||||
goodChooseModal: {
|
||||
show: false,
|
||||
},
|
||||
@ -385,6 +385,7 @@
|
||||
// 更新路线推荐的默认目的地
|
||||
let data = res.data || {}
|
||||
this.submitParam.destinationCode = data.destCode
|
||||
this.destPostRes.checkedList = [{ title: data.destName, val: data.destCode }]
|
||||
this.submitParam.dispatchUnderlingSiteCode = data.siteCode;
|
||||
this.submitParam.dispatchUnderlingSite = data.siteName;
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user