Browse Source

批量发布

master_hella_20240701
yufei0306 5 months ago
parent
commit
c9da71e7ab
  1. 3
      src/locales/en-US.ts
  2. 3
      src/locales/zh-CN.ts
  3. 2
      src/utils/disposition/defaultButtons.ts
  4. 50
      src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue

3
src/locales/en-US.ts

@ -1124,7 +1124,8 @@ export default {
:'Mail',
:'Today',
:'Please enter the reason for rejection',
'驳回原因不能为空,且不超过60字':'The reason for rejection cannot be empty and cannot exceed 60 words'
'驳回原因不能为空,且不超过60字':'The reason for rejection cannot be empty and cannot exceed 60 words',
:'Batch release'
},

3
src/locales/zh-CN.ts

@ -1124,7 +1124,8 @@ export default {
:'邮箱',
:'今日',
:'请输入驳回原因',
'驳回原因不能为空,且不超过60字':'驳回原因不能为空,且不超过60字'
'驳回原因不能为空,且不超过60字':'驳回原因不能为空,且不超过60字',
:'批量发布'
},

2
src/utils/disposition/defaultButtons.ts

@ -559,7 +559,7 @@ export function mainListOrderPubBtn(option:any) {
// 主列表-订单流程-批量发布按钮
export function mainListSelectionOrderPubBtn(option:any) {
return __defaultBtnOption(option,{
label: t(`ts.发布`).replace('ts.', ''),
label: t(`ts.批量发布`).replace('ts.', ''),
name: 'mainOrderSelectionPub',
hide: false,
type: 'primary',

50
src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue

@ -1,7 +1,7 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="[...PurchaseMain.allSchemas.searchSchema,...PurchaseDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" />
<Search :schema="[...PurchaseMain.allSchemas.searchSchema,...PurchaseDetail.allSchemas.searchSchema]" @search="searchList" @reset="searchList" />
</ContentWrap>
<!-- 列表头部 -->
@ -9,10 +9,12 @@
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" :allSchemas="PurchaseMain.allSchemas" :detailAllSchemas="PurchaseDetail.allSchemas" />
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable ref="elTableRef" :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
<Table v-clientTable ref="elTableRef"
:selection="true"
:columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
total: tableObject.total
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" >
v-model:sort="tableObject.sort" @getSelectionRows="getSelectionRows">
<!-- <Table ref="elTableRef" :expand="true" :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
total: tableObject.total
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage"
@ -227,6 +229,7 @@ console.log('PurchaseMain.allSchemas.searchSchema',PurchaseMain.allSchemas.searc
defaultButtons.defaultAddBtn({ hasPermi: 'wms:purchase-main:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'wms:purchase-main:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:purchase-main:export' }), //
defaultButtons.mainListSelectionOrderPubBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -256,6 +259,8 @@ console.log('PurchaseMain.allSchemas.searchSchema',PurchaseMain.allSchemas.searc
} else {
getList()
}
} else if (val=='mainOrderSelectionPub'){//
handleSelectionPublish()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
@ -403,7 +408,44 @@ console.log('PurchaseMain.allSchemas.searchSchema',PurchaseMain.allSchemas.searc
tableObject.loading = false
}
}
const searchList = (model)=>{
selectionRows.value = []
setSearchParams(model)
}
const selectionRows = ref<any>([])
const getSelectionRows = (currentPage,currentPageSelectionRows) => {
console.log("getSelectionRows",currentPage,currentPageSelectionRows)
const currentRows = selectionRows.value.find(item=>item.currentPage==currentPage)
if(currentRows){
currentRows.selectionRows = currentPageSelectionRows
}else{
selectionRows.value.push({
currentPage,
selectionRows:currentPageSelectionRows
})
}
}
//
const handleSelectionPublish = async ()=>{
//
await message.confirm(t('ts.是否发布所选中数据?'))
tableObject.loading = true
let rows:any = []
selectionRows.value.map(item=>{
rows = [...rows,...item.selectionRows.map(item1=>item1.masterId)]
})
tableObject.loading = true
Promise.all( rows.map(item=>PurchaseMainApi.publishPurchaseMain(item))).then((res) => {
console.log('发布',res)
if(res.every(item=>item==true)){
message.success(t('ts.发布成功!'))
}
}).finally(()=>{
tableObject.loading = false
//
getList()
})
}
/** 发布按钮操作 */
const handlePublish = async (id : number) => {
try {

Loading…
Cancel
Save