finance.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. <template>
  2. <div class="app-container oderList">
  3. <div class="filter-container" style="margin: 10px 0 10px 0">
  4. <div class="flex">
  5. <div class="w_input">
  6. <span class="textSpan"> 订单号:</span>
  7. <el-input
  8. v-model="body.orderId"
  9. style="width: 65%"
  10. placeholder="请输入订单号"
  11. size="small"
  12. clearable
  13. />
  14. </div>
  15. <div class="w_input">
  16. <span class="textSpan">客户订单号:</span>
  17. <el-input
  18. v-model="body.extorderId"
  19. style="width: 65%"
  20. placeholder="请输入客户订单号"
  21. size="small"
  22. clearable
  23. />
  24. </div>
  25. <div class="w_input stylephone">
  26. <div class="textSpan marginphone">  手机号:</div>
  27. <el-input
  28. v-model="body.phoneNo"
  29. type="textarea"
  30. :autosize="{ minRows: 1.1, maxRows: 5 }"
  31. class="phone"
  32. size="small"
  33. placeholder="请输入内容"
  34. clearable
  35. />
  36. </div>
  37. <!-- <div class="w_input stylephone">
  38. <div class="textSpan marginphone">通道订单号:</div>
  39. <el-input v-model="body.Id" style="width: 67%" placeholder="请输入通道订单号" size="small" clearable/>
  40. </div> -->
  41. </div>
  42. <div class="flex">
  43. <div class="w_date">
  44. <span class="textSpan">回调时间:</span>
  45. <el-date-picker
  46. v-model="callbackTimeEnd"
  47. size="small"
  48. type="datetimerange"
  49. range-separator="至"
  50. style="width: 78%"
  51. value-format="yyyy-MM-dd HH:mm:ss"
  52. :default-time="['00:00:00', '23:59:59']"
  53. start-placeholder="开始日期"
  54. end-placeholder="结束日期"
  55. @change="oncheckTimeStart"
  56. />
  57. </div>
  58. <div class="w_date">
  59. <span class="textSpan">发送时间:</span>
  60. <el-date-picker
  61. v-model="applyDateStart"
  62. size="small"
  63. type="datetimerange"
  64. style="width: 79%"
  65. range-separator="至"
  66. value-format="yyyy-MM-dd HH:mm:ss"
  67. :default-time="['00:00:00', '23:59:59']"
  68. start-placeholder="开始日期"
  69. end-placeholder="结束日期"
  70. @change="oncustom"
  71. />
  72. </div>
  73. </div>
  74. <div class="flex">
  75. <div class="w_input">
  76. <span class="textSpan">通道名称:</span>
  77. <el-input
  78. v-model="body.channelIdDesc"
  79. style="width: 65%"
  80. placeholder="请输入通道名称"
  81. size="small"
  82. clearable
  83. />
  84. </div>
  85. <div class="w_input">
  86. <span class="textSpan"> 订单状态:</span>
  87. <el-select
  88. v-model="body.status"
  89. size="small"
  90. clearable
  91. placeholder="请选择订单状态"
  92. style="width: 65%"
  93. @change="changeScope"
  94. >
  95. <el-option
  96. v-for="item in status"
  97. :key="item.id"
  98. :label="item.name"
  99. :value="item.id"
  100. />
  101. </el-select>
  102. </div>
  103. <div class="w_input">
  104. <span class="textSpan">  运营商:</span>
  105. <el-select
  106. v-model="body.phoneOperator"
  107. size="small"
  108. clearable
  109. placeholder="请选择运营商"
  110. style="width: 65%"
  111. @change="changeoperator"
  112. >
  113. <el-option
  114. v-for="item in mobileOperator"
  115. :key="item.id"
  116. :label="item.name"
  117. :value="item.id"
  118. />
  119. </el-select>
  120. </div>
  121. </div>
  122. <div class="flex">
  123. <div class="w_input">
  124. <span class="textSpan">  面额:</span>
  125. <!-- <el-input
  126. v-model="flowAmount"
  127. style="width: 65%"
  128. placeholder="请输入订单号"
  129. size="small"
  130. clearable
  131. @change="changeflow"
  132. /> -->
  133. <el-input
  134. v-model="flowAmount"
  135. @clear="changeflow(flowAmount)"
  136. style="width:26%"
  137. placeholder="请输入面额"
  138. size="small"
  139. clearable
  140. />
  141. <span> - </span>
  142. <el-input
  143. v-model="flowAmount1"
  144. @clear="changeflow1(flowAmount)"
  145. style="width:26%"
  146. placeholder="请输入面额"
  147. size="small"
  148. clearable
  149. />
  150. </div>
  151. <div class="w_input">
  152. <span class="textSpan"> 客户名称:</span>
  153. <el-input
  154. v-model="body.customerName"
  155. style="width: 65%"
  156. placeholder="请输入客户名称"
  157. size="small"
  158. clearable
  159. />
  160. </div>
  161. <div class="w_input">
  162. <span class="textSpan">  归属地:</span>
  163. <el-input
  164. v-model="body.phoneHome"
  165. style="width: 65%"
  166. placeholder="请选择归属地"
  167. size="small"
  168. clearable
  169. />
  170. </div>
  171. </div>
  172. <div class="flex">
  173. <div class="w_input">
  174. <span class="textSpan">回调状态:</span>
  175. <el-select
  176. v-model="body.callbackStatus"
  177. size="small"
  178. clearable
  179. placeholder="请选择订单状态"
  180. style="width: 65%"
  181. @change="changeScope"
  182. >
  183. <el-option
  184. v-for="item in dealFlag"
  185. :key="item.id"
  186. :label="item.name"
  187. :value="item.id"
  188. />
  189. </el-select>
  190. </div>
  191. <div class="w_input stylephone">
  192. <div class="textSpan marginphone">通道订单号:</div>
  193. <el-input
  194. v-model="body.gwSeqNo"
  195. style="width: 67%;"
  196. placeholder="请输入通道订单号"
  197. size="small"
  198. clearable
  199. />
  200. </div>
  201. </div>
  202. <div class="flexend">
  203. <el-button
  204. class="classitem"
  205. style="marginright: 50px"
  206. type="primary"
  207. plain
  208. icon="el-icon-star-off"
  209. @click="handleReset"
  210. >导出
  211. </el-button>
  212. <el-button
  213. class="filter-item"
  214. icon="el-icon-search"
  215. type="primary"
  216. plain
  217. @click="handleSearch"
  218. >搜索</el-button>
  219. </div>
  220. </div>
  221. <div class="tag">
  222. <span
  223. class="money"
  224. >客户结算总价:</span>
  225. <span class="money_span">{{ sumPrice }}</span>
  226. <span
  227. class="money"
  228. >合作伙伴结算总价:</span>
  229. <span class="money_span">{{ sumPartnerPrice }}</span>
  230. <span
  231. class="money"
  232. >运营商结算总价:</span>
  233. <span class="money_span">{{ sumOperatorPrice }}</span>
  234. </div>
  235. <el-table v-loading="loading" :data="tableData" border style="width: 100%">
  236. <!-- <el-table-column type="selection" width="40" /> -->
  237. <el-table-column
  238. label="订单号"
  239. width="120"
  240. align="center"
  241. show-overflow-tooltip
  242. >
  243. <template slot-scope="scope">
  244. <span>{{ scope.row.orderId }}</span>
  245. </template>
  246. </el-table-column>
  247. <el-table-column
  248. label="面额"
  249. width="70"
  250. align="center"
  251. show-overflow-tooltip
  252. >
  253. <template slot-scope="scope">
  254. <span>{{ scope.row.flowAmount / 10000 }}</span>
  255. </template>
  256. </el-table-column>
  257. <el-table-column label="客户价格" width="80" align="center">
  258. <template slot-scope="scope">
  259. <span>{{ scope.row.price }}</span>
  260. </template>
  261. </el-table-column>
  262. <el-table-column label="运营商价格" width="100" align="center">
  263. <template slot-scope="scope">
  264. <span>{{ scope.row.operatorBalancePrice }}</span>
  265. </template>
  266. </el-table-column>
  267. <el-table-column label="代理商价格" width="100" align="center">
  268. <template slot-scope="scope">
  269. <span>{{ scope.row.partnerBalancePrice }}</span>
  270. </template>
  271. </el-table-column>
  272. <el-table-column
  273. label="运营商"
  274. width="70"
  275. align="center"
  276. show-overflow-tooltip
  277. >
  278. <template slot-scope="scope">
  279. <el-tag v-if="scope.row.phoneOperator === 2" size="small">电信</el-tag>
  280. <el-tag v-if="scope.row.phoneOperator === 1" size="small">移动</el-tag>
  281. <el-tag v-if="scope.row.phoneOperator === 3" size="small">联通</el-tag>
  282. </template>
  283. </el-table-column>
  284. <el-table-column
  285. label="归属地"
  286. width="70"
  287. align="center"
  288. show-overflow-tooltip
  289. >
  290. <template slot-scope="scope">
  291. <span>{{ scope.row.phoneHome }}</span>
  292. </template>
  293. </el-table-column>
  294. <el-table-column
  295. label="手机号码"
  296. width="110"
  297. align="center"
  298. show-overflow-tooltip
  299. >
  300. <template slot-scope="scope">
  301. <span>{{ scope.row.phoneNo }}</span>
  302. </template>
  303. </el-table-column>
  304. <el-table-column
  305. label="通道名称"
  306. width="90"
  307. align="center"
  308. show-overflow-tooltip
  309. >
  310. <template slot-scope="scope">
  311. <span>{{ scope.row.channelName }}</span>
  312. </template>
  313. </el-table-column>
  314. <el-table-column
  315. label="客户名称"
  316. width="100"
  317. align="center"
  318. prop="createTime"
  319. show-overflow-tooltip
  320. >
  321. <template slot-scope="scope">
  322. <span>{{ scope.row.customerName }}</span>
  323. </template>
  324. </el-table-column>
  325. <el-table-column
  326. label="客户订单号"
  327. width="120"
  328. align="center"
  329. show-overflow-tooltip
  330. >
  331. <template slot-scope="scope">
  332. <span>{{ scope.row.extorderId }}</span>
  333. </template>
  334. </el-table-column>
  335. <el-table-column label="通道订单号" width="120" align="center" show-overflow-tooltip>
  336. <template slot-scope="scope">
  337. <span>{{ scope.row.gwSeqNo }}</span>
  338. </template>
  339. </el-table-column>
  340. <el-table-column
  341. label="订单状态"
  342. width="90"
  343. align="center"
  344. show-overflow-tooltip
  345. >
  346. <template slot-scope="scope">
  347. <el-tag v-if="scope.row.status === 2" size="small">充值中</el-tag>
  348. <el-tag v-if="scope.row.status === 1" size="small">待充值</el-tag>
  349. <!-- <el-tag v-if="scope.row.status === 3" size="small">重发</el-tag> -->
  350. <el-tag v-if="scope.row.status === 4" size="small" >充值失败</el-tag>
  351. <!-- <el-tag v-if="scope.row.status === 5" size="small">回调</el-tag> -->
  352. <el-tag v-if="scope.row.status === 6" size="small">充值成功</el-tag>
  353. </template>
  354. </el-table-column>
  355. <!-- <el-table-column label="产品ID" width="100" align="center" show-overflow-tooltip>
  356. <template slot-scope="scope">
  357. <span>{{ scope.row.packageId }}</span>
  358. </template>
  359. </el-table-column> -->
  360. <el-table-column label="发送时间" width="160" align="center">
  361. <template slot-scope="scope">
  362. <span>{{ scope.row.limitedDate }}</span>
  363. </template>
  364. </el-table-column>
  365. <el-table-column label="回调时间" width="160" align="center">
  366. <template slot-scope="scope">
  367. <span>{{ scope.row.lastModifyDate }}</span>
  368. </template>
  369. </el-table-column>
  370. </el-table>
  371. <!--分页-->
  372. <div class="pagination">
  373. <el-pagination
  374. current-page.sync="body.page"
  375. :current-page="body.page"
  376. :page-sizes="[10, 20, 30, 50]"
  377. :page-size="body.size"
  378. layout="total, sizes, prev, pager, next, jumper"
  379. background
  380. :total="total"
  381. @size-change="handleSizeChange"
  382. @current-change="handleCurrentChange"
  383. />
  384. </div>
  385. </div>
  386. </template>
  387. <script>
  388. import api from '@/api/orderList'
  389. export default {
  390. data() {
  391. return {
  392. Name: '',
  393. // phone:true, //控制批量手机号
  394. tableData: [],
  395. applyDateStart: '', // 发送时间
  396. callbackTimeEnd: '', // 回调时间
  397. flowAmount: '', // 面额乘以10000
  398. flowAmount1: '', // 面额乘以10000
  399. body: {
  400. Id: '',
  401. orderId: '',
  402. extorderId: '',
  403. usedMobile: '',
  404. applyDateStart: '',
  405. applyDateEnd: '',
  406. enterpriseIdDesc: '',
  407. channelIdDesc: '',
  408. status: '',
  409. mobileOperator: '',
  410. flowAmount: '',
  411. checkTimeStart: '',
  412. checkTimeEnd: '',
  413. gwSeqNo: '',
  414. mobileHome: '',
  415. page: 1,
  416. size: 10
  417. },
  418. sumOperatorPrice: "",
  419. sumPartnerPrice: "",
  420. sumPrice: "",
  421. total: 0, // 总数据
  422. // sum: 10100,
  423. loading: false,
  424. status: [
  425. { id: 1, name: '待发' },
  426. { id: 2, name: '已发' },
  427. { id: 6, name: '成功' },
  428. { id: 4, name: '失败' },
  429. { id: 5, name: '风控' }
  430. ],
  431. mobileOperator: [
  432. {id:1,name:"移动"},
  433. {id:3,name:"联通"},
  434. {id:2,name:"电信"},
  435. ],
  436. dealFlag: [
  437. { id: '6', name: '成功' },
  438. { id: '4', name: '失败' },
  439. ]
  440. }
  441. },
  442. created() {
  443. const nowDate = new Date()
  444. const date = {
  445. year: nowDate.getFullYear(),
  446. month: nowDate.getMonth() + 1,
  447. date: nowDate.getDate()
  448. }
  449. const systemTime = date.year + '-' + date.month + '-' + date.date
  450. // this.body.applyDateStart = "2021-05-14 + " 00:00:00"
  451. this.applyDateStart = [systemTime + ' 00:00:00', systemTime + ' 23:59:59']
  452. this.body.applyDateStart = systemTime + ' 00:00:00'
  453. this.body.applyDateEnd = systemTime + ' 23:59:59'
  454. // this.body.applyDateEnd = systemTime + " 23:59:59"
  455. // this.
  456. this.getTenantList()
  457. },
  458. methods: {
  459. // 获取数据
  460. getTenantList() {
  461. this.loading = true
  462. api.finance.Search(this.body).then((res) => {
  463. this.loading = false
  464. // this.tableData=res.data.data.records
  465. // limitedDate :发送时间
  466. // lastModifyDate :回调
  467. // usedTime :用时
  468. const tableData = res.data.data.records
  469. const arry = tableData.map((res) => {
  470. if (res.lastModifyDate != null && res.lastModifyDate != '') {
  471. const limitedDate = res.limitedDate
  472. const lastModifyDate = res.lastModifyDate
  473. // 发送时间 减去 回调时间
  474. const date = new Date(limitedDate)
  475. const time = date.valueOf()
  476. const modify = new Date(lastModifyDate)
  477. const last = modify.valueOf()
  478. const used = last - time
  479. res.usedTime = used
  480. }
  481. return res
  482. })
  483. this.tableData = arry
  484. this.sumOperatorPrice = res.data.data.sumOperatorPrice
  485. this.sumPartnerPrice = res.data.data .sumPartnerPrice
  486. this.sumPrice = res.data.data .sumPrice
  487. console.log(arry)
  488. this.total = res.data.data.total
  489. console.log(res.data.data.records)
  490. })
  491. },
  492. // 搜索手机号
  493. onphon() {
  494. console.log(this.phone)
  495. },
  496. //清除面额
  497. changeflow(flow){
  498. this.flowAmount = ""
  499. },
  500. //清除面额
  501. changeflow1(flow){
  502. this.flowAmount1 = ""
  503. },
  504. // 搜索发送时间
  505. oncustom() {
  506. const applyDateStart = this.applyDateStart
  507. this.body.applyDateStart = applyDateStart[0]
  508. this.body.applyDateEnd = applyDateStart[1]
  509. // console.log(applyDateStart)
  510. // console.log(this.body.applyDateStart)
  511. },
  512. // 搜索回调时间
  513. oncheckTimeStart() {
  514. // checkTimeStart:"",
  515. // checkTimeEnd:"",
  516. const checkTimeStart = this.callbackTimeEnd
  517. this.body.callbackTimeStart = checkTimeStart[0]
  518. this.body.callbackTimeEnd = checkTimeStart[1]
  519. },
  520. // 搜索状态
  521. changeScope() {
  522. console.log(this.body.status)
  523. },
  524. // 运营商
  525. changeoperator() {
  526. console.log(this.body.mobileOperator)
  527. },
  528. // 搜索
  529. handleSearch() {
  530. console.log(this.applyDateStart)
  531. this.body.page = 1
  532. if (this.applyDateStart == null) {
  533. // 发送时间为空时清空 body 里的发送时间
  534. this.body.applyDateEnd = ''
  535. this.body.applyDateStart = ''
  536. }
  537. if (this.callbackTimeEnd == null) {
  538. // 回调时间
  539. this.body.callbackTimeStart = ''
  540. this.body.callbackTimeEnd = ''
  541. }
  542. //面额前后为空判断
  543. let flowAmount=this.flowAmount * 10000;
  544. let flowAmount1=this.flowAmount1 * 10000;
  545. if(this.flowAmount1 != "" && this.flowAmount != ""){ //面额
  546. this.body.flowAmount = flowAmount + "-" + flowAmount1
  547. }
  548. if(this.flowAmount == "" && this.flowAmount1 == ""){
  549. this.body.flowAmount = ""
  550. // console.log(this.body.flowAmount)
  551. }
  552. else if(this.flowAmount == ""){ //面额
  553. this.body.flowAmount = 0 + "-" + flowAmount1
  554. }
  555. else if(this.flowAmount1 == ""){
  556. this.body.flowAmount = flowAmount + "-" + 10000000
  557. }
  558. this.currentPage = '1'
  559. this.getTenantList()
  560. },
  561. //
  562. handleReset() {},
  563. // 分页
  564. handleSizeChange: function(val) {
  565. this.body.size = val
  566. this.getTenantList()
  567. },
  568. // 换页
  569. handleCurrentChange: function(val) {
  570. this.body.page = val
  571. this.getTenantList()
  572. }
  573. }
  574. }
  575. </script>
  576. <style scoped>
  577. .textSpan {
  578. position: relative;
  579. top: 0;
  580. font-size: 14px;
  581. font-weight: 600;
  582. color: rgb(87, 86, 86);
  583. }
  584. .stylephone {
  585. display: flex;
  586. }
  587. .marginphone {
  588. padding-top: 9px;
  589. }
  590. .flex {
  591. width: 100%;
  592. display: flex;
  593. flex-direction: row;
  594. margin-bottom: 10px;
  595. /* flex-wrap: wrap; */
  596. /* justify-content: space-evenly; */
  597. }
  598. .w_date {
  599. width: 66%;
  600. }
  601. .w_input {
  602. width: 33.33%;
  603. }
  604. .flexend {
  605. display: flex;
  606. justify-content: flex-end;
  607. /* padding-top: 20px; */
  608. padding-right: 40px;
  609. }
  610. .tag{
  611. margin-bottom: 20px;
  612. }
  613. .money {
  614. font-size: 14px;
  615. /* font-weight: 600; */
  616. color: rgb(87, 86, 86);
  617. position: relative;
  618. bottom: 2px;
  619. }
  620. .money_span{
  621. font-weight: 600;
  622. margin-right: 20px;
  623. font-weight: 500px;
  624. font-size: 20px;
  625. color:salmon
  626. }
  627. .phone {
  628. width: 66% !important ;
  629. z-index: 100;
  630. }
  631. /* .classitem{
  632. background: salmon;
  633. } */
  634. </style>