From c5842886b876f20d4411d9da4d8b3b4fef0c39a7 Mon Sep 17 00:00:00 2001 From: value <z1292839451@163.com> Date: 星期一, 29 四月 2024 02:25:27 +0800 Subject: [PATCH] 检验项目绑定产品,检验对象绑定产品 --- src/components/view/a7-standard-method.vue | 112 ++++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 92 insertions(+), 20 deletions(-) diff --git a/src/components/view/a7-standard-method.vue b/src/components/view/a7-standard-method.vue index 9bd74b1..b210005 100644 --- a/src/components/view/a7-standard-method.vue +++ b/src/components/view/a7-standard-method.vue @@ -95,7 +95,7 @@ font: '缂栬緫', type: 'text', method: 'doDiy', - field: ['sampleType', 'createUserName', 'updateUserName', '妫�楠屽璞�=structureTestObjectId'] + field: ['createUserName', 'updateUserName'] }, { id: 'delete', font: '鍒犻櫎', @@ -103,9 +103,6 @@ method: 'doDiy' }], tagField: { - structureTestObjectId: { - select: [] - }, isProduct: { select: [{ value: 0, @@ -115,12 +112,22 @@ value: 1, label: '鏄�' }] + }, + isUse: { + select: [{ + value: 0, + type: 'info', + label: '鍚�' + }, { + value: 1, + label: '鏄�' + }] + }, + qualificationId: { + select: [] } }, selectField: { - structureTestObjectId: { - select: [] - }, isProduct: { select: [{ value: 0, @@ -130,10 +137,35 @@ value: 1, label: '鏄�' }] + }, + isUse: { + select: [{ + value: 0, + type: 'info', + label: '鍚�' + }, { + value: 1, + label: '鏄�' + }] + }, + qualificationId: { + select: [] } }, - requiredAdd: ['code', 'name', 'structureTestObjectId', 'isProduct'], - requiredUp: ['code', 'name', 'structureTestObjectId', 'isProduct'] + cascaderField: { + structureTestObjectId: { + tree: [] + }, + // 瀛楁閰嶇疆 + props: { + value: 'value', + label: 'label', + checkStrictly: true, + multiple: true + }, + }, + requiredAdd: ['code', 'name', 'structureTestObjectId', 'isProduct', 'isUse', 'nameEn'], + requiredUp: ['code', 'name', 'structureTestObjectId', 'isProduct', 'isUse', 'nameEn'] }, entityCopy: {}, upIndex: 0, @@ -144,13 +176,16 @@ mounted() { this.entityCopy = this.HaveJson(this.componentData.entity) this.getPower() + this.getQualificationList() this.selectTestObjectByName() }, methods: { refreshTable() { this.$refs['ValueTable'].selectList() + this.selectTestObjectByName() }, refresh() { + this.selectTestObjectByName() this.componentData.entity = this.HaveJson(this.entityCopy) this.upIndex++ }, @@ -182,18 +217,55 @@ openAdd() { this.$refs.ValueTable.openAddDia(this.$api.standardMethod.addStandardMethod); }, - selectTestObjectByName() { - this.$axios.get(this.$api.capacityScope.selectTestObjectByName).then(res => { - let data = [] - res.data.forEach(a => { - data.push({ - label: a.specimenName, - value: a.id - }) - }) - this.componentData.selectField.structureTestObjectId.select = data - this.componentData.tagField.structureTestObjectId.select = data + getQualificationList() { + this.$axios.post(this.$api.enums.selectEnumByCategory, { + category: "璧勮川鍚嶇О" + }).then(res => { + let list = res.data + this.componentData.selectField.qualificationId.select = list + this.componentData.tagField.qualificationId.select = list }) + // this.$axios.post(this.$api.certification.getCertificationDetail,{ + // page: { + // current: -1, + // size: -1 + // }, + // entity:{ + // name: null, + // }}, { + // headers: { + // 'Content-Type': 'application/json' + // } + // }).then(res => { + // if(res.code==200){ + // let list = res.data.body.records.map(item => { + // item.label = item.name + // item.value = item.id + // return item + // }); + // this.componentData.selectField.qualificationId.select = list + // this.componentData.tagField.qualificationId.select = list + // } + // }) + }, + selectTestObjectByName() { + this.$axios.get(this.$api.standardTree.getStandardTree2).then(res => { + res.data.forEach(a => { + this.cascaderFieldData(a) + }) + this.componentData.cascaderField.structureTestObjectId.tree = res.data + }) + }, + cascaderFieldData(val) { + if (val.children === undefined) { + return + } else if (val.children.length == 0) { + delete val.children + } else { + val.children.forEach(a => { + this.cascaderFieldData(a) + }) + } }, } } -- Gitblit v1.9.3