家长附件上传
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="app-container">
|
<view class="app-container">
|
||||||
<!-- 顶部导航栏 -->
|
<!-- 顶部导航栏 -->
|
||||||
<!-- <view class="nav-bar" @click="goBack">
|
<!-- <view class="nav-bar" @click="goBack">
|
||||||
<uni-icons type="back" size="20" color="#fff"></uni-icons>
|
<uni-icons type="back" size="20" color="#fff"></uni-icons>
|
||||||
<text class="nav-title">外宿申请表单</text>
|
<text class="nav-title">外宿申请表单</text>
|
||||||
</view> -->
|
</view> -->
|
||||||
@@ -24,7 +24,8 @@
|
|||||||
<text class="tab-text">地址信息</text>
|
<text class="tab-text">地址信息</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="tab-item" :class="{ active: activeTab === 3 }" @click="switchTab(3)">
|
<view class="tab-item" :class="{ active: activeTab === 3 }" @click="switchTab(3)">
|
||||||
<uni-icons type="person-filled" size="16" :color="activeTab === 3 ? '#409EFF' : '#666'"></uni-icons>
|
<uni-icons type="person-filled" size="16"
|
||||||
|
:color="activeTab === 3 ? '#409EFF' : '#666'"></uni-icons>
|
||||||
<text class="tab-text">家长信息</text>
|
<text class="tab-text">家长信息</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="tab-item" :class="{ active: activeTab === 4 }" @click="switchTab(4)">
|
<view class="tab-item" :class="{ active: activeTab === 4 }" @click="switchTab(4)">
|
||||||
@@ -192,10 +193,13 @@
|
|||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<label class="form-label">家长签字附件</label>
|
<label class="form-label">家长签字附件</label>
|
||||||
<button type="default" size="mini" @click="chooseParentSignFile"
|
<view class="upload-btn" @click="handleUpload">
|
||||||
class="upload-btn">选择图片</button>
|
<text class="upload-icon">+</text>
|
||||||
<image v-if="parentSignFiles.length" :src="parentSignFiles[0].url"
|
<text>上传图片</text>
|
||||||
class="signature-preview" mode="widthFix"></image>
|
</view>
|
||||||
|
<view class="upload-preview" v-if="parentSignFiles">
|
||||||
|
<image :src="parentSignFiles" mode="aspectFill" />
|
||||||
|
</view>
|
||||||
<view class="upload-tip">只能上传jpg/png文件,且不超过2M</view>
|
<view class="upload-tip">只能上传jpg/png文件,且不超过2M</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -375,6 +379,10 @@
|
|||||||
} from '@/api/system/user'
|
} from '@/api/system/user'
|
||||||
import area from '@/components/complex-picker-region/area.js'
|
import area from '@/components/complex-picker-region/area.js'
|
||||||
import config from '@/config'
|
import config from '@/config'
|
||||||
|
import {
|
||||||
|
checkPic
|
||||||
|
} from "@/utils/checkPic.js";
|
||||||
|
import uploadFile from "@/plugins/upload.js";
|
||||||
export default {
|
export default {
|
||||||
name: 'OutsideAccommodationApply',
|
name: 'OutsideAccommodationApply',
|
||||||
data() {
|
data() {
|
||||||
@@ -459,7 +467,7 @@
|
|||||||
],
|
],
|
||||||
// 文件上传相关
|
// 文件上传相关
|
||||||
affixFiles: [],
|
affixFiles: [],
|
||||||
parentSignFiles: [],
|
parentSignFiles: "",
|
||||||
reasonFileList: [],
|
reasonFileList: [],
|
||||||
// 页面状态
|
// 页面状态
|
||||||
currentId: null,
|
currentId: null,
|
||||||
@@ -860,16 +868,28 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
chooseParentSignFile() {
|
// 家长附件上传
|
||||||
|
handleUpload() {
|
||||||
uni.chooseImage({
|
uni.chooseImage({
|
||||||
count: 1,
|
count: 3,
|
||||||
sizeType: ['compressed'],
|
success: async (img) => {
|
||||||
sourceType: ['album', 'camera'],
|
let bool = await checkPic(img.tempFiles[0]);
|
||||||
success: (res) => {
|
if (bool) {
|
||||||
this.parentSignFiles = res.tempFiles;
|
uploadFile('/common/upload', img.tempFilePaths[0]).then((res) => {
|
||||||
this.form.parentSignAttachment = res.tempFilePaths[0];
|
// if (this.form.photo !== "") {
|
||||||
|
// this.form.photo = this.form.photo + "," + JSON.parse(res)
|
||||||
|
// .fileName;
|
||||||
|
// } else {
|
||||||
|
// this.form.photo = JSON.parse(res).fileName;
|
||||||
|
// }
|
||||||
|
this.parentSignFiles = img.tempFilePaths[0];
|
||||||
|
this.form.parentSignAttachment = JSON.parse(res).fileName;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
previewImage(url) {
|
previewImage(url) {
|
||||||
uni.previewImage({
|
uni.previewImage({
|
||||||
@@ -892,12 +912,12 @@
|
|||||||
this.areaText = res.data.address || '';
|
this.areaText = res.data.address || '';
|
||||||
this.parentAreaText = res.data.parentAddress || '';
|
this.parentAreaText = res.data.parentAddress || '';
|
||||||
|
|
||||||
if (this.form.parentSignAttachment) {
|
// if (this.form.parentSignAttachment) {
|
||||||
this.parentSignFiles = [{
|
// this.parentSignFiles = [{
|
||||||
name: this.form.parentSignAttachment.split('/').pop(),
|
// name: this.form.parentSignAttachment.split('/').pop(),
|
||||||
url: this.baseUrl + this.form.parentSignAttachment
|
// url: this.baseUrl + this.form.parentSignAttachment
|
||||||
}];
|
// }];
|
||||||
}
|
// }
|
||||||
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
@@ -934,7 +954,7 @@
|
|||||||
|
|
||||||
if (matchedRecord) {
|
if (matchedRecord) {
|
||||||
const baseStuYearName = matchedRecord.stuYearName ||
|
const baseStuYearName = matchedRecord.stuYearName ||
|
||||||
'';
|
'';
|
||||||
if (baseStuYearName) {
|
if (baseStuYearName) {
|
||||||
const isAllSameYear = response.data.record.every(
|
const isAllSameYear = response.data.record.every(
|
||||||
item => (item.stuYearName || '') ===
|
item => (item.stuYearName || '') ===
|
||||||
@@ -1131,7 +1151,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.affixFiles = [];
|
this.affixFiles = [];
|
||||||
this.parentSignFiles = [];
|
this.parentSignFiles = "";
|
||||||
this.reasonFileList = [];
|
this.reasonFileList = [];
|
||||||
this.areaText = '';
|
this.areaText = '';
|
||||||
this.parentAreaText = '';
|
this.parentAreaText = '';
|
||||||
@@ -1299,15 +1319,15 @@
|
|||||||
background-color: #409EFF;
|
background-color: #409EFF;
|
||||||
border-radius: 2rpx;
|
border-radius: 2rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-parent::after {
|
.card-parent::after {
|
||||||
width: 290rpx;
|
width: 290rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-area::after {
|
.card-area::after {
|
||||||
width: 200rpx;
|
width: 200rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-apply::after {
|
.card-apply::after {
|
||||||
width: 230rpx;
|
width: 230rpx;
|
||||||
}
|
}
|
||||||
@@ -1356,6 +1376,43 @@
|
|||||||
border-color: #409EFF;
|
border-color: #409EFF;
|
||||||
box-shadow: 0 0 0 4rpx rgba(64, 158, 255, 0.1);
|
box-shadow: 0 0 0 4rpx rgba(64, 158, 255, 0.1);
|
||||||
}
|
}
|
||||||
|
// 图片上传样式
|
||||||
|
.upload-btn {
|
||||||
|
width: 200rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
border: 1px dashed #ccc;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 10rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #666;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upload-icon {
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upload-tip {
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #999;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upload-preview {
|
||||||
|
width: 200rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upload-preview image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
/* 选择器样式 */
|
/* 选择器样式 */
|
||||||
.picker-input {
|
.picker-input {
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
<view class="empty-state" v-if="!loading && !hasData">
|
<view class="empty-state" v-if="!loading && !hasData">
|
||||||
<uni-icons type="empty" size="80" color="#c0c4cc"></uni-icons>
|
<uni-icons type="empty" size="80" color="#c0c4cc"></uni-icons>
|
||||||
<text class="empty-text">暂无外宿申请数据</text>
|
<text class="empty-text">暂无外宿申请数据</text>
|
||||||
<text class="empty-tip" v-if="roleGroup.includes('学生')">点击"外宿申请"按钮提交新申请</text>
|
<text class="empty-tip" v-if="roleGroup.includes('学生')">点击右下角"+号"按钮提交新申请</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 数据列表 -->
|
<!-- 数据列表 -->
|
||||||
@@ -112,6 +112,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="info-item"><text class="label">宿费交纳:</text><text
|
||||||
|
class="value">{{ getSafeValue(item, 'accommodationFee', '-') }}</text></view>
|
||||||
</view>
|
</view>
|
||||||
</uni-collapse-item>
|
</uni-collapse-item>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user