index.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. {include file="/shopro/common/script" /}
  2. <style>
  3. .agent-index .status-text {
  4. margin-right: 12px;
  5. }
  6. </style>
  7. <div id="index" class="agent-index panel panel-default panel-intro" v-cloak>
  8. <el-container class="panel-block">
  9. <el-header class="sa-header">
  10. <el-tabs class="sa-tabs" v-model="state.filter.data.tabActive" @tab-change="onChangeTab">
  11. <el-tab-pane v-for="item in type.data.status" :key="item" :label="item.name" :name="item.type">
  12. </el-tab-pane>
  13. </el-tabs>
  14. <div class="sa-title sa-flex sa-row-between">
  15. <div class="sa-title-left">
  16. <div class="left-name">分销商</div>
  17. <sa-filter-condition v-model="state.filter" @filter-delete="onChangeFilter">
  18. </sa-filter-condition>
  19. </div>
  20. <div class="sa-title-right">
  21. <el-button class="sa-button-refresh" icon="RefreshRight" @click="getData"></el-button>
  22. <el-button class="sa-button-refresh" icon="Search" @click="onOpenFilter"></el-button>
  23. </div>
  24. </div>
  25. </el-header>
  26. <el-main class="sa-main">
  27. <el-table v-if="state.filter.data.tabActive=='all'" height="100%" class="sa-table" :data="state.data"
  28. stripe>
  29. <el-table-column prop="user_id" label="ID" min-width="90">
  30. </el-table-column>
  31. <el-table-column label="分销商信息" min-width="150">
  32. <template #default="scope">
  33. <sa-user-profile :user="scope.row.user" :id="scope.row.user_id"></sa-user-profile>
  34. </template>
  35. </el-table-column>
  36. <el-table-column label="等级" min-width="120">
  37. <template #default="scope">
  38. <template v-if="scope.row.level_info">
  39. <div>{{ scope.row.level_info.name }}</div>
  40. <div>(等级{{ scope.row.level_info.level }})</div>
  41. </template>
  42. <template v-else>{{ scope.row.level }}</template>
  43. </template>
  44. </el-table-column>
  45. <el-table-column label="累计佣金" min-width="120">
  46. <template #default="scope"> {{ scope.row.total_income }}元 </template>
  47. </el-table-column>
  48. <el-table-column label="消费金额" min-width="120">
  49. <template #default="scope"> {{ scope.row.user?.total_consume || 0 }}元 </template>
  50. </el-table-column>
  51. <el-table-column label="自购分销业绩" min-width="120">
  52. <template #default="scope">
  53. <div>{{ scope.row.child_order_count_0 }}单</div>
  54. <div>{{ scope.row.child_order_money_0 }}元</div>
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="上级分销商" min-width="120" align="center">
  58. <template #default="scope">
  59. <sa-user-profile type="agent" :user="scope.row.user?.parent_user"
  60. :id="scope.row.user?.parent_user_id" mode="col"></sa-user-profile>
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="一级用户人数" min-width="120">
  64. <template #default="scope"> {{ scope.row.child_user_count_1 }}人 </template>
  65. </el-table-column>
  66. <el-table-column label="一级分销商人数" min-width="160">
  67. <template #default="scope">
  68. <div>{{ scope.row.child_agent_count_1 }}人</div>
  69. </template>
  70. </el-table-column>
  71. <el-table-column prop="createtime" label="创建时间" width="172"></el-table-column>
  72. <el-table-column label="操作" min-width="140" fixed="right">
  73. <template #default="scope">
  74. <div class="sa-flex">
  75. <span class="mr-2" :style="{
  76. color: statusStyle[scope.row.status]?.color,
  77. }">
  78. {{ scope.row.status_text }}
  79. </span>
  80. {if $auth->check('shopro/commission/agent/detail')}
  81. <el-button type="primary" link @click="onDetail(scope.row.user_id)">查看</el-button>
  82. {/if}
  83. </div>
  84. </template>
  85. </el-table-column>
  86. </el-table>
  87. <el-table v-if="state.filter.data.tabActive=='pending'" height="100%" class="sa-table" :data="state.data"
  88. stripe>
  89. <el-table-column prop="user_id" label="ID" min-width="90">
  90. </el-table-column>
  91. <el-table-column label="分销商信息" min-width="150">
  92. <template #default="scope">
  93. <sa-user-profile :user="scope.row.user" :id="scope.row.user_id" />
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="等级" min-width="120">
  97. <template #default="scope">
  98. <template v-if="scope.row.level_info">
  99. <div>{{ scope.row.level_info.name }}</div>
  100. <div>(等级{{ scope.row.level_info.level }})</div>
  101. </template>
  102. <template v-else>{{ scope.row.level }}</template>
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="上级分销商" min-width="120" align="center">
  106. <template #default="scope">
  107. <sa-user-profile type="agent" :user="scope.row.user?.parent_user"
  108. :id="scope.row.user?.parent_user_id" mode="col" />
  109. </template>
  110. </el-table-column>
  111. <el-table-column label="消费金额" min-width="120">
  112. <template #default="scope"> {{ scope.row.user?.total_consume || 0 }}元 </template>
  113. </el-table-column>
  114. <el-table-column label="推广人数" min-width="120">
  115. <template #default="scope"> {{ scope.row.child_user_count_1 }}人 </template>
  116. </el-table-column>
  117. <el-table-column label="提交次数" min-width="120">
  118. <template #default="scope"> {{ scope.row.apply_num }}次</template>
  119. </el-table-column>
  120. <el-table-column prop="createtime" label="创建时间" min-width="172"></el-table-column>
  121. <el-table-column label="操作" min-width="160" fixed="right">
  122. <template #default="scope">
  123. <div class="sa-flex">
  124. {if $auth->check('shopro/commission/agent/edit')}
  125. <el-button type="success" link @click="onEdit(scope.row.user_id, {status:'normal'})">
  126. 同意
  127. </el-button>
  128. {/if}
  129. {if $auth->check('shopro/commission/agent/edit')}
  130. <el-button type="warning" link @click="onEdit(scope.row.user_id,{status:'reject'} )">
  131. 驳回
  132. </el-button>
  133. {/if}
  134. {if $auth->check('shopro/commission/agent/detail')}
  135. <el-button type="primary" link @click="onDetail(scope.row.user_id)">查看</el-button>
  136. {/if}
  137. </div>
  138. </template>
  139. </el-table-column>
  140. </el-table>
  141. <el-table v-if="state.filter.data.tabActive==0" height="100%" class="sa-table" :data="state.data" stripe>
  142. <el-table-column prop="user_id" label="ID" min-width="90"></el-table-column>
  143. <el-table-column label="分销商信息" min-width="150">
  144. <template #default="scope">
  145. <sa-user-profile :user="scope.row.user" :id="scope.row.user_id" />
  146. </template>
  147. </el-table-column>
  148. <el-table-column label="等级" min-width="120">
  149. <template #default="scope">
  150. <template v-if="scope.row.level_info">
  151. <div>{{ scope.row.level_info.name }}</div>
  152. <div>(等级{{ scope.row.level_info.level }})</div>
  153. </template>
  154. <template v-else>{{ scope.row.level }}</template>
  155. </template>
  156. </el-table-column>
  157. <el-table-column label="消费金额" min-width="120">
  158. <template #default="scope"> {{ scope.row.user?.total_consume || 0 }}元 </template>
  159. </el-table-column>
  160. <el-table-column label="推广人数" min-width="120">
  161. <template #default="scope"> {{ scope.row.child_user_count_1 }}人 </template>
  162. </el-table-column>
  163. <el-table-column label="升级之后的等级" min-width="200">
  164. <template #default="scope">
  165. <div v-if="scope.row.level_status_info">
  166. {{ scope.row.level_status_info.name }}
  167. </div>
  168. <div>等级{{ scope.row.level_status }}</div>
  169. </template>
  170. </el-table-column>
  171. <el-table-column prop="createtime" label="创建时间" min-width="172"></el-table-column>
  172. <el-table-column label="操作" min-width="200" fixed="right">
  173. <template #default="scope">
  174. <div class="sa-flex">
  175. <span class="sa-color--info mr-2" v-if="!scope.row.level_status_info">
  176. 未找到等级
  177. </span>
  178. <template v-if="scope.row.level_status_info">
  179. {if $auth->check('shopro/commission/agent/edit')}
  180. <el-button type="success" link
  181. @click=" onEdit(scope.row.user_id, {level_status: scope.row.level_status})">
  182. 同意
  183. </el-button>
  184. <el-button type="danger" link @click="onEdit(scope.row.user_id, { level_status: 0 })">
  185. 拒绝
  186. </el-button>
  187. {/if}
  188. </template>
  189. {if $auth->check('shopro/commission/agent/detail')}
  190. <el-button type="primary" link @click="onDetail(scope.row.user_id)">查看</el-button>
  191. {/if}
  192. </div>
  193. </template>
  194. </el-table-column>
  195. </el-table>
  196. </el-main>
  197. <el-footer class="sa-footer sa-flex sa-row-right">
  198. <sa-pagination v-model="pagination" @pagination-change="getData"></sa-pagination>
  199. </el-footer>
  200. </el-container>
  201. <sa-filter v-model="state.filter" @filter-change="onChangeFilter"></sa-filter>
  202. </div>