|
|
@@ -19,10 +19,14 @@
|
|
|
: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>
|
|
|
+ -->
|
|
|
+ <el-button v-if="row.isClosed == 0" size="small" :type="type" @click="closePeriod(row, 1)">结转</el-button>
|
|
|
+ <el-button v-if="row.isClosed != 0" size="small" :type="type" @click="closePeriod(row, 2)">反结转</el-button>
|
|
|
</template>
|
|
|
<template slot-scope="{ type, size, row, $index }" slot="menuLeft">
|
|
|
<el-button
|
|
|
@@ -32,7 +36,7 @@
|
|
|
openDialog = true;
|
|
|
title = '开账';
|
|
|
"
|
|
|
- v-if="showBut"
|
|
|
+ v-if="!currentPeriod.isValid"
|
|
|
>开 账</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
@@ -42,12 +46,14 @@
|
|
|
openDialog = true;
|
|
|
title = '账套初始化';
|
|
|
"
|
|
|
- v-if="!showBut"
|
|
|
+ v-if="currentPeriod.isValid"
|
|
|
>账套初始化</el-button
|
|
|
>
|
|
|
+ <span v-if="currentPeriod.isValid">当前期间: {{ currentPeriod.period }} 账套开账期间: {{ currentPeriod.openPeriod.period }}</span>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</el-tab-pane>
|
|
|
+ <!--
|
|
|
<el-tab-pane label="月末结转" name="second">
|
|
|
<avue-crud
|
|
|
:option="option2"
|
|
|
@@ -67,12 +73,13 @@
|
|
|
<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">
|
|
|
+ <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> -->
|
|
|
+ </template>
|
|
|
</avue-crud>
|
|
|
</el-tab-pane>
|
|
|
+ -->
|
|
|
</el-tabs>
|
|
|
</basic-container>
|
|
|
<detailsPage v-if="detailsOpen" @goBack="goBack" :onLoad="form" :detailData="detailData"> </detailsPage>
|
|
|
@@ -116,7 +123,7 @@
|
|
|
<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="openPeriod">确 定</el-button>
|
|
|
- <el-button v-else-if="title == '账套初始化'" size="mini" type="primary" @click="resetBill">确 定</el-button>
|
|
|
+ <el-button v-else-if="title == '账套初始化'" size="mini" type="primary" @click="resetPeriod">确 定</el-button>
|
|
|
<el-button v-else-if="title == '汇兑损益汇率'" size="mini" type="primary" @click="inPeriod">确 定</el-button>
|
|
|
<el-button v-else-if="title == '期间损益汇率'" size="mini" type="primary" @click="inPeriod">确 定</el-button>
|
|
|
</span>
|
|
|
@@ -146,7 +153,7 @@
|
|
|
<script>
|
|
|
import {
|
|
|
getList,
|
|
|
- currentPeriod,
|
|
|
+ getCurrentPeriod,
|
|
|
init,
|
|
|
locking,
|
|
|
revokeLocking,
|
|
|
@@ -156,6 +163,9 @@ import {
|
|
|
submitPeriod,
|
|
|
getPeriodExchangeRate,
|
|
|
openPeriod,
|
|
|
+ getPeriodVouchersTemplate,
|
|
|
+ closePeriod,
|
|
|
+ initPeriod,
|
|
|
} from "@/api/iosBasicData/periodManagement";
|
|
|
import detailsPage from "./detailsPage";
|
|
|
import { defaultDate4 } from "@/util/date";
|
|
|
@@ -393,7 +403,9 @@ export default {
|
|
|
align: "center",
|
|
|
size: "small",
|
|
|
menuWidth: 200,
|
|
|
- searchSpan: 6,
|
|
|
+ searchShow: true,
|
|
|
+ // searchSpan: 4,
|
|
|
+ searchMenuSpan: 6,
|
|
|
searchIcon: true,
|
|
|
searchIndex: 3,
|
|
|
dialogWidth: "70%",
|
|
|
@@ -515,11 +527,24 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
+
|
|
|
+ currentPeriod: {
|
|
|
+ periodYear: 0,
|
|
|
+ periodMonth: 0,
|
|
|
+ period: "",
|
|
|
+ isValid: false,
|
|
|
+ openPeriod: {
|
|
|
+ periodYear: 0,
|
|
|
+ periodMonth: 0,
|
|
|
+ period: "",
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
|
this.option = await this.getColumnData(this.getColumnName(366), this.optionList);
|
|
|
this.option2 = await this.getColumnData(this.getColumnName(367), this.optionList2);
|
|
|
+ this.loadCurrentPeriod();
|
|
|
},
|
|
|
methods: {
|
|
|
exportExcel(type) {
|
|
|
@@ -537,47 +562,90 @@ export default {
|
|
|
this.handleClose4();
|
|
|
}
|
|
|
},
|
|
|
- lock(row, type) {
|
|
|
+ async loadCurrentPeriod() {
|
|
|
+ await getCurrentPeriod({ type: "open" }).then((res) => {
|
|
|
+ if (res.data.success && res.data.data) {
|
|
|
+ this.currentPeriod = res.data.data;
|
|
|
+ this.currentPeriod.isValid = this.currentPeriod.periodYear > 0;
|
|
|
+ this.currentPeriod.period =
|
|
|
+ this.currentPeriod.periodYear > 0 ? this.currentPeriod.periodYear + " 年 " + this.currentPeriod.periodMonth + " 月" : "";
|
|
|
+ if (this.currentPeriod.isValid) {
|
|
|
+ this.currentPeriod.openPeriod.period =
|
|
|
+ this.currentPeriod.openPeriod.periodYear > 0
|
|
|
+ ? this.currentPeriod.openPeriod.periodYear + " 年 " + this.currentPeriod.openPeriod.periodMonth + " 月"
|
|
|
+ : "";
|
|
|
+ } else {
|
|
|
+ this.currentPeriod.openPeriod = {
|
|
|
+ periodYear: 0,
|
|
|
+ periodMonth: 0,
|
|
|
+ period: "",
|
|
|
+ };
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.currentPeriod = {
|
|
|
+ periodYear: 0,
|
|
|
+ periodMonth: 0,
|
|
|
+ period: "",
|
|
|
+ isValid: false,
|
|
|
+ openPeriod: {
|
|
|
+ periodYear: 0,
|
|
|
+ periodMonth: 0,
|
|
|
+ period: "",
|
|
|
+ },
|
|
|
+ };
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ openPeriod() {
|
|
|
+ if (!this.openDate) {
|
|
|
+ return this.$message.warning("请选择开账月份!");
|
|
|
+ }
|
|
|
+ this.$confirm("确认开账?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ this.loading = true;
|
|
|
+ openPeriod({ beginDate: this.openDate + "-01 00:00:00" })
|
|
|
+ .then((res) => {
|
|
|
+ this.$message.success("开账成功");
|
|
|
+ this.handleClick(this.activeName);
|
|
|
+ this.handleClose();
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ closePeriod(row, type) {
|
|
|
if (type == "1") {
|
|
|
- this.$confirm("是否锁定?", "提示", {
|
|
|
+ this.$confirm("是否结转?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
|
}).then(() => {
|
|
|
this.loading = true;
|
|
|
- locking({ id: row.id })
|
|
|
+ closePeriod({ id: row.id })
|
|
|
.then((res) => {
|
|
|
- if (res.data.msg == "审核未通过") {
|
|
|
- this.loading = false;
|
|
|
- this.openDialog2 = true;
|
|
|
- this.itemId = row.id;
|
|
|
- this.dialogData = res.data.data;
|
|
|
- } else if (res.data.msg == "凭证未记账") {
|
|
|
- this.loading = false;
|
|
|
- this.openDialog3 = true;
|
|
|
- this.itemId = row.id;
|
|
|
- this.dialogData2 = res.data.data;
|
|
|
- } else {
|
|
|
- this.loading = false;
|
|
|
- this.$message.success("锁定成功");
|
|
|
- this.handleClick(this.activeName);
|
|
|
- }
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.success("结转成功");
|
|
|
+ this.handleClick(this.activeName);
|
|
|
})
|
|
|
.finally(() => {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
});
|
|
|
} else {
|
|
|
- this.$confirm("是否撤销锁定?", "提示", {
|
|
|
+ this.$confirm("是否反结转?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
|
}).then(() => {
|
|
|
this.loading = true;
|
|
|
- revokeLocking({ id: row.id })
|
|
|
+ unClosePeriod({ id: row.id })
|
|
|
.then((res) => {
|
|
|
this.loading = false;
|
|
|
- this.$message.success("撤销锁定");
|
|
|
+ this.$message.success("反结转成功");
|
|
|
this.handleClick(this.activeName);
|
|
|
})
|
|
|
.finally(() => {
|
|
|
@@ -586,35 +654,70 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- inClose(row, type) {
|
|
|
+ resetPeriod() {
|
|
|
+ if (!this.openDate) {
|
|
|
+ return this.$message.warning("请选择初始化月份!");
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$confirm("确认账套初始化?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ this.loading = true;
|
|
|
+ initPeriod({ beginDate: this.openDate + "-01 00:00:00" })
|
|
|
+ .then((res) => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.success("初始化成功");
|
|
|
+ this.handleClick(this.activeName);
|
|
|
+ this.handleClose();
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ lock(row, type) {
|
|
|
if (type == "1") {
|
|
|
- this.$confirm("是否结转?", "提示", {
|
|
|
+ this.$confirm("是否锁定?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
|
}).then(() => {
|
|
|
this.loading = true;
|
|
|
- close({ id: row.id })
|
|
|
+ locking({ id: row.id })
|
|
|
.then((res) => {
|
|
|
- this.loading = false;
|
|
|
- this.$message.success("结转成功");
|
|
|
- this.handleClick(this.activeName);
|
|
|
+ if (res.data.msg == "审核未通过") {
|
|
|
+ this.loading = false;
|
|
|
+ this.openDialog2 = true;
|
|
|
+ this.itemId = row.id;
|
|
|
+ this.dialogData = res.data.data;
|
|
|
+ } else if (res.data.msg == "凭证未记账") {
|
|
|
+ this.loading = false;
|
|
|
+ this.openDialog3 = true;
|
|
|
+ this.itemId = row.id;
|
|
|
+ this.dialogData2 = res.data.data;
|
|
|
+ } else {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.success("锁定成功");
|
|
|
+ this.handleClick(this.activeName);
|
|
|
+ }
|
|
|
})
|
|
|
.finally(() => {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
});
|
|
|
} else {
|
|
|
- this.$confirm("是否反结转?", "提示", {
|
|
|
+ this.$confirm("是否撤销锁定?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
|
}).then(() => {
|
|
|
this.loading = true;
|
|
|
- unclose({ id: row.id })
|
|
|
+ revokeLocking({ id: row.id })
|
|
|
.then((res) => {
|
|
|
this.loading = false;
|
|
|
- this.$message.success("反结转成功");
|
|
|
+ this.$message.success("撤销锁定");
|
|
|
this.handleClick(this.activeName);
|
|
|
})
|
|
|
.finally(() => {
|
|
|
@@ -623,27 +726,6 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- openPeriod() {
|
|
|
- if (!this.openDate) {
|
|
|
- return this.$message.warning("请选择开账月份!");
|
|
|
- }
|
|
|
- this.$confirm("确认开账?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }).then(() => {
|
|
|
- this.loading = true;
|
|
|
- openPeriod({ beginDate: this.openDate + "-01 00:00:00" })
|
|
|
- .then((res) => {
|
|
|
- this.$message.success("开账成功");
|
|
|
- this.handleClick(this.activeName);
|
|
|
- this.handleClose();
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
handleClose() {
|
|
|
this.itemForm = {};
|
|
|
this.openDate = null;
|
|
|
@@ -663,29 +745,6 @@ export default {
|
|
|
this.dialogData2 = [];
|
|
|
this.openDialog3 = false;
|
|
|
},
|
|
|
- resetBill() {
|
|
|
- if (!this.openDate) {
|
|
|
- return this.$message.warning("请选择初始化月份!");
|
|
|
- }
|
|
|
-
|
|
|
- this.$confirm("确认账套初始化?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }).then(() => {
|
|
|
- this.loading = true;
|
|
|
- init({ beginDate: this.openDate + "-01 00:00:00" })
|
|
|
- .then((res) => {
|
|
|
- this.loading = false;
|
|
|
- this.$message.success("初始化成功");
|
|
|
- this.handleClick(this.activeName);
|
|
|
- this.handleClose();
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
handleClick(val) {
|
|
|
if (val == "first") {
|
|
|
this.onLoad(this.page, this.search);
|
|
|
@@ -758,8 +817,8 @@ export default {
|
|
|
done();
|
|
|
this.onLoad(this.page, params);
|
|
|
},
|
|
|
- onLoad(page, params = {}) {
|
|
|
- console.log(params);
|
|
|
+ async onLoad(page, params = {}) {
|
|
|
+ await this.loadCurrentPeriod();
|
|
|
params = {
|
|
|
...Object.assign(params, this.search),
|
|
|
current: page.currentPage,
|
|
|
@@ -791,7 +850,7 @@ export default {
|
|
|
...params,
|
|
|
};
|
|
|
this.loading = true;
|
|
|
- currentPeriod(params)
|
|
|
+ getPeriodVouchersTemplate(params)
|
|
|
.then((res) => {
|
|
|
this.dataList2 = res.data.data;
|
|
|
this.loading = false;
|