Merge branch 'main' into dev-sy

This commit is contained in:
BianLzhaoMin 2024-12-11 13:08:36 +08:00
commit 9c3ae0bc5a
2 changed files with 94 additions and 21 deletions

View File

@ -172,7 +172,7 @@
ref="addAndEditFormRef"
label-position="right"
:model="addAndEditForm"
:rules="htRules"
:rules="addAndEditFormRules"
>
<el-row :gutter="20">
<el-col :span="12">
@ -187,28 +187,56 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" >
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="1" style="margin-bottom: 0" class="upload-tip">
<el-button size="small" type="primary">点击上传</el-button>
<el-upload
class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview"
:on-remove="handleRemove"
:before-remove="beforeRemove"
multiple
:limit="1"
:on-exceed="handleExceed"
:file-list="fileList">
<div class="upload-tip" >支持格式.word.单个文件大小不能超过2M</div>
</el-upload>
支持格式word.单个文件大小不能超过2M最多可上传1张
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" >
<el-col :span="24">
<el-form-item label="附件" prop="fileInfoList">
<div style="flex: 1">
<UploadComponentNew
:maxSize="10"
:max-limit="1"
width="100%"
height="100%"
:multiple="true"
:autoUpload="true"
:minLimit="addAndEditForm.fileInfoList.length"
:actionUrl="uploadUrl"
listType="text"
:justifyContent="`flex-start`"
@onFileChange="onFileChange"
:acceptTypeList="['.doc','.docx' ]"
>
<template v-slot:default>
<!-- <el-icon size="48" color="#aaa"><Plus /></el-icon> -->
<el-button
:icon="UploadFilled"
type="primary"
class="primary-lease"
>上传文件</el-button
>
</template>
</UploadComponentNew>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" class="primary-lease" @click="onCancel"
>取消</el-button
>
<el-button class="primary-lease" type="primary" @click="onSubmit()">
提交
</el-button>
</div>
</template>
</el-dialog>
</template>
@ -230,12 +258,14 @@ const store2 = mainStore()
const isViewForm = ref(false)
const isDisabled = ref(false)
const uploadUrl = import.meta.env.VITE_API_URL + '/file/upload'
import {
getEquipmentTypeApi, //
getCompanyListApi, //
getEquipmentListApi, //
} from 'http/api/usercenter/goodsmang'
import { InfoFilled, UploadFilled } from '@element-plus/icons-vue'
/* 查询参数 */
const queryParams: any = ref({
deviceName: '',
@ -248,7 +278,8 @@ const queryParams: any = ref({
const addAndEditForm = reactive<any>({
htName: '',
mainFileList: [],
fileInfoList: [],
fileInfoTempList: [],
})
//
@ -295,6 +326,48 @@ const onDialogClose = () => {
// addAndEditFormRef.value.resetFields()
}
//
const onFileChange = (fileList: any) => {
addAndEditForm.value.fileInfoTempList = []
const fileListTemp = fileList.map((e: any) => {
return {
fileName: e.name,
fileUrl: e.url,
}
})
addAndEditForm.value.fileInfoTempList.push(...fileListTemp)
}
const addAndEditFormRules = reactive({
htName: [{ required: true, message: '请输入合同名称', trigger: 'blur' }],
fileInfoList: [{ required: true, message: '请上传合同附件', trigger: 'blur' }],
})
//
const onSubmit = () => {
addAndEditForm.value.fileInfoList = addAndEditForm.value.fileInfoTempList
addAndEditFormRef.value.validate(async (valid: any) => {
if (valid) {
// const SEN_API = settleinTitle.value === '' ? editSafeBookApi : addSafeBookApi
// const res: any = await SEN_API(addAndEditForm.value)
// if (res.code === 200) {
// ElMessage({
// type: 'success',
// message: '',
// })
// dialogVisibleSettlein.value = false
// // getLeaseListData()
// }
}
})
}
//
const onCancel = () => {
dialogVisibleSettlein.value = false
}
onMounted(() => {
//
getTypeTreeData()

View File

@ -1481,8 +1481,8 @@ const options = ref<any>([
:span="6"
style="
display: flex;
justify-content: left;
align-items: left;
justify-content: center;
align-items: center;
"
>
<div style="">