|
@@ -14,6 +14,7 @@
|
|
|
@refresh-change="refreshChange"
|
|
|
@on-load="onLoad"
|
|
|
:table-loading="loading"
|
|
|
+ @saveColumn="saveColumn"
|
|
|
>
|
|
|
<template slot="portOfLoadSearch">
|
|
|
<port-info v-model="search.portOfLoad" />
|
|
@@ -83,10 +84,13 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import option from "./config/mainList.json";
|
|
|
+import mainOption from "./config/mainList.json";
|
|
|
import { getList, remove } from "@/api/basicData/customerInquiry";
|
|
|
import detailPage from "./detailsPage.vue";
|
|
|
-
|
|
|
+import { saveColumn, getColumn, getJson } from "@/api/saveColumn";
|
|
|
+import {columnName} from "@/enums/column-name"
|
|
|
+let columnKey=columnName[0].name
|
|
|
+console.log(columnKey)
|
|
|
export default {
|
|
|
name: "customerInformation",
|
|
|
data() {
|
|
@@ -100,7 +104,7 @@ export default {
|
|
|
},
|
|
|
search: {},
|
|
|
form: {},
|
|
|
- option: option,
|
|
|
+ option: {},
|
|
|
parentId: 0,
|
|
|
dataList: [],
|
|
|
page: {
|
|
@@ -114,7 +118,19 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
components: { detailPage },
|
|
|
- created() {
|
|
|
+ async created() {
|
|
|
+ const localData = JSON.parse(localStorage.getItem(columnKey) || null);
|
|
|
+ if (localData != null) {
|
|
|
+ this.option = localData;
|
|
|
+ } else {
|
|
|
+ const res = await getColumn({ fileName: columnKey });
|
|
|
+ console.log(res.data.data);
|
|
|
+ this.option =
|
|
|
+ res.data.data != null
|
|
|
+ ? JSON.parse(res.data.data.jsonMessage)
|
|
|
+ : mainOption;
|
|
|
+ localStorage.setItem(columnKey, JSON.stringify(this.option));
|
|
|
+ }
|
|
|
let _this = this;
|
|
|
this.option.column.forEach(e => {
|
|
|
if (e.prop == "exchangeRate") {
|
|
@@ -210,6 +226,18 @@ export default {
|
|
|
goBack() {
|
|
|
this.detailData = this.$options.data().detailData;
|
|
|
this.show = true;
|
|
|
+ },
|
|
|
+ saveColumn(row, column) {
|
|
|
+ saveColumn({
|
|
|
+ fileName: columnKey,
|
|
|
+ jsonMessage: JSON.stringify(this.option)
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ localStorage.setItem(columnKey, JSON.stringify(this.option));
|
|
|
+ this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|