rebate_list.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703
  1. <template>
  2. <div class="app-container">
  3. <div v-if="showPage == 1">
  4. <!-- 筛选条件 -->
  5. <div>
  6. <el-form
  7. ref="searchForm"
  8. :model="searchForm"
  9. label-width="100px"
  10. size="small"
  11. label-position="left"
  12. >
  13. <el-row :gutter="20">
  14. <el-col :xs="24" :sm="12" :lg="6">
  15. <el-form-item label="经销商名称" prop="customerName">
  16. <el-input
  17. v-model="searchForm.customerName"
  18. placeholder="请输入经销商名称"
  19. ></el-input>
  20. </el-form-item>
  21. </el-col>
  22. <el-col :xs="24" :sm="12" :lg="6">
  23. <el-form-item label="返利类型" prop="walletName">
  24. <el-input
  25. v-model="searchForm.walletName"
  26. placeholder="请输入"
  27. ></el-input>
  28. </el-form-item>
  29. </el-col>
  30. <el-col :xs="24" :sm="12" :lg="6">
  31. <el-form-item label="经销商编码" prop="customerNumber">
  32. <el-input
  33. v-model="searchForm.customerNumber"
  34. placeholder="请输入"
  35. ></el-input>
  36. </el-form-item>
  37. </el-col>
  38. <el-col :xs="24" :sm="12" :lg="6">
  39. <el-form-item label="开始时间" prop="startTime">
  40. <el-date-picker
  41. class="selectStyle"
  42. v-model="searchForm.startTime"
  43. placeholder="选择日期"
  44. type="datetime"
  45. value-format="yyyy-MM-dd HH:mm:ss"
  46. >
  47. </el-date-picker>
  48. </el-form-item>
  49. </el-col>
  50. <el-col :xs="24" :sm="12" :lg="6">
  51. <el-form-item label="结束时间" prop="endTime">
  52. <el-date-picker
  53. class="selectStyle"
  54. v-model="searchForm.endTime"
  55. placeholder="选择日期"
  56. type="datetime"
  57. value-format="yyyy-MM-dd HH:mm:ss"
  58. >
  59. </el-date-picker>
  60. </el-form-item>
  61. </el-col>
  62. <el-col :xs="24" :sm="12" :lg="18">
  63. <el-form-item label="" class="fr">
  64. <el-button size="small" @click="cancelFn">清空</el-button>
  65. <el-button size="small" type="primary" @click="searchFn"
  66. >搜索</el-button
  67. >
  68. </el-form-item>
  69. </el-col>
  70. </el-row>
  71. </el-form>
  72. </div>
  73. <!-- 列表 -->
  74. <div class="mymain-container">
  75. <div class="table">
  76. <el-table
  77. v-loading="listLoading"
  78. :data="dataList"
  79. element-loading-text="Loading"
  80. border
  81. fit
  82. highlight-current-row
  83. stripe
  84. >
  85. <el-table-column
  86. align="center"
  87. label="状态"
  88. prop="examineStatus"
  89. min-width="160"
  90. show-overflow-tooltip
  91. v-if="!isCustomer"
  92. >
  93. <template slot-scope="scope">
  94. <el-tag v-show="scope.row.examineStatus == 'SAVE'">保存</el-tag>
  95. <el-tag v-show="scope.row.examineStatus == 'WAIT'"
  96. >待审核</el-tag
  97. >
  98. <el-tag v-show="scope.row.examineStatus == 'OK_ONE'"
  99. >初审通过</el-tag
  100. >
  101. <el-tag v-show="scope.row.examineStatus == 'FAIL_ONE'"
  102. >初审不通过</el-tag
  103. >
  104. <el-tag v-show="scope.row.examineStatus == 'OK'"
  105. >复核通过</el-tag
  106. >
  107. <el-tag v-show="scope.row.examineStatus == 'FAIL'"
  108. >不通过</el-tag
  109. >
  110. <el-tag v-show="scope.row.examineStatus == 'CLOSE'"
  111. >已关闭</el-tag
  112. >
  113. </template>
  114. </el-table-column>
  115. <el-table-column
  116. v-if="isCustomer"
  117. align="center"
  118. label="是否确认"
  119. prop="customerIsConfirm"
  120. min-width="160"
  121. show-overflow-tooltip
  122. >
  123. <template slot-scope="scope">
  124. <el-tag v-show="scope.row.customerIsConfirm == true"
  125. >已确认</el-tag
  126. >
  127. <el-tag v-show="scope.row.customerIsConfirm == false"
  128. >未确认</el-tag
  129. >
  130. </template>
  131. </el-table-column>
  132. <el-table-column
  133. align="center"
  134. label="返利单号"
  135. prop="rebateOrderId"
  136. min-width="160"
  137. show-overflow-tooltip
  138. ></el-table-column>
  139. <el-table-column
  140. align="center"
  141. label="返利日期"
  142. prop="theTime"
  143. min-width="180"
  144. show-overflow-tooltip
  145. ></el-table-column>
  146. <el-table-column
  147. v-if="isCustomer"
  148. align="center"
  149. label="标题备注"
  150. prop="policyDocNo"
  151. min-width="160"
  152. show-overflow-tooltip
  153. ></el-table-column>
  154. <el-table-column
  155. v-if="!isCustomer"
  156. align="center"
  157. label="经销商编码"
  158. prop="customerNumber"
  159. min-width="160"
  160. show-overflow-tooltip
  161. ></el-table-column>
  162. <el-table-column
  163. v-if="!isCustomer"
  164. align="center"
  165. label="经销商名称"
  166. prop="customerName"
  167. min-width="160"
  168. show-overflow-tooltip
  169. ></el-table-column>
  170. <el-table-column
  171. align="center"
  172. label="返利类型"
  173. prop="walletName"
  174. min-width="160"
  175. show-overflow-tooltip
  176. ></el-table-column>
  177. <el-table-column
  178. align="center"
  179. label="总返利金额"
  180. prop="amount"
  181. min-width="160"
  182. show-overflow-tooltip
  183. >
  184. </el-table-column>
  185. <el-table-column
  186. align="center"
  187. label="返利金额"
  188. prop=""
  189. min-width="160"
  190. show-overflow-tooltip
  191. >
  192. <template slot-scope="scope">
  193. {{ scope.row.withholdAmount != 0 ? 0 : scope.row.rebateAmount }}
  194. </template>
  195. </el-table-column>
  196. <el-table-column
  197. align="center"
  198. label="暂扣返利"
  199. prop="withholdAmount"
  200. min-width="160"
  201. show-overflow-tooltip
  202. ></el-table-column>
  203. <el-table-column
  204. align="center"
  205. label="折让金额"
  206. prop="allowanceAmount"
  207. min-width="160"
  208. show-overflow-tooltip
  209. ></el-table-column>
  210. <el-table-column
  211. v-if="!isCustomer"
  212. align="center"
  213. label="折让编号"
  214. prop="allowanceCode"
  215. min-width="160"
  216. show-overflow-tooltip
  217. ></el-table-column>
  218. <el-table-column
  219. v-if="!isCustomer"
  220. align="center"
  221. label="折让账号"
  222. prop="allowanceAccount"
  223. min-width="160"
  224. show-overflow-tooltip
  225. ></el-table-column>
  226. <el-table-column
  227. v-if="!isCustomer"
  228. align="center"
  229. label="已办理折让金额"
  230. prop="handledAllowanceAmount"
  231. min-width="160"
  232. show-overflow-tooltip
  233. ></el-table-column>
  234. <el-table-column
  235. v-if="!isCustomer"
  236. align="center"
  237. label="折让对应收款单号"
  238. prop="allowanceOrderNo"
  239. min-width="160"
  240. show-overflow-tooltip
  241. ></el-table-column>
  242. <el-table-column
  243. v-if="!isCustomer"
  244. align="center"
  245. label="政策文件流水号"
  246. prop="policyFileNo"
  247. min-width="160"
  248. show-overflow-tooltip
  249. ></el-table-column>
  250. <el-table-column
  251. v-if="!isCustomer"
  252. align="center"
  253. label="政策文号"
  254. prop="policyDocNo"
  255. min-width="160"
  256. show-overflow-tooltip
  257. ></el-table-column>
  258. <el-table-column
  259. v-if="!isCustomer"
  260. align="center"
  261. label="政策年份"
  262. prop="policyYear"
  263. min-width="160"
  264. show-overflow-tooltip
  265. ></el-table-column>
  266. <el-table-column
  267. v-if="!isCustomer"
  268. align="center"
  269. label="政策月份"
  270. prop="policyMonth"
  271. min-width="160"
  272. show-overflow-tooltip
  273. ></el-table-column>
  274. <el-table-column
  275. v-if="!isCustomer"
  276. align="center"
  277. label="政策归属部门"
  278. prop="policyOrg"
  279. min-width="160"
  280. show-overflow-tooltip
  281. ></el-table-column>
  282. <el-table-column
  283. align="center"
  284. v-if="!isCustomer"
  285. label="客户区域"
  286. prop="customerArea"
  287. min-width="160"
  288. show-overflow-tooltip
  289. ></el-table-column>
  290. <el-table-column
  291. v-if="!isCustomer"
  292. align="center"
  293. label="客户属性"
  294. prop="customerAttr"
  295. min-width="160"
  296. show-overflow-tooltip
  297. ></el-table-column>
  298. <el-table-column
  299. align="center"
  300. v-if="!isCustomer"
  301. label="奖励实际归属客户"
  302. prop="rewardActualCustomers"
  303. min-width="160"
  304. show-overflow-tooltip
  305. ></el-table-column>
  306. <el-table-column
  307. v-if="!isCustomer"
  308. align="center"
  309. label="备注1"
  310. prop="remark1"
  311. min-width="160"
  312. show-overflow-tooltip
  313. ></el-table-column>
  314. <el-table-column
  315. v-if="!isCustomer"
  316. align="center"
  317. label="备注2"
  318. prop="remark2"
  319. min-width="160"
  320. show-overflow-tooltip
  321. ></el-table-column>
  322. <el-table-column
  323. v-if="!isCustomer"
  324. align="center"
  325. label="制单人"
  326. prop="createBy"
  327. min-width="160"
  328. show-overflow-tooltip
  329. ></el-table-column>
  330. <el-table-column
  331. v-if="!isCustomer"
  332. align="center"
  333. label="制单时间"
  334. prop="createTime"
  335. min-width="160"
  336. show-overflow-tooltip
  337. ></el-table-column>
  338. <el-table-column
  339. v-if="!isCustomer"
  340. align="center"
  341. label="审核人"
  342. prop="examineBy"
  343. min-width="160"
  344. show-overflow-tooltip
  345. ></el-table-column>
  346. <el-table-column
  347. v-if="!isCustomer"
  348. align="center"
  349. label="审核时间"
  350. prop="examineTime"
  351. min-width="160"
  352. show-overflow-tooltip
  353. ></el-table-column>
  354. <el-table-column
  355. v-if="!isCustomer"
  356. align="center"
  357. label="确认人"
  358. prop="customerName"
  359. min-width="160"
  360. show-overflow-tooltip
  361. ></el-table-column>
  362. <el-table-column
  363. v-if="!isCustomer"
  364. align="center"
  365. label="确认时间"
  366. prop="customerConfirmTime"
  367. min-width="160"
  368. show-overflow-tooltip
  369. ></el-table-column>
  370. <el-table-column
  371. v-if="!isCustomer"
  372. align="center"
  373. label="复核人"
  374. prop="secondExamineBy"
  375. min-width="160"
  376. show-overflow-tooltip
  377. ></el-table-column>
  378. <el-table-column
  379. v-if="!isCustomer"
  380. align="center"
  381. label="复核时间"
  382. prop="secondExamineTime"
  383. min-width="160"
  384. show-overflow-tooltip
  385. ></el-table-column>
  386. <el-table-column
  387. v-if="isCustomer"
  388. align="center"
  389. label="确认时间"
  390. prop="customerConfirmTime"
  391. min-width="160"
  392. show-overflow-tooltip
  393. ></el-table-column>
  394. <el-table-column
  395. align="center"
  396. label="操作"
  397. min-width="160"
  398. show-overflow-tooltip
  399. fixed="right"
  400. >
  401. <template slot-scope="scope">
  402. <el-button
  403. type="text"
  404. class="textColor"
  405. v-if="
  406. !isCustomer &&
  407. $checkBtnRole('edit', $route.meta.roles) &&
  408. scope.row.examineStatus != 'FAIL_ONE'
  409. "
  410. @click="editFn(scope.row.rebateOrderId)"
  411. >编辑</el-button
  412. >
  413. <el-button
  414. type="text"
  415. class="textColor"
  416. v-show="
  417. scope.row.examineStatus == 'SAVE' &&
  418. !isCustomer &&
  419. $checkBtnRole('apply', $route.meta.roles)
  420. "
  421. @click="applyFn(scope.row.rebateOrderId)"
  422. >申请</el-button
  423. >
  424. <el-button
  425. type="text"
  426. class="textColor"
  427. v-show="
  428. scope.row.examineStatus == 'WAIT' &&
  429. !isCustomer &&
  430. $checkBtnRole('examine', $route.meta.roles)
  431. "
  432. @click="examineFn(scope.row.rebateOrderId)"
  433. >审核</el-button
  434. >
  435. <el-button
  436. type="text"
  437. class="textColor"
  438. v-show="
  439. (scope.row.examineStatus == 'OK_ONE' ||
  440. scope.row.examineStatus == 'OK' ||
  441. scope.row.examineStatus == 'FAIL') &&
  442. !isCustomer &&
  443. $checkBtnRole('examine', $route.meta.roles)
  444. "
  445. @click="reviewFn(scope.row.rebateOrderId)"
  446. >复核</el-button
  447. >
  448. <el-button
  449. type="text"
  450. class="textColor"
  451. v-show="
  452. (scope.row.examineStatus == 'WAIT' ||
  453. scope.row.examineStatus == 'SAVE') &&
  454. !isCustomer
  455. "
  456. @click="infoFn(scope.row.rebateOrderId)"
  457. >详情</el-button
  458. >
  459. <el-button
  460. type="text"
  461. class="textColor"
  462. v-show="
  463. (scope.row.examineStatus == 'OK_ONE' ||
  464. scope.row.examineStatus == 'FAIL_ONE' ||
  465. scope.row.examineStatus == 'FAIL' ||
  466. scope.row.examineStatus == 'OK') &&
  467. !isCustomer
  468. "
  469. @click="detail2(scope.row.rebateOrderId)"
  470. >详情</el-button
  471. >
  472. <el-button
  473. type="text"
  474. class="textColor"
  475. v-if="
  476. isCustomer &&
  477. scope.row.withholdAmount == 0 &&
  478. (scope.row.examineStatus == 'OK_ONE' ||
  479. scope.row.examineStatus == 'OK' ||
  480. scope.row.examineStatus == 'FAIL')
  481. "
  482. @click="
  483. confirmFn(
  484. scope.row.rebateOrderId,
  485. scope.row.customerIsConfirm
  486. )
  487. "
  488. >{{
  489. scope.row.customerIsConfirm == true ? "详情" : "确认"
  490. }}</el-button
  491. >
  492. </template>
  493. </el-table-column>
  494. </el-table>
  495. </div>
  496. <!-- 分页 -->
  497. <div class="fr">
  498. <el-pagination
  499. @size-change="handleSizeChange"
  500. @current-change="handleCurrentChange"
  501. :current-page="currentPage"
  502. :page-sizes="[10, 20, 30, 50]"
  503. :page-size="10"
  504. layout="total, sizes, prev, pager, next, jumper"
  505. :total="listTotal"
  506. >
  507. </el-pagination>
  508. </div>
  509. </div>
  510. </div>
  511. <RebateListApply :detailId="detailId" v-else-if="showPage == 2" />
  512. <RebateListExamine
  513. @updateList="updateList"
  514. :detailId="detailId"
  515. v-else-if="showPage == 3"
  516. />
  517. <RebateListReview
  518. @updateList="updateList"
  519. :detailId="detailId"
  520. v-else-if="showPage == 4"
  521. />
  522. <!-- 详情 -->
  523. <RebateListDetail :detailId="detailId" v-else-if="showPage == 5" />
  524. <!-- 确定 -->
  525. <RebateListConfirm
  526. @updateList="updateList"
  527. :detailId="detailId"
  528. :isShow="isShow"
  529. v-else-if="showPage == 6"
  530. />
  531. <!-- 编辑 -->
  532. <RebateListEdit
  533. @updateList="updateList"
  534. :detailId="detailId"
  535. v-else-if="showPage == 7"
  536. />
  537. <!-- <EditDateTimeDialog
  538. :isShow.sync="isShowEditDateDialog"
  539. :dateForm.sync="dateForm"
  540. /> -->
  541. </div>
  542. </template>
  543. <script>
  544. import {
  545. getRebateOrderList,
  546. getRebateOrderApply,
  547. } from "@/api/finance/rebate_list";
  548. import RebateListApply from "./components/rebate_list-apply.vue";
  549. import RebateListExamine from "./components/rebate_list-examine.vue";
  550. import RebateListReview from "./components/rebate_list-review.vue";
  551. import RebateListDetail from "./components/rebate_list-detail";
  552. import RebateListConfirm from "./components/rebate_list-confirm";
  553. import RebateListEdit from "./components/rebate_list-edit.vue";
  554. export default {
  555. components: {
  556. RebateListDetail,
  557. RebateListApply,
  558. RebateListExamine,
  559. RebateListReview,
  560. RebateListConfirm,
  561. RebateListEdit,
  562. },
  563. data() {
  564. return {
  565. currentPage: 1, // 当前页码
  566. pageSize: 10, // 每页数量
  567. listTotal: 0, // 列表总数
  568. dataList: [], // 列表数据
  569. searchForm: {
  570. customerName: "",
  571. walletName: "",
  572. customerNumber: "",
  573. startTime: "",
  574. endTime: "",
  575. }, //搜索表单
  576. listLoading: false, // 列表加载loading
  577. showPage: 1,
  578. detailId: null,
  579. isCustomer: null,
  580. secondId: null,
  581. isShow: null,
  582. };
  583. },
  584. created() {
  585. this.getDataList({
  586. pageSize: this.pageSize,
  587. pageNum: this.currentPage,
  588. });
  589. const res = JSON.parse(localStorage.getItem("supply_user"));
  590. this.isCustomer = res.isCustomer;
  591. if (this.$route.query.id) {
  592. this.examineFn(this.$route.query.id);
  593. }
  594. },
  595. methods: {
  596. //清除
  597. cancelFn() {
  598. this.$refs.searchForm.resetFields();
  599. },
  600. //搜索
  601. searchFn() {
  602. this.getDataList({
  603. ...this.searchForm,
  604. pageSize: this.pageSize,
  605. pageNum: this.currentPage,
  606. });
  607. },
  608. // 更改每页数量
  609. handleSizeChange(val) {
  610. this.pageSize = val;
  611. this.currentPage = 1;
  612. this.getDataList({ pageNum: 1, pageSize: this.pageSize });
  613. },
  614. // 更改当前页
  615. handleCurrentChange(val) {
  616. this.currentPage = val;
  617. this.getDataList({ pageNum: val, pageSize: this.pageSize });
  618. },
  619. //更新列表数据
  620. updateList() {
  621. this.getDataList({
  622. pageSize: this.pageSize,
  623. pageNum: this.currentPage,
  624. });
  625. },
  626. //获取列表数据
  627. async getDataList(data) {
  628. const res = await getRebateOrderList(data);
  629. this.listTotal = res.data.total;
  630. let arr = res.data.records;
  631. if (this.isCustomer) {
  632. let arr2 = arr.filter((v) => {
  633. if (
  634. (v.examineStatus == "OK_ONE" ||
  635. v.examineStatus == "OK" ||
  636. v.examineStatus == "FAIL") &&
  637. v.withholdAmount == 0
  638. ) {
  639. return v;
  640. }
  641. });
  642. this.dataList = arr2;
  643. this.listTotal = arr2.length;
  644. } else {
  645. this.dataList = arr;
  646. this.listTotal = res.data.total;
  647. }
  648. },
  649. //确认
  650. confirmFn(id, isShow) {
  651. this.isShow = isShow;
  652. this.detailId = id;
  653. this.showPage = 6;
  654. },
  655. //复核
  656. reviewFn(id) {
  657. this.detailId = id;
  658. this.showPage = 4;
  659. },
  660. //审核
  661. examineFn(id) {
  662. this.detailId = id;
  663. this.showPage = 3;
  664. },
  665. //申请
  666. async applyFn(id) {
  667. await getRebateOrderApply({ id });
  668. this.getDataList({
  669. pageSize: this.pageSize,
  670. pageNum: this.currentPage,
  671. });
  672. this.$message.success("申请成功");
  673. },
  674. //详情2
  675. detail2(id) {
  676. this.detailId = id;
  677. this.showPage = 2;
  678. },
  679. //详情
  680. infoFn(id) {
  681. this.detailId = id;
  682. this.showPage = 5;
  683. },
  684. //编辑
  685. editFn(id) {
  686. this.detailId = id;
  687. this.showPage = 7;
  688. },
  689. },
  690. };
  691. </script>
  692. <style lang="scss" scoped>
  693. .selectStyle {
  694. width: 100%;
  695. }
  696. </style>