@ -227,45 +227,90 @@
< el -form label -position = " top " style = "margin-top: 5px" >
< el -form -item >
< el -button type = "primary" :loading ="alternativeLoading" @click ="saveComponentModal" style = "margin-left: 7px" > 新增 < / e l - b u t t o n >
< el -button type = "primary" :loading ="alternativeLoading" @click ="batchSaveComponentModal" style = "margin-left: 7px" > 批量新增 < / e l - b u t t o n >
< el -button type = "primary" :loading ="alternativeLoading" @click ="deleteComponentPart" > 删除 < / el -button >
< / e l - f o r m - i t e m >
< / e l - f o r m >
< el -table
: data = "subDetailList"
height = "256px"
border
ref = "componentTable"
@ row - click = "componentClickRow"
: row - class - name = "rowClassName"
@ selection - change = "componentSelectionChange"
style = "width:100%" >
< el -table -column type = "selection" align = "center" width = "50" > < / e l - t a b l e - c o l u m n >
< el -table -column
v - for = "(item,index) in columnSubDetailList" : 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 >
< / e l - t a b l e - c o l u m n >
< el -table -column
fixed = "right"
header - align = "center"
align = "center"
width = "100"
label = "操作" >
< template slot -scope = " scope " >
< el -link style = "cursor: pointer" @click ="updateComponentModal(scope.row)" > 编辑 < / el -link >
< / template >
< / e l - t a b l e - c o l u m n >
< / e l - t a b l e >
< div class = "rq " >
< el -table
: data = "subDetailList"
height = "256px"
border
@ selection - change = "componentSelectionChange"
style = "width:100%" >
< el -table -column type = "selection" align = "center" width = "50" > < / e l - t a b l e - c o l u m n >
< el -table -column
v - for = "(item,index) in columnSubDetailList1" : 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 >
< / e l - t a b l e - c o l u m n >
< el -table -column
prop = ""
header - align = "center"
align = "right"
min - width = "80"
label = "单位用量" >
< template slot -scope = " scope " >
< el -input -number :controls ="false" :step ="0" :ref ="`qtyPerAssembly${scope.$index}`" v-model ="scope.row.qtyPerAssembly" @keyup.enter.native="focusNextInput(scope.$index, 'qtyPerAssembly')" style="height: 11px; width: 98%" > < / el -input -number >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column
prop = ""
header - align = "center"
align = "right"
min - width = "80"
label = "调机量" >
< template slot -scope = " scope " >
< el -input -number :controls ="false" :step ="0" :ref ="`componentScrap${scope.$index}`" v-model ="scope.row.componentScrap" @keyup.enter.native="focusNextInput(scope.$index, 'componentScrap')" style="height: 11px; width: 98%" > < / el -input -number >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column
prop = ""
header - align = "center"
align = "right"
min - width = "80"
label = "损耗率" >
< template slot -scope = " scope " >
< el -input -number :controls ="false" :step ="0" :ref ="`shrinkageFactor${scope.$index}`" v-model ="scope.row.shrinkageFactor" @keyup.enter.native="focusNextInput(scope.$index, 'shrinkageFactor')" style="height: 11px; width: 98%" > < / el -input -number >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column
v - for = "(item,index) in columnSubDetailList2" : 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 >
< / e l - t a b l e - c o l u m n >
< el -table -column
fixed = "right"
header - align = "center"
align = "center"
width = "100"
label = "操作" >
< template slot -scope = " scope " >
< el -link style = "cursor: pointer" @click ="updateComponentModal(scope.row)" > 编辑 < / el -link >
< / template >
< / e l - t a b l e - c o l u m n >
< / e l - t a b l e >
< / div >
< / e l - t a b - p a n e >
< / e l - t a b s >
< el -footer style = "height:30px;margin-top:20px;text-align:center" >
@ -739,6 +784,68 @@
< / e l - f o o t e r >
< / e l - d i a l o g >
<!-- 批量新增子明细物料模态框 -- >
< el -dialog title = "物料清单" top = "17vh" :close-on-click-modal ="false" v -drag :visible.sync ="batchComponentPartModelFlag" width = "1060px" >
< el -form :inline ="true" label -position = " top " :model ="batchComponentPartData" >
< el -form -item :label ="'物料编码'" >
< el -input v-model ="batchComponentPartData.partNo" clearable style="width: 120px" > < / el -input >
< / e l - f o r m - i t e m >
< el -form -item :label ="'物料名称'" >
< el -input v-model ="batchComponentPartData.partDesc" clearable style="width: 120px" > < / el -input >
< / e l - f o r m - i t e m >
< el -form -item : label = "' '" >
< el -button type = "primary" @click ="queryBatchComponentPartList" > 查询 < / el -button >
< / e l - f o r m - i t e m >
< el -form -item :label ="'损耗率%'" style = "margin-left: 545px" >
< el -input -number :controls ="false" :step ="0" min = "0" max = "100" v-model ="batchComponentPartData.shrinkageFactor" style="width: 80px" > < / el -input -number >
< / e l - f o r m - i t e m >
< / e l - f o r m >
< el -table
: height = "400"
: data = "batchComponentPartList"
ref = "batchSaveTable"
@ row - click = "batchSaveClickRow"
@ selection - change = "selectionSaveComponent"
border
style = "width: 100%;" >
< el -table -column
type = "selection"
header - align = "center"
align = "center"
width = "50" >
< / e l - t a b l e - c o l u m n >
< 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 >
< / e l - t a b l e - c o l u m n >
< / e l - t a b l e >
<!-- 分页插件 -- >
< 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" >
< / e l - p a g i n a t i o n >
< el -footer style = "height:35px;margin-top:10px;text-align:center" >
< el -button type = "primary" @click ="batchComponentDataSave" > 保存 < / el -button >
< el -button type = "primary" @ click = "batchComponentPartModelFlag = false" > 关闭 < / e l - b u t t o n >
< / e l - f o o t e r >
< / e l - d i a l o g >
<!-- chooseList模态框 -- >
< ChooseList ref = "baseList" @getBaseData ="getBaseData" > < / ChooseList >
< / div >
@ -770,6 +877,7 @@ import {
queryBomComponentTable , / / 刷 新 子 物 料
getBomEngChgLevel , / / 获 取 物 料 的 B O M 版 本 号
queryPartListAll , / / 查 询 包 含 P u r c h a s e ( R a w ) 的 物 料
batchSaveBomComponent , / / 批 量 新 增 子 件
} from '@/api/part/bomManagement.js'
import { getSiteAndBuByUserName , getSiteAndBuByUserName2 } from "@/api/qc/qc.js"
import { getTableDefaultListLanguage , getTableUserListLanguage } from "@/api/table.js"
@ -851,6 +959,9 @@ export default {
pageIndex4 : 1 ,
pageSize4 : 20 ,
totalPage4 : 0 ,
pageIndex5 : 1 ,
pageSize5 : 20 ,
totalPage5 : 0 ,
selectedDataNum : 0 ,
/ / 条 件 查 询
searchData : {
@ -957,6 +1068,15 @@ export default {
page : 1 ,
limit : 10
} ,
batchComponentPartData : {
site : '' ,
buNo : '' ,
partNo : '' ,
partDesc : '' ,
shrinkageFactor : '' ,
page : 1 ,
limit : 10
} ,
copyPartData : {
type : '' ,
site : '' ,
@ -1024,6 +1144,7 @@ export default {
dataList : [ ] ,
partList : [ ] ,
componentPartList : [ ] ,
batchComponentPartList : [ ] ,
copyPartList : [ ] ,
componentPartSelections : [ ] ,
subDetailList : [ ] ,
@ -1384,7 +1505,7 @@ export default {
columnWidth : 150
}
] ,
columnSubDetailList : [
columnSubDetailList1 : [
{
userId : this . $store . state . user . name ,
functionId : 601002 ,
@ -1439,60 +1560,8 @@ export default {
fixed : '' ,
columnWidth : 300
} ,
{
userId : this . $store . state . user . name ,
functionId : 601002 ,
serialNumber : '601002Table2QtyPerAssembly' ,
tableId : '601002Table2' ,
tableName : 'BOM子物料表' ,
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 : 601002 ,
serialNumber : '601002Table2ComponentScrap' ,
tableId : '601002Table2' ,
tableName : 'BOM子物料表' ,
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 : 601002 ,
serialNumber : '601002Table2ShrinkageFactor' ,
tableId : '601002Table2' ,
tableName : 'BOM子物料表' ,
columnProp : 'shrinkageFactor' ,
headerAlign : 'center' ,
align : 'right' ,
columnLabel : '损耗率' ,
columnHidden : false ,
columnImage : false ,
columnSortable : false ,
sortLv : 0 ,
status : true ,
fixed : '' ,
columnWidth : 80
} ,
] ,
columnSubDetailList2 : [
{
userId : this . $store . state . user . name ,
functionId : 601002 ,
@ -1602,206 +1671,6 @@ export default {
columnWidth : 150
} ,
] ,
columnSubDetailList2 : [
{
userId : this . $store . state . user . name ,
functionId : 601002 ,
serialNumber : '601002Table3LineSequence' ,
tableId : '601002Table3' ,
tableName : 'BOM副产品表' ,
columnProp : 'lineSequence' ,
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 : 601002 ,
serialNumber : '601002Table3ComponentPart' ,
tableId : '601002Table3' ,
tableName : 'BOM副产品表' ,
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 : 601002 ,
serialNumber : '601002Table3ComponentPartDesc' ,
tableId : '601002Table3' ,
tableName : 'BOM副产品表' ,
columnProp : 'componentPartDesc' ,
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 : 601002 ,
serialNumber : '601002Table3QtyPerAssembly' ,
tableId : '601002Table3' ,
tableName : 'BOM副产品表' ,
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 : 601002 ,
serialNumber : '601002Table3ComponentScrap' ,
tableId : '601002Table3' ,
tableName : 'BOM副产品表' ,
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 : 601002 ,
serialNumber : '601002Table3ShrinkageFactor' ,
tableId : '601002Table3' ,
tableName : 'BOM副产品表' ,
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 : 601002 ,
serialNumber : '601002Table3PrintUnit' ,
tableId : '601002Table3' ,
tableName : 'BOM副产品表' ,
columnProp : 'printUnit' ,
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 : 601002 ,
serialNumber : '601002Table3IssueType' ,
tableId : '601002Table3' ,
tableName : 'BOM副产品表' ,
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 : 601002 ,
serialNumber : '601002Table3OperationDesc' ,
tableId : '601002Table3' ,
tableName : 'BOM副产品表' ,
columnProp : 'operationId' ,
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 : 601002 ,
serialNumber : '601002Table3IssueToLoc' ,
tableId : '601002Table3' ,
tableName : 'BOM副产品表' ,
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 : 601002 ,
serialNumber : '601002Table3NoteText' ,
tableId : '601002Table3' ,
tableName : 'BOM副产品表' ,
columnProp : 'noteText' ,
headerAlign : 'center' ,
align : 'left' ,
columnLabel : '备注' ,
columnHidden : false ,
columnImage : false ,
columnSortable : false ,
sortLv : 0 ,
status : true ,
fixed : '' ,
columnWidth : 150
} ,
] ,
operationDetailList : [
{
columnProp : 'routingRevision' ,
@ -2037,6 +1906,7 @@ export default {
} ,
/ / = = = = = = = = 复 选 数 据 集 = = = = = = = =
bomSelections : [ ] ,
batchComponentSelections : [ ] ,
/ / = = = = = = = = 模 态 框 开 关 控 制 = = = = = = = =
authSearch : false ,
authSave : false ,
@ -2056,6 +1926,7 @@ export default {
copyAlternativeModelFlag : false ,
headerSaveFlag : false ,
menuId : this . $route . meta . menuId ,
batchComponentPartModelFlag : false
}
} ,
@ -2199,6 +2070,25 @@ export default {
this . queryCopyPartModal ( )
} ,
/ * *
* 每页数
* @ param val
* /
sizeChangeHandle5 ( val ) {
this . pageSize5 = val
this . pageIndex5 = 1
this . queryBatchComponentPartList ( )
} ,
/ * *
* 当前页
* @ param val
* /
currentChangeHandle5 ( val ) {
this . pageIndex5 = val
this . queryBatchComponentPartList ( )
} ,
/ / = = = = = = = = 页 签 切 换 相 关 方 法 = = = = = = = =
/ * *
@ -2256,6 +2146,16 @@ export default {
this . $refs . selectDiv . setLengthselected ( this . bomSelections . length )
} ,
/ / 点 击 行 选 中 复 选 框
batchSaveClickRow ( row ) {
this . $refs . batchSaveTable . toggleRowSelection ( row )
} ,
/ / 复 选 子 物 料 信 息
selectionSaveComponent ( val ) {
this . batchComponentSelections = val
} ,
/ / = = = = = = = = 新 增 / 编 辑 模 态 框 = = = = = = = =
/ * *
* bom新增模态框
@ -2269,7 +2169,7 @@ export default {
buNo : this . userBuList [ 0 ] . buNo . split ( '_' ) [ 1 ] ,
partNo : '' ,
partDesc : '' ,
engChgLevel : '' ,
engChgLevel : undefined ,
bomType : 'Manufacturing' ,
noteText : '' ,
effPhaseInDate : new Date ( + new Date ( ) + 8 * 3600 * 1000 ) . toISOString ( ) . replace ( /T/g , ' ' ) . replace ( /\.[\d]{3}Z/ , '' ) ,
@ -2496,6 +2396,26 @@ export default {
this . componentSaveModal = true
} ,
/ / 批 量 新 增 子 物 料 模 态 框
batchSaveComponentModal ( ) {
this . batchComponentPartData . limit = this . pageSize5
this . batchComponentPartData . page = this . pageIndex5
this . batchComponentPartData . site = this . modalData . site
this . batchComponentPartData . buNo = this . modalData . buNo
/ / 查 询 所 有 物 料
queryPartListAll ( this . batchComponentPartData ) . then ( ( { data } ) => {
if ( data && data . code === 0 ) {
this . batchComponentPartList = data . page . list
this . pageIndex5 = data . page . currPage
this . pageSize5 = data . page . pageSize
this . totalPage5 = data . page . totalCount
this . batchComponentPartModelFlag = true
} else {
this . batchComponentPartList = [ ]
}
} )
} ,
/ * *
* 副产品新增模态框
* /
@ -2880,9 +2800,7 @@ export default {
this . totalPage3 = data . page . totalCount
this . componentPartModelFlag = true
} else {
this . $alert ( data . msg , '错误' , {
confirmButtonText : '确定'
} )
this . componentPartList = [ ]
}
} )
} ,
@ -2931,6 +2849,25 @@ export default {
} )
} ,
/ * *
* 子物料查询列表
* /
queryBatchComponentPartList ( ) {
this . batchComponentPartData . limit = this . pageSize5
this . batchComponentPartData . page = this . pageIndex5
/ / 查 询 所 有 物 料
queryPartList ( this . batchComponentPartData ) . then ( ( { data } ) => {
if ( data && data . code === 0 ) {
this . batchComponentPartList = data . page . list
this . pageIndex5 = data . page . currPage
this . pageSize5 = data . page . pageSize
this . totalPage5 = data . page . totalCount
} else {
this . batchComponentPartList = [ ]
}
} )
} ,
/ * *
* copy物料查询列表
* /
@ -2960,7 +2897,7 @@ export default {
this . componentPartData . partNo = this . componentData . componentPart
queryPartListAll ( this . componentPartData ) . then ( ( { data } ) => {
if ( data && data . code === 0 ) {
if ( data . page . list . length === 1 ) {
if ( data . page . list . length > 0 ) {
this . componentData . componentPartDesc = data . page . list [ 0 ] . partDesc
this . componentData . printUnit = data . page . list [ 0 ] . printUnit
this . componentData . printUnitName = data . page . list [ 0 ] . printUnitName
@ -3182,6 +3119,64 @@ export default {
}
} ,
/ / 批 量 新 增 子 件
batchComponentDataSave ( ) {
this . $confirm ( "是否确认添加该" + this . batchComponentSelections . 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 . batchComponentPartData . shrinkageFactor ,
lineItemNo : '' ,
operationId : '' ,
operationNo : '' ,
issueToLoc : '' ,
issueToLocName : '' ,
noteText : '' ,
createBy : this . $store . state . user . name ,
lineSequence : '' ,
issueType : 'Reserve And Backflush' ,
productFlag : 'component' ,
batchSaveList : this . batchComponentSelections
}
batchSaveBomComponent ( tempData ) . then ( ( { data } ) => {
if ( data && data . code === 0 ) {
this . subDetailList = data . rows . subDetailList
this . batchComponentPartModelFlag = false
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
}
} )
} )
} ,
/ * *
* 回车事件
* /