8/1 限制前端输入字数
This commit is contained in:
@@ -10,7 +10,13 @@
|
||||
</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-option
|
||||
:disabled="item.status === '1'"
|
||||
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">
|
||||
@@ -84,7 +90,6 @@ const { com_charge_item_method } = toRefs<any>(proxy?.useDict('com_charge_item_m
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
const formRef = ref();
|
||||
const form = ref({
|
||||
'id': null,
|
||||
@@ -107,7 +112,7 @@ const rules = ref({
|
||||
{ required: true, message: '请输入 费用单价', trigger: 'blur' },
|
||||
{
|
||||
validator: (_: any, value: string | number, callback: (arg0?: Error) => any) => {
|
||||
if (value === '' || value === null) {
|
||||
if (value === '' || value === null || value === undefined || value === 0) {
|
||||
return callback(new Error('请输入费用单价'));
|
||||
} else {
|
||||
const val = Number(value);
|
||||
@@ -128,9 +133,9 @@ const rules = ref({
|
||||
carryMethod: [{ required: true, message: '请选择 进位方式', trigger: 'blur' }]
|
||||
});
|
||||
const userid = ref(null);
|
||||
const chargeitemlist = ref([]);
|
||||
const chargeItemList = ref([]);
|
||||
listChargeType().then((res) => {
|
||||
chargeitemlist.value = res.rows;
|
||||
chargeItemList.value = res.rows;
|
||||
});
|
||||
if (route.query.id) {
|
||||
userid.value = route.query.id;
|
||||
@@ -151,12 +156,12 @@ const submitForm = () => {
|
||||
formRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
if (userid.value) {
|
||||
updateChargeItem(form.value).then((res) => {
|
||||
updateChargeItem(form.value).then(() => {
|
||||
ElMessage.success('编辑成功');
|
||||
cancelForm();
|
||||
});
|
||||
} else {
|
||||
addChargeItem(form.value).then((res) => {
|
||||
addChargeItem(form.value).then(() => {
|
||||
ElMessage.success('添加成功');
|
||||
cancelForm();
|
||||
});
|
||||
@@ -170,9 +175,9 @@ const cancelForm = () => {
|
||||
};
|
||||
|
||||
// 车位费 物业费
|
||||
const typeNamelist = ref(['2049026520314445826']);
|
||||
const typeNameList = ref(['2049026520314445826']);
|
||||
function placeHolderFun(typeId: string) {
|
||||
return typeNamelist.value.includes(typeId) ? '请输入每日费用单价' : '请输入费用单价';
|
||||
return typeNameList.value.includes(typeId) ? '请输入每日费用单价' : '请输入费用单价';
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -31,7 +31,13 @@
|
||||
<div>
|
||||
<el-form-item label="收费项目" prop="itemId">
|
||||
<el-select v-model="queryParams.chargeItemId" placeholder="请选择收费项目">
|
||||
<el-option v-for="(item, index) in chargeItems" :key="index" :value="item.id" :label="item.itemName"></el-option>
|
||||
<el-option
|
||||
:disabled="item.status === '1'"
|
||||
v-for="(item, index) in chargeItems"
|
||||
:key="index"
|
||||
:value="item.id"
|
||||
:label="item.itemName"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="缴费周期" prop="chargePeriod">
|
||||
@@ -118,7 +124,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="收费周期" align="center" prop="periodDisplay" width="280">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.periodDisplay }}</span>
|
||||
<span>{{ scope.row.periodDisplay }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -171,7 +177,6 @@
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="650px" append-to-body>
|
||||
<div class="payInfo">
|
||||
<div>
|
||||
@@ -237,7 +242,7 @@
|
||||
<el-tooltip class="box-item" effect="light" placement="top">
|
||||
<el-icon color="#909399" style="vertical-align: middle"><QuestionFilled /></el-icon>
|
||||
<template #content>
|
||||
<span>有账单 应缴费用 不足 优惠金额╬╬</span>
|
||||
<span>有账单 应缴费用 不足 优惠金额</span>
|
||||
</template>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
@@ -418,8 +423,7 @@ import { getCommunitylistAPI } from '@/api/system/community';
|
||||
import { billEdit, billlistType, billPrint, BillPrintType, billQuery } from '@/api/system/SdbCashier';
|
||||
import { listChargeItem } from '@/api/system/SdbChargeItem';
|
||||
import { ref } from 'vue';
|
||||
// import { printTicket, printTicketDiv } from '@/utils/print';
|
||||
import { add, div, eq, eqMoney, gtMoney, ltMoney, maxMoney, minMoney, moneyAdd, mul, sub, sum, toBig } from '@/utils/money';
|
||||
import { add, div, eq, eqMoney, gtMoney, ltMoney, minMoney, moneyAdd, mul, sub, sum, toBig } from '@/utils/money';
|
||||
import { BuildingUnitlist, BuildingVo, FloorsType } from '@/api/system/house/type';
|
||||
import { ChargeItemVO } from '@/api/system/SdbChargeItem/type';
|
||||
import { communitylist_rows_type } from '@/api/system/community/type';
|
||||
@@ -429,8 +433,8 @@ import { CirclePlus, Delete, QuestionFilled } from '@element-plus/icons-vue';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_pay_status, com_pay_method, com_charge_item_unit, com_bill_charge_period } = toRefs<any>(
|
||||
proxy?.useDict('com_pay_status', 'com_pay_method', 'com_charge_item_unit', 'com_bill_charge_period')
|
||||
const { com_pay_status, com_pay_method, com_charge_item_unit } = toRefs<any>(
|
||||
proxy?.useDict('com_pay_status', 'com_pay_method', 'com_charge_item_unit')
|
||||
);
|
||||
|
||||
const userStore = useUserStore();
|
||||
@@ -461,20 +465,34 @@ const villageId = localStorage.getItem('villageid') ?? undefined;
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
// 收款状态
|
||||
payStatus: null,
|
||||
// 小区id
|
||||
villageId: villageId,
|
||||
// 楼栋id
|
||||
buildingId: undefined,
|
||||
// 单元id
|
||||
unitNoId: undefined,
|
||||
// 房屋id
|
||||
houseId: undefined,
|
||||
// 缴费周期
|
||||
chargePeriod: undefined,
|
||||
// 房屋类型id
|
||||
houseUseTypeId: undefined,
|
||||
// 缴费时间
|
||||
payTime: undefined,
|
||||
// 缴费人
|
||||
residentName: undefined,
|
||||
// 缴费项目id
|
||||
chargeItemId: undefined,
|
||||
period: undefined,
|
||||
// 缴费时间开始
|
||||
payTimeBegin: undefined,
|
||||
// 缴费时间结束
|
||||
payTimeEnd: undefined,
|
||||
// 开始时间
|
||||
startDate: undefined,
|
||||
// 结束时间
|
||||
endDate: undefined
|
||||
});
|
||||
|
||||
@@ -510,6 +528,7 @@ function handleChangeVillage(val: string) {
|
||||
queryParams.value.unitNoId = undefined;
|
||||
queryParams.value.buildingId = undefined;
|
||||
queryParams.value.chargeItemId = undefined;
|
||||
queryParams.value.houseId = undefined;
|
||||
buildingList.value = [];
|
||||
unitList.value = [];
|
||||
if (val) {
|
||||
@@ -523,7 +542,8 @@ function handleChangeVillage(val: string) {
|
||||
// 获取收费项目
|
||||
function handleChargeItem(id: string) {
|
||||
listChargeItem({
|
||||
villageId: id
|
||||
villageId: id,
|
||||
status: '0'
|
||||
}).then((res) => {
|
||||
chargeItems.value = res.rows;
|
||||
});
|
||||
@@ -582,6 +602,8 @@ const handleQuery = () => {
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
payTime.value = [];
|
||||
chargePeriod.value = [];
|
||||
queryParams.value = {
|
||||
chargePeriod: undefined,
|
||||
payTime: undefined,
|
||||
@@ -601,6 +623,7 @@ const resetQuery = () => {
|
||||
startDate: undefined,
|
||||
endDate: undefined
|
||||
};
|
||||
queryParams.value.villageId = villageId;
|
||||
handleQuery();
|
||||
};
|
||||
// 控制收费 按钮 不能有已缴纳的(后端会校验)
|
||||
@@ -998,11 +1021,13 @@ function conFimPrint() {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
queryParams.value.villageId = villageId;
|
||||
getList();
|
||||
getHouseTypeList();
|
||||
// 全部小区
|
||||
getCommunitylistAPI().then((res) => {
|
||||
villageList.value = res.rows;
|
||||
handleChangeVillage(queryParams.value.villageId);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user