master
lion 3 years ago
parent 211e005a09
commit 36465dec21

@ -23,7 +23,7 @@
<view>拜访人<text>{{info.name}}</text></view>
<view>电话{{info.mobile}}</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 class="dblong">

@ -16,7 +16,7 @@
<view class="dbstatus bm">
<view class="justify-start">
{{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>
<text style="margin-right:10px">访问时间{{item.date}}</text>
@ -61,7 +61,8 @@
export default {
data() {
return {
btnActive: "",
btnActive: "",
nowadminID:'',
btnList: [{
label: "全部",
value: ''
@ -93,7 +94,9 @@
this.recordType = options.type
this.select.my_audit = this.recordType=='mycheck'?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()
},
onPullDownRefresh() {

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

@ -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;

@ -24,7 +24,7 @@
<view>拜访人<text>{{info.name}}</text></view>
<view>电话{{info.mobile}}</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 class="dblong">

@ -3,7 +3,7 @@
<view class="steps">
<uni-steps :options="steps" :active="stepActive" active-color="#044ed7" />
</view>
<view class="study">
<view class="study" style="padding:0 20rpx">
<view class="service-show" v-if="studyInfo.file_detail.length>0">
<view v-if="picList.length>0&&showSwiperFlag==0">
<u-swiper :list="picList" @change="changeImg" keyName="url"

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

Loading…
Cancel
Save