From b82ec60b612f8d920121f0442a911405404f576f Mon Sep 17 00:00:00 2001 From: tzy <1042411602@qq.com> Date: Tue, 11 Aug 2026 14:46:49 +0800 Subject: [PATCH] 0811 --- .gitignore | 35 +- package.json | 10 +- src/api/system/dingSchemeApplication.js | 27 + src/api/system/materialDocHub.js | 67 + src/api/system/nd3PhasedProduct.js | 38 + src/api/system/operationPlanningMain.js | 37 + src/api/system/orderPro.js | 67 + src/api/system/plmPdfZipPush.js | 27 + src/api/system/plmReceiveLog.js | 26 + src/api/system/productionBoard.js | 10 + src/api/system/ratio.js | 12 + src/api/system/route.js | 8 + src/api/system/workAlertPushConfig.js | 54 + src/api/system/workCenterData.js | 128 + src/assets/icons/svg/404.svg | 2 +- src/assets/icons/svg/bug.svg | 2 +- src/assets/icons/svg/dict.svg | 2 +- src/assets/icons/svg/language.svg | 2 +- src/assets/icons/svg/time-range.svg | 2 +- src/assets/icons/svg/tree.svg | 2 +- src/background.js | 76 + src/components/Pagination/index.vue | 23 +- src/permission.js | 27 +- src/router/index.js | 96 +- src/views/demo/addgongxu/fromed.vue | 3 +- src/views/system/details/index.vue | 1626 +++++--- .../system/dingSchemeApplication/index.vue | 840 ++++ .../materialDocHub/MaterialTableBlock.vue | 71 + src/views/system/materialDocHub/index.vue | 611 +++ src/views/system/nd3PhasedProduct/index.vue | 739 ++++ .../CapacityAnalysis.vue | 570 +++ .../CapacityAnalysisPage.vue | 86 + .../system/operationPlanningMain/index.vue | 735 ++-- src/views/system/orderPro/index.vue | 3599 +++++++++++++++-- src/views/system/plan/index.vue | 2 +- src/views/system/plmPdfZipPush/index.vue | 706 ++++ src/views/system/plmReceiveLog/index.vue | 586 +++ src/views/system/produceKanban/index.vue | 607 +++ src/views/system/productionBoard/index.vue | 1231 ++++++ src/views/system/productionRemind/index.vue | 567 +++ src/views/system/ratio/index.vue | 185 + src/views/system/route/bomfrom.vue | 1 + src/views/system/route/index.vue | 286 +- src/views/system/route/index_backup.vue | 36 +- .../system/workAlertPushConfig/index.vue | 424 ++ src/views/system/workCenterAlert/index.vue | 1827 +++++++++ vue.config.js | 17 +- 47 files changed, 14629 insertions(+), 1506 deletions(-) create mode 100644 src/api/system/dingSchemeApplication.js create mode 100644 src/api/system/materialDocHub.js create mode 100644 src/api/system/nd3PhasedProduct.js create mode 100644 src/api/system/plmPdfZipPush.js create mode 100644 src/api/system/plmReceiveLog.js create mode 100644 src/api/system/productionBoard.js create mode 100644 src/api/system/ratio.js create mode 100644 src/api/system/workAlertPushConfig.js create mode 100644 src/background.js create mode 100644 src/views/system/dingSchemeApplication/index.vue create mode 100644 src/views/system/materialDocHub/MaterialTableBlock.vue create mode 100644 src/views/system/materialDocHub/index.vue create mode 100644 src/views/system/nd3PhasedProduct/index.vue create mode 100644 src/views/system/operationPlanningMain/CapacityAnalysis.vue create mode 100644 src/views/system/operationPlanningMain/CapacityAnalysisPage.vue create mode 100644 src/views/system/plmPdfZipPush/index.vue create mode 100644 src/views/system/plmReceiveLog/index.vue create mode 100644 src/views/system/produceKanban/index.vue create mode 100644 src/views/system/productionBoard/index.vue create mode 100644 src/views/system/productionRemind/index.vue create mode 100644 src/views/system/ratio/index.vue create mode 100644 src/views/system/workAlertPushConfig/index.vue create mode 100644 src/views/system/workCenterAlert/index.vue diff --git a/.gitignore b/.gitignore index f215d2e..4283881 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,36 @@ +# Dependencies +node_modules/ package-lock.json yarn.lock -node_modules + +# Build outputs +dist/ +dist_electron/ +unpackage/ +*.local + +# Logs / cache +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +*.log +.cache/ +.temp/ + +# IDE / OS +.idea/ +.vscode/ +*.iml +.DS_Store +Thumbs.db +Desktop.ini +.cursor/ + +# Local / temp +response.json +*.tmp +*.bak +*.swp +.env.local +.env.*.local diff --git a/package.json b/package.json index d76a85d..16bc6f9 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,12 @@ "author": "tzy", "license": "MIT", "scripts": { - "dev": "vue-cli-service serve", - "build:prod": "vue-cli-service build", + "dev": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve", + "build:prod": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build", "preview": "node build/index.js --preview", - "lint": "eslint --ext .js,.vue src" + "lint": "eslint --ext .js,.vue src", + "electron:serve": "vue-cli-service electron:serve", + "electron:build": "vue-cli-service electron:build" }, "husky": { "hooks": { @@ -82,6 +84,7 @@ "compression-webpack-plugin": "5.0.2", "connect": "3.6.6", "echarts": "^5.6.0", + "electron": "^13.0.0", "eslint": "^6.0.1", "eslint-plugin-vue": "7.2.0", "less": "^4.2.0", @@ -92,6 +95,7 @@ "sass-loader": "10.1.1", "script-ext-html-webpack-plugin": "2.1.5", "svg-sprite-loader": "5.1.1", + "vue-cli-plugin-electron-builder": "^2.1.1", "vue-template-compiler": "2.6.12" }, "engines": { diff --git a/src/api/system/dingSchemeApplication.js b/src/api/system/dingSchemeApplication.js new file mode 100644 index 0000000..5457f17 --- /dev/null +++ b/src/api/system/dingSchemeApplication.js @@ -0,0 +1,27 @@ +import request from '@/utils/request' + +// 分页查询技术方案申请归档 +export function listDingSchemeApplication(query) { + return request({ + url: '/system/ding/scheme/list', + method: 'get', + params: query + }) +} + +// 查询技术方案申请详情 +export function getDingSchemeApplication(id) { + return request({ + url: '/system/ding/scheme/' + id, + method: 'get' + }) +} + +// 手动推送 PLM +export function pushDingSchemePlm(id, force) { + return request({ + url: '/system/ding/scheme/' + id + '/push-plm', + method: 'post', + params: { force: !!force } + }) +} diff --git a/src/api/system/materialDocHub.js b/src/api/system/materialDocHub.js new file mode 100644 index 0000000..46796a0 --- /dev/null +++ b/src/api/system/materialDocHub.js @@ -0,0 +1,67 @@ +import request from '@/utils/request' + +/** 金蝶生产单据整合(BOM 主轴,需令号) */ +export function queryMaterialDocHub(sclh) { + return request({ + url: '/system/kingdee/materialDocHub/query', + method: 'get', + params: { sclh }, + timeout: 300000 + }) +} + +/** 工序计划看板分页(令号可选) */ +export function queryMaterialDocHubBoardPage(params) { + return request({ + url: '/system/kingdee/materialDocHub/board/page', + method: 'get', + params, + timeout: 120000 + }) +} + +/** 展开工单:仅工序计划 */ +export function queryMaterialDocHubBoardDetail(moBillNo, materialNumber) { + return request({ + url: '/system/kingdee/materialDocHub/board/detail', + method: 'get', + params: { moBillNo, materialNumber }, + timeout: 60000 + }) +} + +/** 按需:工序汇报 */ +export function queryMaterialDocHubReports(moBillNo, materialNumber, operNumber) { + const params = { moBillNo } + if (materialNumber) params.materialNumber = materialNumber + if (operNumber != null && operNumber !== '') params.operNumber = operNumber + return request({ + url: '/system/kingdee/materialDocHub/board/reports', + method: 'get', + params, + timeout: 120000 + }) +} + +/** 按需:入库点质检与入库 */ +export function queryMaterialDocHubInstockQc(moBillNo, materialNumber, operNumber) { + const params = { moBillNo } + if (materialNumber) params.materialNumber = materialNumber + if (operNumber != null && operNumber !== '') params.operNumber = operNumber + return request({ + url: '/system/kingdee/materialDocHub/board/instockQc', + method: 'get', + params, + timeout: 120000 + }) +} + +/** 按需:委外 C/G */ +export function queryMaterialDocHubSubcontract(moBillNo) { + return request({ + url: '/system/kingdee/materialDocHub/board/subcontract', + method: 'get', + params: { moBillNo }, + timeout: 60000 + }) +} diff --git a/src/api/system/nd3PhasedProduct.js b/src/api/system/nd3PhasedProduct.js new file mode 100644 index 0000000..2f28919 --- /dev/null +++ b/src/api/system/nd3PhasedProduct.js @@ -0,0 +1,38 @@ +import request from '@/utils/request' + +// 检索 ND 项目(选令号 / 切换项目) +export function searchNd3Project(params) { + return request({ + url: '/system/nd3/phased-product/search', + method: 'get', + params: params + }) +} + +// 报表(页面主数据) +export function getNd3Report(params) { + return request({ + url: '/system/nd3/phased-product/report', + method: 'get', + params: params + }) +} + +// 自选多种物料齐套 +export function getNd3CustomKit(data) { + return request({ + url: '/system/nd3/phased-product/custom-kit', + method: 'post', + data: data + }) +} + +// 多主产品联合试算导出 +export function exportNd3CustomKit(data) { + return request({ + url: '/system/nd3/phased-product/custom-kit/export', + method: 'post', + data: data, + responseType: 'blob' + }) +} diff --git a/src/api/system/operationPlanningMain.js b/src/api/system/operationPlanningMain.js index f6838c8..36e0d5d 100644 --- a/src/api/system/operationPlanningMain.js +++ b/src/api/system/operationPlanningMain.js @@ -74,3 +74,40 @@ export function queryFromK3OperationPlanningMain(query) { params: query }) } + +// 产能分析 +export function getCapacityAnalysisApi(query) { + return request({ + url: '/system/material/buildCapacity', + method: 'get', + params: query + }) +} + +// 产能分析:获取生产令号下拉选项 +export function getProductionOrderNoOptions(query) { + return request({ + url: '/system/plan/productionOrderNoOptions', + method: 'get', + params: query + }) +} + +// 产能分析:导出 +export function exportCapacityAnalysisApi(query) { + return request({ + url: '/system/material/buildCapacity/export', + method: 'post', + params: query, + responseType: 'blob' + }) +} + +// 产能分析:根据生产令号模糊查询带出产品信息 +export function selectByProCode(productionOrderNo) { + return request({ + url: '/system/plan/selectByProCode', + method: 'post', + params: { productionOrderNo } + }) +} diff --git a/src/api/system/orderPro.js b/src/api/system/orderPro.js index 5bd5ba7..ec97f4b 100644 --- a/src/api/system/orderPro.js +++ b/src/api/system/orderPro.js @@ -137,6 +137,15 @@ export function uploadPDF(id) { }) } +// 下载 PLM DWG 图纸 ZIP +export function downloadPlmDwg(id) { + return request({ + url: '/system/orderPro/downloadPlmDwg/' + id, + method: 'get', + responseType: 'blob' + }) +} + // 下载生产工艺计划表 export function exportRoute(id) { return request({ @@ -156,3 +165,61 @@ export function exportRoute3(id) { responseType: 'blob' }) } + +// 查询工艺计划表钉钉发送成功次数(项目令号主键 id,与列表/详情一致;后端可不配菜单权限) +export function getRoutePlanSendCount(id) { + return request({ + url: '/system/orderPro/routePlanSendCount/' + id, + method: 'get' + }) +} + +// 发送工艺计划表(钉钉推送分类 BOM Excel) +export function sendProcessRoutePlanExcel(id) { + return request({ + url: '/system/orderPro/sendProcessRoutePlanExcel/' + id, + method: 'post', + data: {} + }) +} + +// 从 FTP 读取图纸数量统计表并入库 +export function syncDrawingWorkload(id) { + return request({ + url: '/system/orderPro/drawingWorkload/sync/' + id, + method: 'post', + timeout: 5 * 60 * 1000 + }) +} + +// 查询已入库图纸工作量 +export function getDrawingWorkload(id) { + return request({ + url: '/system/orderPro/drawingWorkload/' + id, + method: 'get' + }) +} + +// 获取出图状态 +export function getPlotState() { + return request({ + url: '/system/orderPro/getstate', + method: 'get' + }) +} + +// 金蝶生产订单(按项目 id) +export function getKingdeePrdMo(id) { + return request({ + url: '/system/orderPro/kingdee/prdMo/' + id, + method: 'get' + }) +} + +// 金蝶采购订单(按项目 id) +export function getKingdeePurchaseOrder(id) { + return request({ + url: '/system/orderPro/kingdee/purchaseOrder/' + id, + method: 'get' + }) +} diff --git a/src/api/system/plmPdfZipPush.js b/src/api/system/plmPdfZipPush.js new file mode 100644 index 0000000..46697a5 --- /dev/null +++ b/src/api/system/plmPdfZipPush.js @@ -0,0 +1,27 @@ +import request from '@/utils/request' + +// 查询 PLM PDF 推送记录列表 +export function listPlmPdfZipPush(query) { + return request({ + url: '/system/plmPdfZipPush/list', + method: 'get', + params: query + }) +} + +// 查询 PLM PDF 推送记录详情 +export function getPlmPdfZipPush(id) { + return request({ + url: '/system/plmPdfZipPush/' + id, + method: 'get' + }) +} + +// 下载推送明细中的 PLM DWG +export function downloadPlmDwgItem(itemId) { + return request({ + url: '/system/plmPdfZipPush/downloadDwgItem/' + itemId, + method: 'get', + responseType: 'blob' + }) +} diff --git a/src/api/system/plmReceiveLog.js b/src/api/system/plmReceiveLog.js new file mode 100644 index 0000000..4ea640f --- /dev/null +++ b/src/api/system/plmReceiveLog.js @@ -0,0 +1,26 @@ +import request from '@/utils/request' + +// 查询 PLM 接收留痕列表 +export function listPlmReceiveLog(query) { + return request({ + url: '/system/plmReceiveLog/list', + method: 'get', + params: query + }) +} + +// 查询 PLM 接收留痕详情 +export function getPlmReceiveLog(id) { + return request({ + url: '/system/plmReceiveLog/' + id, + method: 'get' + }) +} + +// 按留痕记录手动将总装同步到 bom_details +export function syncPlmReceiveLogBomDetails(id) { + return request({ + url: '/system/plmReceiveLog/' + id + '/syncBomDetails', + method: 'post' + }) +} diff --git a/src/api/system/productionBoard.js b/src/api/system/productionBoard.js new file mode 100644 index 0000000..5e4dbfe --- /dev/null +++ b/src/api/system/productionBoard.js @@ -0,0 +1,10 @@ +import request from '@/utils/request' + +// 生产看板查询 +export function getProductionBoardQuery(query) { + return request({ + url: '/system/kingdee/productionBoard/query', + method: 'get', + params: query + }) +} diff --git a/src/api/system/ratio.js b/src/api/system/ratio.js new file mode 100644 index 0000000..97f6e6e --- /dev/null +++ b/src/api/system/ratio.js @@ -0,0 +1,12 @@ +import request from '@/utils/request' + +export function getRatioBuildCapacity(params) { + return request({ + url: '/system/ratio/buildCapacity', + method: 'get', + params: { + ratioValue: params.ratioValue, + qty: params.qty + } + }) +} \ No newline at end of file diff --git a/src/api/system/route.js b/src/api/system/route.js index 1294fd9..229e0c6 100644 --- a/src/api/system/route.js +++ b/src/api/system/route.js @@ -98,6 +98,14 @@ export function pushRouteBom(rooteProdet, groupName) { params: { rooteProdet, groupName }, }); } + +export function approveRoute(rooteProdet) { + return request({ + url: '/system/route/approveRoute', + method: 'post', + params: { rooteProdet }, + }); +} export function updateProcessPlan(rooteProdet, ids) { return request({ url: '/system/route/updateProcessPlan', diff --git a/src/api/system/workAlertPushConfig.js b/src/api/system/workAlertPushConfig.js new file mode 100644 index 0000000..e4a4410 --- /dev/null +++ b/src/api/system/workAlertPushConfig.js @@ -0,0 +1,54 @@ +import request from '@/utils/request' + +export function listWorkAlertPushConfig(query) { + return request({ + url: '/system/workAlertPushConfig/list', + method: 'get', + params: query + }) +} + +export function getWorkAlertPushConfig(id) { + return request({ + url: '/system/workAlertPushConfig/' + id, + method: 'get' + }) +} + +export function listPushTypes() { + return request({ + url: '/system/workAlertPushConfig/pushTypes', + method: 'get' + }) +} + +export function addWorkAlertPushConfig(data) { + return request({ + url: '/system/workAlertPushConfig', + method: 'post', + data + }) +} + +export function updateWorkAlertPushConfig(data) { + return request({ + url: '/system/workAlertPushConfig', + method: 'put', + data + }) +} + +export function delWorkAlertPushConfig(id) { + const ids = Array.isArray(id) ? id.join(',') : id + return request({ + url: '/system/workAlertPushConfig/' + ids, + method: 'delete' + }) +} + +export function triggerWorkAlertPush(id) { + return request({ + url: '/system/workAlertPushConfig/trigger/' + id, + method: 'post' + }) +} diff --git a/src/api/system/workCenterData.js b/src/api/system/workCenterData.js index caf3712..ddc344c 100644 --- a/src/api/system/workCenterData.js +++ b/src/api/system/workCenterData.js @@ -42,3 +42,131 @@ export function delWorkCenterData(id) { method: 'delete' }) } + +// 生产管理看板数据(按工段 chejian,免登录) +export function getProduceDataKanban(chejian) { + return request({ + url: '/system/workCenterData/produceDataKanban', + method: 'get', + params: { chejian }, + headers: { isToken: false } + }) +} + +// 预警数据 - 安全库存 +export function getAlertSafetyStock() { + return request({ + url: '/system/workCenterData/alertSafetyStock', + method: 'get' + }) +} + +// 预警数据 - 生产延期 +export function getAlertDelayData(workCenter) { + return request({ + url: '/system/workCenterData/alertDelayData', + method: 'get', + params: { workCenter } + }) +} + +// 预警数据 - 采购订单临期 +export function getAlertPurchaseOrder() { + return request({ + url: '/system/workCenterData/alertPurchaseOrder', + method: 'get' + }) +} + +// 预警数据 - 采购订单审批中 / 重新审核 +export function getAlertPurchaseOrderApproval() { + return request({ + url: '/system/workCenterData/alertPurchaseOrderApproval', + method: 'get' + }) +} + +// 预警数据 - 采购申请单临期 +export function getAlertPurchaseRequest() { + return request({ + url: '/system/workCenterData/alertPurchaseRequest', + method: 'get' + }) +} + +// 预警数据 - 采购申请临期且未下推采购订单 +export function getAlertPurchaseRequestWithoutPo() { + return request({ + url: '/system/workCenterData/alertPurchaseRequestWithoutPo', + method: 'get' + }) +} + +// 预警数据 - 工序汇报未质检 +export function getAlertProcessReportNotInspected() { + return request({ + url: '/system/workCenterData/alertProcessReportNotInspected', + method: 'get' + }) +} + +// 预警数据 - 工序汇报未入库 +export function getAlertProcessReport() { + return request({ + url: '/system/workCenterData/alertProcessReport', + method: 'get' + }) +} + +// 预警数据 - 已转入未转出 / 部分转出 +export function getAlertTransInPendingOut(workCenter) { + return request({ + url: '/system/workCenterData/alertTransInPendingOut', + method: 'get', + params: { workCenter } + }) +} + +// 预警数据 - 开工未转入 +export function getAlertStartedNotTransIn(workCenter) { + return request({ + url: '/system/workCenterData/alertStartedNotTransIn', + method: 'get', + params: { workCenter } + }) +} + +// 预警数据 - 工序转移未及时 +export function getAlertProcessTransfer() { + return request({ + url: '/system/workCenterData/alertProcessTransfer', + method: 'get' + }) +} + +// 预警数据 - 委外实际发出 / 接收记录 +export function getAlertSubcontractTransfer(workCenter, returnStatus) { + return request({ + url: '/system/workCenterData/alertSubcontractTransfer', + method: 'get', + params: { workCenter, returnStatus } + }) +} + +// 按生产订单号查询委外发出 / 接收明细 +export function getSubcontractTransfersByMo(moBillNo) { + return request({ + url: '/system/workCenterData/subcontractTransfersByMo', + method: 'get', + params: { moBillNo } + }) +} + +// 生产提醒:机加/装配/铆焊委外延期 + 委外发出/接收(含供应商) +export function getJjSubcontractDelayRemind() { + return request({ + url: '/system/workCenterData/jjSubcontractDelayRemind', + method: 'get', + timeout: 180000 + }) +} diff --git a/src/assets/icons/svg/404.svg b/src/assets/icons/svg/404.svg index 6df5019..aef1fd3 100644 --- a/src/assets/icons/svg/404.svg +++ b/src/assets/icons/svg/404.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/icons/svg/bug.svg b/src/assets/icons/svg/bug.svg index 05a150d..a95faa7 100644 --- a/src/assets/icons/svg/bug.svg +++ b/src/assets/icons/svg/bug.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/icons/svg/dict.svg b/src/assets/icons/svg/dict.svg index 4849377..6e5329b 100644 --- a/src/assets/icons/svg/dict.svg +++ b/src/assets/icons/svg/dict.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/icons/svg/language.svg b/src/assets/icons/svg/language.svg index 0082b57..1e15ec6 100644 --- a/src/assets/icons/svg/language.svg +++ b/src/assets/icons/svg/language.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/icons/svg/time-range.svg b/src/assets/icons/svg/time-range.svg index 13c1202..4d21efb 100644 --- a/src/assets/icons/svg/time-range.svg +++ b/src/assets/icons/svg/time-range.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/icons/svg/tree.svg b/src/assets/icons/svg/tree.svg index dd4b7dd..9a6b349 100644 --- a/src/assets/icons/svg/tree.svg +++ b/src/assets/icons/svg/tree.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/background.js b/src/background.js new file mode 100644 index 0000000..45cef95 --- /dev/null +++ b/src/background.js @@ -0,0 +1,76 @@ +'use strict' + +import { app, protocol, BrowserWindow } from 'electron' +import { createProtocol } from 'vue-cli-plugin-electron-builder/lib' + +const isDevelopment = process.env.NODE_ENV !== 'production' + +// Scheme must be registered before the app is ready +protocol.registerSchemesAsPrivileged([ + { scheme: 'app', privileges: { secure: true, standard: true } } +]) + +async function createWindow() { + // Create the browser window. + const win = new BrowserWindow({ + width: 1200, + height: 800, + webPreferences: { + // Use pluginOptions.nodeIntegration, leave this alone + // See nklayman.github.io/vue-cli-plugin-electron-builder/guide/security.html#node-integration for more info + nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION, + contextIsolation: !process.env.ELECTRON_NODE_INTEGRATION, + webSecurity: false // Disable web security for local file loading if necessary + } + }) + + // Set window title + win.setTitle('生产预警中心桌面端') + + if (process.env.WEBPACK_DEV_SERVER_URL) { + // Load the url of the dev server if in development mode + await win.loadURL(process.env.WEBPACK_DEV_SERVER_URL) + if (!process.env.IS_TEST) win.webContents.openDevTools() + } else { + createProtocol('app') + // Load the index.html when not in development + win.loadURL('app://./index.html') + } +} + +// Quit when all windows are closed. +app.on('window-all-closed', () => { + // On macOS it is common for applications and their menu bar + // to stay active until the user quits explicitly with Cmd + Q + if (process.platform !== 'darwin') { + app.quit() + } +}) + +app.on('activate', () => { + // On macOS it's common to re-create a window in the app when the + // dock icon is clicked and there are no other windows open. + if (BrowserWindow.getAllWindows().length === 0) createWindow() +}) + +// This method will be called when Electron has finished +// initialization and is ready to create browser windows. +// Some APIs can only be used after this event occurs. +app.on('ready', async () => { + createWindow() +}) + +// Exit cleanly on request from parent process in development mode. +if (isDevelopment) { + if (process.platform === 'win32') { + process.on('message', (data) => { + if (data === 'graceful-exit') { + app.quit() + } + }) + } else { + process.on('SIGTERM', () => { + app.quit() + }) + } +} diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue index 6c845ac..0b86c38 100644 --- a/src/components/Pagination/index.vue +++ b/src/components/Pagination/index.vue @@ -5,7 +5,7 @@ :current-page="currentPage" :page-size="pageSize" :layout="layout" - :page-sizes="pageSizes" + :page-sizes="normalizedPageSizes" :pager-count="pagerCount" :total="total" v-bind="$attrs" @@ -31,12 +31,12 @@ export default { }, limit: { type: Number, - default: 20 + default: 10 }, pageSizes: { type: Array, default() { - return [100, 200, 300, 500] + return [10, 20, 50, 100] } }, // 移动端页码按钮的数量端默认值5 @@ -81,15 +81,22 @@ export default { set(val) { this.$emit('update:limit', val) } + }, + /** 确保当前 pageSize 在可选列表中,避免下拉显示与真实条数不一致 */ + normalizedPageSizes() { + const sizes = [...this.pageSizes] + const limit = Number(this.limit) + if (limit > 0 && !sizes.includes(limit)) { + sizes.push(limit) + } + return sizes.sort((a, b) => a - b) } }, methods: { handleSizeChange(val) { - this.pageSize = val - if (this.currentPage * val > this.total) { - this.currentPage = 1 - } - this.$emit('pagination', { page: this.currentPage, limit: val }) + this.$emit('update:limit', val) + this.$emit('update:page', 1) + this.$emit('pagination', { page: 1, limit: val }) if (this.autoScroll) { scrollTo(0, 800) } diff --git a/src/permission.js b/src/permission.js index b18210b..97d20d4 100644 --- a/src/permission.js +++ b/src/permission.js @@ -8,10 +8,26 @@ import { isRelogin } from '@/utils/request' NProgress.configure({ showSpinner: false }) -const whiteList = ['/login', '/register', '/index', '/indexDaping', '/mrp2', '/system/cost'] +const whiteList = ['/login', '/register', '/index', '/indexDaping', '/mrp2', '/system/cost', '/DataBoard/ProduceKanBan/index'] + +function isWhiteList(path) { + return whiteList.indexOf(path) !== -1 +} router.beforeEach((to, from, next) => { NProgress.start() + + // 白名单页面无需登录,直接访问(含无效/过期 token 场景) + if (isWhiteList(to.path)) { + if (to.path === '/login' && getToken()) { + next({ path: '/' }) + NProgress.done() + return + } + next() + return + } + if (getToken()) { to.meta.title && store.dispatch('settings/setTitle', to.meta.title) /* has token*/ @@ -42,13 +58,8 @@ router.beforeEach((to, from, next) => { } else { // 没有token - if (whiteList.indexOf(to.path) !== -1) { - // 在免登录白名单,直接进入 - next() - } else { - next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页 - NProgress.done() - } + next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页 + NProgress.done() } }) diff --git a/src/router/index.js b/src/router/index.js index 1b7df62..5850355 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -84,11 +84,6 @@ export const constantRoutes = [ component: () => import('@/views/login'), hidden: true }, - { - path: '/login', - component: () => import('@/views/'), - hidden: true - }, { path: '/register', component: () => import('@/views/register'), @@ -140,6 +135,12 @@ export const constantRoutes = [ component: () => import('@/views/indexDaping'), hidden: true }, + { + path: '/DataBoard/ProduceKanBan/index', + component: () => import('@/views/system/produceKanban/index'), + hidden: true, + meta: { title: '生产管理看板' } + }, { path: '/mrp2', component: () => import('@/views/system/mrp2/index'), @@ -153,7 +154,87 @@ export const constantRoutes = [ name: 'CostPublic', hidden: true, meta: { title: '零件成本查询' } - } + }, + { + path: '/system/operationPlanningMain', + component: Layout, + hidden: true, + redirect: '/system/operationPlanningMain/index', + children: [ + { + path: 'index', + component: () => import('@/views/system/operationPlanningMain/index.vue'), + name: 'OperationPlanningMain', + meta: { title: '工序计划', activeMenu: '/system/operationPlanningMain' } + } + ] + }, + { + path: '/system/capacity-analysis', + component: Layout, + hidden: true, + children: [ + { + path: 'index', + component: () => import('@/views/system/operationPlanningMain/CapacityAnalysis.vue'), + name: 'CapacityAnalysis', + meta: { title: '预配套查询', activeMenu: '/system/operationPlanningMain' } + } + ] + }, + { + path: '/system/productionBoard', + component: Layout, + hidden: true, + children: [ + { + path: 'index', + component: () => import('@/views/system/productionBoard/index.vue'), + name: 'ProductionBoard', + meta: { title: '生产综合看板', activeMenu: '/system/productionBoard' } + } + ] + }, + { + path: '/system/materialDocHub', + component: Layout, + hidden: true, + children: [ + { + path: 'index', + component: () => import('@/views/system/materialDocHub/index.vue'), + name: 'MaterialDocHub', + meta: { title: '金蝶单据整合', activeMenu: '/system/materialDocHub' } + } + ] + }, + { + path: '/system/productionRemind', + component: Layout, + hidden: true, + children: [ + { + path: 'index', + component: () => import('@/views/system/productionRemind/index.vue'), + name: 'ProductionRemind', + meta: { title: '委外延期生产提醒', activeMenu: '/system/productionRemind' } + } + ] + }, + { + path: '/system/nd3PhasedProduct', + component: Layout, + hidden: true, + children: [ + { + path: 'index', + component: () => import('@/views/system/nd3PhasedProduct/index.vue'), + name: 'Nd3PhasedProduct', + meta: { title: 'ND3阶段性产品报表', activeMenu: '/system/nd3PhasedProduct' } + } + ] + }, + // { // path: '/', // component: Layout, @@ -256,7 +337,8 @@ Router.prototype.replace = function push(location) { export default new Router({ base: process.env.VUE_APP_CONTEXT_PATH, - mode: 'history', // 去掉url中的# + // Electron 使用 app:// 协议加载页面,history 模式会导致路由跳转后找不到资源(全站 404) + mode: process.env.IS_ELECTRON ? 'hash' : 'history', scrollBehavior: () => ({ y: 0 }), routes: constantRoutes }) diff --git a/src/views/demo/addgongxu/fromed.vue b/src/views/demo/addgongxu/fromed.vue index 9b1df30..538a534 100644 --- a/src/views/demo/addgongxu/fromed.vue +++ b/src/views/demo/addgongxu/fromed.vue @@ -79,7 +79,8 @@ --> -
- - - - +
+ +
+
+
+ +
+
+ 生产令号 + {{ embedOrderNo || '—' }} + {{ embedOrderName }} +
+
+
+
+ {{ bomStats.parentCount }} + 总成 +
+
+ {{ bomStats.childCount }} + 明细 +
+
+ {{ bomStats.existsCount }} + 已存在 +
+
+ {{ bomStats.missingCount }} + 未建档 +
+
+
- + + + + + - + - + - - + + - - + + - - + + + + + - - + + - - + + 搜索 @@ -80,151 +75,141 @@ - + + - 新增 - - - - - 删除 - + 新增 - 导出 - - - - - 导入 - - - - - - - - - 更新物料清单 - - + 删除 - 查看BOM上传状态 - - + 导出 - + + 导入 + + + + + + 更新物料清单 + + + 查看BOM上传状态 + + + 全部展开 + + + 全部收起 + + - - - - - - - - - - - - - - - - - - - - - - - - + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - - + + + - + - + - - + + - + - + - - - - + + + + - + - + - + - - - - - + + + + + - + + + diff --git a/src/views/system/dingSchemeApplication/index.vue b/src/views/system/dingSchemeApplication/index.vue new file mode 100644 index 0000000..ec383fe --- /dev/null +++ b/src/views/system/dingSchemeApplication/index.vue @@ -0,0 +1,840 @@ + + + + + diff --git a/src/views/system/materialDocHub/MaterialTableBlock.vue b/src/views/system/materialDocHub/MaterialTableBlock.vue new file mode 100644 index 0000000..edfaf5d --- /dev/null +++ b/src/views/system/materialDocHub/MaterialTableBlock.vue @@ -0,0 +1,71 @@ + + + diff --git a/src/views/system/materialDocHub/index.vue b/src/views/system/materialDocHub/index.vue new file mode 100644 index 0000000..4d6b3a6 --- /dev/null +++ b/src/views/system/materialDocHub/index.vue @@ -0,0 +1,611 @@ + + + + + diff --git a/src/views/system/nd3PhasedProduct/index.vue b/src/views/system/nd3PhasedProduct/index.vue new file mode 100644 index 0000000..d7c9a27 --- /dev/null +++ b/src/views/system/nd3PhasedProduct/index.vue @@ -0,0 +1,739 @@ + + + + + diff --git a/src/views/system/operationPlanningMain/CapacityAnalysis.vue b/src/views/system/operationPlanningMain/CapacityAnalysis.vue new file mode 100644 index 0000000..0573023 --- /dev/null +++ b/src/views/system/operationPlanningMain/CapacityAnalysis.vue @@ -0,0 +1,570 @@ + + + + + diff --git a/src/views/system/operationPlanningMain/CapacityAnalysisPage.vue b/src/views/system/operationPlanningMain/CapacityAnalysisPage.vue new file mode 100644 index 0000000..8f50462 --- /dev/null +++ b/src/views/system/operationPlanningMain/CapacityAnalysisPage.vue @@ -0,0 +1,86 @@ + + + + + diff --git a/src/views/system/operationPlanningMain/index.vue b/src/views/system/operationPlanningMain/index.vue index 10a8d6d..ebb859d 100644 --- a/src/views/system/operationPlanningMain/index.vue +++ b/src/views/system/operationPlanningMain/index.vue @@ -1,132 +1,96 @@