index.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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 #yszscategory="{ value }">
  7. {{ getYSZSCategoryName(value) }}
  8. </template>
  9. <!-- 采购保证金比例 -->
  10. <template #buymarginvalue="{ value }">
  11. {{ parsePercent(value) }}
  12. </template>
  13. <!-- 状态 -->
  14. <template #presalestatus="{ value }">
  15. {{ getWRPresaleStatusName(value) }}
  16. </template>
  17. <!-- 履约方式 -->
  18. <template #performancetemplateid="{ value }">
  19. <app-performance-rule :item="getPerformanceTemplateById(value)" />
  20. </template>
  21. <!-- 集采价格 -->
  22. <template #price>
  23. <app-table :data="priceList" :columns="priceColumns" :show-toolbar="false" border />
  24. </template>
  25. </app-table-details>
  26. <app-table-details title="钻石参考信息" :label-width="140" :data="selectedRow" :cell-props="details2" :column="2">
  27. <!-- 生产方式 -->
  28. <template #ysproductionmode="{ value }">
  29. {{ handleNumberValue(getYSProductionModeName(value)) }}
  30. </template>
  31. <!-- 图片 -->
  32. <template #pictureurls>
  33. <template v-for="(url, index) in imageUrl" :key="index">
  34. <el-image :src="url" :preview-src-list="imageUrl" fit="cover" />
  35. </template>
  36. </template>
  37. </app-table-details>
  38. <app-table :data="dataList" :columns="columns" :show-toolbar="false" :loading="loading" border>
  39. <template #header>
  40. <h3 class="g-details__title">采购信息</h3>
  41. </template>
  42. <template #footer>
  43. <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex" @change="run" />
  44. </template>
  45. </app-table>
  46. </app-drawer>
  47. </template>
  48. <script lang="ts" setup>
  49. import { shallowRef, reactive, PropType, onMounted } from 'vue'
  50. import { ElMessage } from 'element-plus'
  51. import { getFileUrl, parsePercent, handleNumberValue } from '@/filters'
  52. import { getYSZSCategoryName, getWRPresaleStatusName, getYSProductionModeName, YSZSCategory } from '@/constants/presale'
  53. import { useRequest } from '@/hooks/request'
  54. import { performanceStore } from '@/stores'
  55. import { queryGZMyPresell, queryPresaleorderapplyprice } from '@/services/api/presale'
  56. import AppDrawer from '@pc/components/base/drawer/index.vue'
  57. import AppTable from '@pc/components/base/table/index.vue'
  58. import AppPagination from '@pc/components/base/pagination/index.vue'
  59. import AppTableDetails from '@pc/components/base/table-details/index.vue'
  60. import AppPerformanceRule from '@pc/components/modules/performance-rule/index.vue'
  61. const props = defineProps({
  62. selectedRow: {
  63. type: Object as PropType<Ermcp.GZPreSellRsp>,
  64. required: true
  65. },
  66. })
  67. const { getPerformanceTemplateById } = performanceStore.actions
  68. const show = shallowRef(true)
  69. const imageUrl = reactive<string[]>([])
  70. const { dataList: priceList } = useRequest(queryPresaleorderapplyprice, {
  71. params: {
  72. applyid: props.selectedRow.presaleapplyid
  73. }
  74. })
  75. const { loading, dataList, total, pageIndex, pageSize, run } = useRequest(queryGZMyPresell, {
  76. params: {
  77. pagesize: 10,
  78. presaleapplyid: props.selectedRow.presaleapplyid,
  79. },
  80. onError: (err) => {
  81. ElMessage.error(err)
  82. }
  83. })
  84. const details1 = [
  85. { prop: 'wrstandardname', label: '商品名称:' },
  86. { prop: 'customername', label: '卖方:' },
  87. { prop: 'presaleqty', label: '集采总量:' },
  88. { prop: 'yszscategory', label: '钻石类型:' },
  89. { prop: 'minbuyqty', label: '最小采购单位:' },
  90. { prop: 'minsuccessqty', label: '最低成团量:' },
  91. { prop: 'maxbuyqty', label: '最大采购单位:' },
  92. { prop: 'buymarginvalue', label: '采购保证金比例:' },
  93. { prop: 'startdate', label: '开始日期:' },
  94. { prop: 'enddate', label: '结束日期:' },
  95. { prop: 'presalestatus', label: '状态:' },
  96. { prop: 'tradeqty', label: '已采购数量:' },
  97. { prop: 'performancetemplateid', label: '履约方式:', entireRow: true },
  98. { prop: 'price', label: '集采价格:', entireRow: true },
  99. ]
  100. const details2 = (() => {
  101. switch (props.selectedRow.yszscategory) {
  102. case YSZSCategory.Diamonds: {
  103. return [
  104. { prop: 'zsshapetypestr', label: '形状:' },
  105. { prop: 'zscolortypestr', label: '颜色:' },
  106. { prop: 'sizestr', label: '尺寸:' },
  107. { prop: 'zspolishtypestr', label: '抛光:' },
  108. { prop: 'zsclaritytypestr', label: '净度:' },
  109. { prop: 'zssymmetrytypestr', label: '对称:' },
  110. { prop: 'zscuttypestr', label: '切工:' },
  111. { prop: 'zsfluorescencetypestr', label: '荧光:' },
  112. { prop: 'pictureurls', label: '图片:', entireRow: true },
  113. { prop: 'remark', label: '备注:', entireRow: true },
  114. ]
  115. }
  116. case YSZSCategory.Rough: {
  117. return [
  118. { prop: 'zscolortypestr', label: '颜色:' },
  119. { prop: 'sizestr', label: '尺寸:' },
  120. { prop: 'zsclaritytypestr', label: '净度:' },
  121. { prop: 'yieldrate', label: '成品率:' },
  122. { prop: 'qtydesc', label: '数量描述:' },
  123. { prop: 'weightdesc', label: '重量描述:' },
  124. { prop: 'ysproductionmode', label: '生产方式:' },
  125. { prop: 'pictureurls', label: '图片:', entireRow: true },
  126. { prop: 'remark', label: '备注:', entireRow: true },
  127. ]
  128. }
  129. default: {
  130. return []
  131. }
  132. }
  133. })()
  134. const columns: Ermcp.TableColumn[] = [
  135. { prop: 'customername', label: '采购方' },
  136. { prop: 'orderqty', label: '认购数量(ct)' },
  137. { prop: 'tradeprice', label: '采购价格(元/克拉)' },
  138. { prop: 'ordertime', label: '采购时间' },
  139. ]
  140. const priceColumns: Ermcp.TableColumn[] = [
  141. { prop: 'stepindex', label: '序号' },
  142. { prop: 'qty', label: '数量' },
  143. { prop: 'price', label: '价格(元/克拉)' },
  144. ]
  145. onMounted(() => {
  146. const images = props.selectedRow.pictureurls.split(',')
  147. images.forEach((url) => {
  148. if (url) {
  149. imageUrl.push(getFileUrl(url))
  150. }
  151. })
  152. })
  153. </script>
  154. <style lang="less" scoped>
  155. .el-image {
  156. width: 64px;
  157. height: 64px;
  158. border: 1px solid #ccc;
  159. +.el-image {
  160. margin-left: 10px;
  161. }
  162. }
  163. </style>