| | |
| | | <div class="ledger-main"> |
| | | <div class="page-header-search"> |
| | | <div class="serve-btn"> |
| | | <el-button type="primary" icon="el-icon-plus" |
| | | <el-button size="small" type="primary" icon="el-icon-plus" |
| | | @click="showAddDrawer()">新增仪器</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="bom-item-search"> |
| | | <el-row> |
| | | <el-col :span="19"> |
| | | <el-input v-model="filterText" clearable placeholder="输入关键字进行过滤" /> |
| | | <el-input size="small" v-model="filterText" clearable placeholder="输入关键字进行过滤" /> |
| | | </el-col> |
| | | <el-col :span="5"> |
| | | <el-button type="primary" size="small" @click="addClassVisible = true"><i |
| | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form ref="form" :inline="true" :model="searchData"> |
| | | <el-form-item> |
| | | <el-input v-model="searchData.keyword" placeholder="请输入编号/设备名称/型号规格"> |
| | | <el-form-item width="200"> |
| | | <el-input size="small" v-model="searchData.keyword" placeholder="请输入编号/设备名称/型号规格"> |
| | | <i slot="prefix" class="el-input__icon el-icon-search" /> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="filterTableData">查询</el-button> |
| | | <el-button type="primary" plain @click="resetBtn">重置</el-button> |
| | | <el-button size="small" type="primary" @click="filterTableData">查询</el-button> |
| | | <el-button size="small" type="primary" plain @click="resetBtn">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-col> |
| | |
| | | }, |
| | | measureFormVisible(newVal){ |
| | | if(newVal === false){ |
| | | this.resetForm("addmeasureForm"); |
| | | this.cancelAddMeasure(); |
| | | } |
| | | } |
| | | }, |
| | |
| | | // 获取分类数据 |
| | | async getThreeData() { |
| | | const { data } = await getClassifyList() |
| | | // console.log(data) |
| | | this.classTree = data.map(item => { |
| | | if (item.children) { |
| | | item.children = item.children.map(childrenItem => { |
| | |
| | | const { data } = await getInstrumentDetail({ InstrumentId: row.id }) |
| | | this.equipmentDetail = data |
| | | this.equipmentform = data |
| | | console.log(this.equipmentform) |
| | | const { data: pointList } = await getEquipmentPointList({ InstrumentId: this.equipmentDetail.id }) |
| | | this.codePointsTable = pointList |
| | | const { data: informationList } = await getMetricalInformationList({ InstrumentId: this.equipmentDetail.id }) |
| | | this.measureTable = informationList |
| | | console.log(informationList) |
| | | }, |
| | | // 节点点击处理 |
| | | nodeClickHandler(data, node, element) { |
| | | this.nodeclicked = data |
| | | console.log(data) |
| | | // 只有数据中携带id才能发送查询请求 |
| | | if (data.id) { |
| | | 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) |
| | | this.equipmentTable = data.row |
| | | this.total = data.total |
| | |
| | | handleCurrentChange() { |
| | | // 当前页更改 |
| | | }, |
| | | // 显示设备码点 |
| | | addCodePoints() { |
| | | // 添加新码点,清空原数组 |
| | | this.codePointesTableStatus = true |
| | | }, |
| | | // 新增设备码点 |
| | | addNewCodePoints() { |
| | | console.log(this.equipmentDetail.id); |
| | | this.codePointesTableStatus = true; |
| | | const newObj = {} |
| | | newObj.isInput = true, |
| | |
| | | this.$refs[formName].resetFields(); |
| | | }, |
| | | cancelAddMeasure() { |
| | | this.$refs['upload'].clearFiles(); |
| | | this.measureForm.file = null; |
| | | this.measureFormVisible = false |
| | | this.resetForm('addmeasureForm'); |
| | | this.$refs['upload'].clearFiles(); |
| | | }, |
| | | // 添加计量信息 |
| | | async addMeasure() { |
| | |
| | | this.measureForm.beginDate = parseTime(this.measureForm.date[0], '{y}-{m}-{d}') |
| | | this.measureForm.endDate = parseTime(this.measureForm.date[1], '{y}-{m}-{d}') |
| | | } |
| | | console.log(this.measureForm) |
| | | const formData = new FormData() |
| | | if(this.measureForm.file == null || this.measureForm.file == ""){ |
| | | this.$message.warning("请选择要上传的文件!"); |
| | |
| | | }else{ |
| | | formData.append('file', this.measureForm.file?.raw, this.measureForm.file?.name) |
| | | } |
| | | console.log(this.measureForm) |
| | | for (const key in this.measureForm) { |
| | | console.log(key) |
| | | // if (key === 'file') return |
| | | formData.append(key, this.measureForm[key]) |
| | | } |
| | | console.log(formData) |
| | | try { |
| | | const { data } = await addMetricalInformation(formData) |
| | | console.log(data) |
| | | await addMetricalInformation(formData) |
| | | this.$message.success('添加成功') |
| | | const { data: informationList } = await getMetricalInformationList({ InstrumentId: this.equipmentDetail.id }) |
| | | this.measureTable = informationList |
| | |
| | | } |
| | | this.measureForm.file = null; |
| | | this.$refs['upload'].clearFiles(); |
| | | }else{ |
| | | console.log(32); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | this.codePointsTable = [] |
| | | this.measureTable = [] |
| | | this.measureForm.file = null; |
| | | this.$refs['upload'].clearFiles(); |
| | | }, |
| | | // 关闭添加修改设备抽屉 |
| | | closeAddOrChangeDrawer() { |
| | |
| | | }, |
| | | // 文件上传 |
| | | handleUpload(file, fileList) { |
| | | console.log(file, fileList) |
| | | this.measureForm.file = file |
| | | }, |
| | | // 根据输入的设备编号,设备名称或者型号规格关键字进行过滤列表 |
| | |
| | | this.equipmentTable = this.oldtableData |
| | | }, |
| | | getConditionTable() { |
| | | // console.log(this.radioValue) |
| | | let filteredTable = this.oldtableData.filter(item => { |
| | | return item.conditions === this.radioValue |
| | | }) |
| | |
| | | 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 |