rebate_list.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. <template>
  2. <div class="app-container">
  3. <div v-if="showPage == 1">
  4. <el-radio-group @change="changeRadioFn" v-model="searchForm.examineStatus" size="mini">
  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="mini" 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="mini" @click="cancelFn">清空</el-button>
  49. <el-button size="mini" 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="fl">
  58. <el-popconfirm v-if="$checkBtnRole('del', $route.meta.roles)" class="delClass" @onConfirm="deleFn" title="这是一段内容确定删除吗?">
  59. <el-button :disabled="deleList.length < 1" slot="reference" type="danger" icon="el-icon-minus" size="mini">批量删除</el-button>
  60. </el-popconfirm>
  61. </div>
  62. <div class="fr">
  63. <ExportButton :exUrl="'/rebate/order/export'" :exParams="exParams" />
  64. </div>
  65. </div>
  66. <!-- 列表 -->
  67. <div class="mymain-container">
  68. <div class="table">
  69. <el-table @selection-change="selectionChangeFn" v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe show-summary :summary-method="$getSummaries">
  70. <el-table-column v-if="$checkBtnRole('del', $route.meta.roles)" :selectable='selectableFn' align="center" type="selection" width="51" show-overflow-tooltip></el-table-column>
  71. <el-table-column align="left" label="状态" prop="examineStatus" min-width="160" show-overflow-tooltip v-if="!isCustomer">
  72. <template slot-scope="scope">
  73. <el-tag size="mini" v-show="scope.row.examineStatus == 'SAVE'">保存</el-tag>
  74. <el-tag size="mini" v-show="scope.row.examineStatus == 'WAIT'" type="warning">待审核</el-tag>
  75. <el-tag size="mini" v-show="scope.row.examineStatus == 'OK_ONE'" type="success">初审通过</el-tag>
  76. <el-tag size="mini" v-show="scope.row.examineStatus == 'FAIL_ONE'" type="danger">初审不通过</el-tag>
  77. <el-tag size="mini" v-show="scope.row.examineStatus == 'OK'" type="success">复核通过</el-tag>
  78. <el-tag size="mini" v-show="scope.row.examineStatus == 'FAIL'" type="danger">不通过</el-tag>
  79. <el-tag size="mini" v-show="scope.row.examineStatus == 'CLOSE'" type="info">已关闭</el-tag>
  80. </template>
  81. </el-table-column>
  82. <el-table-column v-if="isCustomer" align="left" label="是否确认" prop="customerIsConfirm" min-width="160" show-overflow-tooltip>
  83. <template slot-scope="scope">
  84. <el-tag v-show="scope.row.customerIsConfirm == true">已确认</el-tag>
  85. <el-tag v-show="scope.row.customerIsConfirm == false">未确认</el-tag>
  86. </template>
  87. </el-table-column>
  88. <el-table-column align="left" label="返利单号" prop="rebateOrderId" min-width="200" show-overflow-tooltip>
  89. <template slot-scope="scope">
  90. <CopyButton :copyText="scope.row.rebateOrderId" />
  91. <span>{{scope.row.rebateOrderId}}</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column align="left" label="返利日期" prop="theTime" min-width="180" show-overflow-tooltip></el-table-column>
  95. <el-table-column v-if="isCustomer" align="left" label="标题备注" prop="policyDocNo" min-width="160" show-overflow-tooltip></el-table-column>
  96. <el-table-column v-if="!isCustomer" align="left" label="经销商编码" prop="customerNumber" min-width="160" show-overflow-tooltip>
  97. <template slot-scope="scope">
  98. <CopyButton :copyText="scope.row.customerNumber" />
  99. <span>{{scope.row.customerNumber}}</span>
  100. </template>
  101. </el-table-column>
  102. <el-table-column v-if="!isCustomer" align="left" label="经销商名称" prop="customerName" min-width="260" show-overflow-tooltip>
  103. <template slot-scope="scope">
  104. <CopyButton :copyText="scope.row.customerName" />
  105. <span>{{scope.row.customerName}}</span>
  106. </template>
  107. </el-table-column>
  108. <el-table-column align="left" label="返利类型" prop="walletName" min-width="160" show-overflow-tooltip></el-table-column>
  109. <el-table-column align="right" label="总返利金额" prop="amount" min-width="160" show-overflow-tooltip>
  110. <template slot-scope="scope">
  111. {{ scope.row.amount | numToFixed }}
  112. </template>
  113. </el-table-column>
  114. <el-table-column align="right" label="返利金额" prop="rebateAmount" min-width="160" show-overflow-tooltip>
  115. <template slot-scope="scope">
  116. {{ scope.row.rebateAmount | numToFixed }}
  117. </template>
  118. </el-table-column>
  119. <el-table-column align="right" label="暂扣返利" prop="withholdAmount" min-width="160" show-overflow-tooltip>
  120. <template slot-scope="scope">
  121. {{ scope.row.withholdAmount | numToFixed }}
  122. </template>
  123. </el-table-column>
  124. <el-table-column align="right" label="折让金额" prop="allowanceAmount" min-width="160" show-overflow-tooltip>
  125. <template slot-scope="scope">
  126. {{ scope.row.allowanceAmount | numToFixed }}
  127. </template>
  128. </el-table-column>
  129. <el-table-column v-if="!isCustomer" align="left" label="折让编号" prop="allowanceCode" min-width="160" show-overflow-tooltip></el-table-column>
  130. <el-table-column v-if="!isCustomer" align="left" label="折让账号" prop="allowanceAccount" min-width="160" show-overflow-tooltip></el-table-column>
  131. <el-table-column v-if="!isCustomer" align="right" label="已办理折让金额" prop="handledAllowanceAmount" min-width="160" show-overflow-tooltip>
  132. <template slot-scope="scope">
  133. {{ scope.row.handledAllowanceAmount | numToFixed }}
  134. </template>
  135. </el-table-column>
  136. <el-table-column v-if="!isCustomer" align="left" label="折让对应收款单号" prop="allowanceOrderNo" min-width="160" show-overflow-tooltip></el-table-column>
  137. <el-table-column v-if="!isCustomer" align="left" label="政策文件流水号" prop="policyFileNo" min-width="160" show-overflow-tooltip></el-table-column>
  138. <el-table-column v-if="!isCustomer" align="left" label="政策文号" prop="policyDocNo" min-width="160" show-overflow-tooltip></el-table-column>
  139. <el-table-column v-if="!isCustomer" align="left" label="政策年份" prop="policyYear" min-width="160" show-overflow-tooltip></el-table-column>
  140. <el-table-column v-if="!isCustomer" align="left" label="政策月份" prop="policyMonth" min-width="160" show-overflow-tooltip></el-table-column>
  141. <el-table-column v-if="!isCustomer" align="left" label="政策归属部门" prop="policyOrg" min-width="160" show-overflow-tooltip></el-table-column>
  142. <el-table-column align="left" v-if="!isCustomer" label="客户区域" prop="customerArea" min-width="160" show-overflow-tooltip></el-table-column>
  143. <el-table-column v-if="!isCustomer" align="left" label="客户属性" prop="customerAttr" min-width="160" show-overflow-tooltip></el-table-column>
  144. <el-table-column align="left" v-if="!isCustomer" label="奖励实际归属客户" prop="rewardActualCustomers" min-width="160" show-overflow-tooltip></el-table-column>
  145. <el-table-column v-if="!isCustomer" align="left" label="备注1" prop="remark1" min-width="160" show-overflow-tooltip></el-table-column>
  146. <el-table-column v-if="!isCustomer" align="left" label="备注2" prop="remark2" min-width="160" show-overflow-tooltip></el-table-column>
  147. <el-table-column v-if="!isCustomer" align="left" label="制单人" prop="createBy" min-width="160" show-overflow-tooltip></el-table-column>
  148. <el-table-column v-if="!isCustomer" align="left" label="制单时间" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  149. <el-table-column v-if="!isCustomer" align="left" label="审核人" prop="examineBy" min-width="160" show-overflow-tooltip></el-table-column>
  150. <el-table-column v-if="!isCustomer" align="left" label="审核时间" prop="examineTime" min-width="160" show-overflow-tooltip></el-table-column>
  151. <el-table-column v-if="!isCustomer" align="left" label="确认人" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
  152. <el-table-column v-if="!isCustomer" align="left" label="确认时间" prop="customerConfirmTime" min-width="160" show-overflow-tooltip></el-table-column>
  153. <el-table-column v-if="!isCustomer" align="left" label="复核人" prop="secondExamineBy" min-width="160" show-overflow-tooltip></el-table-column>
  154. <el-table-column v-if="!isCustomer" align="left" label="复核时间" prop="secondExamineTime" min-width="160" show-overflow-tooltip></el-table-column>
  155. <el-table-column v-if="isCustomer" align="left" label="确认时间" prop="customerConfirmTime" min-width="160" show-overflow-tooltip></el-table-column>
  156. <el-table-column align="center" label="操作" min-width="240" show-overflow-tooltip fixed="right">
  157. <template slot-scope="scope">
  158. <el-button type="text" class="textColor" v-if="
  159. !isCustomer &&
  160. $checkBtnRole('edit', $route.meta.roles) &&
  161. scope.row.examineStatus != 'FAIL_ONE'
  162. " @click="editFn(scope.row.rebateOrderId)">编辑</el-button>
  163. <el-button type="text" class="textColor" v-show="
  164. scope.row.examineStatus == 'SAVE' &&
  165. !isCustomer &&
  166. $checkBtnRole('apply', $route.meta.roles)
  167. " @click="applyFn(scope.row.rebateOrderId)">申请</el-button>
  168. <el-button type="text" class="textColor" v-show="
  169. scope.row.examineStatus == 'WAIT' &&
  170. !isCustomer &&
  171. $checkBtnRole('examine', $route.meta.roles)
  172. " @click="examineFn(scope.row.rebateOrderId)">审核</el-button>
  173. <el-button type="text" class="textColor" v-show="
  174. (scope.row.examineStatus == 'OK_ONE' ||
  175. scope.row.examineStatus == 'OK' ||
  176. scope.row.examineStatus == 'FAIL') &&
  177. !isCustomer &&
  178. $checkBtnRole('examine', $route.meta.roles)
  179. " @click="reviewFn(scope.row.rebateOrderId)">{{
  180. scope.row.examineStatus == "OK" ? "取消复核" : "复核"
  181. }}</el-button>
  182. <el-button type="text" class="textColor" v-show="
  183. (scope.row.examineStatus == 'WAIT' ||
  184. scope.row.examineStatus == 'SAVE') &&
  185. !isCustomer
  186. " @click="infoFn(scope.row.rebateOrderId)">详情</el-button>
  187. <el-button type="text" class="textColor" v-show="
  188. (scope.row.examineStatus == 'OK_ONE' ||
  189. scope.row.examineStatus == 'FAIL_ONE' ||
  190. scope.row.examineStatus == 'FAIL' ||
  191. scope.row.examineStatus == 'OK') &&
  192. !isCustomer
  193. " @click="detail2(scope.row.rebateOrderId)">详情</el-button>
  194. <el-button type="text" class="textColor" v-if="
  195. isCustomer &&
  196. scope.row.withholdAmount == 0 &&
  197. (scope.row.examineStatus == 'OK_ONE' ||
  198. scope.row.examineStatus == 'OK' ||
  199. scope.row.examineStatus == 'FAIL')
  200. " @click="
  201. confirmFn(
  202. scope.row.rebateOrderId,
  203. scope.row.customerIsConfirm
  204. )
  205. ">{{
  206. scope.row.customerIsConfirm == true ? "详情" : "确认"
  207. }}</el-button>
  208. </template>
  209. </el-table-column>
  210. </el-table>
  211. </div>
  212. <!-- 分页 -->
  213. <div class="fr">
  214. <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">
  215. </el-pagination>
  216. </div>
  217. </div>
  218. </div>
  219. <RebateListApply :detailId="detailId" v-else-if="showPage == 2" />
  220. <RebateListExamine @updateList="updateList" :detailId="detailId" v-else-if="showPage == 3" />
  221. <RebateListReview @updateList="updateList" :detailId="detailId" v-else-if="showPage == 4" />
  222. <!-- 详情 -->
  223. <RebateListDetail :detailId="detailId" v-else-if="showPage == 5" />
  224. <!-- 确定 -->
  225. <RebateListConfirm @updateList="updateList" :detailId="detailId" :isShow="isShow" v-else-if="showPage == 6" />
  226. <!-- 编辑 -->
  227. <RebateListEdit @updateList="updateList" :detailId="detailId" v-else-if="showPage == 7" />
  228. <!-- <EditDateTimeDialog
  229. :isShow.sync="isShowEditDateDialog"
  230. :dateForm.sync="dateForm"
  231. /> -->
  232. </div>
  233. </template>
  234. <script>
  235. import {
  236. getRebateOrderList,
  237. getRebateOrderApply,
  238. getRebateOrderBatchDel,
  239. } from "@/api/finance/rebate_list";
  240. import RebateListApply from "./components/rebate_list-apply.vue";
  241. import RebateListExamine from "./components/rebate_list-examine.vue";
  242. import RebateListReview from "./components/rebate_list-review.vue";
  243. import RebateListDetail from "./components/rebate_list-detail";
  244. import RebateListConfirm from "./components/rebate_list-confirm";
  245. import RebateListEdit from "./components/rebate_list-edit.vue";
  246. export default {
  247. name: "rebate_list",
  248. components: {
  249. RebateListDetail,
  250. RebateListApply,
  251. RebateListExamine,
  252. RebateListReview,
  253. RebateListConfirm,
  254. RebateListEdit,
  255. },
  256. data() {
  257. return {
  258. deleList: [],
  259. currentPage: 1, // 当前页码
  260. pageSize: 10, // 每页数量
  261. listTotal: 0, // 列表总数
  262. dataList: [], // 列表数据
  263. searchForm: {
  264. customerName: "",
  265. walletName: "",
  266. customerNumber: "",
  267. startTime: "",
  268. endTime: "",
  269. examineStatus: "",
  270. }, //搜索表单
  271. listLoading: false, // 列表加载loading
  272. showPage: 1,
  273. detailId: null,
  274. isCustomer: null,
  275. secondId: null,
  276. isShow: null,
  277. };
  278. },
  279. computed: {
  280. exParams() {
  281. return {
  282. ...this.searchForm,
  283. pageSize: this.pageSize,
  284. pageNum: this.currentPage,
  285. };
  286. },
  287. },
  288. created() {
  289. this.getDataList({
  290. pageSize: this.pageSize,
  291. pageNum: this.currentPage,
  292. });
  293. const res = JSON.parse(localStorage.getItem("supply_user"));
  294. this.isCustomer = res.isCustomer;
  295. if (this.$route.query.id) {
  296. if (this.isCustomer) {
  297. this.confirmFn(this.$route.query.id, false);
  298. } else {
  299. this.examineFn(this.$route.query.id);
  300. }
  301. }
  302. },
  303. methods: {
  304. // 批量删除
  305. selectionChangeFn(value) {
  306. // console.log(value);
  307. const res = value.map((v) => v.rebateOrderId);
  308. // console.log(res);
  309. this.deleList = res;
  310. },
  311. //删除
  312. async deleFn() {
  313. let res = this.deleList.toString();
  314. // console.log(res);
  315. await getRebateOrderBatchDel({ ids: res });
  316. this.getDataList({
  317. ...this.searchForm,
  318. pageSize: this.pageSize,
  319. pageNum: this.currentPage,
  320. });
  321. this.$message.success("删除成功");
  322. this.deleList = [];
  323. },
  324. selectableFn(row, index) {
  325. // console.log(row, index, 444);
  326. if (row.examineStatus !== "SAVE") {
  327. return false;
  328. } else {
  329. return true;
  330. }
  331. },
  332. //切换radio获取数据
  333. changeRadioFn(v) {
  334. // console.log(111);
  335. this.currentPage = 1;
  336. this.getDataList({
  337. ...this.searchForm,
  338. pageSize: this.pageSize,
  339. pageNum: this.currentPage,
  340. });
  341. },
  342. //清除
  343. cancelFn() {
  344. this.$refs.searchForm.resetFields();
  345. },
  346. //搜索
  347. searchFn() {
  348. this.getDataList({
  349. ...this.searchForm,
  350. pageSize: this.pageSize,
  351. pageNum: this.currentPage,
  352. });
  353. },
  354. // 更改每页数量
  355. handleSizeChange(val) {
  356. this.pageSize = val;
  357. this.currentPage = 1;
  358. this.getDataList({
  359. pageNum: 1,
  360. pageSize: this.pageSize,
  361. ...this.searchForm,
  362. });
  363. },
  364. // 更改当前页
  365. handleCurrentChange(val) {
  366. this.currentPage = val;
  367. this.getDataList({
  368. pageNum: val,
  369. pageSize: this.pageSize,
  370. ...this.searchForm,
  371. });
  372. },
  373. //更新列表数据
  374. updateList() {
  375. this.getDataList({
  376. pageSize: this.pageSize,
  377. pageNum: this.currentPage,
  378. ...this.searchForm,
  379. });
  380. },
  381. //获取列表数据
  382. async getDataList(data) {
  383. const res = await getRebateOrderList(data);
  384. this.listTotal = res.data.total;
  385. let arr = res.data.records;
  386. arr.forEach((value) => {
  387. value.sums1 = [];
  388. value.sums2 = [
  389. "amount",
  390. "rebateAmount",
  391. "withholdAmount",
  392. "allowanceAmount",
  393. "handledAllowanceAmount",
  394. ];
  395. });
  396. if (this.isCustomer) {
  397. let arr2 = arr.filter((v) => {
  398. if (
  399. (v.examineStatus == "OK_ONE" ||
  400. v.examineStatus == "OK" ||
  401. v.examineStatus == "FAIL") &&
  402. v.withholdAmount == 0
  403. ) {
  404. return v;
  405. }
  406. });
  407. this.dataList = arr2;
  408. this.listTotal = arr2.length;
  409. } else {
  410. this.dataList = arr;
  411. this.listTotal = res.data.total;
  412. }
  413. },
  414. //确认
  415. confirmFn(id, isShow) {
  416. this.isShow = isShow;
  417. this.detailId = id;
  418. this.showPage = 6;
  419. },
  420. //复核
  421. reviewFn(id) {
  422. this.detailId = id;
  423. this.showPage = 4;
  424. },
  425. //审核
  426. examineFn(id) {
  427. this.detailId = id;
  428. this.showPage = 3;
  429. },
  430. //申请
  431. async applyFn(id) {
  432. await getRebateOrderApply({ id });
  433. this.getDataList({
  434. pageSize: this.pageSize,
  435. pageNum: this.currentPage,
  436. ...this.currentPage,
  437. });
  438. this.$message.success("申请成功");
  439. },
  440. //详情2
  441. detail2(id) {
  442. this.detailId = id;
  443. this.showPage = 2;
  444. },
  445. //详情
  446. infoFn(id) {
  447. this.detailId = id;
  448. this.showPage = 5;
  449. },
  450. //编辑
  451. editFn(id) {
  452. this.detailId = id;
  453. this.showPage = 7;
  454. },
  455. },
  456. };
  457. </script>
  458. <style lang="scss" scoped>
  459. .selectStyle {
  460. width: 100%;
  461. }
  462. </style>