|
@@ -69,7 +69,7 @@
|
|
|
</u-form-item>
|
|
|
</view>
|
|
|
</u-form>
|
|
|
- <u-button :type="buttonshow?'success':''" shape="circle" style="margin-top: 20rpx;" @click="submit">提交</u-button>
|
|
|
+ <u-button type="success" shape="circle" style="margin-top: 20rpx;" @click="submit">提交</u-button>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -103,13 +103,13 @@
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- buttonshow(){
|
|
|
- if(!this.deptList.companyContant&&this.label.length==0&&this.imgList.length==0&&!this.deptList.email&&!this.deptList.fax){
|
|
|
- return false
|
|
|
- }else{
|
|
|
- return true
|
|
|
- }
|
|
|
- }
|
|
|
+ // buttonshow(){
|
|
|
+ // if(!this.deptList.companyContant&&this.label.length==0&&this.imgList.length==0&&!this.deptList.email&&!this.deptList.fax){
|
|
|
+ // return false
|
|
|
+ // }else{
|
|
|
+ // return true
|
|
|
+ // }
|
|
|
+ // }
|
|
|
},
|
|
|
methods: {
|
|
|
add() {
|
|
@@ -156,70 +156,70 @@
|
|
|
},
|
|
|
submit() {
|
|
|
|
|
|
- let re = /^\w+@[a-zA-Z0-9]{2,10}(?:\.[a-z]{2,4}){1,3}$/;
|
|
|
- if(this.buttonshow){
|
|
|
- var that=this
|
|
|
- for(var i=0;i<this.Persons.length;i++){
|
|
|
- if(this.Persons[i].contacts.length<2||this.Persons[i].contacts.length>10){
|
|
|
- this.$api.msg('联系人姓名2-10个字')
|
|
|
- return
|
|
|
- }
|
|
|
- if(this.Persons[i].contactsPhone.length<2||this.Persons[i].contactsPhone.length>15){
|
|
|
- this.$api.msg('联系人电话7-15位数字')
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- if(!re.test(this.deptList.email)){
|
|
|
- this.$api.msg('邮箱输入错误')
|
|
|
+ // let re = /^\w+@[a-zA-Z0-9]{2,10}(?:\.[a-z]{2,4}){1,3}$/;
|
|
|
+ // if(this.buttonshow){
|
|
|
+ // }
|
|
|
+
|
|
|
+ var that=this
|
|
|
+ for(var i=0;i<this.Persons.length;i++){
|
|
|
+ if(this.Persons[i].contacts.length<2||this.Persons[i].contacts.length>10){
|
|
|
+ this.$api.msg('联系人姓名2-10个字')
|
|
|
return
|
|
|
}
|
|
|
- if(this.deptList.fax.length<6||this.deptList.fax.length>20){
|
|
|
- this.$api.msg('传真输入错误')
|
|
|
+ if(this.Persons[i].contactsPhone.length<2||this.Persons[i].contactsPhone.length>15){
|
|
|
+ this.$api.msg('联系人电话7-15位数字')
|
|
|
return
|
|
|
}
|
|
|
- this.deptList.label=this.label.toString()
|
|
|
- this.deptList.sitePhotoAddress=this.imgList.toString()
|
|
|
- this.deptList.settledCompanyContacts=this.Persons
|
|
|
- uni.showModal({
|
|
|
- content: "详细的企业信息有助于客户了解您的企业,是否确定提交?",
|
|
|
- showCancel: true,
|
|
|
- confirmText: '提交',
|
|
|
- success: function(res) {
|
|
|
- if (res.confirm) {
|
|
|
- uni.showLoading({
|
|
|
- title:"正在提交"
|
|
|
- })
|
|
|
- that.$api.doRequest('post', '/settledCompanyInfo/api/addSettledCompanyInfo', that.deptList).then(res => {
|
|
|
- if (res.data.code == 200) {
|
|
|
- var data={
|
|
|
- compName:'',
|
|
|
- title:'',
|
|
|
- mainBusinessType:'',
|
|
|
- companyProfile:'',
|
|
|
- }
|
|
|
- that.$store.commit('enterchange',data)
|
|
|
- uni.switchTab({
|
|
|
- url:'/pages/grain_pulse/home'
|
|
|
- })
|
|
|
- }else{
|
|
|
- this.$api.msg(res.data.message)
|
|
|
+ }
|
|
|
+ // if(!re.test(this.deptList.email)){
|
|
|
+ // this.$api.msg('邮箱输入错误')
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if(this.deptList.fax.length<6||this.deptList.fax.length>20){
|
|
|
+ // this.$api.msg('传真输入错误')
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ this.deptList.label=this.label.toString()
|
|
|
+ this.deptList.sitePhotoAddress=this.imgList.toString()
|
|
|
+ this.deptList.settledCompanyContacts=this.Persons
|
|
|
+ uni.showModal({
|
|
|
+ content: "详细的企业信息有助于客户了解您的企业,是否确定提交?",
|
|
|
+ showCancel: true,
|
|
|
+ confirmText: '提交',
|
|
|
+ success: function(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ uni.showLoading({
|
|
|
+ title:"正在提交"
|
|
|
+ })
|
|
|
+ that.$api.doRequest('post', '/settledCompanyInfo/api/editSettledCompanyInfo', that.deptList).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ var data={
|
|
|
+ compName:'',
|
|
|
+ title:'',
|
|
|
+ mainBusinessType:'',
|
|
|
+ companyProfile:'',
|
|
|
}
|
|
|
- uni.hideLoading()
|
|
|
- })
|
|
|
- .catch(res => {
|
|
|
- console.log("系统异常",res)
|
|
|
- uni.hideLoading()
|
|
|
- uni.showToast({
|
|
|
- title: "系统异常,请联系管理员",
|
|
|
- icon: 'none',
|
|
|
- duration: 2000
|
|
|
+ that.$store.commit('enterchange',data)
|
|
|
+ uni.navigateBack({
|
|
|
+ delta:2
|
|
|
})
|
|
|
+ }else{
|
|
|
+ this.$api.msg(res.data.message)
|
|
|
+ }
|
|
|
+ uni.hideLoading()
|
|
|
+ })
|
|
|
+ .catch(res => {
|
|
|
+ console.log("系统异常",res)
|
|
|
+ uni.hideLoading()
|
|
|
+ uni.showToast({
|
|
|
+ title: "系统异常,请联系管理员",
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
})
|
|
|
- }
|
|
|
+ })
|
|
|
}
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|