|
|
|
|
@ -2,13 +2,22 @@
|
|
|
|
|
<page-meta :page-style="'overflow:'+(adminListShow||configshow||areaShow?'hidden':'visible')"></page-meta>
|
|
|
|
|
<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">
|
|
|
|
|
{{configInfo.name}}
|
|
|
|
|
</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>
|
|
|
|
|
|
|
|
|
|
</u-popup>
|
|
|
|
|
|
|
|
|
|
<!-- 普通访客 先选择区域 -->
|
|
|
|
|
@ -18,11 +27,10 @@
|
|
|
|
|
</view>
|
|
|
|
|
<block v-if="visitArea.length>0">
|
|
|
|
|
<view class="configvalue areavalue">
|
|
|
|
|
<uni-data-checkbox mode="button" @change='changeVisitArea' v-model="form.visit_area_id" :localdata="visitArea"
|
|
|
|
|
:map="{text:'name',value:'id'}" />
|
|
|
|
|
<uni-data-checkbox mode="button" @change='changeVisitArea' v-model="form.visit_area_id"
|
|
|
|
|
:localdata="visitArea" :map="{text:'name',value:'id'}" />
|
|
|
|
|
</view>
|
|
|
|
|
<button class="areabtn" @click="closeArea" size="large" type="primary"
|
|
|
|
|
>确认</button>
|
|
|
|
|
<button class="areabtn" @click="closeArea" size="large" type="primary">确认</button>
|
|
|
|
|
</block>
|
|
|
|
|
|
|
|
|
|
<view class="configvalue configload" v-else>
|
|
|
|
|
@ -100,8 +108,7 @@
|
|
|
|
|
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>
|
|
|
|
|
<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" />
|
|
|
|
|
@ -116,8 +123,7 @@
|
|
|
|
|
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>
|
|
|
|
|
<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" />
|
|
|
|
|
@ -244,7 +250,7 @@
|
|
|
|
|
}],
|
|
|
|
|
stepActive: 0,
|
|
|
|
|
configshow: false,
|
|
|
|
|
areaShow:false,
|
|
|
|
|
areaShow: false,
|
|
|
|
|
configInfo: {},
|
|
|
|
|
configKey: "ptfk",
|
|
|
|
|
toadyStart: '',
|
|
|
|
|
@ -255,7 +261,7 @@
|
|
|
|
|
acceptType: "",
|
|
|
|
|
acceptName: "",
|
|
|
|
|
goodsName: '',
|
|
|
|
|
visitAreaText:'',
|
|
|
|
|
visitAreaText: '',
|
|
|
|
|
form: {
|
|
|
|
|
type: 1,
|
|
|
|
|
date: "",
|
|
|
|
|
@ -268,20 +274,20 @@
|
|
|
|
|
mobile: "",
|
|
|
|
|
credent: 1,
|
|
|
|
|
idcard: "",
|
|
|
|
|
passcard:"",
|
|
|
|
|
passcard: "",
|
|
|
|
|
company_name: "",
|
|
|
|
|
cars: [],
|
|
|
|
|
follw_people: [],
|
|
|
|
|
long_time: 0,
|
|
|
|
|
start_date: "",
|
|
|
|
|
end_date: "",
|
|
|
|
|
accompany_id:'',
|
|
|
|
|
accompany_id: '',
|
|
|
|
|
accpet_department_id: "",
|
|
|
|
|
accept_admin_id: "",
|
|
|
|
|
accept_goods_admin_id: "",
|
|
|
|
|
acceptName: "",
|
|
|
|
|
goodsName: '',
|
|
|
|
|
accompanyName:''
|
|
|
|
|
accompanyName: ''
|
|
|
|
|
},
|
|
|
|
|
follw_people_obj: {
|
|
|
|
|
name: "",
|
|
|
|
|
@ -345,7 +351,7 @@
|
|
|
|
|
errorMessage: '身份证格式错误'
|
|
|
|
|
}]
|
|
|
|
|
},
|
|
|
|
|
passcard:{
|
|
|
|
|
passcard: {
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
errorMessage: '护照号码不能为空'
|
|
|
|
|
@ -366,7 +372,7 @@
|
|
|
|
|
errorMessage: 'CDA编号不能为空'
|
|
|
|
|
}]
|
|
|
|
|
},
|
|
|
|
|
cars:{
|
|
|
|
|
cars: {
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
errorMessage: '车牌号不能为空'
|
|
|
|
|
@ -422,7 +428,7 @@
|
|
|
|
|
errorMessage: '身份证格式错误'
|
|
|
|
|
}]
|
|
|
|
|
},
|
|
|
|
|
passcard:{
|
|
|
|
|
passcard: {
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
errorMessage: '护照号码不能为空'
|
|
|
|
|
@ -456,7 +462,7 @@
|
|
|
|
|
adminList: [],
|
|
|
|
|
isCall: '', // 是否待邀约
|
|
|
|
|
goStudy: '提交',
|
|
|
|
|
isStudy:false
|
|
|
|
|
isStudy: false
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -467,24 +473,24 @@
|
|
|
|
|
// return
|
|
|
|
|
this.toadyStart = new Date()
|
|
|
|
|
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.isCall = options.iscall ? options.iscall : ''
|
|
|
|
|
// this.goStudy = this.isCall == 'call' ? '提交' : ''
|
|
|
|
|
this.form.audit_status = this.isCall == 'call' ? 1 : 0
|
|
|
|
|
this.showStudy()
|
|
|
|
|
if(options.type==2||options.type==3){
|
|
|
|
|
if (options.type == 2 || options.type == 3) {
|
|
|
|
|
this.getConfig()
|
|
|
|
|
}
|
|
|
|
|
this.init()
|
|
|
|
|
if(uni.getStorageSync('formdata')){
|
|
|
|
|
if (uni.getStorageSync('formdata')) {
|
|
|
|
|
this.form = uni.getStorageSync('formdata')
|
|
|
|
|
}
|
|
|
|
|
// this.getAdminList()
|
|
|
|
|
},
|
|
|
|
|
onReady() {},
|
|
|
|
|
methods: {
|
|
|
|
|
init(){
|
|
|
|
|
init() {
|
|
|
|
|
this.getVisitArea()
|
|
|
|
|
this.getVisitTime()
|
|
|
|
|
this.getReason()
|
|
|
|
|
@ -511,12 +517,12 @@
|
|
|
|
|
if (type == 'accept') {
|
|
|
|
|
this.form.accept_admin_id = ''
|
|
|
|
|
this.form.acceptName = ''
|
|
|
|
|
} else if(type=='goods') {
|
|
|
|
|
} else if (type == 'goods') {
|
|
|
|
|
this.form.accept_goods_admin_id = ''
|
|
|
|
|
this.form.goodsName = ''
|
|
|
|
|
}else{
|
|
|
|
|
this.form.accompany_id=''
|
|
|
|
|
this.form.accompanyName=''
|
|
|
|
|
} else {
|
|
|
|
|
this.form.accompany_id = ''
|
|
|
|
|
this.form.accompanyName = ''
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
submitAccept(e) {
|
|
|
|
|
@ -525,20 +531,20 @@
|
|
|
|
|
this.form.accept_admin_id = e.id
|
|
|
|
|
this.form.accpet_department_id = e.department_id
|
|
|
|
|
this.form.acceptName = e.name
|
|
|
|
|
if(this.visitAreaText=='非生产区'){
|
|
|
|
|
if (this.visitAreaText == '非生产区') {
|
|
|
|
|
this.form.accompany_id = e.id
|
|
|
|
|
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_admin_id = e.id
|
|
|
|
|
this.form.accpet_department_id = e.department_id
|
|
|
|
|
this.form.goodsName = e.name
|
|
|
|
|
if(this.visitAreaText=='非生产区'){
|
|
|
|
|
if (this.visitAreaText == '非生产区') {
|
|
|
|
|
this.form.accompany_id = e.id
|
|
|
|
|
this.form.accompanyName = e.name
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
this.form.accompany_id = e.id
|
|
|
|
|
this.form.accompanyName = e.name
|
|
|
|
|
}
|
|
|
|
|
@ -554,16 +560,20 @@
|
|
|
|
|
closeConfig() {
|
|
|
|
|
this.configshow = false
|
|
|
|
|
},
|
|
|
|
|
closeArea(){
|
|
|
|
|
if(!this.form.visit_area_id){
|
|
|
|
|
closeArea() {
|
|
|
|
|
if (!this.form.visit_area_id) {
|
|
|
|
|
this.util.alert("请先选择前往区域")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if(this.visitAreaText=="生产区"){
|
|
|
|
|
if (this.visitAreaText == "生产区") {
|
|
|
|
|
this.configKey = 'cjfk'
|
|
|
|
|
this.getConfig()
|
|
|
|
|
this.areaShow = false
|
|
|
|
|
}else{
|
|
|
|
|
} else if (this.visitAreaText == "研发R&D") {
|
|
|
|
|
this.configKey = 'yffk'
|
|
|
|
|
this.getConfig()
|
|
|
|
|
this.areaShow = false
|
|
|
|
|
} else {
|
|
|
|
|
this.configKey = 'ptfk'
|
|
|
|
|
this.getConfig()
|
|
|
|
|
this.areaShow = false
|
|
|
|
|
@ -598,11 +608,14 @@
|
|
|
|
|
getVisitArea() {
|
|
|
|
|
let that = this
|
|
|
|
|
that.visitArea = [{
|
|
|
|
|
name:'非生产区',
|
|
|
|
|
id:3
|
|
|
|
|
},{
|
|
|
|
|
name:'生产区',
|
|
|
|
|
id:4
|
|
|
|
|
name: '非生产区',
|
|
|
|
|
id: 3
|
|
|
|
|
}, {
|
|
|
|
|
name: '生产区',
|
|
|
|
|
id: 4
|
|
|
|
|
}, {
|
|
|
|
|
name: "研发R&D",
|
|
|
|
|
id: 5
|
|
|
|
|
}]
|
|
|
|
|
// this.util.request({
|
|
|
|
|
// api: '/api/mobile/visit/visit-area',
|
|
|
|
|
@ -614,7 +627,7 @@
|
|
|
|
|
// utilFail: function(res) {}
|
|
|
|
|
// })
|
|
|
|
|
},
|
|
|
|
|
changeVisitArea(e){
|
|
|
|
|
changeVisitArea(e) {
|
|
|
|
|
console.log(e)
|
|
|
|
|
this.visitAreaText = e.detail.data.name
|
|
|
|
|
},
|
|
|
|
|
@ -704,7 +717,7 @@
|
|
|
|
|
},
|
|
|
|
|
pushFollowPeople() {
|
|
|
|
|
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.$refs['peopleform'].validate().then(res => {
|
|
|
|
|
@ -766,26 +779,26 @@
|
|
|
|
|
let that = this
|
|
|
|
|
let id_arr = []
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
this.$refs['formdata'].validate().then(res => {
|
|
|
|
|
this.util.request({
|
|
|
|
|
api: '/api/mobile/visit/idcard-check',
|
|
|
|
|
method: "post",
|
|
|
|
|
data:{
|
|
|
|
|
idcard:id_arr
|
|
|
|
|
data: {
|
|
|
|
|
idcard: id_arr
|
|
|
|
|
},
|
|
|
|
|
utilSuccess: function(res) {
|
|
|
|
|
if(res.length>0){
|
|
|
|
|
let str = res.join(",")+'未完成学习培训'
|
|
|
|
|
if (res.length > 0) {
|
|
|
|
|
let str = res.join(",") + '未完成学习培训'
|
|
|
|
|
that.util.alert(str)
|
|
|
|
|
uni.setStorageSync('formdata', that.form)
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
// 邀约
|
|
|
|
|
if (that.isCall === 'call') {
|
|
|
|
|
that.submitForm()
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
// 访客
|
|
|
|
|
that.submitNoStudy()
|
|
|
|
|
}
|
|
|
|
|
@ -807,7 +820,7 @@
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
saveFormgoStudy() {
|
|
|
|
|
if(this.form.credent==2){
|
|
|
|
|
if (this.form.credent == 2) {
|
|
|
|
|
this.form.idcard = this.form.passcard
|
|
|
|
|
}
|
|
|
|
|
this.$refs['formdata'].validate().then(res => {
|
|
|
|
|
@ -817,9 +830,9 @@
|
|
|
|
|
this.submitForm()
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if(this.isStudy){
|
|
|
|
|
if (this.isStudy) {
|
|
|
|
|
this.submitNoStudy()
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
uni.setStorageSync('formdata', this.form)
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: '/pages/visit/study?type=' + this.form.type
|
|
|
|
|
@ -857,7 +870,7 @@
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
submitNoStudy(){
|
|
|
|
|
submitNoStudy() {
|
|
|
|
|
let that = this
|
|
|
|
|
this.util.request({
|
|
|
|
|
api: '/api/mobile/visit/visit-save',
|
|
|
|
|
@ -893,11 +906,13 @@
|
|
|
|
|
} else {
|
|
|
|
|
// 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
|
|
|
|
|
uni.requestSubscribeMessage({
|
|
|
|
|
tmplIds: ['DmzNRREPFdZrMWconNDdbj_ebtVPRWufq27kRQ25eNg','IczaKkCmwf55tAAzCcxb_fbbf5L25SWrSKvaBrkIyk4'],
|
|
|
|
|
tmplIds: ['DmzNRREPFdZrMWconNDdbj_ebtVPRWufq27kRQ25eNg',
|
|
|
|
|
'IczaKkCmwf55tAAzCcxb_fbbf5L25SWrSKvaBrkIyk4'
|
|
|
|
|
],
|
|
|
|
|
success(res) {
|
|
|
|
|
console.log("res", res)
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title:'订阅成功'
|
|
|
|
|
title: '订阅成功'
|
|
|
|
|
})
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: '/pages/visit/successform'
|
|
|
|
|
@ -935,34 +950,50 @@
|
|
|
|
|
/deep/ .uni-drawer__content {
|
|
|
|
|
padding: 40rpx
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.configtitle {
|
|
|
|
|
font-size: 40rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
margin-top:36rpx
|
|
|
|
|
margin-top: 36rpx;
|
|
|
|
|
padding-bottom: 20rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.configvalue {
|
|
|
|
|
padding: 40rpx;
|
|
|
|
|
font-size: 36rpx;
|
|
|
|
|
height: 600rpx;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
}
|
|
|
|
|
.configload{
|
|
|
|
|
|
|
|
|
|
.configbtn {
|
|
|
|
|
background: #044ed7;
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
/* display: inline-block; */
|
|
|
|
|
text-align: center;
|
|
|
|
|
margin: 20rpx auto;
|
|
|
|
|
color: #fff;
|
|
|
|
|
border-radius: 20rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.configload {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
font-size: 50rpx;
|
|
|
|
|
color: #ddd;
|
|
|
|
|
}
|
|
|
|
|
.configload text{
|
|
|
|
|
margin-right:20rpx
|
|
|
|
|
}
|
|
|
|
|
/deep/ .u-popup__content__close .u-icon__icon{
|
|
|
|
|
color:#fff!important
|
|
|
|
|
|
|
|
|
|
.configload text {
|
|
|
|
|
margin-right: 20rpx
|
|
|
|
|
}
|
|
|
|
|
.areavalue{
|
|
|
|
|
|
|
|
|
|
/deep/ .u-popup__content__close .u-icon__icon {
|
|
|
|
|
color: #fff !important
|
|
|
|
|
}
|
|
|
|
|
.areabtn{
|
|
|
|
|
|
|
|
|
|
.areavalue {}
|
|
|
|
|
|
|
|
|
|
.areabtn {
|
|
|
|
|
background-color: #044ed7;
|
|
|
|
|
/* margin-left: 8px; */
|
|
|
|
|
width: 100%;
|
|
|
|
|
@ -971,7 +1002,8 @@
|
|
|
|
|
left: 0;
|
|
|
|
|
border-radius: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/deep/ .areavalue .uni-data-checklist .checklist-group .checklist-box.is--button {
|
|
|
|
|
padding:30rpx
|
|
|
|
|
padding: 30rpx
|
|
|
|
|
}
|
|
|
|
|
</style>
|