修改区域功能

This commit is contained in:
yangjun 2026-03-12 10:40:47 +08:00
parent 729cb9bd5b
commit 3a8d8de4e0
16 changed files with 829 additions and 62 deletions

View File

@ -78,6 +78,7 @@ export default defineComponent({
style: propTypes.any,
ignoreDisabled: propTypes.bool.def(false),
orgCode: '',//
showLabel: propTypes.bool.def(true)
},
emits: ['options-change', 'change', 'update:value', 'upDictCode', 'currentText'],
setup(props, { emit, refs }) {
@ -132,13 +133,17 @@ export default defineComponent({
dictOptions.value = dictData.reduce((prev, next) => {
if (next) {
const value = next['value'];
prev.push({
const value1 = {
label: next['text'] || next['label'],
value: stringToNumber ? +value : value,
disabled: next['status'] == 1,
color: next['color'],
...omit(next, ['text', 'value', 'color']),
});
}
if(!props.showLabel&&next['status'] == 1){
}else{
prev.push(value1);
}
}
return prev;
}, []);

View File

@ -5,6 +5,7 @@ enum Api {
list = '/nuBaseInfo/nuBaseInfo/list',
save = '/nuBaseInfo/nuBaseInfo/add',
edit = '/nuBaseInfo/nuBaseInfo/edit',
hldyQyty = '/nuBaseInfo/nuBaseInfo/hldyQyty',
importExcel = '/nuBaseInfo/nuBaseInfo/importExcel',
exportXls = '/nuBaseInfo/nuBaseInfo/exportXls',
qyList = '/nuBaseInfo/nuBaseInfo/qyList',
@ -12,6 +13,7 @@ enum Api {
queryRolePermission = '/nuidPermission/nuAppNuidPermission/queryNuidPermission',
saveRolePermission = '/nuidPermission/nuAppNuidPermission/saveRolePermission',
queryDataRule = '/nuidPermission/nuAppNuidPermission/queryDataRule',
getNuId = '/nuBaseInfo/nuBaseInfo/getNuId',
}
/**
@ -31,6 +33,7 @@ export const getImportUrl = Api.importExcel;
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
export const qyList = (params) => defHttp.get({ url: Api.qyList, params });
export const getNuId = (params) => defHttp.get({ url: Api.getNuId, params });
/**
*
@ -41,6 +44,9 @@ export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
};
export const hldyQyty = (params, isUpdate) => {
return defHttp.post({ url: Api.hldyQyty, params }, { isTransformResponse: false });
};
/**

View File

@ -4,19 +4,19 @@
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-col :lg="5">
<a-form-item name="nuNameParams">
<template #label><span title="区域名称">区域名称</span></template>
<a-input placeholder="请输入区域名称" v-model:value="queryParam.nuNameParams" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-col :lg="5">
<a-form-item name="areaFlag">
<template #label><span title="区域属性">区域属性</span></template>
<j-dict-select-tag v-model:value="queryParam.areaFlag" dictCode="nu_type" placeholder="请选择区域属性" allow-clear @change="changeAreaFlag" />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-col :lg="5">
<a-form-item name="status">
<template #label><span title="区域状态">区域状态</span></template>
<a-select placeholder="请选择区域状态" v-model:value="queryParam.status" allow-clear v-if="queryParam.areaFlag == '1'">
@ -36,11 +36,12 @@
</a-select>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="6" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="9" :md="9" :sm="24">
<span style="float: right; overflow: hidden" 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" @click="handleAdd" preIcon="ant-design:plus-outlined" style="margin-left: 8px"> 新增</a-button>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined" style="margin-left: 8px"> 添加区域</a-button>
<a-button type="primary" @click="handleSbyl" preIcon="ant-design:plus-outlined" style="margin-left: 8px"> 设备预览</a-button>
</span>
</a-col>
</a-row>
@ -53,7 +54,8 @@
:headStyle="{ height: '60px', padding: '0 24px',border:'0px' }"
@mouseenter="item.key"
@mouseleave="item.key"
@click="isSelected = item">
@click="isSelected = item"
style="height: 270px;">
<template #extra>
<span class="hldyClass" >{{item.areaFlag_dictText}}</span>
</template>
@ -68,9 +70,8 @@
<a-divider style="margin: 0 0 10px 0 " />
<p>区域名称{{item.nuName}}</p>
<p style="margin-top: -10px;">创建时间{{item.createTime}}</p>
<div style="float:left;margin-top: 20px;">
<a-button type="dashed" size="small" @click="handleEdit(item)">更名</a-button>
<a-button type="dashed" size="small" @click="handleWlsb(item)" style="margin-left:10px" >设备</a-button>
<p style="margin-top: -10px;"><span v-if="item.areaFlag=='3'">负责人{{item.fzr_dictText}}</span>&nbsp;</p>
<div style=" margin-top: 10px;height: 60px;display: flex;flex-wrap: wrap;">
<a-popover title="二维码" >
<template #content>
<QRCodeWithLogo
@ -80,9 +81,13 @@
:logoSize="40"
/>
</template>
<a-button type="dashed" size="small" style="margin-left:10px">二维码</a-button>
<a-button type="dashed" size="small" style="margin-right:10px">二维码</a-button>
</a-popover>
<a-button type="dashed" size="small" @click="handlePerssion(item)" style="margin-left:10px" >区域功能</a-button>
<a-button type="dashed" size="small" @click="handleEdit(item)" style="margin-right:10px">区域名称</a-button>
<a-button type="dashed" size="small" @click="handleKgxx(item)" style="margin-right:10px" v-if="item.areaFlag=='3'">库管信息</a-button>
<a-button type="dashed" size="small" @click="handleWlsb(item)" style="margin-right:10px" >设备管理</a-button>
<a-button type="dashed" size="small" @click="handlePerssion(item)" style=" margin-right:10px" >区域功能</a-button>
<a-button type="dashed" size="small" @click="handleWlgl(item)" style=" margin-right:10px" v-if="item.areaFlag=='3'">物料管理</a-button>
</div>
<div style="float:right;margin-top: 20px;">
@ -102,31 +107,34 @@
<NuBaseInfoAddModal ref="registerAddModal" @success="handleSuccess"></NuBaseInfoAddModal>
<BaseWlsbListModal ref="wlsbModal" ></BaseWlsbListModal>
<CameraPreviewModal ref="previewModal"></CameraPreviewModal>
<IotDevicesModall ref="iotDevicesModal"></IotDevicesModall>
<!--角色菜单授权抽屉-->
<RolePermissionDrawer @register="rolePermissionDrawer" />
<!-- 表单区域 -->
<CkfzrModal ref="registerCkfzrModal" @success="handleSuccess" />
<!-- 出入库详情 -->
<BlWarehouseMaterialInfoListModal ref="registerCrkModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" name="nuBaseInfo-nuBaseInfo" setup>
import { ref, reactive, onMounted } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './NuBaseInfo.data';
import { qyList, saveOrUpdate } from './NuBaseInfo.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import { saveOrUpdate, hldyQyty } from './NuBaseInfo.api';
import NuBaseInfoModal from './components/NuBaseInfoModal.vue'
import NuBaseInfoAddModal from './components/NuBaseInfoAddModal.vue'
import BaseWlsbListModal from './components/BaseWlsbListModal.vue'
import CameraPreviewModal from '/@/views/iot/tplink/camera/components/CameraPreviewModal.vue'
import IotDevicesModall from '/@/views/biz/nuBaseInfo/iotDevices/IotDevicesModal.vue'
import { useUserStore } from '/@/store/modules/user';
import { JInput } from '/@/components/Form';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
import { useMessage } from '/@/hooks/web/useMessage';
import QRCodeWithLogo from './EwmImage.vue';
import { defHttp } from '/@/utils/http/axios';
import { useDrawer } from '/@/components/Drawer';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { useMessage } from '/@/hooks/web/useMessage';
import QRCodeWithLogo from './EwmImage.vue';
import { defHttp } from '/@/utils/http/axios';
import { useDrawer } from '/@/components/Drawer';
import RolePermissionDrawer from './components/RolePermissionDrawer.vue';
import CkfzrModal from '/@/views/invoicing/warehouseMaterialInfo/components/CkfzrModal.vue'
import BlWarehouseMaterialInfoListModal from '/@/views/invoicing/warehouseMaterialInfo/BlWarehouseMaterialInfoListModal.vue'
const [rolePermissionDrawer, { openDrawer: openRolePermissionDrawer }] = useDrawer();
@ -137,13 +145,14 @@ const { createMessage } = useMessage();
const formRef = ref();
const previewModal = ref();
const iotDevicesModal = ref();
const wlsbModal = ref();
const registerCkfzrModal = ref();
const registerCrkModal = ref();
const queryParam = reactive<any>({});
const tableData = ref<any>([]);
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const registerAddModal = ref();
const userStore = useUserStore();
const labelCol = reactive({
xs:24,
sm:6,
@ -196,6 +205,23 @@ function handleChangeValidateStatus(record,checked) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 库管信息
* @param record
*/
function handleKgxx(record) {
registerCkfzrModal.value.disableSubmit = false;
registerCkfzrModal.value.edit(record);
}
/**
* 物料管理
* @param record
*/
function handleWlgl(record) {
registerCrkModal.value.disableSubmit = true;
registerCrkModal.value.init(record);
}
/**
* 成功回调
@ -226,7 +252,7 @@ function handleChangeValidateStatus(record,checked) {
*/
async function handleTingyong(record) {
record.status = 5;
await saveOrUpdate(record, true).then((res) => {
await hldyQyty(record, true).then((res) => {
if (res.success) {
createMessage.success(res.message);
} else {
@ -258,19 +284,20 @@ function handleChangeValidateStatus(record,checked) {
//
reload();
}
function reload() {
// const list = qyList(queryParam);
// console.log("🚀 ~ reload ~ list:", list)
// console.log("🚀 ~ reload ~ list:", list.records)
/**
* 设备预览
*/
function handleSbyl(){
iotDevicesModal.value.disableSubmit = true;
iotDevicesModal.value.init(null);
}
function reload() {
defHttp.get({url: '/nuBaseInfo/nuBaseInfo/qyList',params:queryParam}).then(res => {
console.log("🌊 ~ reload ~ res1111111:", res)
console.log("🚀 ~ defHttp.get ~ res:", res)
tableData.value = res.records;
});
}

View File

@ -5,17 +5,17 @@
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
name="NuBaseInfoForm">
<a-row>
<a-col :span="24">
<a-form-item label="区域名称" v-bind="validateInfos.nuName" id="NuBaseInfoForm-nuName" name="nuName">
<a-input v-model:value="formData.nuName" placeholder="请输入区域名称" maxLength="15" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :span="24" hidden>
<a-col :span="24" >
<a-form-item label="区域编码" v-bind="validateInfos.nuId" id="NuBaseInfoForm-nuId" name="nuId">
<a-input v-model:value="formData.nuId" placeholder="编码自动生成" allow-clear :disabled="true"
:readonly="formData.nuId"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="区域名称" v-bind="validateInfos.nuName" id="NuBaseInfoForm-nuName" name="nuName">
<a-input v-model:value="formData.nuName" placeholder="请输入区域名称" maxLength="15" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :span="24" >
<a-form-item label="区域属性" v-bind="validateInfos.areaFlag" id="NuBaseInfoForm-areaFlag" name="areaFlag">
<j-dict-select-tag v-model:value="formData.areaFlag" dictCode="nu_type"
@ -40,7 +40,7 @@ import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../NuBaseInfo.api';
import { saveOrUpdate,getNuId } from '../NuBaseInfo.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
const props = defineProps({
@ -64,7 +64,7 @@ const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = reactive({
nuName: [{ required: true, message: '请输入文件类型!' },],
nuName: [{ required: true, message: '请输入区域名称!' },],
areaFlag: [{ required: true, message: '请选择区域属性!' },],
});
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
@ -85,8 +85,13 @@ const disabled = computed(() => {
/**
* 新增
*/
function add() {
edit({});
async function add() {
let nuId = ''
await getNuId(null).then((res) => {
console.log("🚀 ~ add ~ res:", res)
nuId = res.nuId;
});
edit({nuId});
}
/**

View File

@ -39,7 +39,7 @@
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '更名';
title.value = disableSubmit.value ? '详情' : '区域名称';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);

View File

@ -10,20 +10,23 @@
<div>
<a-card title="基础功能">
<a-row v-for="(item,index) in treeData" :key="index">
<a-checkbox-group v-model:value="formData.kzgn">
<template v-if="item.code === 'hldy' && areaFlag == 1">
<a-col :span="24" v-for="itemOne in item.children">
<a-checkbox :checked="true" disabled style="margin-top:10px;">{{ itemOne.slotTitle }}</a-checkbox>
<a-checkbox :value="itemOne.key" style="margin-top:10px;">{{ itemOne.slotTitle }}</a-checkbox>
</a-col>
</template>
<template v-else-if="item.code === 'kf' && areaFlag == 3">
<a-col :span="24" v-for="itemOne in item.children">
<a-checkbox :checked="true" disabled style="margin-top:10px;">{{ itemOne.slotTitle }}</a-checkbox>
<a-checkbox :value="itemOne.key" style="margin-top:10px;">{{ itemOne.slotTitle }}</a-checkbox>
</a-col>
</template>
</a-checkbox-group>
</a-row>
</a-card>
<a-card title="扩展功能" style="margin-top: 20px;">
<!-- <a-card title="扩展功能" style="margin-top: 20px;">
<a-row v-for="(item,index) in treeData" :key="index">
<template v-if="item.code === 'kzgn'">
<a-checkbox-group v-model:value="formData.kzgn">
@ -33,7 +36,7 @@
</a-checkbox-group>
</template>
</a-row>
</a-card>
</a-card> -->
</div>

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/iot/tplink/cameraInfo/previewList',
save='/iot/tplink/cameraInfo/add',
edit='/iot/tplink/cameraInfo/edit',
deleteOne = '/iot/tplink/cameraInfo/delete',
deleteBatch = '/iot/tplink/cameraInfo/deleteBatch',
importExcel = '/iot/tplink/cameraInfo/importExcel',
exportXls = '/iot/tplink/cameraInfo/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
* @param handleSuccess
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}

View File

@ -0,0 +1,53 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '区域编码',
align: "center",
dataIndex: 'nuId'
},
{
title: '区域名称',
align: "center",
dataIndex: 'nuName'
},
{
title: '设备标识',
align: "center",
dataIndex: 'deviceIndex'
},
{
title: '设备型号',
align: "center",
dataIndex: 'deviceModel'
},
{
title: '设备维度',
align: "center",
dataIndex: 'dimension'
},
{
title: '设备类型',
align: "center",
dataIndex: 'deviceType_dictText'
},
{
title: '在线状态',
align: "center",
dataIndex: 'deviceStatus_dictText'
},
];
// 高级查询数据
export const superQuerySchema = {
deviceType: {title: '设备类型',order: 0,view: 'text', type: 'string',},
deviceStatus: {title: '设备状态',order: 1,view: 'number', type: 'number',},
deviceModel: {title: '设备型号',order: 2,view: 'text', type: 'string',},
nuId: {title: '护理单元ID',order: 3,view: 'text', type: 'string',},
nuName: {title: '护理单元',order: 4,view: 'text', type: 'string',},
dimension: {title: '设备维度',order: 5,view: 'text', type: 'string',},
};

View File

@ -0,0 +1,249 @@
<template>
<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-row :gutter="24">
<a-col :lg="6">
<a-form-item name="nuName">
<template #label><span title="区域名称">区域名称</span></template>
<a-input placeholder="请输入区域名称" v-model:value="queryParam.nuName" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="dimension">
<template #label><span title="设备维度">设备维度</span></template>
<j-dict-select-tag v-model:value="queryParam.dimension" :showLabel="false" dictCode="dimension" placeholder="请选择设备纬度" />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="deviceType">
<template #label><span title="设备类型">设备类型</span></template>
<j-dict-select-tag v-model:value="queryParam.deviceType" :showLabel="false" dictCode="tplink_device_type" placeholder="请选择设备类型" />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="deviceStatus">
<template #label><span title="在线状态">在线状态</span></template>
<j-dict-select-tag v-model:value="queryParam.deviceStatus" :showLabel="false" dictCode="tplink_status" placeholder="请选择在线状态" />
</a-form-item>
</a-col>
<a-col :lg="9" :md="9" :sm="24">
<span style="float: left; overflow: hidden" 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>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<IotDevicesModal ref="registerModal" @success="handleSuccess"></IotDevicesModal>
<CameraPreviewModal ref="previewModal"></CameraPreviewModal>
</div>
</template>
<script lang="ts" name="iotDevices-iotDevices" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './IotDevices.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './IotDevices.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import IotDevicesModal from './components/IotDevicesModal.vue'
import { useUserStore } from '/@/store/modules/user';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import CameraPreviewModal from '/@/views/iot/tplink/camera/components/CameraPreviewModal.vue'
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const previewModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '物联设备预览',
api: list,
columns,
canResize:false,
useSearchForm: false,
showIndexColumn: true,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
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:8,
xl:8,
xxl:8
});
const wrapperCol = reactive({
xs: 24,
sm: 16,
});
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
searchQuery();
}
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(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 handlePreview(record: Recordable) {
previewModal.value.disableSubmit = true;
previewModal.value.edit(record);
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '预览',
onClick: handlePreview.bind(null, record),
ifShow: () => {
return record.deviceType == 'SURVEILLANCECAMERA';
},
},
];
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
function 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%;
}
}
</style>

View File

@ -0,0 +1,62 @@
<template>
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true" bodyStyle="padding:14px;"
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
<IotDevicesList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></IotDevicesList>
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
</template>
</a-drawer>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import IotDevicesList from './IotDevicesList.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(1200);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 编辑
* @param record
*/
function init(record) {
title.value = '设备预览';
visible.value = true;
nextTick(() => {
registerForm.value.init(record);
});
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
init,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,175 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="IotDevicesForm">
<a-row>
<a-col :span="24">
<a-form-item label="设备类型" v-bind="validateInfos.deviceType" id="IotDevicesForm-deviceType" name="deviceType">
<a-input v-model:value="formData.deviceType" placeholder="请输入设备类型" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="设备状态 0 离线 1 在线 2 重启中 3 升级中 4 配置中 5 同步中" v-bind="validateInfos.deviceStatus" id="IotDevicesForm-deviceStatus" name="deviceStatus">
<a-input-number v-model:value="formData.deviceStatus" placeholder="请输入设备状态 0 离线 1 在线 2 重启中 3 升级中 4 配置中 5 同步中" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="设备型号" v-bind="validateInfos.deviceModel" id="IotDevicesForm-deviceModel" name="deviceModel">
<a-input v-model:value="formData.deviceModel" placeholder="请输入设备型号" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="护理单元ID" v-bind="validateInfos.nuId" id="IotDevicesForm-nuId" name="nuId">
<a-input v-model:value="formData.nuId" placeholder="请输入护理单元ID" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="护理单元" v-bind="validateInfos.nuName" id="IotDevicesForm-nuName" name="nuName">
<a-input v-model:value="formData.nuName" placeholder="请输入护理单元" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="设备维度" v-bind="validateInfos.dimension" id="IotDevicesForm-dimension" name="dimension">
<a-input v-model:value="formData.dimension" placeholder="请输入设备维度" allow-clear ></a-input>
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../IotDevices.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({})},
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
deviceType: '',
deviceStatus: undefined,
deviceModel: '',
nuId: '',
nuName: '',
dimension: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = reactive({
});
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
//
const disabled = computed(()=>{
if(props.formBpm === true){
if(props.formData.disabled === false){
return false;
}else{
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
const tmpData = {};
Object.keys(formData).forEach((key) => {
if(record.hasOwnProperty(key)){
tmpData[key] = record[key]
}
})
//
Object.assign(formData, tmpData);
});
}
/**
* 提交数据
*/
async function submitForm() {
try {
//
await validate();
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
}
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
</style>

View File

@ -0,0 +1,77 @@
<template>
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<IotDevicesForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></IotDevicesForm>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import IotDevicesForm from './IotDevicesForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -78,6 +78,12 @@ export const columns: BasicColumn[] = [
dataIndex: 'lowerLimit',
width:'100px'
},
{
title: '品牌型号',
align: "center",
dataIndex: 'brandType',
width:'100px'
},
{
title: '物料标签',
align: "center",

View File

@ -126,6 +126,11 @@
<j-dict-select-tag type='list' v-model:value="formData.izJgyh" dictCode="yn" placeholder="请选择机构优惠" />
</a-form-item>
</a-col>
<a-col :span="8" >
<a-form-item label="品牌型号" v-bind="validateInfos.brandType" id="ConfigMaterialInfoForm-brandType" name="brandType">
<a-input v-model:value="formData.brandType" maxlength="101" placeholder="请输入品牌型号" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="供应商" v-bind="validateInfos.suppliers" id="ConfigMaterialInfoForm-suppliers" name="suppliers" :labelCol="labelCol3" :wrapperCol="wrapperCol3">
<j-select-multiple placeholder="请选择供应商" v-model:value="formData.suppliers" dictCode="nu_config_suppliers_info,suppliers_name,id,del_flag = 0" />
@ -196,6 +201,7 @@
izYbbx:'',
izJgyh:'',
tagType:'',
brandType:'',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 9 } });

View File

@ -4,7 +4,7 @@
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="BlWarehouseMaterialInfoForm">
<a-row class="card-class">
<a-col :span="24">
<a-col :span="24" hidden>
<a-form-item label="库房" v-bind="validateInfos.nuName" id="BlWarehouseMaterialInfoForm-nuName" name="nuName" >
<a-input v-model:value="formData.nuName" ></a-input>
</a-form-item>

View File

@ -4,33 +4,34 @@
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="BlWarehouseMaterialInfoForm">
<a-row>
<a-col :span="24">
<a-col :span="24" hidden>
<a-form-item label="库房" v-bind="validateInfos.nuName" id="BlWarehouseMaterialInfoForm-nuName" name="nuName" >
<a-input v-model:value="formData.nuName" ></a-input>
<a-input v-model:value="formData.nuName" placeholder="库房" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="负责人" v-bind="validateInfos.fzr" id="BlWarehouseMaterialInfoForm-fzr" name="fzr" >
<a-input v-model:value="formData.fzr" ></a-input>
<j-dict-select-tag v-model:value="formData.fzr" dictCode="nu_biz_employees_info,name,id" placeholder="请选择负责人" @change="changeFzr" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="负责人电话" v-bind="validateInfos.fzrTel" id="BlWarehouseMaterialInfoForm-fzrTel" name="fzrTel" >
<a-input v-model:value="formData.fzrTel" ></a-input>
<a-input v-model:value="formData.fzrTel" placeholder="负责人电话" disabled ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="性别" v-bind="validateInfos.fzrSex" id="BlWarehouseMaterialInfoForm-fzrSex" name="fzrSex">
<a-select placeholder="性别" v-model:value="formData.fzrSex">
<a-input v-model:value="formData.fzrSex" placeholder="性别" disabled ></a-input>
<!-- <a-select placeholder="性别" v-model:value="formData.fzrSex">
<a-select-option value="">请选择</a-select-option>
<a-select-option value="男"></a-select-option>
<a-select-option value="女"></a-select-option>
</a-select>
</a-select> -->
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="年龄" v-bind="validateInfos.fzrAge" id="BlWarehouseMaterialInfoForm-fzrAge" name="fzrAge">
<a-input-number placeholder="年龄" v-model:value="formData.fzrAge" min="18" max="99" style="width: 100%" ></a-input-number>
<a-input-number placeholder="年龄" disabled v-model:value="formData.fzrAge" min="18" max="99" style="width: 100%" ></a-input-number>
</a-form-item>
</a-col>
<a-col :span="24">
@ -80,7 +81,7 @@
const confirmLoading = ref<boolean>(false);
//
const validatorRules = reactive({
nuName: [{ required: true, message: '请输入库房名称!' },],
fzr: [{ required: true, message: '请选择负责人!' },],
fzrTel: [{ required: false, message: '请输入负责人电话!' },{ pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误', trigger: 'blur' }],
});
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
@ -97,7 +98,26 @@
return props.formDisabled;
});
function changeFzr(value) {
if(value){
defHttp.get({url: "/admin/bizEmployeesInfo/bizEmployeesInfo/queryById",params:{id:value}}).then(res => {
console.log("🚀 ~ changeFzr ~ res:", res)
if(res.dateOfBirth){
var data = new Date();
var dateOfBirth = new Date(res.dateOfBirth);
var age = data.getFullYear() - dateOfBirth.getFullYear();
formData.fzrAge = age;
}
formData.fzrTel = res.emergencyTel;
formData.fzrSex = res.sex;
formData.fzrHeadPath = res.headPath
})
}
}
/**
* 新增
*/
@ -109,6 +129,7 @@
* 编辑
*/
function edit(record) {
console.log("🚀 ~ edit ~ record:", record)
nextTick(() => {
resetFields();
const tmpData = {};