|
|
|
@ -722,6 +722,7 @@ import { |
|
|
|
getInventoryStockList, // 获取领用出库信息 |
|
|
|
saveTrans, // 维修出库 |
|
|
|
saveCoreComponent, |
|
|
|
getCoreSerialLatestAction, |
|
|
|
getSparPartImages, // 获取备件图片 |
|
|
|
deleteCoreComponents,//删除核心备件 |
|
|
|
reportExchangeWorkOrderExcel//执行工单导出 |
|
|
|
@ -734,6 +735,7 @@ import { |
|
|
|
getFileContentList |
|
|
|
} from '@/api/eam/eam_object_list.js'; |
|
|
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" |
|
|
|
import {sysControlModelSearch} from "@/api/base" |
|
|
|
import Chooselist from '@/views/modules/common/Chooselist_eam' |
|
|
|
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' |
|
|
|
import reportImageUpload from "./report_image_upload.vue" |
|
|
|
@ -2921,6 +2923,69 @@ export default { |
|
|
|
this.coreComponentFlag = true |
|
|
|
}, |
|
|
|
|
|
|
|
async checkCoreSerialControlFlag () { |
|
|
|
let tempData = { |
|
|
|
site: this.coreComponentData.site || this.saveData.site || this.$store.state.user.site, |
|
|
|
baseDesc: '备品备件新老序列号管控' |
|
|
|
} |
|
|
|
try { |
|
|
|
const {data} = await sysControlModelSearch(tempData) |
|
|
|
if (data && data.code === 0) { |
|
|
|
return (data.rows || []).some(item => item.baseData === '控制') |
|
|
|
} |
|
|
|
this.$alert(data.msg || '获取新老序列号管控失败!', '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} catch (e) { |
|
|
|
this.$message.error('获取新老序列号管控异常!') |
|
|
|
} |
|
|
|
return false |
|
|
|
}, |
|
|
|
|
|
|
|
async checkCoreSerialCanOnMachine () { |
|
|
|
let tempNewSerialNo = (this.coreComponentData.newSerialNo || '').trim() |
|
|
|
if (tempNewSerialNo === '') { |
|
|
|
return true |
|
|
|
} |
|
|
|
let tempPartNo = (this.coreComponentData.partNo || '').trim() |
|
|
|
if (tempPartNo === '') { |
|
|
|
return true |
|
|
|
} |
|
|
|
let tempData = { |
|
|
|
site: this.coreComponentData.site, |
|
|
|
buNo: this.coreComponentData.buNo, |
|
|
|
orderNo: this.coreComponentData.orderNo, |
|
|
|
partNo: tempPartNo, |
|
|
|
serialNo: tempNewSerialNo |
|
|
|
} |
|
|
|
try { |
|
|
|
const {data} = await getCoreSerialLatestAction(tempData) |
|
|
|
if (!(data && data.code === 0)) { |
|
|
|
this.$alert((data && data.msg) || '校验新序列号失败!', '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return false |
|
|
|
} |
|
|
|
const latestAction = data.data || '' |
|
|
|
// 无任何上下机记录,视为未使用过,允许首次上机 |
|
|
|
if (latestAction === '') { |
|
|
|
return true |
|
|
|
} |
|
|
|
if (latestAction !== '下机') { |
|
|
|
this.$message({ |
|
|
|
message: '新序列号当前为上机状态,不允许重复上机!', |
|
|
|
type: 'warning', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
return false |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
this.$message.error('校验新序列号异常!') |
|
|
|
return false |
|
|
|
} |
|
|
|
return true |
|
|
|
}, |
|
|
|
|
|
|
|
async saveCoreComponent () { |
|
|
|
await this.partNoBlur(1059) |
|
|
|
if (this.coreComponentData.orderNo === '' || this.coreComponentData.orderNo == null) { |
|
|
|
@ -2931,6 +2996,23 @@ export default { |
|
|
|
this.$message.warning('请选择备件!') |
|
|
|
return |
|
|
|
} |
|
|
|
this.coreComponentData.oldSerialNo = (this.coreComponentData.oldSerialNo || '').trim() |
|
|
|
this.coreComponentData.newSerialNo = (this.coreComponentData.newSerialNo || '').trim() |
|
|
|
if (this.coreComponentData.oldSerialNo === '' || this.coreComponentData.oldSerialNo == null) { |
|
|
|
this.$message.warning('请填写老序列号!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.coreComponentData.newSerialNo === '' || this.coreComponentData.newSerialNo == null) { |
|
|
|
this.$message.warning('请填写新序列号!') |
|
|
|
return |
|
|
|
} |
|
|
|
const controlFlag = await this.checkCoreSerialControlFlag() |
|
|
|
if (controlFlag) { |
|
|
|
const serialCheckFlag = await this.checkCoreSerialCanOnMachine() |
|
|
|
if (!serialCheckFlag) { |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
saveCoreComponent(this.coreComponentData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.getCorePartSpareList() |
|
|
|
|