页面路径完善

This commit is contained in:
Zy
2026-04-28 19:18:57 +08:00
parent bde3ca8ff1
commit 7b89144dd4
70 changed files with 573 additions and 221 deletions

View File

@@ -8,6 +8,11 @@
<el-form-item label="项目名称" prop="itemName">
<el-input v-model.trim="form.itemName" placeholder="请输入项目名称" />
</el-form-item>
<el-form-item label="收费项目" prop="typeId">
<el-select v-model="form.typeId">
<el-option v-for="(item, index) in chargeitemlist" :key="index" :value="item.id" :label="item.name"></el-option>
</el-select>
</el-form-item>
<el-form-item label="计费方式" prop="billingType">
<el-radio-group v-model="form.billingType">
<el-radio v-for="(item, index) in com_charge_item_method" :key="index" :value="item.value" :label="item.label"></el-radio>
@@ -60,6 +65,7 @@
import { ref } from 'vue';
import PageHeader from '@/components/Pageheader/index.vue';
import { getChargeItem, updateChargeItem, addChargeItem } from '@/api/system/SdbChargeItem';
import { listChargeType } from '@/api/system/ChargeType';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { com_charge_item_unit } = toRefs<any>(proxy?.useDict('com_charge_item_unit'));
@@ -74,6 +80,7 @@ const route = useRoute();
const formRef = ref();
const form = ref({
'id': null,
'typeId': '',
'itemName': '',
'billingType': '0',
'fixedPrice': null,
@@ -86,6 +93,7 @@ const form = ref({
});
const rules = ref({
itemName: [{ required: true, message: '请输入 项目名称', trigger: 'blur' }],
typeId: [{ required: true, message: '请选择 收费类型', trigger: 'blur' }],
billingType: [{ required: true, message: '请输入 计费方式', trigger: 'blur' }],
fixedPrice: [{ required: true, message: '请输入 费用单价', trigger: 'blur' }],
formula: [{ required: true, message: '请选择 计费公式', trigger: 'blur' }],
@@ -94,8 +102,13 @@ const rules = ref({
carryMethod: [{ required: true, message: '请选择 进位方式', trigger: 'blur' }]
});
const userid = ref(null);
const chargeitemlist = ref([]);
listChargeType().then((res) => {
chargeitemlist.value = res.rows;
});
if (route.query.id) {
userid.value = route.query.id;
getChargeItem(userid.value).then((res) => {
form.value = {
...form.value,

View File

@@ -209,7 +209,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: ChargeItemVO) => {
router.push({
path: '/sdb/addchargeItem',
path: '/sdb/editchargeItem',
query: {
id: row.id
}

View File

@@ -0,0 +1,239 @@
<template>
<div class="p-2 h-full flex flex-col">
<pageheader></pageheader>
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" label-width="120" :inline="true">
<el-form-item label="收费类型名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入收费类型名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card class="flex-1" shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['chargeType:chargeType:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['chargeType:chargeType:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['chargeType:chargeType:remove']"
>删除</el-button
>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" border :data="chargeTypeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="收费类型名称" align="center" prop="name" />
<el-table-column label="状态" align="center" prop="status">
<template #default="scope">
<el-switch
@change="(val: string) => handleChange(val, scope.row)"
v-model="scope.row.status"
active-text="启用"
active-value="0"
inactive-text="停用"
inactive-value="1"
></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['chargeType:chargeType:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['chargeType:chargeType:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改收费类型对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="chargeTypeFormRef" :model="form" :rules="rules" label-width="100px">
<el-form-item label="收费类型名称" prop="name">
<el-input v-model="form.name" placeholder="请输入收费类型名称" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="ChargeType" lang="ts">
import { listChargeType, getChargeType, delChargeType, addChargeType, updateChargeType } from '@/api/system/ChargeType';
import { ChargeTypeVO, ChargeTypeQuery, ChargeTypeForm, ChargeType2Query } from '@/api/system/ChargeType/type';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const chargeTypeList = ref<ChargeTypeVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const chargeTypeFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
const initFormData: ChargeTypeForm = {
id: undefined,
name: undefined,
status: undefined
};
const data = reactive<PageData<ChargeTypeForm, ChargeType2Query>>({
form: { ...initFormData },
queryParams: {
pageNum: 1,
pageSize: 10,
name: undefined,
status: undefined,
params: {}
}
});
const { queryParams, form, rules } = toRefs(data);
const handleChange = (val: string, row: ChargeTypeVO) => {
updateChargeType({
id: row.id,
status: val
}).then(() => {
proxy?.$modal.msgSuccess('操作成功');
getList();
});
};
/** 查询收费类型列表 */
const getList = async () => {
loading.value = true;
const res = await listChargeType(queryParams.value);
chargeTypeList.value = res.rows;
total.value = res.total;
loading.value = false;
};
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
};
/** 表单重置 */
const reset = () => {
form.value = { ...initFormData };
chargeTypeFormRef.value?.resetFields();
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
};
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
};
/** 多选框选中数据 */
const handleSelectionChange = (selection: ChargeTypeVO[]) => {
ids.value = selection.map((item) => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
};
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = '添加收费类型';
};
/** 修改按钮操作 */
const handleUpdate = async (row?: ChargeTypeVO) => {
reset();
const _id = row?.id || ids.value[0];
const res = await getChargeType(_id);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = '修改收费类型';
};
/** 提交按钮 */
const submitForm = () => {
chargeTypeFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.id) {
await updateChargeType(form.value).finally(() => (buttonLoading.value = false));
} else {
await addChargeType(form.value).finally(() => (buttonLoading.value = false));
}
proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false;
await getList();
}
});
};
/** 删除按钮操作 */
const handleDelete = async (row?: ChargeTypeVO) => {
const _ids = row?.id || ids.value;
await proxy?.$modal.confirm('是否确认删除收费类型编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
await delChargeType(_ids);
proxy?.$modal.msgSuccess('删除成功');
await getList();
};
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download(
'chargeType/chargeType/export',
{
...queryParams.value
},
`chargeType_${new Date().getTime()}.xlsx`
);
};
onMounted(() => {
getList();
});
</script>
<style scoped lang="scss">
.el-table {
height: calc(100% - 80px);
}
</style>

View File

@@ -162,7 +162,7 @@ const handleAdd = () => {
});
};
/** 修改按钮操作 */
/** 详情按钮操作 */
const handleMain = async (row?: PayRecordVO) => {
router.push({
path: '/sdb/PayRecordMain',

View File

@@ -29,7 +29,6 @@
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleMain" v-hasPermi="['system:bill:add']">详情</el-button>
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:bill:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
@@ -53,7 +52,7 @@
<dict-tag :options="com_questionnaire_scope" :value="scope.row.chargeScope"></dict-tag>
</template>
</el-table-column>
<el-table-column label="收费项目" align="center" prop="chargeItemId" />
<el-table-column label="收费项目" align="center" prop="chargeItemName" />
<el-table-column label="收费周期" align="center" prop="chargePeriod">
<template #default="scope">
<dict-tag :options="com_bill_charge_period" :value="scope.row.chargePeriod"></dict-tag>
@@ -71,11 +70,11 @@
</el-table-column>
<el-table-column label="单价" align="center" prop="endDate" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
<span>{{ scope.row.fixedPrice }}</span>
</template>
</el-table-column>
<el-table-column label="数量" align="center" prop="chargePeriod" />
<el-table-column label="费用合计" align="center" prop="chargePeriod" />
<!-- <el-table-column label="数量" align="center" prop="chargePeriod" />
<el-table-column label="费用合计" align="center" prop="chargePeriod" /> -->
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:bill:edit']">修改</el-button>
@@ -159,18 +158,6 @@ const getList = async () => {
loading.value = false;
};
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
};
/** 表单重置 */
const reset = () => {
form.value = { ...initFormData };
billFormRef.value?.resetFields();
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
@@ -201,27 +188,10 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: BillVO) => {
reset();
const _id = row?.id || ids.value[0];
const res = await getBill(_id);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = '修改账单管理';
};
/** 提交按钮 */
const submitForm = () => {
billFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.id) {
await updateBill(form.value).finally(() => (buttonLoading.value = false));
} else {
await addBill(form.value).finally(() => (buttonLoading.value = false));
}
proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false;
await getList();
router.push({
path: '/sdb/editSdbbill',
query: {
id: row.id
}
});
};
@@ -244,17 +214,6 @@ const handleDelete = async (row?: BillVO) => {
await getList();
};
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download(
'system/bill/export',
{
...queryParams.value
},
`bill_${new Date().getTime()}.xlsx`
);
};
onMounted(() => {
getList();
});

View File

@@ -64,7 +64,7 @@ import { ref } from 'vue';
import cashier from './cashier.vue';
import history from './history.vue';
const isSearch = ref(false);
const isSearch = ref(true);
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { com_cashier_type } = toRefs<any>(proxy?.useDict('com_cashier_type'));
const searchform = ref({

View File

@@ -508,7 +508,7 @@ const router = useRouter();
const handleRecode = (row: ElectricityDeviceVO) => {
// 1.电表 2.电表
router.push({
path: '/equipment/TopupRecord2',
path: '/equipment/electricityTopupRecord',
query: {
type: '2',
houseName: row.houseName,

View File

@@ -4,10 +4,10 @@
<el-card class="flex-1 mt-10px" shadow="never">
<template #header>
<el-row :gutter="10" style="font-size: 0.8rem">
<el-col :span="3"> 设备号 {{ routeid }} </el-col>
<el-col :span="3"> 房间号 {{ housename }} </el-col>
<el-col :span="17"></el-col>
<el-col :span="1">
<el-col :span="4"> 设备号 {{ routeid }} </el-col>
<el-col :span="4"> 房间号 {{ housename }} </el-col>
<el-col :span="14"></el-col>
<el-col :span="2">
<el-button @click="confinem">返回</el-button>
</el-col>
</el-row>

View File

@@ -98,7 +98,7 @@
></el-switch>
</template>
</el-table-column> -->
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
<el-table-column label="操作" align="center" width="250" fixed="right" class-name="small-padding fixed-width">
<template #default="scope">
<el-row>
<el-col :span="24" class="flex flex-items-center">
@@ -494,7 +494,7 @@ const router = useRouter();
const handleRecode = (row: WaterDeviceVO) => {
// 1.电表 2.水表
router.push({
path: '/equipment/TopupRecord',
path: '/equipment/waterTopupRecord',
query: {
type: '2',
id: row.id,