

<template>
<Mask :width="800" :height="600" :is-show="show">
  <CloseBtn @click="show = false"></CloseBtn>
  <div class="table">
    <el-table :data="tableData"  style="width: 100%">
      <el-table-column prop="createTime" label="创建时间"></el-table-column>
      <el-table-column prop="goodsName" label="商品"></el-table-column>
      <el-table-column prop="totalPrice" label="应收金额"></el-table-column>
      <el-table-column  label="操作">
        <template #default="scope">
          <el-button type="primary" @click="ladingBill(scope.row)">提单</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</Mask>
</template>
<script setup lang="ts">

import Mask from "@/components/Mask.vue";
import {ref} from "vue";
import {post} from "@/utils/request.ts";
import CloseBtn from "@/components/CloseBtn.vue";
const show = ref(false)
const tableData = ref<any>([])
const emit = defineEmits(['ladingBill'])
const getBillList = () => {
    post("retail/regis/list").then((res: any) => {
      tableData.value = res
      tableData.value.forEach((item:any)=>{
        item.data = JSON.parse(item.data)
      })
    })
}
const ladingBill = (row:any)=>{
  emit('ladingBill',row)
  show.value = false
}
const init = () => {
    show.value = true
    getBillList()
}
defineExpose({init})
</script>
<style scoped lang="scss">
.table{
  margin-top: 30px;
}

</style>