|
|
|
@ -75,43 +75,6 @@ |
|
|
|
<el-input type="textarea" v-model="modalData.noteText" :rows="3" resize='none' show-word-limit style="width: 885px;height: 20px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<!-- <el-tabs v-model="detailTable" style="margin-top: 50px; width: 100%; min-height: 120px" type="border-card" class="detail-tab">--> |
|
|
|
<!-- <!– BOM明细信息页签 –>--> |
|
|
|
<!-- <el-tab-pane label="Product Structure" name="bom_detail">--> |
|
|
|
<!-- <el-form label-position="top" style="margin-top: -10px">--> |
|
|
|
<!-- <el-form-item>--> |
|
|
|
<!-- <el-button type="primary" :loading="alternativeLoading" @click="updateBomDetail" style="margin-left: 7px">编辑</el-button>--> |
|
|
|
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
<!-- </el-form>--> |
|
|
|
<!-- <el-form :inline="true" label-position="top" :model="detailData" :rules="rules" style="margin-left: 7px">--> |
|
|
|
<!-- <el-form-item :label="'替代编码'">--> |
|
|
|
<!-- <el-select v-model="detailData.alternativeNo" @change="alternativeChange" style="width: 165px">--> |
|
|
|
<!-- <el-option--> |
|
|
|
<!-- v-for = "(i, index) in detailDataList"--> |
|
|
|
<!-- :key = "index"--> |
|
|
|
<!-- :label = "i.alternativeNo"--> |
|
|
|
<!-- :value = "i.alternativeNo">--> |
|
|
|
<!-- </el-option>--> |
|
|
|
<!-- </el-select>--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
<!-- <el-form-item :label="'替代名称'">--> |
|
|
|
<!-- <el-input v-model="detailData.alternativeDescription" readonly style="width: 300px"></el-input>--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
<!-- <el-form-item :label="'状态'">--> |
|
|
|
<!-- <el-input v-model="detailData.status" readonly style="width: 150px"></el-input>--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
<!-- <el-form-item :label="'最小订单数'">--> |
|
|
|
<!-- <el-input class="inlineNumber numInput" v-model="detailData.minLotQty" readonly type="number" style="width: 100px"></el-input>--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
<!-- </el-form>--> |
|
|
|
<!-- <el-form :inline="true" label-position="top" :model="detailData" style="margin-left: 7px">--> |
|
|
|
<!-- <el-form-item label="备注">--> |
|
|
|
<!-- <el-input type="textarea" v-model="detailData.detailNoteText" :rows="3" resize='none' show-word-limit readonly style="width: 885px;height: 20px"></el-input>--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
<!-- </el-form>--> |
|
|
|
<!-- </el-tab-pane>--> |
|
|
|
<!-- </el-tabs>--> |
|
|
|
<el-tabs v-model="subDetailTable" style="margin-top: 50px; width: 100%; min-height: 350px" type="border-card" @tab-click="queryBomComponentTable" class="sub_detail-tab"> |
|
|
|
<!-- BOM子明细信息页签 --> |
|
|
|
<el-tab-pane label="Components" name="bom_sub_detail"> |
|
|
|
@ -422,93 +385,6 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- <el-container>--> |
|
|
|
<!-- <el-main style="width: 770px; padding: 1px">--> |
|
|
|
<!-- <span style="font-size: 12px" >可选物料</span>--> |
|
|
|
<!-- <el-table--> |
|
|
|
<!-- height="400px"--> |
|
|
|
<!-- :data="batchComponentPartList"--> |
|
|
|
<!-- border--> |
|
|
|
<!-- ref="batchSaveTable"--> |
|
|
|
<!-- @row-dblclick="batchAddPartDB"--> |
|
|
|
<!-- @selection-change="selectionSaveComponent"--> |
|
|
|
<!-- highlight-current-row--> |
|
|
|
<!-- style="width: 100%">--> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- type="selection"--> |
|
|
|
<!-- header-align="center"--> |
|
|
|
<!-- align="center"--> |
|
|
|
<!-- width="50">--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- v-for="(item,index) in componentPartColumnList" :key="index"--> |
|
|
|
<!-- :sortable="item.columnSortable"--> |
|
|
|
<!-- :prop="item.columnProp"--> |
|
|
|
<!-- :header-align="item.headerAlign"--> |
|
|
|
<!-- :show-overflow-tooltip="item.showOverflowTooltip"--> |
|
|
|
<!-- :align="item.align"--> |
|
|
|
<!-- :fixed="item.fixed==''?false:item.fixed"--> |
|
|
|
<!-- :min-width="item.columnWidth"--> |
|
|
|
<!-- :label="item.columnLabel">--> |
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
<!-- <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>--> |
|
|
|
<!-- <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<!-- </el-table>--> |
|
|
|
<!-- <!– 分页插件 –>--> |
|
|
|
<!-- <el-pagination--> |
|
|
|
<!-- @size-change="sizeChangeHandle5"--> |
|
|
|
<!-- @current-change="currentChangeHandle5"--> |
|
|
|
<!-- :current-page="pageIndex5"--> |
|
|
|
<!-- :page-sizes="[20, 50, 100, 200, 500]"--> |
|
|
|
<!-- :page-size="pageSize5"--> |
|
|
|
<!-- :total="totalPage5"--> |
|
|
|
<!-- layout="total, sizes, prev, pager, next, jumper">--> |
|
|
|
<!-- </el-pagination>--> |
|
|
|
<!-- </el-main>--> |
|
|
|
<!-- <el-main style="width: 111px;padding: -1px">--> |
|
|
|
<!-- <div style="margin-top: 182px;margin-left: 5px">--> |
|
|
|
<!-- <el-button type="primary" @click="batchAddPart">添加>></el-button>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- <div style="margin-top: 15px;margin-left: 5px">--> |
|
|
|
<!-- <el-button type="primary" @click="batchDeletePart">删除<<</el-button>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- </el-main>--> |
|
|
|
<!-- <el-main style="width: 400px;padding: 1px">--> |
|
|
|
<!-- <span style="font-size: 12px" >已选物料</span>--> |
|
|
|
<!-- <el-table--> |
|
|
|
<!-- height="400px"--> |
|
|
|
<!-- :data="choosePartList"--> |
|
|
|
<!-- border--> |
|
|
|
<!-- ref="batchSaveTable2"--> |
|
|
|
<!-- @row-dblclick="batchDeletePartDB"--> |
|
|
|
<!-- @selection-change="selectionSaveComponent2"--> |
|
|
|
<!-- highlight-current-row--> |
|
|
|
<!-- style="width: 100%">--> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- type="selection"--> |
|
|
|
<!-- header-align="center"--> |
|
|
|
<!-- align="center"--> |
|
|
|
<!-- width="50">--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- prop="partNo"--> |
|
|
|
<!-- header-align="center"--> |
|
|
|
<!-- align="center"--> |
|
|
|
<!-- min-width="100"--> |
|
|
|
<!-- label="物料编码">--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- prop="partDesc"--> |
|
|
|
<!-- header-align="center"--> |
|
|
|
<!-- align="center"--> |
|
|
|
<!-- min-width="190"--> |
|
|
|
<!-- label="物料名称">--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<!-- </el-table>--> |
|
|
|
<!-- </el-main>--> |
|
|
|
<!-- </el-container>--> |
|
|
|
<div style="display: flex; flex-direction: column; width: 100%;"> |
|
|
|
<!-- 可选物料 --> |
|
|
|
<div style="flex: 1; padding: 1px;"> |
|
|
|
@ -851,12 +727,12 @@ |
|
|
|
<el-dialog title="复制BOM物料" top="17vh" :close-on-click-modal="false" v-drag :visible.sync="copyBomDialogFlag" width="1200px"> |
|
|
|
<el-form :inline="true" label-position="top" :model="copyBomSearchData"> |
|
|
|
<el-form-item :label="'BU'"> |
|
|
|
<el-select v-model="copyBomSearchData.buNo" placeholder="请选择" clearable style="width: 90px"> |
|
|
|
<el-select v-model="copyBomSearchData.buDesc" placeholder="请选择" clearable style="width: 90px"> |
|
|
|
<el-option |
|
|
|
v-for = "i in copyBomSearchData" |
|
|
|
v-for = "i in userBuList" |
|
|
|
:key = "i.buNo" |
|
|
|
:label = "i.buDesc" |
|
|
|
:value = "i.buNo"> |
|
|
|
:value = "i.buDesc"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
@ -884,7 +760,7 @@ |
|
|
|
<el-table |
|
|
|
:height="200" |
|
|
|
:data="copyBomDataList" |
|
|
|
border |
|
|
|
border highlight-current-row |
|
|
|
ref="bomHeaderTable" |
|
|
|
@row-click="headerClickRow" |
|
|
|
v-loading="copyBomQueryLoading" |
|
|
|
@ -984,6 +860,7 @@ import {Decimal} from "decimal.js" |
|
|
|
import BomComponentUpload from "./bom_component_upload.vue" |
|
|
|
import {partFamilyInformationSearch} from "../../../api/part/partFamilyInformation"; |
|
|
|
import {bomSearchHeader, getComponentPartList} from "../../../api/part/bomSearch3"; |
|
|
|
import {getSiteAndBuByUserName} from "@/api/eam/eam.js" |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
BomComponentUpload, |
|
|
|
@ -1081,6 +958,7 @@ export default { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
userBuList: [], |
|
|
|
// 初始页签 |
|
|
|
detailTable: 'bom_detail', |
|
|
|
subDetailTable: 'bom_sub_detail', |
|
|
|
@ -2684,6 +2562,10 @@ export default { |
|
|
|
unitConversionFamily: ['RFID018', 'RFID019'], |
|
|
|
} |
|
|
|
}, |
|
|
|
created () { |
|
|
|
// 获取用户的 site 和 bu |
|
|
|
this.getSiteAndBuByUserName() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 初始化组件的参数 |
|
|
|
async init (tempData) { |
|
|
|
@ -2742,6 +2624,18 @@ export default { |
|
|
|
this.queryBatchComponentPartList() |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取用户的bu |
|
|
|
getSiteAndBuByUserName () { |
|
|
|
let tempData = { |
|
|
|
username: this.$store.state.user.name, |
|
|
|
} |
|
|
|
getSiteAndBuByUserName(tempData).then(({data}) => { |
|
|
|
if (data.code === 0) { |
|
|
|
this.userBuList = data.rows |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// bom新增模态框 |
|
|
|
addModal (row) { |
|
|
|
this.modalData = { |
|
|
|
@ -4111,6 +4005,10 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
copyBomPart() { |
|
|
|
if (!this.modalData.partNo) { |
|
|
|
this.$message.warning('请选择节点!') |
|
|
|
return |
|
|
|
} |
|
|
|
this.copyBomSearchData = { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
buNo: '', |
|
|
|
@ -4174,44 +4072,54 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
copyBomSave() { |
|
|
|
console.log(this.copyBomSelections) |
|
|
|
if (this.copyBomSelections === null || this.copyBomSelections.length === 0) { |
|
|
|
this.$message.warning('请选择可选物料!') |
|
|
|
return |
|
|
|
} |
|
|
|
this.$confirm("是否确认添加该"+ this.copyBomSelections.length +"条子件记录?", "提示", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning" |
|
|
|
}).then(() => { |
|
|
|
let tempData = { |
|
|
|
site: this.modalData.site, |
|
|
|
buNo: this.modalData.buNo, |
|
|
|
partNo: this.modalData.partNo, |
|
|
|
engChgLevel: this.modalData.engChgLevel, |
|
|
|
bomType: this.modalData.bomType, |
|
|
|
alternativeNo: this.detailData.alternativeNo, |
|
|
|
consumptionItem: 'Consumed', |
|
|
|
qtyPerAssembly: 0, |
|
|
|
componentScrap: 0, |
|
|
|
shrinkageFactor: '', |
|
|
|
lineItemNo: '', |
|
|
|
operationId: '', |
|
|
|
operationNo: '', |
|
|
|
issueToLoc: '', |
|
|
|
issueToLocName: '', |
|
|
|
noteText: '', |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
lineSequence: '', |
|
|
|
issueType: 'Reserve And Backflush', |
|
|
|
productFlag: 'component', |
|
|
|
batchSaveList: this.copyBomSelections |
|
|
|
} |
|
|
|
|
|
|
|
// 转换数据结构:将 componentPart 映射到 partNo,因为后端使用 entity.getPartNo() 作为子件编码 |
|
|
|
const convertedSelections = this.copyBomSelections.map(item => { |
|
|
|
return { |
|
|
|
partNo: item.componentPart, // 子件编码(关键:后端使用这个字段作为子件) |
|
|
|
printUnit: item.printUnit || '', |
|
|
|
componentPart: item.componentPart, |
|
|
|
componentPartDesc: item.componentPartDesc || '', |
|
|
|
qtyPerAssembly: item.qtyPerAssembly || 0 // 单位用量 |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
this.$confirm("是否确认添加该"+ this.copyBomSelections.length +"条子件记录?", "提示", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning" |
|
|
|
}).then(() => { |
|
|
|
let tempData = { |
|
|
|
site: this.modalData.site, |
|
|
|
buNo: this.modalData.buNo, |
|
|
|
partNo: this.modalData.partNo, |
|
|
|
engChgLevel: this.modalData.engChgLevel, |
|
|
|
bomType: this.modalData.bomType, |
|
|
|
alternativeNo: this.detailData.alternativeNo, |
|
|
|
consumptionItem: 'Consumed', |
|
|
|
qtyPerAssembly: 0, |
|
|
|
componentScrap: 0, |
|
|
|
shrinkageFactor: this.modalData.shrinkageFactor || '', // 使用头部的损耗率 |
|
|
|
lineItemNo: '', |
|
|
|
operationId: '', |
|
|
|
operationNo: '', |
|
|
|
issueToLoc: '', |
|
|
|
issueToLocName: '', |
|
|
|
noteText: '', |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
lineSequence: '', |
|
|
|
issueType: 'Reserve And Backflush', |
|
|
|
productFlag: 'component', |
|
|
|
batchSaveList: convertedSelections // 使用转换后的数据 |
|
|
|
} |
|
|
|
batchSaveBomComponent(tempData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.subDetailList = data.rows.subDetailList |
|
|
|
this.copyBomDialogFlag = false |
|
|
|
this.batchSaveComponentModal() |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
|