详情表单

szh-new
lijingjia 2 months ago
parent 25edaf576d
commit 8e6e180932

@ -140,7 +140,6 @@ export default {
// 币别
GetFeeCurrencySelectList: () => {
return GetFeeCurrencySelectList().then((res) => {
console.log(res.data)
return res.data
})
},

@ -11,6 +11,7 @@ enum Api {
Save = '/feeApi/PaymentSettlement/Save',
info = '/feeApi/PaymentSettlement/Get',
delete = '/feeApi/PaymentSettlement/Delete',
DeleteDetail = '/feeApi/PaymentSettlement/DeleteDetail',
GetApplicationList = '/feeApi/PaymentSettlement/GetApplicationList',
GetApplicationDetailsById = '/feeApi/PaymentSettlement/GetApplicationDetailsById',
GetExchanges = '/feeApi/PaymentSettlement/GetExchanges'
@ -49,6 +50,14 @@ export function Delete(data: PageRequest) {
})
}
// 删除申请单明细
export function DeleteDetail(data: PageRequest) {
return request<DataResult>({
url: Api.DeleteDetail,
method: 'post',
data
})
}
// 付费申请通过列表
export function GetApplicationList(data: PageRequest) {
return request<DataResult>({

@ -70,7 +70,7 @@
//
import DsFile from "/@/components/File/index.vue"
import { Divider } from 'ant-design-vue'
// import { BatchDelMappingYard } from '../../api'
import { DeleteDetail } from '../../api'
import { exportExcelByData } from '/@/hooks/web/common'
import { useMessage } from '/@/hooks/web/useMessage'
import feeTable from './feeTable.vue'
@ -128,12 +128,12 @@
ids
}
deleteFlag.value = false
// BatchDelMappingYard(postData).then(res => {
// if (res.succeeded) {
// createMessage.success('')
// emit('del')
// }
// })
DeleteDetail(postData).then(res => {
if (res.succeeded) {
createMessage.success('删除成功!')
emit('del')
}
})
}
//
const exportExcel = () => {
@ -162,12 +162,8 @@
setTableData([...list])
}
)
onMounted(() => {
//
reload()
})
defineExpose({
reload
getSelectRows
})
</script>

@ -5,79 +5,79 @@
-->
<template>
<div class="ds-fee-apply-settle-main-detail">
<div class="act-box">
<!-- 保存按钮组 -->
<ActionBar
code="sea_freight_export"
name="hyck"
:save="save"
:delete="deleteRow"
:create="create"
:showBtns="['create', 'save', 'delete', 'print']"
layout="horizontal"
></ActionBar>
<Divider
type="vertical"
class="action-divider"
/>
<!-- <a-dropdown>
<template #overlay>
<a-menu>
<a-menu-item @click="toggleBookingType(formData.bookingType)">{{
formData.bookingType == 'xs' ? '线下' : '线上'
}}</a-menu-item>
</a-menu>
</template>
<a-button type="link">
<span
style="font-size: 13px"
class="iconfont"
:class="{
'icon-xianshang': formData.bookingType == 'xs',
'icon-piliangxiaxian': formData.bookingType == 'xx',
}"
></span>
{{ formData.bookingType == 'xs' ? '线上' : '线下' }}
<span class="iconfont icon-30jiantouxiangxiafill"></span>
</a-button>
</a-dropdown> -->
</div>
<div class="ds-detail-box">
<!-- 表单区域 -->
<div class="form-area">
<BasicForm @register="registerForm" />
<a-spin :spinning="loading">
<div class="act-box">
<!-- 保存按钮组 -->
<ActionBar
code="sea_freight_export"
name="hyck"
:save="save"
:delete="deleteRow"
:create="create"
:showBtns="id ? ['create', 'save', 'delete', 'print'] : ['save']"
layout="horizontal"
></ActionBar>
<Divider
type="vertical"
class="action-divider"
/>
<!-- <a-dropdown>
<template #overlay>
<a-menu>
<a-menu-item @click="toggleBookingType(formData.bookingType)">{{
formData.bookingType == 'xs' ? '线下' : '线上'
}}</a-menu-item>
</a-menu>
</template>
<a-button type="link">
<span
style="font-size: 13px"
class="iconfont"
:class="{
'icon-xianshang': formData.bookingType == 'xs',
'icon-piliangxiaxian': formData.bookingType == 'xx',
}"
></span>
{{ formData.bookingType == 'xs' ? '线上' : '线下' }}
<span class="iconfont icon-30jiantouxiangxiafill"></span>
</a-button>
</a-dropdown> -->
</div>
<!-- 申请明细 -->
<div>
<ApplyInfo
ref="applyInfo"
:id="id"
:status="status"
:feeData="feeData"
@del="init"
@add="add"
></ApplyInfo>
<div class="ds-detail-box">
<!-- 表单区域 -->
<div class="form-area">
<BasicForm @register="registerForm" />
</div>
<!-- 申请明细 -->
<div>
<ApplyInfo
ref="applyInfo"
:id="id"
:feeData="feeData"
@del="init"
@add="add"
></ApplyInfo>
</div>
</div>
</div>
<a-modal
class="fee-modal"
v-model:visible="visible"
title="添加支付结算明细"
width="90%"
@ok="handleOk"
>
<!-- 业务表格 -->
<BusinessTable
v-if="visible"
ref="busTable"
:formData="getFieldsValue()"
:setFieldsValue="setFieldsValue"
@save="save"
@refresh="refresh"
></BusinessTable>
<template #footer>
</template>
</a-modal>
<a-modal
class="fee-modal"
v-model:visible="visible"
title="添加支付结算明细"
width="90%"
>
<!-- 业务表格 -->
<BusinessTable
v-if="visible"
ref="busTable"
:formData="getFieldsValue()"
:setFieldsValue="setFieldsValue"
@save="save"
@refresh="refresh"
></BusinessTable>
<template #footer>
</template>
</a-modal>
</a-spin>
</div>
</template>
<script lang="ts" setup>
@ -93,17 +93,19 @@
import { formSchema } from './columns'
import { useMessage } from '/@/hooks/web/useMessage'
const { createMessage } = useMessage()
import { useRoute, useRouter } from 'vue-router'
import { useRoute } from 'vue-router'
const route = useRoute()
const router = useRouter()
const [registerForm, { validate, getFieldsValue, setFieldsValue, getSelectRows }] = useForm({
import { useGo } from '/@/hooks/web/usePage'
const go = useGo()
const [registerForm, { validate, getFieldsValue, setFieldsValue }] = useForm({
labelWidth: 150,
schemas: formSchema,
readonly: route.path != '/payment-settlement/create',
showActionButtonGroup: false
})
// id
const id = ref(null)
const id = ref('')
const loading = ref(false)
//
const visible = ref(false)
//
@ -116,7 +118,7 @@
}
//
const create = () => {
router.go(0)
go(`/payment-settlement/create`)
}
//
function exportFile() {
@ -130,28 +132,41 @@
visible.value = false
init()
}
const applyInfo = ref(null)
//
const save = () => {
const settlement = validate()
const save = async () => {
const settlement = await validate()
const postData = {
description: '按申请单增加添加费用明细',
settlement,
documents: getSelectRows()
}
description: '按申请单增加添加费用明细',
settlement,
documents: applyInfo.value.getSelectRows()
}
loading.value = true
Save(postData).then(async (res) => {
loading.value = false
if (res.succeeded) {
createMessage.success('保存成功!')
}
}).catch(() => {
loading.value = false
})
}
//
const feeData = ref([])
//
const init = () => {
id.value = route.query.id || getFieldsValue().id
console.log(id.value)
if (id.value) {
//
Get({ id: id.value }).then(res => {
if (res.succeeded) {
setFieldsValue({
...res.data
})
feeData.value = res.data.settlementDetails
}
})
} else {
//
visible.value = true

@ -128,8 +128,8 @@
}
//
const handleEdit = () => {
const handleEdit = (row) => {
go(`/payment-settlement/detail?id=${row.id}`)
}
//
const create = () => {

Loading…
Cancel
Save