diff --git a/src/api/wms/preparetoissueMain/index.ts b/src/api/wms/preparetoissueMain/index.ts index b86b6fcd7..2dd0c8d66 100644 --- a/src/api/wms/preparetoissueMain/index.ts +++ b/src/api/wms/preparetoissueMain/index.ts @@ -107,3 +107,9 @@ export const publish = (id) => { export const resetting = (id) => { return request.put({ url: '/wms/preparetoissue-main/resetting?id=' + id }) } + + +// 创建发料申请 +export const generateIssueRequest = (number) => { + return request.post({ url: '/wms/preparetoissue-main/generateIssueRequest?number=' + number }) +} \ No newline at end of file diff --git a/src/api/wms/productionMain/index.ts b/src/api/wms/productionMain/index.ts index 0086aa58e..372b1c85f 100644 --- a/src/api/wms/productionMain/index.ts +++ b/src/api/wms/productionMain/index.ts @@ -189,6 +189,11 @@ export const generateProductreceiptRequest = (number) => { return request.post({ url: '/wms/production-main/generateProductreceiptRequest?number=' + number }) } +// 创建发料申请 +export const generateIssueRequest = (number) => { + return request.post({ url: '/wms/preparetoissue-main/generateIssueRequest?number=' + number }) +} + diff --git a/src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/index.vue b/src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/index.vue index 87e0a99fd..6ede9c549 100644 --- a/src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/index.vue +++ b/src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/index.vue @@ -252,7 +252,7 @@ const butttondata = (row,$index) => { return [] } return [ - defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:preparetoissue-main:open'}), // 打开 + defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:preparetoissue-main:open'}), // 打开 defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:'wms:preparetoissue-main:close'}), // 关闭 defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:preparetoissue-main:submit'}), // 提交审批 defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:preparetoissue-main:reject'}), // 驳回 @@ -261,6 +261,16 @@ const butttondata = (row,$index) => { defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:'wms:preparetoissue-main:resetting'}), // 重置 defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:preparetoissue-main:update'}), // 编辑 // defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:preparetoissue-main:delete'}), // 删除 + { + label: '生成发料申请', + name: 'scflsq', + hide: isShowMainButton(row,['6']), + type: 'primary', + icon: 'Select', + hasPermi:'wms:preparetoissue-main:publish', + link: true, // 文本展现按钮 + color: '' + }, ] } @@ -329,6 +339,7 @@ const buttonTableClick = async (val, row) => { message.success(t('common.updateSuccess')) tableObject.loading = false getList() + PreparetoissueMainApi.generateIssueRequest(row.number) }).catch(err => { tableObject.loading = false console.log(err) @@ -344,6 +355,18 @@ const buttonTableClick = async (val, row) => { tableObject.loading = false console.log(err) }) + } else if (val == 'scflsq') { // 生成发料申请 + if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') + await message.confirm('确认要生成发料申请吗?') + tableObject.loading = true + await PreparetoissueMainApi.generateIssueRequest(row.number).then(() => { + message.success(t('common.createSuccess')) + tableObject.loading = false + getList() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) } else if (val == 'edit') { // 编辑 openForm('update', row) } else if (val == 'delete') { // 删除 @@ -458,7 +481,12 @@ const submitForm = async (formType, submitData) => { data.subList = tableData.value // 拼接子表数据参数 try { if (formType === 'create') { - await PreparetoissueMainApi.createPreparetoissueMain(data) + await PreparetoissueMainApi.createPreparetoissueMain(data).then((res) => { + if (res.status == '6') { + // 生成发料申请 + PreparetoissueMainApi.generateIssueRequest(res.number) + } + }) message.success(t('common.createSuccess')) } else { await PreparetoissueMainApi.updatePreparetoissueMain(data) diff --git a/src/views/wms/productionManage/productionplan/productionMain/index.vue b/src/views/wms/productionManage/productionplan/productionMain/index.vue index 44ab714e5..642431a99 100644 --- a/src/views/wms/productionManage/productionplan/productionMain/index.vue +++ b/src/views/wms/productionManage/productionplan/productionMain/index.vue @@ -332,13 +332,8 @@ const buttonTableClick = async (val, row) => { await ProductionMainApi.submit(row.masterId).then((res) => { if (res.status == '6') { // 生成备料计划 - // tableObject.loading = true - ProductionMainApi.generatePreparetoissue(row.number).then(() => { - // message.success(t('common.createSuccess')) - // tableObject.loading = false - // getList() + ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => { // 生成收货申请 - // tableObject.loading = true ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { message.success(t('common.createSuccess')) tableObject.loading = false @@ -347,11 +342,11 @@ const buttonTableClick = async (val, row) => { 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.createSuccess')) tableObject.loading = false @@ -408,12 +403,8 @@ const buttonTableClick = async (val, row) => { }) // 生成备料计划 tableObject.loading = true - ProductionMainApi.generatePreparetoissue(row.number).then(() => { - // message.success(t('common.createSuccess')) - // tableObject.loading = false - // getList() + ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => { // 生成收货申请 - // tableObject.loading = true ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { message.success(t('common.createSuccess')) tableObject.loading = false @@ -422,11 +413,11 @@ const buttonTableClick = async (val, row) => { 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.createSuccess')) tableObject.loading = false @@ -465,10 +456,12 @@ const buttonTableClick = async (val, row) => { if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') await message.confirm('确认要生成备料计划吗?') tableObject.loading = true - await ProductionMainApi.generatePreparetoissue(row.number).then(() => { + await ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => { message.success(t('common.createSuccess')) tableObject.loading = false getList() + // 生成发料申请 + ProductionMainApi.generateIssueRequest(PreparetoissueRes.number) }).catch(err => { tableObject.loading = false console.log(err) @@ -608,12 +601,8 @@ const submitForm = async (formType, submitData) => { if (res.status == '6') { // 生成备料计划 tableObject.loading = true - ProductionMainApi.generatePreparetoissue(res.number).then(() => { - // message.success(t('common.createSuccess')) - // tableObject.loading = false - // getList() + ProductionMainApi.generatePreparetoissue(res.number).then((PreparetoissueRes) => { // 生成收货申请 - // tableObject.loading = true ProductionMainApi.generateProductreceiptRequest(res.number).then(() => { message.success(t('common.createSuccess')) tableObject.loading = false @@ -622,11 +611,11 @@ const submitForm = async (formType, submitData) => { tableObject.loading = false console.log(err) }) + // 生成发料申请 + ProductionMainApi.generateIssueRequest(PreparetoissueRes.number) }).catch(err => { - // tableObject.loading = false console.log(err) // 生成收货申请 - // tableObject.loading = true ProductionMainApi.generateProductreceiptRequest(res.number).then(() => { message.success(t('common.createSuccess')) tableObject.loading = false diff --git a/src/views/wms/productionManage/productionplan/productionMainAssemble/index.vue b/src/views/wms/productionManage/productionplan/productionMainAssemble/index.vue index 29cb1a855..1f63f5282 100644 --- a/src/views/wms/productionManage/productionplan/productionMainAssemble/index.vue +++ b/src/views/wms/productionManage/productionplan/productionMainAssemble/index.vue @@ -329,13 +329,8 @@ const buttonTableClick = async (val, row) => { await ProductionMainApi.submit(row.masterId).then((res) => { if (res.status == '6') { // 生成备料计划 - // tableObject.loading = true - ProductionMainApi.generatePreparetoissue(row.number).then(() => { - // message.success(t('common.createSuccess')) - // tableObject.loading = false - // getList() + ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => { // 生成收货申请 - // tableObject.loading = true ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { message.success(t('common.createSuccess')) tableObject.loading = false @@ -344,6 +339,8 @@ const buttonTableClick = async (val, row) => { tableObject.loading = false console.log(err) }) + // 生成发料申请 + ProductionMainApi.generateIssueRequest(PreparetoissueRes.number) }).catch(err => { // tableObject.loading = false console.log(err) @@ -405,12 +402,8 @@ const buttonTableClick = async (val, row) => { }) // 生成备料计划 tableObject.loading = true - ProductionMainApi.generatePreparetoissue(row.number).then(() => { - // message.success(t('common.createSuccess')) - // tableObject.loading = false - // getList() + ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => { // 生成收货申请 - // tableObject.loading = true ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { message.success(t('common.createSuccess')) tableObject.loading = false @@ -419,11 +412,11 @@ const buttonTableClick = async (val, row) => { 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.createSuccess')) tableObject.loading = false @@ -462,10 +455,12 @@ const buttonTableClick = async (val, row) => { if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') await message.confirm('确认要生成备料计划吗?') tableObject.loading = true - await ProductionMainApi.generatePreparetoissue(row.number).then(() => { + await ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => { message.success(t('common.createSuccess')) tableObject.loading = false getList() + // 生成发料申请 + ProductionMainApi.generateIssueRequest(PreparetoissueRes.number) }).catch(err => { tableObject.loading = false console.log(err) @@ -604,12 +599,8 @@ const submitForm = async (formType, submitData) => { if (res.status == '6') { // 生成备料计划 tableObject.loading = true - ProductionMainApi.generatePreparetoissue(res.number).then(() => { - // message.success(t('common.createSuccess')) - // tableObject.loading = false - // getList() + ProductionMainApi.generatePreparetoissue(res.number).then((PreparetoissueRes) => { // 生成收货申请 - // tableObject.loading = true ProductionMainApi.generateProductreceiptRequest(res.number).then(() => { message.success(t('common.createSuccess')) tableObject.loading = false @@ -618,11 +609,11 @@ const submitForm = async (formType, submitData) => { tableObject.loading = false console.log(err) }) + // 生成发料申请 + ProductionMainApi.generateIssueRequest(PreparetoissueRes.number) }).catch(err => { - // tableObject.loading = false console.log(err) // 生成收货申请 - // tableObject.loading = true ProductionMainApi.generateProductreceiptRequest(res.number).then(() => { message.success(t('common.createSuccess')) tableObject.loading = false diff --git a/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue b/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue index e774525ac..dad69ddeb 100644 --- a/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue +++ b/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue @@ -328,13 +328,8 @@ const buttonTableClick = async (val, row) => { await ProductionMainApi.submit(row.masterId).then((res) => { if (res.status == '6') { // 生成备料计划 - // tableObject.loading = true - ProductionMainApi.generatePreparetoissue(row.number).then(() => { - // message.success(t('common.createSuccess')) - // tableObject.loading = false - // getList() + ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => { // 生成收货申请 - // tableObject.loading = true ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { message.success(t('common.createSuccess')) tableObject.loading = false @@ -343,6 +338,8 @@ const buttonTableClick = async (val, row) => { tableObject.loading = false console.log(err) }) + // 生成发料申请 + ProductionMainApi.generateIssueRequest(PreparetoissueRes.number) }).catch(err => { // tableObject.loading = false console.log(err) @@ -404,12 +401,8 @@ const buttonTableClick = async (val, row) => { }) // 生成备料计划 tableObject.loading = true - ProductionMainApi.generatePreparetoissue(row.number).then(() => { - // message.success(t('common.createSuccess')) - // tableObject.loading = false - // getList() + ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => { // 生成收货申请 - // tableObject.loading = true ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { message.success(t('common.createSuccess')) tableObject.loading = false @@ -418,6 +411,8 @@ const buttonTableClick = async (val, row) => { tableObject.loading = false console.log(err) }) + // 生成发料申请 + ProductionMainApi.generateIssueRequest(PreparetoissueRes.number) }).catch(err => { // tableObject.loading = false console.log(err) @@ -461,10 +456,12 @@ const buttonTableClick = async (val, row) => { if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') await message.confirm('确认要生成备料计划吗?') tableObject.loading = true - await ProductionMainApi.generatePreparetoissue(row.number).then(() => { + await ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => { message.success(t('common.createSuccess')) tableObject.loading = false getList() + // 生成发料申请 + ProductionMainApi.generateIssueRequest(PreparetoissueRes.number) }).catch(err => { tableObject.loading = false console.log(err) @@ -598,16 +595,11 @@ const submitForm = async (formType, submitData) => { if (formType === 'create') { data.subList = tableData.value // 拼接子表数据参数 await ProductionMainApi.createProductionMain(data).then((res) => { - // console.log(565,res) if (res.status == '6') { // 生成备料计划 tableObject.loading = true - ProductionMainApi.generatePreparetoissue(res.number).then(() => { - // message.success(t('common.createSuccess')) - // tableObject.loading = false - // getList() + ProductionMainApi.generatePreparetoissue(res.number).then((PreparetoissueRes) => { // 生成收货申请 - // tableObject.loading = true ProductionMainApi.generateProductreceiptRequest(res.number).then(() => { message.success(t('common.createSuccess')) tableObject.loading = false @@ -616,11 +608,11 @@ const submitForm = async (formType, submitData) => { tableObject.loading = false console.log(err) }) + // 生成发料申请 + ProductionMainApi.generateIssueRequest(PreparetoissueRes.number) }).catch(err => { - // tableObject.loading = false console.log(err) // 生成收货申请 - // tableObject.loading = true ProductionMainApi.generateProductreceiptRequest(res.number).then(() => { message.success(t('common.createSuccess')) tableObject.loading = false diff --git a/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue b/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue index 51facfdb9..6a4e7cdac 100644 --- a/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue +++ b/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue @@ -328,13 +328,8 @@ const buttonTableClick = async (val, row) => { await ProductionMainApi.submit(row.masterId).then((res) => { if (res.status == '6') { // 生成备料计划 - // tableObject.loading = true - ProductionMainApi.generatePreparetoissue(row.number).then(() => { - // message.success(t('common.createSuccess')) - // tableObject.loading = false - // getList() + ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => { // 生成收货申请 - // tableObject.loading = true ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { message.success(t('common.createSuccess')) tableObject.loading = false @@ -343,11 +338,11 @@ const buttonTableClick = async (val, row) => { 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.createSuccess')) tableObject.loading = false @@ -404,12 +399,8 @@ const buttonTableClick = async (val, row) => { }) // 生成备料计划 tableObject.loading = true - ProductionMainApi.generatePreparetoissue(row.number).then(() => { - // message.success(t('common.createSuccess')) - // tableObject.loading = false - // getList() + ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => { // 生成收货申请 - // tableObject.loading = true ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { message.success(t('common.createSuccess')) tableObject.loading = false @@ -418,11 +409,11 @@ const buttonTableClick = async (val, row) => { 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.createSuccess')) tableObject.loading = false @@ -461,10 +452,12 @@ const buttonTableClick = async (val, row) => { if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') await message.confirm('确认要生成备料计划吗?') tableObject.loading = true - await ProductionMainApi.generatePreparetoissue(row.number).then(() => { + await ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => { message.success(t('common.createSuccess')) tableObject.loading = false getList() + // 生成发料申请 + ProductionMainApi.generateIssueRequest(PreparetoissueRes.number) }).catch(err => { tableObject.loading = false console.log(err) @@ -603,12 +596,8 @@ const submitForm = async (formType, submitData) => { if (res.status == '6') { // 生成备料计划 tableObject.loading = true - ProductionMainApi.generatePreparetoissue(res.number).then(() => { - // message.success(t('common.createSuccess')) - // tableObject.loading = false - // getList() + ProductionMainApi.generatePreparetoissue(res.number).then((PreparetoissueRes) => { // 生成收货申请 - // tableObject.loading = true ProductionMainApi.generateProductreceiptRequest(res.number).then(() => { message.success(t('common.createSuccess')) tableObject.loading = false @@ -617,11 +606,11 @@ const submitForm = async (formType, submitData) => { tableObject.loading = false console.log(err) }) + // 生成发料申请 + ProductionMainApi.generateIssueRequest(PreparetoissueRes.number) }).catch(err => { - // tableObject.loading = false console.log(err) // 生成收货申请 - // tableObject.loading = true ProductionMainApi.generateProductreceiptRequest(res.number).then(() => { message.success(t('common.createSuccess')) tableObject.loading = false