|
|
@@ -689,6 +689,10 @@
|
|
|
type: Boolean,
|
|
|
default: false,
|
|
|
},
|
|
|
+ // 查询条件(传入)
|
|
|
+ searchInfo: {
|
|
|
+ type: Object
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
const vm = window.vm
|
|
|
@@ -741,13 +745,19 @@
|
|
|
currentPage: 1
|
|
|
},
|
|
|
// 查询条件
|
|
|
- searchCond: {},
|
|
|
+ searchCond: {
|
|
|
+ _value: {}
|
|
|
+ },
|
|
|
searchContent: [],
|
|
|
// 外部传入的查询条件
|
|
|
otherCondition: {
|
|
|
type: Object,
|
|
|
default: null
|
|
|
},
|
|
|
+ //绑定条码添加标识
|
|
|
+ bindBarCodeAddFlag:false,
|
|
|
+ //绑定条码替换标识
|
|
|
+ bindBarCodeReplaceFlag:false,
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -3630,6 +3640,7 @@
|
|
|
// 绑定条码 不管有值没值都是可以查询数据的
|
|
|
//查询可替换商品
|
|
|
this.getDataTable(row)
|
|
|
+ this.bindBarCodeReplaceFlag=true
|
|
|
}
|
|
|
// 说明已经有值,直接替换,不用查询数据库 只包括父级
|
|
|
else if (this.exchangeField && row[this.exchangeField] && (!row['parentId'] || !row['bomSkuId'])) {
|
|
|
@@ -3664,19 +3675,34 @@
|
|
|
row = this.focusedRow
|
|
|
}
|
|
|
param[this.exchangeField] = row[this.exchangeField]
|
|
|
- if (this.bindBarCodeFlag && row['moldlineId']) {
|
|
|
- param.pdtGlueKind = row['pdtGlueKind']
|
|
|
- //todo 查出所有数据 zdl 2023年4月25日09:01:27
|
|
|
- // param.moldlineId = row['moldlineId']
|
|
|
- //todo 暂时注掉 2023年4月25日08:46:09 zdl
|
|
|
- // param.moldlineItemNoList = this.children.map(it=>it.moldlineItemNo).unique()
|
|
|
- }
|
|
|
+ if (this.bindBarCodeFlag ) {
|
|
|
+ //添加子集
|
|
|
+ if(row.hasChild==1){
|
|
|
+ //成型线Id
|
|
|
+ param.moldlineId = row.bomItems[0]['moldlineId']
|
|
|
+ //产品id集合
|
|
|
+ param.modelIdList = row.bomItems.map(it=>it.mouldId).unique()
|
|
|
+ this.bindBarCodeAddFlag=true
|
|
|
+ }
|
|
|
+ //替换子集
|
|
|
+ else{
|
|
|
+ param.pdtGlueKind = row['pdtGlueKind']
|
|
|
+ //todo 查出所有数据 zdl 2023年4月25日09:01:27
|
|
|
+ // param.moldlineId = row['moldlineId']
|
|
|
+ //todo 暂时注掉 2023年4月25日08:46:09 zdl
|
|
|
+ // param.moldlineItemNoList = this.children.map(it=>it.moldlineItemNo).unique()
|
|
|
+ //赋值查询类型
|
|
|
+ this.columns[0].dataType= this.$config.tableSelectType.product
|
|
|
+ }
|
|
|
+ //设置弹窗字段
|
|
|
+ this.setLoadChildInit()
|
|
|
+ }
|
|
|
// 拼接外部传入的其他参数otherCondition
|
|
|
if (this.otherCondition) {
|
|
|
param = Object.assign(param, this.otherCondition)
|
|
|
}
|
|
|
if (this.searchCond) {
|
|
|
- param = Object.assign(param, this.searchCond._value)
|
|
|
+ param = Object.assign(param, this.searchCond._value)
|
|
|
}
|
|
|
this.excute(this.service, this.service[this.methodsNameExchange], param).then(res => {
|
|
|
if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
@@ -3688,7 +3714,7 @@
|
|
|
arr = [...res.data]
|
|
|
}
|
|
|
this.exchangeData = arr
|
|
|
- //过滤掉当前数据 不是绑定条码事需要
|
|
|
+ //过滤掉当前数据 不是绑定条码需要(这里保留的是原来的逻辑)
|
|
|
if(!this.bindBarCodeFlag){
|
|
|
this.exchangeData = this.exchangeData.filter(it => it[this.controlId] !== row[this.controlId])
|
|
|
}
|
|
|
@@ -3713,8 +3739,7 @@
|
|
|
return true
|
|
|
}
|
|
|
return false
|
|
|
- }
|
|
|
- ,
|
|
|
+ },
|
|
|
/**
|
|
|
* @desc : 选择数据之后
|
|
|
* @author : 周兴
|
|
|
@@ -3728,14 +3753,22 @@
|
|
|
}
|
|
|
let row = this.$refs['table-exchange'].batchRows[0]
|
|
|
//如果是绑定条码
|
|
|
- if(this.bindBarCodeFlag){
|
|
|
+ if (this.bindBarCodeFlag) {
|
|
|
//判断页面中是否已有选择数据
|
|
|
//没有重复数据
|
|
|
- if (this.children.filter(it => it.pdtModelId == row.pdtModelId && it.moldlineId ==row.moldingBatch
|
|
|
- && it.moldingDate ==row.moldingDate &&
|
|
|
+ if (this.children.filter(it => it.pdtModelId == row.pdtModelId && it.moldingBatch == row.moldingBatch
|
|
|
+ && it.moldingDate == row.moldingDate &&
|
|
|
it.moldlineId == row.moldlineId && it.moldlineItemNo == row.moldlineItemNo).length == 0) {
|
|
|
- //替换明细
|
|
|
- this.checkDetailByBindBarCode(row)
|
|
|
+ //添加绑定条码
|
|
|
+ if (this.bindBarCodeAddFlag) {
|
|
|
+ this.addDetailByBindBarCode(row)
|
|
|
+ this.bindBarCodeAddFlag = false
|
|
|
+ }
|
|
|
+ //替换绑定条码
|
|
|
+ else {
|
|
|
+ this.checkDetailByBindBarCode(row)
|
|
|
+ this.bindBarCodeReplaceFlag = false
|
|
|
+ }
|
|
|
this.showModal = false
|
|
|
}
|
|
|
//有重复数据
|
|
|
@@ -3743,7 +3776,7 @@
|
|
|
this.$Message.error(this.$t('W_141'))
|
|
|
return
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
// 判断替品是否有标价
|
|
|
if (!row.priceStandard && row.priceStandard != 0) {
|
|
|
this.$Message.error(this.$t('W_069', { 'param': this.$t('priceStandard') }))
|
|
|
@@ -3798,7 +3831,14 @@
|
|
|
}
|
|
|
}
|
|
|
this.$emit('check-detail-by-bind-bar-code',this.focusedRow,row)
|
|
|
-
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 添加明细--当前绑定条码用
|
|
|
+ * @date : 2023/4/27 14:37
|
|
|
+ * @author : 寇珊珊
|
|
|
+ */
|
|
|
+ addDetailByBindBarCode(row){
|
|
|
+ this.$emit('add-detail-by-bind-bar-code',row)
|
|
|
},
|
|
|
/**
|
|
|
* @desc : 计算父级数据
|
|
|
@@ -3962,7 +4002,7 @@
|
|
|
// {field: 'skuSpecs', type: 'disabled', minWidth: '40', title: this.$t('skuSpecs')},
|
|
|
)
|
|
|
}
|
|
|
- //绑定条码- 产品
|
|
|
+ //绑定条码- 替换产品
|
|
|
else if(col.treeNode && col.dataType === this.$config.tableSelectType.product){
|
|
|
//设置后台接口服务
|
|
|
this.methodsName = 'selectProductByBindBarcode'
|
|
|
@@ -3973,7 +4013,7 @@
|
|
|
{itemCode: 'moldingBatch'},
|
|
|
//成型日期
|
|
|
{itemCode: 'moldingDate',
|
|
|
- valueFormat: {code: 'moldingDate', default: [new Date().toDateStr(), new Date().toDateStr()]},
|
|
|
+ valueFormat: {code: 'moldingDate'},
|
|
|
valueKind: 'DATE_RANGE',},
|
|
|
//分组名称
|
|
|
{itemCode: 'groupName'},
|
|
|
@@ -4025,6 +4065,69 @@
|
|
|
{ field: 'moldlineItemKindName', title: this.$t('mouldKindName'), type: 'disabled', width: 'auto' },
|
|
|
)
|
|
|
}
|
|
|
+ //绑定条码- 添加产品
|
|
|
+ else if(col.treeNode && col.dataType === this.$config.tableSelectType.addProduct){
|
|
|
+ //设置后台接口服务
|
|
|
+ this.methodsName = 'selectProductCanBindBarcode'
|
|
|
+ this.methodsNameExchange = 'selectProductCanBindBarcode'
|
|
|
+ this.service = this.$service.moldingRecordItemService
|
|
|
+ this.searchContent = [
|
|
|
+ //成型批次
|
|
|
+ {itemCode: 'moldingBatch'},
|
|
|
+ //成型日期
|
|
|
+ {itemCode: 'moldingDate',
|
|
|
+ valueFormat: {code: 'moldingDate'},
|
|
|
+ valueKind: 'DATE_RANGE',},
|
|
|
+ //分组名称
|
|
|
+ {itemCode: 'groupName'},
|
|
|
+ //成型线编码
|
|
|
+ {itemCode: 'uniqueCode',
|
|
|
+ itemName:'moldlineCode'
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ //替换的列
|
|
|
+ this.columnsUpdate.push(
|
|
|
+ { field: 'moldlineItemNo',title: this.$t('bondingNo') }, // 粘接序号
|
|
|
+ { field: 'moldlineItemCode',title: this.$t('repPdtModelName') },//可变更产品名称
|
|
|
+ { field: 'repPdtModelName'},//可变更产品名称
|
|
|
+ { field: 'uniqueCode',title: this.$t('moldlineCode')},//成型线编码
|
|
|
+ { field: 'moldlineName' },//成型线名称
|
|
|
+ { field: 'manageUserName' },//成型班长
|
|
|
+ { field: 'moldingUserName' },//成型工号
|
|
|
+ { field: 'modelCode',title: this.$t('productCode') },//产品编码
|
|
|
+ { field: 'modelName',title: this.$t('productName') },//产品名称
|
|
|
+ { field: 'mouldCode',title: this.$t('moldingModelCode') },//模具编号
|
|
|
+ { field: 'moldlineItemKindName',title: this.$t('mouldKindName') },//模具状态
|
|
|
+ { field: 'moldingBatch' },//成型批次
|
|
|
+ { field: 'flgMolding' },//成型标识
|
|
|
+ { field: 'unmoldedReasonName' },//未成型原因
|
|
|
+ { field: 'logoName' },//产品商标
|
|
|
+ { field: 'colourName' },//釉色
|
|
|
+ { field: 'flgScrap' },//损坯标识
|
|
|
+ { field: 'scrapReasonName' },//损坯原因
|
|
|
+ )
|
|
|
+ //弹窗的列
|
|
|
+ this.columnsDetail.push(
|
|
|
+ // 成型批次
|
|
|
+ { field: 'moldingBatch', type: 'disabled', width: 'auto' },
|
|
|
+ // 成型日期
|
|
|
+ { field: 'moldingDate', type: 'disabled', width: 'auto' },
|
|
|
+ // 分组序号
|
|
|
+ { field: 'groupNo', title: this.$t('groupNo'), treeNode: true, type: 'disabled', width: 'auto' },
|
|
|
+ // 分组名称
|
|
|
+ { field: 'groupName', title: this.$t('groupName'), type: 'disabled', width: 'auto' },
|
|
|
+ // 成型线编码
|
|
|
+ { field: 'uniqueCode', title: this.$t('moldlineCode'), type: 'disabled', width: 'auto' },
|
|
|
+ // 成型线名称
|
|
|
+ { field: 'moldlineName', type: 'disabled', width: 'auto' },
|
|
|
+ // 产品编码
|
|
|
+ { field: 'modelCode', title: this.$t('productCode'), type: 'disabled', width: 'auto' },
|
|
|
+ // 产品名称
|
|
|
+ { field: 'modelName', title: this.$t('productName'), type: 'disabled', width: 'auto' },
|
|
|
+ // 模具状态
|
|
|
+ { field: 'moldlineItemKindName', title: this.$t('mouldKindName'), type: 'disabled', width: 'auto' },
|
|
|
+ )
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
/**
|