diff --git a/src/views/modules/schedule/order_schedule_expand.vue b/src/views/modules/schedule/order_schedule_expand.vue index b45772a..5fb2e79 100644 --- a/src/views/modules/schedule/order_schedule_expand.vue +++ b/src/views/modules/schedule/order_schedule_expand.vue @@ -1119,6 +1119,8 @@ export default { created() { //查询工单的数据 this.getShopOrderList(); + //初始化动态的表头 + this.get }, /*利用监听器处理大小写*/ diff --git a/src/views/modules/schedule/order_schedule_fqc.vue b/src/views/modules/schedule/order_schedule_fqc.vue index 3d2e787..a778daa 100644 --- a/src/views/modules/schedule/order_schedule_fqc.vue +++ b/src/views/modules/schedule/order_schedule_fqc.vue @@ -208,11 +208,13 @@ 重新排产 - + 生产订单 + {{ buttons.settingTable }} + {{ buttons.defaultTable }} @@ -307,6 +309,8 @@ 生产订单 + {{ buttons.settingTable }} + {{ buttons.defaultTable }} @@ -358,6 +362,9 @@ :visible.sync="showBatchWorkCalendar"> + + + @@ -365,6 +372,8 @@ /*组件*/ import comWorkCalendarOut from "../common/com_work_calendar_out";/*工作日历外组件*/ import comBatchWorkCalendar from "../common/com_batch_work_calendar";/*批量维护工作日历外组件*/ +import column from '@/views/modules/common/column';/*动态表头*/ + import { getShopOrderListWithFqc, getOperatorListWithFqc, @@ -376,11 +385,22 @@ import { moveDownSchedule, getCalendarMapByResourceId,/*获取人员的班次*/ getShopOrderByCon,/*刷新工单数据使用*/ -} from '@/api/schedule/order_schedule_fqc.js' +} from '@/api/schedule/order_schedule_fqc.js'; + +/*动态表头*/ +import { + saveTableDefaultList, + getTableDefaultListLanguage, + getTableUserListLanguage, + removerDefault, + removerUser +} from "@/api/table.js"; export default { data() { return { + showDefault: false, + visible: false, tableHeight: 0, tableLeftWidth: 0, tableRightWidth: 0, @@ -452,7 +472,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -470,7 +490,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -488,7 +508,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -506,7 +526,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -524,7 +544,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -542,7 +562,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -560,7 +580,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -578,7 +598,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -596,7 +616,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -614,7 +634,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -632,7 +652,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -650,7 +670,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -668,7 +688,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -686,7 +706,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -704,7 +724,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -722,7 +742,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -740,7 +760,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -758,7 +778,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -776,7 +796,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -794,7 +814,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -812,7 +832,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -830,7 +850,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -848,7 +868,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -866,7 +886,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -884,7 +904,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -902,7 +922,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -920,7 +940,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -938,7 +958,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -956,7 +976,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -974,7 +994,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -992,7 +1012,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1010,7 +1030,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1028,7 +1048,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1046,7 +1066,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' } ], columnOperatorArray: [ @@ -1066,7 +1086,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1084,7 +1104,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1102,7 +1122,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1120,7 +1140,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1138,7 +1158,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1156,7 +1176,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1174,7 +1194,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' } ], columnOrderScheduleArray: [ @@ -1194,7 +1214,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1212,7 +1232,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1230,7 +1250,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1248,7 +1268,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1266,7 +1286,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1284,7 +1304,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1302,7 +1322,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1320,7 +1340,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1338,7 +1358,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1356,7 +1376,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1374,7 +1394,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1392,7 +1412,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' } ], operatorMenuButton: { @@ -1401,12 +1421,43 @@ export default { reScheduleOrderFlag: true, partStockFlag: true, }, + buttons: { + settingLanguageList: '按语言设置', + edit: '编辑', + delete: '删除', + deleteList: '批量删除', + cz: '操作', + search: '查询', + download: '导出', + settingTable: '设置列表', + defaultTable: '设置默认配置', + list: "列表", + addList: '批量添加', + settingLanguage: "按控件设置" + }, + queryTable:{ + userId: this.$store.state.user.name, + functionId: this.$route.meta.menuId, + tableId: "5304Order", + languageCode: this.$i18n.locale + }, + // 用户table 查询参数 + queryTableUser: { + userId: this.$store.state.user.name, + functionId: this.$route.meta.menuId, + tableId: "5304Order", + status: true, + languageCode: this.$i18n.locale + }, + // 用户table 配置集合 + userColumnList: [], } }, /*注册组件*/ components: { comWorkCalendarOut,/*工作日历外*/ comBatchWorkCalendar,/*批量维护工作日历外组件*/ + column,/*动态列*/ }, mounted() { this.$nextTick(() => { @@ -1922,8 +1973,115 @@ export default { } }, + // 打开页面设置 + userSetting(tableId) { + this.visible = true; + let queryTable = { + userId: this.$store.state.user.name, + functionId: this.$route.meta.menuId, + tableId: tableId, + languageCode: this.$i18n.locale + } + this.$nextTick(() => { + this.$refs.column.init(queryTable); + }); + }, + // 获取 用户保存的 格式列 + getTableUserColumn(tableId) { + //判断是否是null + if(!(null === tableId || "" === tableId)){ + this.queryTableUser.tableId = tableId; + } + getTableUserListLanguage(this.queryTableUser).then(({data}) => { + if (data.rows.length > 0) { + //this.columnList = [] + //如果是订单表 + if('5304Order' === tableId){ + this.columnOrderArray = data.rows; + }else if('5304Schedule' === tableId){ + this.columnOrderScheduleArray = data.rows; + } + } else { + this.getColumnList(tableId); + } + + }) + }, + // 保存 默认配置 列 + async saveColumnList(tableId) { + //重置tableId + this.queryTable.tableId = tableId; + this.queryTableUser.tableId = tableId; + // 删除所有的该页面下保存的数据 + if (this.userColumnList) { + //删除 user自定义的数据 + await removerUser(this.queryTable) + } + // 删除默认配置 + await removerDefault(this.queryTable) + // 保存页面 table属性 + let sumColumnList = this.columnOrderScheduleArray.concat(this.columnOrderArray); + 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: item.columnWidth, + format: item.format, + functionId: this.$route.meta.menuId, + sortLv: item.sortLv, + status: true, + fixed: item.fixed, + serialNumber: item.serialNumber, + columnType: item.columnType, + align: item.align + } + }) + + 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 + } + }) + await saveButtonList(buttons)*/ + this.getFunctionButtonList() + this.getColumnList() + }, + // 获取 tableDefault 列 + getColumnList(tableId) { + //判断是否是null + if(!(null === tableId || "" === tableId)){ + this.queryTable.tableId = tableId; + } + getTableDefaultListLanguage(this.queryTable).then(({data}) => { + if (!data.rows.length == 0) { + // this.showDefault = false + //如果是订单表 + if('5304Order' === tableId){ + this.columnOrderArray = data.rows; + }else if('5304Schedule' === tableId){ + this.columnOrderScheduleArray = data.rows; + } + } else { + // this.showDefault = true + } + }) + }, + }, created() { + //获取动态表头的信息 + this.getTableUserColumn('5304Order'); //查询工单的数据 //this.getShopOrderList(); //查询派工的数据 @@ -1935,6 +2093,11 @@ export default { if (menList.length > 0){ this.shopOrderFlag = false; } + //延迟操作 + setTimeout(item =>{ + //分布执行 + this.getTableUserColumn('5304Schedule'); + },3000); } } diff --git a/src/views/modules/yieldReport/produce_order.vue b/src/views/modules/yieldReport/produce_order.vue index 366070f..360e148 100644 --- a/src/views/modules/yieldReport/produce_order.vue +++ b/src/views/modules/yieldReport/produce_order.vue @@ -330,7 +330,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -348,7 +348,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -366,7 +366,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -384,7 +384,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -402,7 +402,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -420,7 +420,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -438,7 +438,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -456,7 +456,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -474,7 +474,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -492,7 +492,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -510,7 +510,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -528,7 +528,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -546,7 +546,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -564,7 +564,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -582,7 +582,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -600,7 +600,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -618,7 +618,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -636,7 +636,7 @@ export default { columnSortable: true, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -654,7 +654,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -672,7 +672,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -690,7 +690,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -708,7 +708,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -726,7 +726,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -744,7 +744,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -762,7 +762,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -780,7 +780,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -798,7 +798,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -816,7 +816,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -834,7 +834,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -852,7 +852,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -870,7 +870,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -888,7 +888,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -906,7 +906,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -924,7 +924,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -942,7 +942,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -960,7 +960,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -978,7 +978,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -996,7 +996,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1014,7 +1014,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1032,7 +1032,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1050,7 +1050,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1068,7 +1068,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1086,7 +1086,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1104,7 +1104,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, { userId: this.$store.state.user.name, @@ -1122,7 +1122,7 @@ export default { columnSortable: false, sortLv: 0, status: true, - fixed: false + fixed: '' }, ], @@ -2063,10 +2063,10 @@ export default { // 获取 用户保存的 格式列 getTableUserColumn() { getTableUserListLanguage(this.queryTableUser).then(({data}) => { - if (data.rows.length > 0) { + if ( data && data.code == 0 && data.rows.length > 0) { //this.columnList = [] this.columnList = data.rows - } else { + } else { this.getColumnList() } @@ -2122,7 +2122,7 @@ export default { // 获取 tableDefault 列 getColumnList() { getTableDefaultListLanguage(this.queryTable).then(({data}) => { - if (!data.rows.length == 0) { + if (data && data.code == 0) { // this.showDefault = false this.columnList = data.rows } else { @@ -2176,7 +2176,8 @@ export default { this.reportButton.slitReportButton = true; } }); - + //获取动态表头的信息 + this.getTableUserColumn(); } }