Commit 779d33c6 authored by zhoutong's avatar zhoutong

子 agent优化,增加详情跳转 / agent优化,增加详情跳转 -

parent 1c75f2ea
......@@ -2,7 +2,8 @@
<div>
<el-form ref="agentForm" :model="agentObj" :rules="rules" label-width="120px">
<el-form-item :label="$t('代理商Agent')" prop="agentId">
<supplierSelect v-model="agentObj.agentId" :companyType="'1'" :areaType="1" :placeholder="$t('请选择代理商')" :allSupplier="this.$attrs.allSupplier" />
<supplierOutSelect v-model="agentObj.agentId" :companyType="'1'" :areaType="1" :placeholder="$t('请选择代理商')" :allSupplier="this.$attrs.allSupplier" @change="changesupplier" />
<el-button v-hasPermi="['ecw:supplier:query']" type="text" style="font-size: 13px; margin-left: 240px;" @click="SupplierDetail">{{$t('查看代理商详情')}}</el-button>
</el-form-item>
</el-form>
<el-row class="operate-button">
......@@ -14,7 +15,7 @@
<script>
import { agentSet } from "@/api/ecw/boxSea";
import supplierSelect from "./common/supplierSelect.vue";
import supplierOutSelect from "./common/supplierOutSelect.vue";
import { formatStringNumber, serviceMsg } from "../utils";
/**
* agent
......@@ -22,7 +23,7 @@ import { formatStringNumber, serviceMsg } from "../utils";
export default {
name: "agent",
inheritAttrs: false,
components: { supplierSelect },
components: { supplierOutSelect },
data() {
return {
// agent对象
......@@ -31,6 +32,7 @@ export default {
rules: {
agentId: [{ required: true, message: this.$t("必填"), trigger: "change" }],
},
supplierId: 0
};
},
created() {
......@@ -60,6 +62,12 @@ export default {
cancel(type) {
this.$emit("closeDialog", type);
},
SupplierDetail(){
this.$router.push('/supplier/detail?id='+this.supplierId)
},
changesupplier(val){
this.supplierId = val
}
},
};
</script>
......
<template>
<div>
<el-select
filterable
:value="value === 0 ? undefined : value"
@change="change"
v-bind="$attrs"
clearable
>
<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"
></el-option>
</el-select>
</div>
</template>
<script>
/**
* 供应商
*/
export default {
name: "supplierSelect",
props: {
companyType: String,
value: Number,
allSupplier: Array,
areaType: {
type: Number,
default: 0
},
},
model: {
prop: "value",
event: "change",
},
data() {
return {};
},
computed: {
getSuppliers() {
let allSupplier = this.allSupplier.filter(
(item) => item.areaType == this.areaType
);
allSupplier.forEach(map=>{
map.externalBackVO.receiveAddress = map.externalBackVO.receiveAddress?map.externalBackVO.receiveAddress: ''
map.externalBackVO.receiveEmail = map.externalBackVO.receiveEmail?map.externalBackVO.receiveEmail:''
map.externalBackVO.goodName = map.externalBackVO.goodName?map.externalBackVO.goodName:''
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;
return allSupplier.filter((item) =>
item.companyTypes.includes(this.companyType)
);
},
},
methods: {
change(val) {
this.$emit("change", val);
},
},
};
</script>
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