4 changed files with 1945 additions and 628 deletions
-
27src/api/qc/qc.js
-
1055src/views/modules/qc/FAIResultEntry.vue
-
1356src/views/modules/qc/IPQCResultEntry.vue
-
135src/views/modules/qc/qc_FAI_upload_file.vue
1055
src/views/modules/qc/FAIResultEntry.vue
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1356
src/views/modules/qc/IPQCResultEntry.vue
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,135 @@ |
|||
<template> |
|||
<div class="customer-css"> |
|||
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="390px" style="height: 520px;" class="customer-dialog"> |
|||
<el-form :inline="true" label-position="top" label-width="80px"> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item class="customer-item" label="检验单号:" > |
|||
<el-input v-model="pageData.inspectionNo" style="width: 120px;" disabled ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<el-upload class="customer-upload" drag |
|||
action="javascript:void(0);" ref="uploadFile" :limit="1" |
|||
:before-upload="beforeUploadHandle" :on-change="onChange" |
|||
accept=".jpg,.pdf,.PDF" :auto-upload="false" |
|||
style="text-align: left;"> |
|||
<i class="el-icon-upload"></i> |
|||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> |
|||
</el-upload> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="24" style="margin-bottom: 30px;"> |
|||
<el-form-item class="customer-item" label="备注:" > |
|||
<el-input type="textarea" style="width: 360px;" placeholder="请输入内容" v-model="pageData.fileRemark"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
</el-row> |
|||
</el-form> |
|||
<span slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="saveUploadFile()">保存</el-button> |
|||
<el-button type="primary" @click="closeDialog">关闭</el-button> |
|||
</span> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
uploadEamObjectFile, |
|||
} from '@/api/eam/com_eam_object_upload_file.js'; |
|||
|
|||
/* 引入组件 */ |
|||
var functionId = 'C10000002'; |
|||
|
|||
export default { |
|||
data() { |
|||
return { |
|||
titleCon: 'FAI文件上传', |
|||
folder: 'qcFAI', |
|||
visible: false, |
|||
userId: this.$store.state.user.name, |
|||
fileList: [], |
|||
pageData: { |
|||
site: this.$store.state.user.site, |
|||
username: this.$store.state.user.name, |
|||
inspectionNo: '', |
|||
fileRemark: '', |
|||
}, |
|||
dataListLoading: false, |
|||
} |
|||
}, |
|||
methods: { |
|||
//初始化组件的参数 |
|||
init(currentRow) { |
|||
//初始化参数 |
|||
this.pageData = JSON.parse(JSON.stringify(currentRow)); |
|||
//打开页面 |
|||
this.visible = true; |
|||
//重置人员信息 |
|||
this.pageData.username = this.userId; |
|||
}, |
|||
// 上传之前 |
|||
beforeUploadHandle(file) { |
|||
// if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif' && file.type !== 'application/pdf') { |
|||
// this.$message.error('只支持图片和PDF文档!') |
|||
// return false |
|||
// } |
|||
// this.num++ |
|||
}, |
|||
/*选择上传文件时*/ |
|||
onChange(file){ |
|||
this.fileList.push(file); |
|||
}, |
|||
/*关闭modal*/ |
|||
closeDialog(){ |
|||
//刷新报工的页面 |
|||
// this.$emit('refreshPageTables'); |
|||
//关闭当前的页面 |
|||
this.visible = false; |
|||
}, |
|||
/*保修当前的数据*/ |
|||
saveUploadFile(){ |
|||
let remark = this.pageData.fileRemark; |
|||
if(null === remark || '' === remark){ |
|||
this.$message.error("请输入文件备注!"); |
|||
return false; |
|||
} |
|||
/*判断文件是否上传*/ |
|||
if(null == this.fileList || 0 == this.fileList.length){ |
|||
this.$message.error("请先上传文件!"); |
|||
return false; |
|||
} |
|||
const formData = new FormData(); |
|||
//片接文件 |
|||
formData.append("file", this.fileList[0].raw); |
|||
formData.append("folder", this.folder); |
|||
formData.append("site", this.pageData.site); |
|||
formData.append("objectID", this.pageData.inspectionNo); |
|||
formData.append("remark", remark); |
|||
uploadEamObjectFile(formData).then(({data}) => { |
|||
if (data.code === 0) { |
|||
this.$message.success(data.msg); |
|||
//清空文件上传记录 |
|||
this.$refs.uploadFile.clearFiles(); |
|||
this.pageData.fileRemark = ''; |
|||
}else { |
|||
this.$message.warning(data.msg); |
|||
} |
|||
}) |
|||
} |
|||
|
|||
}, |
|||
created() { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
<style scoped lang="scss"> |
|||
|
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue