| | |
| | | <el-form-item label="设备组" prop="devicegroupcode"> |
| | | <el-select v-model="dialogForm.devicegroupcode" :popper-append-to-body="false" :disabled="dialogForm.devicetypecode===''" style="width: 220px" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in DeviceGroupArr" |
| | | v-for="item in DeviceGroupDialogArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | |
| | | :visible.sync="DeviceTypeDialogVisible" |
| | | width="50%" |
| | | top="15vh" |
| | | |
| | | class="DeviceTypeDialogVisible" |
| | | @close="handleCloseDeviceType" |
| | | > |
| | |
| | | <el-table |
| | | :data="DeviceTypeArray" |
| | | border |
| | | height="400" |
| | | highlight-current-row |
| | | :style="{width: 100+'%',height:tableHeight-300+'px'}" |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="sortChangeOfDeviceType" |
| | |
| | | :data="DeviceGroupArray" |
| | | border |
| | | highlight-current-row |
| | | :style="{width: 100+'%',height:tableHeight-300+'px'}" |
| | | height="400" |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="sortChangeOfDeviceGroup" |
| | |
| | | status: '', |
| | | ratio: '' |
| | | }, |
| | | DeviceGroupDialogArr: [], // 设备组数组 |
| | | WorkLineArr: [], // 所属产线数组 |
| | | operation: '', |
| | | dialogFormRules: { |
| | |
| | | }, |
| | | // 设备类型改变时 |
| | | async deviceTypeChange(val) { |
| | | this.form.DeviceType = val |
| | | this.form.DeviceGroup = '' |
| | | const { data: res } = await DeviceTypeSelectGroup({ eqptypecode: val }) |
| | | this.DeviceGroupArr = res |
| | | }, |
| | |
| | | this.dialogVisible = true |
| | | }, |
| | | // 修改按钮 |
| | | edit(operation, row) { |
| | | async edit(operation, row) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | // console.log(row) |
| | | await this.devicetypecodeChange(row.eqptype_code) |
| | | await this.workshopcodeChange(row.wksp_code) |
| | | this.$nextTick(() => { |
| | | this.dialogForm.id = row.id |
| | | this.dialogForm.devicecode = row.code |
| | |
| | | // 对话框设备类型下拉选择改变时 |
| | | async devicetypecodeChange(val) { |
| | | const { data: res } = await DeviceTypeSelectGroup({ eqptypecode: val }) |
| | | this.DeviceGroupArr = res |
| | | this.DeviceGroupDialogArr = res |
| | | this.dialogForm.devicegroupcode = '' |
| | | }, |
| | | // 对话框取消 |
| | |
| | | }, |
| | | // 新增按钮 |
| | | addDeviceType() { |
| | | this.DeviceTypeArray.unshift({ code: '', name: '', group: '', remark: '', isVisible: 1 }) |
| | | const number = Math.random() * Math.random()// 作为删除时的标识符 |
| | | this.DeviceTypeArray.unshift({ code: '', name: '', group: '', remark: '', isVisible: 1, number: number }) |
| | | }, |
| | | // 删除 |
| | | DeviceTypeDel(row) { |
| | |
| | | // 取消 |
| | | DeviceTypeCancel(row) { |
| | | this.DeviceTypeArray.forEach((item, index) => { |
| | | if (item.isVisible === 1 && item.code === row.code) { |
| | | if (item.isVisible === 1 && item.number === row.number) { |
| | | this.DeviceTypeArray.splice(index, 1) |
| | | } |
| | | }) |
| | |
| | | }, |
| | | // 新增 |
| | | addDeviceGroup() { |
| | | this.DeviceGroupArray.unshift({ code: '', name: '', eqptype_code: '', eqptype_name: '', remark: '', isVisible: 1 }) |
| | | const number = Math.random() * Math.random()// 作为删除时的标识符 |
| | | this.DeviceGroupArray.unshift({ code: '', name: '', eqptype_code: '', eqptype_name: '', remark: '', isVisible: 1, number: number }) |
| | | }, |
| | | // 排序 |
| | | sortChangeOfDeviceGroup({ column, prop, order }) { |
| | |
| | | // 取消按钮 |
| | | DeviceGroupCancel(row) { |
| | | this.DeviceGroupArray.forEach((item, index) => { |
| | | if (item.isVisible === 1 && item.code === row.code) { |
| | | if (item.isVisible === 1 && item.number === row.number) { |
| | | this.DeviceGroupArray.splice(index, 1) |
| | | } |
| | | }) |