| | |
| | | <!-- 设备工具明细 --> |
| | | <template> |
| | | <div class="role_manage"> |
| | | <div class="search" v-show="!showData"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">状态:</div> |
| | | <el-select v-model="queryParams.deviceStatus" placeholder="全部" size="small"> |
| | | <el-option v-for="item in deviceStatusList" :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-input size="small" placeholder="请输入" clearable v-model="queryParams.deviceName" |
| | | @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="queryParams.specificationModel" @keyup.enter.native="refreshTable()"></el-input> |
| | | </div> |
| | | </div> |
| | | <div style="padding-left: 30px;"> |
| | | <el-button size="small" @click="refresh()">重 置</el-button> |
| | | <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button> |
| | | <el-button size="small" type="primary" @click="dialogVisible2 = true">新 增</el-button> |
| | | <el-button size="small" type="primary" @click="handleDownOne">导 出</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="search" v-show="!showData"> |
| | | <div> |
| | | <el-form :model="queryParams" ref="queryParams" size="small" :inline="true"> |
| | | <el-form-item label="状态" prop="deviceStatus" class="form-item"> |
| | | <el-select v-model="queryParams.deviceStatus" clearable |
| | | placeholder="全部" size="small" @change="refreshTable"> |
| | | <el-option v-for="item in deviceStatusList" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="设备名称" prop="deviceName"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="queryParams.deviceName" |
| | | @keyup.enter.native="refreshTable()"> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="管理编号" prop="managementNumber"> |
| | | <el-input size="small" placeholder="请输入" clearable |
| | | v-model="queryParams.managementNumber" @keyup.enter.native="refreshTable()"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" size="mini" @click="refreshTable">查询</el-button> |
| | | <el-button size="mini" @click="refresh">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div> |
| | | <el-button size="small" type="primary" @click="dialogVisible2 = true">新增</el-button> |
| | | <el-button size="small" type="primary" @click="handleDownOne">导出</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table" v-show="!showData"> |
| | | <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 320px)'" |
| | | :page="page" @pagination="pagination"></lims-table> |
| | | <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 300px)'" |
| | | :page="page" @pagination="pagination" :row-class-name="tableRowClassName"></lims-table> |
| | | </div> |
| | | <el-dialog :title="isUp ? '设备详情' : '档案修订'" :visible.sync="dialogVisible" width="70%" top="5vh" |
| | | :before-close="handleClose"> |
| | |
| | | labelPosition: 'right', |
| | | dialogVisible: false, |
| | | dialogVisible2: false, |
| | | addPower: false, |
| | | showData: false, // 数采配置页面 |
| | | tableList: [], |
| | | addDia: true, |
| | | addPower: true, |
| | | //设备类型列表 |
| | | equipmentList: [], |
| | | // 负责人列表 |
| | |
| | | { label: "管理编号", prop: "managementNumber" }, |
| | | { label: "技术指标", prop: "technicalIndicators" }, |
| | | { label: "购置日期", prop: "acquisitionDate" }, |
| | | { label: "启用日期", prop: "activationDate" }, |
| | | { label: "校准有效期", prop: "activationDate" }, |
| | | { label: "管理人", prop: "equipmentManagerUser" }, |
| | | { label: "存放点", prop: "storagePoint" }, |
| | | { label: "所属部门", prop: "laboratoryName" }, |
| | |
| | | { |
| | | label: "设备分类", prop: "largeCategory", dataType: "tag", |
| | | formatData: (params) => { |
| | | return this.equipmentList.find(m => m.value == params).label |
| | | if (this.equipmentList.find(m => m.value == params)) { |
| | | return this.equipmentList.find(m => m.value == params).label |
| | | } else { |
| | | return null |
| | | } |
| | | }, |
| | | formatType: (params) => { |
| | | return this.equipmentList.find(m => m.value == params).type |
| | | if (this.equipmentList.find(m => m.value == params)) { |
| | | return this.equipmentList.find(m => m.value == params).type |
| | | } else { |
| | | return null |
| | | } |
| | | } |
| | | }, |
| | | { label: "单价", prop: "unitPrice" }, |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | // this.entityCopy = this.HaveJson(this.componentData.entity) |
| | | // this.getPower() |
| | | this.selectEnumByCategory() |
| | | this.selectDevicePrincipal() |
| | | this.obtainItemParameterList() |
| | | this.getInsProductIds() |
| | | // this.$customEvents.$on('largeCategory', this.handleNotification); |
| | | // 初始化 |
| | | this.clickSidebar(this.clickNodeVal) |
| | | }, |
| | |
| | | this.page.size = limit; |
| | | this.getList(); |
| | | }, |
| | | tableRowClassName({ row }) { |
| | | const today = new Date(); |
| | | const targetDate = new Date(row.activationDate); |
| | | const fiveDaysBeforeTarget = new Date(targetDate); |
| | | // 计算前五天的日期 |
| | | fiveDaysBeforeTarget.setDate(targetDate.getDate() - 5); |
| | | // 比较时需要确保比较的是完整的日期时间,包含时分秒 |
| | | if (today > fiveDaysBeforeTarget) { |
| | | return 'red-row'; |
| | | } |
| | | return ''; |
| | | }, |
| | | refresh() { |
| | | this.queryParams = {}; |
| | | this.page.current = 1; |
| | |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '设备仪器一览表.doc') |
| | | }) |
| | | }, |
| | | // 权限分配 |
| | | getPower(radio) { |
| | | let power = JSON.parse(sessionStorage.getItem('power')) |
| | | let up = false |
| | | let del = false |
| | | let add = false |
| | | let config = 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 (power[i].menuMethod == 'saveDataAcquisitionConfiguration') { |
| | | config = true |
| | | } |
| | | } |
| | | if (!config) { |
| | | this.componentData.do.splice(2, 1) |
| | | } |
| | | if (!up) { |
| | | this.componentData.do.splice(1, 1) |
| | | } |
| | | if (!del) { |
| | | this.componentData.do.splice(0, 1) |
| | | } |
| | | this.addPower = add |
| | | }, |
| | | // 获取字典 |
| | | selectEnumByCategory() { |
| | |
| | | } |
| | | this.upLoad = true; |
| | | upDeviceParameter(formData).then(res => { |
| | | if (res.code === 201) { |
| | | this.upLoad = false |
| | | return |
| | | } |
| | | this.$message.success('修改成功') |
| | | this.upLoad = false |
| | | this.refreshTable('page') |
| | |
| | | } |
| | | this.upLoad2 = true; |
| | | addDeviceParameter(formData).then(res => { |
| | | if (res.code === 201) { |
| | | this.upLoad2 = false |
| | | return |
| | | } |
| | | this.$message.success('提交成功') |
| | | this.upLoad2 = false |
| | | this.refreshTable('page') |
| | |
| | | this.upLoad3 = true |
| | | numberCollect(this.configForm).then(res => { |
| | | this.upLoad3 = false |
| | | if (res.code === 201) { |
| | | return |
| | | } |
| | | this.$message.success('操作成功') |
| | | this.refreshTable('page') |
| | | this.dialogVisible3 = false |
| | |
| | | }) |
| | | .then(() => { |
| | | delDeviceParameter({ id: row.id }).then((res) => { |
| | | if (res.code == 201) return; |
| | | this.$message.success("删除成功"); |
| | | this.refresh(); |
| | | }); |
| | |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .role_manage { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | |
| | | .title { |
| | | line-height: 15px; |
| | | } |
| | | |
| | | .search { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-top: 10px; |
| | | height: 46px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .search_thing { |
| | |
| | | text-align: right; |
| | | } |
| | | |
| | | .search_input { |
| | | width: calc(100% - 80px); |
| | | } |
| | | |
| | | .table { |
| | | margin-top: 12px; |
| | | background-color: #fff; |
| | | height: calc(100vh - 17em); |
| | | height: calc(100vh - 16em); |
| | | } |
| | | |
| | | .el-form-item { |
| | | margin-bottom: 16px; |
| | | } |
| | | |
| | | .picName { |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | |
| | | word-break: break-all; |
| | | width: 120px; |
| | | } |
| | | .form-item >>>.el-form-item__content { |
| | | width: 120px; |
| | | } |
| | | </style> |