| | |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary">查询</el-button> |
| | | <el-button type="primary" plain>重置</el-button> |
| | | <el-button type="primary" @click="filterTableData">查询</el-button> |
| | | <el-button type="primary" plain @click="resetBtn">重置</el-button> |
| | | <!-- <el-button type="text">高级搜索<i class="el-icon-arrow-down el-icon--right" /></el-button> --> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | <el-row> |
| | | <el-col :span="19"> |
| | | <el-input |
| | | v-model="filterText" |
| | | placeholder="输入关键字进行过滤" |
| | | /> |
| | | </el-col> |
| | |
| | | ref="classTree" |
| | | :data="classTree" |
| | | :props="defaultProps" |
| | | default-expand-all |
| | | :default-expand-all="true" |
| | | :filter-node-method="filterNode" |
| | | @node-click="nodeClickHandler" |
| | | /> |
| | |
| | | <div class="library-table"> |
| | | <div class="table-header"> |
| | | <div class="search-bar"> |
| | | <el-radio-group v-model="radioValue"> |
| | | <el-radio-button label="0">全部</el-radio-button> |
| | | <el-radio-group v-model="radioValue" @change="getConditionTable"> |
| | | <!-- <el-radio-button label="0">全部</el-radio-button> --> |
| | | <el-radio-button v-for="item in conditionsOptions" :key="item.value" :label="item.value"> |
| | | {{ item.label }} |
| | | </el-radio-button> |
| | | </el-radio-group> |
| | | <el-checkbox v-model="isOut" :style="{'marginLeft':'12px'}">已过期</el-checkbox> |
| | | <el-checkbox v-model="isOut" @change="getExpireTable" :style="{'marginLeft':'12px'}">已过期</el-checkbox> |
| | | </div> |
| | | <div class="serve-btn"> |
| | | <!-- <el-button type="primary" icon="el-icon-plus">新增人员</el-button> --> |
| | |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" size="small" @click="openDetail(scope.row)">编辑</el-button> |
| | | <el-button type="text" size="small">删除</el-button> |
| | | <el-button type="text" size="small" @click="clickDelete(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <el-button @click="measureFormVisible = false">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <!-- 删除仪器弹出框 --> |
| | | <el-dialog |
| | | title="提示" |
| | | :visible.sync="deletedialogVisible" |
| | | width="30%" |
| | | :before-close="handleClose"> |
| | | <span>确定删除该仪器吗?</span> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="deletedialogVisible = false">取 消</el-button> |
| | | <el-button type="primary" @click="deleteInstrument">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { getClassifyList, getInstrumentList, |
| | | addInstrumentUser, addInstrument, getInstrumentDetail, |
| | | getEquipmentPointList, addEquipmentPoint, |
| | | getMetricalInformationList, changeInstrument, addMetricalInformation } from '@/api/laboratory/ledger' |
| | | getMetricalInformationList, changeInstrument, addMetricalInformation, deleteInstrument } from '@/api/laboratory/ledger' |
| | | import { parseTime } from '@/utils/index' |
| | | export default { |
| | | filters: { |
| | |
| | | userOpetions: [], |
| | | // 仪器状态配置项 |
| | | conditionsOptions: [ |
| | | { |
| | | label: '全部', |
| | | value: 0 |
| | | }, |
| | | { |
| | | label: '运行', |
| | | value: 1 |
| | |
| | | addClassVisible: false, |
| | | // 控制新增计量模态框显示 |
| | | measureFormVisible: false, |
| | | // 控制删除仪器模态框显示 |
| | | deletedialogVisible: false, |
| | | // 控制添加修改仪器抽屉的显示 |
| | | addDrawerVisible: false, |
| | | // 添加修改仪器参数对象 |
| | |
| | | // 码点表格的状态:数据展示false/新增输入true |
| | | codePointesTableStatus: false, |
| | | // 设备详情对象 |
| | | equipmentDetail: {} |
| | | equipmentDetail: {}, |
| | | // 过滤关键字 |
| | | filterText: '', |
| | | // 过滤后的仪器设备表 |
| | | filterdequipmentTable: '', |
| | | oldtableData: '', |
| | | // 过滤不同状态设备 |
| | | conditionTable: '', |
| | | nodeclicked: '', |
| | | expireData: '', |
| | | instrumentId: '' |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | }, |
| | | // 节点点击处理 |
| | | nodeClickHandler(data, node, element) { |
| | | console.log(data) |
| | | this.nodeclicked = data |
| | | // console.log(data) |
| | | // 只有数据中携带id才能发送查询请求 |
| | | if (data.id) { |
| | | this.getEquipmentTable({ classifyId: data.id, pageSize: this.pageSize, pageNo: this.currentPage }) |
| | | this.getEquipmentTable({ classifyId: data.id, pageSize: this.pageSize, pageNo: this.currentPage, whetherWhether: this.isOut }) |
| | | } |
| | | }, |
| | | // 获取仪器列表数据 |
| | | async getEquipmentTable(ages) { |
| | | // console.log('条件对象', ages) |
| | | const { data } = await getInstrumentList(ages) |
| | | // console.log(data) |
| | | console.log(data) |
| | | this.equipmentTable = data.row |
| | | this.total = data.total |
| | | this.oldtableData = this.equipmentTable |
| | | }, |
| | | // 过滤节点 |
| | | filterNode(value, data) { |
| | |
| | | handleUpload(file, fileList) { |
| | | // console.log(file, fileList) |
| | | this.measureForm.file = file |
| | | }, |
| | | // 根据输入的设备编号,设备名称或者型号规格关键字进行过滤列表 |
| | | filterTableData() { |
| | | this.oldtableData = this.equipmentTable |
| | | const filterdequipmentTable = this.equipmentTable.filter(item => { |
| | | return item.equipment_code.includes(this.searchData.keyword) || item.equipment_name.includes(this.searchData.keyword) || item.specifications_models.includes(this.searchData.keyword) |
| | | }) |
| | | this.equipmentTable = filterdequipmentTable |
| | | }, |
| | | resetBtn() { |
| | | this.searchData.keyword = '' |
| | | this.equipmentTable = this.oldtableData |
| | | }, |
| | | getConditionTable() { |
| | | // console.log(this.radioValue) |
| | | let filteredTable = this.oldtableData.filter(item => { |
| | | return item.conditions === this.radioValue |
| | | }) |
| | | // 先判断isOut |
| | | if (this.isOut) { |
| | | // 如果现在勾选了已过期按钮,那就从当前过滤好的列表中筛选出过期列表 |
| | | if (this.expireData.length === 0) { |
| | | this.equipmentTable = null |
| | | } else { |
| | | let expireItem |
| | | for (expireItem of this.expireData) { |
| | | filteredTable = filteredTable.filter(item => { |
| | | return item.equipment_code === expireItem.equipment_code |
| | | }) |
| | | } |
| | | this.equipmentTable = filteredTable |
| | | } |
| | | if (!this.radioValue) { |
| | | this.equipmentTable = this.expireData |
| | | } |
| | | } else { |
| | | this.equipmentTable = filteredTable |
| | | if (!this.radioValue) { |
| | | this.equipmentTable = this.oldtableData |
| | | } |
| | | } |
| | | }, |
| | | async getExpireTable() { |
| | | // const filteredTable = this.oldtableData.filter(item => { |
| | | // return item.conditions === this.radioValue |
| | | // }) |
| | | if (this.isOut) { |
| | | // 捕获点击了已过期,请求过期数据并保存 |
| | | const { data } = await getInstrumentList({ classifyId: this.nodeclicked.id, pageSize: this.pageSize, pageNo: this.currentPage, whetherWhether: this.isOut }) |
| | | this.expireData = data.row |
| | | if (this.expireData.length === 0) { |
| | | this.equipmentTable = null |
| | | } else { |
| | | if (this.radioValue !== 0) { |
| | | let expireItem |
| | | for (expireItem of this.expireData) { |
| | | this.equipmentTable = this.oldtableData.filter(item => { |
| | | console.log(this.radioValue) |
| | | console.log('item', item) |
| | | console.log('expireItem', expireItem) |
| | | return item.conditions === this.radioValue && item.equipment_code === expireItem.equipment_code |
| | | }) |
| | | console.log(this.equipmentTable) |
| | | } |
| | | } else { |
| | | this.equipmentTable = this.expireData |
| | | } |
| | | } |
| | | } else { |
| | | // 捕获取消了已过期,将过期数据清空,重新更新equipmentTable |
| | | this.expireData = '' |
| | | this.equipmentTable = this.oldtableData.filter(item => { |
| | | return item.conditions === this.radioValue |
| | | }) |
| | | if (this.radioValue === 0) { |
| | | this.equipmentTable = this.oldtableData |
| | | } |
| | | } |
| | | }, |
| | | clickDelete(row) { |
| | | this.instrumentId = row.id |
| | | this.deletedialogVisible = true |
| | | }, |
| | | async deleteInstrument() { |
| | | // console.log(row.id) |
| | | await deleteInstrument({ instrumentId: this.instrumentId }) |
| | | this.deletedialogVisible = false |
| | | } |
| | | } |
| | | } |