Browse Source

2025/11/3

java8
Aoi_Tori 2 months ago
parent
commit
c029b2714d
  1. 1
      src/api/part/partProductGroupPtm.js
  2. 590
      src/views/modules/part/bom_create.vue
  3. 833
      src/views/modules/part/quicklyCreateBom.vue

1
src/api/part/partProductGroupPtm.js

@ -2,6 +2,7 @@ import { createAPI } from "@/utils/httpRequest.js";
//查询 searchProductGroupPtm //查询 searchProductGroupPtm
export const searchProductGroupPtmCondition = data => createAPI("/plm/partProductGroupInformation/searchProductGroupPtmCondition", "post", data); export const searchProductGroupPtmCondition = data => createAPI("/plm/partProductGroupInformation/searchProductGroupPtmCondition", "post", data);
export const searchProductGroupPtmCondition1 = data => createAPI("/plm/partProductGroupInformation/searchProductGroupPtmCondition1", "post", data);
// searchProductGroupPtmConditionItemProcess // searchProductGroupPtmConditionItemProcess
export const searchProductGroupPtmConditionItemProcess = data => createAPI("/plm/partProductGroupInformation/searchProductGroupPtmConditionItemProcess", "post", data); export const searchProductGroupPtmConditionItemProcess = data => createAPI("/plm/partProductGroupInformation/searchProductGroupPtmConditionItemProcess", "post", data);

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

@ -120,6 +120,7 @@
<el-button type="primary" :loading="alternativeLoading" @click="saveComponentModal" style="margin-left: 7px">新增</el-button> <el-button type="primary" :loading="alternativeLoading" @click="saveComponentModal" style="margin-left: 7px">新增</el-button>
<el-button type="primary" :loading="alternativeLoading" @click="batchSaveComponentModal" style="margin-left: 7px">批量新增</el-button> <el-button type="primary" :loading="alternativeLoading" @click="batchSaveComponentModal" style="margin-left: 7px">批量新增</el-button>
<el-button type="primary" :loading="alternativeLoading" @click="batchUpdateComponents" style="margin-left: 7px">批量修改</el-button> <el-button type="primary" :loading="alternativeLoading" @click="batchUpdateComponents" style="margin-left: 7px">批量修改</el-button>
<el-button type="primary" :loading="alternativeLoading" @click="copyBomPart" style="margin-left: 7px">复制BOM物料</el-button>
<el-button type="primary" :loading="alternativeLoading" @click="batchUpdateOperationModal" style="margin-left: 7px">编辑工序</el-button> <el-button type="primary" :loading="alternativeLoading" @click="batchUpdateOperationModal" style="margin-left: 7px">编辑工序</el-button>
<el-button type="primary" icon="el-icon-upload" @click="bomComponentUpload">导入</el-button> <el-button type="primary" icon="el-icon-upload" @click="bomComponentUpload">导入</el-button>
<el-button type="primary" :loading="alternativeLoading" @click="deleteComponentPart">删除</el-button> <el-button type="primary" :loading="alternativeLoading" @click="deleteComponentPart">删除</el-button>
@ -826,6 +827,104 @@
</el-footer> </el-footer>
</el-dialog> </el-dialog>
<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-option
v-for = "i in copyBomSearchData"
:key = "i.buNo"
:label = "i.buDesc"
:value = "i.buNo">
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="'物料编码'">
<el-input v-model="copyBomSearchData.partNo" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'物料名称'">
<el-input v-model="copyBomSearchData.partDesc" clearable style="width: 300px"></el-input>
</el-form-item>
<el-form-item prop="partType2" label="零件类型">
<el-select v-model="copyBomSearchData.partType2" clearable style="width: 100px">
<el-option label="成品" value="Manufactured"></el-option>
<el-option label="半成品" value="Manufactured Recipe"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="'BOM版本号'">
<el-input v-model="copyBomSearchData.engChgLevel" style="width: 70px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button @click="getDataList()">查询</el-button>
</el-form-item>
</el-form>
<!-- bom列表 -->
<el-table
:height="200"
:data="copyBomDataList"
border
ref="bomHeaderTable"
@row-click="headerClickRow"
v-loading="copyBomQueryLoading"
style="width: 100%">
<el-table-column
v-for="(item,index) in copyBomColumnList" :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 style="margin-top: 0px"
@size-change="sizeChangeHandle4"
@current-change="currentChangeHandle4"
:current-page="pageIndex4"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="pageSize4"
:total="totalPage4"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<el-table
:height="200"
:data="componentPartList1"
@selection-change="selectionCopyBom"
border
style="width: 100%">
<el-table-column type="selection" width="30"></el-table-column>
<el-table-column
v-for="(item,index) in componentPartColumnList1" :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-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="copyBomSave">保存</el-button>
<el-button type="primary" @click="copyBomDialogFlag=false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- 导入 --> <!-- 导入 -->
<bom-component-upload ref="BomComponentUpload" @refreshPageTables="queryBomComponentTable" v-drag></bom-component-upload> <bom-component-upload ref="BomComponentUpload" @refreshPageTables="queryBomComponentTable" v-drag></bom-component-upload>
@ -863,6 +962,7 @@ import ChooseList from '@/views/modules/common/Chooselist_eam'
import {Decimal} from "decimal.js" 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";
export default { export default {
components: { components: {
BomComponentUpload, BomComponentUpload,
@ -969,19 +1069,25 @@ export default {
pageIndex3: 1, pageIndex3: 1,
pageSize3: 20, pageSize3: 20,
totalPage3: 0, totalPage3: 0,
pageIndex4: 1,
pageSize4: 20,
totalPage4: 0,
pageIndex5: 1, pageIndex5: 1,
pageSize5: 50, pageSize5: 50,
totalPage5: 0, totalPage5: 0,
batchComponentSelections: [], batchComponentSelections: [],
batchComponentSelections2: [], batchComponentSelections2: [],
copyBomSelections: [],
checkedDetail: [], checkedDetail: [],
detailDataList: [], detailDataList: [],
subDetailList: [], subDetailList: [],
componentPartList: [], componentPartList: [],
componentPartList1: [],
batchComponentPartList: [], batchComponentPartList: [],
choosePartList: [], choosePartList: [],
operationList: [], operationList: [],
familyList: [], familyList: [],
copyBomDataList: [],
modalData: { modalData: {
flag: '', flag: '',
title: '', title: '',
@ -1130,6 +1236,19 @@ export default {
page: 1, page: 1,
limit: 10, limit: 10,
}, },
copyBomSearchData: {
site: this.$store.state.user.site,
buNo: '',
userName: this.$store.state.user.name,
partNo: '',
bomType: '',
partDesc: '',
partType2: 'Manufactured Recipe',
engChgLevel: '',
page: 1,
limit: 10
},
headerCurrentRow: {},
// //
rules: { rules: {
partNo: [ partNo: [
@ -1336,6 +1455,98 @@ export default {
columnWidth : 100, columnWidth : 100,
}, },
], ],
copyBomColumnList: [
{
userId: this.$store.state.user.name,
functionId: 601002002,
serialNumber: '601002002Table1PartNo',
tableId: '601002002Table1',
tableName: 'BOMHeader表',
columnProp: 'buNo',
headerAlign: 'center',
align: 'center',
columnLabel: 'BU',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 60
},
{
userId: this.$store.state.user.name,
functionId: 601002002,
serialNumber: '601002002Table1PartNo',
tableId: '601002002Table1',
tableName: 'BOMHeader表',
columnProp: 'partNo',
headerAlign: 'center',
align: 'center',
columnLabel: '物料编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 601002002,
serialNumber: '601002002Table1PartDesc',
tableId: '601002002Table1',
tableName: 'BOMHeader表',
columnProp: 'partDesc',
headerAlign: 'center',
align: 'left',
columnLabel: '物料名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 300
},
{
userId: this.$store.state.user.name,
functionId: 601002002,
serialNumber: '601002002Table1PartType2Desc',
tableId: '601002002Table1',
tableName: 'BOMHeader表',
columnProp: 'partType2Desc',
headerAlign: 'center',
align: 'left',
columnLabel: '零件类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 601002002,
serialNumber: '601002002Table1EngChgLevel',
tableId: '601002002Table1',
tableName: 'BOMHeader表',
columnProp: 'engChgLevel',
headerAlign: 'center',
align: 'right',
columnLabel: 'BOM版本号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
],
partColumnList: [ partColumnList: [
{ {
columnProp: 'partNo', columnProp: 'partNo',
@ -2091,6 +2302,242 @@ export default {
columnWidth: 100 columnWidth: 100
} }
], ],
componentPartColumnList1: [
{
userId: this.$store.state.user.name,
functionId: 601002002,
serialNumber: '601002002Table2LineSequence',
tableId: '601002002Table2',
tableName: 'BOMComponent表',
columnProp: 'lineSequence',
headerAlign: 'center',
align: 'center',
columnLabel: '序号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 50
},
{
userId: this.$store.state.user.name,
functionId: 601002002,
serialNumber: '601002002Table2ComponentPart',
tableId: '601002002Table2',
tableName: 'BOMComponent表',
columnProp: 'componentPart',
headerAlign: 'center',
align: 'center',
columnLabel: '物料编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 601002002,
serialNumber: '601002002Table2ComponentPartDesc',
tableId: '601002002Table2',
tableName: 'BOMComponent表',
columnProp: 'componentPartDesc',
headerAlign: 'center',
align: 'left',
columnLabel: '物料名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 300
},
{
userId: this.$store.state.user.name,
functionId: 601002002,
serialNumber: '601002002Table2QtyPerAssembly',
tableId: '601002002Table2',
tableName: 'BOMComponent表',
columnProp: 'qtyPerAssembly',
headerAlign: 'center',
align: 'right',
columnLabel: '单位用量',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 601002002,
serialNumber: '601002002Table2ComponentScrap',
tableId: '601002002Table2',
tableName: 'BOMComponent表',
columnProp: 'componentScrap',
headerAlign: 'center',
align: 'right',
columnLabel: '调机量',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 601002002,
serialNumber: '601002002Table2ShrinkageFactor',
tableId: '601002002Table2',
tableName: 'BOMComponent表',
columnProp: 'shrinkageFactor',
headerAlign: 'center',
align: 'right',
columnLabel: '损耗率',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 601002002,
serialNumber: '601002002Table2ConsumptionItem',
tableId: '601002002Table2',
tableName: 'BOMComponent表',
columnProp: 'consumptionItem',
headerAlign: 'center',
align: 'center',
columnLabel: '消耗项目',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 601002002,
serialNumber: '601002002Table2PrintUnitName',
tableId: '601002002Table2',
tableName: 'BOMComponent表',
columnProp: 'printUnitName',
headerAlign: 'center',
align: 'center',
columnLabel: '物料单位',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 60
},
{
userId: this.$store.state.user.name,
functionId: 601002002,
serialNumber: '601002002Table2IssueType',
tableId: '601002002Table2',
tableName: 'BOMComponent表',
columnProp: 'issueType',
headerAlign: 'center',
align: 'center',
columnLabel: '生产属性',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 140
},
{
userId: this.$store.state.user.name,
functionId: 601002002,
serialNumber: '601002002Table2OperationNo',
tableId: '601002002Table2',
tableName: 'BOMComponent表',
columnProp: 'operationNo',
headerAlign: 'center',
align: 'left',
columnLabel: '工序编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 601002002,
serialNumber: '601002002Table2OperationName',
tableId: '601002002Table2',
tableName: 'BOMComponent表',
columnProp: 'operationName',
headerAlign: 'center',
align: 'left',
columnLabel: '工序名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 601002002,
serialNumber: '601002002Table2IssueToLoc',
tableId: '601002002Table2',
tableName: 'BOMComponent表',
columnProp: 'issueToLocName',
headerAlign: 'center',
align: 'center',
columnLabel: '发料库位',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 601002002,
serialNumber: '601002002Table2NoteText',
tableId: '601002002Table2',
tableName: 'BOMComponent表',
columnProp: 'noteText',
headerAlign: 'center',
align: 'left',
columnLabel: '备注',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 150
},
],
operationDetailList: [ operationDetailList: [
{ {
columnProp: 'routingRevision', columnProp: 'routingRevision',
@ -2176,6 +2623,7 @@ export default {
saveAllLoading: false, saveAllLoading: false,
saveDetailLoading: false, saveDetailLoading: false,
computeLoading: false, computeLoading: false,
copyBomQueryLoading: false,
// //
modalFlag: false, modalFlag: false,
modalDisableFlag: false, modalDisableFlag: false,
@ -2194,6 +2642,7 @@ export default {
batchOperationModelFlag: false, batchOperationModelFlag: false,
batchUpdateComponentsFlag: false, batchUpdateComponentsFlag: false,
familyDialogFlag: false, familyDialogFlag: false,
copyBomDialogFlag: false,
// ======== ======== // ======== ========
productionDataFamily: ['RFID003', 'RFID004', 'RFID005', 'RFID006', 'RFID007', 'RFID008', 'RFID009', 'RFID012', 'RFID023', 'RFID024', 'RFID025', 'RFID026', 'RFID027'], productionDataFamily: ['RFID003', 'RFID004', 'RFID005', 'RFID006', 'RFID007', 'RFID008', 'RFID009', 'RFID012', 'RFID023', 'RFID024', 'RFID025', 'RFID026', 'RFID027'],
materialDataFamily: ['RFID011', 'RFID020', 'RFID021', 'RFID022'], materialDataFamily: ['RFID011', 'RFID020', 'RFID021', 'RFID022'],
@ -3271,6 +3720,7 @@ export default {
if (data && data.code === 0) { if (data && data.code === 0) {
this.subDetailList = data.rows.subDetailList this.subDetailList = data.rows.subDetailList
this.batchComponentPartModelFlag = false this.batchComponentPartModelFlag = false
this.batchUpdateComponents()
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
@ -3502,6 +3952,18 @@ export default {
this.queryFamilyList() this.queryFamilyList()
}, },
sizeChangeHandle4 (val) {
this.pageSize4 = val
this.pageIndex4 = 1
this.getDataList()
},
//
currentChangeHandle4 (val) {
this.pageIndex4 = val
this.getDataList()
},
batchUpdateComponents() { batchUpdateComponents() {
this.batchUpdateComponentsFlag = true this.batchUpdateComponentsFlag = true
}, },
@ -3614,7 +4076,135 @@ export default {
}) })
this.batchUpdateComponentsFlag = false this.batchUpdateComponentsFlag = false
} }
},
copyBomPart() {
this.copyBomSearchData = {
site: this.$store.state.user.site,
buNo: '',
userName: this.$store.state.user.name,
partNo: '',
bomType: '',
partDesc: '',
partType2: 'Manufactured Recipe',
engChgLevel: '',
page: 1,
limit: 10
}
this.getDataList()
this.copyBomSelections = []
this.copyBomDialogFlag = true
},
getDataList () {
this.copyBomSearchData.limit = this.pageSize4
this.copyBomSearchData.page = this.pageIndex4
this.copyBomQueryLoading = true
bomSearchHeader(this.copyBomSearchData).then(({data}) => {
if (data.code === 0) {
this.copyBomDataList = data.page.list
this.pageIndex4 = data.page.currPage
this.pageSize4 = data.page.pageSize
this.totalPage4 = data.page.totalCount
//
if (this.copyBomDataList.length > 0) {
//
this.headerClickRow(this.copyBomDataList[0])
} else {
this.headerCurrentRow = {}
}
}
this.copyBomQueryLoading = false
})
},
headerClickRow (row) {
this.$refs.bomHeaderTable.toggleRowSelection(row)
this.$set(this.headerCurrentRow, 'site', row.site)
this.$set(this.headerCurrentRow, 'componentPart', row.partNo)
this.$set(this.headerCurrentRow, 'bomType', row.bomType)
this.$set(this.headerCurrentRow, 'engChgLevel', row.engChgLevel)
this.getComponentPartList()
},
getComponentPartList(){
getComponentPartList(this.headerCurrentRow).then(({data}) => {
if (data && data.code === 0) {
this.componentPartList1 = data.rows
} else {
this.componentPartList1 = []
}
})
},
selectionCopyBom(val) {
this.copyBomSelections = val
},
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
}
batchSaveBomComponent(tempData).then(({data}) => {
if (data && data.code === 0) {
this.subDetailList = data.rows.subDetailList
this.copyBomDialogFlag = false
this.batchSaveComponentModal()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
this.batchComponentPartData = {
site: '',
buNo: '',
partNo: '',
partDesc: '',
shrinkageFactor: '',
page: 1,
limit: 10
}
})
})
} }
} }
} }
</script> </script>

833
src/views/modules/part/quicklyCreateBom.vue

@ -27,6 +27,7 @@
:height="54" :height="54"
:data="dataList" :data="dataList"
border border
v-loading="this.dataListLoading"
style="width: 100%;"> style="width: 100%;">
<el-table-column <el-table-column
v-for="(item,index) in columnList" :key="index" v-for="(item,index) in columnList" :key="index"
@ -38,7 +39,18 @@
:fixed="item.fixed === ''?false:item.fixed" :fixed="item.fixed === ''?false:item.fixed"
:min-width="item.columnWidth" :min-width="item.columnWidth"
:label="item.columnLabel"> :label="item.columnLabel">
<template slot="header" slot-scope="scope">
<a href="javascript:void(0)" @click="openColumnModal(item.columnLabel,item.columnProp)" style="cursor:pointer;color: white">{{ item.columnLabel }}</a>
</template>
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <span v-if="!item.columnHidden">-->
<!-- <span v-if="scope.row[item.columnProp]!==null&&scope.row[item.columnProp]!==''">-->
<!-- <el-link style="cursor:pointer;" @click="openColumnModal(item.columnLabel)">{{ scope.row[item.columnProp] }}</el-link>-->
<!-- </span>-->
<!-- <span v-else>-->
<!-- <el-link style="cursor:pointer;" @click="openColumnModal(item.columnLabel)">...</el-link>-->
<!-- </span>-->
<!-- </span>-->
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span> <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> <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template> </template>
@ -489,6 +501,7 @@
<el-form label-position="top" style="margin-left: 2px;"> <el-form label-position="top" style="margin-left: 2px;">
<el-button type="primary" @click="addOrDelItem1">新增</el-button> <el-button type="primary" @click="addOrDelItem1">新增</el-button>
<el-button type="primary" :loading="loading" @click="clickSave1">{{ attributeFlag1?'编辑':'保存' }}</el-button> <el-button type="primary" :loading="loading" @click="clickSave1">{{ attributeFlag1?'编辑':'保存' }}</el-button>
<el-button type="primary" @click="chooseProcessTimeMatrix">选择ProcessTimeMatrix</el-button>
</el-form> </el-form>
<div class="rq " v-show="attributeFlag1"> <div class="rq " v-show="attributeFlag1">
<el-table <el-table
@ -1258,6 +1271,174 @@
</el-footer> </el-footer>
</el-dialog> </el-dialog>
<el-dialog :title="修改属性" :close-on-click-modal="false" v-drag :visible.sync="itemUpdateFlag" width="1100px">
<el-table
:data="partItemList1"
border
:header-cell-style="{padding: '2px 2px'}"
style="width: 100%">
<el-table-column
v-for="(item,index) in columnItemList" :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">
<div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
<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>
</div>
<div v-else>
<div v-if="scope.row.valueChooseFlag !== 'Y'">
<el-input-number v-model="scope.row.numValue" style="padding: 0;width: 100%" v-if="scope.row.valueTypeDb === 'N'" :controls="false"></el-input-number>
<el-input v-model="scope.row.textValue" v-else></el-input>
</div>
<div v-else>
<el-select style="width: 100%;" clearable v-if="scope.row.valueTypeDb === 'T'" v-model="scope.row.textValue">
<el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
</el-select>
<el-select style="width: 100%;" clearable v-else v-model="scope.row.numValue">
<el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
</el-select>
</div>
</div>
</template>
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="itemUpdateSave">保存</el-button>
<el-button type="primary" @click="itemUpdateFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="选择ProcessTimeMatrix" :close-on-click-modal="false" v-drag :visible.sync="processTimeMatrixFlag" width="1440px">
<el-form :inline="true" label-position="top" :model="processTimeMatrixData">
<el-form-item :label="'商品组名称'">
<span style="cursor: pointer" slot="label" @click="queryProductGroup"><a herf="#">商品组名称</a></span>
<el-input disabled v-model="processTimeMatrixData.productGroupName" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'条件描述'">
<el-input v-model="processTimeMatrixData.conditionDesc" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button type="primary" @click="queryProcessTimeMatrix">查询</el-button>
</el-form-item>
</el-form>
<el-table
:data="processTimeMatrixList"
border
:height="400"
:header-cell-style="{padding: '2px 2px'}"
style="width: 100%">
<el-table-column
v-for="(item,index) in processTimeMatrixColumnList" :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">
<div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
<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>
</div>
<div v-else>
<div v-if="scope.row.valueChooseFlag !== 'Y'">
<el-input-number v-model="scope.row.numValue" style="padding: 0;width: 100%" v-if="scope.row.valueTypeDb === 'N'" :controls="false"></el-input-number>
<el-input v-model="scope.row.textValue" v-else></el-input>
</div>
<div v-else>
<el-select style="width: 100%;" clearable v-if="scope.row.valueTypeDb === 'T'" v-model="scope.row.textValue">
<el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
</el-select>
<el-select style="width: 100%;" clearable v-else v-model="scope.row.numValue">
<el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
</el-select>
</div>
</div>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="100"
label="操作">
<template slot-scope="scope">
<el-link style="cursor: pointer" @click="chooseProcessTimeMatrix1(scope.row)">选择</el-link>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle6"
@current-change="currentChangeHandle6"
:current-page="pageIndex6"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="pageSize6"
:total="totalPage6"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="processTimeMatrixFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="商品组清单" top="17vh" :close-on-click-modal="false" v-drag :visible.sync="productGroupFlag" width="700px">
<el-form :inline="true" label-position="top" :model="productGroupData">
<el-form-item :label="'商品组编码'">
<el-input v-model="productGroupData.productGroupId" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'商品组名称'">
<el-input v-model="productGroupData.productGroupName" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button type="primary" @click="queryProductGroup">查询</el-button>
</el-form-item>
</el-form>
<el-table
:height="250"
:data="productGroupList"
@row-dblclick="productGroupDbClick"
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in productGroupColumnList" :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-footer style="height:35px;margin-top:10px;text-align:center">
<el-button type="primary" @click="productGroupFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- 新增物料 --> <!-- 新增物料 -->
<part-create :init-data="searchData" ref="PartCreate" @update-part-item="getPartItem" @refreshPageTables="getBomInfo" @refreshPageTables2="getInfoByBomTemplate" v-drag></part-create> <part-create :init-data="searchData" ref="PartCreate" @update-part-item="getPartItem" @refreshPageTables="getBomInfo" @refreshPageTables2="getInfoByBomTemplate" v-drag></part-create>
@ -1309,6 +1490,8 @@ import {getSiteAndBuByUserName} from "../../../api/qc/qc";
import Data from "lodash"; import Data from "lodash";
import {copyBom, queryBomDetail, queryPartList} from "../../../api/part/bomManagement"; import {copyBom, queryBomDetail, queryPartList} from "../../../api/part/bomManagement";
import {copyRouting, queryRoutingDetail} from "../../../api/part/routingManagement"; import {copyRouting, queryRoutingDetail} from "../../../api/part/routingManagement";
import {productGroupInformationSearch} from "../../../api/part/partProductGroupInformation";
import {searchProductGroupPtmCondition1} from "../../../api/part/partProductGroupPtm";
export default { export default {
components: { components: {
PartCreate, PartCreate,
@ -1323,6 +1506,14 @@ export default {
this.nodeData.nodeId = this.nodeData.nodeId.toUpperCase() this.nodeData.nodeId = this.nodeData.nodeId.toUpperCase()
} }
}, },
itemUpdateFlag: {
deep: true,
handler: function (newV, oldV) {
if (!newV) {
this.partItemList1 = []
}
}
},
'partCurrentRow': { 'partCurrentRow': {
deep: true, deep: true,
handler: function (newV, oldV) { handler: function (newV, oldV) {
@ -1465,6 +1656,20 @@ export default {
this.getRevisionInfo() this.getRevisionInfo()
} }
} }
},
'$route.query.data': {
handler(newData, oldData) {
if (newData) {
this.searchData = newData;
this.searchData.partDesc = newData.testPartDesc;
this.searchData.codeNo = newData.partCodeNo;
this.searchData.rfqDetailId = newData.id;
this.dataList = [{}]
this.getNodeTree();
this.getPartItem();
}
},
immediate: true
} }
}, },
data () { data () {
@ -1486,6 +1691,8 @@ export default {
partProductGroupList3: [], partProductGroupList3: [],
templateList: [], templateList: [],
tempList: [], tempList: [],
processTimeMatrixList: [],
productGroupList: [],
defaultProps: { defaultProps: {
children: "nodeList", children: "nodeList",
label: "nodeName", label: "nodeName",
@ -1511,6 +1718,12 @@ export default {
pageIndex4: 1, pageIndex4: 1,
pageSize4: 20, pageSize4: 20,
totalPage4: 0, totalPage4: 0,
pageIndex5: 1,
pageSize5: 20,
totalPage5: 0,
pageIndex6: 1,
pageSize6: 20,
totalPage6: 0,
partList: [], partList: [],
partList1: [], partList1: [],
codeList: [], codeList: [],
@ -1566,7 +1779,7 @@ export default {
], ],
}, },
searchData: { searchData: {
site: '',
site: this.$store.state.user.site,
buNo: '', buNo: '',
partNo: '', partNo: '',
partDesc: '', partDesc: '',
@ -1608,6 +1821,14 @@ export default {
page: 1, page: 1,
limit: 10 limit: 10
}, },
productGroupData: {
productGroupId: '',
productGroupName: '',
userName: this.$store.state.user.name,
type: 1,
limit: 20,
page: 1
},
copyData: { copyData: {
flag: '', flag: '',
site: this.$store.state.user.site, site: this.$store.state.user.site,
@ -1646,6 +1867,15 @@ export default {
page: 1, page: 1,
limit: 10 limit: 10
}, },
processTimeMatrixData: {
productGroupName: '',
productGroupId: '',
conditionDesc: '',
buNo: '',
site: this.$store.state.user.site,
page: 1,
limit: 20
},
nodeRules:{ nodeRules:{
nodeId:[ nodeId:[
{ {
@ -1788,7 +2018,7 @@ export default {
columnProp: 'cl60k-up', columnProp: 'cl60k-up',
headerAlign: 'left', headerAlign: 'left',
align: 'left', align: 'left',
columnLabel: 'CL60K-UP',
columnLabel: 'CL60k-UP',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
@ -1802,7 +2032,7 @@ export default {
columnProp: 'cl60k-pitch', columnProp: 'cl60k-pitch',
headerAlign: 'left', headerAlign: 'left',
align: 'left', align: 'left',
columnLabel: 'CL60K-Pitch',
columnLabel: 'CL60k-Pitch',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
@ -1816,7 +2046,7 @@ export default {
columnProp: 'cl60k-cd', columnProp: 'cl60k-cd',
headerAlign: 'left', headerAlign: 'left',
align: 'left', align: 'left',
columnLabel: 'CL60K-CD',
columnLabel: 'CL60k-CD',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
@ -2379,8 +2609,7 @@ export default {
columnImage: false, columnImage: false,
status: true, status: true,
fixed: '', fixed: '',
columnWidth: 300,
// columnWidth: 340,
columnWidth: 200,
}, },
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
@ -2396,8 +2625,7 @@ export default {
columnImage: false, columnImage: false,
status: true, status: true,
fixed: '', fixed: '',
columnWidth: 300,
// columnWidth: 340,
columnWidth: 200,
}, },
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
@ -2413,8 +2641,7 @@ export default {
columnImage: false, columnImage: false,
status: true, status: true,
fixed: '', fixed: '',
columnWidth: 360,
// columnWidth: 408,
columnWidth: 240,
}, },
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
@ -2430,10 +2657,220 @@ export default {
columnImage: false, columnImage: false,
status: true, status: true,
fixed: '', fixed: '',
columnWidth: 300,
// columnWidth: 340,
columnWidth: 200,
}, },
], ],
processTimeMatrixColumnList: [
{
userId: this.$store.state.user.name,
columnProp: 'conditionDesc',
headerAlign: 'left',
align: 'left',
columnLabel: '条件描述',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 50
},{
userId: this.$store.state.user.name,
columnProp: 'family1',
headerAlign: 'left',
align: 'left',
columnLabel: 'Family1',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 35
},
{
userId: this.$store.state.user.name,
columnProp: 'family2',
headerAlign: 'left',
align: 'left',
columnLabel: 'Family2',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 35
},
{
userId: this.$store.state.user.name,
columnProp: 'lanes0Web',
headerAlign: 'left',
align: 'left',
columnLabel: 'Lanes0 web',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 50
},
{
userId: this.$store.state.user.name,
columnProp: 'laminationWidth',
headerAlign: 'left',
align: 'left',
columnLabel: 'Lamination width',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
columnProp: 'printingLanes',
headerAlign: 'left',
align: 'left',
columnLabel: 'Printing lanes',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 60
},
{
userId: this.$store.state.user.name,
columnProp: 'bondingPitch',
headerAlign: 'left',
align: 'left',
columnLabel: 'Bonding Pitch',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 55
},
{
userId: this.$store.state.user.name,
columnProp: 'bondingLanes',
headerAlign: 'left',
align: 'left',
columnLabel: '绑定列数',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 40
},
{
userId: this.$store.state.user.name,
columnProp: 'dryFgLanes',
headerAlign: 'left',
align: 'left',
columnLabel: 'Dry FG lanes',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 50
},
{
userId: this.$store.state.user.name,
columnProp: 'cd',
headerAlign: 'left',
align: 'left',
columnLabel: 'CD',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 30
},
{
userId: this.$store.state.user.name,
columnProp: 'uph-tal',
headerAlign: 'left',
align: 'left',
columnLabel: 'UPH-TAL',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 50
},
{
userId: this.$store.state.user.name,
columnProp: 'uph-paris',
headerAlign: 'left',
align: 'left',
columnLabel: 'UPH-Paris',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 60
},
{
userId: this.$store.state.user.name,
columnProp: 'up',
headerAlign: 'left',
align: 'left',
columnLabel: 'up',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 40
},
{
userId: this.$store.state.user.name,
columnProp: 'cl60k-pitch',
headerAlign: 'left',
align: 'left',
columnLabel: 'CL60k-Pitch',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 50
},
{
userId: this.$store.state.user.name,
columnProp: 'cl60k-cd',
headerAlign: 'left',
align: 'left',
columnLabel: 'CL60k-CD',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 50
}
],
bomComponentListColumnList: [ bomComponentListColumnList: [
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
@ -3059,6 +3496,62 @@ export default {
columnWidth: 100 columnWidth: 100
} }
], ],
productGroupColumnList: [
{
userId: this.$store.state.user.name,
functionId: 601006,
serialNumber: '601006Table1BuDesc',
tableId: "601006Table1",
tableName: "商品组信息表",
columnProp: 'buNo',
headerAlign: "center",
align: "center",
columnLabel: 'BU',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 601006,
serialNumber: '601006Table1ProductGroupId',
tableId: "601006Table1",
tableName: "商品组信息表",
columnProp: 'productGroupId',
headerAlign: "center",
align: "center",
columnLabel: '商品组编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 601006,
serialNumber: '601006Table1ProductGroupName',
tableId: "601006Table1",
tableName: "商品组信息表",
columnProp: 'productGroupName',
headerAlign: "center",
align: "center",
columnLabel: '商品组名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 300
},
],
// //
nodeModalFlag: false, nodeModalFlag: false,
nodeModalDisableFlag: false, nodeModalDisableFlag: false,
@ -3076,14 +3569,19 @@ export default {
fastAddFlag: false, fastAddFlag: false,
fastAddFlag1: false, fastAddFlag1: false,
loading: false, loading: false,
dataListLoading: false,
addItemLoading: false, addItemLoading: false,
deleteItemLoading: false, deleteItemLoading: false,
buNoQueryLoading: false, buNoQueryLoading: false,
alternativeLoading: false, alternativeLoading: false,
processTimeMatrixLoading: false,
bomFlag: true, bomFlag: true,
bomFlag1: true, bomFlag1: true,
copyVisible: false, copyVisible: false,
copyPartModelFlag: false
copyPartModelFlag: false,
itemUpdateFlag: false,
processTimeMatrixFlag: false,
productGroupFlag: false
} }
}, },
created () { created () {
@ -3702,7 +4200,9 @@ export default {
codeNo: this.searchData.codeNo, codeNo: this.searchData.codeNo,
recordType: 'IP' recordType: 'IP'
} }
this.dataListLoading = true
getPartItem(tempData).then(({data}) => { getPartItem(tempData).then(({data}) => {
this.dataList = [{}]
if (data && data.code === 0 && data.rows.length > 0) { if (data && data.code === 0 && data.rows.length > 0) {
for (let i = 0; i < data.rows.length; i++) { for (let i = 0; i < data.rows.length; i++) {
const itemDesc = data.rows[i].itemDesc; const itemDesc = data.rows[i].itemDesc;
@ -3758,9 +4258,11 @@ export default {
break; break;
} }
} }
this.$forceUpdate()
} else { } else {
this.dataList = []
this.dataList = [{}]
} }
this.dataListLoading = false
}) })
}, },
@ -5096,6 +5598,31 @@ export default {
this.queryCopyPartModal() this.queryCopyPartModal()
}, },
//
sizeChangeHandle5 (val) {
this.pageSize5 = val
this.pageIndex5 = 1
this.queryProductGroup()
},
//
currentChangeHandle5 (val) {
this.pageIndex5 = val
this.queryProductGroup()
},
//
sizeChangeHandle6 (val) {
this.pageSize6 = val
this.pageIndex6 = 1
this.queryProcessTimeMatrix()
},
//
currentChangeHandle6 (val) {
this.pageIndex6 = val
this.queryProcessTimeMatrix()
},
getCopyRowData(row) { getCopyRowData(row) {
getCopyRowData(row).then(({data}) => { getCopyRowData(row).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
@ -5203,6 +5730,284 @@ export default {
} }
}, },
openColumnModal(desc, prop) {
this.partItemList1 = []
this.itemProp = prop
let tempData = {
site: this.$store.state.user.site,
buNo: this.searchData.buNo,
partNo: this.searchData.partNo,
codeNo: this.searchData.codeNo,
recordType: 'IP'
}
getPartItem(tempData).then(({data}) => {
if (data && data.code === 0 && data.rows.length > 0) {
const foundItem = data.rows.find(item => item.itemDesc === desc);
if (!foundItem) {
this.$message.warning('请先新增该属性再进行修改!')
}
this.partItemList1.push(foundItem)
this.itemUpdateFlag = true
} else {
this.partItemList1 = []
}
})
},
async itemUpdateSave() {
let tempData = {
site: this.$store.state.user.site,
buNo: this.searchData.buNo,
partNo: this.searchData.partNo,
codeNo: this.searchData.codeNo
}
await partInfoByMainPart(tempData).then(({data}) => {
if (data && data.code === 0){
this.$set(this, 'partList1', data.rows)
}else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
let list = []
let partList = this.partList1.filter(item => item.buNo === this.searchData.buNo)
for (let i = 0; i <this.partList1.length; i++) {
if (this.partList1[i].partNo&&this.partList1[i].partNo!==''&&this.partList1[i].buNo){
let items = JSON.parse(JSON.stringify(this.partItemList1))
items[0].site = this.searchData.site
items[0].buNo = partList[i].buNo
items[0].partNo = partList[i].partNo
items[0].codeNo = partList[i].codeNo
items[0].recordType = 'IP'
list.push({
site: this.partList1[i].site,
buNo: this.partList1[i].buNo,
partNo: this.partList1[i].partNo,
codeNo: this.partList1[i].codeNo,
recordType: 'IP',
itemList: items
})
}
}
commitItemsValue(list).then(({data}) => {
if (data && data.code === 0) {
this.getPartItem()
// this.autoCompute()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
this.itemUpdateFlag = false
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
}).catch((error) => {
this.$message.error(error)
})
},
// todo
autoCompute() {
const originalData = this.treeData;
const flatList = [];
function flattenData(data) {
data.forEach(item => {
flatList.push(item);
if (item.nodeList && Array.isArray(item.nodeList)) {
flattenData(item.nodeList);
}
});
}
flattenData(originalData);
console.log(flatList);
for (let i = 0; i < flatList.length; i++) {
this.tempData = {
site: flatList[i].site,
buNo: flatList[i].buNo,
mainPart: this.searchData.partNo,
partNo: flatList[i].partNo,
partDesc: flatList[i].partDesc,
printUnit: flatList[i].printUnit,
printUnitName: flatList[i].printUnitName,
processUnit: flatList[i].processUnit,
bomType: 'Manufacturing',
nodeId: flatList[i].nodeId,
offFlag: '2'
}
}
},
chooseProcessTimeMatrix() {
this.processTimeMatrixFlag = true
},
chooseProcessTimeMatrix1(row) {
this.processTimeMatrixFlag = false
if (this.attributeFlag1) {
this.clickSave1()
}
this.partItemList1.forEach(item => {
let value = null;
switch (item.itemDesc) {
case 'Family1':
value = row.family1;
break;
case 'Family2':
value = row.family2;
break;
case 'Lanes0 web':
value = row.lanes0Web;
break;
case 'Lamination width':
value = row.laminationWidth;
break;
case 'Printing lanes':
value = row.printingLanes;
break;
case 'Bonding Pitch':
value = row.bondingPitch;
break;
case '绑定列数':
value = row.bondingLanes;
break;
case 'Dry FG lanes':
value = row.dryFgLanes;
break;
case 'CD':
value = row.cd;
break;
case 'UPH-TAL':
value = row['uph-tal'];
break;
case 'UPH-Paris':
value = row['uph-paris'];
break;
case 'up':
value = row.up;
break;
case 'CL60k-Pitch':
value = row['cl60k-pitch'];
break;
case 'CL60k-CD':
value = row['cl60k-cd'];
break;
default:
return;
}
console.log('row',row)
console.log('value',value)
if (item.valueTypeDb === 'T') {
// textValue
item.textValue = value ? value : '';
} else if (item.valueTypeDb === 'N') {
// numValue
item.numValue = value ? Number(value) : null;
}
console.log('item',item)
});
this.clickSave1()
},
queryProductGroup() {
this.productGroupData.limit = this.pageSize5
this.productGroupData.page = this.pageIndex5
productGroupInformationSearch(this.productGroupData).then(({data}) => {
if (data.code === 0) {
this.productGroupList = data.page.list
this.pageIndex5 = data.page.currPage
this.pageSize5 = data.page.pageSize
this.totalPage5 = data.page.totalCount
this.productGroupFlag = true
}
})
},
productGroupDbClick(row) {
this.processTimeMatrixData.productGroupName = row.productGroupName
this.processTimeMatrixData.productGroupId = row.productGroupId
this.productGroupFlag = false
},
queryProcessTimeMatrix() {
this.processTimeMatrixLoading = true
this.productGroupData.limit = this.pageSize6
this.productGroupData.page = this.pageIndex6
searchProductGroupPtmCondition1(this.processTimeMatrixData).then(({data}) => {
if (data && data.code === 0) {
const list = data.rows1.list;
const groupMap = new Map();
list.forEach(condition => {
const {conditionDesc, ptmConditionItemList} = condition;
if (!groupMap.has(conditionDesc)) {
groupMap.set(conditionDesc, {conditionDesc});
}
const group = groupMap.get(conditionDesc);
ptmConditionItemList.forEach(item => {
switch (item.itemDesc) {
case 'Family1':
group.family1 = item.numValue || item.textValue;
break;
case 'Family2':
group.family2 = item.numValue || item.textValue;
break;
case 'Lanes0 web':
group.lanes0Web = item.numValue || item.textValue;
break;
case 'Lamination width':
group.laminationWidth = item.numValue || item.textValue;
break;
case 'Printing lanes':
group.printingLanes = item.numValue || item.textValue;
break;
case 'Bonding Pitch':
group.bondingPitch = item.numValue || item.textValue;
break;
case '绑定列数':
group.bondingLanes = item.numValue || item.textValue;
break;
case 'Dry FG lanes':
group.dryFgLanes = item.numValue || item.textValue;
break;
case 'CD':
group.cd = item.numValue || item.textValue;
break;
case 'UPH-TAL':
group['uph-tal'] = item.numValue || item.textValue;
break;
case 'UPH-Paris':
group['uph-paris'] = item.numValue || item.textValue;
break;
case 'up':
group.up = item.numValue || item.textValue;
break;
case 'CL60k-Pitch':
group['cl60k-pitch'] = item.numValue || item.textValue;
break;
case 'CL60k-CD':
group['cl60k-cd'] = item.numValue || item.textValue;
break;
default:
break;
}
this.processTimeMatrixList = Array.from(groupMap.values());
this.pageIndex6 = data.rows1.currPage
this.pageSize6 = data.rows1.pageSize
this.totalPage6 = data.rows1.totalCount
this.processTimeMatrixFlag = true
this.processTimeMatrixLoading = false
})
})
}
})
}
}, },
} }
</script> </script>

Loading…
Cancel
Save