lion 3 years ago
parent f85d4b9528
commit b5acfd07d0

@ -93,6 +93,28 @@
</view>
</view>
</view>
<!-- 审核 -->
<view class="checkforms dbitem" v-if="info.audit_status==0" style="padding-top:30rpx">
<uni-forms ref="formdata" :model="checkForm" :rules="rules" labelWidth="100px">
<uni-forms-item label="状态" required name="status">
<uni-data-select v-model="checkForm.status" :localdata="statusList">
</uni-data-select>
</uni-forms-item>
<uni-forms-item label="审核" required name="level">
<uni-data-select v-model="checkForm.level" :localdata="levelList" @change="setLevel">
</uni-data-select>
<view>{{check_admin_name}}</view>
</uni-forms-item>
<uni-forms-item label="备注">
<uni-easyinput type="textarea" v-model="checkForm.reason" placeholder="请输入备注" />
</uni-forms-item>
</uni-forms>
<button type="primary" style="background-color: #044ed7;" @click="checkSubmit"></button>
</view>
</view>
</view>
@ -102,11 +124,47 @@
<script>
import '@/static/css/bd.css'
export default{
data(){
return{
id:"",
info:{}
export default {
data() {
return {
id: "",
info: {},
checkForm: {
level: "",
status: "",
audit_admin_id: "",
visit_id:"",
reason:""
},
rules: {
status: {
rules: [{
required: true,
errorMessage: '请选择状态'
}]
},
level: {
rules: [{
required: true,
errorMessage: '请选择审核级别'
}]
},
},
statusList: [{
value: 0,
text: "待审核"
},
{
value: 1,
text: "通过"
},
{
value: 2,
text: "驳回"
},
],
levelList: [],
check_admin_name: ""
}
},
onReady() {
@ -114,19 +172,67 @@
},
onLoad(options) {
this.id = options.id
this.checkForm.visit_id = parseInt(options.id)
this.loadDetail()
},
methods:{
loadDetail(){
methods: {
setLevel(val) {
let that = this
console.log(val)
this.levelList.map(item => {
if (item.value == val) {
that.checkForm.level = item.value
that.checkForm.audit_admin_id = item.admin_id
that.check_admin_name = item.admin_name ? item.admin_name : ''
}
})
},
checkSubmit() {
let that = this
console.log(that.checkForm)
this.util.request({
api: '/api/admin/visit_audit/save',
method: "POST",
requestType:'bd',
data: that.checkForm,
utilSuccess: function(res) {
uni.showToast({
title: res.msg,
duration: 2000,
icon: 'none'
})
// uni.removeStorageSync('formData')
uni.navigateTo({
url:'/pages/bd/record?type=mycheck'
})
},
utilFail: function(res) {
uni.showToast({
title: res.errmsg,
duration: 2000,
icon: 'none'
})
}
})
},
loadDetail() {
let that = this
this.util.request({
api: '/api/admin/visit/show',
method: "get",
requestType:'bd',
requestType: 'bd',
data: {
id:that.id
id: that.id
},
utilSuccess: function(res) {
for (let k of res.visit_area.audit_admin) {
that.levelList.push({
text: k.type_name,
value: k.level,
admin_id: k.admin_id,
admin_name: k.admin_name
})
}
that.info = res
},
@ -139,10 +245,10 @@
}
})
},
isnull(p){
if(p == '' || p == undefined || p == null || p == 'undefined' || p == 'null'){
isnull(p) {
if (p == '' || p == undefined || p == null || p == 'undefined' || p == 'null') {
return ""
}else{
} else {
return p
}
}
@ -153,21 +259,24 @@
</script>
<style scoped>
.containers{
.containers {
background-color: #eceefe;
min-height: 100vh;
padding-top:20rpx;
padding-top: 20rpx;
}
.dbtext{
padding-top:10rpx;
margin-bottom:30rpx;
color:#303639;
font-size:40rpx;
padding-left:30rpx
.dbtext {
padding-top: 10rpx;
margin-bottom: 30rpx;
color: #303639;
font-size: 40rpx;
padding-left: 30rpx
}
.sfyritem{
padding-bottom:10rpx
.sfyritem {
padding-bottom: 10rpx
}
.dbinfo>view text {
color: #8f9596;
}

@ -187,7 +187,6 @@
method: "POST",
requestType: 'bd',
utilSuccess: function(res) {
console.log(res)
that.userName = res.name
that.userEmail = res.email
uni.showToast({
@ -197,8 +196,9 @@
})
},
utilFail: function(res) {
console.log("resss",res)
uni.showToast({
title: res.errmsg,
title: res,
duration: 2000,
icon: 'none'
})

@ -77,12 +77,20 @@
page: 1,
page_size: 5,
total: 0,
audit_status: 0
audit_status: '',
my_self:0,
my_audit:0,
my_accept_admin:0
},
isEmpty:false,
recordType:""
}
},
onLoad() {
onLoad(options) {
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.loadList()
},
onPullDownRefresh() {
@ -127,9 +135,10 @@
method: "get",
requestType: "bd",
data: {
...this.select,
page: this.select.page,
page_size: this.select.page_size,
audit_status: this.select.audit_status
// page_size: this.select.page_size,
// audit_status: this.select.audit_status
},
utilSuccess: function(res) {
if(res.total==0){

@ -234,16 +234,16 @@
value: '是'
}],
adminList: [],
isCall:'',
isCall:'', //
goStudy:'去学习'
}
},
onLoad(options) {
this.form.type = options.type
this.isCall = options.iscall
this.isCall = options.iscall?options.iscall:''
this.goStudy = this.isCall=='call'?'提交':'去学习'
this.form.audit_status = 1
this.form.audit_status = this.isCall=='call'?1:0
this.getVisitArea()
this.getVisitTime()
this.getReason()
@ -369,8 +369,9 @@
submitForm() {
let that = this
this.util.request({
api: '/api/mobile/visit/visit-save',
api: '/api/admin/visit/save',
method: "POST",
requestType:'bd',
data: that.form,
utilSuccess: function(res) {
uni.showToast({
@ -378,9 +379,9 @@
duration: 2000,
icon: 'none'
})
uni.removeStorageSync('formData')
// uni.removeStorageSync('formData')
uni.navigateTo({
url:'/pages/visit/successform'
url:'/pages/visit/successform?iscall=call'
})
},
utilFail: function(res) {

@ -1,4 +1,5 @@
<template>
<page-meta :page-style="'overflow:'+(showCodes||showCancel?'hidden':'visible')"></page-meta>
<view class="containers">
<view class="db">
<view class="dblist">
@ -36,13 +37,13 @@
<template v-if="info.type!='3'">
<view class="dbtext">随访人员</view>
<view class="dbitem sfyritem">
<template v-if="info.follw_people">
<template v-if="info.follw_people.length>0">
<view class="dbinfo justify-left" v-for="people in info.follw_people">
<view>
<view>
随访人<text>{{people.name}}</text>
</view>
<view>证件类型<text>{{people.credent_name}}</text></view>
<view>证件类型<text>{{people.credent==1?'身份证':'护照'}}</text></view>
<view>证件号<text>{{people.idcard}}</text></view>
</view>
<view>
@ -93,20 +94,60 @@
</view>
</view>
</view>
<view class="justify-between cancelcode">
<button :class="info.audit_status<1?'wd100 cancelbtn':'cancelbtn'" v-if="info.audit_status<2&&info.audit_status!=5" @click="showCancelM"
type="primary">取消拜访</button>
<button :class="info.audit_status==3?'wd100 codebtn':'codebtn'" v-if="info.audit_status==1||info.audit_status==3" @click="createdCode"
type="primary" style="">出示二维码</button>
</view>
</view>
</view>
<!-- 二维码 -->
<u-popup class="codepop" :show="showCodes" mode="center" closeable="true" @close="closeshowCodes">
<view class="userBox" style="padding:0 120rpx 0rpx 120rpx;">
<view class="userInfoContent" style="padding: 40rpx;font-size: 28rpx;">
<text class="">核销码{{info.code}}</text>
</view>
<view class="qrcode">
<canvas canvas-id='qrcode' style="width: 170px;height:170px;margin: 0 auto;">
</canvas>
</view>
</view>
</u-popup>
<!-- 取消 -->
<u-popup class="cancelpop" :show="showCancel" mode="center" closeable="true" @close="cancelCancel">
<view class="userBox" style="padding:0 120rpx 0rpx 120rpx;">
<view class="userInfoContent" style="padding: 40rpx;font-size: 36rpx;">
<text class="">是否确认取消此次拜访?</text>
</view>
<view class="justify-between cancelbtns">
<button @click="cancelCancel" class="cancelbtn">取消</button>
<button @click="confirmCancel" class="codebtn">确认</button>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import '@/static/css/bd.css'
export default{
data(){
return{
id:"",
info:{}
import uQRCode from "@/utils/qrcode.js"
export default {
data() {
return {
id: "",
info: {},
showCodes: false,
showCancel:false
}
},
onReady() {
@ -116,17 +157,72 @@
this.id = options.id
this.loadDetail()
},
methods:{
loadDetail(){
methods: {
closeshowCodes() {
this.showCodes = false
},
createdCode(code) {
var id = "qrcode";
this.showCodes = true
uQRCode.make({
canvasId: id,
componentInstance: this,
text: this.info.code,
size: 170,
// margin: 10,
backgroundColor: '#ffffff',
foregroundColor: '#000000',
fileType: 'jpg',
errorCorrectLevel: uQRCode.errorCorrectLevel.H,
success: res => {
}
})
},
showCancelM(){
this.showCancel = true
},
confirmCancel(){
this.info.audit_status = 5
this.info.audit_status_text = "已取消"
let that = this
this.showCancel = false
this.util.request({
api: '/api/mobile/visit/visit-save',
method: "POST",
data: that.info,
utilSuccess: function(res) {
uni.showToast({
title: res.msg,
duration: 2000,
icon: 'none'
})
uni.navigateTo({
url:'/pages/visit/visithistory'
})
},
utilFail: function(res) {
uni.showToast({
title: res.errmsg,
duration: 2000,
icon: 'none'
})
}
})
},
cancelCancel(){
this.showCancel = false
},
loadDetail() {
let that = this
this.util.request({
api: '/api/mobile/user/my-visit-detail',
method: "get",
data: {
id:that.id
id: that.id
},
utilSuccess: function(res) {
that.info = res
},
utilFail: function(res) {
@ -138,10 +234,10 @@
}
})
},
isnull(p){
if(p == '' || p == undefined || p == null || p == 'undefined' || p == 'null'){
isnull(p) {
if (p == '' || p == undefined || p == null || p == 'undefined' || p == 'null') {
return ""
}else{
} else {
return p
}
}
@ -152,22 +248,54 @@
</script>
<style scoped>
.containers{
.containers {
background-color: #eceefe;
min-height: 100vh;
padding-top:20rpx;
padding-top: 20rpx;
}
.dbtext{
padding-top:10rpx;
margin-bottom:30rpx;
color:#303639;
font-size:40rpx;
padding-left:30rpx
.dbtext {
padding-top: 10rpx;
margin-bottom: 30rpx;
color: #303639;
font-size: 40rpx;
padding-left: 30rpx
}
.sfyritem{
padding-bottom:10rpx
.sfyritem {
padding-bottom: 10rpx
}
.dbinfo>view text {
color: #8f9596;
}
/deep/ .u-popup__content {
background: #fff;
}
.cancelcode {
margin: 60rpx 0;
background-color: #eceefe;
}
.cancelcode button,.cancelbtns button {
width: 45%
}
.cancelcode button.cancelbtn,.cancelbtns button.cancelbtn {
background: #dddd;
border: none;
color:#333
}
.cancelcode button.codebtn,.cancelbtns button.codebtn {
background: #044ed7;
border: none;
color:#fff
}
.cancelcode button.wd100{
width:100%;
}
</style>

@ -2,8 +2,8 @@
<view class="containers">
<view>
<img :src="succ" alt="">
<view>提交成功等待审核</view>
<view>审核通过后系统将在第一时间通知</view>
<view>提交成功{{!iscall?',等待审核':''}}</view>
<view v-if="!iscall"></view>
<view>
<button @click="toHistory">访</button>
</view>
@ -15,16 +15,22 @@
export default {
data() {
return {
succ: require('../../static/img/success.png')
succ: require('../../static/img/success.png'),
iscall:false
}
},
onLoad() {
onLoad(options) {
this.iscall=options.iscall?true:false
},
methods: {
toHistory() {
let url = '/pages/visit/visithistory'
if(this.iscall){
url = '/pages/bd/record?type=call'
}
uni.navigateTo({
url: '/pages/visit/visithistory'
url: url
})
}
}

@ -210,10 +210,17 @@ const request = options => {
}
}
} else {
if (res.data.hasOwnProperty("errcode")) {
if (options.utilFail != undefined) {
options.utilFail(res.data.errmsg || '接口发生未知错误');
// setTimeout(function(){
// if(res.data.errcode==40001){
// uni.clearStorageSync();
// uni.navigateTo({
// url: '/pages/index/index'
// });
// }
// },1000)
} else {
options.utilFail(res.data.errmsg);
}

Loading…
Cancel
Save