|
|
@@ -238,6 +238,7 @@ export default {
|
|
|
},
|
|
|
{field: 'remarks', type: 'text', width: 'auto'},
|
|
|
],
|
|
|
+ moldlineItemDisabledFlag:false,
|
|
|
//模具型号list
|
|
|
modelList: [],
|
|
|
//工厂区域list
|
|
|
@@ -252,6 +253,12 @@ export default {
|
|
|
userBindKindList: [],
|
|
|
}
|
|
|
},
|
|
|
+ watch:{
|
|
|
+ //监听模具列表可变更产品型号是否可用
|
|
|
+ moldlineItemDisabledFlag(n,o){
|
|
|
+ this.moldlineItemColumn[9].disabled=n
|
|
|
+ }
|
|
|
+ },
|
|
|
methods:{
|
|
|
/**
|
|
|
* @desc : tabs切换事件
|
|
|
@@ -287,13 +294,32 @@ export default {
|
|
|
if (!this.moldlineGroupList[e.rowIndex]) {
|
|
|
this.moldlineGroupList[e.rowIndex] = {}
|
|
|
}
|
|
|
-
|
|
|
if (Object.keys(e).length == 2 && this.moldlineGroupList[e.oldRowIndex]) {
|
|
|
this.moldlineGroupList[e.oldRowIndex].moldingUserList = this.$refs.moldlineGroupUserTable.tableData
|
|
|
this.moldlineGroupList[e.oldRowIndex].moldlineItemList = this.$refs.moldlineItemTable.tableData
|
|
|
}
|
|
|
+ //分组不是第一行 模具可变更型号禁用
|
|
|
+ if(e.rowIndex!=0){
|
|
|
+ this.moldlineItemDisabledFlag = true
|
|
|
+ }else{
|
|
|
+ this.moldlineItemDisabledFlag = false
|
|
|
+ }
|
|
|
this.moldlineGroupUserList = this.moldlineGroupList[e.rowIndex].moldingUserList || []
|
|
|
this.moldlineItemList = this.moldlineGroupList[e.rowIndex].moldlineItemList || []
|
|
|
+ //分组模式下
|
|
|
+ if(this.$config.pdtGlueKind.fenZu == this.formData.pdtGlueKind){
|
|
|
+ //分组序号是1中的模具可变更型号赋值给其他分组下的模具。例如:分组1模具1赋值给分组2模具1
|
|
|
+ let list = this.moldlineGroupList[0].moldlineItemList
|
|
|
+ for(let item in list){
|
|
|
+ for(let it in this.moldlineItemList ){
|
|
|
+ if(it == item){
|
|
|
+ this.moldlineItemList[it].repPdtModelId=list[item].repPdtModelId
|
|
|
+ this.moldlineItemList[it].repPdtModelName=list[item].repPdtModelName
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
/**
|
|
|
* @desc : 添加分组
|
|
|
@@ -328,7 +354,7 @@ export default {
|
|
|
*/
|
|
|
delItem (row, rowIndex) {
|
|
|
this.moldlineItemList.splice(rowIndex, 1)
|
|
|
- this.moldlineGroupList[this.$refs.moldlineGroupList.currentRowIndex].moldlineItemList = this.moldlineItemList
|
|
|
+ this.moldlineGroupList[this.$refs.moldlineGroupTable.currentRowIndex].moldlineItemList = this.moldlineItemList
|
|
|
},
|
|
|
/**
|
|
|
* @desc : 删除分组-工号
|
|
|
@@ -337,7 +363,7 @@ export default {
|
|
|
*/
|
|
|
delGroupUser (row, rowIndex) {
|
|
|
this.moldlineGroupUserList.splice(rowIndex, 1)
|
|
|
- this.moldlineGroupList[this.$refs.moldlineGroupList.currentRowIndex].moldingUserList = this.moldlineGroupUserList
|
|
|
+ this.moldlineGroupList[this.$refs.moldlineGroupTable.currentRowIndex].moldingUserList = this.moldlineGroupUserList
|
|
|
},
|
|
|
/**
|
|
|
* @desc : 保存可变更产品名称
|
|
|
@@ -362,6 +388,11 @@ export default {
|
|
|
* @date : 2023-02-07 13:54
|
|
|
*/
|
|
|
saveDetailChange (field, row, rowIndex){
|
|
|
+ //模具表格改动-可变更产品型号
|
|
|
+ if(typeof rowIndex =='number' && field=='repPdtModelName'){
|
|
|
+ this.moldlineItemList[rowIndex].repPdtModelId = row.repPdtModelId
|
|
|
+ this.moldlineItemList[rowIndex].repPdtModelName = row.repPdtModelName
|
|
|
+ }
|
|
|
this.changeCurrentGroup({rowIndex: this.$refs.moldlineGroupTable.currentRowIndex, oldRowIndex: this.$refs.moldlineGroupTable.currentRowIndex})
|
|
|
},
|
|
|
/**
|
|
|
@@ -386,13 +417,37 @@ export default {
|
|
|
searchDetailFlag: false
|
|
|
},)
|
|
|
}
|
|
|
+ this.moldlineItemColumn = this.moldlineItemColumn.filter(f => f.field != 'repPdtModelName')
|
|
|
} else {
|
|
|
this.moldlineGroupColumn = this.moldlineGroupColumn.filter(f => f.field != 'repPdtModelName')
|
|
|
+ //分组粘贴模具表格增加可变更产品型号
|
|
|
+ if (!this.moldlineItemColumn.some(s => s.field == 'repPdtModelName')) {
|
|
|
+ this.moldlineItemColumn.push({
|
|
|
+ field: 'repPdtModelName',
|
|
|
+ selectField: 'modelCode',
|
|
|
+ width: 150,
|
|
|
+ type: 'tableSelect',
|
|
|
+ param: () => {
|
|
|
+ return {}
|
|
|
+ },
|
|
|
+ sortBoolean: false,
|
|
|
+ dataType: this.$config.tableSelectType.product,
|
|
|
+ fieldUpdate: this.$updateColumns.moldlineGroupChooseMould,
|
|
|
+ searchDetailFlag: false,
|
|
|
+ disabled:this.moldlineItemDisabledFlag,
|
|
|
+ },)
|
|
|
+ }
|
|
|
}
|
|
|
+ //分组表格刷新
|
|
|
this.$nextTick(()=>{
|
|
|
this.$refs.moldlineGroupTable.initColumn()
|
|
|
this.$refs.moldlineGroupTable.refreshTableColumns(this.moldlineGroupColumn)
|
|
|
})
|
|
|
+ //模具表格刷新
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.$refs.moldlineItemTable.initColumn()
|
|
|
+ this.$refs.moldlineItemTable.refreshTableColumns(this.moldlineItemColumn)
|
|
|
+ })
|
|
|
},
|
|
|
/**
|
|
|
* @desc : 改变多批次标识
|
|
|
@@ -410,14 +465,23 @@ export default {
|
|
|
* @date : 2023-02-08 13:48
|
|
|
*/
|
|
|
addItem (val){
|
|
|
+ //分组模式下
|
|
|
+ if (this.$config.pdtGlueKind.fenZu == this.formData.pdtGlueKind && this.$refs.moldlineGroupTable.currentRowIndex!=0) {
|
|
|
+ //本次新建模具与分组1中模具数量不一致不允许新建
|
|
|
+ if (this.moldlineGroupList[0].moldlineItemList && this.moldlineItemList.length+1 > this.moldlineGroupList[0].moldlineItemList.length) {
|
|
|
+ this.$Message.error(this.$t('W_146'))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
let list = this.moldlineItemList.copy().filter(f => f.itemNo)
|
|
|
+ let firstItem = this.$refs.moldlineGroupTable.currentRowIndex!=0 ? this.moldlineGroupList[0].moldlineItemList:null
|
|
|
for (let i = val.outputQty; i > 0; i--) {
|
|
|
//成型线位置序号的范围【1-999】,最多999个模具
|
|
|
if (val.startItemNo + i - 1 < 1 || val.startItemNo + i - 1 > 999) {
|
|
|
this.$Message.error(this.$t('W_105'))
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+ //分组粘贴方式下 分组序号1中模具已有可变更产品型号,将数据赋值给其他分组序号下的模具
|
|
|
list.push({
|
|
|
itemNo: val.startItemNo + i - 1,
|
|
|
productId: val.model ? val.model[i-1].modelId : val.productId,
|
|
|
@@ -427,7 +491,10 @@ export default {
|
|
|
mouldCode: val.mouldCode,
|
|
|
outputStdNum: val.outputStdNum,
|
|
|
outputMoldedNum: val.outputMoldedNum,
|
|
|
- outputQty: val.outputQty
|
|
|
+ outputQty: val.outputQty,
|
|
|
+ //可变更产品型号
|
|
|
+ repPdtModelId:firstItem && firstItem[i-1].repPdtModelId?firstItem[i-1].repPdtModelId:null,
|
|
|
+ repPdtModelName:firstItem && firstItem[i-1].repPdtModelName?firstItem[i-1].repPdtModelName:null,
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -443,6 +510,7 @@ export default {
|
|
|
})
|
|
|
this.moldlineItemList = list
|
|
|
this.moldlineGroupList[this.$refs.moldlineGroupTable.currentRowIndex].moldlineItemList = list
|
|
|
+
|
|
|
},
|
|
|
/**
|
|
|
* @desc : 判断分组是否能删除
|
|
|
@@ -693,7 +761,13 @@ export default {
|
|
|
this.$Message.error(this.$t('W_097'))
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
+ //组内粘贴可变更产品名称不能为空
|
|
|
+ if(this.$config.pdtGlueKind.zuNei === this.formData.pdtGlueKind){
|
|
|
+ if (this.moldlineGroupList && this.moldlineGroupList.some(s => s.repPdtModelName==null || !s.repPdtModelName)) {
|
|
|
+ this.$Message.error(this.$t('W_145'))
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
for (let it of this.moldlineGroupList) {
|
|
|
let noList = []
|
|
|
|
|
|
@@ -713,6 +787,22 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //todo 校验模具明细是分组情况下 模具长度是否一致 可变更产品型号不可为空
|
|
|
+ if (this.$config.pdtGlueKind.fenZu == this.formData.pdtGlueKind) {
|
|
|
+ let itemListLength =[]
|
|
|
+ //分组粘贴下模具表格长度不一致
|
|
|
+ itemListLength = this.moldlineGroupList.filter(fil=>fil.moldlineItemList).map(map=>map.moldlineItemList.length)
|
|
|
+ if (itemListLength.filter(it=>it != this.moldlineGroupList[0].moldlineItemList.length).length>0) {
|
|
|
+ this.$Message.error(this.$t('W_146'))
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ for (let item of this.moldlineItemList) {
|
|
|
+ if (this.moldlineItemList && this.moldlineItemList.some(s => s.repPdtModelName == null || !s.repPdtModelName)) {
|
|
|
+ this.$Message.error(this.$t('W_145'))
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
return true;
|
|
|
},
|
|
|
@@ -746,6 +836,7 @@ export default {
|
|
|
outputMoldedNum: mm.outputMoldedNum,
|
|
|
outputQty: mm.outputQty,
|
|
|
modelId: mm.productId,
|
|
|
+ repPdtModelId:mm.repPdtModelId,
|
|
|
}
|
|
|
}) : [],
|
|
|
}
|