|
@@ -1,19 +1,29 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<Form ref="applyForm" :model="applyForm" :rules="ruleValidate" label-position="top" class="apply-form">
|
|
|
- <FormItem label="学校名称" prop="name">
|
|
|
- <Input v-model="applyForm.name"></Input>
|
|
|
+ <FormItem :label="$t('settings.applyForm.name')" prop="name">
|
|
|
+ <Input v-model="applyForm.name" :placeholder="$t('settings.applyForm.place1')"></Input>
|
|
|
</FormItem>
|
|
|
- <FormItem label="学校简码" prop="id">
|
|
|
+ <!-- <FormItem label="学校简码" prop="id">
|
|
|
<Input v-model="applyForm.id"></Input>
|
|
|
</FormItem>
|
|
|
<FormItem label="学校代码" prop="code">
|
|
|
<Input v-model="applyForm.code"></Input>
|
|
|
+ </FormItem> -->
|
|
|
+ <FormItem :label="$t('settings.applyForm.address')">
|
|
|
+ <BaseAreaPicker ref="areaPicker" v-if="isChinaSite"></BaseAreaPicker>
|
|
|
+ <div class="country-select" v-if="!isChinaSite">
|
|
|
+ <Select v-model="curCountry" filterable placeholder="选择学校所在地区">
|
|
|
+ <Option v-for="(country,index) in countryArr" :value="country.cn" :key="index" >{{ country.cn }}</Option>
|
|
|
+ </Select>
|
|
|
+ </div>
|
|
|
+ <Input type="textarea" :autosize="{minRows: 3,maxRows: 5}" v-model="applyForm.address" :placeholder="$t('settings.applyForm.place2')"></Input>
|
|
|
</FormItem>
|
|
|
- <FormItem label="学校位置">
|
|
|
- <!-- <Input v-model="applyForm.region"></Input> -->
|
|
|
- <BaseAreaPicker ref="areaPicker"></BaseAreaPicker>
|
|
|
- <Input type="textarea" :autosize="{minRows: 3,maxRows: 5}" v-model="applyForm.address"></Input>
|
|
|
+ <FormItem :label="$t('settings.applyForm.cellphone')" prop="cellphone">
|
|
|
+ <Input v-model="applyForm.cellphone" :placeholder="$t('settings.applyForm.place3')"></Input>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem :label="$t('settings.applyForm.content')" prop="content">
|
|
|
+ <Input type="textarea" :autosize="{minRows: 3,maxRows: 5}" v-model="applyForm.content" :placeholder="$t('settings.applyForm.place4')"></Input>
|
|
|
</FormItem>
|
|
|
<!-- <FormItem label="学校图标">
|
|
|
<Upload v-if="!isPreview" ref="upload" :show-upload-list="false" :on-success="handleSuccess"
|
|
@@ -32,15 +42,19 @@
|
|
|
</div>
|
|
|
</FormItem> -->
|
|
|
</Form>
|
|
|
- <Button style="background-color: #168794;width: 90%;margin-left: 5%;" @click="onSubmit">提交申请</Button>
|
|
|
+ <Button style="background-color: #168794;width: 90%;margin-left: 5%;" @click="onSubmit" :loading="isBtnLoading">{{ $t('settings.applyForm.submit') }}</Button>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import countries from '@/static/countries.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ isBtnLoading:false,
|
|
|
isPreview: false,
|
|
|
+ curCountry:'',
|
|
|
+ countryArr:[],
|
|
|
applyForm: {
|
|
|
id: '',
|
|
|
code: '',
|
|
@@ -49,7 +63,9 @@
|
|
|
province: '',
|
|
|
city: '',
|
|
|
picture: '',
|
|
|
- address:''
|
|
|
+ address:'',
|
|
|
+ cellphone:'',
|
|
|
+ content:''
|
|
|
},
|
|
|
uploadList: [],
|
|
|
ruleValidate: {
|
|
@@ -68,21 +84,51 @@
|
|
|
message: '学校代码不能为空 ',
|
|
|
trigger: 'blur'
|
|
|
}],
|
|
|
+ cellphone: [{
|
|
|
+ required: true,
|
|
|
+ message: '联系方式不能为空 ',
|
|
|
+ trigger: 'blur'
|
|
|
+ }],
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.countryArr = countries
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ // 提交建立学校申请
|
|
|
onSubmit() {
|
|
|
this.$refs.applyForm.validate((valid) => {
|
|
|
if (valid) {
|
|
|
let pickResult = this.$refs.areaPicker.pickResult
|
|
|
if(pickResult.province && pickResult.city && pickResult.area){
|
|
|
-
|
|
|
+ this.isBtnLoading = true
|
|
|
+ let formInfo = this.applyForm
|
|
|
+ let params = {
|
|
|
+ name:formInfo.name,
|
|
|
+ area:pickResult.province + pickResult.city + pickResult.area + formInfo.address,
|
|
|
+ tmdname:this.$store.state.userInfo.name,
|
|
|
+ tmdid:this.$store.state.userInfo.TEAMModelId,
|
|
|
+ cellphone:formInfo.cellphone,
|
|
|
+ content:formInfo.content
|
|
|
+ }
|
|
|
+ this.$api.schoolSetting.applySchool(params).then(res => {
|
|
|
+ if(!res.error){
|
|
|
+ setTimeout(()=> {
|
|
|
+ this.isBtnLoading = false
|
|
|
+ this.$emit('applySuc')
|
|
|
+ this.$Message.success(this.$t('settings.applyForm.submitSuc'))
|
|
|
+ },1000)
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ this.$Message.error(err)
|
|
|
+ this.isBtnLoading = false
|
|
|
+ })
|
|
|
}else{
|
|
|
- this.$Message.error('请选择正确的省市区!');
|
|
|
+ this.$Message.error(this.$t('settings.applyForm.errTip1'));
|
|
|
}
|
|
|
} else {
|
|
|
- this.$Message.error('请将信息填写完整!');
|
|
|
+ this.$Message.error(this.$t('settings.applyForm.errTip2'));
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -91,15 +137,20 @@
|
|
|
this.applyForm.picture = res.url
|
|
|
this.isPreview = true
|
|
|
},
|
|
|
- handleFormatError(file) {
|
|
|
- this.$Message.error('上传文件格式只能是jpg、jpeg、png!')
|
|
|
- },
|
|
|
- handleMaxSize(file) {
|
|
|
- this.$Message.error('上传文件大小不能超过10M!')
|
|
|
- },
|
|
|
+ // handleFormatError(file) {
|
|
|
+ // this.$Message.error('上传文件格式只能是jpg、jpeg、png!')
|
|
|
+ // },
|
|
|
+ // handleMaxSize(file) {
|
|
|
+ // this.$Message.error('上传文件大小不能超过10M!')
|
|
|
+ // },
|
|
|
handleBeforeUpload() {
|
|
|
|
|
|
}
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ isChinaSite(){
|
|
|
+ return this.$store.state.config.srvAdr === 'China'
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -107,6 +158,15 @@
|
|
|
<style lang="less">
|
|
|
.apply-form {
|
|
|
padding: 50px 20px;
|
|
|
+
|
|
|
+ .country-select{
|
|
|
+ width: 200px;
|
|
|
+ margin: 10px 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ivu-select-input{
|
|
|
+ color: #DDDDDD;
|
|
|
+ }
|
|
|
|
|
|
.ivu-form-item-label {
|
|
|
color: #bbb;
|
|
@@ -118,11 +178,12 @@
|
|
|
background: #575757;
|
|
|
border-color: transparent;
|
|
|
height: 35px;
|
|
|
+ padding: 10px;
|
|
|
color: #fff;
|
|
|
}
|
|
|
|
|
|
.ivu-input::-webkit-input-placeholder {
|
|
|
- color: #808080;
|
|
|
+ color: #a8a8a8;
|
|
|
}
|
|
|
|
|
|
.ivu-select-single .ivu-select-selection {
|