From 7bdc84b5844d2a481e2f17cdd2c8204fd4a403ee Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期一, 29 九月 2025 16:48:31 +0800
Subject: [PATCH] 业务管理相关页面添加`批号`查询条件
---
src/views/statisticalCharts/inspectionItemWarning/index.vue | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 103 insertions(+), 10 deletions(-)
diff --git a/src/views/statisticalCharts/inspectionItemWarning/index.vue b/src/views/statisticalCharts/inspectionItemWarning/index.vue
index 41ef602..22585f5 100644
--- a/src/views/statisticalCharts/inspectionItemWarning/index.vue
+++ b/src/views/statisticalCharts/inspectionItemWarning/index.vue
@@ -10,12 +10,28 @@
<el-row>
<el-col :span="24">
<div class="inspection-card">
- <div class="title">妫�楠岄」鍋忓樊棰勮鏁版嵁璇︽儏</div>
+ <div class="title">妫�楠岄」骞冲潎鍊煎亸宸璀︽暟鎹鎯�</div>
<Echarts ref="chart"
:chartStyle="chartStyle"
:grid="grid"
:options="echartsOptions"
:series="echartsSeries"
+ :tooltip="tooltip"
+ :xAxis="xAxis"
+ :yAxis="yAxis"
+ style="height: 40vh;"></Echarts>
+ </div>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="24">
+ <div class="inspection-card">
+ <div class="title">妫�楠岄」瑕佹眰鍊煎亸宸璀︽暟鎹鎯�</div>
+ <Echarts ref="chart"
+ :chartStyle="chartStyle"
+ :grid="grid"
+ :options="echartsOptions"
+ :series="echartsSeries1"
:tooltip="tooltip"
:xAxis="xAxis"
:yAxis="yAxis"
@@ -50,13 +66,12 @@
tableLoading: false,
column: [
{ label: '鏍峰搧缂栧彿', prop: 'sampleCode',width: 150 },
- { label: '鏍峰搧鍚嶇О', prop: 'sampleName',width: 150 },
- { label: '鍨嬪彿', prop: 'sampleModel' },
+ { label: '鏍峰搧鍚嶇О', prop: 'sampleName'},
+ { label: '鍨嬪彿', prop: 'sampleModel',width: 150 },
{ label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName',width: 150 },
- { label: '妫�楠岄」鍚嶇О', prop: 'inspectionItemName',width: 150 },
- { label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName',width: 150 },
+ { label: '妫�楠岄」鍚嶇О', prop: 'inspectionItemName'},
{
- label: "鍋忓樊鍊�",
+ label: "鍋忓樊鍊�%",
prop: "deviationValue",
width: 150,
dataType: "tag",
@@ -89,7 +104,6 @@
column1: [
{ label: '鏍峰搧缂栧彿', prop: 'sampleCode'},
{ label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName'},
- { label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName'},
{
label: "妫�娴嬪��",
prop: "testValue",
@@ -119,7 +133,30 @@
echartsOptions: {},
echartsSeries: [
{
- name: '鍋忓樊鍊�',
+ name: '妫�娴嬪��',
+ type: 'line',
+ smooth: true,
+ tooltip: {
+ valueFormatter: function (value) {
+ return value;
+ }
+ },
+ label: {
+ show: true,
+ position: 'top',
+ formatter: function (value) {
+ return value.value;
+ },
+ distance: 14
+ },
+ data: [],
+ markArea: {},
+ markPoint: {}
+ },
+ ],
+ echartsSeries1: [
+ {
+ name: '妫�娴嬪��',
type: 'line',
smooth: true,
tooltip: {
@@ -188,7 +225,6 @@
// 鏌ヨ鎶樼嚎鍥句俊鎭�
rowClick (row) {
selectDeviationWarning({deviationWarningId: row.deviationWarningId}).then(res => {
- console.log('res---', res)
if (res.data === null) {
this.$message.warning('鏆傛棤鏁版嵁')
return
@@ -196,10 +232,23 @@
let lineData = []
let xAxis = []
let markAreas = []; // 瀛樺偍 markArea 鐨勬暟缁�
+ let markAreas1 = [];
let markPoints = [];
+ let markPoints1 = [];
+ const sampleCodeCount = {};
res.data.forEach((item, index) => {
lineData.push(item.testValue)
- xAxis.push(item.sampleCode)
+ // 娣诲姞绱㈠紩浠ョ‘淇濆敮涓�鎬�
+ // 妫�鏌ユ槸鍚﹂渶瑕佸尯鍒� sampleCode
+ if (!sampleCodeCount[item.sampleCode]) {
+ sampleCodeCount[item.sampleCode] = 1; // 绗竴娆″嚭鐜�
+ xAxis.push(item.sampleCode); // 鐩存帴浣跨敤鍘熷 sampleCode
+ } else {
+ sampleCodeCount[item.sampleCode]++; // 澧炲姞璁℃暟
+ const uniqueSampleCode = `${item.sampleCode}-${sampleCodeCount[item.sampleCode]}`;
+ xAxis.push(uniqueSampleCode); // 娣诲姞鍚庣紑浠ュ尯鍒�
+ }
+
// 濡傛灉 isIssue 涓� 1锛屽垯鍦ㄦ绱㈠紩澶勬坊鍔犱竴涓� markArea
if (item.isIssue == 1) {
const startColumn = index > 0 ? xAxis[index - 1] : xAxis[index]; // 璧风偣锛氬墠涓�鍒楁垨褰撳墠鍒�
@@ -233,6 +282,39 @@
borderRadius: 4
}
});
+ }// 濡傛灉 isIssueAsked 涓� 1锛屽垯鍦ㄦ绱㈠紩澶勬坊鍔犱竴涓� markAreas1
+ if (item.isIssueAsked == 1) {
+ const startColumn = index > 0 ? xAxis[index - 1] : xAxis[index]; // 璧风偣锛氬墠涓�鍒楁垨褰撳墠鍒�
+ const endColumn = xAxis[index]; // 缁堢偣锛氬綋鍓嶅垪
+
+ markAreas.push([
+ {
+ xAxis: startColumn, // 浠庡墠涓�鍒楀紑濮�
+ },
+ {
+ xAxis: endColumn, // 鍒板綋鍓嶅垪缁撴潫
+ }
+ ]);
+ markPoints1.push({
+ name: '闂鐐�',
+ coord: [item.sampleCode, item.testValue],
+ value: item.testValue,
+ itemStyle: {
+ color: 'rgba(255, 173, 177, 0.8)'
+ },
+ label: {
+ show: true,
+ formatter: function(params) {
+ return params.value; // 鑷畾涔夋爣绛惧唴瀹�
+ },
+ color: 'black', // 鏍囩鏂囧瓧棰滆壊
+ fontSize: 12,
+ distance: 5, // 璋冩暣鏍囩涓庢皵娉$殑璺濈
+ padding: [0,0],
+ backgroundColor: 'rgba(255, 173, 177, 0.8)', // 鏍囩鑳屾櫙鑹插強閫忔槑搴�
+ borderRadius: 4
+ }
+ });
}
})
this.xAxis[0].data = xAxis
@@ -247,6 +329,17 @@
this.echartsSeries[0].markPoint = {
data: markPoints
};
+ this.echartsSeries1[0].data = lineData
+ // 鏇存柊 markAreas1 閰嶇疆
+ this.echartsSeries1[0].markAreas1 = {
+ itemStyle: {
+ color: 'rgba(255, 173, 177, 0.4)' // 璁剧疆鑳屾櫙棰滆壊
+ },
+ data: markAreas1 // 鍔ㄦ�佺敓鎴愮殑 markAreas1 鏁版嵁
+ };
+ this.echartsSeries1[0].markPoint = {
+ data: markPoints1
+ };
})
},
// 閲嶇疆
--
Gitblit v1.9.3