|
|
|
|
@ -40,7 +40,7 @@
|
|
|
|
|
v-model="form.work_end_time" />
|
|
|
|
|
</uni-forms-item>
|
|
|
|
|
<!-- <uni-forms-item label="车牌号" v-if="form.type==3"> -->
|
|
|
|
|
<uni-forms-item label="停车区域" required name="plate" v-if="form.type==3">
|
|
|
|
|
<uni-forms-item label="车辆类型" required name="plate" v-if="form.type==3">
|
|
|
|
|
<uni-data-checkbox v-model="form.plate" :localdata="parkAreaList" :map="{text:'value',value:'value'}" />
|
|
|
|
|
</uni-forms-item>
|
|
|
|
|
<uni-forms-item label="备注">
|
|
|
|
|
@ -62,9 +62,25 @@
|
|
|
|
|
</uni-forms-item>
|
|
|
|
|
<uni-forms-item label="单位名称" required name="company_name">
|
|
|
|
|
<uni-easyinput v-model="form.company_name" placeholder="请输入单位名称" />
|
|
|
|
|
</uni-forms-item>
|
|
|
|
|
<uni-forms-item label="到访车辆" v-if="form.type!=3">
|
|
|
|
|
<view style="text-align: right;">
|
|
|
|
|
<button style="background-color: #044ed7;" type="primary" size="mini"
|
|
|
|
|
@click="form.cars.push('')">新增车辆</button>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view v-for='(item,index) in form.cars' class="justify-between align-center"
|
|
|
|
|
style="margin-bottom:20rpx">
|
|
|
|
|
<uni-easyinput disabled @tap="plateShow=true,carindex=index" v-model.trim="form.cars[index]"
|
|
|
|
|
placeholder="请输入到访车辆" />
|
|
|
|
|
<text @click="form.cars.splice(index,1)"
|
|
|
|
|
style="color: red;margin-left:20rpx">删除</text>
|
|
|
|
|
</view>
|
|
|
|
|
<plate-input v-if="plateShow" :plate="form.cars[carindex]" @export="setCars"
|
|
|
|
|
@close="plateShow = false" />
|
|
|
|
|
</uni-forms-item>
|
|
|
|
|
<uni-forms-item label="到访车辆">
|
|
|
|
|
<view style="text-align: right;" v-if="form.type!=3">
|
|
|
|
|
<uni-forms-item label="到访车辆" required name="cars" v-else>
|
|
|
|
|
<view style="text-align: right;">
|
|
|
|
|
<button style="background-color: #044ed7;" type="primary" size="mini"
|
|
|
|
|
@click="form.cars.push('')">新增车辆</button>
|
|
|
|
|
</view>
|
|
|
|
|
@ -73,7 +89,7 @@
|
|
|
|
|
style="margin-bottom:20rpx">
|
|
|
|
|
<uni-easyinput disabled @tap="plateShow=true,carindex=index" v-model.trim="form.cars[index]"
|
|
|
|
|
placeholder="请输入到访车辆" />
|
|
|
|
|
<text v-if="form.type!=3" @click="form.cars.splice(index,1)"
|
|
|
|
|
<text @click="form.cars.splice(index,1)"
|
|
|
|
|
style="color: red;margin-left:20rpx">删除</text>
|
|
|
|
|
</view>
|
|
|
|
|
<plate-input v-if="plateShow" :plate="form.cars[carindex]" @export="setCars"
|
|
|
|
|
@ -214,7 +230,7 @@
|
|
|
|
|
credent: 1,
|
|
|
|
|
idcard: "",
|
|
|
|
|
company_name: "",
|
|
|
|
|
cars: [''],
|
|
|
|
|
cars: [],
|
|
|
|
|
follw_people: [],
|
|
|
|
|
long_time: 0,
|
|
|
|
|
start_date: "",
|
|
|
|
|
@ -254,7 +270,7 @@
|
|
|
|
|
plate: {
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
errorMessage: '请选择停车区域'
|
|
|
|
|
errorMessage: '请选择车辆类型'
|
|
|
|
|
}]
|
|
|
|
|
},
|
|
|
|
|
name: {
|
|
|
|
|
@ -292,6 +308,12 @@
|
|
|
|
|
required: true,
|
|
|
|
|
errorMessage: '单位名称不能为空'
|
|
|
|
|
}]
|
|
|
|
|
},
|
|
|
|
|
cars:{
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
errorMessage: '车牌号不能为空'
|
|
|
|
|
}]
|
|
|
|
|
},
|
|
|
|
|
acceptName: {
|
|
|
|
|
rules: [{
|
|
|
|
|
@ -361,7 +383,8 @@
|
|
|
|
|
}],
|
|
|
|
|
adminList: [],
|
|
|
|
|
isCall: '', // 是否待邀约
|
|
|
|
|
goStudy: '去学习'
|
|
|
|
|
goStudy: '去学习',
|
|
|
|
|
isStudy:false
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -375,7 +398,8 @@
|
|
|
|
|
this.configKey = options.type == 1 ? 'ptfk' : (options.type == 2 ? 'sgfk' : 'wlcl')
|
|
|
|
|
this.isCall = options.iscall ? options.iscall : ''
|
|
|
|
|
this.goStudy = this.isCall == 'call' ? '提交' : '去学习'
|
|
|
|
|
this.form.audit_status = this.isCall == 'call' ? 1 : 0
|
|
|
|
|
this.form.audit_status = this.isCall == 'call' ? 1 : 0
|
|
|
|
|
this.getStudy()
|
|
|
|
|
this.getConfig()
|
|
|
|
|
this.getVisitArea()
|
|
|
|
|
this.getVisitTime()
|
|
|
|
|
@ -439,15 +463,15 @@
|
|
|
|
|
let that = this
|
|
|
|
|
// util.request()
|
|
|
|
|
this.util.request({
|
|
|
|
|
api: '/api/admin/config/index',
|
|
|
|
|
api: '/api/mobile/user/config',
|
|
|
|
|
data: {
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 99
|
|
|
|
|
},
|
|
|
|
|
requestType: 'bd',
|
|
|
|
|
// requestType: 'bd',
|
|
|
|
|
utilSuccess: function(res) {
|
|
|
|
|
console.log(res)
|
|
|
|
|
let data = res.data
|
|
|
|
|
let data = res
|
|
|
|
|
for (let k of data) {
|
|
|
|
|
if (k.key == that.configKey) {
|
|
|
|
|
that.configInfo = k
|
|
|
|
|
@ -458,7 +482,32 @@
|
|
|
|
|
utilFail: function(res) {}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 获取单选数据
|
|
|
|
|
// 获取单选数据
|
|
|
|
|
async getStudy() {
|
|
|
|
|
let that = this
|
|
|
|
|
this.util.request({
|
|
|
|
|
api: '/api/mobile/visit/ask-log',
|
|
|
|
|
method: "get",
|
|
|
|
|
data:{
|
|
|
|
|
type:that.form.type
|
|
|
|
|
},
|
|
|
|
|
utilSuccess: function(res) {
|
|
|
|
|
console.log("res",res)
|
|
|
|
|
if(res.msg=='学习有效中'){
|
|
|
|
|
that.isStudy = true
|
|
|
|
|
that.goStudy = '提交'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
utilFail: function(res) {
|
|
|
|
|
// console.log(res)
|
|
|
|
|
// uni.showToast({
|
|
|
|
|
// title: res,
|
|
|
|
|
// duration: 2000,
|
|
|
|
|
// icon: 'none'
|
|
|
|
|
// })
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getVisitArea() {
|
|
|
|
|
let that = this
|
|
|
|
|
@ -581,11 +630,16 @@
|
|
|
|
|
if (this.isCall === 'call') {
|
|
|
|
|
this.submitForm()
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if(this.isStudy){
|
|
|
|
|
this.submitNoStudy()
|
|
|
|
|
}else{
|
|
|
|
|
uni.setStorageSync('formdata', this.form)
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: '/pages/visit/study?type=' + this.form.type
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
uni.setStorageSync('formdata', this.form)
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: '/pages/visit/study?type=' + this.form.type
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
console.log('err', err);
|
|
|
|
|
})
|
|
|
|
|
@ -616,7 +670,57 @@
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
submitNoStudy(){
|
|
|
|
|
let that = this
|
|
|
|
|
this.util.request({
|
|
|
|
|
api: '/api/mobile/visit/visit-save',
|
|
|
|
|
method: "POST",
|
|
|
|
|
data: that.formData,
|
|
|
|
|
utilSuccess: function(res) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: res.msg,
|
|
|
|
|
duration: 2000,
|
|
|
|
|
icon: 'none'
|
|
|
|
|
})
|
|
|
|
|
that.newsSubscription()
|
|
|
|
|
},
|
|
|
|
|
utilFail: function(res) {
|
|
|
|
|
console.log(res)
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: res,
|
|
|
|
|
duration: 2000,
|
|
|
|
|
icon: 'none'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
newsSubscription() {
|
|
|
|
|
uni.getSetting({
|
|
|
|
|
withSubscriptions: true, //是否获取用户订阅消息的订阅状态,默认false不返回
|
|
|
|
|
success(res) {
|
|
|
|
|
if (res.authSetting['scope.subscribeMessage']) {
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: '/pages/visit/successform'
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
// 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
|
|
|
|
|
uni.requestSubscribeMessage({
|
|
|
|
|
tmplIds: ['DmzNRREPFdZrMWconNDdbj_ebtVPRWufq27kRQ25eNg','IczaKkCmwf55tAAzCcxb_fbbf5L25SWrSKvaBrkIyk4'],
|
|
|
|
|
success(res) {
|
|
|
|
|
console.log("res", res)
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title:'订阅成功'
|
|
|
|
|
})
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: '/pages/visit/successform'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
@ -645,9 +749,9 @@
|
|
|
|
|
padding: 40rpx
|
|
|
|
|
}
|
|
|
|
|
.configtitle {
|
|
|
|
|
font-size: 50rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
padding: 20rpx 0;
|
|
|
|
|
font-size: 40rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
margin-top:36rpx
|
|
|
|
|
}
|
|
|
|
|
.configvalue {
|
|
|
|
|
padding: 40rpx;
|
|
|
|
|
|