Compare commits
No commits in common. "d98ddb40461a6bedf2905a340d592d1a8f2d125a" and "9c697ef8af4e96623358f77fd88518dc3b924777" have entirely different histories.
d98ddb4046
...
9c697ef8af
|
@ -18,7 +18,7 @@
|
||||||
<span v-if="hasSearchConditions" style="font-size: 16px;font-weight: bold;color:#E86A6A">
|
<span v-if="hasSearchConditions" style="font-size: 16px;font-weight: bold;color:#E86A6A">
|
||||||
有筛选条件未重置
|
有筛选条件未重置
|
||||||
</span>
|
</span>
|
||||||
<span style="font-size: 16px;font-weight: bold;color:#ABACAD">{{ topTipText }}</span>
|
<span style="font-size: 16px;font-weight: bold;color:#ABACAD">点击展开更多操作区域</span>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<div class="org-info-card" v-show="(!toggleSearchStatus && orgSelectedCon) || toggleSearchStatus">
|
<div class="org-info-card" v-show="(!toggleSearchStatus && orgSelectedCon) || toggleSearchStatus">
|
||||||
|
@ -124,21 +124,21 @@
|
||||||
<a-card>
|
<a-card>
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="sourceScreenSpan">
|
<a-col :span="sourceScreenSpan">
|
||||||
<div style="height: 16px;" :style="{ marginLeft: leftTableML }">
|
<div style="height: 16px;margin-left: 15px;">
|
||||||
<a-tag color="#2DB7F5">{{ leftListTipText }}</a-tag>
|
<a-tag color="#2DB7F5">源数据</a-tag>
|
||||||
<a-radio-group v-show="showSelectedArea" v-model:value="viewType" size="small"
|
<a-radio-group v-model:value="viewType" size="small" style="margin-left: 10px;"
|
||||||
style="margin-left: 10px;" @change="emit('viewTypeChanged', viewType)">
|
@change="emit('viewTypeChanged', viewType)">
|
||||||
<a-radio-button value="all">全部</a-radio-button>
|
<a-radio-button value="all">全部</a-radio-button>
|
||||||
<a-radio-button value="selected">已选择</a-radio-button>
|
<a-radio-button value="selected">已选择</a-radio-button>
|
||||||
<a-radio-button value="unselected">未选择</a-radio-button>
|
<a-radio-button value="unselected">未选择</a-radio-button>
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</div>
|
</div>
|
||||||
<slot name="sourceTableSlot"></slot>
|
<slot name="sourceTableSlot"></slot>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="selectedScreenSpan">
|
<a-col :span="selectedScreenSpan">
|
||||||
<div style="height: 31px;" :style="{ marginLeft: rightTableML }">
|
<div style="height: 31px;margin-left: 4px;">
|
||||||
<a-tag color="#2db7f5">
|
<a-tag color="#2db7f5">
|
||||||
{{ rightListTipText }}
|
已选择
|
||||||
<span style="font-size: 13px;font-weight: bold;">
|
<span style="font-size: 13px;font-weight: bold;">
|
||||||
{{ ' ' + selectedSize + ' ' }}
|
{{ ' ' + selectedSize + ' ' }}
|
||||||
</span>条
|
</span>条
|
||||||
|
@ -152,8 +152,7 @@
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
<a-tab-pane key="asyncHistory" tab="同步历史">
|
<a-tab-pane key="asyncHistory" tab="同步历史">
|
||||||
<AsyncListComponent ref="asyncHistoryRef" :type="syncType" :orgCode="orgData.orgCode">
|
<AsyncListComponent ref="asyncHistoryRef" :orgCode="orgData.orgCode"></AsyncListComponent>
|
||||||
</AsyncListComponent>
|
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
</a-tabs>
|
</a-tabs>
|
||||||
<div class="toggle-button-container">
|
<div class="toggle-button-container">
|
||||||
|
@ -163,39 +162,20 @@
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button type="warning" size="small" @click.stop="handleAsync()"
|
<a-button type="warning" size="small" @click.stop="handleAsync()"
|
||||||
style="margin-left: 5px;margin-right: 5px;" v-show="tabActiveKey == 'dataAsync'">
|
style="margin-left: 5px;margin-right: 5px;" v-show="tabActiveKey == 'dataAsync'">
|
||||||
<span>{{ syncTipText }}</span>
|
<span>同步数据</span>
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-divider type="vertical" style="background-color: #CDCDCF" />
|
<a-divider type="vertical" style="background-color: #CDCDCF" />
|
||||||
<a-button type="primary" size="small" @click="handleAdd"
|
<a-button type="primary" size="small" @click="handleSelectAll" v-show="tabActiveKey == 'dataAsync'"
|
||||||
v-show="showAddBtn && tabActiveKey == 'dataAsync'" style="margin-left: 8px">新增</a-button>
|
style="margin-left: 8px">全部添加</a-button>
|
||||||
<a-divider type="vertical" style="background-color: #CDCDCF"
|
<a-divider type="vertical" style="background-color: #CDCDCF" v-show="tabActiveKey == 'dataAsync'" />
|
||||||
v-show="showAddBtn && tabActiveKey == 'dataAsync'" />
|
<a-button type="primary" size="small" @click="handleRemoveAll" v-show="tabActiveKey == 'dataAsync'"
|
||||||
<a-button type="primary" size="small" @click="handleBatchAdd"
|
style="margin-left: 8px">全部移除</a-button>
|
||||||
v-show="showBatchAddBtn && tabActiveKey == 'dataAsync'" style="margin-left: 8px">批量新增</a-button>
|
<a-divider type="vertical" style="background-color: #CDCDCF" v-show="tabActiveKey == 'dataAsync'" />
|
||||||
<a-divider type="vertical" style="background-color: #CDCDCF"
|
|
||||||
v-show="showBatchAddBtn && tabActiveKey == 'dataAsync'" />
|
|
||||||
<a-button type="primary" size="small" @click="handleSelectAll"
|
|
||||||
v-show="showAddAllBtn && tabActiveKey == 'dataAsync'" style="margin-left: 8px">全部添加</a-button>
|
|
||||||
<a-divider type="vertical" style="background-color: #CDCDCF"
|
|
||||||
v-show="showAddAllBtn && tabActiveKey == 'dataAsync'" />
|
|
||||||
<a-button type="primary" size="small" @click="handleRemoveAll"
|
|
||||||
v-show="showRemoveAllBtn && tabActiveKey == 'dataAsync'" style="margin-left: 8px">{{
|
|
||||||
batchRemoveText
|
|
||||||
}}</a-button>
|
|
||||||
<a-divider type="vertical" style="background-color: #CDCDCF"
|
|
||||||
v-show="showRemoveAllBtn && tabActiveKey == 'dataAsync'" />
|
|
||||||
<a-button type="primary" size="small" @click.stop="handleRestore"
|
<a-button type="primary" size="small" @click.stop="handleRestore"
|
||||||
v-show="showResetDataBtn && tabActiveKey == 'dataAsync'" style="margin-left: 8px">
|
v-show="tabActiveKey == 'dataAsync'" style="margin-left: 8px">
|
||||||
<span>还原数据</span>
|
<span>还原数据</span>
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-divider type="vertical" style="background-color: #CDCDCF"
|
<a-divider type="vertical" style="background-color: #CDCDCF" v-show="tabActiveKey == 'dataAsync'" />
|
||||||
v-show="showResetDataBtn && tabActiveKey == 'dataAsync'" />
|
|
||||||
<a-button type="primary" size="small" @click.stop="handleReload"
|
|
||||||
v-show="showReloadBtn && tabActiveKey == 'dataAsync'" style="margin-left: 8px">
|
|
||||||
<span>刷新</span>
|
|
||||||
</a-button>
|
|
||||||
<a-divider type="vertical" style="background-color: #CDCDCF"
|
|
||||||
v-show="showReloadBtn && tabActiveKey == 'dataAsync'" />
|
|
||||||
<a-radio-group v-model:value="splitVal" button-style="solid" size="small"
|
<a-radio-group v-model:value="splitVal" button-style="solid" size="small"
|
||||||
@change="splitScreenChanged" style="margin-left: 5px;margin-right: 5px;"
|
@change="splitScreenChanged" style="margin-left: 5px;margin-right: 5px;"
|
||||||
v-show="tabActiveKey == 'dataAsync'">
|
v-show="tabActiveKey == 'dataAsync'">
|
||||||
|
@ -238,66 +218,8 @@ import AsyncListComponent from '@/components/dataAsync/AsyncMainList.vue'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
selectedSize: 0,
|
selectedSize: 0,
|
||||||
hasSearchConditions: false,
|
hasSearchConditions: false,
|
||||||
syncType: '',//服务指令:'directive'
|
|
||||||
platType: '',//只查询对应机构类型的机构 业务机构:ywjg 试验机构:syjg
|
|
||||||
topTipText: {
|
|
||||||
type: String,
|
|
||||||
default: '点击展开更多操作区域'
|
|
||||||
},//机构信息卡片收起时提示文字
|
|
||||||
showSelectedArea: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},//是否展示全部、已选择、未选择区域
|
|
||||||
syncTipText: {
|
|
||||||
type: String,
|
|
||||||
default: '同步数据'
|
|
||||||
},//同步数据按钮文字
|
|
||||||
leftListTipText: {
|
|
||||||
type: String,
|
|
||||||
default: '源数据'
|
|
||||||
},//左侧列表提示文字
|
|
||||||
rightListTipText: {
|
|
||||||
type: String,
|
|
||||||
default: '已选择'
|
|
||||||
},//右侧列表提示文字
|
|
||||||
leftTableML: {
|
|
||||||
type: String,
|
|
||||||
default: '15px'
|
|
||||||
},//左侧列表提示文字margin-left
|
|
||||||
rightTableML: {
|
|
||||||
type: String,
|
|
||||||
default: '4px'
|
|
||||||
},//右侧列表提示文字margin-left
|
|
||||||
showAddBtn: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},//是否展示新增
|
|
||||||
showBatchAddBtn: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},//是否展示批量新增
|
|
||||||
showAddAllBtn: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},//是否展示全部添加
|
|
||||||
showRemoveAllBtn: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},//是否展示全部移除
|
|
||||||
showResetDataBtn: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},//是否展示还原数据
|
|
||||||
showReloadBtn: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},//是否展示刷新数据按钮(非历史数据)
|
|
||||||
batchRemoveText: {
|
|
||||||
type: String,
|
|
||||||
default: '全部移除'
|
|
||||||
},//全部移除按钮对应文字
|
|
||||||
});
|
});
|
||||||
const emit = defineEmits(['viewTypeChanged', 'orgChanged', 'handleAsync', 'handleAdd', 'handleBatchAdd', 'handleReload', 'handleAddAll', 'handleRemoveAll']);
|
const emit = defineEmits(['viewTypeChanged', 'orgChanged', 'handleAsync', 'handleAddAll', 'handleRemoveAll']);
|
||||||
|
|
||||||
interface OrganizationData {
|
interface OrganizationData {
|
||||||
id?: string;
|
id?: string;
|
||||||
|
@ -410,23 +332,6 @@ const refreshHistory = () => {
|
||||||
//源数据查询参数
|
//源数据查询参数
|
||||||
const viewType = ref('all')
|
const viewType = ref('all')
|
||||||
|
|
||||||
// 新增功能
|
|
||||||
const handleAdd = async () => {
|
|
||||||
if (!orgData.value) {
|
|
||||||
createMessage.warning("请先选择机构");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
emit('handleAdd', null)
|
|
||||||
};
|
|
||||||
// 批量新增功能
|
|
||||||
const handleBatchAdd = async () => {
|
|
||||||
if (!orgData.value) {
|
|
||||||
createMessage.warning("请先选择机构");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
emit('handleBatchAdd', null)
|
|
||||||
};
|
|
||||||
|
|
||||||
// 全部选择功能
|
// 全部选择功能
|
||||||
const handleSelectAll = async () => {
|
const handleSelectAll = async () => {
|
||||||
if (!orgData.value) {
|
if (!orgData.value) {
|
||||||
|
@ -436,7 +341,6 @@ const handleSelectAll = async () => {
|
||||||
emit('handleAddAll', null)
|
emit('handleAddAll', null)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// 全部移除功能
|
// 全部移除功能
|
||||||
const handleRemoveAll = () => {
|
const handleRemoveAll = () => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
|
@ -475,21 +379,12 @@ const handleRestore = async () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
//刷新数据(非历史)
|
|
||||||
const handleReload = () => {
|
|
||||||
emit('handleReload', null)
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (!props.platType) {
|
queryDepartTreeSync({ platType: 'ywjg' }).then(res => {
|
||||||
queryDepartTreeSync().then(res => {
|
orgTable.value = res;
|
||||||
orgTable.value = res;
|
});
|
||||||
});
|
|
||||||
} else {
|
|
||||||
queryDepartTreeSync({ platType: props.platType }).then(res => {
|
|
||||||
orgTable.value = res;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
|
|
@ -1,568 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="p-2 base-class">
|
|
||||||
<a-card @click="toggleSearchStatus = true" :class="{ 'base-con-class': toggleSearchStatus == false }">
|
|
||||||
<a-row v-show="!toggleSearchStatus && !orgSelectedCon">
|
|
||||||
<a-col :span="10">
|
|
||||||
<span style="font-size: 15px;font-weight: bold;color: #333;">机构信息:</span>
|
|
||||||
<span v-if="!orgData" class="base-info-dn" style="color: red;"> 请先选择机构</span>
|
|
||||||
<template v-else>
|
|
||||||
<span class="base-info-dn"
|
|
||||||
style="margin-left: 10px;font-size: 15px;font-weight: 400;color: #333;"> {{
|
|
||||||
orgData?.departName }}</span>
|
|
||||||
<a-button type="primary" size="small" @click.stop="handleResetOrg" style="margin-left: 10px;">
|
|
||||||
<span class="base-info-dn">重新选择</span>
|
|
||||||
</a-button>
|
|
||||||
</template>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="5">
|
|
||||||
<span style="font-size: 16px;font-weight: bold;color:#ABACAD">点击查看机构详情</span>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
<div class="org-info-card" v-show="(!toggleSearchStatus && orgSelectedCon) || toggleSearchStatus">
|
|
||||||
<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>
|
|
||||||
</div>
|
|
||||||
<a-button v-if="!orgSelectedCon" class="reset-btn" type="primary" @click.stop="handleResetOrg">
|
|
||||||
<span>重新选择</span>
|
|
||||||
</a-button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="org-info-content">
|
|
||||||
<div class="info-row">
|
|
||||||
<div class="info-item">
|
|
||||||
<span class="label">机构编码:</span>
|
|
||||||
<span class="value">{{ orgData?.orgCode || '-' }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-item">
|
|
||||||
<span class="label">运营时间:</span>
|
|
||||||
<span class="value">
|
|
||||||
{{ orgData?.operationStartTime?.substring(0, 10) || '-' }} 至
|
|
||||||
{{ orgData?.operationEndTime?.substring(0, 10) || '-' }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-item">
|
|
||||||
<span class="label">合同时间:</span>
|
|
||||||
<span class="value">
|
|
||||||
{{ orgData?.contractStartTime?.substring(0, 10) || '-' }} 至
|
|
||||||
{{ orgData?.contractEndTime?.substring(0, 10) || '-' }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="info-row">
|
|
||||||
<div class="info-item">
|
|
||||||
<span class="label">电话:</span>
|
|
||||||
<span class="value">{{ orgData?.mobile || '-' }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-item">
|
|
||||||
<span class="label">传真:</span>
|
|
||||||
<span class="value">{{ orgData?.fax || '-' }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-item">
|
|
||||||
<span class="label">地址:</span>
|
|
||||||
<span class="value">{{ orgData?.address || '-' }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<a-divider v-show="toggleSearchStatus && orgData && !orgSelectedCon" style="margin: 0px;margin-top: 8px;" />
|
|
||||||
<a-col :span="24" v-show="toggleSearchStatus && orgData && !orgSelectedCon">
|
|
||||||
<div class="jeecg-basic-table-form-container">
|
|
||||||
<slot name="searchFormSlot"></slot>
|
|
||||||
</div>
|
|
||||||
</a-col>
|
|
||||||
</a-card>
|
|
||||||
</div>
|
|
||||||
<div class="p-2 con-class" style="margin-top: -10px;">
|
|
||||||
<a-card>
|
|
||||||
<a-card v-show="orgSelectedCon" :bordered="false" class="org-container">
|
|
||||||
<a-row :gutter="[16, 16]">
|
|
||||||
<a-col :span="8" v-for="org in orgTable" :key="org.id">
|
|
||||||
<div class="org-card" :class="{ 'active': org.id == orgData?.id }"
|
|
||||||
@click="handleOrgSelected(org)">
|
|
||||||
<div class="org-header">
|
|
||||||
<a-tag color="blue" v-if="org.id == orgData?.id">当前选择</a-tag>
|
|
||||||
<h3 class="org-title">{{ org.departName }}</h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a-descriptions size="default" :column="2" bordered>
|
|
||||||
<a-descriptions-item label="机构编码">{{ org.orgCode || '-' }}</a-descriptions-item>
|
|
||||||
<a-descriptions-item label="运营时间">
|
|
||||||
{{ org.operationStartTime?.substring(0, 10) || '-' }} 至
|
|
||||||
{{ org.operationEndTime?.substring(0, 10) || '-' }}
|
|
||||||
</a-descriptions-item>
|
|
||||||
<a-descriptions-item label="电话">
|
|
||||||
<div class="contact-line">
|
|
||||||
<span><phone-outlined /> {{ org.mobile || '-' }}</span>
|
|
||||||
</div>
|
|
||||||
</a-descriptions-item>
|
|
||||||
<a-descriptions-item label="传真">
|
|
||||||
<div class="contact-line">
|
|
||||||
<span><printer-outlined /> {{ org.fax || '-' }}</span>
|
|
||||||
</div>
|
|
||||||
</a-descriptions-item>
|
|
||||||
<a-descriptions-item label="地址">
|
|
||||||
<ellipsis :length="26" tooltip>{{ org.address || '-' }}</ellipsis>
|
|
||||||
</a-descriptions-item>
|
|
||||||
</a-descriptions>
|
|
||||||
</div>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
</a-card>
|
|
||||||
<a-card v-show="orgSelectedCon && (!orgTable || orgTable?.length == 0)">
|
|
||||||
<a-empty description="暂无数据" :image="simpleImage" />
|
|
||||||
</a-card>
|
|
||||||
<div class="tab-header-container" v-show="!orgSelectedCon">
|
|
||||||
<a-tabs v-model:activeKey="tabActiveKey" class="tabs-container">
|
|
||||||
<a-tab-pane key="dataAsync" tab="数据同步">
|
|
||||||
<a-card>
|
|
||||||
<a-row>
|
|
||||||
<a-col :span="24">
|
|
||||||
<slot name="tableSlot"></slot>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
</a-card>
|
|
||||||
</a-tab-pane>
|
|
||||||
<a-tab-pane key="asyncHistory" tab="同步历史">
|
|
||||||
<AsyncListComponent ref="asyncHistoryRef" :type="syncType" :orgCode="orgData.orgCode">
|
|
||||||
</AsyncListComponent>
|
|
||||||
</a-tab-pane>
|
|
||||||
</a-tabs>
|
|
||||||
<div class="toggle-button-container">
|
|
||||||
<a-button type="primary" size="small" @click.stop="refreshHistory()" style="margin-right: 10px;"
|
|
||||||
v-show="tabActiveKey == 'asyncHistory'">
|
|
||||||
<span>刷新</span>
|
|
||||||
</a-button>
|
|
||||||
<a-button type="warning" size="small" @click.stop="handleAsync()"
|
|
||||||
style="margin-left: 5px;margin-right: 5px;" v-show="showSyncBtn && tabActiveKey == 'dataAsync'">
|
|
||||||
<span>同步数据</span>
|
|
||||||
</a-button>
|
|
||||||
<a-divider type="vertical" style="background-color: #CDCDCF" v-show="tabActiveKey == 'dataAsync'" />
|
|
||||||
<a @click="toggleSearchStatus = !toggleSearchStatus" class="toggle-button"
|
|
||||||
style="margin-left: 5px;margin-right: 5px;">
|
|
||||||
{{ toggleSearchStatus ? '拉伸' : '压缩' }}
|
|
||||||
<Icon
|
|
||||||
:icon="toggleSearchStatus ? 'humbleicons:align-objects-top' : 'humbleicons:align-objects-bottom'" />
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a-card>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" name="synchronization-directive" setup>
|
|
||||||
import { ref, onMounted, computed, toRaw } from 'vue';
|
|
||||||
|
|
||||||
import { queryDepartTreeSync } from '/@/api/common/api';
|
|
||||||
import { Empty } from 'ant-design-vue';
|
|
||||||
import { Modal } from 'ant-design-vue';
|
|
||||||
import { useMessage } from "/@/hooks/web/useMessage";
|
|
||||||
import AsyncListComponent from '@/components/dataAsync/AsyncMainList.vue'
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
syncType: '',//护理单元'nuBaseInfo'
|
|
||||||
showSyncBtn: true,
|
|
||||||
});
|
|
||||||
const emit = defineEmits(['orgChanged', 'handleAsync']);
|
|
||||||
|
|
||||||
interface OrganizationData {
|
|
||||||
id?: string;
|
|
||||||
departName: string;
|
|
||||||
orgCode: string;
|
|
||||||
operationStartTime?: string;
|
|
||||||
operationEndTime?: string;
|
|
||||||
contractStartTime?: string;
|
|
||||||
contractEndTime?: string;
|
|
||||||
mobile?: string;
|
|
||||||
fax?: string;
|
|
||||||
address?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { createMessage } = useMessage();
|
|
||||||
const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE;
|
|
||||||
const toggleSearchStatus = ref<boolean>(true);
|
|
||||||
const sourceScreenSpan = ref(12);
|
|
||||||
const selectedScreenSpan = ref(12);
|
|
||||||
const orgTable = ref<OrganizationData[]>([]);
|
|
||||||
const orgData = ref<OrganizationData | null>(null);
|
|
||||||
const showVideoModal = ref(false);
|
|
||||||
const videoUrl = ref('');
|
|
||||||
const orgSelectedCon = ref(true)
|
|
||||||
const tabActiveKey = ref('dataAsync')
|
|
||||||
const asyncHistoryRef = ref(null)
|
|
||||||
|
|
||||||
const handleOrgSelected = async (org) => {
|
|
||||||
if (!!orgData.value && orgData.value.id != org.id) {
|
|
||||||
Modal.confirm({
|
|
||||||
title: '变更机构提醒',
|
|
||||||
content: '是否变更机构!',
|
|
||||||
okText: '确认',
|
|
||||||
cancelText: '取消',
|
|
||||||
onOk: async () => {
|
|
||||||
await loadOrgData(org);
|
|
||||||
refreshHistory()
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
await loadOrgData(org);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const loadOrgData = async (org) => {
|
|
||||||
// 更新机构数据
|
|
||||||
orgData.value = toRaw(org);
|
|
||||||
emit('orgChanged', org)
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
const handleResetOrg = () => {
|
|
||||||
orgSelectedCon.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
const resetOrgSelectedCon = (v_) => {
|
|
||||||
orgSelectedCon.value = v_
|
|
||||||
}
|
|
||||||
|
|
||||||
//数据同步
|
|
||||||
const handleAsync = () => {
|
|
||||||
Modal.confirm({
|
|
||||||
title: '数据同步',
|
|
||||||
content: '是否确认同步',
|
|
||||||
okText: '确认',
|
|
||||||
cancelText: '取消',
|
|
||||||
onOk: async () => {
|
|
||||||
// 通知父组件执行同步
|
|
||||||
emit('handleAsync', null);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
//刷新同步历史数据
|
|
||||||
const refreshHistory = () => {
|
|
||||||
asyncHistoryRef.value?.searchQuery()
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
queryDepartTreeSync({}).then(res => {
|
|
||||||
orgTable.value = res;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
defineExpose({
|
|
||||||
orgData,
|
|
||||||
resetOrgSelectedCon,
|
|
||||||
refreshHistory,
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
.base-con-class {
|
|
||||||
background: white;
|
|
||||||
border-radius: 8px;
|
|
||||||
cursor: pointer;
|
|
||||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
|
|
||||||
transform: translateY(-2px);
|
|
||||||
border: 1px solid rgba(0, 0, 0, 0.05);
|
|
||||||
}
|
|
||||||
|
|
||||||
.selected-list-container {
|
|
||||||
height: calc(100vh - 310px);
|
|
||||||
overflow: auto;
|
|
||||||
|
|
||||||
:deep(.ant-table) {
|
|
||||||
width: 100% !important;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 新增的机构卡片样式 */
|
|
||||||
.org-cards-container {
|
|
||||||
max-height: 75vh;
|
|
||||||
overflow-y: auto;
|
|
||||||
padding: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.org-card {
|
|
||||||
margin-bottom: 16px;
|
|
||||||
border-radius: 8px;
|
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
transform: translateY(-4px);
|
|
||||||
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
|
|
||||||
background: radial-gradient(circle at center, #c7e6ff 0%, #d4eeff 70%, #e4f0ff 100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.ant-card-head) {
|
|
||||||
border-bottom: 1px solid #f0f0f0;
|
|
||||||
padding: 0 16px;
|
|
||||||
min-height: 48px;
|
|
||||||
|
|
||||||
.ant-card-head-title {
|
|
||||||
padding: 12px 0;
|
|
||||||
font-weight: 500;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.org-info-item {
|
|
||||||
display: flex;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
font-size: 13px;
|
|
||||||
line-height: 1.4;
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.label {
|
|
||||||
font-weight: 500;
|
|
||||||
color: #666;
|
|
||||||
min-width: 70px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.value {
|
|
||||||
color: #333;
|
|
||||||
word-break: break-word;
|
|
||||||
flex: 1;
|
|
||||||
|
|
||||||
&.address-text {
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.selected {
|
|
||||||
position: relative;
|
|
||||||
border: 1px solid #1890ff;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
right: 8px;
|
|
||||||
bottom: 8px;
|
|
||||||
width: 24px;
|
|
||||||
height: 24px;
|
|
||||||
background: url("@/assets/icons/success.svg") no-repeat center;
|
|
||||||
background-size: contain;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-header-container {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tabs-container {
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
:deep(.ant-tabs-content) {
|
|
||||||
height: calc(100% - 40px); // 减去tab标题高度
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.toggle-button-container {
|
|
||||||
position: absolute;
|
|
||||||
right: 16px;
|
|
||||||
top: 8px;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toggle-button {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 4px;
|
|
||||||
color: rgba(0, 0, 0, 0.65);
|
|
||||||
transition: all 0.3s;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: #1890ff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.con-class {
|
|
||||||
:deep(.ant-card .ant-card-body) {
|
|
||||||
// padding-left: 10px !important;
|
|
||||||
// padding-right: 10px !important;
|
|
||||||
// padding-bottom: 0px !important;
|
|
||||||
// padding-bottom: 0px !important;
|
|
||||||
padding: 3px 10px 3px 10px !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.base-class {
|
|
||||||
:deep(.ant-card .ant-card-body) {
|
|
||||||
padding-top: 10px !important;
|
|
||||||
padding-bottom: 10px !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.con-class {
|
|
||||||
:deep(.css-dev-only-do-not-override-9m98ij .ant-table-wrapper .ant-table-pagination.ant-pagination) {
|
|
||||||
margin: 10px !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.org-info-card {
|
|
||||||
background: linear-gradient(135deg, #f8f9fa 0%, #d0eaff 100%);
|
|
||||||
border-radius: 8px;
|
|
||||||
padding: 8px;
|
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
|
|
||||||
border: 1px solid #e8e8e8;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
|
|
||||||
// &:hover {
|
|
||||||
// box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
|
|
||||||
// transform: translateY(-1px);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
.org-info-header {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
padding-bottom: 5px;
|
|
||||||
border-bottom: 1px solid #f0f0f0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.org-title {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.base-info-label {
|
|
||||||
font-weight: 600;
|
|
||||||
color: #595959;
|
|
||||||
font-size: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.org-name {
|
|
||||||
margin-left: 10px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #262626;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.reset-btn {
|
|
||||||
background-color: #1890ff;
|
|
||||||
border-color: #1890ff;
|
|
||||||
height: 32px;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-weight: 500;
|
|
||||||
|
|
||||||
// &:hover {
|
|
||||||
// background-color: #40a9ff;
|
|
||||||
// border-color: #40a9ff;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
.org-info-content {
|
|
||||||
.info-row {
|
|
||||||
display: flex;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.info-item {
|
|
||||||
flex: 1;
|
|
||||||
padding: 0 8px;
|
|
||||||
|
|
||||||
.label {
|
|
||||||
color: #8c8c8c;
|
|
||||||
font-size: 13px;
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.value {
|
|
||||||
color: #262626;
|
|
||||||
font-size: 13px;
|
|
||||||
word-break: break-all;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.org-container {
|
|
||||||
background: transparent;
|
|
||||||
|
|
||||||
.org-card {
|
|
||||||
padding: 16px;
|
|
||||||
border: 1px solid #f0f0f0;
|
|
||||||
border-radius: 4px;
|
|
||||||
transition: all 0.3s;
|
|
||||||
background: white;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
border-color: #1890ff;
|
|
||||||
box-shadow: 0 2px 12px rgba(24, 144, 255, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.active {
|
|
||||||
border: 1px solid #1890ff;
|
|
||||||
background: #f0f8ff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.org-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
|
|
||||||
.org-title {
|
|
||||||
margin: 0 0 0 8px;
|
|
||||||
font-size: 16px;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.contact-line {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
>span {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.anticon {
|
|
||||||
margin-right: 4px;
|
|
||||||
color: #8c8c8c;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.ant-descriptions) {
|
|
||||||
.ant-descriptions-item-label {
|
|
||||||
width: 80px;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 机构选取卡片各项值的容器padding
|
|
||||||
.org-card {
|
|
||||||
:deep(.ant-descriptions-item-content) {
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -52,8 +52,7 @@ import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './Asyn
|
||||||
import AsyncMainModal from './components/AsyncMainModal.vue'
|
import AsyncMainModal from './components/AsyncMainModal.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
orgCode: 'orgCode',
|
orgCode: 'orgCode'
|
||||||
type:'',
|
|
||||||
});
|
});
|
||||||
const queryParam = reactive<any>({});
|
const queryParam = reactive<any>({});
|
||||||
const registerModal = ref();
|
const registerModal = ref();
|
||||||
|
@ -68,7 +67,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
showTableSetting: false,
|
showTableSetting: false,
|
||||||
showActionColumn: false,
|
showActionColumn: false,
|
||||||
beforeFetch: async (params) => {
|
beforeFetch: async (params) => {
|
||||||
queryParam.type = props.type
|
queryParam.type = 'directive'
|
||||||
queryParam.orgCode = props.orgCode
|
queryParam.orgCode = props.orgCode
|
||||||
return Object.assign(params, queryParam);
|
return Object.assign(params, queryParam);
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<!--
|
<!--
|
||||||
platType:只查询对应机构类型的机构 业务机构:ywjg 试验机构:syjg
|
|
||||||
selectedSize:已选择条数
|
selectedSize:已选择条数
|
||||||
hasSearchConditions:是否存在搜索条件
|
hasSearchConditions:是否存在搜索条件
|
||||||
viewTypeChanged:源数据、全部、已选择、未选择变更时的钩子函数
|
viewTypeChanged:源数据、全部、已选择、未选择变更时的钩子函数
|
||||||
|
@ -9,8 +8,8 @@
|
||||||
handleAddAll:全部添加按钮
|
handleAddAll:全部添加按钮
|
||||||
handleRemoveAll:全部移除按钮
|
handleRemoveAll:全部移除按钮
|
||||||
-->
|
-->
|
||||||
<SyncComponent ref="syncComRef" :platType="'ywjg'" :syncType="'directive'" :selectedSize="Array.from(selectedItems.values()).length"
|
<SyncComponent ref="syncComRef" :selectedSize="Array.from(selectedItems.values()).length"
|
||||||
:hasSearchConditions="hasSearchConditions" :showReloadBtn="false" @viewTypeChanged="viewTypeChanged" @orgChanged="orgChanged"
|
:hasSearchConditions="hasSearchConditions" @viewTypeChanged="viewTypeChanged" @orgChanged="orgChanged"
|
||||||
@handleAsync="handleAsync" @handleAddAll="handleAddAll" @handleRemoveAll="handleRemoveAll">
|
@handleAsync="handleAsync" @handleAddAll="handleAddAll" @handleRemoveAll="handleRemoveAll">
|
||||||
<!-- 表单 -->
|
<!-- 表单 -->
|
||||||
<template #searchFormSlot>
|
<template #searchFormSlot>
|
||||||
|
@ -165,7 +164,7 @@ import { getOrgInfo } from '/@/api/common/api';
|
||||||
import { list, asyncFunc } from '@/views/services/serviceDirective/ConfigServiceDirective.api';
|
import { list, asyncFunc } from '@/views/services/serviceDirective/ConfigServiceDirective.api';
|
||||||
import ConfigServiceDirectiveList from '@/views/services/serviceDirective/ConfigServiceDirectiveList.vue'
|
import ConfigServiceDirectiveList from '@/views/services/serviceDirective/ConfigServiceDirectiveList.vue'
|
||||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils'
|
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils'
|
||||||
import { selectedColumns } from './directive.data';
|
import { selectedColumns } from './org.data';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,96 +0,0 @@
|
||||||
import { defHttp } from '/@/utils/http/axios';
|
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
|
||||||
const { createConfirm } = useMessage();
|
|
||||||
|
|
||||||
enum Api {
|
|
||||||
list = '/nuBaseInfo/nuBaseInfo/list',
|
|
||||||
save = '/nuBaseInfo/nuBaseInfo/add',
|
|
||||||
sync = '/nuBaseInfo/nuBaseInfo/sync',
|
|
||||||
batchAdd = '/nuBaseInfo/nuBaseInfo/batchAdd',
|
|
||||||
edit = '/nuBaseInfo/nuBaseInfo/edit',
|
|
||||||
deleteOne = '/nuBaseInfo/nuBaseInfo/delete',
|
|
||||||
deleteBatch = '/nuBaseInfo/nuBaseInfo/deleteBatch',
|
|
||||||
importExcel = '/nuBaseInfo/nuBaseInfo/importExcel',
|
|
||||||
exportXls = '/nuBaseInfo/nuBaseInfo/exportXls',
|
|
||||||
listByOrgCode = '/nuBaseInfo/nuBaseInfo/listByOrgCode',
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出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
|
|
||||||
*/
|
|
||||||
export const listByOrgCode = (params) => defHttp.get({ url: Api.listByOrgCode, params });
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存或者更新
|
|
||||||
* @param params
|
|
||||||
* @param isUpdate
|
|
||||||
*/
|
|
||||||
export const saveOrUpdate = (params, isUpdate) => {
|
|
||||||
let url = isUpdate ? Api.edit : Api.save;
|
|
||||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量新增
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const batchAdd = (params) => {
|
|
||||||
return defHttp.post({ url: Api.batchAdd, 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 orgCode机构编码
|
|
||||||
*/
|
|
||||||
export const asyncFunc = (params) => {
|
|
||||||
return defHttp.post({ url: Api.sync, params });
|
|
||||||
};
|
|
|
@ -1,65 +0,0 @@
|
||||||
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: 'nuName'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '护理单元编码',
|
|
||||||
align: "center",
|
|
||||||
dataIndex: 'nuId'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '区域标签',
|
|
||||||
align: "center",
|
|
||||||
dataIndex: 'areaFlag_dictText'
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// title: '使用状态',
|
|
||||||
// align: "center",
|
|
||||||
// dataIndex: 'status_dictText',
|
|
||||||
// width:100
|
|
||||||
// },
|
|
||||||
];
|
|
||||||
//已选择列表数据
|
|
||||||
export const selectedColumns: BasicColumn[] = [
|
|
||||||
{
|
|
||||||
title: '护理单元名称',
|
|
||||||
align: "center",
|
|
||||||
dataIndex: 'nuName'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '护理单元编码',
|
|
||||||
align: "center",
|
|
||||||
dataIndex: 'nuId'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '区域标签',
|
|
||||||
align: "center",
|
|
||||||
dataIndex: 'areaFlag_dictText'
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// title: '使用状态',
|
|
||||||
// align: "center",
|
|
||||||
// dataIndex: 'status_dictText'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// title: '操作',
|
|
||||||
// dataIndex: 'action',
|
|
||||||
// key: 'action',
|
|
||||||
// width: 60,
|
|
||||||
// fixed: 'right',
|
|
||||||
// },
|
|
||||||
];
|
|
||||||
// 高级查询数据
|
|
||||||
export const superQuerySchema = {
|
|
||||||
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',},
|
|
||||||
};
|
|
|
@ -1,289 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="p-2">
|
|
||||||
<!--引用表格-->
|
|
||||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
|
||||||
<!--插槽:table标题-->
|
|
||||||
<template #tableTitle>
|
|
||||||
<!-- <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-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 } from 'vue';
|
|
||||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
|
||||||
import { useListPage } from '/@/hooks/system/useListPage';
|
|
||||||
import { columns, superQuerySchema } from './NuBaseInfo.data';
|
|
||||||
import { list, deleteOne, batchDelete, listByOrgCode, batchAdd } 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({});
|
|
||||||
|
|
||||||
// 初始化numberValues
|
|
||||||
onMounted(async () => {
|
|
||||||
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;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
orgCode: '',
|
|
||||||
});
|
|
||||||
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,
|
|
||||||
canResize: false,
|
|
||||||
useSearchForm: false,
|
|
||||||
showIndexColumn: true,
|
|
||||||
showTableSetting: false,
|
|
||||||
pagination: false,
|
|
||||||
size: 'small',
|
|
||||||
actionColumn: {
|
|
||||||
width: 120,
|
|
||||||
fixed: 'right',
|
|
||||||
},
|
|
||||||
beforeFetch: async (params) => {
|
|
||||||
queryParam.izSync = '1'//查未同步数据
|
|
||||||
queryParam.orgCode = props.orgCode //查对应机构数据
|
|
||||||
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,
|
|
||||||
});
|
|
||||||
|
|
||||||
// 高级查询配置
|
|
||||||
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 getTableAction(record) {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: '编辑',
|
|
||||||
onClick: handleEdit.bind(null, record),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '移除',
|
|
||||||
popConfirm: {
|
|
||||||
title: '是否确认删除',
|
|
||||||
confirm: handleDelete.bind(null, record),
|
|
||||||
placement: 'topLeft',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 下拉操作栏
|
|
||||||
*/
|
|
||||||
function getDropDownAction(record) {
|
|
||||||
return [
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询
|
|
||||||
*/
|
|
||||||
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: props.orgCode,
|
|
||||||
batchAddList: arr
|
|
||||||
}).then(res => {
|
|
||||||
batchAddOpen.value = false
|
|
||||||
reload()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
defineExpose({
|
|
||||||
searchQuery,
|
|
||||||
batchHandleDelete,
|
|
||||||
handleAdd,
|
|
||||||
getDataSource,
|
|
||||||
handleBatchAdd,
|
|
||||||
reload,
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
</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%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.ant-table-title) {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,173 +0,0 @@
|
||||||
<template>
|
|
||||||
<a-spin :spinning="confirmLoading">
|
|
||||||
<JFormContainer :disabled="disabled">
|
|
||||||
<template #detail>
|
|
||||||
<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="护理单元名称自动生成" 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-input v-model:value="formData.nuId" placeholder="编码自动生成" allow-clear
|
|
||||||
:disabled="true"></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" placeholder="请选择区域标签ID"
|
|
||||||
allow-clear />
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<!-- <a-col :span="24">
|
|
||||||
<a-form-item label="使用状态 0未使用 1占用 2入住 3退住 4留床" v-bind="validateInfos.status" id="NuBaseInfoForm-status" name="status">
|
|
||||||
<j-dict-select-tag v-model:value="formData.status" dictCode="nu_status" placeholder="请选择使用状态 0未使用 1占用 2入住 3退住 4留床" allow-clear />
|
|
||||||
</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 JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
|
||||||
import { getValueType } from '/@/utils';
|
|
||||||
import { saveOrUpdate } from '../NuBaseInfo.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 },
|
|
||||||
orgCode: ''
|
|
||||||
});
|
|
||||||
const formRef = ref();
|
|
||||||
const useForm = Form.useForm;
|
|
||||||
const emit = defineEmits(['register', 'ok']);
|
|
||||||
const formData = reactive<Record<string, any>>({
|
|
||||||
id: '',
|
|
||||||
nuName: '',
|
|
||||||
nuId: '',
|
|
||||||
areaFlag: '',
|
|
||||||
status: '',
|
|
||||||
});
|
|
||||||
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(',');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!model.id) {
|
|
||||||
model.status = "0";
|
|
||||||
}
|
|
||||||
model.orgCode = props.orgCode
|
|
||||||
await saveOrUpdate(model, isUpdate.value)
|
|
||||||
.then((res) => {
|
|
||||||
if (res.success) {
|
|
||||||
createMessage.success("暂存成功!");
|
|
||||||
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>
|
|
|
@ -1,82 +0,0 @@
|
||||||
<template>
|
|
||||||
<j-modal :title="title" :width="width" :maxHeight="`200px`" :visible="visible" @ok="handleOk"
|
|
||||||
:okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" okText="保存" cancelText="关闭">
|
|
||||||
<NuBaseInfoForm ref="registerForm" @ok="submitCallback" :orgCode="orgCode" :formDisabled="disableSubmit"
|
|
||||||
:formBpm="false"></NuBaseInfoForm>
|
|
||||||
</j-modal>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { ref, nextTick, defineExpose } from 'vue';
|
|
||||||
import NuBaseInfoForm from './NuBaseInfoForm.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']);
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
orgCode: ''
|
|
||||||
});
|
|
||||||
/**
|
|
||||||
* 新增
|
|
||||||
*/
|
|
||||||
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>
|
|
|
@ -1,296 +0,0 @@
|
||||||
<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="'点击展开机构详情'"
|
|
||||||
: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>
|
|
||||||
|
|
||||||
<!-- 业务平台数据列表 -->
|
|
||||||
<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>
|
|
||||||
|
|
||||||
<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'
|
|
||||||
|
|
||||||
// >>>>>>>>>>>>>组件:无需处理代码
|
|
||||||
const { createMessage } = useMessage();
|
|
||||||
const syncComRef = ref(null)
|
|
||||||
const sourceOrgCode = import.meta.env.VITE_SYTJGBM
|
|
||||||
const labelCol = reactive({
|
|
||||||
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] !== ''
|
|
||||||
);
|
|
||||||
});
|
|
||||||
/**
|
|
||||||
* 机构变更
|
|
||||||
*/
|
|
||||||
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?.([]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询
|
|
||||||
*/
|
|
||||||
function searchQuery() {
|
|
||||||
listComRef.value.reload();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 重置
|
|
||||||
* 子组件代码会自动触发reload方法:
|
|
||||||
* watch(() => props.queryParams, (newParams) => {
|
|
||||||
reload();
|
|
||||||
}, { deep: true });
|
|
||||||
*/
|
|
||||||
function searchReset() {
|
|
||||||
let vt = queryParam.value.viewType
|
|
||||||
queryParam.value = { viewType: vt }
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 源数据的全部、已选择、未选择变更时触发
|
|
||||||
* @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%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.selected-list-container {
|
|
||||||
:deep(.ant-table) {
|
|
||||||
width: 100% !important;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
Loading…
Reference in New Issue