From e74242e9f270404ac3717aeee59e1ab17815eb50 Mon Sep 17 00:00:00 2001 From: Houjie <714924425@qq.com> Date: 星期三, 27 八月 2025 12:06:25 +0800 Subject: [PATCH] 安灯工单:产线多选修改为单选/设备管理模块迁移: 设备台账/设备履历/故障报修/维修工单/保养标准/点检工单/精度参数维护/工艺参数维护/设备附件管理/故障原因维护 (二维码库添加) 设备台账:设备编码重复校验 、自定义控件引用、权限控制 --- src/views/eam/purchase/modules/EamPurchasePlanAttachmentModal.vue | 0 src/views/eam/spare/modules/EamSparePartScrap/EamSparePartScrapModal.vue | 0 src/views/eam/equipment/modules/EamEquipmentFluidList.vue | 285 + src/views/eam/spare/modules/EamSpareParts/EamSparePartIntoModal.vue | 0 src/components/jeecg/index.js | 7 src/views/andon/modules/AndonOrderForm.vue | 39 src/views/eam/base/EamProcessParametersList.vue | 172 src/views/eam/equipment/modules/EamEquipmentProcessList.vue | 292 + src/views/eam/repair/modules/EamReportRepairList/AssignRepairReportModal.vue | 74 src/views/eam/maintenance/modules/EamInspectionOrderModal.vue | 365 + src/components/jeecg/LxSwitch.vue | 67 src/views/eam/base/EamMaintenanceStandardList.vue | 534 ++ src/views/eam/spare/modules/EamSpareParts/EamSparePartsModal.vue | 0 src/views/eam/purchase/modules/EamEquipmentPurchasePlanForm.vue | 0 src/views/eam/spare/EamSparePartsList.vue | 0 src/views/eam/spare/EamSparePartScrapList.vue | 0 src/views/eam/purchase/EamEquipmentPurchasePlanList.vue | 377 + src/views/eam/spare/modules/EamSparePartReceive/EamSparePartReceiveDetailList.vue | 0 src/views/eam/dispose/EamEquipmentSealUpList.vue | 264 + src/views/eam/repair/modules/EamRepairOrderList/ReceiveFaultModal.vue | 92 src/views/eam/base/EamPrecisionParametersList.vue | 168 src/views/eam/base/modules/EamFluidModal.vue | 60 src/views/eam/maintenance/modules/EamWeekMaintenanceOrderModal.vue | 345 + src/views/eam/dispose/EamEquipmentLeanOutList.vue | 362 + src/views/eam/purchase/modules/EamEquipmentPurchasePlanModal.vue | 61 src/views/eam/maintenance/modules/EamSecondMaintenanceOrderModal.vue | 343 + src/views/eam/equipment/modules/EamEquipmentAttachmentModal.vue | 138 src/views/eam/maintenance/modules/EamThirdMaintenanceOrderModal.vue | 459 + src/views/eam/purchase/modules/EamEquipmentPurchasePlanAuditModal.vue | 82 src/views/eam/repair/EamReportRepairList.vue | 352 + src/views/eam/base/EamEquipmentFaultReasonList.vue | 172 src/views/eam/dispose/modules/EamEquipmentTransferModal.vue | 167 src/views/eam/equipment/modules/MaintenanceEquipmentSelect.vue | 192 src/views/andon/modules/AndonResponseConfigForm.vue | 256 src/views/eam/equipment/modules/NameplateModal.vue | 151 src/views/eam/equipment/modules/ResumeDrawer.vue | 124 src/views/eam/purchase/EamPurchasePlanAttachmentList.vue | 186 src/views/eam/dispose/modules/EamEquipmentScrapModal.vue | 200 src/views/eam/base/modules/EamMaintenanceStandardModal.vue | 331 + src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionExamineModal.vue | 0 src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue | 556 ++ src/views/eam/equipment/modules/EamEquipmentPrecisionList.vue | 329 + src/views/eam/equipment/modules/EamEquipmentModal.vue | 395 + package-lock.json | 217 src/views/eam/spare/modules/EamSparePartReceive/EamSparePartReceiveModal.vue | 0 src/views/eam/spare/EamSparePartRequisitionList.vue | 0 src/views/eam/dispose/EamEquipmentScrapList.vue | 272 + src/views/eam/maintenance/EamThirdMaintenanceOrderList.vue | 583 ++ src/views/eam/repair/EamMajorPartialRepairList.vue | 496 + src/mixins/JeecgListMixin.js | 5 src/views/eam/base/EamSysFilesList.vue | 204 src/views/eam/dispose/modules/EamEquipmentLeanOutModal.vue | 162 src/views/eam/maintenance/modules/EamPrecisionCheckDetailModal.vue | 117 src/views/eam/base/EamFluidList.vue | 199 src/views/eam/equipment/EamEquipmentList.vue | 834 +++ src/utils/util.js | 2 src/views/eam/spare/EamSparePartReceiveList.vue | 0 src/views/eam/base/modules/EamProcessParametersModal.vue | 128 src/views/eam/equipment/EamEquipmentAttachmentList.vue | 185 src/views/eam/equipment/modules/LxSearchEquipmentSelect.vue | 168 src/views/eam/repair/modules/EamMajorPartialRepairModal.vue | 60 src/views/eam/dispose/EamEquipmentTransferList.vue | 279 + src/views/eam/spare/modules/EamSpareParts/EamSparePartInventoryList.vue | 0 src/views/eam/repair/modules/ImagesPreviewModal.vue | 87 src/components/jeecg/LxUpload.vue | 452 + src/views/eam/base/modules/EamMaintenanceStandardDetailList.vue | 151 src/views/eam/repair/modules/EamMajorPartialRepairForm.vue | 306 + src/utils/authFilter.js | 25 src/views/eam/base/modules/EamSysFilesModal.vue | 129 src/views/eam/maintenance/EamInspectionOrderList.vue | 517 + src/views/eam/repair/modules/EamReportRepairList/EamReportRepairModal.vue | 253 src/views/eam/base/modules/EamFluidForm.vue | 118 src/views/eam/base/modules/EamEquipmentFaultReasonModal.vue | 127 src/views/eam/dispose/modules/EamEquipmentSealUpModal.vue | 131 src/views/eam/maintenance/EamWeekMaintenanceOrderList.vue | 489 + src/views/eam/repair/EamRepairOrderList.vue | 299 + src/views/eam/repair/modules/EamMajorPartialRepairDetailModal.vue | 137 package.json | 2 src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionModal.vue | 0 src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionDetailModal.vue | 0 src/views/eam/maintenance/EamPrecisionCheckDetailList.vue | 170 src/views/eam/base/modules/EamPrecisionParametersModal.vue | 120 src/components/jeecg/LxFilePreview.vue | 120 83 files changed, 15,389 insertions(+), 152 deletions(-) diff --git a/package-lock.json b/package-lock.json index fb5e155..064a953 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1296,6 +1296,14 @@ } } }, + "@chenfengyuan/vue-qrcode": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/@chenfengyuan/vue-qrcode/-/vue-qrcode-1.0.2.tgz", + "integrity": "sha512-hwy1d4YMJAyEh+V7dLPG8eAKACRvugzSB4ylwb6QNqo84KHTF50/5EJcBYdUhTRPfAqrxG0i6jDAXONWOGyQbQ==", + "requires": { + "qrcode": "^1.4.4" + } + }, "@hapi/address": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/@hapi/address/-/address-2.1.4.tgz", @@ -8121,6 +8129,11 @@ } } }, + "dijkstrajs": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/dijkstrajs/-/dijkstrajs-1.0.3.tgz", + "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==" + }, "dir-glob": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz", @@ -8431,8 +8444,7 @@ "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "emojis-list": { "version": "3.0.0", @@ -13256,6 +13268,11 @@ "dev": true, "optional": true }, + "pngjs": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/pngjs/-/pngjs-5.0.0.tgz", + "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==" + }, "point-at-length": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/point-at-length/-/point-at-length-1.1.0.tgz", @@ -14865,6 +14882,11 @@ "utila": "~0.4" } }, + "print-js": { + "version": "1.6.0", + "resolved": "https://registry.npmmirror.com/print-js/-/print-js-1.6.0.tgz", + "integrity": "sha512-BfnOIzSKbqGRtO4o0rnj/K3681BSd2QUrsIZy/+WdCIugjIswjmx3lDEZpXB2ruGf9d4b3YNINri81+J0FsBWg==" + }, "private": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", @@ -15015,6 +15037,182 @@ "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" } } + }, + "qrcode": { + "version": "1.5.4", + "resolved": "https://registry.npmmirror.com/qrcode/-/qrcode-1.5.4.tgz", + "integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==", + "requires": { + "dijkstrajs": "^1.0.1", + "pngjs": "^5.0.0", + "yargs": "^15.3.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmmirror.com/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmmirror.com/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmmirror.com/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmmirror.com/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "qrcode.js": { + "version": "0.0.1", + "resolved": "https://registry.npmmirror.com/qrcode.js/-/qrcode.js-0.0.1.tgz", + "integrity": "sha512-EpHuKYzjYH/+SQtAlo4NYe3wpsYzKadKa154Ch163K+jrUlz6pVInWgJlsj5d1dxngYEjuqnClfzutL8Z9rqcg==" }, "qs": { "version": "6.7.0", @@ -17688,6 +17886,21 @@ "babel-plugin-transform-runtime": "^6.23.0" } }, + "vue-qrcode": { + "version": "0.4.0", + "resolved": "https://registry.npmmirror.com/vue-qrcode/-/vue-qrcode-0.4.0.tgz", + "integrity": "sha512-xkaJ1omfzqmEMCotrksZgnneGN8tF52NXpn5suf/lM/L5m7q6+65merbWHt4umWmTpGEZLjFGWg3MuH+HwqTLA==", + "requires": { + "tslib": "^2.2.0" + }, + "dependencies": { + "tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" + } + } + }, "vue-ref": { "version": "2.0.0", "resolved": "https://registry.npmmirror.com/vue-ref/-/vue-ref-2.0.0.tgz", diff --git a/package.json b/package.json index ed0f5ff..77b7f91 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@antv/data-set": "^0.11.4", + "@chenfengyuan/vue-qrcode": "^1.0.2", "@jeecg/antd-online-mini": "3.4.3-beta2", "@jiaminghi/data-view": "^2.10.0", "@tinymce/tinymce-vue": "2.1.0", @@ -48,6 +49,7 @@ "vue-ls": "^3.2.0", "vue-photo-preview": "^1.1.3", "vue-print-nb-jeecg": "^1.0.12", + "vue-qrcode": "^0.4.0", "vue-router": "^3.0.1", "vue-splitpane": "^1.0.4", "vuedraggable": "^2.20.0", diff --git a/src/components/jeecg/LxFilePreview.vue b/src/components/jeecg/LxFilePreview.vue new file mode 100644 index 0000000..9d01b89 --- /dev/null +++ b/src/components/jeecg/LxFilePreview.vue @@ -0,0 +1,120 @@ +<template> + <j-modal + :title="title" + :width="800" + :visible="visible" + switchFullscreen + @ok="handleOk" + @cancel="handleCancel" + :footer="null" + cancelText="鍏抽棴"> + <a-spin :spinning="confirmLoading"> + <img v-if="isImage" :src="localFileUrl" width="100%" height="100%" alt="鍥剧墖棰勮" /> + <iframe v-else-if="isPdf" :src="localFileUrl" width="100%" height="600px"></iframe> + <video v-else-if="isVideo" controls> + <source :src="localFileUrl" type="video/mp4"> + 鎮ㄧ殑娴忚鍣ㄤ笉鏀寔 video 鏍囩銆� + </video> + <pre v-else-if="isText">{{ textContent }}</pre> + <h1 v-else>涓嶆敮鎸侀瑙堬紝璇蜂笅杞藉悗鏌ョ湅</h1> + </a-spin> + </j-modal> +</template> + +<script> +import { getFileAccessHttpUrl } from '@/api/manage' + +export default { + props: { + fileUrl: String + }, + data() { + return { + title: '棰勮', + textContent: '', + confirmLoading: false, + visible: false, + localFileUrl: this.fileUrl, + } + }, + computed: { + isImage() { + return /\.(jpeg|jpg|png|gif|bmp|webp)$/i.test(this.localFileUrl) + }, + isPdf() { + return /\.pdf$/i.test(this.localFileUrl) + }, + isVideo() { + return /\.(mp4|webm|ogg)$/i.test(this.localFileUrl) + }, + isText() { + return /\.(txt|md|json|xml|yaml|yml)$/i.test(this.localFileUrl) + } + }, + watch: { + localFileUrl: 'fetchTextContent' + }, + mounted() { + if (this.isText) { + this.fetchTextContent() + } + }, + methods: { + async fetchTextContent() { + try { + const response = await fetch(this.fileUrl) + if (!response.ok) throw new Error('缃戠粶鍝嶅簲涓嶆槸OK') + const text = await response.text() + this.textContent = text + } catch (error) { + console.error('鑾峰彇鏂囨湰鍐呭澶辫触:', error) + this.textContent = '鏃犳硶鍔犺浇鏂囨湰鍐呭' + } + }, + close() { + this.$emit('close') + this.visible = false + }, + preview(fileUrl) { + let url = getFileAccessHttpUrl(fileUrl) + this.visible = true + this.localFileUrl = url + }, + handleOk() { + this.close() + }, + handleCancel() { + this.close() + } + } +} +</script> + +<style lang="less" scoped> + +/deep/ .ant-modal { + height: 80%; + /* 婊氬姩鏉′紭鍖� start */ + ::-webkit-scrollbar{ + width:8px; + height:8px; + } + + .ant-modal-content { + height: 100%; + display: flex; + flex-direction: column; + + .ant-modal-body { + flex: 1; + overflow: auto; + } + } +} + +pre { + overflow: visible; +} + + +</style> \ No newline at end of file diff --git a/src/components/jeecg/LxSwitch.vue b/src/components/jeecg/LxSwitch.vue new file mode 100644 index 0000000..572645b --- /dev/null +++ b/src/components/jeecg/LxSwitch.vue @@ -0,0 +1,67 @@ +<template> + <a-switch + :checkedChildren="checkedChildren" + :unCheckedChildren="unCheckedChildren" + :defaultChecked="defaultChecked" + :checked="value === '1'" + @change="handleChange" + :disabled="disabled" + :loading="loading" + :size="size" + /> +</template> + +<script> +export default { + name: 'LxSwitch', + props: { + checkedChildren: { + type: String, + default: '', + required: false + }, + value: { + type: String, + required: false + }, + unCheckedChildren: { + type: String, + default: '', + required: false + }, + defaultChecked: { + type: Boolean, + required: false, + default: false + }, + loading: { + type: Boolean, + required: false, + default: false + }, + disabled: { + type: Boolean, + required: false, + default: false + }, + size: { + type: String, + required: false, + default: 'default' + } + }, + data() { + return {} + }, + methods: { + handleChange(checked) { + this.$emit('change', checked ? '1' : '0') + } + }, + //2.2鏂板 鍦ㄧ粍浠跺唴瀹氫箟 鎸囧畾鐖剁粍浠惰皟鐢ㄦ椂鍊欑殑浼犲�煎睘鎬у拰浜嬩欢绫诲瀷 杩欎釜鐗涢�� + model: { + prop: 'value', + event: 'change' + } +} +</script> \ No newline at end of file diff --git a/src/components/jeecg/LxUpload.vue b/src/components/jeecg/LxUpload.vue new file mode 100644 index 0000000..6f47e6f --- /dev/null +++ b/src/components/jeecg/LxUpload.vue @@ -0,0 +1,452 @@ +<template> + <div :id="containerId" style="position: relative"> + + <!-- ---------------------------- begin 鍥剧墖宸﹀彸鎹綅缃� ------------------------------------- --> + <div class="movety-container" :style="{top:top+'px',left:left+'px',display:moveDisplay}" + style="padding:0 8px;position: absolute;z-index: 91;height: 32px;width: 104px;text-align: center;"> + <div :id="containerId+'-mover'" :class="showMoverTask?'uploadty-mover-mask':'movety-opt'" + style="margin-top: 12px"> + <a @click="moveLast" style="margin: 0 5px;"> + <a-icon type="arrow-left" style="color: #fff;font-size: 16px" /> + </a> + <a @click="moveNext" style="margin: 0 5px;"> + <a-icon type="arrow-right" style="color: #fff;font-size: 16px" /> + </a> + </div> + </div> + <!-- ---------------------------- end 鍥剧墖宸﹀彸鎹綅缃� ------------------------------------- --> + + <a-upload + name="file" + :multiple="multiple" + :action="uploadAction" + :headers="headers" + :data="{'biz':bizPath}" + :fileList="fileList" + :beforeUpload="doBeforeUpload" + @change="handleChange" + :disabled="disabled" + :listType="complistType" + @preview="handlePreview" + :class="{'uploadty-disabled':disabled}"> + <template> + <div v-if="isImageComp"> + <a-icon type="plus" /> + <div class="ant-upload-text">{{ text }}</div> + </div> + <a-button v-else-if="buttonVisible"> + <a-icon type="upload" /> + {{ text }} + </a-button> + </template> + </a-upload> + <a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel"> + <img alt="example" style="width: 100%" :src="previewImage" /> + </a-modal> + </div> +</template> + +<script> + +import Vue from 'vue' +import { ACCESS_TOKEN } from '@/store/mutation-types' +import { getFileAccessHttpUrl } from '@/api/manage' + +const FILE_TYPE_ALL = 'all' +const FILE_TYPE_IMG = 'image' +const FILE_TYPE_TXT = 'file' +const uidGenerator = () => { + return '-' + parseInt(Math.random() * 10000 + 1, 10) +} +const getFileName = (path) => { + if (path.lastIndexOf('\\') >= 0) { + let reg = new RegExp('\\\\', 'g') + path = path.replace(reg, '/') + } + return path.substring(path.lastIndexOf('/') + 1) +} +export default { + name: 'LXUpload', + data() { + return { + uploadAction: window._CONFIG['domianURL'] + '/eam/sysFiles/upload', + headers: {}, + fileList: [], + newFileList: [], + uploadGoOn: true, + previewVisible: false, + //---------------------------- begin 鍥剧墖宸﹀彸鎹綅缃� ------------------------------------- + previewImage: '', + containerId: '', + top: '', + left: '', + moveDisplay: 'none', + showMoverTask: false, + moverHold: false, + currentImg: '' + //---------------------------- end 鍥剧墖宸﹀彸鎹綅缃� ------------------------------------- + } + }, + props: { + text: { + type: String, + required: false, + default: '鐐瑰嚮涓婁紶' + }, + fileType: { + type: String, + required: false, + default: FILE_TYPE_ALL + }, + /*杩欎釜灞炴�х敤浜庢帶鍒舵枃浠朵笂浼犵殑涓氬姟璺緞*/ + bizPath: { + type: String, + required: false, + default: 'temp' + }, + value: { + type: [String, Array], + required: false + }, + // update-begin- --- author:wangshuai ------ date:20190929 ---- for:Jupload缁勪欢澧炲姞鏄惁鑳藉鐐瑰嚮 + disabled: { + type: Boolean, + required: false, + default: false + }, + // update-end- --- author:wangshuai ------ date:20190929 ---- for:Jupload缁勪欢澧炲姞鏄惁鑳藉鐐瑰嚮 + //姝ゅ睘鎬ц搴熷純浜� + triggerChange: { + type: Boolean, + required: false, + default: false + }, + /** + * update -- author:lvdandan -- date:20190219 -- for:Jupload缁勪欢澧炲姞鏄惁杩斿洖url锛� + * true锛氫粎杩斿洖url + * false锛氳繑鍥瀎ileName filePath fileSize + */ + // returnUrl: { + // type: Boolean, + // required: false, + // default: true + // }, + number: { + type: Number, + required: false, + default: 0 + }, + buttonVisible: { + type: Boolean, + required: false, + default: true + }, + multiple: { + type: Boolean, + default: true + }, + beforeUpload: { + type: Function + } + }, + watch: { + value: { + immediate: true, + handler() { + let val = this.value + if (val instanceof Array) { + this.initFileListArr(val) + } else { + this.initFileList(val) + } + } + } + }, + computed: { + isImageComp() { + return this.fileType === FILE_TYPE_IMG + }, + complistType() { + return this.fileType === FILE_TYPE_IMG ? 'picture-card' : 'text' + } + }, + created() { + const token = Vue.ls.get(ACCESS_TOKEN) + //---------------------------- begin 鍥剧墖宸﹀彸鎹綅缃� ------------------------------------- + this.headers = { 'X-Access-Token': token } + this.containerId = 'container-ty-' + new Date().getTime() + //---------------------------- end 鍥剧墖宸﹀彸鎹綅缃� ------------------------------------- + }, + + methods: { + initFileListArr(val) { + if (!val || val.length == 0) { + this.fileList = [] + return + } + let fileList = [] + for (var a = 0; a < val.length; a++) { + let url = getFileAccessHttpUrl(val[a].filePath) + fileList.push({ + uid: uidGenerator(), + name: val[a].fileName, + status: 'done', + url: url, + response: { + status: 'history', + message: val[a].filePath + } + }) + } + this.fileList = fileList + }, + initFileList(paths) { + if (!paths || paths.length == 0) { + //return []; + // update-begin- --- author:os_chengtgen ------ date:20190729 ---- for:issues:326,Jupload缁勪欢鍒濆鍖朾ug + this.fileList = [] + return + // update-end- --- author:os_chengtgen ------ date:20190729 ---- for:issues:326,Jupload缁勪欢鍒濆鍖朾ug + } + let fileList = [] + let arr = paths.split(',') + for (var a = 0; a < arr.length; a++) { + let url = getFileAccessHttpUrl(arr[a]) + fileList.push({ + uid: uidGenerator(), + name: getFileName(arr[a]), + status: 'done', + url: url, + response: { + status: 'history', + message: arr[a] + } + }) + } + this.fileList = fileList + }, + doBeforeUpload(file) { + this.uploadGoOn = true + var fileType = file.type + if (this.fileType === FILE_TYPE_IMG) { + if (fileType.indexOf('image') < 0) { + this.$message.warning('璇蜂笂浼犲浘鐗�') + this.uploadGoOn = false + return false + } + } + // 鎵╁睍 beforeUpload 楠岃瘉 + if (typeof this.beforeUpload === 'function') { + return this.beforeUpload(file) + } + return true + }, + handleChange(info) { + console.log('--鏂囦欢鍒楄〃鏀瑰彉--') + if (!info.file.status && this.uploadGoOn === false) { + info.fileList.pop() + } + let fileList = info.fileList + if (info.file.status === 'done') { + if (this.number > 0) { + fileList = fileList.slice(-this.number) + } + if (info.file.response.success) { + fileList = fileList.map((file) => { + if (file.response) { + let reUrl = file.response.result.filePath; + file.url = getFileAccessHttpUrl(reUrl) + } + return file + }) + } + //this.$message.success(`${info.file.name} 涓婁紶鎴愬姛!`); + } else if (info.file.status === 'error') { + this.$message.error(`${info.file.name} 涓婁紶澶辫触.`) + } else if (info.file.status === 'removed') { + this.handleDelete(info.file) + } + this.fileList = fileList + if (info.file.status === 'done' || info.file.status === 'removed') { + //returnUrl涓篺alse鏃惰繑鍥炴枃浠跺悕绉般�佹枃浠惰矾寰勫強鏂囦欢澶у皬 + this.newFileList = [] + for (var a = 0; a < fileList.length; a++) { + // update-begin-author:lvdandan date:20200603 for:銆怲ESTA-514銆戙�愬紑婧恑ssue銆戝涓枃浠跺悓鏃朵笂浼犳椂锛屾帶鍒跺彴鎶ラ敊 + if (fileList[a].status === 'done') { + let fileJson = { + fileName: fileList[a].name, + filePath: fileList[a].response.result.filePath, + fileSize: fileList[a].size, + fileEncodeName: fileList[a].response.result.fileEncodeName, + fileSuffix: fileList[a].response.result.fileSuffix, + } + this.newFileList.push(fileJson) + } else { + return + } + // update-end-author:lvdandan date:20200603 for:銆怲ESTA-514銆戙�愬紑婧恑ssue銆戝涓枃浠跺悓鏃朵笂浼犳椂锛屾帶鍒跺彴鎶ラ敊 + } + this.$emit('change', this.newFileList) + } + }, + handleDelete(file) { + //濡傛湁闇�瑕佹柊澧� 鍒犻櫎閫昏緫 + console.log(file) + }, + handlePreview(file) { + if (this.fileType === FILE_TYPE_IMG) { + this.previewImage = file.url || file.thumbUrl + this.previewVisible = true + } else { + location.href = file.url + } + }, + handleCancel() { + this.previewVisible = false + }, + //---------------------------- begin 鍥剧墖宸﹀彸鎹綅缃� ------------------------------------- + moveLast() { + //console.log(ev) + //console.log(this.fileList) + //console.log(this.currentImg) + let index = this.getIndexByUrl() + if (index == 0) { + this.$message.warn('鏈煡鐨勬搷浣�') + } else { + let curr = this.fileList[index].url + let last = this.fileList[index - 1].url + let arr = [] + for (let i = 0; i < this.fileList.length; i++) { + if (i == index - 1) { + arr.push(curr) + } else if (i == index) { + arr.push(last) + } else { + arr.push(this.fileList[i].url) + } + } + this.currentImg = last + this.$emit('change', arr.join(',')) + } + }, + moveNext() { + let index = this.getIndexByUrl() + if (index == this.fileList.length - 1) { + this.$message.warn('宸插埌鏈�鍚巭') + } else { + let curr = this.fileList[index].url + let next = this.fileList[index + 1].url + let arr = [] + for (let i = 0; i < this.fileList.length; i++) { + if (i == index + 1) { + arr.push(curr) + } else if (i == index) { + arr.push(next) + } else { + arr.push(this.fileList[i].url) + } + } + this.currentImg = next + this.$emit('change', arr.join(',')) + } + }, + getIndexByUrl() { + for (let i = 0; i < this.fileList.length; i++) { + if (this.fileList[i].url === this.currentImg || encodeURI(this.fileList[i].url) === this.currentImg) { + return i + } + } + return -1 + } + }, + mounted() { + const moverObj = document.getElementById(this.containerId + '-mover') + if (moverObj) { + moverObj.addEventListener('mouseover', () => { + this.moverHold = true + this.moveDisplay = 'block' + }) + moverObj.addEventListener('mouseout', () => { + this.moverHold = false + this.moveDisplay = 'none' + }) + } + + let picList = document.getElementById(this.containerId) ? document.getElementById(this.containerId).getElementsByClassName('ant-upload-list-picture-card') : [] + if (picList && picList.length > 0) { + picList[0].addEventListener('mouseover', (ev) => { + ev = ev || window.event + let target = ev.target || ev.srcElement + if ('ant-upload-list-item-info' == target.className) { + this.showMoverTask = false + let item = target.parentElement + this.left = item.offsetLeft + this.top = item.offsetTop + item.offsetHeight - 50 + this.moveDisplay = 'block' + this.currentImg = target.getElementsByTagName('img')[0].src + } + + }) + + picList[0].addEventListener('mouseout', (ev) => { + ev = ev || window.event + let target = ev.target || ev.srcElement + //console.log('绉婚櫎',target) + if ('ant-upload-list-item-info' == target.className) { + this.showMoverTask = true + setTimeout(() => { + if (this.moverHold === false) { + this.moveDisplay = 'none' + } + }, 100) + } + if ('ant-upload-list-item ant-upload-list-item-done' == target.className || 'ant-upload-list ant-upload-list-picture-card' == target.className) { + this.moveDisplay = 'none' + } + }) + //---------------------------- end 鍥剧墖宸﹀彸鎹綅缃� ------------------------------------- + } + }, + model: { + prop: 'value', + event: 'change' + } +} +</script> + +<style lang="less"> +.uploadty-disabled { + .ant-upload-list-item { + .anticon-close { + display: none; + } + + .anticon-delete { + display: none; + } + } + + /*update-begin-author:taoyan date:2022-12-5 for: issues/4250 寤鸿JUpload缁勪欢锛宒isabled涓簍rue鐨勬椂鍊欎笂浼燽utton鑳藉鍙樼伆鎴栬�呭叾浠栨牱寮忓浘妗堬紝渚夸簬鐭ユ檽鏃犳硶鍐嶇偣鍑讳笂浼�*/ + + .ant-btn, .ant-upload-disabled { + cursor: not-allowed; + color: rgba(0, 0, 0, 0.25); + background-color: #f5f5f5; + border-color: #d9d9d9; + } + + /*update-end-author:taoyan date:2022-12-5 for: issues/4250 寤鸿JUpload缁勪欢锛宒isabled涓簍rue鐨勬椂鍊欎笂浼燽utton鑳藉鍙樼伆鎴栬�呭叾浠栨牱寮忓浘妗堬紝渚夸簬鐭ユ檽鏃犳硶鍐嶇偣鍑讳笂浼�*/ + +} + +//---------------------------- begin 鍥剧墖宸﹀彸鎹綅缃� ------------------------------------- +.uploadty-mover-mask { + background-color: rgba(0, 0, 0, 0.5); + opacity: .8; + color: #fff; + height: 28px; + line-height: 28px; +} + +//---------------------------- end 鍥剧墖宸﹀彸鎹綅缃� ------------------------------------- +</style> \ No newline at end of file diff --git a/src/components/jeecg/index.js b/src/components/jeecg/index.js index 166f423..65a9f87 100644 --- a/src/components/jeecg/index.js +++ b/src/components/jeecg/index.js @@ -27,6 +27,9 @@ import JTime from './JTime.vue' import JTreeTable from './JTreeTable.vue' import JEasyCron from '@/components/jeecg/JEasyCron' +import LxSwitch from './LxSwitch.vue' +import LxFilePreview from './LxFilePreview.vue' +import LxUpload from './LxUpload.vue' //jeecgbiz import JSelectDepart from '../jeecgbiz/JSelectDepart.vue' import JSelectMultiUser from '../jeecgbiz/JSelectMultiUser.vue' @@ -71,7 +74,9 @@ Vue.component('JTreeSelect', JTreeSelect) Vue.component('JTreeTable', JTreeTable) Vue.component('JUpload', JUpload) - + Vue.component('LxSwitch', LxSwitch) + Vue.component('LxFilePreview', LxFilePreview) + Vue.component('LxUpload', LxUpload) //jeecgbiz Vue.component('JSelectDepart', JSelectDepart) Vue.component('JSelectMultiUser', JSelectMultiUser) diff --git a/src/mixins/JeecgListMixin.js b/src/mixins/JeecgListMixin.js index 16d8a8c..82fe068 100644 --- a/src/mixins/JeecgListMixin.js +++ b/src/mixins/JeecgListMixin.js @@ -8,7 +8,7 @@ import Vue from 'vue' import { ACCESS_TOKEN, TENANT_ID } from "@/store/mutation-types" import store from '@/store' - +import { buttonShowAuthFilter } from '@/utils/authFilter' export const JeecgListMixin = { data(){ return { @@ -74,6 +74,9 @@ } }, methods:{ + isShowAuth(code){ + return buttonShowAuthFilter(code); + }, loadData(arg) { if(!this.url.list){ this.$message.error("璇疯缃畊rl.list灞炴��!") diff --git a/src/utils/authFilter.js b/src/utils/authFilter.js index ed910bb..9cf27aa 100644 --- a/src/utils/authFilter.js +++ b/src/utils/authFilter.js @@ -7,7 +7,32 @@ return globalDisabledAuth(code); } } +/** + * 鏄剧ず鏉冮檺 + * @param {*} code + * @returns + */ +export function buttonShowAuthFilter(code) { + if(code){ + if(nodeShowAuth(code)){ + return true; + }else{ + return false; + } + }else{ + return false; + } +} +function nodeShowAuth(code){ + let authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || "[]"); + for (let auth of authList) { + if(auth.action == code) { + return true; + } + } + return false; +} function nodeDisabledAuth(code,formData){ //console.log("椤甸潰鏉冮檺绂佺敤--NODE--寮�濮�"); let permissionList = []; diff --git a/src/utils/util.js b/src/utils/util.js index bf4f48f..31c8720 100644 --- a/src/utils/util.js +++ b/src/utils/util.js @@ -106,7 +106,7 @@ for (let item of data) { let component = ""; if(item.component.indexOf("layouts")>=0){ - component = "components/"+item.component; + component = "components/"+item.component.trim(); }else{ component = "views/"+item.component; } diff --git a/src/views/andon/modules/AndonOrderForm.vue b/src/views/andon/modules/AndonOrderForm.vue index 5950cf1..5ff7418 100644 --- a/src/views/andon/modules/AndonOrderForm.vue +++ b/src/views/andon/modules/AndonOrderForm.vue @@ -4,18 +4,18 @@ <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> <!-- 绗竴琛岋細浜х嚎 + 瀹夌伅绫诲瀷 --> <a-row :gutter="24"> - <a-col :span="12"> - <a-form-model-item label="浜х嚎" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryId"> - <j-select-factory - :disabled="disabled" - v-model="model.factoryId" - :multi="true" - @back="backFactoryInfo" - :backProduction="true" - :treeProductOpera="true" - ></j-select-factory> - </a-form-model-item> - </a-col> +<!-- <a-col :span="12">--> +<!-- <a-form-model-item label="浜х嚎" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryId">--> +<!-- <j-select-factory--> +<!-- :disabled="disabled"--> +<!-- v-model="model.factoryId"--> +<!-- :multi="true"--> +<!-- @back="backFactoryInfo"--> +<!-- :backProduction="true"--> +<!-- :treeProductOpera="true"--> +<!-- ></j-select-factory>--> +<!-- </a-form-model-item>--> +<!-- </a-col>--> <a-col :span="12"> <a-form-model-item label="瀹夌伅绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="buttonId"> <j-search-select-tag v-model="model.buttonId" placeholder="璇疯緭鍏ュ畨鐏被鍨�" dict="andon_button_config,button_name,id"></j-search-select-tag> @@ -66,13 +66,13 @@ </a-row> <!-- 绗簲琛岋細澶勭悊缁撴灉鍥剧墖 --> - <a-row :gutter="24"> - <a-col :span="12"> - <a-form-model-item label="澶勭悊缁撴灉鍥剧墖" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="imageFiles"> - <j-image-upload isMultiple v-model="model.imageFiles"></j-image-upload> - </a-form-model-item> - </a-col> - </a-row> +<!-- <a-row :gutter="24">--> +<!-- <a-col :span="12">--> +<!-- <a-form-model-item label="澶勭悊缁撴灉鍥剧墖" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="imageFiles">--> +<!-- <j-image-upload isMultiple v-model="model.imageFiles"></j-image-upload>--> +<!-- </a-form-model-item>--> +<!-- </a-col>--> +<!-- </a-row>--> </a-form-model> </j-form-container> </a-spin> @@ -108,7 +108,6 @@ }, confirmLoading: false, validatorRules: { - factoryId: [{ required: true, message: '浜х嚎鏄繀閫夐」', trigger: 'change' }], buttonId: [{ required: true, message: '瀹夌伅绫诲瀷鏄繀閫夐」', trigger: 'change' }], operator: [{ required: true, message: '瀹夌伅浜烘槸蹇呴�夐」', trigger: 'change' }], operateTime: [{ required: true, message: '瀹夌伅鏃堕棿鏄繀閫夐」', trigger: 'change' }], diff --git a/src/views/andon/modules/AndonResponseConfigForm.vue b/src/views/andon/modules/AndonResponseConfigForm.vue index e9cbdc2..c6e57ec 100644 --- a/src/views/andon/modules/AndonResponseConfigForm.vue +++ b/src/views/andon/modules/AndonResponseConfigForm.vue @@ -1,24 +1,33 @@ <template> <a-spin :spinning="confirmLoading"> - <j-form-container :disabled="formDisabled" class="andon-response-form"> + <j-form-container :disabled="disabled" class="andon-response-form"> <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <!-- 浜х嚎閫夋嫨 --> <a-row :gutter="24"> <a-col :span="12"> <a-form-model-item label="浜х嚎" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryId"> - <j-select-factory + <a-tree-select :disabled="disabled" v-model="model.factoryId" - :multi="true" - @back="backFactoryInfo" - :backProduction="true" - :treeProductOpera="true" - ></j-select-factory> + :tree-data="factoryTreeData" + :allow-clear="true" + :show-search="false" + :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" + :tree-check-strictly="true" + placeholder="璇烽�夋嫨" + style="width: 100%" + @change="handleFactoryChange" + class="custom-tree-select"> + <template slot="title" slot-scope="item"> + {{ item.title }} + </template> + </a-tree-select> </a-form-model-item> </a-col> </a-row> - + <!-- 瀹夌伅绫诲瀷鍜屽搷搴斾汉閰嶇疆 --> <a-row :gutter="24"> <a-col :span="12"> <a-form-model-item label="瀹夌伅绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="buttonId"> @@ -30,25 +39,19 @@ </a-form-model-item> </a-col> <a-col :span="12"> - <a-form-model-item label="鍒濆鍝嶅簲浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="firsterResponder"> + <a-form-model-item label="鍒濆鍝嶅簲浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="firstResponder"> <j-select-user-by-dep :multi="false" - v-model="model.firsterResponder" + v-model="model.firstResponder" placeholder="璇烽�夋嫨" ></j-select-user-by-dep> </a-form-model-item> </a-col> </a-row> - <!-- 浜岀骇鍝嶅簲浜� + 涓夌骇鍝嶅簲浜� --> <a-row :gutter="24"> <a-col :span="12"> - <a-form-model-item - label="浜岀骇鍝嶅簲浜�" - :labelCol="labelCol" - :wrapperCol="wrapperCol" - prop="secondResponder" - > + <a-form-model-item label="浜岀骇鍝嶅簲浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="secondResponder"> <j-select-user-by-dep :multi="false" v-model="model.secondResponder" @@ -57,12 +60,7 @@ </a-form-model-item> </a-col> <a-col :span="12"> - <a-form-model-item - label="涓夌骇鍝嶅簲浜�" - :labelCol="labelCol" - :wrapperCol="wrapperCol" - prop="thirdResponder" - > + <a-form-model-item label="涓夌骇鍝嶅簲浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="thirdResponder"> <j-select-user-by-dep :multi="false" v-model="model.thirdResponder" @@ -77,109 +75,117 @@ </template> <script> -import { httpAction } from '@/api/manage' -import JSelectFactory from '@comp/jeecgbiz/JSelectFactory.vue' +import { httpAction, getAction } from '@/api/manage' +import { TreeSelect } from 'ant-design-vue' export default { name: 'AndonResponseConfigForm', components: { - JSelectFactory + 'a-tree-select': TreeSelect }, props: { disabled: { type: Boolean, - default: false, - required: false + default: false } }, - data () { + data() { return { - model: {}, - // 缁熶竴鏍囩鍒楀搴︼紙浜х嚎銆佸畨鐏被鍨嬬瓑鍏辩敤锛� - labelCol: { - xs: { span: 24 }, - sm: { span: 6 }, + model: { + factoryId: '', + buttonId: '', + firstResponder: '', + secondResponder: '', + thirdResponder: '' }, - // 缁熶竴杈撳叆妗嗗垪瀹藉害 - wrapperCol: { - xs: { span: 24 }, - sm: { span: 18 }, - }, + factoryTreeData: [], + labelCol: { xs: { span: 24 }, sm: { span: 6 } }, + wrapperCol: { xs: { span: 24 }, sm: { span: 18 } }, confirmLoading: false, validatorRules: { - factoryId: [ - { required: true, message: '浜х嚎鏄繀閫夐」', trigger: 'change' } - ], - buttonId: [ - { required: true, message: '瀹夌伅绫诲瀷鏄繀閫夐」', trigger: 'change' } - ], - firsterResponder: [ - { required: true, message: '鍒濆鍝嶅簲浜烘槸蹇呴�夐」', trigger: 'change' } - ], - secondResponder: [ - { required: true, message: '浜岀骇鍝嶅簲浜烘槸蹇呴�夐」', trigger: 'change' } - ], - thirdResponder: [ - { required: true, message: '涓夌骇鍝嶅簲浜烘槸蹇呴�夐」', trigger: 'change' } - ], + factoryId: [{ required: true, message: '浜х嚎鏄繀閫夐」', trigger: 'change' }], + buttonId: [{ required: true, message: '瀹夌伅绫诲瀷鏄繀閫夐」', trigger: 'change' }], + firstResponder: [{ required: true, message: '鍒濆鍝嶅簲浜烘槸蹇呴�夐」', trigger: 'change' }], + secondResponder: [{ required: true, message: '浜岀骇鍝嶅簲浜烘槸蹇呴�夐」', trigger: 'change' }], + thirdResponder: [{ required: true, message: '涓夌骇鍝嶅簲浜烘槸蹇呴�夐」', trigger: 'change' }] }, url: { add: "/andonresponseconfig/andonResponseConfig/add", edit: "/andonresponseconfig/andonResponseConfig/edit", - queryById: "/andonresponseconfig/andonResponseConfig/queryById" + factoryTree: "/base/factory/queryTreeList" } } }, - computed: { - formDisabled(){ - return this.disabled - }, - }, - created () { - this.modelDefault = JSON.parse(JSON.stringify(this.model)); + created() { + this.modelDefault = { ...this.model } + this.loadFactoryTree() }, methods: { - backFactoryInfo(info) { - this.model.factoryIds = this.model.factoryId - this.nextFactoryOptions = info.map((item, index, arr) => { - let c = { label: item.text, value: item.value + '' } - return c - }) + loadFactoryTree() { + this.confirmLoading = true + getAction(this.url.factoryTree) + .then(res => { + if (res.success && Array.isArray(res.result)) { + this.factoryTreeData = this.transformData(res.result) + console.log('浜х嚎鏁版嵁鍔犺浇鎴愬姛锛�', this.factoryTreeData) + } else { + this.$message.warning('浜х嚎鏁版嵁涓虹┖鎴栨牸寮忓紓甯�') + this.factoryTreeData = [] + } + }) + .catch(err => { + console.error('浜х嚎鏁版嵁鍔犺浇澶辫触锛�', err) + this.$message.error('鍔犺浇浜х嚎鏁版嵁澶辫触锛岃閲嶈瘯') + }) + .finally(() => { + this.confirmLoading = false + }) }, - add () { - this.edit(this.modelDefault); + + transformData(nodes) { + return nodes.map(node => ({ + key: node.id, + title: node.factoryName, + value: node.id, + children: node.children && node.children.length > 0 ? this.transformData(node.children) : [] + })) }, - edit (record) { - this.model = Object.assign({}, record); - this.visible = true; + + handleFactoryChange(value) { + this.model.factoryId = value }, - submitForm () { - const that = this; + + add() { + this.model = { ...this.modelDefault } + this.visible = true + }, + edit(record) { + this.model = { ...record } + this.visible = true + }, + + submitForm() { this.$refs.form.validate(valid => { if (valid) { - that.confirmLoading = true; - let httpurl = ''; - let method = ''; - if(!this.model.id){ - httpurl+=this.url.add; - method = 'post'; - }else{ - httpurl+=this.url.edit; - method = 'put'; - } - httpAction(httpurl,this.model,method).then((res)=>{ - if(res.success){ - that.$message.success(res.message); - that.$emit('ok'); - }else{ - that.$message.warning(res.message); - } - }).finally(() => { - that.confirmLoading = false; - }) + this.confirmLoading = true + const httpurl = this.model.id ? this.url.edit : this.url.add + const method = this.model.id ? 'put' : 'post' + + httpAction(httpurl, this.model, method) + .then(res => { + if (res.success) { + this.$message.success(res.message) + this.$emit('ok') + } else { + this.$message.warning(res.message) + } + }) + .finally(() => { + this.confirmLoading = false + }) } }) - }, + } } } </script> @@ -187,43 +193,39 @@ <style scoped> .andon-response-form { padding: 24px; - background-color: #fff; + background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); } .a-form-model-item { margin-bottom: 20px !important; } -.a-form-model-item-label { - margin-right: 16px !important; +.ant-tree-select-selection { + min-height: 32px !important; } -.a-input::placeholder, -.a-select-selection-placeholder { - color: #ccc; - font-style: italic; -} -.a-form-model-item-label > span:first-child { - color: #f5222d; - margin-right: 4px; -} -.a-form-footer { - text-align: right; - margin-top: 36px; -} -.a-button-primary { - background-color: #1890ff; - border-color: #1890ff; - transition: all 0.3s ease; -} -.a-button-primary:hover { - background-color: #40a9ff; - border-color: #40a9ff; -} -.a-button-default { - border-color: #d9d9d9; - transition: all 0.3s ease; -} -.a-button-default:hover { - border-color: #bfbfbf; + +/* 鏍戝舰閫夋嫨缁勪欢鑷畾涔夋牱寮� */ +.custom-tree-select { + /* 璋冩暣涓嬫媺鑿滃崟瀹藉害锛屼娇鍏舵洿閫傞厤鍐呭 */ + & .ant-tree-select-dropdown .ant-tree-select-tree { + width: 220px; + } + /* 鑺傜偣 hover 鏁堟灉 */ + & .ant-tree-select-tree-node:hover { + background-color: #e6f7ff !important; + } + /* 鑺傜偣閫変腑鏁堟灉 */ + & .ant-tree-select-tree-node-selected { + background-color: #bae7ff !important; + } + /* 璋冩暣瀛椾綋澶у皬鍜岃楂� */ + & .ant-tree-select-tree-title { + font-size: 14px; + line-height: 24px; + } + /* 璋冩暣缂╄繘锛屼紭鍖栧眰绾ц瑙夋晥鏋� */ + & .ant-tree-select-tree-indent { + width: 16px; + } } </style> \ No newline at end of file diff --git a/src/views/eam/base/EamEquipmentFaultReasonList.vue b/src/views/eam/base/EamEquipmentFaultReasonList.vue new file mode 100644 index 0000000..7b8a444 --- /dev/null +++ b/src/views/eam/base/EamEquipmentFaultReasonList.vue @@ -0,0 +1,172 @@ +<template> + <a-card :bordered="false"> + + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鏁呴殰缂栫爜"> + <j-input placeholder="璇疯緭鍏ユ晠闅滅紪鐮�" v-model="queryParam.faultCode"></j-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鏁呴殰绠�绉�"> + <j-input placeholder="璇疯緭鍏ユ晠闅滅畝绉�" v-model="queryParam.faultName"></j-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鏁呴殰鍒嗙被"> + <j-dict-select-tag dict-code="fault_reason_category" placeholder="璇烽�夋嫨鏁呴殰鍒嗙被" v-model="queryParam.faultCategory"></j-dict-select-tag> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-button type="primary" icon="download" @click="handleExportXls('璁惧鏁呴殰鍘熷洜缁存姢')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" + @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel"> + <a-icon type="delete" /> + 鍒犻櫎 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down" /> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a + style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange"> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <eamEquipmentFaultReason-modal ref="modalForm" @ok="modalFormOk"></eamEquipmentFaultReason-modal> + </a-card> +</template> + +<script> +import '@/assets/less/TableExpand.less' +import EamEquipmentFaultReasonModal from './modules/EamEquipmentFaultReasonModal' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' + +export default { + name: 'EamEquipmentFaultReasonList', + mixins: [JeecgListMixin], + components: { + EamEquipmentFaultReasonModal + }, + data() { + return { + description: '璁惧鏁呴殰鍘熷洜缁存姢绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鏁呴殰缂栫爜', + align: 'center', + dataIndex: 'faultCode' + }, + { + title: '鏁呴殰绠�绉�', + align: 'center', + dataIndex: 'faultName' + }, + { + title: '鏁呴殰鎻忚堪', + align: 'center', + dataIndex: 'faultDescription' + }, + { + title: '鏁呴殰鍒嗙被', + align: 'center', + dataIndex: 'faultCategory_dictText' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: '/eam/equipmentFaultReason/list', + delete: '/eam/equipmentFaultReason/delete', + deleteBatch: '/eam/equipmentFaultReason/deleteBatch', + exportXlsUrl: 'eam/equipmentFaultReason/exportXls', + importExcelUrl: 'eam/equipmentFaultReason/importExcel' + } + } + }, + computed: { + importExcelUrl: function() { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` + } + }, + methods: {} +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/base/EamFluidList.vue b/src/views/eam/base/EamFluidList.vue new file mode 100644 index 0000000..068dfbf --- /dev/null +++ b/src/views/eam/base/EamFluidList.vue @@ -0,0 +1,199 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="娌规恫缂栫爜"> + <j-input placeholder="璇疯緭鍏ユ补娑茬紪鐮�" v-model="queryParam.fluidCode"></j-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="娌规恫鍚嶇О"> + <j-input placeholder="璇疯緭鍏ユ补娑插悕绉�" v-model="queryParam.fluidName"></j-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-button type="primary" icon="download" @click="handleExportXls('娌规恫淇℃伅')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> + <!-- 楂樼骇鏌ヨ鍖哄煙 --> +<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>--> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>鍒犻櫎</a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + + <eam-fluid-modal ref="modalForm" @ok="modalFormOk"></eam-fluid-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import EamFluidModal from './modules/EamFluidModal' + + export default { + name: 'EamFluidList', + mixins:[JeecgListMixin, mixinDevice], + components: { + EamFluidModal + }, + data () { + return { + description: '娌规恫淇℃伅绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'娌规恫缂栫爜', + align:"center", + dataIndex: 'fluidCode' + }, + { + title:'娌规恫鍚嶇О', + align:"center", + dataIndex: 'fluidName' + }, + { + title:'澶囨敞', + align:"center", + dataIndex: 'remark' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/eam/eamFluid/list", + delete: "/eam/eamFluid/delete", + deleteBatch: "/eam/eamFluid/deleteBatch", + exportXlsUrl: "/eam/eamFluid/exportXls", + importExcelUrl: "eam/eamFluid/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'fluidName',text:'娌规恫鍚嶇О',dictCode:''}) + fieldList.push({type:'string',value:'fluidCode',text:'娌规恫缂栫爜',dictCode:''}) + fieldList.push({type:'string',value:'remark',text:'澶囨敞',dictCode:''}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/base/EamMaintenanceStandardList.vue b/src/views/eam/base/EamMaintenanceStandardList.vue new file mode 100644 index 0000000..d053dff --- /dev/null +++ b/src/views/eam/base/EamMaintenanceStandardList.vue @@ -0,0 +1,534 @@ +<template> + <a-card :bordered="false"> + + <template v-if="isDisplayOperation"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="24"> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="鏍囧噯缂栫爜"> + <a-input + placeholder="璇疯緭鍏ユ爣鍑嗙紪鐮�" + v-model="queryParam.standardCode" + ></a-input> + </a-form-item> + </a-col> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="鏍囧噯鍚嶇О"> + <a-input + placeholder="璇疯緭鍏ユ爣鍑嗗悕绉�" + v-model="queryParam.standardName" + ></a-input> + </a-form-item> + </a-col> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="璁惧缂栧彿"> + <lx-search-equipment-select + placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" + v-model="queryParam.equipmentId" + ></lx-search-equipment-select> + </a-form-item> + </a-col> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="淇濆吇鍒嗙被"> + <j-dict-select-tag + dict-code="maintenance_category" + placeholder="璇烽�夋嫨淇濆吇鍒嗙被" + v-model="queryParam.maintenanceCategory" + /> + </a-form-item> + </a-col> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="鏍囧噯鐘舵��"> + <j-dict-select-tag + dict-code="maintenance_standard_status" + placeholder="璇烽�夋嫨鏍囧噯鐘舵��" + v-model="queryParam.standardStatus" + /> + </a-form-item> + </a-col> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <span + style="float: left;overflow: hidden;" + class="table-page-search-submitButtons" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + type="info" + @click="searchReset" + icon="reload" + style="margin-left: 8px" + >閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button + @click="handleAdd" + type="primary" + icon="plus" + >鏂板</a-button> + <a-upload + name="file" + :showUploadList="false" + :multiple="true" + :headers="tokenHeader" + :action="inspectionImportExcel" + @change="handleImportExcel" + > + <a-button + type="primary" + icon="import" + >鐐规鏍囧噯瀵煎叆</a-button> + </a-upload> + <a-button + type="primary" + icon="download" + @click="handleTemplateXlsDownload(url.inspectionXlsDownloadUrl)" + >鐐规鏍囧噯妯℃澘涓嬭浇</a-button> + <a-upload + name="file" + :showUploadList="false" + :multiple="true" + :headers="tokenHeader" + :action="secondMaintenanceImportExcel" + @change="handleImportExcel" + > + <a-button + type="primary" + icon="import" + >浜屼繚鏍囧噯瀵煎叆</a-button> + </a-upload> + <a-button + type="primary" + icon="download" + @click="handleTemplateXlsDownload(url.secondMaintenanceXlsDownloadUrl)" + >浜屼繚鏍囧噯妯℃澘涓嬭浇</a-button> + <a-upload + name="file" + :showUploadList="false" + :multiple="true" + :headers="tokenHeader" + :action="thirdMaintenanceImportExcel" + @change="handleImportExcel" + > + <a-button + type="primary" + icon="import" + >涓変繚鏍囧噯瀵煎叆</a-button> + </a-upload> + <a-button + type="primary" + icon="download" + @click="handleTemplateXlsDownload(url.thirdMaintenanceXlsDownloadUrl)" + >涓変繚鏍囧噯妯℃澘涓嬭浇</a-button> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item + key="1" + @click="batchDel" + > + <a-icon type="delete" /> + 鍒犻櫎 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down" /> + </a-button> + </a-dropdown> + </div> + </template> + + <!-- table鍖哄煙-begin --> + <div> + <div + class="ant-alert ant-alert-info" + style="margin-bottom: 16px;" + v-if="isDisplayOperation" + > + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a + style="margin-left: 24px" + @click="onClearSelected" + >娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + :customRow='clickThenSelect' + @change="handleTableChange" + > + <template + slot="referenceFile" + slot-scope="text, record, index" + > + <a + v-if="text && text !== ''" + @click.stop="handlePreview(record)" + >棰勮</a> + </template> + <span + slot="action" + slot-scope="text, record" + > + <a + v-if="record.standardStatus === 'NORMAL'" + @click.stop="handleEdit(record)" + >缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item v-if="record.standardStatus === 'NORMAL'"> + <a @click.stop="handleUpgrade(record)">鍗囩増</a> + </a-menu-item> + <a-menu-item v-if="record.standardStatus === 'NORMAL'"> + <a-popconfirm + title="纭畾浣滃簾鍚�?" + @confirm="() => handleAbolish(record.id)" + > + <a>浣滃簾</a> + </a-popconfirm> + </a-menu-item> + <a-menu-item v-if="record.referenceFile !== null"> + <a-popconfirm + title="纭畾涓嬭浇鏂囦欢鍚�?" + @confirm="() => handleDownload(record)" + > + <a>涓嬭浇</a> + </a-popconfirm> + </a-menu-item> + <a-menu-item> + <a-popconfirm + title="纭畾鍒犻櫎鍚�?" + @confirm="() => handleDelete(record.id)" + > + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + + <a-tabs defaultActiveKey="1"> + <a-tab-pane + tab='淇濆吇鏍囧噯鏄庣粏椤�' + key="1" + > + <div + class="table-operator" + style="margin:-16px" + > + <eam-maintenance-standard-detail-list + ref="standardDetailRef" + :standardId="standardId" + /> + </div> + </a-tab-pane> + + </a-tabs> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <eamMaintenanceStandard-modal + ref="modalForm" + @ok="modalFormOk" + ></eamMaintenanceStandard-modal> + <lx-file-preview + ref="lxFilePreview" + :fileUrl="fileUrl" + ></lx-file-preview> + </a-card> +</template> + +<script> +import '@/assets/less/TableExpand.less' +import EamMaintenanceStandardModal from './modules/EamMaintenanceStandardModal' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import EamMaintenanceStandardDetailList from '@views/eam/base/modules/EamMaintenanceStandardDetailList' +import { deleteAction, templateXlsDownload, downFile } from '@api/manage' +import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' + + +export default { + name: 'EamMaintenanceStandardList', + mixins: [JeecgListMixin], + props: { + isDisplayOperation: { + type: Boolean, + default: true + } + }, + components: { + LxSearchEquipmentSelect, + EamMaintenanceStandardModal, + EamMaintenanceStandardDetailList + }, + data() { + return { + description: '淇濆吇鏍囧噯绠$悊椤甸潰', + disableMixinCreated: true, + // 琛ㄥご + columns: [ + { + title: '鏍囧噯缂栫爜', + align: 'center', + dataIndex: 'standardCode' + }, + { + title: '鏍囧噯鍚嶇О', + align: 'center', + dataIndex: 'standardName' + }, + { + title: '鏂囦欢缂栧彿', + align: 'center', + dataIndex: 'fileCode' + }, + { + title: '淇濆吇鍛ㄦ湡(澶�)', + align: 'center', + dataIndex: 'maintenancePeriod' + }, + { + title: '鍒濆鏃ユ湡', + align: 'center', + dataIndex: 'initialDate' + }, + { + title: '淇濆吇鍒嗙被', + align: 'center', + dataIndex: 'maintenanceCategory_dictText' + }, + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentId_dictText' + }, + { + title: '鏍囧噯鐘舵��', + align: 'center', + dataIndex: 'standardStatus_dictText' + }, + { + title: '鐗堟湰', + align: 'center', + dataIndex: 'standardVersion' + }, + { + title: '鍙傝�冩枃浠�', + align: 'center', + dataIndex: 'referenceFile', + scopedSlots: { customRender: 'referenceFile' } + } + ], + url: { + list: '/eam/maintenanceStandard/list', + delete: '/eam/maintenanceStandard/delete', + deleteBatch: '/eam/maintenanceStandard/deleteBatch', + exportXlsUrl: 'eam/maintenanceStandard/exportXls', + inspectionImportExcel: 'eam/maintenanceStandard/inspectionImportExcel', + weekMaintenanceImportExcel: 'eam/maintenanceStandard/weekMaintenanceImportExcel', + secondMaintenanceImportExcel: 'eam/maintenanceStandard/secondMaintenanceImportExcel', + thirdMaintenanceImportExcel: 'eam/maintenanceStandard/thirdMaintenanceImportExcel', + inspectionXlsDownloadUrl: '瀵煎叆妯℃澘/鐐规鏍囧噯瀵煎叆妯℃澘_v1.0.xlsx', + weekMaintenanceXlsDownloadUrl: '瀵煎叆妯℃澘/鍛ㄤ繚鏍囧噯瀵煎叆妯℃澘_v1.0.xlsx', + secondMaintenanceXlsDownloadUrl: '瀵煎叆妯℃澘/浜屼繚鏍囧噯瀵煎叆妯℃澘_v1.0.xlsx', + thirdMaintenanceXlsDownloadUrl: '瀵煎叆妯℃澘/涓変繚鏍囧噯瀵煎叆妯℃澘_v1.0.xlsx', + abolish: '/eam/maintenanceStandard/abolish', + download: '/eam/maintenanceStandard/downloadFile', + }, + fileUrl: '', + standardId: '-1' + } + }, + computed: { + inspectionImportExcel: function () { + return `${window._CONFIG['domianURL']}/${this.url.inspectionImportExcel}` + }, + weekMaintenanceImportExcel: function () { + return `${window._CONFIG['domianURL']}/${this.url.weekMaintenanceImportExcel}` + }, + secondMaintenanceImportExcel: function () { + return `${window._CONFIG['domianURL']}/${this.url.secondMaintenanceImportExcel}` + }, + thirdMaintenanceImportExcel: function () { + return `${window._CONFIG['domianURL']}/${this.url.thirdMaintenanceImportExcel}` + } + }, + created() { + if (!this.isDisplayOperation) { + return + } + const operationColumn = { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' } + } + this.columns = [...this.columns, operationColumn] + this.loadData(1) + }, + methods: { + handlePreview: function (record) { + if (record.referenceFile) { + try { + let file = JSON.parse(record.referenceFile) + this.$refs.lxFilePreview.preview(file.filePath) + } catch (e) { + console.error(e) + this.$message.error(e.message) + } + } else { + this.$message.warning('鍙傝�冩枃浠朵负绌猴紒') + } + }, + clickThenSelect(record) { + return { + style: { + cursor: 'pointer' + }, + on: { + click: () => { + this.onSelectChange(record.id.split(','), [record]) + } + } + } + }, + onClearSelected() { + this.selectedRowKeys = [] + this.selectionRows = [] + this.standardId = '-1' + }, + onSelectChange(selectedRowKeys, selectionRows) { + this.selectedRowKeys = selectedRowKeys + this.selectionRows = selectionRows + if (selectedRowKeys.length === 1) { + this.standardId = selectedRowKeys[0] + } else { + this.standardId = '-1' + } + }, + searchReset() { + this.standardId = '-1' + this.queryParam = {} + this.loadData(1) + }, + handleTemplateXlsDownload(url) { + templateXlsDownload(url) + }, + handleAbolish: function (id) { + if (!this.url.abolish) { + this.$message.error("璇疯缃畊rl.abolish灞炴��!") + return + } + var that = this; + deleteAction(that.url.abolish, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }); + that.loadData(); + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }); + } + }); + }, + handleUpgrade(record) { + //鍗囩増 + this.$refs.modalForm.upgrade(record); + this.$refs.modalForm.title = "鍗囩増"; + this.$refs.modalForm.disableSubmit = false; + }, + handleDownload(record) { + downFile(this.url.download, { id: record.id }).then((res) => { + if (!res) { + this.$message.warning('鏂囦欢涓嬭浇澶辫触') + return + } else { + let fileName = record.fileName; + if (typeof window.navigator.msSaveBlob !== 'undefined') { + window.navigator.msSaveBlob(new Blob([res]), fileName); + } else { + let url = window.URL.createObjectURL(new Blob([res])); + let link = document.createElement('a'); + link.style.display = 'none'; + link.href = url; + link.setAttribute('download', fileName); + document.body.appendChild(link); + link.click() + document.body.removeChild(link) //涓嬭浇瀹屾垚绉婚櫎鍏冪礌 + window.URL.revokeObjectURL(url) //閲婃斁鎺塨lob瀵硅薄 + } + } + }) + }, + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/base/EamPrecisionParametersList.vue b/src/views/eam/base/EamPrecisionParametersList.vue new file mode 100644 index 0000000..b1967a2 --- /dev/null +++ b/src/views/eam/base/EamPrecisionParametersList.vue @@ -0,0 +1,168 @@ +<template> + <a-card :bordered="false"> + + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鍙傛暟缂栫爜"> + <j-input placeholder="璇疯緭鍏ュ弬鏁扮紪鐮�" v-model="queryParam.parameterCode"></j-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="妫�娴嬮」鐩�"> + <j-input placeholder="璇疯緭鍏ユ娴嬮」鐩�" v-model="queryParam.parameterName"></j-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鍙傛暟鍒嗙被"> + <j-dict-select-tag dict-code="precision_parameters_category" placeholder="璇烽�夋嫨鍙傛暟鍒嗙被" v-model="queryParam.parameterCategory"></j-dict-select-tag> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </span> + </a-col> + + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-button type="primary" icon="download" @click="handleExportXls('绮惧害鍙傛暟缁存姢')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" + @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel"> + <a-icon type="delete" /> + 鍒犻櫎 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down" /> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a + style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange"> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <eamPrecisionParameters-modal ref="modalForm" @ok="modalFormOk"></eamPrecisionParameters-modal> + </a-card> +</template> + +<script> +import '@/assets/less/TableExpand.less' +import EamPrecisionParametersModal from './modules/EamPrecisionParametersModal' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' + +export default { + name: 'EamPrecisionParametersList', + mixins: [JeecgListMixin], + components: { + EamPrecisionParametersModal + }, + data() { + return { + description: '绮惧害鍙傛暟缁存姢绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鍙傛暟缂栫爜', + align: 'center', + dataIndex: 'parameterCode' + }, + { + title: '妫�娴嬮」鐩�', + align: 'center', + dataIndex: 'parameterName' + }, + { + title: '鍙傛暟鍒嗙被', + align: 'center', + dataIndex: 'parameterCategory_dictText' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: '/eam/precisionParameters/list', + delete: '/eam/precisionParameters/delete', + deleteBatch: '/eam/precisionParameters/deleteBatch', + exportXlsUrl: 'eam/precisionParameters/exportXls', + importExcelUrl: 'eam/precisionParameters/importExcel' + } + } + }, + computed: { + importExcelUrl: function() { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` + } + }, + methods: {} +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/base/EamProcessParametersList.vue b/src/views/eam/base/EamProcessParametersList.vue new file mode 100644 index 0000000..1736c69 --- /dev/null +++ b/src/views/eam/base/EamProcessParametersList.vue @@ -0,0 +1,172 @@ +<template> + <a-card :bordered="false"> + + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鍙傛暟缂栫爜4444"> + <j-input placeholder="璇疯緭鍏ュ弬鏁扮紪鐮�" v-model="queryParam.parameterCode"></j-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鍙傛暟鍚嶇О"> + <j-input placeholder="璇疯緭鍏ュ弬鏁板悕绉�" v-model="queryParam.parameterName"></j-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鍙傛暟鍒嗙被"> + <j-dict-select-tag dict-code="process_parameters_category" placeholder="璇烽�夋嫨鍙傛暟鍒嗙被" v-model="queryParam.parameterCategory"></j-dict-select-tag> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-button type="primary" icon="download" @click="handleExportXls('宸ュ簭鍙傛暟缁存姢')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" + @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel"> + <a-icon type="delete" /> + 鍒犻櫎 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down" /> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a + style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange"> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <eamProcessParameters-modal ref="modalForm" @ok="modalFormOk"></eamProcessParameters-modal> + </a-card> +</template> + +<script> +import '@/assets/less/TableExpand.less' +import EamProcessParametersModal from './modules/EamProcessParametersModal' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' + +export default { + name: 'EamProcessParametersList', + mixins: [JeecgListMixin], + components: { + EamProcessParametersModal + }, + data() { + return { + description: '宸ュ簭鍙傛暟缁存姢绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鍙傛暟缂栫爜', + align: 'center', + dataIndex: 'parameterCode' + }, + { + title: '鍙傛暟鍚嶇О', + align: 'center', + dataIndex: 'parameterName' + }, + { + title: '鍙傛暟鍒嗙被', + align: 'center', + dataIndex: 'parameterCategory_dictText' + }, + { + title: '璁¢噺鍗曚綅', + align: 'center', + dataIndex: 'parameterUnit' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: '/eam/processParameters/list', + delete: '/eam/processParameters/delete', + deleteBatch: '/eam/processParameters/deleteBatch', + exportXlsUrl: 'eam/processParameters/exportXls', + importExcelUrl: 'eam/processParameters/importExcel' + } + } + }, + computed: { + importExcelUrl: function() { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` + } + }, + methods: {} +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/base/EamSysFilesList.vue b/src/views/eam/base/EamSysFilesList.vue new file mode 100644 index 0000000..f1c6ae6 --- /dev/null +++ b/src/views/eam/base/EamSysFilesList.vue @@ -0,0 +1,204 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鏂囦欢鍚嶇О"> + <j-input placeholder="璇疯緭鍏ユ枃浠跺悕绉�" v-model="queryParam.fileName"></j-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </span> + </a-col> + + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel"> + <a-icon type="delete" /> + 鍒犻櫎 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down" /> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a + style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange"> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handlePreview(record)">棰勮</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾涓嬭浇鏂囦欢鍚�?" @confirm="() => handleDownload(record)"> + <a>涓嬭浇</a> + </a-popconfirm> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <eamSysFiles-modal ref="modalForm" @ok="modalFormOk"></eamSysFiles-modal> + <lx-file-preview ref="lxFilePreview" :fileUrl="fileUrl"></lx-file-preview> + </a-card> +</template> + +<script> +import '@/assets/less/TableExpand.less' +import EamSysFilesModal from './modules/EamSysFilesModal' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import { downFile } from '@/api/manage'; + +export default { + name: 'EamSysFilesList', + mixins: [JeecgListMixin], + components: { + EamSysFilesModal + }, + data() { + return { + description: '璁惧闄勪欢绠$悊绠$悊椤甸潰', + fileUrl: '', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鏂囦欢鍔犲瘑鍚�', + align: 'center', + dataIndex: 'fileEncodeName', + ellipsis: true, + }, + { + title: '鏂囦欢鍚嶇О', + align: 'center', + dataIndex: 'fileName', + ellipsis: true, + }, + { + title: '鏂囦欢璺緞', + align: 'center', + dataIndex: 'filePath', + ellipsis: true, + }, + { + title: '鏂囦欢鍚庣紑鍚�', + align: 'center', + dataIndex: 'fileSuffix' + }, + { + title: '鏂囦欢澶у皬', + align: 'center', + dataIndex: 'fileSize' + }, + { + title: '鎻忚堪', + align: 'center', + dataIndex: 'description', + ellipsis: true, + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: '/eam/sysFiles/list', + delete: '/eam/sysFiles/delete', + deleteBatch: '/eam/sysFiles/deleteBatch', + download: '/eam/sysFiles/downloadFile', + } + } + }, + computed: {}, + methods: { + handleDownload(record) { + downFile(this.url.download, { id: record.id }).then((res) => { + if (!res) { + this.$message.warning('鏂囦欢涓嬭浇澶辫触') + return + } else { + let fileName = record.fileName; + if (typeof window.navigator.msSaveBlob !== 'undefined') { + window.navigator.msSaveBlob(new Blob([res]), fileName); + } else { + let url = window.URL.createObjectURL(new Blob([res])); + let link = document.createElement('a'); + link.style.display = 'none'; + link.href = url; + link.setAttribute('download', fileName); + document.body.appendChild(link); + link.click() + document.body.removeChild(link) //涓嬭浇瀹屾垚绉婚櫎鍏冪礌 + window.URL.revokeObjectURL(url) //閲婃斁鎺塨lob瀵硅薄 + } + } + }) + }, + handlePreview: function (record) { + this.$refs.lxFilePreview.preview(record.filePath); + }, + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/base/modules/EamEquipmentFaultReasonModal.vue b/src/views/eam/base/modules/EamEquipmentFaultReasonModal.vue new file mode 100644 index 0000000..79b0989 --- /dev/null +++ b/src/views/eam/base/modules/EamEquipmentFaultReasonModal.vue @@ -0,0 +1,127 @@ +<template> + <j-modal + :title="title" + :width="800" + :visible="visible" + :confirmLoading="confirmLoading" + switchFullscreen + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :model="model" :rules="validatorRules"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="faultCode" label="鏁呴殰缂栫爜"> + <a-input placeholder="缂栫爜鑷姩鐢熸垚" v-model="model.faultCode" disabled /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="faultName" label="鏁呴殰绠�绉�"> + <a-input placeholder="璇疯緭鍏ユ晠闅滅畝绉�" v-model="model.faultName" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="faultCategory" label="鏁呴殰鍒嗙被"> + <j-dict-select-tag dict-code="fault_reason_category" placeholder="璇烽�夋嫨鏁呴殰鍒嗙被" + v-model="model.faultCategory"></j-dict-select-tag> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="faultDescription" label="鏁呴殰鎻忚堪"> + <a-textarea placeholder="璇疯緭鍏ユ晠闅滄弿杩�" v-model="model.faultDescription" /> + </a-form-model-item> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> +import { httpAction } from '@/api/manage' +import moment from 'moment' + +export default { + name: 'EamEquipmentFaultReasonModal', + data() { + return { + title: '鎿嶄綔', + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + }, + + confirmLoading: false, + validatorRules: { + faultName:[ + { required: true, message: '璇疯緭鍏ユ晠闅滅畝绉�!' } + ], + faultCategory: [ + { required: true, message: '璇烽�夋嫨鏁呴殰鍒嗙被!' } + ], + faultDescription: [ + { required: true, message: '璇疯緭鍏ユ晠闅滄弿杩�!' } + ], + }, + url: { + add: '/eam/equipmentFaultReason/add', + edit: '/eam/equipmentFaultReason/edit' + } + } + }, + created() { + }, + methods: { + add() { + //鍒濆鍖栭粯璁ゅ�� + this.edit({}) + }, + edit(record) { + this.model = Object.assign({}, record) + this.visible = true + }, + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() + }, + handleOk() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true + let httpurl = '' + let method = '' + if (!this.model.id) { + httpurl += this.url.add + method = 'post' + } else { + httpurl += this.url.edit + method = 'put' + } + httpAction(httpurl, this.model, method).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.$emit('ok') + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = false + that.close() + }) + } else { + return false + } + }) + }, + handleCancel() { + this.close() + } + + } +} +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/base/modules/EamFluidForm.vue b/src/views/eam/base/modules/EamFluidForm.vue new file mode 100644 index 0000000..3d54a1d --- /dev/null +++ b/src/views/eam/base/modules/EamFluidForm.vue @@ -0,0 +1,118 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="娌规恫缂栫爜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fluidCode"> + <a-input v-model="model.fluidCode" placeholder="绯荤粺鑷姩鐢熸垚" disabled></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="娌规恫鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fluidName"> + <a-input v-model="model.fluidName" placeholder="璇疯緭鍏ユ补娑插悕绉�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="澶囨敞" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> + <a-textarea v-model="model.remark" placeholder="璇疯緭鍏ュ娉�" ></a-textarea> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import { validateDuplicateValue } from '@/utils/util' + + export default { + name: 'EamFluidForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + fluidName: [ + { required: true, message: '璇疯緭鍏ユ补娑插悕绉�!'}, + { validator: (rule, value, callback) => validateDuplicateValue('eam_fluid', 'fluid_name', value, this.model.id, callback) } + ], + }, + url: { + add: "/eam/eamFluid/add", + edit: "/eam/eamFluid/edit", + queryById: "/eam/eamFluid/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/eam/base/modules/EamFluidModal.vue b/src/views/eam/base/modules/EamFluidModal.vue new file mode 100644 index 0000000..cebe597 --- /dev/null +++ b/src/views/eam/base/modules/EamFluidModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <eam-fluid-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></eam-fluid-form> + </j-modal> +</template> + +<script> + + import EamFluidForm from './EamFluidForm' + export default { + name: 'EamFluidModal', + components: { + EamFluidForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/src/views/eam/base/modules/EamMaintenanceStandardDetailList.vue b/src/views/eam/base/modules/EamMaintenanceStandardDetailList.vue new file mode 100644 index 0000000..51fcea1 --- /dev/null +++ b/src/views/eam/base/modules/EamMaintenanceStandardDetailList.vue @@ -0,0 +1,151 @@ +<template> + <a-card :bordered="false"> + <!-- table鍖哄煙-begin --> + <div> + <a-table + ref="detailTable" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + @change="handleTableChange"> + </a-table> + </div> + <!-- table鍖哄煙-end --> + + </a-card> +</template> + +<script> +import '@/assets/less/TableExpand.less' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import { getAction } from '@api/manage' + +export default { + name: 'EamMaintenanceStandardDetailList', + mixins: [JeecgListMixin], + props: { + standardId: { + type: String, + required: true, + default: '-1' + } + }, + data() { + return { + description: '淇濆吇鏍囧噯鏄庣粏绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '搴忓彿', + align: 'center', + dataIndex: 'itemCode', + width: 60, + }, + { + title: '閮ㄤ綅', + align: 'center', + dataIndex: 'itemPart', + width: 200, + ellipsis: true, + }, + { + title: '淇濆吇椤�', + align: 'center', + dataIndex: 'itemName', + ellipsis: true, + }, + { + title: '淇濆吇瑕佹眰', + align: 'center', + dataIndex: 'itemDemandAlias', + ellipsis: true, + }, + { + title: '妫�鏌ユ爣鍑嗘垨瑕佹眰', + align: 'center', + dataIndex: 'itemDemand', + ellipsis: true, + }, + { + title: '妫�鏌ユ柟娉�', + align: 'center', + dataIndex: 'checkMethod', + ellipsis: true, + } + ], + url: { + list: '/eam/eamMaintenanceStandardDetail/list' + } + } + }, + watch: { + standardId: { + immediate: true, + handler(val) { + if(val) { + this.loadData(1) + }else { + this.clearList(); + } + } + } + }, + created() { + }, + computed: { + }, + methods: { + loadData(arg) { + if (!this.url.list) { + this.$message.error('璇疯缃畊rl.list灞炴��!') + return + } + if(this.standardId && this.standardId === '-1'){ + this.clearList(); + return; + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1 + } + let params = this.getQueryParams()//鏌ヨ鏉′欢 + if (!params) { + return false + } + this.dataSource = [] + params.standardId = this.standardId + this.loading = true + getAction(this.url.list, params).then((res) => { + if (res.success) { + // console.log(res) + //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + this.dataSource = res.result.records || res.result + if (res.result.total) { + this.ipagination.total = res.result.total + } else { + this.ipagination.total = 0 + } + //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) + }, + clearList() { + this.dataSource = [] + this.selectedRowKeys = [] + this.ipagination.current = 1 + }, + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/base/modules/EamMaintenanceStandardModal.vue b/src/views/eam/base/modules/EamMaintenanceStandardModal.vue new file mode 100644 index 0000000..a25d747 --- /dev/null +++ b/src/views/eam/base/modules/EamMaintenanceStandardModal.vue @@ -0,0 +1,331 @@ +<template> + <j-modal + :title="title" + :width="1200" + :visible="visible" + :confirmLoading="confirmLoading" + switchFullscreen + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :model="model" :rules="validatorRules"> + <a-row :gutter="24"> + <a-col :span="8"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="鏍囧噯缂栫爜"> + <a-input placeholder="缂栫爜绯荤粺鑷姩鐢熸垚" v-model="model.standardCode" disabled /> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardName" label="鏍囧噯鍚嶇О"> + <a-input placeholder="璇疯緭鍏ユ爣鍑嗗悕绉�" v-model="model.standardName" /> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenanceCategory" label="淇濆吇鍒嗙被"> + <j-dict-select-tag dict-code="maintenance_category" placeholder="璇烽�夋嫨淇濆吇鍒嗙被" v-model="model.maintenanceCategory" :disabled="editable" /> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="8"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fileCode" label="鏂囦欢缂栧彿"> + <a-input placeholder="璇疯緭鍏ヤ繚鍏绘爣鍑嗘枃浠剁紪鍙�" v-model="model.fileCode"/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="initialDate" label="鍒濆鏃ユ湡"> + <a-date-picker placeholder="璇烽�夋嫨鍒濆鏃ユ湡" v-model="model.initialDate" format="YYYY-MM-DD" style="width: 100%" :disabled="editable"/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancePeriod" label="淇濆吇鍛ㄦ湡"> + <a-input-number v-model="model.maintenancePeriod" :min="1" :precision="0" style="width: 100%"/> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="8"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="璁惧缂栧彿"> + <lx-search-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" v-model="model.equipmentId" :disabled="editable"></lx-search-equipment-select> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardStatus" label="鏍囧噯鐘舵��"> + <j-dict-select-tag dict-code="maintenance_standard_status" v-model="model.standardStatus" disabled/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardVersion" label="鏍囧噯鐗堟湰"> + <a-input-number v-model="model.standardVersion" style="width: 100%" disabled/> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="8"> + <a-form-model-item + label="鍙傝�冩枃浠�" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="fileList"> + <lx-upload :returnUrl="false" + :multiple="false" + v-model="model.fileList" + biz="EamMaintenanceStandard"> + </lx-upload> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <j-vxe-table + ref="editableDetailTable" + :rowNumber="true" + :rowSelection="true" + :bordered="true" + :alwaysEdit="true" + :toolbar="true" + :toolbarConfig="detail.toolbarConfig" + keep-source + :height="300" + :loading="detail.loading" + :dataSource="detail.dataSource" + :columns="detail.columns" + style="margin-top: 8px;"/> + </a-row> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> +import { getAction, httpAction } from '@/api/manage' + import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' + import { JVXETypes } from '@/components/jeecg/JVxeTable' + import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect' + + export default { + name: "EamMaintenanceStandardModal", + mixins: [JVxeTableModelMixin], + components: { + LxSearchEquipmentSelect, + }, + data () { + return { + title:"鎿嶄綔", + visible: false, + model: {}, + editable: false, + upgradeFlag: false, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + standardName: [ + { required: true, message: '璇疯緭鍏ユ爣鍑嗗悕绉�!' } + ], + maintenanceCategory: [ + { required: true, message: '璇烽�夋嫨淇濆吇鍒嗙被!' } + ], + initialDate: [ + { required: true, message: '璇烽�夋嫨鍒濆鏃ユ湡!' } + ], + maintenancePeriod: [ + { required: true, message: '璇疯緭鍏ヤ繚鍏诲懆鏈燂紝鍗曚綅锛氬ぉ!' } + ], + equipmentId: [ + { required: true, message: '璇烽�夋嫨璁惧!' } + ] + }, + url: { + add: "/eam/maintenanceStandard/add", + edit: "/eam/maintenanceStandard/edit", + detail: "/eam/eamMaintenanceStandardDetail/queryList", + upgrade: '/eam/maintenanceStandard/upgrade', + }, + detail: { + loading: false, + dataSource: [], + columns: [ + { + title: 'ID', + key: 'id', + type: JVXETypes.hidden, + }, + { + title: 'standardId', + key: 'standardId', + type: JVXETypes.hidden, + }, + { + title: '搴忓彿', + key: 'itemCode', + type: JVXETypes.inputNumber, + align:"center", + width: 100, + validateRules: [ + {required : true, unique: true, message: '搴忓彿涓嶈兘閲嶅'} + ] + }, + { + title: '閮ㄤ綅', + key: 'itemPart', + type: JVXETypes.textarea, + align:"center", + }, + { + title: '淇濆吇椤�', + key: 'itemName', + type: JVXETypes.textarea, + align:"center", + validateRules: [ + {required : true, message: '淇濆吇椤逛笉鑳戒负绌猴紒'} + ] + }, + { + title: '淇濆吇瑕佹眰', + key: 'itemDemandAlias', + type: JVXETypes.textarea, + align:"center", + }, + { + title: '妫�鏌ユ爣鍑嗘垨瑕佹眰', + key: 'itemDemand', + type: JVXETypes.textarea, + align:"center", + validateRules: [ + {required : true, message: "淇濆吇瑕佹眰涓嶈兘涓虹┖锛�"} + ] + }, + { + title: '妫�鏌ユ柟娉�', + key: 'checkMethod', + type: JVXETypes.textarea, + align:"center", + }, + ], + toolbarConfig: { + // prefix 鍓嶇紑锛泂uffix 鍚庣紑 + slot: ['prefix', 'suffix'], + // add 鏂板鎸夐挳锛況emove 鍒犻櫎鎸夐挳锛沜learSelection 娓呯┖閫夋嫨鎸夐挳 + btn: ['add', 'remove', 'clearSelection'] + }, + } + } + }, + created () { + }, + methods: { + add () { + this.model = {}; + this.visible = true; + this.editable = false; + this.upgradeFlag = false; + this.detail.dataSource = []; + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + this.editable = true; + this.upgradeFlag = false; + this.detail.dataSource = []; + if(record && record.referenceFile) { + let obj = JSON.parse(record.referenceFile); + this.model.fileList = [obj]; + }else { + this.model.fieldList = []; + } + this.loadDetail(record.id); + }, + upgrade(record) { + this.model = Object.assign({}, record); + this.visible = true; + this.editable = true; + this.upgradeFlag = true; + this.detail.dataSource = []; + if(record && record.referenceFile) { + let obj = JSON.parse(record.referenceFile); + this.model.fileList = [obj]; + }else { + this.model.fieldList = []; + } + this.loadDetail(record.id); + }, + close () { + this.$emit('close'); + this.visible = false; + this.$refs.form.clearValidate(); + }, + async handleOk () { + const that = this; + let errMap = await that.$refs.editableDetailTable.validateTable(); + if(errMap){ + this.$message.warning("鏁版嵁鏍¢獙澶辫触锛�"); + return; + } + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + let tableData = that.$refs.editableDetailTable.getTableData(); + let removeData = that.$refs.editableDetailTable.getDeleteData(); + that.model.tableDetailList = [...tableData]; + that.model.removeDetailList = [...removeData]; + + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + if(this.upgradeFlag) { + httpurl+=this.url.upgrade; + }else { + httpurl+=this.url.edit; + } + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + that.close(); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + }else{ + return false; + } + }) + }, + handleCancel () { + this.close() + }, + //鍔犺浇璇︽儏鏁版嵁 + loadDetail(standardId) { + this.detail.dataSource = []; + if (standardId) { + getAction(this.url.detail, { standardId: standardId }).then(res => { + if (res.success) { + this.detail.dataSource = [...res.result]; + } + }) + } + } + + } + } +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/base/modules/EamPrecisionParametersModal.vue b/src/views/eam/base/modules/EamPrecisionParametersModal.vue new file mode 100644 index 0000000..cb2c571 --- /dev/null +++ b/src/views/eam/base/modules/EamPrecisionParametersModal.vue @@ -0,0 +1,120 @@ +<template> + <j-modal + :title="title" + :width="800" + :visible="visible" + :confirmLoading="confirmLoading" + switchFullscreen + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :model="model" :rules="validatorRules"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="parameterCode" label="鍙傛暟缂栫爜"> + <a-input placeholder="缂栫爜鑷姩鐢熸垚" v-model="model.parameterCode" disabled /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="parameterName" label="妫�娴嬮」鐩�"> + <a-input placeholder="璇疯緭鍏ユ娴嬮」鐩�" v-model="model.parameterName" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="parameterCategory" label="鍙傛暟鍒嗙被"> + <j-dict-select-tag dict-code="precision_parameters_category" placeholder="璇烽�夋嫨鍙傛暟鍒嗙被" + v-model="model.parameterCategory"></j-dict-select-tag> + </a-form-model-item> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> +import { httpAction } from '@/api/manage' + +export default { + name: 'EamPrecisionParametersModal', + data() { + return { + title: '鎿嶄綔', + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + }, + + confirmLoading: false, + validatorRules: { + parameterName:[ + { required: true, message: '璇疯緭鍏ュ弬鏁板悕绉�!' } + ], + parameterCategory: [ + { required: true, message: '璇烽�夋嫨鍙傛暟鍒嗙被!' } + ], + }, + url: { + add: '/eam/precisionParameters/add', + edit: '/eam/precisionParameters/edit' + } + } + }, + created() { + }, + methods: { + add() { + //鍒濆鍖栭粯璁ゅ�� + this.edit({}) + }, + edit(record) { + this.model = Object.assign({}, record) + this.visible = true + }, + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() + }, + handleOk() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true + let httpurl = '' + let method = '' + if (!this.model.id) { + httpurl += this.url.add + method = 'post' + } else { + httpurl += this.url.edit + method = 'put' + } + httpAction(httpurl, this.model, method).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.$emit('ok') + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = false + that.close() + }) + } else { + return false + } + }) + }, + handleCancel() { + this.close() + } + + } +} +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/base/modules/EamProcessParametersModal.vue b/src/views/eam/base/modules/EamProcessParametersModal.vue new file mode 100644 index 0000000..2b05740 --- /dev/null +++ b/src/views/eam/base/modules/EamProcessParametersModal.vue @@ -0,0 +1,128 @@ +<template> + <j-modal + :title="title" + :width="800" + :visible="visible" + :confirmLoading="confirmLoading" + switchFullscreen + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :model="model" :rules="validatorRules"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="parameterCode" label="鍙傛暟缂栫爜"> + <a-input placeholder="缂栫爜鑷姩鐢熸垚" v-model="model.parameterCode" :disabled="true"/> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="parameterName" label="鍙傛暟鍚嶇О"> + <a-input placeholder="璇疯緭鍏ュ弬鏁板悕绉�" v-model="model.parameterName" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="parameterCategory" label="鍙傛暟鍒嗙被"> + <j-dict-select-tag dict-code="process_parameters_categorys" placeholder="璇烽�夋嫨鍙傛暟鍒嗙被" v-model="model.parameterCategory" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="parameterUnit" label="璁¢噺鍗曚綅"> + <a-input placeholder="璇疯緭鍏ヨ閲忓崟浣�" v-model="model.parameterUnit" /> + </a-form-model-item> + + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> + import { httpAction } from '@/api/manage' + import moment from "moment" + + export default { + name: "EamProcessParametersModal", + data () { + return { + title:"鎿嶄綔", + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + + confirmLoading: false, + validatorRules:{ + parameterName:[ + { required: true, message: '璇疯緭鍏ュ弬鏁板悕绉�!' } + ], + parameterCategory: [ + { required: true, message: '璇烽�夋嫨鍙傛暟鍒嗙被!' } + ], + parameterUnit:[ + { required: true, message: '璇疯緭鍏ヨ閲忓崟浣�!' } + ] + }, + url: { + add: "/eam/processParameters/add", + edit: "/eam/processParameters/edit", + }, + } + }, + created () { + }, + methods: { + add () { + //鍒濆鍖栭粯璁ゅ�� + this.edit({}); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + close () { + this.$emit('close'); + this.visible = false; + this.$refs.form.clearValidate(); + }, + handleOk () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }) + }else{ + return false; + } + }) + }, + handleCancel () { + this.close() + }, + + + } + } +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/base/modules/EamSysFilesModal.vue b/src/views/eam/base/modules/EamSysFilesModal.vue new file mode 100644 index 0000000..55c321f --- /dev/null +++ b/src/views/eam/base/modules/EamSysFilesModal.vue @@ -0,0 +1,129 @@ +<template> + <j-modal + :title="title" + :width="800" + :visible="visible" + :confirmLoading="confirmLoading" + switchFullscreen + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :model="model" :rules="validatorRules"> + <a-form-model-item + label="涓婁紶" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + v-if="!editable" + prop="fileList"> + <lx-upload :returnUrl="false" + :isMultiple="false" + v-model="model.fileList" + biz="test"> + </lx-upload> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fileName" label="鏂囦欢鍚嶇О" v-if="editable"> + <a-input placeholder="璇疯緭鍏ユ枃浠跺悕绉�" v-model="model.fileName" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description" label="鎻忚堪"> + <a-textarea placeholder="璇疯緭鍏ユ弿杩�" v-model="model.description" /> + </a-form-model-item> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> +import { httpAction } from '@/api/manage' + +export default { + name: 'EamSysFilesModal', + data() { + return { + title: '鎿嶄綔', + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + }, + + confirmLoading: false, + validatorRules: { + fileName: [ + { required: true, message: '璇疯緭鍏ユ枃浠跺悕绉�!' } + ] + }, + url: { + add: '/eam/sysFiles/add', + edit: '/eam/sysFiles/edit', + }, + editable: false, + } + }, + created() { + }, + methods: { + add() { + this.editable = false; + //鍒濆鍖栭粯璁ゅ�� + this.model = {}; + this.visible = true + }, + edit(record) { + this.editable = true; + this.model = Object.assign({}, record) + this.visible = true + }, + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() + }, + handleOk() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true + let httpurl = '' + let method = '' + if (!this.model.id) { + httpurl += this.url.add + method = 'post' + } else { + httpurl += this.url.edit + method = 'put' + } + httpAction(httpurl, this.model, method).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.$emit('ok') + that.close() + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = false + }) + } else { + return false + } + }) + }, + handleCancel() { + this.close() + }, + + } +} +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/dispose/EamEquipmentLeanOutList.vue b/src/views/eam/dispose/EamEquipmentLeanOutList.vue new file mode 100644 index 0000000..d26da1c --- /dev/null +++ b/src/views/eam/dispose/EamEquipmentLeanOutList.vue @@ -0,0 +1,362 @@ +<template> + <a-card :bordered="false"> + + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="24"> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="璁惧缂栧彿1"> + <lx-search-equipment-select + placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" + v-model="queryParam.equipmentId" + ></lx-search-equipment-select> + </a-form-item> + </a-col> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="鍗曟嵁鍙�"> + <a-input + placeholder="璇疯緭鍏ュ崟鎹彿" + v-model="queryParam.code" + ></a-input> + </a-form-item> + </a-col> + <a-col + :xl="6" + :lg="7" + :md="8" + :sm="24" + > + <span + style="float: left;overflow: hidden;" + class="table-page-search-submitButtons" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + type="info" + @click="searchReset" + icon="reload" + style="margin-left: 8px" + >閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button + @click="handleAdd" + type="primary" + icon="plus" + >鏂板</a-button> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item + key="1" + @click="batchDel" + > + <a-icon type="delete" /> + 鍒犻櫎 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down" /> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div + class="ant-alert ant-alert-info" + style="margin-bottom: 16px;" + > + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a + style="margin-left: 24px" + @click="onClearSelected" + >娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :scroll="{ x: 'max-content' }" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange" + > + + <span + slot="action" + slot-scope="text, record" + > + <template v-if="record.leanStatus === 'WAIT_SUBMIT'"> + <a @click="handleEdit(record)">缂栬緫</a> + <a-divider type="vertical" /> + <a-popconfirm + title="纭畾鎻愪氦鍚�?" + @confirm="() => handleSubmit(record.id)" + > + <a>鎻愪氦</a> + </a-popconfirm> + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a + href="javascript:;" + @click="handleDetail(record)" + >璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm + title="纭畾鍒犻櫎鍚�?" + @confirm="() => handleDelete(record.id)" + > + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </template> + <template v-if="record.leanStatus === 'WAIT_RETURN'"> + <a-popconfirm title='纭畾褰掕繕鍚�?' @confirm='() => equipmentReturn(record.id)'> + <a>褰掕繕</a> + </a-popconfirm> + <a-divider type='vertical' /> + <a @click='handleDetail(record)'>璇︽儏</a> + </template> + <template v-if="record.leanStatus !== 'WAIT_RETURN' && record.leanStatus !== 'WAIT_SUBMIT'"> + <a + href="javascript:;" + @click="handleDetail(record)" + >璇︽儏</a> + </template> + </span> + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <eamEquipmentLeanOut-modal + ref="modalForm" + @ok="modalFormOk" + ></eamEquipmentLeanOut-modal> + </a-card> +</template> + +<script> +import '@/assets/less/TableExpand.less' +import EamEquipmentLeanOutModal from './modules/EamEquipmentLeanOutModal' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' +import { getAction } from '@api/manage' + +export default { + name: 'EamEquipmentLeanOutList', + mixins: [JeecgListMixin], + components: { + LxSearchEquipmentSelect, + EamEquipmentLeanOutModal + }, + data() { + return { + description: '璁惧鍊熷嚭褰掕繕绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + fixed: 'left', + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentCode', + fixed: 'left', + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName', + fixed: 'left', + }, + { + title: '鍗曟嵁鍙�', + align: 'center', + dataIndex: 'code' + }, + { + title: '鍊熷叆杞﹂棿', + align: 'center', + dataIndex: 'leanDepartId_dictText' + }, + { + title: '鍊熷叆浜�', + align: 'center', + dataIndex: 'leanPerson_dictText' + }, + { + title: '鍊熺敤鍘熷洜', + align: 'center', + dataIndex: 'leanReason' + }, + { + title: '鍊熺敤鐘舵��', + align: 'center', + dataIndex: 'leanStatus_dictText' + }, + { + title: '鍊熺敤寮�濮嬫椂闂�', + align: 'center', + dataIndex: 'leanStartTime' + }, + { + title: '鍊熺敤褰掕繕鏃堕棿', + align: 'center', + dataIndex: 'leanEndTime' + }, + { + title: '瀹℃牳浜�', + align: 'center', + dataIndex: 'approvalUser_dictText' + }, + { + title: '瀹℃牳鎰忚', + align: 'center', + dataIndex: 'approvalComment' + }, + { + title: '瀹℃牳鏃堕棿', + align: 'center', + dataIndex: 'approvalTime' + }, + { + title: '褰掕繕纭浜�', + align: 'center', + dataIndex: 'confirmUser_dictText' + }, + { + title: '纭鎰忚', + align: 'center', + dataIndex: 'confirmComment' + }, + { + title: '纭鏃堕棿', + align: 'center', + dataIndex: 'confirmTime' + }, + { + title: '澶囨敞', + align: 'center', + dataIndex: 'remark' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + fixed: 'right', + width: 200, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: '/eam/eamEquipmentLeanOut/list', + delete: '/eam/eamEquipmentLeanOut/delete', + deleteBatch: '/eam/eamEquipmentLeanOut/deleteBatch', + submit: '/eam/eamEquipmentLeanOut/submit', + equipmentReturn: '/eam/eamEquipmentLeanOut/equipmentReturn', + } + } + }, + computed: {}, + methods: { + equipmentReturn(id) { + if (!this.url.equipmentReturn) { + this.$message.error('璇疯缃畊rl.submit灞炴��!') + return + } + let that = this + getAction(that.url.equipmentReturn, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + }, + handleSubmit(id) { + if (!this.url.submit) { + this.$message.error('璇疯缃畊rl.submit灞炴��!') + return + } + let that = this + getAction(that.url.submit, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + } + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/dispose/EamEquipmentScrapList.vue b/src/views/eam/dispose/EamEquipmentScrapList.vue new file mode 100644 index 0000000..d9986e6 --- /dev/null +++ b/src/views/eam/dispose/EamEquipmentScrapList.vue @@ -0,0 +1,272 @@ +<template> + <a-card :bordered='false'> + + <!-- 鏌ヨ鍖哄煙 --> + <div class='table-page-search-wrapper'> + <a-form layout='inline' @keyup.enter.native='searchQuery'> + <a-row :gutter='24'> + + <a-col :lg='7' :md='8' :sm='24' :xl='6'> + <a-form-item label='璁惧缂栧彿'> + <lx-search-equipment-select v-model='queryParam.equipmentId' + placeholder='璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储'></lx-search-equipment-select> + </a-form-item> + </a-col> + <a-col :lg='7' :md='8' :sm='24' :xl='6'> + <a-form-item label='鍗曟嵁鍙�'> + <a-input v-model='queryParam.code' placeholder='璇疯緭鍏ュ崟鎹彿'></a-input> + </a-form-item> + </a-col> + <template v-if='toggleSearchStatus'> + <a-col :lg='7' :md='8' :sm='24' :xl='6'> + <a-form-item label='璁惧ID'> + <a-input v-model='queryParam.equipmentId' placeholder='璇疯緭鍏ヨ澶嘔D'></a-input> + </a-form-item> + </a-col> + <a-col :lg='7' :md='8' :sm='24' :xl='6'> + <a-form-item label='杞/鎶ュ簾'> + <a-input v-model='queryParam.scrapType' placeholder='璇疯緭鍏ヨ浆璁�/鎶ュ簾'></a-input> + </a-form-item> + </a-col> + <a-col :lg='7' :md='8' :sm='24' :xl='6'> + <a-form-item label='鐢宠浜�'> + <a-input v-model='queryParam.reportUser' placeholder='璇疯緭鍏ョ敵璇蜂汉'></a-input> + </a-form-item> + </a-col> + </template> + <a-col :lg='7' :md='8' :sm='24' :xl='6'> + <span class='table-page-search-submitButtons' style='float: left;overflow: hidden;'> + <a-button icon='search' type='primary' @click='searchQuery'>鏌ヨ</a-button> + <a-button icon='reload' style='margin-left: 8px' type='primary' @click='searchReset'>閲嶇疆</a-button> + <!-- <a @click="handleToggleSearch" style="margin-left: 8px">--> + <!-- {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }}--> + <!-- <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>--> + <!-- </a>--> + </span> + </a-col> + + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class='table-operator'> + <a-button icon='plus' type='primary' @click='handleAdd'>鏂板</a-button> + <a-dropdown v-if='selectedRowKeys.length > 0'> + <a-menu slot='overlay'> + <a-menu-item key='1' @click='batchDel'> + <a-icon type='delete' /> + 鍒犻櫎 + </a-menu-item> + </a-menu> + <a-button style='margin-left: 8px'> 鎵归噺鎿嶄綔 + <a-icon type='down' /> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class='ant-alert ant-alert-info' style='margin-bottom: 16px;'> + <i class='anticon anticon-info-circle ant-alert-icon'></i> 宸查�夋嫨 <a + style='font-weight: 600'>{{ selectedRowKeys.length }}</a>椤� + <a style='margin-left: 24px' @click='onClearSelected'>娓呯┖</a> + </div> + + <a-table + ref='table' + :columns='columns' + :dataSource='dataSource' + :loading='loading' + :pagination='ipagination' + :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}' + bordered + class='j-table-force-nowrap' + rowKey='id' + size='middle' + @change='handleTableChange'> + + <span slot='action' slot-scope='text, record'> + <template v-if="record.scrapStatus === 'WAIT_SUBMIT'"> + <a-popconfirm title='纭畾鎻愪氦鍚�?' @confirm='() => handleSubmit(record.id)'> + <a>鎻愪氦</a> + </a-popconfirm> + <a-divider type='vertical' /> + + <a-dropdown> + <a class='ant-dropdown-link'>鏇村 <a-icon type='down' /></a> + <a-menu slot='overlay'> + <a-menu-item> + <a @click='handleEdit(record)'>缂栬緫</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title='纭畾鍒犻櫎鍚�?' @confirm='() => handleDelete(record.id)'> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </template> + <template v-else> + <a href='javascript:;' @click='handleDetail(record)'>璇︽儏</a> + </template> + </span> + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <eamEquipmentScrap-modal ref='modalForm' @ok='modalFormOk'></eamEquipmentScrap-modal> + </a-card> +</template> + +<script> +import '@/assets/less/TableExpand.less' +import EamEquipmentScrapModal from './modules/EamEquipmentScrapModal' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' +import { getAction } from '@api/manage' + + +export default { + name: 'EamEquipmentScrapList', + mixins: [JeecgListMixin], + components: { + EamEquipmentScrapModal, + LxSearchEquipmentSelect + }, + data() { + return { + description: '璁惧鎶ュ簾(杞)绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鍗曟嵁鍙�', + align: 'center', + dataIndex: 'code' + }, + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentCode' + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName' + }, + { + title: '杞/鎶ュ簾', + align: 'center', + dataIndex: 'scrapType_dictText' + }, + { + title: '鐢宠浜�', + align: 'center', + dataIndex: 'reportUser_dictText' + }, + { + title: '澶勭疆鏃堕棿', + align: 'center', + dataIndex: 'scrapTime' + }, + { + title: '澶勭疆鐞嗙敱', + align: 'center', + dataIndex: 'scrapReason' + }, + { + title: '澶勭疆閲戦', + align: 'center', + dataIndex: 'scrapAmount' + }, + { + title: '澶勭疆鐘舵��', + align: 'center', + dataIndex: 'scrapStatus_dictText' + }, + { + title: '瀹℃牳浜�', + align: 'center', + dataIndex: 'approvalUser_dictText' + }, + { + title: '瀹℃牳鎰忚', + align: 'center', + dataIndex: 'approvalComment' + }, + { + title: '瀹℃牳鏃堕棿', + align: 'center', + dataIndex: 'approvalTime' + }, + { + title: '澶囨敞', + align: 'center', + dataIndex: 'remark' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + fixed: 'right', + width: 150, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: '/eam/eamEquipmentScrap/list', + delete: '/eam/eamEquipmentScrap/delete', + deleteBatch: '/eam/eamEquipmentScrap/deleteBatch', + submit: '/eam/eamEquipmentScrap/submit' + } + } + }, + computed: { + importExcelUrl: function() { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` + } + }, + methods: { + handleSubmit(id) { + if (!this.url.submit) { + this.$message.error('璇疯缃畊rl.submit灞炴��!') + return + } + let that = this + getAction(that.url.submit, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + } + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/dispose/EamEquipmentSealUpList.vue b/src/views/eam/dispose/EamEquipmentSealUpList.vue new file mode 100644 index 0000000..c26873b --- /dev/null +++ b/src/views/eam/dispose/EamEquipmentSealUpList.vue @@ -0,0 +1,264 @@ +<template> + <a-card :bordered='false'> + + <!-- 鏌ヨ鍖哄煙 --> + <div class='table-page-search-wrapper'> + <a-form layout='inline' @keyup.enter.native='searchQuery'> + <a-row :gutter='24'> + <a-col :lg='7' :md='8' :sm='24' :xl='4'> + <a-form-item label='璁惧缂栧彿'> + <lx-search-equipment-select v-model='queryParam.equipmentId' + placeholder='璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储'></lx-search-equipment-select> + </a-form-item> + </a-col> + <a-col :lg='7' :md='8' :sm='24' :xl='4'> + <a-form-item label='鍗曟嵁鍙�'> + <a-input v-model='queryParam.code' placeholder='璇疯緭鍏ュ崟鎹彿'></a-input> + </a-form-item> + </a-col> + <a-col :lg='7' :md='8' :sm='24' :xl='6'> + <span class='table-page-search-submitButtons' style='float: left;overflow: hidden;'> + <a-button icon='search' type='primary' @click='searchQuery'>鏌ヨ</a-button> + <a-button icon='reload' style='margin-left: 8px' type='info' @click='searchReset'>閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class='table-operator'> + <a-button icon='plus' type='primary' @click='handleAdd'>鏂板</a-button> + <!-- <a-button type="primary" icon="download" @click="handleExportXls('璁惧灏佸瓨鍚皝')">瀵煎嚭</a-button>--> + <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">--> + <!-- <a-button type="primary" icon="import">瀵煎叆</a-button>--> + <!-- </a-upload>--> + <a-dropdown v-if='selectedRowKeys.length > 0'> + <a-menu slot='overlay'> + <a-menu-item key='1' @click='batchDel'> + <a-icon type='delete' /> + 鍒犻櫎 + </a-menu-item> + </a-menu> + <a-button style='margin-left: 8px'> 鎵归噺鎿嶄綔 + <a-icon type='down' /> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class='ant-alert ant-alert-info' style='margin-bottom: 16px;'> + <i class='anticon anticon-info-circle ant-alert-icon'></i> 宸查�夋嫨 <a + style='font-weight: 600'>{{ selectedRowKeys.length }}</a>椤� + <a style='margin-left: 24px' @click='onClearSelected'>娓呯┖</a> + </div> + + <a-table + ref='table' + :columns='columns' + :dataSource='dataSource' + :loading='loading' + :pagination='ipagination' + :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}' + bordered + class='j-table-force-nowrap' + rowKey='id' + size='middle' + @change='handleTableChange'> + + <span slot='action' slot-scope='text, record'> + <template v-if="record.sealStatus === 'WAIT_SUBMIT'"> + <a-popconfirm title='纭畾鎻愪氦鍚�?' @confirm='() => handleSubmit(record.id)'> + <a>鎻愪氦</a> + </a-popconfirm> + <a-divider type='vertical' /> + <a @click='handleEdit(record)'>缂栬緫</a> + <a-divider type='vertical' /> + <a-popconfirm title='纭畾鍒犻櫎鍚�?' @confirm='() => handleDelete(record.id)'> + <a>鍒犻櫎</a> + </a-popconfirm> + </template> + <template v-if="record.sealStatus === 'SEALED'"> + <a-popconfirm title='纭畾鍚皝鍚�?' @confirm='() => handleUnseal(record.id)'> + <a>鍚皝</a> + </a-popconfirm> + <a-divider type='vertical' /> + <a @click='handleDetail(record)'>璇︽儏</a> + </template> + <template v-if="record.sealStatus === 'COMPLETE'|| record.sealStatus === 'WAIT_UNSEALING_AUDIT' "> + <a @click='handleDetail(record)'>璇︽儏</a> + </template> + </span> + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <eamEquipmentSealUp-modal ref='modalForm' @ok='modalFormOk'></eamEquipmentSealUp-modal> + </a-card> +</template> + +<script> +import '@/assets/less/TableExpand.less' +import EamEquipmentSealUpModal from './modules/EamEquipmentSealUpModal' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' +import { getAction } from '@api/manage' + +export default { + name: 'EamEquipmentSealUpList', + mixins: [JeecgListMixin], + components: { + EamEquipmentSealUpModal, + LxSearchEquipmentSelect + }, + data() { + return { + description: '璁惧灏佸瓨鍚皝绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentCode' + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName' + }, + { + title: '鍗曟嵁鍙�', + align: 'center', + dataIndex: 'code' + }, + { + title: '鐢宠浜�', + align: 'center', + dataIndex: 'reportUser_dictText' + }, + { + title: '灏佸瓨寮�濮嬫椂闂�', + align: 'center', + dataIndex: 'sealStartTime' + }, + { + title: '灏佸瓨缁撴潫鏃堕棿', + align: 'center', + dataIndex: 'sealEndTime' + }, + { + title: '灏佸瓨鍘熷洜', + align: 'center', + dataIndex: 'sealUpReason' + }, + { + title: '灏佸瓨鐘舵��', + align: 'center', + dataIndex: 'sealStatus_dictText' + }, + { + title: '瀹℃牳浜�', + align: 'center', + dataIndex: 'approvalUser' + }, + { + title: '瀹℃牳鏃堕棿', + align: 'center', + dataIndex: 'approvalTime' + }, + { + title: '澶囨敞', + align: 'center', + dataIndex: 'remark' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: '/eam/eamEquipmentSealUp/list', + delete: '/eam/eamEquipmentSealUp/delete', + deleteBatch: '/eam/eamEquipmentSealUp/deleteBatch', + submit: '/eam/eamEquipmentSealUp/submit', + unseal: '/eam/eamEquipmentSealUp/unseal' + } + } + }, + computed: { + importExcelUrl: function() { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` + } + }, + methods: { + handleSubmit(id) { + if (!this.url.submit) { + this.$message.error('璇疯缃畊rl.submit灞炴��!') + return + } + let that = this + getAction(that.url.submit, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + }, + handleUnseal(id) { + if (!this.url.unseal) { + this.$message.error('璇疯缃畊rl.submit灞炴��!') + return + } + let that = this + getAction(that.url.unseal, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + } + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/dispose/EamEquipmentTransferList.vue b/src/views/eam/dispose/EamEquipmentTransferList.vue new file mode 100644 index 0000000..dc1a648 --- /dev/null +++ b/src/views/eam/dispose/EamEquipmentTransferList.vue @@ -0,0 +1,279 @@ +<template> + <a-card :bordered='false'> + + <!-- 鏌ヨ鍖哄煙 --> + <div class='table-page-search-wrapper'> + <a-form layout='inline' @keyup.enter.native='searchQuery'> + <a-row :gutter='24'> + + <a-col :lg='7' :md='8' :sm='24' :xl='6'> + <a-form-item label='璁惧缂栧彿'> + <lx-search-equipment-select v-model='queryParam.equipmentId' + placeholder='璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储'></lx-search-equipment-select> + </a-form-item> + + </a-col> + <a-col :lg='7' :md='8' :sm='24' :xl='6'> + <a-form-item label='鍗曟嵁鍙�'> + <a-input v-model='queryParam.code' placeholder='璇疯緭鍏ュ崟鎹彿'></a-input> + </a-form-item> + </a-col> + <template v-if='toggleSearchStatus'> + <a-col :lg='7' :md='8' :sm='24' :xl='6'> + <a-form-item label='璋冨嚭閮ㄩ棬'> + <a-input v-model='queryParam.oldDepartId' placeholder='璇疯緭鍏ヨ皟鍑洪儴闂�'></a-input> + </a-form-item> + </a-col> + <a-col :lg='7' :md='8' :sm='24' :xl='6'> + <a-form-item label='璋冨叆閮ㄩ棬'> + <a-input v-model='queryParam.newDepartId' placeholder='璇疯緭鍏ヨ皟鍏ラ儴闂�'></a-input> + </a-form-item> + </a-col> + </template> + <a-col :lg='7' :md='8' :sm='24' :xl='6'> + <span class='table-page-search-submitButtons' style='float: left;overflow: hidden;'> + <a-button icon='search' type='primary' @click='searchQuery'>鏌ヨ</a-button> + <a-button icon='reload' style='margin-left: 8px' type='primary' @click='searchReset'>閲嶇疆</a-button> +<!-- <a style='margin-left: 8px' @click='handleToggleSearch'>--> +<!-- {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }}--> +<!-- <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />--> +<!-- </a>--> + </span> + </a-col> + + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class='table-operator'> + <a-button icon='plus' type='primary' @click='handleAdd'>鏂板</a-button> + <a-dropdown v-if='selectedRowKeys.length > 0'> + <a-menu slot='overlay'> + <a-menu-item key='1' @click='batchDel'> + <a-icon type='delete' /> + 鍒犻櫎 + </a-menu-item> + </a-menu> + <a-button style='margin-left: 8px'> 鎵归噺鎿嶄綔 + <a-icon type='down' /> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class='ant-alert ant-alert-info' style='margin-bottom: 16px;'> + <i class='anticon anticon-info-circle ant-alert-icon'></i> 宸查�夋嫨 <a + style='font-weight: 600'>{{ selectedRowKeys.length }}</a>椤� + <a style='margin-left: 24px' @click='onClearSelected'>娓呯┖</a> + </div> + + <a-table + ref='table' + :columns='columns' + :dataSource='dataSource' + :loading='loading' + :pagination='ipagination' + :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}' + :scroll="{ x: 'max-content' }" + bordered + class='j-table-force-nowrap' + rowKey='id' + size='middle' + @change='handleTableChange'> + + <span slot='action' slot-scope='text, record'> + <template v-if="record.transferStatus === 'WAIT_SUBMIT'"> + <a-popconfirm title='纭畾鎻愪氦鍚�?' @confirm='() => handleSubmit(record.id)'> + <a>鎻愪氦</a> + </a-popconfirm> + <a-divider type='vertical' /> + + <a-dropdown> + <a class='ant-dropdown-link'>鏇村 <a-icon type='down' /></a> + <a-menu slot='overlay'> + <a-menu-item> + <a @click='handleEdit(record)'>缂栬緫</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title='纭畾鍒犻櫎鍚�?' @confirm='() => handleDelete(record.id)'> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </template> + <template v-else> + <a href='javascript:;' @click='handleDetail(record)'>璇︽儏</a> + </template> + </span> + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <eamEquipmentTransfer-modal ref='modalForm' @ok='modalFormOk'></eamEquipmentTransfer-modal> + </a-card> +</template> + +<script> +import '@/assets/less/TableExpand.less' +import EamEquipmentTransferModal from './modules/EamEquipmentTransferModal' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import { getAction } from '@api/manage' +import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' + + +export default { + name: 'EamEquipmentTransferList', + mixins: [JeecgListMixin], + components: { + EamEquipmentTransferModal, + LxSearchEquipmentSelect + }, + data() { + return { + description: '璁惧褰掑睘鍙樺姩绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + fixed: 'left', + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鍗曟嵁鍙�', + align: 'center', + fixed: 'left', + width: 100, + dataIndex: 'code' + }, + { + title: '璁惧缂栧彿', + align: 'center', + fixed: 'left', + width: 100, + dataIndex: 'equipmentCode' + }, + { + title: '璁惧鍚嶇О', + align: 'center', + fixed: 'left', + width: 100, + dataIndex: 'equipmentName' + }, + { + title: '璋冨嚭閮ㄩ棬', + align: 'center', + dataIndex: 'oldDepartId_dictText' + }, + { + title: '璋冨叆閮ㄩ棬', + align: 'center', + dataIndex: 'newDepartId_dictText' + }, + { + title: '鐢宠浜�', + align: 'center', + dataIndex: 'reportUser_dictText' + }, + { + title: '鍙樺姩鍘熷洜', + align: 'center', + dataIndex: 'transferReason' + }, + { + title: '鍙樺姩鐘舵��', + align: 'center', + dataIndex: 'transferStatus_dictText' + }, + { + title: '鍙樺姩鏃ユ湡', + align: 'center', + dataIndex: 'transferTime' + }, + { + title: '瀹℃牳浜�', + align: 'center', + dataIndex: 'approvalUser_dictText' + }, + { + title: '瀹℃牳鎰忚', + align: 'center', + dataIndex: 'approvalComment' + }, + { + title: '瀹℃牳鏃堕棿', + align: 'center', + dataIndex: 'approvalTime' + }, + { + title: '澶囨敞', + align: 'center', + dataIndex: 'remark' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + fixed: 'right', + width: 150, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: '/eam/eamEquipmentTransfer/list', + delete: '/eam/eamEquipmentTransfer/delete', + deleteBatch: '/eam/eamEquipmentTransfer/deleteBatch', + submit: '/eam/eamEquipmentTransfer/submit' + } + } + }, + computed: { + importExcelUrl: function() { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` + } + }, + methods: { + handleSubmit(id) { + if (!this.url.submit) { + this.$message.error('璇疯缃畊rl.submit灞炴��!') + return + } + let that = this + this.loading = true + getAction(that.url.submit, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(()=>{ + this.loading = false + }) + } + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/dispose/modules/EamEquipmentLeanOutModal.vue b/src/views/eam/dispose/modules/EamEquipmentLeanOutModal.vue new file mode 100644 index 0000000..091cbae --- /dev/null +++ b/src/views/eam/dispose/modules/EamEquipmentLeanOutModal.vue @@ -0,0 +1,162 @@ +<template> + <j-modal + :title="title" + :width="800" + :visible="visible" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + :confirmLoading="confirmLoading" + switchFullscreen + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :model="model" :rules="validatorRules"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code" label="鍗曟嵁鍙�"> + <a-input placeholder="缂栫爜绯荤粺鑷姩鐢熸垚" v-model="model.code" disabled /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="璁惧缂栧彿"> + <lx-search-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" :disabled="disableSubmit" + v-model="model.equipmentId"></lx-search-equipment-select> + </a-form-model-item> + + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanDepartId" label="鍊熷叆杞﹂棿"> + <a-tree-select v-model="model.leanDepartId" + :disabled="disableSubmit" + style="width: 100%" + :tree-data="treeData" + :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" + placeholder="璇烽�夋嫨鍊熷叆杞﹂棿" + allow-clear + tree-default-expand-all + > + </a-tree-select> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanReason" label="鍊熺敤鍘熷洜"> + <a-textarea placeholder="璇疯緭鍏ュ�熺敤鍘熷洜" :disabled="disableSubmit" v-model="model.leanReason" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark" label="澶囨敞"> + <a-textarea placeholder="璇疯緭鍏ュ娉�" :disabled="disableSubmit" v-model="model.remark" /> + </a-form-model-item> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> +import { getAction, httpAction } from '@/api/manage' + import moment from "moment" + import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' + + export default { + name: "EamEquipmentLeanOutModal", + components: { LxSearchEquipmentSelect }, + data () { + return { + title:"鎿嶄綔", + visible: false, + model: {}, + editable: false, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + treeData: [], + validatorRules:{ + equipmentId: [ + { required: true, message: '璇烽�夋嫨璁惧锛�' } + ], + leanDepartId: [ + { required: true, message: '璇烽�夋嫨杞﹂棿锛�' } + ], + leanReason: [ + { required: true, message: '璇疯緭鍏ュ�熺敤鍘熷洜锛�' } + ], + }, + url: { + add: "/eam/eamEquipmentLeanOut/add", + edit: "/eam/eamEquipmentLeanOut/edit", + loadProductionOptions:'/base/factory/queryTreeList', + }, + } + }, + created () { + this.loadAllProductionTree(); + }, + methods: { + add () { + //鍒濆鍖栭粯璁ゅ�� + //鍒濆鍖栭粯璁ゅ�� + this.model = {} + this.visible = true + this.editable = false + }, + edit (record) { + this.model = Object.assign({}, record) + this.visible = true + this.editable = true + // this.loadDetail(record.id) + }, + + close () { + this.$emit('close'); + this.visible = false; + this.$refs.form.clearValidate(); + }, + handleOk () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + that.close(); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + }else{ + return false; + } + }) + }, + handleCancel () { + this.close() + }, + loadAllProductionTree() { + //鍔犺浇杞﹂棿閫夋嫨鏍� + getAction(this.url.loadProductionOptions).then(res => { + if (res.success) { + this.treeData = [...res.result] + }else { + that.$message.warning(res.message) + } + }) + }, + + } + } +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/dispose/modules/EamEquipmentScrapModal.vue b/src/views/eam/dispose/modules/EamEquipmentScrapModal.vue new file mode 100644 index 0000000..870c891 --- /dev/null +++ b/src/views/eam/dispose/modules/EamEquipmentScrapModal.vue @@ -0,0 +1,200 @@ +<template> + <j-modal + :confirmLoading='confirmLoading' + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + :title='title' + :visible='visible' + :width='800' + cancelText='鍏抽棴' + switchFullscreen + @cancel='handleCancel' + @ok='handleOk' + > + + <a-spin :spinning='confirmLoading'> + <a-form-model + ref='form' + :model='model' + :rules='validatorRules' + > + <a-form-model-item + :labelCol='labelCol' + :wrapperCol='wrapperCol' + label='鍗曟嵁鍙�' + prop='code' + > + <a-input + v-model='model.code' + disabled + placeholder='缂栫爜绯荤粺鑷姩鐢熸垚' + /> + </a-form-model-item> + <a-form-model-item + :labelCol='labelCol' + :wrapperCol='wrapperCol' + label='璁惧' + prop='equipmentId' + > + <lx-search-equipment-select + v-model='model.equipmentId' + :disabled='disableSubmit' + placeholder='璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储' + ></lx-search-equipment-select> + </a-form-model-item> + <a-form-model-item + :labelCol='labelCol' + :wrapperCol='wrapperCol' + label='澶勭悊绫诲瀷' + prop='scrapType' + > + <j-dict-select-tag + v-model='model.scrapType' + :disabled='disableSubmit || initialAcceptanceDisable' + dictCode='scrap_sell' + placeholder='璇烽�夋嫨澶勭悊绫诲瀷' + type='radio' + /> + </a-form-model-item> + <a-form-model-item + :labelCol='labelCol' + :wrapperCol='wrapperCol' + label='澶勭疆鐞嗙敱' + prop='scrapReason' + > + <a-input + v-model='model.scrapReason' + placeholder='璇疯緭鍏ュ缃悊鐢�' + /> + </a-form-model-item> + <div v-if='model.scrapType == 2'> + <a-form-model-item + :labelCol='labelCol' + :wrapperCol='wrapperCol' + label='澶勭疆閲戦' + prop='scrapAmount' + > + <a-input + v-model='model.scrapAmount' + placeholder='璇疯緭鍏ュ缃噾棰�' + /> + </a-form-model-item> + </div> + <a-form-model-item + :labelCol='labelCol' + :wrapperCol='wrapperCol' + label='澶囨敞' + prop='remark' + > + <a-textarea + v-model='model.remark' + :disabled='disableSubmit' + placeholder='璇疯緭鍏ュ娉�' + /> + </a-form-model-item> + + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> +import { httpAction } from '@/api/manage' +import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' + + +export default { + name: 'EamEquipmentScrapModal', + components: { LxSearchEquipmentSelect }, + data() { + return { + title: '鎿嶄綔', + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + }, + + confirmLoading: false, + validatorRules: { + scrapReason: [ + { required: true, message: '璇疯緭鍏ュ缃師鍥狅紒' } + ], + equipmentId: [ + { required: true, message: '璇烽�夋嫨璁惧锛�' } + ], + transferReason: [ + { required: true, message: '璇疯緭鍏ュ彉鍔ㄥ師鍥狅紒' } + ], + scrapType: [ + { required: true, message: '璇烽�夋嫨绫诲瀷锛�' } + ] + }, + url: { + add: '/eam/eamEquipmentScrap/add', + edit: '/eam/eamEquipmentScrap/edit' + } + } + }, + created() { + }, + methods: { + add() { + //鍒濆鍖栭粯璁ゅ�� + this.edit({}) + }, + edit(record) { + this.model = Object.assign({}, record) + this.visible = true + }, + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() + }, + handleOk() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true + let httpurl = '' + let method = '' + if (!this.model.id) { + httpurl += this.url.add + method = 'post' + } else { + httpurl += this.url.edit + method = 'put' + } + httpAction(httpurl, this.model, method).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.$emit('ok') + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = false + that.close() + }) + } else { + return false + } + }) + }, + handleCancel() { + this.close() + } + + + } +} +</script> + +<style lang='less' scoped> +</style> \ No newline at end of file diff --git a/src/views/eam/dispose/modules/EamEquipmentSealUpModal.vue b/src/views/eam/dispose/modules/EamEquipmentSealUpModal.vue new file mode 100644 index 0000000..f836dc9 --- /dev/null +++ b/src/views/eam/dispose/modules/EamEquipmentSealUpModal.vue @@ -0,0 +1,131 @@ +<template> + <j-modal + :title="title" + :width="800" + :visible="visible" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + :confirmLoading="confirmLoading" + switchFullscreen + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :model="model" :rules="validatorRules"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code" label="鍗曟嵁鍙�"> + <a-input placeholder="缂栫爜绯荤粺鑷姩鐢熸垚" v-model="model.code" disabled /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="璁惧缂栧彿"> + <lx-search-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" :disabled="disableSubmit" + v-model="model.equipmentId"></lx-search-equipment-select> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sealUpReason" label="灏佸瓨鍘熷洜"> + <a-input placeholder="璇疯緭鍏ュ皝瀛樺師鍥�" :disabled="disableSubmit" v-model="model.sealUpReason" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark" label="澶囨敞"> + <a-input placeholder="璇疯緭鍏ュ娉�" :disabled="disableSubmit" v-model="model.remark" /> + </a-form-model-item> + + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> + import { httpAction } from '@/api/manage' + import moment from "moment" + import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' + + export default { + name: "EamEquipmentSealUpModal", + components: { + LxSearchEquipmentSelect + }, + data () { + return { + title:"鎿嶄綔", + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + + confirmLoading: false, + validatorRules:{ + equipmentId: [ + { required: true, message: '璇烽�夋嫨璁惧锛�' } + ], + sealUpReason: [ + { required: true, message: '璇疯緭鍏ュ皝瀛樺師鍥狅紒' } + ], + }, + url: { + add: "/eam/eamEquipmentSealUp/add", + edit: "/eam/eamEquipmentSealUp/edit", + }, + } + }, + created () { + }, + methods: { + add () { + //鍒濆鍖栭粯璁ゅ�� + this.edit({}); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + close () { + this.$emit('close'); + this.visible = false; + this.$refs.form.clearValidate(); + }, + handleOk () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }) + }else{ + return false; + } + }) + }, + handleCancel () { + this.close() + }, + + + } + } +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/dispose/modules/EamEquipmentTransferModal.vue b/src/views/eam/dispose/modules/EamEquipmentTransferModal.vue new file mode 100644 index 0000000..0e61575 --- /dev/null +++ b/src/views/eam/dispose/modules/EamEquipmentTransferModal.vue @@ -0,0 +1,167 @@ +<template> + <j-modal + :title="title" + :width="800" + :visible="visible" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + :confirmLoading="confirmLoading" + switchFullscreen + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :model="model" :rules="validatorRules"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code" label="鍗曟嵁鍙�"> + <a-input placeholder="缂栫爜绯荤粺鑷姩鐢熸垚" v-model="model.code" disabled/> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="璋冨嚭璁惧"> + <lx-search-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" + v-model="model.equipmentId" :disabled="disableSubmit"></lx-search-equipment-select> + </a-form-model-item> +<!-- <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="oldDepartId" label="璋冨嚭閮ㄩ棬">--> +<!-- <a-input placeholder="璇疯緭鍏ヨ皟鍑洪儴闂�" v-model="model.oldDepartId" />--> +<!-- </a-form-model-item>--> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="newDepartId" label="璋冨叆杞﹂棿"> + <a-tree-select v-model="model.newDepartId" + style="width: 100%" + :tree-data="treeData" + :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" + placeholder="璇烽�夋嫨璋冨叆杞﹂棿" + allow-clear + tree-default-expand-all + :disabled="editable || disableSubmit" + > + </a-tree-select> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="transferReason" label="鍙樺姩鍘熷洜"> + <a-input placeholder="璇疯緭鍏ュ彉鍔ㄥ師鍥�" v-model="model.transferReason" :disabled="disableSubmit"/> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark" label="澶囨敞"> + <a-textarea placeholder="璇疯緭鍏ュ娉�" v-model="model.remark" :disabled="disableSubmit"/> + </a-form-model-item> + + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> + import { httpAction,getAction } from '@/api/manage' + import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' + + export default { + name: "EamEquipmentTransferModal", + components: { LxSearchEquipmentSelect }, + data () { + return { + title:"鎿嶄綔", + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + labelColLong: { + xs: { span: 24 }, + sm: { span: 4 } + }, + wrapperColLong: { + xs: { span: 24 }, + sm: { span: 18 } + }, + treeData: [], + confirmLoading: false, + validatorRules:{ + newDepartId: [ + { required: true, message: '璇烽�夋嫨璋冨叆杞﹂棿' } + ], + equipmentId: [ + { required: true, message: '璇烽�夋嫨璁惧锛�' } + ], + transferReason: [ + { required: true, message: '璇疯緭鍏ュ彉鍔ㄥ師鍥狅紒' } + ], + }, + url: { + add: "/eam/eamEquipmentTransfer/add", + edit: "/eam/eamEquipmentTransfer/edit", + loadProductionOptions:'/base/factory/queryTreeList', + }, + } + }, + created () { + this.loadAllProductionTree(); + }, + methods: { + loadAllProductionTree() { + //鍔犺浇杞﹂棿閫夋嫨鏍� + getAction(this.url.loadProductionOptions).then(res => { + if (res.success) { + this.treeData = [...res.result] + }else { + that.$message.warning(res.message) + } + }) + }, + add () { + //鍒濆鍖栭粯璁ゅ�� + this.edit({}); + this.visible = true; + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + close () { + this.$emit('close'); + this.visible = false; + this.$refs.form.clearValidate(); + }, + handleOk () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }) + }else{ + return false; + } + }) + }, + handleCancel () { + this.close() + }, + + + } + } +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/equipment/EamEquipmentAttachmentList.vue b/src/views/eam/equipment/EamEquipmentAttachmentList.vue new file mode 100644 index 0000000..074fabb --- /dev/null +++ b/src/views/eam/equipment/EamEquipmentAttachmentList.vue @@ -0,0 +1,185 @@ +<template> + <a-card :bordered="false"> + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button v-if="queryParam.equipmentId" @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel"> + <a-icon type="delete" /> + 鍒犻櫎 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down" /> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a + style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange"> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handlePreview(record)">棰勮</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾涓嬭浇鏂囦欢鍚�?" @confirm="() => handleDownload(record)"> + <a>涓嬭浇</a> + </a-popconfirm> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <eamEquipmentAttachment-modal ref="modalForm" @ok="modalFormOk" :equipmentId="queryParam.equipmentId"></eamEquipmentAttachment-modal> + <lx-file-preview ref="lxFilePreview" :fileUrl="fileUrl"></lx-file-preview> + </a-card> +</template> + +<script> +import '@/assets/less/TableExpand.less' +import EamEquipmentAttachmentModal from './modules/EamEquipmentAttachmentModal' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import { downFile } from '@api/manage' + +export default { + name: 'EamEquipmentAttachmentList', + mixins: [JeecgListMixin], + components: { + EamEquipmentAttachmentModal + }, + data() { + return { + description: '璁惧鏂囨。鍙拌处浣跨敤绠$悊椤甸潰', + disableMixinCreated: true, + fileUrl: '', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鏂囦欢鍔犲瘑鍚�', + align: 'center', + dataIndex: 'fileEncodeName', + ellipsis: true, + }, + { + title: '鏂囦欢鍚嶇О', + align: 'center', + dataIndex: 'fileName', + ellipsis: true, + }, + { + title: '鏂囦欢璺緞', + align: 'center', + dataIndex: 'filePath', + ellipsis: true, + }, + { + title: '鏂囦欢鍚庣紑鍚�', + align: 'center', + dataIndex: 'fileSuffix' + }, + { + title: '鏂囦欢澶у皬', + align: 'center', + dataIndex: 'fileSize' + }, + { + title: '鎻忚堪', + align: 'center', + dataIndex: 'description', + ellipsis: true, + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: '/eam/equipmentAttachment/list', + delete: '/eam/equipmentAttachment/delete', + deleteBatch: '/eam/equipmentAttachment/deleteBatch', + download: '/eam/equipmentAttachment/downloadFile', + } + } + }, + computed: { + }, + methods: { + handleDownload(record) { + downFile(this.url.download, { id: record.id }).then((res) => { + if (!res) { + this.$message.warning('鏂囦欢涓嬭浇澶辫触') + return + } else { + let fileName = record.fileName; + if (typeof window.navigator.msSaveBlob !== 'undefined') { + window.navigator.msSaveBlob(new Blob([res]), fileName); + } else { + let url = window.URL.createObjectURL(new Blob([res])); + let link = document.createElement('a'); + link.style.display = 'none'; + link.href = url; + link.setAttribute('download', fileName); + document.body.appendChild(link); + link.click() + document.body.removeChild(link) //涓嬭浇瀹屾垚绉婚櫎鍏冪礌 + window.URL.revokeObjectURL(url) //閲婃斁鎺塨lob瀵硅薄 + } + } + }) + }, + handlePreview: function (record) { + this.$refs.lxFilePreview.preview(record.filePath); + }, + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/equipment/EamEquipmentList.vue b/src/views/eam/equipment/EamEquipmentList.vue new file mode 100644 index 0000000..923380a --- /dev/null +++ b/src/views/eam/equipment/EamEquipmentList.vue @@ -0,0 +1,834 @@ +<template> + <a-card :bordered="false"> + + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="24"> + <a-col + :xl="6" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="璁惧缂栧彿"> + <a-input + placeholder="璇疯緭鍏ヨ澶囩紪鍙�" + v-model="queryParam.equipmentCode" + ></a-input> + </a-form-item> + </a-col> + <a-col + :xl="6" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="璁惧鍚嶇О"> + <a-input + placeholder="璇疯緭鍏ヨ澶囧悕绉�" + v-model="queryParam.equipmentName" + ></a-input> + </a-form-item> + </a-col> + <a-col + :xl="6" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="绠$悊鍒嗙被"> + <j-dict-select-tag + dict-code="equipment_abc_flag" + placeholder="璇烽�夋嫨绠$悊鍒嗙被" + v-model="queryParam.equipmentImportance" + ></j-dict-select-tag> + </a-form-item> + </a-col> + <template v-if="toggleSearchStatus"> + <a-col + :xl="6" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="璧勪骇鐘舵��"> + <j-dict-select-tag + dict-code="asset_status" + placeholder="璇烽�夋嫨璧勪骇鐘舵��" + v-model="queryParam.assetStatus" + ></j-dict-select-tag> + </a-form-item> + </a-col> + <a-col + :xl="6" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="璁惧绫诲埆"> + <j-dict-select-tag + dict-code="equipment_category" + placeholder="璇烽�夋嫨璁惧绫诲埆" + v-model="queryParam.equipmentCategory" + ></j-dict-select-tag> + </a-form-item> + </a-col> + <a-col + :xl="6" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="浣跨敤杞﹂棿"> + <a-tree-select + v-model="queryParam.orgId" + style="width: 100%" + :tree-data="treeDataAlias" + :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" + placeholder="璇烽�夋嫨浣跨敤杞﹂棿" + allow-clear + tree-default-expand-all + > + </a-tree-select> + </a-form-item> + </a-col> + + </template> + <a-col + :xl="6" + :lg="7" + :md="8" + :sm="24" + > + <span + style="float: left;overflow: hidden;" + class="table-page-search-submitButtons" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + type="info" + @click="searchReset" + icon="reload" + style="margin-left: 8px" + >閲嶇疆</a-button> + <a + @click="handleToggleSearch" + style="margin-left: 8px" + > + {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }} + <a-icon :type="toggleSearchStatus ? 'up' : 'down'" /> + </a> + </span> + </a-col> + + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button + @click="handleAdd" + type="primary" + icon="plus" + >鏂板 + </a-button> + <a-button + type="primary" + icon="download" + @click="handleExportXls('璁惧鍙拌处')" + >瀵煎嚭 + </a-button> + <a-upload + name="file" + :showUploadList="false" + :multiple="false" + :headers="tokenHeader" + :action="importExcelUrl" + @change="handleImportExcel" + > + <a-button + type="primary" + icon="import" + >瀵煎叆 + </a-button> + </a-upload> + <a-button + type="primary" + icon="download" + @click="handleTemplateXlsDownload" + >瀵煎叆妯℃澘涓嬭浇 + </a-button> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <!-- <a-menu-item key="1" @click="handleOpenNameplateModal(selectionRows)">--> + <!-- <a-icon type="printer"/>--> + <!-- 鎵撳嵃閾墝--> + <!-- </a-menu-item>--> + <a-menu-item + key="2" + @click="batchDel" + v-if="isShowAuth('eam:equipment:delete')" + > + <a-icon type="delete" /> + 鍒犻櫎 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down" /> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div + class="ant-alert ant-alert-info" + style="margin-bottom: 16px;" + > + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a + style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a + style="margin-left: 24px" + @click="onSelectChange([])" + >娓呯┖</a> + </div> + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :scroll="{ x: 'max-content' }" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange" + :customRow="customTableRow" + > + <span + slot="processParametersFlag" + slot-scope="text" + > + <lx-switch + v-model="text" + disabled + checked-children="鏈�" + un-checked-children="鏃�" + /> + </span> + <span + slot="precisionParametersFlag" + slot-scope="text" + > + <lx-switch + v-model="text" + disabled + checked-children="鏈�" + un-checked-children="鏃�" + /> + </span> + <span + slot="action" + slot-scope="text, record" + > + <a @click.stop="handleEdit(record)">缂栬緫</a> + <a-divider type="vertical" style="margin: 0 8px;" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村<a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a href="javascript:;" @click="handleOpenResumeDrawer(record)">灞ュ巻</a> + </a-menu-item> + <a-menu-item> + <a href="javascript:;" @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item v-if="isShowAuth('eam:equipment:delete')"> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> +</span> + + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <a-tabs + v-model="activeTabKey" + @change="handleTabChange" + > + <a-tab-pane + tab="璁惧鏂囨。" + :key="1" + > + <eam-equipment-attachment-list ref="tabPaneTableListRef1" /> + </a-tab-pane> + <a-tab-pane + tab="鐐规宸ュ崟" + :key="2" + > + <eam-inspection-order-list + ref="tabPaneTableListRef2" + :isDisplayOperation="false" + /> + </a-tab-pane> + <!-- <a-tab-pane tab="鍛ㄤ繚宸ュ崟" :key="3"> + <eam-week-maintenance-order-list ref="tabPaneTableListRef3" :isDisplayOperation="false"/> + </a-tab-pane>--> + <a-tab-pane + tab="浜屼繚宸ュ崟" + :key="3" + > + <eam-second-maintenance-order-list + ref="tabPaneTableListRef3" + :isDisplayOperation="false" + /> + </a-tab-pane> + <a-tab-pane + tab="涓変繚宸ュ崟" + :key="4" + > + <eam-third-maintenance-order-list + ref="tabPaneTableListRef4" + :isDisplayOperation="false" + /> + </a-tab-pane> + <a-tab-pane + tab="缁翠慨宸ュ崟" + :key="5" + > + <eam-repair-order-list + ref="tabPaneTableListRef5" + :isDisplayOperation="false" + /> + </a-tab-pane> + <a-tab-pane + tab="淇濆吇鏍囧噯" + :key="6" + > + <eam-maintenance-standard-list + ref="tabPaneTableListRef6" + :isDisplayOperation="false" + /> + </a-tab-pane> + <a-tab-pane + tab="宸ヨ壓鍙傛暟" + :key="7" + v-if="isOpenProcess" + > + <eam-equipment-process-list + ref="tabPaneTableListRef7" + :isDisplayOperation="false" + /> + </a-tab-pane> + <a-tab-pane + tab="璁惧绮惧害" + :key="8" + v-if="isOpenPrecision" + > + <eam-equipment-precision-list + ref="tabPaneTableListRef8" + :isDisplayOperation="false" + /> + </a-tab-pane> + <a-tab-pane + tab="璁惧娌规恫" + :key="9" + > + <eam-equipment-fluid-list + ref="tabPaneTableListRef9" + :isDisplayOperation="false" + /> + </a-tab-pane> + </a-tabs> + + <!-- 琛ㄥ崟鍖哄煙 --> + <eamEquipment-modal + ref="modalForm" + @ok="modalFormOk" + ></eamEquipment-modal> + <!--閾墝寮圭獥--> + <nameplate-modal + ref="nameplateModalRef" + :printedRows="printedRows" + /> + <!--灞ュ巻寮圭獥--> + <resume-drawer + ref="resumeDrawerRef" + :currentTableRowRecord="currentTableRowRecord" + /> + </a-card> +</template> + +<script> +import '@/assets/less/TableExpand.less' +import EamEquipmentModal from './modules/EamEquipmentModal' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import { getAction, templateXlsDownload } from '@api/manage' +import NameplateModal from '@views/eam/equipment/modules/NameplateModal.vue' +import { getSystemConfigValue } from '@api/api' +import ResumeDrawer from '@views/eam/equipment/modules/ResumeDrawer.vue' +import EamMaintenanceStandardList from '@views/eam/base/EamMaintenanceStandardList.vue' +import EamRepairOrderList from '../repair/EamRepairOrderList' +// import EamInspectionOrderList from '../maintenance/EamInspectionOrderList' +import EamEquipmentAttachmentList from '@views/eam/equipment/EamEquipmentAttachmentList.vue' +// import EamWeekMaintenanceOrderList from '@views/eam/maintenance/EamWeekMaintenanceOrderList.vue' +import EamEquipmentProcessList from '@views/eam/equipment/modules/EamEquipmentProcessList.vue' +import EamEquipmentPrecisionList from '@views/eam/equipment/modules/EamEquipmentPrecisionList.vue' +// import EamSecondMaintenanceOrderList from '@views/eam/maintenance/EamSecondMaintenanceOrderList.vue' +// import EamThirdMaintenanceOrderList from '@views/eam/maintenance/EamThirdMaintenanceOrderList.vue' +import EamEquipmentFluidList from '@views/eam/equipment/modules/EamEquipmentFluidList.vue' +import { hasPermission } from '@/utils/hasPermission' // 娣诲姞杩欎竴琛� +export default { + name: 'EamEquipmentList', + mixins: [JeecgListMixin], + components: { + EamMaintenanceStandardList, + ResumeDrawer, + NameplateModal, + EamEquipmentModal, + EamEquipmentAttachmentList, + EamEquipmentProcessList, + EamEquipmentPrecisionList, + EamEquipmentFluidList + }, + data() { + return { + description: '璁惧鍙拌处绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + }, + fixed: 'left' + }, + { + title: '璁惧缂栧彿', + align: 'center', + width: 100, + dataIndex: 'equipmentCode', + ellipsis: true, + fixed: 'left', + sorter: true + }, + { + title: '璁惧鍚嶇О', + align: 'center', + width: 100, + dataIndex: 'equipmentName', + ellipsis: true, + fixed: 'left' + }, + { + title: '绠$悊鍒嗙被', + align: 'center', + width: 120, + dataIndex: 'equipmentImportance_dictText' + }, + { + title: '鎶�鏈姸鎬�', + align: 'center', + width: 100, + dataIndex: 'technologyStatus_dictText' + }, + { + title: '璧勪骇浣跨敤鐘舵��', + align: 'center', + width: 100, + dataIndex: 'assetStatus_dictText' + }, + { + title: '缁翠慨鐘舵��', + align: 'center', + width: 100, + dataIndex: 'repairStatus_dictText' + }, + { + title: '淇濆吇鐘舵��', + align: 'center', + width: 100, + dataIndex: 'maintenanceStatus_dictText' + }, + { + title: '浣跨敤杞﹂棿', + align: 'center', + width: 100, + dataIndex: 'orgId_dictText' + }, + { + title: '璁惧绠$悊鍛�', + align: 'center', + width: 100, + dataIndex: 'equipmentManager_dictText' + }, + { + title: '璁惧绫诲埆', + align: 'center', + dataIndex: 'equipmentCategory_dictText' + }, + { + title: '璁惧绉嶇被', + align: 'center', + dataIndex: 'equipmentType_dictText' + }, + { + title: '璁惧鍨嬪彿', + align: 'center', + width: 200, + dataIndex: 'equipmentModel' + }, + { + title: '璁惧瑙勬牸', + align: 'center', + width: 100, + dataIndex: 'equipmentSpecification' + }, + { + title: '鐢垫満鍙版暟', + align: 'center', + width: 100, + dataIndex: 'motorsNumber' + }, + { + title: '鎬诲姛鐜�(KW)', + align: 'center', + width: 100, + dataIndex: 'equipmentPower' + }, + { + title: '閲嶉噺(鍚�)', + align: 'center', + width: 100, + dataIndex: 'equipmentWeight' + }, + { + title: '瀹夎浣嶇疆', + align: 'center', + width: 100, + dataIndex: 'installationPosition' + }, + { + title: '鍑哄巶缂栧彿', + align: 'center', + dataIndex: 'factoryNumber' + }, + { + title: '鏈哄簥鍘傚', + align: 'center', + width: 300, + dataIndex: 'manufacturingEnterprise' + }, + { + title: '鏉ユ簮鍥藉', + align: 'center', + width: 100, + dataIndex: 'originCountry' + }, + { + title: '璁惧渚涘簲鍟�', + align: 'center', + width: 100, + dataIndex: 'supplier' + }, + { + title: '鍑哄巶鏃ユ湡', + align: 'center', + width: 100, + dataIndex: 'leaveFactoryDate' + }, + { + title: '鎶曠敤鏃ユ湡', + align: 'center', + width: 100, + dataIndex: 'acceptanceCheckDate' + }, + { + title: '鏈夋棤宸ヨ壓鍙傛暟', + align: 'center', + width: 120, + dataIndex: 'processParametersFlag', + scopedSlots: { customRender: 'processParametersFlag' } + }, + { + title: '鏈夋棤绮惧害鍙傛暟', + align: 'center', + width: 120, + dataIndex: 'precisionParametersFlag', + scopedSlots: { customRender: 'precisionParametersFlag' } + }, + { + title: '澶栧舰灏哄', + align: 'center', + dataIndex: 'overallDimensions' + }, + { + title: '鍘熷��(鍏�)', + align: 'center', + dataIndex: 'originalValue' + }, + { + title: '璧勯噾鏉ユ簮', + align: 'center', + dataIndex: 'fundingSource' + }, + { + title: '鍔熻兘鐢ㄩ��', + align: 'center', + dataIndex: 'functionUse' + }, + { + title: '鎬ц兘鎸囨爣', + align: 'center', + dataIndex: 'performanceIndicators' + }, + { + title: '鍏ュ笎鏃堕棿', + align: 'center', + width: 100, + dataIndex: 'bookingTime' + }, + { + title: '鍒涘缓浜�', + align: 'center', + width: 100, + dataIndex: 'createBy_dictText' + }, + { + title: '鍒涘缓鏃堕棿', + align: 'center', + width: 200, + dataIndex: 'createTime' + }, + { + title: '鏇存柊浜�', + align: 'center', + dataIndex: 'updateBy_dictText' + }, + { + title: '鏇存柊鏃堕棿', + align: 'center', + dataIndex: 'updateTime' + }, + { + title: '澶囨敞', + align: 'center', + dataIndex: 'remark' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + width: 150, + scopedSlots: { customRender: 'action' }, + fixed: 'right' + } + ], + url: { + list: '/eam/equipment/list', + delete: '/eam/equipment/delete', + deleteBatch: '/eam/equipment/deleteBatch', + exportXlsUrl: 'eam/equipment/exportXls', + importExcelUrl: 'eam/equipment/importExcel', + loadProductionOptions: '/base/factory/queryTreeList', + templateXlsDownloadUrl: '瀵煎叆妯℃澘/璁惧鍙拌处瀵煎叆妯℃澘_v1.1.xlsx' + }, + treeData: [], + printedRows: [], + activeTabKey: 1, + appHomeUrl: '', + currentTableRowRecord: {}, + isOpenProcess: false, + isOpenPrecision: false, + treeDataAlias: [] + } + }, + computed: { + importExcelUrl: function() { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` + } + }, + created() { + this.loadAllProductionTree() + this.loadAppHomeUrlConfigValue() + }, + methods: { + loadAllProductionTree() { + //鍔犺浇杞﹂棿閫夋嫨鏍� + getAction(this.url.loadProductionOptions).then(res => { + if (res.success) { + this.treeData = [...res.result] + this.treeDataAlias = this.deepCopyAndModify(res.result) + console.info('treeDataAlias====', this.treeDataAlias) + } else { + that.$message.warning(res.message) + } + }) + }, + + /** + * 寮�鍚摥鐗屽脊绐� + * @param recordArray 琛ㄦ牸琛屼俊鎭泦鍚� + */ + handleOpenNameplateModal(recordArray) { + this.printedRows = recordArray + this.$refs.nameplateModalRef.httpUrl = this.appHomeUrl + this.$refs.nameplateModalRef.visible = true + }, + + /** + * 寮�鍚饱鍘嗘娊灞� + * @param record 琛ㄦ牸琛屼俊鎭� + */ + handleOpenResumeDrawer(record) { + this.currentTableRowRecord = Object.assign({}, record) + this.$refs.resumeDrawerRef.title = '璁惧灞ュ巻' + `锛�${record.equipmentCode}锛塦 + this.$refs.resumeDrawerRef.dataSource = [] + this.$refs.resumeDrawerRef.visible = true + this.$nextTick(() => this.$refs.resumeDrawerRef.getEquipmentResumeByApi()) + }, + + /** + * 鑷畾涔夎澶囧彴璐﹁〃鏍艰 + * @param record 琛ㄦ牸琛屼俊鎭� + * @returns {{style: {cursor: string}, on: {click: *}}} 鏍峰紡瀵硅薄涓庝簨浠舵柟娉� + */ + customTableRow(record) { + return { + style: { + cursor: 'pointer' + }, + on: { + click: () => { + this.onSelectChange([record.id]) + } + } + } + }, + + /** + * 椤电鏀瑰彉鏃惰Е鍙� + * @param activeTabKey 褰撳墠婵�娲荤殑椤电key + */ + handleTabChange(activeTabKey) { + if (this.selectedRowKeys.length !== 1) return + this.$nextTick(() => this.loadTabPaneTableData(this.selectedRowKeys[0])) + }, + + /** + * 鍔犺浇椤电琛ㄦ牸鏁版嵁 + * @param id 璁惧鍙拌处琛岃褰旾d + */ + loadTabPaneTableData(id) { + this.$refs['tabPaneTableListRef' + this.activeTabKey].queryParam.equipmentId = id + this.$refs['tabPaneTableListRef' + this.activeTabKey].loadData(1) + }, + + /** + * 璁惧鍙拌处琛ㄦ牸澶氶�夋鐘舵�佹敼鍙樻椂瑙﹀彂 + * @param selectedRowKeys 宸查�夋嫨鐨剅owKey闆嗗悎 + * @param selectionRows 褰撳墠鍒嗛〉涓嬪凡閫夋嫨鐨勮淇℃伅闆嗗悎 + */ + onSelectChange(selectedRowKeys, selectionRows) { + this.selectedRowKeys = selectedRowKeys + this.selectionRows = selectionRows + this.$refs['tabPaneTableListRef' + this.activeTabKey].queryParam.equipmentId = null + this.$refs['tabPaneTableListRef' + this.activeTabKey].dataSource = [] + this.$refs['tabPaneTableListRef' + this.activeTabKey].onClearSelected() + if (selectedRowKeys.length === 1) { + let row = this.dataSource.find(row => row.id === selectedRowKeys[0]) + if (row) { + this.isOpenProcess = (row.processParametersFlag === '1') + this.isOpenPrecision = (row.precisionParametersFlag === '1') + } else { + this.isOpenProcess = false + this.isOpenPrecision = false + } + this.loadTabPaneTableData(selectedRowKeys[0]) + } else { + this.isOpenProcess = false + this.isOpenPrecision = false + } + //tab鏍囩琚攢姣佷簡锛岃繑鍥炵涓�涓猼ab + if (!this.isOpenProcess && this.activeTabKey === 6) { + this.activeTabKey = 1 + } + if (!this.isOpenPrecision && this.activeTabKey === 7) { + this.activeTabKey = 1 + } + }, + + handleTemplateXlsDownload() { + templateXlsDownload(this.url.templateXlsDownloadUrl) + }, + + loadAppHomeUrlConfigValue() { + let params = { settingKey: 'app_home_url' } + getSystemConfigValue(params).then(res => { + if (res.success) { + this.appHomeUrl = res.result.settingValue + } + }) + }, + deepCopyAndModify(arr) { + // 濡傛灉褰撳墠鍏冪礌涓嶆槸鏁扮粍鎴栧璞★紝鐩存帴杩斿洖 + if (!Array.isArray(arr) && typeof arr !== 'object' || arr === null || arr.length === 0) { + return arr + } + + // 濡傛灉鏄暟缁勶紝鍒涘缓涓�涓柊鏁扮粍骞堕�掑綊澶勭悊姣忎釜鍏冪礌 + if (Array.isArray(arr)) { + const newArray = [] + for (let i = 0; i < arr.length; i++) { + newArray.push(this.deepCopyAndModify(arr[i])) + } + return newArray + } + + // 濡傛灉鏄璞★紝鍒涘缓涓�涓柊瀵硅薄骞堕�掑綊澶勭悊姣忎釜灞炴�� + const newObj = {} + for (const key in arr) { + if (arr.hasOwnProperty(key)) { + if (key === 'selectable') { + newObj[key] = true + } else if (key === 'children') { + newObj[key] = this.deepCopyAndModify(arr[key]) + } else { + newObj[key] = arr[key] + } + + } + } + return newObj + }, + + searchReset() { + this.queryParam = {} + this.onClearSelected() + this.loadTabPaneTableData('-1') + this.loadData(1) + } + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/equipment/modules/EamEquipmentAttachmentModal.vue b/src/views/eam/equipment/modules/EamEquipmentAttachmentModal.vue new file mode 100644 index 0000000..190d5db --- /dev/null +++ b/src/views/eam/equipment/modules/EamEquipmentAttachmentModal.vue @@ -0,0 +1,138 @@ +<template> + <j-modal + :title="title" + :width="800" + :visible="visible" + :confirmLoading="confirmLoading" + switchFullscreen + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :model="model" :rules="validatorRules"> + <a-form-model-item + label="涓婁紶" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + v-if="!editable" + prop="fileList"> + <lx-upload :returnUrl="false" + :isMultiple="false" + v-model="model.fileList" + biz="test"> + </lx-upload> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fileName" label="鏂囦欢鍚嶇О" v-if="editable"> + <a-input placeholder="璇疯緭鍏ユ枃浠跺悕绉�" v-model="model.fileName" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="description" label="鎻忚堪"> + <a-textarea placeholder="璇疯緭鍏ユ弿杩�" v-model="model.description" /> + </a-form-model-item> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> +import { httpAction } from '@/api/manage' + +export default { + name: "EamEquipmentAttachmentModal", + props: { + equipmentId: { + type: String, + required: false, + default: '-1' + } + }, + data () { + return { + title:"鎿嶄綔", + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + + confirmLoading: false, + validatorRules:{ + fileName: [ + { required: true, message: '璇疯緭鍏ユ枃浠跺悕绉�!' } + ] + }, + url: { + add: "/eam/equipmentAttachment/add", + edit: "/eam/equipmentAttachment/edit", + }, + editable: false, + } + }, + created () { + }, + methods: { + add () { + this.editable = false; + //鍒濆鍖栭粯璁ゅ�� + this.model = {}; + this.visible = true + }, + edit (record) { + this.editable = true; + this.model = Object.assign({}, record) + this.visible = true + }, + close () { + this.$emit('close'); + this.visible = false; + this.$refs.form.clearValidate(); + }, + handleOk () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + that.model.equipmentId = that.equipmentId; + httpAction(httpurl, that.model, method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + that.close(); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + }else{ + return false; + } + }) + }, + handleCancel () { + this.close() + }, + + + } + } +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/equipment/modules/EamEquipmentFluidList.vue b/src/views/eam/equipment/modules/EamEquipmentFluidList.vue new file mode 100644 index 0000000..9ec6631 --- /dev/null +++ b/src/views/eam/equipment/modules/EamEquipmentFluidList.vue @@ -0,0 +1,285 @@ +<template> + <a-spin :spinning="confirmLoading"> + <vxe-toolbar> + <template v-slot:buttons> + <vxe-button status="primary" @click="insertEvent()">鏂板</vxe-button> + <vxe-button status="danger" @click="handleBatchRemove()">鎵归噺鍒犻櫎</vxe-button> + </template> + </vxe-toolbar> + <vxe-table + ref="editableDetailTable" + border + resizable + show-overflow + keep-source + :height="300" + :loading="confirmLoading" + :data="dataSource" + :edit-rules="validRules" + :edit-config="{trigger: 'manual', mode: 'row', showStatus: true}" + style="margin-top: 8px;"> + <vxe-table-column type="checkbox" width="60"></vxe-table-column> + <vxe-table-column type="seq" width="60"></vxe-table-column> + <vxe-table-column title="ID" field="id" :visible="false"></vxe-table-column> + <vxe-table-column title="equipmentId" field="equipmentId" :visible="false"></vxe-table-column> + <vxe-table-column title="娌规恫鍚嶇О" field="fluidId" align="center" + :edit-render="{name : '$select', options: fluidList, optionProps: {label:'fluidName', value:'id'}, props: {clearable:true}, events: {change:handleParamSelectChange}}"></vxe-table-column> + <vxe-table-column title="鍙傛暟缂栫爜" field="fluidCode" align="center"></vxe-table-column> + <vxe-table-column title="鎿嶄綔" width="160"> + <template v-slot="{row}"> + <template v-if="hasEditStatus(row)"> + <vxe-button @click="saveRowEvent(row)">淇濆瓨</vxe-button> + <vxe-button @click="cancelRowEvent(row)">鍙栨秷</vxe-button> + </template> + <template v-else> + <vxe-button @click="editRowEvent(row)">缂栬緫</vxe-button> + <vxe-button @click="handleRemove(row)">鍒犻櫎</vxe-button> + </template> + + </template> + </vxe-table-column> + </vxe-table> + <a-pagination + v-bind="ipagination" + @change="handlePageChange" + @showSizeChange="handleShowSizeChange" + /> + </a-spin> +</template> + +<script> +import { deleteAction, getAction, httpAction } from '@/api/manage' + +export default { + name: 'EamEquipmentFluidList', + data() { + return { + title: '鎿嶄綔', + confirmLoading: false, + url: { + add: '/eam/eamEquipmentFluid/add', + edit: '/eam/eamEquipmentFluid/edit', + list: '/eam/eamEquipmentFluid/list', + delete: '/eam/eamEquipmentFluid/delete', + deleteBatch: '/eam/eamEquipmentFluid/deleteBatch', + fluidList: '/eam/eamFluid/listAll' + }, + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0, + size: 'small' + }, + dataSource: [], + fluidList: [], + queryParam: { + equipmentId: '-1' + }, + validRules: { + fluidId: [ + { required: true, message: '璇烽�夋嫨娌规恫锛�' } + ] + } + } + }, + created() { + this.loadFluidList() + }, + methods: { + handleParamSelectChange($event, value) { + console.log(value) + let parameter = this.fluidList.find(item => item.id === value.value) + if (parameter) { + $event.row.fluidCode = parameter.fluidCode + } else { + $event.row.fluidCode = undefined + } + }, + loadFluidList() { + getAction(this.url.fluidList).then(res => { + if (res.success) { + this.fluidList = [...res.result] + } + }) + }, + onClearSelected() { + this.dataSource = [] + this.queryParam.equipmentId = '-1' + this.ipagination.current = 1 + this.ipagination.total = 0 + }, + loadData(args) { + if (!this.url.list) { + this.$message.error('璇疯缃畊rl.list灞炴��!') + return + } + if (args === 1) { + this.ipagination.current = 1 + } + // 灏佽鏌ヨ鏉′欢 + let formData = { + pageNo: args, + pageSize: this.ipagination.pageSize, + equipmentId: this.queryParam.equipmentId + } + // 璋冪敤鏌ヨ鏁版嵁鎺ュ彛 + this.confirmLoading = true + getAction(this.url.list, formData).then(res => { + if (res.success) { + // 鍚庡彴鏌ヨ鍥炴潵鐨� total锛屾暟鎹�绘暟閲� + this.dataSource = res.result.records || res.result + if (res.result.total) { + this.ipagination.total = res.result.total + } else { + this.ipagination.total = 0 + } + } else { + this.$message.warning(res.message) + } + }).finally(() => { + // 杩欓噷鏄棤璁烘垚鍔熸垨澶辫触閮戒細鎵ц鐨勬柟娉曪紝鍦ㄨ繖閲屽叧闂璴oading + this.confirmLoading = false + }) + }, + async insertEvent() { + let record = { equipmentId: this.queryParam.equipmentId } + let { row: newRow } = await this.$refs.editableDetailTable.insert(record) + await this.$refs.editableDetailTable.setActiveCell(newRow, 'fluidId') + }, + async saveRowEvent(row) { + let that = this + const errMap = await that.$refs.editableDetailTable.validate().catch(errMap => errMap) + if (errMap) { + that.$message.warning('鏍¢獙涓嶉�氳繃,璇疯ˉ鍏呭繀濉」锛�') + return + } + that.confirmLoading = true + let httpurl = '' + let method = '' + if (!row.id) { + httpurl += that.url.add + method = 'post' + } else { + httpurl += that.url.edit + method = 'put' + } + let res = await httpAction(httpurl, row, method) + if (res.success) { + that.$message.success(res.message) + that.loadData(that.ipagination.current) + await that.$refs.editableDetailTable.clearActived() + } else { + that.$message.warning(res.message) + } + that.confirmLoading = false + }, + handleRemove(row) { + let xTable = this.$refs.editableDetailTable + let that = this + this.$confirm({ + content: `纭瑕佸垹闄ゅ悧锛焋, + onOk: () => { + if (row.id) { + //鍚庣鍒犻櫎 + deleteAction(that.url.delete, { id: row.id }).then((res) => { + if (res.success) { + that.reCalculatePage(1) + that.$message.success(res.message) + that.loadData(that.ipagination.current) + } else { + that.$message.warning(res.message) + } + }) + } else { + //鍓嶇鍒犻櫎 + xTable.remove(row) + } + }, + onCancel: () => { + xTable.setActiveCell(row, 'fluidId') + } + }) + }, + handleBatchRemove(){ + let xTable = this.$refs.editableDetailTable + let that = this + let checkboxRecords = xTable.getCheckboxRecords(); + if(checkboxRecords && checkboxRecords.length > 0) { + let ids = checkboxRecords.map(record => record.id); + this.$confirm({ + title: "纭鍒犻櫎", + content: "鏄惁鍒犻櫎閫変腑鏁版嵁?", + onOk: function () { + that.confirmLoading = true; + deleteAction(that.url.deleteBatch, {ids: ids.join(',')}).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(checkboxRecords.length) + that.$message.success(res.message); + that.loadData(that.ipagination.current); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }); + } + }); + } else { + that.$message.warning('璇峰厛閫変腑鏁版嵁琛岋紒'); + } + }, + editRowEvent(row) { + this.$refs.editableDetailTable.setActiveRow(row) + }, + cancelRowEvent(row) { + let xTable = this.$refs.editableDetailTable + this.$confirm({ + content: `纭瑕佹斁寮冪紪杈戝悧锛焋, + onOk: () => { + xTable.revertData() + }, + onCancel: () => { + xTable.setActiveCell(row, 'fluidId') + } + }) + }, + hasEditStatus(row) { + const $table = this.$refs.editableDetailTable + if ($table) { + return $table.isActiveByRow(row) + } + return false + }, + reCalculatePage(count) { + //鎬绘暟閲�-count + let total = this.ipagination.total - count + //鑾峰彇鍒犻櫎鍚庣殑鍒嗛〉鏁� + let currentIndex = Math.ceil(total / this.ipagination.pageSize) + //鍒犻櫎鍚庣殑鍒嗛〉鏁�<鎵�鍦ㄥ綋鍓嶉〉 + if (currentIndex < this.ipagination.current) { + this.ipagination.current = currentIndex + } + }, + handlePageChange(current, pageSize){ + this.$set(this.ipagination, 'current', current) + this.$emit('change', {current, pageSize}) + }, + handleShowSizeChange(current, pageSize){ + this.$set(this.ipagination, 'pageSize', pageSize) + this.$emit('change', {current, pageSize}) + }, + } +} +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/equipment/modules/EamEquipmentModal.vue b/src/views/eam/equipment/modules/EamEquipmentModal.vue new file mode 100644 index 0000000..1d739ab --- /dev/null +++ b/src/views/eam/equipment/modules/EamEquipmentModal.vue @@ -0,0 +1,395 @@ +<template> + <j-modal + :title="title" + :width="1200" + :visible="visible" + centered + :confirmLoading="confirmLoading" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + switchFullscreen + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 鍩虹淇℃伅 + </a-divider> + + <a-row :gutter="24"> + <a-col :span="18"> + <a-row> + <a-col :span="8"> + <a-form-model-item prop="equipmentCode" label="璁惧缂栧彿"> + <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="model.equipmentCode" :disabled="editable || disableSubmit" /> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="equipmentName" label="璁惧鍚嶇О"> + <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="model.equipmentName" :disabled="disableSubmit" /> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="equipmentModel" label="璁惧鍨嬪彿"> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ヨ澶囧瀷鍙�'" v-model="model.equipmentModel" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row> + <a-col :span="8"> + <a-form-model-item prop="equipmentSpecification" + label="璁惧瑙勬牸"> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ヨ澶囪鏍�'" v-model="model.equipmentSpecification" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="equipmentCategory" + label="璁惧绫诲埆"> + <j-dict-select-tag dict-code="equipment_category" placeholder="璇烽�夋嫨璁惧绫诲埆" + v-model="model.equipmentCategory" :disabled="disableSubmit" /> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="equipmentType" + label="璁惧绉嶇被"> + <j-tree-dict placeholder="璇烽�夋嫨璁惧绉嶇被" v-model="model.equipmentType" parent-code="equipment_category" field="code" :async="true" :disabled="disableSubmit"></j-tree-dict> + </a-form-model-item> + </a-col> + </a-row> + <a-row> + <a-col :span="8"> + <a-form-model-item prop="equipmentImportance" + label="绠$悊鍒嗙被"> + <j-dict-select-tag dict-code="equipment_abc_flag" placeholder="璇烽�夋嫨绠$悊鍒嗙被" + v-model="model.equipmentImportance" :disabled="disableSubmit" /> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="originalValue" label="鍘熷��(鍏�)"> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ュ師鍊�'" v-model="model.originalValue" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="fundingSource" label="璧勯噾鏉ユ簮"> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ヨ祫閲戞潵婧�'" v-model="model.fundingSource" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + </a-row> + </a-col> + <a-col :span="6"> + <j-image-upload text="璁惧鍥剧墖" bizPath="eam_equipment_image" v-model="model.equipmentImage"></j-image-upload> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="6"> + <a-form-model-item prop="motorsNumber" + label="鐢垫満鍙版暟"> + <a-input-number :placeholder="disableSubmit?'':'璇疯緭鍏ョ數鏈哄彴鏁�'" v-model="model.motorsNumber" :disabled="disableSubmit" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item prop="equipmentPower" label="鎬诲姛鐜�(KW)"> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ユ�诲姛鐜�'" v-model="model.equipmentPower" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item prop="equipmentWeight" label="閲嶉噺(鍚�)"> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ラ噸閲�'" v-model="model.equipmentWeight" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item prop="overallDimensions" label="澶栧舰灏哄"> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ュ褰㈠昂瀵�'" v-model="model.overallDimensions" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="6"> + <a-form-model-item prop="technologyStatus" label="鎶�鏈姸鎬�"> + <j-dict-select-tag dict-code="technology_status" placeholder="璇烽�夋嫨鎶�鏈姸鎬�" + v-model="model.technologyStatus" :disabled="disableSubmit" /> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item prop="functionUse" label="鍔熻兘鐢ㄩ��"> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ュ姛鑳界敤閫�'" v-model="model.functionUse" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item prop="performanceIndicators" label="鎬ц兘鎸囨爣"> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ユ�ц兘鎸囨爣'" v-model="model.performanceIndicators" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item prop="assetStatus" label="璧勪骇鐘舵��"> + <j-dict-select-tag dict-code="asset_status" v-model="model.assetStatus" + disabled/> + </a-form-model-item> + </a-col> + </a-row> + + <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 鍑哄巶淇℃伅 + </a-divider> + + <a-row :gutter="24"> + <a-col :span="6"> + <a-form-model-item prop="factoryNumber" label="鍑哄巶缂栧彿"> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ュ嚭鍘傜紪鍙�'" v-model="model.factoryNumber" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item prop="originCountry" label="鏉ユ簮鍥藉"> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ユ潵婧愬浗瀹�'" v-model="model.originCountry" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item prop="supplier" label="璁惧渚涘簲鍟�"> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ヨ澶囦緵搴斿晢'" v-model="model.supplier" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item prop="manufacturingEnterprise" label="鏈哄簥鍘傚"> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ユ満搴婂巶瀹�'" v-model="model.manufacturingEnterprise" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + + </a-row> + <a-row :gutter="24"> + <a-col :span="6"> + <a-form-model-item prop="leaveFactoryDate" label="鍑哄巶鏃ユ湡"> + <a-date-picker placeholder="璇烽�夋嫨鍑哄巶鏃ユ湡" v-model="model.leaveFactoryDate" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item prop="acceptanceCheckDate" label="鎶曠敤鏃ユ湡"> + <a-date-picker placeholder="璇烽�夋嫨鎶曠敤鏃ユ湡" v-model="model.acceptanceCheckDate" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item prop="bookingTime" label="鍏ヨ处鏃堕棿"> + <a-date-picker placeholder="璇烽�夋嫨鍏ヨ处鏃堕棿" v-model="model.bookingTime" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item prop="installationPosition" label="瀹夎浣嶇疆"> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ュ畨瑁呬綅缃�'" v-model="model.installationPosition" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 浣跨敤淇℃伅 + </a-divider> + + <a-row :gutter="24"> + <a-col :span="6"> + <a-form-model-item prop="orgId" label="浣跨敤杞﹂棿"> + <a-tree-select v-model="model.orgId" + style="width: 100%" + :tree-data="treeData" + :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" + placeholder="璇烽�夋嫨浣跨敤杞﹂棿" + allow-clear + tree-default-expand-all + :disabled="editable || disableSubmit" + > + </a-tree-select> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item prop="equipmentManager" label="璁惧绠$悊鍛�"> + <j-search-select-tag placeholder="璇烽�夋嫨璁惧绠$悊鍛�" v-model="model.equipmentManager" dict="sys_user,realname, username, del_flag=0 and post='PCR0004' and status=1" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item prop="processParametersFlag" label="鏈夋棤宸ヨ壓鍙傛暟"> + <lx-switch checked-children='鏈�' un-checked-children='鏃�' v-model="model.processParametersFlag" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item prop="precisionParametersFlag" label="鏈夋棤绮惧害鍙傛暟"> + <lx-switch checked-children='鏈�' un-checked-children='鏃�' v-model="model.precisionParametersFlag" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="remark" label="澶囨敞"> + <a-textarea :placeholder="disableSubmit?'':'璇疯緭鍏ュ娉�'" v-model="model.remark" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> +import { getAction, httpAction } from '@/api/manage' +import { validateDuplicateValueInDelFlag } from '@/utils/util' +import JSelectProduction from '@comp/jeecgbiz/JSelectProduction.vue' + +export default { + name: 'EamEquipmentModal', + components: { JSelectProduction }, + data() { + return { + title: '鎿嶄綔', + visible: false, + //鎺у埗缂栬緫 + editable: false, + //璇︽儏鎺у埗 + disableSubmit: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 9 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 14 } + }, + labelColLong: { + xs: { span: 24 }, + sm: { span: 2 } + }, + wrapperColLong: { + xs: { span: 24 }, + sm: { span: 22 } + }, + confirmLoading: false, + validatorRules: { + equipmentCode: [ + { required: true, message: '璇疯緭鍏ヨ澶囩紪鐮�' }, + { validator: (rule, value, callback) => validateDuplicateValueInDelFlag('eam_equipment', 'equipment_code', value, this.model.id, true, callback) } + ], + equipmentName: [ + { required: true, message: '璇疯緭鍏ヨ澶囧悕绉�' } + ], + equipmentCategory: [ + { required: true, message: '璇烽�夋嫨璁惧绫诲埆' } + ], + leaveFactoryDate: [ + { required: true, message: '璇烽�夋嫨鍑哄巶鏃ユ湡' } + ], + acceptanceCheckDate: [ + { required: false, message: '璇烽�夋嫨楠屾敹鏃ユ湡' } + ], + orgId: [ + { required: true, message: '璇烽�夋嫨浣跨敤杞﹂棿' } + ], + equipmentManager: [ + { required: true, message: '璇烽�夋嫨璁惧绠$悊鍛�' } + ], + deviceType: [ + { required: false, message: '璇烽�夋嫨璁惧绫诲瀷' } + ] + }, + url: { + add: '/eam/equipment/add', + edit: '/eam/equipment/edit', + loadProductionOptions:'/base/factory/queryTreeList' + }, + treeData: [], + } + }, + created() { + this.loadAllProductionTree(); + }, + methods: { + add() { + this.editable = false; + //鍒濆鍖栭粯璁ゅ�� + this.model = {}; + this.visible = true + }, + edit(record) { + this.editable = true; + this.model = Object.assign({}, record) + this.visible = true + }, + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() + }, + handleOk() { + debugger + console.log('寮�濮嬮獙璇佽〃鍗�') + const that = this + debugger + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true + let httpurl = '' + let method = '' + if (!this.model.id) { + httpurl += this.url.add + method = 'post' + } else { + httpurl += this.url.edit + method = 'put' + } + httpAction(httpurl, this.model, method).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.$emit('ok') + that.close() + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = false + }) + } else { + return false + } + }) + }, + handleCancel() { + this.close() + }, + loadAllProductionTree() { + //鍔犺浇杞﹂棿閫夋嫨鏍� + getAction(this.url.loadProductionOptions).then(res => { + if (res.success) { + this.treeData = [...res.result] + }else { + that.$message.warning(res.message) + } + }) + }, + } +} +</script> + +<style lang="less" scoped> +/deep/ .ant-modal-body { + padding: 0 24px; +} + +/deep/ .ant-upload { + width: 185px; + height: 185px; +} + +/deep/ .img { + display: flex; + justify-content: center; + + .ant-upload-picture-card-wrapper { + width: auto; + } +} + +/deep/ .ant-upload-list-picture-card-container { + width: 185px; + height: 185px; +} + +/deep/ .ant-upload-list-item { + width: 185px; + height: 185px; +} +</style> \ No newline at end of file diff --git a/src/views/eam/equipment/modules/EamEquipmentPrecisionList.vue b/src/views/eam/equipment/modules/EamEquipmentPrecisionList.vue new file mode 100644 index 0000000..3869b1f --- /dev/null +++ b/src/views/eam/equipment/modules/EamEquipmentPrecisionList.vue @@ -0,0 +1,329 @@ +<template> + <a-spin :spinning="confirmLoading"> + <vxe-toolbar> + <template v-slot:buttons> + <vxe-button + status="primary" + @click="insertEvent()" + >鏂板</vxe-button> + <vxe-button + status="danger" + @click="handleBatchRemove()" + >鎵归噺鍒犻櫎</vxe-button> + </template> + </vxe-toolbar> + <vxe-table + ref="editableDetailTable" + border + resizable + show-overflow + keep-source + :height="300" + :loading="confirmLoading" + :data="dataSource" + :edit-rules="validRules" + :edit-config="{trigger: 'manual', mode: 'row', showStatus: true}" + style="margin-top: 8px;" + > + <vxe-table-column + type="checkbox" + width="60" + ></vxe-table-column> + <vxe-table-column + type="seq" + width="60" + ></vxe-table-column> + <vxe-table-column + title="ID" + field="id" + :visible="false" + ></vxe-table-column> + <vxe-table-column + title="equipmentId" + field="equipmentId" + :visible="false" + ></vxe-table-column> + <vxe-table-column + title="妫�娴嬮」鐩�" + field="parameterId" + align="center" + :edit-render="{name : '$select', options: precisionParameterList, optionProps: {label:'parameterName', value:'id'}, props: {clearable:true}, events: {change:handleParamSelectChange}}" + ></vxe-table-column> + <vxe-table-column + title="鍙傛暟缂栫爜" + field="parameterCode" + align="center" + ></vxe-table-column> + <vxe-table-column + title="鍏佸樊鍊�(mm)" + field="parameterValue" + align="center" + :edit-render="{name : '$input'}" + ></vxe-table-column> + <vxe-table-column + title="瀹為檯鍊�" + field="actualValue" + align="center" + ></vxe-table-column> + <vxe-table-column + title="鎿嶄綔" + width="160" + > + <template v-slot="{row}"> + <template v-if="hasEditStatus(row)"> + <vxe-button @click="saveRowEvent(row)">淇濆瓨</vxe-button> + <vxe-button @click="cancelRowEvent(row)">鍙栨秷</vxe-button> + </template> + <template v-else> + <vxe-button @click="editRowEvent(row)">缂栬緫</vxe-button> + <vxe-button @click="handleRemove(row)">鍒犻櫎</vxe-button> + </template> + + </template> + </vxe-table-column> + </vxe-table> + <a-pagination + v-bind="ipagination" + @change="handlePageChange" + @showSizeChange="handleShowSizeChange" + /> + </a-spin> +</template> + +<script> +import { deleteAction, getAction, httpAction } from '@/api/manage' + +export default { + name: 'EamEquipmentPrecisionList', + data() { + return { + title: '鎿嶄綔', + confirmLoading: false, + url: { + add: '/eam/equipmentPrecisionParameters/add', + edit: '/eam/equipmentPrecisionParameters/edit', + list: '/eam/equipmentPrecisionParameters/list', + delete: '/eam/equipmentPrecisionParameters/delete', + deleteBatch: '/eam/equipmentPrecisionParameters/deleteBatch', + precisionParamList: '/eam/precisionParameters/listAll' + }, + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0, + size: 'small' + }, + dataSource: [], + precisionParameterList: [], + queryParam: { + equipmentId: '-1' + }, + validRules: { + parameterId: [ + { required: true, message: '璇烽�夋嫨鍙傛暟锛�' } + ], + parameterValue: [ + { required: true, message: '璇疯緭鍏ュ厑宸�硷紒' } + ] + } + } + }, + created() { + this.loadPrecisionParameterList() + }, + methods: { + handleParamSelectChange($event, value) { + let parameter = this.precisionParameterList.find(item => item.id === value.value) + if (parameter) { + $event.row.parameterCode = parameter.parameterCode + } else { + $event.row.parameterCode = undefined + } + }, + loadPrecisionParameterList() { + getAction(this.url.precisionParamList).then(res => { + if (res.success) { + this.precisionParameterList = [...res.result] + } + }) + }, + onClearSelected() { + this.dataSource = [] + this.queryParam.equipmentId = '-1' + this.ipagination.current = 1 + this.ipagination.total = 0 + }, + loadData(args) { + if (!this.url.list) { + this.$message.error('璇疯缃畊rl.list灞炴��!') + return + } + if (args === 1) { + this.ipagination.current = 1 + } + // 灏佽鏌ヨ鏉′欢 + let formData = { + pageNo: args, + pageSize: this.ipagination.pageSize, + equipmentId: this.queryParam.equipmentId + } + // 璋冪敤鏌ヨ鏁版嵁鎺ュ彛 + this.confirmLoading = true + getAction(this.url.list, formData).then(res => { + if (res.success) { + // 鍚庡彴鏌ヨ鍥炴潵鐨� total锛屾暟鎹�绘暟閲� + this.dataSource = res.result.records || res.result + if (res.result.total) { + this.ipagination.total = res.result.total + } else { + this.ipagination.total = 0 + } + } else { + this.$message.warning(res.message) + } + }).finally(() => { + // 杩欓噷鏄棤璁烘垚鍔熸垨澶辫触閮戒細鎵ц鐨勬柟娉曪紝鍦ㄨ繖閲屽叧闂璴oading + this.confirmLoading = false + }) + }, + async insertEvent() { + let record = { equipmentId: this.queryParam.equipmentId } + let { row: newRow } = await this.$refs.editableDetailTable.insert(record) + await this.$refs.editableDetailTable.setActiveCell(newRow, 'parameterId') + }, + async saveRowEvent(row) { + let that = this + const errMap = await that.$refs.editableDetailTable.validate().catch(errMap => errMap) + if (errMap) { + that.$message.warning('鏍¢獙涓嶉�氳繃,璇疯ˉ鍏呭繀濉」锛�') + return + } + that.confirmLoading = true + let httpurl = '' + let method = '' + if (!row.id) { + httpurl += that.url.add + method = 'post' + } else { + httpurl += that.url.edit + method = 'put' + } + let res = await httpAction(httpurl, row, method) + if (res.success) { + that.$message.success(res.message) + that.loadData(that.ipagination.current) + await that.$refs.editableDetailTable.clearActived() + } else { + that.$message.warning(res.message) + } + that.confirmLoading = false + }, + handleRemove(row) { + let xTable = this.$refs.editableDetailTable + let that = this + this.$confirm({ + content: `纭瑕佸垹闄ゅ悧锛焋, + onOk: () => { + if (row.id) { + //鍚庣鍒犻櫎 + deleteAction(that.url.delete, { id: row.id }).then((res) => { + if (res.success) { + that.reCalculatePage(1) + that.$message.success(res.message) + that.loadData(that.ipagination.current) + } else { + that.$message.warning(res.message) + } + }) + } else { + //鍓嶇鍒犻櫎 + xTable.remove(row) + } + }, + onCancel: () => { + xTable.setActiveCell(row, 'parameterId') + } + }) + }, + handleBatchRemove() { + let xTable = this.$refs.editableDetailTable + let that = this + let checkboxRecords = xTable.getCheckboxRecords(); + if (checkboxRecords && checkboxRecords.length > 0) { + let ids = checkboxRecords.map(record => record.id); + this.$confirm({ + title: "纭鍒犻櫎", + content: "鏄惁鍒犻櫎閫変腑鏁版嵁?", + onOk: function () { + that.confirmLoading = true; + deleteAction(that.url.deleteBatch, { ids: ids.join(',') }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(checkboxRecords.length) + that.$message.success(res.message); + that.loadData(that.ipagination.current); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }); + } + }); + } else { + that.$message.warning('璇峰厛閫変腑鏁版嵁琛岋紒'); + } + }, + editRowEvent(row) { + this.$refs.editableDetailTable.setActiveRow(row) + }, + cancelRowEvent(row) { + let xTable = this.$refs.editableDetailTable + this.$confirm({ + content: `纭瑕佹斁寮冪紪杈戝悧锛焋, + onOk: () => { + xTable.revertData() + }, + onCancel: () => { + xTable.setActiveCell(row, 'parameterId') + } + }) + }, + hasEditStatus(row) { + const $table = this.$refs.editableDetailTable + if ($table) { + return $table.isActiveByRow(row) + } + return false + }, + reCalculatePage(count) { + //鎬绘暟閲�-count + let total = this.ipagination.total - count + //鑾峰彇鍒犻櫎鍚庣殑鍒嗛〉鏁� + let currentIndex = Math.ceil(total / this.ipagination.pageSize) + //鍒犻櫎鍚庣殑鍒嗛〉鏁�<鎵�鍦ㄥ綋鍓嶉〉 + if (currentIndex < this.ipagination.current) { + this.ipagination.current = currentIndex + } + }, + handlePageChange(current, pageSize) { + this.$set(this.ipagination, 'current', current) + this.$emit('change', { current, pageSize }) + }, + handleShowSizeChange(current, pageSize) { + this.$set(this.ipagination, 'pageSize', pageSize) + this.$emit('change', { current, pageSize }) + }, + } +} +</script> + +<style lang="less" scoped> +</style> \ No newline at end of file diff --git a/src/views/eam/equipment/modules/EamEquipmentProcessList.vue b/src/views/eam/equipment/modules/EamEquipmentProcessList.vue new file mode 100644 index 0000000..398f690 --- /dev/null +++ b/src/views/eam/equipment/modules/EamEquipmentProcessList.vue @@ -0,0 +1,292 @@ +<template> + <a-spin :spinning="confirmLoading"> + <vxe-toolbar> + <template v-slot:buttons> + <vxe-button status="primary" @click="insertEvent()">鏂板</vxe-button> + <vxe-button status="danger" @click="handleBatchRemove()">鎵归噺鍒犻櫎</vxe-button> + </template> + </vxe-toolbar> + <vxe-table + ref="editableDetailTable" + border + resizable + show-overflow + keep-source + :height="300" + :loading="confirmLoading" + :data="dataSource" + :edit-rules="validRules" + :edit-config="{trigger: 'manual', mode: 'row', showStatus: true}" + style="margin-top: 8px;"> + <vxe-table-column type="checkbox" width="60"></vxe-table-column> + <vxe-table-column type="seq" width="60"></vxe-table-column> + <vxe-table-column title="ID" field="id" :visible="false"></vxe-table-column> + <vxe-table-column title="equipmentId" field="equipmentId" :visible="false"></vxe-table-column> + <vxe-table-column title="鍙傛暟鍚嶇О" field="parameterId" align="center" + :edit-render="{name : '$select', options: processParameterList, optionProps: {label:'parameterName', value:'id'}, props: {clearable:true}, events: {change:handleParamSelectChange}}"></vxe-table-column> + <vxe-table-column title="鍙傛暟缂栫爜" field="parameterCode" align="center"></vxe-table-column> + <vxe-table-column title="璁¢噺鍗曚綅" field="parameterUnit" align="center"></vxe-table-column> + <vxe-table-column title="鍙傛暟鑼冨洿" field="parameterPeriod" align="center" + :edit-render="{name : '$input'}"></vxe-table-column> + <vxe-table-column title="鎿嶄綔" width="160"> + <template v-slot="{row}"> + <template v-if="hasEditStatus(row)"> + <vxe-button @click="saveRowEvent(row)">淇濆瓨</vxe-button> + <vxe-button @click="cancelRowEvent(row)">鍙栨秷</vxe-button> + </template> + <template v-else> + <vxe-button @click="editRowEvent(row)">缂栬緫</vxe-button> + <vxe-button @click="handleRemove(row)">鍒犻櫎</vxe-button> + </template> + + </template> + </vxe-table-column> + </vxe-table> + <a-pagination + v-bind="ipagination" + @change="handlePageChange" + @showSizeChange="handleShowSizeChange" + /> + </a-spin> +</template> + +<script> +import { deleteAction, getAction, httpAction } from '@/api/manage' + +export default { + name: 'EamEquipmentProcessModal', + data() { + return { + title: '鎿嶄綔', + confirmLoading: false, + url: { + add: '/eam/equipmentProcessParameters/add', + edit: '/eam/equipmentProcessParameters/edit', + list: '/eam/equipmentProcessParameters/list', + delete: '/eam/equipmentProcessParameters/delete', + deleteBatch: '/eam/equipmentProcessParameters/deleteBatch', + processParamList: '/eam/processParameters/listAll' + }, + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0, + size: 'small' + }, + dataSource: [], + processParameterList: [], + queryParam: { + equipmentId: '-1' + }, + validRules: { + parameterId: [ + { required: true, message: '璇烽�夋嫨鍙傛暟锛�' } + ], + parameterPeriod: [ + { required: true, message: '璇疯緭鍏ュ弬鏁拌寖鍥达紒' } + ] + } + } + }, + created() { + this.loadProcessParameterList() + }, + methods: { + handleParamSelectChange($event, value) { + let parameter = this.processParameterList.find(item => item.id === value.value) + if (parameter) { + $event.row.parameterUnit = parameter.parameterUnit + $event.row.parameterCode = parameter.parameterCode + } else { + $event.row.parameterUnit = undefined + $event.row.parameterCode = undefined + } + }, + loadProcessParameterList() { + getAction(this.url.processParamList).then(res => { + if (res.success) { + this.processParameterList = [...res.result] + } + }) + }, + onClearSelected() { + this.dataSource = [] + this.queryParam.equipmentId = '-1' + this.ipagination.current = 1 + this.ipagination.total = 0 + }, + loadData(args) { + if (!this.url.list) { + this.$message.error('璇疯缃畊rl.list灞炴��!') + return + } + if (args === 1) { + this.ipagination.current = 1 + } + // 灏佽鏌ヨ鏉′欢 + let formData = { + pageNo: args, + pageSize: this.ipagination.pageSize, + equipmentId: this.queryParam.equipmentId + } + // 璋冪敤鏌ヨ鏁版嵁鎺ュ彛 + this.confirmLoading = true + getAction(this.url.list, formData).then(res => { + if (res.success) { + // 鍚庡彴鏌ヨ鍥炴潵鐨� total锛屾暟鎹�绘暟閲� + this.dataSource = res.result.records || res.result + if (res.result.total) { + this.ipagination.total = res.result.total + } else { + this.ipagination.total = 0 + } + } else { + this.$message.warning(res.message) + } + }).finally(() => { + // 杩欓噷鏄棤璁烘垚鍔熸垨澶辫触閮戒細鎵ц鐨勬柟娉曪紝鍦ㄨ繖閲屽叧闂璴oading + this.confirmLoading = false + }) + }, + async insertEvent() { + let record = { equipmentId: this.queryParam.equipmentId } + let { row: newRow } = await this.$refs.editableDetailTable.insert(record) + await this.$refs.editableDetailTable.setActiveCell(newRow, 'parameterId') + }, + async saveRowEvent(row) { + let that = this + const errMap = await that.$refs.editableDetailTable.validate().catch(errMap => errMap) + if (errMap) { + that.$message.warning('鏍¢獙涓嶉�氳繃,璇疯ˉ鍏呭繀濉」锛�') + return + } + that.confirmLoading = true + let httpurl = '' + let method = '' + if (!row.id) { + httpurl += that.url.add + method = 'post' + } else { + httpurl += that.url.edit + method = 'put' + } + let res = await httpAction(httpurl, row, method) + if (res.success) { + that.$message.success(res.message) + that.loadData(that.ipagination.current) + await that.$refs.editableDetailTable.clearActived() + } else { + that.$message.warning(res.message) + } + that.confirmLoading = false + }, + handleRemove(row) { + let xTable = this.$refs.editableDetailTable + let that = this + this.$confirm({ + content: `纭瑕佸垹闄ゅ悧锛焋, + onOk: () => { + if (row.id) { + //鍚庣鍒犻櫎 + deleteAction(that.url.delete, { id: row.id }).then((res) => { + if (res.success) { + that.reCalculatePage(1) + that.$message.success(res.message) + that.loadData(that.ipagination.current) + } else { + that.$message.warning(res.message) + } + }) + } else { + //鍓嶇鍒犻櫎 + xTable.remove(row) + } + }, + onCancel: () => { + xTable.setActiveCell(row, 'parameterId') + } + }) + }, + handleBatchRemove(){ + let xTable = this.$refs.editableDetailTable + let that = this + let checkboxRecords = xTable.getCheckboxRecords(); + if(checkboxRecords && checkboxRecords.length > 0) { + let ids = checkboxRecords.map(record => record.id); + this.$confirm({ + title: "纭鍒犻櫎", + content: "鏄惁鍒犻櫎閫変腑鏁版嵁?", + onOk: function () { + that.confirmLoading = true; + deleteAction(that.url.deleteBatch, {ids: ids.join(',')}).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(checkboxRecords.length) + that.$message.success(res.message); + that.loadData(that.ipagination.current); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }); + } + }); + } else { + that.$message.warning('璇峰厛閫変腑鏁版嵁琛岋紒'); + } + }, + editRowEvent(row) { + this.$refs.editableDetailTable.setActiveRow(row) + }, + cancelRowEvent(row) { + let xTable = this.$refs.editableDetailTable + this.$confirm({ + content: `纭瑕佹斁寮冪紪杈戝悧锛焋, + onOk: () => { + xTable.revertData() + }, + onCancel: () => { + xTable.setActiveCell(row, 'parameterId') + } + }) + }, + hasEditStatus(row) { + const $table = this.$refs.editableDetailTable + if ($table) { + return $table.isActiveByRow(row) + } + return false + }, + reCalculatePage(count) { + //鎬绘暟閲�-count + let total = this.ipagination.total - count + //鑾峰彇鍒犻櫎鍚庣殑鍒嗛〉鏁� + let currentIndex = Math.ceil(total / this.ipagination.pageSize) + //鍒犻櫎鍚庣殑鍒嗛〉鏁�<鎵�鍦ㄥ綋鍓嶉〉 + if (currentIndex < this.ipagination.current) { + this.ipagination.current = currentIndex + } + }, + handlePageChange(current, pageSize){ + this.$set(this.ipagination, 'current', current) + this.$emit('change', {current, pageSize}) + }, + handleShowSizeChange(current, pageSize){ + this.$set(this.ipagination, 'pageSize', pageSize) + this.$emit('change', {current, pageSize}) + }, + } +} +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/equipment/modules/LxSearchEquipmentSelect.vue b/src/views/eam/equipment/modules/LxSearchEquipmentSelect.vue new file mode 100644 index 0000000..f8ccb7e --- /dev/null +++ b/src/views/eam/equipment/modules/LxSearchEquipmentSelect.vue @@ -0,0 +1,168 @@ +<template> + + <a-select + showSearch + labelInValue + :disabled="disabled" + :getPopupContainer="getParentContainer" + @search="loadData" + :placeholder="placeholder" + v-model="selectedAsyncValue" + style="width: 100%" + :filterOption="false" + @change="handleAsyncChange" + allowClear + :notFoundContent="loading ? undefined : null" + mode="default" + > + <template #suffixIcon> + <a-icon type="search" /> + </template> + <a-spin v-if="loading" slot="notFoundContent" size="small" /> + <a-select-option v-for="d in options" :key="d.value" :value="d.value">{{ d.text }}</a-select-option> + </a-select> + +</template> + +<script> +import debounce from 'lodash/debounce' +import { getAction } from '@/api/manage' + +export default { + name: 'LxSearchEquipmentSelect', + props: { + disabled: Boolean, + value: [String, Number], + placeholder: { + type: String, + default: '璇烽�夋嫨', + required: false + }, + pageSize: { + type: Number, + default: 20, + required: false + }, + }, + data() { + this.loadData = debounce(this.loadData, 800)//娑堟姈 + this.lastLoad = 0 + return { + loading: false, + selectedValue: undefined, + selectedAsyncValue: undefined, + options: [] + } + }, + created() { + // this.initDictData() + }, + watch: { + 'value': { + immediate: true, + handler(val) { + if (!val) { + this.selectedValue = undefined; + this.selectedAsyncValue = undefined; + this.initDictData(); + } else { + this.initSelectValue() + } + } + } + }, + methods: { + initSelectValue() { + if(!this.selectedAsyncValue || !this.selectedAsyncValue.key || this.selectedAsyncValue.key!=this.value){ + console.log("杩欐墠璇锋眰鍚庡彴") + getAction(`/eam/equipment/asyncLoadEquipment`, { id: this.value }).then(res=>{ + if(res.success){ + if(res.result && res.result.length > 0){ + let obj = { + key : this.value, + label: res.result[0].text + } + this.selectedAsyncValue = {...obj}; + } + this.options = res.result; + } + }) + } + }, + loadData(value) { + console.log('鏁版嵁鍔犺浇', value) + this.lastLoad += 1 + const currentLoad = this.lastLoad + this.options = [] + this.loading = true + // 瀛楀吀code鏍煎紡锛歵able,text,code + getAction(`/eam/equipment/asyncLoadEquipment`, { keyword: value, pageSize: this.pageSize }).then(res => { + this.loading = false + if (res.success) { + if (currentLoad != this.lastLoad) { + return + } + this.options = res.result + console.log('鎴戞槸绗竴涓�', res) + } else { + this.$message.warning(res.message) + } + + }) + + }, + initDictData() { + //寮傛涓�寮�濮嬩篃鍔犺浇涓�鐐规暟鎹� + this.loading = true + getAction(`/eam/equipment/asyncLoadEquipment`, { pageSize: this.pageSize, keyword: '' }).then(res => { + this.loading = false + if (res.success) { + this.options = [...res.result] + } else { + this.$message.warning(res.message) + } + }) + }, + filterOption(input, option) { + return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + handleAsyncChange(selectedObj) { + //update-begin-author:scott date:20201222 for:銆愭悳绱€�戞悳绱㈡煡璇㈢粍浠讹紝鍒犻櫎鏉′欢锛岄粯璁や笅鎷夎繕鏄笂娆$殑缂撳瓨鏁版嵁锛屼笉濂� JT-191 + if (selectedObj) { + this.selectedAsyncValue = selectedObj + //update-begin---author:wangshuai ---date:20221115 for锛歔issues/4213]JSearchSelectTag鏀归�犳敮鎸佸閫�------------ + this.selectedValue = selectedObj.key + //update-end---author:wangshuai ---date:20221115 for锛歔issues/4213]JSearchSelectTag鏀归�犳敮鎸佸閫�------------ + } else { + this.selectedAsyncValue = undefined + this.selectedValue = undefined + this.options = [] + this.loadData('') + } + this.callback() + //update-end-author:scott date:20201222 for:銆愭悳绱€�戞悳绱㈡煡璇㈢粍浠讹紝鍒犻櫎鏉′欢锛岄粯璁や笅鎷夎繕鏄笂娆$殑缂撳瓨鏁版嵁锛屼笉濂� JT-191 + }, + callback() { + this.$emit('change', this.selectedValue) + }, + getParentContainer(node) { + if (typeof this.getPopupContainer === 'function') { + return this.getPopupContainer(node) + } else if (!this.popContainer) { + return node.parentNode + } else { + return document.querySelector(this.popContainer) + } + } + + }, + model: { + prop: 'value', + event: 'change' + } +} +</script> + +<style scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/equipment/modules/MaintenanceEquipmentSelect.vue b/src/views/eam/equipment/modules/MaintenanceEquipmentSelect.vue new file mode 100644 index 0000000..abc6eba --- /dev/null +++ b/src/views/eam/equipment/modules/MaintenanceEquipmentSelect.vue @@ -0,0 +1,192 @@ +<template> + + <a-select + showSearch + labelInValue + :disabled="disabled" + :getPopupContainer="getParentContainer" + @search="loadData" + :placeholder="placeholder" + v-model="selectedAsyncValue" + style="width: 100%" + :filterOption="false" + @change="handleAsyncChange" + allowClear + :notFoundContent="loading ? undefined : null" + mode="default" + > + <template #suffixIcon> + <a-icon type="search" /> + </template> + <a-spin v-if="loading" slot="notFoundContent" size="small" /> + <a-select-option v-for="d in options" :key="d.equipmentId" :value="d.equipmentId">{{ d.equipmentText }} + </a-select-option> + </a-select> + +</template> + +<script> +import debounce from 'lodash/debounce' +import { getAction } from '@/api/manage' + +export default { + name: 'MaintenanceEquipmentSelect', + props: { + disabled: Boolean, + value: [String, Number], + placeholder: { + type: String, + default: '璇烽�夋嫨', + required: false + }, + pageSize: { + type: Number, + default: 20, + required: false + }, + maintenanceCategory: { + type: String, + default: '', + required: false + } + }, + data() { + this.loadData = debounce(this.loadData, 800)//娑堟姈 + this.lastLoad = 0 + return { + loading: false, + selectedValue: undefined, + selectedAsyncValue: undefined, + options: [] + } + }, + created() { + // this.initDictData() + }, + watch: { + 'value': { + immediate: true, + handler(val) { + if (!val) { + this.selectedValue = undefined; + this.selectedAsyncValue = undefined; + this.initDictData() + } else { + this.initSelectValue() + } + } + } + }, + methods: { + initSelectValue() { + if (!this.selectedAsyncValue || !this.selectedAsyncValue.key || this.selectedAsyncValue.key != this.value || !this.maintenanceCategory) { + console.log('杩欐墠璇锋眰鍚庡彴') + getAction(`/eam/maintenanceStandard/listByUser`, { + equipmentId: this.value, + maintenanceCategory: this.maintenanceCategory + }).then(res => { + if (res.success) { + if (res.result && res.result.length > 0) { + let obj = { + key: this.value, + label: res.result[0].text + } + this.selectedAsyncValue = { ...obj } + this.$emit('autocompleteForm', res.result[0]) + } + this.options = res.result + } + }) + } + }, + loadData(value) { + console.log('鏁版嵁鍔犺浇', value) + this.lastLoad += 1 + const currentLoad = this.lastLoad + this.options = [] + this.loading = true + console.log('ssfs', this.selectedAsyncValue) + console.log('ASGasgsgas', this.maintenanceCategory) + // 瀛楀吀code鏍煎紡锛歵able,text,code + getAction(`/eam/maintenanceStandard/listByUser`, { + keyword: value, + maintenanceCategory: this.maintenanceCategory, + pageSize: this.pageSize + }).then(res => { + this.loading = false + if (res.success) { + if (currentLoad != this.lastLoad) { + return + } + this.options = res.result + console.log('鎴戞槸绗竴涓�', res) + } else { + this.$message.warning(res.message) + } + + }) + + }, + initDictData() { + //寮傛涓�寮�濮嬩篃鍔犺浇涓�鐐规暟鎹� + console.log('fasfasgasgasgfasg') + this.loading = true + getAction(`/eam/maintenanceStandard/listByUser`, { + pageSize: this.pageSize, + keyword: '', + maintenanceCategory: this.maintenanceCategory + }).then(res => { + this.loading = false + if (res.success) { + this.options = [...res.result] + } else { + this.$message.warning(res.message) + } + }) + }, + filterOption(input, option) { + return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + handleAsyncChange(selectedObj) { + console.log('selectedObj', selectedObj) + //update-begin-author:scott date:20201222 for:銆愭悳绱€�戞悳绱㈡煡璇㈢粍浠讹紝鍒犻櫎鏉′欢锛岄粯璁や笅鎷夎繕鏄笂娆$殑缂撳瓨鏁版嵁锛屼笉濂� JT-191 + if (selectedObj) { + this.selectedAsyncValue = selectedObj + //update-begin---author:wangshuai ---date:20221115 for锛歔issues/4213]JSearchSelectTag鏀归�犳敮鎸佸閫�------------ + this.selectedValue = selectedObj.key + this.$emit('autocompleteForm', this.options.find(item => item.equipmentId === selectedObj.key)) + //update-end---author:wangshuai ---date:20221115 for锛歔issues/4213]JSearchSelectTag鏀归�犳敮鎸佸閫�------------ + } else { + this.selectedAsyncValue = undefined + this.selectedValue = null + this.options = [] + this.loadData('') + this.$emit('autocompleteForm', {}) + } + this.callback() + //update-end-author:scott date:20201222 for:銆愭悳绱€�戞悳绱㈡煡璇㈢粍浠讹紝鍒犻櫎鏉′欢锛岄粯璁や笅鎷夎繕鏄笂娆$殑缂撳瓨鏁版嵁锛屼笉濂� JT-191 + }, + callback() { + this.$emit('change', this.selectedValue) + }, + getParentContainer(node) { + if (typeof this.getPopupContainer === 'function') { + return this.getPopupContainer(node) + } else if (!this.popContainer) { + return node.parentNode + } else { + return document.querySelector(this.popContainer) + } + } + + }, + model: { + prop: 'value', + event: 'change' + } +} +</script> + +<style scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/equipment/modules/NameplateModal.vue b/src/views/eam/equipment/modules/NameplateModal.vue new file mode 100644 index 0000000..07c0509 --- /dev/null +++ b/src/views/eam/equipment/modules/NameplateModal.vue @@ -0,0 +1,151 @@ +<template> + <j-modal + title="閾墝" + :width="750" + :visible="visible" + @cancel="handleCancel" + :maskClosable="false" + > + + <div id="nameplateTable"> + <table border="1" cellpadding="12" cellspacing="0" align="center" width="80%" v-for="item in printedRows" + :key="item.id"> + <thead> + <tr> + <th colspan="3">璁惧绠$悊鐗�</th> + </tr> + </thead> + + <tbody> + <tr> + <td rowspan="3" align="center"> + <div style="height: 80%;width: 50%"> + <vue-qrcode :value="httpUrl+item.id" :width="50" :height="50"></vue-qrcode> + </div> + </td> + <td>璁惧缂栧彿</td> + <td>{{ item.equipmentCode }}</td> + </tr> + + <tr> + <td>璁惧鍚嶇О</td> + <td>{{ item.equipmentName }}</td> + </tr> + + <tr> + <td>璁惧鍨嬪彿</td> + <td>{{ item.equipmentModel }}</td> + </tr> + + <tr> + <td>璁惧绠$悊</td> + <td>浣跨敤杞﹂棿</td> + <td>{{ item.orgId_dictText }}</td> + </tr> + + <tr> + <td rowspan="3" align="center"> + <div style="height: 80%;width: 50%"> + <QrcodeVue :value="item.equipmentCode" :size="50"/> + </div> + </td> + <td>鍑哄巶缂栧彿</td> + <td>{{ item.factoryNumber }}</td> + </tr> + + <tr> + <td>璁惧绠$悊鍛�</td> + <td>{{ item.equipmentManager_dictText }}</td> + </tr> + + <tr> + <td>瀹夎浣嶇疆</td> + <td>{{ item.installationPosition }}</td> + </tr> + + <tr> + <td>MES</td> + <td colspan="2" style="color: #f00;font-weight: bold;letter-spacing: 1px">闈炵鐞嗗憳鍕垮姩姝ら摥鐗�</td> + </tr> + </tbody> + </table> + </div> + + <template slot="footer"> + <a-button @click="handleCancel">鍏抽棴</a-button> + <a-button type="primary" v-print="'#nameplateTable'">鎵撳嵃</a-button> + </template> + </j-modal> +</template> + +<script> +import VueQrcode from '@chenfengyuan/vue-qrcode' + + export default { + name: 'NameplateModal', + components: { VueQrcode }, + props: { + printedRows: { + type: Array + } + }, + data() { + return { + title: '閾墝', + visible: false, + httpUrl: '' + } + }, + methods: { + handleCancel() { + this.visible = false + } + } + } +</script> + +<style lang="less" scoped> + /deep/ .ant-modal { + height: 75%; + overflow: hidden; + + .ant-modal-content { + height: 100%; + display: flex; + flex-direction: column; + overflow: hidden; + + ::-webkit-scrollbar { + width: 8px; + height: 8px; + } + + .ant-modal-body { + flex: 1; + overflow: auto; + } + } + } + + table { + font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "寰蒋闆呴粦", Arial, sans-serif; + color: #000; + text-align: center; + + &:not(:last-child) { + margin-bottom: 10px; + } + + th { + font-size: 24px; + letter-spacing: 3px; + padding: 12px; + } + + td { + font-size: 14px; + width: 33%; + padding: 6px; + } + } +</style> \ No newline at end of file diff --git a/src/views/eam/equipment/modules/ResumeDrawer.vue b/src/views/eam/equipment/modules/ResumeDrawer.vue new file mode 100644 index 0000000..7d3547a --- /dev/null +++ b/src/views/eam/equipment/modules/ResumeDrawer.vue @@ -0,0 +1,124 @@ +<template> + <a-drawer :title="title" placement="right" :width="600" :closable="false" :visible="visible" @close="onClose"> + <a-spin :spinning="spinning"> + <a-skeleton :title="false" :paragraph="{ rows: 30}" v-if="spinning&&dataSource.length===0"/> + + <template v-if="dataSource.length>0"> + <a-timeline mode="alternate"> + <a-timeline-item v-for="item in dataSource" :key="item.id"> + <span>鎿嶄綔浜猴細{{item.operator_dictText}}</span><br/> + <span>鎿嶄綔锛歿{item.operationTag_dictText}}</span><br/> + <!--<span>鎻忚堪锛歿{item.description}}</span>--> + <span>鎿嶄綔鏃堕棿锛歿{item.createTime}}</span> + </a-timeline-item> + </a-timeline> + + <div style="text-align: center"> + <a v-if="dataSource.length>0&&pageConfig.pageNo===1&&pageConfig.pageNo!==pageConfig.totalPage" + @click="loadNextPageData"> + 鐐瑰嚮鍔犺浇鏇村 + <a-icon type="down"/> + </a> + + <span v-if="isNoMoreData">- 宸茬粡鍒板簳浜� -</span> + + <a-empty v-if="dataSource.length===0"/> + </div> + </template> + </a-spin> + </a-drawer> +</template> + +<script> + import { getAction } from '@/api/manage' + + export default { + name: 'ResumeDrawer', + props: { + currentTableRowRecord: { + type: Object + } + }, + data() { + return { + title: '璁惧灞ュ巻', + visible: false, + spinning: false, + dataSource: [], + url: { + list: '/eam/equipmentHistoryLog/list' + }, + pageConfig: { + pageNo: 1, + pageSize: 10, + totalPage: 0 + }, + drawerBodyElement: null, + isNoMoreData: false + } + }, + methods: { + getEquipmentResumeByApi(pageNo = 1) { + this.pageConfig.pageNo = pageNo + const params = Object.assign({}, this.pageConfig, { equipmentId: this.currentTableRowRecord.id }) + const that = this + this.spinning = true + getAction(this.url.list, params) + .then(res => { + if (res.success) { + console.log('res.result', res.result) + if (!this.pageConfig.totalPage) this.pageConfig.totalPage = res.result.pages + res.result.records.forEach(item => that.dataSource.push(item)) + if (this.pageConfig.totalPage !== this.pageConfig.pageNo) { + if (res.result.current === 2) { + if (!this.drawerBodyElement) this.drawerBodyElement = document.querySelector('.ant-drawer-body') + this.drawerBodyElement.addEventListener('scroll', this.handleDrawerBodyScroll) + } + } else this.isNoMoreData = true + } + }) + .finally(() => { + that.spinning = false + }) + }, + + // 鍔犺浇涓嬩竴椤垫暟鎹� + loadNextPageData() { + const current = this.pageConfig.pageNo + 1 + this.getEquipmentResumeByApi(current) + }, + + // 鎶藉眽鍏冪礌婊氬姩浜嬩欢 + handleDrawerBodyScroll() { + if (this.pageConfig.totalPage === this.pageConfig.pageNo) return + const { scrollTop, clientHeight, scrollHeight } = this.drawerBodyElement + if (scrollTop + clientHeight + 1 >= scrollHeight) this.loadNextPageData() + }, + + onClose() { + this.visible = false + this.pageConfig.totalPage = 0 + this.isNoMoreData = false + if (this.drawerBodyElement) this.drawerBodyElement.removeEventListener('scroll', this.handleDrawerBodyScroll) + } + } + } +</script> + +<style scoped lang="less"> + /deep/ .ant-drawer-wrapper-body { + overflow: hidden; + display: flex; + flex-direction: column; + + ::-webkit-scrollbar { + width: 8px; + height: 8px; + } + + .ant-drawer-body { + flex: 1; + overflow: auto; + } + } +</style> \ No newline at end of file diff --git a/src/views/eam/maintenance/EamInspectionOrderList.vue b/src/views/eam/maintenance/EamInspectionOrderList.vue new file mode 100644 index 0000000..517b211 --- /dev/null +++ b/src/views/eam/maintenance/EamInspectionOrderList.vue @@ -0,0 +1,517 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div + class="table-page-search-wrapper" + v-if="isDisplayOperation" + > + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="24"> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="宸ュ崟鍙�"> + <a-input + placeholder="璇疯緭鍏ュ伐鍗曞彿" + v-model="queryParam.orderNum" + ></a-input> + </a-form-item> + </a-col> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="璁惧缂栧彿"> + <lx-search-equipment-select + placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" + v-model="queryParam.equipmentId" + ></lx-search-equipment-select> + </a-form-item> + </a-col> + <a-col + :xl="6" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="璁″垝鐐规鏃ユ湡"> + <a-range-picker + v-model="queryParam.inspectionDateRange" + @change="onInspectionDateChange" + format="YYYY-MM-DD" + value-format="YYYY-MM-DD" + /> + </a-form-item> + </a-col> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="鐐规鐘舵��"> + <j-dict-select-tag + placeholder="璇烽�夋嫨鐐规鐘舵��" + dict-code="inspection_status" + v-model="queryParam.inspectionStatus" + /> + </a-form-item> + </a-col> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <span + style="float: left;overflow: hidden;" + class="table-page-search-submitButtons" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + type="info" + @click="searchReset" + icon="reload" + style="margin-left: 8px" + >閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div + class="table-operator" + v-if="isDisplayOperation" + > + <a-button + @click="handleAdd" + type="primary" + icon="plus" + v-if="isShowAuth('eam:inspection:add')" + >鏂板</a-button> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item + key="1" + v-if="isShowAuth('eam:inspection:abolish')" + @click="batchZf('ABOLISH')" + > + <a-icon type="snippets" /> + 浣滃簾 + </a-menu-item> + <a-menu-item + key="2" + v-if="isShowAuth('eam:inspection:collect')" + @click="batchLq('UNDER_INSPECTION')" + > + <a-icon type="form" /> + 棰嗗彇 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down" /> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div + class="ant-alert ant-alert-info" + style="margin-bottom: 16px;" + v-if="isDisplayOperation" + > + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ + selectedRowKeys.length }}</a>椤� + <a + style="margin-left: 24px" + @click="onClearSelected" + >娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + class="j-table-force-nowrap" + @change="handleTableChange" + > + + <span + slot="action" + slot-scope="text, record" + > + <a + @click="handleEdit(record)" + v-if="isShowAuth('eam:inspection:edit') && record.inspectionStatus === 'WAIT_INSPECTION'" + >缂栬緫</a> + + <a-divider + type="vertical" + v-if="isShowAuth('eam:inspection:edit') && record.inspectionStatus === 'WAIT_INSPECTION'" + /> + + <a-popconfirm + title="纭畾棰嗗彇鍚�?" + v-if="isShowAuth('eam:inspection:collect') && record.inspectionStatus === 'WAIT_INSPECTION'" + @confirm="() => handleInspection(record.id)" + > + <a>棰嗗彇</a> + </a-popconfirm> + + <a-divider + type="vertical" + v-if="isShowAuth('eam:inspection:collect') && record.inspectionStatus === 'WAIT_INSPECTION'" + /> + + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item v-if="isShowAuth('eam:inspection:abolish') && record.inspectionStatus === 'WAIT_INSPECTION'"> + <a-popconfirm + title="纭畾浣滃簾鍚�?" + @confirm="() => handleOrReceive(record.id)" + > + <a>浣滃簾</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + + <a-divider + v-if="record.inspectionStatus === 'COMPLETE'" + type="vertical" + /> + <a + v-if="record.inspectionStatus === 'COMPLETE'" + @click="handlePrint(record)" + >鎵撳嵃</a> + </span> + </a-table> + </div> + + <eam-inspection-order-modal + ref="modalForm" + @ok="modalFormOk" + ></eam-inspection-order-modal> + </a-card> +</template> + +<script> + +import '@/assets/less/TableExpand.less' +import { mixinDevice } from '@/utils/mixin' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import EamInspectionOrderModal from './modules/EamInspectionOrderModal' +import { deleteAction, getAction } from '@api/manage' +import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' + +export default { + name: 'EamInspectionOrderList', + mixins: [JeecgListMixin, mixinDevice], + components: { + EamInspectionOrderModal, + LxSearchEquipmentSelect, + }, + props: { + isDisplayOperation: { + type: Boolean, + default: true + } + }, + data() { + return { + description: 'eam_inspection_order绠$悊椤甸潰', + disableMixinCreated: true, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '宸ュ崟鍙�', + align: 'center', + dataIndex: 'orderNum' + }, + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentCode' + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName' + }, + { + title: '鏍囧噯鍚嶇О', + align: 'center', + dataIndex: 'standardId_dictText' + }, + { + title: '鐐规鏃ユ湡', + align: 'center', + dataIndex: 'inspectionDate', + customRender: function (text) { + return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) + } + }, + { + title: '鐐规杩囨湡鏃ユ湡', + align: 'center', + dataIndex: 'expirationTime', + customRender: function (text) { + return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) + } + }, + { + title: '鍒涘缓鏂瑰紡', + align: 'center', + dataIndex: 'creationMethod_dictText' + }, + { + title: '鐐规鐘舵��', + align: 'center', + dataIndex: 'inspectionStatus_dictText' + }, + { + title: '鐐规浜�', + align: 'center', + dataIndex: 'operator_dictText' + }, + { + title: '鐐规鏃堕棿', + align: 'center', + dataIndex: 'operateTime', + }, + { + title: '绠$悊鍛樼‘璁�', + align: 'center', + dataIndex: 'confirmUser_dictText' + }, + { + title: '纭鏃堕棿', + align: 'center', + dataIndex: 'confirmTime', + }, + { + title: '纭鎰忚', + align: 'center', + dataIndex: 'confirmComment', + } + ], + url: { + list: '/eam/eamInspectionOrder/list', + cancelInspectionOrder: '/eam/eamInspectionOrder/cancelInspectionOrder', + deleteBatch: '/eam/eamInspectionOrder/deleteBatch', + exportXlsUrl: '/eam/eamInspectionOrder/exportXls', + importExcelUrl: 'eam/eamInspectionOrder/importExcel', + receiveInspectionOrder: 'eam/eamInspectionOrder/receiveInspectionOrder', + cancelOrReceive: 'eam/eamInspectionOrder/cancelOrReceive' + }, + dictOptions: {}, + superFieldList: [], + selectInspectionOrderXqData: {} + } + }, + created() { + if (!this.isDisplayOperation) { + return + } + const operationColumn = { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + fixed: 'right', + width: 200, + scopedSlots: { customRender: 'action' } + } + this.columns = [...this.columns, operationColumn] + this.loadData(1) + }, + computed: { + importExcelUrl: function () { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` + } + }, + methods: { + initDictConfig() { + }, + //璇︽儏 + handleDetail: function (record) { + this.selectInspectionOrderXqData = Object.assign({}, record) + this.$refs.modalFormXq.visible = true + this.$refs.modalFormXq.title = '璇︽儏' + this.$refs.modalFormXq.disableSubmit = true + this.$refs.modalFormXq.getAllApproveData(record) + this.$refs.modalFormXq.getBasicInformation({ ...record, dataId: record.id }) + }, + handleInspection(id) { + if (!this.url.receiveInspectionOrder) { + this.$message.error('璇疯缃畊rl.receiveInspectionOrder!') + return + } + var that = this + getAction(that.url.receiveInspectionOrder, { id: id }).then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + }, + handleOrReceive(id) { + if (!this.url.cancelInspectionOrder) { + this.$message.error('璇疯缃畊rl.cancelInspectionOrder!') + return + } + var that = this + getAction(that.url.cancelInspectionOrder, { id: id }).then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + }, + batchZf(type) { + if (this.selectedRowKeys.length <= 0) { + this.$notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�' + }) + } else { + var ids = '' + for (var a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' + } + var that = this + this.$confirm({ + title: '纭浣滃簾', + content: '鏄惁浣滃簾閫変腑鏁版嵁锛屽彧鏈夊緟鐐规鐘舵�佺殑鏁版嵁鎵嶅彲浣滃簾鎴愬姛?', + onOk: function () { + that.loading = true + getAction(that.url.cancelOrReceive, { ids: ids, type: type }).then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + that.onClearSelected() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.loading = false + }) + } + }) + } + }, + batchLq(type) { + if (this.selectedRowKeys.length <= 0) { + this.$notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�' + }) + } else { + var ids = '' + for (var a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' + } + var that = this + this.$confirm({ + title: '纭棰嗗彇', + content: '鏄惁棰嗗彇閫変腑鏁版嵁锛屽彧鏈夊緟鐐规鐘舵�佺殑鏁版嵁鎵嶅彲棰嗗彇鎴愬姛?', + onOk: function () { + that.loading = true + getAction(that.url.cancelOrReceive, { ids: ids, type: type }).then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + that.onClearSelected() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.loading = false + }) + } + }) + } + }, + onInspectionDateChange: function (value, dateString) { + this.queryParam.inspectionDateBegin = dateString[0] + this.queryParam.inspectionDateEnd = dateString[1] + }, + + handlePrint(record) { + let href = `${window._CONFIG['domianURL']}/jmreport/view/1094871242505912320?id=` + record.id + `&equipmentId=` + record.equipmentId + `&inspectionDate=` + record.inspectionDate; //缃戠珯閾炬帴 + window.open(href, "_blank"); + }, + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/maintenance/EamPrecisionCheckDetailList.vue b/src/views/eam/maintenance/EamPrecisionCheckDetailList.vue new file mode 100644 index 0000000..ea24483 --- /dev/null +++ b/src/views/eam/maintenance/EamPrecisionCheckDetailList.vue @@ -0,0 +1,170 @@ +<template> + <a-card :bordered="false"> + + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鍒犻櫎鏍囪"> + <a-input placeholder="璇疯緭鍏ュ垹闄ゆ爣璁�" v-model="queryParam.delFlag"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="璁惧鍙傛暟id"> + <a-input placeholder="璇疯緭鍏ヨ澶囧弬鏁癷d" v-model="queryParam.equipmentPrecisionId"></a-input> + </a-form-item> + </a-col> + <template v-if="toggleSearchStatus"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="瀹炴祴鍊�"> + <a-input placeholder="璇疯緭鍏ュ疄娴嬪��" v-model="queryParam.actualValue"></a-input> + </a-form-item> + </a-col> + </template> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + <a @click="handleToggleSearch" style="margin-left: 8px"> + {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }} + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> + </a> + </span> + </a-col> + + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-button type="primary" icon="download" @click="handleExportXls('璁惧绮惧害妫�娴嬫槑缁�')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>鍒犻櫎</a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange"> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <eamPrecisionCheckDetail-modal ref="modalForm" @ok="modalFormOk"></eamPrecisionCheckDetail-modal> + </a-card> +</template> + +<script> + import '@/assets/less/TableExpand.less' + import EamPrecisionCheckDetailModal from './modules/EamPrecisionCheckDetailModal' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + + export default { + name: "EamPrecisionCheckDetailList", + mixins:[JeecgListMixin], + components: { + EamPrecisionCheckDetailModal + }, + data () { + return { + description: '璁惧绮惧害妫�娴嬫槑缁嗙鐞嗛〉闈�', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title: '鍒犻櫎鏍囪', + align:"center", + dataIndex: 'delFlag' + }, + { + title: '璁惧鍙傛暟id', + align:"center", + dataIndex: 'equipmentPrecisionId' + }, + { + title: '瀹炴祴鍊�', + align:"center", + dataIndex: 'actualValue' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + scopedSlots: { customRender: 'action' }, + } + ], + url: { + list: "/eam/eamPrecisionCheckDetail/list", + delete: "/eam/eamPrecisionCheckDetail/delete", + deleteBatch: "/eam/eamPrecisionCheckDetail/deleteBatch", + exportXlsUrl: "eam/eamPrecisionCheckDetail/exportXls", + importExcelUrl: "eam/eamPrecisionCheckDetail/importExcel", + }, + } + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + } + }, + methods: { + + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue b/src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue new file mode 100644 index 0000000..6c8b5d7 --- /dev/null +++ b/src/views/eam/maintenance/EamSecondMaintenanceOrderList.vue @@ -0,0 +1,556 @@ +<template> + <a-card :bordered="false"> + + <!-- 鏌ヨ鍖哄煙 --> + <div + class="table-page-search-wrapper" + v-if="isDisplayOperation" + > + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="24"> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="宸ュ崟鍙�"> + <a-input + placeholder="璇疯緭鍏ュ伐鍗曞彿" + v-model="queryParam.orderNum" + ></a-input> + </a-form-item> + </a-col> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="璁惧缂栧彿"> + <lx-search-equipment-select + placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" + v-model="queryParam.equipmentId" + ></lx-search-equipment-select> + </a-form-item> + </a-col> + <a-col + :xl="6" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="璁″垝淇濆吇鏃ユ湡"> + <a-range-picker + v-model="queryParam.maintenanceDateRange" + @change="onMaintenanceDateChange" + format="YYYY-MM-DD" + value-format="YYYY-MM-DD" + /> + </a-form-item> + </a-col> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="淇濆吇鐘舵��"> + <j-dict-select-tag + placeholder="璇烽�夋嫨淇濆吇鐘舵��" + dict-code="second_maintenance_status" + v-model="queryParam.maintenanceStatus" + /> + </a-form-item> + </a-col> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <span + style="float: left;overflow: hidden;" + class="table-page-search-submitButtons" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + type="info" + @click="searchReset" + icon="reload" + style="margin-left: 8px" + >閲嶇疆</a-button> + </span> + </a-col> + + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div + class="table-operator" + v-if="isDisplayOperation" + > + <a-button + @click="handleAdd" + type="primary" + icon="plus" + v-if="isShowAuth('eam:secondMaintenance:add')" + >鏂板 + </a-button> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item + key="1" + @click="handlerBatchAbolish" + v-if="isShowAuth('eam:secondMaintenance:abolish')" + > + <a-icon type="delete" /> + 浣滃簾 + </a-menu-item> + <a-menu-item + key="2" + @click="handlerBatchCollect" + v-if="isShowAuth('eam:secondMaintenance:collect')" + > + <a-icon type="form" /> + 棰嗗彇 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down" /> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div + class="ant-alert ant-alert-info" + style="margin-bottom: 16px;" + v-if="isDisplayOperation" + > + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a + style="margin-left: 24px" + @click="onClearSelected" + >娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + :scroll="{x:'max-content'}" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange" + > + + <span + slot="action" + slot-scope="text, record" + > + <template v-if="record.maintenanceStatus === 'WAIT_MAINTENANCE'"> + <a + @click="handleEdit(record)" + v-if="isShowAuth('eam:secondMaintenance:edit')" + >缂栬緫</a> + + <a-divider + type="vertical" + v-if="isShowAuth('eam:secondMaintenance:edit')" + /> + + <a-popconfirm + title="纭畾棰嗗彇鍚�?" + @confirm="() => handlerCollect(record.id)" + v-if="isShowAuth('eam:secondMaintenance:collect')" + > + <a>棰嗗彇</a> + </a-popconfirm> + + <a-divider + type="vertical" + v-if="isShowAuth('eam:secondMaintenance:collect')" + /> + + </template> + + <template v-else> + <a @click="handleDetail(record)">璇︽儏</a> + <a-divider + type="vertical" + v-if="record.maintenanceStatus === 'COMPLETE'" + /> + <a + v-if="record.maintenanceStatus === 'COMPLETE'" + @click="handlePrint(record)" + >鎵撳嵃</a> + </template> + + </span> + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <eamSecondMaintenanceOrder-modal + ref="modalForm" + @ok="modalFormOk" + ></eamSecondMaintenanceOrder-modal> + </a-card> +</template> + +<script> +import '@/assets/less/TableExpand.less' +import EamSecondMaintenanceOrderModal from './modules/EamSecondMaintenanceOrderModal' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' +import { deleteAction, getAction } from '@api/manage' + + +export default { + name: 'EamSecondMaintenanceOrderList', + mixins: [JeecgListMixin], + components: { + LxSearchEquipmentSelect, + EamSecondMaintenanceOrderModal, + }, + props: { + isDisplayOperation: { + type: Boolean, + default: true + } + }, + data() { + return { + description: '璁惧浜岀骇淇濆吇绠$悊椤甸潰', + disableMixinCreated: true, + selectSecondMaintenanceData: {}, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + fixed: 'left', + customRender: function (t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '宸ュ崟鍙�', + align: 'center', + dataIndex: 'orderNum', + fixed: 'left', + width: 60 + }, + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentCode', + fixed: 'left', + width: 60 + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName', + fixed: 'left', + width: 60 + }, + { + title: '鏍囧噯鍚嶇О', + align: 'center', + dataIndex: 'standardId_dictText' + }, + { + title: '璁″垝淇濆吇鏃ユ湡', + align: 'center', + dataIndex: 'maintenanceDate' + }, + { + title: '瀹為檯寮�濮嬫椂闂�', + align: 'center', + dataIndex: 'actualStartTime' + }, + { + title: '瀹為檯缁撴潫鏃堕棿', + align: 'center', + dataIndex: 'actualEndTime' + }, + { + title: '淇濆吇浜�', + align: 'center', + dataIndex: 'operator_dictText' + }, + { + title: '淇濆吇鐘舵��', + align: 'center', + dataIndex: 'maintenanceStatus_dictText' + }, + { + title: '鍒涘缓鏂瑰紡', + align: 'center', + dataIndex: 'creationMethod_dictText' + }, + { + title: '纭绠$悊鍛�', + align: 'center', + dataIndex: 'confirmUser_dictText', + width: 60 + }, + { + title: '绠$悊鍛樼‘璁ゆ椂闂�', + align: 'center', + dataIndex: 'confirmTime', + width: 60 + }, + { + title: '绠$悊鍛樻剰瑙�', + align: 'center', + dataIndex: 'confirmComment', + width: 60 + }, + { + title: '纭棰嗗', + align: 'center', + dataIndex: 'confirmLeader_dictText', + width: 60 + }, + { + title: '棰嗗纭鏃堕棿', + align: 'center', + dataIndex: 'leaderConfirmTime', + width: 60 + }, + { + title: '棰嗗鎰忚', + align: 'center', + dataIndex: 'leaderConfirmComment', + width: 60 + }, + { + title: '澶囨敞', + align: 'center', + dataIndex: 'remark' + } + ], + url: { + list: '/eam/secondMaintenanceOrder/list', + abolish: '/eam/secondMaintenanceOrder/abolish', + abolishBatch: '/eam/secondMaintenanceOrder/abolishBatch', + collect: '/eam/secondMaintenanceOrder/collect', + collectBatch: '/eam/secondMaintenanceOrder/collectBatch' + } + } + }, + created() { + if (!this.isDisplayOperation) { + return + } + const operationColumn = { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + fixed: 'right', + width: 200, + scopedSlots: { customRender: 'action' } + } + this.columns = [...this.columns, operationColumn] + this.loadData(1) + }, + computed: {}, + methods: { + onMaintenanceDateChange: function (value, dateString) { + if (dateString && dateString.length === 2) { + this.queryParam.maintenanceDateBegin = dateString[0] + this.queryParam.maintenanceDateEnd = dateString[1] + } else { + this.queryParam.maintenanceDateBegin = undefined + this.queryParam.maintenanceDateEnd = undefined + } + }, + handlerAbolish(id) { + if (!this.url.abolish) { + this.$message.error('璇疯缃畊rl.abolish灞炴��!') + return + } + var that = this + deleteAction(that.url.abolish, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + }, + handlerBatchAbolish() { + if (!this.url.abolishBatch) { + this.$message.error('璇疯缃畊rl.abolishBatch灞炴��!') + return + } + if (this.selectedRowKeys.length <= 0) { + // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒'); + this.$notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�' + }) + return + } else { + var ids = '' + for (var a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' + } + var that = this + this.$confirm({ + title: '纭浣滃簾', + content: '鏄惁浣滃簾閫変腑鏁版嵁锛屽彧鏈夊緟淇濆吇鐘舵�佺殑鏁版嵁鎵嶅彲浣滃簾鎴愬姛?', + onOk: function () { + that.loading = true + deleteAction(that.url.abolishBatch, { ids: ids }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(that.selectedRowKeys.length) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + that.onClearSelected() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.loading = false + }) + } + }) + } + }, + //鍗曚釜棰嗗彇 + handlerCollect(id) { + if (!this.url.collect) { + this.$message.error('璇疯缃畊rl.collect灞炴��!') + return + } + let that = this + getAction(that.url.collect, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + }, + //鎵归噺棰嗗彇 + handlerBatchCollect() { + if (!this.url.collectBatch) { + this.$message.error('璇疯缃畊rl.abolishBatch灞炴��!') + return + } + if (this.selectedRowKeys.length <= 0) { + // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒'); + this.$notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�' + }) + return + } else { + var ids = '' + for (var a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' + } + var that = this + this.$confirm({ + title: '纭棰嗗彇', + content: '鏄惁棰嗗彇閫変腑鏁版嵁锛屽彧鏈夊緟淇濆吇鐘舵�佺殑鏁版嵁鎵嶅彲棰嗗彇鎴愬姛?', + onOk: function () { + that.loading = true + deleteAction(that.url.collectBatch, { ids: ids }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(that.selectedRowKeys.length) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + that.onClearSelected() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.loading = false + }) + } + }) + } + }, + handleDetail(record) { + this.selectSecondMaintenanceData = Object.assign({}, record) + this.$refs.secondMaintenanceApprovalModal.recordDetail(record) + this.$refs.secondMaintenanceApprovalModal.title = '璇︽儏' + this.$refs.secondMaintenanceApprovalModal.disableSubmit = true + }, + + handlePrint(record) { + // let href = `${window._CONFIG['domianURL']}/jmreport/view/1094871242505912320`; //缃戠珯閾炬帴 + let href = `${window._CONFIG['domianURL']}/jmreport/view/1094834721929232384?id=` + record.id; //缃戠珯閾炬帴 + window.open(href, "_blank"); + }, + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/maintenance/EamThirdMaintenanceOrderList.vue b/src/views/eam/maintenance/EamThirdMaintenanceOrderList.vue new file mode 100644 index 0000000..572d424 --- /dev/null +++ b/src/views/eam/maintenance/EamThirdMaintenanceOrderList.vue @@ -0,0 +1,583 @@ +<template> + <a-card :bordered="false"> + + <!-- 鏌ヨ鍖哄煙 --> + <div + class="table-page-search-wrapper" + v-if="isDisplayOperation" + > + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="24"> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="宸ュ崟鍙�"> + <a-input + placeholder="璇疯緭鍏ュ伐鍗曞彿" + v-model="queryParam.orderNum" + ></a-input> + </a-form-item> + </a-col> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="璁惧缂栧彿"> + <lx-search-equipment-select + placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" + v-model="queryParam.equipmentId" + ></lx-search-equipment-select> + </a-form-item> + </a-col> + <a-col + :xl="6" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="璁″垝淇濆吇鏃ユ湡"> + <a-range-picker + v-model="queryParam.maintenanceDateRange" + @change="onMaintenanceDateChange" + format="YYYY-MM-DD" + value-format="YYYY-MM-DD" + /> + </a-form-item> + </a-col> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <a-form-item label="淇濆吇鐘舵��"> + <j-dict-select-tag + placeholder="璇烽�夋嫨淇濆吇鐘舵��" + dict-code="second_maintenance_status" + v-model="queryParam.maintenanceStatus" + /> + </a-form-item> + </a-col> + <a-col + :xl="4" + :lg="7" + :md="8" + :sm="24" + > + <span + style="float: left;overflow: hidden;" + class="table-page-search-submitButtons" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + type="info" + @click="searchReset" + icon="reload" + style="margin-left: 8px" + >閲嶇疆</a-button> + </span> + </a-col> + + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div + class="table-operator" + v-if="isDisplayOperation" + > + <a-button + @click="handleAdd" + type="primary" + icon="plus" + v-if="isShowAuth('eam:secondMaintenance:add')" + >鏂板 + </a-button> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item + key="1" + @click="handlerBatchAbolish" + v-if="isShowAuth('eam:secondMaintenance:abolish')" + > + <a-icon type="delete" /> + 浣滃簾 + </a-menu-item> + <a-menu-item + key="2" + @click="handlerBatchCollect" + v-if="isShowAuth('eam:secondMaintenance:collect')" + > + <a-icon type="form" /> + 棰嗗彇 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down" /> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div + class="ant-alert ant-alert-info" + style="margin-bottom: 16px;" + v-if="isDisplayOperation" + > + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a + style="margin-left: 24px" + @click="onClearSelected" + >娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + :scroll="{x:'max-content'}" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange" + > + + <span + slot="action" + slot-scope="text, record" + > + <template v-if="record.maintenanceStatus === 'WAIT_MAINTENANCE'"> + <a + @click="handleEdit(record)" + v-if="isShowAuth('eam:thirdMaintenance:edit')" + >缂栬緫</a> + + <a-divider + type="vertical" + v-if="isShowAuth('eam:thirdMaintenance:edit')" + /> + + <a-popconfirm + title="纭畾棰嗗彇鍚�?" + @confirm="() => handlerCollect(record.id)" + v-if="isShowAuth('eam:thirdMaintenance:collect')" + > + <a>棰嗗彇</a> + </a-popconfirm> + + <a-divider + type="vertical" + v-if="isShowAuth('eam:thirdMaintenance:collect')" + /> + + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item v-if="isShowAuth('eam:thirdMaintenance:abolish')"> + <a-popconfirm + title="纭畾浣滃簾鍚�?" + @confirm="() => handlerAbolish(record.id)" + > + <a>浣滃簾</a> + </a-popconfirm> + </a-menu-item> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + </a-menu> + </a-dropdown> + </template> + + <template v-else> + <a @click="handleDetail(record)">璇︽儏</a> + </template> + + <a-divider + v-if="record.maintenanceStatus === 'COMPLETE'" + type="vertical" + /> + <a + v-if="record.maintenanceStatus === 'COMPLETE'" + @click="handlePrint(record)" + >鎵撳嵃</a> + </span> + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <eamThirdMaintenanceOrder-modal + ref="modalForm" + @ok="modalFormOk" + ></eamThirdMaintenanceOrder-modal> + </a-card> +</template> + +<script> +import '@/assets/less/TableExpand.less' +import EamThirdMaintenanceOrderModal from './modules/EamThirdMaintenanceOrderModal' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' +import { deleteAction, getAction } from '@api/manage' + + +export default { + name: 'EamThirdMaintenanceOrderList', + mixins: [JeecgListMixin], + components: { + LxSearchEquipmentSelect, + EamThirdMaintenanceOrderModal + + }, + props: { + isDisplayOperation: { + type: Boolean, + default: true + } + }, + data() { + return { + description: '璁惧涓夌骇淇濆吇绠$悊椤甸潰', + disableMixinCreated: true, + selectThirdMaintenanceData: {}, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + fixed: 'left', + customRender: function (t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '宸ュ崟鍙�', + align: 'center', + dataIndex: 'orderNum', + fixed: 'left', + width: 60 + }, + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentCode', + fixed: 'left', + width: 60 + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName', + fixed: 'left', + width: 60 + }, + { + title: '鏍囧噯鍚嶇О', + align: 'center', + dataIndex: 'standardId_dictText' + }, + { + title: '璁″垝淇濆吇鏃ユ湡', + align: 'center', + dataIndex: 'maintenanceDate' + }, + { + title: '瀹為檯寮�濮嬫椂闂�', + align: 'center', + dataIndex: 'actualStartTime' + }, + { + title: '瀹為檯缁撴潫鏃堕棿', + align: 'center', + dataIndex: 'actualEndTime' + }, + { + title: '淇濆吇浜�', + align: 'center', + dataIndex: 'operator_dictText' + }, + { + title: '绮惧害妫�楠屼汉', + align: 'center', + dataIndex: 'precisionChecker_dictText' + }, + { + title: '绮惧害妫�楠屾椂闂�', + align: 'center', + dataIndex: 'precisionCheckTime' + }, + { + title: '淇濆吇鐘舵��', + align: 'center', + dataIndex: 'maintenanceStatus_dictText' + }, + { + title: '鍒涘缓鏂瑰紡', + align: 'center', + dataIndex: 'creationMethod_dictText' + }, + { + title: '鏈哄姩鍔炵‘璁�', + align: 'center', + dataIndex: 'confirmUser_dictText', + width: 60 + }, + { + title: '鏈哄姩鍔炵‘璁ゆ椂闂�', + align: 'center', + dataIndex: 'confirmTime', + width: 60 + }, + { + title: '鏈哄姩鍔炴剰瑙�', + align: 'center', + dataIndex: 'confirmComment', + width: 60 + }, + { + title: '纭棰嗗', + align: 'center', + dataIndex: 'confirmLeader_dictText', + width: 60 + }, + { + title: '棰嗗纭鏃堕棿', + align: 'center', + dataIndex: 'leaderConfirmTime', + width: 60 + }, + { + title: '棰嗗鎰忚', + align: 'center', + dataIndex: 'leaderConfirmComment', + width: 60 + }, + { + title: '澶囨敞', + align: 'center', + dataIndex: 'remark' + } + ], + url: { + list: '/eam/thirdMaintenanceOrder/list', + abolish: '/eam/thirdMaintenanceOrder/abolish', + abolishBatch: '/eam/thirdMaintenanceOrder/abolishBatch', + collect: '/eam/thirdMaintenanceOrder/collect', + collectBatch: '/eam/thirdMaintenanceOrder/collectBatch' + } + } + }, + created() { + if (!this.isDisplayOperation) { + return + } + const operationColumn = { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + fixed: 'right', + width: 200, + scopedSlots: { customRender: 'action' } + } + this.columns = [...this.columns, operationColumn] + this.loadData(1) + }, + computed: {}, + methods: { + onMaintenanceDateChange: function (value, dateString) { + if (dateString && dateString.length === 2) { + this.queryParam.maintenanceDateBegin = dateString[0] + this.queryParam.maintenanceDateEnd = dateString[1] + } else { + this.queryParam.maintenanceDateBegin = undefined + this.queryParam.maintenanceDateEnd = undefined + } + }, + handlerAbolish(id) { + if (!this.url.abolish) { + this.$message.error('璇疯缃畊rl.abolish灞炴��!') + return + } + var that = this + deleteAction(that.url.abolish, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + }, + handlerBatchAbolish() { + if (!this.url.abolishBatch) { + this.$message.error('璇疯缃畊rl.abolishBatch灞炴��!') + return + } + if (this.selectedRowKeys.length <= 0) { + // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒'); + this.$notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�' + }) + return + } else { + var ids = '' + for (var a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' + } + var that = this + this.$confirm({ + title: '纭浣滃簾', + content: '鏄惁浣滃簾閫変腑鏁版嵁锛屽彧鏈夊緟淇濆吇鐘舵�佺殑鏁版嵁鎵嶅彲浣滃簾鎴愬姛?', + onOk: function () { + that.loading = true + deleteAction(that.url.abolishBatch, { ids: ids }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(that.selectedRowKeys.length) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + that.onClearSelected() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.loading = false + }) + } + }) + } + }, + //鍗曚釜棰嗗彇 + handlerCollect(id) { + if (!this.url.collect) { + this.$message.error('璇疯缃畊rl.collect灞炴��!') + return + } + let that = this + getAction(that.url.collect, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + }, + //鎵归噺棰嗗彇 + handlerBatchCollect() { + if (!this.url.collectBatch) { + this.$message.error('璇疯缃畊rl.abolishBatch灞炴��!') + return + } + if (this.selectedRowKeys.length <= 0) { + // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒'); + this.$notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�' + }) + return + } else { + var ids = '' + for (var a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' + } + var that = this + this.$confirm({ + title: '纭棰嗗彇', + content: '鏄惁棰嗗彇閫変腑鏁版嵁锛屽彧鏈夊緟淇濆吇鐘舵�佺殑鏁版嵁鎵嶅彲棰嗗彇鎴愬姛?', + onOk: function () { + that.loading = true + deleteAction(that.url.collectBatch, { ids: ids }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(that.selectedRowKeys.length) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + that.onClearSelected() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.loading = false + }) + } + }) + } + }, + handleDetail(record) { + this.selectThirdMaintenanceData = Object.assign({}, record) + this.$refs.thirdMaintenanceApprovalModal.recordDetail(record) + this.$refs.thirdMaintenanceApprovalModal.title = '璇︽儏' + this.$refs.thirdMaintenanceApprovalModal.disableSubmit = true + }, + + handlePrint(record) { + let href = `${window._CONFIG['domianURL']}/jmreport/view/1094880052100399104?id=` + record.id; + // + `&orderId=` + record.id; //缃戠珯閾炬帴 + window.open(href, "_blank"); + }, + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/maintenance/EamWeekMaintenanceOrderList.vue b/src/views/eam/maintenance/EamWeekMaintenanceOrderList.vue new file mode 100644 index 0000000..c5642fe --- /dev/null +++ b/src/views/eam/maintenance/EamWeekMaintenanceOrderList.vue @@ -0,0 +1,489 @@ +<template> + <a-card :bordered="false"> + + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper" v-if="isDisplayOperation"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :xl="4" :lg="7" :md="8" :sm="24"> + <a-form-item label="宸ュ崟鍙�"> + <a-input placeholder="璇疯緭鍏ュ伐鍗曞彿" v-model="queryParam.orderNum"></a-input> + </a-form-item> + </a-col> + <a-col :xl="4" :lg="7" :md="8" :sm="24"> + <a-form-item label="璁惧缂栧彿"> + <lx-search-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" + v-model="queryParam.equipmentId"></lx-search-equipment-select> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="璁″垝淇濆吇鏃ユ湡"> + <a-range-picker v-model="queryParam.maintenanceDateRange" @change="onMaintenanceDateChange" + format="YYYY-MM-DD" value-format="YYYY-MM-DD"/> + </a-form-item> + </a-col> + <a-col :xl="4" :lg="7" :md="8" :sm="24"> + <a-form-item label="淇濆吇鐘舵��"> + <j-dict-select-tag placeholder="璇烽�夋嫨淇濆吇鐘舵��" dict-code="week_maintenance_status" + v-model="queryParam.maintenanceStatus"/> + </a-form-item> + </a-col> + <a-col :xl="4" :lg="7" :md="8" :sm="24"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </span> + </a-col> + + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator" v-if="isDisplayOperation"> + <a-button @click="handleAdd" type="primary" icon="plus" v-if="isShowAuth('eam:weekMaintenance:add')">鏂板</a-button> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="handlerBatchAbolish" v-if="isShowAuth('eam:weekMaintenance:abolish')"> + <a-icon type="delete"/> + 浣滃簾 + </a-menu-item> + <a-menu-item key="2" @click="handlerBatchCollect" v-if="isShowAuth('eam:weekMaintenance:collect')"> + <a-icon type="form"/> + 棰嗗彇 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down"/> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;" v-if="isDisplayOperation"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a + style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + :scroll="{x:'max-content'}" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange"> + + <span slot="action" slot-scope="text, record"> + <template v-if="record.maintenanceStatus === 'WAIT_MAINTENANCE' && isShowAuth('eam:weekMaintenance:edit')"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical"/> + + <a-popconfirm title="纭畾棰嗗彇鍚�?" @confirm="() => handlerCollect(record.id)"> + <a>棰嗗彇</a> + </a-popconfirm> + + <a-divider type="vertical"/> + + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down"/></a> + <a-menu slot="overlay"> + <a-menu-item> + <a-popconfirm title="纭畾浣滃簾鍚�?" @confirm="() => handlerAbolish(record.id)"> + <a>浣滃簾</a> + </a-popconfirm> + </a-menu-item> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + </a-menu> + </a-dropdown> + </template> + + <template v-else> + <a @click="handleDetail(record)">璇︽儏</a> + </template> + </span> + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <eamWeekMaintenanceOrder-modal ref="modalForm" @ok="modalFormOk"></eamWeekMaintenanceOrder-modal> + </a-card> +</template> + +<script> + import '@/assets/less/TableExpand.less' + import EamWeekMaintenanceOrderModal from './modules/EamWeekMaintenanceOrderModal' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' + import { deleteAction, getAction } from '@api/manage' + + + export default { + name: 'EamWeekMaintenanceOrderList', + mixins: [JeecgListMixin], + components: { + LxSearchEquipmentSelect, + EamWeekMaintenanceOrderModal + }, + props: { + isDisplayOperation: { + type: Boolean, + default: true + } + }, + data() { + return { + description: '鍛ㄤ繚宸ュ崟绠$悊椤甸潰', + disableMixinCreated: true, + selectWeekMaintenanceData: {}, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + fixed: 'left', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '宸ュ崟鍙�', + align: 'center', + dataIndex: 'orderNum', + fixed: 'left', + width: 60 + }, + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentCode', + fixed: 'left', + width: 60 + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName', + fixed: 'left', + width: 60 + }, + { + title: '鏍囧噯鍚嶇О', + align: 'center', + dataIndex: 'standardId_dictText', + width: 100 + }, + { + title: '璁″垝淇濆吇鏃ユ湡', + align: 'center', + dataIndex: 'maintenanceDate', + width: 60 + }, + { + title: '瀹為檯寮�濮嬫椂闂�', + align: 'center', + dataIndex: 'actualStartTime', + width: 60 + }, + { + title: '瀹為檯缁撴潫鏃堕棿', + align: 'center', + dataIndex: 'actualEndTime', + width: 60 + }, + { + title: '淇濆吇浜�', + align: 'center', + dataIndex: 'operator_dictText', + width: 60 + }, + { + title: '淇濆吇鐘舵��', + align: 'center', + dataIndex: 'maintenanceStatus_dictText', + width: 60 + }, + { + title: '鍒涘缓鏂瑰紡', + align: 'center', + dataIndex: 'creationMethod_dictText', + width: 60 + }, + { + title: '纭浜�', + align: 'center', + dataIndex: 'confirmUser_dictText', + width: 60 + }, + { + title: '纭鏃堕棿', + align: 'center', + dataIndex: 'confirmTime', + width: 60 + }, + { + title: '纭鎰忚', + align: 'center', + dataIndex: 'confirmComment', + width: 60 + }, + { + title: '鍒濋獙鏀朵汉', + align: 'center', + dataIndex: 'initialAcceptanceUser_dictText', + width: 60 + }, + { + title: '鍒濋獙鏀舵椂闂�', + align: 'center', + dataIndex: 'initialAcceptanceTime', + width: 60 + }, + { + title: '鍒濋獙鏀舵剰瑙�', + align: 'center', + dataIndex: 'initialAcceptanceComment', + width: 60 + }, + { + title: '缁堥獙鏀朵汉', + align: 'center', + dataIndex: 'finalAcceptanceUser_dictText', + width: 60 + }, + { + title: '缁堥獙鏀舵椂闂�', + align: 'center', + dataIndex: 'finalAcceptanceTime', + width: 60 + }, + { + title: '缁堥獙鏀舵剰瑙�', + align: 'center', + dataIndex: 'finalAcceptanceComment', + width: 60 + }, + { + title: '澶囨敞', + align: 'center', + dataIndex: 'remark', + width: 60 + } + // { + // title: '鎿嶄綔', + // dataIndex: 'action', + // align: 'center', + // fixed: 'right', + // width: 100, + // scopedSlots: { customRender: 'action' } + // } + ], + url: { + list: '/eam/weekMaintenanceOrder/list', + abolish: '/eam/weekMaintenanceOrder/abolish', + abolishBatch: '/eam/weekMaintenanceOrder/abolishBatch', + collect: '/eam/weekMaintenanceOrder/collect', + collectBatch: '/eam/weekMaintenanceOrder/collectBatch' + } + } + }, + created() { + if (!this.isDisplayOperation) { + return + } + const operationColumn = { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + fixed: 'right', + width: 200, + scopedSlots: { customRender: 'action' } + } + this.columns = [...this.columns, operationColumn] + this.loadData(1) + }, + computed: {}, + methods: { + onMaintenanceDateChange: function(value, dateString) { + if(dateString && dateString.length === 2) { + this.queryParam.maintenanceDateBegin = dateString[0] + this.queryParam.maintenanceDateEnd = dateString[1] + }else { + this.queryParam.maintenanceDateBegin = undefined + this.queryParam.maintenanceDateEnd = undefined + } + }, + handlerAbolish(id) { + if (!this.url.abolish) { + this.$message.error('璇疯缃畊rl.abolish灞炴��!') + return + } + var that = this + deleteAction(that.url.abolish, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + }, + handlerBatchAbolish() { + if (!this.url.abolishBatch) { + this.$message.error('璇疯缃畊rl.abolishBatch灞炴��!') + return + } + if (this.selectedRowKeys.length <= 0) { + // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒'); + this.$notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�' + }) + return + } else { + var ids = '' + for (var a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' + } + var that = this + this.$confirm({ + title: '纭浣滃簾', + content: '鏄惁浣滃簾閫変腑鏁版嵁锛屽彧鏈夊緟淇濆吇鐘舵�佺殑鏁版嵁鎵嶅彲浣滃簾鎴愬姛?', + onOk: function() { + that.loading = true + deleteAction(that.url.abolishBatch, { ids: ids }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(that.selectedRowKeys.length) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + that.onClearSelected() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.loading = false + }) + } + }) + } + }, + //鍗曚釜棰嗗彇 + handlerCollect(id) { + if (!this.url.collect) { + this.$message.error('璇疯缃畊rl.collect灞炴��!') + return + } + let that = this + getAction(that.url.collect, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + }, + //鎵归噺棰嗗彇 + handlerBatchCollect() { + if (!this.url.collectBatch) { + this.$message.error('璇疯缃畊rl.abolishBatch灞炴��!') + return + } + if (this.selectedRowKeys.length <= 0) { + // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒'); + this.$notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�' + }) + return + } else { + var ids = '' + for (var a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' + } + var that = this + this.$confirm({ + title: '纭棰嗗彇', + content: '鏄惁棰嗗彇閫変腑鏁版嵁锛屽彧鏈夊緟淇濆吇鐘舵�佺殑鏁版嵁鎵嶅彲棰嗗彇鎴愬姛?', + onOk: function() { + that.loading = true + deleteAction(that.url.collectBatch, { ids: ids }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(that.selectedRowKeys.length) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + that.onClearSelected() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.loading = false + }) + } + }) + } + }, + handleDetail(record) { + this.selectWeekMaintenanceData = Object.assign({}, record) + this.$refs.weekMaintenanceApprovalModal.recordDetail(record) + this.$refs.weekMaintenanceApprovalModal.title = '璇︽儏' + this.$refs.weekMaintenanceApprovalModal.disableSubmit = true + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/maintenance/modules/EamInspectionOrderModal.vue b/src/views/eam/maintenance/modules/EamInspectionOrderModal.vue new file mode 100644 index 0000000..61258e3 --- /dev/null +++ b/src/views/eam/maintenance/modules/EamInspectionOrderModal.vue @@ -0,0 +1,365 @@ +<template> + <j-modal + :title="title" + :width="1200" + :visible="visible" + :confirmLoading="confirmLoading" + switchFullscreen + centered + :mask-closable="false" + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <a-spin :spinning="spinning"> + <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-row :gutter="24"> + <a-col :span="8"> + <a-form-model-item prop="standardCode" label="宸ュ崟鍙�"> + <a-input placeholder="宸ュ崟鍙疯嚜鍔ㄧ敓鎴�" v-model="model.orderNum" readOnly/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="equipmentId" label="璁惧缂栧彿"> + <MaintenanceEquipmentSelect placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" v-model="model.equipmentId" + :maintenanceCategory="maintenanceCategory" :disabled="disabled" + @autocompleteForm="autocompleteForm"/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="standardName" label="鏍囧噯鍚嶇О"> + <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" readOnly v-model="model.standardName"/> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="8"> + <a-form-model-item prop="standardCode" label="鏍囧噯缂栫爜"> + <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" readOnly v-model="model.standardCode"/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item label="淇濆吇鍛ㄦ湡"> + <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.maintenancePeriod" readOnly/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="operator" label="鐐规浜�"> + <j-search-select-tag v-model="model.operator" placeholder="璇烽�夋嫨鐐规浜�" :disabled="!model.equipmentId" + :dictOptions="maintenanceOperatorOptions"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="8"> + <a-form-model-item label="鐐规鏃ユ湡" prop="inspectionDate"> + <j-date :placeholder="!model.maintenancePeriod?'璇峰~鍐欎繚鍏诲懆鏈�':'璇烽�夋嫨鐐规鏃ユ湡'" v-model="model.inspectionDate" + :disabled="!model.maintenancePeriod" + @change="expirationTimeFrom(model.inspectionDate)" style="width: 100%"/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item label="鐐规杩囨湡鏃堕棿"> + <j-date placeholder="閫夋嫨鐐规鏃ユ湡鍚庤嚜鍔ㄥ甫鍑�" v-model="model.expirationTime" disabled style="width: 100%"/> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-model-item label="澶囨敞" :labelCol="{span:2}" :wrapperCol="{span:21}" prop="remark"> + <a-textarea v-model="model.remark" rows="3" placeholder="璇疯緭鍏ュ娉�"/> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <j-vxe-table + ref="editableDetailTable" + :rowNumber="true" + :rowSelection="true" + :bordered="true" + :alwaysEdit="true" + :toolbar="true" + keep-source + :height="300" + :loading="detail.loading" + :dataSource="detail.dataSource" + :columns="detail.columns" + style="margin-top: 8px;"/> + </a-row> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> + import { getAction, httpAction } from '@/api/manage' + import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' + import { JVXETypes } from '@/components/jeecg/JVxeTable' + import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect' + import moment from 'dayjs' + + export default { + name: 'EamMaintenanceStandardModal', + mixins: [JVxeTableModelMixin], + components: { + MaintenanceEquipmentSelect + }, + data() { + return { + title: '鎿嶄綔', + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 15 } + }, + confirmLoading: false, + spinning: false, + disabled: false, + validatorRules: { + // standardName: [ + // { required: true, message: '璇疯緭鍏ユ爣鍑嗗悕绉�!' } + // ], + inspectionDate: [ + { required: true, message: '璇烽�夋嫨鐐规鏃ユ湡!' } + ], + // maintenancePeriod: [ + // { required: true, message: '璇疯緭鍏ヤ繚鍏诲懆鏈燂紝鍗曚綅锛氬ぉ!' } + // ], + equipmentId: [ + { required: true, message: '璇烽�夋嫨璁惧!' } + ] + }, + url: { + add: '/eam/eamInspectionOrder/add', + edit: '/eam/eamInspectionOrder/edit', + detail: '/eam/eamMaintenanceStandardDetail/queryList', + detailOrder: '/eam/eamInspectionOrderDetail/queryList', + userSelect: '/eam/user_select/list' + }, + maintenanceCategory: 'POINT_INSPECTION', + maintenanceOperatorOptions: [], + standardId: '', + standardType: false, + detail: { + loading: false, + dataSource: [], + columns: [ + { + title: '搴忓彿', + key: 'itemCode', + type: JVXETypes.inputNumber, + width: '10%', + align: 'center', + validateRules: [ + { required: true, unique: true, message: '搴忓彿涓嶈兘閲嶅' } + ] + }, + { + title: '淇濆吇椤�', + key: 'itemName', + type: JVXETypes.textarea, + width: '20%', + align: 'center', + validateRules: [ + { required: true, message: '淇濆吇椤逛笉鑳戒负绌猴紒' } + ] + }, + { + title: '淇濆吇瑕佹眰', + key: 'itemDemand', + type: JVXETypes.textarea, + width: '30%', + align: 'center', + validateRules: [ + { required: true, message: '淇濆吇瑕佹眰涓嶈兘涓虹┖锛�' } + ] + } + ] + } + } + }, + created() { + }, + methods: { + add() { + this.model = {} + this.detail.dataSource = [] + this.visible = true + this.disabled = false + this.standardType = false + }, + + edit(record) { + this.model = Object.assign({}, record) + this.standardId = record.standardId + this.disabled = true + this.standardType = true + this.visible = true + this.detail.dataSource = [] + if (record && record.referenceFile) { + let obj = JSON.parse(record.referenceFile) + this.model.fileList = [obj] + } else { + this.model.fieldList = [] + } + this.loadDetailOrder(record.id) + }, + + async handleOk() { + const that = this + let errMap = await that.$refs.editableDetailTable.validateTable() + if (errMap) { + this.$message.warning('鏁版嵁鏍¢獙澶辫触锛�') + return + } + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + let tableData = that.$refs.editableDetailTable.getTableData() + let removeData = that.$refs.editableDetailTable.getDeleteData() + that.model.tableDetailList = [...tableData] + that.model.removeDetailList = [...removeData] + + that.confirmLoading = that.spinning = true + let httpurl = '' + let method = '' + if (!this.model.id) { + httpurl += this.url.add + method = 'post' + } else { + httpurl += this.url.edit + method = 'put' + } + this.model.standardId = this.standardId + httpAction(httpurl, this.model, method).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.$emit('ok') + that.close() + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = that.spinning = false + }) + } else { + return false + } + }) + }, + + autocompleteForm(selectObj) { + this.model.standardName = selectObj.standardName + this.model.maintenancePeriod = selectObj.maintenancePeriod + this.model.standardCode = selectObj.standardCode + // 鑻ュ彇娑堣澶囬�夋嫨鍚庝繚鍏诲懆鏈熶负绌哄垯闇�娓呯┖鐐规鏃ユ湡鍜岀偣妫�杩囨湡鏃堕棿 + if (!this.model.equipmentId) { + delete this.model.inspectionDate + delete this.model.expirationTime + } else { + // 濡傛灉鐐规鏃ユ湡瀛樺湪锛屽垯鍦ㄩ噸鏂伴�夋嫨璁惧鍚庡嵆淇濆吇鍛ㄦ湡鍙兘鍙戠敓鏀瑰彉鍚庨噸鏂拌绠楄繃鏈熸椂闂� + if (this.model.inspectionDate) this.expirationTimeFrom(this.model.inspectionDate) + } + if (!this.standardType) { + console.log('this.standardType', this.standardType) + this.standardId = selectObj.id + this.loadDetail(selectObj.id) + } + this.$nextTick(() => this.loadMaintenanceOperatorList(this.model.equipmentId)) + }, + + expirationTimeFrom(date) { + //杩囨湡鏃堕棿鏄垵濮嬫椂闂�+淇濆吇鍛ㄦ湡 + if (date && this.model.maintenancePeriod) { + // 杞崲涓烘椂闂存埑瀛楃涓诧紙鎴栨寚瀹氭牸寮忥級 + this.model.expirationTime = moment(date) + .add(this.model.maintenancePeriod, 'days') + .format('YYYY-MM-DD') + } else { + this.model.expirationTime = null // 娓呯┖鏃犳晥鍊� + } + }, + + //鍔犺浇璇︽儏鏁版嵁 + loadDetail(standardId) { + this.detail.dataSource = [] + if (standardId) { + console.log('standardId', standardId) + this.spinning = true + getAction(this.url.detail, { standardId: standardId }) + .then(res => { + if (res.success) { + this.detail.dataSource = [...res.result] + } + }) + .finally(() => { + this.spinning = false + }) + } + }, + + loadDetailOrder(orderId) { + if (orderId) { + this.spinning = true + getAction(this.url.detailOrder, { orderId: orderId }) + .then(res => { + if (res.success) { + this.detail.dataSource = [...res.result] + } + }) + .finally(() => { + this.spinning = false + }) + } + }, + + loadMaintenanceOperatorList(equipmentId) { + this.maintenanceOperatorOptions = [] + let params = { positionCode: 'PCR0001' } + if (equipmentId) { + params.equipmentId = equipmentId + } else { + delete this.model.operator + return + } + const that = this + getAction(this.url.userSelect, params) + .then(res => { + if (res.success) { + that.maintenanceOperatorOptions = res.result.map(item => ({ + key: item.id, + value: item.username, + text: item.realname + })) + if (!that.maintenanceOperatorOptions.find(item => item.value === that.model.operator)) delete that.model.operator + } else { + if (that.model.operator) delete that.model.operator + } + }) + .catch(err => { + if (that.model.operator) delete that.model.operator + }) + }, + + handleCancel() { + this.close() + }, + + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() + } + } + } +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/maintenance/modules/EamPrecisionCheckDetailModal.vue b/src/views/eam/maintenance/modules/EamPrecisionCheckDetailModal.vue new file mode 100644 index 0000000..271b6fb --- /dev/null +++ b/src/views/eam/maintenance/modules/EamPrecisionCheckDetailModal.vue @@ -0,0 +1,117 @@ +<template> + <j-modal + :title="title" + :width="800" + :visible="visible" + :confirmLoading="confirmLoading" + switchFullscreen + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :model="model" :rules="validatorRules"> + + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag" label="鍒犻櫎鏍囪"> + <a-input-number v-model="model.delFlag"/> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentPrecisionId" label="璁惧鍙傛暟id"> + <a-input placeholder="璇疯緭鍏ヨ澶囧弬鏁癷d" v-model="model.equipmentPrecisionId" /> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="actualValue" label="瀹炴祴鍊�"> + <a-input placeholder="璇疯緭鍏ュ疄娴嬪��" v-model="model.actualValue" /> + </a-form-model-item> + + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> + import { httpAction } from '@/api/manage' + import moment from "moment" + + export default { + name: "EamPrecisionCheckDetailModal", + data () { + return { + title:"鎿嶄綔", + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + + confirmLoading: false, + validatorRules:{ + }, + url: { + add: "/eam/eamPrecisionCheckDetail/add", + edit: "/eam/eamPrecisionCheckDetail/edit", + }, + } + }, + created () { + }, + methods: { + add () { + //鍒濆鍖栭粯璁ゅ�� + this.edit({}); + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + close () { + this.$emit('close'); + this.visible = false; + this.$refs.form.clearValidate(); + }, + handleOk () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }) + }else{ + return false; + } + }) + }, + handleCancel () { + this.close() + }, + + + } + } +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/maintenance/modules/EamSecondMaintenanceOrderModal.vue b/src/views/eam/maintenance/modules/EamSecondMaintenanceOrderModal.vue new file mode 100644 index 0000000..dcf59e9 --- /dev/null +++ b/src/views/eam/maintenance/modules/EamSecondMaintenanceOrderModal.vue @@ -0,0 +1,343 @@ +<template> + <j-modal + :title="title" + :width="1200" + :visible="visible" + :confirmLoading="confirmLoading" + switchFullscreen + :mask-closable="false" + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <a-spin :spinning="spinning"> + <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-row :gutter="24"> + <a-col :span="8"> + <a-form-model-item prop="orderNum" label="宸ュ崟鍙�"> + <a-input placeholder="宸ュ崟鍙风郴缁熻嚜鍔ㄧ敓鎴�" v-model="model.orderNum" disabled/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="equipmentId" label="璁惧缂栫爜"> + <maintenance-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" v-model="model.equipmentId" + :maintenanceCategory="maintenanceCategory" + @autocompleteForm="autocompleteForm" + :disabled="editable"></maintenance-equipment-select> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="standardName" label="鏍囧噯鍚嶇О"> + <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.standardName" disabled/> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="8"> + <a-form-model-item prop="maintenanceDate" label="淇濆吇鏃ユ湡"> + <a-date-picker placeholder="璇烽�夋嫨璁″垝淇濆吇鏃ユ湡" v-model="model.maintenanceDate" format="YYYY-MM-DD" + style="width: 100%"/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="operator" label="淇濆吇浜�"> + <j-search-select-tag v-model="model.operator" placeholder="璇烽�夋嫨淇濆吇浜�" :disabled="!model.equipmentId" + :dictOptions="maintenanceOperatorOptions"/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="maintenancePeriod" label="淇濆吇鍛ㄦ湡"> + <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.maintenancePeriod" disabled/> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="remark" label="澶囨敞"> + <a-textarea placeholder="璇疯緭鍏ュ娉�" v-model="model.remark"/> + </a-form-model-item> + </a-row> + <a-row :gutter="24"> + <a-spin :spinning="detail.loading"> + <j-vxe-table + ref="editableDetailTable" + :rowNumber="true" + :rowSelection="true" + :bordered="true" + :alwaysEdit="true" + :toolbar="true" + :toolbarConfig="detail.toolbarConfig" + keep-source + :height="300" + :dataSource="detail.dataSource" + :columns="detail.columns" + style="margin-top: 8px;"/> + </a-spin> + </a-row> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> +import { getAction, httpAction } from '@/api/manage' +import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect.vue' +import { JVXETypes } from '@comp/jeecg/JVxeTable' + +export default { + name: "EamSecondMaintenanceOrderModal", + components: { MaintenanceEquipmentSelect }, + data () { + return { + title:"鎿嶄綔", + visible: false, + editable: false, + model: {}, + maintenanceCategory: 'SECOND_MAINTENANCE', + // 娣诲姞缂哄け鐨� maintenanceOperatorOptions 灞炴�� + maintenanceOperatorOptions: [], + labelCol: { + xs: { span: 24 }, + sm: { span: 6 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + }, + labelColLong: { + xs: { span: 24 }, + sm: { span: 2 } + }, + wrapperColLong: { + xs: { span: 24 }, + sm: { span: 21 } + }, + confirmLoading: false, + spinning: false, + validatorRules:{ + equipmentId: [ + { required: true, message: '璇烽�夋嫨璁惧!' } + ], + maintenanceDate: [ + { required: true, message: '璇烽�夋嫨璁″垝淇濆吇鏃ユ湡!' } + ] + }, + url: { + add: "/eam/secondMaintenanceOrder/add", + edit: "/eam/secondMaintenanceOrder/edit", + standardDetail: '/eam/eamMaintenanceStandardDetail/queryList', + detail: '/eam/secondMaintenanceOrderDetail/queryList', + userSelect: '/eam/user_select/list' + }, + detail: { + loading: false, + dataSource: [], + columns: [ + { + title: 'ID', + key: 'id', + type: JVXETypes.hidden + }, + { + title: 'orderId', + key: 'orderId', + type: JVXETypes.hidden + }, + { + title: '搴忓彿', + key: 'itemCode', + type: JVXETypes.inputNumber, + width: '10%', + align: 'center', + validateRules: [ + { required: true, unique: true, message: '搴忓彿涓嶈兘閲嶅' } + ] + }, + { + title: '閮ㄤ綅', + key: 'itemPart', + type: JVXETypes.textarea, + width: '25%', + align: 'center' + }, + { + title: '淇濆吇椤�', + key: 'itemName', + type: JVXETypes.textarea, + width: '20%', + align: 'center', + validateRules: [ + { required: true, message: '淇濆吇椤逛笉鑳戒负绌猴紒' } + ] + }, + { + title: '淇濆吇瑕佹眰', + key: 'itemDemand', + type: JVXETypes.textarea, + width: '30%', + align: 'center', + validateRules: [ + { required: true, message: '淇濆吇瑕佹眰涓嶈兘涓虹┖锛�' } + ] + } + ], + toolbarConfig: { + // prefix 鍓嶇紑锛泂uffix 鍚庣紑 + slot: ['prefix', 'suffix'], + // add 鏂板鎸夐挳锛況emove 鍒犻櫎鎸夐挳锛沜learSelection 娓呯┖閫夋嫨鎸夐挳 + btn: ['add', 'remove', 'clearSelection'] + } + } + } + }, + created () { + }, + methods: { + add() { + //鍒濆鍖栭粯璁ゅ�� + this.model = {} + this.visible = true + this.editable = false + this.detail.dataSource = [] + }, + edit(record) { + this.model = Object.assign({}, record) + this.visible = true + this.editable = true + this.detail.dataSource = [] + this.loadDetail(record.id) + }, + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() + }, + async handleOk() { + const that = this + let errMap = await that.$refs.editableDetailTable.validateTable() + if (errMap) { + this.$message.warning('鏁版嵁鏍¢獙澶辫触锛�') + return + } + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + let tableData = that.$refs.editableDetailTable.getTableData() + let removeData = that.$refs.editableDetailTable.getDeleteData() + that.model.tableDetailList = [...tableData] + that.model.removeDetailList = [...removeData] + + that.confirmLoading = true + let httpurl = '' + let method = '' + if (!this.model.id) { + httpurl += this.url.add + method = 'post' + } else { + httpurl += this.url.edit + method = 'put' + } + httpAction(httpurl, this.model, method).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.$emit('ok') + that.close() + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = false + }) + } else { + return false + } + }) + }, + handleCancel() { + this.close() + }, + autocompleteForm(selectObj) { + //鏍囧噯鍚嶇О锛屼繚鍏诲懆鏈熶笉鍒锋柊瑙e喅鍔炴硶 + //鍔炴硶涓� validatorRules equipmentId 杩樻槸鏈夐棶棰� + // const newObj = { + // standardName: selectObj.standardName, + // maintenancePeriod: selectObj.maintenancePeriod, + // standardId : selectObj.id, + // equipmentId: selectObj.equipmentId, + // }; + // this.model = Object.assign({}, newObj, this.model) + //鍔炴硶浜� + this.$set(this.model, 'standardName', selectObj.standardName) + this.$set(this.model, 'maintenancePeriod', selectObj.maintenancePeriod) + this.$set(this.model, 'standardId', selectObj.id) + this.$set(this.model, 'equipmentId', selectObj.equipmentId) + // console.log('model', this.model) + if (!this.model.equipmentId) delete this.model.operator + if (!this.model.id) { + this.loadStandardDetail(selectObj.id) + } + this.loadMaintenanceOperatorList(this.model.equipmentId) + }, + //鍔犺浇璇︽儏鏁版嵁 + loadStandardDetail(standardId) { + this.detail.dataSource = [] + if (standardId) { + this.spinning = true + getAction(this.url.standardDetail, { standardId: standardId }) + .then(res => { + if (res.success) { + this.detail.dataSource = res.result.map(item => ({ + itemCode: item.itemCode, + itemName: item.itemName, + itemPart: item.itemPart, + itemDemand: item.itemDemand + })) + } + }) + .finally(() => { + this.spinning = false + }) + } + }, + //鏍囧噯閫夋嫨鍙樺寲 + loadDetail(orderId) { + if (orderId) { + getAction(this.url.detail, { orderId: orderId }).then(res => { + if (res.success) { + this.detail.dataSource = [...res.result] + } + }) + } + }, + loadMaintenanceOperatorList(equipmentId) { + this.maintenanceOperatorOptions = [] + let params = { positionCode: 'PCR0001' } + if (equipmentId) { + params.equipmentId = equipmentId + } + else return + const that = this + getAction(this.url.userSelect, params) + .then(res => { + if (res.success) { + that.maintenanceOperatorOptions = res.result.map(item => ({ + key: item.id, + value: item.username, + text: item.realname + })) + if (!that.maintenanceOperatorOptions.find(item => item.value === that.model.operator)) delete that.model.operator + } else { + if (that.model.operator) delete that.model.operator + } + }) + .catch(err => { + if (that.model.operator) delete that.model.operator + }) + } + + } + } +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/maintenance/modules/EamThirdMaintenanceOrderModal.vue b/src/views/eam/maintenance/modules/EamThirdMaintenanceOrderModal.vue new file mode 100644 index 0000000..e246065 --- /dev/null +++ b/src/views/eam/maintenance/modules/EamThirdMaintenanceOrderModal.vue @@ -0,0 +1,459 @@ +<template> + <j-modal + :title="title" + :width="1200" + :visible="visible" + :confirmLoading="confirmLoading" + switchFullscreen + :mask-closable="false" + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <a-spin :spinning="spinning"> + <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-row :gutter="24"> + <a-col :span="8"> + <a-form-model-item prop="orderNum" label="宸ュ崟鍙�"> + <a-input placeholder="宸ュ崟鍙风郴缁熻嚜鍔ㄧ敓鎴�" v-model="model.orderNum" disabled /> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="equipmentId" label="璁惧缂栫爜"> + <maintenance-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" v-model="model.equipmentId" + :maintenanceCategory="maintenanceCategory" + @autocompleteForm="autocompleteForm" + :disabled="editable"></maintenance-equipment-select> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="standardName" label="鏍囧噯鍚嶇О"> + <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.standardName" disabled /> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="8"> + <a-form-model-item prop="maintenanceDate" label="淇濆吇鏃ユ湡"> + <a-date-picker placeholder="璇烽�夋嫨璁″垝淇濆吇鏃ユ湡" v-model="model.maintenanceDate" format="YYYY-MM-DD" + style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="operator" label="淇濆吇浜�"> + <j-search-select-tag v-model="model.operator" placeholder="璇烽�夋嫨淇濆吇浜�" :disabled="!model.equipmentId" + :dictOptions="maintenanceOperatorOptions" /> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="maintenancePeriod" label="淇濆吇鍛ㄦ湡"> + <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.maintenancePeriod" disabled /> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="remark" label="澶囨敞"> + <a-textarea placeholder="璇疯緭鍏ュ娉�" v-model="model.remark" /> + </a-form-model-item> + </a-row> + <a-row :gutter="24"> + <a-tabs v-model="activeTabKey"> + <a-tab-pane key="1" tab="淇濆吇椤�" :forceRender="true"> + <j-vxe-table + ref="editableDetailTable" + :rowNumber="true" + :rowSelection="true" + :bordered="true" + :alwaysEdit="true" + :toolbar="true" + :toolbarConfig="detail.toolbarConfig" + keep-source + :height="300" + :dataSource="detail.dataSource" + :columns="detail.columns" + style="margin-top: 8px;" /> + </a-tab-pane> + <a-tab-pane key="2" tab="绮惧害鍙傛暟" :forceRender="true"> + <j-vxe-table + ref="editablePrecisionDetailTable" + :rowNumber="true" + :rowSelection="true" + :bordered="true" + :alwaysEdit="true" + :toolbar="false" + :toolbarConfig="precisionDetail.toolbarConfig" + keep-source + :height="300" + :dataSource="precisionDetail.dataSource" + :columns="precisionDetail.columns" + style="margin-top: 8px;" /> + </a-tab-pane> + </a-tabs> + </a-row> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> +import { getAction, httpAction } from '@/api/manage' +import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect.vue' +import { JVXETypes } from '@comp/jeecg/JVxeTable' + +export default { + name: 'EamThirdMaintenanceOrderModal', + components: { MaintenanceEquipmentSelect }, + data() { + return { + title: '鎿嶄綔', + visible: false, + editable: false, + maintenanceCategory: 'THIRD_MAINTENANCE', + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + }, + labelColLong: { + xs: { span: 24 }, + sm: { span: 2 } + }, + wrapperColLong: { + xs: { span: 24 }, + sm: { span: 21 } + }, + confirmLoading: false, + spinning: false, + activeTabKey: '1', + maintenanceOperatorOptions: [], + validatorRules: { + equipmentId: [ + { required: true, message: '璇烽�夋嫨璁惧!' } + ], + maintenanceDate: [ + { required: true, message: '璇烽�夋嫨璁″垝淇濆吇鏃ユ湡!' } + ] + }, + url: { + add: '/eam/thirdMaintenanceOrder/add', + edit: '/eam/thirdMaintenanceOrder/edit', + standardDetail: '/eam/eamMaintenanceStandardDetail/queryList', + detail: '/eam/thirdMaintenanceOrderDetail/queryList', + userSelect: '/eam/user_select/list', + precisionDetail: '/eam/equipmentPrecisionParameters/queryList', + precisionCheckDetail: '/eam/precisionCheckDetail/queryList', + }, + detail: { + loading: false, + dataSource: [], + columns: [ + { + title: 'ID', + key: 'id', + type: JVXETypes.hidden + }, + { + title: 'orderId', + key: 'orderId', + type: JVXETypes.hidden + }, + { + title: '搴忓彿', + key: 'itemCode', + type: JVXETypes.inputNumber, + width: '10%', + align: 'center', + validateRules: [ + { required: true, unique: true, message: '搴忓彿涓嶈兘閲嶅' } + ] + }, + { + title: '閮ㄤ綅', + key: 'itemPart', + type: JVXETypes.textarea, + width: '25%', + align: 'center' + }, + { + title: '淇濆吇椤�', + key: 'itemName', + type: JVXETypes.textarea, + width: '20%', + align: 'center', + validateRules: [ + { required: true, message: '淇濆吇椤逛笉鑳戒负绌猴紒' } + ] + }, + { + title: '淇濆吇瑕佹眰', + key: 'itemDemand', + type: JVXETypes.textarea, + width: '30%', + align: 'center', + validateRules: [ + { required: true, message: '淇濆吇瑕佹眰涓嶈兘涓虹┖锛�' } + ] + } + ], + toolbarConfig: { + // prefix 鍓嶇紑锛泂uffix 鍚庣紑 + slot: ['prefix', 'suffix'], + // add 鏂板鎸夐挳锛況emove 鍒犻櫎鎸夐挳锛沜learSelection 娓呯┖閫夋嫨鎸夐挳 + btn: ['add', 'remove', 'clearSelection'] + } + }, + precisionDetail: { + loading: false, + dataSource: [], + columns: [ + { + title: 'ID', + key: 'id', + type: JVXETypes.hidden + }, + { + title: 'orderId', + key: 'orderId', + type: JVXETypes.hidden + }, + { + title: 'equipmentId', + key: 'equipmentId', + type: JVXETypes.hidden + }, + { + title: 'parameterId', + key: 'parameterId', + type: JVXETypes.hidden + }, + { + title: '妫�娴嬮」鐩�', + key: 'parameterId_dictText', + type: JVXETypes.normal, + width: '25%', + align: 'center' + }, + { + title: '鍙傛暟缂栫爜', + key: 'parameterCode_dictText', + type: JVXETypes.normal, + width: '20%', + align: 'center', + }, + { + title: '鍏佸樊鍊�', + key: 'parameterValue', + type: JVXETypes.normal, + width: '30%', + align: 'center', + } + ], + toolbarConfig: { + // prefix 鍓嶇紑锛泂uffix 鍚庣紑 + slot: ['prefix', 'suffix'], + // add 鏂板鎸夐挳锛況emove 鍒犻櫎鎸夐挳锛沜learSelection 娓呯┖閫夋嫨鎸夐挳 + btn: ['add', 'remove', 'clearSelection'] + } + } + } + }, + created() { + }, + methods: { + add() { + this.initParams(); + //鍒濆鍖栭粯璁ゅ�� + this.model = {} + this.visible = true + this.editable = false + this.detail.dataSource = [] + }, + edit(record) { + this.initParams(); + this.model = Object.assign({}, record) + this.visible = true + this.editable = true + this.detail.dataSource = [] + this.loadDetail(record.id) + this.loadPrecisionDetail(record.id) + }, + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() + }, + async handleOk() { + const that = this + let errMap = await that.$refs.editableDetailTable.validateTable() + if (errMap) { + this.$message.warning('鏁版嵁鏍¢獙澶辫触锛�') + return + } + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + let tableData = that.$refs.editableDetailTable.getTableData() + let removeData = that.$refs.editableDetailTable.getDeleteData() + that.model.tableDetailList = [...tableData] + that.model.removeDetailList = [...removeData] + + let precisionDetailList = that.$refs.editablePrecisionDetailTable.getTableData() + let removePrecisionDetailList = that.$refs.editablePrecisionDetailTable.getDeleteData() + that.model.precisionDetailList = [...precisionDetailList] + that.model.removePrecisionDetailList = [...removePrecisionDetailList] + + that.confirmLoading = true + let httpurl = '' + let method = '' + if (!this.model.id) { + httpurl += this.url.add + method = 'post' + } else { + httpurl += this.url.edit + method = 'put' + } + httpAction(httpurl, this.model, method).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.$emit('ok') + that.close() + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = false + }) + } else { + return false + } + }) + }, + handleCancel() { + this.close() + }, + autocompleteForm(selectObj) { + //鏍囧噯鍚嶇О锛屼繚鍏诲懆鏈熶笉鍒锋柊瑙e喅鍔炴硶 + //鍔炴硶涓� validatorRules equipmentId 杩樻槸鏈夐棶棰� + // const newObj = { + // standardName: selectObj.standardName, + // maintenancePeriod: selectObj.maintenancePeriod, + // standardId : selectObj.id, + // equipmentId: selectObj.equipmentId, + // }; + // this.model = Object.assign({}, newObj, this.model) + //鍔炴硶浜� + this.$set(this.model, 'standardName', selectObj.standardName) + this.$set(this.model, 'maintenancePeriod', selectObj.maintenancePeriod) + this.$set(this.model, 'standardId', selectObj.id) + this.$set(this.model, 'equipmentId', selectObj.equipmentId) + // console.log('model', this.model) + if (!this.model.equipmentId) delete this.model.operator + if (!this.model.id) { + this.loadStandardDetail(selectObj.id) + this.loadPrecisionParameterList(selectObj.equipmentId) + } + this.loadMaintenanceOperatorList(this.model.equipmentId) + }, + //鍔犺浇璇︽儏鏁版嵁 + loadStandardDetail(standardId) { + this.detail.dataSource = [] + if (standardId) { + this.spinning = true + getAction(this.url.standardDetail, { standardId: standardId }) + .then(res => { + if (res.success) { + this.detail.dataSource = res.result.map(item => ({ + itemCode: item.itemCode, + itemName: item.itemName, + itemPart: item.itemPart, + itemDemand: item.itemDemand + })) + } + }) + .finally(() => { + this.spinning = false + }) + } + }, + //鏍囧噯閫夋嫨鍙樺寲 + loadDetail(orderId) { + if (orderId) { + getAction(this.url.detail, { orderId: orderId }).then(res => { + if (res.success) { + this.detail.dataSource = [...res.result] + } + }) + } + }, + loadMaintenanceOperatorList(equipmentId) { + this.maintenanceOperatorOptions = [] + let params = { positionCode: 'PCR0001' } + if (equipmentId) { + params.equipmentId = equipmentId + } else { + return + } + const that = this + getAction(this.url.userSelect, params) + .then(res => { + if (res.success) { + that.maintenanceOperatorOptions = res.result.map(item => ({ + key: item.id, + value: item.username, + text: item.realname + })) + if (!that.maintenanceOperatorOptions.find(item => item.value === that.model.operator)) delete that.model.operator + } else { + if (that.model.operator) delete that.model.operator + } + }) + .catch(err => { + if (that.model.operator) delete that.model.operator + }) + }, + loadPrecisionParameterList(equipmentId) { + this.precisionDetail.dataSource = [] + if (equipmentId) { + this.spinning = true + getAction(this.url.precisionDetail, { equipmentId: equipmentId }) + .then(res => { + if (res.success) { + this.precisionDetail.dataSource = res.result.map(item => ({ + equipmentId: item.equipmentId, + parameterId: item.parameterId, + parameterId_dictText: item.parameterId_dictText, + parameterCode_dictText: item.parameterCode_dictText, + parameterValue: item.parameterValue, + })) + } + }) + .finally(() => { + this.spinning = false + }) + } + }, + loadPrecisionDetail(orderId) { + if (orderId) { + getAction(this.url.precisionCheckDetail, { orderId: orderId }).then(res => { + if (res.success) { + this.precisionDetail.dataSource = [...res.result] + } + }) + } + }, + initParams() { + this.detail.dataSource = [] + this.precisionDetail.dataSource = [] + this.activeTabKey = '1' + }, + } +} +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/maintenance/modules/EamWeekMaintenanceOrderModal.vue b/src/views/eam/maintenance/modules/EamWeekMaintenanceOrderModal.vue new file mode 100644 index 0000000..4a77dba --- /dev/null +++ b/src/views/eam/maintenance/modules/EamWeekMaintenanceOrderModal.vue @@ -0,0 +1,345 @@ +<template> + <j-modal + :title="title" + :width="1200" + :visible="visible" + :confirmLoading="confirmLoading" + switchFullscreen + :mask-closable="false" + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <a-spin :spinning="spinning"> + <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-row :gutter="24"> + <a-col :span="8"> + <a-form-model-item prop="orderNum" label="宸ュ崟鍙�"> + <a-input placeholder="宸ュ崟鍙风郴缁熻嚜鍔ㄧ敓鎴�" v-model="model.orderNum" disabled/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="equipmentId" label="璁惧缂栫爜"> + <maintenance-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" v-model="model.equipmentId" + :maintenanceCategory="maintenanceCategory" + @autocompleteForm="autocompleteForm" + :disabled="editable"></maintenance-equipment-select> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="standardName" label="鏍囧噯鍚嶇О"> + <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.standardName" disabled/> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="8"> + <a-form-model-item prop="maintenanceDate" label="淇濆吇鏃ユ湡"> + <a-date-picker placeholder="璇烽�夋嫨璁″垝淇濆吇鏃ユ湡" v-model="model.maintenanceDate" format="YYYY-MM-DD" + style="width: 100%"/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="operator" label="淇濆吇浜�"> + <j-search-select-tag v-model="model.operator" placeholder="璇烽�夋嫨淇濆吇浜�" :disabled="!model.equipmentId" + :dictOptions="maintenanceOperatorOptions"/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item prop="maintenancePeriod" label="淇濆吇鍛ㄦ湡"> + <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.maintenancePeriod" disabled/> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="remark" label="澶囨敞"> + <a-textarea placeholder="璇疯緭鍏ュ娉�" v-model="model.remark"/> + </a-form-model-item> + </a-row> + <a-row :gutter="24"> + <a-spin :spinning="detail.loading"> + <j-vxe-table + ref="editableDetailTable" + :rowNumber="true" + :rowSelection="true" + :bordered="true" + :alwaysEdit="true" + :toolbar="true" + :toolbarConfig="detail.toolbarConfig" + keep-source + :height="300" + :dataSource="detail.dataSource" + :columns="detail.columns" + style="margin-top: 8px;"/> + </a-spin> + </a-row> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> + import { getAction, httpAction } from '@/api/manage' + import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' + import { JVXETypes } from '@comp/jeecg/JVxeTable' + import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect' + + export default { + name: 'EamWeekMaintenanceOrderModal', + mixins: [JVxeTableModelMixin], + components: { + MaintenanceEquipmentSelect + }, + data() { + return { + title: '鎿嶄綔', + visible: false, + editable: false, + model: {}, + maintenanceCategory: 'WEEK_MAINTENANCE', + maintenanceOperatorOptions: [], + labelCol: { + xs: { span: 24 }, + sm: { span: 6 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + }, + labelColLong: { + xs: { span: 24 }, + sm: { span: 2 } + }, + wrapperColLong: { + xs: { span: 24 }, + sm: { span: 21 } + }, + confirmLoading: false, + spinning: false, + validatorRules: { + equipmentId: [ + { required: true, message: '璇烽�夋嫨璁惧!' } + ], + maintenanceDate: [ + { required: true, message: '璇烽�夋嫨璁″垝淇濆吇鏃ユ湡!' } + ] + }, + url: { + add: '/eam/weekMaintenanceOrder/add', + edit: '/eam/weekMaintenanceOrder/edit', + standardDetail: '/eam/eamMaintenanceStandardDetail/queryList', + detail: '/eam/weekMaintenanceOrderDetail/queryList', + userSelect: '/eam/user_select/list' + }, + detail: { + loading: false, + dataSource: [], + columns: [ + { + title: 'ID', + key: 'id', + type: JVXETypes.hidden + }, + { + title: 'orderId', + key: 'orderId', + type: JVXETypes.hidden + }, + { + title: '搴忓彿', + key: 'itemCode', + type: JVXETypes.inputNumber, + width: '10%', + align: 'center', + validateRules: [ + { required: true, unique: true, message: '搴忓彿涓嶈兘閲嶅' } + ] + }, + { + title: '淇濆吇椤�', + key: 'itemName', + type: JVXETypes.textarea, + width: '20%', + align: 'center', + validateRules: [ + { required: true, message: '淇濆吇椤逛笉鑳戒负绌猴紒' } + ] + }, + { + title: '瀛愪繚鍏婚」', + key: 'subItemName', + type: JVXETypes.textarea, + width: '25%', + align: 'center' + }, + { + title: '淇濆吇瑕佹眰', + key: 'itemDemand', + type: JVXETypes.textarea, + width: '30%', + align: 'center', + validateRules: [ + { required: true, message: '淇濆吇瑕佹眰涓嶈兘涓虹┖锛�' } + ] + } + ], + toolbarConfig: { + // prefix 鍓嶇紑锛泂uffix 鍚庣紑 + slot: ['prefix', 'suffix'], + // add 鏂板鎸夐挳锛況emove 鍒犻櫎鎸夐挳锛沜learSelection 娓呯┖閫夋嫨鎸夐挳 + btn: ['add', 'remove', 'clearSelection'] + } + } + } + }, + created() { + }, + methods: { + add() { + //鍒濆鍖栭粯璁ゅ�� + this.model = {} + this.visible = true + this.editable = false + this.detail.dataSource = [] + }, + edit(record) { + this.model = Object.assign({}, record) + this.visible = true + this.editable = true + this.detail.dataSource = [] + this.loadDetail(record.id) + }, + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() + }, + async handleOk() { + const that = this + let errMap = await that.$refs.editableDetailTable.validateTable() + if (errMap) { + this.$message.warning('鏁版嵁鏍¢獙澶辫触锛�') + return + } + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + let tableData = that.$refs.editableDetailTable.getTableData() + let removeData = that.$refs.editableDetailTable.getDeleteData() + that.model.tableDetailList = [...tableData] + that.model.removeDetailList = [...removeData] + + that.confirmLoading = true + let httpurl = '' + let method = '' + if (!this.model.id) { + httpurl += this.url.add + method = 'post' + } else { + httpurl += this.url.edit + method = 'put' + } + httpAction(httpurl, this.model, method).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.$emit('ok') + that.close() + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = false + }) + } else { + return false + } + }) + }, + handleCancel() { + this.close() + }, + autocompleteForm(selectObj) { + //鏍囧噯鍚嶇О锛屼繚鍏诲懆鏈熶笉鍒锋柊瑙e喅鍔炴硶 + //鍔炴硶涓� validatorRules equipmentId 杩樻槸鏈夐棶棰� + // const newObj = { + // standardName: selectObj.standardName, + // maintenancePeriod: selectObj.maintenancePeriod, + // standardId : selectObj.id, + // equipmentId: selectObj.equipmentId, + // }; + // this.model = Object.assign({}, newObj, this.model) + //鍔炴硶浜� + this.$set(this.model, 'standardName', selectObj.standardName) + this.$set(this.model, 'maintenancePeriod', selectObj.maintenancePeriod) + this.$set(this.model, 'standardId', selectObj.id) + this.$set(this.model, 'equipmentId', selectObj.equipmentId) + // console.log('model', this.model) + if (!this.model.equipmentId) delete this.model.operator + if (!this.model.id) { + this.loadStandardDetail(selectObj.id) + } + this.loadMaintenanceOperatorList(this.model.equipmentId) + }, + //鍔犺浇璇︽儏鏁版嵁 + loadStandardDetail(standardId) { + this.detail.dataSource = [] + if (standardId) { + this.spinning = true + getAction(this.url.standardDetail, { standardId: standardId }) + .then(res => { + if (res.success) { + this.detail.dataSource = res.result.map(item => ({ + itemCode: item.itemCode, + itemName: item.itemName, + subItemName: item.subItemName, + itemDemand: item.itemDemand + })) + } + }) + .finally(() => { + this.spinning = false + }) + } + }, + //鏍囧噯閫夋嫨鍙樺寲 + loadDetail(orderId) { + if (orderId) { + getAction(this.url.detail, { orderId: orderId }).then(res => { + if (res.success) { + this.detail.dataSource = [...res.result] + } + }) + } + }, + loadMaintenanceOperatorList(equipmentId) { + this.maintenanceOperatorOptions = [] + let params = { positionCode: 'PCR0001' } + if (equipmentId) { + params.equipmentId = equipmentId + } + else return + const that = this + getAction(this.url.userSelect, params) + .then(res => { + if (res.success) { + that.maintenanceOperatorOptions = res.result.map(item => ({ + key: item.id, + value: item.username, + text: item.realname + })) + if (!that.maintenanceOperatorOptions.find(item => item.value === that.model.operator)) delete that.model.operator + } else { + if (that.model.operator) delete that.model.operator + } + }) + .catch(err => { + if (that.model.operator) delete that.model.operator + }) + } + + } + } +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/purchase/EamEquipmentPurchasePlanList.vue b/src/views/eam/purchase/EamEquipmentPurchasePlanList.vue new file mode 100644 index 0000000..4d05ff2 --- /dev/null +++ b/src/views/eam/purchase/EamEquipmentPurchasePlanList.vue @@ -0,0 +1,377 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="閲囪喘璁″垝缂栫爜"> + <j-input placeholder="璇疯緭鍏ラ噰璐鍒掔紪鐮�" v-model="queryParam.planCode"></j-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="閲囪喘璁″垝鍚嶇О"> + <j-input placeholder="璇疯緭鍏ラ噰璐鍒掑悕绉�" v-model="queryParam.planName"></j-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="绠$悊鍒嗙被"> + <j-dict-select-tag dict-code="equipment_abc_flag" placeholder="璇烽�夋嫨绠$悊鍒嗙被" + v-model="queryParam.equipmentImportance"></j-dict-select-tag> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24" v-if="toggleSearchStatus"> + <a-form-item label="璁″垝鐘舵��"> + <j-dict-select-tag dict-code="equipment_purchase_plan_status" placeholder="璇烽�夋嫨璁″垝鐘舵��" + v-model="queryParam.planStatus"></j-dict-select-tag> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + <a @click="handleToggleSearch" style="margin-left: 8px"> + {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }} + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> + </a> + </span> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-button type="primary" icon="download" @click="handleExportXls('璁惧閲囪喘璁″垝')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> + <a-button type="primary" icon="download" @click="handleTemplateXlsDownload">瀵煎叆妯℃澘涓嬭浇</a-button> + <!-- 楂樼骇鏌ヨ鍖哄煙 --> +<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>--> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>鍒犻櫎</a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{ x: 'max-content' }" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + class="j-table-force-nowrap" + @change="handleTableChange" + :customRow="customTableRow" + > + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleDetail(record)">璇︽儏</a> + <span v-if="record.planStatus === 'NEWLY'"> + <a-divider type="vertical" /> + <a-popconfirm title="纭畾鎻愪氦鍚�?" @confirm="() => handleSubmit(record.id)"> + <a>鎻愪氦</a> + </a-popconfirm> + </span> + <span v-else-if="record.planStatus === 'PENDING_AUDIT'"> + <a-divider type="vertical" /> + <a @click="handleAudit(record)">瀹℃牳</a> + </span> + <span v-if="record.planStatus === 'NEWLY'"> + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleEdit(record)">缂栬緫</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + </span> + </a-table> + </div> + + <a-tabs defaultActiveKey="1"> + <a-tab-pane tab="璁惧閲囪喘璁″垝闄勪欢" key="1" > + <eam-purchase-plan-attachment-list ref="eamPurchasePlanAttachmentList"></eam-purchase-plan-attachment-list> + </a-tab-pane> + </a-tabs> + + <eam-equipment-purchase-plan-modal ref="modalForm" @ok="modalFormOk"></eam-equipment-purchase-plan-modal> + <eam-equipment-purchase-plan-audit-modal ref="modalAuditForm" @ok="modalFormOk"></eam-equipment-purchase-plan-audit-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import EamEquipmentPurchasePlanModal from './modules/EamEquipmentPurchasePlanModal' + import EamEquipmentPurchasePlanAuditModal from './modules/EamEquipmentPurchasePlanAuditModal.vue' + import EamPurchasePlanAttachmentList from './EamPurchasePlanAttachmentList.vue' + + import { getAction, templateXlsDownload } from '../../../api/manage' + + export default { + name: 'EamEquipmentPurchasePlanList', + mixins:[JeecgListMixin, mixinDevice], + components: { + EamEquipmentPurchasePlanModal, + EamEquipmentPurchasePlanAuditModal, + EamPurchasePlanAttachmentList + }, + data () { + return { + description: 'eam_equipment_purchase_plan绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + }, + fixed: 'left' + }, + { + title:'閲囪喘璁″垝缂栫爜', + align:"center", + dataIndex: 'planCode', + fixed: 'left' + }, + { + title:'閲囪喘璁″垝鍚嶇О', + align:"center", + dataIndex: 'planName', + fixed: 'left' + }, + { + title:'璁″垝鐘舵��', + align:"center", + dataIndex: 'planStatus_dictText' + }, + { + title:'鍨嬪彿', + align:"center", + dataIndex: 'equipmentModel' + }, + { + title:'閲囪喘鏁伴噺', + align:"center", + dataIndex: 'purchaseNumber' + }, + { + title:'棰勮鍗曚环', + align:"center", + dataIndex: 'estimatedUnitPrice' + }, + { + title:'鎬讳环', + align:"center", + dataIndex: 'totalPrice' + }, + { + title:'鍚堝悓鎬婚噾棰�', + align:"center", + dataIndex: 'overallContractAmount' + }, + { + title:'绠$悊鍒嗙被', + align:"center", + dataIndex: 'equipmentImportance' + }, + // { + // title:'璁″垝绫诲埆', + // align:"center", + // dataIndex: 'planCategory' + // }, + { + title:'鐢宠浜�', + align:"center", + dataIndex: 'applicant' + }, + { + title:'鐢宠杞﹂棿', + align:"center", + dataIndex: 'applicantProduction_dictText' + }, + { + title:'璁″垝寮�濮嬫棩鏈�', + align:"center", + dataIndex: 'planStartDate' + }, + { + title:'璁″垝瀹屾垚鏃ユ湡', + align:"center", + dataIndex: 'planEndDate' + }, + { + title:'璁″垝鎻忚堪', + align:"center", + dataIndex: 'planDescription' + }, + { + title:'瀹炴柦鍙婂崗鍔╅儴闂�', + align:"center", + dataIndex: 'relatedDeparts' + }, + { + title:'澶囨敞', + align:"center", + dataIndex: 'remark' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/eam/eamEquipmentPurchasePlan/list", + submit: "/eam/eamEquipmentPurchasePlan/submit", + audit: "/eam/eamEquipmentPurchasePlan/audit", + delete: "/eam/eamEquipmentPurchasePlan/delete", + deleteBatch: "/eam/eamEquipmentPurchasePlan/deleteBatch", + exportXlsUrl: "/eam/eamEquipmentPurchasePlan/exportXls", + importExcelUrl: "eam/eamEquipmentPurchasePlan/importExcel", + templateXlsDownloadUrl: '瀵煎叆妯℃澘/璁惧閲囪喘璁″垝瀵煎叆妯℃澘_v1.1.xlsx' + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + handleTemplateXlsDownload() { + templateXlsDownload(this.url.templateXlsDownloadUrl) + }, + handleSubmit(id) { + getAction(this.url.submit,{ id: id }).then((res)=>{ + if(res.success){ + this.$message.success(res.message); + this.loadData(this.queryParam); + }else{ + this.$message.warning(res.message); + } + }) + }, + handleAudit(record) { + this.$refs.modalAuditForm.edit(record); + this.$refs.modalAuditForm.title="瀹℃牳"; + this.$refs.modalAuditForm.disableSubmit = true; + }, + onClearSelected() { + this.selectedRowKeys = []; + this.selectionRows = []; + this.$refs.eamPurchasePlanAttachmentList.dataSource = [] + this.$refs.eamPurchasePlanAttachmentList.onClearSelected() + }, + customTableRow(record) { + return { + style: { + cursor: 'pointer' + }, + on: { + click: () => { + this.onSelectChange([record.id]) + } + } + } + }, + onSelectChange(selectedRowKeys, selectionRows) { + this.selectedRowKeys = selectedRowKeys + this.selectionRows = selectionRows + this.$refs.eamPurchasePlanAttachmentList.queryParam.planId = selectedRowKeys[0] + this.$refs.eamPurchasePlanAttachmentList.dataSource = [] + this.$refs.eamPurchasePlanAttachmentList.onClearSelected() + if (selectedRowKeys.length === 1) { + this.$refs.eamPurchasePlanAttachmentList.loadData() + } + }, + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'planName',text:'閲囪喘璁″垝鍚嶇О',dictCode:''}) + fieldList.push({type:'string',value:'planCode',text:'閲囪喘璁″垝缂栫爜',dictCode:''}) + fieldList.push({type:'string',value:'planStatus',text:'璁″垝鐘舵��',dictCode:''}) + fieldList.push({type:'string',value:'equipmentModel',text:'鍨嬪彿',dictCode:''}) + fieldList.push({type:'int',value:'purchaseNumber',text:'閲囪喘鏁伴噺',dictCode:''}) + fieldList.push({type:'BigDecimal',value:'estimatedUnitPrice',text:'棰勮鍗曚环',dictCode:''}) + fieldList.push({type:'BigDecimal',value:'totalPrice',text:'鎬讳环',dictCode:''}) + fieldList.push({type:'BigDecimal',value:'overallContractAmount',text:'鍚堝悓鎬婚噾棰�',dictCode:''}) + fieldList.push({type:'string',value:'equipmentImportance',text:'ABC鏍囪瘑(绠$悊鍒嗙被)',dictCode:''}) + fieldList.push({type:'string',value:'planCategory',text:'璁″垝绫诲埆',dictCode:''}) + fieldList.push({type:'string',value:'applicant',text:'鐢宠浜�',dictCode:''}) + fieldList.push({type:'string',value:'applicantProduction',text:'鐢宠杞﹂棿',dictCode:''}) + fieldList.push({type:'date',value:'planStartDate',text:'璁″垝寮�濮嬫棩鏈�'}) + fieldList.push({type:'date',value:'planEndDate',text:'璁″垝瀹屾垚鏃ユ湡'}) + fieldList.push({type:'string',value:'planDescription',text:'璁″垝鎻忚堪',dictCode:''}) + fieldList.push({type:'string',value:'relatedDeparts',text:'瀹炴柦鍙婂崗鍔╅儴闂�',dictCode:''}) + fieldList.push({type:'string',value:'remark',text:'澶囨敞',dictCode:''}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/purchase/EamPurchasePlanAttachmentList.vue b/src/views/eam/purchase/EamPurchasePlanAttachmentList.vue new file mode 100644 index 0000000..b0c59be --- /dev/null +++ b/src/views/eam/purchase/EamPurchasePlanAttachmentList.vue @@ -0,0 +1,186 @@ +<template> + <a-card :bordered="false"> + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel"> + <a-icon type="delete" /> + 鍒犻櫎 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down" /> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a + style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange"> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handlePreview(record)">棰勮</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾涓嬭浇鏂囦欢鍚�?" @confirm="() => handleDownload(record)"> + <a>涓嬭浇</a> + </a-popconfirm> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <eam-purchase-plan-attachment-modal ref="modalForm" @ok="modalFormOk" :planId="queryParam.planId"></eam-purchase-plan-attachment-modal> + <lx-file-preview ref="lxFilePreview" :fileUrl="fileUrl"></lx-file-preview> + </a-card> +</template> + +<script> +import '@/assets/less/TableExpand.less' +import EamPurchasePlanAttachmentModal from './modules/EamPurchasePlanAttachmentModal.vue' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import { downFile } from '@api/manage' + +export default { + name: 'EamPurchasePlanAttachmentList', + mixins: [JeecgListMixin], + components: { + EamPurchasePlanAttachmentModal + }, + data() { + return { + description: '璁惧閲囪喘璁″垝闄勪欢绠$悊椤甸潰', + disableMixinCreated: true, + fileUrl: '', + queryParam: {}, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鏂囦欢鍔犲瘑鍚�', + align: 'center', + dataIndex: 'fileEncodeName', + ellipsis: true, + }, + { + title: '鏂囦欢鍚嶇О', + align: 'center', + dataIndex: 'fileName', + ellipsis: true, + }, + { + title: '鏂囦欢璺緞', + align: 'center', + dataIndex: 'filePath', + ellipsis: true, + }, + { + title: '鏂囦欢鍚庣紑鍚�', + align: 'center', + dataIndex: 'fileSuffix' + }, + { + title: '鏂囦欢澶у皬', + align: 'center', + dataIndex: 'fileSize' + }, + { + title: '鎻忚堪', + align: 'center', + dataIndex: 'description', + ellipsis: true, + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: '/eam/eamPurchasePlanAttachment/list', + delete: '/eam/eamPurchasePlanAttachment/delete', + deleteBatch: '/eam/eamPurchasePlanAttachment/deleteBatch', + download: '/eam/eamPurchasePlanAttachment/downloadFile', + } + } + }, + computed: { + }, + methods: { + handleDownload(record) { + downFile(this.url.download, { id: record.id }).then((res) => { + if (!res) { + this.$message.warning('鏂囦欢涓嬭浇澶辫触') + return + } else { + let fileName = record.fileName; + if (typeof window.navigator.msSaveBlob !== 'undefined') { + window.navigator.msSaveBlob(new Blob([res]), fileName); + } else { + let url = window.URL.createObjectURL(new Blob([res])); + let link = document.createElement('a'); + link.style.display = 'none'; + link.href = url; + link.setAttribute('download', fileName); + document.body.appendChild(link); + link.click() + document.body.removeChild(link) //涓嬭浇瀹屾垚绉婚櫎鍏冪礌 + window.URL.revokeObjectURL(url) //閲婃斁鎺塨lob瀵硅薄 + } + } + }) + }, + handlePreview: function (record) { + this.$refs.lxFilePreview.preview(record.filePath); + }, + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/purchase/modules/EamEquipmentPurchasePlanAuditModal.vue b/src/views/eam/purchase/modules/EamEquipmentPurchasePlanAuditModal.vue new file mode 100644 index 0000000..e95c76d --- /dev/null +++ b/src/views/eam/purchase/modules/EamEquipmentPurchasePlanAuditModal.vue @@ -0,0 +1,82 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <template slot="footer"> + <a-button type="primary" @click="audit('COMPLETED')">閫氳繃</a-button> + <a-button type="danger" @click="audit('REJECT')">椹冲洖</a-button> + </template> + + <eam-equipment-purchase-plan-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></eam-equipment-purchase-plan-form> + </j-modal> +</template> + +<script> + + import EamEquipmentPurchasePlanForm from './EamEquipmentPurchasePlanForm' + import { postAction } from '../../../../api/manage' + export default { + name: 'EamEquipmentPurchasePlanModal', + components: { + EamEquipmentPurchasePlanForm + }, + data () { + return { + title:'', + width:1200, + visible: false, + disableSubmit: false, + url: { + audit: "/eam/eamEquipmentPurchasePlan/audit" + } + } + }, + methods: { + audit (status) { + console.log(status) + const id = this.$refs.realForm.model.id + postAction(this.url.audit,{ id: id, planStatus: status }).then((res)=>{ + if (res.success) { + this.$message.success(res.message) + this.submitCallback() + } else { + this.$message.warning(res.message) + } + }) + }, + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/src/views/eam/purchase/modules/EamEquipmentPurchasePlanForm.vue b/src/views/eam/purchase/modules/EamEquipmentPurchasePlanForm.vue new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/views/eam/purchase/modules/EamEquipmentPurchasePlanForm.vue diff --git a/src/views/eam/purchase/modules/EamEquipmentPurchasePlanModal.vue b/src/views/eam/purchase/modules/EamEquipmentPurchasePlanModal.vue new file mode 100644 index 0000000..72cde25 --- /dev/null +++ b/src/views/eam/purchase/modules/EamEquipmentPurchasePlanModal.vue @@ -0,0 +1,61 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <eam-equipment-purchase-plan-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></eam-equipment-purchase-plan-form> + </j-modal> +</template> + +<script> + + import EamEquipmentPurchasePlanForm from './EamEquipmentPurchasePlanForm' + export default { + name: 'EamEquipmentPurchasePlanModal', + components: { + EamEquipmentPurchasePlanForm + }, + data () { + return { + title:'', + width:1200, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/src/views/eam/purchase/modules/EamPurchasePlanAttachmentModal.vue b/src/views/eam/purchase/modules/EamPurchasePlanAttachmentModal.vue new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/views/eam/purchase/modules/EamPurchasePlanAttachmentModal.vue diff --git a/src/views/eam/repair/EamMajorPartialRepairList.vue b/src/views/eam/repair/EamMajorPartialRepairList.vue new file mode 100644 index 0000000..b3176e9 --- /dev/null +++ b/src/views/eam/repair/EamMajorPartialRepairList.vue @@ -0,0 +1,496 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="缁翠慨缂栫爜"> + <a-input placeholder="璇疯緭鍏ョ淮淇紪鐮�" v-model="queryParam.repairCode"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="椤圭洰鍚嶇О"> + <a-input placeholder="璇疯緭鍏ラ」鐩悕绉�" v-model="queryParam.repairName"></a-input> + </a-form-item> + </a-col> + <template v-if="toggleSearchStatus"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="缁翠慨鐘舵��"> + <j-dict-select-tag placeholder="璇烽�夋嫨缁翠慨鐘舵��" v-model="queryParam.repairStatus" dictCode="major_partial_repair_status"/> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="缁翠慨绫诲瀷"> + <a-select v-model="queryParam.repairType" placeholder="璇烽�夋嫨缁翠慨绫诲瀷"> + <a-select-option value="澶т慨">澶т慨</a-select-option> + <a-select-option value="椤逛慨">椤逛慨</a-select-option> + </a-select> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="璁″垝寮�濮嬫棩鏈�"> + <a-range-picker + v-model="planDateRange" + @change="selectDateChange" + format="YYYY-MM-DD" + value-format="YYYY-MM-DD" + /> + </a-form-item> + </a-col> + </template> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + <a @click="handleToggleSearch" style="margin-left: 8px"> + {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }} + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> + </a> + </span> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> +<!-- <a-button type="primary" icon="download" @click="handleExportXls('eam_major_partial_repair')">瀵煎嚭</a-button>--> +<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">--> +<!-- <a-button type="primary" icon="import">瀵煎叆</a-button>--> +<!-- </a-upload>--> + <!-- 楂樼骇鏌ヨ鍖哄煙 --> +<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>--> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchSubmit"><a-icon type="form"/>鎻愪氦</a-menu-item> + <a-menu-item key="2" @click="batchConfirm"><a-icon type="check"/>纭</a-menu-item> + <a-menu-item key="3" @click="batchRepeal"><a-icon type="close"/>浣滃簾</a-menu-item> + <a-menu-item key="4" @click="batchDel"><a-icon type="delete"/>鍒犻櫎</a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleDetail(record)">璇︽儏</a> + <span v-if="record.repairStatus === 'PENDING_SUBMISSION'"> + <a-divider type="vertical" /> + <a-popconfirm title="纭畾瑕佹彁浜ゅ悧?" @confirm="() => handleSubmit(record.id)"> + <a>鎻愪氦</a> + </a-popconfirm> + </span> + <span v-if="record.repairStatus === 'PENDING_CONFIRMATION'"> + <a-divider type="vertical" /> + <a-popconfirm title="瑕佸畬鎴愮‘璁ゅ悧?" @confirm="() => handleConfirm(record.id)"> + <a>纭</a> + </a-popconfirm> + </span> + <span v-if="record.repairStatus === 'CONFIRMED'"> + <a-divider type="vertical" /> + <a @click="handleFill(record)">濉姤</a> + </span> + + <span v-if="record.repairStatus === 'PENDING_SUBMISSION'"> + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村<a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleEdit(record)">缂栬緫</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + </span> + + </a-table> + </div> + + <eam-major-partial-repair-modal ref="modalForm" @ok="modalFormOk"></eam-major-partial-repair-modal> + <eam-major-partial-repair-detail-modal ref="modalDetailForm" @ok="modalFormOk"></eam-major-partial-repair-detail-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import EamMajorPartialRepairModal from './modules/EamMajorPartialRepairModal' + import EamMajorPartialRepairDetailModal from './modules/EamMajorPartialRepairDetailModal' + import { getAction } from '../../../api/manage' + + export default { + name: 'EamMajorPartialRepairList', + mixins:[JeecgListMixin, mixinDevice], + components: { + EamMajorPartialRepairModal, + EamMajorPartialRepairDetailModal + }, + data () { + return { + description: '澶т慨椤逛慨绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'缁翠慨缂栫爜', + align:"center", + dataIndex: 'repairCode' + }, + { + title:'椤圭洰鍚嶇О', + align:"center", + dataIndex: 'repairName' + }, + { + title:'缁翠慨鐘舵��', + align:"center", + dataIndex: 'repairStatus_dictText' + }, + { + title:'缁翠慨绫诲瀷', + align:"center", + dataIndex: 'repairType' + }, + { + title:'鐢宠浜�', + align:"center", + dataIndex: 'applicant_dictText' + }, + { + title:'鐢宠杞﹂棿', + align:"center", + dataIndex: 'applicantProduction_dictText' + }, + { + title:'璁″垝寮�濮嬫棩鏈�', + align:"center", + dataIndex: 'planStartDate' + }, + { + title:'璁″垝缁撴潫鏃ユ湡', + align:"center", + dataIndex: 'planEndDate' + }, + { + title:'瀹為檯寮�濮嬫椂闂�', + align:"center", + dataIndex: 'actualStartTime' + }, + { + title:'瀹為檯缁撴潫鏃堕棿', + align:"center", + dataIndex: 'actualEndTime' + }, + { + title:'鎬婚噾棰�', + align:"center", + dataIndex: 'totalAmount' + }, + // { + // title:'鏁呴殰鎻忚堪', + // align:"center", + // dataIndex: 'faultDescription' + // }, + // { + // title:'鐢宠鍘熷洜', + // align:"center", + // dataIndex: 'applicantReason' + // }, + { + title:'璐d换浜�', + align:"center", + dataIndex: 'responsiblePerson_dictText' + }, + { + title:'澶囨敞', + align:"center", + dataIndex: 'remark' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/eam/eamMajorPartialRepair/list", + delete: "/eam/eamMajorPartialRepair/delete", + deleteBatch: "/eam/eamMajorPartialRepair/deleteBatch", + exportXlsUrl: "/eam/eamMajorPartialRepair/exportXls", + importExcelUrl: "eam/eamMajorPartialRepair/importExcel", + submit: "eam/eamMajorPartialRepair/submit", + submitBatch: "eam/eamMajorPartialRepair/submitBatch", + confirm: "eam/eamMajorPartialRepair/confirm", + confirmBatch: "eam/eamMajorPartialRepair/confirmBatch", + repeal: "eam/eamMajorPartialRepair/repeal", + repealBatch: "eam/eamMajorPartialRepair/repealBatch" + }, + planDateRange: [], + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + searchReset() { + this.planDateRange = [] + this.queryParam = {} + this.loadData(1); + }, + selectDateChange(value, dateString) { + if (dateString && dateString.length === 2) { + this.queryParam.planStartDate = dateString[0] + this.queryParam.planEndDate = dateString[1] + } + }, + handleFill(record) { + this.$refs.modalDetailForm.open(record); + this.$refs.modalDetailForm.title = "濉姤"; + this.$refs.modalDetailForm.disableSubmit = false; + }, + handleSubmit(id) { + getAction(this.url.submit,{id:id}).then((res)=>{ + if(res.success){ + this.loadData(); + this.$message.success(res.message); + } else { + this.$message.warning(res.message); + } + }) + }, + handleConfirm(id) { + getAction(this.url.confirm,{id:id}).then((res)=>{ + if(res.success){ + this.loadData(); + this.$message.success(res.message); + } else { + this.$message.warning(res.message); + } + }) + }, + batchSubmit() { + if (this.selectedRowKeys.length <= 0) { + this.$notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�' + }) + return + } else { + var ids = '' + for (var a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' + } + var that = this + this.$confirm({ + title: '纭鎻愪氦', + content: '鏄惁鎻愪氦閫変腑鏁版嵁锛屽彧鏈夊緟鎻愪氦鐘舵�佺殑鏁版嵁鎵嶅彲鎻愪氦鎴愬姛?', + onOk: function () { + that.loading = true + getAction(that.url.submitBatch, { ids: ids }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(that.selectedRowKeys.length) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + that.onClearSelected() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.loading = false + }) + } + }) + } + }, + batchConfirm() { + if (this.selectedRowKeys.length <= 0) { + this.$notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�' + }) + return + } else { + var ids = '' + for (var a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' + } + var that = this + this.$confirm({ + title: '鏄惁纭', + content: '鏄惁纭閫変腑鏁版嵁锛屽彧鏈夊緟纭鐘舵�佺殑鏁版嵁鎵嶅彲纭鎴愬姛?', + onOk: function () { + that.loading = true + getAction(that.url.confirmBatch, { ids: ids }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(that.selectedRowKeys.length) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + that.onClearSelected() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.loading = false + }) + } + }) + } + }, + batchRepeal() { + if (this.selectedRowKeys.length <= 0) { + this.$notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�' + }) + return + } else { + var ids = '' + for (var a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' + } + var that = this + this.$confirm({ + title: '鏄惁浣滃簾', + content: '鏄惁浣滃簾閫変腑鏁版嵁锛屽彧鏈夊緟鎻愪氦鐘舵�佺殑鏁版嵁鎵嶅彲浣滃簾鎴愬姛?', + onOk: function () { + that.loading = true + getAction(that.url.repealBatch, { ids: ids }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(that.selectedRowKeys.length) + // that.$message.success(res.message); + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.loadData() + that.onClearSelected() + } else { + // that.$message.warning(res.message); + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.loading = false + }) + } + }) + } + }, + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'repairCode',text:'缁翠慨缂栫爜',dictCode:''}) + fieldList.push({type:'string',value:'repairName',text:'椤圭洰鍚嶇О',dictCode:''}) + fieldList.push({type:'string',value:'repairStatus',text:'缁翠慨鐘舵��',dictCode:''}) + fieldList.push({type:'string',value:'repairType',text:'缁翠慨绫诲瀷',dictCode:''}) + fieldList.push({type:'string',value:'applicant',text:'鐢宠浜�',dictCode:''}) + fieldList.push({type:'string',value:'applicantProduction',text:'鐢宠杞﹂棿',dictCode:''}) + fieldList.push({type:'date',value:'planStartDate',text:'璁″垝寮�濮嬫棩鏈�'}) + fieldList.push({type:'date',value:'planEndDate',text:'璁″垝缁撴潫鏃ユ湡'}) + fieldList.push({type:'date',value:'actualStartTime',text:'瀹為檯寮�濮嬫椂闂�'}) + fieldList.push({type:'date',value:'actualEndTime',text:'瀹為檯缁撴潫鏃堕棿'}) + fieldList.push({type:'BigDecimal',value:'totalAmount',text:'鎬婚噾棰�',dictCode:''}) + fieldList.push({type:'string',value:'faultDescription',text:'鏁呴殰鎻忚堪',dictCode:''}) + fieldList.push({type:'string',value:'applicantReason',text:'鐢宠鍘熷洜',dictCode:''}) + fieldList.push({type:'string',value:'responsiblePerson',text:'璐d换浜�',dictCode:''}) + fieldList.push({type:'string',value:'remark',text:'澶囨敞',dictCode:''}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/repair/EamRepairOrderList.vue b/src/views/eam/repair/EamRepairOrderList.vue new file mode 100644 index 0000000..60f7a56 --- /dev/null +++ b/src/views/eam/repair/EamRepairOrderList.vue @@ -0,0 +1,299 @@ +<template> + <a-card :bordered="false"> + + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper" v-if="isDisplayOperation"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="宸ュ崟缂栧彿"> + <a-input placeholder="璇疯緭鍏ュ伐鍗曠紪鍙�" v-model="queryParam.repairCode"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="璁惧缂栧彿"> + <!--<a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.equipmentId"/>--> + <lx-search-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" v-model="queryParam.equipmentId"/> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鍗曟嵁鐘舵��"> + <a-select placeholder="璇烽�夋嫨鍗曟嵁鐘舵��" v-model="queryParam.repairStatus" allow-clear> + <a-select-option v-for="item in report_repair_status_list" :key="item.value">{{ item.label }} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + <template v-if="toggleSearchStatus"> + + </template> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + <!--<a @click="handleToggleSearch" style="margin-left: 8px">--> + <!--{{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }}--> + <!--<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>--> + <!--</a>--> + </span> + </a-col> + + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator" v-if="isDisplayOperation"> + <a-button @click="handleOpenReceiveFaultModal" type="primary" icon="plus" v-if="isShowAuth('eam:repair:collect')">棰嗗彇</a-button> + <!--<a-button type="primary" icon="download" @click="handleExportXls('缁翠慨宸ュ崟')">瀵煎嚭</a-button>--> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel"> + <a-icon type="delete"/> + 鍒犻櫎 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down"/> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;" v-if="isDisplayOperation"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a + style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange" + :scroll="{x:'max-content'}" + > + <span slot="action" slot-scope="text, record"> + <a @click="handleDetail(record)">璇︽儏</a> + </span> + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <receive-fault-modal ref="receiveFaultModalRef" @ok="loadData"/> + </a-card> +</template> + +<script> + import '@/assets/less/TableExpand.less' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import ReceiveFaultModal from './modules/EamRepairOrderList/ReceiveFaultModal' + import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' + import LxSearchEquipmentSelect from '../equipment/modules/LxSearchEquipmentSelect' + + + export default { + name: 'EamRepairOrderList', + mixins: [JeecgListMixin], + components: { + LxSearchEquipmentSelect, + ReceiveFaultModal + }, + props: { + isDisplayOperation: { + type: Boolean, + default: true + } + }, + data() { + return { + description: '缁翠慨宸ュ崟绠$悊椤甸潰', + disableMixinCreated: true, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + }, + fixed: 'left', + }, + { + title: '宸ュ崟缂栧彿', + align: 'center', + dataIndex: 'repairCode', + width: 120, + fixed: 'left' + }, + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentCode', + width: 120, + fixed: 'left' + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName', + width: 200, + fixed: 'left' + }, + { + title: '鐘舵��', + align: 'center', + dataIndex: 'repairStatus_dictText', + fixed: 'left', + width: 100 + }, + { + title: '缁翠慨璐熻矗浜�', + align: 'center', + dataIndex: 'repairer', + width: 100 + }, + { + title: '缁翠慨寮�濮嬫椂闂�', + align: 'center', + dataIndex: 'actualStartTime', + width: 200 + }, + { + title: '缁翠慨缁撴潫鏃堕棿', + align: 'center', + dataIndex: 'actualEndTime', + width: 200 + }, + { + title: '鏁呴殰鍘熷洜', + align: 'center', + dataIndex: 'faultReason' + }, + { + title: '缁翠慨缁撴灉鎻忚堪', + align: 'center', + dataIndex: 'repairDescription' + // width: 300 + } + // { + // title: '缁翠慨鍥剧墖', + // align: 'center', + // dataIndex: 'imageFiles', + // width: 100 + // }, + // { + // title: '鏄惁濮斿', + // align: 'center', + // dataIndex: 'outsourcedFlag', + // width: 100 + // }, + // { + // title: '濮斿缁翠慨鎻忚堪', + // align: 'center', + // dataIndex: 'outsourcedRepairDecription', + // width: 300 + // }, + // { + // title: '濮斿缁翠慨寮�濮嬫椂闂�', + // align: 'center', + // dataIndex: 'outsourcedStartTime', + // width: 200 + // }, + // { + // title: '濮斿缁翠慨缁撴潫鏃堕棿', + // align: 'center', + // dataIndex: 'outsourcedEndTime', + // width: 200 + // }, + // { + // title: '濮斿璐熻矗浜�', + // align: 'center', + // dataIndex: 'outsourcedPerson', + // width: 100 + // }, + ], + report_repair_status_list: [], + selectRepairOrderData: {}, + url: { + list: '/eam/eamRepairOrder/list', + delete: '/eam/eamRepairOrder/delete', + deleteBatch: '/eam/eamRepairOrder/deleteBatch', + exportXlsUrl: 'eam/eamRepairOrder/exportXls' + } + } + }, + computed: { + importExcelUrl: function() { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` + } + }, + created() { + if (!this.isDisplayOperation) { + return + } + this.initDictData('report_repair_status') + const operationColumn = { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + width: 100, + scopedSlots: { customRender: 'action' } + } + this.columns = [...this.columns, operationColumn] + this.loadData(1) + }, + methods: { + /** + * 鑾峰彇鏁版嵁瀛楀吀鍊� + * @param dictCode 鏁版嵁瀛楀吀瀵瑰簲璁板綍缂栫爜 + */ + initDictData(dictCode) { + // //浼樺厛浠庣紦瀛樹腑璇诲彇瀛楀吀閰嶇疆 + if (getDictItemsFromCache(dictCode)) { + this[dictCode + '_list'] = getDictItemsFromCache(dictCode) + return + } + //鏍规嵁瀛楀吀Code, 鍒濆鍖栧瓧鍏告暟缁� + ajaxGetDictItems(dictCode, null).then((res) => { + if (res.success) { + this[dictCode + '_list'] = res.result + return + } + }) + }, + + // 寮�鍚鍙栨晠闅滀繚淇崟寮圭獥 + handleOpenReceiveFaultModal() { + this.$refs.receiveFaultModalRef.visible = true + }, + + /** + * 鐐瑰嚮璇︽儏瑙﹀彂 + * @param record 琛ㄦ牸琛屼俊鎭� + */ + handleDetail(record) { + this.selectRepairOrderData = Object.assign({}, record) + this.$refs.repairOrderApprovalModal.visible = true + this.$refs.repairOrderApprovalModal.title = '璇︽儏' + this.$refs.repairOrderApprovalModal.disableSubmit = true + this.$refs.repairOrderApprovalModal.getAllApproveData(record) + this.$refs.repairOrderApprovalModal.getBasicInformation({ ...record, dataId: record.id }) + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/repair/EamReportRepairList.vue b/src/views/eam/repair/EamReportRepairList.vue new file mode 100644 index 0000000..0984200 --- /dev/null +++ b/src/views/eam/repair/EamReportRepairList.vue @@ -0,0 +1,352 @@ +<template> + <a-card :bordered="false"> + + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="璁惧缂栧彿"> + <!--<a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.equipmentId"/>--> + <lx-search-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" v-model="queryParam.equipmentId"/> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24" v-if="isDisplayOperation"> + <a-form-item label="鎶ヤ慨鐘舵��"> + <a-select placeholder="璇烽�夋嫨鎶ヤ慨鐘舵��" v-model="queryParam.reportStatus" allow-clear> + <a-select-option v-for="item in report_repair_status_list" :key="item.value">{{ item.label }} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鏁呴殰鎻忚堪"> + <a-input placeholder="璇疯緭鍏ユ晠闅滄弿杩�" v-model="queryParam.faultDescription" allow-clear/> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鏁呴殰鏃堕棿"> + <a-range-picker showTime v-model="faultTimeRange" value-format="YYYY-MM-DD HH:mm:ss" + @change="handleTimeRangeChange" + style="width: 100%"/> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="鏄惁鍋滄満"> + <a-radio-group v-model="queryParam.breakdownFlag"> + <a-radio v-for="item in breakdown_flag_list" :value="item.value">{{ item.label }}</a-radio> + </a-radio-group> + </a-form-item> + </a-col> + <template v-if="toggleSearchStatus"> + + </template> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + <!-- <a @click="handleToggleSearch" style="margin-left: 8px">--> + <!-- {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }}--> + <!-- <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>--> + <!-- </a>--> + </span> + </a-col> + + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator" v-if="isDisplayOperation"> + <a-button @click="handleAdd" type="primary" icon="plus" v-if="isShowAuth('eam:reportRepair:add')">鏂板</a-button> + <!--<a-button type="primary" icon="download" @click="handleExportXls('鏁呴殰鎶ヤ慨')">瀵煎嚭</a-button>--> + <!--<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"--> + <!--@change="handleImportExcel">--> + <!--<a-button type="primary" icon="import">瀵煎叆</a-button>--> + <!--</a-upload>--> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel" v-if="isShowAuth('eam:reportRepair:abolish')"> + <a-icon type="delete"/> + 浣滃簾 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 + <a-icon type="down"/> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;" v-if="isDisplayOperation"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a + style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:isDisplayOperation?'checkbox':'radio',getCheckboxProps:getCheckboxProps}" + @change="handleTableChange"> + + <template slot="imageFiles" slot-scope="text, record" v-if="text"> + <a @click="handlePreviewImages(record)">棰勮</a> + </template> + + <span slot="action" slot-scope="text, record" v-if="record.reportStatus=='WAIT_REPAIR'"> + <a @click="handleEdit(record)" v-if="isShowAuth('eam:reportRepair:edit')">缂栬緫</a> + + <a-divider type="vertical" v-if="isShowAuth('eam:reportRepair:edit')"/> + + <a @click="handleAssign(record)" v-if="isShowAuth('eam:reportRepair:assign')">鎸囨淳</a> + + <a-divider type="vertical" v-if="isShowAuth('eam:reportRepair:assign')"/> + + <a-popconfirm title="纭畾浣滃簾鍚�?" @confirm="() => handleDelete(record.id)" v-if="isShowAuth('eam:reportRepair:abolish')"> + <a>浣滃簾</a> + </a-popconfirm> + </span> + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <eamReportRepair-modal ref="modalForm" :breakdownFlagList="breakdown_flag_list" :faultReasonList="faultReasonList" + @ok="modalFormOk"/> + <!-- 鍥剧墖棰勮寮圭獥 --> + <images-preview-modal ref="imagesPreviewModalRef" :imageListUrl="currentImageListUrl"/> + <!--鎸囨淳鎶ヤ慨寮圭獥--> + <assign-repair-report-modal ref="assignRepairReportModalRef" @ok="modalFormOk"/> + </a-card> +</template> + +<script> + import '@/assets/less/TableExpand.less' + import EamReportRepairModal from './modules/EamReportRepairList/EamReportRepairModal' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' + import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' + import ImagesPreviewModal from '@views/eam/repair/modules/ImagesPreviewModal.vue' + import { getAction } from '@/api/manage' + import AssignRepairReportModal from './modules/EamReportRepairList/AssignRepairReportModal' + + + export default { + name: 'EamReportRepairList', + mixins: [JeecgListMixin], + components: { + AssignRepairReportModal, + ImagesPreviewModal, + LxSearchEquipmentSelect, + EamReportRepairModal + }, + props: { + isDisplayOperation: { + type: Boolean, + default: true + }, + propsQueryParam: { + type: Object + } + }, + data() { + return { + description: '鏁呴殰鎶ヤ慨绠$悊椤甸潰', + disableMixinCreated: true, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentCode', + width: 200 + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName', + width: 200 + }, + { + title: '鎶ヤ慨鐘舵��', + align: 'center', + dataIndex: 'reportStatus_dictText', + width: 100 + }, + { + title: '鏁呴殰绠�绉�', + align: 'center', + dataIndex: 'faultName', + width: 100 + }, + { + title: '鏁呴殰鍒嗙被', + align: 'center', + dataIndex: 'faultType_dictText', + width: 100 + }, + { + title: '鏁呴殰鎻忚堪', + align: 'center', + dataIndex: 'faultDescription', + width: 200 + }, + { + title: '鏁呴殰寮�濮嬫椂闂�', + align: 'center', + dataIndex: 'faultStartTime', + width: 200 + }, + { + title: '鏄惁鍋滄満', + align: 'center', + dataIndex: 'breakdownFlag_dictText', + width: 100 + }, + { + title: '鎶ヤ慨鍥剧墖', + align: 'center', + dataIndex: 'imageFiles', + scopedSlots: { customRender: 'imageFiles' }, + width: 100 + }, + { + title: '澶囨敞', + align: 'center', + dataIndex: 'remark' + } + ], + breakdown_flag_list: [], + report_repair_status_list: [], + faultTimeRange: [], + faultReasonList: [], + currentImageListUrl: '', + url: { + list: '/eam/eamReportRepair/list', + delete: '/eam/eamReportRepair/abolish', + deleteBatch: '/eam/eamReportRepair/abolishBatch', + exportXlsUrl: 'eam/eamReportRepair/exportXls', + importExcelUrl: 'eam/eamReportRepair/importExcel', + faultReasonList: '/eam/equipmentFaultReason/list' + } + } + }, + computed: { + importExcelUrl: function() { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` + } + }, + created() { + this.initDictData('breakdown_flag') + this.initDictData('report_repair_status') + if (!this.isDisplayOperation) this.queryParam = Object.assign({}, this.propsQueryParam) + else { + const operationColumn = { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' }, + width: 200 + } + this.columns = [...this.columns, operationColumn] + this.getFaultReasonListByApi() + } + this.loadData(1) + }, + methods: { + /** + * 鑾峰彇鏁版嵁瀛楀吀鍊� + * @param dictCode 鏁版嵁瀛楀吀瀵瑰簲璁板綍缂栫爜 + */ + initDictData(dictCode) { + // //浼樺厛浠庣紦瀛樹腑璇诲彇瀛楀吀閰嶇疆 + if (getDictItemsFromCache(dictCode)) { + this[dictCode + '_list'] = getDictItemsFromCache(dictCode) + return + } + //鏍规嵁瀛楀吀Code, 鍒濆鍖栧瓧鍏告暟缁� + ajaxGetDictItems(dictCode, null).then((res) => { + if (res.success) { + this[dictCode + '_list'] = res.result + return + } + }) + }, + + // 璋冪敤鎺ュ彛鑾峰彇鏁呴殰鍘熷洜鍒楄〃 + getFaultReasonListByApi() { + const that = this + getAction(this.url.faultReasonList) + .then(res => { + console.log('res', res) + that.faultReasonList = res.result.records + }) + }, + + /** + * 鏁呴殰鏃堕棿閫夋嫨鍣ㄥ彉鍖栨椂瑙﹀彂 + * @param valueArray + */ + handleTimeRangeChange(valueArray) { + this.queryParam.startTime = valueArray[0] + this.queryParam.endTime = valueArray[1] + }, + + /** + * 棰勮鍥剧墖 + * @param imageFiles 琛ㄦ牸琛屽浘鐗囧湴鍧� + */ + handlePreviewImages({ imageFiles }) { + this.currentImageListUrl = imageFiles + this.$refs.imagesPreviewModalRef.visible = true + }, + + /** + * 鎸囨淳鎶ヤ慨鍗� + * @param record 琛ㄦ牸琛屼俊鎭� + */ + handleAssign(record) { + this.$refs.assignRepairReportModalRef.visible = true + this.$refs.assignRepairReportModalRef.model = Object.assign({}, { id: record.id }) + }, + + getCheckboxProps(record) { + return { + props: { + disabled: record.reportStatus !== 'WAIT_REPAIR' + } + } + }, + + searchReset() { + if (this.isDisplayOperation) this.queryParam = {} + else this.queryParam = Object.assign({}, this.propsQueryParam) + this.faultTimeRange = [] + this.loadData(1) + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/repair/modules/EamMajorPartialRepairDetailModal.vue b/src/views/eam/repair/modules/EamMajorPartialRepairDetailModal.vue new file mode 100644 index 0000000..96bef70 --- /dev/null +++ b/src/views/eam/repair/modules/EamMajorPartialRepairDetailModal.vue @@ -0,0 +1,137 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <j-vxe-table + ref="editableDetailTable" + :rowNumber="true" + :rowSelection="false" + :bordered="false" + :alwaysEdit="true" + :toolbar="false" + keep-source + :height="300" + :loading="detail.loading" + :dataSource="detail.dataSource" + :columns="equipmentColumns" + style="margin-top: 8px;" /> + + </j-modal> + +</template> + +<script> + +import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' +import { JVXETypes } from '@/components/jeecg/JVxeTable' +import { getAction, postAction } from '../../../../api/manage' + +export default { + name: 'EamMajorPartialRepairDetailModal', + mixins: [JVxeTableModelMixin], + data() { + return { + title: '', + width: 1200, + visible: false, + disableSubmit: false, + equipmentOptions: [], + detail: { + loading: false, + dataSource: [] + }, + url: { + queryDetailList: '/eam/eamMajorPartialRepairDetail/list', + fillResult: '/eam/eamMajorPartialRepair/fillResult' + } + } + }, + computed: { + equipmentColumns() { + return [ + { + title: '璁惧', + key: 'equipmentId_dictText', + type: JVXETypes.normal, + width: '25%', + align: 'center' + }, + { + title: '鍗曚环', + key: 'unitPrice', + type: JVXETypes.normal, + width: '10%', + align: 'center' + }, + { + title: '缁翠慨缁撴灉', + key: 'repairResult', + type: JVXETypes.textarea, + width: '30%', + align: 'center', + validateRules: [{ required: true, message: '缁翠慨缁撴灉涓嶈兘涓虹┖锛�' }] + }, + { + title: '缁翠慨鎻忚堪', + key: 'repairDescription', + type: JVXETypes.textarea, + width: '30%', + align: 'center', + validateRules: [{ required: true, message: '缁翠慨鎻忚堪涓嶈兘涓虹┖锛�' }] + } + ]; + } + }, + methods: { + open(record) { + this.visible = true + getAction(this.url.queryDetailList, { repairId: record.id }).then((res) => { + if (res.success) { + if (res.result.total) { + this.detail.dataSource = res.result.records + } + } + }) + }, + close() { + this.$emit('close') + this.visible = false + }, + async handleOk() { + // 馃憞 瑙﹀彂琛ㄦ牸鏍¢獙 + const errMap = await this.$refs.editableDetailTable.validateTable(); + + if (errMap) { + return; + } + + // 鏍¢獙閫氳繃锛岃幏鍙栬〃鏍兼暟鎹� + const tableData = this.$refs.editableDetailTable.getTableData(); + + postAction(this.url.fillResult, tableData).then((res) => { + if (res.success) { + this.$message.success(res.message) + // 馃憞 鎻愪氦鎴愬姛鍚庡叧闂脊绐� + this.submitCallback(); + } else { + this.$message.warning(res.message) + } + }) + }, + submitCallback() { + this.$emit('ok') + this.visible = false + }, + handleCancel() { + this.close() + } + } +} +</script> \ No newline at end of file diff --git a/src/views/eam/repair/modules/EamMajorPartialRepairForm.vue b/src/views/eam/repair/modules/EamMajorPartialRepairForm.vue new file mode 100644 index 0000000..9a95c52 --- /dev/null +++ b/src/views/eam/repair/modules/EamMajorPartialRepairForm.vue @@ -0,0 +1,306 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="8"> + <a-form-model-item label="缁翠慨缂栫爜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairCode"> + <a-input v-model="model.repairCode" placeholder="绯荤粺鑷姩鐢熸垚" disabled ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item label="椤圭洰鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairName"> + <a-input v-model="model.repairName" placeholder="璇疯緭鍏ラ」鐩悕绉�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="8" v-if="disabled"> + <a-form-model-item label="缁翠慨鐘舵��" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairStatus"> + <j-dict-select-tag placeholder="璇烽�夋嫨缁翠慨鐘舵��" v-model="model.repairStatus" dictCode="major_partial_repair_status" disabled/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item label="缁翠慨绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairType"> + <a-select v-model="model.repairType" placeholder="璇烽�夋嫨缁翠慨绫诲瀷"> + <a-select-option value="澶т慨">澶т慨</a-select-option> + <a-select-option value="椤逛慨">椤逛慨</a-select-option> + </a-select> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item label="鐢宠浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicant"> + <j-search-select-tag placeholder="璇烽�夋嫨鐢宠浜�" v-model="model.applicant" dict="sys_user,realname, username, del_flag=0 and status=1"/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item label="鐢宠杞﹂棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicantProduction"> + <a-tree-select v-model="model.applicantProduction" + style="width: 100%" + :tree-data="treeData" + :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" + placeholder="璇烽�夋嫨鐢宠杞﹂棿" + allow-clear + tree-default-expand-all + > + </a-tree-select> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item label="璁″垝寮�濮嬫棩鏈�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planStartDate"> + <j-date placeholder="璇烽�夋嫨璁″垝寮�濮嬫棩鏈�" v-model="model.planStartDate" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item label="璁″垝缁撴潫鏃ユ湡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planEndDate"> + <j-date placeholder="璇烽�夋嫨璁″垝缁撴潫鏃ユ湡" v-model="model.planEndDate" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="8" v-if="disabled"> + <a-form-model-item label="瀹為檯寮�濮嬫椂闂�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="actualStartTime"> + <j-date :show-time="true" dateFormat="YYYY-MM-DD HH" placeholder="璇烽�夋嫨瀹為檯寮�濮嬫椂闂�" v-model="model.actualStartTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="8" v-if="disabled"> + <a-form-model-item label="瀹為檯缁撴潫鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="actualEndTime"> + <j-date :show-time="true" dateFormat="YYYY-MM-DD HH" placeholder="璇烽�夋嫨瀹為檯缁撴潫鏃堕棿" v-model="model.actualEndTime" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="8" v-if="disabled"> + <a-form-model-item label="鎬婚噾棰�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="totalAmount"> + <a-input-number :min=0 :precision="2" v-model="model.totalAmount" placeholder="璇疯緭鍏ユ�婚噾棰�" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item label="鐢宠鍘熷洜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicantReason"> + <a-input v-model="model.applicantReason" placeholder="璇疯緭鍏ョ敵璇峰師鍥�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item label="璐d换浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="responsiblePerson"> + <j-search-select-tag placeholder="璇烽�夋嫨璐d换浜�" v-model="model.responsiblePerson" dict="sys_user,realname, username, del_flag=0 and status=1"/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item label="鏁呴殰鎻忚堪" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="faultDescription"> + <a-textarea v-model="model.faultDescription" placeholder="璇疯緭鍏ユ晠闅滄弿杩�" ></a-textarea> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item label="澶囨敞" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> + <a-textarea v-model="model.remark" placeholder="璇疯緭鍏ュ娉�" ></a-textarea> + </a-form-model-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-tabs defaultActiveKey="1"> + <a-tab-pane key="1" tab="缁翠慨鏄庣粏"> + <j-vxe-table + ref="editableDetailTable" + :rowNumber="true" + :rowSelection="true" + :bordered="true" + :alwaysEdit="true" + :toolbar="true" + :toolbar-config="detailToolbarConfig" + keep-source + :height="300" + :loading="detail.loading" + :dataSource="detail.dataSource" + :columns="equipmentColumns" + style="margin-top: 8px;"/> + </a-tab-pane> + </a-tabs> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + +import { getAction, httpAction } from '@/api/manage' +import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' +import { JVXETypes } from '@/components/jeecg/JVxeTable' + +export default { + name: 'EamMajorPartialRepairForm', + mixins: [JVxeTableModelMixin], + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 7 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + repairName: { required: true, message: '璇疯緭鍏ラ」鐩悕绉�!' }, + repairType: { required: true, message: '璇烽�夋嫨缁翠慨绫诲瀷!' }, + applicant: { required: true, message: '璇烽�夋嫨鐢宠浜�!' }, + applicantProduction: { required: true, message: '璇疯緭鍏ョ敵璇疯溅闂�!' }, + planStartDate: { required: true, message: '璇烽�夋嫨璁″垝寮�濮嬫棩鏈�!' }, + planEndDate: { required: true, message: '璇烽�夋嫨璁″垝缁撴潫鏃ユ湡!' }, + applicantReason: { required: true, message: '璇疯緭鍏ョ敵璇峰師鍥�!' }, + responsiblePerson: { required: true, message: '璇疯緭鍏ヨ矗浠讳汉!' }, + faultDescription: { required: true, message: '璇疯緭鍏ユ晠闅滄弿杩�!' } + }, + treeData: [], + equipmentOptions: [], + detail: { + loading: false, + dataSource: [], + }, + url: { + add: "/eam/eamMajorPartialRepair/add", + edit: "/eam/eamMajorPartialRepair/edit", + queryById: "/eam/eamMajorPartialRepair/queryById", + queryDetailList: "/eam/eamMajorPartialRepairDetail/list", + queryEquipmentList: "/eam/equipment/asyncLoadEquipment", + loadWorkShopOptions:'/mdc/mdcProduction/loadProductionTreeOptions' + } + } + }, + computed: { + detailToolbarConfig() { + return { + // 濡傛灉鏄鎯呴〉锛屽垯涓嶆樉绀� add 鎸夐挳 + btns: this.disabled ? ['remove', 'clearSelection'] : ['add', 'remove', 'clearSelection'], + slots: ['prefix', 'suffix'] + }; + }, + formDisabled(){ + return this.disabled + }, + equipmentColumns() { + return [ + { + title: '璁惧', + key: 'equipmentId', + type: JVXETypes.select, + options: this.equipmentOptions, + width: '20%', + align: 'center', + validateRules: [{ required: true, message: '璁惧涓嶈兘涓虹┖锛�' }] + }, + { + title: '鍗曚环', + key: 'unitPrice', + type: JVXETypes.inputNumber, + width: '10%', + align: 'center', + validateRules: [{ required: true, message: '鍗曚环涓嶈兘涓虹┖锛�' }] + }, + { + title: '缁翠慨缁撴灉', + key: 'repairResult', + type: JVXETypes.textarea, + width: '20%', + align: 'center', + visible: this.disabled + }, + { + title: '缁翠慨鎻忚堪', + key: 'repairDescription', + type: JVXETypes.textarea, + width: '30%', + align: 'center', + visible: this.disabled + } + ]; + } + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + this.loadWorkShopTree() + }, + methods: { + loadWorkShopTree() { + //鍔犺浇杞﹂棿閫夋嫨鏍� + getAction(this.url.loadWorkShopOptions).then(res => { + if (res.success) { + this.treeData = [...res.result] + }else { + that.$message.warning(res.message) + } + }) + }, + add () { + this.edit(this.modelDefault) + }, + edit (record) { + this.model = Object.assign({}, record); + this.visible = true + if (this.model.id) { + getAction(this.url.queryDetailList, { repairId: this.model.id }).then((res) => { + if (res.success) { + console.log(res.result) + if (res.result.total) { + this.detail.dataSource = res.result.records + } + } + }) + } + getAction(this.url.queryEquipmentList, {}).then((res) => { + if (res.success) { + this.equipmentOptions = res.result.map(item => { + return { + label: item.text, + value: item.value + } + }) + } + }) + }, + submitForm () { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if(!this.model.id){ + httpurl+=this.url.add; + method = 'post'; + }else{ + httpurl+=this.url.edit; + method = 'put'; + } + const detailList = this.$refs.editableDetailTable.getTableData() + if (detailList.length === 0 || !detailList[0].equipmentId) { + this.$message.warning('璇锋坊鍔犵淮淇槑缁嗭紒') + that.confirmLoading = false; + return + } + this.model.eamMajorPartialRepairDetailList = this.$refs.editableDetailTable.getTableData() + httpAction(httpurl,this.model,method).then((res)=>{ + if(res.success){ + that.$message.success(res.message); + that.$emit('ok'); + }else{ + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/eam/repair/modules/EamMajorPartialRepairModal.vue b/src/views/eam/repair/modules/EamMajorPartialRepairModal.vue new file mode 100644 index 0000000..5b6aa37 --- /dev/null +++ b/src/views/eam/repair/modules/EamMajorPartialRepairModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <eam-major-partial-repair-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></eam-major-partial-repair-form> + </j-modal> +</template> + +<script> + + import EamMajorPartialRepairForm from './EamMajorPartialRepairForm' + export default { + name: 'EamMajorPartialRepairModal', + components: { + EamMajorPartialRepairForm + }, + data () { + return { + title:'', + width:1200, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/src/views/eam/repair/modules/EamRepairOrderList/ReceiveFaultModal.vue b/src/views/eam/repair/modules/EamRepairOrderList/ReceiveFaultModal.vue new file mode 100644 index 0000000..9c015c4 --- /dev/null +++ b/src/views/eam/repair/modules/EamRepairOrderList/ReceiveFaultModal.vue @@ -0,0 +1,92 @@ +<template> + <j-modal + :title="title" + width="80%" + :visible="visible" + :confirmLoading="confirmLoading" + switchFullscreen + @ok="handleOk" + @cancel="handleCancel" + centered + cancelText="鍏抽棴"> + <eam-report-repair-list ref="reportRepairListRef" :isDisplayOperation="false" + :propsQueryParam="{reportStatus:'WAIT_REPAIR'}"/> + </j-modal> +</template> + +<script> + import { httpAction } from '@api/manage' + import EamReportRepairList from '../../EamReportRepairList' + + export default { + name: 'ReceiveFaultModal', + components: { EamReportRepairList }, + data() { + return { + title: '鏁呴殰鎶ヤ慨鍗�', + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 8 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 12 } + }, + labelColLong: { + xs: { span: 24 }, + sm: { span: 4 } + }, + wrapperColLong: { + xs: { span: 24 }, + sm: { span: 18 } + }, + confirmLoading: false, + validatorRules: {}, + url: { + receiveFault: '/eam/eamRepairOrder/add' + } + } + }, + created() { + }, + methods: { + handleOk() { + const reportId = this.$refs.reportRepairListRef.selectedRowKeys[0] + if (!reportId) { + this.$notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨闇�棰嗗彇鐨勬晠闅滄姤淇崟' + }) + return + } + this.confirmLoading = true + httpAction(this.url.receiveFault, { reportId }, 'post') + .then((res) => { + if (res.success) { + this.$message.success(res.message) + this.$emit('ok') + } else { + this.$message.warning(res.message) + } + }) + .finally(() => { + this.confirmLoading = false + this.close() + }) + }, + handleCancel() { + this.close() + }, + close() { + this.$emit('close') + this.visible = false + } + } + } +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/repair/modules/EamReportRepairList/AssignRepairReportModal.vue b/src/views/eam/repair/modules/EamReportRepairList/AssignRepairReportModal.vue new file mode 100644 index 0000000..5951a14 --- /dev/null +++ b/src/views/eam/repair/modules/EamReportRepairList/AssignRepairReportModal.vue @@ -0,0 +1,74 @@ +<template> + <j-modal :visible="visible" title="鎸囨淳鎶ヤ慨" :width="500" @ok="handleSubmit" @cancel="handleCancel" + :confirmLoading="confirmLoading"> + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :model="model" :rules="validateRules" :labelCol="{span:4}" :wrapperCol="{span:18}"> + <a-form-model-item label="缁翠慨宸�" prop="repairer"> + <j-search-select-tag v-model="model.repairer" placeholder="璇烽�夋嫨缁翠慨宸�" + dict="sys_user,realname, username, del_flag=0 and post='PCR0002' and status=1"/> + </a-form-model-item> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> + import { postAction } from '@/api/manage' + + export default { + name: 'AssignRepairReportModal', + data() { + return { + visible: false, + confirmLoading: false, + model: {}, + validateRules: { + repairer: [ + { required: true, message: '璇烽�夋嫨缁翠慨宸�' } + ] + }, + url: { + assign: '/eam/eamRepairOrder/assign' + } + } + }, + methods: { + handleSubmit() { + const that = this + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true + postAction(that.url.assign, that.model) + .then(res => { + if (res.success) { + that.$message.success(res.message) + that.handleCancel() + that.$emit('ok') + } else { + that.$message.warning(res.message) + } + }) + .finally(() => { + that.confirmLoading = false + }) + } else { + return false + } + }) + }, + + handleCancel() { + this.visible = false + } + } + } +</script> + +<style scoped> + .container { + display: flex; + flex-direction: column; + justify-content: center; + align-content: center; + } +</style> \ No newline at end of file diff --git a/src/views/eam/repair/modules/EamReportRepairList/EamReportRepairModal.vue b/src/views/eam/repair/modules/EamReportRepairList/EamReportRepairModal.vue new file mode 100644 index 0000000..db06d13 --- /dev/null +++ b/src/views/eam/repair/modules/EamReportRepairList/EamReportRepairModal.vue @@ -0,0 +1,253 @@ +<template> + <j-modal + :title="title" + :width="800" + :visible="visible" + :confirmLoading="confirmLoading" + switchFullscreen + @ok="handleOk" + @cancel="close" + :mask-closable="false" + cancelText="鍏抽棴"> + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-row> + <a-col :span="12"> + <a-form-model-item prop="equipmentId" label="璁惧缂栧彿"> + <lx-search-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储" v-model="model.equipmentId"/> + </a-form-model-item> + </a-col> + + <a-col :span="12"> + <a-form-model-item prop="faultName" label="椹卞姩绫诲瀷"> + <a-select placeholder="璇烽�夋嫨鏁呴殰绠�绉�" v-model="model.faultName" @change="handleFaultNameChange"> + <a-select-option v-for="item in faultReasonList" :key="item.faultName"> + {{ item.faultName }} + </a-select-option> + </a-select> + </a-form-model-item> + </a-col> + </a-row> + + <a-row> + <a-col :span="12"> + <a-form-model-item label="鏁呴殰鍒嗙被"> + <a-input placeholder="璇疯緭鍏ユ晠闅滃垎绫�" v-model="model.faultType_dictText" readOnly/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row> + <a-col :span="24"> + <a-form-model-item label="鏁呴殰鎻忚堪" prop="faultDescription" :labelCol="labelColLong" + :wrapperCol="wrapperColLong"> + <a-textarea placeholder="璇疯緭鍏ユ晠闅滄弿杩�" v-model="model.faultDescription"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row> + <a-col :span="12"> + <a-form-model-item prop="faultStartTime" label="鏁呴殰寮�濮嬫椂闂�"> + <a-date-picker showTime placeholder="璇烽�夋嫨鏁呴殰寮�濮嬫椂闂�" v-model="model.faultStartTime" + :allow-clear="false" value-format="YYYY-MM-DD HH:mm:ss" :disabledDate="disabledDate" + :disabledTime="disabledTime"/> + </a-form-model-item> + </a-col> + + <a-col :span="12"> + <a-form-model-item prop="breakdownFlag" label="鏄惁鍋滄満"> + <a-radio-group v-model="model.breakdownFlag"> + <a-radio v-for="item in breakdownFlagList" :value="item.value">{{ item.label }}</a-radio> + </a-radio-group> + </a-form-model-item> + </a-col> + </a-row> + + <a-row> + <a-col :span="24"> + <a-form-model-item prop="imageFiles" label="鎶ヤ慨鍥剧墖" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> + <lx-upload :returnUrl="false" :isMultiple="true" file-type="image" :number="3" + v-model="model.imageFilesResult"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row> + <a-col :span="24"> + <a-form-model-item prop="remark" label="澶囨敞" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> + <a-textarea placeholder="璇疯緭鍏ュ娉�" v-model="model.remark"/> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> + import { httpAction } from '@/api/manage' + import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue' + import moment from 'moment' + + export default { + name: 'EamReportRepairModal', + components: { LxSearchEquipmentSelect }, + props: { + breakdownFlagList: { + type: Array + }, + faultReasonList: { + type: Array + } + }, + data() { + return { + title: '鎿嶄綔', + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 8 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 12 } + }, + labelColLong: { + xs: { span: 24 }, + sm: { span: 4 } + }, + wrapperColLong: { + xs: { span: 24 }, + sm: { span: 18 } + }, + confirmLoading: false, + validatorRules: { + faultStartTime: [ + { required: true, message: '璇烽�夋嫨鏁呴殰寮�濮嬫椂闂�' } + ], + breakdownFlag: [ + { required: true, message: '璇烽�夋嫨鏄惁鍋滄満' } + ], + equipmentId: [ + { required: true, message: '璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储' } + ], + faultName: [ + { required: true, message: '璇烽�夋嫨鏁呴殰绠�绉�' } + ], + faultDescription: [ + { required: true, message: '璇疯緭鍏ユ晠闅滄弿杩�' } + ] + }, + url: { + add: '/eam/eamReportRepair/add', + edit: '/eam/eamReportRepair/edit' + } + } + }, + methods: { + add() { + //鍒濆鍖栭粯璁ゅ�� + this.edit({ + faultDescription: '', + breakdownFlag: this.breakdownFlagList.find(item => item.label === '鍚�').value + }) + }, + + edit(record) { + this.model = Object.assign({}, record, { imageFilesResult: record.imageFiles && this.isJSON(record.imageFiles) ? JSON.parse(record.imageFiles) : null }) + this.visible = true + }, + + handleFaultNameChange(value) { + const faultReasonItem = this.faultReasonList.find(item => item.faultName === value) + this.model.faultType = faultReasonItem.faultCategory + this.model.faultType_dictText = faultReasonItem.faultCategory_dictText + this.model.faultDescription = faultReasonItem.faultDescription + }, + + handleOk() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + console.log('model---------------', that.model) + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true + let httpUrl = '' + let method = '' + if (!this.model.id) { + httpUrl += this.url.add + method = 'post' + } else { + httpUrl += this.url.edit + method = 'put' + } + httpAction(httpUrl, this.model, method).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.$emit('ok') + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = false + that.close() + }) + } else { + return false + } + }) + }, + + // 鍒ゆ柇鏄笉鏄疛SON瀛楃涓� + isJSON(str) { + try { + JSON.parse(str) + return true // 濡傛灉杩欓噷娌℃湁鎶涘嚭寮傚父锛岃鏄庢槸JSON鏍煎紡鐨勫瓧绗︿覆 + } catch (e) { + return false // 濡傛灉鎶涘嚭寮傚父锛岃鏄庝笉鏄疛SON鏍煎紡鐨勫瓧绗︿覆 + } + }, + + /** + * 绂佺敤鏃ユ湡 + * @params current 琚鐢ㄧ殑鏃堕棿 + */ + disabledDate(current) { + // Can not select days after today + return current > moment().endOf('day') + }, + + /** + * 绂佺敤鏃ユ湡涓殑鏃堕棿 + * @returns {{disabledHours: (function(): Array), disabledMinutes: (function(): Array)}} + */ + disabledTime() { + function range(start, end) { + const result = [] + for (let i = start; i < end; i++) { + result.push(i) + } + return result + } + + return { + disabledHours: () => range(moment().hour() + 1, 24), + disabledMinutes: () => range(moment().minute() + 1, 60), + disabledSeconds: () => range(moment().second() + 1, 60) + } + }, + + close() { + this.$emit('close') + this.visible = false + if (this.$refs.form) this.$refs.form.clearValidate() + } + } + } +</script> + +<style lang="less" scoped> + +</style> \ No newline at end of file diff --git a/src/views/eam/repair/modules/ImagesPreviewModal.vue b/src/views/eam/repair/modules/ImagesPreviewModal.vue new file mode 100644 index 0000000..3f0d966 --- /dev/null +++ b/src/views/eam/repair/modules/ImagesPreviewModal.vue @@ -0,0 +1,87 @@ +<template> + <a-modal title="棰勮" :visible="visible" width="50%" :footer="null" @cancel="visible=false"> + <template v-for="(item,index) in imageUrlArr"> + <img v-if="item" :src="getImageItemUrl(item)" width="100%;"/> + + <a-divider v-if="index+1<imageUrlArr.length" style="margin:20px 0;background-color: #000"></a-divider> + </template> + </a-modal> +</template> + +<script> +export default { + name: 'ImagesPreviewModal', + props: { + imageListUrl: { + type: String, + default: '' + } + }, + data() { + return { + visible: false + } + }, + computed: { + imageUrlArr() { + // 澶勭悊绌哄�兼垨鏃犳晥JSON鐨勬儏鍐� + if (!this.imageListUrl || typeof this.imageListUrl !== 'string' || this.imageListUrl.trim() === '') { + return [] + } + + // 灏濊瘯瑙f瀽JSON + let parsed + try { + parsed = JSON.parse(this.imageListUrl) + } catch (e) { + console.error('JSON瑙f瀽閿欒:', e) + console.error('鍑洪敊鐨凧SON瀛楃涓�:', this.imageListUrl) + return [] + } + + // 妫�鏌ヨВ鏋愮粨鏋滄槸鍚︿负鏁扮粍 + if (!Array.isArray(parsed)) { + console.warn('imageListUrl瑙f瀽缁撴灉涓嶆槸鏁扮粍:', parsed) + return [] + } + + // 鎻愬彇filePath骞惰繃婊ゆ棤鏁堝�� + return parsed.map(item => { + // 纭繚姣忎釜item閮芥湁filePath灞炴�т笖涓嶄负绌� + return item && typeof item === 'object' && item.filePath && typeof item.filePath === 'string' ? item.filePath : '' + }).filter(item => item !== '') // 杩囨护鎺夌┖鐨刦ilePath + } + }, + methods: { + getImageItemUrl(imageItemSrcSuffix) { + if (!imageItemSrcSuffix) return '' + return `${window._CONFIG['domianURL']}/${imageItemSrcSuffix}` + } + } +} +</script> + +<style scoped lang="less"> +/deep/ .ant-modal { + height: 70%; + overflow: hidden; + + .ant-modal-content { + height: 100%; + display: flex; + flex-direction: column; + overflow: hidden; + + ::-webkit-scrollbar { + width: 8px; + height: 8px; + } + + .ant-modal-body { + flex: 1; + overflow: auto; + } + } +} + +</style> diff --git a/src/views/eam/spare/EamSparePartReceiveList.vue b/src/views/eam/spare/EamSparePartReceiveList.vue new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/views/eam/spare/EamSparePartReceiveList.vue diff --git a/src/views/eam/spare/EamSparePartRequisitionList.vue b/src/views/eam/spare/EamSparePartRequisitionList.vue new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/views/eam/spare/EamSparePartRequisitionList.vue diff --git a/src/views/eam/spare/EamSparePartScrapList.vue b/src/views/eam/spare/EamSparePartScrapList.vue new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/views/eam/spare/EamSparePartScrapList.vue diff --git a/src/views/eam/spare/EamSparePartsList.vue b/src/views/eam/spare/EamSparePartsList.vue new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/views/eam/spare/EamSparePartsList.vue diff --git a/src/views/eam/spare/modules/EamSparePartReceive/EamSparePartReceiveDetailList.vue b/src/views/eam/spare/modules/EamSparePartReceive/EamSparePartReceiveDetailList.vue new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/views/eam/spare/modules/EamSparePartReceive/EamSparePartReceiveDetailList.vue diff --git a/src/views/eam/spare/modules/EamSparePartReceive/EamSparePartReceiveModal.vue b/src/views/eam/spare/modules/EamSparePartReceive/EamSparePartReceiveModal.vue new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/views/eam/spare/modules/EamSparePartReceive/EamSparePartReceiveModal.vue diff --git a/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionDetailModal.vue b/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionDetailModal.vue new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionDetailModal.vue diff --git a/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionExamineModal.vue b/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionExamineModal.vue new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionExamineModal.vue diff --git a/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionModal.vue b/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionModal.vue new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/views/eam/spare/modules/EamSparePartRequisition/EamSparePartRequisitionModal.vue diff --git a/src/views/eam/spare/modules/EamSparePartScrap/EamSparePartScrapModal.vue b/src/views/eam/spare/modules/EamSparePartScrap/EamSparePartScrapModal.vue new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/views/eam/spare/modules/EamSparePartScrap/EamSparePartScrapModal.vue diff --git a/src/views/eam/spare/modules/EamSpareParts/EamSparePartIntoModal.vue b/src/views/eam/spare/modules/EamSpareParts/EamSparePartIntoModal.vue new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/views/eam/spare/modules/EamSpareParts/EamSparePartIntoModal.vue diff --git a/src/views/eam/spare/modules/EamSpareParts/EamSparePartInventoryList.vue b/src/views/eam/spare/modules/EamSpareParts/EamSparePartInventoryList.vue new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/views/eam/spare/modules/EamSpareParts/EamSparePartInventoryList.vue diff --git a/src/views/eam/spare/modules/EamSpareParts/EamSparePartsModal.vue b/src/views/eam/spare/modules/EamSpareParts/EamSparePartsModal.vue new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/views/eam/spare/modules/EamSpareParts/EamSparePartsModal.vue -- Gitblit v1.9.3