diff --git a/src/api/fee/payFeeConfigDiscountManageApi.js b/src/api/fee/payFeeConfigDiscountManageApi.js new file mode 100644 index 0000000..b5c30f2 --- /dev/null +++ b/src/api/fee/payFeeConfigDiscountManageApi.js @@ -0,0 +1,92 @@ +import request from '@/utils/request' +import { getCommunityId } from '@/api/community/communityApi' + +// 查询费用折扣列表 +export function getPayFeeConfigDiscountList(params) { + return new Promise((resolve, reject) => { + const communityId = getCommunityId() + request({ + url: '/payFeeConfigDiscount/queryPayFeeConfigDiscount', + method: 'get', + params: { ...params, communityId } + }).then(response => { + const res = response.data + if (res.code === 0) { + resolve({ + data: res.data, + total: res.total + }) + } else { + reject(new Error(res.msg || '获取费用折扣列表失败')) + } + }).catch(error => { + reject(error) + }) + }) +} + +// 查询折扣列表 +export function getFeeDiscountList(params) { + return new Promise((resolve, reject) => { + const communityId = getCommunityId() + request({ + url: '/feeDiscount/queryFeeDiscount', + method: 'get', + params: { ...params, communityId } + }).then(response => { + const res = response.data + if (res.code === 0) { + resolve({ + data: res.data, + total: res.total + }) + } else { + reject(new Error(res.msg || '获取折扣列表失败')) + } + }).catch(error => { + reject(error) + }) + }) +} + +// 保存费用折扣 +export function savePayFeeConfigDiscount(data) { + return new Promise((resolve, reject) => { + data.communityId = getCommunityId() + request({ + url: '/payFeeConfigDiscount/savePayFeeConfigDiscount', + method: 'post', + data + }).then(response => { + const res = response.data + if (res.code === 0) { + resolve(res) + } else { + reject(new Error(res.msg || '保存费用折扣失败')) + } + }).catch(error => { + reject(error) + }) + }) +} + +// 删除费用折扣 +export function deletePayFeeConfigDiscount(data) { + return new Promise((resolve, reject) => { + data.communityId = getCommunityId() + request({ + url: '/payFeeConfigDiscount/deletePayFeeConfigDiscount', + method: 'post', + data + }).then(response => { + const res = response.data + if (res.code === 0) { + resolve(res) + } else { + reject(new Error(res.msg || '删除费用折扣失败')) + } + }).catch(error => { + reject(error) + }) + }) +} \ No newline at end of file diff --git a/src/components/fee/addPayFeeConfigDiscount.vue b/src/components/fee/addPayFeeConfigDiscount.vue new file mode 100644 index 0000000..aa95780 --- /dev/null +++ b/src/components/fee/addPayFeeConfigDiscount.vue @@ -0,0 +1,190 @@ + + + + + + {{ $t('addPayFeeConfigDiscount.selectDiscountType') }} + {{ $t('addPayFeeConfigDiscount.discount') }} + {{ $t('addPayFeeConfigDiscount.penalty') }} + + + + + + {{ $t('addPayFeeConfigDiscount.selectDiscountName') }} + + + + + + + + + + {{ $t('addPayFeeConfigDiscount.paymentPeriodTip') }} + + - + + + + + + + + + + {{ $t('addPayFeeConfigDiscount.discountEndTimeTip') }} + + + + + {{ $t('common.cancel') }} + + {{ $t('common.save') }} + + + + + + + + \ No newline at end of file diff --git a/src/components/fee/deletePayFeeConfigDiscount.vue b/src/components/fee/deletePayFeeConfigDiscount.vue new file mode 100644 index 0000000..d13d6f7 --- /dev/null +++ b/src/components/fee/deletePayFeeConfigDiscount.vue @@ -0,0 +1,55 @@ + + + + {{ $t('deletePayFeeConfigDiscount.confirmText') }} + + + + {{ $t('deletePayFeeConfigDiscount.cancel') }} + + {{ $t('common.confirm') }} + + + + + + \ No newline at end of file diff --git a/src/i18n/index.js b/src/i18n/index.js index 42c7d12..2e6830c 100644 --- a/src/i18n/index.js +++ b/src/i18n/index.js @@ -121,6 +121,8 @@ import { messages as communityPaymentMessages } from '../views/fee/communityPaym import { messages as enterCommunityMessages } from '../views/community/enterCommunityLang' import { messages as roomRenovationManageMessages } from '../views/community/roomRenovationManageLang' import { messages as feeConfigManageMessages } from '../views/fee/feeConfigManageLang' +import { messages as payFeeConfigDiscountManageMessages } from '../views/fee/payFeeConfigDiscountManageLang' + Vue.use(VueI18n) @@ -246,6 +248,7 @@ const messages = { ...enterCommunityMessages.en, ...roomRenovationManageMessages.en, ...feeConfigManageMessages.en, + ...payFeeConfigDiscountManageMessages.en, }, zh: { ...loginMessages.zh, @@ -367,6 +370,7 @@ const messages = { ...enterCommunityMessages.zh, ...roomRenovationManageMessages.zh, ...feeConfigManageMessages.zh, + ...payFeeConfigDiscountManageMessages.zh, } } diff --git a/src/router/index.js b/src/router/index.js index 4c89867..faeab81 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -591,6 +591,11 @@ const routes = [ name:'/pages/property/feeConfigManage', component: () => import('@/views/fee/feeConfigManageList.vue') }, + { + path:'/views/fee/payFeeConfigDiscountManage', + name:'/views/fee/payFeeConfigDiscountManage', + component: () => import('@/views/fee/payFeeConfigDiscountManageList.vue') + }, // 其他子路由可以在这里添加 ] }, diff --git a/src/views/fee/feeConfigManageList.vue b/src/views/fee/feeConfigManageList.vue index 4352f87..319246c 100644 --- a/src/views/fee/feeConfigManageList.vue +++ b/src/views/fee/feeConfigManageList.vue @@ -274,7 +274,7 @@ export default { _settingConfigDiscount(feeConfig) { this.$router.push({ - path: '/fee/payFeeConfigDiscountManage', + path: '/views/fee/payFeeConfigDiscountManage', query: { configId: feeConfig.configId, feeName: feeConfig.feeName diff --git a/src/views/fee/payFeeConfigDiscountManageLang.js b/src/views/fee/payFeeConfigDiscountManageLang.js new file mode 100644 index 0000000..1765160 --- /dev/null +++ b/src/views/fee/payFeeConfigDiscountManageLang.js @@ -0,0 +1,104 @@ +export const messages = { + en: { + payFeeConfigDiscountManage: { + title: 'Fee Discount', + discountId: 'Discount ID', + feeName: 'Fee Item', + discountName: 'Discount Name', + rule: 'Rule', + discountType: 'Discount Type', + discount: 'Discount', + penalty: 'Penalty', + paymentPeriod: 'Payment Period', + discountEndTime: 'Discount End Time', + operation: 'Operation', + paymentPeriodTip: 'Payment Period: This constrains the payment time, which is the time when the cashier operates the payment.', + discountEndTimeTip: 'Discount End Time: This indicates the maximum payment time.', + currentYearTip1: 'If the current year fee cannot enjoy the discount, select "No Arrears Rule" in the discount settings and set the arrears duration to 0.', + currentYearTip2: 'This way, all overdue fees will not enjoy the discount, and the current year fee is considered overdue so it will not enjoy the discount.', + fetchError: 'Failed to fetch discount data' + }, + addPayFeeConfigDiscount: { + addTitle: 'Add Discount', + discountType: 'Discount Type', + requiredPlaceholder: 'Required', + selectDiscountType: 'Please select discount type', + discount: 'Discount', + penalty: 'Penalty', + discountName: 'Discount Name', + selectDiscountName: 'Please select discount name', + paymentPeriod: 'Payment Period', + startTimePlaceholder: 'Required, payment start time', + endTimePlaceholder: 'Required, payment end time', + paymentPeriodTip: 'Payment can only enjoy this discount during this period', + discountEndTime: 'Discount End Time', + discountEndTimePlaceholder: 'Optional, discount end time', + discountEndTimeTip: 'Maximum payment time, e.g., for 2024 fee discount, fill in 2025-01-01', + discountTypeRequired: 'Discount type is required', + discountNameRequired: 'Discount name is required', + startTimeRequired: 'Payment start time is required', + endTimeRequired: 'Payment end time is required', + fetchDiscountsError: 'Failed to fetch discounts', + saveSuccess: 'Discount added successfully', + saveError: 'Failed to add discount' + }, + deletePayFeeConfigDiscount: { + title: 'Confirm Operation', + confirmText: 'Are you sure to delete this fee discount?', + cancel: 'Cancel', + deleteSuccess: 'Discount deleted successfully', + deleteError: 'Failed to delete discount' + }, + }, + zh: { + payFeeConfigDiscountManage: { + title: '费用折扣', + discountId: '费用折扣ID', + feeName: '费用项名称', + discountName: '折扣名称', + rule: '规则', + discountType: '折扣类型', + discount: '优惠', + penalty: '违约', + paymentPeriod: '缴费时间段', + discountEndTime: '折扣终止时间', + operation: '操作', + paymentPeriodTip: '缴费时间段:这个约束缴费的时间,也就是前台收银员操作缴费的时间', + discountEndTimeTip: '折扣终止时间:这个表示最大缴费到什么时候', + currentYearTip1: '如果本年度费用不能享受优惠 那么在折扣设置中规则选择打折无欠费规则,并且欠费时长为0', + currentYearTip2: '这样所有欠费的费用则不享受优惠,本年度的费用属于欠费所以不享受优惠', + fetchError: '获取折扣数据失败' + }, + addPayFeeConfigDiscount: { + addTitle: '添加折扣', + discountType: '折扣类型', + requiredPlaceholder: '必填', + selectDiscountType: '请选择折扣类型', + discount: '优惠', + penalty: '违约', + discountName: '折扣名称', + selectDiscountName: '请选择折扣名称', + paymentPeriod: '缴费时间段', + startTimePlaceholder: '必填,请填写缴费起始时间', + endTimePlaceholder: '必填,请填写缴费结束时间', + paymentPeriodTip: '这段时间内缴费才能享受该优惠', + discountEndTime: '折扣终止时间', + discountEndTimePlaceholder: '可选,填写折扣终止时间', + discountEndTimeTip: '最大缴费到什么时候,比如想2024年费用优惠,那么就填写2025-01-01', + discountTypeRequired: '折扣类型不能为空', + discountNameRequired: '折扣名称不能为空', + startTimeRequired: '有效期起始时间不能为空', + endTimeRequired: '有效期终止时间不能为空', + fetchDiscountsError: '获取折扣列表失败', + saveSuccess: '添加成功', + saveError: '添加失败' + }, + deletePayFeeConfigDiscount: { + title: '确认操作', + confirmText: '确定删除费用折扣吗?', + cancel: '点错了', + deleteSuccess: '删除成功', + deleteError: '删除失败' + } + } +} \ No newline at end of file diff --git a/src/views/fee/payFeeConfigDiscountManageList.vue b/src/views/fee/payFeeConfigDiscountManageList.vue new file mode 100644 index 0000000..f6c9b79 --- /dev/null +++ b/src/views/fee/payFeeConfigDiscountManageList.vue @@ -0,0 +1,152 @@ + + + + + + {{ $t('payFeeConfigDiscountManage.title') }} + + + + {{ $t('common.back') }} + + + {{ $t('common.add') }} + + + + + + + + + + + + + {{ item.specName }}:{{ item.specValue }} + + + + + + {{ scope.row.discountType === '1001' ? $t('payFeeConfigDiscountManage.discount') : $t('payFeeConfigDiscountManage.penalty') }} + + + + + {{ scope.row.startTime }}~{{ scope.row.endTime }} + + + + + + + {{ $t('common.delete') }} + + + + + + + + {{ $t('payFeeConfigDiscountManage.paymentPeriodTip') }} + {{ $t('payFeeConfigDiscountManage.discountEndTimeTip') }} + {{ $t('payFeeConfigDiscountManage.currentYearTip1') }} + {{ $t('payFeeConfigDiscountManage.currentYearTip2') }} + + + + + + + + + + + + + + \ No newline at end of file
{{ $t('deletePayFeeConfigDiscount.confirmText') }}