orders.vue 38 KB

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