| | |
| | | <div class="standard_method"> |
| | | <div> |
| | | <el-row class="title"> |
| | | <el-col :span="12" style="padding-left: 20px;">标准方法</el-col> |
| | | <el-col :span="12" style="padding-left: 20px;text-align: left;">标准方法</el-col> |
| | | <el-col :span="12" style="text-align: right;"> |
| | | <el-button size="medium" @click="$refs.ValueTable.openUpload()" v-if="inPower"> |
| | | <i class="el-icon-upload2" style="color: #3A7BFA;"></i> |
| | | <span style="color: #3A7BFA;">导入</span></el-button> |
| | | <el-button size="medium" type="primary" @click="openAdd" v-if="addPower">新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <div class="table"> |
| | | <ValueTable ref="ValueTable" :url="$api.standardMethod.selectStandardMethodList" |
| | | :delUrl="$api.standardMethod.delStandardMethod" :upUrl="$api.standardMethod.upStandardMethod" |
| | | :componentData="componentData" :key="upIndex" /> |
| | | :componentData="componentData" :key="upIndex" :inputUrl="$api.standardMethod.importStandardDetails"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | 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', 'isProduct', 'isUse', 'nameEn'], |
| | | requiredUp: ['code', 'name', 'isProduct', 'isUse', 'nameEn'], |
| | | accept: '.xlsx', |
| | | needSort: ['createTime', 'updateTime', 'field'], |
| | | inputType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
| | | }, |
| | | entityCopy: {}, |
| | | upIndex: 0, |
| | | addDia: false, |
| | | addPower: true |
| | | addPower: true, |
| | | inPower: true, |
| | | } |
| | | }, |
| | | 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++ |
| | | }, |
| | |
| | | let up = false |
| | | let del = false |
| | | let add = false |
| | | let inPower = false |
| | | for (var i = 0; i < power.length; i++) { |
| | | if (power[i].menuMethod == 'addStandardMethod') { |
| | | add = true |
| | |
| | | if (power[i].menuMethod == 'upStandardMethod') { |
| | | up = true |
| | | } |
| | | if (power[i].menuMethod == 'importStandardDetails') { |
| | | inPower = true |
| | | } |
| | | } |
| | | if (!del) { |
| | | this.componentData.do.splice(1, 1) |
| | |
| | | this.componentData.do.splice(0, 1) |
| | | } |
| | | this.addPower = add |
| | | this.inPower = inPower |
| | | }, |
| | | 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.capacityScope.selectTestObjectByName).then(res => { |
| | | let data = [] |
| | | this.$axios.get(this.$api.standardTree.getStandardTree2).then(res => { |
| | | res.data.forEach(a => { |
| | | data.push({ |
| | | label: a.specimenName, |
| | | value: a.id |
| | | }) |
| | | this.cascaderFieldData(a) |
| | | }) |
| | | this.componentData.selectField.structureTestObjectId.select = data |
| | | this.componentData.tagField.structureTestObjectId.select = data |
| | | this.componentData.cascaderField.structureTestObjectId.tree = res.data |
| | | }) |
| | | }, |
| | | getQualificationList(){ |
| | | 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 |
| | | } |
| | | 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> |