Browse Source

site

master
han\hanst 5 days ago
parent
commit
a0006eaf98
  1. 24
      src/views/modules/common/uploadFileList1.vue

24
src/views/modules/common/uploadFileList1.vue

@ -95,7 +95,7 @@ export default {
}, },
site:{ site:{
type: [String,Number], type: [String,Number],
default: ''
required: true
}, },
bu:{ bu:{
type: [String,Number], type: [String,Number],
@ -185,6 +185,12 @@ export default {
} }
}, },
methods: { methods: {
resolveUploadSite () {
if (this.site !== null && this.site !== undefined && this.site !== '') {
return this.site
}
return ''
},
triggerUpload() { triggerUpload() {
this.fileName = ''; // this.fileName = ''; //
this.$refs.uploadFile.clearFiles(); // this.$refs.uploadFile.clearFiles(); //
@ -219,6 +225,11 @@ export default {
} }
}, },
upload() { upload() {
const currentSite = this.resolveUploadSite()
if (currentSite === '') {
this.$message.warning("未获取到工厂,请重新选择数据后再上传")
return;
}
if (this.fileList.length === 0) { if (this.fileList.length === 0) {
this.$message.warning("未选择需要上传的文件") this.$message.warning("未选择需要上传的文件")
return; return;
@ -233,7 +244,7 @@ export default {
} }
let data = new FormData(); let data = new FormData();
data.append("file", this.fileList[0].raw); data.append("file", this.fileList[0].raw);
data.append("orderRef1", this.$store.state.user.site);
data.append("orderRef1", currentSite);
data.append("orderRef2", this.proofingId); data.append("orderRef2", this.proofingId);
data.append("orderRef3", this.id); data.append("orderRef3", this.id);
data.append("orderRef4", this.projectId); data.append("orderRef4", this.projectId);
@ -314,8 +325,13 @@ export default {
}); });
}, },
getProofDocument() { getProofDocument() {
const currentSite = this.resolveUploadSite()
if (currentSite === '') {
this.proofDocumentList = []
return
}
let tempData = { let tempData = {
site: this.$store.state.user.site,
site: currentSite,
username: this.$store.state.user.name, username: this.$store.state.user.name,
buNo: this.bu, buNo: this.bu,
proofingId: this.proofingId, proofingId: this.proofingId,
@ -332,7 +348,7 @@ export default {
if (data && data.code === 0) { if (data && data.code === 0) {
this.proofDocumentList = data.page.list this.proofDocumentList = data.page.list
for (let i = 0; i < this.proofDocumentList.length; i++) { for (let i = 0; i < this.proofDocumentList.length; i++) {
this.proofDocumentList[i].buNo = this.proofDocumenCurrentRow.buNo
this.proofDocumentList[i].buNo = this.bu
} }
} else { } else {
this.proofDocumentList = [] this.proofDocumentList = []

Loading…
Cancel
Save