Commit 7fcb34c6 authored by 邓春圆's avatar 邓春圆

全部渠道列表

parent 6e35e931
......@@ -89,3 +89,28 @@ export function warehouseLinePage(params){
params,
})
}
//获得空运线路模板
export function getAirLineChannelTemplateList(params){
return request({
url:'/ecw/warehouse-line/get-air-line-channel-template-list',
method:'get',
params
})
}
// 根据线路id渠道列表和清关费(复制使用)
export function getAirLineChannelPackagingList(id){
return request({
url:'/ecw/warehouse-line/get-air-line-channel-packaging-list',
method:'get',
params:{lineId:id}
})
}
// 创建仓库线路的渠道包装
export function createWarehouseLineChannelPackaging(data){
return request({
url:'/ecw/warehouse-line/create-warehouse-line-channel-packaging',
method:'put',
data
})
}
......@@ -75,7 +75,7 @@ export default {
type:String,
default:'channelPriceStepClearanceList'
},
readonly: Boolean
readonly: Boolean,
},
name: "packaging-type",
components: {Template, WeightSelect, CurrencySelect},
......@@ -152,10 +152,11 @@ export default {
deleteFn(index){
this.value1[this.keyArr].splice(index, 1)
this.$forceUpdate();
}
},
watch:{
'value1.priceStepClearanceList':{
'value1.priceStepClearanceCreateReqVOList':{
handler(val){
if(val && val.length === 0){
this.addInterval();
......
......@@ -33,30 +33,33 @@
</el-form>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column :label="$t('序号')" align="center" type="index" />
<el-table-column :label="$t('序号')" align="center" type="index"/>
<el-table-column :label="$t('始发仓')" align="center">
<template slot-scope="{row}">
{{$l(exportWarehouseList.find(i=>i.id === row.startWarehouseId),'title')}}
{{ $l(exportWarehouseList.find(i => i.id === row.startWarehouseId), 'title') }}
</template>
</el-table-column>
<el-table-column :label="$t('目的仓')" align="center">
<template slot-scope="{row}">
{{$l(importWarehouseList.find(i=>i.id === row.destWarehouseId),'title')}}
{{ $l(importWarehouseList.find(i => i.id === row.destWarehouseId), 'title') }}
</template>
</el-table-column>
<el-table-column :label="$t('运输方式')" align="center" >
<el-table-column :label="$t('运输方式')" align="center">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="row.transportType"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('出货渠道')" align="center" >
<el-table-column :label="$t('出货渠道')" align="center">
<template slot-scope="{row}">
<!-- {{channelList.find(i=>i.channelId === row.)}}-->
{{ row.channelIds ? $l(row, 'channelNames') : '/'}}
</template>
</el-table-column>
<el-table-column :label="$t('操作')" align="center">
<template slot-scope="{row}">
<el-button v-if="row.transportType === 3" type="text">空运渠道包装清关费</el-button>
<el-button v-if="row.transportType === 3" type="text" @click="$router.push({
path:'/offer/channel-route?id='+ row.id,
})">空运渠道包装清关费
</el-button>
</template>
</el-table-column>
</el-table>
......@@ -154,9 +157,8 @@ export default {
this.loading = true;
const params = {...this.queryParams}
// 执行查询
warehouseLinePage(params).then(r =>{
warehouseLinePage(params).then(r => {
this.loading = false;
console.log(r,'rrr')
this.list = r.data.list;
this.total = r.data.total
})
......
......@@ -3,39 +3,32 @@ 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";
import {createWarehouseLineChannelPackaging, getAirLineChannelPackagingList} from "@/api/ecw/customerContacts";
export default {
name: "channel-route",
components: {AirFreightRouteTemplate, PackagingType},
mounted() {
getChannelList().then((res) => (this.channelList = res.data));
getChannelList({lineId:this.lineId}).then((res) => (this.channelList = res.data));
this.getRouteDetails(this.lineId, (value) => {
this.form.channelList = this.setChannelData(value)
})
},
data() {
return {
form: {
"lineId": 0,
channelList: [{
"channelIds": "",
"packagingCreateReqVOList": [
{
"airWeightLimit": 0,
"channelIds": "",
"clearancePriceUnit": 0,
"clearanceVolumeUnit": 0,
"lineId": 0,
"packagingTypes": "",
"priceStepClearanceCreateReqVOList": [
{
"channelId": '',
"clearancePrice": '',
"clearancePriceUnit": '',
"clearanceVolumeUnit": '',
"endNum": '',
"packagingId": '',
"startNum": '',
"weightUnit": ''
}
]
"priceStepClearanceCreateReqVOList": []
}
]
}],
},
form1: {
......@@ -53,10 +46,23 @@ export default {
},
deletePackagingTypes() {
let a = []
this.form.channelPackagingList.forEach(item => {
a.push(...item.packagingTypes)
this.form.channelList.forEach(item => {
item.packagingCreateReqVOList.forEach(i =>{
a.push(...i.packagingTypes)
})
})
return a
},
channelIdBlackList(){
let arr = []
this.form.channelList.forEach(i =>{
arr.push(...i.channelIds)
})
return arr
},
// 线路id
lineId() {
return Number(this.$route.query.id);
}
},
methods: {
......@@ -71,39 +77,139 @@ export default {
packagingTypes: [],
priceStepClearanceCreateReqVOList: [],
}
let arr = this.form.channelList[index].packagingCreateReqVOList
arr.push(p)
this.$set(this.form.channelList[index], 'packagingCreateReqVOList', arr);
},
newChannelsAdd(index) {
this.form.channelList.splice(index, 0, {
"channelIds": "",
"packagingCreateReqVOList": [
{
"airWeightLimit": 0,
"packagingTypes": "",
"priceStepClearanceCreateReqVOList": []
}
]
},)
},
channelsDelete(index) {
this.form.channelList.splice(index, 1)
},
deletePackag(index, indexx) {
let arr = this.form.channelList;
arr[index].packagingCreateReqVOList.splice(indexx, 1);
this.form.channelList = arr;
},
getRouteDetails(id, callback = () => {
}) {
getAirLineChannelPackagingList(id).then(
(r) => {
callback(r.data)
}
)
},
setChannelData(list = []) {
let arr = []
list.forEach((i, index) => {
if (index === 0) {
arr.push({channelIds: i.channelIds, packagingCreateReqVOList: [i]})
} else {
if (i.channelIds === list[index - 1].channelIds) {
arr[arr.length - 1].packagingCreateReqVOList.push(i)
} else {
arr.push({channelIds: i.channelIds, packagingCreateReqVOList: [i]})
}
}
})
arr.forEach(i => {
i.channelIds = i.channelIds ? i.channelIds.split(',') : []
i.packagingCreateReqVOList.forEach(item => {
item.packagingTypes = item.packagingTypes ? item.packagingTypes.split(',') : [];
item.priceStepClearanceCreateReqVOList = item.lineChannelPriceStepClearanceBackVOList || [];
item.lineChannelPriceStepClearanceBackVOList = null;
})
})
return arr;
// this.form.channelPackagingList.push(p)
let arr = this.form.packagingCreateReqVOList[index].priceStepClearanceCreateReqVOList
},
getChannelDate(value) {
let obj = Object.assign({}, value)
let arr = []
obj.channelList.forEach(i => {
i.packagingCreateReqVOList.forEach(item => {
item.channelIds = i.channelIds.join(',');
let p = {
"airWeightLimit": item.airWeightLimit,
"channelIds": item.channelIds,
"clearancePriceUnit": item.priceStepClearanceCreateReqVOList[0].clearancePriceUnit,
"clearanceVolumeUnit": item.priceStepClearanceCreateReqVOList[0].clearanceVolumeUnit,
"lineId": this.lineId,
"packagingTypes": item.packagingTypes.join(','),
priceStepClearanceCreateReqVOList: this.getPriceStepClearanceCreateReqVOList(item.priceStepClearanceCreateReqVOList)
}
arr.push(p)
this.$set(this.form.packagingCreateReqVOList[index], 'priceStepClearanceCreateReqVOList', arr);
})
})
return {
lineId: this.lineId,
packagingCreateReqVOList: arr,
}
},
getPriceStepClearanceCreateReqVOList(list) {
let arr = []
list.forEach(i => {
arr.push({
"clearancePrice": i.clearancePrice,
"endNum": i.endNum,
"startNum": i.startNum
})
})
return arr
},
submit() {
createWarehouseLineChannelPackaging(this.getChannelDate(this.form)).then(r => {
this.$message.success('保存成功');
this.$router.back()
})
},
copy(value) {
console.log(value, 'value');
this.getRouteDetails(value.id, (value) => {
this.form.channelList = this.setChannelData(value)
this.$message.success('复制成功。')
})
}
}
}
</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">
<el-card style="margin-bottom: 10px" v-for="(itemOuter,index) in form.channelList" :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"
<el-select multiple v-model="itemOuter.channelIds">
<el-option :disabled="channelIdBlackList.includes(item.channelId.toString()) && (!itemOuter.channelIds.includes(item.channelId.toString()))" v-for="item in channelList" :value="item.channelId.toString()" :key="item.channelId"
:label="$l(item, 'name')"></el-option>
</el-select>
</el-col>
<el-col :span="2">
<el-button type="primary">新增渠道</el-button>
<el-button type="primary" @click="newChannelsAdd(index)">新增渠道</el-button>
</el-col>
<el-col :span="2">
<el-button type="danger">删除当前渠道</el-button>
<el-button type="danger" :disabled="form.channelList.length === 1" @click="channelsDelete(index)">
删除当前渠道
</el-button>
</el-col>
<el-col :span="2">
<el-button type="text">选择渠道包装模板</el-button>
<air-freight-route-template :lineId="lineId" @copy="copy">
<el-button v-if="index === 0" type="text">选择渠道包装模板</el-button>
</air-freight-route-template>
</el-col>
</el-row>
</template>
......@@ -116,27 +222,35 @@ export default {
<el-button type="primary" @click="addPackaging(index)">添加包装类型</el-button>
</div>
</div>
<el-row :gutter="20" v-for="(itemm, indexx) in itemOuter.priceStepClearanceCreateReqVOList"
<el-row :gutter="20" v-for="(itemm, indexx) in itemOuter.packagingCreateReqVOList"
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"
<el-option :disabled="deletePackagingTypes.includes(item.value) && (!itemm.packagingTypes.includes(item.value))" 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">
<!-- v-if="itemOuter.packagingCreateReqVOList[indexx].length"-->
<packaging-type key-arr="priceStepClearanceCreateReqVOList"
v-if="itemOuter.priceStepClearanceCreateReqVOList[index].length" v-model="itemOuter[index]">
<el-button type="danger">删除包装类型{{ index + 1 }}
v-model="itemOuter.packagingCreateReqVOList[indexx]">
<el-button @click="deletePackag(index,indexx)" :disabled="itemOuter.packagingCreateReqVOList.length === 1"
type="danger">删除包装类型{{ indexx + 1 }}
</el-button>
</packaging-type>
</el-col>
</el-row>
</el-card>
<div class="footer">
<el-button type="primary" @click="submit">保存</el-button>
</div>
</div>
</template>
<style scoped lang="scss">
.footer {
position: fixed;
bottom: 20px;
}
</style>
<script>
import {getAirLineChannelTemplateList} from "@/api/ecw/customerContacts";
import {warehouseLinePage} from "@/api/ecw/customerContacts";
import {getWarehouseList} from "@/api/ecw/warehouse";
import Template from "@/views/cms/template/index.vue";
export default {
name: "airFreightRouteTemplate",
components: {Template},
props:{
lineId:{
default:''
}
},
data() {
return {
open: true,
warehouseList:[],
list:[],
form:{
open: false,
warehouseList: [],
list: [],
total: 0,
form: {},
queryParams: {
pageSize:20,
transportType:3
}
}
},
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;
warehouseLinePage(this.queryParams).then(r => {
this.list = r.data.list;
this.total = r.data.total
})
},
copy(value) {
this.$emit('copy', value)
this.open = false
}
},
computed: {
exportWarehouseList() {
......@@ -44,20 +53,27 @@ export default {
);
},
},
watch: {
open(value) {
if (value) {
this.getList();
}
}
}
}
</script>
<template>
<div>
<div style="display: inline-block">
<div @click="open = true;" style="display: inline-block">
<slot></slot>
</div>
<el-dialog :visible.sync="open">
<el-card>
<template #header>
<el-form inline >
<el-form-item label="始发地" >
<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>
......@@ -65,7 +81,8 @@ export default {
</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-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>
......@@ -73,22 +90,27 @@ export default {
<el-table border :data="list">
<el-table-column label="始发仓">
<template slot-scope="{row}">
{{ $l(row,'startWarehouseName')}}
{{ $l(exportWarehouseList.find(i => i.id === row.startWarehouseId), 'title') }}
</template>
</el-table-column>
<el-table-column label="目的仓" >
<el-table-column label="目的仓">
<template slot-scope="{row}">
{{ $l(row,'destWarehouseName')}}
{{ $l(importWarehouseList.find(i => i.id === row.destWarehouseId), 'title') }}
</template>
</el-table-column>
<el-table-column label="渠道数">
<template slot-scope="{row}">
{{ row.channelIds ? row.channelIds.split(',').length : 0 }}
</template>
</el-table-column>
<el-table-column label="渠道数" prop="channelCount" ></el-table-column>
<el-table-column>
<template>
<el-button type="text">复制</el-button>
<template slot-scope="{row}">
<el-button type="text" v-if="lineId !== row.id" @click="copy(row)">复制</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
</el-card>
</el-dialog>
</div>
......
......@@ -137,6 +137,8 @@
<el-button size="mini" type="primary" @click="serviceClick(scope.row)" v-if="scope.row.lineId != null"
v-hasPermi="['ecw:warehouse:routerQuery']">{{$t('开通服务')}}</el-button>
<el-button size="mini" type="danger" @click="$router.push('/offer/channel-route?lineId='+scope.row.lineId)" v-if="scope.row.lineId != null && scope.row.transportType == 3" >{{$t('渠道包装清关费')}}</el-button>
</template>
</el-table-column>
</el-table>
......
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