detail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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. <div class="picUrl">
  16. <div class="picUrl-item" v-for="(item,index) in info.picUrl" :key="index">
  17. <el-image style="width: 70px; height: 80px" :src="item" :preview-src-list="info.picUrl"/>
  18. </div>
  19. </div>
  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.prePrice && $numberFormat(info.prePrice) }}元/张
  32. </el-form-item>
  33. <el-form-item label="划线价:" v-if="info && info.type && info.type.value == 'online'">
  34. <span :class="loading ? 'el-icon-loading' : ''"></span>
  35. {{ info && info.originPrice && $numberFormat(info.originPrice) }}元
  36. </el-form-item>
  37. <el-form-item label="盲票总数:">
  38. <span :class="loading ? 'el-icon-loading' : ''"></span>
  39. {{ info && info.quantity }}张
  40. </el-form-item>
  41. <el-form-item label="每包张数:">
  42. <span :class="loading ? 'el-icon-loading' : ''"></span>
  43. {{ info && info.pkgUnit }}张
  44. </el-form-item>
  45. <el-form-item label="采购单价:" v-if="info && info.type && info.type.value == 'offline'">
  46. <span :class="loading ? 'el-icon-loading' : ''"></span>
  47. {{ info && info.pkgSalePrice && $numberFormat(info.pkgSalePrice) }}元
  48. </el-form-item>
  49. <el-form-item label="佣金系数:">
  50. <span :class="loading ? 'el-icon-loading' : ''"></span>
  51. {{ info && info.saleCommRate }}%
  52. </el-form-item>
  53. <el-form-item label="序列号:">
  54. <span :class="loading ? 'el-icon-loading' : ''"></span>
  55. {{ info && info.boxNo }}
  56. </el-form-item>
  57. <el-form-item label="销售范围:">
  58. <span :class="loading ? 'el-icon-loading' : ''"></span>
  59. <span v-if="info.saleChannelType == 1">所有渠道</span>
  60. <span v-else>{{ info.channelTitle }}</span>
  61. </el-form-item>
  62. </el-form>
  63. <div class="base-info-title" v-if="goodsList.length > 0">商品设置(购买即可提货)</div>
  64. <!-- 关联商品设置-->
  65. <el-row :gutter="10" v-if="goodsList.length > 0">
  66. <el-col :span="20" :offset="2">
  67. <div class="prize">
  68. <div class="prize-toptwo">
  69. <div>关联商品列表</div>
  70. </div>
  71. <div class="prize-table">
  72. <el-table :data="goodsList" class="el-table">
  73. <el-table-column label="商品图片">
  74. <template slot-scope="{ row }">
  75. <el-image
  76. style="width: 70px; height: 70px"
  77. :src="row.picUrl"
  78. :preview-src-list="[row.picUrl]"
  79. >
  80. </el-image>
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="商品名称" prop="title">
  84. <template slot-scope="{ row }">
  85. <div v-if="row.prizeType == 'coin'">盲豆 x{{ row.value }}</div>
  86. <div v-else>{{ row.title }}</div>
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="商品类型" align="center">
  90. <template slot-scope="{ row }">
  91. <div v-if="row.prizeType == 'goods'">商品</div>
  92. <div v-if="row.prizeType == 'coupon'">券</div>
  93. <div v-if="row.prizeType == 'coupon_pkg'">券包</div>
  94. <div v-if="row.prizeType == 'coin'">盲豆</div>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="商品价格">
  98. <template slot-scope="{ row }">
  99. <div v-if="row.prizeType == 'goods'">¥{{ $numberFormat(row.value) }}</div>
  100. <span v-else>--</span>
  101. </template>
  102. </el-table-column>
  103. <el-table-column label="商品成本">
  104. <template slot-scope="{ row }">
  105. <div v-if="row.prizeType == 'goods'">¥{{ $numberFormat(row.cost) }}</div>
  106. <span v-else>--</span>
  107. </template>
  108. </el-table-column>
  109. </el-table>
  110. </div>
  111. </div>
  112. </el-col>
  113. </el-row>
  114. <div class="base-info-title">奖级设置</div>
  115. <!-- 奖级设置 -->
  116. <el-row :gutter="10">
  117. <el-col :span="20" :offset="2">
  118. <div class="prize" v-for="(item, index) in awardsList" :key="index">
  119. <div class="prize-top">
  120. <div>奖级名称:{{ item.name }}</div>
  121. <div>奖级:{{ item.sort }}</div>
  122. <!-- <div>关联奖级:{{ item.awardsLabel || '-' }}</div>-->
  123. <div>奖级数量:{{ item.quantity }}</div>
  124. </div>
  125. <div class="prize-table">
  126. <el-table :data="item.prizeList" class="el-table">
  127. <el-table-column label="奖品图片">
  128. <template slot-scope="{ row }">
  129. <el-image
  130. style="width: 70px; height: 70px"
  131. :src="row.picUrl"
  132. :preview-src-list="[row.picUrl]"
  133. >
  134. </el-image>
  135. </template>
  136. </el-table-column>
  137. <el-table-column label="奖品名称" prop="title">
  138. <template slot-scope="{ row }">
  139. <div v-if="row.prizeType.value == 'coin'">盲豆 x{{ row.value }}</div>
  140. <div v-else>{{ row.title }}</div>
  141. </template>
  142. </el-table-column>
  143. <el-table-column label="奖品类型" align="center">
  144. <template slot-scope="{ row }">
  145. <div v-if="row.prizeType.value == 'goods'">商品</div>
  146. <div v-if="row.prizeType.value == 'coupon'">券</div>
  147. <div v-if="row.prizeType.value == 'coupon_pkg'">券包</div>
  148. <div v-if="row.prizeType.value == 'coin'">盲豆</div>
  149. </template>
  150. </el-table-column>
  151. <el-table-column label="商品价格">
  152. <template slot-scope="{ row }">
  153. <div v-if="row.prizeType.value == 'goods'">¥{{ $numberFormat(row.value) }}</div>
  154. <span v-else>--</span>
  155. </template>
  156. </el-table-column>
  157. <el-table-column label="商品成本">
  158. <template slot-scope="{ row }">
  159. <div v-if="row.prizeType.value == 'goods'">¥{{ $numberFormat(row.cost) }}</div>
  160. <span v-else>--</span>
  161. </template>
  162. </el-table-column>
  163. <!-- <el-table-column v-if="info && info.type && info.type.value == 'online'" label="奖品数量" prop="quantity" align="center">-->
  164. <!-- <template slot-scope="{ row }">-->
  165. <!-- <div>{{ row.quantity }}</div>-->
  166. <!-- </template>-->
  167. <!-- </el-table-column>-->
  168. <el-table-column label="已兑数量" prop="cashedQty" align="center" />
  169. <el-table-column label="排序" prop="sortWeight" align="center">
  170. <template slot-scope="{ row }">
  171. <div>{{ row.sortWeight }}</div>
  172. </template>
  173. </el-table-column>
  174. </el-table>
  175. </div>
  176. </div>
  177. </el-col>
  178. </el-row>
  179. </div>
  180. </div>
  181. </template>
  182. <script>
  183. import { publicFileGetUrl } from "@/api/common";
  184. import { ticketBoxDetail } from "@/api/business/ticket";
  185. export default {
  186. name: "TicketDetail",
  187. components: {},
  188. data() {
  189. return {
  190. loading: false,
  191. // 盲票组ID
  192. boxId: "",
  193. // 盲票组详情
  194. info: {},
  195. // 奖品
  196. awardsList: [],
  197. //商品
  198. goodsList:[{
  199. picUrl: '',//商品图片
  200. title: '',//商品名称
  201. prizeType: {
  202. value: '',//商品类型
  203. tape: '',
  204. },
  205. value: '',//价格
  206. cost: '',//成本
  207. },]
  208. };
  209. },
  210. created() {
  211. this.boxId = this.$route.query.id;
  212. this.getDetail();
  213. },
  214. methods: {
  215. // 获取详情
  216. getDetail() {
  217. this.loading = true;
  218. ticketBoxDetail({ boxId: this.boxId })
  219. .then((res) => {
  220. this.loading = false;
  221. if (res.code == 0) {
  222. let data = res.data;
  223. let picUrl = []
  224. data.picUrl.split(",").forEach(res=>{
  225. picUrl.push(publicFileGetUrl + res)
  226. })
  227. this.info = {
  228. ...data,
  229. type: JSON.parse(data.type),
  230. picUrl: picUrl,
  231. channelTitle: data.channelList.map(item => item.name).join(',')
  232. };
  233. data.awardsList.forEach((item) => {
  234. item.prizeList.forEach((ele) => {
  235. (ele.picUrl = publicFileGetUrl + ele.picUrl.split(',')[0]),
  236. (ele.prizeType = JSON.parse(ele.prizeType));
  237. });
  238. });
  239. data.goodsList.forEach(item=>{
  240. (item.picUrl = publicFileGetUrl + item.picUrl.split(',')[0]),
  241. // (item.prizeType = JSON.parse(item.prizeType).value);
  242. (item.prizeType = 'goods');
  243. })
  244. this.awardsList = data.awardsList;
  245. this.goodsList = data.goodsList;
  246. }
  247. })
  248. .catch(() => {
  249. this.loading = false;
  250. });
  251. },
  252. },
  253. };
  254. </script>
  255. <style lang="scss" scoped>
  256. .base-info-title {
  257. padding: 10px;
  258. border-bottom: 1px solid #eaeaea;
  259. margin-bottom: 20px;
  260. }
  261. .tip {
  262. padding-left: 100px;
  263. height: 32px;
  264. margin-bottom: 20px;
  265. color: #828282;
  266. font-size: 14px;
  267. }
  268. .save-btn {
  269. display: flex;
  270. align-content: center;
  271. justify-content: center;
  272. margin-bottom: 100px;
  273. .ge {
  274. width: 100px;
  275. }
  276. }
  277. .prize {
  278. width: 100%;
  279. margin-bottom: 50px;
  280. background: #f9f9f9;
  281. border: 1px solid #bbbbbb;
  282. font-size: 14px;
  283. &-toptwo {
  284. padding: 10px 20px;
  285. margin-bottom: 10px;
  286. //display: flex;
  287. //align-content: center;
  288. //justify-content: space-around;
  289. border-bottom: 1px solid #bbbbbb;
  290. div {
  291. line-height: 36px;
  292. }
  293. }
  294. &-top {
  295. padding: 10px 20px;
  296. margin-bottom: 10px;
  297. display: flex;
  298. align-content: center;
  299. justify-content: space-around;
  300. border-bottom: 1px solid #bbbbbb;
  301. div {
  302. line-height: 36px;
  303. }
  304. }
  305. }
  306. .picUrl {
  307. display: flex;
  308. &-item {
  309. margin-right: 40px;
  310. }
  311. }
  312. </style>