master
xy 2 years ago
parent 8840e8c2ff
commit ca7564be2f

@ -204,13 +204,13 @@ export default {
Authorization: "Bearer " + getToken(), Authorization: "Bearer " + getToken(),
}, },
accept: accept:
".rar,.zip,.doc,.docx,.pdf,.jpg,.png,.gif,.mp4,.xls,.xlsx", ".rar,.zip,.doc,.docx,.pdf,.jpg,.png,.gif,.xls,.xlsx",
"on-success": (response, file, fileList) => { "on-success": (response, file, fileList) => {
this.fileList = fileList; this.fileList = fileList;
form.file = response?.id; form.file = response?.id;
}, },
"before-upload": (file) => { "before-upload": (file) => {
if (file.size / 1000 > 5 * 1024) { if (file.size / 1000 > 50 * 1024) {
this.$message({ this.$message({
type: "warning", type: "warning",
message: "上传文件大小超过5M", message: "上传文件大小超过5M",
@ -241,7 +241,7 @@ export default {
class: "el-upload__tip", class: "el-upload__tip",
slot: "tip", slot: "tip",
}, },
"只能上传jpg/png文件且不超过5Mb" "支持文件格式:.docx.xlsx.pdf.png.jpg\n单个文件不能超过50M"
), ),
] ]
), ),
@ -269,6 +269,13 @@ export default {
cancelButtonText: "取消", cancelButtonText: "取消",
beforeClose: (action, instance, done) => { beforeClose: (action, instance, done) => {
if (action === "confirm") { if (action === "confirm") {
if (!form.file) {
this.$message({
type: 'warning',
message: '请上传附件'
})
return
}
instance.confirmButtonLoading = true; instance.confirmButtonLoading = true;
instance.confirmButtonText = "保存中..."; instance.confirmButtonText = "保存中...";
this.detail.attachment_list = [ this.detail.attachment_list = [

Loading…
Cancel
Save