|
@ -108,6 +108,8 @@ import * as ProductscrapRequestDetailApi from '@/api/wms/productscrapRequestDeta |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as BomDismantleApi from "@/api/wms/bomDismantle"; |
|
|
import * as BomDismantleApi from "@/api/wms/bomDismantle"; |
|
|
import {getProductscrapBomDismantlePage} from "@/api/wms/bomDismantle"; |
|
|
import {getProductscrapBomDismantlePage} from "@/api/wms/bomDismantle"; |
|
|
|
|
|
import * as dismantleRequestDetailbApi from "@/api/wms/dismantleRequestDetailb"; |
|
|
|
|
|
import {updateProductscrapDetailRequestBom} from "@/api/wms/productscrapRequestMain"; |
|
|
|
|
|
|
|
|
// 制品报废申请 |
|
|
// 制品报废申请 |
|
|
defineOptions({ name: 'ProductscrapRequestMain' }) |
|
|
defineOptions({ name: 'ProductscrapRequestMain' }) |
|
@ -136,6 +138,8 @@ const buttondataTable = ref([{ |
|
|
const DialogTitle = ref('Bom信息') |
|
|
const DialogTitle = ref('Bom信息') |
|
|
const bomModelVisible = ref(false) |
|
|
const bomModelVisible = ref(false) |
|
|
const tableListBom = ref() |
|
|
const tableListBom = ref() |
|
|
|
|
|
const lsBomSave = ref() |
|
|
|
|
|
const rowId = ref() |
|
|
const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useTable({ |
|
|
const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useTable({ |
|
|
getListApi: BomDismantleApi.getProductscrapBomDismantlePage |
|
|
getListApi: BomDismantleApi.getProductscrapBomDismantlePage |
|
|
}) |
|
|
}) |
|
@ -151,12 +155,19 @@ const buttonBaseClickBom = (val) => { |
|
|
if (val == 'save') { |
|
|
if (val == 'save') { |
|
|
// 根据 填写的数量 为基准 不填写数量的忽略 |
|
|
// 根据 填写的数量 为基准 不填写数量的忽略 |
|
|
tableListBom.value = detatableDataBom.tableList.filter(item => (item.qty!=0)) |
|
|
tableListBom.value = detatableDataBom.tableList.filter(item => (item.qty!=0)) |
|
|
tableData.value.forEach((item, index) => { |
|
|
if (lsBomSave.value) { |
|
|
if(tableListBom.value[0].rowId == index) { |
|
|
tableData.value.forEach((item, index) => { |
|
|
item.childList = tableListBom.value |
|
|
if(tableListBom.value[0].rowId == index) { |
|
|
} |
|
|
item.childList = tableListBom.value |
|
|
}) |
|
|
} |
|
|
console.log(157, tableData.value) |
|
|
}) |
|
|
|
|
|
}else { |
|
|
|
|
|
// 更新操作 |
|
|
|
|
|
// 详情下的 bom编辑功能 调用接口 保存数据 |
|
|
|
|
|
ProductscrapRequestMainApi.updateProductscrapDetailRequestBom(rowId.value, tableListBom.value) |
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
} |
|
|
|
|
|
// console.log(157, tableData.value) |
|
|
bomModelVisible.value = false |
|
|
bomModelVisible.value = false |
|
|
} |
|
|
} |
|
|
// 关闭 |
|
|
// 关闭 |
|
@ -196,6 +207,7 @@ const tableFormButton = async (val , row) => { |
|
|
bomVersion: row.bomVersion, |
|
|
bomVersion: row.bomVersion, |
|
|
masterId: row.id |
|
|
masterId: row.id |
|
|
} |
|
|
} |
|
|
|
|
|
rowId.value = row.id |
|
|
await getDetailListBom() |
|
|
await getDetailListBom() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -217,18 +229,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
}else if(formField == 'processCode'){ |
|
|
}else if(formField == 'processCode'){ |
|
|
row['processCode'] = val[0]['code'] |
|
|
row['processCode'] = val[0]['code'] |
|
|
}else if(formField == 'itemCode'){ |
|
|
}else if(formField == 'itemCode'){ |
|
|
console.log("aaaaaaaa",val); |
|
|
|
|
|
row['itemCode'] = val[0]['itemCode'] |
|
|
row['itemCode'] = val[0]['itemCode'] |
|
|
row['fromLocationCode'] = val[0]['rawLocationCode'] |
|
|
row['fromLocationCode'] = val[0]['rawLocationCode'] |
|
|
} |
|
|
} |
|
|
// row[formField] = val[0][searchField] |
|
|
|
|
|
// row['containerNumber'] = val[0]['containerNumber'] |
|
|
|
|
|
// row['itemCode'] = val[0]['itemCode'] |
|
|
|
|
|
// row['packingNumber'] = val[0]['packingNumber'] |
|
|
|
|
|
// row['batch'] = val[0]['batch'] |
|
|
|
|
|
// row['uom'] = val[0]['uom'] |
|
|
|
|
|
// row['inventoryStatus'] = val[0]['inventoryStatus'] |
|
|
|
|
|
// row['fromLocationCode'] = val[0]['locationCode'] |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
const setV = {} |
|
|
const setV = {} |
|
|
setV[formField] = val[0][searchField] |
|
|
setV[formField] = val[0][searchField] |
|
@ -240,13 +243,18 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
const setV = {} |
|
|
const setV = {} |
|
|
setV[formField] = val[0][searchField] |
|
|
console.log("formField=="+formField+",val=="+val) |
|
|
setV['itemCode'] = val[0]['itemCode'] |
|
|
// 明细查询页赋值 |
|
|
setV['packingNumber'] = val[0]['packingNumber'] |
|
|
if(formField == 'productionLineCode'){ |
|
|
setV['batch'] = val[0]['batch'] |
|
|
setV['productionLineCode'] = val[0]['code'] |
|
|
setV['uom'] = val[0]['uom'] |
|
|
}else if(formField == 'workStationCode'){ |
|
|
setV['inventoryStatus'] = val[0]['inventoryStatus'] |
|
|
setV['workStationCode'] = val[0]['code'] |
|
|
setV['fromLocationCode'] = val[0]['locationCode'] |
|
|
}else if(formField == 'processCode'){ |
|
|
|
|
|
setV['processCode'] = val[0]['code'] |
|
|
|
|
|
}else if(formField == 'itemCode'){ |
|
|
|
|
|
setV['itemCode'] = val[0]['itemCode'] |
|
|
|
|
|
setV['fromLocationCode'] = val[0]['rawLocationCode'] |
|
|
|
|
|
} |
|
|
formRef.setValues(setV) |
|
|
formRef.setValues(setV) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
@ -410,12 +418,14 @@ const handleHandle = async (id: number) => { |
|
|
const formRef = ref() |
|
|
const formRef = ref() |
|
|
const openForm =async (type: string, row?: number) => { |
|
|
const openForm =async (type: string, row?: number) => { |
|
|
tableData.value = [] // 重置明细数据 |
|
|
tableData.value = [] // 重置明细数据 |
|
|
|
|
|
lsBomSave.value = true |
|
|
formRef.value.open(type, row) |
|
|
formRef.value.open(type, row) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 详情操作 */ |
|
|
/** 详情操作 */ |
|
|
const detailRef = ref() |
|
|
const detailRef = ref() |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
|
|
|
lsBomSave.value = false |
|
|
detailRef.value.openDetail(row, titleName, titleValue) |
|
|
detailRef.value.openDetail(row, titleName, titleValue) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|