From 1b7ff2f053d04a5332aadf59820b567cae1df8d4 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期二, 25 三月 2025 10:14:40 +0800
Subject: [PATCH] 原辅料下单1.报检类型增加2.检验项匹配
---
src/views/structural/capabilityAndLaboratory/capabilityComponents/testObjectEditForm.vue | 31 +++++++++++++++++++++++++++----
1 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/src/views/structural/capabilityAndLaboratory/capabilityComponents/testObjectEditForm.vue b/src/views/structural/capabilityAndLaboratory/capabilityComponents/testObjectEditForm.vue
index ecdd9f2..e8052d0 100644
--- a/src/views/structural/capabilityAndLaboratory/capabilityComponents/testObjectEditForm.vue
+++ b/src/views/structural/capabilityAndLaboratory/capabilityComponents/testObjectEditForm.vue
@@ -24,6 +24,12 @@
:value="item.value"></el-option>
</el-select>
</el-form-item>
+ <el-form-item label="杞﹂棿锛�" prop="objectType" v-if="editForm.objectType == '鍘熻緟鏂�' || editForm.objectType == '鍖呮潗'">
+ <el-select v-model="editForm.workShopId" placeholder="璇烽�夋嫨" size="small">
+ <el-option v-for="item in workshopList" :key="item.id" :label="item.name" :value="item.id">
+ </el-option>
+ </el-select>
+ </el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="closeDia">鍙� 娑�</el-button>
@@ -37,6 +43,7 @@
import { obtainItemParameterList } from "@/api/structural/laboratoryScope";
import { addTestObject, upTestObject } from "@/api/structural/capability";
+import { selectWorkShop } from "@/api/structural/workshop.js"
export default {
name: "EditForm",
@@ -55,6 +62,7 @@
specimenNameEn: '', // 妫�楠屽璞N
// code: '', // 瀵硅薄浠e彿
objectType: '', // 瀵硅薄绫诲瀷
+ workShopId: '',//杞﹂棿
},
laboratoryList: [],
editFormRules: {
@@ -64,21 +72,32 @@
specimenName: [
{ required: true, message: '璇疯緭鍏ユ楠屽璞�', trigger: 'blur' }
],
- // code: [
- // { required: true, message: '璇疯緭鍏ュ璞′唬鍙�', trigger: 'blur' }
- // ],
+ objectType: [
+ { required: true, message: '璇疯緭鍏ュ璞$被鍨�', trigger: 'change' }
+ ],
+ workShopId: [
+ { required: true, message: '璇烽�夋嫨杞﹂棿', trigger: 'change' }
+ ],
},
- operationType: ''
+ operationType: '',
+ workshopList: []
}
},
// 鏂规硶闆嗗悎
methods: {
+ selectWorkShop() {
+ selectWorkShop({ size: -1, current: -1 }).then(res => {
+ this.workshopList = res.data.records
+ })
+ },
openDia(type, row) {
this.operationType = type
this.obtainItemParameterList()
+ this.selectWorkShop()
this.editFormDia = true
if (type === 'add') {
this.resetForm("editForm");
+ this.editForm = {}
} else {
this.editForm = { ...row }
}
@@ -88,6 +107,10 @@
this.$refs.editForm.validate(valid => {
if (valid) {
this.editLoad = true
+ if (this.editForm.objectType != '鍘熻緟鏂�' && this.editForm.objectType != '鍖呮潗') {
+ this.editForm.workShopId = ''
+ }
+ this.editForm.workShopName = this.editForm.workShopId ? this.workshopList.find(m => m.id == this.editForm.workShopId).name : ''
if (this.editForm.id) {
// 淇敼
upTestObject(this.editForm).then(res => {
--
Gitblit v1.9.3