mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 14:19:38 +08:00
1
This commit is contained in:
parent
b8d989a2bc
commit
9e5143e587
@ -3,8 +3,9 @@ let app = getApp();
|
||||
import Notify from '@vant/weapp/notify/notify';
|
||||
|
||||
import {
|
||||
companyRq
|
||||
} from "../../../../api/meeting/visitorIinvitation.js"
|
||||
selfFormatTimeYMDHMS
|
||||
} from "../../../../utils/util.js"
|
||||
|
||||
|
||||
Page({
|
||||
|
||||
@ -13,6 +14,17 @@ Page({
|
||||
*/
|
||||
data: {
|
||||
IMG_NAME: app.IMG_NAME,
|
||||
userDetail: {},
|
||||
idcardTypeShow: false,
|
||||
idcardTypeList: [{
|
||||
name: '居民身份证',
|
||||
}, ],
|
||||
visitTimeShow: false, // 到访时间show
|
||||
visitTimeDate: new Date().getTime(), // 到访时间-当前
|
||||
visitTimeMinDate: new Date().getTime(), // 到访时间-最小
|
||||
leaveTimeShow: false, // 离开时间show
|
||||
leaveTimeDate: new Date().getTime(), // 离开时间-当前
|
||||
fileList: [], // 上传文件
|
||||
detail: {
|
||||
customerId: null, //企业id
|
||||
customerName: null, //企业名称
|
||||
@ -22,12 +34,11 @@ Page({
|
||||
intervieweeId: null, // 访客id
|
||||
name: null, // 访客姓名
|
||||
phone: null, // 访客手机号
|
||||
joinTime: null, // 加入时间
|
||||
cardType: '居民身份证', // 证件类型
|
||||
cardNo: null, // 证件号
|
||||
visitTime: null, // 到访时间
|
||||
leaveTime: null, // 离开时间
|
||||
visitContent: null, // 来访事由
|
||||
cardType: null, // 证件类型
|
||||
cardNo: null, // 证件号
|
||||
photo: null, // 头像
|
||||
}
|
||||
},
|
||||
@ -38,8 +49,16 @@ Page({
|
||||
onLoad(options) {
|
||||
console.log('onLoad', options)
|
||||
let _this = this;
|
||||
let userDetail = wx.getStorageSync('user')
|
||||
//
|
||||
let detail = _this.data.detail;
|
||||
detail.intervieweeId = userDetail.id // 访客id
|
||||
detail.name = userDetail.username // 访客姓名
|
||||
detail.phone = userDetail.mobile // 访客手机号
|
||||
_this.setData({
|
||||
...options
|
||||
...options,
|
||||
userDetail,
|
||||
detail
|
||||
})
|
||||
// 页面初始化 options为页面跳转所带来的参数
|
||||
wx.setNavigationBarTitle({
|
||||
@ -47,21 +66,19 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 跳转-索引栏(单位、人员)
|
||||
jumpIndexBar(e) {
|
||||
console.log('jumpIndexBar', e);
|
||||
let _this = this;
|
||||
let title = e.currentTarget.dataset.title
|
||||
// 校验是否选择“被访单位” 后 ,再选择被访人信息
|
||||
if (title == '人员' && !_this.data.detail.customerId) {
|
||||
if (title == '人员' && !_this.data.detail.customerId) {
|
||||
// 危险通知
|
||||
Notify({
|
||||
type: 'danger',
|
||||
message: '请先选择被访单位!'
|
||||
});
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
// url 参数
|
||||
let param = '?title=' + title;
|
||||
@ -73,6 +90,143 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
// 显示-身份证类型
|
||||
showIdcardType() {
|
||||
let _this = this;
|
||||
_this.setData({
|
||||
idcardTypeShow: true
|
||||
})
|
||||
},
|
||||
|
||||
// 选择-身份证类型
|
||||
selectIdcardType(e) {
|
||||
console.log('selectIdcardType', e);
|
||||
let _this = this;
|
||||
let detail = _this.data.detail;
|
||||
detail.cardType = e.detail.name;
|
||||
_this.setData({
|
||||
idcardTypeShow: false,
|
||||
detail
|
||||
})
|
||||
},
|
||||
|
||||
// 关闭-身份证类型
|
||||
closeIdcardType() {
|
||||
let _this = this;
|
||||
_this.setData({
|
||||
idcardTypeShow: false
|
||||
})
|
||||
},
|
||||
|
||||
// 显示-到访时间
|
||||
showVisitTime() {
|
||||
let _this = this;
|
||||
_this.setData({
|
||||
visitTimeShow: true
|
||||
})
|
||||
},
|
||||
|
||||
// 关闭-到访时间
|
||||
closeVisitTime() {
|
||||
let _this = this;
|
||||
_this.setData({
|
||||
visitTimeShow: false
|
||||
})
|
||||
},
|
||||
|
||||
// 确认-到访时间
|
||||
confirmVisitTime(e) {
|
||||
console.log('confirmVisitTime', e);
|
||||
let _this = this;
|
||||
let detail = _this.data.detail;
|
||||
detail.visitTime = selfFormatTimeYMDHMS(e.detail);
|
||||
_this.setData({
|
||||
visitTimeShow: false,
|
||||
visitTimeDate: e.detail,
|
||||
detail
|
||||
})
|
||||
},
|
||||
|
||||
// 显示-离开时间
|
||||
showLeaveTime() {
|
||||
let _this = this;
|
||||
_this.setData({
|
||||
leaveTimeShow: true
|
||||
})
|
||||
},
|
||||
|
||||
// 关闭-离开时间
|
||||
closeLeaveTime() {
|
||||
let _this = this;
|
||||
_this.setData({
|
||||
leaveTimeShow: false
|
||||
})
|
||||
},
|
||||
|
||||
// 确认-离开时间
|
||||
confirmLeaveTime(e) {
|
||||
console.log('confirmLeaveTime111', e);
|
||||
let _this = this;
|
||||
let detail = _this.data.detail;
|
||||
detail.leaveTime = selfFormatTimeYMDHMS(e.detail);
|
||||
_this.setData({
|
||||
leaveTimeShow: false,
|
||||
leaveTimeDate: e.detail,
|
||||
detail
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// 图片-上传前校验
|
||||
beforeRead(event) {
|
||||
const {
|
||||
file,
|
||||
callback
|
||||
} = event.detail;
|
||||
callback(file.type === 'image');
|
||||
},
|
||||
|
||||
// 图片-上传后
|
||||
afterRead(event) {
|
||||
let _this = this;
|
||||
const {
|
||||
file
|
||||
} = event.detail;
|
||||
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
wx.uploadFile({
|
||||
url: app.DOMAIN_NAME + '/api/dfs/upload',
|
||||
filePath: file.url,
|
||||
name: 'file',
|
||||
formData: {},
|
||||
success(res) {
|
||||
console.log('upload file ', res);
|
||||
let fileData = JSON.parse(res.data)
|
||||
// 上传完成需要更新 fileList
|
||||
let fileList = _this.data.fileList;
|
||||
fileList.push({
|
||||
relativeUrl: fileData.fileName,
|
||||
url: app.DOMAIN_NAME + fileData.fileName,
|
||||
name: fileData.fileName,
|
||||
deletable: true,
|
||||
})
|
||||
_this.setData({
|
||||
fileList
|
||||
})
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 删除图片
|
||||
deleteImg(event) {
|
||||
console.log('deleteImg', event);
|
||||
let _this = this;
|
||||
let fileList = _this.data.fileList;
|
||||
fileList.splice(event.detail.index, 1);
|
||||
_this.setData({
|
||||
fileList
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
|
@ -2,14 +2,11 @@
|
||||
"navigationBarTitleText": "详情",
|
||||
"usingComponents": {
|
||||
"van-field": "@vant/weapp/field/index",
|
||||
"van-picker": "@vant/weapp/picker/index",
|
||||
"van-popup": "@vant/weapp/popup/index",
|
||||
"van-uploader": "@vant/weapp/uploader/index",
|
||||
"van-button": "@vant/weapp/button/index",
|
||||
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
|
||||
"van-dialog": "@vant/weapp/dialog/index",
|
||||
"van-cell": "@vant/weapp/cell/index",
|
||||
"van-notify": "@vant/weapp/notify/index"
|
||||
"van-notify": "@vant/weapp/notify/index",
|
||||
"van-action-sheet": "@vant/weapp/action-sheet/index"
|
||||
}
|
||||
|
||||
}
|
@ -5,44 +5,44 @@
|
||||
<view class="contentView">
|
||||
<view class="rowView" bind:tap="jumpIndexBar" data-title="单位">
|
||||
<view class="label must">被访单位</view>
|
||||
<van-field model:value="{{ detail.customerName }}" input-class="input" is-link readonly placeholder="请选择" input-align="right" border="{{ false }}"/>
|
||||
<van-field model:value="{{ detail.customerName }}" input-class="input" is-link readonly placeholder="请选择" input-align="right" border="{{ false }}" />
|
||||
</view>
|
||||
<view class="rowView" bind:tap="jumpIndexBar" data-title="人员">
|
||||
<view class="label must">被访人姓名</view>
|
||||
<van-field model:value="{{ detail.username }}" input-class="input" is-link readonly placeholder="请选择" border="{{ false }}" input-align="right"/>
|
||||
<van-field model:value="{{ detail.username }}" input-class="input" is-link readonly placeholder="请选择" border="{{ false }}" input-align="right" />
|
||||
</view>
|
||||
<view class="rowView" bind:tap="jumpIndexBar" data-title="人员">
|
||||
<view class="label must">被访人电话</view>
|
||||
<van-field model:value="{{ detail.mobile }}" is-link readonly input-class="input" placeholder="请输入" border="{{ false }}" input-align="right"/>
|
||||
<van-field model:value="{{ detail.mobile }}" is-link readonly input-class="input" placeholder="请输入" border="{{ false }}" input-align="right" />
|
||||
</view>
|
||||
<view class="rowView">
|
||||
<view class="label must">访客姓名</view>
|
||||
<van-field model:value="{{ value }}" input-class="input" placeholder="请输入" border="{{ false }}" input-align="right" />
|
||||
<van-field model:value="{{ detail.name }}" input-class="input" placeholder="请输入" border="{{ false }}" input-align="right" />
|
||||
</view>
|
||||
<view class="rowView">
|
||||
<view class="label must">手机号码</view>
|
||||
<van-field model:value="{{ value }}" input-class="input" placeholder="请输入" border="{{ false }}" input-align="right" />
|
||||
<van-field model:value="{{ detail.phone }}" input-class="input" placeholder="请输入" border="{{ false }}" input-align="right" />
|
||||
</view>
|
||||
<view class="rowView">
|
||||
<view class="label must">身份证类型</view>
|
||||
<van-field model:value="{{ value}}" input-class="input" is-link readonly placeholder="请选择" arrow-direction="down" input-align="right" bind:tap="getCardTypeHandle" />
|
||||
<van-field model:value="{{ detail.cardType }}" input-class="input" is-link readonly placeholder="请选择" arrow-direction="down" input-align="right" bind:tap="showIdcardType" />
|
||||
</view>
|
||||
<view class="rowView">
|
||||
<view class="label must">身份证号</view>
|
||||
<van-field model:value="{{ value }}" input-class="input" placeholder="请输入" border="{{ false }}" input-align="right" />
|
||||
<van-field model:value="{{ detail.cardNo }}" input-class="input" placeholder="请输入" border="{{ false }}" input-align="right" />
|
||||
</view>
|
||||
<view class="rowView">
|
||||
<view class="rowView" bind:tap="showVisitTime">
|
||||
<view class="label must">到访时间</view>
|
||||
<van-field model:value="{{ value }}" input-class="input" is-link readonly placeholder="请选择" border="{{ false }}" arrow-direction="down" input-align="right" bind:tap="getArriveHandle" />
|
||||
<van-field model:value="{{ detail.visitTime }}" input-class="input" is-link readonly placeholder="请选择" border="{{ false }}" arrow-direction="down" input-align="right" />
|
||||
</view>
|
||||
<view class="rowView">
|
||||
<view class="rowView" bind:tap="showLeaveTime">
|
||||
<view class="label must">离开时间</view>
|
||||
<van-field model:value="{{ value }}" input-class="input" is-link readonly placeholder="请选择" border="{{ false }}" arrow-direction="down" input-align="right" bind:tap="getLeaveHandle" />
|
||||
<van-field model:value="{{ detail.leaveTime }}" input-class="input" is-link readonly placeholder="请选择" border="{{ false }}" arrow-direction="down" input-align="right" />
|
||||
</view>
|
||||
|
||||
<view class="rowView">
|
||||
<view class="label must">来访事由</view>
|
||||
<van-field model:value="{{ value }}" input-class="input" placeholder="请输入" border="{{ false }}" input-align="right" />
|
||||
<van-field model:value="{{ detail.visitContent }}" input-class="input" placeholder="请输入" border="{{ false }}" input-align="right" />
|
||||
</view>
|
||||
|
||||
<view class="rowView">
|
||||
@ -53,13 +53,28 @@
|
||||
|
||||
<!-- 上传图片 -->
|
||||
<view class="uploadImgView">
|
||||
<van-uploader file-list="{{ fileList }}" upload-text="点击上传照片" bind:after-read="afterRead" />
|
||||
<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>
|
||||
|
||||
<!-- 提交 -->
|
||||
<view class="submitBtnView" bind:click="submitFormFn">提交</view>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
<!-- 消息通知 -->
|
||||
<van-notify id="van-notify" />
|
||||
<van-notify id="van-notify" />
|
||||
|
||||
<!-- 选择-身份证类型 -->
|
||||
<van-action-sheet description="请选择身份证类型" close-on-click-overlay="{{true}}" show="{{ idcardTypeShow }}" actions="{{ idcardTypeList }}" bind:select="selectIdcardType" bind:close="closeIdcardType" />
|
||||
|
||||
<!-- 选择-到访时间 -->
|
||||
<van-popup show="{{ visitTimeShow }}" position="bottom" custom-style="height: 50vh;" bind:close="closeVisitTime">
|
||||
<van-datetime-picker type="datetime" value="{{ visitTimeDate }}" min-date="{{ visitTimeMinDate }}" bind:confirm="confirmVisitTime" bind:cancel="closeVisitTime" />
|
||||
</van-popup>
|
||||
|
||||
<!-- 选择-离开时间 -->
|
||||
<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-popup>
|
Loading…
x
Reference in New Issue
Block a user