Commit a4a3fcd6 authored by dragondean@qq.com's avatar dragondean@qq.com

添加出货安排增加目的国字段

parent c7457e61
...@@ -7,21 +7,26 @@ ...@@ -7,21 +7,26 @@
<el-radio v-for="dict in transportTypes" :key="dict.value" :label="dict.value">{{$l(dict, 'label')}}</el-radio> <el-radio v-for="dict in transportTypes" :key="dict.value" :label="dict.value">{{$l(dict, 'label')}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的国')" prop="destCountryId">
<el-select v-model="form.destCountryId" clearable>
<el-option v-for="item in tradeCountryList" :key="item.id" :label="$l(item, 'title')" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('出货渠道')" prop="shippingChannelId"> <el-form-item :label="$t('出货渠道')" prop="shippingChannelId">
<el-select v-model="form.shippingChannelId" :placeholder="$t('请选择出货渠道')"> <el-select v-model="form.shippingChannelId" :placeholder="$t('请选择出货渠道')" clearable>
<el-option v-for="item in channelList" :label="$l(item, 'name')" :value="item.channelId" :key="item.channelId"></el-option> <el-option v-for="item in filteredChannelList" :label="$l(item, 'name')" :value="item.channelId" :key="item.channelId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('始发地')" prop="startWarehouseId"> <el-form-item :label="$t('始发地')" prop="startWarehouseId">
<el-select v-model="form.startWarehouseId" :placeholder="$t('请选择始发地')"> <el-select v-model="form.startWarehouseId" :placeholder="$t('请选择始发地')" clearable>
<el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option> <el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的地')" prop="destWarehouseId"> <el-form-item :label="$t('目的地')" prop="destWarehouseId">
<el-select v-model="form.destWarehouseId" :placeholder="$t('请选择目的地')"> <el-select v-model="form.destWarehouseId" :placeholder="$t('请选择目的地')" clearable>
<el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option> <el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -73,6 +78,7 @@ ...@@ -73,6 +78,7 @@
<script> <script>
import { createbox, updatebox } from "@/api/ecw/boxAir"; import { createbox, updatebox } from "@/api/ecw/boxAir";
import { getChannelList } from '@/api/ecw/channel' import { getChannelList } from '@/api/ecw/channel'
import { getTradeCountryList } from '@/api/ecw/region'
export default { export default {
name: "editAirForm", name: "editAirForm",
...@@ -91,11 +97,14 @@ export default { ...@@ -91,11 +97,14 @@ export default {
this.form.destinationClearanceSelect = 3 this.form.destinationClearanceSelect = 3
} }
this.getChannelList() this.getChannelList()
this.getTradeCountry()
}, },
data() { data() {
return { return {
// 表单参数 // 表单参数
form: { }, form: {
destCountryId: undefined
},
channelList: [], channelList: [],
// 表单校验 // 表单校验
rules: { rules: {
...@@ -108,19 +117,38 @@ export default { ...@@ -108,19 +117,38 @@ export default {
destWarehouseId: [ destWarehouseId: [
{ required: true, message: this.$t('目的地不能为空'), trigger: 'blur' } { required: true, message: this.$t('目的地不能为空'), trigger: 'blur' }
] ]
} },
tradeCountryList:[]
}; };
}, },
watch:{ watch:{
'form.destinationClearanceSelect'(){ 'form.destinationClearanceSelect'(){
if(!this.form.destinationClearance){ if(!this.form.destinationClearance){
this.$set(this.form, 'destinationClearance', 1) this.$set(this.form, 'destinationClearance', 1)
} }
},
'form.destCountryId'(){
this.getChannelList()
},
'form.shippingChannelId'(){
let channel = this.channelList.find(item => item.channelId == this.form.shippingChannelId)
if(channel){
this.$set(this.form, 'destCountryId', channel.countryId)
} }
}, },
'form.destWarehouseId'(){
let city = this.importWarehouseList.find(item => item.id == this.form.destWarehouseId)
if(city){
this.form.destCountryId = city.guojia
}
}
},
methods: { methods: {
async getTradeCountry(){
this.tradeCountryList = (await getTradeCountryList()).data
},
getChannelList() { getChannelList() {
getChannelList().then((res) => (this.channelList = res.data)) getChannelList({}).then((res) => (this.channelList = res.data))
}, },
/*destinationClearanceSelect(val) { /*destinationClearanceSelect(val) {
this.$set(this.form,'destinationClearance',val) this.$set(this.form,'destinationClearance',val)
...@@ -160,9 +188,22 @@ export default { ...@@ -160,9 +188,22 @@ export default {
}, },
importWarehouseList() { importWarehouseList() {
return this.warehouseList.filter( return this.warehouseList.filter(
(item) => item.tradeType == "1" || item.type == "3" (item) => {
if(this.form.destCountryId && item.guojia != this.form.destCountryId){
return false
}
return item.tradeType == "1" || item.type == "3"
}
); );
}, },
filteredChannelList(){
return this.channelList.filter(item => {
if(this.form.destCountryId && this.form.destCountryId != item.countryId){
return false
}
return true
})
}
}, },
}; };
</script> </script>
......
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