费用管理

master
lzq 2026-03-03 11:05:47 +08:00
parent db70664f18
commit 572a7aba84
3 changed files with 34 additions and 3 deletions

View File

@ -1,6 +1,6 @@
import { import {
get, get,
post post,
} from '@/common/utils/http-util.ts' } from '@/common/utils/http-util.ts'
export default { export default {
@ -19,4 +19,7 @@ export default {
del(ids: string[]) { del(ids: string[]) {
return post('/station/del', ids) return post('/station/del', ids)
}, },
listAll() {
return get<StationTypes.SearchStationResult[]>('/station/list_all')
},
} }

View File

@ -20,6 +20,17 @@
<ElFormItem v-else label="项目名称" prop="expenseItemName"> <ElFormItem v-else label="项目名称" prop="expenseItemName">
<ElInput v-model="formData.expenseItemName" placeholder="项目名称"/> <ElInput v-model="formData.expenseItemName" placeholder="项目名称"/>
</ElFormItem> </ElFormItem>
<ElFormItem v-if="appUserStore.isXiaoNa" label="站点" prop="stationId">
<ElSelect v-model="formData.stationId" clearable>
<ElOption
v-for="item in stations"
:key="item.id"
:label="item.stationName"
:value="item.id!"/>
</ElSelect>
</ElFormItem>
<ElFormItem label="计费策略" prop="expenseStrategy"> <ElFormItem label="计费策略" prop="expenseStrategy">
<ElRadioGroup v-model="formData.expenseStrategy"> <ElRadioGroup v-model="formData.expenseStrategy">
<ElRadio v-for="it in expenseStrategy" :key="'expenseStrategy'+it.val" :value="it.val" border>{{ it.txt }}</ElRadio> <ElRadio v-for="it in expenseStrategy" :key="'expenseStrategy'+it.val" :value="it.val" border>{{ it.txt }}</ElRadio>
@ -86,6 +97,8 @@ import {
} from '@/pages/gds/goods/constants.ts' } from '@/pages/gds/goods/constants.ts'
import { expenseItemCategory } from '@/pages/fin/expense-item/constants.ts' import { expenseItemCategory } from '@/pages/fin/expense-item/constants.ts'
import GoodsDropTable from '@/pages/gds/goods/GoodsDropTable.vue' import GoodsDropTable from '@/pages/gds/goods/GoodsDropTable.vue'
import { useAppUserStore } from '@/common/app/app-user-store.ts'
import StationApi from '@/pages/cst/station/station-api.ts'
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
research?: () => void research?: () => void
@ -93,6 +106,7 @@ const props = withDefaults(defineProps<{
research: () => { research: () => {
}, },
}) })
const appUserStore = useAppUserStore()
const formPanelIns = useTemplateRef<AFormPanelInstance>('formPanel') const formPanelIns = useTemplateRef<AFormPanelInstance>('formPanel')
const status = ref<'add' | 'modify'>('add') const status = ref<'add' | 'modify'>('add')
const formPanelProps = buildFormPanelProps<ExpenseItemTypes.SearchExpenseItemResult>({ const formPanelProps = buildFormPanelProps<ExpenseItemTypes.SearchExpenseItemResult>({
@ -115,11 +129,11 @@ const formPanelProps = buildFormPanelProps<ExpenseItemTypes.SearchExpenseItemRes
doSubmit(data) { doSubmit(data) {
if (status.value === 'add') { if (status.value === 'add') {
return ExpenseItemApi return ExpenseItemApi
.add(data) .add({...data, stationId: appUserStore.isXiaoNa ? data.stationId : undefined})
.then(props.research) .then(props.research)
} else { } else {
return ExpenseItemApi return ExpenseItemApi
.modify(data) .modify({...data, stationId: appUserStore.isXiaoNa ? data.stationId : undefined})
.then(props.research) .then(props.research)
} }
}, },
@ -144,8 +158,18 @@ const formPanelProps = buildFormPanelProps<ExpenseItemTypes.SearchExpenseItemRes
watchEffect(() => { watchEffect(() => {
formPanelProps.title = status.value === 'add' ? '新建收费项目' : '修改收费项目信息' formPanelProps.title = status.value === 'add' ? '新建收费项目' : '修改收费项目信息'
}) })
const stations = ref<StationTypes.SearchStationResult[]>([])
defineExpose({ defineExpose({
open(data?: ExpenseItemTypes.SearchExpenseItemResult) { open(data?: ExpenseItemTypes.SearchExpenseItemResult) {
if (appUserStore.isXiaoNa) {
StationApi.listAll()
.then(res => {
stations.value = res.data
})
} else {
stations.value = []
}
formPanelIns.value?.open(data?.id) formPanelIns.value?.open(data?.id)
}, },
}) })

View File

@ -5,6 +5,7 @@ declare global {
interface SearchExpenseItemParam extends G.PageParam { interface SearchExpenseItemParam extends G.PageParam {
// Id // Id
id?: string id?: string
stationId?: string
// 归属用户 Id // 归属用户 Id
userId?: string userId?: string
// 归属客户 Id // 归属客户 Id
@ -52,6 +53,7 @@ declare global {
id?: string id?: string
// 归属用户 Id // 归属用户 Id
userId?: string userId?: string
stationId?: string
// 归属客户 Id // 归属客户 Id
customerId?: string customerId?: string
// 归属组织 Id // 归属组织 Id
@ -97,6 +99,7 @@ declare global {
id?: string id?: string
// 归属用户 Id // 归属用户 Id
userId?: string userId?: string
stationId?: string
// 归属客户 Id // 归属客户 Id
customerId?: string customerId?: string
// 归属组织 Id // 归属组织 Id
@ -140,6 +143,7 @@ declare global {
interface ModifyExpenseItemParam { interface ModifyExpenseItemParam {
// Id // Id
id?: string id?: string
stationId?: string
// 归属用户 Id // 归属用户 Id
userId?: string userId?: string
// 归属客户 Id // 归属客户 Id