index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. type:1
  81. // "sys_enterpriseid":JSON.parse(window.sessionStorage.getItem('accountinfo')).enterprise.sys_enterpriseid
  82. }
  83. })
  84. this.acountlist = res.data
  85. console.log(this.acountlist);
  86. this.accountMx()
  87. },
  88. async accountMx () {
  89. this.param.content.sa_accountclassid = this.acountlist[this.activeName].sa_accountclassid
  90. const res = await this.$api.requested(this.param)
  91. this.list = res.data.rows
  92. },
  93. handleClick (index) {
  94. this.activeName = index
  95. this.accountMx()
  96. },
  97. handleSizeChange(val) {
  98. // console.log(`每页 ${val} 条`);
  99. this.param.content.pageSize = val
  100. this.accountMx()
  101. },
  102. handleCurrentChange(val) {
  103. // console.log(`当前页: ${val}`);
  104. this.param.content.pageNumber = val
  105. this.accountMx()
  106. },
  107. },
  108. mounted () {
  109. this.listData()
  110. },
  111. created () {
  112. this.tablecols = this.tool.tabelCol(this.$route.name)['accountMoneyDetailTable'].tablecols
  113. },
  114. }
  115. </script>
  116. <style>
  117. </style>
  118. <style scoped>
  119. .acccounet__panel{
  120. padding: 10px;
  121. line-height: 30px;
  122. border:1px solid #f1f2f3;
  123. color:#666;
  124. border-radius: 5px;
  125. cursor: pointer;
  126. }
  127. </style>