Browse Source

生产计划 发布后创建备料和收货拆分按钮

hella_online_20240829
陈薪名 5 months ago
parent
commit
cb9398f392
  1. 120
      src/views/wms/productionManage/productionplan/productionMain/index.vue
  2. 21
      src/views/wms/productionManage/productionplan/productionMain/productionMain.data.ts
  3. 94
      src/views/wms/productionManage/productionplan/productionMainAssemble/index.vue
  4. 21
      src/views/wms/productionManage/productionplan/productionMainAssemble/productionMainAssemble.data.ts
  5. 92
      src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue
  6. 20
      src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/productionMainAssembleSparePart.data.ts
  7. 92
      src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue
  8. 21
      src/views/wms/productionManage/productionplan/productionMainPredictSparePart/productionMainPredictSparePart.data.ts

120
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
}

21
src/views/wms/productionManage/productionplan/productionMain/productionMain.data.ts

@ -399,7 +399,26 @@ export const ProductionMain = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
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',

94
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

21
src/views/wms/productionManage/productionplan/productionMainAssemble/productionMainAssemble.data.ts

@ -398,7 +398,26 @@ export const ProductionMain = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
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',

92
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) {

20
src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/productionMainAssembleSparePart.data.ts

@ -390,6 +390,26 @@ export const ProductionMain = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
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: '开始时间',

92
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) {

21
src/views/wms/productionManage/productionplan/productionMainPredictSparePart/productionMainPredictSparePart.data.ts

@ -391,7 +391,26 @@ export const ProductionMain = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
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',

Loading…
Cancel
Save