{
+ return request({
+ url: '/system/composite/periodicpolicy/update',
+ method: 'put',
+ data: data
+ })
+}
diff --git a/LCXiaoguan-ui/src/router/index.ts b/LCXiaoguan-ui/src/router/index.ts
index 094b6f0..ca6812f 100644
--- a/LCXiaoguan-ui/src/router/index.ts
+++ b/LCXiaoguan-ui/src/router/index.ts
@@ -123,12 +123,31 @@ export const constantRoutes: RouteRecordRaw[] = [
children: [
{
path: 'add',
- component: () => import('@/views/system/policy/add/index.vue'),
+ component: () => import('@/views/system/periodicpolicy/add/index.vue'),
name: 'AddPolicy',
meta: { title: '新增首付分期政策', activeMenu: '/system/policy' }
}
]
},
+ {
+ path: '/system/periodicpolicy/installment',
+ component: Layout,
+ hidden: true,
+ children: [
+ {
+ path: '',
+ component: () => import('@/views/system/periodicpolicy/installment/index.vue'),
+ name: 'InstallmentPolicy',
+ meta: { title: '分期政策管理', activeMenu: '/system/periodicpolicy' }
+ },
+ {
+ path: 'add',
+ component: () => import('@/views/system/periodicpolicy/installment/add/index.vue'),
+ name: 'AddInstallmentPolicy',
+ meta: { title: '新增分期政策方案', activeMenu: '/system/periodicpolicy' }
+ }
+ ]
+ },
{
path: '/system/project',
component: Layout,
diff --git a/LCXiaoguan-ui/src/views/system/periodicpolicy/add/index.vue b/LCXiaoguan-ui/src/views/system/periodicpolicy/add/index.vue
index 36f5855..5329643 100644
--- a/LCXiaoguan-ui/src/views/system/periodicpolicy/add/index.vue
+++ b/LCXiaoguan-ui/src/views/system/periodicpolicy/add/index.vue
@@ -39,6 +39,7 @@
+
-
+
-
+ {{ row.paymentTime }}
-
+
-
+ {{ row.daysWithin }}
-
+
-
+ {{ row.monthsWithin }}
-
+ {{ row.paymentType }}
-
+ {{ row.paymentName }}
-
+ {{ row.ratio }}%
-
+ {{ row.amount }}
@@ -253,8 +252,10 @@
- 取消
- 保存
+
+ 保存
+ 取消
+
@@ -264,10 +265,14 @@
-
+
+
+
+
+
-
+
@@ -276,21 +281,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+ 非贷款类房款
-
+
+
+
@@ -317,10 +331,11 @@
-
+
+ 保存
+ 保存并新增
+ 取消
+
@@ -332,812 +347,412 @@
diff --git a/LCXiaoguan-ui/src/views/system/periodicpolicy/index.vue b/LCXiaoguan-ui/src/views/system/periodicpolicy/index.vue
index 2abf1b8..4fc30b5 100644
--- a/LCXiaoguan-ui/src/views/system/periodicpolicy/index.vue
+++ b/LCXiaoguan-ui/src/views/system/periodicpolicy/index.vue
@@ -190,12 +190,21 @@
-
- 首付分期
- 编辑
- 删除
-
-
+
+
+ 首付分期
+
+
+ 编辑
+
+
+ 删除
+
+
+ 分期政策
+
+
+
@@ -219,6 +228,7 @@
import { ref, computed, onMounted, onUnmounted } from 'vue';
import { useRouter } from 'vue-router';
import { ElMessage } from 'element-plus';
+import { Edit, Delete, Document } from '@element-plus/icons-vue';
import { listProject } from '@/api/system/project';
import { listPeriodicpolicy } from '@/api/system/periodicpolicy';
@@ -605,8 +615,81 @@ const handleEdit = (row) => {
// 处理分期政策编辑跳转
const handleEditPolicy = (row) => {
- // 这里可以添加分期政策的编辑逻辑
console.log('编辑分期政策:', row);
+
+ if (!row.id) {
+ console.error('缺少必要的ID参数:', row);
+ ElMessage.error('无法编辑:缺少分期方案ID');
+ return;
+ }
+
+ // 跳转到分期政策编辑页面
+ const queryString = new URLSearchParams({
+ id: String(row.id),
+ schemeType: row.schemeType || 'policy',
+ installments: row.projGuid || ''
+ }).toString();
+
+ window.location.href = `/periodicpolicy/add?${queryString}`;
+};
+
+// 处理分期政策按钮跳转
+const handleInstallmentPolicy = (row) => {
+ console.log('跳转到分期政策管理:', row);
+
+ if (!row.id) {
+ console.error('缺少必要的ID参数:', row);
+ ElMessage.error('无法跳转:缺少分期方案ID');
+ return;
+ }
+
+ // 跳转到分期政策管理页面
+ const queryString = new URLSearchParams({
+ schemeId: String(row.id),
+ schemeName: row.schemeName || '',
+ projectId: row.projGuid || ''
+ }).toString();
+
+ window.location.href = `/system/periodicpolicy/installment?${queryString}`;
+};
+
+// 处理删除分期方案
+const handleDelete = async (row) => {
+ if (!row.id) {
+ console.error('缺少必要的ID参数:', row);
+ ElMessage.error('无法删除:缺少分期方案ID');
+ return;
+ }
+
+ try {
+ // 确认删除
+ await ElMessageBox.confirm(
+ `确定要删除分期方案"${row.schemeName || row.schemeName || '未命名方案'}"吗?`,
+ '删除确认',
+ {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }
+ );
+
+ // 执行删除操作
+ loading.value = true;
+ const { delPeriodicpolicy } = await import('@/api/system/periodicpolicy');
+ await delPeriodicpolicy(row.id);
+
+ ElMessage.success('删除成功');
+
+ // 重新加载数据
+ await fetchTableData();
+ } catch (error) {
+ if (error !== 'cancel') {
+ console.error('删除分期方案失败:', error);
+ ElMessage.error(error?.response?.data?.message || '删除失败,请稍后重试');
+ }
+ } finally {
+ loading.value = false;
+ }
};
diff --git a/LCXiaoguan-ui/src/views/system/periodicpolicy/installment/add/index.vue b/LCXiaoguan-ui/src/views/system/periodicpolicy/installment/add/index.vue
new file mode 100644
index 0000000..820dc8e
--- /dev/null
+++ b/LCXiaoguan-ui/src/views/system/periodicpolicy/installment/add/index.vue
@@ -0,0 +1,982 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/LCXiaoguan-ui/src/views/system/periodicpolicy/installment/index.vue b/LCXiaoguan-ui/src/views/system/periodicpolicy/installment/index.vue
new file mode 100644
index 0000000..933fc01
--- /dev/null
+++ b/LCXiaoguan-ui/src/views/system/periodicpolicy/installment/index.vue
@@ -0,0 +1,297 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+ 新增
+
+
+ 修改
+
+
+ 删除
+
+
+ 导出
+
+
+
+
+
+
+
+
+
+
+ {{ formatInstallments(scope.row.installments) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 编辑
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/LCXiaoguan-ui/src/views/system/policy/index.vue b/LCXiaoguan-ui/src/views/system/policy/index.vue
index cbed4c9..1995ec8 100644
--- a/LCXiaoguan-ui/src/views/system/policy/index.vue
+++ b/LCXiaoguan-ui/src/views/system/policy/index.vue
@@ -332,6 +332,8 @@ const handleExport = () => {
);
};
+
+
onMounted(() => {
getList();
});
diff --git a/script/sql/分期方案初始化脚本.sql b/script/sql/分期方案初始化脚本.sql
index 405d8e6..c6e2aa8 100644
--- a/script/sql/分期方案初始化脚本.sql
+++ b/script/sql/分期方案初始化脚本.sql
@@ -81,7 +81,7 @@ CREATE TABLE t_policy (
`description` TEXT COMMENT '说明',
`category` VARCHAR ( 128 ) NOT NULL COMMENT '类别',
`payment_type` VARCHAR ( 128 ) NOT NULL COMMENT '付款方式类型',
- `down_payment_ratio` DECIMAL (5,2) DEFAULT NULL COMMENT '首付比例(%)',
+ `down_payment_ratio` VARCHAR(20) DEFAULT NULL COMMENT '首付比例(%)',
`payment_method` VARCHAR ( 50 ) DEFAULT NULL COMMENT '付款方式',
`policy_type` VARCHAR ( 50 ) DEFAULT NULL COMMENT '政策类型',
`tenant_id` VARCHAR ( 20 ) DEFAULT '000000' COMMENT '租户编号',