|
@@ -0,0 +1,283 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div class="m-4 modals">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <div class="flex items-center justify-between my-4">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <a-button type="primary" size="large" class="btn-add" @click="handleCreate"
|
|
|
|
|
+ ><template #icon> <Icon icon="icon-xt-add_default|iconfont" /> </template
|
|
|
|
|
+ >新增检测</a-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <XTForm :form-data="formData" @change="callForm" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <BasicTable @register="registerTable">
|
|
|
|
|
+ <template #headerCell="{ column }">
|
|
|
|
|
+ <template v-if="column.key === 'deviceUniqueCode'"> 设备编号 </template>
|
|
|
|
|
+ <template v-if="column.key === 'deviceInfo'"> 设备信息 </template>
|
|
|
|
|
+ <template v-if="column.key === 'detectionTime'"> 检测时间 </template>
|
|
|
|
|
+ <template v-if="column.key === 'toxicChemicals'"> 透析用水中的有毒化学物质 </template>
|
|
|
|
|
+ <template v-if="column.key === 'aluminum'">铝(mg/L)<br />正常值≤0.01</template>
|
|
|
|
|
+ <template v-if="column.key === 'totalChlorine'"> 总氯(mg/L)<br />正常值≤0.1 </template>
|
|
|
|
|
+ <template v-if="column.key === 'copper'"> 铜(mg/L)<br />正常值≤0.01 </template>
|
|
|
|
|
+ <template v-if="column.key === 'fluoride'"> 氟化物 (mg/L)<br />正常值≤0.2 </template>
|
|
|
|
|
+ <template v-if="column.key === 'lead'"> 铅(mg/L)<br />正常值≤0.005 </template>
|
|
|
|
|
+ <template v-if="column.key === 'nitrate'">
|
|
|
|
|
+ 硝酸盐(氮)<br />
|
|
|
|
|
+ (mg/L)正常值≤2</template
|
|
|
|
|
+ >
|
|
|
|
|
+ <template v-if="column.key === 'sulfate'">
|
|
|
|
|
+ 硫酸盐 (mg/L)<br />
|
|
|
|
|
+ 正常值≤100</template
|
|
|
|
|
+ >
|
|
|
|
|
+ <template v-if="column.key === 'zinc'"> 锌(mg/L)<br />正常值≤0.1 </template>
|
|
|
|
|
+ <template v-if="column.key === 'electrolyte'"> 透析溶液中的电解质 </template>
|
|
|
|
|
+ <template v-if="column.key === 'calcium'">
|
|
|
|
|
+ 钙(mmol/L)<br />正常值≤2<br />(0.05mmol/L)
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-if="column.key === 'magnesium'">
|
|
|
|
|
+ 镁(mmol/L)<br />正常值≤4<br />(0.15mmol/L)
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-if="column.key === 'potassium'">
|
|
|
|
|
+ 钾(mmol/L)<br />正常值≤8<br />(0.2mmol/L)
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-if="column.key === 'sodium'">
|
|
|
|
|
+ 钠(mmol/L)<br />正常值≤70<br />(3.0mmol/L)
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-if="column.key === 'traceElement'"> 透析用水中的微量元素 </template>
|
|
|
|
|
+ <template v-if="column.key === 'antimony'"> 锑(mg/L)<br />正常值≤0.006 </template>
|
|
|
|
|
+ <template v-if="column.key === 'arsenic'">砷(mg/L)<br />正常值≤0.005</template>
|
|
|
|
|
+ <template v-if="column.key === 'barium'"> 钡(mg/L)<br />正常值≤0.1 </template>
|
|
|
|
|
+ <template v-if="column.key === 'beryllium'"> 铍(mg/L)<br />正常值≤0.0004 </template>
|
|
|
|
|
+ <template v-if="column.key === 'cadmium'"> 镉(mg/L)<br />正常值≤0.001 </template>
|
|
|
|
|
+ <template v-if="column.key === 'chromium'"> 铬(mg/L)<br />正常值≤0.014 </template>
|
|
|
|
|
+ <template v-if="column.key === 'mercury'"> 汞(mg/L)<br />正常值≤0.0002 </template>
|
|
|
|
|
+ <template v-if="column.key === 'selenium'"> 硒(mg/L)<br />正常值≤0.09 </template>
|
|
|
|
|
+ <template v-if="column.key === 'silver'"> 银(mg/L)<br />正常值≤0.005 </template>
|
|
|
|
|
+ <template v-if="column.key === 'thallium'"> 铊(mg/L)<br />正常值≤0.02 </template>
|
|
|
|
|
+ <template v-if="column.key === 'action'"> 操作 </template>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #bodyCell="{ column, record }">
|
|
|
|
|
+ <template v-if="column.key === 'deviceInfo'">{{
|
|
|
|
|
+ record.deviceName + '(' + record.deviceModel + ')'
|
|
|
|
|
+ }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'aluminum'">{{ record.toxicChemicals.aluminum }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'totalChlorine'">{{
|
|
|
|
|
+ record.toxicChemicals.totalChlorine
|
|
|
|
|
+ }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'copper'">{{ record.toxicChemicals.copper }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'fluoride'">{{ record.toxicChemicals.fluoride }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'lead'">{{ record.toxicChemicals.lead }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'nitrate'">{{ record.toxicChemicals.nitrate }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'sulfate'">{{ record.toxicChemicals.sulfate }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'zinc'">{{ record.toxicChemicals.zinc }}</template>
|
|
|
|
|
+
|
|
|
|
|
+ <template v-if="column.key === 'calcium'">{{ record.electrolyte.calcium }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'magnesium'">{{ record.electrolyte.magnesium }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'potassium'">{{ record.electrolyte.potassium }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'sodium'">{{ record.electrolyte.sodium }}</template>
|
|
|
|
|
+
|
|
|
|
|
+ <template v-if="column.key === 'antimony'">{{ record.traceElement.antimony }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'arsenic'">{{ record.traceElement.arsenic }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'barium'">{{ record.traceElement.barium }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'beryllium'">{{ record.traceElement.beryllium }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'cadmium'">{{ record.traceElement.cadmium }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'chromium'">{{ record.traceElement.chromium }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'mercury'">{{ record.traceElement.mercury }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'selenium'">{{ record.traceElement.selenium }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'silver'">{{ record.traceElement.silver }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'thallium'">{{ record.traceElement.thallium }}</template>
|
|
|
|
|
+ <template v-if="column.key === 'action'">
|
|
|
|
|
+ <TableAction
|
|
|
|
|
+ :actions="[
|
|
|
|
|
+ {
|
|
|
|
|
+ auth: 'archives:patientReturn:remove',
|
|
|
|
|
+ icon: 'icon-xt-details_delete_default|iconfont',
|
|
|
|
|
+ tooltip: '删除',
|
|
|
|
|
+ popConfirm: {
|
|
|
|
|
+ title: '是否取消删除',
|
|
|
|
|
+ placement: 'left',
|
|
|
|
|
+ confirm: handleDelete.bind(null, record, column),
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ ]"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </BasicTable>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <FormDrawer @register="registerDrawer" @success="callSuccess" />
|
|
|
|
|
+</template>
|
|
|
|
|
+<script lang="ts" setup>
|
|
|
|
|
+ import { onBeforeMount, ref } from 'vue';
|
|
|
|
|
+ import { BasicTable, useTable, TableAction } from '/@/components/TableCard';
|
|
|
|
|
+ import Icon from '/@/components/Icon';
|
|
|
|
|
+ import { columns } from './data';
|
|
|
|
|
+ import {
|
|
|
|
|
+ chemicalPollutantDetectionQueryPage,
|
|
|
|
|
+ chemicalPollutantDetectionRemove,
|
|
|
|
|
+ } from '/@/api/biz/bio/chemicalPollutantDetectionApi';
|
|
|
|
|
+ import { listDictModel } from '/@/api/common';
|
|
|
|
|
+ import { XTForm } from '/@/components/XTForm/index';
|
|
|
|
|
+ import dayjs from 'dayjs';
|
|
|
|
|
+ import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
|
|
+ import { useDrawer } from '@/components/Drawer';
|
|
|
|
|
+ import FormDrawer from './formDrawer.vue';
|
|
|
|
|
+ const { createMessage } = useMessage();
|
|
|
|
|
+
|
|
|
|
|
+ // formdata
|
|
|
|
|
+ const formData = [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '检测时间:',
|
|
|
|
|
+ name: 'shiftDate',
|
|
|
|
|
+ componentType: 'RangePicker',
|
|
|
|
|
+ format: 'YYYY-MM-DD',
|
|
|
|
|
+ valueFormat: 'YYYY-MM-DD',
|
|
|
|
|
+ placeholder: '请选择日期',
|
|
|
|
|
+ width: 240,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: 'searchNames',
|
|
|
|
|
+ componentType: 'Input',
|
|
|
|
|
+ prefix: 'icon-xt-search',
|
|
|
|
|
+ placeholder: '请输入设备编号',
|
|
|
|
|
+ width: 240,
|
|
|
|
|
+ },
|
|
|
|
|
+ ];
|
|
|
|
|
+ // tab 切换选中
|
|
|
|
|
+ const tabSelected = ref();
|
|
|
|
|
+ // 操作名称
|
|
|
|
|
+ const searchNames = ref('');
|
|
|
|
|
+ const shiftDate = ref([]);
|
|
|
|
|
+
|
|
|
|
|
+ const responseTypeOptions = ref();
|
|
|
|
|
+ const responsesupplierCategoryOptions = ref();
|
|
|
|
|
+ const [registerDrawer, { openDrawer }] = useDrawer();
|
|
|
|
|
+ onBeforeMount(async () => {
|
|
|
|
|
+ responseTypeOptions.value = await listDictModel({ dictCode: 'sys_disable_type' });
|
|
|
|
|
+ responsesupplierCategoryOptions.value = await listDictModel({ dictCode: 'pht' });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ const tableSort = ref([
|
|
|
|
|
+ {
|
|
|
|
|
+ field: 'create_time',
|
|
|
|
|
+ direction: 'DESC',
|
|
|
|
|
+ },
|
|
|
|
|
+ ]) as any;
|
|
|
|
|
+
|
|
|
|
|
+ const [registerTable, { reload }] = useTable({
|
|
|
|
|
+ api: chemicalPollutantDetectionQueryPage,
|
|
|
|
|
+ rowKey: 'id',
|
|
|
|
|
+ columns,
|
|
|
|
|
+ showIndexColumn: false,
|
|
|
|
|
+ bordered: true,
|
|
|
|
|
+ actionColumn: {
|
|
|
|
|
+ width: 200,
|
|
|
|
|
+ title: '操作',
|
|
|
|
|
+ dataIndex: 'action',
|
|
|
|
|
+ },
|
|
|
|
|
+ beforeFetch: handleBeforeFetch,
|
|
|
|
|
+ sortFn: handleSortFn,
|
|
|
|
|
+ });
|
|
|
|
|
+ // 详情按钮事件
|
|
|
|
|
+ async function handleDelete(record) {
|
|
|
|
|
+ await chemicalPollutantDetectionRemove([record.id]);
|
|
|
|
|
+ createMessage.success('删除成功!');
|
|
|
|
|
+ await reload();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 表格点击字段排序
|
|
|
|
|
+ function handleSortFn(sortInfo) {
|
|
|
|
|
+ if (sortInfo?.order && sortInfo?.columnKey) {
|
|
|
|
|
+ // 默认单列排序
|
|
|
|
|
+ tableSort.value = [
|
|
|
|
|
+ {
|
|
|
|
|
+ field: sortInfo.columnKey,
|
|
|
|
|
+ direction: sortInfo.order.replace(/(\w+)(end)/g, '$1').toUpperCase(),
|
|
|
|
|
+ },
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 表格请求之前,对参数进行处理, 添加默认 排序
|
|
|
|
|
+ async function handleBeforeFetch(params) {
|
|
|
|
|
+ const shiftTimes = [];
|
|
|
|
|
+ if (shiftDate.value && shiftDate.value.length > 0) {
|
|
|
|
|
+ shiftTimes.push(shiftDate.value[0]);
|
|
|
|
|
+ shiftTimes.push(shiftDate.value[1]);
|
|
|
|
|
+ shiftTimes[1] = dayjs(shiftTimes[1]).add(1, 'day').format('YYYY-MM-DD');
|
|
|
|
|
+ }
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...params,
|
|
|
|
|
+ orders: tableSort.value,
|
|
|
|
|
+ name: searchNames.value == '' ? undefined : searchNames.value,
|
|
|
|
|
+ status: tabSelected.value == '' ? undefined : tabSelected.value,
|
|
|
|
|
+ time: shiftTimes.length <= 0 ? undefined : shiftTimes,
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 新增按钮事件
|
|
|
|
|
+ function handleCreate() {
|
|
|
|
|
+ openDrawer(true, {
|
|
|
|
|
+ isUpdate: false,
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //抽屉回返事件
|
|
|
|
|
+ // async function handleCancel() {
|
|
|
|
|
+ // clearSelectedRowKeys();
|
|
|
|
|
+ // await reload();
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ async function callSuccess() {
|
|
|
|
|
+ await reload();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 查询组件回调
|
|
|
|
|
+ async function callForm(data) {
|
|
|
|
|
+ shiftDate.value = data.shiftDate ? data.shiftDate : '';
|
|
|
|
|
+ searchNames.value = data.searchNames ? data.searchNames : '';
|
|
|
|
|
+ console.log('callForm:::', searchNames.value);
|
|
|
|
|
+ await reload();
|
|
|
|
|
+ }
|
|
|
|
|
+</script>
|
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
|
+ .table-dot {
|
|
|
|
|
+ display: inline-block;
|
|
|
|
|
+ width: 10px;
|
|
|
|
|
+ height: 10px;
|
|
|
|
|
+ margin-right: 6px;
|
|
|
|
|
+ border-radius: 50%;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ::v-deep(.ant-btn-link) {
|
|
|
|
|
+ color: #3d4155;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ::v-deep(.ant-input-prefix) {
|
|
|
|
|
+ color: #8a99ac;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .colUpdateAvatar {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ line-height: 28px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .colImg {
|
|
|
|
|
+ width: 28px;
|
|
|
|
|
+ height: 28px;
|
|
|
|
|
+ margin-right: 5px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .upStatus {
|
|
|
|
|
+ color: #ff5d39;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .downStatus {
|
|
|
|
|
+ color: #ffad26;
|
|
|
|
|
+ }
|
|
|
|
|
+</style>
|