DetailModal.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <el-dialog :visible.sync="visible" v-bind="modalOptions">
  3. <el-form ref="formData" :model="formData" size="mini" label-position="left" label-suffix=":" label-width="200px">
  4. <!-- 商家任务信息 -->
  5. <el-form-item label="商家ID" prop="shopId">
  6. {{ formData.shopId || '--' }}
  7. </el-form-item>
  8. <el-form-item label="店铺名称" prop="shopName">
  9. {{ formData.shopName || '--' }}
  10. </el-form-item>
  11. <el-form-item label="支持的支付类型" prop="payType">
  12. <span v-if="formData.payType === 9">惠市宝</span>
  13. <span v-else-if="formData.payType === 4">通联</span>
  14. <span v-else-if="formData.payType === 0">无</span>
  15. <span v-else>--</span>
  16. </el-form-item>
  17. <el-form-item label="是否支持代金券" prop="isVoucher">
  18. <span v-if="formData.isVoucher === 1">允许</span>
  19. <span v-else-if="formData.isVoucher === 2">拒绝</span>
  20. <span v-else>--</span>
  21. </el-form-item>
  22. <el-form-item label="请输入代金券返还比例" prop="voucherReturn">
  23. {{ formData.voucherReturn || '--' }}%
  24. </el-form-item>
  25. <el-form-item label="代金券提现比例" prop="voucherCoinRatio">
  26. {{ formData.voucherCoinRatio || '--' }}
  27. </el-form-item>
  28. <el-form-item label="是否支持消费金" prop="isBeeCoin">
  29. <span v-if="formData.isBeeCoin === 1">支持</span>
  30. <span v-else-if="formData.isBeeCoin === 2">不支持</span>
  31. <span v-else>--</span>
  32. </el-form-item>
  33. <el-form-item label="商家消费金提现比例" prop="beeCoinRatio">
  34. {{ formData.beeCoinRatio || '--' }}
  35. </el-form-item>
  36. <el-form-item label="店铺负责人" prop="chargePersonName">
  37. {{ formData.chargePersonName || '--' }}
  38. </el-form-item>
  39. <el-form-item label="负责人电话" prop="chargePersonPhone">
  40. {{ formData.chargePersonPhone || '--' }}
  41. </el-form-item>
  42. <el-form-item label="区域ID" prop="areaId">
  43. {{ formData.areaId || '--' }}
  44. </el-form-item>
  45. <el-form-item label="官方分类名">
  46. <span v-if="categoryList && categoryList.length">{{ getCategoryItem() && getCategoryItem().storeName }}</span>
  47. </el-form-item>
  48. <el-form-item label="店铺地址" prop="shopAdress">
  49. {{ formData.shopAdress || '--' }}
  50. </el-form-item>
  51. <el-form-item label="经度" prop="longitude">
  52. {{ formData.longitude || '--' }}
  53. </el-form-item>
  54. <el-form-item label="纬度" prop="latitude">
  55. {{ formData.latitude || '--' }}
  56. </el-form-item>
  57. <el-form-item label="生效日期" prop="effectiveDate">
  58. {{ formData.effectiveDate || '--' }}
  59. </el-form-item>
  60. <el-form-item label="生效年限" prop="effectiveYear">
  61. {{ formData.effectiveYear || '--' }}
  62. </el-form-item>
  63. <el-form-item label="合同状态" prop="contractState">
  64. <span v-if="formData.contractState === 0">无效</span>
  65. <span v-else-if="formData.contractState === 1">有效</span>
  66. <span v-else>--</span>
  67. </el-form-item>
  68. <el-form-item label="店铺类型" prop="shopType">
  69. <span v-if="formData.shopType === 1">品牌厂家</span>
  70. <span v-else-if="formData.shopType === 2">本地</span>
  71. <span v-else>--</span>
  72. </el-form-item>
  73. <el-form-item label="营业开始时间" prop="startTime">
  74. {{ formData.startTime || '--' }}
  75. </el-form-item>
  76. <el-form-item label="营业结束时间" prop="endTime">
  77. {{ formData.endTime || '--' }}
  78. </el-form-item>
  79. <el-form-item label="店铺类型" prop="shopType">
  80. <span v-if="formData.shopType === 1">品牌厂家</span>
  81. <span v-else-if="formData.shopType === 2">本地</span>
  82. <span v-else>--</span>
  83. </el-form-item>
  84. <el-form-item label="惠市宝商家编号" prop="hsbMrchId">
  85. {{ formData.hsbMrchId || '--' }}
  86. </el-form-item>
  87. <el-form-item label="直播间审核" prop="auditLive">
  88. <span v-if="formData.auditLive === 0">关闭</span>
  89. <span v-else-if="formData.auditLive === 1">开启</span>
  90. <span v-else>--</span>
  91. </el-form-item>
  92. <el-form-item label="直播间商品审核" prop="auditLiveProduct">
  93. <span v-if="formData.auditLiveProduct === 0">关闭</span>
  94. <span v-else-if="formData.auditLiveProduct === 1">开启</span>
  95. <span v-else>--</span>
  96. </el-form-item>
  97. <el-form-item label="评分" prop="score">
  98. {{ formData.score || '--' }}
  99. </el-form-item>
  100. <el-form-item label="商家月售额" prop="monthlySales">
  101. {{ formData.monthlySales || '--' }}
  102. </el-form-item>
  103. <el-form-item label="人均消费额" prop="perCapita">
  104. {{ formData.perCapita || '--' }}
  105. </el-form-item>
  106. <el-form-item label="商家简介" prop="shopBrief">
  107. {{ formData.shopBrief || '--' }}
  108. </el-form-item>
  109. <el-form-item label="广告图" prop="advertisement">
  110. <div v-if="formData.advertisement && formData.advertisement.length">
  111. <el-image
  112. v-for="(item, index) in formData.advertisement" :key="index" :src="item"
  113. style="width:80px;height:80px;margin-right: 10px;" fit="cover"
  114. :preview-src-list="formData.advertisement"
  115. />
  116. </div>
  117. <span v-else>--</span>
  118. </el-form-item>
  119. <el-form-item label="账号" prop="shopPhone">
  120. {{ formData.shopPhone || '--' }}
  121. </el-form-item>
  122. <el-form-item label="密码" prop="shopPassword">
  123. {{ formData.shopPassword || '--' }}
  124. </el-form-item>
  125. <el-form-item label="创建时间" prop="createTime">
  126. {{ formData.createTime || '--' }}
  127. </el-form-item>
  128. </el-form>
  129. </el-dialog>
  130. </template>
  131. <script>
  132. import { businessListGetById, businessClassList } from '@/api/business'
  133. import XeUtils from 'xe-utils'
  134. export default {
  135. name: 'DetailModal',
  136. data() {
  137. return {
  138. modalOptions: {
  139. closeOnClickModal: false,
  140. width: '800px',
  141. title: '查看商家详情'
  142. },
  143. visible: false,
  144. formData: {
  145. shopId: '',
  146. shopName: '', // 店铺名称
  147. voucherCoinRatio: '', // 代金券提现比例
  148. isBeeCoin: '', // 是否支持消费金
  149. beeCoinRatio: '', // 商家消费金提现比例
  150. chargePersonName: '', // 店铺负责人
  151. chargePersonPhone: '', // 负责人电话
  152. shopAdress: '', // 地址
  153. effectiveDate: '', // 生效日期
  154. effectiveYear: '', // 生效年限
  155. shopType: 2, // 商家类型 1 商家 2 本地
  156. payType: 0, // 支付类型
  157. isVoucher: 1, // 是否支持代金卷 1 true 2 false
  158. voucherReturn: '',
  159. contractState: 1, // 合同状态 1-有效 0-无效
  160. auditLive: 1,
  161. auditLiveProduct: 1,
  162. shopPhone: '', // 账号
  163. shopPassword: '', // 密码
  164. perCapita: '', // 人均
  165. score: '', // 评分
  166. advertisement: [], // 广告图
  167. areaId: '', // 区域id
  168. hsbMrchId: '', // 惠市宝商家编号,不是必填
  169. longitude: '', // 经纬度
  170. latitude: '', // 经纬度
  171. classificationId: '', // 商家分类id
  172. classificationName: '', // 非后端参数
  173. startTime: '',
  174. endTime: '',
  175. shopBrief: '', // 商家简介
  176. monthlySales: '',
  177. createTime: ''
  178. },
  179. categoryList: []
  180. }
  181. },
  182. created() {
  183. this.getCategoryTreeList()
  184. },
  185. methods: {
  186. handleClose() {
  187. this.visible = false
  188. },
  189. async getCategoryTreeList() {
  190. const res = await businessClassList({ page: 1, pageSize: 9999 })
  191. XeUtils.eachTree(res.data.records, (item) => {
  192. if (Array.isArray(item.childs) && item.childs.length === 0) {
  193. item.childs = undefined
  194. }
  195. }, { children: 'childs' })
  196. this.categoryList = res.data.records
  197. },
  198. getCategoryItem() {
  199. const { classificationId } = this.formData
  200. const categoryItem = XeUtils.findTree(this.categoryList, (item) => item.id === classificationId)
  201. return categoryItem ? categoryItem.item : {}
  202. },
  203. handleOpen(params = {}) {
  204. this.formData = Object.assign(this.$options.data().formData, params, {
  205. advertisement: params.advertisement ? params.advertisement.split(',') : []
  206. })
  207. if (params.shopId) {
  208. this.getInfo(params.shopId)
  209. }
  210. this.visible = true
  211. },
  212. async getInfo(id) {
  213. const loading = this.$loading({ text: '加载中' })
  214. try {
  215. const res = await businessListGetById({ shopId: id })
  216. this.formData = Object.assign(this.$options.data().formData, res.data, {
  217. shopId: res.data.shopId || '',
  218. advertisement: res.data.advertisement ? res.data.advertisement.split(',') : []
  219. })
  220. } finally {
  221. loading.close()
  222. }
  223. }
  224. }
  225. }
  226. </script>