Browse Source

更新

master
常熟吴彦祖 3 weeks ago
parent
commit
bfaeafe1fd
  1. 11
      src/api/supplier/supplierPartNewProductAudit.js
  2. 219
      src/views/demo/attachmentListUploadDemo.vue
  3. 24
      src/views/modules/supplier/supplierPartMoqPrice.vue
  4. 1192
      src/views/modules/supplier/supplierPartNewProductAudit.vue

11
src/api/supplier/supplierPartNewProductAudit.js

@ -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)

219
src/views/demo/attachmentListUploadDemo.vue

@ -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>

24
src/views/modules/supplier/supplierPartMoqPrice.vue

@ -1,7 +1,7 @@
<template> <template>
<div ref="pageRoot" class="customer-css supplier-part-moq-price"> <div ref="pageRoot" class="customer-css supplier-part-moq-price">
<el-form :inline="true" label-position="top" class="pi-search-form"> <el-form :inline="true" label-position="top" class="pi-search-form">
<el-form-item required>
<el-form-item>
<span slot="label" style="" @click="getBaseList(520, 'search')"><a href="javascript:void(0)">供应商编号</a></span> <span slot="label" style="" @click="getBaseList(520, 'search')"><a href="javascript:void(0)">供应商编号</a></span>
<el-input <el-input
v-model="searchData.supplierNo" v-model="searchData.supplierNo"
@ -58,7 +58,6 @@
type="primary" type="primary"
class="customer-bun-min" class="customer-bun-min"
:loading="topLoading" :loading="topLoading"
:disabled="!canSearch"
@click="searchSupplierPartList" @click="searchSupplierPartList"
>查询</el-button> >查询</el-button>
<el-button class="customer-bun-min" @click="resetSearch">重置</el-button> <el-button class="customer-bun-min" @click="resetSearch">重置</el-button>
@ -75,7 +74,7 @@
highlight-current-row highlight-current-row
v-loading="topLoading" v-loading="topLoading"
style="width: 100%" style="width: 100%"
empty-text="请输入供应商编号后点击查询"
empty-text="点击查询查看数据"
@row-click="handleTopRowClick" @row-click="handleTopRowClick"
> >
<el-table-column fixed="right" label="操作" width="130" header-align="center" align="center"> <el-table-column fixed="right" label="操作" width="130" header-align="center" align="center">
@ -360,7 +359,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注" class="auto">
<el-form-item label="备注" class="auto" :style="calcTextareaFollowGapStyle(3)">
<el-input <el-input
type="textarea" type="textarea"
v-model="attachmentRemark" v-model="attachmentRemark"
@ -468,11 +467,6 @@ export default {
attachmentRemark: '' attachmentRemark: ''
} }
}, },
computed: {
canSearch () {
return !!(this.searchData.supplierNo && this.searchData.supplierNo.trim())
}
},
mounted () { mounted () {
// - rqrq // - rqrq
this.handleResize() this.handleResize()
@ -560,14 +554,10 @@ export default {
this.currentTierPriceList = [] this.currentTierPriceList = []
}, },
searchSupplierPartList () { searchSupplierPartList () {
if (!this.canSearch) {
this.$message.warning('请先输入供应商编号')
return
}
this.topLoading = true this.topLoading = true
const inData = { const inData = {
site: this.$store.state.user.site, site: this.$store.state.user.site,
supplierCode: this.searchData.supplierNo.trim(),
supplierCode: (this.searchData.supplierNo || '').trim(),
partNo: (this.searchData.partNo || '').trim(), partNo: (this.searchData.partNo || '').trim(),
item: (this.searchData.item || '').trim(), item: (this.searchData.item || '').trim(),
sku: (this.searchData.sku || '').trim(), sku: (this.searchData.sku || '').trim(),
@ -1070,6 +1060,11 @@ export default {
const merged = [...(sourceIds || []), ...(appendIds || [])].map(item => String(item)) const merged = [...(sourceIds || []), ...(appendIds || [])].map(item => String(item))
return [...new Set(merged)] return [...new Set(merged)]
}, },
calcTextareaFollowGapStyle (rows) {
const rowCount = Number(rows) || 1
const followGap = rowCount > 1 ? (rowCount - 1) * 20 : 0
return { marginBottom: `${followGap}px` }
},
buildAttachmentRefs () { buildAttachmentRefs () {
return (this.attachmentRefIds || []).join(',') return (this.attachmentRefIds || []).join(',')
} }
@ -1126,4 +1121,5 @@ export default {
height: auto; height: auto;
line-height: 1.5; line-height: 1.5;
} }
</style> </style>

1192
src/views/modules/supplier/supplierPartNewProductAudit.vue
File diff suppressed because it is too large
View File

Loading…
Cancel
Save