|
|
|
@ -28,8 +28,8 @@ |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-upload class="customer-upload" drag |
|
|
|
action="javascript:void(0);" ref="uploadFile" :limit="1" |
|
|
|
<el-upload class="customer-upload" drag multiple :file-list="fileList" |
|
|
|
action="javascript:void(0);" ref="uploadFile" |
|
|
|
:before-upload="beforeUploadHandle" :on-change="onChange" |
|
|
|
accept=".jpg,.jpeg,.png,.gif" :auto-upload="false" |
|
|
|
style="text-align: left;"> |
|
|
|
@ -40,7 +40,7 @@ |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="saveUploadFile()">保存</el-button> |
|
|
|
<el-button type="primary" @click="saveUploadFile">保存</el-button> |
|
|
|
<el-button type="primary" @click="closeDialog">关闭</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
@ -108,14 +108,18 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
// 选择上传文件时 |
|
|
|
onChange (file) { |
|
|
|
this.fileList.push(file) |
|
|
|
onChange (file, fileList) { |
|
|
|
console.log(fileList) |
|
|
|
this.fileList = fileList |
|
|
|
//this.fileList.push(file) |
|
|
|
}, |
|
|
|
// 关闭modal |
|
|
|
closeDialog () { |
|
|
|
this.fileList = [] |
|
|
|
// 清空文件上传记录 |
|
|
|
this.$refs.uploadFile.clearFiles() |
|
|
|
// 刷新报工的页面 |
|
|
|
this.$emit('refreshPageTables2') |
|
|
|
//this.$emit('refreshPageTables2') |
|
|
|
// 关闭当前的页面 |
|
|
|
this.visible = false |
|
|
|
}, |
|
|
|
@ -129,7 +133,10 @@ export default { |
|
|
|
} |
|
|
|
const formData = new FormData() |
|
|
|
// 片接文件 |
|
|
|
formData.append("file", this.fileList[0].raw) |
|
|
|
for (let i = 0; i < this.fileList.length; i++) { |
|
|
|
formData.append("file",this.fileList[i].raw) |
|
|
|
} |
|
|
|
//formData.append("file", this.fileList[0].raw) |
|
|
|
formData.append("site", this.pageData.site) |
|
|
|
formData.append("folder", this.pageData.folder) |
|
|
|
formData.append("objectID", this.pageData.inspectionNo) |
|
|
|
@ -175,8 +182,10 @@ export default { |
|
|
|
**/ |
|
|
|
handleDialogClose () { |
|
|
|
this.fileList = [] |
|
|
|
// 清空文件上传记录 |
|
|
|
this.$refs.uploadFile.clearFiles() |
|
|
|
// 刷新报工的页面 |
|
|
|
this.$emit('refreshPageTables2') |
|
|
|
//this.$emit('refreshPageTables2') |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
|