详情表单

szh-new
lijingjia 2 months ago
parent 8e6e180932
commit 7d237e0c44

@ -91,7 +91,7 @@ export const formSchema: FormSchema[] = [
const { data } = res
data.forEach(item => {
item['label'] = item.shortName
item['value'] = item.codeName
item['value'] = item.id
})
companyDict.value = data
})
@ -100,9 +100,9 @@ export const formSchema: FormSchema[] = [
}
},
{
field: 'costomerCode',
field: 'customerId',
label: '结算对象',
defaultValue: '',
defaultValue: null,
component: 'Select',
colProps: { span: 5 },
componentProps: ({ formModel }) => {

@ -57,7 +57,7 @@
const emits = defineEmits(['refresh', 'register'])
const list = [
{ label: '费用名称', field: 'feeName', span: 5 },
{ label: '费用对象', field: 'customerName', span: 5 },
{ label: '结算对象', field: 'customerName', span: 5 },
// { label: '', field: 'customerNo', span: 4, value: '1' },
{ label: '单位标准', field: 'unitText', span: 5 },
{ label: '不含税单价', field: 'noTaxPrice', span: 5 },
@ -80,6 +80,7 @@
})
const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(async (data) => {
detailData.value = JSON.parse(JSON.stringify(data.record))
console.log(data.record)
setFieldsValue({
...data.record,
beforeValue: JSON.parse(JSON.stringify(beforeValue.value)),
@ -96,14 +97,14 @@
formData.feeRecordId = values.id
formData.id = 0
formData.BusinessType = 1
const res: API.DataResult = await ApplyModification([formData])
setModalProps({ confirmLoading: false, loading: false })
if (res.succeeded) {
createMessage.success(res.message)
emits('refresh')
} else {
createMessage.error(res.message)
}
ApplyModification([formData]).then(res => {
if (res.succeeded) {
createMessage.success(res.message)
emits('refresh')
}
}).catch(() => {
setModalProps({ confirmLoading: false, loading: false })
})
closeModal()
}
onMounted(() => {

@ -246,7 +246,7 @@
source: async (query, process) => {
if (unitDict.value && unitDict.value.length) {
const dict = unitDict.value.map((item) => {
return item.value + '-' + item.name
return item.name + '-' + item.value
})
process(dict)
}

@ -63,8 +63,7 @@
showTableSetting: false,
bordered: false,
showIndexColumn: true,
canResize: true,
resizeHeightOffset: 1,
canResize: false,
// rowSelection: { type: 'checkbox' },
immediate: false
})

@ -302,7 +302,8 @@ export const formSchema: FormSchema[] = [
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: {
allowClear: true
allowClear: true,
valueFormat: 'YYYY-MM-DD'
}
},
{

@ -28,10 +28,10 @@
删除
</a-button>
</a-popconfirm>
<!-- <a-button style="margin-left: 100px;" type="link" @click="exportExcel">
<a-button v-if="id" type="link" @click="openFile">
<span class="iconfont icon-fujian" :style="{ fontSize: '12px' }"></span>
导出
</a-button> -->
附件
</a-button>
</div>
</div>
</template>
@ -46,21 +46,7 @@
</div>
</template>
</BasicTable>
<!-- <a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="2" tab="费用明细">
<div>
</div>
</a-tab-pane>
<a-tab-pane key="3" tab="附件上传" force-render>
<div style="width: 400px;">
<DsFile
ref="dsFile"
:id='route?.query?.id'
/>
</div>
</a-tab-pane>
</a-tabs> -->
<invoiceFile ref="invoiceFileRef"></invoiceFile>
</div>
</template>
<script lang="ts" setup>
@ -70,6 +56,7 @@
//
import DsFile from "/@/components/File/index.vue"
import { Divider } from 'ant-design-vue'
import invoiceFile from '/@/views/operation/invoiceIssue/detail/invoiceFile.vue'
import { DeleteDetail } from '../../api'
import { exportExcelByData } from '/@/hooks/web/common'
import { useMessage } from '/@/hooks/web/useMessage'
@ -139,6 +126,11 @@
const exportExcel = () => {
exportExcelByData(props.feeData, getColumns(), '费用明细')
}
//
const invoiceFileRef = ref(null)
const openFile = () => {
invoiceFileRef.value.init(props.id)
}
//
const cancelDel = () => {
deleteFlag.value = false

@ -18,10 +18,21 @@
<template #toolbar>
<div class="flex" style="width: 100%;">
<h4 style="width: 80px;">结算明细</h4>
<a-button class="ml15" type="link" @click="addInfos">
<span class="iconfont icon-zengjiatianjiajiajian" :style="{ fontSize: '12px' }"></span>
添加到结算明细
</a-button>
<a-dropdown>
<template #overlay>
<a-menu>
<a-menu-item @click="addInfos"></a-menu-item>
<a-menu-item @click="addInfos('rmb')">RMB</a-menu-item>
<a-menu-item @click="addInfos('usd')">USD</a-menu-item>
</a-menu>
</template>
<a-button class="ml15" type="link">
<span class="iconfont icon-zengjiatianjiajiajian" :style="{ fontSize: '12px' }"></span>
添加申请费用明细
<span class="iconfont icon-30jiantouxiangxiafill"></span>
</a-button>
</a-dropdown>
<BasicForm
class="currency-form"
@register="registerForm"
@ -239,7 +250,7 @@
//
const bPostData = ref({})
//
const addInfos = async () => {
const addInfos = async (type) => {
const selectRows = getSelectRows()
//
const currency = getFieldsValue().currency
@ -298,6 +309,14 @@
item.settlementRMB = row.settlementRMB
item.settlementUSD = row.settlementUSD
}
if (type == 'rmb') {
item.settlementUSD = 0
item.settlementOther = 0
}
if (type == 'usd') {
item.settlementRMB = 0
item.settlementOther = 0
}
})
})
//

@ -45,7 +45,7 @@
</div>
<div class="ds-detail-box">
<!-- 表单区域 -->
<div class="form-area">
<div class="form-area mt15">
<BasicForm @register="registerForm" />
</div>
<!-- 申请明细 -->
@ -82,15 +82,14 @@
</template>
<script lang="ts" setup>
import { ref, onMounted } from 'vue'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import ApplyInfo from './components/applyInfo.vue'
import { Divider } from 'ant-design-vue'
import { Get, Save } from '../api'
import { formatParams } from '/@/hooks/web/common'
import { Get, Save, Delete } from '../api'
//
import BusinessTable from './components/businessTable.vue'
import { BasicForm, useForm } from '/@/components/Form'
import { formSchema } from './columns'
import { closePage } from '/@/hooks/web/common'
import { useMessage } from '/@/hooks/web/useMessage'
const { createMessage } = useMessage()
import { useRoute } from 'vue-router'
@ -114,7 +113,20 @@
}
//
function deleteRow() {
const postData = {
ids: [id.value]
}
loading.value = true
Delete(postData).then(res => {
if (res.succeeded) {
createMessage.success('删除成功!')
closePage()
}
loading.value = false
}).catch(() => {
loading.value = false
createMessage.warning('网络异常,请重试!')
})
}
//
const create = () => {

@ -100,17 +100,17 @@ function fileSuccess() {
function addFile() {
dsFile.value.init()
}
function init() {
getfileList()
function init(id) {
getfileList(id)
openFileFlag.value = true
}
const fileSrc = ref('')
const fileFlag = ref(false)
const fileData = ref([]) as any
const fileloading = ref(false)
const getfileList = () => {
const getfileList = (id) => {
fileloading.value = true
GetOpFileList({ id: route.query.id }).then(res => {
GetOpFileList({ id: route.query.id || id }).then(res => {
fileloading.value = false
res.data.forEach(item => {
if (item.createTime) {

@ -565,7 +565,7 @@ export const searchFormSchema: FormSchema[] = [
showName: 'shortName',
valueField: 'id',
resultField: 'data',
immediate: false
immediate: true
}
}
},

@ -28,7 +28,7 @@
删除
</a-button>
</a-popconfirm>
<a-button type="link" @click="exportExcel">
<a-button type="link" @click="openFile">
<span class="iconfont icon-fujian" :style="{ fontSize: '12px' }"></span>
附件
</a-button>
@ -57,29 +57,14 @@
</div>
</template>
</BasicTable>
<!-- <a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="2" tab="费用明细">
<div>
</div>
</a-tab-pane>
<a-tab-pane key="3" tab="附件上传" force-render>
<div style="width: 400px;">
<DsFile
ref="dsFile"
:id='route?.query?.id'
/>
</div>
</a-tab-pane>
</a-tabs> -->
<invoiceFile ref="invoiceFileRef"></invoiceFile>
</div>
</template>
<script lang="ts" setup>
import { onMounted, ref, defineEmits, defineProps, watch, defineExpose } from 'vue'
import { BasicTable, useTable } from '/@/components/Table'
import { columns } from './applyInfoColumns'
//
import DsFile from "/@/components/File/index.vue"
import invoiceFile from '/@/views/operation/invoiceIssue/detail/invoiceFile.vue'
import { DeleteDetail } from '../../api'
import { exportExcelByData } from '/@/hooks/web/common'
import { useMessage } from '/@/hooks/web/useMessage'
@ -148,6 +133,11 @@
const exportExcel = () => {
exportExcelByData(props.feeData, getColumns(), '费用明细')
}
//
const invoiceFileRef = ref(null)
const openFile = () => {
invoiceFileRef.value.init(props.id)
}
//
const cancelDel = () => {
deleteFlag.value = false

@ -127,7 +127,6 @@
const save = async (feeInfo) => {
const postData = await validate()
console.log(postData)
return
if (feeInfo && feeInfo.length) {
postData['details'] = [...feeData.value, ...feeInfo]
} else {

Loading…
Cancel
Save