index.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <template>
  2. <div id="registeredUser">
  3. <!-- <search-box-new
  4. ref="searchBox"
  5. :formData="formData"
  6. :formList="formList"
  7. @search="search"
  8. @init="init"
  9. /> -->
  10. <div class="withd-box">
  11. <div>
  12. 总佣金:{{
  13. (userInfo.cash + userInfo.usedCash + userInfo.freezeCash).toFixed(2)
  14. }}元
  15. </div>
  16. <div>可提现:{{ userInfo.cash }}元</div>
  17. <div>已提现:{{ userInfo.usedCash }}元</div>
  18. </div>
  19. <table-list
  20. :tableSets="tableSet"
  21. :tableData="tableData"
  22. :navText="navText"
  23. :loading="loading"
  24. >
  25. <template slot="customize">
  26. <el-button size="medium" @click="dialogVisible = true" type="primary"
  27. >申请提现</el-button
  28. >
  29. <el-button size="medium" @click="toRecord" type="primary"
  30. >提现记录</el-button
  31. >
  32. </template>
  33. <template slot="btn" slot-scope="props">
  34. <el-button type="text">详情</el-button>
  35. </template>
  36. </table-list>
  37. <pagination
  38. :total="total"
  39. :pageSize="formData.pageSize"
  40. :currentPage="formData.pageNum"
  41. @handleSizeChange="handleSizeChange"
  42. @handleCurrentChange="handleCurrentChange"
  43. />
  44. <withd-dialog
  45. :dialogVisible.sync="dialogVisible"
  46. @getSellerInfo="getSellerInfo"
  47. :cash="userInfo.cash || 0"
  48. ></withd-dialog>
  49. </div>
  50. </template>
  51. <script>
  52. import searchBoxNew from "@/components/searchBoxNew";
  53. import tableList from "@/components/tableList";
  54. import pagination from "@/components/pagination";
  55. import withdDialog from "./withdDialog.vue";
  56. import { getCashList } from "@/api/salesman/commission";
  57. import { getSellerInfo } from "@/api/salesman/user";
  58. export default {
  59. name: "RegisteredUser",
  60. components: { searchBoxNew, tableList, pagination, withdDialog },
  61. data() {
  62. return {
  63. loading: false, //当前表单加载是否加载动画
  64. navText: {
  65. title: "活动列表",
  66. index: 0,
  67. ch: "条",
  68. num: false,
  69. choice: false,
  70. addHide: true,
  71. backFatherBtn: {
  72. status: false,
  73. title: "未定义",
  74. },
  75. },
  76. //搜索
  77. formList: [
  78. {
  79. prop: "nickname",
  80. placeholder: "请输入活动名称",
  81. },
  82. ],
  83. formData: {
  84. status: "0,1",
  85. pageSize: 10,
  86. pageNum: 1,
  87. },
  88. // 表单
  89. tableSet: [
  90. {
  91. label: "佣金ID",
  92. prop: "studentCode",
  93. hidden: true,
  94. },
  95. {
  96. label: "所属订单",
  97. prop: "relatedSn",
  98. hidden: true,
  99. },
  100. {
  101. label: "所属活动",
  102. prop: "sex",
  103. hidden: true,
  104. scope: "sex",
  105. },
  106. {
  107. label: "下单人",
  108. prop: "nickname",
  109. hidden: true,
  110. },
  111. {
  112. label: "订单时间",
  113. prop: "payWay",
  114. hidden: true,
  115. },
  116. {
  117. label: "订单金额",
  118. prop: "payWay",
  119. hidden: true,
  120. },
  121. {
  122. label: "佣金分成方式",
  123. prop: "profitType",
  124. hidden: true,
  125. },
  126. {
  127. label: "佣金等级",
  128. prop: "payWay",
  129. hidden: true,
  130. },
  131. {
  132. label: "佣金金额",
  133. prop: "payWay",
  134. hidden: true,
  135. },
  136. {
  137. label: "佣金结算时间",
  138. prop: "freezingPeriod",
  139. hidden: true,
  140. },
  141. ],
  142. tableData: [], //表单数据
  143. total: 0, //一共多少条
  144. pageSize: 10, //每页多少条数据
  145. currentPage: 1, //当前页码
  146. dialogVisible: false,
  147. userInfo: {},
  148. };
  149. },
  150. mounted() {
  151. this.search();
  152. this.getSellerInfo();
  153. },
  154. methods: {
  155. search(int) {
  156. this.loading = true;
  157. if (int === 1) {
  158. this.formData.pageNum = 1;
  159. }
  160. if (int === 2) {
  161. this.formData = {
  162. pageSize: 10,
  163. pageNum: 1,
  164. };
  165. }
  166. getCashList(this.formData)
  167. .then((res) => {
  168. this.tableData = res.rows;
  169. this.total = res.total;
  170. this.navText.index = res.total;
  171. })
  172. .finally(() => {
  173. this.loading = false;
  174. });
  175. },
  176. init() {
  177. this.search(2);
  178. },
  179. handleSizeChange(v) {
  180. this.formData.pageSize = v;
  181. this.formData.pageNum = 1;
  182. this.search();
  183. },
  184. handleCurrentChange(v) {
  185. this.formData.pageNum = v;
  186. this.search();
  187. },
  188. toRecord() {
  189. this.$router.push({
  190. path: "record",
  191. });
  192. },
  193. getSellerInfo() {
  194. getSellerInfo().then((res) => {
  195. this.userInfo = res.data;
  196. });
  197. },
  198. },
  199. };
  200. </script>
  201. <style lang="less" scoped>
  202. /deep/.el-button {
  203. border-radius: 8px;
  204. }
  205. /deep/.el-dialog {
  206. border-radius: 8px;
  207. .el-dialog__header {
  208. padding: 0;
  209. .hearders {
  210. height: 40px;
  211. display: flex;
  212. align-items: center;
  213. justify-content: space-between;
  214. padding: 0px 18px 0px 20px;
  215. border-bottom: 1px solid #e2e2e2;
  216. .leftTitle {
  217. font-size: 14px;
  218. font-weight: bold;
  219. color: #2f4378;
  220. }
  221. .rightBoxs {
  222. display: flex;
  223. align-items: center;
  224. img {
  225. width: 14px;
  226. height: 14px;
  227. margin-left: 13px;
  228. cursor: pointer;
  229. }
  230. }
  231. }
  232. }
  233. .el-dialog__footer {
  234. padding: 0;
  235. .dialog-footer {
  236. padding: 0px 40px;
  237. height: 70px;
  238. border-top: 1px solid #e2e2e2;
  239. display: flex;
  240. align-items: center;
  241. justify-content: flex-end;
  242. }
  243. }
  244. }
  245. .imgBox {
  246. width: 100%;
  247. // height: 210px;
  248. border: 1px solid #e2e2e2;
  249. border-radius: 8px;
  250. padding: 8px 8px 3px;
  251. display: flex;
  252. flex-direction: column;
  253. align-items: center;
  254. .imgLabel {
  255. flex: 1;
  256. width: 100%;
  257. border: 1px dotted #e2e2e2;
  258. color: #999;
  259. font-size: 14px;
  260. cursor: pointer;
  261. border-radius: 8px;
  262. .msPhoto {
  263. display: flex;
  264. justify-content: center;
  265. align-items: center;
  266. max-width: 100%;
  267. max-height: 270px;
  268. img {
  269. max-width: 100%;
  270. max-height: 270px;
  271. }
  272. }
  273. .imgbbx {
  274. display: flex;
  275. flex-direction: column;
  276. align-items: center;
  277. justify-content: center;
  278. width: 100%;
  279. height: 100%;
  280. i {
  281. font-weight: bold;
  282. margin: 14px 0;
  283. font-size: 24px;
  284. }
  285. }
  286. }
  287. p {
  288. margin: 5px 0px;
  289. }
  290. }
  291. .withd-box{
  292. display: flex;
  293. position: absolute;
  294. top: 122px;
  295. left: 200px;
  296. z-index: 10;
  297. div{
  298. margin-right: 20px;
  299. }
  300. }
  301. </style>