|
@@ -19,25 +19,25 @@
|
|
|
</div>
|
|
|
<div class="body">
|
|
|
<div class="text">
|
|
|
- 规格上限:{{ value ? JSON.parse(value).up : "-" }}
|
|
|
+ Xbar-UCL:{{ value ? JSON.parse(value).avgMax : "-" }}
|
|
|
</div>
|
|
|
<div class="text">
|
|
|
- 规格下限:{{ value ? JSON.parse(value).down : "-" }}
|
|
|
+ Xbar-MED:{{ value ? JSON.parse(value).avgMid : "-" }}
|
|
|
</div>
|
|
|
<div class="text">
|
|
|
- 计量单位:{{ value ? JSON.parse(value).unit : "-" }}
|
|
|
+ Xbar-LCL:{{ value ? JSON.parse(value).avgMin : "-" }}
|
|
|
</div>
|
|
|
<div class="text">
|
|
|
- Xbar-UCL:{{ showData.avgMax ? showData.avgMax : "-" }}
|
|
|
+ R-UCL:{{ value ? JSON.parse(value).rangeMax : "-" }}
|
|
|
</div>
|
|
|
<div class="text">
|
|
|
- Xbar-LCL:{{ showData.avgMin ? showData.avgMin : "0" }}
|
|
|
+ R-MED:{{ value ? JSON.parse(value).rangeMid : "-" }}
|
|
|
</div>
|
|
|
<div class="text">
|
|
|
- R-UCL:{{ showData.rangeMax ? showData.rangeMax : "-" }}
|
|
|
+ R-LCL:{{ value ? JSON.parse(value).rangeMin : "-" }}
|
|
|
</div>
|
|
|
<div class="text">
|
|
|
- R-LCL:{{ showData.rangeMin ? showData.rangeMin : "0" }}
|
|
|
+ 计量单位:{{ value ? JSON.parse(value).unit : "-" }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -49,6 +49,14 @@
|
|
|
<div class="bg"></div>
|
|
|
样本数据录入
|
|
|
</div>
|
|
|
+ <div class="header" v-show="!addStatus && !editStatus">
|
|
|
+ <Search
|
|
|
+ :searchOptions="searchForm"
|
|
|
+ ref="searchRef"
|
|
|
+ @data-list="getTableData"
|
|
|
+ @reset-list="reset"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
<div class="btns">
|
|
|
<!-- <el-button
|
|
|
v-if="!editStatus && !addStatus"
|
|
@@ -60,6 +68,7 @@
|
|
|
<el-button
|
|
|
v-if="!addStatus && !editStatus"
|
|
|
type="primary"
|
|
|
+ size="small"
|
|
|
class="btn"
|
|
|
@click="changeaddstatus"
|
|
|
>新增</el-button
|
|
@@ -67,6 +76,7 @@
|
|
|
<el-button
|
|
|
v-if="editStatus || addStatus"
|
|
|
type="success"
|
|
|
+ size="small"
|
|
|
class="btn"
|
|
|
@click="submit"
|
|
|
>确定</el-button
|
|
@@ -74,23 +84,11 @@
|
|
|
<el-button
|
|
|
v-if="editStatus || addStatus"
|
|
|
type="info"
|
|
|
+ size="small"
|
|
|
class="btn"
|
|
|
@click="canceleOp"
|
|
|
>取消</el-button
|
|
|
- ><span v-if="!addStatus && !editStatus" style="margin: 10px"
|
|
|
- >年份:</span
|
|
|
>
|
|
|
- <el-date-picker
|
|
|
- v-if="!addStatus && !editStatus"
|
|
|
- v-model="year"
|
|
|
- class="btn"
|
|
|
- type="year"
|
|
|
- style="width: 160px"
|
|
|
- placeholder="Pick a year"
|
|
|
- value-format="YYYY"
|
|
|
- :clear-icon="''"
|
|
|
- @change="getTableData"
|
|
|
- />
|
|
|
</div>
|
|
|
<!-- 导入代码 -->
|
|
|
<!-- <div class="btns">
|
|
@@ -163,7 +161,14 @@
|
|
|
><span>{{ row.batchNo }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" :label="title">
|
|
|
+ <el-table-column width="100" prop="accuracys" label="数据">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <div v-for="(item, index) in row.accuracys" :key="index">
|
|
|
+ <span>数值{{ index }}:{{ item }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column align="center" :label="title">
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
prop="accuracy1"
|
|
@@ -214,7 +219,8 @@
|
|
|
><span>{{ row.accuracy5 }}</span>
|
|
|
</template>
|
|
|
</el-table-column> </el-table-column
|
|
|
- ><el-table-column
|
|
|
+ > -->
|
|
|
+ <el-table-column
|
|
|
align="center"
|
|
|
prop="avg"
|
|
|
label="平均值"
|
|
@@ -266,6 +272,7 @@
|
|
|
<template #default="{ row }">
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
+ size="small"
|
|
|
class="btn"
|
|
|
@click="updataItem(row)"
|
|
|
style="height: 25px"
|
|
@@ -273,6 +280,7 @@
|
|
|
>
|
|
|
<el-button
|
|
|
type="info"
|
|
|
+ size="small"
|
|
|
class="btn"
|
|
|
style="height: 25px"
|
|
|
@click="deleteSubmit(row.id)"
|
|
@@ -306,7 +314,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy1"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -323,7 +331,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy1"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -340,7 +348,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy1"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -358,7 +366,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy1"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -375,7 +383,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy2"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -391,7 +399,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy3"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -407,7 +415,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy4"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -423,7 +431,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy5"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -434,7 +442,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy1"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -445,7 +453,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy1"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -456,7 +464,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy1"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -471,7 +479,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy1"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -483,7 +491,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy1"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -495,7 +503,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy1"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -530,50 +538,45 @@
|
|
|
value-format="YYYY-MM-DD"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="任务编号" prop="qualityTaskId">
|
|
|
+ <el-select
|
|
|
+ v-model="addData.qualityTaskId"
|
|
|
+ @change="
|
|
|
+ (value) => {
|
|
|
+ taskChange(value);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in taskOption"
|
|
|
+ :key="index"
|
|
|
+ :label="item.taskCode"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="产品型号" prop="model">
|
|
|
- <el-input v-model="addData.model" />
|
|
|
+ <el-input :disabled="true" v-model="addData.model" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="生产批号" prop="batchNo">
|
|
|
<el-input v-model="addData.batchNo" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="数值1" prop="accuracy1">
|
|
|
- <el-input-number
|
|
|
- :precision="2"
|
|
|
- :step="0.01"
|
|
|
- style="width: 100%"
|
|
|
- v-model="addData.accuracy1"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="数值2" prop="accuracy2">
|
|
|
- <el-input-number
|
|
|
- :precision="2"
|
|
|
- :step="0.01"
|
|
|
- v-model="addData.accuracy2"
|
|
|
- style="width: 100%"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="数值3" prop="accuracy3">
|
|
|
- <el-input-number
|
|
|
- :precision="2"
|
|
|
- :step="0.01"
|
|
|
- style="width: 100%"
|
|
|
- v-model="addData.accuracy3"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="数值4" prop="accuracy4">
|
|
|
+ <el-form-item
|
|
|
+ v-for="(item, index) in addData.accuracys"
|
|
|
+ :label="'数值' + (index + 1)"
|
|
|
+ :key="index"
|
|
|
+ :rules="[
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ trigger: 'change',
|
|
|
+ },
|
|
|
+ ]"
|
|
|
+ >
|
|
|
<el-input-number
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
|
style="width: 100%"
|
|
|
- v-model="addData.accuracy4"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="数值5" prop="accuracy5">
|
|
|
- <el-input-number
|
|
|
- :precision="2"
|
|
|
- style="width: 100%"
|
|
|
- :step="0.01"
|
|
|
- v-model="addData.accuracy5"
|
|
|
+ v-model="addData.accuracys[index]"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<!-- <el-form-item label="平均值" prop="avg">
|
|
@@ -615,14 +618,16 @@
|
|
|
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
- v-print="'#charts'"
|
|
|
+ v-print="'#print'"
|
|
|
style="margin-left: 10px; height: 25px"
|
|
|
>打 印</el-button
|
|
|
>
|
|
|
</div>
|
|
|
<div class="info">
|
|
|
- <div id="charts" :style="{ height: maxHeight / 2 + 'px' }"></div>
|
|
|
- <div id="charts1" :style="{ height: maxHeight / 2 + 'px' }"></div>
|
|
|
+ <div id="print">
|
|
|
+ <div id="charts" :style="{ height: maxHeight / 2 + 'px' }"></div>
|
|
|
+ <div id="charts1" :style="{ height: maxHeight / 2 + 'px' }"></div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-scrollbar>
|
|
@@ -633,7 +638,14 @@
|
|
|
<script setup>
|
|
|
import * as echarts from "echarts";
|
|
|
import { useDictionaryStore } from "@/store";
|
|
|
-import { getData, addDatas, deleteData, updateData } from "@/api/analysis";
|
|
|
+import {
|
|
|
+ getData,
|
|
|
+ addDatas,
|
|
|
+ deleteData,
|
|
|
+ updateData,
|
|
|
+ getTaskCode,
|
|
|
+} from "@/api/analysis";
|
|
|
+import Search from "@/components/Search/index.vue";
|
|
|
const year = ref("0");
|
|
|
const currentOption = reactive({
|
|
|
total: 0,
|
|
@@ -642,11 +654,19 @@ const currentOption = reactive({
|
|
|
pageSizes: [12],
|
|
|
});
|
|
|
const lableValue = ref("");
|
|
|
+const searchRef = ref(null);
|
|
|
+const getTaskOption = async () => {
|
|
|
+ const { data } = await getTaskCode({
|
|
|
+ operationCode: JSON.parse(value.value).value,
|
|
|
+ });
|
|
|
+ taskOption.value = data;
|
|
|
+};
|
|
|
const getTableData = async () => {
|
|
|
const { data, code, msg } = await getData({
|
|
|
+ ...searchRef.value.searchForm,
|
|
|
pageNo: currentOption.page,
|
|
|
pageSize: currentOption.limit,
|
|
|
- yearStr: year.value,
|
|
|
+ // yearStr: year.value,
|
|
|
operation: lableValue.value,
|
|
|
});
|
|
|
if (code == "200") {
|
|
@@ -662,6 +682,23 @@ const getTableData = async () => {
|
|
|
}
|
|
|
disabled.value = false;
|
|
|
};
|
|
|
+const searchForm = [
|
|
|
+ {
|
|
|
+ label: "创建时间",
|
|
|
+ prop: "created",
|
|
|
+ type: "daterange",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "产品型号",
|
|
|
+ prop: "model",
|
|
|
+ type: "input",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "生产批号",
|
|
|
+ prop: "batchNo",
|
|
|
+ type: "input",
|
|
|
+ },
|
|
|
+];
|
|
|
//编辑状态
|
|
|
const editStatus = ref(false);
|
|
|
const addStatus = ref(false);
|
|
@@ -690,8 +727,8 @@ const setY1value = () => {
|
|
|
|
|
|
chartsOption1.value.series[0].data = Y1value.value;
|
|
|
};
|
|
|
-const setX1array = () => {
|
|
|
- X1array.value = [];
|
|
|
+const setX1array = async () => {
|
|
|
+ X1array.value = await [];
|
|
|
tableData.value.forEach((item, index) => {
|
|
|
X1array.value.push(index + 1);
|
|
|
});
|
|
@@ -724,6 +761,12 @@ const addItem = {
|
|
|
range: 0,
|
|
|
};
|
|
|
const rules = {
|
|
|
+ qualityTaskId: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
+ ],
|
|
|
dateStr: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -817,38 +860,39 @@ const rules = {
|
|
|
};
|
|
|
const resItem = {
|
|
|
// abnormal: "",
|
|
|
- accuracy1: 0,
|
|
|
- accuracy2: 0,
|
|
|
- accuracy3: 0,
|
|
|
- accuracy4: 0,
|
|
|
- accuracy5: 0,
|
|
|
analyseUser: "",
|
|
|
- avg: 0,
|
|
|
batchNo: "",
|
|
|
checkDeviceNo: "",
|
|
|
checkUser: "",
|
|
|
dateStr: "",
|
|
|
measure: "",
|
|
|
model: "",
|
|
|
- range: 0,
|
|
|
};
|
|
|
const addData = ref({
|
|
|
// abnormal: "",
|
|
|
- accuracy1: 0,
|
|
|
- accuracy2: 0,
|
|
|
- accuracy3: 0,
|
|
|
- accuracy4: 0,
|
|
|
- accuracy5: 0,
|
|
|
analyseUser: "",
|
|
|
- avg: 0,
|
|
|
batchNo: "",
|
|
|
checkDeviceNo: "",
|
|
|
checkUser: "",
|
|
|
dateStr: "",
|
|
|
measure: "",
|
|
|
model: "",
|
|
|
- range: 0,
|
|
|
});
|
|
|
+const accuracysSum = ref(0);
|
|
|
+const taskChange = (value) => {
|
|
|
+ taskOption.value.forEach((item) => {
|
|
|
+ if (item.id == value) {
|
|
|
+ addData.value.model = item.prodtModel;
|
|
|
+ accuracysSum.value = Number(item.processCount);
|
|
|
+ addData.value.accuracys = [];
|
|
|
+ let array = [];
|
|
|
+ for (let i = 0; i < accuracysSum.value; i++) {
|
|
|
+ array.push(0);
|
|
|
+ }
|
|
|
+ addData.value.accuracys = array;
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
const oldDataJSON = ref("");
|
|
|
const showData = ref({});
|
|
|
const url = ref(import.meta.env.VITE_APP_BASE_API + "/api/v1/spc/import");
|
|
@@ -857,29 +901,47 @@ const opOptions = ref([...dicts.spc_operation]);
|
|
|
const setChart1Info = () => {
|
|
|
// chartsOption1.value.title[0].text = `上限=${showData.value.avgMax ? showData.value.avgMax : "-"}`;
|
|
|
// chartsOption1.value.title[0].text = `x̄=${showData.value.avgAvg ? showData.value.avgAvg : "-"}`;
|
|
|
- chartsOption1.value.series[0].markLine.data[0].yAxis = showData.value.avgMax;
|
|
|
- chartsOption1.value.series[0].markLine.data[0].label.formatter = ` 上限=${showData.value.avgMax ? showData.value.avgMax : "0"}`;
|
|
|
- chartsOption1.value.series[0].markLine.data[1].yAxis = showData.value.avgMin
|
|
|
- ? showData.value.avgMin
|
|
|
+ chartsOption1.value.series[0].markLine.data[0].yAxis = JSON.parse(
|
|
|
+ value.value
|
|
|
+ ).avgMax;
|
|
|
+ chartsOption1.value.series[0].markLine.data[0].label.formatter = ` 上限=${
|
|
|
+ JSON.parse(value.value).avgMax ? JSON.parse(value.value).avgMax : "0"
|
|
|
+ }`;
|
|
|
+ chartsOption1.value.series[0].markLine.data[1].yAxis = JSON.parse(value.value)
|
|
|
+ .avgMin
|
|
|
+ ? JSON.parse(value.value).avgMin
|
|
|
: 0;
|
|
|
- chartsOption1.value.series[0].markLine.data[1].label.formatter = ` 下限=${showData.value.avgMin ? showData.value.avgMin : "0"}`;
|
|
|
- chartsOption1.value.series[0].markLine.data[2].yAxis = showData.value.avgAvg;
|
|
|
- chartsOption1.value.series[0].markLine.data[2].label.formatter = `x̄=${showData.value.avgAvg}`;
|
|
|
+ chartsOption1.value.series[0].markLine.data[1].label.formatter = ` 下限=${JSON.parse(value.value).avgMin ? JSON.parse(value.value).avgMin : "0"}`;
|
|
|
+ chartsOption1.value.series[0].markLine.data[2].yAxis = JSON.parse(
|
|
|
+ value.value
|
|
|
+ ).avgMid;
|
|
|
+ chartsOption1.value.series[0].markLine.data[2].label.formatter = `x̄=${
|
|
|
+ JSON.parse(value.value).avgMid
|
|
|
+ }`;
|
|
|
// chartsOption1.value.title[2].text = `下限=${showData.value.avgMin ? showData.value.avgMin : "0"}`;
|
|
|
};
|
|
|
const setChart2Info = () => {
|
|
|
// chartsOption2.value.title[0].text = `上限=${showData.value.rangeMax ? showData.value.rangeMax : "-"}`;
|
|
|
// chartsOption2.value.title[0].text = `R=${showData.value.rangeAvg ? showData.value.rangeAvg : "-"}`;
|
|
|
- chartsOption2.value.series[0].markLine.data[0].yAxis =
|
|
|
- showData.value.rangeMax;
|
|
|
- chartsOption2.value.series[0].markLine.data[0].label.formatter = ` 上限=${showData.value.rangeMax ? showData.value.rangeMax : "0"}`;
|
|
|
- chartsOption2.value.series[0].markLine.data[1].yAxis = showData.value.rangeMin
|
|
|
- ? showData.value.rangeMin
|
|
|
+ chartsOption2.value.series[0].markLine.data[0].yAxis = JSON.parse(
|
|
|
+ value.value
|
|
|
+ ).rangeMax;
|
|
|
+ chartsOption2.value.series[0].markLine.data[0].label.formatter = ` 上限=${
|
|
|
+ JSON.parse(value.value).rangeMax ? JSON.parse(value.value).rangeMax : "0"
|
|
|
+ }`;
|
|
|
+ chartsOption2.value.series[0].markLine.data[1].yAxis = JSON.parse(value.value)
|
|
|
+ .rangeMin
|
|
|
+ ? JSON.parse(value.value).rangeMin
|
|
|
: 0;
|
|
|
- chartsOption2.value.series[0].markLine.data[1].label.formatter = ` 下限=${showData.value.rangeMin ? showData.value.rangeMin : "0"}`;
|
|
|
- chartsOption2.value.series[0].markLine.data[2].yAxis =
|
|
|
- showData.value.rangeAvg;
|
|
|
- chartsOption2.value.series[0].markLine.data[2].label.formatter = `x̄=${showData.value.rangeAvg}`;
|
|
|
+ chartsOption2.value.series[0].markLine.data[1].label.formatter = ` 下限=${
|
|
|
+ JSON.parse(value.value).rangeMin ? JSON.parse(value.value).rangeMin : "0"
|
|
|
+ }`;
|
|
|
+ chartsOption2.value.series[0].markLine.data[2].yAxis = JSON.parse(
|
|
|
+ value.value
|
|
|
+ ).rangeMid;
|
|
|
+ chartsOption2.value.series[0].markLine.data[2].label.formatter = `x̄=${
|
|
|
+ JSON.parse(value.value).rangeMid
|
|
|
+ }`;
|
|
|
// chartsOption2.value.title[2].text = `下限=${showData.value.rangeMin ? showData.value.rangeMin : "0"}`;
|
|
|
};
|
|
|
const setChart1 = () => {
|
|
@@ -915,13 +977,14 @@ const onSuccess = (res) => {
|
|
|
ElMessage.success(msg);
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
+const taskOption = ref([]);
|
|
|
const value = ref(opOptions.value[0].remark);
|
|
|
const title = ref("调阻精度");
|
|
|
|
|
|
const showLable = ref("调阻");
|
|
|
const changeSelect = () => {
|
|
|
- setTimeout(() => {
|
|
|
+ setTimeout(async () => {
|
|
|
+ getTaskOption();
|
|
|
showLable.value = selectRef.value.currentPlaceholder;
|
|
|
opOptions.value.forEach((item) => {
|
|
|
if (item.dictLabel == showLable.value) {
|
|
@@ -942,8 +1005,8 @@ const changeSelect = () => {
|
|
|
title.value = "调阻精度";
|
|
|
break;
|
|
|
}
|
|
|
- getTableData();
|
|
|
- chartsOption1.value.title[3].text = `${title.value}的Xbar-R控制图`;
|
|
|
+ await getTableData();
|
|
|
+ chartsOption1.value.title[0].text = `${title.value}的Xbar-R控制图`;
|
|
|
// tableData.value.forEach((item) => {
|
|
|
// item.accuracy1 = 0;
|
|
|
// item.accuracy2 = 0;
|
|
@@ -1057,15 +1120,15 @@ const chartsOption1 = ref({
|
|
|
symbol: "circle",
|
|
|
itemStyle: {
|
|
|
color: (params) => {
|
|
|
- const dataIndex = params.dataIndex;
|
|
|
- if (dataIndex == 0) {
|
|
|
+ const avg = JSON.parse(value.value);
|
|
|
+ const paramValue = Number(params.value);
|
|
|
+ if (
|
|
|
+ paramValue <= Number(avg.avgMax) &&
|
|
|
+ paramValue >= Number(avg.avgMin)
|
|
|
+ ) {
|
|
|
return "rgb(26, 122, 240)";
|
|
|
} else {
|
|
|
- return tableData.value[dataIndex - 1]
|
|
|
- ? tableData.value[dataIndex - 1].abnormal != "否"
|
|
|
- ? "red"
|
|
|
- : "rgb(26, 122, 240)"
|
|
|
- : "rgb(26, 122, 240)";
|
|
|
+ return "red";
|
|
|
}
|
|
|
},
|
|
|
},
|
|
@@ -1077,7 +1140,7 @@ const chartsOption1 = ref({
|
|
|
yAxis: 0,
|
|
|
label: {
|
|
|
position: "end",
|
|
|
- formatter: `上限=${showData.value.avgMax ? showData.value.avgMax : "-"}`,
|
|
|
+ formatter: `上限=${JSON.parse(value.value).avgMax ? JSON.parse(value.value).avgMax : "-"}`,
|
|
|
color: "#333",
|
|
|
},
|
|
|
lineStyle: { type: "solid", color: "#333", width: 2 },
|
|
@@ -1087,7 +1150,7 @@ const chartsOption1 = ref({
|
|
|
yAxis: 0,
|
|
|
label: {
|
|
|
position: "end",
|
|
|
- formatter: `下限=${showData.value.avgMin ? showData.value.avgMin : "-"}`,
|
|
|
+ formatter: `下限=${JSON.parse(value.value).avgMin ? JSON.parse(value.value).avgMin : "-"}`,
|
|
|
color: "#333",
|
|
|
},
|
|
|
lineStyle: {
|
|
@@ -1182,15 +1245,15 @@ const chartsOption2 = ref({
|
|
|
symbol: "circle",
|
|
|
itemStyle: {
|
|
|
color: (params) => {
|
|
|
- const dataIndex = params.dataIndex;
|
|
|
- if (dataIndex == 0) {
|
|
|
+ const range = JSON.parse(value.value);
|
|
|
+ const paramValue = Number(params.value);
|
|
|
+ if (
|
|
|
+ paramValue <= Number(range.rangeMax) &&
|
|
|
+ paramValue >= Number(range.rangeMin)
|
|
|
+ ) {
|
|
|
return "rgb(26, 122, 240)";
|
|
|
} else {
|
|
|
- return tableData.value[dataIndex - 1]
|
|
|
- ? tableData.value[dataIndex - 1].abnormal != "否"
|
|
|
- ? "red"
|
|
|
- : "rgb(26, 122, 240)"
|
|
|
- : "rgb(26, 122, 240)";
|
|
|
+ return "red";
|
|
|
}
|
|
|
},
|
|
|
},
|
|
@@ -1202,7 +1265,7 @@ const chartsOption2 = ref({
|
|
|
yAxis: 0,
|
|
|
label: {
|
|
|
position: "end",
|
|
|
- formatter: `上限=${showData.value.rangeMax ? showData.value.rangeMax : "-"}`,
|
|
|
+ formatter: `上限=${JSON.parse(value.value).rangeMax ? JSON.parse(value.value).rangeMax : "-"}`,
|
|
|
color: "#333",
|
|
|
},
|
|
|
lineStyle: { type: "solid", color: "#333", width: 2 },
|
|
@@ -1212,7 +1275,7 @@ const chartsOption2 = ref({
|
|
|
yAxis: 0,
|
|
|
label: {
|
|
|
position: "end",
|
|
|
- formatter: `下限=${showData.value.rangeMin ? showData.value.rangeMin : "-"}`,
|
|
|
+ formatter: `下限=${JSON.parse(value.value).rangeMin ? JSON.parse(value.value).rangeMin : "-"}`,
|
|
|
color: "#333",
|
|
|
},
|
|
|
lineStyle: { type: "solid", color: "#333", width: 2 },
|
|
@@ -1312,6 +1375,7 @@ const reset = () => {
|
|
|
addStatus.value = false;
|
|
|
editStatus.value = false;
|
|
|
addData.value = { ...resItem };
|
|
|
+ searchRef.value.searchForm = {};
|
|
|
currentOption.value = {
|
|
|
total: 0,
|
|
|
page: 0,
|
|
@@ -1319,6 +1383,7 @@ const reset = () => {
|
|
|
pageSizes: [12],
|
|
|
operation: value.value,
|
|
|
};
|
|
|
+ getTableData();
|
|
|
};
|
|
|
const setView = () => {
|
|
|
setHeight();
|
|
@@ -1328,6 +1393,7 @@ const setView = () => {
|
|
|
charts2.value.setOption(chartsOption2.value, true);
|
|
|
};
|
|
|
onMounted(() => {
|
|
|
+ getTaskOption();
|
|
|
setHeight();
|
|
|
year.value = new Date().getFullYear() + "";
|
|
|
opOptions.value.forEach((item) => {
|
|
@@ -1350,6 +1416,11 @@ onBeforeUnmount(() => {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+@media print {
|
|
|
+ #print {
|
|
|
+ margin-left: -18%;
|
|
|
+ }
|
|
|
+}
|
|
|
.formStyle {
|
|
|
width: 400px;
|
|
|
margin: 20px auto;
|
|
@@ -1386,23 +1457,31 @@ onBeforeUnmount(() => {
|
|
|
margin: 10px 0;
|
|
|
padding-right: 40px;
|
|
|
}
|
|
|
- .title {
|
|
|
- height: 30px;
|
|
|
+ .header {
|
|
|
+ margin-top: 20px;
|
|
|
+ //margin-left: 100px;
|
|
|
display: flex;
|
|
|
- align-items: center;
|
|
|
- margin-bottom: 10px;
|
|
|
- justify-content: space-between;
|
|
|
- .btns {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- .btn {
|
|
|
- height: 24px;
|
|
|
- font-size: 14px;
|
|
|
- margin: 0 5px;
|
|
|
- }
|
|
|
- }
|
|
|
+ width: 100%;
|
|
|
+ height: auto;
|
|
|
}
|
|
|
+ //.title {
|
|
|
+ // height: 50px;
|
|
|
+ // display: flex;
|
|
|
+ // align-items: center;
|
|
|
+ // margin-bottom: 10px;
|
|
|
+ // justify-content: space-between;
|
|
|
+ // .btns {
|
|
|
+ // display: flex;
|
|
|
+ // align-items: center;
|
|
|
+ // .btn {
|
|
|
+ // height: 24px;
|
|
|
+ // font-size: 14px;
|
|
|
+ // margin: 0 5px;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //}
|
|
|
.info {
|
|
|
+ margin-top: 20px;
|
|
|
flex: 1;
|
|
|
height: 300px;
|
|
|
}
|