质控图

This commit is contained in:
wyuu 2026-02-10 17:36:45 +08:00
parent 62e7a425cc
commit e59cb9fa9e
4 changed files with 99 additions and 18 deletions

View File

@ -227,3 +227,11 @@ export function querySample(data?: Object) {
params: data
})
}
//计算靶值
export function qcCalc(data?: Object) {
return request({
url: '/qcgraph/calc',
method: 'get',
params: data
})
}

View File

@ -368,4 +368,19 @@ aside {
.el-tree-node__children {
padding-left: 15px !important;
}
/* 禁止文本选中 */
.no-select {
user-select: none;
/* 兼容旧版浏览器 */
-webkit-user-select: none;
/* Safari/Chrome */
-moz-user-select: none;
/* Firefox */
-ms-user-select: none;
/* IE/Edge */
cursor: pointer;
}

View File

@ -89,7 +89,9 @@
<div v-for="item in resultData" class="item">
<div class="time">{{ item.zkrqMonth }}</div>
<div v-for="v in zkKeys">
<div :class="[item.flag == v ? 'red_title' : '']">{{ item['zkjg' + v] }}</div>
<div :class="[item['zkphFlag' + v] ? 'red_title' : '', 'no-select']" @dblclick="dbSKHandle(v, item)">
{{ item['zkjg' + v] }}
</div>
</div>
<div>{{ item.yhdh }}</div>
</div>
@ -102,13 +104,15 @@
<!-- 质控值、SD计算 -->
<el-dialog v-model="dialogVisible" title="质控靶值、SD计算" draggable :close-on-click-modal="false" width="500px">
<el-dialog v-model="dialogVisible" title="质控靶值、SD计算" draggable :close-on-click-modal="false" width="600px">
<el-form :model="form" ref="queryRef" label-width="90px">
<el-form-item label="计算时间:" prop="xmdh">
<el-date-picker v-model="form.sqsj1" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
style="width: 47%;" @change="handletime" />&nbsp;-&nbsp;
<el-date-picker v-model="form.sqsj2" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
@change="handletime" style="width: 47%;" />
<el-date-picker v-model="form.zkrq1" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
style="width: 40%;" @change="handletime" />&nbsp;-&nbsp;
<el-date-picker v-model="form.zkrq2" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
@change="handletime" style="width: 40%;" />
<el-button type="primary" class="ml5" @click="jsTime">计算</el-button>
</el-form-item>
<el-form-item label="质控项目:" prop="xmdh">
<el-input v-model="form.xmdh" readonly />
@ -154,7 +158,7 @@
<script setup>
import { getComDicts } from "@/api/liswork/dict/ComDict";
import { getGroupInstrdList } from "@/api/liswork/work/LisWork";
import { qcgraphList, querySample } from "@/api/liswork/qualityControl/index";
import { qcgraphList, querySample, qcCalc, saveBtQcSample } from "@/api/liswork/qualityControl/index";
import { classCom } from "@/utils/classCom";
import { useCommonStore } from '@/store/modules/commonStore';
import dayjs from 'dayjs';
@ -174,8 +178,8 @@ const pjForm = ref({
const dialogVisible = ref(false)
const form = ref({
xmdh: '',
sqsj1: '',
sqsj2: '',
zkrq1: '',
zkrq2: '',
zkph: '',
zkbz: '',
sd: '',
@ -183,8 +187,7 @@ const form = ref({
const queryParams = ref({
// instrGroup: mbStore.defaultConfig.lisgroupid || 'ALL',
instrGroup: 'ALL',
// yq: mbStore.defaultConfig.defaultinstr || '1',
yq: '46',
yq: mbStore.defaultConfig.defaultinstr || '1',
zkrq1: '',
zkrq2: '',
cs: '0',
@ -206,6 +209,8 @@ const columns = ref([
{ label: '试剂', prop: 'sjph', visible: true, align: 'center' },
{ label: '波长', prop: 'bc', visible: true, align: 'center' },
{ label: '方法', prop: 'ff', visible: true, align: 'center' },
{ label: 'cv(%)', prop: 'cv', visible: true, align: 'center' },
{ label: 'sd', prop: 'sd', visible: true, align: 'center' },
{ label: '备注', prop: 'bz1', visible: true, align: 'center' },
])
@ -263,30 +268,84 @@ const getYqConfig = () => {
})
}
// 获取上个月的第一天和最后一天
const getLastMonthRange = (format = 'YYYY-MM-DD') => {
const lastMonth = dayjs().subtract(1, 'month');
return {
firstDay: lastMonth.startOf('month').format(format),
lastDay: lastMonth.endOf('month').format(format)
};
};
const info = ref({})
const handleEdit = (row, event) => {
const { firstDay, lastDay } = getLastMonthRange();
info.value = row
event.stopPropagation();
form.value.zkrq1 = firstDay
form.value.zkrq2 = lastDay
form.value.xmdh = row.xmdh
form.value.zkbz = row.zkbz
form.value.zkph = row.zkph
form.value.sd = row.sd
// row.cv = form.value.sd * 100 / form.value.zkph
dialogVisible.value = true
}
const jsTime = () => {
qcCalc({ ...form.value, yq: queryParams.value.yq, cs: queryParams.value.cs }).then((res) => {
form.value.zkbz = res.data[0].avg1
form.value.sd = res.data[0].sd1
})
}
const handlePj = (row, event) => {
event.stopPropagation();
pjForm.value = {
zkph: row.zkph,
bz1: row.bz1,
}
info.value = row
pjShow.value = true
}
const dbSKHandle = (val, item) => {
console.log('val==>', val, item);
}
const pjHandle = () => {
pjShow.value = false
info.value.bz1 = pjForm.value.bz1
saveBtQcSample([info.value]).then((res) => {
if (res.code == 0) {
pjShow.value = false
tableData.value = tableData.value.map((item, i) => item.zkph == info.value.zkph ? { ...info.value } : item);
nextTick(() => {
tableRef.value.toggleAllSelection()
})
}
})
}
const subHandle = () => {
if (!form.value.zkbz && !form.value.sd) return ElMessage.warning('请先计算!')
info.value.cv = (form.value.sd * 100 / form.value.zkbz).toFixed(3)
info.value.zkbz = form.value.zkbz
info.value.sd = form.value.sd
saveBtQcSample([info.value]).then((res) => {
if (res.code == 0) {
dialogVisible.value = false
tableData.value = tableData.value.map((item, i) => item.zkph == info.value.zkph ? { ...info.value } : item);
nextTick(() => {
tableRef.value.toggleAllSelection()
})
}
})
}
const rowClick = (row) => {
@ -439,7 +498,7 @@ const initChart = () => {
return res;
}
},
grid: { left: '2%', right: '2%', bottom: '10%', top: '15%', containLabel: true },
grid: { left: '1%', right: '2%', bottom: '10%', top: '10%', containLabel: true },
dataZoom: [
{
type: "slider",
@ -538,7 +597,7 @@ const getList = () => {
if (item.zkrqMonth == v.zkrqMonth) {
item.yhdh = v.yhdh;
// 判断是否为失控
item.flag = Math.abs((v.zkbz - v.zkjg) / v.sd) > 3 ? v.zkph : '';
item['zkphFlag' + v.zkph] = Math.abs((v.zkbz - v.zkjg) / v.sd) > 3 ? true : false;
}
});
});

View File

@ -65,8 +65,7 @@ export default defineConfig(({
proxy: {
// https://cn.vitejs.dev/config/#server-proxy
'/dev-api': {
//target: 'http://47.97.125.165:8904',
target: 'http://localhost:9801',
target: 'http://47.97.125.165:8904',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '')
},