修正ts类型
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="收费项目" align="center" prop="payType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_payrecord_pay_type" :value="scope.row.payType || ''"></dict-tag>
|
||||
<dict-tag :options="com_payrecord_pay_type" :value="scope.row.payType"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="抄表周期" align="center" prop="recordMonth" width="180">
|
||||
@@ -87,12 +87,88 @@
|
||||
|
||||
<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="800px" append-to-body>
|
||||
<el-form ref="payRecordListFormRef" :model="form" label-position="left">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="抄表小区:" prop="recordId">
|
||||
{{ form.villageName ?? '--' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="房屋号码:" prop="houseName"> {{ form.houseName ?? '--' }}</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="住户姓名:" prop="recordId">
|
||||
{{ form.residentName ?? '--' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="住户编号:" prop="residentCode"> {{ form.residentCode ?? '--' }}</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="住户性别:" prop="recordId">
|
||||
{{ form.gender === '1' ? '男' : '女' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机号码:" prop="residentCode"> {{ form.phone ?? '--' }}</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="收费项目:" prop="recordId">
|
||||
<dict-tag v-if="form.payType" :options="com_payrecord_pay_type" :value="form.payType"></dict-tag>
|
||||
<span v-else>--</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="抄表月份:" prop="residentCode"> {{ form.recordMonth ?? '--' }}</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="收费起止日期:" prop="recordId">
|
||||
{{ parseTime(form.startTime, '{y}-{m}-{d}') }} -- {{ parseTime(form.endTime, '{y}-{m}-{d}') }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="起始读数:" prop="startRead"> {{ form.startRead ?? '--' }} 度 </el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="终止读数:" prop="endRead"> {{ form.endRead ?? '--' }} 度</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="本期用度:" prop="startRead"> {{ form.currentCost ?? '--' }} 度 </el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单价:" prop="price"> {{ form.price ?? '--' }} 元/度</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="费用合计:" prop="totalCost"> {{ form.totalCost ?? '--' }} 元 </el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cancel">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="PayRecord" lang="ts">
|
||||
import { listPayRecord, getPayRecord, delPayRecord, addPayRecord, updatePayRecord } from '@/api/system/SdbPayRecord';
|
||||
import { PayRecordVO, PayRecordQuery, PayRecordForm } from '@/api/system/SdbPayRecord/type';
|
||||
import { PayRecordListForm } from '@/api/system/SdbPayRecordMain/type';
|
||||
import { checkPermi } from '@/utils/permission';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
@@ -116,16 +192,29 @@ const dialog = reactive<DialogOption>({
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: PayRecordForm = {
|
||||
const initFormData: PayRecordListForm = {
|
||||
id: undefined,
|
||||
deviceType: undefined,
|
||||
houseId: undefined,
|
||||
recordId: undefined,
|
||||
housenumname: undefined,
|
||||
payType: undefined,
|
||||
recordMonth: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined
|
||||
endTime: undefined,
|
||||
currentCost: undefined,
|
||||
totalCost: undefined,
|
||||
deviceCode: undefined,
|
||||
deviceType: undefined,
|
||||
villageName: undefined,
|
||||
houseName: undefined,
|
||||
residentName: undefined,
|
||||
gender: undefined,
|
||||
phone: undefined,
|
||||
startRead: undefined,
|
||||
endRead: undefined,
|
||||
price: undefined,
|
||||
residentCode: undefined
|
||||
};
|
||||
const data = reactive<PageData<PayRecordForm, PayRecordQuery>>({
|
||||
const data = reactive<PageData<PayRecordListForm, PayRecordQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@@ -187,6 +276,27 @@ const handleMain = async (row?: PayRecordVO) => {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (id: string) => {
|
||||
// const res = await getPayRecordList(id);
|
||||
// Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '最新抄表详细';
|
||||
};
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
const payRecordListFormRef = ref<ElFormInstance>();
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
payRecordListFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: PayRecordVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
|
||||
Reference in New Issue
Block a user