| | |
| | | <style scoped> |
| | | .title { |
| | | height: 60px; |
| | | line-height: 60px; |
| | | } |
| | | .title { |
| | | height: 60px; |
| | | line-height: 60px; |
| | | } |
| | | |
| | | .search { |
| | | background-color: #fff; |
| | | height: 80px; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | .search { |
| | | background-color: #fff; |
| | | height: 80px; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .search_thing { |
| | | width: 350px; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | .search_thing { |
| | | width: 350px; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .search_label { |
| | | width: 110px; |
| | | font-size: 14px; |
| | | text-align: right; |
| | | } |
| | | .search_label { |
| | | width: 110px; |
| | | font-size: 14px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .search_input { |
| | | width: calc(100% - 110px); |
| | | } |
| | | .search_input { |
| | | width: calc(100% - 110px); |
| | | } |
| | | |
| | | .table { |
| | | margin-top: 10px; |
| | | background-color: #fff; |
| | | width: calc(100% - 40px); |
| | | height: calc(100% - 60px - 80px - 10px - 40px); |
| | | padding: 20px; |
| | | } |
| | | .table { |
| | | margin-top: 10px; |
| | | background-color: #fff; |
| | | width: calc(100% - 40px); |
| | | height: calc(100% - 60px - 80px - 10px - 40px); |
| | | padding: 20px; |
| | | } |
| | | </style> |
| | | |
| | | <template> |
| | | <div class="standard_method"> |
| | | <div> |
| | | <el-row class="title"> |
| | | <el-col :span="12" style="padding-left: 20px;">标准方法</el-col> |
| | | <el-col :span="12" style="text-align: right;"> |
| | | <el-button size="medium" type="primary" @click="openAdd" v-if="addPower">新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div class="search"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">标准编号:</div> |
| | | <div class="search_input"><el-input size="small" placeholder="请输入" clearable |
| | | v-model="componentData.entity.code" @keyup.enter.native="refreshTable()"></el-input></div> |
| | | </div> |
| | | <div class="search_thing"> |
| | | <div class="search_label">标准名称:</div> |
| | | <div class="search_input"><el-input size="small" placeholder="请输入" clearable |
| | | v-model="componentData.entity.name" @keyup.enter.native="refreshTable()"></el-input></div> |
| | | </div> |
| | | <div class="search_thing" style="padding-left: 30px;"> |
| | | <el-button size="small" @click="refresh()">重 置</el-button> |
| | | <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | | <ValueTable ref="ValueTable" :url="$api.standardMethod.selectStandardMethodList" |
| | | :delUrl="$api.standardMethod.delStandardMethod" :upUrl="$api.standardMethod.upStandardMethod" :componentData="componentData" :key="upIndex"/> |
| | | </div> |
| | | </div> |
| | | <div class="standard_method"> |
| | | <div> |
| | | <el-row class="title"> |
| | | <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> |
| | | <div class="search"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">标准编号:</div> |
| | | <div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="componentData.entity.code" |
| | | @keyup.enter.native="refreshTable()"></el-input></div> |
| | | </div> |
| | | <div class="search_thing"> |
| | | <div class="search_label">标准名称:</div> |
| | | <div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="componentData.entity.name" |
| | | @keyup.enter.native="refreshTable()"></el-input></div> |
| | | </div> |
| | | <div class="search_thing" style="padding-left: 30px;"> |
| | | <el-button size="small" @click="refresh()">重 置</el-button> |
| | | <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | | <ValueTable ref="ValueTable" :url="$api.standardMethod.selectStandardMethodList" |
| | | :delUrl="$api.standardMethod.delStandardMethod" :upUrl="$api.standardMethod.upStandardMethod" |
| | | :componentData="componentData" :key="upIndex" :inputUrl="$api.standardMethod.importStandardDetails"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import ValueTable from '../tool/value-table.vue' |
| | | export default { |
| | | components: { |
| | | ValueTable |
| | | }, |
| | | data() { |
| | | return { |
| | | componentData: { |
| | | entity: { |
| | | code: null, |
| | | name: null, |
| | | orderBy: { |
| | | field: 'id', |
| | | order: 'asc' |
| | | } |
| | | }, |
| | | isIndex: true, |
| | | showSelect: false, |
| | | select: true, |
| | | do: [{ |
| | | id: 'update', |
| | | font: '编辑', |
| | | type: 'text', |
| | | method: 'doDiy', |
| | | field:['sampleType','createUserName','updateUserName','检验对象=structureTestObjectId'] |
| | | },{ |
| | | id: 'delete', |
| | | font: '删除', |
| | | type: 'text', |
| | | method: 'doDiy' |
| | | }], |
| | | tagField: { |
| | | structureTestObjectId:{select: []} |
| | | }, |
| | | selectField: { |
| | | structureTestObjectId:{select: []} |
| | | }, |
| | | requiredAdd:['code','name','structureTestObjectId'], |
| | | requiredUp:['code','name','structureTestObjectId'] |
| | | }, |
| | | entityCopy: {}, |
| | | upIndex: 0, |
| | | addDia: false, |
| | | addPower: true |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.entityCopy = this.HaveJson(this.componentData.entity) |
| | | this.getPower() |
| | | this.selectTestObjectByName() |
| | | }, |
| | | methods: { |
| | | refreshTable() { |
| | | this.$refs['ValueTable'].selectList() |
| | | }, |
| | | refresh() { |
| | | this.componentData.entity = this.HaveJson(this.entityCopy) |
| | | this.upIndex++ |
| | | }, |
| | | // 权限分配 |
| | | getPower(){ |
| | | let power = JSON.parse(sessionStorage.getItem('power')) |
| | | let up = false |
| | | 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); |
| | | }, |
| | | 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 |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | import ValueTable from '../tool/value-table.vue' |
| | | export default { |
| | | components: { |
| | | ValueTable |
| | | }, |
| | | data() { |
| | | return { |
| | | componentData: { |
| | | entity: { |
| | | code: null, |
| | | name: null, |
| | | orderBy: { |
| | | field: 'id', |
| | | order: 'asc' |
| | | } |
| | | }, |
| | | isIndex: true, |
| | | showSelect: false, |
| | | select: true, |
| | | do: [{ |
| | | id: 'update', |
| | | font: '编辑', |
| | | type: 'text', |
| | | method: 'doDiy', |
| | | field: ['createUserName', 'updateUserName'] |
| | | }, { |
| | | id: 'delete', |
| | | font: '删除', |
| | | type: 'text', |
| | | method: 'doDiy' |
| | | }], |
| | | tagField: { |
| | | isProduct: { |
| | | select: [{ |
| | | value: 0, |
| | | type: 'info', |
| | | label: '否' |
| | | }, { |
| | | value: 1, |
| | | label: '是' |
| | | }] |
| | | }, |
| | | isUse: { |
| | | select: [{ |
| | | value: 0, |
| | | type: 'info', |
| | | label: '否' |
| | | }, { |
| | | value: 1, |
| | | label: '是' |
| | | }] |
| | | }, |
| | | qualificationId: { |
| | | select: [] |
| | | } |
| | | }, |
| | | 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', '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, |
| | | inPower: true, |
| | | } |
| | | }, |
| | | 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++ |
| | | }, |
| | | // 权限分配 |
| | | getPower() { |
| | | let power = JSON.parse(sessionStorage.getItem('power')) |
| | | 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 == 'delStandardMethod') { |
| | | del = true |
| | | } |
| | | if (power[i].menuMethod == 'upStandardMethod') { |
| | | up = true |
| | | } |
| | | if (power[i].menuMethod == 'importStandardDetails') { |
| | | inPower = true |
| | | } |
| | | } |
| | | if (!del) { |
| | | this.componentData.do.splice(1, 1) |
| | | } |
| | | if (!up) { |
| | | 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.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> |