子
---------
<a-modal :title="title" :width="880" :visible="visible" :confirmLoading="confirmLoading" @ok="handleOk" @cancel="handleCancel" ></a>
handleOk () { const _this = this if (this.selectedRowKeys.length === 0) { this.$message.error('至少选择一个入库板材') } else { var objs = this.$refs.table.localDataSource var obj = objs.find(item => item.id === this.curExpandedRowKeys[0]) var slectlist = [] console.log(this.selectedRowKeys, this.curExpandedRowKeys) for (let i = 0; i < this.selectedRowKeys.length; i++) { slectlist.push(this.innerData[this.selectedRowKeys[i]]) } obj.slectlist = slectlist this.$emit('ok', obj) _this.close() } },
父
<select-purchase-modal ref="selectModal" @ok="handleOk" />
handleOk (e) { console.log(e, 12122) this.stockInOrder = e this.stockInOrder.materialPurchaseOrderCode = e.code this.stockInOrder.code = '' this.stockInOrder.totalQuantity = 0 this.orderDetailList = [] for (const key in this.stockInOrder.details) { this.stockInOrder.totalQuantity += key.quantity this.orderDetailList.push({ materialTextureName: key.materialTextureName, materialTextureId: key.materialTextureId, length: key.realPurchaseLength, key.realPurchaseWidth, thickness: key.thickness, quantity: key.quantity, materialPurchaseOrderDetailId: key.id, marketPrice: key.marketPrice, processCost: key.processCost, positionName: '', WareHouseName: '' }) } this.details = this.orderDetailList // this.stockInOrder.details },