|
@@ -257,13 +257,13 @@
|
|
|
<div class="form-input">
|
|
|
<ion-label>用工情况(人)</ion-label>
|
|
|
<ion-input type="number" placeholder="请输入用工人数" label-placement="stacked" :clear-input="true"
|
|
|
- v-model="dataModel.workSituation" class="custom">
|
|
|
+ v-model="dataModel.workSituation" class="custom" @ionBlur="workSituationBlur">
|
|
|
</ion-input>
|
|
|
</div>
|
|
|
<div class="form-input">
|
|
|
<ion-label>参保人数(人)</ion-label>
|
|
|
<ion-input type="number" placeholder="请输入参保人数" label-placement="stacked" :clear-input="true"
|
|
|
- v-model="dataModel.insuredCount" class="custom">
|
|
|
+ v-model="dataModel.insuredCount" class="custom" @ionBlur="insuredCountBlur">
|
|
|
</ion-input>
|
|
|
</div>
|
|
|
<div class="form-input">
|
|
@@ -327,8 +327,6 @@ interface StepParams{
|
|
|
statusVal: number,
|
|
|
loginUserID: string
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
export default defineComponent({
|
|
|
name: 'CompanyEdit',
|
|
|
components:{IndustrySelection,CompanySelectionLike},
|
|
@@ -482,6 +480,30 @@ export default defineComponent({
|
|
|
shortAgeTypeList.value = shortAgeTypeResult;
|
|
|
}
|
|
|
|
|
|
+ function isStringInteger(value: string) {
|
|
|
+ const n = parseInt(value, 10);
|
|
|
+ return n.toString() === value && Number.isInteger(n);
|
|
|
+ }
|
|
|
+
|
|
|
+ function workSituationBlur() {
|
|
|
+ inputValid.value = true;
|
|
|
+ if (formState.dataModel.workSituation != null) {
|
|
|
+ if(!isStringInteger(formState.dataModel.workSituation)||formState.dataModel.workSituation<1){
|
|
|
+ presentAlert("用工情况必须为一个正整数!");
|
|
|
+ inputValid.value = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function insuredCountBlur() {
|
|
|
+ inputValid.value = true;
|
|
|
+ if (formState.dataModel.insuredCount != null) {
|
|
|
+ if(!isStringInteger(formState.dataModel.insuredCount)||formState.dataModel.insuredCount<1){
|
|
|
+ presentAlert("参保人数必须为一个正整数!");
|
|
|
+ inputValid.value = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
const rules = computed(() => {
|
|
|
return {
|
|
@@ -598,6 +620,7 @@ export default defineComponent({
|
|
|
formState.dataModel.industryName = data.text;
|
|
|
}
|
|
|
|
|
|
+ const inputValid = ref(true);
|
|
|
const onNext = async () => {
|
|
|
console.log(formState.dataModel)
|
|
|
const isFormCorrect = await v$.value.$validate();
|
|
@@ -607,7 +630,7 @@ export default defineComponent({
|
|
|
}
|
|
|
companyCodeValidate();
|
|
|
inputDataValidate();
|
|
|
- if(isAllowCommit.value){
|
|
|
+ if(isAllowCommit.value&&inputValid.value){
|
|
|
saveCompany(formState.dataModel).then(result => {
|
|
|
if (result) {
|
|
|
router.push({path: './postList', query: {reload:1,id:formState.dataModel.companyID,status:3,isEdit:isAdd.value!=true?1:0}});
|
|
@@ -739,6 +762,8 @@ export default defineComponent({
|
|
|
infoAlterData,
|
|
|
alertingInfo,
|
|
|
loadingFirm,
|
|
|
+ workSituationBlur,
|
|
|
+ insuredCountBlur,
|
|
|
setInfoAlertOpen,
|
|
|
setInfoLoadingOpen,
|
|
|
onGetFirmByCompanyName,
|