VUE ant a-modal 传值

---------

<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,
           width: 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
    },

 

posted @ 2021-05-21 10:29  上帝视角  阅读(1982)  评论(0编辑  收藏  举报