detail.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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.customerName }}</a-descriptions-item>
  8. <a-descriptions-item label="联系人" :span="2">{{ formData.customerContactName }}</a-descriptions-item>
  9. <a-descriptions-item label="手机号" :span="2">{{ formData.customerPhone }}</a-descriptions-item>
  10. <a-descriptions-item label="客户地址" :span="2">{{ formData.customerAddress }}</a-descriptions-item>
  11. <a-descriptions-item label="货品名称" :span="2">{{ formData.goodsName }}</a-descriptions-item>
  12. <a-descriptions-item label="货品规格" :span="2">{{ formData.goodsModel }}</a-descriptions-item>
  13. <a-descriptions-item label="订单来源" :span="2">
  14. <a-tag
  15. :color="
  16. formData.orderSource === '1'
  17. ? 'orange'
  18. : formData.orderSource === '2'
  19. ? 'green'
  20. : 'purple'
  21. "
  22. >
  23. {{ $TOOL.dictTypeData('order_source', formData.orderSource) }}
  24. </a-tag>
  25. </a-descriptions-item>
  26. <a-descriptions-item label="订单状态" :span="2">
  27. <a-tag
  28. :color="
  29. formData.orderStatus === '1'
  30. ? 'blue'
  31. : formData.orderStatus === '2'
  32. ? 'warning'
  33. : formData.orderStatus === '3'
  34. ? 'processing'
  35. : formData.orderStatus === '4'
  36. ? 'volcano'
  37. : formData.orderStatus === '5'
  38. ? 'purple'
  39. : formData.orderStatus === '6'
  40. ? 'error'
  41. : formData.orderStatus === '7'
  42. ? 'red'
  43. : '#f50'
  44. "
  45. >
  46. {{ $TOOL.dictTypeData('order_status', formData.orderStatus) }}
  47. </a-tag>
  48. </a-descriptions-item>
  49. <a-descriptions-item label="订单重量" :span="2">{{ formData.orderWeight +'吨'}}</a-descriptions-item>
  50. <a-descriptions-item label="过磅重量" :span="2">{{ formData.netWeight +'吨'}}</a-descriptions-item>
  51. <a-descriptions-item label="提货开始时间" :span="2">{{ formData.confStartTime}}</a-descriptions-item>
  52. <a-descriptions-item label="提货结束时间" :span="2">{{ formData.confEndTime}}</a-descriptions-item>
  53. <a-descriptions-item label="签名" :span="4">
  54. <a-image v-if="formData.orderSign != null" :width="200" :src="formData.orderSign" />
  55. </a-descriptions-item>
  56. <a-descriptions-item label="结束备注" :span="4">{{ formData.endReason}}</a-descriptions-item>
  57. <a-descriptions-item label="审核备注" :span="4">{{ formData.orderReason}}</a-descriptions-item>
  58. </a-descriptions>
  59. </a-form>
  60. </xn-form-container>
  61. </template>
  62. <script setup name="recordDoubleForm">
  63. import { cloneDeep } from 'lodash-es'
  64. // 默认是关闭状态
  65. const visible = ref(false)
  66. const formData = ref({})
  67. const table = ref()
  68. const resultJson = ref()
  69. const labelStyle = {
  70. width: '20%'
  71. }
  72. const contentStyle = {
  73. width: '30%'
  74. }
  75. const labelCol4 = ref({span: 4, style: 'width: 26%; line-height: 20px; white-space: normal',})
  76. const labelCol8 = ref({span: 8, style: 'width: 26%; line-height: 20px; white-space: normal',})
  77. const wrapperCol20 = ref({span: 20})
  78. // 打开抽屉
  79. const onOpen = (record) => {
  80. visible.value = true
  81. //getRecordDoubleDetail(record)
  82. if(record){
  83. let recordData = cloneDeep(record)
  84. formData.value = Object.assign({}, recordData)
  85. }
  86. }
  87. const getRecordDoubleDetail = (record) => {
  88. const param = {
  89. id: record.id
  90. }
  91. tbRecordDoubleApi.recordDoubleDetailPic(param).then((data) => {
  92. Object.assign(record, data)
  93. formData.value = record
  94. })
  95. }
  96. // 关闭抽屉
  97. const onClose = () => {
  98. resultJson.value = ''
  99. visible.value = false
  100. }
  101. // 调用这个函数将子组件的一些数据和方法暴露出去
  102. defineExpose({
  103. onOpen
  104. })
  105. </script>
  106. <style scoped>
  107. .imgDiv ::v-deep .ant-image {
  108. margin-left: 20px;
  109. margin-top: 10px;
  110. }
  111. .imgDiv ::v-deep .ant-image-mask-info {
  112. margin-left: 20px;
  113. margin-top: 10px;
  114. }
  115. </style>