|
|
|
@ -4,7 +4,8 @@ import { |
|
|
|
saveTestSoBom, |
|
|
|
removeTestSoBom, |
|
|
|
updateTestSoBom, |
|
|
|
removeBatchTestSoBom |
|
|
|
removeBatchTestSoBom, |
|
|
|
saveBatchTestSoBom |
|
|
|
} from "../../../../api/test/testSoBom"; |
|
|
|
import {updateMaterialTotalAmount} from "../../../../api/test/testInformation"; |
|
|
|
import {searchPart, searchPartList} from '@/api/part/partInformation.js'; |
|
|
|
@ -12,6 +13,7 @@ import numberInput from "../../common/numberInput.vue"; |
|
|
|
import {searchAllUmInformationList} from "../../../../api/part/umInformation"; |
|
|
|
import {Decimal} from "decimal.js"; |
|
|
|
import {queryPart, onlyQueryPartUnitCostList} from "../../../../api/part/partInformation"; |
|
|
|
import {bomManagementSearch, queryBomDetail, queryBomComponent} from "../../../../api/part/bomManagement"; |
|
|
|
export default { |
|
|
|
name: "testTable", |
|
|
|
components:{ |
|
|
|
@ -55,6 +57,7 @@ export default { |
|
|
|
site:this.$store.state.user.site |
|
|
|
}, |
|
|
|
partDialogFlag:false, |
|
|
|
_partSelectContext: 'sobom', // 'sobom' | 'bomImport' |
|
|
|
testSoBomLabel:{ |
|
|
|
componentPartNo: "物料编码", |
|
|
|
partDesc:"物料名称", |
|
|
|
@ -391,7 +394,19 @@ export default { |
|
|
|
no:1, |
|
|
|
size:20, |
|
|
|
total:0, |
|
|
|
queryLoading:false |
|
|
|
queryLoading:false, |
|
|
|
|
|
|
|
// BOM导入相关 |
|
|
|
bomImportDialogFlag: false, |
|
|
|
bomImportLoading: false, |
|
|
|
bomSearchPartNo: '', |
|
|
|
bomHeaderList: [], |
|
|
|
bomHeaderSelection: [], |
|
|
|
bomAlternativeList: [], |
|
|
|
bomAlternativeSelection: [], |
|
|
|
bomComponentTableList: [], |
|
|
|
bomComponentLoading: false, |
|
|
|
bomSaveLoading: false, |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
@ -410,10 +425,17 @@ export default { |
|
|
|
this.partList = []; |
|
|
|
}, |
|
|
|
openPartDialog(){ |
|
|
|
this._partSelectContext = 'sobom'; |
|
|
|
this.partDialogFlag = true; |
|
|
|
this.partData.partNo = this.testSoBom.componentPartNo |
|
|
|
this.initPartList(); |
|
|
|
}, |
|
|
|
openPartDialogForBomImport(){ |
|
|
|
this._partSelectContext = 'bomImport'; |
|
|
|
this.partDialogFlag = true; |
|
|
|
this.partData.partNo = ''; |
|
|
|
this.initPartList(); |
|
|
|
}, |
|
|
|
initPartList(){ |
|
|
|
let params = { |
|
|
|
...this.partData, |
|
|
|
@ -432,6 +454,14 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
dblClickPartTable(row){ |
|
|
|
// BOM导入弹框中选料:填入料号并自动查询 |
|
|
|
if (this._partSelectContext === 'bomImport') { |
|
|
|
this.bomSearchPartNo = row.partNo; |
|
|
|
this.partDialogFlag = false; |
|
|
|
this._partSelectContext = 'sobom'; |
|
|
|
this.$nextTick(() => this.queryBomHeaders()); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (row.status === 'Y'){ |
|
|
|
let params = { |
|
|
|
site:row.site, |
|
|
|
@ -673,6 +703,277 @@ export default { |
|
|
|
this.no = val |
|
|
|
this.initPartList() |
|
|
|
}, |
|
|
|
// ============ BOM导入相关方法 ============ |
|
|
|
openBomImportDialog() { |
|
|
|
this.bomImportDialogFlag = true; |
|
|
|
this.bomSearchPartNo = ''; |
|
|
|
this.bomHeaderList = []; |
|
|
|
this.bomHeaderSelection = []; |
|
|
|
this.bomAlternativeList = []; |
|
|
|
this.bomAlternativeSelection = []; |
|
|
|
this.bomComponentTableList = []; |
|
|
|
}, |
|
|
|
closeBomImportDialog() { |
|
|
|
this.bomImportDialogFlag = false; |
|
|
|
}, |
|
|
|
// Step1: 查询BOM版本列表 |
|
|
|
async queryBomHeaders() { |
|
|
|
if (!this.bomSearchPartNo || !this.bomSearchPartNo.trim()) { |
|
|
|
this.$message.warning('请输入料号'); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.bomImportLoading = true; |
|
|
|
try { |
|
|
|
const { data } = await bomManagementSearch({ |
|
|
|
plmPartNo: this.bomSearchPartNo.trim().toUpperCase(), |
|
|
|
site: this.$store.state.user.site, |
|
|
|
page: 1, |
|
|
|
limit: 200 |
|
|
|
}); |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.bomHeaderList = (data.page ? data.page.list : []).filter( |
|
|
|
item => !item.effPhaseOutDate |
|
|
|
); |
|
|
|
this.bomHeaderSelection = []; |
|
|
|
this.bomAlternativeList = []; |
|
|
|
this.bomAlternativeSelection = []; |
|
|
|
this.bomComponentTableList = []; |
|
|
|
if (this.bomHeaderList.length === 0) { |
|
|
|
this.$message.warning('未查询到BOM信息,请确认料号是否正确'); |
|
|
|
} else if (this.bomHeaderList.length === 1) { |
|
|
|
// 只有一条版本时,自动勾选并触发替代编码加载 |
|
|
|
this.$nextTick(() => { |
|
|
|
if (this.$refs.bomHeaderTable) { |
|
|
|
this.$refs.bomHeaderTable.toggleRowSelection(this.bomHeaderList[0], true); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.warning(data && data.msg ? data.msg : '查询失败'); |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
this.$message.error('查询BOM失败'); |
|
|
|
} |
|
|
|
this.bomImportLoading = false; |
|
|
|
}, |
|
|
|
// Step2: 加载所选版本的替代编码 |
|
|
|
async loadBomAlternatives() { |
|
|
|
if (this.bomHeaderSelection.length === 0) { |
|
|
|
this.$message.warning('请先选择BOM版本'); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.bomImportLoading = true; |
|
|
|
const alternativeMap = new Map(); |
|
|
|
try { |
|
|
|
for (const header of this.bomHeaderSelection) { |
|
|
|
const { data } = await queryBomDetail({ |
|
|
|
site: this.$store.state.user.site, |
|
|
|
partNo: header.partNo, |
|
|
|
engChgLevel: header.engChgLevel, |
|
|
|
bomType: header.bomType |
|
|
|
}); |
|
|
|
if (data && data.code === 0 && data.rows && data.rows.detailList) { |
|
|
|
data.rows.detailList.forEach(alt => { |
|
|
|
const key = `${alt.partNo}-${alt.engChgLevel}-${alt.bomType}-${alt.alternativeNo}`; |
|
|
|
if (!alternativeMap.has(key)) { |
|
|
|
alternativeMap.set(key, alt); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
this.bomAlternativeList = [...alternativeMap.values()]; |
|
|
|
this.bomAlternativeSelection = []; |
|
|
|
this.bomComponentTableList = []; |
|
|
|
// 只有一条替代编码时,自动勾选并触发子物料加载 |
|
|
|
if (this.bomAlternativeList.length === 1) { |
|
|
|
this.$nextTick(() => { |
|
|
|
if (this.$refs.bomAlternativeTable) { |
|
|
|
this.$refs.bomAlternativeTable.toggleRowSelection(this.bomAlternativeList[0], true); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
this.$message.error('加载替代编码失败'); |
|
|
|
} |
|
|
|
this.bomImportLoading = false; |
|
|
|
}, |
|
|
|
// Step3: 加载所选替代编码的子物料 |
|
|
|
async loadBomComponents() { |
|
|
|
if (this.bomAlternativeSelection.length === 0) { |
|
|
|
this.$message.warning('请先选择替代编码'); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.bomComponentLoading = true; |
|
|
|
const componentMap = new Map(); |
|
|
|
try { |
|
|
|
for (const alt of this.bomAlternativeSelection) { |
|
|
|
const { data } = await queryBomComponent({ |
|
|
|
site: this.$store.state.user.site, |
|
|
|
partNo: alt.partNo, |
|
|
|
engChgLevel: alt.engChgLevel, |
|
|
|
bomType: alt.bomType, |
|
|
|
alternativeNo: alt.alternativeNo |
|
|
|
}); |
|
|
|
if (data && data.code === 0 && data.rows && data.rows.subDetailList) { |
|
|
|
data.rows.subDetailList.forEach(comp => { |
|
|
|
if (!componentMap.has(comp.componentPart)) { |
|
|
|
const qtyPerAssembly = Number(comp.qtyPerAssembly) || 0; |
|
|
|
const preRequiredQty = this.testNumber |
|
|
|
? new Decimal(this.testNumber).mul(new Decimal(qtyPerAssembly)).toNumber() |
|
|
|
: 0; |
|
|
|
//const headerUnit = this.bomHeaderList.length > 0 ? (this.bomHeaderList[0].printUnit || '') : ''; |
|
|
|
componentMap.set(comp.componentPart, { |
|
|
|
componentPartNo: comp.componentPart, |
|
|
|
partDesc: comp.componentPartDesc || '', |
|
|
|
umId: comp.printUnit || '', |
|
|
|
assemblyQty: qtyPerAssembly, |
|
|
|
fixedScrapQty: Number(comp.componentScrap) || 0, |
|
|
|
scrapFactor: Number(comp.shrinkageFactor) || 0, |
|
|
|
requiredQty: '', |
|
|
|
unitCost: '', |
|
|
|
totalCost: 0, |
|
|
|
remark: '', |
|
|
|
_status: 'N', |
|
|
|
_costLoading: false |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
this.bomComponentTableList = [...componentMap.values()]; |
|
|
|
if (this.bomComponentTableList.length === 0) { |
|
|
|
this.$message.warning('所选版本和替代编码下暂无子物料'); |
|
|
|
} else { |
|
|
|
await this.enrichBomComponentsCost(); |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
this.$message.error('加载子物料失败'); |
|
|
|
} |
|
|
|
this.bomComponentLoading = false; |
|
|
|
}, |
|
|
|
// 查询各子物料的状态和成本信息(正式料号自动获取成本) |
|
|
|
async enrichBomComponentsCost() { |
|
|
|
const promises = this.bomComponentTableList.map(async (comp) => { |
|
|
|
try { |
|
|
|
const { data } = await queryPart({ |
|
|
|
site: this.$store.state.user.site, |
|
|
|
partNo: comp.componentPartNo |
|
|
|
}); |
|
|
|
if (data && data.code === 0 && data.rows && data.rows.length > 0) { |
|
|
|
const partInfo = data.rows[0]; |
|
|
|
comp._status = partInfo.status || 'N'; |
|
|
|
if (partInfo.status === 'Y') { |
|
|
|
// 正式料号,自动获取成本 |
|
|
|
const { data: costData } = await onlyQueryPartUnitCostList({ |
|
|
|
site: this.$store.state.user.site, |
|
|
|
partNo: comp.componentPartNo, |
|
|
|
configurationId: partInfo.configurationId, |
|
|
|
userName: this.$store.state.user.name |
|
|
|
}); |
|
|
|
if (costData && costData.code === 0 && costData.rows && costData.rows.length === 1) { |
|
|
|
comp.unitCost = parseFloat(costData.rows[0].inventoryValue) || 0; |
|
|
|
comp.totalCost = new Decimal(comp.requiredQty).mul(new Decimal(comp.unitCost)).toNumber(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
// 忽略单个物料查询错误 |
|
|
|
} |
|
|
|
}); |
|
|
|
await Promise.all(promises); |
|
|
|
this.$set(this, 'bomComponentTableList', [...this.bomComponentTableList]); |
|
|
|
}, |
|
|
|
// 需求数量变化时重新计算总价 |
|
|
|
onBomComponentRequiredQtyChange(row) { |
|
|
|
const requiredQty = Number(row.requiredQty) || 0; |
|
|
|
if (this.testNumber && this.testNumber > 0) { |
|
|
|
row.assemblyQty = new Decimal(requiredQty).div(new Decimal(this.testNumber)).toNumber(); |
|
|
|
} |
|
|
|
row.totalCost = new Decimal(requiredQty).mul(new Decimal(row.unitCost || 0)).toNumber(); |
|
|
|
}, |
|
|
|
// 单价变化时重新计算总价(仅非正式料号可手动输入) |
|
|
|
onBomComponentUnitCostChange(row) { |
|
|
|
row.totalCost = new Decimal(row.requiredQty || 0).mul(new Decimal(row.unitCost || 0)).toNumber(); |
|
|
|
}, |
|
|
|
// 删除预览行 |
|
|
|
removeBomComponentRow(row) { |
|
|
|
const idx = this.bomComponentTableList.indexOf(row); |
|
|
|
if (idx > -1) this.bomComponentTableList.splice(idx, 1); |
|
|
|
}, |
|
|
|
// 确认保存BOM导入 |
|
|
|
async saveBomImport() { |
|
|
|
if (this.bomComponentTableList.length === 0) { |
|
|
|
this.$message.warning('请先加载子物料'); |
|
|
|
return; |
|
|
|
} |
|
|
|
const saveList = this.bomComponentTableList.map(comp => ({ |
|
|
|
site: this.$store.state.user.site, |
|
|
|
testNo: this.testNo, |
|
|
|
componentPartNo: comp.componentPartNo, |
|
|
|
assemblyQty: comp.assemblyQty || 0, |
|
|
|
fixedScrapQty: comp.fixedScrapQty || 0, |
|
|
|
scrapFactor: comp.scrapFactor || 0, |
|
|
|
requiredQty: comp.requiredQty || 0, |
|
|
|
reserveQty: 0, |
|
|
|
rmTypeDb: 0, |
|
|
|
unitCost: comp.unitCost || 0, |
|
|
|
totalCost: comp.totalCost || 0, |
|
|
|
remark: comp.remark || '' |
|
|
|
})); |
|
|
|
this.bomSaveLoading = true; |
|
|
|
try { |
|
|
|
const { data } = await saveBatchTestSoBom(saveList); |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('BOM导入成功'); |
|
|
|
this.bomImportDialogFlag = false; |
|
|
|
this.selectTestSoBom(); |
|
|
|
} else { |
|
|
|
this.$message.error(data && data.msg ? data.msg : '导入失败'); |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
this.$message.error('导入失败,请重试'); |
|
|
|
} |
|
|
|
this.bomSaveLoading = false; |
|
|
|
}, |
|
|
|
// 格式化小数显示,避免科学计数法 |
|
|
|
formatDecimal(val) { |
|
|
|
if (val === null || val === undefined || val === '') return '0'; |
|
|
|
const num = Number(val); |
|
|
|
if (isNaN(num) || num === 0) return '0'; |
|
|
|
const str = num.toString(); |
|
|
|
if (!str.includes('e') && !str.includes('E')) { |
|
|
|
// 普通小数,去除多余的尾部零(最多保留10位) |
|
|
|
return parseFloat(num.toFixed(10)).toString(); |
|
|
|
} |
|
|
|
// 科学计数法转为普通小数,最多20位有效数字后去尾零 |
|
|
|
return num.toFixed(20).replace(/\.?0+$/, ''); |
|
|
|
}, |
|
|
|
// BOM版本勾选变化 → 防抖自动加载替代编码 |
|
|
|
onBomHeaderSelectionChange(rows) { |
|
|
|
this.bomHeaderSelection = rows; |
|
|
|
this.bomAlternativeList = []; |
|
|
|
this.bomAlternativeSelection = []; |
|
|
|
this.bomComponentTableList = []; |
|
|
|
if (this._headerSelectTimer) clearTimeout(this._headerSelectTimer); |
|
|
|
if (rows.length > 0) { |
|
|
|
this._headerSelectTimer = setTimeout(() => { |
|
|
|
this.loadBomAlternatives(); |
|
|
|
}, 400); |
|
|
|
} |
|
|
|
}, |
|
|
|
// 替代编码勾选变化 → 防抖自动加载子物料 |
|
|
|
onBomAlternativeSelectionChange(rows) { |
|
|
|
this.bomAlternativeSelection = rows; |
|
|
|
this.bomComponentTableList = []; |
|
|
|
if (this._altSelectTimer) clearTimeout(this._altSelectTimer); |
|
|
|
if (rows.length > 0) { |
|
|
|
this._altSelectTimer = setTimeout(() => { |
|
|
|
this.loadBomComponents(); |
|
|
|
}, 400); |
|
|
|
} |
|
|
|
}, |
|
|
|
// ============ BOM导入相关方法结束 ============ |
|
|
|
|
|
|
|
// 更新测试主信息的材料总金额 |
|
|
|
updateTestMaterialTotalAmount(){ |
|
|
|
if (!this.testNo) { |
|
|
|
@ -730,6 +1031,7 @@ export default { |
|
|
|
<template v-if="isAuth('107001:tab3:remove')"> |
|
|
|
<el-button type="primary" v-if="!disabled" @click="removeBatchTestSoBom">删除</el-button> |
|
|
|
</template> |
|
|
|
<el-button type="primary" v-if="!disabled" @click="openBomImportDialog">BOM导入</el-button> |
|
|
|
</div> |
|
|
|
<el-table |
|
|
|
:height="height" border |
|
|
|
@ -821,6 +1123,141 @@ export default { |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- BOM导入弹框 --> |
|
|
|
<el-dialog |
|
|
|
title="BOM导入" |
|
|
|
width="1200px" |
|
|
|
append-to-body |
|
|
|
:close-on-click-modal="false" |
|
|
|
v-drag |
|
|
|
:visible.sync="bomImportDialogFlag" |
|
|
|
@close="closeBomImportDialog"> |
|
|
|
<!-- 第一步:查询料号 --> |
|
|
|
<el-row :gutter="10" style="margin-bottom: 10px;"> |
|
|
|
<el-col :span="24"> |
|
|
|
<span style="font-weight: bold; margin-right: 10px;" @click="openPartDialogForBomImport"><a>物料编码</a></span> |
|
|
|
<el-input |
|
|
|
v-model="bomSearchPartNo" |
|
|
|
placeholder="请输入PLM物料编码" |
|
|
|
style="width: 220px; margin-right: 8px;" |
|
|
|
@keyup.enter.native="queryBomHeaders" |
|
|
|
clearable> |
|
|
|
</el-input> |
|
|
|
<el-button type="primary" :loading="bomImportLoading" @click="queryBomHeaders">查询</el-button> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<!-- 第二步:选择版本和替代编码 --> |
|
|
|
<el-row :gutter="12" style="margin-bottom: 10px;"> |
|
|
|
<!-- BOM版本 --> |
|
|
|
<el-col :span="12"> |
|
|
|
<div style="margin-bottom: 6px;"> |
|
|
|
<span style="font-weight: bold;">选择BOM版本</span> |
|
|
|
<span style="color: #909399; font-size: 12px; margin-left: 6px;">(勾选后自动加载替代编码)</span> |
|
|
|
<el-tag v-if="bomImportLoading" size="mini" type="info" style="margin-left: 8px;">加载中...</el-tag> |
|
|
|
</div> |
|
|
|
<el-table |
|
|
|
:data="bomHeaderList" |
|
|
|
border |
|
|
|
height="180px" |
|
|
|
ref="bomHeaderTable" |
|
|
|
@selection-change="onBomHeaderSelectionChange" |
|
|
|
style="width: 100%;"> |
|
|
|
<el-table-column type="selection" width="45" align="center"></el-table-column> |
|
|
|
<el-table-column label="BOM版本" prop="engChgLevel" align="center" width="80"></el-table-column> |
|
|
|
<el-table-column label="制造类型" prop="bomType" align="center" min-width="110"></el-table-column> |
|
|
|
<el-table-column label="生效日期" prop="effPhaseInDate" align="center" min-width="100"></el-table-column> |
|
|
|
<el-table-column label="失效日期" prop="effPhaseOutDate" align="center" min-width="100"></el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<!-- 替代编码 --> |
|
|
|
<el-col :span="12"> |
|
|
|
<div style="margin-bottom: 6px;"> |
|
|
|
<span style="font-weight: bold;">选择替代编码</span> |
|
|
|
<span style="color: #909399; font-size: 12px; margin-left: 6px;">(勾选后自动加载子物料)</span> |
|
|
|
<el-tag v-if="bomComponentLoading" size="mini" type="info" style="margin-left: 8px;">加载中...</el-tag> |
|
|
|
</div> |
|
|
|
<el-table |
|
|
|
:data="bomAlternativeList" |
|
|
|
border |
|
|
|
height="180px" |
|
|
|
ref="bomAlternativeTable" |
|
|
|
@selection-change="onBomAlternativeSelectionChange" |
|
|
|
style="width: 100%;"> |
|
|
|
<el-table-column type="selection" width="45" align="center"></el-table-column> |
|
|
|
<el-table-column label="替代编码" prop="alternativeNo" align="center" width="90"></el-table-column> |
|
|
|
<el-table-column label="替代名称" prop="alternativeDescription" align="left" min-width="120" show-overflow-tooltip></el-table-column> |
|
|
|
<el-table-column label="状态" prop="status" align="center" width="100"></el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<!-- 第四步:子物料清单(可编辑) --> |
|
|
|
<div style="margin-bottom: 6px;"> |
|
|
|
<span style="font-weight: bold;">填写需求数量和备注后点击保存</span> |
|
|
|
<span style="color: #909399; font-size: 12px; margin-left: 10px;"> |
|
|
|
(共 {{bomComponentTableList.length}} 条;正式料号成本自动获取不可修改;可删除不需要的行) |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
<el-table |
|
|
|
:data="bomComponentTableList" |
|
|
|
border |
|
|
|
height="280px" |
|
|
|
v-loading="bomComponentLoading" |
|
|
|
class="bom-import-table" |
|
|
|
style="width: 100%;"> |
|
|
|
<el-table-column label="物料编码" prop="componentPartNo" align="left" min-width="120" show-overflow-tooltip></el-table-column> |
|
|
|
<el-table-column label="物料名称" prop="partDesc" align="left" min-width="160" show-overflow-tooltip></el-table-column> |
|
|
|
<el-table-column label="单位" prop="umId" align="center" width="60"></el-table-column> |
|
|
|
<el-table-column label="需求数量*" align="center" width="155"> |
|
|
|
<template slot-scope="{row}"> |
|
|
|
<el-input |
|
|
|
v-model="row.requiredQty" |
|
|
|
style="width: 140px;" |
|
|
|
@change="onBomComponentRequiredQtyChange(row)"> |
|
|
|
</el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="单价" align="center" width="140"> |
|
|
|
<template slot-scope="{row}"> |
|
|
|
<el-input |
|
|
|
v-model="row.unitCost" |
|
|
|
:disabled="row._status === 'Y' && row.unitCost !== ''" |
|
|
|
:formatter="val => formatDecimal(val)" |
|
|
|
:parser="val => (val === '' || val === undefined) ? 0 : Number(val)" |
|
|
|
style="width: 125px;" |
|
|
|
@change="onBomComponentUnitCostChange(row)"> |
|
|
|
</el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="总价" align="right" width="110"> |
|
|
|
<template slot-scope="{row}"> |
|
|
|
<span :title="String(row.totalCost)">{{formatDecimal(row.totalCost)}}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="备注" align="left" min-width="130"> |
|
|
|
<template slot-scope="{row}"> |
|
|
|
<el-input v-model="row.remark" placeholder="备注" size="mini"></el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" align="center" width="60" fixed="right"> |
|
|
|
<template slot-scope="{row}"> |
|
|
|
<a style="color: #F56C6C;" @click="removeBomComponentRow(row)">删除</a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
:loading="bomSaveLoading" |
|
|
|
:disabled="bomComponentTableList.length === 0" |
|
|
|
@click="saveBomImport">保 存</el-button> |
|
|
|
<el-button @click="bomImportDialogFlag = false">取 消</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog title="物料信息" width="800px" append-to-body :close-on-click-modal="false" v-drag :visible.sync="partDialogFlag"> |
|
|
|
<!--搜索条件--> |
|
|
|
<el-form :model="partData" ref="partDataForm" style="width: 600px;" label-position="top"> |
|
|
|
@ -873,9 +1310,20 @@ export default { |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<style scoped> |
|
|
|
<style lang="scss"> |
|
|
|
.el-input-number /deep/ .el-input__inner{ |
|
|
|
text-align: right; |
|
|
|
padding-right: 5px !important; |
|
|
|
} |
|
|
|
.bom-import-table .el-input-number /deep/ .el-input__inner { |
|
|
|
text-align: right; |
|
|
|
padding-left: 4px !important; |
|
|
|
padding-right: 4px !important; |
|
|
|
} |
|
|
|
|
|
|
|
.bom-import-table .cell { |
|
|
|
line-height: 24px; |
|
|
|
font-size: 12px; |
|
|
|
height: 24px; |
|
|
|
} |
|
|
|
</style> |