|
|
@ -88,6 +88,7 @@ import * as ProductionDetailApi from '@/api/wms/productionDetail' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import * as ItemBasicApi from '@/api/wms/itembasic' |
|
|
|
import * as BomApi from "@/api/wms/bom"; |
|
|
|
import * as SwitchApi from '@/api/wms/switch' |
|
|
|
|
|
|
|
// 装配备件计划 |
|
|
|
defineOptions({ name: 'ProductionMainASparePart' }) |
|
|
@ -327,33 +328,7 @@ const buttonTableClick = async (val, row) => { |
|
|
|
tableObject.loading = true |
|
|
|
await ProductionMainApi.submit(row.masterId).then((res) => { |
|
|
|
if (res.status == '6') { |
|
|
|
// 生成备料计划 |
|
|
|
ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => { |
|
|
|
// 生成收货申请 |
|
|
|
ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
// 生成发料申请 |
|
|
|
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number) |
|
|
|
}).catch(err => { |
|
|
|
// tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
// 生成收货申请 |
|
|
|
// tableObject.loading = true |
|
|
|
ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
}) |
|
|
|
autoCreatePlanRequest(row) |
|
|
|
} |
|
|
|
// message.success(t('common.updateSuccess')) |
|
|
|
// tableObject.loading = false |
|
|
@ -401,32 +376,7 @@ const buttonTableClick = async (val, row) => { |
|
|
|
}) |
|
|
|
// 生成备料计划 |
|
|
|
tableObject.loading = true |
|
|
|
ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => { |
|
|
|
// 生成收货申请 |
|
|
|
ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
// 生成发料申请 |
|
|
|
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number) |
|
|
|
}).catch(err => { |
|
|
|
// tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
// 生成收货申请 |
|
|
|
// tableObject.loading = true |
|
|
|
ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
}) |
|
|
|
autoCreatePlanRequest(row) |
|
|
|
} |
|
|
|
}) |
|
|
|
if (!isAvailable) { |
|
|
@ -598,30 +548,8 @@ const submitForm = async (formType, submitData) => { |
|
|
|
if (res.status == '6') { |
|
|
|
// 生成备料计划 |
|
|
|
tableObject.loading = true |
|
|
|
ProductionMainApi.generatePreparetoissue(res.number).then((PreparetoissueRes) => { |
|
|
|
// 生成收货申请 |
|
|
|
ProductionMainApi.generateProductreceiptRequest(res.number).then(() => { |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
// 生成发料申请 |
|
|
|
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
// 生成收货申请 |
|
|
|
ProductionMainApi.generateProductreceiptRequest(res.number).then(() => { |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
}) |
|
|
|
autoCreatePlanRequest(res) |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
// message.success(t('common.createSuccess')) |
|
|
@ -637,6 +565,44 @@ const submitForm = async (formType, submitData) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const planSwitch = ref(false) |
|
|
|
const requestSwitch = ref(false) |
|
|
|
const getSwitch = async ()=>{ |
|
|
|
let switch1 = await SwitchApi.getByCode('CreatePrepareToIssuePlanAfterProductionPlanPublished') |
|
|
|
planSwitch.value = switch1=='TRUE' |
|
|
|
let switch2 = await SwitchApi.getByCode('CreateProductReciptRequestAfterProductionPlanPublished') |
|
|
|
requestSwitch.value = switch2=='TRUE' |
|
|
|
console.log('switch1',switch1) |
|
|
|
console.log('switch2',switch2) |
|
|
|
|
|
|
|
} |
|
|
|
// 自动提交 |
|
|
|
const autoCreatePlanRequest = async (row)=>{ |
|
|
|
// 生成备料计划 |
|
|
|
try { |
|
|
|
|
|
|
|
if(planSwitch.value) { |
|
|
|
// /generatePreparetoissue?number |
|
|
|
let PreparetoissueRes = await ProductionMainApi.generatePreparetoissue(row.number) |
|
|
|
// 生成发料申请 |
|
|
|
// generateIssueRequest |
|
|
|
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number) |
|
|
|
} |
|
|
|
} finally { |
|
|
|
try { |
|
|
|
if(requestSwitch.value){ |
|
|
|
// /generateProductreceiptRequest |
|
|
|
await ProductionMainApi.generateProductreceiptRequest(row.number) |
|
|
|
} |
|
|
|
} finally { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** 导入 */ |
|
|
|
const importFormRef = ref() |
|
|
|
const handleImport = () => { |
|
|
@ -675,6 +641,7 @@ const searchFormClick = (searchData) => { |
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getSwitch() |
|
|
|
tableObject.params = { |
|
|
|
planType: 'assembleSparePart' |
|
|
|
} |
|
|
|