submit
This commit is contained in:
parent
b00e63af10
commit
eab282f1e8
@ -24,7 +24,19 @@ export default {
|
|||||||
imgUrl:'',
|
imgUrl:'',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onShow(){
|
||||||
|
console.log('ererer')
|
||||||
|
uni.login({
|
||||||
|
provider: 'weixin',
|
||||||
|
success(res) {
|
||||||
|
console.log(res,'resssssss')
|
||||||
|
},
|
||||||
|
fail(err) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
onLoad(options){
|
onLoad(options){
|
||||||
|
|
||||||
this.sn=options.sn
|
this.sn=options.sn
|
||||||
this.getPhoto()
|
this.getPhoto()
|
||||||
},
|
},
|
||||||
|
@ -16,7 +16,10 @@
|
|||||||
</tm-groupradio>
|
</tm-groupradio>
|
||||||
</view>
|
</view>
|
||||||
<tm-input name="title" required title="接待人姓名" v-model="reqData.receiver"></tm-input>
|
<tm-input name="title" required title="接待人姓名" v-model="reqData.receiver"></tm-input>
|
||||||
<tm-input :vertical="true" required :height="150" input-type="textarea" bg-color="grey-lighten-5" :maxlength="200" title="访问事由" placeholder="请输入" v-model="reqData.reasonVisit" ></tm-input>
|
<tm-pickers :default-value.sync="reqData.reasonVisit" rang-key="title" :list="chelianglis">
|
||||||
|
<tm-input name="reasonVisit" required title="访问事由" placeholder="请选择" disabled :value="obTstr2(reqData.reasonVisit)" right-icon="icon-angle-right"></tm-input>
|
||||||
|
</tm-pickers>
|
||||||
|
|
||||||
<view class="px-24">
|
<view class="px-24">
|
||||||
<tm-button navtie-type="form" theme="bg-gradient-blue-accent" @click="submit" block >提交数据</tm-button>
|
<tm-button navtie-type="form" theme="bg-gradient-blue-accent" @click="submit" block >提交数据</tm-button>
|
||||||
<view class="py-32 text-size-s text-grey text-align-center">请注意资料的上传,必填项。</view>
|
<view class="py-32 text-size-s text-grey text-align-center">请注意资料的上传,必填项。</view>
|
||||||
@ -31,11 +34,10 @@ export default {
|
|||||||
return {
|
return {
|
||||||
sn:'',
|
sn:'',
|
||||||
chelianglis:[
|
chelianglis:[
|
||||||
{title:"SUV",id:21},
|
{title:"商务洽谈",id:21},
|
||||||
{title:"面包车",id:31},
|
{title:"人才招聘",id:31},
|
||||||
{title:"跑车",id:41},
|
{title:"市场推广",id:41},
|
||||||
{title:"轿车",id:51},
|
{title:"文化交流",id:51},
|
||||||
{title:"房车",id:61},
|
|
||||||
],
|
],
|
||||||
shifoushiguche:[
|
shifoushiguche:[
|
||||||
{title:"男",checked:false,value:0},
|
{title:"男",checked:false,value:0},
|
||||||
@ -44,7 +46,7 @@ export default {
|
|||||||
],
|
],
|
||||||
reqData:{
|
reqData:{
|
||||||
receiver:'',
|
receiver:'',
|
||||||
reasonVisit:'',
|
reasonVisit:[],
|
||||||
tel:'',
|
tel:'',
|
||||||
userName:'',
|
userName:'',
|
||||||
gender:0,
|
gender:0,
|
||||||
@ -75,7 +77,6 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
submit(){
|
submit(){
|
||||||
|
|
||||||
if (!this.reqData.userName?.trim()){
|
if (!this.reqData.userName?.trim()){
|
||||||
uni.showToast({ title: '请输入访客姓名', icon: 'none' });
|
uni.showToast({ title: '请输入访客姓名', icon: 'none' });
|
||||||
return
|
return
|
||||||
@ -84,20 +85,19 @@ export default {
|
|||||||
uni.showToast({ title: '请输入手机号', icon: 'none' });
|
uni.showToast({ title: '请输入手机号', icon: 'none' });
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!this.reqData.reasonVisit?.trim()){
|
|
||||||
uni.showToast({ title: '请输入访问事由', icon: 'none' });
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!this.reqData.receiver?.trim()){
|
if (!this.reqData.receiver?.trim()){
|
||||||
uni.showToast({ title: '请输入接待人姓名', icon: 'none' });
|
uni.showToast({ title: '请输入接待人姓名', icon: 'none' });
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (!this.reqData.reasonVisit?.[0]?.title?.trim()){
|
||||||
|
uni.showToast({ title: '请选择访问事由', icon: 'none' });
|
||||||
|
return
|
||||||
|
}
|
||||||
this.$refs.toast.show({model:'load',mask:true})
|
this.$refs.toast.show({model:'load',mask:true})
|
||||||
|
|
||||||
uni.request({
|
uni.request({
|
||||||
method:'post',
|
method:'post',
|
||||||
url:'https://erpapi.fontree.cn/secret/visitor',
|
url:'https://erpapi.fontree.cn/secret/visitor',
|
||||||
data:{...this.reqData,gender: this.shifoushiguche.find(x=>x.checked).value,sn:this.sn},
|
data:{...this.reqData,gender: this.shifoushiguche.find(x=>x.checked).value,sn:this.sn,reasonVisit:this.reqData.reasonVisit?.[0]?.title},
|
||||||
complete:(res)=>{
|
complete:(res)=>{
|
||||||
this.$refs.toast.hide()
|
this.$refs.toast.hide()
|
||||||
if (res.data.code===200){
|
if (res.data.code===200){
|
||||||
@ -125,13 +125,6 @@ export default {
|
|||||||
//提交成功 。
|
//提交成功 。
|
||||||
uni.$tm.toast(e.msg)
|
uni.$tm.toast(e.msg)
|
||||||
},
|
},
|
||||||
obTstr(o){
|
|
||||||
if(Array.isArray(o)){
|
|
||||||
if(o.length.length===0) return "";
|
|
||||||
return o.join(",")
|
|
||||||
}
|
|
||||||
return JSON.stringify(o)
|
|
||||||
},
|
|
||||||
obTstr2(o){
|
obTstr2(o){
|
||||||
if(Array.isArray(o)){
|
if(Array.isArray(o)){
|
||||||
if(o.length.length===0) return "";
|
if(o.length.length===0) return "";
|
||||||
|
Loading…
Reference in New Issue
Block a user