From 7c2cdcbc7f5585b96fba76a07b0e4417a09c4d7e Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 02 六月 2026 11:06:10 +0800
Subject: [PATCH] 新疆马铃薯 1.过程检验下载添加3个模版
---
src/views/qualityManagement/processInspection/index.vue | 219 +++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 175 insertions(+), 44 deletions(-)
diff --git a/src/views/qualityManagement/processInspection/index.vue b/src/views/qualityManagement/processInspection/index.vue
index 58d1a3a..dd40a5e 100644
--- a/src/views/qualityManagement/processInspection/index.vue
+++ b/src/views/qualityManagement/processInspection/index.vue
@@ -2,13 +2,6 @@
<div class="app-container">
<div class="search_form mb20">
<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"
@@ -18,28 +11,18 @@
placeholder="璇烽�夋嫨"
clearable
@change="changeDaterange" />
- <span style="margin-left: 10px"
- class="search_title">鐢熶骇宸ュ崟鍙凤細</span>
- <el-input v-model="searchForm.workOrderNo"
- style="width: 240px"
- placeholder="璇疯緭鍏ョ敓浜у伐鍗曞彿鎼滅储"
- @change="handleQuery"
- clearable
- :prefix-icon="Search" />
<el-button type="primary"
@click="handleQuery"
style="margin-left: 10px">鎼滅储</el-button>
</div>
- <div>
- <el-button type="primary"
- @click="openForm('add')">鏂板</el-button>
- <el-button @click="handleOut">瀵煎嚭</el-button>
- <el-button type="danger"
- plain
- @click="handleDelete">鍒犻櫎</el-button>
- </div>
</div>
<div class="table_list">
+ <div style="margin-bottom: 20px; text-align: right;">
+ <el-button type="primary" @click="openQuickCheck">蹇�熸楠�</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>
+ </div>
<PIMTable rowKey="id"
:column="tableColumn"
:tableData="tableData"
@@ -56,6 +39,9 @@
@close="handleQuery"></FormDia>
<files-dia ref="filesDia"
@close="handleQuery"></files-dia>
+ <QuickCheckDia ref="quickCheckDia"
+ @close="handleQuery"
+ @success="getList"></QuickCheckDia>
<el-dialog v-model="dialogFormVisible"
title="缂栬緫妫�楠屽憳"
width="30%"
@@ -85,6 +71,37 @@
</div>
</template>
</el-dialog>
+
+ <el-dialog v-model="templateDialogVisible"
+ title="閫夋嫨瀵煎嚭妯℃澘"
+ width="450px"
+ @close="closeTemplateDialog">
+ <div class="template-grid">
+ <div class="template-item" @click="handleTemplateExport('weilong')">
+ <div class="template-icon weilong-icon">浼�</div>
+ <div class="template-name">浼熼緳妯℃澘</div>
+ </div>
+ <!-- <div class="template-item" @click="handleTemplateExport('baishi')">
+ <div class="template-icon baishi-icon">鐧�</div>
+ <div class="template-name">鐧句簨妯℃澘</div>
+ </div> -->
+ <div class="template-item" @click="handleTemplateExport('dali')">
+ <div class="template-icon dali-icon">杈�</div>
+ <div class="template-name">杈惧埄妯℃澘</div>
+ </div>
+ <div class="template-item" @click="handleTemplateExport('common')">
+ <div class="template-icon common-icon">閫�</div>
+ <div class="template-name">閫氱敤妯℃澘</div>
+ </div>
+ </div>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button @click="closeTemplateDialog">鍙栨秷</el-button>
+ </div>
+ </template>
+ </el-dialog>
+
+
</div>
</template>
@@ -100,6 +117,7 @@
} from "vue";
import InspectionFormDia from "@/views/qualityManagement/processInspection/components/inspectionFormDia.vue";
import FormDia from "@/views/qualityManagement/processInspection/components/formDia.vue";
+ import QuickCheckDia from "@/views/qualityManagement/processInspection/components/quickCheckDia.vue";
import { ElMessageBox } from "element-plus";
import {
downloadQualityInspect,
@@ -107,6 +125,10 @@
qualityInspectListPage,
qualityInspectUpdate,
submitQualityInspect,
+ exportWeilongTemplate,
+ exportBaishiTemplate,
+ exportDaliTemplate,
+ exportCommonTemplate,
} from "@/api/qualityManagement/rawMaterialInspection.js";
import FilesDia from "@/views/qualityManagement/processInspection/components/filesDia.vue";
import dayjs from "dayjs";
@@ -115,7 +137,6 @@
const data = reactive({
searchForm: {
- process: "",
entryDate: undefined, // 褰曞叆鏃ユ湡
workOrderNo: "",
entryDateStart: undefined,
@@ -126,6 +147,7 @@
},
});
const { searchForm } = toRefs(data);
+
const tableColumn = ref([
{
label: "妫�娴嬫棩鏈�",
@@ -133,18 +155,13 @@
width: 120,
},
{
- label: "鐢熶骇宸ュ崟鍙�",
- prop: "workOrderNo",
- width: 120,
- },
- {
- label: "宸ュ簭",
- prop: "process",
- width: 230,
- },
- {
label: "妫�楠屽憳",
prop: "checkName",
+ },
+ {
+ label: "閲囪喘鍚堝悓鍙�",
+ prop: "purchaseContractNo",
+ width: 150,
},
{
label: "浜у搧鍚嶇О",
@@ -314,8 +331,12 @@
const formDia = ref();
const filesDia = ref();
const inspectionFormDia = ref();
+ const quickCheckDia = ref();
const { proxy } = getCurrentInstance();
const userStore = useUserStore();
+
+ const templateDialogVisible = ref(false);
+ const currentExportRow = ref(null);
const changeDaterange = value => {
searchForm.value.entryDateStart = undefined;
searchForm.value.entryDateEnd = undefined;
@@ -372,6 +393,26 @@
formDia.value?.openDialog(type, row);
});
};
+
+ // 鎵撳紑蹇�熸楠岀‘璁ゆ
+ const openQuickCheck = () => {
+ // 妫�鏌ユ槸鍚﹂�夋嫨浜嗘暟鎹�
+ if (!selectedRows.value || selectedRows.value.length === 0) {
+ proxy.$modal.msgWarning("璇峰厛閫夋嫨瑕佹楠岀殑鏁版嵁");
+ return;
+ }
+
+ // 杩囨护鍑烘湭鎻愪氦鐨勬暟鎹�
+ const unSubmittedRows = selectedRows.value.filter(item => item.inspectState !== 1);
+ if (unSubmittedRows.length === 0) {
+ proxy.$modal.msgWarning("閫変腑鐨勬暟鎹凡鍏ㄩ儴鎻愪氦锛屾棤闇�閲嶅妫�楠�");
+ return;
+ }
+
+ const ids = unSubmittedRows.map(item => item.id);
+ quickCheckDia.value?.openDialog(ids, unSubmittedRows);
+ };
+
// 鎵撳紑鏂板妫�楠屽脊妗�
const openInspectionForm = (type, row) => {
nextTick(() => {
@@ -442,21 +483,51 @@
});
};
const downLoadFile = row => {
- downloadQualityInspect({ id: row.id }).then(blobData => {
- const blob = new Blob([blobData], {
+ currentExportRow.value = row;
+ templateDialogVisible.value = true;
+ };
+
+ const closeTemplateDialog = () => {
+ templateDialogVisible.value = false;
+ currentExportRow.value = null;
+ };
+
+ const handleTemplateExport = async (templateType) => {
+ if (!currentExportRow.value) {
+ proxy.$modal.msgError("璇烽�夋嫨瑕佸鍑虹殑鏁版嵁");
+ return;
+ }
+ const id = currentExportRow.value.id;
+ const fileNameMap = {
+ weilong: "浼熼緳妯$増妫�楠岀粨鏋�.doc",
+ baishi: "鐧句簨妯$増妫�楠岀粨鏋�.doc",
+ dali: "杈惧埄妯$増妫�楠岀粨鏋�.doc",
+ common: "閫氱敤妯$増妫�楠岀粨鏋�.doc",
+ };
+ const exportFuncMap = {
+ weilong: exportWeilongTemplate,
+ baishi: exportBaishiTemplate,
+ dali: exportDaliTemplate,
+ common: exportCommonTemplate,
+ };
+ try {
+ const response = await exportFuncMap[templateType](id);
+ const blob = new Blob([response], {
type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
});
- const downloadUrl = window.URL.createObjectURL(blob);
-
const link = document.createElement("a");
- link.href = downloadUrl;
- link.download = "杩囩▼妫�楠屾姤鍛�.docx";
+ link.href = URL.createObjectURL(blob);
+ link.download = fileNameMap[templateType];
document.body.appendChild(link);
link.click();
-
document.body.removeChild(link);
- window.URL.revokeObjectURL(downloadUrl);
- });
+ URL.revokeObjectURL(link.href);
+ proxy.$modal.msgSuccess("瀵煎嚭鎴愬姛");
+ closeTemplateDialog();
+ } catch (error) {
+ console.error("瀵煎嚭澶辫触", error);
+ proxy.$modal.msgError("瀵煎嚭澶辫触");
+ }
};
// 瀵煎嚭
const handleOut = () => {
@@ -481,4 +552,64 @@
});
</script>
-<style scoped></style>
+<style scoped>
+.template-grid {
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ gap: 20px;
+ padding: 20px 10px;
+}
+
+.template-item {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: 24px 16px;
+ border: 1px solid #e4e7ed;
+ border-radius: 8px;
+ cursor: pointer;
+ transition: all 0.3s;
+}
+
+.template-item:hover {
+ border-color: #409eff;
+ box-shadow: 0 2px 12px rgba(64, 158, 255, 0.2);
+ transform: translateY(-2px);
+}
+
+.template-icon {
+ width: 56px;
+ height: 56px;
+ border-radius: 50%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 24px;
+ font-weight: bold;
+ color: #fff;
+ margin-bottom: 12px;
+}
+
+.weilong-icon {
+ background: linear-gradient(135deg, #409eff, #1677ff);
+}
+
+.baishi-icon {
+ background: linear-gradient(135deg, #67c23a, #529b2e);
+}
+
+.dali-icon {
+ background: linear-gradient(135deg, #e6a23c, #c4860c);
+}
+
+.common-icon {
+ background: linear-gradient(135deg, #909399, #6d6d6d);
+}
+
+.template-name {
+ font-size: 15px;
+ color: #303133;
+ font-weight: 500;
+}
+</style>
--
Gitblit v1.9.3