<template>
  <ElDialog v-model="showDialog"
    destroy-on-close
    width="fit-content"
    @close="dialogCloseHandler">
    <ElDescriptions title="运输信息" border>
       <ElDescriptionsItem label="Id" prop="id">
        {{ detailData.id }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="车次" prop="trainNum">
        {{ detailData.trainNum }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="订单 Id" prop="orderId">
        {{ detailData.orderId }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="运输状态；字典代码：trans_status，DaiPaiDan-->待派单、DaiJieDan-->待接单、YiJieDan-->已接单、YunShuZhong-->运输中、YiJinChang-->已进场、YiChuChang-->已出场、YiWanCheng-->已完成、YiQuXiao-->已取消" prop="transStatus">
        {{ detailData.transStatus }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="车道名称" prop="lane">
        {{ detailData.lane }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="指派司机时间" prop="assignmentDriverTime">
        {{ detailData.assignmentDriverTime }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="司机确认接单时间" prop="driverConfirmTime">
        {{ detailData.driverConfirmTime }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="开始运输时间" prop="transTime">
        {{ detailData.transTime }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="完结时间" prop="finishTime">
        {{ detailData.finishTime }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="看料员 Id；sys_user.id" prop="checkerId">
        {{ detailData.checkerId }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="勘料状态；字典代码：check_status，Wu-->无需勘料、YiKanLiao-->已勘料、WeiKanLiao-->未勘料" prop="checkStatus">
        {{ detailData.checkStatus }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="勘料时间" prop="checkTime">
        {{ detailData.checkTime }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="勘料照片" prop="checkPhoto">
        {{ detailData.checkPhoto }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="勘料员备注" prop="checkerMemo">
        {{ detailData.checkerMemo }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="司机 Id" prop="driverId">
        {{ detailData.driverId }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="司机所属客户 Id；cst_customer.id" prop="driverCustomerId">
        {{ detailData.driverCustomerId }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="司机所属用户 Id" prop="driverUserId">
        {{ detailData.driverUserId }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="归属客户 Id；cst_customer.id" prop="truckCustomerId">
        {{ detailData.truckCustomerId }}
      </ElDescriptionsItem>
      <ElDescriptionsItem label="归属企业" prop="truckOrgId">
        {{ detailData.truckOrgId }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="车辆 Id" prop="truckId">
        {{ detailData.truckId }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="车牌号" prop="truckLicensePlate">
        {{ detailData.truckLicensePlate }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="历史皮重" prop="historyTareWeight">
        {{ detailData.historyTareWeight }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="毛重；单位：千克" prop="roughWeight">
        {{ detailData.roughWeight }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="皮重；单位：千克" prop="tareWeight">
        {{ detailData.tareWeight }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="净重；单位：千克" prop="settleWeight">
        {{ detailData.settleWeight }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="运距；单位：米" prop="transDistance">
        {{ detailData.transDistance }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="进场车头照片" prop="inFrontPhoto">
        {{ detailData.inFrontPhoto }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="进场车斗照片" prop="inBodyPhoto">
        {{ detailData.inBodyPhoto }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="出场车头照片" prop="outFrontPhoto">
        {{ detailData.outFrontPhoto }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="出场车斗照片" prop="outBodyPhoto">
        {{ detailData.outBodyPhoto }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="进场时间" prop="inTime">
        {{ detailData.inTime }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="出场时间" prop="outTime">
        {{ detailData.outTime }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="支付状态，MianFei-->免费、WeiZhiFu-->未支付、YiZhiFu-->已支付、YiTuiKuan-->已退款" prop="paymentStatus">
        {{ detailData.paymentStatus }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="支付时间" prop="payTime">
        {{ detailData.payTime }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="退款时间" prop="refundTime">
        {{ detailData.refundTime }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="总金额；单位：元" prop="totalMoney">
        {{ detailData.totalMoney }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="优惠金额；单位：元，有正负" prop="discountMoney">
        {{ detailData.discountMoney }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="手动修正金额；单位：元，有正负" prop="reviseMoney">
        {{ detailData.reviseMoney }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="结算金额；单位：元" prop="settleMoney">
        {{ detailData.settleMoney }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="结算方式，YueJie-->月结、YuE-->余额、XianFu-->现付" prop="settlementWay">
        {{ detailData.settlementWay }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="付款人 Id；sys_user.id" prop="payerUserId">
        {{ detailData.payerUserId }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="付款人客户 Id；cst_customer.id" prop="payerCustomerId">
        {{ detailData.payerCustomerId }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="付款方资金账户 Id" prop="payerMoneyAccount">
        {{ detailData.payerMoneyAccount }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="创建人 Id；sys_user.id" prop="creatorId">
        {{ detailData.creatorId }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="修改人 Id； sys_user.id" prop="modifierId">
        {{ detailData.modifierId }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="创建时间" prop="createTime">
        {{ detailData.createTime }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="修改时间" prop="modifyTime">
        {{ detailData.modifyTime }}
      </ElDescriptionsItem>
       <ElDescriptionsItem label="是否删除； 0-->未删除、1-->已删除" prop="deleted">
        {{ detailData.deleted }}
      </ElDescriptionsItem>
    </ElDescriptions>
    <template #footer>
      <ElButton @click="showDialog = false" type="primary">关闭</ElButton>
    </template>
  </ElDialog>
</template>

<script lang="ts" setup>
import TransApi from '@/pages/order/trans-order/trans-api.ts'
import Utils from '@/common/utils'

const showDialog = ref(false)

const detailData = Utils.resetAble(reactive<TransTypes.SearchTransResult>({}))

function dialogCloseHandler() {
  detailData.$reset()
}

defineExpose({
  open(data: TransTypes.SearchTransResult) {
    showDialog.value = true
    TransApi.detail(data.id!)
      .then(res => {
        detailData.$reset(res.data)
      })
  }
})
</script>

<style lang="stylus" scoped>

</style>
