master
lion 3 years ago
parent 211e005a09
commit 36465dec21

@ -23,7 +23,7 @@
<view>拜访人<text>{{info.name}}</text></view> <view>拜访人<text>{{info.name}}</text></view>
<view>电话{{info.mobile}}</view> <view>电话{{info.mobile}}</view>
<view v-if="info.type=='1'"><text>{{info.reason}}</text></view> <view v-if="info.type=='1'"><text>{{info.reason}}</text></view>
<view v-else-if="info.type=='3'">停车区域<text>{{info.plate}}</text></view> <view v-else-if="info.type=='3'">车辆<text>{{info.plate}}</text></view>
</view> </view>
</view> </view>
<view class="dblong"> <view class="dblong">

@ -16,7 +16,7 @@
<view class="dbstatus bm"> <view class="dbstatus bm">
<view class="justify-start"> <view class="justify-start">
{{item.audit_status_text}} {{item.audit_status_text}}
<button class="signBtn" @click.stop='signPic(item.id)' type="primary" v-if="item.audit_status==3&&!item.accept_admin_sign"></button> <button class="signBtn" @click.stop='signPic(item.id)' type="primary" v-if="nowadminID==item.accept_admin_id&&item.audit_status==3&&!item.accept_admin_sign"></button>
</view> </view>
<view> <view>
<text style="margin-right:10px">访问时间{{item.date}}</text> <text style="margin-right:10px">访问时间{{item.date}}</text>
@ -61,7 +61,8 @@
export default { export default {
data() { data() {
return { return {
btnActive: "", btnActive: "",
nowadminID:'',
btnList: [{ btnList: [{
label: "全部", label: "全部",
value: '' value: ''
@ -93,7 +94,9 @@
this.recordType = options.type this.recordType = options.type
this.select.my_audit = this.recordType=='mycheck'?1:0 this.select.my_audit = this.recordType=='mycheck'?1:0
this.select.my_self = this.recordType=='call'?1:0 this.select.my_self = this.recordType=='call'?1:0
this.select.my_accept_admin = this.recordType=='myrecord'?1:0 this.select.my_accept_admin = this.recordType=='myrecord'?1:0
this.nowadminID = uni.getStorageSync('userInfo_Bd').id
console.log("this.nowadminID",this.nowadminID)
this.loadList() this.loadList()
}, },
onPullDownRefresh() { onPullDownRefresh() {

@ -118,7 +118,7 @@
duration: 2000, duration: 2000,
icon: 'none' icon: 'none'
}) })
uni.navigateTo({ uni.redirectTo({
url: '/pages/bd/record?type=myrecord' url: '/pages/bd/record?type=myrecord'
}) })
}, },

@ -40,7 +40,7 @@
v-model="form.work_end_time" /> v-model="form.work_end_time" />
</uni-forms-item> </uni-forms-item>
<!-- <uni-forms-item label="车牌号" v-if="form.type==3"> --> <!-- <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-data-checkbox v-model="form.plate" :localdata="parkAreaList" :map="{text:'value',value:'value'}" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="备注"> <uni-forms-item label="备注">
@ -62,9 +62,25 @@
</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 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>
<uni-forms-item label="到访车辆"> <uni-forms-item label="到访车辆" required name="cars" v-else>
<view style="text-align: right;" v-if="form.type!=3"> <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>
@ -73,7 +89,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 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> 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"
@ -214,7 +230,7 @@
credent: 1, credent: 1,
idcard: "", idcard: "",
company_name: "", company_name: "",
cars: [''], cars: [],
follw_people: [], follw_people: [],
long_time: 0, long_time: 0,
start_date: "", start_date: "",
@ -254,7 +270,7 @@
plate: { plate: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '请选择停车区域' errorMessage: '请选择车辆类型'
}] }]
}, },
name: { name: {
@ -292,6 +308,12 @@
required: true, required: true,
errorMessage: '单位名称不能为空' errorMessage: '单位名称不能为空'
}] }]
},
cars:{
rules: [{
required: true,
errorMessage: '车牌号不能为空'
}]
}, },
acceptName: { acceptName: {
rules: [{ rules: [{
@ -361,7 +383,8 @@
}], }],
adminList: [], adminList: [],
isCall: '', // isCall: '', //
goStudy: '去学习' goStudy: '去学习',
isStudy:false
} }
}, },
@ -375,7 +398,8 @@
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.getStudy()
this.getConfig() this.getConfig()
this.getVisitArea() this.getVisitArea()
this.getVisitTime() this.getVisitTime()
@ -439,15 +463,15 @@
let that = this let that = this
// util.request() // util.request()
this.util.request({ this.util.request({
api: '/api/admin/config/index', api: '/api/mobile/user/config',
data: { data: {
page: 1, page: 1,
page_size: 99 page_size: 99
}, },
requestType: 'bd', // requestType: 'bd',
utilSuccess: function(res) { utilSuccess: function(res) {
console.log(res) console.log(res)
let data = res.data let data = res
for (let k of data) { for (let k of data) {
if (k.key == that.configKey) { if (k.key == that.configKey) {
that.configInfo = k that.configInfo = k
@ -458,7 +482,32 @@
utilFail: function(res) {} 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() { async getVisitArea() {
let that = this let that = this
@ -581,11 +630,16 @@
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
})
} }
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);
}) })
@ -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> </script>
@ -645,9 +749,9 @@
padding: 40rpx padding: 40rpx
} }
.configtitle { .configtitle {
font-size: 50rpx; font-size: 40rpx;
text-align: center; text-align: center;
padding: 20rpx 0; margin-top:36rpx
} }
.configvalue { .configvalue {
padding: 40rpx; padding: 40rpx;

@ -24,7 +24,7 @@
<view>拜访人<text>{{info.name}}</text></view> <view>拜访人<text>{{info.name}}</text></view>
<view>电话{{info.mobile}}</view> <view>电话{{info.mobile}}</view>
<view v-if="info.type=='1'"><text>{{info.reason}}</text></view> <view v-if="info.type=='1'"><text>{{info.reason}}</text></view>
<view v-else-if="info.type=='3'">停车区域<text>{{info.plate}}</text></view> <view v-else-if="info.type=='3'">车辆类型<text>{{info.plate}}</text></view>
</view> </view>
</view> </view>
<view class="dblong"> <view class="dblong">

@ -3,7 +3,7 @@
<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>
<view class="study"> <view class="study" style="padding:0 20rpx">
<view class="service-show" v-if="studyInfo.file_detail.length>0"> <view class="service-show" v-if="studyInfo.file_detail.length>0">
<view v-if="picList.length>0&&showSwiperFlag==0"> <view v-if="picList.length>0&&showSwiperFlag==0">
<u-swiper :list="picList" @change="changeImg" keyName="url" <u-swiper :list="picList" @change="changeImg" keyName="url"

@ -2,6 +2,9 @@
<view class="containers"> <view class="containers">
<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 class="expire" v-if="studyInfo.expire_day">
通过测验后{{studyInfo.expire_day}}天内可不再重复学习
</view> </view>
<view class="asks"> <view class="asks">
<view v-for="(item,index) in askList"> <view v-for="(item,index) in askList">
@ -42,27 +45,22 @@
rate: 0, rate: 0,
askList: [], askList: [],
correctNum: {}, correctNum: {},
answerList: [], answerList: [],
result: {}, result: {}, //
resultArr: [ resultArr: [], //
[], formData: {},
[], askData:{},
[], askContent:[],
[],
[],
[],
[],
[],
[]
],
formData: {}
} }
}, },
onLoad(options) { onLoad(options) {
let that = this let that = this
this.type = options.type this.type = options.type
this.askData.type = parseInt(options.type)
// for(let i=0;i<20;i++){
// this.resultArr.push([])
// }
this.getFormdata() this.getFormdata()
this.getStudy() this.getStudy()
@ -82,14 +80,20 @@
utilSuccess: function(res) { utilSuccess: function(res) {
that.studyInfo = res that.studyInfo = res
that.askList = res.asks that.askList = res.asks
that.rate = parseInt(res.rate) that.rate = parseInt(res.rate)
that.askData.ask = res.asks
that.askData.expire_day = res.expire_day
for(let i=0;i<res.asks.length;i++){
that.resultArr.push([])
}
}, },
utilFail: function(res) {} utilFail: function(res) {}
}) })
}, },
// //
radioAnswer(item, index) { radioAnswer(e, index) {
this.correctNum[index] = item.detail.data.result this.correctNum[index] = e.detail.data.result
this.askContent[index] = e.detail.data.content
}, },
chenckAnswer(e, item, index) { chenckAnswer(e, item, index) {
let answer = item.answer let answer = item.answer
@ -101,8 +105,7 @@
} }
} }
// 0 // 0
if (data.length < correctLength) { if (data.length != correctLength) {
console.log(correctLength)
this.correctNum[index] = 0 this.correctNum[index] = 0
return return
} else { } else {
@ -117,7 +120,8 @@
}, },
// //
submitAnswer() { submitAnswer() {
let correctLength = 0 let correctLength = 0
console.log("this.correctNum",this.correctNum)
for (var key in this.correctNum) { for (var key in this.correctNum) {
if (this.correctNum[key] == 1) { if (this.correctNum[key] == 1) {
correctLength++ correctLength++
@ -132,7 +136,17 @@
}, },
submitForm() { submitForm() {
let that = this let that = this
this.resultArr.map((k,index)=>{
if(k.length>0){
this.askContent[index] = k
}
})
this.askData.content = this.askContent
console.log(this.result,this.resultArr,'---',this.askContent)
console.log("askdata",this.askData)
that.submitStudy()
// return
this.util.request({ this.util.request({
api: '/api/mobile/visit/visit-save', api: '/api/mobile/visit/visit-save',
method: "POST", method: "POST",
@ -155,6 +169,26 @@
} }
}) })
}, },
submitStudy() {
let that = this
this.util.request({
api: '/api/mobile/visit/ask-save',
method: "POST",
data: that.askData,
utilSuccess: function(res) {
},
utilFail: function(res) {
uni.showToast({
title: res,
duration: 2000,
icon: 'none'
})
}
})
},
newsSubscription() { newsSubscription() {
uni.getSetting({ uni.getSetting({
withSubscriptions: true, //false withSubscriptions: true, //false
@ -238,5 +272,11 @@
.steps { .steps {
margin-bottom: 40rpx margin-bottom: 40rpx
}
.expire{
text-align: center;
font-size: 40rpx;
/* padding: 10px; */
margin-bottom: 40rpx;
} }
</style> </style>

Loading…
Cancel
Save