Prechádzať zdrojové kódy

💊 优化创建自查表和协议年份

快乐的梦鱼 1 mesiac pred
rodič
commit
c4da6be2a5

+ 2 - 0
src/api/system/ConfigurationApi.ts

@@ -21,6 +21,8 @@ export const CommonConfigurationConfig = {
 export interface IConfigurationItem {
   baseServerUrl: string,
   articleMark: string,
+  collectSignYear: number,
+  collectFormYear: number,
   routeListImage: string,
   routeListImageStyle: Record<string, any>,
   routeListMarginTop: number,

+ 3 - 1
src/api/system/DefaultConfiguration.json

@@ -1,4 +1,6 @@
 {
   "baseServerUrl": "https://mnwh.wenlvti.net/api",
-  "articleMark": "以上内容摘自:"
+  "articleMark": "以上内容摘自:",
+  "collectSignYear": 2027,
+  "collectFormYear": 2025
 }

+ 1 - 1
src/common/config/AppCofig.ts

@@ -3,7 +3,7 @@
  * 说明:应用静态配置
  */
 export default {
-  version: '1.2.0',
+  version: '1.2.4',
   buildTime: (globalThis as any).__BUILD_TIMESTAMP__ as number,
   buildInfo: (globalThis as any).__BUILD_GUID__ as string,
   appId: 'wx1845c7dab9e8b236',

+ 13 - 3
src/pages/collect/assessment/argeement-sign.vue

@@ -84,6 +84,7 @@ import type { Rules } from 'async-validator';
 import { useLoadQuerys } from '@/common/composeabe/LoadQuerys';
 import CommonRoot from '@/components/dialog/CommonRoot.vue';
 import { useImageSimpleUploadCo } from '@/common/components/upload/ImageUploadCo';
+import { injectAppConfiguration } from '@/api/system/useAppConfiguration';
 
 const { querys } = useLoadQuerys({
   id: 0,
@@ -93,6 +94,7 @@ const { querys } = useLoadQuerys({
 });
 
 const authStore = useAuthStore();
+const appConfig = injectAppConfiguration();
 const currentAgreement = ref<AgreementDetail | null>(null);
 /** 甲方盖章日期(页面填写,保存时可拼为字符串提交) */
 const partyAStampDate = ref<AgreementYmdParts>({ year: '', month: '', day: '' });
@@ -224,14 +226,22 @@ const loader = useSimpleDataLoader(async () => {
 
 const submitLoading = ref(false);
 
-function createAgreement() {
+async function createAgreement() {
   const now = new Date();
   const u = authStore.userInfo;
   const nick = u?.nickname || u?.diyname;
+  const uid = authStore.userInfo?.id ?? authStore.userId;
+  const basicInfo = await AssessmentContentApi.getInheritorBasic(uid);
   const detail = new AgreementDetail();
   detail.userId = authStore.userInfo!.id;
-  detail.year = 2027;
-  detail.partyA = '福建省文化和旅游厅';
+  detail.year = appConfig.value?.collectSignYear || now.getFullYear() + 1;; 
+  if (basicInfo.level === 24) {
+    detail.partyA = '厦门市文化和旅游局';
+  } else if (basicInfo.level === 25) {
+    detail.partyA = '厦门市文化和旅游局';
+  } else {
+    detail.partyA = '福建省文化和旅游厅';
+  }
   detail.partyB = nick ?? '';
   console.log(authStore.userInfo, u, nick);
   partyAStampDate.value = { year: now.getFullYear().toString(), month: (now.getMonth() + 1).toString(), day: now.getDate().toString() };

+ 3 - 1
src/pages/collect/assessment/evaluation-form.vue

@@ -90,6 +90,7 @@ import Field from '@/components/form/Field.vue';
 import SelfAssessmentFormDisplay from './components/SelfAssessmentFormDisplay.vue';
 import { buildSelfAssessmentFormOptions } from './evaluationFormOptions';
 import { useImageSimpleUploadCo } from '@/common/components/upload/ImageUploadCo';
+import { injectAppConfiguration } from '@/api/system/useAppConfiguration';
 
 /** 评估表下方展示用:各级审核意见(不接数据、禁用) */
 const externalReviewSectionTitles = ref([
@@ -115,6 +116,7 @@ const { querys } = useLoadQuerys({
 const currentForm = ref<SelfAssessmentDetail | null>(null);
 const currentFormCheckItems = ref<SelfAssessmentCheckItemAnswer[]>([]);
 const authStore = useAuthStore();
+const appConfig = injectAppConfiguration();
 
 const currentYear = new Date().getFullYear();
 
@@ -167,7 +169,7 @@ const submitLoading = ref(false);
 async function createForm() {
   const detail = new SelfAssessmentDetail();
   detail.userId = authStore.userInfo!.id;
-  detail.year = new Date().getFullYear();
+  detail.year = appConfig.value?.collectFormYear || new Date().getFullYear();
   detail.checkItems = [];
   currentForm.value = detail;
   loadEditorContent();