同步6/16
This commit is contained in:
@@ -52,6 +52,9 @@
|
||||
<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-menu> -->
|
||||
<!-- <el-dropdown-item v-hasPermi="['equipment:addqrcode:electricitydevice']">
|
||||
<div @click="handleMarkqrcode">批量更新固件</div>
|
||||
@@ -74,15 +77,15 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="分合状态" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<div class="readRecord" v-if="scope.row.waterRecord">
|
||||
<DictTag :options="com_electricity_readrecord_status" :value="scope.row.waterRecord.status"></DictTag>
|
||||
<div class="readRecord" v-if="scope.row.electricityRecord">
|
||||
<DictTag :options="com_electricity_readrecord_status" :value="scope.row.electricityRecord.status"></DictTag>
|
||||
</div>
|
||||
<span v-else>---</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="房屋号" align="center" prop="houseName" />
|
||||
<el-table-column label="余额" width="100" align="center" prop="elePrice">
|
||||
<template #defaul="scope">
|
||||
<el-table-column label="余额" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.electricityRecord">{{ scope.row.electricityRecord.balance }}</span>
|
||||
<span v-else>---</span>
|
||||
</template>
|
||||
@@ -106,7 +109,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="抄表时间" align="center">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.waterRecord ? scope.row.waterRecord.readTime : '--' }}</span>
|
||||
<span>{{ scope.row.electricityRecord ? scope.row.electricityRecord.readTime : '--' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column width="150" label="启停" align="center" prop="deleted" v-hasPermi="['equipment:isUse:electricitydevice']">
|
||||
@@ -265,8 +268,8 @@ import { useUserStore } from '@/store/modules/user';
|
||||
import { checkPermi } from '@/utils/permission';
|
||||
import { Upload } from '@element-plus/icons-vue';
|
||||
import { CascaderValue, tourEmits, UploadProps, UploadRawFile } from 'element-plus';
|
||||
import { exportImagesToZip } from '@/utils/exportZip';
|
||||
|
||||
const huhao = 3096371295;
|
||||
const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/electricityDevice/upload';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
@@ -408,7 +411,7 @@ const EditHouseform = ref({
|
||||
/** 批量生成 条形码 */
|
||||
function handleMarkqrcode() {
|
||||
if (ids.value.length > 0) {
|
||||
ElectricityDeviceMakerQrcode(ids.value).then((res) => {
|
||||
ElectricityDeviceMakerQrcode(ids.value).then(() => {
|
||||
ElMessage.success('批量生成成功');
|
||||
getList();
|
||||
});
|
||||
@@ -416,6 +419,28 @@ function handleMarkqrcode() {
|
||||
ElMessage.warning('请选择设备');
|
||||
}
|
||||
}
|
||||
/** 批量下载条形码 */
|
||||
function handleMarkQrcodeZip() {
|
||||
if (ids.value.length > 0) {
|
||||
const selectedIds = new Set(ids.value.map((item) => item.id));
|
||||
const matchedList = ElectricityDeviceList.value.filter((item) => {
|
||||
return selectedIds.has(item.id) && item.url;
|
||||
});
|
||||
produceQRzip(matchedList);
|
||||
} else {
|
||||
ElMessage.warning('请选择设备');
|
||||
}
|
||||
}
|
||||
function produceQRzip(vals: ElectricityDeviceVO[]) {
|
||||
const arr = vals.map((item) => {
|
||||
return {
|
||||
name: item.deviceCode,
|
||||
url: item.url
|
||||
};
|
||||
});
|
||||
exportImagesToZip(arr, 'ele_images');
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: ElectricityDeviceVO[]) => {
|
||||
ids.value = selection.map((item) => {
|
||||
|
||||
Reference in New Issue
Block a user