balanceUpd.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <div>
  3. <el-button size="small" type="primary" @click="showBalance">{{$t(`期初余额更新`)}}</el-button>
  4. <el-drawer
  5. title="期初余额更新记录"
  6. :visible.sync="drawVisible"
  7. size="80%"
  8. direction="rtl"
  9. append-to-body
  10. :show-close="false"
  11. >
  12. <div class="drawer__panel" style="margin-bottom: 0 !important;padding-bottom: 0!important;">
  13. <div style="margin-bottom: 10px;">
  14. <importFile class="inline-16" title="期初余额更新" :bindData="{ownertable:'balance',ownerid:'',usetype:'default'}" :errorUrl="errorUrl" @clearUrl="errorUrl = null" @onSuccess="bindImport"></importFile>
  15. <div class="mt-10 inline-16">
  16. <div class="search__label">{{$t(`更新时间:`)}}</div>
  17. <el-date-picker
  18. size="small"
  19. v-model="selectDate"
  20. type="daterange"
  21. @change="dateChange"
  22. value-format="yyyy-MM-dd"
  23. range-separator="至"
  24. start-placeholder="开始日期"
  25. end-placeholder="结束日期">
  26. </el-date-picker>
  27. </div>
  28. <div class="mt-10 inline-16">
  29. <div class="search__label">{{$t(`搜索:`)}}</div>
  30. <el-input style="width:200px;" :placeholder="$t('搜索')" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="clearSearchValue" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
  31. </el-input>
  32. </div>
  33. </div>
  34. <tableNewLayout :layout="tablecols" height="calc(100vh - 190px)" :data="list" fixedName="operation" :width="true" :custom="true">
  35. <template v-slot:customcol="scope">
  36. <div v-if="scope.column.columnname === 'openingbalance'">
  37. <span><small>¥</small>{{scope.column.data[scope.column.columnname]?tool.formatAmount(scope.column.data[scope.column.columnname],2):'0.00'}}</span>
  38. </div>
  39. <p v-else>{{scope.column.data[scope.column.columnname] || scope.column.columnname === 'operation'?$t(scope.column.data[scope.column.columnname]):'--'}}</p>
  40. </template>
  41. <template v-slot:opreation="scope"></template>
  42. </tableNewLayout>
  43. <div class="container normal-panel" style="text-align:right">
  44. <el-pagination
  45. background
  46. @size-change="handleSizeChange"
  47. @current-change="handleCurrentChange"
  48. :current-page="currentPage"
  49. :page-sizes="[100,150, 200]"
  50. :page-size="100"
  51. layout="total,sizes, prev, pager, next, jumper"
  52. :total="total">
  53. </el-pagination>
  54. </div>
  55. </div>
  56. </el-drawer>
  57. </div>
  58. </template>
  59. <script>
  60. import importFile from './importFile'
  61. export default {
  62. name: "balanceUpd",
  63. components:{importFile},
  64. props:{
  65. },
  66. data(){
  67. return {
  68. drawVisible:false,
  69. errorUrl:null,
  70. param:{
  71. "id": 20241218101003,
  72. "content": {
  73. "pageNumber":1,
  74. "pageSize":100,
  75. "where":{
  76. "condition":"",
  77. "begindate":"",
  78. "enddate":""
  79. }
  80. }
  81. },
  82. list:[],
  83. tablecols:[],
  84. currentPage:0,
  85. total:0,
  86. selectDate:[]
  87. }
  88. },
  89. methods:{
  90. showBalance(){
  91. this.drawVisible = true
  92. this.listData()
  93. },
  94. async listData(){
  95. const res = await this.$api.requested(this.param)
  96. this.list = res.data
  97. this.total = res.total
  98. this.currentPage = res.pageNumber
  99. console.log(res.data)
  100. },
  101. handleSizeChange(val) {
  102. // console.log(`每页 ${val} 条`);
  103. this.param.content.pageSize = val
  104. this.listData()
  105. },
  106. handleCurrentChange(val) {
  107. // console.log(`当前页: ${val}`);
  108. this.param.content.pageNumber = val
  109. this.listData()
  110. },
  111. async bindImport (id) {
  112. const res = await this.$api.requested({
  113. "id": 20241218102503,
  114. "content": {
  115. "attachmentid":id
  116. }
  117. })
  118. if (res.code == 0){
  119. this.tool.showMessage(res,()=>{})
  120. }else {
  121. if (res.data !== '成功') {
  122. this.errorUrl = res.data
  123. }
  124. this.listData()
  125. }
  126. },
  127. clearSearchValue () {
  128. this.$store.dispatch('clearSearchValue')
  129. this.listData(this.param.content.pageNumber = 1)
  130. },
  131. dateChange(){
  132. if (this.selectDate){
  133. this.param.content.where.begindate = this.selectDate[0]
  134. this.param.content.where.enddate = this.selectDate[1]
  135. }else {
  136. this.param.content.where.begindate = ''
  137. this.param.content.where.enddate = ''
  138. }
  139. this.listData()
  140. }
  141. },
  142. created() {
  143. this.tablecols = this.tool.tabelCol(this.$route.name).balanceUpdTable.tablecols
  144. }
  145. }
  146. </script>
  147. <style scoped>
  148. </style>