|
@@ -594,13 +594,10 @@ export default {
|
|
|
if (valid) {
|
|
|
this.buttonLoading = true;
|
|
|
if (this.form.id != null) {
|
|
|
- this.form.pics = []
|
|
|
- for (let i = 0; i < this.$refs.obsFileUpload.fileList.length; i++) {
|
|
|
- console.log(this.$refs.obsFileUpload.fileList[i])
|
|
|
- this.form.pics.push({
|
|
|
- 'fileName': this.$refs.obsFileUpload.fileList[i].name,
|
|
|
- 'picUrl': this.$refs.obsFileUpload.fileList[i].url
|
|
|
- })
|
|
|
+ this.form.files = this.$refs.obsFileUpload.fileList;
|
|
|
+ if (this.form.files.length === 0) {
|
|
|
+ this.$message.warning('必须上传附件!')
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
updateEngineeringDangerous(this.form).then(response => {
|
|
@@ -611,13 +608,10 @@ export default {
|
|
|
this.buttonLoading = false;
|
|
|
});
|
|
|
} else {
|
|
|
- this.form.pics = []
|
|
|
- for (let i = 0; i < this.$refs.obsFileUpload.fileList.length; i++) {
|
|
|
- console.log(this.$refs.obsFileUpload.fileList[i])
|
|
|
- this.form.pics.push({
|
|
|
- 'fileName': this.$refs.obsFileUpload.fileList[i].name,
|
|
|
- 'picUrl': this.$refs.obsFileUpload.fileList[i].url
|
|
|
- })
|
|
|
+ this.form.files = this.$refs.obsFileUpload.fileList;
|
|
|
+ if (this.form.files.length === 0) {
|
|
|
+ this.$message.warning('必须上传附件!')
|
|
|
+ return
|
|
|
}
|
|
|
addEngineeringDangerous(this.form).then(response => {
|
|
|
this.$modal.msgSuccess("新增成功");
|