| | |
| | | |
| | | <template> |
| | | <div class="role_manage"> |
| | | <div> |
| | | <div v-if="!showData"> |
| | | <el-row class="title"> |
| | | <el-col :span="12" style="padding-left: 20px;">设备工具明细</el-col> |
| | | <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" type="primary" @click="dialogVisible2 = true">新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div class="search"> |
| | | <div class="search" v-if="!showData"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">状态:</div> |
| | | <el-select v-model="componentData.entity.deviceStatus" placeholder="全部" size="small"> |
| | |
| | | <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | | <div class="table" v-if="!showData"> |
| | | <!-- 语法 子组件通过 this.$emit +传入方法名 调用父组件方法 例如 this.$emit(selectAllByOne) 就需在父组件声明并传入 @selectAllByOne="selectAllByOne"--> |
| | | <ValueTable @selectAllByOne="selectAllByOne" @isUpdate="isUpdate" ref="ValueTable" |
| | | :url="$api.deviceScope.selectDeviceParameter" :upUrl="$api.deviceScope.upDeviceParameter" |
| | |
| | | </el-col> |
| | | <!-- 右边布局 --> |
| | | <el-col :span="7"> |
| | | <el-form :label-position="labelPosition" :model="formData" label-width="120px" ref="ruleForm"> |
| | | <el-form :label-position="labelPosition" :model="formData" label-width="140px" ref="ruleForm"> |
| | | <!-- 实验室列表 --> |
| | | <el-form-item label="所属部门:"> |
| | | <el-select :disabled="isUp" v-model="formData.subordinateDepartmentsId" placeholder="请选择" size="small" style="width:100%"> |
| | |
| | | v-model="configForm.y"></el-input> |
| | | </div> |
| | | <div class="search_thing"> |
| | | <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>公式:</div> |
| | | <div class="search_label">公式:</div> |
| | | <el-input size="small" placeholder="请输入" clearable |
| | | v-model="configForm.formula"></el-input> |
| | | </div> |
| | |
| | | </el-row> |
| | | </span> |
| | | </el-dialog> |
| | | <dataAcquisitionConfig v-if="showData" :deviceId="deviceId"/> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import ValueTable from '../tool/value-table.vue' |
| | | import dataAcquisitionConfig from '../do/b6-device-management/b6-data-acquisition-config.vue' |
| | | export default { |
| | | components: { |
| | | ValueTable |
| | | ValueTable, |
| | | dataAcquisitionConfig |
| | | }, |
| | | data() { |
| | | return { |
| | | deviceId: '', |
| | | fileTypeOptions: [ |
| | | {label: 'csv', value: '.csv'}, |
| | | {label: 'db', value: '.db'}, |
| | | {label: 'mdb', value: '.mdb'}, |
| | | {label: 'word', value: '.docx'}, |
| | | {label: 'excel', value: '.xlsx'}, |
| | | {label: 'txt', value: '.txt'}, |
| | | {label: 'png', value: '.png'}, |
| | | ], |
| | | //是否是档案修订 true不是 false是 |
| | | isUp: true, |
| | | formData: { |
| | |
| | | dialogVisible: false, |
| | | dialogVisible2: false, |
| | | addPower: false, |
| | | showData: false, // 数采配置页面 |
| | | tableList: [], |
| | | componentData: { |
| | | entity: { |
| | | deviceStatus: null, |
| | |
| | | largeCategory: null, |
| | | orderBy: { |
| | | field: 'id', |
| | | order: 'desc' |
| | | order: 'asc' |
| | | } |
| | | }, |
| | | isIndex: true, |
| | |
| | | font: '档案修订', |
| | | type: 'text', |
| | | method: 'isUpdate' |
| | | }, { |
| | | id: 'handleConfig', |
| | | font: '数采配置', |
| | | type: 'text', |
| | | method: 'handleConfig' |
| | | }], |
| | | } |
| | | // , { |
| | | // id: 'handleConfig', |
| | | // font: '数采配置', |
| | | // type: 'text', |
| | | // method: 'handleConfig', |
| | | // disabFun: (row, index) => { |
| | | // return row.insProductItem === '' |
| | | // } |
| | | // } |
| | | ], |
| | | headNoShow:['enDeviceName'], |
| | | tagField: { |
| | | deviceStatus: { |
| | | select: [] |
| | |
| | | } |
| | | }, |
| | | requiredAdd: [], |
| | | requiredUp: [] |
| | | requiredUp: [], |
| | | needSort: ['deviceName', 'acquisitionDate', 'activationDate', 'lastCalibrationDate', 'nextCalibrationDate', 'deviceStatus'], |
| | | }, |
| | | entityCopy: {}, |
| | | upIndex: 0, |
| | |
| | | this.subordinateDepartmentsList = data |
| | | }) |
| | | }, |
| | | refreshTable() { |
| | | this.$refs['ValueTable'].selectList() |
| | | refreshTable(e) { |
| | | this.$refs['ValueTable'].selectList(e) |
| | | }, |
| | | refresh() { |
| | | this.componentData.entity = this.HaveJson(this.entityCopy) |
| | |
| | | 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 == 'addDeviceParameter') { |
| | | add = true |
| | | } |
| | | if (power[i].menuMethod == 'saveDataAcquisitionConfiguration') { |
| | | config = true |
| | | } |
| | | } |
| | | if (!up) { |
| | | this.componentData.do.splice(1, 1) |
| | | } |
| | | if (!del) { |
| | | this.componentData.do.splice(0, 1) |
| | | } |
| | | this.addPower = add |
| | | }, |
| | | // 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.$axios.post(this.$api.enums.selectEnumByCategory, { |
| | |
| | | this.componentData.tagField.insProductIds.select = [...this.componentData.tagField.insProductIds.select,...children] |
| | | this.componentData.selectField.insProductIds.select = [...this.componentData.selectField.insProductIds.select,...children] |
| | | return m |
| | | }) |
| | | this.options.forEach(item=>{ |
| | | if(item.children.length==0){ |
| | | item.children = null; |
| | | }else{ |
| | | item.children.forEach(m=>{ |
| | | if(m.children.length==0){ |
| | | m.children = null; |
| | | }else{ |
| | | m.children.forEach(n=>{ |
| | | if(n.children&&n.children.length==0){ |
| | | n.children = null; |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | |
| | | this.formData.imageName = response.data.name; |
| | | } |
| | | }, |
| | | handleSuccessUpImg2(response, ) { |
| | | handleSuccessUpImg2(response) { |
| | | if (response.code == 200) { |
| | | this.$nextTick(() => { |
| | | this.formData.imageUpload = response.data.url; |
| | | this.formData.imageName = response.data.name; |
| | | this.formData2.imageUpload = response.data.url; |
| | | this.formData2.imageName = response.data.name; |
| | | }) |
| | |
| | | delete this.formData.updateTime |
| | | delete this.formData.createUser |
| | | delete this.formData.updateUser |
| | | this.formData.insProductIds = this.formData.insProductIds.join() |
| | | this.formData.insProductIds = this.formData.insProductIds?this.formData.insProductIds.join():'' |
| | | this.upLoad = true; |
| | | this.$axios.post(this.$api.deviceScope.upDeviceParameter, this.formData, { |
| | | headers: { |
| | |
| | | } |
| | | this.$message.success('修改成功') |
| | | this.upLoad = false |
| | | this.refreshTable() |
| | | this.refreshTable('page') |
| | | this.dialogVisible = false |
| | | }).catch(e => { |
| | | this.$message.error('修改失败') |
| | |
| | | this.$message.error('未输入启用日期') |
| | | return |
| | | } |
| | | if(!this.formData2.deviceStatus){ |
| | | if(this.formData2.deviceStatus==='' || this.formData2.deviceStatus===null){ |
| | | this.$message.error('未选择当前状态') |
| | | return |
| | | } |
| | |
| | | return |
| | | } |
| | | this.upLoad2 = true; |
| | | this.formData2.insProductIds = this.formData2.insProductIds.join() |
| | | this.formData2.insProductIds = this.formData2.insProductIds?this.formData2.insProductIds.join():'' |
| | | this.$axios.post(this.$api.deviceScope.addDeviceParameter, this.formData2, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | |
| | | } |
| | | this.$message.success('提交成功') |
| | | this.upLoad2 = false |
| | | this.refreshTable() |
| | | this.refreshTable('page') |
| | | this.dialogVisible2 = false |
| | | this.formData2 = { |
| | | imageUpload: '', |
| | |
| | | }) |
| | | }, |
| | | handleConfig(row){ |
| | | this.configForm = {} |
| | | this.dialogVisible3 = true |
| | | this.$axios.post(this.$api.deviceScope.getNumberCollect+'?id='+row.id).then(res => { |
| | | this.configForm = res.data |
| | | // this.configForm = {} |
| | | // this.dialogVisible3 = true |
| | | // this.$axios.post(this.$api.deviceScope.getNumberCollect+'?id='+row.id).then(res => { |
| | | // this.configForm = res.data |
| | | // }) |
| | | this.showData = true |
| | | const list = row.insProductItem.split(';') |
| | | let list2 = [] |
| | | list.map((item) => { |
| | | const obj = Object.assign({ |
| | | deviceId: row.id, |
| | | insProductItem: item, |
| | | }) |
| | | list2.push(obj) |
| | | }) |
| | | this.tableList = list2 |
| | | this.deviceId = row.id |
| | | }, |
| | | closeDataVue () { |
| | | this.showData = false |
| | | }, |
| | | submitForm3(){ |
| | | if(!this.configForm.ip){ |
| | |
| | | this.$message.error('请填写Y'); |
| | | return |
| | | } |
| | | if(!this.configForm.formula){ |
| | | this.$message.error('请填写公式'); |
| | | return |
| | | } |
| | | |
| | | this.upLoad3 = true |
| | | this.$axios.post(this.$api.deviceScope.numberCollect, this.configForm, { |
| | |
| | | return |
| | | } |
| | | this.$message.success('操作成功') |
| | | this.refreshTable() |
| | | this.refreshTable('page') |
| | | this.dialogVisible3 = false |
| | | }).catch(e => { |
| | | this.$message.error('操作失败') |