From b6f2278fcbc32dd0af00d27679efa92c2cf5a53b Mon Sep 17 00:00:00 2001 From: weizong song Date: Mon, 5 Jan 2026 08:58:49 +0800 Subject: [PATCH] up --- rebuild.sh | 2 + src/api/payment.js | 83 ++++ src/components/ContractSignField.vue | 29 +- src/views/flow/create.vue | 614 +++++++++++++++++++++++++++ 错误诊断和解决方案.md | 2 + 5 files changed, 724 insertions(+), 6 deletions(-) create mode 100644 src/api/payment.js diff --git a/rebuild.sh b/rebuild.sh index a2b06bc..c1f4537 100644 --- a/rebuild.sh +++ b/rebuild.sh @@ -111,3 +111,5 @@ echo "" + + diff --git a/src/api/payment.js b/src/api/payment.js new file mode 100644 index 0000000..e360c5e --- /dev/null +++ b/src/api/payment.js @@ -0,0 +1,83 @@ +import request from '@/utils/request' + +/** + * 根据OA流程ID获取关联的支付列表 + * @param {number} oaFlowId - OA流程ID + * @param {object} params - 其他查询参数(如 status, keyword 等) + * @param {boolean} isLoading - 是否显示加载动画 + * @returns {Promise} + */ +export function getPaymentsByFlowId(oaFlowId, params = {}, isLoading = false) { + return request({ + method: 'get', + url: '/api/budget/payments', + params: { + oa_flow_id: oaFlowId, + ...params + }, + isLoading + }) +} + +/** + * 获取付款分类绑定的模板元素(用于还原非直接支付动态字段) + * 后端路由:GET /api/budget/payment-categories/{id}/template-elements + */ +export function getPaymentCategoryTemplateElements(categoryId, isLoading = false) { + return request({ + method: 'get', + url: `/api/budget/payment-categories/${categoryId}/template-elements`, + isLoading + }) +} + +/** + * 获取明细表格字段定义 + * 后端路由:GET /api/budget/detail-table-fields/{elementId} + */ +export function getDetailTableFields(elementId, isLoading = false) { + return request({ + method: 'get', + url: `/api/budget/detail-table-fields/${elementId}`, + isLoading + }) +} + +/** + * 获取非直接支出(账单)详情:包含 element_values(key 为 element_{id} 或 field_key) + * 后端路由:GET /api/budget/planned-expenditures/{id} + */ +export function getPlannedExpenditure(id, isLoading = false) { + return request({ + method: 'get', + url: `/api/budget/planned-expenditures/${id}`, + isLoading + }) +} + +/** + * 获取某个非直接支出分类下的模板(画布配置) + * 后端路由:GET /api/budget/planned-expenditure-templates/by-category/{categoryId} + */ +export function getPlannedExpenditureTemplatesByCategory(categoryId, isLoading = false) { + return request({ + method: 'get', + url: `/api/budget/planned-expenditure-templates/by-category/${categoryId}`, + isLoading + }) +} + +/** + * 批量获取 OA 流程详情(用于显示 no/title 而不是“流程ID”) + * 后端路由:POST /api/budget/oa-flow-details + * body: { flow_ids: number[] } + */ +export function getOaFlowDetails(flowIds, isLoading = false) { + return request({ + method: 'post', + url: '/api/budget/oa-flow-details', + data: { flow_ids: flowIds }, + isLoading + }) +} + diff --git a/src/components/ContractSignField.vue b/src/components/ContractSignField.vue index 6ac5078..fc9b37f 100644 --- a/src/components/ContractSignField.vue +++ b/src/components/ContractSignField.vue @@ -196,8 +196,8 @@ - - + + @@ -330,7 +330,8 @@ export default { purchase_category: "", handler_admin_ids: "", handler_admin_ids_array: [], - apply_handler_id: null, + apply_handler_id: "", + apply_handler_id_array: [], purchase_handler_id: null, owner_department_id: null, owner_department_ids: "", @@ -516,7 +517,8 @@ export default { purchase_category: "", handler_admin_ids: "", handler_admin_ids_array: [], - apply_handler_id: null, + apply_handler_id: "", + apply_handler_id_array: [], purchase_handler_id: null, owner_department_id: null, owner_department_ids: "", @@ -580,7 +582,7 @@ export default { this.form.perform_status = contractData.perform_status || ""; this.form.is_accepted = contractData.is_accepted || false; this.form.purchase_category = contractData.purchase_category || ""; - this.form.apply_handler_id = contractData.apply_handler_id || null; + this.form.apply_handler_id = contractData.apply_handler_id || ""; this.form.purchase_handler_id = contractData.purchase_handler_id || null; this.form.owner_department_id = contractData.owner_department_id || null; this.form.remark = contractData.remark || ""; @@ -606,6 +608,16 @@ export default { this.form.handler_admin_ids_array = []; } + // 处理申请科室经办人多选:转换为字符串数组(因为下拉组件的value是字符串) + if (contractData.apply_handler_id) { + const ids = typeof contractData.apply_handler_id === 'string' + ? contractData.apply_handler_id.split(',').filter(id => id) + : (Array.isArray(contractData.apply_handler_id) ? contractData.apply_handler_id : []); + this.form.apply_handler_id_array = ids.map(id => String(id)); + } else { + this.form.apply_handler_id_array = []; + } + // 处理附件 if (contractData.attachment_id && contractData.attachment) { this.attachmentFileList = [{ @@ -762,6 +774,11 @@ export default { ? this.form.handler_admin_ids_array.join(',') : (this.form.handler_admin_ids || ''); + // 申请科室经办人多选:将数组转换为逗号分隔的字符串 + const applyHandlerIds = Array.isArray(this.form.apply_handler_id_array) + ? this.form.apply_handler_id_array.filter(id => id).join(',') + : (this.form.apply_handler_id || ''); + // 处理金额:开口合同时,amount_total 应该为 null const amountTotal = this.form.amount_type === 'open' ? null : (this.form.amount_total || 0); @@ -793,7 +810,7 @@ export default { is_accepted: this.form.is_accepted || false, purchase_category: this.form.purchase_category || "", handler_admin_ids: handlerAdminIds, - apply_handler_id: this.form.apply_handler_id, + apply_handler_id: applyHandlerIds, purchase_handler_id: this.form.purchase_handler_id, owner_department_id: this.form.owner_department_id, owner_department_ids: ownerDepartmentIds, diff --git a/src/views/flow/create.vue b/src/views/flow/create.vue index f267646..41b4803 100644 --- a/src/views/flow/create.vue +++ b/src/views/flow/create.vue @@ -25,6 +25,237 @@ style="margin-bottom: 20px;" > + + +
+ 关联的支付信息 + + 共 {{ relatedPayments.length }} 条 + +
+
+ 暂无关联的支付信息 +
+ +
+ +
+ + +
+ 支付编号: + {{ payment.serial_number || '-' }} +
+
+ +
+ 支付状态: + + {{ payment.status_text || '-' }} + +
+
+
+ + +
+ 支付金额: + + ¥{{ formatAmount(payment.total_amount) }} + +
+
+ +
+ 支付日期: + {{ formatDate(payment.payment_date) || '-' }} +
+
+
+ + +
+ 支付类型: + {{ payment.payment_type_info.payment_type_text || '-' }} +
+
+ +
+ 支付分类: + {{ formatBreadcrumb(payment.payment_type_info) }} +
+
+
+ + +
+ 支付说明: + {{ payment.description }} +
+
+
+ +
+
支付明细:
+ + + + + + + + + + + +
+ + + +
+ 非直接支付相关信息 +
+ +
+ +
+ {{ (indirectExpenditureMap[d.expenditure_id] && indirectExpenditureMap[d.expenditure_id].title) || (d.expenditure && d.expenditure.title) }} +
+ + + + +
+
+ + +
+ 创建时间: + {{ formatDateTime(payment.created_at) || '-' }} +
+
+ +
+ 处理时间: + {{ formatDateTime(payment.processed_at) || '-' }} +
+
+
+
+
+
+ 加载中... +
+
+
@@ -332,6 +563,52 @@ frameborder="0" /> + + + + +
+