|
@ -102,6 +102,10 @@ |
|
|
:buttondataTable="buttondataTable" |
|
|
:buttondataTable="buttondataTable" |
|
|
@tableFormButton="tableFormButton" |
|
|
@tableFormButton="tableFormButton" |
|
|
:detailValidate="detailValidate" |
|
|
:detailValidate="detailValidate" |
|
|
|
|
|
@detailOpenForm="detailOpenForm" |
|
|
|
|
|
:detailButtonIsShowAdd=false |
|
|
|
|
|
:detailButtonIsShowEdit=false |
|
|
|
|
|
:detailButtonIsShowDelete=false |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 创建标签 --> |
|
|
<!-- 创建标签 --> |
|
@ -326,8 +330,39 @@ const setTableFormsValues = async (val, index1) => { |
|
|
} |
|
|
} |
|
|
// 查询页面返回——详情 |
|
|
// 查询页面返回——详情 |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
nextTick(() => { |
|
|
nextTick(async () => { |
|
|
const setV = {} |
|
|
const setV = {} |
|
|
|
|
|
if (formField == 'secondPackUnit') { |
|
|
|
|
|
setV['secondPackUnit'] = val[0]['packUnit'] |
|
|
|
|
|
setV['secondPackQty'] = val[0]['packQty'] |
|
|
|
|
|
} else if (formField == 'packUnit') { |
|
|
|
|
|
setV['packUnit'] = val[0]['packUnit'] |
|
|
|
|
|
setV['packQty'] = val[0]['packQty'] |
|
|
|
|
|
} else if (formField == 'itemCode') { |
|
|
|
|
|
if(detailRef.value.tableObjectRef.tableList.find(item1=>item1['itemCode'] == val[0]['itemCode'])){ |
|
|
|
|
|
message.warning(`物料${val[0]['itemCode']}已经存在`) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
setV['itemCode'] = val[0]['itemCode'] |
|
|
|
|
|
setV['uom'] = val[0]['uom'] |
|
|
|
|
|
setV['produceDate'] = dayjs().valueOf() |
|
|
|
|
|
setV['batch'] = formatTime(new Date(), 'yyyyMMdd') |
|
|
|
|
|
setV['expireDate'] = val[0]['expireTime']? addDay( val[0]['produceDate'], val[0]['expireTime']) : dayjs('2099-12-31').valueOf() |
|
|
|
|
|
const param1 = { |
|
|
|
|
|
productItemCode: val[0]['itemCode'], |
|
|
|
|
|
available: 'TRUE', |
|
|
|
|
|
pageSize: 20, |
|
|
|
|
|
pageNo: 1, |
|
|
|
|
|
sort: '', |
|
|
|
|
|
by: 'ASC' |
|
|
|
|
|
} |
|
|
|
|
|
await BomApi.getBomPage(param1).then((res) => { |
|
|
|
|
|
console.log(res) |
|
|
|
|
|
if (res?.list?.length > 0) { |
|
|
|
|
|
setV['bomVersion'] = res.list[0].version |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
setV[formField] = val[0][searchField] |
|
|
setV[formField] = val[0][searchField] |
|
|
formRef.setValues(setV) |
|
|
formRef.setValues(setV) |
|
|
}) |
|
|
}) |
|
@ -656,7 +691,9 @@ const openForm = async (type: string, row?: number) => { |
|
|
const { wsCache } = useCache() |
|
|
const { wsCache } = useCache() |
|
|
/** 详情操作 */ |
|
|
/** 详情操作 */ |
|
|
const detailRef = ref() |
|
|
const detailRef = ref() |
|
|
|
|
|
const mainData = ref() |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
|
|
|
mainData.value = row |
|
|
const departmentCode = wsCache |
|
|
const departmentCode = wsCache |
|
|
.get(CACHE_KEY.DEPT) |
|
|
.get(CACHE_KEY.DEPT) |
|
|
.find((account) => account.id == row.departmentCode)?.name |
|
|
.find((account) => account.id == row.departmentCode)?.name |
|
@ -954,6 +991,12 @@ const getDefaultWorkshopCode = async () => { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
const detailOpenForm = (type, row) => { |
|
|
|
|
|
console.log(mainData.value) |
|
|
|
|
|
nextTick(() => { |
|
|
|
|
|
detailRef.value.formRef.formRef.formModel.productionLineCode = mainData.value.productionLineCode |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|
getDefaultWorkshopCode() |
|
|
getDefaultWorkshopCode() |
|
|