feat: 公款管理
This commit is contained in:
parent
930f48bfa3
commit
89936bd954
@ -3,12 +3,14 @@ import login from './login'
|
||||
import commodity from './commodity'
|
||||
import resource from './resource'
|
||||
import order from './order'
|
||||
import inner from './inner'
|
||||
|
||||
const totalApiConfig = {
|
||||
login,
|
||||
commodity,
|
||||
resource,
|
||||
order
|
||||
order,
|
||||
inner
|
||||
}
|
||||
|
||||
Object.values(totalApiConfig).forEach((apiConfig) => {
|
||||
|
||||
11
src/api/inner.ts
Normal file
11
src/api/inner.ts
Normal file
@ -0,0 +1,11 @@
|
||||
const publicMoney = {
|
||||
/**
|
||||
* 公款管理
|
||||
*/
|
||||
getPublicMoneyList: ['/my/settlement/list'], // 获取公款列表
|
||||
addPublicMoney: ['/my/settlement/add'], // 添加公款
|
||||
approvalPublicMoney: ['/my/settlement/approval'], // 审批公款
|
||||
updatePublicMoney: ['/my/settlement/update'] // 更新公款
|
||||
}
|
||||
|
||||
export default publicMoney
|
||||
@ -5,8 +5,9 @@ const order = {
|
||||
getOrderList: ['/order/list'], // 获取订单管理
|
||||
getOrderDetail: ['/order/detail'], // 获取订单详情
|
||||
packOrder: ['/order/toShipping'], // 打包
|
||||
unpackOrder: ['/order/unpack'], // 取消打包
|
||||
finishDeliver: ['/order/delivered'], // 妥投
|
||||
unpackOrder: ['/order/unShipping'], // 取消发货
|
||||
finishDeliver: ['/order/shipped'], // 签收
|
||||
cancelOrder: ['/order/cancel'], // 取消订单
|
||||
getLogisticsInfo: ['/logistics/query'], // 获取物流信息
|
||||
|
||||
/**
|
||||
@ -21,7 +22,13 @@ const order = {
|
||||
*/
|
||||
getSellerList: ['/seller/list'], // 卖家列表
|
||||
updateSeller: ['/seller/insertOrUpdate'], // 添加卖家
|
||||
updateAddress: ['/warehouse/insertOrUpdate'] // 添加仓库
|
||||
updateAddress: ['/warehouse/insertOrUpdate'], // 添加仓库
|
||||
|
||||
/**
|
||||
* 逆向管理
|
||||
*/
|
||||
getReverseList: ['/reverse/list'], // 获取逆向列表
|
||||
approvalReverse: ['/reverse/approve'] // 审批逆向
|
||||
}
|
||||
|
||||
export default order
|
||||
|
||||
@ -489,14 +489,13 @@ export default [
|
||||
childList: []
|
||||
}
|
||||
]
|
||||
}
|
||||
/*
|
||||
},
|
||||
{
|
||||
id: 110,
|
||||
resourceName: '产品管理',
|
||||
resourceName: '内部管理',
|
||||
resourceType: 0,
|
||||
resourceCode: null,
|
||||
path: '/product',
|
||||
path: '/inner',
|
||||
pid: 0,
|
||||
resourceDesc: null,
|
||||
tenantId: 2,
|
||||
@ -510,10 +509,10 @@ export default [
|
||||
childList: [
|
||||
{
|
||||
id: 111,
|
||||
resourceName: '产品管理',
|
||||
resourceName: '公款',
|
||||
resourceType: 1,
|
||||
resourceCode: null,
|
||||
path: '/product/production/index',
|
||||
path: '/inner/public-money/index',
|
||||
pid: 110,
|
||||
resourceDesc: null,
|
||||
tenantId: 2,
|
||||
@ -525,8 +524,10 @@ export default [
|
||||
modifyTime: '2025-05-12 14:37:00',
|
||||
tag: null,
|
||||
childList: []
|
||||
},
|
||||
{
|
||||
}
|
||||
]
|
||||
}
|
||||
/* {
|
||||
id: 112,
|
||||
resourceName: '进件计划',
|
||||
resourceType: 1,
|
||||
|
||||
@ -55,14 +55,20 @@ export const getTableData = (
|
||||
.$api(params)
|
||||
.then((res) => {
|
||||
const result = res as {
|
||||
data: { rows: []; totalPage: number }
|
||||
data: { rows: []; totalPage: number; pageUtils?: any; vvMyAccountEntity?: any }
|
||||
code: string
|
||||
resultMsg: string
|
||||
totalPage: number
|
||||
}
|
||||
table.$loading = false
|
||||
table.$data = result.data.rows
|
||||
table.$pages.total = result.data.totalPage
|
||||
if (result.data.pageUtils) {
|
||||
table.$data = result.data.pageUtils.rows
|
||||
table.$pages.total = result.data.pageUtils.total
|
||||
return result.data
|
||||
} else {
|
||||
table.$data = result.data.rows
|
||||
table.$pages.total = result.data.totalPage
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
table.$loading = false
|
||||
|
||||
68
src/views/inner/public-money/config.ts
Normal file
68
src/views/inner/public-money/config.ts
Normal file
@ -0,0 +1,68 @@
|
||||
export const statusOptions = [
|
||||
{ label: '同意', value: 'agree_approval' },
|
||||
{ label: '驳回', value: 'reject_approval' }
|
||||
]
|
||||
|
||||
const configData = ref()
|
||||
export const initConfig = () => {
|
||||
configData.value = pageConfig({
|
||||
search: {
|
||||
applyReason: { label: '申请原因' },
|
||||
status: { label: '状态', el: 'select', options: statusOptions }
|
||||
},
|
||||
table: [
|
||||
{
|
||||
// index: { label: '序号' },
|
||||
applyReason: { label: '申请原因' },
|
||||
amount: { label: '金额', formatter: (row: any) => row.operate + row.amount },
|
||||
applyUserName: { label: '申请人' },
|
||||
approvalUserName: { label: '审批人' },
|
||||
createTime: {
|
||||
label: '创建时间',
|
||||
formatter: (row: any) => new Date(row.createTime).toLocaleString(),
|
||||
width: 160
|
||||
},
|
||||
status: { label: '状态', slot: 'status' },
|
||||
rejectReason: { label: '驳回原因', 'show-overflow-tooltip': true, width: 160 },
|
||||
btn: {
|
||||
types: ['success', 'warning', 'danger'],
|
||||
names: ['通过', '驳回', '删除'],
|
||||
disableds: [
|
||||
(row: any) => row.status !== 'apply_for_approval',
|
||||
(row: any) => row.status !== 'apply_for_approval',
|
||||
(row: any) => row.status !== 'apply_for_approval'
|
||||
],
|
||||
width: 160
|
||||
}
|
||||
},
|
||||
{
|
||||
// index: { label: '序号' },
|
||||
applyReason: { label: '备注' },
|
||||
amount: { label: '金额', formatter: (row: any) => row.operate + row.amount },
|
||||
createTime: {
|
||||
label: '创建时间',
|
||||
formatter: (row: any) => new Date(row.createTime).toLocaleString(),
|
||||
width: 160
|
||||
}
|
||||
}
|
||||
],
|
||||
dialog: [
|
||||
{
|
||||
operate: {
|
||||
label: '类型',
|
||||
el: 'select',
|
||||
options: [
|
||||
{ label: '充值', value: '+' },
|
||||
{ label: '报销', value: '-' }
|
||||
]
|
||||
},
|
||||
amount: { label: '金额' },
|
||||
applyReason: { label: '申请原因' }
|
||||
},
|
||||
{
|
||||
rejectReason: { label: '驳回原因', rule: true }
|
||||
}
|
||||
]
|
||||
})
|
||||
return configData
|
||||
}
|
||||
134
src/views/inner/public-money/index.vue
Normal file
134
src/views/inner/public-money/index.vue
Normal file
@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<div id="public-money-page">
|
||||
<el-descriptions title="公款明细" class="mb-3 bg-white">
|
||||
<el-descriptions-item label="账户余额">{{ accountData.amount }}元</el-descriptions-item>
|
||||
<el-descriptions-item label="充值金额"
|
||||
>{{ accountData.rechargeAmount }}元</el-descriptions-item
|
||||
>
|
||||
<el-descriptions-item label="报销金额">{{ accountData.subAmount }}元</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-tabs v-model="activeTab" class="px-3 bg-white" @click="onTabChange">
|
||||
<el-tab-pane label="公款明细" name="1" />
|
||||
<el-tab-pane label="资金流水" name="2" />
|
||||
</el-tabs>
|
||||
<template v-if="activeTab === '1'">
|
||||
<search-module :search="search" :table="table1" @search="(val: any) => onTabChange('1', val)">
|
||||
<template #btn>
|
||||
<el-button type="primary" @click="onAdd">新增公款</el-button>
|
||||
</template>
|
||||
</search-module>
|
||||
<table-module :table="table1">
|
||||
<template #status="{ row }">
|
||||
<el-icon v-if="row.status === 'agree_approval'" :size="20" color="#67c23a">
|
||||
<Check />
|
||||
</el-icon>
|
||||
<el-icon v-else-if="row.status === 'reject_approval'" :size="20" color="#f56c6c">
|
||||
<Close />
|
||||
</el-icon>
|
||||
<span v-else></span>
|
||||
</template>
|
||||
</table-module>
|
||||
</template>
|
||||
<template v-else>
|
||||
<table-module :table="table2" />
|
||||
</template>
|
||||
<dialog-module :dialog="$dialog"> </dialog-module>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { Check, Close } from '@element-plus/icons-vue'
|
||||
import { initConfig } from './config'
|
||||
|
||||
/** 新增公款 */
|
||||
const onAdd = async (row: any) => {
|
||||
const dialog = $dialog.value
|
||||
dialog.config = dialog1.value
|
||||
dialog.title = '新增公款'
|
||||
dialog.show = true
|
||||
dialog.submit = async (value: any) => {
|
||||
await api.inner.addPublicMoney.post!({ ...value })
|
||||
dialog.show = false
|
||||
onTabChange('1', search.value.$data)
|
||||
}
|
||||
}
|
||||
|
||||
// 通过
|
||||
const onPass = (row: any) => {
|
||||
handleMessageBox({
|
||||
msg: `是否确定通过?`,
|
||||
success: api.inner.approvalPublicMoney.post!,
|
||||
data: { id: row.id, status: 'agree_approval' }
|
||||
}).then(() => {
|
||||
onTabChange('1', search.value.$data)
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
const onDelete = (row: any) => {
|
||||
handleMessageBox({
|
||||
msg: `是否确定删除?`,
|
||||
success: api.inner.updatePublicMoney.post!,
|
||||
data: { id: row.id, isDelete: 1 }
|
||||
}).then(() => {
|
||||
onTabChange('1', search.value.$data)
|
||||
})
|
||||
}
|
||||
|
||||
// 驳回
|
||||
const onReject = (row: any) => {
|
||||
const dialog = $dialog.value
|
||||
dialog.config = dialog2.value
|
||||
dialog.title = '驳回'
|
||||
dialog.show = true
|
||||
dialog.submit = async (value: any) => {
|
||||
await api.inner.approvalPublicMoney.post!({
|
||||
id: row.id,
|
||||
status: 'reject_approval',
|
||||
rejectReason: value.rejectReason
|
||||
})
|
||||
dialog.show = false
|
||||
onTabChange('1', search.value.$data)
|
||||
}
|
||||
}
|
||||
|
||||
const onTabChange = (tab: string, val?: any) => {
|
||||
if (tab === '1') {
|
||||
table1.value.$onGetData(table1.value, 1, val).then((res: any) => {
|
||||
table1.value.$data = res.pageUtils.rows.filter((item: any) => item.operate === '-')
|
||||
accountData.value = res.vvMyAccountEntity
|
||||
})
|
||||
} else {
|
||||
table2.value.$onGetData(table2.value, 1).then((res: any) => {
|
||||
table2.value.$data = res.pageUtils.rows.filter((item: any) => item.operate === '+')
|
||||
accountData.value = res.vvMyAccountEntity
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化页面 */
|
||||
const ConfigData = initConfig()
|
||||
const { search, table1, table2, $dialog, dialog1, dialog2 } = toRefs(ConfigData.value)
|
||||
table1.value.$pages.pageSizes = [20]
|
||||
table1.value.$api = api.inner.getPublicMoneyList.post
|
||||
table1.value.btn.clicks = [onPass, onReject, onDelete]
|
||||
table2.value.$pages.pageSizes = [20]
|
||||
table2.value.$api = api.inner.getPublicMoneyList.post
|
||||
|
||||
const accountData = ref({ rechargeAmount: 0, subAmount: 0, amount: 0 })
|
||||
const activeTab = ref('1')
|
||||
|
||||
onTabChange(activeTab.value)
|
||||
|
||||
/** 页面缓存 */
|
||||
defineOptions({ name: 'PublicMoney' })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
#public-money-page {
|
||||
:deep(.el-descriptions) {
|
||||
padding-top: 10px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -158,28 +158,24 @@
|
||||
:key="orderActionIndex"
|
||||
:class="[
|
||||
'goods-actions-item flex flex-col gap-2 justify-center items-center',
|
||||
orderActionIndex ? '!mt-2' : ''
|
||||
orderActionIndex ? '!ml-2' : ''
|
||||
]"
|
||||
>
|
||||
<el-button
|
||||
class="ml-0!"
|
||||
type="primary"
|
||||
:type="
|
||||
{
|
||||
'/mm/logistics/query': 'primary',
|
||||
'/mm/order/shipped': 'success',
|
||||
'/mm/order/unShipping': 'danger',
|
||||
'/mm/order/toShipping': 'warning'
|
||||
}[orderAction.interfaceUri]
|
||||
"
|
||||
plain
|
||||
size="small"
|
||||
@click="onButtonClick(orderAction.interfaceUri, packageData)"
|
||||
>{{ orderAction.desc.replace('admin', '').replace('按钮', '') }}</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="
|
||||
packageData.orderActionList.every(
|
||||
(item) => item.interfaceUri !== '/mm/order/toShipping'
|
||||
)
|
||||
"
|
||||
type="success"
|
||||
class="!ml-0"
|
||||
size="small"
|
||||
@click="handleViewLogistics(packageData)"
|
||||
>查看物流信息</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -391,14 +387,14 @@ const onButtonClick = (interfaceUri: string, packageData: PackageItem) => {
|
||||
if ('/mm/order/toShipping' === interfaceUri) {
|
||||
// 打包
|
||||
handlePack(packageData.vvTradeOrderLineDOList)
|
||||
} else if ('/mm/order/testzc' === interfaceUri) {
|
||||
// testzc 物流的接口
|
||||
} else if ('/mm/logistics/query' === interfaceUri) {
|
||||
// 查看物流信息
|
||||
handleViewLogistics(packageData)
|
||||
} else {
|
||||
// testzc其他按钮的接口
|
||||
const apiMap = {
|
||||
'/mm/order/unpack': 'unpackOrder',
|
||||
'/mm/order/delivered': 'finishDeliver'
|
||||
'/mm/order/unShipping': 'unpackOrder', // 取消发货
|
||||
'/mm/order/shipped': 'finishDeliver', // 签收
|
||||
'/mm/order/cancel': 'cancelOrder' // 取消订单
|
||||
}
|
||||
handleMessageBox({
|
||||
msg: '是否确认该操作?',
|
||||
@ -842,7 +838,6 @@ handleGetOrderList()
|
||||
.actions {
|
||||
border-left: 1px solid #f0f2f5;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 8px 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user