change_list.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <template>
  2. <div class="app-container">
  3. <div v-if="showPage == 1">
  4. <el-radio-group @change="changeRadioGroupFn" v-model="category" size="mini">
  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 ref="searchForm" :model="searchForm" label-width="100px" size="mini" label-position="left">
  17. <el-row :gutter="20">
  18. <el-col :xs="24" :sm="12" :lg="6">
  19. <el-form-item label="返利互转单号" prop="id">
  20. <el-input v-model="searchForm.id" placeholder="请输入"></el-input>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :xs="24" :sm="12" :lg="6">
  24. <el-form-item label="返利类型" prop="walletName">
  25. <el-input v-model="searchForm.walletName" placeholder="请输入"></el-input>
  26. </el-form-item>
  27. </el-col>
  28. <el-col :xs="24" :sm="12" :lg="6">
  29. <el-form-item label="申请日期" prop="startTime">
  30. <el-date-picker class="dateStyle" v-model="searchForm.startTime" placeholder="选择日期" type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
  31. </el-date-picker>
  32. </el-form-item>
  33. </el-col>
  34. <el-col :xs="24" :sm="12" :lg="6">
  35. <el-form-item label="" class="fr">
  36. <el-button size="mini" @click="clearFn">清空</el-button>
  37. <el-button size="mini" type="primary" @click="searchFn">搜索</el-button>
  38. </el-form-item>
  39. </el-col>
  40. </el-row>
  41. </el-form>
  42. </div>
  43. <br />
  44. <strong>返利互转单列表</strong>
  45. <el-divider></el-divider>
  46. <!-- 列表 -->
  47. <div class="mymain-container">
  48. <div class="table">
  49. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe show-summary :summary-method="$getSummaries">
  50. <el-table-column label="序号" align="left" width="100" type="index" show-overflow-tooltip></el-table-column>
  51. <el-table-column align="left" label="状态" prop="examineStatus" min-width="160" show-overflow-tooltip>
  52. <template slot-scope="scope">
  53. <el-tag size="mini" type="" v-show="scope.row.examineStatus == 'SAVE'">保存</el-tag>
  54. <el-tag size="mini" type="warning" v-show="scope.row.examineStatus == 'WAIT'">待审核</el-tag>
  55. <el-tag size="mini" type="success" v-show="scope.row.examineStatus == 'OK_ONE'">初审通过</el-tag>
  56. <el-tag size="mini" type="danger" v-show="scope.row.examineStatus == 'FAIL_ONE'">初审不通过</el-tag>
  57. <el-tag size="mini" type="success" v-show="scope.row.examineStatus == 'OK'">复核通过</el-tag>
  58. <el-tag size="mini" type="danger" v-show="scope.row.examineStatus == 'FALL'">不通过</el-tag>
  59. <el-tag size="mini" type="info" v-show="scope.row.examineStatus == 'CLOSE'">已关闭</el-tag>
  60. </template>
  61. </el-table-column>
  62. <el-table-column align="left" label="返利转账单号" prop="id" min-width="200" show-overflow-tooltip>
  63. <template slot-scope="scope">
  64. <CopyButton :copyText="scope.row.id" />
  65. <span>{{scope.row.id}}</span>
  66. </template>
  67. </el-table-column>
  68. <el-table-column align="left" label="申请日期" prop="applyTime" min-width="160" show-overflow-tooltip>
  69. <!-- <template slot-scope="scope">
  70. <div>
  71. <span>{{ scope.row.applyTime }}</span>
  72. <el-button
  73. type="text"
  74. icon="el-icon-edit"
  75. style="padding: 0; margin-left: 6px"
  76. @click="editDate(scope.row)"
  77. ></el-button>
  78. </div>
  79. </template> -->
  80. </el-table-column>
  81. <el-table-column align="left" label="发起方经销商编号" prop="customerNumber" min-width="160" show-overflow-tooltip>
  82. <template slot-scope="scope">
  83. <CopyButton :copyText="scope.row.customerNumber" />
  84. <span>{{scope.row.customerNumber}}</span>
  85. </template>
  86. </el-table-column>
  87. <el-table-column align="left" label="发起方经销商名称" prop="customerName" min-width="260" show-overflow-tooltip>
  88. <template slot-scope="scope">
  89. <CopyButton :copyText="scope.row.customerName" />
  90. <span>{{scope.row.customerName}}</span>
  91. </template>
  92. </el-table-column>
  93. <el-table-column align="left" label="发起方表体备注" prop="initiatorRemark" min-width="160" show-overflow-tooltip></el-table-column>
  94. <el-table-column align="left" label="发起方返利类型" prop="initiatorCustomerWalletName" min-width="160" show-overflow-tooltip></el-table-column>
  95. <el-table-column align="right" label="返利金额" prop="amount" min-width="160" show-overflow-tooltip>
  96. <template slot-scope="scope">
  97. {{ scope.row.amount | numToFixed }}
  98. </template>
  99. </el-table-column>
  100. <el-table-column align="left" label="接收方经销商编号" prop="receiverCustomerNumber" min-width="160" show-overflow-tooltip>
  101. <template slot-scope="scope">
  102. <CopyButton :copyText="scope.row.receiverCustomerNumber" />
  103. <span>{{scope.row.receiverCustomerNumber}}</span>
  104. </template>
  105. </el-table-column>
  106. <el-table-column align="left" label="接收方经销商名称" prop="receiverCustomerName" min-width="260" show-overflow-tooltip>
  107. <template slot-scope="scope">
  108. <CopyButton :copyText="scope.row.receiverCustomerName" />
  109. <span>{{scope.row.receiverCustomerName}}</span>
  110. </template>
  111. </el-table-column>
  112. <el-table-column align="left" label="接收方表体备注" prop="receiverRemark" min-width="160" show-overflow-tooltip></el-table-column>
  113. <el-table-column align="left" label="接收方返利类型" prop="receiverCustomerWalletName" min-width="160" show-overflow-tooltip></el-table-column>
  114. <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  115. <el-table-column align="left" label="制单人" prop="createBy" min-width="160" show-overflow-tooltip></el-table-column>
  116. <el-table-column align="left" label="审核人" prop="examineBy" min-width="160" show-overflow-tooltip></el-table-column>
  117. <el-table-column align="left" label="审核日期" prop="examineTime" min-width="160" show-overflow-tooltip></el-table-column>
  118. <!-- <el-table-column
  119. align="left"
  120. label="复核人"
  121. prop="secondExamineBy"
  122. min-width="160"
  123. show-overflow-tooltip
  124. ></el-table-column>
  125. <el-table-column
  126. align="left"
  127. label="复核日期"
  128. prop="secondExamineTime"
  129. min-width="160"
  130. show-overflow-tooltip
  131. ></el-table-column> -->
  132. <el-table-column align="center" label="操作" min-width="200" show-overflow-tooltip fixed="right">
  133. <template slot-scope="scope">
  134. <el-button @click="submitFn(scope.row.id)" v-if="
  135. $checkBtnRole('apply', $route.meta.roles) &&
  136. isCustomer &&
  137. scope.row.examineStatus == 'SAVE'
  138. " type="text" class="textColor" slot="reference">提审</el-button>
  139. <el-button v-if="isCustomer && scope.row.examineStatus == 'WAIT'" type="text" class="textColor" slot="reference" @click="withdrawFn">撤回</el-button>
  140. <el-button v-if="
  141. scope.row.examineStatus == 'WAIT' &&
  142. !isCustomer &&
  143. $checkBtnRole('examine', $route.meta.roles)
  144. " @click="examineFn(scope.row.id)" type="text" class="textColor" slot="reference">审核</el-button>
  145. <el-button v-if="
  146. (scope.row.examineStatus == 'FAIL_ONE' ||
  147. scope.row.examineStatus == 'SAVE') &&
  148. $checkBtnRole('edit', $route.meta.roles)
  149. " type="text" class="textColor" slot="reference" @click="editFn(scope.row.id)">修改</el-button>
  150. <el-button @click="detailFn(scope.row.id)" type="text" class="textColor" slot="reference">详情</el-button>
  151. </template>
  152. </el-table-column>
  153. </el-table>
  154. </div>
  155. <!-- 分页 -->
  156. <div class="fr">
  157. <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">
  158. </el-pagination>
  159. </div>
  160. </div>
  161. </div>
  162. <ChangeListDetail :detailList="detailList" v-else-if="showPage == 2" />
  163. <ChangeListExamine @refresh="refreshFn" :detailList="detailList" v-else-if="showPage == 3" />
  164. <ChangeListReview @refresh="refreshFn" :detailList="detailList" v-else-if="showPage == 4" />
  165. </div>
  166. </template>
  167. <script>
  168. import {
  169. getChangeList,
  170. getChangeListDetail,
  171. getTransferSubmit,
  172. } from "@/api/finance/change_list";
  173. import ChangeListDetail from "./components/change_list-detail";
  174. import ChangeListExamine from "./components/change_list-examine";
  175. import ChangeListReview from "./components/change_list-review";
  176. export default {
  177. components: {
  178. ChangeListDetail,
  179. ChangeListExamine,
  180. ChangeListReview,
  181. },
  182. data() {
  183. return {
  184. isCustomer: null,
  185. currentPage: 1, // 当前页码
  186. pageSize: 10, // 每页数量
  187. listTotal: 0, // 列表总数
  188. dataList: [], // 列表数据
  189. searchForm: {
  190. startTime: "",
  191. walletName: "",
  192. id: "",
  193. }, //搜索表单
  194. listLoading: false, // 列表加载loading
  195. category: "",
  196. showPage: 1,
  197. detailList: {},
  198. };
  199. },
  200. created() {
  201. const res = JSON.parse(localStorage.getItem("supply_user"));
  202. this.isCustomer = res.isCustomer;
  203. this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
  204. },
  205. methods: {
  206. //切换radio
  207. changeRadioGroupFn(v) {
  208. // console.log(v);
  209. this.currentPage = 1;
  210. this.pageSize = 10;
  211. this.getDataList({
  212. pageSize: this.pageSize,
  213. pageNum: this.currentPage,
  214. examineStatus: v,
  215. });
  216. },
  217. //撤回
  218. withdrawFn() {},
  219. //刷新
  220. refreshFn() {
  221. this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
  222. },
  223. //提审
  224. async submitFn(id) {
  225. await getTransferSubmit({ id });
  226. this.$message.success("提审成功");
  227. this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
  228. },
  229. //清空
  230. clearFn() {
  231. console.log(this.$refs.searchForm);
  232. this.$refs.searchForm.resetFields();
  233. },
  234. //搜索
  235. searchFn() {
  236. this.getDataList({
  237. ...this.searchForm,
  238. pageNum: this.currentPage,
  239. pageSize: this.pageSize,
  240. });
  241. },
  242. //获取列表数据
  243. async getDataList(data) {
  244. const res = await getChangeList(data);
  245. // console.log(res);
  246. res.data.records.forEach((item) => {
  247. item.sums1 = [];
  248. item.sums2 = ["amount"];
  249. });
  250. this.dataList = res.data.records;
  251. this.listTotal = res.data.total;
  252. },
  253. //详情
  254. async detailFn(id) {
  255. const res = await getChangeListDetail({ id });
  256. console.log(res);
  257. this.detailList = res.data;
  258. this.showPage = 2;
  259. },
  260. //修改
  261. async editFn(id) {
  262. const res = await getChangeListDetail({ id });
  263. this.detailList = res.data;
  264. this.showPage = 4;
  265. },
  266. //审核
  267. async examineFn(id) {
  268. const res = await getChangeListDetail({ id });
  269. this.detailList = res.data;
  270. this.showPage = 3;
  271. },
  272. // 更改每页数量
  273. handleSizeChange(val) {
  274. this.pageSize = val;
  275. this.currentPage = 1;
  276. this.getDataList({
  277. pageNum: 1,
  278. pageSize: this.pageSize,
  279. examineStatus: this.category,
  280. });
  281. },
  282. // 更改当前页
  283. handleCurrentChange(val) {
  284. this.currentPage = val;
  285. this.getDataList({
  286. pageNum: val,
  287. pageSize: 10,
  288. examineStatus: this.category,
  289. });
  290. },
  291. },
  292. };
  293. </script>
  294. <style lang="scss" scoped>
  295. .dateStyle {
  296. width: 100%;
  297. }
  298. </style>