Browse Source

申请计划开关单据配置

hella_online_20240829
wangyufei 3 months ago
parent
commit
9615c9d430
  1. 118
      src/views/wms/productionManage/productionplan/productionMain/index.vue
  2. 117
      src/views/wms/productionManage/productionplan/productionMainAssemble/index.vue
  3. 121
      src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue
  4. 117
      src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue

118
src/views/wms/productionManage/productionplan/productionMain/index.vue

@ -88,7 +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: 'ProductionMain' }) defineOptions({ name: 'ProductionMain' })
@ -338,31 +338,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 => {
console.log(err)
//
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
@ -410,30 +386,8 @@ 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 => {
console.log(err)
//
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) {
@ -494,6 +448,42 @@ const buttonTableClick = async (val, row) => {
} }
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 formRef = ref() const formRef = ref()
const openForm =async (type: string, row?: number) => { const openForm =async (type: string, row?: number) => {
@ -606,32 +596,7 @@ const submitForm = async (formType, submitData) => {
await ProductionMainApi.createProductionMain(data).then((res) => { await ProductionMainApi.createProductionMain(data).then((res) => {
// console.log(565,res) // console.log(565,res)
if (res.status == '6') { if (res.status == '6') {
// autoCreatePlanRequest(res)
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)
})
})
} }
}) })
// message.success(t('common.createSuccess')) // message.success(t('common.createSuccess'))
@ -685,6 +650,7 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getSwitch()
tableObject.params = { tableObject.params = {
planType: 'predict' planType: 'predict'
} }

117
src/views/wms/productionManage/productionplan/productionMainAssemble/index.vue

@ -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: 'ProductionMainAssemble' }) defineOptions({ name: 'ProductionMainAssemble' })
@ -335,33 +336,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(res)
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
@ -409,30 +384,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 => {
console.log(err)
//
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) {
@ -604,32 +556,7 @@ const submitForm = async (formType, submitData) => {
await ProductionMainApi.createProductionMain(data).then((res) => { await ProductionMainApi.createProductionMain(data).then((res) => {
// console.log(565,res) // console.log(565,res)
if (res.status == '6') { if (res.status == '6') {
// autoCreatePlanRequest(res)
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)
})
})
} }
}) })
// message.success(t('common.createSuccess')) // message.success(t('common.createSuccess'))
@ -644,7 +571,42 @@ const submitForm = async (formType, submitData) => {
formRef.value.formLoading = false formRef.value.formLoading = false
} }
} }
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 = () => {
@ -683,6 +645,7 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getSwitch()
tableObject.params = { tableObject.params = {
planType: 'assemble' planType: 'assemble'
} }

121
src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue

@ -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'
} }

117
src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue

@ -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: 'ProductionMainPredictSparePart' }) defineOptions({ name: 'ProductionMainPredictSparePart' })
@ -327,31 +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 => {
console.log(err)
//
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
@ -399,30 +376,8 @@ 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 => {
console.log(err)
//
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) {
@ -596,30 +551,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'))
@ -635,6 +568,43 @@ 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 = () => {
@ -672,6 +642,7 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getSwitch()
tableObject.params = { tableObject.params = {
planType: 'predictSparePart' planType: 'predictSparePart'
} }

Loading…
Cancel
Save