detail.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <div class="app-container">
  3. <div class="base-info">
  4. <div class="base-info-title">基础信息</div>
  5. <el-form label-width="100px">
  6. <el-form-item label="盲票类型:">
  7. <span :class="loading ? 'el-icon-loading' : ''"></span>
  8. {{ info && info.type && info.type.desc }}
  9. </el-form-item>
  10. <el-form-item label="盲票组名称:">
  11. <span :class="loading ? 'el-icon-loading' : ''"></span>
  12. {{ info && info.title }}
  13. </el-form-item>
  14. <el-form-item label="图片:">
  15. <el-image
  16. style="width: 110px; height: 150px"
  17. :src="info && info.picUrl"
  18. :preview-src-list="[info && info.picUrl]"
  19. />
  20. </el-form-item>
  21. <el-form-item label="面值:">
  22. <span :class="loading ? 'el-icon-loading' : ''"></span>
  23. {{ info && info.facePrice && $numberFormat(info.facePrice) }}元
  24. </el-form-item>
  25. <el-form-item label="售价:">
  26. <span :class="loading ? 'el-icon-loading' : ''"></span>
  27. {{ info && info.salePrice && $numberFormat(info.salePrice) }}元
  28. </el-form-item>
  29. <el-form-item label="盲票总数:">
  30. <span :class="loading ? 'el-icon-loading' : ''"></span>
  31. {{ info && info.quantity }}张
  32. </el-form-item>
  33. <el-form-item label="每包张数:">
  34. <span :class="loading ? 'el-icon-loading' : ''"></span>
  35. {{ info && info.pkgUnit }}张
  36. </el-form-item>
  37. <el-form-item label="采购单价:" v-if="info.type == 'offline'">
  38. <span :class="loading ? 'el-icon-loading' : ''"></span>
  39. {{ info && info.pkgSalePrice && $numberFormat(info.pkgSalePrice) }}元
  40. </el-form-item>
  41. <el-form-item label="佣金系数:">
  42. <span :class="loading ? 'el-icon-loading' : ''"></span>
  43. {{ info && info.saleCommRate }}%
  44. </el-form-item>
  45. <el-form-item label="序列号:">
  46. <span :class="loading ? 'el-icon-loading' : ''"></span>
  47. {{ info && info.boxNo }}
  48. </el-form-item>
  49. </el-form>
  50. <div class="base-info-title">奖级设置</div>
  51. <!-- 奖级设置 -->
  52. <div class="prize" v-for="(item, index) in awardsList" :key="index">
  53. <div class="prize-top">
  54. <div>奖级名称:{{ item.name }}</div>
  55. <div>奖级:{{ item.sort }}</div>
  56. <div>奖级数量:{{ item.quantity }}</div>
  57. </div>
  58. <div class="prize-table">
  59. <el-table :data="item.prizeList" class="el-table">
  60. <el-table-column label="奖品图片">
  61. <template slot-scope="{ row }">
  62. <el-image
  63. style="width: 70px; height: 70px"
  64. :src="row.picUrl"
  65. :preview-src-list="[row.picUrl]"
  66. >
  67. </el-image>
  68. </template>
  69. </el-table-column>
  70. <el-table-column label="奖品名称" prop="title" />
  71. <el-table-column label="奖品类型" align="center">
  72. <template slot-scope="{ row }">
  73. <div v-if="row.prizeType.value == 'goods'">商品</div>
  74. <div v-if="row.prizeType.value == 'coupon'">券</div>
  75. <div v-if="row.prizeType.value == 'coin'">盲豆</div>
  76. </template>
  77. </el-table-column>
  78. </el-table>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </template>
  84. <script>
  85. import { publicFileGetUrl } from "@/api/common";
  86. import { ticketBoxDetail } from "@/api/business/ticket";
  87. export default {
  88. components: {},
  89. data() {
  90. return {
  91. loading: false,
  92. // 盲票组ID
  93. boxId: "",
  94. // 盲票组详情
  95. info: {},
  96. // 奖品
  97. awardsList: [],
  98. };
  99. },
  100. created() {
  101. this.boxId = this.$route.query.id;
  102. this.getDetail();
  103. },
  104. methods: {
  105. // 获取详情
  106. getDetail() {
  107. this.loading = true;
  108. ticketBoxDetail({ boxId: this.boxId })
  109. .then((res) => {
  110. this.loading = false;
  111. console.log("res", res);
  112. if (res.code == 0) {
  113. let data = res.data;
  114. this.info = {
  115. ...data,
  116. type: JSON.parse(data.type),
  117. picUrl: publicFileGetUrl + data.picUrl,
  118. };
  119. data.awardsList.forEach((item) => {
  120. item.prizeList.forEach((ele) => {
  121. (ele.picUrl = publicFileGetUrl + ele.picUrl.split(',')[0]),
  122. (ele.prizeType = JSON.parse(ele.prizeType));
  123. });
  124. });
  125. this.awardsList = data.awardsList;
  126. }
  127. })
  128. .catch(() => {
  129. this.loading = false;
  130. });
  131. },
  132. },
  133. };
  134. </script>
  135. <style lang="scss" scoped>
  136. .base-info-title {
  137. padding: 10px;
  138. border-bottom: 1px solid #eaeaea;
  139. margin-bottom: 20px;
  140. }
  141. .tip {
  142. padding-left: 100px;
  143. height: 32px;
  144. margin-bottom: 20px;
  145. color: #828282;
  146. font-size: 14px;
  147. }
  148. .save-btn {
  149. display: flex;
  150. align-content: center;
  151. justify-content: center;
  152. margin-bottom: 100px;
  153. .ge {
  154. width: 100px;
  155. }
  156. }
  157. .prize {
  158. width: 1000px;
  159. margin-bottom: 50px;
  160. background: #f9f9f9;
  161. border: 1px solid #bbbbbb;
  162. font-size: 14px;
  163. &-top {
  164. padding: 10px 20px;
  165. margin-bottom: 10px;
  166. display: flex;
  167. align-content: center;
  168. justify-content: space-around;
  169. border-bottom: 1px solid #bbbbbb;
  170. div {
  171. line-height: 36px;
  172. }
  173. }
  174. }
  175. </style>