From 08be158b36f2e49ab116eefe4db6e69e82e1c2e2 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期五, 27 三月 2026 11:28:08 +0800
Subject: [PATCH] 过程检接口对接
---
src/views/reportAnalysis/productionStatistics/index.vue | 263 ++++++++++---
src/api/qualityManagement/rawMaterialInspection.js | 8
src/views/qualityManagement/processInspection/index.vue | 794 ++++++++++++++++++++++++-------------------
3 files changed, 637 insertions(+), 428 deletions(-)
diff --git a/src/api/qualityManagement/rawMaterialInspection.js b/src/api/qualityManagement/rawMaterialInspection.js
index dcb3869..3b76a8f 100644
--- a/src/api/qualityManagement/rawMaterialInspection.js
+++ b/src/api/qualityManagement/rawMaterialInspection.js
@@ -55,3 +55,11 @@
})
}
+// 鏌ヨ杩囩▼妫�鍒楄〃
+export function qualityInspectProcessPage(query) {
+ return request({
+ url: '/quality/qualityInspect/processPage',
+ method: 'get',
+ params: query,
+ })
+}
diff --git a/src/views/qualityManagement/processInspection/index.vue b/src/views/qualityManagement/processInspection/index.vue
index cbeab71..96b90ad 100644
--- a/src/views/qualityManagement/processInspection/index.vue
+++ b/src/views/qualityManagement/processInspection/index.vue
@@ -3,352 +3,426 @@
<div class="search_form">
<div>
<span class="search_title">宸ュ簭锛�</span>
- <el-input
- v-model="searchForm.process"
- style="width: 240px"
- placeholder="璇疯緭鍏ュ伐搴忔悳绱�"
- @change="handleQuery"
- clearable
- :prefix-icon="Search"
- />
- <span style="margin-left: 10px" class="search_title">妫�娴嬫棩鏈燂細</span>
- <el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange"
- placeholder="璇烽�夋嫨" clearable @change="changeDaterange" />
- <el-button type="primary" @click="handleQuery" style="margin-left: 10px"
- >鎼滅储</el-button
- >
+ <el-input v-model="searchForm.process"
+ style="width: 240px"
+ placeholder="璇疯緭鍏ュ伐搴忔悳绱�"
+ @change="handleQuery"
+ clearable
+ :prefix-icon="Search" />
+ <span style="margin-left: 10px"
+ class="search_title">鏃ユ湡锛�</span>
+ <el-date-picker v-model="searchForm.entryDate"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ type="daterange"
+ placeholder="璇烽�夋嫨"
+ clearable
+ @change="changeDaterange" />
+ <el-button type="primary"
+ @click="handleQuery"
+ style="margin-left: 10px">鎼滅储</el-button>
+ <el-button type="info"
+ @click="resetForm"
+ style="margin-left: 10px">閲嶇疆</el-button>
</div>
<div>
- <el-button type="primary" @click="openForm('add')">鏂板</el-button>
+ <!-- <el-button type="primary"
+ @click="openForm('add')">鏂板</el-button>
<el-button @click="handleOut">瀵煎嚭</el-button>
- <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
+ <el-button type="danger"
+ plain
+ @click="handleDelete">鍒犻櫎</el-button> -->
</div>
</div>
<div class="table_list">
- <PIMTable
- rowKey="id"
- :column="tableColumn"
- :tableData="tableData"
- :page="page"
- :isSelection="true"
- @selection-change="handleSelectionChange"
- :tableLoading="tableLoading"
- @pagination="pagination"
- :total="page.total"
- ></PIMTable>
+ <PIMTable rowKey="id"
+ :column="tableColumn"
+ :tableData="tableData"
+ :page="page"
+ @selection-change="handleSelectionChange"
+ :tableLoading="tableLoading"
+ @pagination="pagination"
+ :total="page.total">
+ <template #qualifiedQuantity="{ row }">
+ <span style="font-weight: bold;color: #409eff;">{{ row.qualifiedQuantity }}</span><span style="margin-left: 5px;color: #909399;">鏂�</span>
+ </template>
+ <template #unqualifiedQuantity="{ row }">
+ <span style="font-weight: bold;color: #b43434;">{{ row.unqualifiedQuantity }}</span><span style="margin-left: 5px;color: #909399;">鏂�</span>
+ </template>
+ <template #quantity="{ row }">
+ <span style="font-weight: bold;color: #28e431;">{{ row.quantity }}</span><span style="margin-left: 5px;color: #909399;">鏂�</span>
+ </template>
+ </PIMTable>
</div>
- <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia>
- <FormDia ref="formDia" @close="handleQuery"></FormDia>
- <files-dia ref="filesDia" @close="handleQuery"></files-dia>
- <el-dialog v-model="dialogFormVisible" title="缂栬緫妫�楠屽憳" width="30%"
- @close="closeDia">
- <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
- <el-form-item label="妫�楠屽憳锛�" prop="checkName">
- <el-select v-model="form.checkName" placeholder="璇烽�夋嫨" clearable>
- <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName"
- :value="item.nickName"/>
- </el-select>
- </el-form-item>
- </el-form>
- <template #footer>
- <div class="dialog-footer">
- <el-button type="primary" @click="submitForm">纭</el-button>
- <el-button @click="closeDia">鍙栨秷</el-button>
- </div>
- </template>
- </el-dialog>
+ <InspectionFormDia ref="inspectionFormDia"
+ @close="handleQuery"></InspectionFormDia>
+ <FormDia ref="formDia"
+ @close="handleQuery"></FormDia>
+ <files-dia ref="filesDia"
+ @close="handleQuery"></files-dia>
+ <el-dialog v-model="dialogFormVisible"
+ title="缂栬緫妫�楠屽憳"
+ width="30%"
+ @close="closeDia">
+ <el-form :model="form"
+ label-width="140px"
+ label-position="top"
+ :rules="rules"
+ ref="formRef">
+ <el-form-item label="妫�楠屽憳锛�"
+ prop="checkName">
+ <el-select v-model="form.checkName"
+ placeholder="璇烽�夋嫨"
+ clearable>
+ <el-option v-for="item in userList"
+ :key="item.nickName"
+ :label="item.nickName"
+ :value="item.nickName" />
+ </el-select>
+ </el-form-item>
+ </el-form>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button type="primary"
+ @click="submitForm">纭</el-button>
+ <el-button @click="closeDia">鍙栨秷</el-button>
+ </div>
+ </template>
+ </el-dialog>
</div>
</template>
<script setup>
-import { Search } from "@element-plus/icons-vue";
-import {onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue";
-import InspectionFormDia from "@/views/qualityManagement/processInspection/components/inspectionFormDia.vue";
-import FormDia from "@/views/qualityManagement/processInspection/components/formDia.vue";
-import {ElMessageBox} from "element-plus";
-import {
- downloadQualityInspect,
- qualityInspectDel,
- qualityInspectListPage, qualityInspectUpdate,
- submitQualityInspect
-} from "@/api/qualityManagement/rawMaterialInspection.js";
-import FilesDia from "@/views/qualityManagement/processInspection/components/filesDia.vue";
-import dayjs from "dayjs";
-import {userListNoPage} from "@/api/system/user.js";
-import useUserStore from "@/store/modules/user";
+ import { Search } from "@element-plus/icons-vue";
+ import {
+ onMounted,
+ ref,
+ reactive,
+ toRefs,
+ getCurrentInstance,
+ nextTick,
+ } from "vue";
+ import InspectionFormDia from "@/views/qualityManagement/processInspection/components/inspectionFormDia.vue";
+ import FormDia from "@/views/qualityManagement/processInspection/components/formDia.vue";
+ import { ElMessageBox } from "element-plus";
+ import {
+ downloadQualityInspect,
+ qualityInspectDel,
+ qualityInspectListPage,
+ qualityInspectUpdate,
+ submitQualityInspect,
+ qualityInspectProcessPage,
+ } from "@/api/qualityManagement/rawMaterialInspection.js";
+ import FilesDia from "@/views/qualityManagement/processInspection/components/filesDia.vue";
+ import dayjs from "dayjs";
+ import { userListNoPage } from "@/api/system/user.js";
+ import useUserStore from "@/store/modules/user";
-const data = reactive({
- searchForm: {
- process: "",
- entryDate: undefined, // 褰曞叆鏃ユ湡
- entryDateStart: undefined,
- entryDateEnd: undefined,
- },
- rules: {
- checkName: [{required: true, message: "璇烽�夋嫨", trigger: "change"}],
- },
-});
-const { searchForm } = toRefs(data);
-const tableColumn = ref([
- {
- label: "妫�娴嬫棩鏈�",
- prop: "checkTime",
- width: 120
- },
- {
- label: "鐢熶骇宸ュ崟鍙�",
- prop: "workOrderNo",
- width: 120
- },
- {
- label: "宸ュ簭",
- prop: "process",
- width: 230
- },
- {
- label: "妫�楠屽憳",
- prop: "checkName",
- },
- {
- label: "浜у搧鍚嶇О",
- prop: "productName",
- },
- {
- label: "瑙勬牸鍨嬪彿",
- prop: "model",
- },
- {
- label: "鍗曚綅",
- prop: "unit",
- },
- {
- label: "鏁伴噺",
- prop: "quantity",
- width: 100
- },
- {
- label: "妫�娴嬪崟浣�",
- prop: "checkCompany",
- width: 120
- },
- {
- label: "妫�娴嬬粨鏋�",
- prop: "checkResult",
- dataType: "tag",
- formatType: (params) => {
- if (params == '涓嶅悎鏍�') {
- return "danger";
- } else if (params == '鍚堟牸') {
- return "success";
- } else {
- return null;
- }
+ const data = reactive({
+ searchForm: {
+ process: "",
+ entryDate: undefined, // 褰曞叆鏃ユ湡
+ startTime: undefined,
+ endTime: undefined,
},
- },
- {
- label: "鎻愪氦鐘舵��",
- prop: "inspectState",
- formatData: (params) => {
- if (params) {
- return "宸叉彁浜�";
- } else {
- return "鏈彁浜�";
- }
- },
- },
- {
- dataType: "action",
- label: "鎿嶄綔",
- align: "center",
- fixed: "right",
- width: 280,
- operation: [
- {
- name: "缂栬緫",
- type: "text",
- clickFun: (row) => {
- openForm("edit", row);
- },
- disabled: (row) => {
- // 宸叉彁浜ゅ垯绂佺敤
- if (row.inspectState == 1) return true;
- // 濡傛灉妫�楠屽憳鏈夊�硷紝鍙湁褰撳墠鐧诲綍鐢ㄦ埛鑳界紪杈�
- if (row.checkName) {
- return row.checkName !== userStore.nickName;
- }
- return false;
- }
+ rules: {
+ checkName: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ },
+ });
+ const { searchForm } = toRefs(data);
+ const tableColumn = ref([
+ {
+ label: "鏃ユ湡",
+ prop: "createTime",
+ width: "130",
+ formatData: val => {
+ return dayjs(val).format("YYYY-MM-DD");
},
- {
- name: "闄勪欢",
- type: "text",
- clickFun: (row) => {
- openFilesFormDia(row);
- },
+ },
+ {
+ label: "鐢熶骇璁㈠崟鍙�",
+ prop: "npsNo",
+ width: "130",
+ },
+ {
+ label: "宸ュ簭",
+ prop: "process",
+ dataType: "tag",
+ },
+ {
+ label: "浜у搧缂栫爜",
+ prop: "materialCode",
+ width: "130",
+ },
+ {
+ label: "浜у搧绫诲瀷",
+ prop: "strength",
+ dataType: "tag",
+ formatType: params => {
+ if (params == "A3.5") {
+ return "success";
+ } else if (params == "A4.5") {
+ return "warning";
+ } else {
+ return null;
+ }
},
- {
- name: "鎻愪氦",
- type: "text",
- clickFun: (row) => {
- submit(row.id);
- },
- disabled: (row) => {
- // 宸叉彁浜ゅ垯绂佺敤
- if (row.inspectState == 1) return true;
- // 濡傛灉妫�楠屽憳鏈夊�硷紝鍙湁褰撳墠鐧诲綍鐢ㄦ埛鑳芥彁浜�
- if (row.checkName) {
- return row.checkName !== userStore.nickName;
- }
- return false;
- }
- },
- {
- name: "鍒嗛厤妫�楠屽憳",
- type: "text",
- clickFun: (row) => {
- if (!row.checkName) {
- open(row)
- } else {
- proxy.$modal.msgError("妫�楠屽憳宸插瓨鍦�");
- }
- },
- disabled: (row) => {
- return row.inspectState == 1 || row.checkName;
- }
- },
- {
- name: "涓嬭浇",
- type: "text",
- clickFun: (row) => {
- downLoadFile(row);
- },
- },
- ],
- },
-]);
-const userList = ref([]);
-const currentRow = ref(null)
-const tableData = ref([]);
-const selectedRows = ref([]);
-const tableLoading = ref(false);
-const dialogFormVisible = ref(false);
-const form = ref({
- checkName: ""
-});
-const page = reactive({
- current: 1,
- size: 100,
- total: 0
-});
-const formDia = ref()
-const filesDia = ref()
-const inspectionFormDia = ref()
-const { proxy } = getCurrentInstance()
-const userStore = useUserStore()
-const changeDaterange = (value) => {
- searchForm.value.entryDateStart = undefined;
- searchForm.value.entryDateEnd = undefined;
- if (value) {
- searchForm.value.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
- searchForm.value.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD");
- }
- getList();
-};
-// 鏌ヨ鍒楄〃
-/** 鎼滅储鎸夐挳鎿嶄綔 */
-const handleQuery = () => {
- page.current = 1;
- getList();
-};
-const pagination = (obj) => {
- page.current = obj.page;
- page.size = obj.limit;
- getList();
-};
-const getList = () => {
- tableLoading.value = true;
- const params = { ...searchForm.value, ...page };
- params.entryDate = undefined
- qualityInspectListPage({...params, inspectType: 1}).then(res => {
- tableLoading.value = false;
- tableData.value = res.data.records
- page.total = res.data.total;
- }).catch(err => {
- tableLoading.value = false;
- })
-};
-// 琛ㄦ牸閫夋嫨鏁版嵁
-const handleSelectionChange = (selection) => {
- selectedRows.value = selection;
-};
+ },
+ {
+ label: "浜у搧鍚嶇О",
+ prop: "productName",
+ },
+ {
+ label: "瑙勬牸",
+ prop: "model",
+ width: "130",
+ },
+ {
+ label: "鐝",
+ prop: "schedule",
+ dataType: "tag",
+ formatType: params => {
+ if (params == "鐧界彮") {
+ return "primary";
+ } else if (params == "澶滅彮") {
+ return "warning";
+ } else {
+ return null;
+ }
+ },
+ },
+ {
+ label: "宀椾綅浜哄憳",
+ prop: "postName",
+ },
+ {
+ label: "鎶ュ伐鍗曞彿",
+ prop: "productionProductRouteItemId",
+ },
+ {
+ label: "浜у嚭鏁伴噺",
+ prop: "quantity",
+ dataType: "slot",
+ slot: "quantity",
+ },
+ {
+ label: "鍚堟牸鏁伴噺",
+ prop: "qualifiedQuantity",
+ dataType: "slot",
+ slot: "qualifiedQuantity",
+ },
+ {
+ label: "涓嶅悎鏍兼暟閲�",
+ prop: "unqualifiedQuantity",
+ dataType: "slot",
+ slot: "unqualifiedQuantity",
+ },
-// 鎵撳紑寮规
-const openForm = (type, row) => {
- nextTick(() => {
- formDia.value?.openDialog(type, row)
- })
-};
-// 鎵撳紑鏂板妫�楠屽脊妗�
-const openInspectionForm = (type, row) => {
- nextTick(() => {
- inspectionFormDia.value?.openDialog(type, row)
- })
-};
-// 鎵撳紑闄勪欢寮规
-const openFilesFormDia = (type, row) => {
- nextTick(() => {
- filesDia.value?.openDialog(type, row)
- })
-};
-// 鎻愪环
-const submit = async (id) => {
- const res = await submitQualityInspect({id: id})
- if (res.code === 200) {
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
- getList();
- }
-}
-const open = async (row) => {
- let userLists = await userListNoPage();
- userList.value = userLists.data;
- currentRow.value = row
- dialogFormVisible.value = true
-}
-// 鍏抽棴寮规
-const closeDia = () => {
- proxy.resetForm("formRef");
- dialogFormVisible.value = false;
-};
-const submitForm = () => {
- if (currentRow.value) {
- const data = {
- ...form.value,
- id: currentRow.value.id
- }
- qualityInspectUpdate(data).then(res => {
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
- closeDia();
- getList();
- })
- }
-};
+ // {
+ // dataType: "action",
+ // label: "鎿嶄綔",
+ // align: "center",
+ // fixed: "right",
+ // width: 280,
+ // operation: [
+ // {
+ // name: "缂栬緫",
+ // type: "text",
+ // clickFun: row => {
+ // openForm("edit", row);
+ // },
+ // disabled: row => {
+ // // 宸叉彁浜ゅ垯绂佺敤
+ // if (row.inspectState == 1) return true;
+ // // 濡傛灉妫�楠屽憳鏈夊�硷紝鍙湁褰撳墠鐧诲綍鐢ㄦ埛鑳界紪杈�
+ // if (row.checkName) {
+ // return row.checkName !== userStore.nickName;
+ // }
+ // return false;
+ // },
+ // },
+ // {
+ // name: "闄勪欢",
+ // type: "text",
+ // clickFun: row => {
+ // openFilesFormDia(row);
+ // },
+ // },
+ // {
+ // name: "鎻愪氦",
+ // type: "text",
+ // clickFun: row => {
+ // submit(row.id);
+ // },
+ // disabled: row => {
+ // // 宸叉彁浜ゅ垯绂佺敤
+ // if (row.inspectState == 1) return true;
+ // // 濡傛灉妫�楠屽憳鏈夊�硷紝鍙湁褰撳墠鐧诲綍鐢ㄦ埛鑳芥彁浜�
+ // if (row.checkName) {
+ // return row.checkName !== userStore.nickName;
+ // }
+ // return false;
+ // },
+ // },
+ // {
+ // name: "鍒嗛厤妫�楠屽憳",
+ // type: "text",
+ // clickFun: row => {
+ // if (!row.checkName) {
+ // open(row);
+ // } else {
+ // proxy.$modal.msgError("妫�楠屽憳宸插瓨鍦�");
+ // }
+ // },
+ // disabled: row => {
+ // return row.inspectState == 1 || row.checkName;
+ // },
+ // },
+ // {
+ // name: "涓嬭浇",
+ // type: "text",
+ // clickFun: row => {
+ // downLoadFile(row);
+ // },
+ // },
+ // ],
+ // },
+ ]);
+ const userList = ref([]);
+ const currentRow = ref(null);
+ const tableData = ref([]);
+ const selectedRows = ref([]);
+ const tableLoading = ref(false);
+ const dialogFormVisible = ref(false);
+ const form = ref({
+ checkName: "",
+ });
+ const page = reactive({
+ current: 1,
+ size: 100,
+ total: 0,
+ });
+ const formDia = ref();
+ const filesDia = ref();
+ const inspectionFormDia = ref();
+ const { proxy } = getCurrentInstance();
+ const userStore = useUserStore();
+ const changeDaterange = value => {
+ searchForm.value.startTime = undefined;
+ searchForm.value.endTime = undefined;
+ if (value) {
+ searchForm.value.startTime = dayjs(value[0]).format("YYYY-MM-DD");
+ searchForm.value.endTime = dayjs(value[1]).format("YYYY-MM-DD");
+ }
+ getList();
+ };
+ // 鏌ヨ鍒楄〃
+ /** 鎼滅储鎸夐挳鎿嶄綔 */
+ const handleQuery = () => {
+ page.current = 1;
+ getList();
+ };
+ /** 閲嶇疆鎸夐挳鎿嶄綔 */
+ const resetForm = () => {
+ searchForm.value = {
+ checkName: "",
+ entryDate: undefined,
+ startTime: undefined,
+ endTime: undefined,
+ };
+ getList();
+ };
+ const pagination = obj => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+ };
+ const getList = () => {
+ tableLoading.value = true;
+ const params = { ...searchForm.value, ...page };
+ params.entryDate = undefined;
+ qualityInspectProcessPage({ ...params, inspectType: 1 })
+ .then(res => {
+ tableLoading.value = false;
+ tableData.value = res.data.records;
+ page.total = res.data.total;
+ })
+ .catch(err => {
+ tableLoading.value = false;
+ });
+ };
+ // 琛ㄦ牸閫夋嫨鏁版嵁
+ const handleSelectionChange = selection => {
+ selectedRows.value = selection;
+ };
-// 鍒犻櫎
-const handleDelete = () => {
- let ids = [];
- if (selectedRows.value.length > 0) {
- ids = selectedRows.value.map((item) => item.id);
- } else {
- proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
- return;
- }
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
+ // 鎵撳紑寮规
+ const openForm = (type, row) => {
+ nextTick(() => {
+ formDia.value?.openDialog(type, row);
+ });
+ };
+ // 鎵撳紑鏂板妫�楠屽脊妗�
+ const openInspectionForm = (type, row) => {
+ nextTick(() => {
+ inspectionFormDia.value?.openDialog(type, row);
+ });
+ };
+ // 鎵撳紑闄勪欢寮规
+ const openFilesFormDia = (type, row) => {
+ nextTick(() => {
+ filesDia.value?.openDialog(type, row);
+ });
+ };
+ // 鎻愪环
+ const submit = async id => {
+ const res = await submitQualityInspect({ id: id });
+ if (res.code === 200) {
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ getList();
+ }
+ };
+ const open = async row => {
+ let userLists = await userListNoPage();
+ userList.value = userLists.data;
+ currentRow.value = row;
+ dialogFormVisible.value = true;
+ };
+ // 鍏抽棴寮规
+ const closeDia = () => {
+ proxy.resetForm("formRef");
+ dialogFormVisible.value = false;
+ };
+ const submitForm = () => {
+ if (currentRow.value) {
+ const data = {
+ ...form.value,
+ id: currentRow.value.id,
+ };
+ qualityInspectUpdate(data).then(res => {
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ closeDia();
+ getList();
+ });
+ }
+ };
+
+ // 鍒犻櫎
+ const handleDelete = () => {
+ let ids = [];
+ if (selectedRows.value.length > 0) {
+ ids = selectedRows.value.map(item => item.id);
+ } else {
+ proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+ return;
+ }
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
.then(() => {
- qualityInspectDel(ids).then((res) => {
+ qualityInspectDel(ids).then(res => {
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
getList();
});
@@ -356,41 +430,45 @@
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
});
-};
-const downLoadFile = (row) => {
- downloadQualityInspect({ id: row.id }).then((blobData) => {
- const blob = new Blob([blobData], {
- type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
- })
- const downloadUrl = window.URL.createObjectURL(blob)
-
- const link = document.createElement('a')
- link.href = downloadUrl
- link.download = '杩囩▼妫�楠屾姤鍛�.docx'
- document.body.appendChild(link)
- link.click()
-
- document.body.removeChild(link)
- window.URL.revokeObjectURL(downloadUrl)
- })
-};
-// 瀵煎嚭
-const handleOut = () => {
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
+ };
+ const downLoadFile = row => {
+ downloadQualityInspect({ id: row.id }).then(blobData => {
+ const blob = new Blob([blobData], {
+ type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
+ });
+ const downloadUrl = window.URL.createObjectURL(blob);
+
+ const link = document.createElement("a");
+ link.href = downloadUrl;
+ link.download = "杩囩▼妫�楠屾姤鍛�.docx";
+ document.body.appendChild(link);
+ link.click();
+
+ document.body.removeChild(link);
+ window.URL.revokeObjectURL(downloadUrl);
+ });
+ };
+ // 瀵煎嚭
+ const handleOut = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
.then(() => {
- proxy.download("/quality/qualityInspect/export", {inspectType: 1}, "杩囩▼妫�楠�.xlsx");
+ proxy.download(
+ "/quality/qualityInspect/export",
+ { inspectType: 1 },
+ "杩囩▼妫�楠�.xlsx"
+ );
})
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
});
-};
-onMounted(() => {
- getList();
-});
+ };
+ onMounted(() => {
+ getList();
+ });
</script>
<style scoped></style>
diff --git a/src/views/reportAnalysis/productionStatistics/index.vue b/src/views/reportAnalysis/productionStatistics/index.vue
index a168ed9..b457e61 100644
--- a/src/views/reportAnalysis/productionStatistics/index.vue
+++ b/src/views/reportAnalysis/productionStatistics/index.vue
@@ -54,7 +54,7 @@
@click="handleBlockTimeDimensionChange('month')">鏈�</span>
</div>
<div class="bi-panel-body">
- <div class="chart-filter-tabs">
+ <div class="chart-filter-tabs">
<span v-for="area in salesAreas"
:key="area"
class="cf-tab"
@@ -63,7 +63,12 @@
</div>
<div class="material-info-card">
<div class="material-icon">
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
+ <svg width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ stroke-width="2">
<path d="M20 7h-4V4c0-1.1-.9-2-2-2h-4c-1.1 0-2 .9-2 2v3H4c-1.1 0-2 .9-2 2v11c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2z" />
<polyline points="22,7 12,13 2,7" />
</svg>
@@ -149,7 +154,7 @@
@click="handleBoardTimeDimensionChange('month')">鏈�</span>
</div>
<div class="bi-panel-body">
- <div class="chart-filter-tabs">
+ <div class="chart-filter-tabs">
<span v-for="area in salesAreas"
:key="area"
class="cf-tab"
@@ -158,7 +163,12 @@
</div>
<div class="material-info-card">
<div class="material-icon">
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
+ <svg width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ stroke-width="2">
<path d="M20 7h-4V4c0-1.1-.9-2-2-2h-4c-1.1 0-2 .9-2 2v3H4c-1.1 0-2 .9-2 2v11c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2z" />
<polyline points="22,7 12,13 2,7" />
</svg>
@@ -209,7 +219,7 @@
<!-- 鍙充笅锛氶攢閲忔帓鍚嶅垎鏋� -->
<div class="bi-panel bi-panel-bottom-right">
<PanelHeader :isFullscreen="true"
- title="鐗╂枡鐢熶骇閲忕粺璁�" />
+ title="鑳借�楃粺璁�" />
<div class="panel-tabs">
<span class="tab-item"
:class="{ active: salesTimeDimension === 'year' }"
@@ -219,15 +229,8 @@
@click="handleSalesTimeDimensionChange('month')">鏈�</span>
</div>
<div class="bi-panel-body">
- <!-- <div class="chart-filter-tabs">
- <span v-for="area in salesAreas"
- :key="area"
- class="cf-tab"
- :class="{ active: selectedArea === area }"
- @click="handleAreaChange(area)">{{ area }}</span>
- </div>
<div ref="salesRankingChart"
- class="echart-fill"></div> -->
+ class="echart-fill"></div>
</div>
</div>
</div>
@@ -426,7 +429,14 @@
// 鏉挎潗鍗曡�楀浘琛ㄩ厤缃�
const boardCostChartOption = computed(() => {
const materials = ["娑堣�楅噺"];
- const colors = ["#00A4ED", "#34D8F7", "#4A8BFF", "#8A6BFF", "#C8C447", "#FF6B6B"];
+ const colors = [
+ "#00A4ED",
+ "#34D8F7",
+ "#4A8BFF",
+ "#8A6BFF",
+ "#C8C447",
+ "#FF6B6B",
+ ];
const year = 2024;
const periodType = boardTimeDimension.value;
@@ -520,7 +530,14 @@
// 浜ч噺鍒嗘瀽鍥捐〃閰嶇疆
const productionChartOption = computed(() => {
const salesAreas = ["鍏ㄩ儴", "鐮屽潡", "鏉挎潗"];
- const colors = ["#00A4ED", "#34D8F7", "#4A8BFF", "#8A6BFF", "#C8C447", "#FF6B6B"];
+ const colors = [
+ "#00A4ED",
+ "#34D8F7",
+ "#4A8BFF",
+ "#8A6BFF",
+ "#C8C447",
+ "#FF6B6B",
+ ];
const year = 2024;
const periodType = productionTimeDimension.value;
@@ -723,71 +740,179 @@
};
});
- // 閿�閲忔帓鍚嶅垎鏋愬浘琛ㄩ厤缃�
+ // 鑳借�楃粺璁″浘琛ㄩ厤缃�
const salesRankingChartOption = computed(() => {
- const customers = ["瀹㈡埛BB", "瀹㈡埛AA", "瀹㈡埛CC", "瀹㈡埛DD", "瀹㈡埛DD", "瀹㈡埛DD"];
- const values = [130, 120, 102, 90, 90, 70];
- const barColors = [
- "#34D8F7",
- "#4A8BFF",
- "#8A6BFF",
- "#C8C447",
- "#C8C447",
- "#C8C447",
+ const energyTypes = ["姘�", "鐢�", "钂告苯"];
+ const colors = ["#00A4ED", "#AC43C2", "#F5BC4A"];
+ const year = 2024;
+ const periodType = salesTimeDimension.value;
+
+ // 鐢熸垚鏃堕棿娈�
+ let periods = [];
+ if (periodType === "year") {
+ // 骞村害鏁版嵁锛�6涓湀
+ for (let month = 9; month <= 12; month++) {
+ periods.push(`${month}/${year.toString().slice(2)}`);
+ }
+ for (let month = 1; month <= 3; month++) {
+ periods.push(`${month}/${(year + 1).toString().slice(2)}`);
+ }
+ } else {
+ // 鏈堝害鏁版嵁锛�7澶�
+ const month = 1;
+ for (let day = 1; day <= 7; day++) {
+ periods.push(`${month}/${day}`);
+ }
+ }
+
+ // 涓烘瘡绉嶈兘婧愮被鍨嬬敓鎴愭暟鎹�
+ const waterData = periods.map(() => {
+ return periodType === "year"
+ ? Math.floor(Math.random() * 300) + 400
+ : Math.floor(Math.random() * 30) + 40;
+ });
+ const steamData = periods.map(() => {
+ return periodType === "year"
+ ? Math.floor(Math.random() * 400) + 500
+ : Math.floor(Math.random() * 40) + 50;
+ });
+ const electricityData = periods.map(() => {
+ return periodType === "year"
+ ? Math.floor(Math.random() * 200) + 300
+ : Math.floor(Math.random() * 20) + 30;
+ });
+
+ const series = [
+ {
+ name: "姘�",
+ type: "bar",
+ data: waterData,
+ itemStyle: {
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+ { offset: 0, color: "#00A4ED" },
+ { offset: 1, color: "#0F285A" },
+ ]),
+ borderRadius: [getResponsiveValue(4), getResponsiveValue(4), 0, 0],
+ },
+ barWidth: getResponsiveValue(6),
+ },
+ {
+ name: "鐢�",
+ type: "line",
+ data: electricityData,
+ itemStyle: {
+ color: "#AC43C2",
+ },
+ lineStyle: {
+ width: getResponsiveValue(1),
+ color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
+ { offset: 0, color: "#AC43C2" },
+ { offset: 1, color: "#AC43C2" },
+ ]),
+ },
+ symbol: "circle",
+ symbolSize: getResponsiveValue(8),
+ areaStyle: {
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+ { offset: 0, color: "#AC43C250" },
+ { offset: 1, color: "#AC43C203" },
+ ]),
+ },
+ },
+ {
+ name: "钂告苯",
+ type: "bar",
+ data: steamData,
+ itemStyle: {
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+ { offset: 0, color: "#F5BC4A" },
+ { offset: 1, color: "#591C22" },
+ ]),
+ borderRadius: [getResponsiveValue(4), getResponsiveValue(4), 0, 0],
+ },
+ barWidth: getResponsiveValue(6),
+ },
];
return {
- backgroundColor: "transparent",
tooltip: {
trigger: "axis",
- axisPointer: { type: "shadow" },
- backgroundColor: "rgba(0,0,0,0.55)",
- borderColor: "rgba(64,158,255,0.25)",
+ axisPointer: { type: "cross" },
+ backgroundColor: "rgba(0,0,0,0.7)",
+ borderColor: "rgba(64,158,255,0.5)",
borderWidth: getResponsiveValue(1),
- textStyle: { color: "#B8C8E0", fontSize: getResponsiveValue(11) },
- formatter: "{b}: {c} 绔嬫柟绫�",
+ textStyle: { color: "#B8C8E0", fontSize: getResponsiveValue(12) },
+ formatter: function (params) {
+ let result = params[0].name + "<br/>";
+ params.forEach(param => {
+ const unit = param.seriesName === "鐢�" ? "搴�" : "鍚�";
+ result += `${param.marker}${param.seriesName}: ${param.value} ${unit}<br/>`;
+ });
+ return result;
+ },
+ },
+ legend: {
+ data: energyTypes,
+ top: "5%",
+ right: "1%",
+ textStyle: {
+ color: "#B8C8E0",
+ fontSize: getResponsiveValue(10),
+ },
+ itemWidth: getResponsiveValue(12),
+ itemHeight: getResponsiveValue(12),
+ itemGap: getResponsiveValue(15),
},
grid: {
- left: "14%",
- right: "6%",
- top: "16%",
- bottom: "8%",
+ left: "1%",
+ right: "1%",
+ top: "25%",
+ bottom: "0%",
containLabel: true,
},
xAxis: {
- type: "value",
- axisLine: { show: false },
- axisLabel: { color: "#B8C8E0", fontSize: getResponsiveValue(11) },
- splitLine: { lineStyle: { color: "rgba(184,200,224,0.12)" } },
- },
- yAxis: {
type: "category",
- data: customers,
- axisTick: { show: false },
- axisLine: { show: false },
+ data: periods,
axisLabel: {
- color: "#B8C8E0",
fontSize: getResponsiveValue(11),
- margin: getResponsiveValue(8),
+ color: "#93B9FF",
+ interval: 0,
+ rotate: periodType === "month" ? 45 : 0,
},
- },
- series: [
- {
- name: "閿�閲忥紙绔嬫柟绫筹級",
- type: "bar",
- barWidth: getResponsiveValue(14),
- data: values,
- itemStyle: {
- color: params => barColors[params.dataIndex] || "#00A4ED",
- borderRadius: [
- getResponsiveValue(6),
- getResponsiveValue(6),
- getResponsiveValue(6),
- getResponsiveValue(6),
- ],
+ axisLine: {
+ show: true,
+ lineStyle: {
+ width: getResponsiveValue(1),
+ color: "#305B9A",
},
},
- ],
+ axisTick: {
+ show: false,
+ },
+ },
+ yAxis: {
+ type: "value",
+ axisLabel: {
+ fontSize: getResponsiveValue(11),
+ color: "#93B9FF",
+ formatter: function (value) {
+ return value;
+ },
+ },
+ axisLine: {
+ show: true,
+ lineStyle: {
+ color: "#305B9A",
+ },
+ },
+ splitLine: {
+ lineStyle: {
+ color: "#0F2E60",
+ type: "dashed",
+ },
+ },
+ },
+ series: series,
};
});
@@ -1232,12 +1357,12 @@
}
/* .scroll-table tbody tr:nth-child(odd) {
- background-color: rgba(64, 158, 255, 0.05);
- }
+ background-color: rgba(64, 158, 255, 0.05);
+ }
- .scroll-table tbody tr:nth-child(even) {
- background-color: rgba(64, 158, 255, 0.1);
- } */
+ .scroll-table tbody tr:nth-child(even) {
+ background-color: rgba(64, 158, 255, 0.1);
+ } */
.oddTableTr {
background-color: rgba(64, 158, 255, 0.05);
}
@@ -1357,7 +1482,6 @@
height: 24vh;
}
-
.bi-panel-bottom-right .echart-fill {
height: calc(100% - 2.8vh);
}
@@ -1632,7 +1756,7 @@
text-align: left;
color: #c3c3c3;
}
- /* 鏉愭枡淇℃伅鍗$墖 */
+ /* 鏉愭枡淇℃伅鍗$墖 */
.material-info-card {
display: flex;
align-items: center;
@@ -1691,5 +1815,4 @@
font-size: 1vh;
opacity: 0.7;
}
-
</style>
--
Gitblit v1.9.3