初始化项目
This commit is contained in:
@@ -40,6 +40,23 @@ import java.io.Serial;
|
|||||||
@Column(name = "transfer_amount", attrName = "transferAmount", label = "转账金额", isQuery = false),
|
@Column(name = "transfer_amount", attrName = "transferAmount", label = "转账金额", isQuery = false),
|
||||||
@Column(name = "transfer_status", attrName = "transferStatus", label = "转账状态"),
|
@Column(name = "transfer_status", attrName = "transferStatus", label = "转账状态"),
|
||||||
@Column(name = "remark", attrName = "remark", label = "转账备注", queryType = QueryType.LIKE),
|
@Column(name = "remark", attrName = "remark", label = "转账备注", queryType = QueryType.LIKE),
|
||||||
|
}, joinTable = {
|
||||||
|
@JoinTable(type = Type.LEFT_JOIN, entity = ErpAccount.class, alias = "b",
|
||||||
|
on = "a.out_account_id = b.account_id", attrName = "this",
|
||||||
|
columns = {
|
||||||
|
@Column(name = "account_name", attrName = "accountOutName", label = "账户名称"),
|
||||||
|
}),
|
||||||
|
@JoinTable(type = Type.LEFT_JOIN, entity = ErpAccount.class, alias = "c",
|
||||||
|
on = "a.in_account_id = c.account_id", attrName = "this",
|
||||||
|
columns = {
|
||||||
|
@Column(name = "account_name", attrName = "accountInName", label = "账户名称"),
|
||||||
|
}),
|
||||||
|
@JoinTable(type = Type.LEFT_JOIN, entity = ErpCategory.class, alias = "d",
|
||||||
|
on = "a.category_id = d.category_id", attrName = "this",
|
||||||
|
columns = {
|
||||||
|
@Column(name = "parent_name", attrName = "parentName", label = "父级名称"),
|
||||||
|
@Column(name = "category_name", attrName = "categoryName", label = "分类名称"),
|
||||||
|
}),
|
||||||
}, orderBy = "a.transfer_id DESC"
|
}, orderBy = "a.transfer_id DESC"
|
||||||
)
|
)
|
||||||
@Data
|
@Data
|
||||||
@@ -57,13 +74,21 @@ public class ErpAccountTransfer extends DataEntity<ErpAccountTransfer> implement
|
|||||||
private String transferStatus; // 转账状态
|
private String transferStatus; // 转账状态
|
||||||
private String remark; // 转账备注
|
private String remark; // 转账备注
|
||||||
|
|
||||||
|
private String accountOutName;
|
||||||
|
private String accountInName;
|
||||||
|
|
||||||
|
private String parentName;
|
||||||
|
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
@ExcelFields({
|
@ExcelFields({
|
||||||
@ExcelField(title = "记录时间", attrName = "createTime", align = Align.CENTER, sort = 10, dataFormat = "yyyy-MM-dd hh:mm"),
|
@ExcelField(title = "记录时间", attrName = "createTime", align = Align.CENTER, sort = 10, dataFormat = "yyyy-MM-dd hh:mm"),
|
||||||
@ExcelField(title = "转账主键", attrName = "transferId", align = Align.CENTER, sort = 20),
|
@ExcelField(title = "转账主键", attrName = "transferId", align = Align.CENTER, sort = 20),
|
||||||
@ExcelField(title = "转账名称", attrName = "transferName", align = Align.CENTER, sort = 30),
|
@ExcelField(title = "转账名称", attrName = "transferName", align = Align.CENTER, sort = 30),
|
||||||
@ExcelField(title = "转出账号", attrName = "outAccountId", align = Align.CENTER, sort = 40),
|
@ExcelField(title = "转出账号", attrName = "accountOutName", align = Align.CENTER, sort = 40),
|
||||||
@ExcelField(title = "转入账号", attrName = "inAccountId", align = Align.CENTER, sort = 50),
|
@ExcelField(title = "转入账号", attrName = "accountInName", align = Align.CENTER, sort = 50),
|
||||||
@ExcelField(title = "转账分类", attrName = "categoryId", align = Align.CENTER, sort = 60),
|
@ExcelField(title = "父级分类", attrName = "parentName", align = Align.CENTER, sort = 60),
|
||||||
|
@ExcelField(title = "转账分类", attrName = "categoryName", align = Align.CENTER, sort = 60),
|
||||||
@ExcelField(title = "转账金额", attrName = "transferAmount", align = Align.CENTER, sort = 70),
|
@ExcelField(title = "转账金额", attrName = "transferAmount", align = Align.CENTER, sort = 70),
|
||||||
@ExcelField(title = "转账状态", attrName = "transferStatus", align = Align.CENTER, sort = 80),
|
@ExcelField(title = "转账状态", attrName = "transferStatus", align = Align.CENTER, sort = 80),
|
||||||
@ExcelField(title = "转账备注", attrName = "remark", align = Align.CENTER, sort = 90),
|
@ExcelField(title = "转账备注", attrName = "remark", align = Align.CENTER, sort = 90),
|
||||||
|
|||||||
@@ -42,6 +42,18 @@ import java.io.Serial;
|
|||||||
@Column(name = "remark", attrName = "remark", label = "交易备注", isQuery = false),
|
@Column(name = "remark", attrName = "remark", label = "交易备注", isQuery = false),
|
||||||
@Column(name = "update_time", attrName = "updateTime", label = "更新时间", isQuery = false, isUpdateForce = true),
|
@Column(name = "update_time", attrName = "updateTime", label = "更新时间", isQuery = false, isUpdateForce = true),
|
||||||
@Column(name = "business_id", attrName = "businessId", label = "业务标识"),
|
@Column(name = "business_id", attrName = "businessId", label = "业务标识"),
|
||||||
|
}, joinTable = {
|
||||||
|
@JoinTable(type = Type.LEFT_JOIN, entity = ErpAccount.class, alias = "b",
|
||||||
|
on = "a.account_id = b.account_id", attrName = "this",
|
||||||
|
columns = {
|
||||||
|
@Column(name = "account_name", attrName = "accountName", label = "账户名称"),
|
||||||
|
}),
|
||||||
|
@JoinTable(type = Type.LEFT_JOIN, entity = ErpCategory.class, alias = "c",
|
||||||
|
on = "a.category_id = c.category_id", attrName = "this",
|
||||||
|
columns = {
|
||||||
|
@Column(name = "parent_name", attrName = "parentName", label = "父级名称"),
|
||||||
|
@Column(name = "category_name", attrName = "categoryName", label = "分类名称"),
|
||||||
|
}),
|
||||||
}, orderBy = "a.create_time DESC"
|
}, orderBy = "a.create_time DESC"
|
||||||
)
|
)
|
||||||
@Data
|
@Data
|
||||||
@@ -61,15 +73,22 @@ public class ErpTransactionFlow extends DataEntity<ErpTransactionFlow> implement
|
|||||||
private Date updateTime; // 更新时间
|
private Date updateTime; // 更新时间
|
||||||
private String businessId; // 业务标识
|
private String businessId; // 业务标识
|
||||||
|
|
||||||
|
private String accountName;
|
||||||
|
|
||||||
|
private String parentName;
|
||||||
|
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
@ExcelFields({
|
@ExcelFields({
|
||||||
@ExcelField(title = "记录时间", attrName = "createTime", align = Align.CENTER, sort = 10, dataFormat = "yyyy-MM-dd hh:mm"),
|
@ExcelField(title = "记录时间", attrName = "createTime", align = Align.CENTER, sort = 10, dataFormat = "yyyy-MM-dd hh:mm"),
|
||||||
@ExcelField(title = "流水", attrName = "flowId", align = Align.CENTER, sort = 20),
|
@ExcelField(title = "流水标识", attrName = "flowId", align = Align.CENTER, sort = 20),
|
||||||
@ExcelField(title = "交易名称", attrName = "flowName", align = Align.CENTER, sort = 30),
|
@ExcelField(title = "交易名称", attrName = "flowName", align = Align.CENTER, sort = 30),
|
||||||
@ExcelField(title = "交易类型", attrName = "flowType", align = Align.CENTER, sort = 40),
|
@ExcelField(title = "交易类型", attrName = "flowType",dictType = "erp_type", align = Align.CENTER, sort = 40),
|
||||||
@ExcelField(title = "交易金额", attrName = "amount", align = Align.CENTER, sort = 50),
|
@ExcelField(title = "交易金额", attrName = "amount", align = Align.CENTER, sort = 50),
|
||||||
@ExcelField(title = "交易时间", attrName = "tradeTime", align = Align.CENTER, sort = 60, dataFormat = "yyyy-MM-dd hh:mm"),
|
@ExcelField(title = "交易时间", attrName = "tradeTime", align = Align.CENTER, sort = 60, dataFormat = "yyyy-MM-dd hh:mm"),
|
||||||
@ExcelField(title = "交易账户", attrName = "accountId", align = Align.CENTER, sort = 70),
|
@ExcelField(title = "交易账户", attrName = "accountName", align = Align.CENTER, sort = 70),
|
||||||
@ExcelField(title = "交易分类", attrName = "categoryId", align = Align.CENTER, sort = 80),
|
@ExcelField(title = "父级分类", attrName = "parentName", align = Align.CENTER, sort = 80),
|
||||||
|
@ExcelField(title = "交易分类", attrName = "categoryName", align = Align.CENTER, sort = 80),
|
||||||
@ExcelField(title = "交易备注", attrName = "remark", align = Align.CENTER, sort = 90),
|
@ExcelField(title = "交易备注", attrName = "remark", align = Align.CENTER, sort = 90),
|
||||||
@ExcelField(title = "更新时间", attrName = "updateTime", align = Align.CENTER, sort = 100, dataFormat = "yyyy-MM-dd hh:mm"),
|
@ExcelField(title = "更新时间", attrName = "updateTime", align = Align.CENTER, sort = 100, dataFormat = "yyyy-MM-dd hh:mm"),
|
||||||
@ExcelField(title = "业务标识", attrName = "businessId", align = Align.CENTER, sort = 110),
|
@ExcelField(title = "业务标识", attrName = "businessId", align = Align.CENTER, sort = 110),
|
||||||
|
|||||||
@@ -4,20 +4,20 @@
|
|||||||
* @author gaoxq
|
* @author gaoxq
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<BasicDrawer
|
<BasicModal
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
:showFooter="true"
|
:showFooter="true"
|
||||||
:okAuth="'erp:accountTransfer:edit'"
|
:okAuth="'erp:accountTransfer:edit'"
|
||||||
@register="registerDrawer"
|
@register="registerModal"
|
||||||
@ok="handleSubmit"
|
@ok="handleSubmit"
|
||||||
width="70%"
|
width="60%"
|
||||||
>
|
>
|
||||||
<template #title>
|
<template #title>
|
||||||
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
|
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
|
||||||
<span> {{ getTitle.value }} </span>
|
<span> {{ getTitle.value }} </span>
|
||||||
</template>
|
</template>
|
||||||
<BasicForm @register="registerForm" />
|
<BasicForm @register="registerForm" />
|
||||||
</BasicDrawer>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup name="ViewsErpAccountTransferForm">
|
<script lang="ts" setup name="ViewsErpAccountTransferForm">
|
||||||
import { ref, unref, computed } from 'vue';
|
import { ref, unref, computed } from 'vue';
|
||||||
@@ -26,7 +26,8 @@
|
|||||||
import { router } from '@jeesite/core/router';
|
import { router } from '@jeesite/core/router';
|
||||||
import { Icon } from '@jeesite/core/components/Icon';
|
import { Icon } from '@jeesite/core/components/Icon';
|
||||||
import { BasicForm, FormSchema, useForm } from '@jeesite/core/components/Form';
|
import { BasicForm, FormSchema, useForm } from '@jeesite/core/components/Form';
|
||||||
import { BasicDrawer, useDrawerInner } from '@jeesite/core/components/Drawer';
|
import { BasicModal, useModalInner } from '@jeesite/core/components/Modal';
|
||||||
|
import { ErpCategory, erpCategoryListAll } from '@jeesite/erp/api/erp/category';
|
||||||
import { ErpAccountTransfer, erpAccountTransferSave, erpAccountTransferForm } from '@jeesite/erp/api/erp/accountTransfer';
|
import { ErpAccountTransfer, erpAccountTransferSave, erpAccountTransferForm } from '@jeesite/erp/api/erp/accountTransfer';
|
||||||
import { formatToDateTime } from '@jeesite/core/utils/dateUtil';
|
import { formatToDateTime } from '@jeesite/core/utils/dateUtil';
|
||||||
|
|
||||||
@@ -58,50 +59,59 @@
|
|||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: t('转账分类'),
|
||||||
|
field: 'categoryId',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
api: erpCategoryListAll,
|
||||||
|
params: {
|
||||||
|
categoryType: '0'
|
||||||
|
},
|
||||||
|
fieldNames: { label: 'categoryName', value: 'categoryId' },
|
||||||
|
},
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: t('转出账号'),
|
label: t('转出账号'),
|
||||||
field: 'outAccountId',
|
field: 'outAccountId',
|
||||||
component: 'Input',
|
fieldLabel: 'accountOutName',
|
||||||
|
component: 'ListSelect',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
maxlength: 32,
|
selectType: 'erpAccountSelect',
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('转入账号'),
|
label: t('转入账号'),
|
||||||
field: 'inAccountId',
|
field: 'inAccountId',
|
||||||
component: 'Input',
|
fieldLabel: 'accountInName',
|
||||||
|
component: 'ListSelect',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
maxlength: 32,
|
selectType: 'erpAccountSelect',
|
||||||
},
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('转账分类'),
|
|
||||||
field: 'categoryId',
|
|
||||||
component: 'Input',
|
|
||||||
componentProps: {
|
|
||||||
maxlength: 52,
|
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('转账金额'),
|
label: t('转账金额'),
|
||||||
field: 'transferAmount',
|
field: 'transferAmount',
|
||||||
component: 'Input',
|
component: 'InputNumber',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
maxlength: 30,
|
maxlength: 20,
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('转账状态'),
|
label: t('转账状态'),
|
||||||
field: 'transferStatus',
|
field: 'transferStatus',
|
||||||
component: 'Input',
|
defaultValue: '0',
|
||||||
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
maxlength: 12,
|
dictType: 'transfer_status',
|
||||||
|
allowClear: true,
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
|
dynamicDisabled:true ,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('转账备注'),
|
label: t('转账备注'),
|
||||||
@@ -120,20 +130,20 @@
|
|||||||
baseColProps: { md: 24, lg: 12 },
|
baseColProps: { md: 24, lg: 12 },
|
||||||
});
|
});
|
||||||
|
|
||||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||||
setDrawerProps({ loading: true });
|
setModalProps({ loading: true });
|
||||||
await resetFields();
|
await resetFields();
|
||||||
const res = await erpAccountTransferForm(data);
|
const res = await erpAccountTransferForm(data);
|
||||||
record.value = (res.erpAccountTransfer || {}) as ErpAccountTransfer;
|
record.value = (res.erpAccountTransfer || {}) as ErpAccountTransfer;
|
||||||
record.value.__t = new Date().getTime();
|
record.value.__t = new Date().getTime();
|
||||||
await setFieldsValue(record.value);
|
await setFieldsValue(record.value);
|
||||||
setDrawerProps({ loading: false });
|
setModalProps({ loading: false });
|
||||||
});
|
});
|
||||||
|
|
||||||
async function handleSubmit() {
|
async function handleSubmit() {
|
||||||
try {
|
try {
|
||||||
const data = await validate();
|
const data = await validate();
|
||||||
setDrawerProps({ confirmLoading: true });
|
setModalProps({ confirmLoading: true });
|
||||||
const params: any = {
|
const params: any = {
|
||||||
isNewRecord: record.value.isNewRecord,
|
isNewRecord: record.value.isNewRecord,
|
||||||
transferId: record.value.transferId || data.transferId,
|
transferId: record.value.transferId || data.transferId,
|
||||||
@@ -144,7 +154,7 @@
|
|||||||
// console.log('submit', params, data, record);
|
// console.log('submit', params, data, record);
|
||||||
const res = await erpAccountTransferSave(params, data);
|
const res = await erpAccountTransferSave(params, data);
|
||||||
showMessage(res.message);
|
showMessage(res.message);
|
||||||
setTimeout(closeDrawer);
|
setTimeout(closeModal);
|
||||||
emit('success', data);
|
emit('success', data);
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
if (error && error.errorFields) {
|
if (error && error.errorFields) {
|
||||||
@@ -152,7 +162,7 @@
|
|||||||
}
|
}
|
||||||
console.log('error', error);
|
console.log('error', error);
|
||||||
} finally {
|
} finally {
|
||||||
setDrawerProps({ confirmLoading: false });
|
setModalProps({ confirmLoading: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<InputForm @register="registerDrawer" @success="handleSuccess" />
|
<InputForm @register="registerModal" @success="handleSuccess" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup name="ViewsErpAccountTransferList">
|
<script lang="ts" setup name="ViewsErpAccountTransferList">
|
||||||
@@ -36,9 +36,9 @@
|
|||||||
import { router } from '@jeesite/core/router';
|
import { router } from '@jeesite/core/router';
|
||||||
import { Icon } from '@jeesite/core/components/Icon';
|
import { Icon } from '@jeesite/core/components/Icon';
|
||||||
import { BasicTable, BasicColumn, useTable } from '@jeesite/core/components/Table';
|
import { BasicTable, BasicColumn, useTable } from '@jeesite/core/components/Table';
|
||||||
|
import { ErpCategory, erpCategoryListAll } from '@jeesite/erp/api/erp/category';
|
||||||
import { ErpAccountTransfer, erpAccountTransferList } from '@jeesite/erp/api/erp/accountTransfer';
|
import { ErpAccountTransfer, erpAccountTransferList } from '@jeesite/erp/api/erp/accountTransfer';
|
||||||
import { erpAccountTransferDelete, erpAccountTransferListData } from '@jeesite/erp/api/erp/accountTransfer';
|
import { erpAccountTransferDelete, erpAccountTransferListData } from '@jeesite/erp/api/erp/accountTransfer';
|
||||||
import { useDrawer } from '@jeesite/core/components/Drawer';
|
|
||||||
import { useModal } from '@jeesite/core/components/Modal';
|
import { useModal } from '@jeesite/core/components/Modal';
|
||||||
import { FormProps } from '@jeesite/core/components/Form';
|
import { FormProps } from '@jeesite/core/components/Form';
|
||||||
import InputForm from './form.vue';
|
import InputForm from './form.vue';
|
||||||
@@ -84,23 +84,38 @@
|
|||||||
{
|
{
|
||||||
label: t('转出账号'),
|
label: t('转出账号'),
|
||||||
field: 'outAccountId',
|
field: 'outAccountId',
|
||||||
component: 'Input',
|
fieldLabel: 'accountOutName',
|
||||||
|
component: 'ListSelect',
|
||||||
|
componentProps: {
|
||||||
|
selectType: 'erpAccountSelect',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('转账分类'),
|
label: t('转账分类'),
|
||||||
field: 'categoryId',
|
field: 'categoryId',
|
||||||
component: 'Input',
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
api: erpCategoryListAll,
|
||||||
|
params: {
|
||||||
|
categoryType: '0'
|
||||||
|
},
|
||||||
|
fieldNames: { label: 'categoryName', value: 'categoryId' },
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: t('转账状态'),
|
|
||||||
field: 'transferStatus',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('转账备注'),
|
label: t('转账备注'),
|
||||||
field: 'remark',
|
field: 'remark',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: t('转账状态'),
|
||||||
|
field: 'transferStatus',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
dictType: 'transfer_status',
|
||||||
|
allowClear: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -110,39 +125,47 @@
|
|||||||
dataIndex: 'createTime',
|
dataIndex: 'createTime',
|
||||||
key: 'a.create_time',
|
key: 'a.create_time',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 230,
|
width: 150,
|
||||||
align: 'left',
|
align: 'center',
|
||||||
slot: 'firstColumn',
|
fixed: 'left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('转账名称'),
|
title: t('转账名称'),
|
||||||
dataIndex: 'transferName',
|
dataIndex: 'transferName',
|
||||||
key: 'a.transfer_name',
|
key: 'a.transfer_name',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 130,
|
width: 200,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
slot: 'bizScopeKey',
|
slot: 'bizScopeKey',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('转出账号'),
|
title: t('转出账号'),
|
||||||
dataIndex: 'outAccountId',
|
dataIndex: 'accountOutName',
|
||||||
key: 'a.out_account_id',
|
key: 'b.account_name',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 130,
|
width: 130,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('转入账号'),
|
title: t('转入账号'),
|
||||||
dataIndex: 'inAccountId',
|
dataIndex: 'accountInName',
|
||||||
key: 'a.in_account_id',
|
key: 'c.account_name',
|
||||||
|
sorter: true,
|
||||||
|
width: 130,
|
||||||
|
align: 'left',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('父级分类'),
|
||||||
|
dataIndex: 'parentName',
|
||||||
|
key: 'd.parent_name',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 130,
|
width: 130,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('转账分类'),
|
title: t('转账分类'),
|
||||||
dataIndex: 'categoryId',
|
dataIndex: 'categoryName',
|
||||||
key: 'a.category_id',
|
key: 'd.category_name',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 130,
|
width: 130,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
@@ -162,6 +185,7 @@
|
|||||||
sorter: true,
|
sorter: true,
|
||||||
width: 130,
|
width: 130,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
dictType: 'transfer_status',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('转账备注'),
|
title: t('转账备注'),
|
||||||
@@ -175,6 +199,7 @@
|
|||||||
|
|
||||||
const actionColumn: BasicColumn<ErpAccountTransfer> = {
|
const actionColumn: BasicColumn<ErpAccountTransfer> = {
|
||||||
width: 160,
|
width: 160,
|
||||||
|
align: 'center',
|
||||||
actions: (record: ErpAccountTransfer) => [
|
actions: (record: ErpAccountTransfer) => [
|
||||||
{
|
{
|
||||||
icon: 'i-clarity:note-edit-line',
|
icon: 'i-clarity:note-edit-line',
|
||||||
@@ -214,10 +239,10 @@
|
|||||||
await getForm().setFieldsValue(record.value);
|
await getForm().setFieldsValue(record.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
const [registerModal, { openModal }] = useModal();
|
||||||
|
|
||||||
function handleForm(record: Recordable) {
|
function handleForm(record: Recordable) {
|
||||||
openDrawer(true, record);
|
openModal(true, record);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleExport() {
|
async function handleExport() {
|
||||||
|
|||||||
@@ -4,20 +4,20 @@
|
|||||||
* @author gaoxq
|
* @author gaoxq
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<BasicDrawer
|
<BasicModal
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
:showFooter="true"
|
:showFooter="true"
|
||||||
:okAuth="'erp:expense:edit'"
|
:okAuth="'erp:expense:edit'"
|
||||||
@register="registerDrawer"
|
@register="registerModal"
|
||||||
@ok="handleSubmit"
|
@ok="handleSubmit"
|
||||||
width="70%"
|
width="60%"
|
||||||
>
|
>
|
||||||
<template #title>
|
<template #title>
|
||||||
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
|
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
|
||||||
<span> {{ getTitle.value }} </span>
|
<span> {{ getTitle.value }} </span>
|
||||||
</template>
|
</template>
|
||||||
<BasicForm @register="registerForm" />
|
<BasicForm @register="registerForm" />
|
||||||
</BasicDrawer>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup name="ViewsErpExpenseForm">
|
<script lang="ts" setup name="ViewsErpExpenseForm">
|
||||||
import { ref, unref, computed } from 'vue';
|
import { ref, unref, computed } from 'vue';
|
||||||
@@ -26,7 +26,8 @@
|
|||||||
import { router } from '@jeesite/core/router';
|
import { router } from '@jeesite/core/router';
|
||||||
import { Icon } from '@jeesite/core/components/Icon';
|
import { Icon } from '@jeesite/core/components/Icon';
|
||||||
import { BasicForm, FormSchema, useForm } from '@jeesite/core/components/Form';
|
import { BasicForm, FormSchema, useForm } from '@jeesite/core/components/Form';
|
||||||
import { BasicDrawer, useDrawerInner } from '@jeesite/core/components/Drawer';
|
import { BasicModal, useModalInner } from '@jeesite/core/components/Modal';
|
||||||
|
import { ErpCategory, erpCategoryListAll } from '@jeesite/erp/api/erp/category';
|
||||||
import { ErpExpense, erpExpenseSave, erpExpenseForm } from '@jeesite/erp/api/erp/expense';
|
import { ErpExpense, erpExpenseSave, erpExpenseForm } from '@jeesite/erp/api/erp/expense';
|
||||||
import { formatToDateTime } from '@jeesite/core/utils/dateUtil';
|
import { formatToDateTime } from '@jeesite/core/utils/dateUtil';
|
||||||
|
|
||||||
@@ -61,27 +62,32 @@
|
|||||||
{
|
{
|
||||||
label: t('支出账户'),
|
label: t('支出账户'),
|
||||||
field: 'accountId',
|
field: 'accountId',
|
||||||
component: 'Input',
|
fieldLabel: 'accountName',
|
||||||
|
component: 'ListSelect',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
maxlength: 52,
|
selectType: 'erpAccountSelect',
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('支出分类'),
|
label: t('支出分类'),
|
||||||
field: 'categoryId',
|
field: 'categoryId',
|
||||||
component: 'Input',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
maxlength: 52,
|
api: erpCategoryListAll,
|
||||||
|
params: {
|
||||||
|
categoryType: '1'
|
||||||
|
},
|
||||||
|
fieldNames: { label: 'categoryName', value: 'categoryId' },
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('交易金额'),
|
label: t('交易金额'),
|
||||||
field: 'amount',
|
field: 'amount',
|
||||||
component: 'Input',
|
component: 'InputNumber',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
maxlength: 10,
|
maxlength: 20,
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
@@ -93,20 +99,20 @@
|
|||||||
baseColProps: { md: 24, lg: 12 },
|
baseColProps: { md: 24, lg: 12 },
|
||||||
});
|
});
|
||||||
|
|
||||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||||
setDrawerProps({ loading: true });
|
setModalProps({ loading: true });
|
||||||
await resetFields();
|
await resetFields();
|
||||||
const res = await erpExpenseForm(data);
|
const res = await erpExpenseForm(data);
|
||||||
record.value = (res.erpExpense || {}) as ErpExpense;
|
record.value = (res.erpExpense || {}) as ErpExpense;
|
||||||
record.value.__t = new Date().getTime();
|
record.value.__t = new Date().getTime();
|
||||||
await setFieldsValue(record.value);
|
await setFieldsValue(record.value);
|
||||||
setDrawerProps({ loading: false });
|
setModalProps({ loading: false });
|
||||||
});
|
});
|
||||||
|
|
||||||
async function handleSubmit() {
|
async function handleSubmit() {
|
||||||
try {
|
try {
|
||||||
const data = await validate();
|
const data = await validate();
|
||||||
setDrawerProps({ confirmLoading: true });
|
setModalProps({ confirmLoading: true });
|
||||||
const params: any = {
|
const params: any = {
|
||||||
isNewRecord: record.value.isNewRecord,
|
isNewRecord: record.value.isNewRecord,
|
||||||
expenseId: record.value.expenseId || data.expenseId,
|
expenseId: record.value.expenseId || data.expenseId,
|
||||||
@@ -117,7 +123,7 @@
|
|||||||
// console.log('submit', params, data, record);
|
// console.log('submit', params, data, record);
|
||||||
const res = await erpExpenseSave(params, data);
|
const res = await erpExpenseSave(params, data);
|
||||||
showMessage(res.message);
|
showMessage(res.message);
|
||||||
setTimeout(closeDrawer);
|
setTimeout(closeModal);
|
||||||
emit('success', data);
|
emit('success', data);
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
if (error && error.errorFields) {
|
if (error && error.errorFields) {
|
||||||
@@ -125,7 +131,7 @@
|
|||||||
}
|
}
|
||||||
console.log('error', error);
|
console.log('error', error);
|
||||||
} finally {
|
} finally {
|
||||||
setDrawerProps({ confirmLoading: false });
|
setModalProps({ confirmLoading: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<InputForm @register="registerDrawer" @success="handleSuccess" />
|
<InputForm @register="registerModal" @success="handleSuccess" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup name="ViewsErpExpenseList">
|
<script lang="ts" setup name="ViewsErpExpenseList">
|
||||||
@@ -37,8 +37,8 @@
|
|||||||
import { Icon } from '@jeesite/core/components/Icon';
|
import { Icon } from '@jeesite/core/components/Icon';
|
||||||
import { BasicTable, BasicColumn, useTable } from '@jeesite/core/components/Table';
|
import { BasicTable, BasicColumn, useTable } from '@jeesite/core/components/Table';
|
||||||
import { ErpExpense, erpExpenseList } from '@jeesite/erp/api/erp/expense';
|
import { ErpExpense, erpExpenseList } from '@jeesite/erp/api/erp/expense';
|
||||||
|
import { ErpCategory, erpCategoryListAll } from '@jeesite/erp/api/erp/category';
|
||||||
import { erpExpenseDelete, erpExpenseListData } from '@jeesite/erp/api/erp/expense';
|
import { erpExpenseDelete, erpExpenseListData } from '@jeesite/erp/api/erp/expense';
|
||||||
import { useDrawer } from '@jeesite/core/components/Drawer';
|
|
||||||
import { useModal } from '@jeesite/core/components/Modal';
|
import { useModal } from '@jeesite/core/components/Modal';
|
||||||
import { FormProps } from '@jeesite/core/components/Form';
|
import { FormProps } from '@jeesite/core/components/Form';
|
||||||
import InputForm from './form.vue';
|
import InputForm from './form.vue';
|
||||||
@@ -66,12 +66,23 @@
|
|||||||
{
|
{
|
||||||
label: t('支出账户'),
|
label: t('支出账户'),
|
||||||
field: 'accountId',
|
field: 'accountId',
|
||||||
component: 'Input',
|
fieldLabel: 'accountName',
|
||||||
|
component: 'ListSelect',
|
||||||
|
componentProps: {
|
||||||
|
selectType: 'erpAccountSelect',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('支出分类'),
|
label: t('支出分类'),
|
||||||
field: 'categoryId',
|
field: 'categoryId',
|
||||||
component: 'Input',
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
api: erpCategoryListAll,
|
||||||
|
params: {
|
||||||
|
categoryType: '1'
|
||||||
|
},
|
||||||
|
fieldNames: { label: 'categoryName', value: 'categoryId' },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
@@ -82,31 +93,39 @@
|
|||||||
dataIndex: 'createTime',
|
dataIndex: 'createTime',
|
||||||
key: 'a.create_time',
|
key: 'a.create_time',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 230,
|
width: 150,
|
||||||
align: 'left',
|
align: 'center',
|
||||||
slot: 'firstColumn',
|
fixed: 'left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('支出名称'),
|
title: t('支出名称'),
|
||||||
dataIndex: 'expenseName',
|
dataIndex: 'expenseName',
|
||||||
key: 'a.expense_name',
|
key: 'a.expense_name',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 130,
|
width: 200,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
slot: 'bizScopeKey',
|
slot: 'bizScopeKey',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('支出账户'),
|
title: t('支出账户'),
|
||||||
dataIndex: 'accountId',
|
dataIndex: 'accountName',
|
||||||
key: 'a.account_id',
|
key: 'b.account_name',
|
||||||
|
sorter: true,
|
||||||
|
width: 200,
|
||||||
|
align: 'left',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('父级分类'),
|
||||||
|
dataIndex: 'parentName',
|
||||||
|
key: 'c.parent_name',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 130,
|
width: 130,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('支出分类'),
|
title: t('支出分类'),
|
||||||
dataIndex: 'categoryId',
|
dataIndex: 'categoryName',
|
||||||
key: 'a.category_id',
|
key: 'c.category_name',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 130,
|
width: 130,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
@@ -124,13 +143,14 @@
|
|||||||
dataIndex: 'updateTime',
|
dataIndex: 'updateTime',
|
||||||
key: 'a.update_time',
|
key: 'a.update_time',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 130,
|
width: 150,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const actionColumn: BasicColumn<ErpExpense> = {
|
const actionColumn: BasicColumn<ErpExpense> = {
|
||||||
width: 160,
|
width: 160,
|
||||||
|
align: 'center',
|
||||||
actions: (record: ErpExpense) => [
|
actions: (record: ErpExpense) => [
|
||||||
{
|
{
|
||||||
icon: 'i-clarity:note-edit-line',
|
icon: 'i-clarity:note-edit-line',
|
||||||
@@ -170,10 +190,10 @@
|
|||||||
await getForm().setFieldsValue(record.value);
|
await getForm().setFieldsValue(record.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
const [registerModal, { openModal }] = useModal();
|
||||||
|
|
||||||
function handleForm(record: Recordable) {
|
function handleForm(record: Recordable) {
|
||||||
openDrawer(true, record);
|
openModal(true, record);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleExport() {
|
async function handleExport() {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
:okAuth="'erp:income:edit'"
|
:okAuth="'erp:income:edit'"
|
||||||
@register="registerModal"
|
@register="registerModal"
|
||||||
@ok="handleSubmit"
|
@ok="handleSubmit"
|
||||||
width="70%"
|
width="60%"
|
||||||
>
|
>
|
||||||
<template #title>
|
<template #title>
|
||||||
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
|
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
field: 'amount',
|
field: 'amount',
|
||||||
component: 'InputNumber',
|
component: 'InputNumber',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
maxlength: 10,
|
maxlength: 20,
|
||||||
},
|
},
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,167 +0,0 @@
|
|||||||
<!--
|
|
||||||
* Copyright (c) 2013-Now https://jeesite.com All rights reserved.
|
|
||||||
* No deletion without permission, or be held responsible to law.
|
|
||||||
* @author gaoxq
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<BasicDrawer
|
|
||||||
v-bind="$attrs"
|
|
||||||
:showFooter="true"
|
|
||||||
:okAuth="'erp:transactionFlow:edit'"
|
|
||||||
@register="registerDrawer"
|
|
||||||
@ok="handleSubmit"
|
|
||||||
width="70%"
|
|
||||||
>
|
|
||||||
<template #title>
|
|
||||||
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
|
|
||||||
<span> {{ getTitle.value }} </span>
|
|
||||||
</template>
|
|
||||||
<BasicForm @register="registerForm" />
|
|
||||||
</BasicDrawer>
|
|
||||||
</template>
|
|
||||||
<script lang="ts" setup name="ViewsErpTransactionFlowForm">
|
|
||||||
import { ref, unref, computed } from 'vue';
|
|
||||||
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
|
|
||||||
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
|
|
||||||
import { router } from '@jeesite/core/router';
|
|
||||||
import { Icon } from '@jeesite/core/components/Icon';
|
|
||||||
import { BasicForm, FormSchema, useForm } from '@jeesite/core/components/Form';
|
|
||||||
import { BasicDrawer, useDrawerInner } from '@jeesite/core/components/Drawer';
|
|
||||||
import { ErpTransactionFlow, erpTransactionFlowSave, erpTransactionFlowForm } from '@jeesite/erp/api/erp/transactionFlow';
|
|
||||||
import { formatToDateTime } from '@jeesite/core/utils/dateUtil';
|
|
||||||
|
|
||||||
const emit = defineEmits(['success', 'register']);
|
|
||||||
|
|
||||||
const { t } = useI18n('erp.transactionFlow');
|
|
||||||
const { showMessage } = useMessage();
|
|
||||||
const { meta } = unref(router.currentRoute);
|
|
||||||
const record = ref<ErpTransactionFlow>({} as ErpTransactionFlow);
|
|
||||||
|
|
||||||
const getTitle = computed(() => ({
|
|
||||||
icon: meta.icon || 'i-ant-design:book-outlined',
|
|
||||||
value: record.value.isNewRecord ? t('新增流水') : t('编辑流水'),
|
|
||||||
}));
|
|
||||||
|
|
||||||
const inputFormSchemas: FormSchema<ErpTransactionFlow>[] = [
|
|
||||||
{
|
|
||||||
label: t('基本信息'),
|
|
||||||
field: 'basicInfo',
|
|
||||||
component: 'FormGroup',
|
|
||||||
colProps: { md: 24, lg: 24 },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('交易名称'),
|
|
||||||
field: 'flowName',
|
|
||||||
component: 'Input',
|
|
||||||
componentProps: {
|
|
||||||
maxlength: 32,
|
|
||||||
},
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('交易类型'),
|
|
||||||
field: 'flowType',
|
|
||||||
component: 'Input',
|
|
||||||
componentProps: {
|
|
||||||
maxlength: 12,
|
|
||||||
},
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('交易金额'),
|
|
||||||
field: 'amount',
|
|
||||||
component: 'Input',
|
|
||||||
componentProps: {
|
|
||||||
maxlength: 18,
|
|
||||||
},
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('交易时间'),
|
|
||||||
field: 'tradeTime',
|
|
||||||
component: 'DatePicker',
|
|
||||||
componentProps: {
|
|
||||||
format: 'YYYY-MM-DD HH:mm',
|
|
||||||
showTime: { format: 'HH:mm' },
|
|
||||||
},
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('交易账户'),
|
|
||||||
field: 'accountId',
|
|
||||||
component: 'Input',
|
|
||||||
componentProps: {
|
|
||||||
maxlength: 52,
|
|
||||||
},
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('交易分类'),
|
|
||||||
field: 'categoryId',
|
|
||||||
component: 'Input',
|
|
||||||
componentProps: {
|
|
||||||
maxlength: 52,
|
|
||||||
},
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('交易备注'),
|
|
||||||
field: 'remark',
|
|
||||||
component: 'Input',
|
|
||||||
componentProps: {
|
|
||||||
maxlength: 500,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('业务标识'),
|
|
||||||
field: 'businessId',
|
|
||||||
component: 'Input',
|
|
||||||
componentProps: {
|
|
||||||
maxlength: 52,
|
|
||||||
},
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm<ErpTransactionFlow>({
|
|
||||||
labelWidth: 120,
|
|
||||||
schemas: inputFormSchemas,
|
|
||||||
baseColProps: { md: 24, lg: 12 },
|
|
||||||
});
|
|
||||||
|
|
||||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
|
||||||
setDrawerProps({ loading: true });
|
|
||||||
await resetFields();
|
|
||||||
const res = await erpTransactionFlowForm(data);
|
|
||||||
record.value = (res.erpTransactionFlow || {}) as ErpTransactionFlow;
|
|
||||||
record.value.__t = new Date().getTime();
|
|
||||||
await setFieldsValue(record.value);
|
|
||||||
setDrawerProps({ loading: false });
|
|
||||||
});
|
|
||||||
|
|
||||||
async function handleSubmit() {
|
|
||||||
try {
|
|
||||||
const data = await validate();
|
|
||||||
setDrawerProps({ confirmLoading: true });
|
|
||||||
const params: any = {
|
|
||||||
isNewRecord: record.value.isNewRecord,
|
|
||||||
flowId: record.value.flowId || data.flowId,
|
|
||||||
};
|
|
||||||
|
|
||||||
data[record.value.isNewRecord ? 'createTime' : 'updateTime'] = formatToDateTime(new Date());
|
|
||||||
|
|
||||||
// console.log('submit', params, data, record);
|
|
||||||
const res = await erpTransactionFlowSave(params, data);
|
|
||||||
showMessage(res.message);
|
|
||||||
setTimeout(closeDrawer);
|
|
||||||
emit('success', data);
|
|
||||||
} catch (error: any) {
|
|
||||||
if (error && error.errorFields) {
|
|
||||||
showMessage(error.message || t('common.validateError'));
|
|
||||||
}
|
|
||||||
console.log('error', error);
|
|
||||||
} finally {
|
|
||||||
setDrawerProps({ confirmLoading: false });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -14,17 +14,8 @@
|
|||||||
<a-button type="default" :loading="loading" @click="handleExport()">
|
<a-button type="default" :loading="loading" @click="handleExport()">
|
||||||
<Icon icon="i-ant-design:download-outlined" /> {{ t('导出') }}
|
<Icon icon="i-ant-design:download-outlined" /> {{ t('导出') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button type="primary" @click="handleForm({})" v-auth="'erp:transactionFlow:edit'">
|
|
||||||
<Icon icon="i-fluent:add-12-filled" /> {{ t('新增') }}
|
|
||||||
</a-button>
|
|
||||||
</template>
|
|
||||||
<template #bizScopeKey="{ record, text, value }">
|
|
||||||
<a @click="handleForm({ flowId: record.flowId })" :title="value">
|
|
||||||
{{ text }}
|
|
||||||
</a>
|
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<InputForm @register="registerDrawer" @success="handleSuccess" />
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup name="ViewsErpTransactionFlowList">
|
<script lang="ts" setup name="ViewsErpTransactionFlowList">
|
||||||
@@ -36,18 +27,19 @@
|
|||||||
import { router } from '@jeesite/core/router';
|
import { router } from '@jeesite/core/router';
|
||||||
import { Icon } from '@jeesite/core/components/Icon';
|
import { Icon } from '@jeesite/core/components/Icon';
|
||||||
import { BasicTable, BasicColumn, useTable } from '@jeesite/core/components/Table';
|
import { BasicTable, BasicColumn, useTable } from '@jeesite/core/components/Table';
|
||||||
|
import { ErpCategory, erpCategoryListAll } from '@jeesite/erp/api/erp/category';
|
||||||
import { ErpTransactionFlow, erpTransactionFlowList } from '@jeesite/erp/api/erp/transactionFlow';
|
import { ErpTransactionFlow, erpTransactionFlowList } from '@jeesite/erp/api/erp/transactionFlow';
|
||||||
import { erpTransactionFlowDelete, erpTransactionFlowListData } from '@jeesite/erp/api/erp/transactionFlow';
|
import { erpTransactionFlowDelete, erpTransactionFlowListData } from '@jeesite/erp/api/erp/transactionFlow';
|
||||||
import { useDrawer } from '@jeesite/core/components/Drawer';
|
|
||||||
import { useModal } from '@jeesite/core/components/Modal';
|
import { useModal } from '@jeesite/core/components/Modal';
|
||||||
import { FormProps } from '@jeesite/core/components/Form';
|
import { FormProps } from '@jeesite/core/components/Form';
|
||||||
import InputForm from './form.vue';
|
|
||||||
|
|
||||||
const { t } = useI18n('erp.transactionFlow');
|
const { t } = useI18n('erp.transactionFlow');
|
||||||
const { showMessage } = useMessage();
|
const { showMessage } = useMessage();
|
||||||
const { meta } = unref(router.currentRoute);
|
const { meta } = unref(router.currentRoute);
|
||||||
const record = ref<ErpTransactionFlow>({} as ErpTransactionFlow);
|
const record = ref<ErpTransactionFlow>({} as ErpTransactionFlow);
|
||||||
|
|
||||||
|
const categoryParams = ref<Recordable>({ categoryType: '' });
|
||||||
|
|
||||||
const getTitle = {
|
const getTitle = {
|
||||||
icon: meta.icon || 'i-ant-design:book-outlined',
|
icon: meta.icon || 'i-ant-design:book-outlined',
|
||||||
value: meta.title || t('流水管理'),
|
value: meta.title || t('流水管理'),
|
||||||
@@ -81,24 +73,40 @@
|
|||||||
field: 'flowName',
|
field: 'flowName',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: t('交易类型'),
|
|
||||||
field: 'flowType',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: t('交易账户'),
|
label: t('交易账户'),
|
||||||
field: 'accountId',
|
field: 'accountId',
|
||||||
component: 'Input',
|
fieldLabel: 'accountName',
|
||||||
|
component: 'ListSelect',
|
||||||
|
componentProps: {
|
||||||
|
selectType: 'erpAccountSelect',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('交易类型'),
|
||||||
|
field: 'flowType',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
dictType: 'erp_type',
|
||||||
|
allowClear: true,
|
||||||
|
onChange: (value: string) => {
|
||||||
|
categoryParams.value.categoryType = value;
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('交易分类'),
|
label: t('交易分类'),
|
||||||
field: 'categoryId',
|
field: 'categoryId',
|
||||||
component: 'Input',
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
api: erpCategoryListAll,
|
||||||
|
params: categoryParams.value,
|
||||||
|
fieldNames: { label: 'categoryName', value: 'categoryId' },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('业务标识'),
|
label: t('交易备注'),
|
||||||
field: 'businessId',
|
field: 'remark',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -111,16 +119,16 @@
|
|||||||
key: 'a.create_time',
|
key: 'a.create_time',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 150,
|
width: 150,
|
||||||
align: 'left',
|
align: 'center',
|
||||||
|
fixed: 'left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('交易名称'),
|
title: t('交易名称'),
|
||||||
dataIndex: 'flowName',
|
dataIndex: 'flowName',
|
||||||
key: 'a.flow_name',
|
key: 'a.flow_name',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 130,
|
width: 200,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
slot: 'bizScopeKey',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('交易类型'),
|
title: t('交易类型'),
|
||||||
@@ -129,6 +137,7 @@
|
|||||||
sorter: true,
|
sorter: true,
|
||||||
width: 130,
|
width: 130,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
dictType: 'erp_type',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('交易金额'),
|
title: t('交易金额'),
|
||||||
@@ -143,21 +152,29 @@
|
|||||||
dataIndex: 'tradeTime',
|
dataIndex: 'tradeTime',
|
||||||
key: 'a.trade_time',
|
key: 'a.trade_time',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 130,
|
width: 150,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('交易账户'),
|
title: t('交易账户'),
|
||||||
dataIndex: 'accountId',
|
dataIndex: 'accountName',
|
||||||
key: 'a.account_id',
|
key: 'b.account_name',
|
||||||
|
sorter: true,
|
||||||
|
width: 200,
|
||||||
|
align: 'left',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('父级分类'),
|
||||||
|
dataIndex: 'parentName',
|
||||||
|
key: 'c.parent_name',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 130,
|
width: 130,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('交易分类'),
|
title: t('交易分类'),
|
||||||
dataIndex: 'categoryId',
|
dataIndex: 'categoryName',
|
||||||
key: 'a.category_id',
|
key: 'c.category_name',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 130,
|
width: 130,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
@@ -167,7 +184,7 @@
|
|||||||
dataIndex: 'remark',
|
dataIndex: 'remark',
|
||||||
key: 'a.remark',
|
key: 'a.remark',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 130,
|
width: 200,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -175,48 +192,18 @@
|
|||||||
dataIndex: 'updateTime',
|
dataIndex: 'updateTime',
|
||||||
key: 'a.update_time',
|
key: 'a.update_time',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 130,
|
width: 150,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
fixed: 'right',
|
||||||
{
|
|
||||||
title: t('业务标识'),
|
|
||||||
dataIndex: 'businessId',
|
|
||||||
key: 'a.business_id',
|
|
||||||
sorter: true,
|
|
||||||
width: 130,
|
|
||||||
align: 'left',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const actionColumn: BasicColumn<ErpTransactionFlow> = {
|
|
||||||
width: 160,
|
|
||||||
actions: (record: ErpTransactionFlow) => [
|
|
||||||
{
|
|
||||||
icon: 'i-clarity:note-edit-line',
|
|
||||||
title: t('编辑'),
|
|
||||||
onClick: handleForm.bind(this, { flowId: record.flowId }),
|
|
||||||
auth: 'erp:transactionFlow:edit',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'i-ant-design:delete-outlined',
|
|
||||||
color: 'error',
|
|
||||||
title: t('删除'),
|
|
||||||
popConfirm: {
|
|
||||||
title: t('是否确认删除流水?'),
|
|
||||||
confirm: handleDelete.bind(this, record),
|
|
||||||
},
|
|
||||||
auth: 'erp:transactionFlow:edit',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
const [registerTable, { reload, getForm }] = useTable<ErpTransactionFlow>({
|
const [registerTable, { reload, getForm }] = useTable<ErpTransactionFlow>({
|
||||||
api: erpTransactionFlowListData,
|
api: erpTransactionFlowListData,
|
||||||
beforeFetch: (params) => {
|
beforeFetch: (params) => {
|
||||||
return params;
|
return params;
|
||||||
},
|
},
|
||||||
columns: tableColumns,
|
columns: tableColumns,
|
||||||
actionColumn: actionColumn,
|
|
||||||
formConfig: searchForm,
|
formConfig: searchForm,
|
||||||
showTableSetting: true,
|
showTableSetting: true,
|
||||||
useSearchForm: true,
|
useSearchForm: true,
|
||||||
@@ -229,12 +216,6 @@
|
|||||||
await getForm().setFieldsValue(record.value);
|
await getForm().setFieldsValue(record.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
|
||||||
|
|
||||||
function handleForm(record: Recordable) {
|
|
||||||
openDrawer(true, record);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleExport() {
|
async function handleExport() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const { ctxAdminPath } = useGlobSetting();
|
const { ctxAdminPath } = useGlobSetting();
|
||||||
@@ -245,13 +226,6 @@
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleDelete(record: Recordable) {
|
|
||||||
const params = { flowId: record.flowId };
|
|
||||||
const res = await erpTransactionFlowDelete(params);
|
|
||||||
showMessage(res.message);
|
|
||||||
await handleSuccess(record);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleSuccess(record: Recordable) {
|
async function handleSuccess(record: Recordable) {
|
||||||
await reload({ record });
|
await reload({ record });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,162 +0,0 @@
|
|||||||
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
|
|
||||||
import { BasicColumn, BasicTableProps, FormProps } from '@jeesite/core/components/Table';
|
|
||||||
import { erpTransactionFlowListData } from '@jeesite/erp/api/erp/transactionFlow';
|
|
||||||
|
|
||||||
const { t } = useI18n('erp.transactionFlow');
|
|
||||||
|
|
||||||
const modalProps = {
|
|
||||||
title: t('流水选择'),
|
|
||||||
};
|
|
||||||
|
|
||||||
const searchForm: FormProps<ErpTransactionFlow> = {
|
|
||||||
baseColProps: { md: 8, lg: 6 },
|
|
||||||
labelWidth: 90,
|
|
||||||
schemas: [
|
|
||||||
{
|
|
||||||
label: t('记录时间起'),
|
|
||||||
field: 'createTime_gte',
|
|
||||||
component: 'DatePicker',
|
|
||||||
componentProps: {
|
|
||||||
format: 'YYYY-MM-DD HH:mm',
|
|
||||||
showTime: { format: 'HH:mm' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('记录时间止'),
|
|
||||||
field: 'createTime_lte',
|
|
||||||
component: 'DatePicker',
|
|
||||||
componentProps: {
|
|
||||||
format: 'YYYY-MM-DD HH:mm',
|
|
||||||
showTime: { format: 'HH:mm' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('交易名称'),
|
|
||||||
field: 'flowName',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('交易类型'),
|
|
||||||
field: 'flowType',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('交易账户'),
|
|
||||||
field: 'accountId',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('交易分类'),
|
|
||||||
field: 'categoryId',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('业务标识'),
|
|
||||||
field: 'businessId',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
const tableColumns: BasicColumn<ErpTransactionFlow>[] = [
|
|
||||||
{
|
|
||||||
title: t('记录时间'),
|
|
||||||
dataIndex: 'createTime',
|
|
||||||
key: 'a.create_time',
|
|
||||||
sorter: true,
|
|
||||||
width: 230,
|
|
||||||
align: 'left',
|
|
||||||
slot: 'firstColumn',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t('交易名称'),
|
|
||||||
dataIndex: 'flowName',
|
|
||||||
key: 'a.flow_name',
|
|
||||||
sorter: true,
|
|
||||||
width: 130,
|
|
||||||
align: 'left',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t('交易类型'),
|
|
||||||
dataIndex: 'flowType',
|
|
||||||
key: 'a.flow_type',
|
|
||||||
sorter: true,
|
|
||||||
width: 130,
|
|
||||||
align: 'left',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t('交易金额'),
|
|
||||||
dataIndex: 'amount',
|
|
||||||
key: 'a.amount',
|
|
||||||
sorter: true,
|
|
||||||
width: 130,
|
|
||||||
align: 'right',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t('交易时间'),
|
|
||||||
dataIndex: 'tradeTime',
|
|
||||||
key: 'a.trade_time',
|
|
||||||
sorter: true,
|
|
||||||
width: 130,
|
|
||||||
align: 'center',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t('交易账户'),
|
|
||||||
dataIndex: 'accountId',
|
|
||||||
key: 'a.account_id',
|
|
||||||
sorter: true,
|
|
||||||
width: 130,
|
|
||||||
align: 'left',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t('交易分类'),
|
|
||||||
dataIndex: 'categoryId',
|
|
||||||
key: 'a.category_id',
|
|
||||||
sorter: true,
|
|
||||||
width: 130,
|
|
||||||
align: 'left',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t('交易备注'),
|
|
||||||
dataIndex: 'remark',
|
|
||||||
key: 'a.remark',
|
|
||||||
sorter: true,
|
|
||||||
width: 130,
|
|
||||||
align: 'left',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t('更新时间'),
|
|
||||||
dataIndex: 'updateTime',
|
|
||||||
key: 'a.update_time',
|
|
||||||
sorter: true,
|
|
||||||
width: 130,
|
|
||||||
align: 'center',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t('业务标识'),
|
|
||||||
dataIndex: 'businessId',
|
|
||||||
key: 'a.business_id',
|
|
||||||
sorter: true,
|
|
||||||
width: 130,
|
|
||||||
align: 'left',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const tableProps: BasicTableProps = {
|
|
||||||
api: erpTransactionFlowListData,
|
|
||||||
beforeFetch: (params) => {
|
|
||||||
params['isAll'] = true;
|
|
||||||
return params;
|
|
||||||
},
|
|
||||||
columns: tableColumns,
|
|
||||||
formConfig: searchForm,
|
|
||||||
rowKey: 'flowId',
|
|
||||||
};
|
|
||||||
|
|
||||||
export default {
|
|
||||||
modalProps,
|
|
||||||
tableProps,
|
|
||||||
itemCode: 'flowId',
|
|
||||||
itemName: 'flowId',
|
|
||||||
isShowCode: false,
|
|
||||||
};
|
|
||||||
Reference in New Issue
Block a user