初始化项目
This commit is contained in:
@@ -19,7 +19,6 @@ export interface ErpDebtRecords extends BasicModel<ErpDebtRecords> {
|
||||
accountId: string; // 账户标识
|
||||
repayAmount: number; // 还款金额
|
||||
repayTime?: string; // 还款时间
|
||||
categoryId?: string; // 分类标识
|
||||
remark?: string; // 备注说明
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ export interface ErpDebts extends BasicModel<ErpDebts> {
|
||||
remaining?: number; // 已还金额
|
||||
endTime?: string; // 结清时间
|
||||
ustatus: string; // 状态
|
||||
categoryId?: string; // 分类标识
|
||||
remark?: string; // 交易备注
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
import { Icon } from '@jeesite/core/components/Icon';
|
||||
import { BasicForm, FormSchema, useForm } from '@jeesite/core/components/Form';
|
||||
import { BasicModal, useModalInner } from '@jeesite/core/components/Modal';
|
||||
import { ErpCategory, erpCategoryListAll } from '@jeesite/erp/api/erp/category';
|
||||
import { ErpDebtRecords, erpDebtRecordsSave, erpDebtRecordsForm } from '@jeesite/erp/api/erp/debtRecords';
|
||||
import { formatToDateTime } from '@jeesite/core/utils/dateUtil';
|
||||
|
||||
@@ -37,6 +36,8 @@
|
||||
const { showMessage } = useMessage();
|
||||
const { meta } = unref(router.currentRoute);
|
||||
const record = ref<ErpDebtRecords>({} as ErpDebtRecords);
|
||||
|
||||
const categoryParams = ref<Recordable>({ categoryType: '' });
|
||||
|
||||
const getTitle = computed(() => ({
|
||||
icon: meta.icon || 'i-ant-design:book-outlined',
|
||||
@@ -70,36 +71,22 @@
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('还款分类'),
|
||||
field: 'categoryId',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
api: erpCategoryListAll,
|
||||
params: {
|
||||
categoryType: '1'
|
||||
},
|
||||
fieldNames: { label: 'categoryName', value: 'categoryId' },
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('还款金额'),
|
||||
field: 'repayAmount',
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
maxlength: 10,
|
||||
maxlength: 20,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('备注说明'),
|
||||
field: 'remark',
|
||||
component: 'InputTextArea',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 200,
|
||||
},
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -109,22 +109,6 @@
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('父级分类'),
|
||||
dataIndex: 'parentName',
|
||||
key: 'd.parent_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('还款分类'),
|
||||
dataIndex: 'categoryName',
|
||||
key: 'd.category_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('还款金额'),
|
||||
dataIndex: 'repayAmount',
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
import { Icon } from '@jeesite/core/components/Icon';
|
||||
import { BasicForm, FormSchema, useForm } from '@jeesite/core/components/Form';
|
||||
import { BasicModal, useModalInner } from '@jeesite/core/components/Modal';
|
||||
import { ErpCategory, erpCategoryListAll } from '@jeesite/erp/api/erp/category';
|
||||
import { ErpDebts, erpDebtsSave, erpDebtsForm } from '@jeesite/erp/api/erp/debts';
|
||||
import { formatToDateTime } from '@jeesite/core/utils/dateUtil';
|
||||
|
||||
@@ -36,6 +37,8 @@
|
||||
const { showMessage } = useMessage();
|
||||
const { meta } = unref(router.currentRoute);
|
||||
const record = ref<ErpDebts>({} as ErpDebts);
|
||||
|
||||
const categoryParams = ref<Recordable>({ categoryType: '' });
|
||||
|
||||
const getTitle = computed(() => ({
|
||||
icon: meta.icon || 'i-ant-design:book-outlined',
|
||||
@@ -58,25 +61,49 @@
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('负债类型'),
|
||||
field: 'debtType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'debt_type',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('借贷金额'),
|
||||
field: 'debtAmount',
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
maxlength: 10,
|
||||
maxlength: 20,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('负债类型'),
|
||||
field: 'debtType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'debt_type',
|
||||
allowClear: true,
|
||||
onChange: (value: string) => {
|
||||
categoryParams.value.categoryType = value;
|
||||
},
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('借贷分类'),
|
||||
field: 'categoryId',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
api: erpCategoryListAll,
|
||||
params: categoryParams.value,
|
||||
fieldNames: { label: 'categoryName', value: 'categoryId' },
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('已还金额'),
|
||||
field: 'remaining',
|
||||
defaultValue: 0,
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
maxlength: 20,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('借贷状态'),
|
||||
field: 'ustatus',
|
||||
@@ -107,6 +134,9 @@
|
||||
const res = await erpDebtsForm(data);
|
||||
record.value = (res.erpDebts || {}) as ErpDebts;
|
||||
record.value.__t = new Date().getTime();
|
||||
if (record.value.debtType) {
|
||||
categoryParams.value.categoryType = record.value.debtType;
|
||||
}
|
||||
await setFieldsValue(record.value);
|
||||
setModalProps({ loading: false });
|
||||
});
|
||||
@@ -122,7 +152,7 @@
|
||||
|
||||
data[record.value.isNewRecord ? 'createTime' : 'updateTime'] = formatToDateTime(new Date());
|
||||
|
||||
console.log('submit', params, data, record);
|
||||
// console.log('submit', params, data, record);
|
||||
const res = await erpDebtsSave(params, data);
|
||||
showMessage(res.message);
|
||||
setTimeout(closeModal);
|
||||
|
||||
@@ -109,7 +109,6 @@
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
slot: 'bizScopeKey',
|
||||
},
|
||||
{
|
||||
title: t('借贷金额'),
|
||||
@@ -127,6 +126,22 @@
|
||||
width: 130,
|
||||
align: 'right',
|
||||
},
|
||||
{
|
||||
title: t('父级分类'),
|
||||
dataIndex: 'parentName',
|
||||
key: 'b.parent_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('借贷分类'),
|
||||
dataIndex: 'categoryName',
|
||||
key: 'b.category_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('结清时间'),
|
||||
dataIndex: 'endTime',
|
||||
|
||||
Reference in New Issue
Block a user