王震
2023-12-13 67da82f0b0c24df5f19bbfcfec63801d9ae902d8
src/views/product/workbench/productrecord-tab.vue
@@ -560,30 +560,25 @@
      //   dutyRecordId: this.isDutyFilter ? this.currentDutyRecord.id : null,
      //   workstationId: this.isWorkstationFilter ? this.workstationId : null
      // })
      // console.log(val, res)
      // this.productRecords = res.data.data
    },
    // 多选删除
    select(selection, row) {
      console.log(selection, row)
      const arr = []
      // this.idList = []
      selection.forEach((item) => {
        arr.push(item.id)
      })
      this.idList = [...new Set(arr)]
      console.log(this.idList)
    },
    // 全选删除
    selectAll(selection) {
      console.log(selection)
      const arr = []
      // this.idList = []
      selection.forEach((item) => {
        arr.push(item.id)
      })
      this.idList = [...new Set(arr)]
      console.log(this.idList)
    },
    async delAlls() {
      let isContinue = true
@@ -601,7 +596,6 @@
            isContinue = true
            // this.idList = []
            const res = await delAll(this.idList)
            console.log(res)
            this.getProductRecords()
            this.$message.success('删除成功!')
            this.idList = []
@@ -657,7 +651,6 @@
    },
    // 获取生产记录列表
    getProductRecords() {
      console.log(this.createDateRange)
      let templateJson
      if (this.createDateRange != null && this.createDateRange !== '') {
        templateJson = {
@@ -702,13 +695,11 @@
        item.toggleRowSelection(row)
      })
      const index = this.idList.indexOf(row.id)
      console.log(index)
      if (index >= 0) {
        this.idList.splice(index, 1)
      } else {
        this.idList.push(row.id)
      }
      console.log(this.idList)
      this.currProductRecordId = row.id
      this.paramValues = []
      var productRecordJson = {
@@ -745,7 +736,6 @@
    nextFocus(index) {
      index++
      this.$refs['reference_' + index].focus()
      // console.log(this.i)
    },
    // 删除某条生产记录
    delProductrecord(index, row) {
@@ -835,10 +825,8 @@
          //   JSON.stringify(paramValueArray)
          // )
          updateProductRecord(obj).then((response) => {
            console.log(this.idList)
            if (response.data.code === 0) {
              this.$message.success('修改成功')
              console.log(this.$refs.productRecordTable)
              this.$refs.productRecordTable.forEach((item) => {
                item.clearSelection()
              })