|
@@ -1,75 +1,105 @@
|
|
|
<!-- 国家 -->
|
|
|
<template>
|
|
|
<basic-container>
|
|
|
- <avue-crud :option="option"
|
|
|
- :table-loading="loading"
|
|
|
- :data="data"
|
|
|
- :page.sync="page"
|
|
|
- :permission="permissionList"
|
|
|
- id="out-table"
|
|
|
- :header-cell-class-name="headerClassName"
|
|
|
- :before-open="beforeOpen"
|
|
|
- v-model="form"
|
|
|
- ref="crud"
|
|
|
- @row-update="rowUpdate"
|
|
|
- @row-save="rowSave"
|
|
|
- @row-del="rowDel"
|
|
|
- @search-change="searchChange"
|
|
|
- @search-reset="searchReset"
|
|
|
- @selection-change="selectionChange"
|
|
|
- @current-change="currentChange"
|
|
|
- @size-change="sizeChange"
|
|
|
- @refresh-change="refreshChange"
|
|
|
- @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 287)"
|
|
|
- @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 287)"
|
|
|
- @on-load="onLoad" >
|
|
|
+ <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" :permission="permissionList"
|
|
|
+ id="out-table" :header-cell-class-name="headerClassName" :before-open="beforeOpen" v-model="form" ref="crud"
|
|
|
+ @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel" :search.sync="search"
|
|
|
+ @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
|
|
|
+ @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange"
|
|
|
+ @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 287)"
|
|
|
+ @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 287)" @on-load="onLoad">
|
|
|
<template slot="remarks" slot-scope="scope">
|
|
|
<avue-text-ellipsis :text="scope.row.remarks" :height="30" use-tooltip placement="top">
|
|
|
- <small slot="more">...</small>
|
|
|
+ <small slot="more">...</small>
|
|
|
</avue-text-ellipsis>
|
|
|
</template>
|
|
|
<template slot="menuLeft">
|
|
|
- <el-button type="primary"
|
|
|
- size="small"
|
|
|
- icon="el-icon-plus"
|
|
|
- @click="addbtnfun()">新建国家
|
|
|
+ <el-button type="primary" size="small" icon="el-icon-plus" @click="addbtnfun()">新建国家
|
|
|
</el-button>
|
|
|
- <el-button type="danger"
|
|
|
- size="small"
|
|
|
- icon="el-icon-delete"
|
|
|
- plain
|
|
|
- @click="handleDelete">删 除
|
|
|
+ <el-button type="danger" size="small" icon="el-icon-delete" plain @click="handleDelete">删 除
|
|
|
</el-button>
|
|
|
+ <el-button type="warning" size="small" icon="el-icon-printer" @click="excelBox = true">导入
|
|
|
+ </el-button>
|
|
|
+ <el-button type="success" size="small" @click="handleExport" icon="el-icon-printer">导出</el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
+
|
|
|
+
|
|
|
+ <el-dialog title="导入往来单位" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
|
|
|
+ v-dialog-drag>
|
|
|
+ <avue-form :option="excelOption" v-model="excelForm" :table-loading="excelLoading" :upload-before="uploadBefore"
|
|
|
+ :upload-after="onSuccess">
|
|
|
+ <template slot="excelTemplate">
|
|
|
+ <el-button type="primary" @click="handleGet">
|
|
|
+ 点击下载<i class="el-icon-download el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </avue-form>
|
|
|
+ <p style="text-align: center;color: #DC0505">
|
|
|
+ 温馨提示 第一次导入时请先下载模板
|
|
|
+ </p>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+
|
|
|
</basic-container>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {bcountrysList, bcountrysDetail, bcountrysSubmit, bcountrysRemove} from "@/api/iosBasicData/bcountrys";
|
|
|
-import {mapGetters} from "vuex";
|
|
|
+import { bcountrysList, bcountrysDetail, bcountrysSubmit, bcountrysRemove } from "@/api/iosBasicData/bcountrys";
|
|
|
+import { mapGetters } from "vuex";
|
|
|
+
|
|
|
+import { getToken } from "@/util/auth";
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ excelBox: false,
|
|
|
form: {},
|
|
|
query: {},
|
|
|
loading: true,
|
|
|
+ search: {},
|
|
|
+ excelForm: {},
|
|
|
+ excelLoading: false,
|
|
|
+ excelOption: {
|
|
|
+ submitBtn: false,
|
|
|
+ emptyBtn: false,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "模板下载",
|
|
|
+ prop: "excelTemplate",
|
|
|
+ formslot: true,
|
|
|
+ span: 24
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "模板上传",
|
|
|
+ prop: "excelFile",
|
|
|
+ type: "upload",
|
|
|
+ drag: true,
|
|
|
+ loadText: "模板上传中,请稍等",
|
|
|
+ span: 24,
|
|
|
+ propsHttp: {
|
|
|
+ res: "data"
|
|
|
+ },
|
|
|
+ tip: "请上传 .xls,.xlsx 标准格式文件",
|
|
|
+ action: "/api/blade-los/bcountrys/importBCountrys"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
page: {
|
|
|
pageSize: 10,
|
|
|
currentPage: 1,
|
|
|
total: 0
|
|
|
},
|
|
|
selectionList: [],
|
|
|
- option:{},
|
|
|
+ option: {},
|
|
|
optionBack: {
|
|
|
- addBtnText:'新建国家',
|
|
|
- addTitle:'新建国家',
|
|
|
- editBtnText:'编辑',
|
|
|
- editTitle:'编辑国家',
|
|
|
- viewBtnText:'查看',
|
|
|
- viewTitle:'查看国家',
|
|
|
- height:'auto',
|
|
|
+ addBtnText: '新建国家',
|
|
|
+ addTitle: '新建国家',
|
|
|
+ editBtnText: '编辑',
|
|
|
+ editTitle: '编辑国家',
|
|
|
+ viewBtnText: '查看',
|
|
|
+ viewTitle: '查看国家',
|
|
|
+ height: 'auto',
|
|
|
stripe: true,
|
|
|
calcHeight: 30,
|
|
|
tip: false,
|
|
@@ -95,9 +125,9 @@ export default {
|
|
|
label: "国际三字码",
|
|
|
prop: "unCode",
|
|
|
rules: [{
|
|
|
- pattern:/^[a-zA-Z0-9]{1,3}$/,
|
|
|
- message:"请输入英文字母或数字",
|
|
|
- trigger:'blur'
|
|
|
+ pattern: /^[a-zA-Z0-9]{1,3}$/,
|
|
|
+ message: "请输入英文字母或数字",
|
|
|
+ trigger: 'blur'
|
|
|
}]
|
|
|
},
|
|
|
{
|
|
@@ -123,76 +153,76 @@ export default {
|
|
|
{
|
|
|
label: "版本",
|
|
|
prop: "version",
|
|
|
- hide:true,
|
|
|
- display:false,
|
|
|
+ hide: true,
|
|
|
+ display: false,
|
|
|
},
|
|
|
{
|
|
|
label: "状态",
|
|
|
prop: "status",
|
|
|
- type:'select',
|
|
|
- dicData:[{
|
|
|
- label:'启用',
|
|
|
- value:0
|
|
|
- },{
|
|
|
- label:'停用',
|
|
|
- value:1
|
|
|
+ type: 'select',
|
|
|
+ dicData: [{
|
|
|
+ label: '启用',
|
|
|
+ value: 0
|
|
|
+ }, {
|
|
|
+ label: '停用',
|
|
|
+ value: 1
|
|
|
}],
|
|
|
},
|
|
|
{
|
|
|
label: "主键",
|
|
|
prop: "id",
|
|
|
- hide:true,
|
|
|
- display:false,
|
|
|
+ hide: true,
|
|
|
+ display: false,
|
|
|
},
|
|
|
{
|
|
|
label: "创建人 Id",
|
|
|
prop: "createUser",
|
|
|
- hide:true,
|
|
|
- display:false,
|
|
|
+ hide: true,
|
|
|
+ display: false,
|
|
|
},
|
|
|
{
|
|
|
label: "创建人",
|
|
|
prop: "createUserName",
|
|
|
- display:false,
|
|
|
+ display: false,
|
|
|
},
|
|
|
{
|
|
|
label: "创建部门 Id",
|
|
|
prop: "createDept",
|
|
|
- hide:true,
|
|
|
- display:false,
|
|
|
+ hide: true,
|
|
|
+ display: false,
|
|
|
},
|
|
|
{
|
|
|
label: "创建部门",
|
|
|
prop: "createDeptName",
|
|
|
- display:false,
|
|
|
+ display: false,
|
|
|
},
|
|
|
{
|
|
|
label: "创建时间",
|
|
|
prop: "createTime",
|
|
|
- hide:true,
|
|
|
- display:false,
|
|
|
+ hide: true,
|
|
|
+ display: false,
|
|
|
},
|
|
|
{
|
|
|
label: "修改人 Id",
|
|
|
prop: "updateUser",
|
|
|
- hide:true,
|
|
|
- display:false,
|
|
|
+ hide: true,
|
|
|
+ display: false,
|
|
|
},
|
|
|
{
|
|
|
label: "修改人",
|
|
|
prop: "updateUserName",
|
|
|
- display:false,
|
|
|
+ display: false,
|
|
|
},
|
|
|
{
|
|
|
label: "修改时间",
|
|
|
prop: "updateTime",
|
|
|
- display:false,
|
|
|
+ display: false,
|
|
|
},
|
|
|
{
|
|
|
label: "是否已删除(0 否 1是)",
|
|
|
prop: "isDeleted",
|
|
|
- hide:true,
|
|
|
- display:false,
|
|
|
+ hide: true,
|
|
|
+ display: false,
|
|
|
},
|
|
|
{
|
|
|
label: "备注",
|
|
@@ -231,8 +261,53 @@ export default {
|
|
|
this.option = await this.getColumnData(this.getColumnName(287), this.optionBack);
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 导出
|
|
|
+ handleExport() {
|
|
|
+ var condition = ''
|
|
|
+ for (const key in this.search) {
|
|
|
+ var value = this.search[key]
|
|
|
+ if (value) {
|
|
|
+ condition += `&${key}=${this.search[key]}`
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$confirm('是否导出国家?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ window.open(
|
|
|
+ `/api/blade-los/bcountrys/exportBCountrys?${this.website.tokenHeader
|
|
|
+ }=${getToken()}${condition}`
|
|
|
+ );
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消' //
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ uploadBefore(file, done, loading) {
|
|
|
+ done();
|
|
|
+ loading = true;
|
|
|
+ },
|
|
|
+ // 上传成功
|
|
|
+ onSuccess(res, done, loading, column) {
|
|
|
+ this.excelBox = false;
|
|
|
+ this.$message.success("导入成功!");
|
|
|
+ loading = false;
|
|
|
+ this.onLoad(this.page);
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ // 下载模板
|
|
|
+ handleGet() {
|
|
|
+ window.open(
|
|
|
+ `/api/blade-los/bcountrys/exportBCountrys/template?${this.website.tokenHeader
|
|
|
+ }=${getToken()}`
|
|
|
+ );
|
|
|
+ },
|
|
|
// 新增
|
|
|
- addbtnfun(){
|
|
|
+ addbtnfun() {
|
|
|
this.form.status = 0
|
|
|
this.$refs.crud.rowAdd()
|
|
|
},
|
|
@@ -282,7 +357,7 @@ export default {
|
|
|
message: "操作成功!"
|
|
|
});
|
|
|
});
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
this.$message({
|
|
|
message: '非禁用状态无法删除',
|
|
|
type: 'warning'
|
|
@@ -343,11 +418,11 @@ export default {
|
|
|
this.$refs.crud.toggleSelection();
|
|
|
},
|
|
|
// 分页页数
|
|
|
- currentChange(currentPage){
|
|
|
+ currentChange(currentPage) {
|
|
|
this.page.currentPage = currentPage;
|
|
|
},
|
|
|
// 分页条数
|
|
|
- sizeChange(pageSize){
|
|
|
+ sizeChange(pageSize) {
|
|
|
this.page.pageSize = pageSize;
|
|
|
},
|
|
|
// 点击刷新
|
|
@@ -389,7 +464,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 更改表格颜色
|
|
|
- headerClassName(tab){
|
|
|
+ headerClassName(tab) {
|
|
|
//颜色间隔
|
|
|
let back = ""
|
|
|
if (tab.columnIndex >= 0 && tab.column.level === 1) {
|
|
@@ -407,16 +482,15 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-
|
|
|
::v-deep#out-table .back-one {
|
|
|
- background: #ecf5ff !important;
|
|
|
- }
|
|
|
- ::v-deep#out-table .back-two {
|
|
|
- background: #ecf5ff !important;
|
|
|
- }
|
|
|
+ background: #ecf5ff !important;
|
|
|
+}
|
|
|
|
|
|
-/deep/ .el-col-md-8 {
|
|
|
- width: 24.33333%;
|
|
|
+::v-deep#out-table .back-two {
|
|
|
+ background: #ecf5ff !important;
|
|
|
}
|
|
|
|
|
|
+/deep/ .el-col-md-8 {
|
|
|
+ width: 24.33333%;
|
|
|
+}
|
|
|
</style>
|