orders.vue 27 KB

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