From 58be07dbde1f3375d86204cb215c8372b615a01b Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期三, 09 四月 2025 10:16:53 +0800 Subject: [PATCH] 原辅材车间文件预览调整+成品分配权限限制 --- src/views/structural/capabilityAndLaboratory/capabilityComponents/testObjectEditForm.vue | 35 +++++++++++++++++++++++++++++------ 1 files changed, 29 insertions(+), 6 deletions(-) diff --git a/src/views/structural/capabilityAndLaboratory/capabilityComponents/testObjectEditForm.vue b/src/views/structural/capabilityAndLaboratory/capabilityComponents/testObjectEditForm.vue index 3a8bfe1..bc88919 100644 --- a/src/views/structural/capabilityAndLaboratory/capabilityComponents/testObjectEditForm.vue +++ b/src/views/structural/capabilityAndLaboratory/capabilityComponents/testObjectEditForm.vue @@ -15,13 +15,19 @@ <el-form-item label="妫�楠屽璞N锛�" prop="specimenNameEn"> <el-input v-model="editForm.specimenNameEn" clearable size="small"></el-input> </el-form-item> - <el-form-item label="瀵硅薄浠e彿锛�" prop="code"> + <!-- <el-form-item label="瀵硅薄浠e彿锛�" prop="code"> <el-input v-model="editForm.code" clearable size="small"></el-input> - </el-form-item> + </el-form-item> --> <el-form-item label="瀵硅薄绫诲瀷锛�" prop="objectType"> <el-select v-model="editForm.objectType" clearable placeholder="璇烽�夋嫨" size="small" style="width: 100%"> <el-option v-for="item in dict.type.product_classification" :key="item.value" :label="item.label" :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> @@ -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", @@ -53,8 +60,9 @@ laboratoryId: '', // 鍦烘墍 specimenName: '', // 妫�楠屽璞� specimenNameEn: '', // 妫�楠屽璞N - code: '', // 瀵硅薄浠e彿 + // 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