loulijun2021
2022-08-31 d105bd9dd591264a7b1f79f1fdbbf0e764ff073e
src/views/sbgl/djbz.vue
@@ -58,6 +58,7 @@
          <el-table-column
            prop="RowNum"
            width="50"
            fixed
            label="序号"
          />
          <el-table-column
@@ -164,7 +165,7 @@
    >
      <!--      @close="handleClose"-->
      <div>
        <i class="el-icon-s-operation" style="color:#42b983;margin: -20px 10px 20px 0" />设备点检标准信息
        <i class="el-icon-s-operation" style="color:#42b983;margin: -20px 10px 20px 0" />设备点检标准信息:
      </div>
      <div style="margin: 0 30px;">
        <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
@@ -480,7 +481,7 @@
        code: '',
        name: '',
        enable: 'Y',
        description: ''// 上级单位
        description: ''
      },
      operation: '',
      dialogFormRules: {
@@ -529,19 +530,25 @@
    }
  },
  created() {
    this.getDeviceCheckStandArdSearch()
    this.handleRequest()
  },
  mounted() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
    this.getDeviceCheckItemSelect()
  },
  methods: {
    handleRequest() {
      this.getDeviceCheckStandArdSearch().then(res => {
        if (res.code === '200') {
          this.getDeviceCheckItemSelect()
        }
      })
    },
    async getDeviceCheckStandArdSearch() {
      const res = await DeviceCheckStandArdSearch(this.form)
      this.tableData = res.data
      this.total = res.count
      return { code: res.code }
    },
    // 排序改变时
    sortChange({ column, prop, order }) {
@@ -636,6 +643,9 @@
        DeleteDeviceCheckStaned({ checkstand_code: row.code }).then(res => {
          if (res.code === '200') {
            this.$message.success('删除成功!')
            if (this.form.page > 1 && this.tableData.length === 1) {
              this.form.page--
            }
            this.getDeviceCheckStandArdSearch()
          }
        })
@@ -822,7 +832,7 @@
      this.dialogFormEqp.code = row.code
      const { data: res } = await DeviceCheckStanedAssociationEqp({ checkstand_code: row.code })
      this.dialogFormEqp.eqpAll = res
      this.dialogFormEqp.eqpAll = res.filter(item => item.children.length > 0)
      if (this.dialogFormEqp.eqpAll.length > 0) {
        this.dialogFormEqp.eqpAll.forEach((item, index) => {
@@ -874,6 +884,9 @@
          this.dialogFormEqp.eqpAll[index].name = '全部'
          this.dialogFormEqp.eqpTree = [this.dialogFormEqp.eqpAll[index]]
        }
      })
      this.$nextTick(() => { // 树形回显
        this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr)
      })
    },
    // 小盒子点击
@@ -954,7 +967,7 @@
        })
        this.dialogFormEqp.eqpCodeSelectedArr = [...new Set(this.dialogFormEqp.eqpCodeSelectedArr)]
      }
      console.log(this.dialogFormEqp.eqpCodeSelectedArr, 666)
      // 2.第二种情况当树形   半叶 为零   全叶 为零
      if (halfCheckedKeys.length === 0 && checkedKeys.length === 0) {
        console.log('// 2.第二种情况当树形   半叶 为零   全叶 为零')