|
@ -88,6 +88,7 @@ import * as ProductionDetailApi from '@/api/wms/productionDetail' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as ItemBasicApi from '@/api/wms/itembasic' |
|
|
import * as ItemBasicApi from '@/api/wms/itembasic' |
|
|
import * as BomApi from "@/api/wms/bom"; |
|
|
import * as BomApi from "@/api/wms/bom"; |
|
|
|
|
|
import * as SwitchApi from '@/api/wms/switch' |
|
|
|
|
|
|
|
|
// 装配备件计划 |
|
|
// 装配备件计划 |
|
|
defineOptions({ name: 'ProductionMainASparePart' }) |
|
|
defineOptions({ name: 'ProductionMainASparePart' }) |
|
@ -327,33 +328,7 @@ const buttonTableClick = async (val, row) => { |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
await ProductionMainApi.submit(row.masterId).then((res) => { |
|
|
await ProductionMainApi.submit(row.masterId).then((res) => { |
|
|
if (res.status == '6') { |
|
|
if (res.status == '6') { |
|
|
// 生成备料计划 |
|
|
autoCreatePlanRequest(row) |
|
|
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) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
// message.success(t('common.updateSuccess')) |
|
|
// message.success(t('common.updateSuccess')) |
|
|
// tableObject.loading = false |
|
|
// tableObject.loading = false |
|
@ -401,32 +376,7 @@ const buttonTableClick = async (val, row) => { |
|
|
}) |
|
|
}) |
|
|
// 生成备料计划 |
|
|
// 生成备料计划 |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => { |
|
|
autoCreatePlanRequest(row) |
|
|
// 生成收货申请 |
|
|
|
|
|
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) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
if (!isAvailable) { |
|
|
if (!isAvailable) { |
|
@ -598,30 +548,8 @@ const submitForm = async (formType, submitData) => { |
|
|
if (res.status == '6') { |
|
|
if (res.status == '6') { |
|
|
// 生成备料计划 |
|
|
// 生成备料计划 |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
ProductionMainApi.generatePreparetoissue(res.number).then((PreparetoissueRes) => { |
|
|
autoCreatePlanRequest(res) |
|
|
// 生成收货申请 |
|
|
|
|
|
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) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
// message.success(t('common.createSuccess')) |
|
|
// 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 importFormRef = ref() |
|
|
const handleImport = () => { |
|
|
const handleImport = () => { |
|
@ -675,6 +641,7 @@ const searchFormClick = (searchData) => { |
|
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|
|
|
|
getSwitch() |
|
|
tableObject.params = { |
|
|
tableObject.params = { |
|
|
planType: 'assembleSparePart' |
|
|
planType: 'assembleSparePart' |
|
|
} |
|
|
} |
|
|