fundList.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  1. <template>
  2. <div class="app-container">
  3. <div class="title-container">
  4. <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
  5. </div>
  6. <y-page-list-layout :page-list="pageData" :page-para="listQuery" :get-page-list="getList" :pageSizes="pageSizes">
  7. <template slot="left">
  8. <PermissionButton menu-code="_views_finance_real_fund_create" class-name="filter-item" type="success" icon="el-icon-circle-plus-outline"
  9. :page-jump="false" round style="float: left" @click="createdRealFundDialog = true" />
  10. <el-input v-model="listQuery.keyword" placeholder="关键字搜索..." clearable
  11. style="margin-left: 20px;width: 300px;float: left;">
  12. </el-input>
  13. <el-select style="margin-left: 20px;float: left;" v-model="listQuery.notFinished" @change="getList()" >
  14. <el-option label="已认领" :value="false"> </el-option>
  15. <el-option label="未认领" :value="true"></el-option>
  16. </el-select>
  17. <el-date-picker
  18. style="margin-left: 20px;float: left;"
  19. v-model="payDate"
  20. type="daterange"
  21. align="center"
  22. unlink-panels
  23. range-separator="至"
  24. start-placeholder="到账时日(开始)"
  25. end-placeholder="到账时日(结束)"
  26. :picker-options="pickerOptions" value-format="yyyy-MM-dd">
  27. </el-date-picker>
  28. <el-button class="filter-item" style="margin-left: 10px;float: left;" type="primary" @click="searchList" v-loading.fullscreen.lock="loading" round>搜索
  29. </el-button>
  30. <el-button class="filter-item" style="float: left;" round type="success" @click="resetSearch()">重置
  31. </el-button>
  32. <el-button class="filter-item" style="margin-left: 10px;float: left;" type="info" @click="exportData()" round>导出
  33. </el-button>
  34. </template>
  35. <el-table ref="table" size="medium" slot="table" :data="pageData.records" show-summary border
  36. :summary-method="getSummaries" fit stripe highlight-current-row
  37. :header-row-style="{ color: '#333333' }" style="
  38. border-left: 1px solid #ebeced;
  39. border-right: 1px solid #ebeced;
  40. color: #333333;">
  41. <el-table-column label="付款方" align="center" width='250' >
  42. <template slot-scope="{row}">
  43. <span>{{ row.payer }}</span>
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="付款银行" align="center" width='100' >
  47. <template slot-scope="{row}">
  48. <span>{{ row.payerBank?row.payerBank:'-' }}</span>
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="付款金额(元)" align="center" prop="amount" >
  52. <template slot-scope="{row}">
  53. <span>{{ row.amount }}</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="到账时日" align="center">
  57. <template slot-scope="{row}">
  58. <span>{{ row.payDatetime }}</span>
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="已认领(元)" align="center" prop="claimAmount" >
  62. <template slot-scope="{row}">
  63. <span style="color:green">{{ row.claimAmount }}</span>
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="未认领(元)" align="center" prop="notClaimAmount" >
  67. <template slot-scope="{row}">
  68. <span style="color:red">{{ row.notClaimAmount }}</span>
  69. </template>
  70. </el-table-column>
  71. <el-table-column label="录入人" align="center">
  72. <template slot-scope="{row}">
  73. <span>{{ row.creator}}</span>
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="录入时间" align="center" width='170'>
  77. <template slot-scope="{row}">
  78. <span>{{ row.created}}</span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column label="全部认领" align="center" >
  82. <template slot-scope="{row}">
  83. <i v-if="row.notClaimAmount<=0" style="font-size:20px; color:green" class="el-icon-success"></i>
  84. <i v-else style="font-size:20px; color:RGB(255,106,106)" class="el-icon-warning"></i>
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="备注" align="center" width='170'>
  88. <template slot-scope="{row}">
  89. <span>{{ row.remark}}</span>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="操作" align="center" width="150" >
  93. <template slot-scope="{row}">
  94. <PermissionButton menu-code="_views_claim_list" class-name="filter-item" type="text"
  95. :page-jump="false" @click="clamiList(row.id,row.notClaimAmount,row.payer,row.amount)" />
  96. <PermissionButton menu-code="_views_real_fund_edit" class-name="filter-item" type="text"
  97. :page-jump="false" @click="detail(row.id)" />
  98. <PermissionButton menu-code="_views_real_fund_remove" class-name="filter-item" type="text"
  99. :page-jump="false" @click="remove(row.id)" />
  100. </template>
  101. </el-table-column>
  102. </el-table>
  103. </y-page-list-layout>
  104. <el-dialog :visible.sync="createdRealFundDialog" width="45%" center custom-class="doWarehouseClass" @closed="cleanFund">
  105. <el-form ref="realFund" :model="realFund" >
  106. <el-divider content-position="left">实收款信息</el-divider>
  107. <el-row>
  108. <el-col :xs="24" :sm="12" :lg="24" :span="6">
  109. <el-form-item
  110. label="付款方名称:"
  111. prop="payer"
  112. :rules="{required: true, message: '付款方名称不能为空', trigger: 'blur'}"
  113. label-width="140px"
  114. class="postInfo-container-item"
  115. >
  116. <el-input v-model.trim="realFund.payer" class="filter-item" />
  117. </el-form-item>
  118. </el-col>
  119. </el-row>
  120. <el-row>
  121. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  122. <el-form-item
  123. label="付款金额(元):"
  124. prop="amount"
  125. :rules="{required: true, message: '付款金额不能为空', trigger: 'blur'}"
  126. label-width="140px"
  127. class="postInfo-container-item"
  128. >
  129. <el-input-number :precision="2" :min="0" :value-on-clear="0" v-model.number="realFund.amount" type="number"
  130. style="width:100%" class="filter-item" />
  131. </el-form-item>
  132. </el-col>
  133. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  134. <el-form-item
  135. label="到账时间:"
  136. prop="payDatetime"
  137. :rules="{required: true, message: '到账时间不能为空', trigger: 'blur'}"
  138. label-width="140px"
  139. class="postInfo-container-item"
  140. >
  141. <el-date-picker
  142. v-model="realFund.payDatetime" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" style="width:100%">
  143. </el-date-picker>
  144. </el-form-item>
  145. </el-col>
  146. </el-row>
  147. <el-row>
  148. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  149. <el-form-item
  150. label="付款银行:"
  151. prop="payerBank"
  152. label-width="140px"
  153. class="postInfo-container-item"
  154. >
  155. <el-input v-model.trim="realFund.payerBank" class="filter-item" />
  156. </el-form-item>
  157. </el-col>
  158. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  159. <el-form-item
  160. label="付款银行账号:"
  161. prop="payerAccount"
  162. label-width="140px"
  163. class="postInfo-container-item"
  164. >
  165. <el-input v-model.trim="realFund.payerAccount" class="filter-item" />
  166. </el-form-item>
  167. </el-col>
  168. </el-row>
  169. <el-row>
  170. <el-col :xs="24" :sm="12" :lg="24" :span="6">
  171. <el-form-item
  172. label="备注:"
  173. prop="remark"
  174. label-width="140px"
  175. class="postInfo-container-item"
  176. >
  177. <el-input v-model.trim="realFund.remark" class="filter-item" type="textarea" />
  178. </el-form-item>
  179. </el-col>
  180. </el-row>
  181. </el-form>
  182. <span slot="footer" class="dialog-footer">
  183. <el-button @click="createdRealFundDialog = false">取 消</el-button>
  184. <el-button type="primary" @click="saveRealFund()">确 定</el-button>
  185. </span>
  186. </el-dialog>
  187. <el-dialog :visible.sync="claimListDialog" width="80%" center custom-class="doWarehouseClass">
  188. <div style="margin-bottom:20px;font-size:20px;">
  189. <span>付款方:</span><span style="color:red;font-weight:bold">{{payer}}</span><span style="margin-left:20px">付款金额:</span><span style="color:red;font-weight:bold">{{amount}}¥</span><span style="margin-left:20px">的认领记录:</span>
  190. </div>
  191. <parentTable
  192. :data="claimListData" border stripe :isBoard=300
  193. style="width: 100%">
  194. <el-table-column
  195. align = "center"
  196. prop="businessType"
  197. label="业务类型"
  198. width="180">
  199. </el-table-column>
  200. <el-table-column show-overflow-tooltip
  201. align = "center"
  202. prop="orderName"
  203. label="订单名称"
  204. width="300">
  205. </el-table-column>
  206. <el-table-column show-overflow-tooltip
  207. align = "center"
  208. prop="orderId"
  209. label="订单号"
  210. width="250">
  211. </el-table-column>
  212. <el-table-column
  213. align = "center"
  214. prop="shouldAmount"
  215. label="应收金额(元)">
  216. </el-table-column>
  217. <el-table-column
  218. align = "center"
  219. prop="claimAmount"
  220. label="认领金额(元)">
  221. </el-table-column>
  222. <el-table-column
  223. align = "center"
  224. prop="claimName"
  225. label="认领人">
  226. </el-table-column>
  227. <el-table-column
  228. align = "center"
  229. prop="created" width="180"
  230. label="认领时间">
  231. </el-table-column>
  232. <el-table-column
  233. align = "center"
  234. label="操作">
  235. <template slot-scope="scope">
  236. <el-button @click="removeClaim(scope.row.id)" type="text" size="small">删除</el-button>
  237. </template>
  238. </el-table-column>
  239. </parentTable>
  240. </el-dialog>
  241. </div>
  242. </template>
  243. <script>
  244. import YPageListLayout from '@/components/YPageListLayout'
  245. import Breadcrumb from '@/components/Breadcrumb'
  246. import excelImport from "@/components/excelImport.vue";
  247. export default {
  248. name: 'financeRealFund',
  249. components: {
  250. Breadcrumb,
  251. YPageListLayout,
  252. excelImport
  253. },
  254. data() {
  255. return {
  256. pageData: { records: [] },
  257. listQuery: {
  258. page: 1,
  259. size: 500,
  260. descs: 'id',
  261. keyword:null,
  262. startDate:null,
  263. endDate:null,
  264. notFinished:true
  265. },
  266. createdRealFundDialog: false,
  267. claimListDialog:false,
  268. payDate:'',
  269. claimListData:null,
  270. realFund:{
  271. id:null,
  272. payer:null,
  273. payerBank:null,
  274. payerAccount:null,
  275. amount:null,
  276. claimAmount:null,
  277. notClaimAmount:null,
  278. payDatetime:null,
  279. remark:null,
  280. created:null,
  281. creator:null
  282. },
  283. payer:null,
  284. amount:null,
  285. pickerOptions: {
  286. shortcuts: [{
  287. text: '最近一周',
  288. onClick(picker) {
  289. const end = new Date();
  290. const start = new Date();
  291. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  292. picker.$emit('pick', [start, end]);
  293. }
  294. }, {
  295. text: '最近一个月',
  296. onClick(picker) {
  297. const end = new Date();
  298. const start = new Date();
  299. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  300. picker.$emit('pick', [start, end]);
  301. }
  302. }, {
  303. text: '最近三个月',
  304. onClick(picker) {
  305. const end = new Date();
  306. const start = new Date();
  307. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  308. picker.$emit('pick', [start, end]);
  309. }
  310. }]
  311. },
  312. loading: false,
  313. pageSizes:[10, 20, 30, 50,100,200,500,1000]
  314. }
  315. },
  316. created() {
  317. this.getList();
  318. },
  319. methods: {
  320. resetSearch() {
  321. this.$router.push({ query: {} });
  322. this.payDate = '';
  323. this.listQuery = {
  324. current: 1,
  325. size: 500,
  326. descs: 'id',
  327. notFinished:true
  328. }
  329. this.getList()
  330. },
  331. searchList() {
  332. // 重置分页
  333. this.listQuery.page = 1
  334. this.listQuery.size = 500
  335. if (this.payDate){
  336. this.listQuery.startDate = this.payDate[0];
  337. this.listQuery.endDate = this.payDate[1];
  338. }
  339. this.getList()
  340. },
  341. getList() {
  342. this.loading = true;
  343. this.$api.financeRealFund.list(Object.assign({}, this.listQuery)).then(res=>{
  344. if (res.code ===200){
  345. this.pageData = res.data;
  346. }
  347. })
  348. setTimeout(() => {
  349. this.loading = false;
  350. }, 500);
  351. },
  352. saveRealFund(){
  353. this.$refs.realFund.validate(valid=>{
  354. if (valid){
  355. if (this.realFund.id){
  356. console.log(this.realFund)
  357. this.$api.financeRealFund.edit(this.realFund).then(res=>{
  358. if (res.code ===200 && res.data){
  359. this.$notify({
  360. title: '成功',
  361. message: '修改实收款信息成功',
  362. type: 'success',
  363. duration: 2000
  364. });
  365. this.getList();
  366. this.createdRealFundDialog = false;
  367. }else {
  368. this.$notify({
  369. title: '失败',
  370. message: '修改实收款信息失败',
  371. type: 'error',
  372. duration: 2000
  373. });
  374. }
  375. })
  376. }else{
  377. this.$api.financeRealFund.add(this.realFund).then(res=>{
  378. if (res.code ===200 && res.data){
  379. this.$notify({
  380. title: '成功',
  381. message: '录入实收款信息成功',
  382. type: 'success',
  383. duration: 2000
  384. });
  385. this.getList();
  386. this.createdRealFundDialog = false;
  387. }else {
  388. this.$notify({
  389. title: '失败',
  390. message: '录入实收款信息失败',
  391. type: 'error',
  392. duration: 2000
  393. });
  394. }
  395. })
  396. }
  397. }
  398. })
  399. },
  400. clamiList(id,notClaimAmount,payer,amount){
  401. this.claimListDialog = true;
  402. this.notClaimAmount = notClaimAmount;
  403. this.payer=payer;
  404. this.amount = amount;
  405. this.$api.financeClaim.getList(id).then(res=>{
  406. if (res.code ===200){
  407. this.claimListData = res.data;
  408. }
  409. })
  410. },
  411. detail(id){
  412. this.createdRealFundDialog = true;
  413. this.$api.financeRealFund.detail(id).then(res=>{
  414. if (res.code === 200 ){
  415. this.realFund = res.data
  416. }
  417. })
  418. },
  419. remove(id){
  420. this.$confirm('请确认是否删除此回款记录?','提示',{
  421. confirmButtonText: '确定',
  422. cancelButtonText: '取消',
  423. type: 'warning',
  424. center: true
  425. }).then(()=>{
  426. this.$api.financeRealFund.delete(id).then(res=>{
  427. if (res.code === 200 && res.data){
  428. this.$notify({
  429. title: '成功',
  430. message: '实收款信息已删除',
  431. type: 'success',
  432. duration: 2000
  433. });
  434. this.getList();
  435. }else {
  436. this.$notify({
  437. title: '失败',
  438. message: '实收款信息删除失败',
  439. type: 'error',
  440. duration: 2000
  441. });
  442. }
  443. })
  444. })
  445. },
  446. removeClaim(id){
  447. this.$confirm('请确认是否删除此条认领记录?','提示',{
  448. confirmButtonText: '确定',
  449. cancelButtonText: '取消',
  450. type: 'warning',
  451. center: true
  452. }).then(()=>{
  453. if (id){
  454. this.$api.financeClaim.delete(id).then(res=>{
  455. if (res.code ===200 && res.data){
  456. this.$notify({
  457. title: '成功',
  458. message: '删除认领记录成功',
  459. type: 'success',
  460. duration: 2000
  461. });
  462. this.$api.financeClaim.getList(id).then(res=>{
  463. if (res.code ===200){
  464. this.claimListData = res.data;
  465. }
  466. })
  467. this.getList();
  468. }else {
  469. this.$notify({
  470. title: '失败',
  471. message: '删除认领记录失败',
  472. type: 'error',
  473. duration: 2000
  474. });
  475. }
  476. })
  477. }
  478. })
  479. },
  480. cleanFund(){
  481. this.realFund.id=null;
  482. this.realFund.payer=null;
  483. this.realFund.payerBank=null;
  484. this.realFund.payerAccount=null;
  485. this.realFund.amount=null;
  486. this.realFund.claimAmount=null;
  487. this.realFund.payDatetime=null;
  488. this.realFund.remark=null;
  489. this.realFund.created=null;
  490. this.realFund.creator=null;
  491. },
  492. exportData(){
  493. this.$utils.exportUtil(
  494. "/financeRealFund/export", this.listQuery,
  495. "导出"
  496. );
  497. },
  498. getSummaries(param){
  499. const { columns, data } = param;
  500. const sums = [];
  501. columns.forEach((column, index) => {
  502. if (index === 0) {
  503. sums[index] = '合计';
  504. return;
  505. }
  506. const values = data.map(item => Number(item[column.property]));
  507. if (!values.every(value => isNaN(value))) {
  508. sums[index] = values.reduce((prev, curr) => {
  509. const value = Number(curr);
  510. if (!isNaN(value)) {
  511. return prev + curr;
  512. } else {
  513. return prev;
  514. }
  515. }, 0).toFixed(2);
  516. sums[index] += ' 元';
  517. } else {
  518. sums[index] = '-';
  519. }
  520. });
  521. return sums;
  522. }
  523. },
  524. }
  525. </script>
  526. <style lang="scss" scoped>
  527. /deep/.doWarehouseClass {
  528. border-radius: 10px;
  529. }
  530. .redPoint{
  531. color:red;
  532. position: absolute;
  533. top:8px;
  534. left:5px;
  535. }
  536. </style>