Browse Source

site

master
han\hanst 5 days ago
parent
commit
b40e84f09c
  1. 49
      src/utils/export.js
  2. 24
      src/views/modules/eam/com_project_proof_record.vue
  3. 1
      src/views/modules/eam/eamProjectInfoForUploads.vue
  4. 48
      src/views/modules/eam/eamProjectPartInfo.vue

49
src/utils/export.js

@ -1,3 +1,42 @@
import Vue from "vue";
function parseExportErrorMessage(payload) {
if (!payload) {
return "导出失败,请稍后重试";
}
if (typeof payload === "object") {
if (payload.msg || payload.message) {
return payload.msg || payload.message;
}
if (payload.response && payload.response.data) {
return parseExportErrorMessage(payload.response.data);
}
}
const raw = String(payload);
try {
const json = JSON.parse(raw);
return json.msg || json.message || "导出失败,请稍后重试";
} catch (e) {
return raw;
}
}
function showExportError(message) {
const msg = message || "导出失败,请稍后重试";
if (Vue.prototype && Vue.prototype.$message) {
Vue.prototype.$message.error(msg);
return;
}
alert(msg);
}
function isErrorBlob(resp) {
const type = (resp && resp.type ? resp.type : "").toLowerCase();
return type.indexOf("application/json") > -1
|| type.indexOf("text/plain") > -1
|| type.indexOf("text/html") > -1;
}
export default {
export(url, searchParameter, filenameRep) {
ajax.file(url, JSON.stringify(searchParameter),
@ -5,6 +44,14 @@ export default {
var filename = filenameRep || "export.xls";
var linkelem = document.createElement("a");
try {
if (isErrorBlob(resp)) {
var fr = new FileReader();
fr.onload = function() {
showExportError(parseExportErrorMessage(fr.result));
};
fr.readAsText(resp);
return;
}
var blob = new Blob([resp], {
type: "application/octet-stream"
});
@ -30,10 +77,12 @@ export default {
}
} catch (ex) {
console.log(ex);
showExportError("导出失败,请稍后重试");
}
},
error => {
console.error(error);
showExportError(parseExportErrorMessage(error));
}
);
},

24
src/views/modules/eam/com_project_proof_record.vue

@ -1585,6 +1585,30 @@
} else {
this.proofDocumentList[i].projectLeader = ''
}
} else if (this.proofDocumentList[i].responsibleDepartment === '前道工程师'){
if (this.searchData.cQualityEngineer7 !== null && this.searchData.cQualityEngineer7 !== ''){
this.proofDocumentList[i].projectLeader = this.searchData.cQualityEngineer7.split("-")[1]
} else {
this.proofDocumentList[i].projectLeader = ''
}
} else if (this.proofDocumentList[i].responsibleDepartment === 'QC'){
if (this.searchData.qcEngineer !== null && this.searchData.qcEngineer !== ''){
this.proofDocumentList[i].projectLeader = this.searchData.qcEngineer.split("-")[1]
} else {
this.proofDocumentList[i].projectLeader = ''
}
} else if (this.proofDocumentList[i].responsibleDepartment === 'PE'){
if (this.searchData.peEngineer !== null && this.searchData.peEngineer !== ''){
this.proofDocumentList[i].projectLeader = this.searchData.peEngineer.split("-")[1]
} else {
this.proofDocumentList[i].projectLeader = ''
}
} else if (this.proofDocumentList[i].responsibleDepartment === 'EE'){
if (this.searchData.eeEngineer !== null && this.searchData.eeEngineer !== ''){
this.proofDocumentList[i].projectLeader = this.searchData.eeEngineer.split("-")[1]
} else {
this.proofDocumentList[i].projectLeader = ''
}
}
}
if (this.totalPage > 0) {

1
src/views/modules/eam/eamProjectInfoForUploads.vue

@ -1817,7 +1817,6 @@ export default {
let conSql = ''
if (val === 1056 ) {
strVal = this.searchData.documentTypeId ? this.searchData.documentTypeId.toString() : ''
conSql = " and a.site = '" + this.$store.state.user.site + "'"
this.$refs.baseList.init(val, strVal, conSql)
}

48
src/views/modules/eam/eamProjectPartInfo.vue

@ -4114,6 +4114,18 @@ import {uploadFileList} from '@/api/base/baseFunction.js';
if (this.exportList[i].cQualityEngineer7 !== null && this.exportList[i].cQualityEngineer7 !== '') {
this.exportList[i].projectLeader = this.exportList[i].cQualityEngineer7.split("-")[1];
}
} else if (this.exportList[i].responsibleDepartment === 'QC' || this.exportList[i].responsibleDepartment === 'R018') {
if (this.exportList[i].qcEngineer !== null && this.exportList[i].qcEngineer !== '') {
this.exportList[i].projectLeader = this.exportList[i].qcEngineer.split("-")[1];
}
} else if (this.exportList[i].responsibleDepartment === 'PE' || this.exportList[i].responsibleDepartment === 'R019') {
if (this.exportList[i].peEngineer !== null && this.exportList[i].peEngineer !== '') {
this.exportList[i].projectLeader = this.exportList[i].peEngineer.split("-")[1];
}
} else if (this.exportList[i].responsibleDepartment === 'EE' || this.exportList[i].responsibleDepartment === 'R020') {
if (this.exportList[i].eeEngineer !== null && this.exportList[i].eeEngineer !== '') {
this.exportList[i].projectLeader = this.exportList[i].eeEngineer.split("-")[1];
}
}
}
})
@ -5305,6 +5317,18 @@ import {uploadFileList} from '@/api/base/baseFunction.js';
if (this.proofingCurrentRow.cQualityEngineer7 != null && this.proofingCurrentRow.cQualityEngineer7 !== '') {
this.projectPartDocumentList[i].projectLeader = this.proofingCurrentRow.cQualityEngineer7.split('-')[1] //
}
} else if (this.projectPartDocumentList[i].responsibleDepartment === 'QC') {
if (this.proofingCurrentRow.qcEngineer != null && this.proofingCurrentRow.qcEngineer !== '') {
this.projectPartDocumentList[i].projectLeader = this.proofingCurrentRow.qcEngineer.split('-')[1] //
}
} else if (this.projectPartDocumentList[i].responsibleDepartment === 'PE') {
if (this.proofingCurrentRow.peEngineer != null && this.proofingCurrentRow.peEngineer !== '') {
this.projectPartDocumentList[i].projectLeader = this.proofingCurrentRow.peEngineer.split('-')[1] //
}
} else if (this.projectPartDocumentList[i].responsibleDepartment === 'EE') {
if (this.proofingCurrentRow.eeEngineer != null && this.proofingCurrentRow.eeEngineer !== '') {
this.projectPartDocumentList[i].projectLeader = this.proofingCurrentRow.eeEngineer.split('-')[1] //
}
}
else {
this.projectPartDocumentList[i].projectLeader = ''
@ -5464,6 +5488,18 @@ import {uploadFileList} from '@/api/base/baseFunction.js';
if (this.proofingCurrentRow.cQualityEngineer7 != null && this.proofingCurrentRow.cQualityEngineer7 !== '') {
this.projectOtherDocumentList[i].projectLeader = this.proofingCurrentRow.cQualityEngineer7.split('-')[1] //
}
} else if (this.projectOtherDocumentList[i].responsibleDepartment === 'QC') {
if (this.proofingCurrentRow.qcEngineer != null && this.proofingCurrentRow.qcEngineer !== '') {
this.projectOtherDocumentList[i].projectLeader = this.proofingCurrentRow.qcEngineer.split('-')[1] //
}
} else if (this.projectOtherDocumentList[i].responsibleDepartment === 'PE') {
if (this.proofingCurrentRow.peEngineer != null && this.proofingCurrentRow.peEngineer !== '') {
this.projectOtherDocumentList[i].projectLeader = this.proofingCurrentRow.peEngineer.split('-')[1] //
}
} else if (this.projectOtherDocumentList[i].responsibleDepartment === 'EE') {
if (this.proofingCurrentRow.eeEngineer != null && this.proofingCurrentRow.eeEngineer !== '') {
this.projectOtherDocumentList[i].projectLeader = this.proofingCurrentRow.eeEngineer.split('-')[1] //
}
}
else {
this.projectOtherDocumentList[i].projectLeader = ''
@ -5734,6 +5770,18 @@ import {uploadFileList} from '@/api/base/baseFunction.js';
if (this.proofingCurrentRow.cQualityEngineer7 != null && this.proofingCurrentRow.cQualityEngineer7 !== '') {
this.projectAllDocumentList[i].projectLeader = this.proofingCurrentRow.cQualityEngineer7.split('-')[1] //
}
} else if (this.projectAllDocumentList[i].responsibleDepartment === 'QC') {
if (this.proofingCurrentRow.qcEngineer != null && this.proofingCurrentRow.qcEngineer !== '') {
this.projectAllDocumentList[i].projectLeader = this.proofingCurrentRow.qcEngineer.split('-')[1] //
}
} else if (this.projectAllDocumentList[i].responsibleDepartment === 'PE') {
if (this.proofingCurrentRow.peEngineer != null && this.proofingCurrentRow.peEngineer !== '') {
this.projectAllDocumentList[i].projectLeader = this.proofingCurrentRow.peEngineer.split('-')[1] //
}
} else if (this.projectAllDocumentList[i].responsibleDepartment === 'EE') {
if (this.proofingCurrentRow.eeEngineer != null && this.proofingCurrentRow.eeEngineer !== '') {
this.projectAllDocumentList[i].projectLeader = this.proofingCurrentRow.eeEngineer.split('-')[1] //
}
} else {
this.projectAllDocumentList[i].projectLeader = ''
}

Loading…
Cancel
Save