diff --git a/canteen/components/wyb-table/wyb-table.vue b/canteen/components/wyb-table/wyb-table.vue index a6ae139..71dbd72 100644 --- a/canteen/components/wyb-table/wyb-table.vue +++ b/canteen/components/wyb-table/wyb-table.vue @@ -147,7 +147,13 @@ zIndex: hIndex === 0 ? 20 : 0, left: enableCheck ? checkColWidth + 'rpx' : 0, position: hIndex === 0 && firstLineFixed ? 'sticky' : 'static'}"> - + {{ autoContentItem(cIndex, hIndex) }} diff --git a/canteen/pages/delivery/apply.vue b/canteen/pages/delivery/apply.vue index c5a7394..0ebf0cb 100644 --- a/canteen/pages/delivery/apply.vue +++ b/canteen/pages/delivery/apply.vue @@ -17,7 +17,8 @@ @@ -68,6 +69,9 @@ },{ key: 'delivery_number', label: '出库数量' + },{ + key: 'operation', + label: '操作' }], contents: [], warehouse_list: {}, @@ -98,6 +102,7 @@ warehouse_list = JSON.parse(warehouse_list); for(let i in warehouse_list){ warehouse_list[i].delivery_number = {edit: true, value: warehouse_list[i].delivery_number || 1}; + warehouse_list[i].operation = {button: true, key: 'delete', value: '删除'}; contents.push(warehouse_list[i]); } this.contents = contents; @@ -149,6 +154,15 @@ console.log("检测到table input被更改", event); this.contents[event.contentIndex][event.key].value = event.detailValue; }, + // table操作按钮被点击 + onButtonClick(event){ + if(event.content.key == 'delete'){ + let order_id = event.lineData.order_id; + let material_index = event.lineData.contentIndex; + this.contents.splice(material_index, 1); + delete this.warehouse_list[order_id]; + } + }, // 保存,出库 save(_t){ console.log("dddddd", this.contents) diff --git a/supplier/components/wyb-table/wyb-table.vue b/supplier/components/wyb-table/wyb-table.vue index a6ae139..2737370 100644 --- a/supplier/components/wyb-table/wyb-table.vue +++ b/supplier/components/wyb-table/wyb-table.vue @@ -147,7 +147,13 @@ zIndex: hIndex === 0 ? 20 : 0, left: enableCheck ? checkColWidth + 'rpx' : 0, position: hIndex === 0 && firstLineFixed ? 'sticky' : 'static'}"> - + {{ autoContentItem(cIndex, hIndex) }}