| | |
| | | <div> |
| | | <div class="body" :style="{height:mainHeight+'px'}"> |
| | | |
| | | <div class="bodyTopButtonGroup"> |
| | | <div class="bodyTopButtonGroup" style="justify-content: space-between"> |
| | | <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button> |
| | | <el-button icon="el-icon-c-scale-to-original" @click="deviceTypeButton">设备类型</el-button> |
| | | <el-button icon="el-icon-document-copy" @click="deviceGroupButton">设备组</el-button> |
| | | <div style="display: flex"> |
| | | <el-button icon="el-icon-c-scale-to-original" @click="deviceTypeButton">设备类型</el-button> |
| | | <el-button icon="el-icon-document-copy" @click="deviceGroupButton">设备组</el-button> |
| | | </div> |
| | | |
| | | <!-- <el-button type="primary" icon="el-icon-upload2" @click="upload">导入</el-button>--> |
| | | </div> |
| | | |
| | |
| | | <el-form |
| | | ref="form" |
| | | :model="form" |
| | | label-width="80px" |
| | | label-width="100px" |
| | | inline |
| | | style="display: flex;justify-content: space-between" |
| | | > |
| | | <div class="elForm"> |
| | | <el-form-item label="设备编码" style=" display: flex;"> |
| | | <div class="elForm" style="justify-content: flex-start"> |
| | | <el-form-item label-width="70px" label="设备编码" style=" display: flex;"> |
| | | <el-input v-model="form.DeviceCode" placeholder="请输入" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="设备名称" style=" display: flex;"> |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item filterable label="设备类型" style="display: flex;"> |
| | | <el-form-item v-show="isExpandForm" label-width="70px" filterable label="设备类型" style="display: flex;"> |
| | | <el-select |
| | | v-model="form.DeviceType" |
| | | :popper-append-to-body="false" |
| | | style="width: 200px" |
| | | filterable |
| | | placeholder="请选择" |
| | | |
| | | @change="deviceTypeChange" |
| | | > |
| | | <!-- @focus="getDeviceTypeSelect"--> |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="设备组" style=" display: flex;"> |
| | | <el-form-item v-show="isExpandForm" label="设备组" style=" display: flex;"> |
| | | <el-select |
| | | v-model="form.DeviceGroup" |
| | | filterable |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </div> |
| | | <div style="display: flex;align-items: start;margin-top: 5px;"> |
| | | <div class="bodySearchReset" :style="{marginLeft:$store.state.app.sidebar.opened?'5%':'10%'}"> |
| | | <el-button type="primary" icon="el-icon-search" @click="search">查询</el-button> |
| | | <el-button type="info" icon="el-icon-refresh" @click="reset">重置</el-button> |
| | | </div> |
| | | </el-form> |
| | | <div |
| | | class="bodyTopFormExpand" |
| | | > |
| | | <svg-icon |
| | | v-show="mouseHoverType==='mouseout'" |
| | | style="cursor: pointer" |
| | | :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'" |
| | | @mouseenter="mouseHoverType=$event.type" |
| | | /> |
| | | <svg-icon |
| | | v-show="mouseHoverType==='mouseenter'" |
| | | style="cursor: pointer" |
| | | :icon-class="!isExpandForm?'doubleDown':'doubleUp'" |
| | | @click="isExpandForm=!isExpandForm" |
| | | @mouseout="mouseHoverType=$event.type" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="elTableDiv"> |
| | | <div class="elTableDiv" style="margin-top: 0;"> |
| | | <el-table |
| | | ref="tableDataRef" |
| | | :data="tableData" |
| | | border |
| | | :height="tableHeight+'px'" |
| | | class="tableFixed" |
| | | :height="isExpandForm?tableHeight:(tableHeight+40)+'px'" |
| | | highlight-current-row |
| | | :row-class-name="tableRowClassName" |
| | | :style="{width: 100+'%',height:(tableHeight-50)+'px'}" |
| | | :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}" |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="sortChange" |
| | |
| | | <el-table-column |
| | | prop="eqpgroup_name" |
| | | label="设备组" |
| | | show-tooltip-when-overflow |
| | | min-width="110" |
| | | sortable="custom" |
| | | /> |
| | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button @click="dialogVisibleCancel">取 消</el-button> |
| | | <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button> |
| | | <el-button |
| | | type="primary" |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | @click="dialogVisibleConfirm" |
| | | >确 定</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | |
| | | width="50" |
| | | label="序号" |
| | | prop="RowNum" |
| | | fixed |
| | | /> |
| | | <el-table-column |
| | | prop="code" |
| | |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input v-if="row.isVisible===1" v-model="row.code" placeholder="请输入" /> |
| | | <el-input v-if="row.isVisible===1" v-model="row.code" oninput="value=value.replace(/[^0-9a-zA-Z]/g,'')" placeholder="请输入" /> |
| | | <div v-else> {{ row.code }}</div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <el-table-column |
| | | width="50" |
| | | label="序号" |
| | | fixed |
| | | prop="RowNum" |
| | | /> |
| | | <el-table-column |
| | |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input v-if="row.isVisible===1" v-model="row.code" placeholder="请输入" /> |
| | | <el-input v-if="row.isVisible===1"v-model="row.code" oninput="value=value.replace(/[^0-9a-zA-Z]/g,'')" placeholder="请输入" /> |
| | | <div v-else> {{ row.code }}</div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | import Pagination from '@/components/Pagination' |
| | | import { |
| | | AddUpdateDeviceGroup, AddUpdateDeviceManger, |
| | | AddUpdateDeviceType, DeleteDeviceManger, DeleteDeviceType, |
| | | AddUpdateDeviceType, DeleteDeviceGroup, DeleteDeviceManger, DeleteDeviceType, |
| | | DeviceGroupSearch, |
| | | DeviceMangerSearch, |
| | | DeviceTypeSearch, |
| | |
| | | DeviceTypeSelectGroup, |
| | | WorkShopSelect, WorkShopSelectLine |
| | | } from '@/api/sbgl' |
| | | import { handleDatetime } from '@/utils/global' |
| | | import { handleDatetime, validateCode } from '@/utils/global' |
| | | |
| | | const SER_HZ = /^[\u4e00-\u9fa5]+$/ |
| | | export default { |
| | | name: 'SBQD', |
| | | components: { |
| | | Pagination |
| | | }, |
| | | data() { |
| | | const validateName = (rule, value, callback) => { |
| | | if (!value) { |
| | | return callback(new Error('请输入编码')) |
| | | } else { |
| | | if (SER_HZ.test(value)) { |
| | | return callback(new Error('编码不能为中文')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | } |
| | | return { |
| | | mouseHoverType: 'mouseout', |
| | | isExpandForm: false, |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | form: { |
| | |
| | | operation: '', |
| | | dialogFormRules: { |
| | | devicecode: [ |
| | | { required: true, validator: validateName, trigger: ['blur', 'change'] } |
| | | { required: true, validator: validateCode, trigger: ['blur', 'change'] } |
| | | ], |
| | | devicename: [ |
| | | { required: true, message: '请输入名称', trigger: ['blur', 'change'] } |
| | |
| | | DeleteDeviceManger({ devicecode: row.code }).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success('删除成功!') |
| | | if (this.form.page > 1 && this.tableData.length === 1) { |
| | | this.form.page-- |
| | | } |
| | | this.getDeviceMangerSearch() |
| | | } |
| | | }) |
| | |
| | | dialogVisibleConfirm() { |
| | | this.$refs.dialogForm.validate(valid => { |
| | | if (valid) { |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | const data = { |
| | | id: this.dialogForm.id, |
| | | devicecode: this.dialogForm.devicecode, |
| | |
| | | } |
| | | AddUpdateDeviceManger(data).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') |
| | | this.dialogVisible = false |
| | | this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!') |
| | | this.getDeviceMangerSearch() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | } else { |
| | | this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!') |
| | | } |
| | |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 85 |
| | | this.tableHeight = this.mainHeight - 240 |
| | | this.tableHeight = this.mainHeight - 245 |
| | | this.$refs.tableDataRef.doLayout() |
| | | // if (window.innerHeight < 769) { |
| | | // this.tableHeight = this.tableHeight - 50 |
| | | // } |
| | |
| | | DeleteDeviceType({ devicetypecode: row.code }).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success('删除成功!') |
| | | if (this.formDeviceType.page > 1 && this.DeviceTypeArray.length === 1) { |
| | | this.formDeviceType.page-- |
| | | } |
| | | this.getDeviceTypeSearchDialog() |
| | | } |
| | | }) |
| | |
| | | DeleteDeviceGroup({ devicegroupcode: row.code }).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success('删除成功!') |
| | | if (this.formDeviceGroup.page > 1 && this.DeviceGroupArray.length === 1) { |
| | | this.formDeviceGroup.page-- |
| | | } |
| | | this.getDeviceGroupSearchDialog() |
| | | } |
| | | }) |
| | |
| | | justify-content: center; |
| | | align-items: center; |
| | | } |
| | | |
| | | .tableFixed{ |
| | | ::v-deep .el-table__fixed-right{ |
| | | height: 100% !important; |
| | | } |
| | | ::v-deep .el-table__fixed{ |
| | | height: 100% !important; |
| | | } |
| | | } |
| | | </style> |
| | | <style> |
| | | |