增加导出功能
This commit is contained in:
@@ -188,6 +188,12 @@
|
||||
</el-dialog>
|
||||
<order-source-sync-log-drawer ref="logDrawerRef" />
|
||||
<order-bill-product-check-drawer ref="productCheckDrawerRef" />
|
||||
|
||||
<excel-export-field-dialog
|
||||
ref="exportFieldRef"
|
||||
:fields="ORDER_BILL_EXPORT_FIELDS"
|
||||
storage-key="exportFields:orderBill"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -195,10 +201,13 @@
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { listOrderBill, localRebillAsync } from '@/api/price/billing'
|
||||
import { exportAsyncFromTable } from '@/utils/excelExport'
|
||||
import ExcelExportFieldDialog from '@/components/ExcelExportFieldDialog/index.vue'
|
||||
import { ORDER_BILL_EXPORT_FIELDS } from '@/utils/exportFieldDefs'
|
||||
import OrderSourceSyncLogDrawer from '../../monitor/orderSource/components/OrderSourceSyncLogDrawer.vue'
|
||||
import OrderBillProductCheckDrawer from './components/OrderBillProductCheckDrawer.vue'
|
||||
|
||||
const tableRef = ref()
|
||||
const exportFieldRef = ref()
|
||||
const logDrawerRef = ref()
|
||||
const productCheckDrawerRef = ref()
|
||||
const checkLoading = ref(false)
|
||||
@@ -417,19 +426,24 @@ function queryList(params) {
|
||||
return listOrderBill(query)
|
||||
}
|
||||
|
||||
function handleExport() {
|
||||
async function handleExport() {
|
||||
const params = tableRef.value?.getQueryParams?.() || {}
|
||||
if (!validateOrderIdentifierLimit(params.orderIdentifiers)) return
|
||||
const fields = await exportFieldRef.value?.open?.()
|
||||
if (!fields || !fields.length) return
|
||||
return exportAsyncFromTable({
|
||||
baseUrl: '/price/billing/orderBill/export',
|
||||
tableRef: tableRef.value,
|
||||
normalize: applySearchRanges,
|
||||
normalize: (raw) => {
|
||||
const q = applySearchRanges(raw)
|
||||
q.exportFields = fields
|
||||
return q
|
||||
},
|
||||
filePrefix: 'order_bill',
|
||||
requireFilter: true
|
||||
})
|
||||
}
|
||||
|
||||
const MAX_REBILL = 10000
|
||||
|
||||
function currentIdentifiers() {
|
||||
const q = tableRef.value?.getQueryParams?.() || {}
|
||||
|
||||
Reference in New Issue
Block a user