修改了国家页面
This commit is contained in:
parent
e09d31a731
commit
88208c5439
@ -1,7 +1,31 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
|
<el-row :gutter="20" type='flex'>
|
||||||
|
<el-col :span="3" :xs="3">
|
||||||
|
<div class="head-container">
|
||||||
|
<el-input
|
||||||
|
v-model="domainName"
|
||||||
|
placeholder="全球大区"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
prefix-icon="el-icon-search"
|
||||||
|
style="margin-bottom: 20px"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="head-container">
|
||||||
|
<el-tree
|
||||||
|
:data="domainIdsTree"
|
||||||
|
:props="defaultProps"
|
||||||
|
:expand-on-click-node="false"
|
||||||
|
:filter-node-method="filterNode"
|
||||||
|
ref="tree"
|
||||||
|
default-expand-all
|
||||||
|
@node-click="handleNodeClick"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="21" :xs="21">
|
||||||
<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="name">
|
<el-form-item label="" prop="name">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.name"
|
v-model="queryParams.name"
|
||||||
@ -95,49 +119,49 @@
|
|||||||
</el-col> -->
|
</el-col> -->
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-table v-loading="loading" :data="emisCountryList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="国家名称" align="left" prop="name" min-width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div class="link-type" @click="handleUpdate(scope.row)">{{scope.row.name}}</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="英文名称" align="center" prop="nameEn" min-width="100" />
|
||||||
|
<el-table-column label="国家代码" align="center" prop="code" min-width="100" />
|
||||||
|
<el-table-column label="二字码" align="center" prop="twoCode" min-width="100" />
|
||||||
|
<el-table-column label="三字码" align="center" prop="threeCode" min-width="100" />
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['emis:emisCountry:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<!--
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['emis:emisCountry:remove']"
|
||||||
|
>删除</el-button> -->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="emisCountryList" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="国家名称" align="left" prop="name" min-width="100">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<div class="link-type" @click="handleUpdate(scope.row)">{{scope.row.name}}</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="英文名称" align="center" prop="nameEn" min-width="100" />
|
|
||||||
<el-table-column label="国家代码" align="center" prop="code" min-width="100" />
|
|
||||||
<el-table-column label="二字码" align="center" prop="twoCode" min-width="100" />
|
|
||||||
<el-table-column label="三字码" align="center" prop="threeCode" min-width="100" />
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['emis:emisCountry:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
<!--
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['emis:emisCountry:remove']"
|
|
||||||
>删除</el-button> -->
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
:page-sizes="[20,50,100,300,500,1000,2000,5000]"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
:page-size="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page-sizes="[20,50,100,300,500,1000,2000,5000]"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
:page-size="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
<!-- 添加或修改国家对话框 -->
|
<!-- 添加或修改国家对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" :close-on-click-modal="false" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="500px" :close-on-click-modal="false" append-to-body>
|
||||||
<el-row :gutter="0">
|
<el-row :gutter="0">
|
||||||
@ -198,12 +222,13 @@
|
|||||||
<el-dialog :title="titleView" :visible.sync="openView" width="60%" :close-on-click-modal="false" append-to-body>
|
<el-dialog :title="titleView" :visible.sync="openView" width="60%" :close-on-click-modal="false" append-to-body>
|
||||||
<emisCountryView :id="id" ></EmisCountryView>
|
<emisCountryView :id="id" ></EmisCountryView>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listEmisCountry, getEmisCountry, delEmisCountry, addEmisCountry, updateEmisCountry } from "@/api/emis/emisCountry";
|
import { listEmisCountry, getEmisCountry, delEmisCountry, addEmisCountry, updateEmisCountry } from "@/api/emis/emisCountry";
|
||||||
|
import { listEmisContinent, getEmisContinent, delEmisContinent, addEmisContinent, updateEmisContinent } from "@/api/emis/emisContinent";
|
||||||
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
|
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
|
||||||
import emisCountryView from '@/views/emis/emisCountry/emisCountryView';
|
import emisCountryView from '@/views/emis/emisCountry/emisCountryView';
|
||||||
import emisCountryForm from '@/views/emis/emisCountry/emisCountryForm';
|
import emisCountryForm from '@/views/emis/emisCountry/emisCountryForm';
|
||||||
@ -213,8 +238,19 @@ export default {
|
|||||||
components: { elDateSimplePicker,emisCountryView,emisCountryForm },
|
components: { elDateSimplePicker,emisCountryView,emisCountryForm },
|
||||||
dicts: [
|
dicts: [
|
||||||
],
|
],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
domainName:"",
|
||||||
|
domainIdsTree:[],
|
||||||
|
domainIdsOptions:[],
|
||||||
|
domainIdsEditOptions:[],
|
||||||
|
domainIdMap: new Map(),
|
||||||
|
defaultProps: {
|
||||||
|
children: "children",
|
||||||
|
label: "label"
|
||||||
|
},
|
||||||
|
domainSelectList:[],
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
@ -277,6 +313,7 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
this.getContinentList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询国家列表 */
|
/** 查询国家列表 */
|
||||||
@ -296,6 +333,71 @@ export default {
|
|||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
getContinentList() {
|
||||||
|
this.loading = true;
|
||||||
|
this.queryParams.params = {};
|
||||||
|
if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
|
||||||
|
this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0];
|
||||||
|
this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
|
||||||
|
}
|
||||||
|
if (null != this.daterangeUpdateTime && '' != this.daterangeUpdateTime) {
|
||||||
|
this.queryParams.params["beginUpdateTime"] = this.daterangeUpdateTime[0];
|
||||||
|
this.queryParams.params["endUpdateTime"] = this.daterangeUpdateTime[1];
|
||||||
|
}
|
||||||
|
listEmisContinent(this.addDateRange(this.queryParams, this.dateTimeRange)).then(response => {
|
||||||
|
var domainTree={"id":"","label":"所属大区","children":[]};
|
||||||
|
domainTree.children.push({"id":"-1","label":"临时"});
|
||||||
|
//this.domainIdMap[-1]="临时";
|
||||||
|
var lastDomainId = -1;
|
||||||
|
response.rows.forEach(item =>{
|
||||||
|
// this.domainIdMap[item.id]=item.name;
|
||||||
|
//var optItem={value:item.id,label:item.name};
|
||||||
|
//this.domainIdsOptions.push(optItem)
|
||||||
|
|
||||||
|
var treeItem={"id":item.id,"label":item.name};
|
||||||
|
domainTree.children.push(treeItem);
|
||||||
|
lastDomainId = item.id;
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
var cacheDomainId = this.getCacheDomainId();
|
||||||
|
if (cacheDomainId == undefined || cacheDomainId== -1){
|
||||||
|
cacheDomainId = lastDomainId;
|
||||||
|
this.saveCacheDomainId(lastDomainId);
|
||||||
|
}
|
||||||
|
this.queryParams.continentId = cacheDomainId;
|
||||||
|
this.domainIdsTree.push(domainTree);
|
||||||
|
//this.getList();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 节点单击事件
|
||||||
|
handleNodeClick(data) {
|
||||||
|
// if(data.id!="-1"){
|
||||||
|
this.queryParams.continentId = data.id;
|
||||||
|
this.form.continentId= data.id;
|
||||||
|
this.saveCacheDomainId(data.id);
|
||||||
|
// this.currentAppName=data.label;
|
||||||
|
this.handleQuery();
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
saveCacheDomainId(continentId){
|
||||||
|
var jObj = {
|
||||||
|
continentId: continentId
|
||||||
|
};
|
||||||
|
this.$cache.local.setJSON("menuDomainId",jObj);
|
||||||
|
},
|
||||||
|
getCacheDomainId(){
|
||||||
|
try{
|
||||||
|
var domainJsonObj = this.$cache.local.getJSON("menuDomainId");
|
||||||
|
if(domainJsonObj != undefined){
|
||||||
|
return domainJsonObj.continentId;
|
||||||
|
}else{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}catch(e){
|
||||||
|
this.$cache.local.remove("menuDomainId");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user