|
|
@ -90,6 +90,8 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import * as ProductionlineitemApi from '@/api/wms/productionlineitem' |
|
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
|
import { usePageLoading } from '@/hooks/web/usePageLoading' |
|
|
|
import { getBaseUrl } from '@/utils/systemParam' |
|
|
|
|
|
|
|
const { loadStart, loadDone } = usePageLoading() |
|
|
|
// 备料计划 |
|
|
|
defineOptions({ name: 'PreparetoissueMain' }) |
|
|
@ -395,8 +397,19 @@ const buttonTableClick = async (val, row) => { |
|
|
|
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') |
|
|
|
await message.confirm('确认要生成发料申请吗?') |
|
|
|
tableObject.loading = true |
|
|
|
await PreparetoissueMainApi.generateIssueRequest(row.number).then(() => { |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
|
|
|
|
await PreparetoissueMainApi.generateIssueRequest(row.number).then((res) => { |
|
|
|
console.log('返回数据',res) |
|
|
|
if (res.errorCount > 0) { |
|
|
|
message.confirm('存在物料库存不足,差u你感觉爱你失败。同时自动下载错误数据表格,一个物料显示一行').then(() => { |
|
|
|
window.open( |
|
|
|
getBaseUrl() + '/admin-api' + res.errorFile, |
|
|
|
'222' |
|
|
|
) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
} |
|
|
|
tableObject.loading = false |
|
|
|
buttonBaseClick('refresh',null) |
|
|
|
}).catch(err => { |
|
|
|