change_list.vue 14 KB

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