index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <!-- 预售大厅-我的预售-详情 -->
  2. <template>
  3. <app-drawer class="g-details" title="详情" :width="960" v-model:show="show">
  4. <app-table-details title="预售信息" :label-width="140" :data="selectedRow" :cell-props="details1" :column="2">
  5. <!-- 采购保证金比例 -->
  6. <template #buymarginvalue="{ value }">
  7. {{ parsePercent(value) }}
  8. </template>
  9. <!-- 状态 -->
  10. <template #presalestatus="{ value }">
  11. {{ getWRPresaleStatusName(value) }}
  12. </template>
  13. <!-- 履约方式 -->
  14. <template #performancetemplateid="{ value }">
  15. <app-performance-rule :item="getPerformanceTemplateById(value)" />
  16. </template>
  17. </app-table-details>
  18. <app-table-details title="钻石参考信息" :label-width="140" :data="selectedRow" :cell-props="details2" :column="2">
  19. <!-- 生产方式 -->
  20. <template #ysproductionmode="{ value }">
  21. {{ getYSProductionModeName(value) }}
  22. </template>
  23. <!-- 图片 -->
  24. <template #pictureurls>
  25. <template v-for="(url, index) in imageUrl" :key="index">
  26. <el-image :src="url" :preview-src-list="imageUrl" fit="cover" />
  27. </template>
  28. </template>
  29. </app-table-details>
  30. <app-table :data="dataList" :columns="columns" :show-toolbar="false" :loading="loading" border>
  31. <template #header>
  32. <h3 class="g-details__title">认购信息</h3>
  33. </template>
  34. <template #footer>
  35. <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex" @change="run" />
  36. </template>
  37. </app-table>
  38. </app-drawer>
  39. </template>
  40. <script lang="ts" setup>
  41. import { shallowRef, reactive, PropType, onMounted } from 'vue'
  42. import { ElMessage } from 'element-plus'
  43. import { getFileUrl, parsePercent } from '@/filters'
  44. import { getWRPresaleStatusName, getYSProductionModeName } from '@/constants/presale'
  45. import { useRequest } from '@/hooks/request'
  46. import { performanceStore } from '@/stores'
  47. import { queryGZMyPresell } from '@/services/api/presale'
  48. import AppDrawer from '@pc/components/base/drawer/index.vue'
  49. import AppTable from '@pc/components/base/table/index.vue'
  50. import AppPagination from '@pc/components/base/pagination/index.vue'
  51. import AppTableDetails from '@pc/components/base/table-details/index.vue'
  52. import AppPerformanceRule from '@pc/components/modules/performance-rule/index.vue'
  53. const props = defineProps({
  54. selectedRow: {
  55. type: Object as PropType<Ermcp.GZPreSellRsp>,
  56. required: true
  57. },
  58. })
  59. const { getPerformanceTemplateById } = performanceStore.actions
  60. const show = shallowRef(true)
  61. const imageUrl = reactive<string[]>([])
  62. const { loading, dataList, total, pageIndex, pageSize, run } = useRequest(queryGZMyPresell, {
  63. params: {
  64. pagesize: 10,
  65. presaleapplyid: props.selectedRow.presaleapplyid,
  66. },
  67. onError: (err) => {
  68. ElMessage.error(err)
  69. }
  70. })
  71. const details1 = [
  72. { prop: 'wrstandardname', label: '商品名称:' },
  73. { prop: 'createtime', label: '申请日期:' },
  74. { prop: 'presaleqty', label: '预售总量:' },
  75. { prop: 'unitprice', label: '预售价格:' },
  76. { prop: 'minbuyqty', label: '最小采购单位:' },
  77. { prop: 'minsuccessqty', label: '最低成团量:' },
  78. { prop: 'maxbuyqty', label: '最大采购单位:' },
  79. { prop: 'buymarginvalue', label: '采购保证金比例:' },
  80. { prop: 'startdate', label: '开始日期:' },
  81. { prop: 'enddate', label: '结束日期:' },
  82. { prop: 'presalestatus', label: '状态:' },
  83. { prop: 'tradeqty', label: '已认购数量:' },
  84. { prop: 'performancetemplateid', label: '履约方式:', entireRow: true },
  85. ]
  86. const details2 = [
  87. { prop: 'zscolortypestr', label: '颜色:' },
  88. { prop: 'sizestr', label: '尺寸:' },
  89. { prop: 'zsclaritytypestr', label: '净度:' },
  90. { prop: 'yieldrate', label: '成品率:' },
  91. { prop: 'qtydesc', label: '数量描述:' },
  92. { prop: 'weightdesc', label: '重量描述:' },
  93. { prop: 'ysproductionmode', label: '生产方式:' },
  94. { prop: 'pictureurls', label: '图片:', entireRow: true },
  95. { prop: 'remark', label: '备注:', entireRow: true },
  96. ]
  97. const columns: Ermcp.TableColumn[] = [
  98. { prop: 'customername', label: '认购方' },
  99. { prop: 'orderqty', label: '认购数量(ct)' },
  100. { prop: 'ordertime', label: '认购时间' },
  101. ]
  102. onMounted(() => {
  103. const images = props.selectedRow.pictureurls.split(',')
  104. images.forEach((url) => {
  105. if (url) {
  106. imageUrl.push(getFileUrl(url))
  107. }
  108. })
  109. })
  110. </script>
  111. <style lang="less" scoped>
  112. .el-image {
  113. width: 64px;
  114. height: 64px;
  115. border: 1px solid #ccc;
  116. +.el-image {
  117. margin-left: 10px;
  118. }
  119. }
  120. </style>