hl-core 0.0.10-beta.30 → 0.0.10-beta.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -204,7 +204,10 @@
204
204
  :rules="$rules.required.concat($rules.numbers)"
205
205
  />
206
206
  </base-form-section>
207
- <base-form-section v-if="$dataStore.isPension && whichForm === formStore.insuredFormKey" :title="$dataStore.t('pension.disabilityInfo')">
207
+ <base-form-section
208
+ v-if="$dataStore.isPension && (whichForm === formStore.insuredFormKey || $route.query.tab === 'slaveInsuredForm')"
209
+ :title="$dataStore.t('pension.disabilityInfo')"
210
+ >
208
211
  <base-form-toggle v-model="member.isDisability" :title="$dataStore.t('pension.ifHasDisability')" :disabled="isDisabled" :has-border="false" />
209
212
  <base-animation>
210
213
  <base-panel-input
@@ -631,50 +634,19 @@
631
634
  v-model="member.bankInfo.bankName"
632
635
  :value="member.bankInfo.bankName.nameRu"
633
636
  :label="$dataStore.t('clients.form.nameBank')"
634
- :readonly="isDisabled"
635
- :clearable="!isDisabled"
637
+ :readonly="true"
638
+ :clearable="false"
636
639
  :rules="$rules.objectRequired"
637
- append-inner-icon="mdi mdi-chevron-right"
638
- @append="openPanel($dataStore.t('clients.form.nameBank'), [], 'bankInfo', $dataStore.getBanks, '', 'bankName')"
639
640
  />
640
641
  <base-form-input
641
642
  v-model.trim="member.bankInfo.bin"
642
- :label="$dataStore.t('form.bin')"
643
643
  :maska="$maska.iin"
644
- :readonly="isDisabled"
645
- :clearable="!isDisabled"
644
+ :label="$dataStore.t('form.bin')"
645
+ :readonly="true"
646
+ :clearable="false"
646
647
  :rules="$rules.required.concat($rules.iinRight)"
647
648
  />
648
- <base-form-input v-model="member.bankInfo.bik" :label="$dataStore.t('clients.form.bik')" :readonly="isDisabled" :clearable="!isDisabled" :rules="$rules.required" />
649
- </base-form-section>
650
- <base-form-section v-if="$dataStore.hasAdditionalDocumentsSection(whichForm)" :title="$dataStore.t('form.phDocuments')">
651
- <base-file-input
652
- :label="$dataStore.t('form.identyDocument')"
653
- :disabled="isDisabled"
654
- :clearable="!isDisabled"
655
- icon="mdi-paperclip"
656
- @input="attachAdditionalFile($event, '1')"
657
- :rules="$rules.required"
658
- @onClear="clearAdditionalFile('1')"
659
- />
660
- <base-file-input
661
- :label="$dataStore.t('form.bankStatement')"
662
- :disabled="isDisabled"
663
- :clearable="!isDisabled"
664
- icon="mdi-paperclip"
665
- @input="attachAdditionalFile($event, '10')"
666
- :rules="$rules.required"
667
- @onClear="clearAdditionalFile('10')"
668
- />
669
- <base-file-input
670
- :label="$dataStore.t('pension.ENPFnote')"
671
- :disabled="isDisabled"
672
- :clearable="!isDisabled"
673
- icon="mdi-paperclip"
674
- @input="attachAdditionalFile($event, '8')"
675
- :rules="$rules.required"
676
- @onClear="clearAdditionalFile('8')"
677
- />
649
+ <base-form-input v-model="member.bankInfo.bik" :label="$dataStore.t('clients.form.bik')" :readonly="true" :clearable="false" :rules="$rules.required" />
678
650
  </base-form-section>
679
651
  <base-form-section :title="$dataStore.t('form.contactsData')" v-if="$dataStore.hasContactSection(whichForm)">
680
652
  <base-form-input
@@ -856,7 +828,8 @@ export default {
856
828
  const memberStore = useMemberStore();
857
829
  const whichForm = computed(() => route.query.tab as keyof typeof StoreMembers);
858
830
  const whichIndex = computed(() => route.query.i as string);
859
- const getMember = (whichForm: keyof typeof StoreMembers, whichIndex?: string) => memberStore.getMemberFromStore(whichForm, Number((whichIndex ? whichIndex : '0') as string))!;
831
+ const getMember = (whichForm: keyof typeof StoreMembers | 'slaveInsuredForm', whichIndex?: string) =>
832
+ memberStore.getMemberFromStore(whichForm, Number((whichIndex ? whichIndex : '0') as string))!;
860
833
  const member = ref(getMember(whichForm.value, whichIndex.value));
861
834
  const selectedFamilyMember = ref<Api.GKB.BirthInfo>({});
862
835
  const isPanelOpen = ref<boolean>(false);
@@ -871,7 +844,7 @@ export default {
871
844
  const isPositionPanelOpen = ref<boolean>(false);
872
845
  const isPanelLoading = ref<boolean>(false);
873
846
  const isChangingMember = ref<boolean>(false);
874
- const isNonResident = computed(() => !useEnv().isProduction && dataStore.isPension && member.value.signOfResidency.ids === '500011.2');
847
+ const isNonResident = computed(() => dataStore.isPension && member.value.signOfResidency.ids === '500011.2');
875
848
  const isDataFromGov = computed(() => member.value.verifyType === 'GBDFL' || member.value.verifyType === 'ESBD' || !!member.value.gosPersonData);
876
849
  const familyDialog = ref<boolean>(false);
877
850
  const deletionDialog = ref<boolean>(false);
@@ -888,7 +861,6 @@ export default {
888
861
  const imageDataList = ref<string[]>([]);
889
862
  const isRelative = ref<boolean>(false);
890
863
  const additionalDocuments = ref<any[]>([]);
891
- const requiredDocuments = ref<string[]>(['10']);
892
864
  const contragents = ref<ContragentType[]>([]);
893
865
 
894
866
  const currentPanelDeep = ref<string>();
@@ -924,6 +896,7 @@ export default {
924
896
  case formStore.policyholdersRepresentativeFormKey:
925
897
  return route.params.taskId !== '0';
926
898
  default:
899
+ if (route.query.tab === 'slaveInsuredForm') return true;
927
900
  return false;
928
901
  }
929
902
  };
@@ -1032,7 +1005,7 @@ export default {
1032
1005
  (dataStore.isLifetrip && whichForm.value === formStore.insuredFormKey && member.value.isInsuredUnderage),
1033
1006
  );
1034
1007
  const hasWorkPositionDict = dataStore.isBaiterek;
1035
- const hasIssuerOther = computed(() => !useEnv().isProduction && member.value.documentIssuers && member.value.documentIssuers.nameRu === 'Другое');
1008
+ const hasIssuerOther = computed(() => (useEnv().isProduction ? dataStore.isPension : true) && member.value.documentIssuers && member.value.documentIssuers.nameRu === 'Другое');
1036
1009
 
1037
1010
  const birthDateRule = computed(() => {
1038
1011
  const baseDateRule = dataStore.rules.required.concat(dataStore.rules.birthDate);
@@ -1107,15 +1080,18 @@ export default {
1107
1080
  });
1108
1081
 
1109
1082
  const getOtpConditionByMember = () => {
1110
- switch (whichForm.value) {
1083
+ const which = whichForm.value as keyof typeof StoreMembers | 'slaveInsuredForm';
1084
+ switch (which) {
1111
1085
  case formStore.policyholderFormKey:
1112
1086
  return route.params.taskId === '0';
1113
1087
  case formStore.insuredFormKey:
1114
- return route.query.id === '0';
1088
+ case 'slaveInsuredForm':
1115
1089
  case formStore.policyholdersRepresentativeFormKey:
1116
1090
  case formStore.beneficiaryFormKey:
1117
1091
  case formStore.beneficialOwnerFormKey:
1118
1092
  return route.query.id === '0';
1093
+ default:
1094
+ return dataStore.isPension && route.query.id === '0' && formStore.applicationData.processCode === 24;
1119
1095
  }
1120
1096
  };
1121
1097
  const otpCondition = computed(() => {
@@ -1124,6 +1100,7 @@ export default {
1124
1100
  if (whichForm.value === formStore.beneficiaryFormKey && member.value.age !== null && Number(member.value.age) < 18) return false;
1125
1101
  if (dataStore.isLifetrip && whichForm.value === formStore.insuredFormKey && member.value.isInsuredUnderage) return false;
1126
1102
  if (!member.value.phoneNumber || (member.value.phoneNumber && member.value.phoneNumber.length !== useMask().phone.length)) return false;
1103
+ if (route.query.tab === 'slaveInsuredForm' && route.query.id === '0') return true;
1127
1104
  return getOtpConditionByMember();
1128
1105
  });
1129
1106
 
@@ -1348,20 +1325,6 @@ export default {
1348
1325
  }
1349
1326
  };
1350
1327
 
1351
- const attachAdditionalFile = (event: InputEvent, code: string) => {
1352
- if (event.target) {
1353
- const files = (event.target as HTMLInputElement).files;
1354
- if (files && files.length && files[0]) {
1355
- if (files[0].type !== 'application/pdf') {
1356
- return dataStore.showToaster('error', dataStore.t('toaster.onlyPDF'), 6000);
1357
- }
1358
- const file = Object.assign(files[0]);
1359
- file.code = code;
1360
- additionalDocuments.value.push(file);
1361
- }
1362
- }
1363
- };
1364
-
1365
1328
  const attachDocumentReader = async (event: InputEvent) => {
1366
1329
  if (event.target) {
1367
1330
  const target = event.target as HTMLInputElement;
@@ -1550,6 +1513,7 @@ export default {
1550
1513
  };
1551
1514
 
1552
1515
  const getContragentClick = async (contragent: ContragentType) => {
1516
+ isButtonLoading.value = true;
1553
1517
  await dataStore.serializeContragentData(member.value, contragent);
1554
1518
  fioChooseDialog.value = false;
1555
1519
  isButtonLoading.value = false;
@@ -1623,10 +1587,11 @@ export default {
1623
1587
  }
1624
1588
  const isInsured = formStore.isPolicyholderInsured;
1625
1589
  const remoteIsInsured = ref<boolean | null>(null);
1590
+ const isNewApplication = route.params.taskId === '0';
1626
1591
  if (whichForm.value == formStore.policyholderFormKey || (dataStore.isPension && whichForm.value == formStore.insuredFormKey)) {
1627
1592
  if (route.params.taskId === '0') {
1628
1593
  try {
1629
- const taskId = await dataStore.startApplication(member.value, dataStore.isPension ? (String(route.query.type) === 'joint' ? 4 : 19) : undefined);
1594
+ const taskId = await dataStore.startApplication(member.value, dataStore.isPension ? (String(route.query.type) === 'joint' ? 25 : 19) : undefined);
1630
1595
  if (typeof taskId === 'string') {
1631
1596
  await dataStore.getApplicationData(taskId, false, false, false, false);
1632
1597
  remoteIsInsured.value = formStore.applicationData.clientApp.isInsured;
@@ -1655,20 +1620,7 @@ export default {
1655
1620
  (!formStore.applicationData.isEnpfSum && formStore.applicationData?.pensionApp.transferContracts && formStore.applicationData?.pensionApp.transferContracts.length) ||
1656
1621
  (formStore.applicationData?.pensionApp.compulsoryProfMonthCount && formStore.applicationData?.pensionApp.compulsoryProfMonthCount >= 60)
1657
1622
  )
1658
- requiredDocuments.value.push('8');
1659
- if (isNonResident.value) requiredDocuments.value.push('1');
1660
- if (requiredDocuments.value && requiredDocuments.value.length != 0) {
1661
- const hasAllDocs = requiredDocuments.value.every(fileCode => {
1662
- const result = additionalDocuments.value.map(i => i.code).indexOf(fileCode) !== -1;
1663
- if (!result) {
1664
- const missingFile = dataStore.dicFileTypeList.find((i: Value) => i.code === fileCode);
1665
- dataStore.showToaster('error', `Необходимо вложить ${missingFile?.nameRu}`, 8000);
1666
- }
1667
- return result;
1668
- });
1669
- if (!hasAllDocs) return;
1670
- }
1671
- await uploadAdditionalFiles(formStore.applicationData.processInstanceId);
1623
+ await uploadAdditionalFiles(formStore.applicationData.processInstanceId);
1672
1624
  }
1673
1625
  }
1674
1626
  const memberFromApplicaiton = memberStore.getMemberFromApplication(whichForm.value, whichIndex.value ? Number(whichIndex.value) : undefined);
@@ -1693,25 +1645,36 @@ export default {
1693
1645
  }
1694
1646
  }
1695
1647
  }
1696
- if (whichForm.value === formStore.insuredFormKey) {
1648
+ if (whichForm.value === formStore.insuredFormKey || memberFromApplicaiton.processInstanceId === formStore.applicationData.slave?.processInstanceId) {
1697
1649
  wasInsuredAction.value = true;
1698
1650
  if (dataStore.isPension) {
1699
- formStore.applicationData.pensionApp = {
1651
+ let data = {
1700
1652
  ...formStore.applicationData.pensionApp,
1701
- account: member.value.bankInfo.iik,
1702
- bankBik: member.value.bankInfo.bik,
1703
- bankBin: member.value.bankInfo.bankName.ids,
1704
- bankId: member.value.bankInfo.bankName.id,
1705
- bankName: member.value.bankInfo.bankName.nameRu,
1653
+ slave: formStore.applicationData.slave?.pensionApp ?? undefined,
1706
1654
  };
1707
- const data = {
1708
- ...formStore.applicationData.pensionApp,
1709
- transferContractCompany: formStore.applicationData.pensionApp.transferContractCompany?.nameRu ?? null,
1655
+ const bankinfo = {
1656
+ account: member.value.bankInfo.iik ?? '',
1657
+ bankBik: member.value.bankInfo.bik ?? '',
1658
+ bankBin: member.value.bankInfo.bin ? String(member.value.bankInfo.bin).replaceAll('-', '') : '',
1659
+ bankId: Number(member.value.bankInfo.bankName.id) ?? 0,
1660
+ bankName: member.value.bankInfo.bankName.nameRu ?? '',
1710
1661
  };
1662
+ if (route.query.tab === 'slaveInsuredForm') {
1663
+ data.slave = { ...data.slave, ...bankinfo };
1664
+ } else {
1665
+ data = { ...data, ...bankinfo };
1666
+ }
1667
+ const pensionKeysWithSpace = ['compulsoryContractAmount', 'compulsoryProfContractAmount', 'voluntaryContractAmount', 'ownFundsRaisAmount'];
1668
+ pensionKeysWithSpace.forEach(key => {
1669
+ if (/\s/g.test(data[key]) === true) data[key] = formatSpacedNumber(data[key]);
1670
+ });
1671
+ if (data.slave)
1672
+ pensionKeysWithSpace.forEach(key => {
1673
+ if (/\s/g.test(data.slave[key]) === true) data.slave[key] = dataStore.getNumberWithSpaces(data.slave[key]);
1674
+ });
1711
1675
  const isApplicationSaved = await dataStore.setApplication(data);
1676
+ if (!isNewApplication) dataStore.showToaster('info', dataStore.t('toaster.needToRecalculate'), 5000);
1712
1677
  if (isApplicationSaved === false) return;
1713
- if (formStore.applicationData.pensionApp.amount && formStore.applicationData.pensionApp.amount !== 0)
1714
- dataStore.showToaster('info', dataStore.t('toaster.needToRecalculate'), 5000);
1715
1678
  await dataStore.saveMember(member.value, 'Client', memberFromApplicaiton);
1716
1679
  }
1717
1680
  }
@@ -1801,11 +1764,11 @@ export default {
1801
1764
  isSubmittingForm.value = false;
1802
1765
  return;
1803
1766
  }
1804
- if (formStore.applicationData.pensionApp) {
1805
- formStore.applicationData.pensionApp.account = member.value.bankInfo.iik;
1806
- formStore.applicationData.pensionApp.bankBik = member.value.bankInfo.bik;
1807
- formStore.applicationData.pensionApp.bankBin = member.value.bankInfo.bin;
1808
- formStore.applicationData.pensionApp.bankId = member.value.bankInfo.bankName.id;
1767
+ if (formStore.pensionApp && whichForm.value === 'insuredForm') {
1768
+ formStore.pensionApp.account = member.value.bankInfo.iik;
1769
+ formStore.pensionApp.bankBik = member.value.bankInfo.bik;
1770
+ formStore.pensionApp.bankBin = member.value.bankInfo.bin;
1771
+ formStore.pensionApp.bankId = Number(member.value.bankInfo.bankName.id);
1809
1772
  }
1810
1773
  }
1811
1774
  const hasMemberSaved = await saveMember();
@@ -1822,11 +1785,11 @@ export default {
1822
1785
  isSubmittingForm.value = false;
1823
1786
  return;
1824
1787
  }
1825
- if (formStore.applicationData.pensionApp) {
1826
- formStore.applicationData.pensionApp.account = member.value.bankInfo.iik;
1827
- formStore.applicationData.pensionApp.bankBik = member.value.bankInfo.bik;
1828
- formStore.applicationData.pensionApp.bankBin = member.value.bankInfo.bin;
1829
- formStore.applicationData.pensionApp.bankId = member.value.bankInfo.bankName.id;
1788
+ if (formStore.pensionApp && whichForm.value === 'insuredForm') {
1789
+ formStore.pensionApp.account = member.value.bankInfo.iik;
1790
+ formStore.pensionApp.bankBik = member.value.bankInfo.bik;
1791
+ formStore.pensionApp.bankBin = member.value.bankInfo.bin;
1792
+ formStore.pensionApp.bankId = Number(member.value.bankInfo.bankName.id);
1830
1793
  }
1831
1794
  }
1832
1795
  const hasMemberSaved = await saveMember();
@@ -1972,13 +1935,6 @@ export default {
1972
1935
  deletionDialog.value = false;
1973
1936
  };
1974
1937
 
1975
- const clearAdditionalFile = (code: string) => {
1976
- const index = additionalDocuments.value.indexOf(additionalDocuments.value.find((i: any) => i.code == code));
1977
- if (index > -1) {
1978
- additionalDocuments.value.splice(index, 1);
1979
- }
1980
- };
1981
-
1982
1938
  const onInit = async () => {
1983
1939
  // if (route.params.taskId === '0' || (route.params.taskId !== '0' && dataStore.isProcessEditable(formStore.applicationData.statusCode))) {
1984
1940
  // await dataStore.getSignedDocList(formStore.applicationData.processInstanceId);
@@ -1990,6 +1946,13 @@ export default {
1990
1946
  }
1991
1947
  if (!member.value.id) {
1992
1948
  await router.replace({ query: { ...route.query, id: 0 } });
1949
+ if (dataStore.isPension) {
1950
+ switch (whichForm.value) {
1951
+ case formStore.insuredFormKey:
1952
+ setSignOfResidency();
1953
+ break;
1954
+ }
1955
+ }
1993
1956
  } else {
1994
1957
  if (route.query.id !== String(member.value.id)) await router.replace({ query: { ...route.query, id: member.value.id } });
1995
1958
  if (dataStore.isLifetrip) {
@@ -2008,12 +1971,10 @@ export default {
2008
1971
  member.value.documentDate = reformatDate(userDocument.issueDate);
2009
1972
  member.value.documentExpire = reformatDate(userDocument.expireDate);
2010
1973
  }
2011
-
2012
1974
  // const filteredDocuments: DocumentItem[] = dataStore.getFilesByIIN(member.value.iin!.replace(/-/g, '')) as DocumentItem[];
2013
1975
  // if (filteredDocuments && filteredDocuments.length) memberDocument.value = filteredDocuments[0];
2014
1976
  }
2015
1977
  await setDefaultValues();
2016
- if (Number(formStore.applicationData.processCode) === 4) dataStore.members.insuredApp.isMultiple = true;
2017
1978
  if (hasWorkPositionDict && member.value.positionCode === null) member.value.jobPosition = null;
2018
1979
  };
2019
1980
  onMounted(async () => {
@@ -2062,8 +2023,17 @@ export default {
2062
2023
  },
2063
2024
  );
2064
2025
 
2026
+ watch(
2027
+ () => member.value.registrationProvince,
2028
+ (val, oldVal) => {
2029
+ if (val.nameRu !== null && val.nameRu !== oldVal.nameRu && val.ids !== member.value.registrationCity.code) {
2030
+ member.value.registrationCity = new Value();
2031
+ }
2032
+ },
2033
+ );
2034
+
2065
2035
  const onIinInput = () => {
2066
- if (!!member.value.iin && member.value.iin.length === useMask().iin.length && memberSetting.value.isMultiple === true) {
2036
+ if (!!member.value.iin && member.value.iin.length === useMask().iin.length && memberSetting.value?.isMultiple === true) {
2067
2037
  const alreadyInStatement = formStore[whichForm.value as MultipleMember].findIndex((i: Member) => i.iin === member.value.iin);
2068
2038
  if (alreadyInStatement !== -1 && alreadyInStatement !== Number(whichIndex.value)) {
2069
2039
  dataStore.showToaster('error', dataStore.t('toaster.hasAlreadyMember'), 3000);
@@ -2127,15 +2097,35 @@ export default {
2127
2097
  );
2128
2098
  }
2129
2099
  if (dataStore.isPension) {
2130
- watch(
2131
- () => member.value.bankInfo.bankName,
2132
- val => {
2133
- if (val) {
2134
- member.value.bankInfo.bik = val.code as string;
2135
- member.value.bankInfo.bin = reformatIin(val.ids as string);
2136
- }
2137
- },
2138
- );
2100
+ if (member.value.bankInfo) {
2101
+ watch(
2102
+ () => member.value.bankInfo.iik,
2103
+ async val => {
2104
+ if (val && val.length === 20) {
2105
+ if (
2106
+ route.query.tab === 'slaveInsuredForm'
2107
+ ? formStore.insuredForm.some(i => i.bankInfo.iik === val)
2108
+ : formStore.applicationData.processCode === 25 && val === formStore.slaveInsuredForm.bankInfo.iik
2109
+ ) {
2110
+ dataStore.showToaster('error', `ИИК: "${val}" уже имеется в заявке`);
2111
+ member.value.bankInfo = new BankInfoClass();
2112
+ return;
2113
+ }
2114
+ isButtonLoading.value = true;
2115
+ const bank = await dataStore.getBankByAccountNumber(val);
2116
+ if (bank) {
2117
+ member.value.bankInfo.bik = String(bank.code);
2118
+ member.value.bankInfo.bin = member.value.bankInfo.bankName.ids = reformatIin(String(bank.ids));
2119
+ member.value.bankInfo.bankName.nameRu = String(bank.nameRu);
2120
+ member.value.bankInfo.bankName.id = Number(bank.id);
2121
+ } else member.value.bankInfo = new BankInfoClass();
2122
+ isButtonLoading.value = false;
2123
+ } else if (!val) {
2124
+ member.value.bankInfo = new BankInfoClass();
2125
+ }
2126
+ },
2127
+ );
2128
+ }
2139
2129
  watch(
2140
2130
  () => member.value.isDisability,
2141
2131
  val => {
@@ -2225,7 +2215,6 @@ export default {
2225
2215
  getContragentFromGBDFL,
2226
2216
  getContragent,
2227
2217
  attachFile,
2228
- attachAdditionalFile,
2229
2218
  attachDocumentReader,
2230
2219
  getDocumentReader,
2231
2220
  getFile,
@@ -2240,7 +2229,6 @@ export default {
2240
2229
  searchPositions,
2241
2230
  selectGbdDocument,
2242
2231
  pickPosition,
2243
- clearAdditionalFile,
2244
2232
  getContragentClick,
2245
2233
  };
2246
2234
  },