|
|
@ -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 { |
|
|
|