From ea7c19b7bfd7a5260fa321579e6941f28ef2eb46 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期四, 27 八月 2026 11:36:30 +0800
Subject: [PATCH] fix(order): 解决实验室字段必填验证和数据源问题
---
src/api/standard/standardLibrary.js | 3 +
vue.config.js | 3 +
src/views/business/productOrder/components/addOrder.vue | 18 ++++----
src/views/business/productOrder/components/addView.vue | 18 ++++----
src/api/business/rawMaterialOrder.js | 3 +
src/views/business/productOrder/index.vue | 40 +++++---------------
6 files changed, 36 insertions(+), 49 deletions(-)
diff --git a/src/api/business/rawMaterialOrder.js b/src/api/business/rawMaterialOrder.js
index a95d6ec..7297dd1 100644
--- a/src/api/business/rawMaterialOrder.js
+++ b/src/api/business/rawMaterialOrder.js
@@ -129,6 +129,9 @@
}
// 鏍规嵁鏍囧噯鏍戣繘琛屾爣鍑嗘煡璇�
export function selectsStandardMethodByFLSSM(query) {
+ if (!query || !query.tree || !query.tree.trim()) {
+ return Promise.resolve({ code: 200, data: { standardMethodList: [] } })
+ }
return request({
url: '/standardTree/selectsStandardMethodByFLSSM',
method: 'get',
diff --git a/src/api/standard/standardLibrary.js b/src/api/standard/standardLibrary.js
index 832dd1c..ce53868 100644
--- a/src/api/standard/standardLibrary.js
+++ b/src/api/standard/standardLibrary.js
@@ -76,6 +76,9 @@
// 鏍规嵁鏍囧噯鏍戣繘琛屾爣鍑嗘煡璇�
export function selectsStandardMethodByFLSSM(query) {
+ if (!query || !query.tree || !query.tree.trim()) {
+ return Promise.resolve({ code: 200, data: { standardMethodList: [] } });
+ }
return request({
url: "/standardTree/selectsStandardMethodByFLSSM",
method: "get",
diff --git a/src/views/business/productOrder/components/addOrder.vue b/src/views/business/productOrder/components/addOrder.vue
index 9729ae7..67b582d 100644
--- a/src/views/business/productOrder/components/addOrder.vue
+++ b/src/views/business/productOrder/components/addOrder.vue
@@ -463,10 +463,10 @@
</div>
</el-col>
<el-col v-if="distributeData.userId" :span="22" class="search_thing">
- <div class="search_label"><span class="required-span">* </span>璇曢獙瀹わ細</div>
+ <div class="search_label">璇曢獙瀹わ細</div>
<div class="search_input">
<el-select v-model="distributeData.sonLaboratory" filterable placeholder="璇烽�夋嫨" size="small" style="width: 100%;">
- <el-option v-for="item in sonLaboratoryList" :key="item.value" :label="item.label" :value="item.value">
+ <el-option v-for="item in newJuLaboratoryList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
@@ -614,8 +614,11 @@
},
computed:{
...mapGetters(["nickName", 'nameEn', 'userName']),
+ newJuLaboratoryList() {
+ return (this.dict.type.sys_sub_lab || []).filter(item => item.label === '鏂拌仛')
+ },
},
- dicts: ['check_type1', 'urgency_level', 'form_type', 'sample_status_list'],
+ dicts: ['check_type1', 'urgency_level', 'form_type', 'sample_status_list', 'sys_sub_lab'],
data() {
return {
active: '',
@@ -1379,6 +1382,7 @@
this.distributeData.appointed = ress.data
})
setTimeout(() => {
+ this.distributeData.sonLaboratory = this.newJuLaboratoryList.length > 0 ? this.newJuLaboratoryList[0].value : ''
this.issuedDialogVisible = true;
}, 1000)
})
@@ -1395,10 +1399,6 @@
}
if (this.distributeData.userId == null || this.distributeData.userId == '') {
this.$message.error('鎸囨淳浜哄憳鏈~鍐�')
- return
- }
- if (this.distributeData.userId&&(this.distributeData.sonLaboratory== null ||this.distributeData.sonLaboratory== '')) {
- this.$message.error('璇曢獙瀹ゆ湭濉啓')
return
}
this.upLoad = true;
@@ -2224,8 +2224,8 @@
})
},
changeUser(){
- if(this.sonLaboratoryList.length>0){
- this.distributeData.sonLaboratory = this.sonLaboratoryList[0].value
+ if(this.newJuLaboratoryList.length>0){
+ this.distributeData.sonLaboratory = this.newJuLaboratoryList[0].value
}
},
addProductList(productList,row,index){
diff --git a/src/views/business/productOrder/components/addView.vue b/src/views/business/productOrder/components/addView.vue
index d7e8fd7..52cf05d 100644
--- a/src/views/business/productOrder/components/addView.vue
+++ b/src/views/business/productOrder/components/addView.vue
@@ -459,10 +459,10 @@
</div>
</el-col>
<el-col v-if="distributeData.userId" :span="22" class="search_thing">
- <div class="search_label"><span class="required-span">* </span>璇曢獙瀹わ細</div>
+ <div class="search_label">璇曢獙瀹わ細</div>
<div class="search_input">
<el-select v-model="distributeData.sonLaboratory" filterable placeholder="璇烽�夋嫨" size="small" style="width: 100%;">
- <el-option v-for="item in sonLaboratoryList" :key="item.value" :label="item.label" :value="item.value">
+ <el-option v-for="item in newJuLaboratoryList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
@@ -608,8 +608,11 @@
},
computed:{
...mapGetters(["nickName"]),
+ newJuLaboratoryList() {
+ return (this.dict.type.sys_sub_lab || []).filter(item => item.label === '鏂拌仛')
+ },
},
- dicts: ['check_type1', 'urgency_level', 'form_type', 'sample_status_list'],
+ dicts: ['check_type1', 'urgency_level', 'form_type', 'sample_status_list', 'sys_sub_lab'],
data() {
return {
active: '',
@@ -1308,6 +1311,7 @@
this.distributeData.appointed = ress.data
})
setTimeout(() => {
+ this.distributeData.sonLaboratory = this.newJuLaboratoryList.length > 0 ? this.newJuLaboratoryList[0].value : ''
this.issuedDialogVisible = true;
}, 1000)
})
@@ -1324,10 +1328,6 @@
}
if (this.distributeData.userId == null || this.distributeData.userId == '') {
this.$message.error('鎸囨淳浜哄憳鏈~鍐�')
- return
- }
- if (this.distributeData.userId&&(this.distributeData.sonLaboratory== null ||this.distributeData.sonLaboratory== '')) {
- this.$message.error('璇曢獙瀹ゆ湭濉啓')
return
}
this.upLoad = true;
@@ -2150,8 +2150,8 @@
})
},
changeUser(){
- if(this.sonLaboratoryList.length>0){
- this.distributeData.sonLaboratory = this.sonLaboratoryList[0].value
+ if(this.newJuLaboratoryList.length>0){
+ this.distributeData.sonLaboratory = this.newJuLaboratoryList[0].value
}
},
addProductList(productList,row,index){
diff --git a/src/views/business/productOrder/index.vue b/src/views/business/productOrder/index.vue
index 720cfa7..1f24b24 100644
--- a/src/views/business/productOrder/index.vue
+++ b/src/views/business/productOrder/index.vue
@@ -130,11 +130,11 @@
</div>
</el-col>
<el-col class="search_thing" style="width: 95%;">
- <div class="search_label"><span class="required-span">* </span>璇曢獙瀹わ細</div>
+ <div class="search_label">璇曢獙瀹わ細</div>
<div class="search_input">
<el-select v-model="distributeData.sonLaboratory" clearable filterable placeholder="璇烽�夋嫨" size="small"
style="width: 100%;">
- <el-option v-for="(item, i) in sonLaboratoryList" :key="i + 'oooo'" :label="item.label"
+ <el-option v-for="(item, i) in newJuLaboratoryList" :key="i + 'oooo'" :label="item.label"
:value="item.value">
</el-option>
</el-select>
@@ -335,7 +335,7 @@
getRevocationInsProductList,
selectOrderManDay,
updateInspected,
- updateOrderEntrustCode, updateSampleModel, updateStatus, upInsOrder, upPlanUser2
+ updateOrderEntrustCode, updateSampleModel, updateStatus, upInsOrder
} from "@/api/business/productOrder";
import { selectUserCondition } from "@/api/performance/class";
import { downFile, getFileList, selectSampleAndProductByOrderId } from "@/api/business/rawMaterialOrder";
@@ -765,7 +765,6 @@
],
qrData: [],
multipleSelection: [],
- sonLaboratoryList: [],
printDialog: false,
addInspectionDia: false,
dialogVisible: false,
@@ -783,8 +782,12 @@
}
}
},
+ dicts: ['sys_sub_lab'],
computed: {
...mapGetters(["nickName"]),
+ newJuLaboratoryList() {
+ return (this.dict.type.sys_sub_lab || []).filter(item => item.label === '鏂拌仛')
+ },
},
mounted() {
if (this.checkPermi(['get:raw:await'])) {
@@ -1202,6 +1205,7 @@
// 涓嬪彂
handleIssued(row) {
this.issuedDialogVisible = true;
+ this.distributeData.sonLaboratory = this.newJuLaboratoryList.length > 0 ? this.newJuLaboratoryList[0].value : ''
selectOrderManDay({
id: row.id
}).then(res => {
@@ -1209,26 +1213,6 @@
this.distributeData.sampleId = row.sampleId
this.distributeData.appointed = res.data
this.distributeData.type = row.type
- })
- upPlanUser2({
- orderId: row.id,
- }).then(res => {
- this.sonLaboratoryList = [
- {
- value: '鏂拌仛',
- label: '鏂拌仛'
- }
- ]
- this.distributeData.sonLaboratory = '鏂拌仛'
- // if (res.code === 200 && res.data.length > 0) {
- // this.sonLaboratoryList = [];
- // res.data.forEach(m => {
- // this.sonLaboratoryList.push({
- // value: m,
- // label: m
- // })
- // })
- // }
})
},
submitForm2() {
@@ -1239,10 +1223,6 @@
//
if (this.distributeData.userId == null || this.distributeData.userId == '') {
this.$message.error('鎸囨淳浜哄憳鏈~鍐�')
- return
- }
- if (this.distributeData.userId && (this.distributeData.sonLaboratory == null || this.distributeData.sonLaboratory == '')) {
- this.$message.error('璇曢獙瀹ゆ湭濉啓')
return
}
this.upLoad = true;
@@ -1344,8 +1324,8 @@
this.InspectionKey++
},
changeUser() {
- if (this.sonLaboratoryList.length > 0) {
- this.distributeData.sonLaboratory = this.sonLaboratoryList[0].value
+ if (this.newJuLaboratoryList.length > 0) {
+ this.distributeData.sonLaboratory = this.newJuLaboratoryList[0].value
}
},
handleDelete(row) {
diff --git a/vue.config.js b/vue.config.js
index df96ca0..1ef63cb 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -36,7 +36,8 @@
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
- target: `http://36.213.90.123:9015/lims`,
+ // target: `http://36.213.90.123:9015/lims`,
+ target: `http://127.0.0.1:9509/lims`,
changeOrigin: true,
pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "",
--
Gitblit v1.9.3