index.vue 7.5 KB

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