Browse Source

盘点加loading

hella_online_20240829
wangyufei 3 months ago
parent
commit
203a140f91
  1. 28
      src/views/wms/countManage/count/countJobMain/index.vue
  2. 5
      src/views/wms/countManage/count/countPlanMain/index.vue
  3. 20
      src/views/wms/countManage/count/countRequestMain/index.vue
  4. 16
      src/views/wms/countManage/countadjust/countadjustRequestMain/index.vue

28
src/views/wms/countManage/count/countJobMain/index.vue

@ -236,13 +236,23 @@ const buttonTableClick = async (val, row) => {
console.log('列表-操作按钮事件-执行') console.log('列表-操作按钮事件-执行')
} else if (val == 'mainJobAba') { // } else if (val == 'mainJobAba') { //
console.log('列表-操作按钮事件-放弃') console.log('列表-操作按钮事件-放弃')
await CountJobMainApi.abandonCountJobMain(row.id) tableObject.loading = true
await getList() try {
await CountJobMainApi.abandonCountJobMain(row.id)
await getList()
} finally {
tableObject.loading = false
}
} else if (val == 'mainJobClo') { // } else if (val == 'mainJobClo') { //
handleClose(row.id) handleClose(row.id)
} else if (val == 'mainJobAcc') { // } else if (val == 'mainJobAcc') { //
await CountJobMainApi.acceptCountJobMain(row.id) tableObject.loading = true
await getList() try {
await CountJobMainApi.acceptCountJobMain(row.id)
await getList()
} finally {
tableObject.loading = false
}
console.log('列表-操作按钮事件-承接') console.log('列表-操作按钮事件-承接')
} else if (val == 'exportCountJob'){// } else if (val == 'exportCountJob'){//
handleExportCountJob(row.id,row.number) handleExportCountJob(row.id,row.number)
@ -258,19 +268,23 @@ const buttonTableClick = async (val, row) => {
const handleClose = async (id: number) => { const handleClose = async (id: number) => {
try { try {
await message.confirm(t('common.confirmColse')) await message.confirm(t('common.confirmColse'))
tableObject.loading = true
await CountJobMainApi.closeCountJobMain(id) await CountJobMainApi.closeCountJobMain(id)
message.success(t('common.closeSuccess')) message.success(t('common.closeSuccess'))
await getList() await getList()
} catch {} } finally {
tableObject.loading = false
}
} }
// //
const handleDone = async (id: number) => { const handleDone = async (id: number) => {
try { try {
await message.confirm('确认完成吗?') await message.confirm('确认完成吗?')
tableObject.loading = true
await CountJobMainApi.doneCountJobMain(id) await CountJobMainApi.doneCountJobMain(id)
await getList() await getList()
} catch { } finally {
tableObject.loading = true
} }
} }

5
src/views/wms/countManage/count/countPlanMain/index.vue

@ -607,7 +607,9 @@ const handleDelete = async (id: number) => {
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()
} catch {} } finally {
tableObject.loading = false
}
} }
/** 导出按钮操作 */ /** 导出按钮操作 */
@ -676,6 +678,7 @@ const submitForm = async (formType, data) => {
value: item.value value: item.value
} }
}) // }) //
formRef.value.formLoading = true
try { try {
if (formType === 'create') { if (formType === 'create') {
await CountPlanMainApi.createCountPlanMain(data) await CountPlanMainApi.createCountPlanMain(data)

20
src/views/wms/countManage/count/countRequestMain/index.vue

@ -169,6 +169,11 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
// //
const searchTableSuccessCount = (formField, searchField, val, type,row,count) => { const searchTableSuccessCount = (formField, searchField, val, type,row,count) => {
nextTick(() => { nextTick(() => {
let getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
if (formField == 'reCount') { if (formField == 'reCount') {
// //
if(type == 3){ if(type == 3){
@ -177,7 +182,10 @@ const searchTableSuccessCount = (formField, searchField, val, type,row,count) =>
row.type = type row.type = type
CountRequestMainApi.reCount(row).then((res)=>{ CountRequestMainApi.reCount(row).then((res)=>{
message.success('重盘成功') message.success('重盘成功')
getLoading?.close()
getList() getList()
}).catch((err) => {
getLoading?.close()
}) })
} else { } else {
// //
@ -189,7 +197,10 @@ const searchTableSuccessCount = (formField, searchField, val, type,row,count) =>
row.type = type row.type = type
CountRequestMainApi.superviseCount(row).then((res)=>{ CountRequestMainApi.superviseCount(row).then((res)=>{
message.success('监盘成功') message.success('监盘成功')
getLoading?.close()
getList() getList()
}).catch((err) => {
getLoading?.close()
}) })
} }
}) })
@ -413,12 +424,15 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'countAdjustRequest') { } else if (val == 'countAdjustRequest') {
// //
await message.confirm('确认要生成盘点调整申请吗?') await message.confirm('确认要生成盘点调整申请吗?')
tableObject.loading = true
CountRequestMainApi.generateCountadjustRequest(row.id) CountRequestMainApi.generateCountadjustRequest(row.id)
.then(() => { .then(() => {
message.success(t('已生成盘点调整申请')) message.success(t('已生成盘点调整申请'))
tableObject.loading = false
getList() getList()
}) })
.catch((err) => { .catch((err) => {
tableObject.loading = false
console.log(err) console.log(err)
}) })
} else if (val == 'mainThaw') { } else if (val == 'mainThaw') {
@ -469,11 +483,13 @@ const handleDelete = async (id: number) => {
tableObject.loading = true tableObject.loading = true
// //
await CountRequestMainApi.deleteCountRequestMain(id) await CountRequestMainApi.deleteCountRequestMain(id)
tableObject.loading = false
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()
} catch {} } finally {
tableObject.loading = false
}
} }
/** 导出按钮操作 */ /** 导出按钮操作 */

16
src/views/wms/countManage/countadjust/countadjustRequestMain/index.vue

@ -257,13 +257,18 @@ const buttonTableClick = async (val, row) => {
}) })
} else if (val == 'mainHandle') { // } else if (val == 'mainHandle') { //
await message.confirm('确认要处理吗?') await message.confirm('确认要处理吗?')
tableObject.loading = true let getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
CountadjustRequestMainApi.handle(row.id).then(() => { CountadjustRequestMainApi.handle(row.id).then(() => {
message.success(t('处理成功')) message.success(t('处理成功'))
tableObject.loading = false getLoading?.close()
getList() getList()
}).catch(err => { }).catch(err => {
tableObject.loading = false getLoading?.close()
console.log(err) console.log(err)
}) })
} else if (val == 'edit') { // } else if (val == 'edit') { //
@ -299,11 +304,12 @@ const handleDelete = async (id: number) => {
tableObject.loading = true tableObject.loading = true
// //
await CountadjustRequestMainApi.deleteCountadjustRequestMain(id) await CountadjustRequestMainApi.deleteCountadjustRequestMain(id)
tableObject.loading = false
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()
} catch {} } finally {
tableObject.loading = false
}
} }
/** 导出按钮操作 */ /** 导出按钮操作 */

Loading…
Cancel
Save