<template>
	<a-modal
      v-model:open="open"
      title="出库单"
      centered
      width="90%"
  >
      <div class="goods-detail">
        <a-card>
          <a-form ref="formRef" :model="formData" layout="inline">
            <a-row :gutter="[0, 16]">
              <a-col :span="8">
                <a-form-item label="出库单预录入编号" name="reWarehouseNumber">
                  <a-input v-model:value="formData.reWarehouseNumber" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="出库单编号" name="warehouseNumber">
                  <a-input v-model:value="formData.warehouseNumber" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="二线出岛编号" name="statementCode">
                  <a-input v-model:value="formData.statementCode" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="核注清单号" name="hzCode">
                  <a-input v-model:value="formData.hzCode" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="企业编码" name="companyCode">
                  <a-input v-model:value="formData.companyCode" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="企业名称" name="companyName">
                  <a-input v-model:value="formData.companyName" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="采购类型" name="purchaseType">
                  <a-input v-model:value="formData.purchaseType" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="监管方式" name="regulaMethod">
                  <a-input v-model:value="formData.regulaMethod" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="币制" name="bz">
                  <a-input v-model:value="formData.bz" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="启抵国(地区)" name="qdgDq">
                  <a-input v-model:value="formData.qdgDq" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="出库日期" name="warehouseTime">
                  <a-input v-model:value="formData.warehouseTime" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="进/出口岸" name="inport">
                  <a-input v-model:value="formData.inport" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="进/出境关别" name="jjgb">
                  <a-input v-model:value="formData.jjgb" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="主管关区代码" name="zggqdm">
                  <a-input v-model:value="formData.zggqdm" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="报关标志" name="bgbz">
                  <a-input v-model:value="formData.bgbz" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="运输方式" name="ysfs">
                  <a-input v-model:value="formData.ysfs" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="区港联动标记" name="qgldbj">
                  <a-input v-model:value="formData.qgldbj" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="是否为报税商品" name="bssp">
                  <a-input v-model:value="formData.bssp" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="二线出岛报关单号" name="yxbgdh">
                  <a-input v-model:value="formData.yxbgdh" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="收货企业编号" name="fhqybh">
                  <a-input v-model:value="formData.fhqybh" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="收货企业名称" name="fhqymc">
                  <a-input v-model:value="formData.fhqymc" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="24">
                <a-form-item label="备注" name="remark">
                  <a-textarea v-model:value="formData.remark" :disabled="true" :rows="4"/>
                </a-form-item>
              </a-col>
            </a-row>
          </a-form>
        </a-card>
        <a-card style="margin-top: 10px;">
          <a-form ref="formRef" :model="formData" layout="inline">
            <a-row :gutter="[0, 16]">
              <a-col :span="8">
                <a-form-item label="物料编号" name="wlbh">
                  <a-input v-model:value="formData.wlbh" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="物料名称" name="wlmc">
                  <a-input v-model:value="formData.wlmc" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="版本号" name="version">
                  <a-input v-model:value="formData.version" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="核注清单项次号" name="hzqdxch">
                  <a-input v-model:value="formData.hzqdxch" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="金二账册号" name="jezce">
                  <a-input v-model:value="formData.jezce" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="备案序号" name="recordNum">
                  <a-input v-model:value="formData.recordNum" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="备案名称" name="recordName">
                  <a-input v-model:value="formData.recordName" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="料件成品标志" name="fjcpbz">
                  <a-input v-model:value="formData.fjcpbz" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="规格型号" name="ggxh">
                  <a-input v-model:value="formData.ggxh" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="原产国(地区)" name="ycgdq">
                  <a-input v-model:value="formData.ycgdq" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="出库数量" name="rkNum">
                  <a-input v-model:value="formData.rkNum" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="计量单位" name="measurementUnit">
                  <a-input v-model:value="formData.measurementUnit" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="单价" name="unitPrice">
                  <a-input v-model:value="formData.unitPrice" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="第一法定数量" name="fyfdNum">
                  <a-input v-model:value="formData.fyfdNum" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="第二法定数量" name="defdNum">
                  <a-input v-model:value="formData.defdNum" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="征免方式" name="zmfs">
                  <a-input v-model:value="formData.zmfs" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="货仓代码" name="hcdm">
                  <a-input v-model:value="formData.hcdm" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="仓位代码" name="cwdm">
                  <a-input v-model:value="formData.cwdm" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="货物来源单证类型" name="hwlyTpe">
                  <a-input v-model:value="formData.hwlyTpe" :disabled="true"/>
                </a-form-item>
              </a-col>
              <a-col :span="8">
                <a-form-item label="货物来源单证编号" name="hwlyCode">
                  <a-input v-model:value="formData.hwlyCode" :disabled="true"/>
                </a-form-item>
              </a-col>
            </a-row>
          </a-form>
          <a-table
            style="margin-top: 10px"
            bordered
            :dataSource="[formData]"
            :columns="[
              {title: '物料编号',dataIndex: 'wlbh',key: 'wlbh'},
              {title: '物料名称',dataIndex: 'wlmc',key: 'wlmc'},
              {title: '规格型号',dataIndex: 'ggxh',key: 'ggxh'},
              {title: '出库数量',dataIndex: 'rkNum',key: 'rkNum'},
              {title: '计量单位',dataIndex: 'measurementUnit',key: 'measurementUnit'},
              {title: '单价',dataIndex: 'unitPrice',key: 'unitPrice'},
              {title: '操作',dataIndex: 'action',key: 'action'},
            ]"
            :pagination="false"
          >
            <template #bodyCell="{ column, record }">
              <template v-if="column.dataIndex === 'action'">
                <a-button type="link" primary size="small">查看</a-button>
              </template>
            </template>
          </a-table>
        </a-card>
      </div>
      <template #footer></template>
	</a-modal>
</template>

<script setup name="enterpriseDetail">
	import tool from '@/utils/tool'
	import { cloneDeep } from 'lodash-es'
  import qyOutWarehouseApi from "@/api/yqyc/qyOutWarehouseApi";
	// 抽屉状态
	const open = ref(false)
	const emit = defineEmits({ successful: null })
	const formRef = ref()
	// 表单数据
	const formData = ref({})

	// 打开抽屉
	const onOpen = (record, view = false) => {
		open.value = true
		if (record) {
      qyOutWarehouseApi.qyOutWarehousePage({warehouseNumber: record.warehouseNumber}).then(res => {
        formData.value = Object.assign({}, res)
      })
		}
	}
	// 关闭抽屉
	const onClose = () => {
		formRef.value.resetFields()
		formData.value = {}
		open.value = false
	}
	// 抛出函数
	defineExpose({
		onOpen
	})
</script>
<style lang="less" scoped>
  .goods-detail {
    max-height: 800px;
    overflow-y: auto;
  }
</style>
