orders.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966
  1. <template>
  2. <div id="cloud-balance" v-if="hasAuth">
  3. <section class="top">
  4. <!-- <h3>交易订单中心</h3> -->
  5. <section>
  6. <div class="type-boxes">
  7. <span class="vsub">订单类型:</span>
  8. <div class="inlineb">
  9. <el-checkbox-group v-model="productType" @change="changeOrder" size="mini">
  10. <el-checkbox-button v-for="itm in TypeList" :label="itm.id" :key="itm.id">{{itm.name}}</el-checkbox-button>
  11. </el-checkbox-group>
  12. </div>
  13. </div>
  14. <div class="type-boxes">
  15. <span class="vsub">支付方式:</span>
  16. <div class="inlineb">
  17. <el-checkbox-group v-model="payType" @change="changePay" size="mini">
  18. <el-checkbox-button v-for="itm in payList" :label="itm.id" :key="itm.id">{{itm.name}}</el-checkbox-button>
  19. </el-checkbox-group>
  20. </div>
  21. <div class="inlineb checkbox-div">
  22. <el-checkbox v-model="checked" >人工财务</el-checkbox>
  23. </div>
  24. </div>
  25. <div class="type-boxes">
  26. <div class="inlineb">
  27. <span class="vsub" >时间范围:</span>
  28. <el-date-picker style="width: 260px;"
  29. v-model="timeRange"
  30. type="daterange"
  31. align="right"
  32. unlink-panels
  33. range-separator="到"
  34. start-placeholder="开始日期"
  35. end-placeholder="结束日期"
  36. :picker-options="pickerOptions2"
  37. ></el-date-picker>
  38. </div>
  39. <div class="inlineb">
  40. <span class="vsub" >时间类型:</span>
  41. <el-select v-model="timeType" placeholder="请选择" style="width: 120px;">
  42. <el-option
  43. v-for="item in timeOptions"
  44. :key="item.value"
  45. :label="item.label"
  46. :value="item.value"
  47. ></el-option>
  48. </el-select>
  49. </div>
  50. <div class="inlineb">
  51. <span class="vsub" >状态:</span>
  52. <div class="inlineb">
  53. <el-select v-model="orderState" clearable placeholder style="width: 140px;">
  54. <el-option
  55. v-for="item of orderStateOption"
  56. :key="item.id"
  57. :label="item.name"
  58. :value="item.id"
  59. ></el-option>
  60. </el-select>
  61. </div>
  62. </div>
  63. <div class="inlineb">
  64. <span class="vsub">交易类型:</span>
  65. <el-select v-model="orderTypes" placeholder="交易类型" style="width: 100px;">
  66. <el-option
  67. v-for="item of orderTypesOption"
  68. :key="item.id"
  69. :label="item.name"
  70. :value="item.id"
  71. ></el-option>
  72. </el-select>
  73. </div>
  74. </div>
  75. <div class="type-boxes">
  76. <div class="inlineb">
  77. <span class="vsub" >编号:</span>
  78. <div class="inlineb">
  79. <el-input style="width: 230px;" v-model="searchId" placeholder="订单编号/订单名称/支付编号"></el-input>
  80. </div>
  81. </div>
  82. <div class="inlineb">
  83. <span class="vsub" >用户:</span>
  84. <div class="inlineb">
  85. <el-input style="width: 180px;" v-model="checkUser" placeholder="uid/昵称/姓名"></el-input>
  86. </div>
  87. </div>
  88. <div class="inlineb">
  89. <span class="vsub" >项目:</span>
  90. <div class="inlineb">
  91. <el-input style="width: 100px;" type="number" v-model="productId" placeholder="项目ID"></el-input>
  92. </div>
  93. </div>
  94. <el-button type="primary" @click="getFinanceList">筛选</el-button>
  95. <el-button @click="downFinanceList" class="export-excel" type="primary">导出报表</el-button>
  96. </div>
  97. <div class="type-boxes">
  98. <el-tabs v-model="activeName" type="border-card" @tab-click="changeTab">
  99. <el-tab-pane label="全部" name="all">
  100. <div class="inlineb tab-item">
  101. <div class="text-title">收入</div>
  102. <div class="text-num green">+ {{totalSuccess}}元</div>
  103. <div class="count">共{{incomeCount}}笔</div>
  104. </div>
  105. <div class="inlineb tab-item">
  106. <div class="text-title">支出</div>
  107. <div class="text-num orange">- {{paySuccess}}元</div>
  108. <div class="count">共{{outcomeCount}}笔</div>
  109. </div>
  110. <div class="inlineb tab-item">
  111. <div class="text-title">内部流转</div>
  112. <div class="inner-text">+ {{innerIncomeSum}}元</div>
  113. <div class="inner-text">- {{innerOutcomeSum}}元</div>
  114. <div class="count">共{{innerCount}}笔</div>
  115. </div>
  116. <div class="inlineb tab-item">
  117. <div class="text-title">冻结订单</div>
  118. <div class="text-num">{{frozenSuccessSum}}元</div>
  119. <div class="count">共{{frozenCount}}笔</div>
  120. </div>
  121. </el-tab-pane>
  122. <el-tab-pane label="平台收入" name="income">
  123. <div class="inlineb tab-item">
  124. <div class="text-title">收入</div>
  125. <div class="text-num green">+ {{totalSuccess}}元</div>
  126. <div class="count">共{{incomeCount}}笔</div>
  127. </div>
  128. </el-tab-pane>
  129. <el-tab-pane label="平台支出" name="outcome">
  130. <div class="inlineb tab-item">
  131. <div class="text-title">支出</div>
  132. <div class="text-num orange">- {{paySuccess}}元</div>
  133. <div class="count">共{{outcomeCount}}笔</div>
  134. </div>
  135. </el-tab-pane>
  136. <el-tab-pane label="内部流转" name="inner">
  137. <div class="inlineb tab-item">
  138. <div class="text-title">内部流转</div>
  139. <div class="inner-text">+ {{innerIncomeSum}}元</div>
  140. <div class="inner-text">- {{innerOutcomeSum}}元</div>
  141. <div class="count">共{{innerCount}}笔</div>
  142. </div>
  143. </el-tab-pane>
  144. </el-tabs>
  145. </div>
  146. </section>
  147. </section>
  148. <div class="trcenter changeheight" width="100%">
  149. <el-table :data="financeList" border height="100%" width="100%">
  150. <el-table-column label="订单名称">
  151. <template slot-scope="scope">
  152. <span class="lblue point">
  153. <nuxt-link target="_blank" :to="{path:'/main/orders_detail?id='+scope.row.order_no}">{{scope.row.product_title}}</nuxt-link>
  154. </span>
  155. </template>
  156. </el-table-column>
  157. <el-table-column label="用户">
  158. <template slot-scope="scope"><a class="link-type" :href="scope.row.user_url" target="_blank">{{scope.row.user_info.nickname}}({{scope.row.uid }})</a> </template>
  159. </el-table-column>
  160. <el-table-column label="实际金额">
  161. <template slot-scope="scope">
  162. <div v-if="scope.row.order_type!=6 && scope.row.channel != 'balance' && scope.row.channel != 'admin_confirm'">
  163. <span v-if="parseInt(scope.row.real_amount)>=0" class="green">+{{(scope.row.real_amount/100).toFixed(2)}}</span>
  164. <span v-else class="orange">{{(scope.row.real_amount/100).toFixed(2)}}</span>
  165. </div>
  166. <div v-else-if="scope.row.channel =='admin_confirm'">
  167. <div v-if="scope.row.operator_uid==41266">
  168. <span v-if="parseInt(scope.row.real_amount)>=0">+{{(scope.row.real_amount/100).toFixed(2)}}</span>
  169. <span v-else>{{(scope.row.real_amount/100).toFixed(2)}}</span>
  170. </div>
  171. <div v-else>
  172. <span v-if="parseInt(scope.row.real_amount)>=0" class="green">+{{(scope.row.real_amount/100).toFixed(2)}}</span>
  173. <span v-else class="orange">{{(scope.row.real_amount/100).toFixed(2)}}</span>
  174. </div>
  175. </div>
  176. <div v-else>
  177. <span v-if="parseInt(scope.row.real_amount)>=0">+{{(scope.row.real_amount/100).toFixed(2)}}</span>
  178. <span v-else>{{(scope.row.real_amount/100).toFixed(2)}}</span>
  179. </div>
  180. </template>
  181. </el-table-column>
  182. <el-table-column prop="channel_name" label="支付方式"></el-table-column>
  183. <el-table-column prop="order_state_name" label="订单状态"></el-table-column>
  184. <el-table-column prop label="创建时间">
  185. <template slot-scope="scope">
  186. <span>{{formatDate(scope.row.created_at)}}</span>
  187. </template>
  188. </el-table-column>
  189. <el-table-column prop="name" label="到账时间">
  190. <template slot-scope="scope">
  191. <span>{{formatDate(scope.row.pay_time)}}</span>
  192. </template>
  193. </el-table-column>
  194. <el-table-column
  195. prop=""
  196. label="订单编号">
  197. <template slot-scope="scope">
  198. <nuxt-link target="_blank" :to="{path:'/main/orders_detail?id='+scope.row.order_no}">{{scope.row.order_no}}</nuxt-link>
  199. </template>
  200. </el-table-column>
  201. <el-table-column prop="out_order_id" label="支付编号"></el-table-column>
  202. <el-table-column width="100" label="订单类型">
  203. <template slot-scope="scope">
  204. {{scope.row.product_type_name}}
  205. </template>
  206. </el-table-column>
  207. <el-table-column prop="order_type_name" label="交易类型">
  208. <template slot-scope="scope">
  209. <span>{{scope.row.order_type_name}}</span>
  210. </template>
  211. </el-table-column>
  212. <el-table-column label="关联项目">
  213. <template slot-scope="scope">
  214. <a :href="scope.row.related_project.url?scope.row.related_project.url:'#'" target="_blank">
  215. <span
  216. class="lblue"
  217. >{{scope.row.related_project.name?scope.row.related_project.name:"--"}}</span>
  218. </a>
  219. </template>
  220. </el-table-column>
  221. <el-table-column prop="operator_uid" label="人工">
  222. <template slot-scope="scope">
  223. <span v-if="scope.row.operator_info.nickname">{{scope.row.operator_info.nickname}}</span>
  224. <span>({{scope.row.operator_uid}})</span>
  225. </template>
  226. </el-table-column>
  227. </el-table>
  228. </div>
  229. <div class="order-footer">
  230. <el-pagination
  231. background
  232. @current-change="getFinanceList"
  233. @size-change="changePageSize"
  234. :current-page.sync="currentPage"
  235. :page-sizes="[10, 20, 30, 40]"
  236. :page-size="20"
  237. layout="total, sizes, prev, pager, next, jumper"
  238. :total="totalCount"
  239. ></el-pagination>
  240. </div>
  241. </div>
  242. </template>
  243. <script>
  244. let firstDayOfThisMonth = new Date();
  245. firstDayOfThisMonth.setDate(1);
  246. firstDayOfThisMonth.setHours(0);
  247. firstDayOfThisMonth.setMinutes(0);
  248. firstDayOfThisMonth.setSeconds(0);
  249. export default {
  250. data() {
  251. return {
  252. tabShow:true,
  253. innerIncomeSum:0,
  254. innerOutcomeSum:0,
  255. incomeCount:0,
  256. innerCount:0,
  257. outcomeCount:0,
  258. frozenCount:0,
  259. activeName: 'all',
  260. hasAuth:1,
  261. frozenSuccessSum:0,
  262. frozenSum:0,
  263. financeList: [],
  264. successCount: 0,
  265. totalHave: 0,
  266. totalSuccess: 0,
  267. PayCount: 0,
  268. paySuccess: 0,
  269. productId: "",
  270. productType: [0],
  271. orderTypes: "",
  272. orderTypesOption: [],
  273. orderState: 401,
  274. orderStateOption: [],
  275. productTypes: "",
  276. productTypesOption: [],
  277. checked: false,
  278. orderType: [0],
  279. tradeType: [0],
  280. payType: [0],
  281. timeType: 2,
  282. payListPop:[],
  283. productTypePop:[],
  284. timeOptions: [
  285. {
  286. value: 1,
  287. label: "到帐时间"
  288. },
  289. {
  290. value: 2,
  291. label: "创建时间"
  292. }
  293. ],
  294. TypeList: [],
  295. tradeList: [],
  296. payList: [],
  297. pickerOptions2: {
  298. shortcuts: [
  299. {
  300. text: "全部",
  301. onClick(picker) {
  302. this.timeRange = [];
  303. picker.$emit("pick", []);
  304. }
  305. },
  306. {
  307. text: "最近7天",
  308. onClick(picker) {
  309. const end = new Date();
  310. const start = new Date();
  311. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  312. picker.$emit("pick", [start, end]);
  313. }
  314. },
  315. {
  316. text: "最近30天",
  317. onClick(picker) {
  318. const end = new Date();
  319. const start = new Date();
  320. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  321. picker.$emit("pick", [start, end]);
  322. }
  323. },
  324. {
  325. text: "本周",
  326. onClick(picker) {
  327. let week = new Date().getDay() - 1;
  328. if (week == -1) {
  329. week = 6;
  330. }
  331. const end = new Date();
  332. const start = new Date();
  333. start.setTime(start.getTime() - 3600 * 1000 * 24 * week);
  334. picker.$emit("pick", [start, end]);
  335. }
  336. },
  337. {
  338. text: "本月",
  339. onClick(picker) {
  340. let month = new Date().getMonth + 1;
  341. let year = new Date().getFullYear();
  342. let day = new Date().getDate() - 1;
  343. const end = new Date();
  344. const start = new Date();
  345. start.setTime(start.getTime() - 3600 * 1000 * 24 * day);
  346. picker.$emit("pick", [start, end]);
  347. }
  348. },
  349. {
  350. text: "本年",
  351. onClick(picker) {
  352. let month = new Date().getMonth + 1;
  353. let year = new Date().getFullYear();
  354. let day = new Date().getDate() - 1;
  355. let firstDay = new Date(year, 0, 1);
  356. let dateDiff = new Date() - firstDay;
  357. let msPerDay = 1000 * 60 * 60 * 24;
  358. //计算天数
  359. let diffDays = Math.ceil(dateDiff / msPerDay) - 1;
  360. const end = new Date();
  361. const start = new Date();
  362. start.setTime(start.getTime() - 3600 * 1000 * 24 * diffDays);
  363. picker.$emit("pick", [start, end]);
  364. }
  365. }
  366. ]
  367. },
  368. timeRange: [firstDayOfThisMonth, new Date()],
  369. arriveTime: "",
  370. searchId: "",
  371. tableData3: [],
  372. // 下发的总数据
  373. totalData: {},
  374. // 项目ID
  375. jobID: "",
  376. // 审核人
  377. period: "",
  378. status: "",
  379. // 状态列表数据
  380. jobStatusList: [],
  381. // 负责人
  382. checkUser: "",
  383. // 审核人列表
  384. periodStatusList: [],
  385. // 数据总条目
  386. totalCount: 0,
  387. currentPage: 1,
  388. currentPageSize: 20,
  389. tableData: [],
  390. localData: {
  391. env: "test"
  392. }
  393. };
  394. },
  395. computed: {
  396. isTest() {
  397. return this.localData.env === "test";
  398. },
  399. whole() {
  400. return this.totalData.whole || {};
  401. },
  402. totalDeposit() {
  403. return this.whole.total_deposit;
  404. },
  405. totalFee() {
  406. return this.whole.total_fee;
  407. }
  408. },
  409. mounted() {
  410. this.getAllChoice();
  411. // this.getTableData();
  412. this.getFinanceList();
  413. },
  414. methods: {
  415. formatDate(time) {
  416. if (time === '0') {
  417. return '--'
  418. }
  419. let now = new Date(time * 1000);
  420. let year = now.getFullYear();
  421. let month = now.getMonth() + 1;
  422. let date = now.getDate();
  423. let hour = now.getHours();
  424. let minute = now.getMinutes();
  425. let second = now.getSeconds();
  426. if (hour < 10) {
  427. hour = "0" + hour;
  428. }
  429. if (minute < 10) {
  430. minute = "0" + minute;
  431. }
  432. if (second < 10) {
  433. second = "0" + second;
  434. }
  435. return (
  436. year +
  437. "-" +
  438. month +
  439. "-" +
  440. date +
  441. " " +
  442. hour +
  443. ":" +
  444. minute +
  445. ":" +
  446. second
  447. );
  448. },
  449. // 改变订单类型
  450. changeOrder() {
  451. let haveAll = false;
  452. for (let i = 0; i < this.productType.length; i++) {
  453. if (this.productType[i] == 0) {
  454. haveAll = true;
  455. }
  456. }
  457. if(this.productType.indexOf('扩展') > -1){
  458. this.productType.pop();
  459. this.TypeList.pop()
  460. for (let i=9;i>=0;i--){
  461. this.TypeList.push(this.productTypePop.pop());
  462. }
  463. this.TypeList.push({
  464. id: '缩进',
  465. name: "<<",
  466. });
  467. }
  468. if(this.productType.indexOf('缩进') > -1){
  469. this.productType.pop();
  470. this.TypeList.pop();
  471. for (let i=0;i<10;i++){
  472. this.productTypePop[i]=this.TypeList.pop();
  473. }
  474. this.TypeList.push({
  475. id: '扩展',
  476. name: ">>",
  477. });
  478. }
  479. // 选择其他的时候,去掉全部,全部在第一位
  480. if (
  481. this.productType[0] == 0 &&
  482. 1 < this.productType.length < this.TypeList.length
  483. ) {
  484. let arr = [];
  485. for (let i = 0; i < this.productType.length; i++) {
  486. if (this.productType[i] != 0) {
  487. arr.push(this.productType[i]);
  488. }
  489. }
  490. this.productType = arr;
  491. }
  492. // 选择全部的时候去掉其他,全部在最后一位
  493. if (this.productType[this.productType.length - 1] == 0) {
  494. this.productType = [0];
  495. }
  496. if (!haveAll && this.productType.length == this.TypeList.length - 1) {
  497. this.productType = [0];
  498. }
  499. if (this.productType.length == 0) {
  500. this.productType = [0];
  501. }
  502. },
  503. // 改变支付方式
  504. changePay() {
  505. let haveAll = false;
  506. for (let i = 0; i < this.payType.length; i++) {
  507. if (this.payType[i] == 0) {
  508. haveAll = true;
  509. }
  510. }
  511. if(this.payType.indexOf('扩展') > -1){
  512. this.payType.pop();
  513. this.payList.pop();
  514. this.payList.push(this.payListPop[0]);
  515. this.payList.push(this.payListPop[1]);
  516. this.payList.push(this.payListPop[2]);
  517. this.payList.push({
  518. id: '缩进',
  519. name: "<<",
  520. });
  521. }
  522. if(this.payType.indexOf('缩进') > -1){
  523. this.payType.pop();
  524. this.payList.pop();
  525. this.payList.pop();
  526. this.payList.pop();
  527. this.payList.pop();
  528. this.payList.push({
  529. id: '扩展',
  530. name: ">>",
  531. });
  532. }
  533. // 选择其他的时候,去掉全部,全部在第一位
  534. if (
  535. this.payType[0] == 0 &&
  536. 1 < this.payType.length < this.payList.length
  537. ) {
  538. let arr = [];
  539. for (let i = 0; i < this.payType.length; i++) {
  540. if (this.payType[i] != 0) {
  541. arr.push(this.payType[i]);
  542. }
  543. }
  544. this.payType = arr;
  545. }
  546. // 选择全部的时候去掉其他,全部在最后一位
  547. if (this.payType[this.payType.length - 1] == 0) {
  548. this.payType = [0];
  549. }
  550. if (!haveAll && this.payType.length == this.payList.length - 1) {
  551. this.payType = [0];
  552. }
  553. if (this.payType.length == 0) {
  554. this.payType = [0];
  555. }
  556. },
  557. clickExport() {
  558. window.open("/api/admin/job/get_all_periods?action=export");
  559. },
  560. /**
  561. * 获取筛选值
  562. */
  563. async getEnum() {
  564. let { data } = await this.$get("/api/admin/job/getEnum");
  565. if (data) {
  566. let { jobStatusList, periodStatusList } = data;
  567. this.jobStatusList = jobStatusList;
  568. this.periodStatusList = periodStatusList;
  569. }
  570. },
  571. // 点击操作
  572. clickOperate({ job_id, id }) {
  573. if (this.isTest)
  574. window.open(
  575. `https://dev.test-rooter.proginn.com/main/wage_settlement?job_id=${job_id}&period_id=${id}`
  576. );
  577. else
  578. window.open(
  579. `https://rooter.proginn.com/main/wage_settlement?job_id=${job_id}&period_id=${id}`
  580. );
  581. },
  582. // 点击账单
  583. clickOrder(i) {
  584. if (this.isTest)
  585. window.open(
  586. `https://dev.test-rooter.proginn.com/main/wage_details?job_id=${i.job_id}&period_id=${i.id}`
  587. );
  588. else
  589. window.open(
  590. `https://rooter.proginn.com/main/wage_details?job_id=${i.job_id}&period_id=${i.id}`
  591. );
  592. },
  593. // 点击开发者
  594. clickDev(uid) {
  595. if (this.isTest)
  596. window.open(`https://dev.test.proginn.com/rooter/user/${uid}`);
  597. else window.open(`https://www.proginn.com/rooter/user/${uid}`);
  598. },
  599. // 点击企业
  600. clickCompany(uid) {
  601. if (this.isTest)
  602. window.open(`https://dev.test.proginn.com/rooter/user/${uid}`);
  603. else window.open(`https://www.proginn.com/rooter/user/${uid}`);
  604. },
  605. // 点击账单id
  606. clickJobID(jobID) {
  607. if (this.isTest)
  608. window.open(
  609. `https://dev.test.proginn.com/rooter/cloudjobitem/${jobID}`
  610. );
  611. else window.open(`https://www.proginn.com/rooter/cloudjobitem/${jobID}`);
  612. },
  613. // 点击重试
  614. async clickRetry(id) {
  615. const res = await this.$post("/api/admin/payment/redoDraw", { id });
  616. },
  617. // 根据状态显示图表样式
  618. tableRowClassName({ row, rowIndex }) {
  619. let className = "";
  620. if (row.j_status_name === "结束合作") className = "end-row";
  621. return className;
  622. },
  623. // 格式化列表数据
  624. formatTableData(data) {
  625. return data.map(i => ({
  626. ...i,
  627. payAround: `${i.start_time}<br>${i.end_time}`,
  628. pre_send_salary_timeShow: new Date(
  629. i.pre_send_salary_time * 1000
  630. ).toLocaleDateString()
  631. }));
  632. },
  633. /**
  634. * 点击筛选确认
  635. */
  636. clickSearchConfirm() {
  637. this.currentPage = 1;
  638. },
  639. changePageSize(pageSize) {
  640. this.currentPageSize = pageSize;
  641. this.getFinanceList();
  642. },
  643. async downFinanceList() {
  644. let checkedTF = 0;
  645. if (this.checked) {
  646. checkedTF = 1;
  647. }
  648. let arr1 = [];
  649. if (this.productType[0] == 0) {
  650. arr1 = "";
  651. } else {
  652. arr1 = this.productType.toString();
  653. }
  654. let arr2 = [];
  655. if (this.payType[0] == 0) {
  656. arr2 = "";
  657. } else {
  658. arr2 = this.payType.toString();
  659. }
  660. let time = 1;
  661. if (this.timeType == "") {
  662. time = "";
  663. } else {
  664. time = this.timeType;
  665. }
  666. let starTime = "";
  667. let endTime = "";
  668. if (this.timeRange.length > 0) {
  669. starTime = this.formatDate(this.timeRange[0] / 1000);
  670. endTime = this.formatDate(this.timeRange[1] / 1000);
  671. } else {
  672. starTime = "";
  673. endTime = "";
  674. }
  675. let url =
  676. window.location.host +
  677. "/api/admin/order/export?product_type=" +
  678. arr1 +
  679. "&order_type=" +
  680. this.orderTypes +
  681. "&channel=" +
  682. arr2 +
  683. "&start_time=" +
  684. starTime +
  685. "&end_time=" +
  686. endTime +
  687. "&date_type=" +
  688. time +
  689. "&status=" +
  690. this.orderState +
  691. "&artificial_mark=" +
  692. checkedTF +
  693. "&order=" +
  694. this.searchId +
  695. "&user=" +
  696. this.checkUser +
  697. "&product_id=" +
  698. this.productId;
  699. window.location.href = "http://" + url;
  700. },
  701. changeTab(){
  702. this.orderTypes='';
  703. this.getFinanceList();
  704. },
  705. getFinanceList() {
  706. if (this.$router.currentRoute.query.user) {
  707. this.checkUser = this.$router.currentRoute.query.user;
  708. }
  709. let checkedTF = 0;
  710. if (this.checked) {
  711. checkedTF = 1;
  712. }
  713. let arr1 = [];
  714. if (this.productType[0] == 0) {
  715. arr1 = "";
  716. } else {
  717. arr1 = this.productType.toString();
  718. }
  719. let arr2 = [];
  720. if (this.payType[0] == 0) {
  721. arr2 = "";
  722. } else {
  723. arr2 = this.payType.toString();
  724. }
  725. let time = 1;
  726. if (this.timeType == "") {
  727. time = "";
  728. } else {
  729. time = this.timeType;
  730. }
  731. let starTime = "";
  732. let endTime = "";
  733. if (this.timeRange) {
  734. if (this.timeRange.length > 0) {
  735. if (
  736. (this.timeRange[0] / 1000) * 1000 ==
  737. (this.timeRange[1] / 1000) * 1000
  738. ) {
  739. let changeEnd =
  740. (this.timeRange[1] / 1000) * 1000 + 24 * 60 * 60 * 1000;
  741. starTime = this.formatDate(this.timeRange[0] / 1000);
  742. endTime = this.formatDate(changeEnd / 1000);
  743. } else {
  744. starTime = this.formatDate(this.timeRange[0] / 1000);
  745. endTime = this.formatDate(this.timeRange[1] / 1000);
  746. }
  747. } else {
  748. starTime = "";
  749. endTime = "";
  750. }
  751. } else {
  752. starTime = "";
  753. endTime = "";
  754. }
  755. let body = {
  756. view:'platform',
  757. product_type: arr1,
  758. order_type: this.orderTypes,
  759. channel: arr2,
  760. start_time: starTime,
  761. end_time: endTime,
  762. date_type: time,
  763. status: this.orderState,
  764. artificial_mark: checkedTF,
  765. order: this.searchId,
  766. user: this.checkUser,
  767. product_id: this.productId,
  768. page: this.currentPage,
  769. page_size: this.currentPageSize
  770. };
  771. if (this.orderTypes==''){
  772. body.active_name=this.activeName;
  773. }else{
  774. this.activeName='all';
  775. }
  776. this.$post("/api/admin/order/get_orders", body).then(res=>{
  777. let data = res.data;
  778. if (res.status === 0)this.hasAuth=0;
  779. if (res.status === 1) {
  780. this.financeList = data.orders;
  781. this.totalCount = data.count;
  782. this.successCount = data.successCount;
  783. this.totalHave = data.income_sum;
  784. this.totalSuccess = data.income_success_sum;
  785. this.PayCount = data.expense_sum;
  786. this.paySuccess = data.expense_success_sum;
  787. this.frozenSum = data.frozen_sum;
  788. this.frozenSuccessSum = data.frozen_success_sum;
  789. this.innerOutcomeSum = data.inner_outcome_sum;
  790. this.innerIncomeSum = data.inner_income_sum;
  791. this.innerCount = data.inner_count;
  792. this.incomeCount = data.income_count;
  793. this.outcomeCount = data.outcome_count;
  794. this.frozenCount = data.frozen_count;
  795. }
  796. });
  797. },
  798. async getAllChoice() {
  799. let body = {};
  800. const res = await this.$post("/api/admin/order/get_all_choice");
  801. let data = res.data;
  802. this.orderTypesOption = data.order_types;
  803. this.orderTypesOption.unshift({
  804. id: "",
  805. name: "全部"
  806. });
  807. this.orderStateOption = data.order_state;
  808. this.payList = data.channels;
  809. this.payList.unshift({
  810. id: 0,
  811. name: "全部"
  812. });
  813. this.payListPop[0] = this.payList.pop();
  814. this.payListPop[1] = this.payList.pop();
  815. this.payListPop[2] = this.payList.pop();
  816. this.payList.push({
  817. id: '扩展',
  818. name: ">>",
  819. });
  820. this.TypeList = data.product_types;
  821. this.TypeList.unshift({
  822. id: 0,
  823. name: "全部"
  824. });
  825. for (let i=0;i<10;i++){
  826. this.productTypePop[i]=this.TypeList.pop();
  827. }
  828. this.TypeList.push({
  829. id: '扩展',
  830. name: ">>",
  831. });
  832. }
  833. },
  834. created() {
  835. }
  836. };
  837. </script>
  838. <style scoped>
  839. .order-footer {
  840. position: absolute;
  841. bottom: 10px;
  842. left: 10px;
  843. }
  844. #order-wrap {
  845. width: 100%;
  846. }
  847. #cloud-balance {
  848. white-space: nowrap;
  849. overflow-x: scroll;
  850. height: calc(100% - 40px);
  851. }
  852. .changeheight {
  853. height: calc(100%) !important;
  854. }
  855. .top {
  856. display: flex;
  857. flex-direction: column;
  858. justify-content: center;
  859. height: 340px;
  860. }
  861. .selector-box {
  862. /* margin-top: 10px; */
  863. }
  864. .selector-box {
  865. display: flex;
  866. justify-content: space-between;
  867. }
  868. /* .selector-box-left {
  869. } */
  870. .table {
  871. margin-top: 10px;
  872. height: calc(100% - 320px);
  873. }
  874. .order-table {
  875. /* height: calc(100% - 300px); */
  876. }
  877. .end-row {
  878. background: rgba(0, 0, 0, 0.1);
  879. }
  880. .inlineb {
  881. display: inline-block;
  882. }
  883. .vsub {
  884. vertical-align: sub;
  885. font-size: 14px;
  886. }
  887. .type-boxes {
  888. margin-bottom: 10px;
  889. }
  890. .green {
  891. color: rgba(37, 155, 36, 1);
  892. }
  893. .orange {
  894. color: rgba(255, 152, 0, 1);
  895. }
  896. .state-success {
  897. display: inline-block;
  898. padding: 0px 8px;
  899. text-align: center;
  900. border: 1px solid rgb(48, 142, 255);
  901. }
  902. .state-wait {
  903. display: inline-block;
  904. padding: 0px 8px;
  905. text-align: center;
  906. border: 1px solid rgb(134, 130, 130);
  907. }
  908. .state-load {
  909. display: inline-block;
  910. padding: 0px 8px;
  911. text-align: center;
  912. border: 1px solid rgb(37, 155, 36);
  913. }
  914. .state-faile {
  915. display: inline-block;
  916. padding: 0px 8px;
  917. text-align: center;
  918. border: 1px solid rgb(229, 28, 35);
  919. }
  920. .tab-item{
  921. padding: 5px;
  922. margin-left: 20px;
  923. margin-right: 20px;
  924. width: 100px;
  925. }
  926. .text-num{
  927. padding: 3px;
  928. }
  929. .text-title{
  930. font-size: 14px;
  931. font-weight: bold;
  932. }
  933. .inner-text{
  934. font-size: 10px;
  935. }
  936. .count{
  937. font-size: 12px;
  938. color: #5a5e66;
  939. }
  940. .export-excel{
  941. float: right;
  942. }
  943. </style>