user_bills.vue 16 KB

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