|
|
@ -115,6 +115,8 @@ import { formatDate } from '@/utils/formatTime' |
|
|
|
import { usePageLoading } from '@/hooks/web/usePageLoading' |
|
|
|
import * as ruleApi from '@/api/wms/rule/index' |
|
|
|
import * as LocationApi from '@/api/wms/location' |
|
|
|
import * as SupplieritemApi from '@/api/wms/supplieritem' |
|
|
|
import * as ProductionlineitemApi from '@/api/wms/productionlineitem' |
|
|
|
const { loadStart, loadDone } = usePageLoading() |
|
|
|
// 生产退料申请 |
|
|
|
defineOptions({ name: 'ProductionreturnRequestMain' }) |
|
|
@ -555,21 +557,29 @@ const buttonTableClick = async (val, row) => { |
|
|
|
by: 'ASC', |
|
|
|
}).then(res => { |
|
|
|
if (res.list.length > 0) { |
|
|
|
// 判断物料 可采购 可制造 |
|
|
|
if (res.list[0].enableMake == "FALSE") { |
|
|
|
// 判断物料 可采购 |
|
|
|
if (res.list[0].enableBuy == "TRUE") { |
|
|
|
// 修改 tableform 属性 |
|
|
|
detailListTableColumns.tableFormColumns.map(itemColumns => { |
|
|
|
if(itemColumns.field == 'productionLineCodePackage') { |
|
|
|
itemColumns.tableForm.isInpuFocusShow = false |
|
|
|
itemColumns.tableForm.disabled = true |
|
|
|
ProductionreturnRequestDetailLabelRules.productionLineCodePackage[0].required = false |
|
|
|
} |
|
|
|
// 修改 tableform 属性 |
|
|
|
if(itemColumns.field == 'supplierItemCode') { |
|
|
|
itemColumns.tableForm.isInpuFocusShow = true |
|
|
|
itemColumns.tableForm.disabled = false |
|
|
|
ProductionreturnRequestDetailLabelRules.supplierItemCode[0].required = true |
|
|
|
formLabelRef.value.formLoading = true |
|
|
|
SupplieritemApi.getSupplieritemPage({ |
|
|
|
pageSize: 10, |
|
|
|
pageNo: 1, |
|
|
|
code: item.itemCode, |
|
|
|
sort: '', |
|
|
|
by: 'ASC', |
|
|
|
}).then(response => { |
|
|
|
item.supplierItemCode = response.list[0].supplierCode |
|
|
|
formLabelRef.value.formLoading = false |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
// 修改 tableform 属性 |
|
|
|
detailListTableColumns.tableFormColumns.map(itemColumns => { |
|
|
@ -578,11 +588,36 @@ const buttonTableClick = async (val, row) => { |
|
|
|
itemColumns.tableForm.disabled = true |
|
|
|
ProductionreturnRequestDetailLabelRules.supplierItemCode[0].required = false |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
// 判断物料 可制造 |
|
|
|
if (res.list[0].enableMake == "TRUE") { |
|
|
|
// 修改 tableform 属性 |
|
|
|
detailListTableColumns.tableFormColumns.map(itemColumns => { |
|
|
|
if(itemColumns.field == 'productionLineCodePackage') { |
|
|
|
item.productionLineCodePackage = item.productionLineCode |
|
|
|
itemColumns.tableForm.isInpuFocusShow = true |
|
|
|
itemColumns.tableForm.disabled = true |
|
|
|
ProductionreturnRequestDetailLabelRules.productionLineCodePackage[0].required = true |
|
|
|
formLabelRef.value.formLoading = true |
|
|
|
ProductionlineitemApi.getProductionlineitemPage({ |
|
|
|
pageNo: 1, |
|
|
|
code: item.itemCode, |
|
|
|
sort: '', |
|
|
|
by: 'ASC', |
|
|
|
}).then(response => { |
|
|
|
item.supplierItemCode = response.list[0].supplierCode |
|
|
|
formLabelRef.value.formLoading = false |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
// 修改 tableform 属性 |
|
|
|
detailListTableColumns.tableFormColumns.map(itemColumns => { |
|
|
|
if(itemColumns.field == 'productionLineCodePackage') { |
|
|
|
itemColumns.tableForm.isInpuFocusShow = false |
|
|
|
itemColumns.tableForm.disabled = true |
|
|
|
ProductionreturnRequestDetailLabelRules.productionLineCodePackage[0].required = false |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
@ -835,10 +870,13 @@ const handlePoint = async (row) => { |
|
|
|
}).then((res) => { |
|
|
|
if(res.list.length > 0) { |
|
|
|
isCreateLabel.value = true |
|
|
|
if (res.list[0].productionLineCode != null) { |
|
|
|
if (res.list[0].supplierItemCode != null) { |
|
|
|
labelType.value = 'cg' |
|
|
|
} else if(res.list[0].productionLineCode != null){ |
|
|
|
labelType.value = 'zz' |
|
|
|
} else { |
|
|
|
labelType.value = 'cg' |
|
|
|
isCreateLabel.value = false |
|
|
|
message.warning('不是采购类型也不是制造类型物料不能打印标签!') |
|
|
|
} |
|
|
|
} else { |
|
|
|
isCreateLabel.value = false |
|
|
|