Browse Source

客户

master
han\hanst 5 days ago
parent
commit
2e6e72ce2a
  1. 47
      src/views/modules/eam/eamProjectInfo.vue

47
src/views/modules/eam/eamProjectInfo.vue

@ -3011,6 +3011,21 @@ import {updateColumnSize} from "../../../api/table";
} }
return buValue return buValue
}, },
// site_bu site
getSiteByJoinedBuValue (buValue) {
if (!buValue) {
return ''
}
let matchBu = this.userBuList.find(item => item.buNo === buValue)
if (matchBu && matchBu.site) {
return matchBu.site
}
let buParts = String(buValue).split('_')
if (buParts.length >= 2) {
return buParts[0]
}
return ''
},
// BU bu_no // BU bu_no
getBuNoByBuDesc (buDesc) { getBuNoByBuDesc (buDesc) {
if (!buDesc) { if (!buDesc) {
@ -3068,6 +3083,9 @@ import {updateColumnSize} from "../../../api/table";
}, },
// BU // BU
modalBuChangeHandle (buValue) { modalBuChangeHandle (buValue) {
this.modalData.site = this.getSiteByJoinedBuValue(buValue) || this.$store.state.user.site
this.modalData.customerNo = ''
this.modalData.customerDesc = ''
this.modalData.projectCategory = '' this.modalData.projectCategory = ''
let buNo = this.getBuNoByJoinedValue(buValue) let buNo = this.getBuNoByJoinedValue(buValue)
this.loadModalProjectCategory(buNo) this.loadModalProjectCategory(buNo)
@ -3076,11 +3094,22 @@ import {updateColumnSize} from "../../../api/table";
// S // S
getBaseList (val,type) { getBaseList (val,type) {
this.tagNo = val this.tagNo = val
if (val === 509 && (this.modalData.bu === '' || this.modalData.bu == null)) {
this.$message.warning('请先选择BU!')
return
}
this.$nextTick(() => { this.$nextTick(() => {
let strVal = '' let strVal = ''
let conSql = '' let conSql = ''
if (val === 509 ) { if (val === 509 ) {
strVal = this.modalData.customerNo ? this.modalData.customerNo : '' strVal = this.modalData.customerNo ? this.modalData.customerNo : ''
let currentSite = this.getSiteByJoinedBuValue(this.modalData.bu)
if (!currentSite) {
this.$message.warning('未获取到BU所属工厂,请重新选择BU!')
return
}
const escapedSite = String(currentSite).replace(/'/g, "''")
conSql = " and site = '" + escapedSite + "'"
} }
// if (val === 2006 ) { // if (val === 2006 ) {
// conSql = " and b.site = '" + this.$store.state.user.site + "'" // conSql = " and b.site = '" + this.$store.state.user.site + "'"
@ -3176,6 +3205,16 @@ import {updateColumnSize} from "../../../api/table";
}, },
newCustomer () { newCustomer () {
if (this.modalData.bu === '' || this.modalData.bu == null) {
this.$message.warning('请先选择BU!')
return
}
let currentSite = this.getSiteByJoinedBuValue(this.modalData.bu)
if (!currentSite) {
this.$message.warning('未获取到BU所属工厂,请重新选择BU!')
return
}
this.modalData.site = currentSite
this.modalData.customerNo = '' this.modalData.customerNo = ''
this.modalData.customerDesc = '' this.modalData.customerDesc = ''
this.newCustomerFlag = true this.newCustomerFlag = true
@ -3202,11 +3241,17 @@ import {updateColumnSize} from "../../../api/table";
}, },
saveNewCustomer () { saveNewCustomer () {
let currentSite = this.getSiteByJoinedBuValue(this.modalData.bu)
if (!currentSite) {
this.$message.warning('未获取到BU所属工厂,请重新选择BU!')
return
}
this.modalData.site = currentSite
this.generateNextCustomerNo().then((customerNo) => { this.generateNextCustomerNo().then((customerNo) => {
if (customerNo !== false) { if (customerNo !== false) {
this.modalData.customerNo = customerNo this.modalData.customerNo = customerNo
let tempData = { let tempData = {
site: this.$store.state.user.site,
site: currentSite,
customerNo: customerNo, customerNo: customerNo,
customerDesc: this.modalData.customerDesc, customerDesc: this.modalData.customerDesc,
createBy: this.$store.state.user.name, createBy: this.$store.state.user.name,

Loading…
Cancel
Save