zss
2023-12-11 c880739ec4cd5ede33b31eb98ad5f7628ea288e5
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,24 +16,28 @@
          :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
            prop="partDescription"
            prop="partName"
            header-align="center"
            align="center"
            label="零件描述"
            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) => {
@@ -197,7 +219,6 @@
    pullFeed() {
      var partNoList = []
      var partNoLists
      console.log('this.dataList', this.dataList)
      for (var i = 0; i < this.dataList.length; i++) {
        partNoLists = this.dataList[i].partNo
        partNoList.push(partNoLists)
@@ -205,13 +226,13 @@
      getCheckRawPart(partNoList).then((response) => {
        if (response.data.code === 0) {
          // 需要密码确认情况
          if (response.data.data.success === false) {
            this.messages = response.data.data.message
            this.onnerVisible = true
          } else {
          //if (response.data.data.success === false) {
          //  this.messages = response.data.data.message
          //  this.onnerVisible = true
          //} else {
            // 不需要密码 直接投料
            this.saveFeed()
          }
          //}
        }
      })
    },
@@ -286,16 +307,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 +346,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() {}
}