update: 修改大屏假数据后台管理

This commit is contained in:
xf
2025-07-28 17:15:00 +08:00
parent 11488335d1
commit 4fd7832eef
6 changed files with 363 additions and 102 deletions
@@ -7,7 +7,8 @@
<div class="title">咨询档案</div> <div class="title">咨询档案</div>
<BasicForm @register="registerForm"> <BasicForm @register="registerForm">
<template #record="{ model, field }"> <template #record="{ model, field }">
<div v-if="showReport"> <!-- <div v-if="showReport">-->
<div v-if="false">
{{ model[field] }} {{ model[field] }}
<a-button type="text" style="color: #1890ff" @click="viewReportB(model)">查看</a-button> <a-button type="text" style="color: #1890ff" @click="viewReportB(model)">查看</a-button>
</div> </div>
@@ -84,7 +85,7 @@
try { try {
const res = await getMedicalRecordApi({ id: medicalRecordsId }); const res = await getMedicalRecordApi({ id: medicalRecordsId });
userId.value = res?.userId; userId.value = res?.userId;
getEnvInfo().VITE_PLATFORM !== 'QH' && checkHaveReport(res?.userId, res?.user?.familyRelation_dictText); // getEnvInfo().VITE_PLATFORM !== 'QH' && checkHaveReport(res?.userId, res?.user?.familyRelation_dictText);
idCard.value = res?.user?.idCard; idCard.value = res?.user?.idCard;
await setBasicInfoFieldsValue({ await setBasicInfoFieldsValue({
...res?.user, ...res?.user,
@@ -407,16 +407,16 @@ export const personalFileForm: FormSchema[] = [
component: 'Input', component: 'Input',
// slot: 'desire', // slot: 'desire',
}, },
{ // {
label: '体检报告', // label: '体检报告',
field: 'yymc', // field: 'yymc',
component: 'Input', // component: 'Input',
slot: 'record', // slot: 'record',
ifShow: getEnvInfo().VITE_PLATFORM !== 'QH', // ifShow: getEnvInfo().VITE_PLATFORM !== 'QH',
// ifShow: ({ values }) => { // // ifShow: ({ values }) => {
// return !!values.idCard; // // return !!values.idCard;
// // },
// }, // },
},
{ {
label: 'idCard隐藏字段', label: 'idCard隐藏字段',
field: 'idCard', field: 'idCard',
@@ -14,6 +14,11 @@ enum Api {
status = '/health-emergency/emergency/fakerData/getFakerDataEnable', status = '/health-emergency/emergency/fakerData/getFakerDataEnable',
changeStatus = '/health-emergency/emergency/fakerData/fakerDataEnable', changeStatus = '/health-emergency/emergency/fakerData/fakerDataEnable',
xjCountFakerData = '/health-emergency/emergency/fakerData/createXjMedicalCountFakerData', xjCountFakerData = '/health-emergency/emergency/fakerData/createXjMedicalCountFakerData',
editValue = '/health-emergency/emergency/LargeScreenNew/editValue',
editData = '/health-emergency/emergency/LargeScreenNew/editData',
editMedicalValue = '/health-emergency/emergency/LargeScreenNew/editMedicalValue',
listNew = '/health-emergency/emergency/LargeScreenNew/dataDetail',
listMedical = '/health-emergency/emergency/LargeScreenNew/medicalDataDetail',
} }
export const listApi = (params: any) => defHttp.post({ url: Api.list, params }, { joinParamsToUrl: true, isTransformResponse: false }); export const listApi = (params: any) => defHttp.post({ url: Api.list, params }, { joinParamsToUrl: true, isTransformResponse: false });
// export const saveApi = (params: any) => defHttp.post({ url: Api.save.split(',')[params['module'] - 9], params }); // export const saveApi = (params: any) => defHttp.post({ url: Api.save.split(',')[params['module'] - 9], params });
@@ -25,3 +30,10 @@ export const statusApi = (params: any, id: string) => defHttp.post({ url: Api.st
export const changeStatusApi = (params: any) => defHttp.post({ url: Api.changeStatus, params }); export const changeStatusApi = (params: any) => defHttp.post({ url: Api.changeStatus, params });
export const xjCountFakerDataApi = (params: any, id: string) => defHttp.post({ url: Api.xjCountFakerData + '?centerId=' + id, params }); export const xjCountFakerDataApi = (params: any, id: string) => defHttp.post({ url: Api.xjCountFakerData + '?centerId=' + id, params });
export const editValueApi = (params: any, id: string) => defHttp.post({ url: Api.editValue + '?centerId=' + id, params });
export const editDataApi = (params: any, id: string) => defHttp.post({ url: Api.editData + '?centerId=' + id, params });
export const editMedicalValueApi = (params: any, id: string) => defHttp.post({ url: Api.editMedicalValue + '?centerId=' + id, params });
export const listNewApi = (params: any) => defHttp.get({ url: Api.listNew, params });
export const listMedicalApi = (params: any) => defHttp.get({ url: Api.listMedical, params });
@@ -6,7 +6,7 @@ const serviceColumns: BasicColumn[] = [
dataIndex: 'latestCall', dataIndex: 'latestCall',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{ {
@@ -14,7 +14,7 @@ const serviceColumns: BasicColumn[] = [
dataIndex: 'latestAcceptCall', dataIndex: 'latestAcceptCall',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{ {
@@ -22,7 +22,7 @@ const serviceColumns: BasicColumn[] = [
dataIndex: 'illNum', dataIndex: 'illNum',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{ {
@@ -30,29 +30,29 @@ const serviceColumns: BasicColumn[] = [
dataIndex: 'emergencyNum', dataIndex: 'emergencyNum',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
// {
// title: '累计受理',
// dataIndex: 'totalAccept',
// rewriting: true,
// rewroteCell: {
// type: 'inputNumber',
// },
// },
// {
// title: '累计处置',
// dataIndex: 'totalDisposal',
// rewriting: true,
// rewroteCell: {
// type: 'inputNumber',
// },
// },
{ {
title: '状态', title: '累计受理',
dataIndex: 'status', dataIndex: 'totalAccept',
rewriting: true,
rewroteCell: {
type: 'input',
}, },
},
{
title: '累计处置',
dataIndex: 'totalDisposal',
rewriting: true,
rewroteCell: {
type: 'input',
},
},
// {
// title: '状态',
// dataIndex: 'status',
// },
]; ];
const archiveColumns: BasicColumn[] = [ const archiveColumns: BasicColumn[] = [
{ {
@@ -60,7 +60,7 @@ const archiveColumns: BasicColumn[] = [
dataIndex: 'hospitalCount', dataIndex: 'hospitalCount',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{ {
@@ -68,13 +68,9 @@ const archiveColumns: BasicColumn[] = [
dataIndex: 'emergencyCount', dataIndex: 'emergencyCount',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{
title: '状态',
dataIndex: 'status',
},
]; ];
const bigColumns: BasicColumn[] = [ const bigColumns: BasicColumn[] = [
{ {
@@ -90,13 +86,17 @@ const bigColumns: BasicColumn[] = [
dataIndex: 'count', dataIndex: 'count',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{ {
title: '删除', title: '删除',
dataIndex: 'del', dataIndex: 'del',
}, },
{
title: '状态',
dataIndex: 'status',
},
]; ];
const healthColumns: BasicColumn[] = [ const healthColumns: BasicColumn[] = [
{ {
@@ -104,7 +104,7 @@ const healthColumns: BasicColumn[] = [
dataIndex: 'weightLossCountDay', dataIndex: 'weightLossCountDay',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{ {
@@ -112,7 +112,7 @@ const healthColumns: BasicColumn[] = [
dataIndex: 'weightLossCountMonth', dataIndex: 'weightLossCountMonth',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{ {
@@ -120,7 +120,7 @@ const healthColumns: BasicColumn[] = [
dataIndex: 'weightLossAbnormalCountDay', dataIndex: 'weightLossAbnormalCountDay',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{ {
@@ -128,7 +128,7 @@ const healthColumns: BasicColumn[] = [
dataIndex: 'weightLossAbnormalCountMonth', dataIndex: 'weightLossAbnormalCountMonth',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{ {
@@ -136,7 +136,7 @@ const healthColumns: BasicColumn[] = [
dataIndex: 'bloodSugarCountDay', dataIndex: 'bloodSugarCountDay',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{ {
@@ -144,7 +144,7 @@ const healthColumns: BasicColumn[] = [
dataIndex: 'bloodSugarCountMonth', dataIndex: 'bloodSugarCountMonth',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{ {
@@ -152,7 +152,7 @@ const healthColumns: BasicColumn[] = [
dataIndex: 'bloodSugarAbnormalCountDay', dataIndex: 'bloodSugarAbnormalCountDay',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{ {
@@ -160,7 +160,7 @@ const healthColumns: BasicColumn[] = [
dataIndex: 'bloodSugarAbnormalCountMonth', dataIndex: 'bloodSugarAbnormalCountMonth',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{ {
@@ -168,7 +168,7 @@ const healthColumns: BasicColumn[] = [
dataIndex: 'bloodPressureCountDay', dataIndex: 'bloodPressureCountDay',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{ {
@@ -176,7 +176,7 @@ const healthColumns: BasicColumn[] = [
dataIndex: 'bloodPressureCountMonth', dataIndex: 'bloodPressureCountMonth',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{ {
@@ -184,7 +184,7 @@ const healthColumns: BasicColumn[] = [
dataIndex: 'bloodPressureAbnormalCountDay', dataIndex: 'bloodPressureAbnormalCountDay',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{ {
@@ -192,13 +192,13 @@ const healthColumns: BasicColumn[] = [
dataIndex: 'bloodPressureAbnormalCountMonth', dataIndex: 'bloodPressureAbnormalCountMonth',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{ // {
title: '状态', // title: '状态',
dataIndex: 'status', // dataIndex: 'status',
}, // },
]; ];
const hmedicalColumns: BasicColumn[] = [ const hmedicalColumns: BasicColumn[] = [
@@ -207,7 +207,7 @@ const hmedicalColumns: BasicColumn[] = [
dataIndex: 'totalCount', dataIndex: 'totalCount',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{ {
@@ -215,7 +215,7 @@ const hmedicalColumns: BasicColumn[] = [
dataIndex: 'cardiovaAbCount', dataIndex: 'cardiovaAbCount',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{ {
@@ -223,7 +223,7 @@ const hmedicalColumns: BasicColumn[] = [
dataIndex: 'cerebrovAbCount', dataIndex: 'cerebrovAbCount',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
}, },
}, },
{ {
@@ -231,12 +231,35 @@ const hmedicalColumns: BasicColumn[] = [
dataIndex: 'cctaAbCount', dataIndex: 'cctaAbCount',
rewriting: true, rewriting: true,
rewroteCell: { rewroteCell: {
type: 'inputNumber', type: 'input',
},
},
// {
// title: '状态',
// dataIndex: 'status',
// },
];
export const columns: Array<BasicColumn[]> = [serviceColumns, archiveColumns, bigColumns, healthColumns, hmedicalColumns];
export const columns32: BasicColumn[] = [
{
title: '体检机构',
dataIndex: 'name',
rewriting: true,
rewroteCell: {
type: 'input',
}, },
}, },
{ {
title: '状态', title: '人数',
dataIndex: 'status', dataIndex: 'count',
rewriting: true,
rewroteCell: {
type: 'input',
},
},
{
title: '删除',
dataIndex: 'del',
}, },
]; ];
export const columns: Array<BasicColumn[]> = [serviceColumns, archiveColumns, bigColumns, healthColumns, hmedicalColumns];
@@ -0,0 +1,166 @@
const dataSource = [
{
name: 'latestCall',
count: 'gross',
latestCallStatus: false,
},
{
name: 'latestAcceptCall',
count: 'alerdyreceive',
latestAcceptCallStatus: false,
},
{
name: 'illNum',
count: 'jqqz',
illNumStatus: false,
},
{
name: 'emergencyNum',
count: 'dbjy',
emergencyNumStatus: false,
},
{
name: 'totalAccept',
count: 'totaldeal',
totalAcceptStatus: false,
},
{
name: 'totalDisposal',
count: 'totalacceptance',
totalDisposalStatus: false,
},
{
name: 'hospitalCount',
count: 'oneTwenty',
hospitalCountStatus: false,
},
{
name: 'emergencyCount',
count: 'hospital',
emergencyCountStatus: false,
},
{
name: 'weightLossCountDay',
count: 'weightLossCountDay',
weightLossCountDayStatus: false,
},
{
name: 'weightLossCountMonth',
count: 'weightLossCountMonth',
weightLossCountMonthStatus: false,
},
{
name: 'weightLossAbnormalCountDay',
count: 'weightLossAbnormalCountDay',
weightLossAbnormalCountDayStatus: false,
},
{
name: 'weightLossAbnormalCountMonth',
count: 'weightLossAbnormalCountMonth',
weightLossAbnormalCountMonthStatus: false,
},
{
name: 'bloodSugarCountDay',
count: 'bloodSugarCountDay',
bloodSugarCountDayStatus: false,
},
{
name: 'bloodSugarCountMonth',
count: 'bloodSugarCountMonth',
bloodSugarCountMonthStatus: false,
},
{
name: 'bloodSugarAbnormalCountDay',
count: 'bloodSugarAbnormalCountDay',
bloodSugarAbnormalCountDayStatus: false,
},
{
name: 'bloodSugarAbnormalCountMonth',
count: 'bloodSugarAbnormalCountMonth',
bloodSugarAbnormalCountMonthStatus: false,
},
{
name: 'bloodPressureCountDay',
count: 'bloodPressureCountDay',
bloodPressureCountDayStatus: false,
},
{
name: 'bloodPressureCountMonth',
count: 'bloodPressureCountMonth',
bloodPressureCountMonthStatus: false,
},
{
name: 'bloodPressureAbnormalCountDay',
count: 'bloodPressureAbnormalCountDay',
bloodPressureAbnormalCountDayStatus: false,
},
{
name: 'bloodPressureAbnormalCountMonth',
count: 'bloodPressureAbnormalCountMonth',
bloodPressureAbnormalCountMonthStatus: false,
},
{
name: 'totalCount',
count: 'totalCount',
totalCountStatus: false,
},
{
name: 'cardiovaAbCount',
count: 'cardiovaAbCount',
cardiovaAbCountStatus: false,
},
{
name: 'cerebrovAbCount',
count: 'cerebrovAbCount',
cerebrovAbCountStatus: false,
},
{
name: 'cctaAbCount',
count: 'cctaAbCount',
cctaAbCountStatus: false,
},
{
name: 'name',
count: 'name',
nameStatus: false,
},
{
name: 'count',
count: 'count',
countStatus: false,
},
];
export const dJson = {
latestCall: false,
latestAcceptCall: false,
illNum: false,
emergencyNum: false,
totalAccept: false,
totalDisposal: false,
hospitalCount: false,
emergencyCount: false,
weightLossCountDay: false,
weightLossCountMonth: false,
weightLossAbnormalCountDay: false,
weightLossAbnormalCountMonth: false,
bloodSugarCountDay: false,
bloodSugarCountMonth: false,
bloodSugarAbnormalCountDay: false,
bloodSugarAbnormalCountMonth: false,
bloodPressureCountDay: false,
bloodPressureCountMonth: false,
bloodPressureAbnormalCountDay: false,
bloodPressureAbnormalCountMonth: false,
totalCount: false,
cardiovaAbCount: false,
cerebrovAbCount: false,
cctaAbCount: false,
name: false,
count: false,
};
export function getCount(name: string) {
console.log(dataSource, dJson);
return dataSource.find((item) => item.name === name)?.count;
}
@@ -33,28 +33,18 @@
<a-button type="primary" @click="changeCalculateStatus" :loading="saveLoading">{{ isCalculate ? `保存` : `录入` }}</a-button> <a-button type="primary" @click="changeCalculateStatus" :loading="saveLoading">{{ isCalculate ? `保存` : `录入` }}</a-button>
<a-button style="margin-left: 5px" v-if="isCalculate" @click="changeCalculateStatusFalse">取消</a-button> <a-button style="margin-left: 5px" v-if="isCalculate" @click="changeCalculateStatusFalse">取消</a-button>
<a-button style="margin-left: 5px" type="primary" @click="addListItem" v-if="isCalculate && activeKey == 32">添加</a-button> <a-button style="margin-left: 5px" type="primary" @click="addListItem" v-if="isCalculate && activeKey == 32">添加</a-button>
<span style="margin-left: 5px" v-if="activeKey == 32">
状态:
<a-switch
v-model:checked="checked1"
checked-children=""
un-checked-children=""
@change="changeSwitch"
:loading="switchLoading"
/>
</span>
</div> </div>
</div> </div>
</template> </template>
<template v-if="isCalculate" #bodyCell="{ column, record, index }"> <template v-if="isCalculate" #bodyCell="{ column, record, index }">
<div v-if="column?.rewriting"> <div v-if="column?.rewriting">
<a-input-number v-if="column?.rewroteCell.type === 'inputNumber'" v-model:value="record[column.dataIndex]" /> <a-input-number v-if="column?.rewroteCell.type === 'inputNumber'" v-model:value="record[column.dataIndex]" />
<a-input v-if="column?.rewroteCell.type === 'input'" v-model:value="record[column.dataIndex]" /> <a-input v-if="column?.rewroteCell.type === 'input'" style="width: 80%" v-model:value="record[column.dataIndex]" />
</div> </div>
<div v-if="column.dataIndex == 'status'"> <div v-if="column.dataIndex == 'status'">
<a-switch <a-switch
v-model:checked="checked1" v-model:checked="dJson[column.dataIndex]"
checked-children="" checked-children="22112"
un-checked-children="" un-checked-children=""
@change="changeSwitch" @change="changeSwitch"
:loading="switchLoading" :loading="switchLoading"
@@ -64,13 +54,24 @@
<a-button type="text" style="color: #1890ff" @click="delData(index)">删除</a-button> <a-button type="text" style="color: #1890ff" @click="delData(index)">删除</a-button>
</div> </div>
</template> </template>
<template v-else #bodyCell="{ column }"> <template v-else #bodyCell="{ column, record }">
<div v-if="column.dataIndex == 'status'"> <div v-if="column?.rewriting" style="display: flex; align-items: center; justify-content: center">
{{ record[column.dataIndex] }}
<a-switch <a-switch
v-model:checked="checked1" v-if="activeKey != 32 && record[column.dataIndex]"
v-model:checked="dJson[column.dataIndex]"
checked-children="" checked-children=""
un-checked-children="" un-checked-children=""
@change="changeSwitch" style="margin-left: 5px"
@change="changeSwitchNew(column.dataIndex)"
/>
</div>
<div v-if="column.dataIndex == 'status'">
<a-switch
v-model:checked="record.status"
checked-children=""
un-checked-children=""
@change="changeSwitchMedicalNew(record)"
:loading="switchLoading" :loading="switchLoading"
/> />
</div> </div>
@@ -85,15 +86,21 @@
import BasicTable from '/@/components/Table/src/BasicTable.vue'; import BasicTable from '/@/components/Table/src/BasicTable.vue';
import { useListPage } from '/@/hooks/system/useListPage'; import { useListPage } from '/@/hooks/system/useListPage';
import { onMounted, ref, watch } from 'vue'; import { onMounted, ref, watch } from 'vue';
import { dJson, getCount } from '/@/views/emergency/bigScreenOther/currencyOther.hook';
import { import {
listApi, listApi,
listNewApi,
saveApi, saveApi,
statusApi, statusApi,
changeStatusApi, changeStatusApi,
saveElApi, saveElApi,
editValueApi,
xjCountFakerDataApi, xjCountFakerDataApi,
listMedicalApi,
editMedicalValueApi,
editDataApi,
} from '/@/views/emergency/bigScreenOther/currencyOther.api'; } from '/@/views/emergency/bigScreenOther/currencyOther.api';
import { columns } from '/@/views/emergency/bigScreenOther/currencyOther.data'; import { columns, columns32 } from '/@/views/emergency/bigScreenOther/currencyOther.data';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { allCenterApi } from '/@/views/emergency/scheduling/scheduling.api'; import { allCenterApi } from '/@/views/emergency/scheduling/scheduling.api';
import ApiSelect from '/@/components/Form/src/components/ApiSelect.vue'; import ApiSelect from '/@/components/Form/src/components/ApiSelect.vue';
@@ -140,25 +147,24 @@
]); ]);
const { tableContext } = useListPage({ const { tableContext } = useListPage({
tableProps: { tableProps: {
api: listApi, api: listNewApi,
// columns: props.columns,
beforeFetch: (params) => { beforeFetch: (params) => {
const redisKey = ['house:fakerData:groupUser']; const redisKey = ['house:fakerData:groupUser'];
console.log(redisKey, 'ahjshjsdhj');
params['module'] = activeKey.value; params['module'] = activeKey.value;
params['redisKey'] = activeKey.value == 9 ? redisKey[activeKey.value - 9] : redisKey[activeKey.value - 30]; params['redisKey'] = activeKey.value == 9 ? redisKey[activeKey.value - 9] : redisKey[activeKey.value - 30];
params['centerId'] = centerId.value; params['centerId'] = centerId.value;
return params; return params;
}, },
afterFetch: async () => { afterFetch: async () => {
let { code, result, message: msg } = getRawDataSource(); Object.keys(dJson).forEach((item) => {
const res = await statusApi({ centerId: centerId.value }, centerId.value); dJson[item] = getRawDataSource()[`${item}Status`] == 1;
checked1.value = res[activeKey.value] ? res[activeKey.value] : false; });
if (code == 200) { if (activeKey.value == 32) {
return activeKey.value == 32 ? result : [result]; getRawDataSource().forEach((item) => {
} else { item.status = item.status == 1;
message.warn(msg); });
} }
return activeKey.value == 32 ? getRawDataSource() : [getRawDataSource()];
}, },
tableSetting: { tableSetting: {
redo: true, redo: true,
@@ -174,7 +180,6 @@
}); });
function addListItem() { function addListItem() {
console.log(getDataSource());
let data = JSON.parse(JSON.stringify(getDataSource())); let data = JSON.parse(JSON.stringify(getDataSource()));
data.push({}); data.push({});
setTableData(data); setTableData(data);
@@ -188,11 +193,19 @@
async function changeCalculateStatus() { async function changeCalculateStatus() {
if (!centerId.value) return message.info('请先选择应急分中心'); if (!centerId.value) return message.info('请先选择应急分中心');
if (!isCalculate.value) return (isCalculate.value = true);
if (!isCalculate.value && activeKey.value == 32) {
console.log(1233);
setProps({
columns: columns32,
});
}
if (!isCalculate.value) {
return (isCalculate.value = true);
}
try { try {
if (activeKey.value == 32) { if (activeKey.value == 32) {
let d = getDataSource(); let d = getDataSource();
console.log(d, 'ddddddd');
for (let i = 0; i < d.length; i++) { for (let i = 0; i < d.length; i++) {
if (!d[i].name) { if (!d[i].name) {
return message.info(`第${i + 1}条的体检机构不能为空`); return message.info(`第${i + 1}条的体检机构不能为空`);
@@ -201,21 +214,36 @@
return message.info(`第${i + 1}条的人数不能为空`); return message.info(`第${i + 1}条的人数不能为空`);
} }
d[i]['centerId'] = centerId.value; d[i]['centerId'] = centerId.value;
d[i]['value'] = d[i].count;
d[i]['status'] = 0;
d[i]['type'] = 32;
} }
saveLoading.value = true; saveLoading.value = true;
switchLoading.value = false; switchLoading.value = false;
await xjCountFakerDataApi(d, centerId.value); editMedicalValueApi(d, centerId.value).then(() => {
reload();
saveLoading.value = false;
isCalculate.value = false;
setProps({
columns: columns[activeKey.value - 30],
});
});
} else { } else {
saveLoading.value = true; saveLoading.value = true;
switchLoading.value = false; switchLoading.value = false;
await saveApi({ editDataApi(
{
...(activeKey.value == 9 ? { ...getDataSource()[0], totalAccept: 0, totalDisposal: 0 } : getDataSource()[0]), ...(activeKey.value == 9 ? { ...getDataSource()[0], totalAccept: 0, totalDisposal: 0 } : getDataSource()[0]),
module: activeKey.value, module: activeKey.value,
centerId: centerId.value, centerId: centerId.value,
},
centerId.value
).then(() => {
reload();
saveLoading.value = false;
isCalculate.value = false;
}); });
} }
saveLoading.value = false;
await reload();
} catch (e) { } catch (e) {
saveLoading.value = false; saveLoading.value = false;
@@ -226,6 +254,11 @@
isCalculate.value = false; isCalculate.value = false;
saveLoading.value = false; saveLoading.value = false;
switchLoading.value = false; switchLoading.value = false;
if (activeKey.value == 32) {
setProps({
columns: columns[activeKey.value - 30],
});
}
reload(); reload();
} }
@@ -240,6 +273,30 @@
switchLoading.value = false; switchLoading.value = false;
} }
} }
function changeSwitchMedicalNew(record) {
const params = {
id: record.id,
type: 32,
status: record.status ? 1 : 0,
centerId: centerId.value,
value: record.count,
};
editValueApi(params, centerId.value).then(() => {
reload();
});
}
async function changeSwitchNew(name) {
const count = getCount(name);
const params = {
centerId: centerId.value,
type: count,
value: getDataSource()[0][name],
status: dJson[name] ? 1 : 0,
};
editValueApi(params, centerId.value).then(() => {
reload();
});
}
function handleChange() { function handleChange() {
saveLoading.value = false; saveLoading.value = false;
@@ -247,6 +304,7 @@
isCalculate.value = false; isCalculate.value = false;
setProps({ setProps({
columns: activeKey.value == 9 ? columns[activeKey.value - 9] : columns[activeKey.value - 30], columns: activeKey.value == 9 ? columns[activeKey.value - 9] : columns[activeKey.value - 30],
api: activeKey.value !== 32 ? listNewApi : listMedicalApi,
}); });
if (centerId.value) { if (centerId.value) {
reload(); reload();
@@ -256,6 +314,7 @@
onMounted(() => { onMounted(() => {
setProps({ setProps({
columns: activeKey.value == 9 ? columns[activeKey.value - 9] : columns[activeKey.value - 30], columns: activeKey.value == 9 ? columns[activeKey.value - 9] : columns[activeKey.value - 30],
api: activeKey.value !== 32 ? listNewApi : listMedicalApi,
}); });
}); });