fundList.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  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="90%" 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 show-overflow-tooltip
  213. align = "center"
  214. prop="productionNo"
  215. label="产品号"
  216. width="250">
  217. </el-table-column>
  218. <el-table-column
  219. align = "center"
  220. prop="shouldAmount"
  221. label="应收金额(元)">
  222. <template slot-scope="{row}">
  223. <span>{{ row.productionShouldAmount?row.productionShouldAmount:row.shouldAmount}}</span>
  224. </template>
  225. </el-table-column>
  226. <el-table-column
  227. align = "center"
  228. prop="claimAmount"
  229. label="认领金额(元)">
  230. <template slot-scope="{row}">
  231. <span style="color: red;">{{ row.claimAmount}}</span>
  232. </template>
  233. </el-table-column>
  234. <el-table-column
  235. align = "center"
  236. prop="claimName"
  237. label="认领人">
  238. </el-table-column>
  239. <el-table-column
  240. align = "center"
  241. prop="created" width="180"
  242. label="认领时间">
  243. </el-table-column>
  244. <el-table-column
  245. align = "center"
  246. label="操作">
  247. <template slot-scope="scope">
  248. <el-button @click="removeClaim(scope.row.id)" type="text" size="small">删除</el-button>
  249. </template>
  250. </el-table-column>
  251. </parentTable>
  252. </el-dialog>
  253. </div>
  254. </template>
  255. <script>
  256. import YPageListLayout from '@/components/YPageListLayout'
  257. import Breadcrumb from '@/components/Breadcrumb'
  258. import excelImport from "@/components/excelImport.vue";
  259. export default {
  260. name: 'financeRealFund',
  261. components: {
  262. Breadcrumb,
  263. YPageListLayout,
  264. excelImport
  265. },
  266. data() {
  267. return {
  268. pageData: { records: [] },
  269. listQuery: {
  270. page: 1,
  271. size: 500,
  272. descs: 'id',
  273. keyword:null,
  274. startDate:null,
  275. endDate:null,
  276. notFinished:true
  277. },
  278. createdRealFundDialog: false,
  279. claimListDialog:false,
  280. payDate:'',
  281. claimListData:null,
  282. realFund:{
  283. id:null,
  284. payer:null,
  285. payerBank:null,
  286. payerAccount:null,
  287. amount:null,
  288. claimAmount:null,
  289. notClaimAmount:null,
  290. payDatetime:null,
  291. remark:null,
  292. created:null,
  293. creator:null
  294. },
  295. payer:null,
  296. amount:null,
  297. pickerOptions: {
  298. shortcuts: [{
  299. text: '最近一周',
  300. onClick(picker) {
  301. const end = new Date();
  302. const start = new Date();
  303. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  304. picker.$emit('pick', [start, end]);
  305. }
  306. }, {
  307. text: '最近一个月',
  308. onClick(picker) {
  309. const end = new Date();
  310. const start = new Date();
  311. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  312. picker.$emit('pick', [start, end]);
  313. }
  314. }, {
  315. text: '最近三个月',
  316. onClick(picker) {
  317. const end = new Date();
  318. const start = new Date();
  319. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  320. picker.$emit('pick', [start, end]);
  321. }
  322. }]
  323. },
  324. loading: false,
  325. pageSizes:[10, 20, 30, 50,100,200,500,1000]
  326. }
  327. },
  328. created() {
  329. this.getList();
  330. },
  331. methods: {
  332. resetSearch() {
  333. this.$router.push({ query: {} });
  334. this.payDate = '';
  335. this.listQuery = {
  336. current: 1,
  337. size: 500,
  338. descs: 'id',
  339. notFinished:true
  340. }
  341. this.getList()
  342. },
  343. searchList() {
  344. // 重置分页
  345. this.listQuery.page = 1
  346. this.listQuery.size = 500
  347. if (this.payDate){
  348. this.listQuery.startDate = this.payDate[0];
  349. this.listQuery.endDate = this.payDate[1];
  350. }
  351. this.getList()
  352. },
  353. getList() {
  354. this.loading = true;
  355. this.$api.financeRealFund.list(Object.assign({}, this.listQuery)).then(res=>{
  356. if (res.code ===200){
  357. this.pageData = res.data;
  358. }
  359. })
  360. setTimeout(() => {
  361. this.loading = false;
  362. }, 500);
  363. },
  364. saveRealFund(){
  365. this.$refs.realFund.validate(valid=>{
  366. if (valid){
  367. if (this.realFund.id){
  368. console.log(this.realFund)
  369. this.$api.financeRealFund.edit(this.realFund).then(res=>{
  370. if (res.code ===200 && res.data){
  371. this.$notify({
  372. title: '成功',
  373. message: '修改实收款信息成功',
  374. type: 'success',
  375. duration: 2000
  376. });
  377. this.getList();
  378. this.createdRealFundDialog = false;
  379. }else {
  380. this.$notify({
  381. title: '失败',
  382. message: '修改实收款信息失败',
  383. type: 'error',
  384. duration: 2000
  385. });
  386. }
  387. })
  388. }else{
  389. this.$api.financeRealFund.add(this.realFund).then(res=>{
  390. if (res.code ===200 && res.data){
  391. this.$notify({
  392. title: '成功',
  393. message: '录入实收款信息成功',
  394. type: 'success',
  395. duration: 2000
  396. });
  397. this.getList();
  398. this.createdRealFundDialog = false;
  399. }else {
  400. this.$notify({
  401. title: '失败',
  402. message: '录入实收款信息失败',
  403. type: 'error',
  404. duration: 2000
  405. });
  406. }
  407. })
  408. }
  409. }
  410. })
  411. },
  412. clamiList(id,notClaimAmount,payer,amount){
  413. this.claimListDialog = true;
  414. this.notClaimAmount = notClaimAmount;
  415. this.payer=payer;
  416. this.amount = amount;
  417. this.$api.financeClaim.getList(id).then(res=>{
  418. if (res.code ===200){
  419. this.claimListData = res.data;
  420. }
  421. })
  422. },
  423. detail(id){
  424. this.createdRealFundDialog = true;
  425. this.$api.financeRealFund.detail(id).then(res=>{
  426. if (res.code === 200 ){
  427. this.realFund = res.data
  428. }
  429. })
  430. },
  431. remove(id){
  432. this.$confirm('请确认是否删除此回款记录?','提示',{
  433. confirmButtonText: '确定',
  434. cancelButtonText: '取消',
  435. type: 'warning',
  436. center: true
  437. }).then(()=>{
  438. this.$api.financeRealFund.delete(id).then(res=>{
  439. if (res.code === 200 && res.data){
  440. this.$notify({
  441. title: '成功',
  442. message: '实收款信息已删除',
  443. type: 'success',
  444. duration: 2000
  445. });
  446. this.getList();
  447. }else {
  448. this.$notify({
  449. title: '失败',
  450. message: '实收款信息删除失败',
  451. type: 'error',
  452. duration: 2000
  453. });
  454. }
  455. })
  456. })
  457. },
  458. removeClaim(id){
  459. this.$confirm('请确认是否删除此条认领记录?','提示',{
  460. confirmButtonText: '确定',
  461. cancelButtonText: '取消',
  462. type: 'warning',
  463. center: true
  464. }).then(()=>{
  465. if (id){
  466. this.$api.financeClaim.delete(id).then(res=>{
  467. if (res.code ===200 && res.data){
  468. this.$notify({
  469. title: '成功',
  470. message: '删除认领记录成功',
  471. type: 'success',
  472. duration: 2000
  473. });
  474. this.$api.financeClaim.getList(id).then(res=>{
  475. if (res.code ===200){
  476. this.claimListData = res.data;
  477. }
  478. })
  479. this.getList();
  480. }else {
  481. this.$notify({
  482. title: '失败',
  483. message: '删除认领记录失败',
  484. type: 'error',
  485. duration: 2000
  486. });
  487. }
  488. })
  489. }
  490. })
  491. },
  492. cleanFund(){
  493. this.realFund.id=null;
  494. this.realFund.payer=null;
  495. this.realFund.payerBank=null;
  496. this.realFund.payerAccount=null;
  497. this.realFund.amount=null;
  498. this.realFund.claimAmount=null;
  499. this.realFund.payDatetime=null;
  500. this.realFund.remark=null;
  501. this.realFund.created=null;
  502. this.realFund.creator=null;
  503. },
  504. exportData(){
  505. this.$utils.exportUtil(
  506. "/financeRealFund/export", this.listQuery,
  507. "导出"
  508. );
  509. },
  510. getSummaries(param){
  511. const { columns, data } = param;
  512. const sums = [];
  513. columns.forEach((column, index) => {
  514. if (index === 0) {
  515. sums[index] = '合计';
  516. return;
  517. }
  518. const values = data.map(item => Number(item[column.property]));
  519. if (!values.every(value => isNaN(value))) {
  520. sums[index] = values.reduce((prev, curr) => {
  521. const value = Number(curr);
  522. if (!isNaN(value)) {
  523. return prev + curr;
  524. } else {
  525. return prev;
  526. }
  527. }, 0).toFixed(2);
  528. sums[index] += ' 元';
  529. } else {
  530. sums[index] = '-';
  531. }
  532. });
  533. return sums;
  534. }
  535. },
  536. }
  537. </script>
  538. <style lang="scss" scoped>
  539. /deep/.doWarehouseClass {
  540. border-radius: 10px;
  541. }
  542. .redPoint{
  543. color:red;
  544. position: absolute;
  545. top:8px;
  546. left:5px;
  547. }
  548. </style>