|
@@ -138,6 +138,15 @@
|
|
|
id="cancel"
|
|
|
>取消</el-button
|
|
|
>
|
|
|
+ <el-button
|
|
|
+ style="margin-left: 15px"
|
|
|
+ v-if="!addStatus && !editStatus"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ class="btn"
|
|
|
+ @click="downloadData"
|
|
|
+ >导出</el-button
|
|
|
+ >
|
|
|
<!-- <span v-if="!addStatus && !editStatus" style="margin: 10px"
|
|
|
>年份:</span
|
|
|
>
|
|
@@ -767,6 +776,7 @@ import {
|
|
|
getTaskCode,
|
|
|
cpkCompute,
|
|
|
collectData,
|
|
|
+ exportData, saveExceptionData,
|
|
|
} from "@/api/analysis";
|
|
|
import Search from "@/components/Search/index.vue";
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
@@ -893,11 +903,17 @@ const computeCPK = async (id) => {
|
|
|
if ("error" in response.data) {
|
|
|
result.value = response.data.error;
|
|
|
} else {
|
|
|
- const { product, batch, process, cpk, status } = response.data;
|
|
|
+ const { product, batch, process, cpk, status, mean, std, pp, ppk, ppm } =
|
|
|
+ response.data;
|
|
|
result.value = `产品: ${product}<br>
|
|
|
批次: ${batch}<br>
|
|
|
工序: ${process}<br>
|
|
|
+ 平均值: ${mean}<br>
|
|
|
+ 标准差: ${std}<br>
|
|
|
CPK: ${cpk}<br>
|
|
|
+ PP: ${pp}<br>
|
|
|
+ PPK: ${ppk}<br>
|
|
|
+ PPM: ${ppm}<br>
|
|
|
评级: ${status}`;
|
|
|
}
|
|
|
|
|
@@ -1041,6 +1057,39 @@ const getTableData = async () => {
|
|
|
}
|
|
|
disabled.value = false;
|
|
|
};
|
|
|
+
|
|
|
+const downloadData = async () => {
|
|
|
+ exportData({
|
|
|
+ ...searchRef.value.searchForm,
|
|
|
+ pageNo: currentOption.page,
|
|
|
+ pageSize: currentOption.limit,
|
|
|
+ // yearStr: year.value,
|
|
|
+ operation: lableValue.value,
|
|
|
+ }).then((response) => {
|
|
|
+ const fileData = response.data;
|
|
|
+ // const fileName = decodeURI(
|
|
|
+ // response.headers["content-disposition"].split(";")[1].split("=")[1]
|
|
|
+ // );
|
|
|
+ const fileName = "过程能力数据.xlsx";
|
|
|
+ const fileType =
|
|
|
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8";
|
|
|
+
|
|
|
+ const blob = new Blob([fileData], { type: fileType });
|
|
|
+ const downloadUrl = window.URL.createObjectURL(blob);
|
|
|
+
|
|
|
+ const downloadLink = document.createElement("a");
|
|
|
+ downloadLink.href = downloadUrl;
|
|
|
+ downloadLink.download = fileName;
|
|
|
+
|
|
|
+ document.body.appendChild(downloadLink);
|
|
|
+ downloadLink.click();
|
|
|
+
|
|
|
+ document.body.removeChild(downloadLink);
|
|
|
+ window.URL.revokeObjectURL(downloadUrl);
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
const searchRef = ref(null);
|
|
|
const searchForm = [
|
|
|
{
|