update
init
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<BasicDrawer v-bind="$attrs" :showFooter="false" @register="registerDrawer" destroyOnClose title="查看报告" :width="700" :maskClosable="true">
|
||||
<iframe style="width: 100%; height: 100%" :src="pdfUrl" />
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
|
||||
import { ref } from 'vue';
|
||||
const pdfUrl = ref('');
|
||||
const [registerDrawer, {}] = useDrawerInner(async (data) => {
|
||||
pdfUrl.value = data.url;
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="less"></style>
|
||||
@@ -0,0 +1,38 @@
|
||||
<template>
|
||||
<BasicDrawer v-bind="$attrs" :showFooter="false" @register="registerDrawer" destroyOnClose title="查看问卷详情" :width="700" :maskClosable="true">
|
||||
<a-descriptions v-if="Object.keys(descriptions).length > 0" title="HMS评估报告" bordered>
|
||||
<a-descriptions-item v-for="(item, k) in descriptions" :key="k" :label="k" :span="4">{{ item }}</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
<a-empty v-else style="margin-top: 150px" />
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
|
||||
import { getQsDetail, QsDetail } from '/@/views/archive/comprehensiveStatistics/comprehensiveStatistics.api';
|
||||
|
||||
const descriptions = ref({});
|
||||
//表单赋值
|
||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
||||
setDrawerProps({
|
||||
confirmLoading: false,
|
||||
showCancelBtn: !!data?.showFooter,
|
||||
showOkBtn: !!data?.showFooter,
|
||||
});
|
||||
descriptions.value = {};
|
||||
await getDetail(data.record);
|
||||
});
|
||||
async function getDetail(record: QsDetail) {
|
||||
try {
|
||||
const params = <QsDetail>{ logId: record.logId, realName: record.realName, time: record.saveDate };
|
||||
let res = await getQsDetail(params);
|
||||
if (res) {
|
||||
descriptions.value = res;
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less"></style>
|
||||
@@ -0,0 +1,38 @@
|
||||
<template>
|
||||
<BasicDrawer v-bind="$attrs" :showFooter="false" @register="registerDrawer" destroyOnClose title="查看问卷详情" :width="700" :maskClosable="true">
|
||||
<a-descriptions v-if="Object.keys(descriptions).length > 0" title="HMS评估报告" bordered>
|
||||
<a-descriptions-item v-for="(item, k) in descriptions" :key="k" :label="k" :span="4">{{ item }}</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
<a-empty v-else style="margin-top: 150px" />
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
|
||||
import { getQsDetail, QsDetail } from '/@/views/archive/psychologicalAssessmentStatistics/psychologicalAssessmentStatistics.api';
|
||||
|
||||
const descriptions = ref({});
|
||||
//表单赋值
|
||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
||||
setDrawerProps({
|
||||
confirmLoading: false,
|
||||
showCancelBtn: !!data?.showFooter,
|
||||
showOkBtn: !!data?.showFooter,
|
||||
});
|
||||
descriptions.value = {};
|
||||
await getDetail(data.record);
|
||||
});
|
||||
async function getDetail(record: QsDetail) {
|
||||
try {
|
||||
const params = <QsDetail>{ evaluationId: record?.id, realName: record.realName, time: record.saveDate };
|
||||
let res = await getQsDetail(params);
|
||||
if (res) {
|
||||
descriptions.value = res;
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less"></style>
|
||||
@@ -0,0 +1,17 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
export enum Api {
|
||||
list = '/archives/hmsEvaluation/allEvaluationResultPage',
|
||||
getQsDetail = '/archives/hmsEvaluation/getQsDetail',
|
||||
getQsDetail1 = '/archives/hmsEvaluationPhyStat/getQsDetail',
|
||||
exportPDF = '/archives/hmsEvaluation/getPdfFilePath',
|
||||
}
|
||||
export interface QsDetail {
|
||||
realName: string;
|
||||
time: string;
|
||||
logId: string;
|
||||
createTime?: string;
|
||||
userName?: string;
|
||||
}
|
||||
export const listApi = (params: any) => defHttp.get({ url: Api.list, params });
|
||||
export const getQsDetail = (params: QsDetail) => defHttp.get({ url: Api.getQsDetail, params });
|
||||
export const exportPDF = (params: any) => defHttp.get({ url: Api.exportPDF, params }, { isTransformResponse: false });
|
||||
@@ -0,0 +1,71 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { orgSearchInfo } from '/@/utils/orgSearchInfo';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
|
||||
//姓名 身份证号 性别 单位 部门 评估日期 评估类型 评估状态 错误提示 (操作框添加两个(查看问卷 查看报告))
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'realName',
|
||||
},
|
||||
{
|
||||
title: '身份证号',
|
||||
dataIndex: 'idCard',
|
||||
},
|
||||
{
|
||||
title: '性别',
|
||||
dataIndex: 'sex_dictText',
|
||||
width: 60,
|
||||
},
|
||||
{
|
||||
title: '单位',
|
||||
dataIndex: 'secondDepart',
|
||||
},
|
||||
{
|
||||
title: '部门',
|
||||
dataIndex: 'thirdDepart',
|
||||
},
|
||||
{
|
||||
title: '评估日期',
|
||||
dataIndex: 'saveDate',
|
||||
},
|
||||
{
|
||||
title: '评估类型',
|
||||
dataIndex: 'questionnairesType_dictText',
|
||||
},
|
||||
{
|
||||
title: '评估状态',
|
||||
dataIndex: 'generationStatus_dictText',
|
||||
},
|
||||
{
|
||||
title: '错误提示',
|
||||
dataIndex: 'exceptionCatch',
|
||||
width: 80,
|
||||
},
|
||||
];
|
||||
// 风险评估统计筛选条件 新加评估类型 评估状态 条件
|
||||
export const schema: FormSchema[] = [
|
||||
{
|
||||
label: '姓名',
|
||||
field: 'realName',
|
||||
component: 'Input',
|
||||
},
|
||||
...orgSearchInfo({ orgField: 'orgCode1', orgName: '单位', deptFiled: 'orgCode2', deptName: '部门' }),
|
||||
{
|
||||
label: '评估时间',
|
||||
field: 'saveDate',
|
||||
component: 'RangeDate',
|
||||
},
|
||||
{
|
||||
label: '评估状态',
|
||||
field: 'generationStatus',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: () => ({ dictCode: 'hms_gene_status' }),
|
||||
},
|
||||
{
|
||||
label: '评估类型',
|
||||
field: 'questionnairesType',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: () => ({ dictCode: 'evaluation_type' }),
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<div ref="innerRef">
|
||||
<BasicTable @register="registerTable">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<a-button
|
||||
v-if="column.dataIndex === 'exceptionCatch'"
|
||||
:disabled="!record.exceptionCatch"
|
||||
style="color: #1890ff"
|
||||
type="text"
|
||||
@click="look(record?.exceptionCatch)"
|
||||
>
|
||||
查看
|
||||
</a-button>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<QuestionDrawer @register="registerDrawer" />
|
||||
<question-drawer1 @register="registerDrawer1" />
|
||||
<a-modal v-model:visible="visible" title="错误提示" @ok="okButton">
|
||||
<div style="padding: 10px">
|
||||
<p>{{ info }}</p>
|
||||
</div>
|
||||
</a-modal>
|
||||
<!-- <pdf-drawer @register="registerPdfDrawer" :getContainer="innerRef" />-->
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { listApi, exportPDF } from '/@/views/archive/comprehensiveStatistics/comprehensiveStatistics.api';
|
||||
import { columns, schema } from '/@/views/archive/comprehensiveStatistics/comprehensiveStatistics.data';
|
||||
import { useDrawer } from '/@/components/Drawer';
|
||||
import QuestionDrawer from '/@/views/archive/comprehensiveStatistics/components/questionDrawer.vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
// import PdfDrawer from '/@/views/archive/comprehensiveStatistics/components/pdfDrawer.vue';
|
||||
import { ref } from 'vue';
|
||||
import QuestionDrawer1 from '/@/views/archive/comprehensiveStatistics/components/questionDrawer1.vue';
|
||||
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
const [registerDrawer1, { openDrawer: openDrawer1 }] = useDrawer();
|
||||
// const [registerPdfDrawer, { openDrawer: openPdfDrawer }] = useDrawer();
|
||||
const innerRef = ref();
|
||||
const visible = ref(false);
|
||||
const info = ref('');
|
||||
|
||||
function look(text) {
|
||||
info.value = text;
|
||||
visible.value = true;
|
||||
}
|
||||
|
||||
function okButton() {
|
||||
info.value = '';
|
||||
visible.value = false;
|
||||
}
|
||||
//注册table数据
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: '风险评估统计',
|
||||
api: listApi,
|
||||
columns,
|
||||
canResize: false,
|
||||
formConfig: {
|
||||
labelWidth: 120,
|
||||
schemas: schema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: false,
|
||||
fieldMapToTime: [['saveDate', ['startTime', 'endTime']]],
|
||||
actionColOptions: {
|
||||
style: {
|
||||
marginLeft: '120px',
|
||||
},
|
||||
},
|
||||
},
|
||||
actionColumn: {
|
||||
width: 180,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
function getTableAction(record: Recordable) {
|
||||
return [
|
||||
{
|
||||
label: '查看报告',
|
||||
onClick: checkReport.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '查看问卷',
|
||||
onClick: checkQuestion.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
async function checkReport(record: Recordable) {
|
||||
let url = record?.pdfUrl;
|
||||
if (url) {
|
||||
if (url.charAt(url.length - 1) === ',' || url.charAt(url.length - 1) === ',') {
|
||||
url = url.substring(0, url.length - 1);
|
||||
}
|
||||
window.open(getFileAccessHttpUrl(url));
|
||||
} else {
|
||||
message.warn('获取文件地址失败');
|
||||
}
|
||||
}
|
||||
function checkQuestion(record: Recordable) {
|
||||
if (record?.questionnairesType == 1) {
|
||||
openDrawer(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: false,
|
||||
});
|
||||
} else {
|
||||
openDrawer1(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
</script>
|
||||
<style scoped lang="less"></style>
|
||||
@@ -0,0 +1,18 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
export enum Api {
|
||||
left = '/health-archives/archives/hmsEvaluation/selectMedicalUniItemClassList',
|
||||
right = '/health-archives/archives/hmsEvaluation/selectMedicalUniItemByClassId',
|
||||
downloadUrl = '/archives/hmsEvaluation/reportDownload',
|
||||
}
|
||||
|
||||
export const getLeft = (params: any) => defHttp.get({ url: Api.left, params: params });
|
||||
export const getRight = (params: any) => defHttp.get({ url: Api.right, params: params });
|
||||
export const downloadPDF = (params: any) =>
|
||||
defHttp.get(
|
||||
{
|
||||
url: Api.downloadUrl,
|
||||
params: params,
|
||||
},
|
||||
{ isTransformResponse: false }
|
||||
);
|
||||
@@ -0,0 +1,300 @@
|
||||
<!--体检分析报告-->
|
||||
<template>
|
||||
<div class="analysisReport">
|
||||
<div class="left-menu">
|
||||
<div class="sub-tit tree-tit">检查类别</div>
|
||||
<div class="tree-box">
|
||||
<BasicTree
|
||||
ref="tree"
|
||||
v-model:selectedKeys="selectedKeys"
|
||||
:expanded-keys="expandedKeys"
|
||||
:tree-data="treeData"
|
||||
:fieldNames="fieldNames"
|
||||
@select="select"
|
||||
>
|
||||
<template #name="data"></template>
|
||||
</BasicTree>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="right-content">
|
||||
<div class="sub-tit content-tit">
|
||||
<div>{{ parentName ? (contentName ? parentName + '/' : parentName) : '' }}{{ contentName }} </div>
|
||||
<div class="report-info">
|
||||
<div style="margin-right: 10px" v-if="btnDisable">
|
||||
<span>报告最新年份:{{ reportData?.reportLastYear ? reportData?.reportLastYear : '--' }},</span>
|
||||
<span>生成时间:{{ reportData?.generateTime }}</span>
|
||||
</div>
|
||||
<a-button type="primary" preIcon="ant-design:sync-outlined" @click="getReportStatus">刷新报告信息</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:form-outlined" @click="reportGenerateFun" style="margin: 0 10px">生成报告</a-button>
|
||||
<a-button type="primary" :disabled="!btnDisable" preIcon="ant-design:download-outlined" @click="downloadFile">报告下载 </a-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="rightList.length == 0 && spinning == false" class="empty-con">
|
||||
<a-empty :image="Empty.PRESENTED_IMAGE_SIMPLE" />
|
||||
</div>
|
||||
<div class="spin-content">
|
||||
<a-spin tip="Loading..." :spinning="spinning" />
|
||||
</div>
|
||||
<div class="chart-list">
|
||||
<div class="chart-list-left">
|
||||
<template v-for="(item, i) in rightList" :key="i">
|
||||
<AnalysisContent v-if="i % 2 == 0" :item="item" :key="item" :isConclusion="isConclusion" />
|
||||
</template>
|
||||
</div>
|
||||
<div class="chart-list-right">
|
||||
<template v-for="(item, i) in rightList" :key="i">
|
||||
<AnalysisContent v-if="i % 2 != 0" :item="item" :key="item" :isConclusion="isConclusion" />
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { Empty, message } from 'ant-design-vue';
|
||||
import AnalysisContent from '/@/views/archive/employeeFile/components/analysisReport/components/analysisContent.vue';
|
||||
import { downloadPDF, getLeft, getRight } from '/@/views/archive/employeeFile/components/analysisReport/analysisReport.api';
|
||||
import { fieldNames, useContentName } from '/@/views/archive/employeeFile/components/analysisReport/analysisReportHooks';
|
||||
import { BasicTree } from '/@/components/Tree/index';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import { reportStatus, reportGenerate } from '/@/views/archive/employeeFile/employeeFileList.api';
|
||||
const route = useRoute();
|
||||
const treeData = ref([]);
|
||||
const rightList = ref([]);
|
||||
const expandedKeys = ref<string[]>([]);
|
||||
const selectedKeys = ref<string[]>();
|
||||
const isConclusion = ref(false); //判断是否为结论建议
|
||||
const { contentName, setContentName } = useContentName();
|
||||
const { contentName: parentName, setContentName: setParentName } = useContentName();
|
||||
const tree = ref();
|
||||
let btnDisable = ref(false);
|
||||
let reportData = ref();
|
||||
async function select(selectedKeys, e) {
|
||||
if (Array.isArray(e.node.childList) && e.node.childList.length > 0) {
|
||||
//判断当前项 是否在已经展开keys数组 如果不在则展开 否则关闭
|
||||
let index = expandedKeys.value.indexOf(e.node.id);
|
||||
if (index === -1) {
|
||||
expandedKeys.value.push(e.node.id);
|
||||
} else {
|
||||
expandedKeys.value = expandedKeys.value.filter((item) => item !== e.node.id);
|
||||
}
|
||||
} else {
|
||||
isConclusion.value = false;
|
||||
let { id, name, parentName } = e.node;
|
||||
setParentName(parentName);
|
||||
//第一层节点name不是string类型
|
||||
if (typeof name !== 'string') {
|
||||
name = name.el.innerText;
|
||||
}
|
||||
// 防止重复点击
|
||||
if (contentName.value == name) return;
|
||||
setContentName(name);
|
||||
// 选中结论建议
|
||||
if (id == '11') {
|
||||
isConclusion.value = true;
|
||||
await getRightData(id, true);
|
||||
return;
|
||||
}
|
||||
await getRightData(id);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getReportStatus();
|
||||
getMenu();
|
||||
});
|
||||
|
||||
async function getReportStatus() {
|
||||
try {
|
||||
spinning.value = true;
|
||||
let data = await reportStatus({ userId: route.query.id });
|
||||
console.log(data);
|
||||
reportData.value = data;
|
||||
btnDisable.value = data?.generateStatus == 2;
|
||||
spinning.value = false;
|
||||
} catch {
|
||||
spinning.value = false;
|
||||
}
|
||||
}
|
||||
async function reportGenerateFun() {
|
||||
try {
|
||||
spinning.value = true;
|
||||
await reportGenerate({ userId: route.query.id });
|
||||
spinning.value = false;
|
||||
} catch {
|
||||
spinning.value = false;
|
||||
}
|
||||
}
|
||||
async function getMenu() {
|
||||
try {
|
||||
let data = await getLeft({ sex: route.query.sex });
|
||||
treeData.value = data;
|
||||
if (Array.isArray(data) && data[0]) {
|
||||
const { id, name } = data[0]?.childList[0] || data[0];
|
||||
setContentName(name);
|
||||
// 第一个菜单没有子级
|
||||
if (!data[0]?.childList[0]?.name) {
|
||||
setContentName('');
|
||||
}
|
||||
// 默认展开一级选中第一个节点
|
||||
expandedKeys.value.push(data[0].id);
|
||||
parentName.value = data[0].name;
|
||||
selectedKeys.value = [id];
|
||||
await getRightData(id);
|
||||
} else {
|
||||
spinning.value = false;
|
||||
}
|
||||
} catch {
|
||||
rightList.value = [];
|
||||
spinning.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
const spinning = ref<boolean>(true);
|
||||
const changeSpinning = () => {
|
||||
spinning.value = !spinning.value;
|
||||
};
|
||||
|
||||
async function getRightData(id: string, isConclusion = false) {
|
||||
spinning.value = true;
|
||||
if (!id) {
|
||||
changeSpinning();
|
||||
console.error('该数据没有id');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
let res = await getRight({
|
||||
medicalUniItemClassId: id,
|
||||
isConclusion,
|
||||
userId: route.query.id,
|
||||
});
|
||||
setTimeout(() => {
|
||||
if (res && res.length > 0) {
|
||||
rightList.value = res;
|
||||
} else {
|
||||
rightList.value = [];
|
||||
}
|
||||
spinning.value = false;
|
||||
}, 1000);
|
||||
} catch {
|
||||
rightList.value = [];
|
||||
spinning.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function downloadFile() {
|
||||
const { code, result, message: info } = await downloadPDF({ userId: route.query.id });
|
||||
if (code !== 200) {
|
||||
return message.warn(info);
|
||||
}
|
||||
const url = getFileAccessHttpUrl(result);
|
||||
if (url) {
|
||||
window.open(url);
|
||||
} else {
|
||||
message.warn(info);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.analysisReport {
|
||||
width: 100%;
|
||||
height: calc(100% - 63px);
|
||||
display: flex;
|
||||
margin: 10px;
|
||||
background-color: #fff;
|
||||
|
||||
.sub-tit {
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.left-menu {
|
||||
min-width: 240px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-right: 1px solid #ccc;
|
||||
position: relative;
|
||||
overflow-y: hidden;
|
||||
.tree-tit {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
.tree-box {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
:deep(.ant-tree) {
|
||||
.ant-tree-node-content-wrapper.ant-tree-node-selected {
|
||||
background-color: #eaf3fc;
|
||||
color: #4095e5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right-content {
|
||||
flex: 1;
|
||||
margin: 0 16px 16px 16px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
.spin-content {
|
||||
position: absolute;
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
//border: 1px solid red;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
//background: #fff;
|
||||
//opacity: 0;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.content-tit {
|
||||
height: 45px;
|
||||
line-height: 45px;
|
||||
box-shadow: 0 2px 8px #f0f1f2;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.report-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.empty-con {
|
||||
height: 415px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-list {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
height: calc(100% - 35px);
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.chart-list-left {
|
||||
width: calc(50% - 10px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.chart-list-right {
|
||||
width: calc(50% - 10px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
+332
@@ -0,0 +1,332 @@
|
||||
<template>
|
||||
<div class="chart-item">
|
||||
<!--图表-->
|
||||
<div v-show="firstChild.type === '0'">
|
||||
<div class="chart-title">
|
||||
<div class="t1">{{ item?.peItemName }}</div>
|
||||
<div class="t2" v-show="showReference(firstChild?.printContext)">
|
||||
<span>参考值:</span>
|
||||
<span>
|
||||
<span style="color: #333">{{ firstChild?.printContext }}</span>
|
||||
<span>{{ firstChild?.unit }}</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-table">
|
||||
<div class="label-list">
|
||||
<div class="label-item">时间</div>
|
||||
<div class="label-item">数值</div>
|
||||
</div>
|
||||
<div class="value-list">
|
||||
<a-row class="value-data">
|
||||
<div class="value-data-inner" v-for="val in timeList" :key="val">
|
||||
{{ val ? val : '' }}
|
||||
</div>
|
||||
</a-row>
|
||||
<a-row class="value-data">
|
||||
<div class="value-data-inner" v-for="val in valueList" :key="val">
|
||||
{{ val ? val : '' }}
|
||||
</div>
|
||||
</a-row>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chart-box" ref="chartBox"></div>
|
||||
</div>
|
||||
<!--数值-短文本-->
|
||||
<!-- <div v-show="firstChild.type == '1'">-->
|
||||
<!-- <div class="chart-title">-->
|
||||
<!-- <div class="t1">{{ item?.peItemName }}</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="panel-table">-->
|
||||
<!-- <div class="label-list">-->
|
||||
<!-- <div class="label-item">时间</div>-->
|
||||
<!-- <div class="label-item">数值</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="value-list">-->
|
||||
<!-- <a-row class="value-data">-->
|
||||
<!-- <div-->
|
||||
<!-- class="value-data-inner"-->
|
||||
<!-- v-for="val in timeList"-->
|
||||
<!-- :key="val"-->
|
||||
<!-- style="width: 200px"-->
|
||||
<!-- v-html="val ? val.substring(0, 14) : ''"-->
|
||||
<!-- ></div>-->
|
||||
<!-- </a-row>-->
|
||||
<!-- <a-row class="value-data">-->
|
||||
<!-- <div-->
|
||||
<!-- class="value-data-inner"-->
|
||||
<!-- v-for="val in valueList"-->
|
||||
<!-- :key="val"-->
|
||||
<!-- style="width: 200px"-->
|
||||
<!-- v-html="val && val.length > 14 ? val.substring(0, 14) + '...' : val"-->
|
||||
<!-- >-->
|
||||
<!-- </div>-->
|
||||
<!-- </a-row>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!--数值-长文本-->
|
||||
<!-- <div v-show="firstChild.type == '2'">-->
|
||||
<!-- <div class="chart-title">-->
|
||||
<!-- <div class="t1">{{ item?.peItemName }}</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="panel-table">-->
|
||||
<!-- <div class="label-list">-->
|
||||
<!-- <div class="label-item">时间</div>-->
|
||||
<!-- <div class="label-item">数值</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="value-list">-->
|
||||
<!-- <a-row class="value-data">-->
|
||||
<!-- <a-tooltip v-for="val in timeList" :key="val">-->
|
||||
<!-- <template #title>{{ val }}</template>-->
|
||||
<!-- <div class="value-data-inner" style="width: 200px" v-html="val ? val.substring(0, 14) : ''"></div>-->
|
||||
<!-- </a-tooltip>-->
|
||||
<!-- </a-row>-->
|
||||
<!-- <a-row class="value-data">-->
|
||||
<!-- <a-tooltip v-for="val in valueList" :key="val">-->
|
||||
<!-- <template #title>{{ val }}</template>-->
|
||||
<!-- <div-->
|
||||
<!-- class="value-data-inner"-->
|
||||
<!-- style="width: 200px"-->
|
||||
<!-- v-html="val && val.length > 14 ? val.substring(0, 14) + '...' : val"-->
|
||||
<!-- ></div>-->
|
||||
<!-- </a-tooltip>-->
|
||||
<!-- </a-row>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<div v-if="firstChild.type == '2' || firstChild.type == '1'">
|
||||
<div class="chart-title">
|
||||
<div class="t1">{{ item?.peItemName }}</div>
|
||||
</div>
|
||||
<a-descriptions style="padding: 0 16px" layout="vertical" bordered :column="timeList.length + 1" size="small">
|
||||
<a-descriptions-item style="white-space: nowrap; width: 220px" class="ellipsis" label="时间">数值</a-descriptions-item>
|
||||
<a-descriptions-item style="width: 220px" class="ellipsis" v-for="(val, i) in timeList" :key="val" :label="val">
|
||||
<a-tooltip trigger="click" placement="topLeft">
|
||||
<template #title>{{ valueList[i] }}</template>
|
||||
{{ valueList[i] }}
|
||||
</a-tooltip>
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
</div>
|
||||
<!--文本-->
|
||||
<div v-show="isConclusion">
|
||||
<div class="desc-box">
|
||||
<a-descriptions :title="firstChild?.peYear" bordered>
|
||||
<a-descriptions-item label="结论" :span="3" :labelStyle="{ whiteSpace: 'nowrap', width: '70px' }">
|
||||
<div v-html="firstChild?.conclusion || ''"></div>
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="建议" :span="3" :labelStyle="{ whiteSpace: 'nowrap', width: '70px' }">
|
||||
<div v-html="firstChild?.suggest || ''"></div>
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import echarts from '/@/utils/lib/echarts';
|
||||
import { ref, unref, onMounted, nextTick, computed } from 'vue';
|
||||
import { chartOptions } from '/@/views/archive/employeeFile/components/analysisReport/analysisReportHooks';
|
||||
|
||||
const props = defineProps({
|
||||
item: {
|
||||
type: Object,
|
||||
},
|
||||
isConclusion: {
|
||||
type: Boolean,
|
||||
},
|
||||
});
|
||||
|
||||
const timeList = ref([]);
|
||||
const valueList = ref([]);
|
||||
const firstChild = ref({});
|
||||
const chartBox = ref();
|
||||
|
||||
const showReference = computed(() => showValue);
|
||||
|
||||
function showValue(val: string) {
|
||||
if (!val) {
|
||||
return false;
|
||||
}
|
||||
let result = '';
|
||||
for (let i = val.length - 1; i > 0; i--) {
|
||||
if (!isNaN(val[i]) || (val[i] === '.' && !result.includes('.'))) {
|
||||
result += val[i];
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
const count = parseFloat(result.split('').reverse().join(''));
|
||||
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
function initChart() {
|
||||
const myChart = echarts.init(chartBox.value);
|
||||
const options = chartOptions({
|
||||
timeList: JSON.parse(JSON.stringify(unref(timeList))),
|
||||
firstChild,
|
||||
valueList: JSON.parse(JSON.stringify(unref(valueList))),
|
||||
});
|
||||
myChart.setOption(options);
|
||||
window.addEventListener('resize', () => {
|
||||
myChart.resize();
|
||||
});
|
||||
}
|
||||
|
||||
function useMinWidth() {
|
||||
const minWidth = ref(120);
|
||||
const useWidth = ref(false);
|
||||
|
||||
function setMinWidth(width: number, fontSize = 14) {
|
||||
minWidth.value = width * fontSize;
|
||||
useWidth.value = true;
|
||||
}
|
||||
|
||||
return {
|
||||
useWidth,
|
||||
setMinWidth,
|
||||
minWidth,
|
||||
};
|
||||
}
|
||||
|
||||
const { useWidth, minWidth, setMinWidth } = useMinWidth();
|
||||
|
||||
function computedStyle() {
|
||||
return useWidth.value
|
||||
? {
|
||||
minWidth: minWidth.value + 'px',
|
||||
}
|
||||
: {};
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
timeList.value = props.item.list.map((item) => item.peYear);
|
||||
valueList.value = props.item.list.map((item) => item.peResult);
|
||||
const length = valueList.value.map((item) => (item && item.length) || 0);
|
||||
let max = Math.max(...length);
|
||||
if (max > 4) {
|
||||
setMinWidth(max, 14);
|
||||
}
|
||||
firstChild.value = props.item.list[0];
|
||||
nextTick(() => {
|
||||
initChart();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.chart-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border: 1px solid #f0f0f0;
|
||||
padding: 10px 0;
|
||||
|
||||
.chart-title {
|
||||
margin-left: 16px;
|
||||
|
||||
.t1 {
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
height: 26px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.t1:before {
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 15px;
|
||||
margin-right: 5px;
|
||||
border-radius: 2px;
|
||||
background-color: #1890ff;
|
||||
}
|
||||
|
||||
.t2 {
|
||||
margin: 4px 0;
|
||||
}
|
||||
}
|
||||
|
||||
.panel-table {
|
||||
display: flex;
|
||||
padding: 0 16px;
|
||||
overflow-y: hidden;
|
||||
|
||||
.label-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.label-item {
|
||||
min-width: 80px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
background-color: #f9f9f9;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
}
|
||||
|
||||
.value-list {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: hidden;
|
||||
|
||||
.value-data:first-child {
|
||||
.value-data-inner {
|
||||
border-top: 1px solid #f0f0f0;
|
||||
}
|
||||
}
|
||||
|
||||
.value-data {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
|
||||
.value-data-inner {
|
||||
min-width: 120px;
|
||||
padding: 0 5px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
border-right: 1px solid #f0f0f0;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.chart-box {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
min-height: 250px;
|
||||
//border: 1px solid red;
|
||||
}
|
||||
|
||||
// 文字描述
|
||||
.desc-box {
|
||||
padding: 0 16px;
|
||||
}
|
||||
:deep(.ellipsis) {
|
||||
width: fit-content;
|
||||
max-width: calc(100% / 9);
|
||||
span {
|
||||
min-height: 26px;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3; /* 定义文本的行数 */
|
||||
-webkit-box-orient: vertical;
|
||||
white-space: normal; /* 保证文本换行 */
|
||||
font-family: MyCustomFont, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif,
|
||||
'Apple Color Emoji', 'Segoe UI Emoji', Segoe UI Symbol, 'Noto Color Emoji';
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,681 @@
|
||||
import { FormSchema } from '/@/components/Form';
|
||||
import { getSecondaryDepartmentList, getThirdDepartmentList } from '/@/views/system/user/user.api';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { ColEx } from '/@/components/Form/src/types';
|
||||
import { checkPassword } from '/@/hooks/checkPassword/checkPassword';
|
||||
// 自适应列配置
|
||||
export const adaptiveColProps: Partial<ColEx> = {
|
||||
span: 6,
|
||||
xs: 12, // <576px
|
||||
sm: 12, // ≥576px
|
||||
md: 12, // ≥768px
|
||||
lg: 12, // ≥992px
|
||||
xl: 12, // ≥1200px
|
||||
xxl: 8, // ≥1600px
|
||||
};
|
||||
|
||||
export function getPopupContainer() {
|
||||
return document.body;
|
||||
}
|
||||
/**
|
||||
* @Description:form校验关系
|
||||
* @date `2023/8/17`
|
||||
*/
|
||||
export function checkRelation(_, value) {
|
||||
if (!value) {
|
||||
return Promise.reject('请选择与员工的关系');
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
/**
|
||||
* @Description:校验值重复的个数
|
||||
* @date 2023/8/17
|
||||
* @param val
|
||||
* @param list
|
||||
* @return 出现的个数
|
||||
*/
|
||||
export function repeatCount(val, list) {
|
||||
let i = 0;
|
||||
list.map((item) => {
|
||||
if (item == val && item !== '') {
|
||||
i++;
|
||||
}
|
||||
});
|
||||
return i;
|
||||
}
|
||||
export interface FormItem {
|
||||
name: string;
|
||||
phone: number | string;
|
||||
familyRelation: string;
|
||||
idCard: string;
|
||||
id?: string;
|
||||
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface TableState {
|
||||
data: FormItem[];
|
||||
selectedRowKeys: any[];
|
||||
}
|
||||
|
||||
type FunForm = (isUpdate: boolean) => FormSchema[];
|
||||
/**
|
||||
* @Description:基础信息
|
||||
* @date 2023/8/2
|
||||
* @param isUpdate
|
||||
*/
|
||||
// @ts-ignore
|
||||
export const formSchema: FunForm = (isUpdate = false) => [
|
||||
{
|
||||
label: '用户账号',
|
||||
field: 'username',
|
||||
component: 'Input',
|
||||
componentProps: ({ formModel }) => {
|
||||
return {
|
||||
onInput: () => {
|
||||
formModel.username = formModel.username.replace(/[^a-zA-Z0-9_]/g, '');
|
||||
},
|
||||
autocomplete: 'off',
|
||||
};
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '密码',
|
||||
field: 'password',
|
||||
component: 'StrengthMeter',
|
||||
componentProps: {
|
||||
// @ts-ignore
|
||||
autocomplete: 'new-password',
|
||||
},
|
||||
dynamicRules: () => {
|
||||
return [
|
||||
{
|
||||
required: true,
|
||||
validator: (_, value) => {
|
||||
let { message } = checkPassword(value);
|
||||
if (message === 'ok') {
|
||||
return Promise.resolve();
|
||||
} else {
|
||||
return Promise.reject(message);
|
||||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
},
|
||||
];
|
||||
},
|
||||
required: true,
|
||||
ifShow: isUpdate,
|
||||
},
|
||||
{
|
||||
label: '姓名',
|
||||
field: 'realname',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '性别',
|
||||
field: 'sex',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
// @ts-ignore
|
||||
dictCode: 'sex2',
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
|
||||
{
|
||||
label: '手机号码',
|
||||
field: 'phone',
|
||||
component: 'Input',
|
||||
componentProps: ({ formModel }) => {
|
||||
return {
|
||||
onInput: () => {
|
||||
formModel.phone = formModel.phone.replace(/[^0-9]/g, '');
|
||||
},
|
||||
};
|
||||
},
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
pattern: /^1[3456789][0-9]{9}$/,
|
||||
message: '${label}格式有误',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '身份证号',
|
||||
field: 'idCard',
|
||||
component: 'Input',
|
||||
componentProps: ({ formModel }) => {
|
||||
return {
|
||||
onInput: () => {
|
||||
formModel.idCard = formModel.idCard.replace(/[^Xx0-9]/g, '');
|
||||
},
|
||||
};
|
||||
},
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
pattern: /^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|[xX])$/,
|
||||
message: '${label}格式有误',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '邮箱',
|
||||
field: 'email',
|
||||
component: 'Input',
|
||||
rules: [
|
||||
{
|
||||
pattern: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
|
||||
message: '${label}格式有误',
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '编号',
|
||||
field: 'empSysno',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
componentProps: ({ formModel }) => {
|
||||
return {
|
||||
onInput: () => {
|
||||
formModel.empSysno = formModel.empSysno.replace(/[^0-9]/g, '');
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '单位',
|
||||
field: 'secondDepart',
|
||||
component: 'ApiSelect',
|
||||
required: true,
|
||||
componentProps: ({ formModel }) => {
|
||||
return {
|
||||
api: getSecondaryDepartmentList,
|
||||
resultField: 'result',
|
||||
labelField: 'departName',
|
||||
valueField: 'id',
|
||||
immediate: true,
|
||||
onChange: (_value) => {
|
||||
formModel.orgCode = '';
|
||||
},
|
||||
onDeselect: () => {
|
||||
formModel.secondDepart = '';
|
||||
formModel.orgCode = '';
|
||||
},
|
||||
getPopupContainer: () => document.body,
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '部门',
|
||||
field: 'orgCode',
|
||||
component: 'ApiSelect',
|
||||
required: true,
|
||||
componentProps: ({ formModel }) => {
|
||||
return {
|
||||
api: getThirdDepartmentList,
|
||||
resultField: 'list',
|
||||
labelField: 'departName',
|
||||
params: {
|
||||
secondDepartId: formModel?.secondDepart || '12313',
|
||||
},
|
||||
valueField: 'id',
|
||||
immediate: true,
|
||||
onFocus: () => {
|
||||
if (!formModel.secondDepart) {
|
||||
return message.warn('请先选择单位!');
|
||||
}
|
||||
},
|
||||
getPopupContainer: () => document.body,
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '职务',
|
||||
field: 'empJob',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
// @ts-ignore
|
||||
dictCode: 'e_job',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '职称',
|
||||
field: 'empTitle',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
// @ts-ignore
|
||||
dictCode: 'e_title',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '职位',
|
||||
field: 'empPosition',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
// @ts-ignore
|
||||
dictCode: 'emp_position',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '行政级别',
|
||||
field: 'empLevel',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
// @ts-ignore
|
||||
dictCode: 'emp_level',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '子组',
|
||||
field: 'empGroup',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
// @ts-ignore
|
||||
dictCode: 'emp_group',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '工作状态',
|
||||
field: 'empStatus',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
// @ts-ignore
|
||||
dictCode: 'emp_status',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '工种',
|
||||
field: 'medicalWorkTypeCode',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
// @ts-ignore
|
||||
dictCode: 'medical_worktype',
|
||||
showSearch: true,
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '体检形式',
|
||||
field: 'medicalOnJob',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
// @ts-ignore
|
||||
dictCode: 'medical_on_job',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '接害时间',
|
||||
field: 'medicalHazardDate',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
// @ts-ignore
|
||||
showTime: false,
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '危害因素',
|
||||
field: 'medicalHazardFactorCode',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
// @ts-ignore
|
||||
dictCode: 'medical_hazard',
|
||||
showSearch: true,
|
||||
mode: 'multiple',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '隐藏id',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
];
|
||||
/**
|
||||
* @Description:set基本信息
|
||||
* @date 2023/8/15
|
||||
* @param form1Obj
|
||||
* @param res
|
||||
*/
|
||||
export function setBasicInfo(form1Obj, res) {
|
||||
// 危害因素
|
||||
let medicalHazardFactorCode = null;
|
||||
if (res?.extension?.medicalHazardFactorCode) {
|
||||
medicalHazardFactorCode = res.extension.medicalHazardFactorCode?.split(',');
|
||||
}
|
||||
return {
|
||||
...form1Obj,
|
||||
email: res?.email || '',
|
||||
empSysno: res?.extension?.empSysno,
|
||||
empJob: res?.extension?.empJob,
|
||||
empTitle: res?.extension?.empTitle,
|
||||
empPosition: res?.extension?.empPosition,
|
||||
empLevel: res?.extension?.empLevel,
|
||||
empGroup: res?.extension?.empGroup,
|
||||
empStatus: res?.extension?.empStatus,
|
||||
medicalWorkTypeCode: res?.extension?.medicalWorkTypeCode,
|
||||
medicalOnJob: res?.extension?.medicalOnJob,
|
||||
medicalHazardFactorCode: medicalHazardFactorCode,
|
||||
medicalHazardDate: res?.extension?.medicalHazardDate,
|
||||
secondDepart: res?.secondDepart?.id, //单位
|
||||
orgCode: res?.depart?.id, //部门
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description:扩展信息
|
||||
* @date 2023/7/24
|
||||
* @param isUpdate
|
||||
*/
|
||||
// @ts-ignore
|
||||
export const extendedInfoForm: FunForm = (isUpdate = false) => [
|
||||
{
|
||||
label: '头像',
|
||||
field: 'avatar',
|
||||
component: 'JImageUpload',
|
||||
componentProps: {
|
||||
// @ts-ignore
|
||||
maxCount: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '身份证正面',
|
||||
field: 'empIdcardFace',
|
||||
component: 'JImageUpload',
|
||||
componentProps: {
|
||||
// @ts-ignore
|
||||
maxCount: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '身份证反面',
|
||||
field: 'empIdcardBack',
|
||||
component: 'JImageUpload',
|
||||
componentProps: {
|
||||
// @ts-ignore
|
||||
maxCount: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '身高',
|
||||
field: 'height',
|
||||
component: 'Input',
|
||||
componentProps: ({ formModel }) => {
|
||||
return {
|
||||
suffix: 'cm',
|
||||
style: {
|
||||
width: '100%',
|
||||
},
|
||||
onInput: () => {
|
||||
formModel.height = formModel.height.match(/\d+\.?\d{0,2}/);
|
||||
// formModel.height = formModel.height.replace(/[^0-9.]/g, '');
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '体重',
|
||||
field: 'weight',
|
||||
component: 'Input',
|
||||
componentProps: ({ formModel }) => {
|
||||
return {
|
||||
suffix: 'kg',
|
||||
style: {
|
||||
width: '100%',
|
||||
},
|
||||
onInput: () => {
|
||||
formModel.weight = formModel.weight.match(/\d+\.?\d{0,2}/);
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '出生日期',
|
||||
field: 'birthday',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
// @ts-ignore
|
||||
showTime: false,
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
getPopupContainer: () => document.body,
|
||||
disabledDate: (current) => current > new Date(),
|
||||
},
|
||||
ifShow: !isUpdate,
|
||||
},
|
||||
{
|
||||
label: '年龄',
|
||||
field: 'age',
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
//@ts-ignore
|
||||
style: {
|
||||
width: '100%',
|
||||
},
|
||||
},
|
||||
ifShow: !isUpdate,
|
||||
},
|
||||
{
|
||||
label: '血型',
|
||||
field: 'bloodType',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
//@ts-ignore
|
||||
dictCode: 'blood_type',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '民族',
|
||||
field: 'empNation',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
//@ts-ignore
|
||||
dictCode: 'nation',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '婚姻状况',
|
||||
field: 'empMarriage',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
//@ts-ignore
|
||||
dictCode: 'mr_state',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '政治面貌',
|
||||
field: 'empPolitical',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
//@ts-ignore
|
||||
dictCode: 'emp_political',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '学历',
|
||||
field: 'empDegree',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
//@ts-ignore
|
||||
dictCode: 'emp_education',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '籍贯',
|
||||
field: 'empNativeplace',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '入职时间',
|
||||
field: 'empWorktime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
//@ts-ignore
|
||||
showTime: false,
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
getPopupContainer: () => document.body,
|
||||
disabledDate: (current) => current > new Date(),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '用工形式',
|
||||
field: 'empType',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
//@ts-ignore
|
||||
dictCode: 'contract',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '是否上市员工',
|
||||
field: 'listedFlag',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
//@ts-ignore
|
||||
dictCode: 'sf_10',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '工作地点',
|
||||
field: 'workSpace',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '居住地点',
|
||||
field: 'liveSpace',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '健康类型',
|
||||
field: 'healthType',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
// @ts-ignore
|
||||
dictCode: 'health_type',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '健康状态',
|
||||
field: 'empJkState',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
// @ts-ignore
|
||||
dictCode: 'jk_status',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* @Description:set扩展信息
|
||||
* @date 2023/8/15
|
||||
* @param res
|
||||
*/
|
||||
export function setExtendedForm(res) {
|
||||
return {
|
||||
height: res?.extension?.height,
|
||||
weight: res?.extension?.weight,
|
||||
birthday: res?.birthday || '',
|
||||
age: res?.age,
|
||||
bloodType: res?.extension?.bloodType,
|
||||
empNation: res?.extension?.empNation,
|
||||
empMarriage: res?.extension?.empMarriage,
|
||||
empPolitical: res?.extension?.empPolitical,
|
||||
empDegree: res?.extension?.empDegree,
|
||||
empNativeplace: res?.extension?.empNativeplace,
|
||||
empWorktime: res?.extension?.empWorktime,
|
||||
empType: res?.extension?.empType,
|
||||
listedFlag: res?.extension?.listedFlag,
|
||||
workSpace: res?.extension?.workSpace,
|
||||
liveSpace: res?.extension?.liveSpace,
|
||||
empJkState: res?.extension?.empJkState,
|
||||
healthType: res?.extension?.healthType,
|
||||
avatar: res?.avatar,
|
||||
empIdcardFace: res?.extension?.empIdcardFace,
|
||||
empIdcardBack: res?.extension?.empIdcardBack,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description:身份证截取生日
|
||||
* @date 2023/8/15
|
||||
* @param cardId
|
||||
*/
|
||||
export function getBirth(cardId: string) {
|
||||
if (!cardId) return '';
|
||||
return cardId.substring(6, 10) + '-' + cardId.substring(10, 12) + '-' + cardId.substring(12, 14);
|
||||
}
|
||||
/**
|
||||
* @Description:处理请求参数
|
||||
* @param basicInfo
|
||||
* @param extendForm
|
||||
*/
|
||||
export function dealParams(basicInfo = {}, extendForm: any) {
|
||||
// 危害因素
|
||||
const medicalHazardFactorCode = basicInfo?.['medicalHazardFactorCode'] || null;
|
||||
const idCard = basicInfo?.['idCard'] || null;
|
||||
return {
|
||||
...basicInfo,
|
||||
...extendForm,
|
||||
birthday: getBirth(idCard),
|
||||
secondDepart: null,
|
||||
extension: {
|
||||
...basicInfo,
|
||||
...extendForm,
|
||||
birthday: getBirth(idCard),
|
||||
secondDepart: null,
|
||||
medicalHazardFactorCode: medicalHazardFactorCode,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description:表单字段验证
|
||||
* @date 2023/8/18
|
||||
* @param type
|
||||
* @param value
|
||||
* @param list 校验数据
|
||||
*/
|
||||
export function formValidate(type, value, list) {
|
||||
const messageType = {
|
||||
phone: '输入的手机号有重复',
|
||||
idCard: '输入的身份证号有重复',
|
||||
};
|
||||
const emptyType = {
|
||||
phone: '请输入手机号',
|
||||
idCard: '请输入身份证号',
|
||||
};
|
||||
if (!value) {
|
||||
return Promise.reject(emptyType[type]);
|
||||
}
|
||||
if (repeatCount(value, list) > 1) {
|
||||
return Promise.reject(messageType[type]);
|
||||
} else {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,410 @@
|
||||
<template>
|
||||
<a-spin :spinning="spinning" :delay="500">
|
||||
<div class="bg-color pd-10 basic-container">
|
||||
<a-tabs v-model:activeKey="activeKey" tab-position="left">
|
||||
<a-tab-pane key="1" tab="基本信息">
|
||||
<BasicForm @register="registerForm" />
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="2" tab="扩展信息" v-if="showTab2" force-render>
|
||||
<BasicForm @register="registerExtendForm" />
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="3" tab="紧急联系人" v-if="showTab3">
|
||||
<a-form ref="relationForm" :model="tableState.data" :rules="rules">
|
||||
<a-list :data-source="tableState.data" :bordered="true">
|
||||
<template #header>
|
||||
<a-row>
|
||||
<a-col flex="4" class="align-center">姓名</a-col>
|
||||
<a-col flex="4" class="align-center">与员工关系</a-col>
|
||||
<a-col flex="4" class="align-center">联系电话</a-col>
|
||||
<a-col flex="4" class="align-center">身份证号</a-col>
|
||||
<a-col flex="1" class="align-center">
|
||||
<a-button
|
||||
size="small"
|
||||
title="添加"
|
||||
type="primary"
|
||||
preIcon="ant-design:plus-outlined"
|
||||
@click="handleAdd"
|
||||
:disabled="inputDisabled"
|
||||
/>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
<template #renderItem="{ item, index }">
|
||||
<a-row class="row-self">
|
||||
<a-col flex="4">
|
||||
<div class="flex-jc">
|
||||
<a-form-item style="width: 60%" class="self-form-item" :name="[index, 'name']" :rules="rules.name">
|
||||
<a-input v-model:value="item.name" placeholder="请输入姓名" allow-clear :disabled="inputDisabled" />
|
||||
</a-form-item>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col flex="4">
|
||||
<div class="flex-jc">
|
||||
<a-form-item style="width: 60%" :name="[index, 'familyRelation']" :rules="rules.familyRelation">
|
||||
<JDictSelectTag
|
||||
allowClear
|
||||
placeholder="请选择与员工的关系"
|
||||
v-model:value="item.familyRelation"
|
||||
:getPopupContainer="getPopupContainer"
|
||||
dict-code="family_member_relation"
|
||||
:disabled="inputDisabled"
|
||||
/>
|
||||
</a-form-item>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col flex="4">
|
||||
<div class="flex-jc">
|
||||
<a-form-item style="width: 60%" class="self-form-item" :name="[index, 'phone']" :rules="rules.phone">
|
||||
<a-input
|
||||
v-model:value="item.phone"
|
||||
placeholder="请输入手机号"
|
||||
allow-clear
|
||||
:disabled="inputDisabled"
|
||||
@blur="phoneBlur($event, index)"
|
||||
/>
|
||||
</a-form-item>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col flex="4">
|
||||
<div class="flex-jc">
|
||||
<a-form-item style="width: 60%" class="self-form-item" :name="[index, 'idCard']" :rules="rules.idCard">
|
||||
<a-input
|
||||
v-model:value="item.idCard"
|
||||
placeholder="请输入身份证号"
|
||||
allow-clear
|
||||
:disabled="inputDisabled"
|
||||
/>
|
||||
</a-form-item>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col flex="1" class="align-center">
|
||||
<a-button
|
||||
size="small"
|
||||
title="删除"
|
||||
preIcon="ant-design:delete-outlined"
|
||||
@click="handleDelete(index, item)"
|
||||
:disabled="inputDisabled"
|
||||
/>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
</a-list>
|
||||
</a-form>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
<div class="footer-action" v-show="!inputDisabled">
|
||||
<a-button @click="cancel">重置</a-button>
|
||||
<a-button class="m10" type="primary" @click="submit" :loading="loading" :disabled="loading">保存 </a-button>
|
||||
</div>
|
||||
</div>
|
||||
</a-spin>
|
||||
</template>
|
||||
<script setup lang="ts" name="BasicInfo">
|
||||
import { BasicForm, useForm } from '/@/components/Form';
|
||||
import { computed, nextTick, onMounted, reactive, ref } from 'vue';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import {
|
||||
extendedInfoForm,
|
||||
formSchema,
|
||||
adaptiveColProps,
|
||||
getPopupContainer,
|
||||
FormItem,
|
||||
TableState,
|
||||
dealParams,
|
||||
setExtendedForm,
|
||||
setBasicInfo,
|
||||
checkRelation,
|
||||
formValidate,
|
||||
} from '/@/views/archive/employeeFile/components/basicInfo/basicInfo.data';
|
||||
import { getEmergency, queryById, removeEmergency, saveOrUpdate, updateEmergency } from '/@/views/archive/employeeFile/employeeFileList.api';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { FormInstance } from 'ant-design-vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
||||
|
||||
const route = useRoute();
|
||||
let showTab2 = ref(true); //显示扩展信息
|
||||
let showTab3 = ref(true); //显示紧急联系人
|
||||
|
||||
function init() {
|
||||
let { notShowTab } = route.query;
|
||||
showTab2.value = true;
|
||||
showTab3.value = true;
|
||||
if (notShowTab) {
|
||||
nextTick(() => {
|
||||
if (notShowTab.includes('2')) {
|
||||
showTab2.value = false;
|
||||
}
|
||||
if (notShowTab.includes('3')) {
|
||||
showTab3.value = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const rules = {
|
||||
name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
|
||||
phone: [
|
||||
{ pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误', trigger: 'blur' },
|
||||
{ required: true, trigger: 'blur', validator: phoneBlur },
|
||||
],
|
||||
familyRelation: [{ required: true, trigger: 'blur', validator: checkRelation }],
|
||||
idCard: [
|
||||
{
|
||||
trigger: 'blur',
|
||||
pattern: /^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|[xX])$/,
|
||||
message: '身份证号码格式有误',
|
||||
},
|
||||
{ required: true, trigger: 'blur', validator: idCardBlur },
|
||||
],
|
||||
};
|
||||
|
||||
function phoneBlur(_, value) {
|
||||
return formValidate('phone', value, tableState.data?.map((item) => item.phone) || []);
|
||||
}
|
||||
|
||||
function idCardBlur(_, value) {
|
||||
return formValidate('idCard', value, tableState.data?.map((item) => item.idCard) || []);
|
||||
}
|
||||
|
||||
const spinning = ref<boolean>(true);
|
||||
const changeSpinning = () => {
|
||||
spinning.value = !spinning.value;
|
||||
};
|
||||
const activeKey = ref<string>('1');
|
||||
const tableState: TableState = reactive({
|
||||
data: [],
|
||||
selectedRowKeys: [],
|
||||
});
|
||||
const initInfo = ref();
|
||||
const router = useRouter();
|
||||
// 查看时禁用输入框
|
||||
const inputDisabled = computed(() => route.query.type == 'detail');
|
||||
const isAdd = computed(() => route.query.type == 'add');
|
||||
const relationForm = ref<FormInstance>();
|
||||
const loading = ref(false);
|
||||
|
||||
//表单配置
|
||||
const [registerForm, { setProps, setFieldsValue, validate, clearValidate }] = useForm({
|
||||
labelWidth: 90,
|
||||
schemas: formSchema(isAdd.value),
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: adaptiveColProps,
|
||||
});
|
||||
|
||||
const [
|
||||
registerExtendForm,
|
||||
{ setProps: ExtendSetProps, validate: extendFormValidate, setFieldsValue: extendFormSetValue, clearValidate: clearExtendFormValidate },
|
||||
] = useForm({
|
||||
labelWidth: 90,
|
||||
schemas: extendedInfoForm(!inputDisabled.value),
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: adaptiveColProps,
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
spinning.value = true;
|
||||
if (route.query.type == 'edit') {
|
||||
await getInfo();
|
||||
} else if (route.query.type == 'detail') {
|
||||
await setProps({ disabled: true });
|
||||
await ExtendSetProps({ disabled: true });
|
||||
await getInfo();
|
||||
init();
|
||||
} else {
|
||||
changeSpinning();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @Description:获取基础信息
|
||||
* @date 2023/8/3
|
||||
*/
|
||||
async function getInfo() {
|
||||
try {
|
||||
let res = await queryById({ id: route.query.id });
|
||||
initInfo.value = cloneDeep(res);
|
||||
await setValue(res?.userEmployee || {});
|
||||
tableState.data = res.sysUserEmergencyContactList;
|
||||
} catch {
|
||||
spinning.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description:form赋值
|
||||
* @date 2023/7/24
|
||||
*/
|
||||
async function setValue(res) {
|
||||
spinning.value = false;
|
||||
const form1 = formSchema(isAdd.value).map((item) => item.field);
|
||||
const form1Obj = {};
|
||||
form1.forEach((item) => (form1Obj[item] = res[item]));
|
||||
await setFieldsValue(setBasicInfo(form1Obj, res));
|
||||
await extendFormSetValue(setExtendedForm(res));
|
||||
await clearValidate();
|
||||
await clearExtendFormValidate();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description:获取紧急联系人
|
||||
*/
|
||||
async function getEmergencyList() {
|
||||
try {
|
||||
let list = await getEmergency({ userId: route.query.id });
|
||||
tableState.data = list.records;
|
||||
} catch {}
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
let formItem: FormItem = { name: '', familyRelation: '', phone: '', idCard: '' };
|
||||
tableState.data.unshift(formItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description:删除紧急联系人
|
||||
* @date 2023/8/3
|
||||
* @param index
|
||||
* @param item
|
||||
*/
|
||||
async function handleDelete(index, item) {
|
||||
// 新增数据没添加到数据库
|
||||
if (!item?.id) {
|
||||
return tableState.data.splice(index, 1);
|
||||
}
|
||||
try {
|
||||
await removeEmergency({ id: item.id });
|
||||
tableState.data.splice(index, 1);
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description:添加或者修改紧急联系人
|
||||
* @date 2023/8/8
|
||||
*/
|
||||
async function editEmergency() {
|
||||
try {
|
||||
let values = tableState.data;
|
||||
let params = values?.map((item) => ({ ...item, userId: route.query.id, id: item.id || '' }));
|
||||
return updateEmergency(params);
|
||||
} catch {}
|
||||
}
|
||||
|
||||
function submitSend(params, isUpdate) {
|
||||
saveOrUpdate(params, isUpdate, () => {
|
||||
closeTab();
|
||||
}).catch(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @Description:提交
|
||||
* @date 2023/8/8
|
||||
*/
|
||||
async function submit() {
|
||||
await nextTick(() => {
|
||||
loading.value = true;
|
||||
});
|
||||
try {
|
||||
const basicInfo = await validate();
|
||||
const extendForm = await extendFormValidate();
|
||||
let res = await relationForm.value?.validate();
|
||||
// 请求参数
|
||||
const params = dealParams(basicInfo, extendForm);
|
||||
// 编辑或新增
|
||||
const isUpdate = route.query.type == 'edit';
|
||||
// 提交联系人
|
||||
if (res && Object.keys(res).length > 0) {
|
||||
return editEmergency()
|
||||
.then(() => {
|
||||
// 提交表单
|
||||
submitSend(params, isUpdate);
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
} else {
|
||||
submitSend(params, isUpdate);
|
||||
}
|
||||
} catch (e: any) {
|
||||
console.log(e, 'e');
|
||||
// 处理未填字段
|
||||
const [item] = e?.errorFields || {};
|
||||
const obj = {
|
||||
'1': formSchema(isAdd.value).map((item) => item.field),
|
||||
'2': extendedInfoForm(!inputDisabled.value).map((item) => item.field),
|
||||
};
|
||||
for (const key in obj) {
|
||||
if (obj[key].includes(item.name[0])) {
|
||||
activeKey.value = key;
|
||||
break;
|
||||
} else {
|
||||
activeKey.value = '3';
|
||||
}
|
||||
}
|
||||
loading.value = false;
|
||||
} finally {
|
||||
// loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function closeTab() {
|
||||
const tabStore = useMultipleTabStore();
|
||||
let timer = setTimeout(() => {
|
||||
clearTimeout(timer);
|
||||
router.push({ path: '/archive/employeeFileList' });
|
||||
}, 200);
|
||||
tabStore.closeTabByKey(route.fullPath, router);
|
||||
}
|
||||
|
||||
async function cancel() {
|
||||
if (initInfo.value?.userEmployee) {
|
||||
await setValue(initInfo.value.userEmployee);
|
||||
}
|
||||
await getEmergencyList();
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.basic-container {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.row-self {
|
||||
margin-top: 8px;
|
||||
padding: 0 24px;
|
||||
}
|
||||
|
||||
.footer-action {
|
||||
margin-top: 8px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.flex-jc {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.self-form-item {
|
||||
.ant-form-item-explain {
|
||||
text-align: left !important;
|
||||
}
|
||||
}
|
||||
|
||||
.m10 {
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.pd-10 {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.bg-color {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.align-center {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,93 @@
|
||||
<template>
|
||||
<div style="position: relative; height: 100%; width: 100%">
|
||||
<div class="emp-detail-container">
|
||||
<div class="detail-header">
|
||||
<a-radio-group v-model:value="activeKey" button-style="solid" class="top-selector" @change="changeType">
|
||||
<a-radio-button v-for="t in showList" :key="t.key" :value="t.key">{{ t.title }}</a-radio-button>
|
||||
</a-radio-group>
|
||||
<div class="detail-header-right">{{ decrypt(route.query.name) }}</div>
|
||||
</div>
|
||||
<keep-alive>
|
||||
<component :is="currentComp" />
|
||||
</keep-alive>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, shallowRef, unref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
import { componentsList, ComponentsType, encryption } from '/@/views/archive/employeeFile/employeeFileList.data';
|
||||
|
||||
const route = useRoute();
|
||||
const { decrypt } = encryption();
|
||||
const { hasPermission } = usePermission();
|
||||
const activeKey = ref(1);
|
||||
const showList = ref<ComponentsType[]>([]);
|
||||
// type: detail、edit; currentTab:activeKey
|
||||
const { type, currentTab, showKey } = route.query;
|
||||
if (type === 'detail') {
|
||||
showList.value = filterComponent(componentsList);
|
||||
activeKey.value = Number(currentTab) || 1;
|
||||
} else {
|
||||
showList.value = filterComponent([componentsList[0]]);
|
||||
}
|
||||
|
||||
function filterComponent(list: ComponentsType[]) {
|
||||
/*
|
||||
* 增加筛选出需要显示的组件 2024/08/16
|
||||
*/
|
||||
let arr = list;
|
||||
if (showKey && showKey.length) {
|
||||
const numericShowKey = showKey.map((key) => parseInt(key, 10));
|
||||
arr = list.filter((item) => numericShowKey.includes(item.key));
|
||||
}
|
||||
return arr.filter((t) => {
|
||||
if (t.auth) {
|
||||
return hasPermission(t.auth);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
function changeType() {
|
||||
currentComp.value = getCurrentComp();
|
||||
}
|
||||
|
||||
function getCurrentComp() {
|
||||
return unref(showList).find((t) => t.key === unref(activeKey))?.component || '';
|
||||
}
|
||||
|
||||
let currentComp = shallowRef<any>(getCurrentComp());
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.emp-detail-container {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.top-selector {
|
||||
padding: 10px 10px 0;
|
||||
}
|
||||
|
||||
.detail-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.detail-header-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-right: 50px;
|
||||
padding-top: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,22 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
export enum Api {
|
||||
list = '/archives/employeeArchives/queryByUserId',
|
||||
queryById = '',
|
||||
save = '/health-consultation/consultation/conHealthInfo/add',
|
||||
edit = '/health-consultation/consultation/conHealthInfo/edit',
|
||||
deleteOne = '/health-consultation/consultation/conHealthInfo/delete',
|
||||
// report = '/historyReport/getHistoryReportById',
|
||||
report = '/health-archives/historyReport/selectHealthReportResult',
|
||||
}
|
||||
/**
|
||||
* @Description: 获取列表数据
|
||||
* @date 2023/7/25
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
/**
|
||||
* @Description:体检报告详情
|
||||
* @date 2023/8/16
|
||||
* @param:
|
||||
*/
|
||||
export const report = (params) => defHttp.get({ url: Api.report, params });
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '体检日期',
|
||||
align: 'center',
|
||||
dataIndex: 'peQueueDate',
|
||||
},
|
||||
{
|
||||
title: '体检年度',
|
||||
align: 'center',
|
||||
dataIndex: 'medicalYear',
|
||||
},
|
||||
{
|
||||
title: '体检医院',
|
||||
align: 'center',
|
||||
dataIndex: 'hospitalName',
|
||||
},
|
||||
{
|
||||
title: '审核时间',
|
||||
align: 'center',
|
||||
dataIndex: 'auditDate',
|
||||
},
|
||||
{
|
||||
title: '报告上传时间',
|
||||
align: 'center',
|
||||
dataIndex: 'createDate',
|
||||
},
|
||||
// {
|
||||
// title: '体检检出',
|
||||
// align: 'center',
|
||||
// dataIndex: 'sicksDetailsToString',
|
||||
// },
|
||||
// {
|
||||
// title: '正常/异常项',
|
||||
// align: 'center',
|
||||
// dataIndex: 'statusListToString',
|
||||
// },
|
||||
];
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '体检日期',
|
||||
field: 'date',
|
||||
component: 'RangePicker',
|
||||
componentProps: ({ formModel }) => {
|
||||
return {
|
||||
showTime: false,
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
getPopupContainer: () => document.body,
|
||||
'onUpdate:value': (value) => {
|
||||
if (value) {
|
||||
formModel.startTime = value[0];
|
||||
formModel.endTime = value[1];
|
||||
} else {
|
||||
formModel.startTime = null;
|
||||
formModel.endTime = null;
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '开始时间',
|
||||
field: 'startTime',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
label: '结束时间',
|
||||
field: 'endTime',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
];
|
||||
const one = {
|
||||
analysisName: 'cqmc',
|
||||
senResultRes: 'childlist',
|
||||
};
|
||||
const two = {
|
||||
thirdResultRes: 'childlist',
|
||||
uniItemClassName: 'cqmc',
|
||||
};
|
||||
const three = {
|
||||
peItemName: 'cqmc',
|
||||
peResult: 'xmz',
|
||||
unit: 'xmdw',
|
||||
printContext: 'cqckz',
|
||||
};
|
||||
|
||||
//循序键值对,依次更改
|
||||
let index = 0;
|
||||
const arr = [one, two, three];
|
||||
export function changeKey(json) {
|
||||
function getData(list, one) {
|
||||
if (one && typeof one == 'object') {
|
||||
const oneKeys = Object.keys(one);
|
||||
oneKeys.forEach((key) => {
|
||||
list.forEach((item) => {
|
||||
if (item[key] && Array.isArray(item[key]) && item[key].length) {
|
||||
index++;
|
||||
item[one[key]] = item[key];
|
||||
getData(item[key], arr[index]);
|
||||
delete item[key];
|
||||
} else {
|
||||
item[one[key]] = item[key];
|
||||
item['show'] = true;
|
||||
delete item[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
getData(json, one);
|
||||
return json;
|
||||
}
|
||||
|
||||
export function replaceProperties(json) {
|
||||
return json.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
show: true,
|
||||
cqmc: item?.analysisName,
|
||||
childlist:
|
||||
item?.senResultRes?.map((result) => {
|
||||
return {
|
||||
...result,
|
||||
cqmc: result?.uniItemClassName,
|
||||
show: true,
|
||||
childlist:
|
||||
result?.thirdResultRes?.map((thirdResult) => {
|
||||
return {
|
||||
...thirdResult,
|
||||
cqmc: thirdResult?.peItemName,
|
||||
xmz: thirdResult?.peResult,
|
||||
xmdw: thirdResult?.unit,
|
||||
cqckz: thirdResult?.printContext,
|
||||
show: true,
|
||||
};
|
||||
}) || [],
|
||||
};
|
||||
}) || [],
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<BasicTable @register="registerTable">
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<table-action :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<UserReport ref="reportRefs" @register="lookRecordModal" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, replaceProperties, searchFormSchema } from '/@/views/archive/employeeFile/components/examinationReport/examinationReport.data';
|
||||
import { list, report } from '/@/views/archive/employeeFile/components/examinationReport/examinationReport.api';
|
||||
import UserReport from '/@/views/medical/report/userResult/components/UserReport.vue';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
const reportRefs = ref('');
|
||||
const route = useRoute();
|
||||
// 注册modal
|
||||
const [lookRecordModal, { openModal }] = useModal();
|
||||
// 注册table数据
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: '体检报告',
|
||||
columns,
|
||||
api: list,
|
||||
canResize: false,
|
||||
searchInfo: {
|
||||
userId: route.query.id,
|
||||
},
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: false,
|
||||
},
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
const [registerTable] = tableContext;
|
||||
async function handleDetail(record: Recordable) {
|
||||
let { medicalYear } = record;
|
||||
try {
|
||||
// let res = await report({ id: medicalId });
|
||||
let res = await report({ userId: route.query.id, medicalYear: medicalYear });
|
||||
// let classVoList = replaceProperties(res?.resultItemResList || []);
|
||||
// const result = {
|
||||
// conclusion: res?.conclusion,
|
||||
// recommendation: res?.suggest,
|
||||
// classVoList: classVoList,
|
||||
// };
|
||||
reportRefs.value['handlePhysical'](res);
|
||||
} catch {
|
||||
reportRefs.value['handlePhysical']({});
|
||||
}
|
||||
openModal(true, {
|
||||
isUpdate: true,
|
||||
showFooter: false,
|
||||
});
|
||||
}
|
||||
function getTableAction(record: Recordable) {
|
||||
return [
|
||||
{
|
||||
label: '查看报告',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less"></style>
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<BasicDrawer v-bind="$attrs" :showFooter="false" @register="registerDrawer" destroyOnClose :title="title" :width="500">
|
||||
<QuestionType :list="list" />
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
|
||||
import QuestionType from '/@/views/archive/employeeFile/components/questionType/index.vue';
|
||||
import { queryById } from '/@/views/archive/employeeFile/components/healthAssessment/healthAssessment.api';
|
||||
|
||||
const title = '问卷详情';
|
||||
const list = ref({});
|
||||
const [registerDrawer] = useDrawerInner(async (data) => {
|
||||
if (data.record?.logId) {
|
||||
await getQuestionList(data.record.logId);
|
||||
}
|
||||
});
|
||||
async function getQuestionList(logId) {
|
||||
try {
|
||||
let res = await queryById({ logId });
|
||||
list.value = dealQuestion(res, true);
|
||||
} catch {}
|
||||
}
|
||||
/**
|
||||
* @Description:处理第8题的选中项对后面题的结果
|
||||
* @date 2023/8/12
|
||||
* @param isDeal
|
||||
* @param json
|
||||
*/
|
||||
function dealQuestion(json, isDeal = false) {
|
||||
if (json && typeof json === 'string') {
|
||||
let res = JSON.parse(json);
|
||||
if (!isDeal) return res;
|
||||
let valueT = [9, 10, 11];
|
||||
let valueTh = [11];
|
||||
return res.filter((item) => {
|
||||
if (res[7].answer == '1') {
|
||||
return !valueT.includes(item.orderNo);
|
||||
} else if (res[7].answer == '2') {
|
||||
return !valueTh.includes(item.orderNo);
|
||||
} else {
|
||||
return item;
|
||||
}
|
||||
});
|
||||
}
|
||||
return [];
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,25 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
export enum Api {
|
||||
list = '/health-archives/archives/hmsEvaluationStatistics/pageCustom',
|
||||
queryById = '/health-archives/archives/hmsEvaluation/questionByLogId',
|
||||
exportReport = '/health-archives/archives/hmsEvaluation/pdfByLogId',
|
||||
}
|
||||
/**
|
||||
* @Description:列表接口
|
||||
* @date 2023/7/18
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
/**
|
||||
* @Description:获取答题问卷详情
|
||||
* @date 2023/8/12
|
||||
* @param params
|
||||
*/
|
||||
export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
|
||||
/**
|
||||
* @Description:获取pdf下载地址byLogId
|
||||
* @date 2023/8/16
|
||||
* @param params
|
||||
*/
|
||||
export const exportReport = (params) => defHttp.get({ url: Api.exportReport, params });
|
||||
export const downloadReport = (url: string) => defHttp.get({ ...{ url: url }, ...{ responseType: 'blob' } });
|
||||
@@ -0,0 +1,80 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '评估日期',
|
||||
align: 'center',
|
||||
dataIndex: 'createTime',
|
||||
},
|
||||
{
|
||||
title: '体重指数',
|
||||
align: 'center',
|
||||
dataIndex: 'bmiDesc',
|
||||
},
|
||||
{
|
||||
title: '缺血性心血管病',
|
||||
align: 'center',
|
||||
dataIndex: 'ischemicCardiovascular_dictText',
|
||||
},
|
||||
{
|
||||
title: '糖尿病',
|
||||
align: 'center',
|
||||
dataIndex: 'diabetes_dictText',
|
||||
},
|
||||
{
|
||||
title: '肺癌',
|
||||
align: 'center',
|
||||
dataIndex: 'lungCancer_dictText',
|
||||
},
|
||||
{
|
||||
title: '高血压',
|
||||
align: 'center',
|
||||
dataIndex: 'hypertension_dictText',
|
||||
},
|
||||
{
|
||||
title: '代谢综合征',
|
||||
align: 'center',
|
||||
dataIndex: 'metabolicSyndrome_dictText',
|
||||
},
|
||||
{
|
||||
title: '详情id',
|
||||
align: 'center',
|
||||
dataIndex: 'logId',
|
||||
ifShow: false,
|
||||
},
|
||||
];
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '体检日期',
|
||||
field: 'date',
|
||||
component: 'RangePicker',
|
||||
componentProps: ({ formModel }) => {
|
||||
return {
|
||||
showTime: false,
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
getPopupContainer: () => document.body,
|
||||
'onUpdate:value': (value) => {
|
||||
if (value) {
|
||||
formModel.startDate = value[0];
|
||||
formModel.endDate = value[1];
|
||||
} else {
|
||||
formModel.startDate = null;
|
||||
formModel.endDate = null;
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '开始时间',
|
||||
field: 'startDate',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
label: '结束时间',
|
||||
field: 'endDate',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<BasicTable @register="registerTable">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<div class="total-text">累计评估:{{ total }}次</div>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<HealthQuestionDrawer @register="registerDrawer" />
|
||||
</template>
|
||||
<script setup lang="ts" name="HealthAssessment">
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, searchFormSchema } from '/@/views/archive/employeeFile/components/healthAssessment/healthAssessment.data';
|
||||
import { exportReport, list } from '/@/views/archive/employeeFile/components/healthAssessment/healthAssessment.api';
|
||||
import { useRoute } from 'vue-router';
|
||||
import HealthQuestionDrawer from '/@/views/archive/employeeFile/components/healthAssessment/components/healthQuestionDrawer.vue';
|
||||
import { useDrawer } from '/@/components/Drawer';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import { ref } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { message } from 'ant-design-vue';
|
||||
const route = useRoute();
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
const total = ref();
|
||||
|
||||
//注册table数据
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: '健康评估',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
formConfig: { schemas: searchFormSchema },
|
||||
beforeFetch: (params) => {
|
||||
params['userId'] = route.query.id;
|
||||
return params;
|
||||
},
|
||||
actionColumn: {
|
||||
width: 160,
|
||||
fixed: 'right',
|
||||
},
|
||||
afterFetch: () => {
|
||||
setTotal();
|
||||
},
|
||||
},
|
||||
});
|
||||
const [registerTable, { getRawDataSource }] = tableContext;
|
||||
function setTotal() {
|
||||
try {
|
||||
const data = getRawDataSource();
|
||||
total.value = data.total;
|
||||
} catch {}
|
||||
}
|
||||
async function exportExcel(record: Recordable) {
|
||||
try {
|
||||
if (!record.logId) return false;
|
||||
let res = await exportReport({ logId: record.logId });
|
||||
if (res) {
|
||||
let urlList = res?.split(',');
|
||||
if (!urlList) {
|
||||
message.info('暂无PDF文件');
|
||||
return;
|
||||
}
|
||||
urlList.map((item) => {
|
||||
item && Download(item);
|
||||
});
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
async function Download(url) {
|
||||
const downloadReport = (url: string) =>
|
||||
defHttp.get({ url: '/file/show/' + url, ...{ responseType: 'blob' } }, { isTransformResponse: false });
|
||||
try {
|
||||
let res: any = await downloadReport(url);
|
||||
let blob = new Blob([res], { type: 'application/vnd.ms-pdf;charset=utf-8' });
|
||||
let link = document.createElement('a');
|
||||
link.href = window.URL.createObjectURL(blob);
|
||||
link.download = `${url.substring(url.lastIndexOf('/') + 1)}`;
|
||||
link.click();
|
||||
} catch (e) {
|
||||
throw new Error(e);
|
||||
}
|
||||
}
|
||||
function handleDetail(record: Recordable) {
|
||||
openDrawer(true, {
|
||||
showFooter: false,
|
||||
record,
|
||||
isUpdate: false,
|
||||
});
|
||||
}
|
||||
function getTableAction(record: Recordable) {
|
||||
return [
|
||||
{
|
||||
label: '导出报告',
|
||||
onClick: exportExcel.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '问卷详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.m-10 {
|
||||
margin: 10px;
|
||||
}
|
||||
.total-text {
|
||||
color: #000;
|
||||
}
|
||||
</style>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<template>
|
||||
<BasicDrawer v-bind="$attrs" :showFooter="false" @register="registerDrawer" destroyOnClose :title="title" :width="500">
|
||||
<QuestionType :list="list" />
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
|
||||
import QuestionType from '/@/views/archive/employeeFile/components/questionType/index.vue';
|
||||
import { queryById } from '/@/views/archive/employeeFile/components/psychologicalAssessment/psychologicalAssessment.api';
|
||||
const title = '问卷详情';
|
||||
const list = ref({});
|
||||
const [registerDrawer] = useDrawerInner(async (data) => {
|
||||
if (data.record?.id) {
|
||||
await getQuestionList(data.record.id);
|
||||
}
|
||||
});
|
||||
|
||||
async function getQuestionList(id) {
|
||||
try {
|
||||
let res = await queryById({ id });
|
||||
list.value = JSON.parse(res);
|
||||
} catch {}
|
||||
}
|
||||
</script>
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
export enum Api {
|
||||
list = '/archives/hmsEvaluation/pageCustom',
|
||||
queryById = '/archives/hmsEvaluation/question',
|
||||
}
|
||||
/**
|
||||
* @Description:列表接口
|
||||
* @date 2023/7/18
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '评估日期',
|
||||
align: 'center',
|
||||
dataIndex: 'saveDate',
|
||||
},
|
||||
{
|
||||
title: '健康评分',
|
||||
align: 'center',
|
||||
dataIndex: 'grade',
|
||||
},
|
||||
{
|
||||
title: '评分等级',
|
||||
align: 'center',
|
||||
dataIndex: 'level',
|
||||
},
|
||||
{
|
||||
title: '累计评估',
|
||||
align: 'center',
|
||||
dataIndex: 'fromName',
|
||||
ifShow: false,
|
||||
},
|
||||
];
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '体检日期',
|
||||
field: 'date',
|
||||
component: 'RangePicker',
|
||||
componentProps: ({ formModel }) => {
|
||||
return {
|
||||
showTime: false,
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
getPopupContainer: () => document.body,
|
||||
onChange: ([start, end]) => {
|
||||
formModel.startDate = start;
|
||||
formModel.endDate = end;
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '开始时间',
|
||||
field: 'startDate',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
label: '结束时间',
|
||||
field: 'endDate',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
];
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<BasicTable @register="registerTable">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<div class="total-text">累计评估:{{ total }}次</div>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<QuestionDetailDrawer @register="registerDrawer" />
|
||||
</template>
|
||||
<script setup lang="ts" name="PsychologicalAssessment">
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns } from '/@/views/archive/employeeFile/components/psychologicalAssessment/psychologicalAssessment.data';
|
||||
import { list } from '/@/views/archive/employeeFile/components/psychologicalAssessment/psychologicalAssessment.api';
|
||||
import QuestionDetailDrawer from '/@/views/archive/employeeFile/components/psychologicalAssessment/components/questionDetailDrawer.vue';
|
||||
import { useDrawer } from '/@/components/Drawer';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { ref } from 'vue';
|
||||
import { searchFormSchema } from '/@/views/archive/employeeFile/components/healthAssessment/healthAssessment.data';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { message } from 'ant-design-vue';
|
||||
const route = useRoute();
|
||||
const total = ref();
|
||||
//注册table数据
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: '心理评估',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
formConfig: { schemas: searchFormSchema },
|
||||
actionColumn: {
|
||||
width: 160,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
params['userId'] = route.query.id;
|
||||
params['hmsType'] = '2';
|
||||
return params;
|
||||
},
|
||||
afterFetch: () => {
|
||||
setTotal();
|
||||
},
|
||||
},
|
||||
});
|
||||
const [registerTable, { getRawDataSource }, {}] = tableContext;
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
function setTotal() {
|
||||
try {
|
||||
const data = getRawDataSource();
|
||||
total.value = data.total;
|
||||
} catch {}
|
||||
}
|
||||
|
||||
async function exportExcel(record: Recordable) {
|
||||
if (!record.pdfUrl) {
|
||||
message.info('暂无PDF文件');
|
||||
return;
|
||||
}
|
||||
let urlList = record.pdfUrl?.split(',') || '';
|
||||
urlList?.map((item) => {
|
||||
item && Download(item);
|
||||
});
|
||||
}
|
||||
async function Download(url) {
|
||||
const downloadReport = (url: string) =>
|
||||
defHttp.get({ url: '/file/show/' + url, ...{ responseType: 'blob' } }, { isTransformResponse: false });
|
||||
try {
|
||||
let res: any = await downloadReport(url);
|
||||
let blob = new Blob([res], { type: 'application/vnd.ms-pdf;charset=utf-8' });
|
||||
let link = document.createElement('a');
|
||||
link.href = window.URL.createObjectURL(blob);
|
||||
link.download = `${url.substring(url.lastIndexOf('/') + 1)}`;
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
} catch (e) {
|
||||
throw new Error(e);
|
||||
}
|
||||
}
|
||||
function handleDetail(record: Recordable) {
|
||||
openDrawer(true, {
|
||||
isUpdate: false,
|
||||
record,
|
||||
showFooter: false,
|
||||
});
|
||||
}
|
||||
function getTableAction(record: Recordable) {
|
||||
return [
|
||||
{
|
||||
label: '导出报告',
|
||||
onClick: exportExcel.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '问卷详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.m-10 {
|
||||
margin: 10px;
|
||||
}
|
||||
.total-text {
|
||||
color: #000;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,36 @@
|
||||
<script setup lang="ts">
|
||||
import { toRefs } from 'vue';
|
||||
|
||||
const props = defineProps(['item']);
|
||||
|
||||
const { orderNo, questionName, questionDict } = toRefs(props.item);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div class="q-title">{{ orderNo }}.{{ questionName }}(多选)</div>
|
||||
<div class="q-list">
|
||||
<div class="q-item" v-for="(val, i) in questionDict" :key="i" :class="[val.value == '1' ? 'active' : '']">{{ val.title }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="less">
|
||||
.q-title {
|
||||
line-height: 28px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
.q-item {
|
||||
padding: 4px 10px;
|
||||
border: 1px solid #f4f4f4;
|
||||
background-color: #f4f4f4;
|
||||
border-radius: 6px;
|
||||
margin-bottom: 8px;
|
||||
&.active {
|
||||
border: 1px solid #40a9ff;
|
||||
background: rgba(24, 144, 255, 0.2);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,30 @@
|
||||
<template>
|
||||
<div v-for="(item, k) in list" :key="k" class="question-container">
|
||||
<component :is="typeList(item.quesType)" :key="k" :item="item" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import InputTopic from '/@/views/archive/employeeFile/components/questionType/inputTopic.vue';
|
||||
import RadioTopic from '/@/views/archive/employeeFile/components/questionType/radioTopic.vue';
|
||||
import CheckTopic from '/@/views/archive/employeeFile/components/questionType/checkTopic.vue';
|
||||
import MultipleTopic from '/@/views/archive/employeeFile/components/questionType/multipleTopic.vue';
|
||||
const props = defineProps({
|
||||
list: {
|
||||
type: Array,
|
||||
},
|
||||
});
|
||||
const typeList = (type) => {
|
||||
const typeObj = {
|
||||
5: CheckTopic,
|
||||
2: MultipleTopic,
|
||||
3: InputTopic,
|
||||
1: RadioTopic,
|
||||
};
|
||||
return typeObj[type];
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.question-container {
|
||||
padding: 0 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,25 @@
|
||||
<script setup lang="ts">
|
||||
import { toRefs } from 'vue';
|
||||
|
||||
const props = defineProps(['item']);
|
||||
|
||||
const { orderNo, questionName, answer } = toRefs(props.item);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div class="q-title">{{ orderNo }}.{{ questionName }}(填空)</div>
|
||||
<div>
|
||||
<a-input :value="answer" allow-clear readonly />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="less">
|
||||
.q-title {
|
||||
line-height: 28px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,38 @@
|
||||
<script setup lang="ts">
|
||||
import { toRefs } from 'vue';
|
||||
|
||||
const props = defineProps(['item']);
|
||||
|
||||
const { orderNo, questionName, questionDict, answerCode } = toRefs(props.item);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div class="q-title">{{ orderNo }}.{{ questionName }}(多选)</div>
|
||||
<div class="q-list">
|
||||
<div class="q-item" v-for="(val, i) in questionDict" :key="i" :class="[answerCode.includes(val.code) ? 'active' : '']">{{
|
||||
val.title
|
||||
}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="less">
|
||||
.q-title {
|
||||
line-height: 28px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
.q-item {
|
||||
padding: 4px 10px;
|
||||
border: 1px solid #f4f4f4;
|
||||
background-color: #f4f4f4;
|
||||
border-radius: 6px;
|
||||
margin-bottom: 8px;
|
||||
&.active {
|
||||
border: 1px solid #40a9ff;
|
||||
background: rgba(24, 144, 255, 0.2);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="q-title">{{ orderNo }}.{{ questionName }}(单选)</div>
|
||||
<div class="q-list">
|
||||
<div class="q-item" v-for="(val, i) in questionDict" :key="i" :class="[val.code == answerCode ? 'active' : '']">{{ val.title }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { toRefs } from 'vue';
|
||||
|
||||
const props = defineProps(['item']);
|
||||
|
||||
const { orderNo, questionName, questionDict, answerCode } = toRefs(props.item);
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.q-title {
|
||||
line-height: 28px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
.q-item {
|
||||
padding: 4px 10px;
|
||||
border: 1px solid #f4f4f4;
|
||||
background-color: #f4f4f4;
|
||||
border-radius: 6px;
|
||||
margin-bottom: 8px;
|
||||
&.active {
|
||||
border: 1px solid #40a9ff;
|
||||
background: rgba(24, 144, 255, 0.2);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,7 @@
|
||||
<script setup lang="ts" name="StressAssessment">
|
||||
console.log(2);
|
||||
</script>
|
||||
|
||||
<template><div></div> </template>
|
||||
|
||||
<style scoped lang="less"></style>
|
||||
@@ -0,0 +1,81 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
export enum Api {
|
||||
list = '/sys/healthUserEmployeeEx/list',
|
||||
queryById = '/archives/employeeArchives/queryById',
|
||||
// queryById = '/sys/healthUserEmployeeEx/queryById',
|
||||
save = '/sys/healthUserEmployeeEx/add',
|
||||
edit = '/sys/healthUserEmployeeEx/edit',
|
||||
deleteOne = '/health-consultation/consultation/conHealthInfo/delete',
|
||||
thirdByCode = '/sys/sysDepart/getThirdDepartListByOrgCode',
|
||||
updateEmergency = '/sys/sysUserEmergencyContact/add',
|
||||
getEmergency = '/sys/sysUserEmergencyContact/list',
|
||||
removeEmergency = '/sys/sysUserEmergencyContact/delete',
|
||||
reportStatus = '/health-archives/archives/hmsEvaluation/analysisReport/status',
|
||||
reportGenerate = '/health-archives/archives/hmsEvaluation/analysisReport/generate',
|
||||
}
|
||||
/**
|
||||
* @Description:列表接口
|
||||
* @date 2023/7/17
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params: { ...params, selectFamily: true } });
|
||||
/**
|
||||
* @Description:获取详情信息
|
||||
* @date 2023/7/17
|
||||
*/
|
||||
export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
|
||||
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
* @param isUpdate
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate, handleSuccess) => {
|
||||
const url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
/**
|
||||
* @Description:通过code查三级部门
|
||||
* @date 2023/8/3
|
||||
* @param params
|
||||
*/
|
||||
export const getThirdDepartListByOrgCode = (params) => defHttp.get({ url: Api.thirdByCode, params });
|
||||
|
||||
/**.
|
||||
* @Description:添加或者修改紧急联系人
|
||||
* @date 2023/8/3
|
||||
* @param params
|
||||
*/
|
||||
export const updateEmergency = (params) => defHttp.post({ url: Api.updateEmergency, params }, { successNeedMessage: false });
|
||||
/**
|
||||
* @Description:查询紧急联系人列表
|
||||
* @date 2023/8/3
|
||||
* @param data
|
||||
*/
|
||||
export const getEmergency = (data) => {
|
||||
const params = {
|
||||
...data,
|
||||
pageNo: 1,
|
||||
pageSize: 50,
|
||||
};
|
||||
return defHttp.get({ url: Api.getEmergency, params });
|
||||
};
|
||||
/**
|
||||
* @Description:删除紧急联系人
|
||||
* @date 2023/8/3
|
||||
* @param:
|
||||
*/
|
||||
export const removeEmergency = (params) => defHttp.delete({ url: Api.removeEmergency, params }, { joinParamsToUrl: true });
|
||||
|
||||
/**
|
||||
* 获取分析报告详情状态
|
||||
*
|
||||
*/
|
||||
export const reportStatus = (params) => defHttp.get({ url: Api.reportStatus, params });
|
||||
|
||||
/**
|
||||
* 生成报告
|
||||
* */
|
||||
export const reportGenerate = (params) => defHttp.get({ url: Api.reportGenerate, params });
|
||||
@@ -0,0 +1,238 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { Component, h } from 'vue';
|
||||
import { Image, message } from 'ant-design-vue';
|
||||
import { getFamaleDefaultImage, getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import { EyeOutlined } from '@ant-design/icons-vue';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import BasicInfo from '/@/views/archive/employeeFile/components/basicInfo/basicInfo.vue';
|
||||
import ExaminationReport from '/@/views/archive/employeeFile/components/examinationReport/examinationReport.vue';
|
||||
import HealthAssessment from '/src/views/archive/employeeFile/components/healthAssessment/healthAssessment.vue';
|
||||
import PsychologicalAssessment from '/@/views/archive/employeeFile/components/psychologicalAssessment/psychologicalAssessment.vue';
|
||||
import AnalysisReport from '/@/views/archive/employeeFile/components/analysisReport/analysisReport.vue';
|
||||
import { getSecondaryDepartmentList } from '/@/views/system/user/user.api';
|
||||
import { getThirdDepartListByOrgCode } from '/@/views/archive/employeeFile/employeeFileList.api';
|
||||
import { useDepartment } from '/@/utils/auth/formAuth';
|
||||
import { AesEncryption } from '/@/utils/cipher';
|
||||
import { cacheCipher } from '/@/settings/encryptionSetting';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '用户账号',
|
||||
align: 'center',
|
||||
dataIndex: 'username',
|
||||
width: 100,
|
||||
fixed: 'left',
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
align: 'center',
|
||||
dataIndex: 'realname',
|
||||
fixed: 'left',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '头像',
|
||||
align: 'center',
|
||||
dataIndex: 'avatar',
|
||||
width: 100,
|
||||
customRender: ({ text, record }) => {
|
||||
const t = text ? text.replace(',', '') : null;
|
||||
return h(Image, {
|
||||
placeholder: true,
|
||||
src: getFileAccessHttpUrl(t),
|
||||
height: 50,
|
||||
width: 50,
|
||||
fallback: getFamaleDefaultImage(record.sex),
|
||||
previewMask: () => {
|
||||
return h(EyeOutlined, {
|
||||
style: {
|
||||
color: 'white',
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '性别',
|
||||
align: 'center',
|
||||
dataIndex: 'sex',
|
||||
width: 60,
|
||||
customRender: ({ text }) => {
|
||||
return render.renderDict(text, 'gender');
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '年龄',
|
||||
align: 'center',
|
||||
dataIndex: 'age',
|
||||
width: 60,
|
||||
},
|
||||
{
|
||||
title: '单位',
|
||||
align: 'center',
|
||||
dataIndex: ['secondDepart', 'departName'],
|
||||
},
|
||||
{
|
||||
title: '部门',
|
||||
align: 'center',
|
||||
dataIndex: ['depart', 'departName'],
|
||||
},
|
||||
{
|
||||
title: '身份证',
|
||||
align: 'center',
|
||||
dataIndex: 'idCard',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
align: 'center',
|
||||
dataIndex: 'phone',
|
||||
},
|
||||
{
|
||||
title: '职务',
|
||||
align: 'center',
|
||||
dataIndex: ['extension', 'empJob_dictText'],
|
||||
},
|
||||
{
|
||||
title: '编号',
|
||||
align: 'center',
|
||||
dataIndex: ['extension', 'empNo'],
|
||||
},
|
||||
{
|
||||
title: '家庭成员',
|
||||
align: 'center',
|
||||
dataIndex: 'familyNum',
|
||||
},
|
||||
];
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '姓名',
|
||||
field: 'realname',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '手机号',
|
||||
field: 'phone',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '身份证号',
|
||||
field: 'idCord',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '单位',
|
||||
field: 'orgCode',
|
||||
component: 'ApiSelect',
|
||||
componentProps: ({ formModel, schema }) => {
|
||||
const { secondSelectValue, secondSelectDisabled } = useDepartment({ schema, key: 'orgCode' });
|
||||
secondSelectValue();
|
||||
return {
|
||||
api: getSecondaryDepartmentList,
|
||||
resultField: 'result',
|
||||
labelField: 'departName',
|
||||
valueField: 'orgCode',
|
||||
immediate: true,
|
||||
onChange: () => {
|
||||
formModel.orgCode2 = '';
|
||||
},
|
||||
onDeselect: () => {
|
||||
formModel.orgCode = '';
|
||||
formModel.orgCode2 = '';
|
||||
},
|
||||
showSearch: true,
|
||||
filterOption: (input: string, option: any): boolean => {
|
||||
const str: string = input.toLowerCase();
|
||||
return option.label.toLowerCase().indexOf(str) >= 0;
|
||||
},
|
||||
disabled: secondSelectDisabled,
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '部门',
|
||||
field: 'orgCode2',
|
||||
component: 'ApiSelect',
|
||||
componentProps: ({ formModel, schema }) => {
|
||||
const { thirdSelectValue, thirdSelectDisabled } = useDepartment({ schema, key: 'orgCode' });
|
||||
thirdSelectValue();
|
||||
return {
|
||||
api: getThirdDepartListByOrgCode,
|
||||
resultField: 'list',
|
||||
labelField: 'departName',
|
||||
params: {
|
||||
orgCode: formModel?.orgCode || '12313',
|
||||
},
|
||||
valueField: 'orgCode',
|
||||
immediate: true,
|
||||
onFocus: () => {
|
||||
if (!formModel.orgCode) {
|
||||
return message.warn('请先选择单位!');
|
||||
}
|
||||
},
|
||||
showSearch: true,
|
||||
filterOption: (input: string, option: any): boolean => {
|
||||
const str: string = input.toLowerCase();
|
||||
return option.label.toLowerCase().indexOf(str) >= 0;
|
||||
},
|
||||
disabled: thirdSelectDisabled,
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export interface ComponentsType {
|
||||
key: number;
|
||||
title: string;
|
||||
component: Component;
|
||||
auth?: string;
|
||||
}
|
||||
export const componentsList: ComponentsType[] = [
|
||||
{
|
||||
key: 1,
|
||||
title: '健康档案',
|
||||
component: BasicInfo,
|
||||
},
|
||||
// {
|
||||
// key: 2,
|
||||
// title: '压力评估',
|
||||
// component: StressAssessment,
|
||||
// },
|
||||
{
|
||||
key: 2,
|
||||
title: '体检报告',
|
||||
component: ExaminationReport,
|
||||
},
|
||||
{
|
||||
key: 3,
|
||||
title: '心理评估',
|
||||
component: PsychologicalAssessment,
|
||||
},
|
||||
{
|
||||
key: 4,
|
||||
title: '健康评估',
|
||||
component: HealthAssessment,
|
||||
},
|
||||
{
|
||||
key: 5,
|
||||
title: '体检分析报告',
|
||||
component: AnalysisReport,
|
||||
},
|
||||
];
|
||||
|
||||
export function encryption() {
|
||||
const aes = new AesEncryption(cacheCipher);
|
||||
|
||||
function encrypt(word: string) {
|
||||
if (!word) return;
|
||||
return aes.encryptByAES(word);
|
||||
}
|
||||
|
||||
function decrypt(word: string) {
|
||||
if (!word) return;
|
||||
return aes.decryptByAES(word);
|
||||
}
|
||||
|
||||
return { encrypt, decrypt };
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
<template>
|
||||
<BasicTable @register="registerTable">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined" v-auth="'archives:arc_assess_value:add'"> 新增 </a-button>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, encryption, searchFormSchema } from '/@/views/archive/employeeFile/employeeFileList.data';
|
||||
import { list } from '/@/views/archive/employeeFile/employeeFileList.api';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
const router = useRouter();
|
||||
const userStore = useUserStore();
|
||||
console.log(userStore.getUserInfo?.roleCodes);
|
||||
const { encrypt } = encryption();
|
||||
//注册table数据
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: '健康信息',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: false,
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
if (params.orgCode2) {
|
||||
params.orgCode = params.orgCode2;
|
||||
}
|
||||
},
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
const [registerTable] = tableContext;
|
||||
|
||||
function userInfo(record: Recordable) {
|
||||
const second = record?.secondDepart?.departName ? `-${record?.secondDepart?.departName}` : '';
|
||||
const third = record?.depart?.departName ? `-${record?.depart?.departName}` : '';
|
||||
const unit = second == third ? second : second + third;
|
||||
return encrypt(record.realname + unit);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description:查看详情
|
||||
* @date 2023/7/17
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
router.replace({
|
||||
path: '/archive/employeeFile/employeeFileDetail',
|
||||
query: { id: record.id, type: 'detail', name: userInfo(record), sex: record.sex },
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @Description:编辑
|
||||
* @date 2023/7/17
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
router.replace({ path: '/archive/employeeFile/employeeFileEdit', query: { id: record.id, type: 'edit', name: userInfo(record) } });
|
||||
}
|
||||
function handleAdd() {
|
||||
router.push({ path: '/archive/employeeFile/employeeFileAdd', query: { type: 'add' } });
|
||||
}
|
||||
function getTableAction(record: Recordable) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'archives:arc_assess_value:edit',
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,742 @@
|
||||
<template>
|
||||
<BasicDrawer @register="registerDrawer" :title="props.title" width="70%" :showFooter="true" @ok="handleSubmit">
|
||||
<div style="position: absolute; left: 50%; top: 50%; transform: translate3d(-50%, -50%, 0); z-index: 99" v-if="spining">
|
||||
<a-spin tip="加载中..." />
|
||||
</div>
|
||||
<BasicForm @register="registerForm" class="jeecg-form">
|
||||
<template #first>
|
||||
<div class="sub">基本信息:</div>
|
||||
</template>
|
||||
<template #second>
|
||||
<div class="sub">住院信息:</div>
|
||||
</template>
|
||||
<template #third>
|
||||
<div class="sub">分类信息:</div>
|
||||
</template>
|
||||
<template #A>
|
||||
<div>
|
||||
<div class="label-class">A类(大病信息):</div>
|
||||
</div>
|
||||
<div style="flex: 1">
|
||||
<a-form :model="data1" class="option-form" ref="optionForm">
|
||||
<a-form-item-rest>
|
||||
<div class="table-d">
|
||||
<div class="table-td-d d1">大病名称</div>
|
||||
<div class="table-td-d d1">确诊年份</div>
|
||||
<div class="table-td-d d1">确诊医院</div>
|
||||
<div class="table-td-d d1">大病状态</div>
|
||||
<div class="table-td-d d1">治疗情况</div>
|
||||
<div class="table-td-d d1">
|
||||
<span style="color: #1890ff; cursor: pointer" @click="addItem('a')"> 添加 </span>
|
||||
</div>
|
||||
</div>
|
||||
<template v-for="(item, index) in data1.option" :key="`temp${index}`">
|
||||
<div class="table-d table-d-d">
|
||||
<div class="table-td-d tabled-td-d-d d1">
|
||||
<a-form-item
|
||||
:name="['option', index, 'name']"
|
||||
:rules="{
|
||||
required: true,
|
||||
// message: `请输入第${index}个大病名称`,
|
||||
message: '',
|
||||
}"
|
||||
>
|
||||
<JDictSelectTag
|
||||
style="max-width: 100%"
|
||||
v-model:value="item.name"
|
||||
placeholder="请选择大病名称"
|
||||
dictCode="ill_type"
|
||||
/>
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="table-td-d tabled-td-d-d d1">
|
||||
<a-form-item :name="['option', index, 'time']">
|
||||
<a-date-picker v-model:value="item.time" picker="year" value-format="YYYY" />
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="table-td-d tabled-td-d-d d1">
|
||||
<a-form-item :name="['option', index, 'hospital']">
|
||||
<a-input v-model:value="item.hospital" placeholder="请输入确诊医院" />
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="table-td-d tabled-td-d-d d1 user-group">
|
||||
<a-form-item
|
||||
:name="['option', index, 'status']"
|
||||
:rules="{
|
||||
required: true,
|
||||
// message: `请选择第${index}个大病状态`,
|
||||
message: '',
|
||||
}"
|
||||
>
|
||||
<JDictSelectTag
|
||||
style="max-width: 100%"
|
||||
v-model:value="item.status"
|
||||
placeholder="请选择大病状态"
|
||||
dictCode="archives_ill_status"
|
||||
/>
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="table-td-d tabled-td-d-d d1">
|
||||
<a-form-item :name="['option', index, 'cure']">
|
||||
<a-input v-model:value="item.cure" placeholder="请输入治疗情况" />
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="table-td-d tabled-td-d-d d1">
|
||||
<span style="color: #1890ff; cursor: pointer" @click="delItem('a', index)"> 删除 </span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</a-form-item-rest> </a-form
|
||||
><div style="display: flex"> </div>
|
||||
</div>
|
||||
</template>
|
||||
<template #B>
|
||||
<div style="display: flex">
|
||||
<div>
|
||||
<div class="label-class">B类(慢病信息):</div>
|
||||
</div>
|
||||
<div style="flex: 1">
|
||||
<a-form :model="data2" class="option-form" ref="optionForm">
|
||||
<a-form-item-rest>
|
||||
<div class="table-d">
|
||||
<div class="table-td-d d2">慢病名称</div>
|
||||
<div class="table-td-d d2">确诊年份</div>
|
||||
<div class="table-td-d d2">确诊医院</div>
|
||||
<div class="table-td-d d2">治疗情况</div>
|
||||
<div class="table-td-d d2">
|
||||
<span style="color: #1890ff; cursor: pointer" @click="addItem('b')"> 添加 </span>
|
||||
</div>
|
||||
</div>
|
||||
<template v-for="(item, index) in data2.option" :key="`temp${index}`">
|
||||
<div class="table-d table-d-d">
|
||||
<div class="table-td-d tabled-td-d-d d2">
|
||||
<a-form-item
|
||||
:name="['option', index, 'name']"
|
||||
:rules="{
|
||||
required: true,
|
||||
// message: `请输入第${index}个大病名称`,
|
||||
message: '',
|
||||
}"
|
||||
>
|
||||
<JDictSelectTag
|
||||
style="max-width: 100%"
|
||||
v-model:value="item.name"
|
||||
placeholder="请选择慢病名称"
|
||||
dictCode="hms_disease_type"
|
||||
/>
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="table-td-d tabled-td-d-d d2">
|
||||
<a-form-item :name="['option', index, 'time']">
|
||||
<a-date-picker v-model:value="item.time" picker="year" value-format="YYYY" />
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="table-td-d tabled-td-d-d d2">
|
||||
<a-form-item :name="['option', index, 'hospital']">
|
||||
<a-input v-model:value="item.hospital" placeholder="请输入确诊医院" />
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="table-td-d tabled-td-d-d d2">
|
||||
<a-form-item :name="['option', index, 'cure']">
|
||||
<a-input v-model:value="item.cure" placeholder="请输入治疗情况" />
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="table-td-d tabled-td-d-d d2">
|
||||
<span style="color: #1890ff; cursor: pointer" @click="delItem('b', index)"> 删除 </span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</a-form-item-rest>
|
||||
</a-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #C>
|
||||
<div style="display: flex">
|
||||
<div>
|
||||
<div class="label-class">C类重点指标异常:</div>
|
||||
</div>
|
||||
<div style="flex: 1">
|
||||
<a-form :model="data3" class="option-form" ref="optionForm">
|
||||
<a-form-item-rest>
|
||||
<div class="table-d">
|
||||
<div class="table-td-d d3">指标名称</div>
|
||||
<div class="table-td-d d3">指标值</div>
|
||||
<div class="table-td-d d3">参考范围</div>
|
||||
<div class="table-td-d d3">确诊年份</div>
|
||||
<div class="table-td-d d3">确诊医院</div>
|
||||
<div class="table-td-d d3">
|
||||
<span style="color: #1890ff; cursor: pointer" @click="addItem('c')"> 添加 </span>
|
||||
</div>
|
||||
</div>
|
||||
<template v-for="(item, index) in data3.option" :key="`temp${index}`">
|
||||
<div class="table-d table-d-d">
|
||||
<div class="table-td-d tabled-td-d-d d3">
|
||||
<a-input v-model:value="item.name" readonly />
|
||||
</div>
|
||||
<div class="table-td-d tabled-td-d-d d3">
|
||||
<a-input v-model:value="item.value" readonly />
|
||||
</div>
|
||||
<div class="table-td-d tabled-td-d-d d3">
|
||||
<a-input v-model:value="item.scope" readonly />
|
||||
</div>
|
||||
<div class="table-td-d tabled-td-d-d d3">
|
||||
<a-form-item :name="['option', index, 'hospital']">
|
||||
<a-input v-model:value="item.time" readonly />
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="table-td-d tabled-td-d-d d3">
|
||||
<a-form-item :name="['option', index, 'hospital']">
|
||||
<a-input v-model:value="item.hospital" readonly />
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="table-td-d tabled-td-d-d d3">
|
||||
<span style="color: #1890ff; cursor: pointer" @click="delItem('c', index)"> 删除 </span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</a-form-item-rest>
|
||||
</a-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #D>
|
||||
<div style="display: flex">
|
||||
<div>
|
||||
<div class="label-class">D类(健康风险评估):</div>
|
||||
</div>
|
||||
<div style="flex: 1">
|
||||
<a-form :model="data4" class="option-form" ref="optionForm">
|
||||
<a-form-item-rest>
|
||||
<div class="table-d">
|
||||
<div class="table-td-d d4">疾病名称</div>
|
||||
<div class="table-td-d d4">风险等级</div>
|
||||
<div class="table-td-d d4">评估年份</div>
|
||||
<div class="table-td-d d4">
|
||||
<span style="color: #1890ff; cursor: pointer" @click="addItem('d')"> 添加 </span>
|
||||
</div>
|
||||
</div>
|
||||
<template v-for="(item, index) in data4.option" :key="`temp${index}`">
|
||||
<div class="table-d table-d-d">
|
||||
<div class="table-td-d tabled-td-d-d d4">
|
||||
<a-input v-model:value="item.name" readonly />
|
||||
</div>
|
||||
<div class="table-td-d tabled-td-d-d d4">
|
||||
<a-input v-model:value="item.levelDesc" readonly />
|
||||
</div>
|
||||
<div class="table-td-d tabled-td-d-d d4">
|
||||
<a-input v-model:value="item.time" readonly />
|
||||
</div>
|
||||
<div class="table-td-d tabled-td-d-d d4">
|
||||
<span style="color: #1890ff; cursor: pointer" @click="delItem('d', index)"> 删除 </span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</a-form-item-rest>
|
||||
</a-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</BasicForm>
|
||||
<ChooseSome
|
||||
class="choose-some"
|
||||
:width="1000"
|
||||
@register="examinationModal"
|
||||
@select-some="onSelectUserOk"
|
||||
title="体检报告"
|
||||
zIndex="1001"
|
||||
:tableprops="tableProps"
|
||||
selection-type="checkbox"
|
||||
/>
|
||||
<ChooseSome
|
||||
class="choose-some"
|
||||
:width="1000"
|
||||
@register="examinationModal1"
|
||||
@select-some="onSelectUserOk1"
|
||||
title="评估结果"
|
||||
zIndex="1001"
|
||||
:tableprops="tableProps1"
|
||||
selection-type="checkbox"
|
||||
/>
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import BasicDrawer from '/@/components/Drawer/src/BasicDrawer.vue';
|
||||
import BasicForm from '/@/components/Form/src/BasicForm.vue';
|
||||
import { useDrawer, useDrawerInner } from '/@/components/Drawer';
|
||||
import { useForm } from '/@/components/Form';
|
||||
import { mSearchSchema, schemas, mColumns, mSearchSchema1, mColumns1 } from '/@/views/archive/fiveClassPeople/index.data';
|
||||
import { ref } from 'vue';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import {
|
||||
groupUserAApi,
|
||||
groupUserBApi,
|
||||
groupUserCApi,
|
||||
groupUserDApi,
|
||||
groupUserEApi,
|
||||
groupUserCLatestReportApi,
|
||||
groupUserDLatestReportApi,
|
||||
detailAApi,
|
||||
detailBApi,
|
||||
detailCApi,
|
||||
detailDApi,
|
||||
groupUserExtByUserIdApi,
|
||||
editByUserIdApi,
|
||||
} from '/@/views/archive/fiveClassPeople/index.api';
|
||||
import ChooseSome from '/@/views/compoents/chooseSome/index.vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
const props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: () => '编辑',
|
||||
},
|
||||
});
|
||||
|
||||
const spining = ref(false);
|
||||
|
||||
const data1 = ref<object>({
|
||||
option: [],
|
||||
});
|
||||
const itemA = ref<object>({
|
||||
name: '',
|
||||
time: '',
|
||||
hospital: '',
|
||||
status: '',
|
||||
});
|
||||
const data2 = ref<object>({
|
||||
option: [],
|
||||
});
|
||||
const itemB = ref<object>({
|
||||
name: '',
|
||||
time: '',
|
||||
hospital: '',
|
||||
});
|
||||
const data3 = ref<object>({
|
||||
option: [],
|
||||
});
|
||||
const data4 = ref<object>({
|
||||
option: [],
|
||||
});
|
||||
|
||||
const [examinationModal, { openDrawer }] = useDrawer();
|
||||
const [examinationModal1, { openDrawer: openDrawer1 }] = useDrawer();
|
||||
|
||||
const tableProps = ref({
|
||||
tableProps: {
|
||||
api: groupUserCLatestReportApi,
|
||||
columns: mColumns,
|
||||
canResize: false,
|
||||
immediate: false,
|
||||
clearSelectOnPageChange: false,
|
||||
rowKey: (record: Recordable) => {
|
||||
return JSON.stringify({
|
||||
peItemName: record?.peItemName,
|
||||
peResult: record?.peResult,
|
||||
printContext: record?.printContext,
|
||||
medicalYear: record?.medicalYear,
|
||||
hospitalName: record?.hospitalName,
|
||||
uniItemId: record?.uniItemId,
|
||||
});
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
params['userId'] = getFieldsValue()?.userId;
|
||||
return params;
|
||||
},
|
||||
afterFetch: (data) => {
|
||||
let result: any[] = [];
|
||||
|
||||
data.length > 0 &&
|
||||
data.map((item) => {
|
||||
if (item?.senResultRes && item?.senResultRes.length > 0) {
|
||||
item?.senResultRes.map((it) => {
|
||||
if (it?.thirdResultRes && it?.thirdResultRes.length > 0) {
|
||||
result = result.concat(it?.thirdResultRes);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
},
|
||||
formConfig: {
|
||||
schemas: mSearchSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: false,
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
labelWidth: 140,
|
||||
baseColProps: {
|
||||
xs: 12,
|
||||
sm: 12,
|
||||
md: 12,
|
||||
lg: 12,
|
||||
xl: 12,
|
||||
xxl: 12,
|
||||
},
|
||||
actionColOptions: {
|
||||
style: {
|
||||
paddingLeft: '144px',
|
||||
},
|
||||
span: 24,
|
||||
offset: 0,
|
||||
xs: 12,
|
||||
sm: 12,
|
||||
md: 12,
|
||||
lg: 12,
|
||||
xl: 12,
|
||||
xxl: 12,
|
||||
},
|
||||
},
|
||||
showActionColumn: false,
|
||||
},
|
||||
});
|
||||
const tableProps1 = ref({
|
||||
tableProps: {
|
||||
api: groupUserDLatestReportApi,
|
||||
columns: mColumns1,
|
||||
canResize: false,
|
||||
immediate: false,
|
||||
clearSelectOnPageChange: false,
|
||||
rowKey: (record: Recordable) => {
|
||||
return JSON.stringify({
|
||||
name: record?.name,
|
||||
levelDesc: record?.levelDesc,
|
||||
level: record?.level,
|
||||
year: record?.year + '',
|
||||
});
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
params['userId'] = getFieldsValue()?.userId;
|
||||
return params;
|
||||
},
|
||||
showTableSetting: true,
|
||||
tableSetting: {
|
||||
redo: true,
|
||||
setting: false,
|
||||
},
|
||||
// afterFetch: (data) => {
|
||||
// let result: any[] = [];
|
||||
//
|
||||
// data.length > 0 &&
|
||||
// data.map((item) => {
|
||||
// if (item?.senResultRes && item?.senResultRes.length > 0) {
|
||||
// item?.senResultRes.map((it) => {
|
||||
// if (it?.thirdResultRes && it?.thirdResultRes.length > 0) {
|
||||
// result = result.concat(it?.thirdResultRes);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// return result;
|
||||
// },
|
||||
useSearchForm: false,
|
||||
formConfig: {
|
||||
schemas: mSearchSchema1,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: false,
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
labelWidth: 120,
|
||||
baseColProps: {
|
||||
xs: 12,
|
||||
sm: 12,
|
||||
md: 12,
|
||||
lg: 12,
|
||||
xl: 12,
|
||||
xxl: 12,
|
||||
},
|
||||
actionColOptions: {
|
||||
style: {
|
||||
paddingLeft: '122px',
|
||||
},
|
||||
span: 24,
|
||||
offset: 0,
|
||||
xs: 12,
|
||||
sm: 12,
|
||||
md: 12,
|
||||
lg: 12,
|
||||
xl: 12,
|
||||
xxl: 12,
|
||||
},
|
||||
},
|
||||
showActionColumn: false,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
|
||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
||||
spining.value = true;
|
||||
await resetFields();
|
||||
|
||||
data1.value.option = [];
|
||||
data2.value.option = [];
|
||||
data3.value.option = [];
|
||||
data4.value.option = [];
|
||||
|
||||
let res = {};
|
||||
|
||||
try {
|
||||
switch (data.record.userGroup) {
|
||||
case 'a':
|
||||
const { records: r1 } = await detailAApi({ pageNo: 1, pageSize: 9999, userId: data.record.userId });
|
||||
res = await groupUserExtByUserIdApi({ pageNo: 1, pageSize: 9999, userId: data.record.userId });
|
||||
data1.value.option = r1;
|
||||
break;
|
||||
case 'b':
|
||||
const { records: r2 } = await detailBApi({ pageNo: 1, pageSize: 9999, userId: data.record.userId });
|
||||
res = await groupUserExtByUserIdApi({ pageNo: 1, pageSize: 9999, userId: data.record.userId });
|
||||
data2.value.option = r2;
|
||||
break;
|
||||
case 'c':
|
||||
const { records: r3 } = await detailCApi({ pageNo: 1, pageSize: 9999, userId: data.record.userId });
|
||||
data3.value.option = r3;
|
||||
break;
|
||||
case 'd':
|
||||
const { records: r4 } = await detailDApi({ pageNo: 1, pageSize: 9999, userId: data.record.userId });
|
||||
data4.value.option = r4.map((item: any) => ({
|
||||
name: item?.name,
|
||||
levelDesc: item?.levelDesc,
|
||||
level: item?.level,
|
||||
time: item?.time,
|
||||
}));
|
||||
console.log(data4.value.option);
|
||||
break;
|
||||
case 'e':
|
||||
break;
|
||||
}
|
||||
await setFieldsValue({
|
||||
...data.record,
|
||||
...res,
|
||||
});
|
||||
|
||||
setDrawerProps({
|
||||
confirmLoading: false,
|
||||
});
|
||||
} finally {
|
||||
spining.value = false;
|
||||
}
|
||||
});
|
||||
|
||||
function addItem(type) {
|
||||
switch (type) {
|
||||
case 'a':
|
||||
data1.value?.option.push(JSON.parse(JSON.stringify(itemA.value)));
|
||||
break;
|
||||
case 'b':
|
||||
data2.value?.option.push(JSON.parse(JSON.stringify(itemB.value)));
|
||||
break;
|
||||
case 'c':
|
||||
const list = data3.value.option.map((item: any) => {
|
||||
return JSON.stringify({
|
||||
peItemName: item?.name,
|
||||
peResult: item?.value,
|
||||
printContext: item?.scope,
|
||||
medicalYear: item?.time,
|
||||
hospitalName: item?.hospital,
|
||||
uniItemId: item?.uniItemId,
|
||||
});
|
||||
});
|
||||
openDrawer(true, {
|
||||
selectedRowKeys: list,
|
||||
});
|
||||
break;
|
||||
case 'd':
|
||||
const list1 = data4.value.option.map((item: any) => {
|
||||
return JSON.stringify({
|
||||
name: item?.name,
|
||||
levelDesc: item?.levelDesc,
|
||||
level: item?.level,
|
||||
year: item?.time + '',
|
||||
});
|
||||
});
|
||||
console.log(list1);
|
||||
openDrawer1(true, {
|
||||
selectedRowKeys: list1,
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
function delItem(type, index) {
|
||||
switch (type) {
|
||||
case 'a':
|
||||
data1.value?.option.splice(index, 1);
|
||||
break;
|
||||
case 'b':
|
||||
data2.value?.option.splice(index, 1);
|
||||
break;
|
||||
case 'c':
|
||||
data3.value?.option.splice(index, 1);
|
||||
break;
|
||||
case 'd':
|
||||
data4.value?.option.splice(index, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const [registerForm, { setFieldsValue, resetFields, validate, getFieldsValue }] = useForm({
|
||||
schemas,
|
||||
showAdvancedButton: false,
|
||||
showActionButtonGroup: false,
|
||||
labelWidth: 130,
|
||||
});
|
||||
|
||||
const optionForm = ref();
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const values = await validate();
|
||||
let values1;
|
||||
// if (values['userGroup'] != 'e') {
|
||||
if (!['c', 'd', 'e'].includes(values['userGroup'])) {
|
||||
values1 = await optionForm.value.validate();
|
||||
}
|
||||
|
||||
let params =
|
||||
values['userGroup'] == 'e'
|
||||
? { userId: values.userId }
|
||||
: {
|
||||
userId: values.userId,
|
||||
userGroup: values.userGroup,
|
||||
list: values['userGroup'] === 'c' ? data3.value.option : values['userGroup'] === 'd' ? data4.value.option : values1?.option,
|
||||
};
|
||||
|
||||
console.log(params);
|
||||
if (values['userGroup'] !== 'e' && (!params?.list || params?.list.length === 0)) return message.warn('请填写分类信息');
|
||||
setDrawerProps({
|
||||
confirmLoading: true,
|
||||
});
|
||||
|
||||
switch (values['userGroup']) {
|
||||
case 'a':
|
||||
await editByUserIdApi(values);
|
||||
await groupUserAApi(params);
|
||||
break;
|
||||
case 'b':
|
||||
await editByUserIdApi(values);
|
||||
await groupUserBApi(params);
|
||||
break;
|
||||
case 'c':
|
||||
await groupUserCApi(params);
|
||||
break;
|
||||
case 'd':
|
||||
await groupUserDApi(params);
|
||||
break;
|
||||
case 'e':
|
||||
await groupUserEApi(params);
|
||||
break;
|
||||
}
|
||||
|
||||
closeDrawer();
|
||||
|
||||
emit('success', values['userGroup']);
|
||||
} finally {
|
||||
setDrawerProps({
|
||||
confirmLoading: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function onSelectUserOk(e) {
|
||||
data3.value.option =
|
||||
e.length > 0
|
||||
? e.map((item) => {
|
||||
return {
|
||||
name: JSON.parse(item)?.peItemName,
|
||||
value: JSON.parse(item)?.peResult,
|
||||
scope: JSON.parse(item)?.printContext,
|
||||
time: JSON.parse(item)?.medicalYear,
|
||||
hospital: JSON.parse(item)?.hospitalName,
|
||||
uniItemId: JSON.parse(item)?.uniItemId,
|
||||
};
|
||||
})
|
||||
: [];
|
||||
}
|
||||
|
||||
function onSelectUserOk1(e) {
|
||||
console.log(e);
|
||||
data4.value.option =
|
||||
e.length > 0
|
||||
? e.map((item) => {
|
||||
return {
|
||||
name: JSON.parse(item)?.name,
|
||||
levelDesc: JSON.parse(item)?.levelDesc,
|
||||
level: JSON.parse(item)?.level,
|
||||
time: JSON.parse(item)?.year,
|
||||
};
|
||||
})
|
||||
: [];
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.table-d {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
border-top: 1px solid #f0f0f0;
|
||||
border-right: 1px solid #f0f0f0;
|
||||
.table-td-d {
|
||||
border-left: 1px solid #f0f0f0;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
background-color: #fafafa;
|
||||
height: 50px;
|
||||
line-height: 50px !important;
|
||||
text-align: center;
|
||||
}
|
||||
.d1 {
|
||||
width: calc(100% / 6);
|
||||
}
|
||||
.d2 {
|
||||
width: 20%;
|
||||
}
|
||||
.d4 {
|
||||
width: 25%;
|
||||
}
|
||||
.d3 {
|
||||
width: calc(100% / 6);
|
||||
}
|
||||
.table-d-d {
|
||||
background-color: #ffffff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.option-form {
|
||||
.ant-form-item {
|
||||
line-height: 50px !important;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.user-group .ant-select-selector) {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.sub {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
:deep(.ant-form-item-label .form_item_b-class) {
|
||||
background-color: red;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.label-class {
|
||||
padding-left: 20px;
|
||||
position: relative;
|
||||
|
||||
&::before {
|
||||
position: absolute;
|
||||
font-size: 14px;
|
||||
top: 1px;
|
||||
left: 10px;
|
||||
color: #ff4d4f;
|
||||
content: '*';
|
||||
font-family: SimSun, sans-serif;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,45 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
export enum Api {
|
||||
list = '/health-system/sys/user/listGroupUser',
|
||||
groupUserCLatestReport = '/health-archives/archives/groupUserC/latestReport',
|
||||
groupUserDLatestReport = '/health-archives/archives/groupUserD/latestReport',
|
||||
groupUserA = '/health-archives/archives/groupUserA/addBatch',
|
||||
groupUserB = '/health-archives/archives/groupUserB/addBatch',
|
||||
groupUserC = '/health-archives/archives/groupUserC/addBatch',
|
||||
groupUserD = '/health-archives/archives/groupUserD/addBatch',
|
||||
groupUserE = '/health-archives/archives/groupUserA/updateUserToE',
|
||||
groupUserAImportExcel = '/health-archives/archives/groupUserA/importExcel',
|
||||
groupUserBImportExcel = '/health-archives/archives/groupUserB/importExcel',
|
||||
groupImportExcel = '/health-archives/archives/groupUserC/importExcelBatchUpdateUserGroup',
|
||||
autoAddC = '/health-archives/archives/groupUserC/autoAddC',
|
||||
autoAddD = '/health-archives/archives/groupUserD/autoAddD',
|
||||
detailA = '/health-archives/archives/groupUserA/list',
|
||||
groupUserExtByUserId = '/archives/groupUserExt/groupUserExtByUserId',
|
||||
detailB = '/health-archives/archives/groupUserB/list',
|
||||
detailC = '/health-archives/archives/groupUserC/list',
|
||||
detailD = '/health-archives/archives/groupUserD/list',
|
||||
editByUserId = '/health-archives/archives/groupUserExt/editByUserId',
|
||||
excelImportTemplate = '/health-archives/archives/groupUserA/excelImportTemplate',
|
||||
listGroupUserExport = '/health-system/sys/user/listGroupUserExport', // 五类人群导出
|
||||
}
|
||||
|
||||
export const listApi = (params) => defHttp.get({ url: Api.list, params });
|
||||
export const groupUserCLatestReportApi = (params) => defHttp.get({ url: Api.groupUserCLatestReport, params });
|
||||
export const groupUserDLatestReportApi = (params) => defHttp.get({ url: Api.groupUserDLatestReport, params });
|
||||
export const groupUserAApi = (params) => defHttp.post({ url: Api.groupUserA, params });
|
||||
export const groupUserBApi = (params) => defHttp.post({ url: Api.groupUserB, params });
|
||||
export const groupUserCApi = (params) => defHttp.post({ url: Api.groupUserC, params });
|
||||
export const groupUserDApi = (params) => defHttp.post({ url: Api.groupUserD, params });
|
||||
export const groupUserEApi = (params) => defHttp.post({ url: Api.groupUserE, params }, { joinParamsToUrl: true });
|
||||
export const autoAddCApi = () => defHttp.post({ url: Api.autoAddC });
|
||||
export const autoAddDApi = () => defHttp.post({ url: Api.autoAddD });
|
||||
|
||||
export const groupUserExtByUserIdApi = (params) => defHttp.get({ url: Api.groupUserExtByUserId, params }, { joinParamsToUrl: true });
|
||||
export const detailAApi = (params) => defHttp.get({ url: Api.detailA, params }, { joinParamsToUrl: true });
|
||||
export const detailBApi = (params) => defHttp.get({ url: Api.detailB, params }, { joinParamsToUrl: true });
|
||||
export const detailCApi = (params) => defHttp.get({ url: Api.detailC, params }, { joinParamsToUrl: true });
|
||||
export const detailDApi = (params) => defHttp.get({ url: Api.detailD, params }, { joinParamsToUrl: true });
|
||||
export const editByUserIdApi = (params) => defHttp.post({ url: Api.editByUserId, params }, { successNeedMessage: false });
|
||||
export const excelImportTemplateUrl = Api.excelImportTemplate;
|
||||
export const listGroupUserExportApi = (params) => defHttp.get({ url: Api.listGroupUserExport, params }, { joinParamsToUrl: true });
|
||||
@@ -0,0 +1,274 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import dayjs from 'dayjs';
|
||||
import { orgSearchInfo } from '/@/utils/orgSearchInfo';
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
...orgSearchInfo(),
|
||||
{
|
||||
label: '身份证号',
|
||||
field: 'idCard',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '健康分类',
|
||||
field: 'userGroup',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: () => ({ dictCode: 'user_group' }),
|
||||
},
|
||||
];
|
||||
export const mSearchSchema: FormSchema[] = [
|
||||
{
|
||||
label: '重点指标项',
|
||||
field: 'peItemName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '是否异常项',
|
||||
field: 'colour',
|
||||
component: 'Select',
|
||||
componentProps: () => ({
|
||||
options: [
|
||||
{ label: '否', value: '0' },
|
||||
{ label: '是', value: '1' },
|
||||
],
|
||||
}),
|
||||
},
|
||||
];
|
||||
export const mSearchSchema1: FormSchema[] = [
|
||||
{
|
||||
label: '疾病名称',
|
||||
field: 'name',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '风险等级',
|
||||
field: 'illName',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
defaultValue: '体重',
|
||||
},
|
||||
];
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '单位',
|
||||
dataIndex: 'secondDepart',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '部门',
|
||||
dataIndex: 'depart',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'realName',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '身份证号',
|
||||
dataIndex: 'idCard',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '健康分类',
|
||||
dataIndex: 'userGroup_dictText',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '更新时间',
|
||||
dataIndex: 'userGroupUpdateTime',
|
||||
align: 'center',
|
||||
customRender: ({ text }) => {
|
||||
return text ? dayjs(text).format('YYYY-MM-DD HH:mm:ss') : '';
|
||||
},
|
||||
},
|
||||
];
|
||||
export const mColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '重点指标项',
|
||||
dataIndex: 'peItemName',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '指标值',
|
||||
dataIndex: 'peResult',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '参考范围',
|
||||
dataIndex: 'printContext',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '检查年份',
|
||||
dataIndex: 'medicalYear',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '检查医院',
|
||||
dataIndex: 'hospitalName',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '是否异常项',
|
||||
dataIndex: 'colour',
|
||||
customRender: ({ text }) => (text == '0' ? '否' : '是'),
|
||||
align: 'center',
|
||||
},
|
||||
];
|
||||
export const mColumns1: BasicColumn[] = [
|
||||
{
|
||||
title: '疾病名称',
|
||||
dataIndex: 'name',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '风险等级',
|
||||
dataIndex: 'levelDesc',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '评估年份',
|
||||
dataIndex: 'year',
|
||||
align: 'center',
|
||||
},
|
||||
];
|
||||
export const schemas: FormSchema[] = [
|
||||
{
|
||||
label: '',
|
||||
field: 'first',
|
||||
component: 'Input',
|
||||
slot: 'first',
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
field: 'userId',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
label: '单位',
|
||||
field: 'secondDepart',
|
||||
component: 'Input',
|
||||
componentProps: () => ({ disabled: true }),
|
||||
},
|
||||
{
|
||||
label: '部门',
|
||||
field: 'depart',
|
||||
component: 'Input',
|
||||
componentProps: () => ({ disabled: true }),
|
||||
},
|
||||
{
|
||||
label: '姓名',
|
||||
field: 'realName',
|
||||
component: 'Input',
|
||||
componentProps: () => ({ disabled: true }),
|
||||
},
|
||||
{
|
||||
label: '身份证号',
|
||||
field: 'idCard',
|
||||
component: 'Input',
|
||||
componentProps: () => ({ disabled: true }),
|
||||
},
|
||||
{
|
||||
label: '健康分类',
|
||||
field: 'userGroup',
|
||||
component: 'JDictSelectTag',
|
||||
required: true,
|
||||
componentProps: () => ({ dictCode: 'user_group' }),
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
field: 'second',
|
||||
component: 'Input',
|
||||
slot: 'second',
|
||||
ifShow: ({ values }) => ['a', 'b'].includes(values.userGroup),
|
||||
},
|
||||
{
|
||||
label: '住院状态',
|
||||
field: 'status',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: () => ({ dictCode: 'group_user_status' }),
|
||||
ifShow: ({ values }) => ['a', 'b'].includes(values.userGroup),
|
||||
},
|
||||
{
|
||||
label: '所在医院',
|
||||
field: 'hospital',
|
||||
component: 'Input',
|
||||
ifShow: ({ values }) => ['a', 'b'].includes(values.userGroup),
|
||||
},
|
||||
{
|
||||
label: '住院时间',
|
||||
field: 'hospitalTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: () => ({ format: 'YYYY-MM-DD', valueFormat: 'YYYY-MM-DD', style: { width: '100%' } }),
|
||||
ifShow: ({ values }) => ['a', 'b'].includes(values.userGroup),
|
||||
},
|
||||
{
|
||||
label: '住院次数',
|
||||
field: 'hospitalNum',
|
||||
component: 'InputNumber',
|
||||
componentProps: () => ({ dictCode: 'user_group', style: { width: '100%' } }),
|
||||
ifShow: ({ values }) => ['a', 'b'].includes(values.userGroup),
|
||||
},
|
||||
{
|
||||
label: '联系人',
|
||||
field: 'contact',
|
||||
component: 'Input',
|
||||
componentProps: () => ({ dictCode: 'user_group' }),
|
||||
ifShow: ({ values }) => ['a', 'b'].includes(values.userGroup),
|
||||
},
|
||||
{
|
||||
label: '联系电话',
|
||||
field: 'contactMobile',
|
||||
component: 'Input',
|
||||
componentProps: () => ({ dictCode: 'user_group' }),
|
||||
rules: [
|
||||
// { required: true, message: '请输入联系电话', trigger: 'blur' },
|
||||
{ pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误' },
|
||||
],
|
||||
ifShow: ({ values }) => ['a', 'b'].includes(values.userGroup),
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
field: 'third',
|
||||
component: 'Input',
|
||||
slot: 'third',
|
||||
ifShow: ({ values }) => ['a', 'b', 'c', 'd'].includes(values.userGroup),
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
field: 'idCard',
|
||||
component: 'Input',
|
||||
slot: 'A',
|
||||
ifShow: ({ values }) => values.userGroup == 'a',
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
field: 'idCard',
|
||||
component: 'Input',
|
||||
slot: 'B',
|
||||
ifShow: ({ values }) => values.userGroup == 'b',
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
field: 'idCard',
|
||||
component: 'Input',
|
||||
slot: 'C',
|
||||
ifShow: ({ values }) => values.userGroup == 'c',
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
field: 'idCard',
|
||||
component: 'Input',
|
||||
slot: 'D',
|
||||
ifShow: ({ values }) => values.userGroup == 'd',
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,254 @@
|
||||
<template>
|
||||
<BasicTable @register="registerTable">
|
||||
<template #tableTitle>
|
||||
<a-button v-auth="'archives:group_user_batch:big'" type="primary" preIcon="ant-design:import-outlined" @click="downloadTemplate1">
|
||||
下载大病人员模板</a-button
|
||||
>
|
||||
<a-upload
|
||||
v-auth="'archives:group_user_batch:big'"
|
||||
name="file"
|
||||
:showUploadList="false"
|
||||
:customRequest="onImportXls1"
|
||||
accept=".xlsx, .xls, application/vnd.ms-excel-=='"
|
||||
>
|
||||
<a-button type="primary" preIcon="ant-design:import-outlined" :loading="bigLoading">导入大病人员</a-button>
|
||||
</a-upload>
|
||||
<a-button v-auth="'archives:group_user_batch:slow'" type="primary" preIcon="ant-design:import-outlined" @click="downloadTemplate2">
|
||||
下载慢病人员模板</a-button
|
||||
>
|
||||
<a-upload
|
||||
v-auth="'archives:group_user_batch:slow'"
|
||||
name="file"
|
||||
:showUploadList="false"
|
||||
:customRequest="onImportXls2"
|
||||
accept=".xlsx, .xls, application/vnd.ms-excel-=='"
|
||||
>
|
||||
<a-button type="primary" preIcon="ant-design:import-outlined" :loading="slowLoading">导入慢病人员</a-button>
|
||||
</a-upload>
|
||||
|
||||
<a-button type="primary" preIcon="ant-design:plus-outlined" v-auth="'archives:group_user_batch:automaticAbnormal'" @click="automatic1">
|
||||
自动添加最新体检异常项
|
||||
</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:plus-outlined" v-auth="'archives:group_user_batch:automaticResult'" @click="automatic2">
|
||||
自动添加评估结果
|
||||
</a-button>
|
||||
|
||||
<a-button v-auth="'archives:group_user_batch:importExcel'" type="primary" preIcon="ant-design:import-outlined" @click="downloadTemplate3">
|
||||
下载批量修改导入模板
|
||||
</a-button>
|
||||
<a-upload
|
||||
v-auth="'archives:group_user_batch:importExcel'"
|
||||
name="file"
|
||||
:showUploadList="false"
|
||||
:customRequest="onImportXls3"
|
||||
accept=".xlsx, .xls, application/vnd.ms-excel-=='"
|
||||
>
|
||||
<a-button type="primary">批量修改导入</a-button>
|
||||
</a-upload>
|
||||
<a-button v-auth="'archives:group_user_batch:exportFivePeople'" type="primary" preIcon="ant-design:export-outlined" @click="exportReport">
|
||||
导出
|
||||
</a-button>
|
||||
<a-button
|
||||
v-auth="'archives:group_user_batch:exportFivePeopleRecord'"
|
||||
preIcon="ant-design:search-outlined"
|
||||
@click="handleLookRecord"
|
||||
type="primary"
|
||||
>查看导出记录
|
||||
</a-button>
|
||||
<!-- <a-button v-auth="'archives:group_user_batch:importExcel'" @click="handleLookRecord" type="primary"> 查看批量修改导入记录 </a-button>-->
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<index-drawer @register="registerDrawer" @success="handleSuccess" />
|
||||
<!-- <ExportUtil task-code="batchUpdateUserGroup" :params="{ handleType: '2' }" @register="registerExport" />-->
|
||||
<ExportUtil task-code="groupUserTaskCode" @register="registerExport" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import BasicTable from '/@/components/Table/src/BasicTable.vue';
|
||||
import { TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import {
|
||||
listApi,
|
||||
Api,
|
||||
autoAddCApi,
|
||||
autoAddDApi,
|
||||
excelImportTemplateUrl,
|
||||
listGroupUserExportApi,
|
||||
} from '/@/views/archive/fiveClassPeople/index.api';
|
||||
import { columns, searchFormSchema } from '/@/views/archive/fiveClassPeople/index.data';
|
||||
import IndexDrawer from '/@/views/archive/fiveClassPeople/components/indexDrawer.vue';
|
||||
import { useDrawer } from '/@/components/Drawer';
|
||||
import { useMethods } from '/@/hooks/system/useMethods';
|
||||
import { downloadExcel } from '/@/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/toolHooks';
|
||||
import { ref } from 'vue';
|
||||
import ExportUtil from '/@/utils/export/exportUtil.vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
const [registerExport, { openDrawer: openExportDrawer }] = useDrawer();
|
||||
|
||||
function exportReport() {
|
||||
const val = getForm().getFieldsValue();
|
||||
listGroupUserExportApi(val);
|
||||
}
|
||||
function handleLookRecord() {
|
||||
openExportDrawer(true, {});
|
||||
}
|
||||
|
||||
const { hasParamsImportXls, handleExportXlsx } = useMethods();
|
||||
|
||||
const bigLoading = ref(false);
|
||||
const slowLoading = ref(false);
|
||||
|
||||
function getTableAction(record: Recordable) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onclick: handleEdit.bind(null, record),
|
||||
auth: 'archives:edit-button',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
openDrawer(true, {
|
||||
record,
|
||||
});
|
||||
}
|
||||
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
api: listApi,
|
||||
columns,
|
||||
canResize: false,
|
||||
beforeFetch: (params) => {
|
||||
if (params['orgCode2']) {
|
||||
params['orgCode'] = params['orgCode2'];
|
||||
} else {
|
||||
params['orgCode'] = params['orgCode1'];
|
||||
}
|
||||
return params;
|
||||
},
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: false,
|
||||
fieldMapToNumber: [],
|
||||
},
|
||||
showIndexColumn: true,
|
||||
indexColumnProps: {
|
||||
width: 80,
|
||||
},
|
||||
actionColumn: {
|
||||
width: 80,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, { reload, getForm }] = tableContext;
|
||||
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
}
|
||||
|
||||
function onImportXls1(d) {
|
||||
const size = d.file.size;
|
||||
const m10 = 1024 * 1024 * 10;
|
||||
if (size > m10) {
|
||||
console.log('文件过大');
|
||||
}
|
||||
bigLoading.value = true;
|
||||
console.log(d, 'dddddd');
|
||||
hasParamsImportXls(d, Api.groupUserAImportExcel, { noMessage: true }, (res) => {
|
||||
if (res?.code != 200) {
|
||||
alert(
|
||||
res?.result
|
||||
? res?.result
|
||||
.map((item: any) => {
|
||||
return item.substring(0, item.length) + ';';
|
||||
})
|
||||
.join('\n')
|
||||
: res?.message
|
||||
);
|
||||
}
|
||||
reload();
|
||||
}).finally(() => {
|
||||
bigLoading.value = false;
|
||||
});
|
||||
}
|
||||
function onImportXls2(d) {
|
||||
const size = d.file.size;
|
||||
const m10 = 1024 * 1024 * 10;
|
||||
if (size > m10) {
|
||||
console.log('文件过大');
|
||||
}
|
||||
slowLoading.value = true;
|
||||
hasParamsImportXls(d, Api.groupUserBImportExcel, { noMessage: true }, (res) => {
|
||||
alert(
|
||||
res?.result
|
||||
? res?.result
|
||||
.map((item: any) => {
|
||||
return item.substring(0, item.length) + ';';
|
||||
})
|
||||
.join('\n')
|
||||
: res?.message
|
||||
);
|
||||
reload();
|
||||
}).finally(() => {
|
||||
slowLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
function onImportXls3(file) {
|
||||
hasParamsImportXls(file, Api.groupImportExcel, {}, (res) => {
|
||||
alert(
|
||||
res?.result
|
||||
? res?.result
|
||||
.map((item: any) => {
|
||||
return item.substring(0, item.length) + ';';
|
||||
})
|
||||
.join('\n')
|
||||
: res?.message
|
||||
);
|
||||
reload();
|
||||
}).finally(() => {
|
||||
slowLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
function downloadTemplate1() {
|
||||
// downloadExcel('/static/fiveClass/big.xlsx', '大病人员导入模板');
|
||||
downLoadFile('1');
|
||||
}
|
||||
function downloadTemplate2() {
|
||||
// downloadExcel('/static/fiveClass/slow.xlsx', '慢病人员导入模板');
|
||||
downLoadFile('2');
|
||||
}
|
||||
function downloadTemplate3() {
|
||||
downloadExcel('/static/fiveClass/large.xlsx', '批量修改导入模板');
|
||||
}
|
||||
|
||||
async function downLoadFile(type) {
|
||||
await handleExportXlsx(type === '1' ? '大病人员导入模板' : '慢病人员导入模板', excelImportTemplateUrl, { type: type });
|
||||
// try {
|
||||
// let res: any = await excelImportTemplateApi({ type: type });
|
||||
// let blob = new Blob([res], { type: 'application/octet-stream' });
|
||||
// let link = document.createElement('a');
|
||||
// link.href = window.URL.createObjectURL(blob);
|
||||
// link.download = (type === 1 ? '大病人员导入模板' : '慢病人员导入模板') + '.xlsx';
|
||||
// link.click();
|
||||
// } catch {}
|
||||
}
|
||||
|
||||
function automatic1() {
|
||||
autoAddCApi();
|
||||
}
|
||||
function automatic2() {
|
||||
autoAddDApi();
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="less"></style>
|
||||
@@ -0,0 +1,41 @@
|
||||
// noinspection Eslint
|
||||
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/health-archives/housenew/healthHouseOrderReservationNew/list',
|
||||
deleteBatch = '/health-archives/housenew/healthHouseOrderReservationNew/deleteBatch',
|
||||
allHouseList = '/health-archives/housenew/healthHouseNew/allHouse',
|
||||
}
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
/**
|
||||
*健康室列表
|
||||
*
|
||||
*/
|
||||
|
||||
export const allHouseList = (params) => defHttp.get({ url: Api.allHouseList, params });
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
*/
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.post({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,199 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { allHouseList } from '/@/views/archive/healthCabin/bespeakManage/bespeakManage.api';
|
||||
import { orgSearchInfo } from '/@/utils/orgSearchInfo';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '预约单号',
|
||||
align: 'center',
|
||||
dataIndex: 'reservationNo',
|
||||
},
|
||||
{
|
||||
title: '用户姓名 ',
|
||||
align: 'center',
|
||||
dataIndex: 'realName',
|
||||
},
|
||||
{
|
||||
title: '用户性别',
|
||||
align: 'center',
|
||||
dataIndex: 'sex_dictText',
|
||||
},
|
||||
{
|
||||
title: '用户所属部门',
|
||||
align: 'center',
|
||||
dataIndex: 'thirdDepart',
|
||||
},
|
||||
{
|
||||
title: '用户联系方式',
|
||||
align: 'center',
|
||||
dataIndex: 'mobile',
|
||||
},
|
||||
{
|
||||
title: '预约状态',
|
||||
align: 'center',
|
||||
dataIndex: 'reservationStatus',
|
||||
|
||||
customRender: ({ text }) => {
|
||||
return render.renderDict(text, 'health_reservation');
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '预约健康室',
|
||||
align: 'center',
|
||||
dataIndex: 'houseName',
|
||||
},
|
||||
{
|
||||
title: '设备名称',
|
||||
align: 'center',
|
||||
dataIndex: 'deviceName',
|
||||
},
|
||||
{
|
||||
title: '预约日期',
|
||||
align: 'center',
|
||||
dataIndex: 'reservationDate',
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
align: 'center',
|
||||
dataIndex: 'startTime',
|
||||
},
|
||||
{
|
||||
title: '完成时间',
|
||||
align: 'center',
|
||||
dataIndex: 'endTime',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
align: 'center',
|
||||
dataIndex: 'createDate',
|
||||
},
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '用户姓名',
|
||||
field: 'realName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '预约状态',
|
||||
field: 'status',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
// @ts-ignore//@ts-ignore
|
||||
dictCode: 'health_reservation',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '预约健康室',
|
||||
field: 'houseCode',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: allHouseList,
|
||||
resultField: 'list',
|
||||
labelField: 'houseName',
|
||||
valueField: 'houseCode',
|
||||
immediate: false,
|
||||
placeholder: '请选择预约健康室',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '预约日期',
|
||||
field: 'time',
|
||||
component: 'DatePicker',
|
||||
componentProps: () => ({ format: 'YYYY-MM-DD', valueFormat: 'YYYY-MM-DD', style: { width: '100%' } }),
|
||||
},
|
||||
...orgSearchInfo({ orgName: '二级部门', deptName: '三级部门' }),
|
||||
{
|
||||
label: '设备名称',
|
||||
field: 'deviceName',
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
||||
|
||||
export const schemas: FormSchema[] = [
|
||||
{
|
||||
label: '预约单号',
|
||||
field: 'reservationNo',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '用户姓名',
|
||||
field: 'realName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '预约健康室',
|
||||
field: 'houseName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '用户部门',
|
||||
field: 'thirdDepart',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '设备名称',
|
||||
field: 'deviceName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '用户性别',
|
||||
field: 'sex_dictText',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '设备编号',
|
||||
field: 'deviceCode',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '用户联系方式',
|
||||
field: 'mobile',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '创建时间',
|
||||
field: 'createDate',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '预约时间',
|
||||
field: 'reservationDate',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '取消时间',
|
||||
field: 'cancelDate',
|
||||
component: 'Input',
|
||||
show: ({ values }) => {
|
||||
return values.reservationStatus === '4' || values.reservationStatus === '5';
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '使用时间',
|
||||
field: 'useDate',
|
||||
component: 'Input',
|
||||
show: ({ values }) => {
|
||||
return values.reservationStatus === '2';
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '归还时间',
|
||||
field: 'giveBackDate',
|
||||
component: 'Input',
|
||||
show: ({ values }) => {
|
||||
return values.reservationStatus === '2';
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '预约状态',
|
||||
field: 'reservationStatus',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
// @ts-ignore//@ts-ignore
|
||||
dictCode: 'health_reservation',
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,88 @@
|
||||
<template>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" :icon="h(DeleteOutlined)" @click="deteleAll"> 批量删除 </a-button>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<add-modal @register="registerModal" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { h } from 'vue';
|
||||
import { DeleteOutlined } from '@ant-design/icons-vue';
|
||||
import BasicTable from '/@/components/Table/src/BasicTable.vue';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { TableAction } from '/@/components/Table';
|
||||
import { columns, searchFormSchema } from '/@/views/archive/healthCabin/bespeakManage/bespeakManage.data';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import AddModal from '/@/views/archive/healthCabin/bespeakManage/components/addDespeakManageModal.vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { list, batchDelete } from '/@/views/archive/healthCabin/bespeakManage/bespeakManage.api';
|
||||
const { createMessage } = useMessage();
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
api: list,
|
||||
// dataSource: list,
|
||||
columns,
|
||||
// canResize: false,
|
||||
orderFlag: false,
|
||||
showIndexColumn: true,
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: false,
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return params;
|
||||
},
|
||||
actionColumn: {
|
||||
width: 100,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
//注册弹窗
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
function getTableAction(record: any) {
|
||||
return [
|
||||
{
|
||||
label: '删除',
|
||||
onClick: handleDelete.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
onClick: onlyread.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
function onlyread(record) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: false,
|
||||
title: '查看',
|
||||
onlyRead: true,
|
||||
});
|
||||
}
|
||||
function deteleAll() {
|
||||
if (!selectedRowKeys.value.length) {
|
||||
createMessage.warning('请选择需要删除的数据');
|
||||
} else {
|
||||
batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
}
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
}
|
||||
function handleDelete(record) {
|
||||
batchDelete({ ids: record.id }, handleSuccess);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" width="40%" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" :disabled="onlyRead" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import BasicForm from '/@/components/Form/src/BasicForm.vue';
|
||||
import { useForm } from '/@/components/Form';
|
||||
import { schemas } from '/@/views/archive/healthCabin/bespeakManage/bespeakManage.data';
|
||||
const title = ref('新增');
|
||||
const isUpdate = ref();
|
||||
const onlyRead = ref(true);
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
console.log(data);
|
||||
await resetFields();
|
||||
title.value = data.title;
|
||||
isUpdate.value = data.isUpdate;
|
||||
await setFieldsValue(data.record);
|
||||
});
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 12 },
|
||||
});
|
||||
function handleSubmit() {
|
||||
closeModal();
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,67 @@
|
||||
// noinspection Eslint
|
||||
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/archives/medicalDataAnalysis/list',
|
||||
save = '/archives/medicalDataAnalysis/add',
|
||||
edit = '/archives/medicalDataAnalysis/edit',
|
||||
deleteOne = '/archives/medicalDataAnalysis/delete',
|
||||
deleteBatch = '/archives/medicalDataAnalysis/deleteBatch',
|
||||
importExcel = '/archives/medicalDataAnalysis/importExcel',
|
||||
exportXls = '/archives/medicalDataAnalysis/exportXls',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
/**
|
||||
* 导入api
|
||||
*/
|
||||
export const getImportUrl = Api.importExcel;
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
*/
|
||||
export const deleteOne = (params, handleSuccess) => {
|
||||
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
*/
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const saveOrUpdate = (params: any, isUpdate: boolean) => {
|
||||
const url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params });
|
||||
};
|
||||
@@ -0,0 +1,47 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '今日就诊人数',
|
||||
align: 'center',
|
||||
dataIndex: 'todayCheck',
|
||||
},
|
||||
{
|
||||
title: '总计就诊人数',
|
||||
align: 'center',
|
||||
dataIndex: 'totalCheck',
|
||||
},
|
||||
{
|
||||
title: '今日救护车出动次数',
|
||||
align: 'center',
|
||||
dataIndex: 'todayAmbulance',
|
||||
},
|
||||
{
|
||||
title: '总计救护车出动次数',
|
||||
align: 'center',
|
||||
dataIndex: 'totalAmbulance',
|
||||
},
|
||||
];
|
||||
|
||||
export const schemas: FormSchema[] = [
|
||||
{
|
||||
label: '今日就诊人数',
|
||||
field: 'todayCheck',
|
||||
component: 'InputNumber',
|
||||
},
|
||||
{
|
||||
label: '总计就诊人数',
|
||||
field: 'totalCheck',
|
||||
component: 'InputNumber',
|
||||
},
|
||||
{
|
||||
label: '今日救护车出动次数',
|
||||
field: 'todayAmbulance',
|
||||
component: 'InputNumber',
|
||||
},
|
||||
{
|
||||
label: '总计救护车出动次数',
|
||||
field: 'totalAmbulance',
|
||||
component: 'InputNumber',
|
||||
rules: [{ required: true, trigger: 'blur' }],
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection" style="margin: 10px 5px">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" :icon="h(PlusOutlined)" @click="handleAdd"> 录入 </a-button>
|
||||
<a-button type="primary" :icon="h(EditOutlined)" @click="handleEdit"> 编辑 </a-button>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<add-modal @register="registerModal" @success="handleSuccess" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { h } from 'vue';
|
||||
import { PlusOutlined, EditOutlined } from '@ant-design/icons-vue';
|
||||
import BasicTable from '/@/components/Table/src/BasicTable.vue';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { TableAction } from '/@/components/Table';
|
||||
import { columns } from '/@/views/archive/healthCabin/bigDataShow/bigDataShow.data';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import AddModal from '/@/views/archive/healthCabin/bigDataShow/components/addDigDataShowModal.vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { deleteOne } from '/@/views/archive/healthCabin/bigDataShow/bigDataShow.api';
|
||||
const { createMessage } = useMessage();
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
const { hasPermission } = usePermission();
|
||||
const list = [{}];
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
// api: listApi,
|
||||
dataSource: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
orderFlag: false,
|
||||
showIndexColumn: true,
|
||||
useSearchForm: false,
|
||||
beforeFetch: (params) => {
|
||||
return params;
|
||||
},
|
||||
actionColumn: {
|
||||
width: 100,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
//注册弹窗
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
function getTableAction(record: any) {
|
||||
return [
|
||||
{
|
||||
label: '删除',
|
||||
onClick: handleDelete.bind(null, record),
|
||||
ifShow: () => hasPermission('housenew:health_house_banner:delete'),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
openModal(true, {
|
||||
record: { sort: getDataSource().length + 1 },
|
||||
isUpdate: false,
|
||||
showFooter: true,
|
||||
type: '新增',
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit() {
|
||||
if (!selectedRowKeys.value.length || selectedRowKeys.value.length > 1) {
|
||||
return createMessage.warning('请选择一条数据!');
|
||||
}
|
||||
let id = selectedRowKeys.value[0];
|
||||
let dataSource = getDataSource();
|
||||
let record = dataSource.filter((item) => item.id === id)[0];
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: true,
|
||||
title: '编辑',
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,57 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" width="40%" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" :disabled="onlyRead" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import BasicForm from '/@/components/Form/src/BasicForm.vue';
|
||||
import { useForm } from '/@/components/Form';
|
||||
import { schemas } from '/@/views/archive/healthCabin/bigDataShow/bigDataShow.data';
|
||||
import { saveOrUpdate } from '/@/views/archive/healthCabin/bigDataShow/bigDataShow.api';
|
||||
// Emits声明
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(true);
|
||||
//设置标题
|
||||
const title = ref(String);
|
||||
const onlyRead = ref('false');
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
//重置表单
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
title.value = data.type;
|
||||
//表单赋值
|
||||
await setFieldsValue({
|
||||
...data.record,
|
||||
});
|
||||
// 隐藏底部时禁用整个表单
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate, setProps }] = useForm({
|
||||
labelWidth: 150,
|
||||
schemas,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
let values = await validate();
|
||||
setModalProps({ confirmLoading: true });
|
||||
//提交表单
|
||||
await saveOrUpdate(values, isUpdate.value);
|
||||
//关闭弹窗
|
||||
closeModal();
|
||||
//刷新列表
|
||||
emit('success');
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,30 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
enum Api {
|
||||
list = '/health-archives/housenew/fakerData/getFakerData,' +
|
||||
'/health-archives/housenew/fakerData/getFakerData,' +
|
||||
'/health-archives/housenew/fakerData/getFakerData,' +
|
||||
'/health-archives/housenew/fakerData/getFakerData,' +
|
||||
'/health-archives/housenew/fakerData/getFakerData,' +
|
||||
'/health-archives/housenew/fakerData/getFakerData,' +
|
||||
'/health-archives/housenew/fakerData/getFakerData', // 查询: 1: 五类人群 2:医疗点 3:员工营养监控 4:总体健康水平 5: 干预效果 6: 手表
|
||||
save = '/health-archives/housenew/fakerData/createGroupUserFakerData,' +
|
||||
'/health-archives/housenew/fakerData/createMedicalCenterFakerData,' +
|
||||
'/health-archives/housenew/fakerData/createNutritionFakerData,' +
|
||||
'/health-archives/housenew/fakerData/createHealthLevelFakerData,' +
|
||||
'/health-archives/housenew/fakerData/createInterveneFakerData,' +
|
||||
'/health-archives/housenew/fakerData/createWatchFakerData,' +
|
||||
'/health-archives/housenew/fakerData/createWatchStressFakerData', // 查询: 1: 五类人群 2:医疗点 3:员工营养监控 4:总体健康水平 5: 干预效果 6: 手表
|
||||
status = '/health-archives/housenew/fakerData/getFakerDataEnable',
|
||||
changeStatus = '/health-archives/housenew/fakerData/fakerDataEnable',
|
||||
}
|
||||
console.log(Api.list.split(','));
|
||||
export const listApi = (params: any) =>
|
||||
defHttp.post(
|
||||
{ url: Api.list.split(',')[(params['module'] === 20 ? 5 : params['module'] === 21 ? 6 : params['module']) - 1], params },
|
||||
{ joinParamsToUrl: true, isTransformResponse: false }
|
||||
);
|
||||
export const saveApi = (params: any) =>
|
||||
defHttp.post({ url: Api.save.split(',')[(params['module'] === 20 ? 6 : params['module'] === 21 ? 7 : params['module']) - 1], params });
|
||||
export const statusApi = (params: any) => defHttp.post({ url: Api.status, params });
|
||||
export const changeStatusApi = (params: any) => defHttp.post({ url: Api.changeStatus, params });
|
||||
@@ -0,0 +1,447 @@
|
||||
import { BasicColumn } from '/@/components/Table';
|
||||
|
||||
const fiveColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '总人数',
|
||||
dataIndex: 'totalUser',
|
||||
},
|
||||
{
|
||||
title: '大病',
|
||||
dataIndex: 'illnessNum',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '慢病',
|
||||
dataIndex: 'slowVirusNum',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '异常',
|
||||
dataIndex: 'failNum',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '风险',
|
||||
dataIndex: 'riskNum',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '健康',
|
||||
dataIndex: 'healthNum',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
},
|
||||
];
|
||||
const medicalColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '近一周就诊人数',
|
||||
dataIndex: 'weekNum',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '累计就诊人数',
|
||||
dataIndex: 'totalNum',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '近一周救护车',
|
||||
dataIndex: 'weekAmbulanceNum',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '累计救护车',
|
||||
dataIndex: 'totalAmbulanceNum',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
},
|
||||
];
|
||||
const nutritionColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '早餐人数',
|
||||
dataIndex: 'breakfastHeadCount',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '早餐超标人数',
|
||||
dataIndex: 'breakfastOutOfLimits',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '午餐人数',
|
||||
dataIndex: 'lunchHeadCount',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '午餐超标人数',
|
||||
dataIndex: 'lunchOutOfLimits',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '晚餐人数',
|
||||
dataIndex: 'dinnerHeadCount',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '晚餐超标人数',
|
||||
dataIndex: 'dinnerOutOfLimits',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
},
|
||||
];
|
||||
const healthColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '健康值',
|
||||
dataIndex: 'health',
|
||||
},
|
||||
{
|
||||
title: '亚健康值',
|
||||
dataIndex: 'sub',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '轻度心理问题',
|
||||
dataIndex: 'mild',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '中度心理问题',
|
||||
dataIndex: 'moderate',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '高度心理问题',
|
||||
dataIndex: 'serious',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
},
|
||||
];
|
||||
const interveneColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '训练前睡眠质量',
|
||||
dataIndex: 'sleepAgo',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '训练后睡眠质量',
|
||||
dataIndex: 'sleepLater',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '训练前冥想情绪',
|
||||
dataIndex: 'meditationAgo',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '训练后冥想情绪',
|
||||
dataIndex: 'meditationLater',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '训练前骑行放松度',
|
||||
dataIndex: 'cyclingAgo',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '训练后骑行放松度',
|
||||
dataIndex: 'cyclingLater',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '总体改善度',
|
||||
dataIndex: 'total',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
},
|
||||
];
|
||||
const watchColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '血氧监测-正常',
|
||||
dataIndex: 'bloodOxygenNormal',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '血氧监测-警戒',
|
||||
dataIndex: 'bloodOxygenWarn',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '血氧监测-危险',
|
||||
dataIndex: 'bloodOxygenDanger',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '心率监测-正常',
|
||||
dataIndex: 'heartRateNormal',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '心率监测-警戒',
|
||||
dataIndex: 'heartRateWarn',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '心率监测--危险',
|
||||
dataIndex: 'heartRateDanger',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
},
|
||||
];
|
||||
|
||||
const sportColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '小于两公里1',
|
||||
dataIndex: 'ltOne',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '小于两公里2',
|
||||
dataIndex: 'ltTwo',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '小于两公里3',
|
||||
dataIndex: 'ltThree',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '小于两公里4',
|
||||
dataIndex: 'ltFour',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '3-5公里1',
|
||||
dataIndex: 'middleOne',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '3-5公里2',
|
||||
dataIndex: 'middleTwo',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '3-5公里3',
|
||||
dataIndex: 'middleThree',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '3-5公里4',
|
||||
dataIndex: 'middleFour',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '五公里以上1',
|
||||
dataIndex: 'gtOne',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '五公里以上2',
|
||||
dataIndex: 'gtTwo',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '五公里以上3',
|
||||
dataIndex: 'gtThree',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '五公里以上4',
|
||||
dataIndex: 'gtFour',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
title: '压力-放松',
|
||||
dataIndex: 'stressRelax',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '压力-正常',
|
||||
dataIndex: 'stressNormal',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '压力-中等',
|
||||
dataIndex: 'stressMedium',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '压力-偏高',
|
||||
dataIndex: 'stressHigh',
|
||||
rewriting: true,
|
||||
rewroteCell: {
|
||||
type: 'inputNumber',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
},
|
||||
];
|
||||
export const columns: Array<BasicColumn[]> = [
|
||||
fiveColumns,
|
||||
medicalColumns,
|
||||
nutritionColumns,
|
||||
healthColumns,
|
||||
interveneColumns,
|
||||
watchColumns,
|
||||
sportColumns,
|
||||
];
|
||||
@@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<div style="padding: 10px">
|
||||
<BasicTable @register="registerTable">
|
||||
<template #tableTitle>
|
||||
<div style="width: 100%">
|
||||
<div>
|
||||
<a-tabs v-model:activeKey="activeKey" @change="handleChange" style="padding-left: 5px">
|
||||
<a-tab-pane v-for="item in tabList" :key="item.id" :tab="item.name" />
|
||||
</a-tabs>
|
||||
</div>
|
||||
<div>
|
||||
<a-button type="primary" @click="changeCalculateStatus" :loading="saveLoading">{{ isCalculate ? `保存` : `录入` }}</a-button>
|
||||
<a-button style="margin-left: 5px" v-if="isCalculate" @click="changeCalculateStatusFalse">取消</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="isCalculate" #bodyCell="{ column, record }">
|
||||
<div v-if="column?.rewriting">
|
||||
<a-input-number v-model:value="record[column.dataIndex]" />
|
||||
</div>
|
||||
<div v-if="column.dataIndex == 'status'">
|
||||
<a-switch
|
||||
v-model:checked="checked1"
|
||||
checked-children="开"
|
||||
un-checked-children="关"
|
||||
@change="changeSwitch"
|
||||
:loading="switchLoading"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else #bodyCell="{ column, record }">
|
||||
<div v-if="column.dataIndex == 'status'">
|
||||
<a-switch
|
||||
v-model:checked="checked1"
|
||||
checked-children="开"
|
||||
un-checked-children="关"
|
||||
@change="changeSwitch"
|
||||
:loading="switchLoading"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import BasicTable from '/@/components/Table/src/BasicTable.vue';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { listApi, saveApi, statusApi, changeStatusApi } from '/@/views/archive/healthCabin/bigScreen/currency.api';
|
||||
import { columns } from '/@/views/archive/healthCabin/bigScreen/currency.data';
|
||||
import { message } from 'ant-design-vue';
|
||||
const activeKey = ref(1);
|
||||
const checked1 = ref(false);
|
||||
const isCalculate = ref(false);
|
||||
const saveLoading = ref(false);
|
||||
const switchLoading = ref(false);
|
||||
const tabList = ref([
|
||||
{
|
||||
id: 1,
|
||||
name: '五类人群',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '一线医疗点',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '员工营养监控',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: '总体健康水平',
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: '干预效果',
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
name: '手表',
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
name: '运动压力',
|
||||
},
|
||||
]);
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
api: listApi,
|
||||
// columns: props.columns,
|
||||
beforeFetch: (params) => {
|
||||
const redisKey = ['house:fakerData:groupUser'];
|
||||
params['module'] = activeKey.value === 6 ? 20 : activeKey.value === 7 ? 21 : activeKey.value;
|
||||
params['redisKey'] = redisKey[activeKey.value - 1];
|
||||
return params;
|
||||
},
|
||||
afterFetch: async () => {
|
||||
let { code, result, message: msg } = getRawDataSource();
|
||||
const res = await statusApi({});
|
||||
checked1.value = res[activeKey.value] ? res[activeKey.value] : false;
|
||||
if (code == 200) {
|
||||
return [result];
|
||||
} else {
|
||||
message.warn(msg);
|
||||
}
|
||||
},
|
||||
showTableSetting: false,
|
||||
tableSetting: {
|
||||
setting: false,
|
||||
},
|
||||
pagination: false,
|
||||
canResize: false,
|
||||
immediate: false,
|
||||
useSearchForm: false,
|
||||
showActionColumn: false,
|
||||
},
|
||||
});
|
||||
|
||||
async function changeCalculateStatus() {
|
||||
if (!isCalculate.value) return (isCalculate.value = true);
|
||||
try {
|
||||
saveLoading.value = true;
|
||||
switchLoading.value = false;
|
||||
await saveApi({ ...getDataSource()[0], module: activeKey.value });
|
||||
saveLoading.value = false;
|
||||
await reload();
|
||||
} catch (e) {
|
||||
saveLoading.value = false;
|
||||
|
||||
switchLoading.value = false;
|
||||
}
|
||||
}
|
||||
function changeCalculateStatusFalse() {
|
||||
isCalculate.value = false;
|
||||
saveLoading.value = false;
|
||||
switchLoading.value = false;
|
||||
reload();
|
||||
}
|
||||
|
||||
async function changeSwitch() {
|
||||
try {
|
||||
switchLoading.value = true;
|
||||
checked1.value = !checked1.value;
|
||||
await changeStatusApi({ module: activeKey.value === 6 ? 20 : activeKey.value === 7 ? 21 : activeKey.value, enable: !checked1.value });
|
||||
checked1.value = !checked1.value;
|
||||
switchLoading.value = false;
|
||||
} catch (e) {
|
||||
switchLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function handleChange() {
|
||||
saveLoading.value = false;
|
||||
switchLoading.value = false;
|
||||
isCalculate.value = false;
|
||||
setProps({
|
||||
columns: columns[activeKey.value - 1],
|
||||
});
|
||||
reload();
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
setProps({
|
||||
columns: columns[activeKey.value - 1],
|
||||
});
|
||||
reload();
|
||||
});
|
||||
|
||||
const [registerTable, { reload, setProps, getRawDataSource, getDataSource }, {}] = tableContext;
|
||||
</script>
|
||||
<style scoped lang="less"></style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" width="50%" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" :disabled="onlyRead" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import BasicForm from '/@/components/Form/src/BasicForm.vue';
|
||||
import { useForm } from '/@/components/Form';
|
||||
import { schemas } from '/@/views/archive/healthCabin/healthEquipment/healthEquipment.data';
|
||||
const title = ref('新增');
|
||||
const isUpdate = ref();
|
||||
const onlyRead = ref('false');
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
console.log(data);
|
||||
await resetFields();
|
||||
title.value = data.title;
|
||||
isUpdate.value = data.isUpdate;
|
||||
onlyRead.value = data.onlyRead;
|
||||
});
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||
labelWidth: 120,
|
||||
schemas,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 12 },
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
if (onlyRead.value) {
|
||||
closeModal();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
let values = await validate();
|
||||
setModalProps({ confirmLoading: true });
|
||||
console.log(values, 1233333);
|
||||
closeModal();
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,67 @@
|
||||
// noinspection Eslint
|
||||
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/health-archives/health-house/device/list',
|
||||
save = '/archives/medicalDataAnalysis/add',
|
||||
edit = '/archives/medicalDataAnalysis/edit',
|
||||
deleteOne = '/archives/medicalDataAnalysis/delete',
|
||||
deleteBatch = '/archives/medicalDataAnalysis/deleteBatch',
|
||||
importExcel = '/archives/medicalDataAnalysis/importExcel',
|
||||
exportXls = '/archives/medicalDataAnalysis/exportXls',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
/**
|
||||
* 导入api
|
||||
*/
|
||||
export const getImportUrl = Api.importExcel;
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
*/
|
||||
export const deleteOne = (params, handleSuccess) => {
|
||||
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
*/
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const saveOrUpdate = (params: any, isUpdate: boolean) => {
|
||||
const url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params });
|
||||
};
|
||||
@@ -0,0 +1,124 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '设备编号',
|
||||
align: 'center',
|
||||
dataIndex: 'pic',
|
||||
},
|
||||
{
|
||||
title: '设备名称',
|
||||
align: 'center',
|
||||
dataIndex: 'qq',
|
||||
},
|
||||
{
|
||||
title: '设备状态',
|
||||
align: 'center',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '所属健康室',
|
||||
align: 'center',
|
||||
dataIndex: 'pic',
|
||||
},
|
||||
{
|
||||
title: '设备图片',
|
||||
align: 'center',
|
||||
dataIndex: 'pic',
|
||||
},
|
||||
{
|
||||
title: '设备类型',
|
||||
align: 'center',
|
||||
dataIndex: 'pic',
|
||||
},
|
||||
{
|
||||
title: '单位预约时间(/分钟)',
|
||||
align: 'center',
|
||||
dataIndex: 'pic',
|
||||
},
|
||||
{
|
||||
title: '可预约人数(/人)',
|
||||
align: 'center',
|
||||
dataIndex: 'pic',
|
||||
},
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '所属健康室',
|
||||
field: 'name1',
|
||||
component: 'Select',
|
||||
},
|
||||
{
|
||||
label: '设备类型',
|
||||
field: 'name',
|
||||
component: 'Select',
|
||||
},
|
||||
];
|
||||
|
||||
export const schemas: FormSchema[] = [
|
||||
{
|
||||
label: '设备编号',
|
||||
field: 'name',
|
||||
component: 'Input',
|
||||
rules: [{ required: true }],
|
||||
},
|
||||
{
|
||||
label: '设备名称',
|
||||
field: 'name',
|
||||
component: 'Input',
|
||||
rules: [{ required: true }],
|
||||
},
|
||||
{
|
||||
label: '设备状态',
|
||||
field: 'name',
|
||||
component: 'Select',
|
||||
rules: [{ required: true }],
|
||||
},
|
||||
{
|
||||
label: '设备类型',
|
||||
field: 'name',
|
||||
component: 'Select',
|
||||
rules: [{ required: true }],
|
||||
},
|
||||
{
|
||||
label: '所属健康室',
|
||||
field: 'name',
|
||||
component: 'Input',
|
||||
rules: [{ required: true }],
|
||||
},
|
||||
{
|
||||
label: '添加图片',
|
||||
field: 'uploadImage',
|
||||
component: 'JImageUpload',
|
||||
componentProps: {
|
||||
//按钮显示文字
|
||||
text: '图片上传',
|
||||
//支持两种基本样式picture和picture-card
|
||||
listType: 'picture-card',
|
||||
//用于控制文件上传的业务路径,默认temp
|
||||
bizPath: 'temp',
|
||||
//是否禁用
|
||||
disabled: false,
|
||||
//最大上传数量
|
||||
fileMax: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '设备介绍',
|
||||
field: 'editor',
|
||||
component: 'JEditor',
|
||||
// componentProps: {
|
||||
//是否禁用
|
||||
// disabled: false
|
||||
// },
|
||||
},
|
||||
{
|
||||
label: '预约须知',
|
||||
field: 'editor',
|
||||
component: 'JEditor',
|
||||
// componentProps: {
|
||||
//是否禁用
|
||||
// disabled: false
|
||||
// },
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,106 @@
|
||||
<template>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" :icon="h(PlusOutlined)" @click="add"> 添加设备 </a-button>
|
||||
<a-button type="primary" :icon="h(EditOutlined)" @click="edit"> 修改设备信息 </a-button>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<add-modal @register="registerModal" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { h } from 'vue';
|
||||
import { PlusOutlined, EditOutlined } from '@ant-design/icons-vue';
|
||||
import BasicTable from '/@/components/Table/src/BasicTable.vue';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { TableAction } from '/@/components/Table';
|
||||
import { list } from '/@/views/archive/healthCabin/healthEquipment/healthEquipment.api';
|
||||
import { columns, searchFormSchema } from '/@/views/archive/healthCabin/healthEquipment/healthEquipment.data';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import AddModal from '/@/views/archive/healthCabin/healthEquipment/components/addHealthEquipmentModal.vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
api: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
orderFlag: false,
|
||||
showIndexColumn: true,
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: false,
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
},
|
||||
// beforeFetch: (params) => {
|
||||
// return params;
|
||||
// },
|
||||
actionColumn: {
|
||||
width: 100,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
//注册弹窗
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
function getTableAction(record: any) {
|
||||
return [
|
||||
{
|
||||
label: '删除',
|
||||
onClick: handleDelete.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
function edit() {
|
||||
if (!selectedRowKeys.value.length || selectedRowKeys.value.length > 1) {
|
||||
return createMessage.warning('请选择一条数据!');
|
||||
}
|
||||
let id = selectedRowKeys.value[0];
|
||||
let dataSource = getDataSource();
|
||||
let record = dataSource.filter((item) => item.id === id)[0];
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
title: '编辑',
|
||||
});
|
||||
}
|
||||
function add() {
|
||||
openModal(true, {
|
||||
isUpdate: false,
|
||||
title: '新增',
|
||||
onlyRead: false,
|
||||
});
|
||||
}
|
||||
function onlyread() {
|
||||
if (!selectedRowKeys.value.length || selectedRowKeys.value.length > 1) {
|
||||
return createMessage.warning('请选择一条数据!');
|
||||
}
|
||||
let id = selectedRowKeys.value[0];
|
||||
let dataSource = getDataSource();
|
||||
let record = dataSource.filter((item) => item.id === id)[0];
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: false,
|
||||
title: '查看',
|
||||
onlyRead: true,
|
||||
});
|
||||
}
|
||||
function deteleAll() {
|
||||
if (!selectedRowKeys.value.length) {
|
||||
createMessage.warning('请选择需要删除的格言');
|
||||
}
|
||||
}
|
||||
function handleDelete(e) {
|
||||
console.log(e);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerAdministratorModal" :title="title" :width="800" @ok="handleSubmit">
|
||||
<BasicForm @register="registerAdministratorForm" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form';
|
||||
import { administratorFormSchema } from '/@/views/archive/healthCabin/healthRoom/index.data';
|
||||
import { addAdmin } from '/@/views/archive/healthCabin/healthRoom/index.api';
|
||||
import { encipher } from '/@/utils/jsencrypt';
|
||||
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(true);
|
||||
const title = ref('医院管理员');
|
||||
const record = ref();
|
||||
|
||||
//表单配置
|
||||
const [registerAdministratorForm, { setProps, resetFields, setFieldsValue, validate, clearValidate }] = useForm({
|
||||
schemas: administratorFormSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
//表单赋值
|
||||
const [registerAdministratorModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
//重置表单
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
title.value = data.title;
|
||||
record.value = data.record;
|
||||
if (isUpdate.value) {
|
||||
await setFieldsValue(data.record);
|
||||
}
|
||||
await clearValidate();
|
||||
// 隐藏底部时禁用整个表单
|
||||
await setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
setModalProps({ confirmLoading: true });
|
||||
const values = await validate();
|
||||
const params = {
|
||||
...values,
|
||||
pwd: encipher(values.password),
|
||||
confirmPwd: encipher(values.confirmPassword),
|
||||
// pwd: values.password,
|
||||
// confirmPwd: values.confirmPassword,
|
||||
houseCode: record.value.houseCode,
|
||||
};
|
||||
delete params.confirmPassword;
|
||||
delete params.password;
|
||||
await addAdmin(params);
|
||||
setModalProps({ confirmLoading: false });
|
||||
// 关闭弹窗
|
||||
closeModal();
|
||||
//刷新列表
|
||||
emit('success');
|
||||
} catch {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.title-info {
|
||||
margin-left: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" width="40%" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" :disabled="onlyRead">
|
||||
<template #address="{ model }">
|
||||
<a-input style="width: calc(100% - 100px)" v-model:value="model['housePlace']" :disabled="true" />
|
||||
<a-button style="margin-left: 10px; width: 80px" @click="viewMap" :disabled="onlyRead">查看地图</a-button>
|
||||
</template>
|
||||
<template #defaultHouseNumber="{ model }" v-if="!isUpdate">
|
||||
<a-checkbox-group v-model:value="model['defaultHouseNumber']" :options="plainOptions" />
|
||||
</template>
|
||||
</BasicForm>
|
||||
<Map @register="registerMap" :state="state" ref="map" @get-position="getPosition" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { BasicModal, useModal, useModalInner } from '/@/components/Modal';
|
||||
import BasicForm from '/@/components/Form/src/BasicForm.vue';
|
||||
import { useForm } from '/@/components/Form';
|
||||
import { schemas } from '/@/views/archive/healthCabin/healthRoom/index.data';
|
||||
import Map from '/@/views/consult/resource/components/Map.vue';
|
||||
import { addRoom, editRoom } from '/@/views/archive/healthCabin/healthRoom/index.api';
|
||||
import { getDictCache } from '/@/utils/dict';
|
||||
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const title = ref('新增');
|
||||
const isUpdate = ref();
|
||||
const state = ref();
|
||||
const roomId = ref();
|
||||
const onlyRead = ref('false');
|
||||
let plainOptions = ref();
|
||||
// console.log(plainOptions)
|
||||
onMounted(async () => {
|
||||
plainOptions.value = getDictCache('week');
|
||||
console.log(plainOptions.value);
|
||||
});
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
console.log(data.record);
|
||||
setModalProps({ confirmLoading: false });
|
||||
await resetFields();
|
||||
await updateSchema([
|
||||
{
|
||||
field: 'defaultHouseNumber',
|
||||
show: true,
|
||||
},
|
||||
]);
|
||||
if (data.isUpdate) {
|
||||
await setFieldsValue({ ...data.record });
|
||||
await setFieldsValue({ useDeparts: data.record.useDeparts.split(',') });
|
||||
|
||||
roomId.value = data.record.id;
|
||||
await updateSchema([
|
||||
{
|
||||
field: 'defaultHouseNumber',
|
||||
show: false,
|
||||
},
|
||||
]);
|
||||
}
|
||||
title.value = data.title;
|
||||
isUpdate.value = data.isUpdate;
|
||||
onlyRead.value = data.onlyRead;
|
||||
});
|
||||
const [registerMap, { openModal: openMapModal }] = useModal();
|
||||
const [registerForm, { updateSchema, resetFields, setFieldsValue, validate, getFieldsValue }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
if (onlyRead.value) {
|
||||
closeModal();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
let values = await validate();
|
||||
setModalProps({ confirmLoading: true });
|
||||
values = {
|
||||
...values,
|
||||
...state.value,
|
||||
};
|
||||
if (isUpdate.value) {
|
||||
values.id = roomId.value;
|
||||
await editRoom(values);
|
||||
} else {
|
||||
await addRoom(values);
|
||||
}
|
||||
closeModal();
|
||||
//刷新列表
|
||||
emit('success');
|
||||
} catch (e) {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
function viewMap() {
|
||||
openMapModal(true, {
|
||||
record: { ...getFieldsValue() },
|
||||
});
|
||||
}
|
||||
async function getPosition(val) {
|
||||
let { pname, cityname, adname, address, name } = val.handleItem || '';
|
||||
let nameList = [pname, cityname, adname, address, name];
|
||||
let str = '';
|
||||
nameList.map((item) => {
|
||||
if (item !== undefined) {
|
||||
str += item;
|
||||
}
|
||||
});
|
||||
await setFieldsValue({
|
||||
latitude: val.lat,
|
||||
longitude: val.lng,
|
||||
customAddress: `${val.lng},${val.lat}`,
|
||||
housePlace: str,
|
||||
});
|
||||
state.value = {
|
||||
...state.value,
|
||||
latitude: val.lat,
|
||||
longitude: val.lng,
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" width="40%" @ok="handleSubmit">
|
||||
<BasicTable @register="TerEquiTable" :rowSelection="rowSelection" class="device-table"></BasicTable>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import BasicTable from '/@/components/Table/src/BasicTable.vue';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { deviceList, bindDevices } from '/@/views/archive/healthCabin/healthRoom/index.api';
|
||||
import { terEquiChangeColums } from '/@/views/archive/healthCabin/healthRoom/index.data';
|
||||
const title = ref('选择');
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(false);
|
||||
const terminalCode = ref();
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
console.log(data.record);
|
||||
setModalProps({ confirmLoading: false });
|
||||
terminalCode.value = data.terminalCode;
|
||||
});
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: '终端设备表',
|
||||
api: deviceList,
|
||||
columns: terEquiChangeColums,
|
||||
canResize: false,
|
||||
orderFlag: false,
|
||||
showIndexColumn: false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 100,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
const [TerEquiTable, { reload, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const allData = getDataSource();
|
||||
const filteredData = allData.filter((item) => selectedRowKeys.value.includes(item.id));
|
||||
const deviceCodes = filteredData.map((item) => {
|
||||
return item.deviceCode;
|
||||
});
|
||||
const params = {
|
||||
deviceCodes,
|
||||
terminalCode: terminalCode.value,
|
||||
};
|
||||
// closeModal();
|
||||
await bindDevices(params);
|
||||
closeModal();
|
||||
emit('success');
|
||||
} catch (e) {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,59 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" width="40%" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm"></BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { useForm } from '/@/components/Form';
|
||||
import BasicForm from '/@/components/Form/src/BasicForm.vue';
|
||||
import { terminalFormSchema } from '/@/views/archive/healthCabin/healthRoom/index.data';
|
||||
import { terminalAdd, terminalEdit } from '/@/views/archive/healthCabin/healthRoom/index.api';
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
let title = ref('新增设备');
|
||||
let isUpdate = ref(false);
|
||||
const onlyRead = ref('false');
|
||||
const houseCode = ref();
|
||||
const terminalId = ref();
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
console.log(data);
|
||||
setModalProps({ confirmLoading: false });
|
||||
await resetFields();
|
||||
title.value = data.title + 1;
|
||||
houseCode.value = data.houseCode;
|
||||
isUpdate.value = data.isUpdate;
|
||||
if (data.isUpdate) {
|
||||
terminalId.value = data.record.id;
|
||||
data.record.terminalStatus = data.record.terminalStatus.toString();
|
||||
await setFieldsValue({ ...data.record });
|
||||
}
|
||||
});
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas: terminalFormSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
async function handleSubmit() {
|
||||
console.log(123);
|
||||
try {
|
||||
let values = await validate();
|
||||
setModalProps({ confirmLoading: true });
|
||||
closeModal();
|
||||
values.houseCode = houseCode.value;
|
||||
if (isUpdate.value) {
|
||||
values.id = terminalId.value;
|
||||
await terminalEdit(values);
|
||||
} else {
|
||||
await terminalAdd(values);
|
||||
}
|
||||
emit('success');
|
||||
} catch (e) {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<BasicDrawer v-bind="$attrs" @register="registerModal" title="医院管理员" :width="1000">
|
||||
<div class="administrator-container">
|
||||
<!-- <div class="title-info">-->
|
||||
<!-- <div>医院名称:{{ record?.resourceName }}</div>-->
|
||||
<!-- <div class="level">医院等级:{{ record?.resourceLevel_dictText }}</div>-->
|
||||
<!-- </div>-->
|
||||
<div>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button
|
||||
type="primary"
|
||||
@click="handleAdd"
|
||||
preIcon="ant-design:plus-outlined"
|
||||
v-auth="'medicalCenter:medical_hospital_manager:add'"
|
||||
>
|
||||
新增管理员
|
||||
</a-button>
|
||||
<!-- <a-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- @click="batchHandleDelete"-->
|
||||
<!-- preIcon="ant-design:delete-outlined"-->
|
||||
<!-- v-auth="'medicalCenter:medical_hospital_manager:deleteBatch'"-->
|
||||
<!-- >-->
|
||||
<!-- 批量删除-->
|
||||
<!-- </a-button>-->
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
</div>
|
||||
<!--新增管理员-->
|
||||
<AddAdminModal @register="registerAdminModal" @success="handleSuccess" />
|
||||
<!--重置密码-->
|
||||
<RestPass @register="resetPassModal" />
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
// import { administratorDeleteBatch, administratorDeleteOne, administratorList } from '/@/views/medicalCenter/partnerHospital/partnerHospital.api';
|
||||
import { adminList } from '/@/views/archive/healthCabin/healthRoom/index.api';
|
||||
import AddAdminModal from '/@/views/archive/healthCabin/healthRoom/components/addAdminModal.vue';
|
||||
import { administratorColumns, administratorSearchForm } from '/@/views/archive/healthCabin/healthRoom/index.data';
|
||||
import RestPass from '/@/views/system/user/restPass/RestPass.vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import BasicDrawer from '/@/components/Drawer/src/BasicDrawer.vue';
|
||||
import { useDrawerInner } from '/@/components/Drawer';
|
||||
const record = ref();
|
||||
//表单赋值
|
||||
const [registerModal, { setDrawerProps }] = useDrawerInner(async (data) => {
|
||||
record.value = data.record;
|
||||
await reload();
|
||||
});
|
||||
//注册Modal
|
||||
const [registerAdminModal, { openModal }] = useModal();
|
||||
const [resetPassModal, { openModal: openResetModal }] = useModal();
|
||||
|
||||
//注册table数据
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: '健康室管理员',
|
||||
api: adminList,
|
||||
columns: administratorColumns,
|
||||
canResize: false,
|
||||
showIndexColumn: false,
|
||||
|
||||
formConfig: {
|
||||
labelWidth: 40,
|
||||
|
||||
// schemas: administratorSearchForm,
|
||||
showActionButtonGroup: false,
|
||||
showAdvancedButton: false,
|
||||
showSubmitButton: false,
|
||||
showResetButton: false,
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
// baseColProps: {
|
||||
// offset: 0,
|
||||
// xs: 12,
|
||||
// sm: 12,
|
||||
// md: 8,
|
||||
// lg: 8,
|
||||
// xl: 8,
|
||||
// xxl: 8,
|
||||
// },
|
||||
// actionColOptions: {
|
||||
// span: 8,
|
||||
// offset: 0,
|
||||
// xs: 12,
|
||||
// sm: 12,
|
||||
// md: 8,
|
||||
// lg: 8,
|
||||
// xl: 8,
|
||||
// xxl: 8,
|
||||
// },
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
params['houseCode'] = record.value?.houseCode;
|
||||
return params;
|
||||
},
|
||||
actionColumn: {
|
||||
width: 100,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
||||
function resetPassword(record: Recordable) {
|
||||
openResetModal(true, {
|
||||
record: record.userId,
|
||||
isUpdate: true,
|
||||
showFooter: false,
|
||||
});
|
||||
}
|
||||
function handleAdd() {
|
||||
openModal(true, {
|
||||
record: { ...record.value, hospitalId: record.value.id },
|
||||
isUpdate: false,
|
||||
title: '新增管理员',
|
||||
showFooter: true,
|
||||
});
|
||||
}
|
||||
function handleEdit(row: Recordable) {
|
||||
openModal(true, {
|
||||
record: { ...row, hospitalId: record.value.id },
|
||||
isUpdate: true,
|
||||
title: '编辑医院管理员',
|
||||
showFooter: true,
|
||||
});
|
||||
}
|
||||
// function handleDelete(record: Recordable) {
|
||||
// administratorDeleteOne({ id: record.id }, handleSuccess);
|
||||
// }
|
||||
// function batchHandleDelete() {
|
||||
// if (selectedRowKeys.value.length === 0) {
|
||||
// message.warning('未选中任何数据');
|
||||
// return;
|
||||
// }
|
||||
// administratorDeleteBatch({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
// }
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
function getTableAction(record: Recordable) {
|
||||
return [
|
||||
{
|
||||
label: '重置密码',
|
||||
onClick: resetPassword.bind(null, record),
|
||||
auth: 'system:reset:password',
|
||||
},
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'medicalCenter:medical_hospital_manager:edit',
|
||||
ifShow: false,
|
||||
},
|
||||
// {
|
||||
// label: '删除',
|
||||
// onClick: handleDelete.bind(null, record),
|
||||
// auth: 'medicalCenter:medical_hospital_manager:delete',
|
||||
// ifShow: false,
|
||||
// },
|
||||
];
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.administrator-container {
|
||||
height: 65vh;
|
||||
overflow: auto;
|
||||
}
|
||||
.title-info {
|
||||
margin-left: 20px;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,196 @@
|
||||
<template>
|
||||
<BasicDrawer @register="registerDrawer" title="设备管理" :width="drawerWidth" :maskClosable="false" :show-footer="false">
|
||||
<BasicTable @register="deviceTable" :rowSelection="rowSelection" class="device-table">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" :icon="h(PlusOutlined)" @click="addDevice"> 新增 </a-button>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<DeviceModal @register="deviceModal" @success="deviceSuccess"></DeviceModal>
|
||||
<ProjectDrawer @register="projectDrawer"></ProjectDrawer>
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import BasicDrawer from '/@/components/Drawer/src/BasicDrawer.vue';
|
||||
import { ref, unref, h } from 'vue';
|
||||
import { PlusOutlined, EditOutlined, SearchOutlined } from '@ant-design/icons-vue';
|
||||
import { useDrawer, useDrawerInner } from '/@/components/Drawer';
|
||||
import BasicTable from '/@/components/Table/src/BasicTable.vue';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { TableAction } from '/@/components/Table';
|
||||
import { deviceColumns, deviceSearchFormSchema } from '/@/views/archive/healthCabin/healthRoom/index.data';
|
||||
import DeviceModal from '/@/views/archive/healthCabin/healthRoom/components/deviceModal.vue';
|
||||
import ProjectDrawer from '/@/views/archive/healthCabin/healthRoom/components/projectDrawer.vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { deviceList, deviceDelete, deviceChangeStatus } from '/@/views/archive/healthCabin/healthRoom/index.api';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
const { createMessage } = useMessage();
|
||||
let records = ref();
|
||||
const [registerDrawer, { setDrawerProps }] = useDrawerInner(async (data) => {
|
||||
console.log(data);
|
||||
records.value = data.record;
|
||||
});
|
||||
const [projectDrawer, { openDrawer: openProjectDrawer }] = useDrawer();
|
||||
const drawerWidth = '80%';
|
||||
const list = [{}];
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: '设备管理表',
|
||||
api: deviceList,
|
||||
// dataSource: list,
|
||||
columns: deviceColumns,
|
||||
canResize: false,
|
||||
orderFlag: false,
|
||||
showIndexColumn: false,
|
||||
formConfig: {
|
||||
// layout: 'inline',
|
||||
schemas: deviceSearchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: false,
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
baseColProps: {
|
||||
offset: 0,
|
||||
xs: 8,
|
||||
sm: 8,
|
||||
md: 8,
|
||||
lg: 8,
|
||||
xl: 8,
|
||||
xxl: 5,
|
||||
},
|
||||
},
|
||||
// beforeFetch: (params) => {
|
||||
// params['id'] = record.value.houseCode;
|
||||
// return params;
|
||||
// },
|
||||
actionColumn: {
|
||||
width: 200,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
const [deviceTable, { reload, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const [deviceModal, { openModal }] = useModal();
|
||||
|
||||
function getTableAction(record: any) {
|
||||
return [
|
||||
{
|
||||
label: '启用',
|
||||
onClick: handleEnable.bind(null, record),
|
||||
ifShow: record.deviceStatus == 0,
|
||||
},
|
||||
{
|
||||
label: '禁用',
|
||||
// label: '删除',
|
||||
popConfirm: {
|
||||
title: '请确认禁用类型',
|
||||
okText: '禁用并取消',
|
||||
cancelText: '禁用',
|
||||
confirm: handleDisabled.bind(null, record),
|
||||
cancel: handleOlnyDisabled.bind(null, record),
|
||||
},
|
||||
// onClick: handleDisabled.bind(null, record),
|
||||
// confirm: {
|
||||
// ok: 'qqq',
|
||||
// },
|
||||
ifShow: record.deviceStatus != 0,
|
||||
},
|
||||
{
|
||||
label: '设备项目',
|
||||
onClick: projectBtn.bind(null, record),
|
||||
ifShow: record.childStatus == 1,
|
||||
},
|
||||
];
|
||||
}
|
||||
function projectBtn(record) {
|
||||
openProjectDrawer(true, {
|
||||
record,
|
||||
});
|
||||
}
|
||||
function deviceSuccess() {
|
||||
reload();
|
||||
}
|
||||
|
||||
function getDropDownAction(record: any) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: edit.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
onClick: onlyread.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
onClick: deviceDeleteBtn.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
async function handleEnable(record) {
|
||||
console.log(record);
|
||||
const params = {
|
||||
deviceId: record.id,
|
||||
status: 1,
|
||||
};
|
||||
await deviceChangeStatus(params);
|
||||
reload();
|
||||
}
|
||||
async function handleDisabled(record) {
|
||||
console.log(record);
|
||||
const params = {
|
||||
deviceId: record.id,
|
||||
status: 0,
|
||||
force: true,
|
||||
};
|
||||
await deviceChangeStatus(params);
|
||||
reload();
|
||||
}
|
||||
async function handleOlnyDisabled(record) {
|
||||
const params = {
|
||||
deviceId: record.id,
|
||||
status: 4,
|
||||
force: false,
|
||||
};
|
||||
await deviceChangeStatus(params);
|
||||
reload();
|
||||
}
|
||||
function addDevice() {
|
||||
openModal(true, {
|
||||
title: '新增设备',
|
||||
isUpdate: false,
|
||||
houseCode: records.value.houseCode,
|
||||
});
|
||||
}
|
||||
function edit(record) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
houseCode: records.value.houseCode,
|
||||
title: '编辑',
|
||||
});
|
||||
}
|
||||
function onlyread(record) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
onlyRead: true,
|
||||
title: '详情',
|
||||
});
|
||||
}
|
||||
function deviceDeleteBtn(record) {
|
||||
deviceDelete({ id: record.id }, reload);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.device-table {
|
||||
/deep/ .ant-form-item-control-input-content {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" width="40%" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" :disabled="onlyRead">
|
||||
<template #startTime="{ model }">
|
||||
<a-time-picker v-model:value="model['startTime']" format="HH:mm" value-format="HH:mm" />
|
||||
</template>
|
||||
<template #endTime="{ model }">
|
||||
<a-time-picker v-model:value="model['endTime']" format="HH:mm" value-format="HH:mm" />
|
||||
</template>
|
||||
</BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { useForm } from '/@/components/Form';
|
||||
import BasicForm from '/@/components/Form/src/BasicForm.vue';
|
||||
import { deviceSchemas } from '/@/views/archive/healthCabin/healthRoom/index.data';
|
||||
import { deviceAdd, deviceEdit } from '/@/views/archive/healthCabin/healthRoom/index.api';
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
let title = ref('新增设备');
|
||||
let houseCode = ref();
|
||||
let deviceId = ref();
|
||||
let isUpdate = ref(false);
|
||||
const onlyRead = ref('false');
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
console.log(data);
|
||||
setModalProps({ confirmLoading: false });
|
||||
await resetFields();
|
||||
title.value = data.title;
|
||||
houseCode.value = data.houseCode;
|
||||
isUpdate.value = data.isUpdate;
|
||||
onlyRead.value = data.onlyRead;
|
||||
if (data.isUpdate) {
|
||||
setFieldsValue({ ...data.record });
|
||||
deviceId.value = data.record.id;
|
||||
}
|
||||
});
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas: deviceSchemas,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
async function handleSubmit() {
|
||||
console.log(123);
|
||||
try {
|
||||
let values = await validate();
|
||||
setModalProps({ confirmLoading: true });
|
||||
values.houseCode = houseCode.value;
|
||||
if (isUpdate.value) {
|
||||
values.id = deviceId.value;
|
||||
await deviceEdit(values);
|
||||
} else {
|
||||
console.log(values);
|
||||
await deviceAdd(values);
|
||||
}
|
||||
closeModal();
|
||||
emit('success');
|
||||
} catch (e) {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<template>
|
||||
<BasicModal :title="title" v-bind="$attrs" width="40%" @ok="handleSubmit" @register="registerModal">
|
||||
<BasicForm @register="registerForm">
|
||||
<template #defaultLayout="{ model }">
|
||||
<a-checkbox-group v-model:value="model['defaultLayout']" :options="plainOptions" />
|
||||
</template>
|
||||
</BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { useForm } from '/@/components/Form';
|
||||
import BasicForm from '/@/components/Form/src/BasicForm.vue';
|
||||
import { defaultLayoutSchemas } from '/@/views/archive/healthCabin/healthRoom/index.data';
|
||||
import { getDictCache } from '/@/utils/dict';
|
||||
|
||||
const title = ref('新增');
|
||||
const isUpdate = ref();
|
||||
const state = ref();
|
||||
let plainOptions = ref();
|
||||
// console.log(plainOptions)
|
||||
onMounted(async () => {
|
||||
plainOptions.value = getDictCache('week');
|
||||
});
|
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
console.log(data);
|
||||
// await resetFields();
|
||||
title.value = data.title;
|
||||
isUpdate.value = data.isUpdate;
|
||||
});
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas: defaultLayoutSchemas,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
let values = await validate();
|
||||
console.log(values);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" width="40%" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm">
|
||||
<template #openTime="{ model }">
|
||||
<a-time-picker v-model:value="model['openTime']" format="HH:mm" value-format="HH:mm" />
|
||||
</template>
|
||||
<template #closeTime="{ model }">
|
||||
<a-time-picker v-model:value="model['closeTime']" format="HH:mm" value-format="HH:mm" />
|
||||
</template>
|
||||
</BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { useForm } from '/@/components/Form';
|
||||
import BasicForm from '/@/components/Form/src/BasicForm.vue';
|
||||
import { layoutSchemas } from '/@/views/archive/healthCabin/healthRoom/index.data';
|
||||
import { defaultEdit } from '/@/views/archive/healthCabin/healthRoom/index.api';
|
||||
const title = ref('新增');
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref();
|
||||
const state = ref();
|
||||
const houseCode = ref();
|
||||
const layoutId = ref();
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false });
|
||||
console.log(data);
|
||||
data.record.wokrStatus = data.record.wokrStatus.toString();
|
||||
await setFieldsValue({ ...data.record });
|
||||
title.value = data.title;
|
||||
isUpdate.value = data.isUpdate;
|
||||
houseCode.value = data.record.houseCode;
|
||||
layoutId.value = data.record.id;
|
||||
});
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas: layoutSchemas,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
async function handleSubmit() {
|
||||
setModalProps({ confirmLoading: true });
|
||||
let values = await validate();
|
||||
values.id = layoutId.value;
|
||||
values.houseCode = houseCode.value;
|
||||
console.log(values);
|
||||
// defaultEdit
|
||||
await defaultEdit(values);
|
||||
closeModal();
|
||||
emit('success');
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,102 @@
|
||||
<template>
|
||||
<BasicDrawer @register="registerDrawer" title="默认模板" :width="900" :show-footer="false">
|
||||
<BasicTable @register="deviceTable" :pagination="false" size="small" :rowSelection="rowSelection" class="layout-table">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'openTime'">
|
||||
<div>{{ record.openTime }}--{{ record.closeTime }}</div>
|
||||
</template>
|
||||
</template>
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" :icon="h(EditOutlined)" @click="edit"> 编辑 </a-button>
|
||||
<!-- <a-button type="primary" :icon="h(PlusOutlined)" @click="editLayout"> 修改默认模板 </a-button>-->
|
||||
</template>
|
||||
</BasicTable>
|
||||
<EditLayoutModal @register="layoutModal" @success="layoutSuccess"></EditLayoutModal>
|
||||
<EditDefaultLayoutModal @register="defaultLayoutModal"></EditDefaultLayoutModal>
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, unref, h } from 'vue';
|
||||
import { PlusOutlined, EditOutlined } from '@ant-design/icons-vue';
|
||||
import BasicDrawer from '/@/components/Drawer/src/BasicDrawer.vue';
|
||||
import { useDrawer, useDrawerInner } from '/@/components/Drawer';
|
||||
import BasicTable from '/@/components/Table/src/BasicTable.vue';
|
||||
import { layoutColumns } from '/@/views/archive/healthCabin/healthRoom/index.data';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import EditLayoutModal from '/@/views/archive/healthCabin/healthRoom/components/editLayoutModal.vue';
|
||||
import EditDefaultLayoutModal from '/@/views/archive/healthCabin/healthRoom/components/editDefaultLayoutModal.vue';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { defaultList } from '/@/views/archive/healthCabin/healthRoom/index.api';
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const houseCode = ref();
|
||||
const [registerDrawer, { setDrawerProps }] = useDrawerInner(async (data) => {
|
||||
houseCode.value = data.record.houseCode;
|
||||
});
|
||||
|
||||
const [layoutModal, { openModal: openLayoutModal }] = useModal();
|
||||
const [defaultLayoutModal, { openModal: openDefaultLayoutModal }] = useModal();
|
||||
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: '设备管理表',
|
||||
api: defaultList,
|
||||
// dataSource: dataSource,
|
||||
columns: layoutColumns,
|
||||
canResize: false,
|
||||
orderFlag: false,
|
||||
defSort: {
|
||||
column: 'houseWorkDay',
|
||||
order: 'asc',
|
||||
},
|
||||
rowSelection: { type: 'radio' },
|
||||
showActionColumn: false,
|
||||
formConfig: {
|
||||
showSubmitButton: false,
|
||||
showResetButton: false,
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
params['houseCode'] = houseCode.value;
|
||||
return params;
|
||||
},
|
||||
showIndexColumn: false,
|
||||
// actionColumn: {
|
||||
// width: 450,
|
||||
// fixed: 'right',
|
||||
// },
|
||||
},
|
||||
});
|
||||
const [deviceTable, { reload, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
function edit() {
|
||||
if (!selectedRowKeys.value.length || selectedRowKeys.value.length > 1) {
|
||||
return createMessage.warning('请选择一条数据!');
|
||||
}
|
||||
let id = selectedRowKeys.value[0];
|
||||
let dataSource = getDataSource();
|
||||
let record = dataSource.filter((item) => item.id === id)[0];
|
||||
openLayoutModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
title: '编辑',
|
||||
});
|
||||
}
|
||||
function editLayout() {
|
||||
openDefaultLayoutModal(true, {
|
||||
isUpdate: true,
|
||||
title: '编辑',
|
||||
});
|
||||
}
|
||||
function layoutSuccess() {
|
||||
reload();
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.layout-table {
|
||||
/deep/ .ant-form {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,86 @@
|
||||
<template>
|
||||
<BasicDrawer @register="projectDrawer" title="设备项目" :width="900" :show-footer="false" :maskClosable="false">
|
||||
<BasicTable @register="projectTable" :rowSelection="rowSelection" class="device-table">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" :icon="h(PlusOutlined)" @click="addProject"> 新增 </a-button>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<ProjectModal @register="projectModal" @success="handleSuccess"></ProjectModal>
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import BasicDrawer from '/@/components/Drawer/src/BasicDrawer.vue';
|
||||
import { useDrawerInner } from '/@/components/Drawer';
|
||||
import ProjectModal from '/@/views/archive/healthCabin/healthRoom/components/projectModal.vue';
|
||||
import BasicTable from '/@/components/Table/src/BasicTable.vue';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { projectList, projectDetele } from '/@/views/archive/healthCabin/healthRoom/index.api';
|
||||
import { projectColums } from '/@/views/archive/healthCabin/healthRoom/index.data';
|
||||
import { ref, h } from 'vue';
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import { TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
let deviceCode = ref();
|
||||
let deviceName = ref();
|
||||
const [projectDrawer, { setDrawerProps }] = useDrawerInner(async (data) => {
|
||||
console.log(data.record, 1111111);
|
||||
deviceCode.value = data.record.deviceCode;
|
||||
deviceName.value = data.record.deviceName;
|
||||
});
|
||||
const [projectModal, { openModal }] = useModal();
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: '设备项目表',
|
||||
api: projectList,
|
||||
columns: projectColums,
|
||||
canResize: false,
|
||||
orderFlag: false,
|
||||
showIndexColumn: false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 100,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
const [projectTable, { reload, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
function getTableAction(record: any) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: projectEdit.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
onClick: projectDelete.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
function addProject() {
|
||||
openModal(true, {
|
||||
title: '新增',
|
||||
isUpdate: false,
|
||||
deviceCode: deviceCode.value,
|
||||
deviceName: deviceName.value,
|
||||
});
|
||||
}
|
||||
function projectEdit(record) {
|
||||
openModal(true, {
|
||||
title: '编辑',
|
||||
record,
|
||||
isUpdate: true,
|
||||
deviceCode: deviceCode.value,
|
||||
deviceName: deviceName.value,
|
||||
});
|
||||
}
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
}
|
||||
function projectDelete(record) {
|
||||
projectDetele({ id: record.id }, reload);
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,56 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" width="40%" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm"> </BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { useForm } from '/@/components/Form';
|
||||
import BasicForm from '/@/components/Form/src/BasicForm.vue';
|
||||
import { projectSchemas } from '/@/views/archive/healthCabin/healthRoom/index.data';
|
||||
import { projectAdd, projectEdit } from '/@/views/archive/healthCabin/healthRoom/index.api';
|
||||
const title = ref('新增');
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const deviceCode = ref();
|
||||
const isUpdate = ref(false);
|
||||
const projectId = ref();
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
console.log(data.record);
|
||||
setModalProps({ confirmLoading: false });
|
||||
await resetFields();
|
||||
title.value = `设备名称:${data.deviceName},设备编号:${data.deviceCode}`;
|
||||
deviceCode.value = data.deviceCode;
|
||||
isUpdate.value = data.isUpdate;
|
||||
if (data.isUpdate) {
|
||||
projectId.value = data.record.id;
|
||||
await setFieldsValue({ ...data.record });
|
||||
}
|
||||
});
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas: projectSchemas,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const values = await validate();
|
||||
console.log(values);
|
||||
values.deviceCode = deviceCode.value;
|
||||
if (isUpdate.value) {
|
||||
values.id = projectId.value;
|
||||
await projectEdit(values);
|
||||
} else {
|
||||
await projectAdd(values);
|
||||
}
|
||||
closeModal();
|
||||
emit('success');
|
||||
} catch (e) {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,112 @@
|
||||
<template>
|
||||
<BasicDrawer @register="registerDrawer" title="默认模板" :width="900" :show-footer="false">
|
||||
<BasicTable @register="deviceTable" :pagination="true" size="small" :rowSelection="rowSelection" class="layout-table">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'openTime'">
|
||||
<div>{{ record.openTime }}--{{ record.closeTime }}</div>
|
||||
</template>
|
||||
</template>
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" :icon="h(PlusOutlined)" @click="add"> 新增 </a-button>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<SelfLayoutModal @register="selfModal" @success="selfSuccess"></SelfLayoutModal>
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, unref, h } from 'vue';
|
||||
import { PlusOutlined, EditOutlined } from '@ant-design/icons-vue';
|
||||
import BasicDrawer from '/@/components/Drawer/src/BasicDrawer.vue';
|
||||
import { useDrawer, useDrawerInner } from '/@/components/Drawer';
|
||||
import BasicTable from '/@/components/Table/src/BasicTable.vue';
|
||||
import { selfLayoutColumns } from '/@/views/archive/healthCabin/healthRoom/index.data';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import SelfLayoutModal from '/@/views/archive/healthCabin/healthRoom/components/selfLayoutModal.vue';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { selfLayoutList, selfLayoutDelete } from '/@/views/archive/healthCabin/healthRoom/index.api';
|
||||
import { TableAction } from '/@/components/Table';
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const houseCode = ref();
|
||||
const [registerDrawer, { setDrawerProps }] = useDrawerInner(async (data) => {
|
||||
houseCode.value = data.record.houseCode;
|
||||
console.log(data);
|
||||
});
|
||||
|
||||
const [selfModal, { openModal }] = useModal();
|
||||
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: '设备管理表',
|
||||
api: selfLayoutList,
|
||||
// dataSource: dataSource,
|
||||
columns: selfLayoutColumns,
|
||||
canResize: false,
|
||||
orderFlag: false,
|
||||
showActionColumn: true,
|
||||
formConfig: {
|
||||
showSubmitButton: false,
|
||||
showResetButton: false,
|
||||
},
|
||||
defSort: {
|
||||
column: 'defineDate',
|
||||
order: 'asc',
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
params['houseCode'] = houseCode.value;
|
||||
return params;
|
||||
},
|
||||
showIndexColumn: false,
|
||||
// actionColumn: {
|
||||
// width: 450,
|
||||
// fixed: 'right',
|
||||
// },
|
||||
},
|
||||
});
|
||||
const [deviceTable, { reload, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
function add() {
|
||||
openModal(true, {
|
||||
houseCode: houseCode.value,
|
||||
title: '新增',
|
||||
});
|
||||
}
|
||||
function getTableAction(record: any) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
onClick: handleDetele.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
function handleEdit(record) {
|
||||
openModal(true, {
|
||||
houseCode: houseCode.value,
|
||||
isUpdate: true,
|
||||
title: '编辑',
|
||||
record,
|
||||
});
|
||||
}
|
||||
function handleDetele(record) {
|
||||
selfLayoutDelete({ id: record.id }, reload);
|
||||
}
|
||||
function selfSuccess() {
|
||||
reload();
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.layout-table {
|
||||
/deep/ .ant-form {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,170 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" width="40%" @ok="handleSubmit">
|
||||
<BasicForm @register="register" class="self">
|
||||
<template #add="{ field }">
|
||||
<Button v-if="Number(field) === 0 && !isUpdate" @click="add">+</Button>
|
||||
<Button v-if="field > 0" @click="del(field)">-</Button>
|
||||
</template>
|
||||
</BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { Button } from '/@/components/Button';
|
||||
import { selfLayoutSchemas } from '/@/views/archive/healthCabin/healthRoom/index.data';
|
||||
import { selfLayoutAdd, selfLayoutEdit } from '/@/views/archive/healthCabin/healthRoom/index.api';
|
||||
const title = ref('新增');
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(false);
|
||||
const state = ref();
|
||||
const houseCode = ref();
|
||||
const selfLayoutId = ref();
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
console.log(data);
|
||||
houseCode.value = data.houseCode;
|
||||
await resetFields();
|
||||
// addSchema(0);
|
||||
// await removeSchemaByFiled()
|
||||
title.value = data.title;
|
||||
isUpdate.value = data.isUpdate;
|
||||
await removeSchemaByFiled(['wokrStatus']);
|
||||
if (data.isUpdate) {
|
||||
await appendSchemaByField(
|
||||
{
|
||||
field: `wokrStatus`,
|
||||
component: 'JDictSelectTag',
|
||||
label: '是否启用',
|
||||
colProps: {
|
||||
span: 8,
|
||||
},
|
||||
componentProps: {
|
||||
dictCode: 'yes_no',
|
||||
},
|
||||
},
|
||||
''
|
||||
);
|
||||
selfLayoutId.value = data.record.id;
|
||||
const DateTime = data.record.defineDate + ' 00:00:00';
|
||||
await setFieldsValue({ defineDate: DateTime });
|
||||
await setFieldsValue({ 'houseOpenTime[0].openTime': data.record.openTime });
|
||||
await setFieldsValue({ 'houseOpenTime[0].closeTime': data.record.closeTime });
|
||||
}
|
||||
});
|
||||
const [register, { resetFields, setFieldsValue, appendSchemaByField, removeSchemaByFiled, validate }] = useForm({
|
||||
labelWidth: 100,
|
||||
actionColOptions: { span: 24 },
|
||||
schemas: selfLayoutSchemas,
|
||||
showSubmitButton: false,
|
||||
showResetButton: false,
|
||||
});
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const data = await validate();
|
||||
const result = Object.keys(data).reduce(
|
||||
(acc, key) => {
|
||||
const parts = key.match(/houseOpenTime\[(\d+)\]\.(\w+)/);
|
||||
if (parts) {
|
||||
const index = parseInt(parts[1], 10);
|
||||
const prop = parts[2];
|
||||
if (!acc.houseOpenTime[index]) {
|
||||
acc.houseOpenTime[index] = {};
|
||||
}
|
||||
acc.houseOpenTime[index][prop] = data[key];
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{ houseOpenTime: [] }
|
||||
);
|
||||
console.log(result);
|
||||
console.log(data);
|
||||
const params = {
|
||||
houseCode: houseCode.value,
|
||||
defineDate: data.defineDate,
|
||||
houseOpenTime: result.houseOpenTime,
|
||||
};
|
||||
if (isUpdate.value) {
|
||||
params.wokrStatus = data.wokrStatus;
|
||||
params.id = selfLayoutId.value;
|
||||
await selfLayoutEdit(params);
|
||||
} else {
|
||||
await selfLayoutAdd(params);
|
||||
}
|
||||
result.houseOpenTime.forEach((item, index) => {
|
||||
if (index == 0) return;
|
||||
if (index != 0) del(index);
|
||||
});
|
||||
closeModal();
|
||||
emit('success');
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
const n = ref(1);
|
||||
function add() {
|
||||
addSchema(n.value);
|
||||
n.value++;
|
||||
}
|
||||
|
||||
function addSchema(num) {
|
||||
appendSchemaByField(
|
||||
{
|
||||
field: `houseOpenTime[${num}].openTime`,
|
||||
component: 'TimePicker',
|
||||
label: '开始时间',
|
||||
colProps: {
|
||||
span: 8,
|
||||
},
|
||||
componentProps: {
|
||||
//日期格式化
|
||||
format: 'HH:mm',
|
||||
valueFormat: 'HH:mm',
|
||||
},
|
||||
},
|
||||
''
|
||||
);
|
||||
appendSchemaByField(
|
||||
{
|
||||
field: `houseOpenTime[${num}].closeTime`,
|
||||
component: 'TimePicker',
|
||||
label: '结束时间',
|
||||
colProps: {
|
||||
span: 8,
|
||||
},
|
||||
componentProps: {
|
||||
//日期格式化
|
||||
format: 'HH:mm',
|
||||
valueFormat: 'HH:mm',
|
||||
},
|
||||
},
|
||||
''
|
||||
);
|
||||
|
||||
appendSchemaByField(
|
||||
{
|
||||
field: `${num}`,
|
||||
component: 'Input',
|
||||
label: '',
|
||||
colProps: {
|
||||
span: 8,
|
||||
},
|
||||
slot: 'add',
|
||||
},
|
||||
''
|
||||
);
|
||||
}
|
||||
function del(field) {
|
||||
removeSchemaByFiled([`houseOpenTime[${field}].closeTime`, `houseOpenTime[${field}].openTime`, `${field}`]);
|
||||
n.value--;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.self {
|
||||
/deep/ .ant-picker-panel-container {
|
||||
position: fixed !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<BasicDrawer @register="terminalDrawer" title="终端管理" :width="1200" :maskClosable="false" :show-footer="false">
|
||||
<BasicTable @register="terminalTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" :icon="h(PlusOutlined)" @click="addTerminal"> 新增 </a-button>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<AddTerminalModal @register="terminalRegister" @success="addTerminalSuccess"></AddTerminalModal>
|
||||
<TermEquipDrawer @register="termEquipRegister"></TermEquipDrawer>
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import BasicDrawer from '/@/components/Drawer/src/BasicDrawer.vue';
|
||||
import { useDrawer, useDrawerInner } from '/@/components/Drawer';
|
||||
import { ref, h } from 'vue';
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import BasicTable from '/@/components/Table/src/BasicTable.vue';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { terminalList, terminalDetele } from '/@/views/archive/healthCabin/healthRoom/index.api';
|
||||
import { terminalColumns, terminalSearchFormSchema } from '/@/views/archive/healthCabin/healthRoom/index.data';
|
||||
import { TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import AddTerminalModal from '/@/views/archive/healthCabin/healthRoom/components/addTerminalModal.vue';
|
||||
import TermEquipDrawer from '/@/views/archive/healthCabin/healthRoom/components/terminalEquipmentDrawer.vue';
|
||||
let houseCode = ref();
|
||||
const [terminalDrawer, { setDrawerProps }] = useDrawerInner(async (data) => {
|
||||
console.log(data);
|
||||
houseCode.value = data.record.houseCode;
|
||||
});
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: '健康室表',
|
||||
api: terminalList,
|
||||
columns: terminalColumns,
|
||||
canResize: false,
|
||||
orderFlag: false,
|
||||
showIndexColumn: false,
|
||||
formConfig: {
|
||||
schemas: terminalSearchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: false,
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
},
|
||||
// beforeFetch: (params) => {
|
||||
// params['orgCode'] = 'A01A11'
|
||||
// return params;
|
||||
// },
|
||||
actionColumn: {
|
||||
width: 200,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
const [terminalTable, { reload, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const [terminalRegister, { openModal }] = useModal();
|
||||
// termEquipRegister
|
||||
const [termEquipRegister, { openDrawer: openTermEquipDrawer }] = useDrawer();
|
||||
function addTerminal() {
|
||||
openModal(true, {
|
||||
title: '新增',
|
||||
houseCode: houseCode.value,
|
||||
});
|
||||
}
|
||||
function getTableAction(record: any) {
|
||||
return [
|
||||
{
|
||||
label: '终端设备',
|
||||
onClick: terminalEqui.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: editTerminal.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
onClick: deteleTerminal.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
function editTerminal(record) {
|
||||
openModal(true, {
|
||||
title: '编辑',
|
||||
isUpdate: true,
|
||||
record,
|
||||
houseCode: houseCode.value,
|
||||
});
|
||||
}
|
||||
function deteleTerminal(record) {
|
||||
terminalDetele({ id: record.id }, reload);
|
||||
}
|
||||
function addTerminalSuccess() {
|
||||
reload();
|
||||
}
|
||||
function terminalEqui(record) {
|
||||
openTermEquipDrawer(true, {
|
||||
record,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<BasicDrawer @register="projectDrawer" title="终端设备" :width="900" :show-footer="false" :maskClosable="false">
|
||||
<BasicTable @register="projectTable" :rowSelection="rowSelection" class="device-table">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" :icon="h(PlusOutlined)" @click="addTerEqui"> 新增 </a-button>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<AddTerEquiModal @register="TerEquiModal" @success="handleSuccess"></AddTerEquiModal>
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import BasicDrawer from '/@/components/Drawer/src/BasicDrawer.vue';
|
||||
import { useDrawerInner } from '/@/components/Drawer';
|
||||
import AddTerEquiModal from '/@/views/archive/healthCabin/healthRoom/components/addTerEquipmentModal.vue';
|
||||
import BasicTable from '/@/components/Table/src/BasicTable.vue';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { terEquiColums } from '/@/views/archive/healthCabin/healthRoom/index.data';
|
||||
import { ref, h } from 'vue';
|
||||
import { listByTerminal, terEquiDelete } from '/@/views/archive/healthCabin/healthRoom/index.api';
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import { TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
const terminalCode = ref();
|
||||
const [projectDrawer, { setDrawerProps }] = useDrawerInner(async (data) => {
|
||||
console.log(data.record, 1111111);
|
||||
terminalCode.value = data.record.terminalCode;
|
||||
});
|
||||
const [TerEquiModal, { openModal }] = useModal();
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: '设备项目表',
|
||||
api: listByTerminal,
|
||||
columns: terEquiColums,
|
||||
canResize: false,
|
||||
orderFlag: false,
|
||||
showIndexColumn: false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 100,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
params['terminalCode'] = terminalCode.value;
|
||||
return params;
|
||||
},
|
||||
},
|
||||
});
|
||||
const [projectTable, { reload, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
function getTableAction(record: any) {
|
||||
return [
|
||||
{
|
||||
label: '删除',
|
||||
onClick: projectDelete.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
function addTerEqui() {
|
||||
openModal(true, {
|
||||
title: '新增',
|
||||
terminalCode: terminalCode.value,
|
||||
isUpdate: false,
|
||||
});
|
||||
}
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
}
|
||||
function projectDelete(record) {
|
||||
terEquiDelete({ id: record.id }, reload);
|
||||
// projectDetele({ id: record.id }, reload);
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,201 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
enum Api {
|
||||
list = '/health-archives/housenew/healthHouseNew/list',
|
||||
addRoom = '/health-archives/housenew/healthHouseNew/add',
|
||||
deleteRoom = '/health-archives/housenew/healthHouseNew/delete',
|
||||
deleteBatchRoom = '/health-archives/housenew/healthHouseNew/deleteBatch',
|
||||
getRoomById = '/health-archives/housenew/healthHouseNew/queryById',
|
||||
editRoom = '/health-archives/housenew/healthHouseNew/edit',
|
||||
//设备
|
||||
deviceList = '/health-archives/housenew/healthHouseDeviceNew/list',
|
||||
deviceAdd = '/health-archives/housenew/healthHouseDeviceNew/add',
|
||||
deviceEdit = '/health-archives/housenew/healthHouseDeviceNew/edit',
|
||||
deviceDelete = '/health-archives/housenew/healthHouseDeviceNew/delete',
|
||||
deviceChangeStatus = '/health-archives/housenew/healthHouseDeviceNew/changeStatus',
|
||||
//设备项目
|
||||
projectList = '/health-archives/housenew/healthHouseDeviceProjectNew/list',
|
||||
projectAdd = '/health-archives/housenew/healthHouseDeviceProjectNew/add',
|
||||
projectEdit = '/health-archives/housenew/healthHouseDeviceProjectNew/edit',
|
||||
projectDetele = '/health-archives/housenew/healthHouseDeviceProjectNew/delete',
|
||||
//默认排班
|
||||
defaultList = '/health-archives//housenew/healthHouseNumberNew/list',
|
||||
defaultEdit = '/health-archives/housenew/healthHouseNumberNew/edit',
|
||||
//终端
|
||||
terminalList = '/health-archives/housenew/healthHouseTerminalNew/list',
|
||||
terminalAdd = '/health-archives/housenew/healthHouseTerminalNew/add',
|
||||
terminalEdit = '/health-archives/housenew/healthHouseTerminalNew/edit',
|
||||
terminalDetele = '/health-archives/housenew/healthHouseTerminalNew/delete',
|
||||
listByTerminal = '/health-archives/housenew/healthHouseDeviceNew/listByTerminal',
|
||||
bindDevices = '/health-archives/housenew/healthHouseTerminalNew/bindDevices',
|
||||
terEquiDelete = '/health-archives/housenew/healthHouseTerminalRelationNew/delete',
|
||||
//自定义排班
|
||||
selfLayoutList = '/health-archives/housenew/healthHouseDefineNew/list',
|
||||
selfLayoutAdd = '/health-archives/housenew/healthHouseDefineNew/add',
|
||||
selfLayoutDelete = '/health-archives/housenew/healthHouseDefineNew/delete',
|
||||
selfLayoutEdit = '/health-archives/housenew/healthHouseDefineNew/edit',
|
||||
// 管理员列表
|
||||
adminList = '/health-archives/housenew/healthHouseManagerNew/houseManagers',
|
||||
addAdmin = '/health-archives/housenew/healthHouseManagerNew/addHouseManagers',
|
||||
}
|
||||
// 健康室列表
|
||||
export const listApi = (params: any) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
// 通过id获取健康室信息
|
||||
export const getRoomById = (params: any) => defHttp.get({ url: Api.getRoomById, params });
|
||||
// 健康室新增
|
||||
export const addRoom = (params: any) => defHttp.post({ url: Api.addRoom, params });
|
||||
// 健康室编辑
|
||||
export const editRoom = (params: any) => defHttp.put({ url: Api.editRoom, params });
|
||||
//小屋删除
|
||||
// export const deleteRoom =
|
||||
export const deleteRoom = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.deleteRoom + `?id=${params.id}`, params }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
//健康室批量删除
|
||||
export const deleteBatchRoom = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.deleteBatchRoom, data: params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
//设备列表
|
||||
export const deviceList = (params: any) => defHttp.get({ url: Api.deviceList, params });
|
||||
//设备新增
|
||||
export const deviceAdd = (params: any) => defHttp.post({ url: Api.deviceAdd, params });
|
||||
//设备编辑
|
||||
export const deviceEdit = (params: any) => defHttp.put({ url: Api.deviceEdit, params });
|
||||
//设备删除
|
||||
export const deviceDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.deviceDelete + `?id=${params.id}`, params }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
//设备状态
|
||||
export const deviceChangeStatus = (params: any) => defHttp.post({ url: Api.deviceChangeStatus, params });
|
||||
//设备项目列表
|
||||
export const projectList = (params: any) => defHttp.get({ url: Api.projectList, params });
|
||||
//项目新增
|
||||
export const projectAdd = (params: any) => defHttp.post({ url: Api.projectAdd, params });
|
||||
//项目编辑
|
||||
export const projectEdit = (params: any) => defHttp.put({ url: Api.projectEdit, params });
|
||||
//项目删除
|
||||
export const projectDetele = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.projectDetele + `?id=${params.id}`, params }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
//默认排班列表
|
||||
export const defaultList = (params: any) => defHttp.get({ url: Api.defaultList, params });
|
||||
//默认排班编辑
|
||||
export const defaultEdit = (params: any) => defHttp.put({ url: Api.defaultEdit, params });
|
||||
//终端列表
|
||||
export const terminalList = (params: any) => defHttp.get({ url: Api.terminalList, params });
|
||||
//终端新增
|
||||
export const terminalAdd = (params: any) => defHttp.post({ url: Api.terminalAdd, params });
|
||||
//终端编辑
|
||||
export const terminalEdit = (params: any) => defHttp.put({ url: Api.terminalEdit, params });
|
||||
//终端删除 terminalDetele
|
||||
export const terminalDetele = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.terminalDetele + `?id=${params.id}`, params }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
//通过终端查询设备
|
||||
export const listByTerminal = (params: any) => defHttp.get({ url: Api.listByTerminal, params });
|
||||
//绑定终端设备
|
||||
export const bindDevices = (params: any) => defHttp.post({ url: Api.bindDevices, params });
|
||||
//终端设备删除
|
||||
export const terEquiDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.terEquiDelete + `?id=${params.id}`, params }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
//自定义排班列表
|
||||
export const selfLayoutList = (params: any) => defHttp.get({ url: Api.selfLayoutList, params });
|
||||
//自定义排班新增
|
||||
export const selfLayoutAdd = (params: any) => defHttp.post({ url: Api.selfLayoutAdd, params });
|
||||
|
||||
//自定义排班删除
|
||||
export const selfLayoutDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.selfLayoutDelete + `?id=${params.id}`, params }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
//自定义排班编辑
|
||||
|
||||
export const selfLayoutEdit = (params: any) => defHttp.put({ url: Api.selfLayoutEdit, params });
|
||||
|
||||
// 管理员列表
|
||||
export const adminList = (params: any) => defHttp.get({ url: Api.adminList, params });
|
||||
|
||||
// 管理员新增
|
||||
export const addAdmin = (params: any) => defHttp.post({ url: Api.addAdmin, params });
|
||||
@@ -0,0 +1,745 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { h } from 'vue';
|
||||
import { Image } from 'ant-design-vue';
|
||||
import { getDefaultImage, getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import { EyeOutlined } from '@ant-design/icons-vue';
|
||||
import { getThirdDepartListByOrgCode } from '/@/views/archive/employeeFile/employeeFileList.api';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { ref } from 'vue';
|
||||
import { checkPassword } from '/@/hooks/checkPassword/checkPassword';
|
||||
import { rules } from '/@/utils/helper/validator';
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '名称',
|
||||
align: 'center',
|
||||
dataIndex: 'houseName',
|
||||
},
|
||||
{
|
||||
title: '地点',
|
||||
align: 'center',
|
||||
dataIndex: 'housePlace',
|
||||
},
|
||||
{
|
||||
title: '图片',
|
||||
align: 'center',
|
||||
dataIndex: 'houseImage',
|
||||
customRender: ({ text }) => {
|
||||
const t = text ? text.replace(',', '') : null;
|
||||
return h(Image, {
|
||||
placeholder: true,
|
||||
src: getFileAccessHttpUrl(t),
|
||||
height: 50,
|
||||
width: 50,
|
||||
fallback: getDefaultImage(),
|
||||
previewMask: () => {
|
||||
return h(EyeOutlined, {
|
||||
style: {
|
||||
color: 'white',
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '所属部门',
|
||||
align: 'center',
|
||||
dataIndex: 'departName',
|
||||
},
|
||||
{
|
||||
title: '启用',
|
||||
align: 'center',
|
||||
dataIndex: 'houseStatus_dictText',
|
||||
// customRender: ({ text }) => {
|
||||
// if (!text) return '';
|
||||
// return text == '1' ? '是' : '否';
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '法定排班',
|
||||
align: 'center',
|
||||
dataIndex: 'legalStatus_dictText',
|
||||
},
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '所属部门',
|
||||
field: 'orgCode',
|
||||
component: 'ApiSelect',
|
||||
componentProps: () => {
|
||||
const userOrgCode = user?.userInfo?.orgCode?.substring(0, 6);
|
||||
return {
|
||||
api: getThirdDepartListByOrgCode,
|
||||
resultField: 'list',
|
||||
labelField: 'departName',
|
||||
params: {
|
||||
orgCode: userOrgCode || '12313',
|
||||
},
|
||||
valueField: 'orgCode',
|
||||
immediate: true,
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '启用状态',
|
||||
field: 'houseStatus',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'yes_no',
|
||||
},
|
||||
},
|
||||
];
|
||||
const user = useUserStore();
|
||||
export const schemas: FormSchema[] = [
|
||||
{
|
||||
label: '健康室名称',
|
||||
field: 'houseName',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '健康室地址',
|
||||
field: 'housePlace',
|
||||
component: 'Input',
|
||||
slot: 'address',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '所属部门',
|
||||
field: 'orgCode',
|
||||
component: 'ApiSelect',
|
||||
required: true,
|
||||
componentProps: () => {
|
||||
const userOrgCode = user?.userInfo?.orgCode?.substring(0, 6);
|
||||
return {
|
||||
api: getThirdDepartListByOrgCode,
|
||||
resultField: 'list',
|
||||
labelField: 'departName',
|
||||
params: {
|
||||
orgCode: userOrgCode || '12313',
|
||||
},
|
||||
valueField: 'orgCode',
|
||||
immediate: true,
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '使用部门',
|
||||
field: 'useDeparts',
|
||||
component: 'ApiSelect',
|
||||
required: true,
|
||||
componentProps: () => {
|
||||
const userOrgCode = user?.userInfo?.orgCode?.substring(0, 6);
|
||||
return {
|
||||
api: getThirdDepartListByOrgCode,
|
||||
resultField: 'list',
|
||||
mode: 'multiple',
|
||||
labelField: 'departName',
|
||||
params: {
|
||||
orgCode: userOrgCode || '12313',
|
||||
},
|
||||
valueField: 'orgCode',
|
||||
immediate: true,
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '默认排班',
|
||||
field: 'defaultHouseNumber',
|
||||
component: 'Input',
|
||||
defaultValue: '5,4,3,2,1',
|
||||
slot: 'defaultHouseNumber',
|
||||
},
|
||||
{
|
||||
label: '使用法定排班',
|
||||
field: 'legalStatus',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'yes_no',
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '启用状态',
|
||||
field: 'houseStatus',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'yes_no',
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '健康室图片',
|
||||
field: 'houseImage',
|
||||
component: 'JImageUpload',
|
||||
componentProps: {
|
||||
maxCount: 1,
|
||||
},
|
||||
rules: [{ required: true, trigger: 'blur', message: '请上传健康室图片' }],
|
||||
},
|
||||
];
|
||||
|
||||
export const deviceColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '设备编号',
|
||||
align: 'center',
|
||||
dataIndex: 'deviceCode',
|
||||
},
|
||||
{
|
||||
title: '设备名称',
|
||||
align: 'center',
|
||||
dataIndex: 'deviceName',
|
||||
},
|
||||
{
|
||||
title: '设备状态',
|
||||
align: 'center',
|
||||
dataIndex: 'deviceStatus',
|
||||
customRender: ({ text }) => {
|
||||
if (!text) return '';
|
||||
switch (text) {
|
||||
case 1:
|
||||
return '有效';
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '设备图片',
|
||||
align: 'center',
|
||||
dataIndex: 'deviceImage',
|
||||
customRender: ({ text }) => {
|
||||
const t = text ? text.replace(',', '') : null;
|
||||
return h(Image, {
|
||||
placeholder: true,
|
||||
src: getFileAccessHttpUrl(t),
|
||||
height: 50,
|
||||
width: 50,
|
||||
fallback: getDefaultImage(),
|
||||
previewMask: () => {
|
||||
return h(EyeOutlined, {
|
||||
style: {
|
||||
color: 'white',
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '设备类型',
|
||||
align: 'center',
|
||||
dataIndex: 'categoryCode', //
|
||||
customRender: ({ text }) => {
|
||||
if (!text) return '';
|
||||
if (text == 1) return '测量设备';
|
||||
if (text == 2) return '心理检测';
|
||||
if (text == 3) return '治疗设备';
|
||||
if (text == 4) return '监测设备';
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '单位预约时间(分钟)',
|
||||
align: 'center',
|
||||
dataIndex: 'lengthOfTime',
|
||||
},
|
||||
{
|
||||
title: '可预约人数(人)',
|
||||
align: 'center',
|
||||
dataIndex: 'useNum',
|
||||
},
|
||||
];
|
||||
export const deviceSearchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '设备类型',
|
||||
field: 'categoryCode',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'house_category',
|
||||
},
|
||||
},
|
||||
];
|
||||
export const deviceSchemas: FormSchema[] = [
|
||||
{
|
||||
label: '设备编号',
|
||||
field: 'deviceCode',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '设备名称',
|
||||
field: 'deviceName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '设备类型',
|
||||
field: 'categoryCode',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'house_category',
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '单位预约时间',
|
||||
field: 'lengthOfTime',
|
||||
component: 'Select',
|
||||
ifShow: ({ values }) => {
|
||||
if (!values.categoryCode) return false;
|
||||
if (values.categoryCode != 4) {
|
||||
return true;
|
||||
} else {
|
||||
values.lengthOfTime = '';
|
||||
return false;
|
||||
}
|
||||
},
|
||||
componentProps: {
|
||||
options: [
|
||||
{
|
||||
label: '10分钟',
|
||||
value: '10',
|
||||
},
|
||||
{
|
||||
label: '20分钟',
|
||||
value: '20',
|
||||
},
|
||||
{
|
||||
label: '30分钟',
|
||||
value: '30',
|
||||
},
|
||||
{
|
||||
label: '40分钟',
|
||||
value: '40',
|
||||
},
|
||||
{
|
||||
label: '50分钟',
|
||||
value: '50',
|
||||
},
|
||||
{
|
||||
label: '60分钟',
|
||||
value: '60',
|
||||
},
|
||||
],
|
||||
placeholder: '请选择时长',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '可预约人数',
|
||||
field: 'useNum',
|
||||
component: 'Input',
|
||||
ifShow: ({ values }) => {
|
||||
if (!values.categoryCode) return false;
|
||||
if (values.categoryCode != 4) {
|
||||
return true;
|
||||
} else {
|
||||
values.useNum = '';
|
||||
return false;
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '添加图片',
|
||||
field: 'deviceImage',
|
||||
component: 'JImageUpload',
|
||||
componentProps: {
|
||||
maxCount: 1,
|
||||
},
|
||||
rules: [{ required: true, trigger: 'blur', message: '请上传健康室图片' }],
|
||||
},
|
||||
{
|
||||
label: '设备介绍',
|
||||
field: 'deviceRemark',
|
||||
component: 'JEditor',
|
||||
componentProps: () => {
|
||||
return {
|
||||
height: 200,
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '预约须知',
|
||||
field: 'deviceNotice',
|
||||
component: 'JEditor',
|
||||
componentProps: () => {
|
||||
return {
|
||||
height: 200,
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
export const layoutColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '工作日',
|
||||
dataIndex: 'houseWorkDay',
|
||||
customCell: (_, index) => {
|
||||
if (index % 2 === 0) {
|
||||
return {
|
||||
rowSpan: 2,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
rowSpan: 0,
|
||||
};
|
||||
}
|
||||
},
|
||||
customRender: ({ text }) => {
|
||||
if (text == 1) return '星期一';
|
||||
if (text == 2) return '星期二';
|
||||
if (text == 3) return '星期三';
|
||||
if (text == 4) return '星期四';
|
||||
if (text == 5) return '星期五';
|
||||
if (text == 6) return '星期六';
|
||||
if (text == 7) return '星期日';
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '开放时间',
|
||||
dataIndex: 'openTime',
|
||||
},
|
||||
{
|
||||
title: '启用',
|
||||
dataIndex: 'wokrStatus',
|
||||
customRender: ({ text }) => {
|
||||
if (text == 1) return '是';
|
||||
if (text == 0) return '否';
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const layoutSchemas: FormSchema[] = [
|
||||
{
|
||||
field: 'houseWorkDay',
|
||||
label: '工作日',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'week',
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
field: 'openTime',
|
||||
label: '开始时间',
|
||||
component: 'Input',
|
||||
slot: 'openTime',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
field: 'closeTime',
|
||||
label: '结束时间',
|
||||
component: 'Input',
|
||||
slot: 'closeTime',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
field: 'wokrStatus',
|
||||
label: '排班状态:启用',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'yes_no',
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
];
|
||||
|
||||
export const defaultLayoutSchemas: FormSchema[] = [
|
||||
{
|
||||
field: 'defaultLayout',
|
||||
label: '默认排班',
|
||||
component: 'Input',
|
||||
slot: 'defaultLayout',
|
||||
},
|
||||
{
|
||||
field: 'use',
|
||||
label: '使用法定排班',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'yes_no',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const projectColums: BasicColumn[] = [
|
||||
{
|
||||
title: '项目编号',
|
||||
dataIndex: 'projectCode',
|
||||
},
|
||||
{
|
||||
title: '项目名称',
|
||||
dataIndex: 'projectName',
|
||||
},
|
||||
{
|
||||
title: '项目是否有效',
|
||||
dataIndex: 'projectStatus',
|
||||
customRender: ({ text }) => {
|
||||
if (!text) return '';
|
||||
if (text == 0) return '无效';
|
||||
if (text == 1) return '有效';
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const projectSchemas: FormSchema[] = [
|
||||
{
|
||||
field: 'projectCode',
|
||||
label: '项目编号',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
field: 'projectName',
|
||||
label: '项目名称',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
field: 'projectStatus',
|
||||
label: '项目是否有效',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'yes_no',
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
field: 'projectNotice',
|
||||
label: '项目须知',
|
||||
component: 'InputTextArea',
|
||||
},
|
||||
];
|
||||
|
||||
// 终端
|
||||
export const terminalColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '终端编号',
|
||||
dataIndex: 'terminalCode',
|
||||
},
|
||||
{
|
||||
title: '终端名称',
|
||||
dataIndex: 'terminalName',
|
||||
},
|
||||
{
|
||||
title: '终端状态',
|
||||
dataIndex: 'terminalStatus',
|
||||
customRender: ({ text }) => {
|
||||
if (!text) return '';
|
||||
if (text == 0) return '无效';
|
||||
if (text == 1) return '有效';
|
||||
},
|
||||
},
|
||||
];
|
||||
export const terminalSearchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'terminalName',
|
||||
label: '终端名称',
|
||||
component: 'JInput',
|
||||
},
|
||||
];
|
||||
export const terminalFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'terminalCode',
|
||||
label: '终端编号',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
field: 'terminalName',
|
||||
label: '终端名称',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
field: 'terminalStatus',
|
||||
label: '是否有效',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'yes_no',
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
];
|
||||
//终端设备
|
||||
export const terEquiColums: BasicColumn[] = [
|
||||
{
|
||||
title: '设备编号',
|
||||
dataIndex: 'deviceCode',
|
||||
},
|
||||
{
|
||||
title: '设备名称',
|
||||
dataIndex: 'deviceName',
|
||||
},
|
||||
{
|
||||
title: '设备类型',
|
||||
dataIndex: 'categoryCode_dictText',
|
||||
},
|
||||
];
|
||||
export const terEquiChangeColums: BasicColumn[] = [
|
||||
{
|
||||
title: '设备编号',
|
||||
dataIndex: 'deviceCode',
|
||||
},
|
||||
{
|
||||
title: '设备名称',
|
||||
dataIndex: 'deviceName',
|
||||
},
|
||||
];
|
||||
export const selfLayoutColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '自定义日期',
|
||||
dataIndex: 'defineDate',
|
||||
},
|
||||
{
|
||||
title: '开放时间',
|
||||
dataIndex: 'openTime',
|
||||
slots: 'openTime',
|
||||
},
|
||||
{
|
||||
title: '启用',
|
||||
dataIndex: 'wokrStatus',
|
||||
customRender: ({ text }) => {
|
||||
if (!text) return '';
|
||||
if (text == 0) return '否';
|
||||
if (text == 1) return '是';
|
||||
},
|
||||
},
|
||||
];
|
||||
export const selfLayoutSchemas: FormSchema[] = [
|
||||
{
|
||||
field: 'defineDate',
|
||||
component: 'DatePicker',
|
||||
label: '选择日期',
|
||||
componentProps: {
|
||||
//日期格式化
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
field: 'houseOpenTime[0].openTime',
|
||||
component: 'TimePicker',
|
||||
label: '开始时间',
|
||||
colProps: {
|
||||
span: 8,
|
||||
},
|
||||
componentProps: {
|
||||
//日期格式化
|
||||
format: 'HH:mm',
|
||||
valueFormat: 'HH:mm',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'houseOpenTime[0].closeTime',
|
||||
component: 'TimePicker',
|
||||
label: '结束时间',
|
||||
colProps: {
|
||||
span: 8,
|
||||
},
|
||||
componentProps: {
|
||||
//日期格式化
|
||||
format: 'HH:mm',
|
||||
valueFormat: 'HH:mm',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: '0',
|
||||
component: 'Input',
|
||||
label: '',
|
||||
colProps: {
|
||||
span: 8,
|
||||
},
|
||||
slot: 'add',
|
||||
},
|
||||
];
|
||||
|
||||
// 管理员列表
|
||||
export const administratorColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '账号',
|
||||
dataIndex: 'userName',
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'realName',
|
||||
},
|
||||
];
|
||||
export const administratorSearchForm: FormSchema[] = [
|
||||
{
|
||||
field: 'realName',
|
||||
label: '姓名',
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
||||
export const administratorFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'userName',
|
||||
label: '账号',
|
||||
component: 'Input',
|
||||
componentProps: ({ formModel }) => {
|
||||
return {
|
||||
onInput: () => {
|
||||
formModel.username = formModel.username.replace(/[^a-zA-Z0-9_]/g, '');
|
||||
},
|
||||
autocomplete: 'off',
|
||||
};
|
||||
},
|
||||
dynamicDisabled: ({ values }) => {
|
||||
return !!values.id;
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
field: 'realName',
|
||||
label: '姓名',
|
||||
component: 'Input',
|
||||
componentProps: () => {
|
||||
return {
|
||||
autocomplete: 'off',
|
||||
};
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '密码',
|
||||
field: 'password',
|
||||
component: 'StrengthMeter',
|
||||
componentProps: () => {
|
||||
return {
|
||||
autocomplete: 'new-password',
|
||||
};
|
||||
},
|
||||
dynamicRules: () => {
|
||||
return [
|
||||
{
|
||||
required: true,
|
||||
validator: (_, value) => {
|
||||
if (!value) {
|
||||
return Promise.reject('请输入登录密码');
|
||||
}
|
||||
let { message } = checkPassword(value);
|
||||
if (message === 'ok') {
|
||||
return Promise.resolve();
|
||||
} else {
|
||||
return Promise.reject(message);
|
||||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
},
|
||||
];
|
||||
},
|
||||
ifShow: ({ values }) => {
|
||||
return !values.id;
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '确认密码',
|
||||
field: 'confirmPassword',
|
||||
component: 'InputPassword',
|
||||
componentProps: () => {
|
||||
return {
|
||||
autocomplete: 'off',
|
||||
};
|
||||
},
|
||||
dynamicRules: ({ values }) => rules.confirmPassword(values, true),
|
||||
ifShow: ({ values }) => {
|
||||
return !values.id;
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,177 @@
|
||||
<template>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" :icon="h(PlusOutlined)" @click="addRoom"> 新增 </a-button>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<AddRoom @register="addModal" @success="handleSuccess" />
|
||||
<DeviceDrawer @register="registerDrawer" />
|
||||
<LayoutDrawer @register="layoutDrawer" />
|
||||
<TerminalDrawer @register="terminalDrawer" />
|
||||
<AdminModal @register="adminModal" @success="handleSuccess" />
|
||||
<SelfLayoutDrawer @register="selfLayoutDrawer" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, h } from 'vue';
|
||||
import BasicTable from '/@/components/Table/src/BasicTable.vue';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { TableAction } from '/@/components/Table';
|
||||
import { columns, searchFormSchema } from '/@/views/archive/healthCabin/healthRoom/index.data';
|
||||
import { listApi, deleteRoom } from '/@/views/archive/healthCabin/healthRoom/index.api';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { PlusOutlined, EditOutlined, SearchOutlined, DeleteOutlined } from '@ant-design/icons-vue';
|
||||
//抽屉
|
||||
import DeviceDrawer from '/@/views/archive/healthCabin/healthRoom/components/deviceDrawer.vue';
|
||||
import LayoutDrawer from '/@/views/archive/healthCabin/healthRoom/components/layoutDrawer.vue';
|
||||
import TerminalDrawer from '/@/views/archive/healthCabin/healthRoom/components/terminalDrawer.vue';
|
||||
//新增健康室弹窗
|
||||
import AddRoom from '/@/views/archive/healthCabin/healthRoom/components/addRoomModal.vue';
|
||||
import AdminModal from '/@/views/archive/healthCabin/healthRoom/components/adminModal.vue';
|
||||
import SelfLayoutDrawer from '/@/views/archive/healthCabin/healthRoom/components/selfLayoutDrawer.vue';
|
||||
import { useDrawer } from '/@/components/Drawer';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
const { createMessage } = useMessage();
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: '健康室表',
|
||||
api: listApi,
|
||||
columns,
|
||||
canResize: false,
|
||||
orderFlag: false,
|
||||
showIndexColumn: false,
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: false,
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
},
|
||||
// beforeFetch: (params) => {
|
||||
// params['orgCode'] = 'A01A11'
|
||||
// return params;
|
||||
// },
|
||||
actionColumn: {
|
||||
width: 200,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
const [layoutDrawer, { openDrawer: openLayoutDrawer }] = useDrawer();
|
||||
const [terminalDrawer, { openDrawer: openTerminalDrawer }] = useDrawer();
|
||||
const [selfLayoutDrawer, { openDrawer: openSelfDrawer }] = useDrawer();
|
||||
const [addModal, { openModal }] = useModal();
|
||||
const [adminModal, { openDrawer: openAdminModal }] = useDrawer();
|
||||
function getTableAction(record: any) {
|
||||
return [
|
||||
{
|
||||
label: '设备管理',
|
||||
onClick: handleDevice.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '终端',
|
||||
onClick: handleTerminal.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
function getDropDownAction(record: any) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: edit.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
onClick: onlyread.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '默认排班',
|
||||
onClick: handleLayout.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '自定义排班',
|
||||
onClick: handleCustom.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '管理员',
|
||||
onClick: handleAdmin.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
onClick: handleDelete.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
// 设备管理
|
||||
function handleDevice(record) {
|
||||
openDrawer(true, {
|
||||
record,
|
||||
});
|
||||
}
|
||||
// 默认排版
|
||||
function handleLayout(record) {
|
||||
openLayoutDrawer(true, {
|
||||
record,
|
||||
});
|
||||
}
|
||||
// 自定义排版
|
||||
function handleCustom(record) {
|
||||
openSelfDrawer(true, {
|
||||
record,
|
||||
});
|
||||
}
|
||||
// 管理员
|
||||
function handleAdmin(record) {
|
||||
console.log(record);
|
||||
openAdminModal(true, {
|
||||
record,
|
||||
});
|
||||
}
|
||||
// 终端
|
||||
function handleTerminal(record) {
|
||||
console.log(record);
|
||||
openTerminalDrawer(true, {
|
||||
record,
|
||||
});
|
||||
}
|
||||
// 删除
|
||||
function handleDelete(record) {
|
||||
console.log(record);
|
||||
deleteRoom({ id: record.id }, reload);
|
||||
// deleteRoom
|
||||
}
|
||||
function edit(record) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
title: '编辑',
|
||||
});
|
||||
}
|
||||
function onlyread(record) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
onlyRead: true,
|
||||
title: '详情',
|
||||
});
|
||||
}
|
||||
function addRoom() {
|
||||
openModal(true, {
|
||||
isUpdate: false,
|
||||
title: '录入',
|
||||
});
|
||||
}
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" width="40%" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" :disabled="onlyRead" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, unref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import BasicForm from '/@/components/Form/src/BasicForm.vue';
|
||||
import { useForm } from '/@/components/Form';
|
||||
import { schemas } from '/@/views/archive/healthCabin/planWork/planWork.data';
|
||||
import { saveOrUpdate } from '/@/views/archive/healthCabin/planWork/planWork.api';
|
||||
//设置标题
|
||||
const title = ref(String);
|
||||
// Emits声明
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(true);
|
||||
const onlyRead = ref('false');
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
//重置表单
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
title.value = data.type;
|
||||
if (unref(isUpdate)) {
|
||||
data.record['rangeTime'] = `${data.record.openTime},${data.record.closeTime}`;
|
||||
}
|
||||
//表单赋值
|
||||
await setFieldsValue({
|
||||
...data.record,
|
||||
});
|
||||
// 隐藏底部时禁用整个表单
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate, setProps }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
let values = await validate();
|
||||
setModalProps({ confirmLoading: true });
|
||||
//提交表单
|
||||
await saveOrUpdate(values, isUpdate.value);
|
||||
//关闭弹窗
|
||||
closeModal();
|
||||
//刷新列表
|
||||
emit('success');
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,67 @@
|
||||
// noinspection Eslint
|
||||
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/health-archives/housenew/healthHouseDefaultNumberConfigNew/list',
|
||||
save = '/health-archives/housenew/healthHouseDefaultNumberConfigNew/add',
|
||||
edit = '/health-archives/housenew/healthHouseDefaultNumberConfigNew/edit',
|
||||
deleteOne = '/health-archives/housenew/healthHouseDefaultNumberConfigNew/delete',
|
||||
deleteBatch = '/health-archives/housenew/healthHouseDefaultNumberConfigNew/deleteBatch',
|
||||
importExcel = '/health-archives/housenew/healthHouseDefaultNumberConfigNew/exportXls',
|
||||
exportXls = '/health-archives/housenew/healthHouseDefaultNumberConfigNew/importExcel',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出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 });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
*/
|
||||
export const deleteOne = (params, handleSuccess) => {
|
||||
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
*/
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const saveOrUpdate = (params: any, isUpdate: boolean) => {
|
||||
const url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params });
|
||||
};
|
||||
@@ -0,0 +1,94 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { BODY_CONTAINER } from '/@/utils/domUtils';
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '工作日',
|
||||
align: 'center',
|
||||
dataIndex: 'workDay',
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
align: 'center',
|
||||
dataIndex: 'openTime',
|
||||
},
|
||||
{
|
||||
title: '结束时间',
|
||||
align: 'center',
|
||||
dataIndex: 'closeTime',
|
||||
},
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '工作日',
|
||||
field: 'workDay',
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
||||
|
||||
export const schemas: FormSchema[] = [
|
||||
{
|
||||
label: '工作日',
|
||||
field: 'workDay',
|
||||
component: 'Input',
|
||||
rules: [{ required: true }],
|
||||
},
|
||||
// {
|
||||
// label: '开始时间',
|
||||
// field: 'openTime',
|
||||
// component: 'TimePicker',
|
||||
// //日期格式化
|
||||
// componentProps: {
|
||||
// //日期格式化
|
||||
// format: 'HH/mm',
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// label: '结束时间',
|
||||
// field: 'closeTime',
|
||||
// component: 'TimePicker',
|
||||
// //日期格式化
|
||||
// componentProps: {
|
||||
// //日期格式化
|
||||
// format: 'HH/mm',
|
||||
// },
|
||||
// },
|
||||
{
|
||||
label: '有效期时间',
|
||||
field: 'rangeTime',
|
||||
component: 'RangeDate',
|
||||
rules: [{ required: true }],
|
||||
componentProps: ({ formModel }) => {
|
||||
return {
|
||||
picker: 'time',
|
||||
format: 'HH:mm',
|
||||
valueFormat: 'HH:mm',
|
||||
getPopupContainer: () => BODY_CONTAINER,
|
||||
onChange: (v) => {
|
||||
const time = v ? v.split(',') : ['', ''];
|
||||
formModel.openTime = time[0];
|
||||
formModel.closeTime = time[1];
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
field: 'openTime',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
field: 'closeTime',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,140 @@
|
||||
<template>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" :icon="h(PlusOutlined)" @click="handleAdd" v-auth="'housenew:health_house_device_project:add'"> 新增 </a-button>
|
||||
<!-- <a-button type="primary" :icon="h(EditOutlined)" @click="handleEdit" v-auth="'housenew:health_house_banner:edit'"> 编辑 </a-button>-->
|
||||
<!-- <a-button type="primary" :icon="h(DeleteOutlined)" @click="batchHandleDelete" v-auth="'housenew:health_house_banner:deleteBatch'">-->
|
||||
<!-- 批量删除-->
|
||||
<!-- </a-button>-->
|
||||
<!-- <a-button type="primary" :icon="h(SearchOutlined)" @click="onlyread"> 查看 </a-button>-->
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<add-modal @register="registerModal" @success="handleSuccess" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { h } from 'vue';
|
||||
import { PlusOutlined, EditOutlined, DeleteOutlined, SearchOutlined } from '@ant-design/icons-vue';
|
||||
import BasicTable from '/@/components/Table/src/BasicTable.vue';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { TableAction } from '/@/components/Table';
|
||||
import { columns, searchFormSchema } from '/@/views/archive/healthCabin/planWork/planWork.data';
|
||||
import { batchDelete, deleteOne, list } from '/@/views/archive/healthCabin/planWork/planWork.api';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import AddModal from '/@/views/archive/healthCabin/planWork/components/addPlanWorkModal.vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
const { createConfirm } = useMessage();
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
const { hasPermission } = usePermission();
|
||||
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
api: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
orderFlag: false,
|
||||
showIndexColumn: true,
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: false,
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return params;
|
||||
},
|
||||
actionColumn: {
|
||||
width: 150,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
//注册弹窗
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
function getTableAction(record: any) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
// ifShow: () => hasPermission('housenew:health_house_device_project:edit'),
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
onClick: onlyread.bind(null, record),
|
||||
// ifShow: () => hasPermission('housenew:health_house_banner:delete'),
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
onClick: handleDelete.bind(null, record),
|
||||
// ifShow: () => hasPermission('housenew:health_house_device_project:delete'),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
openModal(true, {
|
||||
record: { sort: getDataSource().length + 1 },
|
||||
isUpdate: false,
|
||||
showFooter: true,
|
||||
type: '新增',
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: true,
|
||||
type: '编辑',
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
deleteOne({ id: record.id }, handleSuccess);
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
// async function batchHandleDelete() {
|
||||
// if (selectedRowKeys.value.length === 0) return message.info('请至少选择一条');
|
||||
// await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
// }
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
function onlyread(record: Recordable) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
title: '查看',
|
||||
onlyRead: true,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,59 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" width="40%" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" :disabled="onlyRead" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import BasicForm from '/@/components/Form/src/BasicForm.vue';
|
||||
import { useForm } from '/@/components/Form';
|
||||
import { schemas } from '/@/views/archive/healthCabin/slideshow/slideshow.data';
|
||||
import { saveOrUpdate } from '/@/views/archive/healthCabin/slideshow/slideshow.api';
|
||||
// Emits声明
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(true);
|
||||
//设置标题
|
||||
const title = ref(String);
|
||||
const onlyRead = ref('false');
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
//重置表单
|
||||
await resetFields();
|
||||
setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
title.value = data.type;
|
||||
console.log(data, '传进来的值');
|
||||
//表单赋值
|
||||
await setFieldsValue({
|
||||
...data.record,
|
||||
});
|
||||
// 隐藏底部时禁用整个表单
|
||||
setProps({ disabled: !data?.showFooter });
|
||||
});
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate, setProps }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
let values = await validate();
|
||||
console.log(values, '要穿走的值');
|
||||
setModalProps({ confirmLoading: true });
|
||||
//提交表单
|
||||
await saveOrUpdate(values, isUpdate.value);
|
||||
//关闭弹窗
|
||||
closeModal();
|
||||
//刷新列表
|
||||
emit('success');
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,67 @@
|
||||
// noinspection Eslint
|
||||
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/health-archives/housenew/healthHouseBannerNew/list',
|
||||
save = '/health-archives/housenew/healthHouseBannerNew/add',
|
||||
edit = '/health-archives/housenew/healthHouseBannerNew/edit',
|
||||
deleteOne = '/health-archives/housenew/healthHouseBannerNew/delete',
|
||||
deleteBatch = '/health-archives/housenew/healthHouseBannerNew/deleteBatch',
|
||||
importExcel = '/health-archives/archives/medicalDataAnalysis/importExcel',
|
||||
exportXls = '/health-archives/archives/medicalDataAnalysis/exportXls',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
/**
|
||||
* 导入api
|
||||
*/
|
||||
export const getImportUrl = Api.importExcel;
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
*/
|
||||
export const deleteOne = (params, handleSuccess) => {
|
||||
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
*/
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const saveOrUpdate = (params: any, isUpdate: boolean) => {
|
||||
const url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params });
|
||||
};
|
||||
@@ -0,0 +1,94 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { getDefaultImage, getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import { h } from 'vue';
|
||||
import { Image } from 'ant-design-vue';
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '标题',
|
||||
align: 'center',
|
||||
dataIndex: 'bannerTitle',
|
||||
},
|
||||
{
|
||||
title: '编号',
|
||||
align: 'center',
|
||||
dataIndex: 'bannerNo',
|
||||
},
|
||||
{
|
||||
title: '轮播图',
|
||||
align: 'center',
|
||||
dataIndex: 'bannerUrl',
|
||||
minWidth: 230,
|
||||
customRender: ({ text }) => {
|
||||
return h(Image, {
|
||||
placeholder: true,
|
||||
src: getFileAccessHttpUrl(text),
|
||||
height: 80,
|
||||
width: 200,
|
||||
fallback: getDefaultImage(),
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '是否有效',
|
||||
align: 'center',
|
||||
dataIndex: 'bannerValid_dictText',
|
||||
},
|
||||
{
|
||||
title: '所属模块',
|
||||
align: 'center',
|
||||
dataIndex: 'bannerType_dictText',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
align: 'center',
|
||||
dataIndex: 'createDate',
|
||||
},
|
||||
];
|
||||
|
||||
export const schemas: FormSchema[] = [
|
||||
{
|
||||
label: '序号',
|
||||
field: 'bannerNo',
|
||||
component: 'InputNumber',
|
||||
rules: [{ required: true }],
|
||||
},
|
||||
{
|
||||
label: '轮播图标题',
|
||||
field: 'bannerTitle',
|
||||
component: 'Input',
|
||||
rules: [{ required: true }],
|
||||
},
|
||||
{
|
||||
label: '是否有效',
|
||||
field: 'bannerValid',
|
||||
component: 'JDictSelectTag',
|
||||
defaultValue: '1',
|
||||
componentProps: {
|
||||
type: 'radio',
|
||||
dictCode: 'yes_no',
|
||||
},
|
||||
rules: [{ required: true }],
|
||||
},
|
||||
{
|
||||
label: '类型',
|
||||
field: 'bannerType',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'house_banner_type',
|
||||
},
|
||||
rules: [{ required: true }],
|
||||
},
|
||||
{
|
||||
label: '轮播图',
|
||||
field: 'bannerUrl',
|
||||
component: 'JImageUpload',
|
||||
rules: [{ required: true, message: '请上传图片' }],
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
label: 'id',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,132 @@
|
||||
<template>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection" style="margin: 10px 5px">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" :icon="h(PlusOutlined)" @click="handleAdd" v-auth="'housenew:health_house_banner:add'"> 新增 </a-button>
|
||||
<!-- <a-button type="primary" :icon="h(EditOutlined)" @click="handleEdit" v-auth="'housenew:health_house_banner:edit'"> 编辑 </a-button>-->
|
||||
<!-- <a-button type="primary" :icon="h(DeleteOutlined)" @click="batchHandleDelete" v-auth="'housenew:health_house_banner:deleteBatch'">-->
|
||||
<!-- 批量删除-->
|
||||
<!-- </a-button>-->
|
||||
<!-- <a-button type="primary" :icon="h(SearchOutlined)" @click="onlyread"> 详情 </a-button>-->
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<add-modal @register="registerModal" @success="handleSuccess" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { h } from 'vue';
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { list, deleteOne } from '/@/views/archive/healthCabin/slideshow/slideshow.api';
|
||||
import { columns } from '/@/views/archive/healthCabin/slideshow/slideshow.data';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import AddModal from '/@/views/archive/healthCabin/slideshow/components/addSlideshowModal.vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
const { createConfirm } = useMessage();
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
const { hasPermission } = usePermission();
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
api: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
orderFlag: false,
|
||||
showIndexColumn: true,
|
||||
useSearchForm: false,
|
||||
beforeFetch: (params) => {
|
||||
return params;
|
||||
},
|
||||
actionColumn: {
|
||||
width: 150,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
//注册弹窗
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
function getTableAction(record: any) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
ifShow: () => hasPermission('housenew:health_house_banner:edit'),
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
onClick: onlyread.bind(null, record),
|
||||
// ifShow: () => hasPermission('housenew:health_house_banner:delete'),
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
onClick: handleDelete.bind(null, record),
|
||||
ifShow: () => hasPermission('housenew:health_house_banner:delete'),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
openModal(true, {
|
||||
record: { sort: getDataSource().length + 1 },
|
||||
isUpdate: false,
|
||||
showFooter: true,
|
||||
type: '新增',
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: true,
|
||||
type: '编辑',
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
deleteOne({ id: record.id }, handleSuccess);
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
// async function batchHandleDelete() {
|
||||
// if (selectedRowKeys.value.length === 0) return message.info('请至少选择一条');
|
||||
// await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
// }
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
function onlyread(record: Recordable) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: false,
|
||||
title: '查看',
|
||||
onlyRead: true,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" width="40%" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" :disabled="onlyRead" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import BasicForm from '/@/components/Form/src/BasicForm.vue';
|
||||
import { useForm } from '/@/components/Form';
|
||||
import { schemas } from '/@/views/archive/healthCabin/terminalManagement/terminalManagement.data';
|
||||
const title = ref('新增');
|
||||
const isUpdate = ref();
|
||||
const onlyRead = ref('false');
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
console.log(data);
|
||||
await resetFields();
|
||||
title.value = data.title;
|
||||
isUpdate.value = data.isUpdate;
|
||||
onlyRead.value = data.onlyRead;
|
||||
});
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
if (onlyRead.value) {
|
||||
closeModal();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
let values = await validate();
|
||||
setModalProps({ confirmLoading: true });
|
||||
console.log(values, 1233333);
|
||||
closeModal();
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,67 @@
|
||||
// noinspection Eslint
|
||||
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/archives/medicalDataAnalysis/list',
|
||||
save = '/archives/medicalDataAnalysis/add',
|
||||
edit = '/archives/medicalDataAnalysis/edit',
|
||||
deleteOne = '/archives/medicalDataAnalysis/delete',
|
||||
deleteBatch = '/archives/medicalDataAnalysis/deleteBatch',
|
||||
importExcel = '/archives/medicalDataAnalysis/importExcel',
|
||||
exportXls = '/archives/medicalDataAnalysis/exportXls',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
/**
|
||||
* 导入api
|
||||
*/
|
||||
export const getImportUrl = Api.importExcel;
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
*/
|
||||
export const deleteOne = (params, handleSuccess) => {
|
||||
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
*/
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const saveOrUpdate = (params: any, isUpdate: boolean) => {
|
||||
const url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params });
|
||||
};
|
||||
@@ -0,0 +1,58 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '健康室 ',
|
||||
align: 'center',
|
||||
dataIndex: 'pic',
|
||||
},
|
||||
{
|
||||
title: '终端编号 ',
|
||||
align: 'center',
|
||||
dataIndex: 'qq',
|
||||
},
|
||||
{
|
||||
title: '终端名称',
|
||||
align: 'center',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '启用',
|
||||
align: 'center',
|
||||
dataIndex: 'pic',
|
||||
},
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '健康室',
|
||||
field: 'name1',
|
||||
component: 'Select',
|
||||
},
|
||||
];
|
||||
|
||||
export const schemas: FormSchema[] = [
|
||||
{
|
||||
label: '健康室',
|
||||
field: 'name',
|
||||
component: 'Select',
|
||||
rules: [{ required: true, trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '终端编号',
|
||||
field: 'name',
|
||||
component: 'Input',
|
||||
rules: [{ required: true, trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '终端名称',
|
||||
field: 'name',
|
||||
component: 'Input',
|
||||
rules: [{ required: true, trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '启用',
|
||||
field: 'name',
|
||||
component: 'Select',
|
||||
rules: [{ required: true, trigger: 'blur' }],
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" :icon="h(PlusOutlined)" @click="handleAdd"> 新增终端 </a-button>
|
||||
<a-button type="primary" :icon="h(EditOutlined)" @click="handleEdit"> 编辑 </a-button>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<add-modal @register="registerModal" @success="handleSuccess" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { h } from 'vue';
|
||||
import { PlusOutlined, EditOutlined } from '@ant-design/icons-vue';
|
||||
import BasicTable from '/@/components/Table/src/BasicTable.vue';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { TableAction } from '/@/components/Table';
|
||||
import { columns, searchFormSchema } from '/@/views/archive/healthCabin/terminalManagement/terminalManagement.data';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import AddModal from '/@/views/archive/healthCabin/terminalManagement/components/addTerminalManagementModal.vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
const { createMessage } = useMessage();
|
||||
import { deleteOne } from '/@/views/archive/healthCabin/bigDataShow/bigDataShow.api';
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
const { hasPermission } = usePermission();
|
||||
const list = [{}];
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
// api: listApi,
|
||||
dataSource: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
orderFlag: false,
|
||||
showIndexColumn: true,
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: false,
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return params;
|
||||
},
|
||||
actionColumn: {
|
||||
width: 150,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
//注册弹窗
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
function getTableAction(record: any) {
|
||||
return [
|
||||
{
|
||||
label: '删除',
|
||||
onClick: handleDelete.bind(null, record),
|
||||
ifShow: () => hasPermission('housenew:health_house_banner:delete'),
|
||||
},
|
||||
{
|
||||
label: '终端设备',
|
||||
onClick: handleDelete.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
openModal(true, {
|
||||
record: { sort: getDataSource().length + 1 },
|
||||
isUpdate: false,
|
||||
showFooter: true,
|
||||
type: '新增',
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit() {
|
||||
if (!selectedRowKeys.value.length || selectedRowKeys.value.length > 1) {
|
||||
return createMessage.warning('请选择一条数据!');
|
||||
}
|
||||
let id = selectedRowKeys.value[0];
|
||||
let dataSource = getDataSource();
|
||||
let record = dataSource.filter((item) => item.id === id)[0];
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: true,
|
||||
title: '编辑',
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,54 @@
|
||||
<template>
|
||||
<BasicModal @register="registerModal" :title="title" :width="900" @ok="handleOk">
|
||||
<BasicForm @register="registerForm"></BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { useForm, BasicForm } from '/@/components/Form';
|
||||
import { formSchema } from '/@/views/archive/healthClock/clockQuestionnaire/integralRule/integralRule.data';
|
||||
import { ruleAdd, ruleEdit } from '/@/views/archive/healthClock/clockQuestionnaire/integralRule/integralRule.api';
|
||||
const title = ref('录入');
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(false);
|
||||
const ruleId = ref();
|
||||
const showFooter = ref(true);
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
setModalProps({ confirmLoading: false });
|
||||
await resetFields();
|
||||
title.value = data.title;
|
||||
isUpdate.value = data.isUpdate;
|
||||
showFooter.value = data.showFooter;
|
||||
console.log(data.record);
|
||||
if (data.isUpdate) {
|
||||
await setFieldsValue(data.record);
|
||||
ruleId.value = data.record.id;
|
||||
}
|
||||
});
|
||||
const [registerForm, { setProps, resetFields, setFieldsValue, validate, updateSchema }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
async function handleOk() {
|
||||
if (!showFooter.value) {
|
||||
closeModal();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const values = await validate();
|
||||
if (isUpdate.value) {
|
||||
values.id = ruleId.value;
|
||||
await ruleEdit(values);
|
||||
} else {
|
||||
await ruleAdd(values);
|
||||
}
|
||||
closeModal();
|
||||
emit('success');
|
||||
} catch (e) {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,32 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
export enum Api {
|
||||
list = '/health-archives/punchnew/healthScoreSettingNew/list',
|
||||
ruleAdd = '/health-archives/punchnew/healthScoreSettingNew/add',
|
||||
ruleEdit = '/health-archives//punchnew/healthScoreSettingNew/edit',
|
||||
ruleDelete = '/health-archives/punchnew/healthScoreSettingNew/delete',
|
||||
}
|
||||
|
||||
// 列表接口
|
||||
export const listApi = (params) => defHttp.get({ url: Api.list, params });
|
||||
// 分类新增
|
||||
export const ruleAdd = (params) => defHttp.post({ url: Api.ruleAdd, params });
|
||||
// 分类编辑
|
||||
export const ruleEdit = (params) => defHttp.put({ url: Api.ruleEdit, params });
|
||||
// 分类删除
|
||||
export const ruleDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.ruleDelete + `?id=${params.id}`, params }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,72 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '积分奖励起始值',
|
||||
dataIndex: 'scoreStart',
|
||||
},
|
||||
{
|
||||
title: '积分奖励递增值',
|
||||
dataIndex: 'scoreStep',
|
||||
},
|
||||
{
|
||||
title: '积分奖励最大值',
|
||||
dataIndex: 'scoreMax',
|
||||
},
|
||||
{
|
||||
title: '规则状态',
|
||||
dataIndex: 'scoreStatus',
|
||||
customRender: ({ text }) => {
|
||||
if (text == 0) return '无效';
|
||||
if (text == 1) return '有效';
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '积分奖励起始值',
|
||||
field: 'scoreStart',
|
||||
component: 'Input',
|
||||
componentProps: () => {
|
||||
return {
|
||||
type: 'number',
|
||||
};
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '积分奖励递增值',
|
||||
field: 'scoreStep',
|
||||
component: 'Input',
|
||||
componentProps: () => {
|
||||
return {
|
||||
type: 'number',
|
||||
};
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '积分奖励最大值',
|
||||
field: 'scoreMax',
|
||||
component: 'Input',
|
||||
componentProps: () => {
|
||||
return {
|
||||
type: 'number',
|
||||
};
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '规则状态',
|
||||
field: 'scoreStatus',
|
||||
component: 'RadioGroup',
|
||||
defaultValue: 1,
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '有效', value: 1 },
|
||||
{ label: '无效', value: 0 },
|
||||
],
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,129 @@
|
||||
<template>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" @click="handleAdd"> 录入</a-button>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :drop-down-actions="getDropAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<AddModal @register="registerModal" @success="handleSuccess"></AddModal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { listApi, ruleDelete, ruleEdit } from '/@/views/archive/healthClock/clockQuestionnaire/integralRule/integralRule.api';
|
||||
import { columns } from '/@/views/archive/healthClock/clockQuestionnaire/integralRule/integralRule.data';
|
||||
import AddModal from '/@/views/archive/healthClock/clockQuestionnaire/integralRule/components/addModal.vue';
|
||||
//注册model
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
//注册table数据
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: '分类规则',
|
||||
useSearchForm: false,
|
||||
api: listApi,
|
||||
columns,
|
||||
canResize: false,
|
||||
formConfig: {
|
||||
//labelWidth: 120,
|
||||
// schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 160,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
openModal(true, {
|
||||
isUpdate: false,
|
||||
showFooter: true,
|
||||
title: '录入',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: true,
|
||||
title: '编辑',
|
||||
});
|
||||
}
|
||||
function handleOnlyRead(record) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: false,
|
||||
title: '查看',
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
}
|
||||
function handleDelete(record) {
|
||||
console.log(record);
|
||||
ruleDelete({ id: record.id }, reload);
|
||||
}
|
||||
// 启用
|
||||
async function handleEnable(record) {
|
||||
record.scoreStatus = 1;
|
||||
await ruleEdit(record);
|
||||
}
|
||||
async function handleDisabled(record) {
|
||||
record.scoreStatus = 0;
|
||||
await ruleEdit(record);
|
||||
}
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record: Recordable) {
|
||||
return [
|
||||
{
|
||||
label: '删除',
|
||||
onClick: handleDelete.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '禁用',
|
||||
onClick: handleDisabled.bind(null, record),
|
||||
ifShow: record.scoreStatus == 1 ? true : false,
|
||||
},
|
||||
{
|
||||
label: '启用',
|
||||
onClick: handleEnable.bind(null, record),
|
||||
ifShow: record.scoreStatus == 0 ? true : false,
|
||||
},
|
||||
];
|
||||
}
|
||||
function getDropAction(record: Recordable) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '查看',
|
||||
onClick: handleOnlyRead.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<BasicModal @register="registerModal" :title="title" :width="900" @ok="handleOk">
|
||||
<BasicForm @register="registerForm"></BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { useForm, BasicForm } from '/@/components/Form';
|
||||
import { addChilrenSchema } from '/@/views/archive/healthClock/clockQuestionnaire/questionsClassify/questionsClassify.data';
|
||||
import { templateAdd } from '/@/views/archive/healthClock/clockQuestionnaire/questionsClassify/questionsClassify.api';
|
||||
const title = ref('123');
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(false);
|
||||
const classId = ref();
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
setModalProps({ confirmLoading: false });
|
||||
await resetFields();
|
||||
title.value = data.title;
|
||||
isUpdate.value = data.isUpdate;
|
||||
await setFieldsValue({ parentId: data.record.id });
|
||||
});
|
||||
const [registerForm, { setProps, resetFields, setFieldsValue, validate, updateSchema }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas: addChilrenSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
async function handleOk() {
|
||||
try {
|
||||
const values = await validate();
|
||||
await templateAdd(values);
|
||||
closeModal();
|
||||
emit('success');
|
||||
} catch (e) {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<BasicModal @register="registerModal" :title="title" :width="900" @ok="handleOk">
|
||||
<BasicForm @register="registerForm"></BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { useForm, BasicForm } from '/@/components/Form';
|
||||
import { formSchema } from '/@/views/archive/healthClock/clockQuestionnaire/questionsClassify/questionsClassify.data';
|
||||
import { templateAdd, templateEdit } from '/@/views/archive/healthClock/clockQuestionnaire/questionsClassify/questionsClassify.api';
|
||||
const title = ref('123');
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(false);
|
||||
const classId = ref();
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
setModalProps({ confirmLoading: false });
|
||||
await resetFields();
|
||||
title.value = data.title;
|
||||
isUpdate.value = data.isUpdate;
|
||||
if (data.isUpdate) {
|
||||
await setFieldsValue(data.record);
|
||||
classId.value = data.record.id;
|
||||
}
|
||||
});
|
||||
const [registerForm, { setProps, resetFields, setFieldsValue, validate, updateSchema }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
async function handleOk() {
|
||||
try {
|
||||
const values = await validate();
|
||||
if (isUpdate.value) {
|
||||
values.id = classId.value;
|
||||
await templateEdit(values);
|
||||
} else {
|
||||
await templateAdd(values);
|
||||
}
|
||||
closeModal();
|
||||
emit('success');
|
||||
} catch (e) {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
export enum Api {
|
||||
list = '/health-archives/punchnew/healthTemplateClassNew/customList',
|
||||
templateAdd = '/health-archives/punchnew/healthTemplateClassNew/add',
|
||||
templateEdit = '/health-archives/punchnew/healthTemplateClassNew/edit',
|
||||
templateDelete = '/health-archives/punchnew/healthTemplateClassNew/delete',
|
||||
}
|
||||
|
||||
// 列表接口
|
||||
export const listApi = (params) => defHttp.get({ url: Api.list, params });
|
||||
// 分类新增
|
||||
export const templateAdd = (params) => defHttp.post({ url: Api.templateAdd, params });
|
||||
// 分类编辑
|
||||
export const templateEdit = (params) => defHttp.put({ url: Api.templateEdit, params });
|
||||
// 分类删除
|
||||
export const templateDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.templateDelete + `?id=${params.id}`, params }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { listApi } from '/@/views/archive/healthClock/clockQuestionnaire/questionsClassify/questionsClassify.api';
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '分类名称',
|
||||
dataIndex: 'className',
|
||||
},
|
||||
{
|
||||
title: '分类排序',
|
||||
dataIndex: 'classOrder',
|
||||
},
|
||||
];
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '分类名称',
|
||||
field: 'className',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '分类排序',
|
||||
field: 'classOrder',
|
||||
component: 'Input',
|
||||
componentProps: () => {
|
||||
return {
|
||||
type: 'number',
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '父级分类',
|
||||
field: 'parentId',
|
||||
component: 'ApiTreeSelect',
|
||||
componentProps: () => {
|
||||
return {
|
||||
api: listApi,
|
||||
fieldNames: {
|
||||
label: 'className',
|
||||
value: 'id',
|
||||
key: 'id',
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const addChilrenSchema: FormSchema[] = [
|
||||
{
|
||||
label: '分类名称',
|
||||
field: 'className',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '分类排序',
|
||||
field: 'classOrder',
|
||||
component: 'Input',
|
||||
componentProps: () => {
|
||||
return {
|
||||
type: 'number',
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '父级分类',
|
||||
field: 'parentId',
|
||||
component: 'ApiTreeSelect',
|
||||
componentProps: () => {
|
||||
return {
|
||||
api: listApi,
|
||||
disabled: true,
|
||||
fieldNames: {
|
||||
label: 'className',
|
||||
value: 'id',
|
||||
key: 'id',
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
<template>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" @click="handleAdd"> 录入 </a-button>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :drop-down-actions="getDropAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<InputModal @register="registerModal" @success="handleSuccess"></InputModal>
|
||||
<AddChildrenModal @register="registerChilrenModal" @success="handleSuccess"></AddChildrenModal>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { columns } from '/@/views/archive/healthClock/clockQuestionnaire/questionsClassify/questionsClassify.data';
|
||||
import { listApi, templateDelete } from '/@/views/archive/healthClock/clockQuestionnaire/questionsClassify/questionsClassify.api';
|
||||
import InputModal from '/@/views/archive/healthClock/clockQuestionnaire/questionsClassify/components/inputModal.vue';
|
||||
import AddChildrenModal from '/@/views/archive/healthClock/clockQuestionnaire/questionsClassify/components/addChildrenModal.vue';
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: '树形表格',
|
||||
isTreeTable: true,
|
||||
useSearchForm: false,
|
||||
rowSelection: {
|
||||
type: 'checkbox',
|
||||
getCheckboxProps(record: Recordable) {
|
||||
// Demo: 第一行(id为0)的选择框禁用
|
||||
if (record.leaf) {
|
||||
return { disabled: true };
|
||||
} else {
|
||||
return { disabled: false };
|
||||
}
|
||||
},
|
||||
},
|
||||
actionColumn: {
|
||||
width: 200,
|
||||
},
|
||||
api: listApi,
|
||||
columns: columns,
|
||||
// dataSource: getTreeTableData(),
|
||||
rowKey: 'id',
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const [registerChilrenModal, { openModal: openChilrenModal }] = useModal();
|
||||
function getTableAction(record: Recordable) {
|
||||
return [
|
||||
{
|
||||
label: '删除',
|
||||
onClick: handleDelete.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '添加下级',
|
||||
onClick: handleAddChildren.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
function getDropAction(record: Recordable) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '查看',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
// 新增
|
||||
function handleAdd() {
|
||||
openModal(true, {
|
||||
title: '录入',
|
||||
isUpdate: false,
|
||||
});
|
||||
}
|
||||
//编辑
|
||||
function handleEdit(record) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
title: '编辑',
|
||||
});
|
||||
}
|
||||
//删除
|
||||
function handleDelete(record) {
|
||||
console.log(record);
|
||||
templateDelete({ id: record.id }, reload);
|
||||
}
|
||||
//添加下级
|
||||
function handleAddChildren(record) {
|
||||
console.log(record);
|
||||
openChilrenModal(true, {
|
||||
record,
|
||||
title: '新增下级',
|
||||
});
|
||||
}
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
}
|
||||
</script>
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
<template>
|
||||
<BasicModal @register="registerModal" :title="title" :width="900" @ok="handleOk">
|
||||
<BasicForm @register="registerForm"></BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { useForm, BasicForm } from '/@/components/Form';
|
||||
import { formSchemas } from '/@/views/archive/healthClock/clockQuestionnaire/questionsManage/questionsManage.data';
|
||||
import { questionAdd, questionEdit } from '/@/views/archive/healthClock/clockQuestionnaire/questionsManage/questionsManage.api';
|
||||
const title = ref('录入');
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(false);
|
||||
const questionId = ref();
|
||||
const showFooter = ref(true);
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
setModalProps({ confirmLoading: false });
|
||||
await resetFields();
|
||||
title.value = data.title;
|
||||
isUpdate.value = data.isUpdate;
|
||||
showFooter.value = data.showFooter;
|
||||
if (data.isUpdate) {
|
||||
await setFieldsValue(data.record);
|
||||
questionId.value = data.record.id;
|
||||
}
|
||||
});
|
||||
const [registerForm, { setProps, resetFields, setFieldsValue, validate, updateSchema }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas: formSchemas,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
async function handleOk() {
|
||||
if (!showFooter.value) {
|
||||
closeModal();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const values = await validate();
|
||||
if (isUpdate.value) {
|
||||
values.id = questionId.value;
|
||||
await questionEdit(values);
|
||||
} else {
|
||||
await questionAdd(values);
|
||||
}
|
||||
closeModal();
|
||||
emit('success');
|
||||
} catch (e) {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
export enum Api {
|
||||
list = '/health-archives/punchnew/healthTemplateQuestionNew/list',
|
||||
questionAdd = '/health-archives/punchnew/healthTemplateQuestionNew/add',
|
||||
questionEdit = '/health-archives/punchnew/healthTemplateQuestionNew/edit',
|
||||
quertionDelete = '/health-archives/punchnew/healthTemplateQuestionNew/deleteBatch',
|
||||
}
|
||||
// 列表接口
|
||||
export const listApi = (params) => defHttp.get({ url: Api.list, params });
|
||||
// 新增
|
||||
export const questionAdd = (params) => defHttp.post({ url: Api.questionAdd, params });
|
||||
//编辑
|
||||
export const questionEdit = (params) => defHttp.post({ url: Api.questionEdit, params });
|
||||
//删除
|
||||
export const quertionDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.quertionDelete + `?ids=${params.id}`, params }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
+135
@@ -0,0 +1,135 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { listApi } from '/@/views/archive/healthClock/clockQuestionnaire/questionsClassify/questionsClassify.api';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '所属分类',
|
||||
dataIndex: 'className',
|
||||
},
|
||||
{
|
||||
title: '问题描述',
|
||||
dataIndex: 'qsDesc',
|
||||
},
|
||||
{
|
||||
title: '问题类型',
|
||||
dataIndex: 'qsType', //punch_qs_type
|
||||
customRender: ({ text }) => {
|
||||
return render.renderDict(text, 'punch_qs_type');
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '问题排序',
|
||||
dataIndex: 'qsOrder',
|
||||
},
|
||||
{
|
||||
title: '是否必填',
|
||||
dataIndex: 'requireStatus', ///yes_no
|
||||
customRender: ({ text }) => {
|
||||
return render.renderDict(text, 'yes_no');
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '频次',
|
||||
dataIndex: 'qsFreq', //punch_frq
|
||||
customRender: ({ text }) => {
|
||||
return render.renderDict(text, 'punch_frq');
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '自定义月份',
|
||||
dataIndex: 'qsFreqCustom',
|
||||
},
|
||||
];
|
||||
|
||||
export const formSchemas: FormSchema[] = [
|
||||
{
|
||||
label: '所属分类',
|
||||
field: 'qsClass',
|
||||
component: 'ApiTreeSelect',
|
||||
componentProps: () => {
|
||||
return {
|
||||
api: listApi,
|
||||
getPopupContainer: () => document.body,
|
||||
fieldNames: {
|
||||
label: 'className',
|
||||
value: 'id',
|
||||
key: 'id',
|
||||
},
|
||||
treeDefaultExpandAll: true,
|
||||
isLeaf: true,
|
||||
onChange: (value, label, extra) => {
|
||||
console.log(value, label, extra);
|
||||
// console.log(isLeaf);
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '问题描述',
|
||||
field: 'qsDesc',
|
||||
component: 'InputTextArea',
|
||||
componentProps: () => {
|
||||
return {
|
||||
row: 3,
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '问题类型',
|
||||
field: 'qsType',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: () => {
|
||||
return {
|
||||
getPopupContainer: () => document.body,
|
||||
dictCode: 'punch_qs_type',
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '问题排序',
|
||||
field: 'qsOrder',
|
||||
component: 'Input',
|
||||
componentProps: () => {
|
||||
return {
|
||||
type: 'number',
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '是否必填',
|
||||
field: 'requireStatus',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
getPopupContainer: () => document.body,
|
||||
dictCode: 'yes_no',
|
||||
// stringToNumber: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '频次',
|
||||
field: 'qsFreq',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: () => {
|
||||
return {
|
||||
getPopupContainer: () => document.body,
|
||||
dictCode: 'punch_frq',
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '自定义月份',
|
||||
field: 'qsFreqCustom',
|
||||
component: 'Input',
|
||||
ifShow: ({ values }) => {
|
||||
if (values.qsFreq == '7') return true;
|
||||
if (values.qsFreq != '7') return false;
|
||||
},
|
||||
componentProps: () => {
|
||||
return {
|
||||
maxValue: 12,
|
||||
type: 'Number',
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" @click="handleAdd"> 录入 </a-button>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<AddModal @register="registerModal" @success="handleSuccess"></AddModal>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns } from '/@/views/archive/healthClock/clockQuestionnaire/questionsManage/questionsManage.data';
|
||||
import AddModal from '/@/views/archive/healthClock/clockQuestionnaire/questionsManage/components/addModal.vue';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { listApi, quertionDelete } from '/@/views/archive/healthClock/clockQuestionnaire/questionsManage/questionsManage.api';
|
||||
//注册table数据
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: '分类规则',
|
||||
api: listApi,
|
||||
columns,
|
||||
canResize: false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 160,
|
||||
fixed: 'right',
|
||||
},
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
function handleAdd() {
|
||||
openModal(true, {
|
||||
title: '录入',
|
||||
showFooter: true,
|
||||
});
|
||||
}
|
||||
function handleDelete(record) {
|
||||
quertionDelete({ id: record.id }, reload);
|
||||
}
|
||||
function handleEdit(record) {
|
||||
openModal(true, {
|
||||
title: '编辑',
|
||||
isUpdate: true,
|
||||
showFooter: true,
|
||||
record,
|
||||
});
|
||||
}
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
}
|
||||
function handleTemplate(record) {
|
||||
openModal(true, {
|
||||
title: '查看',
|
||||
showFooter: false,
|
||||
isUpdate: true,
|
||||
record,
|
||||
});
|
||||
}
|
||||
function getTableAction(record: Recordable) {
|
||||
return [
|
||||
{
|
||||
label: '删除',
|
||||
onClick: handleDelete.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '查看',
|
||||
onClick: handleTemplate.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,53 @@
|
||||
<template>
|
||||
<BasicModal @register="registerModal" :title="title" :width="900" @ok="handleOk">
|
||||
<BasicForm @register="registerForm"></BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { useForm, BasicForm } from '/@/components/Form';
|
||||
import { formSchema } from '/@/views/archive/healthClock/clockQuestionnaire/template/template.data';
|
||||
import { templateAdd, templateById, templateEdit } from '/@/views/archive/healthClock/clockQuestionnaire/template/template.api';
|
||||
const title = ref('录入');
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
const isUpdate = ref(false);
|
||||
const templateId = ref();
|
||||
const showFooter = ref(true);
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
await setModalProps({ confirmLoading: false });
|
||||
await resetFields();
|
||||
title.value = data.title;
|
||||
isUpdate.value = data.isUpdate;
|
||||
showFooter.value = data.showFooter;
|
||||
if (data.isUpdate) {
|
||||
templateId.value = data.record.id;
|
||||
const ClassId = await templateById({ id: data.record.id });
|
||||
await setFieldsValue(data.record);
|
||||
await setFieldsValue({ classId: ClassId.classId.split(',') });
|
||||
}
|
||||
});
|
||||
const [registerForm, { setProps, resetFields, setFieldsValue, validate, updateSchema }] = useForm({
|
||||
//labelWidth: 150,
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
baseColProps: { span: 24 },
|
||||
});
|
||||
async function handleOk() {
|
||||
console.log(isUpdate.value, '12333');
|
||||
await setModalProps({ confirmLoading: true });
|
||||
try {
|
||||
const values = await validate();
|
||||
if (isUpdate.value) {
|
||||
values.id = templateId.value;
|
||||
await templateEdit(values);
|
||||
} else {
|
||||
await templateAdd(values);
|
||||
}
|
||||
closeModal();
|
||||
emit('success');
|
||||
} catch (e) {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
<template>
|
||||
<BasicModal @register="registerModal" :title="title" :width="900" @ok="handleOk" :footer="false">
|
||||
<!-- <div class="wrapper-modal">-->
|
||||
<!-- <a-table bordered :data-source="dataSource" :columns="columns" :pagination="false" :scroll="{ y: '65vh' }"> </a-table>-->
|
||||
<!-- </div>-->
|
||||
<div class="wrapper-modal">
|
||||
<a-table bordered :data-source="dataSource" :columns="columns" :pagination="false" :scroll="{ y: '55vh' }">
|
||||
<template #bodyCell="{ record, column }">
|
||||
<template v-if="column.dataIndex == 'qsType'">
|
||||
<a-radio-group v-model:value="record.qsType" :options="plainOptions" />
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import { templateDetail } from '/@/views/archive/healthClock/clockQuestionnaire/template/template.api';
|
||||
const title = ref('打卡详情');
|
||||
const dataSource = ref([]);
|
||||
const dataSource1 = ref([]);
|
||||
const res = ref([]);
|
||||
const value1 = ref();
|
||||
const plainOptions = [
|
||||
{ label: '是', value: '1' },
|
||||
{ label: '否', value: '2' },
|
||||
];
|
||||
const columns = [
|
||||
{
|
||||
title: '问题分类',
|
||||
dataIndex: 'className',
|
||||
align: 'center',
|
||||
customCell: (_, index) => {
|
||||
const r = res.value;
|
||||
let result = '';
|
||||
for (let i = 0; i < r.length; i++) {
|
||||
if (index < r[i] && r[i] - index === (i === 0 ? r[i] : r[i] - r[i - 1])) {
|
||||
if (i === 0) {
|
||||
result = { rowSpan: r[i] };
|
||||
} else {
|
||||
result = { rowSpan: r[i] - r[i - 1] };
|
||||
}
|
||||
break;
|
||||
} else if (index == r[r.length - 1] && i == r.length - 1) {
|
||||
result = { rowSpan: dataSource1.value.length - r[i] };
|
||||
} else {
|
||||
result = { rowSpan: 0 };
|
||||
}
|
||||
}
|
||||
// console.log(result);
|
||||
return result;
|
||||
},
|
||||
width: '30%',
|
||||
},
|
||||
{
|
||||
title: '问题描述',
|
||||
dataIndex: 'qsDesc',
|
||||
align: 'center',
|
||||
width: '50%',
|
||||
},
|
||||
{
|
||||
title: '问题选项',
|
||||
dataIndex: 'qsType',
|
||||
align: 'center',
|
||||
customRender: ({ text }) => {
|
||||
if (text == '0') return '否';
|
||||
if (text == '1') return '是';
|
||||
},
|
||||
slot: 'qsType',
|
||||
width: '20%',
|
||||
},
|
||||
];
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
await setModalProps({ confirmLoading: false });
|
||||
const params = {
|
||||
templateNo: data.record.templateNo,
|
||||
};
|
||||
const datas = await templateDetail({ ...params });
|
||||
console.log(datas);
|
||||
dataSource1.value = datas;
|
||||
const filstData = datas.map((item) => {
|
||||
const secound = item.qsList.map((item2) => {
|
||||
return {
|
||||
className: item.className,
|
||||
qsClass: item.qsClass,
|
||||
...item2,
|
||||
};
|
||||
});
|
||||
return secound;
|
||||
});
|
||||
const flattenedData = filstData.reduce((acc, currentValue) => {
|
||||
return acc.concat(currentValue);
|
||||
}, []);
|
||||
dataSource.value = flattenedData;
|
||||
let result = [];
|
||||
flattenedData.map((item, index) => {
|
||||
if (index > 0) {
|
||||
if (item.className != flattenedData[index - 1].className) {
|
||||
result.push(index);
|
||||
}
|
||||
}
|
||||
});
|
||||
dataSource1.value = flattenedData;
|
||||
res.value = result;
|
||||
console.log(result);
|
||||
});
|
||||
function handleOk() {
|
||||
closeModal();
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.wrapper-modal {
|
||||
height: 65vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,37 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
export enum Api {
|
||||
list = '/health-archives/punchnew/healthTemplateNew/list',
|
||||
templateAdd = '/health-archives/punchnew/healthTemplateNew/add',
|
||||
templateById = '/health-archives/punchnew/healthTemplateNew/queryById',
|
||||
templateDelete = '/health-archives/punchnew/healthTemplateNew/deleteBatch',
|
||||
templateEdit = '/health-archives/punchnew/healthTemplateNew/edit',
|
||||
templateDetail = '/health-archives/punchnew/healthTemplateNew/templateDetail',
|
||||
}
|
||||
// 列表接口
|
||||
export const listApi = (params) => defHttp.get({ url: Api.list, params });
|
||||
// 新增
|
||||
export const templateAdd = (params) => defHttp.post({ url: Api.templateAdd, params });
|
||||
//详情接口
|
||||
export const templateById = (params) => defHttp.get({ url: Api.templateById, params }, { joinParamsToUrl: true });
|
||||
//删除
|
||||
export const templateDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({ url: Api.templateDelete + `?ids=${params.id}`, params }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
//编辑
|
||||
export const templateEdit = (params) => defHttp.post({ url: Api.templateEdit, params });
|
||||
//模板详情
|
||||
export const templateDetail = (params: any) => defHttp.get({ url: Api.templateDetail, params });
|
||||
@@ -0,0 +1,88 @@
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
import { listApi } from '/@/views/archive/healthClock/clockQuestionnaire/questionsClassify/questionsClassify.api';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '模板名称',
|
||||
dataIndex: 'templateName',
|
||||
},
|
||||
{
|
||||
title: '用户类别',
|
||||
dataIndex: 'classType',
|
||||
customRender: ({ text }) => {
|
||||
return render.renderDict(text, 'punch_user_class');
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '模板状态',
|
||||
dataIndex: 'templateStatus',
|
||||
customRender: ({ text }) => {
|
||||
return render.renderDict(text, 'valid_status');
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const searchSchema: FormSchema[] = [
|
||||
{
|
||||
label: '模板名称',
|
||||
field: 'templateName',
|
||||
component: 'JInput',
|
||||
},
|
||||
{
|
||||
label: '用户类别',
|
||||
field: 'classType',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'punch_user_class',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '模板名称',
|
||||
field: 'templateName',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '用户类别',
|
||||
field: 'classType',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'punch_user_class',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '模板状态',
|
||||
field: 'templateStatus',
|
||||
// component: 'RadioGroup',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'valid_status',
|
||||
type: 'radio',
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '问题分类',
|
||||
field: 'classId',
|
||||
component: 'ApiTreeSelect',
|
||||
componentProps: () => {
|
||||
return {
|
||||
api: listApi,
|
||||
multiple: true,
|
||||
treeCheckable: true,
|
||||
getPopupContainer: () => document.body,
|
||||
fieldNames: {
|
||||
label: 'className',
|
||||
value: 'id',
|
||||
key: 'id',
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user