Commit 77beeb39 authored by Marcus's avatar Marcus

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

parents 26cd01d1 70af7de0
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div slot="header" class="header"> <div slot="header" class="header">
<el-input v-model="queryParams.searchKey" placeholder="用户名/手机/邮箱" style="width:200px" /> <el-input v-model="queryParams.searchKey" placeholder="用户名/手机/邮箱" style="width:200px" />
<dict-selector :type="DICT_TYPE.USER_TYPE" v-model="queryParams.customerType" style="width:100px" /> <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>
<div class="list"> <div class="list">
<div class="item" v-for="item in list" :key="item.id"> <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 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<div class="filters mb-10"> <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> <el-select placeholder="请选择始发地" v-model="exportCity" clearable>
...@@ -13,6 +13,17 @@ ...@@ -13,6 +13,17 @@
<el-select placeholder="请选择目的地" v-model="importCity" clearable> <el-select placeholder="请选择目的地" v-model="importCity" clearable>
<el-option v-for="item in importCityList" :key="item.id" :label="item.titleZh" :value="item.id" /> <el-option v-for="item in importCityList" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select> </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> </div>
<el-row class="" :gutter="10"> <el-row class="" :gutter="10">
<template v-for="item in filteredRouterList"> <template v-for="item in filteredRouterList">
...@@ -22,17 +33,18 @@ ...@@ -22,17 +33,18 @@
{{item.label}} {{item.label}}
<el-link type="primary" @click.native="toggleHide(item.value)" style="float:right">{{item._hide ? '展开' : '折叠'}}</el-link> <el-link type="primary" @click.native="toggleHide(item.value)" style="float:right">{{item._hide ? '展开' : '折叠'}}</el-link>
</div> </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="startTitleZh" />
<el-table-column label="目的地" prop="destTitleZh" /> <el-table-column label="目的地" prop="destTitleZh" />
<el-table-column label="渠道" prop="startTitleZh"> <el-table-column label="渠道" prop="startTitleZh">
<template slot-scope="{row}"> <template slot-scope="{row}">
{{row.channel.nameZh}}11 {{row.channel.nameZh}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" prop=""> <el-table-column label="操作" prop="">
<template slot-scope="{row}"> <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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -56,47 +68,55 @@ export default { ...@@ -56,47 +68,55 @@ export default {
transportType: null, // 运输方式 transportType: null, // 运输方式
importCity: null, // 目的地(进口城市) importCity: null, // 目的地(进口城市)
exportCity: null, // 始发地(出口城市) exportCity: null, // 始发地(出口城市)
channelId: null,
selectedRoutes: [], // 勾选的路线渠道 selectedRoutes: [], // 勾选的路线渠道
hideMap: {}, // 折叠状态 hideMap: {}, // 折叠状态
checkAll: null,
} }
}, },
computed:{ computed:{
importCityList(){ importCityList(){
return this.tradeCityList.filter(item => item.type == 1) return this.tradeCityList.filter(item => item.type == 1)
}, },
exportCityList(){ exportCityList(){
return this.tradeCityList.filter(item => item.type == 2) return this.tradeCityList.filter(item => item.type == 2)
}, },
availChannelList(){
return this.channelList.filter(item => !this.channelId || this.channelId == item.channelId)
},
filteredRouterList(){ filteredRouterList(){
let transportTypeList = [] let transportTypeList = []
this.transportTypeDicts.forEach(item => { this.transportTypeDicts
if(this.transportType === null || this.transportType == '' || this.transportType == item.value){ .filter(transport => !this.channelId || transport.cssClass == 'channel')
let routerList = [] .forEach(item => {
this.openedRouterList.forEach(router => { if(this.transportType === null || this.transportType == '' || this.transportType == item.value){
if(router.transportType == item.value){ let routerList = []
routerList.push(Object.assign({ this.openedRouterList.forEach(router => {
_merge: item.cssClass == 'channel' ? this.channelList.length || 1 : 1, if(router.transportType == item.value){
channel: item.cssClass == 'channel' ? this.channelList[0] || {} : {}, routerList.push(Object.assign({
}, router)) _merge: item.cssClass == 'channel' ? this.availChannelList.length || 1 : 1,
// 字典的cssClass =channel则表示渠道相关(空运,海空联运) channel: item.cssClass == 'channel' ? this.availChannelList[0] || {} : {},
if(item.cssClass == 'channel'){ }, router)
this.channelList.slice(1).forEach(channel => { )
routerList.push(Object.assign({channel, _merge: 0}, router)) // 字典的cssClass =channel则表示渠道相关(空运,海空联运)
}) if(item.cssClass == 'channel'){
this.availChannelList.slice(1).forEach(channel => {
routerList.push(Object.assign({channel, _merge: 0}, router))
})
}
} }
} })
})
let child = { let child = {
label: item.label, label: item.label,
value: item.value, value: item.value,
_hide: false, // 是否折叠 _hide: false, // 是否折叠
routerList: routerList routerList: routerList
}
transportTypeList.push(child)
} }
transportTypeList.push(child) })
}
})
return transportTypeList return transportTypeList
} }
}, },
...@@ -109,9 +129,27 @@ export default { ...@@ -109,9 +129,27 @@ export default {
}, },
selectedRoutes(val){ selectedRoutes(val){
this.$emit('input', 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){ value(val){
this.selectedRoutes = 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(){ created(){
...@@ -139,7 +177,7 @@ export default { ...@@ -139,7 +177,7 @@ export default {
}, },
// 切换路线选择 // 切换路线选择
toggleChecker(router, selected){ toggleChecker(router, selected){
this.getSelectedIndex(router) // this.getSelectedIndex(router)
/* this.selectedRoutes.forEach((item, i)=>{ /* this.selectedRoutes.forEach((item, i)=>{
if(item.lineId == router.id && item.shippingChannelId == item.channel.id){ if(item.lineId == router.id && item.shippingChannelId == item.channel.id){
index = i index = i
...@@ -153,21 +191,25 @@ export default { ...@@ -153,21 +191,25 @@ export default {
}) })
}else{ }else{
let index = this.getSelectedIndex(router) let index = this.getSelectedIndex(router)
if(index !== null){ if(index > -1){
this.selectedRoutes.splice(index, 1) this.selectedRoutes.splice(index, 1)
} }
} }
}, },
getSelectedIndex(router){ 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)=>{ this.selectedRoutes.forEach((item, i)=>{
if(item.lineId == router.id && item.shippingChannelId == router.channel.channelId){ if(item.lineId == router.id && item.shippingChannelId == router.channel.channelId){
index = i index = i
// break // break
} }
}) })
return index return index */
}, },
SpanMethod({ row, column, rowIndex, columnIndex }){ SpanMethod({ row, column, rowIndex, columnIndex }){
if (columnIndex < 2 ) { if (columnIndex < 2 ) {
......
...@@ -138,7 +138,7 @@ import { ...@@ -138,7 +138,7 @@ import {
exportChannelExcel, exportChannelExcel,
} from "@/api/ecw/channel"; } from "@/api/ecw/channel";
import {getWarehouseList} from '@/api/ecw/warehouse' import {getWarehouseList} from '@/api/ecw/warehouse'
import {getExpressList} from '@/api/ecw/express' import {getExpressPage} from '@/api/ecw/express'
export default { export default {
data() { data() {
return { return {
...@@ -166,8 +166,8 @@ export default { ...@@ -166,8 +166,8 @@ export default {
await getWarehouseList().then(res => { await getWarehouseList().then(res => {
this.warehouseList = res.data this.warehouseList = res.data
}) })
await getExpressList().then(res => { await getExpressPage({pageSize: 1000}).then(res => {
this.expressList = res.data this.expressList = res.data.list
}) })
if (this.$route.query.id) { if (this.$route.query.id) {
......
...@@ -39,37 +39,99 @@ ...@@ -39,37 +39,99 @@
/> />
注意:留空则表示永久有效 注意:留空则表示永久有效
</el-form-item> </el-form-item>
<el-form-item label="*运费"> <!--1:优惠卷 2:金额-满减 3:方数-满减 4 折扣 5优惠 6 特价 7区间价-->
<el-form-item label="优惠券金额" v-if="form.type == 1">
<div class="fee-item">
<el-input v-model="form.reduceAmount" style="width:100px" />
<Selector v-model="form.reduceCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<span></span>
<el-input type="number" v-model="form.cashCondition" style="width:100px" />
<span>使用</span>
<span style="color:red">注意:留空则表示不受满金额限制</span>
</div>
</el-form-item>
<el-form-item label="*运费" v-if="[2,3,4,5,6,7].indexOf(form.type) > -1">
<div class="fee-item" v-for="(item, index) in freightFeeList" :key="index"> <div class="fee-item" v-for="(item, index) in freightFeeList" :key="index">
<template v-if="[1,2,3,4,5].indexOf(form.type) > -1">
<el-input v-model="item.fullAmount" style="width:100px" />
<!-- <el-select v-model="item.fullCurrencyId" style="width:100px" > <el-input v-model="item.fullAmount" style="width:100px" />
<el-option v-for="item in currencyList" :key="item.id" :label="item.titleZh" :value="item.id" /> <!-- <el-select v-model="item.fullCurrencyId" style="width:100px" >
</el-select> --> <el-option v-for="item in currencyList" :key="item.id" :label="item.titleZh" :value="item.id" />
<Selector v-model="item.fullCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" /> </el-select> -->
<Selector v-if="[2,4,5].indexOf(form.type) > -1" v-model="item.fullCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<el-input type="number" v-model="item.reduceAmount" style="width:100px" /> <Selector v-if="form.type == 3" v-model="item.prodUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<!-- <el-select v-model="item.reduceCurrencyId" style="width:100px" >
<el-option v-for="item in currencyList" :key="item.id" :label="item.titleZh" :value="item.id" /> <span v-if="[2].indexOf(form.type) > -1"></span>
</el-select> --> <span v-if="[4].indexOf(form.type) > -1">折扣率</span>
<Selector v-model="item.fullCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<span v-if="[5].indexOf(form.type) > -1"></span>
<el-input v-if="[2,3,4].indexOf(form.type) > -1" type="number" v-model="item.reduceAmount" style="width:100px" />
<Selector v-if="[2,3].indexOf(form.type) > -1" v-model="item.fullCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<span v-if="[4].indexOf(form.type) > -1">%</span>
</template>
<template v-if="form.type==7">
> <el-input v-model="item.startAmount" style="width:100px" />
<el-input v-model="item.endAmount" style="width:100px" />
<Selector v-model="item.startAndEndCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
价格
</template>
<el-input v-if="[5,6,7].indexOf(form.type) > -1" type="number" v-model="item.netReceiptsAmount" style="width:100px" />
<Selector v-if="[5,6,7].indexOf(form.type) > -1" v-model="item.netReceiptsCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<template v-if="form.type == 6">
/
<Selector v-model="item.prodUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
</template>
<el-button class="el-icon-plus" size="mini" type="primary" @click="freightFeeList.push({})" /> <el-button class="el-icon-plus" size="mini" type="primary" @click="freightFeeList.push({})" />
<el-button v-if="freightFeeList.length > 1" class="el-icon-minus" size="mini" type="danger" @click="freightFeeList.splice(index,1)" /> <el-button v-if="freightFeeList.length > 1" class="el-icon-minus" size="mini" type="danger" @click="freightFeeList.splice(index,1)" />
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="清关费"> <el-form-item label="清关费" v-if="[2,3,4,5,6,7].indexOf(form.type) > -1">
<div class="fee-item" v-for="(item, index) in clearanceFeeList" :key="index"> <div class="fee-item" v-for="(item, index) in clearanceFeeList" :key="index">
<template v-if="[1,2,3,4,5].indexOf(form.type) > -1">
<el-input v-model="item.fullAmount" style="width:100px" />
<Selector v-model="item.fullCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" /> <el-input v-model="item.fullAmount" style="width:100px" />
<Selector v-if="[2,4,5].indexOf(form.type) > -1" v-model="item.fullCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<el-input v-model="item.reduceAmount" style="width:100px" /> <Selector v-if="form.type == 3" v-model="item.prodUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<Selector v-model="item.fullCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<el-button class="el-icon-plus" size="mini" type="primary" @click="clearanceFeeList.push({})" /> <span v-if="[2].indexOf(form.type) > -1"></span>
<el-button v-if="clearanceFeeList.length > 1" class="el-icon-minus" size="mini" type="danger" @click="clearanceFeeList.splice(index,1)" /> <span v-if="[4].indexOf(form.type) > -1">折扣率</span>
<span v-if="[5].indexOf(form.type) > -1"></span>
<el-input v-if="[2,3,4].indexOf(form.type) > -1" type="number" v-model="item.reduceAmount" style="width:100px" />
<Selector v-if="[2,3].indexOf(form.type) > -1" v-model="item.fullCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<span v-if="[4].indexOf(form.type) > -1">%</span>
</template>
<template v-if="form.type==7">
> <el-input v-model="item.startAmount" style="width:100px" />
<el-input v-model="item.endAmount" style="width:100px" />
<Selector v-model="item.startAndEndCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
价格
</template>
<el-input v-if="[5,6,7].indexOf(form.type) > -1" type="number" v-model="item.netReceiptsAmount" style="width:100px" />
<Selector v-if="[5,6,7].indexOf(form.type) > -1" v-model="item.netReceiptsCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<template v-if="form.type == 6">
/
<Selector v-model="item.prodUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
</template>
<el-button class="el-icon-plus" size="mini" type="primary" @click="freightFeeList.push({})" />
<el-button v-if="freightFeeList.length > 1" class="el-icon-minus" size="mini" type="danger" @click="freightFeeList.splice(index,1)" />
</div> </div>
</el-form-item> </el-form-item>
...@@ -139,15 +201,17 @@ ...@@ -139,15 +201,17 @@
<el-form-item <el-form-item
label="同类叠加" label="同类叠加"
prop="isSimilarSuperposition" prop="isSimilarSuperposition"
v-if="form.type != 1"
> >
<dict-selector <dict-selector
:type="DICT_TYPE.INFRA_BOOLEAN_STRING" form-type="radio"
:type="DICT_TYPE.ECW_YESNO"
v-model="form.isSimilarSuperposition" v-model="form.isSimilarSuperposition"
placeholder="请选择类型" placeholder="请选择类型"
/> />
</el-form-item> </el-form-item>
<el-form-item label="可叠加优惠劵列表" prop="couponIds"> <el-form-item label="可叠加优惠劵列表" prop="couponIds" v-if="form.type != 1">
<el-input <el-input
v-model="form.couponIds" v-model="form.couponIds"
placeholder="请输入可叠加优惠劵列表" placeholder="请输入可叠加优惠劵列表"
...@@ -164,6 +228,7 @@ ...@@ -164,6 +228,7 @@
<el-form-item <el-form-item
label="适用线路类型" label="适用线路类型"
prop="suitableLineType" prop="suitableLineType"
v-if="form.type != 1"
> >
<dict-selector :type="DICT_TYPE.ECW_SUITABLE_LINE_TYPE" v-model="form.suitableLineType" /> <dict-selector :type="DICT_TYPE.ECW_SUITABLE_LINE_TYPE" v-model="form.suitableLineType" />
<routers-selector v-if="showRouterSelector" v-model="form.lineIds" style="margin-top:5px" /> <routers-selector v-if="showRouterSelector" v-model="form.lineIds" style="margin-top:5px" />
...@@ -171,6 +236,7 @@ ...@@ -171,6 +236,7 @@
<el-form-item <el-form-item
label="适用商品" label="适用商品"
prop="prodIds" prop="prodIds"
v-if="form.type != 1"
> >
<!-- <dict-selector :type="DICT_TYPE.ECW_SUITABLE_PROD_TYPE" v-model="form.suitableProdType" /> --> <!-- <dict-selector :type="DICT_TYPE.ECW_SUITABLE_PROD_TYPE" v-model="form.suitableProdType" /> -->
<products-selector v-model="form.prodIds" /> <products-selector v-model="form.prodIds" />
...@@ -178,33 +244,37 @@ ...@@ -178,33 +244,37 @@
<el-form-item <el-form-item
label="订单属性" label="订单属性"
prop="orderAttr" prop="orderAttr"
v-if="form.type != 1"
> >
<dict-selector form-type="checkbox" :type="DICT_TYPE.ECW_ORDER_ATTR" v-model="form.orderAttr" multiple /> <dict-selector form-type="checkbox" :type="DICT_TYPE.ECW_ORDER_ATTR" v-model="form.orderAttr" multiple />
</el-form-item> </el-form-item>
<el-form-item label="是否发送站内信" prop="isSiteContent"> <el-form-item label="是否发送站内信" prop="isSiteContent">
<dict-selector form-type="radio" :type="DICT_TYPE.ECW_YESNO" v-model="form.isSiteContent" /> <dict-selector form-type="radio" :type="DICT_TYPE.ECW_YESNO" v-model="form.isSiteContent" />
</el-form-item> </el-form-item>
<el-form-item label="*中文内容" prop="contentZh" :rules='[{required: true, message: "不能为空"}]'> <el-form-item label="中文内容" prop="contentZh" :rules='[{required: true, message: "不能为空"}]'>
<editor v-model="form.contentZh" :min-height="192" /> <editor v-model="form.contentZh" :min-height="192" />
</el-form-item> </el-form-item>
<el-form-item label="*英文内容" prop="contentEn" :rules='[{required: true, message: "不能为空"}]'> <el-form-item label="英文内容" prop="contentEn" :rules='[{required: true, message: "不能为空"}]'>
<editor v-model="form.contentEn" :min-height="192" /> <editor v-model="form.contentEn" :min-height="192" />
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="品牌" label="品牌"
prop="brand" prop="brand"
v-if="form.type != 1"
> >
<dict-selector form-type="checkbox" :type="DICT_TYPE.BRAND_REG_TYPE" v-model="form.brand" multiple /> <dict-selector form-type="checkbox" :type="DICT_TYPE.BRAND_REG_TYPE" v-model="form.brand" multiple />
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="是否控货" label="是否控货"
prop="isCargoControl" prop="isCargoControl"
v-if="form.type != 1"
> >
<dict-selector form-type="checkbox" :type="DICT_TYPE.ECW_YESNO" v-model="form.isCargoControl" multiple /> <dict-selector form-type="checkbox" :type="DICT_TYPE.ECW_YESNO" v-model="form.isCargoControl" multiple />
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="单证报关" label="单证报关"
prop="documentDeclaration" prop="documentDeclaration"
v-if="form.type != 1"
> >
<dict-selector form-type="checkbox" :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="form.documentDeclaration" multiple /> <dict-selector form-type="checkbox" :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="form.documentDeclaration" multiple />
</el-form-item> </el-form-item>
...@@ -274,6 +344,7 @@ ...@@ -274,6 +344,7 @@
</template> </template>
<script> <script>
import { getCurrencyList } from '@/api/ecw/currency'; import { getCurrencyList } from '@/api/ecw/currency';
import { getUnitList } from '@/api/ecw/unit';
import { import {
createCoupon, createCoupon,
updateCoupon, updateCoupon,
...@@ -288,6 +359,7 @@ import RoutersSelector from '@/components/RoutersSelector' ...@@ -288,6 +359,7 @@ import RoutersSelector from '@/components/RoutersSelector'
import ProductsSelector from '@/components/ProductsSelector' import ProductsSelector from '@/components/ProductsSelector'
import Editor from '@/components/Editor' import Editor from '@/components/Editor'
import Selector from '@/components/Selector' import Selector from '@/components/Selector'
export default { export default {
name: "CouponEdit", name: "CouponEdit",
components: {CustomersSelector, RoutersSelector, ProductsSelector, Editor, Selector}, components: {CustomersSelector, RoutersSelector, ProductsSelector, Editor, Selector},
...@@ -303,7 +375,9 @@ export default { ...@@ -303,7 +375,9 @@ export default {
rules: {}, rules: {},
currencyList:[], currencyList:[],
clearanceFeeList:[{},{}], clearanceFeeList:[{},{}],
freightFeeList:[{},{}] freightFeeList:[{},{}],
discountList:[{}], // 优惠券固定一条
unitList:[]
}; };
}, },
computed:{ computed:{
...@@ -334,21 +408,31 @@ export default { ...@@ -334,21 +408,31 @@ export default {
}) })
let discountedList = activeField ? this[activeField] : [] let discountedList = activeField ? this[activeField] : []
discountedList.forEach(item => { discountedList.forEach(item => {
['endAmount', [
'fullAmount', 'endAmount',
'fullCurrencyId', 'fullAmount',
'netReceiptsAmount', 'fullCurrencyId',
'netReceiptsCurrencyId', 'netReceiptsAmount',
'prodUnit', 'netReceiptsCurrencyId',
'reduceAmount', 'prodUnit',
'reduceCurrencyId', 'reduceAmount',
'startAmount', 'reduceCurrencyId',
'startAndEndCurrencyId'].forEach(field => { 'startAmount',
'startAndEndCurrencyId'
].forEach(field => {
if(item[field])item[field] = parseFloat(item[field]) if(item[field])item[field] = parseFloat(item[field])
}) })
}) })
return discountedList return discountedList
} }
},
watch:{
'form.type'(val){
// 方数满减3和特价6需要单位
if((val == 3 || val == 6) && !this.unitList.length){
this.getUnitList()
}
}
}, },
created() { created() {
getCurrencyList().then(res => this.currencyList = res.data) getCurrencyList().then(res => this.currencyList = res.data)
...@@ -360,6 +444,10 @@ export default { ...@@ -360,6 +444,10 @@ export default {
this.reset() this.reset()
}, },
methods: { methods: {
getUnitList(){
getUnitList().then(res => this.unitList = res.data)
},
/** 表单重置 */ /** 表单重置 */
reset() { reset() {
this.form = { this.form = {
......
...@@ -28,38 +28,42 @@ ...@@ -28,38 +28,42 @@
<el-form-item label="默认运费" prop="transportPrice"> <el-form-item label="默认运费" prop="transportPrice">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="4"> <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-option v-for="currency in currencyList" :key="currency.id" :label="currency.titleZh" :value="currency.id" />
</el-select> </el-select> -->
</el-col> </el-col>
<el-col :span="6"> <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>
<el-col :span="4"> <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-option v-for="unit in unitList" :key="unit.id" :label="unit.titleZh" :value="unit.id" />
</el-select> </el-select> -->
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-form-item label="默认清关费" prop="clearancePrice"> <el-form-item label="默认清关费" prop="clearancePrice">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="4"> <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-option v-for="currency in currencyList" :key="currency.id" :label="currency.titleZh" :value="currency.id" />
</el-select> </el-select> -->
</el-col> </el-col>
<el-col :span="6"> <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>
<el-col :span="4"> <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-option v-for="unit in unitList" :key="unit.id" :label="unit.titleZh" :value="unit.id" />
</el-select> </el-select> -->
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
...@@ -68,38 +72,43 @@ ...@@ -68,38 +72,43 @@
<el-form-item :label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + '运费'" :key="specialIndex + 'transport'"> <el-form-item :label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + '运费'" :key="specialIndex + 'transport'">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="4"> <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-option v-for="currency in currencyList" :key="currency.id" :label="currency.titleZh" :value="currency.id" />
</el-select> </el-select> -->
</el-col> </el-col>
<el-col :span="6"> <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>
<el-col :span="4"> <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-option v-for="unit in unitList" :key="unit.id" :label="unit.titleZh" :value="unit.id" />
</el-select> </el-select> -->
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-form-item :label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + '清关费'" :key="specialIndex + 'clearance'"> <el-form-item :label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + '清关费'" :key="specialIndex + 'clearance'">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="4"> <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-option v-for="currency in currencyList" :key="currency.id" :label="currency.titleZh" :value="currency.id" />
</el-select> </el-select> -->
</el-col> </el-col>
<el-col :span="6"> <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>
<el-col :span="4"> <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-option v-for="unit in unitList" :key="unit.id" :label="unit.titleZh" :value="unit.id" />
</el-select> </el-select> -->
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
...@@ -107,7 +116,7 @@ ...@@ -107,7 +116,7 @@
<el-form-item label="是否预付" prop="advanceStatus"> <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-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 v-for="advanceDict in advanceStatusDictDatas" :key="advanceDict.value" :label="parseInt(advanceDict.value)">{{advanceDict.label}}</el-radio>
</el-radio-group> --> </el-radio-group> -->
...@@ -126,9 +135,7 @@ ...@@ -126,9 +135,7 @@
</el-form-item> </el-form-item>
<el-form-item label="每日入仓上限" prop="dayLimit"> <el-form-item label="每日入仓上限" prop="dayLimit">
<el-input v-model.number="form.dayLimit" type="number"> <el-input v-model.number="form.dayLimit" type="number" style="width:100px" />立方米
<template slot="append">立方米</template>
</el-input>
</el-form-item> </el-form-item>
<el-form-item label="货柜位置" prop="containerLocation"> <el-form-item label="货柜位置" prop="containerLocation">
...@@ -139,9 +146,7 @@ ...@@ -139,9 +146,7 @@
</el-form-item> </el-form-item>
<el-form-item label="方数要求" prop="square"> <el-form-item label="方数要求" prop="square">
<el-input v-model.number="form.square" type="number"> <el-input v-model.number="form.square" type="number" style="width:200px" />
<!-- <template slot="append">立方米</template> -->
</el-input>
</el-form-item> </el-form-item>
</el-card> </el-card>
...@@ -163,8 +168,11 @@ import { getCurrencyList } from '@/api/ecw/currency'; ...@@ -163,8 +168,11 @@ import { getCurrencyList } from '@/api/ecw/currency';
import { getUnitList } from '@/api/ecw/unit'; import { getUnitList } from '@/api/ecw/unit';
import ProductSelector from '@/components/ProductSelector' import ProductSelector from '@/components/ProductSelector'
import {arrryToKeyedObjectBy} from '@/utils/index' import {arrryToKeyedObjectBy} from '@/utils/index'
import Selector from '@/components/Selector'
import Inputor from '@/components/Inputor'
export default { export default {
components: {RoutersSelector, ProductSelector}, components: {RoutersSelector, ProductSelector, Selector, Inputor},
data(){ data(){
return { return {
selectedRoutes: [], // 勾选的路线渠道 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