增加凭证批量提交功能。
This commit is contained in:
@ -131,6 +131,17 @@ export function updateVoucherSuccessive(data: any): any {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量提交凭证
|
||||
* @param ids 凭证ID串
|
||||
*/
|
||||
export function submitBatch(ids: any): any {
|
||||
return request({
|
||||
url: '/voucher/submit/' + ids,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核凭证
|
||||
* @param ids
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import {parseTime} from "@/utils/Jinbooks"
|
||||
import {ref, defineProps} from "vue";
|
||||
import {ref} from "vue";
|
||||
|
||||
const version = ref(__APP_VERSION__)
|
||||
const time = ref(parseTime(new Date(), "{y}"))
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {computed, defineComponent, defineProps} from "vue"
|
||||
import {computed, defineComponent} from "vue"
|
||||
import {isExternal} from '@/utils/Validate'
|
||||
|
||||
const props = defineProps({
|
||||
|
||||
@ -58,7 +58,12 @@
|
||||
@click="handleAdd"
|
||||
>{{ t('org.button.add') }}
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
type="success"
|
||||
:disabled="ids.length === 0"
|
||||
@click="handleSubmit"
|
||||
>提交
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
:disabled="ids.length === 0"
|
||||
@ -95,13 +100,14 @@
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="凭证字" align="left" header-align="center" prop="word" width="150" fixed="left"/>
|
||||
<!-- <el-table-column label="公司名称" align="center" prop="companyName" width="150"/>-->
|
||||
<el-table-column label="备注" align="left" header-align="center" prop="remark" width="280" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="借方总额" align="right" header-align="center" prop="debitAmount" width="120">
|
||||
<el-table-column label="备注" align="left" header-align="center" prop="remark" width="280"
|
||||
:show-overflow-tooltip="true"/>
|
||||
<el-table-column label="借方总额" align="right" header-align="center" prop="debitAmount" width="120">
|
||||
<template #default="scope">
|
||||
{{ formatAmount(scope.row.debitAmount) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="贷方总额" align="right" header-align="center" prop="creditAmount" width="120">
|
||||
<el-table-column label="贷方总额" align="right" header-align="center" prop="creditAmount" width="120">
|
||||
<template #default="scope">
|
||||
{{ formatAmount(scope.row.creditAmount) }}
|
||||
</template>
|
||||
@ -114,7 +120,7 @@
|
||||
<el-table-column label="附单据" align="center" prop="receiptNum"/>
|
||||
<el-table-column label="结转" align="center" prop="carryForward">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.carryForward === 'y'">是</span>
|
||||
<span v-if="scope.row.carryForward === 'y'">是</span>
|
||||
<span v-if="scope.row.carryForward === 'n'">否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -419,6 +425,22 @@ function submitForm(res) {
|
||||
}
|
||||
}
|
||||
|
||||
function handleSubmit(row) {
|
||||
const _ids = row.id || ids.value.join(",");
|
||||
const idList = _ids.split(",")
|
||||
const submitIds = booksVoucherList.value.filter(item => {
|
||||
return idList.indexOf(item.id) > -1 && 'draft' === item.status
|
||||
}).map(item => item.id)
|
||||
if (!submitIds.length) {
|
||||
proxy.$modal.msgError("没有可以提交的凭证项。");
|
||||
return
|
||||
}
|
||||
voucherApis.submitBatch(submitIds).then(res => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("操作成功")
|
||||
})
|
||||
}
|
||||
|
||||
function handleAudit(row) {
|
||||
const _ids = row.id || ids.value.join(",");
|
||||
proxy.$modal.confirm('确认审核"' + _ids + '"等凭证?').then(function () {
|
||||
|
||||
Reference in New Issue
Block a user