Browse Source

外部接口:添加批量重试全部重试按钮

intex_online20250327
songguoqiang 3 weeks ago
parent
commit
770f636497
  1. 13
      src/api/infra/outerApiHis/index.ts
  2. 2
      src/locales/en-US.ts
  3. 2
      src/locales/zh-CN.ts
  4. 29
      src/utils/disposition/defaultButtons.ts
  5. 70
      src/views/infra/outerApiHis/index.vue

13
src/api/infra/outerApiHis/index.ts

@ -57,6 +57,19 @@ export const retry = (id: number) => {
}) })
} }
//批量重试
export const batchRetry = async(ids: string,type:string) => {
// return request.get({
// url: '/wms/outer/batchRetry?ids=' + ids+'&type='+type
// })
//}
let data={
'ids':ids,
'type':type
}
return await request.post({ url: `/wms/outer/batchRetry`, data })
}
//禁用 //禁用
export const disable = (id: number) => { export const disable = (id: number) => {
return request.get({ return request.get({

2
src/locales/en-US.ts

@ -1327,5 +1327,7 @@ export default {
'索赔金额不能为0,请修改后提交。': 'The claim amount cannot be 0, please modify and submit.', '索赔金额不能为0,请修改后提交。': 'The claim amount cannot be 0, please modify and submit.',
: 'Create Shift', : 'Create Shift',
:'More', :'More',
:'Batch retry',
:'All retry',
}, },
} }

2
src/locales/zh-CN.ts

@ -1326,6 +1326,8 @@ export default {
'索赔金额不能为0,请修改后提交。': '索赔金额不能为0,请修改后提交。', '索赔金额不能为0,请修改后提交。': '索赔金额不能为0,请修改后提交。',
:'新增班次', :'新增班次',
:'更多', :'更多',
:'批量重试',
:'全部重试'
}, },
} }

29
src/utils/disposition/defaultButtons.ts

@ -733,6 +733,7 @@ export function mainListSelectionOrderPubBtn(option: any) {
hasPermi: '' hasPermi: ''
}) })
} }
// 主列表-订单流程-关闭按钮 // 主列表-订单流程-关闭按钮
export function mainListOrderCloBtn(option: any) { export function mainListOrderCloBtn(option: any) {
return __defaultBtnOption(option, { return __defaultBtnOption(option, {
@ -798,6 +799,34 @@ export function mainListPlanCloBtn(option: any) {
}) })
} }
// 主列表-批量重试按钮
export function mainListSelectionReTryBtn(option: any) {
return __defaultBtnOption(option, {
label: t(`ts.批量重试`).replace('ts.', ''),
name: 'mainSelectionReTry',
hide: false,
type: 'primary',
color: '',
float: 'left',
link: false, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-全部按钮
export function mainListAllReTryBtn(option: any) {
return __defaultBtnOption(option, {
label: t(`ts.全部重试`).replace('ts.', ''),
name: 'mainAllReTry',
hide: false,
type: 'primary',
color: '',
float: 'left',
link: false, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-上传质量报告 // 主列表-上传质量报告
export function mainListPlanUploadQualityReportBtn(option: any) { export function mainListPlanUploadQualityReportBtn(option: any) {
return __defaultBtnOption(option, { return __defaultBtnOption(option, {

70
src/views/infra/outerApiHis/index.vue

@ -17,6 +17,8 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table <Table
v-clientTable
ref="tableRef" :selection="true"
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -26,6 +28,9 @@
v-model:pageSize="tableObject.pageSize" v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
@getSelectionRows="getSelectionRows"
row-key="id"
:reserve-selection="true"
> >
<template #code="{row}"> <template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> <el-button type="primary" link @click="openDetail(row, '代码', row.code)">
@ -66,6 +71,7 @@ import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
import { waitForDebugger } from 'inspector' import { waitForDebugger } from 'inspector'
import { log } from 'console'
defineOptions({ name: 'OuterApiHis' }) defineOptions({ name: 'OuterApiHis' })
@ -102,6 +108,8 @@ const { getList, setSearchParams } = tableMethods
const HeadButttondata = [ const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:outerApiHis:create'}), // // defaultButtons.defaultAddBtn({hasPermi:'wms:outerApiHis:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:outerApiHis:import'}), // // defaultButtons.defaultImportBtn({hasPermi:'wms:outerApiHis:import'}), //
defaultButtons.mainListSelectionReTryBtn(null), //
defaultButtons.mainListAllReTryBtn(null), //
defaultButtons.defaultExportBtn(null), // defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
@ -119,7 +127,21 @@ const buttonBaseClick = (val, item) => {
} else if (val == 'refresh') { // } else if (val == 'refresh') { //
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') { //
} else { // } else if (val == 'mainAllReTry') { //
handleSelectionRetry('1')
}else if (val == 'mainSelectionReTry') { //
if (selectionRows.value.length > 0) {
// const trialResultList = selectionRows.value.filter(item => item.trialResult == 1)
// let str = ''
// if (trialResultList.length > 0) {
// str=Array.from(new Set(trialResultList.map(item=>item.number))).join('')
// message.error(`${str}`)
// return
// }
handleSelectionRetry('0')
}
}
else { //
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
@ -299,4 +321,50 @@ onMounted(async () => {
importTemplateData.templateUrl = await OuterApiHisApi.importTemplate() importTemplateData.templateUrl = await OuterApiHisApi.importTemplate()
}) })
const selectionRows = ref<any>([])
const tableRef = ref()
const getSelectionRows = (currentPage, currentPageSelectionRows) => {
selectionRows.value = currentPageSelectionRows
// const currentRows = selectionRows.value.find(item => item.currentPage == currentPage)
// console.log(currentPageSelectionRows)
// if(currentRows){
// currentRows.selectionRows = currentPageSelectionRows
// }else{
// selectionRows.value.push({
// currentPage,
// selectionRows:currentPageSelectionRows
// })
// }
}
//
const handleSelectionRetry = async (type:string)=>{
tableObject.loading = true
let ids= Array.from(new Set(selectionRows.value.map(item=>item.id))).join(',')
await OuterApiHisApi.batchRetry(ids,type)
.then((res) => {
// if (res?.status == '2') {
// message.error(res.message)
// } else {
// message.success(res.message)
// }
console.log('获取到的数据',res);
message.success(res.message)
tableObject.loading = false
buttonBaseClick('refresh', null)
})
.catch((err) => {
tableObject.loading = false
console.log(err)
})
// await PackageApi.batchPrintingLable(rows.join(',')).then(res => {
// console.log(res)
// window.open(srcPoint.value+'&relateNumber='+res)
// message.success('')
// }).catch(err => {
// console.log(err)
// message.error('')
// })
}
</script> </script>

Loading…
Cancel
Save