|
@@ -5,6 +5,7 @@
|
|
|
:table-loading="loading"
|
|
|
:data="data"
|
|
|
:page.sync="page"
|
|
|
+ :search.sync="query"
|
|
|
:permission="permissionList"
|
|
|
:before-open="beforeOpen"
|
|
|
v-model="form"
|
|
@@ -39,6 +40,11 @@
|
|
|
size="small"
|
|
|
plain @click.stop="voucherAccountingfun" >凭证记账
|
|
|
</el-button>
|
|
|
+ <el-button type="danger"
|
|
|
+ size="small"
|
|
|
+ plain
|
|
|
+ @click="revokeFinVouchersfun">撤销记账
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
<template slot="menu" slot-scope="{row}">
|
|
|
<el-button type="text"
|
|
@@ -60,7 +66,13 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {finvouchersList, finvouchersDetail, finvouchersSubmit, finvouchersRemove} from "@/api/iosBasicData/finvouchers";
|
|
|
+import {
|
|
|
+ finvouchersList,
|
|
|
+ finvouchersDetail,
|
|
|
+ finvouchersSubmit,
|
|
|
+ finvouchersRemove,
|
|
|
+ confirmFinVouchers, revokeFinVouchers
|
|
|
+} from "@/api/iosBasicData/finvouchers";
|
|
|
import {mapGetters} from "vuex";
|
|
|
import finvouchersitems from "@/views/iosBasicData/finvouchers/finvouchersitems.vue";
|
|
|
import finstlbillsDetails from "@/views/iosBasicData/finstlbills/finstlbillsDetails.vue";
|
|
@@ -130,6 +142,28 @@
|
|
|
prop: "voucherDate",
|
|
|
overHidden:true,
|
|
|
},
|
|
|
+ {
|
|
|
+ label: "凭证开始日期",
|
|
|
+ prop: "voucherDateStart",
|
|
|
+ search:true,
|
|
|
+ overHidden:true,
|
|
|
+ searchLabelWidth:"100",
|
|
|
+ hide:true,
|
|
|
+ type: "date",
|
|
|
+ format: "yyyy-MM-dd",
|
|
|
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "凭证结束日期",
|
|
|
+ prop: "voucherDateEnd",
|
|
|
+ search:true,
|
|
|
+ overHidden:true,
|
|
|
+ searchLabelWidth:"100",
|
|
|
+ hide:true,
|
|
|
+ type: "date",
|
|
|
+ format: "yyyy-MM-dd",
|
|
|
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
+ },
|
|
|
{
|
|
|
label: "财务年",
|
|
|
prop: "accountYear",
|
|
@@ -279,6 +313,7 @@
|
|
|
this.voucherStatusWorkDictsfun()
|
|
|
},
|
|
|
methods: {
|
|
|
+ revokeFinVouchers,
|
|
|
// 获取字典数据
|
|
|
voucherStatusWorkDictsfun(){
|
|
|
getWorkDicts("voucher_status_los").then(res => {
|
|
@@ -300,7 +335,59 @@
|
|
|
this.$message.warning("请选择至少一条数据");
|
|
|
return;
|
|
|
}
|
|
|
- console.log(this.selectionList,'凭证记账选择数据')
|
|
|
+ if (this.selectionList.length === 1) {
|
|
|
+ if (this.selectionList[0].voucherStatus == 1) {
|
|
|
+ return this.$message.warning("请选择还未记账的数据");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$confirm("确定将选择数据进行记账?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(()=>{
|
|
|
+ let arrids = this.selectionList.map(item=>{
|
|
|
+ if (item.voucherStatus == 0) {
|
|
|
+ return item.id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ confirmFinVouchers({ids:arrids.join(',')}).then(res=>{
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ this.onLoad(this.page, this.query);
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 撤销记账
|
|
|
+ revokeFinVouchersfun(){
|
|
|
+ if (this.selectionList.length === 0) {
|
|
|
+ this.$message.warning("请选择至少一条数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.selectionList.length === 1) {
|
|
|
+ if (this.selectionList[0].voucherStatus == 0) {
|
|
|
+ return this.$message.warning("请选择已记账的数据");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$confirm("确定将选择数据撤销记账?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(()=>{
|
|
|
+ let arrids = this.selectionList.map(item=>{
|
|
|
+ if (item.voucherStatus == 1) {
|
|
|
+ return item.id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ revokeFinVouchers({ids:arrids.join(',')}).then(res=>{
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ this.onLoad(this.page, this.query);
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
// 新建凭证
|
|
|
addbtnfun(){
|
|
@@ -323,7 +410,7 @@
|
|
|
});
|
|
|
}
|
|
|
this.isShow = true;
|
|
|
- this.onLoad(this.page, this.search);
|
|
|
+ this.onLoad(this.page, this.query);
|
|
|
},
|
|
|
|
|
|
rowSave(row, done, loading) {
|
|
@@ -406,7 +493,7 @@
|
|
|
searchChange(params, done) {
|
|
|
this.query = params;
|
|
|
this.page.currentPage = 1;
|
|
|
- this.onLoad(this.page, params);
|
|
|
+ this.onLoad(this.page, this.query);
|
|
|
done();
|
|
|
},
|
|
|
selectionChange(list) {
|