rebate_list.vue 18 KB

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