|
@@ -27,8 +27,10 @@
|
|
|
<div class="form-input">
|
|
|
<ion-label>企业名称<span class="danger">*</span></ion-label>
|
|
|
<ion-input placeholder="请输入企业名称" label-placement="stacked" :clear-input="true"
|
|
|
- v-model="dataModel.companyName" class="custom">
|
|
|
+ v-model="dataModel.companyName" class="custom" :style="isAdd?'width: 78%;':''">
|
|
|
</ion-input>
|
|
|
+ <ion-label v-if="isAdd" style="float:right;width:80px;color:#02A5F0FF;position: relative;bottom:34px;left:14px;"
|
|
|
+ @click="onGetFirmByCompanyName">同步</ion-label>
|
|
|
<!-- <ion-note slot="error">企业名称不能为空</ion-note>-->
|
|
|
</div>
|
|
|
<div class="form-input">
|
|
@@ -272,19 +274,31 @@
|
|
|
<ion-button style="width:100%;" @click="onNext">保存并下一步</ion-button>
|
|
|
</ion-toolbar>
|
|
|
</ion-footer>
|
|
|
+ <ion-alert
|
|
|
+ :is-open="alertingInfo"
|
|
|
+ :header="infoAlterData.title"
|
|
|
+ :message="infoAlterData.message"
|
|
|
+ :buttons="infoAlertButtons"
|
|
|
+ @didDismiss="setInfoAlertOpen(false)"
|
|
|
+ ></ion-alert>
|
|
|
+ <ion-loading
|
|
|
+ :is-open="loadingFirm"
|
|
|
+ message="正在同步企业信息..."
|
|
|
+ @didDismiss="setInfoLoadingOpen(false)" >
|
|
|
+ </ion-loading>
|
|
|
</ion-page>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
-import {computed, defineComponent, reactive, ref, toRefs} from "vue";
|
|
|
import {arrowBackOutline} from 'ionicons/icons';
|
|
|
-import {useRouter} from "vue-router";
|
|
|
-import dayjs from "dayjs";
|
|
|
-import {useRoute} from "vue-router/dist/vue-router";
|
|
|
-import {getSysDictionaryList} from "@/api/system/dictionary";
|
|
|
-import {required} from "@vuelidate/validators";
|
|
|
-import {useVuelidate} from "@vuelidate/core";
|
|
|
-import {getCompanyById, getRegionList, getSiteList, getStreeList, saveCompanyInfo} from "@/api/company";
|
|
|
+import {defineComponent, reactive, ref,computed, toRefs} from "vue";
|
|
|
+import {useRoute,useRouter} from "vue-router";
|
|
|
import {alertController, onIonViewDidEnter} from "@ionic/vue";
|
|
|
+import {useVuelidate} from "@vuelidate/core";
|
|
|
+import {getCompanyById, getRegionList, getSiteList, getStreeList,normalFirm, saveCompanyInfo} from "@/api/company";
|
|
|
+import {required} from "@vuelidate/validators";
|
|
|
+import {getSysDictionaryList} from "@/api/system/dictionary";
|
|
|
+import dayjs from "dayjs";
|
|
|
+import IndustrySelection from "@/components/industrySelection.vue";
|
|
|
|
|
|
interface StepParams{
|
|
|
loginUserID: string,
|
|
@@ -302,7 +316,30 @@ export default defineComponent({
|
|
|
openID:"",
|
|
|
statusVal: 1
|
|
|
});
|
|
|
+ const isAdd = ref(false);
|
|
|
const isShow = ref<any>(false);
|
|
|
+ const loadingFirm = ref(false);
|
|
|
+ // 信息弹窗内容
|
|
|
+ const infoAlterData = reactive({
|
|
|
+ title:"",
|
|
|
+ message:""
|
|
|
+ });
|
|
|
+ const alertingInfo = ref(false);
|
|
|
+ function setInfoAlertOpen(value: boolean) {
|
|
|
+ alertingInfo.value = value;
|
|
|
+ }
|
|
|
+ function setInfoLoadingOpen(value: boolean) {
|
|
|
+ loadingFirm.value = value;
|
|
|
+ }
|
|
|
+ const infoAlertButtons = [
|
|
|
+ {
|
|
|
+ text: '确定',
|
|
|
+ role: 'confirm',
|
|
|
+ handler: () => {
|
|
|
+ console.log('s');
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
const isLongDate = ref<any>(false);
|
|
|
const formState = reactive({
|
|
|
dataModel: {
|
|
@@ -342,7 +379,6 @@ export default defineComponent({
|
|
|
{title: '岗位信息', desc: '企业岗位信息', val: 2}
|
|
|
]);
|
|
|
|
|
|
- const professionList = ref<any>([]);
|
|
|
const companyStatusList = ref([]);
|
|
|
const companyModelList = ref<any>([]);
|
|
|
const companyTypeList = ref<any>([]);
|
|
@@ -459,6 +495,63 @@ export default defineComponent({
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ const onGetFirmByCompanyName = async function() {
|
|
|
+ if(formState.dataModel.companyName){
|
|
|
+ await setInfoLoadingOpen(true);
|
|
|
+ const matchedFirmInfo :any = await normalFirm(formState.dataModel.companyName);
|
|
|
+ if(matchedFirmInfo){
|
|
|
+ formState.dataModel.frName = matchedFirmInfo.frName;
|
|
|
+ formState.dataModel.registeredCapital = matchedFirmInfo.registeredCapital;
|
|
|
+ formState.dataModel.companyCode = matchedFirmInfo.companyCode;
|
|
|
+ formState.dataModel.insuredCount = matchedFirmInfo.insuredCount;
|
|
|
+ formState.dataModel.userMobile = matchedFirmInfo.userMobile;
|
|
|
+ formState.dataModel.companyEmail = matchedFirmInfo.companyEmail;
|
|
|
+ formState.dataModel.companyAddress = matchedFirmInfo.companyAddress;
|
|
|
+ formState.dataModel.businScope = matchedFirmInfo.businScope;
|
|
|
+ await setInfoLoadingOpen(false);
|
|
|
+ infoAlterData.title = "提示";
|
|
|
+ infoAlterData.message = "同步成功!";
|
|
|
+ await setInfoAlertOpen(true);
|
|
|
+ }else{
|
|
|
+ await setInfoLoadingOpen(false);
|
|
|
+ infoAlterData.title = "错误";
|
|
|
+ infoAlterData.message = "查找不到该企业,请核实企业名称是否正确!";
|
|
|
+ await setInfoAlertOpen(true);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ infoAlterData.title = "提示";
|
|
|
+ infoAlterData.message = "请输入企业名称!";
|
|
|
+ await setInfoAlertOpen(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ const onSetIndustryID = (data: any)=>{
|
|
|
+ formState.dataModel.industryID = data.value;
|
|
|
+ formState.dataModel.industryName = data.text;
|
|
|
+ }
|
|
|
+
|
|
|
+ const onNext = async () => {
|
|
|
+ const isFormCorrect = await v$.value.$validate();
|
|
|
+ if (!isFormCorrect) {
|
|
|
+ await presentAlert('请输入完整信息!');
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ companyCodeValidate();
|
|
|
+ inputDataValidate();
|
|
|
+ if(isAllowCommit.value){
|
|
|
+ formState.dataModel.loginUserID = curStepData.value.loginUserID;
|
|
|
+ saveCompanyInfo(formState.dataModel).then(result => {
|
|
|
+ if (result) {
|
|
|
+ router.push({path: './postList', query: {reload:1,id:formState.dataModel.companyID,status:2,userID:curStepData.value.loginUserID,openId:curStepData.value.openID}});
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ const onBack = () => {
|
|
|
+ router.push({path:'/jobUserInfo/index', query: {userId: curStepData.value.loginUserID,openId: curStepData.value.openID}});
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
const getRegionListData = () => {
|
|
|
getRegionList({}).then(data => {
|
|
@@ -519,38 +612,16 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
|
|
|
- const onBack = () => {
|
|
|
- router.push({path:'/jobUserInfo/index', query: {userId: curStepData.value.loginUserID,openId: curStepData.value.openID}});
|
|
|
- }
|
|
|
|
|
|
- const onSetIndustryID = (data: any)=>{
|
|
|
- formState.dataModel.industryID = data.value;
|
|
|
- formState.dataModel.industryName = data.text;
|
|
|
- }
|
|
|
|
|
|
- const onNext = async () => {
|
|
|
- const isFormCorrect = await v$.value.$validate();
|
|
|
- if (!isFormCorrect) {
|
|
|
- await presentAlert('请输入完整信息!');
|
|
|
- return null;
|
|
|
- }
|
|
|
- companyCodeValidate();
|
|
|
- inputDataValidate();
|
|
|
- if(isAllowCommit.value){
|
|
|
- formState.dataModel.loginUserID = curStepData.value.loginUserID;
|
|
|
- saveCompanyInfo(formState.dataModel).then(result => {
|
|
|
- if (result) {
|
|
|
- router.push({path: './postList', query: {reload:1,id:formState.dataModel.companyID,status:2,userID:curStepData.value.loginUserID,openId:curStepData.value.openID}});
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- };
|
|
|
+
|
|
|
|
|
|
return {
|
|
|
...toRefs(formState),
|
|
|
arrowBackOutline,
|
|
|
route,
|
|
|
router,
|
|
|
+ isAdd,
|
|
|
isShow,
|
|
|
v$,
|
|
|
isLongDate,
|
|
@@ -565,6 +636,14 @@ export default defineComponent({
|
|
|
companyModelList,
|
|
|
companyTagList,
|
|
|
estateCategoryList,
|
|
|
+ infoAlertButtons,
|
|
|
+ infoAlterData,
|
|
|
+ alertingInfo,
|
|
|
+ loadingFirm,
|
|
|
+ setInfoAlertOpen,
|
|
|
+ setInfoLoadingOpen,
|
|
|
+ onGetFirmByCompanyName,
|
|
|
+ onSetIndustryID,
|
|
|
onNext,
|
|
|
onBack,
|
|
|
getCompanyStatusList,
|