| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <template>
- <div>
- <el-button size="small" type="primary" @click="showBalance">{{$t(`期初余额更新`)}}</el-button>
- <el-drawer
- title="期初余额更新记录"
- :visible.sync="drawVisible"
- size="80%"
- direction="rtl"
- append-to-body
- :show-close="false"
- >
- <div class="drawer__panel" style="margin-bottom: 0 !important;padding-bottom: 0!important;">
- <div style="margin-bottom: 10px;">
- <importFile class="inline-16" title="期初余额更新" :bindData="{ownertable:'balance',ownerid:'',usetype:'default'}" :errorUrl="errorUrl" @clearUrl="errorUrl = null" @onSuccess="bindImport"></importFile>
- <div class="mt-10 inline-16">
- <div class="search__label">{{$t(`更新时间:`)}}</div>
- <el-date-picker
- size="small"
- v-model="selectDate"
- type="daterange"
- @change="dateChange"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- </div>
- <div class="mt-10 inline-16">
- <div class="search__label">{{$t(`搜索:`)}}</div>
- <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>
- </el-input>
- </div>
- </div>
- <tableNewLayout :layout="tablecols" height="calc(100vh - 190px)" :data="list" fixedName="operation" :width="true" :custom="true">
- <template v-slot:customcol="scope">
- <div v-if="scope.column.columnname === 'openingbalance'">
- <span><small>¥</small>{{scope.column.data[scope.column.columnname]?tool.formatAmount(scope.column.data[scope.column.columnname],2):'0.00'}}</span>
- </div>
- <p v-else>{{scope.column.data[scope.column.columnname] || scope.column.columnname === 'operation'?$t(scope.column.data[scope.column.columnname]):'--'}}</p>
- </template>
- <template v-slot:opreation="scope"></template>
- </tableNewLayout>
- <div class="container normal-panel" style="text-align:right">
- <el-pagination
- background
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="currentPage"
- :page-sizes="[100,150, 200]"
- :page-size="100"
- layout="total,sizes, prev, pager, next, jumper"
- :total="total">
- </el-pagination>
- </div>
- </div>
- </el-drawer>
- </div>
- </template>
- <script>
- import importFile from './importFile'
- export default {
- name: "balanceUpd",
- components:{importFile},
- props:{
- },
- data(){
- return {
- drawVisible:false,
- errorUrl:null,
- param:{
- "id": 20241218101003,
- "content": {
- "pageNumber":1,
- "pageSize":100,
- "where":{
- "condition":"",
- "begindate":"",
- "enddate":""
- }
- }
- },
- list:[],
- tablecols:[],
- currentPage:0,
- total:0,
- selectDate:[]
- }
- },
- methods:{
- showBalance(){
- this.drawVisible = true
- this.listData()
- },
- async listData(){
- const res = await this.$api.requested(this.param)
- this.list = res.data
- this.total = res.total
- this.currentPage = res.pageNumber
- console.log(res.data)
- },
- handleSizeChange(val) {
- // console.log(`每页 ${val} 条`);
- this.param.content.pageSize = val
- this.listData()
- },
- handleCurrentChange(val) {
- // console.log(`当前页: ${val}`);
- this.param.content.pageNumber = val
- this.listData()
- },
- async bindImport (id) {
- const res = await this.$api.requested({
- "id": 20241218102503,
- "content": {
- "attachmentid":id
- }
- })
- if (res.code == 0){
- this.tool.showMessage(res,()=>{})
- }else {
- if (res.data !== '成功') {
- this.errorUrl = res.data
- }
- this.listData()
- }
- },
- clearSearchValue () {
- this.$store.dispatch('clearSearchValue')
- this.listData(this.param.content.pageNumber = 1)
- },
- dateChange(){
- if (this.selectDate){
- this.param.content.where.begindate = this.selectDate[0]
- this.param.content.where.enddate = this.selectDate[1]
- }else {
- this.param.content.where.begindate = ''
- this.param.content.where.enddate = ''
- }
- this.listData()
- }
- },
- created() {
- this.tablecols = this.tool.tabelCol(this.$route.name).balanceUpdTable.tablecols
- }
- }
- </script>
- <style scoped>
- </style>
|