index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  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-group>
  12. <search-box-new
  13. ref="searchBox"
  14. :formData="formData"
  15. :formList="formList"
  16. @search="search"
  17. @init="init"
  18. />
  19. <div class="dis_flex_order_li">
  20. <div class="list" v-for="(item, index) in showTabList[type]" :key="index">
  21. <img :src="item.img" alt="" />
  22. <div class="right">
  23. <h4>{{ item.label }}:</h4>
  24. <p>{{ countInfo[item.prop] }}{{ item.ch || "元" }}</p>
  25. </div>
  26. </div>
  27. </div>
  28. <table-list
  29. :key="type"
  30. rowKey="id"
  31. ref="tableList"
  32. @openDialog="(row) => openDialog(row, 0)"
  33. :tableSets="tableSet"
  34. :tableData="tableData"
  35. :navText="navText"
  36. :loading="loading"
  37. >
  38. <template slot="customize">
  39. <el-button @click="batchExport" type="primary"> 导出excel </el-button>
  40. </template>
  41. <template slot="predictPayTime" slot-scope="props">
  42. <span v-if="props.scope.row.creditStatus == 1">已结清</span>
  43. <span style="color: red" v-else>
  44. {{ $methodsTools.onlyForma(props.scope.row.predictPayTime) || "--" }}
  45. </span>
  46. </template>
  47. <template slot="noteType" slot-scope="props">
  48. <div v-if="!props.scope.row.noteId || props.scope.row.noteType == 1">
  49. --
  50. </div>
  51. <div v-else>
  52. <div :class="'tip' + props.scope.row.noteType">
  53. <span v-for="(text, idx) in backText(props.scope.row)" :key="idx">
  54. <span v-if="props.scope.row.noteType == 3">周</span>
  55. {{ text }}
  56. <span v-if="props.scope.row.noteType == 4">日</span>
  57. <i></i>
  58. </span>
  59. </div>
  60. <div>{{ props.scope.row.dayTime }}</div>
  61. </div>
  62. </template>
  63. <template slot="refundStatus" slot-scope="props">
  64. <div>
  65. {{
  66. ["待审核", "未通过", "未退款", "已完成"][
  67. props.scope.row.refundStatus
  68. ]
  69. }}
  70. <span></span>
  71. </div>
  72. </template>
  73. <template slot="status" slot-scope="props">
  74. <el-checkbox
  75. @change="changeStatus"
  76. :checked="!!props.scope.row.status"
  77. ></el-checkbox>
  78. </template>
  79. <template slot="btn" slot-scope="props">
  80. <el-button
  81. v-if="type == 0"
  82. type="text"
  83. :disabled="props.scope.row.creditStatus == 1"
  84. @click="openDialog(props.scope.row, 1)"
  85. >
  86. 催款提醒
  87. </el-button>
  88. <template v-else>
  89. <el-button
  90. type="text"
  91. :disabled="props.scope.row.creditStatus == 1"
  92. @click="openDialog(props.scope.row, 2)"
  93. >
  94. 点击审核
  95. </el-button>
  96. <el-button
  97. type="text"
  98. style="color: #e6a23c"
  99. @click="openDialog(props.scope.row, 3)"
  100. >
  101. 修改备注
  102. </el-button>
  103. </template>
  104. </template>
  105. </table-list>
  106. <pagination
  107. :total="total"
  108. :pageSize.sync="formData.pageSize"
  109. :currentPage.sync="formData.pageNum"
  110. @search="search"
  111. />
  112. <dislog-tip
  113. :dialogVisible.sync="tipDialogVisible"
  114. :orderInfo="activeOrderInfo"
  115. @search="search"
  116. />
  117. <!-- 订单详情 -->
  118. <dislog-order-details :dialogVisible.sync="orderDialogVisible" />
  119. <arap-remarks
  120. :orderSn="activeOrderInfo.orderSn"
  121. :remark="activeOrderInfo.remark"
  122. @search="search"
  123. :dialogVisible.sync="remarkDialogVisible"
  124. ></arap-remarks>
  125. </div>
  126. </template>
  127. <script>
  128. import searchBoxNew from "@/components/searchBoxNew";
  129. import tableList from "@/components/tableList";
  130. import pagination from "@/components/pagination";
  131. import dislogTip from "./dislogTip.vue";
  132. import dislogOrderDetails from "../components/dislogOrderDetails.vue";
  133. import arapRemarks from "../components/arapRemarks.vue";
  134. import { exportFn } from "@/utils/index.js";
  135. import {
  136. orderList,
  137. sellerList,
  138. tenantList,
  139. orderExport,
  140. countOrderNum,
  141. } from "@/api/financed/index";
  142. export default {
  143. name: "cost",
  144. components: {
  145. searchBoxNew,
  146. tableList,
  147. pagination,
  148. dislogTip,
  149. dislogOrderDetails,
  150. arapRemarks,
  151. },
  152. data() {
  153. return {
  154. showTabList: [
  155. [
  156. {
  157. label: "合同金额",
  158. prop: "orderPriceTotal",
  159. img: require("@/assets/images/合同金额@2x.png"),
  160. },
  161. {
  162. label: "已收账款",
  163. prop: "orderReceivedTotal",
  164. img: require("@/assets/images/已收款@2x.png"),
  165. },
  166. {
  167. label: "未收账款",
  168. prop: "orderUncollectedTotal",
  169. img: require("@/assets/images/未收款@2x.png"),
  170. },
  171. ],
  172. [
  173. {
  174. label: "待付账款",
  175. prop: "sellerPay",
  176. img: require("@/assets/images/未收款@2x.png"),
  177. },
  178. ],
  179. [
  180. {
  181. label: "待付账款",
  182. prop: "tenantPay",
  183. img: require("@/assets/images/未收款@2x.png"),
  184. },
  185. ],
  186. ],
  187. loading: false, //当前表单加载是否加载动画
  188. navText: {
  189. title: "应收应付",
  190. index: 0,
  191. ch: "条",
  192. num: true,
  193. choice: false,
  194. addHide: true,
  195. openCheckMore: true,
  196. changeWidth: "160px",
  197. custom: false,
  198. },
  199. formData: {
  200. pageSize: 10,
  201. pageNum: 1,
  202. },
  203. // 表单
  204. tableSet0: [
  205. {
  206. label: "下单时间",
  207. prop: "buyTime",
  208. hidden: true,
  209. scope: "aTimeList",
  210. },
  211. {
  212. label: "订单单号",
  213. prop: "orderSn",
  214. hidden: true,
  215. scope: "openDialog",
  216. },
  217. {
  218. label: "机构名称",
  219. prop: "tenantName",
  220. hidden: true,
  221. },
  222. {
  223. label: "业务员",
  224. prop: "createUsername",
  225. hidden: true,
  226. },
  227. {
  228. label: "业务号",
  229. prop: "createNo",
  230. hidden: true,
  231. },
  232. {
  233. label: "合同金额(元)",
  234. prop: "orderPrice",
  235. hidden: true,
  236. },
  237. {
  238. label: "已收账款(元)",
  239. prop: "orderReceived",
  240. hidden: true,
  241. },
  242. {
  243. label: "未收账款(元)",
  244. prop: "orderUncollected",
  245. hidden: true,
  246. },
  247. {
  248. label: "预收时间",
  249. hidden: true,
  250. scope: "solt",
  251. soltName: "predictPayTime",
  252. },
  253. {
  254. label: "剩余天数",
  255. prop: "predictPayDay",
  256. hidden: true,
  257. },
  258. {
  259. label: "提醒设置",
  260. prop: "noteType",
  261. scope: "solt",
  262. soltName: "noteType",
  263. hidden: true,
  264. },
  265. {
  266. label: "最新提醒",
  267. prop: "lastTime",
  268. hidden: true,
  269. },
  270. ],
  271. tableSet1: [
  272. {
  273. label: "下单时间",
  274. prop: "startTime",
  275. hidden: true,
  276. scope: "aTimeList",
  277. },
  278. {
  279. label: "订单单号",
  280. prop: "orderSn",
  281. hidden: true,
  282. },
  283. {
  284. label: "机构名称",
  285. prop: "tenantName",
  286. hidden: true,
  287. },
  288. {
  289. label: "待付账款(元)",
  290. prop: "divideCompanyMoney",
  291. hidden: true,
  292. },
  293. {
  294. label: "预付时间",
  295. prop: "predictPayTime",
  296. hidden: true,
  297. },
  298. {
  299. label: "剩余天数",
  300. prop: "predictReceiveDay",
  301. hidden: true,
  302. },
  303. {
  304. label: "审核状态",
  305. prop: "refundStatus",
  306. hidden: true,
  307. scope: "solt",
  308. soltName: "refundStatus",
  309. },
  310. {
  311. label: "备注",
  312. prop: "remark",
  313. hidden: true,
  314. },
  315. ],
  316. tableSet2: [
  317. {
  318. label: "下单时间",
  319. prop: "buyTime",
  320. hidden: true,
  321. scope: "aTimeList",
  322. },
  323. {
  324. label: "订单单号",
  325. prop: "orderSn",
  326. hidden: true,
  327. },
  328. {
  329. label: "机构名称",
  330. prop: "tenantName",
  331. hidden: true,
  332. },
  333. {
  334. label: "业务员",
  335. prop: "createUsername",
  336. hidden: true,
  337. },
  338. {
  339. label: "业务号",
  340. prop: "createNo",
  341. hidden: true,
  342. },
  343. {
  344. label: "待付账款(元)",
  345. prop: "divideSellerMoney",
  346. hidden: true,
  347. },
  348. {
  349. label: "预付时间",
  350. prop: "predictReceiveTime",
  351. hidden: true,
  352. },
  353. {
  354. label: "剩余天数",
  355. prop: "predictReceiveDay",
  356. hidden: true,
  357. },
  358. {
  359. label: "审核状态",
  360. prop: "refundStatus",
  361. hidden: true,
  362. scope: "solt",
  363. soltName: "refundStatus",
  364. },
  365. {
  366. label: "备注",
  367. prop: "remark",
  368. hidden: true,
  369. },
  370. ],
  371. tableData: [], //表单数据
  372. total: 0, //一共多少条
  373. tipDialogVisible: false,
  374. orderDialogVisible: false,
  375. remarkDialogVisible: false,
  376. type: 0,
  377. activeOrderInfo: {},
  378. roleList: [],
  379. countInfo: {},
  380. };
  381. },
  382. created() {
  383. this.init();
  384. },
  385. methods: {
  386. openDialog(data, type) {
  387. this.activeOrderInfo = data;
  388. this[
  389. ["order", "tip", "examine", "remark"][type] + "DialogVisible"
  390. ] = true;
  391. },
  392. batchExport() {
  393. const fn = [orderExport, orderExport, orderExport][this.type];
  394. fn(this.backData()).then((res) => {
  395. if (res.msg) {
  396. exportFn(res.msg, "导出应收应付数据");
  397. } else {
  398. this.$message.error("导出失败");
  399. }
  400. });
  401. },
  402. backText(row) {
  403. const type = row.noteType;
  404. if (type == 2) {
  405. return ["每天"];
  406. }
  407. const key = ["weekTime", "monthTime"][type - 3];
  408. let data = row[key].split(",").sort((a, b) => a - b);
  409. return data;
  410. },
  411. changeSearch() {
  412. this.search(2);
  413. },
  414. getDataList(data) {
  415. const fn = [orderList, tenantList, sellerList][this.type];
  416. fn(data)
  417. .then((res) => {
  418. this.tableData = res.rows;
  419. this.total = res.total;
  420. this.navText.index = res.total;
  421. })
  422. .finally(() => {
  423. this.loading = false;
  424. });
  425. },
  426. search(v) {
  427. this.loading = true;
  428. if (v === 2) {
  429. this.formData = {
  430. pageSize: 10,
  431. pageNum: 1,
  432. };
  433. }
  434. this.getDataList(this.backData());
  435. },
  436. backData() {
  437. let data = this.formData;
  438. let { startTime, endTime } = this.formData;
  439. if (startTime || endTime) {
  440. data = JSON.parse(JSON.stringify(this.formData));
  441. if (startTime) {
  442. data.startTime = parseInt(startTime / 1000);
  443. }
  444. if (endTime) {
  445. data.endTime = parseInt(endTime / 1000);
  446. }
  447. }
  448. return data;
  449. },
  450. init() {
  451. this.getRoleList();
  452. this.getCountOrderNum();
  453. this.search(2);
  454. },
  455. getRoleList() {
  456. this.$api.obtainRoleList().then((res) => {
  457. this.roleList = res.rows;
  458. });
  459. },
  460. getCountOrderNum() {
  461. countOrderNum().then((res) => {
  462. this.countInfo = res.data;
  463. });
  464. },
  465. },
  466. computed: {
  467. tableSet() {
  468. return this["tableSet" + this.type];
  469. },
  470. formList() {
  471. let data = [
  472. {
  473. prop: "creditStatus",
  474. placeholder: "账款状态",
  475. scope: "select",
  476. options: [
  477. { label: "已结清", value: 1 },
  478. { label: "未结清", value: 0 },
  479. ],
  480. },
  481. {
  482. prop1: "startTime",
  483. prop2: "endTime",
  484. placeholder1: "开始时间",
  485. placeholder2: "结束时间",
  486. scope: "moreDataPicker",
  487. },
  488. ];
  489. if (this.type != 1) {
  490. data.unshift(
  491. {
  492. prop: "roleId",
  493. placeholder: "角色选择",
  494. scope: "select",
  495. options: this.roleList,
  496. selectValue: "roleId",
  497. selectLabel: "roleName",
  498. },
  499. {
  500. prop: "divideStatus",
  501. placeholder: "审核状态",
  502. scope: "select",
  503. options: [
  504. { label: "待审核", value: 0 },
  505. { label: "已通过", value: 1 },
  506. { label: "未通过", value: 2 },
  507. { label: "已撤销", value: 3 },
  508. ],
  509. },
  510. {
  511. prop: "tenantId",
  512. placeholder: "机构选择",
  513. scope: "systemtenantlist",
  514. }
  515. );
  516. } else {
  517. data.push({
  518. prop: "keyNo",
  519. placeholder: "机构/业务号",
  520. });
  521. }
  522. return data;
  523. },
  524. },
  525. };
  526. </script>
  527. <style lang="scss" scoped>
  528. .tip4,
  529. .tip3 {
  530. white-space: normal;
  531. i::before {
  532. content: ",";
  533. }
  534. }
  535. .dis_flex_order_li {
  536. display: flex;
  537. align-items: center;
  538. flex-wrap: wrap;
  539. & > .list {
  540. user-select: none;
  541. cursor: pointer;
  542. transition: all 0.3s;
  543. box-shadow: 0px 0px 4px 1px rgba(0, 0, 0, 0.2);
  544. &:hover {
  545. transform: scale(1.04);
  546. }
  547. width: 136px;
  548. height: 44px;
  549. border-radius: 6px;
  550. display: flex;
  551. align-items: center;
  552. flex-shrink: 0;
  553. margin-right: 10px;
  554. margin-bottom: 10px;
  555. & > img {
  556. margin-left: 2px;
  557. width: 40px;
  558. height: 40px;
  559. }
  560. & > .right {
  561. flex: 1;
  562. padding-left: 4px;
  563. & > h4 {
  564. color: #000;
  565. margin: 0;
  566. font-size: 12px;
  567. }
  568. & > p {
  569. font-size: 12px;
  570. color: red;
  571. margin: 0;
  572. }
  573. }
  574. }
  575. }
  576. </style>