index.vue 34 KB

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