diff --git a/src/views/wms/productionManage/productionplan/productionMain/index.vue b/src/views/wms/productionManage/productionplan/productionMain/index.vue index a71293867..59b0c44c0 100644 --- a/src/views/wms/productionManage/productionplan/productionMain/index.vue +++ b/src/views/wms/productionManage/productionplan/productionMain/index.vue @@ -236,6 +236,33 @@ const isShowMainButton = (row,val) => { } } +// 根据状态返回该按钮是否显示-针对生成备料计划 +const isShowMainButtonBl = (row,val) => { + if (val.indexOf(row.status) > -1) { + if (row.preparetoissueIsCreate == 'TRUE') { + return true + } else { + return false + } + } else { + return true + } +} + +// 根据状态返回该按钮是否显示-针对生收货申请 +const isShowMainButtonSh = (row,val) => { + if (val.indexOf(row.status) > -1) { + if (row.productreceiptIsCreate == 'TRUE') { + return true + } else { + return false + } + } else { + return true + } +} + + // 列表-操作按钮 const butttondata = (row,$index) => { const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 @@ -252,20 +279,20 @@ const butttondata = (row,$index) => { defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:'wms:production-main:resetting'}), // 重置 defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:update'}), // 编辑 // defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:delete'}), // 删除 - // { - // label: '生成备料计划', - // name: 'scbljh', - // hide: isShowMainButton(row,['6']), - // type: 'primary', - // icon: 'Select', - // hasPermi:'wms:production-main:publish', - // link: true, // 文本展现按钮 - // color: '' - // }, + { + label: '生成备料计划', + name: 'scbljh', + hide: isShowMainButtonBl(row,['6']), + type: 'primary', + icon: 'Select', + hasPermi:'wms:production-main:publish', + link: true, // 文本展现按钮 + color: '' + }, { label: '生成收货申请', name: 'scshsq', - hide: isShowMainButton(row,['6']), + hide: isShowMainButtonSh(row,['6']), type: 'primary', icon: 'Select', hasPermi:'wms:production-main:publish', @@ -302,7 +329,29 @@ const buttonTableClick = async (val, row) => { if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') await message.confirm('确认要提交审批吗?') tableObject.loading = true - await ProductionMainApi.submit(row.masterId).then(() => { + 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() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + // 生成收货申请 + tableObject.loading = true + ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { + // message.success(t('common.createSuccess')) + tableObject.loading = false + getList() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + } message.success(t('common.updateSuccess')) tableObject.loading = false getList() @@ -347,6 +396,26 @@ const buttonTableClick = async (val, row) => { await message.confirm('物料:【'+rs +'】目前为不可用状态,是否继续发布?').catch(() => { isAvailable = false }) + // 生成备料计划 + tableObject.loading = true + await ProductionMainApi.generatePreparetoissue(row.number).then(() => { + // message.success(t('common.createSuccess')) + tableObject.loading = false + getList() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + // 生成收货申请 + tableObject.loading = true + await ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { + // message.success(t('common.createSuccess')) + tableObject.loading = false + getList() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) } }) if (!isAvailable) { @@ -514,7 +583,31 @@ const submitForm = async (formType, submitData) => { try { if (formType === 'create') { data.subList = tableData.value // 拼接子表数据参数 - await ProductionMainApi.createProductionMain(data) + 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() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + // 生成收货申请 + tableObject.loading = true + 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')) } else { await ProductionMainApi.updateProductionMain(data) @@ -523,6 +616,7 @@ const submitForm = async (formType, submitData) => { formRef.value.dialogVisible = false // 刷新当前列表 getList() + } finally { formRef.value.formLoading = false } diff --git a/src/views/wms/productionManage/productionplan/productionMain/productionMain.data.ts b/src/views/wms/productionManage/productionplan/productionMain/productionMain.data.ts index bf0dee7de..74d41a233 100644 --- a/src/views/wms/productionManage/productionplan/productionMain/productionMain.data.ts +++ b/src/views/wms/productionManage/productionplan/productionMain/productionMain.data.ts @@ -399,7 +399,26 @@ export const ProductionMain = useCrudSchemas(reactive([ } } }, - + { + label: '是否创建了备料计划', + field: 'preparetoissueIsCreate', + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + isForm: false, + }, + { + label: '是否创建了收货申请', + field: 'productreceiptIsCreate', + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + isForm: false, + }, // { // label: '开始时间', // field: 'beginTime', diff --git a/src/views/wms/productionManage/productionplan/productionMainAssemble/index.vue b/src/views/wms/productionManage/productionplan/productionMainAssemble/index.vue index 850ebebeb..de3c21983 100644 --- a/src/views/wms/productionManage/productionplan/productionMainAssemble/index.vue +++ b/src/views/wms/productionManage/productionplan/productionMainAssemble/index.vue @@ -229,6 +229,32 @@ const isShowMainButton = (row,val) => { } } +// 根据状态返回该按钮是否显示-针对生成备料计划 +const isShowMainButtonBl = (row,val) => { + if (val.indexOf(row.status) > -1) { + if (row.preparetoissueIsCreate == 'TRUE') { + return true + } else { + return false + } + } else { + return true + } +} + +// 根据状态返回该按钮是否显示-针对生收货申请 +const isShowMainButtonSh = (row,val) => { + if (val.indexOf(row.status) > -1) { + if (row.productreceiptIsCreate == 'TRUE') { + return true + } else { + return false + } + } else { + return true + } +} + // 列表-操作按钮 const butttondata = (row,$index) => { const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 @@ -245,20 +271,20 @@ const butttondata = (row,$index) => { defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:'wms:production-main:resetting'}), // 重置 defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:update'}), // 编辑 // defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:delete'}), // 删除 - // { - // label: '生成备料计划', - // name: 'scbljh', - // hide: isShowMainButton(row,['6']), - // type: 'primary', - // icon: 'Select', - // hasPermi:'wms:production-main:publish', - // link: true, // 文本展现按钮 - // color: '' - // }, + { + label: '生成备料计划', + name: 'scbljh', + hide: isShowMainButtonBl(row,['6']), + type: 'primary', + icon: 'Select', + hasPermi:'wms:production-main:publish', + link: true, // 文本展现按钮 + color: '' + }, { label: '生成收货申请', name: 'scshsq', - hide: isShowMainButton(row,['6']), + hide: isShowMainButtonSh(row,['6']), type: 'primary', icon: 'Select', hasPermi:'wms:production-main:publish', @@ -295,7 +321,29 @@ const buttonTableClick = async (val, row) => { if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') await message.confirm('确认要提交审批吗?') tableObject.loading = true - await ProductionMainApi.submit(row.masterId).then(() => { + 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() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + // 生成收货申请 + tableObject.loading = true + ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { + // message.success(t('common.createSuccess')) + tableObject.loading = false + getList() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + } message.success(t('common.updateSuccess')) tableObject.loading = false getList() @@ -340,6 +388,26 @@ const buttonTableClick = async (val, row) => { await message.confirm('物料:【'+rs +'】目前为不可用状态,是否继续发布?').catch(() => { isAvailable = false }) + // 生成备料计划 + tableObject.loading = true + await ProductionMainApi.generatePreparetoissue(row.number).then(() => { + // message.success(t('common.createSuccess')) + tableObject.loading = false + getList() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + // 生成收货申请 + tableObject.loading = true + await ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { + // message.success(t('common.createSuccess')) + tableObject.loading = false + getList() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) } }) if (!isAvailable) { @@ -365,7 +433,7 @@ const buttonTableClick = async (val, row) => { tableObject.loading = false console.log(err) }) - } else if(val == 'scbljh') { + } else if(val == 'scbljh') { if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') await message.confirm('确认要生成备料计划吗?') tableObject.loading = true diff --git a/src/views/wms/productionManage/productionplan/productionMainAssemble/productionMainAssemble.data.ts b/src/views/wms/productionManage/productionplan/productionMainAssemble/productionMainAssemble.data.ts index aec2ca5bf..6cdca9280 100644 --- a/src/views/wms/productionManage/productionplan/productionMainAssemble/productionMainAssemble.data.ts +++ b/src/views/wms/productionManage/productionplan/productionMainAssemble/productionMainAssemble.data.ts @@ -398,7 +398,26 @@ export const ProductionMain = useCrudSchemas(reactive([ } } }, - + { + label: '是否创建了备料计划', + field: 'preparetoissueIsCreate', + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + isForm: false, + }, + { + label: '是否创建了收货申请', + field: 'productreceiptIsCreate', + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + isForm: false, + }, // { // label: '开始时间', // field: 'beginTime', diff --git a/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue b/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue index 86075935e..cd26ba054 100644 --- a/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue +++ b/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue @@ -229,6 +229,32 @@ const isShowMainButton = (row,val) => { } } +// 根据状态返回该按钮是否显示-针对生成备料计划 +const isShowMainButtonBl = (row,val) => { + if (val.indexOf(row.status) > -1) { + if (row.preparetoissueIsCreate == 'TRUE') { + return true + } else { + return false + } + } else { + return true + } +} + +// 根据状态返回该按钮是否显示-针对生收货申请 +const isShowMainButtonSh = (row,val) => { + if (val.indexOf(row.status) > -1) { + if (row.productreceiptIsCreate == 'TRUE') { + return true + } else { + return false + } + } else { + return true + } +} + // 列表-操作按钮 const butttondata = (row,$index) => { const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 @@ -245,20 +271,20 @@ const butttondata = (row,$index) => { defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:'wms:production-main:resetting'}), // 重置 defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:update'}), // 编辑 // defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:delete'}), // 删除 - // { - // label: '生成备料计划', - // name: 'scbljh', - // hide: isShowMainButton(row,['6']), - // type: 'primary', - // icon: 'Select', - // hasPermi:'wms:production-main:publish', - // link: true, // 文本展现按钮 - // color: '' - // }, + { + label: '生成备料计划', + name: 'scbljh', + hide: isShowMainButtonBl(row,['6']), + type: 'primary', + icon: 'Select', + hasPermi:'wms:production-main:publish', + link: true, // 文本展现按钮 + color: '' + }, { label: '生成收货申请', name: 'scshsq', - hide: isShowMainButton(row,['6']), + hide: isShowMainButtonSh(row,['6']), type: 'primary', icon: 'Select', hasPermi:'wms:production-main:publish', @@ -295,7 +321,29 @@ const buttonTableClick = async (val, row) => { if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') await message.confirm('确认要提交审批吗?') tableObject.loading = true - await ProductionMainApi.submit(row.masterId).then(() => { + 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() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + // 生成收货申请 + tableObject.loading = true + ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { + // message.success(t('common.createSuccess')) + tableObject.loading = false + getList() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + } message.success(t('common.updateSuccess')) tableObject.loading = false getList() @@ -340,6 +388,26 @@ const buttonTableClick = async (val, row) => { await message.confirm('物料:【'+rs +'】目前为不可用状态,是否继续发布?').catch(() => { isAvailable = false }) + // 生成备料计划 + tableObject.loading = true + await ProductionMainApi.generatePreparetoissue(row.number).then(() => { + // message.success(t('common.createSuccess')) + tableObject.loading = false + getList() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + // 生成收货申请 + tableObject.loading = true + await ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { + // message.success(t('common.createSuccess')) + tableObject.loading = false + getList() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) } }) if (!isAvailable) { diff --git a/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/productionMainAssembleSparePart.data.ts b/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/productionMainAssembleSparePart.data.ts index 4955f8006..76f307cbd 100644 --- a/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/productionMainAssembleSparePart.data.ts +++ b/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/productionMainAssembleSparePart.data.ts @@ -390,6 +390,26 @@ export const ProductionMain = useCrudSchemas(reactive([ } } }, + { + label: '是否创建了备料计划', + field: 'preparetoissueIsCreate', + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + isForm: false, + }, + { + label: '是否创建了收货申请', + field: 'productreceiptIsCreate', + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + isForm: false, + }, // { // label: '开始时间', diff --git a/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue b/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue index 15a77d617..60a8f1605 100644 --- a/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue +++ b/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue @@ -229,6 +229,32 @@ const isShowMainButton = (row,val) => { } } +// 根据状态返回该按钮是否显示-针对生成备料计划 +const isShowMainButtonBl = (row,val) => { + if (val.indexOf(row.status) > -1) { + if (row.preparetoissueIsCreate == 'TRUE') { + return true + } else { + return false + } + } else { + return true + } +} + +// 根据状态返回该按钮是否显示-针对生收货申请 +const isShowMainButtonSh = (row,val) => { + if (val.indexOf(row.status) > -1) { + if (row.productreceiptIsCreate == 'TRUE') { + return true + } else { + return false + } + } else { + return true + } +} + // 列表-操作按钮 const butttondata = (row,$index) => { const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 @@ -245,20 +271,20 @@ const butttondata = (row,$index) => { defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:'wms:production-main:resetting'}), // 重置 defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:update'}), // 编辑 // defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:delete'}), // 删除 - // { - // label: '生成备料计划', - // name: 'scbljh', - // hide: isShowMainButton(row,['6']), - // type: 'primary', - // icon: 'Select', - // hasPermi:'wms:production-main:publish', - // link: true, // 文本展现按钮 - // color: '' - // }, + { + label: '生成备料计划', + name: 'scbljh', + hide: isShowMainButtonBl(row,['6']), + type: 'primary', + icon: 'Select', + hasPermi:'wms:production-main:publish', + link: true, // 文本展现按钮 + color: '' + }, { label: '生成收货申请', name: 'scshsq', - hide: isShowMainButton(row,['6']), + hide: isShowMainButtonSh(row,['6']), type: 'primary', icon: 'Select', hasPermi:'wms:production-main:publish', @@ -295,7 +321,29 @@ const buttonTableClick = async (val, row) => { if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') await message.confirm('确认要提交审批吗?') tableObject.loading = true - await ProductionMainApi.submit(row.masterId).then(() => { + 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() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + // 生成收货申请 + tableObject.loading = true + ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { + // message.success(t('common.createSuccess')) + tableObject.loading = false + getList() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + } message.success(t('common.updateSuccess')) tableObject.loading = false getList() @@ -340,6 +388,26 @@ const buttonTableClick = async (val, row) => { await message.confirm('物料:【'+rs +'】目前为不可用状态,是否继续发布?').catch(() => { isAvailable = false }) + // 生成备料计划 + tableObject.loading = true + await ProductionMainApi.generatePreparetoissue(row.number).then(() => { + // message.success(t('common.createSuccess')) + tableObject.loading = false + getList() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) + // 生成收货申请 + tableObject.loading = true + await ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { + // message.success(t('common.createSuccess')) + tableObject.loading = false + getList() + }).catch(err => { + tableObject.loading = false + console.log(err) + }) } }) if (!isAvailable) { diff --git a/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/productionMainPredictSparePart.data.ts b/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/productionMainPredictSparePart.data.ts index 1f985f00b..542dbb02b 100644 --- a/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/productionMainPredictSparePart.data.ts +++ b/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/productionMainPredictSparePart.data.ts @@ -391,7 +391,26 @@ export const ProductionMain = useCrudSchemas(reactive([ } } }, - + { + label: '是否创建了备料计划', + field: 'preparetoissueIsCreate', + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + isForm: false, + }, + { + label: '是否创建了收货申请', + field: 'productreceiptIsCreate', + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + isForm: false, + }, // { // label: '开始时间', // field: 'beginTime',