|
@@ -37,6 +37,14 @@
|
|
|
<div class="bg"></div>
|
|
|
样本数据录入
|
|
|
</div>
|
|
|
+ <div class="header" v-show="!addStatus && !editStatus">
|
|
|
+ <Search
|
|
|
+ :searchOptions="searchForm"
|
|
|
+ ref="searchRef"
|
|
|
+ @data-list="getTableData"
|
|
|
+ @reset-list="resetData"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
<div class="btns">
|
|
|
<!-- <el-button
|
|
|
v-if="!editStatus && !addStatus"
|
|
@@ -49,8 +57,17 @@
|
|
|
v-if="!addStatus && !editStatus"
|
|
|
type="primary"
|
|
|
class="btn"
|
|
|
+ @click="updataItem(row.Index)"
|
|
|
+ size="small"
|
|
|
+ >计算Cpk</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="!addStatus && !editStatus"
|
|
|
+ type="primary"
|
|
|
+ class="btn"
|
|
|
v-print="'#print'"
|
|
|
@click="printFnc"
|
|
|
+ size="small"
|
|
|
>打印</el-button
|
|
|
>
|
|
|
<el-button
|
|
@@ -58,6 +75,7 @@
|
|
|
type="primary"
|
|
|
class="btn"
|
|
|
@click="changeaddstatus"
|
|
|
+ size="small"
|
|
|
>新增</el-button
|
|
|
>
|
|
|
<el-button
|
|
@@ -75,7 +93,8 @@
|
|
|
@click="canceleOp"
|
|
|
id="cancel"
|
|
|
>取消</el-button
|
|
|
- ><span v-if="!addStatus && !editStatus" style="margin: 10px"
|
|
|
+ >
|
|
|
+ <!-- <span v-if="!addStatus && !editStatus" style="margin: 10px"
|
|
|
>年份:</span
|
|
|
>
|
|
|
<el-date-picker
|
|
@@ -88,7 +107,7 @@
|
|
|
placeholder="Pick a year"
|
|
|
:clear-icon="''"
|
|
|
@change="getTableData"
|
|
|
- />
|
|
|
+ />-->
|
|
|
</div>
|
|
|
<!-- 导入代码 -->
|
|
|
<!-- <div class="btns">
|
|
@@ -128,16 +147,14 @@
|
|
|
<div class="tableTitle">
|
|
|
<div></div>
|
|
|
<div>{{ title }}一致性检测表</div>
|
|
|
- <div>{{ year }}年</div>
|
|
|
+ <div></div>
|
|
|
</div>
|
|
|
<el-table
|
|
|
v-if="!printStatus"
|
|
|
:data="showTableData"
|
|
|
- :span-method="objectSpanMethod"
|
|
|
- id="table"
|
|
|
border
|
|
|
:style="{
|
|
|
- height: Height - 230 + 'px',
|
|
|
+ height: Height - 50 + 'px',
|
|
|
width: maxWidth + 'px',
|
|
|
}"
|
|
|
:show-overflow-tooltip="true"
|
|
@@ -173,108 +190,42 @@
|
|
|
><span>{{ row.batchNo }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" :label="title">
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- prop="accuracy1"
|
|
|
- width="60"
|
|
|
- label="数值1"
|
|
|
- >
|
|
|
- <template #default="{ row }"
|
|
|
- ><span>{{ row.accuracy1 }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- prop="accuracy2"
|
|
|
- width="60"
|
|
|
- label="数值2"
|
|
|
- >
|
|
|
- <template #default="{ row }"
|
|
|
- ><span>{{ row.accuracy2 }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- prop="accuracy3"
|
|
|
- width="60"
|
|
|
- label="数值3"
|
|
|
- >
|
|
|
- <template #default="{ row }"
|
|
|
- ><span>{{ row.accuracy3 }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- prop="accuracy4"
|
|
|
- width="60"
|
|
|
- label="数值4"
|
|
|
- >
|
|
|
- <template #default="{ row }"
|
|
|
- ><span>{{ row.accuracy4 }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- prop="accuracy5"
|
|
|
- width="60"
|
|
|
- label="数值5"
|
|
|
- >
|
|
|
- <template #default="{ row }"
|
|
|
- ><span>{{ row.accuracy5 }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- prop="accuracy6"
|
|
|
- width="60"
|
|
|
- label="数值6"
|
|
|
- >
|
|
|
- <template #default="{ row }"
|
|
|
- ><span>{{ row.accuracy6 }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- prop="accuracy7"
|
|
|
- width="60"
|
|
|
- label="数值7"
|
|
|
- >
|
|
|
- <template #default="{ row }"
|
|
|
- ><span>{{ row.accuracy7 }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- prop="accuracy8"
|
|
|
- width="60"
|
|
|
- label="数值8"
|
|
|
- >
|
|
|
- <template #default="{ row }"
|
|
|
- ><span>{{ row.accuracy8 }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- prop="accuracy9"
|
|
|
- width="60"
|
|
|
- label="数值9"
|
|
|
- >
|
|
|
- <template #default="{ row }"
|
|
|
- ><span>{{ row.accuracy9 }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- prop="accuracy10"
|
|
|
- width="60"
|
|
|
- label="数值10"
|
|
|
- >
|
|
|
- <template #default="{ row }"
|
|
|
- ><span>{{ row.accuracy10 }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column> </el-table-column
|
|
|
- ><el-table-column
|
|
|
+ <el-table-column
|
|
|
+ width="100"
|
|
|
+ align="center"
|
|
|
+ prop="accuracys"
|
|
|
+ label="数据"
|
|
|
+ :show-overflow-tooltip="false"
|
|
|
+ >
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-tooltip placement="top">
|
|
|
+ <template #content>
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in row.accuracys"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <span>数值{{ index + 1 }}: {{ item }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <div class="ellipsis-text">
|
|
|
+ {{ row.accuracys.join(", ") }}
|
|
|
+ </div>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+<!-- <el-table-column
|
|
|
+ width="100"
|
|
|
+ align="center"
|
|
|
+ prop="accuracys"
|
|
|
+ label="数据"
|
|
|
+ >
|
|
|
+ <template #default="{ row }">
|
|
|
+ <div v-for="(item, index) in row.accuracys" :key="index">
|
|
|
+ <span>数值{{ index + 1 }}: {{ item }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>-->
|
|
|
+ <!-- <el-table-column
|
|
|
align="center"
|
|
|
prop="Cpk"
|
|
|
label="Cpk值"
|
|
@@ -283,7 +234,7 @@
|
|
|
<template #default="{ row }"
|
|
|
><span>{{ Number(row.cpk).toFixed(2) }}</span>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column>-->
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
width="70"
|
|
@@ -333,7 +284,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
- width="160"
|
|
|
+ width="260"
|
|
|
prop=""
|
|
|
label="操作"
|
|
|
id="opear"
|
|
@@ -603,7 +554,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy1"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -620,7 +571,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy1"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -637,7 +588,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy1"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -655,7 +606,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy1"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -672,7 +623,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy2"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -688,7 +639,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy3"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -704,7 +655,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy4"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -720,7 +671,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy5"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -731,7 +682,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy1"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -742,7 +693,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy1"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -753,7 +704,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy1"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -768,7 +719,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy1"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -780,7 +731,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy1"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -792,7 +743,7 @@
|
|
|
<template #default="{ row }"
|
|
|
>
|
|
|
<el-input-number
|
|
|
-
|
|
|
+
|
|
|
v-model="row.accuracy1"
|
|
|
:precision="2"
|
|
|
:step="0.01"
|
|
@@ -828,21 +779,41 @@
|
|
|
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-select v-model="addData.model">
|
|
|
+ <el-input :disabled="true" v-model="addData.model" />
|
|
|
+ </el-form-item>
|
|
|
+ <!-- <el-form-item label="产品型号" prop="model">
|
|
|
+ <!– <el-select v-model="addData.model">
|
|
|
<el-option
|
|
|
v-for="item in modelOptions"
|
|
|
:key="item.dictLabel"
|
|
|
:label="item.dictLabel"
|
|
|
:value="item.dictValue"
|
|
|
/>
|
|
|
- </el-select> -->
|
|
|
+ </el-select> –>
|
|
|
<el-input v-model="addData.model" />
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item>-->
|
|
|
<el-form-item label="生产批号" prop="batchNo">
|
|
|
<el-input v-model="addData.batchNo" />
|
|
|
</el-form-item>
|
|
|
- <template v-for="(item, index) in 30" :key="index">
|
|
|
+ <!-- <template v-for="(item, index) in 30" :key="index">
|
|
|
<el-form-item
|
|
|
:label="'数值' + addIndex(index)"
|
|
|
:prop="'accuracy' + addIndex(index)"
|
|
@@ -860,7 +831,25 @@
|
|
|
v-model="addData[`accuracy${addIndex(index)}`]"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- </template>
|
|
|
+ </template>-->
|
|
|
+ <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.accuracys[index]"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
<!-- <el-form-item label="平均值" prop="avg">
|
|
|
<el-input v-model="addData.avg" />
|
|
|
</el-form-item>
|
|
@@ -926,10 +915,40 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { useDictionaryStore } from "@/store";
|
|
|
-import { getData2, addDatas, deleteData, updateData } from "@/api/analysis";
|
|
|
+import {
|
|
|
+ getData2,
|
|
|
+ addDatas,
|
|
|
+ deleteData,
|
|
|
+ updateData,
|
|
|
+ getTaskCode,
|
|
|
+} from "@/api/analysis";
|
|
|
+import Search from "@/components/Search/index.vue";
|
|
|
const tableData = ref([]);
|
|
|
const printStatus = ref(false);
|
|
|
const printLoading = ref(false);
|
|
|
+const taskOption = ref([]);
|
|
|
+const getTaskOption = async () => {
|
|
|
+ const { data } = await getTaskCode({
|
|
|
+ operationCode: JSON.parse(value.value).value,
|
|
|
+ });
|
|
|
+ taskOption.value = data;
|
|
|
+};
|
|
|
+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 printFnc = () => {
|
|
|
printLoading.value = true;
|
|
@@ -995,23 +1014,24 @@ const setTableData = (array) => {
|
|
|
//★Index 为实际接口数据Index
|
|
|
array.forEach((item, index) => {
|
|
|
let obj1 = { ...item, Index: index };
|
|
|
- let obj2 = { ...item, Index: index };
|
|
|
- let obj3 = { ...item, Index: index };
|
|
|
- for (let i = 1; i < 11; i++) {
|
|
|
- obj2[`accuracy${i}`] = obj2[`accuracy${i + 10}`];
|
|
|
- obj3[`accuracy${i}`] = obj3[`accuracy${i + 20}`];
|
|
|
- }
|
|
|
+ // let obj2 = { ...item, Index: index };
|
|
|
+ // let obj3 = { ...item, Index: index };
|
|
|
+ // for (let i = 1; i < 11; i++) {
|
|
|
+ // obj2[`accuracy${i}`] = obj2[`accuracy${i + 10}`];
|
|
|
+ // obj3[`accuracy${i}`] = obj3[`accuracy${i + 20}`];
|
|
|
+ // }
|
|
|
showTableData.value.push(obj1);
|
|
|
- showTableData.value.push(obj2);
|
|
|
- showTableData.value.push(obj3);
|
|
|
+ // showTableData.value.push(obj2);
|
|
|
+ // showTableData.value.push(obj3);
|
|
|
});
|
|
|
};
|
|
|
//接口获取实际data
|
|
|
const getTableData = async () => {
|
|
|
const { data, code, msg } = await getData2({
|
|
|
+ ...searchRef.value.searchForm,
|
|
|
pageNo: currentOption.page,
|
|
|
pageSize: currentOption.limit,
|
|
|
- yearStr: year.value,
|
|
|
+ // yearStr: year.value,
|
|
|
operation: lableValue.value,
|
|
|
});
|
|
|
if (code == "200") {
|
|
@@ -1026,6 +1046,24 @@ const getTableData = async () => {
|
|
|
}
|
|
|
disabled.value = false;
|
|
|
};
|
|
|
+const searchRef = ref(null);
|
|
|
+const searchForm = [
|
|
|
+ {
|
|
|
+ label: "日期",
|
|
|
+ prop: "createds",
|
|
|
+ type: "daterange",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "产品型号",
|
|
|
+ prop: "model",
|
|
|
+ type: "input",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "生产批号",
|
|
|
+ prop: "batchNo",
|
|
|
+ type: "input",
|
|
|
+ },
|
|
|
+];
|
|
|
//编辑状态
|
|
|
const editStatus = ref(false);
|
|
|
//新增状态
|
|
@@ -1236,6 +1274,7 @@ const showLable = ref("调阻");
|
|
|
const lableValue = ref("");
|
|
|
const changeSelect = () => {
|
|
|
setTimeout(() => {
|
|
|
+ getTaskOption();
|
|
|
showLable.value = selectRef.value.currentPlaceholder;
|
|
|
opOptions.value.forEach((item) => {
|
|
|
if (item.dictLabel == showLable.value) {
|
|
@@ -1565,6 +1604,7 @@ const addSubmit = async () => {
|
|
|
const { data, code } = await addDatas({
|
|
|
...addData.value,
|
|
|
yearStr: year.value,
|
|
|
+ operation: lableValue.value,
|
|
|
});
|
|
|
if (code == "200") {
|
|
|
ElMessage.success("添加成功!");
|
|
@@ -1606,6 +1646,12 @@ const reset = () => {
|
|
|
pageSizes: [4],
|
|
|
};
|
|
|
};
|
|
|
+
|
|
|
+const resetData = () => {
|
|
|
+ searchRef.value.searchForm = {};
|
|
|
+ getTableData();
|
|
|
+};
|
|
|
+
|
|
|
watch(
|
|
|
() => showTableData.value,
|
|
|
(newVal, oldVal) => {
|
|
@@ -1616,6 +1662,7 @@ watch(
|
|
|
}
|
|
|
);
|
|
|
onMounted(() => {
|
|
|
+ getTaskOption();
|
|
|
setHeight();
|
|
|
year.value = new Date().getFullYear() + "";
|
|
|
opOptions.value.forEach((item) => {
|
|
@@ -1679,6 +1726,12 @@ onMounted(() => {
|
|
|
alignitems: center;
|
|
|
}
|
|
|
}
|
|
|
+.ellipsis-text {
|
|
|
+ white-space: nowrap; /* 禁止换行 */
|
|
|
+ overflow: hidden; /* 隐藏超出部分 */
|
|
|
+ text-overflow: ellipsis; /* 显示省略号 */
|
|
|
+ width: 100%; /* 宽度占满单元格 */
|
|
|
+}
|
|
|
.formStyle {
|
|
|
width: 400px;
|
|
|
margin: 20px auto;
|
|
@@ -1716,22 +1769,29 @@ onMounted(() => {
|
|
|
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: 30px;
|
|
|
+ // 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 {
|
|
|
flex: 1;
|
|
|
.tableTitle {
|