Commit 15e60742 authored by zhoutong's avatar zhoutong

【预生产环境】海运出货操作,代理商枚举值下拉框太长,需要调整下

parent 67a59f1b
<template> <template>
<div> <div>
<el-select <el-select filterable :value="value === 0 ? undefined : value" @change="change" v-bind="$attrs" clearable>
filterable <el-option v-for="supplier in getSuppliers" :key="supplier.id" :label="$t('公司名称:') + $l(supplier, 'company') + $t(',地址:') + supplier.externalBackVO.receiveAddress + $t(',邮箱:') + supplier.externalBackVO.receiveEmail + $t(',品名:') + supplier.externalBackVO.goodName + $t(',From M No:') + supplier.externalBackVO.fromNo + $t(',BA No:') + supplier.externalBackVO.baNo" :value="supplier.id" style="width: 600px">
:value="value === 0 ? undefined : value" <el-tooltip class="item" effect="dark" placement="top">
@change="change" <div slot="content">
v-bind="$attrs" <span>{{ $t('公司名称:') + $l(supplier, 'company') + $t(',地址:') + supplier.externalBackVO.receiveAddress + $t(',邮箱:') + supplier.externalBackVO.receiveEmail + $t(',品名:') + supplier.externalBackVO.goodName + $t(',From M No:') + supplier.externalBackVO.fromNo + $t(',BA No:') + supplier.externalBackVO.baNo }}</span>
clearable </div>
> <div class="iclass">{{ $t('公司名称:') + $l(supplier, 'company') + $t(',地址:') + supplier.externalBackVO.receiveAddress + $t(',邮箱:') + supplier.externalBackVO.receiveEmail + $t(',品名:') + supplier.externalBackVO.goodName + $t(',From M No:') + supplier.externalBackVO.fromNo + $t(',BA No:') + supplier.externalBackVO.baNo }}</div>
<el-option </el-tooltip>
v-for="supplier in getSuppliers" </el-option>
:key="supplier.id" </el-select>
:label="$t('公司名称:')+$l(supplier, 'company')+$t(',地址:')+supplier.externalBackVO.receiveAddress+$t(',邮箱:')+supplier.externalBackVO.receiveEmail+$t(',品名:')+supplier.externalBackVO.goodName+$t(',From M No:')+supplier.externalBackVO
.fromNo+$t(',BA No:')+supplier.externalBackVO
.baNo"
:value="supplier.id"
></el-option>
</el-select>
</div> </div>
</template> </template>
<script> <script>
...@@ -25,7 +18,7 @@ ...@@ -25,7 +18,7 @@
* 供应商 * 供应商
*/ */
export default { export default {
name: "supplierSelect", name: 'supplierSelect',
props: { props: {
companyType: String, companyType: String,
value: Number, value: Number,
...@@ -33,38 +26,40 @@ export default { ...@@ -33,38 +26,40 @@ export default {
areaType: { areaType: {
type: Number, type: Number,
default: 0 default: 0
}, }
}, },
model: { model: {
prop: "value", prop: 'value',
event: "change", event: 'change'
}, },
data() { data() {
return {}; return {}
}, },
computed: { computed: {
getSuppliers() { getSuppliers() {
let allSupplier = this.allSupplier.filter( let allSupplier = this.allSupplier.filter((item) => item.areaType == this.areaType)
(item) => item.areaType == this.areaType allSupplier.forEach((map) => {
); map.externalBackVO.receiveAddress = map.externalBackVO.receiveAddress ? map.externalBackVO.receiveAddress : ''
allSupplier.forEach(map=>{ map.externalBackVO.receiveEmail = map.externalBackVO.receiveEmail ? map.externalBackVO.receiveEmail : ''
map.externalBackVO.receiveAddress = map.externalBackVO.receiveAddress?map.externalBackVO.receiveAddress: '' map.externalBackVO.goodName = map.externalBackVO.goodName ? map.externalBackVO.goodName : ''
map.externalBackVO.receiveEmail = map.externalBackVO.receiveEmail?map.externalBackVO.receiveEmail:'' map.externalBackVO.fromNo = map.externalBackVO.fromNo ? map.externalBackVO.fromNo : ''
map.externalBackVO.goodName = map.externalBackVO.goodName?map.externalBackVO.goodName:'' map.externalBackVO.baNo = map.externalBackVO.baNo ? map.externalBackVO.baNo : ''
map.externalBackVO.fromNo = map.externalBackVO.fromNo?map.externalBackVO.fromNo:''
map.externalBackVO.baNo = map.externalBackVO.baNo?map.externalBackVO.baNo:''
}) })
if(this.areaType == 1 || !this.companyType) return allSupplier; if (this.areaType == 1 || !this.companyType) return allSupplier
return allSupplier.filter((item) => return allSupplier.filter((item) => item.companyTypes.includes(this.companyType))
item.companyTypes.includes(this.companyType) }
);
},
}, },
methods: { methods: {
change(val) { change(val) {
this.$emit("change", val); this.$emit('change', val)
}, }
}, }
}; }
</script> </script>
<style scoped>
.iclass {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
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