12 changed files with 4975 additions and 443 deletions
-
35src/api/qc/qc.js
-
144src/views/modules/qc/FAIResultEntry.vue
-
144src/views/modules/qc/FQCResultEntry.vue
-
144src/views/modules/qc/IPQCResultEntry.vue
-
121src/views/modules/qc/IQCResultEntry.vue
-
3529src/views/modules/qc/OQCResultEntry.vue
-
2src/views/modules/qc/PQCResultEntry.vue
-
107src/views/modules/qc/SQCResultEntry.vue
-
2src/views/modules/qc/com_qc_itemImage_upload_file.vue
-
126src/views/modules/qc/patrol_config_upload.vue
-
8src/views/modules/qc/qcItem.vue
-
1056src/views/modules/qc/qcPartAttribute.vue
3529
src/views/modules/qc/OQCResultEntry.vue
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,126 @@ |
|||
<template> |
|||
<div class="customer-css"> |
|||
<el-dialog title="巡检配置导入" :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-button type="primary" @click="downloadFile()">下载文件模板</el-button> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<el-upload class="customer-upload" drag action="javascript:void(0);" ref="uploadFile" :limit="1" accept=".xlsx,.xls" |
|||
:before-upload="beforeUploadHandle" :on-change="onChange" :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-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 { |
|||
patrolConfigUpload, |
|||
queryFileId |
|||
} from '@/api/qc/qc.js' |
|||
import { downLoadObjectFile } from '@/api/eam/eam_object_list.js' |
|||
|
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
fileList: [], |
|||
pageData: { |
|||
site: '', |
|||
buNo: '', |
|||
partNo: '' |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
init (currentRow) { |
|||
this.pageData = JSON.parse(JSON.stringify(currentRow)) |
|||
this.visible = true |
|||
}, |
|||
beforeUploadHandle (file) { |
|||
let extName = file[0].name.substring(file[0].name.lastIndexOf('.')).toLowerCase() |
|||
if (!(extName === '.xlsx' || extName === '.xls')) { |
|||
this.$message.error('数据导入失败,请选择正确的xlsx模板文件') |
|||
return false |
|||
} |
|||
}, |
|||
onChange (file) { |
|||
this.fileList.push(file) |
|||
}, |
|||
closeDialog () { |
|||
this.fileList = [] |
|||
this.visible = false |
|||
}, |
|||
saveUploadFile () { |
|||
if (this.fileList == null || this.fileList.length === 0) { |
|||
this.$message.error('请先上传文件!') |
|||
return false |
|||
} |
|||
const formData = new FormData() |
|||
formData.append('file', this.fileList[0].raw) |
|||
formData.append('site', this.pageData.site) |
|||
formData.append('buNo', this.pageData.buNo) |
|||
formData.append('partNo', this.pageData.partNo) |
|||
patrolConfigUpload(formData).then(({ data }) => { |
|||
if (data.code === 0) { |
|||
this.$message.success(data.msg) |
|||
this.$refs.uploadFile.clearFiles() |
|||
this.fileList = [] |
|||
this.visible = false |
|||
this.$emit('refreshPatrolConfig') |
|||
} else { |
|||
let message = (data.msg || '').split(';') |
|||
this.$alert(message[0] + '<br/>' + (message[1] || ''), '导入失败', { |
|||
confirmButtonText: '确定', |
|||
dangerouslyUseHTMLString: true |
|||
}) |
|||
} |
|||
}).catch(() => { |
|||
this.$message.error('导入失败,请检查文件格式和内容') |
|||
}) |
|||
}, |
|||
async downloadFile () { |
|||
let file = { |
|||
id: 0, |
|||
fileName: '' |
|||
} |
|||
let tempData = { |
|||
orderRef1: 'qc', |
|||
orderRef2: 'patrolConfigUpload' |
|||
} |
|||
await queryFileId(tempData).then(({ data }) => { |
|||
if (data && data.code === 0) { |
|||
file.id = data.data.id |
|||
file.fileName = data.data.fileName |
|||
} else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
await downLoadObjectFile(file).then(({ data }) => { |
|||
const blob = new Blob([data], { type: 'application/octet-stream' }) |
|||
const fileName = file.fileName |
|||
const linkNode = document.createElement('a') |
|||
linkNode.download = fileName |
|||
linkNode.style.display = 'none' |
|||
linkNode.href = URL.createObjectURL(blob) |
|||
document.body.appendChild(linkNode) |
|||
linkNode.click() |
|||
URL.revokeObjectURL(linkNode.href) |
|||
document.body.removeChild(linkNode) |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped lang="scss"> |
|||
</style> |
|||
1056
src/views/modules/qc/qcPartAttribute.vue
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue