<script setup lang="ts">
import { getSeqInInfo } from "@/views/flow/common/CheckTopInfos/utils";
import { useCommonStoreHook, useDictionaryStore } from "@/store";
import { useScreenshot } from "@/views/base/craftManagement/route/screenshot.ts";
import { useLayout } from "@/hooks/useLayout";

const infoObj = ref({});

const props = defineProps({
  row: {
    type: Object,
    required: true,
  },
});


onMounted(async () => {
  console.log("CheckTopInfos routeFlowComService mounted", props.row);
  let res = await getSeqInInfo(props.row.businessId);
  infoObj.value = res.data;
});

const { capture } = useScreenshot();
const { layout } = useLayout();
const { dicts } = useDictionaryStore();
</script>

<template>
  <div class="box">
    <el-card>
        <el-descriptions title="" border :column="3" label-width="100">
          <el-descriptions-item label="接收人:">
            {{infoObj.recipient}}
          </el-descriptions-item>
          <el-descriptions-item label="检验码:">
            <el-text class="mx-1">{{infoObj.checkCode}}</el-text>
          </el-descriptions-item>
          <el-descriptions-item label="单据类型:">
            <el-text class="mx-1">{{infoObj.billTypeStr}}</el-text>
          </el-descriptions-item>
          <el-descriptions-item label="仓库类型:">
            <el-text class="mx-1">{{infoObj.warehouseTypeStr}}</el-text>
          </el-descriptions-item>
          <el-descriptions-item label="批号:">
            <el-text class="mx-1">{{infoObj.lotCode}}</el-text>
          </el-descriptions-item>
          </el-descriptions>
      <el-descriptions title="" border :column="3" label-width="100">
        <div class="cell-item">
          <el-descriptions-item label="备注:" class="cell-item">
            <el-text class="mx-1">{{infoObj.remark}}</el-text>
          </el-descriptions-item>
        </div>
      </el-descriptions>
      <el-descriptions title="" border :column="1" label-width="100">
          <el-descriptions-item label="管号:">
            <el-text class="mx-1">{{infoObj.seqNo}}</el-text>
          </el-descriptions-item>
      </el-descriptions>
      <el-descriptions title="" border :column="3" label-width="100">
            <el-descriptions-item label="创建人:">
              <el-text class="mx-1">{{infoObj.creator}}</el-text>
            </el-descriptions-item>
            <el-descriptions-item label="创建时间:" span="2">
              <el-text class="mx-1">{{infoObj.created}}</el-text>
            </el-descriptions-item>
        </el-descriptions>
    </el-card>
  </div>
</template>

<style>
.cell-item {
  display: flex;
  align-items: center;
}
</style>
