From ef1ca3769f8af093312131b16e1d5383b92c5aed Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Tue, 26 Mar 2024 18:01:39 +0800 Subject: [PATCH] add --- src/api/financial_budget_doc_detail.ts | 41 ++++ src/views/financial_budget_doc/detail.js | 84 ++++++++ src/views/financial_budget_doc/edit.vue | 189 ++++++++++++++---- src/views/financial_budget_doc/index.vue | 64 +++--- .../edit.vue | 2 +- 5 files changed, 315 insertions(+), 65 deletions(-) create mode 100644 src/api/financial_budget_doc_detail.ts create mode 100644 src/views/financial_budget_doc/detail.js diff --git a/src/api/financial_budget_doc_detail.ts b/src/api/financial_budget_doc_detail.ts new file mode 100644 index 0000000..1078e63 --- /dev/null +++ b/src/api/financial_budget_doc_detail.ts @@ -0,0 +1,41 @@ +import request from "@/utils/request"; + +// 财务管理--项目预算书列表 +export function apiFinancialBudgetDocDetailLists(params: any) { + return request.get({ + url: "/financial.financial_budget_doc_detail/lists", + params, + }); +} + +// 添加财务管理--项目预算书 +export function apiFinancialBudgetDocDetailAdd(params: any) { + return request.post({ + url: "/financial.financial_budget_doc_detail/add", + params, + }); +} + +// 编辑财务管理--项目预算书 +export function apiFinancialBudgetDocDetailEdit(params: any) { + return request.post({ + url: "/financial.financial_budget_doc_detail/edit", + params, + }); +} + +// 删除财务管理--项目预算书 +export function apiFinancialBudgetDocDetailDelete(params: any) { + return request.post({ + url: "/financial.financial_budget_doc_detail/delete", + params, + }); +} + +// 财务管理--项目预算书详情 +export function apiFinancialBudgetDocDetailDetail(params: any) { + return request.get({ + url: "/financial.financial_budget_doc_detail/detail", + params, + }); +} diff --git a/src/views/financial_budget_doc/detail.js b/src/views/financial_budget_doc/detail.js new file mode 100644 index 0000000..2a2545c --- /dev/null +++ b/src/views/financial_budget_doc/detail.js @@ -0,0 +1,84 @@ +import { apiFinancialBudgetDocDetailLists } from '@/api/financial_budget_doc_detail' + + +const detailConfig = { + title: "财务管理--项目预算书", + config: [ + { + label: "合同名称", + value: "contract_name" + }, + { + label: "合同类型", + value: "contract_type_text" + }, + { + label: "甲方签约单位", + value: "part_a" + }, + + { + label: "签订金额", + value: "money" + }, + { + label: "合同签订日期", + value: "create_date" + }, + { + label: "预算书名称", + value: "name" + }, + { + label: "下达日期", + value: "issue_date" + }, + { + label: "创建人", + value: "create_user" + }, + { + label: "创建时间", + value: "create_time" + }, + { + label: "备注", + value: "remark", + column: 1, + }, + { + label: "附件", + value: "annex", + column: 1, + }, + + ], + table: { + title: "发票明细", + tableConfig: [ + { + label: "部门", + value: 'dept_text', + + }, + { + label: "预算分成方式", + value: 'type_text' + }, + { + label: "预算分成金额", + value: 'amount', + }, + { + label: "备注", + value: 'remark', + }, + + + ], + query: 'budget_doc_id', + fetchFun: apiFinancialBudgetDocDetailLists, + } + +} +export default detailConfig; \ No newline at end of file diff --git a/src/views/financial_budget_doc/edit.vue b/src/views/financial_budget_doc/edit.vue index a92d896..4616f80 100644 --- a/src/views/financial_budget_doc/edit.vue +++ b/src/views/financial_budget_doc/edit.vue @@ -1,36 +1,112 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 发票明细 + + + + 暂无数据,点击添加 + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -39,8 +115,13 @@ import type { FormInstance } from 'element-plus' import Popup from '@/components/popup/index.vue' import { apiFinancialBudgetDocAdd, apiFinancialBudgetDocEdit, apiFinancialBudgetDocDetail } from '@/api/financial_budget_doc' +import { apiFinancialBudgetDocDetailLists, apiFinancialBudgetDocDetailDelete } from '@/api/financial_budget_doc_detail' import { timeFormat } from '@/utils/util' import type { PropType } from 'vue' +import { cost_approved_projects } from "@/components/dialogTable/dialogTableConfig"; +import { deptLists } from "@/api/org/department" + + defineProps({ dictData: { type: Object as PropType>, @@ -51,6 +132,8 @@ const emit = defineEmits(['success', 'close']) const formRef = shallowRef() const popupRef = shallowRef>() const mode = ref('add') +const showDialog = ref(false) + // 弹窗标题 @@ -62,15 +145,44 @@ const popupTitle = computed(() => { const formData = reactive({ id: '', contract_id: '', + contract_name: '', code: '', name: '', issue_date: '', remark: '', annex: '', create_user: '', + create_time: '', + detail: [], + "contract_type_text": "", + "part_a": "", + "money": "", + "create_date": "", }) +const handleAdd = (row) => { + // 在 row 后面插入一行数据 + formData.detail.push({}); +}; + +const handleDelete = async (row) => { + if (row.id) await apiFinancialBudgetDocDetailDelete({ id: row.id }) + // 删除 row + const index = formData.detail.indexOf(row); + formData.detail.splice(index, 1); +}; + +const customEvent = (e) => { + formData.contract_id = e.id + formData.contract_name = e.contract_name + formData.contract_type_text = e.contract_type_text + formData.part_a = e.part_a + formData.money = e.money + formData.create_date = e.create_date + showDialog.value = false +} + // 表单验证 const formRules = reactive({ contract_id: [{ @@ -114,8 +226,9 @@ const setFormData = async (data: Record) => { formData[key] = data[key] } } - - + let res = await apiFinancialBudgetDocDetailLists({ budget_doc_id: data.id }) + formData.detail = res.lists + } const getDetail = async (row: Record) => { @@ -129,9 +242,9 @@ const getDetail = async (row: Record) => { // 提交按钮 const handleSubmit = async () => { await formRef.value?.validate() - const data = { ...formData, } - mode.value == 'edit' - ? await apiFinancialBudgetDocEdit(data) + const data = { ...formData, } + mode.value == 'edit' + ? await apiFinancialBudgetDocEdit(data) : await apiFinancialBudgetDocAdd(data) popupRef.value?.close() emit('success') @@ -149,7 +262,13 @@ const handleClose = () => { } +const deptList = ref([]) +const getDeptList = async () => { + let res = await deptLists() + deptList.value = res.lists +} +getDeptList() defineExpose({ open, setFormData, diff --git a/src/views/financial_budget_doc/index.vue b/src/views/financial_budget_doc/index.vue index b6bc7d9..af1569e 100644 --- a/src/views/financial_budget_doc/index.vue +++ b/src/views/financial_budget_doc/index.vue @@ -1,13 +1,10 @@ - - - + + + @@ -28,38 +25,32 @@ 新增 - + 删除 - + + - + - + 编辑 - + 删除 + + 详情 + @@ -69,20 +60,26 @@ + + diff --git a/src/views/supervision_dangerous_engineering_case/edit.vue b/src/views/supervision_dangerous_engineering_case/edit.vue index 2f5dd53..2c54eb2 100644 --- a/src/views/supervision_dangerous_engineering_case/edit.vue +++ b/src/views/supervision_dangerous_engineering_case/edit.vue @@ -15,7 +15,7 @@ - +