project_form.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. <template>
  2. <div>
  3. <div class="i-title">{{ title }}</div>
  4. <div>
  5. <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
  6. <el-tab-pane label="实际营收" name="1">
  7. <div class="header-bar">
  8. <div>
  9. <el-row>
  10. <el-col :span="3"><span class="text-title">实际营收</span></el-col>
  11. <el-col :span="3" :offset="1"><span class="text-title">托管</span></el-col>
  12. <el-col :span="3" :offset="1"><span class="text-title">退款</span></el-col>
  13. </el-row>
  14. </div>
  15. <div>
  16. <el-row>
  17. <el-col :span="3"><span class="red">{{ headerBar.revenue }}</span></el-col>
  18. <el-col :span="3" :offset="1"><span class="red">{{ headerBar.trusteeship }}</span></el-col>
  19. <el-col :span="3" :offset="1"><span class="green">{{ headerBar.refund }}</span></el-col>
  20. </el-row>
  21. </div>
  22. <div>
  23. <el-row>
  24. <el-col :span="3"><span>共{{ headerBar.revenueCount }}笔</span></el-col>
  25. <el-col :span="3" :offset="1"><span>共{{ headerBar.trusteeshipCount }}笔</span></el-col>
  26. <el-col :span="3" :offset="1"><span>共{{ headerBar.refundCount }}笔</span></el-col>
  27. </el-row>
  28. </div>
  29. </div>
  30. </el-tab-pane>
  31. <el-tab-pane label="托管" name="2">
  32. <div class="header-bar">
  33. <div>
  34. <el-row>
  35. <el-col :span="3"><span class="text-title">实际营收</span></el-col>
  36. <el-col :span="3" :offset="1"><span class="text-title">托管</span></el-col>
  37. <el-col :span="3" :offset="1"><span class="text-title">退款</span></el-col>
  38. </el-row>
  39. </div>
  40. <div>
  41. <el-row>
  42. <el-col :span="3"><span class="red">{{ headerBar.revenue }}</span></el-col>
  43. <el-col :span="3" :offset="1"><span class="red">{{ headerBar.trusteeship }}</span></el-col>
  44. <el-col :span="3" :offset="1"><span class="green">{{ headerBar.refund }}</span></el-col>
  45. </el-row>
  46. </div>
  47. <div>
  48. <el-row>
  49. <el-col :span="3"><span>共{{ headerBar.revenueCount }}笔</span></el-col>
  50. <el-col :span="3" :offset="1"><span>共{{ headerBar.trusteeshipCount }}笔</span></el-col>
  51. <el-col :span="3" :offset="1"><span>共{{ headerBar.refundCount }}笔</span></el-col>
  52. </el-row>
  53. </div>
  54. </div>
  55. </el-tab-pane>
  56. <el-tab-pane label="退款" name="3">
  57. <div class="header-bar">
  58. <div>
  59. <el-row>
  60. <el-col :span="3"><span class="text-title">实际营收</span></el-col>
  61. <el-col :span="3" :offset="1"><span class="text-title">托管</span></el-col>
  62. <el-col :span="3" :offset="1"><span class="text-title">退款</span></el-col>
  63. </el-row>
  64. </div>
  65. <div>
  66. <el-row>
  67. <el-col :span="3"><span class="red">{{ headerBar.revenue }}</span></el-col>
  68. <el-col :span="3" :offset="1"><span class="red">{{ headerBar.trusteeship }}</span></el-col>
  69. <el-col :span="3" :offset="1"><span class="green">{{ headerBar.refund }}</span></el-col>
  70. </el-row>
  71. </div>
  72. <div>
  73. <el-row>
  74. <el-col :span="3"><span>共{{ headerBar.revenueCount }}笔</span></el-col>
  75. <el-col :span="3" :offset="1"><span>共{{ headerBar.trusteeshipCount }}笔</span></el-col>
  76. <el-col :span="3" :offset="1"><span>共{{ headerBar.refundCount }}笔</span></el-col>
  77. </el-row>
  78. </div>
  79. </div>
  80. </el-tab-pane>
  81. </el-tabs>
  82. </div>
  83. <div style="text-align: right;margin-bottom: 10px">
  84. <el-button @click="exportList" class="export-excel" type="primary">导出报表</el-button>
  85. </div>
  86. <div>
  87. <el-table :data="tableData" border width="100%">
  88. <el-table-column label="订单名称">
  89. <template slot-scope="scope">
  90. <span class="lblue point">
  91. <nuxt-link
  92. target="_blank"
  93. :to="{path:'/main/orders_detail?id='+scope.row.order_no}"
  94. >{{ scope.row.product_title }}</nuxt-link>
  95. </span>
  96. </template>
  97. </el-table-column>
  98. <el-table-column label="用户">
  99. <template slot-scope="scope">
  100. <a
  101. class="link-type"
  102. :href="scope.row.user_url"
  103. target="_blank"
  104. >{{ scope.row.user_info.nickname }}({{ scope.row.uid }})</a>
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="实际金额">
  108. <template slot-scope="scope">
  109. <template v-if="scope.row.channel != 'admin_confirm'">
  110. <!-- 技术信用-->
  111. <div
  112. v-if="scope.row.product_type == 13"
  113. >
  114. <!--退款-->
  115. <span
  116. v-if="scope.row.order_type == 8"
  117. >{{ (scope.row.real_amount / 100).toFixed(2) }}
  118. </span>
  119. <template v-else-if="scope.row.order_type == 4">
  120. <!--如果不是余额购买-->
  121. <span v-if="scope.row.channel != 'balance'" class="red">
  122. +{{ (scope.row.real_amount / 100).toFixed(2) }}
  123. </span>
  124. <span v-else>
  125. +{{ (scope.row.real_amount / 100).toFixed(2) }}
  126. </span>
  127. </template>
  128. <span v-else>{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
  129. </div>
  130. <!-- 提现-->
  131. <div v-else-if="scope.row.product_type == 200">
  132. <span class="green">
  133. {{ (scope.row.real_amount / 100).toFixed(2) }}
  134. </span>
  135. </div>
  136. <!-- 充值-->
  137. <div v-else-if="scope.row.product_type == 3">
  138. <div v-if="scope.row.operator_uid==41266">
  139. +{{ (scope.row.real_amount / 100).toFixed(2) }}
  140. </div>
  141. <div v-else>
  142. <span class="red">+{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
  143. </div>
  144. </div>
  145. <!-- 扣款-->
  146. <div v-else-if="scope.row.product_type == 300">
  147. <div v-if="scope.row.operator_uid==41266">
  148. +{{ (scope.row.real_amount / 100).toFixed(2) }}
  149. </div>
  150. <div v-else>
  151. <span class="red">+{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
  152. </div>
  153. </div>
  154. <!-- 云端意向金-->
  155. <div v-else-if="scope.row.product_type == 8">
  156. <!--如果不是余额购买-->
  157. <span v-if="scope.row.channel != 'balance'" class="red">
  158. +{{ (scope.row.real_amount / 100).toFixed(2) }}
  159. </span>
  160. <span v-else>
  161. +{{ (scope.row.real_amount / 100).toFixed(2) }}
  162. </span>
  163. </div>
  164. <!-- 雇佣-->
  165. <div v-else-if="scope.row.product_type == 4">
  166. <!--退款-->
  167. <span v-if="scope.row.order_type == 8">{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
  168. <!--结薪-->
  169. <span v-else-if="scope.row.order_type == 5">{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
  170. <template v-else-if="scope.row.order_type == 4 || scope.row.order_type == 1">
  171. <!--如果不是余额购买-->
  172. <span v-if="scope.row.channel != 'balance'" class="red">
  173. +{{ (scope.row.real_amount / 100).toFixed(2) }}
  174. </span>
  175. <span v-else>
  176. +{{ (scope.row.real_amount / 100).toFixed(2) }}
  177. </span>
  178. </template>
  179. <span v-else>{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
  180. </div>
  181. <!-- 云端押金-->
  182. <div v-else-if="scope.row.product_type == 400">
  183. <!--退款-->
  184. <span v-if="scope.row.order_type == 8">{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
  185. <template v-else-if="scope.row.order_type == 1">
  186. <!--如果不是余额购买-->
  187. <span v-if="scope.row.channel != 'balance'" class="red">
  188. +{{ (scope.row.real_amount / 100).toFixed(2) }}
  189. </span>
  190. <span v-else>
  191. +{{ (scope.row.real_amount / 100).toFixed(2) }}
  192. </span>
  193. </template>
  194. <span v-else>{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
  195. </div>
  196. <!-- 云端工作-->
  197. <div v-else-if="scope.row.product_type == 9">
  198. <!--退款-->
  199. <span v-if="scope.row.order_type == 8">{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
  200. <!--结薪-->
  201. <template v-else-if="scope.row.order_type == 5">
  202. <!--如果不是余额购买-->
  203. <span v-if="scope.row.channel != 'balance' && scope.row.channel != 'qingtuanbao'" >
  204. {{ (scope.row.real_amount / 100).toFixed(2) }}
  205. </span>
  206. <span v-else>
  207. {{ (scope.row.real_amount / 100).toFixed(2) }}
  208. </span>
  209. </template>
  210. <!--托管-->
  211. <template v-else-if="scope.row.order_type == 1">
  212. <!--如果不是余额购买-->
  213. <span v-if="scope.row.channel != 'balance'" class="red">
  214. +{{ (scope.row.real_amount / 100).toFixed(2) }}
  215. </span>
  216. <span v-else>
  217. +{{ (scope.row.real_amount / 100).toFixed(2) }}
  218. </span>
  219. </template>
  220. <span v-else>{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
  221. </div>
  222. <!-- 整包-->
  223. <div v-else-if="scope.row.product_type == 2">
  224. <!--退款-->
  225. <span v-if="scope.row.order_type == 8">{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
  226. <!--结薪-->
  227. <template v-else-if="scope.row.order_type == 5">
  228. <!--如果不是余额购买-->
  229. <span v-if="scope.row.channel != 'balance' && scope.row.channel != 'qingtuanbao'" >
  230. {{ (scope.row.real_amount / 100).toFixed(2) }}
  231. </span>
  232. <span v-else>
  233. {{ (scope.row.real_amount / 100).toFixed(2) }}
  234. </span>
  235. </template>
  236. <!--托管-->
  237. <template v-else-if="scope.row.order_type == 1">
  238. <!--如果不是余额购买-->
  239. <span v-if="scope.row.channel != 'balance' && scope.row.channel != 'qingtuanbao'" class="red">
  240. +{{ (scope.row.real_amount / 100).toFixed(2) }}
  241. </span>
  242. <span v-else>
  243. +{{ (scope.row.real_amount / 100).toFixed(2) }}
  244. </span>
  245. </template>
  246. <!--解冻-->
  247. <template v-else-if="scope.row.order_type == 7">
  248. <!--如果不是余额购买-->
  249. <span v-if="scope.row.channel != 'balance' && scope.row.channel != 'qingtuanbao'" class="green">
  250. {{ (scope.row.real_amount / 100).toFixed(2) }}
  251. </span>
  252. <span v-else>
  253. {{ (scope.row.real_amount / 100).toFixed(2) }}
  254. </span>
  255. </template>
  256. <span v-else>{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
  257. </div>
  258. <!-- 查看机会-->
  259. <div v-else-if="scope.row.product_type == 1">
  260. <!--如果不是余额购买-->
  261. <span v-if="scope.row.channel != 'balance'" class="red">
  262. +{{ (scope.row.real_amount / 100).toFixed(2) }}
  263. </span>
  264. <span v-else>
  265. +{{ (scope.row.real_amount / 100).toFixed(2) }}
  266. </span>
  267. </div>
  268. <!-- 其他-->
  269. <div v-else>
  270. <!--如果不是余额购买-->
  271. <span v-if="scope.row.channel != 'balance'" class="red">
  272. +{{ (scope.row.real_amount / 100).toFixed(2) }}
  273. </span>
  274. <span v-else>
  275. +{{ (scope.row.real_amount / 100).toFixed(2) }}
  276. </span>
  277. </div>
  278. </template>
  279. <template v-else>
  280. <div v-if="scope.row.operator_uid != '41266'">
  281. <span
  282. v-if="parseInt(scope.row.real_amount)>0"
  283. class="red"
  284. >+{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
  285. <span
  286. v-else-if="parseInt(scope.row.real_amount) == 0">{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
  287. <span v-else class="green">{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
  288. </div>
  289. <div v-else>
  290. <span
  291. v-if="parseInt(scope.row.real_amount)>0"
  292. >+{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
  293. <span
  294. v-else-if="parseInt(scope.row.real_amount) == 0">{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
  295. <span v-else>{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
  296. </div>
  297. </template>
  298. </template>
  299. </el-table-column>
  300. <el-table-column prop="channel_name" label="支付方式"></el-table-column>
  301. <el-table-column prop="order_state_name" label="订单状态"></el-table-column>
  302. <el-table-column prop label="创建时间">
  303. <template slot-scope="scope">
  304. <span>{{ formatDate(scope.row.created_at) }}</span>
  305. </template>
  306. </el-table-column>
  307. <el-table-column prop="name" label="到账时间">
  308. <template slot-scope="scope">
  309. <span>{{ formatDate(scope.row.pay_time) }}</span>
  310. </template>
  311. </el-table-column>
  312. <el-table-column prop label="订单编号">
  313. <template slot-scope="scope">
  314. <nuxt-link
  315. target="_blank"
  316. :to="{path:'/main/orders_detail?id='+scope.row.order_no}"
  317. >{{ scope.row.order_no }}
  318. </nuxt-link>
  319. </template>
  320. </el-table-column>
  321. <el-table-column prop="out_order_id" label="支付编号"></el-table-column>
  322. <el-table-column width="100" label="订单类型">
  323. <template slot-scope="scope">{{ scope.row.product_type_name }}</template>
  324. </el-table-column>
  325. <el-table-column prop="order_type_name" label="交易类型">
  326. <template slot-scope="scope">
  327. <span>{{ scope.row.order_type_name }}</span>
  328. </template>
  329. </el-table-column>
  330. <el-table-column label="关联项目">
  331. <template slot-scope="scope">
  332. <a
  333. :href="scope.row.related_project.url?scope.row.related_project.url:'#'"
  334. target="_blank"
  335. >
  336. <span
  337. class="lblue"
  338. >{{ scope.row.related_project.name ? scope.row.related_project.name : "--" }}</span>
  339. </a>
  340. </template>
  341. </el-table-column>
  342. <el-table-column prop="operator_uid" label="人工">
  343. <template slot-scope="scope">
  344. <span v-if="scope.row.operator_info.nickname">{{ scope.row.operator_info.nickname }}</span>
  345. <span>({{ scope.row.operator_uid }})</span>
  346. </template>
  347. </el-table-column>
  348. </el-table>
  349. </div>
  350. <div>
  351. <el-pagination
  352. @current-change="onClickPage"
  353. :current-page.sync="pageInfo.page"
  354. :page-size="pageInfo.size"
  355. layout="total, prev, pager, next"
  356. :total="pageInfo.total"
  357. ></el-pagination>
  358. </div>
  359. </div>
  360. </template>
  361. <script>
  362. export default {
  363. data() {
  364. return {
  365. pageInfo: {
  366. page: 1,
  367. size: 20,
  368. total: 0,
  369. },
  370. headerBar: {
  371. revenue: 0,
  372. trusteeship: 0,
  373. refund: 0,
  374. revenueCount: 0,
  375. trusteeshipCount: 0,
  376. refundCount: 0,
  377. },
  378. title: "",
  379. activeName: '1',
  380. orderType: "",
  381. tableData: [],
  382. queryData: {}
  383. };
  384. },
  385. mounted() {
  386. if (!this.queryDataFormat()) {
  387. return false;
  388. }
  389. this.getHeaderBar();
  390. this.getTableData();
  391. },
  392. methods: {
  393. // 获取列表数据
  394. async getTableData() {
  395. this.$post("/api/admin/order/get_orders", this.queryData).then(res => {
  396. let data = res.data;
  397. if (res.status === 1) {
  398. this.tableData = data.orders;
  399. this.pageInfo.total = data.count;
  400. }
  401. });
  402. },
  403. async getHeaderBar() {
  404. if (!this.queryData.start_time || !this.queryData.end_time || !this.queryData.product_type) {
  405. this.$message.error('参数异常');
  406. return;
  407. }
  408. let data = {
  409. start_time: this.queryData.start_time,
  410. end_time: this.queryData.end_time,
  411. product_type: this.queryData.product_type
  412. };
  413. this.$post("/api/admin/ReportForm/getFormBar", data).then(res => {
  414. let data = res.data;
  415. if (res.status === 1) {
  416. this.headerBar.trusteeship = (data.trusteeshipAmount * 1).toFixed(2);
  417. this.headerBar.refund = (data.refundAmount * 1).toFixed(2);
  418. this.headerBar.trusteeshipCount = data.trusteeshipCount;
  419. this.headerBar.refundCount = data.refundCount;
  420. // let amount = data.trusteeshipAmount - data.refundAmount;
  421. let count = data.trusteeshipCount - data.refundCount;
  422. // this.headerBar.revenue = amount > 0 ? amount : 0;
  423. this.headerBar.revenue = (data.revenue * 1).toFixed(2);
  424. this.headerBar.revenueCount = count > 0 ? count : 0;
  425. }
  426. });
  427. },
  428. async exportList() {
  429. let url =
  430. window.location.host +
  431. "/api/admin/order/export?product_type=" +
  432. this.queryData.product_type +
  433. "&start_time=" +
  434. this.queryData.start_time +
  435. "&end_time=" +
  436. this.queryData.end_time +
  437. "&date_type=" +
  438. this.queryData.date_type +
  439. "&status=" +
  440. this.queryData.status +
  441. "&artificial_mark=" +
  442. 0;
  443. if (this.orderType !== "") {
  444. url += "&order_type=" + this.orderType;
  445. } else {
  446. url += "&active_name=all";
  447. }
  448. window.location.href = "https://" + url;
  449. },
  450. onClickPage(){
  451. this.queryDataFormat();
  452. this.getTableData();
  453. },
  454. handleClick(tab, event) {
  455. if (tab.name === "2") {
  456. this.orderType = "1"; //托管
  457. } else if (tab.name === "3") {
  458. this.orderType = "8"; //退款
  459. } else {
  460. this.orderType = "";
  461. }
  462. this.queryDataFormat();
  463. this.getTableData();
  464. },
  465. queryDataFormat() {
  466. let query = this.$route.query;
  467. if (JSON.stringify(query) === "{}") {
  468. this.$message.error('参数不正确');
  469. return false;
  470. }
  471. this.orderType = this.orderType !== "" ? this.orderType : query.orderType || this.orderType;
  472. let data = {
  473. view: "platform",
  474. product_type: query.product_type, //项目类型2整包4雇佣9云端
  475. start_time: query.start_time,
  476. end_time: query.end_time,
  477. // order_type:1,
  478. date_type: query.date_type || 2, //1到账时间2创建时间
  479. status: 401, //401订单支付成功
  480. artificial_mark: 0, //0为开启人工财务1开启
  481. page: this.pageInfo.page,
  482. page_size: this.pageInfo.size
  483. }
  484. if (this.orderType !== "") {
  485. data.order_type = this.orderType;
  486. } else {
  487. // data.active_name = 'all';
  488. data.order_type = 1;
  489. }
  490. this.formatTitle(data.product_type);
  491. this.queryData = data;
  492. return true;
  493. },
  494. formatTitle(type) {
  495. type = type * 1;
  496. let title = '';
  497. switch (type) {
  498. case 2:
  499. title = '整包';
  500. break;
  501. case 4:
  502. title = '雇佣';
  503. break;
  504. case 9:
  505. title = '云端';
  506. break;
  507. case 11:
  508. title = '会员';
  509. break;
  510. case 12:
  511. title = '认证';
  512. break;
  513. case 55:
  514. title = '查看联系方式';
  515. break;
  516. }
  517. this.title = title + "项目详情";
  518. },
  519. formatDate(time) {
  520. if (time === "0") {
  521. return "--";
  522. }
  523. let now = new Date(time * 1000);
  524. let year = now.getFullYear();
  525. let month = now.getMonth() + 1;
  526. let date = now.getDate();
  527. let hour = now.getHours();
  528. let minute = now.getMinutes();
  529. let second = now.getSeconds();
  530. if (hour < 10) {
  531. hour = "0" + hour;
  532. }
  533. if (minute < 10) {
  534. minute = "0" + minute;
  535. }
  536. if (second < 10) {
  537. second = "0" + second;
  538. }
  539. return (
  540. year +
  541. "-" +
  542. month +
  543. "-" +
  544. date +
  545. " " +
  546. hour +
  547. ":" +
  548. minute +
  549. ":" +
  550. second
  551. );
  552. },
  553. }
  554. };
  555. </script>
  556. <style scoped>
  557. .i-title {
  558. margin: 0 0 10px 10px;
  559. font-size: 20px;
  560. font-weight: 600;
  561. }
  562. .table {
  563. height: calc(100% - 80px);
  564. }
  565. .text-title {
  566. font-weight: 600;
  567. }
  568. .header-bar > div {
  569. margin-bottom: 5px;
  570. }
  571. .green {
  572. color: rgba(37, 155, 36, 1);
  573. }
  574. .orange {
  575. color: rgba(255, 152, 0, 1);
  576. }
  577. .red {
  578. color: rgb(255, 2, 30);
  579. }
  580. </style>