rebate_list.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  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. align="center"
  117. label="返利单号"
  118. prop="rebateOrderId"
  119. min-width="160"
  120. show-overflow-tooltip
  121. ></el-table-column>
  122. <el-table-column
  123. align="center"
  124. label="返利日期"
  125. prop="theTime"
  126. min-width="160"
  127. show-overflow-tooltip
  128. ></el-table-column>
  129. <el-table-column
  130. v-if="isCustomer"
  131. align="center"
  132. label="标题备注"
  133. prop="policyDocNo"
  134. min-width="160"
  135. show-overflow-tooltip
  136. ></el-table-column>
  137. <el-table-column
  138. v-if="!isCustomer"
  139. align="center"
  140. label="经销商编码"
  141. prop="customerNumber"
  142. min-width="160"
  143. show-overflow-tooltip
  144. ></el-table-column>
  145. <el-table-column
  146. v-if="!isCustomer"
  147. align="center"
  148. label="经销商名称"
  149. prop="customerName"
  150. min-width="160"
  151. show-overflow-tooltip
  152. ></el-table-column>
  153. <el-table-column
  154. align="center"
  155. label="返利类型"
  156. prop="walletName"
  157. min-width="160"
  158. show-overflow-tooltip
  159. ></el-table-column>
  160. <el-table-column
  161. align="center"
  162. label="总返利金额"
  163. prop="amount"
  164. min-width="160"
  165. show-overflow-tooltip
  166. >
  167. </el-table-column>
  168. <el-table-column
  169. align="center"
  170. label="返利金额"
  171. prop=""
  172. min-width="160"
  173. show-overflow-tooltip
  174. >
  175. <template slot-scope="scope">
  176. {{ scope.row.withholdAmount != 0 ? 0 : 0 }}
  177. </template>
  178. </el-table-column>
  179. <el-table-column
  180. align="center"
  181. label="暂扣返利"
  182. prop="withholdAmount"
  183. min-width="160"
  184. show-overflow-tooltip
  185. ></el-table-column>
  186. <el-table-column
  187. align="center"
  188. label="折让金额"
  189. prop="allowanceAmount"
  190. min-width="160"
  191. show-overflow-tooltip
  192. ></el-table-column>
  193. <el-table-column
  194. v-if="!isCustomer"
  195. align="center"
  196. label="折让编号"
  197. prop="allowanceCode"
  198. min-width="160"
  199. show-overflow-tooltip
  200. ></el-table-column>
  201. <el-table-column
  202. v-if="!isCustomer"
  203. align="center"
  204. label="折让账号"
  205. prop="allowanceAccount"
  206. min-width="160"
  207. show-overflow-tooltip
  208. ></el-table-column>
  209. <el-table-column
  210. v-if="!isCustomer"
  211. align="center"
  212. label="已办理折让金额"
  213. prop="handledAllowanceAmount"
  214. min-width="160"
  215. show-overflow-tooltip
  216. ></el-table-column>
  217. <el-table-column
  218. v-if="!isCustomer"
  219. align="center"
  220. label="折让对应收款单号"
  221. prop="allowanceOrderNo"
  222. min-width="160"
  223. show-overflow-tooltip
  224. ></el-table-column>
  225. <el-table-column
  226. v-if="!isCustomer"
  227. align="center"
  228. label="政策文件流水号"
  229. prop="policyFileNo"
  230. min-width="160"
  231. show-overflow-tooltip
  232. ></el-table-column>
  233. <el-table-column
  234. v-if="!isCustomer"
  235. align="center"
  236. label="政策文号"
  237. prop="policyDocNo"
  238. min-width="160"
  239. show-overflow-tooltip
  240. ></el-table-column>
  241. <el-table-column
  242. v-if="!isCustomer"
  243. align="center"
  244. label="政策年份"
  245. prop="policyYear"
  246. min-width="160"
  247. show-overflow-tooltip
  248. ></el-table-column>
  249. <el-table-column
  250. v-if="!isCustomer"
  251. align="center"
  252. label="政策月份"
  253. prop="policyMonth"
  254. min-width="160"
  255. show-overflow-tooltip
  256. ></el-table-column>
  257. <el-table-column
  258. v-if="!isCustomer"
  259. align="center"
  260. label="政策归属部门"
  261. prop="policyOrg"
  262. min-width="160"
  263. show-overflow-tooltip
  264. ></el-table-column>
  265. <el-table-column
  266. align="center"
  267. v-if="!isCustomer"
  268. label="客户区域"
  269. prop="customerArea"
  270. min-width="160"
  271. show-overflow-tooltip
  272. ></el-table-column>
  273. <el-table-column
  274. v-if="!isCustomer"
  275. align="center"
  276. label="客户属性"
  277. prop="customerAttr"
  278. min-width="160"
  279. show-overflow-tooltip
  280. ></el-table-column>
  281. <el-table-column
  282. align="center"
  283. v-if="!isCustomer"
  284. label="奖励实际归属客户"
  285. prop="rewardActualCustomers"
  286. min-width="160"
  287. show-overflow-tooltip
  288. ></el-table-column>
  289. <el-table-column
  290. v-if="!isCustomer"
  291. align="center"
  292. label="备注1"
  293. prop="remark1"
  294. min-width="160"
  295. show-overflow-tooltip
  296. ></el-table-column>
  297. <el-table-column
  298. v-if="!isCustomer"
  299. align="center"
  300. label="备注2"
  301. prop="remark2"
  302. min-width="160"
  303. show-overflow-tooltip
  304. ></el-table-column>
  305. <el-table-column
  306. v-if="!isCustomer"
  307. align="center"
  308. label="制单人"
  309. prop="createBy"
  310. min-width="160"
  311. show-overflow-tooltip
  312. ></el-table-column>
  313. <el-table-column
  314. v-if="!isCustomer"
  315. align="center"
  316. label="制单时间"
  317. prop="createTime"
  318. min-width="160"
  319. show-overflow-tooltip
  320. ></el-table-column>
  321. <el-table-column
  322. v-if="!isCustomer"
  323. align="center"
  324. label="审核人"
  325. prop="examineBy"
  326. min-width="160"
  327. show-overflow-tooltip
  328. ></el-table-column>
  329. <el-table-column
  330. v-if="!isCustomer"
  331. align="center"
  332. label="审核时间"
  333. prop="examineTime"
  334. min-width="160"
  335. show-overflow-tooltip
  336. ></el-table-column>
  337. <el-table-column
  338. v-if="!isCustomer"
  339. align="center"
  340. label="确认人"
  341. prop="customerName"
  342. min-width="160"
  343. show-overflow-tooltip
  344. ></el-table-column>
  345. <el-table-column
  346. v-if="!isCustomer"
  347. align="center"
  348. label="确认时间"
  349. prop="customerConfirmTime"
  350. min-width="160"
  351. show-overflow-tooltip
  352. ></el-table-column>
  353. <el-table-column
  354. v-if="!isCustomer"
  355. align="center"
  356. label="复核人"
  357. prop="secondExamineBy"
  358. min-width="160"
  359. show-overflow-tooltip
  360. ></el-table-column>
  361. <el-table-column
  362. v-if="!isCustomer"
  363. align="center"
  364. label="复核时间"
  365. prop="secondExamineTime"
  366. min-width="160"
  367. show-overflow-tooltip
  368. ></el-table-column>
  369. <el-table-column
  370. align="center"
  371. label="操作"
  372. min-width="160"
  373. show-overflow-tooltip
  374. fixed="right"
  375. >
  376. <template slot-scope="scope">
  377. <el-button
  378. type="text"
  379. class="textColor"
  380. v-if="!isCustomer"
  381. @click="editFn(scope.row.rebateOrderId)"
  382. >编辑</el-button
  383. >
  384. <el-button
  385. type="text"
  386. class="textColor"
  387. v-show="scope.row.examineStatus == 'SAVE' && !isCustomer"
  388. @click="applyFn(scope.row.rebateOrderId)"
  389. >申请</el-button
  390. >
  391. <el-button
  392. type="text"
  393. class="textColor"
  394. v-show="scope.row.examineStatus == 'WAIT' && !isCustomer"
  395. @click="examineFn(scope.row.rebateOrderId)"
  396. >审核</el-button
  397. >
  398. <el-button
  399. type="text"
  400. class="textColor"
  401. v-show="scope.row.examineStatus == 'OK_ONE' && !isCustomer"
  402. @click="reviewFn(scope.row.rebateOrderId)"
  403. >复核</el-button
  404. >
  405. <el-button
  406. type="text"
  407. class="textColor"
  408. v-show="
  409. (scope.row.examineStatus == 'WAIT' ||
  410. scope.row.examineStatus == 'SAVE') &&
  411. !isCustomer
  412. "
  413. @click="infoFn(scope.row.rebateOrderId)"
  414. >详情</el-button
  415. >
  416. <el-button
  417. type="text"
  418. class="textColor"
  419. v-show="
  420. (scope.row.examineStatus == 'OK_ONE' ||
  421. scope.row.examineStatus == 'FAIL_ONE' ||
  422. scope.row.examineStatus == 'FAIL' ||
  423. scope.row.examineStatus == 'OK') &&
  424. !isCustomer
  425. "
  426. @click="detail2(scope.row.rebateOrderId)"
  427. >详情</el-button
  428. >
  429. <el-button
  430. type="text"
  431. class="textColor"
  432. v-if="
  433. isCustomer &&
  434. scope.row.examineStatus == 'OK_ONE' &&
  435. scope.row.withholdAmount == 0
  436. "
  437. @click="confirmFn(scope.row.rebateOrderId)"
  438. >确认</el-button
  439. >
  440. </template>
  441. </el-table-column>
  442. </el-table>
  443. </div>
  444. <!-- 分页 -->
  445. <div class="fr">
  446. <el-pagination
  447. @size-change="handleSizeChange"
  448. @current-change="handleCurrentChange"
  449. :current-page="currentPage"
  450. :page-sizes="[10, 20, 30, 50]"
  451. :page-size="10"
  452. layout="total, sizes, prev, pager, next, jumper"
  453. :total="listTotal"
  454. >
  455. </el-pagination>
  456. </div>
  457. </div>
  458. </div>
  459. <RebateListApply :detailId="detailId" v-else-if="showPage == 2" />
  460. <RebateListExamine
  461. @updateList="updateList"
  462. :detailId="detailId"
  463. v-else-if="showPage == 3"
  464. />
  465. <RebateListReview
  466. @updateList="updateList"
  467. :detailId="detailId"
  468. v-else-if="showPage == 4"
  469. />
  470. <!-- 详情 -->
  471. <RebateListDetail :detailId="detailId" v-else-if="showPage == 5" />
  472. <!-- 确定 -->
  473. <RebateListConfirm :detailId="detailId" v-else-if="showPage == 6" />
  474. <!-- 编辑 -->
  475. <RebateListEdit
  476. @updateList="updateList"
  477. :detailId="detailId"
  478. v-else-if="showPage == 7"
  479. />
  480. </div>
  481. </template>
  482. <script>
  483. import {
  484. getRebateOrderList,
  485. getRebateOrderApply,
  486. } from "@/api/finance/rebate_list";
  487. import RebateListApply from "./components/rebate_list-apply.vue";
  488. import RebateListExamine from "./components/rebate_list-examine.vue";
  489. import RebateListReview from "./components/rebate_list-review.vue";
  490. import RebateListDetail from "./components/rebate_list-detail";
  491. import RebateListConfirm from "./components/rebate_list-confirm";
  492. import RebateListEdit from "./components/rebate_list-edit.vue";
  493. export default {
  494. components: {
  495. RebateListDetail,
  496. RebateListApply,
  497. RebateListExamine,
  498. RebateListReview,
  499. RebateListConfirm,
  500. RebateListEdit,
  501. },
  502. data() {
  503. return {
  504. currentPage: 1, // 当前页码
  505. pageSize: 10, // 每页数量
  506. listTotal: 0, // 列表总数
  507. dataList: [], // 列表数据
  508. searchForm: {
  509. customerName: "",
  510. walletName: "",
  511. customerNumber: "",
  512. startTime: "",
  513. endTime: "",
  514. }, //搜索表单
  515. listLoading: false, // 列表加载loading
  516. showPage: 1,
  517. detailId: null,
  518. isCustomer: null,
  519. };
  520. },
  521. created() {
  522. this.getDataList({
  523. pageSize: this.pageSize,
  524. pageNum: this.currentPage,
  525. });
  526. const res = JSON.parse(localStorage.getItem("supply_user"));
  527. this.isCustomer = res.isCustomer;
  528. },
  529. methods: {
  530. //清除
  531. cancelFn() {
  532. this.$refs.searchForm.resetFields();
  533. },
  534. //搜索
  535. searchFn() {
  536. this.getDataList({
  537. ...this.searchForm,
  538. pageSize: this.pageSize,
  539. pageNum: this.currentPage,
  540. });
  541. },
  542. // 更改每页数量
  543. handleSizeChange(val) {
  544. this.pageSize = val;
  545. this.currentPage = 1;
  546. this.getDataList({ pageNum: 1, pageSize: this.pageSize });
  547. },
  548. // 更改当前页
  549. handleCurrentChange(val) {
  550. this.currentPage = val;
  551. this.getDataList({ pageNum: val, pageSize: this.pageSize });
  552. },
  553. //更新列表数据
  554. updateList() {
  555. this.getDataList({
  556. pageSize: this.pageSize,
  557. pageNum: this.currentPage,
  558. });
  559. },
  560. //获取列表数据
  561. async getDataList(data) {
  562. const res = await getRebateOrderList(data);
  563. this.dataList = res.data.records;
  564. this.listTotal = res.data.total;
  565. },
  566. //确认
  567. confirmFn(id) {
  568. this.detailId = id;
  569. this.showPage = 6;
  570. },
  571. //复核
  572. reviewFn(id) {
  573. this.detailId = id;
  574. this.showPage = 4;
  575. },
  576. //审核
  577. examineFn(id) {
  578. this.detailId = id;
  579. this.showPage = 3;
  580. },
  581. //申请
  582. async applyFn(id) {
  583. await getRebateOrderApply({ id });
  584. this.getDataList({
  585. pageSize: this.pageSize,
  586. pageNum: this.currentPage,
  587. });
  588. this.$message.success("申请成功");
  589. },
  590. //详情2
  591. detail2(id) {
  592. this.detailId = id;
  593. this.showPage = 2;
  594. },
  595. //详情
  596. infoFn(id) {
  597. this.detailId = id;
  598. this.showPage = 5;
  599. },
  600. //编辑
  601. editFn(id) {
  602. this.detailId = id;
  603. this.showPage = 7;
  604. },
  605. },
  606. };
  607. </script>
  608. <style lang="scss" scoped>
  609. .selectStyle {
  610. width: 100%;
  611. }
  612. </style>