diff --git a/src/views/finance/paymentSettlement/detail/columns.tsx b/src/views/finance/paymentSettlement/detail/columns.tsx index d1a8992f..d09d3e21 100644 --- a/src/views/finance/paymentSettlement/detail/columns.tsx +++ b/src/views/finance/paymentSettlement/detail/columns.tsx @@ -10,6 +10,7 @@ const optionsStore = useOptionsStore() import { useRoute } from 'vue-router' const route = useRoute() import { GetClientListByCode, getOrgList, GetClientBank, GetFeeCurrencySelectList } from '/@/api/common' +import { GetOrgList, ClientCommonGetStlMode, GetClientBankList,GetOrgBankList } from '../../feeSettlement/api' // 引入字典数据 import { getDictOption } from '/@/utils/dictUtil' import { placeholderSign } from 'element-plus/es/components/table-v2/src/private' @@ -281,10 +282,7 @@ export const formSchema: FormSchema[] = [ if (e && obj) { formModel.customerId = obj.id } - if (!e && !obj) { - formModel.customerId = '' - } - }, + } } } }, @@ -368,52 +366,147 @@ export const formSchema: FormSchema[] = [ { field: 'customerBankName', label: '客户银行', - component: 'ApiSelect', - required: false, - dynamicDisabled: false, + // show: ({ values }) => { + // return values.mode=='free'; + // }, colProps: { span: 4 }, + component: 'ApiSelect', componentProps: ({ formModel }) => { return { - api: GetClientBank, - params: { - id: formModel.customerId + api: () => { + return new Promise((resolve) => { + console.log(formModel) + const queryStr = [ + { + FieldName: 'ClientId', + FieldValue: formModel.customerId, + ConditionalType: '0', + }, + ] + const data = { + pageCondition: { + pageIndex: 1, + pageSize: 20, + sortConditions: [], + }, + queryCondition: JSON.stringify(queryStr), + } + GetClientBankList(data).then((res) => { + res.data.forEach(item=>{ + item.showName = item.bankName + ' ' + item.bankAccountNo + }) + resolve(res) + }) + }) }, - labelField: 'bankName', - valueField: 'id', - resultField: 'data', immediate: false, - filterOption: (input: string, option: any) => { - return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 - }, + labelField: 'showName', + valueField: 'bankName', + resultField: 'data', onChange: (e, obj) => { - console.log(obj) - if (e && obj) { - formModel.customerBankId = obj.value + if (obj) { + formModel.customerBankId = obj.id formModel.customerAccount = obj.bankAccountNo } - if (!e && !obj) { - formModel.customerBankId = null - formModel.customerBankName = null - formModel.customerAccount = null + if (!obj && !e) { + formModel.customerBankId = '' + formModel.customerAccount = '' } } } } }, { - field: 'customerBankId', - label: '', - component: 'Input', - show: false + field: 'customerAccount', + label: '客户账号', + // show: ({ values }) => { + // return values.mode=='free'; + // }, + colProps: { span: 4 }, + dynamicDisabled:true, + component: 'Input' }, { - field: 'customerAccount', - label: '银行账号', - component: 'Input', - required: false, - dynamicDisabled: false, - colProps: { span: 4 } + field: 'orgBankName', + label: '收款账号', + colProps: { span: 4 }, + component: 'ApiSelect', + componentProps: ({ formModel }) => { + return { + api: () => { + return new Promise((resolve) => { + GetOrgBankList().then((res) => { + res.data.forEach(item=>{ + item.showName = item.bankName + ' ' + item.bankAccountNo + }) + resolve(res) + }) + }) + }, + immediate: false, + labelField: 'showName', + valueField: 'showName', + resultField: 'data', + onChange: (e, obj) => { + if (obj) { + formModel.orgBankId = obj.id + } + if (!obj && !e) { + formModel.orgBankId = '' + } + }, + } + }, }, + // { + // field: 'customerBankName', + // label: '客户银行', + // component: 'ApiSelect', + // required: false, + // dynamicDisabled: false, + // colProps: { span: 4 }, + // componentProps: ({ formModel }) => { + // return { + // api: GetClientBank, + // params: { + // id: formModel.customerId + // }, + // labelField: 'bankName', + // valueField: 'id', + // resultField: 'data', + // immediate: false, + // filterOption: (input: string, option: any) => { + // return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + // }, + // onChange: (e, obj) => { + // console.log(obj) + // if (e && obj) { + // formModel.customerBankId = obj.value + // formModel.customerAccount = obj.bankAccountNo + // } + // if (!e && !obj) { + // formModel.customerBankId = null + // formModel.customerBankName = null + // formModel.customerAccount = null + // } + // } + // } + // } + // }, + // { + // field: 'customerBankId', + // label: '', + // component: 'Input', + // show: false + // }, + // { + // field: 'customerAccount', + // label: '银行账号', + // component: 'Input', + // required: false, + // dynamicDisabled: false, + // colProps: { span: 4 } + // }, { field: 'relativeNO', label: '相关号码', @@ -478,7 +571,6 @@ export const formSchema: FormSchema[] = [ dynamicDisabled: false, colProps: { span: 4 }, componentProps: { - showTime: true, allowClear: true, format: 'YYYY-MM-DD', valueFormat: 'YYYY-MM-DD' diff --git a/src/views/finance/paymentSettlement/detail/components/businessTable.vue b/src/views/finance/paymentSettlement/detail/components/businessTable.vue index 45d812ca..4d393cd9 100644 --- a/src/views/finance/paymentSettlement/detail/components/businessTable.vue +++ b/src/views/finance/paymentSettlement/detail/components/businessTable.vue @@ -253,8 +253,7 @@ const addInfos = async (type) => { const selectRows = getSelectRows() // 主单是否有币别 - const currency = props.formData.currency - console.log(currency) + const currency = getFieldsValue().currency if (selectRows.length == 0) { return createMessage.warning('没有选择要添加的业务!') } @@ -280,11 +279,10 @@ loading.value = false }) } else { - return // 转换汇率申请 - props.setFieldsValue({ - currency - }) + // props.setFieldsValue({ + // currency + // }) // 合并所有选择过的费用明细 let currencyList = [] // 根据申请单获取所有币别 @@ -294,10 +292,10 @@ customerId: item.customerId } }) - console.log(postCurrency) const items = await GetExchanges(postCurrency).then(res => { return res.data }) + console.log(items) items.forEach(item => { if (item.exchangeRates) { item.exchangeRates.forEach(c => { diff --git a/src/views/finance/paymentSettlement/detail/index.vue b/src/views/finance/paymentSettlement/detail/index.vue index 7c2a8a91..d5c332ee 100644 --- a/src/views/finance/paymentSettlement/detail/index.vue +++ b/src/views/finance/paymentSettlement/detail/index.vue @@ -147,10 +147,9 @@ const applyInfo = ref(null) // 保存 const save = async () => { - const settlement = await validate() const postData = { description: '按申请单增加添加费用明细', - settlement, + settlement: getFieldsValue(), documents: applyInfo.value.getSelectRows() } loading.value = true @@ -168,20 +167,22 @@ // 初始化接口 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 - } + setFieldsValue({ + ...res.data + }) + feeData.value = res.data.settlementDetails }) } else { // 新建 visible.value = true + const type = route.query.type + // 设置表单mode + setFieldsValue({ + mode: type + }) } } onMounted(() => { diff --git a/src/views/finance/paymentSettlement/index.vue b/src/views/finance/paymentSettlement/index.vue index bb967f16..4a736dd8 100644 --- a/src/views/finance/paymentSettlement/index.vue +++ b/src/views/finance/paymentSettlement/index.vue @@ -22,11 +22,11 @@ class="action-divider" />