研发访客须知

master
lion 2 years ago
parent c9ca17fb2e
commit 87566c4f23

@ -2,36 +2,44 @@
<page-meta :page-style="'overflow:'+(adminListShow||configshow||areaShow?'hidden':'visible')"></page-meta> <page-meta :page-style="'overflow:'+(adminListShow||configshow||areaShow?'hidden':'visible')"></page-meta>
<view class="containers"> <view class="containers">
<!-- 拜访须知 --> <!-- 拜访须知 -->
<u-popup :show="configshow" class="configwrap" closeable mode="bottom" @close="closeConfig"> <u-popup :show="configshow" :mask-close-able="false" class="configwrap" mode="bottom">
<view class="configtitle"> <view class="configtitle">
{{configInfo.name}} {{configInfo.name}}
</view> </view>
<view class="configvalue" v-html="configInfo.value"> <view class="configvalue">
<view v-html="configInfo.value">
</view>
<view style="text-align: center;">
<view class="configbtn" @click="closeConfig">
确认
</view>
</view>
</view> </view>
</u-popup>
</u-popup>
<!-- 普通访客 先选择区域 -->
<u-popup :show="areaShow" class="configwrap" mode="bottom"> <!-- 普通访客 先选择区域 -->
<view class="configtitle"> <u-popup :show="areaShow" class="configwrap" mode="bottom">
前往区域 <view class="configtitle">
</view> 前往区域
<block v-if="visitArea.length>0"> </view>
<view class="configvalue areavalue"> <block v-if="visitArea.length>0">
<uni-data-checkbox mode="button" @change='changeVisitArea' v-model="form.visit_area_id" :localdata="visitArea" <view class="configvalue areavalue">
:map="{text:'name',value:'id'}" /> <uni-data-checkbox mode="button" @change='changeVisitArea' v-model="form.visit_area_id"
</view> :localdata="visitArea" :map="{text:'name',value:'id'}" />
<button class="areabtn" @click="closeArea" size="large" type="primary" </view>
>确认</button> <button class="areabtn" @click="closeArea" size="large" type="primary">确认</button>
</block> </block>
<view class="configvalue configload" v-else> <view class="configvalue configload" v-else>
<text>数据加载中...</text> <text>数据加载中...</text>
<u-icon @click="getVisitArea" name="reload" color="#2979ff" size="28"></u-icon> <u-icon @click="getVisitArea" name="reload" color="#2979ff" size="28"></u-icon>
</view> </view>
</u-popup> </u-popup>
<view class="steps"> <view class="steps">
<uni-steps :options="steps" :active="stepActive" active-color="#044ed7" /> <uni-steps :options="steps" :active="stepActive" active-color="#044ed7" />
</view> </view>
@ -80,31 +88,30 @@
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="证件号码" required name="idcard" v-if="form.credent==1"> <uni-forms-item label="证件号码" required name="idcard" v-if="form.credent==1">
<uni-easyinput type="idcard" v-model="form.idcard" placeholder="请输入证件号码" /> <uni-easyinput type="idcard" v-model="form.idcard" placeholder="请输入证件号码" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="护照号码" required name="passcard" v-if="form.credent==2"> <uni-forms-item label="护照号码" required name="passcard" v-if="form.credent==2">
<uni-easyinput type="text" v-model="form.passcard" placeholder="请输入证件号码" /> <uni-easyinput type="text" v-model="form.passcard" placeholder="请输入证件号码" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="单位名称" required name="company_name"> <uni-forms-item label="单位名称" required name="company_name">
<uni-easyinput v-model="form.company_name" placeholder="请输入单位名称" /> <uni-easyinput v-model="form.company_name" placeholder="请输入单位名称" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="CDA编号" required name="cda" v-if="form.type==1&&visitAreaText=='生产区'"> <uni-forms-item label="CDA编号" required name="cda" v-if="form.type==1&&visitAreaText=='生产区'">
<uni-easyinput type='textarea' v-model="form.cda" placeholder="请输入CDA编号(如无注明原因)" /> <uni-easyinput type='textarea' v-model="form.cda" placeholder="请输入CDA编号(如无注明原因)" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="到访车辆" v-if="form.type!=3"> <uni-forms-item label="到访车辆" v-if="form.type!=3">
<view style="text-align: right;"> <view style="text-align: right;">
<button style="background-color: #044ed7;" type="primary" size="mini" <button style="background-color: #044ed7;" type="primary" size="mini"
@click="form.cars.push('')">新增车辆</button> @click="form.cars.push('')">新增车辆</button>
</view> </view>
<view v-for='(item,index) in form.cars' class="justify-between align-center" <view v-for='(item,index) in form.cars' class="justify-between align-center"
style="margin-bottom:20rpx"> style="margin-bottom:20rpx">
<uni-easyinput disabled @tap="plateShow=true,carindex=index" v-model.trim="form.cars[index]" <uni-easyinput disabled @tap="plateShow=true,carindex=index" v-model.trim="form.cars[index]"
placeholder="请输入到访车辆" /> placeholder="请输入到访车辆" />
<text @click="form.cars.splice(index,1)" <text @click="form.cars.splice(index,1)" style="color: red;margin-left:20rpx">删除</text>
style="color: red;margin-left:20rpx">删除</text> </view>
</view> <plate-input v-if="plateShow" :plate="form.cars[carindex]" @export="setCars"
<plate-input v-if="plateShow" :plate="form.cars[carindex]" @export="setCars" @close="plateShow = false" />
@close="plateShow = false" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="到访车辆" required name="cars" v-else> <uni-forms-item label="到访车辆" required name="cars" v-else>
<view style="text-align: right;"> <view style="text-align: right;">
@ -116,8 +123,7 @@
style="margin-bottom:20rpx"> style="margin-bottom:20rpx">
<uni-easyinput disabled @tap="plateShow=true,carindex=index" v-model.trim="form.cars[index]" <uni-easyinput disabled @tap="plateShow=true,carindex=index" v-model.trim="form.cars[index]"
placeholder="请输入到访车辆" /> placeholder="请输入到访车辆" />
<text @click="form.cars.splice(index,1)" <text @click="form.cars.splice(index,1)" style="color: red;margin-left:20rpx">删除</text>
style="color: red;margin-left:20rpx">删除</text>
</view> </view>
<plate-input v-if="plateShow" :plate="form.cars[carindex]" @export="setCars" <plate-input v-if="plateShow" :plate="form.cars[carindex]" @export="setCars"
@close="plateShow = false" /> @close="plateShow = false" />
@ -169,25 +175,25 @@
<uni-forms-item label="结束日期"> <uni-forms-item label="结束日期">
<uni-datetime-picker type="date" :start="toadyStart" return-type="string" v-model="form.end_date" /> <uni-datetime-picker type="date" :start="toadyStart" return-type="string" v-model="form.end_date" />
</uni-forms-item> </uni-forms-item>
</template> </template>
<view class="formtext" v-if="form.type==1||form.type==2">访</view> <view class="formtext" v-if="form.type==1||form.type==2">访</view>
<uni-forms-item label="被访人" required name="acceptName" v-if="form.type==1||form.type==2"> <uni-forms-item label="被访人" required name="acceptName" v-if="form.type==1||form.type==2">
<uni-easyinput @clear="clearAccept('accept')" disabled v-model="form.acceptName" <uni-easyinput @clear="clearAccept('accept')" disabled v-model="form.acceptName"
@tap="adminListShowOpen('accept')" placeholder="请选择联系人员" /> @tap="adminListShowOpen('accept')" placeholder="请选择联系人员" />
</uni-forms-item> </uni-forms-item>
<view class="formtext" v-if="visitAreaText=='生产区'"></view> <view class="formtext" v-if="visitAreaText=='生产区'"></view>
<uni-forms-item label="陪同人" required name="accompanyName" v-if="visitAreaText=='生产区'"> <uni-forms-item label="陪同人" required name="accompanyName" v-if="visitAreaText=='生产区'">
<uni-easyinput @clear="clearAccept('accompany')" disabled v-model="form.accompanyName" <uni-easyinput @clear="clearAccept('accompany')" disabled v-model="form.accompanyName"
@tap="adminListShowOpen('accompany')" placeholder="请选择联系人员" /> @tap="adminListShowOpen('accompany')" placeholder="请选择联系人员" />
</uni-forms-item> </uni-forms-item>
<view class="formtext" v-if="form.type==3"></view> <view class="formtext" v-if="form.type==3"></view>
<uni-forms-item label="收货人" v-if="form.type==3" required name="goodsName"> <uni-forms-item label="收货人" v-if="form.type==3" required name="goodsName">
<uni-easyinput @clear="clearAccept('goods')" disabled v-model="form.goodsName" <uni-easyinput @clear="clearAccept('goods')" disabled v-model="form.goodsName"
@tap="adminListShowOpen('goods')" placeholder="请选择联系人员" /> @tap="adminListShowOpen('goods')" placeholder="请选择联系人员" />
</uni-forms-item> </uni-forms-item>
<qianziyu-select :show="adminListShow" type="radio" :popupTitle="'联系人员'" name="cworkStationName" <qianziyu-select :show="adminListShow" type="radio" :popupTitle="'联系人员'" name="cworkStationName"
:dataLists="adminList" placeholder="输入陪同人具体姓名或手机号搜索" @search="selectSearch" @submit="submitAccept" :dataLists="adminList" placeholder="输入陪同人具体姓名或手机号搜索" @search="selectSearch" @submit="submitAccept"
@cancel="cancelAccept" /> @cancel="cancelAccept" />
</uni-forms> </uni-forms>
<button type="primary" style="background-color: #044ed7;" @click="getStudy">{{goStudy}}</button> <button type="primary" style="background-color: #044ed7;" @click="getStudy">{{goStudy}}</button>
@ -209,9 +215,9 @@
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="证件号码" required name='idcard' v-if="follw_people_obj.credent==1"> <uni-forms-item label="证件号码" required name='idcard' v-if="follw_people_obj.credent==1">
<uni-easyinput type="idcard" v-model="follw_people_obj.idcard" placeholder="请输入证件号码" /> <uni-easyinput type="idcard" v-model="follw_people_obj.idcard" placeholder="请输入证件号码" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="护照号码" required name='passcard' v-if="follw_people_obj.credent==2"> <uni-forms-item label="护照号码" required name='passcard' v-if="follw_people_obj.credent==2">
<uni-easyinput type="text" v-model="follw_people_obj.passcard" placeholder="请输入证件号码" /> <uni-easyinput type="text" v-model="follw_people_obj.passcard" placeholder="请输入证件号码" />
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
<view class="uni-group" style="text-align: right;"> <view class="uni-group" style="text-align: right;">
@ -243,8 +249,8 @@
title: '完成' title: '完成'
}], }],
stepActive: 0, stepActive: 0,
configshow: false, configshow: false,
areaShow:false, areaShow: false,
configInfo: {}, configInfo: {},
configKey: "ptfk", configKey: "ptfk",
toadyStart: '', toadyStart: '',
@ -254,8 +260,8 @@
adminKeyword: '', adminKeyword: '',
acceptType: "", acceptType: "",
acceptName: "", acceptName: "",
goodsName: '', goodsName: '',
visitAreaText:'', visitAreaText: '',
form: { form: {
type: 1, type: 1,
date: "", date: "",
@ -267,21 +273,21 @@
name: "", name: "",
mobile: "", mobile: "",
credent: 1, credent: 1,
idcard: "", idcard: "",
passcard:"", passcard: "",
company_name: "", company_name: "",
cars: [], cars: [],
follw_people: [], follw_people: [],
long_time: 0, long_time: 0,
start_date: "", start_date: "",
end_date: "", end_date: "",
accompany_id:'', accompany_id: '',
accpet_department_id: "", accpet_department_id: "",
accept_admin_id: "", accept_admin_id: "",
accept_goods_admin_id: "", accept_goods_admin_id: "",
acceptName: "", acceptName: "",
goodsName: '', goodsName: '',
accompanyName:'' accompanyName: ''
}, },
follw_people_obj: { follw_people_obj: {
name: "", name: "",
@ -344,45 +350,45 @@
pattern: '^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]', pattern: '^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]',
errorMessage: '身份证格式错误' errorMessage: '身份证格式错误'
}] }]
}, },
passcard:{ passcard: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '护照号码不能为空' errorMessage: '护照号码不能为空'
}, { }, {
pattern: '/^([a-zA-z]|[0-9]){5,17}$/', pattern: '/^([a-zA-z]|[0-9]){5,17}$/',
errorMessage: '护照格式错误' errorMessage: '护照格式错误'
}] }]
}, },
company_name: { company_name: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '单位名称不能为空' errorMessage: '单位名称不能为空'
}] }]
}, },
cda: { cda: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: 'CDA编号不能为空' errorMessage: 'CDA编号不能为空'
}] }]
}, },
cars:{ cars: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '车牌号不能为空' errorMessage: '车牌号不能为空'
}] }]
}, },
acceptName: { acceptName: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '请选择被访人' errorMessage: '请选择被访人'
}] }]
}, },
accompanyName: { accompanyName: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '请选择陪同人' errorMessage: '请选择陪同人'
}] }]
}, },
goodsName: { goodsName: {
rules: [{ rules: [{
@ -421,15 +427,15 @@
pattern: '^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]', pattern: '^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]',
errorMessage: '身份证格式错误' errorMessage: '身份证格式错误'
}] }]
}, },
passcard:{ passcard: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '护照号码不能为空' errorMessage: '护照号码不能为空'
}, { }, {
pattern: '/^([a-zA-z]|[0-9]){5,17}$/', pattern: '/^([a-zA-z]|[0-9]){5,17}$/',
errorMessage: '护照格式错误' errorMessage: '护照格式错误'
}] }]
} }
}, },
// //
@ -455,40 +461,40 @@
}], }],
adminList: [], adminList: [],
isCall: '', // isCall: '', //
goStudy: '提交', goStudy: '提交',
isStudy:false isStudy: false
} }
}, },
onLoad(options) { onLoad(options) {
// uni.navigateTo({ // uni.navigateTo({
// url:'/pages/visit/testStudy?type=3' // url:'/pages/visit/testStudy?type=3'
// }) // })
// return // return
this.toadyStart = new Date() this.toadyStart = new Date()
this.form.type = options.type this.form.type = options.type
this.areaShow = options.type == 1?true:false this.areaShow = options.type == 1 ? true : false
this.configKey = options.type == 1 ? 'ptfk' : (options.type == 2 ? 'sgfk' : 'wlcl') this.configKey = options.type == 1 ? 'ptfk' : (options.type == 2 ? 'sgfk' : 'wlcl')
this.isCall = options.iscall ? options.iscall : '' this.isCall = options.iscall ? options.iscall : ''
// this.goStudy = this.isCall == 'call' ? '' : '' // this.goStudy = this.isCall == 'call' ? '' : ''
this.form.audit_status = this.isCall == 'call' ? 1 : 0 this.form.audit_status = this.isCall == 'call' ? 1 : 0
this.showStudy() this.showStudy()
if(options.type==2||options.type==3){ if (options.type == 2 || options.type == 3) {
this.getConfig() this.getConfig()
} }
this.init() this.init()
if(uni.getStorageSync('formdata')){ if (uni.getStorageSync('formdata')) {
this.form = uni.getStorageSync('formdata') this.form = uni.getStorageSync('formdata')
} }
// this.getAdminList() // this.getAdminList()
}, },
onReady() {}, onReady() {},
methods: { methods: {
init(){ init() {
this.getVisitArea() this.getVisitArea()
this.getVisitTime() this.getVisitTime()
this.getReason() this.getReason()
this.getPark() this.getPark()
}, },
adminListShowOpen(type) { adminListShowOpen(type) {
this.acceptType = type this.acceptType = type
@ -511,38 +517,38 @@
if (type == 'accept') { if (type == 'accept') {
this.form.accept_admin_id = '' this.form.accept_admin_id = ''
this.form.acceptName = '' this.form.acceptName = ''
} else if(type=='goods') { } else if (type == 'goods') {
this.form.accept_goods_admin_id = '' this.form.accept_goods_admin_id = ''
this.form.goodsName = '' this.form.goodsName = ''
}else{ } else {
this.form.accompany_id='' this.form.accompany_id = ''
this.form.accompanyName='' this.form.accompanyName = ''
} }
}, },
submitAccept(e) { submitAccept(e) {
console.log(e) console.log(e)
if (this.acceptType == 'accept') { if (this.acceptType == 'accept') {
this.form.accept_admin_id = e.id this.form.accept_admin_id = e.id
this.form.accpet_department_id = e.department_id this.form.accpet_department_id = e.department_id
this.form.acceptName = e.name this.form.acceptName = e.name
if(this.visitAreaText=='非生产区'){ if (this.visitAreaText == '非生产区') {
this.form.accompany_id = e.id this.form.accompany_id = e.id
this.form.accompanyName = e.name this.form.accompanyName = e.name
} }
} else if(this.acceptType == 'goods'){ } else if (this.acceptType == 'goods') {
this.form.accept_goods_admin_id = e.id this.form.accept_goods_admin_id = e.id
this.form.accept_admin_id = e.id this.form.accept_admin_id = e.id
this.form.accpet_department_id = e.department_id this.form.accpet_department_id = e.department_id
this.form.goodsName = e.name this.form.goodsName = e.name
if(this.visitAreaText=='非生产区'){ if (this.visitAreaText == '非生产区') {
this.form.accompany_id = e.id this.form.accompany_id = e.id
this.form.accompanyName = e.name this.form.accompanyName = e.name
} }
}else{ } else {
this.form.accompany_id = e.id this.form.accompany_id = e.id
this.form.accompanyName = e.name this.form.accompanyName = e.name
} }
this.adminListShow = false this.adminListShow = false
}, },
setCars(e) { setCars(e) {
@ -553,21 +559,25 @@
closeConfig() { closeConfig() {
this.configshow = false this.configshow = false
}, },
closeArea(){ closeArea() {
if(!this.form.visit_area_id){ if (!this.form.visit_area_id) {
this.util.alert("请先选择前往区域") this.util.alert("请先选择前往区域")
return return
} }
if(this.visitAreaText=="生产区"){ if (this.visitAreaText == "生产区") {
this.configKey = 'cjfk' this.configKey = 'cjfk'
this.getConfig() this.getConfig()
this.areaShow = false this.areaShow = false
}else{ } else if (this.visitAreaText == "研发R&D") {
this.configKey = 'ptfk' this.configKey = 'yffk'
this.getConfig() this.getConfig()
this.areaShow = false this.areaShow = false
} } else {
this.configKey = 'ptfk'
this.getConfig()
this.areaShow = false
}
}, },
async getConfig() { async getConfig() {
let that = this let that = this
@ -586,23 +596,26 @@
if (k.key == that.configKey) { if (k.key == that.configKey) {
that.configInfo = k that.configInfo = k
} }
} }
that.configshow = true that.configshow = true
}, },
utilFail: function(res) {} utilFail: function(res) {}
}) })
}, },
// //
getVisitArea() { getVisitArea() {
let that = this let that = this
that.visitArea = [{ that.visitArea = [{
name:'非生产区', name: '非生产区',
id:3 id: 3
},{ }, {
name:'生产区', name: '生产区',
id:4 id: 4
}, {
name: "研发R&D",
id: 5
}] }]
// this.util.request({ // this.util.request({
// api: '/api/mobile/visit/visit-area', // api: '/api/mobile/visit/visit-area',
@ -613,10 +626,10 @@
// }, // },
// utilFail: function(res) {} // utilFail: function(res) {}
// }) // })
}, },
changeVisitArea(e){ changeVisitArea(e) {
console.log(e) console.log(e)
this.visitAreaText = e.detail.data.name this.visitAreaText = e.detail.data.name
}, },
getVisitTime() { getVisitTime() {
let that = this let that = this
@ -703,9 +716,9 @@
this.$refs.showRight.close() this.$refs.showRight.close()
}, },
pushFollowPeople() { pushFollowPeople() {
console.log('this.follw_people_obj', this.follw_people_obj) console.log('this.follw_people_obj', this.follw_people_obj)
if(this.follw_people_obj.credent==2){ if (this.follw_people_obj.credent == 2) {
this.follw_people_obj.idcard = this.follw_people_obj.passcard this.follw_people_obj.idcard = this.follw_people_obj.passcard
} }
this.$refs['peopleform'].validate().then(res => { this.$refs['peopleform'].validate().then(res => {
if (this.follow_people_index > -1) { if (this.follow_people_index > -1) {
@ -722,110 +735,110 @@
}, },
// //
// 访 // 访
async showStudy() { async showStudy() {
this.util.alert("请确保每位访客都已通过学习培训,方可提交拜访") this.util.alert("请确保每位访客都已通过学习培训,方可提交拜访")
// let that = this // let that = this
// let id_arr = [] // let id_arr = []
// id_arr.push(this.form.idcard) // id_arr.push(this.form.idcard)
// for(var k of this.form.follw_people){ // for(var k of this.form.follw_people){
// id_arr.push(k.idcard) // id_arr.push(k.idcard)
// } // }
// this.util.request({ // this.util.request({
// api: '/api/mobile/visit/ask-log', // api: '/api/mobile/visit/ask-log',
// method: "post", // method: "post",
// data:{ // data:{
// type:that.form.type // type:that.form.type
// }, // },
// utilSuccess: function(res) { // utilSuccess: function(res) {
// console.log("res",res) // console.log("res",res)
// if(res.msg==''){ // if(res.msg==''){
// uni.showToast({ // uni.showToast({
// title: '访访', // title: '访访',
// duration: 2000, // duration: 2000,
// icon: 'none' // icon: 'none'
// }) // })
// that.isStudy = true // that.isStudy = true
// that.goStudy = '' // that.goStudy = ''
// } // }
// }, // },
// utilFail: function(res) { // utilFail: function(res) {
// // console.log(res) // // console.log(res)
// // uni.showToast({ // // uni.showToast({
// // title: res, // // title: res,
// // duration: 2000, // // duration: 2000,
// // icon: 'none' // // icon: 'none'
// // }) // // })
// } // }
// }) // })
}, },
// 访 // 访
async getStudy() { async getStudy() {
let that = this let that = this
let id_arr = [] let id_arr = []
id_arr.push(this.form.idcard) id_arr.push(this.form.idcard)
for(var k of this.form.follw_people){ for (var k of this.form.follw_people) {
id_arr.push(k.idcard) id_arr.push(k.idcard)
} }
this.$refs['formdata'].validate().then(res => { this.$refs['formdata'].validate().then(res => {
this.util.request({ this.util.request({
api: '/api/mobile/visit/idcard-check', api: '/api/mobile/visit/idcard-check',
method: "post", method: "post",
data:{ data: {
idcard:id_arr idcard: id_arr
}, },
utilSuccess: function(res) { utilSuccess: function(res) {
if(res.length>0){ if (res.length > 0) {
let str = res.join("")+'未完成学习培训' let str = res.join("") + '未完成学习培训'
that.util.alert(str) that.util.alert(str)
uni.setStorageSync('formdata', that.form) uni.setStorageSync('formdata', that.form)
}else{ } else {
// //
if (that.isCall === 'call') { if (that.isCall === 'call') {
that.submitForm() that.submitForm()
}else{ } else {
// 访 // 访
that.submitNoStudy() that.submitNoStudy()
} }
} }
}, },
utilFail: function(res) { utilFail: function(res) {
// console.log(res) // console.log(res)
uni.showToast({ uni.showToast({
title: res, title: res,
duration: 2000, duration: 2000,
icon: 'none' icon: 'none'
}) })
} }
}) })
}).catch(err => { }).catch(err => {
console.log('err', err); console.log('err', err);
}) })
}, },
saveFormgoStudy() { saveFormgoStudy() {
if(this.form.credent==2){ if (this.form.credent == 2) {
this.form.idcard = this.form.passcard this.form.idcard = this.form.passcard
} }
this.$refs['formdata'].validate().then(res => { this.$refs['formdata'].validate().then(res => {
console.log("form", this.form) console.log("form", this.form)
// return // return
if (this.isCall === 'call') { if (this.isCall === 'call') {
this.submitForm() this.submitForm()
return return
}
if(this.isStudy){
this.submitNoStudy()
}else{
uni.setStorageSync('formdata', this.form)
uni.redirectTo({
url: '/pages/visit/study?type=' + this.form.type
})
} }
if (this.isStudy) {
this.submitNoStudy()
} else {
uni.setStorageSync('formdata', this.form)
uni.redirectTo({
url: '/pages/visit/study?type=' + this.form.type
})
}
}).catch(err => { }).catch(err => {
console.log('err', err); console.log('err', err);
}) })
@ -856,57 +869,59 @@
}) })
} }
}) })
}, },
submitNoStudy(){ submitNoStudy() {
let that = this let that = this
this.util.request({ this.util.request({
api: '/api/mobile/visit/visit-save', api: '/api/mobile/visit/visit-save',
method: "POST", method: "POST",
data: that.form, data: that.form,
utilSuccess: function(res) { utilSuccess: function(res) {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
duration: 2000, duration: 2000,
icon: 'none' icon: 'none'
}) })
uni.removeStorageSync('formdata') uni.removeStorageSync('formdata')
that.newsSubscription() that.newsSubscription()
}, },
utilFail: function(res) { utilFail: function(res) {
console.log(res) console.log(res)
uni.showToast({ uni.showToast({
title: res, title: res,
duration: 2000, duration: 2000,
icon: 'none' icon: 'none'
}) })
} }
}) })
}, },
newsSubscription() { newsSubscription() {
uni.getSetting({ uni.getSetting({
withSubscriptions: true, //false withSubscriptions: true, //false
success(res) { success(res) {
if (res.authSetting['scope.subscribeMessage']) { if (res.authSetting['scope.subscribeMessage']) {
uni.redirectTo({ uni.redirectTo({
url: '/pages/visit/successform' url: '/pages/visit/successform'
}) })
} else { } else {
// //
uni.requestSubscribeMessage({ uni.requestSubscribeMessage({
tmplIds: ['DmzNRREPFdZrMWconNDdbj_ebtVPRWufq27kRQ25eNg','IczaKkCmwf55tAAzCcxb_fbbf5L25SWrSKvaBrkIyk4'], tmplIds: ['DmzNRREPFdZrMWconNDdbj_ebtVPRWufq27kRQ25eNg',
success(res) { 'IczaKkCmwf55tAAzCcxb_fbbf5L25SWrSKvaBrkIyk4'
console.log("res", res) ],
uni.showToast({ success(res) {
title:'订阅成功' console.log("res", res)
}) uni.showToast({
uni.redirectTo({ title: '订阅成功'
url: '/pages/visit/successform' })
}) uni.redirectTo({
} url: '/pages/visit/successform'
}) })
} }
} })
}); }
}
});
}, },
} }
} }
@ -935,43 +950,60 @@
/deep/ .uni-drawer__content { /deep/ .uni-drawer__content {
padding: 40rpx padding: 40rpx
} }
.configtitle { .configtitle {
font-size: 40rpx; font-size: 40rpx;
text-align: center; text-align: center;
margin-top:36rpx margin-top: 36rpx;
padding-bottom: 20rpx;
} }
.configvalue { .configvalue {
padding: 40rpx; padding: 40rpx;
font-size: 36rpx; font-size: 36rpx;
height: 600rpx; height: 600rpx;
overflow-y: auto; overflow-y: auto;
} }
.configload{
display: flex; .configbtn {
justify-content: center; background: #044ed7;
align-items: center; padding: 20rpx;
font-size: 50rpx; /* display: inline-block; */
color: #ddd; text-align: center;
} margin: 20rpx auto;
.configload text{ color: #fff;
margin-right:20rpx border-radius: 20rpx;
} }
/deep/ .u-popup__content__close .u-icon__icon{
color:#fff!important .configload {
} display: flex;
.areavalue{ justify-content: center;
align-items: center;
} font-size: 50rpx;
.areabtn{ color: #ddd;
background-color: #044ed7; }
/* margin-left: 8px; */
width: 100%; .configload text {
position: fixed; margin-right: 20rpx
bottom: 0; }
left: 0;
border-radius: 0; /deep/ .u-popup__content__close .u-icon__icon {
} color: #fff !important
/deep/ .areavalue .uni-data-checklist .checklist-group .checklist-box.is--button { }
padding:30rpx
.areavalue {}
.areabtn {
background-color: #044ed7;
/* margin-left: 8px; */
width: 100%;
position: fixed;
bottom: 0;
left: 0;
border-radius: 0;
}
/deep/ .areavalue .uni-data-checklist .checklist-group .checklist-box.is--button {
padding: 30rpx
} }
</style> </style>
Loading…
Cancel
Save