王震
2023-12-27 b1dbfd44f6bafaa4d24e0c1c3a0f7ae548e77f60
src/views/product/workbench/productrecord-tab.vue
@@ -120,12 +120,12 @@
                  :show-overflow-tooltip="true"
                >
                  <template slot="header" slot-scope="scope">
                    <div style="line-height: 14px;">SN号</div>
                    <div style="line-height: 14px;">批次号</div>
                    <div class="th" @click.stop>
                      <template>
                        <el-input
                          type="text"
                          placeholder="SN号"
                          placeholder="批次号"
                          v-model="searchContent.outBatchNo"
                          clearable
                          size="mini"
@@ -280,7 +280,7 @@
                </el-table-column>
              </el-table>
            </el-tab-pane>
            <el-tab-pane label="附件">
            <!-- <el-tab-pane label="附件">
              <el-upload
                ref="upload"
                action="/mes/operationTask/upload"
@@ -292,7 +292,7 @@
                :auto-upload="false"
                list-type="picture"
              ></el-upload>
            </el-tab-pane>
            </el-tab-pane> -->
          </el-tabs>
        </div>
      </div>
@@ -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()
              })