修复小区背景颜色,巡检点顺序一致,投诉处理按钮
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
<el-table-column label="账单名称" align="center" prop="billName" />
|
||||
<el-table-column label="收费范围" align="center" prop="chargeScope" width="100">
|
||||
<template #default="scope">
|
||||
<template v-if="ShowHouselist.includes(scope.row.chargeTypeId)">
|
||||
<template v-if="ShowHouseList.includes(scope.row.chargeTypeId)">
|
||||
<DictTag :options="com_bill_charge_scope_house" :value="scope.row.chargeScope"></DictTag>
|
||||
</template>
|
||||
<template v-else>
|
||||
@@ -56,8 +56,9 @@
|
||||
<span v-else>---</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<el-table-column label="操作" width="200" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleChange(scope.row)">生成账单</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-has-permi="['bill:bill:edit']">编辑</el-button>
|
||||
<el-button link type="primary" @click="handleMain(scope.row)" v-has-permi="['bill:bill:query']">详情</el-button>
|
||||
</template>
|
||||
@@ -65,6 +66,36 @@
|
||||
</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 v-model="BillVisible" :title="BillForm.title" width="500">
|
||||
<el-form :model="BillForm" label-width="auto" style="max-width: 600px">
|
||||
<el-form-item label="账单生成时间">
|
||||
<el-date-picker
|
||||
v-if="BillForm.chargePeriod === '0'"
|
||||
v-model="BillForm.year"
|
||||
type="years"
|
||||
format="YYYY"
|
||||
value-format="YYYY"
|
||||
placeholder="选择账单生成年份"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<el-date-picker
|
||||
format="YYYY-MM"
|
||||
value-format="YYYY-MM"
|
||||
v-else
|
||||
v-model="BillForm.yearMonths"
|
||||
type="months"
|
||||
placeholder="选择账单生成月份"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="BillVisible = false">关闭</el-button>
|
||||
<el-button type="primary" @click="handleChangeApi"> 生成 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -72,7 +103,7 @@
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import pagination from '@/components/Pagination/index.vue';
|
||||
import DictTag from '@/components/DictTag/index.vue';
|
||||
import { listBill } from '@/api/system/SdbBill';
|
||||
import { listBill, manualGenerateApi } from '@/api/system/SdbBill';
|
||||
import { BillVO, BillQuery, BillForm } from '@/api/system/SdbBill/type';
|
||||
import { listChargeItem } from '@/api/system/SdbChargeItem';
|
||||
import { checkPermi } from '@/utils/permission';
|
||||
@@ -92,7 +123,7 @@ const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
|
||||
const ShowHouselist = ['2049026484272791553', '2049026503017136129'];
|
||||
const ShowHouseList = ['2049026484272791553', '2049026503017136129'];
|
||||
|
||||
const initFormData: BillForm = {
|
||||
id: undefined,
|
||||
@@ -104,7 +135,7 @@ const initFormData: BillForm = {
|
||||
endDate: undefined,
|
||||
villageId: undefined,
|
||||
remark: undefined,
|
||||
cerateTime: undefined
|
||||
createTime: undefined
|
||||
};
|
||||
const data = reactive<PageData<BillForm, BillQuery>>({
|
||||
form: { ...initFormData },
|
||||
@@ -116,7 +147,7 @@ const data = reactive<PageData<BillForm, BillQuery>>({
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form } = toRefs(data);
|
||||
const { queryParams } = toRefs(data);
|
||||
|
||||
const chargeItems = ref([]);
|
||||
function init() {
|
||||
@@ -176,7 +207,7 @@ const handleUpdate = (row?: BillVO) => {
|
||||
});
|
||||
};
|
||||
|
||||
function handleMain(row) {
|
||||
function handleMain(row: BillVO) {
|
||||
router.push({
|
||||
path: '/sdb/sdbbillMain',
|
||||
query: {
|
||||
@@ -184,6 +215,44 @@ function handleMain(row) {
|
||||
}
|
||||
});
|
||||
}
|
||||
const BillVisible = ref(false);
|
||||
const BillForm = ref<{
|
||||
title: string;
|
||||
billId: string;
|
||||
chargePeriod: string;
|
||||
yearMonths?: string[];
|
||||
year?: string[];
|
||||
}>({
|
||||
title: '',
|
||||
billId: '',
|
||||
chargePeriod: '1'
|
||||
});
|
||||
function handleChange(row: BillVO) {
|
||||
clearChangeBillForm();
|
||||
BillVisible.value = true;
|
||||
BillForm.value.title = row.billName;
|
||||
BillForm.value.chargePeriod = row.chargePeriod;
|
||||
BillForm.value.billId = row.id;
|
||||
if (BillForm.value.chargePeriod === '1') {
|
||||
BillForm.value['yearMonths'] = [];
|
||||
} else {
|
||||
BillForm.value['year'] = [];
|
||||
}
|
||||
}
|
||||
function handleChangeApi() {
|
||||
manualGenerateApi(BillForm.value).then((res) => {
|
||||
ElMessage.success(res.msg);
|
||||
clearChangeBillForm();
|
||||
BillVisible.value = false;
|
||||
});
|
||||
}
|
||||
function clearChangeBillForm() {
|
||||
BillForm.value = {
|
||||
title: '',
|
||||
billId: '',
|
||||
chargePeriod: '1'
|
||||
};
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
|
||||
@@ -40,14 +40,14 @@
|
||||
</el-col>
|
||||
<right-toolbar :show-add="false" :show-edit="false" :show-delete="false">
|
||||
<template #dropdown>
|
||||
<el-dropdown-item @click="handleMarkqrcode" v-if="checkPermi(['equipment:addqrcode:electricitydevice'])">
|
||||
<el-dropdown-item @click="handleMarkQRCode" v-if="checkPermi(['equipment:addqrcode:electricitydevice'])">
|
||||
<span>批量生成条形码</span>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click="handleMarkQrcodeZip" v-if="checkPermi(['equipment:addqrcode:electricitydevice'])">
|
||||
<span>批量下载条形码</span>
|
||||
</el-dropdown-item>
|
||||
<!-- <el-dropdown-item v-has-permi="['equipment:addqrcode:electricitydevice']">
|
||||
<div @click="handleMarkqrcode">批量更新固件</div>
|
||||
<div @click="handleMarkQRCode">批量更新固件</div>
|
||||
</el-dropdown-item> -->
|
||||
</template>
|
||||
</right-toolbar>
|
||||
@@ -171,7 +171,7 @@
|
||||
</el-card>
|
||||
<!-- 添加或修改电 设备对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form v-if="dialogType === 'usedWater'" :rules="rules" ref="UsedWaterformRef" :model="UsedWaterform" label-width="100px">
|
||||
<el-form v-if="dialogType === 'usedWater'" :rules="rules" ref="UsedWaterFormRef" :model="UsedWaterform" label-width="100px">
|
||||
<el-form-item label="设备编号" prop="deviceCode"> {{ UsedWaterform.deviceCode }} </el-form-item>
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker
|
||||
@@ -198,7 +198,7 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-form v-else-if="dialogType === 'Upload'" ref="UploadFileformRef" :model="UploadFileform" :rules="UploadFileformRules" label-width="100px">
|
||||
<el-form v-else-if="dialogType === 'Upload'" ref="UploadFileFormRef" :model="UploadFileForm" :rules="UploadFileFormRules" label-width="100px">
|
||||
<el-form-item label="上传更新文件" prop="file">
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
@@ -227,9 +227,9 @@
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">更新到设备</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-form v-else-if="dialogType === 'UpdateHouse'" ref="EditHouseformRef" :model="EditHouseform" :rules="EditHouseformRules" label-width="100px">
|
||||
<el-form v-else-if="dialogType === 'UpdateHouse'" ref="EditHouseFormRef" :model="EditHouseForm" :rules="EditHouseFormRules" label-width="100px">
|
||||
<el-form-item label="更新户号" prop="houseId">
|
||||
<el-cascader v-model="userHousepath" :options="treedata" @change="handleChange" />
|
||||
<el-cascader v-model="userHousePath" :options="treeData" @change="handleChange" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="unSubmit">取消</el-button>
|
||||
@@ -264,8 +264,6 @@ import { checkPermi } from '@/utils/permission';
|
||||
import { Upload } from '@element-plus/icons-vue';
|
||||
import { CascaderValue, UploadProps, UploadRawFile } from 'element-plus';
|
||||
import { exportImagesToZip } from '@/utils/exportZip';
|
||||
import { WaterDeviceVO } from '@/api/system/SdbWaterDevice/type';
|
||||
import { waterDeviceUnbind } from '@/api/system/SdbWaterDevice';
|
||||
|
||||
const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/electricityDevice/upload';
|
||||
|
||||
@@ -311,7 +309,7 @@ const getList = async () => {
|
||||
};
|
||||
// ! 用电量 =============================================================================
|
||||
const usedWaterInfo = ref(true);
|
||||
const UsedWaterformRef = ref(null);
|
||||
const UsedWaterFormRef = ref(null);
|
||||
const UsedWaterform = ref({
|
||||
deviceCode: '',
|
||||
startTime: '',
|
||||
@@ -349,14 +347,14 @@ function handleEndTime(val: string) {
|
||||
// ! =======================================================================================
|
||||
|
||||
// ? 上传固件 ==============================================================================================
|
||||
const UploadFileformRef = ref(null);
|
||||
const UploadFileFormRef = ref(null);
|
||||
const uploadRef = ref(null);
|
||||
const UploadFileform = ref({
|
||||
const UploadFileForm = ref({
|
||||
id: '',
|
||||
deviceCode: '',
|
||||
file: ''
|
||||
});
|
||||
const UploadFileformRules = {
|
||||
const UploadFileFormRules = {
|
||||
file: [{ required: true, message: '更新文件不能为空', trigger: 'blur' }]
|
||||
};
|
||||
// 携带token
|
||||
@@ -387,18 +385,18 @@ const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile: UploadRawFile)
|
||||
return true;
|
||||
};
|
||||
const handleAvatarSuccess: UploadProps['onSuccess'] = (response: any) => {
|
||||
UploadFileform.value.file = response.data.url;
|
||||
UploadFileForm.value.file = response.data.url;
|
||||
};
|
||||
|
||||
// ? 上传固件 ==============================================================================================
|
||||
|
||||
// * 编辑房屋 ==============================================================================================
|
||||
// 编辑房屋
|
||||
const EditHouseformRef = ref(null);
|
||||
const EditHouseformRules = {
|
||||
const EditHouseFormRef = ref(null);
|
||||
const EditHouseFormRules = {
|
||||
file: [{ required: true, message: '更新文件不能为空', trigger: 'blur' }]
|
||||
};
|
||||
const EditHouseform = ref({
|
||||
const EditHouseForm = ref({
|
||||
id: '',
|
||||
deviceCode: '',
|
||||
houseId: ''
|
||||
@@ -406,7 +404,7 @@ const EditHouseform = ref({
|
||||
// * 编辑房屋 ==============================================================================================
|
||||
|
||||
/** 批量生成 条形码 */
|
||||
function handleMarkqrcode() {
|
||||
function handleMarkQRCode() {
|
||||
if (ids.value.length > 0) {
|
||||
ElectricityDeviceMakerQrcode(ids.value).then(() => {
|
||||
ElMessage.success('批量生成成功');
|
||||
@@ -423,12 +421,12 @@ function handleMarkQrcodeZip() {
|
||||
const matchedList = ElectricityDeviceList.value.filter((item) => {
|
||||
return selectedIds.has(item.id) && item.url;
|
||||
});
|
||||
produceQRzip(matchedList);
|
||||
produceQRZip(matchedList);
|
||||
} else {
|
||||
ElMessage.warning('请选择设备');
|
||||
}
|
||||
}
|
||||
function produceQRzip(vals: ElectricityDeviceVO[]) {
|
||||
function produceQRZip(vals: ElectricityDeviceVO[]) {
|
||||
const arr = vals.map((item) => {
|
||||
return {
|
||||
name: item.deviceCode,
|
||||
@@ -464,12 +462,12 @@ const handleQrCode = (row: ElectricityDeviceVO) => {
|
||||
});
|
||||
};
|
||||
// * house
|
||||
const treedata = ref([]);
|
||||
const treeData = ref([]);
|
||||
const houseStore = useHouseStore();
|
||||
const userHousepath = ref<CascaderValue>([]);
|
||||
const userHousePath = ref<CascaderValue>([]);
|
||||
function handleChange(val: CascaderValue) {
|
||||
userHousepath.value = val;
|
||||
EditHouseform.value.houseId = val[2];
|
||||
userHousePath.value = val;
|
||||
EditHouseForm.value.houseId = val[2];
|
||||
}
|
||||
// * house
|
||||
const dialogType = ref<'usedWater' | 'Upload' | 'UpdateHouse'>('usedWater');
|
||||
@@ -486,13 +484,13 @@ const handleOpenDialog = (type: 'usedWater' | 'Upload' | 'UpdateHouse', row: Ele
|
||||
UsedWaterform.value.endTime = '';
|
||||
usedWaterInfo.value = true;
|
||||
} else if (type === 'Upload') {
|
||||
UploadFileform.value.file = '';
|
||||
UploadFileform.value.deviceCode = row.deviceCode;
|
||||
UploadFileform.value.id = row.id;
|
||||
UploadFileForm.value.file = '';
|
||||
UploadFileForm.value.deviceCode = row.deviceCode;
|
||||
UploadFileForm.value.id = row.id;
|
||||
} else if (type === 'UpdateHouse') {
|
||||
EditHouseform.value.id = row.id;
|
||||
EditHouseform.value.deviceCode = row.deviceCode;
|
||||
EditHouseform.value.houseId = '';
|
||||
EditHouseForm.value.id = row.id;
|
||||
EditHouseForm.value.deviceCode = row.deviceCode;
|
||||
EditHouseForm.value.houseId = '';
|
||||
getTree();
|
||||
}
|
||||
};
|
||||
@@ -509,10 +507,10 @@ function handleUnbind(data: ElectricityDeviceVO) {
|
||||
}
|
||||
|
||||
function getTree() {
|
||||
treedata.value = [];
|
||||
treeData.value = [];
|
||||
houseStore.getCurrentVilageTreeHouse().then((res) => {
|
||||
treedata.value = res;
|
||||
userHousepath.value = [];
|
||||
treeData.value = res;
|
||||
userHousePath.value = [];
|
||||
});
|
||||
}
|
||||
|
||||
@@ -526,7 +524,7 @@ const submitForm = () => {
|
||||
ElMessage.warning('请选择时间');
|
||||
return;
|
||||
}
|
||||
UsedWaterformRef.value?.validate(async (valid: boolean) => {
|
||||
UsedWaterFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
await getElectricityDeviceTimeRangeUsedWater(UsedWaterform.value)
|
||||
@@ -541,12 +539,12 @@ const submitForm = () => {
|
||||
}
|
||||
});
|
||||
} else if (dialogType.value === 'UpdateHouse') {
|
||||
EditHouseformRef.value?.validate(async (valid: boolean) => {
|
||||
EditHouseFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
await updateElectricityDevice(EditHouseform.value).finally(() => (buttonLoading.value = false));
|
||||
await updateElectricityDevice(EditHouseForm.value).finally(() => (buttonLoading.value = false));
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
getList();
|
||||
await getList();
|
||||
unSubmit();
|
||||
}
|
||||
});
|
||||
@@ -571,18 +569,18 @@ const reset = () => {
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
};
|
||||
EditHouseform.value = {
|
||||
EditHouseForm.value = {
|
||||
houseId: '',
|
||||
deviceCode: '',
|
||||
id: ''
|
||||
};
|
||||
UploadFileform.value.file = '';
|
||||
UploadFileForm.value.file = '';
|
||||
// 上传 清空
|
||||
UploadFileformRef.value?.resetFields();
|
||||
UploadFileFormRef.value?.resetFields();
|
||||
// 使用电量 清空
|
||||
EditHouseformRef.value?.resetFields();
|
||||
EditHouseFormRef.value?.resetFields();
|
||||
// 使用电量 清空
|
||||
UsedWaterformRef.value?.resetFields();
|
||||
UsedWaterFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
|
||||
Reference in New Issue
Block a user