From d40e875d8e025fd09566e919306f5b05755c25cb Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期六, 11 五月 2024 14:51:17 +0800
Subject: [PATCH] x优化班次
---
src/components/view/a7-standard-method.vue | 138 +++++++++++++++++++++++++++++++++++++++++----
1 files changed, 125 insertions(+), 13 deletions(-)
diff --git a/src/components/view/a7-standard-method.vue b/src/components/view/a7-standard-method.vue
index 5176e02..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,24 +112,60 @@
value: 1,
label: '鏄�'
}]
- }
- },
- selectField: {
- structureTestObjectId: {
- select: []
},
- isProduct: {
+ isUse: {
select: [{
value: 0,
+ type: 'info',
label: '鍚�'
}, {
value: 1,
label: '鏄�'
}]
+ },
+ qualificationId: {
+ select: []
}
},
- requiredAdd: ['code', 'name', 'structureTestObjectId', 'isProduct'],
- requiredUp: ['code', 'name', 'structureTestObjectId', 'isProduct']
+ selectField: {
+ isProduct: {
+ select: [{
+ value: 0,
+ type: 'info',
+ label: '鍚�'
+ }, {
+ value: 1,
+ label: '鏄�'
+ }]
+ },
+ isUse: {
+ select: [{
+ value: 0,
+ type: 'info',
+ label: '鍚�'
+ }, {
+ value: 1,
+ label: '鏄�'
+ }]
+ },
+ qualificationId: {
+ select: []
+ }
+ },
+ 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,
@@ -143,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++
},
@@ -157,4 +193,80 @@
getPower() {
let power = JSON.parse(sessionStorage.getItem('power'))
let up = false
- let del = fa
+ let del = false
+ let add = false
+ for (var i = 0; i < power.length; i++) {
+ if (power[i].menuMethod == 'addStandardMethod') {
+ add = true
+ }
+ if (power[i].menuMethod == 'delStandardMethod') {
+ del = true
+ }
+ if (power[i].menuMethod == 'upStandardMethod') {
+ up = true
+ }
+ }
+ if (!del) {
+ this.componentData.do.splice(1, 1)
+ }
+ if (!up) {
+ this.componentData.do.splice(0, 1)
+ }
+ this.addPower = add
+ },
+ openAdd() {
+ this.$refs.ValueTable.openAddDia(this.$api.standardMethod.addStandardMethod);
+ },
+ 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)
+ })
+ }
+ },
+ }
+ }
+</script>
--
Gitblit v1.9.3