|
|
@@ -76,15 +76,17 @@
|
|
|
},
|
|
|
moldingRecordList: [],// 成型记录明细信息
|
|
|
// 成型记录明细列表
|
|
|
- productUniqueCodeCount: 0,//绑定条码个数
|
|
|
+ productUniqueCodeCount: 0,//绑定条码个数(如果长度和查询数据长度一致则不能进行绑定条码)
|
|
|
//成型记录明细列表
|
|
|
moldingRecordTreeColumns: [
|
|
|
// 分组序号
|
|
|
- { field: 'moldlineItemNo', title: self.$t('groupNo'),
|
|
|
+ {
|
|
|
+ field: 'moldlineItemNo', title: self.$t('bondingNo'),
|
|
|
dataType: self.$config.tableSelectType.product, controlId: 'pdtModelId',
|
|
|
- treeNode: true, type: 'disabled', width: 'auto' },
|
|
|
+ treeNode: true, type: 'disabled', width: 'auto'
|
|
|
+ },
|
|
|
// 分组名称
|
|
|
- { field: 'moldlineItemCode', title: self.$t('groupName'), type: 'disabled', width: 'auto' },
|
|
|
+ { field: 'moldlineItemCode', title: self.$t('repPdtModelName'), type: 'disabled', width: 'auto' },
|
|
|
// 成型线编码
|
|
|
{ field: 'uniqueCode', title: self.$t('moldlineCode'), type: 'disabled', width: 'auto' },
|
|
|
// 成型线名称
|
|
|
@@ -97,8 +99,6 @@
|
|
|
{ field: 'modelCode', title: self.$t('productCode'), type: 'disabled', width: 'auto' },
|
|
|
// 产品名称
|
|
|
{ field: 'modelName', title: self.$t('productName'), type: 'disabled', width: 'auto' },
|
|
|
- // 模具编号
|
|
|
- { field: 'mouldCode', title: self.$t('moldingModelCode'), type: 'disabled', width: 'auto' },
|
|
|
// 模具状态
|
|
|
{ field: 'moldlineItemKindName', title: self.$t('mouldKindName'), type: 'disabled', width: 'auto' },
|
|
|
// 绑码标识
|
|
|
@@ -241,7 +241,7 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- this.$refs.moldingRecord.tableData = this.moldingRecordList;
|
|
|
+ this.$refs.moldingRecord.tableData = this.moldingRecordList
|
|
|
// 处理子级数据
|
|
|
this.$refs.moldingRecord.loadChildrenInit(this.moldingRecordList, ['productUniqueCode'])
|
|
|
// 重新刷新
|
|
|
@@ -285,38 +285,40 @@
|
|
|
this.$set(this.moldingRecordList[rowIndex], field, row[field])
|
|
|
this.$set(this.moldingRecordList[rowIndex], 'productUniqueFlag', true)
|
|
|
row.productUniqueFlag = true
|
|
|
- //改变每条总单下明细的绑定条码
|
|
|
- for (let item = 0; item < row.bomItems.length; item++) {
|
|
|
- //从后台数据查出来绑定条码已经存在的不需要赋值;
|
|
|
- if (!row.bomItems[item].readOnlyUniqueCode) {
|
|
|
- this.$set(row.bomItems[item], 'productUniqueFlag', true)
|
|
|
- this.$set(row.bomItems[item], 'productUniqueCode', row[field])
|
|
|
- }
|
|
|
- //修改备注也要修改productUniqueFlag标识 用于后续保存数据过滤
|
|
|
- if(field =='productRemarks'){
|
|
|
- this.$set(row.bomItems[item], 'productUniqueFlag', true)
|
|
|
- }
|
|
|
+ //改变每条总单下明细的绑定条码
|
|
|
+ for (let item = 0; item < row.bomItems.length; item++) {
|
|
|
+ //从后台数据查出来绑定条码已经存在的不需要赋值;
|
|
|
+ if (!row.bomItems[item].readOnlyUniqueCode) {
|
|
|
+ this.$set(row.bomItems[item], 'productUniqueFlag', true)
|
|
|
+ this.$set(row.bomItems[item], 'productUniqueCode', row[field])
|
|
|
}
|
|
|
- for (let i = 0; i < this.moldingRecordList.length; i++) {
|
|
|
- if (this.moldingRecordList[i].id == row.id) {
|
|
|
- this.moldingRecordList[i] = row
|
|
|
- }
|
|
|
+ //修改备注也要修改productUniqueFlag标识 用于后续保存数据过滤
|
|
|
+ if (field == 'productRemarks') {
|
|
|
+ this.$set(row.bomItems[item], 'productUniqueFlag', true)
|
|
|
}
|
|
|
- // 处理子级数据
|
|
|
- this.$refs.moldingRecord.loadChildrenInit(this.moldingRecordList, ['productUniqueCode'])
|
|
|
- // this.$refs.moldingRecord.reloadData(this.moldingRecordList)
|
|
|
+ }
|
|
|
+ for (let i = 0; i < this.moldingRecordList.length; i++) {
|
|
|
+ if (this.moldingRecordList[i].id == row.id) {
|
|
|
+ this.moldingRecordList[i] = row
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$refs.moldingRecord.tableData = this.moldingRecordList
|
|
|
+ // 处理子级数据
|
|
|
+ this.$refs.moldingRecord.loadChildrenInit(this.moldingRecordList, ['productUniqueCode'])
|
|
|
+ // 重新刷新
|
|
|
+ this.$refs.moldingRecord.reloadTreeTable(this.moldingRecordList)
|
|
|
},
|
|
|
/**
|
|
|
* @desc : 替换子集
|
|
|
* @date : 2023/4/24 15:09
|
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
|
- checkDetail(oldRow,newRow){
|
|
|
- for(let it of this.moldingRecordList){
|
|
|
- let index =0
|
|
|
- for(let item of it.bomItems){
|
|
|
- if(item.id ==oldRow.id){
|
|
|
- newRow.moldingItemId= newRow.itemId
|
|
|
+ checkDetail(oldRow, newRow) {
|
|
|
+ for (let it of this.moldingRecordList) {
|
|
|
+ let index = 0
|
|
|
+ for (let item of it.bomItems) {
|
|
|
+ if (item.id == oldRow.id) {
|
|
|
+ newRow.moldingItemId = newRow.itemId
|
|
|
item = Object.assign(item, newRow)
|
|
|
index++
|
|
|
break
|
|
|
@@ -331,12 +333,14 @@
|
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
|
detail(id) {
|
|
|
+ //绑定条码计数 每次查询之前要清零(因为保存后要重新调用)
|
|
|
+ this.productUniqueCodeCount = 0
|
|
|
let param = {
|
|
|
'moldlineId': parseInt(id),
|
|
|
'pdtGlueKind': this.$route.query.pdtGlueKind,
|
|
|
'moldingBatch': this.$route.query.moldingBatch,
|
|
|
'moldingDate': this.$route.query.moldingDate,
|
|
|
- 'ftyId' : this.$store.state.user.ftyId
|
|
|
+ 'ftyId': this.$store.state.user.ftyId
|
|
|
}
|
|
|
return this.excute(this.$service.moldingRecordItemService, this.$service.moldingRecordItemService.selectByMoldineId, param).then(res => {
|
|
|
if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
@@ -345,7 +349,7 @@
|
|
|
this.moldingRecordList = list
|
|
|
let index = 0
|
|
|
for (let i of this.moldingRecordList) {
|
|
|
- i.pdtModelId= this.$config.bindBarCodePdtModelId.parentId
|
|
|
+ i.pdtModelId = this.$config.bindBarCodePdtModelId.parentId
|
|
|
//明细已有绑定条码个数
|
|
|
let productUniqueCodeLength = 0
|
|
|
//明细已有成型标识个数
|
|
|
@@ -365,19 +369,19 @@
|
|
|
this.$set(item, 'readOnly', ['productUniqueCode'])
|
|
|
//如果明细里绑定条码存在没值的情况;总单绑定条码可以输入 反之不可以;明细有值没值都要禁用
|
|
|
if (item.productUniqueCode) {
|
|
|
- item.exchangeFlag=false
|
|
|
+ item.exchangeFlag = false
|
|
|
productUniqueCodeLength++
|
|
|
item.readOnlyUniqueCode = true
|
|
|
}
|
|
|
//明细不是成型
|
|
|
if (!item.flgMolding) {
|
|
|
- item.exchangeFlag=false
|
|
|
+ item.exchangeFlag = false
|
|
|
flgMoldingLength++
|
|
|
}
|
|
|
itemIndex++
|
|
|
}
|
|
|
//明细中每条绑定条码都有值 = 每条总单下的明细数量 或者 是成型标识数量大于0
|
|
|
- if (productUniqueCodeLength == i.bomItems.length || flgMoldingLength>0) {
|
|
|
+ if (productUniqueCodeLength == i.bomItems.length || flgMoldingLength > 0) {
|
|
|
i.readOnlyUniqueCode = true
|
|
|
//明细第一条绑定条码赋值给父级
|
|
|
this.$set(this.moldingRecordList[index], 'productUniqueCode', zeroCode)
|
|
|
@@ -408,15 +412,15 @@
|
|
|
if (this.moldingRecordList.length > 0) {
|
|
|
//提取明细信息
|
|
|
for (let it of this.moldingRecordList.filter(it => it.productUniqueFlag)) {
|
|
|
- let bomItems= it.bomItems.filter(item => item.productUniqueFlag)
|
|
|
+ let bomItems = it.bomItems.filter(item => item.productUniqueFlag)
|
|
|
list.push({
|
|
|
- moldingItemIds: bomItems.map(map =>map.moldingItemId),
|
|
|
- ftyId :bomItems[0].ftyId,
|
|
|
- moldingItemId :bomItems[0].moldingItemId,
|
|
|
- uniqueId :bomItems[0].productId,
|
|
|
+ moldingItemIds: bomItems.map(map => map.moldingItemId),
|
|
|
+ ftyId: bomItems[0].ftyId,
|
|
|
+ moldingItemId: bomItems[0].moldingItemId,
|
|
|
+ uniqueId: bomItems[0].productId,
|
|
|
uniqueCode: bomItems[0].productId ? null : it.productUniqueCode,
|
|
|
- remarks :it.productRemarks,
|
|
|
- flgPdtGlue :true,
|
|
|
+ remarks: it.productRemarks,
|
|
|
+ flgPdtGlue: true,
|
|
|
})
|
|
|
}
|
|
|
}
|