2f4b56b8 by xiaomiao

Merge branch 'dev' of http://yun.pashanhoo.com:9090/bdc/bdcdj-web into dev

2 parents 83213799 72d18867
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-07-31 15:43:30
* @LastEditTime: 2023-08-07 14:43:46
-->
<template>
<div class="rlPopup">
......@@ -25,7 +25,7 @@
<el-button type="primary" @click="clickImage" v-if="previewImg.imgList.length>0">(放大) 显示(缩小)</el-button>
<el-upload class="fileUpdate" ref="upload" :key="key" action="" :show-file-list="false" :multiple="true" :auto-upload="false"
:on-change="handleChange"
accept=".JPG, .PNG, .JPEG,.jpg, .png, .jpeg" :before-upload="beforeUpload">
accept=".JPG, .PNG, .JPEG,.jpg, .png, .jpeg">
<el-button icon="el-icon-upload" type="primary" v-if="ableOperation">上传</el-button>
</el-upload>
<el-button type="primary" icon="el-icon-delete-solid" @click="handleDelete"
......@@ -225,28 +225,12 @@
this.showViewer = true
},
/**
* @description: 上传
* @param {*} file
* @author: renchao
*/
beforeUpload (file) {
const isLt5M = file.size / 1024 / 1024 < 5;
if (!isLt5M) {
this.$message.error('上传图片大小不能超过 5MB!');
return false;
}
// 所有条件满足时返回 true
return true;
},
/**
* @description: handleChange
* @param {*} file
* @param {*} files
* @author: renchao
*/
async handleChange (file, fileList) {
if (!this.beforeUpload(file)) return
let length = fileList.length;
this.maxFileLength = Math.max(length, this.maxFileLength)
var formData = new FormData();
......@@ -254,8 +238,12 @@
if (this.maxFileLength !== length) {
return
}
let num = 0
let num = 0, max = 0;
const isLt5M = file.size / 1024 / 1024 < 5;
fileList.forEach(item => {
if (!isLt5M) {
max++
}
if (!['image/jpeg', 'image/png', 'image/jpg', 'image/gif'].includes(item.raw.type)) {
num++
} else {
......@@ -268,6 +256,11 @@
this.key++
return;
}
if (max >= 1) {
this.$message.error('上传图片大小不能超过 5MB!');
this.key++
return;
}
formData.append("bsmSj", this.previewImg.bsmSj);
formData.append("bsmSlsq", this.previewImg.bsmSlsq);
uploadBatch(formData).then((res) => {
......
......@@ -9,7 +9,7 @@
<i class="el-icon-question invalid-icon"></i>
<div class="invalid-body">您是否确定终止该业务办理?</div>
</div>
<div class="invalid-reson">终止原因:</div>
<div class="invalid-reson">退件原因:</div>
<el-input
v-model="stopMessage"
placeholder="请输入终止原因"
......