修正ts类型
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<div class="bullshit__info">
|
||||
对不起,您正在寻找的页面不存在。尝试检查URL的错误,然后按浏览器上的刷新按钮或尝试在我们的应用程序中找到其他内容。
|
||||
</div>
|
||||
<router-link to="/index" class="bullshit__return-home"> 返回首页 </router-link>
|
||||
<router-link to="/" class="bullshit__return-home"> 返回首页 </router-link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -123,7 +123,7 @@ const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const selectName = ref<Array<string>>([]);
|
||||
const total = ref(0);
|
||||
const dateRange = ref<[DateModelType, DateModelType]>(['', '']);
|
||||
const dateRange = ref<[string, string]>(['', '']);
|
||||
const defaultSort = ref<any>({ prop: 'loginTime', order: 'descending' });
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
|
||||
@@ -143,7 +143,7 @@ const showSearch = ref(true);
|
||||
const ids = ref<Array<number | string>>([]);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const dateRange = ref<[DateModelType, DateModelType]>(['', '']);
|
||||
const dateRange = ref<[string, string]>(['', '']);
|
||||
const defaultSort = ref<any>({ prop: 'operTime', order: 'descending' });
|
||||
|
||||
const operLogTableRef = ref<ElTableInstance>();
|
||||
|
||||
@@ -138,7 +138,7 @@ const handleRegister = () => {
|
||||
if (!err) {
|
||||
const username = registerForm.value.username;
|
||||
await ElMessageBox.alert('<span style="color: red; ">' + t('register.registerSuccess', { username }) + '</font>', '系统提示', {
|
||||
app: undefined,
|
||||
// app: undefined,
|
||||
dangerouslyUseHTMLString: true,
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
@@ -28,11 +28,11 @@
|
||||
</template>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="跳转链接" prop="jump_link">
|
||||
<el-input v-model.trim="form.jump_link" placeholder="请输入跳转链接" />
|
||||
<el-form-item label="跳转链接" prop="link">
|
||||
<el-input v-model.trim="form.link" placeholder="请输入跳转链接" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序号" prop="order">
|
||||
<el-input-number v-model.trim="form.order" placeholder="请输入" />
|
||||
<el-form-item label="排序号" prop="byOrder">
|
||||
<el-input-number v-model.trim="form.byOrder" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-top: 30px">
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
@@ -91,8 +91,8 @@ const form = ref({
|
||||
id: null,
|
||||
name: '', // 分类id、
|
||||
url: '', // 设备名称
|
||||
jump_link: '', // 编号
|
||||
order: null // 区域
|
||||
link: '', // 编号
|
||||
byOrder: 1 // 区域
|
||||
});
|
||||
const rules = ref({
|
||||
name: [{ required: true, message: '请输入Banner图名称', trigger: 'blur' }],
|
||||
@@ -108,8 +108,8 @@ function init() {
|
||||
id: res.data.id,
|
||||
name: res.data.name, // 分类id、
|
||||
url: res.data.url, // 设备名称
|
||||
jump_link: res.data.jump_link, // 编号
|
||||
order: res.data.order // 区域
|
||||
link: res.data.link, // 编号
|
||||
byOrder: res.data.byOrder // 区域
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
@@ -64,11 +64,17 @@
|
||||
<el-table-column label="名称" align="center" prop="name" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<el-switch inactive-value="0" active-value="1" v-model="scope.row.status"></el-switch>
|
||||
<!-- 0启用 1停用 -->
|
||||
<el-switch
|
||||
@change="(val: string) => handleSwitch(scope.row.id, val)"
|
||||
inactive-value="0"
|
||||
active-value="1"
|
||||
v-model="scope.row.status"
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序" align="center" prop="order" />
|
||||
<el-table-column label="添加时间" align="center" prop="order" />
|
||||
<el-table-column label="排序" align="center" prop="byOrder" />
|
||||
<el-table-column label="添加时间" align="center" />
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['banner:banner:edit']">修改</el-button>
|
||||
@@ -81,12 +87,12 @@
|
||||
</el-card>
|
||||
<!-- 添加或修改Banner图管理对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="bannerFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form ref="bannerFormRef" :model="form" label-width="80px">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="order">
|
||||
<el-input v-model="form.order" placeholder="请输入排序" />
|
||||
<el-form-item label="排序" prop="byOrder">
|
||||
<el-input v-model="form.byOrder" placeholder="请输入排序" />
|
||||
</el-form-item>
|
||||
<el-form-item label="小区id" prop="villageId">
|
||||
<el-input v-model="form.villageId" placeholder="请输入小区id" />
|
||||
@@ -103,7 +109,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Banner" lang="ts">
|
||||
import { listBanner, getBanner, delBanner, addBanner, updateBanner } from '@/api/system/Banner';
|
||||
import { listBanner, getBanner, delBanner, addBanner, updateBanner, switchBanner } from '@/api/system/Banner';
|
||||
import { BannerVO, BannerQuery, BannerForm } from '@/api/system/Banner/type';
|
||||
import { checkPermi } from '@/utils/permission';
|
||||
|
||||
@@ -130,7 +136,8 @@ const initFormData: BannerForm = {
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
status: undefined,
|
||||
order: undefined,
|
||||
byOrder: undefined,
|
||||
link: undefined,
|
||||
villageId: undefined
|
||||
};
|
||||
const data = reactive<PageData<BannerForm, BannerQuery>>({
|
||||
@@ -140,9 +147,9 @@ const data = reactive<PageData<BannerForm, BannerQuery>>({
|
||||
pageSize: 10,
|
||||
name: undefined,
|
||||
status: undefined,
|
||||
order: undefined,
|
||||
villageId: undefined,
|
||||
params: {}
|
||||
byOrder: undefined,
|
||||
link: undefined,
|
||||
villageId: undefined
|
||||
}
|
||||
});
|
||||
|
||||
@@ -243,6 +250,12 @@ const handleExport = () => {
|
||||
`banner_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
function handleSwitch(id: string, status: string) {
|
||||
switchBanner(id, status).then(() => {
|
||||
ElMessage.success('操作成功');
|
||||
getList();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
<div class="carinfo_item">
|
||||
<div class="label">投诉时间</div>
|
||||
<div class="main">{{ form.orderDate }}</div>
|
||||
<div class="main">{{ form.createTime }}</div>
|
||||
</div>
|
||||
|
||||
<div class="carinfo_item">
|
||||
@@ -100,7 +100,8 @@ const form = ref({
|
||||
'status': '1', // 投诉状态 0待处理 1已处理
|
||||
'handleId': '',
|
||||
'handleName': '',
|
||||
'handleContent': ''
|
||||
'handleContent': '',
|
||||
'createTime': null
|
||||
});
|
||||
const rules = {
|
||||
status: [{ required: true, message: '选择投诉处理状态', trigger: 'blur' }]
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<el-col :span="2"></el-col>
|
||||
<el-col :span="11">
|
||||
<el-form-item label="绑定车牌号" prop="carNum">
|
||||
<el-input v-model.number="form.carNum" placeholder="请输入车牌号" />
|
||||
<LicensePlateInput ref="carNumInputRef" required v-model="form.carNum" @change="() => handleValidate()" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -92,7 +92,7 @@
|
||||
import { ref } from 'vue';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { addMonthCard, getMonthCard, updateMonthCard } from '@/api/system/MonthCard';
|
||||
import { validator } from '@/utils/Reg';
|
||||
import { LicensePlateValidator, validator } from '@/utils/Reg';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_pay_method } = toRefs<any>(proxy?.useDict('com_pay_method'));
|
||||
|
||||
@@ -139,9 +139,18 @@ const rules = ref({
|
||||
carNum: [
|
||||
{ required: true, message: '请输入车牌号', trigger: 'blur' },
|
||||
{
|
||||
validator: (_, value) => validator(value, 'PlateNumber'),
|
||||
message: '请输入正确的车牌号',
|
||||
trigger: 'blur'
|
||||
validator: (rule: any, value: string, callback: any) => {
|
||||
if (!value) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
if (!LicensePlateValidator.isValidPlate(value)) {
|
||||
callback(new Error('请输入正确的车牌号格式'));
|
||||
return;
|
||||
}
|
||||
callback();
|
||||
},
|
||||
trigger: 'blur' // ✅ 只在失焦时验证
|
||||
}
|
||||
],
|
||||
startTime: [{ required: true, message: '请选择有效日期', trigger: 'blur' }],
|
||||
@@ -154,7 +163,12 @@ const rules = ref({
|
||||
}
|
||||
]
|
||||
});
|
||||
function handleValidate() {
|
||||
formRef.value.validateField('carNum');
|
||||
}
|
||||
|
||||
const userid = ref(null);
|
||||
|
||||
if (route.query.id) {
|
||||
userid.value = route.query.id;
|
||||
getMonthCard(userid.value).then((res) => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<Pageheader title="公告管理"></Pageheader>
|
||||
<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">
|
||||
@@ -17,7 +17,7 @@
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<el-card shadow="never" class="flex-1">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-col :span="1.5">
|
||||
@@ -199,3 +199,9 @@ onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.el-table {
|
||||
height: calc(100% - 80px);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -41,7 +41,8 @@
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-form-item label="车牌号" prop="carNum">
|
||||
<el-input v-model.number.trim="form.carNum" placeholder="请输入车牌号" />
|
||||
<!-- <el-input v-model.number.trim="form.carNum" placeholder="请输入车牌号" /> -->
|
||||
<LicensePlateInput ref="carNumInputRef" required v-model="form.carNum" @change="() => handleValidate()" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="2"></el-col>
|
||||
@@ -108,10 +109,11 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import LicensePlateInput from '@/components/LicensePlateInput/index.vue';
|
||||
import { listArea } from '@/api/system/carArea';
|
||||
import { addParkingCost, getParkingCost, updateParkingCost } from '@/api/system/ParkingCost';
|
||||
import { listParking } from '@/api/system/parking';
|
||||
import { validator } from '@/utils/Reg';
|
||||
import { LicensePlateValidator, validator } from '@/utils/Reg';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_pay_method } = toRefs<any>(proxy?.useDict('com_pay_method'));
|
||||
const { com_parking_charge } = toRefs<any>(proxy?.useDict('com_parking_charge'));
|
||||
@@ -130,7 +132,7 @@ const form = ref({
|
||||
carNum: null, // 车牌号
|
||||
startTime: '', // 开始时间
|
||||
endTime: '', // 结束时间
|
||||
cost: '', // 费用
|
||||
cost: null, // 费用
|
||||
payMethod: '', // 支付方式
|
||||
payerStatus: '0', // 缴纳人状态
|
||||
remark: '' // 备注
|
||||
@@ -156,9 +158,18 @@ const rules = ref({
|
||||
carNum: [
|
||||
{ required: true, message: '请绑定车牌号', trigger: 'blur' },
|
||||
{
|
||||
validator: (_, value) => validator(value, 'PlateNumber'),
|
||||
message: '请请绑定车牌号',
|
||||
trigger: 'blur'
|
||||
validator: (rule: any, value: string, callback: any) => {
|
||||
if (!value) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
if (!LicensePlateValidator.isValidPlate(value)) {
|
||||
callback(new Error('请输入正确的车牌号格式'));
|
||||
return;
|
||||
}
|
||||
callback();
|
||||
},
|
||||
trigger: 'blur' // ✅ 只在失焦时验证
|
||||
}
|
||||
],
|
||||
startTime: [{ required: true, message: '请选择有效日期', trigger: 'blur' }],
|
||||
@@ -172,6 +183,9 @@ const rules = ref({
|
||||
}
|
||||
]
|
||||
});
|
||||
function handleValidate() {
|
||||
formRef.value.validateField('carNum');
|
||||
}
|
||||
const userid = ref(null);
|
||||
|
||||
// 区域
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="缴纳人" align="center" prop="payerName" />
|
||||
<el-table-column label="车牌号" align="center" prop="carNum" />
|
||||
<el-table-column label="停车时长" align="center" width="180">
|
||||
<el-table-column label="停车时长" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<span>{{ formatTimeDiff(scope.row.startTime, scope.row.endTime) }}</span>
|
||||
</template>
|
||||
@@ -76,7 +76,8 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="支付方式" align="center" prop="payMethod">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_pay_method" :value="scope.row.payMethod" />
|
||||
<dict-tag v-if="scope.row.payMethod" :options="com_pay_method" :value="scope.row.payMethod" />
|
||||
<span v-else>--</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
@@ -108,8 +109,8 @@ const { com_pay_method } = toRefs<any>(proxy?.useDict('com_pay_method'));
|
||||
|
||||
const router = useRouter();
|
||||
interface ParkingCostType extends ParkingCostVO {
|
||||
areaName: string;
|
||||
parkingName: string;
|
||||
areaName?: string;
|
||||
parkingName?: string;
|
||||
}
|
||||
const parkingCostList = ref<ParkingCostType[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
|
||||
<!-- 填空题/多行文本展示 -->
|
||||
<div v-else-if="q.type === 'input'" class="input-placeholder">
|
||||
<el-input v-model="q.placeholder" placeholder="用户输入区域" />
|
||||
<el-input disabled placeholder="用户输入区域" />
|
||||
</div>
|
||||
<div v-else-if="q.type === 'textarea'" class="input-placeholder">
|
||||
<el-input type="textarea" v-model="q.placeholder" placeholder="用户输入区域" />
|
||||
<el-input disabled type="textarea" placeholder="用户输入区域" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -90,7 +90,8 @@ function init() {
|
||||
getQuestionnaire(viewid.value).then((res) => {
|
||||
viewData.value = {
|
||||
...viewData.value,
|
||||
...res.data
|
||||
...res.data,
|
||||
content: [] as QuestionComponentItem[]
|
||||
};
|
||||
if (typeof res.data.content === 'string') {
|
||||
viewData.value.content = JSON.parse(res.data.content) as QuestionComponentItem[];
|
||||
|
||||
@@ -82,9 +82,8 @@ import QuestionnaireEdit from './components/QuestionnaireEdit.vue';
|
||||
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { Delete, DocumentAdd } from '@element-plus/icons-vue';
|
||||
import { getQuestionnaire } from '../test/api';
|
||||
import { QuestionnaireForm, QuestionnaireVO } from '@/api/system/Questionnaire/type';
|
||||
import { addQuestionnaire, updateQuestionnaire } from '@/api/system/Questionnaire';
|
||||
import { QuestionComponentnaireForm, QuestionnaireForm, QuestionnaireVO } from '@/api/system/Questionnaire/type';
|
||||
import { addQuestionnaire, getQuestionnaire, updateQuestionnaire } from '@/api/system/Questionnaire';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_questionnaire_scope } = toRefs<any>(proxy?.useDict('com_questionnaire_scope'));
|
||||
@@ -119,14 +118,13 @@ function delteUse(id: string | number) {
|
||||
}
|
||||
// ! 编辑问卷 ------------------------------------------------------------------------
|
||||
const questionnaireEditRef = ref<InstanceType<typeof QuestionnaireEdit>>();
|
||||
const editData = ref<QuestionnaireVO | null>(null);
|
||||
const editData = ref<QuestionComponentnaireForm>(null);
|
||||
|
||||
// ! 路由参数 --------------------------------------------------------------------------------
|
||||
const userid = ref(null);
|
||||
|
||||
if (route.query.id) {
|
||||
userid.value = route.query.id;
|
||||
|
||||
handleEdit(userid.value);
|
||||
} else {
|
||||
handleAdd();
|
||||
@@ -146,9 +144,9 @@ async function handleEdit(id: string | number) {
|
||||
tableData.value = res.rows;
|
||||
// 父组件自己调用接口获取数据
|
||||
getQuestionnaire(id).then((res) => {
|
||||
editData.value = res.data;
|
||||
editData.value.content = JSON.parse(res.data.content);
|
||||
questionnaireEditRef.value?.init(res.data);
|
||||
editData.value = res.data as QuestionComponentnaireForm;
|
||||
editData.value.content = JSON.parse(res.data.content as string);
|
||||
questionnaireEditRef.value?.init(res.data as QuestionComponentnaireForm);
|
||||
form.value = {
|
||||
scope: res.data.scope,
|
||||
residents: res.data.residents,
|
||||
@@ -171,7 +169,7 @@ async function handleEdit(id: string | number) {
|
||||
}
|
||||
|
||||
// 保存草稿
|
||||
async function handleSave(data: QuestionnaireForm) {
|
||||
async function handleSave(data: QuestionComponentnaireForm) {
|
||||
try {
|
||||
// 父组件自己调用接口提交
|
||||
if (userid.value) {
|
||||
@@ -202,7 +200,7 @@ async function handleSave(data: QuestionnaireForm) {
|
||||
}
|
||||
|
||||
// 发布问卷
|
||||
async function handlePublish(data: QuestionnaireForm) {
|
||||
async function handlePublish(data: QuestionComponentnaireForm) {
|
||||
try {
|
||||
if (userid.value) {
|
||||
await updateQuestionnaire({
|
||||
|
||||
@@ -120,6 +120,8 @@ const initFormData: QuestionnaireForm = {
|
||||
status: undefined,
|
||||
scope: undefined,
|
||||
residents: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
const data = reactive<PageData<QuestionnaireForm, QuestionnaireQuery>>({
|
||||
@@ -127,19 +129,10 @@ const data = reactive<PageData<QuestionnaireForm, QuestionnaireQuery>>({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
villageId: undefined,
|
||||
title: undefined,
|
||||
description: undefined,
|
||||
content: undefined,
|
||||
status: undefined,
|
||||
scope: undefined,
|
||||
residents: undefined,
|
||||
params: {}
|
||||
title: undefined
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '问卷ID不能为空', trigger: 'blur' }],
|
||||
title: [{ required: true, message: '问卷标题不能为空', trigger: 'blur' }],
|
||||
content: [{ required: true, message: '问卷题目结构不能为空', trigger: 'blur' }]
|
||||
title: [{ required: true, message: '问卷标题不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<el-col :span="2"></el-col>
|
||||
<el-col :span="11">
|
||||
<el-form-item label="项目类型" prop="projectType">
|
||||
<el-radio-group :disabled="form.projectLevel === '1'" v-model="form.projectType">
|
||||
<el-radio-group :disabled="form.projectLevel === 1" v-model="form.projectType">
|
||||
<el-radio v-for="item in com_repair_project_types" :key="item.id" :value="item.value">{{ item.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
@@ -24,7 +24,7 @@
|
||||
<el-col :span="11">
|
||||
<el-form-item label="项目层级" prop="projectLevel">
|
||||
<el-radio-group v-model="form.projectLevel">
|
||||
<el-radio v-for="item in com_repair_project_level" :key="item.id" :value="item.value">{{ item.label }}</el-radio>
|
||||
<el-radio v-for="item in com_repair_project_level" :key="item.id" :value="Number(item.value)">{{ item.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -37,7 +37,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="form.projectLevel === '1'">
|
||||
<el-row v-if="form.projectLevel === 1">
|
||||
<el-col :span="11">
|
||||
<el-form-item label="隶属父级" prop="email">
|
||||
<el-select @change="handleChange" v-model="form.parentId" placeholder="请选择隶属父级" style="width: 240px">
|
||||
@@ -74,7 +74,7 @@ const form = ref({
|
||||
projectName: null, // 项目名称
|
||||
parentId: '', // 父级项目id
|
||||
projectType: '0', // 项目类型
|
||||
projectLevel: '0', //项目层级
|
||||
projectLevel: 0, //项目层级
|
||||
status: '0' //状态
|
||||
});
|
||||
const rules = ref({
|
||||
@@ -96,6 +96,14 @@ function handleChange(val) {
|
||||
// != ==========================================
|
||||
|
||||
function init() {
|
||||
form.value = {
|
||||
id: null,
|
||||
projectName: null, // 项目名称
|
||||
parentId: '', // 父级项目id
|
||||
projectType: '0', // 项目类型
|
||||
projectLevel: 0, //项目层级
|
||||
status: '0' //状态
|
||||
};
|
||||
listRepairProject().then((res) => {
|
||||
const arr = res.rows.filter((ite) => ite.projectLevel === 0);
|
||||
options.value = arr;
|
||||
@@ -106,7 +114,7 @@ function init() {
|
||||
form.value = {
|
||||
...form.value,
|
||||
...find,
|
||||
projectLevel: String(find.projectLevel)
|
||||
projectLevel: find.projectLevel
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ import { ref } from 'vue';
|
||||
import repairUser from '@/components/Holder/repairUser.vue';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { getRepair, updateRepair } from '@/api/system/Repair';
|
||||
import { convertBuildingToTree, getHousePathById } from '@/utils/house';
|
||||
import { getHousePathById } from '@/utils/house';
|
||||
import { listRepairProject } from '@/api/system/RepairProject';
|
||||
import { listResident } from '@/api/system/resident';
|
||||
import { RepairVO } from '@/api/system/Repair/type';
|
||||
|
||||
@@ -196,6 +196,8 @@ const initFormData: RepairProjectForm = {
|
||||
const data = reactive<PageData<RepairProjectForm, RepairProjectQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectName: undefined,
|
||||
parentId: undefined,
|
||||
projectType: undefined,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -24,40 +24,38 @@
|
||||
</transition>
|
||||
|
||||
<el-card class="flex-1" shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<right-toolbar></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="payRecordListList" @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="loading" border :data="payRecordListList">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="仪表名称" align="center" prop="deviceType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_waterelectricity_topup_type" :value="scope.row.deviceType"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备编号" align="center" prop="deviceCode" />
|
||||
<el-table-column label="房间号" align="center" prop="houseName" />
|
||||
<el-table-column label="仪表名称" align="center" prop="payType" />
|
||||
<el-table-column label="收费项目" align="center" prop="payType">
|
||||
<el-table-column label="收费项目" align="center" prop="payType" width="160">
|
||||
<template #default="scope">
|
||||
<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">
|
||||
<el-table-column label="抄表月份" align="center" prop="recordMonth" width="100">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.recordMonth, '{y}-{m}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间" align="center" prop="startTime" width="180">
|
||||
<el-table-column label="开始时间" align="center" prop="startTime" width="160">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束时间" align="center" prop="endTime" width="180">
|
||||
<el-table-column label="结束时间" align="center" prop="endTime" width="160">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="本期用度" align="center" prop="currentCost" />
|
||||
<el-table-column label="费用合计(元)" align="center" prop="totalCost" />
|
||||
<el-table-column label="设备编号" align="center" prop="deviceCode" />
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<el-table-column label="本期用度" align="center" prop="currentCost" width="160" />
|
||||
<el-table-column label="费用合计(元)" align="center" prop="totalCost" width="120" />
|
||||
<el-table-column label="操作" align="center" width="160" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)">详情</el-button>
|
||||
</template>
|
||||
@@ -148,7 +146,9 @@ import { listPayRecordList, getPayRecordList, delPayRecordList, addPayRecordList
|
||||
import { PayRecordListVO, PayRecordListQuery, PayRecordListForm } from '@/api/system/SdbPayRecordMain/type';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_payrecord_pay_type } = toRefs<any>(proxy?.useDict('com_payrecord_pay_type'));
|
||||
const { com_payrecord_pay_type, com_waterelectricity_topup_type } = toRefs<any>(
|
||||
proxy?.useDict('com_payrecord_pay_type', 'com_waterelectricity_topup_type')
|
||||
);
|
||||
|
||||
const payRecordListList = ref<PayRecordListVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
@@ -159,6 +159,7 @@ const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const payRecordListFormRef = ref<ElFormInstance>();
|
||||
@@ -218,10 +219,18 @@ const deviceCodeList = [
|
||||
];
|
||||
const { queryParams, form } = toRefs(data);
|
||||
|
||||
const queryid = ref('');
|
||||
if (route.query.id) {
|
||||
queryid.value = route.query.id as string;
|
||||
}
|
||||
|
||||
/** 查询抄表周期明细列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listPayRecordList(queryParams.value);
|
||||
const res = await listPayRecordList({
|
||||
...queryParams.value,
|
||||
recordId: queryid.value ?? undefined
|
||||
});
|
||||
payRecordListList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
|
||||
@@ -10,7 +10,13 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="收费项目" prop="chargeItemId">
|
||||
<el-select v-model="form.chargeItemId" @change="handleChange">
|
||||
<el-option v-for="(item, index) in chargeitemlist" :key="index" :value="item.id" :label="item.itemName"></el-option>
|
||||
<el-option
|
||||
:disabled="item.status === '1'"
|
||||
v-for="(item, index) in chargeitemlist"
|
||||
:key="index"
|
||||
:value="item.id"
|
||||
:label="item.itemName"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 水费,电费, 收费范围为 房屋 -->
|
||||
@@ -27,6 +33,7 @@
|
||||
</el-radio-group>
|
||||
<div @click="handleClearCheckout" v-if="form.chargeScope === '1'" class="ml-10px cursor-pointer color-red">清空</div>
|
||||
</el-form-item>
|
||||
<!-- 房屋选择 -->
|
||||
<el-form-item v-if="form.chargeScope === '1' && typeNamelist.includes(typeName)">
|
||||
<div class="residentBox">
|
||||
<ul class="checkoutSideUsesbox">
|
||||
@@ -52,6 +59,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<!-- 业主选择 -->
|
||||
<el-form-item v-if="form.chargeScope === '1' && !typeNamelist.includes(typeName)">
|
||||
<div class="residentBox">
|
||||
<ul class="checkoutSideUsesbox">
|
||||
@@ -113,7 +121,7 @@ import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { listChargeItem } from '@/api/system/SdbChargeItem';
|
||||
import { getBill, updateBill, addBill, BillHouse, listBillHouse, queryResidentList_holder } from '@/api/system/SdbBill';
|
||||
import type { DatePickerType } from 'element-plus';
|
||||
import { formatDate, formatDate2 } from '@/utils';
|
||||
import { formatDate2 } from '@/utils';
|
||||
import { Delete } from '@element-plus/icons-vue';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
@@ -48,8 +48,12 @@
|
||||
<el-table-column label="账单名称" align="center" prop="billName" />
|
||||
<el-table-column label="收费范围" align="center" prop="chargeScope" width="100">
|
||||
<template #default="scope">
|
||||
<!-- TODO 收费类型来判断收费范围 -->
|
||||
<dict-tag :options="com_bill_charge_scope_house" :value="scope.row.chargeScope"></dict-tag>
|
||||
<template v-if="ShowHouselist.includes(scope.row.chargeTypeId)">
|
||||
<dict-tag :options="com_bill_charge_scope_house" :value="scope.row.chargeScope"></dict-tag>
|
||||
</template>
|
||||
<template v-else>
|
||||
<dict-tag :options="com_questionnaire_scope" :value="scope.row.chargeScope"></dict-tag>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收费项目" align="center" prop="chargeItemName" />
|
||||
@@ -68,7 +72,7 @@
|
||||
<template #default="scope">
|
||||
<div class="flex justify-center">
|
||||
<span>{{ scope.row.fixedPrice }}</span> /
|
||||
<dict-tag :options="com_charge_item_unit" value="0"></dict-tag>
|
||||
<dict-tag :options="com_charge_item_unit" :value="scope.row.unit"></dict-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -97,7 +101,7 @@ import { checkPermi } from '@/utils/permission';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_bill_search_filter } = toRefs<any>(proxy?.useDict('com_bill_search_filter'));
|
||||
const { com_questionnaire_scope } = toRefs<any>(proxy?.useDict('com_questionnaire_scope'));
|
||||
const { com_bill_charge_period } = toRefs<any>(proxy?.useDict('com_bill_charge_period'));
|
||||
// const { com_bill_charge_period } = toRefs<any>(proxy?.useDict('com_bill_charge_period'));
|
||||
const { com_bill_charge_scope_house } = toRefs<any>(proxy?.useDict('com_bill_charge_scope_house'));
|
||||
const { com_charge_item_unit } = toRefs<any>(proxy?.useDict('com_charge_item_unit'));
|
||||
|
||||
@@ -118,6 +122,8 @@ const dialog = reactive<DialogOption>({
|
||||
title: ''
|
||||
});
|
||||
|
||||
const ShowHouselist = ['2049026484272791553'];
|
||||
|
||||
const initFormData: BillForm = {
|
||||
id: undefined,
|
||||
billCode: undefined,
|
||||
@@ -135,9 +141,10 @@ const data = reactive<PageData<BillForm, BillQuery>>({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
billCode: '',
|
||||
type: '',
|
||||
value: ''
|
||||
chargeItemId: '',
|
||||
billCode: ''
|
||||
// type: '',
|
||||
// value: ''
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -22,17 +22,17 @@
|
||||
<div v-else-if="scope.row.chargeTypeName === '电费' || scope.row.chargeTypeName === '水费'">{{ scope.row.houseName }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="收费项目">
|
||||
<el-table-column align="center" label="收费项目" width="250">
|
||||
<template #default="scope">
|
||||
<div>{{ scope.row.chargeItemName }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="收费周期">
|
||||
<el-table-column align="center" label="收费周期" width="300">
|
||||
<template #default="scope">
|
||||
<div>{{ scope.row.startDate }} -- {{ scope.row.endDate }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="单价">
|
||||
<el-table-column align="center" label="单价" width="150">
|
||||
<template #default="scope">
|
||||
<div>{{ scope.row.fixedPrice }}</div>
|
||||
</template>
|
||||
@@ -42,13 +42,13 @@
|
||||
<div>{{ scope.row.formula }}</div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column align="center" label="缴费状态">
|
||||
<el-table-column align="center" label="缴费状态" width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag v-if="!inglelist.includes(scope.row.chargeItemName)" :options="com_pay_status" :value="scope.row.payStatus"></dict-tag>
|
||||
<div v-else>--</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="应缴金额">
|
||||
<el-table-column align="center" label="应缴金额" width="120">
|
||||
<template #default="scope">
|
||||
<div v-if="!inglelist.includes(scope.row.chargeItemName)">{{ scope.row.money ?? '--' }}</div>
|
||||
<div v-else>--</div>
|
||||
@@ -67,7 +67,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<span>账单名称: </span>
|
||||
<span style="text-wrap: wrap; text-indent: 2rem">{{ from.billResidentId.join('、 ') }}</span>
|
||||
<span style="text-wrap: wrap; text-indent: 2rem">{{ from.billResidentId.map((item) => item.chargeItemName).join('、 ') }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span>应收合计:¥{{ from.allCost }}</span>
|
||||
@@ -157,11 +157,8 @@ const getList = () => {
|
||||
};
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: billlistType[]) => {
|
||||
// TODO: 获取选中的id
|
||||
ids.value = [];
|
||||
ids.value = selection;
|
||||
console.log(ids.value);
|
||||
console.log(selection);
|
||||
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
@@ -189,15 +186,20 @@ const from = ref({
|
||||
});
|
||||
|
||||
const openDiage = () => {
|
||||
if (!ids.value.length) {
|
||||
ElMessage.warning('请至少选择一条账单进行收款');
|
||||
return;
|
||||
}
|
||||
from.value = {
|
||||
allCost: 0,
|
||||
payStatus: '0',
|
||||
billResidentId: ['202505电费', '202505水费'],
|
||||
billResidentId: [],
|
||||
payType: '0',
|
||||
remark: ''
|
||||
};
|
||||
// 计算金额
|
||||
console.log(ids.value);
|
||||
ids.value.forEach((item) => {
|
||||
from.value.billResidentId.push(item);
|
||||
from.value.allCost += Number(item.money);
|
||||
});
|
||||
dialog.visible = true;
|
||||
|
||||
@@ -132,6 +132,7 @@ const queryParams = ref({
|
||||
pageSize: 10
|
||||
});
|
||||
const tabledata = ref([]);
|
||||
// 支付状态 0未缴纳 1已缴纳 2缴纳失败
|
||||
const getList = () => {
|
||||
billQuery({
|
||||
residentId: props.query.residentId,
|
||||
@@ -144,7 +145,6 @@ const getList = () => {
|
||||
};
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: billlistType[]) => {
|
||||
// TODO: 获取选中的id
|
||||
ids.value = selection.map((item) => item.residentId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="searchBox">
|
||||
<el-input v-model="searchValue" @keyup.enter="getlist">
|
||||
<el-input clearable v-model="searchValue" @keyup.enter="getlist">
|
||||
<template #suffix>
|
||||
<el-icon @click="getlist" class="cursor-pointer">
|
||||
<Search></Search>
|
||||
@@ -21,16 +21,19 @@
|
||||
</template>
|
||||
</el-input>
|
||||
|
||||
<div class="listbox" v-if="list.length">
|
||||
<div class="listbox" v-if="onceSearch || Searching">
|
||||
<div class="list_item">
|
||||
<div class="title">
|
||||
<DictTag :options="com_cashier_type" :value="searchType"></DictTag>
|
||||
<DictTag :options="com_cashier_type" :value="LazysearchType"></DictTag>
|
||||
</div>
|
||||
<div class="list_body">
|
||||
<div class="list_body" v-loading="Searching" v-if="list.length > 0 || Searching">
|
||||
<div class="list_value" @click="searchclick(item)" v-for="(item, index) in list" :key="index">
|
||||
{{ item.houseName }}-{{ item.residentName }}-{{ item.phone }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="flex h-full items-center justify-center">
|
||||
<span class="noData">暂无数据</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -58,25 +61,30 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
// TODO 收银台
|
||||
// TODO 历史缴费
|
||||
// TODO 添加临时收费
|
||||
// TODO 预存
|
||||
// TODO 缴费
|
||||
import { Search } from '@element-plus/icons-vue';
|
||||
import { Component, DefineComponent, ref } from 'vue';
|
||||
import { Component, ref } from 'vue';
|
||||
|
||||
import cashier from './cashier.vue';
|
||||
import history from './history.vue';
|
||||
import { debounce } from '@/utils';
|
||||
import { cashQuery } from '@/api/system/SdbCashier';
|
||||
|
||||
/** 当前状态 搜索后 搜索前 */
|
||||
const isSearch = ref(true);
|
||||
/** 为了loading 搜索结果 添加防抖 */
|
||||
const Searching = ref(false);
|
||||
const onceSearch = ref(false);
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_cashier_type } = toRefs<any>(proxy?.useDict('com_cashier_type'));
|
||||
console.log(com_cashier_type);
|
||||
/** 房屋 住户 车辆 车位 */
|
||||
const com_cashier_type_list = ref(['houseName', 'residentName']);
|
||||
const searchform = ref();
|
||||
const searchValue = ref('');
|
||||
const searchType = ref('residentName');
|
||||
const searchType = ref('houseName');
|
||||
const LazysearchType = ref('');
|
||||
function handleChangeSearchType() {
|
||||
list.value = [];
|
||||
searchValue.value = '';
|
||||
@@ -126,13 +134,46 @@ function handleChecout(index: TabValue) {
|
||||
}
|
||||
|
||||
// ! ===================================================================================
|
||||
// 用于追踪最新请求的标识
|
||||
let latestRequestId = 0;
|
||||
function getlist() {
|
||||
console.log('search2');
|
||||
// 生成当前请求的唯一ID
|
||||
const currentRequestId = ++latestRequestId;
|
||||
const currenttime = Date.now();
|
||||
|
||||
Searching.value = true;
|
||||
searchform.value = {};
|
||||
searchform.value[searchType.value] = searchValue.value;
|
||||
cashQuery(searchform.value).then((res) => {
|
||||
list.value = res.data;
|
||||
});
|
||||
|
||||
let lastdata = [];
|
||||
cashQuery(searchform.value)
|
||||
.then((res) => {
|
||||
// 检查是否是最新的请求,防止竞态条件
|
||||
if (currentRequestId === latestRequestId) {
|
||||
lastdata = res.data;
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
if (currentRequestId === latestRequestId) {
|
||||
LazysearchType.value = searchType.value;
|
||||
onceSearch.value = true;
|
||||
// 计算已过去的时间
|
||||
const elapsedTime = Date.now() - currenttime;
|
||||
const minLoadingTime = 300;
|
||||
if (elapsedTime < minLoadingTime) {
|
||||
setTimeout(() => {
|
||||
// 再次检查,防止在等待期间发起了新请求
|
||||
if (currentRequestId === latestRequestId) {
|
||||
list.value = lastdata;
|
||||
Searching.value = false;
|
||||
}
|
||||
}, minLoadingTime - elapsedTime);
|
||||
} else {
|
||||
list.value = lastdata;
|
||||
Searching.value = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// ! ===================================================================================
|
||||
const handleBack = () => {
|
||||
@@ -142,6 +183,9 @@ const handleBack = () => {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.noData {
|
||||
color: #999999;
|
||||
}
|
||||
.tabsbox {
|
||||
height: 60px;
|
||||
background-color: #fff;
|
||||
@@ -203,11 +247,15 @@ const handleBack = () => {
|
||||
}
|
||||
|
||||
.listbox {
|
||||
border: 1px solid #ccc;
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
min-height: 200px;
|
||||
font-size: 16px;
|
||||
margin-top: -2px;
|
||||
box-sizing: border-box;
|
||||
border-radius: 0px 0px 5px 5px;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
color: rgba(16, 16, 16, 1);
|
||||
box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.1);
|
||||
|
||||
.list_item {
|
||||
padding-bottom: 30px;
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<el-table-column label="设备编码" width="250" align="center" prop="deviceCode" />
|
||||
<el-table-column label="设备状态" width="100" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<div class="readRecord" v-if="scope.row.status">
|
||||
<div class="readRecord" v-if="scope.row.status !== null">
|
||||
<DictTag :options="com_waterdevice_on_status" :value="scope.row.status"></DictTag>
|
||||
</div>
|
||||
<span v-else>---</span>
|
||||
@@ -121,32 +121,31 @@
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<el-table-column min-width="120" label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-row>
|
||||
<el-col :span="24" class="flex flex-items-center actions">
|
||||
<el-button link type="primary" @click="handleRecode(scope.row)" v-hasPermi="['equipment:view:electricitydevice']">充值记录</el-button>
|
||||
<el-button link type="primary" @click="handleQrCode(scope.row)" v-hasPermi="['equipment:addqrcode:electricitydevice']"
|
||||
>生成条码</el-button
|
||||
>
|
||||
<el-button link type="primary" @click="handleOpenDialog('usedWater', scope.row)" v-hasPermi="['equipment:useWater:electricitydevice']"
|
||||
>用水量</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="handleOpenDialog('Upload', scope.row)"
|
||||
v-hasPermi="['equipment:updatehardware:electricitydevice']"
|
||||
>更新固件</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="handleOpenDialog('UpdateHouse', scope.row)"
|
||||
v-hasPermi="['equipment:edithouse:electricitydevice']"
|
||||
>绑定房屋</el-button
|
||||
>
|
||||
<!-- <el-dropdown style="vertical-align: text-top">
|
||||
<div class="actions">
|
||||
<el-button link type="primary" @click="handleRecode(scope.row)" v-hasPermi="['equipment:view:electricitydevice']">充值记录</el-button>
|
||||
<el-button link type="primary" @click="handleQrCode(scope.row)" v-hasPermi="['equipment:addqrcode:electricitydevice']"
|
||||
>生成条码</el-button
|
||||
>
|
||||
<el-button link type="primary" @click="handleOpenDialog('usedWater', scope.row)" v-hasPermi="['equipment:useWater:electricitydevice']"
|
||||
>用电量</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="handleOpenDialog('Upload', scope.row)"
|
||||
v-hasPermi="['equipment:updatehardware:electricitydevice']"
|
||||
>更新固件</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="handleOpenDialog('UpdateHouse', scope.row)"
|
||||
v-hasPermi="['equipment:edithouse:electricitydevice']"
|
||||
>绑定房屋</el-button
|
||||
>
|
||||
<!-- <el-dropdown style="vertical-align: text-top">
|
||||
<el-button link type="primary">
|
||||
<div>
|
||||
更多<el-icon><arrow-down /></el-icon>
|
||||
@@ -166,8 +165,7 @@
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -180,19 +178,21 @@
|
||||
<el-form-item label="设备编号" prop="deviceCode"> {{ UsedWaterform.deviceCode }} </el-form-item>
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker
|
||||
format="YYYY-MM-DD HH:MM:ss"
|
||||
value-format="YYYY-MM-DD HH:MM:ss"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
v-model="UsedWaterform.startTime"
|
||||
type="datetime"
|
||||
@update:model-value="handleStarTime"
|
||||
placeholder="开始时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-date-picker
|
||||
format="YYYY-MM-DD HH:MM:ss"
|
||||
value-format="YYYY-MM-DD HH:MM:ss"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
v-model="UsedWaterform.endTime"
|
||||
type="datetime"
|
||||
@update:model-value="handleEndTime"
|
||||
placeholder="结束时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -326,6 +326,26 @@ const rules = {
|
||||
startTime: [{ required: true, message: '请选择开始时间', trigger: 'blur' }],
|
||||
endTime: [{ required: true, message: '请选择结束时间', trigger: 'blur' }]
|
||||
};
|
||||
function handleStarTime(val: string) {
|
||||
if (!val) return;
|
||||
const current = new Date(val).getTime();
|
||||
if (UsedWaterform.value.endTime && UsedWaterform.value.startTime) {
|
||||
if (current > new Date(UsedWaterform.value.endTime).getTime()) {
|
||||
UsedWaterform.value.endTime = '';
|
||||
ElMessage.warning('开始时间不能大于结束时间');
|
||||
}
|
||||
}
|
||||
}
|
||||
function handleEndTime(val: string) {
|
||||
if (!val) return;
|
||||
const current = new Date(val).getTime();
|
||||
if (UsedWaterform.value.startTime && UsedWaterform.value.endTime) {
|
||||
if (current < new Date(UsedWaterform.value.startTime).getTime()) {
|
||||
UsedWaterform.value.startTime = '';
|
||||
ElMessage.warning('结束时间不能小于开始时间');
|
||||
}
|
||||
}
|
||||
}
|
||||
// ! =======================================================================================
|
||||
|
||||
// ? 上传固件 ==============================================================================================
|
||||
@@ -464,7 +484,7 @@ function getTree() {
|
||||
}
|
||||
|
||||
/** 电表 启停*/
|
||||
// TODO 修改水电表 启停
|
||||
// TODO 修改电表 启停
|
||||
const handleChangeWater = (val: string, row: ElectricityDeviceVO) => {};
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
@@ -579,9 +599,18 @@ const download = (url: string) => {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.actions {
|
||||
:deep(.el-button + .el-button) {
|
||||
margin-left: 0;
|
||||
}
|
||||
:deep(.el-button > span) {
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
@media (max-width: 1500px) {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
:deep(.waterDevice_online) {
|
||||
color: #3dd4a7;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<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" label-width="100px" @submit.prevent="handleQuery" :model="queryParams" :inline="true">
|
||||
<el-form ref="queryFormRef" label-width="70px" @submit.prevent="handleQuery" :model="queryParams" :inline="true">
|
||||
<!-- <el-form-item label="设备状态" prop="eleStatus">
|
||||
<el-select v-model="queryParams.eleStatus">
|
||||
<el-option v-for="(item, index) in com_waterdevice_on_status" :key="index" :label="item.label" :value="item.value"></el-option>
|
||||
@@ -15,8 +15,11 @@
|
||||
<el-option v-for="(item, index) in com_water_readrecord_status" :key="index" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="设备编号" prop="deviceCode">
|
||||
<el-input v-model="queryParams.deviceCode" placeholder="请输入" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="房屋" prop="houseName">
|
||||
<el-input v-model="queryParams.houseName" placeholder="请输入" clearable />
|
||||
<el-input clearable v-model="queryParams.houseName" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleQuery">搜索</el-button>
|
||||
@@ -38,6 +41,9 @@
|
||||
<el-dropdown-item @click="handleMarkqrcode" v-if="checkPermi(['equipment:addqrcode:waterdevice'])">
|
||||
<span>批量生成条形码</span>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click="handleMarkQrcodeZip">
|
||||
<span>批量下载条形码</span>
|
||||
</el-dropdown-item>
|
||||
<!-- <el-dropdown-item v-hasPermi="['equipment:addqrcode:electricitydevice']">
|
||||
<div @click="handleMarkqrcode">批量更新固件</div>
|
||||
</el-dropdown-item> -->
|
||||
@@ -51,13 +57,14 @@
|
||||
<el-table-column label="设备编码" width="250" align="center" prop="deviceCode" />
|
||||
<el-table-column label="设备状态" width="100" align="center" prop="eleStatus">
|
||||
<template #default="scope">
|
||||
<dict-tag v-if="scope.row.waterRecord" :options="com_waterdevice_on_status" :value="scope.row.waterRecord.eleStatus"></dict-tag>
|
||||
<!-- 1 离线 0在线 -->
|
||||
<dict-tag v-if="scope.row.waterRecord" :options="com_waterdevice_on_status" :value="Number(scope.row.status)"></dict-tag>
|
||||
<span v-else>---</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分合状态" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<dict-tag v-if="scope.row.status" :options="com_water_readrecord_status" :value="scope.row.waterRecord.status"></dict-tag>
|
||||
<dict-tag v-if="scope.row.status !== null" :options="com_water_readrecord_status" :value="scope.row.waterRecord.status"></dict-tag>
|
||||
<span v-else>---</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -102,29 +109,30 @@
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<el-table-column label="操作" min-width="120" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-row>
|
||||
<el-col :span="24" class="flex flex-items-center actions">
|
||||
<el-button link type="primary" @click="handleRecode(scope.row)" v-hasPermi="['equipment:view:waterdevice']">充值记录</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
:loading="loadingQRCode.includes(scope.row.id)"
|
||||
@click="handleQrCode(scope.row)"
|
||||
v-hasPermi="['equipment:addqrcode:waterdevice']"
|
||||
>生成条码</el-button
|
||||
>
|
||||
<el-button link type="primary" @click="handleOpenDialog('usedWater', scope.row)" v-hasPermi="['equipment:useWater:waterdevice']"
|
||||
>用水量</el-button
|
||||
>
|
||||
<el-button link type="primary" @click="handleOpenDialog('Upload', scope.row)" v-hasPermi="['equipment:updatehardware:waterdevice']"
|
||||
>更新固件</el-button
|
||||
>
|
||||
<el-button link type="primary" @click="handleOpenDialog('UpdateHouse', scope.row)" v-hasPermi="['equipment:edithouse:waterdevice']"
|
||||
>绑定房屋</el-button
|
||||
>
|
||||
<!-- <el-dropdown style="vertical-align: text-top">
|
||||
<div class="actions">
|
||||
<el-button link type="primary" @click="handleRecode(scope.row)" v-hasPermi="['equipment:view:waterdevice']">充值记录</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
:loading="loadingQRCode.includes(scope.row.id)"
|
||||
@click="handleQrCode(scope.row)"
|
||||
v-hasPermi="['equipment:addqrcode:waterdevice']"
|
||||
>生成条码</el-button
|
||||
>
|
||||
<el-button link type="primary" @click="handleOpenDialog('usedWater', scope.row)" v-hasPermi="['equipment:useWater:waterdevice']"
|
||||
>用水量</el-button
|
||||
>
|
||||
<el-button link type="primary" @click="handleOpenDialog('Upload', scope.row)" v-hasPermi="['equipment:updatehardware:waterdevice']"
|
||||
>更新固件</el-button
|
||||
>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row.deviceCode)">最新抄表记录</el-button>
|
||||
|
||||
<el-button link type="primary" @click="handleOpenDialog('UpdateHouse', scope.row)" v-hasPermi="['equipment:edithouse:waterdevice']"
|
||||
>绑定房屋</el-button
|
||||
>
|
||||
<!-- <el-dropdown style="vertical-align: text-top">
|
||||
<el-button link type="primary">
|
||||
<div>
|
||||
更多<el-icon><arrow-down /></el-icon>
|
||||
@@ -144,13 +152,19 @@
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</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" />
|
||||
<pagination
|
||||
:pageSizes="[10, 30, 50, 100]"
|
||||
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>
|
||||
@@ -163,6 +177,7 @@
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
v-model="UsedWaterform.startTime"
|
||||
type="datetime"
|
||||
@update:model-value="handleStarTime"
|
||||
placeholder="开始时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -172,6 +187,7 @@
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
v-model="UsedWaterform.endTime"
|
||||
type="datetime"
|
||||
@update:model-value="handleEndTime"
|
||||
placeholder="结束时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -251,6 +267,19 @@
|
||||
<div class="useditem">用水量</div>
|
||||
<div class="useditem value">{{ UsedWaterInfo.count }}</div>
|
||||
</div>
|
||||
|
||||
<el-form v-if="dialogType === 'deviceLastRecord'" ref="deviceLastRecordformRef" :model="EditHouseform" label-width="100px">
|
||||
<el-form-item label="设备编号" prop="deviceCode"> {{ deviceLastRecordform.deviceCode }} </el-form-item>
|
||||
<el-form-item label="读表时间" prop="readTime"> {{ deviceLastRecordform.readTime }} </el-form-item>
|
||||
<el-form-item label="阀门状态" prop="status">
|
||||
<DictTag :options="com_water_readrecord_status" :value="deviceLastRecordform.status"></DictTag>
|
||||
</el-form-item>
|
||||
<el-form-item label="余额" prop="balance"> {{ deviceLastRecordform.balance }} </el-form-item>
|
||||
<el-form-item label="用水量" prop="totalWater"> {{ deviceLastRecordform.totalWater }} </el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="unSubmit">关闭</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@@ -262,18 +291,17 @@ import {
|
||||
getWaterDeviceTimeRangeUsedWater,
|
||||
WaterDeviceMakerQrcode,
|
||||
updateWaterDevice,
|
||||
WaterDeviceUpdateBin
|
||||
WaterDeviceUpdateBin,
|
||||
latestRecord
|
||||
} from '@/api/system/SdbWaterDevice/index';
|
||||
import { WaterDeviceVO, WaterDeviceQuery, WaterDeviceForm } from '@/api/system/SdbWaterDevice/type';
|
||||
import { WaterDeviceVO } from '@/api/system/SdbWaterDevice/type';
|
||||
import { useHouseStore } from '@/store/modules/house';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { getHousePathById } from '@/utils/house';
|
||||
import { Upload } from '@element-plus/icons-vue';
|
||||
import { CascaderValue, tourEmits, UploadProps, UploadRawFile } from 'element-plus';
|
||||
import { formatDate } from '@/utils/time';
|
||||
import { CascaderValue, UploadProps, UploadRawFile } from 'element-plus';
|
||||
import { checkPermi } from '@/utils/permission';
|
||||
import { exportImagesToZip } from '@/utils/exportZip';
|
||||
|
||||
const huhao = 3096371295;
|
||||
const uploadAUrl = import.meta.env.VITE_APP_BASE_API + '/waterDevice/uploadA';
|
||||
const uploadBUrl = import.meta.env.VITE_APP_BASE_API + '/waterDevice/uploadB';
|
||||
|
||||
@@ -285,7 +313,7 @@ const waterDeviceList = ref<WaterDeviceVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<{ id: string; deviceCode: string }[]>([]);
|
||||
const ids = ref<WaterDeviceVO[]>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
@@ -303,19 +331,21 @@ const data = reactive({
|
||||
pageSize: 10,
|
||||
eleStatus: '',
|
||||
houseName: '',
|
||||
status: ''
|
||||
status: '',
|
||||
deviceCode: ''
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams } = toRefs(data);
|
||||
|
||||
/** 查询水 设备列表 */
|
||||
const getList = async () => {
|
||||
const getList = async (callback?: (vals: WaterDeviceVO[]) => void) => {
|
||||
loading.value = true;
|
||||
const res = await listWaterDevice(queryParams.value);
|
||||
waterDeviceList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
callback && callback(waterDeviceList.value);
|
||||
};
|
||||
// ! 用水量 =============================================================================
|
||||
const usedWaterInfo = ref(true);
|
||||
@@ -325,6 +355,27 @@ const UsedWaterform = ref({
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
});
|
||||
function handleStarTime(val: string) {
|
||||
if (!val) return;
|
||||
const current = new Date(val).getTime();
|
||||
if (UsedWaterform.value.endTime && UsedWaterform.value.startTime) {
|
||||
if (current > new Date(UsedWaterform.value.endTime).getTime()) {
|
||||
UsedWaterform.value.endTime = '';
|
||||
ElMessage.warning('开始时间不能大于结束时间');
|
||||
}
|
||||
}
|
||||
}
|
||||
function handleEndTime(val: string) {
|
||||
if (!val) return;
|
||||
const current = new Date(val).getTime();
|
||||
if (UsedWaterform.value.startTime && UsedWaterform.value.endTime) {
|
||||
if (current < new Date(UsedWaterform.value.startTime).getTime()) {
|
||||
UsedWaterform.value.startTime = '';
|
||||
ElMessage.warning('结束时间不能小于开始时间');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const UsedWaterInfo = ref({
|
||||
count: '',
|
||||
startTime: '',
|
||||
@@ -334,6 +385,7 @@ const rules = {
|
||||
startTime: [{ required: true, message: '请选择开始时间', trigger: 'blur' }],
|
||||
endTime: [{ required: true, message: '请选择结束时间', trigger: 'blur' }]
|
||||
};
|
||||
|
||||
// ! =======================================================================================
|
||||
|
||||
// ? 上传固件 ==============================================================================================
|
||||
@@ -395,7 +447,19 @@ const EditHouseform = ref({
|
||||
houseId: ''
|
||||
});
|
||||
// * 编辑房屋 ==============================================================================================
|
||||
const deviceLastRecordformRef = ref(null);
|
||||
const deviceLastRecordform = ref({
|
||||
id: '',
|
||||
deviceCode: '',
|
||||
balance: '',
|
||||
eleStatus: '',
|
||||
readTime: '',
|
||||
status: '',
|
||||
totalWater: '',
|
||||
type: ''
|
||||
});
|
||||
|
||||
const imageRefs = ref([]);
|
||||
/** 批量生成 条形码 */
|
||||
function handleMarkqrcode() {
|
||||
if (ids.value.length > 0) {
|
||||
@@ -407,13 +471,33 @@ function handleMarkqrcode() {
|
||||
ElMessage.warning('请选择设备');
|
||||
}
|
||||
}
|
||||
|
||||
function handleMarkQrcodeZip() {
|
||||
if (ids.value.length > 0) {
|
||||
const selectedIds = new Set(ids.value.map((item) => item.id));
|
||||
const matchedList = waterDeviceList.value.filter((item) => {
|
||||
return selectedIds.has(item.id) && item.url;
|
||||
});
|
||||
produceQRzip(matchedList);
|
||||
} else {
|
||||
ElMessage.warning('请选择设备');
|
||||
}
|
||||
}
|
||||
|
||||
function produceQRzip(vals: WaterDeviceVO[]) {
|
||||
const arr = vals.map((item) => {
|
||||
return {
|
||||
name: item.deviceCode,
|
||||
url: item.url
|
||||
};
|
||||
});
|
||||
exportImagesToZip(arr);
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: WaterDeviceVO[]) => {
|
||||
ids.value = selection.map((item) => {
|
||||
return {
|
||||
id: item.id,
|
||||
deviceCode: item.deviceCode
|
||||
};
|
||||
return item;
|
||||
});
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
@@ -430,11 +514,14 @@ const handleQrCode = (row: WaterDeviceVO) => {
|
||||
id: row.id,
|
||||
deviceCode: row.deviceCode
|
||||
}
|
||||
]).then(() => {
|
||||
ElMessage.success('生成成功');
|
||||
loadingQRCode.value = loadingQRCode.value.filter((item) => item !== row.id);
|
||||
getList();
|
||||
});
|
||||
])
|
||||
.then(() => {
|
||||
ElMessage.success('生成成功');
|
||||
getList();
|
||||
})
|
||||
.finally(() => {
|
||||
loadingQRCode.value = loadingQRCode.value.filter((item) => item !== row.id);
|
||||
});
|
||||
}, 1000);
|
||||
};
|
||||
// * house
|
||||
@@ -446,26 +533,31 @@ function handleChange(val: CascaderValue) {
|
||||
EditHouseform.value.houseId = val[2];
|
||||
}
|
||||
// * house
|
||||
const dialogType = ref<'usedWater' | 'Upload' | 'UpdateHouse'>('usedWater');
|
||||
const dialogType = ref<'usedWater' | 'Upload' | 'UpdateHouse' | 'deviceLastRecord'>('usedWater');
|
||||
/** 用水量 更新固件 编辑房屋*/
|
||||
const handleOpenDialog = (type: 'usedWater' | 'Upload' | 'UpdateHouse', row: WaterDeviceVO) => {
|
||||
const handleOpenDialog = (type: 'usedWater' | 'Upload' | 'UpdateHouse' | 'deviceLastRecord', row?: WaterDeviceVO) => {
|
||||
reset();
|
||||
if (type === 'usedWater') {
|
||||
UsedWaterform.value.deviceCode = row.deviceCode;
|
||||
UsedWaterform.value.startTime = '';
|
||||
UsedWaterform.value.endTime = '';
|
||||
usedWaterInfo.value = true;
|
||||
dialog.title = '用水量查询';
|
||||
} else if (type === 'Upload') {
|
||||
UploadFileform.value.deviceCodes = [row.deviceCode];
|
||||
dialog.title = '固件上传';
|
||||
} else if (type === 'UpdateHouse') {
|
||||
EditHouseform.value.id = row.id;
|
||||
EditHouseform.value.deviceCode = row.deviceCode;
|
||||
EditHouseform.value.houseId = '';
|
||||
dialog.title = '编辑户号';
|
||||
getTree();
|
||||
} else if (type === 'deviceLastRecord') {
|
||||
// 处理设备最后记录的逻辑
|
||||
dialog.title = '设备最新抄表记录';
|
||||
}
|
||||
dialog.visible = true;
|
||||
dialogType.value = type;
|
||||
dialog.title = type === 'usedWater' ? '用水量查询' : type === 'UpdateHouse' ? '编辑户号' : '更新固件';
|
||||
};
|
||||
|
||||
function getTree() {
|
||||
@@ -479,6 +571,26 @@ function getTree() {
|
||||
/** 水表 启停*/
|
||||
const handleChangeWater = (val: string, row: WaterDeviceVO) => {};
|
||||
|
||||
function handleUpdate(id: string) {
|
||||
latestRecord(id).then((res) => {
|
||||
console.log('设备最新抄表记录', res);
|
||||
deviceLastRecordform.value = {
|
||||
id: '',
|
||||
deviceCode: '',
|
||||
balance: '',
|
||||
eleStatus: '',
|
||||
readTime: '',
|
||||
status: '',
|
||||
totalWater: '',
|
||||
type: ''
|
||||
};
|
||||
deviceLastRecordform.value = {
|
||||
...res.data
|
||||
};
|
||||
handleOpenDialog('deviceLastRecord');
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
if (dialogType.value === 'usedWater') {
|
||||
|
||||
@@ -25,8 +25,9 @@
|
||||
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-form-item label="车牌号" prop="carNum">
|
||||
<el-input v-model.trim="form.carNum" placeholder="请输入车牌号" />
|
||||
<el-form-item label="车牌号" prop="carNum" :validate-event="false">
|
||||
<!-- <el-input v-model.trim="form.carNum" placeholder="请输入车牌号" /> -->
|
||||
<LicensePlateInput ref="carNumInputRef" required v-model="form.carNum" @change="() => handleValidate()" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="2"></el-col>
|
||||
@@ -79,7 +80,7 @@
|
||||
<el-col :span="24">
|
||||
<el-form-item label="持有人">
|
||||
<!-- 公共组件 持有人 -->
|
||||
<Holder :userid="form.residentId" @change="handleChange"></Holder>
|
||||
<Holder :userid="form.residentId ?? ''" @change="handleChange"></Holder>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -102,6 +103,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import LicensePlateInput from '@/components/LicensePlateInput/index.vue';
|
||||
import Holder from '@/components/Holder/index.vue';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { listArea } from '@/api/system/carArea';
|
||||
@@ -109,7 +111,7 @@ import { listParking } from '@/api/system/parking';
|
||||
import { UploadFiles, UploadProps, UploadRawFile, UploadUserFile } from 'element-plus';
|
||||
import { addCar, getCar, updateCar, uploadCar } from '@/api/system/cars';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { validator } from '@/utils/Reg';
|
||||
import { LicensePlateValidator, validator } from '@/utils/Reg';
|
||||
|
||||
const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/car/uploadImage';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
@@ -117,10 +119,11 @@ const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const formRef = ref();
|
||||
const carNumInputRef = ref();
|
||||
const form = ref({
|
||||
id: null,
|
||||
areaId: null, // 区域id
|
||||
residentId: null, // 车位id
|
||||
residentId: '', // 车位id
|
||||
parkingId: null, // 持有人id
|
||||
carNum: '', //车牌号
|
||||
carBrand: '', //车辆品牌
|
||||
@@ -134,15 +137,31 @@ const rules = ref({
|
||||
areaId: [{ required: true, message: '请选择区域', trigger: 'blur' }],
|
||||
residentId: [{ required: true, message: '请选择', trigger: 'blur' }],
|
||||
carNum: [
|
||||
{ required: true, message: '请输入车牌号', trigger: 'blur' },
|
||||
{
|
||||
validator: (_, value) => validator(value, 'PlateNumber'),
|
||||
message: '请请输入车牌号',
|
||||
trigger: 'blur'
|
||||
required: true,
|
||||
message: '请输入车牌号码',
|
||||
trigger: ['blur']
|
||||
},
|
||||
{
|
||||
validator: (rule: any, value: string, callback: any) => {
|
||||
if (!value) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
if (!LicensePlateValidator.isValidPlate(value)) {
|
||||
callback(new Error('请输入正确的车牌号格式'));
|
||||
return;
|
||||
}
|
||||
callback();
|
||||
},
|
||||
trigger: 'blur' // ✅ 只在失焦时验证
|
||||
}
|
||||
],
|
||||
carBrand: [{ required: true, message: '请输入车辆品牌', trigger: 'blur' }]
|
||||
});
|
||||
function handleValidate() {
|
||||
formRef.value.validateField('carNum');
|
||||
}
|
||||
function headerToken() {
|
||||
const useStore = useUserStore();
|
||||
return {
|
||||
@@ -204,6 +223,12 @@ function changeArealist(val: string) {
|
||||
// !== 提交 =============================================================================
|
||||
// 提交
|
||||
const submitForm = () => {
|
||||
const plateResult = carNumInputRef.value.validate();
|
||||
if (!plateResult.valid) {
|
||||
// 自动聚焦到错误字段
|
||||
carNumInputRef.value.focus();
|
||||
return;
|
||||
}
|
||||
formRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
if (userid.value.trim() !== '') {
|
||||
|
||||
@@ -60,12 +60,8 @@
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<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="['car:car:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['car:car:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['car:car:edit']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['car:car:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -138,8 +134,9 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 持有人 */
|
||||
const ResidentList = ref([]);
|
||||
const getResidentName = (id: string | number) => {
|
||||
const find = ResidentList.value.find((item) => item.id == id);
|
||||
const getResidentName = (id: string) => {
|
||||
const find = ResidentList.value.find((item) => item.id === id);
|
||||
if (!find) return '--';
|
||||
return find.name;
|
||||
};
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ const ids = ref<Array<number | string>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const dateRange = ref<[DateModelType, DateModelType]>(['', '']);
|
||||
const dateRange = ref<[string, string]>(['', '']);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const configFormRef = ref<ElFormInstance>();
|
||||
|
||||
@@ -215,12 +215,14 @@
|
||||
</el-form-item>
|
||||
<el-form-item prop="dictType">
|
||||
<el-input v-model="typeForm.dictType" placeholder="请输入字典类型" maxlength="100" />
|
||||
<span slot="label">
|
||||
<el-tooltip content="数据存储中的Key值,如:sys_user_sex" placement="top">
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
字典类型
|
||||
</span>
|
||||
<template v-slot:label>
|
||||
<span>
|
||||
<el-tooltip content="数据存储中的Key值,如:sys_user_sex" placement="top">
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
字典类型
|
||||
</span>
|
||||
</template>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="typeForm.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||
@@ -292,7 +294,7 @@ const typeIds = ref<Array<number | string>>([]);
|
||||
const typeSingle = ref(true);
|
||||
const typeMultiple = ref(true);
|
||||
const typeTotal = ref(0);
|
||||
const dateRange = ref<[DateModelType, DateModelType]>(['', '']);
|
||||
const dateRange = ref<[string, string]>(['', '']);
|
||||
|
||||
const typeFormRef = ref<ElFormInstance>();
|
||||
const typeQueryFormRef = ref<ElFormInstance>();
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
</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" />
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getlist" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -93,7 +93,7 @@ const router = useRouter();
|
||||
const route = useRoute();
|
||||
const form = ref({
|
||||
id: null,
|
||||
categoryId: '', // 分类id、
|
||||
categoryName: '', // 分类id、
|
||||
deviceName: '', // 设备名称
|
||||
deviceCode: '', // 编号
|
||||
deviceModel: '', // 型号
|
||||
@@ -121,7 +121,7 @@ function init() {
|
||||
getDevice(userid.value).then(async (res) => {
|
||||
form.value = {
|
||||
id: res.data.id,
|
||||
categoryId: res.data.categoryId,
|
||||
categoryName: res.data.categoryName,
|
||||
deviceName: res.data.deviceName,
|
||||
deviceCode: res.data.deviceCode,
|
||||
deviceModel: res.data.deviceModel,
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
import { ref } from 'vue';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { useHouseStore } from '@/store/modules/house';
|
||||
import { addHouseAPI, EditHouseApi, getHouseApi, getHouselistAPI } from '@/api/system/house';
|
||||
import { addHouseAPI, EditHouseApi, getBuildingOnly, getHouseApi, getHouselistAPI } from '@/api/system/house';
|
||||
import { addHouseType } from '@/api/system/house/type';
|
||||
|
||||
const router = useRouter();
|
||||
@@ -128,7 +128,7 @@ if (route.query.id) {
|
||||
|
||||
// 选择楼栋
|
||||
function handlechangeBuild(id: string) {
|
||||
getHouselistAPI(id).then((res) => {
|
||||
getBuildingOnly(id).then((res) => {
|
||||
units.value = Array.from({ length: res.data.unitCount }).map((_, index) => {
|
||||
return {
|
||||
no: index + 1,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="buildingheader flex align-center justify-between">
|
||||
<div>楼栋</div>
|
||||
<div>
|
||||
<span class="pointer" @click="handleAddBuilding" v-hasPermi="['building:building:add']">+增加楼栋</span>
|
||||
<span class="pointer" @click="handleAddBuilding" v-hasPermi="['system:building:add']">+增加楼栋</span>
|
||||
</div>
|
||||
</div>
|
||||
<ul>
|
||||
@@ -16,8 +16,8 @@
|
||||
>
|
||||
<div class="buildingname" @click="switchBuilding(item.id ?? null)">{{ item.buildingName ?? '' }}</div>
|
||||
<div class="buildactions flex align-center justify-around">
|
||||
<el-icon class="pointer hover-color-blue" @click="editBuilding(item.id)" v-hasPermi="['building:building:edit']"><Setting /></el-icon>
|
||||
<el-icon class="pointer hover-color-red" @click="deleteBuilding(item.id)" v-hasPermi="['building:building:remove']"><Delete /></el-icon>
|
||||
<el-icon class="pointer hover-color-blue" @click="editBuilding(item.id)" v-hasPermi="['system:building:edit']"><Setting /></el-icon>
|
||||
<el-icon class="pointer hover-color-red" @click="deleteBuilding(item.id)" v-hasPermi="['system:building:remove']"><Delete /></el-icon>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -1,18 +1,41 @@
|
||||
<template>
|
||||
<div class="UnitBox">
|
||||
<div class="Unit_top flex align-center justify-between">
|
||||
<!-- <div>
|
||||
<span class="text-size-16px text-color-black text-widget-bold mr-30px">
|
||||
<strong>{{ houseStore.currentBuildingInfo?.buildingName }}</strong>
|
||||
</span>
|
||||
<span class="mr-15px" v-if="houseStore.currentBuildingInfo && houseStore.currentBuildingInfo?.buildToward"
|
||||
>楼栋朝向:{{ houseStore.currentBuildingInfo?.buildToward ? `${houseStore.currentBuildingInfo?.buildToward}(m)` : '--' }}</span
|
||||
>
|
||||
<span class="mr-15px" v-if="houseStore.currentBuildingInfo && houseStore.currentBuildingInfo?.buildTall"
|
||||
>楼高:{{ houseStore.currentBuildingInfo?.buildTall ? `${houseStore.currentBuildingInfo?.buildTall}(m)` : '--' }}</span
|
||||
>
|
||||
<span class="mr-15px" v-if="houseStore.currentBuildingInfo && houseStore.currentBuildingInfo?.buildStructure"
|
||||
>楼栋结构:{{ houseStore.currentBuildingInfo?.buildStructure ? `${houseStore.currentBuildingInfo?.buildStructure}(m)` : '--' }}
|
||||
</span>
|
||||
</div> -->
|
||||
<div>
|
||||
<span class="text-size-16px text-color-black text-widget-bold mr-30px">
|
||||
<strong>{{ houseStore.currentBuildingInfo?.buildingName }}</strong>
|
||||
</span>
|
||||
<span class="mr-30px">楼栋朝向:{{ houseStore.currentBuildingInfo?.buildToward }}</span>
|
||||
<span class="mr-30px">楼高:{{ houseStore.currentBuildingInfo?.buildTall ? `${houseStore.currentBuildingInfo?.buildTall}(m)` : '' }}</span>
|
||||
<span class="mr-30px">楼栋结构:{{ houseStore.currentBuildingInfo?.buildStructure }} </span>
|
||||
<span class="mr-15px"
|
||||
>楼栋朝向:{{ houseStore.currentBuildingInfo?.buildToward ? `${houseStore.currentBuildingInfo?.buildToward}` : '--' }}</span
|
||||
>
|
||||
<span class="mr-15px">楼高:{{ houseStore.currentBuildingInfo?.buildTall ? `${houseStore.currentBuildingInfo?.buildTall}(m)` : '--' }}</span>
|
||||
<span class="mr-15px"
|
||||
>楼栋结构:{{ houseStore.currentBuildingInfo?.buildStructure ? `${houseStore.currentBuildingInfo?.buildStructure}` : '--' }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="rightActions">
|
||||
<div class="rightActions flex flex-items-center">
|
||||
<span class="mr-20px" @click="handleAddHouse" v-hasPermi="['system:house:add']">+增加房屋</span>
|
||||
<!-- <span class="mr-20px">收费标准设置</span> -->
|
||||
<span @click="deleteAllhouse" v-hasPermi="['system:house:remove']">删除</span>
|
||||
<div class="searchbox flex flex-items-center">
|
||||
<el-input v-model="housename" class="searchinput" placeholder="请输入房屋号"></el-input>
|
||||
<el-button style="margin-left: 10px" type="primary" @click="handleSearchHouse">搜索</el-button>
|
||||
<el-button @click="reset">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="UnitBody">
|
||||
@@ -30,11 +53,23 @@ const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const houseStore = useHouseStore();
|
||||
const router = useRouter();
|
||||
|
||||
const housename = ref('');
|
||||
/** 添加房屋 */
|
||||
function handleAddHouse() {
|
||||
router.push({
|
||||
path: '/house/addHouse'
|
||||
});
|
||||
}
|
||||
function handleSearchHouse() {
|
||||
if (housename.value && housename.value.trim()) {
|
||||
houseStore.getHouseBybuildingNo(housename.value);
|
||||
}
|
||||
}
|
||||
function reset() {
|
||||
housename.value = '';
|
||||
houseStore.getHouseBybuildingNo(housename.value);
|
||||
}
|
||||
|
||||
async function deleteAllhouse() {
|
||||
await proxy?.$modal.confirm('该信息删除后无法恢复,确定要删除吗?');
|
||||
@@ -68,9 +103,23 @@ $primary_color: #1978fe;
|
||||
color: rgba(102, 102, 102, 1);
|
||||
.rightActions {
|
||||
color: $primary_color;
|
||||
height: 35px;
|
||||
span {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.searchbox {
|
||||
margin-left: 30px;
|
||||
.searchinput {
|
||||
width: 250px;
|
||||
@media (max-width: 1200px) {
|
||||
width: 50px;
|
||||
}
|
||||
@media (max-width: 1400px) {
|
||||
width: 130px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.UnitBody {
|
||||
|
||||
@@ -102,6 +102,7 @@ const route = useRoute();
|
||||
const router = useRouter();
|
||||
const houseRentalid = ref(null);
|
||||
const HouseInfo = ref({
|
||||
'id': null,
|
||||
'house': '',
|
||||
'name': null,
|
||||
'rentalStatus': null,
|
||||
|
||||
@@ -35,6 +35,7 @@ const formRef = ref();
|
||||
const form = ref({
|
||||
id: null,
|
||||
itemName: '', // 项目名称
|
||||
status: '0', // 状态 0正常 1停用
|
||||
inspectionStandard: null // 巡检标准
|
||||
});
|
||||
const rules = ref({
|
||||
@@ -48,6 +49,7 @@ if (route.query.id) {
|
||||
form.value = {
|
||||
id: res.data.id,
|
||||
itemName: res.data.itemName,
|
||||
status: res.data.status,
|
||||
inspectionStandard: res.data.inspectionStandard
|
||||
};
|
||||
});
|
||||
|
||||
@@ -76,7 +76,6 @@
|
||||
<el-table-column label="未开始" align="center" prop="pendingTask" />
|
||||
</el-table>
|
||||
<pagination
|
||||
:pagerCount="pagerCount"
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:layout="layout"
|
||||
@@ -104,7 +103,6 @@ const total = ref(100);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
|
||||
const pagerCount = document.body.clientWidth <= 1500 ? 1 : 7;
|
||||
const layout = document.body.clientWidth <= 1500 ? 'total, sizes, prev, pager, next' : 'total, sizes, prev, pager, next,';
|
||||
const disabledDate = (time: Date) => {
|
||||
return time.getTime() > Date.now();
|
||||
@@ -311,7 +309,8 @@ const getList = async () => {
|
||||
list.value[4].value += item.outUncompletedTasks ?? 0;
|
||||
});
|
||||
if (!Number.isNaN(+list.value[2].value) && !Number.isNaN(+list.value[1].value)) {
|
||||
list.value[3].value = Math.min((Number(list.value[2].value) / Number(list.value[1].value)) * 100, 100).toFixed(2) + '%';
|
||||
const num = Number(list.value[2].value) / Number(list.value[1].value);
|
||||
list.value[3].value = Math.min((Number.isNaN(num) ? 0 : num) * 100, 100).toFixed(2) + '%';
|
||||
}
|
||||
|
||||
handleEcartsData(ecartslist.value.find((item) => item.key === activeEchartsindex.value));
|
||||
|
||||
@@ -57,7 +57,13 @@
|
||||
<el-table-column label="计划路线" align="center" prop="routeNames" />
|
||||
<el-table-column label="状态" width="150" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<el-switch v-model="scope.row.status" :active-value="0" :inactive-value="1"></el-switch>
|
||||
<el-switch
|
||||
@change="(val: string) => handleChangeStatus(scope.row.id, val)"
|
||||
v-model="scope.row.status"
|
||||
active-value="0"
|
||||
inactive-value="1"
|
||||
></el-switch>
|
||||
<!-- 0关闭 1开启 -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="110" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
@@ -74,7 +80,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Plan" lang="ts">
|
||||
import { listPlan, getPlan, delPlan, addPlan, updatePlan } from '@/api/system/InspectionPlan/index';
|
||||
import { listPlan, getPlan, delPlan, addPlan, updatePlan, changePlanStatus } from '@/api/system/InspectionPlan/index';
|
||||
import { PlanVO, PlanQuery, PlanForm } from '@/api/system/InspectionPlan/type';
|
||||
import { checkPermi } from '@/utils/permission';
|
||||
import { numToWeek } from '@/utils/time';
|
||||
@@ -203,7 +209,13 @@ const handleUpdate = async (row?: PlanVO) => {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 状态修改 */
|
||||
function handleChangeStatus(id: string, status: string) {
|
||||
changePlanStatus(id, status).then(() => {
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
getList();
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
planFormRef.value?.validate(async (valid: boolean) => {
|
||||
|
||||
@@ -55,7 +55,13 @@
|
||||
<el-table-column label="巡检点位置" align="center" prop="location" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<DictTag :options="com_inspection_point_status" :value="scope.row.status"></DictTag>
|
||||
<el-switch
|
||||
@change="(val: string) => handleChangeStatus(scope.row.id, val)"
|
||||
v-model="scope.row.status"
|
||||
active-value="0"
|
||||
inactive-value="1"
|
||||
></el-switch>
|
||||
<!-- 0开启 1关闭 -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="添加时间" align="center" prop="createTime" />
|
||||
@@ -73,8 +79,8 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Point" lang="ts">
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { listPoint, getPoint, delPoint, addPoint, updatePoint } from '@/api/system/InspectionPoint/index';
|
||||
import Pageheader from '@/components/Pageheader/index.vue';
|
||||
import { listPoint, getPoint, delPoint, addPoint, updatePoint, changePointStatus } from '@/api/system/InspectionPoint/index';
|
||||
import { PointVO, PointQuery, PointForm } from '@/api/system/InspectionPoint/type';
|
||||
import { checkPermi } from '@/utils/permission';
|
||||
|
||||
@@ -218,6 +224,12 @@ const handleDelete = async (row?: PointVO) => {
|
||||
await getList();
|
||||
};
|
||||
|
||||
function handleChangeStatus(id: string, status: string) {
|
||||
changePointStatus(id, status).then(() => {
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
getList();
|
||||
});
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
|
||||
@@ -78,7 +78,6 @@ const form = ref<RecordVO>({
|
||||
planName: '',
|
||||
actualStartTime: '',
|
||||
actualEndTime: '',
|
||||
statusLabel: '',
|
||||
createByName: '',
|
||||
details: [],
|
||||
createTime: '',
|
||||
@@ -89,6 +88,7 @@ if (route.query.id) {
|
||||
userid.value = route.query.id;
|
||||
getRecord(userid.value).then((res) => {
|
||||
form.value = {
|
||||
...form.value,
|
||||
...res.data
|
||||
};
|
||||
});
|
||||
@@ -122,7 +122,7 @@ const tableData = [
|
||||
// 推出
|
||||
const cancelForm = () => {
|
||||
router.push({
|
||||
path: '/carArea/monthCard'
|
||||
path: '/Inspection/Record'
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -62,56 +62,14 @@
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<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="['system:route:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:route:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['system:route:edit']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['system:route:remove']">删除</el-button>
|
||||
</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="routeFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="巡检路线名称" prop="routeName">
|
||||
<el-input v-model="form.routeName" placeholder="请输入巡检路线名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="路线描述" prop="description">
|
||||
<el-input v-model="form.description" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="巡检点" prop="totalPoints">
|
||||
<el-input v-model="form.totalPoints" placeholder="请输入巡检点" />
|
||||
</el-form-item>
|
||||
<el-form-item label="预计巡检时长" prop="estimatedTime">
|
||||
<el-input v-model="form.estimatedTime" placeholder="请输入预计巡检时长" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="起点经度" prop="startLng">
|
||||
<el-input v-model="form.startLng" placeholder="请输入起点经度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="起点纬度" prop="startLat">
|
||||
<el-input v-model="form.startLat" placeholder="请输入起点纬度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="终点经度" prop="endLng">
|
||||
<el-input v-model="form.endLng" placeholder="请输入终点经度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="终点纬度" prop="endLat">
|
||||
<el-input v-model="form.endLat" 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>
|
||||
|
||||
@@ -143,6 +101,7 @@ const dialog = reactive<DialogOption>({
|
||||
const initFormData: RouteForm = {
|
||||
id: undefined,
|
||||
routeName: undefined,
|
||||
pathPoints: undefined,
|
||||
description: undefined,
|
||||
totalPoints: undefined,
|
||||
estimatedTime: undefined,
|
||||
@@ -160,14 +119,14 @@ const data = reactive<PageData<RouteForm, RouteQuery>>({
|
||||
pageSize: 10,
|
||||
routeName: undefined,
|
||||
description: undefined,
|
||||
pathPoints: undefined,
|
||||
totalPoints: undefined,
|
||||
estimatedTime: undefined,
|
||||
routeStatus: undefined,
|
||||
startLng: undefined,
|
||||
startLat: undefined,
|
||||
endLng: undefined,
|
||||
endLat: undefined,
|
||||
params: {}
|
||||
endLat: undefined
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||
@@ -258,7 +217,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: RouteVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除巡检路线编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await proxy?.$modal.confirm('是否确认删除该巡检路线?').finally(() => (loading.value = false));
|
||||
await delRoute(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
<el-table v-loading="loading" border :data="routeList">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="巡检人员" align="center" prop="inspectorName" show-overflow-tooltip />
|
||||
<el-table-column label="巡检人员" align="center" prop="roleName" show-overflow-tooltip />
|
||||
<el-table-column label="计划巡检任务" align="center" prop="totalTasks" />
|
||||
<el-table-column label="按时完成" align="center" prop="completedTasks">
|
||||
<template #default="scope">
|
||||
@@ -76,8 +76,6 @@ const data = reactive({
|
||||
});
|
||||
|
||||
const checkdata = ref([]);
|
||||
// TODO 巡检人员名称
|
||||
|
||||
const { queryParams } = toRefs(data);
|
||||
/** 查询巡检路线列表 */
|
||||
const getList = async () => {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" label-width="100px" @submit.prevent="handleQuery" :model="queryParams" :inline="true">
|
||||
<el-form-item label="执行状态" prop="taskName">
|
||||
<el-form-item label="执行状态" prop="statuss">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择执行状态" clearable>
|
||||
<el-option v-for="(item, index) in com_inspection_task_status" :key="index" :value="item.value" :label="item.label"></el-option>
|
||||
</el-select>
|
||||
@@ -73,7 +73,11 @@
|
||||
<dict-tag :options="com_inspection_task_status" :value="scope.row.status"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="提醒时间" align="center" prop="remindTime" />
|
||||
<el-table-column label="提醒时间" width="160" align="center" prop="remindTime">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_inspection_remind_tiime" :value="scope.row.remindTime"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="关联巡检计划" align="center" prop="planId" />
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
@@ -96,7 +100,7 @@ import { checkPermi } from '@/utils/permission';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_inspection_task_status } = toRefs<any>(proxy?.useDict('com_inspection_task_status'));
|
||||
const { com_inspection_plan_setting } = toRefs<any>(proxy?.useDict('com_inspection_plan_setting'));
|
||||
|
||||
const { com_inspection_remind_tiime } = toRefs<any>(proxy?.useDict('com_inspection_remind_tiime'));
|
||||
const router = useRouter();
|
||||
const taskList = ref<TaskVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
@@ -118,16 +122,7 @@ const dialog = reactive<DialogOption>({
|
||||
const initFormData: TaskForm = {
|
||||
id: undefined,
|
||||
taskName: undefined,
|
||||
planId: undefined,
|
||||
inspectorId: undefined,
|
||||
routeId: undefined,
|
||||
taskTime: undefined,
|
||||
costUnit: undefined,
|
||||
status: undefined,
|
||||
actualStartTime: undefined,
|
||||
actualEndTime: undefined,
|
||||
remark: undefined,
|
||||
remindTime: undefined
|
||||
status: undefined
|
||||
};
|
||||
const data = reactive<PageData<TaskForm, TaskQuery>>({
|
||||
form: { ...initFormData },
|
||||
@@ -135,16 +130,7 @@ const data = reactive<PageData<TaskForm, TaskQuery>>({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
taskName: undefined,
|
||||
planId: undefined,
|
||||
inspectorId: undefined,
|
||||
routeId: undefined,
|
||||
taskTime: undefined,
|
||||
costUnit: undefined,
|
||||
status: undefined,
|
||||
actualStartTime: undefined,
|
||||
actualEndTime: undefined,
|
||||
remindTime: undefined,
|
||||
params: {}
|
||||
status: undefined
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||
|
||||
@@ -64,7 +64,6 @@
|
||||
<el-col :span="1.5">
|
||||
<el-button v-hasPermi="['system:ossConfig:list']" type="info" plain icon="Operation" @click="handleOssConfig">配置管理</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
@@ -81,7 +80,7 @@
|
||||
<el-table-column v-if="false" label="对象存储主键" align="center" prop="ossId" />
|
||||
<el-table-column label="文件名" align="center" prop="fileName" />
|
||||
<el-table-column label="原名" align="center" prop="originalName" />
|
||||
<el-table-column label="文件后缀" align="center" prop="fileSuffix" />
|
||||
<el-table-column label="文件后缀" align="center" prop="fileSuffix" width="100" />
|
||||
<el-table-column label="文件展示" align="center" prop="url">
|
||||
<template #default="scope">
|
||||
<ImagePreview
|
||||
@@ -94,14 +93,14 @@
|
||||
<span v-if="!checkFileSuffix(scope.row.fileSuffix) || !previewListResource" v-text="scope.row.url" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180" sortable="custom">
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="120" sortable="custom">
|
||||
<template #default="scope">
|
||||
<span>{{ proxy.parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上传人" align="center" prop="createByName" />
|
||||
<el-table-column label="服务商" align="center" prop="service" sortable="custom" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="上传人" align="center" prop="createByName" width="100" />
|
||||
<el-table-column label="服务商" align="center" prop="service" sortable="custom" width="100" />
|
||||
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="下载" placement="top">
|
||||
<el-button v-hasPermi="['system:oss:download']" link type="primary" icon="Download" @click="handleDownload(scope.row)"></el-button>
|
||||
@@ -152,7 +151,7 @@ const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const type = ref(0);
|
||||
const previewListResource = ref(true);
|
||||
const dateRangeCreateTime = ref<[DateModelType, DateModelType]>(['', '']);
|
||||
const dateRangeCreateTime = ref<[string, string]>(['', '']);
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
|
||||
@@ -97,7 +97,7 @@ const form = ref({
|
||||
parkingArea: null, // 车位面积
|
||||
parkingFloor: null, // 车位楼层
|
||||
type: '0', // 车位类型
|
||||
residentId: null, // 住户id
|
||||
residentId: '', // 住户id
|
||||
parkingStatus: '', // 车位状态
|
||||
remark: '', // 备注
|
||||
parkingCode: '' // 车位编码
|
||||
|
||||
@@ -83,7 +83,9 @@
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleMain(scope.row)" v-hasPermi="['parking:parking:query']">审核</el-button>
|
||||
<el-button link type="primary" v-if="scope.row.checkStatus === '0'" @click="handleMain(scope.row)" v-hasPermi="['parking:parking:query']"
|
||||
>审核</el-button
|
||||
>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['parking:parking:edit']">编辑</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['parking:parking:remove']">删除</el-button>
|
||||
</template>
|
||||
|
||||
@@ -15,43 +15,47 @@
|
||||
<div class="w-full h-full CarinfoBox gridbox">
|
||||
<div class="carinfo_item">
|
||||
<div class="label">区域:</div>
|
||||
<div class="main">地下停车场A区</div>
|
||||
<div class="main">{{ parkingReviewinfo.parking.areaName }}</div>
|
||||
</div>
|
||||
<div class="carinfo_item">
|
||||
<div class="label">车位编号:</div>
|
||||
<div class="main">地下停车场A区</div>
|
||||
<div class="main">{{ parkingReviewinfo.parking.parkingCode }}</div>
|
||||
</div>
|
||||
<div class="carinfo_item">
|
||||
<div class="label">车位面积:</div>
|
||||
<div class="main">地下停车场A区</div>
|
||||
<div class="main">{{ parkingReviewinfo.parking.parkingArea }} ㎡</div>
|
||||
</div>
|
||||
<div class="carinfo_item">
|
||||
<div class="label">楼层:</div>
|
||||
<div class="main">地下停车场A区</div>
|
||||
<div class="main">{{ parkingReviewinfo.parking.parkingFloor }} 层</div>
|
||||
</div>
|
||||
<div class="carinfo_item">
|
||||
<div class="label">车位类型:</div>
|
||||
<div class="main">地下停车场A区</div>
|
||||
<div class="main">
|
||||
<dict-tag :options="com_parking_type" :value="parkingReviewinfo.parking.type" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="carinfo_item">
|
||||
<div class="label">车位状态:</div>
|
||||
<div class="main">地下停车场A区</div>
|
||||
<div class="main">
|
||||
<DictTag :options="com_parking_status" :value="parkingReviewinfo.parking.parkingStatus"></DictTag>
|
||||
</div>
|
||||
</div>
|
||||
<div class="carinfo_item">
|
||||
<div class="label">持有人:</div>
|
||||
<div class="main">地下停车场A区</div>
|
||||
<div class="main">{{ parkingReviewinfo.parking.residentId }}</div>
|
||||
</div>
|
||||
<div class="carinfo_item">
|
||||
<div class="label">添加时间:</div>
|
||||
<div class="main">地下停车场A区</div>
|
||||
<div class="main">{{ parkingReviewinfo.parking.createTime }}</div>
|
||||
</div>
|
||||
<div class="carinfo_item">
|
||||
<div class="label">添加人:</div>
|
||||
<div class="main">地下停车场A区</div>
|
||||
<div class="main">{{ parkingReviewinfo.parking.createName }}</div>
|
||||
</div>
|
||||
<div class="carinfo_item">
|
||||
<div class="label">备注:</div>
|
||||
<div class="main">地下停车场A区</div>
|
||||
<div class="main">{{ parkingReviewinfo.parking.remark }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -64,7 +68,7 @@
|
||||
<span>车辆信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="w-full h-full CarinfoBox">
|
||||
<div class="w-full h-full CarinfoBox" v-if="parkingReviewinfo.car">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="carinfo_item">
|
||||
@@ -114,6 +118,9 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="w-full h-full CarinfoBox flex flex-center min-h-17rem" v-else>
|
||||
<span style="color: #999; font-weight: 500; font-size: larger; letter-spacing: 10px">暂无信息</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
<div class="">
|
||||
@@ -148,21 +155,21 @@
|
||||
</div>
|
||||
</template>
|
||||
<div class="w-full h-50%">
|
||||
<!-- <el-steps space="200px" direction="vertical" :active="activeStop">
|
||||
<el-step :description="reviewInfo.submitTime">
|
||||
<el-steps space="200px" direction="vertical" :active="activeStop">
|
||||
<el-step :description="parkingReviewinfo.parkingReviewProcess.submitTime">
|
||||
<template #title>
|
||||
<span v-if="active === 0">未提交信息</span>
|
||||
<span v-if="active >= 1">已提交信息</span>
|
||||
</template>
|
||||
</el-step>
|
||||
<el-step :description="reviewInfo.propertyTime">
|
||||
<el-step :description="parkingReviewinfo.parkingReviewProcess.propertyTime">
|
||||
<template #title>
|
||||
<span v-if="active <= 2">待审核</span>
|
||||
<span v-if="active === 3">物业审核不通过</span>
|
||||
<span v-if="active >= 4">物业审核通过</span>
|
||||
</template>
|
||||
</el-step>
|
||||
<el-step :description="reviewInfo.certificationTime">
|
||||
<el-step :description="parkingReviewinfo.parkingReviewProcess.certificationTime">
|
||||
<template #title>
|
||||
<span v-if="active <= 5">未认证</span>
|
||||
<span v-if="active === 6">已认证</span>
|
||||
@@ -173,7 +180,7 @@
|
||||
<span>审核完成</span>
|
||||
</template>
|
||||
</el-step>
|
||||
</el-steps> -->
|
||||
</el-steps>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
@@ -184,6 +191,12 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { getParkingReviewInfo } from '@/api/system/parking';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_parking_status } = toRefs<any>(proxy?.useDict('com_parking_status'));
|
||||
const { com_parking_type } = toRefs<any>(proxy?.useDict('com_parking_type'));
|
||||
|
||||
/** 住户审核状态 */
|
||||
enum reviewStatus {
|
||||
/** 未提交 */
|
||||
@@ -202,10 +215,61 @@ enum reviewStatus {
|
||||
Certification = 6
|
||||
}
|
||||
type activeType = reviewStatus;
|
||||
const active = ref<activeType>(6);
|
||||
const activeStop = ref(4);
|
||||
|
||||
const active = ref<activeType>(0);
|
||||
const activeStop = ref(0);
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const id = ref('');
|
||||
|
||||
const parkingReviewinfo = ref({
|
||||
parking: {
|
||||
'id': '',
|
||||
'areaId': '',
|
||||
'areaName': '',
|
||||
'villageId': '',
|
||||
'villageName': '',
|
||||
'parkingCode': '',
|
||||
'parkingArea': null,
|
||||
'parkingStatus': '',
|
||||
'type': '',
|
||||
'residentId': null,
|
||||
'residentName': null,
|
||||
'parkingFloor': '',
|
||||
'createName': '',
|
||||
'checkStatus': '',
|
||||
'remark': '',
|
||||
'createTime': '',
|
||||
'delFlag': null
|
||||
},
|
||||
car: null,
|
||||
parkingReviewProcess: {
|
||||
submitStatus: null,
|
||||
propertyStatus: null,
|
||||
certificationStatus: null,
|
||||
submitTime: null,
|
||||
propertyTime: null,
|
||||
certificationTime: null
|
||||
}
|
||||
});
|
||||
|
||||
function getInfo() {
|
||||
if (route.query.id) {
|
||||
id.value = route.query.id as string;
|
||||
getParkingReviewInfo(id.value).then((res) => {
|
||||
parkingReviewinfo.value = res.data;
|
||||
handleActivestaus(res.data.parkingReviewProcess);
|
||||
});
|
||||
}
|
||||
}
|
||||
getInfo();
|
||||
|
||||
function handleActivestaus(rews) {
|
||||
if (!rews) {
|
||||
activeStop.value = 0;
|
||||
active.value = 0;
|
||||
return;
|
||||
}
|
||||
if (rews.submitStatus === reviewStatus.unSubmit) {
|
||||
activeStop.value = 0;
|
||||
active.value = 0;
|
||||
@@ -231,7 +295,6 @@ function handleActivestaus(rews) {
|
||||
}
|
||||
}
|
||||
|
||||
const router = useRouter();
|
||||
function handlBacK() {
|
||||
router.back();
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<div class="userinfo_item img">
|
||||
<div class="title_item">身份证正面:</div>
|
||||
<div class="userinfo_itme_img">
|
||||
<el-image class="w-full h-full" fit="fill" :src="splitImages(userInfo.cardImageFront)"></el-image>
|
||||
<el-image class="w-full h-full" fit="fill" :src="userInfo.cardImageFront"></el-image>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
@@ -52,7 +52,7 @@
|
||||
</div>
|
||||
<div class="userinfo_item">
|
||||
<div class="title_item">住户性别:</div>
|
||||
<span> {{ userInfo.gender === 1 ? '男' : '女' }} </span>
|
||||
<span> {{ userInfo.gender === '0' ? '男' : '女' }} </span>
|
||||
</div>
|
||||
<div class="userinfo_item">
|
||||
<div class="title_item">证件号码:</div>
|
||||
@@ -117,7 +117,7 @@
|
||||
</el-step>
|
||||
<el-step :description="reviewInfo.propertyTime">
|
||||
<template #title>
|
||||
<DictTag :options="com_review" :value="reviewInfo.propertyStatus || '0'"></DictTag>
|
||||
<span>{{ getReviewStatusLabel(reviewInfo.propertyStatus || '0') }}</span>
|
||||
</template>
|
||||
</el-step>
|
||||
<el-step :description="reviewInfo.certificationTime">
|
||||
@@ -155,6 +155,7 @@ const userInfo = ref<ResidentVO>({
|
||||
code: null,
|
||||
villageId: '',
|
||||
buildingId: '',
|
||||
userId: null,
|
||||
'id': null,
|
||||
'name': '',
|
||||
'type': null,
|
||||
@@ -198,7 +199,11 @@ if (route.query.id) {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 在 script setup 中添加
|
||||
const getReviewStatusLabel = (status: string) => {
|
||||
const item = com_review.value?.find((i: any) => i.value === status);
|
||||
return item ? item.label : '未知状态';
|
||||
};
|
||||
function handleActivestaus(rews) {
|
||||
// 提交状态 0未提交 1已提交
|
||||
if (rews.submitStatus === '0') {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<el-card style="flex: 1" shadow="never">
|
||||
<div class="residentBody h-full">
|
||||
<div class="treebox h-full">
|
||||
<div class="treeTitlebox">{{ currentVilageInfo.villageName ?? '12' }}</div>
|
||||
<div class="treeTitlebox">{{ currentVilageInfo.villageName ?? '--' }}</div>
|
||||
<div class="treeboxbody">
|
||||
<!-- 树状+ -->
|
||||
<el-tree :highlight-current="true" style="max-width: 600px" :data="treedata" :props="defaultProps" @node-click="handleNodeClick" />
|
||||
@@ -152,7 +152,6 @@ const total = ref(0);
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
|
||||
const initFormData: ResidentForm = {
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
type: undefined,
|
||||
@@ -372,6 +371,7 @@ onMounted(() => {
|
||||
display: flex;
|
||||
.treebox {
|
||||
width: 250px;
|
||||
min-width: 250px;
|
||||
margin-right: 10px;
|
||||
.treeTitlebox {
|
||||
height: 60px;
|
||||
|
||||
@@ -57,14 +57,11 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import api from '@/api/system/user';
|
||||
import { ref } from 'vue';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { getCommunitylistAPI } from '@/api/system/community';
|
||||
import { roleMenuTreeselect, treeselect as menuTreeselect } from '@/api/system/menu/index';
|
||||
import { addRole, getRole, updateRole } from '@/api/system/role';
|
||||
import { MenuTreeOption, RoleMenuTree } from '@/api/system/menu/types';
|
||||
import { DeptTreeOption } from '@/api/system/role/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { sys_normal_disable } = toRefs<any>(proxy?.useDict('sys_normal_disable'));
|
||||
@@ -102,6 +99,7 @@ const rules = ref({
|
||||
|
||||
async function init() {
|
||||
if (route.query.id) {
|
||||
userid.value = route.query.id;
|
||||
const { data } = await getRole(userid.value);
|
||||
Object.assign(form.value, data);
|
||||
form.value.roleSort = Number(form.value.roleSort);
|
||||
@@ -129,7 +127,7 @@ const getRoleMenuTreeselect = (roleId: string | number) => {
|
||||
};
|
||||
|
||||
/** 树权限(展开/折叠)*/
|
||||
const handleCheckedTreeExpand = (value: boolean, type: string) => {
|
||||
const handleCheckedTreeExpand = (value: CheckboxValueType, type: string) => {
|
||||
if (type == 'menu') {
|
||||
const treeList = menuOptions.value;
|
||||
for (let i = 0; i < treeList.length; i++) {
|
||||
@@ -147,7 +145,7 @@ const handleCheckedTreeExpand = (value: boolean, type: string) => {
|
||||
}
|
||||
};
|
||||
/** 树权限(全选/全不选) */
|
||||
const handleCheckedTreeNodeAll = (value: any, type: string) => {
|
||||
const handleCheckedTreeNodeAll = (value: CheckboxValueType, type: string) => {
|
||||
if (type == 'menu') {
|
||||
menuRef.value?.setCheckedNodes(value ? (menuOptions.value as any) : []);
|
||||
} else if (type == 'dept') {
|
||||
@@ -155,9 +153,9 @@ const handleCheckedTreeNodeAll = (value: any, type: string) => {
|
||||
}
|
||||
};
|
||||
/** 树权限(父子联动) */
|
||||
const handleCheckedTreeConnect = (value: any, type: string) => {
|
||||
const handleCheckedTreeConnect = (value: CheckboxValueType, type: string) => {
|
||||
if (type == 'menu') {
|
||||
form.value.menuCheckStrictly = value;
|
||||
form.value.menuCheckStrictly = value as boolean;
|
||||
} else if (type == 'dept') {
|
||||
// form.value.deptCheckStrictly = value;
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const dateRange = ref<[DateModelType, DateModelType]>(['', '']);
|
||||
const dateRange = ref<[string, string]>(['', '']);
|
||||
const menuOptions = ref<MenuTreeOption[]>([]);
|
||||
const menuExpand = ref(false);
|
||||
const menuNodeAll = ref(false);
|
||||
@@ -315,7 +315,7 @@ const resetQuery = () => {
|
||||
/**删除按钮操作 */
|
||||
const handleDelete = async (row?: RoleVO) => {
|
||||
const roleids = row?.roleId || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除角色编号为' + roleids + '数据项目');
|
||||
await proxy?.$modal.confirm('是否确认删除该角色');
|
||||
await delRole(roleids);
|
||||
getList();
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
@@ -431,19 +431,19 @@ const getRoleDeptTreeSelect = async (roleId: string | number) => {
|
||||
return res.data;
|
||||
};
|
||||
/** 树权限(展开/折叠)*/
|
||||
const handleCheckedTreeExpand = (value: boolean, type: string) => {
|
||||
const handleCheckedTreeExpand = (value: CheckboxValueType, type: string) => {
|
||||
if (type == 'menu') {
|
||||
const treeList = menuOptions.value;
|
||||
for (let i = 0; i < treeList.length; i++) {
|
||||
if (menuRef.value) {
|
||||
menuRef.value.store.nodesMap[treeList[i].id].expanded = value;
|
||||
menuRef.value.store.nodesMap[treeList[i].id].expanded = value as boolean;
|
||||
}
|
||||
}
|
||||
} else if (type == 'dept') {
|
||||
const treeList = deptOptions.value;
|
||||
for (let i = 0; i < treeList.length; i++) {
|
||||
if (deptRef.value) {
|
||||
deptRef.value.store.nodesMap[treeList[i].id].expanded = value;
|
||||
deptRef.value.store.nodesMap[treeList[i].id].expanded = value as boolean;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +93,8 @@ import Echarts from '@/components/Echarts/index.vue';
|
||||
import { EChartsOption } from 'echarts';
|
||||
import { getLast7Days, getLastNDays } from '@/utils/time';
|
||||
|
||||
const date = ref('');
|
||||
|
||||
/** 入住情况 */
|
||||
const options = shallowRef<EChartsOption>({
|
||||
tooltip: { show: false },
|
||||
|
||||
@@ -75,6 +75,7 @@ import Echarts from '@/components/Echarts/index.vue';
|
||||
import { EChartsOption } from 'echarts';
|
||||
import { getLast7Days, getLastNDays } from '@/utils/time';
|
||||
|
||||
const date = ref('');
|
||||
/** 入住情况 */
|
||||
const options = shallowRef<EChartsOption>({
|
||||
tooltip: { show: false },
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<el-input v-model="queryParams.title" placeholder="请输入问卷标题" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" : @click="handleQuery">搜索</el-button>
|
||||
<el-button :@click="resetQuery">重置</el-button>
|
||||
<el-button type="primary" @click="handleQuery">搜索</el-button>
|
||||
<el-button @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { QuestionnaireVO } from '@/api/system/Questionnaire/type';
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
|
||||
// 查询问卷列表
|
||||
export function listQuestionnaire(query) {
|
||||
export function listQuestionnaire(query): AxiosPromise<QuestionnaireVO[]> {
|
||||
return request({
|
||||
url: '/questionnaire/list',
|
||||
method: 'get',
|
||||
|
||||
@@ -8,21 +8,27 @@
|
||||
<el-form-item label="员工姓名" prop="nickName">
|
||||
<el-input v-model.trim="form.nickName" placeholder="请输入员工姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="登录账号" prop="userName">
|
||||
<el-form-item label="登录账号" v-if="form.userId == undefined" prop="userName">
|
||||
<el-input v-model.trim="form.userName" placeholder="请输入登录账号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="登录密码" prop="password">
|
||||
<el-input v-model.trim="form.password" placeholder="请输入" />
|
||||
<el-form-item label="登录密码" v-if="form.userId == undefined" prop="password">
|
||||
<el-input type="password" clearable v-model.trim="form.password" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="员工头像" prop="chargeScope"></el-form-item>
|
||||
<!-- <el-form-item label="员工头像" prop="chargeScope"></el-form-item> -->
|
||||
<el-form-item label="员工性别" prop="chargeScope">
|
||||
<el-select v-model="form.sex" placeholder="请选择">
|
||||
<el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="员工角色" prop="roleIds">
|
||||
<el-select v-model="form.roleIds" multiple>
|
||||
<el-option v-for="(item, index) in roleOptions" :key="index" :value="item.roleId" :label="item.roleName"></el-option>
|
||||
<el-form-item label="员工角色" prop="roleIds" v-if="form.userId == null || form.userId != useUserStore().userId">
|
||||
<el-select v-model="form.roleIds">
|
||||
<el-option
|
||||
:disabled="item.status == '1'"
|
||||
v-for="(item, index) in roleOptions"
|
||||
:key="index"
|
||||
:value="item.roleId"
|
||||
:label="item.roleName"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="管理小区" prop="checkvillage">
|
||||
@@ -57,6 +63,7 @@ import { ref } from 'vue';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { getCommunitylistAPI } from '@/api/system/community';
|
||||
import { validator } from '@/utils/Reg';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
@@ -79,7 +86,7 @@ const form = ref({
|
||||
'sex': '', // 0男 1女 2未知
|
||||
'status': '0', // (0正常 1停用)
|
||||
'password': '', // 密码
|
||||
'roleIds': [], // 角色组
|
||||
'roleIds': '', // 角色组
|
||||
'remark': ''
|
||||
});
|
||||
const rules = ref({
|
||||
@@ -124,7 +131,7 @@ async function init() {
|
||||
'phonenumber': res.data.user.phonenumber, // 手机号码
|
||||
'sex': res.data.user.sex, // 0男 1女 2未知
|
||||
'password': '', // 密码
|
||||
'roleIds': res.data.roleIds ?? [], // 角色组
|
||||
'roleIds': res.data.roleIds[0], // 角色组
|
||||
'remark': ''
|
||||
};
|
||||
roleOptions.value = [];
|
||||
@@ -157,15 +164,19 @@ function handleChangeVillage(value: string[]) {
|
||||
|
||||
// !== 提交 =============================================================================
|
||||
const submitForm = () => {
|
||||
const obj = {
|
||||
...form.value,
|
||||
'roleIds': [form.value.roleIds]
|
||||
};
|
||||
formRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
if (userid.value) {
|
||||
api.updateUser(form.value).then(() => {
|
||||
api.updateUser(obj).then(() => {
|
||||
ElMessage.success('编辑成功');
|
||||
cancelForm();
|
||||
});
|
||||
} else {
|
||||
api.addUser(form.value).then(() => {
|
||||
api.addUser(obj).then(() => {
|
||||
ElMessage.success('添加成功');
|
||||
cancelForm();
|
||||
});
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<div class="p-2 h-full flex flex-col">
|
||||
<pageheader> </pageheader>
|
||||
<div class="panel">
|
||||
<h4 class="panel-title">基本信息</h4>
|
||||
<el-form :model="form" :inline="true">
|
||||
@@ -17,9 +18,9 @@
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="panel">
|
||||
<div class="panel flex-1 flex flex-col">
|
||||
<h4 class="panel-title">角色信息</h4>
|
||||
<div>
|
||||
<div class="flex-1">
|
||||
<el-table
|
||||
ref="tableRef"
|
||||
v-loading="loading"
|
||||
@@ -49,7 +50,6 @@
|
||||
<el-button type="primary" @click="submitForm()">提交</el-button>
|
||||
<el-button @click="close()">返回</el-button>
|
||||
</div>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -144,3 +144,11 @@ onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.panel {
|
||||
margin-top: 20px;
|
||||
.el-table {
|
||||
height: calc(100% - 160px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -60,10 +60,11 @@
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</el-col> -->
|
||||
<right-toolbar more-title="更多" v-model:show-search="showSearch" :columns="columns" :search="true" @query-table="getList">
|
||||
|
||||
<right-toolbar :show-add="checkPermi(['system:user:add'])" @update:add="handleAdd" more-title="更多" :columns="columns">
|
||||
<template #dropdown>
|
||||
<el-dropdown-item @click="handleUpdate()">修改</el-dropdown-item>
|
||||
<el-dropdown-item @click="handleDelete()">删除</el-dropdown-item>
|
||||
<el-dropdown-item v-if="checkPermi(['system:user:edit'])" :disabled="single" @click="handleUpdate()">修改</el-dropdown-item>
|
||||
<el-dropdown-item v-if="checkPermi(['system:user:remove'])" :disabled="multiple" @click="handleDelete()">删除</el-dropdown-item>
|
||||
<el-dropdown-item @click="importTemplate">下载模板</el-dropdown-item>
|
||||
<!-- 注意 由于el-dropdown-item标签是延迟加载的 所以v-has-permi自定义标签不生效 需要使用v-if调用方法执行 -->
|
||||
<el-dropdown-item v-if="checkPermi(['system:user:import'])" @click="handleImport">导入数据</el-dropdown-item>
|
||||
@@ -454,7 +455,7 @@ const handleResetPwd = async (row: UserVO) => {
|
||||
);
|
||||
if (!err && res) {
|
||||
await api.resetUserPwd(row.userId, res.value);
|
||||
proxy?.$modal.msgSuccess('修改成功,新密码是:' + res.value);
|
||||
proxy?.$modal.msgSuccess('修改成功');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -8,6 +8,11 @@
|
||||
<el-form-item label="仓库名称" prop="warehouseName">
|
||||
<el-input v-model.trim="form.warehouseName" placeholder="请输入仓库名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="归属小区" prop="villageId">
|
||||
<el-select v-model="form.villageId" placeholder="请选择归属小区">
|
||||
<el-option v-for="(item, index) in cummunitylist" :key="index" :label="item.villageName" :value="item.villageId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="contactPerson">
|
||||
<el-input v-model.trim="form.contactPerson" placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
@@ -47,7 +52,7 @@ const formRef = ref();
|
||||
const form = ref({
|
||||
id: null,
|
||||
warehouseName: '', // 供应商名称
|
||||
villageId: Number(localStorage.getItem('villageid')), // 邮箱
|
||||
villageId: '', // 小区id
|
||||
contactPhone: '', // 联系电话
|
||||
address: '', // 地址
|
||||
remark: '', // 备注
|
||||
|
||||
@@ -124,7 +124,7 @@ const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const dateRange = ref<[DateModelType, DateModelType]>(['', '']);
|
||||
const dateRange = ref<[string, string]>(['', '']);
|
||||
const uniqueId = ref('');
|
||||
const dataNameList = ref<Array<string>>([]);
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
<script name="repairEcharts" setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { workSpaceRepairTrendListApi } from '@/api/workflow';
|
||||
import Echarts from '@/components/Echarts/index.vue';
|
||||
import { getLast7Days } from '@/utils/time';
|
||||
import { EChartsOption } from 'echarts';
|
||||
import type { EChartsOption } from 'echarts';
|
||||
|
||||
// 使用 ref 而不是 shallowRef,以确保深层响应式,或者在更新时重新赋值整个对象
|
||||
const chartConfig = shallowRef<EChartsOption>({
|
||||
grid: {
|
||||
left: '1%',
|
||||
@@ -11,7 +14,8 @@ const chartConfig = shallowRef<EChartsOption>({
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
data: getLast7Days()
|
||||
type: 'category', // 建议明确指定类型
|
||||
data: [] as string[]
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
@@ -21,7 +25,7 @@ const chartConfig = shallowRef<EChartsOption>({
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: [100, 140, 230, 100, 130, 180, 173],
|
||||
data: [] as number[],
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
name: '维修单数',
|
||||
@@ -31,10 +35,10 @@ const chartConfig = shallowRef<EChartsOption>({
|
||||
x: 0,
|
||||
y: 0,
|
||||
x2: 0,
|
||||
y2: 1, // 从上到下渐变
|
||||
y2: 1,
|
||||
colorStops: [
|
||||
{ offset: 0, color: '#e2edff' }, // 顶部:半透明蓝色
|
||||
{ offset: 1, color: '#f2f9ff' } // 底部:极浅蓝/透明
|
||||
{ offset: 0, color: '#e2edff' },
|
||||
{ offset: 1, color: '#f2f9ff' }
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -52,6 +56,53 @@ const chartConfig = shallowRef<EChartsOption>({
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
// 获取维修列表数据
|
||||
function getRepairList() {
|
||||
const id = localStorage.getItem('villageid');
|
||||
if (!id) return;
|
||||
|
||||
workSpaceRepairTrendListApi(id)
|
||||
.then((res: any[]) => {
|
||||
if (!res || res.length === 0) {
|
||||
return;
|
||||
}
|
||||
const map = res.sort((a, b) => new Date(a.date).getTime() - new Date(b.date).getTime());
|
||||
// 提取日期和数量
|
||||
const dates = map.map((item) => item.date);
|
||||
const counts = map.map((item) => item.count);
|
||||
|
||||
// 如果使用的是 ref,直接修改属性即可触发响应式
|
||||
chartConfig.value = {
|
||||
grid: chartConfig.value.grid,
|
||||
yAxis: chartConfig.value.yAxis,
|
||||
tooltip: chartConfig.value.tooltip,
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: dates
|
||||
},
|
||||
series: [
|
||||
{
|
||||
...chartConfig.value.series?.[0],
|
||||
type: 'line', // 确保 type 存在
|
||||
data: counts
|
||||
}
|
||||
]
|
||||
} as EChartsOption;
|
||||
|
||||
// 注意:如果 <Echarts> 组件内部没有正确监听 options 的变化,
|
||||
// 可能需要强制触发更新,例如:
|
||||
// chartConfig.value = { ...chartConfig.value };
|
||||
// 但大多数封装好的 Echarts 组件会 watch options 并调用 setOption
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('获取维修趋势数据失败:', err);
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getRepairList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<span class="echarts_units">单位(个)</span>
|
||||
</div>
|
||||
<div class="flex flex-items-center justify-center">
|
||||
<span class="echarts_all_baoxiu">全部保修</span>
|
||||
<span class="echarts_all_baoxiu">全部报修</span>
|
||||
<i class="echarts_all_arrow"></i>
|
||||
</div>
|
||||
</div>
|
||||
@@ -63,7 +63,15 @@
|
||||
<div class="flex flex-col h-full">
|
||||
<div class="villageInfoBox">
|
||||
<div class="iconbox">
|
||||
<el-image :src="summicon"></el-image>
|
||||
<div :title="`${weather_icon.title} ${weather_icon.wind_direction} ${weather_icon.wind_power} 温度${weather_icon.temperature}°C`">
|
||||
{{ getWeatherIcon(weather_icon.iconvalue) }}
|
||||
</div>
|
||||
<!-- <el-image :src="summicon"></el-image> -->
|
||||
<!-- <svg xmlns="http://www.w3.org/2000/svg" color="white" width="70" height="70" fill="currentColor" class="qi-100" viewBox="0 0 16 16">
|
||||
<path
|
||||
d="M7.655 2.357a.5.5 0 0 0 .854-.353v-1.5a.5.5 0 0 0-1 0v1.5a.5.5 0 0 0 .146.353Zm-4.08 1.861c.06.026.126.039.191.039l.001-.001a.5.5 0 0 0 .355-.855l-1.064-1.06a.5.5 0 0 0-.707.708l1.062 1.06a.498.498 0 0 0 .162.11ZM.503 8.496h1.5a.5.5 0 1 0 0-1h-1.5a.5.5 0 0 0 0 1Zm1.914 5.221a.501.501 0 0 0 .631-.063l1.063-1.06a.5.5 0 0 0-.708-.707l-1.062 1.06a.5.5 0 0 0 .076.77Zm5.225 2.14a.5.5 0 0 0 .854-.354v-1.5a.5.5 0 0 0-1 0v1.5a.5.5 0 0 0 .146.354Zm5.467-2.084a.5.5 0 0 0 .544-.816l-1.06-1.06a.498.498 0 0 0-.832.152.5.5 0 0 0 .126.555l1.06 1.06a.496.496 0 0 0 .162.109Zm.893-5.263h1.5a.5.5 0 1 0 0-1h-1.5a.5.5 0 0 0 0 1Zm-2.031-4.327a.5.5 0 0 0 .633-.063l1.06-1.06a.5.5 0 1 0-.708-.708l-1.06 1.06a.5.5 0 0 0 .075.77Zm-6.466.075a4.5 4.5 0 1 1 5 7.484 4.5 4.5 0 0 1-5-7.484Zm4.445.832a3.5 3.5 0 1 0-3.89 5.82 3.5 3.5 0 0 0 3.89-5.82Z"
|
||||
/>
|
||||
</svg> -->
|
||||
</div>
|
||||
<div class="villageinfo">
|
||||
<div class="villagename">{{ villageinfo.villageName }}</div>
|
||||
@@ -254,7 +262,8 @@ import { UploadUserFile } from 'element-plus';
|
||||
import { getVillageByIdAPI } from '@/api/system/community';
|
||||
import { getLast7Days, numToWeek2 } from '@/utils/time';
|
||||
import { EChartsOption } from 'echarts';
|
||||
import { workSpaceTotalListApi } from '@/api/workflow';
|
||||
import { workSpaceIncomeTrendListApi, workSpaceTotalListApi, workSpaceWeatherApi } from '@/api/workflow';
|
||||
import { getWeatherIcon } from '@/utils/weather';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_resident_type } = toRefs<any>(proxy?.useDict('com_resident_type'));
|
||||
@@ -269,12 +278,26 @@ const list = ref([
|
||||
{ name: '投诉总数量', value: 458, icon: icon6 }
|
||||
]);
|
||||
|
||||
const weather_icon = ref({
|
||||
iconvalue: null,
|
||||
title: '',
|
||||
// 当前温度 °C
|
||||
temperature: null,
|
||||
// 风向
|
||||
'wind_direction': '',
|
||||
// 风力等级
|
||||
'wind_power': '',
|
||||
// 相对湿度 %
|
||||
'humidity': null
|
||||
});
|
||||
function getVillageinfo() {
|
||||
const id = localStorage.getItem('villageid');
|
||||
workSpaceTotalListApi(id).then((res) => {
|
||||
list.value[0].value = res.totalResident;
|
||||
list.value[1].value = res.totalHouse;
|
||||
list.value[2].value = res.totalParking;
|
||||
list.value[3].value = res.totalDevice;
|
||||
list.value[4].value = res.totalMaterial;
|
||||
list.value[5].value = res.totalComplaint;
|
||||
});
|
||||
getVillageByIdAPI(id).then((res) => {
|
||||
@@ -283,10 +306,22 @@ function getVillageinfo() {
|
||||
villageId: res.data.villageId,
|
||||
villageName: res.data.villageName
|
||||
};
|
||||
const city = res.data.city.replaceAll('/', '');
|
||||
workSpaceWeatherApi(city).then((res) => {
|
||||
weather_icon.value = {
|
||||
iconvalue: res.weather_icon,
|
||||
title: res.weather,
|
||||
wind_direction: res.wind_direction,
|
||||
wind_power: res.wind_power,
|
||||
humidity: res.humidity,
|
||||
temperature: res.temperature
|
||||
};
|
||||
});
|
||||
houseStore.updateVilageinfo(res.data);
|
||||
});
|
||||
}
|
||||
getVillageinfo();
|
||||
|
||||
// ! echarts 切换
|
||||
const active_index = ref(0);
|
||||
const actions = ref([
|
||||
@@ -300,8 +335,10 @@ const actions = ref([
|
||||
name: '支出'
|
||||
}
|
||||
]);
|
||||
changeChartConfig(0);
|
||||
function changeActive_index(val: number) {
|
||||
active_index.value = val;
|
||||
changeChartConfig(val);
|
||||
}
|
||||
|
||||
const chartConfig = shallowRef<EChartsOption>({
|
||||
@@ -389,6 +426,38 @@ const chartConfig = shallowRef<EChartsOption>({
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
function changeChartConfig(val: number) {
|
||||
const id = localStorage.getItem('villageid');
|
||||
workSpaceIncomeTrendListApi(id, val).then((res) => {
|
||||
console.log(res);
|
||||
if (!res || res.length === 0) {
|
||||
return;
|
||||
}
|
||||
const map = res.sort((a, b) => new Date(a.date).getTime() - new Date(b.date).getTime());
|
||||
// 提取日期和数量
|
||||
const dates = map.map((item) => item.date);
|
||||
const incomes = map.map((item) => item.income);
|
||||
|
||||
chartConfig.value = {
|
||||
grid: chartConfig.value.grid,
|
||||
yAxis: chartConfig.value.yAxis,
|
||||
tooltip: chartConfig.value.tooltip,
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: dates
|
||||
},
|
||||
series: [
|
||||
{
|
||||
...chartConfig.value.series?.[0],
|
||||
type: 'line', // 确保 type 存在
|
||||
data: incomes
|
||||
}
|
||||
]
|
||||
} as EChartsOption;
|
||||
});
|
||||
}
|
||||
|
||||
// ! echarts 切换
|
||||
// ! 侧边栏
|
||||
const Sideactive = ref(1);
|
||||
@@ -453,7 +522,7 @@ const fileList = ref<UploadUserFile[]>([]);
|
||||
const seachervalue = ref('name');
|
||||
const searchInput = ref('');
|
||||
const loading = ref(true);
|
||||
const total = ref(100);
|
||||
const total = ref(0);
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@@ -497,6 +566,7 @@ const tableData = ref([]);
|
||||
async function getList() {
|
||||
const res = await listResident(queryParams.value);
|
||||
tableData.value = res.rows;
|
||||
total.value = res.total;
|
||||
}
|
||||
getList();
|
||||
|
||||
@@ -689,6 +759,11 @@ async function deleteFun(row) {
|
||||
.iconbox {
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
font-size: 70px;
|
||||
line-height: 70px;
|
||||
position: relative;
|
||||
cursor: default;
|
||||
z-index: 2;
|
||||
}
|
||||
.villageinfo {
|
||||
margin-left: 20px;
|
||||
|
||||
@@ -401,7 +401,7 @@ const handleSelectionChange = (selection: any) => {
|
||||
const getPageList = async () => {
|
||||
const query = proxy.$route.query;
|
||||
if (query.activeName) {
|
||||
activeName.value = query.activeName;
|
||||
activeName.value = query.activeName as string;
|
||||
proxy.$route.query.activeName = '';
|
||||
}
|
||||
if (activeName.value === '0') {
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button v-hasPermi="['workflow:instance:remove']" type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
<el-button v-hasPermi="['workflow:instance:remove']" type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -221,7 +221,7 @@ import { RouterJumpVo } from '@/api/workflow/workflowCommon/types';
|
||||
import VueJsonPretty from 'vue-json-pretty';
|
||||
import 'vue-json-pretty/lib/styles.css';
|
||||
import UserSelect from '@/components/UserSelect/index.vue';
|
||||
import { ElForm, FormInstance } from 'element-plus';
|
||||
import { ElForm, FormInstance, TabsPaneContext } from 'element-plus';
|
||||
//审批记录组件
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
|
||||
@@ -369,8 +369,8 @@ const getProcessInstanceFinishList = () => {
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row: FlowInstanceVO) => {
|
||||
const instanceIdList = row.id || instanceIds.value;
|
||||
const handleDelete = async (row?: FlowInstanceVO) => {
|
||||
const instanceIdList = row?.id || instanceIds.value;
|
||||
await proxy?.$modal.confirm('是否确认删除?');
|
||||
loading.value = true;
|
||||
if ('running' === tab.value) {
|
||||
@@ -382,7 +382,7 @@ const handleDelete = async (row: FlowInstanceVO) => {
|
||||
}
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
};
|
||||
const changeTab = async (data: string) => {
|
||||
const changeTab = async (data: TabsPaneContext) => {
|
||||
processInstanceList.value = [];
|
||||
queryParams.value.pageNum = 1;
|
||||
if ('running' === data.paneName) {
|
||||
@@ -459,7 +459,7 @@ const userSelectCallBack = (data: UserVO[]) => {
|
||||
if (data && data.length > 0) {
|
||||
userSelectCount.value = data.length;
|
||||
selectUserIds.value = data.map((item) => item.userId);
|
||||
queryParams.value.createByIds = selectUserIds.value;
|
||||
queryParams.value.createByIds = selectUserIds.value as string[];
|
||||
}
|
||||
};
|
||||
const rules = reactive<Record<string, any>>({
|
||||
|
||||
@@ -128,12 +128,12 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { pageByAllTaskWait, pageByAllTaskFinish, updateAssignee, urgeTask } from '@/api/workflow/task';
|
||||
import UserSelect from '@/components/UserSelect';
|
||||
import UserSelect from '@/components/UserSelect/index.vue';
|
||||
import { TaskQuery } from '@/api/workflow/task/types';
|
||||
import workflowCommon from '@/api/workflow/workflowCommon';
|
||||
import { RouterJumpVo } from '@/api/workflow/workflowCommon/types';
|
||||
import processMeddle from '@/components/Process/processMeddle';
|
||||
import messageType from '@/components/Process/MessageType';
|
||||
import processMeddle from '@/components/Process/processMeddle.vue';
|
||||
import messageType from '@/components/Process/MessageType.vue';
|
||||
import { UserVO } from '@/api/system/user/types';
|
||||
import { TabsPaneContext } from 'element-plus';
|
||||
//选人组件
|
||||
@@ -286,7 +286,7 @@ const userSelectCallBack = (data: UserVO[]) => {
|
||||
if (data && data.length > 0) {
|
||||
userSelectCount.value = data.length;
|
||||
selectUserIds.value = data.map((item) => item.userId);
|
||||
queryParams.value.createByIds = selectUserIds.value;
|
||||
queryParams.value.createByIds = selectUserIds.value as string[];
|
||||
}
|
||||
};
|
||||
onMounted(() => {
|
||||
|
||||
@@ -93,7 +93,7 @@ const queryFormRef = ref<ElFormInstance>();
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
|
||||
const { wf_task_status } = toRefs<any>(proxy?.useDict('wf_task_status'));
|
||||
import UserSelect from '@/components/UserSelect';
|
||||
import UserSelect from '@/components/UserSelect/index.vue';
|
||||
import { ref } from 'vue';
|
||||
import { UserVO } from '@/api/system/user/types';
|
||||
|
||||
@@ -177,7 +177,7 @@ const userSelectCallBack = (data: UserVO[]) => {
|
||||
if (data && data.length > 0) {
|
||||
userSelectCount.value = data.length;
|
||||
selectUserIds.value = data.map((item) => item.userId);
|
||||
queryParams.value.createByIds = selectUserIds.value;
|
||||
queryParams.value.createByIds = selectUserIds.value as string[];
|
||||
}
|
||||
};
|
||||
onMounted(() => {
|
||||
|
||||
@@ -88,7 +88,7 @@ import { RouterJumpVo } from '@/api/workflow/workflowCommon/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
|
||||
import UserSelect from '@/components/UserSelect';
|
||||
import UserSelect from '@/components/UserSelect/index.vue';
|
||||
import { ref } from 'vue';
|
||||
import { UserVO } from '@/api/system/user/types';
|
||||
|
||||
@@ -179,7 +179,7 @@ const userSelectCallBack = (data: UserVO[]) => {
|
||||
if (data && data.length > 0) {
|
||||
userSelectCount.value = data.length;
|
||||
selectUserIds.value = data.map((item) => item.userId);
|
||||
queryParams.value.createByIds = selectUserIds.value;
|
||||
queryParams.value.createByIds = selectUserIds.value as string[];
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user