cuijian
2025-06-16 054ced58ea3a99a3a6774bf43c9fb794781f0651
src/views/tms/modules/outBound/OutboundDetailSelectList.vue
@@ -14,6 +14,26 @@
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'checkbox'}"
        @change="handleTableChange">
        <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index">
        <div :key="col.dataIndex">
          <a-input-number
            v-if="col.dataIndex === 'ratedLife'"
            :disabled="record.accuracyClass != '1'"
            :value="text"
            @change="(e) => handleChange(e, record.key, col, index)"
            :min="1"
          />
          <a-input-number
            v-if="col.dataIndex === 'useLife'"
            :disabled="record.accuracyClass != '1'"
            :value="text"
            @change="(e) => handleChange(e, record.key, col, index)"
            :min="1"
          />
        </div>
      </template>
        <span slot="action" slot-scope="text, record">
          <a @click="handleOutbound(record)">出库</a>
        </span>
@@ -101,6 +121,18 @@
            align:"left",
            dataIndex: 'outboundQuantity'
          },
          {
          title:'额定寿命',
          align:"center",
          dataIndex: 'ratedLife',
          scopedSlots: { customRender: 'ratedLife' },
        },
        {
          title:'使用寿命',
          align:"center",
          dataIndex: 'useLife',
          scopedSlots: { customRender: 'useLife' },
        },
          // {
          //   title:'已出库数量',
          //   align:"left",
@@ -193,7 +225,9 @@
          {
            outBoundOrderId: this.mainId,
            outboundDetailId: record.id,
            outboundQuantity: record.outboundQuantity
            outboundQuantity: record.outboundQuantity,
            ratedLife:record.ratedLife,
            useLife:record.useLife
          }
        ]
        postAction(this.url.outbound, params).then(res=>{
@@ -205,7 +239,17 @@
            this.$message
          }
        })
      }
      },
      handleChange(value, key, column, index) {
        console.log(value, key, column, index)
        const temp = [...this.dataSource]
        const target = temp.filter(item => key === item.key)[index];
        if (target) {
          target[column.dataIndex] = value
          this.dataSource = temp
        }
      },
    }
  }