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 @@
</el-tab-pane>
</el-tabs>
</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-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>
......@@ -50,21 +57,24 @@
import submitTwo from '../submitprojects/submittwo';
import submitThree from '../submitprojects/submitthree';
import submitFour from '../submitprojects/submitfour';
import submitFive from '../submitprojects/submitfive';
import loadingCmpt from '../../../components/common/loading';
export default {
name : "setproject",
data(){
return{
firstName:'first',
secondName:'second',
thirdName:'third',
fourthName:'fourth',
formData:{},
fullscreenLoading:false,
}
return{
firstName:'first',
secondName:'second',
thirdName:'third',
fourthName:'fourth',
fivehName:'five',
formData:{},
empTypeIf:true,
fullscreenLoading:false,
}
},
components:{
submitOne,submitTwo,submitThree,submitFour,loadingCmpt
submitOne,submitTwo,submitThree,submitFour,loadingCmpt,submitFive
},
methods : {
editDatapush(){
......@@ -76,34 +86,37 @@
if(submitthree){
let submitfour = this.$refs.childfour.submitfourIfed();
if(submitfour){
this.$confirm( this.$t('Otherjson.projectcontent'), {
cancelButtonText: this.$t('commonTips.cancel'),
confirmButtonText: this.$t('commonTips.confirm'),
closeOnClickModal:false,
closeOnPressEscape:false,
type: '',
customClass: 'deleteConfirm'
}).then(() => {
api.updateProject(this.formData).then(response => {
if(response.code == 0) {
this.fullscreenLoading = true;
let _this = this;
setTimeout(function(){
_this.$message.success(_this.$t('Otherjson.revision'));
_this.$router.go(-1);
_this.fullscreenLoading = false;
},2000)
} else {
this.$message.error(response.msg);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
}).catch(() => {
let submitfive = this.$refs.childfive.submitfiveIfed();
if(submitfive){
this.$confirm( this.$t('Otherjson.projectcontent'), {
cancelButtonText: this.$t('commonTips.cancel'),
confirmButtonText: this.$t('commonTips.confirm'),
closeOnClickModal:false,
closeOnPressEscape:false,
type: '',
customClass: 'deleteConfirm'
}).then(() => {
api.updateProject(this.formData).then(response => {
if(response.code == 0) {
this.fullscreenLoading = true;
let _this = this;
setTimeout(function(){
_this.$message.success(_this.$t('Otherjson.revision'));
_this.$router.go(-1);
_this.fullscreenLoading = false;
},2000)
} else {
this.$message.error(response.msg);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
}).catch(() => {
});
});
}
}
}
}
......@@ -126,6 +139,13 @@
},
},
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 => {
if(response.code == 0) {
this.formData = response.result;
......
......@@ -44,4 +44,7 @@ export default {
checkAccount (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 @@
</el-radio-group>
</el-form-item>
<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>
</el-form-item>
<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 :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 :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 :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 :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 :label="$t('saleManage.contactForm.businessCard')+':'" ref="formimg" style="width: 100%;">
<p class="imgTitle">{{$t('releasejson.companyLogoUrltext')}}</p>
<div class="uploadImg">
<el-upload
:disabled="checkif"
:class="{hide:imagesIf}"
class="uploadImgCircle"
name="fileUpload"
......@@ -74,6 +75,7 @@
}
};
return {
submitoneIf:false,
ispone:1,
formData: {
accountType:'0',
......@@ -111,6 +113,7 @@
empCardUrl: [{required: true,message: this.$t('personalAuth.emptyCard'),trigger: 'change'}],
},
isphone:true,
checkif:false,
}
},
methods:{
......@@ -155,26 +158,58 @@
}
},
accountblur(){
// 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){
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
}
account = this.formData.accounted;
}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
}
account = this.formData.account;
}
api.checkAccount({accountType:phoneType,account:this.formData.account}).then(response => {
api.checkAccountEdit({account:account}).then(response => {
if(response.code == 0) {
this.ispone = response.result;
this.$refs.formData.validateField('account');
this.$refs.formData.validateField('accounted');
if(response.result.accountState == 0){
this.checkif = false;
}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){
this.$confirm(this.$t('Otherjson.remindtext'), {
cancelButtonText: this.$t('Otherjson.enter'),
......@@ -187,16 +222,27 @@
});
}
} else {
// this.$message.error(response.msg);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
} else {
// this.$message.error(response.msg);
}
})
.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(){
this.formData.projectId = this.formId;
if(this.ispone == 1){
......@@ -266,6 +312,18 @@
backd(){
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>
......
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