| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="work-time-config"> |
| | | <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.number" @keyup.enter.native="refreshTable()"></el-input></div> |
| | | </div> |
| | | <div class="search_thing"> |
| | | <div class="search_label">å®éªå®¤ï¼</div> |
| | | <el-select v-model="componentData.entity.laboratory" placeholder="å
¨é¨" size="small"> |
| | | <el-option v-for="item in laboratoryList" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="search_thing"> |
| | | <div class="search_label">é¨é¨ï¼</div> |
| | | <div class="search_input"> |
| | | <el-select v-model="componentData.entity.department" placeholder="å
¨é¨" size="small"> |
| | | <el-option v-for="item in partList" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </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> |
| | | <el-button size="small" type="primary" style="position: absolute;right: 50px;" @click="openAdd">æ° å¢</el-button> |
| | | </div> |
| | | <div class="table"> |
| | | <ValueTable ref="ValueTable0" |
| | | :url="$api.auxiliaryWorkingHours.selectAuxiliaryWorkingHours" :upUrl="$api.auxiliaryWorkingHours.upAuxiliaryWorkingHours" |
| | | :delUrl="$api.auxiliaryWorkingHours.deleteAuxiliaryWorkingHours" :componentData="componentData" :key="upIndex" /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { number } from 'echarts' |
| | | import ValueTable from '../../tool/value-table.vue' |
| | | export default { |
| | | components: { |
| | | ValueTable |
| | | }, |
| | | data () { |
| | | return{ |
| | | componentData: { |
| | | entity: { |
| | | number: null, |
| | | department: null, |
| | | laboratory: null, |
| | | orderBy: { |
| | | field: 'id', |
| | | order: 'desc' |
| | | } |
| | | }, |
| | | isIndex: true, |
| | | showSelect: false, |
| | | select: true, |
| | | do: [{ |
| | | id: 'delete', |
| | | font: 'å é¤', |
| | | type: 'text', |
| | | method: 'doDiy' |
| | | }, { |
| | | id: 'update', |
| | | font: 'ç¼è¾', |
| | | type: 'text', |
| | | method: 'doDiy' |
| | | }], |
| | | tagField: { |
| | | laboratory: { |
| | | select: [] |
| | | }, |
| | | unit: { |
| | | select: [] |
| | | }, |
| | | // department: { |
| | | // select: [] |
| | | // }, |
| | | }, |
| | | linkEvent: { |
| | | }, |
| | | selectField: { |
| | | laboratory: { |
| | | select: [] |
| | | }, |
| | | unit: { |
| | | select: [] |
| | | }, |
| | | // department: { |
| | | // select: [] |
| | | // }, |
| | | }, |
| | | requiredAdd: ['number','auxiliaryProject','laboratory','unit','approvedWorkingHour','department'], |
| | | requiredUp: ['number','auxiliaryProject','laboratory','unit','approvedWorkingHour','department'] |
| | | }, |
| | | entityCopy: {}, |
| | | upIndex: 0, |
| | | laboratoryList:[], |
| | | partList:[], |
| | | addPower:true |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.entityCopy = this.HaveJson(this.componentData.entity) |
| | | this.getPower() |
| | | this.obtainItemParameterList() |
| | | this.selectEnumByCategoryForUnit() |
| | | }, |
| | | methods: { |
| | | refresh(){ |
| | | this.componentData.entity = this.HaveJson(this.entityCopy) |
| | | this.upIndex++ |
| | | }, |
| | | refreshTable(){ |
| | | this.$refs['ValueTable0'].selectList() |
| | | }, |
| | | getPower(radio) { |
| | | 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 == 'upDeviceParameter') { |
| | | up = true |
| | | } |
| | | if (power[i].menuMethod == 'delDeviceParameter') { |
| | | del = true |
| | | } |
| | | if (power[i].menuMethod == 'addDeviceParameter') { |
| | | add = true |
| | | } |
| | | } |
| | | if (!up) { |
| | | this.componentData.do.splice(1, 1) |
| | | } |
| | | if (!del) { |
| | | this.componentData.do.splice(0, 1) |
| | | } |
| | | this.addPower = add |
| | | }, |
| | | openAdd() { |
| | | this.$refs.ValueTable0.openAddDia(this.$api.auxiliaryWorkingHours.insertAuxiliaryWorkingHours); |
| | | }, |
| | | obtainItemParameterList() { |
| | | this.$axios.get(this.$api.laboratoryScope.obtainItemParameterList).then(res => { |
| | | let data = [] |
| | | res.data.forEach(a => { |
| | | data.push({ |
| | | label: a.laboratoryName, |
| | | value: a.id |
| | | }) |
| | | }) |
| | | this.laboratoryList = data |
| | | this.componentData.selectField.laboratory.select = data |
| | | this.componentData.tagField.laboratory.select = data |
| | | }) |
| | | }, |
| | | selectEnumByCategoryForUnit() { |
| | | this.$axios.post(this.$api.enums.selectEnumByCategory, { |
| | | category: "åä½" |
| | | }).then(res => { |
| | | this.componentData.selectField.unit.select = res.data |
| | | this.componentData.tagField.unit.select = res.data |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .work-time-config{ |
| | | height: 100%; |
| | | } |
| | | .search { |
| | | background-color: #fff; |
| | | height: 80px; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .search_thing { |
| | | width: 250px; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .search_label { |
| | | width: 70px; |
| | | font-size: 14px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .search_input { |
| | | width: calc(100% - 70px); |
| | | } |
| | | .table { |
| | | margin-top: 10px; |
| | | background-color: #fff; |
| | | width: calc(100% - 40px); |
| | | height: calc(100% - 60px - 80px - 10px - 40px); |
| | | padding: 20px; |
| | | } |
| | | </style> |