From 952a20f1c005d80e9bf881287c40e6f4e4266a0b Mon Sep 17 00:00:00 2001
From: lxp <1928192722@qq.com>
Date: 星期三, 12 三月 2025 15:34:52 +0800
Subject: [PATCH] Merge branch 'dev' of http://114.132.189.42:9002/r/center-lims-before-ruoyi into dev
---
src/views/CNAS/personnel/personnelInfo/index.vue | 298
src/api/cnas/resourceDemand/device.js | 916 +
src/assets/styles/index.scss | 4
src/views/CNAS/personnel/personnelInfo/Department/components/Records/dispose/Step/Fact.vue | 108
src/views/CNAS/resourceDemand/device/index.vue | 250
src/views/CNAS/personnel/personnelInfo/Department/components/Communicate/Add.vue | 116
src/views/CNAS/resourceDemand/device/component/equipmentAcceptance.vue | 317
src/views/CNAS/personnel/personnelInfo/Department/components/Records/dispose/Step/Reason.vue | 122
src/views/CNAS/personnel/personnelInfo/Department/components/Records/supervise/SuperviseForm.vue | 201
src/views/CNAS/personnel/personnelInfo/Department/components/Plan/UploadExcel.vue | 44
src/components/materialOrder/filesLookVisible.vue | 54
src/views/CNAS/personnel/personnelInfo/Department/components/Records/dispose/Step/Measure.vue | 121
src/views/CNAS/resourceDemand/device/component/device-overview.vue | 386
src/views/CNAS/personnel/personnelInfo/Department/components/Records/dispose/Step/Result.vue | 111
src/views/structural/capabilityAndLaboratory/laboratory/index.vue | 4
src/store/getters.js | 2
src/views/CNAS/personnel/personnelInfo/Department/components/Records/dispose/index.vue | 239
src/views/CNAS/personnel/personnelInfo/Department/components/Records/supervise/ApproveForm.vue | 84
src/api/cnas/personnel/personnelInfo.js | 819 +
src/views/structural/capabilityAndLaboratory/capability/index.vue | 8
src/components/Table/value-table.vue | 45
src/components/ImageUpload/index.vue | 48
src/components/Table/lims-table.vue | 298
src/store/modules/user.js | 11
src/views/CNAS/resourceDemand/device/component/check-and-accept.vue | 934 ++
src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelInformation/index.vue | 948 ++
src/views/CNAS/personnel/personnelInfo/Department/components/Records/control/index.vue | 312
src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelTraining/Edit.vue | 662 +
src/router/index.js | 9
src/views/CNAS/personnel/personnelInfo/Department/components/trackRecord/index.vue | 298
src/api/business/inspectionOrder.js | 2
src/components/Echart/echart.vue | 116
src/assets/images/renyuan-title.svg | 11
src/utils/echarts.js | 353
src/views/CNAS/personnel/personnelInfo/Department/components/Plan/index.vue | 484 +
src/api/business/insBushing.js | 10
src/components/FileUpload/index.vue | 20
src/views/CNAS/resourceDemand/device/component/resource-reservation.vue | 464
src/views/CNAS/personnel/personnelInfo/Department/components/Records/control/Step/ConditionForm.vue | 145
src/views/standard/standardLibrary/index.vue | 2
src/views/CNAS/resourceDemand/device/component/files.vue | 1141 ++
src/views/CNAS/resourceDemand/device/component/management.vue | 1430 +++
src/views/CNAS/resourceDemand/device/component/state.vue | 605 +
src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelCapacity/index.vue | 567 +
src/views/CNAS/personnel/personalOverview/index.vue | 242
src/layout/components/Navbar.vue | 3
src/views/CNAS/personnel/personnelInfo/Department/components/Records/Add.vue | 234
src/components/Editor/index.vue | 36
src/views/CNAS/resourceDemand/device/component/calibration.vue | 805 +
src/views/CNAS/personnel/personnelInfo/Department/components/TrainingRecord/index.vue | 285
src/views/CNAS/personnel/personnelInfo/Department/components/Communicate/index.vue | 213
src/views/CNAS/personnel/personnelInfo/Department/components/Records/control/Step/Inform.vue | 103
src/views/CNAS/personnel/personnelInfo/Department/components/Records/index.vue | 406
src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelList/index.vue | 364
src/api/cnas/personnel/personalOverview.js | 10
src/views/CNAS/resourceDemand/device/component/fault.vue | 701 +
src/views/business/inspectionOrder/add.vue | 2532 +++-
src/views/CNAS/personnel/personnelInfo/Department/components/Mandate/index.vue | 228
src/views/CNAS/personnel/personnelInfo/Department/components/Mandate/Add.vue | 198
src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelTraining/AddInDetail.vue | 319
src/views/CNAS/resourceDemand/device/component/maintenance.vue | 345
src/views/CNAS/personnel/personnelInfo/Department/components/Records/control/Step/RectifyForm.vue | 101
src/api/system/user.js | 10
src/views/CNAS/systemManagement/measuresDealRisks/components/hazardIdentificationRiskAssessment.vue | 1
src/views/CNAS/personnel/personnelInfo/Department/index.vue | 152
src/views/CNAS/personnel/personnelInfo/Department/components/JobResponsibilities/index.vue | 364
src/views/CNAS/resourceDemand/device/component/check.vue | 704 +
src/assets/styles/element-ui.scss | 46
src/views/CNAS/personnel/personnelInfo/Department/components/rewardPunishmentRecord/index.vue | 316
src/layout/components/TagsView/index.vue | 245
src/views/CNAS/personnel/personnelInfo/Department/components/Plan/Add.vue | 172
src/views/CNAS/resourceDemand/device/component/borrow.vue | 651 +
src/api/standard/standardLibrary.js | 25
src/views/CNAS/resourceDemand/device/component/operationInstruction.vue | 525 +
src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelTraining/index.vue | 1012 ++
src/views/CNAS/resourceDemand/device/component/record.vue | 474 +
src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue | 754 +
package.json | 2
src/views/business/inspectionOrder/index.vue | 1628 ++-
src/plugins/download.js | 3
src/views/CNAS/personnel/personnelInfo/Department/components/Records/control/Step/MeasureForm.vue | 110
src/views/CNAS/resourceDemand/device/component/acceptanceForm.vue | 192
src/views/CNAS/resourceDemand/device/component/operationOverview.vue | 220
83 files changed, 26,277 insertions(+), 1,573 deletions(-)
diff --git a/package.json b/package.json
index 1bbf543..1bdf3ee 100644
--- a/package.json
+++ b/package.json
@@ -43,7 +43,9 @@
"axios": "0.28.1",
"clipboard": "2.0.8",
"core-js": "3.37.1",
+ "dom-to-image": "^2.6.0",
"echarts": "5.4.0",
+ "element-resize-detector": "^1.2.4",
"element-ui": "2.15.14",
"file-saver": "2.0.5",
"fuse.js": "6.4.3",
diff --git a/src/api/business/insBushing.js b/src/api/business/insBushing.js
new file mode 100644
index 0000000..73c0ab0
--- /dev/null
+++ b/src/api/business/insBushing.js
@@ -0,0 +1,10 @@
+import request from '@/utils/request'
+
+// 鏌ョ湅鎵�灞炲崟浣嶆楠屽崟
+export function selectBushingBySampleId(query) {
+ return request({
+ url: '/insBushing/selectBushingBySampleId',
+ method: 'get',
+ params: query
+ })
+}
diff --git a/src/api/business/inspectionOrder.js b/src/api/business/inspectionOrder.js
index d655d60..d6fc987 100644
--- a/src/api/business/inspectionOrder.js
+++ b/src/api/business/inspectionOrder.js
@@ -120,7 +120,7 @@
export function exportChecked(query) {
return request({
url: '/insOrder/exportChecked',
- method: 'get',
+ method: 'post',
data: query,
responseType:'blob'
})
diff --git a/src/api/cnas/personnel/personalOverview.js b/src/api/cnas/personnel/personalOverview.js
new file mode 100644
index 0000000..e539973
--- /dev/null
+++ b/src/api/cnas/personnel/personalOverview.js
@@ -0,0 +1,10 @@
+import request from "@/utils/request";
+
+// 璧勬簮瑕佹眰-浜哄憳鎬昏
+export function selectPersonnelOverview(query) {
+ return request({
+ url: "/user/selectPersonnelOverview",
+ method: "get",
+ params: query,
+ });
+}
diff --git a/src/api/cnas/personnel/personnelInfo.js b/src/api/cnas/personnel/personnelInfo.js
new file mode 100644
index 0000000..c9d6eaf
--- /dev/null
+++ b/src/api/cnas/personnel/personnelInfo.js
@@ -0,0 +1,819 @@
+import request from "@/utils/request";
+
+//鍒犻櫎閮ㄩ棬
+export function delDepartmentLims(query) {
+ return request({
+ url: "/department/delDepartmentLims",
+ method: "delete",
+ params: query,
+ });
+}
+
+// 娣诲姞閮ㄩ棬
+export function addDepartmentLims(data) {
+ return request({
+ url: "/department/addDepartmentLims",
+ method: "post",
+ data: data,
+ });
+}
+
+// 鏌ヨCNAS浜哄憳渚ц竟鏍�
+export function selectCNSAPersonTree(query) {
+ return request({
+ url: "/personBasicInfo/selectCNSAPersonTree",
+ method: "get",
+ params: query,
+ });
+}
+
+// 瀵规帴浜哄憳骞冲彴 鑾峰彇鎵�鏈変汉鍛樹俊鎭�
+export function getEmployees(query) {
+ return request({
+ url: "/personBasicInfo/getEmployees",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鑾峰彇浜哄憳鍒楄〃
+export function basicInformationOfPersonnelSelectPage(query) {
+ return request({
+ url: "/personBasicInfo/basicInformationOfPersonnelSelectPage",
+ method: "get",
+ params: query,
+ });
+}
+
+//鍒犻櫎浜哄憳鏄庣粏鎵�鍦ㄧ粍缁囨灦鏋�
+export function delUserDepardLimsId(query) {
+ return request({
+ url: "/user/delUserDepardLimsId",
+ method: "delete",
+ params: query,
+ });
+}
+
+// 淇敼浜哄憳鏄庣粏鎵�鍦ㄧ粍缁囨灦鏋�
+export function upUserDepardLimsId(data) {
+ return request({
+ url: "/system/newUser/upUserDepardLimsId",
+ method: "post",
+ data: data,
+ });
+}
+
+// 鏈俊鎭鍑�,浼犲弬绫讳技鍒嗛〉
+export function exportPersonBasicInfo(query) {
+ return request({
+ url: "/personBasicInfo/exportPersonBasicInfo",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+// 鏈俊鎭鍑�,浼犲弬绫讳技鍒嗛〉
+export function exportPersonBasicInfoById(query) {
+ return request({
+ url: "/personBasicInfo/exportPersonBasicInfoById",
+ method: "get",
+ params: query,
+ });
+}
+
+/**
+ * @desc 娌熼�氳褰�
+ */
+
+// 娌熼�氳褰�-鍒楄〃
+export function personPersonCommunicationAbilityPage(query) {
+ return request({
+ url: "/personCommunicationAbility/personPersonCommunicationAbilityPage",
+ method: "get",
+ params: query,
+ });
+}
+
+//娌熼�氳褰�-鍒犻櫎
+export function deletePersonCommunicationAbility(query) {
+ return request({
+ url: "/personCommunicationAbility/deletePersonCommunicationAbility",
+ method: "delete",
+ params: query,
+ });
+}
+
+// 娌熼�氳褰�-瀵煎嚭
+export function exportPersonCommunicationAbility(query) {
+ return request({
+ url: "/personCommunicationAbility/exportPersonCommunicationAbility",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+// 浜哄憳鍒楄〃
+export function selectUserList(query) {
+ return request({
+ url: "/deviceScope/selectUserList",
+ method: "get",
+ params: query,
+ });
+}
+
+// 娌熼�氳褰曟柊澧�-缂栬緫
+export function addOrUpdatePersonCommunicationAbility(data) {
+ return request({
+ url: "/personCommunicationAbility/addOrUpdatePersonCommunicationAbility",
+ method: "post",
+ data: data,
+ });
+}
+
+/**
+ * @desc 宀椾綅鑱岃矗
+ */
+
+// 鍒嗛〉鏌ヨ宀椾綅鑱岃矗
+export function personJobResponsibilitiesSelect(query) {
+ return request({
+ url: "/personJobResponsibilities/personJobResponsibilitiesSelect",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鏂板宀椾綅鑱岃矗
+export function personJobResponsibilitiesSave(data) {
+ return request({
+ url: "/personJobResponsibilities/personJobResponsibilitiesSave",
+ method: "post",
+ data: data,
+ });
+}
+
+// 瀵煎嚭浜哄憳鑱岃矗,浼犲弬id
+export function exportPersonJobResponsibilities(query) {
+ return request({
+ url: "/personJobResponsibilities/exportPersonJobResponsibilities",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+//鍒犻櫎宀椾綅鑱岃矗
+export function personJobResponsibilitiesDelete(query) {
+ return request({
+ url: "/personJobResponsibilities/personJobResponsibilitiesDelete",
+ method: "delete",
+ params: query,
+ });
+}
+
+/**
+ * @desc 浠昏亴鎺堟潈
+ */
+
+// 浠昏亴鎺堟潈璁板綍-鍒楄〃
+export function PersonPostAuthorizationRecordPage(query) {
+ return request({
+ url: "/personPostAuthorizationRecord/PersonPostAuthorizationRecordPage",
+ method: "get",
+ params: query,
+ });
+}
+
+//浠昏亴鎺堟潈璁板綍-鍒犻櫎
+export function deletePersonPostAuthorizationRecord(query) {
+ return request({
+ url: "/personPostAuthorizationRecord/deletePersonPostAuthorizationRecord",
+ method: "delete",
+ params: query,
+ });
+}
+
+// 瀵煎嚭浜哄憳鑱岃矗,浼犲弬id
+export function exportPersonPostAuthorizationRecord(query) {
+ return request({
+ url: "/personPostAuthorizationRecord/exportPersonPostAuthorizationRecord",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+// 浠昏亴鎺堟潈璁板綍-鏂板
+export function addOrUpdatePersonPostAuthorizationRecord(data) {
+ return request({
+ url: "/personPostAuthorizationRecord/addOrUpdatePersonPostAuthorizationRecord",
+ method: "post",
+ data: data,
+ });
+}
+
+//鍒犻櫎鏂囦欢
+export function deleteCNASFile(query) {
+ return request({
+ url: "/personBasicInfo/deleteCNASFile",
+ method: "delete",
+ params: query,
+ });
+}
+
+/**
+ * @desc 浜哄憳鑳藉姏
+ */
+// 瀵煎嚭浜哄憳鑳藉姏
+export function exportPersonnelCapacity(query) {
+ return request({
+ url: "/personPersonnelCapacity/exportPersonnelCapacity",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+// 鏌ヨ浜哄憳鑳藉姏
+export function personPersonnelCapacityPage(query) {
+ return request({
+ url: "/personPersonnelCapacity/personPersonnelCapacityPage",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鏂板缂栬緫浜哄憳鑳藉姏
+export function addOrUpdatePersonPersonnelCapacity(data) {
+ return request({
+ url: "/personPersonnelCapacity/addOrUpdatePersonPersonnelCapacity",
+ method: "post",
+ data: data,
+ });
+}
+
+// 纭浜哄憳鑳藉姏
+export function confirmPersonnelCapability(data) {
+ return request({
+ url: "/personPersonnelCapacity/confirmPersonnelCapability",
+ method: "post",
+ data: data,
+ });
+}
+
+//鍒犻櫎浜哄憳鑳藉姏
+export function deletePersonPersonnelCapacity(query) {
+ return request({
+ url: "/personPersonnelCapacity/deletePersonPersonnelCapacity",
+ method: "delete",
+ params: query,
+ });
+}
+
+/**
+ * @desc 浜哄憳淇℃伅
+ */
+// 鑾峰彇闄勪欢
+export function getAnnex(query) {
+ return request({
+ url: "/personBasicInfo/getAnnex",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鏇存柊闄勪欢
+export function updateAnnex(data) {
+ return request({
+ url: "/personBasicInfo/updateAnnex",
+ method: "post",
+ data: data,
+ });
+}
+
+//
+export function getAnnexByUserId(query) {
+ return request({
+ url: "/personBasicInfo/getAnnexByUserId",
+ method: "get",
+ params: query,
+ });
+}
+
+// 娣诲姞闄勪欢
+export function addAnnex(data) {
+ return request({
+ url: "/personBasicInfo/addAnnex",
+ method: "post",
+ data: data,
+ });
+}
+
+//鍒犻櫎闄勪欢
+export function deleteAnnex(query) {
+ return request({
+ url: "/personBasicInfo/deleteAnnex/" + query,
+ method: "delete",
+ // params: query,
+ });
+}
+
+//浜哄憳鍩烘湰淇℃伅鏌ヨ
+export function getCNASPersonnelInfo(query) {
+ return request({
+ url: "/personBasicInfo/getCNASPersonnelInfo",
+ method: "get",
+ params: query,
+ });
+}
+
+// 浜哄憳鍩烘湰淇℃伅淇濆瓨
+export function saveCNASPersonnelInfo(data) {
+ return request({
+ url: "/personBasicInfo/saveCNASPersonnelInfo",
+ method: "post",
+ data: data,
+ });
+}
+
+/**鍩硅璁″垝
+ */
+//骞村害璁″垝鏄庣粏琛� 鍒犻櫎
+export function deleteDetail(query) {
+ return request({
+ url: "/personTraining/deleteDetail",
+ method: "delete",
+ params: query,
+ });
+}
+
+//鏌ヨ浜哄憳鍩硅
+export function personTrainingSelect(query) {
+ return request({
+ url: "/personTraining/personTrainingSelect",
+ method: "get",
+ params: query,
+ });
+}
+
+//鏌ヨ鍩硅璁″垝骞村害璁″垝鏄庣粏琛�
+export function queryTheAnnualPlanDetailsTable(query) {
+ return request({
+ url: "/personTraining/queryTheAnnualPlanDetailsTable",
+ method: "get",
+ params: query,
+ });
+}
+
+//鍒犻櫎浜哄憳鍩硅淇℃伅
+export function personTrainingDelete(query) {
+ return request({
+ url: "/personTraining/personTrainingDelete",
+ method: "delete",
+ params: query,
+ });
+}
+
+// 瀹℃牳 骞村害浜哄憳鍩硅
+export function reviewAnnualPersonnelTraining(data) {
+ return request({
+ url: "/personTraining/reviewAnnualPersonnelTraining",
+ method: "post",
+ data: data,
+ });
+}
+
+// 鎵瑰噯 骞村害浜哄憳鍩硅
+export function approveAnnualPersonnelTraining(data) {
+ return request({
+ url: "/personTraining/approveAnnualPersonnelTraining",
+ method: "post",
+ data: data,
+ });
+}
+
+// 瀵煎嚭浜哄憳鍩硅涓庤�冩牳璁板綍
+export function exportPersonTrainingRecord(query) {
+ return request({
+ url: "/personTraining/exportPersonTrainingRecord",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+// 瀵煎嚭/浜哄憳鍩硅
+export function exportPersonTraining(query) {
+ return request({
+ url: "/personTraining/exportPersonTraining",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+// 璁ら/鍙栨秷璁ら
+export function claimOfTrainingAndAssessmentRecords(data) {
+ return request({
+ url: "/personTraining/claimOfTrainingAndAssessmentRecords",
+ method: "post",
+ data: data,
+ });
+}
+
+// 鎵归噺鍒犻櫎 骞村害璁″垝鏄庣粏琛�
+export function deleteAnnualPlanDetailTable(query) {
+ return request({
+ url: "/personTraining/deleteAnnualPlanDetailTable",
+ method: "delete",
+ params: query,
+ });
+}
+
+// 骞村害璁″垝鏄庣粏 鏂囦欢涓嬭浇
+export function fileDownLoad(query) {
+ return request({
+ url: "/personTraining/fileDownLoad",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+// 鍒犻櫎鏌ヨ
+export function deleteFile(query) {
+ return request({
+ url: "/personTraining/deleteFile",
+ method: "delete",
+ params: query,
+ });
+}
+
+//闄勪欢鏌ヨ
+export function getFileData(query) {
+ return request({
+ url: "/personTraining/getFileData",
+ method: "get",
+ params: query,
+ });
+}
+
+//鍩硅涓庤�冩牳璁板綍 鏌ヨ
+export function trainingAndAssessmentRecordsPage(query) {
+ return request({
+ url: "/personTraining/trainingAndAssessmentRecordsPage",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鍩硅涓庤�冩牳 澶辩劍鏇存柊
+export function outOfFocusPreservation(data) {
+ return request({
+ url: "/personTraining/outOfFocusPreservation",
+ method: "post",
+ data: data,
+ });
+}
+
+// 鍩硅涓庤�冩牳 鏂板浜哄憳
+export function newPersonnelAddedToTrainingRecords(data) {
+ return request({
+ url: "/personTraining/newPersonnelAddedToTrainingRecords",
+ method: "post",
+ data: data,
+ });
+}
+
+// 鍩硅涓庤�冩牳璁板綍 鎵归噺鍒犻櫎
+export function deleteTrainingAndAssessmentRecords(query) {
+ return request({
+ url: "/personTraining/deleteTrainingAndAssessmentRecords",
+ method: "delete",
+ params: query,
+ });
+}
+
+// 鍩硅涓庤�冩牳璁板綍 鎻愪氦
+export function trainingAndAssessmentRecordsAdded(data) {
+ return request({
+ url: "/personTraining/trainingAndAssessmentRecordsAdded",
+ method: "post",
+ data: data,
+ });
+}
+
+//鏌ヨ閮ㄩ棬
+export function selectDepartLims(query) {
+ return request({
+ url: "/personTraining/selectDepartLims",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鏂板鍩硅璁″垝骞村害璁″垝鏄庣粏琛�
+export function addOrUpdatePersonTrainingDetailed(data) {
+ return request({
+ url: "/personTraining/addOrUpdatePersonTrainingDetailed",
+ method: "post",
+ data: data,
+ });
+}
+
+/**
+ * @desc 鐩戠潱璁″垝
+ */
+//骞村害璁″垝鍒楄〃
+export function yearPlanList(query) {
+ return request({
+ url: "/superVisePlan/yearPlanList",
+ method: "get",
+ params: query,
+ });
+}
+
+//骞村害璁″垝鏄庣粏
+export function yearPlanDetailList(query) {
+ return request({
+ url: "/superVisePlan/yearPlanDetailList",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鍒犻櫎骞磋鍒�
+export function yearPlanDel(query) {
+ return request({
+ url: "/superVisePlan/yearPlanDel",
+ method: "delete",
+ params: query,
+ });
+}
+
+// 鍒犻櫎骞磋鍒掓槑缁�
+export function yearPlanDetailDel(query) {
+ return request({
+ url: "/superVisePlan/yearPlanDetailDel",
+ method: "delete",
+ params: query,
+ });
+}
+
+// 鎵瑰噯骞村害璁″垝
+export function yearPlanDetailApproval(data) {
+ return request({
+ url: "/superVisePlan/yearPlanDetailApproval",
+ method: "post",
+ data: data,
+ });
+}
+
+// 浜哄憳 鐩戠潱璁″垝瀵煎嚭
+export function exportSuperVisePlan(query) {
+ return request({
+ url: "/superVisePlan/exportSuperVisePlan",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+// 鐩戠潱璁″垝瀵煎叆骞村害璁″垝
+export function yearPlanDetailImport(data) {
+ return request({
+ url: "/superVisePlan/yearPlanDetailImport",
+ method: "post",
+ headers: {
+ "Content-Type": "multipart/form-data;",
+ },
+ data: data,
+ });
+}
+
+// 鐩戠潱璁″垝-鏂板骞村害璁″垝
+export function yearPlanDetailAdd(data) {
+ return request({
+ url: "/superVisePlan/yearPlanDetailAdd",
+ method: "post",
+ data: data,
+ });
+}
+
+// 鐩戠潱璁″垝-缂栬緫骞村害璁″垝
+export function yearPlanDetailEdit(data) {
+ return request({
+ url: "/superVisePlan/yearPlanDetailEdit",
+ method: "post",
+ data: data,
+ });
+}
+
+/**
+ * @desc 鐩戠潱璁板綍
+ */
+//鏌ヨ
+export function personSupervisionRecordPage(query) {
+ return request({
+ url: "/personSupervisionRecord/personSupervisionRecordPage",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鍒犻櫎 鐩戠潱璁板綍
+export function deletePersonSupervisionRecord(query) {
+ return request({
+ url: "/personSupervisionRecord/deletePersonSupervisionRecord",
+ method: "delete",
+ params: query,
+ });
+}
+
+// 鎺у埗鍗曞鍑�
+export function exportSupervisionControlSheet(query) {
+ return request({
+ url: "/personSupervisionRecord/exportSupervisionControlSheet",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+// 澶勭悊鍗曞鍑�
+export function exportSupervisionProcessingSheet(query) {
+ return request({
+ url: "/personSupervisionRecord/exportSupervisionProcessingSheet",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+// 鐩戠潱璁板綍瀵煎嚭
+export function exportPersonSupervisionRecord(query) {
+ return request({
+ url: "/personSupervisionRecord/exportPersonSupervisionRecord",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+// 鏂板-缂栬緫 鐩戠潱璁板綍
+export function addOrUpdatePersonSupervisionRecord(data) {
+ return request({
+ url: "/personSupervisionRecord/addOrUpdatePersonSupervisionRecord",
+ method: "post",
+ data: data,
+ });
+}
+
+//鏌ヨ 鎺у埗鍗�
+export function personSupervisionControlSheetPage(query) {
+ return request({
+ url: "/personSupervisionRecord/personSupervisionControlSheetPage",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鏂板-缂栬緫 鎺у埗鍗�
+export function addOrUpdatePersonSupervisionControl(data) {
+ return request({
+ url: "/personSupervisionRecord/addOrUpdatePersonSupervisionControl",
+ method: "post",
+ data: data,
+ });
+}
+
+//鏌ヨ 澶勭悊鍗�
+export function personSupervisionProcessingPage(query) {
+ return request({
+ url: "/personSupervisionRecord/personSupervisionProcessingPage",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鏂板-缂栬緫 澶勭悊鍗�
+export function addOrUpdatePersonnelServiceProcessing(data) {
+ return request({
+ url: "/personSupervisionRecord/addOrUpdatePersonnelServiceProcessing",
+ method: "post",
+ data: data,
+ });
+}
+
+/**
+ * @desc 濂栨儵璁板綍
+ */
+// 濂栨儵璁板綍 鏂板/鏇存柊
+export function addOrUpdateRewardPunishment(data) {
+ return request({
+ url: "/personRewardPunishmentRecord/addOrUpdateRewardPunishment",
+ method: "post",
+ data: data,
+ });
+}
+
+// 浜哄憳 - 濂栨儵璁板綍 鍒犻櫎
+export function deleteRewardPunishment(query) {
+ return request({
+ url: "/personRewardPunishmentRecord/deleteRewardPunishment",
+ method: "delete",
+ params: query,
+ });
+}
+
+// 浜哄憳 - 濂栨儵璁板綍 鍒嗛〉鏌ヨ
+export function rewardPunishmentPage(query) {
+ return request({
+ url: "/personRewardPunishmentRecord/rewardPunishmentPage",
+ method: "get",
+ params: query,
+ });
+}
+
+/**
+ * @desc 宸ヤ綔灞ュ巻
+ */
+
+// 瀵煎嚭宸ヤ綔灞ュ巻
+export function personTrackRecordExport(query) {
+ return request({
+ url: "/personTrackRecord/personTrackRecordExport",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+// 鏇存柊宸ヤ綔灞ュ巻
+export function personTrackRecordUpdate(data) {
+ return request({
+ url: "/personTrackRecord/personTrackRecordUpdate",
+ method: "post",
+ data: data,
+ });
+}
+
+// 鏂板宸ヤ綔灞ュ巻
+export function personTrackRecordSave(data) {
+ return request({
+ url: "/personTrackRecord/personTrackRecordSave",
+ method: "post",
+ data: data,
+ });
+}
+
+// 鍒犻櫎宸ヤ綔灞ュ巻
+export function personTrackRecordDelete(query) {
+ return request({
+ url: "/personTrackRecord/personTrackRecordDelete",
+ method: "delete",
+ params: query,
+ });
+}
+
+//鏌ヨ宸ヤ綔灞ュ巻
+export function personTrackRecordSelect(query) {
+ return request({
+ url: "/personTrackRecord/personTrackRecordSelect",
+ method: "get",
+ params: query,
+ });
+}
+
+/**
+ * @desc 鍩硅璁板綍
+ */
+// 瀵煎嚭鍩硅璁板綍
+export function exportTrainingRecord(query) {
+ return request({
+ url: "/personTrainingRecord/exportTrainingRecord",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+//鏌ヨ浜哄憳 鍩硅璁板綍
+export function trainingSelectTrainingRecord(query) {
+ return request({
+ url: "/personTrainingRecord/trainingSelectTrainingRecord",
+ method: "get",
+ params: query,
+ });
+}
+
+//鏌ヨ浜哄憳鏄庣粏 鍩硅璁板綍
+export function queryPersonnelDetails(query) {
+ return request({
+ url: "/personTrainingRecord/queryPersonnelDetails",
+ method: "get",
+ params: query,
+ });
+}
diff --git a/src/api/cnas/resourceDemand/device.js b/src/api/cnas/resourceDemand/device.js
new file mode 100644
index 0000000..b82cf37
--- /dev/null
+++ b/src/api/cnas/resourceDemand/device.js
@@ -0,0 +1,916 @@
+// 涓嶇‘瀹氬害璇勫畾鐩稿叧鎺ュ彛
+import request from "@/utils/request";
+
+//璁惧鏍戝舰
+export function treeDevice(query) {
+ return request({
+ url: "/deviceScope/treeDevice",
+ method: "get",
+ params: query,
+ });
+}
+
+//鏌ヨ璁惧璇︽儏鍒楄〃
+export function selectDeviceParameter(query) {
+ return request({
+ url: "/deviceScope/selectDeviceParameter",
+ method: "get",
+ params: query,
+ });
+}
+
+//鑾峰彇瀹為獙瀹ゅ悕绉�
+export function obtainItemParameterList(query) {
+ return request({
+ url: "/laboratoryScope/obtainItemParameterList",
+ method: "get",
+ params: query,
+ });
+}
+
+//璁惧宸ュ叿鏄庣粏瀵煎嚭
+export function exportEquipmentDetails(query) {
+ return request({
+ url: "/deviceScope/exportEquipmentDetails",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+//璁惧閲岄潰閫夋嫨妫�楠岄」鐩�(鏍戝舰缁撴瀯)
+export function getInsProduction(query) {
+ return request({
+ url: "/capacityScope/getInsProduction",
+ method: "get",
+ params: query,
+ });
+}
+
+// 淇敼璁惧璇︽儏鍙傛暟
+export function upDeviceParameter(data) {
+ return request({
+ url: "/deviceScope/upDeviceParameter",
+ method: "post",
+ data: data,
+ });
+}
+
+// 娣诲姞璁惧璇︽儏鍙傛暟
+export function addDeviceParameter(data) {
+ return request({
+ url: "/deviceScope/addDeviceParameter",
+ method: "post",
+ data: data,
+ });
+}
+
+// 缁存姢鏁伴噰閰嶇疆
+export function numberCollect(data) {
+ return request({
+ url: "/deviceScope/numberCollect",
+ method: "post",
+ data: data,
+ });
+}
+
+//璁惧棰勭害鎺ュ彛-鍒楄〃
+export function getDeviceParameter(query) {
+ return request({
+ url: "/deviceScope/selectDeviceParameter",
+ method: "get",
+ params: query,
+ });
+}
+
+//鍒犻櫎璁惧璇︽儏鍙傛暟
+export function delDeviceParameter(query) {
+ return request({
+ url: "/deviceScope/delDeviceParameter",
+ method: "delete",
+ params: query,
+ });
+}
+
+//鏌ヨ鏁伴噰閰嶇疆
+export function queryDataAcquisitionConfiguration(query) {
+ return request({
+ url: "/deviceScope/queryDataAcquisitionConfiguration",
+ method: "get",
+ params: query,
+ });
+}
+
+// 缁存姢鏁伴噰閰嶇疆
+export function saveDataAcquisitionConfiguration(data) {
+ return request({
+ url: "/deviceScope/saveDataAcquisitionConfiguration",
+ method: "post",
+ data: data,
+ });
+}
+
+//鍒犻櫎鏁伴噰閰嶇疆
+export function deleteDataAcquisitionConfiguration(data) {
+ return request({
+ url: "/deviceScope/deleteDataAcquisitionConfiguration",
+ method: "post",
+ data: data,
+ });
+}
+
+//cnas璁惧浣跨敤璁板綍鍒嗛〉鏌ヨ
+export function deviceRecordPage(query) {
+ return request({
+ url: "/deviceRecord/deviceRecordPage",
+ method: "get",
+ params: query,
+ });
+}
+
+// 璁惧浣跨敤璁板綍淇濆瓨
+export function saveDeviceRecord(data) {
+ return request({
+ url: "/deviceRecord/saveDeviceRecord",
+ method: "post",
+ data: data,
+ });
+}
+
+// 璁惧浣跨敤璁板綍缂栬緫
+export function updateDeviceRecord(data) {
+ return request({
+ url: "/deviceRecord/updateDeviceRecord",
+ method: "post",
+ data: data,
+ });
+}
+
+//鍒犻櫎璁惧浣跨敤璁板綍
+export function deleteDeviceRecord(query) {
+ return request({
+ url: "/deviceRecord/deleteDeviceRecord",
+ method: "delete",
+ params: query,
+ });
+}
+//浣跨敤璁板綍 瀵煎嚭
+export function exportUseRecord(query) {
+ return request({
+ url: "/deviceRecord/exportUseRecord",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+//鏂板璁惧妗f
+export function addDocument(data) {
+ return request({
+ url: "/documents/add",
+ method: "post",
+ data: data,
+ });
+}
+
+// 鑾峰彇鐩稿叧鏂囨。鏁版嵁鐨刟pi-鏇存柊
+export function updateDocument(data) {
+ return request({
+ url: "/documents/updateDocument",
+ method: "post",
+ data: data,
+ });
+}
+
+//鍒犻櫎璁惧妗f
+export function deleteDocumentById(query) {
+ return request({
+ url: "/documents/delete",
+ method: "delete",
+ params: query,
+ });
+}
+//
+
+//璁惧楠屾敹鍒楄〃
+export function pageDeviceAcceptance(query) {
+ return request({
+ url: "/deviceAcceptance/pageDeviceAcceptance",
+ method: "get",
+ params: query,
+ });
+}
+
+//璁惧楠屾敹闄勪欢鍒楄〃
+export function getDeviceAcceptanceFileList(query) {
+ return request({
+ url: "/deviceAcceptance/getDeviceAcceptanceFileList",
+ method: "get",
+ params: query,
+ });
+}
+
+//璁惧楠屾敹闄勪欢鍒犻櫎
+export function delDeviceAcceptanceFileList(query) {
+ return request({
+ url: "/deviceAcceptance/delDeviceAcceptanceFileList",
+ method: "delete",
+ params: query,
+ });
+}
+
+//璁惧楠屾敹锛堣澶囷級瀵煎嚭
+export function exportDeviceAcceptance(query) {
+ return request({
+ url: "/deviceAcceptance/exportDeviceAcceptance",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+//鍒犻櫎璁惧楠屾敹
+export function delDeviceAcceptance(query) {
+ return request({
+ url: "/deviceAcceptance/delDeviceAcceptance",
+ method: "delete",
+ params: query,
+ });
+}
+
+//鏌ヨ璁惧楠屾敹
+export function getDeviceAcceptance(query) {
+ return request({
+ url: "/deviceAcceptance/getDeviceAcceptance",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鏂板璁惧楠屾敹
+export function addDeviceAcceptance(data) {
+ return request({
+ url: "/deviceAcceptance/addDeviceAcceptance",
+ method: "post",
+ data: data,
+ });
+}
+
+// 缂栬緫璁惧楠屾敹
+export function updateDeviceAcceptance(data) {
+ return request({
+ url: "/deviceAcceptance/updateDeviceAcceptance",
+ method: "post",
+ data: data,
+ });
+}
+
+//璁惧鏍″噯 鍒嗛〉鏌ヨ
+export function deviceMetricRecordPage(query) {
+ return request({
+ url: "/deviceMetricRecord/deviceMetricRecordPage",
+ method: "get",
+ params: query,
+ });
+}
+// 璁惧鏍″噯 鏂板 鏇存柊-鏍″噯璁板綍
+export function addOrUpdateDeviceMetricRecord(data) {
+ return request({
+ url: "/deviceMetricRecord/addOrUpdateDeviceMetricRecord",
+ method: "post",
+ data: data,
+ });
+}
+//璁惧鏍″噯 鏂板 鏇存柊-鎻愪氦椤圭洰鏍″噯缁存姢
+export function saveOrUpdateDeviceMetric(data) {
+ return request({
+ url: "/deviceMetrics/saveOrUpdateDeviceMetric",
+ method: "post",
+ data: data,
+ });
+}
+
+//璁惧鏍″噯 鏌ヨ鏍″噯鏉$洰
+export function showDeviceMetricsCopy(query) {
+ return request({
+ url: "/deviceMetricRecord/showDeviceMetricsCopy",
+ method: "get",
+ params: query,
+ });
+}
+
+//璁惧鏍″噯 鍒犻櫎
+export function deleteDeviceMetricRecord(query) {
+ return request({
+ url: "/deviceMetricRecord/deleteDeviceMetricRecord",
+ method: "delete",
+ params: query,
+ });
+}
+//璁惧鏍″噯 瀵煎嚭
+export function deviceMetricRecordExport(query) {
+ return request({
+ url: "/deviceMetricRecord/deviceMetricRecordExport",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+//璁惧鏍″噯 璁惧缁存姢琛� 鏌ヨ
+export function selectDeviceMetric(query) {
+ return request({
+ url: "/deviceMetrics/selectDeviceMetric",
+ method: "get",
+ params: query,
+ });
+}
+
+//璁惧鏍″噯 鍒犻櫎
+export function deleteDeviceMetrics(query) {
+ return request({
+ url: "/deviceMetrics/deleteDeviceMetrics",
+ method: "delete",
+ params: query,
+ });
+}
+//鍒犻櫎 璁惧鏍″噯-闄勪欢
+export function delDeviceCalibrationFile(query) {
+ return request({
+ url: "/personBasicInfo/delDeviceCalibrationFile",
+ method: "delete",
+ params: query,
+ });
+}
+//璁惧鏍″噯鏌ヨ-闄勪欢
+export function getDeviceCalibrationFile(query) {
+ return request({
+ url: "/personBasicInfo/getDeviceCalibrationFile",
+ method: "get",
+ params: query,
+ });
+}
+//璁惧鏍″噯瀵煎嚭-闄勪欢
+export function downLoadDeviceCalibrationFile(query) {
+ return request({
+ url: "/personBasicInfo/downLoadDeviceCalibrationFile",
+ method: "get",
+ params: query,
+ responseType: "blob"
+ });
+}
+
+//鍒犻櫎鏂囦欢
+export function deleteCNASFile(query) {
+ return request({
+ url: "/personBasicInfo/deleteCNASFile",
+ method: "delete",
+ params: query,
+ });
+}
+
+//鏌ヨ璁惧妗f鍒楄〃
+export function getListByDId(query) {
+ return request({
+ url: '/documents/getListByDId',
+ method: "get",
+ params: query,
+ });
+}
+
+//璁惧妗f瀵煎嚭
+export function exportDeviceFile(query) {
+ return request({
+ url: "/deviceScope/exportDeviceFile",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+//璁惧淇濆吇鍗曟潯瀵煎嚭
+export function exportMaintenanceRecord(query) {
+ return request({
+ url: "/deviceMaintain/exportMaintenanceRecord",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+//璁惧缁存姢鍒犻櫎
+export function deleteDeviceMaintenance(query) {
+ return request({
+ url: "/deviceMaintain/deleteDeviceMaintenance",
+ method: "delete",
+ params: query,
+ });
+}
+//璁惧缁存姢鍒犻櫎
+export function deviceMaintenanceExport(query) {
+ return request({
+ url: "/deviceMaintain/deviceMaintenanceExport",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+// 鏂板璁惧缁存姢淇濆吇
+export function addDeviceMaintenance(data) {
+ return request({
+ url: "/deviceMaintain/addDeviceMaintenance",
+ method: "post",
+ data: data,
+ });
+}
+//璁惧缁存姢琛� 鏌ヨ
+export function getDeviceMaintenancePage(query) {
+ return request({
+ url: "/deviceMaintain/getDeviceMaintenancePage",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鍊熺敤-淇濆瓨
+export function saveDeviceBorrow(data) {
+ return request({
+ url: "/deviceBorrow/saveDeviceBorrow",
+ method: "post",
+ data: data,
+ });
+}
+
+//鍊熺敤-鏌ョ湅
+export function getDeviceBorrow(query) {
+ return request({
+ url: "/deviceBorrow/getDeviceBorrow",
+ method: "get",
+ params: query,
+ });
+}
+
+//鍊熺敤-瀵煎嚭
+export function deviceBorrowExport(query) {
+ return request({
+ url: "/deviceBorrow/deviceBorrowExport",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+//鍊熺敤-鍒犻櫎
+export function deleteDeviceBorrow(query) {
+ return request({
+ url: "/deviceBorrow/deleteDeviceBorrow",
+ method: "delete",
+ params: query,
+ });
+}
+
+//鍊熺敤-鍒楄〃
+export function deviceBorrowPage(query) {
+ return request({
+ url: "/deviceBorrow/deviceBorrowPage",
+ method: "get",
+ params: query,
+ });
+}
+
+// 璁惧鍚敤/鍋滅敤 淇濆瓨锛屾彁浜わ紝椹冲洖锛岄�氳繃鎺ュ彛
+export function saveDeviceState(data) {
+ return request({
+ url: "/deviceState/saveDeviceState",
+ method: "post",
+ data: data,
+ });
+}
+
+//閫氳繃璁惧缂栧彿鑾峰彇璁惧鍒楄〃
+export function selectDeviceByCode(query) {
+ return request({
+ url: "/deviceScope/selectDeviceByCode",
+ method: "get",
+ params: query,
+ });
+}
+
+//璁惧鍋滃惎鐢ㄥ崟鏉″鍑�
+export function exportDeviceStatus(query) {
+ return request({
+ url: "/deviceState/exportDeviceStatus",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+//璁惧鍚敤/鍋滅敤 鍒犻櫎
+export function deleteDeviceState(query) {
+ return request({
+ url: "/deviceState/deleteDeviceState",
+ method: "delete",
+ params: query,
+ });
+}
+
+//璁惧鐘舵�佸鍑�
+export function deviceStateExport(query) {
+ return request({
+ url: "/deviceState/deviceStateExport",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+//璁惧鍚敤/鍋滅敤 鍒嗛〉
+export function getDeviceStatePage(query) {
+ return request({
+ url: "/deviceState/getDeviceStatePage",
+ method: "get",
+ params: query,
+ });
+}
+
+//璁惧鎶ュ簾鐢宠鍒楄〃
+export function pageDeviceScrapped(query) {
+ return request({
+ url: "/deviceScrapped/pageDeviceScrapped",
+ method: "get",
+ params: query,
+ });
+}
+
+// 瀵煎嚭
+export function exportDeviceScrapped(query) {
+ return request({
+ url: "/deviceScrapped/exportDeviceScrapped",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+//鍒犻櫎璁惧鎶ュ簾鐢宠
+export function delDeviceScrapped(query) {
+ return request({
+ url: "/deviceScrapped/delDeviceScrapped",
+ method: "delete",
+ params: query,
+ });
+}
+
+//鏌ヨ璁惧鎶ュ簾鐢宠
+export function getDeviceScrapped(query) {
+ return request({
+ url: "/deviceScrapped/getDeviceScrapped",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鏂板璁惧鎶ュ簾鐢宠
+export function addDeviceScrapped(data) {
+ return request({
+ url: "/deviceScrapped/addDeviceScrapped",
+ method: "post",
+ data: data,
+ });
+}
+
+//璁惧鏁呴殰缁翠慨鍒楄〃
+export function pageDeviceBreakdownMaintenance(query) {
+ return request({
+ url: "/deviceBreakdownMaintenance/pageDeviceBreakdownMaintenance",
+ method: "get",
+ params: query,
+ });
+}
+
+// 璁惧鏁呴殰涓庣淮淇�-瀵煎嚭
+export function exportDeviceBreakdownMaintenance(query) {
+ return request({
+ url: "/deviceBreakdownMaintenance/exportDeviceBreakdownMaintenance",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+//鍒犻櫎璁惧鏁呴殰缁翠慨
+export function delDeviceBreakdownMaintenance(query) {
+ return request({
+ url: "/deviceBreakdownMaintenance/delDeviceBreakdownMaintenance",
+ method: "delete",
+ params: query,
+ });
+}
+
+//鏌ヨ璁惧鏁呴殰缁翠慨
+export function getDeviceBreakdownMaintenance(query) {
+ return request({
+ url: "/deviceBreakdownMaintenance/getDeviceBreakdownMaintenance",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鏂板璁惧鏁呴殰缁翠慨
+export function addDeviceBreakdownMaintenance(data) {
+ return request({
+ url: "/deviceBreakdownMaintenance/addDeviceBreakdownMaintenance",
+ method: "post",
+ data: data,
+ });
+}
+
+//鍒嗛〉鏌ヨ璁惧鐐规璁板綍
+export function getDeviceInspectionRecordByPage(query) {
+ return request({
+ url: "/deviceInspectionRecord/getDeviceInspectionRecordByPage",
+ method: "get",
+ params: query,
+ });
+}
+
+// 瀵煎嚭璁惧鐐规璁板綍
+export function exportDeviceInspectionRecord(query) {
+ return request({
+ url: "/deviceInspectionRecord/exportDeviceInspectionRecord",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+//鍒犻櫎璁惧鐐规璁板綍
+export function deleteDeviceInspectionRecord(query) {
+ return request({
+ url: "/deviceInspectionRecord/deleteDeviceInspectionRecord",
+ method: "delete",
+ params: query,
+ });
+}
+
+//璁惧鐐规璁板綍璇︽儏
+export function getDeviceInspectionRecord(query) {
+ return request({
+ url: "/deviceInspectionRecord/getDeviceInspectionRecord",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鏂板璁惧鐐规璁板綍
+export function addDeviceInspectionRecord(data) {
+ return request({
+ url: "/deviceInspectionRecord/addDeviceInspectionRecord",
+ method: "post",
+ data: data,
+ });
+}
+
+// 淇敼璁惧鐐规璁板綍
+export function updateDeviceInspectionRecord(data) {
+ return request({
+ url: "/deviceInspectionRecord/updateDeviceInspectionRecord",
+ method: "post",
+ data: data,
+ });
+}
+
+// 澶嶆牳璁惧鐐规璁板綍
+export function reviewDeviceInspectionRecord(data) {
+ return request({
+ url: "/deviceInspectionRecord/reviewDeviceInspectionRecord",
+ method: "post",
+ data: data,
+ });
+}
+
+//璁惧浜嬫晠鎶ュ憡鍒楄〃
+export function pageDeviceAccidentReport(query) {
+ return request({
+ url: "/deviceAccidentReport/pageDeviceAccidentReport",
+ method: "get",
+ params: query,
+ });
+}
+
+// 瀵煎嚭璁惧浜嬫晠
+export function exportDeviceAccidentReport(query) {
+ return request({
+ url: "/deviceAccidentReport/exportDeviceAccidentReport",
+ method: "get",
+ responseType: "blob",
+ params: query,
+ });
+}
+
+//鍒犻櫎璁惧浜嬫晠鎶ュ憡
+export function delDeviceAccidentReport(query) {
+ return request({
+ url: "/deviceAccidentReport/delDeviceAccidentReport",
+ method: "delete",
+ params: query,
+ });
+}
+
+//鏌ヨ璁惧浜嬫晠鎶ュ憡
+export function getDeviceAccidentReport(query) {
+ return request({
+ url: "/deviceAccidentReport/getDeviceAccidentReport",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鏂板璁惧浜嬫晠鎶ュ憡
+export function addDeviceAccidentReport(data) {
+ return request({
+ url: "/deviceAccidentReport/addDeviceAccidentReport",
+ method: "post",
+ data: data,
+ });
+}
+//浣滀笟鎸囧涔︽煡璇�
+export function pageByPageQueryOfHomeworkInstructions(query) {
+ return request({
+ url: "/instruction/pageByPageQueryOfHomeworkInstructions",
+ method: "get",
+ params: query,
+ });
+}
+//浣滀笟鎸囧涔� 瀹℃壒
+export function approvalOfHomeworkInstructionManual(data) {
+ return request({
+ url: "/instruction/approvalOfHomeworkInstructionManual",
+ method: "post",
+ data: data,
+ });
+}
+
+//浣滀笟鎸囧涔� 鍒犻櫎
+export function homeworkGuidebook(query) {
+ return request({
+ url: "/instruction/homeworkGuidebook",
+ method: "delete",
+ params: query,
+ });
+}
+
+//浣滀笟鎸囧涔� 缂栬緫鏌ヨ
+export function homeworkGuidebookEditor(query) {
+ return request({
+ url: "/instruction/homeworkGuidebookEditor",
+ method: "get",
+ params: query,
+ });
+}
+
+//浣滀笟鎸囧涔︽柊澧�
+export function newHomeworkGuidebookAdded(data) {
+ return request({
+ url: "/instruction/newHomeworkGuidebookAdded",
+ method: "post",
+ data: data,
+ });
+}
+
+//浣滀笟鎸囧涔﹀彈鎺ф枃浠跺垹闄�
+export function deleteHomeworkGuidebook(query) {
+ return request({
+ url: "/instruction/deleteHomeworkGuidebook",
+ method: "delete",
+ params: query,
+ });
+}
+
+//璁惧棰勭害鎺ュ彛
+export function reservationSelectDevice(query) {
+ return request({
+ url: "/reservation/selectDeviceParameter",
+ method: "get",
+ params: query,
+ });
+}
+//璁惧棰勭害鎺ュ彛 鍒犻櫎
+export function reservationDelete(query) {
+ return request({
+ url: "/reservation/delete",
+ method: "delete",
+ params: query,
+ });
+}
+//璁惧棰勭害鎺ュ彛 淇濆瓨
+export function reservationSave(query) {
+ return request({
+ url: "/reservation/save",
+ method: "post",
+ data: query,
+ });
+}
+//璁惧棰勭害鎺ュ彛
+export function selectReservationParameterPage(query) {
+ return request({
+ url: "/reservation/selectReservationParameterPage",
+ method: "get",
+ params: query,
+ });
+}
+// 璁惧杩愯鎬昏-鏍规嵁id鑾峰彇璁惧鏁呴殰鏁版嵁
+export function device(query) {
+ return request({
+ url: "/deviceFaults/device",
+ method: "get",
+ params: query,
+ });
+}
+//璁惧楠屾敹涓洓涓猼able琛ㄦ牸鐨勫垹闄ゅ姛鑳�
+export function deleteIncidentReportAll(query) {
+ return request({
+ url: "/incidentReport/deleteIncidentReportAll",
+ method: "delete",
+ params: query,
+ });
+}
+//璁惧楠屾敹涓洓涓猼able琛ㄦ牸鐨勫垹闄ゅ姛鑳�
+export function deleteIncidentReport(query) {
+ return request({
+ url: "/incidentReport/deleteIncidentReport",
+ method: "delete",
+ params: query,
+ });
+}
+
+//璁惧楠屾敹 淇濆瓨锛屾彁浜わ紝椹冲洖锛岄�氳繃鎺ュ彛
+export function saveIncidentReportData(query) {
+ return request({
+ url: "/incidentReport/saveIncidentReportData",
+ method: "post",
+ data: query,
+ });
+}
+//璁惧楠屾敹 淇濆瓨锛屾彁浜わ紝椹冲洖锛岄�氳繃鎺ュ彛
+export function incidentReportPage(query) {
+ return request({
+ url: "/incidentReport/incidentReportPage",
+ method: "get",
+ params: query,
+ });
+}
+//璁惧楠屾敹 淇濆瓨锛屾彁浜わ紝椹冲洖锛岄�氳繃鎺ュ彛
+export function getShowIncidentReport(query) {
+ return request({
+ url: "/incidentReport/getShowIncidentReport",
+ method: "get",
+ params: query,
+ });
+}
+//璁惧楠屾敹瀵煎嚭
+export function incidentReportExport(query) {
+ return request({
+ url: "/incidentReport/incidentReportExport",
+ method: "get",
+ params: query,
+ responseType: "blob"
+ });
+}
+//娣诲姞璁惧鏁呴殰
+export function addOrUpdateDeviceFaultOne(query) {
+ return request({
+ url: "/deviceFaultOne/addOrUpdateDeviceFaultOne",
+ method: "post",
+ data: query,
+ });
+}
+//璁惧鏁呴殰琛� 鍒嗛〉鏌ヨ
+export function deviceFaultOnePage(query) {
+ return request({
+ url: "/deviceFaultOne/deviceFaultOnePage",
+ method: "get",
+ params: query,
+ });
+}
+//璁惧鏁呴殰瀵煎嚭
+export function exportRewardAndPunishmentRecords(query) {
+ return request({
+ url: "/deviceFaultOne/exportRewardAndPunishmentRecords",
+ method: "get",
+ params: query,
+ responseType: "blob"
+ });
+}
+
+//鍒犻櫎 璁惧鏁呴殰
+export function deleteDeviceFaultOne(query) {
+ return request({
+ url: "/deviceFaultOne/deleteDeviceFaultOne",
+ method: "delete",
+ params: query,
+ });
+}
+
diff --git a/src/api/standard/standardLibrary.js b/src/api/standard/standardLibrary.js
index 7817c92..63752ea 100644
--- a/src/api/standard/standardLibrary.js
+++ b/src/api/standard/standardLibrary.js
@@ -99,6 +99,15 @@
});
}
+// 閫氳繃鏍囧噯鏍戞煡璇㈠搴旂殑妫�楠岄」鐩�
+export function selectStandardProductList(query) {
+ return request({
+ url: "/standardTree/selectStandardProductList",
+ method: "get",
+ params: query,
+ });
+}
+
// 鏌ヨ鍘熷璁板綍妯℃澘鏋氫妇
export function getStandardTemplate(query) {
return request({
@@ -134,3 +143,19 @@
params: query,
});
}
+
+// 鑾峰彇鏍囧噯鏍戜笅鏍囧噯鏂规硶鏋氫妇
+export function selectStandardMethodEnum() {
+ return request({
+ url: "/standardTree/selectStandardMethodEnum",
+ method: "get",
+ });
+}
+
+// 鑾峰彇鏍囧噯鏍�(妫�楠屼笅鍗�)
+export function selectStandardTreeList2() {
+ return request({
+ url: "/standardTree/selectStandardTreeList2",
+ method: "get",
+ });
+}
diff --git a/src/api/system/user.js b/src/api/system/user.js
index 7579fd2..cb4750c 100644
--- a/src/api/system/user.js
+++ b/src/api/system/user.js
@@ -185,9 +185,17 @@
}
// 鑾峰彇褰撳墠鐧诲綍浜哄憳閮ㄩ棬
-export function selectUserDepartmentLimsName(query) {
+export function selectUserDepartmentLimsName() {
return request({
url: "/system/newUser/selectUserDepartmentLimsName",
method: "get",
});
}
+
+// 鑾峰彇瀹為獙瀹や笅鐨勬楠屽憳鍒楄〃
+export function getLaboratoryPersonList() {
+ return request({
+ url: "/system/newUser/getLaboratoryPersonList",
+ method: "get",
+ });
+}
diff --git a/src/assets/images/renyuan-title.svg b/src/assets/images/renyuan-title.svg
new file mode 100644
index 0000000..c69691f
--- /dev/null
+++ b/src/assets/images/renyuan-title.svg
@@ -0,0 +1,11 @@
+<svg width="148" height="21" viewBox="0 0 148 21" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M7.00437 5.75531V0.0625L0.772461 5.75531H7.00437Z" fill="#B26F00"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M141.709 5.75531V0.0625L147.941 5.75531H141.709Z" fill="#B26F00"/>
+<path d="M6.97192 2.0625C6.97192 0.957931 7.86735 0.0625 8.97192 0.0625H139.676C140.781 0.0625 141.676 0.957931 141.676 2.0625V12.0625C141.676 16.4808 138.095 20.0625 133.676 20.0625H14.9719C10.5537 20.0625 6.97192 16.4808 6.97192 12.0625V2.0625Z" fill="url(#paint0_linear_2026_4)"/>
+<defs>
+<linearGradient id="paint0_linear_2026_4" x1="6.97192" y1="0.0625" x2="6.97192" y2="20.0625" gradientUnits="userSpaceOnUse">
+<stop stop-color="#F9C76F"/>
+<stop offset="1" stop-color="#FEB42F"/>
+</linearGradient>
+</defs>
+</svg>
diff --git a/src/assets/styles/element-ui.scss b/src/assets/styles/element-ui.scss
index 363092a..c0bd317 100644
--- a/src/assets/styles/element-ui.scss
+++ b/src/assets/styles/element-ui.scss
@@ -89,4 +89,48 @@
> .el-submenu__title
.el-submenu__icon-arrow {
display: none;
-}
\ No newline at end of file
+}
+
+/* 鍏ㄥ眬琛ㄦ牸鏍峰紡 */
+.el-table th.el-table__cell,
+.has-gutter .el-table__cell {
+ background-color: #f0f1f5 !important;
+ color: #333;
+}
+
+/* 琛ㄦ牸琛岄�変腑鑳屾櫙鑹� */
+.el-table__body tr.current-row>td.el-table__cell,
+.el-table__body tr.selection-row>td.el-table__cell {
+ background-color: #c1ddf1;
+}
+
+.el-table__header .has-gutter .el-table__cell .cell {
+ font-size: 14px !important;
+ font-weight: 500;
+}
+
+.cell {
+ color: #333;
+ padding: 0 15px !important;
+ font-size: 12px;
+}
+
+.cell span {
+ font-size: 12px;
+ font-weight: 400;
+}
+
+.el-table .el-table__cell {
+ padding: 0 0;
+}
+
+.el-table .el-table__row {
+ height: 41px;
+}
+
+.el-table th.el-table__cell>.cell {
+ font-size: 14px;
+ font-weight: 400;
+ color: #333;
+ padding: 6px 15px !important;
+}
diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss
index a8f0459..f5b99c0 100644
--- a/src/assets/styles/index.scss
+++ b/src/assets/styles/index.scss
@@ -199,8 +199,8 @@
.bg-1 {
width: 100%;
- height: calc(100% - 50px);
+ min-height: calc(100vh - 90px);
overflow-y: auto;
- padding: 20px 10px 10px;
+ // padding: 20px 10px 10px;
background: rgb(245, 247, 251);
}
diff --git a/src/components/Echart/echart.vue b/src/components/Echart/echart.vue
new file mode 100644
index 0000000..a7ccff3
--- /dev/null
+++ b/src/components/Echart/echart.vue
@@ -0,0 +1,116 @@
+<template>
+ <div>
+ <div class="echart_size" :id="id" :style="`height:${config.height};width:${config.width}`"></div>
+ </div>
+</template>
+<script>
+import * as echarts from 'echarts'
+import ResizeListener from 'element-resize-detector';
+import { iuCharts } from '@/utils/echarts'
+export default {
+ props: {
+ id: {
+ type: String,
+ default: ''
+ },
+ config: {
+ type: Object,
+ default: () => { }
+ },
+ datas: {
+ type: Object,
+ default: () => { }
+ }
+ },
+ data() {
+ return {
+ chart: null,
+ }
+ },
+ watch: {
+ /* 濡傛灉鍥捐〃鏁版嵁鏄悗鍙拌幏鍙栫殑锛岀洃鍚埗缁勪欢涓殑鏁版嵁鍙樺寲锛岄噸鏂拌Е鍙慐charts */
+ datas: {
+ deep: true,
+ // immediate: true,
+ handler(val) {
+ this.$nextTick(() => {
+ this.init();
+ })
+ },
+ },
+ },
+ created() {
+ this.$nextTick(() => {
+ this.init()
+ })
+ },
+ mounted() {
+ window.addEventListener('resize', this.windowResizeListener);
+ this.chartEleResizeListener();
+ },
+ beforeDestroy() {
+ if (!this.chart) {
+ return;
+ }
+ this.chart.dispose();
+ this.chart = null;
+ },
+ methods: {
+ init() {
+ // 瀹炰緥鍖栧璞�
+ this.chart = echarts.init(document.getElementById(this.id))
+ this.chart.showLoading({
+ text: 'loading',
+ color: '#3A7BFA',
+ textColor: '#000',
+ maskColor: 'rgba(255, 255, 255, 0.2)',
+ zlevel: 0,
+ });
+ if (this.config.isLoading) {
+ this.chart.hideLoading();
+ switch (this.config.type) {
+ case 'bar':
+ iuCharts.drawBar(this.chart, this.datas)
+ break;
+ case 'line':
+ iuCharts.drawLine(this.chart, this.datas)
+ break;
+ case 'pie':
+ iuCharts.drawPie(this.chart, this.datas)
+ break;
+ case 'gauge':
+ iuCharts.drawGauge(this.chart, this.datas)
+ break;
+ default:
+ break;
+ }
+ setTimeout(() => {
+ this.chart.resize()
+ }, 200)
+ }
+ },
+ /* 瀵筩hart鍏冪礌灏哄杩涜鐩戝惉锛屽綋鍙戠敓鍙樺寲鏃跺悓姝ユ洿鏂癳chart瑙嗗浘 */
+ chartEleResizeListener() {
+ const chartInstance = ResizeListener({
+ strategy: 'scroll',
+ callOnAdd: true
+ });
+ chartInstance.listenTo(this.$el, () => {
+ if (!this.chart) return;
+ this.chart.resize();
+ });
+ },
+ /* 褰撶獥鍙g缉鏀炬椂锛宔chart鍔ㄦ�佽皟鏁磋嚜韬ぇ灏� */
+ windowResizeListener() {
+ if (!this.chart) return;
+ this.chart.resize();
+ }
+ }
+}
+</script>
+<style scoped>
+.echart_size {
+ width: 100%;
+ height: 100%;
+}
+</style>
diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue
index 9323e53..1142802 100644
--- a/src/components/Editor/index.vue
+++ b/src/components/Editor/index.vue
@@ -1,17 +1,8 @@
<template>
<div>
- <el-upload
- :action="uploadUrl"
- :before-upload="handleBeforeUpload"
- :on-success="handleUploadSuccess"
- :on-error="handleUploadError"
- name="file"
- :show-file-list="false"
- :headers="headers"
- style="display: none"
- ref="upload"
- v-if="this.type == 'url'"
- >
+ <el-upload :action="uploadUrl" :before-upload="handleBeforeUpload" :on-success="handleUploadSuccess"
+ :on-error="handleUploadError" name="file" :show-file-list="false" :headers="uploadHeader" style="display: none"
+ ref="upload" v-if="this.type == 'url'">
</el-upload>
<div class="editor" ref="editor" :style="styles"></div>
</div>
@@ -197,76 +188,95 @@
</script>
<style>
-.editor, .ql-toolbar {
+.editor,
+.ql-toolbar {
white-space: pre-wrap !important;
line-height: normal !important;
}
+
.quill-img {
display: none;
}
+
.ql-snow .ql-tooltip[data-mode="link"]::before {
content: "璇疯緭鍏ラ摼鎺ュ湴鍧�:";
}
+
.ql-snow .ql-tooltip.ql-editing a.ql-action::after {
border-right: 0px;
content: "淇濆瓨";
padding-right: 0px;
}
+
.ql-snow .ql-tooltip[data-mode="video"]::before {
content: "璇疯緭鍏ヨ棰戝湴鍧�:";
}
+
.ql-snow .ql-picker.ql-size .ql-picker-label::before,
.ql-snow .ql-picker.ql-size .ql-picker-item::before {
content: "14px";
}
+
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before {
content: "10px";
}
+
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before {
content: "18px";
}
+
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before {
content: "32px";
}
+
.ql-snow .ql-picker.ql-header .ql-picker-label::before,
.ql-snow .ql-picker.ql-header .ql-picker-item::before {
content: "鏂囨湰";
}
+
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
content: "鏍囬1";
}
+
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
content: "鏍囬2";
}
+
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
content: "鏍囬3";
}
+
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before {
content: "鏍囬4";
}
+
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before {
content: "鏍囬5";
}
+
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before {
content: "鏍囬6";
}
+
.ql-snow .ql-picker.ql-font .ql-picker-label::before,
.ql-snow .ql-picker.ql-font .ql-picker-item::before {
content: "鏍囧噯瀛椾綋";
}
+
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="serif"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="serif"]::before {
content: "琛嚎瀛椾綋";
}
+
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="monospace"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before {
content: "绛夊瀛椾綋";
diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue
index 12ad4ea..63a9f2e 100644
--- a/src/components/FileUpload/index.vue
+++ b/src/components/FileUpload/index.vue
@@ -1,19 +1,8 @@
<template>
<div class="upload-file">
- <el-upload
- multiple
- :action="uploadFileUrl"
- :before-upload="handleBeforeUpload"
- :file-list="fileList"
- :limit="limit"
- :on-error="handleUploadError"
- :on-exceed="handleExceed"
- :on-success="handleUploadSuccess"
- :show-file-list="false"
- :headers="headers"
- class="upload-file-uploader"
- ref="fileUpload"
- >
+ <el-upload multiple :action="uploadFileUrl" :before-upload="handleBeforeUpload" :file-list="fileList" :limit="limit"
+ :on-error="handleUploadError" :on-exceed="handleExceed" :on-success="handleUploadSuccess" :show-file-list="false"
+ :headers="uploadHeader" class="upload-file-uploader" ref="fileUpload">
<!-- 涓婁紶鎸夐挳 -->
<el-button size="mini" type="primary">閫夊彇鏂囦欢</el-button>
<!-- 涓婁紶鎻愮ず -->
@@ -203,18 +192,21 @@
.upload-file-uploader {
margin-bottom: 5px;
}
+
.upload-file-list .el-upload-list__item {
border: 1px solid #e4e7ed;
line-height: 2;
margin-bottom: 10px;
position: relative;
}
+
.upload-file-list .ele-upload-list__item-content {
display: flex;
justify-content: space-between;
align-items: center;
color: inherit;
}
+
.ele-upload-list__item-content-action .el-link {
margin-right: 10px;
}
diff --git a/src/components/ImageUpload/index.vue b/src/components/ImageUpload/index.vue
index bf7e381..f8e4009 100644
--- a/src/components/ImageUpload/index.vue
+++ b/src/components/ImageUpload/index.vue
@@ -1,22 +1,9 @@
<template>
<div class="component-upload-image">
- <el-upload
- multiple
- :action="uploadImgUrl"
- list-type="picture-card"
- :on-success="handleUploadSuccess"
- :before-upload="handleBeforeUpload"
- :limit="limit"
- :on-error="handleUploadError"
- :on-exceed="handleExceed"
- ref="imageUpload"
- :on-remove="handleDelete"
- :show-file-list="true"
- :headers="headers"
- :file-list="fileList"
- :on-preview="handlePictureCardPreview"
- :class="{hide: this.fileList.length >= this.limit}"
- >
+ <el-upload multiple :action="uploadImgUrl" list-type="picture-card" :on-success="handleUploadSuccess"
+ :before-upload="handleBeforeUpload" :limit="limit" :on-error="handleUploadError" :on-exceed="handleExceed"
+ ref="imageUpload" :on-remove="handleDelete" :show-file-list="true" :headers="uploadHeader" :file-list="fileList"
+ :on-preview="handlePictureCardPreview" :class="{ hide: this.fileList.length >= this.limit }">
<i class="el-icon-plus"></i>
</el-upload>
@@ -28,16 +15,8 @@
鐨勬枃浠�
</div>
- <el-dialog
- :visible.sync="dialogVisible"
- title="棰勮"
- width="800"
- append-to-body
- >
- <img
- :src="dialogImageUrl"
- style="display: block; max-width: 100%; margin: 0 auto"
- />
+ <el-dialog :visible.sync="dialogVisible" title="棰勮" width="800" append-to-body>
+ <img :src="dialogImageUrl" style="display: block; max-width: 100%; margin: 0 auto" />
</el-dialog>
</div>
</template>
@@ -56,7 +35,7 @@
},
// 澶у皬闄愬埗(MB)
fileSize: {
- type: Number,
+ type: Number,
default: 5,
},
// 鏂囦欢绫诲瀷, 渚嬪['png', 'jpg', 'jpeg']
@@ -95,9 +74,9 @@
this.fileList = list.map(item => {
if (typeof item === "string") {
if (item.indexOf(this.baseUrl) === -1 && !isExternal(item)) {
- item = { name: this.baseUrl + item, url: this.baseUrl + item };
+ item = { name: this.baseUrl + item, url: this.baseUrl + item };
} else {
- item = { name: item, url: item };
+ item = { name: item, url: item };
}
}
return item;
@@ -215,17 +194,18 @@
<style scoped lang="scss">
// .el-upload--picture-card 鎺у埗鍔犲彿閮ㄥ垎
::v-deep.hide .el-upload--picture-card {
- display: none;
+ display: none;
}
+
// 鍘绘帀鍔ㄧ敾鏁堟灉
::v-deep .el-list-enter-active,
::v-deep .el-list-leave-active {
- transition: all 0s;
+ transition: all 0s;
}
-::v-deep .el-list-enter, .el-list-leave-active {
+::v-deep .el-list-enter,
+.el-list-leave-active {
opacity: 0;
transform: translateY(0);
}
</style>
-
diff --git a/src/components/Table/lims-table.vue b/src/components/Table/lims-table.vue
index f3e3a3d..9b35d19 100644
--- a/src/components/Table/lims-table.vue
+++ b/src/components/Table/lims-table.vue
@@ -1,29 +1,85 @@
<template>
<div>
<!-- 琛ㄦ牸 -->
- <el-table ref="multipleTable" v-loading="tableLoading" :border="border" :data="tableData"
- :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" :height="height"
- :highlight-current-row="highlightCurrentRow" :row-class-name="rowClassName" :row-style="rowStyle"
- :row-key="rowKey" :span-method="spanMethod" stripe style="width: 100%" tooltip-effect="dark" @row-click="rowClick"
- @current-change="currentChange" @selection-change="handleSelectionChange" class="lims-table">
- <el-table-column align="center" type="selection" width="55" v-if="isSelection" />
- <el-table-column align="center" label="搴忓彿" type="index" width="60" :index="indexMethod" />
+ <el-table
+ ref="multipleTable"
+ v-loading="tableLoading"
+ :border="border"
+ :data="tableData"
+ :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }"
+ :height="height"
+ :highlight-current-row="highlightCurrentRow"
+ :row-class-name="rowClassName"
+ :row-style="rowStyle"
+ :row-key="rowKey"
+ :span-method="spanMethod"
+ :stripe="stripe"
+ style="width: 100%"
+ tooltip-effect="dark"
+ @row-click="rowClick"
+ @current-change="currentChange"
+ @selection-change="handleSelectionChange"
+ class="lims-table"
+ >
+ <el-table-column
+ align="center"
+ type="selection"
+ width="55"
+ v-if="isSelection"
+ />
+ <el-table-column
+ align="center"
+ label="搴忓彿"
+ type="index"
+ width="60"
+ :index="indexMethod"
+ />
- <el-table-column v-for="(item, index) in column" :key="index" :column-key="item.columnKey"
- :filter-method="item.filterHandler" :filter-multiple="item.filterMultiple" :filtered-value="item.filteredValue"
- :filters="item.filters" :fixed="item.fixed" :label="item.label" :min-width="item.minWidth" :prop="item.prop"
- :show-overflow-tooltip="item.dataType === 'action' || item.dataType === 'slot' ? false : true"
- :sortable="item.sortable ? true : false" :type="item.type"
- :width="item.dataType === 'action' ? getWidth(item.operation) : item.width" align="center">
+ <el-table-column
+ v-for="(item, index) in column"
+ :key="index"
+ :column-key="item.columnKey"
+ :filter-method="item.filterHandler"
+ :filter-multiple="item.filterMultiple"
+ :filtered-value="item.filteredValue"
+ :filters="item.filters"
+ :fixed="item.fixed"
+ :label="item.label"
+ :min-width="item.minWidth"
+ :prop="item.prop"
+ :show-overflow-tooltip="
+ item.dataType === 'action' || item.dataType === 'slot' ? false : true
+ "
+ :sortable="item.sortable ? true : false"
+ :type="item.type"
+ :width="
+ item.dataType === 'action' ? getWidth(item.operation) : item.width
+ "
+ align="center"
+ >
<!-- <div class="123" v-if="item.type == ''"> -->
- <template v-if="item.hasOwnProperty('colunmTemplate')" :slot="item.colunmTemplate" slot-scope="scope">
- <slot v-if="item.theadSlot" :index="index" :name="item.theadSlot" :row="scope.row" />
+ <template
+ v-if="item.hasOwnProperty('colunmTemplate')"
+ :slot="item.colunmTemplate"
+ slot-scope="scope"
+ >
+ <slot
+ v-if="item.theadSlot"
+ :index="index"
+ :name="item.theadSlot"
+ :row="scope.row"
+ />
</template>
<template slot-scope="scope">
<!-- 鎻掓Ы -->
<div v-if="item.dataType == 'slot'">
- <slot v-if="item.slot" :index="scope.$index" :name="item.slot" :row="scope.row" />
+ <slot
+ v-if="item.slot"
+ :index="scope.$index"
+ :name="item.slot"
+ :row="scope.row"
+ />
</div>
<!-- 杩涘害鏉� -->
<div v-else-if="item.dataType == 'progress'">
@@ -31,89 +87,142 @@
</div>
<!-- 鍥剧墖 -->
<div v-else-if="item.dataType == 'image'">
- <img :src="javaApi + '/img/' + scope.row[item.prop]" alt=""
- style="width: 40px; height: 40px; margin-top: 10px" />
+ <img
+ :src="javaApi + '/img/' + scope.row[item.prop]"
+ alt=""
+ style="width: 40px; height: 40px; margin-top: 10px"
+ />
</div>
<!-- tag -->
<div v-else-if="item.dataType == 'tag'">
- <el-tag v-if="
- typeof dataTypeFn(scope.row[item.prop], item.formatData) ==
- 'string'
- " :title="scope.row[item.prop] | formatters(item.formatData)"
- :type="formatType(scope.row[item.prop], item.formatType)">{{ scope.row[item.prop] |
- formatters(item.formatData) }}</el-tag>
- <el-tag v-for="(tag, index) in dataTypeFn(
- scope.row[item.prop],
- item.formatData
- )" v-else-if="
- typeof dataTypeFn(scope.row[item.prop], item.formatData) ==
- 'object'
- " :key="index" :title="scope.row[item.prop] | formatters(item.formatData)"
- :type="formatType(tag, item.formatType)">{{
+ <el-tag
+ v-if="
+ typeof dataTypeFn(scope.row[item.prop], item.formatData) ==
+ 'string'
+ "
+ :title="scope.row[item.prop] | formatters(item.formatData)"
+ :type="formatType(scope.row[item.prop], item.formatType)"
+ >{{ scope.row[item.prop] | formatters(item.formatData) }}</el-tag
+ >
+ <el-tag
+ v-for="(tag, index) in dataTypeFn(
+ scope.row[item.prop],
+ item.formatData
+ )"
+ v-else-if="
+ typeof dataTypeFn(scope.row[item.prop], item.formatData) ==
+ 'object'
+ "
+ :key="index"
+ :title="scope.row[item.prop] | formatters(item.formatData)"
+ :type="formatType(tag, item.formatType)"
+ >{{
item.tagGroup
? tag[item.tagGroup.label]
? tag[item.tagGroup.label]
: tag
: tag
- }}</el-tag>
- <el-tag v-else :title="scope.row[item.prop] | formatters(item.formatData)"
- :type="formatType(scope.row[item.prop], item.formatType)">{{ scope.row[item.prop] |
- formatters(item.formatData) }}</el-tag>
+ }}</el-tag
+ >
+ <el-tag
+ v-else
+ :title="scope.row[item.prop] | formatters(item.formatData)"
+ :type="formatType(scope.row[item.prop], item.formatType)"
+ >{{ scope.row[item.prop] | formatters(item.formatData) }}</el-tag
+ >
</div>
<!-- 鎸夐挳 -->
<div v-else-if="item.dataType == 'action'">
<template v-for="(o, key) in item.operation">
- <el-button v-show="o.type != 'upload'" size="mini" v-if="o.showHide ? o.showHide(scope.row) : true"
- :disabled="o.disabled ? o.disabled(scope.row) : false" :icon="iconFn(o)" :plain="o.plain"
- :style="{ color: o.name === '鍒犻櫎' ? '#f56c6c' : o.color }" :type="o.type | typeFn(scope.row)"
- @click="o.clickFun(scope.row)" :key="key">
+ <el-button
+ v-show="o.type != 'upload'"
+ size="mini"
+ v-if="o.showHide ? o.showHide(scope.row) : true"
+ :disabled="o.disabled ? o.disabled(scope.row) : false"
+ :icon="iconFn(o)"
+ :plain="o.plain"
+ :style="{ color: o.name === '鍒犻櫎' ? '#f56c6c' : o.color }"
+ :type="o.type | typeFn(scope.row)"
+ @click="o.clickFun(scope.row)"
+ :key="key"
+ >
{{ o.name }}
</el-button>
- <!-- <el-upload :action="javaApi + o.url + '?id=' + (o.uploadIdFun ? o.uploadIdFun(scope.row) : scope.row.id)"
- size="mini" ref="upload" :multiple="o.multiple ? o.multiple : false" :limit="1"
- :disabled="o.disabled ? o.disabled(scope.row) : false" :accept="o.accept
- ? o.accept
- : '.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'
- " v-if="o.type == 'upload' && o.url" style="display: inline-block; width: 50px"
- v-show="o.showHide ? o.showHide(scope.row) : true" :headers="uploadHeader" :on-error="onError"
+ <el-upload
+ :action="
+ javaApi +
+ o.url
+ "
+ size="mini"
+ ref="upload"
+ :multiple="o.multiple ? o.multiple : false"
+ :disabled="o.disabled ? o.disabled(scope.row) : false"
+ :accept="
+ o.accept
+ ? o.accept
+ : '.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'
+ "
+ v-if="o.type == 'upload' && o.url"
+ style="display: inline-block; width: 50px"
+ v-show="o.showHide ? o.showHide(scope.row) : true"
:data="o.data ? o.data(scope.row) : {}"
:before-upload="o.beforeUpload ? o.beforeUpload(scope.row) : () => true"
- :on-exceed="onExceed" :on-success="handleSuccessUp" :show-file-list="false" :key="key">
- <el-button :size="o.size ? o.size : 'small'" type="text"
- :disabled="o.disabled ? o.disabled(scope.row) : false">{{ o.name }}</el-button>
- </el-upload> -->
- <el-upload :action="javaApi + o.url"
- size="mini" ref="upload" :multiple="o.multiple ? o.multiple : false"
- :disabled="o.disabled ? o.disabled(scope.row) : false" :accept="o.accept
- ? o.accept
- : '.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'
- " v-if="o.type == 'upload' && o.url" style="display: inline-block; width: 50px"
- v-show="o.showHide ? o.showHide(scope.row) : true" :headers="uploadHeader" :on-error="onError"
- :data="o.data ? o.data(scope.row) : {}"
- :before-upload="o.beforeUpload ? o.beforeUpload(scope.row) : () => true"
- :on-exceed="onExceed" :on-success="handleSuccessUp" :show-file-list="false" :key="key">
- <el-button :size="o.size ? o.size : 'small'" type="text"
- :disabled="o.disabled ? o.disabled(scope.row) : false">{{ o.name }}</el-button>
+ :headers="uploadHeader"
+ :on-error="onError"
+ :on-exceed="onExceed"
+ :on-success="handleSuccessUp"
+ :show-file-list="false"
+ :key="key"
+ >
+ <el-button
+ :size="o.size ? o.size : 'small'"
+ type="text"
+ :disabled="o.disabled ? o.disabled(scope.row) : false"
+ >{{ o.name }}</el-button
+ >
</el-upload>
- <el-upload action="#" :on-change="(file, fileList) => o.clickFun(scope.row, file, fileList)
- " :multiple="o.multiple ? o.multiple : false" :limit="o.limit ? o.limit : 1"
- :disabled="o.disabled ? o.disabled(scope.row) : false" :accept="o.accept
- ? o.accept
- : '.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'
- " v-if="o.type == 'upload' && !o.url" style="display: inline-block; width: 50px"
- v-show="o.showHide ? o.showHide(scope.row) : true" :auto-upload="false" :on-exceed="onExceed"
- :show-file-list="false" :key="key">
- <el-button :size="o.size ? o.size : 'small'" type="text"
- :disabled="o.disabled ? o.disabled(scope.row) : false">{{ o.name }}</el-button>
+ <el-upload
+ action="#"
+ :on-change="
+ (file, fileList) => o.clickFun(scope.row, file, fileList)
+ "
+ :multiple="o.multiple ? o.multiple : false"
+ :limit="o.limit ? o.limit : 1"
+ :disabled="o.disabled ? o.disabled(scope.row) : false"
+ :accept="
+ o.accept
+ ? o.accept
+ : '.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'
+ "
+ v-if="o.type == 'upload' && !o.url"
+ style="display: inline-block; width: 50px"
+ v-show="o.showHide ? o.showHide(scope.row) : true"
+ :auto-upload="false"
+ :on-exceed="onExceed"
+ :show-file-list="false"
+ :key="key"
+ >
+ <el-button
+ :size="o.size ? o.size : 'small'"
+ type="text"
+ :disabled="o.disabled ? o.disabled(scope.row) : false"
+ >{{ o.name }}</el-button
+ >
</el-upload>
</template>
</div>
<!-- 鍙偣鍑荤殑鏂囧瓧 -->
- <div v-else-if="item.dataType == 'link'" class="cell link" style="width: 100%"
- @click="goLink(scope.row, item.linkMethod)">
- <span v-if="!item.formatData">{{ scope.row[item.prop] }}</span>
+ <div
+ v-else-if="item.dataType == 'link'"
+ class="cell"
+ style="width: 100%"
+ @click="goLink(scope.row, item.linkEvent)"
+ >
+ <span class="link" v-if="!item.formatData">
+ {{ scope.row[item.prop] }}
+ </span>
</div>
<!-- 榛樿绾睍绀烘暟鎹� -->
<div v-else class="cell" style="width: 100%">
@@ -125,8 +234,16 @@
</template>
</el-table-column>
</el-table>
- <pagination v-if="page" v-show="page.total > 0" :total="page.total" :layout="page.layout" :page.sync="page.current"
- :limit.sync="page.size" @pagination="pagination" style="background-color: #fff;" />
+ <pagination
+ v-if="page"
+ v-show="page.total > 0"
+ :total="page.total"
+ :layout="page.layout"
+ :page.sync="page.current"
+ :limit.sync="page.size"
+ @pagination="pagination"
+ style="background-color: #fff"
+ />
</div>
</template>
@@ -184,7 +301,6 @@
name: "ZTTable",
filters: {
typeFn(val, row) {
- // console.log(val, row, '11111111');
if (typeof val === "function") {
return val(row);
} else return val;
@@ -216,19 +332,19 @@
handleSelectionChange: {
type: Function,
default: () => {
- return () => { };
+ return () => {};
},
},
rowClick: {
type: Function,
default: () => {
- return () => { };
+ return () => {};
},
},
currentChange: {
type: Function,
default: () => {
- return () => { };
+ return () => {};
},
},
border: {
@@ -236,6 +352,10 @@
default: true,
},
highlightCurrentRow: {
+ type: Boolean,
+ default: false,
+ },
+ stripe: {
type: Boolean,
default: false,
},
@@ -253,7 +373,7 @@
},
rowClassName: {
type: Function,
- default: () => { },
+ default: () => {},
},
rowStyle: {
type: Function,
@@ -356,11 +476,11 @@
return (this.page.current - 1) * this.page.size + index + 1;
},
// 鐐瑰嚮鍗曞厓鏍糽ink浜嬩欢
- goLink(row, linkMethod) {
- if (!linkMethod) {
+ goLink(row, linkEvent) {
+ if (!linkEvent) {
return this.$message.warning("璇烽厤缃甽ingk浜嬩欢");
}
- this.$parent[linkMethod](row);
+ linkEvent.vueComponent[linkEvent.method](row);
},
// 鍚堝苟鍗曞厓鏍�
calculateSpanInfo() {
@@ -449,11 +569,11 @@
</script>
<style scoped>
-.el-table>>>.el-table__empty-text {
+.el-table >>> .el-table__empty-text {
text-align: center;
}
->>>.cell {
+>>> .cell {
padding: 0 !important;
}
@@ -470,7 +590,7 @@
cursor: pointer;
}
->>>.el-table__body-wrapper::-webkit-scrollbar {
+>>> .el-table__body-wrapper::-webkit-scrollbar {
height: 14px;
/* 璁剧疆婊氬姩鏉″搴� */
}
diff --git a/src/components/Table/value-table.vue b/src/components/Table/value-table.vue
index 34561e0..ec9f177 100644
--- a/src/components/Table/value-table.vue
+++ b/src/components/Table/value-table.vue
@@ -152,8 +152,8 @@
<!-- 鍙搷浣滆杩涜鐐瑰嚮浜嬩欢 -->
<span v-else-if="data.linkEvent && showLink(a.label, data.linkEvent)" style="color:#409EFF;cursor: pointer;"
@click="handleLinkEvent(scope.row, data.linkEvent[a.label])">{{ scope.row[a.label] }}</span>
- <img v-else-if="showUpload(a.label) && scope.row[a.label]" :src="javaApi + '/img/' + scope.row[a.label]" alt=""
- style="width: 40px;height: 40px;margin-top: 10px;">
+ <img v-else-if="showUpload(a.label) && scope.row[a.label]" :src="javaApi + '/img/' + scope.row[a.label]"
+ alt="" style="width: 40px;height: 40px;margin-top: 10px;">
<span v-else :class="{ red: getRedColor(a.label, scope.row) }">{{ scope.row[a.label] }}</span>
</template>
</el-table-column>
@@ -165,8 +165,9 @@
<span v-if="a.type != 'upload'">{{ a.font }}</span>
<el-upload v-else ref='upload' :accept='a.uploadConfig.accept'
:action="javaApi + a.uploadConfig.url + '?id=' + (a.uploadConfig.uploadIdFun ? a.uploadConfig.uploadIdFun(scope.row) : scope.row.id)"
- :disabled="a.disabled ? a.disabled(scope.row, scope.$index) : false" :headers="token" :on-error="onError"
- :on-success="handleSuccessUp" :show-file-list="false" name="file" style="background: transparent;">
+ :disabled="a.disabled ? a.disabled(scope.row, scope.$index) : false" :headers="uploadHeader"
+ :on-error="onError" :on-success="handleSuccessUp" :show-file-list="false" name="file"
+ style="background: transparent;">
<span>{{ a.font }}</span>
</el-upload>
</el-button>
@@ -189,7 +190,8 @@
<span v-if="showUpReq(a.label)" class="required-span">* </span>{{ a.value }}锛�
</el-col>
<el-col :span="16 / data.row">
- <el-input v-if="showType(a.label, data.selectField) == null && !showUpload(a.label) && !showCascader(a.label)"
+ <el-input
+ v-if="showType(a.label, data.selectField) == null && !showUpload(a.label) && !showCascader(a.label)"
v-model="upData[a.label]" :disabled="isDisabled(a.label)" :placeholder="`璇疯緭鍏�${a.value}`" clearable
size="small"></el-input>
<el-select v-if="showType(a.label, data.selectField) != null" v-model="upData[a.label]"
@@ -201,8 +203,9 @@
</el-option>
</el-select>
<el-upload v-if="showUpload(a.label)" ref='upload' :accept='data.addUploadConfig.accept'
- :action="javaApi + data.addUploadConfig.url" :headers="token" :multiple="false" :on-error="onError"
- :on-success="m => handleSuccessUp(m, a.label)" :show-file-list="false" class="avatar-uploader" name="file"
+ :action="javaApi + data.addUploadConfig.url" :headers="uploadHeader" :multiple="false"
+ :on-error="onError" :on-success="m => handleSuccessUp(m, a.label)" :show-file-list="false"
+ class="avatar-uploader" name="file"
style="background: transparent;width: 80px;height: 80px;border: 1px solid #DCDFE6;border-radius: 6px;margin: 10px 0;">
<img v-if="upData[a.label]" :src="javaApi + '/img/' + upData[a.label]" class="avatar"
style="width: 80px;height: 80px;border-radius: 6px;">
@@ -221,7 +224,8 @@
<span v-if="showUpReq(a.label)" class="required-span">* </span>{{ a.value }}锛�
</el-col>
<el-col :offset="1" :span="16">
- <el-input v-if="showType(a.label, data.selectField) == null && !showUpload(a.label) && !showCascader(a.label)"
+ <el-input
+ v-if="showType(a.label, data.selectField) == null && !showUpload(a.label) && !showCascader(a.label)"
v-model="upData[a.label]" :disabled="isDisabled(a.label)" :placeholder="`璇疯緭鍏�${a.value}`" clearable
size="small"></el-input>
<el-select v-if="showType(a.label, data.selectField) != null" v-model="upData[a.label]"
@@ -231,8 +235,9 @@
:value="b.value"></el-option>
</el-select>
<el-upload v-if="showUpload(a.label)" ref='upload' :accept='data.addUploadConfig.accept'
- :action="javaApi + data.addUploadConfig.url" :headers="token" :multiple="false" :on-error="onError"
- :on-success="m => handleSuccessUp(m, a.label)" :show-file-list="false" class="avatar-uploader" name="file"
+ :action="javaApi + data.addUploadConfig.url" :headers="uploadHeader" :multiple="false"
+ :on-error="onError" :on-success="m => handleSuccessUp(m, a.label)" :show-file-list="false"
+ class="avatar-uploader" name="file"
style="background: transparent;width: 80px;height: 80px;border: 1px solid #DCDFE6;border-radius: 6px;margin: 10px 0;">
<img v-if="upData[a.label]" :src="javaApi + '/img/' + upData[a.label]" class="avatar"
style="width: 80px;height: 80px;border-radius: 6px;">
@@ -260,7 +265,8 @@
class="required-span">*
</span>{{ a.value }}锛�</el-col>
<el-col :span="16 / data.row">
- <el-input v-if="showType(a.label, data.selectField) == null && !showUpload(a.label) && !showCascader(a.label)"
+ <el-input
+ v-if="showType(a.label, data.selectField) == null && !showUpload(a.label) && !showCascader(a.label)"
v-model="upData[a.label]" :placeholder="`璇疯緭鍏�${a.value}`" clearable size="small"></el-input>
<el-select v-if="showType(a.label, data.selectField) != null" v-model="upData[a.label]"
:multiple="data.selectField[a.label].choose" :placeholder="`璇烽�夋嫨${a.value}`" clearable filterable
@@ -269,8 +275,9 @@
:value="b.value"></el-option>
</el-select>
<el-upload v-if="showUpload(a.label)" ref='upload' :accept='data.addUploadConfig.accept'
- :action="javaApi + data.addUploadConfig.url" :headers="token" :multiple="false" :on-error="onError"
- :on-success="m => handleSuccessUp(m, a.label)" :show-file-list="false" class="avatar-uploader" name="file"
+ :action="javaApi + data.addUploadConfig.url" :headers="uploadHeader" :multiple="false"
+ :on-error="onError" :on-success="m => handleSuccessUp(m, a.label)" :show-file-list="false"
+ class="avatar-uploader" name="file"
style="background: transparent;width: 80px;height: 80px;border: 1px solid #DCDFE6;border-radius: 6px;margin: 10px 0;">
<img v-if="upData[a.label]" :src="javaApi + '/img/' + upData[a.label]" class="avatar"
style="width: 80px;height: 80px;border-radius: 6px;">
@@ -287,7 +294,8 @@
<el-col :span="6" style="text-align: right;"><span v-if="showAddReq(a.label)" class="required-span">*
</span>{{ a.value }}锛�</el-col>
<el-col :offset="1" :span="16">
- <el-input v-if="showType(a.label, data.selectField) == null && !showUpload(a.label) && !showCascader(a.label)"
+ <el-input
+ v-if="showType(a.label, data.selectField) == null && !showUpload(a.label) && !showCascader(a.label)"
v-model="upData[a.label]" :placeholder="`璇疯緭鍏�${a.value}`" clearable size="small"></el-input>
<el-select v-if="showType(a.label, data.selectField) != null" v-model="upData[a.label]"
:multiple="data.selectField[a.label].choose" :placeholder="`璇烽�夋嫨${a.value}`" clearable size="small"
@@ -296,8 +304,9 @@
:value="b.value"></el-option>
</el-select>
<el-upload v-if="showUpload(a.label)" ref='upload' :accept='data.addUploadConfig.accept'
- :action="javaApi + data.addUploadConfig.url" :headers="token" :multiple="false" :on-error="onError"
- :on-success="m => handleSuccessUp(m, a.label)" :show-file-list="false" class="avatar-uploader" name="file"
+ :action="javaApi + data.addUploadConfig.url" :headers="uploadHeader" :multiple="false"
+ :on-error="onError" :on-success="m => handleSuccessUp(m, a.label)" :show-file-list="false"
+ class="avatar-uploader" name="file"
style="background: transparent;width: 80px;height: 80px;border: 1px solid #DCDFE6;border-radius: 6px;margin: 10px 0;">
<img v-if="upData[a.label]" :src="javaApi + '/img/' + upData[a.label]" class="avatar"
style="width: 80px;height: 80px;border-radius: 6px;">
@@ -328,8 +337,8 @@
<el-dialog :visible.sync="uploadDia" title="鏁版嵁瀵煎叆" width="500px">
<div style="margin: 0 auto;">
<el-upload ref="upload" :accept="data.accept === undefined ? '.csv' : data.accept" :action="javaApi + inputUrl"
- :auto-upload="false" :data="{ param: data.uploadStr }" :file-list="fileList" :headers="token" :limit="1"
- :on-change="beforeUpload" :on-error="onError" :on-success="onSuccess" drag name="file">
+ :auto-upload="false" :data="{ param: data.uploadStr }" :file-list="fileList" :headers="uploadHeader"
+ :limit="1" :on-change="beforeUpload" :on-error="onError" :on-success="onSuccess" drag name="file">
<i class="el-icon-upload"></i>
<div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
</el-upload>
diff --git a/src/components/materialOrder/filesLookVisible.vue b/src/components/materialOrder/filesLookVisible.vue
index 2ab086f..1a44265 100644
--- a/src/components/materialOrder/filesLookVisible.vue
+++ b/src/components/materialOrder/filesLookVisible.vue
@@ -3,26 +3,20 @@
<el-dialog title="闄勪欢鏌ョ湅" :visible.sync="isShow" width="80%" @closed="$emit('closeFilesLook')">
<div style="display: flex;justify-content: space-between;">
<ul class="tab">
- <li v-for="(m,i) in dataVisibleTitle" :key="i" :class="{active:i===dataVisibleIndex}" @click="handleDataVisibleTab(m,i)">{{m.label}}</li>
+ <li v-for="(m, i) in dataVisibleTitle" :key="i" :class="{ active: i === dataVisibleIndex }"
+ @click="handleDataVisibleTab(m, i)">{{ m.label }}</li>
</ul>
- <el-upload :action="action"
- :auto-upload="true"
- :data="{orderId: dataVisibleIndex === 0 ? filesLookInfo.enterOrderId : filesLookInfo.quarterOrderId}"
- :on-success="handleSuccessUp" :show-file-list="false"
- accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' :headers="headers"
- :before-upload="beforeUpload"
- style="width: 80px !important;"
- :on-error="onError" ref='upload'>
+ <el-upload :action="action" :auto-upload="true"
+ :data="{ orderId: dataVisibleIndex === 0 ? filesLookInfo.enterOrderId : filesLookInfo.quarterOrderId }"
+ :on-success="handleSuccessUp" :show-file-list="false"
+ accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' :headers="uploadHeader"
+ :before-upload="beforeUpload" style="width: 80px !important;" :on-error="onError" ref='upload'>
<el-button size="small" type="primary" style="height: 38px">闄勪欢涓婁紶</el-button>
</el-upload>
</div>
<div style="height: 70vh;overflow-y: auto;" v-if="filesDialogVisible">
- <ValueTable ref="fileList"
- :url="$api.insOrderPlan.getFileList"
- :delUrl="$api.insOrderPlan.delfile"
- class="value-table"
- :key="upIndex"
- :componentData="componentData"/>
+ <ValueTable ref="fileList" :url="$api.insOrderPlan.getFileList" :delUrl="$api.insOrderPlan.delfile"
+ class="value-table" :key="upIndex" :componentData="componentData" />
</div>
</el-dialog>
</div>
@@ -35,7 +29,7 @@
export default {
name: "filesLookVisible",
// import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
- components: {ValueTable},
+ components: { ValueTable },
props: {
filesDialogVisible: {
type: Boolean,
@@ -43,7 +37,7 @@
},
filesLookInfo: {
type: Object,
- default: () => {}
+ default: () => { }
},
},
data() {
@@ -64,20 +58,20 @@
dataVisibleIndex: 0, // tab鏍忛�夋嫨鍊�
componentData: {
entity: {
- insOrderId:''
+ insOrderId: ''
},
isIndex: true,
showSelect: false,
select: false,
sort: false,
- init:false,
+ init: false,
do: [
{
id: 'parent',
font: '涓嬭浇',
type: 'text',
method: 'handleDown'
- },{
+ }, {
id: 'delete',
font: '鍒犻櫎',
type: 'text',
@@ -87,8 +81,8 @@
isPage: false,
linkEvent: {},
tagField: {
- type:{
- select:[
+ type: {
+ select: [
{
value: 1,
label: '鍥剧墖'
@@ -114,7 +108,7 @@
// 鏂规硶闆嗗悎
methods: {
// 鍒囨崲鏁版嵁鏌ョ湅tab鏍�
- handleDataVisibleTab (m, i) {
+ handleDataVisibleTab(m, i) {
this.dataVisibleIndex = i
this.refreshTable()
},
@@ -129,17 +123,17 @@
this.$refs['fileList'].selectList(e)
})
},
- handleDown(row){
+ handleDown(row) {
this.$axios.post(this.$api.insOrderPlan.downFile, {
id: row.id,
}).then(res => {
if (res.code === 200) {
let url = '';
- if(res.data.type==1){
- url = this.javaApi+'/img/'+res.data.fileUrl
- file.downloadIamge(url,row.fileName)
- }else{
- url = this.javaApi+'/word/'+res.data.fileUrl
+ if (res.data.type == 1) {
+ url = this.javaApi + '/img/' + res.data.fileUrl
+ file.downloadIamge(url, row.fileName)
+ } else {
+ url = this.javaApi + '/word/' + res.data.fileUrl
const link = document.createElement('a');
link.href = url;
link.download = row.fileName;
@@ -150,7 +144,7 @@
})
},
- handleSuccessUp(response, ) {
+ handleSuccessUp(response,) {
this.upLoading = false;
if (response.code == 200) {
this.$message.success('涓婁紶鎴愬姛');
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index da89cf9..79b01c4 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -10,7 +10,8 @@
</div>
<div class="right-menu">
<div class="avatar-wrapper">
- <img :src="avatar" class="user-avatar" />
+ <!-- <img :src="avatar" class="user-avatar" /> -->
+ <el-avatar :size="28">{{ nickName.substring(0, 1) }}</el-avatar>
<span class="userName">{{ nickName }}</span>
<img
class="logoout"
diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue
index 73d03a4..714163b 100644
--- a/src/layout/components/TagsView/index.vue
+++ b/src/layout/components/TagsView/index.vue
@@ -1,245 +1,278 @@
<template>
<div id="tags-view-container" class="tags-view-container">
- <scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll">
- <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
+ <scroll-pane
+ ref="scrollPane"
+ class="tags-view-wrapper"
+ @scroll="handleScroll"
+ >
+ <hamburger
+ id="hamburger-container"
+ :is-active="sidebar.opened"
+ class="hamburger-container"
+ @toggleClick="toggleSideBar"
+ />
<router-link
v-for="tag in visitedViews"
ref="tag"
:key="tag.path"
- :class="isActive(tag)?'active':''"
+ :class="isActive(tag) ? 'active' : ''"
:to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
tag="span"
class="tags-view-item"
:style="activeStyle(tag)"
- @click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''"
- @contextmenu.prevent.native="openMenu(tag,$event)"
+ @click.middle.native="!isAffix(tag) ? closeSelectedTag(tag) : ''"
+ @contextmenu.prevent.native="openMenu(tag, $event)"
>
{{ tag.title }}
- <span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
+ <span
+ v-if="!isAffix(tag)"
+ class="el-icon-close"
+ @click.prevent.stop="closeSelectedTag(tag)"
+ />
</router-link>
</scroll-pane>
- <ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
- <li @click="refreshSelectedTag(selectedTag)"><i class="el-icon-refresh-right"></i> 鍒锋柊椤甸潰</li>
- <li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)"><i class="el-icon-close"></i> 鍏抽棴褰撳墠</li>
- <li @click="closeOthersTags"><i class="el-icon-circle-close"></i> 鍏抽棴鍏朵粬</li>
- <li v-if="!isFirstView()" @click="closeLeftTags"><i class="el-icon-back"></i> 鍏抽棴宸︿晶</li>
- <li v-if="!isLastView()" @click="closeRightTags"><i class="el-icon-right"></i> 鍏抽棴鍙充晶</li>
- <li @click="closeAllTags(selectedTag)"><i class="el-icon-circle-close"></i> 鍏ㄩ儴鍏抽棴</li>
+ <ul
+ v-show="visible"
+ :style="{ left: left + 'px', top: top + 'px' }"
+ class="contextmenu"
+ >
+ <li @click="refreshSelectedTag(selectedTag)">
+ <i class="el-icon-refresh-right"></i> 鍒锋柊椤甸潰
+ </li>
+ <li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">
+ <i class="el-icon-close"></i> 鍏抽棴褰撳墠
+ </li>
+ <li @click="closeOthersTags">
+ <i class="el-icon-circle-close"></i> 鍏抽棴鍏朵粬
+ </li>
+ <li v-if="!isFirstView()" @click="closeLeftTags">
+ <i class="el-icon-back"></i> 鍏抽棴宸︿晶
+ </li>
+ <li v-if="!isLastView()" @click="closeRightTags">
+ <i class="el-icon-right"></i> 鍏抽棴鍙充晶
+ </li>
+ <li @click="closeAllTags(selectedTag)">
+ <i class="el-icon-circle-close"></i> 鍏ㄩ儴鍏抽棴
+ </li>
</ul>
</div>
</template>
<script>
-import ScrollPane from './ScrollPane'
-import path from 'path'
+import ScrollPane from "./ScrollPane";
+import path from "path";
import Hamburger from "@/components/Hamburger/index.vue";
-import {mapGetters} from "vuex";
+import { mapGetters } from "vuex";
export default {
- components: {Hamburger, ScrollPane },
+ components: { Hamburger, ScrollPane },
data() {
return {
visible: false,
top: 0,
left: 0,
selectedTag: {},
- affixTags: []
- }
+ affixTags: [],
+ };
},
computed: {
- ...mapGetters([
- 'sidebar',
- ]),
+ ...mapGetters(["sidebar"]),
visitedViews() {
- return this.$store.state.tagsView.visitedViews
+ return this.$store.state.tagsView.visitedViews;
},
routes() {
- return this.$store.state.permission.routes
+ return this.$store.state.permission.routes;
},
theme() {
return this.$store.state.settings.theme;
- }
+ },
},
watch: {
$route() {
- this.addTags()
- this.moveToCurrentTag()
+ this.addTags();
+ this.moveToCurrentTag();
},
visible(value) {
if (value) {
- document.body.addEventListener('click', this.closeMenu)
+ document.body.addEventListener("click", this.closeMenu);
} else {
- document.body.removeEventListener('click', this.closeMenu)
+ document.body.removeEventListener("click", this.closeMenu);
}
- }
+ },
},
mounted() {
- this.initTags()
- this.addTags()
+ this.initTags();
+ this.addTags();
},
methods: {
toggleSideBar() {
- this.$store.dispatch('app/toggleSideBar')
+ this.$store.dispatch("app/toggleSideBar");
},
isActive(route) {
- return route.path === this.$route.path
+ return route.path === this.$route.path;
},
activeStyle(tag) {
if (!this.isActive(tag)) return {};
return {
"background-color": this.theme,
- "border-color": this.theme
+ "border-color": this.theme,
};
},
isAffix(tag) {
- return tag.meta && tag.meta.affix
+ return tag.meta && tag.meta.affix;
},
isFirstView() {
try {
- return this.selectedTag.fullPath === '/index' || this.selectedTag.fullPath === this.visitedViews[1].fullPath
+ return (
+ this.selectedTag.fullPath === "/index" ||
+ this.selectedTag.fullPath === this.visitedViews[1].fullPath
+ );
} catch (err) {
- return false
+ return false;
}
},
isLastView() {
try {
- return this.selectedTag.fullPath === this.visitedViews[this.visitedViews.length - 1].fullPath
+ return (
+ this.selectedTag.fullPath ===
+ this.visitedViews[this.visitedViews.length - 1].fullPath
+ );
} catch (err) {
- return false
+ return false;
}
},
- filterAffixTags(routes, basePath = '/') {
- let tags = []
- routes.forEach(route => {
+ filterAffixTags(routes, basePath = "/") {
+ let tags = [];
+ routes.forEach((route) => {
if (route.meta && route.meta.affix) {
- const tagPath = path.resolve(basePath, route.path)
+ const tagPath = path.resolve(basePath, route.path);
tags.push({
fullPath: tagPath,
path: tagPath,
name: route.name,
- meta: { ...route.meta }
- })
+ meta: { ...route.meta },
+ });
}
if (route.children) {
- const tempTags = this.filterAffixTags(route.children, route.path)
+ const tempTags = this.filterAffixTags(route.children, route.path);
if (tempTags.length >= 1) {
- tags = [...tags, ...tempTags]
+ tags = [...tags, ...tempTags];
}
}
- })
- return tags
+ });
+ return tags;
},
initTags() {
- const affixTags = this.affixTags = this.filterAffixTags(this.routes)
+ const affixTags = (this.affixTags = this.filterAffixTags(this.routes));
for (const tag of affixTags) {
// Must have tag name
if (tag.name) {
- this.$store.dispatch('tagsView/addVisitedView', tag)
+ this.$store.dispatch("tagsView/addVisitedView", tag);
}
}
},
addTags() {
- const { name } = this.$route
+ const { name } = this.$route;
if (name) {
- this.$store.dispatch('tagsView/addView', this.$route)
+ this.$store.dispatch("tagsView/addView", this.$route);
}
},
moveToCurrentTag() {
- const tags = this.$refs.tag
+ const tags = this.$refs.tag;
this.$nextTick(() => {
for (const tag of tags) {
if (tag.to.path === this.$route.path) {
- this.$refs.scrollPane.moveToTarget(tag)
+ this.$refs.scrollPane.moveToTarget(tag);
// when query is different then update
if (tag.to.fullPath !== this.$route.fullPath) {
- this.$store.dispatch('tagsView/updateVisitedView', this.$route)
+ this.$store.dispatch("tagsView/updateVisitedView", this.$route);
}
- break
+ break;
}
}
- })
+ });
},
refreshSelectedTag(view) {
this.$tab.refreshPage(view);
if (this.$route.meta.link) {
- this.$store.dispatch('tagsView/delIframeView', this.$route)
+ this.$store.dispatch("tagsView/delIframeView", this.$route);
}
},
closeSelectedTag(view) {
this.$tab.closePage(view).then(({ visitedViews }) => {
if (this.isActive(view)) {
- this.toLastView(visitedViews, view)
+ this.toLastView(visitedViews, view);
}
- })
+ });
},
closeRightTags() {
- this.$tab.closeRightPage(this.selectedTag).then(visitedViews => {
- if (!visitedViews.find(i => i.fullPath === this.$route.fullPath)) {
- this.toLastView(visitedViews)
+ this.$tab.closeRightPage(this.selectedTag).then((visitedViews) => {
+ if (!visitedViews.find((i) => i.fullPath === this.$route.fullPath)) {
+ this.toLastView(visitedViews);
}
- })
+ });
},
closeLeftTags() {
- this.$tab.closeLeftPage(this.selectedTag).then(visitedViews => {
- if (!visitedViews.find(i => i.fullPath === this.$route.fullPath)) {
- this.toLastView(visitedViews)
+ this.$tab.closeLeftPage(this.selectedTag).then((visitedViews) => {
+ if (!visitedViews.find((i) => i.fullPath === this.$route.fullPath)) {
+ this.toLastView(visitedViews);
}
- })
+ });
},
closeOthersTags() {
- this.$router.push(this.selectedTag.fullPath).catch(()=>{});
+ this.$router.push(this.selectedTag.fullPath).catch(() => {});
this.$tab.closeOtherPage(this.selectedTag).then(() => {
- this.moveToCurrentTag()
- })
+ this.moveToCurrentTag();
+ });
},
closeAllTags(view) {
this.$tab.closeAllPage().then(({ visitedViews }) => {
- if (this.affixTags.some(tag => tag.path === this.$route.path)) {
- return
+ if (this.affixTags.some((tag) => tag.path === this.$route.path)) {
+ return;
}
- this.toLastView(visitedViews, view)
- })
+ this.toLastView(visitedViews, view);
+ });
},
toLastView(visitedViews, view) {
- const latestView = visitedViews.slice(-1)[0]
+ const latestView = visitedViews.slice(-1)[0];
if (latestView) {
- this.$router.push(latestView.fullPath)
+ this.$router.push(latestView.fullPath);
} else {
// now the default is to redirect to the home page if there is no tags-view,
// you can adjust it according to your needs.
- if (view.name === 'Dashboard') {
+ if (view.name === "Dashboard") {
// to reload home page
- this.$router.replace({ path: '/redirect' + view.fullPath })
+ this.$router.replace({ path: "/redirect" + view.fullPath });
} else {
- this.$router.push('/')
+ this.$router.push("/");
}
}
},
openMenu(tag, e) {
- const menuMinWidth = 105
- const offsetLeft = this.$el.getBoundingClientRect().left // container margin left
- const offsetWidth = this.$el.offsetWidth // container width
- const maxLeft = offsetWidth - menuMinWidth // left boundary
- const left = e.clientX - offsetLeft + 15 // 15: margin right
+ const menuMinWidth = 105;
+ const offsetLeft = this.$el.getBoundingClientRect().left; // container margin left
+ const offsetWidth = this.$el.offsetWidth; // container width
+ const maxLeft = offsetWidth - menuMinWidth; // left boundary
+ const left = e.clientX - offsetLeft + 15; // 15: margin right
if (left > maxLeft) {
- this.left = maxLeft
+ this.left = maxLeft;
} else {
- this.left = left
+ this.left = left;
}
- this.top = e.clientY
- this.visible = true
- this.selectedTag = tag
+ this.top = e.clientY;
+ this.visible = true;
+ this.selectedTag = tag;
},
closeMenu() {
- this.visible = false
+ this.visible = false;
},
handleScroll() {
- this.closeMenu()
- }
- }
-}
+ this.closeMenu();
+ },
+ },
+};
</script>
<style lang="scss" scoped>
@@ -251,19 +284,19 @@
z-index: 1000; /* 纭繚澶撮儴鍦ㄥ叾浠栧唴瀹逛箣涓� */
background: #fff;
border-bottom: 1px solid #d8dce5;
- box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04);
+ box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);
.tags-view-wrapper {
.hamburger-container {
display: inline-block;
line-height: 46px;
height: 100%;
cursor: pointer;
- transition: background .3s;
- -webkit-tap-highlight-color:transparent;
+ transition: background 0.3s;
+ -webkit-tap-highlight-color: transparent;
padding: 0 10px !important;
&:hover {
- background: rgba(0, 0, 0, .025)
+ background: rgba(0, 0, 0, 0.025);
}
}
.tags-view-item {
@@ -290,7 +323,7 @@
color: #fff;
border-color: #42b983;
&::before {
- content: '';
+ content: "";
background: #fff;
display: inline-block;
width: 8px;
@@ -303,7 +336,7 @@
}
}
.contextmenu {
- margin: 0;
+ margin: -20px;
background: #fff;
z-index: 3000;
position: absolute;
@@ -313,7 +346,7 @@
font-size: 12px;
font-weight: 400;
color: #333;
- box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3);
+ box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);
li {
margin: 0;
padding: 7px 16px;
@@ -336,10 +369,10 @@
vertical-align: 2px;
border-radius: 50%;
text-align: center;
- transition: all .3s cubic-bezier(.645, .045, .355, 1);
+ transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
transform-origin: 100% 50%;
&:before {
- transform: scale(.6);
+ transform: scale(0.6);
display: inline-block;
vertical-align: -3px;
}
diff --git a/src/plugins/download.js b/src/plugins/download.js
index d814fb9..c0caca4 100644
--- a/src/plugins/download.js
+++ b/src/plugins/download.js
@@ -4,6 +4,7 @@
import { getToken } from "@/utils/auth";
import errorCode from "@/utils/errorCode";
import { blobValidate } from "@/utils/ruoyi";
+import Vue from "vue";
const baseURL = process.env.VUE_APP_BASE_API;
let downloadLoadingInstance;
@@ -99,7 +100,7 @@
// 灏嗘枃浠惰浆鎹负 Blob
const blob = await response.blob();
// 浣跨敤 saveAs 淇濆瓨鏂囦欢
- saveAs(blob, filename);
+ saveAs(blob, name);
Message.success("鏁版嵁瀵煎嚭鎴愬姛");
} catch (error) {
Message.error(error);
diff --git a/src/router/index.js b/src/router/index.js
index 912bf88..b9675e1 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -100,11 +100,18 @@
permissions: ['business:order'],
children: [
{
- // 閾滄潗鏂欎笅鍗�
+ // 鏂板濮旀墭鍗曢〉闈�
path: 'addOrder',
component: () => import('@/views/business/inspectionOrder/add'),
name: 'addOrder',
meta: { title: '鏂板濮旀墭鍗�', activeMenu: '/business/inspectionOrder' }
+ },
+ {
+ // 鏌ョ湅濮旀墭鍗曡鎯呴〉闈�
+ path: 'showDetails',
+ component: () => import('@/views/business/inspectionOrder/add'),
+ name: 'showDetails',
+ meta: { title: '濮旀墭鍗曡鎯�', activeMenu: '/business/inspectionOrder' }
}
]
},
diff --git a/src/store/getters.js b/src/store/getters.js
index 0d93723..099391b 100644
--- a/src/store/getters.js
+++ b/src/store/getters.js
@@ -9,6 +9,8 @@
avatar: (state) => state.user.avatar,
name: (state) => state.user.name,
nickName: (state) => state.user.nickName,
+ companyName: (state) => state.user.companyName,
+ loginUserInfo: (state) => state.user.loginUserInfo,
userId: (state) => state.user.id,
introduction: (state) => state.user.introduction,
roles: (state) => state.user.roles,
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 8626ba0..8c7bda4 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -11,6 +11,8 @@
name: "",
avatar: "",
nickName: "",
+ companyName: "",
+ loginUserInfo: {},
roles: [],
permissions: [],
},
@@ -30,6 +32,12 @@
},
SET_NICKNAME: (state, nickName) => {
state.nickName = nickName;
+ },
+ SET_COMPANYNAME: (state, companyName) => {
+ state.companyName = companyName;
+ },
+ SET_LOGINUSERINFO: (state, loginUserInfo) => {
+ state.loginUserInfo = loginUserInfo;
},
SET_ROLES: (state, roles) => {
state.roles = roles;
@@ -67,7 +75,6 @@
return new Promise((resolve, reject) => {
getInfo()
.then((res) => {
- console.log("store-->",res);
const user = res.user;
let avatar = user.avatar || "";
if (!isHttp(avatar)) {
@@ -82,10 +89,12 @@
} else {
commit("SET_ROLES", ["ROLE_DEFAULT"]);
}
+ commit("SET_LOGINUSERINFO", user);
commit("SET_ID", user.userId);
commit("SET_NAME", user.userName);
commit("SET_AVATAR", avatar);
commit("SET_NICKNAME", user.nickName);
+ commit("SET_COMPANYNAME", user.companyName);
resolve(res);
})
.catch((error) => {
diff --git a/src/utils/echarts.js b/src/utils/echarts.js
new file mode 100644
index 0000000..67aa260
--- /dev/null
+++ b/src/utils/echarts.js
@@ -0,0 +1,353 @@
+import * as echarts from "echarts";
+
+const iuCharts = {
+ drawBar: function (chart, params) {
+ var color = ["#4379EE", "#FEC53D", "#65789B", "#F6BD16"];
+ let series = params.yData.map((m, i) => {
+ let obj = {
+ name: m.title,
+ type: "bar",
+ barWidth: "16%",
+ barGap: "30%",
+ itemStyle: {
+ normal: {
+ color: color[i],
+ barBorderRadius: [50, 50, 0, 0],
+ },
+ },
+ data: m.data,
+ };
+ return obj;
+ });
+ var option = {
+ backgroundColor: "#fff",
+ tooltip: {
+ trigger: "axis",
+ axisPointer: {
+ lineStyle: {
+ color: "#4379EE",
+ },
+ },
+ },
+ grid: {
+ top: "25px",
+ left: "40px",
+ right: "3%",
+ bottom: "40px",
+ // containLabel: true
+ },
+ legend: {
+ show: true,
+ orient: "horizontal",
+ y: -2,
+ right: 15,
+ itemWidth: 12,
+ itemHeight: 12,
+ itemGap: 24,
+ textStyle: {
+ color: "rgba(43,48,52)",
+ fontSize: "14px",
+ },
+ },
+ xAxis: [
+ {
+ type: "category",
+ axisLine: {
+ show: false,
+ },
+ axisLabel: {
+ color: "rgba(43,48,52, 0.4)",
+ margin: 20,
+ },
+ axisTick: {
+ show: false,
+ },
+ splitLine: {
+ show: false,
+ },
+ boundaryGap: false,
+ data: params.xData,
+ },
+ ],
+ yAxis: [
+ {
+ minInterval: 1,
+ type: "value",
+ min: 0,
+ splitNumber: 4,
+ splitLine: {
+ show: true,
+ lineStyle: {
+ color: "rgba(43,48,52, 0.1)",
+ },
+ },
+ axisLine: {
+ show: false,
+ },
+ axisLabel: {
+ color: "rgba(43,48,52, 0.4)",
+ margin: 20,
+ },
+ axisTick: {
+ show: false,
+ },
+ },
+ ],
+ series: series,
+ };
+ chart.setOption(option);
+ },
+ drawLine: function (chart, params) {
+ let series = [];
+ params.yData.forEach((m) => {
+ series.push({
+ name: m.title,
+ type: "line",
+ showAllSymbol: true,
+ symbol: "circle",
+ symbolSize: 10,
+ lineStyle: {
+ normal: {
+ color: "#4379EE",
+ width: 3,
+ },
+ },
+ areaStyle: {
+ normal: {
+ color: new echarts.graphic.LinearGradient(
+ 0,
+ 0,
+ 0,
+ 1,
+ [
+ {
+ offset: 0,
+ color: "rgba(67,121,238,0.3)",
+ },
+ {
+ offset: 1,
+ color: "rgba(67,121,238,0)",
+ },
+ ],
+ false
+ ),
+ },
+ },
+ data: m.data,
+ });
+ });
+ let option = {
+ backgroundColor: "#fff",
+ tooltip: {
+ trigger: "axis",
+ axisPointer: {
+ lineStyle: {
+ color: "#4379EE",
+ },
+ },
+ },
+ grid: {
+ top: "25px",
+ left: "40px",
+ right: "3%",
+ bottom: "40px",
+ // containLabel: true
+ },
+ xAxis: [
+ {
+ type: "category",
+ axisLine: {
+ show: false,
+ },
+ axisLabel: {
+ color: "rgba(43,48,52, 0.4)",
+ margin: 20,
+ },
+ axisTick: {
+ show: false,
+ },
+ splitLine: {
+ show: false,
+ },
+ boundaryGap: false,
+ data: params.xData,
+ },
+ ],
+ yAxis: [
+ {
+ minInterval: 1,
+ type: "value",
+ min: 0,
+ splitNumber: 4,
+ splitLine: {
+ show: true,
+ lineStyle: {
+ color: "rgba(43,48,52, 0.1)",
+ },
+ },
+ axisLine: {
+ show: false,
+ },
+ axisLabel: {
+ color: "rgba(43,48,52, 0.4)",
+ margin: 20,
+ },
+ axisTick: {
+ show: false,
+ },
+ },
+ ],
+ series: series,
+ };
+ chart.setOption(option);
+ },
+ drawPie: function (chart, params) {
+ let option = {
+ color: params.color,
+ backgroundColor: "#fff",
+ tooltip: {
+ trigger: "item",
+ formatter: "{a} <br/>{b} : {c}",
+ },
+ title: {
+ text: params.percentage,
+ textStyle: {
+ color: "#4379EE",
+ fontSize: 14,
+ align: "center",
+ fontWeight: "normal",
+ },
+ x: "center",
+ y: "center",
+ },
+ grid: {
+ top: 20,
+ bottom: 20,
+ left: 0,
+ right: 0,
+ },
+ legend: {
+ show: false,
+ },
+ series: [
+ // 涓昏灞曠ず灞傜殑
+ {
+ radius: ["55%", "90%"],
+ center: ["50%", "50%"],
+ type: "pie",
+ label: {
+ show: false,
+ },
+ name: params.title,
+ data: params.data,
+ },
+ // 杈规鐨勮缃�
+ {
+ radius: ["55%", "65%"],
+ center: ["50%", "50%"],
+ type: "pie",
+ label: {
+ normal: {
+ show: false,
+ },
+ emphasis: {
+ show: false,
+ },
+ },
+ labelLine: {
+ normal: {
+ show: false,
+ },
+ emphasis: {
+ show: false,
+ },
+ },
+ animation: false,
+ tooltip: {
+ show: false,
+ },
+ data: [
+ {
+ value: 1,
+ itemStyle: {
+ color: "rgba(250,250,250,0.3)",
+ },
+ },
+ ],
+ },
+ ],
+ };
+ chart.setOption(option);
+ },
+ drawGauge: function (chart, params) {
+ let option = {
+ tooltip: {
+ formatter: "{a} <br/>{b} : {c}%",
+ },
+ toolbox: {
+ feature: {
+ restore: {},
+ saveAsImage: {},
+ },
+ },
+ series: [
+ {
+ type: "gauge",
+ axisLine: {
+ lineStyle: {
+ width: 28,
+ color: [
+ [0.3, "#67e0e3"],
+ [0.7, "#37a2da"],
+ [1, "#fd666d"],
+ ],
+ },
+ },
+ pointer: {
+ itemStyle: {
+ color: "auto",
+ },
+ },
+ axisTick: {
+ distance: -28,
+ length: 8,
+ lineStyle: {
+ color: "#fff",
+ width: 2,
+ },
+ },
+ splitLine: {
+ distance: -28,
+ length: 28,
+ lineStyle: {
+ color: "#fff",
+ width: 4,
+ },
+ },
+ axisLabel: {
+ color: "inherit",
+ distance: 40,
+ fontSize: 14,
+ },
+ detail: {
+ valueAnimation: true,
+ formatter: "{value} %",
+ color: "inherit",
+ textStyle: {
+ fontSize: 30,
+ align: "center",
+ },
+ },
+ data: [
+ {
+ value: 70,
+ },
+ ],
+ },
+ ],
+ };
+ chart.setOption(option, true);
+ },
+};
+
+export { iuCharts };
diff --git a/src/views/CNAS/personnel/personalOverview/index.vue b/src/views/CNAS/personnel/personalOverview/index.vue
new file mode 100644
index 0000000..a227788
--- /dev/null
+++ b/src/views/CNAS/personnel/personalOverview/index.vue
@@ -0,0 +1,242 @@
+<style scoped>
+.search {
+ background-color: #fff;
+ height: 80px;
+ display: flex;
+ align-items: center;
+}
+
+.search_thing {
+ width: 350px;
+ display: flex;
+ align-items: center;
+}
+
+.search_label {
+ width: 110px;
+ font-size: 14px;
+ text-align: right;
+}
+
+.search_input {
+ width: calc(100% - 110px);
+}
+
+.table {
+ margin-top: 10px;
+ background-color: #fff;
+ width: calc(100% - 40px);
+ height: calc(100% - 60px - 80px - 10px - 40px);
+ padding: 20px;
+ overflow-y: auto;
+}
+
+.card {
+ list-style-type: none;
+ display: grid;
+ grid-template-columns: repeat(auto-fit, 320px);
+ /* justify-content: center; */
+ grid-gap: 16px;
+ min-height: 200px;
+}
+
+.card li {
+ width: 320px;
+ border-radius: 8px 8px 8px 8px;
+ box-shadow: 4px 4px 8px 0px rgba(51, 51, 51, 0.04);
+ border: 1px solid #EEEEEE;
+ margin: 0 !important;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ box-sizing: border-box;
+ padding: 26px 16px 16px;
+ font-size: 14px;
+ position: relative;
+ overflow: show;
+}
+
+li .title {
+ width: 147px;
+ height: 20px;
+ background: url(../../../../assets/images/renyuan-title.svg) no-repeat;
+ position: absolute;
+ top: -6px;
+ left: 50%;
+ transform: translateX(-50%);
+ text-align: center;
+ line-height: 20px;
+ color: #fff;
+}
+</style>
+
+<template>
+ <div class="role_manage">
+ <div class="search">
+ <div class="search_thing">
+ <div class="search_label">浜哄憳鍚嶇О锛�</div>
+ <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="entity.name"></el-input>
+ </div>
+ </div>
+ <div class="search_thing" style="padding-left: 30px;">
+ <el-button size="small" @click="refresh()">閲� 缃�</el-button>
+ <el-button size="small" type="primary"
+ @click="currentPage = 1, list = [], finishLoding = false, keyMap = {}, refreshTable()">鏌� 璇�</el-button>
+ </div>
+ </div>
+ <div class="table" v-loading="loading">
+ <scroll-pagination @load="refreshTable" :finishLoding="finishLoding" :list="list"
+ v-if="list.length > 0 || loading">
+ <ul class="card" style="margin-top: 10px;">
+ <li v-for="(m, i) in list" :key="i">
+ <el-image style="width: 80px;
+ height: 112px;" :src="javaApi + '/img/' + m.pictureUrl">
+ <div slot="error" class="image-error" style="width: 79px;
+ height: 110px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: 1px solid #EEEEEE;">
+ <i class="el-icon-picture-outline" style="font-size:30px;color:#666666;"></i>
+ </div>
+ </el-image>
+ <el-image style="width: 195px;
+ height: 112px;" :src="javaApi + '/img/' + m.signatureUrl">
+ <div slot="error" class="image-error" style="width: 194px;
+ height: 110px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: 1px solid #EEEEEE;">
+ <i class="el-icon-picture-outline" style="font-size:30px;color:#666666;"></i>
+ </div>
+ </el-image>
+ <div class="title">{{ m.name }}</div>
+ </li>
+ </ul>
+ </scroll-pagination>
+ <div v-if="list.length < 1 && !loading" style="color:#909399;font-size:14px;text-align: center;margin-top:200px">
+ 鏆傛棤鏁版嵁
+ </div>
+ </div>
+ </div>
+</template>
+
+<script>
+import ScrollPagination from '@/components/index/scroll-paging.vue'
+import {
+ selectPersonnelOverview
+} from '@/api/cnas/personnel/personalOverview'
+export default {
+ components: {
+ ScrollPagination
+ },
+ data() {
+ return {
+ entity: {
+ name: null,
+ state: 1,
+ orderBy: { field: "id", order: "asc" }
+ },
+ list: [],
+ currentPage: 1, // 褰撳墠椤�
+ pageSize: 16, // 涓�椤�16鏉�
+ total: '',
+ loading: true, // 缁勪欢loading鐨勫睍绀�,榛樿涓簍rue
+ finishLoding: false, // 鍔犺浇瀹屾垚锛屾樉绀哄凡缁忔病鏈夋洿澶氫簡
+ keyMap: {}
+ }
+ },
+ created() {
+ this.keyMap = {};
+ this.currentPage = 1;
+ this.list = [];
+ this.refreshTable();
+ },
+ methods: {
+ refreshTable() {
+ const key = `_${this.currentPage}`
+ const value = this.keyMap[key]
+ // 濡傛灉value瀛樺湪锛岃〃绀虹紦瀛樻湁鍊硷紝閭d箞闃绘璇锋眰
+ if (value) {
+ return
+ }
+ // value涓嶅瓨鍦紝琛ㄧず绗竴娆¤姹�,璁剧疆鍗犱綅
+ this.keyMap[key] = 'temp'
+ if (this.currentPage == 1) {
+ this.loading = true
+ }
+ selectPersonnelOverview({
+ current: this.currentPage,
+ size: this.pageSize,
+ ...this.entity
+ }).then(res => {
+ if (res.code == 200) {
+ this.total = res.data.body.total
+ let list = res.data.body.records;
+ if (list.length == 0) {
+ this.finishLoding = true;
+ } else {
+ if (list.length < this.pageSize) {
+ this.finishLoding = true;
+ }
+ this.list = this.list.concat(list)
+ if (this.total == this.list.length) {
+ this.finishLoding = true;
+ }
+ this.currentPage++;
+ }
+ }
+ this.loading = false
+ })
+ },
+ refresh() {
+ this.keyMap = {};
+ this.currentPage = 1;
+ this.list = [];
+ this.finishLoding = false;
+ this.entity = {
+ name: null,
+ state: 1,
+ orderBy: { field: "id", order: "asc" }
+ };
+ this.refreshTable()
+ },
+ // 婊氬姩瑙﹀簳鍔犺浇
+ scrollFn() {
+ let clientHeight = document.documentElement.clientHeight - 18; //鍙鍖哄煙
+ let scrollHeight = document.body.scrollHeight; // 婊氬姩鏂囨。楂樺害
+ let scrollTop = parseInt(document.documentElement.scrollTop); // 宸叉粴鍔ㄧ殑楂樺害
+ let height = 300;
+ if (
+ scrollTop + clientHeight >= scrollHeight - height &&
+ scrollHeight != 0
+ ) {
+ if (!this.finishLoding && this.currentPage * this.pageSize < this.total) {
+ this.currentPage = this.currentPage + 1;
+ this.refreshTable();
+ }
+ } else {
+ return false;
+ }
+ },
+ throttle(fn, wait) {
+ // 灏佽鍑芥暟杩涜鑺傛祦
+ var timer = null;
+ return function () {
+ var context = this;
+ var args = arguments;
+ if (!timer) {
+ timer = setTimeout(function () {
+ fn.apply(context, args);
+ timer = null;
+ }, wait);
+ }
+ };
+ },
+ },
+ destroyed() {
+ window.removeEventListener("scroll", this.throttle(), false);
+ },
+}
+</script>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Communicate/Add.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Communicate/Add.vue
new file mode 100644
index 0000000..d22914f
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Communicate/Add.vue
@@ -0,0 +1,116 @@
+<template>
+ <div class="add">
+ <el-dialog :title="isEdit ? '缂栬緫闄勪欢璧勬枡' : '鏂板闄勪欢璧勬枡'" :visible.sync="dialogVisible" width="40%">
+ <el-form :model="form" label-width="80px" size="small">
+ <el-form-item label="娌熼�氫汉">
+ <el-select v-model="form.userId" placeholder="璇烽�夋嫨" style="width: 100%" multiple>
+ <el-option v-for="(item, index) in userList" :key="index" :label="item.name"
+ :value="item.id"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="娌熼�氭椂闂�">
+ <el-date-picker v-model="form.communicationTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
+ placeholder="璇烽�夋嫨鏃ユ湡鏃堕棿" style="width: 100%">
+ </el-date-picker>
+ </el-form-item>
+ <el-form-item label="娌熼�氬湴鐐�">
+ <el-input v-model="form.communicationPlace" placeholder="璇烽�夋嫨"></el-input>
+ </el-form-item>
+ <el-form-item label="娌熼�氬唴瀹�">
+ <el-input v-model="form.communicationContent" placeholder="璇烽�夋嫨"></el-input>
+ </el-form-item>
+ </el-form>
+ <div slot="footer" class="foot">
+ <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" :loading="loading" @click="submitForm">纭� 瀹�</el-button>
+ </div>
+ </el-dialog>
+ </div>
+</template>
+<script>
+import {
+ selectUserList,
+ addOrUpdatePersonCommunicationAbility
+} from '@/api/cnas/personnel/personnelInfo.js'
+export default {
+ data() {
+ return {
+ isEdit: false,
+ dialogVisible: false,
+ form: {
+ id: undefined,
+ userId: [],
+ communicationTime: undefined,
+ communicationPlace: undefined,
+ communicationContent: undefined
+ },
+ loading: false,
+ userList: []
+ }
+ },
+ methods: {
+ /**
+ * @desc 鏄剧ず妯℃�佹
+ * @param {*} row
+ * @param {*} type
+ */
+ openDialog(row, type) {
+ this.getUserList()
+ this.dialogVisible = true
+ if (type) {
+ this.isEdit = true
+ this.form.id = row.id
+ this.form.userId = row.userId.split(',').map(m => Number(m))
+ this.form.communicationTime = row.communicationTime
+ this.form.communicationPlace = row.communicationPlace
+ this.form.communicationContent = row.communicationContent
+ } else {
+ this.isEdit = false
+ this.form.id = undefined
+ this.form.userId = []
+ this.form.communicationTime = undefined
+ this.form.communicationPlace = undefined
+ this.form.communicationContent = undefined
+ }
+ },
+ /**
+ * @desc 鑾峰彇鐢ㄦ埛淇℃伅
+ */
+ async getUserList() {
+ const { code, data } = await selectUserList()
+ if (code == 200) {
+ this.userList = data
+ }
+ },
+ /**
+ * @desc 鎻愪氦琛ㄥ崟
+ */
+ async submitForm() {
+ this.loading = true
+ const { code, data } = await addOrUpdatePersonCommunicationAbility({
+ id: this.form.id,
+ userId: this.form.userId.join(','),
+ communicationTime: this.form.communicationTime,
+ communicationPlace: this.form.communicationPlace,
+ communicationContent: this.form.communicationContent,
+ })
+ if (code == 200) {
+ this.$emit('submit')
+ this.dialogVisible = false
+ } else {
+ this.$message.error(this.isEdit ? '缂栬緫澶辫触' : '鏂板澶辫触')
+ }
+ this.loading = false
+ }
+ }
+}
+</script>
+<style scoped>
+.foot {
+ width: 100%;
+}
+
+.add>>>.el-dialog__footer {
+ padding-right: 20px;
+}
+</style>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Communicate/index.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Communicate/index.vue
new file mode 100644
index 0000000..086b96b
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Communicate/index.vue
@@ -0,0 +1,213 @@
+<template>
+ <div class="flex_column">
+ <TableCard :showForm="isDepartment" title="娌熼�氳褰�">
+ <template v-slot:form>
+ <div v-if="isDepartment" class="w100 items_center justify_between">
+ <div></div>
+ <div>
+ <el-button size="small" type="primary" @click="openDialog">鏂板</el-button>
+ </div>
+ </div>
+ </template>
+ <template v-slot:table>
+ <limsTable :column="columnData" :height="'calc(100vh - 21em)'" :table-data="tableData"
+ :table-loading="loading" style="margin-top: 18px; padding: 0 15px;" :page="page"
+ @pagination="pagination"></limsTable>
+ </template>
+ </TableCard>
+ <Add ref="communicateModal" @submit="getTableData"></Add>
+ </div>
+</template>
+<script>
+import TableCard from '@/components/TableCard/index.vue';
+import limsTable from "@/components/Table/lims-table.vue";
+import Add from "./Add.vue"
+import {
+ personPersonCommunicationAbilityPage,
+ deletePersonCommunicationAbility,
+ exportPersonCommunicationAbility
+} from '@/api/cnas/personnel/personnelInfo.js'
+
+export default {
+ components: {
+ TableCard,
+ limsTable,
+ Add
+ },
+ props: {
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ }
+ },
+ isDepartment: {
+ type: Boolean,
+ default: false
+ }
+ },
+ data() {
+ return {
+ // departId: 0,
+ columnData: [
+ {
+ label: '搴忓彿',
+ prop: 'id'
+ }, {
+ label: '娌熼�氫汉',
+ prop: 'userName'
+ }, {
+ label: '娌熼�氭椂闂�',
+ prop: 'communicationTime'
+ }, {
+ label: '娌熼�氬湴鐐�',
+ prop: 'communicationPlace'
+ }, {
+ label: '娌熼�氬唴瀹�',
+ prop: 'communicationContent'
+ }, {
+ label: '鎿嶄綔',
+ dataType: 'action',
+ operation: [
+ {
+ name: '缂栬緫',
+ type: 'text',
+ clickFun: (row) => {
+ this.openDialog(row, true)
+ }
+ }, {
+ name: '瀵煎嚭',
+ type: 'text',
+ clickFun: (row) => {
+ this.handleDown(row)
+ }
+ }, {
+ name: '鍒犻櫎',
+ type: 'text',
+ color: '#f56c6c',
+ clickFun: (row) => {
+ this.delPerson(row.id)
+ }
+ }
+ ]
+ },
+ ],
+ tableData: [],
+ page: {
+ current: 1,
+ pageSize: 20,
+ total: 0
+ },
+ loading: false
+ }
+ },
+ mounted() {
+ this.getTableData()
+ },
+ methods: {
+ openDialog(row, type = false) {
+ this.$refs.communicateModal.openDialog(row, type)
+ },
+ async getTableData() {
+ this.loading = true
+ const params = this.isDepartment ? {
+ departLimsId: this.departId,
+ current: this.page.current,
+ size: this.page.pageSize
+ } : {
+ userId: this.departId,
+ current: this.page.current,
+ size: this.page.pageSize
+ }
+ const { code, data } = await personPersonCommunicationAbilityPage(params)
+ if (code == 200) {
+ this.page.total = data.total
+ this.tableData = data.records
+ this.loading = false
+ }
+ },
+ pagination({ page, limit }) {
+ this.page.current = page;
+ this.page.size = limit;
+ this.getTableData();
+ },
+ /**
+ * @desc 鑾峰彇璁惧id
+ */
+ getDepart(id) {
+ this.departId = id
+ this.getTableData()
+ },
+ /**
+ * @desc 鍒犻櫎娌熼�氳褰�
+ */
+ delPerson(id) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ枃浠�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(async () => {
+ let formData = new FormData()
+ formData.append('id', id)
+ const { code } = await deletePersonCommunicationAbility(formData)
+ if (code == 200) {
+ this.$message({
+ type: 'success',
+ message: '鍒犻櫎鎴愬姛!'
+ });
+ this.getTableData()
+ }
+ })
+ },
+ async handleDown(row) {
+ exportPersonCommunicationAbility({ id: row.id }).then(res => {
+ if (res.code == 201) {
+ this.$message.error(res.message)
+ return
+ }
+ const blob = new Blob([res], { type: 'application/octet-stream' });
+ this.$download.saveAs(blob, row.userName + '-娌熼�氳褰�' + '.docx')
+ })
+ }
+ },
+ watch: {
+ departId: {
+ handler(newId, oldId) {
+ if (newId) {
+ this.getTableData();
+ }
+ }
+ }
+ }
+}
+</script>
+<style scoped>
+.flex_column {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+
+.w100 {
+ width: 100%;
+}
+
+
+.items_center {
+ display: flex;
+ align-items: center;
+}
+
+.justify_between {
+ justify-content: space-between
+}
+
+.date_box {
+ margin: 0 5px;
+}
+
+.search {
+ width: 150px;
+ padding: 0 16px;
+}
+</style>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/JobResponsibilities/index.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/JobResponsibilities/index.vue
new file mode 100644
index 0000000..ef784f1
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/JobResponsibilities/index.vue
@@ -0,0 +1,364 @@
+<!-- 宀椾綅鑱岃矗 -->
+<template>
+ <div class="view">
+ <div style="text-align: left; margin-bottom: 15px;padding: 0 10px">
+ <label>鍛樺伐锛�</label>
+ <el-input v-model="userName" clearable placeholder="璇疯緭鍏ュ憳宸�" size="small" style="width: 20vh;"></el-input>
+ <el-button size="small" type="primary" @click="refreshTable">鏌ヨ</el-button>
+ <div v-if="isDepartment" style="float: right;">
+ <el-button size="small" type="primary" @click="addPost">鏂板</el-button>
+ <!-- <el-button size="small" type="primary">瀵煎嚭excel</el-button>-->
+ </div>
+ </div>
+ <div class="table" style="padding: 0 10px">
+ <el-table :data="tableData" height="70vh" style="width: 100%">
+ <el-table-column label="搴忓彿" type="index" width="60"></el-table-column>
+ <el-table-column label="鍛樺伐缂栧彿" min-width="120" prop="account"></el-table-column>
+ <el-table-column label="宀椾綅鍚嶇О" min-width="180" prop="postName"></el-table-column>
+ <el-table-column label="鎵�灞為儴闂�" min-width="180" prop="departLimsName"></el-table-column>
+ <el-table-column label="宸ヤ綔鐩爣" min-width="180" prop="jobObjective"></el-table-column>
+ <el-table-column label="宀椾綅鑱岃矗" min-width="180" prop="jobResponsibilities"></el-table-column>
+ <el-table-column label="浠昏亴浜�" min-width="180" prop="incumbentName"></el-table-column>
+ <el-table-column label="浠昏亴浜哄鏍告棩鏈�" min-width="180" prop="incumbentDate"></el-table-column>
+ <el-table-column label="涓荤" min-width="180" prop="supervisorName"></el-table-column>
+ <el-table-column label="涓荤瀹℃牳鏃ユ湡" min-width="180" prop="supervisorDate"></el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔" width="140">
+ <template v-slot="scope">
+ <el-button v-if="!isDepartment || scope.row.currentState === '鍏抽棴'" size="small" type="text"
+ @click="handleViewClick(scope.row, 'view')">鏌ョ湅
+ </el-button>
+ <el-button v-if="isDepartment && scope.row.currentState !== '鍏抽棴'" size="small" type="text"
+ @click="handleViewClick(scope.row, 'edit')">缂栬緫
+ </el-button>
+ <el-button size="small" type="text" @click="downLoadPost(scope.row)">瀵煎嚭</el-button>
+ <el-button v-if="isDepartment" size="small" type="text" @click="deletePost(scope.row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]"
+ :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
+ @current-change="handleCurrentChange">
+ </el-pagination>
+ </div>
+ <!-- 鏂板宀椾綅鑱岃矗 -->
+ <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="dialogVisible" title="鏂板宀椾綅鑱岃矗"
+ width="50%" @close="resetForm">
+ <el-steps :active="currentStep" align-center finish-status="success">
+ <el-step v-for="(v, i) in steps" :key="i" :title="v" style="cursor:pointer"
+ @click.native="choiceStep(i)"></el-step>
+ </el-steps>
+ <el-form ref="form" :model="form" :rules="rules" label-width="130px">
+ <div>
+ <el-card style="margin-top: 1em; height: 40vh; overflow-y: scroll;">
+ <!-- 鏂板璁惧浜嬭褰曞崱鐗� -->
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="宀椾綅鍚嶇О锛�" prop="postName">
+ <el-input v-model="form.postName" :disabled="currentStep !== 0 || operationType === 'view'"
+ size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="宸ヤ綔鐩爣锛�" prop="jobObjective">
+ <el-input v-model="form.jobObjective" :disabled="currentStep !== 0 || operationType === 'view'"
+ size="small" type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="宀椾綅鑱岃矗锛�" prop="jobResponsibilities">
+ <el-input v-model="form.jobResponsibilities" :disabled="currentStep !== 0 || operationType === 'view'"
+ size="small" type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col v-if="currentStep === 0 || operationType === 'view'" :span="12">
+ <el-form-item :rules="[{ required: currentStep === 0, message: '璇烽�夋嫨浠昏亴浜�', trigger: 'change' }]"
+ label="浠昏亴浜猴細" prop="incumbentId">
+ <el-select v-model="form.incumbentId" :disabled="operationType === 'view'" clearable filterable
+ placeholder="璇烽�夋嫨浠昏亴浜�" size="small" style="width: 100%;">
+ <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col v-if="currentStep === 1 || operationType === 'view'" :span="12">
+ <el-form-item :rules="[{ required: currentStep === 1, message: '璇烽�夋嫨涓荤', trigger: 'blur' }]" label="涓荤锛�"
+ prop="supervisorId">
+ <el-select v-model="form.supervisorId" :disabled="currentStep !== 1 || operationType === 'view'"
+ clearable filterable placeholder="璇烽�夋嫨涓荤" size="small" style="width: 100%;">
+ <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-card>
+ <el-row style="margin-top: 1em;">
+ <el-col :span="4">
+ 鎿嶄綔浜猴細{{ form.submitPerson }}
+ </el-col>
+ <el-col :span="6">
+ 鏃ユ湡锛歿{ form.submitDate }}
+ </el-col>
+ </el-row>
+ </div>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button v-if="currentStep !== 0 && currentStep !== 3" @click="submitForm('3reject')">椹冲洖</el-button>
+ <el-button v-if="currentStep === 0" @click="submitForm('2save')">淇濆瓨</el-button>
+ <el-button v-if="currentStep !== 3" type="primary" @click="submitForm('1submit')">{{ currentStep === 0 ? '鎻愪氦' :
+ '閫氳繃'
+ }}</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import { dateFormat } from '@/utils/date';
+import {
+ selectUserList,
+ personJobResponsibilitiesSelect,
+ personJobResponsibilitiesSave,
+ exportPersonJobResponsibilities,
+ personJobResponsibilitiesDelete,
+} from '@/api/cnas/personnel/personnelInfo.js'
+export default {
+ data() {
+ return {
+ userName: '',
+ tableData: [],
+ responsibleOptions: [],
+ search: {
+ size: 20,
+ current: 1,
+ total: 0
+ },
+ dialogVisible: false,
+ currentStep: 0, // 姝ラ鏉℃樉绀虹鍑犳
+ currentStepClick: 0, // 鐐瑰嚮姝ラ鏉″彉鍖�
+ operationType: '',
+ steps: ['鎻愪氦', '浠昏亴浜虹‘璁�', '涓荤纭'],
+ form: {
+ postName: '', // 宀椾綅鍚嶇О
+ jobObjective: '', // 宸ヤ綔鐩爣
+ jobResponsibilities: '', // 宀椾綅鑱岃矗
+ incumbentId: '', // 浠昏亴浜�
+ supervisorId: '' // 涓荤
+ },
+ rules: {
+ postName: [{ required: true, message: '璇疯緭鍏ュ矖浣嶅悕绉�', trigger: 'blur' }],
+ jobObjective: [{ required: true, message: '璇疯緭鍏ュ伐浣滅洰鏍�', trigger: 'blur' }],
+ jobResponsibilities: [{ required: true, message: '璇疯緭鍏ュ矖浣嶈亴璐�', trigger: 'blur' }],
+ incumbentId: [{ required: true, message: '璇烽�夋嫨浠昏亴浜�', trigger: 'change' }],
+ supervisorId: [{ required: true, message: '璇烽�夋嫨涓荤', trigger: 'change' }]
+ }
+ // departId: 0
+ };
+ },
+ props: {
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ }
+ },
+ isDepartment: {
+ type: Boolean,
+ default: false
+ }
+ },
+ mounted() {
+ this.getPostList(this.departId);
+ },
+ methods: {
+ addPost() {
+ this.dialogVisible = true;
+ this.form = {
+ postName: '', // 宀椾綅鍚嶇О
+ jobObjective: '', // 宸ヤ綔鐩爣
+ jobResponsibilities: '', // 宀椾綅鑱岃矗
+ incumbentId: '', // 浠昏亴浜�
+ supervisorId: '', // 鎿嶄綔浜�
+ submitPerson: '', // 涓荤
+ submitDate: '', // 鏃ユ湡
+ currentStep: 0 // 鏃ユ湡
+ };
+ this.currentStep = 0;
+ this.getUserList();
+ },
+ // 鏌ヨ鍒楄〃淇℃伅
+ getPostList(userId) {
+ this.search.userId = userId;
+ const name = this.isDepartment ? 'departmentId' : 'userId';
+ personJobResponsibilitiesSelect({
+ userName: this.userName,
+ [name]: this.search.userId,
+ size: this.search.size,
+ current: this.search.current
+ }).then(res => {
+ if (res.code === 201) return;
+ this.tableData = res.data.records;
+ this.search.total = res.data.total;
+ });
+ },
+ //鎻愪氦琛ㄥ崟
+ async submitForm(saveState) {
+ this.$refs.form.validate((valid) => {
+ if (valid === true || saveState !== '1submit') {
+ // 缁欏綋鍓嶇幆鑺傝缃垱寤轰汉涓庢椂闂�
+ let user = JSON.parse(localStorage.getItem('user'));
+ const dateTime = dateFormat(new Date());
+ // 鑾峰彇褰撳墠鐜妭鎿嶄綔浜轰笌鏃ユ湡
+ switch (this.currentStep) {
+ case 0:
+ this.form.submittingOperator = user.name;
+ this.form.submittingDate = dateTime;
+ break;
+ case 1:
+ this.form.incumbentOperator = user.name;
+ this.form.incumbentDate = dateTime;
+ break;
+ case 2:
+ this.form.supervisorOperator = user.name;
+ this.form.supervisorDate = dateTime;
+ break;
+ default:
+ break;
+ }
+ // 鑾峰彇褰撳墠鐜妭璐熻矗浜�
+ switch (saveState === '3reject' ? this.currentStep - 1 : this.currentStep) {
+ case 1:
+ this.form.currentResponsible = this.form.submittingOperator;
+ break;
+ case 2:
+ this.form.currentResponsible = this.form.incumbentOperator;
+ break;
+ default:
+ break;
+ }
+ let currentStepAction;
+ // 璁剧疆璇ユ搷浣滃垽鏂槸鍚︿负鎻愪氦锛屼繚瀛橈紝椹冲洖锛岄�氳繃
+ switch (saveState) {
+ // 鎻愪氦锛岄�氳繃
+ case '1submit':
+ currentStepAction = this.currentStep + 1;
+ break;
+ // 淇濆瓨
+ case '2save':
+ currentStepAction = this.currentStep;
+ break;
+ // 椹冲洖
+ case '3reject':
+ currentStepAction = this.currentStep - 1;
+ break;
+ default:
+ break;
+ }
+ // 鑾峰彇褰撳墠鐘舵��
+ this.form.currentState = currentStepAction === 3 ? '鍏抽棴' : this.steps[currentStepAction];
+ personJobResponsibilitiesSave(this.form).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鎻愪氦鎴愬姛');
+ this.getPostList(this.departId);
+ this.dialogVisible = false;
+ }
+ });
+ } else {
+ let step = this.steps[this.currentStep];
+ this.$message.warning(step + ' 娴佺▼涓湁蹇呭~椤规湭濉紒');
+ }
+ });
+ },
+ // 缂栬緫
+ handleViewClick(row, type) {
+ this.operationType = type;
+ this.getUserList();
+ row.incumbentId = Number(row.incumbentId);
+ this.form = { ...row };
+ switch (row.currentState) {
+ case '鎻愪氦':
+ this.currentStep = 0;
+ break;
+ case '浠昏亴浜虹‘璁�':
+ this.currentStep = 1;
+ this.form.submitPerson = row.submittingOperator;
+ this.form.submitDate = row.submittingDate;
+ break;
+ case '涓荤纭':
+ this.currentStep = 2;
+ this.form.submitPerson = row.incumbentOperator;
+ this.form.submitDate = row.incumbentDate;
+ break;
+ case '鍏抽棴':
+ this.currentStep = 3;
+ this.form.submitPerson = row.supervisorOperator;
+ this.form.submitDate = row.supervisorDate;
+ break;
+ default:
+ break;
+ }
+ this.form.currentState = this.currentStep;
+ this.currentStepClick = this.currentStep === 3 ? 0 : this.currentStep
+ console.log('this.form---', this.form);
+ this.dialogVisible = true;
+ },
+ // 涓嬭浇宀椾綅鑱岃矗
+ downLoadPost(row) {
+ exportPersonJobResponsibilities({ id: row.id }).then(res => {
+ const blob = new Blob([res], { type: 'application/octet-stream' });
+ this.$download.saveAs(blob, row.incumbentName + '-宀椾綅鑱岃矗' + '.docx')
+ })
+ },
+ // 鍒犻櫎宀椾綅鑱岃矗
+ deletePost(row) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎姝ゆ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ personJobResponsibilitiesDelete({ id: row.id }).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鍒犻櫎鎴愬姛');
+ this.getPostList(this.departId);
+ }
+ });
+ }).catch(() => {
+ this.$message.error('鍒犻櫎澶辫触');
+ });
+ },
+ resetForm() {
+ this.$refs.form.resetFields();
+ },
+ refreshTable() {
+ this.getPostList(this.departId);
+ },
+ // 鑾峰彇璐熻矗浜轰俊鎭帴鍙�
+ getUserList() {
+ selectUserList().then(res => {
+ if (res.code == 200) {
+ this.responsibleOptions = res.data;
+ }
+ });
+ },
+ choiceStep(index) {
+ this.currentStepClick = index;
+ },
+ handleSizeChange(val) {
+ this.search.size = val;
+ this.getPostList(this.departId);
+ },
+ handleCurrentChange(val) {
+ this.search.current = val;
+ this.getPostList(this.departId);
+ }
+ },
+ watch: {
+ departId: {
+ handler(newId, oldId) {
+ this.getPostList(newId);
+ }
+ }
+ }
+};
+</script>
+<style scoped></style>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Mandate/Add.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Mandate/Add.vue
new file mode 100644
index 0000000..8741543
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Mandate/Add.vue
@@ -0,0 +1,198 @@
+<template>
+ <div class="add">
+ <el-dialog :title="isEdit ? '缂栬緫闄勪欢璧勬枡' : '鏂板闄勪欢璧勬枡'" :visible.sync="dialogVisible" width="50%">
+ <el-form ref="ruleForm" :rules="rules" :model="form" label-width="100px" size="medium">
+ <el-form-item label="璇佷功缂栧彿" prop="certificateNumber">
+ <el-input v-model="form.certificateNumber" placeholder="璇疯緭鍏�" style="width: 100%">
+ </el-input>
+ </el-form-item>
+ <el-form-item label="琚换鑱屼汉鍛�" prop="userId">
+ <el-select v-model="form.userId" placeholder="璇烽�夋嫨">
+ <el-option v-for="(item, index) in userList" :key="index" :label="item.name"
+ :value="item.id"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="浠昏亴宀椾綅" prop="post">
+ <el-input v-model="form.post" placeholder="璇疯緭鍏�"></el-input>
+ </el-form-item>
+ <el-form-item label="鐞嗚鑰冭瘯鎴愮哗" prop="num1">
+ <el-input v-model="form.num1" placeholder="璇疯緭鍏�"></el-input>
+ </el-form-item>
+ <el-form-item label="鎿嶄綔鎶�鑳借�冭瘯鎴愮哗" prop="num2">
+ <el-input v-model="form.num2" placeholder="璇疯緭鍏�"></el-input>
+ </el-form-item>
+ <el-form-item label="鎿嶄綔绫诲瀷" prop="operationType">
+ <el-input v-model="form.operationType" placeholder="璇烽�夋嫨"></el-input>
+ </el-form-item>
+ <el-row>
+ <el-col :span="20">
+ <el-form-item label="涓婂矖璇佷功">
+ <el-input v-model="form.systemFileName" size="small" disabled>
+ <el-button slot="append" icon="el-icon-delete-solid"
+ @click="deleteFile(form.systemFileName)"></el-button>
+ </el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="4">
+ <el-upload ref="upload" style="float: left; margin: 0 12px 0 20px;" :action="action"
+ :show-file-list="false" :on-success="onSuccess" :headers="uploadHeader">
+ <el-button class="uploadFile" slot="trigger" size="small" type="primary">娴忚</el-button>
+ </el-upload>
+ </el-col>
+ </el-row>
+ <el-form-item label="澶囨敞">
+ <el-input v-model="form.remarks" placeholder="璇烽�夋嫨"></el-input>
+ </el-form-item>
+ </el-form>
+ <div slot="footer" class="foot">
+ <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" :loading="loading" @click="submitForm">纭� 瀹�</el-button>
+ </div>
+ </el-dialog>
+ </div>
+</template>
+<script>
+import {
+ addOrUpdatePersonPostAuthorizationRecord,
+ selectUserList,
+ deleteCNASFile
+} from '@/api/cnas/personnel/personnelInfo.js'
+export default {
+ data() {
+ return {
+ isEdit: false,
+ dialogVisible: false,
+ form: {
+ id: undefined,
+ certificateNumber: undefined,
+ userId: undefined,
+ post: undefined,
+ operationType: undefined,
+ fileList: [],
+ fileName: undefined,
+ systemFileName: undefined,
+ remarks: undefined,
+ num2: undefined,
+ num1: undefined
+ },
+ rules: {
+ certificateNumber: [{ required: true, message: '璇疯緭鍏ヨ瘉涔︾紪鍙�', trigger: 'blur' }],
+ userId: [{ required: true, message: '璇烽�夋嫨琚换鑱屼汉鍛�', trigger: 'change' }],
+ post: [{ required: true, message: '浠昏亴宀椾綅', trigger: 'blur' }],
+ operationType: [{ required: true, message: '鎿嶄綔绫诲瀷', trigger: 'blur' }],
+
+ },
+ loading: false,
+ userList: []
+ }
+ },
+ mounted() {
+
+ },
+ computed: {
+ action() {
+ return this.javaApi + '/personBasicInfo/saveCNASFile'
+ }
+ },
+ methods: {
+ async onSuccess(response, file, fileList) {
+ this.$set(this.form, "systemFileName", response.data)
+ },
+ deleteFile(fileName) {
+ deleteCNASFile({ fileName }).then(res => {
+ this.$message.success('鍒犻櫎鎴愬姛锛�')
+ this.$set(this.form, "systemFileName", null)
+ })
+ },
+ async openDialog(row, type) {
+ await this.getUserList()
+ this.dialogVisible = true
+ if (type) {
+ this.isEdit = true
+ this.form.id = row.id
+ this.form.certificateNumber = row.certificateNumber
+ this.form.userId = Number(row.userId)
+ this.form.post = row.post
+ this.form.operationType = row.operationType
+ this.form.systemFileName = row.systemFileName
+ this.form.remarks = row.remarks
+ this.form.num1 = row.num1
+ this.form.num2 = row.num2
+ } else {
+ this.isEdit = false
+ this.form.id = undefined
+ this.form.certificateNumber = undefined
+ this.form.userId = undefined
+ this.form.post = undefined
+ this.form.operationType = undefined
+ this.form.fileList = []
+ this.form.fileName = undefined
+ this.form.systemFileName = undefined
+ this.form.remarks = undefined
+ this.form.num1 = undefined
+ this.form.num2 = undefined
+ }
+ },
+ closeDialog() {
+ this.dialogVisible = false
+ },
+ /**
+ * @desc 鑾峰彇鐢ㄦ埛淇℃伅
+ */
+ async getUserList() {
+ const { code, data } = await selectUserList()
+ if (code == 200) {
+ this.userList = data
+ }
+ },
+ /**
+ * @desc 鎻愪氦琛ㄥ崟
+ */
+ submitForm() {
+ this.$refs.ruleForm.validate(async (valid) => {
+ if (valid) {
+ await this.submitFormData()
+ }
+ })
+ },
+ /**
+ * @desc 涓婁紶鏂囦欢
+ */
+ beforeUpload(file) {
+ this.form.fileList = [file]
+ this.form.fileName = file.name
+ },
+ /**
+ * @desc 鎻愪氦form琛ㄥ崟
+ */
+ async submitFormData() {
+ this.loading = true
+ const { code, data } = await addOrUpdatePersonPostAuthorizationRecord({
+ id: this.form.id,
+ certificateNumber: this.form.certificateNumber,
+ userId: this.form.userId,
+ post: this.form.post,
+ operationType: this.form.operationType,
+ systemFileName: this.form.systemFileName,
+ remarks: this.form.remarks,
+ num1: this.form.num1,
+ num2: this.form.num2
+ })
+ if (code == 200) {
+ this.closeDialog()
+ this.$emit('refresh')
+ }
+ this.loading = false
+ }
+ }
+}
+</script>
+<style scoped>
+.foot {
+ width: 100%;
+}
+
+.add>>>.el-dialog__footer {
+ padding-right: 20px;
+}
+</style>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Mandate/index.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Mandate/index.vue
new file mode 100644
index 0000000..d6fa9a2
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Mandate/index.vue
@@ -0,0 +1,228 @@
+<template>
+ <div class="flex_column">
+ <TableCard :showForm="isDepartment" title="浠昏亴鎺堟潈璁板綍">
+ <template v-slot:form>
+ <div v-if="isDepartment" class="w100 items_center justify_between">
+ <div></div>
+ <div>
+ <el-button size="small" type="primary" @click="openDialog">鏂板</el-button>
+ </div>
+ </div>
+ </template>
+ <template v-slot:table>
+ <limsTable :column="columnData" :height="'calc(100vh - 21em)'" :table-data="tableData"
+ :table-loading="loading" style="margin-top: 18px; padding: 0 15px;" :page="page"
+ @pagination="pagination"></limsTable>
+ </template>
+ </TableCard>
+ <Add ref="mandateModal" @refresh="getTableData"></Add>
+ </div>
+</template>
+<script>
+import TableCard from "@/components/TableCard/index.vue";
+import limsTable from "@/components/Table/lims-table.vue";
+import Add from "./Add.vue"
+import {
+ PersonPostAuthorizationRecordPage,
+ deletePersonPostAuthorizationRecord,
+ exportPersonPostAuthorizationRecord
+} from '@/api/cnas/personnel/personnelInfo.js'
+import { nextTick } from "vue";
+
+export default {
+ components: {
+ TableCard,
+ limsTable,
+ Add
+ },
+ props: {
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ }
+ },
+ isDepartment: {
+ type: Boolean,
+ default: false
+ }
+ },
+ data() {
+ return {
+ // departId: 0,
+ columnData: [
+ {
+ label: '搴忓彿',
+ prop: 'id'
+ }, {
+ label: '璇佷功缂栧彿',
+ prop: 'certificateNumber'
+ }, {
+ label: '琚换鑱屼汉鍛�',
+ prop: 'userName'
+ }, {
+ label: '浠昏亴宀椾綅',
+ prop: 'post'
+ }, {
+ label: '鐞嗚鑰冭瘯鎴愮哗',
+ prop: 'num1'
+ }, {
+ label: '鎿嶄綔鎶�鑳借�冭瘯鎴愮哗',
+ prop: 'num2'
+ }, {
+ label: '鎿嶄綔鏃堕棿',
+ prop: 'updateTime'
+ }, {
+ label: '澶囨敞',
+ prop: 'remarks',
+ width: 300
+ }, {
+ label: '鎿嶄綔',
+ dataType: 'action',
+ width: 160,
+ operation: [
+ {
+ name: '缂栬緫',
+ type: 'text',
+ clickFun: (row) => {
+ this.openDialog(row, true)
+ }
+ }, {
+ name: '涓嬭浇',
+ type: 'text',
+ clickFun: (row) => {
+ this.handleDown(row)
+ }
+ }, {
+ name: '鍒犻櫎',
+ type: 'text',
+ color: '#f56c6c',
+ clickFun: (row) => {
+ this.deleteNotify(row.id)
+ }
+ }
+ ]
+ },
+ ],
+ tableData: [],
+ page: {
+ current: 1,
+ pageSize: 20,
+ total: 0
+ },
+ loading: false
+ }
+ },
+ mounted() {
+ this.getTableData()
+ console.log(this.departId)
+ },
+ methods: {
+ openDialog(row, type = false) {
+ this.$refs.mandateModal.openDialog(row, type)
+ },
+ /**
+ * @desc 鏌ヨ琛ㄦ牸鏁版嵁
+ */
+ async getTableData() {
+ this.loading = true
+ await nextTick()
+ const params = this.isDepartment ? {
+ departLimsId: this.departId,
+ current: this.page.current,
+ size: this.page.pageSize
+ } : {
+ userId: this.departId,
+ current: this.page.current,
+ size: this.page.pageSize
+ }
+ const { code, data } = await PersonPostAuthorizationRecordPage(params)
+ if (code == 200) {
+ this.page.total = data.total
+ this.tableData = data.records
+ this.loading = false
+ }
+ },
+ /**
+ * @desc 鍒嗛〉
+ */
+ pagination({ page, limit }) {
+ this.page.current = page;
+ this.page.size = limit;
+ this.getTableData();
+ },
+ /**
+ * @desc 鍒犻櫎浠昏亴璁板綍
+ */
+ deleteNotify(id) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ枃浠�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ this.delMandate(id)
+ })
+ },
+ /**
+ * @desc api鍒犻櫎
+ */
+ async delMandate(id) {
+ const formData = new FormData()
+ formData.append('id', id)
+ const { code, data } = await deletePersonPostAuthorizationRecord(formData)
+ if (code == 200) {
+ this.$message({ message: '鍒犻櫎鎴愬姛', type: 'success' })
+ this.getTableData()
+ } else {
+ this.$message({ message: '鍒犻櫎澶辫触', type: 'error' })
+ }
+ },
+ /**
+ * @desc 鑾峰彇璁惧id
+ */
+ getDepart(id) {
+ this.departId = id
+ this.getTableData()
+ },
+ handleDown(row) {
+ exportPersonPostAuthorizationRecord({ id: row.id }).then(res => {
+ if (res.code == 201) {
+ this.$message.error(res.message)
+ return
+ }
+ const blob = new Blob([res], { type: 'application/octet-stream' });
+ this.$download.saveAs(blob, '浠昏亴鎺堟潈-' + row.certificateNumber + '-' + row.post + '.docx')
+ })
+ }
+ },
+ // watch: {
+ // departId: {
+ // handler(newId, oldId) {
+ // if (newId) {
+ // this.getTableData();
+ // }
+ // }
+ // }
+ // }
+}
+</script>
+<style scoped>
+.flex_column {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+
+.w100 {
+ width: 100%;
+}
+
+.items_center {
+ display: flex;
+ align-items: center;
+}
+
+.justify_between {
+ justify-content: space-between
+}
+</style>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelCapacity/index.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelCapacity/index.vue
new file mode 100644
index 0000000..49dd10d
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelCapacity/index.vue
@@ -0,0 +1,567 @@
+<!-- 浜哄憳鑳藉姏 -->
+<template>
+ <div>
+ <div style="text-align: left; margin-bottom: 15px;padding: 0 16px">
+ <label>濮撳悕</label>
+ <el-input v-model="userName" placeholder="璇疯緭鍏ュ鍚�" size="small" style="width: 20vh;"></el-input>
+ <el-button size="small" type="primary" @click="refreshTable">鏌ヨ</el-button>
+ <div v-if="isDepartment" style="float: right;">
+ <el-button size="small" type="primary" @click="addAppointPost('add')">鏂板</el-button>
+ </div>
+ </div>
+ <div class="table">
+ <TableCard :showForm="false" :showTitle="false">
+ <template v-slot:table>
+ <limsTable :column="yearColumnData" :height="'calc(100vh - 20em)'" :table-data="tableData"
+ :table-loading="yearLoading" style="padding: 0 15px;margin-bottom: 16px" :page="search"
+ @pagination="pagination">
+ <div slot="jobResponsibilities" slot-scope="scope">
+ <div v-html="changeLine(scope.row.responsibilities)"></div>
+ </div>
+ <div slot="placeWorkSlot" slot-scope="scope">
+ <div v-html="changeLine(scope.row.placeWork)"></div>
+ </div>
+ </limsTable>
+ </template>
+ </TableCard>
+ </div>
+ <!--鏂板鑳藉姏璁ゅ畾寮规-->
+ <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="title" :visible.sync="dialogVisible"
+ width="80%" @close="resetForm">
+ <el-form v-if="dialogVisible" ref="infoForm" :model="form" :rules="rules">
+ <el-col :span="12">
+ <el-form-item label="浜哄憳锛�" label-width="110px" prop="userId">
+ <el-select v-model="form.userId" :disabled="operationType === 'view'" clearable filterable placeholder="璇烽�夋嫨"
+ size="small" style="width: 100%;">
+ <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鑱岀О锛�" label-width="110px" prop="technicalPost">
+ <el-input v-model="form.technicalPost" :disabled="operationType === 'view'" clearable size="small"
+ style="width: 100%;" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <div style="display: flex;justify-content: space-evenly;font-weight: 600">
+ <span>鏌ユ牳缁撴灉</span>
+ <span>绗﹀悎涓庡惁</span>
+ <span>澶囨敞</span>
+ </div>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="瀛﹀巻锛�" label-width="110px" prop="academicDegree">
+ <el-input v-model="form.academicDegree" :disabled="operationType === 'view'" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item class="radio-group" prop="academicConformNot" style="text-align: center">
+ <el-radio-group v-model="form.academicConformNot" :disabled="operationType === 'view'">
+ <el-radio :label="1">绗﹀悎</el-radio>
+ <el-radio :label="2">涓嶇鍚�</el-radio>
+ <el-radio :label="3">涓嶉�傜敤</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item prop="academicRemarks">
+ <el-input v-model="form.academicRemarks" :disabled="operationType === 'view'" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鐩稿叧骞撮檺锛�" label-width="110px" prop="relatedYears">
+ <el-input v-model="form.relatedYears" :disabled="operationType === 'view'" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item class="radio-group" prop="relatedYearsConformNot" style="text-align: center">
+ <el-radio-group v-model="form.relatedYearsConformNot" :disabled="operationType === 'view'">
+ <el-radio :label="1">绗﹀悎</el-radio>
+ <el-radio :label="2">涓嶇鍚�</el-radio>
+ <el-radio :label="3">涓嶉�傜敤</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item prop="relatedYearsRemarks ">
+ <el-input v-model="form.relatedYearsRemarks" :disabled="operationType === 'view'" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鐩稿叧鍩硅锛�" label-width="110px" prop="relatedTraining">
+ <el-input v-model="form.relatedTraining" :disabled="operationType === 'view'" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item class="radio-group" prop="relatedTrainingConformNot" style="text-align: center">
+ <el-radio-group v-model="form.relatedTrainingConformNot" :disabled="operationType === 'view'">
+ <el-radio :label="1">绗﹀悎</el-radio>
+ <el-radio :label="2">涓嶇鍚�</el-radio>
+ <el-radio :label="3">涓嶉�傜敤</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item prop="relatedTrainingRemarks">
+ <el-input v-model="form.relatedTrainingRemarks" :disabled="operationType === 'view'"
+ size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鐩稿叧缁忛獙锛�" label-width="110px" prop="relevantExperience">
+ <el-input v-model="form.relevantExperience" :disabled="operationType === 'view'" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item class="radio-group" prop="relevantExperienceConformNot" style="text-align: center">
+ <el-radio-group v-model="form.relevantExperienceConformNot" :disabled="operationType === 'view'">
+ <el-radio :label="1">绗﹀悎</el-radio>
+ <el-radio :label="2">涓嶇鍚�</el-radio>
+ <el-radio :label="3">涓嶉�傜敤</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item prop="relevantExperienceRemarks">
+ <el-input v-model="form.relevantExperienceRemarks" :disabled="operationType === 'view'"
+ size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="涓婂矖璇侊細" label-width="110px" prop="workLicense">
+ <el-input v-model="form.workLicense" :disabled="operationType === 'view'" size="small" style="width: 100%">
+ </el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item class="radio-group" prop="workLicenseConformNot" style="text-align: center">
+ <el-radio-group v-model="form.workLicenseConformNot" :disabled="operationType === 'view'">
+ <el-radio :label="1">绗﹀悎</el-radio>
+ <el-radio :label="2">涓嶇鍚�</el-radio>
+ <el-radio :label="3">涓嶉�傜敤</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item prop="workLicenseRemarks">
+ <el-input v-model="form.workLicenseRemarks" :disabled="operationType === 'view'" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="宀椾綅鑱岃矗锛�" label-width="110px" prop="jobResponsibilitiesTem" style="height: 450px">
+ <el-checkbox-group v-model="form.jobResponsibilitiesTem" :disabled="operationType === 'view'"
+ @change="selectResponsibilities">
+ <el-checkbox v-for="city in responsibilities" :key="city.value" :label="city.label"
+ :value="city.value"></el-checkbox>
+ </el-checkbox-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item class="radio-group" prop="jobResponsibilitiesConformNot"
+ style="text-align: center;height: 420px">
+ <el-radio-group v-model="form.jobResponsibilitiesConformNot" :disabled="operationType === 'view'">
+ <el-radio :label="1">绗﹀悎</el-radio>
+ <el-radio :label="2">涓嶇鍚�</el-radio>
+ <el-radio :label="3">涓嶉�傜敤</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item prop="jobResponsibilitiesRemarks" style="height: 420px">
+ <el-input v-model="form.jobResponsibilitiesRemarks" :disabled="operationType === 'view'"
+ size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <span style="padding-left: 110px;font-size: 14px">澶囨敞锛氬矖浣嶈亴璐h揪鍒�5椤瑰強5椤逛互涓婁负绗﹀悎</span>
+ </el-col>
+ <el-col :span="16">
+ <el-form-item label="缁煎悎璇勪环锛�" label-width="110px" prop="comprehensiveAssessment">
+ <el-radio-group v-model="form.comprehensiveAssessment" :disabled="operationType === 'view'">
+ <el-radio label="Qualified this position">鍙儨浠昏宀椾綅</el-radio>
+ <el-radio label="You can work while training">鍙竟鍩硅杈逛笂宀�</el-radio>
+ <el-radio label="Iconpetent for the position">涓嶈儨浠昏宀椾綅</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button v-if="operationType !== 'view'" @click="resetForm">鍙栨秷</el-button>
+ <el-button v-if="operationType !== 'view'" type="primary" @click="submitForm">淇濆瓨</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import limsTable from "@/components/Table/lims-table.vue";
+import TableCard from '@/components/TableCard/index.vue';
+import {
+ exportPersonnelCapacity,
+ personPersonnelCapacityPage,
+ addOrUpdatePersonPersonnelCapacity,
+ confirmPersonnelCapability,
+ deletePersonPersonnelCapacity,
+ selectUserList,
+} from '@/api/cnas/personnel/personnelInfo.js'
+export default {
+ dicts: ['responsibilities_list'],
+ props: {
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ }
+ },
+ isDepartment: {
+ type: Boolean,
+ default: false
+ }
+ },
+ components: {
+ limsTable,
+ TableCard
+ },
+ data() {
+ return {
+ userName: '',
+ tableData: [],
+ search: {
+ size: 20,
+ current: 1,
+ total: 0
+ },
+ title: '鏂板鑳藉姏璁ゅ畾',
+ operationType: '',
+ yearColumnData: [
+ {
+ label: '宀椾綅',
+ prop: 'postName',
+ minWidth: '100'
+ }, {
+ label: '濮撳悕',
+ prop: 'userName',
+ minWidth: '100'
+ }, {
+ label: '瀛﹀巻',
+ prop: 'academicDegree',
+ minWidth: '100'
+ }, {
+ label: '涓撲笟',
+ prop: 'major',
+ minWidth: '100'
+ }, {
+ label: '鑱岀О',
+ prop: 'technicalPost',
+ minWidth: '100'
+ }, {
+ dataType: 'slot',
+ label: '宸ヤ綔缁忓巻',
+ prop: 'placeWork',
+ minWidth: '100',
+ slot: 'placeWorkSlot'
+ }, {
+ dataType: 'slot',
+ label: '宀椾綅鑱岃矗',
+ prop: 'jobResponsibilities',
+ minWidth: '200px',
+ slot: 'jobResponsibilities'
+ }, {
+ dataType: 'tag',
+ label: '缁煎悎璇勪环',
+ minWidth: '140px',
+ prop: 'comprehensiveAssessment',
+ formatData: (params) => {
+ if (params == 'Qualified this position') {
+ return '鍙儨浠昏宀椾綅';
+ } else if (params == 'You can work while training') {
+ return '鍙竟鍩硅杈逛笂宀�';
+ } else {
+ return '涓嶈儨浠昏宀椾綅';
+ }
+ },
+ formatType: (params) => {
+ if (params == 'Qualified this position') {
+ return 'success';
+ } else if (params == 'You can work while training') {
+ return 'warning';
+ } else {
+ return 'danger';
+ }
+ }
+ }, {
+ label: '纭浜�',
+ prop: 'confirmOperatingPersonnelId',
+ minWidth: '100'
+ }, {
+ label: '纭鏃ユ湡',
+ prop: 'confirmDate',
+ minWidth: '160'
+ }, {
+ dataType: 'action',
+ minWidth: '220',
+ label: '鎿嶄綔',
+ fixed: 'right',
+ operation: [
+ {
+ name: '缂栬緫',
+ type: 'text',
+ clickFun: (row) => {
+ this.handleViewClick('edit', row);
+ },
+ showHide: (row) => {
+ if (this.isDepartment) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ },
+ {
+ name: '鏌ョ湅',
+ type: 'text',
+ clickFun: (row) => {
+ this.handleViewClick('view', row);
+ }
+ },
+ {
+ name: '瀵煎嚭',
+ type: 'text',
+ clickFun: (row) => {
+ this.downLoadPost(row);
+ }
+ },
+ {
+ name: '纭',
+ type: 'text',
+ clickFun: (row) => {
+ this.verifyGet(row.id);
+ }
+ },
+ {
+ name: '鍒犻櫎',
+ type: 'text',
+ color: '#f56c6c',
+ clickFun: (row) => {
+ this.deletePost(row.id);
+ },
+ showHide: (row) => {
+ if (this.isDepartment) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ }
+ ]
+ }],
+ yearLoading: false,
+ dialogVisible: false,
+ form: {
+ jobResponsibilitiesTem: []
+ },
+ responsibleOptions: [],
+ rules: {
+ userId: [{ required: true, message: '璇烽�夋嫨浜哄憳', trigger: 'change' }],
+ academicDegree: [{ required: true, message: '璇疯緭鍏ュ鍘嗘煡鏍哥粨鏋�', trigger: 'blur' }],
+ academicConformNot: [{ required: true, message: '璇烽�夋嫨瀛﹀巻绗﹀悎涓庡惁', trigger: 'change' }],
+ relatedYears: [{ required: true, message: '璇疯緭鍏ョ浉鍏冲勾闄愭煡鏍哥粨鏋�', trigger: 'blur' }],
+ relatedYearsConformNot: [{ required: true, message: '璇烽�夋嫨鐩稿叧骞撮檺绗﹀悎涓庡惁', trigger: 'change' }],
+ relatedTraining: [{ required: true, message: '璇疯緭鍏ョ浉鍩硅闄愭煡鏍哥粨鏋�', trigger: 'blur' }],
+ relatedTrainingConformNot: [{ required: true, message: '璇烽�夋嫨鐩稿叧鍩硅绗﹀悎涓庡惁', trigger: 'change' }],
+ relevantExperience: [{ required: true, message: '璇疯緭鍏ョ浉鍏崇粡楠屾煡鏍哥粨鏋�', trigger: 'blur' }],
+ relevantExperienceConformNot: [{ required: true, message: '璇烽�夋嫨鐩稿叧缁忛獙绗﹀悎涓庡惁', trigger: 'change' }],
+ workLicense: [{ required: true, message: '璇疯緭鍏ヤ笂宀楄瘉鏌ユ牳缁撴灉', trigger: 'blur' }],
+ workLicenseConformNot: [{ required: true, message: '璇烽�夋嫨涓婂矖璇佺鍚堜笌鍚�', trigger: 'change' }],
+ jobResponsibilitiesTem: [{ required: true, message: '璇烽�夋嫨宀椾綅鑱岃矗鏌ユ牳缁撴灉', trigger: 'change' }],
+ jobResponsibilitiesConformNot: [{ required: true, message: '璇烽�夋嫨宀椾綅鑱岃矗绗﹀悎涓庡惁', trigger: 'change' }],
+ comprehensiveAssessment: [{ required: true, message: '璇烽�夋嫨缁煎悎璇勪环', trigger: 'change' }]
+ },
+ responsibilities: []
+ };
+ },
+ mounted() {
+ this.getList(this.departId);
+ },
+ methods: {
+ // 涓嬭浇
+ downLoadPost(row) {
+ exportPersonnelCapacity({ id: row.id }).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/msword' });
+ this.$download.saveAs(blob, "浜哄憳鑳藉姏瀵煎嚭" + '.docx')
+ })
+ },
+ // 鏌ヨ
+ refreshTable() {
+ this.getList(this.departId);
+ },
+ // 鑾峰彇浜哄憳鑳藉姏鍒楄〃淇℃伅
+ getList(userId) {
+ this.search.userId = userId;
+ const name = this.isDepartment ? 'departmentId' : 'userId';
+ this.yearLoading = true
+ personPersonnelCapacityPage({
+ userName: this.userName,
+ [name]: this.search.userId,
+ size: this.search.size,
+ current: this.search.current
+ }).then(res => {
+ this.yearLoading = false
+ if (res.code === 201) return;
+ this.tableData = res.data.records;
+ this.search.total = res.data.total;
+ }).catch(err => {
+ console.log(err);
+ this.yearLoading = false
+ })
+ },
+ selectResponsibilities(arr) {
+ let arrTem = [];
+ arr.map(val => {
+ const index = this.responsibilities.findIndex(item => item.label === val);
+ if (index > -1) {
+ arrTem.push(this.responsibilities[index].value);
+ }
+ });
+ this.form.jobResponsibilities = arrTem.join(',');
+ },
+ getResponsibilities() {
+ this.responsibilities = this.dict.type.responsibilities_list;
+ },
+ changeLine(val) {
+ if (val) {
+ return val.replace(/,/g, '<br>')
+ } else {
+ return
+ }
+ },
+ // 鏂板
+ addAppointPost(type) {
+ this.operationType = type;
+ this.title = '鏂板鑳藉姏璁ゅ畾'
+ this.dialogVisible = true;
+ this.form = {
+ jobResponsibilitiesTem: []
+ }
+ this.getUserList();
+ this.getResponsibilities();
+
+ },
+ // 缂栬緫/鏌ョ湅
+ handleViewClick(type, row) {
+ this.operationType = type;
+ this.title = this.operationType === 'edit' ? '淇敼鑳藉姏璁ゅ畾' : '鏌ョ湅鑳藉姏璁ゅ畾'
+ this.dialogVisible = true;
+ this.form = { ...row }
+ if (this.form.responsibilities) {
+ this.$set(this.form, 'jobResponsibilitiesTem', this.form.responsibilities.split(","))
+ } else {
+ this.$set(this.form, 'jobResponsibilitiesTem', [])
+ }
+ this.getUserList();
+ this.getResponsibilities();
+ },
+ submitForm() {
+ this.$refs.infoForm.validate((valid) => {
+ if (valid) {
+ addOrUpdatePersonPersonnelCapacity(this.form).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鎻愪氦鎴愬姛');
+ this.getList(this.departId);
+ this.form.id = null;
+ this.dialogVisible = false;
+ }
+ });
+ }
+ });
+ },
+ verifyGet(id) {
+ this.$confirm('鏄惁纭鏈潯淇℃伅?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ confirmPersonnelCapability({ id }).then(res => {
+ if (res.code == 200) {
+ this.$message.success('纭鎴愬姛');
+ this.getList(this.departId);
+ }
+ });
+ }).catch((err) => {
+ console.log('err---', err);
+ this.$message.info('宸插彇娑�')
+ });
+ },
+ // 鍒犻櫎宀椾綅鑱岃矗
+ deletePost(id) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎姝ゆ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deletePersonPersonnelCapacity({ id }).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鍒犻櫎鎴愬姛');
+ this.getList(this.departId);
+ }
+ });
+ }).catch(() => {
+ this.$message.error('鍒犻櫎澶辫触');
+ });
+ },
+ resetForm() {
+ this.$refs.infoForm.resetFields();
+ this.dialogVisible = false;
+ },
+ // 鑾峰彇璐熻矗浜轰俊鎭帴鍙�
+ getUserList() {
+ selectUserList().then(res => {
+ if (res.code == 200) {
+ this.responsibleOptions = res.data;
+ }
+ });
+ },
+ pagination({ page, limit }) {
+ this.search.current = page;
+ this.search.size = limit;
+ this.getList();
+ },
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ departId: {
+ handler(newId, oldId) {
+ this.getList(newId);
+ }
+ },
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ isDepartment: {
+ handler(newId, oldId) {
+ this.getList(this.departId);
+ }
+ },
+ }
+};
+</script>
+<style scoped>
+>>>.el-dialog {
+ margin: 6vh auto 50px !important;
+}
+
+>>>.el-dialog__body {
+ max-height: 70vh;
+ overflow-y: auto;
+}
+
+.radio-group>>>.el-form-item__error {
+ padding-left: 38px;
+}
+
+>>>.el-checkbox__label {
+ width: 212px;
+ white-space: pre-wrap;
+}
+</style>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelInformation/index.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelInformation/index.vue
new file mode 100644
index 0000000..a6cd688
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelInformation/index.vue
@@ -0,0 +1,948 @@
+<template>
+ <div>
+ <div style="text-align: right;margin-bottom: 10px">
+ <!-- <el-button size="small" @click="$emit('goBackList')">杩斿洖</el-button>-->
+ <el-button size="small" type="primary" @click="synchronous" :loading="synchronousLoading">鍚屾绗笁鏂逛俊鎭�</el-button>
+ <el-button size="small" type="primary" @click="dialogVisible = true">浜哄憳鍒嗙被</el-button>
+ <el-button :loading="saveLoading" size="small" type="primary" @click="save">淇濆瓨</el-button>
+ </div>
+ <div>
+ <div style="display: flex;flex-direction: row;">
+ <div style="width: 12em">
+ <el-image :src="javaApi + '/img/' + form.pictureUrl" fit="fill"
+ style="width: 180px;height: 300px;border: 1px solid #000;border-radius: 10px;margin-left: 6px;margin-top: 10px;">
+ <div slot="error" class="image-slot">
+ <i class="el-icon-picture-outline" style="font-size: 40px;"></i>
+ </div>
+ </el-image>
+ <el-image :src="javaApi + '/img/' + form.signatureUrl" fit="fill"
+ style="width:80%;height: 50px;border: 1px solid #000;border-radius: 10px;margin-left: 22px;margin-top: 20px;">
+ <div slot="error" class="image-slot">
+ <i class="el-icon-picture-outline" style="font-size: 40px;"></i>
+ </div>
+ </el-image>
+ </div>
+ <div style="height: calc(100vh - 14em);overflow-y: auto">
+ <el-form ref="form" :model="form" label-width="110px">
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="濮撳悕">
+ <el-input v-model="form.name" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鐧诲綍璐﹀彿">
+ <el-input v-model="form.account" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="褰撳墠鐘舵��">
+ <el-radio-group v-model="form.currentState">
+ <el-radio label="1formal" size="mini">姝e紡</el-radio>
+ <el-radio label="2intern" size="mini">瀹炰範</el-radio>
+ <el-radio label="3leaveOffice" size="mini">绂昏亴</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="宸ュ彿">
+ <el-input v-model="form.jobNumber" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍛樺伐瀛愮紪鍙�">
+ <el-input v-model="form.subordinateNumber" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鎬у埆">
+ <el-radio-group v-model="form.sex">
+ <el-radio label="1" size="mini">鐢�</el-radio>
+ <el-radio label="0" size="mini">濂�</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <!-- <el-col :span="8">
+ <el-form-item label="鍏ヨ亴鏃堕棿">
+ <el-date-picker v-model="form.entryTime" type="date" placeholder="閫夋嫨鏃ユ湡" size="small"
+ style="width: 99%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss">
+ </el-date-picker>
+ </el-form-item>
+ </el-col> -->
+ <!-- <el-col :span="8">
+ <el-form-item label="褰撳墠鑱屽姟">
+ <el-input v-model="form.currentPosition" size="small" clearable></el-input>
+ </el-form-item>
+ </el-col> -->
+ </el-row>
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="鍏徃鍚嶇О">
+ <el-input v-model="form.corporateName" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="閮ㄩ棬缂栧彿">
+ <el-input v-model="form.departmentCode" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鎵�灞為儴闂�">
+ <el-cascader v-model="form.departLimsId" :options="department"
+ :props="{ label: 'name', value: 'id', checkStrictly: true }" filterable
+ style="width: 100%;"></el-cascader>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="宀椾綅绫诲埆">
+ <el-input v-model="form.postType" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="宀椾綅缂栧彿">
+ <el-input v-model="form.postCode" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="宀椾綅鍚嶇О">
+ <el-input v-model="form.postName" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="鍏ラ泦鍥㈡椂闂�">
+ <el-date-picker v-model="form.groupTime" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small"
+ style="width: 99%;" type="date" value-format="yyyy-MM-dd">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍏ュ崟浣嶆椂闂�">
+ <el-date-picker v-model="form.unitTime" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small"
+ style="width: 99%;" type="date" value-format="yyyy-MM-dd">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鐩存帴涓婄骇">
+ <el-input v-model="form.reportingTo" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="鍔冲姩鍏崇郴">
+ <el-radio-group v-model="form.laborRelations">
+ <el-radio label="鍚堝悓宸�" size="mini">鍚堝悓宸�</el-radio>
+ <el-radio label="姝e紡宸�" size="mini">姝e紡宸�</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="璇曠敤寮�濮嬫椂闂�">
+ <el-date-picker v-model="form.trialStartTime" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small"
+ style="width: 99%;" type="date" value-format="yyyy-MM-dd">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="璇曠敤缁撴潫鏃堕棿">
+ <el-date-picker v-model="form.trialEndTime" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small"
+ style="width: 99%;" type="date" value-format="yyyy-MM-dd">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="24" style="text-align: left;">
+ <el-form-item label="浜哄憳鍒嗙被">
+ <span style="color: #000;">{{ form.personnelClassification }}</span>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="鍑虹敓鏃ユ湡">
+ <el-date-picker v-model="form.dateBirth" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small"
+ style="width: 99%;" type="date" value-format="yyyy-MM-dd">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="绫嶈疮">
+ <el-input v-model="form.nativePlace" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="姘戞棌">
+ <el-input v-model="form.nation" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="璇佷欢绫诲瀷">
+ <el-input v-model="form.idType" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="韬唤璇佸彿">
+ <el-input v-model="form.identityCard" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="骞撮緞">
+ <el-input-number v-model="form.personBasicInfoAge" :max="130" :min="1" controls-position="right"
+ size="small" style="width: 99%;"></el-input-number>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="璇佷欢鏈夋晥鏈�">
+ <el-date-picker v-model="form.validityPeriod" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small"
+ style="width: 99%;" type="date" value-format="yyyy-MM-dd">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="濠氬Щ鐘跺喌">
+ <el-radio-group v-model="form.maritalStatus">
+ <el-radio label='宸插' size="mini">宸插</el-radio>
+ <el-radio label='鏈' size="mini">鏈</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="璇佷欢鍦板潃">
+ <el-input v-model="form.idAddress" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="璇佷欢璇︾粏鍦板潃">
+ <el-input v-model="form.idDetailAddress" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鐜板眳鍦板潃">
+ <el-input v-model="form.currentAddress" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鐜板眳璇︾粏鍦板潃">
+ <el-input v-model="form.currentDetailAddress" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="閫佽揪鍦板潃">
+ <el-input v-model="form.serviceAddress" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="閫佽揪璇︾粏鍦板潃">
+ <el-input v-model="form.serviceDetailAddress" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鏄惁閫�浼嶅啗浜�">
+ <el-radio-group v-model="form.retiredSoldiers">
+ <el-radio label='鏄�' size="mini">鏄�</el-radio>
+ <el-radio label='鍚�' size="mini">鍚�</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="鏀挎不闈㈣矊">
+ <el-input v-model="form.politicalStatus" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍏ュ厷/鍥㈡椂闂�">
+ <el-date-picker v-model="form.dumplingTime" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small"
+ style="width: 99%;" type="date" value-format="yyyy-MM-dd">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鎵嬫満鍙�">
+ <el-input v-model="form.telephone" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="鐭彿">
+ <el-input v-model="form.cornet" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍔炲叕鐢佃瘽">
+ <el-input v-model="form.officePhone" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍏徃閭">
+ <el-input v-model="form.companyEmail" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="璁$畻鏈虹瓑绾�">
+ <el-input v-model="form.ncre" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鏈�楂樺鍘�">
+ <el-input v-model="form.officialAcademicRedentials" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鏈�楂樺浣�">
+ <el-input v-model="form.highestDegree" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="姣曚笟闄㈡牎1">
+ <el-input v-model="form.graduatedInstitutions1" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="涓撲笟1">
+ <el-input v-model="form.major1" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="姣曚笟鏃堕棿1">
+ <el-date-picker v-model="form.graduationTime1" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small"
+ style="width: 99%;" type="date" value-format="yyyy-MM-dd">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="姣曚笟闄㈡牎2">
+ <el-input v-model="form.graduatedInstitutions2" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="涓撲笟2">
+ <el-input v-model="form.major2" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="姣曚笟鏃堕棿2">
+ <el-date-picker v-model="form.graduationTime2" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small"
+ style="width: 99%;" type="date" value-format="yyyy-MM-dd">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="鏄惁鍏ㄦ棩鍒�">
+ <el-radio-group v-model="form.fullTime">
+ <el-radio :label="1" size="mini">鏄�</el-radio>
+ <el-radio :label="0" size="mini">鍚�</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鏄惁灞炰簬涓ぉ">
+ <el-radio-group v-model="form.enroll">
+ <el-radio :label=1 size="mini">鏄�</el-radio>
+ <el-radio :label=0 size="mini">鍚�</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="XX灞婂ぇ瀛︾敓">
+ <el-input v-model="form.collegeStudents" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="8">
+ <el-form-item label="绱ф�ヨ仈绯讳汉">
+ <el-input v-model="form.emergencyContact" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="绱ф�ヨ仈绯荤數璇�">
+ <el-input v-model="form.emergencyContactPhone" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鏈�鍚庢洿鏂版椂闂�">
+ <el-date-picker v-model="form.lastUpdateTime" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small"
+ style="width: 99%;" type="date" value-format="yyyy-MM-dd">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="18">
+ <el-form-item label="涓汉鐓х墖">
+ <el-input v-model="form.pictureUrl" disabled size="small">
+ <el-button v-if="form.pictureUrl" slot="append" icon="el-icon-delete-solid"
+ @click="deleteFile(form.pictureUrl, 'pictureUrl')"></el-button>
+ </el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-upload ref="upload" :action="action" :headers="uploadHeader"
+ :on-success="(response, file, fileList) => onSuccess(response, file, fileList, 'pictureUrl')"
+ :show-file-list="false" style="float: left; margin: 0 10px 0 10px;">
+ <el-button slot="trigger" class="uploadFile" size="mini" type="primary">涓婁紶</el-button>
+ </el-upload>
+ <el-button v-if="form.pictureUrl" class="uploadFile" size="mini" type="primary"
+ @click="downloadFile(form.pictureUrl)">涓嬭浇</el-button>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="18">
+ <el-form-item label="鐢靛瓙绛惧悕">
+ <el-input v-model="form.signatureUrl" disabled size="small">
+ <el-button v-if="form.signatureUrl" slot="append" icon="el-icon-delete-solid"
+ @click="deleteFile(form.signatureUrl, 'signatureUrl')"></el-button>
+ </el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-upload ref="upload" :action="action" :headers="uploadHeader"
+ :on-success="(response, file, fileList) => onSuccess(response, file, fileList, 'signatureUrl')"
+ :show-file-list="false" style="float: left; margin: 0 10px 0 10px;">
+ <el-button slot="trigger" class="uploadFile" size="small" type="primary">涓婁紶</el-button>
+ </el-upload>
+ <el-button v-if="form.signatureUrl" class="uploadFile" size="small" type="primary"
+ @click="downloadFile(form.signatureUrl)">涓嬭浇</el-button>
+ </el-col>
+ </el-row>
+ <!-- <el-row>
+ <el-col :span="20">
+ <el-form-item label="闄勪欢璧勬枡">
+ <el-input v-model="form.attachmentInformation" size="small" disabled>
+ <el-button v-if="form.attachmentInformation" slot="append"
+ icon="el-icon-delete-solid"
+ @click="deleteFile(form.attachmentInformation, 'attachmentInformation')"></el-button>
+ </el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="4">
+ <el-upload ref="upload" style="float: left; margin: 0 20px;" :action="action"
+ :show-file-list="false"
+ :on-success="(response, file, fileList) => onSuccess(response, file, fileList, 'attachmentInformation')">
+ <el-button class="uploadFile" slot="trigger" size="mini" type="primary">娴忚</el-button>
+ </el-upload>
+ <el-button class="uploadFile" size="mini" type="primary" @click="downloadFile(form.attachmentInformation)">涓嬭浇</el-button>
+ </el-col>
+ </el-row> -->
+
+ <el-row>
+ <el-col :span="20">
+ <el-form-item label="闄勪欢璧勬枡">
+ </el-form-item>
+ </el-col>
+ <el-col :span="4">
+ <el-button size="mini" style="float: right;margin-right: 25px" type="primary"
+ @click="annexAdd(0)">鏂板</el-button>
+ </el-col>
+ </el-row>
+ <el-table :data="annexList" border height="200" style="width: 96%;">
+ <el-table-column label="搴忓彿" type="index" width="80px">
+ </el-table-column>
+ <el-table-column label="璇佷欢鍙�" prop="idNumber" width="150px">
+ </el-table-column>
+ <el-table-column label="鍙戣瘉鍗曚綅" prop="issueUnit" width="150px">
+ </el-table-column>
+ <el-table-column label="鏂囦欢鍚嶇О" prop="fileName" show-overflow-tooltip width="200px">
+ </el-table-column>
+ <el-table-column label="绾у埆" prop="level" width="150px">
+ </el-table-column>
+ <el-table-column label="鏈夋晥鏈�" prop="periodValidity" width="150px">
+ </el-table-column>
+ <el-table-column label="娣诲姞鏃堕棿" prop="createTime" width="150px">
+ </el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔" width="150px">
+ <template slot-scope="scope">
+ <el-button size="mini" type="text" @click="downloadFile(scope.row.fileName)">涓嬭浇</el-button>
+ <el-button size="mini" type="text" @click="annexAdd(1, scope.row)">缂栬緫</el-button>
+ <el-button size="mini" type="text" @click="deleteAnnex(scope.row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-form>
+ <el-row>
+ </el-row>
+ </div>
+ </div>
+ </div>
+ <!-- 浜哄憳鍒嗙被寮规 -->
+ <el-dialog :visible.sync="dialogVisible" title="鎻愮ず" width="40%" @open="getComparisonList">
+ <div style="height: 30vh;">
+ <el-row>
+ <el-col :span="4">
+ 浜哄憳鍒嗙被锛�
+ </el-col>
+ <el-col :span="20" style="text-align: left;">
+ <el-checkbox-group v-model="checkList">
+ <el-checkbox v-for="v in personnelClassification" :key="v.value" :label="v.value"></el-checkbox>
+ </el-checkbox-group>
+ </el-col>
+ </el-row>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="clickPersonnelClassificationSure">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+
+ <!-- 鏂板闄勪欢璧勬枡 -->
+ <el-dialog :before-close="handleClose" :title="title" :visible.sync="dialogVisible1" width="40%"
+ @open="getComparisonList">
+ <el-form ref="annex" :model="annex" :rules="rules" label-width="100px">
+ <el-row>
+ <el-col :span="16">
+ <el-form-item label="璇佷欢鍙�" prop="idNumber">
+ <el-input v-model="annex.idNumber" clearable size="small" style="width: 100%;"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row style="margin-top: 15px">
+ <el-col :span="16">
+ <el-form-item label="鍙戣瘉鍗曚綅" prop="issueUnit">
+ <el-input v-model="annex.issueUnit" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row style="margin-top: 15px">
+ <el-col :span="16">
+ <el-form-item label="绾у埆" prop="level">
+ <el-input v-model="annex.level" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row style="margin-top: 15px">
+ <el-col :span="16">
+ <el-form-item label="鏈夋晥鏈�" prop="periodValidity">
+ <el-date-picker v-model="annex.periodValidity" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small"
+ style="width: 99%;" type="date" value-format="yyyy-MM-dd">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row style="margin-top: 15px">
+ <el-col :span="16">
+ <el-form-item label="澶嶅嵃浠�" prop="copy">
+ <el-input v-model="annex.copy" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row style="margin-top: 15px">
+ <el-col :span="16">
+ <el-form-item label="鍘熶欢" prop="original">
+ <el-input v-model="annex.original" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row style="margin-top: 15px">
+ <el-col :span="16">
+ <el-form-item label="鏂囦欢">
+ <el-upload :action="action" :headers="uploadHeader" :before-upload="beforeAvatarUpload"
+ :on-success="(response, file, fileList) => onSuccess(response, file, fileList, 'fileName')"
+ :show-file-list="false">
+ <img v-if="imageUrl" :src="imageUrl" class="avatar">
+ <i v-else class="el-icon-upload avatar-uploader-icon"></i>
+ </el-upload>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="cancellation">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitForm('annex')">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import {
+ getEmployees,
+ getAnnex,
+ updateAnnex,
+ getAnnexByUserId,
+ addAnnex,
+ deleteAnnex,
+ getCNASPersonnelInfo,
+ saveCNASPersonnelInfo,
+ deleteCNASFile
+} from '@/api/cnas/personnel/personnelInfo.js'
+export default {
+ dicts: ['personnl_type'],
+ props: {
+ clickNodeVal: {
+ type: Object,
+ default: () => { return {} }
+ },
+ },
+ data() {
+ return {
+ synchronousLoading: false,
+ addOrupdate: null,
+ title: '',
+ annexList: [],
+ imageUrl: '',
+ annex: {
+ userId: '',
+ idNumber: '',
+ issueUnit: '',
+ level: '',
+ periodValidity: '',
+ copy: '',
+ original: '',
+ fileName: ''
+ },
+ rules: {
+ idNumber: [
+ { required: true, message: '璇疯緭鍏ヨ瘉浠跺彿', trigger: 'blur' }
+ ],
+ issueUnit: [
+ { required: true, message: '璇疯緭鍏ュ彂璇佸崟浣�', trigger: 'blur' }
+ ],
+ periodValidity: [
+ { required: true, message: '璇烽�夋嫨鏈夋晥鏈�', trigger: 'blur' }
+ ]
+ },
+ dialogVisible1: false,
+ form: {
+ userId: '',
+ name: '',
+ account: '',
+ currentState: '',
+ jobNumber: '',
+ subordinateNumber: '',
+ sex: '',
+ corporateName: '',
+ department: '',
+ departLimsId: [],
+ postType: '',
+ postCode: '',
+ postName: '',
+ groupTime: '',
+ unitTime: '',
+ reportingTo: '',
+ laborRelations: '',
+ trialStartTime: '',
+ trialEndTime: '',
+ personnelClassification: '',
+ dateBirth: '',
+ nativePlace: '',
+ nation: '',
+ idType: '',
+ identityCard: '',
+ age: '',
+ validityPeriod: '',
+ maritalStatus: '',
+ idAddress: '',
+ idDetailAddress: '',
+ currentAddress: '',
+ currentDetailAddress: '',
+ serviceAddress: '',
+ serviceDetailAddress: '',
+ retiredSoldiers: '',
+ politicalStatus: '',
+ dumplingTime: '',
+ telephone: '',
+ cornet: '',
+ officePhone: '',
+ email: '',
+ ncre: '',
+ officialAcademicRedentials: '',
+ highestDegree: '',
+ graduatedInstitutions1: '',
+ major1: '',
+ graduationTime1: '',
+ graduatedInstitutions2: '',
+ major2: '',
+ graduationTime2: '',
+ fullTime: '',
+ enroll: '',
+ collegeStudents: '',
+ emergencyContact: '',
+ emergencyContactPhone: '',
+ lastUpdateTime: '',
+ pictureUrl: '',
+ signatureUrl: '',
+ },
+ department: [],
+ saveLoading: false,
+ dialogVisible: false,
+ personnelClassification: [],
+ checkList: [],
+ successFileList: [], // 闃叉鍚庣鍑虹幇鑴忔暟鎹�
+ isSave: false,
+ }
+ },
+ created() {
+ this.init()
+ },
+ computed: {
+ action() {
+ return this.javaApi + '/personBasicInfo/saveCNASFile'
+ }
+ },
+ methods: {
+ synchronous() {
+ console.log('鍩烘湰淇℃伅', this.clickNodeVal);
+ this.synchronousLoading = true
+ getEmployees({ userId: this.clickNodeVal.userId }).then(res => {
+ this.synchronousLoading = false
+ this.getUserBasisInfo(this.clickNodeVal.userId)
+ this.$message.success("鍚屾鎴愬姛")
+
+ })
+ },
+ annexAdd(type, row) {
+ if (type === 1) {
+ this.title = '缂栬緫闄勪欢璧勬枡'
+ this.addOrupdate = 1
+ getAnnex({ id: row.id }).then(res => {
+ this.annex = res.data
+ this.imageUrl = this.javaApi + '/img/' + res.data.fileName
+ })
+ } else {
+ this.title = '鏂板闄勪欢璧勬枡'
+ this.addOrupdate = 2
+ }
+ this.dialogVisible1 = true
+ },
+ submitForm(formName) {
+ this.$refs[formName].validate((valid) => {
+ if (valid) {
+ this.addAnnex()
+ } else {
+ return false
+ }
+ })
+ },
+ addAnnex() {
+ if (this.annex.fileName == "" || this.annex.fileName == null || this.annex.fileName == undefined) {
+ this.$message.error("璇蜂笂浼犳枃浠�")
+ return
+ }
+ this.annex.userId = this.clickNodeVal.userId
+ if (this.addOrupdate === 1) {
+ updateAnnex(this.annex).then(res => {
+ if (res.code == 200) {
+ getAnnexByUserId({ userId: this.clickNodeVal.userId }).then(res => {
+ this.dialogVisible1 = false
+ this.imageUrl = ''
+ this.resetForm('annex')
+ this.annexList = res.data
+ this.$message.success('鏇存柊鎴愬姛锛�')
+ })
+ }
+ })
+ } else {
+ this.annex.id = null
+ addAnnex(this.annex).then(res => {
+ if (res.code == 200) {
+ getAnnexByUserId({ userId: this.clickNodeVal.userId }).then(res => {
+ this.dialogVisible1 = false
+ this.imageUrl = ''
+ this.resetForm('annex')
+ this.annexList = res.data
+ this.$message.success('淇濆瓨鎴愬姛')
+ })
+ }
+ })
+ }
+ },
+ deleteAnnex(row) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ枃浠�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deleteAnnex(row.id).then(res => {
+ this.$message.success('鍒犻櫎鎴愬姛锛�')
+ this.annexList = this.annexList.filter(item => item.id != row.id)
+ })
+ })
+ },
+ beforeAvatarUpload(file) {
+ let flag = true
+ if (file.size > 1024 * 1024 * 10) {
+ this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M');
+ this.$refs.upload.clearFiles()
+ flag = false
+ }
+ if (!flag) {
+ return Promise.reject(flag); //姝g‘鐨勭粓姝�
+ }
+ },
+ downloadFile(fileName) {
+ this.$download.saveAs(fileName, fileName)
+ },
+ async onSuccess(response, file, fileList, entityVal) {
+ if (entityVal == 'fileName') {
+ this.annex.fileName = response.data
+ this.imageUrl = this.javaApi + '/img/' + response.data
+ }
+ // 鍦ㄤ繚瀛樿祴鍊兼柊鏂囦欢
+ this.successFileList.push(response.data)
+ this.$set(this.form, entityVal, response.data)
+ },
+ // 鍒濆鍖栬皟鐢�
+ init() {
+ if (!this.clickNodeVal.userId) {
+ let user = JSON.parse(localStorage.getItem('user'))
+ this.getUserBasisInfo(user.userId)
+ this.clickNodeVal.userId = user.userId
+ } else {
+ this.getUserBasisInfo(this.clickNodeVal.userId)
+ }
+ },
+ getUserBasisInfo(userId) {
+ getCNASPersonnelInfo({ userId }).then(res => {
+ this.form = res.data.PersonBasicInfoDto
+ this.department = res.data.department
+ this.annexList = res.data.annexList
+ this.form.departLimsId = res.data.PersonBasicInfoDto.departLimsId.split(',').filter(a => a != "").map(Number)
+ console.log('res.data', res);
+ })
+ },
+ async save() {
+ this.saveLoading = true
+ this.form.userId = this.clickNodeVal.userId
+ if (Array.isArray(this.form.departLimsId)) {
+ if (this.form.departLimsId.length > 0) {
+ this.form.departLimsId = this.form.departLimsId.join(',').trim() + ','
+ } else {
+ this.form.departLimsId = ''
+ }
+ }
+ saveCNASPersonnelInfo(this.form).then(res => {
+ this.saveLoading = false
+ this.isSave = true
+ this.getUserBasisInfo(this.clickNodeVal.userId)
+ this.$message.success('淇濆瓨鎴愬姛锛�')
+ })
+ },
+ // 鍙栦汉鍛樺垎绫荤殑瀛楀吀
+ getComparisonList() {
+ // 鏂囦欢鐘舵��
+ this.getDicts("personnl_type").then((response) => {
+ this.personnelClassification = this.dictToValue(response.data);
+ this.checkList = this.form.personnelClassification ? this.form.personnelClassification.split('锛�') : []
+ });
+ },
+ clickPersonnelClassificationSure() {
+ this.dialogVisible = false
+ this.form.personnelClassification = this.checkList.filter(m => m).join('锛�')
+ },
+ async deleteFile(fileName, entityVal) {
+ await deleteCNASFile({ fileName }).then(res => {
+ this.$message.success('鍒犻櫎鎴愬姛锛�')
+ this.$set(this.form, entityVal, null)
+ let index = this.successFileList.indexOf(fileName)
+ if (index != -1) {
+ this.successFileList.splice(index, 1)
+ }
+ })
+ },
+ validateFileSize(rule, value, callback) {
+ if (!value) {
+ return callback(new Error('璇蜂笂浼犳枃浠�'));
+ } else {
+ callback();
+ }
+ },
+ cancellation() {
+ this.dialogVisible1 = false
+ this.imageUrl = ''
+ this.resetForm('annex')
+ },
+ handleClose(done) {
+ this.imageUrl = ''
+ this.annex = {
+ userId: '',
+ idNumber: '',
+ issueUnit: '',
+ level: '',
+ periodValidity: '',
+ copy: '',
+ original: '',
+ fileName: ''
+ }
+ done();
+ },
+ resetForm(formName) {
+ this.$refs[formName].resetFields();
+ }
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ clickNodeVal: {
+ handler(newVal, oldVal) {
+ if (newVal.userId) {
+ this.getUserBasisInfo(newVal.userId)
+ }
+ },
+ }
+ }
+}
+</script>
+
+<style scoped>
+>>>.el-form-item {
+ margin-bottom: 3px;
+}
+
+.el-input {
+ border-radius: 15px;
+}
+
+.el-icon-picture-outline {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ transform: translate(-50%, -50%);
+}
+
+.uploadFile {
+ margin-top: 2px;
+ float: left;
+}
+
+.avatar-uploader-icon {
+ font-size: 28px;
+ color: #0f8bf1;
+ width: 178px;
+ height: 50px;
+ text-align: center;
+ border: 1px solid #d9d9d9;
+}
+
+.avatar {
+ width: 178px;
+ height: 178px;
+ display: block;
+}
+</style>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelList/index.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelList/index.vue
new file mode 100644
index 0000000..04e8033
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelList/index.vue
@@ -0,0 +1,364 @@
+<template>
+ <div>
+ <div class="search-list">
+ <span class="search-input">
+ <span class="search-label">
+ <span style="width: 120px;font-size: 14px;line-height: 32px">浜哄憳鍚嶇О锛�</span>
+ <el-input v-model="entity.name" clearable placeholder="璇疯緭鍏�" size="small" style="width: 100%;"
+ @keyup.enter.native="refreshTable()">
+ </el-input>
+ </span>
+ <el-button size="small" style="margin-left: 10px" @click="refresh()">閲� 缃�</el-button>
+ <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
+ </span>
+ <span>
+ <el-button :loading="synchronousLoading" size="small" type="primary" @click="synchronous"
+ :v-show="departId">鍚屾绗笁鏂逛汉鍛樹俊鎭�</el-button>
+ <el-button :loading="outLoading" size="small" type="primary" @click="handleDown">瀵煎嚭</el-button>
+ <el-button size="small" type="primary"
+ @click="selectUserDia = true, getList(), queryParams.name = '', multipleSelection = []">鏂板缓</el-button>
+ </span>
+ </div>
+ <div class="search-table">
+ <el-table v-loading="tableLoading" :data="tableData" border height="calc(100vh - 20em)" style="width: 100%;">
+ <el-table-column align="center" label="搴忓彿" width="60">
+ <template v-slot="scope">
+ <span>{{ (page.current - 1) * page.size + scope.$index + 1 }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="鍛樺伐缂栧彿" prop="account" width="150"></el-table-column>
+ <el-table-column label="濮撳悕" prop="name" width="120"></el-table-column>
+ <el-table-column label="鍏ラ泦鍥㈡椂闂�" prop="groupTime" width="120"></el-table-column>
+ <el-table-column label="绫嶈疮" prop="nativePlace" width="120"></el-table-column>
+ <el-table-column label="璇佷欢鍙风爜" prop="identityCard" show-overflow-tooltip width="300"></el-table-column>
+ <el-table-column label="璇佷欢鍦板潃" prop="idAddress" show-overflow-tooltip width="100"></el-table-column>
+ <el-table-column label="鎵嬫満鍙�" prop="telephone" show-overflow-tooltip width="100"></el-table-column>
+ <el-table-column label="姣曚笟闄㈡牎" prop="graduatedInstitutions1" width="100"></el-table-column>
+ <el-table-column label="鎵�瀛︿笓涓�" prop="major1" width="100"></el-table-column>
+ <el-table-column label="姣曚笟鏃堕棿" prop="graduationTime1" width="100"></el-table-column>
+ <el-table-column label="鏈�楂樺鍘�" prop="officialAcademicRedentials" width="100"></el-table-column>
+ <el-table-column label="鏈�楂樺浣�" prop="highestDegree" width="100"></el-table-column>
+ <el-table-column label="鑱岀О" prop="professionalTitle" width="100"></el-table-column>
+ <el-table-column label="绱ф�ヨ仈绯讳汉" prop="emergencyContact" width="120"></el-table-column>
+ <el-table-column label="绱ф�ヨ仈绯荤數璇�" prop="emergencyContactPhone" width="120"></el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔" width="140">
+ <template slot-scope="scope">
+ <el-button size="small" type="text" @click="downPerson(scope.row)">涓嬭浇</el-button>
+ <el-button size="small" type="text" @click="$emit('updatePerson', scope.row)">缂栬緫
+ </el-button>
+ <el-button size="small" type="text" @click="deletePerson(scope.row)">鍒犻櫎
+ </el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-pagination :current-page="1" :current-page.sync="page.current" :page-size="page.size"
+ :page-sizes="[10, 20, 30, 50, 100]" :total="page.total" layout="->,total, sizes, prev, pager, next, jumper"
+ style="margin-top: 16px" @size-change="handleSizeChange" @current-change="handleCurrentChange">
+ </el-pagination>
+ </div>
+ <el-dialog :visible.sync="selectUserDia" title="閫夋嫨鐢ㄦ埛" width="70%">
+ <div class="search" style="margin-bottom: 9px;">
+ <div class="search_thing" style="display: flex;">
+ <div class="search_label">鐢ㄦ埛鍚嶏細</div>
+ <div class="search_input">
+ <el-input v-model="queryParams.name" clearable placeholder="璇疯緭鍏�" size="small"
+ @keyup.enter.native="getList()" style="width: 150px;"></el-input>
+ </div>
+ </div>
+ </div>
+ <div v-if="selectUserDia" class="body" style="height: 60vh;">
+ <lims-table :tableData="personTableData" :column="column" :tableLoading="tableLoading"
+ :height="'calc(100vh - 290px)'" :page="personPage" :isSelection="true"
+ :handleSelectionChange="handleSelectionChange"></lims-table>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="selectUserDia = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="selectUser">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import limsTable from "@/components/Table/lims-table.vue";
+import {
+ getEmployees,
+ basicInformationOfPersonnelSelectPage,
+ delUserDepardLimsId,
+ upUserDepardLimsId,
+ exportPersonBasicInfo,
+ exportPersonBasicInfoById,
+ selectUserList,
+} from '@/api/cnas/personnel/personnelInfo.js'
+export default {
+ name: 'PersonnelList',
+ // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+ components: { limsTable },
+ props: {
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ }
+ },
+ isDepartment: {
+ type: Boolean,
+ default: false
+ },
+ currentCompaniesList: {
+ type: Array,
+ default: []
+ }
+ },
+ data() {
+ // 杩欓噷瀛樻斁鏁版嵁
+ return {
+ entity: {},
+ multipleSelection: [],
+ synchronousLoading: false,
+ page: {
+ size: 20,
+ current: 1,
+ },
+ outLoading: false,
+ tableLoading: false,
+ tableData: [], // 浜哄憳鎬诲垪琛ㄦ暟鎹�
+ selectUserDia: false, // 娣诲姞浜哄憳寮规,
+ stateList: [
+ {
+ value: 1,
+ type: 'success',
+ label: '鍚敤'
+ },
+ {
+ value: 0,
+ type: 'danger',
+ label: '鍋滅敤'
+ }
+ ],
+ queryParams: {
+ name: ''
+ },
+ personTableData: [],
+ column: [
+ { label: "濮撳悕", prop: "name" },
+ { label: "璐﹀彿", prop: "account" },
+ {
+ label: "瑙掕壊",
+ prop: "roleName",
+ },
+ {
+ label: "鐘舵��", prop: "state", dataType: "tag",
+ formatData: (params) => {
+ let index = this.stateList.findIndex(
+ (item) => item.value == params
+ );
+ if (index > -1) {
+ return this.stateList[index].label;
+ } else {
+ return null;
+ }
+ },
+ formatType: (params) => {
+ let index = this.stateList.findIndex(
+ (item) => item.value == params
+ );
+ if (index > -1) {
+ return this.stateList[index].type;
+ } else {
+ return null;
+ }
+ },
+ },
+ { label: "鐢佃瘽鍙风爜", prop: "phone" },
+ ],
+ personPage: {
+ total: 0,
+ size: 10,
+ current: 0,
+ },
+ tableLoading: false,
+ };
+ },
+ mounted() {
+ this.refreshTable();
+ },
+ // 鏂规硶闆嗗悎
+ methods: {
+ synchronous() {
+ console.log('departId', this.departId);
+ this.$message.warning("姝e湪鍚屾锛岃绋嶅悗...")
+ this.synchronousLoading = true
+ getEmployees({ departId: this.departId }).then(res => {
+ this.synchronousLoading = false
+ this.$message.success("鍚屾鎴愬姛")
+ })
+ },
+ /**
+ * @desc 鑾峰彇璁惧id
+ */
+ // 閲嶇疆
+ refresh() {
+ this.page = {
+ size: 20,
+ current: 1,
+ };
+ this.entity.name = ''
+ this.refreshTable();
+ },
+ // 鏌ヨ浜哄憳鍒楄〃鏁版嵁
+ refreshTable(entity, type) {
+ try {
+ this.tableLoading = true;
+ this.entity.departmentId = this.departId;
+ let params = { ...this.page, ...this.entity }
+ delete params.total
+ basicInformationOfPersonnelSelectPage(params).then(res => {
+ this.tableLoading = false;
+ if (res.code === 201) {
+ return;
+ }
+ this.page.total = res.data.total;
+ this.tableData = res.data.records;
+ });
+ } catch (e) {
+ this.tableLoading = false;
+ }
+ },
+ // 鍒犻櫎浜哄憳
+ deletePerson(row) {
+ this.$confirm('鏄惁鍒犻櫎褰撳墠鏁版嵁?', '璀﹀憡', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ })
+ .then(() => {
+ delUserDepardLimsId({ id: row.id }).then(res => {
+ if (res.code === 201) {
+ return;
+ }
+ this.$message.success('鍒犻櫎鎴愬姛');
+ this.refreshTable();
+ })
+ .catch(e => {
+ this.$message.error('鍒犻櫎澶辫触');
+ });
+ })
+ .catch(() => {
+ });
+ },
+ handleSizeChange(val) {
+ this.page.size = val;
+ this.refreshTable();
+ },
+ handleCurrentChange(val) {
+ this.page.current = val;
+ this.refreshTable();
+ },
+ handleSelectionChange(val) {
+ this.multipleSelection = val
+ },
+ selectUser() {
+ if (!this.currentCompaniesList.length > 0) {
+ this.$message.warning("璇烽�夋嫨閮ㄩ棬锛�")
+ return;
+ }
+ let selects = this.multipleSelection;
+ if (selects.length == 0) {
+ this.$message.error('鏈�夋嫨鏁版嵁');
+ return;
+ }
+ let ids = [];
+ selects.forEach(a => {
+ ids.push(a.id);
+ });
+ let str = '';
+ this.currentCompaniesList.forEach(a => {
+ if (a) {
+ str += a + ',';
+ }
+ });
+ this.selectUserDia = false;
+ upUserDepardLimsId({
+ ids: JSON.stringify(ids),
+ id: str
+ }).then(res => {
+ if (res.code === 201) {
+ return;
+ }
+ this.$message.success('娣诲姞鎴愬姛');
+ this.refreshTable();
+ });
+ this.$emit('refreshTree')
+ },
+ getList() {
+ this.tableLoading = true;
+ let param = { ...this.queryParams, ...this.personPage };
+ delete param.total;
+ selectUserList({ ...param })
+ .then((res) => {
+ this.tableLoading = false;
+ if (res.code === 200) {
+ this.personTableData = res.data;
+ }
+ })
+ .catch((err) => {
+ this.tableLoading = false;
+ });
+ },
+ pagination({ page, limit }) {
+ this.personPage.current = page;
+ this.personPage.size = limit;
+ this.getList();
+ },
+ handleDown() {
+ this.outLoading = true;
+ let entity = this.HaveJson(this.entity)
+ exportPersonBasicInfo(entity).then(res => {
+ this.outLoading = false;
+ if (res.code === 201) {
+ return;
+ }
+ const blob = new Blob([res], { type: 'application/octet-stream' });
+ this.$download.saveAs(blob, '浜哄憳淇℃伅.xlsx')
+ });
+ },
+ downPerson(row) {
+ exportPersonBasicInfoById({ id: row.userId }).then(res => {
+ this.$download.saveAs(res.data, res.data)
+ this.$message.success('涓嬭浇鎴愬姛')
+ });
+ }
+ },
+ watch: {
+ departId: {
+ handler(newId, oldId) {
+ if (newId) {
+ this.page.current = 1
+ this.refreshTable();
+ }
+ }
+ }
+ }
+};
+</script>
+
+<style scoped>
+.search-list {
+ padding: 0 16px 16px;
+ display: flex;
+ justify-content: space-between;
+}
+
+.search-table {
+ padding: 0 16px;
+}
+
+.search-input {
+ display: flex;
+}
+
+.search-label {
+ display: flex;
+}
+</style>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelTraining/AddInDetail.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelTraining/AddInDetail.vue
new file mode 100644
index 0000000..38bb4b4
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelTraining/AddInDetail.vue
@@ -0,0 +1,319 @@
+<template>
+ <div>
+ <el-dialog :visible.sync="addTrainingPlanDia" :show="currshowlist" @close="$emit('update:currshowlist', false)"
+ title="鏂板鍩硅璁″垝" width="50%">
+ <div class="body">
+ <el-form ref="trainingPlan" :model="trainingPlan" label-position="right" label-width="90px"
+ :rules="trainingPlanRules">
+ <el-row>
+ <el-col :span="12">
+ <!-- <el-form-item label="鍩硅鏃ユ湡:" prop="trainingDate">
+ <el-date-picker v-model="trainingPlan.trainingDate" format="yyyy-MM-dd"
+ placeholder="閫夋嫨鏃ユ湡" size="small" value-format="yyyy-MM-dd"
+ type="date" style="width: 100%"></el-date-picker>
+ </el-form-item> -->
+ <el-form-item label="鍩硅鏈堜唤:" prop="trainingDate">
+ <el-select v-model="trainingPlan.trainingDate">
+ <el-option v-for="(v, i) in months" :key="i" :label="v.label" :value="v.value"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍩硅鏃ユ湡:" prop="trainingDateTwo">
+ <el-date-picker v-model="trainingPlan.trainingDateTwo" type="date" value-format="yyyy-MM-dd"
+ placeholder="閫夋嫨鏃ユ湡">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="寮�濮嬫椂闂�:" prop="openingTime">
+ <el-time-picker v-model="trainingPlan.openingTime" placeholder="閫夋嫨鏃堕棿" size="small" style="width: 100%"
+ value-format="HH:mm:ss"></el-time-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="缁撴潫鏃堕棿:" prop="endTime">
+ <el-time-picker v-model="trainingPlan.endTime" placeholder="閫夋嫨鏃堕棿" size="small" style="width: 100%"
+ value-format="HH:mm:ss"></el-time-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍩硅鐩爣:">
+ <el-input v-model="trainingPlan.trainingObjectives" placeholder="璇疯緭鍏�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍙傚姞瀵硅薄:">
+ <el-input v-model="trainingPlan.participants" placeholder="璇疯緭鍏�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍩硅鍐呭:" prop="trainingContent">
+ <el-input v-model="trainingPlan.trainingContent" placeholder="璇疯緭鍏�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍩硅璁插笀:" prop="trainingLecturerId">
+ <el-select v-model="trainingPlan.trainingLecturerId" multiple clearable filterable placeholder="璇烽�夋嫨"
+ size="small" style="width: 100%">
+ <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璇鹃瀛﹀垎:">
+ <el-input type="number" v-model="trainingPlan.projectCredits" label="鎻忚堪鏂囧瓧" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍩硅鍦扮偣:">
+ <el-input v-model="trainingPlan.placeTraining" placeholder="璇疯緭鍏�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍩硅鏂瑰紡:">
+ <el-input v-model="trainingPlan.trainingMode" placeholder="璇疯緭鍏�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="涓惧姙閮ㄩ棬:">
+ <el-select v-model="trainingPlan.holdingDepartment" placeholder="璇烽�夋嫨">
+ <el-option v-for="(v, i) in departLims" :key="i" :label="v.name" :value="v.id"></el-option>
+ </el-select>
+ <!--
+ <el-input
+ v-model="trainingPlan.holdingDepartment"
+ placeholder="璇疯緭鍏�"
+ size="small"
+ ></el-input> -->
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璇炬椂:">
+ <el-input type="number" v-model="trainingPlan.classHour" label="鎻忚堪鏂囧瓧" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="closeAdd">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitAdd">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import {
+ selectDepartLims,
+ addOrUpdatePersonTrainingDetailed,
+} from '@/api/cnas/personnel/personnelInfo.js'
+import { selectUserCondition } from "@/api/system/user";
+export default {
+ props: {
+ currshowlist: {
+ type: Boolean,
+ default: false,
+ },
+ currentChangeRow: {
+ type: Object,
+ default: () => {
+ return {};
+ },
+ },
+ },
+ name: "Add",
+ // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+ components: {},
+ data() {
+ var trainingLecturerIdValidate = (rule, value, callback) => {
+ if (typeof value !== "undefined" && value.length == 0) {
+ callback(new Error("璇烽�夋嫨璁插笀"));
+ } else {
+ callback();
+ }
+ };
+ // 杩欓噷瀛樻斁鏁版嵁
+ return {
+ departLims: [],
+ months: [
+ { label: "1鏈�", value: "1鏈�" },
+ { label: "2鏈�", value: "2鏈�" },
+ { label: "3鏈�", value: "3鏈�" },
+ { label: "4鏈�", value: "4鏈�" },
+ { label: "5鏈�", value: "5鏈�" },
+ { label: "6鏈�", value: "6鏈�" },
+ { label: "7鏈�", value: "7鏈�" },
+ { label: "8鏈�", value: "8鏈�" },
+ { label: "9鏈�", value: "9鏈�" },
+ { label: "10鏈�", value: "10鏈�" },
+ { label: "11鏈�", value: "11鏈�" },
+ { label: "12鏈�", value: "12鏈�" },
+ ],
+ addTrainingPlanDia: false,
+ trainingPlan: {
+ id: "",
+ planId: "",
+ trainingDate: "",
+ trainingDateTwo: "",
+ classHour: "",
+ openingTime: "",
+ endTime: "",
+ trainingObjectives: "",
+ participants: "",
+ trainingContent: "",
+ trainingLecturerId: undefined,
+ projectCredits: "",
+ placeTraining: "",
+ trainingMode: "",
+ holdingDepartment: "",
+ },
+ trainingPlanRules: {
+ trainingDate: [
+ { required: true, message: "璇烽�夋嫨鍩硅鏃ユ湡", trigger: "change" },
+ ],
+ trainingDateTwo: [
+ { required: true, message: "璇烽�夋嫨鍩硅鏃ユ湡", trigger: "change" },
+ ],
+ openingTime: [
+ { required: true, message: "璇烽�夋嫨寮�濮嬫椂闂�", trigger: "change" },
+ ],
+ endTime: [
+ { required: true, message: "璇烽�夋嫨缁撴潫鏃堕棿", trigger: "change" },
+ ],
+ trainingContent: [
+ { required: true, message: "璇疯緭鍏ュ煿璁唴瀹�", trigger: "blur" },
+ ],
+ trainingLecturerId: [
+ {
+ required: true,
+ validator: trainingLecturerIdValidate,
+ trigger: "change",
+ },
+ ],
+ },
+ responsibleOptions: [],
+ };
+ },
+ created() {
+ this.departLims = [];
+ selectDepartLims().then((res) => {
+ this.departLims = res.data;
+ });
+ },
+ // 鏂规硶闆嗗悎
+ methods: {
+ showDialog(id) {
+ this.trainingPlan.planId = id;
+ this.getUserList();
+ // this.addTrainingPlanDia = true;
+ },
+ showEditDialog(row) {
+ this.getUserList();
+ let data = JSON.parse(JSON.stringify(row));
+
+ console.log(data.trainingLecturerId);
+ let list = data.trainingLecturerId.split(/銆亅锛寍,|\\s+/);
+ this.$set(this.trainingPlan, "trainingLecturerId", list);
+ this.$set(this.trainingPlan, "id", data.id);
+ this.$set(this.trainingPlan, "trainingDate", data.trainingDate);
+ this.$set(this.trainingPlan, "trainingDateTwo", data.trainingDateTwo);
+ this.$set(this.trainingPlan, "classHour", data.classHour);
+ this.$set(this.trainingPlan, "openingTime", data.openingTime);
+ this.$set(this.trainingPlan, "endTime", data.endTime);
+ this.$set(
+ this.trainingPlan,
+ "trainingObjectives",
+ data.trainingObjectives
+ );
+ this.$set(this.trainingPlan, "participants", data.participants);
+ this.$set(this.trainingPlan, "projectCredits", data.projectCredits);
+ this.$set(this.trainingPlan, "placeTraining", data.placeTraining);
+ this.$set(this.trainingPlan, "trainingContent", data.trainingContent);
+ this.$set(this.trainingPlan, "trainingMode", data.trainingMode);
+ this.$set(this.trainingPlan, "holdingDepartment", data.holdingDepartment);
+ this.$set(this.trainingPlan, "planId", data.planId);
+
+ console.log("222", this.trainingPlan);
+ },
+ // 鎻愪氦鏂板
+ submitAdd() {
+ this.$refs.trainingPlan.validate((valid) => {
+ if (valid) {
+ // 灏嗗煿璁甯堝�煎皝瑁�
+ this.trainingPlan.trainingLecturerId =
+ this.trainingPlan.trainingLecturerId.join(",");
+ console.log(
+ "this.trainingPlan.trainingLecturerId",
+ this.trainingPlan.trainingLecturerId
+ );
+ const personTrainingDetailed = this.trainingPlan;
+ console.log("personTrainingDetailed", personTrainingDetailed);
+ addOrUpdatePersonTrainingDetailed(personTrainingDetailed).then((res) => {
+ if (res.code == 200) {
+ this.$message.success("鎻愪氦鎴愬姛");
+ this.closeAdd();
+ this.dialogVisible = false;
+ }
+ });
+ }
+ });
+ },
+ // 鍏抽棴寮规
+ closeAdd() {
+ this.$refs.trainingPlan.resetFields();
+ this.$emit("search");
+ this.$emit("searchPlan");
+ this.addTrainingPlanDia = false;
+ },
+ // 鑾峰彇璐熻矗浜轰俊鎭帴鍙�
+ getUserList() {
+ selectUserCondition().then((res) => {
+ if (res.code == 200) {
+ this.responsibleOptions = res.data;
+ }
+ });
+ },
+ },
+ watch: {
+ // addTrainingPlanDia(newVal) {
+ // if (newVal) {
+ // this.trainingPlan.planId = null;
+ // }
+ // },
+ currshowlist(newValue) {
+ this.addTrainingPlanDia = this.currshowlist;
+ if (!newValue) {
+ this.closeAdd();
+ this.trainingPlan = {
+ id: "",
+ planId: "",
+ trainingDate: "",
+ classHour: "",
+ openingTime: "",
+ endTime: "",
+ trainingObjectives: "",
+ participants: "",
+ trainingContent: "",
+ trainingLecturerId: undefined,
+ projectCredits: "",
+ placeTraining: "",
+ trainingMode: "",
+ holdingDepartment: "",
+ };
+ }
+ if (this.currshowlist) {
+ this.$nextTick(() => {
+ if (this.trainingPlan.trainingLecturerId.length == 0) {
+ this.trainingPlan.trainingLecturerId = undefined;
+ }
+ });
+ }
+ },
+ },
+};
+</script>
+
+<style scoped></style>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelTraining/Edit.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelTraining/Edit.vue
new file mode 100644
index 0000000..b880fd0
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelTraining/Edit.vue
@@ -0,0 +1,662 @@
+<template>
+ <div>
+ <div class="page-header">
+ <h4><span class="line"></span><span>鍩硅涓庤�冩牳璁板綍</span></h4>
+ <div class="btns">
+ <el-button size="small" type="primary" @click="submitForm" :disabled="![1, 4].includes(currentRow.state)">{{
+ currentRow.assessmentUserId ? '淇濆瓨' : '鎻愪氦' }}</el-button>
+ <el-button size="small" @click="$emit('goBack')">杩斿洖</el-button>
+ </div>
+ </div>
+ <div class="form_title">
+ <el-row>
+ <el-col :span="5">
+ <span class="form_label">璇剧▼缂栧彿锛�</span>
+ <span> {{ trainingForm.courseCode }} </span>
+ </el-col>
+ <el-col :span="6">
+ <span class="form_label">鍩硅鍐呭锛�</span>
+ <span> {{ trainingForm.trainingContent }} </span>
+ </el-col>
+ <el-col :span="4">
+ <span class="form_label">鐘舵�侊細</span>
+ <el-tag v-if="trainingForm.state === 1" type="success">宸插畬鎴�</el-tag>
+ <el-tag v-if="trainingForm.state === 2" type="warning">杩涜涓�</el-tag>
+ <el-tag v-if="trainingForm.state === 3" type="primary">鏈紑濮�</el-tag>
+ <el-tag v-if="trainingForm.state === 4" type="info">宸茬粨鏉�</el-tag>
+ </el-col>
+ <el-col :span="4">
+ <span class="form_label">鍩硅璁插笀锛�</span>
+ <span> {{ trainingForm.trainingLecturerId }} </span>
+ </el-col>
+ <el-col :span="4">
+ <span class="form_label">鍩硅鏃ユ湡锛�</span>
+ <span> {{ trainingForm.trainingDate }} </span>
+ </el-col>
+ </el-row>
+ <el-row style="margin: 15px 0">
+ <el-form>
+ <el-col :span="12">
+ <el-form-item label="鑰冩牳鏂瑰紡">
+ <el-input v-model="trainingForm.assessmentMethod"
+ :disabled="currentRow.state == 1 || currentRow.assessmentUserId" :rows="2" placeholder="璇疯緭鍏�"
+ size="small" style="width: 79%" type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鏈鍩硅缁煎悎璇勪环">
+ <el-input v-model="trainingForm.comprehensiveAssessment"
+ :disabled="currentRow.state == 1 || ((currentRow.assessmentUserId !== user.userId) && ![35, 16, 36].includes(user.userId)) || !currentRow.assessmentUserId"
+ :rows="2" placeholder="璇疯緭鍏�" size="small" style="width: 68%" type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璇勪环浜�">
+ <el-select v-model="trainingForm.assessmentUserId"
+ :disabled="currentRow.state == 1 || currentRow.assessmentUserId" placeholder="璇烽�夋嫨" size="small"
+ style="width: 68%">
+ <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璇勪环鏃堕棿">
+ <el-date-picker v-model="trainingForm.assessmentDate"
+ :disabled="currentRow.state == 1 || ((currentRow.assessmentUserId !== user.userId) && ![35, 16, 36].includes(user.userId)) || !currentRow.assessmentUserId"
+ style="width:40%" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" size="small"
+ placeholder="閫夋嫨鏃ユ湡">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍩硅鎽樿">
+ <el-input v-model="trainingForm.trainingAbstract"
+ :disabled="currentRow.state == 1 || currentRow.assessmentUserId" :rows="2" placeholder="璇疯緭鍏�"
+ size="small" style="width: 79%" type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item>
+ <!-- <el-upload
+ ref="upload"
+ :action="action"
+ :before-upload="beforeUpload"
+ :on-error="onError"
+ :data="uploadData"
+ :headers="uploadHeader"
+ :on-success="attachmentUpload"
+ >
+ <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
+ </el-upload> -->
+ <el-button type="primary" size="small" @click="attachmentFrame = true">闄勪欢</el-button>
+ </el-form-item>
+ </el-col>
+ <!-- <el-col :span="12" :offset="12">
+ <el-image
+ v-if="currentRow.url"
+ style="width: 70%; height: 100px"
+ :src="javaApi + '/img/' + currentRow.url">
+ </el-image>
+ </el-col> -->
+ </el-form>
+ </el-row>
+ </div>
+ <!-- 鏂囦欢棰勮 -->
+ <el-dialog :visible.sync="lookDialogVisible" fullscreen title="鏌ョ湅闄勪欢" width="800px">
+ <filePreview v-if="lookDialogVisible" :currentFile="{}" :fileUrl="previewFile"
+ style="height: 90vh;overflow-y: auto;top: 0" />
+ </el-dialog>
+ <!-- 闄勪欢寮规 -->
+ <el-dialog title="闄勪欢" :visible.sync="attachmentFrame" width="70%" border :before-close="handleClose">
+ <el-upload ref="upload" :action="action" :before-upload="beforeUpload" :on-error="onError" :data="uploadData"
+ :headers="uploadHeader" :on-success="attachmentUpload" style="margin-bottom: 10px">
+ <el-button size="small" type="primary" :disabled="currentRow.state == 1">涓婁紶闄勪欢</el-button>
+ </el-upload>
+ <el-table ref="fileData" :data="fileData" height="400px">
+ <el-table-column label="搴忓彿" type="index" width="100" header-align="center" align="center">
+ </el-table-column>
+ <el-table-column label="鏂囦欢鍚嶇О" prop="fileName" header-align="center" align="center">
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" fixed="right" width="200px" header-align="center" align="center">
+ <template slot-scope="scope">
+ <el-button type="text" size="small" @click="preview(scope.row)">棰勮</el-button>
+ <el-button type="text" size="small" @click="download(scope.row)">涓嬭浇</el-button>
+ <el-button type="text" style="color: red;" size="small" @click="deleteFile(scope.row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="attachmentFrame = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="attachmentFrame = false">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+
+
+ <el-divider>浜哄憳璇︽儏</el-divider>
+ <div>
+ <div class="items_center">
+ <span>濮撳悕</span>
+ <el-input v-model="userName" class="search" placeholder="璇疯緭鍏�" size="small"></el-input>
+ <el-button size="small" type="primary" @click="getInfo">鏌ヨ</el-button>
+ </div>
+ <div class="items_btn">
+ <el-button :disabled="currentRow.state === 1" size="small" type="primary" @click="addPerson">鏂板浜哄憳</el-button>
+ <el-button :disabled="currentRow.state === 1" size="small" @click="batchDelete">鎵归噺鍒犻櫎</el-button>
+ </div>
+ <el-table :data="trainingTableData" height="calc(100vh - 30em)" stripe style="width: 100%"
+ @selection-change="handleSelectionChange">
+ <el-table-column type="selection" width="55"></el-table-column>
+ <el-table-column label="搴忓彿" type="index" width="60"></el-table-column>
+ <el-table-column label="濮撳悕" prop="userName"></el-table-column>
+ <el-table-column label="宸ュ彿" prop="account"></el-table-column>
+ <el-table-column label="瑙掕壊" prop="roleName"></el-table-column>
+ <el-table-column label="鐢佃瘽鍙风爜" prop="phone"></el-table-column>
+ <el-table-column label="鑰冩牳缁撴灉" prop="examinationResults">
+ <template v-slot="scope">
+ <el-select v-model="scope.row.examinationResults" :disabled="currentRow.state === 1" size="small"
+ style="width: 100%" @change="updatePersonResult(scope.row)">
+ <el-option label="鍚堟牸" value="鍚堟牸"></el-option>
+ <el-option label="涓嶅悎鏍�" value="涓嶅悎鏍�"></el-option>
+ </el-select>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ <el-dialog :visible.sync="selectUserDia" title="閫夋嫨鐢ㄦ埛" width="70%">
+ <div class="search" style="margin-bottom: 9px;">
+ <div class="search_thing">
+ <div class="search_label">鐢ㄦ埛鍚嶏細</div>
+ <div class="search_input">
+ <el-input v-model="queryParams.name" clearable placeholder="璇疯緭鍏�" size="small"
+ @keyup.enter.native="$refs.ValueTable.selectList()"></el-input>
+ </div>
+ </div>
+ </div>
+ <div v-if="selectUserDia" class="body" style="height: 60vh;">
+ <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 290px)'"
+ :page="page" @pagination="pagination" :isSelection="true"
+ :handleSelectionChange="handleSelectionChange"></lims-table>
+ <!-- <ValueTable ref="ValueTable" :componentData="addUserTableInfo" :isSelectedList="isSelectedList"
+ :url="$api.user.selectUserList" /> -->
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="selectUserDia = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="selectUser">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import TableCard from '@/components/TableCard/index.vue';
+import limsTable from "@/components/Table/lims-table.vue";
+// import ValueTable from '@/components/Table/value-table.vue';
+import filePreview from "@/components/Preview/filePreview.vue";
+import {
+ fileDownLoad,
+ deleteFile,
+ getFileData,
+ trainingAndAssessmentRecordsPage,
+ outOfFocusPreservation,
+ newPersonnelAddedToTrainingRecords,
+ deleteTrainingAndAssessmentRecords,
+ trainingAndAssessmentRecordsAdded,
+ selectUserList,
+} from '@/api/cnas/personnel/personnelInfo.js'
+import { selectUserCondition } from "@/api/system/user";
+import { mapGetters } from "vuex";
+export default {
+ name: 'Edit',
+ // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+ components: { limsTable, TableCard, filePreview },
+ props: {
+ currentRow: {
+ type: Object,
+ default: () => {
+ return {}
+ }
+ },
+ },
+ data() {
+ // 杩欓噷瀛樻斁鏁版嵁
+ return {
+ previewFile: '',
+ lookDialogVisible: false,
+ user: {},
+ fileData: [],
+ attachmentFrame: false,
+ isSelectedList: [], // 绂佺敤鐨勫閫�
+ userName: undefined,
+ trainingForm: {
+ code: '111111',
+ date: '2024-10-10',
+ },
+ uploadData: {},
+ trainingColumn: [
+ {
+ label: '濮撳悕',
+ prop: 'userName'
+ },
+ {
+ label: '宸ュ彿',
+ prop: 'account'
+ },
+ {
+ label: '瑙掕壊',
+ prop: 'roleName'
+ },
+ {
+ label: '鐢佃瘽鍙风爜',
+ prop: 'phone'
+ },
+ {
+ label: '鑰冩牳缁撴灉',
+ prop: 'result'
+ }
+ ],
+ trainingTableData: [],
+ trainingLoading: false,
+ selectUserDia: false, // 娣诲姞浜哄憳寮规
+ addUserTableInfo: {
+ name: null,
+ entity: {
+ departLimsId: '1',
+ orderBy: {
+ field: 'id',
+ order: 'asc'
+ }
+ },
+ isIndex: true,
+ showSelect: true,
+ select: true,
+ do: [],
+ tagField: {
+ state: {
+ select: [
+ {
+ value: 1,
+ type: 'success',
+ label: '鍚敤'
+ },
+ {
+ value: 0,
+ type: 'danger',
+ label: '鍋滅敤'
+ }
+ ]
+ }
+ },
+ selectField: {},
+ upUserDepardLimsIdPower: true
+ },
+ multipleSelection: [],
+ multipleSelections: [],
+ userList: [],
+ stateList: [
+ {
+ value: 1,
+ type: 'success',
+ label: '鍚敤'
+ },
+ {
+ value: 0,
+ type: 'danger',
+ label: '鍋滅敤'
+ }
+ ],
+ queryParams: {},
+ tableData: [],
+ column: [
+ { label: "濮撳悕", prop: "name" },
+ { label: "璐﹀彿", prop: "account" },
+ {
+ label: "瑙掕壊",
+ prop: "roleName",
+ },
+ {
+ label: "鐘舵��", prop: "state", dataType: "tag",
+ formatData: (params) => {
+ let index = this.stateList.findIndex(
+ (item) => item.value == params
+ );
+ if (index > -1) {
+ return this.stateList[index].label;
+ } else {
+ return null;
+ }
+ },
+ formatType: (params) => {
+ let index = this.stateList.findIndex(
+ (item) => item.value == params
+ );
+ if (index > -1) {
+ return this.stateList[index].type;
+ } else {
+ return null;
+ }
+ },
+ },
+ { label: "鐢佃瘽鍙风爜", prop: "phone" },
+ ],
+ page: {
+ total: 0,
+ size: 10,
+ current: 0,
+ },
+ tableLoading: false,
+ };
+ },
+ computed: {
+ action() {
+ return this.javaApi + '/personTraining/fileUpload';
+ },
+ ...mapGetters(["userId"]),
+ },
+ mounted() {
+ this.trainingForm = JSON.parse(JSON.stringify(this.currentRow))
+ this.getInfo()
+ this.getUserList()
+ this.getFileData(this.trainingForm.id)
+ // 鑾峰彇褰撳墠鐧诲綍浜轰俊鎭�
+ this.loginPerson();
+ },
+ // 鏂规硶闆嗗悎
+ methods: {
+ // 闄勪欢棰勮
+ preview(row) {
+ let folder = '';
+ if (row.fileUrl.includes('xls')) {
+ folder = 'excel'
+ } else if (row.fileUrl.includes('docx')) {
+ folder = 'word'
+ } else {
+ folder = 'img'
+ }
+ this.previewFile = this.javaApi + folder + row.fileUrl
+ this.$nextTick(() => {
+ this.lookDialogVisible = true
+ })
+ },
+ // 涓嬭浇
+ download(row) {
+ fileDownLoad({ id: row.id }).then(res => {
+ console.log('2123');
+ const blob = new Blob([res], { type: row.mime });
+ this.$download.saveAs(blob, row.fileName)
+ })
+ },
+
+ // 鍒犻櫎
+ deleteFile(row) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ枃浠�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deleteFile({ id: row.id }).then(res => {
+ this.$message({
+ type: 'success',
+ message: '鍒犻櫎鎴愬姛!'
+ });
+ this.getFileData(this.trainingForm.id);
+ })
+ })
+
+ },
+ // 鏌ヨ
+ getFileData(id) {
+ getFileData({ detailedId: id }).then(res => {
+ this.fileData = res.data
+ })
+ },
+ // 闄勪欢涓婁紶 鎴愬姛鐨勯挬瀛�
+ attachmentUpload(res, file, fileList) {
+ // 缁欏浘鐗囪矾寰勮祴鍊�
+ this.$message.success('涓婁紶鎴愬姛')
+ this.currentRow.url = res.data.url
+ this.$refs.upload.clearFiles();
+ this.getFileData(this.trainingForm.id);
+ },
+ // 澶辫触鐨勯挬瀛�
+ onError(err, file, fileList) {
+ this.$message.error('涓婁紶澶辫触')
+ },
+ // 涓婁紶鍓嶇殑閽╁瓙
+ beforeUpload(file) {
+ // 缁欎紶閫掔殑鍙傛暟璧嬪��
+ this.$set(this.uploadData, "id", this.currentRow.id)
+ },
+ // 褰撳墠鐧诲綍浜轰俊鎭�
+ loginPerson() {
+ this.user = {
+ userId: this.userId
+ }
+ },
+ // 鑾峰彇褰撳墠鏁版嵁
+ async getInfo() {
+ this.trainingLoading = true
+ trainingAndAssessmentRecordsPage({
+ trainingDetailedId: this.currentRow.id,
+ userName: this.userName
+ }).then(res => {
+ if (res.code === 200) {
+ this.trainingTableData = res.data
+ }
+ this.trainingLoading = false
+ })
+ },
+ async updatePersonResult(row) {
+ const { code } = await outOfFocusPreservation(row)
+ if (code === 200) {
+ this.$message.success("鎿嶄綔鎴愬姛锛�")
+ }
+ },
+ getList() {
+ this.tableLoading = true;
+ let param = { ...this.queryParams, ...this.page };
+ delete param.total;
+ selectUserList({ ...param })
+ .then((res) => {
+ this.tableLoading = false;
+ if (res.code === 200) {
+ this.tableData = res.data.records;
+ this.page.total = res.data.total;
+ }
+ })
+ .catch((err) => {
+ this.tableLoading = false;
+ });
+ },
+ pagination({ page, limit }) {
+ this.page.current = page;
+ this.page.size = limit;
+ this.getList();
+ },
+ handleSelectionChange(val) {
+ this.multipleSelections = val
+ },
+ addPerson() {
+ this.isSelectedList = this.trainingTableData.map(item => item.userId)
+ this.getList()
+ this.selectUserDia = true;
+ },
+ selectUser() {
+ let selects = this.multipleSelections;
+ if (selects.length == 0) {
+ this.$message.error('鏈�夋嫨鏁版嵁');
+ return;
+ }
+ let list = []
+ selects.forEach(a => {
+ const obj = {
+ courseId: this.currentRow.id,
+ examinationResults: "",
+ userId: a.id
+ }
+ list.push(obj)
+ // this.trainingTableData.push(obj);
+ });
+ newPersonnelAddedToTrainingRecords(list).then(res => {
+ this.isSelectedList = []
+ this.selectUserDia = false;
+ this.getInfo()
+ })
+ },
+ // 鎵归噺鍒犻櫎
+ handleSelectionChange(list) {
+ this.multipleSelection = list
+ },
+ batchDelete() {
+ console.log('鎵归噺鍒犻櫎', this.multipleSelection)
+ if (this.multipleSelection.length > 0) {
+ let ids = this.multipleSelection.map(item => item.trainingRecordId)
+ this.$confirm('鏄惁纭鍒犻櫎鎵�閫夋嫨鐨勬暟鎹�?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ let formData = new FormData()
+ formData.append('ids', ids)
+ deleteTrainingAndAssessmentRecords(formData)
+ .then(res => {
+ if (res.code == 200) {
+ this.$message.success('鍒犻櫎鎴愬姛');
+ this.getInfo()
+ }
+ });
+ }).catch(() => {
+ this.$message.warning('鍙栨秷鍒犻櫎');
+ });
+ } else {
+ this.$message.warning('璇烽�夋嫨闇�瑕佸垹闄ょ殑鏁版嵁')
+ }
+ },
+ handleSizeChange(val) {
+ this.search.size = val;
+ this.getInfo();
+ },
+ handleCurrentChange(val) {
+ this.search.current = val;
+ this.getInfo();
+ },
+ /**
+ * @desc 鎻愪氦琛ㄥ崟
+ */
+ async submitForm() {
+ console.log('this.currentRow.state', this.currentRow.state);
+ if (this.currentRow.state !== 4 && this.currentRow.state !== 1) {
+ this.$message.warning("褰撳墠鐘舵�佹棤娉曟彁浜�/鎾ら攢锛�")
+ return
+ }
+ // 濡傛灉绛変簬4 琛ㄧず璇ョ姸鎬佷负宸茬粨鏉燂紝1 琛ㄧず宸插畬鎴�
+ let state = 4
+ if (this.currentRow.assessmentUserId == this.user.userId) {
+ state = 1
+ }
+ let data = {
+ assessmentMethod: this.trainingForm.assessmentMethod,
+ comprehensiveAssessment: this.trainingForm.comprehensiveAssessment,
+ trainingDetailedId: this.trainingForm.id,
+ assessmentUserId: this.currentRow.assessmentUserId ? this.currentRow.assessmentUserId : this.trainingForm.assessmentUserId,
+ assessmentDate: this.trainingForm.assessmentDate,
+ state: state,
+ trainingAbstract: this.trainingForm.trainingAbstract
+ }
+ const { code } = await trainingAndAssessmentRecordsAdded(data)
+ if (code === 200) {
+ this.currentRow.state = state
+ this.$message.success("鎿嶄綔鎴愬姛")
+ // this.$emit('refresh',this.currentRow.id)
+ }
+ },
+ getUserList() {
+ selectUserCondition().then(res => {
+ if (res.code === 201) {
+ return
+ }
+ this.userList = res.data
+ })
+ },
+ handleClose() {
+ this.attachmentFrame = false;
+ },
+ }
+};
+</script>
+
+<style scoped>
+.page-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 0 20px;
+ margin-bottom: 10px;
+}
+
+h4 {
+ display: flex;
+ align-items: center;
+}
+
+h4 .line {
+ display: inline-block;
+ width: 3px;
+ height: 16px;
+ background: #3A7BFA;
+ margin-right: 4px;
+}
+
+.form_title {
+ font-size: 14px;
+ padding: 0 20px;
+ margin-bottom: 10px;
+}
+
+.el-divider {
+ margin: 0 1em 1em 0;
+}
+
+.form__input_label {
+ width: 90px;
+ margin-right: 6px;
+ color: #606266;
+}
+
+.form__input_label2 {
+ width: 210px;
+ margin-right: 6px;
+ color: #606266;
+}
+
+.search_thing {
+ display: flex;
+ align-items: center
+}
+
+.search_label {
+ width: 120px;
+}
+
+.pagination {
+ display: flex;
+ justify-content: space-between
+}
+
+.items_center {
+ float: left;
+ width: 50%;
+ text-align: left;
+}
+
+.items_btn {
+ text-align: right;
+ width: 50%;
+ float: right;
+ margin-bottom: 1em;
+}
+
+.search {
+ width: 180px;
+ padding: 0 16px;
+}
+</style>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelTraining/index.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelTraining/index.vue
new file mode 100644
index 0000000..9467953
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelTraining/index.vue
@@ -0,0 +1,1012 @@
+<!-- 浜哄憳鍩硅 -->
+<template>
+ <div class="flex_column">
+ <div v-if="!editPlanShow && isDepartment && flag">
+ <TableCard title="骞村害璁″垝琛�">
+ <template v-slot:form>
+ <div class="items_center">
+ <span>鍒涘缓浜�</span>
+ <el-input v-model="pagination.compilerName" class="search" placeholder="璇疯緭鍏�" size="mini"></el-input>
+ <el-button size="mini" type="primary" @click="getYearPlanList(departId)">鏌ヨ</el-button>
+ </div>
+ <div>
+ <el-button size="mini" type="primary" @click="uploadDia = true">瀵煎叆</el-button>
+ </div>
+ </template>
+ <template v-slot:table>
+ <limsTable :column="yearPlanColumn" :currentChange="currentChange" :height="'130'"
+ :table-data="yearPlanTableData" :table-loading="yearLoading" highlightCurrentRow style="padding: 0 15px"
+ :page="pagination" @pagination="paginationMetod">
+ </limsTable>
+ </template>
+ </TableCard>
+ </div>
+ <div v-if="!editPlanShow" class="table">
+ <TableCard title="骞村害璁″垝鏄庣粏琛�">
+ <template v-slot:form>
+ <div class="items_center">
+ <span>鍩硅璁插笀</span>
+ <el-input v-model="inDetailForm.trainingLecturerName" class="search" clearable placeholder="璇疯緭鍏�"
+ size="mini"></el-input>
+ <!-- <span>璇剧▼缂栧彿</span>
+ <el-input v-model="inDetailForm.courseCode" class="search" clearable placeholder="璇疯緭鍏�" size="small"></el-input> -->
+ <span style="margin-right: 4px">鍩硅鏃ユ湡</span>
+ <el-date-picker v-model="inDetailForm.trainingDate" clearable format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡"
+ size="mini" type="date" value-format="yyyy-MM-dd"></el-date-picker>
+ <el-button size="mini" style="margin-left: 10px" type="primary" @click="searchTable">鏌ヨ</el-button>
+ </div>
+ <div style="display: flex; align-items: center">
+ <el-button v-if="isDepartment && currentChangeRow && isOperation && flag" size="mini"
+ @click="batchDelete">鎵归噺鍒犻櫎</el-button>
+ <el-button v-if="isDepartment && currentChangeRow && isOperation && flag" size="mini" type="primary"
+ @click="addTrainingPlan">鏂板</el-button>
+ </div>
+ </template>
+ <template v-slot:table>
+ <el-tabs v-model="activeName" style="margin-left: 15px">
+ <el-tab-pane label="鏈煿璁�" name="first">
+ <limsTable :column="inDetailPlanColumn" :handleSelectionChange="handleSelectionChange"
+ :height="tableHeight + ''" :isSelection="true" :table-data="inDetailPlanTableData"
+ :table-loading="yearLoading" style="padding: 0 15px" :page="inDetailPagination"
+ @pagination="paginationmethod0">
+ </limsTable>
+ </el-tab-pane>
+ <el-tab-pane label="宸茬粨鏉�" name="second">
+ <limsTable :column="inDetailPlanColumn" :handleSelectionChange="handleSelectionChange"
+ :height="tableHeight + ''" :isSelection="true" :table-data="inDetailPlanTableData"
+ :table-loading="yearLoading" style="padding: 0 15px" :page="inDetailPagination"
+ @pagination="paginationmethod0">
+ </limsTable>
+ </el-tab-pane>
+ </el-tabs>
+ </template>
+ </TableCard>
+ </div>
+ <Add ref="addPlan" :currshowlist.sync="addInDetail" :currentChangeRow="currentChangeRow"
+ @search="getInDetailPlan(currentRowId, departId)" @searchPlan="refreshYearPlanList(departId2)"></Add>
+ <Edit v-if="editPlanShow" ref="editPlan" :currentRow="currentRow" :key="editKey" @refresh="refresh"
+ @del="getInDetailPlan(currentRowId, departId)" @goBack="goBack"></Edit>
+ <el-dialog :visible.sync="reviewDialog" title="瀹℃牳" width="30%" @close="reviewRemarks = ''">
+ <span>
+ 瀹℃牳澶囨敞锛�
+ <el-input v-model="reviewRemarks" type="textarea"></el-input>
+ </span>
+ <span slot="footer" class="dialog-footer">
+ <el-button :loading="reviewLoading" @click="handleReview(2)">涓嶉�氳繃</el-button>
+ <el-button :loading="reviewLoading" type="primary" @click="handleReview(1)">閫� 杩�</el-button>
+ </span>
+ </el-dialog>
+ <el-dialog :visible.sync="approvalDialog" title="鎵瑰噯" width="30%" @close="approvalRemarks = ''">
+ <span>
+ 鎵瑰噯澶囨敞锛�
+ <el-input v-model="approvalRemarks" type="textarea"></el-input>
+ </span>
+ <span slot="footer" class="dialog-footer">
+ <el-button :loading="approvalLoading" @click="handleApproval(2)">涓嶆壒鍑�</el-button>
+ <el-button :loading="reviewLoading" type="primary" @click="handleApproval(1)">鎵� 鍑�</el-button>
+ </span>
+ </el-dialog>
+ <el-dialog :visible.sync="uploadDia" title="鏁版嵁瀵煎叆" width="500px">
+ <div style="margin: 0 auto">
+ <el-upload ref="upload" :action="javaApi + '/personTraining/personTrainingImport'" :auto-upload="false"
+ :before-upload="beforeUpload" :file-list="fileList" :headers="uploadHeader" :limit="1" :on-error="onError"
+ :on-success="onSuccess" accept=".xlsx" drag name="file">
+ <i class="el-icon-upload"></i>
+ <div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
+ </el-upload>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="uploadDia = false">鍙� 娑�</el-button>
+ <el-button :loading="uploading" type="primary" @click="submitUpload()">涓� 浼�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import TableCard from '@/components/TableCard/index.vue';
+import limsTable from "@/components/Table/lims-table.vue";
+import Add from "./AddInDetail.vue";
+import Edit from "./Edit.vue";
+import {
+ deleteDetail,
+ personTrainingSelect,
+ queryTheAnnualPlanDetailsTable,
+ personTrainingDelete,
+ reviewAnnualPersonnelTraining,
+ approveAnnualPersonnelTraining,
+ exportPersonTrainingRecord,
+ claimOfTrainingAndAssessmentRecords,
+ exportPersonTraining,
+ deleteAnnualPlanDetailTable,
+} from '@/api/cnas/personnel/personnelInfo.js'
+
+export default {
+ name: "PersonnelTraining",
+ components: { Add, limsTable, TableCard, Edit },
+ props: {
+ flag: {
+ type: Boolean,
+ default: false,
+ },
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ },
+ },
+ isDepartment: {
+ type: Boolean,
+ default: false,
+ },
+ },
+ data() {
+ return {
+ currentPlanId: null,
+ activeName: "first",
+ addInDetail: false,
+ departId2: null,
+ editKey: 1,
+ search: {},
+ superviseForm: {},
+ inDetailForm: {
+ trainingLecturerName: "",
+ courseCode: "",
+ trainingDate: "",
+ },
+ yearLoading: false,
+ yearPlanTableData: [], // 骞村害璁″垝琛ㄦ暟鎹�
+ yearPlanColumn: [
+ {
+ label: "鏂囦欢鍚嶇О",
+ width: "160px",
+ minWidth: "160px",
+ prop: "fileName",
+ showOverflowTooltip: true,
+ },
+ {
+ label: "鍒涘缓鏃堕棿",
+ width: "160px",
+ prop: "createTime",
+ },
+ {
+ label: "鍒涘缓浜�",
+ prop: "createUserName",
+ },
+ {
+ label: "缂栧埗浜�",
+ prop: "compilerName",
+ },
+ {
+ label: "缂栧埗鏃ユ湡",
+ width: "160px",
+ prop: "compilationDate",
+ },
+ {
+ label: "瀹℃牳浜�",
+ prop: "reviewerName",
+ minWidth: "100px",
+ },
+ {
+ dataType: "tag",
+ label: "瀹℃牳鐘舵��",
+ prop: "reviewerStatus",
+ width: "100px",
+ formatData: (params) => {
+ if (params == 1) {
+ return "閫氳繃";
+ } else if (params == 2) {
+ return "涓嶉�氳繃";
+ } else {
+ return null;
+ }
+ },
+ formatType: (params) => {
+ if (params == 1) {
+ return "success";
+ } else if (params == 2) {
+ return "danger";
+ } else {
+ return null;
+ }
+ },
+ },
+ {
+ label: "瀹℃牳澶囨敞",
+ prop: "auditRemarks",
+ minWidth: "100px",
+ },
+ {
+ label: "瀹℃牳鏃ユ湡",
+ width: "160px",
+ prop: "auditDate",
+ },
+ {
+ label: "鎵瑰噯浜�",
+ prop: "approverName",
+ minWidth: "100px",
+ },
+ {
+ label: "鎵瑰噯澶囨敞",
+ prop: "approvalRemarks",
+ minWidth: "100px",
+ },
+ {
+ dataType: "tag",
+ label: "鎵瑰噯鐘舵��",
+ minWidth: "100px",
+ prop: "approvalStatus",
+ formatData: (params) => {
+ if (params == 1) {
+ return "鎵瑰噯";
+ } else if (params == 2) {
+ return "涓嶆壒鍑�";
+ } else {
+ return null;
+ }
+ },
+ formatType: (params) => {
+ if (params == 1) {
+ return "success";
+ } else if (params == 2) {
+ return "danger";
+ } else {
+ return null;
+ }
+ },
+ },
+ {
+ label: "鎵瑰噯鏃ユ湡",
+ width: "160px",
+ prop: "approvalDate",
+ },
+ {
+ dataType: "action",
+ width: "180px",
+ label: "鎿嶄綔",
+ fixed: "right",
+ operation: [
+ {
+ name: "瀵煎嚭",
+ type: "text",
+ disabled: (row) => {
+ if (row.approvalStatus === 1 && row.reviewerStatus === 1) {
+ return false;
+ } else {
+ return true;
+ }
+ },
+ clickFun: (row) => {
+ this.downLoadPost(row);
+ },
+ },
+ {
+ name: "瀹℃牳",
+ type: "text",
+ disabled: (row) => {
+ if (row.reviewerStatus === 1 || (row.departId == 18 && row.currentId != 10 && row.currentId != 16) || (row.departId == 19 && row.currentId != 35 && row.currentId != 16)) {
+ return true;
+ } else {
+ return false;
+ }
+ },
+ clickFun: (row) => {
+ this.handleCheck(row.id);
+ },
+ },
+ {
+ name: "鎵瑰噯",
+ type: "text",
+ disabled: (row) => {
+ if (row.approvalStatus === 1 || (row.currentId != 11 && row.currentId != 16)) {
+ return true;
+ } else {
+ return false;
+ }
+ },
+ clickFun: (row) => {
+ this.handleApprove(row.id);
+ },
+ },
+ {
+ name: "鍒犻櫎",
+ type: "text",
+ color: "#f56c6c",
+ clickFun: (row) => {
+ this.deleteFun(row.id);
+ },
+ },
+ ],
+ },
+ ],
+ inDetailPlanTableData: [], // 骞村害璁″垝鏄庣粏琛ㄨ〃鏁版嵁
+ inDetailPlanColumn: [
+ // {
+ // label: '璇剧▼缂栧彿',
+ // prop: 'courseCode',
+ // width: '130px',
+ // },
+ {
+ dataType: "tag",
+ label: "鎶ュ悕鐘舵��",
+ width: "100px",
+ prop: "whetherClaim",
+ isShow: this.flag,
+ formatData: (params) => {
+ if (params === true) {
+ return "宸叉姤鍚�";
+ } else {
+ return "鏈姤鍚�";
+ }
+ },
+ formatType: (params) => {
+ if (params === true) {
+ return "success";
+ } else {
+ return "info";
+ }
+ },
+ },
+ {
+ label: "鎶ュ悕浜烘暟",
+ prop: "enrollment",
+ width: "100px",
+ isShow: !this.flag,
+ },
+ {
+ label: "鍩硅鐩爣",
+ prop: "trainingObjectives",
+ width: "160px",
+ minWidth: "160px",
+ showOverflowTooltip: true,
+ },
+ {
+ label: "鍩硅鍐呭",
+ prop: "trainingContent",
+ width: "160px",
+ minWidth: "160px",
+ showOverflowTooltip: true,
+ },
+ {
+ label: "鍩硅鏂瑰紡",
+ prop: "trainingMode",
+ width: "140px",
+ minWidth: "140px",
+ showOverflowTooltip: true,
+ },
+ {
+ dataType: "tag",
+ label: "璇剧▼鐘舵��",
+ width: "100px",
+ prop: "state",
+ formatData: (params) => {
+ if (params == 1) {
+ return "宸插畬鎴�";
+ } else if (params == 2) {
+ return "杩涜涓�";
+ } else if (params == 3) {
+ return "鏈紑濮�";
+ } else if (params == 4) {
+ return "宸茬粨鏉�";
+ } else {
+ return null;
+ }
+ },
+ formatType: (params) => {
+ if (params == 1) {
+ return "success";
+ } else if (params == 2) {
+ return "warning";
+ } else if (params == 3) {
+ return "primary";
+ } else if (params == 4) {
+ return "info";
+ } else {
+ return null;
+ }
+ },
+ },
+ {
+ label: "鍙傚姞瀵硅薄",
+ prop: "participants",
+ width: "140px",
+ minWidth: "140px",
+ showOverflowTooltip: true,
+ },
+ {
+ label: "涓惧姙閮ㄩ棬",
+ prop: "holdingDepartmentName",
+ width: "140px",
+ minWidth: "140px",
+ showOverflowTooltip: true,
+ },
+ {
+ label: "鍩硅鍦扮偣",
+ prop: "placeTraining",
+ width: "160px",
+ minWidth: "160px",
+ showOverflowTooltip: true,
+ },
+ {
+ label: "鍩硅璁插笀",
+ prop: "trainingLecturerId",
+ width: "120px",
+ minWidth: "120px",
+ showOverflowTooltip: true,
+ },
+ {
+ label: "鍩硅鏃ユ湡",
+ prop: "trainingDateTwo",
+ width: "140px",
+ },
+ {
+ label: "寮�濮嬫椂闂�",
+ prop: "openingTime",
+ width: "120px",
+ },
+ {
+ label: "璇炬椂",
+ prop: "classHour",
+ width: "100px",
+ },
+ {
+ label: "澶囨敞",
+ prop: "remarks",
+ width: "120px",
+ minWidth: "120px",
+ showOverflowTooltip: true,
+ },
+ {
+ dataType: "action",
+ width: "240",
+ label: "鎿嶄綔",
+ fixed: "right",
+ operation: [
+ // 瓒呰繃浼氳寮�濮嬫椂闂村氨涓嶈兘璁ら浜�
+ {
+ name: "鎶ュ悕",
+ type: "text",
+ clickFun: (row) => {
+ this.handleClaim(row);
+ },
+ disabled: (row) => {
+ if (
+ row.whetherClaim === true ||
+ row.trainingDateTwo < this.$moment().format("YYYY-MM-DD")
+ ) {
+ return true;
+ } else {
+ return false;
+ }
+ },
+ },
+ {
+ name: "缁撴灉鏄庣粏",
+ type: "text",
+ clickFun: (row) => {
+ this.editInDetail(row);
+ },
+ showHide: (row) => {
+ if (row.isDisabled == 1) {
+ return true;
+ } else {
+ return false;
+ }
+ },
+ },
+ {
+ name: "瀵煎嚭",
+ type: "text",
+ clickFun: (row) => {
+ this.downLoadInDetail(row);
+ },
+ },
+ {
+ name: "鍒犻櫎",
+ type: "text",
+ color: "#f56c6c",
+ clickFun: (row) => {
+ this.deleteDetail(row);
+ },
+ showHide: (row) => {
+ if (row.isDisabled == 1) {
+ return true;
+ } else {
+ return false;
+ }
+ },
+ },
+ {
+ name: "缂栬緫",
+ type: "text",
+ clickFun: (row) => {
+ this.editDetail(row);
+ },
+ showHide: (row) => {
+ if (row.isDisabled == 1) {
+ return true;
+ } else {
+ return false;
+ }
+ },
+ },
+ ],
+ },
+ ],
+ pagination: {
+ size: 20,
+ current: 1,
+ total: 0,
+ compilerName: "",
+ },
+ inDetailPagination: {
+ size: 20,
+ current: 1,
+ total: 0,
+ },
+ editPlanShow: false,
+ currentRow: {},
+ currentRowId: null, // 褰撳墠閫変腑鏁版嵁鐨刬d
+ reviewRemarks: "", // 瀹℃牳澶囨敞
+ reviewDialog: false, // 瀹℃牳寮规
+ reviewLoading: false, // 瀹℃牳鎻愪氦鎸夐挳
+ approvalRemarks: "", // 瀹℃牳澶囨敞
+ approvalDialog: false, // 瀹℃牳寮规
+ approvalLoading: false, // 瀹℃牳鎻愪氦鎸夐挳
+ multipleSelection: [], // 骞村害鏄庣粏琛ㄩ�変腑鐨勬暟鎹�
+ uploadDia: false,
+ uploading: false,
+ isOperation: false,
+ token: null,
+ fileList: [],
+ currentChangeRow: {},
+ tableHeight: 0,
+ };
+ },
+ beforeDestroy() {
+ window.removeEventListener("resize", this.getTableHeight);
+ },
+ created() {
+ this.getTableHeight();
+ },
+ mounted() {
+ window.addEventListener("resize", this.getTableHeight);
+ this.token = {
+ token: sessionStorage.getItem("token"),
+ };
+ if (this.isDepartment) {
+ this.getYearPlanList(this.departId);
+ } else {
+ this.getInDetailPlan("", this.departId);
+ }
+ console.log("this.flag", this.flag);
+ },
+ methods: {
+ //鍔ㄦ�佽幏鍙栬〃鏍奸珮搴�
+ getTableHeight() {
+ const otherHeight = 548; // 鍏朵綑楂樺害
+ const tableH = 50; // 璺濈椤甸潰涓嬫柟鐨勯珮搴�
+ const tableHeightDetil = window.innerHeight - tableH;
+ if (tableHeightDetil <= 300) {
+ this.tableHeight = 200;
+ } else {
+ this.tableHeight = window.innerHeight - tableH - otherHeight;
+ }
+ },
+ // 缂栬緫鏄庣粏
+ editDetail(row) {
+ this.addInDetail = true;
+ this.$nextTick(() => {
+ this.$refs.addPlan.showEditDialog(row);
+ });
+ },
+ // 鍒犻櫎鏄庣粏
+ deleteDetail(row) {
+ this.$confirm("鏄惁鍒犻櫎?", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ }).then(() => {
+ deleteDetail({ id: row.id }).then((res) => {
+ this.$message.success("鍒犻櫎鎴愬姛");
+ this.searchTable();
+ });
+ });
+ },
+ searchTable() {
+ // 灏嗛〉鐮佽涓�
+ this.inDetailPagination.current = 1
+ this.getInDetailPlan(this.currentRowId);
+ },
+ // 鏌ヨ-骞村害璁″垝琛�
+ getYearPlanList(userId) {
+ const name = this.isDepartment ? "departmentId" : "userId";
+ personTrainingSelect({
+ [name]: userId,
+ size: this.pagination.size,
+ current: this.pagination.current,
+ compilerName: this.pagination.compilerName
+ }).then((res) => {
+ if (res.code === 201) return;
+ let data = {};
+ this.yearPlanTableData = res.data.records;
+ this.pagination.total = res.data.total;
+ if (this.yearPlanTableData.length > 0) {
+ this.currentRowId = this.yearPlanTableData[0].id;
+ if (this.currentPlanId) {
+ let filterData = this.yearPlanTableData.filter(
+ (item) => item.id == this.currentPlanId
+ );
+ if (filterData.length > 0) {
+ data = filterData[0];
+ }
+ } else {
+ data = this.yearPlanTableData[0];
+ }
+ this.currentChange(data);
+ } else {
+ this.inDetailPlanTableData = [];
+ }
+ });
+ },
+ refreshYearPlanList(departmentId) {
+ console.log("鍒锋柊涓昏〃", departmentId);
+ personTrainingSelect({
+ departmentId: departmentId,
+ size: this.pagination.size,
+ current: this.pagination.current,
+ compilerName: this.pagination.compilerName
+ }).then((res) => {
+ if (res.code === 201) return;
+ this.yearPlanTableData = res.data.records;
+ this.pagination.total = res.data.total;
+ });
+ },
+ currentChange(row) {
+ const now = new Date();
+ const currentYear = now.getFullYear();
+ this.currentChangeRow = row;
+ this.currentRowId = row.id;
+ if (row.createTime.slice(0, 4) == currentYear) {
+ this.isOperation = true;
+ } else {
+ this.isOperation = false;
+ }
+ this.currentPlanId = row.id;
+ this.getInDetailPlan(row.id);
+ },
+ getInDetailPlan(id) {
+ if (this.inDetailForm.trainingDate === null) {
+ this.inDetailForm.trainingDate = "";
+ }
+ let state = 3;
+ if (this.activeName != "first") {
+ state = -1;
+ }
+ const userId = this.isDepartment ? "" : this.departId;
+ if (this.currentPlanId) {
+ id = this.currentPlanId;
+ }
+ queryTheAnnualPlanDetailsTable({
+ userId,
+ size: this.inDetailPagination.size,
+ current: this.inDetailPagination.current,
+ trainingLecturerName: this.inDetailForm.trainingLecturerName,
+ trainingDate: this.inDetailForm.trainingDate,
+ courseCode: this.inDetailForm.courseCode,
+ departId: this.departId,
+ state
+ }).then((res) => {
+ if (res.code === 201) return;
+ this.inDetailPlanTableData = res.data.records;
+ this.inDetailPagination.total = res.data.total;
+ this.departId2 = res.data.records[0].departId;
+ });
+ },
+ // 鏂板骞村害璁″垝鏄庣粏琛�
+ addTrainingPlan() {
+ if (!this.currentRowId) {
+ this.$message.warning("璇烽�夋嫨涓�鏉¤鍒掕繘琛屾柊澧�");
+ return;
+ }
+ this.addInDetail = true;
+ this.$nextTick(() => {
+ this.$refs.addPlan.showDialog(this.currentRowId);
+ });
+ },
+ // 骞村害璁″垝琛�-鍒犻櫎
+ deleteFun(id) {
+ this.$confirm("姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ personTrainingDelete({ id }).then((res) => {
+ this.$message.success("鍒犻櫎鎴愬姛锛�");
+ this.getYearPlanList(this.departId);
+ });
+ })
+ .catch(() => {
+ this.$message({
+ type: "info",
+ message: "宸插彇娑堝垹闄�",
+ });
+ });
+ },
+ // 骞村害璁″垝琛�-瀹℃牳
+ handleCheck(id) {
+ this.currentRowId = id;
+ this.reviewDialog = true;
+ },
+ handleReview(status) {
+ const personTrainingUpdateDto = {
+ id: this.currentRowId,
+ remarks: this.reviewRemarks,
+ status: status,
+ };
+ this.reviewLoading = true;
+ reviewAnnualPersonnelTraining(personTrainingUpdateDto).then((res) => {
+ if (res.code === 200) {
+ this.$message.success("鎻愪氦鎴愬姛锛�");
+ this.reviewDialog = false;
+ this.getYearPlanList(this.departId);
+ }
+ this.reviewLoading = false;
+ })
+ .catch(() => {
+ this.reviewLoading = false;
+ });
+ },
+ // 骞村害璁″垝琛�-鎵瑰噯
+ handleApprove(id) {
+ this.currentRowId = id;
+ this.approvalDialog = true;
+ },
+ handleApproval(status) {
+ const personTrainingUpdateDto = {
+ id: this.currentRowId,
+ remarks: this.approvalRemarks,
+ status: status,
+ };
+ this.approvalLoading = true;
+ approveAnnualPersonnelTraining(personTrainingUpdateDto).then((res) => {
+ if (res.code === 200) {
+ this.$message.success("鎻愪氦鎴愬姛锛�");
+ this.approvalDialog = false;
+ this.getYearPlanList(this.departId);
+ }
+ this.approvalLoading = false;
+ })
+ .catch(() => {
+ this.approvalLoading = false;
+ });
+ },
+ // 骞村害璁″垝琛�-涓嬭浇
+ downLoadPost(row) {
+ exportPersonTraining({ id: row.id }).then((res) => {
+ this.outLoading = false;
+ const blob = new Blob([res], { type: "application/msword" });
+ this.$download.saveAs(blob, row.fileName + ".docx")
+ });
+ },
+ // 骞村害璁″垝-瀵煎叆
+ submitUpload() {
+ if (this.$refs.upload.uploadFiles.length == 0) {
+ this.$message.error("鏈�夋嫨鏂囦欢");
+ return;
+ }
+ this.uploading = true;
+ this.$refs.upload.submit();
+ this.uploading = false;
+ },
+ onSuccess(response, file, fileList) {
+ this.$refs.upload.clearFiles();
+ this.uploadDia = false;
+ this.uploading = false;
+ if (response.code == 201) {
+ this.$message.error(response.message);
+ return;
+ }
+ this.$message.success("涓婁紶鎴愬姛");
+ this.standardList = [];
+ this.productList = [];
+ this.getYearPlanList(this.departId);
+ },
+ onError(err, file, fileList) {
+ this.$message.error("涓婁紶澶辫触");
+ this.$refs.upload.clearFiles();
+ this.uploading = false;
+ },
+ beforeUpload(file, fileList) {
+ if (
+ file.type !=
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
+ ) {
+ this.$message.error("涓婁紶鏂囦欢鏍煎紡涓嶆纭�");
+ this.$refs.upload.clearFiles();
+ return false;
+ }
+ },
+ // 骞村害璁″垝鍒嗛〉
+ paginationMetod({ page, limit }) {
+ this.pagination.current = page;
+ this.pagination.size = limit;
+ this.getYearPlanList();
+ },
+ // 骞村害璁″垝鏄庣粏琛�-璁ら銆佸彇娑堣棰�
+ handleClaim(row) {
+ this.$confirm("鏄惁纭鎶ュ悕璇ヨ绋�?", "鎻愮ず", {
+ confirmButtonText: "鎶ュ悕",
+ cancelButtonText: "鍙栨秷鎶ュ悕",
+ type: "warning",
+ })
+ .then(() => {
+ this.handleClaimFun(true, row.id);
+ })
+ .catch(() => {
+ this.handleClaimFun(false, row.id);
+ });
+ },
+ handleClaimFun(claimAndClaim, rowId) {
+ claimOfTrainingAndAssessmentRecords({
+ claimAndClaim,
+ rowId
+ }).then((res) => {
+ this.getInDetailPlan(this.currentChangeRow.id);
+ });
+ },
+ // 骞村害璁″垝鏄庣粏琛�-缂栬緫
+ editInDetail(row) {
+ this.editPlanShow = true;
+ this.currentRow = row;
+ },
+ //
+ goBack() {
+ this.editPlanShow = false;
+ this.getInDetailPlan(this.currentRowId);
+ },
+ refresh(id) {
+ if (this.inDetailForm.trainingDate === null) {
+ this.inDetailForm.trainingDate = "";
+ }
+ const userId = this.isDepartment ? "" : this.departId;
+ queryTheAnnualPlanDetailsTable({
+ userId,
+ size: this.inDetailPagination.size,
+ current: this.inDetailPagination.current,
+ trainingLecturerName: this.inDetailForm.trainingLecturerName,
+ id,
+ trainingDate: this.inDetailForm.trainingDate,
+ courseCode: this.inDetailForm.courseCode,
+ departId: this.departId
+ }).then((res) => {
+ if (res.code === 201) return;
+ this.inDetailPlanTableData = res.data.records;
+ this.inDetailPagination.total = res.data.total;
+ this.currentRow = this.inDetailPlanTableData.find(
+ (item) => item.id == id
+ );
+ this.editKey += 1;
+ });
+ console.log("鍒锋柊", this.currentRow);
+ },
+ refresh(id) {
+ if (this.inDetailForm.trainingDate === null) {
+ this.inDetailForm.trainingDate = "";
+ }
+ const userId = this.isDepartment ? "" : this.departId;
+ queryTheAnnualPlanDetailsTable({
+ userId,
+ size: this.inDetailPagination.size,
+ current: this.inDetailPagination.current,
+ id,
+ trainingLecturerName: this.inDetailForm.trainingLecturerName,
+ trainingDate: this.inDetailForm.trainingDate,
+ courseCode: this.inDetailForm.courseCode,
+ departId: this.departId
+ }).then((res) => {
+ if (res.code === 201) return;
+ this.inDetailPlanTableData = res.data.records;
+ this.inDetailPagination.total = res.data.total;
+ this.currentRow = this.inDetailPlanTableData.find(
+ (item) => item.id == id
+ );
+ this.editKey += 1;
+ });
+ console.log("鍒锋柊", this.currentRow);
+ },
+ // 骞村害璁″垝鏄庣粏琛�-涓嬭浇
+ downLoadInDetail(row) {
+ exportPersonTrainingRecord({ id: row.id }).then((res) => {
+ this.outLoading = false;
+ const blob = new Blob([res], { type: "application/msword" });
+ this.$download.saveAs(blob, row.courseCode + "浜哄憳鍩硅涓庤�冩牳璁板綍" + ".docx")
+ });
+ },
+ // 骞村害璁″垝鏄庣粏琛�-澶氶��
+ handleSelectionChange(list) {
+ this.multipleSelection = list;
+ },
+ // 骞村害鏄庣粏琛�-鍒犻櫎
+ batchDelete() {
+ if (this.multipleSelection.length > 0) {
+ let ids = [];
+ this.multipleSelection.forEach((item) => {
+ ids.push(item.id);
+ });
+ this.$confirm("鏄惁纭鍒犻櫎鎵�閫夋嫨鐨勬暟鎹�?", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ deleteAnnualPlanDetailTable({ ids: ids.join(",") }).then((res) => {
+ if (res.code == 200) {
+ this.$message.success("鍒犻櫎鎴愬姛");
+ this.getInDetailPlan(this.currentRowId);
+ }
+ });
+ })
+ .catch(() => {
+ this.$message.warning("鍙栨秷鍒犻櫎");
+ });
+ } else {
+ this.$message.warning("璇烽�夋嫨闇�瑕佸垹闄ょ殑鏁版嵁");
+ }
+ },
+ paginationmethod0({ page, limit }) {
+ this.inDetailPagination.current = page;
+ this.inDetailPagination.size = limit;
+ this.getYearPlanList(this.departId);
+ },
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ departId: {
+ handler(newId, oldId) {
+ this.currentPlanId = null;
+ if (this.isDepartment) {
+ console.log("涓�");
+ this.getYearPlanList(newId);
+ } else {
+ this.getInDetailPlan("");
+ }
+ },
+ },
+ activeName: {
+ handler(newValue, oldValue) {
+ this.getInDetailPlan(this.currentRowId);
+ },
+ },
+ },
+};
+</script>
+<style scoped>
+.flex_column {
+ display: flex;
+ height: 80vh;
+ flex-direction: column;
+ overflow: auto;
+ justify-content: space-between;
+}
+
+.pagination {
+ display: flex;
+ justify-content: space-between;
+}
+
+.items_center {
+ display: flex;
+ align-items: center;
+}
+
+.date_box {
+ margin: 0 5px;
+}
+
+.search {
+ width: 150px;
+ margin: 0 16px;
+}
+</style>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Plan/Add.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Plan/Add.vue
new file mode 100644
index 0000000..44d9244
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Plan/Add.vue
@@ -0,0 +1,172 @@
+<template>
+ <div class="add">
+ <el-dialog :title="isEdit ? '缂栬緫鐩戠潱璁″垝鏄庣粏' : '鏂板鐩戠潱璁″垝鏄庣粏'" :visible.sync="dialogVisible" width="800px">
+ <el-form ref="formRef" :model="ruleForm" :rules="rules" label-width="100px">
+ <el-col :span="12">
+ <el-form-item label="鐩戠潱鏃ユ湡" prop="superviseDate">
+ <el-date-picker v-model="ruleForm.superviseDate" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡"
+ style="width: 100%;" type="date" value-format="yyyy-MM-dd"></el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鐩戠潱鐩殑" prop="superviseDes">
+ <el-input v-model="ruleForm.superviseDes"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鐩戠潱椤圭洰" prop="superviseProject">
+ <el-input v-model="ruleForm.superviseProject"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="琚洃鐫d汉" prop="supervisePerson">
+ <el-input v-model="ruleForm.supervisePerson"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="鐩戠潱鍘熷洜" prop="superviseReason">
+ <el-input v-model="ruleForm.superviseReason"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="澶囨敞" prop="remarks">
+ <el-input v-model="ruleForm.remarks"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-form>
+ <div slot="footer" class="foot">
+ <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
+ <el-button :loading="loading" type="primary" @click="submitForm">纭� 瀹�</el-button>
+ </div>
+ </el-dialog>
+ </div>
+</template>
+<script>
+import {
+ yearPlanDetailAdd,
+ yearPlanDetailEdit
+} from '@/api/cnas/personnel/personnelInfo.js'
+export default {
+ props: {
+ planId: {
+ type: Number,
+ default: undefined
+ }
+ },
+ data() {
+ return {
+ loading: false,
+ isEdit: false,
+ dialogVisible: false,
+ ruleForm: {
+ id: undefined,
+ superviseDate: undefined, // 鐩戠潱鏃ユ湡
+ superviseDes: undefined, // 鐩戠潱鐩殑
+ superviseProject: undefined, // 鐩戠潱椤圭洰
+ supervisePerson: undefined, // 琚洃鐫d汉
+ superviseReason: undefined, // 鐩戠潱鍘熷洜
+ remarks: undefined, // 澶囨敞
+ },
+ rules: {
+ superviseDate: [{ required: true, message: '璇烽�夋嫨鏃ユ湡', trigger: 'change' }],
+ superviseDes: [{ required: true, message: '璇疯緭鍏ョ洃鐫g洰鐨�', trigger: 'blur' }],
+ superviseProject: [{ required: true, message: '璇疯緭鍏ョ洃鐫i」鐩�', trigger: 'blur' }],
+ supervisePerson: [{ required: true, message: '璇疯緭鍏ヨ鐩戠潱浜�', trigger: 'blur' }],
+ superviseReason: [{ required: true, message: '璇疯緭鍏ョ洃鐫e師鍥�', trigger: 'blur' }],
+ }
+ }
+ },
+ methods: {
+ formatForm(row) {
+ this.ruleForm.id = undefined
+ this.ruleForm.planId = row.planId
+ this.ruleForm.superviseDate = undefined
+ this.ruleForm.superviseDes = undefined
+ this.ruleForm.superviseProject = undefined
+ this.ruleForm.supervisePerson = undefined
+ this.ruleForm.superviseReason = undefined
+ this.ruleForm.remarks = undefined
+ },
+ renderForm(row) {
+ this.ruleForm.id = row.id
+ this.ruleForm.superviseDate = row.superviseDate
+ this.ruleForm.superviseDes = row.superviseDes
+ this.ruleForm.superviseProject = row.superviseProject
+ this.ruleForm.supervisePerson = row.supervisePerson
+ this.ruleForm.superviseReason = row.superviseReason
+ this.ruleForm.remarks = row.remarks
+ },
+ showDialog(row, type) {
+ console.log(row)
+ if (type) {
+ this.isEdit = true
+ this.renderForm(row)
+ } else {
+ this.formatForm(row)
+ this.isEdit = false
+ }
+ this.dialogVisible = true
+ },
+ closeDialog() {
+ this.dialogVisible = false
+ },
+ async addYearDetail() {
+ const { code, data } = await yearPlanDetailAdd(this.ruleForm)
+ this.loading = false
+ if (code == 200) {
+ this.$message({
+ type: 'success',
+ message: '鏂板鎴愬姛'
+ })
+ this.closeDialog()
+ this.$emit('submit')
+ } else {
+ this.$message({
+ type: 'error',
+ message: '鏂板澶辫触'
+ })
+ }
+ },
+ async editYearDetail() {
+ const { code, data } = await yearPlanDetailEdit(this.ruleForm)
+ this.loading = false
+ if (code == 200) {
+ this.$message({
+ type: 'success',
+ message: '缂栬緫鎴愬姛'
+ })
+ this.closeDialog()
+ this.$emit('submit')
+ } else {
+ this.$message({
+ type: 'error',
+ message: '缂栬緫澶辫触'
+ })
+ }
+ },
+ submitForm() {
+ this.$refs.formRef.validate((valid) => {
+ if (valid) {
+ this.loading = true
+ if (this.isEdit) {
+ this.editYearDetail()
+ } else {
+ this.addYearDetail()
+ }
+ } else {
+ return false;
+ }
+ })
+ },
+ }
+}
+</script>
+<style scoped>
+.foot {
+ width: 100%;
+}
+
+.add>>>.el-dialog__footer {
+ padding-right: 20px;
+}
+</style>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Plan/UploadExcel.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Plan/UploadExcel.vue
new file mode 100644
index 0000000..dec71b7
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Plan/UploadExcel.vue
@@ -0,0 +1,44 @@
+<template>
+ <div>
+ <el-upload ref="upload" action="#" :before-upload="beforeUpload" :http-request="uploadFile"
+ :file-list="fileList" :on-success="uploadFileSuccess" accept=".xls, .xlsx" :limit="1" :auto-upload="true"
+ :show-file-list="false">
+ <el-button size="small" type="primary">瀵煎叆</el-button>
+ </el-upload>
+ </div>
+</template>
+<script>
+import {
+ yearPlanDetailImport
+} from '@/api/cnas/personnel/personnelInfo.js'
+export default {
+ data() {
+ return {
+ fileList: []
+ }
+ },
+ methods: {
+ /**
+ * @desc 涓婁紶鏂囦欢
+ */
+ beforeUpload(file) {
+ this.fileList = [file]
+ },
+ /**
+ * @desc 涓婁紶鑷虫湇鍔″櫒
+ */
+ async uploadFile() {
+ console.log('鏂囦欢', this.fileList[0])
+ let formData = new FormData()
+ formData.append('file', this.fileList[0])
+ const { code, data } = await yearPlanDetailImport(formData)
+ if (code == 200) {
+ this.$emit('upload')
+ }
+ },
+ uploadFileSuccess() {
+ this.$refs.upload.clearFiles()
+ }
+ }
+}
+</script>
\ No newline at end of file
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Plan/index.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Plan/index.vue
new file mode 100644
index 0000000..6ef1c26
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Plan/index.vue
@@ -0,0 +1,484 @@
+<template>
+ <div class="flex_column">
+ <div>
+ <TableCard title="骞村害璁″垝琛�">
+ <template v-slot:form>
+ <div class="items_center">
+ <span>缂栧埗浜�</span>
+ <el-input v-model="yearForm.organizationPerson" class="search" placeholder="璇疯緭鍏�"
+ size="small"></el-input>
+ <el-button size="small" type="primary" @click="getYearPlanList">鏌ヨ</el-button>
+ <el-button size="small" @click="clearYear">娓呯┖</el-button>
+ </div>
+ <!-- <UploadExcel v-if="isShowButton" @upload="getYearPlanList"></UploadExcel> -->
+ <el-upload ref="upload" v-if="isShowButton" :action="action" :data="uploadData"
+ :headers="uploadHeader" :before-upload="beforeUpload" :on-success="onSuccess">
+ <el-button size="small" type="primary">瀵煎叆</el-button>
+ </el-upload>
+
+
+
+
+ </template>
+ <template v-slot:table>
+ <limsTable ref="yearTable" :column="yearColumnData" :height="'calc(100vh - 38em)'"
+ :highlightCurrentRow="true" :rowClick="rowClick" :table-data="yearTableData"
+ :table-loading="yearLoading" style="margin-top: 0.5em;
+ padding: 0 15px;" :page="yearPage" @pagination="yearPagination">
+ </limsTable>
+ </template>
+ </TableCard>
+ </div>
+ <div style="width: 100%; height: 0.5em; background-color: #f5f7fb;"></div>
+ <div>
+ <TableCard title="骞村害璁″垝鏄庣粏琛�">
+ <template v-slot:form>
+ <div class="items_center">
+ <span>鐩戠潱鏃ユ湡</span>
+ <el-date-picker v-model="yearDetailForm.date" class="date_box" format="yyyy-MM-dd"
+ placeholder="閫夋嫨鏃ユ湡" size="small" type="date" value-format="yyyy-MM-dd">
+ </el-date-picker>
+ <span>鐩戠潱椤圭洰</span>
+ <el-input v-model="yearDetailForm.project" class="search" placeholder="璇疯緭鍏�"
+ size="small"></el-input>
+ <el-button size="small" type="primary" @click="getYearDetailPlanList">鏌ヨ</el-button>
+ <el-button size="small" @click="clearDetail">娓呯┖</el-button>
+ </div>
+ <div>
+ <el-button v-if="isOperation" size="small" type="primary"
+ @click="showDialog('add')">鏂板</el-button>
+ </div>
+ </template>
+ <template v-slot:table>
+ <limsTable :column="yearDetailColumnData" :height="'calc(100vh - 38em)'"
+ :table-data="yearDetailTableData" :table-loading="yearDetailLoading"
+ style="margin-top: 18px; padding: 0 15px;" :page="yearDeatilPage"
+ @pagination="yearDeatilPagination">
+ </limsTable>
+ </template>
+ </TableCard>
+ </div>
+ <PlanAdd ref="planModal" :planId="planId" @submit="handleForm"></PlanAdd>
+ </div>
+</template>
+<script>
+import TableCard from '@/components/TableCard/index.vue';
+import PlanAdd from "./Add.vue"
+import limsTable from "@/components/Table/lims-table.vue";
+import UploadExcel from "./UploadExcel.vue"
+import {
+ yearPlanList,
+ yearPlanDetailList,
+ yearPlanDel,
+ yearPlanDetailDel,
+ yearPlanDetailApproval,
+ exportSuperVisePlan
+} from '@/api/cnas/personnel/personnelInfo.js'
+
+export default {
+ props: {
+ departId: {
+ type: Number,
+ default: null
+ }
+ },
+
+
+ components: {
+ TableCard,
+ PlanAdd,
+ limsTable,
+ UploadExcel
+ },
+ data() {
+ return {
+ uploadData: {},
+ isShowButton: false,
+ planId: undefined,
+ yearForm: {
+ organizationPerson: undefined,
+ },
+ yearTableData: [], // 骞磋〃
+ yearPage: {
+ curent: 1,
+ pageSize: 20,
+ total: 0
+ },
+ yearColumnData: [
+ {
+ label: '鏂囦欢鍚嶇О',
+ prop: 'fileName',
+ minWidth: '150px'
+ }, {
+ label: '缂栧埗浜�',
+ prop: 'organizationPersonName',
+ minWidth: '100'
+ }, {
+ label: '缂栧埗鏃ユ湡',
+ prop: 'organizationDate',
+ minWidth: '160'
+ }, {
+ label: '鎵瑰噯浜�',
+ prop: 'approvalName',
+ minWidth: '100'
+ }, {
+ label: '鎵瑰噯鏃ユ湡',
+ prop: 'approvalDate',
+ minWidth: '160'
+ }, {
+ label: '瀹℃牳浜�',
+ prop: 'examine'
+ }, {
+ dataType: 'tag',
+ label: '鎵瑰噯鐘舵��',
+ prop: 'approvalStatus',
+ minWidth: '130',
+ formatData: (params) => {
+ if (params == 1) {
+ return '鎵瑰噯'
+ } else {
+ return '涓嶆壒鍑�'
+ }
+ },
+ formatType: (params) => {
+ if (params == 1) {
+ return 'success'
+ } else {
+ return 'danger'
+ }
+ }
+ }, {
+ label: '鍒涘缓鏃ユ湡',
+ prop: 'createTime',
+ minWidth: '160'
+ }, {
+ label: '鍒涘缓浜�',
+ prop: 'createName',
+ minWidth: '100'
+ }, {
+ dataType: 'action',
+ minWidth: '160',
+ label: '鎿嶄綔',
+ fixed: 'right',
+ operation: [
+ {
+ name: '瀵煎嚭',
+ type: 'text',
+ clickFun: (row) => {
+ this.downLoadPost(row)
+ }
+ },
+ {
+ name: '鎵瑰噯',
+ type: 'text',
+ disabled: (row) => {
+ if (row.approvalStatus == 1 || (row.departId == 18 && ![12, 11, 16].includes(row.currentId)) || (row.departId == 19 && ![35, 41, 16].includes(row.currentId))) {
+ return true
+ } else {
+ return false
+ }
+ },
+ clickFun: (row) => {
+ this.approvalYearPlan(row)
+ }
+ },
+ {
+ name: '鍒犻櫎',
+ type: 'text',
+ color: '#f56c6c',
+ clickFun: (row) => {
+ this.delYearPlan(row.id)
+ }
+ }
+ ]
+ }],
+ yearLoading: false,
+ yearDetailForm: {
+ date: undefined,
+ project: undefined
+ },
+ yearDetailTableData: [], // 骞存槑缁嗚〃
+ yearDeatilPage: {
+ curent: 1,
+ pageSize: 20,
+ total: 0
+ },
+ yearDetailColumnData: [
+ {
+ label: '鐩戠潱鏃ユ湡',
+ prop: 'superviseDate'
+ }, {
+ label: '鐩戠潱鐩殑',
+ prop: 'superviseDes'
+ }, {
+ label: '琚洃鐫d汉鍛�',
+ prop: 'supervisePerson'
+ }, {
+ label: '澶囨敞',
+ prop: 'remarks'
+ }, {
+ label: '鍩硅鏃ユ湡',
+ prop: 'trainDate'
+ }, {
+ label: '鍒涘缓',
+ prop: 'createBy'
+ }, {
+ dataType: 'action',
+ width: '180',
+ label: '鎿嶄綔',
+ operation: [
+ {
+ name: '缂栬緫',
+ type: 'text',
+ clickFun: (row) => {
+ this.$refs.planModal.showDialog(row, true)
+ }
+ },
+ {
+ name: '鍒犻櫎',
+ type: 'text',
+ color: '#f56c6c',
+ clickFun: (row) => {
+ this.delYearPlanDetail(row.id)
+ }
+ }
+ ]
+ }
+ ],
+ yearDetailLoading: false,
+ isOperation: false,
+ }
+ },
+ mounted() {
+ this.getYearPlanList()
+ // this.getPower()
+ // this.getYearDetailPlanList()
+
+ },
+ computed: {
+ action() {
+ return this.javaApi + '/superVisePlan/yearPlanDetailImport'
+ },
+ },
+ watch: {
+ departId(newValue, oldValue) {
+ this.getYearPlanList();
+ }
+ },
+ methods: {
+ // 涓婁紶鍓嶇殑閽╁瓙
+ beforeUpload(file) {
+ let list = file.name.split(".")
+ let fileName = list[list.length - 1]
+ this.$set(this.uploadData, "suffix", fileName)
+ },
+ // 鎴愬姛涔嬪悗鐨勯挬瀛�
+ onSuccess(response, file, fileList) {
+ this.getYearPlanList();
+ this.$message.success("瀵煎叆鎴愬姛")
+ this.$refs.upload.clearFiles()
+ },
+ getPower() {
+ let power = JSON.parse(sessionStorage.getItem('power'))
+ let up = false
+ for (var i = 0; i < power.length; i++) {
+ if (power[i].menuMethod == 'yearPlanDetailImport') {
+ up = true
+ }
+ }
+ if (!up) {
+ this.isShowButton = false
+ } else {
+ this.isShowButton = true
+ }
+ },
+ /**
+ * @desc 鏌ヨ骞村害璁″垝鍒楄〃
+ */
+ async getYearPlanList() {
+ this.yearLoading = true
+ const { code, data } = await yearPlanList({
+ current: this.yearPage.curent,
+ size: this.yearPage.pageSize,
+ organizationPerson: this.yearForm.organizationPerson,
+ departId: this.departId
+ })
+ if (code == 200) {
+ this.yearTableData = data.records
+ this.yearPage.total = data.total
+ if (this.yearTableData.length > 0) {
+ this.rowClick(this.yearTableData[0])
+ } else {
+ this.yearDetailTableData = []
+ }
+ }
+ console.log('涓昏〃鏁版嵁', this.yearTableData);
+ this.yearLoading = false
+ },
+ // 骞磋鍒掑垎椤�
+ yearPagination({ page, limit }) {
+ this.yearPage.current = page;
+ this.yearPage.size = limit;
+ this.getYearPlanList();
+ },
+ // 骞村害璁″垝琛ㄦ牸锛岀偣鍑昏鏁版嵁鍚庡埛鏂拌鎯�
+ rowClick(row) {
+ const now = new Date();
+ const currentYear = now.getFullYear();
+ if (row.createTime.slice(0, 4) == currentYear) {
+ this.isOperation = true;
+ } else {
+ this.isOperation = false;
+ }
+ this.planId = row.id
+ this.getYearDetailPlanList()
+ },
+ // 鏂板|缂栬緫瀹屾垚鍚庡仛浠�涔�
+ handleForm() {
+ this.getYearDetailPlanList()
+ },
+ // 娓呴櫎骞�
+ clearYear() {
+ this.$refs.yearTable.setCurrent()
+ this.yearForm.organizationPerson = undefined
+ this.getYearPlanList()
+ },
+ // 娓呴櫎鏄庣粏
+ clearDetail() {
+ this.yearDetailForm.date = undefined
+ this.yearDetailForm.project = undefined
+ this.getYearDetailPlanList()
+ },
+
+ /**
+ * @desc 鏌ヨ骞村害璁″垝鏄庣粏
+ */
+ async getYearDetailPlanList() {
+ this.yearDetailLoading = true
+ const { code, data } = await yearPlanDetailList({
+ planId: this.planId,
+ current: this.yearDeatilPage.curent,
+ size: this.yearDeatilPage.pageSize,
+ date: this.yearDetailForm.date,
+ project: this.yearDetailForm.project
+ })
+ if (code == 200) {
+ this.yearDetailTableData = data.records
+ this.yearDeatilPage.total = data.total
+ }
+ this.yearDetailLoading = false
+ },
+ showDialog(operationType, row, type = false) {
+ if (operationType === 'add') {
+ if (!this.planId) {
+ this.$message.warning('璇烽�夋嫨涓�鏉¤鍒掕繘琛屾柊澧�')
+ return
+ }
+ }
+ this.$refs.planModal.showDialog({ planId: this.planId, ...row }, type)
+ },
+
+
+
+ // 骞存槑缁嗚鍒掑垎椤�
+ yearDeatilPagination({ page, limit }) {
+ this.yearDeatilPage.current = page;
+ this.yearDeatilPage.size = limit;
+ this.getYearDetailPlanList();
+ },
+ // 鍒犻櫎骞磋鍒�
+ delYearPlan(id) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ枃浠�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(async () => {
+ const { code } = await yearPlanDel({ id })
+ if (code == 200) {
+ this.$message.success('鍒犻櫎鎴愬姛')
+ this.getYearPlanList()
+ this.getYearDetailPlanList()
+ } else {
+ this.$message.error('鍒犻櫎澶辫触')
+ }
+ })
+ },
+ // 鍒犻櫎骞磋鍒掓槑缁�
+ delYearPlanDetail(id) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ枃浠�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(async () => {
+ const { code } = await yearPlanDetailDel({ id })
+ if (code == 200) {
+ this.$message.success('鍒犻櫎鎴愬姛')
+ this.getYearDetailPlanList()
+ } else {
+ this.$message.error('鍒犻櫎澶辫触')
+ }
+ })
+ },
+ // 鎵瑰噯骞村害璁″垝
+ approvalYearPlan(row) {
+ this.$confirm('纭鎵瑰噯璇ュ勾搴﹁鍒�?', '鎻愮ず', {
+ confirmButtonText: '鎵瑰噯',
+ cancelButtonText: '涓嶆壒鍑�',
+ type: 'info'
+ }).then(() => {
+ this.approvalYearPlanFun(1, row.id)
+ }).catch(action => {
+ this.approvalYearPlanFun(0, row.id)
+ })
+ },
+ // 骞村害璁″垝琛�-涓嬭浇
+ downLoadPost(row) {
+ exportSuperVisePlan({ id: row.id }).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/msword' });
+ this.$download.saveAs(blob, row.fileName + '.docx')
+ })
+ },
+ async approvalYearPlanFun(approvalStatus, rowId) {
+ const { code } = await yearPlanDetailApproval({
+ id: rowId,
+ approvalStatus: approvalStatus
+ })
+ if (code == 200) {
+ this.$message.success('鎿嶄綔鎴愬姛锛�')
+ this.getYearPlanList()
+ } else {
+ this.$message.error('鎿嶄綔鎴愬姛锛�')
+ }
+ }
+ }
+}
+</script>
+<style scoped>
+.flex_column {
+ display: flex;
+ height: 80vh;
+ flex-direction: column;
+ overflow: auto;
+ justify-content: space-between;
+}
+
+.pagination {
+ display: flex;
+ justify-content: space-between
+}
+
+.items_center {
+ display: flex;
+ align-items: center;
+}
+
+.date_box {
+ margin: 0 5px;
+}
+
+.search {
+ width: 150px;
+ padding: 0 16px;
+}
+</style>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Records/Add.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/Add.vue
new file mode 100644
index 0000000..0919282
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/Add.vue
@@ -0,0 +1,234 @@
+<template>
+ <div class="add">
+ <el-dialog :isEdit="isEdit" :title="isEdit ? '缂栬緫宸ヤ綔鐩戠潱璁板綍' : '鏂板宸ヤ綔鐩戠潱璁板綍'" :visible.sync="dialogVisible" width="800">
+ <el-steps v-if="isEdit" :active="active" :align-center="true" finish-status="success">
+ <el-step style="cursor: pointer;" title="妫�娴�" @click.native="setStep(0)"></el-step>
+ <el-step style="cursor: pointer;" title="瀹℃壒" @click.native="setStep(1)"></el-step>
+ </el-steps>
+ <SuperviseForm v-show="pageStatus == 0" ref="superviseFormRef" :disabled="active != 0" :departId="departId"
+ :isEdit="isEdit" :superviseForm.sync="mainForm.superviseForm" :userList="userList" @addData="addData"
+ @close="closeDialog" @submit="submit"></SuperviseForm>
+ <ApproveForm v-show="pageStatus == 1" ref="approveFormRef" :approveForm.sync="mainForm.approveForm"
+ :disabled="active != 1" :departId="departId" :isEdit="isEdit" :userList="userList" @close="toClose"
+ @submit="submit"></ApproveForm>
+ <el-result v-show="pageStatus == 2" icon="success" subTitle="澶勭悊瀹屾垚" title="瀹℃牳瀹屾垚">
+ </el-result>
+ </el-dialog>
+ </div>
+</template>
+<script>
+import SuperviseForm from './supervise/SuperviseForm.vue'
+import ApproveForm from './supervise/ApproveForm.vue'
+import {
+ selectUserList,
+ addOrUpdatePersonSupervisionRecord
+} from '@/api/cnas/personnel/personnelInfo.js'
+import { dateFormat } from '@/utils/date.js'
+
+export default {
+ props: {
+ departId: {
+ type: Number,
+ default: null
+ }
+ },
+
+ components: {
+ SuperviseForm,
+ ApproveForm
+ },
+ data() {
+ return {
+ active: 0,
+ pageStatus: 0,
+ isEdit: false,
+ dialogVisible: false,
+ userList: [],
+ id: undefined,
+ mainForm: {
+ superviseForm: {
+ testerId: undefined,
+ supervisorId: undefined,
+ testItem: undefined,
+ sampleNumber: undefined,
+ detectionDate: undefined,
+ personnel: [],
+ instrumentEquipment: undefined,
+ workingEnvironment: undefined,
+ sampleCollection: undefined,
+ samplePreparation: undefined,
+ testMethod: undefined,
+ testingRecords: undefined,
+ testReport: undefined,
+ evaluationSupervisionSituation: undefined,
+ doNotMeetTheHandlingOpinions: undefined,
+ },
+ approveForm: {
+ technicalDirector: undefined
+ }
+ }
+ }
+ },
+ methods: {
+ async openDialog(row, type = false) {
+ this.dialogVisible = true
+ this.isEdit = type
+ console.log('type', this.isEdit);
+ await this.getUserList()
+ if (this.isEdit) {
+ // 缂栬緫
+ this.loadForm(row)
+ this.id = row.id
+ console.log(1111);
+ } else {
+ // 鏂板
+ this.resetForm(row)
+ this.id = undefined
+ console.log(22222);
+ }
+ console.log('this.id', this.id);
+ },
+ /**
+ * @desc 鍔犺浇琛ㄥ崟
+ */
+ loadForm(row) {
+ if (row.currentState) {
+ this.active = Number(row.currentState)
+ this.pageStatus = Number(row.currentState === '2' ? 0 : row.currentState)
+ }
+ // 绗�1姝�
+ this.mainForm.superviseForm.testerId = row.testerId
+ this.mainForm.superviseForm.supervisorId = row.supervisorId
+ this.mainForm.superviseForm.testItem = row.testItem
+ this.mainForm.superviseForm.sampleNumber = row.sampleNumber
+ this.mainForm.superviseForm.detectionDate = row.detectionDate
+ // let personList = row.personnel.split(',')
+ // this.mainForm.superviseForm.personnel = personList.map(item => {
+ // return Number(item)
+ // });
+ this.mainForm.superviseForm.personnel = row.personnel
+ this.mainForm.superviseForm.instrumentEquipment = row.instrumentEquipment
+ this.mainForm.superviseForm.workingEnvironment = row.workingEnvironment
+ this.mainForm.superviseForm.sampleCollection = row.sampleCollection
+ this.mainForm.superviseForm.samplePreparation = row.samplePreparation
+ this.mainForm.superviseForm.testMethod = row.testMethod
+ this.mainForm.superviseForm.testingRecords = row.testingRecords
+ this.mainForm.superviseForm.testReport = row.testReport
+ this.mainForm.superviseForm.evaluationSupervisionSituation = row.evaluationSupervisionSituation
+ this.mainForm.superviseForm.doNotMeetTheHandlingOpinions = row.doNotMeetTheHandlingOpinions
+ // 绗�2姝�
+ this.mainForm.approveForm.technicalDirector = row.technicalDirector
+ },
+ /**
+ * @desc 閲嶇疆琛ㄥ崟
+ */
+ resetForm(row) {
+ console.log(row)
+ this.active = 0
+ this.pageStatus = 0
+ // 绗�1涓�
+ this.mainForm.superviseForm.currentState = undefined
+ this.mainForm.superviseForm.testerId = undefined
+ this.mainForm.superviseForm.supervisorId = undefined
+ this.mainForm.superviseForm.testItem = undefined
+ this.mainForm.superviseForm.sampleNumber = undefined
+ this.mainForm.superviseForm.detectionDate = undefined
+ this.mainForm.superviseForm.personnel = undefined
+ this.mainForm.superviseForm.instrumentEquipment = undefined
+ this.mainForm.superviseForm.workingEnvironment = undefined
+ this.mainForm.superviseForm.sampleCollection = undefined
+ this.mainForm.superviseForm.samplePreparation = undefined
+ this.mainForm.superviseForm.testMethod = undefined
+ this.mainForm.superviseForm.testingRecords = undefined
+ this.mainForm.superviseForm.testReport = undefined
+ this.mainForm.superviseForm.evaluationSupervisionSituation = undefined
+ this.mainForm.superviseForm.doNotMeetTheHandlingOpinions = undefined
+ // 绗�2涓�
+ this.mainForm.approveForm.technicalDirector = undefined
+ console.log('鏂板', this.mainForm);
+
+
+ },
+ closeDialog() {
+ this.dialogVisible = false
+ },
+ /**
+ * @desc 鑾峰彇鐢ㄦ埛淇℃伅
+ */
+ async getUserList() {
+ const { code, data } = await selectUserList()
+ if (code == 200) {
+ this.userList = data
+ }
+ },
+ /**
+ * @desc 椹冲洖
+ */
+ toClose() {
+ this.submitFormApi({
+ id: this.id,
+ currentState: 0,
+ })
+ },
+ /**
+ * @desc 鏂板
+ */
+ addData(step) {
+ let data = this.setParams(step)
+ this.submitFormApi(data)
+ },
+ /**
+ * @desc 缂栬緫
+ */
+ submit(step) {
+ let data = this.setParams(step)
+ data.id = this.id
+ this.submitFormApi(data)
+ },
+ // 璁剧疆鍙傛暟
+ setParams(step) {
+ if (step == 1) {
+ let result = this.mainForm.superviseForm
+ result.currentState = this.active + 1
+ result.technicalDirectorDate = dateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss')
+ return result
+ }
+ if (step == 2) {
+ let result = this.mainForm.approveForm
+ result.currentState = this.active + 1
+ return result
+ }
+ },
+ // 鍚戞湇鍔″櫒鍙戦�佽〃鍗�
+ async submitFormApi(data) {
+ console.log('鎺ュ彛琛ㄥ崟', data)
+ // 灏嗛儴闂ㄥ甫鍏�
+ if (data.id == null) {
+ data.departLimsId = this.departId
+ }
+ const { code } = await addOrUpdatePersonSupervisionRecord(data)
+ if (code == 200) {
+ this.$message.success('鎿嶄綔鎴愬姛')
+ this.dialogVisible = false
+ this.$emit('submit')
+ }
+ },
+ setStep(e) {
+ this.pageStatus = e
+ }
+ }
+}
+</script>
+<style scoped>
+.foot {
+ width: 100%;
+}
+
+.add>>>.el-dialog__footer {
+ padding-right: 20px;
+}
+
+.main_right {
+ text-align: left;
+}
+</style>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Records/control/Step/ConditionForm.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/control/Step/ConditionForm.vue
new file mode 100644
index 0000000..42a1e7b
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/control/Step/ConditionForm.vue
@@ -0,0 +1,145 @@
+<template>
+ <el-form label-width="160px" :model="form" :disabled="disabled" style="position: relative;" size="small">
+ <el-card :body-style="{ height: '350px', overflow: 'auto' }">
+ <el-form-item label="閮ㄩ棬璐熻矗浜�">
+ <el-select v-model="form.departmentHeadId" placeholder="璇烽�夋嫨" style="width: 100%">
+ <el-option v-for="(item, index) in userList" :key="index" :label="item.name"
+ :value="item.id"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="琚洃鐫d汉">
+ <el-select v-model="form.supervisedPersonId" placeholder="璇烽�夋嫨" style="width: 100%">
+ <el-option v-for="(item, index) in userList" :key="index" :label="item.name"
+ :value="item.id"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="涓嶇鍚堝伐浣滃彂鐜伴�斿緞">
+ <el-checkbox-group v-model="form.discoveryApproach">
+ <el-checkbox v-for="(item, index) in checkbox" :key="index" :label="item.value" name="type">{{
+ item.label }}
+ </el-checkbox>
+ </el-checkbox-group>
+ </el-form-item>
+ <el-form-item label="涓嶇鍚堝伐浣滅殑璇︾粏璁板綍">
+ <el-input v-model="form.notConformDetails" type="textarea" :rows="2" placeholder="璇疯緭鍏ュ唴瀹�"></el-input>
+ </el-form-item>
+ <el-form-item label="涓嶇鍚堢殑渚濇嵁鍙婃潯娆惧彿">
+ <el-input v-model="form.nonConformityClause" type="textarea" :rows="2" placeholder="璇疯緭鍏ュ唴瀹�"></el-input>
+ </el-form-item>
+ </el-card>
+ <el-form-item label-width="0">
+ <div style=" display: flex; width: 100%; justify-content: space-between; margin-top: 15px;">
+ <div>
+ 鎿嶄綔浜猴細{{ currentResponsible }}
+ </div>
+ <div v-if="step == 0 || step == 1">
+ <el-button v-if="step == 1" :disabled="false" @click="cancel">椹冲洖</el-button>
+ <el-button :disabled="false" @click="save">淇濆瓨</el-button>
+ <el-button type="primary" @click="onSubmit"
+ :disabled="(supervisedPersonId != null && userId != supervisedPersonId) ||
+ ((departId == 18 && ![12, 10, 16].includes(userId)) || (departId == 19 && ![35, 41, 16].includes(userId)))">鎻愪氦</el-button>
+ </div>
+ </div>
+ </el-form-item>
+ </el-form>
+</template>
+<script>
+import { mapGetters } from "vuex";
+export default {
+ props: {
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ }
+ },
+ isPermission: {
+ type: Boolean,
+ default: false,
+ },
+ supervisedPersonId: {
+ type: Number,
+ default: null
+ },
+ currentResponsible: {
+ type: String,
+ default: ''
+ },
+ disabled: {
+ type: Boolean,
+ default: false
+ },
+ userList: {
+ type: Array,
+ default: () => {
+ return []
+ }
+ },
+ step: {
+ type: Number,
+ default: 0
+ },
+ condiForm: {
+ type: Object,
+ default: () => {
+ return {}
+ }
+ }
+ },
+ computed: {
+ form: {
+ get() {
+ return this.condiForm
+ },
+ set(val) {
+ this.$emit('update:condiForm', val)
+ }
+ },
+ ...mapGetters(["userId"]),
+ },
+ data() {
+ return {
+ checkbox: [
+ {
+ label: '绠$悊璇勫',
+ value: 0
+ }, {
+ label: '鍐呴儴瀹℃牳',
+ value: 1
+ }, {
+ label: '妫�娴嬭繃绋嬫帶鍒�',
+ value: 2
+ }, {
+ label: '鍐呴儴璐ㄩ噺鎺у埗',
+ value: 3
+ }, {
+ label: '鍐呴儴鐩戠潱',
+ value: 4
+ }, {
+ label: '澶栭儴璇勫/妫�鏌�',
+ value: 5
+ }, {
+ label: '椤惧鎶曡瘔/鎰忚鍙嶉',
+ value: 6
+ }, {
+ label: '鍏朵粬',
+ value: 7
+ }
+ ],
+ }
+ },
+ created() {
+ },
+ methods: {
+ onSubmit() {
+ this.$emit('nextStep', 'submit')
+ },
+ save() {
+ this.$emit('nextStep', 'save')
+ },
+ cancel() {
+ this.$emit('cancel', 'cancel')
+ }
+ }
+}
+</script>
\ No newline at end of file
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Records/control/Step/Inform.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/control/Step/Inform.vue
new file mode 100644
index 0000000..45b5a65
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/control/Step/Inform.vue
@@ -0,0 +1,103 @@
+<template>
+ <el-form :model="form" label-width="160px" style="position: relative" :disabled="disabled" size="small">
+ <el-card :body-style="{ height: '350px', overflow: 'auto' }">
+ <el-form-item label="閫氱煡瀹㈡埛">
+ <el-radio-group v-model="form.whetherInformCustomer">
+ <el-radio :label="1">鏄�</el-radio>
+ <el-radio :label="2">鍚�</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ <el-form-item label="鎭㈠宸ヤ綔">
+ <el-radio-group v-model="form.whetherResumeWork">
+ <el-radio :label="1">鏄�</el-radio>
+ <el-radio :label="2">鍚�</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ <el-form-item label="璐ㄩ噺璐熻矗浜�">
+ <el-select v-model="form.qualitySupervisorId" placeholder="璇烽�夋嫨">
+ <el-option v-for="(item, index) in userList" :key="index" :label="item.name"
+ :value="item.id"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-card>
+ <el-form-item label-width="0">
+ <div style=" display: flex; width: 100%; justify-content: space-between; margin-top: 15px;">
+ <div>
+ 鎿嶄綔浜猴細{{ currentResponsible }}
+ </div>
+ <div v-if="step == 4">
+ <el-button @click="cancel">椹冲洖</el-button>
+ <el-button type="primary" @click="onSubmit"
+ :disabled="(departId == 18 && ![12, 10, 16].includes(userId)) || (departId == 19 && ![35, 41, 16].includes(userId))">鎻愪氦</el-button>
+ </div>
+ </div>
+ </el-form-item>
+ </el-form>
+</template>
+<script>
+import { mapGetters } from "vuex";
+export default {
+ props: {
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ }
+ },
+ isPermission: {
+ type: Boolean,
+ default: false,
+ },
+ currentResponsible: {
+ type: String,
+ default: ''
+ },
+ disabled: {
+ type: Boolean,
+ default: false
+ },
+ userList: {
+ type: Array,
+ default: []
+ },
+ step: {
+ type: Number,
+ default: 0
+ },
+ inform: {
+ type: Object,
+ default: () => {
+ return {}
+ }
+ }
+ },
+ computed: {
+ form: {
+ get() {
+ return this.inform
+ },
+ set(val) {
+ this.$emit('update:inform', val)
+ }
+ },
+ ...mapGetters(["userId"]),
+ },
+ data() {
+ return {
+ }
+ },
+ created() {
+ },
+ methods: {
+ onSubmit() {
+ this.$emit('nextStep', 'submit')
+ },
+ save() {
+ this.$emit('nextStep', 'save')
+ },
+ cancel() {
+ this.$emit('cancel', 'cancel')
+ }
+ }
+}
+</script>
\ No newline at end of file
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Records/control/Step/MeasureForm.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/control/Step/MeasureForm.vue
new file mode 100644
index 0000000..61d72b5
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/control/Step/MeasureForm.vue
@@ -0,0 +1,110 @@
+<template>
+ <el-form :model="form" label-width="200px" style="position: relative;" :disabled="disabled" size="small">
+ <el-card :body-style="{ height: '350px', overflow: 'auto' }">
+ <el-form-item label="璐d换閮ㄩ棬">
+ <el-select v-model="form.responsibleDepartmentId" placeholder="璇烽�夋嫨" @change="filterUserList">
+ <el-option label="閫氫俊浜у搧瀹為獙瀹�" :value="18"></el-option>
+ <el-option label="鐢靛姏浜у搧瀹為獙瀹�" :value="19"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="璐d换浜�">
+ <el-select v-model="form.responsibleDepartmentPersonId" placeholder="璇烽�夋嫨">
+ <el-option v-for="(item, index) in userListTwo" :key="index" :label="item.name"
+ :value="item.id"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="娑堥櫎涓嶇鍚堝伐浣滄墍閲囧彇鐨勬帾鏂�">
+ <el-input v-model="form.treatmentMeasures" type="textarea" :rows="2" placeholder="璇疯緭鍏ュ唴瀹�"></el-input>
+ </el-form-item>
+ </el-card>
+ <el-form-item v-if="step == 2" label-width="0px" :disabled="disabled">
+ <div style=" display: flex; width: 100%; justify-content: space-between; margin-top: 15px;">
+ <div>
+ 鎿嶄綔浜猴細{{ currentResponsible }}
+ </div>
+ <div>
+ <el-button @click="cancel">椹冲洖</el-button>
+ <el-button type="primary" @click="onSubmit"
+ :disabled="(departId == 18 && ![12, 10, 16].includes(userId)) || (departId == 19 && ![35, 41, 16].includes(userId))">鎻愪氦</el-button>
+ </div>
+ </div>
+ </el-form-item>
+ </el-form>
+</template>
+<script>
+import { mapGetters } from "vuex";
+export default {
+ props: {
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ }
+ },
+ isPermission: {
+ type: Boolean,
+ default: false,
+ },
+ currentResponsible: {
+ type: String,
+ default: ''
+ },
+ disabled: {
+ type: Boolean,
+ default: false
+ },
+ userList: {
+ type: Array,
+ default: []
+ },
+ step: {
+ type: Number,
+ default: 0
+ },
+ handleForm: {
+ type: Object,
+ default: () => {
+ return {}
+ }
+ }
+ },
+ computed: {
+ form: {
+ get() {
+ return this.handleForm
+ },
+ set(val) {
+ this.$emit('update:handleForm', val)
+ }
+ },
+ ...mapGetters(["userId"]),
+ },
+ data() {
+ return {
+ userListTwo: []
+ }
+ },
+ mounted() {
+ this.userListTwo = JSON.parse(JSON.stringify(this.userList))
+ },
+ created() {
+ },
+ methods: {
+ filterUserList() {
+ this.userListTwo = this.userList.filter(item => item.departLimsId.includes(this.form.responsibleDepartmentId))
+ if (!this.userListTwo.some(item => item.id == this.form.responsibleDepartmentPersonId)) {
+ this.form.responsibleDepartmentPersonId = null
+ }
+ },
+ onSubmit() {
+ this.$emit('nextStep', 'submit')
+ },
+ save() {
+ this.$emit('nextStep', 'save')
+ },
+ cancel() {
+ this.$emit('cancel', 'cancel')
+ }
+ }
+}
+</script>
\ No newline at end of file
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Records/control/Step/RectifyForm.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/control/Step/RectifyForm.vue
new file mode 100644
index 0000000..5ac10eb
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/control/Step/RectifyForm.vue
@@ -0,0 +1,101 @@
+<template>
+ <el-form :model="form" label-width="160px" style="position: relative" :disabled="disabled" size="small">
+ <el-card :body-style="{ height: '350px', overflow: 'auto' }">
+ <el-form-item label="鏄惁闇�瑕侀噰鍙栫籂姝f帾鏂�">
+ <el-radio-group v-model="form.correctiveMeasure">
+ <el-radio :label="1">鏄�</el-radio>
+ <el-radio :label="2">鍚�</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ <el-form-item label="绾犳鎺柦澶勭悊鍗曡窡韪�">
+ <el-radio-group v-model="form.correctiveMeasureFollowTracks">
+ <el-radio :label="1">鏄�</el-radio>
+ <el-radio :label="2">鍚�</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ <el-form-item label="鎶�鏈礋璐d汉">
+ <el-select v-model="form.correctiveMeasurePersonId" placeholder="璇烽�夋嫨">
+ <el-option v-for="(item, index) in userList" :key="index" :label="item.name"
+ :value="item.id"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-card>
+ <el-form-item label-width="0">
+ <div style=" display: flex; width: 100%; justify-content: space-between; margin-top: 15px;">
+ <div>
+ 鎿嶄綔浜猴細{{ currentResponsible }}
+ </div>
+ <div v-if="step == 3">
+ <el-button @click="cancel">椹冲洖</el-button>
+ <el-button type="primary" @click="onSubmit"
+ :disabled="(departId == 18 && ![12, 10, 16].includes(userId)) || (departId == 19 && ![35, 41, 16].includes(userId))">鎻愪氦</el-button>
+ </div>
+ </div>
+ </el-form-item>
+ </el-form>
+</template>
+<script>
+import { mapGetters } from "vuex";
+export default {
+ props: {
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ }
+ },
+ isPermission: {
+ type: Boolean,
+ default: false,
+ },
+ currentResponsible: {
+ type: String,
+ default: ''
+ },
+ disabled: {
+ type: Boolean,
+ default: false
+ },
+ userList: {
+ type: Array,
+ default: []
+ },
+ step: {
+ type: Number,
+ default: 0
+ },
+ rectifyForm: {
+ type: Object,
+ default: () => {
+ return {}
+ }
+ }
+ },
+ computed: {
+ form: {
+ get() {
+ return this.rectifyForm
+ },
+ set(val) {
+ this.$emit('update:rectifyForm', val)
+ }
+ },
+ ...mapGetters(["userId"]),
+ },
+ data() {
+ return {
+ }
+ },
+ methods: {
+ onSubmit() {
+ this.$emit('nextStep', 'submit')
+ },
+ save() {
+ this.$emit('nextStep', 'save')
+ },
+ cancel() {
+ this.$emit('cancel', 'cancel')
+ }
+ }
+}
+</script>
\ No newline at end of file
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Records/control/index.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/control/index.vue
new file mode 100644
index 0000000..325cf70
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/control/index.vue
@@ -0,0 +1,312 @@
+<template>
+ <div>
+ <el-dialog :visible.sync="dialogVisible" title="涓嶇鍚堝伐浣滄帶鍒跺崟">
+ <el-steps :active="active" :align-center="true" finish-status="success">
+ <el-step v-for="(item, index) in stepList" :key="index" :title="item.label" style="cursor: pointer;"
+ @click.native="setStep(item.value)"></el-step>
+ </el-steps>
+ <el-divider></el-divider>
+ <ConditionForm v-if="pageStatus == 0" :departId="departId" :isPermission="isPermission"
+ :supervisedPersonId="mainForm.condiForm.supervisedPersonId" :condiForm.sync="mainForm.condiForm"
+ :currentResponsible="currentResponsible" :disabled="active != 0" :step="active" :userList="userList"
+ @nextStep="submit"></ConditionForm>
+ <ConditionForm v-if="pageStatus == 1" :departId="departId" :isPermission="isPermission"
+ :supervisedPersonId="mainForm.condiForm.supervisedPersonId" :condiForm.sync="mainForm.condiForm"
+ :currentResponsible="currentResponsible" :disabled="true" :step="active" :userList="userList"
+ @cancel="cancel" @nextStep="submit"></ConditionForm>
+ <MeasureForm v-if="pageStatus == 2" :departId="departId" :isPermission="isPermission"
+ :currentResponsible="currentResponsible" :disabled="active != 2" :handleForm.sync="mainForm.handleForm"
+ :step="active" :userList="userList" @cancel="cancel" @nextStep="submit"></MeasureForm>
+ <RectifyForm v-if="pageStatus == 3" :departId="departId" :isPermission="isPermission"
+ :currentResponsible="currentResponsible" :disabled="active != 3"
+ :rectifyForm.sync="mainForm.rectifyForm" :step="active" :userList="userList" @cancel="cancel"
+ @nextStep="submit"></RectifyForm>
+ <Inform v-if="pageStatus == 4" :departId="departId" :isPermission="isPermission" :disabled="active != 4"
+ :inform.sync="mainForm.inform" :step="active" :userList="userList" @cancel="cancel" @nextStep="submit">
+ </Inform>
+ <el-result v-if="pageStatus == 5" icon="success" subTitle="澶勭悊瀹屾垚" title="瀹℃牳瀹屾垚">
+ </el-result>
+ </el-dialog>
+ </div>
+</template>
+<script>
+import ConditionForm from './Step/ConditionForm.vue'
+import MeasureForm from './Step/MeasureForm.vue'
+import RectifyForm from './Step/RectifyForm.vue'
+import Inform from './Step/Inform.vue'
+import {
+ selectUserList,
+ personSupervisionControlSheetPage,
+ addOrUpdatePersonSupervisionControl
+} from '@/api/cnas/personnel/personnelInfo.js'
+export default {
+ props: {
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ }
+ },
+ },
+ components: {
+ ConditionForm, MeasureForm, RectifyForm, Inform
+ },
+ data() {
+ return {
+ isPermission: true,
+ supervisedPersonId: null,
+ active: 0,
+ pageStatus: 0,
+ dialogVisible: false,
+ currentResponsible: undefined,
+ stepList: [{
+ label: '宸ヤ綔鎯呭喌',
+ value: 0
+ }, {
+ label: '琚洃鐫d汉纭',
+ value: 1
+ }, {
+ label: '澶勭悊鎺柦',
+ value: 2
+ }, {
+ label: '绾犳鎺柦',
+ value: 3
+ }, {
+ label: '閫氱煡瀹㈡埛',
+ value: 4
+ }
+ ],
+ supervisionRecordId: undefined,
+ controlId: undefined,
+ mainForm: {
+ condiForm: {
+ departmentHeadId: undefined,
+ supervisedPersonId: undefined,
+ discoveryApproach: [],
+ notConformDetails: undefined,
+ nonConformityClause: undefined,
+ departLimsId: undefined
+ },
+ handleForm: {
+ responsibleDepartmentPersonId: undefined,
+ treatmentMeasures: undefined,
+ departLimsId: undefined
+ },
+ rectifyForm: {
+ correctiveMeasure: undefined,
+ correctiveMeasureFollowTracks: undefined,
+ correctiveMeasurePersonId: undefined,
+ departLimsId: undefined
+ },
+ inform: {
+ whetherInformCustomer: undefined,
+ whetherResumeWork: undefined,
+ qualitySupervisorId: undefined,
+ departLimsId: undefined
+ }
+ },
+ userList: [],
+ controlType: undefined
+ }
+ },
+ mounted() {
+ this.isPermission = isPermission("isSubmit")
+ console.log('鏉冮檺', this.isPermission);
+ },
+ methods: {
+ /**
+ * @desc 鍒濆鍖栬〃鍗�
+ */
+ initForm() {
+ this.mainForm.condiForm.departmentHeadId = undefined
+ this.mainForm.condiForm.supervisedPersonId = undefined
+ this.mainForm.condiForm.discoveryApproach = []
+ this.mainForm.condiForm.notConformDetails = undefined
+ this.mainForm.condiForm.nonConformityClause = undefined
+ this.mainForm.condiForm.departLimsId = undefined
+ this.mainForm.handleForm.responsibleDepartmentPersonId = undefined
+ this.mainForm.handleForm.treatmentMeasures = undefined
+ this.mainForm.handleForm.departLimsId = undefined
+ this.mainForm.rectifyForm.correctiveMeasure = undefined
+ this.mainForm.rectifyForm.correctiveMeasureFollowTracks = undefined
+ this.mainForm.rectifyForm.correctiveMeasurePersonId = undefined
+ this.mainForm.rectifyForm.departLimsId = undefined
+ this.mainForm.inform.whetherInformCustomer = undefined
+ this.mainForm.inform.whetherResumeWork = undefined
+ this.mainForm.inform.qualitySupervisorId = undefined
+ this.mainForm.inform.departLimsId = undefined
+ },
+ /**
+ * @desc 鎵撳紑妯℃�佹
+ * @param {鐩戠潱璁板綍id} id
+ */
+ openDialog(id) {
+ this.dialogVisible = true
+ this.getUserList()
+ this.getControlData(id)
+ },
+ /**
+ * @desc 鑾峰彇鐢ㄦ埛淇℃伅
+ */
+ async getUserList() {
+ const { code, data } = await selectUserList()
+ if (code == 200) {
+ this.userList = data
+ }
+ },
+ /**
+ * @desc 鏌ヨ鐩戠潱璁板綍鎺у埗鍗�
+ * @param {鐩戠潱璁板綍id} id
+ */
+ async getControlData(id) {
+ const { code, data } = await personSupervisionControlSheetPage({ id })
+ if (code == 202) {
+ this.controlType = '鏂板'
+ this.supervisionRecordId = id
+ this.active = 0
+ this.pageStatus = 0
+ this.controlId = undefined
+ this.initForm()
+ }
+ if (code == 200) {
+ this.currentResponsible = data.currentResponsible
+ this.controlType = '缂栬緫'
+ this.controlId = data.id
+ this.active = Number(data.currentState)
+ this.pageStatus = Number(data.currentState === 4 ? 0 : data.currentState)
+ // 绗�1銆�2姝ユ暟鎹�
+ this.mainForm.condiForm.departmentHeadId = data.departmentHeadId
+ this.mainForm.condiForm.supervisedPersonId = data.supervisedPersonId
+ this.mainForm.condiForm.notConformDetails = data.notConformDetails
+ this.mainForm.condiForm.nonConformityClause = data.nonConformityClause
+ this.mainForm.condiForm.departLimsId = data.departLimsId
+ // 绗�3姝ユ暟鎹�
+ this.mainForm.handleForm.responsibleDepartmentPersonId = data.responsibleDepartmentPersonId
+ this.mainForm.handleForm.treatmentMeasures = data.treatmentMeasures
+ this.mainForm.handleForm.departLimsId = data.departLimsId
+ // 绗�4姝ユ暟鎹�
+ this.mainForm.rectifyForm.correctiveMeasure = data.correctiveMeasure
+ this.mainForm.rectifyForm.correctiveMeasureFollowTracks = data.correctiveMeasureFollowTracks
+ this.mainForm.rectifyForm.correctiveMeasurePersonId = data.correctiveMeasurePersonId
+ this.mainForm.rectifyForm.departLimsId = data.departLimsId
+ // 绗�5姝ユ暟鎹�
+ this.mainForm.inform.whetherInformCustomer = data.whetherInformCustomer
+ this.mainForm.inform.whetherResumeWork = data.whetherResumeWork
+ this.mainForm.inform.qualitySupervisorId = data.qualitySupervisorId
+ this.mainForm.inform.departLimsId = data.departLimsId
+ this.supervisionRecordId = data.supervisionRecordId
+
+
+ this.supervisedPersonId = data.supervisedPersonId
+ }
+ },
+ submit(type) {
+ let currentState = undefined
+ if (type == 'submit') {
+ currentState = this.active + 1
+ } else if (type == 'save') {
+ currentState = undefined
+ }
+ if (this.active == 0) {
+ let { discoveryApproach, ...condiFormRest } = this.mainForm.condiForm
+ let approcahStr = discoveryApproach.join(',')
+ this.submitForm({
+ id: this.controlId,
+ supervisionRecordId: this.supervisionRecordId,
+ discoveryApproach: approcahStr,
+ currentState: currentState,
+ discovererDate: this.$moment().format('YYYY-MM-DD HH:mm:ss'),
+ ...condiFormRest
+ })
+ }
+ if (this.active == 1) {
+ let { discoveryApproach, ...condiFormRest } = this.mainForm.condiForm
+ let approcahStr = discoveryApproach.join(',')
+ this.submitForm({
+ id: this.controlId,
+ supervisionRecordId: this.supervisionRecordId,
+ discoveryApproach: approcahStr,
+ currentState: currentState,
+ supervisedPersonDate: this.$moment().format('YYYY-MM-DD'),
+ ...condiFormRest
+ })
+ }
+ if (this.active == 2) {
+ let { handleForm } = this.mainForm
+ this.submitForm({
+ id: this.controlId,
+ supervisionRecordId: this.supervisionRecordId,
+ currentState: currentState,
+ responsibleDepartmentDate: this.$moment().format('YYYY-MM-DD HH:mm:ss'),
+ ...handleForm
+ })
+ }
+ if (this.active == 3) {
+ let { rectifyForm } = this.mainForm
+ this.submitForm({
+ id: this.controlId,
+ supervisionRecordId: this.supervisionRecordId,
+ currentState: currentState,
+ correctiveMeasureDate: this.$moment().format('YYYY-MM-DD HH:mm:ss'),
+ ...rectifyForm
+ })
+ }
+ if (this.active == 4) {
+ let { inform } = this.mainForm
+ this.submitForm({
+ id: this.controlId,
+ supervisionRecordId: this.supervisionRecordId,
+ currentState: currentState,
+ qualitySupervisorDate: this.$moment().format('YYYY-MM-DD HH:mm:ss'),
+ ...inform
+ })
+ }
+ },
+ /**
+ * @desc 鎻愪氦琛ㄥ崟
+ */
+ async submitForm(form) {
+ let user = JSON.parse(localStorage.getItem('user'));
+ form.responsibleDepartmentId = Number(form.responsibleDepartmentId)
+ const { code } = await addOrUpdatePersonSupervisionControl({
+ currentResponsible: user.name,
+ ...form
+ })
+ if (this.controlType == '鏂板') {
+ if (code == 200) {
+ this.$message.success('鎻愪氦鎴愬姛')
+ }
+ } else if (this.controlType == '缂栬緫') {
+ if (code == 200) {
+ this.$message.success('鎻愪氦鎴愬姛')
+ }
+ }
+ this.$emit('getTableData')
+ this.dialogVisible = false
+ },
+ /**
+ * @desc 椹冲洖
+ */
+ cancel() {
+ let currentState = this.active - 1
+ this.submitForm({
+ id: this.controlId,
+ supervisionRecordId: this.supervisionRecordId,
+ currentState: currentState,
+ })
+ },
+ setStep(e) {
+ this.pageStatus = e
+ }
+ }
+}
+</script>
+<style scoped>
+.dialog-footer {
+ width: 100%;
+}
+
+>>>.el-dialog__footer {
+ padding-right: 20px;
+}
+</style>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Records/dispose/Step/Fact.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/dispose/Step/Fact.vue
new file mode 100644
index 0000000..75c287c
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/dispose/Step/Fact.vue
@@ -0,0 +1,108 @@
+<template>
+ <el-form :model="form" :disabled="disabled" label-width="140px" size="small" style="position: relative">
+ <el-card :body-style="{ height: '350px', overflow: 'auto' }">
+ <el-form-item label="鎻愬嚭閮ㄩ棬">
+ <!-- <el-select
+ v-model="form.proposingDepartment"
+ placeholder="璇烽�夋嫨"
+ style="width: 100%"
+ >
+ <el-option label="閫氫俊浜у搧瀹為獙瀹�" :value="18"></el-option>
+ <el-option label="鐢靛姏浜у搧瀹為獙瀹�" :value="19"></el-option>
+ </el-select> -->
+ <el-input :disabled="true" v-model="form.proposingDepartment"></el-input>
+ </el-form-item>
+
+ <el-form-item label="浜哄憳閫夋嫨">
+ <el-select v-model="form.proposingDepartmentPersonId" placeholder="璇烽�夋嫨" style="width: 100%">
+ <el-option v-for="(item, index) in userList" :key="index" :label="item.name"
+ :value="item.id"></el-option>
+ </el-select>
+ </el-form-item>
+
+ <el-form-item label="涓嶅悎鏍兼垨鍋忕鎻忚堪">
+ <el-input type="textarea" v-model="form.descriptionNonconformity" :rows="2" placeholder="璇疯緭鍏ュ唴瀹�">
+ </el-input>
+ </el-form-item>
+ </el-card>
+ <el-form-item label-width="0">
+ <div style="display: flex; width: 100%; justify-content: space-between; margin-top: 15px;">
+ <div>
+ 鎿嶄綔浜猴細{{ currentResponsible }}
+ </div>
+ <div v-if="step == 0">
+ <el-button :disabled="false" @click="cancel">椹冲洖</el-button>
+ <el-button @click="save">淇濆瓨</el-button>
+ <el-button type="primary" @click="submit"
+ :disabled="(departId == 18 && ![12, 10, 16].includes(userId)) || (departId == 19 && ![35, 41, 16].includes(userId))">鎻愪氦</el-button>
+ </div>
+ </div>
+ </el-form-item>
+ </el-form>
+</template>
+<script>
+import { mapGetters } from "vuex";
+export default {
+ props: {
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ }
+ },
+ isPermission: {
+ type: Boolean,
+ default: false,
+ },
+ currentResponsible: {
+ type: String,
+ default: ''
+ },
+ factForm: {
+ type: Object,
+ default: () => {
+ return {}
+ }
+ },
+ userList: {
+ type: Array,
+ default: []
+ },
+ step: {
+ type: Number,
+ default: 0
+ },
+ disabled: {
+ type: Boolean,
+ default: false
+ }
+ },
+ computed: {
+ form: {
+ get() {
+ this.$set(this.factForm, 'proposingDepartment', '鐩戠潱鍛�')
+ return this.factForm
+ },
+ set(val) {
+ this.$emit('update:factForm', val)
+ }
+ },
+ ...mapGetters(["userId"]),
+ },
+ data() {
+ return {
+ }
+ },
+ methods: {
+ submit() {
+ this.$emit('nextStep', 'submit')
+ },
+ save() {
+ this.$emit('nextStep', 'save')
+ },
+ cancel() {
+ this.$emit('cancel', 'cancel')
+ }
+ }
+}
+</script>
\ No newline at end of file
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Records/dispose/Step/Measure.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/dispose/Step/Measure.vue
new file mode 100644
index 0000000..bd8be58
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/dispose/Step/Measure.vue
@@ -0,0 +1,121 @@
+<template>
+ <el-form :model="form" :disabled="disabled" label-width="130px" size="small" style="position: relative">
+ <el-card :body-style="{ height: '350px', overflow: 'auto' }">
+ <el-form-item label="璐d换閮ㄩ棬">
+ <!-- <el-select v-model="form.correctiveActionId" placeholder="璇烽�夋嫨">
+ <el-option
+ v-for="(item, index) in userList"
+ :key="index"
+ :label="item.name"
+ :value="item.id"
+ ></el-option>
+ </el-select> -->
+ <el-select @change="filterUserList" v-model="form.causeAnalysisId" placeholder="璇烽�夋嫨"
+ style="width: 100%">
+ <el-option label="閫氫俊浜у搧瀹為獙瀹�" :value="18"></el-option>
+ <el-option label="鐢靛姏浜у搧瀹為獙瀹�" :value="19"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="璐d换浜�">
+ <el-select v-model="form.correctiveActionId" placeholder="璇烽�夋嫨">
+ <el-option v-for="(item, index) in userListTwo" :key="index" :label="item.name"
+ :value="item.id"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="绾犳鎺柦">
+ <el-input type="textarea" v-model="form.correctiveMeasure" :rows="2" placeholder="璇疯緭鍏ュ唴瀹�">
+ </el-input>
+ </el-form-item>
+ <el-form-item label="鎻愬嚭瑕佹眰閮ㄩ棬纭">
+ <el-input type="textarea" v-model="form.requestDepartmentConfirmation" :rows="2" placeholder="璇疯緭鍏ュ唴瀹�">
+ </el-input>
+ </el-form-item>
+ </el-card>
+ <el-form-item label-width="0">
+ <div style="display: flex; width: 100%; justify-content: space-between; margin-top: 15px;">
+ <div>
+ 鎿嶄綔浜猴細{{ currentResponsible }}
+ </div>
+ <div v-if="step == 2">
+ <el-button :disabled="false" @click="cancel">椹冲洖</el-button>
+ <el-button type="primary" @click="submit"
+ :disabled="(departId == 18 && ![12, 10, 16].includes(userId)) || (departId == 19 && ![35, 41, 16].includes(userId))">鎻愪氦</el-button>
+ </div>
+ </div>
+ </el-form-item>
+ </el-form>
+</template>
+<script>
+import { mapGetters } from "vuex";
+export default {
+ props: {
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ }
+ },
+ isPermission: {
+ type: Boolean,
+ default: false,
+ },
+ currentResponsible: {
+ type: String,
+ default: ''
+ },
+ measureForm: {
+ type: Object,
+ default: {}
+ },
+ userList: {
+ type: Array,
+ default: []
+ },
+ step: {
+ type: Number,
+ default: 0
+ },
+ disabled: {
+ type: Boolean,
+ default: false
+ }
+ },
+ computed: {
+ form: {
+ get() {
+ return this.measureForm
+ },
+ set(val) {
+ this.$emit('update:measureForm', val)
+ }
+ },
+ ...mapGetters(["userId"]),
+ },
+ data() {
+ return {
+ userListTwo: []
+ }
+ },
+ mounted() {
+ this.userListTwo = JSON.parse(JSON.stringify(this.userList))
+ console.log('this.userListTwo', this.userListTwo);
+ },
+ methods: {
+ filterUserList() {
+ this.userListTwo = this.userList.filter(item => item.departLimsId.includes(this.form.causeAnalysisId))
+ if (!this.userListTwo.some(item => item.id == this.form.correctiveActionId)) {
+ this.form.correctiveActionId = null
+ }
+ },
+ submit() {
+ this.$emit('nextStep', 'submit')
+ },
+ save() {
+ this.$emit('nextStep', 'save')
+ },
+ cancel() {
+ this.$emit('cancel', 'cancel')
+ }
+ }
+}
+</script>
\ No newline at end of file
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Records/dispose/Step/Reason.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/dispose/Step/Reason.vue
new file mode 100644
index 0000000..6f0cb59
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/dispose/Step/Reason.vue
@@ -0,0 +1,122 @@
+<template>
+ <el-form :model="form" :disabled="disabled" label-width="140px" size="small" style="position: relative;">
+ <el-card :body-style="{ height: '350px', overflow: 'auto' }">
+ <el-form-item label="璐d换閮ㄩ棬">
+ <!-- <el-select
+ v-model="form.causeAnalysisPersonId"
+ placeholder="璇烽�夋嫨"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="(item, index) in userList"
+ :key="index"
+ :label="item.name"
+ :value="item.id"
+ ></el-option>
+ </el-select> -->
+ <el-select @change="filterUserList" v-model="form.causeAnalysisId" placeholder="璇烽�夋嫨"
+ style="width: 100%">
+ <el-option label="閫氫俊浜у搧瀹為獙瀹�" :value="18"></el-option>
+ <el-option label="鐢靛姏浜у搧瀹為獙瀹�" :value="19"></el-option>
+ </el-select>
+ </el-form-item>
+
+ <el-form-item label="浜哄憳閫夋嫨">
+ <el-select v-model="form.causeAnalysisPersonId" placeholder="璇烽�夋嫨" style="width: 100%">
+ <el-option v-for="(item, index) in userListTwo" :key="index" :label="item.name"
+ :value="item.id"></el-option>
+ </el-select>
+ </el-form-item>
+
+ <el-form-item label="鍘熷洜鍒嗘瀽">
+ <el-input type="textarea" v-model="form.causeAnalysis" :rows="2" placeholder="璇疯緭鍏ュ唴瀹�">
+ </el-input>
+ </el-form-item>
+ </el-card>
+ <el-form-item label-width="0">
+ <div style="display: flex; width: 100%; justify-content: space-between; margin-top: 15px;">
+ <div>
+ <span>鎿嶄綔浜猴細{{ currentResponsible }}</span>
+ </div>
+ <div v-if="step == 1">
+ <el-button :disabled="false" @click="cancel">椹冲洖</el-button>
+ <el-button type="primary" @click="submit"
+ :disabled="(departId == 18 && ![12, 10, 16].includes(userId)) || (departId == 19 && ![35, 41, 16].includes(userId))">鎻愪氦</el-button>
+ </div>
+ </div>
+ </el-form-item>
+ </el-form>
+</template>
+<script>
+import { mapGetters } from "vuex";
+export default {
+ props: {
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ }
+ },
+ isPermission: {
+ type: Boolean,
+ default: false,
+ },
+ currentResponsible: {
+ type: String,
+ default: ''
+ },
+ userList: {
+ type: Array,
+ default: []
+ },
+ reasonForm: {
+ type: Object,
+ default: {}
+ },
+ step: {
+ type: Number,
+ default: 0
+ },
+ disabled: {
+ type: Boolean,
+ default: false
+ }
+ },
+ computed: {
+ form: {
+ get() {
+ return this.reasonForm
+ },
+ set(val) {
+ this.$emit('update:reasonForm', val)
+ }
+ },
+ ...mapGetters(["userId"]),
+ },
+ data() {
+ return {
+ userListTwo: []
+ }
+ },
+ mounted() {
+ this.userListTwo = JSON.parse(JSON.stringify(this.userList))
+ },
+ methods: {
+ filterUserList() {
+ this.userListTwo = this.userList.filter(item => item.departLimsId.includes(this.form.causeAnalysisId))
+ if (!this.userListTwo.some(item => item.id == this.form.causeAnalysisPersonId)) {
+ this.form.causeAnalysisPersonId = null
+ }
+ },
+ submit() {
+ this.$emit('nextStep', 'submit')
+ },
+ save() {
+ this.$emit('nextStep', 'save')
+ },
+ cancel() {
+ this.$emit('cancel', 'cancel')
+ }
+ }
+}
+</script>
\ No newline at end of file
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Records/dispose/Step/Result.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/dispose/Step/Result.vue
new file mode 100644
index 0000000..3f47dd2
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/dispose/Step/Result.vue
@@ -0,0 +1,111 @@
+<template>
+ <el-form :model="form" :disabled="disabled" label-width="130px" size="small" style="position: relative">
+ <el-card :body-style="{ height: '350px', overflow: 'auto' }">
+ <el-form-item label="楠岃瘉閮ㄩ棬">
+ <!-- <el-select
+ v-model="form.verificationDepartmentPersonId"
+ placeholder="璇烽�夋嫨"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="(item, index) in userList"
+ :key="index"
+ :label="item.name"
+ :value="item.id"
+ ></el-option>
+ </el-select> -->
+ <el-input :disabled="true" v-model="form.verificationDepartment"></el-input>
+ </el-form-item>
+
+ <el-form-item label="浜哄憳閫夋嫨">
+ <el-select v-model="form.verificationDepartmentPersonId" placeholder="璇烽�夋嫨" style="width: 100%">
+ <el-option v-for="(item, index) in userList" :key="index" :label="item.name"
+ :value="item.id"></el-option>
+ </el-select>
+ </el-form-item>
+
+ <el-form-item label="瀹炴柦楠岃瘉缁撴灉">
+ <el-input type="textarea" v-model="form.implementationVerificationResults" :rows="2"
+ placeholder="璇疯緭鍏ュ唴瀹�">
+ </el-input>
+ </el-form-item>
+ </el-card>
+ <el-form-item label-width="0">
+ <div style="display: flex; width: 100%; justify-content: space-between; margin-top: 15px;">
+ <div>
+ 鎿嶄綔浜猴細{{ currentResponsible }}
+ </div>
+ <div v-if="step == 3">
+ <el-button :disabled="false" @click="cancel">椹冲洖</el-button>
+ <el-button type="primary" @click="submit"
+ :disabled="(departId == 18 && ![12, 10, 16].includes(userId)) || (departId == 19 && ![35, 41, 16].includes(userId))">鎻愪氦</el-button>
+ </div>
+ </div>
+ </el-form-item>
+ </el-form>
+</template>
+<script>
+import { mapGetters } from "vuex";
+export default {
+ props: {
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ }
+ },
+ isPermission: {
+ type: Boolean,
+ default: false,
+ },
+ currentResponsible: {
+ type: String,
+ default: ''
+ },
+ resultForm: {
+ type: Object,
+ default: {}
+ },
+ step: {
+ type: Number,
+ default: 0
+ },
+ disabled: {
+ type: Boolean,
+ default: false
+ },
+ userList: {
+ type: Array,
+ default: []
+ },
+ },
+ computed: {
+ form: {
+ get() {
+ this.$set(this.resultForm, 'verificationDepartment', '璐ㄩ噺璐熻矗浜�')
+ return this.resultForm
+ },
+ set(val) {
+ this.$emit('update:resultForm', val)
+ }
+ },
+ ...mapGetters(["userId"]),
+ },
+ data() {
+ return {
+ }
+ },
+ methods: {
+ submit() {
+ this.$emit('nextStep', 'submit')
+ },
+ save() {
+ this.$emit('nextStep', 'save')
+ },
+ cancel() {
+ this.$emit('cancel', 'cancel')
+ }
+ }
+}
+</script>
+<style scoped></style>
\ No newline at end of file
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Records/dispose/index.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/dispose/index.vue
new file mode 100644
index 0000000..7dad14c
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/dispose/index.vue
@@ -0,0 +1,239 @@
+<template>
+ <div>
+ <el-dialog title="绾犻敊澶勭悊鍗�" :visible.sync="dialogVisible">
+ <el-steps :active="active" finish-status="success" :align-center="true">
+ <el-step style="cursor: pointer;" v-for="(item, index) in stepList" :key="index" :title="item.label"
+ @click.native="setStep(item.value)"></el-step>
+ </el-steps>
+ <el-divider></el-divider>
+ <Fact v-if="pageStatus == 0" :departId="departId" :isPermission="isPermission"
+ :factForm.sync="mainForm.factForm" :userList="userList" :currentResponsible="currentResponsible"
+ :disabled="active != 0" :step="active" @nextStep="submit" @cancel="cancel"></Fact>
+ <Reason v-if="pageStatus == 1" :isPermission="isPermission" :departId="departId"
+ :reasonForm.sync="mainForm.reasonForm" :userList="userList" :currentResponsible="currentResponsible"
+ :disabled="active != 1" :step="active" @nextStep="submit" @cancel="cancel"></Reason>
+ <Measure v-if="pageStatus == 2" :departId="departId" :isPermission="isPermission"
+ :measureForm.sync="mainForm.measureForm" :userList="userList" :currentResponsible="currentResponsible"
+ :disabled="active != 2" :step="active" @nextStep="submit" @cancel="cancel"></Measure>
+ <Result v-if="pageStatus == 3" :departId="departId" :isPermission="isPermission"
+ :resultForm.sync="mainForm.resultForm" :userList="userList" :currentResponsible="currentResponsible"
+ :disabled="active != 3" :step="active" @nextStep="submit" @cancel="cancel"></Result>
+ <!-- <div slot="footer" class="dialog-footer">
+ <el-button v-if="active == 4" type="primary" @click="submit(5)">瀹屾垚</el-button>
+ </div> -->
+ </el-dialog>
+ </div>
+</template>
+<script>
+import Fact from './Step/Fact.vue'
+import Reason from './Step/Reason.vue'
+import Measure from './Step/Measure.vue'
+import Result from './Step/Result.vue'
+import { dateFormat } from '@/utils/date.js'
+import {
+ selectUserList,
+ personSupervisionProcessingPage,
+ addOrUpdatePersonnelServiceProcessing
+} from '@/api/cnas/personnel/personnelInfo.js'
+export default {
+ props: {
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ }
+ },
+ },
+ components: {
+ Fact, Reason, Measure, Result
+ },
+ data() {
+ return {
+ isPermission: true,
+ active: 0,
+ pageStatus: 0,
+ dialogVisible: false,
+ currentResponsible: undefined,
+ stepList: [
+ {
+ label: '闂鎻忚堪',
+ value: 0
+ }, {
+ label: '鍘熷洜鍒嗘瀽',
+ value: 1
+ }, {
+ label: '绾犳鎺柦',
+ value: 2
+ }, {
+ label: '楠岃瘉缁撴灉',
+ value: 3
+ }
+ ],
+ supervisionRecordId: undefined,
+ processId: undefined,
+ mainForm: {
+ factForm: {
+ proposingDepartmentPersonId: undefined,
+ descriptionNonconformity: undefined
+ },
+ reasonForm: {
+ causeAnalysisPersonId: undefined,
+ causeAnalysis: undefined
+ },
+ measureForm: {
+ correctiveActionId: undefined,
+ correctiveMeasure: undefined,
+ requestDepartmentConfirmation: undefined
+ },
+ resultForm: {
+ verificationDepartmentPersonId: undefined,
+ implementationVerificationResults: undefined
+ }
+ },
+ userList: [],
+ }
+ },
+ mounted() {
+ this.isPermission = isPermission("isSubmit")
+ console.log('鏉冮檺', this.isPermission);
+ },
+ methods: {
+ openDialog(id) {
+ this.dialogVisible = true
+ this.getUserList()
+ this.getProcessData(id)
+ },
+ /**
+ * @desc 鑾峰彇鐢ㄦ埛淇℃伅
+ */
+ async getUserList() {
+ const { code, data } = await selectUserList()
+ if (code == 200) {
+ this.userList = data
+ }
+ },
+ /**
+ * @desc 鏌ヨ鐩戠潱璁板綍澶勭悊鍗�
+ * @param {鐩戠潱璁板綍id} id
+ */
+ async getProcessData(id) {
+ const { code, data } = await personSupervisionProcessingPage({ id })
+ if (code == 202) {
+ this.controlType = '鏂板'
+ this.supervisionRecordId = id
+ this.active = 0
+ this.pageStatus = 0
+ this.processId = undefined
+ }
+ if (code == 200) {
+ this.currentResponsible = data.currentResponsible
+ this.controlType = '缂栬緫'
+ this.supervisionRecordId = id
+ this.processId = data.processingId
+ this.active = Number(data.currentState)
+ this.pageStatus = Number(data.currentState === 2 ? 0 : data.currentState)
+ // 绗�1姝ユ暟鎹�
+ this.mainForm.factForm.proposingDepartmentPersonId = data.proposingDepartmentPersonId
+ this.mainForm.factForm.descriptionNonconformity = data.descriptionNonconformity
+ // 绗�2姝ユ暟鎹�
+ this.mainForm.reasonForm.causeAnalysisPersonId = data.causeAnalysisPersonId
+ this.mainForm.reasonForm.causeAnalysis = data.causeAnalysis
+ // 绗�3姝ユ暟鎹�
+ this.mainForm.measureForm.correctiveActionId = data.correctiveActionId
+ this.mainForm.measureForm.correctiveMeasure = data.correctiveMeasure
+ this.mainForm.measureForm.requestDepartmentConfirmation = data.requestDepartmentConfirmation
+ // 绗�4姝ユ暟鎹�
+ this.mainForm.resultForm.verificationDepartmentPersonId = data.verificationDepartmentPersonId
+ this.mainForm.resultForm.implementationVerificationResults = data.implementationVerificationResults
+ }
+ },
+ closeDialog() {
+ this.dialogVisible = false
+ },
+ submit(type) {
+ let currentState = undefined
+ if (type == 'submit') {
+ currentState = this.active + 1
+ } else if (type == 'save') {
+ currentState = undefined
+ }
+ if (this.active == 0) {
+ // 绗�1姝�
+ console.log('绗�1姝�', this.active, currentState)
+ let { factForm } = this.mainForm
+ this.submitForm({
+ proposingDepartmentDate: dateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss'),
+ currentState: currentState,
+ ...factForm
+ })
+ } else if (this.active == 1) {
+ // 绗�2姝�
+ console.log('绗�2姝�', this.active, currentState)
+ let { reasonForm } = this.mainForm
+ this.submitForm({
+ causeAnalysisDate: dateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss'),
+ currentState: currentState,
+ ...reasonForm
+ })
+ } else if (this.active == 2) {
+ // 绗�3姝�
+ console.log('绗�3姝�', this.active, currentState)
+ let { measureForm } = this.mainForm
+ let { requestDepartmentConfirmation, ...measureFormRest } = measureForm
+ this.submitForm({
+ correctiveActionDate: dateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss'),
+ currentState: currentState,
+ requestDepartmentConfirmation: requestDepartmentConfirmation ? 1 : 2,
+ ...measureFormRest
+ })
+ } else if (this.active == 3) {
+ // 绗�4姝�
+ console.log('绗�4姝�', this.active, currentState)
+ let { resultForm } = this.mainForm
+ this.submitForm({
+ verificationDepartmentDate: dateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss'),
+ currentState: currentState,
+ ...resultForm
+ })
+ }
+ },
+ /**
+ * @desc 鎻愪氦琛ㄥ崟
+ */
+ async submitForm(form) {
+ console.log('鎻愪氦琛ㄥ崟', form)
+ const { code } = await addOrUpdatePersonnelServiceProcessing({
+ processingId: this.processId,
+ supervisionRecordId: this.supervisionRecordId,
+ ...form
+ })
+ if (this.controlType == '鏂板') {
+ if (code == 200) {
+ this.$message.success('鎻愪氦鎴愬姛')
+ }
+ } else if (this.controlType == '缂栬緫') {
+ if (code == 200) {
+ this.$message.success('鎻愪氦鎴愬姛')
+ }
+ }
+ this.$emit('getTableData')
+ this.dialogVisible = false
+ },
+ /**
+ * @desc 椹冲洖
+ */
+ cancel() {
+ let currentState = this.active - 1
+ this.submitForm({
+ id: this.processId,
+ supervisionRecordId: this.supervisionRecordId,
+ currentState: currentState,
+ })
+ },
+ setStep(e) {
+ console.log(e)
+ this.pageStatus = e
+ }
+ }
+}
+</script>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Records/index.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/index.vue
new file mode 100644
index 0000000..413d1a2
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/index.vue
@@ -0,0 +1,406 @@
+<template>
+ <div class="flex_column">
+ <div>
+ <TableCard :showTitle="false">
+ <template v-slot:form>
+ <div class="items_center">
+ <!-- <span>鍏抽敭瀛�</span>
+ <el-input size="small" class="search" v-model="superviseForm.searchVal" placeholder="璇疯緭鍏�"></el-input>
+ <el-button type="primary" size="small">鏌ヨ</el-button> -->
+ <el-button v-if="multipleSelection.length > 0" slot="reference" size="small" type="danger"
+ @click="delRecords">鍒犻櫎</el-button>
+ </div>
+ <div>
+ <el-button size="small" type="primary" @click="addRecord"
+ v-show="departId && departId != 1">鏂板</el-button>
+ </div>
+ </template>
+ <template v-slot:table>
+ <limsTable :column="superviseColumnData" :handleSelectionChange="handleSelectionChange"
+ :height="'calc(100vh - 19em)'" :isSelection="true" :table-data="superviseTableData"
+ :table-loading="superviseLoading" rowKey="id" style="margin-top: 18px; padding: 0 15px;"
+ :page="page" @pagination="pagination">
+ <div slot="action" slot-scope="scope">
+ <el-button type="text" @click="openDownloadDia(scope.row)">
+ <span>瀵煎嚭</span>
+ </el-button>
+ <el-button type="text" @click="openRecord(scope.row)">
+ <span>鐩戠潱璁板綍</span>
+ </el-button>
+ <el-button type="text" @click="openControl(scope.row.id)"
+ :disabled="scope.row.evaluationSupervisionSituation != '涓嶇鍚�'">
+ <span :style="renderBtn(scope.row.currentStateControl)">鎺у埗鍗�</span>
+ </el-button>
+ <el-button type="text" @click="openDispose(scope.row.id)"
+ :disabled="scope.row.correctiveMeasure != '1'">
+ <span :style="renderBtn(scope.row.currentStateProcessing)">澶勭悊鍗�</span>
+ </el-button>
+ </div>
+ </limsTable>
+ </template>
+ </TableCard>
+ </div>
+ <RecordAdd ref="recordModal" @submit="getTableData" :departId="departId"></RecordAdd>
+ <ControlModal ref="controlModal" @getTableData="getTableData" :departId="departId"></ControlModal>
+ <DisposeModal ref="disposeModal" @getTableData='getTableData' :departId="departId"></DisposeModal>
+ <el-dialog :visible.sync="downloadDialog" title="瀵煎嚭" width="600px">
+ <span>
+ <el-button :disabled="!download.currentStateControl" plain type="primary"
+ @click="controlDown">鎺у埗鍗曞鍑�</el-button>
+ <el-button :disabled="!download.currentStateProcessing" plain type="primary"
+ @click="processingDown">澶勭悊鍗曞鍑�</el-button>
+ <el-button plain type="primary" @click="supervisoryDown">鐩戠潱璁板綍瀵煎嚭</el-button>
+ </span>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="downloadDialog = false">鍙� 娑�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+<script>
+import TableCard from '@/components/TableCard/index.vue';
+import RecordAdd from "./Add.vue"
+import limsTable from "@/components/Table/lims-table.vue";
+import ControlModal from "./control/index.vue"
+import DisposeModal from "./dispose/index.vue"
+import {
+ personSupervisionRecordPage,
+ deletePersonSupervisionRecord,
+ exportSupervisionControlSheet,
+ exportSupervisionProcessingSheet,
+ exportPersonSupervisionRecord
+} from '@/api/cnas/personnel/personnelInfo.js'
+export default {
+ props: {
+ isDepartment: {
+ type: Boolean,
+ default: false
+ },
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ }
+ },
+ },
+ components: {
+ TableCard,
+ RecordAdd,
+ limsTable,
+ ControlModal,
+ DisposeModal
+ },
+ data() {
+ return {
+ loading: false,
+ page: {
+ current: 1,
+ pageSize: 20,
+ total: 0
+ },
+ // 鐩戠潱璁板綍
+ superviseForm: {
+ searchVal: undefined
+ },
+ superviseColumnData: [
+ // {
+ // label: 'id',
+ // prop: 'id'
+ // },
+ {
+ label: '妫�娴嬩汉鍛�',
+ prop: 'testerName',
+ width: 120
+ }, {
+ label: '鐩戠潱浜哄憳',
+ prop: 'supervisorName',
+ width: 120
+ }, {
+ label: '妫�楠岄」鐩�',
+ prop: 'testItem',
+ width: 120
+ }, {
+ label: '鏍峰搧缂栧彿',
+ prop: 'sampleNumber',
+ width: 120
+ }, {
+ label: '妫�楠屾棩鏈�',
+ prop: 'detectionDate',
+ width: 160
+ }, {
+ label: '鎺у埗鍗曠姸鎬�',
+ prop: 'currentStateControl',
+ formatData: (item) => {
+ let result = undefined
+ switch (item) {
+ case '0':
+ result = '宸ヤ綔鎯呭喌'
+ break;
+ case '1':
+ result = '琚洃鐫d汉纭'
+ break;
+ case '2':
+ result = '澶勭悊鎺柦'
+ break;
+ case '3':
+ result = '绾犳鎺柦'
+ break;
+ case '4':
+ result = '閫氱煡瀹㈡埛'
+ break;
+ }
+ return result
+ },
+ width: 140,
+ }, {
+ label: '娴佺▼鍗曠姸鎬�',
+ prop: 'currentStateProcessing',
+ formatData: (item) => {
+ let result = undefined
+ switch (item) {
+ case '0':
+ result = '闂鎻忚堪'
+ break;
+ case '1':
+ result = '鍘熷洜鍒嗘瀽'
+ break;
+ case '2':
+ result = '绾犳鎺柦'
+ break;
+ case '3':
+ result = '楠岃瘉缁撴灉'
+ break;
+ }
+ return result
+ },
+ width: 140,
+ }, {
+ label: '浜哄憳',
+ prop: 'personnel',
+ width: 150
+ }, {
+ label: '璁惧浠櫒',
+ prop: 'instrumentEquipment',
+ width: 140
+ }, {
+ label: '宸ヤ綔鐜',
+ prop: 'workingEnvironment',
+ width: 140
+ }, {
+ label: '鏍峰搧閲囬泦',
+ prop: 'sampleCollection',
+ width: 140
+ }, {
+ label: '鏍峰搧鐨勫噯澶�',
+ prop: 'samplePreparation',
+ width: 140
+ }, {
+ label: '妫�楠屾柟娉�',
+ prop: 'testMethod',
+ width: 120
+ }, {
+ label: '妫�娴嬭褰�',
+ prop: 'testingRecords',
+ width: 120
+ }, {
+ label: '妫�楠屾姤鍛�',
+ prop: 'testReport',
+ width: 120
+ }, {
+ label: '鐩戠潱鎯呭喌璇勪环',
+ prop: 'evaluationSupervisionSituation',
+ width: 140
+ }, {
+ label: '涓嶇鍚堝鐞嗘剰瑙�',
+ prop: 'doNotMeetTheHandlingOpinions',
+ width: 140
+ }, {
+ fixed: 'right',
+ dataType: "slot",
+ width: 280,
+ label: '鎿嶄綔',
+ slot: 'action',
+ }
+ ],
+ superviseTableData: [],
+ superviseLoading: false,
+ multipleSelection: [],
+ downloadDialog: false,
+ download: {
+ currentStateControl: '',
+ currentStateProcessing: '',
+ },
+ downloadId: '',
+ }
+ },
+ mounted() {
+ this.getTableData()
+ },
+ methods: {
+ /**
+ * @desc 鑾峰彇鏍戠殑浜哄憳id
+ */
+ getDepart() {
+ this.getTableData()
+ },
+ pagination({ page, limit }) {
+ this.page.current = page;
+ this.page.pageSize = limit;
+ this.getTableData();
+ },
+ // 鑾峰彇鐩戠潱璁板綍
+ async getTableData() {
+ this.loading = true
+ const { code, data } = await personSupervisionRecordPage({
+ departLimsId: this.isDepartment ? this.departId : null,
+ userId: this.isDepartment ? null : this.departId,
+ current: this.page.current,
+ size: this.page.pageSize
+ })
+ if (code == 200) {
+ this.superviseTableData = data.records
+ this.page.total = data.total
+ }
+ this.loading = false
+ },
+ // 鏂板鐩戠潱璁板綍
+ addRecord(row, type = false) {
+ this.$refs.recordModal.openDialog({ departId: this.departId, ...row }, type)
+ },
+ openRecord(row) {
+ this.$refs.recordModal.openDialog(row, true)
+ },
+ // 鎵撳紑瀵煎嚭寮规
+ openDownloadDia(row) {
+ this.downloadDialog = true
+ this.download = row
+ console.log('this.download', this.download.currentStateProcessing, this.download.currentStateControl);
+ this.downloadId = row.id
+ },
+ // 鎺у埗鍗曞鍑�
+ controlDown() {
+ exportSupervisionControlSheet({ supervisionRecordId: this.downloadId }).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/msword' });
+ this.$download.saveAs(blob, '鎺у埗鍗曞鍑�' + '.docx')
+ })
+ },
+ // 澶勭悊鍗曞鍑�
+ processingDown() {
+ exportSupervisionProcessingSheet({ supervisionRecordId: this.downloadId }).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/msword' });
+ this.$download.saveAs(blob, '澶勭悊鍗曞鍑�' + '.docx')
+ })
+ },
+ // 鐩戠潱璁板綍瀵煎嚭
+ supervisoryDown() {
+ exportPersonSupervisionRecord({ id: this.downloadId }).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/msword' });
+ this.$download.saveAs(blob, '鐩戠潱璁板綍瀵煎嚭' + '.docx')
+ })
+ },
+ // 鏄剧ず鎺у埗鍗�
+ openControl(id) {
+ this.$refs.controlModal.openDialog(id)
+ },
+ // 鏄剧ず澶勭悊鍗�
+ openDispose(id) {
+ this.$refs.disposeModal.openDialog(id)
+ },
+ // 琛ㄦ牸澶氶�夋縺娲诲悗鍋氫粈涔�
+ handleSelectionChange(val) {
+ this.multipleSelection = val
+ },
+ /**
+ * @desc 鎵归噺鍒犻櫎鐩戠潱璁板綍
+ */
+ delRecords() {
+ this.$confirm(
+ '姝ゆ搷浣滃皢鍒犻櫎閫変腑鏁版嵁, 鏄惁缁х画?',
+ '鎻愮ず',
+ {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ })
+ .then(() => {
+ console.log(this.multipleSelection)
+ let ids = this.multipleSelection.map((item) => item.id)
+ const code = this.delTableData(ids)
+ this.$message({
+ type: code == 200 ? 'success' : 'error',
+ message: code == 200 ? '鍒犻櫎鎴愬姛锛�' : '鍒犻櫎澶辫触锛�'
+ });
+ this.getTableData()
+ })
+ },
+ // 鍒犻櫎api
+ async delTableData(ids) {
+ const { code } = await this.$axios({
+ method: 'delete',
+ url: deletePersonSupervisionRecord,
+ data: ids
+ })
+ return code
+ },
+ // 琛岃儗鏅壊
+ renderBtn(currentState) {
+ let status = Number(currentState)
+ let res = {}
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ res = { color: '#337ecc' }
+ break;
+ case 2:
+ res = { color: '#409EFF' }
+ break;
+ case 3:
+ res = { color: '#79bbff' }
+ break;
+ case 4:
+ res = { color: '#a0cfff' }
+ break;
+ }
+ return res;
+ }
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ departId: {
+ handler(newId, oldId) {
+ if (this.isDepartment) {
+ this.getTableData();
+ } else {
+ this.getTableData()
+ }
+ }
+ }
+ }
+}
+</script>
+<style scoped>
+.flex_column {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+
+
+.items_center {
+ display: flex;
+ align-items: center;
+}
+
+.date_box {
+ margin: 0 5px;
+}
+
+.search {
+ width: 150px;
+ padding: 0 16px;
+}
+</style>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Records/supervise/ApproveForm.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/supervise/ApproveForm.vue
new file mode 100644
index 0000000..6563eb8
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/supervise/ApproveForm.vue
@@ -0,0 +1,84 @@
+<template>
+ <el-form
+ :model="form"
+ label-width="100px"
+ :disabled="disabled"
+ size="small"
+ >
+ <el-form-item label="鎶�鏈礋璐d汉">
+ <el-select
+ v-model="form.technicalDirector"
+ placeholder="璇烽�夋嫨"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="(item, index) in userList"
+ :key="index"
+ :label="item.name"
+ :value="item.id"
+ ></el-option>
+ </el-select>
+ </el-form-item>
+ <!-- <el-form-item label="瀹℃壒">
+ <el-input
+ type="textarea"
+ :rows="2"
+ placeholder="璇疯緭鍏�"
+ ></el-input>
+ </el-form-item> -->
+ <el-form-item v-if="!disabled" style="text-align: right;">
+ <el-button size="small" type="danger" @click="close">椹冲洖</el-button>
+ <el-button size="small" type="primary" @click="submit">鎻愪氦</el-button>
+ </el-form-item>
+ </el-form>
+</template>
+<script>
+export default {
+ props: {
+ userList: {
+ type: Array,
+ default: () => {
+ return []
+ }
+ },
+ approveForm: {
+ type: Object,
+ default: {}
+ },
+ isEdit: {
+ type: Boolean,
+ default: false
+ },
+ disabled: {
+ type: Boolean,
+ default: false
+ }
+ },
+ computed: {
+ form: {
+ get() {
+ return this.approveForm
+ },
+ set(val) {
+ this.$emit('approveForm', val)
+ }
+ }
+ },
+ data() {
+ return {
+
+ }
+ },
+ methods: {
+ submit() {
+ this.$emit('submit', 2)
+ },
+ /**
+ * @desc 椹冲洖
+ */
+ close() {
+ this.$emit('close', 2)
+ }
+ }
+}
+</script>
\ No newline at end of file
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Records/supervise/SuperviseForm.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/supervise/SuperviseForm.vue
new file mode 100644
index 0000000..92280f6
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Records/supervise/SuperviseForm.vue
@@ -0,0 +1,201 @@
+<template>
+ <el-form
+ :model="ruleForm"
+ :disabled="disabled"
+ label-width="100px"
+ size="small"
+ >
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="妫�娴嬩汉鍛�">
+ <el-select v-model="ruleForm.testerId" placeholder="璇烽�夋嫨" style="width: 100%">
+ <el-option
+ v-for="(item, index) in userList"
+ :key="index"
+ :label="item.name"
+ :value="item.id"
+ ></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鐩戠潱鍛�">
+ <el-select v-model="ruleForm.supervisorId" placeholder="璇烽�夋嫨" style="width: 100%">
+ <el-option
+ v-for="(item, index) in userList"
+ :key="index"
+ :label="item.name"
+ :value="item.id"
+ ></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="妫�娴嬮」鐩�">
+ <el-input v-model="ruleForm.testItem" placeholder="璇疯緭鍏�"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鏍峰搧缂栧彿">
+ <el-input v-model="ruleForm.sampleNumber" placeholder="璇疯緭鍏�"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="妫�娴嬫棩鏈�">
+ <el-date-picker
+ v-model="ruleForm.detectionDate"
+ value-format="yyyy-MM-dd"
+ type="date"
+ placeholder="閫夋嫨鏃ユ湡"
+ style="width: 100%;"
+ >
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="浜哄憳">
+ <!-- <el-select
+ v-model="ruleForm.personnel"
+ placeholder="璇烽�夋嫨"
+ style="width: 100%"
+ multiple
+ >
+ <el-option
+ v-for="(item, index) in userList"
+ :key="index"
+ :label="item.name"
+ :value="item.id"
+ ></el-option>
+ </el-select> -->
+ <el-input v-model="ruleForm.personnel" type="textarea" :rows="2" style="width: 100%" placeholder="璇疯緭鍏�"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="浠櫒璁惧">
+ <el-input v-model="ruleForm.instrumentEquipment" placeholder="璇疯緭鍏�"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="宸ヤ綔鐜">
+ <el-input v-model="ruleForm.workingEnvironment" placeholder="璇疯緭鍏�"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="鏍峰搧閲囬泦">
+ <el-input v-model="ruleForm.sampleCollection" placeholder="璇疯緭鍏�"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鏍峰搧鐨勫噯澶�">
+ <el-input v-model="ruleForm.samplePreparation" placeholder="璇疯緭鍏�"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="妫�娴嬫柟娉�">
+ <el-input v-model="ruleForm.testMethod" placeholder="璇疯緭鍏�"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="妫�娴嬭褰�">
+ <el-input v-model="ruleForm.testingRecords" placeholder="璇疯緭鍏�"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="妫�娴嬫姤鍛�">
+ <el-input v-model="ruleForm.testReport" placeholder="璇疯緭鍏�"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鐩戠潱鎯呭喌璇勪环">
+ <el-select v-model="ruleForm.evaluationSupervisionSituation" placeholder="璇烽�夋嫨" style="width: 100%;">
+ <el-option label="绗﹀悎" value="绗﹀悎"></el-option>
+ <el-option label="涓嶇鍚�" value="涓嶇鍚�"></el-option>
+ </el-select>
+
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="澶勭悊鎰忚">
+ <el-input v-model="ruleForm.doNotMeetTheHandlingOpinions" placeholder="璇疯緭鍏�"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col v-show="isEdit && !disabled" :span="24">
+ <el-form-item style="text-align: right;">
+ <el-button size="small" @click="close">鍙栨秷</el-button>
+ <el-button size="small" type="primary" @click="approve">瀹℃壒</el-button>
+ </el-form-item>
+ </el-col>
+ <el-col v-show="!isEdit" :span="24">
+ <el-form-item style="text-align: right;">
+ <el-button size="small" type="primary" @click="addData">鎻愪氦</el-button>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+</template>
+<script>
+
+export default {
+ props: {
+ isEdit: {
+ type: Boolean,
+ default: false
+ },
+ userList: {
+ type: Array,
+ default: () => {
+ return []
+ }
+ },
+ superviseForm: {
+ type: Object,
+ default: {}
+ },
+ disabled: {
+ type: Boolean,
+ default: false
+ }
+ },
+ computed: {
+ ruleForm: {
+ get() {
+ return this.superviseForm
+ },
+ set(val) {
+ this.$emit('superviseForm', val)
+ }
+ }
+ },
+ data() {
+ return {
+ }
+ },
+ methods: {
+ close() {
+ this.$emit('close')
+ },
+ approve() {
+ this.$emit('submit', 1)
+ },
+ addData() {
+ this.$emit('addData', 1)
+ }
+ }
+}
+</script>
\ No newline at end of file
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/TrainingRecord/index.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/TrainingRecord/index.vue
new file mode 100644
index 0000000..4f228e4
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/TrainingRecord/index.vue
@@ -0,0 +1,285 @@
+<!-- 鍩硅璁板綍 -->
+<template>
+ <div>
+ <div class="flex_table">
+ <div v-if="isDepartment" style="width: 50%">
+ <TableCard :showTitle="false">
+ <template v-slot:form>
+ <div class="items_center">
+ <span>濮撳悕</span>
+ <el-input v-model="trainingPagination.userName" class="search" clearable placeholder="璇疯緭鍏�"
+ size="small"></el-input>
+ <el-button size="small" type="primary" @click="getPersonnelTraining(departId)">鏌ヨ</el-button>
+ </div>
+ <div>
+ <!-- <el-button :loading="outLoading" size="small" type="primary" @click="exportExcel">瀵煎嚭</el-button>-->
+ </div>
+ </template>
+ <template v-slot:table>
+ <limsTable :column="trainingColumn" :currentChange="currentChange" :height="'calc(100vh - 18em)'"
+ :highlightCurrentRow="true" :table-data="trainingTableData" :table-loading="trainingLoading"
+ style="padding: 0 15px;" :page="trainingPagination" @pagination="trainingPaginationMethod">
+ </limsTable>
+ </template>
+ </TableCard>
+ </div>
+ <div :style="`width: ${isDepartment ? '50%' : '100%'};`">
+ <TableCard :showTitle="false">
+ <template v-slot:form>
+ <div class="items_center">
+ <span>骞翠唤</span>
+ <el-date-picker v-model="searchForm.trainingDate" clearable format="yyyy" placeholder="閫夋嫨骞�" size="small"
+ style="margin: 0 10px" type="year" value-format="yyyy">
+ </el-date-picker>
+ <el-button size="small" type="primary"
+ @click="queryPersonnelDetailsPage(currentChangeRow.userId)">鏌ヨ</el-button>
+ <el-button size="small" type="primary" @click="openDownloadDia(currentChangeRow)">瀵煎嚭</el-button>
+ </div>
+ </template>
+ <template v-slot:table>
+ <limsTable :column="trainingPersonColumn" :height="'calc(100vh - 18em)'"
+ :table-data="trainingPersonTableData" :table-loading="trainingPersonLoading" style="padding: 0 15px;"
+ :page="trainingPersonPagination" @pagination="trainingPersonPaginationMethod">
+ </limsTable>
+ </template>
+ </TableCard>
+ </div>
+ </div>
+ </div>
+</template>
+
+<script>
+import limsTable from "@/components/Table/lims-table.vue";
+import TableCard from "@/components/TableCard/index.vue";
+import {
+ exportTrainingRecord,
+ trainingSelectTrainingRecord,
+ queryPersonnelDetails,
+} from '@/api/cnas/personnel/personnelInfo.js'
+export default {
+ components: { TableCard, limsTable },
+ props: {
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ }
+ },
+ isDepartment: {
+ type: Boolean,
+ default: false
+ }
+ },
+ data() {
+ return {
+ outLoading: false,
+ trainingForm: {},
+ trainingColumn: [
+ {
+ label: '鍛樺伐缂栧彿',
+ prop: 'account',
+ width: '100'
+ }, {
+ label: '濮撳悕',
+ prop: 'name'
+ }, {
+ label: '鎵�鍦ㄩ儴闂�',
+ prop: 'departLimsName',
+ width: '150'
+ }, {
+ label: '鑱岀О',
+ prop: 'professionalTitle'
+ }, {
+ label: '鏈�楂樺鍘�',
+ prop: 'officialAcademicRedentials',
+ width: '100'
+ }, {
+ label: '鍏ュ崟浣嶆椂闂�',
+ prop: 'unitTime',
+ width: '150'
+ },
+ // {
+ // fixed: 'right',
+ // dataType: 'action',
+ // width: 80,
+ // label: '鎿嶄綔',
+ // operation: [
+ // {
+ // name: '瀵煎嚭',
+ // type: 'text',
+ // clickFun: (row) => {
+ // this.openDownloadDia(row)
+ // }
+ // }
+ // ]
+ // }
+ ],
+ trainingTableData: [],
+ trainingLoading: false,
+ trainingPagination: {
+ size: 20,
+ total: 0,
+ current: 1,
+ userName: null
+ },
+ searchForm: {
+ trainingDate: ''
+ },
+ trainingPersonColumn: [
+ {
+ label: '鍩硅鏃ユ湡',
+ prop: 'trainingDate'
+ }, {
+ label: '鍩硅鍐呭',
+ prop: 'trainingContent'
+ }, {
+ label: '鍩硅璇炬椂',
+ prop: 'educationBackground'
+ }, {
+ label: '璇炬椂',
+ prop: 'classHour'
+ }, {
+ label: '鍩硅缁撴灉',
+ prop: 'examinationResults',
+ }, {
+ label: '澶囨敞',
+ prop: 'remarks'
+ }
+ ],
+ trainingPersonTableData: [],
+ trainingPersonLoading: false,
+ trainingPersonPagination: {
+ size: 20,
+ current: 1,
+ total: 0
+ },
+ currentChangeRow: '',
+ };
+ },
+ mounted() {
+ this.getPersonnelTraining(this.departId);
+ },
+ methods: {
+ // exportExcel() {
+ // this.outLoading = true;
+ // const name = this.isDepartment ? 'departmentId' : 'userId';
+ // this.$axios.get(this.$api.personnel.personTrackRecordExport + `&${name}=` + this.departId, { responseType: 'blob' }).then(res => {
+ // this.outLoading = false;
+ // this.$message.success('瀵煎嚭鎴愬姛');
+ // const blob = new Blob([res], { type: 'application/octet-stream' });
+ // const url = URL.createObjectURL(blob);
+ // const link = document.createElement('a');
+ // link.href = url;
+ // link.download = '鍩硅璁板綍.xlsx';
+ // link.click();
+ // }).catch(err => {
+ // this.outLoading = false;
+ // })
+ // },
+ // 鏌ヨ
+ refreshTable() {
+ this.getPersonnelTraining(this.departId);
+ },
+ // 鍩硅璁板綍瀵煎嚭
+ openDownloadDia(row) {
+ let date = this.searchForm.trainingDate
+ if (!date) {
+ date = this.$moment().format('YYYY')
+ }
+ console.log('date----', date);
+ exportTrainingRecord({
+ userId: row.userId,
+ trainingDate: date
+ }).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/msword' });
+ this.$download.saveAs(blob, '鍩硅璁板綍瀵煎嚭' + '.docx')
+ })
+ },
+ // 鑾峰彇瀹為獙瀹�-鍩硅璁″垝鍒楄〃淇℃伅
+ getPersonnelTraining(departId) {
+ // const name = this.isDepartment ? 'departmentId' : 'userId';
+ trainingSelectTrainingRecord({
+ departmentId: departId,
+ ...this.trainingPagination
+ }).then(res => {
+ this.trainingTableData = res.data.records;
+ this.trainingPagination.total = res.data.total;
+ if (this.trainingTableData.length > 0) {
+ this.currentChange(this.trainingTableData[0]);
+ }
+ });
+ },
+ // 鑾峰彇涓汉-鍩硅璁″垝鍒楄〃淇℃伅
+ currentChange(row) {
+ this.currentChangeRow = row
+ if (row === null) {
+ row = this.trainingTableData[0]
+ }
+ this.queryPersonnelDetailsPage(row.userId)
+ },
+ queryPersonnelDetailsPage(userId) {
+ if (this.searchForm.trainingDate === null) {
+ this.searchForm.trainingDate = ''
+ }
+ queryPersonnelDetails({
+ userId,
+ ...this.trainingPersonPagination
+ }).then(res => {
+ this.trainingPersonTableData = res.data.records;
+ this.trainingPersonPagination.total = res.data.total;
+ });
+ },
+ // 鍒嗛〉
+ trainingPaginationMethod({ page, limit }) {
+ this.trainingPagination.current = page;
+ this.trainingPagination.size = limit;
+ this.getPersonnelTraining(this.departId);
+ },
+ // 鍒嗛〉
+ trainingPersonPaginationMethod({ page, limit }) {
+ this.trainingPersonPagination.current = page;
+ this.trainingPersonPagination.size = limit;
+ this.queryPersonnelDetailsPage(this.currentChangeRow.userId);
+ },
+ },
+ watch: {
+ departId: {
+ handler(newId, oldId) {
+ if (this.isDepartment) {
+ this.getPersonnelTraining(newId);
+ } else {
+ this.queryPersonnelDetailsPage(newId)
+ }
+ }
+ }
+ }
+};
+</script>
+<style scoped>
+>>>.el-form-item {
+ margin-bottom: 13px;
+}
+
+.flex_table {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+}
+
+.pagination {
+ display: flex;
+ justify-content: space-between;
+ margin-top: 10px;
+}
+
+.items_center {
+ display: flex;
+ align-items: center;
+}
+
+.search {
+ width: 150px;
+ padding: 0 6px;
+}
+</style>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/rewardPunishmentRecord/index.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/rewardPunishmentRecord/index.vue
new file mode 100644
index 0000000..a9e1122
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/rewardPunishmentRecord/index.vue
@@ -0,0 +1,316 @@
+<!-- 濂栨儵璁板綍 -->
+<template>
+ <div>
+ <div style="text-align: left; margin-bottom: 15px;">
+ <label>濮撳悕</label>
+ <el-input v-model="search.userName" clearable placeholder="璇疯緭鍏ュ叧閿瓧" size="small" style="width: 20vh;"></el-input>
+ <label style="margin-left: 1em">濂栨儵鏃ユ湡</label>
+ <el-date-picker v-model="search.searchTimeList" :picker-options="pickerOptions" align="right" clearable
+ end-placeholder="缁撴潫鏃ユ湡" format="yyyy-MM-dd" range-separator="鑷�" size="small" start-placeholder="寮�濮嬫棩鏈�"
+ style="width: 20%" type="daterange" unlink-panels value-format="yyyy-MM-dd 00:00:00">
+ </el-date-picker>
+ <el-button size="small" type="primary" @click="getPersonnelTraining(departId)">鏌ヨ</el-button>
+ <div style="float: right;">
+ <el-button :loading="outLoading" size="small" type="primary" @click="handleDown">瀵煎嚭</el-button>
+ <el-button size="small" type="primary" @click="dialogVisible = true">鏂板</el-button>
+ </div>
+ </div>
+ <div class="table">
+ <el-table :data="tableData" height="70vh" style="width: 100%">
+ <el-table-column label="搴忓彿" type="index" width="120">
+ <template v-slot="scope">
+ <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="鍛樺伐缂栧彿" min-width="180" prop="account">
+ </el-table-column>
+ <el-table-column label="濮撳悕" min-width="180" prop="userName">
+ </el-table-column>
+ <el-table-column label="濂栨儵绾у埆" min-width="180" prop="rewardPunishLevel">
+ </el-table-column>
+ <el-table-column label="濂栨儵鏃堕棿" min-width="180" prop="rewardPunishTime">
+ </el-table-column>
+ <el-table-column label="濂栨儵鍚嶇О" min-width="180" prop="rewardPunishName">
+ </el-table-column>
+ <el-table-column label="濂栨儵鍏蜂綋鍐呭" min-width="120" prop="rewardPunishContent">
+ </el-table-column>
+ <el-table-column label="濂栨儵鍗曚綅" min-width="180" prop="rewardPunishWorkUnit">
+ </el-table-column>
+ <el-table-column label="鍒涘缓浜�" min-width="180" prop="createUserName">
+ </el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔" width="100">
+ <template v-slot="scope">
+ <el-button size="small" type="text" @click="editForm(scope.row)">缂栬緫</el-button>
+ <el-button size="small" type="text" @click="deleteRow(scope.row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]"
+ :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
+ @current-change="handleCurrentChange">
+ </el-pagination>
+ </div>
+ <el-dialog :visible.sync="dialogVisible" title="鎻愮ず" width="50%" @open="getUserList">
+ <div style="height: 40vh">
+ <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+ <el-col :span="12">
+ <el-form-item label="鍛樺伐缂栧彿">
+ <el-input v-model="form.account" disabled size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍛樺伐濮撳悕" prop="userName">
+ <el-select v-model="form.userName" placeholder="璇烽�夋嫨" size="small" style="width: 100%" value-key="id"
+ @change="selectUserChange">
+ <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="濂栨儵绾у埆" prop="rewardPunishLevel">
+ <el-input v-model="form.rewardPunishLevel" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="濂栨儵鍚嶇О" prop="rewardPunishName">
+ <el-input v-model="form.rewardPunishName" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="濂栨儵鏃堕棿" prop="rewardPunishTime">
+ <el-date-picker v-model="form.rewardPunishTime" format="yyyy-MM-dd HH:mm:ss" placeholder="閫夋嫨鏃ユ湡"
+ size="small" style="width: 100%" type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="濂栨儵鍗曚綅" prop="rewardPunishWorkUnit">
+ <el-input v-model="form.rewardPunishWorkUnit" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="濂栨儵鍐呭">
+ <el-input v-model="form.rewardPunishContent" :rows="2" size="small" type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-form>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="saveOrUpdate">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import {
+ deleteRewardPunishment,
+ addOrUpdateRewardPunishment,
+ rewardPunishmentPage
+} from '@/api/cnas/personnel/personnelInfo.js'
+export default {
+ props: {
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ }
+ },
+ isDepartment: {
+ type: Boolean,
+ default: false
+ }
+ },
+ data() {
+ return {
+ tableData: [],
+ search: {
+ size: 20,
+ current: 1,
+ total: 0,
+ userName: '',
+ searchTimeList: []
+ },
+ form: {},
+ dialogVisible: false,
+ outLoading: false,
+ pickerOptions: {
+ shortcuts: [{
+ text: '鏈�杩戜竴鍛�',
+ onClick(picker) {
+ const end = new Date();
+ const start = new Date();
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+ picker.$emit('pick', [start, end]);
+ }
+ }, {
+ text: '鏈�杩戜竴涓湀',
+ onClick(picker) {
+ const end = new Date();
+ const start = new Date();
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+ picker.$emit('pick', [start, end]);
+ }
+ }, {
+ text: '鏈�杩戜笁涓湀',
+ onClick(picker) {
+ const end = new Date();
+ const start = new Date();
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+ picker.$emit('pick', [start, end]);
+ }
+ }]
+ },
+ rules: {
+ userName: [{
+ required: true, message: '璇烽�夋嫨鍛樺伐濮撳悕', trigger: 'change'
+ }],
+ rewardPunishLevel: [{
+ required: true, message: '璇疯緭鍏ュ鎯╃骇鍒�', trigger: 'blur'
+ }],
+ rewardPunishName: [{
+ required: true, message: '璇疯緭鍏ュ鎯╁悕绉�', trigger: 'blur'
+ }],
+ rewardPunishTime: [{
+ required: true, message: '璇疯緭鍏ュ鎯╂椂闂�', trigger: 'blur'
+ }],
+ rewardPunishWorkUnit: [{
+ required: true, message: '璇疯緭鍏ュ鎯╁崟浣�', trigger: 'blur'
+ }]
+ },
+ responsibleOptions: []
+ };
+ },
+ mounted() {
+ this.getPersonnelTraining(this.departId);
+ },
+ methods: {
+ handleSizeChange(val) {
+ this.search.size = val
+ this.getPersonnelTraining(this.departId);
+ },
+ handleCurrentChange(val) {
+ this.search.current = val
+ this.getPersonnelTraining(this.departId);
+ },
+ async getPersonnelTraining() {
+ const { code, data } = await rewardPunishmentPage({
+ userId: this.isDepartment ? '' : this.departId,
+ departmentId: this.isDepartment ? this.departId : '',
+ current: this.search.curent,
+ size: this.search.size,
+ userName: this.search.userName,
+ startTime: this.search.searchTimeList && this.search.searchTimeList[0],
+ endTime: this.search.searchTimeList && this.search.searchTimeList[1],
+ })
+ if (code == 200) {
+ this.tableData = data.records
+ this.search.total = data.total
+ }
+ },
+ handleDown() {
+ this.outLoading = true
+ this.$axios.post(this.$api.deviceCheck.rewardPunishmentExport, {
+ userId: this.isDepartment ? '' : this.departId,
+ departmentId: this.isDepartment ? this.departId : '',
+ userName: this.search.userName,
+ startTime: this.search.searchTimeList && this.search.searchTimeList[0],
+ endTime: this.search.searchTimeList && this.search.searchTimeList[1]
+ }, { responseType: 'blob' }).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], {
+ type: 'application/force-download'
+ })
+ //灏咮lob 瀵硅薄杞崲鎴愬瓧绗︿覆
+ let reader = new FileReader();
+ reader.readAsText(blob, 'utf-8');
+ reader.onload = () => {
+ try {
+ let result = JSON.parse(reader.result);
+ if (result.message) {
+ this.$message.error(result.message);
+ } else {
+ // 鍒涘缓涓�涓秴閾炬帴锛屽皢鏂囦欢娴佽祴杩涘幓锛岀劧鍚庡疄鐜拌繖涓秴閾炬帴鐨勫崟鍑讳簨浠�
+ const elink = document.createElement('a')
+ elink.download = decodeURI('濂栨儵璁板綍' + '.xlsx')
+ elink.style.display = 'none'
+ elink.href = URL.createObjectURL(blob)
+ document.body.appendChild(elink)
+ elink.click();
+ URL.revokeObjectURL(elink.href) // 閲婃斁URL 瀵硅薄
+ document.body.removeChild(elink)
+ this.$message.success('瀵煎嚭鎴愬姛')
+ }
+ } catch (err) {
+ console.log(err);
+ // 鍒涘缓涓�涓秴閾炬帴锛屽皢鏂囦欢娴佽祴杩涘幓锛岀劧鍚庡疄鐜拌繖涓秴閾炬帴鐨勫崟鍑讳簨浠�
+ const elink = document.createElement('a')
+ elink.download = decodeURI('濂栨儵璁板綍' + '.xlsx')
+ elink.style.display = 'none'
+ elink.href = URL.createObjectURL(blob)
+ document.body.appendChild(elink)
+ elink.click();
+ URL.revokeObjectURL(elink.href) // 閲婃斁URL 瀵硅薄
+ document.body.removeChild(elink)
+ this.$message.success('瀵煎嚭鎴愬姛')
+ }
+ }
+ })
+ },
+ // 鑾峰彇璐熻矗浜轰俊鎭帴鍙�
+ getUserList() {
+ this.$axios.get(this.$api.deviceScope.selectUserList).then(res => {
+ if (res.code == 200) {
+ this.responsibleOptions = res.data
+ }
+ })
+ },
+ selectUserChange(val) {
+ this.form.userName = val.name
+ this.form.account = val.account
+ this.form.userId = val.id
+ },
+ editForm(row) {
+ this.dialogVisible = true
+ this.form = { ...row };
+ },
+ saveOrUpdate() {
+ this.$refs.form.validate(async (valid) => {
+ if (valid) {
+ this.dialogVisible = false
+ const { code, data } = await addOrUpdateRewardPunishment(this.form)
+ if (code == 200) {
+ this.$message.success("鎿嶄綔鎴愬姛锛�")
+ this.getPersonnelTraining(this.departId);
+ }
+ }
+ })
+ },
+ async deleteRow(row) {
+ const { code, data } = await deleteRewardPunishment({
+ id: row.id
+ })
+ if (code == 200) {
+ this.$message.success("鎿嶄綔鎴愬姛锛�")
+ this.getPersonnelTraining(this.departId);
+ }
+ }
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ departId: {
+ handler(newId, oldId) {
+ this.getPersonnelTraining(newId);
+ }
+ },
+ dialogVisible(newVal) {
+ if (newVal === false) {
+ this.form = {}
+ this.$refs['form'].clearValidate()
+ }
+ }
+ }
+};
+</script>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/trackRecord/index.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/trackRecord/index.vue
new file mode 100644
index 0000000..7efd792
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/trackRecord/index.vue
@@ -0,0 +1,298 @@
+<!-- 宸ヤ綔灞ュ巻 -->
+<template>
+ <div>
+ <div style="text-align: right; margin-bottom: 15px;">
+ <el-button v-if="clickNodeVal.userId" size="small" type="primary" @click="dialogVisible = true">娣诲姞宸ヤ綔灞ュ巻</el-button>
+ <el-button :loading="outLoading" size="small" type="primary" @click="exportExcel">瀵煎嚭excel</el-button>
+ </div>
+ <div class="table">
+ <el-table :data="tableData" height="70vh" style="width: 100%">
+ <el-table-column label="搴忓彿" type="index" width="120">
+ <template v-slot="scope">
+ <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="璧峰鏃ユ湡" min-width="180" prop="startTime">
+ </el-table-column>
+ <el-table-column label="缁撴潫鏃ユ湡" min-width="180" prop="endTime">
+ </el-table-column>
+ <el-table-column label="宸ヤ綔鍗曚綅" min-width="120" prop="placeWork">
+ </el-table-column>
+ <el-table-column label="宸ヤ綔閮ㄩ棬" min-width="120" prop="department">
+ </el-table-column>
+ <el-table-column label="鑱屽姟" min-width="120" prop="post">
+ </el-table-column>
+ <el-table-column label="澶囨敞" min-width="180" prop="remarks">
+ </el-table-column>
+ <el-table-column label="鍒涘缓浜�" min-width="180" prop="createUser">
+ </el-table-column>
+ <el-table-column label="鍒涘缓鏃堕棿" min-width="180" prop="createTime">
+ </el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔" width="150">
+ <template v-slot="scope">
+ <el-button size="small" type="text" @click="downloadFile(scope.row.fileName)">瀵煎嚭</el-button>
+ <el-button size="small" type="text" @click="checkFun(scope.row)">鏌ョ湅</el-button>
+ <el-button size="small" style="color: red;" type="text" @click="deleteFun(scope.row.id)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]"
+ :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
+ @current-change="handleCurrentChange">
+ </el-pagination>
+ </div>
+ <el-dialog :visible.sync="dialogVisible" title="鎻愮ず" width="45%">
+ <div style="height: 30vh;">
+ <el-form ref="ruleForm" :model="ruleForm" :rules="rules" class="demo-ruleForm" label-width="100px">
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="璧峰鏃ユ湡" prop="startTime">
+ <el-date-picker v-model="ruleForm.startTime" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" required
+ size="small" style="width: 99%;" type="date" value-format="yyyy-MM-dd HH:mm:ss">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="缁撴潫鏃ユ湡">
+ <el-date-picker v-model="ruleForm.endTime" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small"
+ style="width: 99%;" type="date" value-format="yyyy-MM-dd HH:mm:ss">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="宸ヤ綔鍗曚綅" prop="placeWork">
+ <el-input v-model="ruleForm.placeWork" clearable required size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="宸ヤ綔閮ㄩ棬" prop="department">
+ <el-input v-model="ruleForm.department" clearable required size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="鏈�楂樿亴鍔�" prop="post">
+ <el-input v-model="ruleForm.post" clearable required size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="闄勪欢璧勬枡">
+ <el-row>
+ <el-col :span="17"><el-input v-model="ruleForm.fileName" disabled size="small"></el-input></el-col>
+ <el-col :span="7">
+ <el-upload ref="upload" :action="action" :on-change="handleChangePic" :on-success="onSuccess"
+ :show-file-list="false" style="float: left; margin: 0 20px;" :headers="uploadHeader">
+ <el-button slot="trigger" class="uploadFile" size="mini" type="primary">娴忚</el-button>
+ </el-upload>
+ </el-col>
+ </el-row>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="24">
+ <el-form-item label="澶囨敞">
+ <el-input v-model="ruleForm.remarks" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="saveOrUpdate">{{ isUpdate ? '鏇� 鏂�' : '淇� 瀛�' }}</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import {
+ personTrackRecordExport,
+ personTrackRecordUpdate,
+ personTrackRecordSave,
+ personTrackRecordDelete,
+ personTrackRecordSelect,
+} from '@/api/cnas/personnel/personnelInfo.js'
+export default {
+ props: {
+ clickNodeVal: {
+ type: Object,
+ default: () => {
+ return {};
+ }
+ }
+ },
+ data() {
+ return {
+ tableData: [],
+ search: {
+ size: 20,
+ current: 1,
+ total: 0
+ },
+ dialogVisible: false,
+ ruleForm: {
+ fileName: '',
+ sysFileName: ''
+ },
+ rules: {
+ startTime: [
+ { required: true, message: '璇疯緭鍏ヨ捣濮嬫棩鏈�', trigger: 'blur' },
+ { required: true, message: '璇疯緭鍏ヨ捣濮嬫棩鏈�', trigger: 'change' }
+ ],
+ placeWork: [
+ { required: true, message: '璇疯緭鍏ュ伐浣滃崟浣�', trigger: 'blur' }
+ ],
+ department: [
+ { required: true, message: '璇疯緭鍏ュ伐浣滈儴闂�', trigger: 'blur' }
+ ],
+ post: [
+ { required: true, message: '璇疯緭鍏ユ渶楂樿亴鍔�', trigger: 'blur' }
+ ]
+ },
+ isUpdate: false,
+ outLoading: false
+ };
+ },
+ created() {
+ this.init();
+ },
+ computed: {
+ action() {
+ return this.javaApi + '/personBasicInfo/saveCNASFile'
+ }
+ },
+ methods: {
+ downloadFile(fileName) {
+ this.$download.saveAs(fileName, fileName)
+ },
+ handleChangePic(file, fileList) {
+ if (fileList.length > 1) {
+ fileList.splice(0, 1);
+ }
+ },
+ onSuccess(response, file, fileList) {
+ if (response.code === 200) {
+ this.$set(this.ruleForm, 'fileName', response.data)
+ } else {
+ this.$message.warning(response.message)
+ }
+ },
+ exportExcel() {
+ this.outLoading = true
+ let userId = this.clickNodeVal.userId ? this.clickNodeVal.userId : null
+ let departmentId = this.clickNodeVal.id ? this.clickNodeVal.id : null
+ personTrackRecordExport({
+ userId,
+ departmentId
+ }).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/octet-stream' });
+ this.$download.saveAs(blob, '宸ヤ綔灞ュ巻.xlsx')
+ })
+ },
+ saveOrUpdate() {
+ this.$refs['ruleForm'].validate((valid) => {
+ if (valid) {
+ if (this.isUpdate) {
+ personTrackRecordUpdate(this.ruleForm).then(res => {
+ if (res.code = 200) {
+ this.dialogVisible = false
+ this.$message.success('鏇存柊鎴愬姛锛�')
+ this.init()
+ }
+ })
+ } else {
+ this.ruleForm.userId = this.clickNodeVal.userId
+ personTrackRecordSave(this.ruleForm).then(res => {
+ if (res.code = 200) {
+ this.dialogVisible = false
+ this.$message.success('鏂板鎴愬姛锛�')
+ this.init()
+ }
+ })
+ }
+ } else {
+ return false;
+ }
+ });
+ },
+ deleteFun(id) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ personTrackRecordDelete({ id }).then(res => {
+ this.$message.success('鍒犻櫎鎴愬姛锛�')
+ this.init()
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
+ },
+ handleSizeChange(val) {
+ this.search.size = val
+ this.init()
+ },
+ handleCurrentChange(val) {
+ this.search.current = val
+ this.init()
+ },
+ // 鍒濆鍖栬皟鐢�
+ init() {
+ if (this.clickNodeVal.userId) {
+ this.getPersonnelTraining(this.clickNodeVal.userId ? this.clickNodeVal.userId : null, null);
+ } else {
+ this.getPersonnelTraining(null, this.clickNodeVal.id ? this.clickNodeVal.id : null);
+ }
+ },
+ getPersonnelTraining(userId, departmentId) {
+ personTrackRecordSelect({
+ userId,
+ departmentId,
+ ...this.search
+ }).then(res => {
+ this.tableData = res.data.records
+ this.search.total = res.data.total
+ })
+ },
+ checkFun(row) {
+ this.ruleForm = { ...row }
+ this.dialogVisible = true
+ this.isUpdate = true
+ }
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ clickNodeVal(newVal) {
+ if (newVal.userId) {
+ // 鐢ㄦ埛id
+ this.getPersonnelTraining(newVal.userId, null);
+ } else {
+ // 閮ㄩ棬id
+ this.getPersonnelTraining(null, newVal.id);
+ }
+ },
+ dialogVisible(newVal) {
+ if (!newVal) {
+ this.isUpdate = false
+ this.$refs.ruleForm.resetFields();
+ this.ruleForm = {}
+ }
+ }
+ }
+};
+</script>
+<style scoped>
+>>>.el-form-item {
+ margin-bottom: 13px;
+}
+</style>
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/index.vue b/src/views/CNAS/personnel/personnelInfo/Department/index.vue
new file mode 100644
index 0000000..9bccaf2
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/index.vue
@@ -0,0 +1,152 @@
+<template>
+ <el-tabs v-model="activeName" :lazy="true" type="border-card">
+ <el-tab-pane label="浜哄憳鍩烘湰淇℃伅" name="浜哄憳鍩烘湰淇℃伅">
+ <PersonnelList v-if="activeName === '浜哄憳鍩烘湰淇℃伅' && isShowAll" ref="personnelList"
+ :currentCompaniesList="currentCompaniesList" :departId="departId" @refreshTree="refreshTree"
+ @updatePerson="updatePerson"></PersonnelList>
+ <personnelInformation v-if="activeName === '浜哄憳鍩烘湰淇℃伅' && !isShowAll" :clickNodeVal="clickNodeVal">
+ </personnelInformation>
+ </el-tab-pane>
+ <el-tab-pane label="鍩硅璁″垝" name="鍩硅璁″垝">
+ <PersonnelTraining v-if="activeName === '鍩硅璁″垝'" ref="personnelTraining" :flag="flag" :departId="departId"
+ :isDepartment="isDepartment"></PersonnelTraining>
+ </el-tab-pane>
+ <el-tab-pane label="鐩戠潱璁″垝" name="鐩戠潱璁″垝">
+ <Plan v-if="activeName === '鐩戠潱璁″垝'" :departId="departId"></Plan>
+ </el-tab-pane>
+ <el-tab-pane label="宀椾綅鑱岃矗" name="宀椾綅鑱岃矗">
+ <job-responsibilities v-if="activeName === '宀椾綅鑱岃矗'" ref="jobResponsibilities" :departId="departId"
+ :isDepartment="isDepartment"></job-responsibilities>
+ </el-tab-pane>
+ <el-tab-pane label="宸ヤ綔灞ュ巻" name="宸ヤ綔灞ュ巻">
+ <trackRecord v-if="activeName === '宸ヤ綔灞ュ巻'" :clickNodeVal="clickNodeVal"></trackRecord>
+ </el-tab-pane>
+ <el-tab-pane label="濂栨儵璁板綍" name="濂栨儵璁板綍">
+ <rewardPunishmentRecord v-if="activeName === '濂栨儵璁板綍'" :departId="departId" :isDepartment="isDepartment">
+ </rewardPunishmentRecord>
+ </el-tab-pane>
+ <el-tab-pane label="鍩硅璁板綍" name="鍩硅璁板綍">
+ <training-record v-if="activeName === '鍩硅璁板綍'" ref="trainingRecord" :departId="departId"
+ :isDepartment="isDepartment"></training-record>
+ </el-tab-pane>
+ <el-tab-pane label="鐩戠潱璁板綍" name="鐩戠潱璁板綍">
+ <Records v-if="activeName === '鐩戠潱璁板綍'" ref="recordsRef" :departId="departId" :isDepartment="isDepartment">
+ </Records>
+ </el-tab-pane>
+ <el-tab-pane label="浠昏亴鎺堟潈璁板綍" name="浠昏亴鎺堟潈璁板綍">
+ <Mandate v-if="activeName === '浠昏亴鎺堟潈璁板綍'" ref="manDateRef" :departId="departId" :isDepartment="isDepartment">
+ </Mandate>
+ </el-tab-pane>
+ <el-tab-pane label="浜哄憳鑳藉姏" name="浜哄憳鑳藉姏">
+ <personnel-capacity v-if="activeName === '浜哄憳鑳藉姏'" ref="personnelCapacity" :departId="departId"
+ :isDepartment="isDepartment"></personnel-capacity>
+ </el-tab-pane>
+ <el-tab-pane label="娌熼�氳褰�" name="娌熼�氳褰�">
+ <Communicate v-if="activeName === '娌熼�氳褰�'" ref="communicateRef" :departId="departId" :isDepartment="isDepartment">
+ </Communicate>
+ </el-tab-pane>
+ </el-tabs>
+</template>
+<script>
+import Plan from './components/Plan/index.vue';
+import Records from './components/Records/index.vue';
+import Communicate from './components/Communicate/index.vue';
+import Mandate from './components/Mandate/index.vue';
+import PersonnelList from './components/PersonnelList/index.vue';
+import PersonnelTraining from './components/PersonnelTraining/index.vue';
+import JobResponsibilities from './components/JobResponsibilities/index.vue';
+import TrainingRecord from './components/TrainingRecord/index.vue';
+import PersonnelCapacity from './components/PersonnelCapacity/index.vue';
+import trackRecord from "./components/trackRecord/index.vue";
+import rewardPunishmentRecord from "./components/rewardPunishmentRecord/index.vue";
+import PersonnelInformation from "./components/PersonnelInformation/index.vue";
+
+export default {
+ props: {
+ clickNodeVal: {
+ type: Object,
+ default: () => {
+ return {};
+ }
+ },
+ departId: {
+ type: Number,
+ default: 0
+ },
+ isDepartment: {
+ type: Boolean,
+ default: false
+ },
+ isShowAll: {
+ type: Boolean,
+ default: false
+ },
+ currentCompaniesList: {
+ type: Array,
+ default: []
+ }
+ },
+ components: {
+ PersonnelInformation,
+ rewardPunishmentRecord,
+ trackRecord,
+ PersonnelCapacity,
+ TrainingRecord,
+ JobResponsibilities,
+ PersonnelTraining,
+ PersonnelList,
+ Plan,
+ Records,
+ Communicate,
+ Mandate
+ },
+ watch: {
+ departId: {
+ handler(newId, oldId) {
+ if (newId) {
+ switch (this.activeName) {
+ case '娌熼�氳褰�':
+ this.$refs.communicateRef.getDepart(newId);
+ break;
+ case '浠昏亴鎺堟潈璁板綍':
+ this.$refs.manDateRef.getDepart(newId);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+ },
+ data() {
+ return {
+ flag: true,
+ activeName: '浜哄憳鍩烘湰淇℃伅',
+ }
+ },
+ created() {
+ // this.flag = isPermission('personTrainingSelect')
+ // console.log('this.flag',this.flag);
+ },
+ methods: {
+ updatePerson(row) {
+ this.$parent.updatePerson(row);
+ },
+ refreshTree() {
+ this.$parent.refreshTree();
+ },
+ }
+};
+</script>
+<style scoped>
+.el-tabs>>>.el-tabs--border-card {
+ box-shadow: unset;
+ border: unset;
+}
+
+.flex_column {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+</style>
diff --git a/src/views/CNAS/personnel/personnelInfo/index.vue b/src/views/CNAS/personnel/personnelInfo/index.vue
new file mode 100644
index 0000000..9feb358
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/index.vue
@@ -0,0 +1,298 @@
+<template>
+ <div class="main">
+
+ <div class="main_left">
+ <el-row>
+ <el-col :span="20">
+ <el-input v-model="search" class="div_left_input" clearable placeholder="杈撳叆鍏抽敭瀛楄繘琛屾悳绱�" size="small"
+ suffix-icon="el-icon-search" @blur="searchFilter" @clear="searchFilter"
+ @keyup.enter.native="searchFilter"></el-input>
+ </el-col>
+ <el-col :span="4" style="text-align: center;line-height: 30px; margin-top: 14px">
+ <el-button circle icon="el-icon-plus" size="mini" type="primary" @click="handleAdd"></el-button>
+ </el-col>
+ </el-row>
+ <el-tree ref="tree" :data="list" :default-expanded-keys="[1]" :expand-on-click-node="false"
+ :filter-node-method="filterNode" :props="{ children: 'children', label: 'name' }" highlight-current
+ node-key="id" style="height:calc(100% - 80px);overflow-y: scroll;scrollbar-width: none;"
+ @node-click="handleNodeClick">
+ <div slot-scope="{ node, data }" class="custom-tree-node">
+ <el-row style="width: 100%;">
+ <el-col :span="22" style="text-align: left;">
+ <span><i
+ :class="`node_i ${data.children != undefined && data.children.length > 0 ? 'el-icon-folder-opened' : 'el-icon-tickets'}`"></i>
+ {{ data.name }}</span>
+ </el-col>
+ <el-col v-if="node.level > 1 && data.id !== null" :span="2" style="text-align: right;">
+ <el-button size="mini" type="text" @click.stop="remove(node, data)">
+ <i class="el-icon-delete"></i>
+ </el-button>
+ </el-col>
+ </el-row>
+ </div>
+ </el-tree>
+ </div>
+ <div style="width: 10px;"></div>
+ <div class="main_right">
+ <!-- 閮ㄩ棬 -->
+ <Department ref="departRef" :clickNodeVal="clickNodeVal" :currentCompaniesList="currentCompaniesList"
+ :departId="departId" :isDepartment="isDepartment" :isShowAll="isShowAll" />
+ </div>
+ <el-dialog :visible.sync="addDia" title="鏋舵瀯鏂板" width="400px">
+ <div class="body">
+ <el-row style="line-height: 50px;">
+ <el-col :span="6" style="text-align: right;">
+ <span class="required-span">* </span>鏋舵瀯鍚嶇О锛�
+ </el-col>
+ <el-col :offset="1" :span="16">
+ <el-input v-model="addOb.name" clearable placeholder="璇疯緭鍏ユ灦鏋勫悕绉�" size="small"
+ @keyup.enter.native="addStandardTree"></el-input>
+ </el-col>
+ </el-row>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="addDia = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="addStandardTree">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import Department from './Department/index.vue';
+import {
+ delDepartmentLims,
+ addDepartmentLims,
+ selectCNSAPersonTree,
+} from '@/api/cnas/personnel/personnelInfo.js'
+
+export default {
+ components: {
+ Department
+ },
+ data() {
+ return {
+ isShowAll: true, // 鏄惁灞曠ず鏍囩鏍�
+ departId: 0,
+ list: [],
+ addDia: false,
+ addOb: {
+ name: '',
+ fatherId: ''
+ },
+ search: '',
+ clickNodeVal: {},
+ addUserForm: {
+ name: ''
+ },
+ currentCompaniesList: [],
+ entity: {
+ name: '',
+ departLimsId: '',
+ orderBy: {
+ field: 'id',
+ order: 'asc'
+ }
+ },
+ overallRecord: '浜哄憳鍒楄〃',
+ isDepartment: false,
+ };
+ },
+ mounted() {
+ this.geList();
+ },
+ methods: {
+ remove(node, data) {
+ this.$confirm("鏄惁鍒犻櫎璇ュ眰绾�", "鎻愮ず", {
+ type: "error"
+ }).then(() => {
+ this.treeLoad = true
+ delDepartmentLims({
+ id: data.id
+ }).then(res => {
+ if (res.code == 201) return
+ this.$message.success('宸插垹闄�')
+ this.geList();
+ })
+ }).catch(e => { })
+ },
+ addStandardTree() {
+ if (this.addOb.name == null || this.addOb.factory == '') {
+ this.$message.error('鏋勬灦鍚嶇О鏄繀濉」')
+ return
+ }
+ addDepartmentLims(this.addOb).then(res => {
+ if (res.code === 201) {
+ return
+ }
+ this.$message.success('娣诲姞鎴愬姛')
+ this.addDia = false
+ this.geList();
+ this.addOb.name = ''
+ this.addOb.fatherId = ''
+ })
+ },
+ handleAdd() {
+ if (this.addOb.fatherId) {
+ this.addDia = true;
+ } else {
+ this.$message.error('璇烽�夋嫨涓�涓灦鏋勫眰绾�')
+ }
+ },
+ // 浜哄憳鍒楄〃缂栬緫
+ updatePerson(row) {
+ const node = this.findNodeById(this.list, row.name);
+ if (node) {
+ this.handleNodeClick(node);
+ } else {
+ this.$message.warning('鏈壘鍒拌浜哄憳');
+ }
+ },
+ // 鏂板缓浜哄憳鍚庡埛鏂版爲
+ refreshTree() {
+ this.geList()
+ },
+ findNodeById(treeData, name) {
+ for (let i = 0; i < treeData.length; i++) {
+ if (treeData[i].name === name) {
+ return treeData[i]; // 鎵惧埌鑺傜偣锛岃繑鍥炶鑺傜偣
+ }
+ if (treeData[i].children && treeData[i].children.length > 0) {
+ const foundNode = this.findNodeById(treeData[i].children, name);
+ if (foundNode) {
+ return foundNode; // 鍦ㄥ瓙鑺傜偣涓壘鍒帮紝杩斿洖璇ヨ妭鐐�
+ }
+ }
+ }
+ return null; // 娌℃湁鎵惧埌鑺傜偣锛岃繑鍥瀗ull
+ },
+ searchFilter() {
+ this.$refs.tree.filter(this.search);
+ },
+ // 鑾峰彇鏍�
+ geList() {
+ selectCNSAPersonTree().then(res => {
+ this.list = res.data;
+ if (this.list.length > 0) {
+ this.isDepartment = true;
+ this.departId = this.list[0].id
+ }
+ });
+ },
+ filterNode(value, data) {
+ if (!value) return true;
+ return data.name.indexOf(value) !== -1;
+ },
+ handleNodeClick(val, node, el) {
+ //鏍戠殑鍊�
+ this.clickNodeVal = val;
+ // 瀛樺偍鐖剁骇鑺傜偣绾ф暟
+ if (node) {
+ this.getNodeParent(node);
+ this.clickNodeVal.level = node.level;
+ this.clickNodeVal.parent = node.parent.data;
+ }
+ this.entity.departLimsId = val.id;
+ this.addOb.fatherId = val.id;
+ // 鏄惁鏄剧ず璁惧璇︽儏
+ this.isShowAll = val.id !== null;
+ if (val.id) { // 濡傛灉鏄疄楠屽
+ this.departId = val.id;
+ this.isDepartment = true;
+ }
+ if (val.userId) { // 鏄汉鍛�
+ this.departId = val.userId;
+ this.isDepartment = false
+ }
+ },
+ getNodeParent(val) {
+ if (val.parent != null) {
+ this.currentCompaniesList[val.level - 1] = val.data.id;
+ this.selectTree += ' - ' + val.label;
+ this.getNodeParent(val.parent);
+ }
+ }
+ }
+};
+</script>
+
+<style scoped>
+.custom-tree-node {
+ width: 80%;
+ line-height: 32px;
+}
+
+.custom-tree-node .el-icon-delete {
+ color: #3A7BFA;
+ opacity: 0;
+ font-size: 15px;
+}
+
+.custom-tree-node:hover .el-icon-delete {
+ opacity: 1;
+}
+
+.node_i {
+ color: orange;
+ font-size: 18px;
+}
+
+.main {
+ display: flex;
+ padding-top: 10px;
+ box-sizing: border-box;
+}
+
+.main_left {
+ background: #ffffff;
+ text-align: center;
+ height: calc(100vh - 6.5em);
+ width: 240px;
+ border-radius: 15px;
+}
+
+.main_right {
+ width: calc(100% - 240px);
+ border-radius: 15px;
+}
+
+.div_left_input {
+ margin: 15px 0;
+ width: 90%;
+}
+
+>>>.el-tabs--border-card>.el-tabs__header .el-tabs__item {
+ border: 0 none;
+}
+
+>>>.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active {
+ color: black;
+}
+
+>>>.el-tabs--border-card>.el-tabs__header {
+ border-bottom: none;
+}
+
+.search {
+ background-color: #fff;
+ height: 100%;
+ display: flex;
+ justify-content: flex-end;
+}
+
+.search_thing {
+ width: 350px;
+ display: flex;
+ align-items: center;
+}
+
+.search_label {
+ width: 110px;
+ font-size: 14px;
+ text-align: right;
+}
+
+.search_input {
+ width: calc(100% - 110px);
+}
+</style>
diff --git a/src/views/CNAS/resourceDemand/device/component/acceptanceForm.vue b/src/views/CNAS/resourceDemand/device/component/acceptanceForm.vue
new file mode 100644
index 0000000..b9e7181
--- /dev/null
+++ b/src/views/CNAS/resourceDemand/device/component/acceptanceForm.vue
@@ -0,0 +1,192 @@
+<template>
+ <div>
+ <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="dialogVisible"
+ title="浠櫒璁惧楠屾敹鍗�" width="80%" @close="resetForm">
+ <el-form ref="modelForm" :model="form" :rules="rules" label-width="180px">
+ <el-col :span="12">
+ <el-form-item label="鍒拌揣鏃ユ湡锛�" prop="arrivalDate">
+ <el-date-picker v-model="form.arrivalDate" type="date" placeholder="閫夋嫨鏃ユ湡" size="small" format="yyyy-MM-dd"
+ style="width: 100%" value-format="yyyy-MM-dd" :disabled="operationType === 'view'">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="閲戦锛�" prop="goldAmount">
+ <el-input v-model="form.goldAmount" :disabled="operationType === 'view'" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="缁翠慨鍗曚綅锛�" prop="maintenanceunit">
+ <el-input v-model="form.maintenanceunit" :disabled="operationType === 'view'" clearable
+ size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鏀惰澶囦富鏈哄拰澶囦欢鎯呭喌锛�" prop="spareParts">
+ <el-input v-model="form.spareParts" :disabled="operationType === 'view'" clearable size="small"
+ type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="瀹夎銆佽皟璇曟儏鍐碉細" prop="installationDebugging">
+ <el-input v-model="form.installationDebugging" :disabled="operationType === 'view'" clearable size="small"
+ type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="楠屾敹鎯呭喌锛�" prop="checkSituation">
+ <el-input v-model="form.checkSituation" :disabled="operationType === 'view'" clearable size="small"
+ type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鎺ユ敹绛惧瓧锛�" prop="receivingSignature">
+ <el-input v-model="form.receivingSignature" :disabled="operationType === 'view'" clearable
+ size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍘傚浠h〃锛�" prop="producer">
+ <el-input v-model="form.producer" :disabled="operationType === 'view'" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鎺ユ敹浜猴細" prop="recipient">
+ <el-input v-model="form.recipient" :disabled="operationType === 'view'" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鎺ユ敹鏃ユ湡锛�" prop="recipientDate">
+ <el-date-picker v-model="form.recipientDate" type="date" placeholder="閫夋嫨鏃ユ湡" size="small" format="yyyy-MM-dd"
+ style="width: 100%" value-format="yyyy-MM-dd" :disabled="operationType === 'view'">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="resetForm">鍙� 娑�</el-button>
+ <el-button v-if="operationType !== 'view'" :loading="submitFormLoading" type="primary" @click="submitForm">纭�
+ 璁�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import {
+ getDeviceAcceptance,
+ addDeviceAcceptance,
+ updateDeviceAcceptance,
+} from '@/api/cnas/resourceDemand/device.js'
+import { selectUserCondition } from "@/api/system/user";
+export default {
+ name: "acceptance-form",
+ // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+ components: {},
+ data() {
+ // 杩欓噷瀛樻斁鏁版嵁
+ return {
+ dialogVisible: false,
+ submitFormLoading: false,
+ form: {
+ arrivalDate: '',
+ goldAmount: '',
+ maintenanceunit: '',
+ spareParts: '',
+ installationDebugging: '',
+ checkSituation: '',
+ receivingSignature: '',
+ producer: '',
+ recipient: '',
+ recipientDate: '',
+ deviceId: '',
+ },
+ operationType: '',
+ rules: {
+ arrivalDate: [{ required: true, message: '璇烽�夋嫨鍒拌揣鏃ユ湡', trigger: 'change' }],
+ },
+ userList: [],
+ }
+ },
+ mounted() {
+
+ },
+ // 鏂规硶闆嗗悎
+ methods: {
+ // 鎵撳紑寮规
+ openDialog(type, id, deviceId) {
+ this.dialogVisible = true
+ this.operationType = type
+ this.form.acceptanceId = id
+ this.form.deviceId = deviceId
+ this.getUserList()
+ if (this.form.acceptanceId) {
+ this.searchInfo()
+ }
+ },
+ // 鏌ヨ璇︽儏
+ searchInfo() {
+ getDeviceAcceptance({ acceptanceId: this.form.acceptanceId }).then(res => {
+ if (res.code === 200) {
+ this.form = { ...res.data }
+ }
+ }).catch(error => {
+ console.error(error)
+ })
+ },
+ // 鎻愪氦琛ㄥ崟
+ submitForm() {
+ this.$refs.modelForm.validate((valid) => {
+ if (valid) {
+ if (this.operationType === 'add') {
+ addDeviceAcceptance(this.form).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鏂板鎴愬姛')
+ this.resetForm()
+ }
+ this.submitFormLoading = false
+ }).catch(err => {
+ this.submitFormLoading = false
+ })
+ } else {
+ updateDeviceAcceptance(this.form).then(res => {
+ if (res.code == 200) {
+ this.$message.success('淇敼鎴愬姛')
+ this.resetForm()
+ }
+ this.submitFormLoading = false
+ }).catch(err => {
+ this.submitFormLoading = false
+ })
+ }
+ }
+ })
+ },
+ // 鍏抽棴寮规
+ resetForm() {
+ this.dialogVisible = false
+ this.$emit('closeDialog')
+ },
+ getUserList() {
+ selectUserCondition().then(res => {
+ let data = [];
+ res.data.forEach((a) => {
+ data.push({
+ label: a.name,
+ value: a.id,
+ });
+ });
+ this.userList = data
+ })
+ },
+ },
+}
+</script>
+
+<style scoped>
+.form-item {
+ display: flex;
+ align-items: center;
+ margin-right: 20px;
+}
+</style>
diff --git a/src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue b/src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue
new file mode 100644
index 0000000..99d88ac
--- /dev/null
+++ b/src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue
@@ -0,0 +1,754 @@
+<template>
+ <div class="data-acquisition-config">
+ <div>
+ <el-row class="title">
+ <el-col :span="6" style="padding-left: 20px;text-align: left;">鏁伴噰閰嶇疆</el-col>
+ <el-col :span="18" style="text-align: right;">
+ <el-button size="small" type="primary" @click="fileConfiguration">鏂囦欢閰嶇疆</el-button>
+ <el-button size="small" @click="$parent.closeDataVue()">
+ <span style="color: #3A7BFA;">杩斿洖</span>
+ </el-button>
+ </el-col>
+ </el-row>
+ </div>
+ <div class="table">
+ <el-table :data="tableList.slice(
+ (page.current - 1) * page.size,
+ page.current * page.size
+ )
+ " border tooltip-effect="dark" style="width: 74%;" height="100%" :span-method="spanMethod">
+ <el-table-column type="index" label="搴忓彿" align="center" width="65"></el-table-column>
+ <el-table-column prop="deviceName" align="center" min-width="100" label="璁惧鍚嶇О"></el-table-column>
+ <el-table-column prop="fileType" align="center" label="鏂囦欢鍚庣紑"></el-table-column>
+ <el-table-column prop="collectUrl" align="center" min-width="100" show-overflow-tooltip
+ label="閲囬泦鍦板潃"></el-table-column>
+ <el-table-column prop="storageUrl" align="center" min-width="100" show-overflow-tooltip
+ label="瀛樺偍鍦板潃"></el-table-column>
+ <el-table-column prop="ip" align="center" label="IP鍦板潃" min-width="100"></el-table-column>
+ <el-table-column prop="sample" align="center" label="妫�楠屽璞�" show-overflow-tooltip
+ min-width="150"></el-table-column>
+ <el-table-column prop="inspectionItemClass" align="center" label="妫�楠岄」鍒嗙被" min-width="120"></el-table-column>
+ <el-table-column prop="inspectionItem" align="center" label="妫�楠岄」" min-width="100"></el-table-column>
+ <el-table-column prop="inspectionItemSubclass" align="center" label="妫�楠屽瓙椤�" min-width="100"></el-table-column>
+ <el-table-column prop="referx" align="center" label="鍙傜収X" min-width="100"></el-table-column>
+ <el-table-column prop="x" align="center" label="X"></el-table-column>
+ <el-table-column prop="refery" align="center" label="鍙傜収Y" min-width="100"></el-table-column>
+ <el-table-column prop="y" align="center" label="Y"></el-table-column>
+ <el-table-column prop="anotherName" align="center" label="鍒悕" min-width="100"></el-table-column>
+ <el-table-column prop="matchingName" align="center" label="鍖归厤鍚嶇О" min-width="100"></el-table-column>
+ <el-table-column prop="formula" align="center" label="鍏紡"></el-table-column>
+ <el-table-column prop="section" fixed="right" label="鎿嶄綔" width="120">
+ <template slot-scope="scope">
+ <el-button type="text" @click="dataConfig(scope.row)">鏁伴噰閰嶇疆</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ <div class="page" v-if="tableList.length > 0">
+ <el-pagination @size-change="sizeChange" @current-change="currentChange" :current-page="page.current"
+ :page-sizes="[10, 20, 30, 50, 100]" :page-size="page.size" layout="total, sizes, prev, pager, next, jumper"
+ :total="tableList.length">
+ </el-pagination>
+ </div>
+ <el-dialog title="鏁伴噰閰嶇疆" :visible.sync="dialogVisible3" width="920px" :before-close="closeForm">
+ <el-form :model="configForm" label-position="top" size="small" ref="configForm" label-width="100px"
+ class="demo-ruleForm">
+ <el-table :data="domains" style="width: 100%" height="300">
+ <el-table-column label="搴忓彿" type="index" width="80">
+ <template v-slot="scope">
+ {{ getIndexWithAlphabet(scope.$index) }}
+ </template>
+ </el-table-column>
+ <el-table-column prop="referx" label="鍙傜収X" min-width="140">
+ <template v-slot="scope">
+ <el-input style="width: 100%" v-model="scope.row.referx"></el-input>
+ </template>
+ </el-table-column>
+ <el-table-column prop="x" label="X" min-width="100">
+ <template v-slot="scope">
+ <el-input style="width: 100%" v-model="scope.row.x"></el-input>
+ </template>
+ </el-table-column>
+ <el-table-column prop="refery" label="鍙傜収Y" min-width="140">
+ <template v-slot="scope">
+ <el-input style="width: 100%" v-model="scope.row.refery"></el-input>
+ </template>
+ </el-table-column>
+ <el-table-column prop="y" label="Y" min-width="100">
+ <template v-slot="scope">
+ <el-input style="width: 100%" v-model="scope.row.y"></el-input>
+ </template>
+ </el-table-column>
+ <el-table-column prop="anotherName" label="鍒悕" min-width="140">
+ <template v-slot="scope">
+ <el-input style="width: 100%" v-model="scope.row.anotherName"></el-input>
+ </template>
+ </el-table-column>
+ <el-table-column prop="matchingName" label="鍖归厤鍚嶇О" min-width="140">
+ <template v-slot="scope">
+ <el-input style="width: 100%" v-model="scope.row.matchingName"></el-input>
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" width="150">
+ <template v-slot="scope">
+ <el-button @click.prevent="removeDomain(scope.row)" size="small" type="text">鍒犻櫎</el-button>
+ <el-button @click="addDomain" size="small" type="text">鏂板</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <div class="fomItem2">
+ <el-form-item class="fomItemInput1">
+ <template v-slot="label">
+ 鍏紡锛�
+ <el-tooltip v-for="(formula, key) in formulas" class="itemFomItem" effect="dark"
+ :content="formula.content" :key="key" placement="top">
+ <label>{{ formula.label }}()</label>
+ </el-tooltip>
+ <el-input type="textarea" autosi:autosize="{ minRows: 2, maxRows: 4}" ze placeholder="璇疯緭鍏ュ唴瀹�"
+ v-model="configForm.formula" @change="evalResult">
+ </el-input>
+ </template>
+ </el-form-item>
+ </div>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-row>
+ <el-button @click="closeForm">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitForm3" :loading="upLoad3">纭� 瀹�</el-button>
+ </el-row>
+ </span>
+ </el-dialog>
+ <el-dialog title="鏁伴噰閰嶇疆" :visible.sync="dialogVisible4" width="400px">
+ <div class="search_thing" style="margin-bottom: 14px;">
+ <div class="search_label">
+ <span style="color:red;margin-right: 4px;">*</span>IP锛�
+ </div>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="configForm.ip"></el-input>
+ </div>
+ <div class="search_thing" style="margin-bottom: 14px;">
+ <div class="search_label">
+ <span style="color:red;margin-right: 4px;">*</span>閲囬泦鍦板潃锛�
+ </div>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="configForm.collectUrl"></el-input>
+ </div>
+ <div class="search_thing" style="margin-bottom: 14px;">
+ <div class="search_label">鍌ㄥ瓨鍦板潃锛�</div>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="configForm.storageUrl"></el-input>
+ </div>
+ <div class="search_thing" style="margin-bottom: 14px;">
+ <div class="search_label">
+ <span style="color:red;margin-right: 4px;">*</span>鏂囦欢鍚庣紑锛�
+ </div>
+ <el-select v-model="configForm.fileType" size="small" placeholder="璇烽�夋嫨" style="width: 100%;">
+ <el-option v-for="item in fileTypeOptions" :key="item.value" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
+ </div>
+ <div class="search_thing" style="margin-bottom: 14px;">
+ <div class="search_label">濮旀墭瀛楁锛�</div>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="configForm.entrustCode"></el-input>
+ </div>
+ <div class="search_thing" style="margin-bottom: 14px;">
+ <div class="search_label">鏍峰搧瀛楁锛�</div>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="configForm.sampleCode"></el-input>
+ </div>
+ <div class="search_thing" style="margin-bottom: 14px;">
+ <div class="search_label">鏂囦欢鍚嶇О锛�</div>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="configForm.dbFileName"></el-input>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-row>
+ <el-button @click="dialogVisible4 = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitForm4" :loading="upLoad4">纭� 瀹�</el-button>
+ </el-row>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import {
+ queryDataAcquisitionConfiguration,
+ saveDataAcquisitionConfiguration,
+ deleteDataAcquisitionConfiguration,
+} from '@/api/cnas/resourceDemand/device.js'
+export default {
+ name: "dataAcquisitionConfig",
+ // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+ components: {},
+ props: {
+ deviceId: {
+ type: Number,
+ default: () => []
+ }
+ },
+ mounted() {
+ this.init();
+ },
+ data() {
+ // 杩欓噷瀛樻斁鏁版嵁
+ return {
+ formulas: [
+ {
+ label: "MAX",
+ content: "姹傚弬鏁版渶澶у�硷紝鍙傛暟涓暟鏈�灏戜袱涓紝濡傦細MAX(A1,B2)"
+ },
+ {
+ label: "MIN",
+ content: "姹傚弬鏁版渶灏忓�硷紝鍙傛暟涓暟鏈�灏戜袱涓紝濡傦細MIN(A1,B2)"
+ },
+ {
+ label: "SUM",
+ content: "姹傚拰锛屽弬鏁颁釜鏁版渶灏戜袱涓紝濡傦細SUM(A1,B2)"
+ },
+ {
+ label: "ABS",
+ content: "姹傜粷瀵瑰�硷紝鍙傛暟涓暟鏈�灏戜竴涓紝濡傦細ABS(A1)"
+ },
+ {
+ label: "AVERAGE",
+ content: "姹傚钩鍧囧�硷紝鍙傛暟涓暟鏈�灏戜袱涓釜锛屽锛欰VERAGE(A1,B2)"
+ },
+ {
+ label: "MEDIAN",
+ content: "姹備腑鍊硷紝鍙傛暟涓暟鏈�灏戜袱涓釜锛屽锛歁EDIAN(A1,B2)"
+ },
+ ],
+ dialogVisible4: false,
+ tableList: [],
+ page: {
+ current: 1,
+ size: 20
+ },
+ dialogVisible3: false,
+ configForm: {
+ formula: "",
+ collectUrl: "",
+ storageUrl: "",
+ entrustCode: "",
+ sampleCode: "",
+ dbFileName: "",
+ fiberOpticRibbon: ""
+ },
+ domains: [
+ {
+ referx: "",
+ refery: "",
+ x: "",
+ y: "",
+ anotherName: "",
+ matchingName: ""
+ }
+ ],
+ upLoad3: false,
+ upLoad4: false,
+ fileTypeOptions: [
+ { label: "csv", value: ".csv" },
+ { label: "db", value: ".db" },
+ { label: "mdb", value: ".mdb" },
+ { label: "word", value: ".docx" },
+ { label: "excel", value: ".xlsx" },
+ { label: "txt", value: ".txt" },
+ { label: "png", value: ".png" }
+ ],
+ spanList: [],
+ specialSpanList: [],
+ spanConfig: {
+ special: {
+ main: "inspectionItemSubclass",
+ rows: [
+ {
+ name: "deviceName",
+ index: 1
+ },
+ {
+ name: "fileType",
+ index: 2
+ },
+ {
+ name: "collectUrl",
+ index: 3
+ },
+ {
+ name: "storageUrl",
+ index: 4
+ },
+ {
+ name: "ip",
+ index: 5
+ },
+ {
+ name: "inspectionItem",
+ index: 6
+ },
+ {
+ name: "inspectionItemSubclass",
+ index: 7
+ },
+ {
+ name: "formula",
+ index: 13
+ },
+ {
+ name: "section",
+ index: 14
+ }
+ ]
+ }
+ },
+ deleteList: []
+ };
+ },
+ // 鏂规硶闆嗗悎
+ methods: {
+ getIndexWithAlphabet(index) {
+ const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+ const letterIndex = index % 26;
+ return alphabet.charAt(letterIndex) + (index + 1);
+ },
+ rowspan(spanArr, position, spanName) {
+ this.tableList.forEach((item, index) => {
+ if (index === 0) {
+ spanArr.push(1);
+ position = 0;
+ } else {
+ if (
+ this.tableList[index][spanName] ===
+ this.tableList[index - 1][spanName]
+ ) {
+ spanArr[position] += 1;
+ spanArr.push(0);
+ } else {
+ spanArr.push(1);
+ position = index;
+ }
+ }
+ });
+ },
+ spanMethod({ row, column, rowIndex, columnIndex }) {
+ // 涓�鑸殑鍚堝苟琛�
+ if (
+ this.spanConfig != undefined &&
+ this.spanConfig.rows &&
+ this.spanConfig.rows.length > 0
+ ) {
+ let i = null;
+ let obj = this.spanConfig.rows.find((item, index) => {
+ i = index;
+ return item.index == columnIndex;
+ });
+ if (obj) {
+ const _row = this.spanList[i].arr[rowIndex];
+ const _col = _row > 0 ? 1 : 0;
+ return {
+ rowspan: _row,
+ colspan: _col
+ };
+ }
+ }
+ // 鐗规畩鐨勫悎骞惰
+ if (
+ this.spanConfig != undefined &&
+ this.spanConfig.special &&
+ this.spanConfig.special.main &&
+ this.spanConfig.special.rows &&
+ this.spanConfig.special.rows.length > 0
+ ) {
+ let i = null;
+ let obj = this.spanConfig.special.rows.find((item, index) => {
+ i = index;
+ return item.index == columnIndex;
+ });
+ if (obj) {
+ const _row = this.specialSpanList[i].arr[rowIndex];
+ const _col = _row > 0 ? 1 : 0;
+ return {
+ rowspan: _row,
+ colspan: _col
+ };
+ }
+ }
+ },
+ fileConfiguration() {
+ this.dialogVisible4 = true;
+ if (this.tableList[0]) {
+ this.$set(this.configForm, "fileType", this.tableList[0].fileType);
+ this.$set(this.configForm, "collectUrl", this.tableList[0].collectUrl);
+ this.$set(this.configForm, "storageUrl", this.tableList[0].storageUrl);
+ this.$set(this.configForm, "ip", this.tableList[0].ip);
+ this.$set(
+ this.configForm,
+ "entrustCode",
+ this.tableList[0].entrustCode
+ );
+ this.$set(
+ this.configForm,
+ "sampleCode",
+ this.tableList[0].sampleCode
+ );
+ this.$set(
+ this.configForm,
+ "dbFileName",
+ this.tableList[0].dbFileName
+ );
+ this.$set(
+ this.configForm,
+ "fiberOpticRibbon",
+ this.tableList[0].fiberOpticRibbon
+ )
+ }
+ },
+ init() {
+ queryDataAcquisitionConfiguration({ deviceId: this.deviceId, isDevice: false }).then(res => {
+ this.tableList = res.data;
+ this.tableList.forEach(i => {
+ let isIncludes = false
+ if (i.formula && i.formula != "") {
+ this.formulas.forEach(j => {
+ if (i.formula.includes(j.label)) {
+ isIncludes = true
+ }
+ })
+ }
+ if (!isIncludes && i.formula) {
+ i.formula = i.formula.slice(1, -1)
+ }
+ i.sample = i.sample
+ .replace(/"/g, "")
+ .replace(/],/g, "锛�")
+ .replace(/\[/g, "")
+ .replace(/]/g, "");
+ });
+ if (this.tableList[0]) {
+ this.$set(this.configForm, "fileType", this.tableList[0].fileType);
+ this.$set(
+ this.configForm,
+ "collectUrl",
+ this.tableList[0].collectUrl
+ );
+ this.$set(
+ this.configForm,
+ "storageUrl",
+ this.tableList[0].storageUrl
+ );
+ this.$set(this.configForm, "ip", this.tableList[0].ip);
+ this.$set(
+ this.configForm,
+ "entrustCode",
+ this.tableList[0].entrustCode
+ );
+ this.$set(
+ this.configForm,
+ "sampleCode",
+ this.tableList[0].sampleCode
+ );
+ this.$set(
+ this.configForm,
+ "dbFileName",
+ this.tableList[0].dbFileName
+ );
+ this.$set(
+ this.configForm,
+ "fiberOpticRibbon",
+ this.tableList[0].fiberOpticRibbon
+ )
+ }
+ // 涓�鑸殑鍚堝苟琛�
+ if (
+ this.spanConfig != undefined &&
+ this.spanConfig.rows &&
+ this.spanConfig.rows.length > 0
+ ) {
+ this.spanList = [];
+ this.spanConfig.rows.forEach((item, index) => {
+ this.spanList.push({
+ arr: [],
+ position: 0
+ });
+ this.rowspan(
+ this.spanList[index].arr,
+ this.spanList[index].position,
+ item.name
+ );
+ });
+ }
+ // 鐗规畩鐨勫悎骞惰
+ if (
+ this.spanConfig != undefined &&
+ this.spanConfig.special &&
+ this.spanConfig.special.main &&
+ this.spanConfig.special.rows &&
+ this.spanConfig.special.rows.length > 0
+ ) {
+ this.specialSpanList = [];
+ this.spanConfig.special.rows.forEach((item, index) => {
+ this.specialSpanList.push({
+ arr: [],
+ position: 0
+ });
+ this.rowspan(
+ this.specialSpanList[index].arr,
+ this.specialSpanList[index].position,
+ this.spanConfig.special.main
+ );
+ });
+ }
+ });
+ },
+ submitForm4() {
+ const obj = Object.assign({
+ deviceId: this.deviceId,
+ fileType: this.configForm.fileType,
+ collectUrl: this.configForm.collectUrl,
+ storageUrl: this.configForm.storageUrl,
+ ip: this.configForm.ip,
+ isDevice: true,
+ entrustCode: this.configForm.entrustCode,
+ sampleCode: this.configForm.sampleCode,
+ dbFileName: this.configForm.dbFileName,
+ fiberOpticRibbon: this.configForm.fiberOpticRibbon
+ });
+ this.upLoad4 = true;
+ saveDataAcquisitionConfiguration({ deviceId: this.deviceId, ...obj }).then(res => {
+ if (res.code == 200) {
+ // this.tableList = res.data;
+ this.dialogVisible4 = false;
+ this.init();
+ this.$message.success("鎿嶄綔鎴愬姛");
+ }
+ this.upLoad4 = false;
+ })
+ .catch(err => {
+ this.upLoad4 = false;
+ });
+ },
+ dataConfig(row) {
+ this.configForm = {
+ deviceId: row.deviceId,
+ inspectionItem: row.inspectionItem.trim(),
+ inspectionItemSubclass: row.inspectionItemSubclass,
+ structureItemParameterId: row.structureItemParameterId,
+ inspectionItemClass: row.inspectionItemClass,
+ };
+ this.dialogVisible3 = true;
+ queryDataAcquisitionConfiguration({
+ deviceId: this.deviceId,
+ inspectionItem: row.inspectionItem.trim(),
+ isDevice: true,
+ inspectionItemSubclass: row.inspectionItemSubclass.trim(),
+ inspectionItemClass: row.inspectionItemClass.trim(),
+ structureItemParameterId: row.structureItemParameterId
+ }).then(res => {
+ const data = res.data;
+ if (data[0]) {
+ this.domains.splice(0, 1);
+ let formula = data[0].formula
+ let isIncludes = false
+ if (formula && formula != "") {
+ for (let key in this.formulas) {
+ if (formula.includes(this.formulas[key].label)) {
+ isIncludes = true
+ }
+ }
+ }
+ if (!isIncludes && formula) {
+ let formulaValue = formula.slice(1, -1)
+ this.$set(this.configForm, "formula", formulaValue);
+ } else {
+ this.$set(this.configForm, "formula", data[0].formula);
+ }
+ data.forEach(i => {
+ this.domains.push({
+ referx: i.referx,
+ refery: i.refery,
+ x: i.x,
+ y: i.y,
+ anotherName: i.anotherName,
+ matchingName: i.matchingName,
+ id: i.id
+ });
+ });
+ }
+ });
+ },
+ submitForm3() {
+ this.$refs.configForm.validate(valid => {
+ // 琛ㄥ崟鏍¢獙
+ if (valid) {
+ this.domains.forEach(item => {
+ const isEmpty = Object.values(item).every(val => val === "");
+ if (isEmpty) {
+ this.$message.error("璇峰~鍐欏弬鐓ф暟鎹�");
+ }
+ });
+ this.domains.forEach((i, index) => {
+ let isIncludes = false
+ if (this.configForm.formula && this.configForm.formula !== "") {
+ for (let formula in this.formulas) {
+ if (this.configForm.formula.includes(this.formulas[formula].label)) {
+ isIncludes = true
+ }
+ }
+ }
+ if (isIncludes === false && this.configForm.formula !== "" && this.configForm.formula !== undefined) {
+ i.formula = "(" + this.configForm.formula + ")";
+ } else {
+ i.formula = this.configForm.formula;
+ }
+ i.deviceId = this.deviceId;
+ i.inspectionItem = this.configForm.inspectionItem;
+ i.inspectionItemSubclass = this.configForm.inspectionItemSubclass;
+ i.structureItemParameterId = this.configForm.structureItemParameterId;
+ i.inspectionItemClass = this.configForm.inspectionItemClass;
+ i.serialNumber = this.getIndexWithAlphabet(index)
+ });
+ saveDataAcquisitionConfiguration({
+ deviceId: this.deviceId,
+ dataConfigList: this.domains,
+ isDevice: false
+ }).then(res => {
+ this.dialogVisible3 = false;
+ this.domains = [
+ {
+ referx: "",
+ refery: "",
+ x: "",
+ y: "",
+ id: ""
+ }
+ ];
+ if (this.deleteList.length > 0) {
+ deleteDataAcquisitionConfiguration({ ids: this.deleteList.join() }).then(res => {
+ if (res.code == 200) {
+ this.init();
+ }
+ });
+ }
+ this.init();
+ this.$message.success("娣诲姞鎴愬姛");
+ });
+ } else {
+ return false;
+ }
+ });
+ },
+ removeDomain(item) {
+ // 鍒犻櫎鍏紡formItem
+ const index = this.domains.indexOf(item);
+ if (index !== -1 && this.domains.length > 1) {
+ if (item.id) {
+ this.deleteList.push(item.id);
+ this.domains.splice(index, 1);
+ } else {
+ this.domains.splice(index, 1);
+ }
+ } else {
+ this.$message.error("涓嶅厑璁稿垹闄ゆ渶鍚庝竴鏉℃暟鎹紒");
+ }
+ },
+ addDomain() {
+ // 娣诲姞鍏紡formItem
+ this.domains.push({
+ referx: "",
+ refery: "",
+ x: "",
+ y: "",
+ id: ""
+ });
+ },
+ evalResult(val) {
+ this.configForm.formula = val;
+ // 鏍规嵁鍏紡璁$畻鍑虹粨鏋�
+ },
+ sizeChange(val) {
+ this.page.size = val;
+ },
+ currentChange(val) {
+ this.page.current = val;
+ },
+ closeForm() {
+ this.deleteList = [];
+ this.domains = [
+ {
+ referx: "",
+ refery: "",
+ x: "",
+ y: "",
+ id: ""
+ }
+ ];
+ this.dialogVisible3 = false;
+ this.$refs.configForm.resetFields();
+ }
+ }
+};
+</script>
+
+<style scoped>
+.itemFomItem {
+ margin-left: 20px;
+}
+
+.search_thing {
+ width: 350px;
+ display: flex;
+ align-items: center;
+}
+
+.search_label {
+ width: 110px;
+
+ font-size: 14px;
+ text-align: right;
+}
+
+.data-acquisition-config {
+ width: 100%;
+ height: 100%;
+ overflow-y: hidden;
+ overflow-x: hidden;
+
+ .title {
+ height: 60px;
+ line-height: 60px;
+ }
+}
+
+.page {
+ width: 100%;
+ height: 30px;
+ text-align: right;
+ margin-top: 10px;
+}
+
+.table {
+ margin-top: 10px;
+ background-color: #fff;
+ width: calc(100vw - 1em);
+ height: calc(100vh - 18em);
+}
+
+.fomItem1 {
+ display: flex;
+ height: 74px;
+}
+
+.fomItem2 {
+ display: flex;
+ width: 100%;
+}
+
+.fomItemInput {
+ width: 180px;
+ margin-right: 6px;
+}
+
+.fomItemInput1 {
+ width: 100%;
+ margin-right: 6px;
+}
+
+>>>.el-form-item__label {
+ padding-bottom: 0 !important;
+}
+</style>
diff --git a/src/views/CNAS/resourceDemand/device/component/borrow.vue b/src/views/CNAS/resourceDemand/device/component/borrow.vue
new file mode 100644
index 0000000..fd18aba
--- /dev/null
+++ b/src/views/CNAS/resourceDemand/device/component/borrow.vue
@@ -0,0 +1,651 @@
+<!-- 璁惧鍊熺敤 -->
+<template>
+ <div>
+ <div class="search">
+ <div class="search_thing">
+ <div class="search_label">娴佺▼缂栧彿锛�</div>
+ <div><el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.processNumber"
+ @keyup.enter.native="refreshTable()"></el-input></div>
+ </div>
+ <div class="search_thing" style="padding-left: 30px;">
+ <el-button size="small" @click="refresh()">閲� 缃�</el-button>
+ <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
+ </div>
+ <div class="btns">
+ <el-button size="small" type="primary" @click="add">鏂板</el-button>
+ <el-button size="small" type="primary" @click="handleDown" :loading="outLoading">瀵煎嚭</el-button>
+ </div>
+ </div>
+ <div class="tables" style="margin-top: 10px;">
+ <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 290px)'"
+ :page="page" @pagination="pagination"></lims-table>
+ <!-- <ValueTable ref="ValueTable" :url="$api.deviceBorrow.deviceBorrowPage"
+ :delUrl="$api.deviceBorrow.deleteDeviceBorrow" :componentData="componentData" :key="upIndex" /> -->
+ </div>
+ <el-dialog title="浠櫒璁惧棰�(鍊�)鐢ㄧ櫥璁�" top="5vh" :visible.sync="dialogVisible" width="60%">
+ <el-steps :active="currentStep" finish-status="success" align-center>
+ <el-step style="cursor:pointer" v-for="(v, i) in steps" :title="v" :key="i"
+ @click.native="choiceStep(i)"></el-step>
+ </el-steps>
+ <el-form ref="form" :model="form" :rules="rules" label-width="130px">
+ <div v-show="currentStepClick === 0">
+ <el-card style="margin-top: 1em; height: 51vh; overflow-y: scroll;">
+ <!-- 鏂板璁惧浜嬭褰曞崱鐗� -->
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="缂栧彿锛�" prop="processNumber">
+ <el-input v-model="form.processNumber" size="small" :disabled="currentStep > 0"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璁惧鍚嶇О锛�">
+ <el-input v-model="form.deviceName" size="small" disabled></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="绠$悊缂栧彿锛�" prop="unifyNumber">
+ <el-input v-model="form.unifyNumber" size="small" :disabled="currentStep > 0"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍊熺敤浜猴細" prop="recipientUser">
+ <el-select v-model="form.recipientUser" filterable placeholder="璇烽�夋嫨" clearable size="small"
+ style="width: 100%;" :disabled="currentStep > 0">
+ <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍊熺敤浜鸿仈绯绘柟寮忥細" prop="borrowerContactInformation" label-width="150px">
+ <el-input v-model="form.borrowerContactInformation" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍊熺敤鏃ユ湡锛�" prop="recipientTime">
+ <el-date-picker v-model="form.recipientTime" type="date" placeholder="閫夋嫨鏃ユ湡" size="small"
+ format="yyyy-MM-dd" style="width: 100%" value-format="yyyy-MM-dd" :disabled="currentStep > 0">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍊熺敤鏃剁姸鎬侊細">
+ <el-radio-group v-model="form.recipientState" :disabled="currentStep !== 0">
+ <el-radio :label="0">鍚堟牸</el-radio>
+ <el-radio :label="1">缁翠慨</el-radio>
+ <el-radio :label="2">鍋滅敤</el-radio>
+ <el-radio :label="3">鎶ュ簾</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="鐩稿叧闄勪欢锛�" prop="fileName">
+ <el-input v-model="form.fileName" disabled size="small"
+ :style="`width: ${currentStep == 0 ? '88%' : '100%'};`">
+ <el-button slot="append" v-if="currentStep === 0" icon="el-icon-delete-solid"
+ @click="deleteFile"></el-button>
+ </el-input>
+ <el-upload ref="upload" style="float: right;" :action="action" :show-file-list="false"
+ :on-success="onSuccess" :disabled="currentStep !== 0" :headers="uploadHeader">
+ <el-button style="position: relative;top: -4px" class="uploadFile" slot="trigger" size="small"
+ type="primary" v-if="currentStep === 0">闄勪欢涓婁紶</el-button>
+ </el-upload>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="涓嬬幆鑺傝矗浠讳汉锛�" prop="nextUser">
+ <el-select v-model="form.nextUser" filterable placeholder="璇烽�夋嫨" clearable size="small"
+ style="width: 100%;" :disabled="currentStep !== 0">
+ <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-card>
+ <el-row style="margin-top: 1em;">
+ <el-col :span="4">
+ 鎿嶄綔浜猴細{{ form.submitOperationUser }}
+ </el-col>
+ <el-col :span="6">
+ 鏃ユ湡锛歿{ form.submitOperationTime }}
+ </el-col>
+ </el-row>
+ </div>
+ <div v-show="currentStepClick === 1">
+ <el-card style="margin-top: 1em; height: 51vh; overflow-y: scroll;">
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="褰掕繕浜猴細" prop="rebackUser"
+ :rules="[{ required: currentStep === 1, message: '璇疯緭鍏ュ綊杩樹汉', trigger: 'change' }]">
+ <!-- <el-input v-model="form.rebackUser" size="small" :disabled="currentStep !== 1"></el-input> -->
+ <el-select v-model="form.rebackUser" filterable placeholder="璇烽�夋嫨" clearable size="small"
+ style="width: 50%;" :disabled="currentStep !== 1">
+ <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="褰掕繕鏃ユ湡锛�" prop="rebackTime"
+ :rules="[{ required: currentStep === 1, message: '璇烽�夋嫨褰掕繕鏃ユ湡', trigger: 'change' }]">
+ <el-date-picker v-model="form.rebackTime" :disabled="currentStep !== 1" type="date" placeholder="閫夋嫨鏃ユ湡"
+ size="small" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鎺ユ敹鐘跺喌锛�">
+ <el-radio-group v-model="form.receiveState" :disabled="currentStep !== 1">
+ <el-radio :label="0">鍚堟牸</el-radio>
+ <el-radio :label="1">缁翠慨</el-radio>
+ <el-radio :label="2">鍋滅敤</el-radio>
+ <el-radio :label="3">鎶ュ簾</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璁惧璐熻矗浜猴細" prop="deviceUser"
+ :rules="[{ required: currentStep === 1, message: '璇烽�夋嫨璁惧璐熻矗浜�', trigger: 'change' }]">
+ <!-- <el-input v-model="form.deviceUser" size="small" :disabled="currentStep !== 1"></el-input> -->
+ <el-select v-model="form.deviceUser" filterable placeholder="璇烽�夋嫨" clearable size="small"
+ style="width: 50%;" :disabled="currentStep !== 1">
+ <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="澶囨敞锛�">
+ <el-input type="textarea" v-model="form.note" :disabled="currentStep !== 1" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+
+ </el-row>
+ </el-card>
+ <el-row style="margin-top: 1em;">
+ <el-col :span="4">
+ 鎿嶄綔浜猴細{{ form.receiveOperationUser }}
+ </el-col>
+ <el-col :span="6">
+ 鏃ユ湡锛歿{ form.receiveOperationTime }}
+ </el-col>
+ </el-row>
+ </div>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="submitForm('3reject')" v-if="currentStep !== 0 && currentStep !== 2">椹冲洖</el-button>
+ <el-button @click="submitForm('2save')" v-if="currentStep === 0">淇濆瓨</el-button>
+ <el-button type="primary" v-if="currentStep !== 2" @click="submitForm('1submit')">{{ currentStep === 0 ? '鎻愪氦' :
+ '閫氳繃'
+ }}</el-button>
+ </span>
+ </el-dialog>
+ <el-dialog title="娴佺▼璺熻釜" top="5vh" :visible.sync="dialogVisible0" width="60%">
+ <el-table :data="deviceLogs" style="width: 100%">
+ <el-table-column type="index" width="50">
+ </el-table-column>
+ <el-table-column prop="operator" label="鎿嶄綔浜�" width="180">
+ </el-table-column>
+ <el-table-column prop="operationTime" label="鎿嶄綔鏃ユ湡" width="180">
+ </el-table-column>
+ <el-table-column prop="operationType" label="鎻愪氦绫诲瀷">
+ </el-table-column>
+ <el-table-column prop="operationContent" label="鎿嶄綔鍐呭">
+ </el-table-column>
+ </el-table>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import limsTable from "@/components/Table/lims-table.vue";
+import { dateFormat } from '@/utils/date'
+import {
+ saveDeviceBorrow,
+ deleteCNASFile,
+ getDeviceBorrow,
+ deviceBorrowExport,
+ deleteDeviceBorrow,
+ deviceBorrowPage,
+} from '@/api/cnas/resourceDemand/device.js'
+import { selectUserCondition } from "@/api/system/user";
+import { mapGetters } from "vuex";
+export default {
+ props: {
+ clickNodeVal: {
+ type: Object,
+ default: () => {
+ return {};
+ }
+ }
+ },
+ components: {
+ limsTable
+ },
+ data() {
+ return {
+ dialogVisible: false,
+ dialogVisible0: false,
+ currentStep: 0, // 姝ラ鏉℃樉绀虹鍑犳
+ currentStepClick: 0, // 鐐瑰嚮姝ラ鏉″彉鍖�
+ steps: ['鍊熷嚭', '鍊熺敤'],
+ responsibleOptions: [], // 涓嬬幆鑺傝礋璐d汉list
+ form: {
+ processNumber: null,
+ deviceName: null,
+ unifyNumber: null,
+ recipientUser: null,
+ recipientTime: null,
+ nextUser: null,
+ rebackUser: null,
+ rebackTime: null,
+ receiveState: null,
+ deviceUser: null,
+ fileName: null,
+ },
+ rules: {
+ processNumber: [{ required: true, message: '璇疯緭鍏ョ紪鍙�', trigger: 'blur' }],
+ deviceName: [{ required: true, message: '璇疯緭鍏ヨ澶囧悕绉�', trigger: 'blur' }],
+ unifyNumber: [{ required: true, message: '璇疯緭鍏ョ鐞嗙紪鍙�', trigger: 'blur' }],
+ recipientUser: [{ required: true, message: '璇疯緭鍏ュ�熺敤浜�', trigger: 'blur' }],
+ borrowerContactInformation: [{ required: true, message: '璇疯緭鍏ュ�熺敤浜鸿仈绯绘柟寮�', trigger: 'blur' }],
+ recipientTime: [{ required: true, message: '璇烽�夋嫨鍊熺敤鏃ユ湡', trigger: 'change' }],
+ nextUser: [{ required: true, message: '璇烽�夋嫨涓嬬幆鑺傝礋璐d汉', trigger: 'change' }],
+ },
+ deviceLogs: [],
+ outLoading: false,
+ recipientStateList: [{
+ value: 0,
+ type: 'success',
+ label: '鍚堟牸'
+ }, {
+ value: 1,
+ type: 'warning',
+ label: '缁翠慨'
+ }, {
+ value: 2,
+ type: 'info',
+ label: '鍋滅敤'
+ }, {
+ value: 3,
+ type: 'danger',
+ label: '鎶ュ簾'
+ }],
+ queryParams: {},
+ tableData: [],
+ column: [
+ { label: "娴佺▼缂栧彿", prop: "processNumber" },
+ { label: "璁惧鍚嶇О", prop: "deviceName" },
+ {
+ label: "绠$悊缂栧彿",
+ prop: "unifyNumber"
+ },
+ { label: "鍊熺敤浜�", prop: "recipientUser" },
+ { label: "鍊熺敤浜鸿仈绯绘柟寮�", prop: "borrowerContactInformation", width: '140px' },
+ { label: "鍊熺敤鏃ユ湡", prop: "recipientTime" },
+ {
+ label: "鍊熺敤鏃剁姸鎬�", prop: "recipientState", dataType: "tag",
+ formatData: (params) => {
+ return this.recipientStateList.find((m) => m.value == params).label;
+ },
+ formatType: (params) => {
+ return this.recipientStateList.find((m) => m.value == params).type;
+ },
+ },
+ { label: "鍊熷嚭浜�", prop: "submitUser" },
+ { label: "鍊熷嚭鏃ユ湡", prop: "createTime" },
+ {
+ label: "褰撳墠鐘舵��", prop: "nowState"
+ },
+ { label: "褰撳墠璐d换浜�", prop: "nowUser" },
+ { label: "闄勪欢", prop: "fileName" },
+ {
+ dataType: "action",
+ fixed: "right",
+ label: "鎿嶄綔",
+ operation: [
+ {
+ name: "鏌ョ湅",
+ type: "text",
+ clickFun: (row) => {
+ this.lookDetail(row);
+ },
+ },
+ {
+ name: "鍒犻櫎",
+ type: "text",
+ clickFun: (row) => {
+ this.handleDelete(row);
+ },
+ },
+ {
+ name: "娴佺▼璺熻釜",
+ type: "text",
+ clickFun: (row) => {
+ this.handleLookList(row);
+ },
+ },
+ ],
+ },
+ ],
+ page: {
+ total: 0,
+ size: 10,
+ current: 0,
+ },
+ tableLoading: false,
+ }
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ clickNodeVal(newVal) {
+ if (newVal.value) {
+ thisqueryParams.deviceId = this.clickNodeVal.value
+ this.refreshTable()
+ }
+ },
+ dialogVisible(newVal) {
+ if (!newVal) {
+ this.form = {}
+ this.currentStep = 0 // 姝ラ鏉℃樉绀虹鍑犳
+ this.currentStepClick = 0 // 鐐瑰嚮姝ラ鏉″彉鍖�
+ this.$refs['form'].clearValidate()
+ }
+ }
+ },
+ computed: {
+ ...mapGetters(["nickName"]),
+ action() {
+ return this.javaApi + '/personBasicInfo/saveCNASFile'
+ }
+ },
+ mounted() {
+ this.queryParams.deviceId = this.clickNodeVal.value
+ this.getUserList()
+ this.refreshTable()
+ },
+ methods: {
+ getList() {
+ this.tableLoading = true;
+ let param = { ...this.queryParams, ...this.page };
+ delete param.total;
+ deviceBorrowPage({ ...param })
+ .then((res) => {
+ this.tableLoading = false;
+ if (res.code === 200) {
+ this.tableData = res.data.records;
+ this.page.total = res.data.total;
+ }
+ })
+ .catch((err) => {
+ this.tableLoading = false;
+ });
+ },
+ pagination({ page, limit }) {
+ this.page.current = page;
+ this.page.size = limit;
+ this.getList();
+ },
+ refresh() {
+ this.queryParams = {};
+ this.page.current = 1;
+ this.getList();
+ },
+ refreshTable() {
+ this.page.current = 1;
+ this.getList();
+ },
+ choiceStep(index) {
+ this.currentStepClick = index
+ },
+ //鎻愪氦琛ㄥ崟
+ async submitForm(saveState) {
+ this.$refs.form.validate((valid) => {
+ if (valid === true || saveState !== '1submit') {
+ // 缁欏綋鍓嶇幆鑺傝缃垱寤轰汉涓庢椂闂�
+ let user = JSON.parse(localStorage.getItem('user'))
+ const dateTime = dateFormat(new Date())
+ // 鑾峰彇褰撳墠鐜妭鎿嶄綔浜轰笌鏃ユ湡
+ switch (this.currentStep) {
+ case 0:
+ this.form.submitOperationUser = this.nickName
+ this.form.submitOperationTime = dateTime
+ break
+ case 1:
+ this.form.receiveOperationUser = this.nickName
+ this.form.receiveOperationTime = dateTime
+ break
+ default:
+ break
+ }
+ // 鑾峰彇褰撳墠鐜妭璐熻矗浜�
+ switch (saveState === '3reject' ? this.currentStep - 1 : this.currentStep) {
+ case 0:
+ this.form.nowUser = this.form.nextUser
+ break
+ default:
+ break
+ }
+ let currentStepAction;
+ // 璁剧疆璇ユ搷浣滃垽鏂槸鍚︿负鎻愪氦锛屼繚瀛橈紝椹冲洖锛岄�氳繃
+ switch (saveState) {
+ // 鎻愪氦锛岄�氳繃
+ case '1submit':
+ currentStepAction = this.currentStep + 1
+ break
+ // 淇濆瓨
+ case '2save':
+ currentStepAction = this.currentStep
+ break
+ // 椹冲洖
+ case '3reject':
+ currentStepAction = this.currentStep - 1
+ break
+ default:
+ break
+ }
+ // 鑾峰彇褰撳墠鐘舵��
+ this.form.nowState = currentStepAction === 2 ? '鍏抽棴' : this.steps[currentStepAction]
+ this.form.deviceId = this.clickNodeVal.value
+ delete this.form.deviceLogs
+ saveDeviceBorrow(this.form).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鎻愪氦鎴愬姛')
+ this.dialogVisible = false
+ this.refreshTable()
+ }
+ })
+ } else {
+ let step = this.steps[this.currentStep]
+ this.$message.warning(step + ' 娴佺▼涓湁蹇呭~椤规湭濉紒');
+ }
+ });
+ },
+ deleteFile() {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ枃浠�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deleteCNASFile({ fileName: this.form.fileName }).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鍒犻櫎鎴愬姛锛�')
+ }
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
+ },
+ onSuccess(response, file, fileList) {
+ if (response.code == 200) {
+ // 鍦ㄤ繚瀛樿祴鍊兼柊鏂囦欢
+ this.form.fileName = file.name
+ this.form.url = response.data
+ } else {
+ this.$message.error(response.message)
+ }
+ },
+ // 鑾峰彇璐熻矗浜轰俊鎭帴鍙�
+ getUserList() {
+ selectUserCondition().then(res => {
+ if (res.code == 200) {
+ this.responsibleOptions = res.data
+ }
+ })
+ },
+ // 鏌ョ湅璇︽儏
+ lookDetail(row) {
+ getDeviceBorrow({ id: row.id }).then(res => {
+ if (res.code == 200) {
+ this.form = res.data
+ this.form.deviceName = this.clickNodeVal.label
+ this.form.deviceId = this.clickNodeVal.value
+ this.deviceLogs = res.data.deviceLogs
+ let i = this.steps.findIndex(item => item == row.nowState)
+ if (i == -1) {
+ this.currentStep = 2
+ this.currentStepClick = 0
+ } else {
+ this.currentStep = i
+ this.currentStepClick = i
+ }
+ console.log(this.currentStepClick)
+ this.dialogVisible = true
+ }
+ })
+ },
+ // 鏂板
+ add() {
+ this.dialogVisible = true
+ this.form = {
+ processNumber: null,
+ deviceName: null,
+ unifyNumber: null,
+ recipientUser: null,
+ recipientTime: null,
+ nextUser: null,
+ rebackUser: null,
+ rebackTime: null,
+ receiveState: null,
+ deviceUser: null,
+ fileName: null,
+ }
+ this.form.deviceName = this.clickNodeVal.label
+ this.form.deviceId = this.clickNodeVal.value
+ },
+ //瀵煎嚭
+ handleDown() {
+ this.outLoading = true
+ deviceBorrowExport({ deviceId: this.clickNodeVal.value }).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], {
+ type: 'application/force-download'
+ })
+ const filename = decodeURI(this.clickNodeVal.label + '璁惧鍊熷嚭缁熻' + '.xlsx')
+ this.$download.saveAs(blob, filename)
+ })
+ },
+ handleLookList(row) {
+ getDeviceBorrow({ id: row.id }).then(res => {
+ if (res.code == 200) {
+ this.deviceLogs = res.data.deviceLogs
+ this.dialogVisible0 = true
+ }
+ })
+ },
+ handleDelete(row) {
+ this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ deleteDeviceBorrow({ id: row.id }).then((res) => {
+ this.$message.success("鍒犻櫎鎴愬姛");
+ this.refresh();
+ });
+ })
+ .catch(() => { });
+ },
+ },
+}
+</script>
+
+<style scoped>
+h4 {
+ font-weight: 400;
+ font-size: 16px;
+ display: flex;
+ justify-content: space-between;
+ margin: 10px 0;
+}
+
+h4 .line {
+ display: inline-block;
+ width: 3px;
+ height: 16px;
+ background: #3A7BFA;
+ margin-right: 4px;
+}
+
+.tables {
+ width: 100%;
+ height: calc(100vh - 15em);
+}
+
+.search {
+ background-color: #fff;
+ display: flex;
+ align-items: center;
+ position: relative;
+ margin-top: 10px;
+}
+
+.search_thing {
+ display: flex;
+ align-items: center;
+ height: 40px;
+}
+
+.search_label {
+ width: 70px;
+ font-size: 14px;
+ text-align: right;
+}
+
+.search_input {
+ width: calc(100% - 120px);
+}
+
+.btns {
+ position: absolute;
+ right: 0px;
+ top: 50%;
+ transform: translate(0, -50%);
+}
+
+.btns_thing {
+ position: absolute;
+ right: 230px;
+ top: 50%;
+ transform: translate(0, -50%);
+}
+
+.form .search_label {
+ width: 120px;
+}
+
+.el-radio {
+ margin-right: 10px;
+}
+
+.el-radio-group {
+ width: 100%;
+ display: flex;
+ margin-top: 12px;
+}
+</style>
diff --git a/src/views/CNAS/resourceDemand/device/component/calibration.vue b/src/views/CNAS/resourceDemand/device/component/calibration.vue
new file mode 100644
index 0000000..5f4fd0e
--- /dev/null
+++ b/src/views/CNAS/resourceDemand/device/component/calibration.vue
@@ -0,0 +1,805 @@
+<!-- 璁惧鏍″噯 -->
+<template>
+ <div>
+ <div class="btnS">
+ <el-button size="small" type="primary" @click="calibrationMaintenance()">鏍″噯椤圭洰缁存姢</el-button>
+ <el-button size="small" type="primary" @click="add('add')">娣诲姞鏍″噯璁板綍</el-button>
+ <el-button size="small" type="primary" @click="handleDown">瀵煎嚭Excel</el-button>
+ </div>
+ <div class="tables" style="margin-top: 16px;">
+ <el-table :data="tableData" height="calc(100vh - 20em)">
+ <el-table-column label="搴忓彿" type="index" width="120">
+ <template v-slot="scope">
+ <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="璁板綍缂栧彿" min-width="150" prop="processNumber"></el-table-column>
+ <el-table-column label="鏍″噯鏈烘瀯" min-width="150" prop="unitOfMeasure"
+ show-overflow-tooltip></el-table-column>
+ <el-table-column label="鏍″噯缁撹" min-width="150" prop="status">
+ <template v-slot="scope">
+ {{ scope.row.status === '0yes' ? '鍚堟牸' : scope.row.status === '1no' ? '涓嶅悎鏍�' : '鍏朵粬' }}
+ </template>
+ </el-table-column>
+ <el-table-column label="鏍″噯璇佷功缂栧彿" min-width="150" prop="certificateSerialNumber"></el-table-column>
+ <el-table-column label="璇存槑" min-width="150" prop="remark" show-overflow-tooltip></el-table-column>
+ <el-table-column label="鏍″噯鏃ユ湡" min-width="150" prop="calibrationDate"></el-table-column>
+ <el-table-column label="涓嬫鏍″噯鏃ユ湡" min-width="150" prop="nextCalibrationDate"></el-table-column>
+ <el-table-column label="纭鏃ユ湡" min-width="150" prop="confirmDate"></el-table-column>
+ <el-table-column label="鐧昏浜�" min-width="150" prop="createUser"></el-table-column>
+ <el-table-column label="鐧昏鏃ユ湡" min-width="150" prop="createTime"></el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔" min-width="150">
+ <template #default="{ row }">
+ <el-button size="small" type="text" @click="handleAttachmentClick(row)">闄勪欢</el-button>
+ <!-- <el-button size="small" type="text" @click="handleViewClick('view', row)">鏌ョ湅</el-button> -->
+ <el-button size="small" type="text" @click="handleViewClick('add', row)">缂栬緫</el-button>
+ <el-button size="small" type="text" @click="handleDeleteClick(row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]"
+ :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" style="margin-right: 5%;"
+ @size-change="handleSizeChange" @current-change="handleCurrentChange">
+ </el-pagination>
+ </div>
+ <!-- 鏂囦欢棰勮 -->
+ <el-dialog
+ :visible.sync="lookDialogVisible"
+ fullscreen
+ title="鏌ョ湅闄勪欢" width="800px">
+ <filePreview v-if="lookDialogVisible" :currentFile="{}"
+ :fileUrl="previewFile" style="height: 90vh;overflow-y: auto;top: 0"/>
+ </el-dialog>
+ <!-- 闄勪欢寮规 -->
+ <el-dialog
+ title="闄勪欢"
+ :visible.sync="dialogVisibleFile"
+ width="60%"
+ >
+ <el-upload
+ ref="upload"
+ style="margin-top: 5px;margin-bottom: 10px;"
+ :action="action"
+ :data="uploadData"
+ :headers="uploadHeader"
+ :before-upload="beforeUpload"
+ :on-success="onSuccess"
+ >
+ <el-button type="primary" size="small" :loading="upLoading">涓婁紶闄勪欢</el-button>
+ </el-upload>
+ <el-table
+ :data="fileData"
+ border
+ height="400px"
+ style="width: 100%">
+ <el-table-column label="搴忓彿" type="index" width="240px">
+ </el-table-column>
+ <el-table-column label="鏂囦欢鍚嶇О" prop="fileName">
+ </el-table-column>
+ <el-table-column label="鎿嶄綔">
+ <template slot-scope="scope">
+ <el-button type="text" @click="preview(scope.row)">棰勮</el-button>
+ <el-button type="text" @click="download(scope.row)">涓嬭浇</el-button>
+ <el-button type="text" @click="delFile(scope.row)" style="color: red;">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <span slot="footer" class="dialog-footer">
+ <el-button type="primary" @click="dialogVisibleFile = false">鍏� 闂�</el-button>
+ </span>
+ </el-dialog>
+
+
+
+ <!-- 鏍″噯椤圭洰缁存姢 -->
+ <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="dialogVisible0" title="鏍″噯椤圭洰缁存姢"
+ top="5vh" width="70%">
+ <h4>
+ <span style="display: flex;align-items: center;"><span class="line"></span><span>璁惧鏍″噯鍙傛暟缁存姢</span></span>
+ <el-button :loading="addCalibrateLoading" size="small" type="primary" @click="addCalibrate">娣� 鍔�</el-button>
+ </h4>
+ <div>
+ <el-form ref="form0" :model="form0" :rules="form0Rules"
+ label-position="right" label-width="120px">
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="璁¢噺鍙傛暟:" prop="measurementParameter">
+ <el-input v-model="form0.measurementParameter" clearable placeholder="璇疯緭鍏�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="閲忕▼鑼冨洿:" prop="rangeOfMeasurement">
+ <el-input v-model="form0.rangeOfMeasurement" clearable placeholder="璇疯緭鍏�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鏈�澶у厑璁歌宸�:" prop="maxPermissibleError">
+ <el-input v-model="form0.maxPermissibleError" clearable placeholder="璇疯緭鍏�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍒ゅ畾鏍囧噯:" prop="judgmentCriteria">
+ <el-input v-model="form0.judgmentCriteria" clearable placeholder="璇疯緭鍏�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ </div>
+ <h4>
+ <span style="display: flex;align-items: center;"><span class="line"></span><span>璁惧鏍″噯鍙傛暟</span></span>
+ </h4>
+ <!-- 璁惧鏍″噯鍙傛暟琛ㄦ牸 -->
+ <el-table ref="calibrateTable" v-loading="calibrateParamsLoading" :data="calibrateParams"
+ max-height="450"
+ stripe style="width: 100%">
+ <el-table-column label="缂栧彿" type="index" width="80"></el-table-column>
+ <el-table-column label="璁¢噺鍙傛暟" prop="measurementParameter"></el-table-column>
+ <el-table-column label="閲忕▼鑼冨洿" prop="rangeOfMeasurement"></el-table-column>
+ <el-table-column label="鏈�澶у厑璁歌宸�" prop="maxPermissibleError"></el-table-column>
+ <el-table-column label="鍒ゅ畾鏍囧噯" prop="judgmentCriteria"></el-table-column>
+ <el-table-column label="鍒涘缓浜�" prop="createdBy"></el-table-column>
+ <el-table-column label="鍒涘缓鏃堕棿" prop="creationTime"></el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔">
+ <template slot-scope="scope">
+ <el-button size="small" type="text" @click="handleDelete(scope.row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-dialog>
+
+ <!-- 娣诲姞鏍″噯璁板綍 -->
+ <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="dialogVisible1" title="鏍″噯璁板綍"
+ top="5vh"
+ width="80%" @close="resetCalibrationRecord">
+ <div style="height: 70vh;overflow-y: auto;overflow-x: hidden;">
+ <h4>
+ <div style="display: flex;align-items: center;">
+ <span class="line"></span>
+ <span>娣诲姞璁惧鏍″噯璁板綍</span>
+ </div>
+ </h4>
+ <el-form ref="calibrationRecord" :model="calibrationRecord"
+ :rules="formRules" label-position="right" label-width="120px">
+ <el-row>
+ <el-col :span="6">
+ <el-form-item label="鏍″噯鏈嶅姟鏈烘瀯:" prop="unitOfMeasure">
+ <el-input v-model="calibrationRecord.unitOfMeasure" :disabled="operationType === 'view'"
+ size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鏍″噯鏃ユ湡:" prop="calibrationDate">
+ <el-date-picker v-model="calibrationRecord.calibrationDate" :disabled="operationType === 'view'"
+ format="yyyy-MM-dd"
+ placeholder="閫夋嫨鏃ユ湡"
+ size="small"
+ style="width: 90%" type="date"
+ value-format="yyyy-MM-dd" @change="getNextCalibrationDate">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="10">
+ <el-form-item label="涓嬫鏍″噯鏃ユ湡:" label-width="140px">
+ <el-date-picker v-model="calibrationRecord.nextCalibrationDate" disabled
+ format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small" style="width: 90%"
+ type="date" value-format="yyyy-MM-dd">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="璁$畻鍣ㄥ叿:" prop="calculatingApparatus">
+ <el-input v-model="calibrationRecord.calculatingApparatus" :disabled="operationType === 'view'"
+ size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="璁$畻鏍囧噯閲忕▼:" prop="standardRange">
+ <el-input v-model="calibrationRecord.standardRange" :disabled="operationType === 'view'" size="small"
+ style="width: 90%"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="10">
+ <el-form-item label="璁¢噺鏍囧噯涓嶇‘瀹氬害:" label-width="140px" prop="calibrationStandardUncertainty">
+ <el-input v-model="calibrationRecord.calibrationStandardUncertainty" :disabled="operationType === 'view'" size="small"
+ style="width: 90%"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="鎵�渚濇嵁鏂囦欢:" prop="byDocument">
+ <el-input v-model="calibrationRecord.byDocument" :disabled="operationType === 'view'"
+ size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="璇佷功缂栧彿:" prop="certificateSerialNumber">
+ <el-input v-model="calibrationRecord.certificateSerialNumber" :disabled="operationType === 'view'" size="small"
+ style="width: 90%"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="10">
+ <el-form-item label="鐘舵��:" label-width="140px" prop="status" required>
+ <el-radio-group v-model="calibrationRecord.status" :disabled="operationType === 'view'">
+ <el-radio label="0yes">鍚堟牸</el-radio>
+ <el-radio label="1no">涓嶅悎鏍�</el-radio>
+ <el-radio label="2other">鍏朵粬</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="纭鏃ユ湡:">
+ <el-date-picker v-model="calibrationRecord.confirmDate" :disabled="operationType === 'view'"
+ format="yyyy-MM-dd HH:mm:ss" placeholder="閫夋嫨鏃ユ湡" size="small" style="width: 100%"
+ type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="澶囨敞:">
+ <el-input v-model="calibrationRecord.remark" :disabled="operationType === 'view'" :rows="3" size="small" style="width: 96%"
+ type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ <h4>
+ <span style="display: flex;align-items: center;">
+ <span class="line"></span><span>鏍″噯鏉$洰纭缁撴灉</span>
+ </span>
+ </h4>
+ <el-table ref="calibrateTable" :data="calibrateParams" border>
+ <el-table-column label="缂栧彿" type="index" width="60"></el-table-column>
+ <el-table-column label="璁¢噺鍙傛暟" prop="measurementParameter"></el-table-column>
+ <el-table-column label="閲忕▼鑼冨洿" prop="rangeOfMeasurement"></el-table-column>
+ <el-table-column label="鏈�澶у厑璁歌宸�" prop="maxPermissibleError"></el-table-column>
+ <el-table-column label="鍒ゅ畾鏍囧噯" prop="judgmentCriteria"></el-table-column>
+ <el-table-column label="鏄惁鏍″噯" prop="isCalibration">
+ <template slot="header" slot-scope="scope">
+ <span class="required-span">* </span>鏄惁鏍″噯
+ </template>
+ <template slot-scope="scope">
+ <el-radio-group v-model="scope.row.isCalibration" :disabled="operationType === 'view'">
+ <el-radio label="0yes">鏄�</el-radio>
+ <el-radio label="1no">鍚�</el-radio>
+ </el-radio-group>
+ </template>
+ </el-table-column>
+ <el-table-column label="鍒ゅ畾缁撴灉" min-width="140" prop="result">
+ <template slot="header" slot-scope="scope">
+ <span class="required-span">* </span>鍒ゅ畾缁撴灉
+ </template>
+ <template slot-scope="scope">
+ <el-radio-group v-model="scope.row.result" :disabled="operationType === 'view'" @input="checkRadio()">
+ <el-radio label="0yes">鍚堟牸</el-radio>
+ <el-radio label="1no">涓嶅悎鏍�</el-radio>
+ <el-radio label="2other">鍏朵粬</el-radio>
+ </el-radio-group>
+ </template>
+ </el-table-column>
+ <el-table-column label="鍗曢」缁撴灉璇存槑" prop="singleResultStatement">
+ <template slot-scope="scope">
+ <el-input v-model="scope.row.singleResultStatement" :disabled="operationType === 'view'"
+ size="small"></el-input>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button v-if="operationType === 'add'" @click="dialogVisible1 = false">鍙� 娑�</el-button>
+ <el-button v-if="operationType === 'add'" :loading="addRecordLoading" type="primary"
+ @click="addRecord">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import {
+ deviceMetricRecordPage,
+ showDeviceMetricsCopy,
+ deleteDeviceMetricRecord,
+ deviceMetricRecordExport,
+ deleteCNASFile,
+ selectDeviceMetric,
+ deleteDeviceMetrics,
+ addOrUpdateDeviceMetricRecord,
+ saveOrUpdateDeviceMetric, downLoadDeviceCalibrationFile, getDeviceCalibrationFile, delDeviceCalibrationFile
+} from '@/api/cnas/resourceDemand/device.js'
+import { mapGetters } from "vuex";
+import filePreview from "@/components/Preview/filePreview.vue";
+export default {
+ components: {filePreview},
+ props: {
+ clickNodeVal: {
+ type: Object,
+ default: () => {
+ return {};
+ }
+ }
+ },
+ data() {
+ return {
+ value: "",
+ calibrateParams: [],
+ calibrateParamsLoading: false,
+ addCalibrateLoading: false,
+ previewFile: '',
+ lookDialogVisible: false,
+ recordId: null,
+ uploadData: {},
+ fileData: [],
+ dialogVisibleFile: false,
+ calibrationRecord: {
+ unitOfMeasure: '', // 璁¢噺鍗曚綅
+ calibrationDate: null, // 鏍″噯鏃ユ湡
+ nextCalibrationDate: null, // 涓嬫鏍″噯鏃ユ湡
+ calculatingApparatus: '', // 璁$畻鍣ㄥ叿
+ confirmDate: null, // 纭鏃ユ湡
+ standardRange: '', // 璁$畻鏍囧噯閲忕▼
+ calibrationStandardUncertainty: '', // 璁¢噺鏍囧噯涓嶇‘瀹氬害
+ byDocument: '', // 渚濇嵁鏂囦欢
+ certificateSerialNumber: '', // 璇佷功缂栧彿
+ status: '', // 鐘舵��
+ remark: '', // 澶囨敞
+ systemFileName: '', //
+ fileName: '', //
+ },
+ formRules: {
+ unitOfMeasure: [{ required: true, message: '璇疯緭鍏ユ牎鍑嗘湇鍔℃満鏋�', trigger: 'blur' }],
+ calibrationDate: [{ required: true, message: '璇烽�夋嫨鏍″噯鏃ユ湡', trigger: 'change' }],
+ calculatingApparatus: [{ required: true, message: '璇疯緭鍏ヨ绠楀櫒鍏�', trigger: 'blur' }],
+ standardRange: [{ required: true, message: '璇疯緭鍏ヨ绠楁爣鍑嗛噺绋�', trigger: 'blur' }],
+ calibrationStandardUncertainty: [{ required: true, message: '璇疯緭鍏ヨ閲忔爣鍑嗕笉纭畾搴�', trigger: 'blur' }],
+ byDocument: [{ required: true, message: '璇疯緭鍏ユ墍渚濇嵁鏂囦欢', trigger: 'blur' }],
+ status: [{ required: true, message: '璇烽�夋嫨鐘舵��', trigger: 'change' }],
+ },
+ tableData: [],
+ dialogVisible0: false,
+ dialogVisible1: false,
+ form0: {
+ measurementParameter: '', // 璁¢噺鍙傛暟
+ rangeOfMeasurement: '',
+ maxPermissibleError: '',
+ judgmentCriteria: '',
+ createdBy: '',
+ action: '',
+ deviceId: null
+ },
+ form0Rules: {
+ measurementParameter: [
+ { required: true, message: '璇疯緭鍏ヨ閲忓弬鏁�', trigger: 'blur' }
+ ],
+ rangeOfMeasurement: [
+ { required: true, message: '璇疯緭鍏ラ噺绋嬭寖鍥�', trigger: 'blur' }
+ ],
+ maxPermissibleError: [
+ { required: true, message: '璇疯緭鍏ユ渶澶у厑璁歌宸�', trigger: 'blur' }
+ ],
+ judgmentCriteria: [
+ { required: true, message: '璇疯緭鍏ュ垽瀹氭爣鍑�', trigger: 'blur' }
+ ],
+ },
+ addRecordLoading: false,
+ upLoading: false,
+ operationType: '',
+ search: {
+ size: 20,
+ current: 1,
+ total: 0
+ },
+ }
+ },
+ // 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭�
+ computed: {
+ ...mapGetters(["nickName"]),
+ action() {
+ return this.javaApi + '/personBasicInfo/saveDeviceCalibrationFile'
+ }
+ },
+ mounted() {
+ //鑾峰彇鎿嶄綔璁板綍淇℃伅
+ this.getTableList(this.clickNodeVal.value) // 鑾峰彇璁惧鏍″噯鍒楄〃鏁版嵁
+ },
+ methods: {
+ preview(row) {
+ let list = row.fileUrl.split('.')
+ let suffix = list[list.length - 1]
+ if(suffix.toLowerCase().includes("pdf")) {
+ let link = document.createElement('a')
+ let url = this.javaApi + 'word' + row.fileUrl
+ console.log(url);
+ link.href = url
+ link.target= '_blank'
+ document.body.appendChild(link)
+ link.click()
+ document.body.removeChild(link)
+ }else{
+ let url = ''
+ if(suffix.toLowerCase().includes('docx')) {
+ url = this.javaApi + 'word' + row.fileUrl
+ }else if(suffix.toLowerCase().includes('xls')) {
+ url = this.javaApi + 'excel' + row.fileUrl
+ }else{
+ url = this.javaApi + 'img' + row.fileUrl
+ }
+ this.previewFile = url
+ this.$nextTick(() => {
+ this.lookDialogVisible = true
+ })
+ }
+ },
+ download(row) {
+ downLoadDeviceCalibrationFile({id: row.id}).then(res => {
+ const blob = new Blob([res],{type: row.mime})
+ this.$download.saveAs(blob, row.fileName)
+ })
+ },
+ delFile(row) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ枃浠�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ delDeviceCalibrationFile({id: row.id}).then(res => {
+ this.$message({
+ type: 'success',
+ message: '鍒犻櫎鎴愬姛!'
+ });
+ this.getFileData(this.recordId);
+ })
+ })
+ },
+ handleAttachmentClick(row) {
+ // 妯℃嫙涓嬭浇闄勪欢
+ // const imageUrl = this.javaApi + '/img/' + row.systemFileName; // 鍥剧墖 URL
+ // file.downloadIamge(imageUrl,row.fileName)
+ this.recordId = row.id
+ this.dialogVisibleFile = true
+ this.getFileData(row.id)
+ },
+ getFileData(id) {
+ getDeviceCalibrationFile({id: id}).then(res =>{
+ this.fileData = res.data
+ })
+ },
+ //鐘舵�佸垽瀹�
+ checkRadio() {
+ let resultList = this.calibrateParams.map(ele => ele.result)
+ if (resultList && resultList.filter(ele => ele == '1no').length > 0) {
+ this.calibrationRecord.status = '1no'
+ } else if (resultList && resultList.filter(ele => ele == '2other').length == resultList.length) {
+ this.calibrationRecord.status = '2other'
+ } else if (resultList && resultList.filter(ele => ele == '0yes').length == resultList.length) {
+ this.calibrationRecord.status = '0yes'
+ }
+ },
+ getNextCalibrationDate(val) {
+ let oneYearLaterDate = new Date(val)
+ oneYearLaterDate.setFullYear(oneYearLaterDate.getFullYear() + 1);
+ oneYearLaterDate.setDate(oneYearLaterDate.getDate() - 1);
+ // let obj = oneYearLaterDate.toISOString().split('T')[0];
+ this.calibrationRecord.nextCalibrationDate = oneYearLaterDate
+ },
+ handleSizeChange(val) {
+ this.search.size = val
+ this.getTableList(this.clickNodeVal.value);
+ },
+ handleCurrentChange(val) {
+ this.search.current = val
+ this.getTableList(this.clickNodeVal.value);
+ },
+ getTableList(deviceId) {
+ deviceMetricRecordPage({ deviceId, type: 'calibrate', ...this.search }).then(res => {
+ this.tableData = res.data.records
+ this.search.total = res.data.total
+ })
+ },
+ // 娣诲姞鏍告煡璁板綍
+ add(type) {
+ this.operationType = type
+ this.dialogVisible1 = true
+ this.getXmsg()
+ },
+ // 鏌ョ湅缂栬緫璇︽儏
+ handleViewClick(type, row) {
+ showDeviceMetricsCopy({ id: row.id, type: 'calibrate' }).then(res => {
+ this.calibrateParams = res.data
+ })
+ this.calibrationRecord = { ...row }
+ this.operationType = type
+ this.dialogVisible1 = true
+ },
+ // 琛ㄦ牸鍒犻櫎鎿嶄綔
+ handleDeleteClick(row) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deleteDeviceMetricRecord({ id: row.id }).then(res => {
+ this.getTableList(this.clickNodeVal.value) // 鑾峰彇璁惧鏍″噯鍒楄〃鏁版嵁
+ this.$message.success('鍒犻櫎鎴愬姛锛�')
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ })
+ },
+ //瀵煎嚭
+ handleDown() {
+ this.outLoading = true
+ deviceMetricRecordExport({
+ deviceId: this.clickNodeVal.value,
+ type: 'calibrate'
+ }).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/octet-stream' });
+ this.$download.saveAs(blob, '璁惧鏍″噯.xlsx')
+ })
+ },
+ // 鏍″噯椤圭洰缁存姢
+ calibrationMaintenance() {
+ this.dialogVisible0 = true
+ this.getXmsg();
+ },
+ // 鑾峰彇璁惧鏍″噯鍙傛暟table淇℃伅
+ async getXmsg() {
+ this.calibrateParamsLoading = true
+ try {
+ await selectDeviceMetric({ deviceId: this.clickNodeVal.value, type: 'calibrate' }).then(res => {
+ if (res.code == 200) {
+ this.calibrateParams = res.data
+ }
+ this.calibrateParamsLoading = false
+ })
+ } catch (e) {
+ console.log('getXmsg---', e)
+ this.calibrateParamsLoading = false
+ }
+ },
+ // 鏍″噯椤圭洰缁存姢-鍒犻櫎璁惧鏍″噯鍙傛暟
+ handleDelete(row) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deleteDeviceMetrics({ id: row.id }).then(res => {
+ if (res.code === 200) {
+ this.$message.success('鍒犻櫎鎴愬姛!');
+ this.getXmsg();
+ }
+ })
+ }).catch(() => {
+ this.$message.info('宸插彇娑堝垹闄�');
+ })
+ },
+ // 鎻愪氦椤圭洰鏍″噯缁存姢
+ addCalibrate() {
+ this.$refs['form0'].validate((valid) => {
+ if (valid) {
+ // 淇濆瓨
+ this.calibrateParamsLoading = true
+ this.addCalibrateLoading = true
+ this.form0.deviceId = this.clickNodeVal.value;
+ this.form0.createdBy = this.nickName;
+ this.form0.type = 'calibrate'
+ saveOrUpdateDeviceMetric(this.form0).then(res => {
+ if (res.code == 200) {
+ this.$message.success('淇濆瓨鎴愬姛')
+ this.$refs['form0'].resetFields()
+ this.getXmsg() // 鍒锋柊璁惧鏍″噯鍙傛暟琛ㄦ牸
+ }
+ this.calibrateParamsLoading = false
+ this.addCalibrateLoading = false
+ }).catch(() => {
+ this.addCalibrateLoading = false
+ })
+ } else {
+ this.addCalibrateLoading = false
+ this.$message.warning('鏈夊繀濉」鏈~');
+ }
+ })
+ },
+ // 鎻愪氦鏍″噯璁板綍
+ addRecord() {
+ this.$refs['calibrationRecord'].validate((valid) => {
+ if (valid) {
+ try {
+ if (this.calibrateParams.some(m => m.isCalibration === undefined)) {
+ this.$message.error('璇烽�夋嫨鏄惁鏍″噯')
+ return
+ }
+ if (!this.calibrateParams.every(m => m.result !== undefined)) {
+ this.$message.error('璇烽�夋嫨鍒ゅ畾缁撴灉')
+ return
+ }
+ this.addRecordLoading = true
+ this.calibrationRecord.deviceId = this.clickNodeVal.value;
+ this.calibrationRecord.createUser = this.nickName
+ this.calibrationRecord.type = 'calibrate'
+ this.calibrationRecord.deviceMetricsCopyList = this.calibrateParams
+ this.calibrationRecord.deviceMetricsCopyList.forEach(m => {
+ delete m.creationTime
+ })
+ delete this.calibrationRecord.createTime
+ addOrUpdateDeviceMetricRecord(this.calibrationRecord).then(res => {
+ if (res.code == 200) {
+ this.$message.success('娣诲姞鎴愬姛')
+ this.dialogVisible1 = false
+ this.getTableList(this.clickNodeVal.value)
+ }
+ this.addRecordLoading = false
+ }).catch((err) => {
+ this.addRecordLoading = false
+ })
+ } catch (e) {
+ console.log('addRecord---', e)
+ this.addRecordLoading = false
+ }
+ } else {
+ this.$message.warning('鏈夊繀濉」鏈~');
+ }
+ })
+ },
+ resetCalibrationRecord() {
+ this.$refs.calibrationRecord.resetFields()
+ },
+ // 涓婁紶闄勪欢
+ handleSuccessUp(response, file) {
+ if (response.code == 200) {
+ // 鍦ㄤ繚瀛樿祴鍊兼柊鏂囦欢
+ this.calibrationRecord.fileName = file.name
+ this.calibrationRecord.systemFileName = response.data
+ this.upLoading = false;
+ } else {
+ this.upLoading = false;
+ this.$message.error(response.message)
+ }
+ },
+ beforeUpload(file) {
+ let list = file.name.split('.')
+ let suffix = list[list.length - 1]
+
+ console.log(suffix);
+ if (file.size > 1024 * 1024 * 10) {
+ this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M');
+ this.$refs.upload.clearFiles()
+ return false;
+ } else {
+ this.upLoading = true;
+ this.$set(this.uploadData,'id',this.recordId)
+ this.$set(this.uploadData,'suffix',suffix)
+ return true;
+ }
+ },
+ onSuccess(response,file,fileList) {
+ if(response.code == 200) {
+ this.$message.success("涓婁紶鎴愬姛")
+ this.upLoading = false
+ this.$refs.upload.clearFiles()
+ this.getFileData(this.recordId)
+ } else {
+ this.$message.error(response.msg)
+ }
+ },
+ onError(err, file, fileList) {
+ this.$message.error('涓婁紶澶辫触')
+ this.$refs.upload.clearFiles()
+ },
+ // end
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ clickNodeVal(newVal) {
+ if (newVal.value) {
+ this.getTableList(newVal.value);
+ }
+ },
+ dialogVisible1(newVal) {
+ if (newVal === false) {
+ this.calibrateParams = []
+ this.calibrationRecord = {
+ unitOfMeasure: '', // 璁¢噺鍗曚綅
+ calibrationDate: null, // 鏍″噯鏃ユ湡
+ nextCalibrationDate: null, // 涓嬫鏍″噯鏃ユ湡
+ calculatingApparatus: '', // 璁$畻鍣ㄥ叿
+ standardRange: '', // 璁$畻鏍囧噯閲忕▼
+ calibrationStandardUncertainty: '', // 璁¢噺鏍囧噯涓嶇‘瀹氬害
+ byDocument: '', // 渚濇嵁鏂囦欢
+ certificateSerialNumber: '', // 璇佷功缂栧彿
+ status: '', // 鐘舵��
+ remark: '', // 澶囨敞
+ }
+ }
+ }
+ }
+}
+
+</script>
+<style scoped>
+.tables {
+ width: 100%;
+ height: calc(100vh - 230px);
+}
+
+.search {
+ background-color: #fff;
+ height: 40px;
+ display: flex;
+ align-items: center;
+ position: relative;
+}
+
+.search_thing {
+ display: flex;
+ align-items: center;
+ height: 40px;
+}
+
+.search_label {
+ width: 70px;
+ font-size: 14px;
+ text-align: right;
+ margin-right: 10px;
+}
+
+.search_input {
+ width: calc(100% - 110px);
+}
+
+.btnS {
+ text-align: right;
+ margin-top: 10px;
+}
+
+h4 {
+ font-weight: 400;
+ font-size: 16px;
+ display: flex;
+ justify-content: space-between;
+ margin: 10px 0;
+}
+
+h4 .line {
+ display: inline-block;
+ width: 3px;
+ height: 16px;
+ background: #3A7BFA;
+ margin-right: 4px;
+}
+
+.check {
+ background-color: #fff;
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-between;
+}
+
+.check_thing {
+ flex: 0 0 calc(20% - 10px);
+ margin-bottom: 20px;
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+}
+
+.check_label {
+ font-size: 14px;
+ margin-bottom: 5px;
+}
+
+.check_data .check_input {
+ width: 100%;
+}
+
+.el-table {
+ font-size: 14px;
+ color: #333;
+}
+
+.el-table thead {
+ background-color: #f5f5f5;
+}
+</style>
diff --git a/src/views/CNAS/resourceDemand/device/component/check-and-accept.vue b/src/views/CNAS/resourceDemand/device/component/check-and-accept.vue
new file mode 100644
index 0000000..26680b7
--- /dev/null
+++ b/src/views/CNAS/resourceDemand/device/component/check-and-accept.vue
@@ -0,0 +1,934 @@
+<!-- 璁惧楠屾敹 -->
+<template>
+ <div>
+ <div class="search">
+ <div class="search_thing">
+ <div class="search_label">娴佺▼缂栧彿锛�</div>
+ <div class="search_input"><el-input v-model="search.processNumber" clearable placeholder="璇疯緭鍏�" size="small"
+ @keyup.enter.native="getDeviceAList(clickNodeVal.value)"></el-input></div>
+ </div>
+ <div class="search_thing" style="padding-left: 30px;">
+ <el-button size="small" @click="resetSearch">閲� 缃�</el-button>
+ <el-button size="small" type="primary" @click="getDeviceAList(clickNodeVal.value)">鏌� 璇�</el-button>
+ </div>
+ <div class="btns">
+ <el-button size="small" type="primary" @click="dialogVisible = true">娣诲姞楠屾敹</el-button>
+ <el-button :loading="outLoading" size="small" type="primary" @click="handleDown">瀵煎嚭</el-button>
+ </div>
+ </div>
+ <div class="tables" style="margin-top: 10px;">
+ <el-table ref="table" :data="tableDataAlist" height="100%" v-loading="tableLoading">
+ <el-table-column label="搴忓彿" type="index" width="60">
+ <template v-slot="scope">
+ <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="娴佺▼缂栧彿" min-width="150" prop="processNumber" show-overflow-tooltip/>
+ <el-table-column label="璁惧鍚嶇О" min-width="140" prop="deviceName" show-overflow-tooltip/>
+ <el-table-column label="绠$悊缂栧彿" min-width="140" prop="managementNumber" show-overflow-tooltip/>
+ <el-table-column label="搴忓垪鍙�" min-width="80" prop="serialNumber" />
+ <el-table-column label="鎻愪氦鑰�" min-width="100" prop="submitUser" />
+ <el-table-column label="鎻愪氦鏃ユ湡" min-width="150" prop="createTime" />
+ <el-table-column label="褰撳墠鐘舵��" min-width="140" prop="currentState" />
+ <el-table-column label="褰撳墠璐熻矗浜�" min-width="120" prop="currentResponsible" />
+ <el-table-column fixed="right" label="鎿嶄綔" min-width="140">
+ <template #default="{ row }">
+ <el-button size="small" type="text" @click="handleAttachmentClick(row)">闄勪欢</el-button>
+ <el-button size="small" type="text" @click="handleViewClick(row)">鏌ョ湅</el-button>
+ <el-button size="small" type="text" @click="handleDeleteClick(row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]"
+ :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
+ @current-change="handleCurrentChange">
+ </el-pagination>
+ </div>
+ <!-- 娣诲姞璁惧鏁呴殰璁板綍 -->
+ <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="dialogVisible" title="浠櫒璁惧楠屾敹璁板綍"
+ width="60%" @open="openRecordAcceptance">
+ <el-steps :active="currentStep" finish-status="success">
+ <el-step v-for="(v, i) in steps" :key="i" :title="v" style="cursor:pointer"
+ @click.native="choiceStep(i)"></el-step>
+ </el-steps>
+ <el-form ref="form" :model="form" :rules="rules" label-width="130px">
+ <div v-show="currentStepClick === 0">
+ <el-card style="margin-top: 1em; height: 56vh; overflow-y: scroll;">
+ <!-- 鏂板璁惧浜嬭褰曞崱鐗� -->
+ <el-row>
+ <el-col :span="24">
+ <el-form-item label="娴佺▼缂栧彿锛�" prop="processNumber">
+ <el-input v-model="form.processNumber" disabled size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璁惧鍚嶇О锛�">
+ <el-input v-model="form.deviceName" disabled size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鐢熶骇鍘傚锛�">
+ <el-input v-model="form.manufacturer" disabled size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璁惧鍨嬪彿锛�">
+ <el-input v-model="form.specificationModel" disabled size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="绠$悊缂栧彿锛�">
+ <el-input v-model="form.managementNumber" disabled size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :rules="[{ required: currentStep === 0, message: '璇疯緭鍏ュ簭鍒楀彿', trigger: 'blur' }]" label="搴忓垪鍙凤細"
+ prop="serialNumber">
+ <el-input v-model="form.serialNumber" :disabled="currentStep !== 0" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :rules="[{ required: currentStep === 0, message: '璇疯緭鍏ヨ澶囩被鍒�', trigger: 'change' }]" label="璁惧绫诲埆锛�"
+ prop="deviceClass">
+ <el-radio-group v-model="form.deviceClass" :disabled="currentStep !== 0">
+ <el-radio label="0precision">绮惧瘑鍨嬭澶�</el-radio>
+ <el-radio label="1conventional">甯歌璁惧</el-radio><br />
+ <el-radio label="2auxiliary_class">杈呭姪绫昏澶�</el-radio>
+ <el-radio label="4environmental">鐜绫昏澶�</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item :rules="[{ required: currentStep === 0, message: '璇疯緭鍏ュ紑绠卞墠妫�鏌ュ鍖呰鏈夋棤鐮存崯', trigger: 'blur' }]" label="寮�绠卞墠妫�鏌ュ鍖呰鏈夋棤鐮存崯锛�" label-width="220px"
+ prop="checkOuterPackaging">
+ <el-input v-model="form.checkOuterPackaging" :disabled="currentStep !== 0" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="鐩稿叧闄勪欢锛�" prop="fileName">
+ <el-input v-model="form.fileName" :style="`width: ${currentStep == 0 ? '88%' : '100%'};`" disabled
+ size="small">
+ <el-button v-if="currentStep === 0" slot="append" icon="el-icon-delete-solid"
+ @click="deleteFile"></el-button>
+ </el-input>
+ <el-upload ref="upload" :action="action" :on-success="onSuccess" :show-file-list="false"
+ style="float: right;">
+ <el-button v-if="currentStep === 0" slot="trigger" class="uploadFile" size="small"
+ style="position: relative;top: -4px" type="primary">闄勪欢涓婁紶</el-button>
+ </el-upload>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item :rules="[{ required: currentStep === 0, message: '璇烽�夋嫨涓嬬幆鑺傝矗浠讳汉', trigger: 'change' }]" label="涓嬬幆鑺傝矗浠讳汉锛�"
+ prop="submitNextPesponsible">
+ <el-select v-model="form.submitNextPesponsible" :disabled="currentStep !== 0" clearable filterable
+ placeholder="璇烽�夋嫨涓嬬幆鑺傝礋璐d汉" size="small" style="width: 50%;">
+ <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :rules="[{ required: currentStep === 0, message: '璇疯緭鍏ヨ澶囧紑绠遍獙鏀剁粨璁�', trigger: 'change' }]" label="璁惧寮�绠遍獙鏀剁粨璁猴細" label-width="150px"
+ prop="unpackingAcceptanceConclusion">
+ <el-radio-group v-model="form.unpackingAcceptanceConclusion" :disabled="currentStep !== 0">
+ <el-radio :label="'0qualified'">鍚堟牸</el-radio>
+ <el-radio :label="'1unqualified'">涓嶅悎鏍硷紝缂哄皯澶囦欢渚涘簲鍟嗚ˉ鍙�</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <div style="margin-bottom: 20px; width: 100%;">
+ <label>澶囦欢纭锛�</label>
+ <el-button v-if="currentStep === 0" size="small" style="float: right;"
+ type="primary" @click="addTableRow('sparePartsConfirmationList')">澧炲姞琛�</el-button>
+ </div>
+ <el-table :data="form.sparePartsConfirmationList" border stripe style="width: 100%; min-height: 30vh">
+ <el-table-column label="搴忓彿" prop="搴忓彿" type="index" width="80" />
+ <el-table-column label="鍚嶇О" min-width="120" prop="name">
+ <template v-slot="scope">
+ <el-input v-if="currentStep === 0" v-model="scope.row.name" size="small"></el-input>
+ <label v-else>{{ scope.row.name }}</label>
+ </template>
+ </el-table-column>
+ <el-table-column label="鏁伴噺" min-width="120" prop="number">
+ <template v-slot="scope">
+ <el-input v-if="currentStep === 0" v-model="scope.row.number" size="small"></el-input>
+ <label v-else>{{ scope.row.number }}</label>
+ </template>
+ </el-table-column>
+ <el-table-column label="澶囨敞" min-width="120" prop="note">
+ <template v-slot="scope">
+ <el-input v-if="currentStep === 0" v-model="scope.row.note" size="small"></el-input>
+ <label v-else>{{ scope.row.note }}</label>
+ </template>
+ </el-table-column>
+ <el-table-column v-if="currentStep === 0" fixed="right" label="鎿嶄綔" width="90">
+ <template slot-scope="scope">
+ <el-button icon="el-icon-delete" type="text"
+ @click="deleteRow(scope.$index, scope.row, 'sparePartsConfirmationList')">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-col>
+ <el-col :span="24">
+ <div style="margin: 20px 0; width: 100%;">
+ <label>鏂囦欢绫荤‘璁わ細</label>
+ <el-button v-if="currentStep === 0" size="small" style="float: right;"
+ type="primary" @click="addTableRow('fileClassConfirmationList')">澧炲姞琛�</el-button>
+ </div>
+ <el-table :data="form.fileClassConfirmationList" border stripe style="width: 100%; min-height: 30vh">
+ <el-table-column label="搴忓彿" prop="搴忓彿" type="index" width="80" />
+ <el-table-column label="搴旀湁鍐屾暟" min-width="120" prop="expectedCopies">
+ <template v-slot="scope">
+ <el-input v-if="currentStep === 0" v-model="scope.row.expectedCopies" size="small"></el-input>
+ <label v-else>{{ scope.row.expectedCopies }}</label>
+ </template>
+ </el-table-column>
+ <el-table-column label="瀹為檯鏀跺埌鍐屾暟" min-width="120" prop="actualCopies">
+ <template v-slot="scope">
+ <el-input v-if="currentStep === 0" v-model="scope.row.actualCopies" size="small"></el-input>
+ <label v-else>{{ scope.row.actualCopies }}</label>
+ </template>
+ </el-table-column>
+ <el-table-column v-if="currentStep === 0" fixed="right" label="鎿嶄綔" width="90">
+ <template v-slot="scope">
+ <el-button icon="el-icon-delete" type="text"
+ @click="deleteRow(scope.$index, scope.row, 'fileClassConfirmationList')">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-col>
+ <el-col :span="24" style="margin-top: 10px;">
+ <el-form-item label="澶囨敞锛�" label-width="90px">
+ <el-input v-model="form.submitRemarks" :disabled="currentStep !== 0" size="small"
+ type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-card>
+ <el-row style="margin-top: 1em;">
+ <el-col :span="4">
+ 鎿嶄綔浜猴細{{ form.submitOperatingPersonnel }}
+ </el-col>
+ <el-col :span="6">
+ 鏃ユ湡锛歿{ form.submitDate }}
+ </el-col>
+ </el-row>
+ </div>
+ <div v-show="currentStepClick === 1">
+ <el-card style="margin-top: 1em; height: 56vh; overflow-y: scroll;">
+ <el-row>
+ <el-col :span="24">
+ <el-form-item label="澶嶆牳鎰忚锛�" prop="accidentDescription">
+ <el-input v-model="form.unpackingReviewOpinion" :disabled="currentStep !== 1" size="small"
+ type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item :rules="[{ required: currentStep === 1, message: '璇疯緭鍏ヤ笅鐜妭璐d换浜�', trigger: 'change' }]" label="涓嬬幆鑺傝矗浠讳汉锛�"
+ prop="unpackingNextPesponsible">
+ <el-select v-model="form.unpackingNextPesponsible" :disabled="currentStep !== 1" clearable filterable
+ placeholder="璇烽�夋嫨涓嬬幆鑺傝礋璐d汉" size="small" style="width: 50%;">
+ <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-card>
+ <el-row style="margin-top: 1em;">
+ <el-col :span="4">
+ 鎿嶄綔浜猴細{{ form.unpackingOperatingPersonnel }}
+ </el-col>
+ <el-col :span="6">
+ 鏃ユ湡锛歿{ form.unpackingDate }}
+ </el-col>
+ </el-row>
+ </div>
+ <div v-show="currentStepClick === 2">
+ <el-card style="margin-top: 1em; height: 56vh; overflow-y: scroll;">
+ <el-row>
+ <el-col :span="24">
+ <el-form-item :rules="[{ required: currentStep === 2, message: '璇疯緭鍏ュ畨瑁呬綅缃�', trigger: 'blur' }]" label="瀹夎浣嶇疆锛�"
+ prop="installLocation">
+ <el-input v-model="form.installLocation" :disabled="currentStep !== 2" clearable placeholder="璇疯緭鍏ュ畨瑁呬綅缃�"
+ size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="澶囨敞锛�">
+ <el-input v-model="form.installRemarks" :disabled="currentStep !== 2" size="small"
+ type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item :rules="[{ required: currentStep === 2, message: '璇疯緭鍏ヤ笅鐜妭璐d换浜�', trigger: 'blur' }]" label="涓嬬幆鑺傝矗浠讳汉锛�"
+ prop="installNextPesponsible">
+ <el-select v-model="form.installNextPesponsible" :disabled="currentStep !== 2" clearable filterable
+ placeholder="璇烽�夋嫨涓嬬幆鑺傝礋璐d汉" size="small" style="width: 50%;">
+ <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <div style="margin-bottom: 20px; width: 100%;">
+ <label>瀹夎楠屾敹璁板綍</label>
+ <el-button v-if="currentStep === 2" size="small" style="float: right;"
+ type="primary" @click="addTableRow('installationAcceptanceRecordList')">澧炲姞琛�</el-button>
+ </div>
+ <el-table :data="form.installationAcceptanceRecordList" border stripe
+ style="width: 100%; min-height: 30vh">
+ <el-table-column label="搴忓彿" prop="搴忓彿" type="index" width="80" />
+ <el-table-column label="椤圭洰" min-width="120" prop="installationProject">
+ <template v-slot="scope">
+ <el-input v-if="currentStep === 2" v-model="scope.row.installationProject"
+ size="small"></el-input>
+ <label v-else>{{ scope.row.installationProject }}</label>
+ </template>
+ </el-table-column>
+ <el-table-column label="瀹夎鎯呭喌" min-width="120" prop="installationSituation">
+ <template v-slot="scope">
+ <el-input v-if="currentStep === 2" v-model="scope.row.installationSituation"
+ size="small"></el-input>
+ <label v-else>{{ scope.row.installationSituation }}</label>
+ </template>
+ </el-table-column>
+ <el-table-column label="瀹夎瀹屾垚" min-width="120" prop="installationCompleted">
+ <template v-slot="scope">
+ <el-select v-if="currentStep === 2" v-model="scope.row.installationCompleted" placeholder="璇烽�夋嫨">
+ <el-option label="鏄�" value="0yes"></el-option>
+ <el-option label="鍚�" value="1no"></el-option>
+ </el-select>
+ <label v-else>{{ scope.row.installationCompleted === '0yes' ? '鏄�' :
+ scope.row.installationCompleted === '1no' ? '鍚�' : '' }}</label>
+ </template>
+ </el-table-column>
+ <el-table-column v-if="currentStep === 2" fixed="right" label="鎿嶄綔" width="90">
+ <template slot-scope="scope">
+ <el-button icon="el-icon-delete" type="text"
+ @click="deleteRow(scope.$index, scope.row, 'installationAcceptanceRecordList')">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-col>
+ </el-row>
+ </el-card>
+ <el-row style="margin-top: 1em;">
+ <el-col :span="4">
+ 鎿嶄綔浜猴細{{ form.installOperatingPersonnel }}
+ </el-col>
+ <el-col :span="6">
+ 鏃ユ湡锛歿{ form.installDate }}
+ </el-col>
+ </el-row>
+ </div>
+ <div v-show="currentStepClick === 3">
+ <el-card style="margin-top: 1em; height: 56vh; overflow-y: scroll;">
+ <el-row>
+ <el-col :span="24">
+ <el-form-item :rules="[{ required: currentStep === 3, message: '璇疯緭鍏ュ鍚堟剰瑙�', trigger: 'blur' }]" label="澶嶅悎鎰忚锛�"
+ prop="installationAcceptanceCompoundOpinion">
+ <el-input v-model="form.installationAcceptanceCompoundOpinion" :disabled="currentStep !== 3"
+ size="small" type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item :rules="[{ required: currentStep === 3, message: '璇疯緭鍏ヤ笅鐜妭璐熻矗浜�', trigger: 'change' }]" label="涓嬬幆鑺傝矗浠讳汉锛�"
+ prop="installationAcceptanceNextPesponsible">
+ <el-select v-model="form.installationAcceptanceNextPesponsible" :disabled="currentStep !== 3" clearable
+ filterable placeholder="璇烽�夋嫨涓嬬幆鑺傝礋璐d汉" size="small" style="width: 50%;">
+ <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-card>
+ <el-row style="margin-top: 1em;">
+ <el-col :span="4">
+ 鎿嶄綔浜猴細{{ form.installationAcceptanceOperatingPersonnel }}
+ </el-col>
+ <el-col :span="6">
+ 鏃ユ湡锛歿{ form.installationAcceptanceDate }}
+ </el-col>
+ </el-row>
+ </div>
+ <div v-show="currentStepClick === 4">
+ <el-card style="margin-top: 1em; height: 56vh; overflow-y: scroll;">
+ <div style="margin-bottom: 20px; width: 100%;">
+ <label>楠屾敹鏍告煡璁板綍锛�</label>
+ <el-button v-if="currentStep === 4" size="small" style="float: right;"
+ type="primary" @click="addTableRow('acceptanceCheckRecordList')">澧炲姞琛�</el-button>
+ </div>
+ <el-table :data="form.acceptanceCheckRecordList" border style="width: 100%; min-height: 30vh">
+ <el-table-column label="搴忓彿" prop="sequence" width="80">
+ </el-table-column>
+ <el-table-column label="浠櫒妯″潡" min-width="120" prop="instrumentModule">
+ <template v-slot="scope">
+ <el-input v-if="currentStep === 4" v-model="scope.row.instrumentModule" size="small"></el-input>
+ <label v-else>{{ scope.row.instrumentModule }}</label>
+ </template>
+ </el-table-column>
+ <el-table-column label="鏍告煡鍙傛暟" min-width="120" prop="verificationParameter">
+ <template v-slot="scope">
+ <el-input v-if="currentStep === 4" v-model="scope.row.verificationParameter" size="small"></el-input>
+ <label v-else>{{ scope.row.verificationParameter }}</label>
+ </template>
+ </el-table-column>
+ <el-table-column label="鍙帴鏀堕檺" min-width="120" prop="acceptableLimit">
+ <template v-slot="scope">
+ <el-input v-if="currentStep === 4" v-model="scope.row.acceptableLimit" size="small"></el-input>
+ <label v-else>{{ scope.row.acceptableLimit }}</label>
+ </template>
+ </el-table-column>
+ <el-table-column label="鏍告煡缁撴灉" min-width="120" prop="verificationResult">
+ <template v-slot="scope">
+ <el-input v-if="currentStep === 4" v-model="scope.row.verificationResult" size="small"></el-input>
+ <label v-else>{{ scope.row.verificationResult }}</label>
+ </template>
+ </el-table-column>
+ <el-table-column label="鏍告煡缁撹" min-width="120" prop="verificationConclusion">
+ <template v-slot="scope">
+ <el-select v-if="currentStep === 4" v-model="scope.row.verificationConclusion" placeholder="璇烽�夋嫨">
+ <el-option label="绗﹀悎" value="0accordWith"></el-option>
+ <el-option label="涓嶇鍚�" value="1inconformity"></el-option>
+ </el-select>
+ <label v-else>{{ scope.row.verificationConclusion }}</label>
+ </template>
+ </el-table-column>
+ <el-table-column v-if="currentStep === 4" fixed="right" label="鎿嶄綔" width="90">
+ <template slot-scope="scope">
+ <el-button size="small" type="text"
+ @click="deleteRow(scope.$index, scope.row, 'acceptanceCheckRecordList')">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-form-item :rules="[{ required: currentStep === 4, message: '璇疯緭鍏ヨ澶囧紑绠遍獙鏀剁粨璁�', trigger: 'change' }]" label="璁惧寮�绠遍獙鏀剁粨璁猴細"
+ label-width="150px" prop="acceptanceCheckUnpackingConclusion">
+ <el-radio-group v-model="form.acceptanceCheckUnpackingConclusion" :disabled="currentStep !== 4">
+ <el-radio :label="'0qualified'">鍚堟牸</el-radio>
+ <el-radio :label="'1unqualified'">涓嶅悎鏍硷紝缂哄皯澶囦欢渚涘簲鍟嗚ˉ鍙�</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ <el-form-item :rules="[{ required: currentStep === 4, message: '璇疯緭鍏ヤ笅鐜妭璐d换浜�', trigger: 'change' }]" label="涓嬬幆鑺傝矗浠讳汉锛�"
+ prop="acceptanceCheckNextPesponsible">
+ <el-select v-model="form.acceptanceCheckNextPesponsible" :disabled="currentStep !== 4" clearable
+ filterable placeholder="璇烽�夋嫨涓嬬幆鑺傝礋璐d汉" size="small" style="width: 50%;">
+ <el-option v-for="item in responsibleOptions" :key="item.value" :label="item.label" :value="item.name">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-card>
+ <el-row style="margin-top: 1em;">
+ <el-col :span="4">
+ 鎿嶄綔浜猴細{{ form.acceptanceCheckOperatingPersonnel }}
+ </el-col>
+ <el-col :span="6">
+ 鏃ユ湡锛歿{ form.acceptanceCheckDate }}
+ </el-col>
+ </el-row>
+ </div>
+ <div v-show="currentStepClick === 5">
+ <el-card style="margin-top: 1em; height: 56vh; overflow-y: scroll;">
+ <el-row>
+ <el-col :span="24">
+ <el-form-item :rules="[{ required: currentStep === 5, message: '璇疯緭鍏ュ鏍告剰瑙�', trigger: 'blur' }]" label="瀹℃牳鎰忚锛�"
+ prop="acceptanceAuditAuditOpinion">
+ <el-input v-model="form.acceptanceAuditAuditOpinion" :disabled="currentStep !== 5" size="small"
+ type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-card>
+ <el-row style="margin-top: 1em;">
+ <el-col :span="4">
+ 鎿嶄綔浜猴細{{ form.acceptanceAuditOperatingPersonnel }}
+ </el-col>
+ <el-col :span="6">
+ 鏃ユ湡锛歿{ form.acceptanceAuditDate }}
+ </el-col>
+ </el-row>
+ </div>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button v-if="currentStep !== 0 && currentStep !== 6" @click="submitForm('3reject')">椹冲洖</el-button>
+ <el-button v-if="currentStep === 0" @click="submitForm('2save')">淇濆瓨</el-button>
+ <el-button v-if="currentStep !== 6" type="primary" @click="submitForm('1submit')">{{ currentStep === 0 ? '鎻愪氦' :
+ '閫氳繃'
+ }}</el-button>
+ </span>
+ </el-dialog>
+ </div>
+ <!-- 鏌ュ崟缂栬緫妗� -->
+</template>
+
+<script>
+import { dateFormat } from '@/utils/date'
+import file from "@/utils/file";
+import {
+ deleteCNASFile, deleteIncidentReport,
+ deleteIncidentReportAll, getShowIncidentReport, incidentReportExport, incidentReportPage,
+ saveIncidentReportData,
+ selectDeviceByCode
+} from "@/api/cnas/resourceDemand/device";
+import {selectUserCondition} from "@/api/system/user";
+import {mapGetters} from "vuex";
+
+export default {
+ props: {
+ clickNodeVal: {
+ type: Object,
+ default: () => {
+ return {};
+ }
+ }
+ },
+ data() {
+ return {
+ //浜嬫晠璁惧淇℃伅
+ tableDataAlist: [], // 鏇存敼鍙橀噺鍚嶇О
+ tableLoading: false,
+ dialogVisible: false,
+ rules: {
+ quantity: [{ required: true, message: '璇疯緭鍏ユ暟閲�', trigger: 'blur' }],
+ },
+ currentStep: 0, // 姝ラ鏉℃樉绀虹鍑犳
+ currentStepClick: 0, // 鐐瑰嚮姝ラ鏉″彉鍖�
+ steps: ['鎻愪氦', '寮�绠遍獙鏀跺鏍�', '瀹夎楠屾敹妫�鏌�', '瀹夎楠屾敹澶嶆牳', '楠屾敹鏍告煡', '楠屾敹鏍告煡瀹℃牳'],
+ form: {
+ sparePartsConfirmationList: [], // 澶囦欢纭List
+ fileClassConfirmationList: [], // 鏂囦欢纭List
+ installationAcceptanceRecordList: [], // 瀹夎楠屾敹璁板綍
+ acceptanceCheckRecordList: [], // 楠屾敹鏍告煡璁板綍
+ fileName: '', // 鏂囦欢鍚嶇О
+ systemFileName: '', // 绯荤粺鏂囦欢鍚嶇О
+ },
+ outLoading: false,
+ responsibleOptions: [], // 涓嬬幆鑺傝礋璐d汉list
+ isUpdate: false,
+ search: {
+ size: 20,
+ current: 1,
+ total: 0,
+ processNumber: '',
+ },
+ }
+ },
+ computed: {
+ action() {
+ return this.javaApi + '/personBasicInfo/saveCNASFile'
+ },
+ ...mapGetters(["nickName"]),
+ },
+ mounted() {
+ // 鑾峰彇璁惧浜嬫晠淇℃伅
+ this.getDeviceAList(this.clickNodeVal.value);
+ window.excelClosed = this.closed
+ },
+ methods: {
+ handleSizeChange(val) {
+ this.search.size = val
+ this.getDeviceAList(this.clickNodeVal.value);
+ },
+ handleCurrentChange(val) {
+ this.search.current = val
+ this.getDeviceAList(this.clickNodeVal.value);
+ },
+ deleteFile() {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ枃浠�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deleteCNASFile({fileName: this.form.systemFileName}).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鍒犻櫎鎴愬姛锛�')
+ }
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
+ },
+ onSuccess(response, file, fileList) {
+ if (response.code == 200) {
+ // 鍦ㄤ繚瀛樿祴鍊兼柊鏂囦欢
+ this.form.fileName = file.name
+ this.form.systemFileName = response.data
+ } else {
+ this.$message.error(response.message)
+ }
+ },
+ addTableRow(value) {
+ switch (value) {
+ // 澶囦欢纭
+ case 'sparePartsConfirmationList':
+ const obj = Object.assign({
+ name: '',
+ number: null,
+ note: ''
+ })
+ this.form.sparePartsConfirmationList.push(obj)
+ break
+ // 鏂囦欢纭List
+ case 'fileClassConfirmationList':
+ const obj1 = Object.assign({
+ expectedCopies: '',
+ actualCopies: '',
+ })
+ this.form.fileClassConfirmationList.push(obj1)
+ break
+ // 瀹夎楠屾敹璁板綍
+ case 'installationAcceptanceRecordList':
+ const obj2 = Object.assign({
+ installationProject: '',
+ installationSituation: '',
+ installationCompleted: ''
+ })
+ this.form.installationAcceptanceRecordList.push(obj2)
+ break
+ // 楠屾敹鏍告煡璁板綍
+ case 'acceptanceCheckRecordList':
+ const obj3 = Object.assign({
+ instrumentModule: '',
+ verificationParameter: '',
+ acceptableLimit: '',
+ verificationResult: '',
+ verificationConclusion: ''
+ })
+ this.form.acceptanceCheckRecordList.push(obj3)
+ default:
+ break
+ }
+ },
+ deleteRow(index, row, type) {
+ switch (type) {
+ // 澶囦欢纭
+ case 'sparePartsConfirmationList':
+ if (row.sparePartsId) {
+ deleteIncidentReportAll({sparePartsId: row.sparePartsId}).then(res => { });
+ }
+ this.form.sparePartsConfirmationList.splice(index, 1)
+ this.$message.success('鍒犻櫎鎴愬姛锛�')
+ break
+ // 鏂囦欢纭List
+ case 'fileClassConfirmationList':
+ if (row.fileId) {
+ deleteIncidentReportAll({fileId: row.fileId}).then(res => { });
+ }
+ this.form.fileClassConfirmationList.splice(index, 1)
+ this.$message.success('鍒犻櫎鎴愬姛锛�')
+ break
+ // 瀹夎楠屾敹璁板綍
+ case 'installationAcceptanceRecordList':
+ if (row.installId) {
+ deleteIncidentReportAll({installId: row.installId}).then(res => { });
+ }
+ this.form.installationAcceptanceRecordList.splice(index, 1)
+ this.$message.success('鍒犻櫎鎴愬姛锛�')
+ break
+ // 楠屾敹鏍告煡璁板綍
+ case 'acceptanceCheckRecordList':
+ if (row.acceptanceCheckId) {
+ deleteIncidentReportAll({acceptanceCheckId: row.acceptanceCheckId}).then(res => { });
+ }
+ this.form.acceptanceCheckRecordList.splice(index, 1)
+ this.$message.success('鍒犻櫎鎴愬姛锛�')
+ default:
+ break
+ }
+ },
+ choiceStep(index) {
+ this.currentStepClick = index
+ },
+ openRecordAcceptance() {
+ // 鑾峰彇璁惧鍩虹淇℃伅
+ selectDeviceByCode({id: this.clickNodeVal.value}).then(res => {
+ this.form.deviceName = res.data.deviceName
+ this.form.manufacturer = res.data.manufacturer
+ this.form.specificationModel = res.data.specificationModel
+ this.form.managementNumber = res.data.managementNumber
+ this.$nextTick(() => {
+ this.$refs['form'].clearValidate()
+ })
+ });
+ // 鑾峰彇璐熻矗浜轰俊鎭�
+ this.getUserList()
+ },
+ //鎻愪氦琛ㄥ崟
+ async submitForm(saveState) {
+ this.$refs.form.validate((valid) => {
+ if (valid === true || saveState !== '1submit') {
+ // 缁欏綋鍓嶇幆鑺傝缃垱寤轰汉涓庢椂闂�
+ const dateTime = dateFormat(new Date())
+ // 鑾峰彇褰撳墠鐜妭鎿嶄綔浜轰笌鏃ユ湡
+ switch (this.currentStep) {
+ case 0:
+ this.form.submitOperatingPersonnel = this.nickName
+ this.form.submitDate = dateTime
+ break
+ case 1:
+ this.form.unpackingOperatingPersonnel = this.nickName
+ this.form.unpackingDate = dateTime
+ break
+ case 2:
+ this.form.installOperatingPersonnel = this.nickName
+ this.form.installDate = dateTime
+ break
+ case 3:
+ this.form.installationAcceptanceOperatingPersonnel = this.nickName
+ this.form.installationAcceptanceDate = dateTime
+ break
+ case 4:
+ this.form.acceptanceCheckOperatingPersonnel = this.nickName
+ this.form.acceptanceCheckDate = dateTime
+ break
+ case 5:
+ this.form.acceptanceAuditOperatingPersonnel = this.nickName
+ this.form.acceptanceAuditDate = dateTime
+ break
+ default:
+ break
+ }
+ // 鑾峰彇褰撳墠鐜妭璐熻矗浜�
+ switch (saveState === '3reject' ? this.currentStep - 1 : this.currentStep) {
+ case 0:
+ this.form.currentResponsible = this.form.submitNextPesponsible
+ break
+ case 1:
+ this.form.currentResponsible = this.form.unpackingNextPesponsible
+ break
+ case 2:
+ this.form.currentResponsible = this.form.installNextPesponsible
+ break
+ case 3:
+ this.form.currentResponsible = this.form.installationAcceptanceNextPesponsible
+ break
+ case 4:
+ this.form.currentResponsible = this.form.acceptanceCheckNextPesponsible
+ break
+ default:
+ break
+ }
+ let currentStepAction;
+ // 璁剧疆璇ユ搷浣滃垽鏂槸鍚︿负鎻愪氦锛屼繚瀛橈紝椹冲洖锛岄�氳繃
+ switch (saveState) {
+ // 鎻愪氦锛岄�氳繃
+ case '1submit':
+ currentStepAction = this.currentStep + 1
+ break
+ // 淇濆瓨
+ case '2save':
+ currentStepAction = this.currentStep
+ break
+ // 椹冲洖
+ case '3reject':
+ currentStepAction = this.currentStep - 1
+ break
+ default:
+ break
+ }
+ // 鑾峰彇褰撳墠鐘舵��
+ this.form.currentState = currentStepAction === 6 ? '鍏抽棴' : this.steps[currentStepAction]
+ this.form.deviceId = this.clickNodeVal.value
+ saveIncidentReportData(this.form).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鎻愪氦鎴愬姛')
+ this.getDeviceAList(this.clickNodeVal.value);
+ this.dialogVisible = false
+ }
+ })
+ } else {
+ let step = this.steps[this.currentStep]
+ this.$message.warning(step + ' 娴佺▼涓湁蹇呭~椤规湭濉紒');
+ }
+ });
+ },
+ // 鑾峰彇璐熻矗浜轰俊鎭帴鍙�
+ getUserList() {
+ selectUserCondition().then(res => {
+ if (res.code == 200) {
+ this.responsibleOptions = res.data
+ }
+ })
+ },
+ resetSearch() {
+ this.search = {
+ size: 20,
+ current: 1,
+ total: 0,
+ processNumber: '',
+ }
+ this.getDeviceAList(this.clickNodeVal.value);
+ },
+ // 鑾峰彇璁惧浜嬫晠淇℃伅(鏍规嵁浠巚uex涓幏鍙栧埌鐨勮澶囧悕绉癷d杩涜鏁版嵁鏌ヨ)
+ getDeviceAList(deviceId) {
+ this.tableLoading = true
+ incidentReportPage({deviceId: deviceId, size:this.search.size, current:this.search.current, processNumber: this.search.processNumber}).then(res => {
+ this.tableLoading = false
+ if (res.code == 200) {
+ this.tableDataAlist = res.data.records
+ this.search.total = res.data.total
+ }
+ }).catch(err => {
+ this.tableLoading = false
+ })
+ },
+ //table 浜嬩欢澶勭悊寮�濮嬪
+ // 涓嬭浇闄勪欢
+ handleAttachmentClick(row) {
+ this.$download.saveAs(row.systemFileName, row.fileName)
+ },
+ handleViewClick(row) {
+ getShowIncidentReport({id: row.id}).then(res => {
+ this.form = { ...res.data }
+ // 濡傛灉绱㈠紩涓�6琛ㄧず鍏ㄩ儴閫氳繃
+ this.currentStep = this.steps.indexOf(this.form.currentState) === -1 ? 6 : this.steps.indexOf(this.form.currentState)
+ this.currentStepClick = this.currentStep === 6 ? 0 : this.currentStep
+ this.$nextTick(() => {
+ this.$refs['form'].clearValidate()
+ })
+ })
+ this.dialogVisible = true
+ },
+ handleDeleteClick(row) {
+ this.$confirm('姝ゆ搷浣滃皢鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deleteIncidentReport({id: row.id}).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鍒犻櫎鎴愬姛')
+ this.getDeviceAList(this.clickNodeVal.value);
+ }
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
+
+ },
+ //瀵煎嚭
+ handleDown() {
+ this.outLoading = true
+ incidentReportExport({deviceId: this.clickNodeVal.value}).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/octet-stream' });
+ this.$download.saveAs(blob, '璁惧楠屾敹.xlsx')
+ })
+ },
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ clickNodeVal(newVal) {
+ if (newVal.value) {
+ this.getDeviceAList(newVal.value);
+ }
+ },
+ dialogVisible(newVal) {
+ if (!newVal) {
+ this.form = {
+ sparePartsConfirmationList: [], // 澶囦欢纭List
+ fileClassConfirmationList: [], // 鏂囦欢纭List
+ installationAcceptanceRecordList: [], // 瀹夎楠屾敹璁板綍
+ acceptanceCheckRecordList: [], // 楠屾敹鏍告煡璁板綍
+ fileName: '', // 鏂囦欢鍚嶇О
+ systemFileName: '', // 绯荤粺鏂囦欢鍚嶇О
+ }
+ this.currentStep = 0 // 姝ラ鏉℃樉绀虹鍑犳
+ this.currentStepClick = 0 // 鐐瑰嚮姝ラ鏉″彉鍖�
+ this.$refs['form'].clearValidate()
+ }
+ }
+ }
+}
+function downloadImage(url) {
+ const link = document.createElement('a');
+ link.href = url;
+ link.download = 'attachment.jpg'; // 鏂囦欢鍚�
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+}
+</script>
+
+<style scoped>
+>>>.el-radio {
+ color: #606266;
+ font-weight: 500;
+ cursor: pointer;
+ margin-right: 0px;
+ width: 10em;
+}
+
+.tables {
+ width: 100%;
+ height: calc(100vh - 17em);
+}
+
+.search {
+ margin-top: 10px;
+ background-color: #fff;
+ height: 40px;
+ display: flex;
+ align-items: center;
+ position: relative;
+}
+
+.search_thing {
+ display: flex;
+ align-items: center;
+ height: 40px;
+}
+
+.search_label {
+ font-size: 14px;
+ text-align: right;
+}
+
+.search_input {
+ width: calc(100% - 120px);
+}
+
+.btns {
+ position: absolute;
+ right: 0px;
+ top: 40%;
+ transform: translate(0, -50%);
+ /* text-align: right; */
+}
+
+.search_thing {
+ display: flex;
+ margin-bottom: 10px;
+}
+
+.search_label {
+ /* width: 150px; */
+ text-align: right;
+ padding-right: 10px;
+}
+
+.search_input {
+ flex-grow: 1;
+}
+
+.line {
+ width: 20px;
+ height: 1px;
+ background-color: #ccc;
+ display: inline-block;
+ margin-right: 10px;
+}
+
+.form .search_label {
+ width: 120px;
+}
+</style>
diff --git a/src/views/CNAS/resourceDemand/device/component/check.vue b/src/views/CNAS/resourceDemand/device/component/check.vue
new file mode 100644
index 0000000..2097352
--- /dev/null
+++ b/src/views/CNAS/resourceDemand/device/component/check.vue
@@ -0,0 +1,704 @@
+<!-- 璁惧鏍告煡 -->
+<template>
+ <div>
+ <div class="btns">
+ <el-button size="small" type="primary" @click="calibrationMaintenance()">鏍告煡椤圭洰缁存姢</el-button>
+ <el-button size="small" type="primary" @click="add('add')">娣诲姞鏍告煡璁板綍</el-button>
+ <el-button size="small" type="primary" @click="downLoadPost">瀵煎嚭Excel</el-button>
+ </div>
+ <div class="tables" style="margin-top: 16px;">
+ <el-table :data="tableData" height="calc(100vh - 20em)">
+ <el-table-column label="搴忓彿" type="index" width="120">
+ <template v-slot="scope">
+ <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="璁板綍缂栧彿" min-width="150" prop="processNumber"></el-table-column>
+ <el-table-column label="鏍告煡鏈烘瀯" min-width="150" prop="calibrationInstitution"
+ show-overflow-tooltip></el-table-column>
+ <el-table-column label="鏍告煡缁撹" min-width="150" prop="status">
+ <template v-slot="scope">
+ {{ scope.row.status === '0yes' ? '鍚堟牸' : scope.row.status === '1no' ? '涓嶅悎鏍�' : '鍏朵粬' }}
+ </template>
+ </el-table-column>
+ <el-table-column label="鏍告煡璇佷功缂栧彿" min-width="150" prop="certificateSerialNumber"></el-table-column>
+ <el-table-column label="璇存槑" min-width="150" prop="remark" show-overflow-tooltip></el-table-column>
+ <el-table-column label="鏍告煡鏃ユ湡" min-width="150" prop="calibrationDate"></el-table-column>
+ <el-table-column label="涓嬫鏍告煡鏃ユ湡" min-width="150" prop="nextCalibrationDate"></el-table-column>
+ <el-table-column label="鐧昏浜�" min-width="150" prop="createUser"></el-table-column>
+ <el-table-column label="鐧昏鏃ユ湡" min-width="150" prop="createTime"></el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔" min-width="150">
+ <template #default="{ row }">
+ <el-button size="small" type="text" @click="handleAttachmentClick(row)">闄勪欢</el-button>
+ <el-button size="small" type="text" @click="handleViewClick('view', row)">鏌ョ湅</el-button>
+ <el-button size="small" type="text" @click="handleDeleteClick(row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]"
+ :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" style="margin-right: 5%;"
+ @size-change="handleSizeChange" @current-change="handleCurrentChange">
+ </el-pagination>
+ </div>
+
+ <!-- 鏍″噯椤圭洰缁存姢 -->
+ <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="dialogVisible0" title="鏍告煡椤圭洰缁存姢"
+ top="5vh" width="70%">
+ <h4>
+ <span style="display: flex;align-items: center;"><span class="line"></span><span>璁惧鏍告煡鍙傛暟缁存姢</span></span>
+ <el-button :loading="addCalibrateLoading" size="small" type="primary" @click="addCalibrate">娣� 鍔�</el-button>
+ </h4>
+ <div>
+ <el-form ref="form0" :model="form0" :rules="form0Rules"
+ label-position="right" label-width="120px">
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="鏍告煡鍙傛暟:" prop="measurementParameter">
+ <el-input v-model="form0.measurementParameter" clearable placeholder="璇疯緭鍏�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鏍告煡鑼冨洿:" prop="rangeOfMeasurement">
+ <el-input v-model="form0.rangeOfMeasurement" clearable placeholder="璇疯緭鍏�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鏈�澶у厑璁歌宸�:" prop="maxPermissibleError">
+ <el-input v-model="form0.maxPermissibleError" clearable placeholder="璇疯緭鍏�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍒ゅ畾鏍囧噯:" prop="judgmentCriteria">
+ <el-input v-model="form0.judgmentCriteria" clearable placeholder="璇疯緭鍏�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ </div>
+ <h4>
+ <span style="display: flex;align-items: center;"><span class="line"></span><span>璁惧鏍告煡鍙傛暟</span></span>
+ </h4>
+ <!-- 璁惧鏍″噯鍙傛暟琛ㄦ牸 -->
+ <el-table ref="calibrateTable" v-loading="calibrateParamsLoading" :data="calibrateParams"
+ max-height="450"
+ stripe style="width: 100%">
+ <el-table-column label="缂栧彿" type="index" width="80"></el-table-column>
+ <el-table-column label="鏍告煡鍙傛暟" prop="measurementParameter"></el-table-column>
+ <el-table-column label="鏍告煡鑼冨洿" prop="rangeOfMeasurement"></el-table-column>
+ <el-table-column label="鏈�澶у厑璁歌宸�" prop="maxPermissibleError"></el-table-column>
+ <el-table-column label="鍒ゅ畾鏍囧噯" prop="judgmentCriteria"></el-table-column>
+ <el-table-column label="鍒涘缓浜�" prop="createdBy"></el-table-column>
+ <el-table-column label="鍒涘缓鏃堕棿" prop="creationTime"></el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔">
+ <template slot-scope="scope">
+ <el-button size="small" type="text" @click="handleDelete(scope.row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-dialog>
+
+ <!-- 娣诲姞鏍告煡璁板綍 -->
+ <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="dialogVisible1" title="鏍告煡璁板綍" :before-close="handleClose"
+ top="5vh"
+ width="80%" @close="resetcalibrationRecord">
+ <div class="dialog-content">
+ <h4>
+ <span style="display: flex;align-items: center;">
+ <span class="line"></span>
+ <span>娣诲姞璁惧鏍告煡璁板綍</span>
+ </span>
+ </h4>
+ <el-form ref="calibrationRecord" :model="calibrationRecord" :rules="formRules"
+ label-position="right" label-width="120px">
+ <el-row>
+ <el-col :span="6">
+ <el-form-item label="鏍告煡浜�:" prop="unitOfMeasure">
+ <el-input v-model="calibrationRecord.unitOfMeasure" :disabled="operationType === 'view'"
+ size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鏍告煡鏃ユ湡:" prop="calibrationDate">
+ <el-date-picker v-model="calibrationRecord.calibrationDate" :disabled="operationType === 'view'" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡"
+ size="small"
+ style="width: 90%" type="date" value-format="yyyy-MM-dd">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="10">
+ <el-form-item label="涓嬫鏍告煡鏃ユ湡:" label-width="140px" prop="nextCalibrationDate">
+ <el-date-picker v-model="calibrationRecord.nextCalibrationDate" :disabled="operationType === 'view'" :picker-options="{ disabledDate: this.disabledDate }"
+ format="yyyy-MM-dd"
+ placeholder="閫夋嫨鏃ユ湡"
+ size="small" style="width: 90%" type="date"
+ value-format="yyyy-MM-dd">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="鏍告煡鍣ㄥ叿:" prop="calculatingApparatus">
+ <el-input v-model="calibrationRecord.calculatingApparatus" :disabled="operationType === 'view'"
+ size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鏍告煡鏍囧噯閲忕▼:" prop="standardRange">
+ <el-input v-model="calibrationRecord.standardRange" :disabled="operationType === 'view'" size="small"
+ style="width: 90%"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="10">
+ <el-form-item label="鏍告煡鏍囧噯涓嶇‘瀹氬害:" label-width="140px" prop="calibrationStandardUncertainty">
+ <el-input v-model="calibrationRecord.calibrationStandardUncertainty" :disabled="operationType === 'view'" size="small"
+ style="width: 90%"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="鏍告煡鎸囧涔�:" prop="byDocument">
+ <el-input v-model="calibrationRecord.byDocument" :disabled="operationType === 'view'"
+ size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="妫�鏌ユ姤鍛婄紪鍙�:" prop="certificateSerialNumber">
+ <el-input v-model="calibrationRecord.certificateSerialNumber" :disabled="operationType === 'view'" size="small"
+ style="width: 90%"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鏍告煡鎬荤粨璁�:" label-width="140px" prop="status">
+ <el-radio-group v-model="calibrationRecord.status" :disabled="operationType === 'view'">
+ <el-radio label="0yes">鍚堟牸</el-radio>
+ <el-radio label="1no">涓嶅悎鏍�</el-radio>
+ <el-radio label="2other">鍏朵粬</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="23">
+ <el-form-item label="闄勪欢锛�" prop="fileName">
+ <el-input v-model="calibrationRecord.fileName" :style="`width: ${operationType === 'add' ? '90%' : '100%'};}`" disabled
+ size="small">
+ <el-button v-if="operationType === 'add'" slot="append" icon="el-icon-delete-solid"
+ @click="deleteFile"></el-button>
+ </el-input>
+ <el-upload v-if="operationType === 'add'" ref="upload" :action="action" :before-upload="beforeUpload" :headers="uploadHeader"
+ :limit="1" :on-error="onError" :on-success="handleSuccessUp"
+ :show-file-list="false"
+ style="float: right;">
+ <el-button :loading="upLoading" size="small" style="position: relative; top: -4px;"
+ type="primary">闄勪欢涓婁紶
+ </el-button>
+ </el-upload>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="澶囨敞:">
+ <el-input v-model="calibrationRecord.remark" :disabled="operationType === 'view'" :rows="3" size="small"
+ style="width: 96%" type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ <h4>
+ <span style="display: flex;align-items: center;">
+ <span class="line"></span><span>鏍告煡鏉$洰纭缁撴灉</span>
+ </span>
+ </h4>
+ <el-table ref="calibrateTable" :data="calibrateParams" stripe style="width: 100%;">
+ <el-table-column label="缂栧彿" type="index" width="80"></el-table-column>
+ <el-table-column label="鏍告煡鍙傛暟" prop="measurementParameter" width="150"></el-table-column>
+ <el-table-column label="鏍告煡鑼冨洿" prop="rangeOfMeasurement" width="150"></el-table-column>
+ <el-table-column label="鏈�澶у厑璁歌宸�" prop="maxPermissibleError" width="150"></el-table-column>
+ <el-table-column label="鍒ゅ畾鏍囧噯" prop="judgmentCriteria" width="150"></el-table-column>
+ <el-table-column label="鏄惁鏍告煡" prop="isCalibration">
+ <template slot="header" slot-scope="scope">
+ <span class="required-span">* </span>鏄惁鏍告煡
+ </template>
+ <template slot-scope="scope">
+ <el-radio-group v-model="scope.row.isCalibration" :disabled="operationType === 'view'">
+ <el-radio label="0yes">鏄�</el-radio>
+ <el-radio label="1no">鍚�</el-radio>
+ </el-radio-group>
+ </template>
+ </el-table-column>
+ <el-table-column label="鍒ゅ畾缁撴灉" prop="result">
+ <template slot="header" slot-scope="scope">
+ <span class="required-span">* </span>鍒ゅ畾缁撴灉
+ </template>
+ <template slot-scope="scope">
+ <el-radio-group v-model="scope.row.result" :disabled="operationType === 'view'" @input="checkRadio()">
+ <el-radio label="0yes">鍚堟牸</el-radio>
+ <el-radio label="1no">涓嶅悎鏍�</el-radio>
+ <el-radio label="2other">鍏朵粬</el-radio>
+ </el-radio-group>
+ </template>
+ </el-table-column>
+ <el-table-column label="鍗曢」缁撴灉璇存槑" prop="singleResultStatement">
+ <template slot-scope="scope">
+ <el-input v-model="scope.row.singleResultStatement" :disabled="operationType === 'view'" size="small"></el-input>
+ </template>
+ </el-table-column>
+ </el-table>
+ <span slot="footer" class="dialog-footer" style="float: right;margin-top: 10px">
+ <el-button v-if="operationType === 'add'" @click="handleClose">鍙� 娑�</el-button>
+ <el-button v-if="operationType === 'add'" type="primary" @click="addRecord">纭� 瀹�</el-button>
+ </span>
+ </div>
+ </el-dialog>
+ </div>
+
+</template>
+
+<script>
+import file from '@/utils/file';
+import { mapGetters } from "vuex";
+import {
+ addOrUpdateDeviceMetricRecord, deleteCNASFile, deleteDeviceMetricRecord, deleteDeviceMetrics,
+ deviceMetricRecordExport,
+ deviceMetricRecordPage,
+ saveOrUpdateDeviceMetric,
+ selectDeviceMetric, showDeviceMetricsCopy
+} from "@/api/cnas/resourceDemand/device";
+export default {
+ components: {},
+ props: {
+ clickNodeVal: {
+ type: Object,
+ default: () => {
+ return {};
+ }
+ }
+ },
+ data() {
+ return {
+ search: {
+ size: 20,
+ current: 1,
+ total: 0
+ },
+ calibrateParamsLoading: false,
+ addCalibrateLoading: false,
+ form0: {
+ measurementParameter: '', // 璁¢噺鍙傛暟
+ rangeOfMeasurement: '',
+ maxPermissibleError: '',
+ judgmentCriteria: '',
+ createdBy: '',
+ action: '',
+ deviceId: null
+ },
+ form0Rules: {
+ measurementParameter: [
+ { required: true, message: '璇疯緭鍏ヨ閲忓弬鏁�', trigger: 'blur' }
+ ],
+ rangeOfMeasurement: [
+ { required: true, message: '璇疯緭鍏ラ噺绋嬭寖鍥�', trigger: 'blur' }
+ ],
+ maxPermissibleError: [
+ { required: true, message: '璇疯緭鍏ユ渶澶у厑璁歌宸�', trigger: 'blur' }
+ ],
+ judgmentCriteria: [
+ { required: true, message: '璇疯緭鍏ュ垽瀹氭爣鍑�', trigger: 'blur' }
+ ],
+ },
+ dialogVisible0: false,
+ calibrationRecord: {
+ unitOfMeasure: '', // 鏍告煡浜�
+ calibrationDate: '', // 鏍告煡鏃ユ湡
+ nextCalibrationDate: '', // 涓嬫鏍告煡鏃ユ湡
+ calculatingApparatus: '', // 鏍告煡鍣ㄥ叿
+ standardRange: '', // 鏍告煡鏍囧噯閲忕▼
+ calibrationStandardUncertainty: '', // 鏍告煡鏍囧噯涓嶇‘瀹氬害
+ byDocument: '', // 鏍告煡鎸囧涔�
+ certificateSerialNumber: '', // 妫�鏌ユ姤鍛婃寚瀵间功
+ fileName: '', // 闄勪欢
+ status: '', // 鏍告煡鎬荤粨璁�
+ remark: '', // 澶囨敞
+ },
+ formRules: {
+ unitOfMeasure: [{ required: true, message: '璇疯緭鍏ユ牳鏌ヤ汉', trigger: 'blur' }],
+ calibrationDate: [{ required: true, message: '璇烽�夋嫨鏍告煡鏃ユ湡', trigger: 'change' }],
+ nextCalibrationDate: [{ required: true, message: '璇烽�夋嫨涓嬫鏍告煡鏃ユ湡', trigger: 'change' }],
+ calculatingApparatus: [{ required: true, message: '璇疯緭鍏ユ牳鏌ュ櫒鍏�', trigger: 'blur' }],
+ standardRange: [{ required: true, message: '璇疯緭鍏ユ牳鏌ユ爣鍑嗛噺绋�', trigger: 'blur' }],
+ calibrationStandardUncertainty: [{ required: true, message: '璇疯緭鍏ユ牳鏌ユ爣鍑嗕笉纭畾搴�', trigger: 'blur' }],
+ byDocument: [{ required: true, message: '璇疯緭鍏ユ牳鏌ユ寚瀵间功', trigger: 'blur' }],
+ certificateSerialNumber: [{ required: true, message: '璇疯緭鍏ユ鏌ユ姤鍛婃寚瀵间功', trigger: 'blur' }],
+ status: [{ required: true, message: '璇烽�夋嫨鏍告煡鎬荤粨璁�', trigger: 'change' }]
+ },
+ calibrateParams: [],
+ tableData: [],
+ operationType: '',
+ dialogVisible1: false,
+ formData: {
+ person: '',
+ data1: '',
+ name: '',
+ },
+ upLoading: false
+ }
+ },
+ // 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭�
+ computed: {
+ ...mapGetters(["nickName"]),
+ action() {
+ return this.javaApi + '/personBasicInfo/saveCNASFile'
+ }
+ },
+ mounted() {
+ this.getTableList(this.clickNodeVal.value) // 鑾峰彇璁惧鏍告煡鍒楄〃鏁版嵁
+ },
+ methods: {
+ //鐘舵�佸垽瀹�
+ checkRadio() {
+ let resultList = this.calibrateParams.map(ele => ele.result)
+ if (resultList && resultList.filter(ele => ele == '1no').length > 0) {
+ this.calibrationRecord.status = '1no'
+ } else if (resultList && resultList.filter(ele => ele == '2other').length == resultList.length) {
+ this.calibrationRecord.status = '2other'
+ } else if (resultList && resultList.filter(ele => ele == '0yes').length == resultList.length) {
+ this.calibrationRecord.status = '0yes'
+ }
+ },
+ //涓嬫鏍告煡鏃ユ湡:绂佺敤鍦ㄦ牳鏌ユ棩鏈熷墠鐨勬棩鏈�
+ disabledDate(time) {
+ let selectDate = this.calibrationRecord.calibrationDate
+ if (selectDate) {
+ let oldDate = new Date(selectDate)
+ return time <= oldDate.getTime()
+ }
+ return false
+ },
+ handleSizeChange(val) {
+ this.search.size = val
+ this.getTableList(this.clickNodeVal.value);
+ },
+ handleCurrentChange(val) {
+ this.search.current = val
+ this.getTableList(this.clickNodeVal.value);
+ },
+ // 鑾峰彇璁惧鏍″噯鍙傛暟table淇℃伅
+ async getXmsg() {
+ this.calibrateParamsLoading = true
+ try {
+ await selectDeviceMetric({deviceId: this.clickNodeVal.value, type: 'examine'}).then(res => {
+ if (res.code == 200) {
+ this.calibrateParams = res.data
+ }
+ this.calibrateParamsLoading = false
+ })
+ } catch (e) {
+ this.calibrateParamsLoading = false
+ }
+ },
+ // 鏍″噯椤圭洰缁存姢
+ calibrationMaintenance() {
+ this.dialogVisible0 = true
+ this.getXmsg();
+ },
+ addCalibrate() {
+ this.$refs['form0'].validate((valid) => {
+ if (valid) {
+ // 淇濆瓨
+ this.calibrateParamsLoading = true
+ this.addCalibrateLoading = true
+ this.form0.deviceId = this.clickNodeVal.value;
+ this.form0.createdBy = this.nickName;
+ this.form0.type = 'examine'
+ saveOrUpdateDeviceMetric(this.form0).then(res => {
+ if (res.code == 200) {
+ this.$message.success('淇濆瓨鎴愬姛')
+ this.$refs['form0'].resetFields()
+ this.getXmsg() // 鍒锋柊璁惧鏍″噯鍙傛暟琛ㄦ牸
+ }
+ this.calibrateParamsLoading = false
+ this.addCalibrateLoading = false
+ })
+ } else {
+ this.addCalibrateLoading = false
+ this.$message.warning('鏈夊繀濉」鏈~');
+ }
+ })
+ },
+ // 鏌ヨ璁惧鏍告煡鍒楄〃
+ getTableList(deviceId) {
+ deviceMetricRecordPage({deviceId: deviceId, size: this.search.size, current: this.search.current, type: 'examine'}).then(res => {
+ this.tableData = res.data.records
+ this.search.total = res.data.total
+ })
+ },
+ // 鎻愪氦瑕佹坊鍔犵殑璁板綍
+ addRecord() {
+ this.$refs['calibrationRecord'].validate((valid) => {
+ if (valid) {
+ try {
+ if (this.calibrateParams.some(m => m.isCalibration === undefined)) {
+ this.$message.error('璇烽�夋嫨鏄惁鏍告煡')
+ return
+ }
+ if (!this.calibrateParams.every(m => m.result !== undefined)) {
+ this.$message.error('璇烽�夋嫨鍒ゅ畾缁撴灉')
+ return
+ }
+ this.addRecordLoading = true
+ this.calibrationRecord.deviceId = this.clickNodeVal.value;
+ this.calibrationRecord.createUser = this.nickName
+ this.calibrationRecord.deviceMetricsCopyList = this.calibrateParams
+ this.calibrationRecord.deviceMetricsCopyList.forEach(ele => {
+ delete ele.creationTime
+ })
+ this.calibrationRecord.type = 'examine'
+ addOrUpdateDeviceMetricRecord(this.calibrationRecord).then(res => {
+ if (res.code == 200) {
+ this.$message.success('娣诲姞鎴愬姛')
+ this.dialogVisible1 = false
+ this.getTableList(this.clickNodeVal.value)
+ }
+ this.addRecordLoading = false
+ })
+ } catch (e) {
+ console.log('addRecord---', e)
+ this.addRecordLoading = false
+ }
+ } else {
+ this.$message.warning('鏈夊繀濉」鏈~');
+ }
+ })
+ },
+ handleClose(done) {
+ this. calibrationRecord = {
+ unitOfMeasure: '', // 鏍告煡浜�
+ calibrationDate: '', // 鏍告煡鏃ユ湡
+ nextCalibrationDate: '', // 涓嬫鏍告煡鏃ユ湡
+ calculatingApparatus: '', // 鏍告煡鍣ㄥ叿
+ standardRange: '', // 鏍告煡鏍囧噯閲忕▼
+ calibrationStandardUncertainty: '', // 鏍告煡鏍囧噯涓嶇‘瀹氬害
+ byDocument: '', // 鏍告煡鎸囧涔�
+ certificateSerialNumber: '', // 妫�鏌ユ姤鍛婃寚瀵间功
+ fileName: '', // 闄勪欢
+ status: '', // 鏍告煡鎬荤粨璁�
+ remark: '', // 澶囨敞
+ }
+ this.dialogVisible1 = false
+ },
+ resetcalibrationRecord() {
+ this.$refs.calibrationRecord.resetFields()
+ },
+ // 闄勪欢涓婁紶
+ handleSuccessUp(response, file) {
+ if (response.code == 200) {
+ // 鍦ㄤ繚瀛樿祴鍊兼柊鏂囦欢
+ this.calibrationRecord.fileName = file.name
+ this.calibrationRecord.systemFileName = response.data
+ this.upLoading = false;
+ } else {
+ this.$message.error(response.message)
+ }
+ },
+ beforeUpload(file) {
+ if (file.size > 1024 * 1024 * 10) {
+ this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M');
+ this.$refs.upload.clearFiles()
+ return false;
+ } else {
+ this.upLoading = true;
+ return true;
+ }
+ },
+ onError(err, file, fileList) {
+ this.$message.error('涓婁紶澶辫触')
+ this.$refs.upload.clearFiles()
+ },
+ deleteFile() {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ枃浠�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deleteCNASFile({fileName: this.form.systemFileName}).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鍒犻櫎鎴愬姛锛�')
+ }
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
+ },
+ // end
+ handleAttachmentClick(row) {
+ this.$download.saveAs(row.systemFileName, row.fileName)
+ },
+ // 娣诲姞鏍告煡璁板綍
+ add(type) {
+ this.operationType = type
+ this.dialogVisible1 = true
+ this.getXmsg()
+ },
+ // 鏌ョ湅璇︽儏
+ handleViewClick(type, row) {
+ showDeviceMetricsCopy({id: row.id, type: 'examine'}).then(res => {
+ this.calibrateParams = res.data
+ })
+ this.calibrationRecord = { ...row }
+ this.operationType = type
+ this.dialogVisible1 = true
+ },
+
+ // 琛ㄦ牸鍒犻櫎鎿嶄綔
+ handleDeleteClick(row) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deleteDeviceMetricRecord({id: row.id}).then(res => {
+ this.getTableList(this.clickNodeVal.value) // 鑾峰彇璁惧鏍″噯鍒楄〃鏁版嵁
+ this.$message.success('鍒犻櫎鎴愬姛锛�')
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ })
+ },
+ handleDelete(row) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deleteDeviceMetrics({id: row.id}).then(res => {
+ this.getXmsg();
+ this.$message.success('鍒犻櫎鎴愬姛锛�')
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ })
+ },
+ downLoadPost() {
+ this.outLoading = true
+ deviceMetricRecordExport({deviceId: this.clickNodeVal.value}).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res],{ type: 'application/msword' });
+ this.$download.saveAs(blob, '璁惧鏍告煡.xlsx')
+ })
+ },
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ clickNodeVal(newVal) {
+ if (newVal.value) {
+ this.getTableList(newVal.value);
+ }
+ },
+ }
+}
+
+function downloadImage(url, name) {
+ const link = document.createElement('a');
+ link.href = url;
+ link.download = name; // 鏂囦欢鍚�
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+}
+</script>
+<style scoped>
+.dialog-content {
+ max-height: 70vh;
+ /* 璁剧疆鏈�澶ч珮搴� */
+ overflow-y: auto;
+ /* 鍚敤鍨傜洿婊氬姩 */
+}
+
+.tables {
+ width: 100%;
+ height: calc(100vh - 230px);
+}
+
+.search {
+ background-color: #fff;
+ height: 40px;
+ display: flex;
+ align-items: center;
+ position: relative;
+}
+
+.search_thing {
+ display: flex;
+ align-items: center;
+ height: 40px;
+}
+
+.search_label {
+ width: 70px;
+ font-size: 14px;
+ text-align: right;
+ margin-right: 10px;
+}
+
+.search_input {
+ width: calc(100% - 110px);
+}
+
+.btns {
+ text-align: right;
+ margin-top: 10px;
+}
+
+h4 {
+ font-weight: 400;
+ font-size: 16px;
+ display: flex;
+ justify-content: space-between;
+ margin: 10px 0;
+}
+
+h4 .line {
+ display: inline-block;
+ width: 3px;
+ height: 16px;
+ background: #3A7BFA;
+ margin-right: 4px;
+}
+
+.check {
+ background-color: #fff;
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-between;
+}
+
+.check_thing {
+ flex: 0 0 calc(20% - 10px);
+ margin-bottom: 20px;
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+}
+
+.check_label {
+ font-size: 14px;
+ margin-bottom: 5px;
+}
+
+.check_data .check_input {
+ width: 100%;
+}
+
+.el-table {
+ font-size: 14px;
+ color: #333;
+}
+
+.el-table thead {
+ background-color: #f5f5f5;
+}
+</style>
diff --git a/src/views/CNAS/resourceDemand/device/component/device-overview.vue b/src/views/CNAS/resourceDemand/device/component/device-overview.vue
new file mode 100644
index 0000000..2efabd0
--- /dev/null
+++ b/src/views/CNAS/resourceDemand/device/component/device-overview.vue
@@ -0,0 +1,386 @@
+<!-- 璁惧鎬昏 -->
+<style scoped>
+.title {
+ height: 60px;
+ line-height: 60px;
+}
+
+.search {
+ background-color: #fff;
+ height: 50px;
+ display: flex;
+ align-items: center;
+}
+
+.search_thing {
+ width: 350px;
+ display: flex;
+ align-items: center;
+}
+
+.search_label {
+ width: 110px;
+ font-size: 14px;
+ text-align: left;
+}
+
+.search_input {
+ width: calc(100% - 110px);
+}
+
+.table {
+ background-color: #fff;
+ width: calc(100% - 40px);
+ height: calc(100vh - 17em);
+ /* padding: 10px; */
+ overflow-y: auto;
+}
+
+.card {
+ list-style-type: none;
+ display: grid;
+ grid-template-columns: repeat(auto-fit, 380px);
+ justify-content: start;
+ grid-gap: 16px;
+ min-height: 300px;
+}
+
+.card li {
+ width: 380px;
+ height: 165px;
+ border-radius: 8px 8px 8px 8px;
+ border: 1px solid #EEEEEE;
+ margin: 0 !important;
+ display: flex;
+ align-items: center;
+ box-sizing: border-box;
+ padding: 16px;
+ font-size: 14px;
+ color: #666666;
+ position: relative;
+ overflow: hidden;
+}
+
+.card li .img {
+ width: 114px;
+ height: 114px;
+ border-radius: 16px;
+ margin-right: 24px;
+}
+
+.list-left .list-left-info {
+ line-height: 36px;
+ display: flex;
+}
+
+.text-truncate {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap
+}
+
+.circles {
+ position: absolute;
+ width: 70px;
+ height: 70px;
+ right: 0;
+ top: 0;
+ z-index: 0;
+}
+
+.circles .circle {
+ border-radius: 50%;
+ opacity: 0.2;
+}
+
+.circle0,
+.circle1,
+.circle2 {
+ width: 60px;
+ height: 60px;
+ position: absolute;
+}
+
+.circle3 {
+ width: 16px;
+ height: 16px;
+ position: absolute;
+}
+
+.circle0 {
+ bottom: 6px;
+ left: 0;
+}
+
+.circle1 {
+ bottom: 0;
+ right: -30px;
+}
+
+.circle2 {
+ left: 0;
+ top: -30px;
+}
+
+.circle3 {
+ top: 0;
+ right: 0;
+}
+
+.success .circle {
+ background: #34BD66;
+}
+
+.danger .circle {
+ background: #FF3838;
+}
+
+.warning .circle {
+ background: #FBB247;
+}
+.info .circle {
+ background: #909399;
+}
+</style>
+
+<template>
+ <div class="role_manage">
+ <div style="margin-top: 10px">
+ <el-form :model="entity" inline label-position="right">
+ <el-form-item label="鐘舵��:">
+ <el-select v-model="entity.deviceStatus" placeholder="鍏ㄩ儴" size="small" clearable>
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="璁惧鍚嶇О:">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="entity.deviceName"></el-input>
+ </el-form-item>
+ <el-form-item>
+ <el-button size="small" @click="refresh()">閲� 缃�</el-button>
+ </el-form-item>
+ <el-form-item>
+ <el-button size="small" type="primary"
+ @click="currentPage = 1, keyMap = {}, list = [], finishLoding = false, refreshTable()">鏌� 璇�</el-button>
+ </el-form-item>
+ </el-form>
+ </div>
+ <div class="table" v-loading="loading">
+ <scroll-pagination @load="refreshTable()" :finishLoding="finishLoding" :list="list"
+ v-if="list.length > 0 || loading">
+ <ul class="card">
+ <li v-for="(m, i) in list" :key="i">
+ <el-image class="img" :src="javaApi + '/img/' + m.imageUpload">
+ <div slot="error" class="image-error" style="width: 112px;
+ height: 112px;
+ border-radius: 16px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: 1px solid #EEEEEE;">
+ <i class="el-icon-picture-outline" style="font-size:30px;color:#666666;"></i>
+ </div>
+ </el-image>
+ <div class="list-left">
+ <div class="list-left-info">
+ <span class="label">璁惧鍚嶇О锛�</span>
+ <span style="color:#3A7BFA;
+ font-size: 16px;
+ display: inline-block;
+ width: 129px;
+ word-break: break-all;" class="text-truncate" :title="m.deviceName">{{ m.deviceName ? m.deviceName : '鏃�' }}</span>
+ </div>
+ <div class="list-left-info">
+ <span class="label">瑙勬牸鍨嬪彿锛�</span>
+ <span style="color:#333333;font-size: 16px;">{{ m.specificationModel ? m.specificationModel : '鏃�'
+ }}</span>
+ </div>
+ <div class="list-left-info">
+ <span class="label">鐘舵�侊細</span>
+ <el-tag :type="m.type" v-if="m.deviceStatusName">{{ m.deviceStatusName }}</el-tag>
+ <span v-else style="color:#333333;font-size: 16px;">鏃�</span>
+ </div>
+ </div>
+ <div class="circles" :class="m.type">
+ <div class="circle0 circle"></div>
+ <div class="circle1 circle"></div>
+ <div class="circle2 circle"></div>
+ <div class="circle3 circle"></div>
+ </div>
+ </li>
+ </ul>
+ </scroll-pagination>
+ <div v-if="list.length < 1 && !loading" style="color:#909399;font-size:14px;text-align: center;margin-top:200px">
+ 鏆傛棤鏁版嵁
+ </div>
+ </div>
+ </div>
+</template>
+
+<script>
+import ScrollPagination from '@/components/index/scroll-paging.vue'
+import {selectDeviceParameter} from "@/api/cnas/resourceDemand/device";
+export default {
+ props: {
+ clickNodeVal: {
+ type: Object,
+ default: () => {
+ return {};
+ }
+ }
+ },
+ components: {
+ ScrollPagination
+ },
+ data() {
+ return {
+ entity: {
+ deviceStatus: null,
+ deviceName: null,
+ },
+ options: [],
+ list: [],
+ currentPage: 1, // 褰撳墠椤�
+ pageSize: 16, // 涓�椤�16鏉�
+ total: '',
+ loading: true, // 缁勪欢loading鐨勫睍绀�,榛樿涓簍rue
+ finishLoding: false, // 鍔犺浇瀹屾垚锛屾樉绀哄凡缁忔病鏈夋洿澶氫簡
+ keyMap: {},
+ laboratoryNameIsNull: false,
+ }
+ },
+ created() {
+ this.selectEnumByCategory()
+ this.keyMap = {};
+ this.currentPage = 1;
+ this.list = [];
+ this.clickSidebar(this.clickNodeVal)
+ },
+ methods: {
+ refreshTable() {
+ const key = `_${this.currentPage}`
+ const value = this.keyMap[key]
+ // 濡傛灉value瀛樺湪锛岃〃绀虹紦瀛樻湁鍊硷紝閭d箞闃绘璇锋眰
+ if (value) {
+ return
+ }
+ // value涓嶅瓨鍦紝琛ㄧず绗竴娆¤姹�,璁剧疆鍗犱綅
+ this.keyMap[key] = 'temp'
+ if (this.currentPage == 1) {
+ this.loading = true
+ }
+ if(this.list.length==0){
+ this.finishLoding = false;
+ }
+ selectDeviceParameter({
+ laboratoryNameIsNull: this.laboratoryNameIsNull,
+ current: this.currentPage,
+ size: this.pageSize,
+ ...this.entity
+ }).then(res => {
+ if (res.code == 200) {
+ this.total = res.data.total
+ let list = res.data.records.map(m => {
+ switch (m.deviceStatus) {
+ case 0:
+ // 姝e父
+ m.type = 'success'
+ break;
+ case 1:
+ // 缁翠慨
+ m.type = 'warning'
+ break;
+ case 2:
+ // 鍋滅敤
+ m.type = 'danger'
+ break;
+ case 3:
+ // 鎶ュ簾
+ m.type = 'info'
+ break;
+ }
+ this.options.forEach(j => {
+ if (m.deviceStatus == j.value) {
+ m.deviceStatusName = j.label
+ }
+ })
+ return m;
+ })
+ if (list.length == 0) {
+ this.finishLoding = true;
+ } else {
+ if (list.length < this.pageSize) {
+ this.finishLoding = true;
+ }
+ this.list = this.list.concat(list)
+ if (this.total == this.list.length) {
+ this.finishLoding = true;
+ }
+ this.currentPage++;
+ }
+ }
+ this.loading = false
+ }).catch(err => {
+ this.loading = false
+ })
+ },
+ refresh() {
+ this.keyMap = {};
+ this.currentPage = 1;
+ this.list = [];
+ this.finishLoding = false;
+ this.entity = {
+ deviceStatus: null,
+ deviceName: null,
+ orderBy: { field: "id", order: "asc" }
+ };
+ this.refreshTable()
+ },
+ // 鑾峰彇瀛楀吀
+ selectEnumByCategory() {
+ // 璁惧鐘舵��
+ this.getDicts("device_status").then((response) => {
+ this.options = this.dictToValue(response.data);
+ });
+ },
+ // 鐐瑰嚮渚ц竟鏍忓埛鏂�
+ clickSidebar(clickNodeVal) {
+ this.laboratoryNameIsNull = false
+ // 鏄惁瀛樺湪value锛屽瓨鍦╲alue浠h〃涓轰笁绾�
+ if (!clickNodeVal.value) {
+ this.finishLoding = false;
+ this.keyMap = {};
+ this.currentPage = 1;
+ this.list = [];
+ this.entity.laboratoryName = null
+ this.entity.storagePoint = null
+ // 绛変簬1浠h〃涓烘爲鐨勪竴绾э紝label涓洪儴闂�
+ if (clickNodeVal.label == '鍏朵粬') {
+ this.laboratoryNameIsNull = true
+ this.refreshTable();
+ return
+ }
+ if (clickNodeVal.level == 1) {
+ this.entity.laboratoryName = clickNodeVal.label
+ // 绛変簬浜岀骇銆俵abel涓哄瓨鍌ㄥ湴鐐�
+ } else if (clickNodeVal.level == 2) {
+ // 鍏朵粬琛ㄧず娌℃湁閰嶇疆瀹為獙瀹わ紝鍙厤缃簡鍦扮偣
+ if (clickNodeVal.parent.label == '鍏朵粬') {
+ this.laboratoryNameIsNull = true
+ } else {
+ this.entity.laboratoryName = clickNodeVal.parent.label
+ }
+ this.entity.storagePoint = clickNodeVal.label
+ }
+ this.refreshTable();
+ }
+ }
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ clickNodeVal(newVal) {
+ this.clickSidebar(newVal)
+ }
+ }
+}
+</script>
diff --git a/src/views/CNAS/resourceDemand/device/component/equipmentAcceptance.vue b/src/views/CNAS/resourceDemand/device/component/equipmentAcceptance.vue
new file mode 100644
index 0000000..1bea84b
--- /dev/null
+++ b/src/views/CNAS/resourceDemand/device/component/equipmentAcceptance.vue
@@ -0,0 +1,317 @@
+<template>
+ <div>
+ <div>
+ <div style="margin: 10px 0;text-align: right">
+ <el-button size="small" type="primary" @click="handleForm('add')">鏂板</el-button>
+ </div>
+ <div>
+ <el-table ref="yearTable" v-loading="yearTableDetailDataLoading" :data="yearTableDetailData"
+ height="calc(100vh - 18em)" style="width: 100% ;">
+ <!-- 琛ㄦ牸鍒� -->
+ <el-table-column align="center" header-align="center" label="搴忓彿" prop="prop" type="index"
+ width="70"></el-table-column>
+ <el-table-column label="鍒拌揣鏃ユ湡" min-width="150" prop="arrivalDate"></el-table-column>
+ <el-table-column label="閲戦" min-width="100" prop="goldAmount"></el-table-column>
+ <el-table-column label="缁翠慨鍗曚綅" min-width="150" prop="maintenanceunit"></el-table-column>
+ <!-- 鎿嶄綔鎸夐挳 -->
+ <el-table-column align="center" label="鎿嶄綔" min-width="180">
+ <template slot-scope="scope">
+ <el-button size="small" type="text" @click="handleForm('edit', scope.row.acceptanceId)">缂栬緫</el-button>
+ <el-button size="small" type="text" @click="handleForm('view', scope.row.acceptanceId)">鏌ョ湅</el-button>
+ <el-button size="small" type="text" @click="record(scope.row)">闄勪欢</el-button>
+ <el-button size="small" type="text" @click="handleDownOne(scope.row.acceptanceId)">瀵煎嚭</el-button>
+ <el-button size="small" style="color: #f56c6c" type="text"
+ @click="deleteFun(scope.row.acceptanceId)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-pagination :current-page="1" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]"
+ :total="pagination1.total" layout="->,total, sizes, prev, pager, next, jumper"
+ @size-change="handleSizeChange1" @current-change="handleCurrentChange1">
+ </el-pagination>
+ </div>
+ </div>
+ <acceptance-form v-if="applicationForm" ref="applicationForm" @closeDialog="closeDialog"></acceptance-form>
+ <!--涓婁紶鎶ュ憡-->
+ <el-dialog :visible.sync="filesDialogVisible" title="闄勪欢" width="80%" @closed="closeFilesLook">
+ <div style="display: flex;justify-content: space-between;">
+ <el-upload ref='upload' :action="fileAction" :auto-upload="true" :before-upload="fileBeforeUpload"
+ :data="{ acceptanceId: acceptanceId }" :headers="uploadHeader" :on-error="onError"
+ :on-success="handleSuccessUp" :show-file-list="false"
+ accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' style="width: 80px !important;">
+ <el-button size="small" style="height: 38px" type="primary">闄勪欢涓婁紶</el-button>
+ </el-upload>
+ </div>
+ <div>
+ <limsTable ref="yearTable" :column="columnData" :height="'calc(100vh - 30em)'" :highlightCurrentRow="true"
+ :table-data="tableData" :table-loading="tableLoading" style="margin-top: 0.5em;" :page="pagination1">
+ </limsTable>
+ </div>
+ </el-dialog>
+ <el-dialog :visible.sync="lookDialogVisible" fullscreen title="鏌ョ湅闄勪欢" top="5vh" width="800px">
+ <filePreview v-if="lookDialogVisible" :currentFile="{}" :fileUrl="fileUrl"
+ style="height: 90vh;overflow-y: auto;" />
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import AcceptanceForm from "./acceptanceForm.vue";
+import limsTable from "@/components/Table/lims-table.vue";
+import filePreview from "@/components/Preview/filePreview.vue";
+import {
+ pageDeviceAcceptance,
+ getDeviceAcceptanceFileList,
+ delDeviceAcceptanceFileList,
+ exportDeviceAcceptance,
+ delDeviceAcceptance,
+} from '@/api/cnas/resourceDemand/device.js'
+export default {
+ name: "equipment-acceptance",
+ // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+ components: { filePreview, limsTable, AcceptanceForm },
+ props: {
+ clickNodeVal: {
+ type: Object,
+ default: () => {
+ }
+ }
+ },
+ data() {
+ // 杩欓噷瀛樻斁鏁版嵁
+ return {
+ pagination1: {
+ size: 10,
+ current: 1,
+ total: 0,
+ },
+ yearTableDetailDataLoading: false,
+ yearTableDetailData: [],
+ applicationForm: false,
+ filesDialogVisible: false,
+ columnData: [
+ {
+ label: '鏂囦欢鍚嶇О',
+ prop: 'fileName',
+ minWidth: '150px'
+ },
+ {
+ dataType: 'action',
+ minWidth: '100',
+ label: '鎿嶄綔',
+ fixed: 'right',
+ operation: [
+ {
+ name: '棰勮',
+ type: 'text',
+ clickFun: (row) => {
+ this.handleLook(row)
+ }
+ },
+ {
+ name: '涓嬭浇',
+ type: 'text',
+ clickFun: (row) => {
+ this.upload(row)
+ }
+ },
+ {
+ name: '鍒犻櫎',
+ type: 'text',
+ color: '#f56c6c',
+ clickFun: (row) => {
+ this.delete(row)
+ }
+ }
+ ]
+ }
+ ],
+ tableData: [],
+ tableLoading: false,
+ acceptanceId: '', // 涓婁紶闄勪欢褰撳墠琛岀殑id
+ currentInfo: {},
+ lookDialogVisible: false,
+ fileUrl: ''
+ }
+ },
+ mounted() {
+ this.getYearTableDetailData(this.clickNodeVal.value)
+ },
+ // 鏂规硶闆嗗悎
+ methods: {
+ // 鏌ヨ
+ getYearTableDetailData(deviceId) {
+ this.yearTableDetailDataLoading = true
+ pageDeviceAcceptance({
+ current: this.pagination1.current,
+ size: this.pagination1.size,
+ deviceId: deviceId,
+ }).then(res => {
+ if (res.code == 200) {
+ this.yearTableDetailData = res.data.records
+ this.pagination1.total = res.data.total
+ }
+ this.yearTableDetailDataLoading = false
+ }).catch(err => {
+ this.yearTableDetailDataLoading = false
+ })
+ },
+ handleForm(type, id) {
+ this.applicationForm = true
+ this.$nextTick(() => {
+ this.$refs.applicationForm.openDialog(type, id, this.clickNodeVal.value)
+ })
+ },
+ closeDialog() {
+ this.applicationForm = false
+ this.getYearTableDetailData(this.clickNodeVal.value)
+ },
+ // 鎵撳紑鎶ュ憡寮规
+ record(row) {
+ this.filesDialogVisible = true
+ this.acceptanceId = row.acceptanceId
+ this.searchTableList()
+ },
+ // 鏌ヨ闄勪欢鍒楄〃
+ searchTableList() {
+ this.tableLoading = true
+ getDeviceAcceptanceFileList({ acceptanceId: this.acceptanceId }).then(res => {
+ this.tableLoading = false
+ this.tableData = res.data
+ }).catch(err => {
+ this.tableLoading = false
+ console.log('err---', err);
+ })
+ },
+ // 鏌ョ湅鏂囦欢
+ handleLook(row) {
+ this.currentInfo = row
+ this.lookDialogVisible = true
+ const state = /\.(jpg|jpeg|png|gif)$/i.test(this.currentInfo.fileUrl)
+ if (state) {
+ this.fileUrl = this.javaApi + '/img/' + this.currentInfo.fileUrl
+ } else {
+ this.fileUrl = this.javaApi + '/word/' + this.currentInfo.fileUrl
+ }
+ },
+ // 涓嬭浇
+ upload(row) {
+ this.$download.saveAs(row.fileUrl, row.fileName)
+ },
+ // 鍒犻櫎
+ delete(row) {
+ this.$confirm('姝ゆ搷浣滃皢鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ this.tableLoading = true
+ delDeviceAcceptanceFileList({ acceptanceFileId: row.acceptanceFileId }).then(res => {
+ this.tableLoading = false
+ this.$message.success('鍒犻櫎鎴愬姛')
+ this.searchTableList()
+ }).catch(err => {
+ this.tableLoading = false
+ console.log('err---', err);
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
+ },
+ // 涓婁紶闄勪欢
+ fileBeforeUpload(file) {
+ let flag = true
+ if (file.size > 1024 * 1024 * 10) {
+ this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M');
+ this.$refs.upload.clearFiles()
+ flag = false
+ }
+ if (!flag) {
+ return Promise.reject(flag); //姝g‘鐨勭粓姝�
+ }
+ },
+ onError(err, file, fileList, type) {
+ this.$message.error('涓婁紶澶辫触')
+ this.$refs.upload.clearFiles()
+ },
+ handleSuccessUp(response,) {
+ this.upLoading = false;
+ if (response.code == 200) {
+ this.$message.success('涓婁紶鎴愬姛');
+ this.searchTableList()
+ }
+ },
+ closeFilesLook() {
+ this.filesDialogVisible = false
+ },
+ // 鍒嗛〉
+ handleSizeChange1(val) {
+ this.pagination1.size = val
+ this.getYearTableDetailData(this.clickNodeVal.value)
+ },
+ // 鍒嗛〉
+ handleCurrentChange1(val) {
+ this.pagination1.current = val
+ this.getYearTableDetailData(this.clickNodeVal.value)
+ },
+ // 瀵煎嚭
+ handleDownOne(id) {
+ this.outLoading = true
+ exportDeviceAcceptance({ acceptanceId: id }).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/octet-stream' });
+ this.$download.saveAs(blob, '璁惧楠屾敹.doc')
+ })
+ },
+ // 鍒犻櫎
+ deleteFun(id) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ delDeviceAcceptance({ acceptanceId: id }).then(res => {
+ this.$message.success('鍒犻櫎鎴愬姛锛�');
+ this.getYearTableDetailData(this.clickNodeVal.value);
+ });
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
+ },
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ clickNodeVal(newVal) {
+ if (newVal.value) {
+ this.getYearTableDetailData(newVal.value);
+ }
+ },
+ },
+ computed: {
+ fileAction() {
+ return this.javaApi + '/deviceAcceptance/uploadDeviceAcceptanceFile'
+
+ }
+ },
+}
+</script>
+
+<style scoped>
+.title {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+
+.title-search {
+ display: flex;
+ align-items: center;
+ margin: 10px 0;
+}
+</style>
diff --git a/src/views/CNAS/resourceDemand/device/component/fault.vue b/src/views/CNAS/resourceDemand/device/component/fault.vue
new file mode 100644
index 0000000..c509165
--- /dev/null
+++ b/src/views/CNAS/resourceDemand/device/component/fault.vue
@@ -0,0 +1,701 @@
+<!-- 璁惧鏁呴殰 -->
+<template>
+ <div>
+ <div class="search">
+ <div class="search_thing">
+ <div class="search_label">娴佺▼缂栧彿锛�</div>
+ <div>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="search.processNumber" style="width: 100%;"
+ @keyup.enter.native="getTableList(clickNodeVal.value)">
+ </el-input>
+ </div>
+ </div>
+ <div class="search_thing" style="padding-left: 30px;">
+ <el-button size="small" @click="resetSearch">閲� 缃�</el-button>
+ <el-button size="small" type="primary" @click="getTableList(clickNodeVal.value)">鏌� 璇�</el-button>
+ </div>
+ <div class="btns">
+ <el-button size="small" type="primary" @click="dialogVisible = true, addRecode()">鏂板缓</el-button>
+ <el-button size="small" type="primary" @click="handleDown" :loading="outLoading">瀵煎嚭</el-button>
+ </div>
+ </div>
+ <div>
+ <div class="tables" style="margin-top: 16px;">
+ <el-table :data="faultParam" style="width: 100%" height="calc(100vh - 20em)">
+ <!-- 琛ㄦ牸鍒� -->
+ <el-table-column header-align="center" align="center" width="70" prop="prop" label="搴忓彿"
+ type="index"></el-table-column>
+ <el-table-column prop="processNumber" label="娴佺▼缂栧彿" min-width="180"></el-table-column>
+ <el-table-column prop="deviceName" label="璁惧鍚嶇О" min-width="150"></el-table-column>
+ <el-table-column prop="managementNumber" label="缁熶竴缂栧彿" min-width="150"></el-table-column>
+ <el-table-column prop="faultSituation" label="鏁呴殰鎯呭喌" min-width="130"></el-table-column>
+ <el-table-column prop="submitPerson" label="鎻愪氦浜�" min-width="130"></el-table-column>
+ <el-table-column prop="createTime" label="鎻愪氦鏃ユ湡" min-width="150"></el-table-column>
+ <el-table-column prop="currentState" label="褰撳墠鐘舵��" min-width="130"></el-table-column>
+ <el-table-column prop="currentResponsible" label="褰撳墠璐d换浜�" width="180"></el-table-column>
+ <!-- 鎿嶄綔鎸夐挳 -->
+ <el-table-column label="鎿嶄綔" fixed="right" min-width="150">
+ <template slot-scope="scope">
+ <el-button size="small" type="text" @click="showDetailsDialog(scope.row)">鏌ョ湅璇︽儏</el-button>
+ <el-button type="text" size="small" @click="handleDeleteClick(scope.$index, scope.row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="1"
+ style="margin-right: 5%;" :page-sizes="[10, 20, 30, 50, 100]" :page-size="search.size"
+ layout="->,total, sizes, prev, pager, next, jumper" :total="search.total">
+ </el-pagination>
+ </div>
+ </div>
+ <el-dialog title="鏂板缁翠慨璁板綍" top="5vh" :visible.sync="dialogVisible" width="60%" @open="openRecordAcceptance"
+ :close-on-click-modal="false" :close-on-press-escape="false">
+ <el-steps :active="currentStep" finish-status="success" align-center>
+ <el-step v-for="(v, i) in steps" style="cursor:pointer" :title="v" :key="i"
+ @click.native="choiceStep(i)"></el-step>
+ </el-steps>
+ <el-form ref="form" :model="form" label-position="right" label-width="120px">
+ <!-- 鎻愪氦 -->
+ <div v-show="currentStepClick == 0">
+ <el-card style="margin-top: 1em;">
+ <el-row>
+ <el-col :span="24">
+ <el-form-item label="娴佺▼缂栧彿:">
+ <el-input v-model="form.processNumber" size="small" disabled></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璁惧鍚嶇О:">
+ <el-input v-model="form.deviceName" size="small" disabled></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="瑙勬牸鍨嬪彿:">
+ <el-input v-model="form.specificationModel" size="small" disabled></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璁惧缂栧彿:">
+ <el-input v-model="form.managementNumber" size="small" disabled></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍑嗙‘搴﹂噺鍊�:" prop="measureOfAccuracy"
+ :rules="[{ required: currentStep === 0, message: '璇疯緭鍏ュ噯纭害閲忓��', trigger: 'blur' }]">
+ <el-input v-model="form.measureOfAccuracy" size="small" :disabled="currentStep !== 0"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鏁呴殰鏃ユ湡:" prop="faultDate">
+ <el-date-picker v-model="form.faultDate" type="date" placeholder="閫夋嫨鏃ユ湡" size="small"
+ format="yyyy-MM-dd" style="width: 100%" value-format="yyyy-MM-dd" :disabled="currentStep !== 0">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="瑕佹眰淇鏃ユ湡:" prop="requestRepairDate">
+ <el-date-picker v-model="form.requestRepairDate" :picker-options="{ disabledDate: this.disabledDate }"
+ type="date" placeholder="閫夋嫨鏃ユ湡" size="small" format="yyyy-MM-dd" style="width: 100%"
+ value-format="yyyy-MM-dd" :disabled="currentStep !== 0">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="鏁呴殰鎯呭喌:" prop="faultSituation"
+ :rules="[{ required: currentStep === 0, message: '璇疯緭鍏ユ晠闅滄儏鍐�', trigger: 'blur' }]">
+ <el-input v-model="form.faultSituation" type="textarea" size="small"
+ :disabled="currentStep !== 0"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="鐩稿叧闄勪欢:">
+ <el-input v-model="form.fileName" :disabled="true" size="small" style="width: 80%;">
+ <el-button slot="append" icon="el-icon-delete-solid" @click="deleteFile"
+ :disabled="currentStep !== 0"></el-button>
+ </el-input>
+ <el-upload ref="upload" style="float: right;" :action="action" :show-file-list="false"
+ :on-success="handleSuccess">
+ <el-button style="position: relative;top: -4px;" class="uploadFile" slot="trigger" size="small"
+ type="primary" :disabled="currentStep !== 0">闄勪欢涓婁紶
+ </el-button>
+ </el-upload>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="涓嬬幆鑺傝礋璐d汉:" prop="submitNextPesponsible"
+ :rules="[{ required: currentStep === 0, message: '璇疯緭鍏ヤ笅鐜妭璐熻矗浜�', trigger: 'change' }]">
+ <el-select v-model="form.submitNextPesponsible" placeholder="璇烽�夋嫨涓嬬幆鑺傝礋璐d汉" size="small"
+ style="width: 100%" :disabled="currentStep !== 0">
+ <el-option v-for="(v, i) in users" :label="v.name" :value="v.name" :key="i"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-card>
+ <el-row style="margin-top: 1em;">
+ <el-col :span="4">
+ 鎿嶄綔浜猴細{{ form.submitOperatingPersonnel }}
+ </el-col>
+ <el-col :span="6">
+ 鏃ユ湡锛歿{ form.submitDate }}
+ </el-col>
+ </el-row>
+ </div>
+ <!-- 璁惧绠$悊鍛樻剰瑙� -->
+ <div v-show="currentStepClick == 1">
+ <el-card style="margin-top: 1em; height: 45vh; overflow-y: scroll;">
+ <el-row>
+ <el-col :span="24">
+ <el-form-item label="缁翠慨鏂瑰紡鍙婅垂鐢�:" prop="methodCost"
+ :rules="[{ required: currentStep === 1, message: '璇疯緭鍏ョ淮淇柟寮忓強璐圭敤', trigger: 'blur' }]">
+ <el-input v-model="form.methodCost" type="textarea" size="small"
+ :disabled="currentStep !== 1"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="瀹℃牳鎰忚:" prop="adminAuditOption"
+ :rules="[{ required: currentStep === 1, message: '璇疯緭鍏ュ鏍告剰瑙�', trigger: 'blur' }]">
+ <el-input v-model="form.adminAuditOption" type="textarea" size="small"
+ :disabled="currentStep !== 1"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="涓嬬幆鑺傝礋璐d汉:" prop="adminNextPesponsible"
+ :rules="[{ required: currentStep === 1, message: '璇疯緭鍏ヤ笅鐜妭璐熻矗浜�', trigger: 'change' }]">
+ <el-select v-model="form.adminNextPesponsible" placeholder="璇烽�夋嫨涓嬬幆鑺傝礋璐d汉" size="small"
+ style="width: 100%" :disabled="currentStep !== 1">
+ <el-option v-for="(v, i) in users" :label="v.name" :value="v.name" :key="i"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-card>
+ <el-row style="margin-top: 1em;">
+ <el-col :span="4">
+ 鎿嶄綔浜猴細{{ form.adminOperatingPersonnel }}
+ </el-col>
+ <el-col :span="6">
+ 鏃ユ湡锛歿{ form.adminDate }}
+ </el-col>
+ </el-row>
+ </div>
+ <!-- 鎶�鏈礋璐d汉鎰忚 -->
+ <div v-show="currentStepClick == 2">
+ <el-card style="margin-top: 1em; height: 45vh; overflow-y: scroll;">
+ <el-row>
+ <el-col :span="24">
+ <el-form-item label="瀹℃牳鎰忚:" prop="technicalAuditOption"
+ :rules="[{ required: currentStep === 2, message: '璇疯緭鍏ュ鏍告剰瑙�', trigger: 'blur' }]">
+ <el-input v-model="form.technicalAuditOption" type="textarea" size="small"
+ :disabled="currentStep !== 2"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="涓嬬幆鑺傝礋璐d汉:" prop="technicalNextPesponsible"
+ :rules="[{ required: currentStep === 2, message: '璇疯緭鍏ヤ笅鐜妭璐熻矗浜�', trigger: 'change' }]">
+ <el-select v-model="form.technicalNextPesponsible" placeholder="璇烽�夋嫨涓嬬幆鑺傝礋璐d汉" size="small"
+ style="width: 100%" :disabled="currentStep !== 2">
+ <el-option v-for="(v, i) in users" :label="v.name" :value="v.name" :key="i"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-card>
+ <el-row style="margin-top: 1em;">
+ <el-col :span="4">
+ 鎿嶄綔浜猴細{{ form.technicalOperatingPersonnel }}
+ </el-col>
+ <el-col :span="6">
+ 鏃ユ湡锛歿{ form.technicalDate }}
+ </el-col>
+ </el-row>
+ </div>
+ <!-- 缁翠慨鎯呭喌璁板綍 -->
+ <div v-show="currentStepClick == 3">
+ <el-card style="margin-top: 1em; height: 45vh; overflow-y: scroll;">
+ <el-row>
+ <el-col :span="24">
+ <el-form-item label="缁翠慨鎯呭喌:" prop="maintainSituation"
+ :rules="[{ required: currentStep === 3, message: '璇疯緭鍏ョ淮淇儏鍐�', trigger: 'blur' }]">
+ <el-input v-model="form.maintainSituation" type="textarea" size="small"
+ :disabled="currentStep !== 3"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="涓嬬幆鑺傝礋璐d汉:" prop="maintainNextPesponsible"
+ :rules="[{ required: currentStep === 3, message: '璇疯緭鍏ヤ笅鐜妭璐熻矗浜�', trigger: 'change' }]">
+ <el-select v-model="form.maintainNextPesponsible" placeholder="璇烽�夋嫨涓嬬幆鑺傝礋璐d汉" size="small"
+ style="width: 100%" :disabled="currentStep !== 3">
+ <el-option v-for="(v, i) in users" :label="v.name" :value="v.name" :key="i"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-card>
+ <el-row style="margin-top: 1em;">
+ <el-col :span="4">
+ 鎿嶄綔浜猴細{{ form.maintainOperatingPersonnel }}
+ </el-col>
+ <el-col :span="6">
+ 鏃ユ湡锛歿{ form.maintainDate }}
+ </el-col>
+ </el-row>
+ </div>
+ <!-- 缁翠慨鍚庣殑纭 -->
+ <div v-show="currentStepClick == 4">
+ <el-card style="margin-top: 1em; height: 45vh; overflow-y: scroll;">
+ <el-row>
+ <el-col :span="24">
+ <el-form-item label="楠屾敹銆佺‘璁ゃ�佹牎鍑嗘儏鍐�:" prop="checkCalSituation" label-width="200"
+ :rules="[{ required: currentStep === 4, message: '璇疯緭鍏ラ獙鏀躲�佺‘璁ゃ�佹牎鍑嗘儏鍐�', trigger: 'blur' }]">
+ <el-input v-model="form.checkCalSituation" type="textarea" size="small" style="width: 100%"
+ :disabled="currentStep !== 4"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-card>
+ <el-row style="margin-top: 1em;">
+ <el-col :span="4">
+ 鎿嶄綔浜猴細{{ form.afterMaintenanceOperatingPersonnel }}
+ </el-col>
+ <el-col :span="6">
+ 鏃ユ湡锛歿{ form.afterMaintenanceDate }}
+ </el-col>
+ </el-row>
+ </div>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="submitForm('3reject')" v-if="currentStep !== 0 && currentStep !== 5"
+ :loading="sumbitLoading1">椹冲洖</el-button>
+ <el-button @click="submitForm('2save')" v-if="currentStep === 0" :loading="sumbitLoading2">淇濆瓨</el-button>
+ <el-button type="primary" v-if="currentStep !== 5" @click="submitForm('1submit')" :loading="sumbitLoading3">
+ {{ currentStep === 0 ? '鎻愪氦' : '閫氳繃' }}
+ </el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import { dateFormat } from '@/utils/date'
+import { mapGetters } from "vuex";
+import {
+ addOrUpdateDeviceFaultOne,
+ deleteCNASFile, deleteDeviceFaultOne,
+ deviceFaultOnePage, exportRewardAndPunishmentRecords,
+ selectDeviceByCode
+} from "@/api/cnas/resourceDemand/device";
+import {selectUserCondition} from "@/api/system/user";
+export default {
+ props: {
+ clickNodeVal: {
+ type: Object,
+ default: () => {
+ }
+ }
+ },
+ data() {
+ return {
+ search: {
+ size: 20,
+ current: 1,
+ total: 0,
+ processNumber: ''
+ },
+ users: [],
+ currentStep: 0,
+ currentStepClick: 0,
+ steps: ['鎻愪氦', '璁惧绠$悊鍛樻剰瑙�', '鎶�鏈礋璐d汉鎰忚', '缁翠慨鎯呭喌璁板綍', '缁翠慨鍚庣殑纭'],
+ outLoading: false,
+ form: {},
+ faultParam: [],
+ dialogVisible: false,
+ sumbitLoading1: false,
+ sumbitLoading2: false,
+ sumbitLoading3: false,
+ }
+ },
+ computed: {
+ ...mapGetters(["nickName"]),
+ action() {
+ return this.javaApi + '/personBasicInfo/saveCNASFile'
+ }
+ },
+ mounted() {
+ this.getTableList(this.clickNodeVal.value)
+ },
+ methods: {
+ //瑕佹眰淇鏃ユ湡:绂佺敤鍦ㄦ晠闅滄棩鏈熷墠鐨勬棩鏈�
+ disabledDate(time) {
+ let selectDate = this.form.faultDate
+ if (selectDate) {
+ let selectTime = new Date(selectDate).getTime() - 28800000
+ return time < selectTime
+ }
+ return false
+ },
+ //鎻愪氦琛ㄥ崟
+ async submitForm(saveState) {
+ let currentStepAction;
+ // 璁剧疆璇ユ搷浣滃垽鏂槸鍚︿负鎻愪氦锛屼繚瀛橈紝椹冲洖锛岄�氳繃 寮�鍚痩oding
+ switch (saveState) {
+ // 鎻愪氦锛岄�氳繃
+ case '1submit':
+ currentStepAction = this.currentStep + 1
+ this.sumbitLoading1 = true
+ break
+ // 淇濆瓨
+ case '2save':
+ currentStepAction = this.currentStep
+ this.sumbitLoading2 = true
+ break
+ // 椹冲洖
+ case '3reject':
+ currentStepAction = this.currentStep - 1
+ this.sumbitLoading3 = true
+ break
+ default:
+ break
+ }
+ this.$refs.form.validate((valid) => {
+ if (valid === true || saveState !== '1submit') {
+ // 缁欏綋鍓嶇幆鑺傝缃垱寤轰汉涓庢椂闂�
+ const dateTime = dateFormat(new Date())
+ // 鑾峰彇褰撳墠鐜妭鎿嶄綔浜轰笌鏃ユ湡
+ switch (this.currentStep) {
+ case 0:
+ this.form.submitUser = this.nickName
+ this.form.submitOperatingPersonnel = this.nickName
+ this.form.submitDate = dateTime
+ break
+ case 1:
+ this.form.adminOperatingPersonnel = this.nickName
+ this.form.adminDate = dateTime
+ break
+ case 2:
+ this.form.technicalOperatingPersonnel = this.nickName
+ this.form.technicalDate = dateTime
+ break
+ case 3:
+ this.form.maintainOperatingPersonnel = this.nickName
+ this.form.maintainDate = dateTime
+ break
+ case 4:
+ this.form.afterMaintenanceOperatingPersonnel = this.nickName
+ this.form.afterMaintenanceDate = dateTime
+ break
+ default:
+ break
+ }
+ // 鑾峰彇褰撳墠鐜妭璐熻矗浜�
+ switch (saveState === '3reject' ? this.currentStep - 1 : this.currentStep) {
+ case 0:
+ this.form.currentResponsible = this.form.submitOperatingPersonnel
+ break
+ case 1:
+ this.form.currentResponsible = this.form.departmentOperatingPersonnel
+ break
+ case 2:
+ this.form.currentResponsible = this.form.measuringRoomOperatingPersonnel
+ break
+ case 3:
+ this.form.currentResponsible = this.form.approvalOperatingPersonnel
+ break
+ default:
+ break
+ }
+ // 鑾峰彇褰撳墠鐘舵��
+ this.form.currentState = currentStepAction === 5 ? '鍏抽棴' : this.steps[currentStepAction]
+ this.form.deviceId = this.clickNodeVal.value
+ addOrUpdateDeviceFaultOne(this.form).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鎻愪氦鎴愬姛')
+ this.getTableList(this.clickNodeVal.value)
+ this.dialogVisible = false
+ }
+ this.closeLoading()
+ })
+ } else {
+ let step = this.steps[this.currentStep]
+ this.$message.warning(step + ' 娴佺▼涓湁蹇呭~椤规湭濉紒');
+ this.closeLoading()
+ }
+ });
+ },
+ closeLoading() {
+ this.sumbitLoading1 = false
+ this.sumbitLoading2 = false
+ this.sumbitLoading3 = false
+ },
+ openRecordAcceptance() {
+ // 鑾峰彇璁惧鍩虹淇℃伅
+ selectDeviceByCode({id: this.clickNodeVal.value}).then(res => {
+ this.form.deviceName = res.data.deviceName
+ this.form.manufacturer = res.data.manufacturer
+ this.form.specificationModel = res.data.specificationModel
+ this.form.managementNumber = res.data.managementNumber
+ });
+ // 鑾峰彇璐熻矗浜轰俊鎭�
+ this.getUserList()
+ },
+ // 鑾峰彇璐熻矗浜轰俊鎭帴鍙�
+ getUserList() {
+ selectUserCondition().then((res) => {
+ this.users = res.data;
+ });
+ },
+ handleSizeChange(val) {
+ this.search.size = val
+ this.getTableList(this.clickNodeVal.value);
+ },
+ handleCurrentChange(val) {
+ this.search.current = val
+ this.getTableList(this.clickNodeVal.value);
+ },
+ deleteFile() {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ枃浠�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deleteCNASFile({fileName: this.form.systemFileName}).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鍒犻櫎鎴愬姛锛�')
+ }
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
+ },
+ choiceStep(index) {
+ this.currentStepClick = index
+ },
+ //鏂囨。
+ handleSuccess(response, file, fileList) {
+ if (response.code == 200) {
+ this.form.fileName = response.data
+ this.$message.success('涓婁紶鎴愬姛')
+ } else {
+ this.$message.error(response.msg)
+ }
+ },
+ onError(error, file, fileList) {
+ // 鏂囦欢涓婁紶澶辫触鏃剁殑澶勭悊閫昏緫
+ this.$message.error('涓婁紶澶辫触')
+ this.$refs.upload.clearFiles()
+ },
+ beforeUpload(file) {
+ if (file.size > 1024 * 1024 * 10) {
+ this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M');
+ this.$refs.upload.clearFiles()
+ return false;
+ } else {
+ return true;
+ }
+ },
+ resetSearch() {
+ this.search = {
+ size: 20,
+ current: 1,
+ total: 0,
+ processNumber: '',
+ }
+ this.getTableList(this.clickNodeVal.value);
+ },
+ //鑾峰彇鎵�鏈変俊鎭�
+ getTableList(deviceId) {
+ const params = {
+ deviceId: deviceId,
+ size: this.search.size,
+ current: this.search.current,
+ processNumber: this.search.processNumber,
+ }
+ deviceFaultOnePage(params).then(res => {
+ if (res.code == 200) {
+ this.faultParam = res.data.records
+ this.search.total = res.data.total
+ }
+ })
+ },
+ //瀵煎嚭
+ handleDown() {
+ this.outLoading = true
+ exportRewardAndPunishmentRecords({deviceId: this.clickNodeVal.value}).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/octet-stream' });
+ this.$dowmload.saveAs(blob, '璁惧鏁呴殰琛�.xlsx')
+ })
+ },
+ selectAllByOne(row) {
+ this.dialogVisible = true;
+ this.formData = this.HaveJson(row);
+ },
+ //娣诲姞璁板綍鎸夐挳
+ addRecode() {
+ this.currentStep = 0;
+ this.currentStepClick = 0;
+ },
+ //鏌ョ湅璇︽儏
+ showDetailsDialog(row) {
+ this.form = { ...row }
+ this.currentStep = this.steps.indexOf(this.form.currentState) === -1 ? 5 : this.steps.indexOf(this.form.currentState)
+ this.currentStepClick = this.currentStep === 5 ? 0 : this.currentStep
+ this.$nextTick(() => {
+ this.$refs['form'].clearValidate()
+ })
+ this.dialogVisible = true
+ },
+ //鍒犻櫎鎿嶄綔
+ handleDeleteClick(index, row) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deleteDeviceFaultOne({id: row.id}).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鍒犻櫎鎴愬姛')
+ this.getTableList(this.clickNodeVal.value)
+ }
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
+ },
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ clickNodeVal(newVal) {
+ if (newVal.value) {
+ this.getTableList(newVal.value);
+ }
+ },
+ dialogVisible(newVal) {
+ if (!newVal) {
+ this.form = {}
+ this.closeLoading()
+ this.currentStep = 0 // 姝ラ鏉℃樉绀虹鍑犳
+ this.currentStepClick = 0 // 鐐瑰嚮姝ラ鏉″彉鍖�
+ this.$refs['form'].clearValidate()
+ }
+ }
+ }
+}
+</script>
+
+<style scoped>
+h4 {
+ font-weight: 400;
+ font-size: 16px;
+ /* display: flex;
+ justify-content: space-between; */
+ margin: 10px 0;
+}
+
+/*
+淇濆瓨鎻愪氦鎸夐挳鏍峰紡
+*/
+h4 .title {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+h4 .title .line {
+ display: inline-block;
+ width: 3px;
+ height: 16px;
+ background: #3A7BFA;
+ margin-right: 4px;
+}
+
+.tables {
+ width: 100%;
+ height: calc(100vh - 230px);
+}
+
+.el-from {
+ max-width: 400px;
+ margin: 0 auto;
+}
+
+.form-row {
+ display: flex;
+ justify-content: space-between;
+}
+
+.dialogBottom {
+ margin-top: 14px;
+ display: flex;
+ justify-content: space-between;
+}
+
+.form-operation {
+ display: flex;
+ justify-content: center;
+}
+
+.form-item {
+ display: flex;
+ margin-right: 100px;
+}
+
+.label {
+ margin-right: 20px;
+ line-height: 40px;
+}
+
+.value {
+ font-weight: normal;
+ line-height: 40px;
+}
+
+.form-row .el-form-item {
+ flex: 1;
+ /* 姣忎釜琛ㄥ崟椤瑰崰鎹浉鍚屾瘮渚嬬殑绌洪棿 */
+ margin-right: 100px;
+ /* 鍙�夛細涓哄彸渚у厓绱犳坊鍔犻棿璺� */
+}
+
+.search {
+ background-color: #fff;
+ height: 40px;
+ display: flex;
+ align-items: center;
+ position: relative;
+}
+
+.search_thing {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ height: 40px;
+}
+
+.search_label {
+ width: 70px;
+ font-size: 14px;
+ text-align: right;
+}
+
+.search_input {
+ width: calc(100% - 120px);
+}
+
+.btns {
+ position: absolute;
+ right: 0px;
+ top: 50%;
+ transform: translate(0, -50%);
+}
+
+.form .search_label {
+ width: 120px;
+}
+</style>
diff --git a/src/views/CNAS/resourceDemand/device/component/files.vue b/src/views/CNAS/resourceDemand/device/component/files.vue
new file mode 100644
index 0000000..1850918
--- /dev/null
+++ b/src/views/CNAS/resourceDemand/device/component/files.vue
@@ -0,0 +1,1141 @@
+<!-- 璁惧妗f -->
+<template>
+ <div class="page">
+ <div class="page-header">
+ <h4><span class="line"></span><span>璁惧妗f</span></h4>
+ <div class="btns">
+ <el-button type="primary" size="small" @click="openEditForm" style="">淇妗f</el-button>
+ <el-button type="primary" size="small" @click="dialogVisible1 = true" style="">娣诲姞闄勪欢</el-button>
+ <el-button type="primary" size="small" @click="deviceDialog = true" style="">鏌ョ湅璁惧浜岀淮鐮�</el-button>
+<!-- <el-button type="primary" size="small" @click="handleDownOne" style="">瀵煎嚭</el-button>-->
+ </div>
+ </div>
+ <el-divider></el-divider>
+ <div class="main_div">
+ <el-row :gutter="20">
+ <el-col :span="6">
+ <!-- 鍔犳椂闂存埑閬垮厤娴忚鍣ㄧ紦瀛橀棶棰� -->
+ <el-image :src="`${javaApi}/img/${Mdata.imageUpload}`" fit="fill" :key="'personalPicture' + timeStamp"
+ style="width: 200px;height: 300px;border: 1px solid #000;border-radius: 10px;margin-left: 30px;margin-top: 20px;">
+ <div slot="error" class="image-slot">
+ <i class="el-icon-picture-outline" style="font-size: 40px;"></i>
+ </div>
+ </el-image>
+ </el-col>
+ <el-col :span="8">
+ <div class="form-item">
+ <label>璁惧鍚嶇О</label>
+ <!-- <p>{{ Mdata.deviceName }}</p> -->
+ <el-tooltip
+ class="item"
+ :content="Mdata.deviceName"
+ >
+ <span class="text-ellipsis" >{{ Mdata.deviceName }}</span>
+ </el-tooltip>
+ </div>
+ <div class="form-item">
+ <label>璁惧绫诲瀷</label>
+ <p>{{ Mdata.largeCategory }}</p>
+ </div>
+
+ <div class="form-item">
+ <label>绠$悊缂栧彿</label>
+ <p>{{ Mdata.managementNumber }}</p>
+ </div>
+ <div class="form-item">
+ <label>鎵�灞為儴闂�</label>
+ <p>{{ Mdata.laboratoryName }}</p>
+ </div>
+ <div class="form-item">
+ <label>鐢熶骇鍘傚</label>
+ <!-- <p>{{ Mdata.manufacturer }}</p> -->
+ <el-tooltip
+ class="item"
+ :content="Mdata.manufacturer"
+ >
+ <span class="text-ellipsis" >{{ Mdata.manufacturer }}</span>
+ </el-tooltip>
+ </div>
+ <div class="form-item">
+ <label>璧勪骇缂栫爜</label>
+ <p class="text-ellipsis">{{ Mdata.assetCode }}</p>
+ </div>
+
+ <div class="form-item">
+ <label>鍑哄巶鏃ユ湡</label>
+ <p>{{ Mdata.acquisitionDate | formaterDateTime }}</p>
+ </div>
+ <div class="form-item">
+ <label>鍚敤鏃ユ湡</label>
+ <p>{{ Mdata.activationDate | formaterDateTime }}</p>
+ </div>
+ <div class="form-item">
+ <label>鏍稿噯鍛ㄦ湡(鏈�)</label>
+ <p>{{ Mdata.calibrationDate }}</p>
+ </div>
+
+ <div class="form-item">
+ <label>鎶ュ簾鏃堕棿</label>
+ <p>{{ handleData() }}</p>
+ </div>
+ <div class="form-item">
+ <label>鍑嗙‘搴﹂噺鍊�</label>
+ <el-tooltip
+ class="item"
+ :content="Mdata.technicalIndicators"
+ >
+ <span class="text-ellipsis">{{ Mdata.technicalIndicators }}</span>
+ </el-tooltip>
+ <!-- <p>{{ Mdata.technicalIndicators }}</p> -->
+ </div>
+ <div class="form-item">
+ <label>缁翠慨璁板綍</label>
+ <p>{{ handleData() }}</p>
+ </div>
+ <div class="form-item">
+ <label>琚巿鏉冧汉</label>
+ <p>{{ Mdata.authorizedPersonName }}</p>
+ </div>
+
+ </el-col>
+ <el-col :span="10">
+ <div class="form-item">
+ <label>瑙勬牸鍨嬪彿</label>
+ <p>{{ Mdata.specificationModel }}</p>
+ </div>
+ <!-- <div class="form-item">
+ <label>缁嗙被</label>
+ <p>{{ handleData() }}</p>
+ </div> -->
+ <div class="form-item">
+ <label>鍑哄巶缂栧彿</label>
+ <p>{{ Mdata.factoryNo }}</p>
+ </div>
+ <div class="form-items">
+ <label>璁惧鐘舵��</label>
+ <el-radio-group v-model="Mdata.deviceStatus" style="margin-left: 10px;">
+ <el-radio :label="0" :disabled="Mdata.deviceStatus != 0">姝e父</el-radio>
+ <el-radio :label="1" :disabled="Mdata.deviceStatus != 1">缁翠慨</el-radio>
+ <el-radio :label="2" :disabled="Mdata.deviceStatus != 2">鍋滅敤</el-radio>
+ <el-radio :label="3" :disabled="Mdata.deviceStatus != 3">鎶ュ簾</el-radio>
+ </el-radio-group>
+ </div>
+ <div class="form-item">
+ <label>瀛樻斁鐐�</label>
+ <p>{{ Mdata.storagePoint }}</p>
+ </div>
+ <div class="form-item">
+ <label>浜у湴</label>
+ <p>{{ Mdata.origin }}</p>
+ </div>
+ <div class="form-item">
+ <label>妫�楠岄」</label>
+ <el-tooltip
+ class="item"
+ effect="dark"
+ :content="Mdata.insProductItem"
+ placement="top"
+ >
+ <span class="text-ellipsis" >{{ Mdata.insProductItem }}</span>
+ </el-tooltip>
+ </div>
+ <div class="form-item">
+ <label>璐疆鏃ユ湡</label>
+ <p>{{ Mdata.acquisitionDate | formaterDateTime }}</p>
+ </div>
+
+ <div class="form-item">
+ <label>鏈�杩戞函婧愭棩鏈�</label>
+ <p>{{ Mdata.lastCalibrationDate | formaterDateTime }}</p>
+ </div>
+ <div class="form-item">
+ <label>閲囪喘璐圭敤(鍏�)</label>
+ <p>{{ Mdata.unitPrice }}</p>
+ </div>
+ <div class="form-item">
+ <label>鍋滅敤鏃堕棿</label>
+ <p>{{ Mdata.nextCalibrationDate | formaterDateTime }}</p>
+ </div>
+ <div class="form-item">
+ <label>璁惧璐熻矗浜�</label>
+ <p>{{ Mdata.equipmentManagerName }}</p>
+ </div>
+ <div class="form-item">
+ <label>楠屾敹璁板綍</label>
+ <p>{{ handleData() }}</p>
+ </div>
+ <div class="form-item">
+ <label>鏍稿噯璇佷功</label>
+ <p>{{ Mdata.calibrateNo }}</p>
+ </div>
+ </el-col>
+ </el-row>
+ <h4 style="margin-bottom: 10px;margin-top: 10px;"><span class="line"></span><span>闄勪欢鍜岀浉鍏虫枃妗�</span></h4>
+ <el-table height="200px" :data="tableDataA">
+ <el-table-column header-align="center" align="center" prop="prop" label="搴忓彿" type="index" width="60" />
+ <el-table-column prop="documentType" label="绫诲瀷" min-width="100">
+ <template v-slot="scope">
+ {{ scope.row.documentType === '0' ? '闄勪欢' : scope.row.documentType === '1' ? '鏂囨。' : '' }}
+ </template>
+ </el-table-column>
+ <el-table-column prop="name" label="鍚嶇О" min-width="150" />
+ <el-table-column prop="number" label="缂栧彿" min-width="150" />
+ <el-table-column prop="version" label="鐗堟湰" min-width="80" />
+ <el-table-column prop="quantity" label="浠芥暟" min-width="80" />
+ <el-table-column prop="pageCount" label="椤电爜" min-width="80" />
+ <el-table-column prop="provider" label="鎻愪緵鑰�" min-width="150" />
+ <el-table-column prop="provideDate" label="鎻愪緵鏃ユ湡" min-width="150" />
+ <el-table-column prop="comments" label="澶囨敞" min-width="150" />
+ <el-table-column fixed="right" label="鎿嶄綔" min-width="180">
+ <template slot-scope="scope">
+ <el-button type="text" size="small" @click="handleAttachmentClick(scope.row)">涓嬭浇闄勪欢</el-button>
+ <el-button type="text" size="small" @click="handleViewClick(scope.row)">鏌ョ湅</el-button>
+ <el-button type="text" size="small" @click="handleDeleteClick(scope.row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ <!-- 淇 -->
+ <el-dialog title="淇妗f" top="5vh" :visible.sync="dialogVisible" width="70%" @open="openFileRevisionDialog"
+ :before-close="handleClose">
+ <el-row style="display:flex;justify-content: space-around;">
+ <!-- 宸﹁竟甯冨眬 -->
+ <el-col :span="7">
+ <el-col>
+ <!-- 鍥剧墖 -->
+ <el-image class="img" style="width:100%;height: 320px;margin-bottom:16px"
+ :src="javaApi + '/img/' + editData.imageUpload">
+ <div slot="error" class="image-error" style="width: calc(100% - 2px);
+ height: 318px;
+ border-radius: 16px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: 1px solid #EEEEEE;">
+ <i class="el-icon-picture-outline" style="font-size:60px;color:#666666;"></i>
+ </div>
+ </el-image>
+ <!-- 琛ㄥ崟 -->
+ <el-form :model="editData" label-width="120px" ref="rules1" :rules="rules1">
+ <el-form-item label="浠櫒鍚嶇О:" prop="deviceName">
+ <el-input v-model="editData.deviceName" size="small"></el-input>
+ </el-form-item>
+ <el-form-item label="浠櫒鍚嶇ОEN:" prop="enDeviceName">
+ <el-input v-model="editData.enDeviceName" size="small"></el-input>
+ </el-form-item>
+ <el-form-item label="瑙勬牸鍨嬪彿:" prop="specificationModel">
+ <el-input v-model="editData.specificationModel" size="small"></el-input>
+ </el-form-item>
+ <el-form-item label="鐢熶骇鍘傚:">
+ <el-input v-model="editData.manufacturer" size="small"></el-input>
+ </el-form-item>
+ </el-form>
+ </el-col>
+ </el-col>
+ <!-- 涓棿甯冨眬 -->
+ <el-col :span="7">
+ <el-form :model="editData" label-width="116px" ref="rules2" :rules="rules1">
+ <el-form-item label="鏍″噯鏈嶅姟鏈烘瀯:">
+ <el-input v-model="editData.calibrationServices" disabled size="small"></el-input>
+ </el-form-item>
+ <el-form-item label="璧勪骇缂栫爜:">
+ <el-input v-model="editData.assetCode" size="small"></el-input>
+ </el-form-item>
+ <el-form-item label="浜у湴:">
+ <el-input v-model="editData.origin" size="small"></el-input>
+ </el-form-item>
+ <el-form-item label="鍑哄巶缂栧彿:">
+ <el-input v-model="editData.factoryNo" size="small"></el-input>
+ </el-form-item>
+ <el-form-item label="绠$悊缂栧彿:" prop="managementNumber">
+ <el-input v-model="editData.managementNumber" size="small"></el-input>
+ </el-form-item>
+ <el-form-item label="璐疆鏃ユ湡:">
+ <el-date-picker style="width:100%" v-model="editData.acquisitionDate" type="date" format="yyyy-MM-dd"
+ value-format="yyyy-MM-dd HH:mm:ss" size="small" placeholder="閫夋嫨鏃ユ湡">
+ </el-date-picker>
+ </el-form-item>
+ <el-form-item label="鍚敤鏃ユ湡:" prop="activationDate">
+ <el-date-picker style="width:100%" v-model="editData.activationDate" type="date" format="yyyy-MM-dd"
+ value-format="yyyy-MM-dd HH:mm:ss" size="small" placeholder="閫夋嫨鏃ユ湡">
+ </el-date-picker>
+ </el-form-item>
+ <el-form-item label="璐熻矗浜�:">
+ <el-select v-model="editData.equipmentManager" placeholder="璇烽�夋嫨" size="small" style="width:100%">
+ <el-option v-for="item in responsiblePersonList" :key="item.name" :label="item.name" :value="item.id">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="瀛樻斁鐐�:">
+ <el-input v-model="editData.storagePoint" size="small"></el-input>
+ </el-form-item>
+ <el-form-item label="鎶�鏈寚鏍�:">
+ <el-input v-model="editData.technicalIndicators" :rows="7" type="textarea" size="small"></el-input>
+ </el-form-item>
+ </el-form>
+ </el-col>
+ <!-- 鍙宠竟甯冨眬 -->
+ <el-col :span="7">
+ <el-form :model="editData" label-width="140px" ref="ruleForm" :rules="rules1">
+ <!-- 瀹為獙瀹ゅ垪琛� -->
+ <el-form-item label="鎵�灞為儴闂�:">
+ <el-select v-model="editData.subordinateDepartmentsId" placeholder="璇烽�夋嫨" size="small" style="width:100%">
+ <el-option v-for="item in subordinateDepartmentsList" :key="item.value" :label="item.label"
+ :value="item.value">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="妫�娴嬮」鐩�:">
+ <el-cascader v-model="editData.insProductIds" :options="options" :show-all-levels="false" :props="props"
+ placeholder="璇烽�夋嫨" size="small" style="width:100%;" :collapse-tags="true" separator="," filterable
+ clearable></el-cascader>
+ </el-form-item>
+ <!-- <el-form-item label="鏈�杩戞牎鍑嗘棩鏈�:">
+ <el-date-picker style="width:100%" v-model="Mdata.latestTraceability" format="yyyy-MM-dd"
+ value-format="yyyy-MM-dd" type="date" size="small" placeholder="閫夋嫨鏃ユ湡">
+ </el-date-picker>
+ </el-form-item> -->
+ <!-- <el-form-item label="涓嬫鏍″噯鏃ユ湡:">
+ <el-date-picker style="width:100%" v-model="Mdata.nextCalibrationDate" format="yyyy-MM-dd"
+ value-format="yyyy-MM-dd HH:mm:ss" type="date" size="small" placeholder="閫夋嫨鏃ユ湡">
+ </el-date-picker>
+ </el-form-item> -->
+ <el-form-item label="璁惧绫诲瀷:">
+ <el-select v-model="editData.largeCategory" placeholder="璇烽�夋嫨" size="small" style="width:100%">
+ <el-option v-for="item in equipmentList" :key="item.value" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鍗曚环(涓囧厓):">
+ <el-input v-model="editData.unitPrice" size="small"></el-input>
+ </el-form-item>
+ <el-form-item label="褰撳墠鐘舵��:" prop="deviceStatus">
+ <el-select v-model="editData.deviceStatus" placeholder="璇烽�夋嫨" size="small" style="width:100%">
+ <el-option v-for="item in deviceStatusList" :key="item.value" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鏍″噯鍛ㄦ湡锛堟湀锛�:" prop="calibrationDate">
+ <el-input v-model="editData.calibrationDate" size="small"></el-input>
+ </el-form-item>
+ <el-form-item label="琚巿鏉冧汉:">
+ <el-select v-model="editData.authorizedPerson" multiple placeholder="璇烽�夋嫨" size="small" style="width:100%">
+ <el-option v-for="item in responsiblePersonList" :key="item.name" :label="item.name" :value="item.id">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鍥剧墖:">
+ <!-- <div
+ style="border: 1px solid #DCDFE6;border-radius:4px;height:32px;lineHeight:32px;display:flex;justify-content: space-around;font-size: 13px;">
+ <div v-show="Mdata.imageName" class="picName">{{ Mdata.imageName }}</div>
+ <el-upload :action="action" :on-success="handleSuccessUpImg2" :show-file-list="false"
+ accept='image/jpg,image/jpeg,image/png' :headers="headers" :on-change="beforeUpload"
+ :on-error="onError" ref='upload'>
+ <el-button type="text" style="height:30px;padding-top:8px"><span v-if="Mdata.imageName"></span></el-button>
+ </el-upload>
+ </div> -->
+
+ <div>
+ <div v-show="editData.imageName" class="picName">{{ editData.imageName }}</div>
+ <el-upload :action="action" :on-success="handleSuccessUpImg2" :show-file-list="false"
+ accept='image/jpg,image/jpeg,image/png' :headers="uploadHeader" :on-change="beforeUpload"
+ :on-error="onError" ref='upload' class="avatar-uploader"
+ >
+ <img v-if="editData.imageUpload" :src="javaApi + '/img/' + editData.imageUpload" class="avatar">
+ <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+ </el-upload>
+ </div>
+ </el-form-item>
+ </el-form>
+ </el-col>
+ </el-row>
+ <span slot="footer" class="dialog-footer">
+ <el-row>
+ <el-button @click="handleClose">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitForm" :loading="upLoad">纭� 瀹�</el-button>
+ </el-row>
+ </span>
+ </el-dialog>
+ <el-dialog title="娣诲姞璁惧闄勪欢" top="5vh" v-if="dialogVisible1" :visible.sync="dialogVisible1" width="40%">
+ <el-form ref="form" :model="addFile" label-width="120px">
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="缁存姢绫诲瀷锛�">
+ <el-radio-group v-model="addFile.documentType">
+ <el-radio :label="0">闄勪欢</el-radio>
+ <el-radio :label="1">鏂囨。</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="妗f鍚嶇О锛�">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addFile.name"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="搴撳彿/璧勪骇缂栧彿:">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addFile.number"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鐗堟湰锛�">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addFile.version"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="浠芥暟锛�">
+ <el-input-number v-model="addFile.quantity" controls-position="right" style="width: 100%;" size="small"
+ :min="0" :max="10"></el-input-number>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="椤电爜锛�">
+ <el-input-number v-model="addFile.pageCount" controls-position="right" style="width: 100%;" size="small"
+ :min="0" :max="10"></el-input-number>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鎻愪緵鑰咃細">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addFile.provider"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="褰掓。鏃ユ湡锛�">
+ <el-date-picker type="date" style="width:100%" placeholder="璇烽�夋嫨鏃ユ湡" size="small" v-model="addFile.archiveDate"
+ format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="澶囨敞锛�">
+ <el-input type="textarea" :rows="2" size="small" v-model="addFile.comments"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="闄勪欢锛�" style="float: left;">
+ <el-upload class="upload-demo" :action="action" :headers="uploadHeader" ref="uploadFile" :on-error="onError"
+ :on-remove="handleRemove" :on-success="onSuccess" :before-remove="beforeRemove" multiple :limit="1"
+ :on-exceed="handleExceed" :file-list="fileList">
+ <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
+ </el-upload>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-row>
+ <el-button @click="dialogVisible1 = false" size="small">鍙� 娑�</el-button>
+ <el-button type="primary" @click="saveRecord" size="small" :loading="isLoading">{{ isAddFileUpdate == true ?
+ '鏇存柊' :
+ '纭� 瀹�' }}</el-button>
+ </el-row>
+ </span>
+ </el-dialog>
+ <el-dialog title="璁惧浜岀淮鐮�" :visible.sync="deviceDialog" top="5vh" width="30%">
+ <div style="width:90%;text-align: right;">
+ <el-button type="primary" size="mini" @click="clickGeneratePicture">涓嬭浇鍥剧墖</el-button>
+ <el-button type="primary" size="mini" @click="labelPrint">鏍囩鎵撳嵃</el-button>
+ </div>
+ <div class="device-main" ref="deviceQrCode" id="deviceCode">
+ <div class="device-center">
+ <p class="device-title">{{ Mdata.deviceName }}</p>
+ <div class="device-footer">
+ <div>
+ <vueQr class="qr-code"
+ :text="'https://zttx-lims.ztt.cn:8021/lims/qr/qrScan?code=' + Mdata.managementNumber + '&type=device'"
+ :size="200" :margin="10"></vueQr>
+ </div>
+ <div class="device-number">
+ <span class="device-text">璁惧缂栫爜:</span>
+ <span class="device-text">{{ Mdata.managementNumber }}</span>
+ </div>
+ <div class="device-name">
+ <span class="device-text">璁惧鍨嬪彿:</span>
+ <span class="device-text">{{ Mdata.specificationModel }}</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import { MessageBox } from 'element-ui'
+import fileDownload from '@/utils/file'
+import vueQr from 'vue-qr'
+import PrintJS from 'print-js'
+import domtoimage from 'dom-to-image';
+import {
+ deleteCNASFile,
+ updateDocument,
+ addDocument,
+ deleteDocumentById,
+ selectDeviceByCode,
+ upDeviceParameter,
+ exportDeviceFile,
+ getInsProduction, getListByDId,
+} from '@/api/cnas/resourceDemand/device.js'
+import { selectUserCondition } from "@/api/system/user";
+import {
+ obtainItemParameterList,
+} from '@/api/cnas/resourceDemand/device.js'
+export default {
+ filters: {
+ formaterDateTime(dateTime) {
+ if (dateTime === undefined || dateTime === null || dateTime === '') {
+ return dateTime
+ }
+ return dateTime.split(" ")[0]
+ }
+ },
+ props: {
+ clickNodeVal: {
+ type: Object,
+ default: () => {
+ return {};
+ }
+ }
+ },
+ components: {
+ vueQr
+ },
+ data() {
+ return {
+ deviceDialog: false,//鏌ョ湅璁惧浜岀淮鐮佸脊妗�
+ rules1: {
+ deviceName: [
+ { required: true, message: '璇疯緭鍏ヤ华鍣ㄥ悕绉�', trigger: 'blur' },
+ ],
+ enDeviceName: [
+ { required: true, message: '璇疯緭鍏ヤ华鍣ㄥ悕绉癊N', trigger: 'blur' },
+ ],
+ specificationModel: [
+ { required: true, message: '璇疯緭鍏ヨ鏍煎瀷鍙�', trigger: 'blur' },
+ ],
+ managementNumber: [
+ { required: true, message: '璇疯緭鍏ョ鐞嗙紪鍙�', trigger: 'blur' },
+ ],
+ activationDate: [
+ { required: true, message: '璇疯緭鍏ユ牎鍑嗘湁鏁堟湡', trigger: 'blur' },
+ ],
+ deviceStatus: [
+ { required: true, message: '璇疯緭鍏ュ綋鍓嶇姸鎬�', trigger: 'blur' },
+ ],
+ calibrationDate: [
+ { required: true, message: '璇疯緭鍏ユ牎鍑嗗懆鏈�(鏈�)', trigger: 'blur' },
+ ],
+ subordinateDepartmentsId: [
+ { required: true, message: '璇烽�夋嫨鎵�灞為儴闂�', trigger: 'change' },
+ ]
+ },
+ // dateForm: {
+
+ // },
+ fileList: [], // 娣诲姞闄勪欢涓婁紶鏂囦欢鍒楄〃
+ timeStamp: '', // 缁欏浘鐗囨坊鍔爇ey锛屽湪姣忔鍔犺浇椤甸潰鐨勬椂鍊欐柊寤烘椂闂存埑
+ equipmentManager: [],
+ formLabelWidth: '100px',
+ dialogVisible1: false,
+ recordNumber: '',
+ inLoading: false, // 鎺у埗涓婁紶鎸夐挳鍔犺浇鐘舵��
+ isLoading: false, // 鎺у埗纭畾鎸夐挳鍔犺浇鐘舵��
+ formData: {},
+ tableDataA: [],
+ num: 1,
+ //娣诲姞闄勪欢鏁版嵁鏀堕泦
+ addFile: {
+ documentType: '', // 缁存姢绫诲瀷
+ provideDate: null, // 褰掓。鏃ユ湡
+ name: '', // 妗f鍚嶇О
+ number: '', // 搴撳彿/璧勪骇缂栧彿
+ version: '', // 鐗堟湰
+ quantity: 1, // 浠芥暟
+ pageCount: 1, // 椤电爜
+ provider: '', // 鎻愪緵鑰�
+ comments: "", // 澶囨敞
+ fileName: "", // 鏂囦欢鍘熷悕绉�
+ systemFileName: "", // 绯荤粺鐢熸垚鍚嶇О
+ },
+ componentData: {
+ entity: { name: "", orderBy: { field: "id", order: "asc" } },
+ page: { current: "1", size: "80" }
+ },
+ upIndex: 0,
+ dialogVisible: false,
+ upLoad: false,
+ responsiblePersonList: [],
+ subordinateDepartmentsList: [],
+ options: [],
+ equipmentList: [],
+ deviceStatusList: [],
+ props: { multiple: true, emitPath: false, value: 'id', label: 'name' },
+ // 鏀堕泦璁惧妗f鏁版嵁
+ Mdata: {
+ deviceName: null
+ },
+ isAddFileUpdate: false,
+ editData: {
+ authorizedPerson: [],
+ },
+ }
+ },
+ computed: {
+ action() {
+ return this.javaApi + '/deviceScope/uploadFile'
+ }
+ },
+ mounted() {
+ // 鏀堕泦鏁版嵁
+ this.getList(this.clickNodeVal.value)
+ // 鑾峰彇鐩稿叧鏂囨。鐨勬暟鎹�
+ this.getPage()
+ this.timeStamp = Date.now()
+ },
+ methods: {
+ /**
+ * 灏嗛〉闈㈡寚瀹氳妭鐐瑰唴瀹硅浆涓哄浘鐗�
+ * 1.鎷垮埌鎯宠杞崲涓哄浘鐗囩殑鍐呭鑺傜偣DOM锛�
+ * 2.杞崲锛屾嬁鍒拌浆鎹㈠悗鐨刢anvas
+ * 3.杞崲涓哄浘鐗�
+ */
+ clickGeneratePicture() {
+ const _than = this
+ domtoimage.toPng(_than.$refs.deviceQrCode, { quality: 1, width: 440, }).then(function (dataUrl) {
+ // 灏嗚浆鎹㈠悗鐨勫浘鍍忔暟鎹瓨鍌ㄤ负 data URL
+ fileDownload.downloadIamge(dataUrl, _than.Mdata.deviceName)
+ });
+ },
+ //鎵撳嵃璁惧浜岀淮鐮�
+ labelPrint() {
+ PrintJS({
+ printable: 'deviceCode',//椤甸潰
+ type: "html",//鏂囨。绫诲瀷
+ maxWidth: 360,
+ css: ['/static/css/device-print.css'],
+ style: '@page { size: auto; margin: 0mm;}',
+ targetStyles: ["*"], // 浣跨敤dom鐨勬墍鏈夋牱寮忥紝寰堥噸瑕�
+ });
+ },
+ openFileRevisionDialog() {
+ // 鑾峰彇妗f淇璐熻矗浜轰笅鎷夋鏁版嵁
+ this.selectDevicePrincipal()
+ // 鑾峰彇妗f淇鎵�灞為儴闂ㄤ笅鎷夋鏁版嵁
+ this.obtainItemParameterList()
+ // 鑾峰彇妗f淇璁惧鐘舵�佷笅鎷夋鏁版嵁
+ this.selectEnumByCategory()
+ // 鑾峰彇妗f淇妫�楠岄」鐩骇鑱斿脊妗嗘暟鎹�
+ this.getInsProductIds()
+ },
+ //闄勪欢鍜岀浉鍏虫枃妗d簨浠�
+ handleAttachmentClick(row) {
+ console.log(row)
+ if (row.fileName) {
+ this.$download.saveAs(row.fileName)
+ } else {
+ this.$message.warning('鏈笂浼犳枃浠讹紒')
+ }
+ },
+ handleViewClick(row) {
+ this.isAddFileUpdate = true
+ this.addFile = { ...row }
+ this.dialogVisible1 = true
+ if (row.fileName) {
+ const obj = Object.assign({
+ name: row.fileName,
+ url: row.fileName,
+ status: 'success',
+ uid: Date.now(),
+ })
+ this.fileList.push(obj)
+ }
+ },
+ handleDeleteClick(row) {
+ // 鍒犻櫎閫昏緫
+ MessageBox.confirm('纭畾瑕佸垹闄よ璁板綍鍚楋紵', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning',
+ }).then(() => {
+ deleteDocumentById({ id: row.id }).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鍒犻櫎鎴愬姛')
+ this.getPage()
+ }
+ })
+ }).catch(() => {
+ this.$message.info('宸插彇娑堝垹闄�')
+ })
+ },
+ saveRecord() {
+ //杞崲鏁版嵁
+ this.addFile.deviceId = this.clickNodeVal.value
+ let obj = this.addFile.systemFileName
+ this.addFile.systemFileName = obj.name
+ this.addFile.fileName = obj.url
+
+ // 鏇存柊
+ if (this.isAddFileUpdate) {
+ updateDocument(this.addFile).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鏇存柊鎴愬姛')
+ this.dialogVisible1 = false;
+ this.getPage()
+ }
+ })
+ } else {
+ // 鏂板
+ addDocument(this.addFile).then(res => {
+ if (res.code == 200) {
+ this.$message.success('淇濆瓨鎴愬姛')
+ this.dialogVisible1 = false;
+ this.getPage()
+ }
+ })
+ }
+ },
+ onSuccess(response, file, fileList) {
+ if (response.code == 200) {
+ this.addFile.systemFileName = response.data
+ this.addFile.fileName = file.name
+ } else {
+ this.$refs.uploadFile.clearFiles()
+ this.$message.error('涓婁紶澶辫触锛�' + response.message)
+ }
+ },
+ handleRemove(file, fileList) {
+ this.deleteFile(this.addFile.systemFileName)
+ },
+ deleteFile(fileName) {
+ deleteCNASFile({ fileName }).then(res => {
+ this.$message.success('鍒犻櫎鎴愬姛锛�')
+ })
+ },
+ handleExceed(files, fileList) {
+ this.$message.warning(`褰撳墠闄愬埗閫夋嫨 1 涓枃浠讹紝鏈閫夋嫨浜� ${files.length} 涓枃浠讹紝鍏遍�夋嫨浜� ${files.length + fileList.length} 涓枃浠禶);
+ },
+ beforeRemove(file, fileList) {
+ return this.$confirm(`纭畾绉婚櫎 ${file.name}锛焋);
+ },
+ // 鑾峰彇鐩稿叧鏂囨。鏁版嵁鐨刟pi
+ getPage() {
+ getListByDId({ id: this.clickNodeVal.value }).then(res => {
+ if (res.code == 200)
+ this.tableDataA = res.data
+ })
+ },
+ // 鏀堕泦鏁版嵁
+ getList(id) {
+ selectDeviceByCode({ id }).then(res => {
+ // 灏嗗垎绫诲垪琛ㄧ殑淇℃伅瀛樿捣鏉�
+ if (res.code == 200) {
+ this.Mdata = res.data;
+ this.Mdata.insProductIds = this.Mdata.insProductIds.split(',')
+ if (this.Mdata.authorizedPerson) {
+ this.Mdata.authorizedPerson = JSON.parse(this.Mdata.authorizedPerson)
+ }
+ }
+ });
+ },
+ handleData(m) {
+ if (m) {
+ return m
+ } else {
+ return '-'
+ }
+ },
+ handleClose() {
+ this.dialogVisible = false
+ },
+ //鎵撳紑淇妗f寮规
+ openEditForm() {
+ this.editData = JSON.parse(JSON.stringify(this.Mdata))
+ this.$nextTick(() => {
+ this.dialogVisible = true
+ })
+ },
+ //淇妗f
+ submitForm() {
+ let flag = true
+ this.$refs['rules1'].validate((valid) => {
+ if (!valid) {
+ flag = false;
+ return false;
+ }
+ });
+ this.$refs['rules2'].validate((valid) => {
+ if (!valid) {
+ flag = false;
+ return false;
+ }
+ });
+ this.$refs['ruleForm'].validate((valid) => {
+ if (!valid) {
+ flag = false;
+ return false;
+ }
+ });
+ if (!flag) {
+ return;
+ }
+ delete this.editData.createTime
+ delete this.editData.updateTime
+ delete this.editData.createUser
+ delete this.editData.updateUser
+ delete this.editData.orderBy
+ const formData = this.HaveJson(this.editData)
+ formData.userAllow = this.equipmentManager.toString();
+ formData.insProductIds = Array.isArray(formData.insProductIds) ? formData.insProductIds.join(',') : '';
+ if (formData.authorizedPerson.length === 0) {
+ formData.authorizedPerson = ''
+ } else {
+ formData.authorizedPerson = JSON.stringify(formData.authorizedPerson)
+ }
+ this.upLoad = true;
+ upDeviceParameter(formData).then(res => {
+ this.$message.success('淇敼鎴愬姛')
+ this.upLoad = false
+ this.getList(this.clickNodeVal.value)
+ this.dialogVisible = false
+ }).catch(e => {
+ this.$message.error('淇敼澶辫触')
+ this.dialogVisible = false
+ this.upLoad = false
+ })
+ },
+ // 瀵煎嚭
+ handleDownOne(row) {
+ this.outLoading = true
+ exportDeviceFile({ deviceId: this.clickNodeVal.value }).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/octet-stream' });
+ this.$download.saveAs(blob, '璁惧妗f鍗�.doc')
+ })
+ },
+ handleSuccessUpImg2(response) {
+ if (response.code == 200) {
+ this.$nextTick(() => {
+ this.editData.imageUpload = response.data.url;
+ this.editData.imageName = response.data.name;
+ console.log(this.javaApi + 'img/' + this.editData.imageUpload);
+
+ })
+ }
+ },
+ beforeUpload(file) {
+ if (file.size > 1024 * 1024 * 10) {
+ this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M');
+ this.$refs.upload.clearFiles()
+ return false;
+ } else {
+ return true;
+ }
+ },
+ onError(err, file, fileList) {
+ this.$message.error('涓婁紶澶辫触')
+ this.$refs.upload.clearFiles()
+ },
+ // 鑾峰彇璐熻矗浜哄垪琛�
+ selectDevicePrincipal() {
+ selectUserCondition().then(res => {
+ this.responsiblePersonList = res.data;
+ })
+ },
+ obtainItemParameterList() {
+ obtainItemParameterList().then(res => {
+ let data = []
+ res.data.forEach(a => {
+ data.push({
+ label: a.laboratoryName,
+ value: a.id
+ })
+ })
+ this.subordinateDepartmentsList = data
+ })
+ },
+ getInsProductIds() {
+ getInsProduction().then(res => {
+ this.options = res.data.map((m, i) => {
+ m.id = m.name;
+ return m
+ })
+ this.options.forEach(item => {
+ if (item.children.length == 0) {
+ item.children = null;
+ } else {
+ item.children.forEach(m => {
+ if (m.children.length == 0) {
+ m.children = null;
+ } else {
+ m.children.forEach(n => {
+ if (n.children && n.children.length == 0) {
+ n.children = null;
+ }
+ })
+ }
+ })
+ }
+ })
+ })
+ },
+ // 鑾峰彇瀛楀吀
+ selectEnumByCategory() {
+ // 璁惧鐘舵��
+ this.getDicts("device_status").then((response) => {
+ this.deviceStatusList = this.dictToValue(response.data)
+ this.deviceStatusList.forEach(a => {
+ if (!isNaN(a.value)) {
+ a.value = parseInt(a.value)
+ }
+ })
+ });
+ // 璁惧鍒嗙被
+ this.getDicts("device_type").then((response) => {
+ this.equipmentList = this.dictToValue(response.data);
+ });
+ },
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ clickNodeVal(newVal) {
+ if (newVal.value) {
+ this.getList(newVal.value)
+ this.getPage()
+ }
+ },
+ dialogVisible1(newVal) {
+ if (newVal == false) {
+ this.isAddFileUpdate = false
+ this.addFile = {}
+ this.fileList = []
+ }
+ }
+ }
+}
+</script>
+
+<style scoped>
+.main_div {
+ height: calc(100vh - 15em);
+ overflow-y: auto;
+ overflow-x: hidden;
+}
+
+.page {
+ width: 100%;
+ height: 100%;
+}
+
+.page-header {
+ display: flex;
+ justify-content: space-between;
+ margin-top: 10px;
+}
+
+h4 {
+ display: flex;
+ align-items: center;
+}
+
+h4 .line {
+ display: inline-block;
+ width: 3px;
+ height: 16px;
+ background: #3A7BFA;
+ margin-right: 4px;
+}
+
+.tables {
+ width: 100%;
+}
+
+.el-image {
+ position: relative;
+}
+
+.el-icon-picture-outline {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ transform: translate(-50%, -50%);
+}
+
+.form-item {
+ line-height: 34px;
+ display: flex;
+ align-items: center;
+ font-size: 14px;
+}
+
+.text-ellipsis {
+ display: inline-block;
+ width: 200px;
+ /* 鎴栬�呮偍鍙互璁剧疆涓�涓叿浣撶殑瀹藉害鍊� */
+ box-sizing: border-box;
+ /* 纭繚padding鍜宐order涓嶅奖鍝嶅厓绱犵殑鎬诲搴� */
+ white-space: nowrap;
+ /* 绂佹鏂囨湰鎹㈣ */
+ text-overflow: ellipsis;
+ /* 浣跨敤鐪佺暐鍙疯〃绀鸿鎴柇鐨勬枃鏈� */
+ overflow: hidden;
+ /* 闅愯棌瓒呭嚭瀹瑰櫒鐨勫唴瀹� */
+}
+
+.form-items {
+ line-height: 34px;
+ /* display: flex; */
+ /* align-items: center; */
+ margin-left: 15%;
+ font-size: 14px;
+}
+
+
+.form-item label {
+ min-width: 130px;
+ display: inline-block;
+ text-align: right;
+ margin-right: 20px;
+ color: #999;
+}
+
+.form-item p {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-line-clamp: 3;
+ /* 杩欓噷璁剧疆浣犳兂瑕佺殑琛屾暟 */
+ -webkit-box-orient: vertical;
+}
+
+.btns {
+ display: flex;
+ align-items: center;
+}
+
+.search_thing,
+.check_thing {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ gap: 1rem;
+}
+
+.search_label,
+.check_label {
+ width: 120px;
+}
+
+.search_input,
+.check_data,
+.check_input {
+ flex-grow: 1;
+}
+
+.avatar-uploader .el-upload {
+ border: 1px dashed #190505;
+ border-radius: 6px;
+ cursor: pointer;
+ position: relative;
+ overflow: hidden;
+}
+
+.avatar-uploader .el-upload:hover {
+ border-color: #409EFF;
+}
+
+.avatar-uploader-icon {
+ font-size: 28px;
+ color: #8c939d;
+ width: 178px;
+ height: 178px;
+ line-height: 178px;
+ text-align: center;
+}
+
+.avatar {
+ width: 178px;
+ height: 178px;
+ display: block;
+}
+
+.device-main {
+ width: 90%;
+ margin: 0px 5%;
+ height: 500px;
+ padding: 25px 0px;
+ background-color: #fff;
+}
+
+.device-center {
+ width: 90%;
+ height: 490px;
+ margin: 0px 5%;
+ border-radius: 15px;
+ background-color: #fff;
+ overflow: hidden;
+ /* box-shadow: 3px 3px 8px 0 rgba(0, 0, 0, 0.3); */
+ filter: drop-shadow(0px 5px 5px rgba(0, 0, 0, 0.3))
+}
+
+.device-title {
+ position: relative;
+ top: 20px;
+ z-index: 2;
+ font-size: clamp(1rem, 0.582rem + 1.59vw, 1.475rem);
+ font-weight: bold;
+ color: #4f6ab2;
+ width: 100%;
+ height: 90px;
+ line-height: 100px;
+ text-align: center;
+}
+
+.device-footer {
+ width: 100%;
+ height: 420px;
+ background-color: #3361d0;
+ position: relative
+}
+
+.device-footer::after {
+ content: "";
+ width: 100%;
+ height: 70px;
+ position: absolute;
+ top: -30px;
+ border-radius: 0 0 50% 50%;
+ background-color: #fff;
+}
+
+.device-footer .qr-code {
+ width: 55%;
+ height: 200px;
+ position: relative;
+ top: 60px;
+ left: 22.5%;
+ background-color: #fff;
+ border-radius: 15px;
+ overflow: hidden;
+}
+
+.device-number {
+ width: 80%;
+ height: 20px;
+ margin-left: 20%;
+ position: relative;
+ top: 80px;
+}
+
+.device-text {
+ color: #fff;
+ font-weight: bold;
+ font-size: 100%;
+}
+
+.device-name {
+ width: 80%;
+ margin-left: 20%;
+ height: 20px;
+ position: relative;
+ top: 90px;
+}
+</style>
diff --git a/src/views/CNAS/resourceDemand/device/component/maintenance.vue b/src/views/CNAS/resourceDemand/device/component/maintenance.vue
new file mode 100644
index 0000000..c875750
--- /dev/null
+++ b/src/views/CNAS/resourceDemand/device/component/maintenance.vue
@@ -0,0 +1,345 @@
+<!-- 璁惧缁存姢 -->
+<template>
+ <div>
+ <div class="search">
+ <div class="search_thing">
+ <div class="search_label">娴佺▼缂栧彿锛�</div>
+ <div class="search_input"><el-input v-model="search.deviceNumber" clearable placeholder="璇疯緭鍏�" size="small"
+ @keyup.enter.native="getAllMessage(clickNodeVal.value)"></el-input></div>
+ </div>
+ <div class="search_thing" style="padding-left: 20px;">
+ <el-button size="small" @click="resetSearch">閲� 缃�</el-button>
+ <el-button size="small" type="primary" @click="getAllMessage(clickNodeVal.value)">鏌� 璇�</el-button>
+ </div>
+ <div class="btns">
+ <el-button size="small" type="primary" @click="dialogVisible = true; add()">娣诲姞缁存姢璁板綍</el-button>
+ <el-button :loading="outLoading" size="small" type="primary" @click="handleDown">瀵煎嚭</el-button>
+ </div>
+ </div>
+ <div class="tables" style="margin-top: 16px;">
+ <el-table ref="table" :data="MaintainParam" height="calc(100vh - 20em)">
+ <el-table-column label="搴忓彿" type="index" width="120">
+ <template v-slot="scope">
+ <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="娴佺▼缂栧彿" min-width="180" prop="deviceNumber" />
+ <el-table-column label="璁惧鍚嶇О" min-width="150" prop="deviceName" />
+ <el-table-column label="绠$悊缂栧彿" min-width="150" prop="managementNumber" />
+ <el-table-column label="缁存姢鍐呭" min-width="150" prop="content" />
+ <el-table-column label="缁存姢鏃堕棿" min-width="150" prop="date" />
+ <el-table-column label="鎻愪氦浜�" min-width="150" prop="name" />
+ <el-table-column label="鎻愪氦鏃ユ湡" min-width="150" prop="date">
+ </el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔" width="150">
+ <template slot-scope="scope">
+ <el-button size="small" type="text" @click="handleViewClick(scope.row)">鏌ョ湅</el-button>
+ <el-button size="small" type="text" @click="handleDeleteClick(scope.$index, scope.row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]"
+ :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
+ @current-change="handleCurrentChange">
+ </el-pagination>
+ </div>
+ <!-- 鏂板缓缁存姢 -->
+ <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="dialogVisible"
+ title="娣诲姞缁存姢璁板綍"
+ top="5vh" width="60%">
+ <el-form ref="form" :model="formData" label-width="130px">
+ <el-row>
+ <el-col :span="24">
+ <el-form-item label="娴佺▼缂栧彿:" prop="deviceNumber">
+ <el-input v-model="formData.deviceNumber" clearable disabled size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璁惧鍚嶇О:" prop="deviceName">
+ <el-input v-model="formData.deviceName" clearable disabled placeholder="璇疯緭鍏�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="绠$悊缂栧彿:" prop="managementNumber">
+ <el-input v-model="formData.managementNumber" clearable disabled placeholder="璇疯緭鍏�"
+ size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item :rules="[{ required: true, message: '璇疯緭鍏ョ淮鎶ゅ唴瀹�', trigger: 'blur' }]" label="缁存姢鍐呭:"
+ prop="content">
+ <el-input v-model="formData.content" placeholder="璇疯緭鍏�" size="small" type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :rules="[{ required: true, message: '璇烽�夋嫨缁存姢鏃堕棿', trigger: 'blur' }]" label="缁存姢鏃堕棿:" prop="date">
+ <el-date-picker v-model="formData.date" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small"
+ style="width:100%" type="date" value-format="yyyy-MM-dd">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :rules="[{ required: true, message: '璇烽�夋嫨缁存姢绫诲瀷', trigger: 'blur' }]" label="缁存姢绫诲瀷:"
+ prop="maintenanceType">
+ <el-radio-group v-model="formData.maintenanceType" :disabled="!this.editMode">
+ <el-radio :label="0">浣跨敤鍓嶅悗缁存姢</el-radio>
+ <el-radio :label="1">璁″垝涓淮鎶�</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :rules="[{ required: true, message: '璇烽�夋嫨涓嬫缁存姢鏃堕棿', trigger: 'blur' }]" label="涓嬫缁存姢鏃堕棿:"
+ prop="nextDate">
+ <el-date-picker
+ v-model="formData.nextDate"
+ :picker-options="{ disabledDate: this.disabledDate }"
+ format="yyyy-MM-dd"
+ placeholder="閫夋嫨鏃ユ湡" size="small"
+ style="width:90%"
+ type="date"
+ value-format="yyyy-MM-dd">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :rules="[{ required: true, message: '璇疯緭鍏ョ淮鎶や汉', trigger: 'blur' }]" label="缁存姢浜�:" prop="name">
+ <el-input v-model="formData.name" clearable placeholder="璇疯緭鍏�" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="澶囨敞:">
+ <el-input v-model="formData.comments" placeholder="璇疯緭鍏�" size="small" type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button v-if="editMode" @click="dialogVisible = false">鍙� 娑�</el-button>
+ <el-button v-if="editMode" type="primary" @click="addRecord">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import {
+ exportMaintenanceRecord,
+ deleteDeviceMaintenance,
+ selectDeviceByCode,
+ addDeviceMaintenance,
+ getDeviceMaintenancePage, deviceMaintenanceExport,
+} from '@/api/cnas/resourceDemand/device.js'
+export default {
+ props: {
+ clickNodeVal: {
+ type: Object,
+ default: () => {
+ return {};
+ }
+ }
+ },
+ data() {
+ return {
+ search: {
+ size: 20,
+ current: 1,
+ total: 0,
+ deviceNumber: ''
+ },
+ editMode: false,
+ dialogVisible: false,
+ //琛ㄥ崟缁存姢鍐呭
+ formData: {},
+ //琛ㄥご鏄剧ず
+ MaintainParam: [],
+ outLoading: false
+ }
+ },
+ mounted() {
+ this.getAllMessage(this.clickNodeVal.value)
+ },
+ methods: {
+ //涓嬫缁存姢鏃ユ湡:绂佺敤鍦ㄧ淮鎶ゆ棩鏈熷墠鐨勬棩鏈�
+ disabledDate(time) {
+ let selectDate = this.formData.date
+ if (selectDate) {
+ let oldDate = new Date(selectDate)
+ return time <= oldDate.getTime()
+ }
+ return false
+ },
+ handleSizeChange(val) {
+ this.search.size = val
+ this.getAllMessage(this.clickNodeVal.value)
+ },
+ handleCurrentChange(val) {
+ this.search.current = val
+ this.getAllMessage(this.clickNodeVal.value)
+ },
+ //鎿嶄綔璇︽儏鏌ョ湅
+ handleViewClick(row) {
+ this.editMode = false;
+ this.dialogVisible = true;
+ this.formData = row;
+ },
+ // 瀵煎嚭
+ handleDownOne() {
+ this.outLoading = true
+ deviceMaintenanceExport({ deviceId: this.clickNodeVal.value }).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/octet-stream' });
+ this.$download.saveAs(blob, '璁惧缁存姢.xlsx')
+ })
+ },
+ //鎿嶄綔璇︽儏鍒犻櫎
+ handleDeleteClick(index, row) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ枃浠�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deleteDeviceMaintenance({ id: row.id }).then(res => {
+ this.getAllMessage(this.clickNodeVal.value)
+ this.$message({
+ type: 'success',
+ message: '鍒犻櫎鎴愬姛!'
+ });
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
+ },
+ //鐐瑰嚮鍚庡彲缂栬緫
+ add() {
+ selectDeviceByCode({ id: this.clickNodeVal.value }).then(res => {
+ this.formData.deviceName = res.data.deviceName
+ this.formData.managementNumber = res.data.managementNumber
+ this.$nextTick(() => {
+ this.$refs['form'].clearValidate()
+ })
+ });
+ this.editMode = true;
+ },
+ //娣诲姞缁存姢璁板綍
+ addRecord() {
+ this.$refs['form'].validate((valid) => {
+ if (valid) {
+ this.formData.deviceId = this.clickNodeVal.value;
+ addDeviceMaintenance(this.formData).then(res => {
+ if (res.code == 200) {
+ this.$message.success('娣诲姞鎴愬姛');
+ this.getAllMessage(this.clickNodeVal.value)
+ this.dialogVisible = false;
+ this.formData = {}; //娓呯┖琛ㄥ崟
+ }
+ })
+ // this.MaintainParam.push(this.formData)
+ }
+ })
+ },
+ resetSearch() {
+ this.search = {
+ size: 20,
+ current: 1,
+ total: 0,
+ deviceNumber: '',
+ }
+ this.getAllMessage(this.clickNodeVal.value);
+ },
+ //鑾峰彇琛ㄥ崟璁惧缁存姢淇℃伅
+ getAllMessage(deviceId) {
+ getDeviceMaintenancePage({
+ deviceId,
+ ...this.search
+ }).then(res => {
+ if (res.code == 200) {
+ this.MaintainParam = res.data.records
+ this.search.total = res.data.total
+ }
+ })
+ },
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ clickNodeVal(newVal) {
+ if (newVal.value) {
+ this.getAllMessage(newVal.value)
+ }
+ },
+ dialogVisible(newVal) {
+ if (newVal === false) {
+ this.formData = {}
+ this.$refs['form'].clearValidate()
+ }
+ }
+ }
+}
+</script>
+
+<style scoped>
+h4 {
+ font-weight: 400;
+ font-size: 16px;
+ display: flex;
+ justify-content: space-between;
+ margin: 10px 0;
+}
+
+h4 .line {
+ display: inline-block;
+ width: 3px;
+ height: 16px;
+ background: #3A7BFA;
+ margin-right: 4px;
+}
+
+.tables {
+ width: 100%;
+ height: calc(100vh - 17em);
+}
+
+.search {
+ background-color: #fff;
+ display: flex;
+ align-items: center;
+ position: relative;
+ margin-top: 10px;
+}
+
+.search_thing {
+ display: flex;
+ align-items: center;
+ height: 40px;
+}
+
+.search_label {
+ width: 80px;
+ font-size: 14px;
+ text-align: right;
+}
+
+.search_input {
+ width: 73%;
+}
+
+.btns {
+ position: absolute;
+ right: 0px;
+ top: 50%;
+ transform: translate(0, -50%);
+}
+
+.btns_thing {
+ position: absolute;
+ right: 230px;
+ top: 50%;
+ transform: translate(0, -50%);
+}
+
+.form .search_label {
+ width: 120px;
+}
+</style>
diff --git a/src/views/CNAS/resourceDemand/device/component/management.vue b/src/views/CNAS/resourceDemand/device/component/management.vue
new file mode 100644
index 0000000..bfc3c45
--- /dev/null
+++ b/src/views/CNAS/resourceDemand/device/component/management.vue
@@ -0,0 +1,1430 @@
+<!-- 璁惧宸ュ叿鏄庣粏 -->
+<template>
+ <div class="role_manage">
+ <div class="search" v-show="!showData">
+ <div class="search_thing">
+ <div class="search_label">鐘舵�侊細</div>
+ <el-select
+ v-model="queryParams.deviceStatus"
+ placeholder="鍏ㄩ儴"
+ size="small"
+ >
+ <el-option
+ v-for="item in deviceStatusList"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </div>
+ <div class="search_thing">
+ <div class="search_label">璁惧鍚嶇О锛�</div>
+ <div class="search_input">
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="queryParams.deviceName"
+ @keyup.enter.native="refreshTable()"
+ >
+ </el-input>
+ </div>
+ </div>
+ <div class="search_thing">
+ <div class="search_label">瑙勬牸鍨嬪彿锛�</div>
+ <div class="search_input">
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="queryParams.specificationModel"
+ @keyup.enter.native="refreshTable()"
+ ></el-input>
+ </div>
+ </div>
+ <div style="padding-left: 30px">
+ <el-button size="small" @click="refresh()">閲� 缃�</el-button>
+ <el-button size="small" type="primary" @click="refreshTable()"
+ >鏌� 璇�</el-button
+ >
+ <el-button size="small" type="primary" @click="dialogVisible2 = true"
+ >鏂� 澧�</el-button
+ >
+ <el-button size="small" type="primary" @click="handleDownOne"
+ >瀵� 鍑�</el-button
+ >
+ </div>
+ </div>
+ <div class="table" v-show="!showData">
+ <lims-table
+ :tableData="tableData"
+ :column="column"
+ :tableLoading="tableLoading"
+ :height="'calc(100vh - 320px)'"
+ :page="page"
+ @pagination="pagination"
+ ></lims-table>
+ </div>
+ <el-dialog
+ :title="isUp ? '璁惧璇︽儏' : '妗f淇'"
+ :visible.sync="dialogVisible"
+ width="70%"
+ top="5vh"
+ :before-close="handleClose"
+ >
+ <el-row style="display: flex; justify-content: space-around">
+ <!-- 宸﹁竟甯冨眬 -->
+ <el-col :span="7">
+ <el-col>
+ <!-- 鍥剧墖 -->
+ <el-image
+ class="img"
+ style="width: 100%; height: 320px; marginbottom: 16px"
+ :src="javaApi + '/img/' + formData.imageUpload"
+ >
+ <div
+ slot="error"
+ class="image-error"
+ style="
+ width: calc(100% -2px);
+ height: 318px;
+ border-radius: 16px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: 1px solid #eeeeee;
+ "
+ >
+ <i
+ class="el-icon-picture-outline"
+ style="font-size: 60px; color: #666666"
+ ></i>
+ </div>
+ </el-image>
+ <!-- 琛ㄥ崟 -->
+ <el-form
+ :label-position="labelPosition"
+ :model="formData"
+ label-width="120px"
+ >
+ <el-form-item label="浠櫒鍚嶇О:" required>
+ <el-input
+ :disabled="isUp"
+ v-model="formData.deviceName"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="浠櫒鍚嶇ОEN:" required>
+ <el-input
+ :disabled="isUp"
+ v-model="formData.enDeviceName"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="瑙勬牸鍨嬪彿:" required>
+ <el-input
+ :disabled="isUp"
+ v-model="formData.specificationModel"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="鐢熶骇鍘傚:">
+ <el-input
+ :disabled="isUp"
+ v-model="formData.manufacturer"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ </el-form>
+ </el-col>
+ </el-col>
+ <!-- 涓棿甯冨眬 -->
+ <el-col :span="7">
+ <el-form
+ :label-position="labelPosition"
+ :model="formData"
+ label-width="116px"
+ >
+ <el-form-item label="鏍″噯鏈嶅姟鏈烘瀯:">
+ <el-input
+ disabled
+ v-model="formData.calibrationServices"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="鍑哄巶缂栧彿:">
+ <el-input
+ :disabled="isUp"
+ v-model="formData.factoryNo"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="绠$悊缂栧彿:" required>
+ <el-input
+ :disabled="isUp"
+ v-model="formData.managementNumber"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="璐疆鏃ユ湡:">
+ <el-date-picker
+ :disabled="isUp"
+ style="width: 100%"
+ v-model="formData.acquisitionDate"
+ type="date"
+ format="yyyy-MM-dd"
+ value-format="yyyy-MM-dd HH:mm:ss"
+ size="small"
+ placeholder="閫夋嫨鏃ユ湡"
+ >
+ </el-date-picker>
+ </el-form-item>
+ <el-form-item label="鍚敤鏃ユ湡:" required>
+ <el-date-picker
+ :disabled="isUp"
+ style="width: 100%"
+ v-model="formData.activationDate"
+ type="date"
+ format="yyyy-MM-dd"
+ value-format="yyyy-MM-dd HH:mm:ss"
+ size="small"
+ placeholder="閫夋嫨鏃ユ湡"
+ >
+ </el-date-picker>
+ </el-form-item>
+ <el-form-item label="绠$悊浜�:">
+ <el-select
+ v-model="formData.equipmentManager"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 100%"
+ >
+ <el-option
+ :disabled="isUp"
+ v-for="item in responsiblePersonList"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="瀛樻斁鐐�:">
+ <el-input
+ :disabled="isUp"
+ v-model="formData.storagePoint"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="鎶�鏈寚鏍�:">
+ <el-input
+ :disabled="isUp"
+ v-model="formData.technicalIndicators"
+ :rows="7"
+ type="textarea"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ </el-form>
+ </el-col>
+ <!-- 鍙宠竟甯冨眬 -->
+ <el-col :span="7">
+ <el-form
+ :label-position="labelPosition"
+ :model="formData"
+ label-width="140px"
+ ref="ruleForm"
+ >
+ <!-- 瀹為獙瀹ゅ垪琛� -->
+ <el-form-item label="鎵�灞為儴闂�:">
+ <el-select
+ :disabled="isUp"
+ v-model="formData.subordinateDepartmentsId"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="item in subordinateDepartmentsList"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="妫�娴嬮」鐩�:">
+ <el-cascader
+ :disabled="isUp"
+ v-model="formData.insProductIds"
+ :options="options"
+ :show-all-levels="false"
+ :props="props"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 100%"
+ :collapse-tags="!isUp"
+ separator=","
+ filterable
+ clearable
+ ></el-cascader>
+ </el-form-item>
+ <el-form-item label="鏈�杩戞牎鍑嗘棩鏈�:" v-if="isUp">
+ <el-date-picker
+ :disabled="isUp"
+ style="width: 100%"
+ v-model="formData.latestTraceability"
+ format="yyyy-MM-dd"
+ value-format="yyyy-MM-dd"
+ type="date"
+ size="small"
+ placeholder="閫夋嫨鏃ユ湡"
+ >
+ </el-date-picker>
+ </el-form-item>
+ <el-form-item label="涓嬫鏍″噯鏃ユ湡:" v-if="isUp">
+ <el-date-picker
+ :disabled="isUp"
+ style="width: 100%"
+ v-model="formData.latestTraceability"
+ format="yyyy-MM-dd"
+ value-format="yyyy-MM-dd"
+ type="date"
+ size="small"
+ placeholder="閫夋嫨鏃ユ湡"
+ >
+ </el-date-picker>
+ </el-form-item>
+ <el-form-item label="璁惧绫诲瀷:">
+ <el-select
+ :disabled="isUp"
+ v-model="formData.largeCategory"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="item in equipmentList"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鍗曚环(涓囧厓):">
+ <el-input
+ :disabled="isUp"
+ v-model="formData.unitPrice"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="褰撳墠鐘舵��:" required>
+ <el-select
+ :disabled="isUp"
+ v-model="formData.deviceStatus"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="item in deviceStatusList"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鏍″噯鍛ㄦ湡锛堟湀锛�:" required>
+ <el-input
+ :disabled="isUp"
+ v-model="formData.calibrationDate"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="鍥剧墖:">
+ <div
+ style="
+ border: 1px solid #dcdfe6;
+ border-radius: 4px;
+ height: 32px;
+ lineheight: 32px;
+ display: flex;
+ justify-content: space-around;
+ font-size: 13px;
+ "
+ >
+ <div v-show="formData.imageName" class="picName">
+ {{ formData.imageName }}
+ </div>
+ <el-upload
+ :disabled="isUp"
+ :action="action"
+ :on-success="handleSuccessUpImg2"
+ :show-file-list="false"
+ accept="image/jpg,image/jpeg,image/png"
+ :headers="uploadHeader"
+ :on-change="beforeUpload"
+ :on-error="onError"
+ ref="upload"
+ >
+ <el-button type="text" style="height: 30px; padding-top: 8px"
+ >涓婁紶</el-button
+ >
+ </el-upload>
+ </div>
+ </el-form-item>
+ </el-form>
+ </el-col>
+ </el-row>
+ <span slot="footer" class="dialog-footer">
+ <el-row v-if="!isUp">
+ <el-button @click="handleClose">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitForm" :loading="upLoad"
+ >纭� 瀹�</el-button
+ >
+ </el-row>
+ </span>
+ </el-dialog>
+ <!-- 鏂板-->
+ <el-dialog
+ title="鏂板璁惧"
+ top="5vh"
+ :visible.sync="dialogVisible2"
+ width="70%"
+ :before-close="handleClose2"
+ >
+ <el-row style="display: flex; justify-content: space-around">
+ <!-- 宸﹁竟甯冨眬 -->
+ <el-col :span="7">
+ <el-col>
+ <!-- 鍥剧墖 -->
+ <el-image
+ class="img"
+ style="width: 100%; height: 320px; margin-bottom: 16px"
+ :src="javaApi + '/img/' + formData2.imageUpload"
+ >
+ <div
+ slot="error"
+ class="image-error"
+ style="
+ width: calc(100% -2px);
+ height: 318px;
+ border-radius: 16px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: 1px solid #eeeeee;
+ "
+ >
+ <i
+ class="el-icon-picture-outline"
+ style="font-size: 60px; color: #666666"
+ ></i>
+ </div>
+ </el-image>
+ <!-- 琛ㄥ崟 -->
+ <el-form
+ :label-position="labelPosition"
+ :model="formData2"
+ label-width="120px"
+ >
+ <el-form-item label="浠櫒鍚嶇О:" required>
+ <el-input
+ v-model="formData2.deviceName"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="浠櫒鍚嶇ОEN:" required>
+ <el-input
+ v-model="formData2.enDeviceName"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="瑙勬牸鍨嬪彿:" required>
+ <el-input
+ v-model="formData2.specificationModel"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="鐢熶骇鍘傚:">
+ <el-input
+ v-model="formData2.manufacturer"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ </el-form>
+ </el-col>
+ </el-col>
+ <!-- 涓棿甯冨眬 -->
+ <el-col :span="7">
+ <el-form
+ :label-position="labelPosition"
+ :model="formData2"
+ label-width="110px"
+ >
+ <!-- <el-form-item label="鐢熶骇鍘傚EN:">
+ <el-input v-model="formData2.factoryNo" size="small"></el-input>
+ </el-form-item> -->
+ <el-form-item label="鏍″噯鏈嶅姟鏈烘瀯:">
+ <el-input
+ v-model="formData2.calibrationServices"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="鍑哄巶缂栧彿:">
+ <el-input v-model="formData2.factoryNo" size="small"></el-input>
+ </el-form-item>
+ <el-form-item label="绠$悊缂栧彿:" required>
+ <el-input
+ v-model="formData2.managementNumber"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="璐疆鏃ユ湡:">
+ <el-date-picker
+ style="width: 100%"
+ v-model="formData2.acquisitionDate"
+ type="date"
+ format="yyyy-MM-dd"
+ value-format="yyyy-MM-dd HH:mm:ss"
+ size="small"
+ placeholder="閫夋嫨鏃ユ湡"
+ >
+ </el-date-picker>
+ </el-form-item>
+ <el-form-item label="鍚敤鏃ユ湡:" required>
+ <el-date-picker
+ style="width: 100%"
+ v-model="formData2.activationDate"
+ type="date"
+ format="yyyy-MM-dd"
+ value-format="yyyy-MM-dd HH:mm:ss"
+ size="small"
+ placeholder="閫夋嫨鏃ユ湡"
+ >
+ </el-date-picker>
+ </el-form-item>
+ <el-form-item label="绠$悊浜�:">
+ <el-select
+ v-model="formData2.equipmentManager"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="item in responsiblePersonList"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="瀛樻斁鐐�:">
+ <el-input
+ v-model="formData2.storagePoint"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="鎶�鏈寚鏍�:">
+ <el-input
+ v-model="formData2.technicalIndicators"
+ :rows="7"
+ type="textarea"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ </el-form>
+ </el-col>
+ <!-- 鍙宠竟甯冨眬 -->
+ <el-col :span="7">
+ <el-form
+ :label-position="labelPosition"
+ :model="formData2"
+ label-width="120px"
+ ref="ruleForm"
+ >
+ <!-- 瀹為獙瀹ゅ垪琛� -->
+ <el-form-item label="鎵�灞為儴闂�:">
+ <el-select
+ v-model="formData2.subordinateDepartmentsId"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="item in subordinateDepartmentsList"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="妫�娴嬮」鐩�:">
+ <el-cascader
+ v-model="formData2.insProductIds"
+ :options="options"
+ :show-all-levels="false"
+ :props="props"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 100%"
+ collapse-tags
+ separator=","
+ filterable
+ clearable
+ ></el-cascader>
+ </el-form-item>
+ <el-form-item label="璁惧绫诲瀷:">
+ <el-select
+ v-model="formData2.largeCategory"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="item in equipmentList"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鍗曚环(涓囧厓):">
+ <el-input v-model="formData2.unitPrice" size="small"></el-input>
+ </el-form-item>
+ <el-form-item label="褰撳墠鐘舵��:" required>
+ <el-select
+ v-model="formData2.deviceStatus"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="item in deviceStatusList"
+ :key="item.id"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鏍″噯鍛ㄦ湡锛堟湀锛�:" required>
+ <el-input
+ v-model="formData2.calibrationDate"
+ size="small"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="鍥剧墖:">
+ <div
+ style="
+ border: 1px solid #dcdfe6;
+ border-radius: 4px;
+ height: 32px;
+ line-height: 32px;
+ display: flex;
+ justify-content: space-around;
+ font-size: 13px;
+ "
+ >
+ <div v-show="formData2.imageName" class="picName">
+ {{ formData2.imageName }}
+ </div>
+ <el-upload
+ :action="action"
+ :on-success="handleSuccessUpImg2"
+ :show-file-list="false"
+ accept="image/jpg,image/jpeg,image/png"
+ :headers="uploadHeader"
+ :on-change="beforeUpload"
+ :on-error="onError"
+ ref="upload"
+ >
+ <el-button type="text" style="height: 30px; padding-top: 8px"
+ >涓婁紶</el-button
+ >
+ </el-upload>
+ </div>
+ </el-form-item>
+ </el-form>
+ </el-col>
+ </el-row>
+ <span slot="footer" class="dialog-footer">
+ <el-row>
+ <el-button @click="handleClose2">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitForm2" :loading="upLoad2"
+ >纭� 瀹�</el-button
+ >
+ </el-row>
+ </span>
+ </el-dialog>
+ <el-dialog title="鏁伴噰閰嶇疆" :visible.sync="dialogVisible3" width="400px">
+ <div class="search_thing" style="margin-bottom: 14px">
+ <div class="search_label">
+ <span style="color: red; margin-right: 4px">*</span>IP锛�
+ </div>
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="configForm.ip"
+ ></el-input>
+ </div>
+ <div class="search_thing" style="margin-bottom: 14px">
+ <div class="search_label">
+ <span style="color: red; margin-right: 4px">*</span>閲囬泦鍦板潃锛�
+ </div>
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="configForm.collectUrl"
+ ></el-input>
+ </div>
+ <div class="search_thing" style="margin-bottom: 14px">
+ <div class="search_label">
+ <span style="color: red; margin-right: 4px">*</span>鍌ㄥ瓨鍦板潃锛�
+ </div>
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="configForm.storageUrl"
+ ></el-input>
+ </div>
+ <div class="search_thing" style="margin-bottom: 14px">
+ <div class="search_label">
+ <span style="color: red; margin-right: 4px">*</span>鍙傜収锛�
+ </div>
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="configForm.refer"
+ ></el-input>
+ </div>
+ <div class="search_thing" style="margin-bottom: 14px">
+ <div class="search_label">
+ <span style="color: red; margin-right: 4px">*</span>X锛�
+ </div>
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="configForm.x"
+ ></el-input>
+ </div>
+ <div class="search_thing" style="margin-bottom: 14px">
+ <div class="search_label">
+ <span style="color: red; margin-right: 4px">*</span>Y锛�
+ </div>
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="configForm.y"
+ ></el-input>
+ </div>
+ <div class="search_thing">
+ <div class="search_label">鍏紡锛�</div>
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="configForm.formula"
+ ></el-input>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-row>
+ <el-button @click="dialogVisible3 = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitForm3" :loading="upLoad3"
+ >纭� 瀹�</el-button
+ >
+ </el-row>
+ </span>
+ </el-dialog>
+ <dataAcquisitionConfig v-if="showData" :deviceId="deviceId" />
+ </div>
+</template>
+
+<script>
+import limsTable from "@/components/Table/lims-table.vue";
+import dataAcquisitionConfig from "./acquisitionConfig.vue";
+import {
+ obtainItemParameterList,
+ exportEquipmentDetails,
+ getInsProduction,
+ upDeviceParameter,
+ addDeviceParameter,
+ numberCollect,
+ getDeviceParameter,
+ delDeviceParameter,
+} from "@/api/cnas/resourceDemand/device.js";
+import { selectUserCondition } from "@/api/system/user";
+export default {
+ props: {
+ clickNodeVal: {
+ type: Object,
+ default: () => {
+ return {};
+ },
+ },
+ },
+ components: {
+ limsTable,
+ dataAcquisitionConfig,
+ },
+ data() {
+ return {
+ dateFormat: "yyyy-MM-dd",
+ deviceId: "",
+ fileTypeOptions: [
+ { label: "csv", value: ".csv" },
+ { label: "db", value: ".db" },
+ { label: "mdb", value: ".mdb" },
+ { label: "word", value: ".docx" },
+ { label: "excel", value: ".xlsx" },
+ { label: "txt", value: ".txt" },
+ { label: "png", value: ".png" },
+ ],
+ //鏄惁鏄。妗堜慨璁� true涓嶆槸 false鏄�
+ isUp: true,
+ formData: {
+ authorizedPerson: [],
+ },
+ formData2: {
+ imageUpload: "",
+ imageName: "",
+ deviceStatus: "",
+ authorizedPerson: [],
+ },
+ value: "",
+ props: { multiple: true, emitPath: false, value: "id", label: "name" },
+ options: [],
+ labelPosition: "right",
+ dialogVisible: false,
+ dialogVisible2: false,
+ addPower: false,
+ showData: false, // 鏁伴噰閰嶇疆椤甸潰
+ tableList: [],
+ addDia: true,
+ addPower: true,
+ //璁惧绫诲瀷鍒楄〃
+ equipmentList: [],
+ // 璐熻矗浜哄垪琛�
+ responsiblePersonList: [],
+ // 鎺堟潈浜哄垪琛�
+ authorizerList: [],
+ // 褰撳墠鐘舵�佸垪琛�
+ deviceStatusList: [],
+ // 鎵�灞為儴闂�
+ subordinateDepartmentsList: [],
+ upLoad: false,
+ upLoad2: false,
+ dialogVisible3: false,
+ upLoad3: false,
+ configForm: {},
+ laboratoryNameIsNull: false,
+ queryParams: {},
+ tableData: [],
+ column: [
+ {
+ label: "璁惧鍚嶇О",
+ prop: "deviceName",
+ dataType: "link",
+ linkEvent: { method: "selectAllByOne", vueComponent: this },
+ },
+ { label: "璁惧鍚嶇ОEN", prop: "enDeviceName" },
+ {
+ label: "瑙勬牸鍨嬪彿",
+ prop: "specificationModel",
+ },
+ { label: "鐢熶骇鍘傚", prop: "manufacturer" },
+ { label: "鍑哄巶缂栧彿", prop: "factoryNo" },
+ { label: "绠$悊缂栧彿", prop: "managementNumber" },
+ { label: "鎶�鏈寚鏍�", prop: "technicalIndicators" },
+ { label: "璐疆鏃ユ湡", prop: "acquisitionDate" },
+ { label: "鍚敤鏃ユ湡", prop: "activationDate" },
+ { label: "绠$悊浜�", prop: "equipmentManagerUser" },
+ { label: "瀛樻斁鐐�", prop: "storagePoint" },
+ { label: "鎵�灞為儴闂�", prop: "laboratoryName" },
+ { label: "妫�楠岄」鐩�", prop: "insProductItem" },
+ { label: "鏍″噯鏈嶅姟鏈烘瀯", prop: "calibrationServices" },
+ { label: "鏈�杩戞牎鍑嗘棩鏈�", prop: "lastCalibrationDateTwo" },
+ { label: "鏈�杩戞牳鏌ユ棩鏈�", prop: "lastCalibrationDate" },
+ { label: "涓嬫鏍″噯鏃ユ湡", prop: "nextCalibrationDateTwo" },
+ { label: "涓嬫鏍告煡鏃ユ湡", prop: "nextCalibrationDate" },
+ {
+ label: "璁惧鍒嗙被",
+ prop: "largeCategory",
+ dataType: "tag",
+ formatData: (params) => {
+ return this.equipmentList.find((m) => m.value == params).label;
+ },
+ formatType: (params) => {
+ return this.equipmentList.find((m) => m.value == params).type;
+ },
+ },
+ { label: "鍗曚环", prop: "unitPrice" },
+ {
+ label: "璁惧鐘舵��",
+ prop: "deviceStatus",
+ dataType: "tag",
+ formatData: (params) => {
+ return this.deviceStatusList.find((m) => m.value == params).label;
+ },
+ formatType: (params) => {
+ return this.deviceStatusList.find((m) => m.value == params).type;
+ },
+ },
+ { label: "鏍″噯鍛ㄦ湡(鏈�)", prop: "calibrationDate" },
+ {
+ dataType: "action",
+ fixed: "right",
+ label: "鎿嶄綔",
+ operation: [
+ {
+ name: "妗f淇",
+ type: "text",
+ clickFun: (row) => {
+ this.isUpdate(row);
+ },
+ },
+ {
+ name: "鏁伴噰閰嶇疆",
+ type: "text",
+ clickFun: (row) => {
+ this.handleConfig(row);
+ },
+ disabled: (row) => {
+ return row.insProductItem == null || row.insProductItem === "";
+ },
+ },
+ {
+ name: "鍒犻櫎",
+ type: "text",
+ clickFun: (row) => {
+ this.handleDelete(row);
+ },
+ },
+ ],
+ },
+ ],
+ page: {
+ total: 0,
+ size: 10,
+ current: 0,
+ },
+ tableLoading: false,
+ };
+ },
+ computed: {
+ action() {
+ return this.javaApi + "/deviceScope/uploadFile";
+ },
+ },
+ mounted() {
+ this.selectEnumByCategory();
+ this.selectDevicePrincipal();
+ this.obtainItemParameterList();
+ this.getInsProductIds();
+ // 鍒濆鍖�
+ this.clickSidebar(this.clickNodeVal);
+ },
+ methods: {
+ //鍒嗙被
+ handleNotification(cate) {
+ this.queryParams.largeCategory = cate;
+ },
+ obtainItemParameterList() {
+ obtainItemParameterList().then((res) => {
+ let data = [];
+ res.data.forEach((a) => {
+ data.push({
+ label: a.laboratoryName,
+ value: a.id,
+ });
+ });
+ this.subordinateDepartmentsList = data;
+ });
+ },
+ getList() {
+ this.tableLoading = true;
+ let param = {
+ laboratoryNameIsNull: this.laboratoryNameIsNull,
+ ...this.queryParams,
+ ...this.page,
+ };
+ delete param.total;
+ getDeviceParameter({ ...param })
+ .then((res) => {
+ this.tableLoading = false;
+ if (res.code === 200) {
+ this.tableData = res.data.records;
+ this.page.total = res.data.total;
+ }
+ })
+ .catch((err) => {
+ this.tableLoading = false;
+ });
+ },
+ pagination({ page, limit }) {
+ this.page.current = page;
+ this.page.size = limit;
+ this.getList();
+ },
+ refresh() {
+ this.queryParams = {};
+ this.page.current = 1;
+ this.getList();
+ },
+ refreshTable() {
+ this.page.current = 1;
+ this.getList();
+ },
+ // 瀵煎嚭
+ handleDownOne() {
+ this.outLoading = true;
+ exportEquipmentDetails().then((res) => {
+ this.outLoading = false;
+ const blob = new Blob([res], { type: "application/octet-stream" });
+ this.$download.saveAs(blob, "璁惧浠櫒涓�瑙堣〃.doc");
+ });
+ },
+ // 鑾峰彇瀛楀吀
+ selectEnumByCategory() {
+ // 璁惧鐘舵��
+ this.getDicts("device_status").then((response) => {
+ this.deviceStatusList = this.dictToValue(response.data);
+ });
+ // 璁惧鍒嗙被
+ this.getDicts("device_type").then((response) => {
+ this.equipmentList = this.dictToValue(response.data);
+ });
+ },
+ // 鑾峰彇璐熻矗浜哄垪琛�
+ selectDevicePrincipal() {
+ selectUserCondition().then((res) => {
+ let data = [];
+ res.data.forEach((a) => {
+ data.push({
+ label: a.name,
+ value: a.id,
+ });
+ });
+ this.responsiblePersonList = data;
+ this.authorizerList = data;
+ });
+ },
+ getInsProductIds() {
+ getInsProduction().then((res) => {
+ this.options = res.data.map((m, i) => {
+ m.id = m.name;
+ let children = m.children.map((n) => {
+ n.label = n.name;
+ n.value = n.id;
+ return n;
+ });
+ return m;
+ });
+ this.options.forEach((item) => {
+ if (item.children.length == 0) {
+ item.children = null;
+ } else {
+ item.children.forEach((m) => {
+ if (m.children.length == 0) {
+ m.children = null;
+ } else {
+ m.children.forEach((n) => {
+ if (n.children && n.children.length == 0) {
+ n.children = null;
+ }
+ });
+ }
+ });
+ }
+ });
+ });
+ },
+ handleClose() {
+ this.formData = {
+ authorizedPerson: [],
+ };
+ this.formData2 = {
+ imageUpload: "",
+ imageName: "",
+ authorizedPerson: [],
+ };
+ this.dialogVisible = false;
+ this.upLoad = false;
+ },
+ handleClose2() {
+ this.formData = {
+ authorizedPerson: [],
+ };
+ this.formData2 = {
+ imageUpload: "",
+ imageName: "",
+ authorizedPerson: [],
+ };
+ this.dialogVisible2 = false;
+ this.upLoad = false;
+ },
+ selectAllByOne(row) {
+ this.isUp = true;
+ //鎵撳紑寮规
+ this.dialogVisible = true;
+ //row = 鐐瑰嚮瀵瑰簲琛屽��
+ //澶嶅埗缁檉ormData
+ this.formData = this.HaveJson(row);
+ console.log(row.insProductIds + "valll");
+ this.formData.insProductIds = row.insProductIds
+ ? row.insProductIds.split(",")
+ : [];
+ },
+ isUpdate(row) {
+ //淇敼 isUp 涓烘。妗堜慨鏀�
+ this.isUp = false;
+ //鎵撳紑寮规
+ this.dialogVisible = true;
+ //row = 鐐瑰嚮瀵瑰簲琛屽�间竴琛屽��
+ //澶嶅埗缁檉ormData
+ this.formData = this.HaveJson(row);
+ if (typeof row.insProductIds === "number") {
+ row.insProductIds = row.insProductIds + "";
+ }
+ this.formData.deviceStatus = this.formData.deviceStatus + "";
+ this.formData.insProductIds = row.insProductIds
+ ? row.insProductIds.split(",")
+ : [];
+ // 灏嗘椂闂存牸寮忎负yyyy-MM-dd 杩涜杞崲
+ const dateRegex = /^\d{4}-\d{2}-\d{2}$/;
+ Object.keys(this.formData).forEach((key) => {
+ if (dateRegex.test(this.formData[key])) {
+ this.formData[key] = `${this.formData[key]} 00:00:00`;
+ }
+ });
+ },
+ beforeUpload(file) {
+ if (file.size > 1024 * 1024 * 10) {
+ this.$message.error("涓婁紶鏂囦欢涓嶈秴杩�10M");
+ this.$refs.upload.clearFiles();
+ return false;
+ } else {
+ return true;
+ }
+ },
+ onError(err, file, fileList) {
+ this.$message.error("涓婁紶澶辫触");
+ this.$refs.upload.clearFiles();
+ },
+ // 涓婁紶鍥剧墖鎴愬姛
+ handleSuccessUpImg(response) {
+ if (response.code == 200) {
+ this.formData.imageUpload = response.data.url;
+ this.formData.imageName = response.data.name;
+ }
+ },
+ handleSuccessUpImg2(response) {
+ if (response.code == 200) {
+ this.$nextTick(() => {
+ this.formData.imageUpload = response.data.url;
+ this.formData.imageName = response.data.name;
+ this.formData2.imageUpload = response.data.url;
+ this.formData2.imageName = response.data.name;
+ });
+ }
+ },
+ submitForm() {
+ if (!this.formData.deviceName) {
+ this.$message.error("鏈緭鍏ヤ华鍣ㄥ悕绉�");
+ return;
+ }
+ if (!this.formData.enDeviceName) {
+ this.$message.error("鏈緭鍏ヤ华鍣ㄥ悕绉癊N");
+ return;
+ }
+ if (!this.formData.specificationModel) {
+ this.$message.error("鏈緭鍏ヨ鏍煎瀷鍙�");
+ return;
+ }
+ if (!this.formData.managementNumber) {
+ this.$message.error("鏈緭鍏ョ鐞嗙紪鍙�");
+ return;
+ }
+ if (!this.formData.activationDate) {
+ this.$message.error("鏈緭鍏ユ牎鍑嗘湁鏁堟湡");
+ return;
+ }
+ if (!this.formData.subordinateDepartmentsId) {
+ this.$message.error("鏈�夋嫨鎵�灞為儴闂�");
+ return;
+ }
+ if (
+ this.formData.deviceStatus === "" ||
+ this.formData.deviceStatus === null
+ ) {
+ this.$message.error("鏈�夋嫨褰撳墠鐘舵��");
+ return;
+ }
+ if (!this.formData.calibrationDate) {
+ this.$message.error("鏈緭鍏ユ牎鍑嗗懆鏈燂紙鏈堬級");
+ return;
+ }
+ delete this.formData.createTime;
+ delete this.formData.updateTime;
+ delete this.formData.createUser;
+ delete this.formData.updateUser;
+ const formData = this.HaveJson(this.formData);
+ formData.insProductIds = formData.insProductIds
+ ? formData.insProductIds.join()
+ : "";
+ if (formData.authorizedPerson.length === 0) {
+ formData.authorizedPerson = "";
+ } else {
+ formData.authorizedPerson = JSON.stringify(formData.authorizedPerson);
+ }
+ this.upLoad = true;
+ upDeviceParameter(formData)
+ .then((res) => {
+ this.$message.success("淇敼鎴愬姛");
+ this.upLoad = false;
+ this.refreshTable("page");
+ this.dialogVisible = false;
+ })
+ .catch((e) => {
+ this.$message.error("淇敼澶辫触");
+ this.dialogVisible = false;
+ this.upLoad = false;
+ });
+ },
+ // 鎻愪氦妗f淇--鏂板
+ submitForm2() {
+ if (!this.formData2.deviceName) {
+ this.$message.error("鏈緭鍏ヤ华鍣ㄥ悕绉�");
+ return;
+ }
+ if (!this.formData2.enDeviceName) {
+ this.$message.error("鏈緭鍏ヤ华鍣ㄥ悕绉癊N");
+ return;
+ }
+ if (!this.formData2.specificationModel) {
+ this.$message.error("鏈緭鍏ヨ鏍煎瀷鍙�");
+ return;
+ }
+ if (!this.formData2.managementNumber) {
+ this.$message.error("鏈緭鍏ョ鐞嗙紪鍙�");
+ return;
+ }
+ if (!this.formData2.activationDate) {
+ this.$message.error("鏈緭鍏ユ牎鍑嗘湁鏁堟湡");
+ return;
+ }
+ if (!this.formData2.deviceStatus) {
+ this.$message.error("鏈�夋嫨褰撳墠鐘舵��");
+ return;
+ }
+ if (!this.formData2.calibrationDate) {
+ this.$message.error("杈撳叆鏍″噯鍛ㄦ湡锛堟湀锛�");
+ return;
+ }
+ const formData = this.HaveJson(this.formData2);
+ formData.insProductIds = formData.insProductIds
+ ? formData.insProductIds.join()
+ : "";
+ if (formData.authorizedPerson.length === 0) {
+ formData.authorizedPerson = "";
+ } else {
+ formData.authorizedPerson = JSON.stringify(formData.authorizedPerson);
+ }
+ this.upLoad2 = true;
+ addDeviceParameter(formData)
+ .then((res) => {
+ this.$message.success("鎻愪氦鎴愬姛");
+ this.upLoad2 = false;
+ this.refreshTable("page");
+ this.dialogVisible2 = false;
+ this.formData2 = {
+ imageUpload: "",
+ imageName: "",
+ authorizedPerson: [],
+ };
+ })
+ .catch((e) => {
+ this.$message.error("鎻愪氦澶辫触");
+ this.dialogVisible2 = false;
+ this.upLoad2 = false;
+ });
+ },
+ handleConfig(row) {
+ let list = [];
+ if (row.insProductItem) {
+ list = row.insProductItem.split(";");
+ }
+ let list2 = [];
+ list.map((item) => {
+ const obj = Object.assign({
+ deviceId: row.id,
+ insProductItem: item,
+ });
+ list2.push(obj);
+ });
+ this.tableList = list2;
+ this.deviceId = row.id;
+ this.$nextTick(() => {
+ this.showData = true;
+ });
+ },
+ closeDataVue() {
+ this.clickSidebar(this.clickNodeVal);
+ this.showData = false;
+ },
+ submitForm3() {
+ if (!this.configForm.ip) {
+ this.$message.error("璇峰~鍐橧P");
+ return;
+ }
+ if (!this.configForm.collectUrl) {
+ this.$message.error("璇峰~鍐欓噰闆嗗湴鍧�");
+ return;
+ }
+ if (!this.configForm.storageUrl) {
+ this.$message.error("璇峰~鍐欏偍瀛樺湴鍧�");
+ return;
+ }
+ if (!this.configForm.refer) {
+ this.$message.error("璇峰~鍐欏弬鐓�");
+ return;
+ }
+ if (!this.configForm.x) {
+ this.$message.error("璇峰~鍐橷");
+ return;
+ }
+ if (!this.configForm.y) {
+ this.$message.error("璇峰~鍐橸");
+ return;
+ }
+
+ this.upLoad3 = true;
+ numberCollect(this.configForm)
+ .then((res) => {
+ this.upLoad3 = false;
+ this.$message.success("鎿嶄綔鎴愬姛");
+ this.refreshTable("page");
+ this.dialogVisible3 = false;
+ })
+ .catch((e) => {
+ this.$message.error("鎿嶄綔澶辫触");
+ this.dialogVisible3 = false;
+ this.upLoad3 = false;
+ });
+ },
+ // 鐐瑰嚮渚ц竟鏍忓埛鏂�
+ clickSidebar(clickNodeVal) {
+ this.laboratoryNameIsNull = false;
+ // 鏄惁瀛樺湪value锛屽瓨鍦╲alue浠h〃涓轰笁绾�
+ if (!clickNodeVal.value) {
+ this.list = [];
+ this.queryParams.laboratoryName = null;
+ this.queryParams.storagePoint = null;
+ // 绛変簬1浠h〃涓烘爲鐨勪竴绾э紝label涓洪儴闂�
+ if (clickNodeVal.label == "鍏朵粬") {
+ this.laboratoryNameIsNull = true;
+ this.refreshTable("page");
+ return;
+ }
+ if (clickNodeVal.level == 1) {
+ this.queryParams.laboratoryName = clickNodeVal.label;
+ // 绛変簬浜岀骇銆俵abel涓哄瓨鍌ㄥ湴鐐�
+ } else if (clickNodeVal.level == 2) {
+ // 鍏朵粬琛ㄧず娌℃湁閰嶇疆瀹為獙瀹わ紝鍙厤缃簡鍦扮偣
+ if (clickNodeVal.parent.label == "鍏朵粬") {
+ this.laboratoryNameIsNull = true;
+ } else {
+ this.queryParams.laboratoryName = clickNodeVal.parent.label;
+ }
+ this.queryParams.storagePoint = clickNodeVal.label;
+ }
+ this.refreshTable("page");
+ }
+ },
+ handleDelete(row) {
+ this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ delDeviceParameter({ id: row.id }).then((res) => {
+ this.$message.success("鍒犻櫎鎴愬姛");
+ this.refresh();
+ });
+ })
+ .catch(() => {});
+ },
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ clickNodeVal(newVal) {
+ this.clickSidebar(newVal);
+ },
+ },
+};
+</script>
+
+<style scoped>
+.role_manage {
+ width: 100%;
+ height: 100%;
+}
+
+.title {
+ line-height: 15px;
+}
+
+.search {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-top: 10px;
+}
+
+.search_thing {
+ width: 14em;
+ display: flex;
+ align-items: center;
+}
+
+.search_label {
+ width: 80px;
+ font-size: 14px;
+ text-align: right;
+}
+
+.search_input {
+ width: calc(100% - 80px);
+}
+
+.table {
+ margin-top: 12px;
+ background-color: #fff;
+ height: calc(100vh - 17em);
+}
+
+.el-form-item {
+ margin-bottom: 16px;
+}
+
+.picName {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ word-break: break-all;
+ width: 120px;
+}
+</style>
diff --git a/src/views/CNAS/resourceDemand/device/component/operationInstruction.vue b/src/views/CNAS/resourceDemand/device/component/operationInstruction.vue
new file mode 100644
index 0000000..ab82ea4
--- /dev/null
+++ b/src/views/CNAS/resourceDemand/device/component/operationInstruction.vue
@@ -0,0 +1,525 @@
+<!-- 浣滀笟鎸囧涔� -->
+<template>
+ <div>
+ <div style="margin: 10px 0;text-align: right">
+<!-- <el-button size="small" type="primary" @click="getList">鍒锋柊</el-button>-->
+ <el-button size="small" type="primary" @click="dialogVisible = true">鍙楁帶鐢宠</el-button>
+ </div>
+ <el-table :data="tableData" border height="calc(100vh - 18em)">
+ <el-table-column type="index" label="搴忓彿" width="120">
+ <template v-slot="scope">
+ <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="鐢宠缂栧彿" min-width="150" prop="applicationNumber"></el-table-column>
+ <el-table-column label="璁惧鍚嶇О" min-width="150" prop="deviceName"></el-table-column>
+ <el-table-column label="璁惧缂栧彿" min-width="150" prop="deviceNumber"></el-table-column>
+ <el-table-column label="璁惧鍨嬪彿" min-width="150" prop="deviceModel"></el-table-column>
+ <el-table-column label="鏂囦欢缂栧彿" min-width="150" prop="documentNumber"></el-table-column>
+ <el-table-column label="鏂囦欢鍚嶅瓧" min-width="150" prop="fileName"></el-table-column>
+ <el-table-column label="鏂囨。璇存槑" min-width="150" prop="documentNote"></el-table-column>
+ <el-table-column label="涓婁紶浜�" min-width="150" prop="uploaderName"></el-table-column>
+ <el-table-column label="涓婁紶鏃堕棿" min-width="150" prop="updateTime"></el-table-column>
+ <el-table-column label="鐢熸晥鏃堕棿" min-width="150" prop="entryIntoForceTime"></el-table-column>
+ <el-table-column label="瀹℃壒浜�" min-width="150" prop="approverName"></el-table-column>
+ <el-table-column label="瀹℃壒鐘舵��" min-width="150" prop="status">
+ <template v-slot="scope">
+ {{ scope.row.status === true ? '閫氳繃' : scope.row.status === false ? '涓嶉�氳繃' : '鏈鏍�' }}
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" min-width="180" fixed="right" prop="name">
+ <template v-slot="scope">
+ <el-button type="text" size="small" @click="downloadFile(scope.row.fileSystemName)">涓嬭浇</el-button>
+ <el-button type="text" size="small" style="color: red;"
+ @click="deleteHomeworkGuidebook(scope.row)" :disabled="scope.row.status === true">鍒犻櫎</el-button>
+ <el-button type="text" size="small" @click="instructionEditFun(scope.row)" :disabled="scope.row.status === true">缂栬緫</el-button>
+ <el-button type="text" size="small" @click="approval(scope.row)" :disabled="scope.row.status === true">瀹℃壒</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="1"
+ :page-sizes="[10, 20, 30, 50, 100]" :page-size="search.size" layout="->,total, sizes, prev, pager, next, jumper"
+ :total="search.total">
+ </el-pagination>
+ <el-dialog :visible.sync="dialogVisible" title="鍙楁帶鐢宠" width="60%">
+ <div style="height: 60vh; overflow-y: auto; overflow-x: hidden;">
+ <el-form ref="form1" label-width="110px" :model="instructionForm">
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="鐢宠缂栧彿:">
+ <el-input v-model="instructionForm.applicationNumber" disabled size="small" clearable></el-input>
+ </el-form-item>
+ <el-form-item label="闄勪欢锛�" style="float: left;">
+ <el-upload ref="uploadFile" :action="action" :before-remove="beforeRemove" :file-list="fileList1"
+ :headers="uploadHeader" :limit="1" :on-error="onError" :on-exceed="handleExceed"
+ :on-remove="handleRemove1" :on-success="onSuccess1" class="upload-demo" multiple>
+ <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
+ </el-upload>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鐢宠閮ㄩ棬:">
+ <el-input v-model="instructionForm.applicationDepartment" clearable size="small"></el-input>
+ </el-form-item>
+ <el-form-item label="璐d换浜�:">
+ <el-input v-model="instructionForm.personLiable" clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="鍙楁帶鐢宠璇存槑:" prop="controlledApplicationDescription"
+ :rules="[{ required: true, message: '璇疯緭鍏ュ彈鎺х敵璇疯鏄�', trigger: 'blur' }]">
+ <el-input v-model="instructionForm.controlledApplicationDescription" type="textarea"
+ clearable></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ <div style="text-align: right; margin-bottom: 10px">
+ <el-button size="small" type="primary" @click="openAddDia">娣诲姞鍙楁帶鏂囦欢</el-button>
+ <el-button size="small" @click="delFile">鍒犻櫎</el-button>
+ </div>
+ <el-table :data="documentTableData" border style="width: 100%;" tooltip-effect="dark" :row-key="getRowKey"
+ @selection-change="handleSelectionChange" height="29em">
+ <el-table-column type="selection" width="55%">
+ </el-table-column>
+ <el-table-column label="搴忓彿" prop="id" type="index" width="60"></el-table-column>
+ <el-table-column label="璁惧鍚嶇О" prop="deviceName" show-overflow-tooltip min-width="125"></el-table-column>
+ <el-table-column label="璁惧缂栧彿" prop="deviceNumber" show-overflow-tooltip min-width="125"></el-table-column>
+ <el-table-column label="璁惧鍨嬪彿" prop="deviceModel" show-overflow-tooltip min-width="125"></el-table-column>
+ <el-table-column label="鏂囨。缂栧彿" prop="documentNumber" show-overflow-tooltip min-width="125"></el-table-column>
+ <el-table-column label="鏂囦欢鍚嶇О" prop="fileName" show-overflow-tooltip min-width="125"></el-table-column>
+ <el-table-column label="涓婁紶浜�" prop="author" show-overflow-tooltip min-width="125"></el-table-column>
+ <el-table-column label="涓婁紶鏃堕棿" prop="updateTime" show-overflow-tooltip min-width="125"></el-table-column>
+ <el-table-column min-width="100" label="鎿嶄綔" fixed="right">
+ <template v-slot="scope">
+ <el-button type="text" size="small" @click="downloadFile(scope.row.fileSystemName)">涓嬭浇</el-button>
+ <el-button type="text" @click="editFun(scope.row, scope.$index)">缂栬緫</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ <span slot="footer">
+ <el-button @click="dialogVisible = false" size="small">鍙� 娑�</el-button>
+ <el-button size="small" type="primary" @click="submitFun">鎻愪氦</el-button>
+ </span>
+ </el-dialog>
+ <el-dialog :visible.sync="dialogVisible1" title="娣诲姞璁惧浣滀笟鎸囧涔�" width="40%">
+ <div style="height: 50vh;">
+ <el-form ref="form" :model="form" label-width="90px">
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="鏂囦欢绫诲瀷:" prop="documentType"
+ :rules="[{ required: true, message: '璇疯緭鍏ユ枃浠剁被鍨�', trigger: 'blur' }]">
+ <el-input v-model="form.documentType" clearable size="small" placeholder="璇疯緭鍏ユ枃浠剁被鍨�"></el-input>
+ </el-form-item>
+ <el-form-item label="璁惧鍚嶇О:" prop="deviceName"
+ :rules="[{ required: true, message: '璇烽�夋嫨璁惧', trigger: 'change' }]">
+ <el-select v-model="form.deviceName" size="small" clearable style="width: 100%" placeholder="璇烽�夋嫨璁惧鍚嶇О"
+ @change="onDeviceNameChange" filterable>
+ <el-option v-for="item in deviceNameOption" :key="item.id" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鏂囨。缂栧彿:" prop="documentNumber"
+ :rules="[{ required: true, message: '璇疯緭鍏ユ枃妗g紪鍙�', trigger: 'blur' }]">
+ <el-input v-model="form.documentNumber" size="small" clearable placeholder="璇疯緭鍏ユ枃妗g紪鍙�"></el-input>
+ </el-form-item>
+ <el-form-item label="绠$悊缂栧彿:">
+ <el-input v-model="form.deviceNumber" size="small" clearable disabled placeholder="璇疯緭鍏ョ鐞嗙紪鍙�"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鏂囦欢鐗堟湰:" prop="documentVersion"
+ :rules="[{ required: true, message: '璇疯緭鍏ユ枃浠剁増鏈�', trigger: 'blur' }]">
+ <el-input v-model="form.documentVersion" size="small" placeholder="璇疯緭鍏ユ枃浠剁増鏈�" clearable></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="浣滆��:" prop="author" :rules="[{ required: true, message: '璇疯緭鍏ヤ綔鑰�', trigger: 'blur' }]">
+ <el-input v-model="form.author" size="small" clearable></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鎻愪氦鏃ユ湡:" prop="submitDate"
+ :rules="[{ required: true, message: '璇烽�夋嫨鎻愪氦鏃ユ湡', trigger: 'change' }]">
+ <el-date-picker v-model="form.submitDate" format="yyyy-MM-dd" style="width: 100%" size="small" clearable
+ placeholder="閫夋嫨鏃ユ湡" type="date" value-format="yyyy-MM-dd">
+ </el-date-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="鏂囨。璇存槑:" prop="documentNote"
+ :rules="[{ required: true, message: '璇疯緭鍏ユ枃妗h鏄�', trigger: 'blur' }]">
+ <el-input v-model="form.documentNote" placeholder="璇疯緭鍏ユ枃妗h鏄�" type="textarea" clearable></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="闄勪欢锛�" style="float: left;">
+ <el-upload ref="uploadFile" :action="action" :before-remove="beforeRemove" :file-list="fileList"
+ :headers="uploadHeader" :limit="1" :on-error="onError" :on-exceed="handleExceed"
+ :on-remove="handleRemove" :on-success="onSuccess" class="upload-demo" multiple>
+ <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
+ </el-upload>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ </div>
+ <span slot="footer">
+ <el-button @click="closeDia" size="small">鍙� 娑�</el-button>
+ <el-button type="primary" @click="addFile" size="small">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import fileDownload from "@/utils/file";
+import {
+ approvalOfHomeworkInstructionManual,
+ homeworkGuidebook,
+ homeworkGuidebookEditor,
+ newHomeworkGuidebookAdded,
+ deleteHomeworkGuidebook,
+ pageByPageQueryOfHomeworkInstructions,
+ selectDeviceParameter,
+} from '@/api/cnas/resourceDemand/device.js'
+export default {
+ props: {
+ clickNodeVal: {
+ type: Object,
+ default: () => {
+ return {};
+ }
+ }
+ },
+ name: '',
+ components: {},
+ data() {
+ return {
+ search: {
+ size: 20,
+ current: 1,
+ total: 0
+ },
+ dialogVisible: false,
+ dialogVisible1: false,
+ value: '',
+ selectRow: null,
+ device: null,
+ tableDataIndex: '',
+ form: {
+ documentType: '',
+ documentNumber: '',
+ deviceName: '',
+ deviceModel: '',
+ deviceNumber: '',
+ fileName: '',
+ fileSystemName: '',
+ submitDate: '',
+ documentNote: '',
+ },
+ tableData: [],
+ documentTableData: [],
+ formData: {},
+ fileList: [],
+ fileList1: [],
+ laboratoryNameIsNull: false,
+ devices: [], //璁惧鍒楄〃鏁版嵁
+ deviceNameOption: [], //璁惧鍚嶇О涓嬫媺妗嗘暟鎹�
+ entity: {
+ deviceName: null,
+ laboratoryName: '',
+ storagePoint: ''
+ },
+ selectedRow: [],
+ instructionForm: {
+ applicationNumber: '', // 鐢宠缂栧彿
+ applicationDepartment: '', // 鐢宠閮ㄩ棬
+ personLiable: '', // 璐d换浜�
+ controlledApplicationDescription: '', // 鍙楁帶鐢宠璇存槑
+ }
+ }
+ },
+ mounted() {
+ this.getAllDevice();
+ this.getList()
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ clickNodeVal(newVal) {
+ if (newVal) {
+ this.getList()
+ this.clickSidebar(newVal)
+ }
+ },
+ dialogVisible(newVal) {
+ if (newVal === false) {
+ this.instructionForm = {}
+ this.documentTableData = []
+ this.fileList1 = []
+ }
+ }
+ },
+ methods: {
+ approval(row) {
+ this.$confirm('鏄惁瀹℃壒閫氳繃锛�', '鎻愮ず', {
+ confirmButtonText: '閫氳繃',
+ cancelButtonText: '涓嶉�氳繃',
+ type: 'warning'
+ }).then(() => {
+ this.approvalFun(row.id, true)
+ }).catch(() => {
+ this.approvalFun(row.id, false)
+ });
+ },
+ approvalFun(id, status) {
+ approvalOfHomeworkInstructionManual({ id, status }).then(res => {
+ this.getList()
+ this.$message({
+ type: 'success',
+ message: '鎿嶄綔鎴愬姛!'
+ });
+ })
+
+ },
+ getRowKey(row) {
+ return row.index
+ },
+ deleteHomeworkGuidebook(row) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ homeworkGuidebook({
+ id: row.id,
+ instructionId: row.instructionId
+ }).then(res => {
+ this.$message.success('鍒犻櫎鎴愬姛锛�')
+ this.getList()
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
+ },
+ downloadFile(fileName) {
+ this.$download.saveAs(fileName, fileName)
+ },
+ instructionEditFun(row) {
+ this.dialogVisible = true
+ homeworkGuidebookEditor({ instructionId: row.instructionId }).then(res => {
+ if (res.code == 200) {
+ this.instructionForm = res.data.instruction;
+ if (this.instructionForm.fileSystemName) {
+ this.fileList1.push({ name: this.instructionForm.fileName })
+ }
+ this.documentTableData = res.data.list;
+ // 鍒犻櫎鐢�
+ this.documentTableData.forEach((v, k) => {
+ v.index = k
+ })
+ }
+ })
+ },
+ handleSizeChange(val) {
+ this.search.size = val
+ this.getList()
+ },
+ handleCurrentChange(val) {
+ this.search.current = val
+ this.getList()
+ },
+ submitFun() {
+ this.$refs.form1.validate((valid) => {
+ if (valid) {
+ this.instructionForm.feTempHumRecordList = this.documentTableData
+ newHomeworkGuidebookAdded(this.instructionForm).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鎿嶄綔鎴愬姛锛�')
+ this.dialogVisible = false
+ this.getList()
+ }
+ })
+ } else {
+ return false;
+ }
+ });
+ },
+ clickSidebar(clickNodeVal) {
+ this.laboratoryNameIsNull = false
+ // 鏄惁瀛樺湪value锛屽瓨鍦╲alue浠h〃涓轰笁绾�
+ if (!clickNodeVal.value) {
+ this.list = [];
+ this.entity.laboratoryName = null
+ this.entity.storagePoint = null
+ // 绛変簬1浠h〃涓烘爲鐨勪竴绾э紝label涓洪儴闂�
+ if (clickNodeVal.label === '鍏朵粬') {
+ this.laboratoryNameIsNull = true
+ this.getAllDevice()
+ return
+ }
+ if (clickNodeVal.level === 1) {
+ this.entity.laboratoryName = clickNodeVal.label
+ // 绛変簬浜岀骇銆俵abel涓哄瓨鍌ㄥ湴鐐�
+ } else if (clickNodeVal.level === 2) {
+ // 鍏朵粬琛ㄧず娌℃湁閰嶇疆瀹為獙瀹わ紝鍙厤缃簡鍦扮偣
+ if (clickNodeVal.parent.label === '鍏朵粬') {
+ this.laboratoryNameIsNull = true
+ } else {
+ this.entity.laboratoryName = clickNodeVal.parent.label
+ }
+ this.entity.storagePoint = clickNodeVal.label
+ }
+ this.getAllDevice()
+ }
+ },
+ // 鏂板
+ addFile() {
+ this.$refs.form.validate((valid) => {
+ if (valid) {
+ if (this.tableDataIndex !== undefined) {
+ this.$set(this.documentTableData, this.tableDataIndex, this.form)
+ this.dialogVisible1 = false;
+ this.$message.success('淇敼鎴愬姛');
+ console.log('this.documentTableData---edit', this.documentTableData[this.tableDataIndex])
+ } else {
+ this.documentTableData.push(this.form);
+ this.dialogVisible1 = false;
+ this.$message.success('娣诲姞鎴愬姛');
+ }
+ } else {
+ return false;
+ }
+ });
+ },
+ openAddDia() {
+ this.dialogVisible1 = true
+ this.tableDataIndex = undefined;
+ this.form = {}
+ this.form.deviceName = this.clickNodeVal.label
+ this.onDeviceNameChange()
+ this.fileList = []
+
+ },
+ editFun(row, index) {
+ this.form = { ...row }
+ this.tableDataIndex = index;
+ console.log('this.tableDataIndex', this.tableDataIndex)
+ // 鍥炴樉鍒楄〃
+ if (this.form.fileSystemName) {
+ this.fileList.push({ name: this.form.fileName })
+ }
+ this.dialogVisible1 = true
+ },
+ closeDia() {
+ this.dialogVisible1 = false
+ this.$refs['form'].resetFields()
+ this.fileList = []
+ },
+ handleSelectionChange(selected) {
+ this.selectedRow = selected
+ },
+ async delFile() {
+ if (this.selectedRow.length === 0) {
+ this.$message.error('璇烽�夋嫨瑕佸垹闄ょ殑閫夐」');
+ return;
+ }
+ // 鍒犻櫎淇濆瓨濂界殑鏁版嵁
+ let ids = this.selectedRow
+ .filter(item => item.id !== undefined)
+ .map(item => item.id).join(',');
+ //鏈夐敊璇�
+ const res = await deleteHomeworkGuidebook({ ids });
+ if (res.code === 200) {
+ // 鍒犻櫎瑙嗗浘鐨勬暟鎹�
+ for (const resKey in this.selectedRow) {
+ this.documentTableData = this.documentTableData.filter(item => item.index === this.selectedRow[resKey].index)
+ }
+ this.$message.success({
+ message: '鍒犻櫎鎴愬姛',
+ type: 'success'
+ });
+ }
+ },
+ onSuccess(response, file, fileList) {
+ this.form.fileName = file.name;
+ this.form.fileSystemName = response.data;
+ },
+ onSuccess1(response, file, fileList) {
+ this.instructionForm.fileName = file.name;
+ this.instructionForm.fileSystemName = response.data;
+ },
+ onError(error, file, fileList) {
+ this.$message.error('涓婁紶澶辫触:', error, file, fileList);
+ },
+ handleRemove(file, fileList) {
+ this.form.fileName = ''
+ this.form.fileSystemName = ''
+ },
+ handleRemove1(file, fileList) {
+ this.form.fileName = ''
+ this.form.fileSystemName = ''
+ },
+ beforeRemove(file) {
+ return this.$confirm(`纭畾绉婚櫎 ${file.name}锛焋)
+ },
+ handleExceed(files, fileList) {
+ this.$message.warning(`褰撳墠闄愬埗閫夋嫨 1 涓枃浠讹紝鏈閫夋嫨浜� ${files.length} 涓枃浠躲�俙);
+ },
+ getList() {
+ pageByPageQueryOfHomeworkInstructions({ ...this.search }).then(res => {
+ if (res.code == 200) {
+ this.tableData = res.data.records;
+ this.search.total = res.data.total
+ }
+ })
+ },
+ getAllDevice() {
+ selectDeviceParameter({ laboratoryNameIsNull: this.laboratoryNameIsNull }).then(res => {
+ if (res.code == 200) {
+ this.devices = res.data.records;
+ this.updateDeviceNameOptions();
+ }
+ })
+ },
+ // 鏇存柊璁惧鍚嶇О涓嬫媺妗嗙殑閫夐」
+ updateDeviceNameOptions() {
+ this.deviceNameOption = this.devices.map(device => ({
+ value: device.deviceName,
+ label: device.deviceName
+ }));
+ },
+ // 璁惧鍚嶇О鏀瑰彉鏃惰Е鍙�
+ onDeviceNameChange() {
+ // 鏍规嵁閫変腑鐨勮澶囧悕绉帮紝鏇存柊绠$悊缂栧彿涓嬫媺妗嗙殑閫夐」
+ const selectedDevice = this.devices.find(device => device.deviceName === this.form.deviceName);
+ if (selectedDevice) {
+ this.form.deviceNumber = selectedDevice.managementNumber;
+ this.form.deviceModel = selectedDevice.specificationModel;
+ this.form.deviceId = selectedDevice.id
+ }
+ },
+ },
+ computed: {
+ action() {
+ return this.javaApi + '/personBasicInfo/saveCNASFile'
+ }
+ },
+}
+</script>
+
+<style scoped>
+h4 {
+ font-weight: 400;
+ font-size: 16px;
+ display: flex;
+ justify-content: flex-end;
+ margin: 10px 0;
+}
+</style>
diff --git a/src/views/CNAS/resourceDemand/device/component/operationOverview.vue b/src/views/CNAS/resourceDemand/device/component/operationOverview.vue
new file mode 100644
index 0000000..7f87754
--- /dev/null
+++ b/src/views/CNAS/resourceDemand/device/component/operationOverview.vue
@@ -0,0 +1,220 @@
+<!-- 璁惧杩愯鎬昏 -->
+<template>
+ <div>
+ <div class="page">
+ <echart-module id="'page-left'" :config="chartConfig" :datas="chartData" class="page-left"></echart-module>
+ <div class="page-right">
+ <div class="form-item">
+ <label>鍚敤鏃堕暱(骞�)</label>
+ <span>{{deviceData.usedYears}}</span>
+ </div>
+ <div class="form-item">
+ <label>鏁呴殰娆℃暟</label>
+ <span>{{deviceData.faultCount}}</span>
+ </div>
+ <div class="form-item">
+ <label>鏈�杩戞晠闅滄棩鏈�</label>
+ <span>{{ deviceData.faultDate }}</span>
+ </div>
+ <div class="form-item">
+ <label>鏈�杩戞牎鍑嗘棩鏈�</label>
+ <span>{{deviceData.lastCalibrationDate }}</span>
+ </div>
+ <div class="form-item">
+ <label>涓嬫鏍″噯鏃ユ湡</label>
+ <span>{{deviceData.nextCalibrationDate}}</span>
+ </div>
+ <div class="form-item">
+ <label>鏍″噯鎬荤粨璁�</label>
+ <span :class="formatColorStyle(deviceData.calibrateStatus)">{{ deviceData.calibrateStatus }}</span>
+ </div>
+ <div class="form-item">
+ <label>鏈�杩戞牳鏌ユ棩鏈�</label>
+ <span>{{deviceData.lastExamineDate}}</span>
+ </div>
+ <div class="form-item">
+ <label>涓嬫鏍告煡鏃ユ湡</label>
+ <span>{{deviceData.nextExamineDate}}</span>
+ </div>
+ <div class="form-item">
+ <label>鏍告煡鎬荤粨璁�</label>
+ <span :class="formatColorStyle(deviceData.examineStatus)">{{deviceData.examineStatus}}</span>
+ </div>
+ <div class="form-item">
+ <label>璁惧杩愯鐘舵��</label>
+ <span :class="formatColorStyle(deviceData.deviceStatus)">{{deviceData.deviceStatus}}</span>
+ </div>
+ <div class="form-item">
+ <label>鏈�杩戠淮鎶ゆ棩鏈�</label>
+ <span>{{ deviceData.maintenanceDate }}</span>
+ </div>
+ <div class="form-item">
+ <label>涓嬫缁存姢鏃ユ湡</label>
+ <span>{{ deviceData.nextMaintenanceDate }}</span>
+ </div>
+ <div class="form-item">
+ <label>缁存姢绫诲瀷</label>
+ <span>{{ deviceData.maintenanceType }}</span>
+ </div>
+ <div class="form-item">
+ <label>娴嬮噺椤圭洰</label>
+ <span>{{ deviceData.insProduct }}</span>
+ </div>
+ </div>
+ </div>
+ </div>
+</template>
+
+<script>
+import EchartModule from '@/components/Echart/echart.vue'
+import {device} from "@/api/cnas/resourceDemand/device";
+
+export default {
+ components: { EchartModule },
+ props: {
+ clickNodeVal: {
+ type: Object,
+ default: () => {
+ return {};
+ }
+ }
+ },
+ data() {
+ return {
+ chartConfig: {
+ height: '',
+ isLoading: true,
+ type: 'gauge'
+ },
+ chartData: {
+ formatter: "宸茶繃鏍″噯鏃ユ湡鐧惧垎姣�: {c}%",
+ color: [
+ [0.3, '#21a700'],
+ [0.7, '#0066ff'],
+ [1, '#d80000']
+ ],
+ value: 0,
+ },
+ form: {
+ value1: ''
+ },
+ formData: {
+ usedAge: 12
+ },
+ //璁惧鏁版嵁鏀堕泦
+ deviceData: {
+
+ }
+ }
+ },
+ mounted() {
+ //鑾峰彇璁惧鏁呴殰鐨勪俊鎭�
+ this.getDeviceInfo(this.clickNodeVal.value);
+ },
+ methods: {
+ formatColorStyle(status) {
+ if (status == null || status == "" || status == undefined) {
+ return ""
+ }
+ let styleStr = ''
+ switch (status) {
+ case "鍚堟牸":
+ styleStr = 'success'
+ break;
+ case "涓嶅悎鏍�":
+ styleStr = 'failed'
+ break;
+ case "鍏朵粬":
+ styleStr = 'other'
+ break;
+ case "姝e父":
+ styleStr = 'success'
+ break;
+ case "缁翠慨":
+ styleStr = 'other'
+ break;
+ case "鍋滅敤":
+ styleStr = 'stop'
+ break;
+ case "鎶ュ簾":
+ styleStr = 'failed'
+ break;
+ }
+ return styleStr;
+ },
+ //鑾峰彇璁惧杩愯鎬昏淇℃伅
+ getDeviceInfo(deviceId) {
+ device({deviceId: deviceId}).then(res => {
+ if (res.code == 200) {
+ this.deviceData = res.data
+ this.chartData.value = res.data.progress
+ }
+ })
+ },
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ clickNodeVal(newVal) {
+ // 鏄惁瀛樺湪value锛屽瓨鍦╲alue浠h〃涓轰笁绾�
+ if (this.clickNodeVal.value) {
+ this.getDeviceInfo(newVal.value)
+ }
+ }
+ }
+}
+</script>
+
+<style scoped>
+.page {
+ width: 100%;
+ height: 100vh;
+ display: flex;
+}
+
+.page-left {
+ width: 420px;
+ height: 420px;
+ margin-top: 40px;
+ margin-right: 40px;
+}
+
+.page-right {
+ flex: 1;
+ height: calc(100% - 200px);
+ overflow: scroll;
+ /* background: red; */
+}
+
+.form-item {
+ line-height: 42px;
+ font-size: 14px;
+}
+
+.page-right label {
+ color: #999;
+ width: 110px;
+ display: inline-block;
+ text-align: right;
+ margin-right: 20px;
+}
+
+.el-radio__input.is-disabled+span.el-radio__label {
+ color: #606266 !important;
+}
+
+.success {
+ color: #21a700
+}
+
+.failed {
+ color: #d80000
+}
+
+.other {
+ color: #e8a849;
+}
+
+.stop {
+ color: #909399;
+}
+</style>
diff --git a/src/views/CNAS/resourceDemand/device/component/record.vue b/src/views/CNAS/resourceDemand/device/component/record.vue
new file mode 100644
index 0000000..d4eec0c
--- /dev/null
+++ b/src/views/CNAS/resourceDemand/device/component/record.vue
@@ -0,0 +1,474 @@
+<!-- 浣跨敤璁板綍 -->
+<template>
+ <div>
+ <div class="search">
+ <div class="search_thing">
+ <div class="search_label">娴佺▼缂栧彿锛�</div>
+ <el-input v-model="search.deviceNumber" clearable placeholder="璇疯緭鍏�" size="small" style="width: 70%;"
+ @keyup.enter.native="getTableList(clickNodeVal.value)"></el-input>
+ </div>
+ <div class="search_thing" style="padding-left: 30px;">
+ <el-button size="small" @click="resetSearch">閲� 缃�</el-button>
+ <el-button size="small" type="primary" @click="getTableList(clickNodeVal.value)">鏌� 璇�</el-button>
+ </div>
+ <div class="btns">
+ <el-button size="small" type="primary" @click="dialogVisible = true, openAdd()">鏂� 寤�</el-button>
+ <el-button :loading="outLoading" size="small" type="primary" @click="handleDown">瀵� 鍑�</el-button>
+ </div>
+ </div>
+ <div class="tables" style="margin-top: 16px;">
+ <el-table ref="Recordtable" :data="formParamList" height="calc(100vh - 20em)">
+ <!-- 琛ㄦ牸鍒� -->
+ <el-table-column label="搴忓彿" type="index" width="120">
+ <template v-slot="scope">
+ <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="鏍峰搧缂栧彿" min-width="180" prop="deviceNumber" />
+ <el-table-column label="璁惧鍚嶇О" min-width="150" prop="deviceName" />
+ <el-table-column label="绠$悊缂栧彿" min-width="150" prop="managementNumber" />
+ <el-table-column label="娓╁害(掳C)" min-width="120" prop="temperature" />
+ <el-table-column label="婀垮害(%RH)" min-width="120" prop="humidity" />
+ <el-table-column label="浣跨敤鍓�" min-width="120" prop="useBefore">
+ <template v-slot="scope">
+ {{ scope.row.useBefore === 1 ? '姝e父' : '涓嶆甯�' }}
+ </template>
+ </el-table-column>
+ <el-table-column label="浣跨敤鍚�" min-width="120" prop="useAfter">
+ <template v-slot="scope">
+ {{ scope.row.useAfter === 1 ? '姝e父' : '涓嶆甯�' }}
+ </template>
+ </el-table-column>
+ <el-table-column label="寮傚父鎯呭喌" min-width="120" prop="abnormal" />
+ <el-table-column label="浣跨敤寮�濮嬫棩鏈�" min-width="150" prop="useStartDate" />
+ <el-table-column label="浣跨敤缁撴潫鏃ユ湡" min-width="150" prop="useEndDate" />
+ <el-table-column label="浣跨敤浜�" min-width="120" prop="usePerson" />
+ <el-table-column label="澶囨敞" min-width="120" prop="remark" />
+ <!-- 鎿嶄綔鎸夐挳 -->
+ <el-table-column fixed="right" label="鎿嶄綔" width="130">
+ <template slot-scope="scope">
+ <el-button size="small" type="text" @click="showDetailsDialog(scope.row)">鏌ョ湅璇︽儏</el-button>
+ <el-button size="small" type="text" @click="handleDeleteClick(scope.$index, scope.row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]"
+ :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
+ @current-change="handleCurrentChange">
+ </el-pagination>
+ </div>
+ <el-dialog :visible.sync="dialogVisible" title="浠櫒璁惧浣跨敤璁板綍琛�" top="5vh" width="55%">
+ <el-form ref="form" :model="form" label-width="130px">
+ <el-row>
+ <el-col :span="24">
+ <el-form-item label="鏍峰搧缂栧彿:">
+ <el-input v-model="form.deviceNumber" disabled size="small" style="width: 100%;"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璁惧鍚嶇О:" required>
+ <el-input v-model="form.deviceName" :disabled="true" size="small" style="width: 100%;"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="绠$悊缂栧彿:" required>
+ <el-input v-model="form.managementNumber" :disabled="true" size="small" style="width: 100%;"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :rules="[{ required: true, message: '璇疯緭鍏ユ俯搴�(掳C)', trigger: 'blur' }]" label="娓╁害(掳C):"
+ prop="temperature">
+ <el-input v-model="form.temperature" :disabled="isShow" size="small" style="width: 100%;"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :rules="[{ required: true, message: '璇疯緭鍏ユ箍搴�(%RH)', trigger: 'blur' }]" label="婀垮害(%RH):"
+ prop="humidity">
+ <el-input v-model="form.humidity" :disabled="isShow" size="small" style="width: 100%;"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :rules="[{ required: true, message: '璇烽�夋嫨浣跨敤鍓�', trigger: 'change' }]" label="浣跨敤鍓�:"
+ prop="useBefore">
+ <el-radio-group v-model="form.useBefore" :disabled="isShow">
+ <el-radio :label="1">姝e父</el-radio>
+ <el-radio :label="0">涓嶆甯�</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :rules="[{ required: true, message: '璇烽�夋嫨浣跨敤鍚�', trigger: 'change' }]" label="浣跨敤鍚�:"
+ prop="useAfter">
+ <el-radio-group v-model="form.useAfter" :disabled="isShow">
+ <el-radio :label="1">姝e父</el-radio>
+ <el-radio :label="0">涓嶆甯�</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ </el-col>
+ <el-col v-if="form.useAfter === 0" :span="24">
+ <el-form-item :rules="[{ required: form.useAfter === 0, message: '璇疯緭鍏ュ紓甯告儏鍐�', trigger: 'blur' }]" label="寮傚父鎯呭喌:"
+ prop="abnormal">
+ <el-input v-model="form.abnormal" :disabled="isShow" size="small" style="width: 100%;"
+ type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :rules="[{ required: true, message: '璇疯緭鍏ヤ娇鐢ㄦ棩鏈�', trigger: 'blur' }]" label="浣跨敤鏃ユ湡:"
+ prop="useDateList">
+
+ <el-date-picker
+ v-model="form.useDateList"
+ :disabled="isShow"
+ value-format="yyyy-MM-dd"
+ type="daterange"
+ range-separator="鑷�"
+ start-placeholder="寮�濮嬫棩鏈�"
+ end-placeholder="缁撴潫鏃ユ湡">
+ </el-date-picker>
+ <!-- <el-date-picker
+ v-model="form.useDateList" :disabled="isShow" end-placeholder="缁撴潫鏃ユ湡" format="yyyy-MM-dd HH:mm:ss"
+ size="small"
+ start-placeholder="寮�濮嬫棩鏈�"
+ style="width:100%"
+ type="datetimerange"
+ value-format="yyyy-MM-dd HH:mm:ss">
+ </el-date-picker> -->
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :rules="[{ required: true, message: '璇疯緭鍏ヤ娇鐢ㄤ汉', trigger: 'change' }]" label="浣跨敤浜�:"
+ prop="usePerson">
+ <el-input v-model="form.usePerson" :disabled="isShow" size="small" style="width:100%"></el-input>
+ <!-- <el-select v-model="form.usePerson" placeholder="璇烽�夋嫨" :disabled="isShow" size="small" style="width:100%">
+ <el-option v-for="item in responsiblePersonList" :key="item.name" :label="item.name" :value="item.id">
+ </el-option>
+ </el-select> -->
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="澶囨敞:">
+ <el-input v-model="form.remark" :disabled="isShow" type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button v-if="!isShow" @click="dialogVisible = false">鍙� 娑�</el-button>
+ <el-button v-if="!isShow" type="primary" @click="saveRecord">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+<script>
+import {
+ deviceRecordPage,
+ exportUseRecord,
+ selectDeviceByCode,
+ saveDeviceRecord,
+ updateDeviceRecord,
+ deleteDeviceRecord,
+} from '@/api/cnas/resourceDemand/device.js'
+import { selectUserCondition } from "@/api/system/user";
+export default {
+ props: {
+ clickNodeVal: {
+ type: Object,
+ default: () => {
+ return {};
+ }
+ },
+ // 鍒ゆ柇鏄惁鏄閮ㄥ垎绂�
+ isMenuList: {
+ type: Number,
+ default: 0
+ }
+ },
+ data() {
+ return {
+ search: {
+ size: 20,
+ current: 1,
+ total: 0,
+ sampleCode: '',
+ managementNumber: ''
+ },
+ responsiblePersonList: {},
+ isShow: false,
+ outLoading: false,
+ ratifyDialog: false,
+ exportDate: '',
+ userList: [],
+ form: {
+ // deviceId:'',
+ processNumber: '',
+ deviceName: '',
+ managementNumber: '',
+ //娓╁害
+ temperature: '',
+ //婀垮害
+ humidity: '',
+ //浣跨敤鍓�
+ useBefore: 1,
+ //浣跨敤鍚�
+ useAfter: 1,
+ //寮傚父鎯呭喌
+ abnormal: '',
+ useDateList: [],
+ //浣跨敤鏃ユ湡
+ useStartDate: null,
+ useEndDate: null,
+ //浣跨敤浜�
+ usePerson: '',
+ usePersonId: '',
+ //澶囨敞
+ remark: '',
+ },
+ dialogVisible: false,
+ operationType: '',
+ formParamList: [],
+ }
+ },
+ mounted() {
+ this.getTableList(this.clickNodeVal.value);
+ },
+ methods: {
+ handleSizeChange(val) {
+ this.search.size = val
+ this.getTableList(this.clickNodeVal.value);
+ },
+ handleCurrentChange(val) {
+ this.search.current = val
+ this.getTableList(this.clickNodeVal.value);
+ },
+ resetSearch() {
+ this.search = {
+ size: 20,
+ current: 1,
+ total: 0,
+ sampleCode: '',
+ managementNumber: ''
+ }
+ this.getTableList(this.clickNodeVal.value);
+ },
+ async getTableList(deviceId) {
+ if (deviceId === undefined) {
+ deviceId = ''
+ }
+ await deviceRecordPage({
+ deviceId: deviceId,
+ ...this.search
+ }).then(res => {
+ if (res.code == 200) {
+ this.formParamList = res.data.records
+ this.search.total = res.data.total
+ }
+ })
+ },
+ // 鎵撳紑瀵煎嚭寮规閫夋嫨缂栧埗浜恒�佹壒鍑嗕汉
+ openHandleOut() {
+ this.ratifyDialog = true
+ },
+ //瀵煎嚭
+ handleDown() {
+ this.outLoading = true
+ exportUseRecord({
+ deviceId: this.clickNodeVal.value,
+ exportDate: this.exportDate
+ }).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/octet-stream' });
+ this.$download.saveAs(blob, '璁惧浣跨敤璁板綍.doc')
+ })
+ },
+ //鏂板缓
+ openAdd() {
+ this.operationType = 'add'
+ this.getUserList()
+ selectDeviceByCode({ id: this.clickNodeVal.value }).then(res => {
+ this.form.deviceName = res.data.deviceName
+ this.form.managementNumber = res.data.managementNumber
+ this.$nextTick(() => {
+ this.$refs['form'].clearValidate()
+ })
+ });
+ },
+ usePersonName(value) {
+ const index = this.userList.findIndex(item => item.id === value)
+ if (index > -1) {
+ this.form.usePerson = this.userList[index].name
+ }
+ },
+ //纭娣诲姞璁板綍
+ saveRecord() {
+ this.$refs.form.validate((valid) => {
+ if (valid) {
+ this.form.useStartDate = this.form.useDateList[0]
+ this.form.useEndDate = this.form.useDateList[1]
+ this.form.deviceId = this.clickNodeVal.value
+ if (this.operationType === 'add') {
+ saveDeviceRecord(this.form).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鏂板鎴愬姛')
+ this.getTableList(this.clickNodeVal.value)
+ this.dialogVisible = false
+ }
+ })
+ this.dialogVisible = false;
+ } else {
+ updateDeviceRecord(this.form).then(res => {
+ if (res.code == 200) {
+ this.$message.success('淇敼鎴愬姛')
+ this.getTableList(this.clickNodeVal.value)
+ this.dialogVisible = false
+ }
+ })
+ this.dialogVisible = false;
+ }
+ }
+ });
+ },
+ //鏌ョ湅璇︽儏
+ showDetailsDialog(type, row) {
+ this.operationType = type;
+ console.log(row)
+ this.dialogVisible = true;
+ this.getUserList()
+ this.form = row;
+ let list = []
+ if (row.useStartDate === null) {
+ row.useStartDate = ''
+ }
+ if (row.useEndDate === null) {
+ row.useEndDate = ''
+ }
+ list.push(row.useStartDate)
+ list.push(row.useEndDate)
+ this.$set(this.form, 'useDateList', list)
+ },
+ handleDeleteClick(index, row) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ枃浠�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deleteDeviceRecord({ id: row.id }).then(res => {
+ this.formParamList.splice(index, 1);
+ this.$message({
+ type: 'success',
+ message: '鍒犻櫎鎴愬姛!'
+ });
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
+ },
+ getUserList() {
+ selectUserCondition().then(res => {
+ this.userList = res.data
+ })
+ },
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ clickNodeVal(newVal) {
+ if (newVal.value) {
+ this.getTableList(newVal.value);
+ }
+ },
+ dialogVisible(newVal) {
+ if (newVal === false) {
+ this.form = {
+ // deviceId:'',
+ sampleCode: '',
+ deviceName: '',
+ managementNumber: '',
+ //娓╁害
+ temperature: '',
+ //婀垮害
+ humidity: '',
+ //浣跨敤鍓�
+ useBefore: 1,
+ //浣跨敤鍚�
+ useAfter: 1,
+ //寮傚父鎯呭喌
+ abnormal: '',
+ //浣跨敤鏃ユ湡
+ useDateList: [],
+ //浣跨敤浜�
+ usePersonId: '',
+ //澶囨敞
+ remark: '',
+ }
+ this.$refs.form.clearValidate()
+ }
+ }
+ }
+}
+</script>
+
+<style scoped>
+.tables {
+ width: 100%;
+ height: calc(100vh - 15em);
+}
+
+.el-from {
+ max-width: 400px;
+ margin: 0 auto;
+}
+
+.form-row {
+ display: flex;
+ justify-content: space-between;
+}
+
+.el-input {
+ width: calc(100% - 120px);
+ /* 纭繚杈撳叆妗嗗搴︿竴鑷� */
+}
+
+.form-row .el-form-item {
+ flex: 1;
+ /* 姣忎釜琛ㄥ崟椤瑰崰鎹浉鍚屾瘮渚嬬殑绌洪棿 */
+ margin-right: 100px;
+ /* 鍙�夛細涓哄彸渚у厓绱犳坊鍔犻棿璺� */
+}
+
+/* 绉婚櫎鏈�鍚庝竴涓厓绱犵殑鍙宠竟璺� */
+.form-row .el-form-item:last-child {
+ margin-right: 0;
+
+}
+
+.search {
+ background-color: #fff;
+ margin-top: 10px;
+ display: flex;
+ align-items: center;
+ position: relative;
+}
+
+.search_thing {
+ display: flex;
+ align-items: center;
+ height: 40px;
+
+}
+
+.search_label {
+ width: 140px;
+ font-size: 14px;
+ text-align: right;
+ margin-right: 10px;
+}
+
+.btns {
+ position: absolute;
+ right: 0px;
+ top: 50%;
+ transform: translate(0, -50%);
+}
+</style>
diff --git a/src/views/CNAS/resourceDemand/device/component/resource-reservation.vue b/src/views/CNAS/resourceDemand/device/component/resource-reservation.vue
new file mode 100644
index 0000000..7f3806b
--- /dev/null
+++ b/src/views/CNAS/resourceDemand/device/component/resource-reservation.vue
@@ -0,0 +1,464 @@
+<!-- 璧勬簮棰勫畾 -->
+<template>
+ <div class="role_manage">
+ <el-row class="title">
+ <el-col :span="24" style="text-align: right;padding:10px 0">
+ <el-date-picker
+ v-model="startTime"
+ format="yyyy-MM-dd"
+ placeholder="閫夋嫨璧峰鏃ユ湡"
+ size="mini"
+ type="date"
+ value-format="yyyy-MM-dd"/>
+ 鑷�
+ <el-date-picker
+ v-model="endTime"
+ format="yyyy-MM-dd"
+ placeholder="閫夋嫨缁撴潫鏃ユ湡"
+ size="mini"
+ type="date"
+ value-format="yyyy-MM-dd"/>
+ <el-button size="mini" type="primary" @click="ValidateAndQuery" style="margin-left: 10px">鏌� 璇�</el-button>
+ </el-col>
+ </el-row>
+ <div class="table-container">
+ <el-table v-loading="tableLoading" :data="tableData" border class="scrollable-table" style="width: 100%">
+ <el-table-column label="搴忓彿"
+ type="index"
+ width="60">
+ </el-table-column>
+ <el-table-column label="璁惧" min-width="60" prop="deviceName"/>
+ <el-table-column label="鏃堕棿" min-width="60" prop="time"/>
+ <el-table-column v-for="date in dates" :key="date" :label="date">
+ <template #default="{ row }">
+ <el-button v-if="!row[date]" size="mini" type="primary" @click="openModal(date, row)">
+ {{ getDisplayText(row, date) }}
+ </el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="showModal" title="棰勫畾淇℃伅"
+ top="5vh" width="70%">
+ <h4>
+ <el-button v-if="isBeforeDate()" size="small" @click="cancelReservation(selectedRow)">鍙栨秷棰勫畾</el-button>
+ <el-button v-if="isBeforeDate()" size="small" type="primary" @click="openAdd()">鏂板缓棰勫畾</el-button>
+ </h4>
+ <el-table ref="table" :data="tableData2" style="width: 100%" tooltip-effect="dark"
+ @close="ValidateAndQuery"
+ @selection-change="handleSelectionChange">
+ <el-table-column type="selection" width="55%">
+ </el-table-column>
+ <el-table-column label="搴忓彿" width="120">
+ <template #default="{ row, $index }">
+ <!-- 浣跨敤 $index 鏉ヨ幏鍙栬绱㈠紩锛岄�氬父浠�0寮�濮嬶紝鎵�浠�+1浠ョ鍚堝父瑙勫簭鍙蜂範鎯� -->
+ {{ $index + 1 }}
+ </template>
+ </el-table-column>
+ <el-table-column label="棰勫畾缂栧彿" prop="deviceNumber" width="120">
+ </el-table-column>
+ <el-table-column label="瀹㈡埛鍚嶇О" prop="customerName" show-overflow-tooltip>
+ </el-table-column>
+ <el-table-column label="鑱旂郴浜�" prop="linkPerson" show-overflow-tooltip>
+ </el-table-column>
+ <el-table-column label="鑱旂郴鐢佃瘽" prop="phone" show-overflow-tooltip>
+ </el-table-column>
+ <el-table-column label="棰勫畾璇存槑" prop="reservationSpecification" show-overflow-tooltip>
+ </el-table-column>
+ <el-table-column label="鍒涘缓浜�" prop="name" show-overflow-tooltip>
+ </el-table-column>
+ <el-table-column label="鍒涘缓鏃堕棿" prop="createDate" show-overflow-tooltip>
+ </el-table-column>
+ </el-table>
+ </el-dialog>
+ <el-dialog :visible.sync="addVisiable" title="鏂板缓棰勫畾" top="5vh" width="40%">
+ <el-form ref="addReservationForm" :model="addReservation" :rules="rules" label-width="90px">
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="棰勫畾璁惧:">
+ <el-input v-model="addReservation.deviceName"></el-input>
+ </el-form-item>
+ <el-form-item label="瀹㈡埛鍚嶇О:">
+ <el-input v-model="addReservation.customerName"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="棰勫畾鏃堕棿:">
+ <el-input v-model="addReservation.reservationTime"></el-input>
+ </el-form-item>
+ <el-form-item label="娴佺▼缂栧彿:">
+ <el-input v-model="addReservation.deviceNumber"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鑱旂郴浜�:">
+ <el-input v-model="addReservation.linkPerson"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鑱旂郴鐢佃瘽:" prop="phone">
+ <el-input v-model="addReservation.phone"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="棰勫畾璇存槑:" required>
+ <el-input v-model="addReservation.reservationSpecification" type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="addVisiable = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="addRecord">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import {
+ reservationDelete,
+ reservationSave,
+ reservationSelectDevice,
+ selectReservationParameterPage
+} from "@/api/cnas/resourceDemand/device";
+
+export default {
+ props: {
+ clickNodeVal: {
+ type: Object,
+ default: () => {
+ return {};
+ }
+ }
+ },
+ data() {
+ return {
+ timeSlots: ['09:00-12:00', '13:00-18:00', '18:00-22:00'],
+ dates: [],
+ showModal: false,
+ selectedDate: '',
+ selectedTime: '',
+ selectedDevice: '',
+ tableData: [],
+ tableLoading: false,
+ tableData2: [],
+ selectedReservationId: null, // 鐢ㄤ簬瀛樺偍閫変腑鐨処D
+ selectedRow: null,
+ addVisiable: false,
+ laboratoryNameIsNull: false,
+ currentPage: 1, // 褰撳墠椤�
+ pageSize: -1, // 涓�椤�16鏉�
+ startTime: '',
+ endTime: '',
+ entity: {
+ laboratoryName: '',
+ storagePoint: '',
+ },
+ addReservation: {
+ deviceName: '',
+ reservationTime: '',
+ specificTime: '',
+ customerName: '',
+ deviceNumber: '',
+ linkPerson: '',
+ phone: '',
+ reservationSpecification: ''
+ },
+ total: '',
+ yuyue: null,
+ yuyuetime: '',
+ rules: {
+ phone: [
+ {
+ required: true, message: '璇疯緭鍏ヨ仈绯荤數璇�',
+ trigger: 'blur'
+ },
+ {
+ pattern: /^1[3456789]\d{9}$/,
+ message: '璇疯緭鍏ユ纭殑鎵嬫満鍙风爜',
+ trigger: ['blur', 'change']
+ }
+ ]
+ },
+ appointment: ''
+ }
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ clickNodeVal(newVal) {
+ this.clickSidebar(newVal)
+ }
+ },
+ created() {
+ this.clickSidebar(this.clickNodeVal)
+ this.initDate();
+ },
+ mounted() {
+ // this.getStartTimeAndEndTime();
+ },
+ methods: {
+ isBeforeDate() {
+ let currentDate = this.$moment().format('YYYY-MM-DD')
+ let currentTime = this.$moment().format('HH')
+ const appointment = this.appointment && this.appointment.split('-')
+ let appointment0 = ''
+ let appointment1 = ''
+ if (appointment) {
+ appointment0 = appointment[0].slice(0, 2)
+ appointment1 = appointment[1].slice(0, 2)
+ }
+ if (currentDate < this.yuyuetime) {
+ // 鏈潵鐨勬棩鏈燂紝涓�瀹氳兘鏂板棰勭害
+ return true
+ } else if (currentDate === this.yuyuetime) {
+ // 褰撳ぉ鐨勬棩鏈燂紝宸茬粡杩囦簡鐨勬椂闂翠笉鍙彇娑堝拰鏂板
+ if (currentTime < appointment1) {
+ return true
+ } else if (currentTime > appointment1) {
+ return false
+ }
+ }
+ },
+ getDisplayText(row, date) {
+ if (!row || row.dateList === null || row.dateList === undefined || row.dateList === "") {
+ return '棰勭害';
+ }
+ const dateLst = row.dateList
+ for (const dateLstElement of dateLst) {
+ if (dateLstElement.date === date) {
+ if (dateLstElement.value === 0) {
+ return '棰勭害';
+ } else {
+ return dateLstElement.value;
+ }
+ }
+ }
+ return '棰勭害';
+ },
+
+ ValidateAndQuery() {
+ if (!this.startTime || !this.endTime) {
+ this.$message.error('璇烽�夋嫨鏃ユ湡鑼冨洿');
+ return;
+ }
+ if ((new Date(this.endTime) - new Date(this.startTime)) / (1000 * 60 * 60 * 24) >= 10) {
+ this.$message.error('鍙兘棰勭害10澶╀互鍐�');
+ return;
+ }
+ if (new Date(this.startTime) > new Date(this.endTime)) {
+ this.$message.error('寮�濮嬫棩鏈熶笉鑳藉ぇ浜庣粨鏉熸棩鏈�');
+ return;
+ }
+ this.query();
+ },
+ initDate() {
+ if (this.startTime == '' || this.endTime == '' || this.startTime == null || this.endTime == null) {
+ const daysAdd = 3;
+ const now = new Date();
+ this.startTime = now.getFullYear() + "-" +
+ String(now.getMonth() + 1).padStart(2, '0') + "-" +
+ String(now.getDate()).padStart(2, '0');
+ let endTime = new Date(now);
+ endTime.setDate(now.getDate() + daysAdd);
+ this.endTime = endTime.getFullYear() + "-" +
+ String(endTime.getMonth() + 1).padStart(2, '0') + "-" +
+ String(endTime.getDate()).padStart(2, '0');
+ const start = new Date(this.startTime);
+ const end = new Date(this.endTime);
+ const tempDates = [];
+ while (start <= end) {
+ const year = start.getFullYear();
+ const month = String(start.getMonth() + 1).padStart(2, '0'); // 鏈堜唤浠�0寮�濮嬶紝鎵�浠ュ姞1锛屽苟浣跨敤padStart琛�0
+ const day = String(start.getDate()).padStart(2, '0'); // 浣跨敤padStart琛�0
+ tempDates.push(`${year}-${month}-${day}`);
+ start.setDate(start.getDate() + 1);
+ }
+ this.dates = tempDates;
+ this.getStartTimeAndEndTime();
+ }
+ },
+ query() {
+ if (this.startTime && this.endTime) {
+ const start = new Date(this.startTime);
+ const end = new Date(this.endTime);
+ const tempDates = [];
+ while (start <= end) {
+ const year = start.getFullYear();
+ const month = String(start.getMonth() + 1).padStart(2, '0'); // 鏈堜唤浠�0寮�濮嬶紝鎵�浠ュ姞1锛屽苟浣跨敤padStart琛�0
+ const day = String(start.getDate()).padStart(2, '0'); // 浣跨敤padStart琛�0
+ tempDates.push(`${year}-${month}-${day}`);
+ start.setDate(start.getDate() + 1);
+ }
+ this.dates = tempDates;
+ this.getStartTimeAndEndTime();
+ }
+ },
+ //鏌ヨ鏃堕棿
+ getStartTimeAndEndTime() {
+ //鏌ヨ閫昏緫
+ this.tableLoading = true;
+ const params = {
+ current: this.currentPage,
+ size: this.pageSize,
+ starttime: this.startTime,
+ endtime: this.endTime,
+ laboratoryNameIsNull: this.laboratoryNameIsNull,
+ laboratoryName: this.entity.laboratoryName,
+ storagePoint: this.entity.storagePoint,
+ }
+ reservationSelectDevice(params).then(res => {
+ this.tableLoading = false;
+ if (res.code === 200) {
+ this.tableData = res.data;
+ }
+ }).catch(err => {
+ this.tableLoading = false;
+ })
+ },
+ // 鎵撳紑棰勭害寮规
+ openModal(date, row) {
+ console.log('date', date);
+ console.log('row', row);
+ this.yuyue = row;
+ this.yuyuetime = date;
+ this.appointment = row.time
+ this.showModal = true;
+ this.getList();
+ },
+ // 鎵撳紑鏂板缓棰勫畾寮规
+ openAdd() {
+ this.addVisiable = true;
+ this.addReservation.deviceId = this.yuyue.id;
+ this.addReservation.deviceName = this.yuyue.deviceName;
+ this.addReservation.reservationTime = this.yuyuetime + " " + this.yuyue.time;
+ this.addReservation.specificTime = this.yuyue.time;
+ this.addReservation.deviceNumber = 'TX-ABC-01' + Math.floor(Math.random() * 10 + 1);
+ },
+ handleSelectionChange(selected) {
+ this.selectedRow = selected.length > 0 ? selected : null;
+ },
+ async cancelReservation(selectedRow) {
+ if (!selectedRow || selectedRow.length == 0) {
+ this.$message.error('璇烽�夋嫨瑕佸垹闄ょ殑棰勭害');
+ return;
+ }
+ let ids = selectedRow.map(item => item.id).join(',');
+ try {
+ const res = await reservationDelete({ids: ids});
+ if (res.code === 200) {
+ this.$message.success({
+ message: '鍒犻櫎鎴愬姛',
+ type: 'success'
+ });
+ this.getList();
+ this.query();
+ this.showModal = false;
+ } else {
+ this.$message.error({
+ message: '鍒犻櫎澶辫触',
+ type: 'error'
+ });
+ }
+ } catch (error) {
+ this.$message.error({
+ message: '鍒犻櫎杩囩▼涓彂鐢熼敊璇紝璇风◢鍚庨噸璇�',
+ type: 'error'
+ });
+ }
+ },
+ addRecord() {
+ this.$refs.addReservationForm.validate((valid) => {
+ if (valid) {
+ this.addReservation.reservationTime = this.yuyuetime;
+ reservationSave(this.addReservation).then(res => {
+ if (res.code == 200) {
+ this.$message.success('淇濆瓨鎴愬姛')
+ this.addVisiable = false
+ this.getList();
+ this.query();
+ this.addReservation = {};
+ }
+ })
+ } else {
+ this.$message.error({message: '璇锋鏌ヨ〃鍗曞~鍐欐槸鍚︽纭�', type: 'error'});
+ return false;
+ }
+ });
+ },
+ // 棰勫畾淇℃伅鏌ヨ
+ getList() {
+ const params = {
+ deviceId: this.yuyue.id,
+ reservationTime: this.yuyuetime,
+ specificTime: this.yuyue.time,
+ }
+ selectReservationParameterPage(params).then(res => {
+ if (res.code == 200) {
+ this.tableData2 = res.data;
+ }
+ })
+ },
+ // 鐐瑰嚮渚ц竟鏍忓埛鏂�
+ clickSidebar(clickNodeVal) {
+ this.laboratoryNameIsNull = false
+ // 鏄惁瀛樺湪value锛屽瓨鍦╲alue浠h〃涓轰笁绾�
+ if (!clickNodeVal.value) {
+ this.finishLoding = false;
+ this.keyMap = {};
+ this.currentPage = 1;
+ this.list = [];
+ this.entity.laboratoryName = null
+ this.entity.storagePoint = null
+ // 绛変簬1浠h〃涓烘爲鐨勪竴绾э紝label涓洪儴闂�
+ if (clickNodeVal.label == '鍏朵粬') {
+ this.laboratoryNameIsNull = true
+ this.getStartTimeAndEndTime();
+ return
+ }
+ if (clickNodeVal.level == 1) {
+ this.entity.laboratoryName = clickNodeVal.label
+ // 绛変簬浜岀骇銆俵abel涓哄瓨鍌ㄥ湴鐐�
+ } else if (clickNodeVal.level == 2) {
+ // 鍏朵粬琛ㄧず娌℃湁閰嶇疆瀹為獙瀹わ紝鍙厤缃簡鍦扮偣
+ if (clickNodeVal.parent.label == '鍏朵粬') {
+ this.laboratoryNameIsNull = true
+ } else {
+ this.entity.laboratoryName = clickNodeVal.parent.label
+ }
+ this.entity.storagePoint = clickNodeVal.label
+ }
+ this.getStartTimeAndEndTime();
+ }
+ }
+ },
+
+}
+</script>
+
+<style scoped>
+.table-container {
+ overflow: auto;
+ height: calc(100vh - 15em);
+ /* 鍙互鏍规嵁闇�瑕佽皟鏁撮珮搴� */
+}
+
+.scrollable-table {
+ max-height: 100%;
+ overflow-y: auto;
+ /* overflow-x: auto; */
+}
+
+h4 {
+ font-weight: 400;
+ font-size: 16px;
+ display: flex;
+ justify-content: flex-end;
+ margin: 10px 0;
+}
+
+.form-row {
+ display: flex;
+ justify-content: space-between;
+}
+</style>
diff --git a/src/views/CNAS/resourceDemand/device/component/state.vue b/src/views/CNAS/resourceDemand/device/component/state.vue
new file mode 100644
index 0000000..e7467ce
--- /dev/null
+++ b/src/views/CNAS/resourceDemand/device/component/state.vue
@@ -0,0 +1,605 @@
+<!-- 璁惧鍋滅敤鍚敤 -->
+<template>
+ <div>
+ <div class="search">
+ <el-row :gutter="10" style="width: 100%;">
+ <el-col :span="20" style="display: flex;flex-wrap: wrap;">
+ <div class="search_thing">
+ <div class="search_label">娴佺▼缂栧彿锛�</div>
+ <div class="search_input">
+ <el-input v-model="search.processNumber" clearable placeholder="璇疯緭鍏�" size="small" style="width: 100%"
+ @keyup.enter.native="getDeviceStatePage(clickNodeVal.value)"></el-input>
+ </div>
+ </div>
+ <div class="search_thing" style="padding-left: 20px;">
+ <el-button size="small" @click="resetSearch">閲� 缃�</el-button>
+ <el-button size="small" type="primary" @click="getDeviceStatePage(clickNodeVal.value)">鏌� 璇�</el-button>
+ </div>
+ </el-col>
+ <el-col :span="4">
+ <div class="btns">
+ <el-button size="small" type="primary" @click="dialogVisible = true">鏂板缓</el-button>
+ <el-button :loading="outLoading" size="small" type="primary" @click="handleDown">瀵煎嚭Excel</el-button>
+ </div>
+ </el-col>
+ </el-row>
+ </div>
+ <div>
+ <el-table :data="tableDatalist" height="calc(100vh - 20em)" style="width: 100% ;">
+ <!-- 琛ㄦ牸鍒� -->
+ <el-table-column align="center" header-align="center" label="搴忓彿" prop="prop" type="index"
+ width="70"></el-table-column>
+ <el-table-column label="娴佺▼缂栧彿" min-width="180" prop="processNumber"></el-table-column>
+ <el-table-column label="璁惧鍚嶇О" min-width="180" prop="deviceName"></el-table-column>
+ <el-table-column label="绠$悊缂栧彿" min-width="150" prop="managementNumber"></el-table-column>
+ <el-table-column label="璁惧鐘舵��" min-width="130" prop="deviceStatus">
+ <template #default="{ row }">
+ {{ row.deviceStatus === '0scrap' ? '鎶ュ簾' : row.deviceStatus === '1startUsing' ? '鍚敤' : '鍋滅敤' }}
+ </template>
+ </el-table-column>
+ <el-table-column label="鍋滅敤/鍚敤鐞嗙敱" min-width="180" prop="reason"></el-table-column>
+ <el-table-column label="鎻愪氦浜�" min-width="130" prop="createUser"></el-table-column>
+ <el-table-column label="鎻愪氦鏃ユ湡" min-width="150" prop="createTime"></el-table-column>
+ <el-table-column label="褰撳墠鐘舵��" min-width="130" prop="currentState"></el-table-column>
+ <el-table-column label="褰撳墠璐d换浜�" min-width="180" prop="currentResponsible"></el-table-column>
+ <!-- 鎿嶄綔鎸夐挳 -->
+ <el-table-column fixed="right" label="鎿嶄綔" min-width="150">
+ <template #default="{ row }">
+ <el-button size="small" type="text" @click="handleViewClick(row)">鏌ョ湅</el-button>
+ <el-button size="small" type="text" @click="handleDownOne(row)">瀵煎嚭</el-button>
+ <el-button size="small" type="text" @click="handleDeleteClick(row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-pagination :current-page="1" :page-size="search.size" :page-sizes="[10, 20, 30, 50, 100]"
+ :total="search.total" layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
+ @current-change="handleCurrentChange">
+ </el-pagination>
+ </div>
+ <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="dialogVisible" title="璁惧鎯呭喌"
+ top="5vh" width="60%" @open="openRecordAcceptance">
+ <el-steps :active="currentStep" align-center finish-status="success">
+ <el-step v-for="(v, i) in steps" :key="i" :title="v" style="cursor:pointer"
+ @click.native="choiceStep(i)"></el-step>
+ </el-steps>
+ <el-form ref="form" :model="form" :rules="rules" label-width="130px">
+ <div v-show="currentStepClick === 0">
+ <el-card style="margin-top: 1em; height: 42vh; overflow-y: scroll;">
+ <!-- 鍗$墖 -->
+ <el-row>
+ <el-col :span="24">
+ <el-form-item label="娴佺▼缂栧彿锛�">
+ <el-input v-model="form.processNumber" disabled size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="绠$悊缂栧彿锛�">
+ <el-input v-model="form.managementNumber" disabled size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璁惧鍚嶇О锛�">
+ <el-input v-model="form.deviceName" disabled size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="瑙勬牸鍨嬪彿锛�">
+ <el-input v-model="form.specificationModel" disabled size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :rules="[{ required: currentStep === 0, message: '璇疯緭鍏ラ厤浠�', trigger: 'blur' }]" label="閰嶄欢锛�"
+ prop="accessoryPart">
+ <el-input v-model="form.accessoryPart" :disabled="currentStep !== 0" size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :rules="[{ required: currentStep === 0, message: '璇烽�夋嫨璁惧鐘舵��', trigger: 'change' }]"
+ label="璁惧鎯呭喌锛�" prop="deviceStatus">
+ <el-select v-model="form.deviceStatus" :disabled="currentStep !== 0" placeholder="璇烽�夋嫨" size="small"
+ style="width:100%">
+ <el-option label="鎶ュ簾" value="0scrap"></el-option>
+ <el-option label="鍚敤" value="1startUsing"></el-option>
+ <el-option label="鍋滅敤" value="2stopUsing"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :rules="[{ required: currentStep === 0, message: '璇疯緭鍏ュ仠鐢ㄥ惎鐢ㄧ悊鐢�', trigger: 'blur' }]"
+ label="鍋滅敤鍚敤鐞嗙敱锛�" prop="reason">
+ <el-input v-model="form.reason" :disabled="currentStep !== 0" :rows="3" size="small"
+ type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :rules="[{ required: currentStep === 0, message: '璇烽�夋嫨涓嬬幆鑺傝矗浠讳汉', trigger: 'change' }]"
+ label="涓嬬幆鑺傝矗浠讳汉锛�" prop="submitNextPesponsible">
+ <el-select v-model="form.submitNextPesponsible" :disabled="currentStep !== 0" clearable filterable
+ placeholder="璇烽�夋嫨涓嬬幆鑺傝礋璐d汉" size="small" style="width: 100%">
+ <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-card>
+ <el-row style="margin-top: 1em;">
+ <el-col :span="4">
+ 鎿嶄綔浜猴細{{ form.submitOperatingPersonnel }}
+ </el-col>
+ <el-col :span="6">
+ 鏃ユ湡锛歿{ form.submitDate }}
+ </el-col>
+ </el-row>
+ </div>
+ <div v-show="currentStepClick === 1">
+ <el-card style="margin-top: 1em; height: 42vh; overflow-y: scroll;">
+ <el-row>
+ <el-col :span="24">
+ <el-form-item label="閮ㄩ棬璐熻矗浜烘剰瑙侊細" prop="departmentReviewOpinion">
+ <el-input v-model="form.departmentReviewOpinion" :disabled="currentStep !== 1" size="small"
+ type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :rules="[{ required: currentStep === 1, message: '璇疯緭鍏ヤ笅鐜妭璐d换浜�', trigger: 'change' }]"
+ label="涓嬬幆鑺傝矗浠讳汉锛�" prop="departmentNextPesponsible">
+ <el-select v-model="form.departmentNextPesponsible" :disabled="currentStep !== 1" clearable filterable
+ placeholder="璇烽�夋嫨涓嬬幆鑺傝礋璐d汉" size="small" style="width: 100%;">
+ <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-card>
+ <el-row style="margin-top: 1em;">
+ <el-col :span="4">
+ 鎿嶄綔浜猴細{{ form.departmentOperatingPersonnel }}
+ </el-col>
+ <el-col :span="6">
+ 鏃ユ湡锛歿{ form.departmentDate }}
+ </el-col>
+ </el-row>
+ </div>
+ <div v-show="currentStepClick === 2">
+ <el-card style="margin-top: 1em; height: 42vh; overflow-y: scroll;">
+ <el-row>
+ <el-col :span="24">
+ <el-form-item :rules="[{ required: currentStep === 2, message: '璇疯緭鍏ヨ閲忓鎰忚', trigger: 'blur' }]"
+ label="璁¢噺瀹ゆ剰瑙侊細" prop="measuringRoomReviewOpinion">
+ <el-input v-model="form.measuringRoomReviewOpinion" :disabled="currentStep !== 2" size="small"
+ type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :rules="[{ required: currentStep === 2, message: '璇疯緭鍏ヤ笅鐜妭璐d换浜�', trigger: 'blur' }]"
+ label="涓嬬幆鑺傝矗浠讳汉锛�" prop="measuringRoomNextPesponsible">
+ <el-select v-model="form.measuringRoomNextPesponsible" :disabled="currentStep !== 2" clearable
+ filterable placeholder="璇烽�夋嫨涓嬬幆鑺傝礋璐d汉" size="small" style="width: 100%;">
+ <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-card>
+ <el-row style="margin-top: 1em;">
+ <el-col :span="4">
+ 鎿嶄綔浜猴細{{ form.measuringRoomOperatingPersonnel }}
+ </el-col>
+ <el-col :span="6">
+ 鏃ユ湡锛歿{ form.measuringRoomDate }}
+ </el-col>
+ </el-row>
+ </div>
+ <div v-show="currentStepClick === 3">
+ <el-card style="margin-top: 1em; height: 42vh; overflow-y: scroll;">
+ <el-row>
+ <el-col :span="24">
+ <el-form-item :rules="[{ required: currentStep === 3, message: '璇疯緭鍏ユ壒鍑嗘剰瑙�', trigger: 'blur' }]"
+ label="鎵瑰噯鎰忚锛�" prop="approvalOpinion">
+ <el-input v-model="form.approvalOpinion" :disabled="currentStep !== 3" size="small"
+ type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item :rules="[{ required: currentStep === 3, message: '璇疯緭鍏ヤ笅鐜妭璐熻矗浜�', trigger: 'change' }]"
+ label="涓嬬幆鑺傝矗浠讳汉锛�" prop="approvalNextPesponsible">
+ <el-select v-model="form.approvalNextPesponsible" :disabled="currentStep !== 3" clearable filterable
+ placeholder="璇烽�夋嫨涓嬬幆鑺傝礋璐d汉" size="small" style="width: 100%;">
+ <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.name">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-card>
+ <el-row style="margin-top: 1em;">
+ <el-col :span="4">
+ 鎿嶄綔浜猴細{{ form.approvalOperatingPersonnel }}
+ </el-col>
+ <el-col :span="6">
+ 鏃ユ湡锛歿{ form.approvalDate }}
+ </el-col>
+ </el-row>
+ </div>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button v-if="currentStep !== 0 && currentStep !== 4" :loading="sumbitLoading1"
+ @click="submitForm('3reject')">椹冲洖</el-button>
+ <el-button v-if="currentStep === 0" :loading="sumbitLoading2" @click="submitForm('2save')">淇濆瓨</el-button>
+ <el-button v-if="currentStep !== 4" :loading="sumbitLoading3" type="primary" @click="submitForm('1submit')">
+ {{ currentStep === 0 ? '鎻愪氦' : '閫氳繃' }}
+ </el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+<script>
+import {
+ saveDeviceState,
+ selectDeviceByCode,
+ exportDeviceStatus,
+ deleteDeviceState,
+ deviceStateExport,
+ getDeviceStatePage,
+} from '@/api/cnas/resourceDemand/device.js'
+import { selectUserCondition } from "@/api/system/user";
+import { dateFormat } from '@/utils/date'
+import { mapGetters } from "vuex";
+export default {
+ props: {
+ clickNodeVal: {
+ type: Object,
+ default: () => {
+ return {};
+ }
+ }
+ },
+ computed: {
+ ...mapGetters(["nickName"]),
+ },
+ data() {
+ return {
+ outLoading: false, // 瀵煎嚭loading
+ dialogVisible: false,
+ form: {},
+ currentStep: 0, // 姝ラ鏉℃樉绀虹鍑犳
+ currentStepClick: 0, // 鐐瑰嚮姝ラ鏉″彉鍖�
+ steps: ['鎻愪氦', '閮ㄩ棬璐熻矗浜�', '璁¢噺瀹�', '鎵瑰噯浜�'],
+ responsibleOptions: [], // 涓嬬幆鑺傝礋璐d汉
+ tableDatalist: [], // table琛ㄦ牸
+ rules: {
+ quantity: [{ required: true, message: '璇疯緭鍏ユ暟閲�', trigger: 'blur' }],
+ },
+ search: {
+ size: 20,
+ current: 1,
+ total: 0,
+ processNumber: ''
+ },
+ sumbitLoading1: false,
+ sumbitLoading2: false,
+ sumbitLoading3: false,
+ }
+ },
+ mounted() {
+ this.getDeviceStatePage(this.clickNodeVal.value)
+ },
+ methods: {
+ // 鍒嗛〉
+ handleSizeChange(val) {
+ this.search.size = val
+ this.getDeviceStatePage(this.clickNodeVal.value)
+ },
+ // 鍒嗛〉
+ handleCurrentChange(val) {
+ this.search.current = val
+ this.getDeviceStatePage(this.clickNodeVal.value)
+ },
+ //鎻愪氦琛ㄥ崟
+ async submitForm(saveState) {
+ let currentStepAction;
+ // 璁剧疆璇ユ搷浣滃垽鏂槸鍚︿负鎻愪氦锛屼繚瀛橈紝椹冲洖锛岄�氳繃 寮�鍚痩oding
+ switch (saveState) {
+ // 鎻愪氦锛岄�氳繃
+ case '1submit':
+ currentStepAction = this.currentStep + 1
+ this.sumbitLoading1 = true
+ break
+ // 淇濆瓨
+ case '2save':
+ currentStepAction = this.currentStep
+ this.sumbitLoading2 = true
+ break
+ // 椹冲洖
+ case '3reject':
+ currentStepAction = this.currentStep - 1
+ this.sumbitLoading3 = true
+ break
+ default:
+ break
+ }
+ this.$refs.form.validate((valid) => {
+ if (valid === true || saveState !== '1submit') {
+ // 缁欏綋鍓嶇幆鑺傝缃垱寤轰汉涓庢椂闂�
+ const dateTime = dateFormat(new Date())
+ // 鑾峰彇褰撳墠鐜妭鎿嶄綔浜轰笌鏃ユ湡
+ switch (this.currentStep) {
+ case 0:
+ this.form.createUser = this.nickName
+ this.form.submitOperatingPersonnel = this.nickName
+ this.form.submitDate = dateTime
+ break
+ case 1:
+ this.form.departmentOperatingPersonnel = this.nickName
+ this.form.departmentDate = dateTime
+ break
+ case 2:
+ this.form.measuringRoomOperatingPersonnel = this.nickName
+ this.form.measuringRoomDate = dateTime
+ break
+ case 3:
+ this.form.approvalOperatingPersonnel = this.nickName
+ this.form.approvalDate = dateTime
+ break
+ default:
+ break
+ }
+ // 鑾峰彇褰撳墠鐜妭璐熻矗浜�
+ switch (saveState === '3reject' ? this.currentStep - 1 : this.currentStep) {
+ case 0:
+ this.form.currentResponsible = this.form.submitOperatingPersonnel
+ break
+ case 1:
+ this.form.currentResponsible = this.form.departmentOperatingPersonnel
+ break
+ case 2:
+ this.form.currentResponsible = this.form.measuringRoomOperatingPersonnel
+ break
+ case 3:
+ this.form.currentResponsible = this.form.approvalOperatingPersonnel
+ break
+ default:
+ break
+ }
+ // 鑾峰彇褰撳墠鐘舵��
+ this.form.currentState = currentStepAction === 4 ? '鍏抽棴' : this.steps[currentStepAction]
+ this.form.deviceId = this.clickNodeVal.value
+ saveDeviceState(this.form).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鎻愪氦鎴愬姛')
+ this.getDeviceStatePage(this.clickNodeVal.value)
+ this.dialogVisible = false
+ this.closeLoading()
+ }
+ this.closeLoading()
+ })
+ } else {
+ let step = this.steps[this.currentStep]
+ this.$message.warning(step + ' 娴佺▼涓湁蹇呭~椤规湭濉紒');
+ this.closeLoading()
+ }
+ });
+ },
+ closeLoading() {
+ this.sumbitLoading1 = false
+ this.sumbitLoading2 = false
+ this.sumbitLoading3 = false
+ },
+ choiceStep(index) {
+ this.currentStepClick = index
+ },
+ openRecordAcceptance() {
+ // 鑾峰彇璁惧鍩虹淇℃伅
+ selectDeviceByCode({ id: this.clickNodeVal.value }).then(res => {
+ this.form.deviceName = res.data.deviceName
+ this.form.specificationModel = res.data.specificationModel
+ this.form.managementNumber = res.data.managementNumber
+ this.$nextTick(() => {
+ this.$refs['form'].clearValidate()
+ })
+ });
+ // 鑾峰彇璐熻矗浜轰俊鎭�
+ this.getUserList()
+ },
+ // 鑾峰彇璐熻矗浜轰俊鎭帴鍙�
+ getUserList() {
+ selectUserCondition().then(res => {
+ if (res.code == 200) {
+ this.responsibleOptions = res.data
+ }
+ })
+ },
+ // 鏌ョ湅
+ handleViewClick(row) {
+ this.form = { ...row }
+ // 濡傛灉绱㈠紩涓�6琛ㄧず鍏ㄩ儴閫氳繃
+ this.currentStep = this.steps.indexOf(this.form.currentState) === -1 ? 4 : this.steps.indexOf(this.form.currentState)
+ this.currentStepClick = this.currentStep === 4 ? 0 : this.currentStep
+ this.$nextTick(() => {
+ this.$refs['form'].clearValidate()
+ })
+ this.dialogVisible = true
+ },
+ // 瀵煎嚭
+ handleDownOne(row) {
+ this.outLoading = true
+ exportDeviceStatus({ deviceId: row.deviceId, processNumber: row.processNumber }).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/octet-stream' });
+ this.$download.saveAs(blob, '璁惧鍋�/鍚敤.doc')
+ })
+ },
+ // 鍒犻櫎
+ handleDeleteClick(row) {
+ this.$confirm('姝ゆ搷浣滃皢鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deleteDeviceState({ stateId: row.stateId }).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鍒犻櫎鎴愬姛')
+ this.getDeviceStatePage(this.clickNodeVal.value)
+ }
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
+ },
+ //瀵煎嚭
+ handleDown() {
+ this.outLoading = true
+ deviceStateExport({
+ deviceId: this.clickNodeVal.value,
+ processNumber: this.search.processNumber
+ }).then(res => {
+ this.outLoading = false
+ const blob = new Blob([res], { type: 'application/octet-stream' });
+ this.$download.saveAs(blob, '璁惧鍋滅敤/鍚敤.xlsx')
+ }).finally(() => {
+ this.outLoading = false
+ })
+ },
+ resetSearch() {
+ this.search = {
+ size: 20,
+ current: 1,
+ total: 0,
+ processNumber: '',
+ }
+ this.getDeviceStatePage(this.clickNodeVal.value);
+ },
+ getDeviceStatePage(deviceId) {
+ getDeviceStatePage({ deviceId, ...this.search }).then(res => {
+ if (res.code == 200) {
+ this.tableDatalist = res.data.records
+ this.search.total = res.data.total
+ }
+ })
+ }
+ },
+ watch: {
+ // 鐩戝惉鐐瑰嚮el-tree鐨勬暟鎹紝杩涜鏁版嵁鍒锋柊
+ clickNodeVal(newVal) {
+ if (newVal.value) {
+ this.componentData.entity.deviceId = this.clickNodeVal.value
+ this.entityCopy = this.HaveJson(this.componentData.entity)
+ this.getDeviceStatePage(newVal.value)
+ }
+ },
+ dialogVisible(newVal) {
+ if (!newVal) {
+ this.form = {
+ }
+ this.closeLoading()
+ this.currentStep = 0 // 姝ラ鏉℃樉绀虹鍑犳
+ this.currentStepClick = 0 // 鐐瑰嚮姝ラ鏉″彉鍖�
+ this.$refs['form'].clearValidate()
+ }
+ }
+ },
+}
+</script>
+
+<style scoped>
+.dialog-content {
+ max-height: 70vh;
+ /* 璁剧疆鏈�澶ч珮搴� */
+ overflow-y: auto;
+ /* 鍚敤鍨傜洿婊氬姩 */
+}
+
+h4 {
+ font-weight: 400;
+ font-size: 16px;
+ margin: 10px 0;
+}
+
+/*
+淇濆瓨鎻愪氦鎸夐挳鏍峰紡
+*/
+h4 .title {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+h4 .title .line {
+ display: inline-block;
+ width: 3px;
+ height: 16px;
+ background: #3A7BFA;
+ margin-right: 4px;
+}
+
+.tables {
+ width: 100%;
+ height: calc(100vh - 15em);
+}
+
+.el-from {
+ max-width: 400px;
+ margin: 0 auto;
+}
+
+.form-row {
+ display: flex;
+ justify-content: space-between;
+}
+
+
+.form-row .el-form-item {
+ flex: 1;
+ /* 姣忎釜琛ㄥ崟椤瑰崰鎹浉鍚屾瘮渚嬬殑绌洪棿 */
+ margin-right: 100px;
+ /* 鍙�夛細涓哄彸渚у厓绱犳坊鍔犻棿璺� */
+}
+
+/* 绉婚櫎鏈�鍚庝竴涓厓绱犵殑鍙宠竟璺� */
+.form-row .el-form-item:last-child {
+ margin-right: 0;
+
+}
+
+.search {
+ background-color: #fff;
+ margin: 10px 0;
+ display: flex;
+ align-items: center;
+ position: relative;
+}
+
+.search_thing {
+ display: flex;
+ align-items: center;
+ height: 40px;
+}
+
+.search_label {
+ width: 70px;
+ font-size: 14px;
+ text-align: right;
+}
+
+.search_input {
+ width: 70%;
+}
+
+.btns {
+ position: absolute;
+ right: 0;
+ top: 50%;
+ transform: translate(0, -50%);
+}
+
+.form .search_label {
+ width: 120px;
+}
+</style>
diff --git a/src/views/CNAS/resourceDemand/device/index.vue b/src/views/CNAS/resourceDemand/device/index.vue
new file mode 100644
index 0000000..a12de51
--- /dev/null
+++ b/src/views/CNAS/resourceDemand/device/index.vue
@@ -0,0 +1,250 @@
+<template>
+ <div class="device-page">
+ <div class="device-left">
+ <el-input v-model="deviceName" class="div_left_input" clearable placeholder="杈撳叆璁惧鍚嶇О" size="small"
+ suffix-icon="el-icon-search" @blur="searchFilter" @clear="searchFilter"
+ @keyup.enter.native="searchFilter"></el-input>
+ <el-tree :data="list" ref="tree" :props="{ children: 'children', label: 'label' }" node-key="id"
+ @node-click="handleNodeClick" :filter-node-method="filterNode" highlight-current @node-expand="nodeOpen"
+ @node-collapse="nodeClose" v-loading="loading" :expand-on-click-node="false" style="height:calc(100% - 46px);
+ overflow-y: scroll;
+ scrollbar-width: none;">
+ <div class="custom-tree-node" slot-scope="{ node, data }">
+ <el-row style="width: 100%;">
+ <el-col :span="21" :title="data.label">
+ <span class="single-line-ellipsis" style="width: 100%;display: inline-block;">
+ <i :class="`node_i ${data.children != undefined
+ ? data.code === '[1]'
+ ? 'el-icon-folder-opened'
+ : 'el-icon-folder'
+ : 'el-icon-tickets'
+ }`
+ "></i>
+ {{ data.label }}
+ </span>
+ </el-col>
+ </el-row>
+ </div>
+ </el-tree>
+ </div>
+ <div class="device-right">
+ <div v-if="isShowAll" style="height: 100%;">
+ <el-tabs v-model="menuListActiveName" class="main_right" type="border-card">
+ <el-tab-pane label="璁惧鎬昏" name="璁惧鎬昏">
+ <overview v-if="menuListActiveName == '璁惧鎬昏'" :clickNodeVal="clickNodeVal" />
+ </el-tab-pane>
+ <el-tab-pane label="璁惧宸ュ叿鏄庣粏" name="璁惧宸ュ叿鏄庣粏">
+ <management v-if="menuListActiveName == '璁惧宸ュ叿鏄庣粏'" :clickNodeVal="clickNodeVal" />
+ </el-tab-pane>
+ <el-tab-pane label="璧勬簮棰勫畾" name="璧勬簮棰勫畾">
+ <resourceReservation v-if="menuListActiveName == '璧勬簮棰勫畾'" :clickNodeVal="clickNodeVal"/>
+ </el-tab-pane>
+ <el-tab-pane label="浣滀笟鎸囧涔�" name="浣滀笟鎸囧涔�">
+ <operationInstruction v-if="menuListActiveName == '浣滀笟鎸囧涔�'" :clickNodeVal="clickNodeVal" />
+ </el-tab-pane>
+ </el-tabs>
+ </div>
+ <div v-if="!isShowAll" style="height: 100%;">
+ <el-tabs v-model="tabListActiveName" class="main_right" type="border-card" @tab-click="handleClick">
+ <el-tab-pane label="璁惧杩愯鎬昏" name="璁惧杩愯鎬昏">
+ <operationOverview view v-if="tabListActiveName == '璁惧杩愯鎬昏'" :clickNodeVal="clickNodeVal"/>
+ </el-tab-pane>
+ <el-tab-pane label="璁惧妗f" name="璁惧妗f">
+ <files v-if="tabListActiveName == '璁惧妗f'" :clickNodeVal="clickNodeVal" />
+ </el-tab-pane>
+ <el-tab-pane label="璁惧楠屾敹" name="璁惧楠屾敹">
+ <checkAndAccept v-if="tabListActiveName == '璁惧楠屾敹'" :clickNodeVal="clickNodeVal"/>
+ </el-tab-pane>
+ <el-tab-pane label="璁惧鏍″噯" name="璁惧鏍″噯">
+ <calibration v-if="tabListActiveName == '璁惧鏍″噯'" :clickNodeVal="clickNodeVal" />
+ </el-tab-pane>
+ <el-tab-pane label="璁惧鏍告煡" name="璁惧鏍告煡">
+ <check v-if="tabListActiveName == '璁惧鏍告煡'" :clickNodeVal="clickNodeVal"/>
+ </el-tab-pane>
+ <el-tab-pane label="璁惧缁存姢" name="璁惧缁存姢">
+ <maintenance v-if="tabListActiveName == '璁惧缁存姢'" :clickNodeVal="clickNodeVal" />
+ </el-tab-pane>
+ <el-tab-pane label="璁惧鍊熺敤" name="璁惧鍊熺敤">
+ <borrow v-if="tabListActiveName == '璁惧鍊熺敤'" :clickNodeVal="clickNodeVal" />
+ </el-tab-pane>
+ <el-tab-pane label="璁惧鏁呴殰" name="璁惧鏁呴殰">
+ <fault v-if="tabListActiveName == '璁惧鏁呴殰'" :clickNodeVal="clickNodeVal" />
+ </el-tab-pane>
+ <el-tab-pane label="浣跨敤璁板綍" name="浣跨敤璁板綍">
+ <record v-if="tabListActiveName == '浣跨敤璁板綍'" :clickNodeVal="clickNodeVal" />
+ </el-tab-pane>
+ <el-tab-pane label="璁惧鍋滅敤/鍚敤" name="璁惧鍋滅敤/鍚敤">
+ <state v-if="tabListActiveName == '璁惧鍋滅敤/鍚敤'" :clickNodeVal="clickNodeVal" />
+ </el-tab-pane>
+ </el-tabs>
+ </div>
+ </div>
+ </div>
+</template>
+
+<script>
+import management from "./component/management.vue";
+import overview from "./component/device-overview.vue";
+import resourceReservation from "./component/resource-reservation.vue";
+import operationInstruction from "./component/operationInstruction.vue";
+import operationOverview from "./component/operationOverview.vue";
+import files from "./component/files.vue";
+import checkAndAccept from "./component/check-and-accept.vue";
+import calibration from "./component/calibration.vue";
+import check from "./component/check.vue";
+import maintenance from "./component/maintenance.vue";
+import borrow from "./component/borrow.vue";
+import fault from "./component/fault.vue";
+import record from "./component/record.vue";
+import state from "./component/state.vue";
+
+import {
+ treeDevice,
+} from '@/api/cnas/resourceDemand/device.js'
+export default {
+ components: {
+ checkAndAccept,
+ operationOverview,
+ files,
+ calibration,
+ check,
+ maintenance,
+ borrow,
+ fault,
+ record,
+ state,
+ management,
+ overview,
+ resourceReservation,
+ operationInstruction
+ },
+ data() {
+ return {
+ isShowAll: true,
+ deviceName: "", // 渚ц竟鏍忔悳绱�
+ loading: false,
+ tabListActiveName: '璁惧杩愯鎬昏',
+ menuListActiveName: '璁惧鎬昏',
+ list: [],
+ clickNodeVal: {}
+ };
+ },
+ mounted() {
+ // 鍒濆鍖栬皟鐢�
+ this.geList();
+ },
+ methods: {
+ handleClick(tab, event) {
+ },
+ searchFilter() {
+ this.$refs.tree.filter(this.deviceName)
+ },
+ filterNode(value, data) {
+ if (!value) return true;
+ return data.label.indexOf(value) !== -1;
+ },
+ // 鐖剁骇
+ geList() {
+ this.loading = true;
+ treeDevice().then(res => {
+ let data = res.data;
+ this.list = data;
+ this.loading = false
+ });
+ },
+ handleNodeClick(val, node, el) {
+ // 鐐瑰嚮涓存椂缂撳瓨
+ this.clickNodeVal = val;
+ // 瀛樺偍鐖剁骇鑺傜偣绾ф暟
+ this.clickNodeVal.level = node.level
+ this.clickNodeVal.parent = node.parent.data
+ // 鏄惁鏄剧ず璁惧璇︽儏
+ if (!val.value) {
+ this.isShowAll = true
+ } else {
+ this.isShowAll = false
+ }
+ },
+ nodeOpen(data, node, el) {
+ // $($(el.$el).find(".node_i")[0]).attr(
+ // "class",
+ // "node_i el-icon-folder-opened"
+ // );
+ },
+ nodeClose(data, node, el) {
+ // $($(el.$el).find(".node_i")[0]).attr("class", "node_i el-icon-folder");
+ },
+ }
+};
+</script>
+
+<style scoped>
+.device-page {
+ display: flex;
+ padding-top: 10px;
+ box-sizing: border-box;
+ width: 100%;
+}
+
+.device-left {
+ width: 250px;
+ height: 100%;
+ background: #fff;
+ border-radius: 16px;
+ box-sizing: border-box;
+ padding: 10px 16px;
+ flex-shrink: 0;
+ padding-right: 0;
+}
+
+.device-right {
+ background: #fff;
+ width: calc(100% - 250px);
+ height: calc(100vh - 40px);
+ border-radius: 16px;
+ box-sizing: border-box;
+ padding: 10px;
+}
+
+.showLargeCategory {
+ width: 100%;
+ height: 100%;
+}
+
+.device-right-content {
+ /* margin-top: 10px; */
+ height: calc(100% - 42px);
+ width: 100%;
+}
+
+.custom-tree-node {
+ width: 100%;
+ line-height: 32px;
+ font-size: 14px;
+}
+
+.node_i {
+ color: orange;
+ font-size: 18px;
+}
+
+.main_right {
+ height: calc(100% - 5px);
+ overflow: hidden;
+}
+
+>>>.el-tabs__content {
+ padding-top: 0;
+}
+
+>>>.single-line-ellipsis {
+ margin: 0 !important;
+}
+
+>>>.el-tree-node__content {
+ text-align: left;
+ align-items: start;
+ margin: 4px;
+ height: 100%;
+}
+</style>
diff --git a/src/views/CNAS/systemManagement/measuresDealRisks/components/hazardIdentificationRiskAssessment.vue b/src/views/CNAS/systemManagement/measuresDealRisks/components/hazardIdentificationRiskAssessment.vue
index cdc0c7a..abab933 100644
--- a/src/views/CNAS/systemManagement/measuresDealRisks/components/hazardIdentificationRiskAssessment.vue
+++ b/src/views/CNAS/systemManagement/measuresDealRisks/components/hazardIdentificationRiskAssessment.vue
@@ -124,7 +124,6 @@
</template>
<script>
-import { getToken } from "@/utils/auth";
import {
getPageResults,
dangerousRiskApproval,
diff --git a/src/views/business/inspectionOrder/add.vue b/src/views/business/inspectionOrder/add.vue
index 68a2506..ade64a8 100644
--- a/src/views/business/inspectionOrder/add.vue
+++ b/src/views/business/inspectionOrder/add.vue
@@ -1,71 +1,165 @@
<template>
<div class="bg-1">
- <div v-show="!configShow && !equipConfigShow && !cableConfigShow">
+ <div
+ v-show="!configShow && !equipConfigShow && !cableConfigShow"
+ style="margin: 5px 15px"
+ >
<el-row class="title">
- <el-col :span="6" style="padding-left: 20px; text-align: left">濮旀墭鍗曚俊鎭� 鎬讳环锛�<span
- style="color: #3a7bfa">锟{ total }}</span></el-col>
+ <el-col :span="6"
+ >濮旀墭鍗曚俊鎭� 鎬讳环锛�<span style="color: #3a7bfa"
+ >锟{ total }}</span
+ ></el-col
+ >
<el-col :span="18" style="text-align: right">
- <el-select v-model="template" size="medium" filterable placeholder="涓嬪崟妯℃澘" style="margin-right: 10px"
- v-show="active == 1" @change="selectInsOrderTemplateById">
- <el-option v-for="(a, ai) in templates" :key="ai" :value="a.id" :label="a.name">
+ <el-select
+ v-model="template"
+ size="medium"
+ filterable
+ placeholder="涓嬪崟妯℃澘"
+ style="margin-right: 10px"
+ v-show="active == 1"
+ @change="selectInsOrderTemplateById"
+ >
+ <el-option
+ v-for="(a, ai) in templates"
+ :key="ai"
+ :value="a.id"
+ :label="a.name"
+ >
<span style="float: left">{{ a.name }}</span>
- <i class="el-icon-delete" style="float: right; color: #66b1ff; font-size: 16px"
- @click.stop="handleDelete(a)"></i>
+ <i
+ class="el-icon-delete"
+ style="float: right; color: #66b1ff; font-size: 16px"
+ @click.stop="handleDelete(a)"
+ ></i>
</el-option>
</el-select>
- <el-button size="medium" @click="templateDia = true" v-show="active == 1">
+ <el-button
+ size="medium"
+ @click="templateDia = true"
+ v-show="active == 1"
+ >
<span style="color: #3a7bfa">淇濆瓨妯℃澘</span>
</el-button>
- <el-button size="medium" type="primary" @click="openCableConfig" v-if="
- active == 1 &&
- PROJECT == '瑁呭鐢电紗' &&
- addObj.sampleType != undefined &&
- addObj.sampleType.indexOf('鐢电紗') > -1
- ">鐢电紗閰嶇疆</el-button>
- <el-button size="medium" type="primary" @click="openEquipConfig" v-if="active == 1">瀛愭牱鍝侀厤缃�</el-button>
- <el-button size="medium" type="primary" @click="openConfig" v-if="addObj.sampleType === '鍏夌紗'">鍏夌氦閰嶇疆</el-button>
- <el-button size="medium" type="primary" @click="save" :loading="saveLoad" v-show="active == 1">鎻愪氦</el-button>
+ <el-button
+ size="medium"
+ type="primary"
+ @click="openEquipConfig"
+ v-if="active == 1"
+ >瀛愭牱鍝侀厤缃�</el-button
+ >
+ <el-button
+ size="medium"
+ type="primary"
+ @click="openConfig"
+ v-if="addObj.sampleType === '鍏夌紗'"
+ >鍏夌氦閰嶇疆</el-button
+ >
+ <el-button
+ size="medium"
+ type="primary"
+ @click="save"
+ :loading="saveLoad"
+ v-show="active == 1"
+ >鎻愪氦</el-button
+ >
<!-- 瀹℃牳 -->
- <el-button size="medium" @click="upInsOrderOfState(2)" :loading="saveLoad"
- v-show="active == 3 && addObj.companyId" :disabled="saveLoad">涓嶉�氳繃</el-button>
- <el-button size="medium" type="primary" @click="upInsOrderOfState(1)" :loading="saveLoad"
- v-show="active == 3 && addObj.companyId">閫氳繃</el-button>
- <el-button size="medium" @click="$parent.playOrder(0)">
+ <el-button
+ size="medium"
+ @click="upInsOrderOfState(2)"
+ :loading="saveLoad"
+ v-show="active == 3 && addObj.companyId"
+ :disabled="saveLoad"
+ >涓嶉�氳繃</el-button
+ >
+ <el-button
+ size="medium"
+ type="primary"
+ @click="upInsOrderOfState(1)"
+ :loading="saveLoad"
+ v-show="active == 3 && addObj.companyId"
+ >閫氳繃</el-button
+ >
+ <el-button size="medium" @click="$router.go(-1)">
<span style="color: #3a7bfa">杩斿洖</span>
</el-button>
</el-col>
</el-row>
</div>
<basic-container>
- <div class="search" v-show="!configShow && !equipConfigShow && !cableConfigShow">
- <el-form :model="addObj" :rules="formRule" label-position="right" inline>
+ <div
+ class="search"
+ v-show="!configShow && !equipConfigShow && !cableConfigShow"
+ >
+ <el-form
+ :model="addObj"
+ :rules="formRule"
+ label-position="right"
+ inline
+ >
<el-row>
<el-col :span="6">
<el-form-item label="濮旀墭缂栧彿锛�" prop="entrustCode">
- <el-input v-model="addObj.entrustCode" size="small" class="search_input" placeholder="绯荤粺鐢熸垚"
- disabled></el-input>
+ <el-input
+ v-model="addObj.entrustCode"
+ size="small"
+ class="search_input"
+ placeholder="绯荤粺鐢熸垚"
+ disabled
+ ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="妫�楠岀被鍒細" prop="orderType">
- <el-select size="small" class="search_input" clearable v-model="addObj.orderType"
- :disabled="active > 1">
- <el-option v-for="(a, ai) in orderType" :key="ai" :value="a.dictValue"
- :label="a.dictLabel"></el-option>
+ <el-select
+ size="small"
+ class="search_input"
+ clearable
+ v-model="addObj.orderType"
+ :disabled="active > 1"
+ >
+ <el-option
+ v-for="(a, ai) in orderType"
+ :key="ai"
+ :value="a.dictValue"
+ :label="a.dictLabel"
+ ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="鍒跺崟浜猴細" prop="custom">
- <el-input size="small" class="search_input" clearable disabled v-model="addObj.custom"></el-input>
+ <el-input
+ size="small"
+ class="search_input"
+ clearable
+ disabled
+ v-model="addObj.custom"
+ ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
- <el-form-item label="濮旀墭鍗曚綅锛�" prop="company" class="company_input">
- <el-input readonly size="small" v-model="addObj.company" placeholder="閫夋嫨濮旀墭鍗曚綅">
- <template slot="append"><el-button slot="append" icon="el-icon-search" @click="selectUserDia = true"
- :disabled="active > 1 || addObj.company != '涓ぉ绉戞妧妫�娴嬩腑蹇�'
- "></el-button></template>
+ <el-form-item
+ label="濮旀墭鍗曚綅锛�"
+ prop="company"
+ class="company_input"
+ >
+ <el-input
+ readonly
+ size="small"
+ v-model="addObj.company"
+ placeholder="閫夋嫨濮旀墭鍗曚綅"
+ >
+ <template slot="append"
+ ><el-button
+ slot="append"
+ icon="el-icon-search"
+ @click="selectUserDia = true"
+ :disabled="
+ active > 1 || addObj.company != '涓ぉ绉戞妧妫�娴嬩腑蹇�'
+ "
+ ></el-button
+ ></template>
</el-input>
</el-form-item>
</el-col>
@@ -73,53 +167,104 @@
<el-row>
<el-col :span="6">
<el-form-item label="鑱旂郴鏂瑰紡锛�" prop="phone">
- <el-input size="small" placeholder="璇疯緭鍏�" class="search_input" clearable :readonly="active > 1"
- v-model="addObj.phone"></el-input>
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ class="search_input"
+ clearable
+ :disabled="active > 1"
+ v-model="addObj.phone"
+ ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="绱ф�ョ▼搴︼細" prop="type">
- <el-select @change="changeType" size="small" class="search_input" clearable v-model="addObj.type"
- :disabled="active > 1">
- <el-option v-for="(a, ai) in type" :key="ai" :value="a.dictValue" :label="a.dictLabel"></el-option>
+ <el-select
+ @change="changeType"
+ size="small"
+ class="search_input"
+ clearable
+ v-model="addObj.type"
+ :disabled="active > 1"
+ >
+ <el-option
+ v-for="(a, ai) in type"
+ :key="ai"
+ :value="a.dictValue"
+ :label="a.dictLabel"
+ ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
- <el-form-item label="鏍峰搧鍚嶇О锛�" prop="sample" class="sample_input">
+ <el-form-item
+ label="鏍峰搧鍚嶇О锛�"
+ prop="sample"
+ class="sample_input"
+ >
<el-input readonly size="small" v-model="addObj.sample">
- <template slot="append"><el-button slot="append" icon="el-icon-search"
- @click="selectStandardTree = true" :disabled="active > 1"></el-button></template>
+ <template slot="append"
+ ><el-button
+ slot="append"
+ icon="el-icon-search"
+ @click="selectStandardTree = true"
+ :disabled="active > 1"
+ ></el-button
+ ></template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="鏍峰搧鏁伴噺锛�" prop="sampleNum">
- <el-input-number size="small" v-model="addObj.sampleNum" :min="1" :max="100" :precision="0"
- @change="addStandardTree" :disabled="active > 1"></el-input-number>
+ <el-input-number
+ size="small"
+ v-model="addObj.sampleNum"
+ :min="1"
+ :max="100"
+ :precision="0"
+ @change="addStandardTree"
+ :disabled="active > 1"
+ ></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="鏉ユ牱鏂瑰紡锛�" prop="formType">
- <el-select v-model="addObj.formType" size="small" class="search_input" :disabled="active > 1">
- <el-option v-for="(a, ai) in formType" :key="ai" :label="a.dictLabel"
- :value="a.dictValue"></el-option>
+ <el-select
+ v-model="addObj.formType"
+ size="small"
+ class="search_input"
+ :disabled="active > 1"
+ >
+ <el-option
+ v-for="(a, ai) in formType"
+ :key="ai"
+ :label="a.dictLabel"
+ :value="a.dictValue"
+ ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="鎶ュ憡鍙戦�佹柟寮忥細" prop="send">
- <el-radio-group v-model="addObj.send">
+ <el-radio-group v-model="addObj.send" :disabled="active > 1">
<el-radio :label="1">鑷彇</el-radio>
<el-radio :label="0">鍏朵粬</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="6">
- <el-form-item label="鏍峰搧澶勭悊鏂瑰紡锛�" prop="processing" class="processing_input">
- <el-radio-group v-model="addObj.processing" size="mini">
+ <el-form-item
+ label="鏍峰搧澶勭悊鏂瑰紡锛�"
+ prop="processing"
+ class="processing_input"
+ >
+ <el-radio-group
+ v-model="addObj.processing"
+ :disabled="active > 1"
+ size="mini"
+ >
<el-radio :label="0">濮旀墭鍗曚綅鍙栧洖</el-radio>
<el-radio :label="1">瀹為獙瀹ゅ鐞�</el-radio>
</el-radio-group>
@@ -127,33 +272,64 @@
</el-col>
<el-col :span="6">
<el-form-item label="宸ョ▼鍚嶇О锛�" prop="engineering">
- <el-input size="small" class="search_input" :placeholder="active > 1 ? '' : '璇疯緭鍏�'" clearable
- v-model="addObj.engineering" :readonly="active > 1"></el-input>
+ <el-input
+ size="small"
+ class="search_input"
+ :placeholder="active > 1 ? '' : '璇疯緭鍏�'"
+ clearable
+ v-model="addObj.engineering"
+ :disabled="active > 1"
+ ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
- <el-form-item label="宸ョ▼鍚嶇ОEN锛�" prop="engineeringEn" class="engineeringEn_input">
- <el-input size="small" :placeholder="active > 1 ? '' : '璇疯緭鍏�'" clearable v-model="addObj.engineeringEn"
- :readonly="active > 1"></el-input>
+ <el-form-item
+ label="宸ョ▼鍚嶇ОEN锛�"
+ prop="engineeringEn"
+ class="engineeringEn_input"
+ >
+ <el-input
+ size="small"
+ :placeholder="active > 1 ? '' : '璇疯緭鍏�'"
+ clearable
+ v-model="addObj.engineeringEn"
+ :disabled="active > 1"
+ ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="鐢熶骇鍗曚綅锛�" prop="production">
- <el-input size="small" class="search_input" placeholder="璇疯緭鍏�" clearable v-model="addObj.production"
- :readonly="active > 1"></el-input>
+ <el-input
+ size="small"
+ class="search_input"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="addObj.production"
+ :disabled="active > 1"
+ ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
- <el-form-item label="鐢熶骇鍗曚綅EN锛�" prop="productionEn" class="productionEn_input">
- <el-input size="small" class="search_input" placeholder="璇疯緭鍏�" clearable v-model="addObj.productionEn"
- :readonly="active > 1"></el-input>
+ <el-form-item
+ label="鐢熶骇鍗曚綅EN锛�"
+ prop="productionEn"
+ class="productionEn_input"
+ >
+ <el-input
+ size="small"
+ class="search_input"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="addObj.productionEn"
+ :disabled="active > 1"
+ ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="鏄惁鐣欐牱锛�" prop="isLeave">
- <el-radio-group v-model="addObj.isLeave">
+ <el-radio-group v-model="addObj.isLeave" :disabled="active > 1">
<el-radio :label="0">涓嶇暀鏍�</el-radio>
<el-radio :label="1">鐣欐牱</el-radio>
</el-radio-group>
@@ -163,202 +339,1235 @@
<el-row>
<el-col :span="6">
<el-form-item label="鏄惁娑夊強閰嶅鏍峰搧锛�" prop="mating">
- <el-radio-group v-model="addObj.mating" @change="$refs.sampleTable.doLayout()">
+ <el-radio-group
+ :disabled="active > 1"
+ v-model="addObj.mating"
+ @change="$refs.sampleTable.doLayout()"
+ >
<el-radio :label="1">鏄�</el-radio>
<el-radio :label="0">鍚�</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="6">
- <el-form-item label="OTC璁㈠崟鍙凤細" prop="otcCode" class="otcCode_input">
- <el-input size="small" :placeholder="active > 1 ? '' : '璇疯緭鍏�'" clearable v-model="addObj.otcCode"
- :readonly="active > 1"></el-input>
+ <el-form-item
+ label="OTC璁㈠崟鍙凤細"
+ prop="otcCode"
+ class="otcCode_input"
+ >
+ <el-input
+ size="small"
+ :placeholder="active > 1 ? '' : '璇疯緭鍏�'"
+ clearable
+ v-model="addObj.otcCode"
+ :disabled="active > 1"
+ ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="濮旀墭浜猴細" prop="prepareUser">
- <el-input size="small" class="search_input" :placeholder="active > 1 ? '' : '璇疯緭鍏�'" clearable
- v-model="addObj.prepareUser" :readonly="active > 1"></el-input>
+ <el-input
+ size="small"
+ class="search_input"
+ :placeholder="active > 1 ? '' : '璇疯緭鍏�'"
+ clearable
+ v-model="addObj.prepareUser"
+ :disabled="active > 1"
+ ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="澶囨敞锛�" prop="remark">
- <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 2 }" size="small" clearable
- :placeholder="active > 1 ? '' : '璇疯緭鍏�'" v-model="addObj.remark" :readonly="active > 1"></el-input>
+ <el-input
+ type="textarea"
+ :autosize="{ minRows: 2, maxRows: 2 }"
+ size="small"
+ clearable
+ :placeholder="active > 1 ? '' : '璇疯緭鍏�'"
+ v-model="addObj.remark"
+ :disabled="active > 1"
+ ></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</basic-container>
+ <div
+ class="search"
+ v-if="active == 1"
+ style="display: flex; background: transparent"
+ >
+ <div style="display: flex; align-items: center">
+ <div class="search_label">鏍峰搧鍨嬪彿锛�</div>
+ <div class="search_input">
+ <el-select
+ v-model="model"
+ :placeholder="active > 1 ? '' : '璇疯緭鍏�'"
+ filterable
+ allow-create
+ default-first-option
+ size="small"
+ @change="changeModel"
+ >
+ <el-option
+ v-for="item in models"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ <div style="display: flex; align-items: center">
+ <div class="search_label">妫�楠屾爣鍑嗭細</div>
+ <div class="search_input">
+ <el-select
+ filterable
+ v-model="standardMethodListId"
+ :placeholder="active > 1 ? '' : '璇疯緭鍏�'"
+ size="small"
+ @focus="methodFocus"
+ :loading="methodLoad"
+ @change="changeStandardMethodListId"
+ >
+ <el-option
+ v-for="item in methods"
+ :key="item.id"
+ :label="item.code"
+ :value="item.id"
+ >
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ </div>
<basic-container>
<div style="height: auto">
- <div class="search" v-if="active == 1" style="display: flex; background: transparent">
- <div>
- <div class="search_label">鏍峰搧鍨嬪彿锛�</div>
- <div class="search_input">
- <el-select v-model="model" :placeholder="active > 1 ? '' : '璇疯緭鍏�'" filterable allow-create
- default-first-option size="small" @change="changeModel">
- <el-option v-for="item in models" :key="item.value" :label="item.label" :value="item.value">
- </el-option>
- </el-select>
- </div>
- </div>
- <div>
- <div class="search_label">妫�楠屾爣鍑嗭細</div>
- <div class="search_input">
- <el-select filterable v-model="standardMethodListId" :placeholder="active > 1 ? '' : '璇疯緭鍏�'" size="small"
- @focus="methodFocus" :loading="methodLoad" @change="changeStandardMethodListId">
- <el-option v-for="item in methods" :key="item.id" :label="item.code" :value="item.id">
- </el-option>
- </el-select>
- </div>
- </div>
- </div>
- <el-table class="el-table sampleTable" ref="sampleTable" :data="sampleList" max-height="400px"
- tooltip-effect="dark" border @selection-change="selectSample" highlight-current-row @row-click="rowClick"
- style="margin-top: 10px">
- <el-table-column type="selection" width="60" :selectable="selectable" v-if="active == 1"></el-table-column>
- <el-table-column type="index" label="搴忓彿" width="65" align="center"></el-table-column>
- <el-table-column prop="sample" label="鏍峰搧鍚嶇О" align="center" min-width="100">
+ <el-table
+ class="el-table sampleTable"
+ ref="sampleTable"
+ :data="sampleList"
+ max-height="400px"
+ tooltip-effect="dark"
+ border
+ @selection-change="selectSample"
+ highlight-current-row
+ @row-click="rowClick"
+ style="margin-top: 10px"
+ >
+ <el-table-column
+ type="selection"
+ width="60"
+ :selectable="selectable"
+ v-if="active == 1"
+ ></el-table-column>
+ <el-table-column
+ type="index"
+ label="搴忓彿"
+ width="65"
+ align="center"
+ ></el-table-column>
+ <el-table-column
+ prop="sample"
+ label="鏍峰搧鍚嶇О"
+ align="center"
+ min-width="100"
+ >
<template slot-scope="scope">
- <el-input size="small" v-model="scope.row.sample" clearable :readonly="active > 1"></el-input>
+ <el-input
+ size="small"
+ v-model="scope.row.sample"
+ clearable
+ :readonly="active > 1"
+ ></el-input>
</template>
</el-table-column>
- <el-table-column prop="sampleCode" label="鏍峰搧缂栧彿" min-width="140" align="center">
+ <el-table-column
+ prop="sampleCode"
+ label="鏍峰搧缂栧彿"
+ min-width="140"
+ align="center"
+ >
<template slot-scope="scope">
- <el-input size="small" v-model="scope.row.sampleCode" clearable placeholder="涓嶅~鍐欏垯绯荤粺鑷姩鐢熸垚"
- :readonly="active > 1"></el-input>
+ <el-input
+ size="small"
+ v-model="scope.row.sampleCode"
+ clearable
+ placeholder="涓嶅~鍐欏垯绯荤粺鑷姩鐢熸垚"
+ :readonly="active > 1"
+ ></el-input>
</template>
</el-table-column>
- <el-table-column prop="model" label="鏍峰搧鍨嬪彿" align="center" min-width="100">
+ <el-table-column
+ prop="model"
+ label="鏍峰搧鍨嬪彿"
+ align="center"
+ min-width="100"
+ >
<template slot-scope="scope">
- <el-select v-model="scope.row.model" filterable allow-create default-first-option placeholder="鏍峰搧鍨嬪彿"
- size="small" @change="handleChangeModel" :disabled="active > 1" style="width: 100%">
- <el-option v-for="item in models" :key="item.value" :label="item.label" :value="item.value">
+ <el-select
+ v-model="scope.row.model"
+ filterable
+ allow-create
+ default-first-option
+ placeholder="鏍峰搧鍨嬪彿"
+ size="small"
+ @change="handleChangeModel"
+ :disabled="active > 1"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="item in models"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
</el-option>
</el-select>
</template>
</el-table-column>
- <el-table-column prop="modelNum" label="鍨嬪彿鍙傛暟" width="130" align="center" v-if="!(active > 1)">
+ <el-table-column
+ prop="modelNum"
+ label="鍨嬪彿鍙傛暟"
+ width="130"
+ align="center"
+ v-if="!(active > 1)"
+ >
<template slot-scope="scope">
- <el-input size="small" v-model="scope.row.modelNum" clearable placeholder="闈炲繀濉�" @keyup.enter.native="
- methodChange(scope.row.standardMethodListId, scope.row)
- " @clear="methodChange(scope.row.standardMethodListId, scope.row)"></el-input>
+ <el-input
+ size="small"
+ v-model="scope.row.modelNum"
+ clearable
+ placeholder="闈炲繀濉�"
+ @keyup.enter.native="
+ methodChange(scope.row.standardMethodListId, scope.row)
+ "
+ @clear="methodChange(scope.row.standardMethodListId, scope.row)"
+ ></el-input>
</template>
</el-table-column>
- <el-table-column prop="standardMethodListId" label="妫�楠屾爣鍑�" align="center" min-width="100">
+ <el-table-column
+ prop="standardMethodListId"
+ label="妫�楠屾爣鍑�"
+ align="center"
+ min-width="100"
+ >
<template slot-scope="scope">
- <el-select v-model="scope.row.standardMethodListId" :disabled="scope.row.model == null || active > 1"
- placeholder="妫�楠屾爣鍑�" filterable size="small" :loading="methodLoad"
- @change="(value) => methodChange(value, scope.row)" @focus="methodFocus" :readonly="active > 1"
- style="width: 100%" clearable @clear="productList = []">
- <el-option v-for="item in methods" :key="item.id" :label="item.code" :value="item.id">
+ <el-select
+ v-model="scope.row.standardMethodListId"
+ :disabled="scope.row.model == null || active > 1"
+ placeholder="妫�楠屾爣鍑�"
+ filterable
+ size="small"
+ :loading="methodLoad"
+ @change="(value) => methodChange(value, scope.row)"
+ @focus="methodFocus"
+ :readonly="active > 1"
+ style="width: 100%"
+ clearable
+ @clear="productList = []"
+ >
+ <el-option
+ v-for="item in methods"
+ :key="item.id"
+ :label="item.code"
+ :value="item.id"
+ >
</el-option>
</el-select>
</template>
</el-table-column>
- <el-table-column prop="joinName" label="閰嶅鏍峰搧鍚嶇О" width="140" align="center" v-if="addObj.mating == 1">
+ <el-table-column
+ prop="joinName"
+ label="閰嶅鏍峰搧鍚嶇О"
+ width="140"
+ align="center"
+ v-if="addObj.mating == 1"
+ >
<template slot-scope="scope">
- <el-input size="small" type="textarea" :autosize="{ minRows: 1, maxRows: 1 }"
- v-model="scope.row.joinName"></el-input>
+ <el-input
+ size="small"
+ type="textarea"
+ :autosize="{ minRows: 1, maxRows: 1 }"
+ v-model="scope.row.joinName"
+ ></el-input>
</template>
</el-table-column>
- <el-table-column prop="joinModel" label="閰嶅鏍峰搧鍨嬪彿" width="140" align="center" v-if="addObj.mating == 1">
+ <el-table-column
+ prop="joinModel"
+ label="閰嶅鏍峰搧鍨嬪彿"
+ width="140"
+ align="center"
+ v-if="addObj.mating == 1"
+ >
<template slot-scope="scope">
- <el-input size="small" type="textarea" :autosize="{ minRows: 1, maxRows: 1 }"
- v-model="scope.row.joinModel"></el-input>
+ <el-input
+ size="small"
+ type="textarea"
+ :autosize="{ minRows: 1, maxRows: 1 }"
+ v-model="scope.row.joinModel"
+ ></el-input>
</template>
</el-table-column>
- <el-table-column prop="joinNum" label="閰嶅鏍峰搧鏁伴噺" width="140" align="center" v-if="addObj.mating == 1">
+ <el-table-column
+ prop="joinNum"
+ label="閰嶅鏍峰搧鏁伴噺"
+ width="140"
+ align="center"
+ v-if="addObj.mating == 1"
+ >
<template slot-scope="scope">
- <el-input-number size="small" v-model="scope.row.joinNum" :min="1" :max="100" :precision="0"
- :controls="false" style="width: 80%"></el-input-number>
+ <el-input-number
+ size="small"
+ v-model="scope.row.joinNum"
+ :min="1"
+ :max="100"
+ :precision="0"
+ :controls="false"
+ style="width: 80%"
+ ></el-input-number>
</template>
</el-table-column>
- <el-table-column prop="proNum" label="寰呮椤规暟閲�" width="105" align="center"></el-table-column>
+ <el-table-column
+ prop="proNum"
+ label="寰呮椤规暟閲�"
+ width="105"
+ align="center"
+ ></el-table-column>
</el-table>
- <el-table class="el-table" ref="productTable" :data="productList" max-height="400px" tooltip-effect="dark"
- border @selection-change="selectProduct" style="margin-bottom: 10px" @select="upProductSelect"
- :row-class-name="tableRowClassName" v-loading="standardLoading || getProductLoad" @select-all="handleAll">
- <el-table-column type="selection" width="65" :selectable="selectable" v-if="active == 1"></el-table-column>
- <el-table-column prop="inspectionItem" label="妫�楠岄」" min-width="140" show-overflow-tooltip>
+ <el-table
+ class="el-table"
+ ref="productTable"
+ :data="productList"
+ max-height="400px"
+ tooltip-effect="dark"
+ border
+ @selection-change="selectProduct"
+ style="margin-bottom: 10px"
+ @select="upProductSelect"
+ :row-class-name="tableRowClassName"
+ v-loading="standardLoading || getProductLoad"
+ @select-all="handleAll"
+ >
+ <el-table-column
+ type="selection"
+ width="65"
+ :selectable="selectable"
+ v-if="active == 1"
+ ></el-table-column>
+ <el-table-column
+ prop="inspectionItem"
+ label="妫�楠岄」"
+ min-width="140"
+ show-overflow-tooltip
+ >
<template slot="header" slot-scope="scope">
- <div style="
+ <div
+ style="
display: flex;
align-items: center;
flex-direction: column;
font-size: 14px;
- ">
+ "
+ >
<span>妫�楠岄」</span>
- <el-input v-if="active == 1" v-model="inspectionItem" @input="searchFilterList" size="mini"
- placeholder="璇疯緭鍏�" />
+ <el-input
+ v-if="active == 1"
+ v-model="inspectionItem"
+ @input="searchFilterList"
+ size="mini"
+ placeholder="璇疯緭鍏�"
+ />
</div>
</template>
</el-table-column>
- <el-table-column prop="inspectionItemSubclass" label="妫�楠岄」瀛愰」" min-width="140" show-overflow-tooltip>
+ <el-table-column
+ prop="inspectionItemSubclass"
+ label="妫�楠岄」瀛愰」"
+ min-width="140"
+ show-overflow-tooltip
+ >
<template slot="header" slot-scope="scope">
- <div style="
+ <div
+ style="
display: flex;
align-items: center;
flex-direction: column;
font-size: 14px;
- ">
+ "
+ >
<span>妫�楠岄」瀛愰」</span>
- <el-input v-if="active == 1" v-model="inspectionItemSubclass" @input="searchFilterList" size="mini"
- placeholder="璇疯緭鍏�" />
+ <el-input
+ v-if="active == 1"
+ v-model="inspectionItemSubclass"
+ @input="searchFilterList"
+ size="mini"
+ placeholder="璇疯緭鍏�"
+ />
</div>
</template>
</el-table-column>
<el-table-column prop="tell" label="瑕佹眰鎻忚堪" min-width="220px">
<template slot-scope="scope">
- <el-input size="small" placeholder="瑕佹眰鎻忚堪" v-model="scope.row.tell" clearable type="textarea"
- :autosize="{ minRows: 1, maxRows: 3 }" @change="(e) => requestChange(e, scope.row, 'tell')"
- v-if="active == 1 && isAskOnlyRead"></el-input>
+ <el-input
+ size="small"
+ placeholder="瑕佹眰鎻忚堪"
+ v-model="scope.row.tell"
+ clearable
+ type="textarea"
+ :autosize="{ minRows: 1, maxRows: 3 }"
+ @change="(e) => requestChange(e, scope.row, 'tell')"
+ v-if="active == 1 && isAskOnlyRead"
+ ></el-input>
<span v-else>
<template>{{ scope.row.tell }}</template>
</span>
</template>
</el-table-column>
- <el-table-column prop="ask" label="瑕佹眰鍊�" min-width="220px" v-if="isAskOnlyRead">
+ <el-table-column
+ prop="ask"
+ label="瑕佹眰鍊�"
+ min-width="220px"
+ v-if="isAskOnlyRead"
+ >
<template slot-scope="scope">
- <el-input size="small" placeholder="瑕佹眰鍊�" v-model="scope.row.ask" clearable type="textarea"
- :autosize="{ minRows: 1, maxRows: 3 }" @change="(e) => requestChange(e, scope.row, 'ask')" v-if="
+ <el-input
+ size="small"
+ placeholder="瑕佹眰鍊�"
+ v-model="scope.row.ask"
+ clearable
+ type="textarea"
+ :autosize="{ minRows: 1, maxRows: 3 }"
+ @change="(e) => requestChange(e, scope.row, 'ask')"
+ v-if="
active == 1 &&
isAskOnlyRead &&
scope.row.inspectionValueType != '5'
- "></el-input>
+ "
+ ></el-input>
<span v-else>
<template>{{ scope.row.ask }}</template>
</span>
</template>
</el-table-column>
- <el-table-column prop="methodS" label="璇曢獙鏂规硶" min-width="120" show-overflow-tooltip>
+ <el-table-column
+ prop="methodS"
+ label="璇曢獙鏂规硶"
+ min-width="120"
+ show-overflow-tooltip
+ >
<template slot="header" slot-scope="scope">
- <div style="
+ <div
+ style="
display: flex;
align-items: center;
flex-direction: column;
font-size: 14px;
- ">
+ "
+ >
<span>璇曢獙鏂规硶</span>
- <el-input v-if="active == 1" v-model="methodS" @input="searchFilterList" size="mini"
- placeholder="璇疯緭鍏�" />
+ <el-input
+ v-if="active == 1"
+ v-model="methodS"
+ @input="searchFilterList"
+ size="mini"
+ placeholder="璇疯緭鍏�"
+ />
</div>
</template>
</el-table-column>
- <el-table-column prop="unit" label="璁¢噺鍗曚綅" width="100" show-overflow-tooltip></el-table-column>
- <el-table-column prop="price" label="鍗曚环" width="100" show-overflow-tooltip></el-table-column>
- <el-table-column prop="section" label="鍖洪棿" min-width="120" show-overflow-tooltip></el-table-column>
- <el-table-column prop="sonLaboratory" label="瀛愬疄楠屽" min-width="130" show-overflow-tooltip :filters="filters"
- :filter-method="filterHandler"></el-table-column>
+ <el-table-column
+ prop="unit"
+ label="璁¢噺鍗曚綅"
+ width="100"
+ show-overflow-tooltip
+ ></el-table-column>
+ <el-table-column
+ prop="price"
+ label="鍗曚环"
+ width="100"
+ show-overflow-tooltip
+ ></el-table-column>
+ <el-table-column
+ prop="section"
+ label="鍖洪棿"
+ min-width="120"
+ show-overflow-tooltip
+ ></el-table-column>
+ <el-table-column
+ prop="sonLaboratory"
+ label="瀛愬疄楠屽"
+ min-width="130"
+ show-overflow-tooltip
+ :filters="filters"
+ :filter-method="filterHandler"
+ ></el-table-column>
</el-table>
</div>
</basic-container>
+ <el-dialog
+ title="閫夋嫨鏍峰搧"
+ :visible.sync="selectStandardTree"
+ width="500px"
+ >
+ <div
+ class="body"
+ style="height: 60vh; overflow-y: auto; user-select: none"
+ v-if="selectStandardTree"
+ >
+ <el-row>
+ <el-col :span="24">
+ <el-input
+ placeholder="杈撳叆鍏抽敭瀛楄繘琛屾悳绱�"
+ suffix-icon="el-icon-search"
+ v-model="search"
+ size="small"
+ style="margin-bottom: 5px"
+ clearable
+ @blur="searchFilter"
+ @clear="searchFilter"
+ @keyup.enter.native="searchFilter"
+ ></el-input>
+ </el-col>
+ </el-row>
+ <el-tree
+ :data="list"
+ ref="tree"
+ :props="{ children: 'children', label: 'label' }"
+ node-key="label"
+ :filter-node-method="filterNode"
+ @node-click="handleNodeClick"
+ highlight-current
+ @node-expand="nodeOpen"
+ @node-collapse="nodeClose"
+ :default-expanded-keys="expandedKeys"
+ @dblclick.native="activeStandardTree"
+ >
+ <div class="custom-tree-node" slot-scope="{ node, data }">
+ <el-row>
+ <el-col :span="24">
+ <span
+ ><i
+ :class="`node_i ${
+ data.children != undefined
+ ? data.code === '[1]'
+ ? 'el-icon-folder-opened'
+ : 'el-icon-folder'
+ : 'el-icon-tickets'
+ }`"
+ ></i>
+ {{ data.code }} {{ data.label }}</span
+ >
+ </el-col>
+ </el-row>
+ </div>
+ </el-tree>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="selectStandardTree = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="activeStandardTree">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ <el-dialog title="閫夋嫨鍗曚綅" :visible.sync="selectUserDia" width="70%">
+ <div class="body" style="height: 60vh" v-if="selectUserDia">
+ <ValueTable
+ ref="ValueTable2"
+ :url="$api.user.selectCustomPageList"
+ :componentData="componentData2"
+ />
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="selectUserDia = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="selectUser">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ <el-dialog title="淇濆瓨妯℃澘" :visible.sync="templateDia" width="400px">
+ <div
+ class="body"
+ style="display: flex; align-items: center"
+ v-if="templateDia"
+ >
+ <div class="search_label" style="width: 90px">
+ <span class="required-span">* </span>妯℃澘鍚嶇О锛�
+ </div>
+ <div class="search_input">
+ <el-input size="small" clearable v-model="templateName"></el-input>
+ </div>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="templateDia = false">鍙� 娑�</el-button>
+ <el-button
+ type="primary"
+ @click="addTemplateDia"
+ :loading="templateLoading"
+ >纭� 瀹�</el-button
+ >
+ </span>
+ </el-dialog>
+ <el-dialog
+ title="妫�楠屼笅鍙�"
+ :visible.sync="issuedDialogVisible"
+ width="400px"
+ :close-on-click-modal="false"
+ :close-on-press-escape="false"
+ :show-close="false"
+ >
+ <div class="body" style="max-height: 60vh">
+ <el-row>
+ <el-col class="search_thing" :span="22">
+ <div class="search_label">
+ <span class="required-span">* </span>绾﹀畾鏃堕棿锛�
+ </div>
+ <div class="search_input">
+ <el-date-picker
+ size="small"
+ v-model="distributeData.appointed"
+ :picker-options="pickerOptions"
+ type="date"
+ placeholder="閫夋嫨鏃ユ湡"
+ value-format="yyyy-MM-dd"
+ style="width: 100%"
+ format="yyyy-MM-dd"
+ >
+ </el-date-picker>
+ </div>
+ </el-col>
+ <el-col class="search_thing" :span="22">
+ <div class="search_label">
+ <span class="required-span" v-if="addObj.type == 2">* </span
+ >鎸囨淳浜哄憳锛�
+ </div>
+ <div class="search_input">
+ <el-select
+ multiple
+ v-model="distributeData.userId"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ filterable
+ style="width: 100%"
+ @change="changeUser"
+ >
+ <el-option-group
+ v-for="(item, index) in Object.keys(personList)"
+ :key="index"
+ :label="item"
+ >
+ <el-option
+ v-for="op in personList[item]"
+ :key="op.id"
+ :label="op.name"
+ :value="op.id"
+ >
+ </el-option>
+ </el-option-group>
+ </el-select>
+ </div>
+ </el-col>
+ <el-col
+ class="search_thing"
+ :span="22"
+ v-if="distributeData.userId.length > 0"
+ >
+ <div class="search_label">
+ <span class="required-span">* </span>璇曢獙瀹わ細
+ </div>
+ <div class="search_input">
+ <el-select
+ v-model="distributeData.sonLaboratory"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ filterable
+ style="width: 100%"
+ >
+ <el-option
+ v-for="item in sonLaboratoryList"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </div>
+ </el-col>
+ <el-col class="search_thing" :span="22">
+ <div class="search_label">
+ <span class="required-span">* </span>鍒涘缓濮旀墭鍗曪細
+ </div>
+ <div class="search_input">
+ <el-select
+ v-model="distributeData.isCreate"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ filterable
+ style="width: 100%"
+ >
+ <el-option label="鏄�" :value="true"></el-option>
+ <el-option label="鍚�" :value="false"></el-option>
+ </el-select>
+ </div>
+ </el-col>
+ </el-row>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-row>
+ <el-button @click="issuedDialogVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitForm2" :loading="upLoad"
+ >纭� 瀹�</el-button
+ >
+ </el-row>
+ </span>
+ </el-dialog>
+ <el-dialog title="涓嶉�氳繃鍘熷洜" :visible.sync="noDialogVisible" width="400px">
+ <div class="body" style="max-height: 60vh">
+ <el-row>
+ <el-col class="search_thing" :span="22">
+ <div class="search_label">
+ <span class="required-span">* </span>涓嶉�氳繃鍘熷洜锛�
+ </div>
+ <div class="search_input">
+ <el-input
+ v-model="tell"
+ size="small"
+ placeholder="璇疯緭鍏ヤ笉閫氳繃鍘熷洜"
+ ></el-input>
+ </div>
+ </el-col>
+ </el-row>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-row>
+ <el-button @click="(noDialogVisible = false), (tell = '')"
+ >鍙� 娑�</el-button
+ >
+ <el-button type="primary" @click="submitTell" :loading="noLoading"
+ >纭� 瀹�</el-button
+ >
+ </el-row>
+ </span>
+ </el-dialog>
+ <fiberOpticConfig
+ :fiberPairing="fiberPairing"
+ :currentId="currentId"
+ @saveFiberopticConfig="saveFiberConfigEvent($event)"
+ v-if="configShow && examine == 0"
+ :active="active"
+ :inspectionItemST="inspectionItemST"
+ />
+ <fiberOpticConfigTwo
+ :currentId="currentId"
+ v-if="configShow && examine == 1"
+ :active="active"
+ />
+ <equipConfig
+ :currentId="currentId"
+ v-if="equipConfigShow"
+ :active="active"
+ />
+ <cableConfig v-if="cableConfigShow" :active="active" />
+ <!-- 鍗曢�夌壒娈婂�煎鐞嗘-->
+ <el-dialog
+ title="妫�娴嬪埌鐗规畩椤癸紝璇蜂綔鍑轰互涓嬮�夋嫨"
+ :visible.sync="bsm1Dia"
+ :close-on-press-escape="false"
+ :close-on-click-modal="false"
+ min-width="400px"
+ :show-close="false"
+ :before-close="beforeClose"
+ >
+ <div class="body" style="max-height: 60vh">
+ <el-row v-if="bsm1">
+ <el-col
+ class="search_thing"
+ :span="24"
+ style="height: initial; margin: 5px 0"
+ >
+ <div class="search_label" style="width: 80px">
+ <span class="required-span">* </span>閫夐」锛�
+ </div>
+ <div class="search_input">
+ <el-radio-group v-model="bsm1Val" @input="upBsm1">
+ <el-radio
+ v-for="(a, ai) in JSON.parse(bsmRow.section)"
+ :key="ai"
+ :label="a"
+ style="margin-bottom: 2px; margin-top: 2px"
+ ></el-radio>
+ </el-radio-group>
+ </div>
+ </el-col>
+ <el-col
+ class="search_thing"
+ :span="24"
+ style="height: initial; margin: 5px 0"
+ >
+ <div class="search_label" style="width: 80px">瑕佹眰鍊硷細</div>
+ <div
+ class="search_input"
+ v-show="bsm1Val !== null && bsm1Val !== ''"
+ >
+ <el-radio-group v-model="bsm1Val" @input="upBsm1">
+ <el-radio
+ v-for="(a, ai) in JSON.parse(bsmRow.section)"
+ :key="ai"
+ :label="a"
+ >{{ JSON.parse(bsmRow.ask)[ai] }}</el-radio
+ >
+ </el-radio-group>
+ </div>
+ </el-col>
+ </el-row>
+ <el-row v-if="bsm2">
+ <el-col class="search_thing" :span="22">
+ <div class="search_label" style="width: 220px">
+ <span class="required-span">* </span>鏍峰搧鐔旀帴閰嶅鏁伴噺锛�
+ </div>
+ <div class="search_input">
+ <el-input-number
+ size="medium"
+ v-model="bsm2Val"
+ :min="1"
+ :max="bsm2Val3.length"
+ :precision="0"
+ style="width: 70%"
+ :controls="false"
+ @change="bsm2Up"
+ ></el-input-number>
+ <span>MAX锛歿{ bsm2Val3.length }}</span>
+ </div>
+ </el-col>
+ <el-col style="margin-top: 6px">
+ <el-col v-for="(a, ai) in bsm2Val2" :key="ai">
+ <el-col :span="10">
+ <el-select
+ v-model="a[0]"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="(item, index) in sampleList"
+ :key="index"
+ :label="index + 1"
+ :value="index + 1"
+ >
+ </el-option>
+ </el-select>
+ </el-col>
+ <el-col
+ :span="4"
+ class="pairing"
+ style="border: 0; color: rgba(0, 0, 0, 0.2)"
+ >鈥斺��</el-col
+ >
+ <el-col :span="10">
+ <el-select
+ v-model="a[1]"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="(item, index) in sampleList"
+ :key="index"
+ :label="index + 1"
+ :value="index + 1"
+ >
+ </el-option>
+ </el-select>
+ </el-col>
+ </el-col>
+ </el-col>
+ </el-row>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-row>
+ <el-button type="primary" @click="save2" :loading="saveLoad"
+ >纭� 瀹�</el-button
+ >
+ </el-row>
+ </span>
+ </el-dialog>
+ <!-- 鍏ㄩ�夌壒娈婂�煎鐞嗘-->
+ <el-dialog
+ title="妫�娴嬪埌鐗规畩椤癸紝璇蜂綔鍑轰互涓嬮�夋嫨"
+ :visible.sync="bsm1DiaAll"
+ min-width="400px"
+ :show-close="false"
+ :close-on-press-escape="false"
+ :close-on-click-modal="false"
+ :before-close="beforeClose"
+ >
+ <div
+ class="body"
+ style="max-height: 60vh"
+ v-for="(item, index) in bsm1DiaList"
+ :key="index"
+ >
+ <el-row v-if="item.bsm1">
+ <el-col
+ class="search_thing"
+ :span="24"
+ style="height: initial; margin: 5px 0"
+ >
+ <div class="search_label" style="width: 80px">
+ <span class="required-span">* </span>閫夐」锛�
+ </div>
+ <div class="search_input">
+ <el-radio-group v-model="item.bsm1Val" @input="upBsmAll(item)">
+ <el-radio
+ v-for="(a, ai) in JSON.parse(item.bsmRow.section)"
+ :key="ai"
+ :label="a"
+ style="margin-bottom: 2px; margin-top: 2px"
+ ></el-radio>
+ </el-radio-group>
+ </div>
+ </el-col>
+ <el-col
+ class="search_thing"
+ :span="24"
+ style="height: initial; margin: 5px 0"
+ >
+ <div class="search_label" style="width: 80px">瑕佹眰鍊硷細</div>
+ <div
+ class="search_input"
+ v-show="item.bsm1Val !== null && item.bsm1Val !== ''"
+ >
+ <el-radio-group v-model="item.bsm1Val" @input="upBsmAll(item)">
+ <el-radio
+ v-for="(a, ai) in JSON.parse(item.bsmRow.section)"
+ :key="ai"
+ :label="a"
+ >{{ JSON.parse(item.bsmRow.ask)[ai] }}</el-radio
+ >
+ </el-radio-group>
+ </div>
+ </el-col>
+ </el-row>
+ <el-row v-if="item.bsm2">
+ <el-col class="search_thing" :span="22">
+ <div class="search_label" style="width: 220px">
+ <span class="required-span">* </span>鏍峰搧鐔旀帴閰嶅鏁伴噺锛�
+ </div>
+ <div class="search_input">
+ <el-input-number
+ size="medium"
+ v-model="item.bsm2Val"
+ :min="1"
+ :max="item.bsm2Val3.length"
+ :precision="0"
+ style="width: 70%"
+ :controls="false"
+ @change="bsm2Up"
+ ></el-input-number>
+ <span>MAX锛歿{ item.bsm2Val3.length }}</span>
+ </div>
+ </el-col>
+ <el-col style="margin-top: 6px">
+ <el-col v-for="(a, ai) in item.bsm2Val2" :key="ai">
+ <el-col :span="10">
+ <el-select
+ v-model="a[0]"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="(item, index) in item.sampleList"
+ :key="index"
+ :label="index + 1"
+ :value="index + 1"
+ >
+ </el-option>
+ </el-select>
+ </el-col>
+ <el-col
+ :span="4"
+ class="pairing"
+ style="border: 0; color: rgba(0, 0, 0, 0.2)"
+ >鈥斺��</el-col
+ >
+ <el-col :span="10">
+ <el-select
+ v-model="a[1]"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="(item, index) in item.sampleList"
+ :key="index"
+ :label="index + 1"
+ :value="index + 1"
+ >
+ </el-option>
+ </el-select>
+ </el-col>
+ </el-col>
+ </el-col>
+ </el-row>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-row>
+ <el-button type="primary" @click="save1" :loading="saveLoad"
+ >纭� 瀹�</el-button
+ >
+ </el-row>
+ </span>
+ </el-dialog>
+ <el-dialog
+ title="鐗规畩鍊煎~鍐�"
+ :visible.sync="bsm3Dia"
+ top="5vh"
+ :close-on-click-modal="false"
+ :close-on-press-escape="false"
+ width="800px"
+ :show-close="false"
+ >
+ <el-table :data="editTable" style="width: 100%" height="500px">
+ <!-- inspectionItemList -->
+ <el-table-column prop="inspectionItemList" label="妫�楠岄」" width="180">
+ </el-table-column>
+ <el-table-column prop="sampleCode" label="鏍峰搧缂栧彿" width="180">
+ </el-table-column>
+ <el-table-column prop="model" label="鏍峰搧鍨嬪彿" width="180">
+ </el-table-column>
+ <el-table-column prop="symbolItem" label="璇嗗埆绗﹀彿"> </el-table-column>
+ <el-table-column prop="value" label="璇嗗埆绗﹀��">
+ <template slot-scope="scope">
+ <el-input
+ v-model="scope.row.value"
+ placeholder="璇疯緭鍏�"
+ @input="inputValueHandler(scope.row, scope.$index)"
+ size="small"
+ type="number"
+ ></el-input>
+ </template>
+ </el-table-column>
+ </el-table>
+ <span slot="footer" class="dialog-footer">
+ <el-row>
+ <el-button @click="bsm3Dia = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="save0" :loading="saveLoad"
+ >纭� 瀹�</el-button
+ >
+ </el-row>
+ </span>
+ </el-dialog>
+ <el-dialog
+ title="娓╁害寰幆瑕佹眰濉啓"
+ :visible.sync="circulateShow"
+ width="900px"
+ :close-on-click-modal="false"
+ :close-on-press-escape="false"
+ :before-close="beforeCirculateShowClose"
+ :show-close="false"
+ >
+ <div class="search" style="display: flex; background: transparent">
+ <div class="search_thing">
+ <div class="search_label">淇濇俯鏃堕棿锛�</div>
+ <div class="search_input">
+ <el-input
+ v-model="circulateForm.entrustTime"
+ size="small"
+ placeholder=""
+ type="number"
+ ></el-input>
+ </div>
+ </div>
+ <div class="search_thing">
+ <div class="search_label">寰幆娆℃暟锛�</div>
+ <div class="search_input">
+ <el-input
+ v-model="circulateForm.entrustNum"
+ size="small"
+ placeholder=""
+ type="number"
+ ></el-input>
+ </div>
+ </div>
+ <div class="search_thing">
+ <div class="search_label">娓╁害鐐癸細</div>
+ <div class="search_input">
+ <el-input
+ @focus="() => (isFocus = true)"
+ @blur="changeTemperatureData"
+ v-model="circulateForm.entrustPoint"
+ size="small"
+ placeholder=""
+ type="number"
+ ></el-input>
+ </div>
+ </div>
+ </div>
+ <div class="circulateTable">
+ <div class="opticalProject">
+ <div style="line-height: 30px">鍏夌氦椤圭洰</div>
+ <el-divider></el-divider>
+ <div>
+ <el-table
+ ref="multipleTable"
+ border
+ :header-cell-style="{ 'text-align': 'center' }"
+ :cell-style="{ 'text-align': 'center' }"
+ :data="opticalProject"
+ tooltip-effect="dark"
+ style="width: 100%"
+ @row-click="rowClickOptical"
+ @select="selectOpticalProject"
+ @select-all="selectAllOptical"
+ @selection-change="handleSelectionChange"
+ >
+ <el-table-column type="selection" width="55"> </el-table-column>
+ <el-table-column
+ prop="value"
+ label="鍏夌氦椤圭洰"
+ show-overflow-tooltip
+ ></el-table-column>
+ </el-table>
+ </div>
+ </div>
+ <div class="temperatureList">
+ <div class="temperatureListTitle">
+ <span>娓╁害鐐归泦鍚�</span>
+ <span>
+ <el-button
+ type="primary"
+ size="mini"
+ :disabled="isFocus"
+ @click="addTemperatureData"
+ >鏂板</el-button
+ >
+ <el-button size="mini" @click="deleteTemperatureData"
+ >鍒犻櫎</el-button
+ >
+ </span>
+ </div>
+ <el-divider></el-divider>
+ <el-table
+ :data="temperatureData"
+ border
+ :header-cell-style="{ 'text-align': 'center' }"
+ :cell-style="{ 'text-align': 'center' }"
+ style="width: 100%"
+ >
+ <el-table-column prop="date" label="娓╁害鐐�(鈩�)" width="120px">
+ <template slot-scope="scope">
+ <el-input
+ size="small"
+ v-model="scope.row.temperaturePoint"
+ clearable
+ placeholder="璇疯緭鍏�"
+ @change="changeTemperature"
+ ></el-input>
+ </template>
+ </el-table-column>
+ <el-table-column prop="name" label="瑕佹眰(dB/Km)">
+ <template slot-scope="scope">
+ <span>x</span>
+ <el-select
+ v-model="scope.row.askSymbol"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 120px"
+ @change="changeTemperature"
+ >
+ <el-option
+ v-for="item in temperatureDataList"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ <el-input
+ size="small"
+ v-model="scope.row.askNum"
+ clearable
+ placeholder="璇疯緭鍏�"
+ style="width: 120px"
+ @change="changeTemperature"
+ ></el-input>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="cleanSpliceData">鍙栨秷</el-button>
+ <el-button type="primary" @click="spliceData">淇濆瓨</el-button>
+ </span>
+ </el-dialog>
+ <!-- 鐢靛姏璇曢獙瀹�---娓╁崌璇曢獙/鐑惊鐜� -->
+ <el-dialog
+ :title="temperatureTitle"
+ :visible.sync="temperatureShow"
+ :close-on-click-modal="false"
+ :close-on-press-escape="false"
+ width="260px"
+ :before-close="temperatureShowClose"
+ :show-close="false"
+ >
+ <div>
+ <div v-if="isShowInput" style="margin-bottom: 6px">
+ <span>寰幆娆℃暟:</span>
+ <!-- <el-input size="small" type="number" v-model="temperatureTestNum" style="width: 120px"></el-input> -->
+ <el-input-number
+ v-model="temperatureTestNum"
+ :min="2"
+ :max="1000000"
+ size="small"
+ label=""
+ ></el-input-number>
+ </div>
+ <el-checkbox-group
+ v-model="temperatureTest"
+ @change="handleTemperatureTestChange"
+ style="display: flex; flex-direction: column"
+ >
+ <el-checkbox
+ v-for="item in temperatureList"
+ :label="item"
+ :key="item"
+ style="margin-bottom: 6px"
+ >{{ item }}</el-checkbox
+ >
+ </el-checkbox-group>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="cleanTemperatureTest">鍙栨秷</el-button>
+ <el-button type="primary" @click="spliceTemperatureTest"
+ >淇濆瓨</el-button
+ >
+ </span>
+ </el-dialog>
</div>
</template>
<script>
+import {
+ selectInsOrderTemplate,
+ hasSendUrgentOrder,
+ addInsOrder,
+ selectOrderManDay,
+ selectInsOrderTemplateById,
+ upInsOrderOfState,
+ upInsOrder,
+ getInsOrder,
+ addInsOrderTemplate,
+ delInsOrderTemplate,
+ labelPrinting,
+} from "@/api/business/inspectionOrder";
+import {
+ selectStandardTreeList2,
+ selectStandardMethodEnum,
+ selectsStandardMethodByFLSSM,
+ selectStandardProductList,
+} from "@/api/standard/standardLibrary";
+import { selectBushingBySampleId } from "@/api/business/insBushing";
+import { getLaboratoryPersonList } from "@/api/system/user";
import { mapGetters } from "vuex";
import fiberOpticConfig from "./fiberoptic-config.vue";
import fiberOpticConfigReadOnly from "./fiberoptic-config-readonly.vue";
@@ -375,24 +1584,15 @@
cableConfig,
},
computed: {
- ...mapGetters(["nickName", "company"]),
+ ...mapGetters(["nickName", "loginUserInfo"]),
},
- props: {
- examine: {
- type: Number,
- default: () => 0,
- },
- active: {
- type: Number,
- default: () => 0,
- },
- currentId: {
- type: Number,
- default: () => 0,
- },
- },
+ props: {},
data() {
return {
+ isReview: false, //鏄惁鏄煡鐪嬭鎯�
+ examine: 0,
+ active: 0,
+ currentId: 0,
pickerOptions: {
disabledDate(time) {
// 褰撳墠鏃堕棿鍔犱笂涓夊ぉ鐨勬椂闂存埑
@@ -686,18 +1886,20 @@
this.standardMethodListId = null;
},
},
+ created() {
+ this.active = this.$route.query.active;
+ this.currentId = this.$route.query.currentId;
+ this.examine = this.$route.query.examine;
+ this.isReview = this.$route.query.isReview;
+ },
mounted() {
- if (this.addObj.custom == "" || this.addObj.custom == null) {
- this.addObj.custom = this.nickName; //璁剧疆鍒跺崟浜轰负褰撳墠鐧诲綍浜�
- }
- this.addObj.company = this.company;
+ //鏌ヨ瀛楀吀
this.selectDictForType();
this.selectDictForOrderType();
this.selectDictForUnit();
this.selectDictForSampleForm();
-
if (this.active != 3) {
- this.getUserNow();
+ this.init();
}
this.selectStandardTreeList();
this.getAuthorizedPerson();
@@ -705,25 +1907,29 @@
if (this.active != 1) {
// 鏌ョ湅/瀹℃牳娴佺▼
// 璇锋眰鎺ュ彛锛屽洖鏄炬暟鎹�
- this.$axios
- .post(this.$api.insOrder.getInsOrder, {
- orderId: this.currentId,
- })
+ getInsOrder({
+ orderId: this.currentId,
+ })
.then((res) => {
- this.addObj = {
- ...res.data.insOrder,
- };
- this.addObj.type = String(this.addObj.type);
- this.sampleList = this.HaveJson(res.data.sampleProduct);
- this.getProNum();
- this.addObj.sampleNum = this.sampleList.length;
- this.$nextTick(() => {
- this.$refs.sampleTable.doLayout();
- if (this.addObj.sampleNum > 0) {
- this.$refs.sampleTable.setCurrentRow(this.sampleList[0], true);
- this.rowClick(this.sampleList[0]);
- }
- });
+ if (res.code === 200) {
+ this.addObj = {
+ ...res.data.insOrder,
+ };
+ this.addObj.type = String(this.addObj.type);
+ this.sampleList = this.HaveJson(res.data.sampleProduct);
+ this.getProNum();
+ this.addObj.sampleNum = this.sampleList.length;
+ this.$nextTick(() => {
+ this.$refs.sampleTable.doLayout();
+ if (this.addObj.sampleNum > 0) {
+ this.$refs.sampleTable.setCurrentRow(this.sampleList[0], true);
+ this.rowClick(this.sampleList[0]);
+ }
+ });
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
}
},
@@ -747,16 +1953,13 @@
let flag = true;
//濡傛灉鏄被鍨嬫槸绱ф�ワ紝鍒ゆ柇褰撳墠瀹㈡埛褰撳ぉ鐨勭揣鎬ラ搴︽槸鍚︾敤瀹�
if (type == 2) {
- await this.$axios
- .post(this.$api.insOrder.hasSendUrgentOrder, {})
+ await hasSendUrgentOrder()
.then((res) => {
flag = res.data;
return flag;
- // if (!res.data) {
- // this.addObj.type = "1";
- // this.$message.error("褰撳ぉ绱ф�ラ搴﹀凡鐢ㄥ畬");
- // throw "褰撳ぉ绱ф�ラ搴﹀凡鐢ㄥ畬";
- // }
+ })
+ .catch((error) => {
+ console.error(error);
});
}
return flag;
@@ -770,7 +1973,7 @@
});
},
//淇濆瓨鍗曟牴鍨傜洿鐕冪儳鐗规畩鍊�
- saveSingleVerticalCombustionData() { },
+ saveSingleVerticalCombustionData() {},
openSingleVerticalCombustionDialog() {
this.$prompt("鍗曟牴鍨傜洿鐕冪儳娆℃暟", "鐗规畩妫�娴嬮」鐩�", {
confirmButtonText: "纭畾",
@@ -788,7 +1991,7 @@
this.currentMethod.insProduct = this.productList0;
this.getProNum();
})
- .catch(() => { });
+ .catch(() => {});
},
singleVerticalData(arr, value) {
arr.forEach((ins) => {
@@ -1166,9 +2369,15 @@
}
},
getAuthorizedPerson() {
- this.$axios.get(this.$api.user.getLaboratoryPersonList).then((res) => {
- this.personList = res.data;
- });
+ getLaboratoryPersonList()
+ .then((res) => {
+ if (res.code === 200) {
+ this.personList = res.data;
+ }
+ })
+ .catch((error) => {
+ console.error(error);
+ });
},
selectDictForType() {
getDicts("urgency_level")
@@ -1289,7 +2498,7 @@
try {
let num = this.replaceAll(tell, symbolItem, value);
return num;
- } catch (e) { }
+ } catch (e) {}
},
replaceAll(str, find, value) {
if (str === undefined) {
@@ -1471,7 +2680,7 @@
.then(() => {
this.saveMethod(sampleList);
})
- .catch(() => { });
+ .catch(() => {});
} else {
let isRTS = this.totalArr.find(
(a) =>
@@ -1553,7 +2762,7 @@
.then(() => {
this.saveMethod(sampleList);
})
- .catch(() => { });
+ .catch(() => {});
} else {
let isRTS = this.totalArr.find(
(a) =>
@@ -1584,7 +2793,7 @@
});
}
},
- errorSet() { },
+ errorSet() {},
/**
* 鏍¢獙濮旀墭瑕佹眰鐨勬楠岄」鐨勮姹傛弿杩板拰瑕佹眰鍊�
*
@@ -1606,10 +2815,10 @@
console.log("ask or tell is null");
this.errorInspectionItemList.push(
ele.inspectionItem +
- " " +
- (ele.inspectionItemSubclass == null
- ? ""
- : ele.inspectionItemSubclass)
+ " " +
+ (ele.inspectionItemSubclass == null
+ ? ""
+ : ele.inspectionItemSubclass)
);
});
isTrue = false;
@@ -1646,10 +2855,10 @@
);
this.errorInspectionItemList.push(
ele.inspectionItem +
- " " +
- (ele.inspectionItemSubclass == null
- ? ""
- : ele.inspectionItemSubclass)
+ " " +
+ (ele.inspectionItemSubclass == null
+ ? ""
+ : ele.inspectionItemSubclass)
);
isTrue = false;
}
@@ -1658,10 +2867,10 @@
console.log("瑕佹眰鍊间腑娌℃湁鏁板瓧");
this.errorInspectionItemList.push(
ele.inspectionItem +
- " " +
- (ele.inspectionItemSubclass == null
- ? ""
- : ele.inspectionItemSubclass)
+ " " +
+ (ele.inspectionItemSubclass == null
+ ? ""
+ : ele.inspectionItemSubclass)
);
isTrue = false;
}
@@ -1672,10 +2881,10 @@
console.log("鐩村緞鍏樊涔嬪崐涓�0.5涓嶅尮閰�");
this.errorInspectionItemList.push(
ele.inspectionItem +
- " " +
- (ele.inspectionItemSubclass == null
- ? ""
- : ele.inspectionItemSubclass)
+ " " +
+ (ele.inspectionItemSubclass == null
+ ? ""
+ : ele.inspectionItemSubclass)
);
isTrue = false;
// if(ele.tell.indexOf(askVal[0])<0 && ele.tell.indexOf('鍗�')<0){
@@ -1726,10 +2935,10 @@
console.log("鏈�澶у�煎拰鏈�灏忓�肩浉绛�");
this.errorInspectionItemList.push(
ele.inspectionItem +
- " " +
- (ele.inspectionItemSubclass == null
- ? ""
- : ele.inspectionItemSubclass)
+ " " +
+ (ele.inspectionItemSubclass == null
+ ? ""
+ : ele.inspectionItemSubclass)
);
isTrue = false;
}
@@ -1738,20 +2947,20 @@
console.log("瑕佹眰鎻忚堪涓笉鍖呭惈卤浠ュ強鍖洪棿鐨勬暟瀛�");
this.errorInspectionItemList.push(
ele.inspectionItem +
- " " +
- (ele.inspectionItemSubclass == null
- ? ""
- : ele.inspectionItemSubclass)
+ " " +
+ (ele.inspectionItemSubclass == null
+ ? ""
+ : ele.inspectionItemSubclass)
);
isTrue = false;
} else if (ele.tell.indexOf("-") == 0) {
console.log("瑕佹眰鍊肩殑鍖洪棿鏍煎紡閿欒");
this.errorInspectionItemList.push(
ele.inspectionItem +
- " " +
- (ele.inspectionItemSubclass == null
- ? ""
- : ele.inspectionItemSubclass)
+ " " +
+ (ele.inspectionItemSubclass == null
+ ? ""
+ : ele.inspectionItemSubclass)
);
isTrue = false;
} else if (tell.indexOf("-") > 0 || tell.indexOf("卤") > 0) {
@@ -1770,10 +2979,10 @@
console.log("閿欒鐨勫尯闂磋缃�");
this.errorInspectionItemList.push(
ele.inspectionItem +
- " " +
- (ele.inspectionItemSubclass == null
- ? ""
- : ele.inspectionItemSubclass)
+ " " +
+ (ele.inspectionItemSubclass == null
+ ? ""
+ : ele.inspectionItemSubclass)
);
isTrue = false;
}
@@ -1786,10 +2995,10 @@
console.log(777777);
this.errorInspectionItemList.push(
ele.inspectionItem +
- " " +
- (ele.inspectionItemSubclass == null
- ? ""
- : ele.inspectionItemSubclass)
+ " " +
+ (ele.inspectionItemSubclass == null
+ ? ""
+ : ele.inspectionItemSubclass)
);
isTrue = false;
} else {
@@ -1806,10 +3015,10 @@
console.log(888888);
this.errorInspectionItemList.push(
ele.inspectionItem +
- " " +
- (ele.inspectionItemSubclass == null
- ? ""
- : ele.inspectionItemSubclass)
+ " " +
+ (ele.inspectionItemSubclass == null
+ ? ""
+ : ele.inspectionItemSubclass)
);
isTrue = false;
}
@@ -1823,10 +3032,10 @@
console.log(99999);
this.errorInspectionItemList.push(
ele.inspectionItem +
- " " +
- (ele.inspectionItemSubclass == null
- ? ""
- : ele.inspectionItemSubclass)
+ " " +
+ (ele.inspectionItemSubclass == null
+ ? ""
+ : ele.inspectionItemSubclass)
);
isTrue = false;
}
@@ -1836,10 +3045,10 @@
console.log(1010101001);
this.errorInspectionItemList.push(
ele.inspectionItem +
- " " +
- (ele.inspectionItemSubclass == null
- ? ""
- : ele.inspectionItemSubclass)
+ " " +
+ (ele.inspectionItemSubclass == null
+ ? ""
+ : ele.inspectionItemSubclass)
);
isTrue = false;
}
@@ -2112,6 +3321,7 @@
let sampleList = this.HaveJson(sampleList0);
sampleList.forEach((a) => {
a.insProduct.forEach((b) => {
+ b.id = null;
delete b.bsmRow;
});
});
@@ -2130,141 +3340,76 @@
console.log(this.sampleList);
console.log(this.fiberPairing);
this.saveLoad = true;
- this.$axios
- .post(this.$api.insOrder.addInsOrder, {
- str: JSON.stringify({
- insOrder: this.addObj,
- list: JSON.stringify(
- sampleList.map((a) => {
- if (this.PROJECT === "瑁呭鐢电紗") {
- if (a.modelNum) {
- const index = a.modelNum.indexOf("脳");
- if (index === 0) {
- a.model = a.model + a.modelNum;
- } else if (index === -1) {
- a.model = a.model + "-" + a.modelNum;
- } else {
- a.model = a.modelNum + a.model;
- }
- } else {
- a.model =
- a.model +
- (a.modelNum == null ||
- a.modelNum == "" ||
- a.modelNum == "null"
- ? ""
- : "-" + a.modelNum);
- }
- } else {
- a.model =
- a.model +
- (a.modelNum == null ||
- a.modelNum == "" ||
- a.modelNum == "null"
- ? ""
- : "-" + a.modelNum);
- }
- a.insProduct = a.insProduct.filter((b) => b.state === 1);
- return a;
- })
- ),
- pairing: JSON.stringify(this.bsm2Val2),
- fiberPairing: JSON.stringify(this.fiberPairing),
- }),
- })
+ addInsOrder({
+ insOrder: this.addObj,
+ list: sampleList.map((a) => {
+ a.model =
+ a.model +
+ (a.modelNum == null || a.modelNum == "" || a.modelNum == "null"
+ ? ""
+ : "-" + a.modelNum);
+ a.insProduct = a.insProduct.filter((b) => b.state === 1);
+ return a;
+ }),
+ pairing: this.bsm2Val2,
+ fiberPairing: this.fiberPairing,
+ })
.then((res) => {
+ if (res.code === 200) {
+ this.$message.success("宸叉彁浜�");
+ this.bsm3Dia = false;
+ this.$router.go(-1);
+ }
this.saveLoad = false;
- if (res.code == 201) return;
- this.$message.success("宸叉彁浜�");
- this.bsm3Dia = false;
- this.$parent.playOrder(0);
})
- .catch((e) => {
+ .catch((error) => {
this.saveLoad = false;
+ console.error(error);
});
},
upInsOrderOfState(state) {
if (state == 1) {
//this.saveLoad = true
this.issuedDialogVisible = true;
- this.$axios
- .post(this.$api.insOrder.selectOrderManDay, {
- id: this.currentId,
+ selectOrderManDay({
+ id: this.currentId,
+ })
+ .then((res) => {
+ if (res.code === 200) {
+ this.distributeData.orderId = this.currentId;
+ this.distributeData.appointed = res.data;
+ console.log("绾﹀畾鏃堕棿", this.distributeData.appointed);
+ }
})
- .then((ress) => {
- this.distributeData.orderId = this.currentId;
- this.distributeData.appointed = ress.data;
- console.log("绾﹀畾鏃堕棿", this.distributeData.appointed);
+ .catch((error) => {
+ console.error(error);
});
setTimeout(() => {
this.issuedDialogVisible = true;
}, 1000);
- // this.$axios.post(this.$api.insOrder.upInsOrderOfState, {
- // state,
- // id: this.currentId,
- // companyId:this.addObj.companyId,
- // laboratory:this.addObj.laboratory,
- // company: this.addObj.company
- // }, {
- // headers: {
- // 'Content-Type': 'application/json'
- // }
- // }).then(res => {
- // this.saveLoad = false
- // if (res.code == 201) return
- // this.$message.success('鎻愪氦鎴愬姛')
-
- // this.$parent.multipleSelection = [{id: this.currentId}]
- // this.$parent.print()
- // 濡傛灉绱ф�ョ▼搴︿负绱ф�ワ紝闇�瑕佺洿鎺ヤ笅鍙戜汉鍛�
- // if (this.addObj.type == 2) {
- // this.issuedDialogVisible = true;
- // this.$axios.post(this.$api.insOrder.selectOrderManDay, {
- // id: this.currentId
- // }).then(ress => {
- // this.distributeData.orderId = this.currentId
- // this.distributeData.appointed = ress.data
- // })
- // } else {
- // this.$parent.playOrder(0)
- // }
-
- // this.$axios.post(this.$api.insOrder.selectOrderManDay, {
- // id: this.currentId
- // }).then(ress => {
- // this.distributeData.orderId = this.currentId
- // this.distributeData.appointed = ress.data
- // })
- // setTimeout(() => {
- // this.issuedDialogVisible = true;
- // }, 1000)
- // })
} else {
// 涓嶉�氳繃
this.noDialogVisible = true;
}
},
getLabelPrinting(currentId) {
- this.$axios
- .post(this.$api.insOrder.labelPrinting, {
- ids: currentId,
- })
+ labelPrinting({
+ ids: currentId,
+ })
.then((res) => {
- //瀹℃牳閫氳繃锛岄粯璁ゅ彧鎵撳嵃绗竴涓牱鍝佹爣绛�
- let firstSample = res.data[0];
- let arr1 = [];
- firstSample.insProduct.forEach((b) => {
- arr1.push(b.inspectionItem);
- });
- firstSample.item = [...new Set(arr1)].join(",");
- // arr.forEach((a) => {
- // let arr1 = [];
- // a.insProduct.forEach((b) => {
- // arr1.push(b.inspectionItem);
- // });
- // a.item = [...new Set(arr1)].join(",");
- // });
- this.beginPrint(firstSample);
+ if (res.code === 200) {
+ //瀹℃牳閫氳繃锛岄粯璁ゅ彧鎵撳嵃绗竴涓牱鍝佹爣绛�
+ let firstSample = res.data[0];
+ let arr1 = [];
+ firstSample.insProduct.forEach((b) => {
+ arr1.push(b.inspectionItem);
+ });
+ firstSample.item = [...new Set(arr1)].join(",");
+ this.beginPrint(firstSample);
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
//寮�濮嬫爣绛炬墦鍗�
@@ -2360,92 +3505,74 @@
return;
}
// let flag = true;
- this.$axios
- .post(
- this.$api.insOrder.upInsOrderOfState,
- {
- state: 1,
- id: this.currentId,
- companyId: this.addObj.companyId,
- laboratory: this.addObj.laboratory,
- company: this.addObj.company,
- isCreate: this.distributeData.isCreate,
- },
- {
- headers: {
- "Content-Type": "application/json",
- },
- }
- )
+ upInsOrderOfState({
+ state: 1,
+ id: this.currentId,
+ companyId: this.addObj.companyId,
+ laboratory: this.addObj.laboratory,
+ company: this.addObj.company,
+ isCreate: this.distributeData.isCreate,
+ })
.then((res) => {
- // flag = false;
-
- // if (flag) {
- // this.$message.error("濮旀墭缂栧彿鐢熸垚澶辫触");
- // return;
- // }
- this.upLoad = true;
- this.$axios
- .post(
- this.$api.insOrder.upInsOrder,
- {
- orderId: this.distributeData.orderId,
- appointed: this.distributeData.appointed,
- userIdList: this.distributeData.userId,
- sonLaboratory: this.distributeData.sonLaboratory,
- },
- {
- headers: {
- "Content-Type": "application/json",
- },
- }
- )
- .then((res) => {
- if (res.code === 201) {
- this.upLoad = false;
- return;
- }
- this.$message.success("鎻愪氦鎴愬姛");
- this.upLoad = false;
- this.issuedDialogVisible = false;
- this.$parent.playOrder(0);
- //瀹℃牳閫氳繃鍚庯紝鑷姩鎵撳嵃浜岀淮鐮�
- //TODO: 鐢靛姏璇曢獙瀹ゆ殏鏃朵笉鐢ㄦ爣绛炬墦鍗�
- if (
- this.sonLaboratoryList.filter((f) => f.value === "鐢靛姏璇曢獙瀹�")
- .length === 0
- ) {
- this.$nextTick(() => {
- this.getLabelPrinting(this.currentId);
- });
- }
+ if (res.code === 200) {
+ this.upLoad = true;
+ upInsOrder({
+ orderId: this.distributeData.orderId,
+ appointed: this.distributeData.appointed,
+ userIdList: this.distributeData.userId,
+ sonLaboratory: this.distributeData.sonLaboratory,
})
- .catch((e) => {
- this.$message.error("鎻愪氦澶辫触");
- this.upLoad = false;
- });
+ .then((res) => {
+ if (res.code === 201) {
+ this.upLoad = false;
+ return;
+ }
+ this.$message.success("鎻愪氦鎴愬姛");
+ this.issuedDialogVisible = false;
+ this.upLoad = false;
+ this.$router.go(-1);
+ //瀹℃牳閫氳繃鍚庯紝鑷姩鎵撳嵃浜岀淮鐮�
+ //TODO: 鐢靛姏璇曢獙瀹ゆ殏鏃朵笉鐢ㄦ爣绛炬墦鍗�
+ if (
+ this.sonLaboratoryList.filter((f) => f.value === "鐢靛姏璇曢獙瀹�")
+ .length === 0
+ ) {
+ this.$nextTick(() => {
+ this.getLabelPrinting(this.currentId);
+ });
+ }
+ })
+ .catch((error) => {
+ this.$message.error("鎻愪氦澶辫触");
+ this.upLoad = false;
+ console.error(error);
+ });
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
- getUserNow() {
- this.$axios.get(this.$api.user.getUserNow).then((res) => {
- let selects = res.data;
- if (selects == null) return;
- this.addObj.userId = selects.id;
- this.addObj.company = selects.company;
- this.addObj.custom = selects.name;
- this.addObj.code = selects.code;
- this.addObj.phone = selects.phone;
- this.addObj.companyId = selects.departId;
- this.addObj.production = "/";
- this.addObj.productionEn = "/";
- if (this.active == 1) {
- this.selectInsOrderTemplate();
- }
- });
+ init() {
+ if (this.addObj.custom == "" || this.addObj.custom == null) {
+ this.addObj.custom = this.loginUserInfo.nickName; //璁剧疆鍒跺崟浜轰负褰撳墠鐧诲綍浜�
+ } else {
+ this.addObj.custom = this.loginUserInfo.nickName;
+ }
+ this.addObj.company = this.loginUserInfo.companyName;
+ this.addObj.companyId = this.loginUserInfo.company;
+ this.addObj.userId = this.loginUserInfo.userId;
+ // this.addObj.code = this.loginUserInfo.code;
+ this.addObj.phone = this.loginUserInfo.phoneNumber;
+ this.addObj.production = "/";
+ this.addObj.productionEn = "/";
+ if (this.active == 1) {
+ this.selectInsOrderTemplate();
+ }
},
getProNum() {
this.sampleSelectionList.forEach((m, i) => {
- Vue.set(
+ this.$set(
this.sampleSelectionList[i],
"proNum",
m.insProduct.filter((a) => a.state == 1).length
@@ -2503,13 +3630,17 @@
}
},
selectStandardTreeList() {
- this.$axios
- .get(this.$api.standardTree.selectStandardTreeList2)
+ selectStandardTreeList2()
.then((res) => {
- this.list = res.data;
- this.list.forEach((a) => {
- this.expandedKeys.push(a.label);
- });
+ if (res.code === 200) {
+ this.list = res.data;
+ this.list.forEach((a) => {
+ this.expandedKeys.push(a.label);
+ });
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
filterNode(value, data) {
@@ -2554,33 +3685,50 @@
},
selectsStandardMethodByFLSSM() {
this.methodLoad = true;
- this.$axios
- .post(this.$api.standardTree.selectsStandardMethodByFLSSM, {
- tree: this.selectTree,
- })
+ selectsStandardMethodByFLSSM({
+ tree: this.selectTree,
+ })
.then((res) => {
- this.methodLoad = false;
- try {
- if (
- res.data.standardMethodList.length == 0 &&
- this.selectTree.split("-").length == 5
- ) {
- let arr = this.selectTree.split("-");
- let arr0 = arr.slice(0, arr.length - 1);
- let selectTree = arr0
- .join("-")
- .substring(0, arr0.join("-").length - 1);
- this.$axios
- .post(this.$api.standardTree.selectsStandardMethodByFLSSM, {
+ if (res.code === 200) {
+ this.methodLoad = false;
+ try {
+ if (
+ res.data.standardMethodList.length == 0 &&
+ this.selectTree.split("-").length == 5
+ ) {
+ let arr = this.selectTree.split("-");
+ let arr0 = arr.slice(0, arr.length - 1);
+ let selectTree = arr0
+ .join("-")
+ .substring(0, arr0.join("-").length - 1);
+ template()
+ .then((res) => {
+ if (res.status === 200) {
+ console.log(res);
+ }
+ })
+ .catch((error) => {
+ console.error(error);
+ });
+ selectsStandardMethodByFLSSM({
tree: selectTree,
})
- .then((ress) => {
- this.methods = ress.data.standardMethodList;
- });
- } else {
- this.methods = res.data.standardMethodList;
- }
- } catch (e) { }
+ .then((res) => {
+ if (res.code === 200) {
+ this.methods = ress.data.standardMethodList;
+ }
+ })
+ .catch((error) => {
+ console.error(error);
+ });
+ } else {
+ this.methods = res.data.standardMethodList;
+ }
+ } catch (e) {}
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
addStandardTree(currentValue, oldValue) {
@@ -2778,7 +3926,7 @@
// row.manHour = arr2[index];
// row.price = arr3[index];
// row.tell = arr4[index];
- } catch (e) { }
+ } catch (e) {}
}
if (
row.bsm === "1" &&
@@ -2892,12 +4040,14 @@
console.log("upProductSelect", this.sampleList);
},
searchProject() {
- this.$axios
- .post(this.$api.enums.selectEnumByCategory, {
- category: "鍏夌氦椤圭洰",
- })
+ getDicts("fiber_type")
.then((res) => {
- this.opticalProject = res.data;
+ if (res.code === 200) {
+ this.opticalProject = res.data;
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
permute(nums) {
@@ -2934,15 +4084,14 @@
return "warning-row";
},
selectInsOrderTemplate() {
- this.$axios
- .get(
- this.$api.insOrder.selectInsOrderTemplate +
- "?company=" +
- this.addObj.company
- )
+ selectInsOrderTemplate({ company: this.addObj.company })
.then((res) => {
- if (res.code == 201) return;
- this.templates = res.data;
+ if (res.code === 200) {
+ this.templates = res.data;
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
// 鍒犻櫎妯℃澘--璋冪敤鎺ュ彛
@@ -2953,51 +4102,45 @@
type: "warning",
})
.then(() => {
- this.$axios
- .post(this.$api.insOrder.delInsOrderTemplate, {
- id: row.id,
- })
+ delInsOrderTemplate({
+ id: row.id,
+ })
.then((res) => {
- if (res.code === 201) {
- return;
+ if (res.code === 200) {
+ this.$message.success("鍒犻櫎鎴愬姛");
+ this.selectInsOrderTemplate();
}
- this.$message.success("鍒犻櫎鎴愬姛");
- this.selectInsOrderTemplate();
})
- .catch((e) => {
+ .catch((error) => {
this.$message.error("鍒犻櫎澶辫触");
+ console.error(error);
});
})
- .catch(() => { });
+ .catch(() => {});
},
// 淇濆瓨妯℃澘
addTemplateDia() {
if (this.templateName) {
this.templateLoading = true;
- this.$axios
- .post(
- this.$api.insOrder.addInsOrderTemplate,
- {
- name: this.templateName,
- thing: JSON.stringify({
- addObj: this.addObj,
- sampleList: this.sampleList,
- selectTree: this.selectTree,
- }),
- },
- {
- headers: {
- "Content-Type": "application/json",
- },
- }
- )
+ addInsOrderTemplate({
+ name: this.templateName,
+ thing: JSON.stringify({
+ addObj: this.addObj,
+ sampleList: this.sampleList,
+ selectTree: this.selectTree,
+ }),
+ })
.then((res) => {
- if (res.code == 201) return;
- this.templateLoading = false;
- this.templateDia = false;
- this.$message.success("淇濆瓨鎴愬姛");
- this.selectInsOrderTemplate();
- this.templateName = "";
+ if (res.code === 200) {
+ this.templateLoading = false;
+ this.templateDia = false;
+ this.$message.success("淇濆瓨鎴愬姛");
+ this.selectInsOrderTemplate();
+ this.templateName = "";
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
} else {
this.$message.error("璇峰~鍐欐ā鏉垮悕绉�");
@@ -3005,26 +4148,27 @@
},
// 鏌ヨ妯℃澘
selectInsOrderTemplateById(e) {
- this.$axios
- .post(this.$api.insOrder.selectInsOrderTemplateById + "?id=" + e)
+ selectInsOrderTemplateById({ id: e })
.then((res) => {
- if (res.code == 201) return;
- // let obj = JSON.parse(res.data)
- let obj = res.data;
- console.log(obj);
- //鍒跺崟浜鸿缃负褰撳墠鐧诲綍鐢ㄦ埛
- let user = JSON.parse(localStorage.getItem("user"));
- obj.addObj.custom = user.name;
- obj.addObj.userId = user.userId;
- this.addObj = obj.addObj;
- this.sampleList = obj.sampleList;
- this.selectTree = obj.selectTree;
- //榛樿閫変腑绗竴涓牱鍝�
- this.$nextTick(() => {
- if (this.sampleList.length > 0) {
- this.rowClick(this.sampleList[0]);
- }
- });
+ if (res.code === 200) {
+ let obj = res.data;
+ console.log(obj);
+ //鍒跺崟浜鸿缃负褰撳墠鐧诲綍鐢ㄦ埛
+ obj.addObj.custom = this.loginUserInfo.nickName;
+ obj.addObj.userId = this.loginUserInfo.userId;
+ this.addObj = obj.addObj;
+ this.sampleList = obj.sampleList;
+ this.selectTree = obj.selectTree;
+ //榛樿閫変腑绗竴涓牱鍝�
+ this.$nextTick(() => {
+ if (this.sampleList.length > 0) {
+ this.rowClick(this.sampleList[0]);
+ }
+ });
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
delSampleAndProduct() {
@@ -3086,43 +4230,39 @@
let selectTreeList = this.selectTree.split(" - ");
this.addObj.model &&
(selectTreeList[selectTreeList.length - 1] = this.addObj.model);
- this.$axios
- .post(
- this.$api.standardTree.selectStandardProductList,
- {
- model:
- (this.addObj.model ? this.addObj.model : row.model) +
- "-" +
- row.modelNum,
- standardMethodListId: val,
- factory: selectTreeList.join(" - "),
- },
- {
- headers: {
- "Content-Type": "application/json",
- },
- }
- )
+ selectStandardProductList({
+ model:
+ (this.addObj.model ? this.addObj.model : row.model) +
+ "-" +
+ row.modelNum,
+ standardMethodListId: val,
+ factory: selectTreeList.join(" - "),
+ })
.then((res) => {
- res.data.forEach((a) => {
- a.state = 0;
- });
- row.insProduct = this.HaveJson(res.data);
- this.productList = row.insProduct;
- this.productList0 = JSON.parse(JSON.stringify(this.productList));
- // this.$refs.sampleTable.setCurrentRow(row)
- // setTimeout(() => {
- // this.productList.forEach(a => {
- // if (a.state == 1) this.toggleSelection(a)
- // })
- // }, 200)
- this.$nextTick(() => {
- this.methodCount++;
- this.getProductLoad = false;
- if (this.sampleSelectionList.length == this.methodCount) {
- this.standardLoading = false;
- }
- });
+ if (res.code === 200) {
+ res.data.forEach((a) => {
+ a.state = 0;
+ });
+ row.insProduct = this.HaveJson(res.data);
+ this.productList = row.insProduct;
+ this.productList0 = JSON.parse(JSON.stringify(this.productList));
+ // this.$refs.sampleTable.setCurrentRow(row)
+ // setTimeout(() => {
+ // this.productList.forEach(a => {
+ // if (a.state == 1) this.toggleSelection(a)
+ // })
+ // }, 200)
+ this.$nextTick(() => {
+ this.methodCount++;
+ this.getProductLoad = false;
+ if (this.sampleSelectionList.length == this.methodCount) {
+ this.standardLoading = false;
+ }
+ });
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
this.searchProject();
this.searchTemList();
@@ -3143,60 +4283,56 @@
let selectTreeList = this.selectTree.split(" - ");
this.addObj.model &&
(selectTreeList[selectTreeList.length - 1] = this.addObj.model);
- this.$axios
- .post(
- this.$api.standardTree.selectStandardProductList,
- {
- model:
- (this.addObj.model ? this.addObj.model : row.model) +
- "-" +
- row.modelNum,
- standardMethodListId: val,
- factory: selectTreeList.join(" - "),
- },
- {
- headers: {
- "Content-Type": "application/json",
- },
- }
- )
+ selectStandardProductList({
+ model:
+ (this.addObj.model ? this.addObj.model : row.model) +
+ "-" +
+ row.modelNum,
+ standardMethodListId: val,
+ factory: selectTreeList.join(" - "),
+ })
.then((res) => {
- res.data.forEach((a) => {
- a.state = 0;
- });
- row.insProduct = this.HaveJson(res.data);
- this.productList = row.insProduct;
- this.productList0 = JSON.parse(JSON.stringify(this.productList));
- // this.$refs.sampleTable.setCurrentRow(row)
- // setTimeout(() => {
- // this.productList.forEach(a => {
- // if (a.state == 1) this.toggleSelection(a)
- // })
- // }, 200)
- this.$nextTick(() => {
- this.methodCount++;
- this.getProductLoad = false;
- if (this.sampleSelectionList.length == this.methodCount) {
- this.standardLoading = false;
- }
- });
+ if (res.code === 200) {
+ res.data.forEach((a) => {
+ a.state = 0;
+ });
+ row.insProduct = this.HaveJson(res.data);
+ this.productList = row.insProduct;
+ this.productList0 = JSON.parse(JSON.stringify(this.productList));
+ // this.$refs.sampleTable.setCurrentRow(row)
+ // setTimeout(() => {
+ // this.productList.forEach(a => {
+ // if (a.state == 1) this.toggleSelection(a)
+ // })
+ // }, 200)
+ this.$nextTick(() => {
+ this.methodCount++;
+ this.getProductLoad = false;
+ if (this.sampleSelectionList.length == this.methodCount) {
+ this.standardLoading = false;
+ }
+ });
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
this.searchProject();
this.searchTemList();
},
searchTemList() {
this.temperatureList = [];
- this.$axios
- .post(this.$api.enums.selectEnumByCategory, {
- category: "鐢靛姏娓╁害寰幆妫�楠�",
- })
+ getDicts("temperature_cycling_type")
.then((res) => {
- if (res.data.length > 0) {
+ if (res.code === 200) {
this.temperatureEngList = res.data;
res.data.forEach((item) => {
- this.temperatureList.push(item.label);
+ this.temperatureList.push(item.dictLabel);
});
}
+ })
+ .catch((error) => {
+ console.error(error);
});
},
changeModel() {
@@ -3286,10 +4422,14 @@
// })
},
selectStandardMethods() {
- this.$axios
- .get(this.$api.standardTree.selectStandardMethodEnum)
+ selectStandardMethodEnum()
.then((res) => {
- this.methods = res.data;
+ if (res.code === 200) {
+ this.methods = res.data;
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
selectable() {
@@ -3471,42 +4611,39 @@
return;
}
this.noLoading = true;
- this.$axios
- .post(
- this.$api.insOrder.upInsOrderOfState,
- {
- state: 2,
- id: this.currentId,
- tell: this.tell,
- },
- {
- headers: {
- "Content-Type": "application/json",
- },
- }
- )
+ upInsOrderOfState({
+ state: 2,
+ id: this.currentId,
+ tell: this.tell,
+ })
.then((res) => {
- this.noLoading = false;
- this.tell = "";
- if (res.code == 201) return;
- this.$message.success("鎻愪氦鎴愬姛");
- this.issuedDialogVisible = false;
- this.$parent.playOrder(0);
+ if (res.code === 200) {
+ this.noLoading = false;
+ this.tell = "";
+ this.$message.success("鎻愪氦鎴愬姛");
+ this.issuedDialogVisible = false;
+ this.$router.go(-1);
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
selectEnumByCategoryForSonLaboratory() {
- this.$axios
- .post(this.$api.enums.selectEnumByCategory, {
- category: "瀛愬疄楠屽",
- })
+ getDicts("sys_sub_lab")
.then((res) => {
- this.factory = [];
- res.data.forEach((a) => {
- this.filters.push({
- text: a.label,
- value: a.value,
+ if (res.code === 200) {
+ this.factory = [];
+ res.data.forEach((a) => {
+ this.filters.push({
+ text: a.dictLabel,
+ value: a.dictValue,
+ });
});
- });
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
filterHandler(value, row, column) {
@@ -3526,24 +4663,28 @@
return;
}
this.sampleIds = [this.sampleId];
- this.$axios
- .post(this.$api.insBushing.selectBushingBySampleId, {
- sampleId: this.sampleId,
- })
+ selectBushingBySampleId({
+ sampleId: this.sampleId,
+ })
.then((res) => {
- if (res.data.length === 0) {
- this.$message.error("璇ユ牱鍝佹病鏈夐厤缃厜绾�");
- return;
- }
- for (var i in this.sampleList) {
- if ((this.sampleList[i].id = this.sampleId)) {
- this.sampleList[i].bushing = res.data;
- break;
+ if (res.code === 200) {
+ if (res.data.length === 0) {
+ this.$message.error("璇ユ牱鍝佹病鏈夐厤缃厜绾�");
+ return;
}
+ for (var i in this.sampleList) {
+ if ((this.sampleList[i].id = this.sampleId)) {
+ this.sampleList[i].bushing = res.data;
+ break;
+ }
+ }
+ this.$nextTick(() => {
+ this.configShow = true;
+ });
}
- this.$nextTick(() => {
- this.configShow = true;
- });
+ })
+ .catch((error) => {
+ console.error(error);
});
}
},
@@ -3559,21 +4700,6 @@
this.$message.error("鏈�変腑鏍峰搧");
return;
}
- // this.$axios.post(this.$api.insBushing.selectBushingBySampleId, {
- // sampleId: this.sampleId
- // }).then(res => {
- // if (res.data.length === 0) {
- // this.$message.error('璇ユ牱鍝佹病鏈夐厤缃厜绾�')
- // return
- // }
- // for (var i in this.sampleList) {
- // if (this.sampleList[i].id = this.sampleId) {
- // this.sampleList[i].bushing = res.data
- // break
- // }
- // }
- // this.configShow = true
- // })
}
},
openCableConfig() {
@@ -3588,21 +4714,6 @@
this.$message.error("鏈�変腑鏍峰搧");
return;
}
- // this.$axios.post(this.$api.insBushing.selectBushingBySampleId, {
- // sampleId: this.sampleId
- // }).then(res => {
- // if (res.data.length === 0) {
- // this.$message.error('璇ユ牱鍝佹病鏈夐厤缃厜绾�')
- // return
- // }
- // for (var i in this.sampleList) {
- // if (this.sampleList[i].id = this.sampleId) {
- // this.sampleList[i].bushing = res.data
- // break
- // }
- // }
- // this.configShow = true
- // })
}
},
upBsm1(val) {
@@ -4032,7 +5143,10 @@
border-radius: 2px;
}
-.ins_order_add .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
+.ins_order_add
+ .el-tree--highlight-current
+ .el-tree-node.is-current
+ > .el-tree-node__content {
color: #3a7bfa;
}
@@ -4063,13 +5177,13 @@
.company_input .el-form-item__content,
.sample_input .el-form-item__content {
- width: 72%;
+ width: 70%;
}
.engineeringEn_input .el-form-item__content,
.otcCode_input .el-form-item__content,
.productionEn_input .el-form-item__content {
- width: 65%;
+ width: 63%;
}
.processing_input .el-form-item__content {
diff --git a/src/views/business/inspectionOrder/index.vue b/src/views/business/inspectionOrder/index.vue
index 56b36ab..01efcc4 100644
--- a/src/views/business/inspectionOrder/index.vue
+++ b/src/views/business/inspectionOrder/index.vue
@@ -4,11 +4,23 @@
<el-row class="title">
<el-col :span="12" style="text-align: left">妫�楠屼笅鍗�</el-col>
<el-col :span="12" style="text-align: right">
- <el-button size="medium" type="primary" @click="dialogVisible1 = true"
- :loading="exportCheckedLoading">瀵煎嚭妫�楠岀粨鏋�</el-button>
- <el-button size="medium" type="primary" @click="print">鏍囩鎵撳嵃</el-button>
- <el-button size="medium" type="primary" @click="playOrder(1)"
- v-hasPermi="['business:order:add']">涓嬪崟</el-button>
+ <el-button
+ size="medium"
+ type="primary"
+ @click="dialogVisible1 = true"
+ :loading="exportCheckedLoading"
+ >瀵煎嚭妫�楠岀粨鏋�</el-button
+ >
+ <el-button size="medium" type="primary" @click="print"
+ >鏍囩鎵撳嵃</el-button
+ >
+ <el-button
+ size="medium"
+ type="primary"
+ @click="playOrder(1)"
+ v-hasPermi="['business:order:add']"
+ >涓嬪崟</el-button
+ >
</el-col>
</el-row>
</div>
@@ -19,8 +31,13 @@
<div class="search_thing" style="width: 20%">
<div class="search_label">濮旀墭缂栧彿锛�</div>
<div class="search_input">
- <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.entrustCode"
- @keyup.enter.native="refreshTable()"></el-input>
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="queryParams.entrustCode"
+ @keyup.enter.native="refreshTable()"
+ ></el-input>
</div>
</div>
<div class="search_thing" style="width: 20%">
@@ -28,68 +45,119 @@
澶栭儴濮旀墭缂栧彿锛�
</div>
<div class="search_input">
- <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.outEntrustCode"
- @keyup.enter.native="refreshTable()"></el-input>
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="queryParams.outEntrustCode"
+ @keyup.enter.native="refreshTable()"
+ ></el-input>
</div>
</div>
<div class="search_thing" style="width: 20%">
<div class="search_label">鏍峰搧鍚嶇О锛�</div>
<div class="search_input">
- <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.sampleName"
- @keyup.enter.native="refreshTable()"></el-input>
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="queryParams.sampleName"
+ @keyup.enter.native="refreshTable()"
+ ></el-input>
</div>
</div>
<div class="search_thing" style="width: 20%">
<div class="search_label">鏍峰搧鍨嬪彿锛�</div>
<div class="search_input">
- <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.sampleModel"
- @keyup.enter.native="refreshTable()"></el-input>
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="queryParams.sampleModel"
+ @keyup.enter.native="refreshTable()"
+ ></el-input>
</div>
</div>
<div class="search_thing" style="width: 20%">
<div class="search_label">鏍峰搧缂栧彿锛�</div>
<div class="search_input">
- <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.sampleCode"
- @keyup.enter.native="refreshTable()"></el-input>
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="queryParams.sampleCode"
+ @keyup.enter.native="refreshTable()"
+ ></el-input>
</div>
</div>
<div class="search_thing" style="width: 40%" v-if="more">
<div class="search_label">涓嬪崟鏃堕棿锛�</div>
<div class="search_input">
- <el-date-picker style="width: 100%" v-model="queryParams.startAndEndTime" type="daterange" size="small"
- range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡" value-format="yyyy-MM-dd"
- clearable placeholder="閫夋嫨鏃ユ湡">
+ <el-date-picker
+ style="width: 100%"
+ v-model="queryParams.startAndEndTime"
+ type="daterange"
+ size="small"
+ range-separator="鑷�"
+ start-placeholder="寮�濮嬫棩鏈�"
+ end-placeholder="缁撴潫鏃ユ湡"
+ value-format="yyyy-MM-dd"
+ clearable
+ placeholder="閫夋嫨鏃ユ湡"
+ >
</el-date-picker>
</div>
</div>
<div class="search_thing" style="width: 20%" v-if="more">
<div class="search_label">涓嬪崟浜猴細</div>
<div class="search_input">
- <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.name"
- @keyup.enter.native="refreshTable()"></el-input>
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="queryParams.name"
+ @keyup.enter.native="refreshTable()"
+ ></el-input>
</div>
</div>
<div class="search_thing" style="width: 20%" v-if="more">
<div class="search_label">宸ョ▼鍚嶇О锛�</div>
<div class="search_input">
- <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.engineering"
- @keyup.enter.native="refreshTable()"></el-input>
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="queryParams.engineering"
+ @keyup.enter.native="refreshTable()"
+ ></el-input>
</div>
</div>
<div class="search_thing" style="width: 20%" v-if="more">
<div class="search_label">鐢熶骇鍗曚綅锛�</div>
<div class="search_input">
- <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.production"
- @keyup.enter.native="refreshTable()"></el-input>
+ <el-input
+ size="small"
+ placeholder="璇疯緭鍏�"
+ clearable
+ v-model="queryParams.production"
+ @keyup.enter.native="refreshTable()"
+ ></el-input>
</div>
</div>
</el-col>
<el-col :span="4">
<div class="search_thing">
- <el-button type="text" :icon="!more ? 'el-icon-arrow-down' : 'el-icon-arrow-up'" style="color: #3a7bfa"
- @click="more = !more">{{ !more ? "鏇村" : "鏀惰捣" }}</el-button>
+ <el-button
+ type="text"
+ :icon="!more ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"
+ style="color: #3a7bfa"
+ @click="more = !more"
+ >{{ !more ? "鏇村" : "鏀惰捣" }}</el-button
+ >
<el-button size="small" @click="refresh()">閲� 缃�</el-button>
- <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
+ <el-button size="small" type="primary" @click="refreshTable()"
+ >鏌� 璇�</el-button
+ >
</div>
</el-col>
</el-row>
@@ -99,59 +167,118 @@
<div v-show="active == 0">
<div class="table">
<ul class="tab">
- <li v-for="(m, i) in tabList" :key="i + 'afgh'" :class="{ active: i == tabIndex }" @click="handleTab(m, i)">
+ <li
+ v-for="(m, i) in tabList"
+ :key="i + 'afgh'"
+ :class="{ active: i == tabIndex }"
+ @click="handleTab(m, i)"
+ >
{{ m.label }}
</li>
</ul>
- <lims-table :tableData="tableData" :height="tableHeight + ''" @pagination="pagination" :column="column"
- :page="page" :tableLoading="tableLoading"></lims-table>
+ <lims-table
+ highlightCurrentRow
+ isSelection
+ :tableData="tableData"
+ :height="tableHeight + ''"
+ @pagination="pagination"
+ :handleSelectionChange="selectionChange"
+ :column="column"
+ :page="page"
+ :tableLoading="tableLoading"
+ ></lims-table>
</div>
<!-- 瀹℃牳 -->
- <el-dialog title="涓嬪崟瀹℃牳" :visible.sync="verifyDialogVisible" width="30%" :before-close="handleClose">
+ <el-dialog
+ title="涓嬪崟瀹℃牳"
+ :visible.sync="verifyDialogVisible"
+ width="30%"
+ :before-close="handleClose"
+ >
<p style="font-size: 16px; color: #333333" v-if="!isPass">
- 濮旀墭缂栧彿<span style="color: #34bd66">ZTMS2023071001</span>鐨勪俊鎭槸鍚﹂�氳繃
+ 濮旀墭缂栧彿<span style="color: #34bd66">ZTMS2023071001</span
+ >鐨勪俊鎭槸鍚﹂�氳繃
</p>
- <el-form :label-position="labelPosition" :model="formData" label-width="150px" ref="ruleForm" v-else>
+ <el-form
+ :label-position="labelPosition"
+ :model="formData"
+ label-width="150px"
+ ref="ruleForm"
+ v-else
+ >
<el-form-item label="璇疯緭鍏ユ牱鍝佸簱浣嶅彿锛�">
- <el-input v-model="formData.specificationModel" size="small" style="width: 60%"></el-input>
+ <el-input
+ v-model="formData.specificationModel"
+ size="small"
+ style="width: 60%"
+ ></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-row v-if="!isPass">
<el-button @click="handleClose">閫� 鍥�</el-button>
- <el-button type="primary" @click="submitForm" :loading="upLoad">閫� 杩�</el-button>
+ <el-button type="primary" @click="submitForm" :loading="upLoad"
+ >閫� 杩�</el-button
+ >
</el-row>
<el-row v-else>
<el-button @click="handleClose">杩� 鍥�</el-button>
- <el-button type="primary" @click="submitForm" :loading="upLoad">纭� 瀹�</el-button>
+ <el-button type="primary" @click="submitForm" :loading="upLoad"
+ >纭� 瀹�</el-button
+ >
</el-row>
</span>
</el-dialog>
<!-- 鎾ら攢 -->
- <el-dialog title="涓嬪崟鎾ら攢" :visible.sync="quashDialogVisible" width="30%" :before-close="handleClose">
+ <el-dialog
+ title="涓嬪崟鎾ら攢"
+ :visible.sync="quashDialogVisible"
+ width="30%"
+ :before-close="handleClose"
+ >
<p style="font-size: 16px; color: #333333" v-if="!isQuash">
濮旀墭缂栧彿<span style="color: #34bd66">{{
this.insOrderRow.entrustCode
- }}</span>鐨勪俊鎭槸鍚︽挙閿�
+ }}</span
+ >鐨勪俊鎭槸鍚︽挙閿�
</p>
- <el-form :label-position="labelPosition" :model="formData" label-width="150px" ref="ruleForm" v-else>
+ <el-form
+ :label-position="labelPosition"
+ :model="formData"
+ label-width="150px"
+ ref="ruleForm"
+ v-else
+ >
<el-form-item label="璇疯緭鍏ユ挙閿�鍘熷洜锛�">
- <el-input v-model="formData.specificationModel" size="small" style="width: 60%"></el-input>
+ <el-input
+ v-model="formData.specificationModel"
+ size="small"
+ style="width: 60%"
+ ></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-row v-if="!isQuash">
<el-button @click="handleClose">鍙� 娑�</el-button>
- <el-button type="primary" @click="submitForm" :loading="upLoad">纭� 瀹�</el-button>
+ <el-button type="primary" @click="submitForm" :loading="upLoad"
+ >纭� 瀹�</el-button
+ >
</el-row>
<el-row v-else>
<el-button @click="handleClose">杩� 鍥�</el-button>
- <el-button type="primary" @click="submitForm" :loading="upLoad">纭� 瀹�</el-button>
+ <el-button type="primary" @click="submitForm" :loading="upLoad"
+ >纭� 瀹�</el-button
+ >
</el-row>
</span>
</el-dialog>
<!-- 涓嬪彂 -->
- <el-dialog title="妫�楠屽垎閰�" :visible.sync="issuedDialogVisible" width="400px" :before-close="handleClose">
+ <el-dialog
+ title="妫�楠屽垎閰�"
+ :visible.sync="issuedDialogVisible"
+ width="400px"
+ :before-close="handleClose"
+ >
<div class="body" style="max-height: 60vh">
<el-row>
<el-col class="search_thing" style="width: 95%">
@@ -159,34 +286,73 @@
<span class="required-span">* </span>绾﹀畾鏃堕棿锛�
</div>
<div class="search_input">
- <el-date-picker size="small" v-model="distributeData.appointed" type="date" placeholder="閫夋嫨鏃ユ湡"
- value-format="yyyy-MM-dd" style="width: 100%" format="yyyy-MM-dd">
+ <el-date-picker
+ size="small"
+ v-model="distributeData.appointed"
+ type="date"
+ placeholder="閫夋嫨鏃ユ湡"
+ value-format="yyyy-MM-dd"
+ style="width: 100%"
+ format="yyyy-MM-dd"
+ >
</el-date-picker>
</div>
</el-col>
<el-col class="search_thing" style="width: 95%">
<div class="search_label">
- <span class="required-span" v-show="distributeData.type == 2">* </span>鎸囨淳浜哄憳锛�
+ <span class="required-span" v-show="distributeData.type == 2"
+ >* </span
+ >鎸囨淳浜哄憳锛�
</div>
<div class="search_input">
- <el-select v-model="distributeData.userId" placeholder="璇烽�夋嫨" size="small" style="width: 100%"
- clearable filterable @change="changeUser">
- <el-option-group v-for="(item, index) in Object.keys(personList)" :key="index" :label="item">
- <el-option v-for="op in personList[item]" :key="op.id" :label="op.name" :value="op.id">
+ <el-select
+ v-model="distributeData.userId"
+ placeholder="璇烽�夋嫨"
+ size="small"
+ style="width: 100%"
+ clearable
+ filterable
+ @change="changeUser"
+ >
+ <el-option-group
+ v-for="(item, index) in Object.keys(personList)"
+ :key="index"
+ :label="item"
+ >
+ <el-option
+ v-for="op in personList[item]"
+ :key="op.id"
+ :label="op.name"
+ :value="op.id"
+ >
</el-option>
</el-option-group>
</el-select>
</div>
</el-col>
- <el-col class="search_thing" style="width: 95%" v-if="distributeData.userId">
+ <el-col
+ class="search_thing"
+ style="width: 95%"
+ v-if="distributeData.userId"
+ >
<div class="search_label">
<span class="required-span">* </span>璇曢獙瀹わ細
</div>
<div class="search_input">
- <el-select v-model="distributeData.sonLaboratory" placeholder="璇烽�夋嫨11" size="small" style="width: 100%"
- clearable filterable>
- <el-option v-for="(item, i) in sonLaboratoryList" :key="i + 'oooo'" :label="item.label"
- :value="item.value">
+ <el-select
+ v-model="distributeData.sonLaboratory"
+ placeholder="璇烽�夋嫨11"
+ size="small"
+ style="width: 100%"
+ clearable
+ filterable
+ >
+ <el-option
+ v-for="(item, i) in sonLaboratoryList"
+ :key="i + 'oooo'"
+ :label="item.label"
+ :value="item.value"
+ >
</el-option>
</el-select>
</div>
@@ -196,18 +362,33 @@
<span slot="footer" class="dialog-footer">
<el-row>
<el-button @click="handleClose2">鍙� 娑�</el-button>
- <el-button type="primary" @click="submitForm2" :loading="upLoad">纭� 瀹�</el-button>
+ <el-button type="primary" @click="submitForm2" :loading="upLoad"
+ >纭� 瀹�</el-button
+ >
</el-row>
</span>
</el-dialog>
- <el-dialog title="鏁版嵁鏌ョ湅" :visible.sync="dataDialogVisible" width="100%" fullscreen>
- <div style="height: 80vh; overflow-y: auto" v-if="dataDialogVisible">
- <ValueTable ref="ValueTableDataLook" :rowKey="'insProductId'"
- :url="$api.insOrder.selectSampleAndProductByOrderId" :componentData="componentDataDataLook" />
- </div>
+ <el-dialog
+ title="鏁版嵁鏌ョ湅"
+ :visible.sync="dataDialogVisible"
+ width="100%"
+ fullscreen
+ >
+ <lims-table
+ highlightCurrentRow
+ :heigt="'80vh'"
+ :tableData="dataLooktableData"
+ :column="dataLookcolumn"
+ :tableLoading="dataLookTableLoading"
+ ></lims-table>
</el-dialog>
- <el-dialog top="5vh" :title="deleteTilte" :visible.sync="deleteDialogVisible" :before-close="handleCloseDelete"
- width="80%">
+ <el-dialog
+ top="5vh"
+ :title="deleteTilte"
+ :visible.sync="deleteDialogVisible"
+ :before-close="handleCloseDelete"
+ width="80%"
+ >
<div class="table-container" v-if="deleteDialogVisible">
<!-- <ValueTable
ref="ValueTableDataDelete"
@@ -221,23 +402,57 @@
:componentData="componentDataDelete"
:isColumnWidth="true"
/> -->
- <el-table height="500px" ref="revokeTable" @select="handleSelectionChange" @select-all="handleSelectionAll"
- :data="treeTableData" style="width: 100%" row-key="id" border lazy :load="load"
- :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
- <el-table-column v-if="deleteTilte == '鎾ら攢'" type="selection" width="55"></el-table-column>
- <el-table-column prop="sampleCode" label="鏍峰搧缂栧彿" show-overflow-tooltip>
+ <el-table
+ height="500px"
+ ref="revokeTable"
+ @select="handleSelectionChange"
+ @select-all="handleSelectionAll"
+ :data="treeTableData"
+ style="width: 100%"
+ row-key="id"
+ border
+ lazy
+ :load="load"
+ :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
+ >
+ <el-table-column
+ v-if="deleteTilte == '鎾ら攢'"
+ type="selection"
+ width="55"
+ ></el-table-column>
+ <el-table-column
+ prop="sampleCode"
+ label="鏍峰搧缂栧彿"
+ show-overflow-tooltip
+ >
</el-table-column>
- <el-table-column prop="inspectionItem" label="妫�楠岄」" show-overflow-tooltip>
+ <el-table-column
+ prop="inspectionItem"
+ label="妫�楠岄」"
+ show-overflow-tooltip
+ >
</el-table-column>
- <el-table-column prop="inspectionItemSubclass" label="妫�楠屽瓙椤�" show-overflow-tooltip>
+ <el-table-column
+ prop="inspectionItemSubclass"
+ label="妫�楠屽瓙椤�"
+ show-overflow-tooltip
+ >
</el-table-column>
- <el-table-column prop="sampleType" label="鏍峰搧鍒嗙被" show-overflow-tooltip>
+ <el-table-column
+ prop="sampleType"
+ label="鏍峰搧鍒嗙被"
+ show-overflow-tooltip
+ >
</el-table-column>
<el-table-column prop="sample" label="鏍峰搧" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="model" label="鍨嬪彿" show-overflow-tooltip>
</el-table-column>
- <el-table-column prop="sonLaboratory" label="璇曢獙瀹�" show-overflow-tooltip>
+ <el-table-column
+ prop="sonLaboratory"
+ label="璇曢獙瀹�"
+ show-overflow-tooltip
+ >
</el-table-column>
<el-table-column prop="tell" label="瑕佹眰鍊�" show-overflow-tooltip>
</el-table-column>
@@ -248,46 +463,117 @@
<el-button @click="handleNo">{{
deleteTilte == "鎾ら攢" ? "鍙� 娑�" : "涓嶉�氳繃"
}}</el-button>
- <el-button type="primary" @click="submitDelete" :loading="printLoading">{{ deleteTilte == "鎾ら攢" ? "纭� 瀹�" :
- "閫� 杩�" }}</el-button>
+ <el-button
+ type="primary"
+ @click="submitDelete"
+ :loading="printLoading"
+ >{{ deleteTilte == "鎾ら攢" ? "纭� 瀹�" : "閫� 杩�" }}</el-button
+ >
</el-row>
</span>
</el-dialog>
<!-- 鏁版嵁鏌ョ湅璇︽儏 -->
- <el-dialog title="鏌ョ湅璇︽儏" :visible.sync="dialogVisible" width="70%" :before-close="handleClose3">
- <el-table v-if="type == '鍗曟牴鍨傜洿鐕冪儳' || type == '鏉惧绠�'" :data="viewDetailsList" height="400px" border
- style="width: 100%">
- <el-table-column type="index" label="搴忓彿" width="80px"></el-table-column>
- <el-table-column prop="entrustCode" label="濮旀墭鍗曞彿"></el-table-column>
- <el-table-column prop="sampleCode" label="鏍峰搧缂栧彿"></el-table-column>
+ <el-dialog
+ title="鏌ョ湅璇︽儏"
+ :visible.sync="dialogVisible"
+ width="70%"
+ :before-close="handleClose3"
+ >
+ <el-table
+ v-if="type == '鍗曟牴鍨傜洿鐕冪儳' || type == '鏉惧绠�'"
+ :data="viewDetailsList"
+ height="400px"
+ border
+ style="width: 100%"
+ >
+ <el-table-column
+ type="index"
+ label="搴忓彿"
+ width="80px"
+ ></el-table-column>
+ <el-table-column
+ prop="entrustCode"
+ label="濮旀墭鍗曞彿"
+ ></el-table-column>
+ <el-table-column
+ prop="sampleCode"
+ label="鏍峰搧缂栧彿"
+ ></el-table-column>
<el-table-column prop="color" label="濂楃"></el-table-column>
<!-- <el-table-column prop="inspectionItem" label="妫�楠岄」"></el-table-column> -->
<el-table-column prop="insValue" label="妫�楠岀粨鏋�"></el-table-column>
</el-table>
- <el-table v-if="type == '鎶楁媺寮哄害'" :data="viewDetailsList" height="400px" border style="width: 100%">
- <el-table-column type="index" label="搴忓彿" width="80px"></el-table-column>
- <el-table-column prop="inspectionItem" label="妫�楠岄」"></el-table-column>
- <el-table-column prop="inspectionItemSubclass" label="妫�楠屽瓙椤�"></el-table-column>
+ <el-table
+ v-if="type == '鎶楁媺寮哄害'"
+ :data="viewDetailsList"
+ height="400px"
+ border
+ style="width: 100%"
+ >
+ <el-table-column
+ type="index"
+ label="搴忓彿"
+ width="80px"
+ ></el-table-column>
+ <el-table-column
+ prop="inspectionItem"
+ label="妫�楠岄」"
+ ></el-table-column>
+ <el-table-column
+ prop="inspectionItemSubclass"
+ label="妫�楠屽瓙椤�"
+ ></el-table-column>
<el-table-column prop="width" label="瀹藉害"></el-table-column>
<el-table-column prop="thickness" label="鍘氬害"></el-table-column>
<el-table-column prop="testValue" label="妫�楠屽��"></el-table-column>
</el-table>
- <el-table v-if="type == '鏂浼搁暱鐜�'" :data="viewDetailsList" height="400px" border style="width: 100%">
- <el-table-column type="index" label="搴忓彿" width="80px"></el-table-column>
- <el-table-column prop="inspectionItem" label="妫�楠岄」"></el-table-column>
- <el-table-column prop="inspectionItemSubclass" label="妫�楠屽瓙椤�"></el-table-column>
- <el-table-column v-for="(v, i) in tableHeader" :key="i" :prop="`testValue${i}`"
- :label="`妫�楠屽��${i + 1}`"></el-table-column>
+ <el-table
+ v-if="type == '鏂浼搁暱鐜�'"
+ :data="viewDetailsList"
+ height="400px"
+ border
+ style="width: 100%"
+ >
+ <el-table-column
+ type="index"
+ label="搴忓彿"
+ width="80px"
+ ></el-table-column>
+ <el-table-column
+ prop="inspectionItem"
+ label="妫�楠岄」"
+ ></el-table-column>
+ <el-table-column
+ prop="inspectionItemSubclass"
+ label="妫�楠屽瓙椤�"
+ ></el-table-column>
+ <el-table-column
+ v-for="(v, i) in tableHeader"
+ :key="i"
+ :prop="`testValue${i}`"
+ :label="`妫�楠屽��${i + 1}`"
+ ></el-table-column>
</el-table>
</el-dialog>
-
<!-- 瀵煎嚭宸叉鏁版嵁 -->
- <el-dialog title="閫夋嫨鏃ユ湡" :visible.sync="dialogVisible1" width="30%" :before-close="handleClose4">
+ <el-dialog
+ title="閫夋嫨鏃ユ湡"
+ :visible.sync="dialogVisible1"
+ width="30%"
+ :before-close="handleClose4"
+ >
<span>涓嬪崟鏃ユ湡: </span>
- <el-date-picker v-model="exportCheckedDate" type="daterange" size="small" value-format="yyyy-MM-dd"
- range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡">
+ <el-date-picker
+ v-model="exportCheckedDate"
+ type="daterange"
+ size="small"
+ value-format="yyyy-MM-dd"
+ range-separator="鑷�"
+ start-placeholder="寮�濮嬫棩鏈�"
+ end-placeholder="缁撴潫鏃ユ湡"
+ >
</el-date-picker>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose4">鍙� 娑�</el-button>
@@ -295,18 +581,48 @@
</span>
</el-dialog>
</div>
- <div style="width: 100%; height: 100%" v-if="active > 0">
- <Add :active="active" :currentId="currentId" v-if="active < 4" :examine="examine" />
- </div>
- <el-dialog title="鏍囩鎵撳嵃" :visible.sync="printDialogVisible" width="40%" top="5vh">
- <div style="width: 100%; height: 400px; overflow-y: auto" v-loading="loadPint">
+ <!-- <div style="width: 100%; height: 100%" v-if="active > 0">
+ <Add
+ :active="active"
+ :currentId="currentId"
+ v-if="active < 4"
+ :examine="examine"
+ />
+ </div> -->
+ <el-dialog
+ title="鏍囩鎵撳嵃"
+ :visible.sync="printDialogVisible"
+ width="40%"
+ top="5vh"
+ >
+ <div
+ style="width: 100%; height: 400px; overflow-y: auto"
+ v-loading="loadPint"
+ >
<div class="dia_body">
- <el-checkbox style="margin: 10px 5px" :indeterminate="isIndeterminate" v-model="checkAll"
- @change="handleCheckAllChange">鍏ㄩ��</el-checkbox>
- <el-checkbox-group @change="changePrintCode()" v-model="checkIndexList">
- <el-card class="box-card" v-for="(item, i) in qrData" :key="i + 'wwwww'"
- style="margin-bottom: 15px; font-size: 16px !important">
- <el-checkbox :label="i" :key="i" style="position: relative; top: -20px; left: 5px"><br /></el-checkbox>
+ <el-checkbox
+ style="margin: 10px 5px"
+ :indeterminate="isIndeterminate"
+ v-model="checkAll"
+ @change="handleCheckAllChange"
+ >鍏ㄩ��</el-checkbox
+ >
+ <el-checkbox-group
+ @change="changePrintCode()"
+ v-model="checkIndexList"
+ >
+ <el-card
+ class="box-card"
+ v-for="(item, i) in qrData"
+ :key="i + 'wwwww'"
+ style="margin-bottom: 15px; font-size: 16px !important"
+ >
+ <el-checkbox
+ :label="i"
+ :key="i"
+ style="position: relative; top: -10px; left: 5px"
+ ><br
+ /></el-checkbox>
<div>
<el-row style="font-size: 14px; padding-left: 20px">
<el-col style="font-weight: bold">{{ item.pName }}</el-col>
@@ -314,48 +630,89 @@
<div style="display: flex">
<div>
<el-col :span="8" :offset="4">
- <vueQr :text="'https://zttx-lims.ztt.cn:8021/lims/qr/qrScan?code=' +
- item.id +
- '&type=sample'
- " :size="140" :margin="2"></vueQr>
+ <vueQr
+ :text="
+ 'https://zttx-lims.ztt.cn:8021/lims/qr/qrScan?code=' +
+ item.id +
+ '&type=sample'
+ "
+ :size="140"
+ :margin="2"
+ ></vueQr>
</el-col>
</div>
<div style="margin-left: 50px; width: 100%">
<el-row>
- <el-col style="
+ <el-col
+ style="
font-weight: bold;
text-align: left;
font-size: 14px;
- "><span>鏍峰搧缂栧彿: </span>{{ item.sampleCode }}</el-col>
+ "
+ ><span>鏍峰搧缂栧彿: </span
+ >{{ item.sampleCode }}</el-col
+ >
</el-row>
<el-row style="margin-top: 1px; font-size: 14px">
- <el-col style="font-weight: bold; text-align: left"><span>濮旀墭鍗曞彿: </span>{{ item.code
- }}</el-col>
+ <el-col style="font-weight: bold; text-align: left"
+ ><span>濮旀墭鍗曞彿: </span>{{ item.code }}</el-col
+ >
</el-row>
<el-row style="margin-top: 1px; font-size: 14px">
- <el-col style="font-weight: bold; text-align: left"><span>瑙勬牸鍨嬪彿: </span>{{ item.model
- }}</el-col>
+ <el-col style="font-weight: bold; text-align: left"
+ ><span>瑙勬牸鍨嬪彿: </span>{{ item.model }}</el-col
+ >
</el-row>
<el-row style="margin-top: 1px; font-size: 14px">
- <el-col style="font-weight: bold; text-align: left"><span>鏍峰搧鍚嶇О: </span>{{ item.sample
- }}</el-col>
+ <el-col style="font-weight: bold; text-align: left"
+ ><span>鏍峰搧鍚嶇О: </span
+ >{{ item.sample }}</el-col
+ >
</el-row>
- <el-row style="margin-top: 1px; font-size: 14px" class="ellipsis-multiline">
- <el-col style="font-weight: bold; text-align: left"><span>妫�娴嬮」鐩�: </span>{{ item.item
- }}</el-col>
+ <el-row
+ style="margin-top: 1px; font-size: 14px"
+ class="ellipsis-multiline"
+ >
+ <el-col style="font-weight: bold; text-align: left"
+ ><span>妫�娴嬮」鐩�: </span>{{ item.item }}</el-col
+ >
</el-row>
<el-row style="margin-top: 2px; font-size: 14px">
- <el-col style="
+ <el-col
+ style="
font-weight: bold;
display: flex;
align-items: center;
- "><span>鏍峰搧鐘舵��: </span><el-radio-group :value="item.insState"
- style="margin-top: 7px; margin-left: 4px" disabled>
- <el-radio :label="0" style="font-weight: bold; margin-right: 7px">寰呮</el-radio>
- <el-radio :label="1" style="font-weight: bold; margin-right: 7px">鍦ㄦ</el-radio>
- <el-radio :label="2" style="font-weight: bold; margin-right: 7px">宸叉</el-radio>
- </el-radio-group><el-radio :label="1" style="font-weight: bold; margin-top: 7px"
- v-model="item.isLeave" disabled>鐣欐牱</el-radio></el-col>
+ "
+ ><span>鏍峰搧鐘舵��: </span
+ ><el-radio-group
+ :value="item.insState"
+ style="margin-top: 7px; margin-left: 4px"
+ disabled
+ >
+ <el-radio
+ :label="0"
+ style="font-weight: bold; margin-right: 7px"
+ >寰呮</el-radio
+ >
+ <el-radio
+ :label="1"
+ style="font-weight: bold; margin-right: 7px"
+ >鍦ㄦ</el-radio
+ >
+ <el-radio
+ :label="2"
+ style="font-weight: bold; margin-right: 7px"
+ >宸叉</el-radio
+ > </el-radio-group
+ ><el-radio
+ :label="1"
+ style="font-weight: bold; margin-top: 7px"
+ v-model="item.isLeave"
+ disabled
+ >鐣欐牱</el-radio
+ ></el-col
+ >
</el-row>
</div>
</div>
@@ -367,40 +724,61 @@
<span slot="footer" class="dialog-footer">
<el-row>
<el-button @click="printDialogVisible = false">鍙� 娑�</el-button>
- <el-button type="primary" @click="submitPrint" :loading="printLoading">鎵� 鍗�</el-button>
+ <el-button
+ type="primary"
+ @click="submitPrint"
+ :loading="printLoading"
+ >鎵� 鍗�</el-button
+ >
</el-row>
</span>
</el-dialog>
- <div class="el-dialog__body" style="
+ <div
+ class="el-dialog__body"
+ style="
overflow-y: auto;
margin-top: 0;
position: fixed;
top: 999px;
z-index: 99999;
display: none;
- ">
+ "
+ >
<div id="printMOrder" class="printMOrder" ref="printMOrder">
- <el-card class="box-card" v-for="(item, i) in checkDataList" :key="i + 'uuuuu'" style="
+ <el-card
+ class="box-card"
+ v-for="(item, i) in checkDataList"
+ :key="i + 'uuuuu'"
+ style="
font-size: 0.2cm !important;
page-break-after: always;
color: #000;
box-shadow: none;
margin: 0 !important;
padding: 0 !important;
- ">
+ "
+ >
<div style="display: flex">
<div>
<el-col :span="10" :offset="2">
- <vueQr :text="'https://zttx-lims.ztt.cn:8021/lims/qr/qrScan?code=' +
- item.id +
- '&type=sample'
- " :size="60" :margin="2"></vueQr>
+ <vueQr
+ :text="
+ 'https://zttx-lims.ztt.cn:8021/lims/qr/qrScan?code=' +
+ item.id +
+ '&type=sample'
+ "
+ :size="60"
+ :margin="2"
+ ></vueQr>
</el-col>
</div>
<div style="margin-left: 0.32cm; line-height: 0.22cm">
<el-row>
- <el-col style="font-size: 0.2cm; width: 4cm" class="single-line-ellipsis"><span>鏍峰搧缂栧彿: </span>{{
- item.sampleCode }}</el-col>
+ <el-col
+ style="font-size: 0.2cm; width: 4cm"
+ class="single-line-ellipsis"
+ ><span>鏍峰搧缂栧彿: </span>{{ item.sampleCode }}</el-col
+ >
</el-row>
<el-row style="font-size: 0.2cm">
<el-col><span>濮旀墭鍗曞彿: </span>{{ item.code }}</el-col>
@@ -409,19 +787,29 @@
<el-col><span>瑙勬牸鍨嬪彿: </span>{{ item.model }}</el-col>
</el-row>
<el-row style="font-size: 0.2cm">
- <el-col><span>鏍峰搧鍚嶇О: </span>{{ item.sample }}</el-col>
+ <el-col
+ ><span>鏍峰搧鍚嶇О: </span>{{ item.sample }}</el-col
+ >
</el-row>
<el-row style="font-size: 0.2cm; width: 4cm">
- <el-col class="ellipsis-multiline"><span>妫�娴嬮」鐩�: </span>{{ item.item }}</el-col>
+ <el-col class="ellipsis-multiline"
+ ><span>妫�娴嬮」鐩�: </span>{{ item.item }}</el-col
+ >
</el-row>
<el-row style="margin-top: 0.01cm; font-size: 0.2cm">
- <el-col style="display: flex; align-items: center"><span>鏍峰搧鐘舵��: </span>
- <span style="white-space: nowrap"><span v-if="item.insState == 0">鈭�</span><span class="scor"
- v-if="item.insState != 0"></span>寰呮
- <span v-if="item.insState == 1">鈭�</span><span class="scor" v-if="item.insState != 1"></span>鍦ㄦ
- <span v-if="item.insState == 2">鈭�</span><span class="scor" v-if="item.insState != 2"></span>宸叉
- <span v-if="item.isLeave == 1">鈭�</span><span class="scor"
- v-if="item.isLeave != 1"></span>鐣欐牱</span>
+ <el-col style="display: flex; align-items: center"
+ ><span>鏍峰搧鐘舵��: </span>
+ <span style="white-space: nowrap"
+ ><span v-if="item.insState == 0">鈭�</span
+ ><span class="scor" v-if="item.insState != 0"></span>寰呮
+ <span v-if="item.insState == 1">鈭�</span
+ ><span class="scor" v-if="item.insState != 1"></span>鍦ㄦ
+ <span v-if="item.insState == 2">鈭�</span
+ ><span class="scor" v-if="item.insState != 2"></span>宸叉
+ <span v-if="item.isLeave == 1">鈭�</span
+ ><span class="scor" v-if="item.isLeave != 1"></span
+ >鐣欐牱</span
+ >
</el-col>
</el-row>
</div>
@@ -437,6 +825,9 @@
import limsTable from "@/components/Table/lims-table.vue";
import {
selectInsOrderParameter,
+ labelPrinting,
+ exportChecked,
+ selectSampleAndProductByOrderId,
hasSendUrgentOrder,
delCustomById,
upCustom,
@@ -446,11 +837,13 @@
import getLodop from "@/utils/lodop";
import Add from "./add.vue";
import { mapGetters } from "vuex";
+import LimsTable from "@/components/Table/lims-table.vue";
export default {
components: {
limsTable,
Add,
vueQr,
+ LimsTable,
},
computed: {
...mapGetters(["permissions"]),
@@ -499,6 +892,11 @@
prop: "sampleName",
minWidth: "160px",
width: "160px",
+ dataType: "link",
+ linkEvent: {
+ method: "showDetails",
+ vueComponent: this,
+ },
},
{
label: "鏍峰搧缂栧彿",
@@ -607,36 +1005,215 @@
{
name: "鏁版嵁鏌ョ湅",
type: "text",
- clickFun: (row) => { },
+ clickFun: (row) => {},
+ disabled: (row) => {
+ return row.state != 1 && row.state != 4;
+ },
+ clickFun: (row) => {
+ this.handleDataLook(row);
+ },
},
{
name: "鎶ュ憡涓嬭浇",
type: "text",
- clickFun: (row) => { },
+ clickFun: (row) => {},
+ disabled: (row, index) => {
+ return row.state != 4 || row.isRatify != 1;
+ },
},
{
name: "瀹℃牳",
type: "text",
- clickFun: (row) => { },
+ clickFun: (row) => {},
+ disabled: (row, index) => {
+ return row.state != 0;
+ },
},
{
name: "鎾ら攢",
type: "text",
- clickFun: (row) => { },
+ clickFun: (row) => {},
+ disabled: (row, index) => {
+ return row.state != 1 && row.state != 0;
+ },
},
{
name: "鎾ら攢瀹℃牳",
type: "text",
- clickFun: (row) => { },
+ clickFun: (row) => {},
+ disabled: (row, index) => {
+ return (
+ (row.state != 1 && row.state != 0) ||
+ this.tabIndex != 1 ||
+ row.isRevocation != 1
+ );
+ },
},
{
name: "鍒嗛厤",
type: "text",
- clickFun: (row) => { },
+ clickFun: (row) => {},
+ disabled: (row, index) => {
+ return (
+ row.state != 1 ||
+ (row.entrustCode != null &&
+ Number(row.assign) > 0 &&
+ row.inspectId != null)
+ );
+ },
},
],
},
],
+ dataLookTableLoading: false,
+ dataLookcolumn: [
+ {
+ label: "濮旀墭缂栧彿",
+ prop: "entrustCode",
+ minWidth: "160px",
+ width: "160px",
+ },
+ {
+ label: "鏍峰搧缂栧彿",
+ prop: "sampleCode",
+ minWidth: "160px",
+ width: "160px",
+ },
+ {
+ label: "绠″鑹叉爣",
+ prop: "bushColor",
+ minWidth: "160px",
+ width: "160px",
+ },
+ {
+ label: "鍏夌氦甯︾紪鍙�",
+ prop: "code",
+ minWidth: "160px",
+ width: "160px",
+ },
+ {
+ label: "鍏夌氦鑹叉爣",
+ prop: "color",
+ minWidth: "160px",
+ width: "160px",
+ },
+ {
+ label: "妫�楠岄」",
+ prop: "inspectionItem",
+ minWidth: "120px",
+ width: "120px",
+ },
+ {
+ label: "妫�楠屽瓙椤�",
+ prop: "inspectionItemSubclass",
+ minWidth: "120px",
+ width: "120px",
+ },
+ {
+ label: "妫�楠岀粨鏋�",
+ prop: "lastValue",
+ minWidth: "120px",
+ width: "120px",
+ },
+ {
+ label: "缁撴灉鍒ゅ畾",
+ prop: "insResult",
+ minWidth: "100px",
+ width: "100px",
+ dataType: "tag",
+ formatData: (params) => {
+ let index = this.urgencyDictList.findIndex(
+ (item) => item.dictValue == params
+ );
+ if (index > -1) {
+ return this.urgencyDictList[index].dictLabel;
+ } else {
+ return null;
+ }
+ },
+ formatType: (params) => {
+ let index = this.urgencyDictList.findIndex(
+ (item) => item.dictValue == params
+ );
+ if (index > -1) {
+ return this.urgencyDictList[index].listClass;
+ } else {
+ return null;
+ }
+ },
+ },
+ {
+ label: "鍗曚綅",
+ prop: "unit",
+ minWidth: "120px",
+ width: "120px",
+ },
+ {
+ label: "璇曢獙瑕佹眰",
+ prop: "tell",
+ minWidth: "120px",
+ width: "120px",
+ },
+ {
+ label: "妫�楠屼汉",
+ prop: "checkName",
+ minWidth: "120px",
+ width: "120px",
+ },
+ {
+ label: "妫�楠屾棩鏈�",
+ prop: "checkTime",
+ minWidth: "120px",
+ width: "120px",
+ },
+ {
+ label: "鏍峰搧鍚嶇О",
+ prop: "sample",
+ minWidth: "160px",
+ width: "160px",
+ },
+ {
+ label: "鏍峰搧鍨嬪彿",
+ prop: "model",
+ minWidth: "160px",
+ width: "160px",
+ },
+ {
+ label: "璇曢獙瀹�",
+ prop: "sonLaboratory",
+ minWidth: "120px",
+ width: "120px",
+ },
+ {
+ dataType: "action",
+ fixed: "right",
+ label: "鎿嶄綔",
+ operation: [
+ {
+ name: "鏌ョ湅",
+ type: "text",
+ clickFun: (row) => {},
+ showHide: (row) => {
+ console.log(row);
+ console.log(row.inspectionItem);
+ return (
+ row.inspectionItem == "鍗曟牴鍨傜洿鐕冪儳" ||
+ row.inspectionItem.includes("鏉惧绠�") ||
+ row.inspectionItemSubclass.includes("鏉惧绠�") ||
+ (row.inspectionItem == "鎶楁媺寮哄害" &&
+ (row.inspectionItemSubclass == "鐑�佸寲澶勭悊鍓�" ||
+ row.inspectionItemSubclass == "鐑�佸寲澶勭悊鍚�")) ||
+ (row.inspectionItem == "鏂浼搁暱鐜�" &&
+ (row.inspectionItemSubclass == "鐑�佸寲澶勭悊鍓�" ||
+ row.inspectionItemSubclass == "鐑�佸寲澶勭悊鍚�"))
+ );
+ },
+ },
+ ],
+ },
+ ],
+ dataLooktableData: [],
+
//old
tableHeader: [],
type: "",
@@ -678,262 +1255,262 @@
// 浜哄憳鍒楄〃
personList: [],
currentTableData: [],
- componentData: {
- entity: {
- entrustCode: null,
- sample: null,
- sampleName: null,
- sampleModel: null,
- sampleCode: null,
- outEntrustCode: null,
- state: 0,
- name: null,
- engineering: null,
- production: null,
- startAndEndTime: [],
- // orderBy: {
- // field: '',
- // order: ''
- // }
- },
- isIndex: true,
- showSelect: true,
- select: true,
- selectMethod: "selectMethod",
- do: [
- {
- id: "dataLook",
- font: "鏁版嵁鏌ョ湅",
- type: "text",
- method: "handleDataLook",
- disabFun: (row, index) => {
- return row.state != 1 && row.state != 4;
- },
- },
- {
- id: "download",
- font: "鎶ュ憡涓嬭浇",
- type: "text",
- method: "download",
- disabFun: (row, index) => {
- return row.state != 4 || row.isRatify != 1;
- },
- },
- {
- id: "verify",
- font: "瀹℃牳",
- type: "text",
- method: "handleVerify",
- disabFun: (row, index) => {
- return row.state != 0;
- },
- },
- {
- id: "quash",
- font: "鎾ら攢",
- type: "text",
- method: "handlEquash",
- disabFun: (row, index) => {
- return row.state != 1 && row.state != 0;
- },
- },
- {
- id: "quashCheck",
- font: "鎾ら攢瀹℃牳",
- type: "text",
- method: "handlEquashCheck",
- disabFun: (row, index) => {
- return (
- (row.state != 1 && row.state != 0) ||
- this.tabIndex != 1 ||
- row.isRevocation != 1
- );
- },
- },
- {
- font: "鍒嗛厤",
- type: "text",
- method: "handleIssued",
- disabFun: (row, index) => {
- return (
- row.state != 1 ||
- (row.entrustCode != null &&
- Number(row.assign) > 0 &&
- row.inspectId != null)
- );
- },
- },
- ],
- linkEvent: {
- sampleName: {
- method: "selectAllByOne",
- },
- },
- tagField: {
- type: {
- select: [],
- },
- createUser: {
- select: [],
- },
- orderType: {
- select: [],
- },
- processing: {
- select: [
- {
- value: 1,
- label: "瀹為獙瀹ゅ鐞�",
- },
- {
- value: 0,
- label: "濮旀墭鍗曚綅鍙栧洖",
- },
- ],
- },
- isLeave: {
- select: [
- {
- value: 1,
- label: "鐣欐牱",
- },
- {
- value: 0,
- label: "涓嶇暀鏍�",
- },
- ],
- },
- send: {
- select: [
- {
- value: 1,
- label: "鑷彇",
- },
- {
- value: 0,
- label: "鍏朵粬",
- },
- ],
- },
- },
- selectField: {},
- requiredAdd: [],
- requiredUp: [],
- needSort: ["createTime", "sendTime", "type", "appointed"],
- },
+ // componentData: {
+ // entity: {
+ // entrustCode: null,
+ // sample: null,
+ // sampleName: null,
+ // sampleModel: null,
+ // sampleCode: null,
+ // outEntrustCode: null,
+ // state: 0,
+ // name: null,
+ // engineering: null,
+ // production: null,
+ // startAndEndTime: [],
+ // // orderBy: {
+ // // field: '',
+ // // order: ''
+ // // }
+ // },
+ // isIndex: true,
+ // showSelect: true,
+ // select: true,
+ // selectMethod: "selectMethod",
+ // do: [
+ // {
+ // id: "dataLook",
+ // font: "鏁版嵁鏌ョ湅",
+ // type: "text",
+ // method: "handleDataLook",
+ // disabFun: (row, index) => {
+ // return row.state != 1 && row.state != 4;
+ // },
+ // },
+ // {
+ // id: "download",
+ // font: "鎶ュ憡涓嬭浇",
+ // type: "text",
+ // method: "download",
+ // disabFun: (row, index) => {
+ // return row.state != 4 || row.isRatify != 1;
+ // },
+ // },
+ // {
+ // id: "verify",
+ // font: "瀹℃牳",
+ // type: "text",
+ // method: "handleVerify",
+ // disabFun: (row, index) => {
+ // return row.state != 0;
+ // },
+ // },
+ // {
+ // id: "quash",
+ // font: "鎾ら攢",
+ // type: "text",
+ // method: "handlEquash",
+ // disabFun: (row, index) => {
+ // return row.state != 1 && row.state != 0;
+ // },
+ // },
+ // {
+ // id: "quashCheck",
+ // font: "鎾ら攢瀹℃牳",
+ // type: "text",
+ // method: "handlEquashCheck",
+ // disabFun: (row, index) => {
+ // return (
+ // (row.state != 1 && row.state != 0) ||
+ // this.tabIndex != 1 ||
+ // row.isRevocation != 1
+ // );
+ // },
+ // },
+ // {
+ // font: "鍒嗛厤",
+ // type: "text",
+ // method: "handleIssued",
+ // disabFun: (row, index) => {
+ // return (
+ // row.state != 1 ||
+ // (row.entrustCode != null &&
+ // Number(row.assign) > 0 &&
+ // row.inspectId != null)
+ // );
+ // },
+ // },
+ // ],
+ // linkEvent: {
+ // sampleName: {
+ // method: "selectAllByOne",
+ // },
+ // },
+ // tagField: {
+ // type: {
+ // select: [],
+ // },
+ // createUser: {
+ // select: [],
+ // },
+ // orderType: {
+ // select: [],
+ // },
+ // processing: {
+ // select: [
+ // {
+ // value: 1,
+ // label: "瀹為獙瀹ゅ鐞�",
+ // },
+ // {
+ // value: 0,
+ // label: "濮旀墭鍗曚綅鍙栧洖",
+ // },
+ // ],
+ // },
+ // isLeave: {
+ // select: [
+ // {
+ // value: 1,
+ // label: "鐣欐牱",
+ // },
+ // {
+ // value: 0,
+ // label: "涓嶇暀鏍�",
+ // },
+ // ],
+ // },
+ // send: {
+ // select: [
+ // {
+ // value: 1,
+ // label: "鑷彇",
+ // },
+ // {
+ // value: 0,
+ // label: "鍏朵粬",
+ // },
+ // ],
+ // },
+ // },
+ // selectField: {},
+ // requiredAdd: [],
+ // requiredUp: [],
+ // needSort: ["createTime", "sendTime", "type", "appointed"],
+ // },
orderId: "",
revocationInsProductIds: "",
- componentDataDataLook: {
- isPage: false,
- entity: {
- id: 0,
- orderBy: {
- field: "sampleCode",
- order: "asc",
- },
- },
- isIndex: false,
- showSelect: false,
- select: false,
- do: [
- {
- id: "",
- font: "鏌ョ湅",
- type: "text",
- method: "viewDetails",
- showFun: (row, index) => {
- return (
- row.inspectionItem == "鍗曟牴鍨傜洿鐕冪儳" ||
- row.inspectionItem.includes("鏉惧绠�") ||
- row.inspectionItemSubclass.includes("鏉惧绠�") ||
- (row.inspectionItem == "鎶楁媺寮哄害" &&
- (row.inspectionItemSubclass == "鐑�佸寲澶勭悊鍓�" ||
- row.inspectionItemSubclass == "鐑�佸寲澶勭悊鍚�")) ||
- (row.inspectionItem == "鏂浼搁暱鐜�" &&
- (row.inspectionItemSubclass == "鐑�佸寲澶勭悊鍓�" ||
- row.inspectionItemSubclass == "鐑�佸寲澶勭悊鍚�"))
- );
- },
- },
- ],
- tagField: {
- insState: {
- select: [],
- },
- insResult: {
- select: [
- {
- value: 1,
- label: "鍚堟牸",
- type: "success",
- },
- {
- value: 0,
- label: "涓嶅悎鏍�",
- type: "danger",
- },
- {
- value: 3,
- label: "涓嶅垽瀹�",
- type: "",
- },
- ],
- },
- },
- selectField: {},
- spanConfig: {
- rows: [
- // {
- // name: "entrustCode",
- // index: 0,
- // },
- // {
- // name: "sampleCode",
- // index: 1,
- // },
- ],
- },
- requiredAdd: [],
- requiredUp: [],
- },
- componentDataDelete: {
- entity: {
- // orderId: '',
- // orderBy: {
- // field: 'sampleCode',
- // order: 'asc'
- // }
- },
- isPage: false,
- isIndex: false,
- showSelect: true,
- select: true,
- selectMethod: "selectDelete",
- do: [],
- tagField: {
- insState: {
- select: [],
- },
- insResult: {
- select: [
- {
- value: 1,
- label: "鍚堟牸",
- type: "success",
- },
- {
- value: 0,
- label: "涓嶅悎鏍�",
- type: "danger",
- },
- ],
- },
- },
- selectField: {},
- spanConfig: {},
- requiredAdd: [],
- requiredUp: [],
- },
+ // componentDataDataLook: {
+ // isPage: false,
+ // entity: {
+ // id: 0,
+ // orderBy: {
+ // field: "sampleCode",
+ // order: "asc",
+ // },
+ // },
+ // isIndex: false,
+ // showSelect: false,
+ // select: false,
+ // do: [
+ // {
+ // id: "",
+ // font: "鏌ョ湅",
+ // type: "text",
+ // method: "viewDetails",
+ // showFun: (row, index) => {
+ // return (
+ // row.inspectionItem == "鍗曟牴鍨傜洿鐕冪儳" ||
+ // row.inspectionItem.includes("鏉惧绠�") ||
+ // row.inspectionItemSubclass.includes("鏉惧绠�") ||
+ // (row.inspectionItem == "鎶楁媺寮哄害" &&
+ // (row.inspectionItemSubclass == "鐑�佸寲澶勭悊鍓�" ||
+ // row.inspectionItemSubclass == "鐑�佸寲澶勭悊鍚�")) ||
+ // (row.inspectionItem == "鏂浼搁暱鐜�" &&
+ // (row.inspectionItemSubclass == "鐑�佸寲澶勭悊鍓�" ||
+ // row.inspectionItemSubclass == "鐑�佸寲澶勭悊鍚�"))
+ // );
+ // },
+ // },
+ // ],
+ // tagField: {
+ // insState: {
+ // select: [],
+ // },
+ // insResult: {
+ // select: [
+ // {
+ // value: 1,
+ // label: "鍚堟牸",
+ // type: "success",
+ // },
+ // {
+ // value: 0,
+ // label: "涓嶅悎鏍�",
+ // type: "danger",
+ // },
+ // {
+ // value: 3,
+ // label: "涓嶅垽瀹�",
+ // type: "",
+ // },
+ // ],
+ // },
+ // },
+ // selectField: {},
+ // spanConfig: {
+ // rows: [
+ // // {
+ // // name: "entrustCode",
+ // // index: 0,
+ // // },
+ // // {
+ // // name: "sampleCode",
+ // // index: 1,
+ // // },
+ // ],
+ // },
+ // requiredAdd: [],
+ // requiredUp: [],
+ // },
+ // componentDataDelete: {
+ // entity: {
+ // // orderId: '',
+ // // orderBy: {
+ // // field: 'sampleCode',
+ // // order: 'asc'
+ // // }
+ // },
+ // isPage: false,
+ // isIndex: false,
+ // showSelect: true,
+ // select: true,
+ // selectMethod: "selectDelete",
+ // do: [],
+ // tagField: {
+ // insState: {
+ // select: [],
+ // },
+ // insResult: {
+ // select: [
+ // {
+ // value: 1,
+ // label: "鍚堟牸",
+ // type: "success",
+ // },
+ // {
+ // value: 0,
+ // label: "涓嶅悎鏍�",
+ // type: "danger",
+ // },
+ // ],
+ // },
+ // },
+ // selectField: {},
+ // spanConfig: {},
+ // requiredAdd: [],
+ // requiredUp: [],
+ // },
deleteDialogVisible: false,
entityCopy: {},
upIndex: 0,
@@ -994,8 +1571,17 @@
more() {
this.getTableHeight();
},
+ printDialogVisible(newVal) {
+ if (!newVal) {
+ this.checkIndexList = [];
+ }
+ },
},
methods: {
+ selectionChange(val) {
+ console.log(val);
+ this.multipleSelection = val;
+ },
//鑾峰彇琛ㄦ牸楂樺害
getTableHeight() {
const otherHeight = this.more ? 430 : 380; // 鍏朵綑楂樺害
@@ -1045,16 +1631,9 @@
startTime: this.exportCheckedDate[0],
endTime: this.exportCheckedDate[1],
};
- console.log("data", data);
this.exportCheckedLoading = true;
this.dialogVisible1 = false;
- this.$axios
- .post(this.$api.insOrder.exportChecked, data, {
- headers: {
- "Content-Type": "application/json",
- },
- responseType: "blob",
- })
+ exportChecked(data)
.then((res) => {
this.$message.success("瀵煎嚭鎴愬姛");
this.exportCheckedDate = [];
@@ -1066,6 +1645,9 @@
link.download = "妫�楠岀粨鏋�.xlsx";
document.body.appendChild(link);
link.click();
+ })
+ .catch((error) => {
+ console.error(error);
});
},
// 鏌ョ湅璇︽儏
@@ -1105,26 +1687,27 @@
}
});
},
- selectMethod(val) {
- this.multipleSelection = val;
- },
getLabelPrinting(selection) {
this.loadPint = true;
- this.$axios
- .post(this.$api.insOrder.labelPrinting, {
- ids: selection.map((m) => m.id).join(","),
- })
+ labelPrinting({
+ ids: selection.map((m) => m.id).join(","),
+ })
.then((res) => {
- let arr = res.data;
- arr.forEach((a) => {
- this.loadPint = false;
- let arr1 = [];
- a.insProduct.forEach((b) => {
- arr1.push(b.inspectionItem);
+ if (res.code === 200) {
+ let arr = res.data;
+ arr.forEach((a) => {
+ this.loadPint = false;
+ let arr1 = [];
+ a.insProduct.forEach((b) => {
+ arr1.push(b.inspectionItem);
+ });
+ a.item = [...new Set(arr1)].join(",");
});
- a.item = [...new Set(arr1)].join(",");
- });
- this.qrData = arr;
+ this.qrData = arr;
+ }
+ })
+ .catch((error) => {
+ console.error(error);
});
},
//寮�濮嬫爣绛炬墦鍗�
@@ -1227,31 +1810,6 @@
this.beginPrint(this.qrData);
});
this.printDialogVisible = false;
-
- // PrintJS({
- // printable: "printMOrder", //椤甸潰
- // type: "html", //鏂囨。绫诲瀷
- // maxWidth: 360,
- // style: `@page {
- // margin:0;
- // size: 400px 75px collapse;
- // margin-top:3px;
- // &:first-of-type{
- // margin-top:0 !important;
- // }
- // }
- // html{
- // zoom:100%;
- // }
- // @media print{
- // width: 400px;
- // height: 75px;
- // margin:0;
- // }`,
- // onPrintDialogClose: (this.erexcel = false),
- // targetStyles: ["*"], // 浣跨敤dom鐨勬墍鏈夋牱寮忥紝寰堥噸瑕�
- // font_size: "0.15cm",
- // });
},
print() {
if (this.multipleSelection.length == 0) {
@@ -1290,44 +1848,18 @@
}
},
refresh() {
- this.componentData.entity = this.HaveJson(this.entityCopy);
- this.upIndex++;
+ this.queryParams = {
+ entrustCode: "",
+ outEntrustCode: "",
+ sampleName: "",
+ sampleModel: "",
+ sampleCode: "",
+ startAndEndTime: [],
+ name: "",
+ engineering: "",
+ production: "",
+ };
this.refreshTable();
- },
- // 鏉冮檺鍒嗛厤
- getPower(radio) {
- let power = JSON.parse(sessionStorage.getItem("power"));
- let up = false;
- let del = false;
- let revoke = false;
- let check = false;
- let checkUpdate = false;
- for (var i = 0; i < power.length; i++) {
- if (power[i].menuMethod == "upInsOrder") {
- up = true;
- }
- if (power[i].menuMethod == "updateStatus") {
- revoke = true;
- }
- if (power[i].menuMethod == "upInsOrderOfState") {
- check = true;
- }
- if (power[i].menuMethod == "checkUpdate") {
- checkUpdate = true;
- }
- }
- if (!up) {
- this.componentData.do.splice(5, 1);
- }
- if (!checkUpdate) {
- this.componentData.do.splice(4, 1);
- }
- if (!revoke) {
- this.componentData.do.splice(3, 1);
- }
- if (!check) {
- this.componentData.do.splice(2, 1);
- }
},
handleClose() {
this.verifyDialogVisible = false;
@@ -1350,21 +1882,29 @@
this.exportCheckedDate = [];
this.dialogVisible1 = false;
},
- // 璇︽儏
- selectAllByOne(row) {
- this.active = 2;
- // console.log(row);
- // //鎵撳紑寮规
- // this.dialogVisible = true;
- // //row = 鐐瑰嚮瀵瑰簲琛屽��
- // //澶嶅埗缁檉ormData
- // this.formData = this.HaveJson(row);
- this.currentId = row.id;
- this.examine = 1;
+ // 鏌ョ湅璇︽儏
+ showDetails(row) {
+ this.$router.push({
+ name: "showDetails",
+ query: {
+ active: 2,
+ currentId: row.id,
+ examine: 1,
+ isReview: true,
+ },
+ });
},
// 鏁版嵁鏌ョ湅
handleDataLook(row) {
- this.componentDataDataLook.entity.id = row.id;
+ selectSampleAndProductByOrderId({ id: row.id })
+ .then((res) => {
+ if (res.code === 200) {
+ this.dataLooktableData = res.data;
+ }
+ })
+ .catch((error) => {
+ console.error(error);
+ });
this.dataDialogVisible = true;
},
// 涓嬭浇鎶ュ憡
@@ -1635,8 +2175,8 @@
this.$axios
.get(
this.$api.insOrder.selectTemperatureByProductId +
- "?productId=" +
- tree.id
+ "?productId=" +
+ tree.id
)
.then((res) => {
this.loadRecursion(this.treeTableData, tree.id, res.data);
@@ -1650,10 +2190,10 @@
this.$axios
.get(
this.$api.insOrder.selectTemperatureNumberByProductId +
- "?parentId=" +
- tree.parentId +
- "&inspectionItem=" +
- tree.inspectionItemTwo
+ "?parentId=" +
+ tree.parentId +
+ "&inspectionItem=" +
+ tree.inspectionItemTwo
)
.then((res) => {
this.loadRecursion(this.treeTableData, tree.id, res.data);
@@ -1665,10 +2205,10 @@
this.$axios
.get(
this.$api.insOrder.selectProductsBySampleId +
- "?sampleId=" +
- tree.id +
- "&orderId=" +
- this.orderId
+ "?sampleId=" +
+ tree.id +
+ "&orderId=" +
+ this.orderId
)
.then((res) => {
this.treeTableData.forEach((m, index) => {
@@ -1700,8 +2240,8 @@
this.$axios
.get(
this.$api.insOrder.revokeReviewTemperatureByProductId +
- "?productId=" +
- tree.id
+ "?productId=" +
+ tree.id
)
.then((res) => {
resolve(res.data);
@@ -1713,10 +2253,10 @@
this.$axios
.get(
this.$api.insOrder.revokeReviewConsistentByProductId +
- "?parentId=" +
- tree.parentId +
- "&inspectionItem=" +
- tree.inspectionItemTwo
+ "?parentId=" +
+ tree.parentId +
+ "&inspectionItem=" +
+ tree.inspectionItemTwo
)
.then((res) => {
resolve(res.data);
@@ -1726,10 +2266,10 @@
this.$axios
.get(
this.$api.insOrder.revokeReviewProduct +
- "?sampleId=" +
- tree.id +
- "&orderId=" +
- this.orderId
+ "?sampleId=" +
+ tree.id +
+ "&orderId=" +
+ this.orderId
)
.then((res) => {
resolve(res.data);
@@ -2062,13 +2602,15 @@
},
// 涓嬪崟
playOrder(num) {
+ // this.active = num;
+ // this.examine = 0;
this.$router.push({
name: "addOrder",
- params: {},
+ query: {
+ active: num,
+ examine: 0,
+ },
});
- this.active = num;
- this.examine = 0;
- // this.refreshTable();
},
handleTab(m, i) {
this.tabIndex = i;
@@ -2199,11 +2741,11 @@
margin-bottom: 16px;
}
-.box-card>>>.el-radio__inner {
+.box-card >>> .el-radio__inner {
border-radius: 2px !important;
}
-.box-card>>>.el-radio__input.is-checked .el-radio__inner::after {
+.box-card >>> .el-radio__input.is-checked .el-radio__inner::after {
content: "";
width: 8px;
height: 3px;
@@ -2220,15 +2762,15 @@
background: none;
}
->>>.el-radio__label {
+>>> .el-radio__label {
color: #000 !important;
}
-.el-dialog__body>>>.el-radio__label {
+.el-dialog__body >>> .el-radio__label {
font-size: 8px;
}
-.el-dialog__body>>>.el-radio__input.is-checked .el-radio__inner::after {
+.el-dialog__body >>> .el-radio__input.is-checked .el-radio__inner::after {
content: "";
width: 4px;
height: 3px;
@@ -2245,36 +2787,36 @@
background: none;
}
->>>.el-radio__input.is-disabled.is-checked .el-radio__inner {
+>>> .el-radio__input.is-disabled.is-checked .el-radio__inner {
background: #3a7bfa;
}
-.el-dialog__body>>>.el-radio__input.is-disabled.is-checked .el-radio__inner {
+.el-dialog__body >>> .el-radio__input.is-disabled.is-checked .el-radio__inner {
background: transparent;
}
-.el-dialog__body>>>.el-radio__inner {
+.el-dialog__body >>> .el-radio__inner {
width: 8px !important;
height: 8px !important;
}
-.el-dialog__body>>>.el-radio__label {
+.el-dialog__body >>> .el-radio__label {
padding-left: 2px !important;
}
-.el-dialog__body>>>.el-card__body {
+.el-dialog__body >>> .el-card__body {
padding: 0 !important;
}
-.el-dialog__body>>>.el-card {
+.el-dialog__body >>> .el-card {
border: none;
}
-.el-dialog__body>>>.el-radio__input.is-disabled .el-radio__inner {
+.el-dialog__body >>> .el-radio__input.is-disabled .el-radio__inner {
border-color: #000 !important;
}
-.el-dialog__body>>>.el-radio__input.is-disabled.is-checked .el-radio__inner {
+.el-dialog__body >>> .el-radio__input.is-disabled.is-checked .el-radio__inner {
border: none !important;
}
diff --git a/src/views/standard/standardLibrary/index.vue b/src/views/standard/standardLibrary/index.vue
index 2f66f8a..a467c0b 100644
--- a/src/views/standard/standardLibrary/index.vue
+++ b/src/views/standard/standardLibrary/index.vue
@@ -438,7 +438,7 @@
</el-col>
</el-row>
<el-row style="width: 100%; margin-top: 8px">
- <el-col :span="24" style="display: flex; align-items: center; justify-content: end">
+ <el-col :span="24" style="display: flex; align-items: center; justify-content: flex-end">
<el-button @click="clearProduct(1)" size="small" type="danger">閲嶇疆鍗曚环</el-button>
<el-button @click="clearProduct(2)" size="small" type="danger">閲嶇疆宸ユ椂绯绘暟</el-button>
<el-button type="primary" size="small" @click="sectionUp(moreSelects)">璁剧疆鍖洪棿</el-button>
diff --git a/src/views/structural/capabilityAndLaboratory/capability/index.vue b/src/views/structural/capabilityAndLaboratory/capability/index.vue
index 47973df..f130807 100644
--- a/src/views/structural/capabilityAndLaboratory/capability/index.vue
+++ b/src/views/structural/capabilityAndLaboratory/capability/index.vue
@@ -10,7 +10,7 @@
</el-col>
<el-col :span="12" style="text-align: right;">
<el-upload v-if="radio === 0" ref='upload1' style="display: inline;margin-right: 8px" :action="uploadAction1"
- :before-upload="beforeUpload1" :headers="token" :on-error="onError1" :on-success="handleSuccessUp1"
+ :before-upload="beforeUpload1" :headers="uploadHeader" :on-error="onError1" :on-success="handleSuccessUp1"
:show-file-list="false" accept='.doc,.docx,.xls,.xlsx'>
<el-button size="small" type="primary">瀵煎叆</el-button>
</el-upload>
@@ -81,9 +81,9 @@
</el-dialog>
<el-dialog :visible.sync="uploadDia" title="鏁版嵁瀵煎叆" width="500px">
<div style="margin: 0 auto;">
- <el-upload ref="upload" :action="uploadAction" :auto-upload="false" :file-list="fileList" :headers="token"
- :limit="1" :on-change="beforeUpload" :on-error="onError" :on-success="onSuccess" accept=".xlsx" drag
- name="file">
+ <el-upload ref="upload" :action="uploadAction" :auto-upload="false" :file-list="fileList"
+ :headers="uploadHeader" :limit="1" :on-change="beforeUpload" :on-error="onError" :on-success="onSuccess"
+ accept=".xlsx" drag name="file">
<i class="el-icon-upload"></i>
<div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
</el-upload>
diff --git a/src/views/structural/capabilityAndLaboratory/laboratory/index.vue b/src/views/structural/capabilityAndLaboratory/laboratory/index.vue
index da211f7..aebb5e9 100644
--- a/src/views/structural/capabilityAndLaboratory/laboratory/index.vue
+++ b/src/views/structural/capabilityAndLaboratory/laboratory/index.vue
@@ -120,14 +120,14 @@
</el-form-item>
<el-form-item label="璧勮川鍥剧墖">
<el-upload ref="upload" :action="uploadAction" :on-success="(m) => handleSuccessUpImg(m, 'imageUrl')"
- accept="image/jpg,image/jpeg,image/png" :multiple="false" :limit="1" :headers="headers"
+ accept="image/jpg,image/jpeg,image/png" :multiple="false" :limit="1" :headers="uploadHeader"
:on-change="beforeUpload" :on-error="onError">
<el-button slot="trigger" size="small" type="primary">閫夊彇鍥剧墖</el-button>
</el-upload>
</el-form-item>
<el-form-item label="璧勮川闄勪欢">
<el-upload ref="upload1" :action="uploadAction" :on-success="(m) => handleSuccessUpImg(m, 'fileUrl')"
- accept="image/jpg,image/jpeg,image/png,application/pdf,.doc,.docx" :headers="headers" :multiple="false"
+ accept="image/jpg,image/jpeg,image/png,application/pdf,.doc,.docx" :headers="uploadHeader" :multiple="false"
:limit="1" :on-change="beforeUpload1" :on-error="onError1">
<el-button slot="trigger" size="small" type="primary">閫夊彇鏂囦欢</el-button>
</el-upload>
--
Gitblit v1.9.3