index.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092
  1. <template>
  2. <basic-container>
  3. <el-dialog :modal-append-to-body="false" :visible.sync="editBussinessVisible" title="编辑资料" width="80%">
  4. <avue-form v-if="editBussinessVisible" :table-loading="loading" v-model="bussiness" :option="bussinessOption" @reset-change="emptytChange" @submit="submitBussiness()">
  5. </avue-form>
  6. </el-dialog>
  7. <el-dialog :modal-append-to-body="false" :visible.sync="chongzhiVisible" title="网银支付" width="30%">
  8. ,<div align="center" style="font-size: 20px;color: #0099FF;margin-bottom: 20px;">充值金额</div>
  9. <div align="center">
  10. <span>
  11. <!-- <el-input-number size="large" placeholder="请输入充值金额" v-model="money" min="1">
  12. </el-input-number> -->
  13. <el-input placeholder="请输入内容" v-model="money" type="number" :min="1">
  14. <template slot="prepend">RMB</template>
  15. </el-input>
  16. </span>
  17. <div align="left" style="margin: 10px;">充值金额(大写):{{moneyChina}}</div>
  18. <div align="center" style="margin: 20px;">
  19. <el-button type="success" size="mini" @click="chongzhiConfirm"> 去充值</el-button>
  20. </div>
  21. <el-divider></el-divider>
  22. <div>说明:充值后账户余额 = 本次充值金额 - 技术服务费 - 手续费
  23. <div>
  24. <table style="width: 100%;" border="1" class="myTable">
  25. <tr v-for="(item,i) in statDatas" :key="i">
  26. <td class="column">{{ item.key }}</td>
  27. <td class="column">{{ item.value }}</td>
  28. </tr>
  29. </table>
  30. </div>
  31. </div>
  32. </div>
  33. </el-dialog>
  34. <el-card>
  35. <el-row :gutter="50">
  36. <el-col :span="24">
  37. <!-- <el-card>
  38. {{userInfo.userName}} 欢迎回来
  39. </el-card> -->
  40. <el-card header="音乐之声-基础数据统计" v-if="permission.basic_static">
  41. <avue-data-rotate :option="optionMusic"></avue-data-rotate>
  42. </el-card>
  43. <br>
  44. <el-card header="音乐之声-财务账本" v-if="permission.account_static">
  45. <avue-data-display :option="option"></avue-data-display>
  46. <el-row>
  47. <el-col :span="6">
  48. <div align="center" id="todayOut" style="width: 100%;height: 300px;"></div>
  49. </el-col>
  50. <el-col :span="6">
  51. <div align="center" id="historyOut" style="width: 100%;height: 300px;"></div>
  52. </el-col>
  53. <el-col :span="6">
  54. <div align="center" id="todayIn" style="width: 100%;height: 300px;"></div>
  55. </el-col>
  56. <el-col :span="6">
  57. <div align="center" id="historyIn" style="width: 100%;height: 300px;"></div>
  58. </el-col>
  59. </el-row>
  60. </el-card>
  61. <el-card header="音乐之声-佣金结算统计" v-if="permission.ordercommission_static">
  62. <el-button-group>
  63. <el-col :span="12">
  64. <el-button size="small" :type="buttonDay" icon="el-icon-document" @click="handleDay">按日
  65. </el-button>
  66. </el-col>
  67. <el-col :span="12">
  68. <el-button size="small" :type="buttonMonth" icon="el-icon-data-line" @click="handleMonth">按月
  69. </el-button>
  70. </el-col>
  71. </el-button-group>
  72. <el-date-picker value-format="yyyy-MM-dd" size="small" v-model="selectDate" :type="dateType" :placeholder="dataPlace">
  73. </el-date-picker>
  74. <el-button-group>
  75. <el-col :span="12">
  76. <el-button size="small" :type="buttonChart" icon="el-icon-data-line" @click="handleStatic">统计
  77. </el-button>
  78. </el-col>
  79. </el-button-group>
  80. <el-row>
  81. <el-col :span="24">
  82. <div id="orderStatistics" style="width: 100%;height: 600px;">
  83. </div>
  84. </el-col>
  85. </el-row>
  86. <!-- 图形 -->
  87. </el-card>
  88. </el-col>
  89. </el-row>
  90. </el-card>
  91. <el-card v-if="permission.bussiness_screen" :span="24">
  92. <el-row>
  93. <div>
  94. <el-row :gutter="50">
  95. <el-col span="12">
  96. <div style="background-color: #4d4dff;border-radius: 30px;">
  97. <avue-avatar style="margin:20px;" :size="128" :src="bussiness.icon"></avue-avatar>
  98. <span style="color: white;">{{bussiness.name}}</span>
  99. <span style="color: white;margin-left: 40px;">API密钥:</span> <span style="color: white;margin-left:10px">******</span>
  100. <span style="margin-left: 10px;">
  101. <el-tooltip content="API密钥用于接口对接,请谨慎保存" placement="bottom" effect="dark">
  102. <el-button type="primary" size="mini" @click="doCopy()">
  103. 复制
  104. </el-button>
  105. </el-tooltip>
  106. </span>
  107. <span style="margin-left: 30px;background-color: #4d4dff;">
  108. <el-link target="_blank" type="success" :href="bussiness.apiFilePath">Api文档下载(打开需输入密钥)</el-link>
  109. </span>
  110. <div>
  111. <el-button style="margin-left:50px;" type="primary" class="button" @click="editBussiness">编辑资料</el-button>
  112. <span style="color: white;margin-left: 40px;">服务费率(千分比):{{bussiness.serviceRate}}</span>
  113. </div>
  114. <div style="margin-left: 20px;margin-top:30px;">
  115. <span style="color: white;">账户余额</span>
  116. </div>
  117. <div style="margin-left: 20px;margin-top:10px;padding-bottom: 20px;">
  118. <span>
  119. <avue-avatar style="margin-bottom: 30px;" src="/img/bg/rmb.png"></avue-avatar>
  120. </span>
  121. <span style="font-size:60px;margin-left:20px;margin-bottom: 20px;color:white;">
  122. {{bussiness.remain}}
  123. </span>
  124. </div>
  125. </div>
  126. </el-col>
  127. <el-col span="12" height="400px">
  128. <el-row :gutter="50">
  129. <el-col span="12">
  130. <div style="background-color: #4d4dff;border-radius: 30px;" align="center" @click="chongzhi">
  131. <img style="margin:10px;" float="center" :size="30" src="/img/bg/qb.png" />
  132. <div style="color: white;padding-bottom: 10px;">
  133. 账户充值
  134. </div>
  135. </div>
  136. </el-col>
  137. <el-col span="12">
  138. <div style="background-color: #ff5050;border-radius: 30px;" align="center" @click="toMyOrder">
  139. <img style="margin:10px;" float="center" :size="30" src="/img/bg/zd.png" />
  140. <div style="color: white;padding-bottom: 10px;">
  141. 我的账单
  142. </div>
  143. </div>
  144. </el-col>
  145. </el-row>
  146. <el-row :gutter="50">
  147. <el-col span="12">
  148. <div style="background-color: #d633ff;border-radius: 30px;" align="center" @click="toMyDebit">
  149. <img style="margin:10px;" float="center" :size="30" src="/img/bg/fxfr.png" />
  150. <div style="color: white;padding-bottom: 10px;">
  151. 分销分润
  152. </div>
  153. </div>
  154. </el-col>
  155. <el-col span="12">
  156. <div style="background-color: #8080ff;border-radius: 30px;" align="center">
  157. <img style="margin:10px;" float="center" :size="30" src="/img/bg/sm.png" />
  158. <div style="color: white;padding-bottom: 10px;">
  159. 计费说明
  160. </div>
  161. </div>
  162. </el-col>
  163. </el-row>
  164. </el-col>
  165. </el-row>
  166. </div>
  167. </el-row>
  168. <el-row :gutter="50">
  169. <el-col span="12">
  170. <el-card style="background-color: #f2f2f2;border-radius: 30px;">
  171. <div slot="header">
  172. <span>推广数据</span>
  173. </div>
  174. <avue-data-display :option="tgOption"></avue-data-display>
  175. </el-card>
  176. </el-col>
  177. <el-col span="12">
  178. <el-card style="background-color: #f2f2f2;border-radius: 30px;">
  179. <div slot="header">
  180. <span>产品销量</span>
  181. </div>
  182. <avue-data-display :option="tgOption"></avue-data-display>
  183. </el-card>
  184. </el-col>
  185. </el-row>
  186. </el-card>
  187. </basic-container>
  188. </template>
  189. <script>
  190. import request from '@/router/axios';
  191. import echarts from "echarts";
  192. import {
  193. getList as getParams
  194. } from "@/api/system/param";
  195. import {
  196. add as addBillrecord,
  197. chongzhi,
  198. } from "@/api/billrecord/billrecord";
  199. import {
  200. getByAccount,
  201. update
  202. } from "@/api/guosen/bussiness"
  203. import {
  204. mapGetters
  205. } from "vuex";
  206. export default {
  207. data() {
  208. return {
  209. loading: true,
  210. editBussinessVisible: false,
  211. moneyChina: "壹拾万元整",
  212. bussiness: {},
  213. statDatas: [{
  214. key: "技术服务费率",
  215. value: 0
  216. },
  217. {
  218. key: "技术服务费",
  219. value: 0
  220. },
  221. {
  222. key: "充值金额",
  223. value: 0
  224. },
  225. {
  226. key: "可用余额",
  227. value: 0
  228. }
  229. ],
  230. yibaoOrder: {
  231. },
  232. billrecord: {
  233. payStatus: 0,
  234. type: 5
  235. },
  236. money: 100000,
  237. serviceRate: 0.005,
  238. chongzhiVisible: false,
  239. buttonDay: "primary",
  240. buttonMonth: "",
  241. selectDate: [],
  242. dateType: "daterange",
  243. dataPlace: "选择日期",
  244. query: {
  245. staticType: 1
  246. },
  247. tgOption: {
  248. span: 8,
  249. data: [{
  250. count: "66.6万",
  251. title: '总曝光量',
  252. },
  253. {
  254. count: '88.8万',
  255. title: '总点击率',
  256. },
  257. {
  258. count: '688万',
  259. title: '总访问量',
  260. },
  261. {
  262. count: '6666',
  263. title: '今日曝光量',
  264. },
  265. {
  266. count: '6666',
  267. title: '今日点击率',
  268. },
  269. {
  270. count: '6666',
  271. title: '今日访问量',
  272. }
  273. ]
  274. },
  275. bussiness_option2: {
  276. span: 12,
  277. data: [{
  278. click: function(item) {
  279. alert(JSON.stringify(item));
  280. },
  281. count: '150',
  282. title: '充值',
  283. icon: 'el-icon-warning',
  284. color: 'rgb(49, 180, 141)'
  285. }, {
  286. click: function(item) {
  287. alert(JSON.stringify(item));
  288. },
  289. count: '53%',
  290. title: '跳出率',
  291. icon: 'el-icon-view',
  292. color: '#00a65a'
  293. }, {
  294. click: function(item) {
  295. alert(JSON.stringify(item));
  296. },
  297. count: '44',
  298. title: '用户注册数',
  299. icon: 'el-icon-setting',
  300. color: '#f39c12'
  301. }]
  302. },
  303. bussinessOption: {
  304. height: 'auto',
  305. calcHeight: 30,
  306. tip: false,
  307. searchShow: true,
  308. searchMenuSpan: 6,
  309. border: true,
  310. index: true,
  311. viewBtn: true,
  312. selection: true,
  313. dialogClickModal: false,
  314. dialogWidth: "30%",
  315. column: [{
  316. label: "商户号名称",
  317. labelWidth: 130,
  318. prop: "name",
  319. span: 24,
  320. rules: [{
  321. required: true,
  322. message: "请输入商户号名称",
  323. trigger: "blur"
  324. }]
  325. },
  326. {
  327. label: "api回调地址",
  328. prop: "recallUrl",
  329. labelWidth: 130,
  330. span: 24,
  331. hide: true,
  332. rules: [{
  333. required: false,
  334. message: "请输入关联账号的密码",
  335. trigger: "blur"
  336. }]
  337. },
  338. {
  339. label: "广告图",
  340. prop: "icon",
  341. labelWidth: 130,
  342. span: 12,
  343. type: "upload",
  344. listType: "picture-img",
  345. action: '/api/putObject',
  346. propsHttp: {
  347. url: 'data'
  348. },
  349. rules: [{
  350. required: false,
  351. message: "请输入营业执照",
  352. trigger: "blur"
  353. }]
  354. },
  355. {
  356. label: "营业执照",
  357. prop: "businessLicense",
  358. labelWidth: 130,
  359. span: 12,
  360. type: "upload",
  361. listType: "picture-img",
  362. action: '/api/putObject',
  363. propsHttp: {
  364. url: 'data'
  365. },
  366. rules: [{
  367. required: false,
  368. message: "请输入营业执照",
  369. trigger: "blur"
  370. }]
  371. },
  372. {
  373. label: "税务登记证",
  374. prop: "taxAffairsLicense",
  375. labelWidth: 130,
  376. type: "upload",
  377. listType: "picture-img",
  378. action: '/api/putObject',
  379. propsHttp: {
  380. url: 'data'
  381. },
  382. span: 12,
  383. rules: [{
  384. required: false,
  385. message: "请输入税务登记证",
  386. trigger: "blur"
  387. }]
  388. },
  389. {
  390. label: "组织机构代码证",
  391. prop: "organizationCodeLicense",
  392. labelWidth: 130,
  393. span: 12,
  394. type: "upload",
  395. listType: "picture-img",
  396. action: '/api/putObject',
  397. propsHttp: {
  398. url: 'data'
  399. },
  400. rules: [{
  401. required: false,
  402. message: "请输入关联账号的密码",
  403. trigger: "blur"
  404. }]
  405. },
  406. {
  407. label: "关联账号的id",
  408. prop: "accountId",
  409. hide: true,
  410. display: false,
  411. rules: [{
  412. required: true,
  413. message: "请输入关联账号的id",
  414. trigger: "blur"
  415. }]
  416. },
  417. ]
  418. },
  419. bussiness_option1: {
  420. height: "500px",
  421. span: 24,
  422. data: [{
  423. click: function(item) {
  424. alert(JSON.stringify(item));
  425. },
  426. title: '分类统计',
  427. subtitle: '实时',
  428. count: 7993,
  429. allcount: 10222,
  430. text: '当前分类总记录数',
  431. color: 'rgb(27, 201, 142)',
  432. key: '类'
  433. },
  434. ]
  435. },
  436. option: {
  437. span: 6,
  438. data: [{
  439. click: function() {
  440. },
  441. count: 100,
  442. decimals: 2,
  443. title: '今日提现',
  444. },
  445. {
  446. click: function() {
  447. },
  448. count: 100,
  449. decimals: 2,
  450. title: '历史提现',
  451. },
  452. {
  453. click: function() {
  454. },
  455. count: 100,
  456. decimals: 2,
  457. title: '今日收入',
  458. },
  459. {
  460. click: function() {},
  461. count: 100,
  462. decimals: 2,
  463. title: '历史收入',
  464. }
  465. ]
  466. },
  467. optionMusic: {
  468. span: 6,
  469. data: [{
  470. title: '用户总数',
  471. count: 0,
  472. icon: 'el-icon-user',
  473. color: 'rgb(56, 161, 242)',
  474. click: () => {
  475. this.$router.push("/loginuser/loginuser");
  476. },
  477. },
  478. {
  479. click: () => {
  480. this.$router.push("/guosen/agenter");
  481. },
  482. title: '代理总数',
  483. count: 0,
  484. icon: 'el-icon-s-custom',
  485. color: 'rgb(3,180,144)',
  486. },
  487. {
  488. title: '活动总数',
  489. count: 0,
  490. icon: 'el-icon-s-flag',
  491. color: 'rgb(105,184,242)',
  492. click: () => {
  493. this.$router.push("/activity/activity");
  494. },
  495. },
  496. {
  497. title: '商品总数',
  498. count: 0,
  499. icon: 'el-icon-shopping-cart-full',
  500. color: 'rgb(49, 180, 141)',
  501. click: () => {
  502. this.$router.push("/userpointsgoods/userpointsgoods");
  503. },
  504. },
  505. ]
  506. },
  507. optionTodayOut: {
  508. title: {
  509. text: '今日提现去向',
  510. left: 'center'
  511. },
  512. tooltip: {
  513. trigger: 'item'
  514. },
  515. series: [{
  516. name: '今日提现去向',
  517. type: 'pie',
  518. radius: '70%',
  519. data: [{
  520. value: 0,
  521. name: '用户'
  522. },
  523. {
  524. value: 0,
  525. name: '代理'
  526. },
  527. {
  528. value: 0,
  529. name: '广告商'
  530. },
  531. {
  532. value: 0,
  533. name: '运营商'
  534. },
  535. {
  536. value: 0,
  537. name: '主办方'
  538. },
  539. ],
  540. emphasis: {
  541. itemStyle: {
  542. shadowBlur: 10,
  543. shadowOffsetX: 0,
  544. shadowColor: 'rgba(0, 0, 0, 0.5)'
  545. }
  546. }
  547. }]
  548. },
  549. optionHistoryOut: {
  550. title: {
  551. text: '历史提现去向',
  552. left: 'center'
  553. },
  554. tooltip: {
  555. trigger: 'item'
  556. },
  557. series: [{
  558. name: '历史提现去向',
  559. type: 'pie',
  560. radius: '70%',
  561. data: [{
  562. value: 0,
  563. name: '用户'
  564. },
  565. {
  566. value: 0,
  567. name: '代理'
  568. },
  569. {
  570. value: 0,
  571. name: '广告商'
  572. },
  573. {
  574. value: 0,
  575. name: '运营商'
  576. },
  577. {
  578. value: 0,
  579. name: '主办方'
  580. },
  581. ],
  582. emphasis: {
  583. itemStyle: {
  584. shadowBlur: 10,
  585. shadowOffsetX: 0,
  586. shadowColor: 'rgba(0, 0, 0, 0.5)'
  587. }
  588. }
  589. }]
  590. },
  591. optionTodayIn: {
  592. title: {
  593. text: '今日收入来源',
  594. left: 'center'
  595. },
  596. tooltip: {
  597. trigger: 'item'
  598. },
  599. series: [{
  600. name: '今日收入来源',
  601. type: 'pie',
  602. radius: '70%',
  603. data: [{
  604. value: 0,
  605. name: '用户'
  606. },
  607. {
  608. value: 0,
  609. name: '代理'
  610. },
  611. {
  612. value: 0,
  613. name: '广告商'
  614. },
  615. ],
  616. emphasis: {
  617. itemStyle: {
  618. shadowBlur: 10,
  619. shadowOffsetX: 0,
  620. shadowColor: 'rgba(0, 0, 0, 0.5)'
  621. }
  622. }
  623. }]
  624. },
  625. optionHistoryIn: {
  626. title: {
  627. text: '历史收入来源',
  628. left: 'center'
  629. },
  630. tooltip: {
  631. trigger: 'item'
  632. },
  633. series: [{
  634. name: '历史收入来源',
  635. type: 'pie',
  636. radius: '70%',
  637. data: [{
  638. value: 40.06,
  639. name: '用户'
  640. },
  641. {
  642. value: 0,
  643. name: '代理'
  644. },
  645. {
  646. value: 0,
  647. name: '广告商'
  648. },
  649. ],
  650. emphasis: {
  651. itemStyle: {
  652. shadowBlur: 10,
  653. shadowOffsetX: 0,
  654. shadowColor: 'rgba(0, 0, 0, 0.5)'
  655. }
  656. }
  657. }]
  658. },
  659. }
  660. },
  661. computed: {
  662. ...mapGetters(["permission", "userInfo"])
  663. },
  664. watch: {
  665. "money"() {
  666. if (this.money < 0) {
  667. this.money = 1;
  668. }
  669. this.moneyChina = this.convertCurrency(this.money)
  670. this.statDatas[0].value = this.bussiness.serviceRate /1000
  671. this.statDatas[1].value = this.money * this.bussiness.serviceRate /1000
  672. this.statDatas[2].value = parseFloat(this.money)
  673. this.statDatas[3].value = parseFloat(this.statDatas[2].value) - parseFloat(this.statDatas[1].value)
  674. },
  675. },
  676. mounted() {
  677. var _that = this;
  678. // this.type = this.tabsOption.column[0];
  679. let befDate = new Date();
  680. let byear = befDate.getFullYear();
  681. let bmonth = befDate.getMonth() + 1;
  682. let bday = befDate.getDate();
  683. let startTime = `${byear}-${bmonth}-${bday}`;
  684. this.selectDate = [startTime, startTime];
  685. this.getData();
  686. this.getOrderCommissionData();
  687. this.getAccoutStatic()
  688. getByAccount().then(res => {
  689. _that.bussiness = res.data.data
  690. _that.statDatas[0].value = res.data.data.serviceRate / 1000
  691. _that.statDatas[1].value = _that.money * _that.statDatas[0].value
  692. _that.statDatas[2].value = _that.money
  693. _that.statDatas[3].value = _that.statDatas[2].value - _that.statDatas[1].value
  694. console.log("buss" + JSON.stringify(_that.bussiness))
  695. })
  696. },
  697. methods: {
  698. submitBussiness(){
  699. update(this.bussiness).then(res=>{
  700. this.$message({
  701. type: "success",
  702. message: res.data.msg
  703. });
  704. this.editBussinessVisible = false;
  705. })
  706. },
  707. convertCurrency(money) {
  708. debugger
  709. //汉字的数字
  710. var cnNums = new Array('零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖');
  711. //基本单位
  712. var cnIntRadice = new Array('', '拾', '佰', '仟');
  713. //对应整数部分扩展单位
  714. var cnIntUnits = new Array('', '万', '亿', '兆');
  715. //对应小数部分单位
  716. var cnDecUnits = new Array('角', '分', '毫', '厘');
  717. //整数金额时后面跟的字符
  718. var cnInteger = '整';
  719. //整型完以后的单位
  720. var cnIntLast = '元';
  721. //最大处理的数字
  722. var maxNum = 999999999999999.9999;
  723. //金额整数部分
  724. var integerNum;
  725. //金额小数部分
  726. var decimalNum;
  727. //输出的中文金额字符串
  728. var chineseStr = '';
  729. //分离金额后用的数组,预定义
  730. var parts;
  731. if (money == '') {
  732. return '';
  733. }
  734. money = parseFloat(money);
  735. if (money >= maxNum) {
  736. //超出最大处理数字
  737. return '';
  738. }
  739. if (money == 0) {
  740. chineseStr = cnNums[0] + cnIntLast + cnInteger;
  741. return chineseStr;
  742. }
  743. //转换为字符串
  744. money = money.toString();
  745. if (money.indexOf('.') == -1) {
  746. integerNum = money;
  747. decimalNum = '';
  748. } else {
  749. parts = money.split('.');
  750. integerNum = parts[0];
  751. decimalNum = parts[1].substr(0, 4);
  752. }
  753. //获取整型部分转换
  754. if (parseInt(integerNum, 10) > 0) {
  755. var zeroCount = 0;
  756. var IntLen = integerNum.length;
  757. for (var i = 0; i < IntLen; i++) {
  758. var n = integerNum.substr(i, 1);
  759. var p = IntLen - i - 1;
  760. var q = p / 4;
  761. var m = p % 4;
  762. if (n == '0') {
  763. zeroCount++;
  764. } else {
  765. if (zeroCount > 0) {
  766. chineseStr += cnNums[0];
  767. }
  768. //归零
  769. zeroCount = 0;
  770. chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
  771. }
  772. if (m == 0 && zeroCount < 4) {
  773. chineseStr += cnIntUnits[q];
  774. }
  775. }
  776. chineseStr += cnIntLast;
  777. }
  778. //小数部分
  779. if (decimalNum != '') {
  780. var decLen = decimalNum.length;
  781. for (var i = 0; i < decLen; i++) {
  782. var n = decimalNum.substr(i, 1);
  783. if (n != '0') {
  784. chineseStr += cnNums[Number(n)] + cnDecUnits[i];
  785. }
  786. }
  787. }
  788. if (chineseStr == '') {
  789. chineseStr += cnNums[0] + cnIntLast + cnInteger;
  790. } else if (decimalNum == '') {
  791. chineseStr += cnInteger;
  792. }
  793. return chineseStr;
  794. },
  795. editBussiness() {
  796. this.editBussinessVisible = true;
  797. },
  798. doCopy() {
  799. this.$copyText(this.bussiness.secret)
  800. this.$message.success("复制成功")
  801. },
  802. toMyDebit() {
  803. this.$router.push('/guosen/bussinessdebitrequest');
  804. },
  805. toMyOrder() {
  806. this.$router.push('/bussiness/order');
  807. },
  808. guid() {
  809. var str = "abcdefghijklmnopqrstuvwxyz0123456789"; // 可以作为常量放到random外面
  810. var result = "";
  811. for (var i = 0; i < 32; i++) {
  812. result += str[parseInt(Math.random() * str.length)];
  813. }
  814. return result;
  815. },
  816. chongzhi() {
  817. this.chongzhiVisible = true;
  818. },
  819. chongzhiConfirm() {
  820. this.billrecord.price = this.money;
  821. this.billrecord.orderId = this.guid();
  822. this.billrecord.bussinessFee = this.statDatas[1].value
  823. //易宝订单
  824. this.yibaoOrder.orderId = this.billrecord.orderId; //商户请求号
  825. debugger
  826. this.yibaoOrder.orderAmount = this.money; //充值金额
  827. // this.yibaoOrder.payType = "B2B"; //"B2C:个人网银" "B2B:企业网银
  828. this.yibaoOrder.goodsName = "充值"
  829. this.yibaoOrder.notifyUrl = ",,,"
  830. // this.yibaoOrder.bankCode = "ABC,ICBC,BOC,CMBCHINA,SZPA,CCB"; //银行编码
  831. this.yibaoOrder.redirectUrl = "https://music.nanyue6688.com/test/#/wel/index";
  832. addBillrecord(this.billrecord).then(res => {
  833. chongzhi(this.yibaoOrder).then(res => {
  834. location.href = res.data.data.payUrl;
  835. console.log(JSON.stringify(res))
  836. })
  837. })
  838. },
  839. //按日
  840. handleDay() {
  841. this.buttonDay = "primary";
  842. this.buttonMonth = "";
  843. this.query.staticType = 1;
  844. this.dateType = "daterange";
  845. this.dataPlace = "选择日期";
  846. },
  847. //按月
  848. handleMonth() {
  849. this.buttonDay = "";
  850. this.buttonMonth = "primary";
  851. this.query.staticType = 2;
  852. this.dateType = "monthrange";
  853. this.dataPlace = "选择月份";
  854. },
  855. getAccoutStatic() {
  856. request({
  857. url: '/api/cyzh-static/staticAccountStatic',
  858. method: "get",
  859. }).then(res => {
  860. //今日提现
  861. let todayOut = res.data.data.todayOut;
  862. this.optionTodayOut.series[0].data[0].value = todayOut.userOut;
  863. this.optionTodayOut.series[0].data[1].value = todayOut.proxyOut;
  864. this.optionTodayOut.series[0].data[2].value = todayOut.adsOut;
  865. this.optionTodayOut.series[0].data[3].value = todayOut.operationOut;
  866. this.optionTodayOut.series[0].data[4].value = todayOut.sponsorOut;
  867. this.option.data[0].count = todayOut.total;
  868. //历史提现
  869. let historyOut = res.data.data.totalOut;
  870. this.optionHistoryOut.series[0].data[0].value = historyOut.userOut;
  871. this.optionHistoryOut.series[0].data[1].value = historyOut.proxyOut;
  872. this.optionHistoryOut.series[0].data[2].value = historyOut.adsOut;
  873. this.optionHistoryOut.series[0].data[3].value = historyOut.operationOut;
  874. this.optionHistoryOut.series[0].data[4].value = historyOut.sponsorOut;
  875. this.option.data[1].count = historyOut.total;
  876. //今日收入
  877. let todayIn = res.data.data.todayIn;
  878. this.optionTodayIn.series[0].data[0].value = todayIn.userIn;
  879. this.optionTodayIn.series[0].data[1].value = todayIn.proxyIn;
  880. this.optionTodayIn.series[0].data[2].value = todayIn.adsIn;
  881. this.option.data[2].count = todayIn.total;
  882. //历史收入
  883. let historyIn = res.data.data.totalIn;
  884. this.optionHistoryIn.series[0].data[0].value = historyIn.userIn;
  885. this.optionHistoryIn.series[0].data[1].value = historyIn.proxyIn;
  886. this.optionHistoryIn.series[0].data[2].value = historyIn.adsIn;
  887. this.option.data[3].count = historyIn.total;
  888. this.drawPie();
  889. })
  890. },
  891. getOrderCommissionData() {
  892. this.query.beginDate = this.selectDate[0];
  893. this.query.endDate = this.selectDate[1];
  894. request({
  895. url: '/api/cyzh-static/staticOrderCommission',
  896. method: "post",
  897. data: this.query
  898. }).then(res => {
  899. this.drawRealDemandLine(res.data.data.dateList, res.data.data.unClearList, res.data.data.clearedList)
  900. })
  901. },
  902. getData() {
  903. request({
  904. url: '/api/cyzh-static/static',
  905. method: "get"
  906. }).then(res => {
  907. const resData = res.data.data;
  908. this.optionMusic.data[0].count = resData.userCount;
  909. this.optionMusic.data[1].count = resData.agenterCount;
  910. this.optionMusic.data[2].count = resData.activityCount;
  911. this.optionMusic.data[3].count = resData.shopCount;
  912. })
  913. },
  914. handleStatic() {
  915. this.getOrderCommissionData();
  916. },
  917. drawPie() {
  918. let todayOutChart = echarts.init(document.getElementById('todayOut'));
  919. todayOutChart.setOption(this.optionTodayOut);
  920. let histroyOuntChart = echarts.init(document.getElementById('historyOut'));
  921. histroyOuntChart.setOption(this.optionHistoryOut);
  922. let todayInChart = echarts.init(document.getElementById('todayIn'));
  923. todayInChart.setOption(this.optionTodayIn);
  924. let historyInChart = echarts.init(document.getElementById('historyIn'));
  925. historyInChart.setOption(this.optionHistoryIn);
  926. },
  927. //柱形图
  928. drawRealDemandLine(dateList, unclearDataList, clearedDataList) {
  929. // 基于准备好的dom,初始化echarts实例
  930. let myChart = echarts.init(document.getElementById('orderStatistics'))
  931. // 基于准备好的dom,初始化echarts实例
  932. // 绘制图表
  933. myChart.setOption({
  934. title: {
  935. text: ''
  936. },
  937. tooltip: {
  938. trigger: 'axis',
  939. axisPointer: {
  940. type: 'shadow'
  941. }
  942. },
  943. grid: { //直角坐标系内绘图网格
  944. show: true, //是否显示直角坐标系网格。[ default: false ]
  945. left: "10%", //grid 组件离容器左侧的距离。
  946. right: "30px",
  947. borderColor: "#c45455", //网格的边框颜色
  948. bottom: "20%" //
  949. },
  950. legend: {
  951. data: ['待结算', '已结算'],
  952. show: true,
  953. },
  954. // x轴拖动
  955. dataZoom: [{
  956. type: "slider",
  957. realtime: true, //拖动滚动条时是否动态的更新图表数据
  958. height: 25, //滚动条高度
  959. start: 0, //滚动条开始位置(共100等份)
  960. end: 100 //结束位置(共100等份)
  961. }],
  962. xAxis: {
  963. data: dateList,
  964. axisLabel: { //坐标轴刻度标签的相关设置。
  965. interval: 0,
  966. rotate: "45"
  967. }
  968. },
  969. yAxis: {},
  970. series: [{
  971. name: '待结算',
  972. type: 'bar',
  973. stack: '佣金',
  974. data: unclearDataList
  975. }, {
  976. name: '已结算',
  977. type: 'bar',
  978. stack: '佣金',
  979. data: clearedDataList
  980. }]
  981. });
  982. }
  983. }
  984. }
  985. </script>
  986. <style>
  987. .button {
  988. padding: 10;
  989. float: center;
  990. }
  991. .image {
  992. width: 35%;
  993. display: block;
  994. border-radius: 65px;
  995. }
  996. .myTable {
  997. border-collapse: collapse;
  998. margin: 0 auto;
  999. text-align: center;
  1000. }
  1001. </style>