客户对账 调整

zth
张同海 2 weeks ago
parent 027a292872
commit 2aeedd9bd5

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema } from '/@/components/Table'
import { GetAllClientList } from '/@/views/operation/CustomerReconciliation/api.js'
import { GetClientListByCode } from '/@/api/common'
export const billTypeData = [
{ value: 0, label: '全部' },
{ value: 1, label: '应收' },
@ -58,40 +58,62 @@ export const schemas: FormSchema[] = [
label: '对账客户',
field: 'customerName',
component: 'ApiSelect',
colProps: { span: 4 },
required: true,
dynamicDisabled: ({ values }) => {
return !!values.id && !!values.customerId
},
colProps: { span: 4 },
componentProps: (a) => {
return {
api: GetAllClientList,
api: GetClientListByCode,
params: { code: '' },
labelField: 'shortName',
valueField: 'shortName',
showName: 'description',
resultField: 'data',
immediate: true,
allowClear: true,
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
immediate: false,
onChange: (e, obj) => {
if (e && obj) {
console.log(obj)
a.formModel.customerId = obj.id
}
if (!e && !obj) {
a.formModel.customerId = ''
}
},
}
},
// componentProps: {
// options: billTypeData,
// labelField: 'shortName',
// valueField: 'id',
// },
},
// {
// field: 'isLocking',
// component: 'Switch',
// label: '账单状态',
// defaultValue: false,
// colProps: { span: 2 },
// label: '对账客户',
// field: 'customerName',
// component: 'ApiSelect',
// colProps: { span: 4 },
// required: true,
// componentProps: (a) => {
// return {
// api: GetAllClientList,
// labelField: 'shortName',
// valueField: 'shortName',
// resultField: 'data',
// immediate: true,
// allowClear: true,
// showSearch: true,
// filterOption: (input: string, option: any) => {
// return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
// },
// onChange: (e, obj) => {
// if (e && obj) {
// console.log(obj)
// a.formModel.customerId = obj.id
// }
// },
// }
// },
// // componentProps: {
// // options: billTypeData,
// // labelField: 'shortName',
// // valueField: 'id',
// // },
// },
{
@ -185,32 +207,23 @@ export const Editschemas: FormSchema[] = [
label: '对账客户',
colProps: { span: 4 },
show: false,
componentProps: (e) => {
return {
onEdit: () => {
const { formActionType } = e
formActionType ? formActionType.linkageForm(e) : null
},
}
},
},
{
label: '对账客户',
field: 'customerName',
component: 'DEdit',
required: false,
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: (a) => {
return {
api: GetAllClientList,
api: GetClientListByCode,
params: { code: '' },
labelField: 'shortName',
valueField: 'shortName',
showName: 'description',
resultField: 'data',
immediate: true,
allowClear: true,
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
immediate: false,
onChange: (e, obj) => {
if (e && obj) {
a.formModel.customerId = obj.id
@ -223,6 +236,35 @@ export const Editschemas: FormSchema[] = [
}
},
},
// {
// label: '对账客户',
// field: 'customerName',
// component: 'DEdit',
// colProps: { span: 4 },
// componentProps: (a) => {
// return {
// api: GetAllClientList,
// labelField: 'shortName',
// valueField: 'shortName',
// resultField: 'data',
// immediate: true,
// allowClear: true,
// showSearch: true,
// filterOption: (input: string, option: any) => {
// return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
// },
// onChange: (e, obj) => {
// if (e && obj) {
// a.formModel.customerId = obj.id
// }
// },
// onEdit: () => {
// const { formActionType } = a
// formActionType ? formActionType.linkageForm(a) : null
// },
// }
// },
// },
{
field: 'isNoTax',
component: 'DEdit',

@ -181,7 +181,7 @@
</a-spin>
</a-col>
</a-row>
<BasicModal v-bind="$attrs" width="80%" @register="registerFileModel" title="附件管理">
<BasicModal v-bind="$attrs" :width="1000" @register="registerFileModel" title="附件管理">
<BasicTable class="ds-table" @register="registerTableFile">
<template #tableTitle>
<a-button v-repeat type="link" @click="Lock">
@ -211,10 +211,10 @@
@add-detail-l="AddDetailL"
@add-detail-r="AddDetailR"
/>
<BasicModal width="80%" v-bind="$attrs" @register="registerEdit" title="账单详情">
<BasicModal :width="1000" v-bind="$attrs" @register="registerEdit" title="账单详情">
<ShowData />
</BasicModal>
<BasicModal width="30%" v-bind="$attrs" @register="registerFile" title="上传附件">
<BasicModal :width="420" v-bind="$attrs" @register="registerFile" title="上传附件">
<BasicForm @register="registerFormFile" />
</BasicModal>
</div>
@ -295,15 +295,13 @@
GetCheckBillBusinessList(ApiData).then((res) => {
setTableDataL(res.data.list)
Ldata.value = res.data.dataTotal
console.log(res, '左侧列表数据')
spinningL.value = false
})
// GetCheckBillFeeRecordsList(ApiData).then((res) => {
// setTableDataR(res.data)
// console.log(res, '')
// })
} else {
// addDetail()
addDetail()
}
}
function RauditClass() {
@ -496,6 +494,7 @@
function addDetail() {
openModalAdd(true, {
customerId: getFieldsValue().customerId,
customerName: getFieldsValue().customerName,
})
}
//
@ -616,6 +615,11 @@
//
async function AddDetailL(e) {
if (!id.value) {
setFieldsValue({
...getFieldsValue(),
customerId: e.customerId,
customerName: e.customerName,
})
await Save()
}
e.id = id.value
@ -624,20 +628,32 @@
notification.success({ message: '添加成功', duration: 3 })
init()
RefInfo.value.handleSubmit()
RefInfo.value.closeModal()
}
})
}
//
async function AddDetailR(e) {
if (!id.value) {
setFieldsValue({
...getFieldsValue(),
customerId: e.customerId,
customerName: e.customerName,
})
await Save()
}
console.log(getSelectRowsL()[getSelectRowsL().length - 1])
console.log(
getSelectRowsL(),
getSelectRowsL().length,
getSelectRowsL()[getSelectRowsL().length - 1].checkId,
)
e.id = getSelectRowsL()[getSelectRowsL().length - 1].checkId
AddCheckBillFeeRecords(e).then((res) => {
if (res.succeeded) {
notification.success({ message: '添加成功', duration: 3 })
init()
RefInfo.value.closeModal()
}
})
}

@ -5,8 +5,8 @@
title="添加账单明细"
@register="registerModal"
@cancel="closeModal"
width="84%"
height="793"
:width="1600"
:height="753"
:canFullscreen="false"
:showFooter="false"
>
@ -135,8 +135,6 @@
})
//
function selectionChange(e) {
console.log(e)
if (e.rows.length) {
spinningR.value = true
let ApiData = {
@ -148,7 +146,6 @@
},
}
GetFeeRecordQueryList(ApiData).then((res) => {
console.log(res.data)
let Arr: any = [
{ currency: 'RMB', cr: 0, dr: 0 },
{ currency: 'USD', cr: 0, dr: 0 },
@ -242,21 +239,23 @@
return postParam
}
//
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
const [registerModal, { setModalProps, closeModal }] = useModalInner((data) => {
spinningL.value = true
setFieldsValue({ customerId: data.customerId })
dataSourceL.value = []
setTableData([])
setModalProps({ confirmLoading: true, loading: true })
const res: API.DataResult = await GetBusinessQueryList(beforeFetch(getFieldsValue()))
if (res.succeeded) {
dataSourceL.value = res.data
setTableData([...res.data])
setTableDataRT([])
// setTableDataRB([])
spinningL.value = false
}
setModalProps({ confirmLoading: false, loading: false })
setFieldsValue({ customerId: data.customerId, customerName: data.customerName })
setTimeout(async () => {
dataSourceL.value = []
setTableData([])
setModalProps({ confirmLoading: true, loading: true })
const res: API.DataResult = await GetBusinessQueryList(beforeFetch(getFieldsValue()))
if (res.succeeded) {
dataSourceL.value = res.data
setTableData([...res.data])
setTableDataRT([])
// setTableDataRB([])
spinningL.value = false
}
setModalProps({ confirmLoading: false, loading: false })
}, 100)
})
//
const [registerTableRT, { setTableData: setTableDataRT, getSelectRows: getSelectRowsR }] =
@ -296,24 +295,34 @@
function addDetailL() {
let Apidata: any = {
ids: [],
customerId: '',
customerName: '',
}
getSelectRowsL().forEach((item) => {
Apidata.ids.push(item.id)
})
Apidata.customerId = getSelectRowsL()[0].customerId
Apidata.customerName = getSelectRowsL()[0].customerName
emit('AddDetailL', Apidata)
}
//
function addDetailR() {
let Apidata: any = {
ids: [],
customerId: '',
customerName: '',
}
getSelectRowsR().forEach((item) => {
console.log(item)
Apidata.ids.push(item.id)
})
Apidata.customerId = getSelectRowsL()[0].customerId
Apidata.customerName = getSelectRowsL()[0].customerName
emit('AddDetailR', Apidata)
}
defineExpose({
handleSubmit,
closeModal,
})
</script>
<style lang="less" scoped>

@ -35,28 +35,61 @@ export const RQueryArr = [
]
// 表单
export const schemas: FormSchema[] = [
// {
// label: '费用对象',
// field: 'customerId',
// component: 'ApiSelect',
// required: false,
// dynamicDisabled: false,
// colProps: { span: 4 },
// componentProps: () => {
// return {
// api: GetAllClientList,
// labelField: 'shortName',
// valueField: 'id',
// resultField: 'data',
// immediate: true,
// allowClear: true,
// filterOption: (input: string, option: any) => {
// return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
// },
// }
// },
// },
{
label: '费用对象',
field: 'customerId',
field: 'customerName',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: () => {
componentProps: (a) => {
return {
api: GetAllClientList,
api: GetClientListByCode,
params: { code: '' },
labelField: 'shortName',
valueField: 'id',
valueField: 'shortName',
showName: 'description',
resultField: 'data',
immediate: true,
allowClear: true,
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
immediate: false,
onChange: (e, obj) => {
if (e && obj) {
a.formModel.customerId = obj.id
}
if (!e && !obj) {
a.formModel.customerId = ''
}
},
}
},
},
{
field: 'customerId',
component: 'Input',
label: '对账客户',
colProps: { span: 4 },
show: false,
},
{
field: 'customNo',
component: 'Input',
@ -116,7 +149,7 @@ export const schemas: FormSchema[] = [
componentProps: () => {
return {
api: GetClientStlModeSelectList,
immediate: false,
immediate: true,
labelField: 'stlName',
valueField: 'id',
resultField: 'data',
@ -136,7 +169,7 @@ export const schemas: FormSchema[] = [
componentProps: () => {
return {
api: GetFeeCurrencySelectList,
immediate: false,
immediate: true,
labelField: 'name',
valueField: 'codeName',
resultField: 'data',
@ -165,7 +198,7 @@ export const schemas: FormSchema[] = [
})
})
},
immediate: false,
immediate: true,
valueField: 'id',
resultField: 'data',
// mode: 'multiple',
@ -221,7 +254,7 @@ export const schemas: FormSchema[] = [
componentProps: () => {
return {
api: GetVoynoSelectList,
immediate: false,
immediate: true,
labelField: 'voyNo',
valueField: 'id',
resultField: 'data',
@ -276,7 +309,7 @@ export const schemas: FormSchema[] = [
})
})
},
immediate: false,
immediate: true,
labelField: 'cnName',
valueField: 'id',
resultField: 'data',
@ -305,7 +338,7 @@ export const schemas: FormSchema[] = [
})
})
},
immediate: false,
immediate: true,
labelField: 'cnName',
valueField: 'id',
resultField: 'data',

Loading…
Cancel
Save