Browse Source

制品报废更新与增加BOM更新

master
zhaoxuebing 11 months ago
parent
commit
0715d3c596
  1. 5
      src/api/wms/productscrapRequestMain/index.ts
  2. 42
      src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue
  3. 14
      src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts

5
src/api/wms/productscrapRequestMain/index.ts

@ -91,3 +91,8 @@ export const agreeProductscrapRequestMain = async (id) => {
export const handleProductscrapRequestMain = async (id) => {
return await request.put({ url: `/wms/productscrap-request-main/handle?id=` + id })
}
// 修改制品报废BOM数据
export const updateProductscrapDetailRequestBom = async (id, data) => {
return await request.post({ url: `/wms/productscrap-request-main/updateBom?id=`+id, data })
}

42
src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue

@ -108,6 +108,8 @@ import * as ProductscrapRequestDetailApi from '@/api/wms/productscrapRequestDeta
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as BomDismantleApi 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' })
@ -136,6 +138,8 @@ const buttondataTable = ref([{
const DialogTitle = ref('Bom信息')
const bomModelVisible = ref(false)
const tableListBom = ref()
const lsBomSave = ref()
const rowId = ref()
const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useTable({
getListApi: BomDismantleApi.getProductscrapBomDismantlePage
})
@ -151,12 +155,19 @@ const buttonBaseClickBom = (val) => {
if (val == 'save') {
//
tableListBom.value = detatableDataBom.tableList.filter(item => (item.qty!=0))
if (lsBomSave.value) {
tableData.value.forEach((item, index) => {
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
}
//
@ -196,6 +207,7 @@ const tableFormButton = async (val , row) => {
bomVersion: row.bomVersion,
masterId: row.id
}
rowId.value = row.id
await getDetailListBom()
}
}
@ -217,18 +229,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
}else if(formField == 'processCode'){
row['processCode'] = val[0]['code']
}else if(formField == 'itemCode'){
console.log("aaaaaaaa",val);
row['itemCode'] = val[0]['itemCode']
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 {
const setV = {}
setV[formField] = val[0][searchField]
@ -240,13 +243,18 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
console.log("formField=="+formField+",val=="+val)
//
if(formField == 'productionLineCode'){
setV['productionLineCode'] = val[0]['code']
}else if(formField == 'workStationCode'){
setV['workStationCode'] = val[0]['code']
}else if(formField == 'processCode'){
setV['processCode'] = val[0]['code']
}else if(formField == 'itemCode'){
setV['itemCode'] = val[0]['itemCode']
setV['packingNumber'] = val[0]['packingNumber']
setV['batch'] = val[0]['batch']
setV['uom'] = val[0]['uom']
setV['inventoryStatus'] = val[0]['inventoryStatus']
setV['fromLocationCode'] = val[0]['locationCode']
setV['fromLocationCode'] = val[0]['rawLocationCode']
}
formRef.setValues(setV)
})
}
@ -410,12 +418,14 @@ const handleHandle = async (id: number) => {
const formRef = ref()
const openForm =async (type: string, row?: number) => {
tableData.value = [] //
lsBomSave.value = true
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
lsBomSave.value = false
detailRef.value.openDetail(row, titleName, titleValue)
}

14
src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts

@ -646,6 +646,7 @@ export const ProductscrapRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
},
isTable: false,
isTableForm: false,
isForm: false,
tableForm:{
isInpuFocusShow: false,
searchListPlaceholder: '请选择包装号',
@ -676,6 +677,7 @@ export const ProductscrapRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
},
isTable: false,
isTableForm: false,
isForm: false,
tableForm: {
disabled: true
}
@ -690,6 +692,7 @@ export const ProductscrapRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
},
isTable: false,
isTableForm: false,
isForm: false,
tableForm: {
disabled: true
}
@ -703,6 +706,11 @@ export const ProductscrapRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
},
tableForm: {
disabled: true
},
form: {
componentProps:{
disabled: true
}
}
},
{
@ -717,6 +725,7 @@ export const ProductscrapRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 150,
show: false
},
isForm: false,
tableForm: {
disabled: true
}
@ -807,6 +816,11 @@ export const ProductscrapRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
tableForm: {
type: 'Select',
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{

Loading…
Cancel
Save