change_list.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. <template>
  2. <div class="app-container">
  3. <div v-if="showPage == 1">
  4. <el-radio-group @change="changeRadioGroupFn" v-model="category" size="">
  5. <el-radio-button label="">全部</el-radio-button>
  6. <el-radio-button label="WAIT">待审核</el-radio-button>
  7. <el-radio-button label="OK_ONE">审核通过</el-radio-button>
  8. <el-radio-button label="FAIL_ONE">审核驳回</el-radio-button>
  9. <!-- <el-radio-button label="复核通过"></el-radio-button>
  10. <el-radio-button label="待复核"></el-radio-button>
  11. <el-radio-button label="复核驳回"></el-radio-button> -->
  12. </el-radio-group>
  13. <br /><br />
  14. <!-- 筛选条件 -->
  15. <div>
  16. <el-form
  17. ref="searchForm"
  18. :model="searchForm"
  19. label-width="100px"
  20. size="small"
  21. label-position="left"
  22. >
  23. <el-row :gutter="20">
  24. <el-col :xs="24" :sm="12" :lg="6">
  25. <el-form-item label="返利互转单号" prop="id">
  26. <el-input
  27. v-model="searchForm.id"
  28. placeholder="请输入"
  29. ></el-input>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :xs="24" :sm="12" :lg="6">
  33. <el-form-item label="返利类型" prop="walletName">
  34. <el-input
  35. v-model="searchForm.walletName"
  36. placeholder="请输入"
  37. ></el-input>
  38. </el-form-item>
  39. </el-col>
  40. <el-col :xs="24" :sm="12" :lg="6">
  41. <el-form-item label="申请日期" prop="startTime">
  42. <el-date-picker
  43. class="dateStyle"
  44. v-model="searchForm.startTime"
  45. placeholder="选择日期"
  46. type="datetime"
  47. value-format="yyyy-MM-dd HH:mm:ss"
  48. >
  49. </el-date-picker>
  50. </el-form-item>
  51. </el-col>
  52. <el-col :xs="24" :sm="12" :lg="6">
  53. <el-form-item label="" class="fr">
  54. <el-button size="small" @click="clearFn">清空</el-button>
  55. <el-button size="small" type="primary" @click="searchFn"
  56. >搜索</el-button
  57. >
  58. </el-form-item>
  59. </el-col>
  60. </el-row>
  61. </el-form>
  62. </div>
  63. <br />
  64. <strong>返利互转单列表</strong>
  65. <el-divider></el-divider>
  66. <!-- 列表 -->
  67. <div class="mymain-container">
  68. <div class="table">
  69. <el-table
  70. v-loading="listLoading"
  71. :data="dataList"
  72. element-loading-text="Loading"
  73. border
  74. fit
  75. highlight-current-row
  76. stripe
  77. >
  78. <el-table-column
  79. label="序号"
  80. align="center"
  81. width="100"
  82. type="index"
  83. show-overflow-tooltip
  84. ></el-table-column>
  85. <el-table-column
  86. align="center"
  87. label="返利转账单号"
  88. prop="id"
  89. min-width="160"
  90. show-overflow-tooltip
  91. ></el-table-column>
  92. <el-table-column
  93. align="center"
  94. label="申请日期"
  95. prop="applyTime"
  96. min-width="160"
  97. show-overflow-tooltip
  98. >
  99. <!-- <template slot-scope="scope">
  100. <div>
  101. <span>{{ scope.row.applyTime }}</span>
  102. <el-button
  103. type="text"
  104. icon="el-icon-edit"
  105. style="padding: 0; margin-left: 6px"
  106. @click="editDate(scope.row)"
  107. ></el-button>
  108. </div>
  109. </template> -->
  110. </el-table-column>
  111. <el-table-column
  112. align="center"
  113. label="发起方经销商编号"
  114. prop="customerNumber"
  115. min-width="160"
  116. show-overflow-tooltip
  117. ></el-table-column>
  118. <el-table-column
  119. align="center"
  120. label="发起方经销商名称"
  121. prop="customerName"
  122. min-width="160"
  123. show-overflow-tooltip
  124. ></el-table-column>
  125. <el-table-column
  126. align="center"
  127. label="发起方表体备注"
  128. prop="initiatorRemark"
  129. min-width="160"
  130. show-overflow-tooltip
  131. ></el-table-column>
  132. <el-table-column
  133. align="center"
  134. label="发起方返利类型"
  135. prop="initiatorCustomerWalletName"
  136. min-width="160"
  137. show-overflow-tooltip
  138. ></el-table-column>
  139. <el-table-column
  140. align="center"
  141. label="返利金额"
  142. prop="amount"
  143. min-width="160"
  144. show-overflow-tooltip
  145. ></el-table-column>
  146. <el-table-column
  147. align="center"
  148. label="接收方经销商编号"
  149. prop="receiverCustomerNumber"
  150. min-width="160"
  151. show-overflow-tooltip
  152. ></el-table-column>
  153. <el-table-column
  154. align="center"
  155. label="接收方经销商名称"
  156. prop="receiverCustomerName"
  157. min-width="160"
  158. show-overflow-tooltip
  159. ></el-table-column>
  160. <el-table-column
  161. align="center"
  162. label="接收方表体备注"
  163. prop="receiverRemark"
  164. min-width="160"
  165. show-overflow-tooltip
  166. ></el-table-column>
  167. <el-table-column
  168. align="center"
  169. label="接收方返利类型"
  170. prop="receiverCustomerWalletName"
  171. min-width="160"
  172. show-overflow-tooltip
  173. ></el-table-column>
  174. <el-table-column
  175. align="center"
  176. label="备注"
  177. prop="remark"
  178. min-width="160"
  179. show-overflow-tooltip
  180. ></el-table-column>
  181. <el-table-column
  182. align="center"
  183. label="制单人"
  184. prop="createBy"
  185. min-width="160"
  186. show-overflow-tooltip
  187. ></el-table-column>
  188. <el-table-column
  189. align="center"
  190. label="审核人"
  191. prop="examineBy"
  192. min-width="160"
  193. show-overflow-tooltip
  194. ></el-table-column>
  195. <el-table-column
  196. align="center"
  197. label="审核日期"
  198. prop="examineTime"
  199. min-width="160"
  200. show-overflow-tooltip
  201. ></el-table-column>
  202. <!-- <el-table-column
  203. align="center"
  204. label="复核人"
  205. prop="secondExamineBy"
  206. min-width="160"
  207. show-overflow-tooltip
  208. ></el-table-column>
  209. <el-table-column
  210. align="center"
  211. label="复核日期"
  212. prop="secondExamineTime"
  213. min-width="160"
  214. show-overflow-tooltip
  215. ></el-table-column> -->
  216. <el-table-column
  217. align="center"
  218. label="状态"
  219. prop="examineStatus"
  220. min-width="160"
  221. show-overflow-tooltip
  222. >
  223. <template slot-scope="scope">
  224. <el-tag v-show="scope.row.examineStatus == 'SAVE'">保存</el-tag>
  225. <el-tag v-show="scope.row.examineStatus == 'WAIT'"
  226. >待审核</el-tag
  227. >
  228. <el-tag v-show="scope.row.examineStatus == 'OK_ONE'"
  229. >初审通过</el-tag
  230. >
  231. <el-tag v-show="scope.row.examineStatus == 'FAIL_ONE'"
  232. >初审不通过</el-tag
  233. >
  234. <el-tag v-show="scope.row.examineStatus == 'OK'"
  235. >复核通过</el-tag
  236. >
  237. <el-tag v-show="scope.row.examineStatus == 'FALL'"
  238. >不通过</el-tag
  239. >
  240. <el-tag v-show="scope.row.examineStatus == 'CLOSE'"
  241. >已关闭</el-tag
  242. >
  243. </template>
  244. </el-table-column>
  245. <el-table-column
  246. align="center"
  247. label="操作"
  248. min-width="200"
  249. show-overflow-tooltip
  250. fixed="right"
  251. >
  252. <template slot-scope="scope">
  253. <el-button
  254. @click="submitFn(scope.row.id)"
  255. v-if="
  256. $checkBtnRole('apply', $route.meta.roles) &&
  257. isCustomer &&
  258. scope.row.examineStatus == 'SAVE'
  259. "
  260. type="text"
  261. class="textColor"
  262. slot="reference"
  263. >提审</el-button
  264. >
  265. <el-button
  266. v-if="isCustomer && scope.row.examineStatus == 'WAIT'"
  267. type="text"
  268. class="textColor"
  269. slot="reference"
  270. @click="withdrawFn"
  271. >撤回</el-button
  272. >
  273. <el-button
  274. v-if="
  275. scope.row.examineStatus == 'WAIT' &&
  276. !isCustomer &&
  277. $checkBtnRole('examine', $route.meta.roles)
  278. "
  279. @click="examineFn(scope.row.id)"
  280. type="text"
  281. class="textColor"
  282. slot="reference"
  283. >审核</el-button
  284. >
  285. <el-button
  286. v-if="
  287. (scope.row.examineStatus == 'FAIL_ONE' ||
  288. scope.row.examineStatus == 'SAVE') &&
  289. $checkBtnRole('edit', $route.meta.roles)
  290. "
  291. type="text"
  292. class="textColor"
  293. slot="reference"
  294. @click="editFn(scope.row.id)"
  295. >修改</el-button
  296. >
  297. <el-button
  298. @click="detailFn(scope.row.id)"
  299. type="text"
  300. class="textColor"
  301. slot="reference"
  302. >详情</el-button
  303. >
  304. </template>
  305. </el-table-column>
  306. </el-table>
  307. </div>
  308. <!-- 分页 -->
  309. <div class="fr">
  310. <el-pagination
  311. @size-change="handleSizeChange"
  312. @current-change="handleCurrentChange"
  313. :current-page="currentPage"
  314. :page-sizes="[10, 20, 30, 50]"
  315. :page-size="pageSize"
  316. layout="total, sizes, prev, pager, next, jumper"
  317. :total="listTotal"
  318. >
  319. </el-pagination>
  320. </div>
  321. </div>
  322. </div>
  323. <ChangeListDetail :detailList="detailList" v-else-if="showPage == 2" />
  324. <ChangeListExamine
  325. @refresh="refreshFn"
  326. :detailList="detailList"
  327. v-else-if="showPage == 3"
  328. />
  329. <ChangeListReview
  330. @refresh="refreshFn"
  331. :detailList="detailList"
  332. v-else-if="showPage == 4"
  333. />
  334. </div>
  335. </template>
  336. <script>
  337. import {
  338. getChangeList,
  339. getChangeListDetail,
  340. getTransferSubmit,
  341. } from "@/api/finance/change_list";
  342. import ChangeListDetail from "./components/change_list-detail";
  343. import ChangeListExamine from "./components/change_list-examine";
  344. import ChangeListReview from "./components/change_list-review";
  345. export default {
  346. components: {
  347. ChangeListDetail,
  348. ChangeListExamine,
  349. ChangeListReview,
  350. },
  351. data() {
  352. return {
  353. isCustomer: null,
  354. currentPage: 1, // 当前页码
  355. pageSize: 10, // 每页数量
  356. listTotal: 0, // 列表总数
  357. dataList: [], // 列表数据
  358. searchForm: {
  359. startTime: "",
  360. walletName: "",
  361. id: "",
  362. }, //搜索表单
  363. listLoading: false, // 列表加载loading
  364. category: "",
  365. showPage: 1,
  366. detailList: {},
  367. };
  368. },
  369. created() {
  370. const res = JSON.parse(localStorage.getItem("supply_user"));
  371. this.isCustomer = res.isCustomer;
  372. this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
  373. },
  374. methods: {
  375. //切换radio
  376. changeRadioGroupFn(v) {
  377. console.log(v);
  378. this.getDataList({
  379. pageSize: this.pageSize,
  380. pageNum: this.currentPage,
  381. examineStatus: v,
  382. });
  383. },
  384. //撤回
  385. withdrawFn() {},
  386. //刷新
  387. refreshFn() {
  388. this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
  389. },
  390. //提审
  391. async submitFn(id) {
  392. await getTransferSubmit({ id });
  393. this.$message.success("提审成功");
  394. this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
  395. },
  396. //清空
  397. clearFn() {
  398. console.log(this.$refs.searchForm);
  399. this.$refs.searchForm.resetFields();
  400. },
  401. //搜索
  402. searchFn() {
  403. this.getDataList({
  404. ...this.searchForm,
  405. pageNum: this.currentPage,
  406. pageSize: this.pageSize,
  407. });
  408. },
  409. //获取列表数据
  410. async getDataList(data) {
  411. const res = await getChangeList(data);
  412. console.log(res);
  413. this.dataList = res.data.records;
  414. this.listTotal = res.data.total;
  415. },
  416. //详情
  417. async detailFn(id) {
  418. const res = await getChangeListDetail({ id });
  419. console.log(res);
  420. this.detailList = res.data;
  421. this.showPage = 2;
  422. },
  423. //修改
  424. async editFn(id) {
  425. const res = await getChangeListDetail({ id });
  426. this.detailList = res.data;
  427. this.showPage = 4;
  428. },
  429. //审核
  430. async examineFn(id) {
  431. const res = await getChangeListDetail({ id });
  432. this.detailList = res.data;
  433. this.showPage = 3;
  434. },
  435. // 更改每页数量
  436. handleSizeChange(val) {
  437. this.pageSize = val;
  438. this.currentPage = 1;
  439. this.getDataList({
  440. pageNum: 1,
  441. pageSize: this.pageSize,
  442. examineStatus: this.category,
  443. });
  444. },
  445. // 更改当前页
  446. handleCurrentChange(val) {
  447. this.currentPage = val;
  448. this.getDataList({
  449. pageNum: val,
  450. pageSize: 10,
  451. examineStatus: this.category,
  452. });
  453. },
  454. },
  455. };
  456. </script>
  457. <style lang="scss" scoped>
  458. .dateStyle {
  459. width: 100%;
  460. }
  461. </style>