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