- {{ field.name }}
+ {{ field.name }}
- {{ field.label }}
+ {{ field.label }}
{{ getTypeDisplay(field.type) }}
@@ -78,27 +78,28 @@
-
+
-
+
-
+
@@ -108,15 +109,21 @@
-
+
-
-
- 取消
- 保存
+
@@ -129,81 +136,498 @@ export default {
formatType: 'html',
codeContent: '',
showEditDrawer: false,
- editForm: {
- name: '',
- label: '',
- type: 'text',
- options: ''
- },
- fieldList: [
+ currentTemplateIndex: 4,
+ templates: [
{
- name: 'projectName',
- label: '项目名称',
- type: 'text',
- options: ''
+ name: '报销贴单',
+ content: `
+
+
+
苏州市河道管理处报销贴单
+
+ 科室:{{department}}
+ {{year}}年{{month}}月{{day}}日
+
+
+
+
+ | 职工姓名 |
+ {{name}} |
+ 退休/在职 |
+ {{status}} |
+ 家属姓名 |
+ {{familyName}} |
+ 与本人关系 |
+ {{relation}} |
+
+
+ | 内容 |
+ 发票金额 |
+ 报销比例 |
+ {{medicalActualAmount}} |
+ 报销(领款)人 |
+ {{name}} |
+
+
+ | 门诊医药费 |
+ {{medicalInvoiceValue}} |
+ {{medicalReimbursementRatio}} |
+ {{medicalActualAmount}} |
+
+
+ | 住院医药费 |
+ {{hospitalInvoiceValue}} |
+ {{hospitalReimbursementRatio}} |
+ {{hospitalActualAmount}} |
+ 科室负责人 |
+ {{departmentHead}} |
+
+
+ | 儿童医药费 |
+ {{childMedicalInvoiceValue}} |
+ {{childMedicalReimbursementRatio}} |
+ {{childMedicalActualAmount}} |
+ 财审科审核 |
+ {{financialAudit}} |
+
+
+ | 幼托费用 |
+ {{childcareInvoiceValue}} |
+ 无 |
+ {{childcareActualAmount}} |
+ 分管领导审核 |
+ {{leaderAudit}} |
+
+
+ | 子女保险费 |
+ {{childInsuranceInvoiceValue}} |
+ 无 |
+ {{childInsuranceActualAmount}} |
+ 财务分管领导审核 |
+ {{financialLeaderAudit}} |
+
+
+ | 合计 |
+ {{totalAmount}} |
+ 单位负责人审批 |
+ {{unitLeaderAudit}} |
+
+
+ | 报销金额(大写) |
+ {{upperCaseAmount}} |
+
+
+
+
+
`
},
{
- name: 'budgetAmount',
- label: '预算金额',
- type: 'number',
- options: ''
+ name: '公务接待结算单',
+ content: `
+
+
+
苏州市河道管理处公务接待结算单
+
+
+
+ | 科室 |
+ {{department}} |
+ 事由 |
+ {{reason}} |
+
+
+ | 日期 |
+ {{date}} |
+ 就餐地点 |
+ {{diningLocation}} |
+
+
+ | 就餐人数 |
+ 接待人数 |
+ {{visitorCount}} |
+ 金额(元) |
+ 餐费 |
+ {{mealsFee}} |
+
+
+ | 陪同人数 |
+ {{accompanyCount}} |
+ 住宿费 |
+ {{accommodationFee}} |
+
+
+ | 科室经办人 |
+ {{handler}} |
+ 综合科意见 |
+ {{comprehensiveOpinion}} |
+
+
+ | 分管领导意见 |
+ {{leaderOpinion}} |
+
+
+ | 备注 |
+ {{remark}} |
+
+
+
+
+
`
},
{
- name: 'paymentDate',
- label: '支付日期',
- type: 'date',
- options: ''
+ name: '会议审批表',
+ content: `
+
+
苏州市河道管理处会议审批表
+
+
+ {{year}}年
+ {{month}}月
+ {{day}}日
+
+
+
+
+
+ | 申请部门 |
+ {{department}} |
+
+
+ | 会议名称 |
+ {{meetingName}} |
+
+
+ | 会议类别 |
+ ({{meetingType}})类会议 |
+
+
+ | 会议起止日期及天数 |
+ {{duration}} |
+
+
+ | 会议地点 |
+ {{location}} |
+
+
+ | 会议规模 |
+ 代表人数:{{representativeCount}} 工作人员数:{{staffCount}} |
+
+
+ | 会议经费预算(元) |
+ {{totalBudget}} |
+
+
+ | 其中:住宿费 |
+ {{accommodationFee}} |
+
+
+ | 伙食费 |
+ {{mealsFee}} |
+
+
+ | 租场费 |
+ {{venueFee}} |
+
+
+ | 其他费用 |
+ {{otherFees}} |
+
+
+ | 科室负责人审核 |
+ {{departmentApproval}} |
+
+
+ | 分管领导审核 |
+ {{sectionApproval}} |
+
+
+ | 综合科审核 |
+ {{comprehensiveApproval}} |
+
+
+ | 单位负责人审核 |
+ {{unitApproval}} |
+
+
+
+
`
},
{
- name: 'paymentType',
- label: '支付方式',
- type: 'select',
- options: '现金,银行转账,支票,其他'
+ name: '公务接待申请单',
+ content: `
+
+
+
苏州市河道管理处公务接待申请单
+
+
+
+ | 申请科室 |
+ {{department}} |
+ 申请理由 |
+ {{reason}} |
+
+
+ | 申请日期 |
+ {{applyDate}} |
+ |
+
+
+ | 预计就餐人数 |
+ 接待人数 |
+ {{visitorCount}} |
+ 预计金额 (元) |
+ 餐费 |
+ {{mealsFee}} |
+
+
+ | 陪同人数 |
+ {{accompanyCount}} |
+ 住宿费 |
+ {{accommodationFee}} |
+
+
+ | 科室经办人 |
+ {{handler}} |
+ 综合科意见 |
+ {{comprehensiveOpinion}} |
+
+
+ | 分管领导意见 |
+ {{leaderOpinion}} |
+
+
+ | 备注 |
+ {{remark}} |
+
+
+
+
+
`
},
{
- name: 'isUrgent',
- label: '是否加急',
- type: 'checkbox',
- options: ''
+ name: '水电费结算单',
+ content: `
+
+
+
水电费结算单
+
+
+
+ | 费用发生地点: |
+ {{location}} |
+
+
+ | 上期读数 |
+ {{previousReading}} |
+ 实际使用水/电量 |
+ {{usageAmount}} |
+
+
+ | 年 月 日读数 |
+ {{currentReading}} |
+ 水/电费单价 |
+ {{unitPrice}} |
+
+
+ | 总费用 |
+ {{totalAmount}}元 |
+ 大写: |
+ {{amountInWords}} |
+
+
+ | 借水/电单位 |
+ {{borrower}} |
+ 经办人 |
+ {{handler}} |
+
+
+ | 经办科室 |
+ {{department}} |
+ 科室负责人 |
+ {{departmentHead}} |
+
+
+ | 发票预留电话 |
+ {{phone}} |
+ 分管领导 |
+ {{leader}} |
+
+
+
+
+
+ 申请日期:{{applyDate}}
+
+
+
+
`
},
{
- name: 'approvalStatus',
- label: '审批状态',
- type: 'radio',
- options: '待审批,已通过,已拒绝'
+ name: '报销贴单简易版',
+ content: `
+
+
+
苏州市河道管理处报销贴单
+
+
+
+ | 科室:{{department}} |
+ {{year}}年{{month}}月{{day}}日 |
+
+
+
+
+
+
+ | 用途说明 |
+ 金额 |
+ 附单据{{receiptCount}}张 |
+
+
+ | {{purpose1}} |
+ {{amount1}} |
+
+
+ | {{purpose2}} |
+ {{amount2}} |
+
+
+ | {{purpose3}} |
+ {{amount3}} |
+
+
+ | {{purpose4}} |
+ {{amount4}} |
+
+
+ | {{purpose5}} |
+ {{amount5}} |
+
+
+ | 合计 |
+ {{totalAmount}} |
+
+
+ | 报销金额(大写) |
+ {{amountInWords}} |
+
+
+
+
+
+
+ | 报销(领款)人 |
+ {{applicant}} |
+
+
+ | 科室负责人 |
+ {{departmentHead}} |
+
+
+ | 财审科审核 |
+ {{financialAudit}} |
+
+
+ | 分管领导审核 |
+ {{leaderAudit}} |
+
+
+ | 财务分管领导审核 |
+
+
+
+
`
}
- ]
+ ],
+ editForm: {
+ name: '测试字段',
+ label: '测试标签',
+ type: 'text',
+ options: '',
+ required: false,
+ placeholder: ''
+ },
+ fieldList: [],
+ previewContent: '',
+ fieldMetadata: {},
}
},
+ mounted() {
+ this.loadTemplate(this.currentTemplateIndex);
+ this.$nextTick(() => {
+ this.handleRefresh();
+ });
+ },
watch: {
+ currentTemplateIndex: {
+ immediate: true,
+ handler(newVal) {
+ this.loadTemplate(newVal);
+ }
+ },
formatType: {
immediate: true,
handler(val) {
if (val === 'html') {
- this.codeContent = '\n\n\n 支付表格\n\n\n \n\n'
+ this.loadTemplate(this.currentTemplateIndex);
} else {
this.codeContent = '\n\n \n'
+ this.previewContent = ''
}
}
}
},
methods: {
+ loadTemplate(index) {
+ if (this.templates && this.templates[index]) {
+ this.currentTemplateIndex = index;
+ this.codeContent = this.templates[index].content;
+ }
+ },
+ nextTemplate() {
+ const nextIndex = (this.currentTemplateIndex + 1) % this.templates.length;
+ this.loadTemplate(nextIndex);
+ },
+ prevTemplate() {
+ const prevIndex = (this.currentTemplateIndex - 1 + this.templates.length) % this.templates.length;
+ this.loadTemplate(prevIndex);
+ },
handleRefresh() {
- // 实现刷新预览的逻辑
+ let processedContent = this.codeContent;
+
+ const variableRegex = /\{\{([^}]+)\}\}/g;
+ const matches = this.codeContent.matchAll(variableRegex);
+ const variables = new Set();
+
+ for (const match of matches) {
+ variables.add(match[1]);
+ }
+
+ this.updateFieldMetadata(Array.from(variables));
+
+ processedContent = processedContent.replace(/\{\{[^}]+\}\}/g, '');
+
+ this.previewContent = processedContent;
},
handleUpload() {
// 实现文件上传的逻辑
},
handleEditField(field) {
- this.editForm = { ...field }
- this.showEditDrawer = true
+ this.editForm = { ...field };
+ this.showEditDrawer = true;
+
+ console.log('正在编辑字段:', field.name);
},
handleSaveField() {
- const index = this.fieldList.findIndex(item => item.name === this.editForm.name)
- if (index > -1) {
- this.fieldList[index] = { ...this.editForm }
+ const { name } = this.editForm;
+
+ if (this.fieldMetadata[name]) {
+ this.fieldMetadata[name] = { ...this.editForm };
}
- this.showEditDrawer = false
+
+ this.generateFieldList();
+
+ this.showEditDrawer = false;
},
getTypeDisplay(type) {
const typeMap = {
@@ -216,11 +640,49 @@ export default {
}
return typeMap[type] || type
},
+ handleCancel() {
+ this.$router.back();
+ },
handleSave() {
- // 这里添加保存逻辑
- this.$message.success('保存成功')
- // 保存成功后返回列表页
- this.$router.push('/business-config/pay-form')
+ this.$message.success('保存成功');
+ this.$router.push('/business-config/pay-form');
+ },
+ updateFieldMetadata(variables) {
+ const updatedMetadata = {};
+
+ variables.forEach(varName => {
+ if (this.fieldMetadata[varName]) {
+ updatedMetadata[varName] = this.fieldMetadata[varName];
+ } else {
+ updatedMetadata[varName] = {
+ name: varName,
+ label: this.formatVariableName(varName),
+ type: 'text',
+ options: '',
+ required: false,
+ placeholder: `请输入${this.formatVariableName(varName)}`
+ };
+ }
+ });
+
+ this.fieldMetadata = updatedMetadata;
+
+ this.generateFieldList();
+
+ console.log('字段元数据已更新:', this.fieldMetadata);
+ },
+ generateFieldList() {
+ this.fieldList = Object.values(this.fieldMetadata);
+ },
+ formatVariableName(name) {
+ return name
+ .replace(/([A-Z])/g, ' $1')
+ .replace(/^./, str => str.toUpperCase())
+ .trim();
+ },
+ showDrawerOnly() {
+ this.showEditDrawer = true;
+ console.log('尝试只打开抽屉');
}
}
}
@@ -314,6 +776,16 @@ export default {
.text-muted {
color: #6c757d;
}
+
+ .field-name,
+ .field-label {
+ display: block;
+ word-break: break-all;
+ word-wrap: break-word;
+ white-space: normal;
+ line-height: 1.4;
+ font-size: 13px;
+ }
}
.w-100 {
@@ -357,6 +829,45 @@ export default {
}
}
}
+
+.drawer-footer {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ padding: 16px;
+ background: #fff;
+ border-top: 1px solid #e8e8e8;
+
+ .footer-buttons {
+ display: flex;
+ justify-content: center;
+ gap: 16px;
+ }
+}
+
+.form-input {
+ width: 100%;
+
+ :deep(.el-input__inner),
+ :deep(.el-textarea__inner) {
+ white-space: normal;
+ word-wrap: break-word;
+ word-break: break-all;
+ }
+
+ :deep(.el-select) {
+ width: 100%;
+ }
+}
+
+.el-form-item {
+ margin-bottom: 22px;
+
+ :deep(.el-form-item__label) {
+ line-height: 1.5;
+ }
+}
diff --git a/src/views/contract/components/printFundApproval.vue b/src/views/contract/components/printFundApproval.vue
new file mode 100644
index 0000000..8a2b806
--- /dev/null
+++ b/src/views/contract/components/printFundApproval.vue
@@ -0,0 +1,324 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/contract/components/printMeetingSettlement.vue b/src/views/contract/components/printMeetingSettlement.vue
new file mode 100644
index 0000000..2c960ea
--- /dev/null
+++ b/src/views/contract/components/printMeetingSettlement.vue
@@ -0,0 +1,228 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/contract/components/printReimbursementSimple.vue b/src/views/contract/components/printReimbursementSimple.vue
new file mode 100644
index 0000000..7040ee9
--- /dev/null
+++ b/src/views/contract/components/printReimbursementSimple.vue
@@ -0,0 +1,347 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/contract/paymentRegistrationList.vue b/src/views/contract/paymentRegistrationList.vue
index 32d46e1..bc2a7ca 100644
--- a/src/views/contract/paymentRegistrationList.vue
+++ b/src/views/contract/paymentRegistrationList.vue
@@ -155,6 +155,9 @@
+
+
+
@@ -175,6 +178,9 @@ import printReceptionApproval from "./components/printReceptionApproval";
import printReceptionSettlement from "./components/printReceptionSettlement";
import printReimbursement from "./components/printReimbursement";
import printUtilityBill from "./components/printUtilityBill";
+import printReimbursementSimple from "./components/printReimbursementSimple";
+import printMeetingSettlement from "./components/printMeetingSettlement";
+import printFundApproval from "./components/printFundApproval";
export default {
components: {
@@ -185,6 +191,9 @@ export default {
printReceptionSettlement,
printReimbursement,
printUtilityBill,
+ 'print-reimbursement-simple': printReimbursementSimple,
+ printMeetingSettlement,
+ printFundApproval,
detailPaymentRegistration,
},
data() {
@@ -566,6 +575,34 @@ export default {
} else if(rowIndex === 6) { // 第七行
this.$refs['printUtilityBill'].getUtilityData(row.id);
this.$refs['printUtilityBill'].isShow = true;
+ } else if(rowIndex === 7) { // 第八行
+ try {
+ if (this.$refs['printReimbursementSimple']) {
+ this.$refs['printReimbursementSimple'].getReimbursementData(row.id);
+ this.$refs['printReimbursementSimple'].isShow = true;
+ } else {
+ this.$Message.warning('打印组件未正确加载');
+ }
+ } catch (error) {
+ console.error('打印错误:', error);
+ this.$Message.error('打印失败: ' + error.message);
+ }
+ } else if(rowIndex === 8) { // 第九行,打印会议结算单
+ try {
+ this.$refs['printMeetingSettlement'].getMeetingData(row.id);
+ this.$refs['printMeetingSettlement'].isShow = true;
+ } catch (error) {
+ console.error('打印会议结算单错误:', error);
+ this.$Message.error('打印会议结算单失败: ' + error.message);
+ }
+ } else if(rowIndex === 9) { // 第十行,打印资金划拨审批单
+ try {
+ this.$refs['printFundApproval'].getApprovalData(row.id);
+ this.$refs['printFundApproval'].isShow = true;
+ } catch (error) {
+ console.error('打印资金划拨审批单错误:', error);
+ this.$Message.error('打印资金划拨审批单失败: ' + error.message);
+ }
} else {
this.$Message.warning('该行不支持打印功能');
}