| | |
| | | font: '编辑', |
| | | type: 'text', |
| | | method: 'doDiy', |
| | | field: ['sampleType', 'createUserName', 'updateUserName', '检验对象=structureTestObjectId'] |
| | | field: ['createUserName', 'updateUserName'] |
| | | }, { |
| | | id: 'delete', |
| | | font: '删除', |
| | |
| | | method: 'doDiy' |
| | | }], |
| | | tagField: { |
| | | structureTestObjectId: { |
| | | select: [] |
| | | }, |
| | | isProduct: { |
| | | select: [{ |
| | | value: 0, |
| | |
| | | label: '是' |
| | | }] |
| | | }, |
| | | qualificationId:{ |
| | | qualificationId: { |
| | | select: [] |
| | | } |
| | | }, |
| | | selectField: { |
| | | structureTestObjectId: { |
| | | select: [] |
| | | }, |
| | | isProduct: { |
| | | select: [{ |
| | | value: 0, |
| | |
| | | label: '是' |
| | | }] |
| | | }, |
| | | qualificationId:{ |
| | | qualificationId: { |
| | | select: [] |
| | | } |
| | | }, |
| | | requiredAdd: ['code', 'name', 'structureTestObjectId', 'isProduct','isUse','nameEn'], |
| | | requiredUp: ['code', 'name', 'structureTestObjectId', 'isProduct','isUse','nameEn'] |
| | | 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, |
| | |
| | | mounted() { |
| | | this.entityCopy = this.HaveJson(this.componentData.entity) |
| | | this.getPower() |
| | | this.selectTestObjectByName() |
| | | this.getQualificationList() |
| | | this.selectTestObjectByName() |
| | | }, |
| | | methods: { |
| | | refreshTable() { |
| | | this.$refs['ValueTable'].selectList() |
| | | this.selectTestObjectByName() |
| | | }, |
| | | refresh() { |
| | | this.selectTestObjectByName() |
| | | this.componentData.entity = this.HaveJson(this.entityCopy) |
| | | this.upIndex++ |
| | | }, |
| | |
| | | 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(){ |
| | | getQualificationList() { |
| | | this.$axios.post(this.$api.enums.selectEnumByCategory, { |
| | | category: "资质名称" |
| | | }).then(res => { |
| | | let list = res.data |
| | | 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, |
| | |
| | | // 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> |