parent
0db0f3f973
commit
21c340d3b4
|
|
@ -20,7 +20,7 @@ enum Api {
|
|||
}
|
||||
|
||||
/**
|
||||
* 护理单元列表
|
||||
* 区域列表
|
||||
* @param params
|
||||
*/
|
||||
export const getNuList = (params) => {
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
//选择框标题
|
||||
modalTitle: {
|
||||
type: String,
|
||||
default: '护理单元选择',
|
||||
default: '区域选择',
|
||||
},
|
||||
},
|
||||
emits: ['register', 'getSelectResult'],
|
||||
|
|
@ -112,7 +112,7 @@
|
|||
//update-end-author:liusq date:2023-10-30 for: [issues/5514]组件页面显示错位
|
||||
schemas: [
|
||||
{
|
||||
label: '护理单元名称',
|
||||
label: '区域名称',
|
||||
field: 'nuName',
|
||||
component: 'JInput',
|
||||
colProps: { span: 10 },
|
||||
|
|
@ -122,13 +122,13 @@
|
|||
//定义表格列
|
||||
const columns = [
|
||||
{
|
||||
title: '护理单元ID',
|
||||
title: '区域ID',
|
||||
dataIndex: 'nuId',
|
||||
width: 180,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: '护理单元名称',
|
||||
title: '区域名称',
|
||||
dataIndex: 'nuName',
|
||||
// width: 180,
|
||||
},
|
||||
|
|
@ -144,7 +144,7 @@
|
|||
rowKey: 'nuId',
|
||||
columns: [
|
||||
{
|
||||
title: '护理单元名称',
|
||||
title: '区域名称',
|
||||
dataIndex: 'nuName',
|
||||
width: 40,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ import { useMessage } from "/@/hooks/web/useMessage";
|
|||
import AsyncListComponent from '@/components/dataAsync/AsyncMainList.vue'
|
||||
|
||||
const props = defineProps({
|
||||
syncType: '',//护理单元'nuBaseInfo'
|
||||
syncType: '',//区域'nuBaseInfo'
|
||||
showSyncBtn: true,
|
||||
});
|
||||
const emit = defineEmits(['orgChanged', 'handleAsync']);
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ function searchReset() {
|
|||
getBaseList(item);
|
||||
}
|
||||
|
||||
//获取护理单元及物联设备数量
|
||||
//获取区域及物联设备数量
|
||||
function getBaseList(item){
|
||||
defHttp.get({ url: '/admin/nuBaseInfo/nuBaseInfo/getBaseWlsbList', params: {orgCode:item.orgCode} }).then((res) => {
|
||||
baseList.value = res;
|
||||
|
|
|
|||
|
|
@ -55,12 +55,12 @@ export const columns: BasicColumn[] = [
|
|||
// dataIndex: 'locationName'
|
||||
// },
|
||||
// {
|
||||
// title: '护理单元',
|
||||
// title: '区域',
|
||||
// align: "center",
|
||||
// dataIndex: 'nuId_dictText',
|
||||
// },
|
||||
// {
|
||||
// title: '护理单元',
|
||||
// title: '区域',
|
||||
// align: "center",
|
||||
// dataIndex: 'nuName'
|
||||
// },
|
||||
|
|
@ -171,7 +171,7 @@ export const formSchema: FormSchema[] = [
|
|||
// dynamicDisabled: true
|
||||
// },
|
||||
// {
|
||||
// label: '护理单元',
|
||||
// label: '区域',
|
||||
// field: 'nuId',
|
||||
// component: 'JSelectNu',
|
||||
// componentProps: {
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ import {ref, reactive, createVNode, h, onMounted, watch, unref} from 'vue';
|
|||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '护理单元-物联管理-摄像头信息',
|
||||
title: '区域-物联管理-摄像头信息',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ import {ref, reactive, createVNode, h, onMounted, watch, unref} from 'vue';
|
|||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '护理单元-物联管理-录像信息',
|
||||
title: '区域-物联管理-录像信息',
|
||||
api: searchVideo,
|
||||
columns: recordingColumns,
|
||||
canResize: false,
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '护理单元-物联管理-录像计划',
|
||||
title: '区域-物联管理-录像计划',
|
||||
api: list,
|
||||
columns,
|
||||
rowKey : "ids",
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '护理单元-物联管理-机构信息',
|
||||
title: '区域-物联管理-机构信息',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:false,
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '护理单元-物联管理-区域信息',
|
||||
title: '区域-物联管理-区域信息',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:false,
|
||||
|
|
|
|||
|
|
@ -102,11 +102,11 @@ export const searchFormSchema: FormSchema[] = [
|
|||
// colProps: { span: 6 },
|
||||
// },
|
||||
// {
|
||||
// label: '护理单元',
|
||||
// label: '区域',
|
||||
// field: 'deviceStatus',
|
||||
// component: 'JDictSelectTag',
|
||||
// componentProps: {
|
||||
// placeholder: '请选择护理单元',
|
||||
// placeholder: '请选择区域',
|
||||
// dictCode: 'nu_base_info,nu_name,id,del_flag = 0 order by nu_name asc',
|
||||
// },
|
||||
// colProps: { span: 6 },
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ import { defHttp } from '/@/utils/http/axios';
|
|||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
//护理单元回调
|
||||
//区域回调
|
||||
function handleHldyParams(params){
|
||||
defHttp.post({
|
||||
url: "/iot/tq/electricityMeter/editHldy",
|
||||
|
|
@ -245,7 +245,7 @@ import { defHttp } from '/@/utils/http/axios';
|
|||
apiLogModal.value.showApiLog(record);
|
||||
}
|
||||
/**
|
||||
* 配置护理单元
|
||||
* 配置区域
|
||||
*/
|
||||
function handlePzhldy(record){
|
||||
hldyUtilsModal.value.disableSubmit = true;
|
||||
|
|
|
|||
|
|
@ -239,14 +239,14 @@
|
|||
apiLogModal.value.showApiLog(record);
|
||||
}
|
||||
/**
|
||||
* 配置护理单元
|
||||
* 配置区域
|
||||
*/
|
||||
function handlePzhldy(record){
|
||||
hldyUtilsModal.value.disableSubmit = true;
|
||||
hldyUtilsModal.value.edit(record);
|
||||
}
|
||||
|
||||
//护理单元回调
|
||||
//区域回调
|
||||
function handleHldyParams(params){
|
||||
defHttp.post({
|
||||
url: "/iot/tq/waterMeter/editHldy",
|
||||
|
|
|
|||
|
|
@ -110,11 +110,11 @@ export const searchFormSchema: FormSchema[] = [
|
|||
// colProps: { span: 6 },
|
||||
// },
|
||||
// {
|
||||
// label: '护理单元',
|
||||
// label: '区域',
|
||||
// field: 'deviceStatus',
|
||||
// component: 'JDictSelectTag',
|
||||
// componentProps: {
|
||||
// placeholder: '请选择护理单元',
|
||||
// placeholder: '请选择区域',
|
||||
// dictCode: 'nu_base_info,nu_name,id,del_flag = 0 order by nu_name asc',
|
||||
// },
|
||||
// colProps: { span: 6 },
|
||||
|
|
|
|||
|
|
@ -98,11 +98,11 @@ export const searchFormSchema: FormSchema[] = [
|
|||
// colProps: { span: 6 },
|
||||
// },
|
||||
// {
|
||||
// label: '护理单元',
|
||||
// label: '区域',
|
||||
// field: 'deviceStatus',
|
||||
// component: 'JDictSelectTag',
|
||||
// componentProps: {
|
||||
// placeholder: '请选择护理单元',
|
||||
// placeholder: '请选择区域',
|
||||
// dictCode: 'nu_base_info,nu_name,id,del_flag = 0 order by nu_name asc',
|
||||
// },
|
||||
// colProps: { span: 6 },
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@
|
|||
}
|
||||
|
||||
|
||||
//护理单元回调
|
||||
//区域回调
|
||||
function handleHldyParams(params){
|
||||
defHttp.post({
|
||||
url: "/iot/yiweilian/humidDevice/editHldy",
|
||||
|
|
@ -203,7 +203,7 @@
|
|||
})
|
||||
}
|
||||
/**
|
||||
* 配置护理单元
|
||||
* 配置区域
|
||||
*/
|
||||
function handlePzhldy(record){
|
||||
hldyUtilsModal.value.disableSubmit = true;
|
||||
|
|
|
|||
|
|
@ -5,14 +5,15 @@
|
|||
<div class="org-info-header">
|
||||
<div class="org-title">
|
||||
<span class="base-info-label">机构信息:</span>
|
||||
<span v-if="!orgData" class="base-info-dn" style="color: #ff4d4f;"> 请先选择机构</span>
|
||||
<span v-else class="org-name">{{ orgData?.departName }}</span>
|
||||
<span v-if="!orgData" class="base-info-label" style="color: #ff4d4f;"> 请先选择机构</span>
|
||||
<span v-else class="base-info-label">{{ orgData?.departName }}</span>
|
||||
<span v-if="orgData" class="base-info-label" style="margin-left:30px;">机构编码:{{ orgData?.orgCode || '-' }}</span>
|
||||
</div>
|
||||
<a-button v-if="!orgSelectedCon" class="reset-btn" type="primary" @click.stop="orgReset">
|
||||
<a-button v-if="!orgSelectedCon" class="reset-btn" type="primary" @click.stop="orgReset" style="margin-top:10px;">
|
||||
<span>重新选择</span>
|
||||
</a-button>
|
||||
</div>
|
||||
<div class="org-info-content">
|
||||
<!-- <div class="org-info-content">
|
||||
<div class="info-row">
|
||||
<div class="info-item">
|
||||
<span class="label">机构编码:</span>
|
||||
|
|
@ -39,7 +40,7 @@
|
|||
<div class="info-item">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</a-card>
|
||||
</div>
|
||||
|
|
@ -136,15 +137,16 @@ const selectedOrgs = ref<string[]>([])
|
|||
|
||||
const handleOrgSelected = async (org) => {
|
||||
if (!!orgData.value && orgData.value.orgId != org.orgId) {
|
||||
Modal.confirm({
|
||||
title: '变更机构提醒',
|
||||
content: '是否变更机构!',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: async () => {
|
||||
await loadOrgData(org);
|
||||
},
|
||||
});
|
||||
// Modal.confirm({
|
||||
// title: '变更机构提醒',
|
||||
// content: '是否变更机构!',
|
||||
// okText: '确认',
|
||||
// cancelText: '取消',
|
||||
// onOk: async () => {
|
||||
// await loadOrgData(org);
|
||||
// },
|
||||
// });
|
||||
await loadOrgData(org);
|
||||
} else {
|
||||
await loadOrgData(org);
|
||||
}
|
||||
|
|
@ -221,13 +223,14 @@ defineExpose({
|
|||
align-items: center;
|
||||
margin-bottom: 5px;
|
||||
padding-bottom: 5px;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
// border-bottom: 1px solid #f0f0f0;
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
.org-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 9px;
|
||||
|
||||
.base-info-label {
|
||||
font-weight: 600;
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ import { getWeekMonthQuarterYear } from '/@/utils';
|
|||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '护理单元名称',
|
||||
title: '区域名称',
|
||||
align: "center",
|
||||
dataIndex: 'nuName'
|
||||
},
|
||||
{
|
||||
title: '护理单元编码',
|
||||
title: '区域编码',
|
||||
align: "center",
|
||||
dataIndex: 'nuId'
|
||||
},
|
||||
|
|
@ -27,15 +27,39 @@ export const columns: BasicColumn[] = [
|
|||
// width:100
|
||||
// },
|
||||
];
|
||||
//已选择列表数据
|
||||
export const selectedColumns: BasicColumn[] = [
|
||||
//列表数据
|
||||
export const columnsSync: BasicColumn[] = [
|
||||
{
|
||||
title: '护理单元名称',
|
||||
title: '区域名称',
|
||||
align: "center",
|
||||
dataIndex: 'nuName'
|
||||
},
|
||||
{
|
||||
title: '护理单元编码',
|
||||
title: '区域编码',
|
||||
align: "center",
|
||||
dataIndex: 'nuId'
|
||||
},
|
||||
{
|
||||
title: '区域标签',
|
||||
align: "center",
|
||||
dataIndex: 'areaFlag_dictText'
|
||||
},
|
||||
{
|
||||
title: '同步状态',
|
||||
align: "center",
|
||||
dataIndex: 'izSync_dictText',
|
||||
width:100
|
||||
},
|
||||
];
|
||||
//已选择列表数据
|
||||
export const selectedColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '区域名称',
|
||||
align: "center",
|
||||
dataIndex: 'nuName'
|
||||
},
|
||||
{
|
||||
title: '区域编码',
|
||||
align: "center",
|
||||
dataIndex: 'nuId'
|
||||
},
|
||||
|
|
@ -59,7 +83,7 @@ export const selectedColumns: BasicColumn[] = [
|
|||
];
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
nuName: {title: '护理单元名称',order: 0,view: 'text', type: 'string',},
|
||||
nuName: {title: '区域名称',order: 0,view: 'text', type: 'string',},
|
||||
areaFlag: {title: '区域标签',order: 1,view: 'list', type: 'string',dictCode: 'nu_type',},
|
||||
status: {title: '使用状态',order: 2,view: 'list', type: 'string',dictCode: 'nu_status',},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ const userStore = useUserStore();
|
|||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '护理单元',
|
||||
title: '区域',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,305 @@
|
|||
<template>
|
||||
<div class="p-2">
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" @click="batchAddOpen = true" preIcon="ant-design:plus-outlined"> 批量新增</a-button>
|
||||
<a-button type="primary" @click="handleAsync" preIcon="ant-design:sync-outlined"> 全部同步</a-button>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<NuBaseInfoModal ref="registerModal" :orgCode="orgCode" @success="handleSuccess"></NuBaseInfoModal>
|
||||
<!-- 批量新增 -->
|
||||
<a-modal v-model:open="batchAddOpen" title="批量新增" :ok-text="'确认'" :cancel-text="'取消'" @ok="handleOk">
|
||||
<a-form layout="horizontal" :label-col="{ span: 8 }" :wrapper-col="{ span: 12 }" style="margin-top: 20px;">
|
||||
<template v-for="item in nuTypeOptions" :key="item.value">
|
||||
<a-form-item :label="item.text || item.label">
|
||||
<a-input-number v-model:value="numberValues[item.value]" :min="0" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</template>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="nuBaseInfo-nuBaseInfo" setup>
|
||||
import { ref, reactive, onMounted,defineExpose } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columnsSync } from './NuBaseInfo.data';
|
||||
import { list, deleteOne, batchDelete, listByOrgCode, batchAdd, asyncFunc } from './NuBaseInfo.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import NuBaseInfoModal from './components/NuBaseInfoModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { JInput } from '/@/components/Form';
|
||||
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
import { initDictOptions } from '/@/utils/dict';
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const nuTypeOptions = ref([]);
|
||||
|
||||
const numberValues = ref({});
|
||||
const formRef = ref();
|
||||
const batchAddOpen = ref(false)//批量新增显隐
|
||||
const queryParam = reactive<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const userStore = useUserStore();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '区域',
|
||||
api: list,
|
||||
columns: columnsSync,
|
||||
// canResize: false,
|
||||
useSearchForm: false,
|
||||
showIndexColumn: true,
|
||||
// showTableSetting: false,
|
||||
pagination: false,
|
||||
size: 'small',
|
||||
immediate: false,
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
queryParam.pageSize = -1 //不分页
|
||||
queryParam.column = 'nuId' //排序字段
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
}
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
xs: 24,
|
||||
sm: 6,
|
||||
xl: 6,
|
||||
xxl: 6
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 18,
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
searchQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
var params = { orgCode: queryParam.sysOrgCode }
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.add(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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除
|
||||
*/
|
||||
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),
|
||||
ifShow: () => {
|
||||
return record.izSync == 1;
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '移除',
|
||||
popConfirm: {
|
||||
title: '是否确认移除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
ifShow: () => {
|
||||
return record.izSync == 1;
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
ifShow: () => {
|
||||
return record.izSync == 0;
|
||||
},
|
||||
},
|
||||
// {
|
||||
// label: '同步',
|
||||
// popConfirm: {
|
||||
// title: '是否确认同步到对应机构',
|
||||
// confirm: handleDelete.bind(null, record),
|
||||
// placement: 'topLeft',
|
||||
// },
|
||||
// ifShow: () => {
|
||||
// return record.izSync == 1;
|
||||
// },
|
||||
// }
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
// 同步数据
|
||||
const handleAsync = async () => {
|
||||
console.log("🚀 ~ handleAsync ~ queryParam.orgCode:", queryParam.sysOrgCode)
|
||||
await asyncFunc({ orgCode: queryParam.sysOrgCode });
|
||||
//刷新历史数据
|
||||
// syncComRef?.value?.refreshHistory()
|
||||
// createMessage.success("同步结果请在同步历史中查看!");
|
||||
reload();
|
||||
};
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
//打开批量新增窗口
|
||||
function handleBatchAdd() {
|
||||
batchAddOpen.value = true
|
||||
}
|
||||
|
||||
//批量新增提交
|
||||
function handleOk() {
|
||||
let arr = []
|
||||
for (const key in numberValues.value) {
|
||||
if (Object.hasOwnProperty.call(numberValues.value, key)) {
|
||||
const value = numberValues.value[key];
|
||||
arr.push({
|
||||
type: key,
|
||||
num: value
|
||||
})
|
||||
}
|
||||
}
|
||||
batchAdd({
|
||||
orgCode: queryParam.sysOrgCode,
|
||||
batchAddList: arr
|
||||
}).then(res => {
|
||||
batchAddOpen.value = false
|
||||
reload()
|
||||
})
|
||||
}
|
||||
|
||||
async function init(record){
|
||||
console.log("🚀 ~ init ~ record:", record)
|
||||
queryParam.sysOrgCode = record.orgCode
|
||||
reload();
|
||||
|
||||
|
||||
const dictData = await initDictOptions('nu_type', '');
|
||||
nuTypeOptions.value = dictData.reduce((prev, next) => {
|
||||
if (next && next['status'] == 0) {
|
||||
prev.push({
|
||||
text: next['text'] || next['label'],
|
||||
value: next['value'],
|
||||
});
|
||||
}
|
||||
return prev;
|
||||
}, []);
|
||||
nuTypeOptions.value.forEach(item => {
|
||||
numberValues.value[item.value] = 0;
|
||||
});
|
||||
}
|
||||
|
||||
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>
|
||||
|
|
@ -6,13 +6,13 @@
|
|||
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="护理单元名称自动生成" allow-clear
|
||||
<a-form-item label="区域名称" v-bind="validateInfos.nuName" id="NuBaseInfoForm-nuName" name="nuName">
|
||||
<a-input v-model:value="formData.nuName" placeholder="区域名称自动生成" allow-clear
|
||||
:disabled="true"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="护理单元编码" v-bind="validateInfos.nuId" id="NuBaseInfoForm-nuId" name="nuId">
|
||||
<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"></a-input>
|
||||
</a-form-item>
|
||||
|
|
@ -48,7 +48,6 @@ const props = defineProps({
|
|||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: () => ({}) },
|
||||
formBpm: { type: Boolean, default: true },
|
||||
orgCode: ''
|
||||
});
|
||||
const formRef = ref();
|
||||
const useForm = Form.useForm;
|
||||
|
|
@ -57,6 +56,7 @@ const formData = reactive<Record<string, any>>({
|
|||
id: '',
|
||||
nuName: '',
|
||||
nuId: '',
|
||||
orgCode: '',
|
||||
areaFlag: '',
|
||||
status: '',
|
||||
});
|
||||
|
|
@ -85,8 +85,9 @@ const disabled = computed(() => {
|
|||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
function add(record) {
|
||||
console.log("🚀 ~ add ~ record:", record)
|
||||
edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -143,7 +144,6 @@ async function submitForm() {
|
|||
if (!model.id) {
|
||||
model.status = "0";
|
||||
}
|
||||
model.orgCode = props.orgCode
|
||||
await saveOrUpdate(model, isUpdate.value)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
|
|
|
|||
|
|
@ -24,11 +24,11 @@ const props = defineProps({
|
|||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
function add(record) {
|
||||
title.value = '新增';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.add();
|
||||
registerForm.value.add(record);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,297 +1,73 @@
|
|||
<template>
|
||||
<!--
|
||||
selectedSize:已选择条数
|
||||
topTipText:机构信息卡片收起时提示文字
|
||||
showAddBtn:是否展示新增按钮
|
||||
showSelectedArea:是否展示全部、已选择、未选择区域
|
||||
hasSearchConditions:是否存在搜索条件
|
||||
viewTypeChanged:源数据、全部、已选择、未选择变更时的钩子函数
|
||||
orgChanged:机构变更钩子
|
||||
handleAsync:同步数据按钮
|
||||
handleBatchAdd:批量新增
|
||||
-->
|
||||
<SyncComponent ref="syncComRef" :syncType="'nuBaseInfo'" :selectedSize="listComRef?.getDataSource()?.length"
|
||||
:syncTipText="'同步(全部)'" :leftTableML="'1px'" :rightTableML="'22px'" :batchRemoveText="'移除选中'"
|
||||
:showBatchAddBtn="true" :leftListTipText="'已同步'" :rightListTipText="'待同步'" :showAddAllBtn="false"
|
||||
:showAddBtn="true" :showResetDataBtn="false" :hasSearchConditions="hasSearchConditions" :topTipText="'点击展开机构详情'"
|
||||
:screenModeTip_left="'已同步'" :screenModeTip_right="'待同步'" :showSelectedArea="false"
|
||||
@viewTypeChanged="viewTypeChanged" @orgChanged="orgChanged" @handleAdd="handleAdd"
|
||||
@handleBatchAdd="handleBatchAdd" @handleRemoveAll="handleRemoveAll" @handleAsync="handleAsync"
|
||||
@handleReload="handleReload">
|
||||
<!-- 业务机构数据列表 -->
|
||||
<template #sourceTableSlot>
|
||||
<a-table style="margin-top: 8px;" size="small" :columns="selectedColumns"
|
||||
:dataSource="Array.from(selectedItems.values())" :pagination="false" :scroll="{ y: '55vh' }">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<a-popconfirm placement="left" ok-text="确认" cancel-text="取消"
|
||||
@confirm="handleRemoveFromRight(record.id)">
|
||||
<template #title>
|
||||
<span>是否确认移除</span>
|
||||
</template>
|
||||
<a-button type="link" danger size="small"
|
||||
:disabled="initialDataIds.includes(record.id)">移除</a-button>
|
||||
</a-popconfirm>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'mp3File'">
|
||||
<span v-if="!record.mp3File" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<audio controls v-else style="width: 100%; max-width: 300px; height: 40px;">
|
||||
<source :src="getFileAccessHttpUrl(record.mp3File)">
|
||||
</audio>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'mp4File'">
|
||||
<span v-if="!record.mp4File" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<a-button v-else type="primary" size="small" @click="openVideoModal(record.mp4File)">
|
||||
播放视频
|
||||
</a-button>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'bodyTagList'">
|
||||
<span v-if="!record.bodyTagList || record.bodyTagList.length === 0"
|
||||
style="font-size: 12px;font-style: italic;">-</span>
|
||||
<template v-else>
|
||||
{{record.bodyTagList.map(item => item.tagName).join('、')}}
|
||||
</template>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'emotionTagList'">
|
||||
<span v-if="!record.emotionTagList || record.emotionTagList.length === 0"
|
||||
style="font-size: 12px;font-style: italic;">-</span>
|
||||
<template v-else>
|
||||
{{record.emotionTagList.map(item => item.tagName).join('、')}}
|
||||
</template>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'previewFileMedia'">
|
||||
<span v-if="!record.previewFileMedia" style="font-size: 12px;font-style: italic;">无图片</span>
|
||||
<img v-else :src="testOrgInfo.url + record.previewFileMedia"
|
||||
style="max-width: 50px; max-height: 50px;" />
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'immediateFileMedia'">
|
||||
<span v-if="!record.immediateFileMedia" style="font-size: 12px;font-style: italic;">无图片</span>
|
||||
<img v-else :src="testOrgInfo.url + record.immediateFileMedia"
|
||||
style="max-width: 50px; max-height: 50px;" />
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</template>
|
||||
<OrgSelect ref="orgSelectComRef" @orgChanged="orgChanged" @orgReset="orgReset"></OrgSelect>
|
||||
|
||||
<!-- 业务平台数据列表 -->
|
||||
<template #businessTableSlot>
|
||||
<NuBaseInfoList style="margin-top: -18px;" ref="listComRef" v-if="syncComRef?.orgData?.orgCode"
|
||||
:key="syncComRef?.orgData?.orgCode" :orgCode="syncComRef?.orgData?.orgCode"></NuBaseInfoList>
|
||||
</template>
|
||||
</SyncComponent>
|
||||
<div class="p-2 base-class" style="margin-top: -0.5rem;" v-show="showDevices">
|
||||
<NuBaseInfoSyncList ref="baseSyncModalRef"/>
|
||||
</div>
|
||||
|
||||
<a-modal v-model:visible="showVideoModal" title="视频播放" :footer="null" @cancel="closeVideoModal"
|
||||
:bodyStyle="{ padding: '0', maxHeight: '80vh', overflow: 'auto' }">
|
||||
<video controls style="width: 100%; max-height: '70vh'; display: block; margin: 0 auto;">
|
||||
<source :src="videoUrl">
|
||||
您的浏览器不支持视频播放。
|
||||
</video>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script setup name="synchronization-nubaseinfo" lang="ts">
|
||||
/**
|
||||
*说明
|
||||
* 如何获取当前机构信息 syncComRef?.value?.orgData
|
||||
*/
|
||||
import { ref, reactive, computed, onBeforeMount } from 'vue'
|
||||
import SyncComponent from '/@/components/Sync/SyncComponent.vue'
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
import { getOrgInfo } from '/@/api/common/api';
|
||||
// 以下为护理单元引用:
|
||||
import { list, asyncFunc, listByOrgCode } from './NuBaseInfo.api';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils'
|
||||
import { selectedColumns } from './NuBaseInfo.data'
|
||||
import NuBaseInfoList from './NuBaseInfoList.vue'
|
||||
<script setup name="tq-water-index" lang="ts">
|
||||
|
||||
import {ref, reactive, onMounted, watch} from 'vue'
|
||||
import OrgSelect from '/@/views/iotsync/components/OrgSelect.vue'
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import NuBaseInfoSyncList from '/@/views/synchronization/nuBaseInfo/NuBaseInfoSyncList.vue'
|
||||
|
||||
// >>>>>>>>>>>>>组件:无需处理代码
|
||||
const { createMessage } = useMessage();
|
||||
const syncComRef = ref(null)
|
||||
const sourceOrgCode = import.meta.env.VITE_SYTJGBM
|
||||
const orgSelectComRef = ref(null);
|
||||
const baseSyncModalRef = ref();
|
||||
|
||||
const orgData = ref();
|
||||
const showDevices = ref(false);
|
||||
const labelCol = reactive({
|
||||
xs: 24,
|
||||
sm: 4,
|
||||
xl: 6,
|
||||
xxl: 5
|
||||
xs: 24,
|
||||
sm: 4,
|
||||
xl: 6,
|
||||
xxl: 5
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
});
|
||||
const testOrgInfo = ref({})
|
||||
// <<<<<<<<<<<<<组件:无需处理代码
|
||||
|
||||
|
||||
// >>>>>>>>>>>>>需要处理代码
|
||||
const listComRef = ref();
|
||||
const initialDataIds = ref<string[]>([]);//已到机构运营时候后,会记录初始化数据(业务系统已分配数据)
|
||||
const selectedItems = ref(new Map<string | number, any>());//已选择数据
|
||||
const queryParam = ref({ viewType: 'all' })//源数据查询参数
|
||||
const showVideoModal = ref(false);
|
||||
const videoUrl = ref('');
|
||||
|
||||
// 计算当前是否存在搜索条件
|
||||
const hasSearchConditions = computed(() => {
|
||||
return Object.keys(queryParam.value).some(key =>
|
||||
key !== 'viewType' && queryParam.value[key] !== undefined && queryParam.value[key] !== ''
|
||||
);
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
});
|
||||
/**
|
||||
* 机构变更
|
||||
*/
|
||||
const orgChanged = async (org) => {
|
||||
// 清空当前选择
|
||||
selectedItems.value.clear();
|
||||
// 清空初始化数据
|
||||
initialDataIds.value = [];
|
||||
try {
|
||||
// 加载新机构数据
|
||||
const res = await listByOrgCode({ dataSourceCode: org.orgCode, pageNo: 1, pageSize: -1 });
|
||||
// 如果有数据,更新右侧列表
|
||||
if (res.records && res.records.length > 0) {
|
||||
const newRecords = res.records;
|
||||
newRecords.forEach(record => {
|
||||
selectedItems.value.set(record.id, record);
|
||||
if (!syncComRef?.value?.orgData?.operationStartTime || new Date() >= new Date(syncComRef?.value?.orgData?.operationStartTime)) {
|
||||
initialDataIds.value.push(record.id);
|
||||
}
|
||||
});
|
||||
|
||||
// 更新左侧列表的选中状态
|
||||
listComRef.value?.updateSelection?.(newRecords);
|
||||
} else {
|
||||
// 没有数据时也确保清空
|
||||
selectedItems.value.clear();
|
||||
listComRef.value?.updateSelection?.([]);
|
||||
}
|
||||
|
||||
// 切换视图
|
||||
syncComRef?.value?.resetOrgSelectedCon(false);
|
||||
|
||||
} catch (err) {
|
||||
createMessage.error('机构数据查询失败');
|
||||
// 失败时也确保清空状态
|
||||
selectedItems.value.clear();
|
||||
listComRef.value?.updateSelection?.([]);
|
||||
}
|
||||
orgData.value = org;
|
||||
// 切换视图
|
||||
orgSelectComRef?.value?.resetOrgSelectedCon(false);
|
||||
showDevices.value = true;
|
||||
baseSyncModalRef.value.init(org);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* 机构重新选择
|
||||
*/
|
||||
function searchQuery() {
|
||||
listComRef.value.reload();
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
* 子组件代码会自动触发reload方法:
|
||||
* watch(() => props.queryParams, (newParams) => {
|
||||
reload();
|
||||
}, { deep: true });
|
||||
*/
|
||||
function searchReset() {
|
||||
let vt = queryParam.value.viewType
|
||||
queryParam.value = { viewType: vt }
|
||||
const orgReset = async (org) => {
|
||||
showDevices.value = false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 源数据的全部、已选择、未选择变更时触发
|
||||
* @param v_ all、selected、unselected
|
||||
*/
|
||||
const viewTypeChanged = (v_) => {
|
||||
queryParam.value.viewType = v_
|
||||
//组件内部监听了queryParam值的变化,自动刷新
|
||||
}
|
||||
const handleSelectChange = (items: Map<string | number, any>) => {
|
||||
selectedItems.value = new Map(items);
|
||||
};
|
||||
|
||||
const handleRemoveFromRight = (key: string | number) => {
|
||||
selectedItems.value.delete(key);
|
||||
listComRef.value?.removeSelectedItem?.(key);
|
||||
};
|
||||
|
||||
const openVideoModal = (url: string) => {
|
||||
videoUrl.value = getFileAccessHttpUrl(url);
|
||||
showVideoModal.value = true;
|
||||
};
|
||||
|
||||
const closeVideoModal = () => {
|
||||
showVideoModal.value = false;
|
||||
videoUrl.value = '';
|
||||
};
|
||||
|
||||
//刷新数据
|
||||
const handleReload = () => {
|
||||
listComRef?.value?.reload();
|
||||
orgChanged(syncComRef?.value?.orgData)
|
||||
}
|
||||
|
||||
// 同步数据
|
||||
const handleAsync = async () => {
|
||||
await asyncFunc({ orgCode: syncComRef?.value?.orgData?.orgCode });
|
||||
//刷新历史数据
|
||||
syncComRef?.value?.refreshHistory()
|
||||
createMessage.success("同步结果请在同步历史中查看!");
|
||||
};
|
||||
//新增
|
||||
const handleAdd = () => {
|
||||
listComRef.value.handleAdd();
|
||||
}
|
||||
|
||||
//批量新增
|
||||
const handleBatchAdd = () => {
|
||||
listComRef.value.handleBatchAdd();
|
||||
}
|
||||
|
||||
// 全部移除
|
||||
const handleRemoveAll = () => {
|
||||
listComRef?.value?.batchHandleDelete()
|
||||
}
|
||||
// <<<<<<<<<<<<<需要处理代码
|
||||
|
||||
onBeforeMount(() => {
|
||||
getOrgInfo({ orgCode: import.meta.env.VITE_SYTJGBM }).then(res => {
|
||||
testOrgInfo.value = res
|
||||
})
|
||||
})
|
||||
</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%;
|
||||
}
|
||||
.container {
|
||||
max-width: 100% !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.selected-list-container {
|
||||
:deep(.ant-table) {
|
||||
width: 100% !important;
|
||||
max-width: 100%;
|
||||
}
|
||||
.ant-form-item{
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
.base-class {
|
||||
:deep(.ant-card .ant-card-body) {
|
||||
padding-top: 10px !important;
|
||||
padding-bottom: 10px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ export function useBasicFormSchema() {
|
|||
// rules: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: '请填写护理单元长者入住应缴金额',
|
||||
// message: '请填写区域长者入住应缴金额',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
const hldyUtilsListModal = ref();
|
||||
const departInfo = ref<any>({});
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
//护理单元回调
|
||||
//区域回调
|
||||
function hldyCallback(record) {
|
||||
console.log("🚀 ~ hldyCallback ~ record:", record)
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<BasicTable @register="registerTable" >
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
护理单元
|
||||
区域
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
|
|
|
|||
Loading…
Reference in New Issue