Commit 851e65ee authored by zhangyanni's avatar zhangyanni

Merge remote-tracking branch 'origin/dev1.0.11' into dev1.0.11

parents f86bd024 5e29ba9a
...@@ -35,6 +35,13 @@ ...@@ -35,6 +35,13 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
<div class="projectTab" v-if="!empTypeIf" style="margin-top: 20px">
<el-tabs v-model="fivehName">
<el-tab-pane :label="$t('releasejson.projecttitle')" name="five">
<submit-five :formDatas="formData" :maxIf="false" ref="childfive"></submit-five>
</el-tab-pane>
</el-tabs>
</div>
<el-row style="padding: 15px 0; text-align: center;width: 85%;z-index: 99;position: fixed;bottom: 0px;right: 0px;background:rgba(255,255,255,1);box-shadow:0px -5px 10px 0px rgba(0,0,0,0.1);"> <el-row style="padding: 15px 0; text-align: center;width: 85%;z-index: 99;position: fixed;bottom: 0px;right: 0px;background:rgba(255,255,255,1);box-shadow:0px -5px 10px 0px rgba(0,0,0,0.1);">
<el-button type="primary" style="width: 180px;height: 42px" @click="editDatapush">{{$t('findPassword.confirmModify')}}</el-button> <el-button type="primary" style="width: 180px;height: 42px" @click="editDatapush">{{$t('findPassword.confirmModify')}}</el-button>
<el-button style="width: 180px;height: 42px" @click="backgo">{{$t('workPlace.goreturn')}}</el-button> <el-button style="width: 180px;height: 42px" @click="backgo">{{$t('workPlace.goreturn')}}</el-button>
...@@ -50,21 +57,24 @@ ...@@ -50,21 +57,24 @@
import submitTwo from '../submitprojects/submittwo'; import submitTwo from '../submitprojects/submittwo';
import submitThree from '../submitprojects/submitthree'; import submitThree from '../submitprojects/submitthree';
import submitFour from '../submitprojects/submitfour'; import submitFour from '../submitprojects/submitfour';
import submitFive from '../submitprojects/submitfive';
import loadingCmpt from '../../../components/common/loading'; import loadingCmpt from '../../../components/common/loading';
export default { export default {
name : "setproject", name : "setproject",
data(){ data(){
return{ return{
firstName:'first', firstName:'first',
secondName:'second', secondName:'second',
thirdName:'third', thirdName:'third',
fourthName:'fourth', fourthName:'fourth',
formData:{}, fivehName:'five',
fullscreenLoading:false, formData:{},
} empTypeIf:true,
fullscreenLoading:false,
}
}, },
components:{ components:{
submitOne,submitTwo,submitThree,submitFour,loadingCmpt submitOne,submitTwo,submitThree,submitFour,loadingCmpt,submitFive
}, },
methods : { methods : {
editDatapush(){ editDatapush(){
...@@ -76,34 +86,37 @@ ...@@ -76,34 +86,37 @@
if(submitthree){ if(submitthree){
let submitfour = this.$refs.childfour.submitfourIfed(); let submitfour = this.$refs.childfour.submitfourIfed();
if(submitfour){ if(submitfour){
this.$confirm( this.$t('Otherjson.projectcontent'), { let submitfive = this.$refs.childfive.submitfiveIfed();
cancelButtonText: this.$t('commonTips.cancel'), if(submitfive){
confirmButtonText: this.$t('commonTips.confirm'), this.$confirm( this.$t('Otherjson.projectcontent'), {
closeOnClickModal:false, cancelButtonText: this.$t('commonTips.cancel'),
closeOnPressEscape:false, confirmButtonText: this.$t('commonTips.confirm'),
type: '', closeOnClickModal:false,
customClass: 'deleteConfirm' closeOnPressEscape:false,
}).then(() => { type: '',
api.updateProject(this.formData).then(response => { customClass: 'deleteConfirm'
if(response.code == 0) { }).then(() => {
this.fullscreenLoading = true; api.updateProject(this.formData).then(response => {
let _this = this; if(response.code == 0) {
setTimeout(function(){ this.fullscreenLoading = true;
_this.$message.success(_this.$t('Otherjson.revision')); let _this = this;
_this.$router.go(-1); setTimeout(function(){
_this.fullscreenLoading = false; _this.$message.success(_this.$t('Otherjson.revision'));
},2000) _this.$router.go(-1);
} else { _this.fullscreenLoading = false;
this.$message.error(response.msg); },2000)
} } else {
}) this.$message.error(response.msg);
.catch(error => { }
console.log("提交出错"); })
return false; .catch(error => {
}); console.log("提交出错");
}).catch(() => { return false;
});
}).catch(() => {
}); });
}
} }
} }
} }
...@@ -126,6 +139,13 @@ ...@@ -126,6 +139,13 @@
}, },
}, },
mounted(){ mounted(){
const empinfo = JSON.parse(this.Base64.decode(window.sessionStorage.getItem("userInfo")));
//empType 0 小b 1 大b 2 内部用户
if(empinfo.empType != 2){
this.empTypeIf = true;
}else{
this.empTypeIf = false;
}
api.selectProjectEditById(this.$route.query.projectId).then(response => { api.selectProjectEditById(this.$route.query.projectId).then(response => {
if(response.code == 0) { if(response.code == 0) {
this.formData = response.result; this.formData = response.result;
......
...@@ -44,4 +44,7 @@ export default { ...@@ -44,4 +44,7 @@ export default {
checkAccount (params){ checkAccount (params){
return api.fetchPost('/business/project/checkAccount',Qs.stringify(params)); return api.fetchPost('/business/project/checkAccount',Qs.stringify(params));
}, },
checkAccountEdit (params){
return api.fetchPost('/business/project/checkAccountEdit',Qs.stringify(params));
},
} }
\ No newline at end of file
...@@ -8,30 +8,31 @@ ...@@ -8,30 +8,31 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item v-if="isphone" :label="$t('saleManage.contactForm.phone')+':'" ref="formaccount" prop="account"> <el-form-item v-if="isphone" :label="$t('saleManage.contactForm.phone')+':'" ref="formaccount" prop="account">
<el-input @blur="accountblur" v-model="formData.account" @input="change()" autocomplete style="width: 450px;" :placeholder="$t('saleManage.contactForm.placeholderPhone')" <el-input @blur="accountblur()" v-model="formData.account" @input="change()" autocomplete style="width: 450px;" :placeholder="$t('saleManage.contactForm.placeholderPhone')"
maxlength="11"></el-input> maxlength="11"></el-input>
</el-form-item> </el-form-item>
<el-form-item v-if="!isphone" :label="$t('oneself.email')+':'" ref="formaccounted" prop="accounted"> <el-form-item v-if="!isphone" :label="$t('oneself.email')+':'" ref="formaccounted" prop="accounted">
<el-input @blur="accountblur" v-model="formData.accounted" @input="change()" style="width: 450px;" :placeholder="$t('commonTips.placeholderEmail')"></el-input> <el-input @blur="accountblur()" v-model="formData.accounted" @input="change()" style="width: 450px;" :placeholder="$t('commonTips.placeholderEmail')"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('personalAuth.name')+':'" prop="empName"> <el-form-item :label="$t('personalAuth.name')+':'" prop="empName">
<el-input v-model="formData.empName" style="width: 450px;" :placeholder="$t('saleManage.placeholderName')" maxlength="36"></el-input> <el-input :disabled="checkif" v-model="formData.empName" style="width: 450px;" :placeholder="$t('saleManage.placeholderName')" maxlength="36"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('saleManage.department')+':'" prop="empDeptName"> <el-form-item :label="$t('saleManage.department')+':'" prop="empDeptName">
<el-input v-model="formData.empDeptName" style="width: 450px;" :placeholder="$t('saleManage.placeholderDepartment')" maxlength="36"></el-input> <el-input :disabled="checkif" v-model="formData.empDeptName" style="width: 450px;" :placeholder="$t('saleManage.placeholderDepartment')" maxlength="36"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('personalAuth.position')+':'" prop="empPosition"> <el-form-item :label="$t('personalAuth.position')+':'" prop="empPosition">
<el-input v-model="formData.empPosition" style="width: 450px;" :placeholder="$t('saleManage.placeholderPosition')" maxlength="36"></el-input> <el-input :disabled="checkif" v-model="formData.empPosition" style="width: 450px;" :placeholder="$t('saleManage.placeholderPosition')" maxlength="36"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('saleManage.companyEmail')+':'" prop="companyEmail"> <el-form-item :label="$t('saleManage.companyEmail')+':'" prop="companyEmail">
<el-input v-model="formData.companyEmail" style="width: 450px;" :placeholder="$t('saleManage.placeholderEmail')" autocomplete maxlength="36"></el-input> <el-input :disabled="checkif" v-model="formData.companyEmail" style="width: 450px;" :placeholder="$t('saleManage.placeholderEmail')" autocomplete maxlength="36"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('saleManage.contactForm.businessCard')+':'" ref="formimg" style="width: 100%;"> <el-form-item :label="$t('saleManage.contactForm.businessCard')+':'" ref="formimg" style="width: 100%;">
<p class="imgTitle">{{$t('releasejson.companyLogoUrltext')}}</p> <p class="imgTitle">{{$t('releasejson.companyLogoUrltext')}}</p>
<div class="uploadImg"> <div class="uploadImg">
<el-upload <el-upload
:disabled="checkif"
:class="{hide:imagesIf}" :class="{hide:imagesIf}"
class="uploadImgCircle" class="uploadImgCircle"
name="fileUpload" name="fileUpload"
...@@ -74,6 +75,7 @@ ...@@ -74,6 +75,7 @@
} }
}; };
return { return {
submitoneIf:false,
ispone:1, ispone:1,
formData: { formData: {
accountType:'0', accountType:'0',
...@@ -111,6 +113,7 @@ ...@@ -111,6 +113,7 @@
empCardUrl: [{required: true,message: this.$t('personalAuth.emptyCard'),trigger: 'change'}], empCardUrl: [{required: true,message: this.$t('personalAuth.emptyCard'),trigger: 'change'}],
}, },
isphone:true, isphone:true,
checkif:false,
} }
}, },
methods:{ methods:{
...@@ -155,26 +158,58 @@ ...@@ -155,26 +158,58 @@
} }
}, },
accountblur(){ accountblur(){
// if(this.$refs.formData.validateField('account')){ // if(this.$refs.formData.validateField('account')){
let phoneType = this.isphone==true?0:1; let phoneType = this.isphone==true?0:1;
if(phoneType == 1){
this.formData.account = this.formData.accounted;
let regema = /^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-.])+[A-Za-z]{2,5}$/;
if(!regema.test(this.formData.account)){
return
}
}else{
let reg = /^((13[0-9])|(14([0]|[5-9]))|(15([0-3]|[5-9]))|(16([2]|[5-7]))|(17[0-9])|(18[0-9])|(19([1]|[8,9])))\d{8}$/;
if(!reg.test(this.formData.account)){
return
}
}
if(!this.maxIf){
let account = '';
if(phoneType == 1){ if(phoneType == 1){
this.formData.account = this.formData.accounted; account = this.formData.accounted;
let regema = /^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-.])+[A-Za-z]{2,5}$/;
if(!regema.test(this.formData.account)){
return
}
}else{ }else{
let reg = /^((13[0-9])|(14([0]|[5-9]))|(15([0-3]|[5-9]))|(16([2]|[5-7]))|(17[0-9])|(18[0-9])|(19([1]|[8,9])))\d{8}$/; account = this.formData.account;
if(!reg.test(this.formData.account)){
return
}
} }
api.checkAccount({accountType:phoneType,account:this.formData.account}).then(response => { api.checkAccountEdit({account:account}).then(response => {
if(response.code == 0) { if(response.code == 0) {
this.ispone = response.result; if(response.result.accountState == 0){
this.$refs.formData.validateField('account'); this.checkif = false;
this.$refs.formData.validateField('accounted'); }else if(response.result.accountState == 1){
this.checkif = true;
this.formData.empName = response.result.empName;
this.formData.empDeptName = response.result.empDeptName;
this.formData.empPosition = response.result.empPosition;
this.formData.companyEmail = response.result.companyEmail;
this.formData.empCardUrl = response.result.empCardUrl;
if(this.formData.empCardUrl){
this.fileList = [{url:this.formData.empCardUrl}];
this.imagesIf = true;
}
}
} else {
this.$message.error(response.msg);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
}
api.checkAccount({accountType:phoneType,account:this.formData.account}).then(response => {
if(response.code == 0) {
this.ispone = response.result;
this.$refs.formData.validateField('account');
this.$refs.formData.validateField('accounted');
if(this.maxIf){
if(response.result == 1){ if(response.result == 1){
this.$confirm(this.$t('Otherjson.remindtext'), { this.$confirm(this.$t('Otherjson.remindtext'), {
cancelButtonText: this.$t('Otherjson.enter'), cancelButtonText: this.$t('Otherjson.enter'),
...@@ -187,16 +222,27 @@ ...@@ -187,16 +222,27 @@
}); });
} }
} else {
// this.$message.error(response.msg);
} }
}) } else {
.catch(error => { // this.$message.error(response.msg);
console.log("提交出错"); }
return false; })
}); .catch(error => {
console.log("提交出错");
return false;
});
// } // }
}, },
submitfiveIfed(){
this.$refs.formData.validate((valid) => {
if(valid) {
this.submitfiveIf = true;
}else{
this.submitfiveIf = false;
}
});
return this.submitfiveIf
},
submitformgo(){ submitformgo(){
this.formData.projectId = this.formId; this.formData.projectId = this.formId;
if(this.ispone == 1){ if(this.ispone == 1){
...@@ -266,6 +312,18 @@ ...@@ -266,6 +312,18 @@
backd(){ backd(){
this.$emit('dataEvent',0,false); this.$emit('dataEvent',0,false);
}, },
},
watch:{
formDatas(val){
if(this.formDatas){
this.formData = val;
if(this.formData.accountType !=null){
this.formData.accountType = String(this.formData.accountType);
}else{
this.formData.accountType = '0';
}
}
}
} }
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment