Browse Source

财务期间管理模块

Qukatie 1 year ago
parent
commit
fe89a9698a

+ 112 - 0
src/api/iosBasicData/periodManagement.js

@@ -0,0 +1,112 @@
+import request from '@/router/axios';
+//查询列表
+export const getList = (params) => {
+    return request({
+        url: '/api/blade-los/finperiod/list',
+        method: 'get',
+        params: params
+    })
+}
+//清除选定财务账
+export const init = (data) => {
+    return request({
+        url: '/api/blade-los/finperiod/init',
+        method: 'post',
+        data: data
+    })
+}
+//开账
+export const open = (data) => {
+    return request({
+        url: '/api/blade-los/finperiod/open',
+        method: 'post',
+        data: data
+    })
+}
+//业务锁定
+export const locking = (data) => {
+    return request({
+        url: '/api/blade-los/finperiod/locking',
+        method: 'post',
+        data: data
+    })
+}
+//撤销业务锁定
+export const revokeLocking = (data) => {
+    return request({
+        url: '/api/blade-los/finperiod/revokeLocking',
+        method: 'post',
+        data: data
+    })
+}
+//结转
+export const close = (data) => {
+    return request({
+        url: '/api/blade-los/finperiod/close',
+        method: 'post',
+        data: data
+    })
+}
+//反结转
+export const unclose= (data) => {
+    return request({
+        url: '/api/blade-los/finperiod/unclose',
+        method: 'post',
+        data: data
+    })
+}
+//月末结转列表
+export const currentPeriod = (params) => {
+    return request({
+        url: '/api/blade-los/finperiod/currentPeriod',
+        method: 'get',
+        params: params
+    })
+}
+//模版新增或修改
+export const submit= (data) => {
+    return request({
+        url: '/api/blade-los/finperiod/submit',
+        method: 'post',
+        data: data
+    })
+}
+//导入科目明细总账
+export const getAccountsItemsList= (params) => {
+    return request({
+        url: '/api/blade-los/accounts/getAccountsItemsList',
+        method: 'get',
+        params: params
+    })
+}
+//详情
+export const getDetails= (params) => {
+    return request({
+        url: '/api/blade-los/finperiod/detail',
+        method: 'get',
+        params: params
+    })
+}
+//模版新增或修改
+export const generateVouchers= (data) => {
+    return request({
+        url: '/api/blade-los/finperiod/generateVouchers',
+        method: 'post',
+        data: data
+    })
+}
+//模版新增或修改
+export const submitPeriod= (data) => {
+    return request({
+        url: '/api/blade-los/finvouchers/submitPeriod',
+        method: 'post',
+        data: data
+    })
+}
+export const getPeriodExchangeRate= (params) => {
+    return request({
+        url: '/api/blade-los/bcurrency/getPeriodExchangeRate',
+        method: 'get',
+        params: params
+    })
+}

+ 12 - 0
src/enums/column-name.js

@@ -1714,6 +1714,18 @@ const columnName = [{
   {
     code: 365,
     name: '鑫信恒源-放单-放单管理明细列表'
+  },
+  {
+    code: 366,
+    name: '鑫信恒源-财务管理-会计期间列表'
+  },
+  {
+    code: 367,
+    name: '鑫信恒源-财务管理-月末结转列表'
+  },
+  {
+    code: 368,
+    name: '鑫信恒源-财务管理-月末结转明细列表'
   }
 ]
 export const getColumnName = (key) => {

+ 4 - 1
src/views/iosBasicData/ComputationCenter/index.vue

@@ -357,7 +357,10 @@ export default {
                 });
             } else {
                 this.$router.push({
-                    path: "/iosBasicData/fininvoicesOutput/index"
+                    path: "/iosBasicData/fininvoicesOutput/index",
+                    query: {
+                        id: row.id
+                    }
                 });
             }
         },

+ 1 - 1
src/views/iosBasicData/PaymentApplication/index.vue

@@ -388,7 +388,7 @@ export default {
     expandChange(row, expendList) {
       finstlbillsitemsList(1, 20, { pid: row.id }).then(res => {
         row.finStlBillsItemsList = res.data.data.records.map(item => {
-          if (item.currentStlCurCode = 'CNY') {
+          if (item.currentStlCurCode == 'CNY') {
             // 发票
             this.$set(item, 'currentInvoiceAmountRMB', item.currentInvoiceAmount)
             // 应结算金额

File diff suppressed because it is too large
+ 816 - 846
src/views/iosBasicData/fininvoicesOutput/index.vue


+ 235 - 0
src/views/iosBasicData/periodManagement/detailsPage.vue

@@ -0,0 +1,235 @@
+<template>
+    <div>
+        <div class="customer-head">
+            <div class="customer-back">
+                <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
+                    @click="goBack(0)">返回列表
+                </el-button>
+            </div>
+            <div class="add-customer-btn">
+                <el-button v-if="editButton" class="el-button&#45;&#45;small-yh" style="margin-left: 6px;" type="primary"
+                    size="small" @click="editButton = false">编 辑
+                </el-button>
+                <el-button v-if="!editButton" style="margin-left: 6px;" type="primary" size="small" @click="submit">保 存
+                </el-button>
+                <el-button v-if="!editButton" type="success" size="small" @click="importData">导入明细科目名称</el-button>
+            </div>
+        </div>
+        <div style="margin-top: 50px">
+            <trade-card title="基础信息">
+                <avue-form :option="optionForm" v-model="form" ref="form">
+                </avue-form>
+            </trade-card>
+            <trade-card title="明细信息">
+                <avue-crud ref="crud" :option="option" :data="form.accItems"
+                    @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 368)"
+                    @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 368)"
+                    @selection-change="selectionChange"></avue-crud>
+            </trade-card>
+        </div>
+    </div>
+</template>
+
+<script>
+import {
+    getDetails, submit, getAccountsItemsList
+} from "@/api/iosBasicData/periodManagement";
+import reportDialog from "@/components/report-dialog/main";
+import { dateFormat } from "@/util/date";
+import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
+import _ from "lodash";
+export default {
+    name: "detailsPage",
+
+    data() {
+        return {
+            editButton: true,
+            selectionList: [],
+            bigObj: {},
+            form: {},
+            optionForm: {
+                menuBtn: false,
+                span: 6,
+                labelWidth: 90,
+                disabled: false,
+                column: [
+                    {
+                        label: '凭证类型',
+                        prop: "vkno",
+                        disabled: false,
+                    },
+                    {
+                        label: '汇兑损益科目',
+                        prop: "plAccFnm",
+                        disabled: false,
+                    },
+                    {
+                        label: '摘要',
+                        prop: "descr",
+                        disabled: false,
+                    }
+                ]
+            },
+            option: {},
+            optionList: {
+                disabled: false,
+                border: true,
+                align: 'center',
+                // index: true,
+                refreshBtn: false,
+                addBtn: false,
+                cellBtn: true,
+                addRowBtn: false,
+                editBtn: false,
+                delBtn: false,
+                menuWidth: 120,
+                menu: false,
+                tip: false,
+                selection: true,
+                column: [{
+                    label: '科目代码',
+                    prop: 'accNo',
+                    overHidden: true,
+                    display: false
+                }, {
+                    label: '科目名称',
+                    prop: 'cnm',
+                    overHidden: true,
+                    display: false
+                }, {
+                    label: '方向',
+                    prop: 'dc',
+                    overHidden: true,
+                    display: false
+                }, {
+                    label: '币种',
+                    prop: 'fcyNo',
+                    overHidden: true,
+                    display: false
+                }]
+            }
+        }
+    },
+    components: { SearchQuery, reportDialog },
+    props: {
+        onLoad: Object,
+        detailData: Object
+    },
+    async created() {
+        if (this.detailData.id) {
+            this.editButton = true
+            this.optionForm.disabled = true
+            this.getDetail(this.detailData.id, this.detailData.type)
+        }
+        this.option = await this.getColumnData(this.getColumnName(368), this.optionList);
+    },
+    methods: {
+        selectionChange(list) {
+            this.selectionList = list
+        },
+        //修改提交触发
+        submit() {
+            this.$refs["form"].validate((valid, done) => {
+                done();
+                if (valid) {
+                    const loading = this.$loading({
+                        lock: true,
+                        text: '加载中',
+                        spinner: 'el-icon-loading',
+                        background: 'rgba(255,255,255,0.7)'
+                    });
+                    let obj={
+                        ...this.bigObj,
+                        periodVouchersTemplate:this.form
+                    }
+                    submit(obj).then(res => {
+                        this.form = res.data.data
+                        this.$message.success("保存成功");
+                        this.editButton = true;
+                        this.getDetail(this.form.periodVouchersTemplate.id,this.form.periodVouchersTemplate.bsType)
+                    }).finally(() => {
+                        loading.close();
+                    });
+
+                } else {
+                    return false;
+                }
+            });
+        },
+        getDetail(id, type) {
+            const loading = this.$loading({
+                lock: true,
+                text: '加载中',
+                spinner: 'el-icon-loading',
+                background: 'rgba(255,255,255,0.7)'
+            })
+            getDetails({ id: id, type: type }).then(res => {
+                this.bigObj = res.data.data
+                this.form = res.data.data.periodVouchersTemplate
+                loading.close();
+            }).catch(() => {
+                loading.close();
+            })
+        },
+        importData() {
+            this.$confirm('是否导入科目明细总账?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                getAccountsItemsList({ type: this.form.bsType == 'FM-CURRENCY-PL-TRANSFER' ? 1 : 2 }).then(res => {
+                    this.form.accItems = res.data.data
+                    this.$message.success("导入成功");
+                }).finally(() => {
+                    this.form.accItems.forEach((e, index) => {
+                        if (e.selected == 'true') {
+                            this.$refs.crud.toggleRowSelection(e);
+                        }
+                    })
+                });
+            })
+        },
+        //自定义列保存
+        async saveColumnTwo(ref, option, optionBack, code) {
+            /**
+             * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+             * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+             * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+             */
+            const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+            if (inSave) {
+                this.$message.success("保存成功");
+                //关闭窗口
+                this.$refs[ref].$refs.dialogColumn.columnBox = false;
+            }
+        },
+        //自定义列重置
+        async resetColumnTwo(ref, option, optionBack, code) {
+            this[option] = this[optionBack];
+            const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+            if (inSave) {
+                this.$message.success("重置成功");
+                this.$refs[ref].$refs.dialogColumn.columnBox = false;
+            }
+        },
+        goBack(type) {
+            this.$emit("goBack", type);
+        },
+
+        // 弹框的重置
+        resetCrud() {
+            this.$message.success("重置成功");
+        },
+        // 弹窗的保存
+        saveCrud() {
+            this.$message.success("保存成功");
+        },
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+::v-deep .el-form-item {
+    margin-bottom: 8px !important;
+}
+</style>

+ 573 - 0
src/views/iosBasicData/periodManagement/index.vue

@@ -0,0 +1,573 @@
+<template>
+    <div>
+        <basic-container v-show="!detailsOpen">
+            <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
+                <el-tab-pane label="会计期间" name="first">
+                    <avue-crud :option="option" :search.sync="search" v-model="form" :table-loading="loading"
+                        :data="dataList" ref="crud" :key="key" @on-load="onLoad" @search-change="searchChange"
+                        @refresh-change="refreshChange" @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 366)"
+                        @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 366)" :page.sync="page">
+                        <template slot-scope="{type,size,row,index}" slot="menu">
+                            <el-button size="small" :type="type" :disabled="row.lockingStatus != 0"
+                                @click="lock(row, 1)">锁定</el-button>
+                            <el-button size="small" :type="type" :disabled="row.lockingStatus != 1 || row.isClosed != 0"
+                                @click="lock(row, 2)">撤销锁定</el-button>
+                            <el-button size="small" :type="type" :disabled="row.lockingStatus != 1 || row.isClosed != 0"
+                                @click="inClose(row, 1)">结转</el-button>
+                            <el-button size="small" :type="type" :disabled="row.isClosed != 1"
+                                @click="inClose(row, 2)">反结转</el-button>
+                        </template>
+                        <template slot-scope="{type,size,row,$index}" slot="menuLeft">
+                            <el-button type="success" size="small" @click="openDialog = true; title = '开账'" v-if="showBut">开
+                                账</el-button>
+                            <el-button type="success" size="small" @click="openDialog = true; title = '账套初始化'"
+                                v-if="!showBut">账套初始化</el-button>
+                        </template>
+                    </avue-crud>
+                </el-tab-pane>
+                <el-tab-pane label="月末结转" name="second">
+                    <avue-crud :option="option2" :search.sync="search2" v-model="form2" :table-loading="loading"
+                        :data="dataList2" ref="crud2" :key="key" @on-load="onLoad2" @search-change="searchChange2"
+                        @refresh-change="refreshChange2"
+                        @resetColumn="resetColumnTwo('crud2', 'option2', 'optionList2', 367)"
+                        @saveColumn="saveColumnTwo('crud2', 'option2', 'optionList2', 367)">
+                        <template slot-scope="{type,size,row,index}" slot="menu">
+                            <el-button size="small" :type="type" @click="editOpen(row)">模板修改</el-button>
+                            <el-button size="small" :type="type" @click="generate(row)">生成凭证</el-button>
+                        </template>
+                        <!-- <template slot-scope="{type,size,row,$index}" slot="menuLeft">
+                            <el-button icon="el-icon-plus" type="primary" size="small"
+                                @click="detailsOpen = true">新建申请</el-button>
+                        </template> -->
+                    </avue-crud>
+                </el-tab-pane>
+            </el-tabs>
+        </basic-container>
+        <detailsPage v-if="detailsOpen" @goBack="goBack" :onLoad="form" :detailData="detailData">
+        </detailsPage>
+        <el-dialog v-dialogdrag append-to-body :title="title" :visible.sync="openDialog" width="30%"
+            :before-close="handleClose">
+            <span v-if="title == '汇兑损益汇率' || '期间损益汇率'" style="display: flex;align-items: center;">
+                <avue-crud :data="itemData" :option="itemOption"></avue-crud>
+            </span>
+            <span v-else-if="title == '开账' || '账套初始化'" style="display: flex;align-items: center;">
+                开账日期:<avue-date size="small" type="datetime" v-model="openDate" format="yyyy-MM-dd HH:mm:ss"
+                    value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择开张日期"></avue-date>
+            </span>
+            <el-dialog v-dialogdrag append-to-body title="凭证明细" :visible.sync="itemOpenDialog" width="50%"
+                :before-close="handleClose2">
+                <span style="display: flex;align-items: center;">
+                    <avue-crud :data="itemForm2.finVouchersItemsList" :option="itemOption2"></avue-crud>
+                </span>
+                <span slot="footer" class="dialog-footer">
+                    <el-button size="mini" @click="itemOpenDialog = false">取 消</el-button>
+                    <el-button size="mini" type="primary" @click="onPeriod()">确 定</el-button>
+                </span>
+            </el-dialog>
+            <span slot="footer" class="dialog-footer">
+                <el-button size="mini" @click="openDialog = false">取 消</el-button>
+                <el-button v-if="title == '开账'" size="mini" type="primary" @click="onBill">确 定</el-button>
+                <el-button v-if="title == '账套初始化'" size="mini" type="primary" @click="resetBill">确 定</el-button>
+                <el-button v-if="title == '汇兑损益汇率' || '期间损益汇率'" size="mini" type="primary" @click="inPeriod">确 定</el-button>
+            </span>
+        </el-dialog>
+    </div>
+</template>
+  
+<script>
+import { getList, currentPeriod, open, init, locking, revokeLocking, close, unclose, generateVouchers, submitPeriod, getPeriodExchangeRate } from "@/api/iosBasicData/periodManagement";
+import detailsPage from "./detailsPage"
+import { defaultDate4 } from "@/util/date";
+
+export default {
+    name: "index",
+    components: {
+        detailsPage
+    },
+    data() {
+        return {
+            itemForm: {},
+            itemData: [],
+            itemOption: {
+                viewBtn: false,
+                editBtn: false,
+                delBtn: false,
+                addBtn: false,
+                index: false,
+                border: true,
+                menu: false,
+                header: false,
+                align: "center",
+                size: "small",
+                column: [
+                    {
+                        label: '币种代码',
+                        prop: 'curCode'
+                    }, {
+                        label: '币种名称',
+                        prop: 'curName'
+                    }, {
+                        label: '汇率日期',
+                        prop: 'curDate'
+                    }, {
+                        label: '汇率',
+                        prop: 'exrate',
+                        type: 'number',
+                        precision: 4,
+                        step: 4,
+                        cell: true
+                    }
+                ]
+            },
+            itemForm2:{},
+            itemOption2: {
+                viewBtn: false,
+                editBtn: false,
+                delBtn: false,
+                addBtn: false,
+                index: false,
+                border: true,
+                menu: false,
+                header: false,
+                align: "center",
+                size: "small",
+                column: [
+                    {
+                        label: '摘要',
+                        prop: 'descr',
+                        overHidden: true,
+                    },
+                    {
+                        label: '代码名称',
+                        prop: 'accountCode',
+                        overHidden: true,
+                    },
+                    {
+                        label: '本币金额',
+                        overHidden: true,
+                        children: [{
+                            label: '借方',
+                            prop: 'amountDr',
+                            overHidden: true,
+                        }, {
+                            label: '货方',
+                            prop: 'amountCr',
+                            overHidden: true,
+                        }]
+                    },
+                    {
+                        label: '外币金额',
+                        overHidden: true,
+                        children: [{
+                            label: '币种',
+                            prop: 'curCode',
+                            overHidden: true,
+                        }, {
+                            label: '汇率',
+                            prop: 'exrate',
+                            overHidden: true,
+                        }, {
+                            label: '借方',
+                            prop: 'amountDrUsd',
+                            overHidden: true,
+                        }, {
+                            label: '货方',
+                            prop: 'amountCrUsd',
+                            overHidden: true,
+                        }]
+                    }
+                ]
+            },
+            showBut: false,
+            title: '开账',
+            openDate: null,
+            openDialog: false,
+            itemOpenDialog: false,
+            activeName: 'first',
+            detailsOpen: false,
+            loading: false,
+            search: {
+                periodYear: defaultDate4()
+            },
+            form: {},
+            dataList: [],
+            detailData: {},
+            page: {
+                pageSize: 20,
+                currentPage: 1,
+                total: 0,
+                pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+            },
+            key: 0,
+            option: {},
+            optionList: {
+                viewBtn: false,
+                editBtn: false,
+                delBtn: false,
+                addBtn: false,
+                index: true,
+                span: 8,
+                border: true,
+                height: "auto",
+                searchMenuPosition: "right",
+                align: "center",
+                size: "small",
+                menuWidth: 200,
+                searchSpan: 8,
+                searchIcon: true,
+                searchIndex: 2,
+                dialogWidth: "70%",
+                column: [
+                    {
+                        label: '会计年度',
+                        prop: "periodYear",
+                        search: true,
+                        overHidden: true,
+                        hide: true,
+                        type: "year",
+                        valueFormat: "yyyy"
+                    },
+                    {
+                        label: '期间',
+                        prop: "periodDate",
+                        overHidden: true,
+                    },
+                    {
+                        label: '开始时间',
+                        prop: "beginDate",
+                        search: true,
+                        overHidden: true,
+                        type: "date",
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd 00:00:00"
+                    },
+                    {
+                        label: '结束时间',
+                        prop: "endDate",
+                        type: "date",
+                        overHidden: true,
+                        search: true,
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd 23:59:59"
+                    },
+                    {
+                        label: '结转状态',
+                        prop: "isClosed",
+                        type: 'select',
+                        overHidden: true,
+                        search: true,
+                        dicData: [
+                            {
+                                label: '未结转',
+                                value: 0,
+                            }, {
+                                label: '已结转',
+                                value: 1,
+                            }
+                        ]
+                    },
+                    {
+                        label: '结转时间',
+                        prop: "closeDate",
+                        searchProp: "closeDateList",
+                        overHidden: true,
+                        search: true,
+                        type: "date",
+                        searchRange: true,
+                        searchDefaultTime: ["00:00:00", "23:59:59"],
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd HH:mm:ss"
+                    }
+                ]
+            },
+            search2: {},
+            form2: {},
+            dataList2: [],
+            detailData2: {},
+            option2: {},
+            optionList2: {
+                viewBtn: false,
+                editBtn: false,
+                delBtn: false,
+                addBtn: false,
+                index: true,
+                span: 8,
+                border: true,
+                height: "auto",
+                searchMenuPosition: "right",
+                align: "center",
+                size: "small",
+                menuWidth: 200,
+                dialogWidth: "70%",
+                column: [
+                    {
+                        label: '结转凭证',
+                        prop: "descr",
+                        overHidden: true,
+                    },
+                    {
+                        label: '开始时间',
+                        prop: "date",
+                        overHidden: true,
+                    },
+                    {
+                        label: '状态',
+                        prop: "status",
+                        type: 'select',
+                        overHidden: true,
+                        dicData: [
+                            {
+                                label: '未结转',
+                                value: 0,
+                            }, {
+                                label: '已结转',
+                                value: 1,
+                            }
+                        ]
+                    }
+                ]
+            },
+        }
+    },
+    async created() {
+        this.option = await this.getColumnData(this.getColumnName(366), this.optionList);
+        this.option2 = await this.getColumnData(this.getColumnName(367), this.optionList2);
+    },
+    methods: {
+        lock(row, type) {
+            if (type == '1') {
+                this.$confirm('是否锁定?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    locking({ id: row.id }).then(res => {
+                        this.$message.success("锁定成功");
+                        this.handleClick(this.activeName)
+                    })
+                })
+            } else {
+                this.$confirm('是否撤销锁定?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    revokeLocking({ id: row.id }).then(res => {
+                        this.$message.success("撤销锁定");
+                        this.handleClick(this.activeName)
+                    })
+                })
+            }
+        },
+        inClose(row, type) {
+            if (type == '1') {
+                this.$confirm('是否结转?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    close({ id: row.id }).then(res => {
+                        this.$message.success("结转成功");
+                        this.handleClick(this.activeName)
+                    })
+                })
+            } else {
+                this.$confirm('是否反结转?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    unclose({ id: row.id }).then(res => {
+                        this.$message.success("反结转成功");
+                        this.handleClick(this.activeName)
+                    })
+                })
+            }
+        },
+        onBill() {
+            this.$confirm('确认开账?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                this.loading = true
+                open({ beginDate: this.openDate }).then(res => {
+                    this.$message.success("开账成功");
+                    this.handleClick(this.activeName)
+                    this.handleClose()
+                }).finally(() => {
+                    this.loading = false
+                })
+            })
+        },
+        handleClose() {
+            this.itemForm = {}
+            this.openDate = null
+            this.openDialog = false
+        },
+        handleClose2() {
+            this.itemData2 = []
+            this.itemOpenDialog = false
+        },
+        resetBill() {
+            this.$confirm('确认账套初始化?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                this.loading = true
+                init({ beginDate: this.openDate }).then(res => {
+                    this.$message.success("初始化成功");
+                    this.handleClick(this.activeName)
+                    this.handleClose()
+                }).finally(() => {
+                    this.loading = false
+                })
+            })
+        },
+        handleClick(val) {
+            if (val == 'first') {
+                this.onLoad(this.page, this.search)
+            } else {
+                this.onLoad2(this.search2)
+            }
+        },
+        goBack(type) {
+            this.form = {}
+            this.detailsOpen = false
+            this.onLoad(this.page, this.search)
+        },
+        editOpen(row, status) {
+            this.form = row
+            this.detailData = {
+                id: row.id,
+                type: row.bsType,
+                status: status
+            };
+            this.detailsOpen = true;
+        },
+        generate(row) {
+            this.openDialog = true;
+            this.itemForm = row;
+            this.title = row.bsType == 'FM-CURRENCY-PL-TRANSFER' ? '汇兑损益汇率' : '期间损益汇率';
+            getPeriodExchangeRate().then(res => {
+                res.data.data.forEach(e => {
+                    e.$cellEdit = true
+                })
+                this.itemData = res.data.data
+            })
+        },
+        inPeriod() {
+            let obj = {}
+            obj = { ...this.itemForm, exchangeRateList: this.itemData }
+            
+            generateVouchers(obj).then(res => {
+                console.log(res)
+                this.itemForm2=res.data.data
+                this.handleClose()
+                this.itemOpenDialog = true
+            })
+
+        },
+        onPeriod(){
+            if(this.itemForm2.finVouchersItemsList.length==0){
+                return this.$message.error("明细不能为空");
+            }
+            this.$confirm('确定保存凭证?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                this.loading = true
+                submitPeriod(this.itemForm2).then(res => {
+                    this.$message.success("保存成功");
+                    this.handleClose2()
+                }).finally(() => {
+                    this.loading = false
+                })
+            })
+            
+        },  
+        //刷新
+        refreshChange() {
+            this.onLoad(this.page, this.search)
+        },
+        searchChange(params, done) {
+            this.page.currentPage = 1
+            done();
+            this.onLoad(this.page, params)
+        },
+        onLoad(page, params = {}) {
+            console.log(params)
+            params = {
+                ...Object.assign(params, this.search),
+                current: page.currentPage,
+                size: page.pageSize,
+            }
+            this.loading = true
+            getList(params).then(res => {
+                this.dataList = res.data.data.records
+                this.page.total = res.data.data.total;
+                this.showBut = res.data.data.records.length == 0 ? true : false;
+                this.loading = false
+            }).finally(() => {
+                this.loading = false
+            })
+        },
+        //刷新
+        refreshChange2() {
+            this.onLoad2(this.search)
+        },
+        searchChange2(params, done) {
+            this.page.currentPage = 1
+            done();
+            this.onLoad(params)
+        },
+        onLoad2(page, params = {}) {
+            params = {
+                ...params
+            }
+            this.loading = true
+            currentPeriod(params).then(res => {
+                this.dataList2 = res.data.data
+                this.loading = false
+            }).finally(() => {
+                this.loading = false
+            })
+        },
+        //自定义列保存
+        async saveColumnTwo(ref, option, optionBack, code) {
+            /**
+             * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+             * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+             * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+             */
+            const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+            if (inSave) {
+                this.$message.success("保存成功");
+                //关闭窗口
+                this.$refs[ref].$refs.dialogColumn.columnBox = false;
+            }
+        },
+        //自定义列重置
+        async resetColumnTwo(ref, option, optionBack, code) {
+            this[option] = this[optionBack];
+            const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+            if (inSave) {
+                this.$message.success("重置成功");
+                this.$refs[ref].$refs.dialogColumn.columnBox = false;
+            }
+        }
+    }
+}
+</script>
+  
+<style scoped>
+.bottomBox {
+    padding: 3px 6px;
+    border-radius: 12px;
+    color: #fff;
+    font-size: 10px;
+}
+</style>
+  

+ 4 - 1
src/views/tirePartsMall/financialManagement/purchaseDetail/index.vue

@@ -1,7 +1,7 @@
 <template>
     <basic-container>
         <avue-crud :key="key" ref="crud" :option="option" :data="data" :search.sync="query" @on-load="onLoad"
-            @search-reset="query = {}" :page.sync="page" :cell-style="cellStyle" @search-change="searchChange"
+            @search-reset="resetChange" :page.sync="page" :cell-style="cellStyle" @search-change="searchChange"
             @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 337.2)"
             @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 337.2)">
             <template slot="menuLeft">
@@ -348,6 +348,9 @@ export default {
         })
     },
     methods: {
+        resetChange(){
+            this.query=this.$options.data().query
+        },
         cellStyle({ row, rowIndex }) {
             if (row.status == '已取消') {
                 return 'color: red';

+ 4 - 1
src/views/tirePartsMall/financialManagement/saleDetail/index.vue

@@ -1,7 +1,7 @@
 <template>
     <basic-container>
         <avue-crud :key="key" ref="crud" :option="option" :data="data" :search.sync="query" @on-load="onLoad"
-            @search-reset="query = {}" :page.sync="page" :cell-style="cellStyle" @search-change="searchChange"
+            @search-reset="resetChange" :page.sync="page" :cell-style="cellStyle" @search-change="searchChange"
             @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 337)"
             @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 337)">
             <template slot="menuLeft">
@@ -336,6 +336,9 @@ export default {
         })
     },
     methods: {
+        resetChange(){
+            this.query=this.$options.data().query
+        },
         cellStyle({ row, rowIndex }) {
             if (row.status == '已取消') {
                 return 'color: red';

Some files were not shown because too many files changed in this diff