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 ItemBasicApi from '@/api/wms/itembasic'
import * as BomApi from "@/api/wms/bom";
import * as SwitchApi from '@/api/wms/switch'
//
//
defineOptions({ name: 'ProductionMain' })
@ -338,31 +338,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 => {
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)
})
})
autoCreatePlanRequest(row)
}
// message.success(t('common.updateSuccess'))
// tableObject.loading = false
@ -410,30 +386,8 @@ 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 => {
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)
})
})
autoCreatePlanRequest(row)
}
})
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 openForm =async (type: string, row?: number) => {
@ -606,32 +596,7 @@ const submitForm = async (formType, submitData) => {
await ProductionMainApi.createProductionMain(data).then((res) => {
// console.log(565,res)
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'))
@ -685,6 +650,7 @@ const searchFormClick = (searchData) => {
/** 初始化 **/
onMounted(async () => {
getSwitch()
tableObject.params = {
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 ItemBasicApi from '@/api/wms/itembasic'
import * as BomApi from "@/api/wms/bom";
import * as SwitchApi from '@/api/wms/switch'
//
defineOptions({ name: 'ProductionMainAssemble' })
@ -335,33 +336,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(res)
}
// message.success(t('common.updateSuccess'))
// tableObject.loading = false
@ -409,30 +384,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 => {
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)
})
})
autoCreatePlanRequest(row)
}
})
if (!isAvailable) {
@ -604,32 +556,7 @@ const submitForm = async (formType, submitData) => {
await ProductionMainApi.createProductionMain(data).then((res) => {
// console.log(565,res)
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'))
@ -644,7 +571,42 @@ const submitForm = async (formType, submitData) => {
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 handleImport = () => {
@ -683,6 +645,7 @@ const searchFormClick = (searchData) => {
/** 初始化 **/
onMounted(async () => {
getSwitch()
tableObject.params = {
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 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'
}

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 ItemBasicApi from '@/api/wms/itembasic'
import * as BomApi from "@/api/wms/bom";
import * as SwitchApi from '@/api/wms/switch'
//
defineOptions({ name: 'ProductionMainPredictSparePart' })
@ -327,31 +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 => {
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)
})
})
autoCreatePlanRequest(row)
}
// message.success(t('common.updateSuccess'))
// tableObject.loading = false
@ -399,30 +376,8 @@ 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 => {
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)
})
})
autoCreatePlanRequest(row)
}
})
if (!isAvailable) {
@ -596,30 +551,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'))
@ -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 handleImport = () => {
@ -672,6 +642,7 @@ const searchFormClick = (searchData) => {
/** 初始化 **/
onMounted(async () => {
getSwitch()
tableObject.params = {
planType: 'predictSparePart'
}

Loading…
Cancel
Save