From 9b570ff406734ac0b4ab18572fc0b92ad3ba8101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwangzihua=E2=80=9D?= Date: Wed, 24 Dec 2025 11:48:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 3 + .env.localhost | 3 + .env.pre | 3 + .env.production | 3 + .env.test | 3 + .eslintignore | 18 ++ .eslintrc.cjs | 66 +++++ .gitignore | 7 + .prettierrc.cjs | 30 +++ .stylelintignore | 3 + .stylelintrc.js | 70 ++++++ .vscode/settings.json | 3 + .../service-applications-api.js | 17 +- src/api/support/file-api.js | 2 +- src/components/support/file-upload/index.vue | 2 +- .../service-count/quarter-statistics.vue | 235 ++++++++++++++++++ .../erp/service/service-application-count.vue | 30 +++ .../erp/service/service-applications-form.vue | 59 ++++- .../erp/service/service-applications-list.vue | 102 +++++++- 19 files changed, 637 insertions(+), 22 deletions(-) create mode 100644 .env.development create mode 100644 .env.localhost create mode 100644 .env.pre create mode 100644 .env.production create mode 100644 .env.test create mode 100644 .eslintignore create mode 100644 .eslintrc.cjs create mode 100644 .gitignore create mode 100644 .prettierrc.cjs create mode 100644 .stylelintignore create mode 100644 .stylelintrc.js create mode 100644 .vscode/settings.json create mode 100644 src/components/system/service-count/quarter-statistics.vue create mode 100644 src/views/business/erp/service/service-application-count.vue diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..c82c8bc --- /dev/null +++ b/.env.development @@ -0,0 +1,3 @@ +NODE_ENV=development +VITE_APP_TITLE='律师公益法律服务活动申报与管理平台' +VITE_APP_API_URL='http://127.0.0.1:1024' \ No newline at end of file diff --git a/.env.localhost b/.env.localhost new file mode 100644 index 0000000..6d15c47 --- /dev/null +++ b/.env.localhost @@ -0,0 +1,3 @@ +NODE_ENV=development +VITE_APP_TITLE='律师公益法律服务活动申报与管理平台' +VITE_APP_API_URL='http://127.0.0.1:1024' diff --git a/.env.pre b/.env.pre new file mode 100644 index 0000000..a478a5e --- /dev/null +++ b/.env.pre @@ -0,0 +1,3 @@ +NODE_ENV=production +VITE_APP_TITLE='律师公益法律服务活动申报与管理平台' +VITE_APP_API_URL='https://preview.smartadmin.vip/smart-admin-api' \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..a478a5e --- /dev/null +++ b/.env.production @@ -0,0 +1,3 @@ +NODE_ENV=production +VITE_APP_TITLE='律师公益法律服务活动申报与管理平台' +VITE_APP_API_URL='https://preview.smartadmin.vip/smart-admin-api' \ No newline at end of file diff --git a/.env.test b/.env.test new file mode 100644 index 0000000..8743092 --- /dev/null +++ b/.env.test @@ -0,0 +1,3 @@ +NODE_ENV=production +VITE_APP_TITLE='律师公益法律服务活动申报与管理平台' +VITE_APP_API_URL='http://127.0.0.1:1024' diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..78e1638 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,18 @@ + +*.sh +node_modules +lib +*.md +*.woff +*.ttf +.vscode +.idea +dist +public +/docs +.husky +.local +.localhost +/bin +Dockerfile +src/assets diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..81e7acc --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,66 @@ +/* + * @Description: + * @Author: zhuoda + * @Date: 2021-11-05 + * @LastEditTime: 2022-07-05 + * @LastEditors: zhuoda + */ +module.exports = { + root: true, //此项是用来告诉eslint找当前配置文件不能往父级查找 + env: { + browser: true, + es2021: true, + node: true, + }, + parser: 'vue-eslint-parser', //使用vue-eslint-parser 来解析vue文件中的 template和script + parserOptions: { + ecmaVersion: 12, // 默认情况下,ESLint使用的是ECMAScript5语法,此处我们设置的选项是 es12 + sourceType: 'module', // 指定js导入的方式 + }, + extends: ['plugin:vue/vue3-essential', 'eslint:recommended', 'plugin:vue/base'], + globals: { + defineProps: 'readonly', + defineEmits: 'readonly', + defineExpose: 'readonly', + withDefaults: 'readonly', + }, + plugins: ['vue'], + rules: { + 'no-unused-vars': [ + 'error', + // we are only using this rule to check for unused arguments since TS + // catches unused variables but not args. + { varsIgnorePattern: '.*', args: 'none' }, + ], + 'space-before-function-paren': 'off', + + 'vue/attributes-order': 'off', + 'vue/one-component-per-file': 'off', + 'vue/html-closing-bracket-newline': 'off', + 'vue/max-attributes-per-line': 'off', + 'vue/multiline-html-element-content-newline': 'off', + 'vue/singleline-html-element-content-newline': 'off', + 'vue/attribute-hyphenation': 'off', + 'vue/require-default-prop': 'off', + 'vue/multi-word-component-names': [ + 'error', + { + ignores: ['index'], //需要忽略的组件名 + }, + ], + 'vue/html-self-closing': [ + 'error', + { + html: { + void: 'always', + normal: 'never', + component: 'always', + }, + svg: 'always', + math: 'always', + }, + ], + // Enable vue/script-setup-uses-vars rule + 'vue/script-setup-uses-vars': 'error', + }, +}; diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..61425d5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +node_modules +.DS_Store +**/.DS_Store +dist +dist-ssr +*.local +.idea diff --git a/.prettierrc.cjs b/.prettierrc.cjs new file mode 100644 index 0000000..d1c4ba8 --- /dev/null +++ b/.prettierrc.cjs @@ -0,0 +1,30 @@ +/* + * 代码格式化配置 + * + * @Author: 1024创新实验室-主任:卓大 + * @Date: 2022-09-12 14:44:18 + * @Wechat: zhuda1024 + * @Email: lab1024@163.com + * @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012 + */ +module.exports = { + printWidth: 150, // 每行代码长度(默认80) + tabWidth: 2, // 缩进空格数 + useTabs: false, //不用tab缩进 + semi: true, //// 在语句末尾打印分号 + singleQuote: true, // 使用单引号而不是双引号 + vueIndentScriptAndStyle: true, //Vue文件脚本和样式标签缩进 + quoteProps: 'as-needed', // 更改引用对象属性的时间 可选值"" + jsxSingleQuote: true, // 在JSX中使用单引号而不是双引号 + trailingComma: 'es5', //多行时尽可能打印尾随逗号。(例如,单行数组永远不会出现逗号结尾。) 可选值"",默认none + bracketSpacing: true, // 在对象文字中的括号之间打印空格 + jsxBracketSameLine: false, //jsx 标签的反尖括号需要换行 + arrowParens: 'always', // 在单独的箭头函数参数周围包括括号 always:(x) => x \ avoid:x => x + rangeStart: 0, // 这两个选项可用于格式化以给定字符偏移量(分别包括和不包括)开始和结束的代码 + rangeEnd: Infinity, + requirePragma: false, // 指定要使用的解析器,不需要写文件开头的 @prettier + insertPragma: false, // 不需要自动在文件开头插入 @prettier + proseWrap: 'preserve', // 使用默认的折行标准 always\never\preserve + htmlWhitespaceSensitivity: 'css', // 指定HTML文件的全局空格敏感度 css\strict\ignore + endOfLine: 'auto', // 因为prettier的规范和eslint的换行规则不同,所以这个必须配置。要不然每次打开文件都会有一堆的警告;换行符使用 lf 结尾是 可选值" { - return postRequest(`/serviceApplications/submit/${id}`); + return getRequest(`/serviceApplications/submit/${id}`); + }, +/** + * 审核 @author wzh + */ + review: (param) => { + return postRequest('/serviceApplications/review', param); + }, + + /** + * 新增提交 @author wzh + */ + addSubmit: (param) => { + return postRequest('/serviceApplications/addSubmit', param); }, /** * 批量提交 @author wzh diff --git a/src/api/support/file-api.js b/src/api/support/file-api.js index 165c02c..8f93153 100644 --- a/src/api/support/file-api.js +++ b/src/api/support/file-api.js @@ -40,6 +40,6 @@ export const fileApi = { * 根据文件ID列表获取文件信息 @author 系统 */ getFileList: (fileIds) => { - return getRequest(`/support/file/getFileList?fileIds=${fileIds}`); + return postRequest('/support/file/getFileList', { fileIds }); }, }; diff --git a/src/components/support/file-upload/index.vue b/src/components/support/file-upload/index.vue index 2d33874..7f8ea4b 100644 --- a/src/components/support/file-upload/index.vue +++ b/src/components/support/file-upload/index.vue @@ -95,7 +95,7 @@ }); // 图片类型的后缀名 - const imgFileType = ['jpg', 'jpeg', 'png', 'gif', 'PNG', 'GIF', 'JPG']; + const imgFileType = ['jpg', 'jpeg', 'png', 'gif','.PNG','.GIF','.JPG']; // 重新修改图片展示字段 const files = computed(() => { diff --git a/src/components/system/service-count/quarter-statistics.vue b/src/components/system/service-count/quarter-statistics.vue new file mode 100644 index 0000000..b272136 --- /dev/null +++ b/src/components/system/service-count/quarter-statistics.vue @@ -0,0 +1,235 @@ + + + + + + \ No newline at end of file diff --git a/src/views/business/erp/service/service-application-count.vue b/src/views/business/erp/service/service-application-count.vue new file mode 100644 index 0000000..329fa3c --- /dev/null +++ b/src/views/business/erp/service/service-application-count.vue @@ -0,0 +1,30 @@ + + + + + + \ No newline at end of file diff --git a/src/views/business/erp/service/service-applications-form.vue b/src/views/business/erp/service/service-applications-form.vue index d14991f..9abd3ca 100644 --- a/src/views/business/erp/service/service-applications-form.vue +++ b/src/views/business/erp/service/service-applications-form.vue @@ -149,7 +149,7 @@ @@ -448,8 +448,8 @@ serviceContent: [{ required: true, message: '服务内容描述 必填' }], }; - // 点击确定,验证表单 - async function onSubmit() { + // 点击保存,验证表单并保存 + async function onSave() { try { // 验证富文本编辑器内容 const editorContent = serviceContentRef.value?.getHtml() || ''; @@ -466,7 +466,25 @@ } } - // 新建、编辑API + // 点击提交,验证表单并提交 + async function onSubmit() { + try { + // 验证富文本编辑器内容 + const editorContent = serviceContentRef.value?.getHtml() || ''; + const cleanContent = editorContent.replace(/<[^>]*>/g, '').trim(); + if (!cleanContent) { + message.error('服务内容描述 必填'); + return; + } + + await formRef.value.validateFields(); + submit(); + } catch (err) { + message.error('参数验证错误,请仔细填写表单数据!'); + } + } + + // 新建、编辑保存API async function save() { SmartLoading.show(); try { @@ -479,11 +497,42 @@ } if (form.applicationId) { + // 编辑保存:调用update接口 await serviceApplicationsApi.update(submitData); } else { + // 新增保存:调用add接口 await serviceApplicationsApi.add(submitData); } - message.success('操作成功'); + message.success('保存成功'); + emits('reloadList'); + onClose(); + } catch (err) { + smartSentry.captureError(err); + } finally { + SmartLoading.hide(); + } + } + + // 新建、编辑提交API + async function submit() { + SmartLoading.show(); + try { + // 准备提交数据 + const submitData = { ...form }; + + // 确保attachmentIds字段存在且为字符串格式 + if (!submitData.attachmentIds) { + submitData.attachmentIds = ''; + } + + if (form.applicationId) { + // 编辑提交:调用submit接口,传递applicationId + await serviceApplicationsApi.submit(form.applicationId); + } else { + // 新增提交:调用addSubmit接口,传递完整数据 + await serviceApplicationsApi.addSubmit(submitData); + } + message.success('提交成功'); emits('reloadList'); onClose(); } catch (err) { diff --git a/src/views/business/erp/service/service-applications-list.vue b/src/views/business/erp/service/service-applications-list.vue index 5d61126..4ed7d7e 100644 --- a/src/views/business/erp/service/service-applications-list.vue +++ b/src/views/business/erp/service/service-applications-list.vue @@ -110,8 +110,9 @@ @@ -119,7 +120,30 @@ -
+ + +
+

请选择审核结果:

+ + + 同意 + + + 拒绝 + + +
+
+ + +