4 changed files with 1432 additions and 14 deletions
-
11src/api/supplier/supplierPartNewProductAudit.js
-
219src/views/demo/attachmentListUploadDemo.vue
-
24src/views/modules/supplier/supplierPartMoqPrice.vue
-
1192src/views/modules/supplier/supplierPartNewProductAudit.vue
@ -0,0 +1,11 @@ |
|||||
|
import { createAPI } from '@/utils/httpRequest.js' |
||||
|
|
||||
|
export const listNewProductAuditSupplierPart = data => createAPI('/supplier/supplierPartNewProductAudit/listSupplierPart', 'post', data) |
||||
|
export const startNewProductAudit = data => createAPI('/supplier/supplierPartNewProductAudit/startAudit', 'post', data) |
||||
|
export const restartNewProductAudit = data => createAPI('/supplier/supplierPartNewProductAudit/restartAudit', 'post', data) |
||||
|
export const listNewProductAuditRecord = data => createAPI('/supplier/supplierPartNewProductAudit/listAuditRecord', 'post', data) |
||||
|
export const submitNewProductAuditRecord = data => createAPI('/supplier/supplierPartNewProductAudit/submitAuditRecord', 'post', data) |
||||
|
export const listNewProductTestRecord = data => createAPI('/supplier/supplierPartNewProductAudit/listTestRecord', 'post', data) |
||||
|
export const saveNewProductTestRecord = data => createAPI('/supplier/supplierPartNewProductAudit/saveTestRecord', 'post', data) |
||||
|
export const saveNewProductTestRecordAttachment = data => createAPI('/supplier/supplierPartNewProductAudit/saveTestRecordAttachment', 'post', data) |
||||
|
|
||||
@ -0,0 +1,219 @@ |
|||||
|
<template> |
||||
|
<div class="mod-config attachment-list-upload-demo"> |
||||
|
<el-form :inline="true" label-position="top"> |
||||
|
<el-form-item label="业务类型"> |
||||
|
<el-input v-model="attachmentContext.orderReftype" style="width: 220px" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="orderRef2"> |
||||
|
<el-input v-model="attachmentContext.orderRef2" style="width: 220px" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label=" "> |
||||
|
<el-button type="primary" @click="openAttachmentListDemo">打开附件清单</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
|
||||
|
<el-dialog title="附件清单" :close-on-click-modal="false" v-drag :visible.sync="attachmentDialogVisible" width="860px"> |
||||
|
<el-form :inline="true" label-position="top"> |
||||
|
<el-form-item> |
||||
|
<el-button type="primary" @click="openAttachmentUploadDialog">上传文件</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
|
||||
|
<el-table :height="360" :data="attachmentFileList" border v-loading="attachmentLoading" style="width: 100%"> |
||||
|
<el-table-column prop="fileName" label="文件名称" min-width="300" show-overflow-tooltip /> |
||||
|
<el-table-column prop="createdBy" label="上传人" width="120" align="center" /> |
||||
|
<el-table-column prop="createDate" label="上传时间" width="180" align="center" /> |
||||
|
<el-table-column prop="cadditionalInfo" label="备注" min-width="180" show-overflow-tooltip /> |
||||
|
<el-table-column label="操作" width="130" align="center" fixed="right"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-link type="primary" @click="previewAttachmentFile(scope.row)">查看 |</el-link> |
||||
|
<el-link type="danger" @click="removeAttachmentFile(scope.row)">删除</el-link> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
|
||||
|
<el-footer style="height:40px;margin-top: 10px;text-align:center"> |
||||
|
<el-button type="primary" @click="attachmentDialogVisible = false">关闭</el-button> |
||||
|
</el-footer> |
||||
|
</el-dialog> |
||||
|
|
||||
|
<el-dialog title="上传" :visible.sync="ossVisible" v-drag width="400px" append-to-body :close-on-click-modal="false"> |
||||
|
<el-form ref="form" class="rq" label-width="80px" label-position="top"> |
||||
|
<el-row :gutter="10"> |
||||
|
<el-col :span="24"> |
||||
|
<el-form-item label=" " class="auto"> |
||||
|
<el-upload |
||||
|
drag |
||||
|
:file-list="fileList2" |
||||
|
action="#" |
||||
|
ref="upload" |
||||
|
:on-remove="onRemoveFile" |
||||
|
:on-change="onChangeFile" |
||||
|
multiple |
||||
|
:auto-upload="false" |
||||
|
> |
||||
|
<i class="el-icon-upload"></i> |
||||
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> |
||||
|
</el-upload> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="24"> |
||||
|
<el-form-item label="备注" class="auto"> |
||||
|
<el-input type="textarea" v-model="ossForm.remark" resize="none" :autosize="{ minRows: 3, maxRows: 3 }"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<span slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" :loading="uploadLoading" @click="handleUploadFiles">确认</el-button> |
||||
|
<el-button @click="ossVisible = false">取消</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
queryOssFilePlus, |
||||
|
ossUploadNoSaveOSSForYJY, |
||||
|
previewOssFileById, |
||||
|
removeOss |
||||
|
} from '@/api/oss/oss' |
||||
|
|
||||
|
export default { |
||||
|
name: 'AttachmentListUploadDemo', |
||||
|
data () { |
||||
|
return { |
||||
|
attachmentDialogVisible: false, |
||||
|
ossVisible: false, |
||||
|
attachmentLoading: false, |
||||
|
uploadLoading: false, |
||||
|
attachmentFileList: [], |
||||
|
fileList2: [], |
||||
|
ossForm: { |
||||
|
remark: '' |
||||
|
}, |
||||
|
attachmentContext: { |
||||
|
orderRef1: this.$store.state.user.site, |
||||
|
orderRef2: 'DEMO_BIZ_001', |
||||
|
orderRef3: '', |
||||
|
orderRef4: '', |
||||
|
orderReftype: 'DEMO_ATTACHMENT' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
buildAttachmentQueryParams () { |
||||
|
return { |
||||
|
orderRef1: this.attachmentContext.orderRef1 || '', |
||||
|
orderRef2: this.attachmentContext.orderRef2 || '', |
||||
|
orderRef3: this.attachmentContext.orderRef3 || '', |
||||
|
orderRef4: this.attachmentContext.orderRef4 || '', |
||||
|
orderReftype: this.attachmentContext.orderReftype || '' |
||||
|
} |
||||
|
}, |
||||
|
openAttachmentListDemo () { |
||||
|
this.attachmentDialogVisible = true |
||||
|
this.fetchAttachmentFileList() |
||||
|
}, |
||||
|
fetchAttachmentFileList () { |
||||
|
this.attachmentLoading = true |
||||
|
queryOssFilePlus(this.buildAttachmentQueryParams()).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.attachmentFileList = data.rows || [] |
||||
|
} else { |
||||
|
this.attachmentFileList = [] |
||||
|
} |
||||
|
}).catch(() => { |
||||
|
this.attachmentFileList = [] |
||||
|
}).finally(() => { |
||||
|
this.attachmentLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
openAttachmentUploadDialog () { |
||||
|
this.fileList2 = [] |
||||
|
this.ossForm.remark = '' |
||||
|
this.ossVisible = true |
||||
|
this.$nextTick(() => { |
||||
|
if (this.$refs.upload) { |
||||
|
this.$refs.upload.clearFiles() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
onRemoveFile (file, fileList) { |
||||
|
this.fileList2 = fileList |
||||
|
}, |
||||
|
onChangeFile (file, fileList) { |
||||
|
this.fileList2 = fileList |
||||
|
}, |
||||
|
handleUploadFiles () { |
||||
|
if (!this.fileList2 || this.fileList2.length === 0) { |
||||
|
this.$message.warning('请选择文件') |
||||
|
return |
||||
|
} |
||||
|
const params = this.buildAttachmentQueryParams() |
||||
|
const formData = new FormData() |
||||
|
for (let i = 0; i < this.fileList2.length; i++) { |
||||
|
formData.append('file', this.fileList2[i].raw) |
||||
|
} |
||||
|
formData.append('orderRef1', params.orderRef1) |
||||
|
formData.append('orderRef2', params.orderRef2) |
||||
|
formData.append('orderRef3', params.orderRef3) |
||||
|
formData.append('orderRef4', params.orderRef4) |
||||
|
formData.append('createdBy', this.$store.state.user.name) |
||||
|
formData.append('CAdditionalInfo', this.ossForm.remark || '') |
||||
|
formData.append('orderReftype', params.orderReftype) |
||||
|
this.uploadLoading = true |
||||
|
ossUploadNoSaveOSSForYJY(formData).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.$message.success('上传成功') |
||||
|
this.ossVisible = false |
||||
|
this.fileList2 = [] |
||||
|
this.ossForm.remark = '' |
||||
|
this.fetchAttachmentFileList() |
||||
|
} else { |
||||
|
this.$message.warning((data && data.msg) || '上传失败') |
||||
|
} |
||||
|
}).catch(() => { |
||||
|
this.$message.error('上传失败') |
||||
|
}).finally(() => { |
||||
|
this.uploadLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
previewAttachmentFile (row) { |
||||
|
if (!row || !row.id) { |
||||
|
return |
||||
|
} |
||||
|
previewOssFileById(row.id) |
||||
|
}, |
||||
|
removeAttachmentFile (row) { |
||||
|
if (!row || !row.id) { |
||||
|
return |
||||
|
} |
||||
|
this.$confirm('确定删除该附件吗?', '提示', { |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
removeOss([row.id]).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.$message.success('删除成功') |
||||
|
this.fetchAttachmentFileList() |
||||
|
} else { |
||||
|
this.$message.warning((data && data.msg) || '删除失败') |
||||
|
} |
||||
|
}) |
||||
|
}).catch(() => {}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.attachment-list-upload-demo { |
||||
|
padding: 10px; |
||||
|
} |
||||
|
|
||||
|
.rq .auto /deep/ .el-form-item__content { |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
</style> |
||||
1192
src/views/modules/supplier/supplierPartNewProductAudit.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