页面修改
This commit is contained in:
parent
50dbd27f51
commit
c74e635212
@ -26,5 +26,6 @@ const config = {
|
||||
// 设置后台接口服务的基础地址
|
||||
// config.baseUrl = 'http://tc.cqsznc.com:7080';
|
||||
// config.baseUrl = 'http://192.168.71.139:8080';
|
||||
config.baseUrl = '/api';
|
||||
config.baseUrl = 'http://183.230.235.66:11010/api';
|
||||
// config.baseUrl = '/api';
|
||||
export default config;
|
@ -9,6 +9,9 @@ const install = (Vue, vm) => {
|
||||
|
||||
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
|
||||
vm.$u.api = {
|
||||
//获取单位列表
|
||||
getUnits:(params = {}) => vm.$u.get(config.adminPath+'/property/enum-fetcher/enum-values/getUnit',params),
|
||||
|
||||
codesub: (params = {}) => vm.$u.get(config.adminPath+'/property/visitorManagement/useqr', params),
|
||||
uploadimg: (params = {}) => vm.$u.post(config.adminPath+'/resource/oss/upload', params),
|
||||
fksub: (params = {}) => vm.$u.post(config.adminPath+'/property/visitorManagement/add', params),
|
||||
|
@ -64,8 +64,17 @@
|
||||
|
||||
<view class="form-item">
|
||||
<text class="label">被访单位</text>
|
||||
<view class="input-wrapper">
|
||||
<input type="text" placeholder="请输入被访单位名称" v-model="formData.interviewedUnit"/>
|
||||
<view class="select-wrapper" :class="{active: showUnitDialog}" @click.stop="showUnitDialog = true">
|
||||
<text>{{ formData.interviewedUnit || '请选择被访单位' }}</text>
|
||||
<image class="filter-img" src="/static/ic_down_arrow_g.png"/>
|
||||
<view v-if="showUnitDialog" class="dropdown">
|
||||
<view class="dropdown-list">
|
||||
<view v-for="(item, index) in unitList" :key="index" class="dropdown-item"
|
||||
@click.stop="selectInterviewedUnit(item)">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -138,6 +147,11 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="face-tip-wrapper">
|
||||
<text class="face-tip">请确保无遮挡、光线明亮、正脸拍摄</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="form-item">
|
||||
<text class="label">预约状态</text>
|
||||
@ -174,7 +188,7 @@ export default {
|
||||
visitorPhone: '15555555555',
|
||||
visitingReason: '',
|
||||
interviewedPerson: '1',
|
||||
interviewedUnit: '1',
|
||||
interviewedUnit: '',
|
||||
interviewedPhone: '15555555555',
|
||||
visitingBeginDate: date,
|
||||
visitingBeginTime: time,
|
||||
@ -194,7 +208,9 @@ export default {
|
||||
3: '已完成'
|
||||
},
|
||||
typeList: ['业务洽谈', '会议参与', '面试应聘', '技术支持', '办事咨询', '调研考察'],
|
||||
showTypeDialog: false
|
||||
unitList: [],
|
||||
showTypeDialog: false,
|
||||
showUnitDialog: false
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
@ -218,6 +234,9 @@ export default {
|
||||
// #ifdef APP-PLUS
|
||||
plus.screen.lockOrientation('default');
|
||||
// #endif
|
||||
|
||||
// 获取单位列表
|
||||
this.getUnits();
|
||||
},
|
||||
onReady() {
|
||||
// #ifdef APP-PLUS
|
||||
@ -226,20 +245,36 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
document.addEventListener('click', this.handleClickOutside);
|
||||
// 调用getUnits方法获取被访单位数据
|
||||
this.getUnits();
|
||||
},
|
||||
beforeDestroy() {
|
||||
document.removeEventListener('click', this.handleClickOutside);
|
||||
},
|
||||
methods: {
|
||||
async getUnits() {
|
||||
let res = await this.$u.api.getUnits();
|
||||
if (res.code == '200') {
|
||||
this.unitList = res.data;
|
||||
}
|
||||
},
|
||||
// 添加选择拜访事由方法
|
||||
selectVisitingReason(reason) {
|
||||
this.formData.visitingReason = reason;
|
||||
this.showTypeDialog = false;
|
||||
},
|
||||
|
||||
// 添加选择被访单位方法
|
||||
selectInterviewedUnit(unit) {
|
||||
this.formData.interviewedUnit = unit.name;
|
||||
this.formData.interviewedUnitId = unit.value;
|
||||
this.showUnitDialog = false;
|
||||
},
|
||||
|
||||
// 点击外部关闭下拉菜单
|
||||
handleClickOutside() {
|
||||
this.showTypeDialog = false;
|
||||
this.showUnitDialog = false;
|
||||
},
|
||||
|
||||
// 处理日期时间选择
|
||||
@ -277,6 +312,20 @@ export default {
|
||||
success: (res) => {
|
||||
// console.log(res.tempFilePaths[0])
|
||||
this.formData.facePictures = res.tempFilePaths[0];
|
||||
// 压缩图片
|
||||
uni.compressImage({
|
||||
src: this.formData.facePictures, // 原图路径
|
||||
quality: 70, // 压缩质量 0-100
|
||||
success: (res) => {
|
||||
this.formData.facePictures = res.tempFilePath
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.showToast({
|
||||
title: '拍照失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.showToast({
|
||||
@ -297,6 +346,7 @@ export default {
|
||||
visitorPhone,
|
||||
visitingReason,
|
||||
interviewedPerson,
|
||||
interviewedUnit,
|
||||
bookingParkingSpace,
|
||||
licensePlate,
|
||||
facePictures,
|
||||
@ -316,6 +366,11 @@ export default {
|
||||
return '请输入证件号';
|
||||
}
|
||||
|
||||
// 验证被访单位
|
||||
if (!interviewedUnit) {
|
||||
return '请选择被访单位';
|
||||
}
|
||||
|
||||
// 验证电话
|
||||
if (!visitorPhone) {
|
||||
return '请输入联系电话';
|
||||
@ -428,6 +483,7 @@ export default {
|
||||
const ossId = parsedData.data.ossId;
|
||||
console.log("ossId",ossId)
|
||||
submitData.facePictures=ossId;
|
||||
submitData.interviewedUnitId = this.formData.interviewedUnitId;
|
||||
console.log(submitData)
|
||||
this.$u.api.fksub(submitData).then(res => {
|
||||
console.log(res)
|
||||
@ -520,6 +576,7 @@ export default {
|
||||
visitingReason: '',
|
||||
interviewedPerson: '',
|
||||
interviewedUnit: '',
|
||||
interviewedUnitId: '',
|
||||
interviewedPhone: '',
|
||||
visitingBeginDate: date,
|
||||
visitingBeginTime: time,
|
||||
@ -780,4 +837,13 @@ export default {
|
||||
.dropdown-item:hover {
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
.face-tip-wrapper {
|
||||
flex: 1;
|
||||
margin-left: 108px; /* 与label宽度和margin一致 */
|
||||
}
|
||||
|
||||
.face-tip {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user