Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
This commit is contained in:
@@ -71,6 +71,7 @@ export interface CostItemSettingVO {
|
||||
*/
|
||||
searchValue: string;
|
||||
chargeNo: string;
|
||||
unit: string;
|
||||
|
||||
}
|
||||
|
||||
|
@@ -222,7 +222,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
data.roomId = data.roomId
|
||||
.split(',')
|
||||
.filter((id: string) => id.trim() !== '');
|
||||
data.area = data.sumPeices / data.peices;
|
||||
// data.area = data.sumPeices / data.peices;
|
||||
} else {
|
||||
isAdd.value = true;
|
||||
}
|
||||
|
@@ -332,7 +332,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
for (const item of record.relationList) {
|
||||
for (let i = 0; i < detailTable.value.length; i++) {
|
||||
if (item.cleanId === detailTable.value[i].id) {
|
||||
detailTable.value[i].area = item.areas;
|
||||
// detailTable.value[i].area = item.areas;
|
||||
detailTable.value[i].sumPeices = item.sumPrice;
|
||||
}
|
||||
}
|
||||
@@ -446,7 +446,7 @@ const detailColumns = [
|
||||
customRender: ({ value }: { value: number }) =>
|
||||
value === 1 ? '启用' : '禁用',
|
||||
},
|
||||
// { title: '保洁面积', dataIndex: 'area', key: 'area' },
|
||||
{ title: '保洁面积', dataIndex: 'area', key: 'area' },
|
||||
{
|
||||
title: '合计费用',
|
||||
dataIndex: 'sumPeices',
|
||||
@@ -490,7 +490,6 @@ function handleViewDetail(record: any) {
|
||||
...record,
|
||||
readonly: true,
|
||||
unitId: currentUnitId.value,
|
||||
area: record.su,
|
||||
});
|
||||
detailModalApi.open();
|
||||
}
|
||||
@@ -542,6 +541,7 @@ async function handleConfirm() {
|
||||
: await clean_orderAdd(data);
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
currentUnitId.value = ''; //清空当前单位id
|
||||
modalApi.close();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
@@ -553,6 +553,7 @@ async function handleConfirm() {
|
||||
async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
detailTable.value = []; //清空详情表格
|
||||
currentUnitId.value = ''; //清空当前单位id
|
||||
resetInitialized();
|
||||
}
|
||||
// 获取服务地址
|
||||
|
@@ -57,9 +57,9 @@ async function handleOpenChange(open: boolean) {
|
||||
:is="renderDict(costItemSettingDetail.paymentType,'pro_payment_type')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="费用周期(月)">
|
||||
{{ costItemSettingDetail.chargeCycle }}
|
||||
</DescriptionsItem>
|
||||
<!-- <DescriptionsItem label="费用周期(月)">-->
|
||||
<!-- {{ costItemSettingDetail.chargeCycle }}-->
|
||||
<!-- </DescriptionsItem>-->
|
||||
<DescriptionsItem label="单位">
|
||||
{{ costItemSettingDetail.unit }}
|
||||
</DescriptionsItem>
|
||||
@@ -83,15 +83,15 @@ async function handleOpenChange(open: boolean) {
|
||||
:is="renderDict(costItemSettingDetail.state,'wy_state')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="计算公式" v-if="costItemSettingDetail.formula!=null">
|
||||
<DescriptionsItem label="计算公式" v-if="costItemSettingDetail.formula!=null" :span="2">
|
||||
<component
|
||||
:is="renderDict(costItemSettingDetail.formula,'pro_calculation_formula')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="计费单价">
|
||||
<DescriptionsItem :label="costItemSettingDetail.formula=='1'?'费用':'计费单价'" v-if="costItemSettingDetail.unitPrice!=null">
|
||||
{{ costItemSettingDetail.unitPrice }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="附加费用">
|
||||
<DescriptionsItem label="附加费用" v-if="costItemSettingDetail.surcharge!=null">
|
||||
{{ costItemSettingDetail.surcharge }}
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
|
@@ -10,6 +10,7 @@ import { costItemSettingAdd, costItemSettingInfo, costItemSettingUpdate } from '
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
@@ -53,7 +54,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
initCostTypeOptions()
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
|
||||
@@ -67,6 +68,39 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* 初始化费用类型
|
||||
*/
|
||||
async function initCostTypeOptions() {
|
||||
formApi.updateSchema([
|
||||
{
|
||||
componentProps: {
|
||||
// 费用类型不要保洁、会议、绿植
|
||||
options: getDictOptions('pro_expense_type'),
|
||||
onChange: async (value: string) => {
|
||||
if (value) {
|
||||
//水费、电费、气费
|
||||
if(['5','6','8'].includes(value)){
|
||||
await formApi.setFieldValue('formula', '5');//(本层本次读数-上次读数)*单价/本层实际使用面积*本单位面积
|
||||
//停车费、租金、押金
|
||||
}else if(['2','7','9'].includes(value)){
|
||||
await formApi.setFieldValue('formula', '1');//固定费用
|
||||
//会议室使用费、绿植租赁费、保洁服务费
|
||||
}else if(['1','3','4'].includes(value)){
|
||||
await formApi.setFieldValue('formula', null);
|
||||
//物业管理费
|
||||
}else{
|
||||
await formApi.setFieldValue('formula', '0');//建筑面积*单价
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
},
|
||||
fieldName: 'costType',
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
@@ -76,6 +110,18 @@ async function handleConfirm() {
|
||||
}
|
||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
//会议室使用费、绿植租赁费、保洁服务费
|
||||
if(['1','3','4'].includes(data.costType)){
|
||||
data.roundingMode=null;
|
||||
data.currencyDecimals=null;
|
||||
data.formula=null;
|
||||
data.unitPrice=null;
|
||||
data.surcharge=null;
|
||||
}
|
||||
//固定费用
|
||||
if(data.formula=='1'){
|
||||
data.surcharge=null;
|
||||
}
|
||||
await (isUpdate.value ? costItemSettingUpdate(data) : costItemSettingAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
|
@@ -32,6 +32,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '费用编号',
|
||||
field: 'chargeNo',
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: '费用类型',
|
||||
@@ -41,10 +42,12 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return renderDict(row.costType, 'pro_expense_type');
|
||||
},
|
||||
},
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '收费项目',
|
||||
field: 'chargeItem',
|
||||
minWidth: 180,
|
||||
},
|
||||
{
|
||||
title: '费用标识',
|
||||
@@ -54,6 +57,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return renderDict(row.costMark, 'pro_cost_identification');
|
||||
},
|
||||
},
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: '付费类型',
|
||||
@@ -63,33 +67,18 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return renderDict(row.paymentType, 'pro_payment_type');
|
||||
},
|
||||
},
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: '费用周期(月)',
|
||||
field: 'chargeCycle',
|
||||
},
|
||||
{
|
||||
title: '计算公式',
|
||||
field: 'formula',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.formula, 'pro_calculation_formula');
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '计费单价',
|
||||
field: 'unitPrice',
|
||||
},
|
||||
{
|
||||
title: '附加费用',
|
||||
field: 'surcharge',
|
||||
title: '单位',
|
||||
field: 'unit',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
field: 'state',
|
||||
slots: { default: 'state' },
|
||||
width: 100,
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
@@ -114,9 +103,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
label: '费用类型',
|
||||
fieldName: 'costType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_expense_type'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
@@ -143,12 +129,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '费用周期(月)',
|
||||
fieldName: 'chargeCycle',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '单位',
|
||||
fieldName: 'unit',
|
||||
@@ -158,15 +138,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
placeholder: '请输入(如:元)',
|
||||
},
|
||||
},
|
||||
// {
|
||||
// label: '付费方式',
|
||||
// fieldName: 'paymentMode',
|
||||
// component: 'Select',
|
||||
// componentProps: {
|
||||
// options: getDictOptions('wy_fffs'),
|
||||
// },
|
||||
// rules: 'selectRequired',
|
||||
// },
|
||||
{
|
||||
label: '进位方式',
|
||||
fieldName: 'roundingMode',
|
||||
@@ -175,6 +146,10 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
component: 'Select',
|
||||
rules: 'selectRequired',
|
||||
dependencies: {
|
||||
show: (fromValue) => !(['1','3','4'].includes(fromValue.costType)),
|
||||
triggerFields: ['costType'],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '保留小数',
|
||||
@@ -184,6 +159,10 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
options: getDictOptions('pro_keep_decimals'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
dependencies: {
|
||||
show: (fromValue) => !(['1','3','4'].includes(fromValue.costType)),
|
||||
triggerFields: ['costType'],
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
@@ -201,18 +180,42 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_calculation_formula'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
disabled:true,
|
||||
defaultValue:'1',
|
||||
dependencies: {
|
||||
show: (fromValue) => !(['1','3','4'].includes(fromValue.costType)),
|
||||
triggerFields: ['costType'],
|
||||
},
|
||||
formItemClass:'col-span-2'
|
||||
},
|
||||
{
|
||||
label: '计费单价',
|
||||
fieldName: 'unitPrice',
|
||||
component: 'InputNumber',
|
||||
rules: 'required',
|
||||
dependencies: {
|
||||
show: (fromValue) => ['0','5','6','8'].includes(fromValue.costType),
|
||||
triggerFields: ['costType'],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '费用',
|
||||
fieldName: 'unitPrice',
|
||||
component: 'InputNumber',
|
||||
rules: 'required',
|
||||
dependencies: {
|
||||
show: (fromValue) => ['2','7','9'].includes(fromValue.costType),
|
||||
triggerFields: ['costType'],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '附加费',
|
||||
fieldName: 'surcharge',
|
||||
component: 'InputNumber',
|
||||
rules: 'required',
|
||||
dependencies: {
|
||||
show: (fromValue) => ['0','5','6','8'].includes(fromValue.costType),
|
||||
triggerFields: ['costType'],
|
||||
},
|
||||
},
|
||||
];
|
||||
|
@@ -63,10 +63,11 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '单位',
|
||||
field: 'residentUnitText',
|
||||
minWidth: 150,
|
||||
minWidth: 180,
|
||||
},
|
||||
{
|
||||
title: '费用类型',
|
||||
width: 150,
|
||||
field: 'costType',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
|
@@ -20,8 +20,11 @@ import type { CostItemSettingVO } from '#/api/property/costManagement/costItemSe
|
||||
import { getDictOptions } from '#/utils/dict';
|
||||
import { personList } from '#/api/property/resident/person';
|
||||
import { renderDictValue } from '#/utils/render';
|
||||
import {resident_unitInfo, resident_unitList} from "#/api/property/resident/unit";
|
||||
|
||||
import {
|
||||
resident_unitInfo,
|
||||
resident_unitList,
|
||||
} from '#/api/property/resident/unit';
|
||||
import dayjs from 'dayjs';
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
const isUpdate = ref(false);
|
||||
@@ -74,7 +77,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
|
||||
if (isUpdate.value && id) {
|
||||
const record = await houseChargeInfo(id);
|
||||
record.chargeTime =record.startTime?.substring(0,7);
|
||||
record.chargeTime = record.startTime?.substring(0, 7);
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
@@ -93,8 +96,12 @@ async function handleConfirm() {
|
||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
if (data.chargeTime) {
|
||||
data.startTime = data.chargeTime+'-01 00:00:00';
|
||||
data.endTime = data.chargeTime+'-31 23:59:59';
|
||||
data.startTime = dayjs(data.chargeTime)
|
||||
.startOf('month')
|
||||
.format('YYYY-MM-DD HH:mm:ss');
|
||||
data.endTime = dayjs(data.chargeTime)
|
||||
.endOf('month')
|
||||
.format('YYYY-MM-DD HH:mm:ss');
|
||||
}
|
||||
await (isUpdate.value ? houseChargeUpdate(data) : houseChargeAdd(data));
|
||||
resetInitialized();
|
||||
@@ -115,7 +122,7 @@ async function handleClosed() {
|
||||
/**
|
||||
* 查询费用项设置
|
||||
*/
|
||||
async function queryCostItemOptions(costType: string|null) {
|
||||
async function queryCostItemOptions(costType: string | null) {
|
||||
let params = {
|
||||
pageSize: 1000,
|
||||
pageNum: 1,
|
||||
@@ -157,7 +164,9 @@ async function initCostTypeOptions() {
|
||||
{
|
||||
componentProps: {
|
||||
// 费用类型不要保洁、会议、绿植
|
||||
options: getDictOptions('pro_expense_type').filter(item=>!(['1','3','4'].includes(item.value))),
|
||||
options: getDictOptions('pro_expense_type').filter(
|
||||
(item) => !['1', '3', '4'].includes(item.value),
|
||||
),
|
||||
onChange: async (value: string) => {
|
||||
if (value) {
|
||||
await queryCostItemOptions(value);
|
||||
@@ -207,7 +216,7 @@ async function queryUnitData() {
|
||||
};
|
||||
const res = await resident_unitList(params);
|
||||
const options = res.rows.map((unit) => ({
|
||||
label:unit.name,
|
||||
label: unit.name,
|
||||
value: unit.id,
|
||||
}));
|
||||
formApi.updateSchema([
|
||||
@@ -229,8 +238,8 @@ async function queryUnitData() {
|
||||
}
|
||||
|
||||
async function queryRoomByUnit(unitId: string) {
|
||||
let unitInfo = await resident_unitInfo(unitId);
|
||||
if(unitInfo&&unitInfo.locationDetail){
|
||||
let unitInfo = await resident_unitInfo(unitId);
|
||||
if (unitInfo && unitInfo.locationDetail) {
|
||||
await formApi.setFieldValue('roomInfo', unitInfo.locationDetail);
|
||||
await formApi.setFieldValue('area', unitInfo.area);
|
||||
}
|
||||
@@ -241,14 +250,12 @@ async function queryRoomByUnit(unitId: string) {
|
||||
<BasicModal :title="title">
|
||||
<BasicForm>
|
||||
<template #roomInfo="slotProps">
|
||||
<div>
|
||||
{{slotProps.field.value}}
|
||||
</div>
|
||||
<div>
|
||||
{{ slotProps.field.value }}
|
||||
</div>
|
||||
</template>
|
||||
<template #area="slotProps">
|
||||
<div>
|
||||
{{slotProps.field.value}}(㎡)
|
||||
</div>
|
||||
<div>{{ slotProps.field.value }}(㎡)</div>
|
||||
</template>
|
||||
</BasicForm>
|
||||
</BasicModal>
|
||||
|
@@ -718,17 +718,16 @@ onBeforeUnmount(() => {
|
||||
.left {
|
||||
display: flex;
|
||||
width: 18.3125rem;
|
||||
font-size: 1.875rem;
|
||||
font-family: ShiShangZhongHeiJianTi;
|
||||
font-weight: 400;
|
||||
.left-first {
|
||||
padding-left: 2.3125rem;
|
||||
font-size: 1.875rem;
|
||||
width: 10.5rem;
|
||||
color: #ffffff;
|
||||
}
|
||||
.left-second {
|
||||
width: 6.5rem;
|
||||
font-family: ShiShangZhongHeiJianTi;
|
||||
font-weight: 400;
|
||||
font-size: 1.25rem;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
@@ -759,7 +758,7 @@ onBeforeUnmount(() => {
|
||||
}
|
||||
}
|
||||
.header {
|
||||
margin-top: 1.125rem;
|
||||
margin-top: 2.125rem;
|
||||
margin-left: 4.625rem;
|
||||
margin-right: 4.25rem;
|
||||
height: 6rem;
|
||||
|
Reference in New Issue
Block a user