rebate_list.vue 22 KB

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