add
This commit is contained in:
parent
7710bb6819
commit
99da64d0e6
9
src/api/contract_ledger.ts
Normal file
9
src/api/contract_ledger.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 财务管理--合同台账列表
|
||||
export function apiContractLedgerLists(params: any) {
|
||||
return request.get({
|
||||
url: "/cost_project.cost_approved_project/ledger",
|
||||
params,
|
||||
});
|
||||
}
|
@ -1,26 +1,49 @@
|
||||
import request from '@/utils/request'
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 待立项造价项目列表
|
||||
export function apiCostApprovedProjectLists(params: any) {
|
||||
return request.get({ url: '/cost_project.cost_approved_project/lists', params })
|
||||
return request.get({
|
||||
url: "/cost_project.cost_approved_project/lists",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 添加待立项造价项目
|
||||
export function apiCostApprovedProjectAdd(params: any) {
|
||||
return request.post({ url: '/cost_project.cost_approved_project/add', params })
|
||||
return request.post({
|
||||
url: "/cost_project.cost_approved_project/add",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 编辑待立项造价项目
|
||||
export function apiCostApprovedProjectEdit(params: any) {
|
||||
return request.post({ url: '/cost_project.cost_approved_project/edit', params })
|
||||
return request.post({
|
||||
url: "/cost_project.cost_approved_project/edit",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除待立项造价项目
|
||||
export function apiCostApprovedProjectDelete(params: any) {
|
||||
return request.post({ url: '/cost_project.cost_approved_project/delete', params })
|
||||
return request.post({
|
||||
url: "/cost_project.cost_approved_project/delete",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 待立项造价项目详情
|
||||
export function apiCostApprovedProjectDetail(params: any) {
|
||||
return request.get({ url: '/cost_project.cost_approved_project/detail', params })
|
||||
}
|
||||
return request.get({
|
||||
url: "/cost_project.cost_approved_project/detail",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 待立项造价项目列表
|
||||
export function apiCostApprovedProjectSerch(params: any) {
|
||||
return request.get({
|
||||
url: "/cost_project.cost_approved_project/datas",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
31
src/api/financial_invoice.ts
Normal file
31
src/api/financial_invoice.ts
Normal file
@ -0,0 +1,31 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 财务管理--开票台账列表
|
||||
export function apiFinancialInvoiceLists(params: any) {
|
||||
return request.get({ url: "/financial.financial_invoice/lists", params });
|
||||
}
|
||||
|
||||
// 添加财务管理--开票台账
|
||||
export function apiFinancialInvoiceAdd(params: any) {
|
||||
return request.post({ url: "/financial.financial_invoice/add", params });
|
||||
}
|
||||
|
||||
// 编辑财务管理--开票台账
|
||||
export function apiFinancialInvoiceEdit(params: any) {
|
||||
return request.post({ url: "/financial.financial_invoice/edit", params });
|
||||
}
|
||||
|
||||
// 删除财务管理--开票台账
|
||||
export function apiFinancialInvoiceDelete(params: any) {
|
||||
return request.post({ url: "/financial.financial_invoice/delete", params });
|
||||
}
|
||||
|
||||
// 财务管理--开票台账详情
|
||||
export function apiFinancialInvoiceDetail(params: any) {
|
||||
return request.get({ url: "/financial.financial_invoice/detail", params });
|
||||
}
|
||||
|
||||
// 财务管理--开票台账列表
|
||||
export function apiFinancialInvoiceSearch(params: any) {
|
||||
return request.get({ url: "/financial.financial_invoice/datas", params });
|
||||
}
|
26
src/api/financial_refund.ts
Normal file
26
src/api/financial_refund.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 财务管理--到账台账列表
|
||||
export function apiFinancialRefundLists(params: any) {
|
||||
return request.get({ url: '/financial.financial_refund/lists', params })
|
||||
}
|
||||
|
||||
// 添加财务管理--到账台账
|
||||
export function apiFinancialRefundAdd(params: any) {
|
||||
return request.post({ url: '/financial.financial_refund/add', params })
|
||||
}
|
||||
|
||||
// 编辑财务管理--到账台账
|
||||
export function apiFinancialRefundEdit(params: any) {
|
||||
return request.post({ url: '/financial.financial_refund/edit', params })
|
||||
}
|
||||
|
||||
// 删除财务管理--到账台账
|
||||
export function apiFinancialRefundDelete(params: any) {
|
||||
return request.post({ url: '/financial.financial_refund/delete', params })
|
||||
}
|
||||
|
||||
// 财务管理--到账台账详情
|
||||
export function apiFinancialRefundDetail(params: any) {
|
||||
return request.get({ url: '/financial.financial_refund/detail', params })
|
||||
}
|
26
src/api/financial_settlement.ts
Normal file
26
src/api/financial_settlement.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 财务管理--项目结算列表
|
||||
export function apiFinancialSettlementLists(params: any) {
|
||||
return request.get({ url: '/financial.financial_settlement/lists', params })
|
||||
}
|
||||
|
||||
// 添加财务管理--项目结算
|
||||
export function apiFinancialSettlementAdd(params: any) {
|
||||
return request.post({ url: '/financial.financial_settlement/add', params })
|
||||
}
|
||||
|
||||
// 编辑财务管理--项目结算
|
||||
export function apiFinancialSettlementEdit(params: any) {
|
||||
return request.post({ url: '/financial.financial_settlement/edit', params })
|
||||
}
|
||||
|
||||
// 删除财务管理--项目结算
|
||||
export function apiFinancialSettlementDelete(params: any) {
|
||||
return request.post({ url: '/financial.financial_settlement/delete', params })
|
||||
}
|
||||
|
||||
// 财务管理--项目结算详情
|
||||
export function apiFinancialSettlementDetail(params: any) {
|
||||
return request.get({ url: '/financial.financial_settlement/detail', params })
|
||||
}
|
@ -530,7 +530,6 @@ export const finance_payment_plan: Iconfig = {
|
||||
};
|
||||
|
||||
import { bankaccountLists } from "@/api/bank_account";
|
||||
|
||||
export const bank_account: Iconfig = {
|
||||
fetchFn: bankaccountLists,
|
||||
serchList: [
|
||||
@ -560,3 +559,28 @@ export const bank_account: Iconfig = {
|
||||
{ opening_amount: "期初金额" },
|
||||
],
|
||||
};
|
||||
|
||||
import { apiFinancialInvoiceLists } from "@/api/financial_invoice";
|
||||
|
||||
export const financial_invoice: Iconfig = {
|
||||
fetchFn: apiFinancialInvoiceLists,
|
||||
serchList: [
|
||||
{
|
||||
label: "开票编号",
|
||||
value: "invoice_type",
|
||||
},
|
||||
],
|
||||
tableList: [
|
||||
{ contract_name: "合同名称" },
|
||||
{ invoice_code: "开票编号" },
|
||||
{ apply_amount: "开票申请金额" },
|
||||
{ apply_company: "开票单位名称" },
|
||||
{ part_a: "甲方签约单位" },
|
||||
{ part_b: "乙方签约单位" },
|
||||
{ sign_money: "签订金额(元)" },
|
||||
{ sign_time: "签约时间" },
|
||||
{ invoice_type_text: "发票类型" },
|
||||
{ is_refund: "到账状态" },
|
||||
{ refund_amount: "到账金额" },
|
||||
],
|
||||
};
|
||||
|
147
src/views/contract_ledger/edit.vue
Normal file
147
src/views/contract_ledger/edit.vue
Normal file
@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-form-item label="合同id" prop="contract_id">
|
||||
<el-input v-model="formData.contract_id" clearable placeholder="请输入合同id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开票id" prop="invoice_id">
|
||||
<el-input v-model="formData.invoice_id" clearable placeholder="请输入开票id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="本次到账金额" prop="amount">
|
||||
<el-input v-model="formData.amount" clearable placeholder="请输入本次到账金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="到账日期" prop="date">
|
||||
<el-input v-model="formData.date" clearable placeholder="请输入到账日期" />
|
||||
</el-form-item>
|
||||
<el-form-item label="说明" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable placeholder="请输入说明" />
|
||||
</el-form-item>
|
||||
<el-form-item label="登记人" prop="create_user">
|
||||
<el-input v-model="formData.create_user" clearable placeholder="请输入登记人" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="financialRefundEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiFinancialRefundAdd, apiFinancialRefundEdit, apiFinancialRefundDetail } from '@/api/financial_refund'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑财务管理--到账台账' : '新增财务管理--到账台账'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
contract_id: '',
|
||||
invoice_id: '',
|
||||
amount: '',
|
||||
date: '',
|
||||
remark: '',
|
||||
create_user: '',
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
contract_id: [{
|
||||
required: true,
|
||||
message: '请输入合同id',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
invoice_id: [{
|
||||
required: true,
|
||||
message: '请输入开票id',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
amount: [{
|
||||
required: true,
|
||||
message: '请输入本次到账金额',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
date: [{
|
||||
required: true,
|
||||
message: '请输入到账日期',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
remark: [{
|
||||
required: true,
|
||||
message: '请输入说明',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
create_user: [{
|
||||
required: true,
|
||||
message: '请输入登记人',
|
||||
trigger: ['blur']
|
||||
}]
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiFinancialRefundDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiFinancialRefundEdit(data)
|
||||
: await apiFinancialRefundAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
137
src/views/contract_ledger/index.vue
Normal file
137
src/views/contract_ledger/index.vue
Normal file
@ -0,0 +1,137 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="合同名称" prop="contract_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_name" clearable placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同编号" prop="contract_num">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_num" clearable placeholder="请输入合同编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="甲方单位" prop="part_b">
|
||||
<el-input class="w-[280px]" v-model="queryParams.part_b" clearable placeholder="请输入甲方单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同类型" prop="contract_type">
|
||||
<el-input class="w-[280px]" v-model="queryParams.contract_type" clearable placeholder="请输入合同类型" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['financial.financial_refund/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['financial.financial_refund/delete']" :disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists">
|
||||
<el-table-column label="合同名称" prop="contract_name" :render-header="pager.calcWidth" />
|
||||
<el-table-column label="合同编号" prop="contract_num" :render-header="pager.calcWidth" />
|
||||
<el-table-column label="合同类型" prop="contract_type" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.cost_contract_type" :value="row.contract_type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="业务性质" prop="business_nature" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.cost_consultation_business_nature"
|
||||
:value="row.business_nature" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合同签订金额" prop="money" show-overflow-tooltip width="120" />
|
||||
<el-table-column label="甲方签约单位" prop="part_a" show-overflow-tooltip width="120" />
|
||||
<el-table-column label="签订部门" prop="dept" show-overflow-tooltip />
|
||||
<el-table-column label="已开票金额" prop="total_invoice_amount" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="已到账金额" prop="total_refund_amount" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="已结算金额" prop="total_settlement_amount" show-overflow-tooltip width="100" />
|
||||
<el-table-column label="合同结算日期" prop="settlement_date" show-overflow-tooltip width="120" />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['financial.financial_refund/edit']" type="primary" link
|
||||
@click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['financial.financial_refund/delete']" type="danger" link
|
||||
@click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- <edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" /> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="financialRefundLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiContractLedgerLists } from '@/api/contract_ledger'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
// import EditPopup from './edit.vue'
|
||||
|
||||
// const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// // 是否显示编辑框
|
||||
// const showEdit = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
contract_name: "",
|
||||
contract_name: '',
|
||||
part_b: '',
|
||||
contract_type: '',
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('cost_consultation_business_nature,cost_contract_type')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiContractLedgerLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// // 添加
|
||||
// const handleAdd = async () => {
|
||||
// showEdit.value = true
|
||||
// await nextTick()
|
||||
// editRef.value?.open('add')
|
||||
// }
|
||||
|
||||
// // 编辑
|
||||
// const handleEdit = async (data: any) => {
|
||||
// showEdit.value = true
|
||||
// await nextTick()
|
||||
// editRef.value?.open('edit')
|
||||
// editRef.value?.setFormData(data)
|
||||
// }
|
||||
|
||||
// // 删除
|
||||
// const handleDelete = async (id: number | any[]) => {
|
||||
// await feedback.confirm('确定要删除?')
|
||||
// await apiFinancialRefundDelete({ id })
|
||||
// getLists()
|
||||
// }
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
98
src/views/financial_invoice/detail.js
Normal file
98
src/views/financial_invoice/detail.js
Normal file
@ -0,0 +1,98 @@
|
||||
const detailConfig = {
|
||||
title: "财务管理--开票台账",
|
||||
config: [
|
||||
{
|
||||
label: "合同名称",
|
||||
value: "contract_name"
|
||||
},
|
||||
{
|
||||
label: "合同类型",
|
||||
value: "contract_type"
|
||||
},
|
||||
{
|
||||
label: "甲方签约单位",
|
||||
value: "part_a"
|
||||
},
|
||||
{
|
||||
label: "乙方签约单位",
|
||||
value: "part_b"
|
||||
},
|
||||
{
|
||||
label: "签订金额",
|
||||
value: "sign_money"
|
||||
},
|
||||
{
|
||||
label: "合同签订日期",
|
||||
value: "sign_time"
|
||||
},
|
||||
{
|
||||
label: "累计已开票(元)",
|
||||
value: "total_invoice_amount"
|
||||
},
|
||||
{
|
||||
label: "累计已到账(元)",
|
||||
value: "total_refund_amount"
|
||||
},
|
||||
{
|
||||
label: "开票编号",
|
||||
value: "invoice_code",
|
||||
},
|
||||
{
|
||||
label: "发票类型",
|
||||
value: "invoice_type_text",
|
||||
},
|
||||
{
|
||||
label: "开票申请金额",
|
||||
value: "apply_amount",
|
||||
},
|
||||
{
|
||||
label: "开票单位名称",
|
||||
value: "apply_company",
|
||||
},
|
||||
{
|
||||
label: "纳税人识别号",
|
||||
value: "apply_company_number",
|
||||
},
|
||||
{
|
||||
label: "开票单位注册地址",
|
||||
value: "apply_company_telephone",
|
||||
|
||||
},
|
||||
{
|
||||
label: "开户银行",
|
||||
value: "apply_company_bank",
|
||||
},
|
||||
|
||||
{
|
||||
label: "开户账号",
|
||||
value: "apply_company_account",
|
||||
},
|
||||
{
|
||||
label: "开票联系人",
|
||||
value: "apply_contact",
|
||||
},
|
||||
{
|
||||
label: "发票接收邮箱",
|
||||
value: "apply_email",
|
||||
},
|
||||
{
|
||||
label: "对应付款方式",
|
||||
value: "pay_type",
|
||||
},
|
||||
{
|
||||
label: "开票内容",
|
||||
value: "invoice_content",
|
||||
},
|
||||
{
|
||||
label: "创建人",
|
||||
value: "create_user",
|
||||
},
|
||||
{
|
||||
label: "创建时间",
|
||||
value: "create_time",
|
||||
},
|
||||
|
||||
]
|
||||
|
||||
}
|
||||
export default detailConfig;
|
335
src/views/financial_invoice/edit.vue
Normal file
335
src/views/financial_invoice/edit.vue
Normal file
@ -0,0 +1,335 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80vw" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="135px" :rules="formRules">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="contract_name">
|
||||
<el-input v-model="formData.contract_name" clearable placeholder="点击选择合同"
|
||||
@click="showDialog = true" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同类型">
|
||||
<el-input v-model="formData.contract_type" clearable placeholder="系统自动获取" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="甲方签约单位">
|
||||
<el-input v-model="formData.part_a" clearable placeholder="系统自动获取" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="乙方签约单位">
|
||||
<el-input v-model="formData.part_b" clearable placeholder="系统自动获取" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="签订金额(元)">
|
||||
<el-input v-model="formData.sign_money" clearable placeholder="系统自动获取" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同签订日期">
|
||||
<el-input v-model="formData.sign_time" clearable placeholder="系统自动获取" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="累计已开票(元)">
|
||||
<el-input v-model="formData.total_invoice_amount" clearable placeholder="系统自动获取" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="累计已到账(元)">
|
||||
<el-input v-model="formData.total_refund_amount" clearable placeholder="系统自动获取" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票编号" prop="invoice_code">
|
||||
<el-input v-model="formData.invoice_code" clearable placeholder="系统自动生成" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发票类型" prop="invoice_type">
|
||||
<el-select class="flex-1" v-model="formData.invoice_type" clearable placeholder="请选择发票类型">
|
||||
<el-option v-for="(item, index) in dictData.zjzx_invoice_type" :key="index"
|
||||
:label="item.name" :value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票申请金额" prop="apply_amount">
|
||||
<el-input v-model="formData.apply_amount" clearable placeholder="请输入开票申请金额" type="number" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票单位名称" prop="apply_company">
|
||||
<el-input v-model="formData.apply_company" clearable placeholder="请输入开票单位名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="纳税人识别号">
|
||||
<el-input v-model="formData.apply_company_number" clearable placeholder="请输入纳税人识别号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票单位注册地址">
|
||||
<el-input v-model="formData.apply_company_address" clearable placeholder="请输入开票单位注册地址" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票单位电话">
|
||||
<el-input v-model="formData.apply_company_telephone" clearable placeholder="请输入开票单位电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户银行">
|
||||
<el-input v-model="formData.apply_company_bank" clearable placeholder="请输入开户银行" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户账号">
|
||||
<el-input v-model="formData.apply_company_account" clearable placeholder="请输入开户账号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票联系人">
|
||||
<el-input v-model="formData.apply_contact" clearable placeholder="请输入开票联系人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发票接收邮箱" prop="apply_email">
|
||||
<el-input v-model="formData.apply_email" clearable placeholder="请输入发票接收邮箱" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="对应付款方式">
|
||||
<el-input v-model="formData.pay_type" clearable placeholder="请输入对应付款方式" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票内容">
|
||||
<el-input v-model="formData.invoice_content" clearable placeholder="请输入开票内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<createUserLable flag :formData="formData" />
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-dialog v-model="showDialog" title="选择合同" width="70%">
|
||||
<dialogTable :config="cost_approved_projects" @customEvent="customEvent">
|
||||
</dialogTable>
|
||||
</el-dialog>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="financialInvoiceEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiFinancialInvoiceAdd, apiFinancialInvoiceEdit, apiFinancialInvoiceDetail } from '@/api/financial_invoice'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
import { cost_approved_projects } from "@/components/dialogTable/dialogTableConfig";
|
||||
|
||||
|
||||
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const showDialog = ref(false)
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑财务管理--开票台账' : '新增财务管理--开票台账'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
contract_id: '',
|
||||
contract_name: "",
|
||||
invoice_code: '',
|
||||
invoice_type: '',
|
||||
apply_amount: '',
|
||||
apply_company: '',
|
||||
apply_company_number: '',
|
||||
apply_company_address: '',
|
||||
apply_company_telephone: '',
|
||||
apply_company_bank: '',
|
||||
apply_company_account: '',
|
||||
apply_contact: '',
|
||||
apply_email: '',
|
||||
pay_type: '',
|
||||
invoice_content: '',
|
||||
create_user: '',
|
||||
create_time: '',
|
||||
"contract_type": "",
|
||||
"part_a": "",
|
||||
"part_b": "",
|
||||
"sign_money": "",
|
||||
"sign_time": "",
|
||||
"total_invoice_amount": 0,
|
||||
"total_refund_amount": 0
|
||||
})
|
||||
|
||||
const customEvent = (e) => {
|
||||
formData.contract_id = e.id
|
||||
formData.contract_name = e.contract_name
|
||||
formData.contract_type = e.contract_type
|
||||
formData.part_a = e.part_a
|
||||
formData.part_b = e.part_b
|
||||
formData.sign_money = e.sign_money
|
||||
formData.sign_time = e.sign_time
|
||||
formData.total_invoice_amount = e.total_invoice_amount
|
||||
formData.total_refund_amount = e.total_refund_amount
|
||||
showDialog.value = false
|
||||
}
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
contract_name: [{
|
||||
required: true,
|
||||
message: '请选择合同',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
invoice_code: [{
|
||||
required: true,
|
||||
message: '请输入开票编号',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
invoice_type: [{
|
||||
required: true,
|
||||
message: '请输入发票类型',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
apply_amount: [{
|
||||
required: true,
|
||||
message: '请输入开票申请金额',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
apply_company: [{
|
||||
required: true,
|
||||
message: '请输入开票单位名称',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
apply_company_number: [{
|
||||
required: true,
|
||||
message: '请输入纳税人识别号',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
apply_company_address: [{
|
||||
required: true,
|
||||
message: '请输入开票单位注册地址',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
apply_company_telephone: [{
|
||||
required: true,
|
||||
message: '请输入开票单位电话',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
apply_company_bank: [{
|
||||
required: true,
|
||||
message: '请输入开户银行',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
apply_company_account: [{
|
||||
required: true,
|
||||
message: '请输入开户账号',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
apply_contact: [{
|
||||
required: true,
|
||||
message: '请输入开票联系人',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
apply_email: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入邮箱',
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
type: 'email',
|
||||
message: '请输入正确的邮箱',
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
],
|
||||
pay_type: [{
|
||||
required: true,
|
||||
message: '请输入对应付款方式',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
invoice_content: [{
|
||||
required: true,
|
||||
message: '请输入开票内容',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
create_user: [{
|
||||
required: true,
|
||||
message: '请输入开票申请人',
|
||||
trigger: ['blur']
|
||||
}]
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiFinancialInvoiceDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiFinancialInvoiceEdit(data)
|
||||
: await apiFinancialInvoiceAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
155
src/views/financial_invoice/index.vue
Normal file
155
src/views/financial_invoice/index.vue
Normal file
@ -0,0 +1,155 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="合同名称" prop="contract_id">
|
||||
<select-remote model="contract_id" :formData="queryParams"
|
||||
:api="apiCostApprovedProjectSerch"></select-remote>
|
||||
</el-form-item>
|
||||
<el-form-item label="开票编号" prop="invoice_code">
|
||||
<el-input class="w-[280px]" v-model="queryParams.invoice_code" clearable placeholder="请输入开票编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="发票类型" prop="invoice_type">
|
||||
<el-select class="flex-1" v-model="queryParams.invoice_type" clearable placeholder="请选择发票类型">
|
||||
<el-option v-for="(item, index) in dictData.zjzx_invoice_type" :key="index" :label="item.name"
|
||||
:value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="开票单位名称" prop="apply_company">
|
||||
<el-input class="w-[280px]" v-model="queryParams.apply_company" clearable placeholder="请输入开票单位名称" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['financial.financial_invoice/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['financial.financial_invoice/delete']" :disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="合同名称" prop="contract_name" :render-header="pager.calcWidth" />
|
||||
<el-table-column label="开票编号" prop="invoice_code" :render-header="pager.calcWidth" />
|
||||
|
||||
<el-table-column label="开票申请金额" prop="apply_amount" show-overflow-tooltip width="120" />
|
||||
<el-table-column label="开票单位名称" prop="apply_company" show-overflow-tooltip width="120" />
|
||||
<el-table-column label="甲方签约单位" prop="part_a" show-overflow-tooltip width="120" />
|
||||
<el-table-column label="乙方签约单位" prop="part_b" show-overflow-tooltip width="120" />
|
||||
<el-table-column label="签订金额(元)" prop="sign_money" width="150" />
|
||||
<el-table-column label="签约时间" prop="sign_time" show-overflow-tooltip width="120" />
|
||||
<el-table-column label="发票类型" prop="invoice_type_text" show-overflow-tooltip />
|
||||
<el-table-column label="到账状态" prop="is_refund" show-overflow-tooltip />
|
||||
<el-table-column label="到账金额" prop="refund_amount" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="170" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['financial.financial_invoice/edit']" type="primary" link
|
||||
@click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['financial.financial_invoice/delete']" type="danger" link
|
||||
@click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['financial.financial_invoice/detail']" link @click="handleDetail(row.id)">
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
<detailPage v-if="showDetail" ref="detailRef" @close="showDetail = false" :detailConfig="detailConfig" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="financialInvoiceLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiFinancialInvoiceLists, apiFinancialInvoiceDelete, apiFinancialInvoiceDetail } from '@/api/financial_invoice'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import { apiCostApprovedProjectSerch } from "@/api/cost_approved_project";
|
||||
import detailConfig from './detail'
|
||||
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
const detailRef = ref('')
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
const showDetail = ref(false)
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
contract_id: '',
|
||||
invoice_code: '',
|
||||
invoice_type: '',
|
||||
apply_company: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('zjzx_invoice_type')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiFinancialInvoiceLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
let res = await apiFinancialInvoiceDetail({ id: data.id })
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiFinancialInvoiceDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
// 详情
|
||||
const handleDetail = async (id: any) => {
|
||||
let res = await apiFinancialInvoiceDetail({ id })
|
||||
showDetail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
65
src/views/financial_refund/detail.js
Normal file
65
src/views/financial_refund/detail.js
Normal file
@ -0,0 +1,65 @@
|
||||
const detailConfig = {
|
||||
title: "财务管理--到账台账",
|
||||
config: [
|
||||
{
|
||||
label: "合同名称",
|
||||
value: "contract_name"
|
||||
},
|
||||
{
|
||||
label: "合同类型",
|
||||
value: "contract_type"
|
||||
},
|
||||
{
|
||||
label: "甲方签约单位",
|
||||
value: "part_a"
|
||||
},
|
||||
{
|
||||
label: "乙方签约单位",
|
||||
value: "part_b"
|
||||
},
|
||||
{
|
||||
label: "签订金额",
|
||||
value: "sign_money"
|
||||
},
|
||||
{
|
||||
label: "合同签订日期",
|
||||
value: "sign_time"
|
||||
},
|
||||
{
|
||||
label: "累计已开票(元)",
|
||||
value: "total_invoice_amount"
|
||||
},
|
||||
{
|
||||
label: "累计已到账(元)",
|
||||
value: "total_refund_amount"
|
||||
},
|
||||
{
|
||||
label: "开票台账编号",
|
||||
value: "invoice_code",
|
||||
},
|
||||
{
|
||||
label: "本次到账金额",
|
||||
value: "amount",
|
||||
},
|
||||
{
|
||||
label: "到账日期",
|
||||
value: "date",
|
||||
},
|
||||
{
|
||||
label: "说明",
|
||||
value: "remark",
|
||||
column: 1,
|
||||
},
|
||||
{
|
||||
label: "创建人",
|
||||
value: "create_user",
|
||||
},
|
||||
{
|
||||
label: "创建时间",
|
||||
value: "create_time",
|
||||
},
|
||||
|
||||
]
|
||||
|
||||
}
|
||||
export default detailConfig;
|
220
src/views/financial_refund/edit.vue
Normal file
220
src/views/financial_refund/edit.vue
Normal file
@ -0,0 +1,220 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="130px" :rules="formRules">
|
||||
<el-form-item label="合同名称" prop="contract_name">
|
||||
<el-input v-model="formData.contract_name" clearable placeholder="点击选择合同" @click="showDialog = true"
|
||||
readonly />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同类型">
|
||||
<el-input v-model="formData.contract_type" clearable placeholder="系统自动获取" disabled />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="甲方签约单位">
|
||||
<el-input v-model="formData.part_a" clearable placeholder="系统自动获取" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="乙方签约单位">
|
||||
<el-input v-model="formData.part_b" clearable placeholder="系统自动获取" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="签订金额(元)">
|
||||
<el-input v-model="formData.sign_money" clearable placeholder="系统自动获取" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同签订日期">
|
||||
<el-input v-model="formData.sign_time" clearable placeholder="系统自动获取" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="累计已开票(元)">
|
||||
<el-input v-model="formData.total_invoice_amount" clearable placeholder="系统自动获取" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="累计已到账(元)">
|
||||
<el-input v-model="formData.total_refund_amount" clearable placeholder="系统自动获取" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="开票台账编号" prop="invoice_code">
|
||||
<el-input v-model="formData.invoice_code" clearable placeholder="点击选择开票台账" readonly
|
||||
@click="showDialog1 = true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="本次到账金额" prop="amount">
|
||||
<el-input v-model="formData.amount" clearable placeholder="请输入本次到账金额" type="number" />
|
||||
</el-form-item>
|
||||
<el-form-item label="到账日期" prop="date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.date" clearable value-format="YYYY-MM-DD"
|
||||
placeholder="选择到账日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="说明" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable placeholder="请输入说明" type="textarea" />
|
||||
</el-form-item>
|
||||
<createUserLable :formData="formData" />
|
||||
</el-form>
|
||||
<el-dialog v-model="showDialog" title="选择合同" width="70%">
|
||||
<dialogTable :config="cost_approved_projects" @customEvent="customEvent">
|
||||
</dialogTable>
|
||||
</el-dialog>
|
||||
<div v-if="showDialog1">
|
||||
<el-dialog v-model="showDialog1" title="选择开票台账" width="70%">
|
||||
<dialogTable :config="financial_invoice" @customEvent="customEvent1"
|
||||
:query="{ contract_id: formData.contract_id }">
|
||||
</dialogTable>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="financialRefundEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiFinancialRefundAdd, apiFinancialRefundEdit, apiFinancialRefundDetail } from '@/api/financial_refund'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
import { cost_approved_projects, financial_invoice } from "@/components/dialogTable/dialogTableConfig";
|
||||
|
||||
|
||||
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const showDialog = ref(false)
|
||||
const showDialog1 = ref(false)
|
||||
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑财务管理--到账台账' : '新增财务管理--到账台账'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
contract_id: '',
|
||||
contract_name: '',
|
||||
invoice_id: '',
|
||||
invoice_code: '',
|
||||
amount: '',
|
||||
date: '',
|
||||
remark: '',
|
||||
create_user: '',
|
||||
create_time: '',
|
||||
"contract_type": "",
|
||||
"part_a": "",
|
||||
"part_b": "",
|
||||
"sign_money": "",
|
||||
"sign_time": "",
|
||||
"invoice_code": "",
|
||||
"apply_amount": "",
|
||||
"total_invoice_amount": 0,
|
||||
"total_refund_amount": 0
|
||||
})
|
||||
|
||||
const customEvent = (e) => {
|
||||
formData.contract_id = e.id
|
||||
formData.contract_name = e.contract_name
|
||||
formData.contract_type = e.contract_type
|
||||
formData.part_a = e.part_a
|
||||
formData.part_b = e.part_b
|
||||
formData.sign_money = e.sign_money
|
||||
formData.sign_time = e.sign_time
|
||||
formData.total_invoice_amount = e.total_invoice_amount
|
||||
formData.total_refund_amount = e.total_refund_amount
|
||||
showDialog.value = false
|
||||
}
|
||||
|
||||
const customEvent1 = (e) => {
|
||||
formData.invoice_id = e.id
|
||||
formData.invoice_code = e.invoice_code
|
||||
showDialog1.value = false
|
||||
}
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
contract_id: [{
|
||||
required: true,
|
||||
message: '请输入合同id',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
invoice_id: [{
|
||||
required: true,
|
||||
message: '请输入开票id',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
amount: [{
|
||||
required: true,
|
||||
message: '请输入本次到账金额',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
date: [{
|
||||
required: true,
|
||||
message: '请输入到账日期',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
remark: [{
|
||||
required: true,
|
||||
message: '请输入说明',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
create_user: [{
|
||||
required: true,
|
||||
message: '请输入登记人',
|
||||
trigger: ['blur']
|
||||
}]
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiFinancialRefundDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiFinancialRefundEdit(data)
|
||||
: await apiFinancialRefundAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
145
src/views/financial_refund/index.vue
Normal file
145
src/views/financial_refund/index.vue
Normal file
@ -0,0 +1,145 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="合同名称" prop="contract_id">
|
||||
<select-remote model="contract_id" :formData="queryParams"
|
||||
:api="apiCostApprovedProjectSerch"></select-remote>
|
||||
</el-form-item>
|
||||
<el-form-item label="开票台账编号" prop="invoice_id">
|
||||
<select-remote model="invoice_id" :formData="queryParams"
|
||||
:api="apiFinancialInvoiceSearch"></select-remote>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['financial.financial_refund/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['financial.financial_refund/delete']" :disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="合同名称" prop="contract_name" :render-header="pager.calcWidth" />
|
||||
<el-table-column label="开票编号" prop="invoice_code" :render-header="pager.calcWidth" />
|
||||
<el-table-column label="本次到账金额" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="到账日期" prop="date" show-overflow-tooltip />
|
||||
<el-table-column label="登记人" prop="create_user" show-overflow-tooltip />
|
||||
<el-table-column label="开票申请金额" prop="apply_amount" show-overflow-tooltip width="120" />
|
||||
<el-table-column label="甲方签约单位" prop="part_a" show-overflow-tooltip width="120" />
|
||||
<el-table-column label="乙方签约单位" prop="part_b" show-overflow-tooltip width="120" />
|
||||
<el-table-column label="说明" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="170" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['financial.financial_refund/edit']" type="primary" link
|
||||
@click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['financial.financial_refund/delete']" type="danger" link
|
||||
@click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['financial.financial_refund/detail']" link @click="handleDetail(row.id)">
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
<detailPage v-if="showDetail" ref="detailRef" @close="showDetail = false" :detailConfig="detailConfig" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="financialRefundLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiFinancialRefundLists, apiFinancialRefundDelete, apiFinancialRefundDetail } from '@/api/financial_refund'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import { apiCostApprovedProjectSerch } from "@/api/cost_approved_project";
|
||||
import { apiFinancialInvoiceSearch } from '@/api/financial_invoice'
|
||||
import detailConfig from './detail'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
const detailRef = ref('')
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
const showDetail = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
contract_id: '',
|
||||
invoice_id: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiFinancialRefundLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
let res = await apiFinancialRefundDetail({ id: data.id })
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiFinancialRefundDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
|
||||
// 详情
|
||||
const handleDetail = async (id: any) => {
|
||||
let res = await apiFinancialRefundDetail({ id })
|
||||
showDetail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
59
src/views/financial_settlement/detail.js
Normal file
59
src/views/financial_settlement/detail.js
Normal file
@ -0,0 +1,59 @@
|
||||
const detailConfig = {
|
||||
title: "财务管理--项目结算",
|
||||
config: [
|
||||
{
|
||||
label: "合同名称",
|
||||
value: "contract_name"
|
||||
},
|
||||
{
|
||||
label: "合同类型",
|
||||
value: "contract_type"
|
||||
},
|
||||
{
|
||||
label: "甲方签约单位",
|
||||
value: "part_a"
|
||||
},
|
||||
{
|
||||
label: "乙方签约单位",
|
||||
value: "part_b"
|
||||
},
|
||||
{
|
||||
label: "签订金额",
|
||||
value: "sign_money"
|
||||
},
|
||||
{
|
||||
label: "合同签订日期",
|
||||
value: "sign_time"
|
||||
},
|
||||
{
|
||||
label: "累计已开票(元)",
|
||||
value: "total_invoice_amount"
|
||||
},
|
||||
{
|
||||
label: "累计已到账(元)",
|
||||
value: "total_refund_amount"
|
||||
},
|
||||
{
|
||||
label: "结算金额",
|
||||
value: "amount",
|
||||
},
|
||||
{
|
||||
label: "结算日期",
|
||||
value: "date",
|
||||
},
|
||||
|
||||
{
|
||||
label: "结算备注",
|
||||
value: "remark",
|
||||
column: 1,
|
||||
},
|
||||
{
|
||||
label: "附件",
|
||||
value: "annex",
|
||||
column: 1,
|
||||
},
|
||||
|
||||
]
|
||||
|
||||
}
|
||||
export default detailConfig;
|
186
src/views/financial_settlement/edit.vue
Normal file
186
src/views/financial_settlement/edit.vue
Normal file
@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="140px" :rules="formRules">
|
||||
<el-form-item label="合同名称" prop="contract_name">
|
||||
<el-input v-model="formData.contract_name" clearable placeholder="点击选择合同" @click="showDialog = true"
|
||||
readonly />
|
||||
</el-form-item>
|
||||
<el-form-item label="甲方签约单位">
|
||||
<el-input v-model="formData.part_a" clearable placeholder="系统自动获取" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="乙方签约单位">
|
||||
<el-input v-model="formData.part_b" clearable placeholder="系统自动获取" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="签订金额(元)">
|
||||
<el-input v-model="formData.sign_money" clearable placeholder="系统自动获取" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同签订日期">
|
||||
<el-input v-model="formData.sign_time" clearable placeholder="系统自动获取" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="累计已开票(元)">
|
||||
<el-input v-model="formData.total_invoice_amount" clearable placeholder="系统自动获取" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="累计已到账(元)">
|
||||
<el-input v-model="formData.total_refund_amount" clearable placeholder="系统自动获取" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="结算金额" prop="amount">
|
||||
<el-input v-model="formData.amount" clearable placeholder="请输入结算金额" type="number" />
|
||||
</el-form-item>
|
||||
<el-form-item label="结算日期" prop="date">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.date" clearable value-format="YYYY-MM-DD"
|
||||
placeholder="选择结算日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结算备注" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable placeholder="请输入结算备注" type="textarea" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件" prop="annex">
|
||||
<uploadAnnex :formData="formData"></uploadAnnex>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-dialog v-model="showDialog" title="选择合同" width="70%">
|
||||
<dialogTable :config="cost_approved_projects" @customEvent="customEvent">
|
||||
</dialogTable>
|
||||
</el-dialog>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="financialSettlementEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiFinancialSettlementAdd, apiFinancialSettlementEdit, apiFinancialSettlementDetail } from '@/api/financial_settlement'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
import { cost_approved_projects } from "@/components/dialogTable/dialogTableConfig";
|
||||
|
||||
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const showDialog = ref(false)
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑财务管理--项目结算' : '新增财务管理--项目结算'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
contract_id: '',
|
||||
contract_name: '',
|
||||
amount: '',
|
||||
date: '',
|
||||
remark: '',
|
||||
annex: '',
|
||||
"contract_type": "",
|
||||
"part_a": "",
|
||||
"part_b": "",
|
||||
"sign_money": "",
|
||||
"sign_time": "",
|
||||
"invoice_code": "",
|
||||
"apply_amount": "",
|
||||
"total_invoice_amount": 0,
|
||||
"total_refund_amount": 0
|
||||
})
|
||||
|
||||
const customEvent = (e) => {
|
||||
formData.contract_id = e.id
|
||||
formData.contract_name = e.contract_name
|
||||
formData.contract_type = e.contract_type
|
||||
formData.part_a = e.part_a
|
||||
formData.part_b = e.part_b
|
||||
formData.sign_money = e.sign_money
|
||||
formData.sign_time = e.sign_time
|
||||
formData.total_invoice_amount = e.total_invoice_amount
|
||||
formData.total_refund_amount = e.total_refund_amount
|
||||
showDialog.value = false
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
contract_id: [{
|
||||
required: true,
|
||||
message: '请输入合同id',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
amount: [{
|
||||
required: true,
|
||||
message: '请输入结算金额',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
date: [{
|
||||
required: true,
|
||||
message: '请输入结算日期',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
remark: [{
|
||||
required: true,
|
||||
message: '请输入结算备注',
|
||||
trigger: ['blur']
|
||||
}]
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiFinancialSettlementDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiFinancialSettlementEdit(data)
|
||||
: await apiFinancialSettlementAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
141
src/views/financial_settlement/index.vue
Normal file
141
src/views/financial_settlement/index.vue
Normal file
@ -0,0 +1,141 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="合同名称" prop="contract_id">
|
||||
<select-remote model="contract_id" :formData="queryParams"
|
||||
:api="apiCostApprovedProjectSerch"></select-remote>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['financial.financial_settlement/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['financial.financial_settlement/delete']" :disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="合同名称" prop="contract_name" show-overflow-tooltip />
|
||||
<el-table-column label="合同类型" prop="contract_type" show-overflow-tooltip />
|
||||
<el-table-column label="结算金额" prop="amount" show-overflow-tooltip />
|
||||
<el-table-column label="结算日期" prop="date" show-overflow-tooltip />
|
||||
<el-table-column label="甲方签约单位" prop="part_a" show-overflow-tooltip width="120" />
|
||||
<el-table-column label="乙方签约单位" prop="part_b" show-overflow-tooltip width="120" />
|
||||
<el-table-column label="签订金额(元)" prop="sign_money" width="150" />
|
||||
<el-table-column label="签约时间" prop="sign_time" show-overflow-tooltip width="120" />
|
||||
<el-table-column label="已开票金额" prop="total_invoice_amount" show-overflow-tooltip />
|
||||
<el-table-column label="已到账金额" prop="total_refund_amount" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="170" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['financial.financial_settlement/edit']" type="primary" link
|
||||
@click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['financial.financial_settlement/delete']" type="danger" link
|
||||
@click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['financial.financial_settlement/detail']" link
|
||||
@click="handleDetail(row.id)">
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
<detailPage v-if="showDetail" ref="detailRef" @close="showDetail = false" :detailConfig="detailConfig" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="financialSettlementLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiFinancialSettlementLists, apiFinancialSettlementDelete, apiFinancialSettlementDetail } from '@/api/financial_settlement'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import { apiCostApprovedProjectSerch } from "@/api/cost_approved_project";
|
||||
import detailConfig from './detail'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
const detailRef = ref('')
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
const showDetail = ref(false)
|
||||
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
contract_id: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiFinancialSettlementLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
let res = await apiFinancialSettlementDetail({ id: data.id })
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiFinancialSettlementDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
// 详情
|
||||
const handleDetail = async (id: any) => {
|
||||
let res = await apiFinancialSettlementDetail({ id })
|
||||
showDetail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
@ -56,8 +56,10 @@
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="单位">
|
||||
<template #default="{ row }"> <el-input v-model="row.unit" />
|
||||
</template></el-table-column>
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.unit" @input="row.unit = row.unit.replace(/\d+/g, '')" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="预算金额">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.amount" type="number" />
|
||||
|
@ -71,7 +71,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="单位">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.unit" />
|
||||
<el-input v-model="row.unit" @input="row.unit = row.unit.replace(/\d+/g, '')" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prop="remark">
|
||||
|
@ -60,7 +60,7 @@
|
||||
|
||||
<el-table-column label="单位">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.unit" />
|
||||
<el-input v-model="row.unit" @input="row.unit = row.unit.replace(/\d+/g, '')" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
@ -58,7 +58,7 @@
|
||||
|
||||
<el-table-column label="单位">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.unit" />
|
||||
<el-input v-model="row.unit" @input="row.unit = row.unit.replace(/\d+/g, '')" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工作量">
|
||||
|
@ -304,6 +304,7 @@ interface SummaryMethodProps<T = Product> {
|
||||
data: T[]
|
||||
}
|
||||
const getSummaries = (param: SummaryMethodProps) => {
|
||||
// FIXME
|
||||
updateCost();
|
||||
if (formData && formData.contract_amount && project_amount.value) {
|
||||
project_amount.value = Number(formData.contract_amount) - Number(project_amount.value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user