rebate_list.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. <template>
  2. <div class="app-container">
  3. <div v-if="showPage == 1">
  4. <el-radio-group @change="changeRadioFn" v-model="searchForm.examineStatus" size="">
  5. <el-radio-button label="">全部</el-radio-button>
  6. <el-radio-button label="SAVE">保存</el-radio-button>
  7. <el-radio-button label="WAIT">待审核</el-radio-button>
  8. <el-radio-button label="OK_ONE">初审通过</el-radio-button>
  9. <el-radio-button label="FAIL_ONE">初审不通过</el-radio-button>
  10. <el-radio-button label="OK">复核通过</el-radio-button>
  11. <el-radio-button label="FAIL">复核不通过</el-radio-button>
  12. <el-radio-button label="CLOSE">已关闭</el-radio-button>
  13. </el-radio-group>
  14. <br /><br />
  15. <!-- 筛选条件 -->
  16. <div>
  17. <el-form ref="searchForm" :model="searchForm" label-width="100px" size="small" label-position="left">
  18. <el-row :gutter="20">
  19. <el-col :xs="24" :sm="12" :lg="6">
  20. <el-form-item label="经销商名称" prop="customerName">
  21. <el-input v-model="searchForm.customerName" placeholder="请输入经销商名称"></el-input>
  22. </el-form-item>
  23. </el-col>
  24. <el-col :xs="24" :sm="12" :lg="6">
  25. <el-form-item label="返利类型" prop="walletName">
  26. <el-input v-model="searchForm.walletName" placeholder="请输入"></el-input>
  27. </el-form-item>
  28. </el-col>
  29. <el-col :xs="24" :sm="12" :lg="6">
  30. <el-form-item label="经销商编码" prop="customerNumber">
  31. <el-input v-model="searchForm.customerNumber" placeholder="请输入"></el-input>
  32. </el-form-item>
  33. </el-col>
  34. <el-col :xs="24" :sm="12" :lg="6">
  35. <el-form-item label="开始时间" prop="startTime">
  36. <el-date-picker class="selectStyle" v-model="searchForm.startTime" placeholder="选择日期" type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
  37. </el-date-picker>
  38. </el-form-item>
  39. </el-col>
  40. <el-col :xs="24" :sm="12" :lg="6">
  41. <el-form-item label="结束时间" prop="endTime">
  42. <el-date-picker class="selectStyle" v-model="searchForm.endTime" placeholder="选择日期" type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
  43. </el-date-picker>
  44. </el-form-item>
  45. </el-col>
  46. <el-col :xs="24" :sm="12" :lg="18">
  47. <el-form-item label="" class="fr">
  48. <el-button size="small" @click="cancelFn">清空</el-button>
  49. <el-button size="small" type="primary" @click="searchFn">搜索</el-button>
  50. </el-form-item>
  51. </el-col>
  52. </el-row>
  53. </el-form>
  54. </div>
  55. <!-- 按钮 -->
  56. <div class="btn-group clearfix">
  57. <div class="fr">
  58. <ExportButton :exUrl="'/rebate/order/export'" :exParams="exParams" />
  59. </div>
  60. </div>
  61. <!-- 列表 -->
  62. <div class="mymain-container">
  63. <div class="table">
  64. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe show-summary :summary-method="$getSummaries">
  65. <el-table-column align="center" label="状态" prop="examineStatus" min-width="160" show-overflow-tooltip v-if="!isCustomer">
  66. <template slot-scope="scope">
  67. <el-tag v-show="scope.row.examineStatus == 'SAVE'">保存</el-tag>
  68. <el-tag v-show="scope.row.examineStatus == 'WAIT'">待审核</el-tag>
  69. <el-tag v-show="scope.row.examineStatus == 'OK_ONE'">初审通过</el-tag>
  70. <el-tag v-show="scope.row.examineStatus == 'FAIL_ONE'">初审不通过</el-tag>
  71. <el-tag v-show="scope.row.examineStatus == 'OK'">复核通过</el-tag>
  72. <el-tag v-show="scope.row.examineStatus == 'FAIL'">不通过</el-tag>
  73. <el-tag v-show="scope.row.examineStatus == 'CLOSE'">已关闭</el-tag>
  74. </template>
  75. </el-table-column>
  76. <el-table-column v-if="isCustomer" align="center" label="是否确认" prop="customerIsConfirm" min-width="160" show-overflow-tooltip>
  77. <template slot-scope="scope">
  78. <el-tag v-show="scope.row.customerIsConfirm == true">已确认</el-tag>
  79. <el-tag v-show="scope.row.customerIsConfirm == false">未确认</el-tag>
  80. </template>
  81. </el-table-column>
  82. <el-table-column align="center" label="返利单号" prop="rebateOrderId" min-width="160" show-overflow-tooltip></el-table-column>
  83. <el-table-column align="center" label="返利日期" prop="theTime" min-width="180" show-overflow-tooltip></el-table-column>
  84. <el-table-column v-if="isCustomer" align="center" label="标题备注" prop="policyDocNo" min-width="160" show-overflow-tooltip></el-table-column>
  85. <el-table-column v-if="!isCustomer" align="center" label="经销商编码" prop="customerNumber" min-width="160" show-overflow-tooltip></el-table-column>
  86. <el-table-column v-if="!isCustomer" align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
  87. <el-table-column align="center" label="返利类型" prop="walletName" min-width="160" show-overflow-tooltip></el-table-column>
  88. <el-table-column align="right" label="总返利金额" prop="amount" min-width="160" show-overflow-tooltip>
  89. <template slot-scope="scope">
  90. {{ scope.row.amount | numToFixed }}
  91. </template>
  92. </el-table-column>
  93. <el-table-column align="right" label="返利金额" prop="rebateAmount" min-width="160" show-overflow-tooltip>
  94. <template slot-scope="scope">
  95. {{ scope.row.rebateAmount | numToFixed }}
  96. </template>
  97. </el-table-column>
  98. <el-table-column align="right" label="暂扣返利" prop="withholdAmount" min-width="160" show-overflow-tooltip>
  99. <template slot-scope="scope">
  100. {{ scope.row.withholdAmount | numToFixed }}
  101. </template>
  102. </el-table-column>
  103. <el-table-column align="right" label="折让金额" prop="allowanceAmount" min-width="160" show-overflow-tooltip>
  104. <template slot-scope="scope">
  105. {{ scope.row.allowanceAmount | numToFixed }}
  106. </template>
  107. </el-table-column>
  108. <el-table-column v-if="!isCustomer" align="center" label="折让编号" prop="allowanceCode" min-width="160" show-overflow-tooltip></el-table-column>
  109. <el-table-column v-if="!isCustomer" align="center" label="折让账号" prop="allowanceAccount" min-width="160" show-overflow-tooltip></el-table-column>
  110. <el-table-column v-if="!isCustomer" align="right" label="已办理折让金额" prop="handledAllowanceAmount" min-width="160" show-overflow-tooltip>
  111. <template slot-scope="scope">
  112. {{ scope.row.handledAllowanceAmount | numToFixed }}
  113. </template>
  114. </el-table-column>
  115. <el-table-column v-if="!isCustomer" align="center" label="折让对应收款单号" prop="allowanceOrderNo" min-width="160" show-overflow-tooltip></el-table-column>
  116. <el-table-column v-if="!isCustomer" align="center" label="政策文件流水号" prop="policyFileNo" min-width="160" show-overflow-tooltip></el-table-column>
  117. <el-table-column v-if="!isCustomer" align="center" label="政策文号" prop="policyDocNo" min-width="160" show-overflow-tooltip></el-table-column>
  118. <el-table-column v-if="!isCustomer" align="center" label="政策年份" prop="policyYear" min-width="160" show-overflow-tooltip></el-table-column>
  119. <el-table-column v-if="!isCustomer" align="center" label="政策月份" prop="policyMonth" min-width="160" show-overflow-tooltip></el-table-column>
  120. <el-table-column v-if="!isCustomer" align="center" label="政策归属部门" prop="policyOrg" min-width="160" show-overflow-tooltip></el-table-column>
  121. <el-table-column align="center" v-if="!isCustomer" label="客户区域" prop="customerArea" min-width="160" show-overflow-tooltip></el-table-column>
  122. <el-table-column v-if="!isCustomer" align="center" label="客户属性" prop="customerAttr" min-width="160" show-overflow-tooltip></el-table-column>
  123. <el-table-column align="center" v-if="!isCustomer" label="奖励实际归属客户" prop="rewardActualCustomers" min-width="160" show-overflow-tooltip></el-table-column>
  124. <el-table-column v-if="!isCustomer" align="center" label="备注1" prop="remark1" min-width="160" show-overflow-tooltip></el-table-column>
  125. <el-table-column v-if="!isCustomer" align="center" label="备注2" prop="remark2" min-width="160" show-overflow-tooltip></el-table-column>
  126. <el-table-column v-if="!isCustomer" align="center" label="制单人" prop="createBy" min-width="160" show-overflow-tooltip></el-table-column>
  127. <el-table-column v-if="!isCustomer" align="center" label="制单时间" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  128. <el-table-column v-if="!isCustomer" align="center" label="审核人" prop="examineBy" min-width="160" show-overflow-tooltip></el-table-column>
  129. <el-table-column v-if="!isCustomer" align="center" label="审核时间" prop="examineTime" min-width="160" show-overflow-tooltip></el-table-column>
  130. <el-table-column v-if="!isCustomer" align="center" label="确认人" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
  131. <el-table-column v-if="!isCustomer" align="center" label="确认时间" prop="customerConfirmTime" min-width="160" show-overflow-tooltip></el-table-column>
  132. <el-table-column v-if="!isCustomer" align="center" label="复核人" prop="secondExamineBy" min-width="160" show-overflow-tooltip></el-table-column>
  133. <el-table-column v-if="!isCustomer" align="center" label="复核时间" prop="secondExamineTime" min-width="160" show-overflow-tooltip></el-table-column>
  134. <el-table-column v-if="isCustomer" align="center" label="确认时间" prop="customerConfirmTime" min-width="160" show-overflow-tooltip></el-table-column>
  135. <el-table-column align="center" label="操作" min-width="240" show-overflow-tooltip fixed="right">
  136. <template slot-scope="scope">
  137. <el-button type="text" class="textColor" v-if="
  138. !isCustomer &&
  139. $checkBtnRole('edit', $route.meta.roles) &&
  140. scope.row.examineStatus != 'FAIL_ONE'
  141. " @click="editFn(scope.row.rebateOrderId)">编辑</el-button>
  142. <el-button type="text" class="textColor" v-show="
  143. scope.row.examineStatus == 'SAVE' &&
  144. !isCustomer &&
  145. $checkBtnRole('apply', $route.meta.roles)
  146. " @click="applyFn(scope.row.rebateOrderId)">申请</el-button>
  147. <el-button type="text" class="textColor" v-show="
  148. scope.row.examineStatus == 'WAIT' &&
  149. !isCustomer &&
  150. $checkBtnRole('examine', $route.meta.roles)
  151. " @click="examineFn(scope.row.rebateOrderId)">审核</el-button>
  152. <el-button type="text" class="textColor" v-show="
  153. (scope.row.examineStatus == 'OK_ONE' ||
  154. scope.row.examineStatus == 'OK' ||
  155. scope.row.examineStatus == 'FAIL') &&
  156. !isCustomer &&
  157. $checkBtnRole('examine', $route.meta.roles)
  158. " @click="reviewFn(scope.row.rebateOrderId)">{{
  159. scope.row.examineStatus == "OK" ? "取消复核" : "复核"
  160. }}</el-button>
  161. <el-button type="text" class="textColor" v-show="
  162. (scope.row.examineStatus == 'WAIT' ||
  163. scope.row.examineStatus == 'SAVE') &&
  164. !isCustomer
  165. " @click="infoFn(scope.row.rebateOrderId)">详情</el-button>
  166. <el-button type="text" class="textColor" v-show="
  167. (scope.row.examineStatus == 'OK_ONE' ||
  168. scope.row.examineStatus == 'FAIL_ONE' ||
  169. scope.row.examineStatus == 'FAIL' ||
  170. scope.row.examineStatus == 'OK') &&
  171. !isCustomer
  172. " @click="detail2(scope.row.rebateOrderId)">详情</el-button>
  173. <el-button type="text" class="textColor" v-if="
  174. isCustomer &&
  175. scope.row.withholdAmount == 0 &&
  176. (scope.row.examineStatus == 'OK_ONE' ||
  177. scope.row.examineStatus == 'OK' ||
  178. scope.row.examineStatus == 'FAIL')
  179. " @click="
  180. confirmFn(
  181. scope.row.rebateOrderId,
  182. scope.row.customerIsConfirm
  183. )
  184. ">{{
  185. scope.row.customerIsConfirm == true ? "详情" : "确认"
  186. }}</el-button>
  187. </template>
  188. </el-table-column>
  189. </el-table>
  190. </div>
  191. <!-- 分页 -->
  192. <div class="fr">
  193. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[10, 20, 30, 50]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="listTotal">
  194. </el-pagination>
  195. </div>
  196. </div>
  197. </div>
  198. <RebateListApply :detailId="detailId" v-else-if="showPage == 2" />
  199. <RebateListExamine @updateList="updateList" :detailId="detailId" v-else-if="showPage == 3" />
  200. <RebateListReview @updateList="updateList" :detailId="detailId" v-else-if="showPage == 4" />
  201. <!-- 详情 -->
  202. <RebateListDetail :detailId="detailId" v-else-if="showPage == 5" />
  203. <!-- 确定 -->
  204. <RebateListConfirm @updateList="updateList" :detailId="detailId" :isShow="isShow" v-else-if="showPage == 6" />
  205. <!-- 编辑 -->
  206. <RebateListEdit @updateList="updateList" :detailId="detailId" v-else-if="showPage == 7" />
  207. <!-- <EditDateTimeDialog
  208. :isShow.sync="isShowEditDateDialog"
  209. :dateForm.sync="dateForm"
  210. /> -->
  211. </div>
  212. </template>
  213. <script>
  214. import {
  215. getRebateOrderList,
  216. getRebateOrderApply,
  217. } from "@/api/finance/rebate_list";
  218. import RebateListApply from "./components/rebate_list-apply.vue";
  219. import RebateListExamine from "./components/rebate_list-examine.vue";
  220. import RebateListReview from "./components/rebate_list-review.vue";
  221. import RebateListDetail from "./components/rebate_list-detail";
  222. import RebateListConfirm from "./components/rebate_list-confirm";
  223. import RebateListEdit from "./components/rebate_list-edit.vue";
  224. export default {
  225. name: "rebate_list",
  226. components: {
  227. RebateListDetail,
  228. RebateListApply,
  229. RebateListExamine,
  230. RebateListReview,
  231. RebateListConfirm,
  232. RebateListEdit,
  233. },
  234. data() {
  235. return {
  236. currentPage: 1, // 当前页码
  237. pageSize: 10, // 每页数量
  238. listTotal: 0, // 列表总数
  239. dataList: [], // 列表数据
  240. searchForm: {
  241. customerName: "",
  242. walletName: "",
  243. customerNumber: "",
  244. startTime: "",
  245. endTime: "",
  246. examineStatus: "",
  247. }, //搜索表单
  248. listLoading: false, // 列表加载loading
  249. showPage: 1,
  250. detailId: null,
  251. isCustomer: null,
  252. secondId: null,
  253. isShow: null,
  254. };
  255. },
  256. computed: {
  257. exParams() {
  258. return {
  259. ...this.searchForm,
  260. pageSize: this.pageSize,
  261. pageNum: this.currentPage,
  262. };
  263. },
  264. },
  265. created() {
  266. this.getDataList({
  267. pageSize: this.pageSize,
  268. pageNum: this.currentPage,
  269. });
  270. const res = JSON.parse(localStorage.getItem("supply_user"));
  271. this.isCustomer = res.isCustomer;
  272. if (this.$route.query.id) {
  273. if (this.isCustomer) {
  274. this.confirmFn(this.$route.query.id, false);
  275. } else {
  276. this.examineFn(this.$route.query.id);
  277. }
  278. }
  279. },
  280. methods: {
  281. //切换radio获取数据
  282. changeRadioFn(v) {
  283. // console.log(111);
  284. this.currentPage = 1;
  285. this.getDataList({
  286. ...this.searchForm,
  287. pageSize: this.pageSize,
  288. pageNum: this.currentPage,
  289. });
  290. },
  291. //清除
  292. cancelFn() {
  293. this.$refs.searchForm.resetFields();
  294. },
  295. //搜索
  296. searchFn() {
  297. this.getDataList({
  298. ...this.searchForm,
  299. pageSize: this.pageSize,
  300. pageNum: this.currentPage,
  301. });
  302. },
  303. // 更改每页数量
  304. handleSizeChange(val) {
  305. this.pageSize = val;
  306. this.currentPage = 1;
  307. this.getDataList({
  308. pageNum: 1,
  309. pageSize: this.pageSize,
  310. ...this.searchForm,
  311. });
  312. },
  313. // 更改当前页
  314. handleCurrentChange(val) {
  315. this.currentPage = val;
  316. this.getDataList({
  317. pageNum: val,
  318. pageSize: this.pageSize,
  319. ...this.searchForm,
  320. });
  321. },
  322. //更新列表数据
  323. updateList() {
  324. this.getDataList({
  325. pageSize: this.pageSize,
  326. pageNum: this.currentPage,
  327. ...this.searchForm,
  328. });
  329. },
  330. //获取列表数据
  331. async getDataList(data) {
  332. const res = await getRebateOrderList(data);
  333. this.listTotal = res.data.total;
  334. let arr = res.data.records;
  335. arr.forEach((value) => {
  336. value.sums1 = [];
  337. value.sums2 = [
  338. "amount",
  339. "rebateAmount",
  340. "withholdAmount",
  341. "allowanceAmount",
  342. "handledAllowanceAmount",
  343. ];
  344. });
  345. if (this.isCustomer) {
  346. let arr2 = arr.filter((v) => {
  347. if (
  348. (v.examineStatus == "OK_ONE" ||
  349. v.examineStatus == "OK" ||
  350. v.examineStatus == "FAIL") &&
  351. v.withholdAmount == 0
  352. ) {
  353. return v;
  354. }
  355. });
  356. this.dataList = arr2;
  357. this.listTotal = arr2.length;
  358. } else {
  359. this.dataList = arr;
  360. this.listTotal = res.data.total;
  361. }
  362. },
  363. //确认
  364. confirmFn(id, isShow) {
  365. this.isShow = isShow;
  366. this.detailId = id;
  367. this.showPage = 6;
  368. },
  369. //复核
  370. reviewFn(id) {
  371. this.detailId = id;
  372. this.showPage = 4;
  373. },
  374. //审核
  375. examineFn(id) {
  376. this.detailId = id;
  377. this.showPage = 3;
  378. },
  379. //申请
  380. async applyFn(id) {
  381. await getRebateOrderApply({ id });
  382. this.getDataList({
  383. pageSize: this.pageSize,
  384. pageNum: this.currentPage,
  385. ...this.currentPage,
  386. });
  387. this.$message.success("申请成功");
  388. },
  389. //详情2
  390. detail2(id) {
  391. this.detailId = id;
  392. this.showPage = 2;
  393. },
  394. //详情
  395. infoFn(id) {
  396. this.detailId = id;
  397. this.showPage = 5;
  398. },
  399. //编辑
  400. editFn(id) {
  401. this.detailId = id;
  402. this.showPage = 7;
  403. },
  404. },
  405. };
  406. </script>
  407. <style lang="scss" scoped>
  408. .selectStyle {
  409. width: 100%;
  410. }
  411. </style>