Browse Source

复制BOM

java8
han\hanst 2 months ago
parent
commit
60695f782c
  1. 224
      src/views/modules/part/bom_create.vue

224
src/views/modules/part/bom_create.vue

@ -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-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-item>
</el-form> </el-form>
<!-- <el-tabs v-model="detailTable" style="margin-top: 50px; width: 100%; min-height: 120px" type="border-card" class="detail-tab">-->
<!-- &lt;!&ndash; BOM明细信息页签 &ndash;&gt;-->
<!-- <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"> <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子明细信息页签 --> <!-- BOM子明细信息页签 -->
<el-tab-pane label="Components" name="bom_sub_detail"> <el-tab-pane label="Components" name="bom_sub_detail">
@ -422,93 +385,6 @@
</div> </div>
</div> </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>-->
<!-- &lt;!&ndash; 分页插件 &ndash;&gt;-->
<!-- <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="display: flex; flex-direction: column; width: 100%;">
<!-- 可选物料 --> <!-- 可选物料 -->
<div style="flex: 1; padding: 1px;"> <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-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 :inline="true" label-position="top" :model="copyBomSearchData">
<el-form-item :label="'BU'"> <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 <el-option
v-for = "i in copyBomSearchData"
v-for = "i in userBuList"
:key = "i.buNo" :key = "i.buNo"
:label = "i.buDesc" :label = "i.buDesc"
:value = "i.buNo">
:value = "i.buDesc">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -884,7 +760,7 @@
<el-table <el-table
:height="200" :height="200"
:data="copyBomDataList" :data="copyBomDataList"
border
border highlight-current-row
ref="bomHeaderTable" ref="bomHeaderTable"
@row-click="headerClickRow" @row-click="headerClickRow"
v-loading="copyBomQueryLoading" v-loading="copyBomQueryLoading"
@ -984,6 +860,7 @@ import {Decimal} from "decimal.js"
import BomComponentUpload from "./bom_component_upload.vue" import BomComponentUpload from "./bom_component_upload.vue"
import {partFamilyInformationSearch} from "../../../api/part/partFamilyInformation"; import {partFamilyInformationSearch} from "../../../api/part/partFamilyInformation";
import {bomSearchHeader, getComponentPartList} from "../../../api/part/bomSearch3"; import {bomSearchHeader, getComponentPartList} from "../../../api/part/bomSearch3";
import {getSiteAndBuByUserName} from "@/api/eam/eam.js"
export default { export default {
components: { components: {
BomComponentUpload, BomComponentUpload,
@ -1081,6 +958,7 @@ export default {
}, },
data() { data() {
return { return {
userBuList: [],
// //
detailTable: 'bom_detail', detailTable: 'bom_detail',
subDetailTable: 'bom_sub_detail', subDetailTable: 'bom_sub_detail',
@ -2684,6 +2562,10 @@ export default {
unitConversionFamily: ['RFID018', 'RFID019'], unitConversionFamily: ['RFID018', 'RFID019'],
} }
}, },
created () {
// site bu
this.getSiteAndBuByUserName()
},
methods: { methods: {
// //
async init (tempData) { async init (tempData) {
@ -2742,6 +2624,18 @@ export default {
this.queryBatchComponentPartList() 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 // bom
addModal (row) { addModal (row) {
this.modalData = { this.modalData = {
@ -4111,6 +4005,10 @@ export default {
}, },
copyBomPart() { copyBomPart() {
if (!this.modalData.partNo) {
this.$message.warning('请选择节点!')
return
}
this.copyBomSearchData = { this.copyBomSearchData = {
site: this.$store.state.user.site, site: this.$store.state.user.site,
buNo: '', buNo: '',
@ -4174,44 +4072,54 @@ export default {
}, },
copyBomSave() { copyBomSave() {
console.log(this.copyBomSelections)
if (this.copyBomSelections === null || this.copyBomSelections.length === 0) { if (this.copyBomSelections === null || this.copyBomSelections.length === 0) {
this.$message.warning('请选择可选物料!') this.$message.warning('请选择可选物料!')
return 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}) => { batchSaveBomComponent(tempData).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.subDetailList = data.rows.subDetailList this.subDetailList = data.rows.subDetailList
this.copyBomDialogFlag = false this.copyBomDialogFlag = false
this.batchSaveComponentModal()
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',

Loading…
Cancel
Save