王震
2023-12-04 8afbe0b83915dc417cea62221782e7ce15c00c78
src/views/product/workbench/feed-form.vue
@@ -1,6 +1,7 @@
<template>
  <el-dialog
    width="40%"
    width="60%"
    top="5vh"
    title="投料"
    :visible.sync="innerVisible"
    append-to-body
@@ -15,17 +16,20 @@
          :key="tableKey"
          :data="dataList"
          border
          style="width: 100%;"
          height="400"
          style="width: 100%;overflow-y: scroll;"
          @cell-dblclick="dblhandleCurrentChange"
          show-summary
          :span-method="objectSpanMethod"
          :summary-method="getSummaries"
        >
          <el-table-column header-align="center" align="center" type="index" label="序号"></el-table-column>
          <el-table-column
            prop="partNo"
            header-align="center"
            align="center"
            label="零件编号"
            show-overflow-tooltip
          >
          </el-table-column>
          <el-table-column
@@ -33,6 +37,7 @@
            header-align="center"
            align="center"
            label="零件"
            show-overflow-tooltip
          >
          </el-table-column>
          <el-table-column
@@ -40,6 +45,7 @@
            header-align="center"
            align="center"
            label="批号"
            show-overflow-tooltip
          >
          </el-table-column>
          <!-- <el-table-column
@@ -72,7 +78,13 @@
            header-align="center"
            align="center"
            label="单位"
            show-overflow-tooltip
          >
          </el-table-column>
          <el-table-column prop="menu" label="操作"  header-align="center" align="center">
            <template scope="scope">
              <el-button type="text" icon="el-icon-circle-close" @click="cancelFeed(scope.$index,scope.row)">取消</el-button>
            </template>
          </el-table-column>
        </el-table>
      </div>
@@ -142,6 +154,12 @@
      password: null
    }
  },
  beforeUpdate(){
    this.$nextTick(()=>{
      this.objectSpanMethod()
      this.$refs.table.doLayout()
    })
  },
  directives: {
    focus: {
      inserted: function(el, option) {
@@ -162,6 +180,10 @@
    }
  },
  methods: {
    //投入取消按钮
    cancelFeed(index,row){
      this.dataList.splice(index,1)
    },
    confirmData() {
      if (this.password != null) {
        checkSubmitPassword({ password: this.password }).then((response) => {
@@ -286,16 +308,16 @@
      return reg.test(value)
    },
    objectSpanMethod() {
      setTimeout(() => {
      this.$nextTick(()=>{
        if (this.$refs.table.$el) {
          const current = this.$refs.table.$el
            .querySelector('.el-table__footer-wrapper')
            .querySelector('.el-table__footer')
          const cell = current.rows[0].cells
          // cell[1].style.display = 'none'
          cell[0].colSpan = '4'
          cell[0].colSpan = '6'
        }
      }, 50)
      })
    },
    getSummaries(param) {
      const { columns, data } = param
@@ -325,12 +347,19 @@
  },
  watch: {
    currshowlist() {
      this.innerVisible = this.currshowlist
      this.password = null
      if (this.currshowlist) {
        this.$nextTick(() => {})
      const _than = this
      _than.innerVisible = _than.currshowlist
      _than.password = null
      if (!_than.currshowlist) {
        _than.$nextTick(() => {
        })
      }
    }
    },
  },
  created(){
    this.$nextTick(()=>{
      this.objectSpanMethod()
    })
  },
  mounted() {}
}