details.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <!-- 预售大厅-我的预售-我的申请-详情 -->
  2. <template>
  3. <app-drawer title="详情" :width="800" 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 #applystatus="{ value }">
  11. {{ getInOutApplyStatusName(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. {{ handleNumberValue(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-drawer>
  31. </template>
  32. <script lang="ts" setup>
  33. import { shallowRef, reactive, PropType, onMounted } from 'vue'
  34. import { getFileUrl, parsePercent, handleNumberValue } from '@/filters'
  35. import { getInOutApplyStatusName, getYSProductionModeName } from '@/constants/presale'
  36. import { performanceStore } from '@/stores'
  37. import AppDrawer from '@pc/components/base/drawer/index.vue'
  38. import AppTableDetails from '@pc/components/base/table-details/index.vue'
  39. import AppPerformanceRule from '@pc/components/modules/performance-rule/index.vue'
  40. const props = defineProps({
  41. selectedRow: {
  42. type: Object as PropType<Ermcp.GZWrPreSaleApplyRsp>,
  43. required: true
  44. },
  45. })
  46. const { getPerformanceTemplateById } = performanceStore.actions
  47. const show = shallowRef(true)
  48. const imageUrl = reactive<string[]>([])
  49. const details1 = [
  50. { prop: 'wrstandardname', label: '商品名称:' },
  51. { prop: 'applytime', label: '申请日期:' },
  52. { prop: 'presaleqty', label: '预售总量:' },
  53. { prop: 'unitprice', label: '预售价格:' },
  54. { prop: 'minbuyqty', label: '最小采购单位:' },
  55. { prop: 'minsuccessqty', label: '最低成团量:' },
  56. { prop: 'maxbuyqty', label: '最大采购单位:' },
  57. { prop: 'buymarginvalue', label: '采购保证金比例:' },
  58. { prop: 'startdate', label: '开始日期:' },
  59. { prop: 'enddate', label: '结束日期:' },
  60. { prop: 'applystatus', label: '状态:' },
  61. { prop: 'auditremark', label: '审核备注:' },
  62. { prop: 'performancetemplateid', label: '履约方式:', entireRow: true },
  63. ]
  64. const details2 = [
  65. { prop: 'zscolortypestr', label: '颜色:' },
  66. { prop: 'sizestr', label: '尺寸:' },
  67. { prop: 'zsclaritytypestr', label: '净度:' },
  68. { prop: 'yieldrate', label: '成品率:' },
  69. { prop: 'qtydesc', label: '数量描述:' },
  70. { prop: 'weightdesc', label: '重量描述:' },
  71. { prop: 'ysproductionmode', label: '生产方式:' },
  72. { prop: 'pictureurls', label: '图片:', entireRow: true },
  73. { prop: 'remark', label: '备注:', entireRow: true },
  74. ]
  75. onMounted(() => {
  76. const images = props.selectedRow.pictureurls.split(',')
  77. images.forEach((url) => {
  78. if (url) {
  79. imageUrl.push(getFileUrl(url))
  80. }
  81. })
  82. })
  83. </script>
  84. <style lang="less" scoped>
  85. .el-image {
  86. width: 64px;
  87. height: 64px;
  88. border: 1px solid #ccc;
  89. +.el-image {
  90. margin-left: 10px;
  91. }
  92. }
  93. </style>