This commit is contained in:
wangweidong 2025-10-27 15:17:09 +08:00
commit 581c080f11
6 changed files with 912 additions and 747 deletions

View File

@ -6,6 +6,45 @@
:wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="5">
<a-form-item name="keyWord">
<template #label><span title="物料信息">物料信息</span></template>
<j-input placeholder="请输入物料名称/拼音/编码" v-model:value="queryParam.keyWord" allow-clear
:type="'default'"></j-input>
</a-form-item>
</a-col>
<a-col :lg="5">
<a-form-item name="categoryId">
<template #label><span title="一级分类">一级分类</span></template>
<j-dict-select-tag v-model:value="queryParam.categoryId"
:dictCode="`nu_config_material_category,category_name,id,del_flag = 0 and iz_enabled = 0 order by sort asc`"
placeholder="请选择一级分类" allowClear :ignoreDisabled="true"
@select="handleSearch({ 'levle': 1, 'key': queryParam.categoryId }, false)" />
<!-- <span v-else>请选择源平台</span> -->
</a-form-item>
</a-col>
<a-col :lg="5">
<a-form-item name="typeId">
<template #label><span title="二级分类">二级分类</span></template>
<j-dict-select-tag type="list" v-model:value="queryParam.typeId"
:dictCode="`nu_config_material_type,type_name,id,del_flag = 0 and iz_enabled = 0 and category_id = '${queryParam.categoryId || ''}' `"
placeholder="请选择二级分类" allowClear :ignoreDisabled="true"
@select="handleSearch({ 'levle': 2, 'categoryId': queryParam.categoryId, 'key': queryParam.typeId }, false)" />
</a-form-item>
</a-col>
<a-col :lg="5">
<a-form-item name="medicationId">
<template #label><span title="三级分类">三级分类</span></template>
<j-dict-select-tag type="list" v-model:value="queryParam.medicationId"
:dictCode="`nu_config_material_medication,medication_name,id,del_flag = 0 and iz_enabled = 0 and category_id = '${queryParam.categoryId || ''}' and type_id = '${queryParam.typeId || ''}' `"
placeholder="请选择三级分类" allowClear :ignoreDisabled="true"
@select="handleSearch({ 'levle': 3, 'categoryId': queryParam.categoryId, 'typeId': queryParam.typeId, 'key': queryParam.medicationId }, false)" />
</a-form-item>
</a-col>
<!-- <a-col :lg="5">
<a-form-item name="materialName">
<template #label><span title="物料名称">物料名称</span></template>
<j-input placeholder="请输入物料名称" v-model:value="queryParam.materialName" allow-clear></j-input>
@ -22,8 +61,8 @@
<template #label><span title="拼音检索">拼音检索</span></template>
<j-input placeholder="请输入拼音" v-model:value="queryParam.pinyin" allow-clear></j-input>
</a-form-item>
</a-col>
<a-col :lg="5">
</a-col> -->
<a-col :lg="4">
<a-form-item name="izEnabled">
<template #label><span title="是否启用">是否启用</span></template>
<j-dict-select-tag type='list' placeholder="请选择是否启用" v-model:value="queryParam.izEnabled"
@ -59,22 +98,26 @@
</div>
</div>
<a-menu style="width: 100%;" mode="inline" >
<a-menu style="width: 100%;" mode="inline">
<template v-for="item in treeData">
<!-- 第一层判断是否有下级 -->
<a-sub-menu v-if="item.children && item.children.length > 0" :key="item.key" @titleClick="handleSearch(item)" @mouseenter="item.showContent = true" @mouseleave="item.showContent = false">
<a-sub-menu v-if="item.children && item.children.length > 0" :key="item.key"
@titleClick="handleSearch(item)" @mouseenter="item.showContent = true"
@mouseleave="item.showContent = false">
<template #icon>
<Icon :icon="item.icon" :size="20" v-if="item.icon" />
<Icon icon="ant-design:appstore-add-outlined" :size="20" v-else />
<Icon :icon="item.icon" :size="20" v-if="item.icon" />
<Icon icon="ant-design:appstore-add-outlined" :size="20" v-else />
</template>
<template #title>
<span >{{ item?.title }}
<span>{{ item?.title }}
<span v-if="item?.izEnabled == '1'" style="color:red;">(已停用)</span>
<span v-show="item.showContent">
<!-- 下拉菜单 -->
<a-dropdown >
<a-dropdown>
<template #overlay>
<ConfigMaterialInfoListMenu :data="item" @handleAddbj="handleAddbj" @handleAddxj="handleAddxj" @handleAdd="handleAdd" @handleFenleiEdit="handleFenleiEdit" @handleQyty="handleQyty" @handleQianyi="handleQianyi" />
<ConfigMaterialInfoListMenu :data="item" @handleAddbj="handleAddbj" @handleAddxj="handleAddxj"
@handleAdd="handleAdd" @handleFenleiEdit="handleFenleiEdit" @handleQyty="handleQyty"
@handleQianyi="handleQianyi" />
</template>
<!-- 图标 -->
<a class="ant-dropdown-link" style="color:#1890FF;" @click.prevent>
@ -86,19 +129,23 @@
</template>
<!-- 第二级 -->
<template v-for="child in item.children">
<a-sub-menu :key="child.key" v-if="child.children && child.children.length > 0" @titleClick="handleSearch(child)" @mouseenter="child.showContent = true" @mouseleave="child.showContent = false" >
<template #icon >
<a-sub-menu :key="child.key" v-if="child.children && child.children.length > 0"
@titleClick="handleSearch(child)" @mouseenter="child.showContent = true"
@mouseleave="child.showContent = false">
<template #icon>
<Icon :icon="child.icon" :size="20" v-if="child.icon" />
<Icon icon="ant-design:appstore-add-outlined" :size="20" v-else />
</template>
<template #title >
<span >{{ child?.title }}
<template #title>
<span>{{ child?.title }}
<span v-if="child?.izEnabled == '1'" style="color:red;">(已停用)</span>
<span v-show="child.showContent">
<!-- 下拉菜单 -->
<a-dropdown >
<a-dropdown>
<template #overlay>
<ConfigMaterialInfoListMenu :data="child" @handleAddbj="handleAddbj" @handleAddxj="handleAddxj" @handleAdd="handleAdd" @handleFenleiEdit="handleFenleiEdit" @handleQyty="handleQyty" @handleQianyi="handleQianyi" />
<ConfigMaterialInfoListMenu :data="child" @handleAddbj="handleAddbj"
@handleAddxj="handleAddxj" @handleAdd="handleAdd" @handleFenleiEdit="handleFenleiEdit"
@handleQyty="handleQyty" @handleQianyi="handleQianyi" />
</template>
<!-- 图标 -->
<a class="ant-dropdown-link" style="color:#1890FF;" @click.prevent>
@ -109,17 +156,21 @@
</span>
</template>
<!-- 第三层 -->
<a-menu-item :key="childThree.key" v-for="childThree in child.children" @click="handleSearch(childThree)" @mouseenter="childThree.showContent = true" @mouseleave="childThree.showContent = false">
<a-menu-item :key="childThree.key" v-for="childThree in child.children"
@click="handleSearch(childThree)" @mouseenter="childThree.showContent = true"
@mouseleave="childThree.showContent = false">
<template #icon>
<Icon :icon="childThree.icon" :size="20" v-if="childThree.icon" />
<Icon icon="ant-design:appstore-add-outlined" :size="20" v-else />
</template>
<span >{{ childThree?.title }}
<span>{{ childThree?.title }}
<span v-if="childThree?.izEnabled == '1'" style="color:red;">(已停用)</span>
<span v-show="childThree.showContent">
<a-dropdown >
<a-dropdown>
<template #overlay>
<ConfigMaterialInfoListMenu :data="childThree" @handleAddbj="handleAddbj" @handleAddxj="handleAddxj" @handleAdd="handleAdd" @handleFenleiEdit="handleFenleiEdit" @handleQyty="handleQyty" @handleQianyi="handleQianyi" />
<ConfigMaterialInfoListMenu :data="childThree" @handleAddbj="handleAddbj"
@handleAddxj="handleAddxj" @handleAdd="handleAdd" @handleFenleiEdit="handleFenleiEdit"
@handleQyty="handleQyty" @handleQianyi="handleQianyi" />
</template>
<a class="ant-dropdown-link" style="color:#1890FF;" @click.prevent>
<Icon icon="ant-design:setting-outlined" />
@ -129,7 +180,9 @@
</span>
</a-menu-item>
</a-sub-menu>
<a-menu-item :key="child.key" v-if="!child.children || child.children.length < 1" @click="handleSearch(child)" @mouseenter="child.showContent = true" @mouseleave="child.showContent = false">
<a-menu-item :key="child.key" v-if="!child.children || child.children.length < 1"
@click="handleSearch(child)" @mouseenter="child.showContent = true"
@mouseleave="child.showContent = false">
<template #icon>
<Icon :icon="child.icon" :size="20" v-if="child.icon" />
<Icon icon="ant-design:appstore-add-outlined" :size="20" v-else />
@ -138,9 +191,11 @@
<span v-if="child?.izEnabled == '1'" style="color:red;">(已停用)</span>
<span v-show="child.showContent">
<!-- 下拉菜单 -->
<a-dropdown >
<a-dropdown>
<template #overlay>
<ConfigMaterialInfoListMenu :data="child" @handleAddbj="handleAddbj" @handleAddxj="handleAddxj" @handleAdd="handleAdd" @handleFenleiEdit="handleFenleiEdit" @handleQyty="handleQyty" @handleQianyi="handleQianyi" />
<ConfigMaterialInfoListMenu :data="child" @handleAddbj="handleAddbj"
@handleAddxj="handleAddxj" @handleAdd="handleAdd" @handleFenleiEdit="handleFenleiEdit"
@handleQyty="handleQyty" @handleQianyi="handleQianyi" />
</template>
<!-- 图标 -->
<a class="ant-dropdown-link" style="color:#1890FF;" @click.prevent>
@ -152,7 +207,8 @@
</a-menu-item>
</template>
</a-sub-menu>
<a-menu-item :key="item.key" v-if="!item.children || item.children.length < 1" @click="handleSearch(item)" @mouseenter="item.showContent = true" @mouseleave="item.showContent = false">
<a-menu-item :key="item.key" v-if="!item.children || item.children.length < 1" @click="handleSearch(item)"
@mouseenter="item.showContent = true" @mouseleave="item.showContent = false">
<template #icon>
<Icon :icon="item.icon" :size="20" v-if="item.icon" />
<Icon icon="ant-design:appstore-add-outlined" :size="20" v-else />
@ -161,9 +217,11 @@
<span v-if="item?.izEnabled == '1'" style="color:red;">(已停用)</span>
<span v-show="item.showContent">
<!-- 下拉菜单 -->
<a-dropdown >
<a-dropdown>
<template #overlay>
<ConfigMaterialInfoListMenu :data="item" @handleAddbj="handleAddbj" @handleAddxj="handleAddxj" @handleAdd="handleAdd" @handleFenleiEdit="handleFenleiEdit" @handleQyty="handleQyty" @handleQianyi="handleQianyi" />
<ConfigMaterialInfoListMenu :data="item" @handleAddbj="handleAddbj" @handleAddxj="handleAddxj"
@handleAdd="handleAdd" @handleFenleiEdit="handleFenleiEdit" @handleQyty="handleQyty"
@handleQianyi="handleQianyi" />
</template>
<!-- 图标 -->
<a class="ant-dropdown-link" style="color:#1890FF;" @click.prevent>
@ -548,7 +606,7 @@ function handleWlQyty(record) {
}
//
function handleSearch(data) {
function handleSearch(data, izReload = true) {
console.log("🚀 ~ handleSearch ~ data:", data)
var levle = parseInt(data.levle)
if (levle == 1) {
@ -564,7 +622,9 @@ function handleSearch(data) {
queryParam.typeId = data.typeId
queryParam.medicationId = data.key
}
reload();
if (izReload) {
reload();
}
}
//
function handleAddbj(data) {

View File

@ -2,25 +2,60 @@
<div class="p-2">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6" hidden>
<a-form-item name="nuId">
<template #label><span title="库房">库房</span></template>
<j-dict-select-tag type='list' placeholder="请选择库房" v-model:value="queryParam.nuId" dictCode="nu_base_info,nu_name,nu_id,area_flag = '3'" allow-clear />
<j-dict-select-tag type='list' placeholder="请选择库房" v-model:value="queryParam.nuId"
dictCode="nu_base_info,nu_name,nu_id,area_flag = '3'" allow-clear />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-col :lg="5">
<a-form-item name="wlParamInfo">
<template #label><span title="物料信息">物料信息</span></template>
<a-input placeholder="请填写物料信息" v-model:value="queryParam.wlParamInfo" allow-clear></a-input>
<a-input placeholder="请填写物料信息" v-model:value="queryParam.wlParamInfo" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-col :lg="5">
<a-form-item name="categoryId">
<template #label><span title="一级分类">一级分类</span></template>
<j-dict-select-tag v-model:value="queryParam.categoryId"
:dictCode="`nu_config_material_category,category_name,id,del_flag = 0 and iz_enabled = 0 order by sort asc`"
placeholder="请选择一级分类" allowClear :ignoreDisabled="true"
@select="handleSearch({ 'levle': 1, 'key': queryParam.categoryId }, false)" />
<!-- <span v-else>请选择源平台</span> -->
</a-form-item>
</a-col>
<a-col :lg="5">
<a-form-item name="typeId">
<template #label><span title="二级分类">二级分类</span></template>
<j-dict-select-tag type="list" v-model:value="queryParam.typeId"
:dictCode="`nu_config_material_type,type_name,id,del_flag = 0 and iz_enabled = 0 and category_id = '${queryParam.categoryId || ''}' `"
placeholder="请选择二级分类" allowClear :ignoreDisabled="true"
@select="handleSearch({ 'levle': 2, 'categoryId': queryParam.categoryId, 'key': queryParam.typeId }, false)" />
</a-form-item>
</a-col>
<a-col :lg="5">
<a-form-item name="medicationId">
<template #label><span title="三级分类">三级分类</span></template>
<j-dict-select-tag type="list" v-model:value="queryParam.medicationId"
:dictCode="`nu_config_material_medication,medication_name,id,del_flag = 0 and iz_enabled = 0 and category_id = '${queryParam.categoryId || ''}' and type_id = '${queryParam.typeId || ''}' `"
placeholder="请选择三级分类" allowClear :ignoreDisabled="true"
@select="handleSearch({ 'levle': 3, 'categoryId': queryParam.categoryId, 'typeId': queryParam.typeId, 'key': queryParam.medicationId }, false)" />
</a-form-item>
</a-col>
<a-col :xl="2" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-col>
@ -28,14 +63,15 @@
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" >
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'warehouseMaterialInfo:bl_warehouse_material_info:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 选择物料</a-button>
<a-button type="primary" v-auth="'warehouseMaterialInfo:bl_warehouse_material_info:add'" @click="handleAdd"
preIcon="ant-design:plus-outlined"> 选择物料</a-button>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
<TableAction :actions="getTableAction(record)" />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
@ -45,226 +81,254 @@
<!-- 选择物料 -->
<CheckWuliaoModal ref="registerAddModal" @success="handleSuccess"></CheckWuliaoModal>
<!-- 出入库详情 -->
<NuWarehouseMaterialCrkInfoListModal ref="registerCrkModal" @success="handleSuccess"></NuWarehouseMaterialCrkInfoListModal>
<NuWarehouseMaterialCrkInfoListModal ref="registerCrkModal" @success="handleSuccess">
</NuWarehouseMaterialCrkInfoListModal>
</div>
</template>
<script lang="ts" name="warehouseMaterialInfo-blWarehouseMaterialInfo" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './BlWarehouseMaterialInfo.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './BlWarehouseMaterialInfo.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import BlWarehouseMaterialInfoModal from './components/BlWarehouseMaterialInfoModal.vue'
import CheckWuliaoModal from './components/CheckWuliaoModal.vue'
import NuWarehouseMaterialCrkInfoListModal from '/@/views/invoicing/warehouseMaterialInfo/NuWarehouseMaterialCrkInfoListModal.vue'
import { useUserStore } from '/@/store/modules/user';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { JInput } from '/@/components/Form';
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './BlWarehouseMaterialInfo.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './BlWarehouseMaterialInfo.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import BlWarehouseMaterialInfoModal from './components/BlWarehouseMaterialInfoModal.vue'
import CheckWuliaoModal from './components/CheckWuliaoModal.vue'
import NuWarehouseMaterialCrkInfoListModal from '/@/views/invoicing/warehouseMaterialInfo/NuWarehouseMaterialCrkInfoListModal.vue'
import { useUserStore } from '/@/store/modules/user';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { JInput } from '/@/components/Form';
import { defHttp } from '/@/utils/http/axios';
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const registerAddModal = ref();
const registerCrkModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '库房物料配置信息',
api: list,
columns,
canResize:false,
useSearchForm: false,
immediate: false,
actionColumn: {
width: 180,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const registerAddModal = ref();
const registerCrkModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '库房物料配置信息',
api: list,
columns,
canResize: false,
useSearchForm: false,
immediate: false,
actionColumn: {
width: 180,
fixed: 'right',
},
exportConfig: {
name: "库房物料配置信息",
url: getExportUrl,
params: queryParam,
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
},
exportConfig: {
name: "库房物料配置信息",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: 24,
sm: 4,
xl: 6,
xxl: 6
});
const wrapperCol = reactive({
xs: 24,
sm: 18,
});
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:6
});
const wrapperCol = reactive({
xs: 24,
sm: 18,
searchQuery();
}
/**
* 新增事件
*/
function handleAdd() {
var params = { nuId: queryParam.nuId }
registerAddModal.value.disableSubmit = false;
registerAddModal.value.edit(params);
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
//
function handleCrkjl(record: Recordable) {
registerCrkModal.value.disableSubmit = true;
registerCrkModal.value.init(record);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
// {
// label: '',
// onClick: handleEdit.bind(null, record),
// auth: 'warehouseMaterialInfo:bl_warehouse_material_info:edit'
// },
// {
// label: '',
// onClick: handleDetail.bind(null, record),
// },
{
label: '启用',
onClick: handleQyty.bind(null, record, '0'),
auth: 'warehouseMaterialInfo:bl_warehouse_material_info:edit',
ifShow: record.izEnabled == '1'
},
{
label: '停用',
onClick: handleQyty.bind(null, record, '1'),
auth: 'warehouseMaterialInfo:bl_warehouse_material_info:edit',
ifShow: record.izEnabled == '0'
},
{
label: '记录',
onClick: handleCrkjl.bind(null, record, '1'),
},
];
}
function handleQyty(record, izEnabled) {
defHttp.put({ url: '/invoicing/blWarehouseMaterialInfo/edit', params: { id: record.id, izEnabled: izEnabled } }).then(res => {
handleSuccess();
});
}
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
searchQuery();
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 新增事件
*/
function handleAdd() {
var params = {nuId:queryParam.nuId}
registerAddModal.value.disableSubmit = false;
registerAddModal.value.edit(params);
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
//
function handleCrkjl(record: Recordable) {
registerCrkModal.value.disableSubmit = true;
registerCrkModal.value.init(record);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
// {
// label: '',
// onClick: handleEdit.bind(null, record),
// auth: 'warehouseMaterialInfo:bl_warehouse_material_info:edit'
// },
// {
// label: '',
// onClick: handleDetail.bind(null, record),
// },
{
label: '启用',
onClick: handleQyty.bind(null, record,'0'),
auth: 'warehouseMaterialInfo:bl_warehouse_material_info:edit',
ifShow: record.izEnabled == '1'
},
{
label: '停用',
onClick: handleQyty.bind(null, record,'1'),
auth: 'warehouseMaterialInfo:bl_warehouse_material_info:edit',
ifShow: record.izEnabled == '0'
},
{
label: '记录',
onClick: handleCrkjl.bind(null, record,'1'),
},
];
}
function handleQyty(record,izEnabled) {
defHttp.put({ url: '/invoicing/blWarehouseMaterialInfo/edit', params: { id: record.id,izEnabled:izEnabled} }).then(res => {
handleSuccess();
});
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
/**
* 查询
*/
function searchQuery() {
function init(record) {
queryParam.nuId = record.nuId;
reload();
}
function handleSearch(data, izReload = true) {
console.log("🚀 ~ handleSearch ~ data:", data)
var levle = parseInt(data.levle)
if (levle == 1) {
queryParam.categoryId = data.key
queryParam.typeId = ''
queryParam.medicationId = ''
} else if (levle == 2) {
queryParam.categoryId = data.categoryId
queryParam.typeId = data.key
queryParam.medicationId = ''
} else if (levle == 3) {
queryParam.categoryId = data.categoryId
queryParam.typeId = data.typeId
queryParam.medicationId = data.key
}
if (izReload) {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
}
function init(record){
queryParam.nuId = record.nuId;
reload();
}
defineExpose({
init,
});
defineExpose({
init,
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust{
min-width: 100px !important;
}
.query-group-split-cust{
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help){
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust {
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help) {
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),
:deep(.ant-input-number) {
width: 100%;
}
}
</style>

View File

@ -10,6 +10,12 @@
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
<template v-if="column.dataIndex === 'requestValue'">
<span >{{ (text == null || text == undefined) ? '-' : ((text == '0' || text == '0.00') ? 0 : text ) }}</span>
</template>
<template v-if="column.dataIndex === 'resolveValue'">
<span >{{ (text == null || text == undefined) ? '-' : ((text == '0' || text == '0.00') ? 0 : text ) }}</span>
</template>
</template>
</BasicTable>
<!-- 表单区域 -->

View File

@ -2,89 +2,98 @@
<div style="padding: 4px;">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="reload" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-form ref="formRef" @keyup.enter.native="reload" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="address">
<template #label><span title="SN">SN</span></template>
<j-input placeholder="请输入SN" v-model:value="queryParam.address" allow-clear ></j-input>
<j-input placeholder="请输入SN" v-model:value="queryParam.address" allow-clear :type="'default'"></j-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="nuId">
<template #label><span title="区域">区域</span></template>
<j-dict-select-tag type='list' v-model:value="queryParam.nuId" :dictCode="`nu_base_info,nu_name,nu_id`" placeholder="请选区域" allow-clear />
<j-dict-select-tag type='list' v-model:value="queryParam.nuId" :dictCode="`nu_base_info,nu_name,nu_id`"
placeholder="请选区域" allow-clear />
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="reload">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a-button type="primary" preIcon="ant-design:search-outlined" @click="reload">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button>
</a-col>
</a-row>
</a-form>
</div>
<a-row style="margin-top: -18px;">
<a-col v-for="(item,index) in tableData.records" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6" style="padding: 8px 6px 6px 8px;">
<a-card style="width: 100%;border-radius: 8px;" :headStyle="{ height: '70px', padding: '0 24px',border:'0px' }" :bodyStyle="{ padding: '24px 24px 4px 24px' }">
<a-col v-for="(item, index) in tableData.records" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6"
style="padding: 8px 6px 6px 8px;">
<a-card style="width: 100%;border-radius: 8px;" :headStyle="{ height: '70px', padding: '0 24px', border: '0px' }"
:bodyStyle="{ padding: '24px 24px 4px 24px' }">
<template #title>
<a-row style="font-weight: normal;">
<a-col :span="18" style="font-size: 14px;">
<div>SN<span style="font-weight: bold;">{{item.address}}</span></div>
<div style="font-size: 12px;">抄表时间{{item.readTime?item.readTime:'未抄表'}}</div>
</a-col>
<a-col :span="6" style="display: flex; justify-content: flex-end;">
<div :class="item.relayState=='1'?'zxClass':'lxClass'">{{item.relayState=='1'?'合闸':'拉闸'}}</div>
</a-col>
<a-col :span="24">
<a-divider style="margin: 10px 0 0 0" />
</a-col>
</a-row>
<a-row style="font-weight: normal;">
<a-col :span="18" style="font-size: 14px;">
<div>SN<span style="font-weight: bold;">{{ item.address }}</span></div>
<div style="font-size: 12px;">抄表时间{{ item.readTime ? item.readTime : '未抄表' }}</div>
</a-col>
<a-col :span="6" style="display: flex; justify-content: flex-end;">
<div :class="item.relayState == '1' ? 'zxClass' : 'lxClass'">{{ item.relayState == '1' ? '合闸' : '拉闸' }}</div>
</a-col>
<a-col :span="24">
<a-divider style="margin: 10px 0 0 0" />
</a-col>
</a-row>
</template>
<a-row style="margin-top:-10px;">
<a-col :span="12" style="margin-top: -10px;">{{item.nuId_dictText?item.nuId_dictText:'未配置'}}</a-col>
<a-col :span="12" style="text-align: right;margin-top: -10px;">
<span style="text-align: right;background:#f6f6f6;padding: 2px 10px;border-radius:5px;">NUID: {{item.nuId?item.nuId:'未配置'}}</span>
</a-col>
<a-col :span="14" style="text-align: right;font-size: 44px;font-weight: bold;margin-top:18px;">
<span>{{item.eleValue?item.eleValue:'0.00'}}</span>
</a-col>
<a-col :span="8" style="padding: 12px 0 0 5px;margin-top:18px;">
<div style="font-size: 12px;margin: 5px 0 -5px 2px;padding:2px;">KWH</div>
<div style="margin-top:-3px;"><span style="background:#eeeeee;padding: 2px;border-radius:5px;font-size:11px;">用电量</span></div>
</a-col>
</a-row>
<a-divider />
<p style="text-align:center;">
<span style="display:inline-block;cursor: pointer;" @click="handleRead(item)">
<span class="tbClass"><img src="../../../../assets/iot/a1.png" style="width:20px;" /></span><br/>
<span class="antTitle">抄表</span>
</span>
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleControlLz(item)" v-if="item.relayState=='1'">
<span class="tbClass"><img src="../../../../assets/iot/a5.png" style="width:20px;" /></span><br/>
<span class="antTitle">拉闸</span>
</span>
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleControlHz(item)" v-if="item.relayState=='0'">
<span class="tbClass"><img src="../../../../assets/iot/a2.png" style="width:20px;" /></span><br/>
<span class="antTitle">合闸</span>
</span>
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleReset(item)">
<span class="tbClass"><img src="../../../../assets/iot/a3.png" style="width:20px;" /></span><br/>
<span class="antTitle">清零</span>
</span>
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="showApiLog(item)">
<span class="tbClass"><img src="../../../../assets/iot/a4.png" style="width:20px;" /></span><br/>
<span class="antTitle">日志</span>
</span>
</p>
<a-row style="margin-top:-10px;">
<a-col :span="12" style="margin-top: -10px;">{{ item.nuId_dictText ? item.nuId_dictText : '未配置' }}</a-col>
<a-col :span="12" style="text-align: right;margin-top: -10px;">
<span style="text-align: right;background:#f6f6f6;padding: 2px 10px;border-radius:5px;">NUID:
{{ item.nuId ? item.nuId : '未配置' }}</span>
</a-col>
<a-col :span="14" style="text-align: right;font-size: 44px;font-weight: bold;margin-top:18px;">
<span>{{ item.eleValue ? item.eleValue : '0.00' }}</span>
</a-col>
<a-col :span="8" style="padding: 12px 0 0 5px;margin-top:18px;">
<div style="font-size: 12px;margin: 5px 0 -5px 2px;padding:2px;">KWH</div>
<div style="margin-top:-3px;"><span
style="background:#eeeeee;padding: 2px;border-radius:5px;font-size:11px;">用电量</span></div>
</a-col>
</a-row>
<a-divider />
<p style="text-align:center;">
<span style="display:inline-block;cursor: pointer;" @click="handleRead(item)">
<span class="tbClass"><img src="../../../../assets/iot/a1.png" style="width:20px;" /></span><br />
<span class="antTitle">抄表</span>
</span>
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleControlLz(item)"
v-if="item.relayState == '1'">
<span class="tbClass"><img src="../../../../assets/iot/a5.png" style="width:20px;" /></span><br />
<span class="antTitle">拉闸</span>
</span>
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleControlHz(item)"
v-if="item.relayState == '0'">
<span class="tbClass"><img src="../../../../assets/iot/a2.png" style="width:20px;" /></span><br />
<span class="antTitle">合闸</span>
</span>
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleReset(item)">
<span class="tbClass"><img src="../../../../assets/iot/a3.png" style="width:20px;" /></span><br />
<span class="antTitle">清零</span>
</span>
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="showApiLog(item)">
<span class="tbClass"><img src="../../../../assets/iot/a4.png" style="width:20px;" /></span><br />
<span class="antTitle">日志</span>
</span>
</p>
</a-card>
</a-col>
<a-col v-if="tableData.total==0" >
<a-col v-if="tableData.total == 0">
<div style="margin: 30px auto;">
<a-empty />
</div>
</a-col>
</a-row>
<div v-if="tableData.total > 0"
<div v-if="tableData.total > 0"
style="float:right;bottom: 20px;z-index: 999;padding: 8px 16px;border-radius: 4px;display: flex;align-items: center;">
<span style="margin-right: 10px;"> {{ tableData.total }} 条数据</span>
<Pagination showLessItems v-model:current="pageParams.pageNo" :pageSize="pageParams.pageSize" size="small"
@ -96,143 +105,143 @@
</template>
<script lang="ts" name="iot-nuIotRegionInfo" setup>
import {reactive, ref,h,onMounted} from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { Statistic } from 'ant-design-vue';
import {Modal} from "ant-design-vue";
import {list, eleReset, eleControl, eleRead } from './electricity.api';
import { reactive, ref, h, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { Statistic } from 'ant-design-vue';
import { Modal } from "ant-design-vue";
import { list, eleReset, eleControl, eleRead } from './electricity.api';
import { Pagination } from 'ant-design-vue';
import { JInput } from '/@/components/Form';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import ApiLogModal from "@/views/iot/tq/electricity/apilog/ApiLogModal.vue";
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import ApiLogModal from "@/views/iot/tq/electricity/apilog/ApiLogModal.vue";
import { set } from 'lodash-es';
const formRef = ref();
const queryParam = reactive<any>({});
const apiLogModal = ref();
const tableData = ref<any>([]);
const formRef = ref();
const queryParam = reactive<any>({});
const apiLogModal = ref();
const tableData = ref<any>([]);
const pageParams = ref({ pageNo: 1, pageSize: 8 })
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
const labelCol = reactive({
xs: 24,
sm: 4,
xl: 6,
xxl: 4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
//
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
//
reload();
}
//
async function handleRead(record) {
const params = {
'cid': record.cid,
'address': record.address,
};
await eleRead(params);
setTimeout(() => {
reload();
}
//
async function handleRead(record) {
const params = {
'cid' : record.cid,
'address' : record.address,
};
await eleRead(params);
setTimeout(() => {
reload();
}, 4000);
}
//
async function handleControlLz(record) {
if(record.relayState == '0'){
Modal.info({
title: '拉闸',
content: h('div', {}, [
h('p', '此电表已拉闸!'),
]),
onOk() {},
});
return;
}
const params = {
'cid' : record.cid,
'address' : record.address,
'type' : '10',
};
await eleControl(params);
setTimeout(() => {
reload();
}, 4000);
}
}, 4000);
}
//
async function handleControlHz(record) {
if(record.relayState == '1'){
Modal.info({
title: '合闸',
content: h('div', {}, [
h('p', '此电表已合闸!'),
]),
onOk() {},
});
return;
}
const params = {
'cid' : record.cid,
'address' : record.address,
'type' : '11',
};
await eleControl(params);
setTimeout(() => {
reload();
}, 4000);
}
//
async function handleReset(record) {
const params = {
'cid' : record.cid,
'address' : record.address,
};
await eleReset(params);
setTimeout(() => {
reload();
}, 4000);
}
/**
* 查看api日志
*/
function showApiLog(record){
console.log(record);
apiLogModal.value.disableSubmit = true;
apiLogModal.value.showApiLog(record);
}
function reload(){
queryParam.pageSize = pageParams.value.pageSize;
queryParam.pageNo = pageParams.value.pageNo;
defHttp.get({url: '/iot/tq/electricityMeter/list',params:queryParam}).then(res => {
console.log("🚀 ~ defHttp.get ~ res:", res)
tableData.value = res;
//
async function handleControlLz(record) {
if (record.relayState == '0') {
Modal.info({
title: '拉闸',
content: h('div', {}, [
h('p', '此电表已拉闸!'),
]),
onOk() { },
});
return;
}
//
onMounted(() => {
const params = {
'cid': record.cid,
'address': record.address,
'type': '10',
};
await eleControl(params);
setTimeout(() => {
reload();
}, 4000);
}
//
async function handleControlHz(record) {
if (record.relayState == '1') {
Modal.info({
title: '合闸',
content: h('div', {}, [
h('p', '此电表已合闸!'),
]),
onOk() { },
});
return;
}
const params = {
'cid': record.cid,
'address': record.address,
'type': '11',
};
await eleControl(params);
setTimeout(() => {
reload();
}, 4000);
}
//
async function handleReset(record) {
const params = {
'cid': record.cid,
'address': record.address,
};
await eleReset(params);
setTimeout(() => {
reload();
}, 4000);
}
/**
* 查看api日志
*/
function showApiLog(record) {
console.log(record);
apiLogModal.value.disableSubmit = true;
apiLogModal.value.showApiLog(record);
}
function reload() {
queryParam.pageSize = pageParams.value.pageSize;
queryParam.pageNo = pageParams.value.pageNo;
defHttp.get({ url: '/iot/tq/electricityMeter/list', params: queryParam }).then(res => {
console.log("🚀 ~ defHttp.get ~ res:", res)
tableData.value = res;
});
}
//
onMounted(() => {
reload();
});
</script>
<style lang="less" scoped>
.cardTitle{
.cardTitle {
background: #1ea0fa;
width: 100%;
margin: -28px -24px;
@ -243,35 +252,38 @@ const pageParams = ref({ pageNo: 1, pageSize: 8 })
display: block;
position: absolute;
}
.zxClass{
font-size:14px;
.zxClass {
font-size: 14px;
background: linear-gradient(to right, #1ea0fa, #017de9);
border-radius: 8px;
height: 25px;
color: white;
line-height: 25px;
text-align: center;
width:50px;
margin-top:11px;
width: 50px;
margin-top: 11px;
}
.lxClass{
font-size:14px;
.lxClass {
font-size: 14px;
background: linear-gradient(to right, #cccccc, #cccccc);
border-radius: 8px;
height: 25px;
color: white;
line-height: 25px;
text-align: center;
width:50px;
margin-top:11px;
width: 50px;
margin-top: 11px;
}
.tbClass{
.tbClass {
background: #f6f6f6;
padding: 8px;
border-radius: 5px;
}
.antTitle{
.antTitle {
margin-top: 10px;
display: block;
font-size: 12px;

View File

@ -2,89 +2,98 @@
<div style="padding: 4px;">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="reload" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-form ref="formRef" @keyup.enter.native="reload" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="address">
<template #label><span title="SN">SN</span></template>
<j-input placeholder="请输入SN" v-model:value="queryParam.address" allow-clear ></j-input>
<j-input placeholder="请输入SN" v-model:value="queryParam.address" :type="'default'" allow-clear></j-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="nuId">
<template #label><span title="区域">区域</span></template>
<j-dict-select-tag type='list' v-model:value="queryParam.nuId" :dictCode="`nu_base_info,nu_name,nu_id`" placeholder="请选区域" allow-clear />
<j-dict-select-tag type='list' v-model:value="queryParam.nuId" :dictCode="`nu_base_info,nu_name,nu_id`"
placeholder="请选区域" allow-clear />
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="reload">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a-button type="primary" preIcon="ant-design:search-outlined" @click="reload">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button>
</a-col>
</a-row>
</a-form>
</div>
<a-row style="margin-top: -18px;">
<a-col v-for="(item,index) in tableData.records" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6" style="padding: 8px 6px 6px 8px;">
<a-card style="width: 100%;border-radius: 8px;" :headStyle="{ height: '70px', padding: '0 24px',border:'0px' }" :bodyStyle="{ padding: '24px 24px 4px 24px' }">
<a-col v-for="(item, index) in tableData.records" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6"
style="padding: 8px 6px 6px 8px;">
<a-card style="width: 100%;border-radius: 8px;" :headStyle="{ height: '70px', padding: '0 24px', border: '0px' }"
:bodyStyle="{ padding: '24px 24px 4px 24px' }">
<template #title>
<a-row style="font-weight: normal;">
<a-col :span="18" style="font-size: 14px;">
<div>SN<span style="font-weight: bold;">{{item.address}}</span></div>
<div style="font-size: 12px;">抄表时间{{item.readTime?item.readTime:'未抄表'}}</div>
</a-col>
<a-col :span="6" style="display: flex; justify-content: flex-end;">
<div :class="item.relayState=='1'?'zxClass':'lxClass'">{{item.relayState=='1'?'开阀':'关阀'}}</div>
</a-col>
<a-col :span="24">
<a-divider style="margin: 10px 0 0 0" />
</a-col>
</a-row>
<a-row style="font-weight: normal;">
<a-col :span="18" style="font-size: 14px;">
<div>SN<span style="font-weight: bold;">{{ item.address }}</span></div>
<div style="font-size: 12px;">抄表时间{{ item.readTime ? item.readTime : '未抄表' }}</div>
</a-col>
<a-col :span="6" style="display: flex; justify-content: flex-end;">
<div :class="item.relayState == '1' ? 'zxClass' : 'lxClass'">{{ item.relayState == '1' ? '开阀' : '关阀' }}</div>
</a-col>
<a-col :span="24">
<a-divider style="margin: 10px 0 0 0" />
</a-col>
</a-row>
</template>
<a-row style="margin-top:-10px;">
<a-col :span="12" style="margin-top: -10px;">{{item.nuId_dictText?item.nuId_dictText:'未配置'}}</a-col>
<a-col :span="12" style="text-align: right;margin-top: -10px;">
<span style="text-align: right;background:#f6f6f6;padding: 2px 10px;border-radius:5px;">NUID: {{item.nuId?item.nuId:'未配置'}}</span>
</a-col>
<a-col :span="14" style="text-align: right;font-size: 44px;font-weight: bold;margin-top:18px;">
<span>{{item.waterValue?item.waterValue:'0.00'}}</span>
</a-col>
<a-col :span="8" style="padding: 12px 0 0 5px;margin-top:18px;">
<div style="font-size: 12px;margin: 8px 0 -5px 2px;"></div>
<div style="margin-top:-3px;"><span style="background:#eeeeee;padding: 2px;border-radius:5px;font-size:11px;">用水量</span></div>
</a-col>
</a-row>
<a-divider />
<p style="text-align:center;">
<span style="display:inline-block;cursor: pointer;" @click="handleRead(item)">
<span class="tbClass"><img src="../../../../assets/iot/a1.png" style="width:20px;" /></span><br/>
<span class="antTitle">抄表</span>
</span>
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleControlLz(item)" v-if="item.relayState=='0'">
<span class="tbClass"><img src="../../../../assets/iot/a10.png" style="width:20px;" /></span><br/>
<span class="antTitle">开阀</span>
</span>
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleControlHz(item)" v-if="item.relayState=='1'">
<span class="tbClass"><img src="../../../../assets/iot/a11.png" style="width:20px;" /></span><br/>
<span class="antTitle">关阀</span>
</span>
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleReset(item)">
<span class="tbClass"><img src="../../../../assets/iot/a3.png" style="width:20px;" /></span><br/>
<span class="antTitle">清零</span>
</span>
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="showApiLog(item)">
<span class="tbClass"><img src="../../../../assets/iot/a4.png" style="width:20px;" /></span><br/>
<span class="antTitle">日志</span>
</span>
</p>
<a-row style="margin-top:-10px;">
<a-col :span="12" style="margin-top: -10px;">{{ item.nuId_dictText ? item.nuId_dictText : '未配置' }}</a-col>
<a-col :span="12" style="text-align: right;margin-top: -10px;">
<span style="text-align: right;background:#f6f6f6;padding: 2px 10px;border-radius:5px;">NUID:
{{ item.nuId ? item.nuId : '未配置' }}</span>
</a-col>
<a-col :span="14" style="text-align: right;font-size: 44px;font-weight: bold;margin-top:18px;">
<span>{{ item.waterValue ? item.waterValue : '0.00' }}</span>
</a-col>
<a-col :span="8" style="padding: 12px 0 0 5px;margin-top:18px;">
<div style="font-size: 12px;margin: 8px 0 -5px 2px;"></div>
<div style="margin-top:-3px;"><span
style="background:#eeeeee;padding: 2px;border-radius:5px;font-size:11px;">用水量</span></div>
</a-col>
</a-row>
<a-divider />
<p style="text-align:center;">
<span style="display:inline-block;cursor: pointer;" @click="handleRead(item)">
<span class="tbClass"><img src="../../../../assets/iot/a1.png" style="width:20px;" /></span><br />
<span class="antTitle">抄表</span>
</span>
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleControlLz(item)"
v-if="item.relayState == '0'">
<span class="tbClass"><img src="../../../../assets/iot/a10.png" style="width:20px;" /></span><br />
<span class="antTitle">开阀</span>
</span>
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleControlHz(item)"
v-if="item.relayState == '1'">
<span class="tbClass"><img src="../../../../assets/iot/a11.png" style="width:20px;" /></span><br />
<span class="antTitle">关阀</span>
</span>
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleReset(item)">
<span class="tbClass"><img src="../../../../assets/iot/a3.png" style="width:20px;" /></span><br />
<span class="antTitle">清零</span>
</span>
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="showApiLog(item)">
<span class="tbClass"><img src="../../../../assets/iot/a4.png" style="width:20px;" /></span><br />
<span class="antTitle">日志</span>
</span>
</p>
</a-card>
</a-col>
<a-col v-if="tableData.total==0" >
<a-col v-if="tableData.total == 0">
<div style="margin: 30px auto;">
<a-empty />
</div>
</a-col>
</a-row>
<div v-if="tableData.total > 0"
<div v-if="tableData.total > 0"
style="float:right;bottom: 20px;z-index: 999;padding: 8px 16px;border-radius: 4px;display: flex;align-items: center;">
<span style="margin-right: 10px;"> {{ tableData.total }} 条数据</span>
<Pagination showLessItems v-model:current="pageParams.pageNo" :pageSize="pageParams.pageSize" size="small"
@ -96,143 +105,143 @@
</template>
<script lang="ts" name="iot-nuIotRegionInfo" setup>
import {reactive, ref,h,onMounted} from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { Statistic } from 'ant-design-vue';
import {Modal} from "ant-design-vue";
import {list, eleReset, eleControl, eleRead } from './water.api';
import { reactive, ref, h, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { Statistic } from 'ant-design-vue';
import { Modal } from "ant-design-vue";
import { list, eleReset, eleControl, eleRead } from './water.api';
import { Pagination } from 'ant-design-vue';
import ApiLogModal from "@/views/iot/tq/electricity/apilog/WaterApiLogModal.vue";
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import ApiLogModal from "@/views/iot/tq/electricity/apilog/WaterApiLogModal.vue";
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { set } from 'lodash-es';
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
const formRef = ref();
const queryParam = reactive<any>({});
const apiLogModal = ref();
const tableData = ref<any>([]);
const formRef = ref();
const queryParam = reactive<any>({});
const apiLogModal = ref();
const tableData = ref<any>([]);
const pageParams = ref({ pageNo: 1, pageSize: 8 })
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
const labelCol = reactive({
xs: 24,
sm: 4,
xl: 6,
xxl: 4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
//
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
//
reload();
}
//
async function handleRead(record) {
const params = {
'cid': record.cid,
'address': record.address,
};
await eleRead(params);
setTimeout(() => {
reload();
}
//
async function handleRead(record) {
const params = {
'cid' : record.cid,
'address' : record.address,
};
await eleRead(params);
setTimeout(() => {
reload();
}, 4000);
}
//
async function handleControlLz(record) {
if(record.relayState == '1'){
Modal.info({
title: '开阀',
content: h('div', {}, [
h('p', '此水表已开阀!'),
]),
onOk() {},
});
return;
}
const params = {
'cid' : record.cid,
'address' : record.address,
'type' : '43',
};
await eleControl(params);
setTimeout(() => {
reload();
}, 4000);
}
}, 4000);
}
//
async function handleControlHz(record) {
if(record.relayState == '0'){
Modal.info({
title: '关阀',
content: h('div', {}, [
h('p', '此水表已关阀!'),
]),
onOk() {},
});
return;
}
const params = {
'cid' : record.cid,
'address' : record.address,
'type' : '53',
};
await eleControl(params);
setTimeout(() => {
reload();
}, 4000);
}
//
async function handleReset(record) {
const params = {
'cid' : record.cid,
'address' : record.address,
};
await eleReset(params);
setTimeout(() => {
reload();
}, 4000);
}
/**
* 查看api日志
*/
function showApiLog(record){
console.log(record);
apiLogModal.value.disableSubmit = true;
apiLogModal.value.showApiLog(record);
}
function reload(){
queryParam.pageSize = pageParams.value.pageSize;
queryParam.pageNo = pageParams.value.pageNo;
defHttp.get({url: '/iot/tq/waterMeter/list',params:queryParam}).then(res => {
console.log("🚀 ~ defHttp.get ~ res:", res)
tableData.value = res;
//
async function handleControlLz(record) {
if (record.relayState == '1') {
Modal.info({
title: '开阀',
content: h('div', {}, [
h('p', '此水表已开阀!'),
]),
onOk() { },
});
return;
}
//
onMounted(() => {
const params = {
'cid': record.cid,
'address': record.address,
'type': '43',
};
await eleControl(params);
setTimeout(() => {
reload();
}, 4000);
}
//
async function handleControlHz(record) {
if (record.relayState == '0') {
Modal.info({
title: '关阀',
content: h('div', {}, [
h('p', '此水表已关阀!'),
]),
onOk() { },
});
return;
}
const params = {
'cid': record.cid,
'address': record.address,
'type': '53',
};
await eleControl(params);
setTimeout(() => {
reload();
}, 4000);
}
//
async function handleReset(record) {
const params = {
'cid': record.cid,
'address': record.address,
};
await eleReset(params);
setTimeout(() => {
reload();
}, 4000);
}
/**
* 查看api日志
*/
function showApiLog(record) {
console.log(record);
apiLogModal.value.disableSubmit = true;
apiLogModal.value.showApiLog(record);
}
function reload() {
queryParam.pageSize = pageParams.value.pageSize;
queryParam.pageNo = pageParams.value.pageNo;
defHttp.get({ url: '/iot/tq/waterMeter/list', params: queryParam }).then(res => {
console.log("🚀 ~ defHttp.get ~ res:", res)
tableData.value = res;
});
}
//
onMounted(() => {
reload();
});
</script>
<style lang="less" scoped>
.cardTitle{
.cardTitle {
background: #1ea0fa;
width: 100%;
margin: -28px -24px;
@ -243,35 +252,38 @@ const pageParams = ref({ pageNo: 1, pageSize: 8 })
display: block;
position: absolute;
}
.zxClass{
font-size:14px;
.zxClass {
font-size: 14px;
background: linear-gradient(to right, #1ea0fa, #017de9);
border-radius: 8px;
height: 25px;
color: white;
line-height: 25px;
text-align: center;
width:50px;
margin-top:11px;
width: 50px;
margin-top: 11px;
}
.lxClass{
font-size:14px;
.lxClass {
font-size: 14px;
background: linear-gradient(to right, #cccccc, #cccccc);
border-radius: 8px;
height: 25px;
color: white;
line-height: 25px;
text-align: center;
width:50px;
margin-top:11px;
width: 50px;
margin-top: 11px;
}
.tbClass{
.tbClass {
background: #f6f6f6;
padding: 8px;
border-radius: 5px;
}
.antTitle{
.antTitle {
margin-top: 10px;
display: block;
font-size: 12px;

View File

@ -2,88 +2,96 @@
<div style="padding: 4px;">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="reload" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-form ref="formRef" @keyup.enter.native="reload" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="sn">
<template #label><span title="SN">SN</span></template>
<j-input placeholder="请输入SN" v-model:value="queryParam.sn" allow-clear ></j-input>
<JInput placeholder="请输入SN" v-model:value="queryParam.sn" allow-clear :type="'default'"></JInput>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="nuId">
<template #label><span title="区域">区域</span></template>
<j-dict-select-tag type='list' v-model:value="queryParam.nuId" :dictCode="`nu_base_info,nu_name,nu_id`" placeholder="请选区域" allow-clear />
<j-dict-select-tag type='list' v-model:value="queryParam.nuId" :dictCode="`nu_base_info,nu_name,nu_id`"
placeholder="请选区域" allow-clear />
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span class="table-page-search-submitButtons">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button>
<a-button type="primary" preIcon="ant-design:search-outlined" @click="reload">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<a-row style="margin-top: -18px;">
<a-col v-for="(item,index) in tableData.records" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6" style="padding: 8px 6px 6px 8px;">
<a-card style="width: 100%;border-radius: 8px;" :headStyle="{ height: '70px', padding: '0 24px',border:'0px' }" :bodyStyle="{ padding: '24px 24px 4px 24px' }">
<a-col v-for="(item, index) in tableData.records" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8"
:xxl="6" style="padding: 8px 6px 6px 8px;">
<a-card style="width: 100%;border-radius: 8px;"
:headStyle="{ height: '70px', padding: '0 24px', border: '0px' }"
:bodyStyle="{ padding: '24px 24px 4px 24px' }">
<template #title>
<a-row style="font-weight: normal;">
<a-col :span="18" style="font-size: 14px;">
<div>SN<span style="font-weight: bold;">{{item.sn}}</span></div>
<div style="font-size: 12px;">抄表时间{{item.reportingTime?item.reportingTime:'未抄表'}}</div>
</a-col>
<a-col :span="6" style="display: flex; justify-content: flex-end;">
<div :class="item.status=='0'?'zxClass':'lxClass'">{{item.status=='0'?'在线':'离线'}}</div>
</a-col>
<a-col :span="24">
<a-divider style="margin: 10px 0 0 0" />
</a-col>
</a-row>
<a-row style="font-weight: normal;">
<a-col :span="18" style="font-size: 14px;">
<div>SN<span style="font-weight: bold;">{{ item.sn }}</span></div>
<div style="font-size: 12px;">抄表时间{{ item.reportingTime ? item.reportingTime : '未抄表' }}</div>
</a-col>
<a-col :span="6" style="display: flex; justify-content: flex-end;">
<div :class="item.status == '0' ? 'zxClass' : 'lxClass'">{{ item.status == '0' ? '在线' : '离线' }}</div>
</a-col>
<a-col :span="24">
<a-divider style="margin: 10px 0 0 0" />
</a-col>
</a-row>
</template>
<a-row style="margin-top:-10px;">
<a-col :span="12" style="margin-top: -10px;">{{item.nuId_dictText?item.nuId_dictText:'未配置'}}</a-col>
<a-col :span="12" style="text-align: right;margin-top: -10px;">
<span style="text-align: right;background:#f6f6f6;padding: 2px 10px;border-radius:5px;">NUID: {{item.nuId?item.nuId:'未配置'}}</span>
<a-row style="margin-top:-10px;">
<a-col :span="12" style="margin-top: -10px;">{{ item.nuId_dictText ? item.nuId_dictText : '未配置' }}</a-col>
<a-col :span="12" style="text-align: right;margin-top: -10px;">
<span style="text-align: right;background:#f6f6f6;padding: 2px 10px;border-radius:5px;">NUID:
{{ item.nuId ? item.nuId : '未配置' }}</span>
</a-col>
<a-col :span="24" style="padding: 12px 0 0 5px;margin-top:18px;">
<a-row>
<a-col :span="11" style="text-align: center;">
<span><img src="../../../assets/iot/a8.png" style="width:25px;margin-top: -15px;" /></span>
<span style="font-size: 30px;font-weight:700;">{{ item.temperature ? item.temperature : '-' }}</span>
<span style="font-size: 16px;"></span>
</a-col>
<a-col :span="24" style="padding: 12px 0 0 5px;margin-top:18px;">
<a-row>
<a-col :span="11" style="text-align: center;">
<span><img src="../../../assets/iot/a8.png" style="width:25px;margin-top: -15px;" /></span>
<span style="font-size: 30px;font-weight:700;">{{item.temperature?item.temperature:'-'}}</span>
<span style="font-size: 16px;"></span>
</a-col>
<a-col :span="2" style="text-align: center;">
<a-divider type="vertical" style="height: 40px;"/>
</a-col>
<a-col :span="11" style="text-align: center;">
<span style="margin-top:0px;"><img src="../../../assets/iot/a9.png" style="width:25px;margin-top: -15px;" /></span>
<span style="font-size: 30px;font-weight:700;margin-left: 6px;">{{item.humidity?item.humidity:'-'}}</span>
<span style="font-size: 16px;">%</span>
</a-col>
</a-row>
<a-col :span="2" style="text-align: center;">
<a-divider type="vertical" style="height: 40px;" />
</a-col>
<a-col :span="11" style="text-align: center;">
<span style="margin-top:0px;"><img src="../../../assets/iot/a9.png"
style="width:25px;margin-top: -15px;" /></span>
<span style="font-size: 30px;font-weight:700;margin-left: 6px;">{{ item.humidity ? item.humidity : '-'
}}</span>
<span style="font-size: 16px;">%</span>
</a-col>
</a-row>
<a-divider />
<p style="text-align:center;">
<span style="display:inline-block;cursor: pointer;" @click="handleRead(item)">
<span class="tbClass"><img src="../../../assets/iot/a7.png" style="width:20px;" /></span><br/>
<span class="antTitle">抄表</span>
</span>
<!-- <span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleEdit(item)">
</a-col>
</a-row>
<a-divider />
<p style="text-align:center;">
<span style="display:inline-block;cursor: pointer;" @click="handleRead(item)">
<span class="tbClass"><img src="../../../assets/iot/a7.png" style="width:20px;" /></span><br />
<span class="antTitle">抄表</span>
</span>
<!-- <span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleEdit(item)">
<span class="tbClass"><img src="../../../assets/iot/a6.png" style="width:20px;" /></span><br/>
<span class="antTitle">配置</span>
</span> -->
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="showApiLog(item)">
<span class="tbClass"><img src="../../../assets/iot/a4.png" style="width:20px;" /></span><br/>
<span class="antTitle">日志</span>
</span>
</p>
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="showApiLog(item)">
<span class="tbClass"><img src="../../../assets/iot/a4.png" style="width:20px;" /></span><br />
<span class="antTitle">日志</span>
</span>
</p>
</a-card>
</a-col>
<a-col v-if="tableData.total==0" >
<a-col v-if="tableData.total == 0">
<div style="margin: 30px auto;">
<a-empty />
</div>
@ -102,97 +110,97 @@
</template>
<script lang="ts" name="iot-nuIotRegionInfo" setup>
import {reactive, ref,h,onMounted} from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { Statistic } from 'ant-design-vue';
import {Modal} from "ant-design-vue";
import {updateDeviceRealTime} from './humid.api';
import { Pagination } from 'ant-design-vue';
import { reactive, ref, h, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { Statistic } from 'ant-design-vue';
import { Modal } from "ant-design-vue";
import { updateDeviceRealTime } from './humid.api';
import { Pagination } from 'ant-design-vue';
import ApiLogAlarmModal from './components/ApiLogAlarmModal.vue'
import DeviceInfoDrawer from "./components/DeviceInfoDrawer.vue";
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { set } from 'lodash-es';
import {useDrawer} from "@/components/Drawer";
import ApiLogAlarmModal from './components/ApiLogAlarmModal.vue'
import DeviceInfoDrawer from "./components/DeviceInfoDrawer.vue";
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { set } from 'lodash-es';
import { useDrawer } from "@/components/Drawer";
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
//drawer
const [registerDrawer, { openDrawer }] = useDrawer();
const formRef = ref();
const queryParam = reactive<any>({});
const apiLogAlarmModal = ref();
const tableData = ref<any>([]);
//drawer
const [registerDrawer, { openDrawer }] = useDrawer();
const formRef = ref();
const queryParam = reactive<any>({});
const apiLogAlarmModal = ref();
const tableData = ref<any>([]);
const pageParams = ref({ pageNo: 1, pageSize: 8 })
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
const labelCol = reactive({
xs: 24,
sm: 4,
xl: 6,
xxl: 4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
//
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
//
reload();
}
//
async function handleRead(record) {
const params = {
'sn': record.sn,
};
await updateDeviceRealTime(params);
setTimeout(() => {
reload();
}
//
async function handleRead(record) {
const params = {
'sn' : record.sn,
};
await updateDeviceRealTime(params);
setTimeout(() => {
reload();
}, 4000);
}
}, 4000);
}
//
async function handleEdit(record) {
record["isUpdate"] = true;
console.log(record);
openDrawer(true, {
record,
isUpdate: true,
showFooter: true,
tenantSaas: false,
});
}
/**
* 查看api日志
*/
function showApiLog(record){
apiLogAlarmModal.value.disableSubmit = true;
apiLogAlarmModal.value.showLogAlarm(record);
}
function reload(){
queryParam.pageSize = pageParams.value.pageSize;
queryParam.pageNo = pageParams.value.pageNo;
defHttp.get({url: '/iot/yiweilian/humidDevice/list',params:queryParam}).then(res => {
console.log("🚀 ~ defHttp.get ~ res:", res)
tableData.value = res;
});
}
//
onMounted(() => {
reload();
//
async function handleEdit(record) {
record["isUpdate"] = true;
console.log(record);
openDrawer(true, {
record,
isUpdate: true,
showFooter: true,
tenantSaas: false,
});
}
/**
* 查看api日志
*/
function showApiLog(record) {
apiLogAlarmModal.value.disableSubmit = true;
apiLogAlarmModal.value.showLogAlarm(record);
}
function reload() {
queryParam.pageSize = pageParams.value.pageSize;
queryParam.pageNo = pageParams.value.pageNo;
defHttp.get({ url: '/iot/yiweilian/humidDevice/list', params: queryParam }).then(res => {
console.log("🚀 ~ defHttp.get ~ res:", res)
tableData.value = res;
});
}
//
onMounted(() => {
reload();
});
</script>
<style lang="less" scoped>
.cardTitle{
.cardTitle {
background: #1ea0fa;
width: 100%;
margin: -28px -24px;
@ -203,35 +211,38 @@ const pageParams = ref({ pageNo: 1, pageSize: 8 })
display: block;
position: absolute;
}
.zxClass{
font-size:14px;
.zxClass {
font-size: 14px;
background: linear-gradient(to right, #1ea0fa, #017de9);
border-radius: 8px;
height: 25px;
color: white;
line-height: 25px;
text-align: center;
width:50px;
margin-top:11px;
width: 50px;
margin-top: 11px;
}
.lxClass{
font-size:14px;
.lxClass {
font-size: 14px;
background: linear-gradient(to right, #cccccc, #cccccc);
border-radius: 8px;
height: 25px;
color: white;
line-height: 25px;
text-align: center;
width:50px;
margin-top:11px;
width: 50px;
margin-top: 11px;
}
.tbClass{
.tbClass {
background: #f6f6f6;
padding: 8px;
border-radius: 5px;
}
.antTitle{
.antTitle {
margin-top: 10px;
display: block;
font-size: 12px;