Commit 77beeb39 authored by Marcus's avatar Marcus

Merge remote-tracking branch 'origin/dev' into dev

parents 26cd01d1 70af7de0
......@@ -5,7 +5,7 @@
<div slot="header" class="header">
<el-input v-model="queryParams.searchKey" placeholder="用户名/手机/邮箱" style="width:200px" />
<dict-selector :type="DICT_TYPE.USER_TYPE" v-model="queryParams.customerType" style="width:100px" />
<el-button type="primary" @click="reLoad">搜1</el-button>
<el-button type="primary" @click="reLoad"></el-button>
</div>
<div class="list">
<div class="item" v-for="item in list" :key="item.id">
......
<template>
<el-input v-model="valueSync" :type="type" :clearable="clearable" :placeholder="placeholder" />
</template>
<script>
export default {
data(){
return {
valueSync: null
}
},
props:{
type: String,
value: [String, Number],
clearable: Boolean,
placeholder: String,
default: String, // 默认值
},
computed:{
},
watch:{
valueSync(val){
this.$emit('input', val)
},
value(value){
this.valueSync = value
this.setDefault()
}
},
created(){
this.valueSync = this.value
this.setDefault()
},
methods:{
setDefault(){
if(!this.default){
return false
}
if(this.valueSync == null || this.valueSync == ''){
this.valueSync = this.default
}
}
}
}
</script>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<div>
<div class="filters mb-10">
运输方式
<dict-selector :type='DICT_TYPE.ECW_TRANSPORT_TYPE' v-model="transportType" placeholder="请选择运输方式" />
<dict-selector :type='DICT_TYPE.ECW_TRANSPORT_TYPE' v-model="transportType" placeholder="请选择运输方式" style="width:150px" />
始发地:
<el-select placeholder="请选择始发地" v-model="exportCity" clearable>
......@@ -13,6 +13,17 @@
<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>
出货渠道:
<el-select placeholder="请选择目渠道" v-model="channelId" clearable>
<el-option v-for="item in channelList" :key="item.channelId" :label="item.nameZh" :value="item.channelId" />
</el-select>
</div>
<div class="mb-10">
<el-radio-group v-model="checkAll">
<el-radio :label="true">全选</el-radio>
<el-radio :label="false">全不选</el-radio>
</el-radio-group>
</div>
<el-row class="" :gutter="10">
<template v-for="item in filteredRouterList">
......@@ -22,17 +33,18 @@
{{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>
<!--table需要给一个key,否则全选的时候不会自动更新渲染-->
<el-table v-if="!hideMap[item.value]" :data="item.routerList" :span-method="SpanMethod" border :key="selectedRoutes.length + item.value">
<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
{{row.channel.nameZh}}
</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>
<el-checkbox :checked="getSelectedIndex(row) > -1" @change="toggleChecker(row, $event)"></el-checkbox>
</template>
</el-table-column>
</el-table>
......@@ -56,31 +68,40 @@ export default {
transportType: null, // 运输方式
importCity: null, // 目的地(进口城市)
exportCity: null, // 始发地(出口城市)
channelId: null,
selectedRoutes: [], // 勾选的路线渠道
hideMap: {}, // 折叠状态
checkAll: null,
}
},
computed:{
importCityList(){
return this.tradeCityList.filter(item => item.type == 1)
},
exportCityList(){
return this.tradeCityList.filter(item => item.type == 2)
},
availChannelList(){
return this.channelList.filter(item => !this.channelId || this.channelId == item.channelId)
},
filteredRouterList(){
let transportTypeList = []
this.transportTypeDicts.forEach(item => {
this.transportTypeDicts
.filter(transport => !this.channelId || transport.cssClass == 'channel')
.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))
_merge: item.cssClass == 'channel' ? this.availChannelList.length || 1 : 1,
channel: item.cssClass == 'channel' ? this.availChannelList[0] || {} : {},
}, router)
)
// 字典的cssClass =channel则表示渠道相关(空运,海空联运)
if(item.cssClass == 'channel'){
this.channelList.slice(1).forEach(channel => {
this.availChannelList.slice(1).forEach(channel => {
routerList.push(Object.assign({channel, _merge: 0}, router))
})
}
......@@ -95,7 +116,6 @@ export default {
}
transportTypeList.push(child)
}
})
return transportTypeList
}
......@@ -109,9 +129,27 @@ export default {
},
selectedRoutes(val){
this.$emit('input', val)
// 如果选择发生变化
let total = 0
this.filteredRouterList.forEach(item => {
total += item.routerList.length
})
if(total != val.length && val.length){
this.checkAll = null
}
},
value(val){
this.selectedRoutes = val || []
},
checkAll(val){
if(val === true || val === false){
console.log('选中全部')
this.filteredRouterList.forEach(item => {
item.routerList.forEach(router => {
if(this.getSelectedIndex(router) > -1 != val )this.toggleChecker(router, val)
})
})
}
}
},
created(){
......@@ -139,7 +177,7 @@ export default {
},
// 切换路线选择
toggleChecker(router, selected){
this.getSelectedIndex(router)
// this.getSelectedIndex(router)
/* this.selectedRoutes.forEach((item, i)=>{
if(item.lineId == router.id && item.shippingChannelId == item.channel.id){
index = i
......@@ -153,21 +191,25 @@ export default {
})
}else{
let index = this.getSelectedIndex(router)
if(index !== null){
if(index > -1){
this.selectedRoutes.splice(index, 1)
}
}
},
getSelectedIndex(router){
let index = null
return this.selectedRoutes.findIndex(item => {
return item.lineId == router.id && item.shippingChannelId == router.channel.channelId
})
/* let index = null
this.selectedRoutes.forEach((item, i)=>{
if(item.lineId == router.id && item.shippingChannelId == router.channel.channelId){
index = i
// break
}
})
return index
return index */
},
SpanMethod({ row, column, rowIndex, columnIndex }){
if (columnIndex < 2 ) {
......
......@@ -138,7 +138,7 @@ import {
exportChannelExcel,
} from "@/api/ecw/channel";
import {getWarehouseList} from '@/api/ecw/warehouse'
import {getExpressList} from '@/api/ecw/express'
import {getExpressPage} from '@/api/ecw/express'
export default {
data() {
return {
......@@ -166,8 +166,8 @@ export default {
await getWarehouseList().then(res => {
this.warehouseList = res.data
})
await getExpressList().then(res => {
this.expressList = res.data
await getExpressPage({pageSize: 1000}).then(res => {
this.expressList = res.data.list
})
if (this.$route.query.id) {
......
This diff is collapsed.
......@@ -28,38 +28,42 @@
<el-form-item label="默认运费" prop="transportPrice">
<el-row :gutter="20">
<el-col :span="4">
<el-select v-model="form.transportPriceUnit">
<selector v-model="form.transportPriceUnit" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<!-- <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-select> -->
</el-col>
<el-col :span="6">
<el-input v-model.number="form.transportPrice" type="number" placeholder="整数或者两位小数"/>
<inputor default="0" v-model.number="form.transportPrice" type="number" placeholder="整数或者两位小数"/>
</el-col>
<el-col :span="4">
<el-select v-model="form.transportVolumeUnit">
/ <selector v-model="form.transportVolumeUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<!-- <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-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">
<selector v-model="form.clearancePriceUnit" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<!-- <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-select> -->
</el-col>
<el-col :span="6">
<el-input v-model.number="form.clearancePrice" type="number" placeholder="整数或者两位小数"/>
<inputor default="0" v-model.number="form.clearancePrice" type="number" placeholder="整数或者两位小数"/>
</el-col>
<el-col :span="4">
<el-select v-model="form.clearanceVolumeUnit">
/ <selector v-model="form.clearanceVolumeUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<!-- <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-select> -->
</el-col>
</el-row>
</el-form-item>
......@@ -68,38 +72,43 @@
<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">
<selector v-model="special.transportPriceUnit" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<!-- <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-select> -->
</el-col>
<el-col :span="6">
<el-input v-model.number="special.transportPrice" type="number" placeholder="整数或者两位小数"/>
<inputor default="0" v-model.number="special.transportPrice" type="number" placeholder="整数或者两位小数" />
</el-col>
<el-col :span="4">
<el-select v-model="special.transportVolumeUnit">
/ <selector v-model="special.transportVolumeUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<!-- <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-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">
<selector v-model="special.clearancePriceUnit" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<!-- <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-select> -->
</el-col>
<el-col :span="6">
<el-input v-model.number="special.clearancePrice" type="number" placeholder="整数或者两位小数"/>
<inputor default="0" v-model.number="special.clearancePrice" type="number" placeholder="整数或者两位小数"/>
</el-col>
<el-col :span="4">
<el-select v-model="special.clearanceVolumeUnit">
/ <selector v-model="special.clearanceVolumeUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<!-- <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-select> -->
</el-col>
</el-row>
</el-form-item>
......@@ -107,7 +116,7 @@
<el-form-item label="是否预付" prop="advanceStatus">
<dict-selector :type="DICT_TYPE.ADVANCE_STATUS" v-model="form.advanceStatus" />
<dict-selector form-type="radio" :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> -->
......@@ -126,9 +135,7 @@
</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-input v-model.number="form.dayLimit" type="number" style="width:100px" />立方米
</el-form-item>
<el-form-item label="货柜位置" prop="containerLocation">
......@@ -139,9 +146,7 @@
</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-input v-model.number="form.square" type="number" style="width:200px" />
</el-form-item>
</el-card>
......@@ -163,8 +168,11 @@ import { getCurrencyList } from '@/api/ecw/currency';
import { getUnitList } from '@/api/ecw/unit';
import ProductSelector from '@/components/ProductSelector'
import {arrryToKeyedObjectBy} from '@/utils/index'
import Selector from '@/components/Selector'
import Inputor from '@/components/Inputor'
export default {
components: {RoutersSelector, ProductSelector},
components: {RoutersSelector, ProductSelector, Selector, Inputor},
data(){
return {
selectedRoutes: [], // 勾选的路线渠道
......
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