费用打印
parent
b9d764c09c
commit
1592554987
@ -0,0 +1,103 @@
|
||||
<!--
|
||||
* @Description: 提单信息历史数据列表弹窗组件
|
||||
* @Author: lijj
|
||||
* @Date: 2024-04-29 11:54:04
|
||||
-->
|
||||
<template>
|
||||
<a-modal
|
||||
title="提单信息"
|
||||
@cancel="visible = false"
|
||||
@ok="handleOk"
|
||||
v-if="visible"
|
||||
:visible="visible"
|
||||
width="80%"
|
||||
:loading="loading"
|
||||
>
|
||||
<BasicTable
|
||||
@register="registerTable"
|
||||
/>
|
||||
</a-modal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { defineExpose, ref, defineProps } from 'vue'
|
||||
import { BasicTable, useTable } from '/@/components/Table'
|
||||
import { GetBillManageHistoryList, ImportBillManageHistory } from '../../api/BookingLedger.js'
|
||||
import { columns, searchFormSchema } from './ladingInfo'
|
||||
// 引入提示信息
|
||||
import { useMessage } from '/@/hooks/web/useMessage'
|
||||
const { createMessage } = useMessage()
|
||||
import { useI18n } from '/@/hooks/web/useI18n'
|
||||
const { t } = useI18n()
|
||||
const props = defineProps({
|
||||
// 业务id
|
||||
id: {
|
||||
type: String
|
||||
},
|
||||
// 提单信息表
|
||||
reload: {
|
||||
type: Function
|
||||
}
|
||||
})
|
||||
// 引入处理入参方法
|
||||
import { formatParams } from '/@/hooks/web/common'
|
||||
const [registerTable, { reload, getSelectRows }] = useTable({
|
||||
title: '',
|
||||
api: async (p) => {
|
||||
const res: API.DataResult = await GetBillManageHistoryList(p)
|
||||
return new Promise((resolve) => {
|
||||
resolve({ data: [...res.data], total: res.count })
|
||||
})
|
||||
},
|
||||
// 请求前的参数格式化
|
||||
beforeFetch: (p) => {
|
||||
return formatParams(p)
|
||||
},
|
||||
columns,
|
||||
formConfig: {
|
||||
labelWidth: 120,
|
||||
// 表格表单需要的过滤字段集合
|
||||
schemas: searchFormSchema,
|
||||
},
|
||||
maxHeight: 600,
|
||||
isTreeTable: false,
|
||||
pagination: true,
|
||||
useSearchForm: true,
|
||||
showTableSetting: false,
|
||||
bordered: true,
|
||||
showIndexColumn: true,
|
||||
indexColumnProps: {
|
||||
width: 60,
|
||||
},
|
||||
rowSelection: {
|
||||
type: 'checkbox'
|
||||
},
|
||||
canResize: true,
|
||||
resizeHeightOffset: 80
|
||||
})
|
||||
const visible = ref(false)
|
||||
// 初始化组件
|
||||
const init = () => {
|
||||
visible.value = true
|
||||
}
|
||||
const loading = true
|
||||
const handleOk = () => {
|
||||
const rows = getSelectRows()
|
||||
const ids = rows.map(item => {
|
||||
return item.id
|
||||
})
|
||||
ImportBillManageHistory({ ids, businessType: 1, id: props.id }).then(res => {
|
||||
visible.value = false
|
||||
if (res.succeeded) {
|
||||
createMessage.success('导入成功!')
|
||||
props.reload()
|
||||
}
|
||||
})
|
||||
}
|
||||
defineExpose({
|
||||
init
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue