orders.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987
  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.order_no}"
  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).toFixed(2)}}</span>
  179. <span v-else class="orange">{{(scope.row.real_amount/100).toFixed(2)}}</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="人工">
  221. <template slot-scope="scope">
  222. <span v-if="scope.row.operator_info.nickname">{{scope.row.operator_info.nickname}}</span>
  223. <span>({{scope.row.operator_uid}})</span>
  224. </template>
  225. </el-table-column>
  226. </el-table>
  227. </div>
  228. <div class="order-footer">
  229. <el-pagination
  230. background
  231. @current-change="getFinanceList"
  232. @size-change="changePageSize"
  233. :current-page.sync="currentPage"
  234. :page-sizes="[10, 20, 30, 40]"
  235. :page-size="20"
  236. layout="total, sizes, prev, pager, next, jumper"
  237. :total="totalCount"
  238. ></el-pagination>
  239. </div>
  240. </div>
  241. </template>
  242. <script>
  243. export default {
  244. data() {
  245. return {
  246. finaceList: [],
  247. successCount: 0,
  248. totalHave: 0,
  249. totalSuccess: 0,
  250. PayCount: 0,
  251. paySuccess: 0,
  252. productId: "",
  253. productType: [0],
  254. orderTypes: "",
  255. orderTypesOption: [],
  256. orderState: "",
  257. orderStateOption: [],
  258. productTypes: "",
  259. productTypesOption: [],
  260. checked: false,
  261. orderType: [0],
  262. tradeType: [0],
  263. payType: [0],
  264. timeType: 2,
  265. timeOptions: [
  266. {
  267. value: 1,
  268. label: "到帐时间"
  269. },
  270. {
  271. value: 2,
  272. label: "创建时间"
  273. }
  274. ],
  275. TypeList: [
  276. {
  277. id: 0,
  278. type: "全部"
  279. },
  280. {
  281. id: 1,
  282. type: "整包项目"
  283. },
  284. {
  285. id: 2,
  286. type: "云端工作"
  287. },
  288. {
  289. id: 3,
  290. type: "雇佣工作"
  291. }
  292. ],
  293. tradeList: [
  294. {
  295. id: 0,
  296. type: "全部"
  297. },
  298. {
  299. id: 1,
  300. type: "充值"
  301. },
  302. {
  303. id: 2,
  304. type: "提现"
  305. },
  306. {
  307. id: 3,
  308. type: "购买"
  309. },
  310. {
  311. id: 4,
  312. type: "购买"
  313. }
  314. ],
  315. payList: [
  316. {
  317. id: 1,
  318. type: "充值"
  319. },
  320. {
  321. id: 2,
  322. type: "提现"
  323. },
  324. {
  325. id: 3,
  326. type: "购买"
  327. },
  328. {
  329. id: 4,
  330. type: "购买"
  331. }
  332. ],
  333. pickerOptions2: {
  334. shortcuts: [
  335. {
  336. text: "全部",
  337. onClick(picker) {
  338. picker.$emit("pick", []);
  339. }
  340. },
  341. {
  342. text: "最近7天",
  343. onClick(picker) {
  344. const end = new Date();
  345. const start = new Date();
  346. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  347. picker.$emit("pick", [start, end]);
  348. }
  349. },
  350. {
  351. text: "最近30天",
  352. onClick(picker) {
  353. const end = new Date();
  354. const start = new Date();
  355. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  356. picker.$emit("pick", [start, end]);
  357. }
  358. },
  359. {
  360. text: "本周",
  361. onClick(picker) {
  362. var week = new Date().getDay() - 1;
  363. console.log(week);
  364. if (week == -1) {
  365. week = 6;
  366. }
  367. const end = new Date();
  368. const start = new Date();
  369. start.setTime(start.getTime() - 3600 * 1000 * 24 * week);
  370. picker.$emit("pick", [start, end]);
  371. }
  372. },
  373. {
  374. text: "本月",
  375. onClick(picker) {
  376. var month = new Date().getMonth + 1;
  377. var year = new Date().getFullYear();
  378. // console.log(month, year);
  379. var day = new Date().getDate() - 1;
  380. console.log(day);
  381. const end = new Date();
  382. const start = new Date();
  383. start.setTime(start.getTime() - 3600 * 1000 * 24 * day);
  384. picker.$emit("pick", [start, end]);
  385. }
  386. },
  387. {
  388. text: "本年",
  389. onClick(picker) {
  390. var month = new Date().getMonth + 1;
  391. var year = new Date().getFullYear();
  392. // console.log(month, year);
  393. var day = new Date().getDate() - 1;
  394. var firstDay = new Date(year, 0, 1);
  395. var dateDiff = new Date() - firstDay;
  396. var msPerDay = 1000 * 60 * 60 * 24;
  397. //计算天数
  398. var diffDays = Math.ceil(dateDiff / msPerDay) - 1;
  399. console.log(diffDays);
  400. const end = new Date();
  401. const start = new Date();
  402. start.setTime(start.getTime() - 3600 * 1000 * 24 * diffDays);
  403. picker.$emit("pick", [start, end]);
  404. }
  405. }
  406. ]
  407. },
  408. timeRange: "",
  409. arriveTime: "",
  410. searchId: "",
  411. tableData3: [
  412. {
  413. date: "2016-05-03",
  414. name: "王小虎",
  415. money: "200",
  416. state: 1
  417. },
  418. {
  419. date: "2016-05-02",
  420. name: "王小虎",
  421. money: "-100",
  422. state: 2
  423. },
  424. {
  425. date: "2016-05-04",
  426. name: "王小虎",
  427. money: "-100",
  428. state: 3
  429. },
  430. {
  431. date: "2016-05-01",
  432. name: "王小虎",
  433. money: "-100",
  434. state: 4
  435. },
  436. {
  437. date: "2016-05-08",
  438. name: "王小虎",
  439. money: "2100",
  440. state: 1
  441. },
  442. {
  443. date: "2016-05-06",
  444. name: "王小虎",
  445. money: "-1200",
  446. state: 4
  447. },
  448. {
  449. date: "2016-05-07",
  450. name: "王小虎",
  451. money: "-100",
  452. state: 1
  453. }
  454. ],
  455. // 下发的总数据
  456. totalData: {},
  457. // 项目ID
  458. jobID: "",
  459. // 审核人
  460. period: "",
  461. status: "",
  462. // 状态列表数据
  463. jobStatusList: [],
  464. // 负责人
  465. checkUser: "",
  466. // 审核人列表
  467. periodStatusList: [],
  468. // 数据总条目
  469. totalCount: 0,
  470. currentPage: 1,
  471. currentPageSize: 20,
  472. // 列表宽度
  473. // tableWidths,
  474. // 列表头显示内容
  475. // tableHeaders,
  476. // 列表头字段
  477. // tableProps,
  478. // 列表数据
  479. tableData: [],
  480. localData: {
  481. env: "test"
  482. }
  483. };
  484. },
  485. computed: {
  486. isTest() {
  487. return this.localData.env === "test";
  488. },
  489. whole() {
  490. return this.totalData.whole || {};
  491. },
  492. totalDeposit() {
  493. return this.whole.total_deposit;
  494. },
  495. totalFee() {
  496. return this.whole.total_fee;
  497. }
  498. },
  499. mounted() {
  500. this.getAllChice();
  501. this.getTableData();
  502. this.getFinanceList();
  503. },
  504. methods: {
  505. handleOrderClick(id) {
  506. this.$router.push(`/main/bills/${id}`);
  507. },
  508. formatDate(time) {
  509. var now = new Date(time * 1000);
  510. var year = now.getFullYear();
  511. var month = now.getMonth() + 1;
  512. var date = now.getDate();
  513. var hour = now.getHours();
  514. var minute = now.getMinutes();
  515. var second = now.getSeconds();
  516. if (hour < 10) {
  517. hour = "0" + hour;
  518. }
  519. if (minute < 10) {
  520. minute = "0" + minute;
  521. }
  522. if (second < 10) {
  523. second = "0" + second;
  524. }
  525. return (
  526. year +
  527. "-" +
  528. month +
  529. "-" +
  530. date +
  531. " " +
  532. hour +
  533. ":" +
  534. minute +
  535. ":" +
  536. second
  537. );
  538. },
  539. // 改变订单类型
  540. changeOrder() {
  541. var haveAll = false;
  542. for (var i = 0; i < this.productType.length; i++) {
  543. if (this.productType[i] == 0) {
  544. haveAll = true;
  545. }
  546. }
  547. // 选择其他的时候,去掉全部,全部在第一位
  548. if (
  549. this.productType[0] == 0 &&
  550. 1 < this.productType.length < this.TypeList.length
  551. ) {
  552. var arr = [];
  553. for (var i = 0; i < this.productType.length; i++) {
  554. if (this.productType[i] != 0) {
  555. arr.push(this.productType[i]);
  556. }
  557. }
  558. this.productType = arr;
  559. }
  560. // 选择全部的时候去掉其他,全部在最后一位
  561. if (this.productType[this.productType.length - 1] == 0) {
  562. this.productType = [0];
  563. }
  564. if (!haveAll && this.productType.length == this.TypeList.length - 1) {
  565. this.productType = [0];
  566. }
  567. if (this.productType.length == 0) {
  568. console.log("sss:", this.productType);
  569. this.productType = [0];
  570. }
  571. },
  572. // 改变支付方式
  573. changePay() {
  574. var haveAll = false;
  575. for (var i = 0; i < this.payType.length; i++) {
  576. if (this.payType[i] == 0) {
  577. haveAll = true;
  578. }
  579. }
  580. // 选择其他的时候,去掉全部,全部在第一位
  581. if (
  582. this.payType[0] == 0 &&
  583. 1 < this.payType.length < this.payList.length
  584. ) {
  585. var arr = [];
  586. for (var i = 0; i < this.payType.length; i++) {
  587. if (this.payType[i] != 0) {
  588. arr.push(this.payType[i]);
  589. }
  590. }
  591. this.payType = arr;
  592. }
  593. // 选择全部的时候去掉其他,全部在最后一位
  594. if (this.payType[this.payType.length - 1] == 0) {
  595. this.payType = [0];
  596. }
  597. if (!haveAll && this.payType.length == this.payList.length - 1) {
  598. this.payType = [0];
  599. }
  600. if (this.payType.length == 0) {
  601. console.log("sss:", this.orderType);
  602. this.payType = [0];
  603. }
  604. },
  605. clickExport() {
  606. window.open("/api/admin/job/get_all_periods?action=export");
  607. },
  608. /**
  609. * 获取筛选值
  610. */
  611. async getEnum() {
  612. let { data } = await this.$get("/api/admin/job/getEnum");
  613. console.log(data);
  614. if (data) {
  615. let { jobStatusList, periodStatusList } = data;
  616. this.jobStatusList = jobStatusList;
  617. this.periodStatusList = periodStatusList;
  618. }
  619. },
  620. // 点击操作
  621. clickOperate({ job_id, id }) {
  622. if (this.isTest)
  623. window.open(
  624. `https://dev.test-rooter.proginn.com/main/wage_settlement?job_id=${job_id}&period_id=${id}`
  625. );
  626. else
  627. window.open(
  628. `https://rooter.proginn.com/main/wage_settlement?job_id=${job_id}&period_id=${id}`
  629. );
  630. },
  631. // 点击账单
  632. clickOrder(i) {
  633. if (this.isTest)
  634. window.open(
  635. `https://dev.test-rooter.proginn.com/main/wage_details?job_id=${i.job_id}&period_id=${i.id}`
  636. );
  637. else
  638. window.open(
  639. `https://rooter.proginn.com/main/wage_details?job_id=${i.job_id}&period_id=${i.id}`
  640. );
  641. },
  642. // 点击开发者
  643. clickDev(uid) {
  644. if (this.isTest)
  645. window.open(`https://dev.test.proginn.com/rooter/user/${uid}`);
  646. else window.open(`https://www.proginn.com/rooter/user/${uid}`);
  647. },
  648. // 点击企业
  649. clickCompany(uid) {
  650. if (this.isTest)
  651. window.open(`https://dev.test.proginn.com/rooter/user/${uid}`);
  652. else window.open(`https://www.proginn.com/rooter/user/${uid}`);
  653. },
  654. // 点击账单id
  655. clickJobID(jobID) {
  656. if (this.isTest)
  657. window.open(
  658. `https://dev.test.proginn.com/rooter/cloudjobitem/${jobID}`
  659. );
  660. else window.open(`https://www.proginn.com/rooter/cloudjobitem/${jobID}`);
  661. },
  662. // 点击重试
  663. async clickRetry(id) {
  664. const res = await this.$post("/api/admin/payment/redoDraw", { id });
  665. // console.log(res)
  666. },
  667. // 根据状态显示图表样式
  668. tableRowClassName({ row, rowIndex }) {
  669. // console.log({row, rowIndex})
  670. let className = "";
  671. if (row.j_status_name === "结束合作") className = "end-row";
  672. // console.log(className)
  673. return className;
  674. },
  675. // 格式化列表数据
  676. formatTableData(data) {
  677. return data.map(i => ({
  678. ...i,
  679. payAround: `${i.start_time}<br>${i.end_time}`,
  680. pre_send_salary_timeShow: new Date(
  681. i.pre_send_salary_time * 1000
  682. ).toLocaleDateString()
  683. }));
  684. },
  685. /**
  686. * 点击筛选确认
  687. */
  688. clickSearchConfirm() {
  689. this.currentPage = 1;
  690. // this.getTableData();
  691. },
  692. changePageSize(pageSize) {
  693. this.currentPageSize = pageSize;
  694. this.getFinanceList();
  695. },
  696. // 获取列表数据
  697. async getTableData() {
  698. this.tableData = [];
  699. let url = "/api/admin/job/get_all_periods";
  700. let body = { page: this.currentPage, page_size: this.currentPageSize };
  701. if (this.status) body.j_status = this.status;
  702. if (this.period) body.p_status = this.period;
  703. if (this.checkUser) body.chk_user = this.checkUser;
  704. if (this.jobID) body.job_id = this.jobID;
  705. const res = await this.$post(url, body);
  706. const data = res.data;
  707. this.tableData = this.formatTableData(data.list);
  708. this.totalData = data;
  709. // // console.log(this.tableData)
  710. this.totalCount = Number(data.total);
  711. this.totalPage = data.totalPage;
  712. this.localData.env = data.current_env;
  713. },
  714. async downFinanceList() {
  715. var checkedTF = 0;
  716. // console.log(this.checked);
  717. if (this.checked) {
  718. // console.log(333);
  719. checkedTF = 1;
  720. }
  721. var arr1 = [];
  722. if (this.productType[0] == 0) {
  723. arr1 = "";
  724. } else {
  725. arr1 = this.productType.toString();
  726. }
  727. var arr2 = [];
  728. if (this.payType[0] == 0) {
  729. arr2 = "";
  730. } else {
  731. arr2 = this.payType.toString();
  732. }
  733. var time = 1;
  734. if (this.timeType == "") {
  735. time = "";
  736. } else {
  737. time = this.timeType;
  738. }
  739. var starTime = "";
  740. var endTime = "";
  741. if (this.timeRange.length) {
  742. starTime = this.formatDate(this.timeRange[0] / 1000);
  743. endTime = this.formatDate(this.timeRange[1] / 1000);
  744. } else {
  745. starTime = "";
  746. endTime = "";
  747. }
  748. let body = {
  749. // 1111
  750. product_type: arr1,
  751. order_type: this.orderTypes,
  752. channel: arr2,
  753. start_time: starTime,
  754. end_time: endTime,
  755. date_type: time,
  756. status: this.orderState,
  757. artificial_mark: checkedTF,
  758. order: this.searchId,
  759. user: this.checkUser,
  760. // this.productTypes
  761. product_id: this.productId,
  762. page: this.currentPage,
  763. page_size: this.currentPageSize
  764. };
  765. // http://local-rooter.proginn.com:20201/api/admin/order/export?product_type=&order_type=&channel=&start_time=&end_time=&date_type=2&status=&artificial_mark=0&order=&user=&product_id=&page=1&page_size=20
  766. // const res = await this.$get("/api/admin/order/export", body);
  767. var url =
  768. window.location.host +
  769. "/api/admin/order/export?product_type=" +
  770. arr1 +
  771. "&order_type=" +
  772. this.orderTypes +
  773. "&channel=" +
  774. arr2 +
  775. "&start_time=" +
  776. starTime +
  777. "&end_time=" +
  778. endTime +
  779. "&date_type=" +
  780. time +
  781. "&status=" +
  782. this.orderState +
  783. "&artificial_mark=" +
  784. checkedTF +
  785. "&order=" +
  786. this.searchId +
  787. "&user=" +
  788. this.checkUser +
  789. "&product_id=" +
  790. this.productId;
  791. console.log(url);
  792. window.location.href = "http://" + url;
  793. },
  794. async getFinanceList() {
  795. // console.log("timeRange:", this.timeRange);
  796. // return false;
  797. var checkedTF = 0;
  798. console.log(this.checked);
  799. if (this.checked) {
  800. console.log(333);
  801. checkedTF = 1;
  802. }
  803. var arr1 = [];
  804. if (this.productType[0] == 0) {
  805. arr1 = "";
  806. } else {
  807. arr1 = this.productType.toString();
  808. }
  809. var arr2 = [];
  810. if (this.payType[0] == 0) {
  811. arr2 = "";
  812. } else {
  813. arr2 = this.payType.toString();
  814. }
  815. var time = 1;
  816. if (this.timeType == "") {
  817. time = "";
  818. } else {
  819. time = this.timeType;
  820. }
  821. var starTime = "";
  822. var endTime = "";
  823. if (this.timeRange) {
  824. starTime = this.formatDate(this.timeRange[0] / 1000);
  825. endTime = this.formatDate(this.timeRange[1] / 1000);
  826. } else {
  827. starTime = "";
  828. endTime = "";
  829. }
  830. let body = {
  831. // 1111
  832. product_type: arr1,
  833. order_type: this.orderTypes,
  834. channel: arr2,
  835. start_time: starTime,
  836. end_time: endTime,
  837. date_type: time,
  838. status: this.orderState,
  839. artificial_mark: checkedTF,
  840. order: this.searchId,
  841. user: this.checkUser,
  842. // this.productTypes
  843. product_id: this.productId,
  844. page: this.currentPage,
  845. page_size: this.currentPageSize
  846. };
  847. const res = await this.$post("/api/admin/order/get_orders", body);
  848. var data = res.data;
  849. this.finaceList = data.orders;
  850. this.totalCount = Number(data.count);
  851. this.successCount = data.successCount;
  852. (this.totalHave = data.income_sum),
  853. (this.totalSuccess = data.income_success_sum);
  854. this.PayCount = data.expense_sum;
  855. this.paySuccess = data.expense_success_sum;
  856. },
  857. async getAllChice() {
  858. let body = {};
  859. const res = await this.$post("/api/admin/order/get_all_choice");
  860. var data = res.data;
  861. console.log(data);
  862. this.orderTypesOption = data.order_types;
  863. this.orderTypesOption.unshift({
  864. id: "",
  865. name: "全部"
  866. });
  867. this.orderStateOption = data.order_state;
  868. this.payList = data.channels;
  869. this.payList.unshift({
  870. id: 0,
  871. name: "全部"
  872. });
  873. this.TypeList = data.product_types;
  874. this.TypeList.unshift({
  875. id: 0,
  876. name: "全部"
  877. });
  878. // this.productTypesOption = data.product_types;
  879. // this.finaceList = data;
  880. // this.totalCount = Number(data.total);
  881. }
  882. },
  883. created() {
  884. console.log(process.env.NODE_ENV);
  885. }
  886. };
  887. </script>
  888. <style scoped>
  889. .order-footer {
  890. position: absolute;
  891. bottom: 10px;
  892. left: 10px;
  893. }
  894. #order-wrap {
  895. width: 100%;
  896. }
  897. #cloud-balance {
  898. white-space: nowrap;
  899. overflow-x: scroll;
  900. height: calc(100% - 40px);
  901. }
  902. .changeheight {
  903. height: calc(100%) !important;
  904. }
  905. .top {
  906. display: flex;
  907. flex-direction: column;
  908. justify-content: center;
  909. height: 270px;
  910. }
  911. .selector-box {
  912. /* margin-top: 10px; */
  913. }
  914. .selector-box {
  915. display: flex;
  916. justify-content: space-between;
  917. }
  918. /* .selector-box-left {
  919. } */
  920. .table {
  921. margin-top: 10px;
  922. height: calc(100% - 320px);
  923. }
  924. .order-table {
  925. /* height: calc(100% - 300px); */
  926. }
  927. .end-row {
  928. background: rgba(0, 0, 0, 0.1);
  929. }
  930. .inlineb {
  931. display: inline-block;
  932. }
  933. .vsub {
  934. vertical-align: sub;
  935. }
  936. .type-boxs {
  937. margin-bottom: 10px;
  938. }
  939. .green {
  940. color: rgba(37, 155, 36, 1);
  941. }
  942. .orange {
  943. color: rgba(255, 152, 0, 1);
  944. }
  945. .state-success {
  946. display: inline-block;
  947. padding: 0px 8px;
  948. text-align: center;
  949. border: 1px solid rgb(48, 142, 255);
  950. }
  951. .state-wait {
  952. display: inline-block;
  953. padding: 0px 8px;
  954. text-align: center;
  955. border: 1px solid rgb(134, 130, 130);
  956. }
  957. .state-load {
  958. display: inline-block;
  959. padding: 0px 8px;
  960. text-align: center;
  961. border: 1px solid rgb(37, 155, 36);
  962. }
  963. .state-faile {
  964. display: inline-block;
  965. padding: 0px 8px;
  966. text-align: center;
  967. border: 1px solid rgb(229, 28, 35);
  968. }
  969. </style>