diff --git a/.eslintignore b/.eslintignore index fc04190..50f1b24 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,7 @@ /*.json /*.js -dist \ No newline at end of file +dist +*.config.js +*.config.ts +.eslintrc.js +node_modules/ diff --git a/.eslintrc.js b/.eslintrc.js index e74ce34..7d423ab 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,77 +1,129 @@ -// eslint-disable-next-line @typescript-eslint/no-var-requires const path = require('path'); module.exports = { root: true, - parser: 'vue-eslint-parser', - parserOptions: { - // Parser that checks the content of the + + diff --git a/src/components/index.ts b/src/components/index.ts index 797268f..bae0bd8 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -13,6 +13,7 @@ import Chart from './chart/index.vue'; import Breadcrumb from './breadcrumb/index.vue'; import DataTable from './common/DataTable.vue'; import ImageUpload from './common/ImageUpload.vue'; +import OnlyOfficeEditor from './common/OnlyOfficeEditor.vue'; // Manually introduce ECharts modules to reduce packing size @@ -35,5 +36,6 @@ export default { Vue.component('Breadcrumb', Breadcrumb); Vue.component('DataTable', DataTable); Vue.component('ImageUpload', ImageUpload); + Vue.component('OnlyOfficeEditor', OnlyOfficeEditor); }, }; diff --git a/src/components/menu/index.vue b/src/components/menu/index.vue index e0cd7b3..a9cb535 100644 --- a/src/components/menu/index.vue +++ b/src/components/menu/index.vue @@ -1,158 +1,23 @@ - + diff --git a/src/views/setting/system/contract-settings/contract-file.vue b/src/views/setting/system/contract-settings/contract-file.vue index 28116c2..a51ef09 100644 --- a/src/views/setting/system/contract-settings/contract-file.vue +++ b/src/views/setting/system/contract-settings/contract-file.vue @@ -61,7 +61,6 @@ import { Message } from '@arco-design/web-vue'; import useDataTable from '@/composables/useDataTable'; import { - getWordSettingFromId, delWordSetting, getWordSettingList, disableWordSetting, @@ -72,7 +71,7 @@ import { camelToSnake } from '@/utils/caseConvert'; // import contractNumberFormDrawer from './drawer/contract-number-form-drawer.vue'; import contractFileForm from './modal/contract-file-form.vue'; - + import { useRouter } from 'vue-router'; const { data: renderData, columns: projectColumn, @@ -91,7 +90,7 @@ initialPageSize: 10, pageSizeOptions: [10, 20, 50, 100], }); - + const router = useRouter(); const contractWordList = ref([]); const departmentListData = ref([]); const showModal = ref(false); @@ -200,26 +199,16 @@ // 处理错误 } }; - const getWordSettingFromIdData = async (id: number) => { - const { code, data } = await getWordSettingFromId(id); - if (code === 200 && data) { - const { contractCodeSetting } = data; - currentNumberInfo.value = contractCodeSetting || null; - currentNumberInfo.value.arrange = camelToSnake( - currentNumberInfo.value.arrange - ); - } - }; const handleAddContractNumber = () => { // currentNumberInfo.value = null; isEdit.value = false; showModal.value = true; }; const handleEditContractNumber = async (id: number) => { - await getWordSettingFromIdData(id); - isEdit.value = true; - // currentNumberInfo.value = info - showModal.value = true; + router.push({ + name: 'system-setting-contract-file-edit', + query: { id }, + }); }; // 初始化数据 onMounted(() => { diff --git a/src/views/setting/system/contract-settings/contract-template-edit.vue b/src/views/setting/system/contract-settings/contract-template-edit.vue new file mode 100644 index 0000000..28f5d2e --- /dev/null +++ b/src/views/setting/system/contract-settings/contract-template-edit.vue @@ -0,0 +1,709 @@ + + + + + + 合同文档模板设置 + + 保存 + + + + + + + {{ currentContractTemplateInfo.name }} + + + {{ + currentContractTemplateInfo.contractType + }} + + 适用范围 + {{ currentContractTemplateInfo.departmentName }} + + + + 基本配置 + + 基本信息 + + 条款配置 + + + + + + + {{ item.name }} + + + + + + + {{ item.name }} + + + + + + + + + {{ title }} + + + + + 删除条款 + + + + + + + + + + + + {{ item.name }} + + + + + 合同编号预览:{{ + currentContractTemplateInfo.contractCode + }} + + + + + + + {{ item.text }} + + + + + 其他信息(选填) + + + + {{ item.name }} + + + + + + + + + + + {{ item.title }} + + + + + 优惠条款 + + + + + + + + + + + + + + + + + diff --git a/src/views/setting/system/contract-settings/contract-template.vue b/src/views/setting/system/contract-settings/contract-template.vue index 306a9d4..fd1cfc9 100644 --- a/src/views/setting/system/contract-settings/contract-template.vue +++ b/src/views/setting/system/contract-settings/contract-template.vue @@ -48,20 +48,19 @@ + + diff --git a/src/views/setting/system/contract-settings/modal/contract-template-form.vue b/src/views/setting/system/contract-settings/modal/contract-template-form.vue index 4687939..5309888 100644 --- a/src/views/setting/system/contract-settings/modal/contract-template-form.vue +++ b/src/views/setting/system/contract-settings/modal/contract-template-form.vue @@ -1,7 +1,7 @@ (); @@ -54,13 +54,13 @@ (e: 'update:visible', val: boolean): void; (e: 'submitted'): void; }>(); - + const router = useRouter(); // 表单数据 const formRef = ref(); - const form = reactive({ + const form = reactive({ name: '', departmentId: null, - // id: undefined, + id: undefined, }); // 校验规则 @@ -68,19 +68,18 @@ name: [{ required: true, message: '请输入模板名称' }], departmentId: [{ required: true, message: '请选择适用范围' }], }; - - // Watch 弹窗控制 & 初始化 + // 表单事件 + const handleCancel = () => { + emit('update:visible', false); + }; watch( () => props.visible, (val) => { if (val) { if (props.record) { - // form.id = props.record?.id; - // form.name = props.record?.name; - // form.parent_id = props.record?.parentId ?? ''; - // form.user_id = props.record?.UserId ?? ''; - // form.remark = props.record?.remark ?? ''; - // Object.assign(form, props.record); + Object.assign(form, { + ...props.record, + }); } else { Object.assign(form, { id: undefined, @@ -92,21 +91,29 @@ }, { immediate: true } ); - - // 表单事件 - const handleCancel = () => { - emit('update:visible', false); - }; const handleSubmit = async () => { await formRef.value?.validate(); - const { code, message } = props.isEdit + if (!form.departmentId || !form.name) return; + if (props.isEdit) { + // saveType 保存类别:1 名称与适用范围数据,2 基础信息数据,3 条款数据) + form.saveType = 1; + } + const { code, message, data } = props.isEdit ? await updateTemplateSetting(form) : await createTemplateSetting(form); if (code === 200) { Message.success(message); + if (props.isEdit) { + emit('submitted'); + } else { + const info = data as any; + const id = info.contractTemplateSettingId; + router.push({ + name: 'system-setting-contract-template-edit', + query: { id }, + }); + } handleCancel(); - // 通知父组件更新部门列表数据 - emit('submitted'); } }; diff --git a/src/views/setting/system/contract-settings/terms/bond.vue b/src/views/setting/system/contract-settings/terms/bond.vue new file mode 100644 index 0000000..f42b609 --- /dev/null +++ b/src/views/setting/system/contract-settings/terms/bond.vue @@ -0,0 +1,113 @@ + + + {{ title }} + + + + + + + + {{ item.text }} + + + + + + + + {{ item.text }} + + + + + + + + + diff --git a/src/views/setting/system/contract-settings/terms/discount.vue b/src/views/setting/system/contract-settings/terms/discount.vue new file mode 100644 index 0000000..cdfaf5e --- /dev/null +++ b/src/views/setting/system/contract-settings/terms/discount.vue @@ -0,0 +1,127 @@ + + + 优惠条款 + + + + + + 单价折扣 + 单价减免 + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/setting/system/contract-settings/terms/incremental.vue b/src/views/setting/system/contract-settings/terms/incremental.vue new file mode 100644 index 0000000..f13f56d --- /dev/null +++ b/src/views/setting/system/contract-settings/terms/incremental.vue @@ -0,0 +1,134 @@ + + + 递增条款 + + + + + + + + + + + + + % + 元 + + + + + + + + + + + % + 元 + + + + + + + + + + + diff --git a/src/views/setting/system/contract-settings/terms/late-fee.vue b/src/views/setting/system/contract-settings/terms/late-fee.vue new file mode 100644 index 0000000..d0541bc --- /dev/null +++ b/src/views/setting/system/contract-settings/terms/late-fee.vue @@ -0,0 +1,144 @@ + + + 滞纳金条款 + + + + + + + + + + + 仅计算不生成账单 + 达到上限生成账单 + 生成账单每天调 + + + + + + + + + + %/天 + 元/天 + + + + + + + %上限 + 元上限 + + + + + + + + + + + + diff --git a/src/views/setting/system/contract-settings/terms/rent-setting.vue b/src/views/setting/system/contract-settings/terms/rent-setting.vue new file mode 100644 index 0000000..bb75a83 --- /dev/null +++ b/src/views/setting/system/contract-settings/terms/rent-setting.vue @@ -0,0 +1,312 @@ + + + 租期条款(租金) + + + {{ + text + }} + + + + + + + + + + + + + + + + + + 租期开始前 + 租期开始后 + 租期开始上月 + 租期开始本月 + + + + + 日付款 + 自然日付款 + 工作日付款 + + + + + + + + + + {{ item.bankAccuntName }} + + + + + + + + + + diff --git a/src/views/setting/system/data-dictionary/components/contract-card.vue b/src/views/setting/system/data-dictionary/components/contract-card.vue new file mode 100644 index 0000000..f0f56ae --- /dev/null +++ b/src/views/setting/system/data-dictionary/components/contract-card.vue @@ -0,0 +1,195 @@ + + + + + + + 合同类型(标签类) + 全选 + + 新增 + + + + + onProjectTypeCheckChange(item, val)" + > + {{ item.name }} + + + + + + + + + + + + + diff --git a/src/views/setting/system/data-dictionary/index.vue b/src/views/setting/system/data-dictionary/index.vue index 71b63c3..3f086ea 100644 --- a/src/views/setting/system/data-dictionary/index.vue +++ b/src/views/setting/system/data-dictionary/index.vue @@ -27,6 +27,7 @@ + @@ -42,6 +43,7 @@ import { dataDictionaryTabs } from './contrant'; import projectCard from './components/project-card.vue'; import roomCard from './components/room-card.vue'; + import contractCard from './components/contract-card.vue'; import tenantCard from './components/tenant-card.vue'; const { t } = useI18n(); diff --git a/tailwind.config.ts b/tailwind.config.ts new file mode 100644 index 0000000..eed1e60 --- /dev/null +++ b/tailwind.config.ts @@ -0,0 +1,34 @@ +import type { Config } from 'tailwindcss'; + +const config: Config = { + content: [ + './index.html', + './src/**/*.{vue,js,ts,jsx,tsx}', // 扫描所有 Vue/TS/JS 文件,保证类名能被提取 + ], + theme: { + extend: { + colors: { + // 让 Tailwind 能直接用 Arco Design 的主题变量 + primary: 'var(--color-primary)', + success: 'var(--color-success)', + warning: 'var(--color-warning)', + danger: 'var(--color-danger)', + }, + borderRadius: { + // 覆盖 Tailwind 的圆角,用 Arco token + lg: 'var(--border-radius-medium)', + xl: 'var(--border-radius-large)', + }, + fontSize: { + // 对齐 Arco Design 的字体大小 + sm: 'var(--font-size-small)', + base: 'var(--font-size-body-3)', + lg: 'var(--font-size-title-2)', + }, + }, + }, + darkMode: 'class', // 跟 Arco 的暗黑模式配合 + plugins: [], +}; + +export default config;
{{ currentContractTemplateInfo.name }}
+ 适用范围 + {{ currentContractTemplateInfo.departmentName }} +
+ 基本信息
+ + + + + + {{ item.name }} + + + +
{{ title }}
其他信息(选填)