From 8163e42a218b736138da5ad6ba35a50647ccc854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AD=A3=E6=98=93?= Date: Thu, 31 Jul 2025 14:34:19 +0800 Subject: [PATCH] =?UTF-8?q?feat(workorder):=20=E6=9B=B4=E6=96=B0=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD=E5=B9=B6=E5=8D=87?= =?UTF-8?q?=E7=BA=A7vxe-table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在workorder_online.vue中添加当前日期初始化逻辑 - 升级vxe-table及相关插件版本 - 重构vxe-table初始化代码 - 在workplan2.vue中添加物料异常统计功能 - 优化workorder2.vue的拖拽排序功能,使用vxe-table内置拖拽 - 更新dayjs插件配置,添加周数支持 --- package.json | 5 +- src/main.js | 28 +- src/views/productManagement/workorder2.vue | 1072 ++++++++--------- .../productManagement/workorder_online.vue | 5 + src/views/productManagement/workplan2.vue | 872 +++++++------- 5 files changed, 1017 insertions(+), 965 deletions(-) diff --git a/package.json b/package.json index d7b5ff1..b745b32 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@microsoft/signalr": "^6.0.23", "@riophae/vue-treeselect": "0.4.0", "@vue/composition-api": "^1.7.2", + "@vxe-ui/plugin-export-xlsx": "^3.2.3", "af-table-column": "^1.0.3", "animate.css": "^4.1.1", "axios": "^0.21.4", @@ -67,8 +68,8 @@ "vue-seamless-scroll": "^1.1.23", "vuedraggable": "^2.20.0", "vuex": "3.6.0", - "vxe-table": "^3.7.8", - "vxe-table-plugin-export-xlsx": "legacy", + "vxe-pc-ui": "^3.8.2", + "vxe-table": "^3.16.8", "xe-utils": "^3.5.11", "xlsx": "^0.18.5" }, diff --git a/src/main.js b/src/main.js index 98cf4ec..4499bb6 100644 --- a/src/main.js +++ b/src/main.js @@ -45,13 +45,25 @@ import printJS from 'print-js' import * as echarts from 'echarts' import ECharts from 'vue-echarts' // VXE-Table相关组件 -import VXETable from 'vxe-table' -import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx' -import ExcelJS from 'exceljs' -VXETable.use(VXETablePluginExportXLSX, { - ExcelJS, -}) +// import VXETable from 'vxe-table' +// import 'vxe-table/lib/style.css' +// import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx' +// vxe-table 3.x版本不需要传入ExcelJS参数 +// VXETable.use(VXETablePluginExportXLSX) + +// vxe-table更新用法 ============================= +import VxeUIAll, { VxeUI } from 'vxe-pc-ui' +import 'vxe-pc-ui/lib/style.css' +import VxeUITable from 'vxe-table' import 'vxe-table/lib/style.css' +import VxeUIPluginExportXLSX from '@vxe-ui/plugin-export-xlsx' +import ExcelJS from 'exceljs' +VxeUI.use(VxeUIPluginExportXLSX, { + ExcelJS +}) +Vue.use(VxeUIAll) +Vue.use(VxeUITable) +// =========================================== import dataV from '@jiaminghi/data-view' @@ -62,11 +74,13 @@ import AFTableColumn from 'af-table-column' import dayjs from 'dayjs' import 'dayjs/locale/zh-cn' // 引入中文语言包 import relativeTime from 'dayjs/plugin/relativeTime' +import weekOfYear from 'dayjs/plugin/weekOfYear' import utc from 'dayjs/plugin/utc' import timezone from 'dayjs/plugin/timezone' dayjs.extend(utc) dayjs.extend(timezone) dayjs.extend(relativeTime) +dayjs.extend(weekOfYear) dayjs.tz.setDefault('Asia/Shanghai') // mdicon import '@mdi/font/css/materialdesignicons.css' @@ -115,7 +129,7 @@ Vue.use(Element, { size: Cookies.get('size') || 'small', // set element-ui default size }) -Vue.use(VXETable) +//Vue.use(VXETable) Vue.use(dataV) Vue.use(AFTableColumn) diff --git a/src/views/productManagement/workorder2.vue b/src/views/productManagement/workorder2.vue index f7c0d0c..2738fb4 100644 --- a/src/views/productManagement/workorder2.vue +++ b/src/views/productManagement/workorder2.vue @@ -6,7 +6,8 @@ - + @@ -28,28 +29,33 @@ 导出工单 删除工单 生成工单 -
- - {{item.text}}:{{checkNumOption[index]}} + + {{ item.text }}:{{ checkNumOption[index] }}
当前首检工单: - {{nowOrderRetainStr}} + {{ nowOrderRetainStr }}
- +
将文件拖到此处,或点击上传
-
是否更新已经存在的生产工单
+
是否更新已经存在的生产工单 +
仅允许导入xls、xlsx格式文件。 - 下载模板 + 下载模板
- - + + - \ No newline at end of file diff --git a/src/views/productManagement/workorder_online.vue b/src/views/productManagement/workorder_online.vue index d204d32..d3fa6b6 100644 --- a/src/views/productManagement/workorder_online.vue +++ b/src/views/productManagement/workorder_online.vue @@ -96,6 +96,11 @@ export default { } }, mounted() { + const today = this.$dayjs(); + this.search.year = today.year(); + this.search.week = today.week(); + // 将0(周日)转为7 + this.search.date = today.day() === 0 ? 7 : today.day(); this.getList() }, methods: { diff --git a/src/views/productManagement/workplan2.vue b/src/views/productManagement/workplan2.vue index a499727..4054522 100644 --- a/src/views/productManagement/workplan2.vue +++ b/src/views/productManagement/workplan2.vue @@ -6,7 +6,8 @@
- + @@ -22,11 +23,11 @@
- - + + {{ materialNotFoundCount }} - - + + {{ materialSpecColorErrorCount }} {{ weekAll.requireNum }} @@ -49,7 +50,8 @@ 删除本周计划
- + @@ -76,21 +78,28 @@ - + - +
将文件拖到此处,或点击上传
-
是否更新已经存在的生产计划
+
是否更新已经存在的生产计划 +
仅允许导入xls、xlsx格式文件。 - 下载模板 + 下载模板
上传导入时间:{{ upload.time }} @@ -119,10 +128,12 @@ - + - + +
@@ -132,24 +143,31 @@ - + + - + + - + + - + + - + + - + + @@ -160,20 +178,26 @@ - + - + + - + + - + + - + + @@ -186,216 +210,230 @@ \ No newline at end of file