|
|
@@ -25,9 +25,14 @@
|
|
|
@click="bindBarcodeButton" style="margin-right: 10px">{{ $v('bindBarcode') }}
|
|
|
</DkButton>
|
|
|
<!-- 清空条码 -->
|
|
|
- <DkButton :disabled="productUniqueCodeCount==moldingRecordList.length" @click="clearBindBarcode">{{
|
|
|
+ <DkButton :disabled="productUniqueCodeCount==moldingRecordList.length"
|
|
|
+ style="margin-right: 10px" @click="clearBindBarcode">{{
|
|
|
$v('clearBindBarcode') }}
|
|
|
</DkButton>
|
|
|
+ <!-- 撤销条码 -->
|
|
|
+ <DkButton :disabled="productUniqueCodeCount==0" @click="revokeBindBarcode">{{
|
|
|
+ $v('revokeBindBarcode') }}
|
|
|
+ </DkButton>
|
|
|
</DkForm>
|
|
|
</DkPanel>
|
|
|
|
|
|
@@ -84,8 +89,10 @@
|
|
|
productUniqueCodeCount: 0,//绑定条码个数(如果长度和查询数据长度一致则不能进行绑定条码)
|
|
|
//成型记录明细列表
|
|
|
moldingRecordTreeColumns: [
|
|
|
- { field: 'ttttt', type: 'switch', width: 'auto' ,childCanInput: false,
|
|
|
- equal: true,},
|
|
|
+ {
|
|
|
+ field: 'revokeFlag', type: 'switch', width: 'auto', childCanInput: false,
|
|
|
+ equal: true, treeNode: true,
|
|
|
+ },
|
|
|
// 分组序号
|
|
|
{
|
|
|
field: 'moldlineItemNo', title: self.$t('bondingNo'),
|
|
|
@@ -282,39 +289,82 @@
|
|
|
this.$refs.moldingRecord.reloadData(this.moldingRecordList)
|
|
|
},
|
|
|
/**
|
|
|
+ * @desc : 撤销条码
|
|
|
+ * @date : 2023/5/8 9:53
|
|
|
+ * @author : 寇珊珊
|
|
|
+ */
|
|
|
+ revokeBindBarcode() {
|
|
|
+ let list = this.moldingRecordList.filter(it=>it.revokeFlag)
|
|
|
+ let pdtUniqueIdList=[]
|
|
|
+ for(let item of list ){
|
|
|
+ for(let it of item.bomItems){
|
|
|
+ if(it.pdtUniqueId){
|
|
|
+ pdtUniqueIdList.push(it.pdtUniqueId)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (pdtUniqueIdList.length == 0) {
|
|
|
+ this.$Message.error(this.$t('W_150'))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.excute(this.$service.productService, this.$service.productService.undo, pdtUniqueIdList).then(res => {
|
|
|
+ if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
+ this.$Message.success(res.message)
|
|
|
+ this.detail(this.$route.params.id)
|
|
|
+ } else {
|
|
|
+ this.$Message.error(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
* @desc : 值改变
|
|
|
* @date : 2023/2/28 11:23
|
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
|
changeValue(value) {
|
|
|
- let field = value.field
|
|
|
- let row = value.row
|
|
|
- let rowIndex = value.rowIndex
|
|
|
- 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)
|
|
|
+ if (value && value.field) {
|
|
|
+ let field = value.field
|
|
|
+ let row = value.row
|
|
|
+ let rowIndex = value.rowIndex
|
|
|
+ if (value.field == 'productUniqueCode') {
|
|
|
+ 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 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)
|
|
|
}
|
|
|
- }
|
|
|
- for (let i = 0; i < this.moldingRecordList.length; i++) {
|
|
|
- if (this.moldingRecordList[i].id == row.id) {
|
|
|
- this.moldingRecordList[i] = row
|
|
|
+ //撤销标识
|
|
|
+ else if(value.field == 'revokeFlag'){
|
|
|
+ //可以进行条码绑定-就不可以撤销
|
|
|
+ if(row.canProductUniqueCode){
|
|
|
+ this.$Message.error(this.$t('W_151'))
|
|
|
+ row.revokeFlag=false
|
|
|
+ }else {
|
|
|
+ this.$set(this.moldingRecordList[rowIndex], 'revokeFlag', true)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- this.$refs.moldingRecord.tableData = this.moldingRecordList
|
|
|
- // 处理子级数据
|
|
|
- this.$refs.moldingRecord.loadChildrenInit(this.moldingRecordList, ['productUniqueCode'])
|
|
|
- // 重新刷新
|
|
|
- this.$refs.moldingRecord.reloadTreeTable(this.moldingRecordList)
|
|
|
+
|
|
|
},
|
|
|
/**
|
|
|
* @desc : 替换子集
|
|
|
@@ -341,6 +391,11 @@
|
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
|
getDetailAdd(e) {
|
|
|
+ if(e && e.column){
|
|
|
+ if(e.column.field =='revokeFlag'){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
//只存父级
|
|
|
if (e && e.row && e.row.hasChild == 1) {
|
|
|
this.row = e.row
|
|
|
@@ -359,9 +414,6 @@
|
|
|
if (this.row) {
|
|
|
if (!this.row.modelCount || (this.row.modelCount && this.row.modelCount != this.row.bomItems.length)) {
|
|
|
//赋值查询类型
|
|
|
- this.moldingRecordTreeColumns[0].dataType = this.$config.tableSelectType.addProduct
|
|
|
- //设置组件弹窗字段
|
|
|
- this.$refs.moldingRecord.setLoadChildInit()
|
|
|
this.$refs.moldingRecord.focusedRow = this.row
|
|
|
//加载数据
|
|
|
this.$refs.moldingRecord.getDataTable(this.row)
|
|
|
@@ -415,6 +467,7 @@
|
|
|
let index = 0
|
|
|
for (let i of this.moldingRecordList) {
|
|
|
i.pdtModelId = this.$config.bindBarCodePdtModelId.parentId
|
|
|
+ i.modelCount= i.bomItems[0].modelCount
|
|
|
//明细已有绑定条码个数
|
|
|
let productUniqueCodeLength = 0
|
|
|
//明细已有成型标识个数
|
|
|
@@ -529,10 +582,10 @@
|
|
|
}
|
|
|
//todo 判断每组数据是否达到可保存数量
|
|
|
//如果本次都不需要绑定条码
|
|
|
- if(this.productUniqueCodeCount != this.moldingRecordList.length){
|
|
|
+ if (this.productUniqueCodeCount != this.moldingRecordList.length) {
|
|
|
//过滤掉总单中本次不需要进行绑定条码的数据
|
|
|
- for(let i of this.moldingRecordList.filter(it=>!it.readOnlyUniqueCode)){
|
|
|
- if(!i.modelCount ||i.modelCount && i.modelCount!= i.bomItems.length){
|
|
|
+ for (let i of this.moldingRecordList.filter(it => !it.readOnlyUniqueCode)) {
|
|
|
+ if (!i.modelCount || i.modelCount && i.modelCount != i.bomItems.length) {
|
|
|
this.$Message.error(this.$t('W_144'))
|
|
|
return false
|
|
|
}
|