Browse Source

2026-10-20

qms导入优化
master
fengyuan_yang 4 weeks ago
parent
commit
75ad8dcd40
  1. 3
      src/views/modules/qc/qcItem.vue
  2. 3
      src/views/modules/qc/qcMethod.vue
  3. 6
      src/views/modules/qc/qcPartAttribute.vue
  4. 2
      src/views/modules/qc/qcTemplate.vue
  5. 44
      src/views/modules/qc/qc_upload.vue

3
src/views/modules/qc/qcItem.vue

@ -1571,8 +1571,7 @@
qcUpload () {
let currentData = {
flag: 'item',
createBy: this.$store.state.user.name,
site: this.$store.state.user.site,
createBy: this.$store.state.user.name
}
//打开组件 去做新增业务
this.$nextTick(() => {

3
src/views/modules/qc/qcMethod.vue

@ -719,8 +719,7 @@
qcUpload () {
let currentData = {
flag: 'method',
createBy: this.$store.state.user.name,
site: this.$store.state.user.site,
createBy: this.$store.state.user.name
}
this.$nextTick(() => {
this.$refs.qcUpload.init(currentData)

6
src/views/modules/qc/qcPartAttribute.vue

@ -3358,8 +3358,7 @@
let currentData = {
flag: flag,
title: title,
createBy: this.$store.state.user.name,
site: this.$store.state.user.site,
createBy: this.$store.state.user.name
}
this.$nextTick(() => {
this.$refs.qcUpload.init(currentData)
@ -3370,8 +3369,7 @@
qcUpload () {
let currentData = {
flag: 'partAttribute',
createBy: this.$store.state.user.name,
site: this.$store.state.user.site,
createBy: this.$store.state.user.name
}
//打开组件 去做新增业务
this.$nextTick(() => {

2
src/views/modules/qc/qcTemplate.vue

@ -1825,7 +1825,6 @@
let currentData = {
flag: 'template',
createBy: this.$store.state.user.name,
site: this.$store.state.user.site,
title: '模板导入'
}
this.$nextTick(() => {
@ -1838,7 +1837,6 @@
let currentData = {
flag: 'templateItem',
createBy: this.$store.state.user.name,
site: this.$store.state.user.site,
title: '检验项目导入'
}
this.$nextTick(() => {

44
src/views/modules/qc/qc_upload.vue

@ -2,7 +2,17 @@
<div class="customer-css">
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="390px" class="customer-dialog">
<el-form :inline="true" label-position="top" label-width="80px">
<el-button type="primary" @click="downloadFile()">下载文件模板</el-button>
<div class="upload-toolbar">
<el-button type="primary" @click="downloadFile()">下载文件模板</el-button>
<el-select v-if="isMasterImport" filterable v-model="selectedSite" placeholder="请选择工厂" style="width: 180px">
<el-option
v-for="item in siteList"
:key="item.siteID"
:label="item.shortSiteName"
:value="item.siteID">
</el-option>
</el-select>
</div>
<el-form-item v-if="needSelectBu" label="BU">
<el-select v-model="bu" placeholder="请选择" style="width: 295px">
<el-option
@ -51,6 +61,7 @@ import {
getSiteAndBuByUserName
} from "@/api/qc/qc.js"
import { downLoadObjectFile } from '@/api/eam/eam_object_list.js'
import { getSiteData } from '@/api/board.js'
export default {
data() {
return {
@ -58,6 +69,8 @@ export default {
visible: false,
fileList: [],
bu: '',
selectedSite: '',
siteList: [],
userBuList: [],
saveLoading: false,
pageData: {
@ -75,13 +88,25 @@ export default {
return !this.isMasterImport
},
importSite() {
return this.pageData.site || (this.$store.state.user && this.$store.state.user.site) || ''
return this.selectedSite || ''
}
},
created(){
this.getSiteAndBu();
this.loadSiteList()
},
methods: {
loadSiteList () {
return getSiteData({ userID: this.$store.state.user.name }).then(({data}) => {
this.siteList = (data && data.rows) ? data.rows : []
if (!this.selectedSite && this.siteList.length) {
this.selectedSite = this.siteList[0].siteID
}
})
},
getDefaultSite () {
return (this.siteList && this.siteList.length) ? this.siteList[0].siteID : ''
},
getSiteAndBu () {
let tempData = {
username: this.$store.state.user.name,
@ -97,8 +122,10 @@ export default {
this.titleCon = this.pageData.title || '文件导入'
this.fileList = []
this.bu = ''
this.selectedSite = this.getDefaultSite()
this.saveLoading = false
this.visible = true
this.loadSiteList()
this.$nextTick(() => {
if (this.$refs.uploadFile) {
this.$refs.uploadFile.clearFiles()
@ -122,6 +149,7 @@ export default {
closeDialog(){
this.fileList = []
this.bu = ''
this.selectedSite = this.getDefaultSite()
this.saveLoading = false
this.$emit('refreshPageTables');
this.visible = false;
@ -154,7 +182,7 @@ export default {
return false;
}
if (this.isMasterImport && !this.importSite) {
this.$message.warning("未获取到当前用户工厂");
this.$message.warning("请选择工厂");
return false;
}
if (this.fileList == null || this.fileList.length === 0){
@ -227,7 +255,7 @@ export default {
partStandard: '物料检验标准导入模板.xlsx'
}
if (!this.importSite) {
this.$message.warning("未获取到当前用户工厂")
this.$message.warning("请选择工厂")
return
}
await downloadQcImportTemplate(this.pageData.flag, this.importSite).then(({data}) => {
@ -274,4 +302,12 @@ export default {
}
</script>
<style scoped lang="scss">
.upload-toolbar {
display: flex;
align-items: center;
margin-bottom: 10px;
.el-button {
margin-right: 8px;
}
}
</style>
Loading…
Cancel
Save