diff --git a/pages.json b/pages.json
index fb18994..c0930c7 100644
--- a/pages.json
+++ b/pages.json
@@ -35,6 +35,9 @@
"path": "pages/visit/addrecord"
},
// 学习
+ {
+ "path": "pages/visit/tostudy"
+ },
{
"path": "pages/visit/study"
},
diff --git a/pages/bd/bddetail.vue b/pages/bd/bddetail.vue
index e777c7e..dc07604 100644
--- a/pages/bd/bddetail.vue
+++ b/pages/bd/bddetail.vue
@@ -25,10 +25,16 @@
事由:{{info.reason}}
车辆:{{info.plate}}
+
+
+
+ 拜访公司:{{info.company_name?info.company_name:''}}
+
+
长期访客申请:{{info.long_time==0?'否':'是'}}
- 长期访问时间:{{info.start_date}} 至 {{info.end_date}}
+ 长期访问时间:{{info.start_date?info.start_date:''}} 至 {{info.end_date?info.end_date:''}}
@@ -321,5 +327,12 @@
.dbinfo>view text {
color: #8f9596;
+ }
+ .company{
+ padding-bottom:30rpx;
+ margin-top:-10rpx;
+ }
+ .company text{
+ color: #8f9596;
}
diff --git a/pages/bd/mine.vue b/pages/bd/mine.vue
index 7b7187f..e18d97c 100644
--- a/pages/bd/mine.vue
+++ b/pages/bd/mine.vue
@@ -65,10 +65,16 @@
事由:{{item.reason}}
车牌:{{item.plate}}
+
+
+
+ 拜访公司:{{item.company_name?item.company_name:''}}
+
+
长期访客申请:{{item.long_time==0?'否':'是'}}
- 长期访问时间:{{item.start_date}} 至 {{item.end_date}}
+ 长期访问时间:{{item.start_date?item.start_date:''}} 至 {{item.end_date?item.end_date:''}}
@@ -346,5 +352,12 @@
padding: 0 20rpx;
background-color: #044ed7;
color: #fff
+ }
+ .company{
+ padding-bottom:30rpx;
+ margin-top:-10rpx;
+ }
+ .company text{
+ color: #8f9596;
}
\ No newline at end of file
diff --git a/pages/bd/record.vue b/pages/bd/record.vue
index f846869..5cc05c1 100644
--- a/pages/bd/record.vue
+++ b/pages/bd/record.vue
@@ -35,10 +35,16 @@
事由:{{item.reason}}
车牌:{{item.plate}}
+
+
+
+ 拜访公司:{{item.company_name?item.company_name:''}}
+
+
长期访客申请:{{item.long_time==0?'否':'是'}}
- 长期访问时间:{{item.start_date}} 至 {{item.end_date}}
+ 长期访问时间:{{item.start_date?item.start_date:''}} 至 {{item.end_date?item.end_date:''}}
@@ -191,5 +197,12 @@
margin-left: 40rpx;
font-size: 32rpx;
line-height: 2.3;
+ }
+ .company{
+ padding-bottom:30rpx;
+ margin-top:-10rpx;
+ }
+ .company text{
+ color: #8f9596;
}
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 37987b3..a65ad23 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -5,8 +5,14 @@
我的拜访记录
-
+
+
+
+
+
+
@@ -14,9 +20,10 @@
-
- BD管理员
+
+ BD管理员
+
@@ -28,9 +35,10 @@
export default {
data() {
return {
- ptfk: require('../../static/img/ptfk1.png'),
+ ptfk: require('../../static/img/ptfk.png'),
wlcl: require('../../static/img/wlcl1.png'),
- sgry: require('../../static/img/sgry1.png'),
+ sgry: require('../../static/img/sgry1.png'),
+ xxpx: require('../../static/img/xxpx.png'),
bdgl: require('../../static/img/bdgl.png'),
winHeight: 0,
isBd:""
@@ -59,6 +67,9 @@
break;
case 0:
url = "/pages/visit/visithistory"
+ break;
+ case 5:
+ url = "/pages/visit/tostudy"
break;
case 4:
if(!this.util.isNull(this.isBd)){
diff --git a/pages/index/login.vue b/pages/index/login.vue
index 3545932..cffec4b 100644
--- a/pages/index/login.vue
+++ b/pages/index/login.vue
@@ -71,7 +71,13 @@
})
that.getBdInfo();
},
- utilFail: function(res) {}
+ utilFail: function(res) {
+ uni.showToast({
+ title: res,
+ duration: 2000,
+ icon:'none'
+ })
+ }
})
}).catch(err => {
console.log('err', err);
diff --git a/pages/visit/addrecord.vue b/pages/visit/addrecord.vue
index 0e7ae51..e30432c 100644
--- a/pages/visit/addrecord.vue
+++ b/pages/visit/addrecord.vue
@@ -190,7 +190,7 @@
:dataLists="adminList" placeholder="输入陪同人具体姓名或手机号搜索" @search="selectSearch" @submit="submitAccept"
@cancel="cancelAccept" />
-
+
@@ -455,7 +455,7 @@
}],
adminList: [],
isCall: '', // 是否待邀约
- goStudy: '去学习',
+ goStudy: '提交',
isStudy:false
}
@@ -470,13 +470,16 @@
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.goStudy = this.isCall == 'call' ? '提交' : ''
this.form.audit_status = this.isCall == 'call' ? 1 : 0
- this.getStudy()
+ this.showStudy()
if(options.type==2||options.type==3){
this.getConfig()
}
- this.init()
+ this.init()
+ if(uni.getStorageSync('formdata')){
+ this.form = uni.getStorageSync('formdata')
+ }
// this.getAdminList()
},
onReady() {},
@@ -590,31 +593,7 @@
})
},
// 获取单选数据
- 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
@@ -737,7 +716,90 @@
},
- // 去学习
+ // 去学习
+ // 获取访客学习状态
+ async showStudy() {
+ this.util.alert("请确保每位访客都已通过学习培训,方可提交拜访")
+ // let that = this
+ // let id_arr = []
+ // id_arr.push(this.form.idcard)
+ // for(var k of this.form.follw_people){
+ // id_arr.push(k.idcard)
+ // }
+ // this.util.request({
+ // api: '/api/mobile/visit/ask-log',
+ // method: "post",
+ // data:{
+ // type:that.form.type
+ // },
+ // utilSuccess: function(res) {
+ // console.log("res",res)
+ // if(res.msg=='学习有效中'){
+ // uni.showToast({
+ // title: '请确保随访人员都已通过学习培训方可提交拜访',
+ // duration: 2000,
+ // icon: 'none'
+ // })
+ // that.isStudy = true
+ // that.goStudy = '提交'
+
+ // }
+ // },
+ // utilFail: function(res) {
+ // // console.log(res)
+ // // uni.showToast({
+ // // title: res,
+ // // duration: 2000,
+ // // icon: 'none'
+ // // })
+ // }
+ // })
+ },
+ // 获取随访人员的 学习记录
+ async getStudy() {
+ let that = this
+ let id_arr = []
+ id_arr.push(this.form.idcard)
+ 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
+ },
+ utilSuccess: function(res) {
+ if(res.length>0){
+ let str = res.join(",")+'未完成学习培训'
+ that.util.alert(str)
+ uni.setStorageSync('formdata', that.form)
+ }else{
+ // 邀约
+ if (that.isCall === 'call') {
+ that.submitForm()
+ }else{
+ // 访客
+ that.submitNoStudy()
+ }
+ }
+ },
+ utilFail: function(res) {
+ // console.log(res)
+ uni.showToast({
+ title: res,
+ duration: 2000,
+ icon: 'none'
+ })
+ }
+ })
+
+ }).catch(err => {
+ console.log('err', err);
+ })
+
+ },
saveFormgoStudy() {
if(this.form.credent==2){
this.form.idcard = this.form.passcard
@@ -775,7 +837,7 @@
duration: 2000,
icon: 'none'
})
- // uni.removeStorageSync('formData')
+ uni.removeStorageSync('formdata')
uni.redirectTo({
url: '/pages/visit/successform?iscall=call'
})
@@ -801,6 +863,7 @@
duration: 2000,
icon: 'none'
})
+ uni.removeStorageSync('formdata')
that.newsSubscription()
},
utilFail: function(res) {
diff --git a/pages/visit/detail.vue b/pages/visit/detail.vue
index 93f23d5..74da71e 100644
--- a/pages/visit/detail.vue
+++ b/pages/visit/detail.vue
@@ -26,10 +26,17 @@
事由:{{info.reason}}
车辆类型:{{info.plate}}
-
+
+
+
+ 拜访公司:{{info.company_name?info.company_name:''}}
+
+
+
+
长期访客申请:{{info.long_time==0?'否':'是'}}
- 长期访问时间:{{info.start_date}} 至 {{info.end_date}}
+ 长期访问时间:{{info.start_date?info.start_date:''}} 至 {{info.end_date?info.end_date:''}}
@@ -325,5 +332,13 @@
.cancelcode button.wd100{
width:100%;
- }
+ }
+ .company{
+ padding-bottom:30rpx;
+ margin-top:-10rpx;
+ }
+ .company text{
+ color: #8f9596;
+ }
+
diff --git a/pages/visit/testStudy.vue b/pages/visit/testStudy.vue
index 8665b28..c8dd2dc 100644
--- a/pages/visit/testStudy.vue
+++ b/pages/visit/testStudy.vue
@@ -67,8 +67,10 @@
},
methods: {
getFormdata(){
- let res = uni.getStorageSync('formdata')
- this.formData = res
+ // let res = uni.getStorageSync('formdata')
+ // this.formData = res
+ let res = uni.getStorageSync('studydata')
+ this.askData = res
},
async getStudy() {
let that = this
@@ -146,7 +148,7 @@
console.log(this.result,this.resultArr,'---',this.askContent)
console.log("askdata",this.askData)
that.submitStudy()
- // return
+ return
this.util.request({
api: '/api/mobile/visit/visit-save',
method: "POST",
@@ -171,12 +173,27 @@
},
submitStudy() {
let that = this
+ console.log("that.askData",that.askData)
+ // return
this.util.request({
api: '/api/mobile/visit/ask-save',
method: "POST",
data: that.askData,
utilSuccess: function(res) {
+ if(uni.getStorageSync('studydata')){
+ uni.removeStorageSync('studydata')
+ }
+ uni.showToast({
+ title: '提交成功',
+ duration: 1500,
+ icon: 'none'
+ })
+ setTimeout(function(){
+ uni.redirectTo({
+ url: '/pages/index/index'
+ })
+ },1500)
},
utilFail: function(res) {
uni.showToast({
@@ -234,6 +251,7 @@
.asks {
min-height: 80vh;
overflow-y: auto;
+ padding-bottom:60rpx
}
.asks>view,
@@ -244,7 +262,8 @@
.containers>.submitBtn {
position: fixed;
bottom: 0;
- width: 100%;
+ width: 100%;
+ left:0
}
.containers>.submitBtn text {
@@ -259,7 +278,7 @@
}
.containers>.submitBtn text:first-child {
- border-radius: 10rpx 0 0 10rpx;
+ border-radius: 0rpx 0 0 10rpx;
}
.containers>.submitBtn text:last-child {
@@ -267,7 +286,7 @@
background-color: #044ed7;
color: #fff;
display: inline-block;
- border-radius: 0 10rpx 10rpx 0;
+ border-radius: 0 0rpx 10rpx 0;
}
.steps {
diff --git a/pages/visit/tostudy.vue b/pages/visit/tostudy.vue
new file mode 100644
index 0000000..3718ee6
--- /dev/null
+++ b/pages/visit/tostudy.vue
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+ 基础信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/visit/visithistory.vue b/pages/visit/visithistory.vue
index 836186b..6bda588 100644
--- a/pages/visit/visithistory.vue
+++ b/pages/visit/visithistory.vue
@@ -30,10 +30,16 @@
事由:{{item.reason}}
车牌:{{item.plate}}
+
+
+
+ 拜访公司:{{item.company_name?item.company_name:''}}
+
+
长期访客申请:{{item.long_time==0?'否':'是'}}
- 长期访问时间:{{item.start_date}} 至 {{item.end_date}}
+ 长期访问时间:{{item.start_date?item.start_date:''}} 至 {{item.end_date?item.end_date:''}}
@@ -158,5 +164,12 @@
}
/deep/ .u-empty{
min-height: 60vh;
+ }
+ .company{
+ padding-bottom:30rpx;
+ margin-top:-10rpx;
+ }
+ .company text{
+ color: #8f9596;
}
diff --git a/static/img/ptfk.png b/static/img/ptfk.png
index 59eb61e..f8db7af 100644
Binary files a/static/img/ptfk.png and b/static/img/ptfk.png differ
diff --git a/static/img/xxpx.png b/static/img/xxpx.png
new file mode 100644
index 0000000..ae72ce0
Binary files /dev/null and b/static/img/xxpx.png differ
diff --git a/utils/util.js b/utils/util.js
index d17919a..44396b9 100755
--- a/utils/util.js
+++ b/utils/util.js
@@ -199,7 +199,8 @@ const request = options => {
success: function(res) {
uni.hideLoading();
if (res.statusCode != 200) {
- if (options.utilFail != undefined) {
+ if (options.utilFail != undefined) {
+
if (res.statusCode == 401) {
uni.clearStorageSync();
uni.navigateTo({
@@ -210,8 +211,10 @@ const request = options => {
}
}
} else {
- if (res.data.hasOwnProperty("errcode")) {
+ if (res.data.hasOwnProperty("errcode")) {
+
if (options.utilFail != undefined) {
+ // console.log("res",res.data.errmsg)
options.utilFail(res.data.errmsg || '接口发生未知错误');
// setTimeout(function(){
// if(res.data.errcode==40001){