Browse Source

修改上传文件检验

develop
caoyizhong 3 years ago
parent
commit
1a4d9918c8
  1. 26
      src/views/report/index.vue
  2. 2
      vue.config.js

26
src/views/report/index.vue

@ -122,8 +122,8 @@
</div>
</div>
</div>
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%">
<el-form :model="editForm" :disabled="dialogReadOnly" label-width="150px">
<el-dialog :title="title" :visible.sync="dialogVisible" width="35%">
<el-form :model="editForm" :disabled="dialogReadOnly" label-width="200px">
<el-form-item label="报告名称:">
<el-input
v-model="editForm.reportName"
@ -336,7 +336,10 @@ export default {
//
newItem() {
this.title = "新增报告";
this.saveFlag = true;
if(this.$refs.myUpload !== undefined){
this.$refs.myUpload.clearFiles();
}
const mainImg = this.$refs.myUpload;
if (mainImg && mainImg.length) {
mainImg.forEach(item => {
@ -368,16 +371,23 @@ export default {
//
save() {
if (this.editForm.id) {
// console.log(this.editForm);
updateData(this.editForm).then((res) => {
this.dialogVisible = false;
this.onSubmit();
});
} else {
let param = Object.assign({ statusCd: 1000 }, this.editForm);
addData(param).then((res) => {
this.dialogVisible = false;
this.onSubmit();
});
// console.log(this.editForm);
if(this.editForm.filePath !== undefined){
let param = Object.assign({ statusCd: 1000 }, this.editForm);
addData(param).then((res) => {
this.dialogVisible = false;
this.onSubmit();
});
}else{
this.$message.warning("请上传文件")
}
}
},
//

2
vue.config.js

@ -6,7 +6,7 @@
function resolve(dir) {
return path.join(__dirname, dir)
}
// const url = 'http://192.168.100.11:9002'; //裴
// const url = 'http://192.168.2.12:9002'; //裴
// const url = 'https://yoursairdata.com/api';//生产
// const url = 'http://192.168.100.11:9002';
// const url = 'http://192.168.23.64:9002';

Loading…
Cancel
Save