detail.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <xn-form-container title="详情" :width="900" :visible="visible" :destroy-on-close="true" @close="onClose">
  3. <a-form ref="formRef" :model="formData" :label-col="labelCol4" :wrapper-col="wrapperCol20">
  4. <a-descriptions :column="4" size="middle" bordered class="mb-2" :label-style="labelStyle" :contentStyle="contentStyle">
  5. <a-descriptions-item label="订单编号" :span="2">{{ formData.orderNumber }}</a-descriptions-item>
  6. <a-descriptions-item label="订单名称" :span="2">{{ formData.orderName }}</a-descriptions-item>
  7. <a-descriptions-item label="车牌号" :span="2">{{ formData.licenseNumber }}</a-descriptions-item>
  8. <a-descriptions-item label="车辆轴数" :span="2">{{ formData.axleNumber+'轴' }}</a-descriptions-item>
  9. <a-descriptions-item label="提货开始时间" :span="2">{{ formData.beginTime }}</a-descriptions-item>
  10. <a-descriptions-item label="提货结束时间" :span="2">{{formData.endTime }}</a-descriptions-item>
  11. <a-descriptions-item label="客户名称" :span="2">{{ formData.customerName }}</a-descriptions-item>
  12. <a-descriptions-item label="联系人" :span="2">{{ formData.customerContactName }}</a-descriptions-item>
  13. <a-descriptions-item label="货品名称" :span="2">{{ formData.goodsName }}</a-descriptions-item>
  14. <a-descriptions-item label="货品编码" :span="2">{{ formData.goodsCode }}</a-descriptions-item>
  15. <a-descriptions-item label="司机姓名" :span="2">{{ formData.driverName }}</a-descriptions-item>
  16. <a-descriptions-item label="司机电话" :span="2">{{ formData.driverMobile }}</a-descriptions-item>
  17. <a-descriptions-item label="创建人" :span="2">{{ formData.createUserName }}</a-descriptions-item>
  18. <a-descriptions-item label="创建时间" :span="2">{{ formData.createTime }}</a-descriptions-item>
  19. <a-descriptions-item label="预约状态" :span="4">
  20. <a-tag
  21. :color="
  22. formData.status === '1'
  23. ? 'volcano'
  24. : formData.status === '2'
  25. ? 'red'
  26. : formData.status === '3'
  27. ? 'processing'
  28. : formData.status === '4'
  29. ? 'warning'
  30. : formData.status === '5'
  31. ? 'magenta'
  32. : formData.status === '6'
  33. ? 'orange'
  34. : formData.status === '7'
  35. ? 'gold'
  36. : formData.status === '8'
  37. ? 'lime'
  38. : formData.status === '9'
  39. ? 'green'
  40. : formData.status === '10'
  41. ? 'cyan'
  42. : formData.status === '11'
  43. ? 'success'
  44. : formData.status === '12'
  45. ? 'blue'
  46. : formData.status === '13'
  47. ? 'geekblue'
  48. : 'error'
  49. "
  50. >
  51. {{ $TOOL.dictTypeData('appointment_status', formData.status) }}
  52. </a-tag>
  53. </a-descriptions-item>
  54. <a-descriptions-item label="审核备注" :span="4">{{ formData.appointmentReason }}</a-descriptions-item>
  55. <a-descriptions-item label="司机确认" :span="4">
  56. <a-image :width="200" :src="formData.driverSign" />
  57. </a-descriptions-item>
  58. <a-descriptions-item label="卸货重量(吨)" :span="4">{{ formData.unloadWeight }}</a-descriptions-item>
  59. <a-descriptions-item label="司机回签" :span="4">
  60. <div v-for="(item,index) in fileList " :key="item.value">
  61. <a-image :width="200" :src="item.url" />
  62. </div>
  63. </a-descriptions-item>
  64. <a-descriptions-item label="签收审核" :span="4" v-if="formData.auditSign!=null && formData.auditSign!=''">
  65. <a-image :width="200" :src="formData.auditSign" />
  66. </a-descriptions-item>
  67. </a-descriptions>
  68. </a-form>
  69. </xn-form-container>
  70. </template>
  71. <script setup name="recordDoubleForm">
  72. import { cloneDeep } from 'lodash-es'
  73. import sysConfig from "@/config";
  74. // 默认是关闭状态
  75. const visible = ref(false)
  76. const formData = ref({})
  77. const table = ref()
  78. const resultJson = ref()
  79. const labelStyle = {
  80. width: '20%'
  81. }
  82. const contentStyle = {
  83. width: '30%'
  84. }
  85. const labelCol4 = ref({span: 4, style: 'width: 26%; line-height: 20px; white-space: normal',})
  86. const labelCol8 = ref({span: 8, style: 'width: 26%; line-height: 20px; white-space: normal',})
  87. const wrapperCol20 = ref({span: 20})
  88. const fileList = ref([])
  89. // 打开抽屉
  90. const onOpen = (record) => {
  91. visible.value = true
  92. //getRecordDoubleDetail(record)
  93. if(record){
  94. let recordData = cloneDeep(record)
  95. formData.value = Object.assign({}, recordData)
  96. fileList.value = []
  97. if(formData.value.unloadImg!=null){
  98. for (var i=0;i<formData.value.unloadImg.split(',').length;i++){
  99. fileList.value.push({
  100. name: formData.value.unloadName.split(',')[i],
  101. url:sysConfig.PREVIEW_PATH + formData.value.unloadImg.split(',')[i]
  102. })
  103. }
  104. }
  105. }
  106. }
  107. const getRecordDoubleDetail = (record) => {
  108. const param = {
  109. id: record.id
  110. }
  111. tbRecordDoubleApi.recordDoubleDetailPic(param).then((data) => {
  112. Object.assign(record, data)
  113. formData.value = record
  114. })
  115. }
  116. // 关闭抽屉
  117. const onClose = () => {
  118. resultJson.value = ''
  119. visible.value = false
  120. }
  121. // 调用这个函数将子组件的一些数据和方法暴露出去
  122. defineExpose({
  123. onOpen
  124. })
  125. </script>
  126. <style scoped>
  127. .imgDiv ::v-deep .ant-image {
  128. margin-left: 20px;
  129. margin-top: 10px;
  130. }
  131. .imgDiv ::v-deep .ant-image-mask-info {
  132. margin-left: 20px;
  133. margin-top: 10px;
  134. }
  135. </style>