Browse Source

2025-11-28

采购标签生成导入优化
master
fengyuan_yang 2 months ago
parent
commit
bc19f88434
  1. 2
      src/views/modules/print/PoPartPrint.vue
  2. 60
      src/views/modules/qc/qc_upload.vue
  3. 23
      src/views/modules/yieldReport/com_process_inspection.vue
  4. 2
      src/views/modules/yieldReport/com_produce_report_normal.vue

2
src/views/modules/print/PoPartPrint.vue

@ -45,7 +45,7 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item :label="' '" > <el-form-item :label="' '" >
<el-button class="customer-bun-min" type="primary" @click="getMainData" style="">Query</el-button>
<el-button class="customer-bun-min" type="primary" @click="getMainData" style="">查询</el-button>
<el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</el-button> <el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>

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

@ -1,6 +1,6 @@
<template> <template>
<div class="customer-css"> <div class="customer-css">
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="390px" style="height: 520px;" class="customer-dialog">
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" @close="handleDialogClose" width="390px" style="height: 520px;" class="customer-dialog">
<el-form :inline="true" label-position="top" label-width="80px"> <el-form :inline="true" label-position="top" label-width="80px">
<el-button type="primary" @click="downloadFile()">下载文件模板</el-button> <el-button type="primary" @click="downloadFile()">下载文件模板</el-button>
<el-form-item label="BU" v-if="pageData.flag !== 'poPartPrint'"> <el-form-item label="BU" v-if="pageData.flag !== 'poPartPrint'">
@ -24,7 +24,7 @@
</el-row> </el-row>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="saveUploadFile()">保存</el-button>
<el-button type="primary" @click="saveUploadFile()" :loading="uploadLoading">保存</el-button>
<el-button type="primary" @click="closeDialog">关闭</el-button> <el-button type="primary" @click="closeDialog">关闭</el-button>
</span> </span>
</el-dialog> </el-dialog>
@ -51,6 +51,7 @@ export default {
fileList: [], fileList: [],
bu: '', bu: '',
userBuList:[], userBuList:[],
uploadLoading: false, // loading
pageData: { pageData: {
flag: '', flag: '',
createBy: '', createBy: '',
@ -94,12 +95,41 @@ export default {
}, },
/*关闭modal*/ /*关闭modal*/
closeDialog(){ closeDialog(){
//
this.fileList = []; this.fileList = [];
// el-upload
if (this.$refs.uploadFile) {
this.$refs.uploadFile.clearFiles();
}
// BU
this.bu = '';
// loading
this.uploadLoading = false;
// //
this.$emit('refreshPageTables'); this.$emit('refreshPageTables');
// //
this.visible = false; this.visible = false;
}, },
/*对话框关闭事件 - 确保清理所有数据*/
handleDialogClose(){
//
this.fileList = [];
// el-upload
if (this.$refs.uploadFile) {
this.$refs.uploadFile.clearFiles();
}
// BU
this.bu = '';
// loading
this.uploadLoading = false;
// pageData
this.pageData = {
flag: '',
createBy: '',
site: ''
};
},
/*保修当前的数据*/ /*保修当前的数据*/
saveUploadFile(){ saveUploadFile(){
if (this.pageData.flag !== 'poPartPrint' && (this.bu === '' || this.bu == null)){ if (this.pageData.flag !== 'poPartPrint' && (this.bu === '' || this.bu == null)){
@ -111,6 +141,10 @@ export default {
this.$message.error("请先上传文件!"); this.$message.error("请先上传文件!");
return false; return false;
} }
// loading
this.uploadLoading = true;
const formData = new FormData(); const formData = new FormData();
formData.append("file", this.fileList[0].raw); formData.append("file", this.fileList[0].raw);
formData.append("createBy", this.pageData.createBy); formData.append("createBy", this.pageData.createBy);
@ -126,6 +160,11 @@ export default {
}else { }else {
this.$message.warning(data.msg); this.$message.warning(data.msg);
} }
}).catch((error) => {
this.$message.error('上传失败:' + (error.message || '网络错误'));
}).finally(() => {
// loading
this.uploadLoading = false;
}) })
} else if (this.pageData.flag === 'template') { } else if (this.pageData.flag === 'template') {
formData.set('site',this.bu) formData.set('site',this.bu)
@ -139,6 +178,11 @@ export default {
}else { }else {
this.$message.warning(data.msg); this.$message.warning(data.msg);
} }
}).catch((error) => {
this.$message.error('上传失败:' + (error.message || '网络错误'));
}).finally(() => {
// loading
this.uploadLoading = false;
}) })
} else if (this.pageData.flag === 'partAttribute') { } else if (this.pageData.flag === 'partAttribute') {
uploadPartAttributeExcel(formData).then(({data}) => { uploadPartAttributeExcel(formData).then(({data}) => {
@ -151,6 +195,11 @@ export default {
} else { } else {
this.$message.warning(data.msg); this.$message.warning(data.msg);
} }
}).catch((error) => {
this.$message.error('上传失败:' + (error.message || '网络错误'));
}).finally(() => {
// loading
this.uploadLoading = false;
}) })
} else if (this.pageData.flag === 'poPartPrint') { } else if (this.pageData.flag === 'poPartPrint') {
// //
@ -174,9 +223,14 @@ export default {
} else { } else {
this.$message.warning(data.msg); this.$message.warning(data.msg);
} }
}).catch((error) => {
this.$message.error('上传失败:' + (error.message || '网络错误'));
}).finally(() => {
// loading
this.uploadLoading = false;
}) })
} }
this.bu = '';
// bu closeDialog
}, },
// //
async downloadFile(){ async downloadFile(){

23
src/views/modules/yieldReport/com_process_inspection.vue

@ -320,12 +320,6 @@
<el-form-item :label="'物料类别'"> <el-form-item :label="'物料类别'">
<el-input v-model="detailData.invdefinetype" readonly style="width: 100px"></el-input> <el-input v-model="detailData.invdefinetype" readonly style="width: 100px"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="'PN'">
<el-input v-model="detailData.cinvSourceCode" readonly style="width: 100px"></el-input>
</el-form-item>
<el-form-item :label="'SKU'">
<el-input v-model="detailData.sku" readonly style="width: 100px"></el-input>
</el-form-item>
<el-form-item :label="'物料名称'"> <el-form-item :label="'物料名称'">
<el-input v-model="detailData.partDesc" readonly style="width: 300px"></el-input> <el-input v-model="detailData.partDesc" readonly style="width: 300px"></el-input>
</el-form-item> </el-form-item>
@ -392,14 +386,14 @@
label="项目编号"> label="项目编号">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="itemName"
prop="itemDesc"
header-align="center" header-align="center"
align="left" align="left"
min-width="150" min-width="150"
label="项目名称"> label="项目名称">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="standardValue"
prop="defaultValue"
header-align="center" header-align="center"
align="center" align="center"
min-width="100" min-width="100"
@ -505,6 +499,10 @@ export default {
resourceId: { resourceId: {
type: String, type: String,
default: '' default: ''
},
seqNo: {
type: String,
default: ''
} }
}, },
data() { data() {
@ -1022,9 +1020,12 @@ export default {
if (this.orderNo) { if (this.orderNo) {
this.searchData.orderNo = this.orderNo this.searchData.orderNo = this.orderNo
} }
// ID
if (this.resourceId) {
this.searchData.resourceId = this.resourceId
// // ID
// if (this.resourceId) {
// this.searchData.resourceId = this.resourceId
// }
if (this.seqNo) {
this.searchData.seqNo = this.seqNo
} }
this.getDataList() this.getDataList()
this.getSiteAndBuByUserName2() this.getSiteAndBuByUserName2()

2
src/views/modules/yieldReport/com_produce_report_normal.vue

@ -730,7 +730,7 @@
@refreshPageData="refreshPageData"></ComMalformedMaterial> @refreshPageData="refreshPageData"></ComMalformedMaterial>
<!-- 过程检验组件 --> <!-- 过程检验组件 -->
<ComProcessInspection :visible.sync="showProcessInspectionFlag" :orderNo="scheduleData.orderNo" :resourceId="scheduleData.resourceId"></ComProcessInspection>
<ComProcessInspection :visible.sync="showProcessInspectionFlag" :orderNo="scheduleData.orderNo" :resourceId="scheduleData.resourceId" :seqNo="scheduleData.seqNo"></ComProcessInspection>
<!-- MRB异常单登记组件 --> <!-- MRB异常单登记组件 -->
<ComMrbRegister ref="comMrbRegister" :visible.sync="showMrbRegisterFlag" @confirmed="onMrbConfirmed"></ComMrbRegister> <ComMrbRegister ref="comMrbRegister" :visible.sync="showMrbRegisterFlag" @confirmed="onMrbConfirmed"></ComMrbRegister>

Loading…
Cancel
Save