diff --git a/src/views/modules/eam/com_eam_knowledge_base_upload_file.vue b/src/views/modules/eam/com_eam_knowledge_base_upload_file.vue index af7a212..9809278 100644 --- a/src/views/modules/eam/com_eam_knowledge_base_upload_file.vue +++ b/src/views/modules/eam/com_eam_knowledge_base_upload_file.vue @@ -22,7 +22,7 @@ + :before-upload="beforeUploadHandle" :on-change="onChange" accept="*" :auto-upload="false" style="text-align: center;">
将文件拖到此处,或点击上传
@@ -31,7 +31,7 @@ - + @@ -39,7 +39,7 @@
- 保存 + 保存 关闭 @@ -52,7 +52,7 @@ import { } from '@/api/eam/eam_object_list.js'; /* 引入组件 */ -var functionId = 'C10000002'; +var functionId = 'C10000002' export default { data() { @@ -63,31 +63,33 @@ export default { userId: this.$store.state.user.name, fileList: [], pageData: { - site: this.$store.state.user.site, + site: '', + buNo: '', username: this.$store.state.user.name, num: '', objectId: '', objectName: '', defectId: '', defectDesc: '', - fileRemark: '', }, + fileRemark: '', dataListLoading: false, } }, methods: { - //初始化组件的参数 + // 初始化组件的参数 init(currentRow) { - //初始化参数 - this.pageData = JSON.parse(JSON.stringify(currentRow)); - //打开页面 - this.visible = true; - //重置人员信息 - this.pageData.username = this.userId; + // 初始化参数 + this.pageData = JSON.parse(JSON.stringify(currentRow)) + this.fileRemark = '' + // 打开页面 + this.visible = true + // 重置人员信息 + this.pageData.username = this.userId }, // 上传之前 - beforeUploadHandle(file) { + 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 @@ -95,57 +97,53 @@ export default { // this.num++ }, - /*选择上传文件时*/ - onChange(file){ - this.fileList.push(file); + /* 选择上传文件时 */ + onChange (file) { + this.fileList.push(file) }, - /*关闭modal*/ - closeDialog(){ - this.fileList = []; - //刷新报工的页面 - this.$emit('refreshPageTables'); - //关闭当前的页面 - this.visible = false; + /* 关闭modal */ + closeDialog () { + this.fileList = [] + // 刷新报工的页面 + this.$emit('refreshPageTables') + // 关闭当前的页面 + this.visible = false }, - /*保修当前的数据*/ - saveUploadFile(){ - let remark = this.pageData.fileRemark; - if(null == remark || '' == remark){ + /* 保修当前的数据 */ + saveUploadFile () { + let remark = this.fileRemark + if (remark == null || remark === '') { remark = '' } - /*判断文件是否上传*/ - if(null == this.fileList || 0 == this.fileList.length){ - this.$message.error("请先上传文件!"); - return false; + /* 判断文件是否上传 */ + if (null == this.fileList || 0 === this.fileList.length) { + this.$message.error("请先上传文件!") + return false } - const formData = new FormData(); + const formData = new FormData() //片接文件 - formData.append("file", this.fileList[0].raw); - formData.append("folder", this.folder); - formData.append("site", this.pageData.site); - formData.append("num", this.pageData.num); - formData.append("remark", remark); + formData.append("file", this.fileList[0].raw) + formData.append("folder", this.folder) + formData.append("orderRef1", this.pageData.site) + formData.append("orderRef2", this.pageData.num) + formData.append("orderRef3", remark) + formData.append("orderRef4", this.pageData.buNo) knowledgeBaseUpload(formData).then(({data}) => { if (data.code === 0) { - this.$message.success(data.msg); + this.$message.success(data.msg) //清空文件上传记录 - this.$refs.uploadFile.clearFiles(); - this.pageData.fileRemark = ''; - this.fileList = []; + this.$refs.uploadFile.clearFiles() + this.fileRemark = '' + this.fileList = [] }else { - this.$message.warning(data.msg); + this.$message.warning(data.msg) } }) } }, - created() { - - } } - - + diff --git a/src/views/modules/eam/eam_knowledge_base.vue b/src/views/modules/eam/eam_knowledge_base.vue index b9479a4..f392541 100644 --- a/src/views/modules/eam/eam_knowledge_base.vue +++ b/src/views/modules/eam/eam_knowledge_base.vue @@ -7,6 +7,16 @@ + + + + + + @@ -67,13 +77,11 @@ @current-change="changeCurrentRow" @selection-change="selectionChangeHandle" border - v-loading="dataListLoading" style="width: 100%;"> - + + + + + + {{ i.sitename }} + + {{ i.buDesc }} + + + + + + + + + + + + + + + 设备编码 - - + + - - - - - - - - - - - - 故障编码 - - - - - - - - - - - - - - + + - + @@ -171,7 +181,7 @@ resize='none' maxlength="300" show-word-limit - style="width: 284px;height: 60px"> + style="width: 662px;height: 60px"> @@ -188,14 +198,13 @@ - 上传文件 + 上传文件 - + @@ -236,7 +245,6 @@