user_bills.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. <template>
  2. <div id="mainBody">
  3. <div v-if="user" style="padding: 20px;">
  4. <div style="padding: 20px;display: flex;flex-wrap: wrap;justify-content: space-between;padding-top: 0px">
  5. <div style="width: 50%;margin-top: 15px">订单数量:{{ totalCount }}</div>
  6. <div style="width: 50%;margin-top: 15px">账户余额:{{ balance }}</div>
  7. <div style="width: 50%;margin-top: 15px">收入金额:{{ income_success_sum }}</div>
  8. <div style="width: 50%;margin-top: 15px">支出金额:{{ expense_success_sum }}</div>
  9. <div style="width: 50%;margin-top: 15px">薪资余额:{{ recharge }}</div>
  10. <div style="width: 50%;margin-top: 15px">冻结余额:{{ income }}</div>
  11. </div>
  12. <el-table :data="finaceList" border style="width: 100%;">
  13. <el-table-column prop label="订单名称">
  14. <template slot-scope="scope">
  15. <span class="lblue point">
  16. <nuxt-link
  17. target="_blank"
  18. :to="{path:'/main/orders_detail?id='+scope.row.order_no}"
  19. >{{ scope.row.product_title }}</nuxt-link>
  20. </span>
  21. </template>
  22. </el-table-column>
  23. <el-table-column label="实际金额">
  24. <template slot-scope="scope">
  25. <template v-if="scope.row.channel != 'admin_confirm'">
  26. <!-- 技术信用-->
  27. <div
  28. v-if="scope.row.product_type == 13"
  29. >
  30. <!--退款-->
  31. <span
  32. v-if="scope.row.order_type == 8"
  33. >{{ (scope.row.real_amount).toFixed(2) }}
  34. </span>
  35. <template v-else-if="scope.row.order_type == 4">
  36. <!--如果不是余额购买-->
  37. <span v-if="scope.row.channel != 'balance'" class="red">
  38. +{{ (scope.row.real_amount).toFixed(2) }}
  39. </span>
  40. <span v-else>
  41. +{{ (scope.row.real_amount).toFixed(2) }}
  42. </span>
  43. </template>
  44. <span v-else>{{ (scope.row.real_amount).toFixed(2) }}</span>
  45. </div>
  46. <!-- 提现-->
  47. <div v-else-if="scope.row.product_type == 200">
  48. <span class="green">
  49. {{ (scope.row.real_amount).toFixed(2) }}
  50. </span>
  51. </div>
  52. <!-- 充值-->
  53. <div v-else-if="scope.row.product_type == 3">
  54. <div v-if="scope.row.operator_uid==41266">
  55. +{{ (scope.row.real_amount).toFixed(2) }}
  56. </div>
  57. <div v-else>
  58. <span class="red">+{{ (scope.row.real_amount).toFixed(2) }}</span>
  59. </div>
  60. </div>
  61. <!-- 扣款-->
  62. <div v-else-if="scope.row.product_type == 300">
  63. <div v-if="scope.row.operator_uid==41266">
  64. +{{ (scope.row.real_amount).toFixed(2) }}
  65. </div>
  66. <div v-else>
  67. <span class="red">+{{ (scope.row.real_amount).toFixed(2) }}</span>
  68. </div>
  69. </div>
  70. <!-- 云端意向金-->
  71. <div v-else-if="scope.row.product_type == 8">
  72. <!--如果不是余额购买-->
  73. <span v-if="scope.row.channel != 'balance'" class="red">
  74. +{{ (scope.row.real_amount).toFixed(2) }}
  75. </span>
  76. <span v-else>
  77. +{{ (scope.row.real_amount).toFixed(2) }}
  78. </span>
  79. </div>
  80. <!-- 雇佣-->
  81. <div v-else-if="scope.row.product_type == 4">
  82. <!--退款-->
  83. <span v-if="scope.row.order_type == 8">{{ (scope.row.real_amount).toFixed(2) }}</span>
  84. <!--结薪-->
  85. <span v-else-if="scope.row.order_type == 5">{{ (scope.row.real_amount).toFixed(2) }}</span>
  86. <template v-else-if="scope.row.order_type == 4 || scope.row.order_type == 1">
  87. <!--如果不是余额购买-->
  88. <span v-if="scope.row.channel != 'balance'" class="red">
  89. +{{ (scope.row.real_amount).toFixed(2) }}
  90. </span>
  91. <span v-else>
  92. +{{ (scope.row.real_amount).toFixed(2) }}
  93. </span>
  94. </template>
  95. <span v-else>{{ (scope.row.real_amount).toFixed(2) }}</span>
  96. </div>
  97. <!-- 云端押金-->
  98. <div v-else-if="scope.row.product_type == 400">
  99. <!--退款-->
  100. <span v-if="scope.row.order_type == 8">{{ (scope.row.real_amount).toFixed(2) }}</span>
  101. <template v-else-if="scope.row.order_type == 1">
  102. <!--如果不是余额购买-->
  103. <span v-if="scope.row.channel != 'balance'" class="red">
  104. +{{ (scope.row.real_amount).toFixed(2) }}
  105. </span>
  106. <span v-else>
  107. +{{ (scope.row.real_amount).toFixed(2) }}
  108. </span>
  109. </template>
  110. <span v-else>{{ (scope.row.real_amount).toFixed(2) }}</span>
  111. </div>
  112. <!-- 云端工作-->
  113. <div v-else-if="scope.row.product_type == 9">
  114. <!--退款-->
  115. <span v-if="scope.row.order_type == 8">{{ (scope.row.real_amount).toFixed(2) }}</span>
  116. <!--结薪-->
  117. <template v-else-if="scope.row.order_type == 5">
  118. <!--如果不是余额购买-->
  119. <span v-if="scope.row.channel != 'balance' && scope.row.channel != 'qingtuanbao'">
  120. {{ (scope.row.real_amount).toFixed(2) }}
  121. </span>
  122. <span v-else>
  123. {{ (scope.row.real_amount).toFixed(2) }}
  124. </span>
  125. </template>
  126. <!--托管-->
  127. <template v-else-if="scope.row.order_type == 1">
  128. <!--如果不是余额购买-->
  129. <span v-if="scope.row.channel != 'balance'" class="red">
  130. +{{ (scope.row.real_amount).toFixed(2) }}
  131. </span>
  132. <span v-else>
  133. +{{ (scope.row.real_amount).toFixed(2) }}
  134. </span>
  135. </template>
  136. <span v-else>{{ (scope.row.real_amount).toFixed(2) }}</span>
  137. </div>
  138. <!-- 整包-->
  139. <div v-else-if="scope.row.product_type == 2">
  140. <!--退款-->
  141. <span v-if="scope.row.order_type == 8">{{ (scope.row.real_amount).toFixed(2) }}</span>
  142. <!--结薪-->
  143. <template v-else-if="scope.row.order_type == 5">
  144. <!--如果不是余额购买-->
  145. <span v-if="scope.row.channel != 'balance' && scope.row.channel != 'qingtuanbao'">
  146. {{ (scope.row.real_amount).toFixed(2) }}
  147. </span>
  148. <span v-else>
  149. {{ (scope.row.real_amount).toFixed(2) }}
  150. </span>
  151. </template>
  152. <!--托管-->
  153. <template v-else-if="scope.row.order_type == 1">
  154. <!--如果不是余额购买-->
  155. <span v-if="scope.row.channel != 'balance' && scope.row.channel != 'qingtuanbao'" class="red">
  156. +{{ (scope.row.real_amount).toFixed(2) }}
  157. </span>
  158. <span v-else>
  159. +{{ (scope.row.real_amount).toFixed(2) }}
  160. </span>
  161. </template>
  162. <!--解冻-->
  163. <template v-else-if="scope.row.order_type == 7">
  164. <!--如果不是余额购买-->
  165. <span v-if="scope.row.channel != 'balance' && scope.row.channel != 'qingtuanbao'" class="green">
  166. {{ (scope.row.real_amount).toFixed(2) }}
  167. </span>
  168. <span v-else>
  169. {{ (scope.row.real_amount).toFixed(2) }}
  170. </span>
  171. </template>
  172. <span v-else>{{ (scope.row.real_amount).toFixed(2) }}</span>
  173. </div>
  174. <!-- 查看机会-->
  175. <div v-else-if="scope.row.product_type == 1">
  176. <!--如果不是余额购买-->
  177. <span v-if="scope.row.channel != 'balance'" class="red">
  178. +{{ (scope.row.real_amount).toFixed(2) }}
  179. </span>
  180. <span v-else>
  181. +{{ (scope.row.real_amount).toFixed(2) }}
  182. </span>
  183. </div>
  184. <!-- 其他-->
  185. <div v-else>
  186. <!--如果不是余额购买-->
  187. <span v-if="scope.row.channel != 'balance'" class="red">
  188. +{{ (scope.row.real_amount).toFixed(2) }}
  189. </span>
  190. <span v-else>
  191. +{{ (scope.row.real_amount).toFixed(2) }}
  192. </span>
  193. </div>
  194. </template>
  195. <template v-else>
  196. <div v-if="scope.row.operator_uid != '41266'">
  197. <span
  198. v-if="parseInt((scope.row.real_amount).toFixed(2))>0"
  199. class="red"
  200. >+{{ (scope.row.real_amount).toFixed(2) }}</span>
  201. <span
  202. v-else-if="parseInt((scope.row.real_amount).toFixed(2)) == 0">{{
  203. (scope.row.real_amount).toFixed(2)
  204. }}</span>
  205. <span v-else class="green">{{ (scope.row.real_amount).toFixed(2) }}</span>
  206. </div>
  207. <div v-else>
  208. <span
  209. v-if="parseInt((scope.row.real_amount).toFixed(2))>0"
  210. >+{{ (scope.row.real_amount).toFixed(2) }}</span>
  211. <span
  212. v-else-if="parseInt((scope.row.real_amount).toFixed(2)) == 0">{{
  213. (scope.row.real_amount).toFixed(2)
  214. }}</span>
  215. <span v-else>{{ (scope.row.real_amount).toFixed(2) }}</span>
  216. </div>
  217. </template>
  218. </template>
  219. </el-table-column>
  220. <el-table-column prop label="当前余额">
  221. <template slot-scope="scope">{{ scope.row.total_balance ? scope.row.total_balance : '--' }}</template>
  222. </el-table-column>
  223. <el-table-column prop label="支付方式">
  224. <template slot-scope="scope">{{ scope.row.channel_name }}</template>
  225. </el-table-column>
  226. <el-table-column prop label="创建时间">
  227. <template slot-scope="scope">{{ scope.row.created_at_name }}</template>
  228. </el-table-column>
  229. </el-table>
  230. </div>
  231. <div class="order-footer">
  232. <el-pagination
  233. background
  234. @current-change="getFinanceList"
  235. @size-change="changePageSize"
  236. :current-page.sync="currentPage"
  237. :page-sizes="[10, 20, 30, 40]"
  238. :page-size="20"
  239. layout="total, sizes, prev, pager, next, jumper"
  240. :total="totalCount"
  241. ></el-pagination>
  242. </div>
  243. </div>
  244. </template>
  245. <script>
  246. export default {
  247. props: {
  248. uid: {
  249. type: Number,
  250. default: 0
  251. }
  252. },
  253. data() {
  254. return {
  255. user: {},
  256. orderState: 401,
  257. tradeList: [
  258. {
  259. id: 0,
  260. type: "全部"
  261. },
  262. {
  263. id: 1,
  264. type: "充值"
  265. },
  266. {
  267. id: 2,
  268. type: "提现"
  269. },
  270. {
  271. id: 3,
  272. type: "购买"
  273. },
  274. {
  275. id: 4,
  276. type: "购买"
  277. }
  278. ],
  279. finaceList: [],
  280. // 下发的总数据
  281. totalData: {},
  282. // 负责人
  283. checkUser: "",
  284. // 审核人列表
  285. periodStatusList: [],
  286. // 数据总条目
  287. totalCount: 1,
  288. currentPage: 1,
  289. currentPageSize: 20,
  290. // 列表数据
  291. tableData: [],
  292. balance: 0,
  293. income: 0,
  294. recharge: 0,
  295. orderTypesOption: [],
  296. orderStateOption: [],
  297. payList: [],
  298. payListPop: [],
  299. productTypePop: [],
  300. TypeList: [],
  301. };
  302. },
  303. computed: {
  304. isTest() {
  305. return this.localData.env === "test";
  306. }
  307. },
  308. mounted() {
  309. this.getAllChoice();
  310. this.getFinanceList();
  311. },
  312. methods: {
  313. changePageSize(val) {
  314. this.getFinanceList();
  315. },
  316. // 获取列表数据
  317. async getFinanceList() {
  318. let body = {
  319. page: this.currentPage,
  320. page_size: this.currentPageSize,
  321. user: this.uid,
  322. status: this.orderState,
  323. };
  324. const res = await this.$post("/api/admin/order/get_user_orders", body);
  325. var data = res.data;
  326. this.finaceList = data.orders;
  327. this.totalCount = Number(data.count);
  328. this.successCount = Number(data.successCount);
  329. this.income_sum = Number(data.income_sum);
  330. this.income_success_sum = Number(data.income_success_sum);
  331. this.expense_sum = Number(data.expense_sum);
  332. this.expense_success_sum = Number(data.expense_success_sum);
  333. this.balance = data.total_balance.total_balance;
  334. this.income = data.total_balance.income_tax_balance ? data.total_balance.income_tax_balance / 100 : 0;
  335. this.recharge = data.total_balance.recharge_balance ? data.total_balance.recharge_balance / 100 : 0;
  336. this.user = data.user;
  337. //console.log(this.user.nickname);
  338. },
  339. async downFinanceList() {
  340. let body = {
  341. page: this.currentPage,
  342. page_size: this.currentPageSize,
  343. user: this.$route.query.user
  344. };
  345. // const res = await this.$get("/api/admin/order/get_orders", body);
  346. var url =
  347. this.$store.state.domainConfig.siteUrl +
  348. "/api/admin/order/export?" +
  349. "artificial_mark=1";
  350. console.log(url);
  351. window.location.href = url;
  352. },
  353. async getAllChoice() {
  354. let body = {};
  355. const res = await this.$post("/api/admin/order/get_all_choice");
  356. let data = res.data;
  357. this.orderTypesOption = data.order_types;
  358. this.orderTypesOption.unshift({
  359. id: "",
  360. name: "全部"
  361. });
  362. this.orderStateOption = data.order_state;
  363. console.log(this.orderStateOption)
  364. this.payList = data.channels;
  365. this.payList.unshift({
  366. id: 0,
  367. name: "全部"
  368. });
  369. this.payListPop[0] = this.payList.pop();
  370. this.payListPop[1] = this.payList.pop();
  371. this.payListPop[2] = this.payList.pop();
  372. this.payList.push({
  373. id: "扩展",
  374. name: ">>"
  375. });
  376. this.TypeList = data.product_types;
  377. this.TypeList.unshift({
  378. id: 0,
  379. name: "全部"
  380. });
  381. for (let i = 0; i < 10; i++) {
  382. this.productTypePop[i] = this.TypeList.pop();
  383. }
  384. this.TypeList.push({
  385. id: "扩展",
  386. name: ">>"
  387. });
  388. }
  389. }
  390. };
  391. </script>
  392. <style lang="scss" scoped>
  393. .user-name {
  394. margin-bottom: 10px;
  395. }
  396. .user-info {
  397. margin-bottom: 10px;
  398. }
  399. .order-footer {
  400. margin-top: 20px;
  401. /*position: absolute;*/
  402. /*bottom: 10px;*/
  403. /*left: 10px;*/
  404. }
  405. .product_title {
  406. overflow: hidden;
  407. -webkit-line-clamp: 1;
  408. text-overflow: ellipsis;
  409. display: -webkit-box;
  410. -webkit-box-orient: vertical;
  411. }
  412. #mainBody {
  413. white-space: nowrap;
  414. overflow-x: scroll;
  415. height: calc(100% - 40px);
  416. }
  417. .orange {
  418. color: rgba(255, 152, 0, 1);
  419. }
  420. .red {
  421. color: rgb(255, 2, 30);
  422. }
  423. .green {
  424. color: rgba(37, 155, 36, 1);
  425. }
  426. </style>