描述:预约详细信息

This commit is contained in:
SelfRidicule 2024-03-10 17:58:40 +08:00
parent c1da11dc1d
commit 058d9e7c07
4 changed files with 146 additions and 10 deletions

View File

@ -8,7 +8,8 @@ import {
import { import {
visitorPersonRq, visitorPersonRq,
selectVisitorRecordByIdRq selectVisitorRecordByIdRq,
updateVisitorPersonStatusRq
} from "../../../../api/meeting/visitorIinvitation.js" } from "../../../../api/meeting/visitorIinvitation.js"
@ -22,6 +23,8 @@ Page({
id: null, id: null,
title: null, title: null,
type: null, type: null,
submitShow: false,
verifyShow: false,
userDetail: {}, userDetail: {},
idcardTypeShow: false, idcardTypeShow: false,
idcardTypeList: [{ idcardTypeList: [{
@ -49,7 +52,11 @@ Page({
visitContent: null, // 来访事由 visitContent: null, // 来访事由
photo: null, // 头像-相对路径 photo: null, // 头像-相对路径
url: null, // 人脸设备图片-全路径 url: null, // 人脸设备图片-全路径
} },
// 审核
dialogShow: false,
dialogId: null,
dialogContent: null,
}, },
/** /**
@ -76,6 +83,16 @@ Page({
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: options.title title: options.title
}) })
// 根据类型 判断显示
if (options.type == 'add') {
_this.setData({
submitShow: true
})
} else if (options.type == 'verify') {
} else if (options.type == 'detail') {
}
// 有id查询详情 // 有id查询详情
if (options.id) { if (options.id) {
// 获取详情 // 获取详情
@ -89,6 +106,12 @@ Page({
selectVisitorRecordByIdRq(_this.data.id).then(res => { selectVisitorRecordByIdRq(_this.data.id).then(res => {
console.log('selectVisitorRecordByIdRq', res); console.log('selectVisitorRecordByIdRq', res);
let detail = res.data; let detail = res.data;
// 是点击审核菜单或按钮并且是未审核的数据
if (_this.data.type == 'verify' && detail.status == 0) {
_this.setData({
verifyShow: true
})
}
_this.setData({ _this.setData({
detail, detail,
fileList: [{ fileList: [{
@ -332,6 +355,13 @@ Page({
// 添加数据 // 添加数据
visitorPersonRq(detail).then(res => { visitorPersonRq(detail).then(res => {
console.log('visitorPersonRq', res); console.log('visitorPersonRq', res);
// 刷新上个页面参数
let pages = getCurrentPages(); //获取page
let prevPage = pages[pages.length - 2]; //上一个页面(父页面)
prevPage.setData({
changeData: true
})
//
if (res.code == 0) { if (res.code == 0) {
wx.navigateBack() wx.navigateBack()
} else { } else {
@ -340,6 +370,69 @@ Page({
}) })
}, },
// 显示-弹出框
showDialog(e) {
console.log('showDialog', e);
let _this = this
_this.setData({
dialogShow: true,
dialogId: e.currentTarget.dataset.id,
dialogContent: null
})
},
// 弹出框-审核
dialogVerify(e) {
console.log('dialogSuccess', e);
let status = e.currentTarget.dataset.status;
let _this = this
// 驳回 需要输入描述信息
if (status == 2 && !_this.data.dialogContent) {
Notify({
type: 'danger',
message: '请输入描述信息!'
});
return
}
updateVisitorPersonStatusRq({
id: _this.data.dialogId,
status,
rejectContent: _this.data.dialogContent,
}).then(res => {
console.log('updateVisitorPersonStatusRq', res);
// 刷新上个页面参数
let pages = getCurrentPages(); //获取page
let prevPage = pages[pages.length - 2]; //上一个页面(父页面)
prevPage.setData({
changeData: true
})
//
_this.setData({
dialogShow: false,
})
if (res.code == 0) {
_this.setData({
verifyShow: false
})
} else {
Notify({
type: 'danger',
message: res.msg
});
}
})
},
// 弹出框-输入框:输入内容时触发
dialogInput(e) {
let _this = this
console.log('dialogInput', e.detail);
_this.setData({
dialogContent: e.detail,
})
},
// 显示错误消息 // 显示错误消息
showErrMsg(msg) { showErrMsg(msg) {
Notify({ Notify({

View File

@ -6,7 +6,9 @@
"van-uploader": "@vant/weapp/uploader/index", "van-uploader": "@vant/weapp/uploader/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index", "van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-notify": "@vant/weapp/notify/index", "van-notify": "@vant/weapp/notify/index",
"van-action-sheet": "@vant/weapp/action-sheet/index" "van-action-sheet": "@vant/weapp/action-sheet/index",
"van-dialog": "@vant/weapp/dialog/index"
} }
} }

View File

@ -21,7 +21,7 @@
</view> </view>
<view class="rowView"> <view class="rowView">
<view class="label must">手机号码</view> <view class="label must">手机号码</view>
<van-field value="{{ detail.phone }}" bind:input="fieldInput" data-name="phone" input-class="input" placeholder="请输入" border="{{ false }}" input-align="right" /> <van-field value="{{ detail.phone }}" bind:input="fieldInput" data-name="phone" input-class="input" placeholder="请输入" border="{{ false }}" input-align="right" />
</view> </view>
<view class="rowView"> <view class="rowView">
<view class="label must">身份证类型</view> <view class="label must">身份证类型</view>
@ -29,7 +29,7 @@
</view> </view>
<view class="rowView"> <view class="rowView">
<view class="label must">身份证号</view> <view class="label must">身份证号</view>
<van-field value="{{ detail.cardNo }}" bind:input="fieldInput" data-name="cardNo" input-class="input" placeholder="请输入" border="{{ false }}" input-align="right" /> <van-field value="{{ detail.cardNo }}" bind:input="fieldInput" data-name="cardNo" input-class="input" placeholder="请输入" border="{{ false }}" input-align="right" />
</view> </view>
<view class="rowView" bind:tap="showVisitTime"> <view class="rowView" bind:tap="showVisitTime">
<view class="label must">到访时间</view> <view class="label must">到访时间</view>
@ -42,7 +42,7 @@
<view class="rowView"> <view class="rowView">
<view class="label must">来访事由</view> <view class="label must">来访事由</view>
<van-field value="{{ detail.visitContent }}" bind:input="fieldInput" data-name="visitContent" input-class="input" placeholder="请输入" border="{{ false }}" input-align="right" /> <van-field value="{{ detail.visitContent }}" bind:input="fieldInput" data-name="visitContent" input-class="input" placeholder="请输入" border="{{ false }}" input-align="right" />
</view> </view>
<view class="rowView"> <view class="rowView">
@ -53,13 +53,14 @@
<!-- 上传图片 --> <!-- 上传图片 -->
<view class="uploadImgView"> <view class="uploadImgView">
<van-uploader file-list="{{ fileList }}" upload-text="点击上传照片" use-before-read bind:before-read="beforeRead" bind:after-read="afterRead" deletable="{{ true }}" bind:delete="deleteImg" max-count="1" /> <van-uploader file-list="{{ fileList }}" upload-text="点击上传照片" use-before-read bind:before-read="beforeRead" bind:after-read="afterRead" deletable="{{ true }}" bind:delete="deleteImg" max-count="1" />
<view class="tipsView">提示:请保持五官清晰,以方便系统精准识</view> <view class="tipsView">提示:请保持五官清晰,以方便系统精准识</view>
</view> </view>
<!-- 提交 --> <!-- 提交 -->
<view class="submitBtnView" bind:tap="submitData">提交</view> <view class="submitBtnView" wx:if="{{submitShow}}" bind:tap="submitData">提交</view>
<!-- 审核 -->
<view class="submitBtnView" wx:if="{{verifyShow}}" bind:tap="showDialog" data-id="{{id}}">审核</view>
</view> </view>
@ -78,3 +79,12 @@
<van-popup show="{{ leaveTimeShow }}" position="bottom" custom-style="height: 50vh;" bind:close="closeLeaveTime"> <van-popup show="{{ leaveTimeShow }}" position="bottom" custom-style="height: 50vh;" bind:close="closeLeaveTime">
<van-datetime-picker type="datetime" value="{{ leaveTimeDate }}" min-date="{{ visitTimeDate }}" bind:confirm="confirmLeaveTime" bind:cancel="closeLeaveTime" /> <van-datetime-picker type="datetime" value="{{ leaveTimeDate }}" min-date="{{ visitTimeDate }}" bind:confirm="confirmLeaveTime" bind:cancel="closeLeaveTime" />
</van-popup> </van-popup>
<!-- 审核弹出框 -->
<van-dialog use-slot title="审核" show="{{ dialogShow }}" show-confirm-button="{{false}}" show-cancel-button="{{false}}" close-on-click-overlay>
<van-field input-class="textarea" bind:input="dialogInput" value="{{ dialogContent }}" type="textarea" placeholder="请输入描述信息" />
<view class="dialogBtnView">
<view class="rejectBtn" data-status="2" bind:tap="dialogVerify">驳回</view>
<view class="successBtn" data-status="1" bind:tap="dialogVerify">通过</view>
</view>
</van-dialog>

View File

@ -80,3 +80,34 @@
font-size: 30rpx; font-size: 30rpx;
text-align: center; text-align: center;
} }
.textarea {
height: 300rpx !important;
border: 1px solid rgb(126, 126, 126, 0.2) !important;
padding: 20rpx !important;
}
.dialogBtnView {
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid rgb(126, 126, 126, 0.2);
}
.dialogBtnView .rejectBtn,
.dialogBtnView .successBtn {
width: 50%;
text-align: center;
padding: 30rpx 0;
font-size: 32rpx;
}
.dialogBtnView .rejectBtn {
border-right: 1px solid rgb(126, 126, 126, 0.2);
color: red;
}
.dialogBtnView .successBtn {
color: #4e96f8;
}