feat: 更新业务需求
This commit is contained in:
@@ -222,7 +222,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
data.roomId = data.roomId
|
data.roomId = data.roomId
|
||||||
.split(',')
|
.split(',')
|
||||||
.filter((id: string) => id.trim() !== '');
|
.filter((id: string) => id.trim() !== '');
|
||||||
data.area = data.sumPeices / data.peices;
|
// data.area = data.sumPeices / data.peices;
|
||||||
} else {
|
} else {
|
||||||
isAdd.value = true;
|
isAdd.value = true;
|
||||||
}
|
}
|
||||||
|
@@ -542,6 +542,7 @@ async function handleConfirm() {
|
|||||||
: await clean_orderAdd(data);
|
: await clean_orderAdd(data);
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
emit('reload');
|
emit('reload');
|
||||||
|
currentUnitId.value = ''; //清空当前单位id
|
||||||
modalApi.close();
|
modalApi.close();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@@ -553,6 +554,7 @@ async function handleConfirm() {
|
|||||||
async function handleClosed() {
|
async function handleClosed() {
|
||||||
await formApi.resetForm();
|
await formApi.resetForm();
|
||||||
detailTable.value = []; //清空详情表格
|
detailTable.value = []; //清空详情表格
|
||||||
|
currentUnitId.value = ''; //清空当前单位id
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
}
|
}
|
||||||
// 获取服务地址
|
// 获取服务地址
|
||||||
|
@@ -20,8 +20,11 @@ import type { CostItemSettingVO } from '#/api/property/costManagement/costItemSe
|
|||||||
import { getDictOptions } from '#/utils/dict';
|
import { getDictOptions } from '#/utils/dict';
|
||||||
import { personList } from '#/api/property/resident/person';
|
import { personList } from '#/api/property/resident/person';
|
||||||
import { renderDictValue } from '#/utils/render';
|
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 emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
@@ -74,7 +77,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
|
|
||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
const record = await houseChargeInfo(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 formApi.setValues(record);
|
||||||
}
|
}
|
||||||
await markInitialized();
|
await markInitialized();
|
||||||
@@ -93,8 +96,12 @@ async function handleConfirm() {
|
|||||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||||
const data = cloneDeep(await formApi.getValues());
|
const data = cloneDeep(await formApi.getValues());
|
||||||
if (data.chargeTime) {
|
if (data.chargeTime) {
|
||||||
data.startTime = data.chargeTime+'-01 00:00:00';
|
data.startTime = dayjs(data.chargeTime)
|
||||||
data.endTime = data.chargeTime+'-31 23:59:59';
|
.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));
|
await (isUpdate.value ? houseChargeUpdate(data) : houseChargeAdd(data));
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
@@ -115,7 +122,7 @@ async function handleClosed() {
|
|||||||
/**
|
/**
|
||||||
* 查询费用项设置
|
* 查询费用项设置
|
||||||
*/
|
*/
|
||||||
async function queryCostItemOptions(costType: string|null) {
|
async function queryCostItemOptions(costType: string | null) {
|
||||||
let params = {
|
let params = {
|
||||||
pageSize: 1000,
|
pageSize: 1000,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@@ -157,7 +164,9 @@ async function initCostTypeOptions() {
|
|||||||
{
|
{
|
||||||
componentProps: {
|
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) => {
|
onChange: async (value: string) => {
|
||||||
if (value) {
|
if (value) {
|
||||||
await queryCostItemOptions(value);
|
await queryCostItemOptions(value);
|
||||||
@@ -207,7 +216,7 @@ async function queryUnitData() {
|
|||||||
};
|
};
|
||||||
const res = await resident_unitList(params);
|
const res = await resident_unitList(params);
|
||||||
const options = res.rows.map((unit) => ({
|
const options = res.rows.map((unit) => ({
|
||||||
label:unit.name,
|
label: unit.name,
|
||||||
value: unit.id,
|
value: unit.id,
|
||||||
}));
|
}));
|
||||||
formApi.updateSchema([
|
formApi.updateSchema([
|
||||||
@@ -229,8 +238,8 @@ async function queryUnitData() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function queryRoomByUnit(unitId: string) {
|
async function queryRoomByUnit(unitId: string) {
|
||||||
let unitInfo = await resident_unitInfo(unitId);
|
let unitInfo = await resident_unitInfo(unitId);
|
||||||
if(unitInfo&&unitInfo.locationDetail){
|
if (unitInfo && unitInfo.locationDetail) {
|
||||||
await formApi.setFieldValue('roomInfo', unitInfo.locationDetail);
|
await formApi.setFieldValue('roomInfo', unitInfo.locationDetail);
|
||||||
await formApi.setFieldValue('area', unitInfo.area);
|
await formApi.setFieldValue('area', unitInfo.area);
|
||||||
}
|
}
|
||||||
@@ -241,14 +250,12 @@ async function queryRoomByUnit(unitId: string) {
|
|||||||
<BasicModal :title="title">
|
<BasicModal :title="title">
|
||||||
<BasicForm>
|
<BasicForm>
|
||||||
<template #roomInfo="slotProps">
|
<template #roomInfo="slotProps">
|
||||||
<div>
|
<div>
|
||||||
{{slotProps.field.value}}
|
{{ slotProps.field.value }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #area="slotProps">
|
<template #area="slotProps">
|
||||||
<div>
|
<div>{{ slotProps.field.value }}(㎡)</div>
|
||||||
{{slotProps.field.value}}(㎡)
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</BasicForm>
|
</BasicForm>
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
|
Reference in New Issue
Block a user