index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989
  1. <template>
  2. <div id="ActivityList">
  3. <el-radio-group
  4. v-model="type"
  5. @change="changeSearch"
  6. style="margin-bottom: 10px"
  7. >
  8. <el-radio-button :label="0">应收账款</el-radio-button>
  9. <el-radio-button :label="1">机构分成</el-radio-button>
  10. <el-radio-button :label="2">业务员提成</el-radio-button>
  11. <el-radio-button :label="3">佣金结算</el-radio-button>
  12. </el-radio-group>
  13. <search-box-new
  14. ref="searchBox"
  15. :formData="formData"
  16. :formList="formList"
  17. @search="search"
  18. @init="init"
  19. />
  20. <picture-list
  21. :key="type + 'a'"
  22. :fn="getCountOrderNum"
  23. :list="showTabList[type]"
  24. ></picture-list>
  25. <table-list
  26. :key="type"
  27. rowKey="id"
  28. ref="tableList"
  29. :tableSets="tableSet"
  30. :tableData="tableData"
  31. :navText="navText"
  32. :loading="loading"
  33. :setIndex="setIndex"
  34. @load="load"
  35. >
  36. <template slot="customize">
  37. <el-button v-if="type == 0" @click="openDialog({}, 4)" type="success">
  38. 坏账设置
  39. </el-button>
  40. <el-button @click="batchExport" type="primary"> 导出excel </el-button>
  41. </template>
  42. <template slot="predictPayTime" slot-scope="props">
  43. <span v-if="props.scope.row.creditStatus == 1">已结清</span>
  44. <span style="color: red" v-else>
  45. {{ $methodsTools.onlyForma(props.scope.row.predictPayTime) || "--" }}
  46. </span>
  47. </template>
  48. <template slot="noteType" slot-scope="props">
  49. <div v-if="!props.scope.row.noteId || props.scope.row.noteType == 1">
  50. --
  51. </div>
  52. <div v-else>
  53. <div :class="'tip' + props.scope.row.noteType">
  54. <span v-for="(text, idx) in backText(props.scope.row)" :key="idx">
  55. <span v-if="props.scope.row.noteType == 3">周</span>
  56. {{ text }}
  57. <span v-if="props.scope.row.noteType == 4">日</span>
  58. <i></i>
  59. </span>
  60. </div>
  61. <div>{{ props.scope.row.dayTime }}</div>
  62. </div>
  63. </template>
  64. <template slot="divideCheckStatus" slot-scope="props">
  65. <div v-if="props.scope.row.billType != 7">
  66. {{
  67. divideCheckStatus(
  68. props.scope.row.orderSn,
  69. props.scope.row.payStatus,
  70. props.scope.row.checkStatus
  71. )
  72. }}
  73. <span style="color: #409eff" v-if="props.scope.row.roleName">
  74. ({{ props.scope.row.roleName }})
  75. </span>
  76. </div>
  77. </template>
  78. <template slot="status" slot-scope="props">
  79. {{ backStatus(props.scope) | formatPrice }}
  80. </template>
  81. <template slot="btn" slot-scope="props">
  82. <el-button
  83. v-if="props.scope.row.oId || type == 0"
  84. type="text"
  85. @click="openDialog(props.scope.row, 3)"
  86. >
  87. 查看详情
  88. </el-button>
  89. <el-button
  90. v-if="type == 0"
  91. type="text"
  92. :disabled="props.scope.row.creditStatus == 1"
  93. @click="openDialog(props.scope.row, 0)"
  94. >
  95. 催款提醒
  96. </el-button>
  97. <template v-else>
  98. <el-button
  99. type="text"
  100. v-if="!props.scope.row.orderSn"
  101. :disabled="
  102. !(
  103. props.scope.row.payStatus === 0 ||
  104. props.scope.row.payStatus === 4
  105. )
  106. "
  107. @click="openDialog(props.scope.row, 1)"
  108. >
  109. {{
  110. type == 1
  111. ? "分成支付"
  112. : type == 2
  113. ? "提成支付"
  114. : type == 3
  115. ? "佣金支付"
  116. : ""
  117. }}
  118. </el-button>
  119. <el-button
  120. v-else
  121. type="text"
  122. :disabled="props.scope.row.checkStatus !== 0"
  123. @click="openDialog(props.scope.row, 1)"
  124. >
  125. {{
  126. type == 1
  127. ? "分成审核"
  128. : type == 2
  129. ? "提成审核"
  130. : type == 3
  131. ? "佣金审核"
  132. : ""
  133. }}
  134. </el-button>
  135. <el-button
  136. type="text"
  137. style="color: #e6a23c"
  138. @click="openDialog(props.scope.row, 2)"
  139. >
  140. 修改备注
  141. </el-button>
  142. </template>
  143. </template>
  144. </table-list>
  145. <pagination
  146. :total="total"
  147. :pageSize.sync="formData.pageSize"
  148. :currentPage.sync="formData.pageNum"
  149. @search="search"
  150. />
  151. <dislog-tip
  152. :dialogVisible.sync="tipDialogVisible"
  153. :orderInfo="activeOrderInfo"
  154. @search="search"
  155. />
  156. <!-- 订单详情 -->
  157. <dislog-order-details
  158. :orderSn="activeOrderInfo.orderSn"
  159. :orderFrom="activeOrderInfo.orderFrom"
  160. :dialogVisible.sync="orderDialogVisible"
  161. />
  162. <arap-remarks
  163. :info="activeOrderInfo"
  164. @search="search"
  165. :dialogVisible.sync="remarkDialogVisible"
  166. />
  167. <dislog-set
  168. :dialogVisible.sync="examineDialogVisible"
  169. @search="search"
  170. :info="activeOrderInfo"
  171. @update="update"
  172. ></dislog-set>
  173. <!-- 坏账设置 -->
  174. <dislog-bad-bill
  175. :dialogVisible.sync="badBillDialogVisible"
  176. ></dislog-bad-bill>
  177. </div>
  178. </template>
  179. <script>
  180. import dislogSet from "../components/audit/dislogSet.vue";
  181. import searchBoxNew from "@/components/searchBoxNew";
  182. import tableList from "@/components/tableList";
  183. import pagination from "@/components/pagination";
  184. import dislogTip from "./dislogTip.vue";
  185. import dislogOrderDetails from "../components/dislogOrderDetails.vue";
  186. import arapRemarks from "../components/arapRemarks.vue";
  187. import pictureList from "@/components/Comon/pictureList.vue";
  188. import dislogBadBill from "../components/dislogBadBill.vue";
  189. import { exportFn } from "@/utils/index.js";
  190. import {
  191. orderList,
  192. companyList,
  193. orderExport,
  194. tenantExport,
  195. sellerExport,
  196. countOrderNum,
  197. commissionList,
  198. sellerPercentageList,
  199. monthOrderList,
  200. commissionExport,
  201. } from "@/api/financed/index";
  202. export default {
  203. name: "Arap",
  204. components: {
  205. searchBoxNew,
  206. tableList,
  207. pagination,
  208. dislogTip,
  209. dislogOrderDetails,
  210. arapRemarks,
  211. dislogSet,
  212. pictureList,
  213. dislogBadBill,
  214. },
  215. data() {
  216. return {
  217. value5: [],
  218. showTabList: [
  219. [
  220. {
  221. label: "未收账款",
  222. prop: "orderUncollectedTotal",
  223. img: "未收款",
  224. },
  225. ],
  226. [
  227. {
  228. label: "待付分成",
  229. prop: "unPayMoneyTotal",
  230. img: "未收款",
  231. },
  232. {
  233. label: "待扣分成",
  234. prop: "unDeductMoneyTotal",
  235. img: "已退款",
  236. },
  237. {
  238. label: "已扣分成",
  239. prop: "deductMoneyTotal",
  240. img: "成本金额",
  241. },
  242. {
  243. label: "已付分成",
  244. prop: "payMoneyTotal",
  245. img: "已收款",
  246. },
  247. ],
  248. [
  249. {
  250. label: "待付分成",
  251. prop: "unPayMoneyTotal",
  252. img: "未收款",
  253. },
  254. {
  255. label: "待扣分成",
  256. prop: "unDeductMoneyTotal",
  257. img: "已退款",
  258. },
  259. {
  260. label: "已扣分成",
  261. prop: "deductMoneyTotal",
  262. img: "成本金额",
  263. },
  264. {
  265. label: "已付分成",
  266. prop: "payMoneyTotal",
  267. img: "已收款",
  268. },
  269. ],
  270. [
  271. {
  272. label: "待付佣金",
  273. prop: "unPayMoneyTotal",
  274. img: "未收款",
  275. },
  276. {
  277. label: "已付佣金",
  278. prop: "payMoneyTotal",
  279. img: "已收款",
  280. },
  281. ],
  282. ],
  283. loading: false, //当前表单加载是否加载动画
  284. navText: {
  285. title: "应收应付",
  286. index: 0,
  287. ch: "条",
  288. num: true,
  289. choice: false,
  290. addHide: true,
  291. dontNum: false,
  292. openCheckMore: true,
  293. changeWidth: "240px",
  294. custom: false,
  295. tableColor: true,
  296. tableColorFunc: ({ row, rowIndex }) => {
  297. if (row.oId) {
  298. return "child-row";
  299. }
  300. return "";
  301. },
  302. },
  303. formData: {
  304. pageSize: 10,
  305. pageNum: 1,
  306. },
  307. // 表单
  308. tableSet0: [
  309. {
  310. label: "坏账",
  311. prop: "badBill",
  312. hidden: true,
  313. scope: "isOptions",
  314. options: [
  315. {
  316. label: "否",
  317. value: false,
  318. },
  319. {
  320. label: "是",
  321. value: true,
  322. style: {
  323. color: "red",
  324. },
  325. },
  326. ],
  327. },
  328. {
  329. label: "下单时间",
  330. prop: "buyTime",
  331. hidden: true,
  332. scope: "aTimeList",
  333. },
  334. {
  335. label: "订单单号",
  336. prop: "orderSn",
  337. hidden: true,
  338. },
  339. {
  340. label: "机构名称",
  341. prop: "tenantName",
  342. hidden: true,
  343. },
  344. {
  345. label: "业务员",
  346. prop: "createUsername",
  347. hidden: true,
  348. },
  349. {
  350. label: "业务号",
  351. prop: "createNo",
  352. hidden: true,
  353. },
  354. {
  355. label: "合同金额(元)",
  356. prop: "orderPrice",
  357. hidden: true,
  358. scope: "formatPrice",
  359. },
  360. {
  361. label: "已收账款(元)",
  362. prop: "orderReceived",
  363. hidden: true,
  364. scope: "formatPrice",
  365. },
  366. {
  367. label: "已退金额(元)",
  368. prop: "orderRefunded",
  369. hidden: true,
  370. scope: "formatPrice",
  371. },
  372. {
  373. label: "未收账款(元)",
  374. prop: "orderUncollected",
  375. hidden: true,
  376. scope: "formatPrice",
  377. },
  378. {
  379. label: "预收时间",
  380. hidden: true,
  381. prop: "predictReceiveTime",
  382. scope: "aTimeList",
  383. },
  384. {
  385. label: "剩余天数",
  386. prop: "predictReceiveDay",
  387. hidden: true,
  388. scope: "fill",
  389. },
  390. {
  391. label: "提醒设置",
  392. prop: "noteType",
  393. scope: "solt",
  394. soltName: "noteType",
  395. hidden: true,
  396. },
  397. {
  398. label: "最新提醒",
  399. prop: "lastTime",
  400. hidden: true,
  401. scope: "aTimeList",
  402. },
  403. ],
  404. tableSet1: [
  405. {
  406. label: "时间",
  407. prop: "monthTime",
  408. hidden: true,
  409. width: 140,
  410. },
  411. {
  412. label: "订单单号",
  413. prop: "orderSn",
  414. hidden: true,
  415. scope: "fill",
  416. width: 200,
  417. },
  418. {
  419. label: "类型",
  420. prop: "billType",
  421. scope: "type",
  422. hidden: true,
  423. values: {
  424. 1: "月份",
  425. 2: "季度",
  426. 3: "半年",
  427. 4: "年度",
  428. 6: "完单",
  429. 7: "退款",
  430. },
  431. },
  432. {
  433. label: "机构名称",
  434. prop: "tenantName",
  435. hidden: true,
  436. },
  437. {
  438. label: "角色名称",
  439. prop: "roleName",
  440. hidden: true,
  441. scope: "fill",
  442. },
  443. {
  444. label: "已付分成(元)",
  445. prop: "payMoney",
  446. hidden: true,
  447. scope: "solt",
  448. soltName: "status",
  449. },
  450. {
  451. label: "已扣分成(元)",
  452. prop: "deductMoney",
  453. hidden: true,
  454. scope: "solt",
  455. soltName: "status",
  456. },
  457. {
  458. label: "待付分成(元)",
  459. prop: "payMoney",
  460. hidden: true,
  461. scope: "solt",
  462. soltName: "status",
  463. },
  464. {
  465. label: "待扣分成(元)",
  466. prop: "deductMoney",
  467. hidden: true,
  468. scope: "solt",
  469. soltName: "status",
  470. },
  471. {
  472. label: "预付时间",
  473. prop: "predictPayTime",
  474. hidden: true,
  475. scope: "aTimeList",
  476. hidden: true,
  477. },
  478. {
  479. label: "剩余天数",
  480. prop: "predictPayDay",
  481. hidden: true,
  482. scope: "fill",
  483. },
  484. {
  485. label: "审核状态",
  486. prop: "divideCheckStatus",
  487. hidden: true,
  488. scope: "solt",
  489. soltName: "divideCheckStatus",
  490. },
  491. {
  492. label: "支付时间",
  493. prop: "payTime",
  494. scope: "aTimeList",
  495. hidden: true,
  496. },
  497. {
  498. label: "备注",
  499. prop: "remark",
  500. hidden: true,
  501. },
  502. ],
  503. tableSet2: [
  504. {
  505. label: "时间",
  506. prop: "monthTime",
  507. hidden: true,
  508. width: 140,
  509. },
  510. {
  511. label: "订单单号",
  512. prop: "orderSn",
  513. scope: "fill",
  514. hidden: true,
  515. width: 200,
  516. },
  517. {
  518. label: "类型",
  519. prop: "billType",
  520. scope: "type",
  521. hidden: true,
  522. values: {
  523. 1: "月份",
  524. 2: "季度",
  525. 3: "半年",
  526. 4: "年度",
  527. 6: "完单",
  528. 7: "退款",
  529. },
  530. },
  531. {
  532. label: "机构名称",
  533. prop: "tenantName",
  534. hidden: true,
  535. },
  536. {
  537. label: "角色名称",
  538. prop: "roleName",
  539. hidden: true,
  540. scope: "fill",
  541. },
  542. {
  543. label: "业务员",
  544. prop: "createUsername",
  545. hidden: true,
  546. },
  547. {
  548. label: "业务号",
  549. prop: "createNo",
  550. hidden: true,
  551. },
  552. {
  553. label: "已付提成(元)",
  554. prop: "payMoney",
  555. hidden: true,
  556. scope: "solt",
  557. soltName: "status",
  558. },
  559. {
  560. label: "已扣提成(元)",
  561. prop: "deductMoney",
  562. hidden: true,
  563. scope: "solt",
  564. soltName: "status",
  565. },
  566. {
  567. label: "待付提成(元)",
  568. prop: "payMoney",
  569. hidden: true,
  570. scope: "solt",
  571. soltName: "status",
  572. },
  573. {
  574. label: "待扣提成(元)",
  575. prop: "deductMoney",
  576. hidden: true,
  577. scope: "solt",
  578. soltName: "status",
  579. },
  580. {
  581. label: "审核状态",
  582. prop: "divideCheckStatus",
  583. hidden: true,
  584. scope: "solt",
  585. soltName: "divideCheckStatus",
  586. },
  587. {
  588. label: "支付时间",
  589. prop: "payTime",
  590. scope: "aTimeList",
  591. hidden: true,
  592. },
  593. {
  594. label: "备注",
  595. prop: "remark",
  596. hidden: true,
  597. },
  598. ],
  599. tableSet3: [
  600. {
  601. label: "时间",
  602. prop: "monthTime",
  603. hidden: true,
  604. width: 140,
  605. },
  606. {
  607. label: "订单单号",
  608. prop: "orderSn",
  609. scope: "fill",
  610. hidden: true,
  611. width: 200,
  612. },
  613. {
  614. label: "机构名称",
  615. prop: "tenantName",
  616. hidden: true,
  617. },
  618. {
  619. label: "角色名称",
  620. prop: "roleName",
  621. hidden: true,
  622. scope: "fill",
  623. },
  624. {
  625. label: "已付佣金(元)",
  626. prop: "payMoney",
  627. hidden: true,
  628. scope: "solt",
  629. soltName: "status",
  630. },
  631. {
  632. label: "待付佣金(元)",
  633. prop: "payMoney",
  634. hidden: true,
  635. scope: "solt",
  636. soltName: "status",
  637. },
  638. {
  639. label: "审核状态",
  640. prop: "divideCheckStatus",
  641. hidden: true,
  642. scope: "solt",
  643. soltName: "divideCheckStatus",
  644. },
  645. {
  646. label: "支付时间",
  647. prop: "payTime",
  648. scope: "aTimeList",
  649. hidden: true,
  650. },
  651. {
  652. label: "备注",
  653. prop: "remark",
  654. hidden: true,
  655. },
  656. ],
  657. tableData: [], //表单数据
  658. total: 0, //一共多少条
  659. tipDialogVisible: false,
  660. orderDialogVisible: false,
  661. remarkDialogVisible: false,
  662. examineDialogVisible: false,
  663. badBillDialogVisible: false,
  664. type: 0,
  665. activeOrderInfo: {},
  666. roleList: [],
  667. countInfo: {},
  668. spanData: {},
  669. maps: new Map(),
  670. };
  671. },
  672. created() {
  673. this.init();
  674. },
  675. methods: {
  676. divideCheckStatus(type, e1, e2) {
  677. var a = "";
  678. if (type) {
  679. switch (e2) {
  680. case -1:
  681. a = "未通过";
  682. break;
  683. case 0:
  684. a = "待审核";
  685. break;
  686. case 1:
  687. a = "已通过";
  688. break;
  689. case 2:
  690. a = "待支付";
  691. break;
  692. case 3:
  693. a = "已支付";
  694. break;
  695. default:
  696. break;
  697. }
  698. } else {
  699. switch (e1) {
  700. case 0:
  701. a = "待支付";
  702. break;
  703. case 1:
  704. a = "已打款";
  705. break;
  706. case 2:
  707. a = "待审核";
  708. break;
  709. case 3:
  710. a = "打款中";
  711. break;
  712. case 4:
  713. a = "打款失败";
  714. break;
  715. default:
  716. break;
  717. }
  718. }
  719. return a;
  720. },
  721. openDialog(data, type) {
  722. this.activeOrderInfo = data;
  723. this.activeOrderInfo.checkFrom = this.type + 1;
  724. this[
  725. ["tip", "examine", "remark", "order", "badBill"][type] + "DialogVisible"
  726. ] = true;
  727. },
  728. batchExport() {
  729. const fn = [orderExport, tenantExport, sellerExport, commissionExport][
  730. this.type
  731. ];
  732. fn(this.formData).then((res) => {
  733. if (res.msg) {
  734. exportFn(
  735. res.msg,
  736. `导出${
  737. ["应收应付", "机构分成", "业务员提成", "佣金结算"][this.type]
  738. }数据`
  739. );
  740. } else {
  741. this.$message.error("导出失败");
  742. }
  743. });
  744. },
  745. backText(row) {
  746. const type = row.noteType;
  747. if (type == 2) {
  748. return ["每天"];
  749. }
  750. const key = ["weekTime", "monthTime"][type - 3];
  751. let data = row[key].split(",").sort((a, b) => a - b);
  752. return data;
  753. },
  754. setIndex(index) {
  755. return index + 1;
  756. },
  757. changeSearch() {
  758. this.maps.clear();
  759. this.search(2);
  760. },
  761. getDataList() {
  762. const fn = [orderList, companyList, sellerPercentageList, commissionList][
  763. this.type
  764. ];
  765. fn(this.formData)
  766. .then((res) => {
  767. this.type != 0 &&
  768. res.rows.forEach((e) => {
  769. e.children = [];
  770. e.hasChildren = true;
  771. e.monthTime = this.parseTime(e.monthTime, "{y}-{m}");
  772. });
  773. this.tableData = res.rows;
  774. this.total = res.total;
  775. this.navText.index = res.total;
  776. })
  777. .finally(() => {
  778. this.loading = false;
  779. });
  780. },
  781. load(tree, treeNode, resolve) {
  782. monthOrderList({ divideLogId: tree.id, roleId: this.formData.roleId })
  783. .then((res) => {
  784. // id冲突会报错
  785. res.data.forEach((e) => {
  786. e.oId = e.id;
  787. e.id = e.id + 100086;
  788. e.billType = e.orderType + 5;
  789. e.monthTime = this.parseTime(e.orderTime, "{y}-{m}-{d}");
  790. if (this.type == 3 || this.type == 2) {
  791. e.divideCompanyMoney =
  792. this.type == 2 ? e.divideSellerMoney : e.brokerage;
  793. }
  794. });
  795. resolve(res.data);
  796. })
  797. .catch(() => {
  798. resolve([]);
  799. });
  800. this.maps.set(tree.id, { tree, treeNode, resolve });
  801. },
  802. update(parentId) {
  803. const { tree, treeNode, resolve } = this.maps.get(parentId);
  804. this.$set(
  805. this.$refs.tableList.$refs.pagerset.store.states.lazyTreeNodeMap,
  806. parentId,
  807. []
  808. );
  809. if (tree) {
  810. this.load(tree, treeNode, resolve);
  811. }
  812. },
  813. // 切换已付待付
  814. backStatus({ row, column }) {
  815. let { payStatus, oId } = row;
  816. let { label, property } = column;
  817. if (oId) {
  818. property =
  819. property == "payMoney" ? "divideCompanyMoney" : "divideMoney";
  820. // payStatus = payStatus != 3 ? 0 : 1;
  821. }
  822. payStatus = payStatus != 1 ? 0 : 1;
  823. return ["0.00", row[property]][
  824. (label.indexOf("已") != -1 ? 0 : 1) ^ payStatus
  825. ];
  826. },
  827. changeData(data) {
  828. if (this.type == 0) {
  829. return data;
  830. }
  831. let total = 0;
  832. let arr = [];
  833. data.forEach((ele) => {
  834. const monthList = ele.monthList;
  835. delete ele.monthList;
  836. this.spanData[total] = monthList.length;
  837. total += monthList.length;
  838. monthList.map((e) => {
  839. Object.keys(e).forEach((key) => {
  840. e[key] = e[key] || ele[key];
  841. });
  842. });
  843. arr.push(...monthList);
  844. });
  845. return arr;
  846. },
  847. search(v) {
  848. this.loading = true;
  849. if (v === 2) {
  850. this.formData = {
  851. pageSize: 10,
  852. pageNum: 1,
  853. month: [],
  854. };
  855. }
  856. this.maps.forEach((value, id) => {
  857. this.update(id);
  858. });
  859. this.getDataList();
  860. },
  861. init() {
  862. this.getRoleList();
  863. this.search(2);
  864. },
  865. getRoleList() {
  866. this.$api.obtainRoleList().then((res) => {
  867. this.roleList = res.rows;
  868. });
  869. },
  870. getCountOrderNum() {
  871. return countOrderNum({ totalType: this.type + 1 }).then((res) => {
  872. return Promise.resolve(res);
  873. });
  874. },
  875. },
  876. computed: {
  877. tableSet() {
  878. return this["tableSet" + this.type];
  879. },
  880. formList() {
  881. const key = ["订单", "分成", "提成", "分成"][this.type];
  882. let data = [
  883. {
  884. prop: "tenantId",
  885. placeholder: "机构选择",
  886. scope: "systemtenantlist",
  887. },
  888. ];
  889. if (this.type != 0) {
  890. data.push(
  891. {
  892. prop: "roleId",
  893. scope: "roleList",
  894. placeholder: "角色选择",
  895. },
  896. {
  897. prop: "monthTime",
  898. scope: "moreMonth",
  899. },
  900. {
  901. prop: "payStatus",
  902. placeholder: "审核状态",
  903. scope: "select",
  904. options: [
  905. { label: "待支付", value: 0 },
  906. { label: "已打款", value: 1 },
  907. { label: "待审核", value: 2 },
  908. { label: "打款中", value: 3 },
  909. { label: "打款失败", value: 4 },
  910. ],
  911. }
  912. );
  913. }
  914. if (this.type == 0) {
  915. data.push(
  916. {
  917. prop: "badBill",
  918. placeholder: "坏账选择",
  919. scope: "select",
  920. options: [
  921. { label: "是", value: 1 },
  922. { label: "否", value: 2 },
  923. ],
  924. },
  925. {
  926. prop1: "startTime",
  927. prop2: "endTime",
  928. placeholder1: key + "开始时间",
  929. placeholder2: key + "结束时间",
  930. scope: "moreDataPicker",
  931. },
  932. {
  933. prop: "orderSn",
  934. placeholder: "订单单号",
  935. }
  936. );
  937. }
  938. if (this.type == 0 || this.type == 2) {
  939. data.push({
  940. prop: "keyNo",
  941. placeholder: "业务号",
  942. });
  943. }
  944. if (this.type == 1) {
  945. data.push({
  946. prop: "billType",
  947. placeholder: "账单类型",
  948. scope: "select",
  949. options: [
  950. { label: "月份", value: 1 },
  951. { label: "季度", value: 2 },
  952. { label: "半年", value: 3 },
  953. { label: "年度", value: 4 },
  954. ],
  955. });
  956. }
  957. return data;
  958. },
  959. },
  960. watch: {
  961. type(value) {
  962. this.navText.title = ["应收应付", "机构分成", "业务员提成", "佣金结算"][
  963. value
  964. ];
  965. },
  966. },
  967. };
  968. </script>
  969. <style lang="scss" scoped>
  970. .tip4,
  971. .tip3 {
  972. white-space: normal;
  973. i::before {
  974. content: ",";
  975. }
  976. }
  977. /deep/ {
  978. .el-table {
  979. .child-row {
  980. background: #f0f9eb;
  981. .el-table__cell {
  982. background: #f0f9eb !important;
  983. }
  984. }
  985. }
  986. }
  987. </style>