project_form.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  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'" class="green">
  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'" class="green">
  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;
  417. this.headerBar.refund = data.refundAmount * 1;
  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.revenueCount = count > 0 ? count : 0;
  424. }
  425. });
  426. },
  427. async exportList() {
  428. let url =
  429. window.location.host +
  430. "/api/admin/order/export?product_type=" +
  431. this.queryData.product_type +
  432. "&start_time=" +
  433. this.queryData.start_time +
  434. "&end_time=" +
  435. this.queryData.end_time +
  436. "&date_type=" +
  437. this.queryData.date_type +
  438. "&status=" +
  439. this.queryData.status +
  440. "&artificial_mark=" +
  441. 0;
  442. if (this.orderType !== "") {
  443. url += "&order_type=" + this.orderType;
  444. } else {
  445. url += "&active_name=all";
  446. }
  447. window.location.href = "http://" + url;
  448. },
  449. onClickPage(){
  450. this.queryDataFormat();
  451. this.getTableData();
  452. },
  453. handleClick(tab, event) {
  454. if (tab.name === "2") {
  455. this.orderType = "1"; //托管
  456. } else if (tab.name === "3") {
  457. this.orderType = "8"; //退款
  458. } else {
  459. this.orderType = "";
  460. }
  461. this.queryDataFormat();
  462. this.getTableData();
  463. },
  464. queryDataFormat() {
  465. let query = this.$route.query;
  466. if (JSON.stringify(query) === "{}") {
  467. this.$message.error('参数不正确');
  468. return false;
  469. }
  470. this.orderType = this.orderType !== "" ? this.orderType : query.orderType || this.orderType;
  471. let data = {
  472. view: "platform",
  473. product_type: query.product_type, //项目类型2整包4雇佣9云端
  474. start_time: query.start_time,
  475. end_time: query.end_time,
  476. date_type: query.date_type || 2, //1到账时间2创建时间
  477. status: 401, //401订单支付成功
  478. artificial_mark: 0, //0为开启人工财务1开启
  479. page: this.pageInfo.page,
  480. page_size: this.pageInfo.size
  481. }
  482. if (this.orderType !== "") {
  483. data.order_type = this.orderType;
  484. } else {
  485. data.active_name = 'all';
  486. }
  487. this.formatTitle(data.product_type);
  488. this.queryData = data;
  489. return true;
  490. },
  491. formatTitle(type) {
  492. type = type * 1;
  493. let title = '';
  494. switch (type) {
  495. case 2:
  496. title = '整包';
  497. break;
  498. case 4:
  499. title = '雇佣';
  500. break;
  501. case 9:
  502. title = '云端';
  503. break;
  504. case 11:
  505. title = '会员';
  506. break;
  507. case 12:
  508. title = '认证';
  509. break;
  510. case 55:
  511. title = '查看联系方式';
  512. break;
  513. }
  514. this.title = title + "项目详情";
  515. },
  516. formatDate(time) {
  517. if (time === "0") {
  518. return "--";
  519. }
  520. let now = new Date(time * 1000);
  521. let year = now.getFullYear();
  522. let month = now.getMonth() + 1;
  523. let date = now.getDate();
  524. let hour = now.getHours();
  525. let minute = now.getMinutes();
  526. let second = now.getSeconds();
  527. if (hour < 10) {
  528. hour = "0" + hour;
  529. }
  530. if (minute < 10) {
  531. minute = "0" + minute;
  532. }
  533. if (second < 10) {
  534. second = "0" + second;
  535. }
  536. return (
  537. year +
  538. "-" +
  539. month +
  540. "-" +
  541. date +
  542. " " +
  543. hour +
  544. ":" +
  545. minute +
  546. ":" +
  547. second
  548. );
  549. },
  550. }
  551. };
  552. </script>
  553. <style scoped>
  554. .i-title {
  555. margin: 0 0 10px 10px;
  556. font-size: 20px;
  557. font-weight: 600;
  558. }
  559. .table {
  560. height: calc(100% - 80px);
  561. }
  562. .text-title {
  563. font-weight: 600;
  564. }
  565. .header-bar > div {
  566. margin-bottom: 5px;
  567. }
  568. .green {
  569. color: rgba(37, 155, 36, 1);
  570. }
  571. .orange {
  572. color: rgba(255, 152, 0, 1);
  573. }
  574. .red {
  575. color: rgb(255, 2, 30);
  576. }
  577. </style>