Commit a1c9e238 authored by houjn@hikoon.cn's avatar houjn@hikoon.cn

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

parents 7b63f769 32429172
...@@ -71,3 +71,12 @@ export function exportRegionExcel(query) { ...@@ -71,3 +71,12 @@ export function exportRegionExcel(query) {
responseType: 'blob' responseType: 'blob'
}) })
} }
// 获得国家树
export function getListTree(query) {
return request({
url: '/ecw/region/getListTree',
method: 'get',
params: query
})
}
...@@ -12,33 +12,21 @@ ...@@ -12,33 +12,21 @@
<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="是否显示" prop="isShow">
<el-input v-model="queryParams.isShow" placeholder="请输入是否显示" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="数据来源" prop="source">
<el-input v-model="queryParams.source" placeholder="请输入数据来源" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="国家中文名称" prop="countryZh">
<el-form-item label="国家" prop="countryZh">
<el-input v-model="queryParams.countryZh" placeholder="请输入国家中文名称" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.countryZh" placeholder="请输入国家中文名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<el-form-item label="国家英文名称" prop="countryEn">
<el-input v-model="queryParams.countryEn" placeholder="请输入国家英文名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="省中文名称" prop="provinceZh"> <el-form-item label="省" prop="provinceZh">
<el-input v-model="queryParams.provinceZh" placeholder="请输入省中文名称" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.provinceZh" placeholder="请输入省中文名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<el-form-item label="省英文名称" prop="provinceEn">
<el-input v-model="queryParams.provinceEn" placeholder="请输入省英文名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="市中文名称" prop="cityZh">
<el-input v-model="queryParams.cityZh" placeholder="请输入市中文名称" clearable @keyup.enter.native="handleQuery"/> <el-form-item label="城市" prop="cityZh">
</el-form-item> <el-input v-model="queryParams.cityZh" placeholder="请输入城市中文名称" clearable @keyup.enter.native="handleQuery"/>
<el-form-item label="市英文名称" prop="cityEn">
<el-input v-model="queryParams.cityEn" placeholder="请输入市英文名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<el-form-item label="码头编号" prop="number"> <el-form-item label="码头编号" prop="number">
<el-input v-model="queryParams.number" placeholder="请输入码头编号" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.number" placeholder="请输入码头编号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
...@@ -70,20 +58,12 @@ ...@@ -70,20 +58,12 @@
<el-table-column label="主键" align="center" prop="id" /> <el-table-column label="主键" align="center" prop="id" />
<el-table-column label="中文名称" align="center" prop="titleZh" /> <el-table-column label="中文名称" align="center" prop="titleZh" />
<el-table-column label="英文名称" align="center" prop="titleEn" /> <el-table-column label="英文名称" align="center" prop="titleEn" />
<el-table-column label="排序" align="center" prop="sort" /> <el-table-column label="国家" align="center" prop="countryZh" />
<el-table-column label="是否显示,默认显示" align="center" prop="isShow" /> <el-table-column label="省" align="center" prop="provinceZh" />
<el-table-column label="数据来源(pc端,mobile端)" align="center" prop="source" /> <el-table-column label="城市" align="center" prop="cityZh" />
<el-table-column label="国家id" align="center" prop="countryId" />
<el-table-column label="国家中文名称" align="center" prop="countryZh" />
<el-table-column label="国家英文名称" align="center" prop="countryEn" />
<el-table-column label="省id" align="center" prop="provinceId" />
<el-table-column label="省中文名称" align="center" prop="provinceZh" />
<el-table-column label="省英文名称" align="center" prop="provinceEn" />
<el-table-column label="市id" align="center" prop="cityId" />
<el-table-column label="市中文名称" align="center" prop="cityZh" />
<el-table-column label="市英文名称" align="center" prop="cityEn" />
<el-table-column label="码头编号" align="center" prop="number" /> <el-table-column label="码头编号" align="center" prop="number" />
<el-table-column label="码头类型" align="center" prop="type" /> <el-table-column label="码头类型" align="center" prop="type" />
<el-table-column label="排序" align="center" prop="sort" />
<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>
...@@ -114,39 +94,44 @@ ...@@ -114,39 +94,44 @@
<el-form-item label="排序" prop="sort"> <el-form-item label="排序" prop="sort">
<el-input v-model="form.sort" placeholder="请输入排序" /> <el-input v-model="form.sort" placeholder="请输入排序" />
</el-form-item> </el-form-item>
<el-form-item label="是否显示,默认显示" prop="isShow">
<el-input v-model="form.isShow" placeholder="请输入是否显示,默认显示" />
</el-form-item> <el-form-item label="国家" prop="countryId">
<el-form-item label="数据来源(pc端,mobile端)" prop="source"> <el-select v-model="form.countryId" placeholder="请选择国家" @change="changeCountry">
<el-input v-model="form.source" placeholder="请输入数据来源(pc端,mobile端)" /> <el-option
</el-form-item> v-for="item in countryList"
<el-form-item label="国家id" prop="countryId"> :key="item.id"
<el-input v-model="form.countryId" placeholder="请输入国家id" /> :label="item.titleZh"
</el-form-item> :value="item.id">
<el-form-item label="国家中文名称" prop="countryZh"> </el-option>
<el-input v-model="form.countryZh" placeholder="请输入国家中文名称" /> </el-select>
</el-form-item>
<el-form-item label="国家英文名称" prop="countryEn">
<el-input v-model="form.countryEn" placeholder="请输入国家英文名称" />
</el-form-item>
<el-form-item label="省id" prop="provinceId">
<el-input v-model="form.provinceId" placeholder="请输入省id" />
</el-form-item>
<el-form-item label="省中文名称" prop="provinceZh">
<el-input v-model="form.provinceZh" placeholder="请输入省中文名称" />
</el-form-item>
<el-form-item label="省英文名称" prop="provinceEn">
<el-input v-model="form.provinceEn" placeholder="请输入省英文名称" />
</el-form-item>
<el-form-item label="市id" prop="cityId">
<el-input v-model="form.cityId" placeholder="请输入市id" />
</el-form-item> </el-form-item>
<el-form-item label="市中文名称" prop="cityZh">
<el-input v-model="form.cityZh" placeholder="请输入市中文名称" />
<el-form-item label="省" prop="provinceId">
<el-select v-model="form.provinceId" placeholder="请选择省" @change="changeProvince">
<el-option
v-for="item in provinceList"
:key="item.id"
:label="item.titleZh"
:value="item.id">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="市英文名称" prop="cityEn">
<el-input v-model="form.cityEn" placeholder="请输入市英文名称" />
<el-form-item label="城市" prop="cityId">
<el-select v-model="form.cityId" placeholder="请选择城市" @change="changeCity">
<el-option
v-for="item in cityList"
:key="item.id"
:label="item.titleZh"
:value="item.id">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="码头编号" prop="number"> <el-form-item label="码头编号" prop="number">
<el-input v-model="form.number" placeholder="请输入码头编号" /> <el-input v-model="form.number" placeholder="请输入码头编号" />
</el-form-item> </el-form-item>
...@@ -164,6 +149,7 @@ ...@@ -164,6 +149,7 @@
<script> <script>
import { createDock, updateDock, deleteDock, getDock, getDockPage, exportDockExcel } from "@/api/ecw/dock"; import { createDock, updateDock, deleteDock, getDock, getDockPage, exportDockExcel } from "@/api/ecw/dock";
import { getListTree } from "@/api/ecw/region";
export default { export default {
name: "Dock", name: "Dock",
...@@ -181,6 +167,14 @@ export default { ...@@ -181,6 +167,14 @@ export default {
total: 0, total: 0,
// 码头信息列表 // 码头信息列表
list: [], list: [],
//国家信息列表
countryList: [],
//省信息列表
provinceList: [],
//市信息列表
cityList: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
...@@ -193,8 +187,6 @@ export default { ...@@ -193,8 +187,6 @@ export default {
titleZh: null, titleZh: null,
titleEn: null, titleEn: null,
sort: null, sort: null,
isShow: null,
source: null,
countryId: null, countryId: null,
countryZh: null, countryZh: null,
countryEn: null, countryEn: null,
...@@ -213,14 +205,35 @@ export default { ...@@ -213,14 +205,35 @@ export default {
rules: { rules: {
titleZh: [{ required: true, message: "中文名称不能为空", trigger: "blur" }], titleZh: [{ required: true, message: "中文名称不能为空", trigger: "blur" }],
titleEn: [{ required: true, message: "英文名称不能为空", trigger: "blur" }], titleEn: [{ required: true, message: "英文名称不能为空", trigger: "blur" }],
sort: [{ required: true, message: "排序不能为空", trigger: "blur" }], sort: [{ required: true, message: "排序不能为空", trigger: "blur" }]
isShow: [{ required: true, message: "是否显示,默认显示不能为空", trigger: "blur" }],
source: [{ required: true, message: "数据来源(pc端,mobile端)不能为空", trigger: "blur" }]
} }
}; };
}, },
watch: {
'form.countryId'(newV, oldV) {
if(oldV && oldV != newV) {
this.form.provinceId = null;
this.form.provinceZh = null;
this.form.provinceEn = null;
this.form.cityId = null;
this.form.cityZh = null;
this.form.cityEn = null;
}
},
'form.provinceId'(newV, oldV) {
if(oldV && oldV != newV) {
this.form.cityId = null;
this.form.cityZh = null;
this.form.cityEn = null;
}
}
},
created() { created() {
this.getList(); this.getList();
this.getCountryList();
}, },
methods: { methods: {
/** 查询列表 */ /** 查询列表 */
...@@ -236,6 +249,50 @@ export default { ...@@ -236,6 +249,50 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
getCountryList() {
getListTree(this.queryParams).then(response => {
this.countryList = response.data;
});
},
changeCountry(countryId) {
for(let index in this.countryList) {
let country = this.countryList[index];
if(country.id == countryId) {
this.provinceList = country.children;
this.form.countryZh = country.titleZh;
this.form.countryEn = country.titleEn;
return;
}
}
},
changeProvince(provinceId) {
for(let index in this.provinceList) {
let province = this.provinceList[index];
if(province.id == provinceId) {
this.cityList = province.children;
this.form.provinceZh = province.titleZh;
this.form.provinceEn = province.titleEn;
return;
}
}
},
changeCity(cityId) {
for(let index in this.cityList) {
let city = this.cityList[index];
if(city.id == cityId) {
this.form.cityZh = city.titleZh;
this.form.cityEn = city.titleEn;
return;
}
}
},
/** 取消按钮 */ /** 取消按钮 */
cancel() { cancel() {
this.open = false; this.open = false;
...@@ -248,8 +305,6 @@ export default { ...@@ -248,8 +305,6 @@ export default {
titleZh: undefined, titleZh: undefined,
titleEn: undefined, titleEn: undefined,
sort: undefined, sort: undefined,
isShow: undefined,
source: undefined,
countryId: undefined, countryId: undefined,
countryZh: undefined, countryZh: undefined,
countryEn: undefined, countryEn: undefined,
...@@ -287,6 +342,9 @@ export default { ...@@ -287,6 +342,9 @@ export default {
const id = row.id; const id = row.id;
getDock(id).then(response => { getDock(id).then(response => {
this.form = response.data; this.form = response.data;
this.changeCountry(response.data.countryId);
this.changeProvince(response.data.provinceId);
this.open = true; this.open = true;
this.title = "修改码头信息"; this.title = "修改码头信息";
}); });
......
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