@ -715,7 +715,10 @@ export default {
/ * *
* 分类信息新增 / 编辑
* /
saveData ( ) {
async saveData ( ) {
await this . workCenterBlur ( 216 )
await this . laborClassBlur ( 217 )
await this . setupLaborClassBlur ( 217 )
if ( this . modalData . bu === '' || this . modalData . bu == null ) {
this . $message . warning ( '请选择BU!' )
return
@ -825,13 +828,14 @@ export default {
} ,
/ / 加 工 中 心 输 入 校 验
workCenterBlur ( tagNo ) {
async workCenterBlur ( tagNo ) {
if ( this . modalData . workCenterNo != null && this . modalData . workCenterNo !== '' ) {
let tempData = {
tagno : tagNo ,
conditionSql : " and work_center_no = '" + this . modalData . workCenterNo + "'" + " and site = '" + this . modalData . bu . split ( '_' ) [ 0 ] + "'" + " and bu_no = '" + this . modalData . bu . split ( '_' ) [ 1 ] + "'"
}
verifyData ( tempData ) . then ( ( { data } ) => {
/ / 返 回 P r o m i s e
return verifyData ( tempData ) . then ( ( { data } ) => {
if ( data && data . code === 0 ) {
if ( data . baseListData . length > 0 ) {
this . modalData . workCenterDesc = data . baseListData [ 0 ] . work_center_desc
@ -842,20 +846,26 @@ export default {
this . $message . warning ( data . msg )
this . modalData . workCenterDesc = ''
}
} )
} ) . catch ( error => {
console . error ( error ) ;
this . $message . error ( '校验失败,请重试' ) ;
this . modalData . workCenterDesc = '' ;
} ) ;
} else {
this . modalData . workCenterDesc = ''
return Promise . resolve ( ) ; / / 如 果 i t e m N o 为 空 , 直 接 返 回 r e s o l v e d P r o m i s e
}
} ,
/ / 人 员 等 级 描 述
setupLaborClassBlur ( tagNo ) {
async setupLaborClassBlur ( tagNo ) {
if ( this . modalData . setupLaborClassNo != null && this . modalData . setupLaborClassNo !== '' ) {
let tempData = {
tagno : tagNo ,
conditionSql : " and class_no = '" + this . modalData . setupLaborClassNo + "'" + " and site = '" + this . modalData . bu . split ( '_' ) [ 0 ] + "'" + " and bu_no = '" + this . modalData . bu . split ( '_' ) [ 1 ] + "'"
}
verifyData ( tempData ) . then ( ( { data } ) => {
/ / 返 回 P r o m i s e
return verifyData ( tempData ) . then ( ( { data } ) => {
if ( data && data . code === 0 ) {
if ( data . baseListData . length > 0 ) {
this . modalData . setupLaborClassDesc = data . baseListData [ 0 ] . class_desc
@ -864,23 +874,27 @@ export default {
}
} else {
this . $message . warning ( data . msg )
this . modalData . setupLaborClassNo = ''
this . modalData . setupLaborClassDesc = ''
}
} )
} ) . catch ( error => {
console . error ( error ) ;
this . $message . error ( '校验失败,请重试' ) ;
this . modalData . setupLaborClassDesc = '' ;
} ) ;
} else {
this . modalData . setupLaborClassDesc = ''
return Promise . resolve ( ) ; / / 如 果 i t e m N o 为 空 , 直 接 返 回 r e s o l v e d P r o m i s e
}
} ,
/ / 人 员 等 级 描 述
laborClassBlur ( tagNo ) {
async laborClassBlur ( tagNo ) {
if ( this . modalData . laborClassNo != null && this . modalData . laborClassNo !== '' ) {
let tempData = {
tagno : tagNo ,
conditionSql : " and class_no = '" + this . modalData . laborClassNo + "'" + " and site = '" + this . modalData . bu . split ( '_' ) [ 0 ] + "'" + " and bu_no = '" + this . modalData . bu . split ( '_' ) [ 1 ] + "'"
}
verifyData ( tempData ) . then ( ( { data } ) => {
return verifyData ( tempData ) . then ( ( { data } ) => {
if ( data && data . code === 0 ) {
if ( data . baseListData . length > 0 ) {
this . modalData . laborClassDesc = data . baseListData [ 0 ] . class_desc
@ -891,9 +905,14 @@ export default {
this . $message . warning ( data . msg )
this . modalData . laborClassDesc = ''
}
} )
} ) . catch ( error => {
console . error ( error ) ;
this . $message . error ( '校验失败,请重试' ) ;
this . modalData . laborClassDesc = '' ;
} ) ;
} else {
this . modalData . laborClassDesc = ''
return Promise . resolve ( ) ; / / 如 果 i t e m N o 为 空 , 直 接 返 回 r e s o l v e d P r o m i s e
}
} ,