Detail.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <el-dialog
  3. :title="title"
  4. :visible.sync="dialogVisible"
  5. width="750px"
  6. :append-to-body="true"
  7. :before-close="close"
  8. :destroy-on-close="true"
  9. :close-on-click-modal="false">
  10. <el-form ref="form" label-width="120px" label-position="top" >
  11. <flexbox
  12. class="ygp-form-items"
  13. align="flex-start"
  14. justify="flex-start">
  15. <el-form-item label="渠道名称" style="width: 50%; margin-bottom:5px;" >
  16. <span :class="loading?'el-icon-loading':''"></span>
  17. {{detail.name}}
  18. </el-form-item>
  19. <el-form-item label="手机号码" style="width: 50%; margin-bottom:5px;" >
  20. <span :class="loading?'el-icon-loading':''"></span>
  21. {{detail.mobile}}
  22. </el-form-item>
  23. </flexbox>
  24. <flexbox
  25. class="ygp-form-items"
  26. align="flex-start"
  27. justify="flex-start">
  28. <el-form-item label="联系人" style="width: 50%;margin-bottom:5px;" >
  29. <span :class="loading?'el-icon-loading':''"></span>
  30. {{detail.contact}}
  31. </el-form-item>
  32. <el-form-item label="渠道级别" style="width: 50%;margin-bottom:5px;" >
  33. <span :class="loading?'el-icon-loading':''"></span>
  34. {{detail.level}}级渠道
  35. </el-form-item>
  36. </flexbox>
  37. <flexbox
  38. class="ygp-form-items"
  39. align="flex-start"
  40. justify="flex-start">
  41. <el-form-item label="上级渠道" style="width: 50%;margin-bottom:5px;" >
  42. <span :class="loading?'el-icon-loading':''"></span>
  43. {{detail.parentName}}
  44. </el-form-item>
  45. <el-form-item label="佣金比例" style="width: 50%;margin-bottom:5px;" >
  46. <span :class="loading?'el-icon-loading':''"></span>
  47. {{detail.commRate}}%
  48. </el-form-item>
  49. </flexbox>
  50. <flexbox
  51. class="ygp-form-items"
  52. align="flex-start"
  53. justify="flex-start">
  54. <el-form-item label="所在地区" style="width: 50%;margin-bottom:5px;" >
  55. <span :class="loading?'el-icon-loading':''"></span>
  56. {{detail.province}} {{detail.city}} {{detail.area}}
  57. </el-form-item>
  58. <el-form-item label="创建时间" style="width: 50%;margin-bottom:5px;" >
  59. <span :class="loading?'el-icon-loading':''"> </span>
  60. {{ detail.createdTime | moment("YYYY-MM-DD HH:mm:ss") }}
  61. </el-form-item>
  62. </flexbox>
  63. <el-divider></el-divider>
  64. <flexbox
  65. class="ygp-form-items"
  66. align="flex-start"
  67. justify="flex-start">
  68. <el-form-item label="经销商" style="width: 50%;margin-bottom:5px;" >
  69. <span :class="loading?'el-icon-loading':''"></span>
  70. {{detail.siteCnt}}
  71. </el-form-item>
  72. <el-form-item label="用户数" style="width: 50%;margin-bottom:5px;" >
  73. <span :class="loading?'el-icon-loading':''"></span>
  74. {{detail.userCnt}}
  75. </el-form-item>
  76. </flexbox>
  77. <flexbox
  78. class="ygp-form-items"
  79. align="flex-start"
  80. justify="flex-start">
  81. <el-form-item label="订单数" style="width: 50%;margin-bottom:5px;" >
  82. <span :class="loading?'el-icon-loading':''"> </span>
  83. {{detail.operData && detail.operData.orderCnt}}
  84. </el-form-item>
  85. <el-form-item label="营业额" style="width: 50%;margin-bottom:5px;" >
  86. <span :class="loading?'el-icon-loading':''"></span>{{detail.operData &&detail.operData.saleAmt/100}}
  87. </el-form-item>
  88. </flexbox>
  89. <flexbox
  90. class="ygp-form-items"
  91. align="flex-start"
  92. justify="flex-start">
  93. <el-form-item label="佣金" style="width: 50%;margin-bottom:5px;" >
  94. <span :class="loading?'el-icon-loading':''">{{detail.operData && detail.operData.commAmt/100}} </span>
  95. </el-form-item>
  96. </flexbox>
  97. </el-form>
  98. <div slot="footer" class="dialog-footer">
  99. <el-button @click="close">关 闭</el-button>
  100. </div>
  101. </el-dialog>
  102. </template>
  103. <script>
  104. import { mapGetters } from 'vuex'
  105. import { getChannelDetail} from "@/api/admin/channel";
  106. export default {
  107. props: {
  108. dialogVisible: {
  109. type: Boolean,
  110. default: false
  111. },
  112. editId: [Number, String] // 编辑用
  113. },
  114. data() {
  115. return {
  116. loading: false,
  117. // 详情数据
  118. detail: {}
  119. }
  120. },
  121. computed: {
  122. ...mapGetters(['userInfo']),
  123. title() {
  124. return '渠道详情'
  125. }
  126. },
  127. created() {
  128. // 是编辑
  129. if (this.editId) {
  130. this.getDetail()
  131. }
  132. },
  133. mounted() {
  134. document.body.appendChild(this.$el)
  135. },
  136. destroyed() {
  137. // if appendToBody is true, remove DOM node after destroy
  138. if (this.appendToBody && this.$el && this.$el.parentNode) {
  139. this.$el.parentNode.removeChild(this.$el)
  140. }
  141. },
  142. methods: {
  143. /**
  144. * 获取项目详情
  145. */
  146. getDetail() {
  147. this.loading = true
  148. getChannelDetail(this.editId).then(res => {
  149. this.loading = false
  150. const data = res.data || {}
  151. // console.log("getDetail :" + JSON.stringify(data))
  152. this.detail = data
  153. })
  154. .catch(() => {
  155. this.loading = false
  156. })
  157. },
  158. /**
  159. * 关闭窗口
  160. */
  161. close() {
  162. this.$emit('close')
  163. }
  164. }
  165. }
  166. </script>
  167. <style scoped lang="scss">
  168. .tag{
  169. margin-right: 15px;
  170. width: 90px;
  171. text-align: center;
  172. cursor: pointer;
  173. }
  174. .tag-select{
  175. background-color: #409eff!important;
  176. border-color: #409eff!important;
  177. color: #fff!important;
  178. }
  179. .cover-content-item{
  180. width: 220px;
  181. float: left;
  182. position: relative;
  183. .cover-img {
  184. width: 200px;
  185. height: 100px;
  186. }
  187. .cover-mark {
  188. position: absolute;
  189. top: 0px;
  190. right: 28px;
  191. z-index: 1;
  192. color: red;
  193. cursor: pointer;
  194. visibility: hidden;
  195. }
  196. .select {
  197. visibility: visible!important;
  198. }
  199. }
  200. .dialog-footer{
  201. text-align: center;
  202. }
  203. </style>
  204. <style lang="scss">
  205. .el-dialog__body {
  206. padding: 15px 20px;
  207. }
  208. .ygp-form-items {
  209. .el-form-item{
  210. padding: 0 5px;
  211. }
  212. .el-form-item__label {
  213. line-height: 1.2;
  214. padding-bottom: 0px;
  215. word-break: break-all;
  216. word-wrap: break-word;
  217. color: #333;
  218. }
  219. .el-form-item__error {
  220. position: relative;
  221. top: auto;
  222. left: auto;
  223. }
  224. .el-form-item.is-desc_text {
  225. .el-form-item__label {
  226. display: none;
  227. }
  228. }
  229. }
  230. </style>