Commit 300373a1 authored by dragondean@qq.com's avatar dragondean@qq.com

路线产品(不含批量操作)

parent 6142d2f7
...@@ -29,7 +29,7 @@ export function deleteChannel(id) { ...@@ -29,7 +29,7 @@ export function deleteChannel(id) {
// 获得渠道管理 // 获得渠道管理
export function getChannel(id) { export function getChannel(id) {
return request({ return request({
url: '/ecw/channel/get?id=' + id, url: '/ecw/channel/get?channelId=' + id,
method: 'get' method: 'get'
}) })
} }
...@@ -43,6 +43,15 @@ export function getChannelPage(query) { ...@@ -43,6 +43,15 @@ export function getChannelPage(query) {
}) })
} }
// 获得渠道列表 TODO
export function getChannelList(query) {
return request({
url: '/ecw/channel/select',
method: 'get',
params: query
})
}
// 导出渠道管理 Excel // 导出渠道管理 Excel
export function exportChannelExcel(query) { export function exportChannelExcel(query) {
return request({ return request({
......
...@@ -43,6 +43,15 @@ export function getExpressPage(query) { ...@@ -43,6 +43,15 @@ export function getExpressPage(query) {
}) })
} }
// 获取配送列表
export function getExpressList(query) {
return request({
url: '/ecw/express/list',
method: 'get',
params: query
})
}
// 导出配送管理 Excel // 导出配送管理 Excel
export function exportExpressExcel(query) { export function exportExpressExcel(query) {
return request({ return request({
......
...@@ -89,3 +89,12 @@ export function getCityList(query) { ...@@ -89,3 +89,12 @@ export function getCityList(query) {
params: query params: query
}) })
} }
// 获得进出口城市
export function getTradeCityList(query) {
return request({
url: '/ecw/region/getCityList',
method: 'get',
params: query
})
}
...@@ -81,7 +81,7 @@ export function changeRouteStatus(data) { ...@@ -81,7 +81,7 @@ export function changeRouteStatus(data) {
} }
/**查看已开通线路列表 */ /**查看已开通线路列表 */
export function openedRouterList(data) { export function openedRouterList(data = {}) {
return request({ return request({
url: '/ecw/warehouse/openedRouterList', url: '/ecw/warehouse/openedRouterList',
method: 'post', method: 'post',
......
...@@ -35,15 +35,19 @@ export default { ...@@ -35,15 +35,19 @@ export default {
this.$emit('input', this.forceString ? String(this.valueSync) : this.valueSync) this.$emit('input', this.forceString ? String(this.valueSync) : this.valueSync)
}, },
value(val){ value(val){
if(!val || val === null){ this.setValueSync()
return
}
if(this.forceString && this.multiple){
this.valueSync = val.split(',')
}else this.valueSync = this.forceString ? String(val) : val
} }
}, },
created(){
this.setValueSync()
},
methods:{ methods:{
setValueSync(){
if(!this.value || this.value == '') return
if(this.forceString && this.multiple){
this.valueSync = val.split(',')
}else this.valueSync = this.forceString ? String(this.value) : this.value
},
getList(){ getList(){
return selfDefinedDict[this.type] || this.getDictDatas(this.type) return selfDefinedDict[this.type] || this.getDictDatas(this.type)
} }
......
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
dialogVisible: false, dialogVisible: false,
hideUpload: false, hideUpload: false,
baseUrl: process.env.VUE_APP_BASE_API, baseUrl: process.env.VUE_APP_BASE_API,
uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址 uploadImgUrl: process.env.VUE_APP_BASE_API + "/app-api/file/upload", // 上传的图片服务器地址
headers: { headers: {
Authorization: "Bearer " + getToken(), Authorization: "Bearer " + getToken(),
}, },
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
this.fileList = list.map(item => { this.fileList = list.map(item => {
if (typeof item === "string") { if (typeof item === "string") {
if (item.indexOf(this.baseUrl) === -1) { if (item.indexOf(this.baseUrl) === -1) {
item = { name: this.baseUrl + item, url: this.baseUrl + item }; item = { name: item, url: item };
} else { } else {
item = { name: item, url: item }; item = { name: item, url: item };
} }
...@@ -127,7 +127,8 @@ export default { ...@@ -127,7 +127,8 @@ export default {
}, },
// 上传成功回调 // 上传成功回调
handleUploadSuccess(res) { handleUploadSuccess(res) {
this.uploadList.push({ name: res.fileName, url: res.fileName }); console.log({res})
this.uploadList.push({ name: res.data.split('/').pop(), url: res.data });
if (this.uploadList.length === this.number) { if (this.uploadList.length === this.number) {
this.fileList = this.fileList.concat(this.uploadList); this.fileList = this.fileList.concat(this.uploadList);
this.uploadList = []; this.uploadList = [];
......
<template>
<el-select
v-model="index"
filterable
clearable
remote
reserve-keyword
placeholder="请输入商品关键词"
:remote-method="remoteMethod"
:loading="loading">
<el-option
v-for="(item, index) in list"
:key="item.id"
:label="item.titleZh"
:value="index">
</el-option>
</el-select>
</template>
<script>
import {getProduct, getProductPage} from '@/api/ecw/product'
export default {
props:{
productType: [String, Number],
value: [String, Number]
},
data(){
return {
index: {},
list:[],
loading: false
}
},
watch:{
index(val){
this.$emit('input', val !== null ? this.list[val].id : null)
this.$emit('change', val !== null ? this.list[val] : null)
},
value(val){
console.log('初始化内容', val)
/* let index = this.list.findIndex(item => item.id == val)
if(index < 0){
getProduct(val).then(res => {
this.list.unshift(res.data)
this.index = 0
})
} */
this.init()
}
},
created(){
console.log('created', this.value)
this.init()
},
methods:{
init(){
if(!this.value) return null
let index = this.list.findIndex(item => item.id == this.value)
if(index < 0){
getProduct(this.value).then(res => {
this.list.unshift(res.data)
this.index = 0
})
}
},
remoteMethod(keyword){
let params = {}
if(this.productType){
params.productType = this.productType
}
params.titleZh = keyword
this.loading = true
getProductPage(params)
.then(res => this.list = res.data.list)
.finally(() => this.loading = false)
}
}
}
</script>
\ No newline at end of file
<template>
<div>
<template v-for="(list, level) in options">
<el-select
:key="list.id"
v-model="selectedIndex[level]"
placeholder="请选择"
>
<el-option
v-for="item in list"
:key="item.id"
:label="item.titleZh"
:value="item.id"
>
</el-option>
</el-select>
</template>
</div>
</template>
<script>
import { getListTree } from "@/api/ecw/region";
// 洲,国,省,市,区
export default {
props:{
continent: {
type: Number,
default: 1
}, // 0 从洲开始,1从国家开始,
type: String, // 进出口类型
},
data() {
return {
treeList: [],
selectedIndex:[],
options:[]
};
},
watch:{
treeList(){
this.selectedIndex = []
this.options = [
this.treeList
]
},
selectedIndex(val, old){
}
},
created(){
getListTree({
treeType: this.treeType,
type: this.type
}).then((response) => {
this.treeList = response.data;
});
},
methods: {
},
};
</script>
\ No newline at end of file
<template>
<div>
<div class="filters mb-10">
运输方式
<dict-selector :type='DICT_TYPE.ECW_TRANSPORT_TYPE' v-model="transportType" placeholder="请选择运输方式" />
始发地:
<el-select placeholder="请选择始发地" v-model="exportCity" clearable>
<el-option v-for="item in exportCityList" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select>
目的地:
<el-select placeholder="请选择目的地" v-model="importCity" clearable>
<el-option v-for="item in importCityList" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select>
</div>
<el-row class="" :gutter="10">
<template v-for="item in filteredRouterList">
<el-col :span="12" :key="item.value">
<el-card class="mb-10">
<div slot="header">
{{item.label}}
<el-link type="primary" @click.native="toggleHide(item.value)" style="float:right">{{item._hide ? '展开' : '折叠'}}</el-link>
</div>
<el-table v-if="!hideMap[item.value]" :data="item.routerList" :span-method="SpanMethod" border>
<el-table-column label="始发地" prop="startTitleZh" />
<el-table-column label="目的地" prop="destTitleZh" />
<el-table-column label="渠道" prop="startTitleZh">
<template slot-scope="{row}">
{{row.channel.nameZh}}11
</template>
</el-table-column>
<el-table-column label="操作" prop="">
<template slot-scope="{row}">
<el-checkbox :checked="getSelectedIndex(row) !== null" @change="toggleChecker(row, $event)"></el-checkbox>
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
</template>
</el-row>
</div>
</template>
<script>
import {getChannelList} from '@/api/ecw/channel'
import {getTradeCityList} from '@/api/ecw/region'
import {openedRouterList} from '@/api/ecw/warehouse'
export default {
data(){
return {
transportTypeDicts: this.getDictDatas(this.DICT_TYPE.ECW_TRANSPORT_TYPE),
channelList:[],
tradeCityList:[],
openedRouterList:[], // 开放路线
transportType: null, // 运输方式
importCity: null, // 目的地(进口城市)
exportCity: null, // 始发地(出口城市)
selectedRoutes: [], // 勾选的路线渠道
hideMap: {}, // 折叠状态
}
},
computed:{
importCityList(){
return this.tradeCityList.filter(item => item.type == 1)
},
exportCityList(){
return this.tradeCityList.filter(item => item.type == 2)
},
filteredRouterList(){
let transportTypeList = []
this.transportTypeDicts.forEach(item => {
if(this.transportType === null || this.transportType == '' || this.transportType == item.value){
let routerList = []
this.openedRouterList.forEach(router => {
if(router.transportType == item.value){
routerList.push(Object.assign({
_merge: item.cssClass == 'channel' ? this.channelList.length || 1 : 1,
channel: item.cssClass == 'channel' ? this.channelList[0] || {} : {},
}, router))
// 字典的cssClass =channel则表示渠道相关(空运,海空联运)
if(item.cssClass == 'channel'){
this.channelList.slice(1).forEach(channel => {
routerList.push(Object.assign({channel, _merge: 0}, router))
})
}
}
})
let child = {
label: item.label,
value: item.value,
_hide: false, // 是否折叠
routerList: routerList
}
transportTypeList.push(child)
}
})
return transportTypeList
}
},
watch:{
exportCity(){
this.getOpenedRouterList()
},
importCity(){
this.getOpenedRouterList()
},
selectedRoutes(val){
this.$emit('input', val)
},
value(val){
this.selectedRoutes = val || []
}
},
created(){
getChannelList().then(res => {
this.channelList = res.data
})
getTradeCityList().then(res => {
this.tradeCityList = res.data
})
this.getOpenedRouterList()
},
methods:{
getOpenedRouterList(){
let params = {}
if(this.exportCity){
params.startCityId = this.exportCity
}
if(this.importCity){
params.destCityId = this.importCity
}
openedRouterList(params).then(res => {
this.openedRouterList = res.data
})
},
// 切换路线选择
toggleChecker(router, selected){
this.getSelectedIndex(router)
/* this.selectedRoutes.forEach((item, i)=>{
if(item.lineId == router.id && item.shippingChannelId == item.channel.id){
index = i
break
}
}) */
if(selected){
this.selectedRoutes.push({
lineId: router.id,
shippingChannelId: router.channel.channelId
})
}else{
let index = this.getSelectedIndex(router)
if(index !== null){
this.selectedRoutes.splice(index, 1)
}
}
},
getSelectedIndex(router){
let index = null
this.selectedRoutes.forEach((item, i)=>{
if(item.lineId == router.id && item.shippingChannelId == router.channel.channelId){
index = i
// break
}
})
return index
},
SpanMethod({ row, column, rowIndex, columnIndex }){
if (columnIndex < 2 ) {
return {
rowspan: row._merge,
colspan: 1
}
}
return {
rowspan: 1,
colspan: 1
}
},
// 折叠,展开
toggleHide(value){
this.$set(this.hideMap, value, !this.hideMap[value])
}
}
}
</script>
<style scoped>
.mb-10{
margin-bottom: 10px
}
</style>
\ No newline at end of file
<template> <template>
<el-card shadow="never"> <el-card shadow="never">
<div slot="header" class="clearfix card-header"> <div slot="header" class="clearfix card-header">
<div class="title">{{title}}</div> <div class="card-title">{{title}}</div>
<el-button size="mini" type="primary" icon="el-icon-plus" @click="listData.push({})"></el-button> <el-button size="mini" type="primary" icon="el-icon-plus" @click="listData.push({})"></el-button>
</div> </div>
<el-table :data="listData" border> <el-table :data="listData" border>
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.card-header{ .card-header{
display: flex; display: flex;
.title{ .card-title{
flex: 1; flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
components: {}, components: {},
data() { data() {
return { return {
uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址 uploadImgUrl: process.env.VUE_APP_BASE_API + "/app-api/file/upload", // 上传的图片服务器地址
headers: { headers: {
Authorization: "Bearer " + getToken(), Authorization: "Bearer " + getToken(),
}, },
......
...@@ -67,7 +67,7 @@ export const DICT_TYPE = { ...@@ -67,7 +67,7 @@ export const DICT_TYPE = {
ECW_PRODUCT_MATERIAL: 'product_material', //商品材质 ECW_PRODUCT_MATERIAL: 'product_material', //商品材质
ECW_PACKAGING_TYPE: 'packaging_type', //包装要求 ECW_PACKAGING_TYPE: 'packaging_type', //包装要求
ECW_CONTAINER_LOCATION: 'container_location', //默认货柜位置 ECW_CONTAINER_LOCATION: 'container_location', //默认货柜位置
ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS: 'special_req_for_line_products', // 特殊需求
//--------ecw--------- //--------ecw---------
CUSTOMER_STATUS: 'customer_status', CUSTOMER_STATUS: 'customer_status',
CUSTOMER_SOURCE: 'customer_source', CUSTOMER_SOURCE: 'customer_source',
...@@ -78,7 +78,7 @@ export const DICT_TYPE = { ...@@ -78,7 +78,7 @@ export const DICT_TYPE = {
CUSTOMER_COMPLAINT_STATUS: 'customer_complaint_status', CUSTOMER_COMPLAINT_STATUS: 'customer_complaint_status',
ECW_MESSAGE_LEAVE_TYPE: 'ecw_message_leave_type', ECW_MESSAGE_LEAVE_TYPE: 'ecw_message_leave_type',
ECW_MESSAGE_LEAVE_STATUS: 'ecw_message_leave_status', ECW_MESSAGE_LEAVE_STATUS: 'ecw_message_leave_status',
PWD_TYPE: 'pwd_type' PWD_TYPE: 'pwd_type',
} }
......
...@@ -427,3 +427,11 @@ export function isNumberStr(str) { ...@@ -427,3 +427,11 @@ export function isNumberStr(str) {
return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str) return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str)
} }
// 将数组变成object
export function arrryToKeyedObjectBy(arr, key){
let obj = {}
arr.forEach(item => {
obj[item[key]] = item
})
return obj
}
\ No newline at end of file
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-card shadow="never">
<div slot="header" class="clearfix">
<span>基本信息</span>
</div>
<el-form-item label="仓库ID字符串" prop="warehouseIds">
<el-input
v-model="form.warehouseIds"
placeholder="请输入仓库ID字符串"
/>
</el-form-item>
<el-form-item label="快递ID" prop="expressId">
<el-input v-model="form.expressId" placeholder="请输入快递ID" />
</el-form-item>
<el-form-item label="渠道代理" prop="channelAgent">
<el-input
v-model="form.channelAgent"
placeholder="请输入渠道代理"
/>
</el-form-item>
</el-card>
<el-card shadow="never">
<div slot="header" class="clearfix">
<span>渠道收费规则</span>
</div>
<!-- <el-form-item label="渠道ID" prop="channelId">
<el-input v-model="form.channelId" placeholder="请输入渠道ID" />
</el-form-item> -->
<el-form-item label="收费模式" prop="chargingMode">
<el-input v-model="form.channelCostCreateReqVO.chargingMode" placeholder="请输入收费模式" />
</el-form-item>
<el-form-item label="是否包税:0 不包税 1 包税" prop="isTaxInclusive">
<el-input v-model="form.channelCostCreateReqVO.isTaxInclusive" placeholder="请输入是否包税:0 不包税 1 包税" />
</el-form-item>
<el-form-item label="包税加价金额" prop="taxAddAmount">
<el-input v-model="form.channelCostCreateReqVO.taxAddAmount" placeholder="请输入包税加价金额" />
</el-form-item>
<el-form-item label="结算类型:1 单件 2 整票" prop="settlementType">
<el-select v-model="form.channelCostCreateReqVO.settlementType" placeholder="请选择结算类型:1 单件 2 整票">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="免税金额" prop="taxFreeAmount">
<el-input v-model="form.channelCostCreateReqVO.taxFreeAmount" placeholder="请输入免税金额" />
</el-form-item>
<el-form-item label="消费税比例" prop="consumptionTaxRatio">
<el-input v-model="form.channelCostCreateReqVO.consumptionTaxRatio" placeholder="请输入消费税比例" />
</el-form-item>
<el-form-item label="燃油费用比例" prop="fuelCostRatio">
<el-input v-model="form.channelCostCreateReqVO.fuelCostRatio" placeholder="请输入燃油费用比例" />
</el-form-item>
<el-form-item label="单件取整重量" prop="oneRoundingWeight">
<el-input v-model="form.channelCostCreateReqVO.oneRoundingWeight" placeholder="请输入单件取整重量" />
</el-form-item>
<el-form-item label="取整单价" prop="unitPrice">
<el-input v-model="form.channelCostCreateReqVO.unitPrice" placeholder="请输入取整单价" />
</el-form-item>
<el-form-item label="杂费" prop="incidental">
<el-input v-model="form.channelCostCreateReqVO.incidental" placeholder="请输入杂费" />
</el-form-item>
<el-form-item label="免抛重量" prop="freeThrowWeight">
<el-input v-model="form.channelCostCreateReqVO.freeThrowWeight" placeholder="请输入免抛重量" />
</el-form-item>
<el-form-item label="计算系数" prop="coefficients">
<el-input v-model="form.channelCostCreateReqVO.coefficients" placeholder="请输入计算系数" />
</el-form-item>
<el-form-item label="清关单价" prop="customsClearUnit">
<el-input v-model="form.channelCostCreateReqVO.customsClearUnit" placeholder="请输入清关单价" />
</el-form-item>
</el-card>
<el-card shadow="never"> <el-card shadow="never">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>渠道信息</span> <span>渠道信息</span>
</div> </div>
<el-row> <el-row>
<el-col span="12"> <el-col :span="12">
<el-form-item label="中文名称" prop="nameZh"> <el-form-item label="中文名称" prop="nameZh">
<el-input v-model="form.nameZh" placeholder="请输入名称-中文" /> <el-input v-model="form.nameZh" placeholder="请输入名称-中文" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col span="12"> <el-col :span="12">
<el-form-item label="名称英文" prop="nameEn"> <el-form-item label="名称英文" prop="nameEn">
<el-input v-model="form.nameEn" placeholder="请输入名称-英文" /> <el-input v-model="form.nameEn" placeholder="请输入名称-英文" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col span="12"> <el-col :span="12">
<el-form-item label="内部名称中文" prop="internalNameZh"> <el-form-item label="内部名称中文" prop="internalNameZh">
<el-input <el-input
v-model="form.internalNameZh" v-model="form.internalNameZh"
...@@ -93,7 +26,7 @@ ...@@ -93,7 +26,7 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col span="12"> <el-col :span="12">
<el-form-item label="内部名称英文" prop="internalNameEn"> <el-form-item label="内部名称英文" prop="internalNameEn">
<el-input <el-input
v-model="form.internalNameEn" v-model="form.internalNameEn"
...@@ -101,25 +34,59 @@ ...@@ -101,25 +34,59 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="类型编码" prop="typeNumber">
<el-input
v-model="form.typeNumber"
placeholder="请输入类型编码"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="归属仓库" prop="warehouseIds">
<!-- <el-select v-model="form.wareHouseIds">
<el-option v-for="item in warehouseList" :value="item.id" :label="item.nameZh"/>
</el-select> -->
<el-checkbox-group v-model="warehouseIdsArr">
<!--label需要是字符串,因为回显时分解后为字符串格式-->
<el-checkbox v-for="item in warehouseList" :label="`${item.id}`" :key="item.id" >{{item.titleZh}}</el-checkbox>
</el-checkbox-group>
<!-- <el-input
v-model="form.warehouseIds"
placeholder="请输入归属仓库Ids"
/> -->
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="排序" prop="sort">
<el-input v-model="form.sort" placeholder="请输入排序" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="快递" prop="expressId">
<!-- <el-input v-model="form.expressId" placeholder="请输入快递ID" /> -->
<el-select v-model="form.expressId">
<el-option v-for="item in expressList" :value="item.id" :label="item.companyName" :key="item.id"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="预计到达时间" prop="etaTime">
<el-input type="number" v-model="form.etaTime" placeholder="请输入天数">
<span slot="append"></span>
</el-input>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item label="渠道代理" prop="channelAgent">
<el-input
v-model="form.channelAgent"
placeholder="请输入渠道代理"
/>
</el-form-item>
</el-col> -->
</el-row> </el-row>
<el-form-item label="类型编码" prop="typeNumber">
<el-input
v-model="form.typeNumber"
placeholder="请输入类型编码"
/>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="form.sort" placeholder="请输入排序" />
</el-form-item>
<el-form-item label="预计到达时间(天)" prop="etaTime">
<el-date-picker
clearable
v-model="form.etaTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择预计到达时间(天)"
/>
</el-form-item>
<el-form-item label="备注-中文" prop="remarksZh"> <el-form-item label="备注-中文" prop="remarksZh">
<el-input <el-input
v-model="form.remarksZh" v-model="form.remarksZh"
...@@ -132,16 +99,32 @@ ...@@ -132,16 +99,32 @@
placeholder="请输入备注-英文" placeholder="请输入备注-英文"
/> />
</el-form-item> </el-form-item>
<el-form-item label="状态(0:禁用 1:启用)" prop="status"> <!-- <el-form-item label="状态(0:禁用 1:启用)" prop="status">
<el-radio-group v-model="form.status"> <el-radio-group v-model="form.status">
<el-radio label="1">请选择字典生成</el-radio> <el-radio label="1">请选择字典生成</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> -->
</el-card>
<el-card shadow="never">
<div slot="header" class="clearfix">
<span>渠道收费规则</span>
</div>
<el-form-item label="清关单价" prop="customsClearUnit">
<el-input v-model="form.customsClearUnit" placeholder="请输入清关单价">
<span slot="append">$</span>
</el-input>
</el-form-item>
<el-form-item label="每0.5KG单价" prop="weightUnitPrice">
<el-input v-model="form.weightUnitPrice" placeholder="此字段名暂缺" >
<span slot="append">$</span>
</el-input>
</el-form-item> </el-form-item>
</el-card> </el-card>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div>
<el-button type="primary" @click="submitForm">确 定</el-button> <el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button> <el-button @click="$router.back()">返回列表</el-button>
</div> </div>
</div> </div>
</template> </template>
...@@ -154,7 +137,8 @@ import { ...@@ -154,7 +137,8 @@ import {
getChannelPage, getChannelPage,
exportChannelExcel, exportChannelExcel,
} from "@/api/ecw/channel"; } from "@/api/ecw/channel";
import {getWarehouseList} from '@/api/ecw/warehouse'
import {getExpressList} from '@/api/ecw/express'
export default { export default {
data() { data() {
return { return {
...@@ -162,15 +146,52 @@ export default { ...@@ -162,15 +146,52 @@ export default {
channelCostCreateReqVO:{} channelCostCreateReqVO:{}
}, },
rules: {}, rules: {},
expressList:[],
warehouseList: [],
warehouseIdsArr:[]
}; };
}, },
created() { watch:{
if (this.$route.query.id) { /* wareHouseIdsArr(val){
getChannel(this.$route.query.id).then((res) => { console.log('更新wareHouseIdsArr', val)
this.form = res.data; this.$set(this.form, 'wareHouseIds', val.join(','))
}); },
} 'form.wareHouseIds'(val){
console.log('form.wareHouseIds', val)
this.wareHouseIdsArr = val?.split(',') || []
} */
},
async created() {
// 获得仓库
await getWarehouseList().then(res => {
this.warehouseList = res.data
})
await getExpressList().then(res => {
this.expressList = res.data
})
if (this.$route.query.id) {
getChannel(this.$route.query.id).then((res) => {
this.$set(this, 'form', res.data)
console.log('this.form.warehouseIds', this.form.warehouseIds)
if(this.form.warehouseIds.length){
this.warehouseIdsArr = this.form.warehouseIds.split(',')?.filter(item => !!item)
}
});
}
}, },
computed:{
/* wareHouseIdsArr:{
get(){
return this.form.wareHouseIds?.split(',') || []
},
set(val){
console.log('val', val)
this.$set(this.form, 'wareHouseIds', val.join(','))
}
} */
},
methods: { methods: {
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
...@@ -178,20 +199,19 @@ export default { ...@@ -178,20 +199,19 @@ export default {
if (!valid) { if (!valid) {
return; return;
} }
this.form.warehouseIds = this.warehouseIdsArr.join(',')
// 修改的提交 // 修改的提交
if (this.form.channelId != null) { if (this.form.channelId != null) {
updateChannel(this.form).then((response) => { updateChannel(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.$router.back();
this.getList();
}); });
return; return;
} }
// 添加的提交 // 添加的提交
createChannel(this.form).then((response) => { createChannel(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.$router.back();
this.getList();
}); });
}); });
}, },
......
...@@ -3,52 +3,51 @@ ...@@ -3,52 +3,51 @@
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="名称-中文" prop="nameZh"> <el-form-item label="名称" prop="nameZh">
<el-input v-model="queryParams.nameZh" placeholder="请输入名称-中文" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.nameZh" placeholder="请输入名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<el-form-item label="名称-英文" prop="nameEn"> <!-- <el-form-item label="名称-英文" prop="nameEn">
<el-input v-model="queryParams.nameEn" placeholder="请输入名称-英文" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.nameEn" placeholder="请输入名称-英文" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> -->
<el-form-item label="内部名称" prop="internalNameZh">
<el-input v-model="queryParams.internalNameZh" placeholder="请输入内部名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<el-form-item label="内部名称-中文" prop="internalNameZh"> <!-- <el-form-item label="内部名称-英文" prop="internalNameEn">
<el-input v-model="queryParams.internalNameZh" placeholder="请输入内部名称-中文" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="内部名称-英文" prop="internalNameEn">
<el-input v-model="queryParams.internalNameEn" placeholder="请输入内部名称-英文" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.internalNameEn" placeholder="请输入内部名称-英文" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item> -->
<el-form-item label="类型编码" prop="typeNumber"> <el-form-item label="类型编码" prop="typeNumber">
<el-input v-model="queryParams.typeNumber" placeholder="请输入类型编码" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.typeNumber" placeholder="请输入类型编码" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<el-form-item label="仓库ID字符串" prop="warehouseIds"> <!-- <el-form-item label="仓库ID字符串" prop="warehouseIds">
<el-input v-model="queryParams.warehouseIds" placeholder="请输入仓库ID字符串" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.warehouseIds" placeholder="请输入仓库ID字符串" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item> -->
<el-form-item label="排序" prop="sort"> <!-- <el-form-item label="排序" prop="sort">
<el-input v-model="queryParams.sort" placeholder="请输入排序" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.sort" placeholder="请输入排序" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item> -->
<el-form-item label="快递ID" prop="expressId"> <el-form-item label="快递ID" prop="expressId">
<el-input v-model="queryParams.expressId" placeholder="请输入快递ID" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.expressId" placeholder="请输入快递ID" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<el-form-item label="预计到达时间(天)"> <el-form-item label="到达时间">
<el-date-picker v-model="dateRangeEtaTime" style="width: 240px" value-format="yyyy-MM-dd" <el-input v-model="queryParams.dateRangeEtaTime" placeholder="预计到达天数" clearable @keyup.enter.native="handleQuery"/>
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item> </el-form-item>
<el-form-item label="渠道代理" prop="channelAgent"> <el-form-item label="渠道代理" prop="channelAgent">
<el-input v-model="queryParams.channelAgent" placeholder="请输入渠道代理" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.channelAgent" placeholder="请输入渠道代理" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<el-form-item label="备注-中文" prop="remarksZh"> <el-form-item label="备注" prop="remarksZh">
<el-input v-model="queryParams.remarksZh" placeholder="请输入备注-中文" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.remarksZh" placeholder="请输入备注-中文" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<el-form-item label="备注-英文" prop="remarksEn"> <!-- <el-form-item label="备注-英文" prop="remarksEn">
<el-input v-model="queryParams.remarksEn" placeholder="请输入备注-英文" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.remarksEn" placeholder="请输入备注-英文" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item> -->
<el-form-item label="状态(0:禁用 1:启用)" prop="status"> <!-- <el-form-item label="状态(0:禁用 1:启用)" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态(0:禁用 1:启用)" clearable size="small"> <el-select v-model="queryParams.status" placeholder="请选择状态(0:禁用 1:启用)" clearable size="small">
<el-option label="请选择字典生成" value="" /> <el-option label="请选择字典生成" value="" />
</el-select> </el-select>
</el-form-item> </el-form-item> -->
<el-form-item label="创建时间"> <!-- <el-form-item label="创建时间">
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd" <el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" /> type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item> </el-form-item> -->
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
...@@ -71,19 +70,19 @@ ...@@ -71,19 +70,19 @@
<!-- 列表 --> <!-- 列表 -->
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list">
<el-table-column label="渠道ID" align="center" prop="channelId" /> <el-table-column label="渠道ID" align="center" prop="channelId" />
<el-table-column label="名称-中文" align="center" prop="nameZh" /> <el-table-column label="名称" align="center" prop="nameZh" />
<el-table-column label="名称-英文" align="center" prop="nameEn" /> <!-- <el-table-column label="名称-英文" align="center" prop="nameEn" /> -->
<el-table-column label="内部名称-中文" align="center" prop="internalNameZh" /> <el-table-column label="内部名称" align="center" prop="internalNameZh" />
<el-table-column label="内部名称-英文" align="center" prop="internalNameEn" /> <!-- <el-table-column label="内部名称-英文" align="center" prop="internalNameEn" /> -->
<el-table-column label="类型编码" align="center" prop="typeNumber" /> <el-table-column label="类型编码" align="center" prop="typeNumber" />
<el-table-column label="仓库ID字符串" align="center" prop="warehouseIds" /> <el-table-column label="仓库ID字符串" align="center" prop="warehouseIds" />
<el-table-column label="排序" align="center" prop="sort" /> <el-table-column label="排序" align="center" prop="sort" />
<el-table-column label="快递ID" align="center" prop="expressId" /> <el-table-column label="快递ID" align="center" prop="expressId" />
<el-table-column label="预计到达时间(天)" align="center" prop="etaTime" /> <el-table-column label="预计时间(天)" align="center" prop="etaTime" />
<el-table-column label="渠道代理" align="center" prop="channelAgent" /> <el-table-column label="渠道代理" align="center" prop="channelAgent" />
<el-table-column label="备注-中文" align="center" prop="remarksZh" /> <el-table-column label="备注" align="center" prop="remarksZh" />
<el-table-column label="备注-英文" align="center" prop="remarksEn" /> <!-- <el-table-column label="备注-英文" align="center" prop="remarksEn" /> -->
<el-table-column label="状态(0:禁用 1:启用)" align="center" prop="status" /> <!-- <el-table-column label="状态" align="center" prop="status" /> -->
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
...@@ -160,7 +159,7 @@ export default { ...@@ -160,7 +159,7 @@ export default {
}; };
}, },
created() { created() {
// this.getList(); this.getList();
}, },
methods: { methods: {
/** 查询列表 */ /** 查询列表 */
......
...@@ -388,10 +388,13 @@ export default { ...@@ -388,10 +388,13 @@ export default {
/**跳转价格管理 */ /**跳转价格管理 */
toPriceManager(row) { toPriceManager(row) {
localStorage.setItem('product', JSON.stringify(row)); /* localStorage.setItem('product', JSON.stringify(row));
localStorage.setItem('typeList', JSON.stringify(this.typeList)); localStorage.setItem('typeList', JSON.stringify(this.typeList)); */
this.$router.push({ this.$router.push({
name:'ProductPrice' name:'ProductPrice',
query: {
product_id: row.id
}
}) })
}, },
......
<template>
<div class="app-container">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="商品类型" prop="typeId">
<el-input v-if="productDisabled && productType" :value="productType.titleZh" disabled />
<el-select v-if="!productDisabled" v-model="form.productType">
<el-option v-for="type in productTypeList" :key="type.id" :label="type.titleZh" :value="type.id" />
</el-select>
</el-form-item>
<el-form-item label="商品名称" prop="titleZh">
<el-input v-if="productDisabled" :value="product ? product.titleZh:null" disabled />
<product-selector v-else v-model="form.productId" :product-type="form.productType" @change="product=$event" />
</el-form-item>
<el-form-item label="英文名称" prop="titleEn">
<el-input :value="product ? product.titleEn : ''" disabled />
</el-form-item>
<el-form-item label="路线" v-if="form.warehouseLineDO">
<el-input :value="'【' + getDictDataLabel(DICT_TYPE.ECW_TRANSPORT_TYPE, form.warehouseLineDO.transportType) + '】从【'+form.warehouseLineDO.startTitleZh+'】发往【'+form.warehouseLineDO.destTitleZh+'】'" disabled />
</el-form-item>
<router-selector v-if="!form.id" v-model="selectedRoutes" />
<el-card style="margin-bottom: 10px">
<div slot="header" style="font-size:20px;">
价格设置
</div>
<el-form-item label="默认运费" prop="transportPrice">
<el-row :gutter="20">
<el-col :span="4">
<el-select v-model="form.transportPriceUnit">
<el-option v-for="currency in currencyList" :key="currency.id" :label="currency.titleZh" :value="currency.id" />
</el-select>
</el-col>
<el-col :span="6">
<el-input v-model.number="form.transportPrice" type="number" placeholder="整数或者两位小数"/>
</el-col>
<el-col :span="4">
<el-select v-model="form.transportVolumeUnit">
<el-option v-for="unit in unitList" :key="unit.id" :label="unit.titleZh" :value="unit.id" />
</el-select>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="默认清关费" prop="clearancePrice">
<el-row :gutter="20">
<el-col :span="4">
<el-select v-model="form.clearancePriceUnit">
<el-option v-for="currency in currencyList" :key="currency.id" :label="currency.titleZh" :value="currency.id" />
</el-select>
</el-col>
<el-col :span="6">
<el-input v-model.number="form.clearancePrice" type="number" placeholder="整数或者两位小数"/>
</el-col>
<el-col :span="4">
<el-select v-model="form.clearanceVolumeUnit">
<el-option v-for="unit in unitList" :key="unit.id" :label="unit.titleZh" :value="unit.id" />
</el-select>
</el-col>
</el-row>
</el-form-item>
<template v-for="(special, specialIndex) in this.specialProducts">
<el-form-item :label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + '运费'" :key="specialIndex + 'transport'">
<el-row :gutter="20">
<el-col :span="4">
<el-select v-model="special.transportPriceUnit">
<el-option v-for="currency in currencyList" :key="currency.id" :label="currency.titleZh" :value="currency.id" />
</el-select>
</el-col>
<el-col :span="6">
<el-input v-model.number="special.transportPrice" type="number" placeholder="整数或者两位小数"/>
</el-col>
<el-col :span="4">
<el-select v-model="special.transportVolumeUnit">
<el-option v-for="unit in unitList" :key="unit.id" :label="unit.titleZh" :value="unit.id" />
</el-select>
</el-col>
</el-row>
</el-form-item>
<el-form-item :label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + '清关费'" :key="specialIndex + 'clearance'">
<el-row :gutter="20">
<el-col :span="4">
<el-select v-model="special.clearancePriceUnit">
<el-option v-for="currency in currencyList" :key="currency.id" :label="currency.titleZh" :value="currency.id" />
</el-select>
</el-col>
<el-col :span="6">
<el-input v-model.number="special.clearancePrice" type="number" placeholder="整数或者两位小数"/>
</el-col>
<el-col :span="4">
<el-select v-model="special.clearanceVolumeUnit">
<el-option v-for="unit in unitList" :key="unit.id" :label="unit.titleZh" :value="unit.id" />
</el-select>
</el-col>
</el-row>
</el-form-item>
</template>
<el-form-item label="是否预付" prop="advanceStatus">
<dict-selector :type="DICT_TYPE.ADVANCE_STATUS" v-model="form.advanceStatus" />
<!-- <el-radio-group v-model="form.advanceStatus">
<el-radio v-for="advanceDict in advanceStatusDictDatas" :key="advanceDict.value" :label="parseInt(advanceDict.value)">{{advanceDict.label}}</el-radio>
</el-radio-group> -->
</el-form-item>
</el-card>
<el-card>
<div slot="header" style="font-size:20px;">
基础信息
</div>
<el-form-item label="需要预约入仓" prop="needBook">
<el-radio v-model.number="form.needBook" :label="1"></el-radio>
<el-radio v-model.number="form.needBook" :label="0"></el-radio>
</el-form-item>
<el-form-item label="每日入仓上限" prop="dayLimit">
<el-input v-model.number="form.dayLimit" type="number">
<template slot="append">立方米</template>
</el-input>
</el-form-item>
<el-form-item label="货柜位置" prop="containerLocation">
<!-- <el-select v-model="form.containerLocation" placeholder="选择货柜位置" clearable>
<el-option v-for="locationItem in locationList" :key="locationItem.value" :label="locationItem.label" :value="locationItem.value"/>
</el-select> -->
<dict-selector :type="DICT_TYPE.ECW_CONTAINER_LOCATION" v-model="form.containerLocation" />
</el-form-item>
<el-form-item label="方数要求" prop="square">
<el-input v-model.number="form.square" type="number">
<!-- <template slot="append">立方米</template> -->
</el-input>
</el-form-item>
</el-card>
</el-form>
<div style="margin: 20px 0">
<el-button @click="submitForm" type="primary">确认提交</el-button>
<el-button type="default" @click="$router.back">返回上一页</el-button>
</div>
</div>
</template>
<script>
import RouterSelector from '@/components/RouterSelector'
import { createProductPrice, updateProductPrice, deleteProductPrice, getProductPrice, getProductPricePage, exportProductPriceExcel } from "@/api/ecw/productPrice";
import { getProduct } from '@/api/ecw/product'
import { getProductType, getProductTypeList } from '@/api/ecw/productType'
import { getCurrencyList } from '@/api/ecw/currency';
import { getUnitList } from '@/api/ecw/unit';
import ProductSelector from '@/components/ProductSelector'
import {arrryToKeyedObjectBy} from '@/utils/index'
export default {
components: {RouterSelector, ProductSelector},
data(){
return {
selectedRoutes: [], // 勾选的路线渠道
form:{},
specialProducts: [],
// specialList:[], // 特殊需求,默认四个
rules: {
/* typeId: [{ required: true, message: "产品类型不能为空", trigger: "blur" }],
titleZh: [{ required: true, message: "产品名称不能为空", trigger: "blur" }],
titleEn: [{ required: true, message: "英文名称不能为空", trigger: "blur" }], */
transportPrice: [{ required: true, message: "海运费不能为空", trigger: "blur" }],
clearancePrice: [{ required: true, message: "清关费不能为空", trigger: "blur" }],
advanceStatus: [{ required: true, message: "是否预付不能为空", trigger: "blur" }],
containerLocation:[{ required: true, message: "货柜位置不能为空", trigger: "blur" }],
square:[{ required: true, message: "方数不能为空", trigger: "blur" }],
// zhongLinjie:[{ required: true, message: "默认重货标准不能为空", trigger: "blur" }],
// paoLinjie:[{ required: true, message: "默认泡货标准不能为空", trigger: "blur" }],
needBook:[{ required: true, message: "预约入仓不能为空", trigger: "blur" }],
},
product: null,
productType: null,
currencyList:[],
unitList:[],
productTypeList:[],
productDisabled: true
}
},
computed:{
},
watch:{
product(){
getProductType(this.product.typeId).then(res => {
this.productType = res.data
})
},
form(val){
if(!val)return
// 特殊需求回显
if(val.specialList){
let keyed = arrryToKeyedObjectBy(val.specialList, 'specialDictType')
console.log(keyed)
this.specialProducts.map((item, index) => {
if(keyed[item.specialDictType]){
for(let field in item){
if(keyed[item.specialDictType][field]){
item[field] = keyed[item.specialDictType][field]
}
}
}
/* clearancePric
clearancePriceUnit,
clearanceVolumeUnit,
specialDictType,
transportPrice,
transportPriceUnit,
transportVolumeUnit, */
})
}
}
},
created(){
// 修改回显
if(this.$route.query.id){
getProductPrice(this.$route.query.id).then(res => {
this.form = res.data
this.product = res.data.productDO
/* getProduct(res.data.productId).then(res => {
this.product = res.data
}) */
})
}
// 指定产品
else if(this.$route.query.product_id){
getProduct(this.$route.query.product_id).then(res => {
this.product = res.data
})
}
// 获取类型列表
else{
this.productDisabled = false
getProductTypeList().then(res => this.productTypeList = res.data)
}
getCurrencyList().then(res => this.currencyList = res.data)
getUnitList().then(res => this.unitList = res.data)
this.getDictDatas(this.DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS).forEach(item => {
console.log(item, this.getDictDataLabel(item.value))
this.specialProducts.push({
"clearancePrice": null,
"clearancePriceUnit": null,
"clearanceVolumeUnit": null,
"specialDictType": item.value,
"transportPrice": null,
"transportPriceUnit": null,
"transportVolumeUnit": null,
})
})
},
methods:{
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
// 只有新增的时候做判断
if(!this.form.id && (!this.selectedRoutes || !this.selectedRoutes.length)) {
this.$message.error('请选择线路');
return;
}
let data = Object.assign({}, this.form, {
// lineChannelList: this.selectedRoutes,
specialList: this.specialProducts
})
// 修改的提交
if (this.form.id != null) {
updateProductPrice(data).then(response => {
this.$modal.msgSuccess("修改成功");
this.$router.replace('/product/product-price')
});
return;
}
// 添加的提交
data.productId = this.product.id;
data.lineChannelList = this.lineChannelList
createProductPrice(data).then(response => {
this.$modal.msgSuccess("请求成功");
this.$router.replace('/product/product-price')
});
});
},
}
}
</script>
\ No newline at end of file
...@@ -2,24 +2,30 @@ ...@@ -2,24 +2,30 @@
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="始发地" prop="startCityId"> <el-form-item label="运输方式" prop="transportType">
<!-- <el-select v-model="queryParams.transportType" clearable>
<el-option v-for="dict in transportDatas" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select> -->
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportType" clearable />
</el-form-item>
<el-form-item label="始发地" prop="startCityId">
<el-select v-model="queryParams.startCityId" clearable> <el-select v-model="queryParams.startCityId" clearable>
<el-option v-for="city in startCityList" :key="city.id" :label="city.titleZh" :value="city.id" /> <el-option v-for="city in startCityList" :key="city.id" :label="city.titleZh" :value="city.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="目的地" prop="destCityId"> <el-form-item label="目的地" prop="destCityId">
<el-select v-model="queryParams.destCityId" clearable> <el-select v-model="queryParams.destCityId" clearable>
<el-option v-for="city in destCityList" :key="city.id" :label="city.titleZh" :value="city.id" /> <el-option v-for="city in destCityList" :key="city.id" :label="city.titleZh" :value="city.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="空运渠道" prop="shippingChannelId">
<el-form-item label="运输方式" prop="transportType"> <el-select v-model="queryParams.shippingChannelId" clearable>
<el-select v-model="queryParams.transportType" clearable> <el-option v-for="item in channelList" :key="item.id" :label="item.nameZh" :value="item.channelId" />
<el-option v-for="dict in transportDatas" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
...@@ -42,7 +48,7 @@ ...@@ -42,7 +48,7 @@
<!-- 列表 --> <!-- 列表 -->
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list">
<el-table-column label="序号" type="index" width="50" /> <el-table-column label="序号" prop="id" width="50" />
<el-table-column prop="tansportType" label="运输方式" align="center" width="100"> <el-table-column prop="tansportType" label="运输方式" align="center" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -51,7 +57,13 @@ ...@@ -51,7 +57,13 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="tansportType" label="出货渠道" align="center" width="100">
<template slot-scope="{row}">
<div>
{{ channelName(row.shippingChannelId) }}
</div>
</template>
</el-table-column>
<el-table-column prop="startDestTitle" label="始发地/目的地" align="center"> <el-table-column prop="startDestTitle" label="始发地/目的地" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
...@@ -291,10 +303,13 @@ import { getDictDatas, DICT_TYPE } from '@/utils/dict'; ...@@ -291,10 +303,13 @@ import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import { getCurrencyList } from '@/api/ecw/currency'; import { getCurrencyList } from '@/api/ecw/currency';
import { getUnitList } from '@/api/ecw/unit'; import { getUnitList } from '@/api/ecw/unit';
import { AuditStatusEnum} from '@/utils/constants' import { AuditStatusEnum} from '@/utils/constants'
import { getChannelList } from '@/api/ecw/channel';
import DictTag from '@/components/DictTag'
import {arrryToKeyedObjectBy} from '@/utils/index'
export default { export default {
name: "ProductPrice", name: "ProductPrice",
components: { components: {
DictTag
}, },
data() { data() {
return { return {
...@@ -305,7 +320,7 @@ export default { ...@@ -305,7 +320,7 @@ export default {
routedList: [], //已开头路线列表 routedList: [], //已开头路线列表
currecyList: [], //货币列表 currecyList: [], //货币列表
unitList: [], //单位列表 unitList: [], //单位列表
channelList:[] , // 渠道
routeParams:{}, //路线搜索条件 routeParams:{}, //路线搜索条件
isUpdate: false, //更新操作 isUpdate: false, //更新操作
...@@ -337,12 +352,14 @@ export default { ...@@ -337,12 +352,14 @@ export default {
pageSize: 10, pageSize: 10,
productId: null, productId: null,
warehouseLineId: null, warehouseLineId: null,
transportType: null,
transportPrice: null, transportPrice: null,
transportPriceUnit: null, transportPriceUnit: null,
transportVolumeUnit: null, transportVolumeUnit: null,
clearancePrice: null, clearancePrice: null,
clearancePriceUnit: null, clearancePriceUnit: null,
clearanceVolumeUnit: null, clearanceVolumeUnit: null,
shippingChannelId: null,
status: null, status: null,
}, },
// 表单参数 // 表单参数
...@@ -375,14 +392,23 @@ export default { ...@@ -375,14 +392,23 @@ export default {
}, },
computed: { computed: {
keyedChannel(){
return arrryToKeyedObjectBy(this.channelList, 'channelId')
},
channelName(){
return id => {
return this.keyedChannel[id] ? this.keyedChannel[id].nameZh : null
}
},
transportName() { transportName() {
return transportType => { return transportType => {
for(let index in this.transportDatas) { return this.getDictDataLabel(this.DICT_TYPE.ECW_TRANSPORT_TYPE, transportType)
/* for(let index in this.transportDatas) {
let transportItem = this.transportDatas[index]; let transportItem = this.transportDatas[index];
if(transportItem.value == transportType) { if(transportItem.value == transportType) {
return transportItem.label; return transportItem.label;
} }
} } */
} }
}, },
...@@ -444,7 +470,7 @@ export default { ...@@ -444,7 +470,7 @@ export default {
} else { } else {
this.getTypeList(); this.getTypeList();
} }
this.getChannelList()
this.getList(); this.getList();
//获取城市列表 //获取城市列表
this.getAllCityList(); this.getAllCityList();
...@@ -457,6 +483,9 @@ export default { ...@@ -457,6 +483,9 @@ export default {
methods: { methods: {
getChannelList(){
getChannelList().then(res => this.channelList = res.data)
},
/** 获取产品类型列表 */ /** 获取产品类型列表 */
getTypeList() { getTypeList() {
getProductTypeList().then(response => { getProductTypeList().then(response => {
...@@ -581,6 +610,8 @@ export default { ...@@ -581,6 +610,8 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
return this.$router.push('product-price/edit?' + (new URLSearchParams(this.$route.query)).toString())
this.reset(); this.reset();
this.routeParams = {}; this.routeParams = {};
this.getOpenedRouterList(); this.getOpenedRouterList();
...@@ -613,6 +644,7 @@ export default { ...@@ -613,6 +644,7 @@ export default {
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
return this.$router.push('product-price/edit?id=' + row.id)
this.reset(); this.reset();
const id = row.id; const id = row.id;
let lineId = row.warehouseLineId; let lineId = row.warehouseLineId;
......
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