From 0af4ccb5dacacce56c5fddd0d70288fc377c56be Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期二, 01 九月 2026 17:04:37 +0800
Subject: [PATCH] feat(inspection): 1.添加报告类型功能并优化检验流程 2.设备管理组件中的部门列表获取方法优化

---
 src/views/business/inspectionTask/components/InspectionWord.vue |   13 ++++--
 src/views/CNAS/resourceDemand/device/component/management.vue   |   12 +++---
 src/views/business/reportPreparation/index.vue                  |   20 +++++++++
 src/views/business/inspectionView/index.vue                     |   14 ++++--
 src/views/business/inspectionTask/inspection.vue                |    4 +
 5 files changed, 45 insertions(+), 18 deletions(-)

diff --git a/src/views/CNAS/resourceDemand/device/component/management.vue b/src/views/CNAS/resourceDemand/device/component/management.vue
index 745aade..71bbc62 100644
--- a/src/views/CNAS/resourceDemand/device/component/management.vue
+++ b/src/views/CNAS/resourceDemand/device/component/management.vue
@@ -391,7 +391,6 @@
 import limsTable from "@/components/Table/lims-table.vue";
 import dataAcquisitionConfig from './acquisitionConfig.vue'
 import {
-	obtainItemParameterList,
 	exportEquipmentDetails,
 	getInsProduction,
 	upDeviceParameter,
@@ -400,6 +399,7 @@
 	getDeviceParameter,
 	delDeviceParameter,
 } from '@/api/cnas/resourceDemand/device.js'
+import { listDept } from '@/api/system/dept'
 import { selectUserCondition } from "@/api/business/inspectionTask";
 export default {
 	props: {
@@ -563,7 +563,7 @@
 	mounted() {
 		this.selectEnumByCategory()
 		this.selectDevicePrincipal()
-		this.obtainItemParameterList()
+		this.obtainDepartmentList()
 		this.getInsProductIds()
 		// 鍒濆鍖�
 		this.clickSidebar(this.clickNodeVal)
@@ -573,13 +573,13 @@
 		handleNotification(cate) {
 			this.queryParams.largeCategory = cate
 		},
-		obtainItemParameterList() {
-			obtainItemParameterList().then(res => {
+		obtainDepartmentList() {
+			listDept({ status: '0' }).then(res => {
 				let data = []
 				res.data.forEach(a => {
 					data.push({
-						label: a.laboratoryName,
-						value: a.id
+						label: a.deptName,
+						value: a.deptId
 					})
 				})
 				this.subordinateDepartmentsList = data
diff --git a/src/views/business/inspectionTask/components/InspectionWord.vue b/src/views/business/inspectionTask/components/InspectionWord.vue
index 047d3aa..bd71a78 100644
--- a/src/views/business/inspectionTask/components/InspectionWord.vue
+++ b/src/views/business/inspectionTask/components/InspectionWord.vue
@@ -1789,15 +1789,17 @@
       checkSubmitPlan({
         orderId: this.orderId,
         laboratory: this.sonLaboratory,
+        reportType: this.reportType,
       }).then(res => {
         if (res.code === 200) {
-          if (!res.data || res.data.length == 0) {
+          if (!res.data || res.data.errorMsg.length == 0) {
             this.submitLoading = true;
             submitPlan({
               orderId: this.orderId,
               laboratory: this.sonLaboratory,
               verifyUser: this.verifyUser,
               entrustCode: this.insOrder.entrustCode,
+              registerInsResults: this.reportType === 1,
               reportType: this.reportType
             }).then(res => {
               if (res.code === 200) {
@@ -1813,12 +1815,12 @@
           } else {
             let newData = []
             const h = this.$createElement
-            for (let i in res.data) {
-              const lastChar = res.data[i].slice(-1);
+            for (let i in res.data.errorMsg) {
+              const lastChar = res.data.errorMsg[i].slice(-1);
               if (lastChar == '-') {
-                res.data[i] = res.data[i].slice(0, -1);
+                res.data.errorMsg[i] = res.data.errorMsg[i].slice(0, -1);
               }
-              newData.push(h('p', { style: 'font-size: 14px;color: red;' }, (Number(i) + 1) + '銆�' + res.data[i]))
+              newData.push(h('p', { style: 'font-size: 14px;color: red;' }, (Number(i) + 1) + '銆�' + res.data.errorMsg[i]))
             }
             newData.push(h('p', { style: 'font-size: 16px;color:#000;margin-top:12px;overflow-y: auto;max-height:80vh' }, '浠ヤ笂椤圭洰涓嶅悎鏍硷紝纭畾鎻愪氦锛�'))
             this.$confirm('鎻愮ず', {
@@ -1833,6 +1835,7 @@
                 orderId: this.orderId,
                 laboratory: this.sonLaboratory,
                 verifyUser: this.verifyUser,
+                registerInsResults: false,
                 reportType: this.reportType
               }).then(res => {
                 if (res.code === 200) {
diff --git a/src/views/business/inspectionTask/inspection.vue b/src/views/business/inspectionTask/inspection.vue
index bf67066..796b098 100644
--- a/src/views/business/inspectionTask/inspection.vue
+++ b/src/views/business/inspectionTask/inspection.vue
@@ -2755,6 +2755,7 @@
       this.$refs.viewManHourDia.showDialog(this.id, 99);
     },
     openAddVerifyDia() {
+      this.reportType = null;
       this.addVerifyDia = true;
     },
     confirmSubmit(registerInsResults){
@@ -2803,12 +2804,13 @@
       checkSubmitPlan({
         orderId: this.orderId,
         laboratory: this.sonLaboratory,
+        reportType: this.reportType,
       }).then((res) => {
         if (res.code === 200) {
           if (!res.data || res.data.errorMsg.length == 0) {
             this.submitLoading = true;
             //妫�楠岀被鍨嬩负鍘熸潗鏂�
-            if(this.typeSource==1 && res.data.unInsOrderCount==0 && this.isSplit==1){
+            if(this.reportType === 1 && this.typeSource==1 && res.data.unInsOrderCount==0 && this.isSplit==1){
               const htmlStr = "鏄惁鐧昏IFS閲囪喘妫�楠岀粨鏋滃苟绉诲簱锛熻鎿嶄綔浼氱櫥璁�<span style='color:#ff4949'>鍚屼竴闆朵欢鍚屼竴璁㈠崟鐨勬墍鏈夋媶鍒嗘壒娆�</span>锛岃璋ㄦ厧閫夋嫨銆�"
               this.$confirm(htmlStr, '鎻愮ず', {
                 confirmButtonText: '鏄�',
diff --git a/src/views/business/inspectionView/index.vue b/src/views/business/inspectionView/index.vue
index aed573d..bba64e6 100644
--- a/src/views/business/inspectionView/index.vue
+++ b/src/views/business/inspectionView/index.vue
@@ -2561,6 +2561,7 @@
       this.$refs.viewManHourDia.showDialog(this.id, 99);
     },
     openAddVerifyDia() {
+      this.reportType = null;
       this.addVerifyDia = true;
     },
     submit() {
@@ -2584,15 +2585,17 @@
       checkSubmitPlan({
         orderId: this.orderId,
         laboratory: this.sonLaboratory,
+        reportType: this.reportType,
       }).then((res) => {
         if (res.code === 200) {
-          if (!res.data || res.data.length == 0) {
+          if (!res.data || res.data.errorMsg.length == 0) {
             this.submitLoading = true;
             submitPlan({
               orderId: this.orderId,
               laboratory: this.sonLaboratory,
               verifyUser: this.verifyUser,
               entrustCode: this.insOrder.entrustCode,
+              registerInsResults: this.reportType === 1,
               reportType: this.reportType,
             }).then((res) => {
               if (res.code === 200) {
@@ -2609,16 +2612,16 @@
           } else {
             let newData = [];
             const h = this.$createElement;
-            for (let i in res.data) {
-              const lastChar = res.data[i].slice(-1);
+            for (let i in res.data.errorMsg) {
+              const lastChar = res.data.errorMsg[i].slice(-1);
               if (lastChar == "-") {
-                res.data[i] = res.data[i].slice(0, -1);
+                res.data.errorMsg[i] = res.data.errorMsg[i].slice(0, -1);
               }
               newData.push(
                 h(
                   "p",
                   { style: "font-size: 14px;color: red;" },
-                  Number(i) + 1 + "銆�" + res.data[i]
+                  Number(i) + 1 + "銆�" + res.data.errorMsg[i]
                 )
               );
             }
@@ -2645,6 +2648,7 @@
                   orderId: this.orderId,
                   laboratory: this.sonLaboratory,
                   verifyUser: this.verifyUser,
+                  registerInsResults: false,
                   reportType: this.reportType,
                 }).then((res) => {
                   if (res.code === 200) {
diff --git a/src/views/business/reportPreparation/index.vue b/src/views/business/reportPreparation/index.vue
index 0046fc0..33d4743 100644
--- a/src/views/business/reportPreparation/index.vue
+++ b/src/views/business/reportPreparation/index.vue
@@ -11,6 +11,11 @@
             <el-option v-for="(a, i) in queryStatusList" :key="i" :label="a.label" :value="a.value"></el-option>
           </el-select>
         </el-form-item>
+        <el-form-item label="鎶ュ憡绫诲瀷" prop="reportType">
+          <el-select v-model="entity.reportType" clearable size="small" @change="refreshTable()">
+            <el-option v-for="item in reportTypeList" :key="item.value" :label="item.label" :value="item.value"></el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item label="涓嬪崟绫诲埆" prop="typeSource">
           <el-select v-model="entity.typeSource" clearable size="small" @change="refreshTable()">
             <el-option v-for="(a, i) in typeSourceList" :key="i" :label="a.label" :value="a.value"></el-option>
@@ -228,7 +233,8 @@
         code: null,
         typeSource: null,
         orderType: null,
-        materialProp: null
+        materialProp: null,
+        reportType: null
       },
       page: {
         current: 1,
@@ -272,6 +278,10 @@
         { label: '鎶芥', value: '鎶芥' },
         { label: '杩涘巶妫�楠�', value: '杩涘巶妫�楠�' },
         { label: '瀛e害妫�楠�', value: 'Quarterly inspection' },
+      ],
+      reportTypeList: [
+        { label: '妫�娴嬫姤鍛�', value: 0 },
+        { label: '妫�楠屾姤鍛�', value: 1 },
       ],
       showInfoDialog: false, // 浜т笟閾句俊鎭煡鐪�
       isReport: 1,
@@ -357,6 +367,14 @@
           linkMethod: "selectAllByOne",
         },
         {
+          label: '鎶ュ憡绫诲瀷',
+          prop: 'reportType',
+          width: '100px',
+          dataType: 'tag',
+          formatData: (params) => params === 0 ? '妫�娴嬫姤鍛�' : '妫�楠屾姤鍛�',
+          formatType: (params) => params === 0 ? 'warning' : 'success',
+        },
+        {
           label: "涓嬪崟绫诲埆",
           prop: "typeSource",
           width: "100px",

--
Gitblit v1.9.3