From 94e0abbf193f9e1fc953716ca7868d74cd14a2cd Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期一, 21 九月 2026 11:06:25 +0800
Subject: [PATCH] fix(inspectionTask): 修复连接实验室功能并更新字段标签
---
src/views/business/inspectionTask/index.vue | 32 +++++++++++++++++++++-----------
1 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/src/views/business/inspectionTask/index.vue b/src/views/business/inspectionTask/index.vue
index 37b7124..5c66bd9 100644
--- a/src/views/business/inspectionTask/index.vue
+++ b/src/views/business/inspectionTask/index.vue
@@ -234,7 +234,6 @@
import UnPassRetestResult from "@/components/rawMaterialInspection/unPassRetestResult.vue"
import {
claimInsOrderPlan,
- upPlanUser2,
upPlanUser,
selectUserCondition,
getBindingProductByProductId,
@@ -244,6 +243,7 @@
selectInsOrderPlanList,
selectSampleAndProductByOrderId,
} from "@/api/business/inspectionTask.js";
+import { treeDevice } from "@/api/cnas/resourceDemand/device.js";
import { mapGetters } from "vuex";
import {getRetestResult} from "@/api/business/rawMaterialOrder";
import {upReportUrl} from "@/api/business/insReport";
@@ -839,19 +839,29 @@
},
handleConnect(row) {
this.orderId = row.id;
- this.connect = {};
+ this.connect = {
+ connectPerson: "",
+ sonLaboratory: "",
+ };
+ this.sonLaboratoryList = [];
this.connectVisible = true;
- upPlanUser2({ orderId: this.orderId }).then((res) => {
- if (res.code === 200 && res.data.length > 0) {
- this.sonLaboratoryList = [];
- res.data.forEach((m) => {
- this.sonLaboratoryList.push({
- value: m,
- label: m,
- });
- });
+ treeDevice().then((res) => {
+ if (res.code === 200) {
+ const laboratoryNames = [
+ ...new Set((res.data || []).map((item) => item && item.label).filter(Boolean)),
+ ];
+ this.sonLaboratoryList = laboratoryNames.map((laboratoryName) => ({
+ value: laboratoryName,
+ label: laboratoryName,
+ }));
+ if (this.sonLaboratoryList.length === 0) {
+ this.$message.warning("鏆傛棤鍦烘墍鏁版嵁");
+ return;
+ }
this.connect.sonLaboratory = this.sonLaboratoryList[0].value;
}
+ }).catch(() => {
+ this.$message.error("鍦烘墍鏁版嵁鍔犺浇澶辫触");
});
},
confirmConnect() {
--
Gitblit v1.9.3