客户对账 调整

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

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

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

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

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

Loading…
Cancel
Save