From 0f7a12177d5ff931e6883981ab5024377496c618 Mon Sep 17 00:00:00 2001 From: zuowenwen Date: Thu, 24 Feb 2022 14:54:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AEfunctionId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/auditManagement/auditRules.vue | 281 ++++++++---------- .../modules/auditManagement/auditTeam.vue | 261 ++++++++-------- .../modules/auditManagement/auditType.vue | 248 +++++++--------- src/views/modules/knifemold/receive.vue | 251 +++++----------- .../purchaseorder/procurementReview.vue | 154 +++++----- .../purchaseorder/purchaseRequisition.vue | 203 +++++-------- src/views/modules/warehouse/location.vue | 255 ++++++++-------- src/views/modules/warehouse/warehouse.vue | 147 ++++----- 8 files changed, 786 insertions(+), 1014 deletions(-) diff --git a/src/views/modules/auditManagement/auditRules.vue b/src/views/modules/auditManagement/auditRules.vue index 34fd69c..16d6b3b 100644 --- a/src/views/modules/auditManagement/auditRules.vue +++ b/src/views/modules/auditManagement/auditRules.vue @@ -287,7 +287,9 @@ import column from "../common/column"; saveTableDefaultList, saveTableUser, getTableDefaultListLanguage, - getTableUserListLanguage + getTableUserListLanguage, + removerDefault, + removerUser } from "@/api/table.js" import { userFavoriteList, @@ -421,22 +423,22 @@ import { // 是否收藏 favorite: false, addLanguage: false, - functionId: 2401, - tableId: "auditRules2401", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'AURU01', value1: true, visible: false, showDefault: false, // 默认table 查询参数 queryTable: { - functionId: 2401, - tableId: "auditRules2401", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'AURU01', languageCode: this.$i18n.locale }, // 用户table 查询参数 queryTableUser: { userId: this.$store.state.user.name, - functionId: 2401, - tableId: "auditRules2401", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'AURU01', status: true, languageCode: this.$i18n.locale }, @@ -452,9 +454,8 @@ import { columnList: [ { userId: this.$store.state.user.name, - functionId: 2401, serialNumber: 'auditRules2401RecordTypeDb', - tableId: "auditRules2401", + tableId: this.$route.meta.menuId + 'AURU01', tableName: "auditType", columnProp: "recordTypeDb", headerAlign: "center", @@ -469,9 +470,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2401, serialNumber: 'auditRules2401RuleId', - tableId: "auditRules2401", + tableId: this.$route.meta.menuId + 'AURU01', tableName: "auditType", columnProp: "ruleId", headerAlign: "center", @@ -486,9 +486,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2401, serialNumber: 'auditTeam230RuleDesc', - tableId: "auditRules2401", + tableId: this.$route.meta.menuId + 'AURU01', tableName: "auditType", columnProp: "ruleDesc", headerAlign: "center", @@ -503,9 +502,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2401, serialNumber: 'auditTeam230Priority', - tableId: "auditRules2401", + tableId: this.$route.meta.menuId + 'AURU01', tableName: "auditType", columnProp: "priority", headerAlign: "center", @@ -520,9 +518,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2401, serialNumber: 'auditTeam230MinValue', - tableId: "auditRules2401", + tableId: this.$route.meta.menuId + 'AURU01', tableName: "auditType", columnProp: "minValue", headerAlign: "center", @@ -537,9 +534,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2401, serialNumber: 'auditTeam230MinValue', - tableId: "auditRules2401", + tableId: this.$route.meta.menuId + 'AURU01', tableName: "auditType", columnProp: "maxValue", headerAlign: "center", @@ -554,9 +550,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2401, serialNumber: 'auditRules2401Active', - tableId: "auditRules2401", + tableId: this.$route.meta.menuId + 'AURU01', tableName: "auditType", columnProp: "active", headerAlign: "center", @@ -571,9 +566,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2401, serialNumber: 'auditRules2401Remark', - tableId: "auditRules2401", + tableId: this.$route.meta.menuId + 'AURU01', tableName: "auditType", columnProp: "remark", headerAlign: "center", @@ -591,8 +585,7 @@ import { columnList1: [ { userId: this.$store.state.user.name, - functionId: 2401, - tableId: "authStep2401", + tableId: this.$route.meta.menuId + 'AURU02', tableName: "authStep", columnProp: "stepId", headerAlign: "center", @@ -607,8 +600,7 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2401, - tableId: "authStep2401", + tableId: this.$route.meta.menuId + 'AURU02', tableName: "authStep", columnProp: "authTypeDesc", headerAlign: "center", @@ -623,8 +615,7 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2401, - tableId: "authStep2401", + tableId: this.$route.meta.menuId + 'AURU02', tableName: "authStep", columnProp: "userName", headerAlign: "center", @@ -639,8 +630,7 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2401, - tableId: "authStep2401", + tableId: this.$route.meta.menuId + 'AURU02', tableName: "authStep", columnProp: "groupDesc", headerAlign: "center", @@ -655,8 +645,7 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2401, - tableId: "authStep2401", + tableId: this.$route.meta.menuId + 'AURU02', tableName: "authStep", columnProp: "printDesc", headerAlign: "center", @@ -671,8 +660,7 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2401, - tableId: "authStep2401", + tableId: this.$route.meta.menuId + 'AURU02', tableName: "authStep", columnProp: "firstStepDesc", headerAlign: "center", @@ -687,8 +675,7 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2401, - tableId: "authStep2401", + tableId: this.$route.meta.menuId + 'AURU02', tableName: "authStep", columnProp: "lastStepDesc", headerAlign: "center", @@ -705,8 +692,8 @@ import { // 数据集 dataList: [], queryButton: { - functionId: 2401, - table_id: 'auditRules2401', + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'AURU01', languageCode: this.$i18n.locale, objectType: 'button' }, @@ -729,69 +716,66 @@ import { exportDefaultValue: "这一行这一列没有数据", // 导出 end buttonList: [ - // { - // functionId: "9001", - // languageValue: '添加', - // objectId: 'add', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '编辑', - // objectId: 'edit', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '删除', - // objectId: 'delete', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '批量删除', - // objectId: 'deleteList', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '操作', - // objectId: 'cz', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '查询', - // objectId: 'search', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '导出', - // objectId: 'download', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '设置列表', - // objectId: 'settingTable', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '设置默认配置', - // objectId: 'defaultTable', - // objectType: "button", - // tableId: "common1001" - // } + { + languageValue: '新增', + objectId: 'add', + objectType: "button", + tableId: this.$route.meta.menuId + 'AURU01', + }, + { + languageValue: '编辑', + objectId: 'edit', + objectType: "button", + tableId: this.$route.meta.menuId + 'AURU01', + }, + { + languageValue: '删除', + objectId: 'delete', + objectType: "button", + tableId: this.$route.meta.menuId + 'AURU01', + }, + { + languageValue: '批量删除', + objectId: 'deleteList', + objectType: "button", + tableId: this.$route.meta.menuId + 'AURU01', + }, + { + languageValue: '操作', + objectId: 'cz', + objectType: "button", + tableId: this.$route.meta.menuId + 'AURU01', + }, + { + languageValue: '查询', + objectId: 'search', + objectType: "button", + tableId: this.$route.meta.menuId + 'AURU01', + }, + { + languageValue: '导出', + objectId: 'download', + objectType: "button", + tableId: this.$route.meta.menuId + 'AURU01', + }, + { + languageValue: '设置列表', + objectId: 'settingTable', + objectType: "button", + tableId: this.$route.meta.menuId + 'AURU01', + }, + { + languageValue: '设置默认配置', + objectId: 'defaultTable', + objectType: "button", + tableId: this.$route.meta.menuId + 'AURU01', + }, + { + languageValue: '审批步骤', + objectId: 'reviewer', + objectType: "button", + tableId: this.$route.meta.menuId + 'AURU01', + } ], languageList: [], languageColumnList: [], @@ -1195,39 +1179,6 @@ import { } }, - // 保存语言编辑 - saveLanguageList(val) { - saveSysLanguageOne(val).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - } else { - this.$message.error(data.msg) - } - }) - }, - // 编辑语言 - addLanguageFun() { - if (this.querySysLanguagePack.languageCode) { - this.addLanguage = true - this.languageColumnList = [] - let query = { - functionId: 2401, - tableId: "common1002", - languageCode: this.$i18n.locale - } - getTableDefaultListLanguage(query).then(({data}) => { - if (data.rows.length > 0) { - this.languageColumnList = data.rows - } - }) - this.languageColumnList = this.columnList - searchLanguageListByLanguageCode(this.querySysLanguagePack).then(({data}) => { - this.languageDataList = data.rows - }) - } else { - this.$message("请选中一种语言") - } - }, // 获取多语言列表 getLanguageList() { searchSysLanguage(this.queryLanguage).then(({data}) => { @@ -1254,8 +1205,8 @@ import { this.visible = true; let queryTable = { userId: this.$store.state.user.name, - functionId: 2401, - tableId: "auditRules2401", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'AURU01', languageCode: this.$i18n.locale } this.$nextTick(() => { @@ -1275,28 +1226,50 @@ import { }) }, // 保存 默认配置 列 - saveColumnList() { - - saveTableDefaultList(this.columnList).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - this.showDefault = false - } else { - this.$message.error(data.msg) + async saveColumnList() { + // 删除所有的该页面下保存的数据 + if (this.userColumnList) { + //删除 user自定义的数据 + await removerUser(this.queryTable) + } + // 删除默认配置 + await removerDefault(this.queryTable) + // 保存页面 table属性 + let sumColumnList = this.columnList.concat(this.columnList1); + sumColumnList = sumColumnList.map(item=> { + return item = { + tableId: item.tableId, + tableName: item.tableName, + columnProp: item.columnProp, + columnLabel: item.columnLabel, + columnHidden: false, + columnImage: false, + columnSortable: false, + columnWidth: null, + format: null, + functionId: this.$route.meta.menuId, + sortLv: 0, + status: true, + fixed: false, + serialNumber: null, + columnType: null, + align: null } }) - saveTableDefaultList(this.columnList1).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - this.showDefault = false - } else { - this.$message.error(data.msg) + + await saveTableDefaultList(sumColumnList) + // 保存页面 button label title 属性 + let buttons = this.buttonList.map( item => { + return item = { + functionId: this.$route.meta.menuId, + languageValue: item.languageValue, + objectId: item.objectId, + objectType: item.objectType, + tableId: item.tableId } }) - saveButtonList(this.buttonList).then(({data}) => { - }) + await saveButtonList(buttons) this.getFunctionButtonList() - this.getFunctionButtonList(); this.getColumnList() }, // 获取 tableDefault 列 diff --git a/src/views/modules/auditManagement/auditTeam.vue b/src/views/modules/auditManagement/auditTeam.vue index f3c168f..f616b37 100644 --- a/src/views/modules/auditManagement/auditTeam.vue +++ b/src/views/modules/auditManagement/auditTeam.vue @@ -167,7 +167,9 @@ import column from "../common/column"; saveTableDefaultList, saveTableUser, getTableDefaultListLanguage, - getTableUserListLanguage + getTableUserListLanguage, + removerDefault, + removerUser } from "@/api/table.js" import { userFavoriteList, @@ -240,8 +242,8 @@ import { // 是否收藏 favorite: false, addLanguage: false, - functionId: 2301, - tableId: "auditTeam2301", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'AUTE01', value1: true, visible: false, showDefault: false, @@ -254,15 +256,15 @@ import { },], // 默认table 查询参数 queryTable: { - functionId: 2301, - tableId: "auditTeam2301", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'AUTE01', languageCode: this.$i18n.locale }, // 用户table 查询参数 queryTableUser: { userId: this.$store.state.user.name, - functionId: 2301, - tableId: "auditTeam2301", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'AUTE01', status: true, languageCode: this.$i18n.locale }, @@ -278,9 +280,8 @@ import { columnList: [ { userId: this.$store.state.user.name, - functionId: 2301, serialNumber: 'auditTeam2301RecordTypeDb', - tableId: "auditTeam2301", + tableId: this.$route.meta.menuId + 'AUTE01', tableName: "auditType", columnProp: "recordTypeDb", headerAlign: "center", @@ -295,9 +296,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2301, serialNumber: 'auditTeam2301GroupId', - tableId: "auditTeam2301", + tableId: this.$route.meta.menuId + 'AUTE01', tableName: "auditType", columnProp: "groupId", headerAlign: "center", @@ -312,9 +312,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2301, serialNumber: 'auditTeam230GroupDesc', - tableId: "auditTeam2301", + tableId: this.$route.meta.menuId + 'AUTE01', tableName: "auditType", columnProp: "groupDesc", headerAlign: "center", @@ -329,9 +328,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2301, serialNumber: 'auditTeam230GroupEmailAddress', - tableId: "auditTeam2301", + tableId: this.$route.meta.menuId + 'AUTE01', tableName: "auditType", columnProp: "groupEmailAddress", headerAlign: "center", @@ -346,9 +344,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2301, serialNumber: 'auditTeam2301Active', - tableId: "auditTeam2301", + tableId: this.$route.meta.menuId + 'AUTE01', tableName: "auditType", columnProp: "active", headerAlign: "center", @@ -366,7 +363,7 @@ import { columnList1: [ // { // userId: this.$store.state.user.name, - // functionId: 2301, + // functionId: this.$route.meta.menuId, // tableId: "common1002", // tableName: "commonLanguage", // columnProp: "functionId", @@ -382,7 +379,7 @@ import { // }, // { // userId: this.$store.state.user.name, - // functionId: 2301, + // functionId: this.$route.meta.menuId, // tableId: "common1002", // tableName: "commonLanguage", // columnProp: "objectId", @@ -398,7 +395,7 @@ import { // }, // { // userId: this.$store.state.user.name, - // functionId: 2301, + // functionId: this.$route.meta.menuId, // tableId: "common1002", // tableName: "commonLanguage", // columnProp: "objectType", @@ -414,7 +411,7 @@ import { // }, // { // userId: this.$store.state.user.name, - // functionId: 2301, + // functionId: this.$route.meta.menuId, // tableId: "common1002", // tableName: "commonLanguage", // columnProp: "languageValue", @@ -430,7 +427,7 @@ import { // }, // { // userId: this.$store.state.user.name, - // functionId: 2301, + // functionId: this.$route.meta.menuId, // tableId: "common1002", // tableName: "commonLanguage", // columnProp: "languageCode", @@ -448,8 +445,8 @@ import { // 数据集 dataList: [], queryButton: { - functionId: 2301, - table_id: 'auditTeam2301', + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'AUTE01', languageCode: this.$i18n.locale, objectType: 'button' }, @@ -472,69 +469,66 @@ import { exportDefaultValue: "这一行这一列没有数据", // 导出 end buttonList: [ - // { - // functionId: "9001", - // languageValue: '添加', - // objectId: 'add', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '编辑', - // objectId: 'edit', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '删除', - // objectId: 'delete', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '批量删除', - // objectId: 'deleteList', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '操作', - // objectId: 'cz', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '查询', - // objectId: 'search', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '导出', - // objectId: 'download', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '设置列表', - // objectId: 'settingTable', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '设置默认配置', - // objectId: 'defaultTable', - // objectType: "button", - // tableId: "common1001" - // } + { + languageValue: '新增', + objectId: 'add', + objectType: "button", + tableId: this.$route.meta.menuId + 'AUTE01', + }, + { + languageValue: '编辑', + objectId: 'edit', + objectType: "button", + tableId: this.$route.meta.menuId + 'AUTE01', + }, + { + languageValue: '删除', + objectId: 'delete', + objectType: "button", + tableId: this.$route.meta.menuId + 'AUTE01', + }, + { + languageValue: '批量删除', + objectId: 'deleteList', + objectType: "button", + tableId: this.$route.meta.menuId + 'AUTE01', + }, + { + languageValue: '操作', + objectId: 'cz', + objectType: "button", + tableId: this.$route.meta.menuId + 'AUTE01', + }, + { + languageValue: '查询', + objectId: 'search', + objectType: "button", + tableId: this.$route.meta.menuId + 'AUTE01', + }, + { + languageValue: '导出', + objectId: 'download', + objectType: "button", + tableId: this.$route.meta.menuId + 'AUTE01', + }, + { + languageValue: '设置列表', + objectId: 'settingTable', + objectType: "button", + tableId: this.$route.meta.menuId + 'AUTE01', + }, + { + languageValue: '设置默认配置', + objectId: 'defaultTable', + objectType: "button", + tableId: this.$route.meta.menuId + 'AUTE01', + }, + { + languageValue: '审核人', + objectId: 'reviewer', + objectType: "button", + tableId: this.$route.meta.menuId + 'AUTE01', + } ], languageList: [], languageColumnList: [], @@ -804,39 +798,6 @@ import { } }, - // 保存语言编辑 - saveLanguageList(val) { - saveSysLanguageOne(val).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - } else { - this.$message.error(data.msg) - } - }) - }, - // 编辑语言 - addLanguageFun() { - if (this.querySysLanguagePack.languageCode) { - this.addLanguage = true - this.languageColumnList = [] - let query = { - functionId: 2301, - tableId: "common1002", - languageCode: this.$i18n.locale - } - getTableDefaultListLanguage(query).then(({data}) => { - if (data.rows.length > 0) { - this.languageColumnList = data.rows - } - }) - this.languageColumnList = this.columnList - searchLanguageListByLanguageCode(this.querySysLanguagePack).then(({data}) => { - this.languageDataList = data.rows - }) - } else { - this.$message("请选中一种语言") - } - }, // 获取多语言列表 getLanguageList() { searchSysLanguage(this.queryLanguage).then(({data}) => { @@ -863,8 +824,8 @@ import { this.visible = true; let queryTable = { userId: this.$store.state.user.name, - functionId: 2301, - tableId: "auditTeam2301", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'AUTE01', languageCode: this.$i18n.locale } this.$nextTick(() => { @@ -884,28 +845,50 @@ import { }) }, // 保存 默认配置 列 - saveColumnList() { - - saveTableDefaultList(this.columnList).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - this.showDefault = false - } else { - this.$message.error(data.msg) + async saveColumnList() { + // 删除所有的该页面下保存的数据 + if (this.userColumnList) { + //删除 user自定义的数据 + await removerUser(this.queryTable) + } + // 删除默认配置 + await removerDefault(this.queryTable) + // 保存页面 table属性 + let sumColumnList = this.columnList.concat(this.columnList1); + sumColumnList = sumColumnList.map(item=> { + return item = { + tableId: item.tableId, + tableName: item.tableName, + columnProp: item.columnProp, + columnLabel: item.columnLabel, + columnHidden: false, + columnImage: false, + columnSortable: false, + columnWidth: null, + format: null, + functionId: this.$route.meta.menuId, + sortLv: 0, + status: true, + fixed: false, + serialNumber: null, + columnType: null, + align: null } }) - saveTableDefaultList(this.columnList1).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - this.showDefault = false - } else { - this.$message.error(data.msg) + + await saveTableDefaultList(sumColumnList) + // 保存页面 button label title 属性 + let buttons = this.buttonList.map( item => { + return item = { + functionId: this.$route.meta.menuId, + languageValue: item.languageValue, + objectId: item.objectId, + objectType: item.objectType, + tableId: item.tableId } }) - saveButtonList(this.buttonList).then(({data}) => { - }) + await saveButtonList(buttons) this.getFunctionButtonList() - this.getFunctionButtonList(); this.getColumnList() }, // 获取 tableDefault 列 diff --git a/src/views/modules/auditManagement/auditType.vue b/src/views/modules/auditManagement/auditType.vue index 214ec6f..e47e64f 100644 --- a/src/views/modules/auditManagement/auditType.vue +++ b/src/views/modules/auditManagement/auditType.vue @@ -152,7 +152,9 @@ import column from "../common/column"; saveTableDefaultList, saveTableUser, getTableDefaultListLanguage, - getTableUserListLanguage + getTableUserListLanguage, + removerDefault, + removerUser } from "@/api/table.js" import { userFavoriteList, @@ -202,8 +204,8 @@ import { // 是否收藏 favorite: false, addLanguage: false, - functionId: 2201, - tableId: "auditType2201", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'AUTP01', value1: true, visible: false, showDefault: false, @@ -221,15 +223,15 @@ import { partFamilyList : [], // 默认table 查询参数 queryTable: { - functionId: 2201, - tableId: "auditType2201", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'AUTP01', languageCode: this.$i18n.locale }, // 用户table 查询参数 queryTableUser: { userId: this.$store.state.user.name, - functionId: 2201, - tableId: "auditType2201", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'AUTP01', status: true, languageCode: this.$i18n.locale }, @@ -245,9 +247,8 @@ import { columnList: [ { userId: this.$store.state.user.name, - functionId: 2201, serialNumber: 'auditType2201RoleItemNo', - tableId: "auditType2201", + tableId: this.$route.meta.menuId + 'AUTP01', tableName: "auditType", columnProp: "roleItemNo", headerAlign: "center", @@ -262,9 +263,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2201, serialNumber: 'auditType2201RoleDesc', - tableId: "auditType2201", + tableId: this.$route.meta.menuId + 'AUTP01', tableName: "auditType", columnProp: "roleDesc", headerAlign: "center", @@ -279,9 +279,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2201, serialNumber: 'auditType2201FamilyName', - tableId: "auditType2201", + tableId: this.$route.meta.menuId + 'AUTP01', tableName: "auditType", columnProp: "familyName", headerAlign: "center", @@ -296,9 +295,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2201, serialNumber: 'auditType2201Remark', - tableId: "auditType2201", + tableId: this.$route.meta.menuId + 'AUTP01', tableName: "auditType", columnProp: "remark", headerAlign: "center", @@ -313,9 +311,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2201, serialNumber: 'auditType2201Active', - tableId: "auditType2201", + tableId: this.$route.meta.menuId + 'AUTP01', tableName: "auditType", columnProp: "active", headerAlign: "center", @@ -333,7 +330,7 @@ import { columnList1: [ // { // userId: this.$store.state.user.name, - // functionId: 2201, + // functionId: this.$route.meta.menuId, // tableId: "common1002", // tableName: "commonLanguage", // columnProp: "functionId", @@ -349,7 +346,7 @@ import { // }, // { // userId: this.$store.state.user.name, - // functionId: 2201, + // functionId: this.$route.meta.menuId, // tableId: "common1002", // tableName: "commonLanguage", // columnProp: "objectId", @@ -365,7 +362,7 @@ import { // }, // { // userId: this.$store.state.user.name, - // functionId: 2201, + // functionId: this.$route.meta.menuId, // tableId: "common1002", // tableName: "commonLanguage", // columnProp: "objectType", @@ -381,7 +378,7 @@ import { // }, // { // userId: this.$store.state.user.name, - // functionId: 2201, + // functionId: this.$route.meta.menuId, // tableId: "common1002", // tableName: "commonLanguage", // columnProp: "languageValue", @@ -397,7 +394,7 @@ import { // }, // { // userId: this.$store.state.user.name, - // functionId: 2201, + // functionId: this.$route.meta.menuId, // tableId: "common1002", // tableName: "commonLanguage", // columnProp: "languageCode", @@ -415,8 +412,8 @@ import { // 数据集 dataList: [], queryButton: { - functionId: 2201, - table_id: 'auditType2201', + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'AUTP01', languageCode: this.$i18n.locale, objectType: 'button' }, @@ -438,69 +435,61 @@ import { exportDefaultValue: "这一行这一列没有数据", // 导出 end buttonList: [ + { + languageValue: '查询', + objectId: 'search', + objectType: "button", + tableId: this.$route.meta.menuId + 'AUTP01', + }, + { + languageValue: '编辑', + objectId: 'edit', + objectType: "button", + tableId: this.$route.meta.menuId + 'AUTP01', + }, + { + languageValue: '删除', + objectId: 'delete', + objectType: "button", + tableId: this.$route.meta.menuId + 'AUTP01', + }, + { + languageValue: '新增', + objectId: 'add', + objectType: "button", + tableId: this.$route.meta.menuId + 'AUTP01', + }, + { + languageValue: '操作', + objectId: 'cz', + objectType: "button", + tableId: this.$route.meta.menuId + 'AUTP01', + }, // { - // functionId: "9001", - // languageValue: '添加', - // objectId: 'add', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '编辑', - // objectId: 'edit', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '删除', - // objectId: 'delete', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '批量删除', - // objectId: 'deleteList', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '操作', - // objectId: 'cz', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", // languageValue: '查询', // objectId: 'search', // objectType: "button", - // tableId: "common1001" + // tableId: this.$route.meta.menuId + 'AUTP01', // }, - // { - // functionId: "9001", - // languageValue: '导出', - // objectId: 'download', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '设置列表', - // objectId: 'settingTable', - // objectType: "button", - // tableId: "common1001" - // }, - // { - // functionId: "9001", - // languageValue: '设置默认配置', - // objectId: 'defaultTable', - // objectType: "button", - // tableId: "common1001" - // } + { + languageValue: '导出', + objectId: 'download', + objectType: "button", + tableId: this.$route.meta.menuId + 'AUTP01', + }, + { + + languageValue: '设置列表', + objectId: 'settingTable', + objectType: "button", + tableId: this.$route.meta.menuId + 'AUTP01', + }, + { + languageValue: '设置默认配置', + objectId: 'defaultTable', + objectType: "button", + tableId: this.$route.meta.menuId + 'AUTP01', + } ], languageList: [], languageColumnList: [], @@ -675,39 +664,6 @@ import { } }, - // 保存语言编辑 - saveLanguageList(val) { - saveSysLanguageOne(val).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - } else { - this.$message.error(data.msg) - } - }) - }, - // 编辑语言 - addLanguageFun() { - if (this.querySysLanguagePack.languageCode) { - this.addLanguage = true - this.languageColumnList = [] - let query = { - functionId: 2201, - tableId: "common1002", - languageCode: this.$i18n.locale - } - getTableDefaultListLanguage(query).then(({data}) => { - if (data.rows.length > 0) { - this.languageColumnList = data.rows - } - }) - this.languageColumnList = this.columnList - searchLanguageListByLanguageCode(this.querySysLanguagePack).then(({data}) => { - this.languageDataList = data.rows - }) - } else { - this.$message("请选中一种语言") - } - }, // 获取多语言列表 getLanguageList() { searchSysLanguage(this.queryLanguage).then(({data}) => { @@ -734,8 +690,8 @@ import { this.visible = true; let queryTable = { userId: this.$store.state.user.name, - functionId: 2201, - tableId: "auditType2201", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'AUTP01', languageCode: this.$i18n.locale } this.$nextTick(() => { @@ -755,38 +711,58 @@ import { }) }, // 保存 默认配置 列 - saveColumnList() { - - saveTableDefaultList(this.columnList).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - this.showDefault = false - } else { - this.$message.error(data.msg) + async saveColumnList() { + // 删除所有的该页面下保存的数据 + if (this.userColumnList) { + //删除 user自定义的数据 + await removerUser(this.queryTable) + } + // 删除默认配置 + await removerDefault(this.queryTable) + // 保存页面 table属性 + let sumColumnList = this.columnList.concat(this.columnList1); + sumColumnList = sumColumnList.map(item=> { + return item = { + tableId: item.tableId, + tableName: item.tableName, + columnProp: item.columnProp, + columnLabel: item.columnLabel, + columnHidden: false, + columnImage: false, + columnSortable: false, + columnWidth: null, + format: null, + functionId: this.$route.meta.menuId, + sortLv: 0, + status: true, + fixed: false, + serialNumber: null, + columnType: null, + align: null } }) - saveTableDefaultList(this.columnList1).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - this.showDefault = false - } else { - this.$message.error(data.msg) + + await saveTableDefaultList(sumColumnList) + // 保存页面 button label title 属性 + let buttons = this.buttonList.map( item => { + return item = { + functionId: this.$route.meta.menuId, + languageValue: item.languageValue, + objectId: item.objectId, + objectType: item.objectType, + tableId: item.tableId } }) - saveButtonList(this.buttonList).then(({data}) => { - }) + await saveButtonList(buttons) this.getFunctionButtonList() - this.getFunctionButtonList(); this.getColumnList() }, // 获取 tableDefault 列 getColumnList() { getTableDefaultListLanguage(this.queryTable).then(({data}) => { if (!data.rows.length == 0) { - this.showDefault = false this.columnList = data.rows } else { - this.showDefault = true } }) }, diff --git a/src/views/modules/knifemold/receive.vue b/src/views/modules/knifemold/receive.vue index 4d22330..21b2d05 100644 --- a/src/views/modules/knifemold/receive.vue +++ b/src/views/modules/knifemold/receive.vue @@ -272,7 +272,9 @@ saveTableDefaultList, saveTableUser, getTableDefaultListLanguage, - getTableUserListLanguage + getTableUserListLanguage, + removerDefault, + removerUser } from "@/api/table.js" import { @@ -348,8 +350,8 @@ invoicePrice : 0, site: this.$store.state.user.site, addLanguage: false, - functionId: 1001, - tableId: "1001viewIfsTable", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'VIFS01', value1: true, visible: false, showDefault: false, @@ -373,15 +375,15 @@ }, // 默认table 查询参数 queryTable: { - functionId: 1001, - tableId: "1001viewIfsTable", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'VIFS01', languageCode: this.$i18n.locale }, // 用户table 查询参数 queryTableUser: { userId: this.$store.state.user.name, - functionId: 1001, - tableId: "1001viewIfsTable", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'VIFS01', status: true, languageCode: this.$i18n.locale }, @@ -397,9 +399,8 @@ poToolColumnList : [ { userId: this.$store.state.user.name, - functionId: 1001, serialNumber: '1001viewIfsTableTransactionId', - tableId: "1001poToolTable", + tableId: this.$route.meta.menuId + 'VIFS01', tableName: "poToolTable", columnProp: "toolInstanceId", headerAlign: "center", @@ -414,9 +415,8 @@ }, { userId: this.$store.state.user.name, - functionId: 1001, serialNumber: '1001viewIfsTableToolDescription', - tableId: "1001poToolTable", + tableId: this.$route.meta.menuId + 'VIFS01', tableName: "poToolTable", columnProp: "toolDescription", headerAlign: "center", @@ -429,48 +429,13 @@ status: true, fixed: false }, - // { - // userId: this.$store.state.user.name, - // functionId: 1001, - // serialNumber: '1001viewIfsTableTransactionId', - // tableId: "1001poToolTable", - // tableName: "poToolTable", - // columnProp: "status2", - // headerAlign: "center", - // align: "center", - // columnLabel: "校验方式", - // columnHidden: false, - // columnImage: false, - // columnSortable: false, - // sortLv: 0, - // status: true, - // fixed: false - // }, - // { - // userId: this.$store.state.user.name, - // functionId: 1001, - // serialNumber: '1001viewIfsTableTransactionId', - // tableId: "1001poToolTable", - // tableName: "poToolTable", - // columnProp: "status", - // headerAlign: "center", - // align: "center", - // columnLabel: "是否检验", - // columnHidden: false, - // columnImage: false, - // columnSortable: false, - // sortLv: 0, - // status: true, - // fixed: false - // }, ], // 展示列集 columnList: [ { userId: this.$store.state.user.name, - functionId: 1001, serialNumber: '1001viewIfsTableTransactionId', - tableId: "1001viewIfsTable", + tableId: this.$route.meta.menuId + 'VIFS01', tableName: "viewIfsTable", columnProp: "transactionId", headerAlign: "center", @@ -485,9 +450,8 @@ }, { userId: this.$store.state.user.name, - functionId: 1001, serialNumber: '1001viewIfsTableToolId', - tableId: "1001viewIfsTable", + tableId: this.$route.meta.menuId + 'VIFS01', tableName: "viewIfsTable", columnProp: "toolId", headerAlign: "center", @@ -502,9 +466,8 @@ }, { userId: this.$store.state.user.name, - functionId: 1001, serialNumber: '1001viewIfsTableDescription', - tableId: "1001viewIfsTable", + tableId: this.$route.meta.menuId + 'VIFS01', tableName: "viewIfsTable", columnProp: "description", headerAlign: "center", @@ -517,45 +480,10 @@ status: true, fixed: false, }, - // { - // userId: this.$store.state.user.name, - // functionId: 1001, - // serialNumber: '1001viewIfsTableOrderNo', - // tableId: "1001viewIfsTable", - // tableName: "viewIfsTable", - // columnProp: "orderNo", - // headerAlign: "center", - // align: "center", - // columnLabel: "采购单号", - // columnHidden: false, - // columnImage: false, - // columnSortable: false, - // sortLv: 0, - // status: true, - // fixed: false, - // }, - // { - // userId: this.$store.state.user.name, - // functionId: 1001, - // serialNumber: '1001viewIfsTablelineItemNo', - // tableId: "1001viewIfsTable", - // tableName: "viewIfsTable", - // columnProp: "lineItemNo", - // headerAlign: "center", - // align: "center", - // columnLabel: "行号", - // columnHidden: false, - // columnImage: false, - // columnSortable: false, - // sortLv: 0, - // status: true, - // fixed: false, - // }, { userId: this.$store.state.user.name, - functionId: 1001, serialNumber: '1001viewIfsTableVendorNo', - tableId: "1001viewIfsTable", + tableId: this.$route.meta.menuId + 'VIFS01', tableName: "viewIfsTable", columnProp: "vendorNo", headerAlign: "center", @@ -570,9 +498,8 @@ }, { userId: this.$store.state.user.name, - functionId: 1001, serialNumber: '1001viewIfsTableVendorName', - tableId: "1001viewIfsTable", + tableId: this.$route.meta.menuId + 'VIFS01', tableName: "viewIfsTable", columnProp: "vendorName", headerAlign: "center", @@ -587,9 +514,8 @@ }, { userId: this.$store.state.user.name, - functionId: 1001, serialNumber: '1001viewIfsTableQuantity', - tableId: "1001viewIfsTable", + tableId: this.$route.meta.menuId + 'VIFS01', tableName: "viewIfsTable", columnProp: "quantity", headerAlign: "center", @@ -604,9 +530,8 @@ }, { userId: this.$store.state.user.name, - functionId: 1001, serialNumber: '1001viewIfsTableGenerateQuantity', - tableId: "1001viewIfsTable", + tableId: this.$route.meta.menuId + 'VIFS01', tableName: "viewIfsTable", columnProp: "generateQuantity", headerAlign: "center", @@ -707,8 +632,7 @@ columnList2: [ { userId: this.$store.state.user.name, - functionId: 2102, - tableId: "fileDetail2102", + tableId: this.$route.meta.menuId + 'VIFS02', tableName: "fileDetailTable", columnProp: "fileName", headerAlign: "center", @@ -723,8 +647,7 @@ }, { userId: this.$store.state.user.name, - functionId: 2102, - tableId: "fileDetail2102", + tableId: this.$route.meta.menuId + 'VIFS02', tableName: "fileDetailTable", columnProp: "createDate", headerAlign: "center", @@ -740,8 +663,7 @@ }, { userId: this.$store.state.user.name, - functionId: 2102, - tableId: "fileDetail2102", + tableId: this.$route.meta.menuId + 'VIFS02', tableName: "fileDetailTable", columnProp: "createdBy", headerAlign: "center", @@ -761,8 +683,8 @@ currSelectList : [], poToolList : [], queryButton: { - functionId: 1001, - table_id: '1001viewIfsTable', + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'VIFS01', languageCode: this.$i18n.locale, objectType: 'button' }, @@ -799,67 +721,67 @@ // 导出 end buttonList: [ { - functionId: "1001", + functionId: this.$route.meta.menuId, languageValue: '接收', objectId: 'receive', objectType: "button", - tableId: "1001viewIfsTable" + tableId: this.$route.meta.menuId + 'VIFS01', }, { - functionId: "1001", + functionId: this.$route.meta.menuId, languageValue: '生成', objectId: 'generate', objectType: "button", - tableId: "1001poToolTable" + tableId: this.$route.meta.menuId + 'VIFS01', }, { - functionId: "1001", + functionId: this.$route.meta.menuId, languageValue: '打印', objectId: 'print', objectType: "button", - tableId: "1001poToolTable" + tableId: this.$route.meta.menuId + 'VIFS01', }, { - functionId: "1001", + functionId: this.$route.meta.menuId, languageValue: '关闭', objectId: 'shutSown', objectType: "button", - tableId: "1001poToolTable" + tableId: this.$route.meta.menuId + 'VIFS01', }, { - functionId: "1001", + functionId: this.$route.meta.menuId, languageValue: '操作', objectId: 'operating', objectType: "button", - tableId: "1001viewIfsTable" + tableId: this.$route.meta.menuId + 'VIFS01', }, { - functionId: "1001", + functionId: this.$route.meta.menuId, languageValue: '查询', objectId: 'search', objectType: "button", - tableId: "1001viewIfsTable" + tableId: this.$route.meta.menuId + 'VIFS01', }, { - functionId: "1001", + functionId: this.$route.meta.menuId, languageValue: '导出', objectId: 'download', objectType: "button", - tableId: "1001viewIfsTable" + tableId: this.$route.meta.menuId + 'VIFS01', }, { - functionId: "1001", + functionId: this.$route.meta.menuId, languageValue: '设置列表', objectId: 'settingTable', objectType: "button", - tableId: "1001viewIfsTable" + tableId: this.$route.meta.menuId + 'VIFS01', }, { - functionId: "1001", + functionId: this.$route.meta.menuId, languageValue: '设置默认配置', objectId: 'defaultTable', objectType: "button", - tableId: "1001viewIfsTable" + tableId: this.$route.meta.menuId + 'VIFS01', }, ], languageList: [], @@ -1284,39 +1206,6 @@ // 收藏 favorites() { - }, - // 保存语言编辑 - saveLanguageList(val) { - saveSysLanguageOne(val).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - } else { - this.$message.error(data.msg) - } - }) - }, - // 编辑语言 - addLanguageFun() { - if (this.querySysLanguagePack.languageCode) { - this.addLanguage = true - this.languageColumnList = [] - let query = { - functionId: 1001, - tableId: "common1002", - languageCode: this.$i18n.locale - } - getTableDefaultListLanguage(query).then(({data}) => { - if (data.rows.length > 0) { - this.languageColumnList = data.rows - } - }) - this.languageColumnList = this.columnList - searchLanguageListByLanguageCode(this.querySysLanguagePack).then(({data}) => { - this.languageDataList = data.rows - }) - } else { - this.$message("请选中一种语言") - } }, // 获取多语言列表 getLanguageList() { @@ -1350,7 +1239,7 @@ getTableUserAll() { let queryTable = { userId: this.$store.state.user.name, - functionId: 1001, + functionId: this.$route.meta.menuId, tableId: this.tableId, languageCode: this.$i18n.locale } @@ -1360,7 +1249,6 @@ this.$refs.column.init(queryTable); }); }, - // 获取 用户保存的 格式列 getTableUserColumn() { getTableUserListLanguage(this.queryTableUser).then(({data}) => { @@ -1374,25 +1262,50 @@ }) }, // 保存 默认配置 列 - saveColumnList() { - - saveTableDefaultList(this.columnList).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - this.showDefault = false - } else { - this.$message.error(data.msg) + async saveColumnList() { + // 删除所有的该页面下保存的数据 + if (this.userColumnList) { + //删除 user自定义的数据 + await removerUser(this.queryTable) + } + // 删除默认配置 + await removerDefault(this.queryTable) + // 保存页面 table属性 + let sumColumnList = this.columnList.concat(this.columnList1); + sumColumnList = sumColumnList.map(item=> { + return item = { + tableId: item.tableId, + tableName: item.tableName, + columnProp: item.columnProp, + columnLabel: item.columnLabel, + columnHidden: false, + columnImage: false, + columnSortable: false, + columnWidth: null, + format: null, + functionId: this.$route.meta.menuId, + sortLv: 0, + status: true, + fixed: false, + serialNumber: null, + columnType: null, + align: null } }) - saveTableDefaultList(this.columnList1).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - this.showDefault = false - } else { - this.$message.error(data.msg) + + await saveTableDefaultList(sumColumnList) + // 保存页面 button label title 属性 + let buttons = this.buttonList.map( item => { + return item = { + functionId: this.$route.meta.menuId, + languageValue: item.languageValue, + objectId: item.objectId, + objectType: item.objectType, + tableId: item.tableId } }) - this.getFunctionButtonList(); + await saveButtonList(buttons) + this.getFunctionButtonList() this.getColumnList() }, // 获取 tableDefault 列 diff --git a/src/views/modules/purchaseorder/procurementReview.vue b/src/views/modules/purchaseorder/procurementReview.vue index 3865705..316953d 100644 --- a/src/views/modules/purchaseorder/procurementReview.vue +++ b/src/views/modules/purchaseorder/procurementReview.vue @@ -250,7 +250,9 @@ saveTableDefaultList, saveTableUser, getTableDefaultListLanguage, - getTableUserListLanguage + getTableUserListLanguage, + removerDefault, + removerUser } from "@/api/table.js" import { userFavoriteList, saveUserFavorite, removeUserFavorite @@ -323,8 +325,8 @@ // 是否收藏 favorite: false, addLanguage: false, - functionId: 2101, - tableId: "review2101", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'PRRE01', value1: true, visible: false, showDefault: false, @@ -347,15 +349,15 @@ }, // 默认table 查询参数 queryTable: { - functionId: 2101, - tableId: "review2101", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'PRRE01', languageCode: this.$i18n.locale }, // 用户table 查询参数 queryTableUser: { userId: this.$store.state.user.name, - functionId: 2101, - tableId: "review2101", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'PRRE01', status: true, languageCode: this.$i18n.locale }, @@ -371,9 +373,8 @@ columnList: [ { userId: this.$store.state.user.name, - functionId: 2101, serialNumber: 'review2101RequisitionNo', - tableId: "review2101", + tableId: this.$route.meta.menuId + 'PRRE01', tableName: "PRHeader", columnProp: "requisitionno", headerAlign: "center", @@ -389,9 +390,8 @@ }, { userId: this.$store.state.user.name, - functionId: 2101, serialNumber: 'review2101OrderType', - tableId: "review2101", + tableId: this.$route.meta.menuId + 'PRRE01', tableName: "PRHeader", columnProp: "orderType", headerAlign: "center", @@ -406,9 +406,8 @@ }, { userId: this.$store.state.user.name, - functionId: 2101, serialNumber: 'review2101Partno', - tableId: "review2101", + tableId: this.$route.meta.menuId + 'PRRE01', tableName: "PRHeader", columnProp: "partno", headerAlign: "center", @@ -423,9 +422,8 @@ }, { userId: this.$store.state.user.name, - functionId: 2101, serialNumber: 'review2101Qty', - tableId: "review2101", + tableId: this.$route.meta.menuId + 'PRRE01', tableName: "PRHeader", columnProp: "qty", headerAlign: "center", @@ -440,9 +438,8 @@ }, { userId: this.$store.state.user.name, - functionId: 2101, serialNumber: 'review2101Price', - tableId: "review2101", + tableId: this.$route.meta.menuId + 'PRRE01', tableName: "PRHeader", columnProp: "price", headerAlign: "center", @@ -457,9 +454,8 @@ }, { userId: this.$store.state.user.name, - functionId: 2101, serialNumber: 'review2101TotalPrice', - tableId: "review2101", + tableId: this.$route.meta.menuId + 'PRRE01', tableName: "PRHeader", columnProp: "totalPrice", headerAlign: "center", @@ -474,9 +470,8 @@ }, { userId: this.$store.state.user.name, - functionId: 2101, serialNumber: 'review2101Supplierid', - tableId: "review2101", + tableId: this.$route.meta.menuId + 'PRRE01', tableName: "PRHeader", columnProp: "supplierid", headerAlign: "center", @@ -491,9 +486,8 @@ }, { userId: this.$store.state.user.name, - functionId: 2101, serialNumber: 'review2101Suppliername', - tableId: "review2101", + tableId: this.$route.meta.menuId + 'PRRE01', tableName: "PRHeader", columnProp: "suppliername", headerAlign: "center", @@ -508,9 +502,8 @@ }, { userId: this.$store.state.user.name, - functionId: 2101, serialNumber: 'review2101FamilyName', - tableId: "review2101", + tableId: this.$route.meta.menuId + 'PRRE01', tableName: "PRHeader", columnProp: "familyName", headerAlign: "center", @@ -525,9 +518,8 @@ }, { userId: this.$store.state.user.name, - functionId: 2101, serialNumber: 'review2101EnterDate', - tableId: "review2101", + tableId: this.$route.meta.menuId + 'PRRE01', tableName: "PRHeader", columnProp: "enterDate", headerAlign: "center", @@ -542,9 +534,8 @@ }, { userId: this.$store.state.user.name, - functionId: 2101, serialNumber: 'review2101AuthorizeFlag', - tableId: "review2101", + tableId: this.$route.meta.menuId + 'PRRE01', tableName: "PRHeader", columnProp: "approveresult", headerAlign: "center", @@ -645,8 +636,7 @@ columnList2: [ { userId: this.$store.state.user.name, - functionId: 2102, - tableId: "fileDetail2102", + tableId: this.$route.meta.menuId + 'PRRE02', tableName: "fileDetailTable", columnProp: "fileName", headerAlign: "center", @@ -661,8 +651,7 @@ }, { userId: this.$store.state.user.name, - functionId: 2102, - tableId: "fileDetail2102", + tableId: this.$route.meta.menuId + 'PRRE02', tableName: "fileDetailTable", columnProp: "createDate", headerAlign: "center", @@ -678,8 +667,7 @@ }, { userId: this.$store.state.user.name, - functionId: 2102, - tableId: "fileDetail2102", + tableId: this.$route.meta.menuId + 'PRRE02', tableName: "fileDetailTable", columnProp: "createdBy", headerAlign: "center", @@ -697,8 +685,8 @@ // 数据集 dataList: [], queryButton: { - functionId: 2101, - table_id: 'review2101', + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'PRRE01', languageCode: this.$i18n.locale, objectType: 'button' }, @@ -1080,39 +1068,6 @@ } }, - // 保存语言编辑 - saveLanguageList(val) { - saveSysLanguageOne(val).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - } else { - this.$message.error(data.msg) - } - }) - }, - // 编辑语言 - addLanguageFun() { - if (this.querySysLanguagePack.languageCode) { - this.addLanguage = true - this.languageColumnList = [] - let query = { - functionId: 2101, - tableId: "review2101", - languageCode: this.$i18n.locale - } - getTableDefaultListLanguage(query).then(({data}) => { - if (data.rows.length > 0) { - this.languageColumnList = data.rows - } - }) - this.languageColumnList = this.columnList - searchLanguageListByLanguageCode(this.querySysLanguagePack).then(({data}) => { - this.languageDataList = data.rows - }) - } else { - this.$message("请选中一种语言") - } - }, // 获取多语言列表 getLanguageList() { searchSysLanguage(this.queryLanguage).then(({data}) => { @@ -1142,8 +1097,8 @@ this.visible = true; let queryTable = { userId: this.$store.state.user.name, - functionId: 2101, - tableId: "review2101", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'PRRE01', languageCode: this.$i18n.locale } this.$nextTick(() => { @@ -1163,25 +1118,50 @@ }) }, // 保存 默认配置 列 - saveColumnList() { - - saveTableDefaultList(this.columnList).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - this.showDefault = false - } else { - this.$message.error(data.msg) + async saveColumnList() { + // 删除所有的该页面下保存的数据 + if (this.userColumnList) { + //删除 user自定义的数据 + await removerUser(this.queryTable) + } + // 删除默认配置 + await removerDefault(this.queryTable) + // 保存页面 table属性 + let sumColumnList = this.columnList.concat(this.columnList1); + sumColumnList = sumColumnList.map(item=> { + return item = { + tableId: item.tableId, + tableName: item.tableName, + columnProp: item.columnProp, + columnLabel: item.columnLabel, + columnHidden: false, + columnImage: false, + columnSortable: false, + columnWidth: null, + format: null, + functionId: this.$route.meta.menuId, + sortLv: 0, + status: true, + fixed: false, + serialNumber: null, + columnType: null, + align: null } }) - saveTableDefaultList(this.columnList1).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - this.showDefault = false - } else { - this.$message.error(data.msg) + + await saveTableDefaultList(sumColumnList) + // 保存页面 button label title 属性 + let buttons = this.buttonList.map( item => { + return item = { + functionId: this.$route.meta.menuId, + languageValue: item.languageValue, + objectId: item.objectId, + objectType: item.objectType, + tableId: item.tableId } }) - this.getFunctionButtonList(); + await saveButtonList(buttons) + this.getFunctionButtonList() this.getColumnList() }, // 获取 tableDefault 列 diff --git a/src/views/modules/purchaseorder/purchaseRequisition.vue b/src/views/modules/purchaseorder/purchaseRequisition.vue index 960e9dd..71beeec 100644 --- a/src/views/modules/purchaseorder/purchaseRequisition.vue +++ b/src/views/modules/purchaseorder/purchaseRequisition.vue @@ -191,14 +191,14 @@ {{inputSearch10}} - + - + { - if (data.code == 0) { - this.$message.success(data.msg) - } else { - this.$message.error(data.msg) - } - }) - }, - // 编辑语言 - addLanguageFun() { - if (this.querySysLanguagePack.languageCode) { - this.addLanguage = true - this.languageColumnList = [] - let query = { - functionId: 2001, - tableId: "common1002", - languageCode: this.$i18n.locale - } - getTableDefaultListLanguage(query).then(({data}) => { - if (data.rows.length > 0) { - this.languageColumnList = data.rows - } - }) - this.languageColumnList = this.columnList - searchLanguageListByLanguageCode(this.querySysLanguagePack).then(({data}) => { - this.languageDataList = data.rows - }) - } else { - this.$message("请选中一种语言") - } - }, - // 获取多语言列表 - getLanguageList() { - searchSysLanguage(this.queryLanguage).then(({data}) => { - this.languageList = data.rows - }) - }, + // 获取button的词典 getFunctionButtonList() { searchFunctionButtonList(this.queryButton).then(({data}) => { @@ -1488,7 +1422,7 @@ export default { getTableUserAll() { let queryTable = { userId: this.$store.state.user.name, - functionId: 2001, + tableId: "common1001", languageCode: this.$i18n.locale } @@ -1553,25 +1487,50 @@ export default { }) }, // 保存 默认配置 列 - saveColumnList() { - - saveTableDefaultList(this.columnList).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - this.showDefault = false - } else { - this.$message.error(data.msg) + async saveColumnList() { + // 删除所有的该页面下保存的数据 + if (this.userColumnList) { + //删除 user自定义的数据 + await removerUser(this.queryTable) + } + // 删除默认配置 + await removerDefault(this.queryTable) + // 保存页面 table属性 + let sumColumnList = this.columnList.concat(this.columnList1); + sumColumnList = sumColumnList.map(item=> { + return item = { + tableId: item.tableId, + tableName: item.tableName, + columnProp: item.columnProp, + columnLabel: item.columnLabel, + columnHidden: false, + columnImage: false, + columnSortable: false, + columnWidth: null, + format: null, + functionId: this.$route.meta.menuId, + sortLv: 0, + status: true, + fixed: false, + serialNumber: null, + columnType: null, + align: null } }) - saveTableDefaultList(this.columnList1).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - this.showDefault = false - } else { - this.$message.error(data.msg) + + await saveTableDefaultList(sumColumnList) + // 保存页面 button label title 属性 + let buttons = this.buttonList.map( item => { + return item = { + functionId: this.$route.meta.menuId, + languageValue: item.languageValue, + objectId: item.objectId, + objectType: item.objectType, + tableId: item.tableId } }) - this.getFunctionButtonList(); + await saveButtonList(buttons) + this.getFunctionButtonList() this.getColumnList() }, // 获取 tableDefault 列 diff --git a/src/views/modules/warehouse/location.vue b/src/views/modules/warehouse/location.vue index 205f435..0f3a2ec 100644 --- a/src/views/modules/warehouse/location.vue +++ b/src/views/modules/warehouse/location.vue @@ -174,7 +174,9 @@ import column from "../common/column"; saveTableDefaultList, saveTableUser, getTableDefaultListLanguage, - getTableUserListLanguage + getTableUserListLanguage, + removerDefault, + removerUser } from "@/api/table.js" import { userFavoriteList, @@ -238,22 +240,22 @@ import { // 是否收藏 favorite: false, addLanguage: false, - functionId: 2601, - tableId: "location2601", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'LOTI01', value1: true, visible: false, showDefault: false, // 默认table 查询参数 queryTable: { - functionId: 2601, - tableId: "location2601", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'LOTI01', languageCode: this.$i18n.locale }, // 用户table 查询参数 queryTableUser: { userId: this.$store.state.user.name, - functionId: 2601, - tableId: "location2601", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'LOTI01', status: true, languageCode: this.$i18n.locale }, @@ -269,9 +271,8 @@ import { columnList: [ { userId: this.$store.state.user.name, - functionId: 2601, serialNumber: 'location2601LocationId', - tableId: "location2601", + tableId: this.$route.meta.menuId + 'LOTI01', tableName: "locationTable", columnProp: "locationId", headerAlign: "center", @@ -286,9 +287,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2601, serialNumber: 'location2601LocationName', - tableId: "location2601", + tableId: this.$route.meta.menuId + 'LOTI01', tableName: "locationTable", columnProp: "locationName", headerAlign: "center", @@ -303,9 +303,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2601, serialNumber: 'location2601WarehouseId', - tableId: "location2601", + tableId: this.$route.meta.menuId + 'LOTI01', tableName: "locationTable", columnProp: "warehouseId", headerAlign: "center", @@ -320,9 +319,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2601, serialNumber: 'location2601WarehouseName', - tableId: "location2601", + tableId: this.$route.meta.menuId + 'LOTI01', tableName: "locationTable", columnProp: "warehouseName", headerAlign: "center", @@ -337,9 +335,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2601, serialNumber: 'location2601StrActive', - tableId: "location2601", + tableId: this.$route.meta.menuId + 'LOTI01', tableName: "locationTable", columnProp: "strActive", headerAlign: "center", @@ -357,7 +354,7 @@ import { columnList1: [ // { // userId: this.$store.state.user.name, - // functionId: 2601, + // functionId: this.$route.meta.menuId, // tableId: "common1002", // tableName: "commonLanguage", // columnProp: "functionId", @@ -373,7 +370,7 @@ import { // }, // { // userId: this.$store.state.user.name, - // functionId: 2601, + // functionId: this.$route.meta.menuId, // tableId: "common1002", // tableName: "commonLanguage", // columnProp: "objectId", @@ -389,7 +386,7 @@ import { // }, // { // userId: this.$store.state.user.name, - // functionId: 2601, + // functionId: this.$route.meta.menuId, // tableId: "common1002", // tableName: "commonLanguage", // columnProp: "objectType", @@ -405,7 +402,7 @@ import { // }, // { // userId: this.$store.state.user.name, - // functionId: 2601, + // functionId: this.$route.meta.menuId, // tableId: "common1002", // tableName: "commonLanguage", // columnProp: "languageValue", @@ -421,7 +418,7 @@ import { // }, // { // userId: this.$store.state.user.name, - // functionId: 2601, + // functionId: this.$route.meta.menuId, // tableId: "common1002", // tableName: "commonLanguage", // columnProp: "languageCode", @@ -439,8 +436,8 @@ import { // 数据集 dataList: [], queryButton: { - functionId: 2601, - table_id: 'location2601', + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'LOTI01', languageCode: this.$i18n.locale, objectType: 'button' }, @@ -463,69 +460,60 @@ import { exportDefaultValue: "这一行这一列没有数据", // 导出 end buttonList: [ - // { - // functionId: "2601", - // languageValue: '添加', - // objectId: 'add', - // objectType: "button", - // tableId: "location2601" - // }, - // { - // functionId: "2601", - // languageValue: '编辑', - // objectId: 'edit', - // objectType: "button", - // tableId: "location2601" - // }, - // { - // functionId: "2601", - // languageValue: '删除', - // objectId: 'delete', - // objectType: "button", - // tableId: "location2601" - // }, - // { - // functionId: "2601", - // languageValue: '批量删除', - // objectId: 'deleteList', - // objectType: "button", - // tableId: "location2601" - // }, - // { - // functionId: "2601", - // languageValue: '操作', - // objectId: 'cz', - // objectType: "button", - // tableId: "location2601" - // }, - // { - // functionId: "2601", - // languageValue: '查询', - // objectId: 'search', - // objectType: "button", - // tableId: "location2601" - // }, - // { - // functionId: "2601", - // languageValue: '导出', - // objectId: 'download', - // objectType: "button", - // tableId: "location2601" - // }, - // { - // functionId: "2601", - // languageValue: '设置列表', - // objectId: 'settingTable', - // objectType: "button", - // tableId: "location2601" - // }, - // { - // functionId: "2601", - // languageValue: '设置默认配置', - // objectId: 'defaultTable', - // objectType: "button", - // tableId: "location2601" - // } + { + languageValue: '新增', + objectId: 'add', + objectType: "button", + tableId: this.$route.meta.menuId + 'LOTI01', + }, + { + languageValue: '编辑', + objectId: 'edit', + objectType: "button", + tableId: this.$route.meta.menuId + 'LOTI01', + }, + { + languageValue: '删除', + objectId: 'delete', + objectType: "button", + tableId: this.$route.meta.menuId + 'LOTI01', + }, + { + languageValue: '批量删除', + objectId: 'deleteList', + objectType: "button", + tableId: this.$route.meta.menuId + 'LOTI01', + }, + { + languageValue: '操作', + objectId: 'cz', + objectType: "button", + tableId: this.$route.meta.menuId + 'LOTI01', + }, + { + languageValue: '查询', + objectId: 'search', + objectType: "button", + tableId: this.$route.meta.menuId + 'LOTI01', + }, + { + languageValue: '导出', + objectId: 'download', + objectType: "button", + tableId: this.$route.meta.menuId + 'LOTI01', + }, + { + languageValue: '设置列表', + objectId: 'settingTable', + objectType: "button", + tableId: this.$route.meta.menuId + 'LOTI01', + }, + { + languageValue: '设置默认配置', + objectId: 'defaultTable', + objectType: "button", + tableId: this.$route.meta.menuId + 'LOTI01', + } ], languageList: [], languageColumnList: [], @@ -735,39 +723,6 @@ import { } }, - // 保存语言编辑 - saveLanguageList(val) { - saveSysLanguageOne(val).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - } else { - this.$message.error(data.msg) - } - }) - }, - // 编辑语言 - addLanguageFun() { - if (this.querySysLanguagePack.languageCode) { - this.addLanguage = true - this.languageColumnList = [] - let query = { - functionId: 2601, - tableId: "common1002", - languageCode: this.$i18n.locale - } - getTableDefaultListLanguage(query).then(({data}) => { - if (data.rows.length > 0) { - this.languageColumnList = data.rows - } - }) - this.languageColumnList = this.columnList - searchLanguageListByLanguageCode(this.querySysLanguagePack).then(({data}) => { - this.languageDataList = data.rows - }) - } else { - this.$message("请选中一种语言") - } - }, // 获取多语言列表 getLanguageList() { searchSysLanguage(this.queryLanguage).then(({data}) => { @@ -796,8 +751,8 @@ import { this.visible = true; let queryTable = { userId: this.$store.state.user.name, - functionId: 2601, - tableId: "location2601", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'LOTI01', languageCode: this.$i18n.locale } this.$nextTick(() => { @@ -817,28 +772,50 @@ import { }) }, // 保存 默认配置 列 - saveColumnList() { - - saveTableDefaultList(this.columnList).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - this.showDefault = false - } else { - this.$message.error(data.msg) + async saveColumnList() { + // 删除所有的该页面下保存的数据 + if (this.userColumnList) { + //删除 user自定义的数据 + await removerUser(this.queryTable) + } + // 删除默认配置 + await removerDefault(this.queryTable) + // 保存页面 table属性 + let sumColumnList = this.columnList.concat(this.columnList1); + sumColumnList = sumColumnList.map(item=> { + return item = { + tableId: item.tableId, + tableName: item.tableName, + columnProp: item.columnProp, + columnLabel: item.columnLabel, + columnHidden: false, + columnImage: false, + columnSortable: false, + columnWidth: null, + format: null, + functionId: this.$route.meta.menuId, + sortLv: 0, + status: true, + fixed: false, + serialNumber: null, + columnType: null, + align: null } }) - saveTableDefaultList(this.columnList1).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - this.showDefault = false - } else { - this.$message.error(data.msg) + + await saveTableDefaultList(sumColumnList) + // 保存页面 button label title 属性 + let buttons = this.buttonList.map( item => { + return item = { + functionId: this.$route.meta.menuId, + languageValue: item.languageValue, + objectId: item.objectId, + objectType: item.objectType, + tableId: item.tableId } }) - saveButtonList(this.buttonList).then(({data}) => { - }) + await saveButtonList(buttons) this.getFunctionButtonList() - this.getFunctionButtonList(); this.getColumnList() }, // 获取 tableDefault 列 diff --git a/src/views/modules/warehouse/warehouse.vue b/src/views/modules/warehouse/warehouse.vue index 13081b8..0800d4d 100644 --- a/src/views/modules/warehouse/warehouse.vue +++ b/src/views/modules/warehouse/warehouse.vue @@ -149,7 +149,9 @@ import column from "../common/column"; saveTableDefaultList, saveTableUser, getTableDefaultListLanguage, - getTableUserListLanguage + getTableUserListLanguage, + removerDefault, + removerUser } from "@/api/table.js" import { userFavoriteList, @@ -215,22 +217,22 @@ import { // 是否收藏 favorite: false, addLanguage: false, - functionId: 2501, - tableId: "wareHouse2501", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'WAHO01', value1: true, visible: false, - showDefault: false, + showDefault: true, // 默认table 查询参数 queryTable: { - functionId: 2501, - tableId: "wareHouse2501", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'WAHO01', languageCode: this.$i18n.locale }, // 用户table 查询参数 queryTableUser: { userId: this.$store.state.user.name, - functionId: 2501, - tableId: "wareHouse2501", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'WAHO01', status: true, languageCode: this.$i18n.locale }, @@ -246,9 +248,8 @@ import { columnList: [ { userId: this.$store.state.user.name, - functionId: 2501, serialNumber: 'wareHouse2501WareHouseId', - tableId: "wareHouse2501", + tableId: this.$route.meta.menuId + 'WAHO01', tableName: "wareHouseTable", columnProp: "wareHouseId", headerAlign: "center", @@ -264,9 +265,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2501, serialNumber: 'wareHouse2501WareHouseName', - tableId: "wareHouse2501", + tableId: this.$route.meta.menuId + 'WAHO01', tableName: "wareHouseTable", columnProp: "wareHouseName", headerAlign: "center", @@ -281,9 +281,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2501, serialNumber: 'wareHouse2501WareHouseType', - tableId: "wareHouse2501", + tableId: this.$route.meta.menuId + 'WAHO01', tableName: "wareHouseTable", columnProp: "wareHouseTypeDb", headerAlign: "center", @@ -298,9 +297,8 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2501, serialNumber: 'wareHouse2501WareHouseTypeDb', - tableId: "wareHouse2501", + tableId: this.$route.meta.menuId + 'WAHO01', tableName: "wareHouseTable", columnProp: "wareHouseType", headerAlign: "center", @@ -315,9 +313,9 @@ import { }, /* { userId: this.$store.state.user.name, - functionId: 2501, + functionId: this.$route.meta.menuId, serialNumber: 'wareHouse2501Keeper', - tableId: "wareHouse2501", + tableId: this.$route.meta.menuId + 'WAHO01', tableName: "wareHouseTable", columnProp: "keeper", headerAlign: "center", @@ -332,9 +330,9 @@ import { }, { userId: this.$store.state.user.name, - functionId: 2501, + functionId: this.$route.meta.menuId, serialNumber: 'wareHouse2501CompanyId', - tableId: "wareHouse2501", + tableId: this.$route.meta.menuId + 'WAHO01', tableName: "wareHouseTable", columnProp: "companyId", headerAlign: "center", @@ -349,9 +347,8 @@ import { },*/ { userId: this.$store.state.user.name, - functionId: 2501, serialNumber: 'wareHouse2501StrActive', - tableId: "wareHouse2501", + tableId: this.$route.meta.menuId + 'WAHO01', tableName: "wareHouseTable", columnProp: "strActive", headerAlign: "center", @@ -369,7 +366,7 @@ import { columnList1: [ // { // userId: this.$store.state.user.name, - // functionId: 2501, + // functionId: this.$route.meta.menuId, // tableId: "common1002", // tableName: "commonLanguage", // columnProp: "functionId", @@ -385,7 +382,7 @@ import { // }, // { // userId: this.$store.state.user.name, - // functionId: 2501, + // functionId: this.$route.meta.menuId, // tableId: "common1002", // tableName: "commonLanguage", // columnProp: "objectId", @@ -401,7 +398,7 @@ import { // }, // { // userId: this.$store.state.user.name, - // functionId: 2501, + // functionId: this.$route.meta.menuId, // tableId: "common1002", // tableName: "commonLanguage", // columnProp: "objectType", @@ -417,7 +414,7 @@ import { // }, // { // userId: this.$store.state.user.name, - // functionId: 2501, + // functionId: this.$route.meta.menuId, // tableId: "common1002", // tableName: "commonLanguage", // columnProp: "languageValue", @@ -433,7 +430,7 @@ import { // }, // { // userId: this.$store.state.user.name, - // functionId: 2501, + // functionId: this.$route.meta.menuId, // tableId: "common1002", // tableName: "commonLanguage", // columnProp: "languageCode", @@ -451,8 +448,8 @@ import { // 数据集 dataList: [], queryButton: { - functionId: 2501, - table_id: 'wareHouse2501', + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'WAHO01', languageCode: this.$i18n.locale, objectType: 'button' }, @@ -476,67 +473,59 @@ import { // 导出 end buttonList: [ { - functionId: "2501", - languageValue: '添加', + languageValue: '新增', objectId: 'add', objectType: "button", - tableId: "wareHouse2501" + tableId: this.$route.meta.menuId + 'WAHO01', }, { - functionId: "2501", languageValue: '编辑', objectId: 'edit', objectType: "button", - tableId: "wareHouse2501" + tableId: this.$route.meta.menuId + 'WAHO01', }, { - functionId: "2501", languageValue: '删除', objectId: 'delete', objectType: "button", - tableId: "wareHouse2501" + tableId: this.$route.meta.menuId + 'WAHO01', }, // { - // functionId: "2501", + // // languageValue: '批量删除', // objectId: 'deleteList', // objectType: "button", - // tableId: "wareHouse2501" + // tableId: this.$route.meta.menuId + 'WAHO01', // }, { - functionId: "2501", languageValue: '操作', objectId: 'cz', objectType: "button", - tableId: "wareHouse2501" + tableId: this.$route.meta.menuId + 'WAHO01', }, { - functionId: "2501", languageValue: '查询', objectId: 'search', objectType: "button", - tableId: "wareHouse2501" + tableId: this.$route.meta.menuId + 'WAHO01', }, { - functionId: "2501", languageValue: '导出', objectId: 'download', objectType: "button", - tableId: "wareHouse2501" + tableId: this.$route.meta.menuId + 'WAHO01', }, { - functionId: "2501", languageValue: '设置列表', objectId: 'settingTable', objectType: "button", - tableId: "wareHouse2501" + tableId: this.$route.meta.menuId + 'WAHO01', }, { - functionId: "2501", languageValue: '设置默认配置', objectId: 'defaultTable', objectType: "button", - tableId: "wareHouse2501" + tableId: this.$route.meta.menuId + 'WAHO01', } ], languageList: [], @@ -769,7 +758,7 @@ import { this.addLanguage = true this.languageColumnList = [] let query = { - functionId: 2501, + functionId: this.$route.meta.menuId, tableId: "common1002", languageCode: this.$i18n.locale } @@ -814,8 +803,8 @@ import { this.visible = true; let queryTable = { userId: this.$store.state.user.name, - functionId: 2501, - tableId: "wareHouse2501", + functionId: this.$route.meta.menuId, + tableId: this.$route.meta.menuId + 'WAHO01', languageCode: this.$i18n.locale } this.$nextTick(() => { @@ -835,28 +824,50 @@ import { }) }, // 保存 默认配置 列 - saveColumnList() { - - saveTableDefaultList(this.columnList).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - this.showDefault = false - } else { - this.$message.error(data.msg) + async saveColumnList() { + // 删除所有的该页面下保存的数据 + if (this.userColumnList) { + //删除 user自定义的数据 + await removerUser(this.queryTable) + } + // 删除默认配置 + await removerDefault(this.queryTable) + // 保存页面 table属性 + let sumColumnList = this.columnList.concat(this.columnList1); + sumColumnList = sumColumnList.map(item=> { + return item = { + tableId: item.tableId, + tableName: item.tableName, + columnProp: item.columnProp, + columnLabel: item.columnLabel, + columnHidden: false, + columnImage: false, + columnSortable: false, + columnWidth: null, + format: null, + functionId: this.$route.meta.menuId, + sortLv: 0, + status: true, + fixed: false, + serialNumber: null, + columnType: null, + align: null } }) - saveTableDefaultList(this.columnList1).then(({data}) => { - if (data.code == 0) { - this.$message.success(data.msg) - this.showDefault = false - } else { - this.$message.error(data.msg) + + await saveTableDefaultList(sumColumnList) + // 保存页面 button label title 属性 + let buttons = this.buttonList.map( item => { + return item = { + functionId: this.$route.meta.menuId, + languageValue: item.languageValue, + objectId: item.objectId, + objectType: item.objectType, + tableId: item.tableId } }) - saveButtonList(this.buttonList).then(({data}) => { - }) + await saveButtonList(buttons) this.getFunctionButtonList() - this.getFunctionButtonList(); this.getColumnList() }, // 获取 tableDefault 列