index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <div>
  3. <normal-layout>
  4. <div slot="content">
  5. <div class="container">
  6. <el-row :gutter="20">
  7. <el-col v-for="(item,index) in acountlist" :key="index" :span="6" class="mt-10" @click.native="handleClick(index)">
  8. <div class="acccounet__panel" :style="activeName == index?{border:'1px solid #d8dde8'}:''">
  9. <p class="normal-margin">{{item.accountname}}</p>
  10. <p class="normal-title" style="font-size:1.825rem" :style="activeName == index?{color:'#3874f6'}:''"><small>¥</small>&nbsp;{{tool.formatAmount(item.balance)}}</p>
  11. <div class="score">
  12. <p style="margin-top:16px">信用额度:{{item.creditquota}}</p>
  13. </div>
  14. </div>
  15. </el-col>
  16. </el-row>
  17. <tableLayout :layout="tablecols" :data="list" :opwidth="200" :custom="true" :fixedName="'operation'" height="calc(100vh - 390px)">
  18. <template v-slot:customcol="scope">
  19. <div v-if="scope.column.columnname == 'type'">
  20. {{ scope.column.data.type ? '收入凭证' : '支出凭证' }}
  21. </div>
  22. <div v-else>
  23. {{scope.column.data[[scope.column.columnname]]?scope.column.data[[scope.column.columnname]]:'--'}}
  24. </div>
  25. </template>
  26. <template v-slot:opreation="scope">
  27. <editPrice v-if="tool.checkAuth($route.name,'update')" class="inline-16" :data="scope.data"/>
  28. <delete-btn
  29. @deleteCreate="deleteCreate"
  30. v-if="tool.checkAuth($route.name,'delete')"
  31. :id="scope.data.sa_itempriceadjust_itemsid"
  32. @deleteSuccess="$refs.basicLayout.listData()"
  33. nameId="20221025095404"
  34. nameKey="sa_itempriceadjust_itemsids"
  35. />
  36. </template>
  37. </tableLayout>
  38. <div style="margin-top:16px;text-align:right">
  39. <el-pagination
  40. background
  41. small
  42. @size-change="handleSizeChange"
  43. @current-change="handleCurrentChange"
  44. :current-page="param.content.pageNumber"
  45. :page-size="param.content.pageSize"
  46. layout="total, prev, pager, next, jumper"
  47. :total="total">
  48. </el-pagination>
  49. </div>
  50. </div>
  51. </div>
  52. </normal-layout>
  53. </div>
  54. </template>
  55. <script>
  56. export default {
  57. data () {
  58. return {
  59. activeName:0,
  60. acountlist:[],
  61. list:[],
  62. param: {
  63. "id":20230111103403,
  64. "content": {
  65. "pageNumber":1,
  66. "pageSize":20,
  67. "sa_accountclassid":""
  68. }
  69. },
  70. total:0
  71. }
  72. },
  73. async created () {
  74. },
  75. methods:{
  76. async listData () {
  77. const res = await this.$api.requested({
  78. id:"20221008145903",
  79. content:{
  80. "sys_enterpriseid":JSON.parse(window.sessionStorage.getItem('accountinfo')).enterprise.sys_enterpriseid
  81. }
  82. })
  83. this.acountlist = res.data
  84. console.log(this.acountlist);
  85. this.accountMx()
  86. },
  87. async accountMx () {
  88. this.param.content.sa_accountclassid = this.acountlist[this.activeName].sa_accountclassid
  89. const res = await this.$api.requested(this.param)
  90. this.list = res.data.rows
  91. },
  92. handleClick (index) {
  93. this.activeName = index
  94. this.accountMx()
  95. },
  96. handleSizeChange(val) {
  97. // console.log(`每页 ${val} 条`);
  98. this.param.content.pageSize = val
  99. this.accountMx()
  100. },
  101. handleCurrentChange(val) {
  102. // console.log(`当前页: ${val}`);
  103. this.param.content.pageNumber = val
  104. this.accountMx()
  105. },
  106. },
  107. mounted () {
  108. this.listData()
  109. },
  110. created () {
  111. this.tablecols = this.tool.tabelCol(this.$route.name)['accountMoneyDetailTable'].tablecols
  112. },
  113. }
  114. </script>
  115. <style>
  116. </style>
  117. <style scoped>
  118. .acccounet__panel{
  119. padding: 10px;
  120. line-height: 30px;
  121. border:1px solid #f1f2f3;
  122. color:#666;
  123. border-radius: 5px;
  124. cursor: pointer;
  125. }
  126. </style>