Commit 6e35e931 authored by 邓春圆's avatar 邓春圆

渠道列表详情

parent b87ec2ed
<script>
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
import PackagingType from "@/views/ecw/channel/componrnts/packaging-type.vue";
import {getChannelList} from "@/api/ecw/channel";
import AirFreightRouteTemplate from "@/views/ecw/offer/components/airFreightRouteTemplate.vue";
export default {
name: "channel-route",
components: {AirFreightRouteTemplate, PackagingType},
mounted() {
getChannelList().then((res) => (this.channelList = res.data));
},
data() {
return {
form: {
"lineId": 0,
"packagingCreateReqVOList": [
{
"airWeightLimit": 0,
"channelIds": "",
"clearancePriceUnit": 0,
"clearanceVolumeUnit": 0,
"lineId": 0,
"packagingTypes": "",
"priceStepClearanceCreateReqVOList": [
{
"channelId": '',
"clearancePrice": '',
"clearancePriceUnit": '',
"clearanceVolumeUnit": '',
"endNum": '',
"packagingId": '',
"startNum": '',
"weightUnit": ''
}
]
}
]
},
form1: {
bubbleWeightRatio: 100,
channelCostCreateReqVO: {},
channelPackagingList: [],
},
channelList: [],
dialogVisible: false,
}
},
computed: {
DICT_TYPE() {
return DICT_TYPE
},
deletePackagingTypes() {
let a = []
this.form.channelPackagingList.forEach(item => {
a.push(...item.packagingTypes)
})
return a
}
},
methods: {
deleteFn(index) {
this.form.channelPackagingList.splice(index, 1)
},
getDictDatas,
//添加包装类型
addPackaging(index) {
let p = {
airWeightLimit: '',
packagingTypes: [],
priceStepClearanceCreateReqVOList: [],
}
// this.form.channelPackagingList.push(p)
let arr = this.form.packagingCreateReqVOList[index].priceStepClearanceCreateReqVOList
arr.push(p)
this.$set(this.form.packagingCreateReqVOList[index], 'priceStepClearanceCreateReqVOList', arr);
},
}
}
</script>
<template>
<div style="padding: 20px">
<air-freight-route-template></air-freight-route-template>
<el-card v-for="(itemOuter,index) in form.packagingCreateReqVOList" :key="index">
<template #header>
<el-row :gutter="20" type="flex" align="middle">
<el-col :span="1">渠道{{ index + 1 }}
</el-col>
<el-col :span="3">
<el-select multiple>
<el-option v-for="item in channelList" :value="item.channelId" :key="item.channelId"
:label="$l(item, 'name')"></el-option>
</el-select>
</el-col>
<el-col :span="2">
<el-button type="primary">新增渠道</el-button>
</el-col>
<el-col :span="2">
<el-button type="danger">删除当前渠道</el-button>
</el-col>
<el-col :span="2">
<el-button type="text">选择渠道包装模板</el-button>
</el-col>
</el-row>
</template>
<div style="display: flex;justify-content: space-between;">
<h1>
<span style="color: red;font-size: 14px;font-weight: 700;">*</span>
渠道包装列表
</h1>
<div>
<el-button type="primary" @click="addPackaging(index)">添加包装类型</el-button>
</div>
</div>
<el-row :gutter="20" v-for="(itemm, indexx) in itemOuter.priceStepClearanceCreateReqVOList"
style="margin-bottom: 50px; border-bottom: 1px solid #cccccc" :key="indexx">
<el-col :span="2">包装类型{{ indexx + 1 }}:</el-col>
<el-col :span="5">
<el-select multiple v-model="itemm.packagingTypes">
<el-option v-for="item in getDictDatas(DICT_TYPE.ECW_PACKAGING_TYPE)" :value="item.value" :key="item.value"
:label="$l(item, 'label')"></el-option>
</el-select>
</el-col>
<el-col :span="16">
<packaging-type key-arr="priceStepClearanceCreateReqVOList"
v-if="itemOuter.priceStepClearanceCreateReqVOList[index].length" v-model="itemOuter[index]">
<el-button type="danger">删除包装类型{{ index + 1 }}
</el-button>
</packaging-type>
</el-col>
</el-row>
</el-card>
</div>
</template>
<style scoped lang="scss">
</style>
<script>
import {getAirLineChannelTemplateList} from "@/api/ecw/customerContacts";
import {getWarehouseList} from "@/api/ecw/warehouse";
import Template from "@/views/cms/template/index.vue";
export default {
name: "airFreightRouteTemplate",
components: {Template},
data() {
return {
open: true,
warehouseList:[],
list:[],
form:{
}
}
},
mounted() {
getWarehouseList().then((r) => {
this.warehouseList = r.data;
});
this.getList();
},
methods: {
getList() {
getAirLineChannelTemplateList(this.form).then(r => {
console.log(r,'rrr')
this.list = r.data;
})
},
},
computed: {
exportWarehouseList() {
return this.warehouseList.filter(
(item) => item.tradeType == "2" || item.type == "3"
);
},
importWarehouseList() {
return this.warehouseList.filter(
(item) => item.tradeType == "1" || item.type == "3"
);
},
},
}
</script>
<template>
<div>
<div style="display: inline-block">
<slot></slot>
</div>
<el-dialog :visible.sync="open">
<el-card>
<template #header>
<el-form inline >
<el-form-item label="始发地" >
<el-select v-model="form.startWarehouseId" :placeholder="$t('请选择始发地')">
<el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="item.id"
:key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的地')" prop="destWarehouseId">
<el-select v-model="form.destWarehouseId" :placeholder="$t('请选择目的地')">
<el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
</el-form>
</template>
<el-table border :data="list">
<el-table-column label="始发仓">
<template slot-scope="{row}">
{{ $l(row,'startWarehouseName')}}
</template>
</el-table-column>
<el-table-column label="目的仓" >
<template slot-scope="{row}">
{{ $l(row,'destWarehouseName')}}
</template>
</el-table-column>
<el-table-column label="渠道数" prop="channelCount" ></el-table-column>
<el-table-column>
<template>
<el-button type="text">复制</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</el-dialog>
</div>
</template>
<style scoped lang="scss">
</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