loulijun2021
2022-06-29 f8c92594757c7a3db7188bb384f4fd2fb841604a
src/views/sbgl/sbqd.vue
@@ -224,7 +224,7 @@
        <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"
@@ -289,6 +289,7 @@
      :visible.sync="DeviceTypeDialogVisible"
      width="50%"
      top="15vh"
      class="DeviceTypeDialogVisible"
      @close="handleCloseDeviceType"
    >
@@ -299,8 +300,8 @@
      <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"
@@ -385,7 +386,7 @@
        :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"
@@ -547,6 +548,7 @@
        status: '',
        ratio: ''
      },
      DeviceGroupDialogArr: [], // 设备组数组
      WorkLineArr: [], // 所属产线数组
      operation: '',
      dialogFormRules: {
@@ -626,7 +628,7 @@
    },
    // 设备类型改变时
    async deviceTypeChange(val) {
      this.form.DeviceType = val
      this.form.DeviceGroup = ''
      const { data: res } = await DeviceTypeSelectGroup({ eqptypecode: val })
      this.DeviceGroupArr = res
    },
@@ -670,10 +672,11 @@
      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
@@ -727,7 +730,7 @@
    // 对话框设备类型下拉选择改变时
    async devicetypecodeChange(val) {
      const { data: res } = await DeviceTypeSelectGroup({ eqptypecode: val })
      this.DeviceGroupArr = res
      this.DeviceGroupDialogArr = res
      this.dialogForm.devicegroupcode = ''
    },
    // 对话框取消
@@ -809,7 +812,8 @@
    },
    // 新增按钮
    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) {
@@ -854,7 +858,7 @@
    // 取消
    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)
        }
      })
@@ -884,7 +888,8 @@
    },
    // 新增
    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 }) {
@@ -958,7 +963,7 @@
    // 取消按钮
    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)
        }
      })