From 2dd434830299e781cd942ef5e6e938160dd12704 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期二, 03 三月 2026 17:15:18 +0800
Subject: [PATCH] 原材料检验功能开发
---
src/pages/index.vue | 46
src/pages.json | 28
src/pages/qualityManagement/materialInspection/fileList.vue | 566 ++++++++++
src/api/qualityManagement/materialInspection.js | 157 ++
src/pages/qualityManagement/materialInspection/add.vue | 1134 ++++++++++++++++++++
src/pages/qualityManagement/materialInspection/detail.vue | 526 +++++++++
src/pages/qualityManagement/materialInspection/index.vue | 814 ++++++++++++++
7 files changed, 3,271 insertions(+), 0 deletions(-)
diff --git a/src/api/qualityManagement/materialInspection.js b/src/api/qualityManagement/materialInspection.js
new file mode 100644
index 0000000..13c7efe
--- /dev/null
+++ b/src/api/qualityManagement/materialInspection.js
@@ -0,0 +1,157 @@
+import request from "@/utils/request";
+
+// 鏌ヨ鍘熸潗鏂欐楠屽垪琛�
+export function qualityInspectListPage(query) {
+ return request({
+ url: '/quality/qualityInspect/listPage',
+ method: 'get',
+ params: query,
+ })
+}
+
+// 鏂板鍘熸潗鏂欐楠�
+export function qualityInspectAdd(data) {
+ return request({
+ url: '/quality/qualityInspect/add',
+ method: 'post',
+ data: data,
+ })
+}
+
+// 淇敼鍘熸潗鏂欐楠�
+export function qualityInspectUpdate(data) {
+ return request({
+ url: '/quality/qualityInspect/update',
+ method: 'post',
+ data: data,
+ })
+}
+
+// 鍒犻櫎鍘熸潗鏂欐楠�
+export function qualityInspectDel(data) {
+ return request({
+ url: '/quality/rawMaterialInspection/delete',
+ method: 'post',
+ data: data,
+ })
+}
+
+// 鎻愪氦鍘熸潗鏂欐楠�
+export function submitQualityInspect(data) {
+ return request({
+ url: '/quality/qualityInspect/submit',
+ method: 'post',
+ data: data,
+ })
+}
+
+// 涓嬭浇鍘熸潗鏂欐楠屾姤鍛�
+export function downloadQualityInspect(data) {
+ return request({
+ url: '/quality/rawMaterialInspection/export',
+ method: 'post',
+ data: data,
+ responseType: "blob",
+ })
+}
+
+// 鑾峰彇渚涘簲鍟嗗垪琛�
+export function getSupplierList() {
+ return request({
+ url: '/basic/supplier/list',
+ method: 'get',
+ })
+}
+
+// 鑾峰彇浜у搧鍒楄〃
+export function getProductList() {
+ return request({
+ url: '/basic/product/list',
+ method: 'get',
+ })
+}
+
+// 鑾峰彇浜у搧鍨嬪彿鍒楄〃
+export function getProductModelList(productId) {
+ return request({
+ url: '/basic/productModel/list',
+ method: 'get',
+ params: { productId },
+ })
+}
+
+// 鑾峰彇妫�楠屽憳鍒楄〃
+export function getUserList() {
+ return request({
+ url: '/system/user/list',
+ method: 'get',
+ })
+}
+
+
+// 鏌ヨ妫�楠屾寚鏍�
+export function qualityInspectParamInfo(query) {
+ return request({
+ url: '/quality/qualityInspectParam/' + query,
+ method: 'get',
+ data: query,
+ })
+}
+// 鎻愪氦妫�楠�
+export function qualityInspectParamUpdate(query) {
+ return request({
+ url: '/quality/qualityInspectParam/update',
+ method: 'post',
+ data: query,
+ })
+}
+
+// 鍒犻櫎妫�楠岃褰�
+export function qualityInspectParamDel(query) {
+ return request({
+ url: '/quality/qualityInspectParam/del',
+ method: 'delete',
+ data: query,
+ })
+}
+// 鍒犻櫎鎸囨爣鍒楄〃
+export function qualityInspectDetailByProductId(params) {
+ return request({
+ url: "/qualityTestStandard/getQualityTestStandardByProductId",
+ method: "get",
+ params: params,
+ });
+}
+// 鏍规嵁鏍囧噯ID鑾峰彇鏍囧噯鍙傛暟
+export function getQualityTestStandardParamByTestStandardId(testStandardId) {
+ return request({
+ url: "/qualityTestStandard/getQualityTestStandardParamByTestStandardId",
+ method: "get",
+ params: { testStandardId },
+ });
+}
+
+// 鏌ヨ闄勪欢鍒楄〃
+export function qualityInspectFileListPage(query) {
+ return request({
+ url: '/quality/qualityInspectFile/listPage',
+ method: 'get',
+ params: query,
+ })
+}
+// 淇濆瓨闄勪欢鍒楄〃
+export function qualityInspectFileAdd(query) {
+ return request({
+ url: '/quality/qualityInspectFile/add',
+ method: 'post',
+ data: query,
+ })
+}
+// 鍒犻櫎闄勪欢鍒楄〃
+export function qualityInspectFileDel(query) {
+ return request({
+ url: '/quality/qualityInspectFile/del',
+ method: 'delete',
+ data: query,
+ })
+}
\ No newline at end of file
diff --git a/src/pages.json b/src/pages.json
index 74f5cf6..868dda7 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -893,6 +893,34 @@
}
},
{
+ "path": "pages/qualityManagement/materialInspection/index",
+ "style": {
+ "navigationBarTitleText": "鍘熸潗鏂欐楠�",
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/qualityManagement/materialInspection/add",
+ "style": {
+ "navigationBarTitleText": "鍘熸潗鏂欐楠屾坊鍔�",
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/qualityManagement/materialInspection/detail",
+ "style": {
+ "navigationBarTitleText": "鍘熸潗鏂欐楠岃鎯�",
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/qualityManagement/materialInspection/fileList",
+ "style": {
+ "navigationBarTitleText": "鍘熸潗鏂欐楠岄檮浠�",
+ "navigationStyle": "custom"
+ }
+ },
+ {
"path": "pages/message",
"style": {
"navigationBarTitleText": "娑堟伅涓績"
diff --git a/src/pages/index.vue b/src/pages/index.vue
index 2a93fa2..960c788 100644
--- a/src/pages/index.vue
+++ b/src/pages/index.vue
@@ -137,6 +137,31 @@
</up-grid>
</view>
</view>
+ <!-- 璐ㄩ噺绠$悊妯″潡 -->
+ <view class="common-module collaboration-module"
+ v-if="hasQualityItems">
+ <view class="module-header">
+ <view class="module-title-container">
+ <text class="module-title">璐ㄩ噺绠$悊</text>
+ </view>
+ </view>
+ <view class="module-content">
+ <up-grid :border="false"
+ col="4">
+ <up-grid-item v-for="(item, index) in qualityItems"
+ :key="index"
+ @click="handleCommonItemClick(item)">
+ <view class="icon-container"
+ :style="{ background: item.bgColor }">
+ <up-icon :name="item.icon"
+ :size="58"
+ color="#ffffff"></up-icon>
+ </view>
+ <text class="item-label">{{item.label}}</text>
+ </up-grid-item>
+ </up-grid>
+ </view>
+ </view>
<!-- 浜哄姏璧勬簮妯″潡 -->
<view class="common-module collaboration-module"
v-if="hasHumanResourcesItems">
@@ -312,6 +337,12 @@
{
icon: "/static/images/icon/caigoutaizhang@2x.png",
label: "鍚堝悓绠$悊",
+ },
+ ]);
+ const qualityItems = reactive([
+ {
+ icon: "/static/images/icon/caigoutaizhang@2x.png",
+ label: "鍘熸潗鏂欐楠�",
},
]);
const safetyItems = reactive([
@@ -725,6 +756,11 @@
url: "/pages/humanResources/contractManagement/index",
});
break;
+ case "鍘熸潗鏂欐楠�":
+ uni.navigateTo({
+ url: "/pages/qualityManagement/materialInspection/index",
+ });
+ break;
default:
uni.showToast({
title: `鐐瑰嚮浜�${item.label}`,
@@ -1001,6 +1037,15 @@
...filteredHumanResources
);
+ // 杩囨护璐ㄩ噺绠$悊鑿滃崟
+ const originalQuality = [
+ { icon: "/static/images/icon/caigoutaizhang@2x.png", label: "鍘熸潗鏂欐楠�" },
+ ];
+ const filteredQuality = originalQuality.filter(item => {
+ return allowedMenuTitles.has(item.label);
+ });
+ qualityItems.splice(0, qualityItems.length, ...filteredQuality);
+
// 杩囨护鐢熶骇绠℃帶鑿滃崟
const originalProduction = [
{
@@ -1032,6 +1077,7 @@
const hasPurchaseItems = computed(() => purchaseItems.length > 0);
const hasCollaborationItems = computed(() => collaborationItems.length > 0);
const hasSafetyItems = computed(() => safetyItems.length > 0);
+ const hasQualityItems = computed(() => qualityItems.length > 0);
const hasHumanResourcesItems = computed(() => humanResourcesItems.length > 0);
const hasProductionItems = computed(() => productionItems.length > 0);
const hasEquipmentItems = computed(() => equipmentItems.length > 0);
diff --git a/src/pages/qualityManagement/materialInspection/add.vue b/src/pages/qualityManagement/materialInspection/add.vue
new file mode 100644
index 0000000..0309813
--- /dev/null
+++ b/src/pages/qualityManagement/materialInspection/add.vue
@@ -0,0 +1,1134 @@
+<template>
+ <view class="material-inspection-add">
+ <!-- 浣跨敤閫氱敤椤甸潰澶撮儴缁勪欢 -->
+ <PageHeader :title="isEdit ? '缂栬緫鍘熸潗鏂欐楠�' : '鏂板鍘熸潗鏂欐楠�'"
+ @back="goBack" />
+ <!-- 琛ㄥ崟鍐呭 -->
+ <up-form :model="form"
+ ref="formRef"
+ label-width="110"
+ :rules="rules">
+ <!-- 鍩烘湰淇℃伅 -->
+ <up-form-item label="渚涘簲鍟�"
+ prop="supplier"
+ required
+ border-bottom>
+ <up-input v-model="form.supplier"
+ placeholder="璇烽�夋嫨渚涘簲鍟�"
+ readonly
+ :disabled="supplierQuantityDisabled" />
+ <template #right>
+ <up-icon @click="showSupplierSheet = true"
+ name="arrow-right" />
+ </template>
+ </up-form-item>
+ <up-form-item label="浜у搧鍚嶇О"
+ prop="productId"
+ required
+ border-bottom>
+ <up-input v-model="form.productName"
+ placeholder="璇烽�夋嫨浜у搧"
+ readonly
+ @click="showProductTree = true"
+ :disabled="isEdit" />
+ <template #right>
+ <up-icon @click="showProductTree = true"
+ name="arrow-right" />
+ </template>
+ </up-form-item>
+ <up-form-item label="瑙勬牸鍨嬪彿"
+ prop="productModelId"
+ required
+ border-bottom>
+ <up-input v-model="form.model"
+ placeholder="璇烽�夋嫨瑙勬牸鍨嬪彿"
+ readonly
+ :disabled="isEdit" />
+ <template #right>
+ <up-icon @click="showModelSheet = true"
+ name="arrow-right" />
+ </template>
+ </up-form-item>
+ <up-form-item label="鎸囨爣閫夋嫨"
+ prop="testStandardId"
+ border-bottom>
+ <up-input v-model="testStandardDisplay"
+ placeholder="璇烽�夋嫨鎸囨爣"
+ readonly />
+ <template #right>
+ <up-icon @click="openTestStandardSheet"
+ name="arrow-right" />
+ </template>
+ </up-form-item>
+ <up-form-item label="鍗曚綅"
+ prop="unit"
+ border-bottom>
+ <up-input v-model="form.unit"
+ placeholder="璇疯緭鍏ュ崟浣�"
+ disabled />
+ </up-form-item>
+ <up-form-item label="鏁伴噺"
+ prop="quantity"
+ required
+ border-bottom>
+ <up-input v-model="form.quantity"
+ type="number"
+ placeholder="璇疯緭鍏ユ暟閲�"
+ :disabled="supplierQuantityDisabled" />
+ </up-form-item>
+ <up-form-item label="妫�娴嬪崟浣�"
+ prop="checkCompany"
+ border-bottom>
+ <up-input v-model="form.checkCompany"
+ placeholder="璇疯緭鍏ユ娴嬪崟浣�"
+ clearable />
+ </up-form-item>
+ <up-form-item label="妫�娴嬬粨鏋�"
+ prop="checkResult"
+ required
+ border-bottom>
+ <up-input v-model="form.checkResult"
+ placeholder="璇烽�夋嫨妫�娴嬬粨鏋�"
+ readonly
+ @click="showResultSheet" />
+ <template #right>
+ <up-icon @click="showResultSheet = true"
+ name="arrow-right" />
+ </template>
+ </up-form-item>
+ <up-form-item label="妫�楠屽憳"
+ prop="checkName"
+ border-bottom>
+ <up-input v-model="form.checkName"
+ placeholder="璇烽�夋嫨妫�楠屽憳"
+ readonly
+ @click="showInspectorSheet" />
+ <template #right>
+ <up-icon @click="showInspectorSheet = true"
+ name="arrow-right" />
+ </template>
+ </up-form-item>
+ <up-form-item label="妫�娴嬫棩鏈�"
+ prop="checkTime"
+ required
+ border-bottom>
+ <up-input v-model="form.checkTime"
+ placeholder="璇烽�夋嫨妫�娴嬫棩鏈�"
+ readonly />
+ <!-- <template #right>
+ <up-icon name="calendar"
+ @click="showDatePicker"></up-icon>
+ </template> -->
+ </up-form-item>
+ <!-- <up-form-item label="閲囪喘璁㈠崟鍙�"
+ prop="purchaseContractNo"
+ border-bottom>
+ <up-input v-model="form.purchaseContractNo"
+ placeholder="璇疯緭鍏ラ噰璐鍗曞彿"
+ clearable />
+ </up-form-item> -->
+ <!-- 妫�楠岄」鐩� -->
+ <view class="inspection-items-container">
+ <view class="steps-header">
+ <text class="steps-title">妫�楠岄」鐩�</text>
+ <text class="steps-count">鍏� {{ tableData.length }} 涓」鐩�</text>
+ </view>
+ <view class="steps-list">
+ <view v-for="(item, index) in tableData"
+ :key="index"
+ class="exec-step-item">
+ <view class="step-number">
+ {{ index + 1 }}
+ </view>
+ <view class="step-content">
+ <view class="step-row">
+ <text class="step-label">鎸囨爣锛�</text>
+ <text class="step-value">{{ item.parameterItem }}</text>
+ </view>
+ <view class="step-row">
+ <text class="step-label">鍗曚綅锛�</text>
+ <text class="step-value">{{ item.unit }}</text>
+ </view>
+ <view class="step-row">
+ <text class="step-label">鏍囧噯鍊硷細</text>
+ <text class="step-value">{{ item.standardValue }}</text>
+ </view>
+ <view class="step-row">
+ <text class="step-label">鍐呮帶鍊硷細</text>
+ <text class="step-value">{{ item.controlValue }}</text>
+ </view>
+ <view class="step-row">
+ <text class="step-label">妫�楠屽�硷細</text>
+ <up-input v-model="item.testValue"
+ placeholder="璇疯緭鍏ユ楠屽��"
+ clearable
+ border-bottom
+ class="step-input" />
+ </view>
+ </view>
+ </view>
+ <view v-if="tableData.length === 0"
+ class="empty-data">
+ <text>璇峰厛閫夋嫨鎸囨爣</text>
+ </view>
+ </view>
+ </view>
+ </up-form>
+ <!-- 搴曢儴鎸夐挳 -->
+ <view class="bottom-buttons">
+ <up-button type="default"
+ size="default"
+ @click="goBack"
+ class="bottom-btn">
+ 鍙栨秷
+ </up-button>
+ <up-button type="primary"
+ size="default"
+ @click="submitForm"
+ :loading="loading"
+ class="bottom-btn">
+ {{ isEdit ? '淇濆瓨' : '鎻愪氦' }}
+ </up-button>
+ </view>
+ <!-- 鏃ユ湡閫夋嫨鍣� -->
+ <up-popup v-model:show="showDate"
+ mode="date"
+ :start-year="2020"
+ :end-year="2030"
+ @confirm="confirmDate" />
+ <!-- 渚涘簲鍟嗛�夋嫨 -->
+ <up-action-sheet :show="showSupplierSheet"
+ :actions="supplierOptions"
+ @select="selectSupplier"
+ @close="showSupplierSheet = false"
+ title="閫夋嫨渚涘簲鍟�" />
+ <!-- 浜у搧閫夋嫨 -->
+ <up-action-sheet :show="showProductSheet"
+ :actions="productSheetOptions"
+ @select="selectProduct"
+ @close="showProductSheet = false"
+ title="閫夋嫨浜у搧" />
+ <!-- 瑙勬牸鍨嬪彿閫夋嫨 -->
+ <up-action-sheet :show="showModelSheet"
+ :actions="modelSheetOptions"
+ @select="selectModel"
+ @close="showModelSheet = false"
+ title="閫夋嫨瑙勬牸鍨嬪彿" />
+ <!-- 妫�娴嬬粨鏋滈�夋嫨 -->
+ <up-action-sheet :show="showResultSheet"
+ :actions="resultSheetOptions"
+ @select="selectResult"
+ @close="showResultSheet = false"
+ title="閫夋嫨妫�娴嬬粨鏋�" />
+ <!-- 妫�楠屽憳閫夋嫨 -->
+ <up-action-sheet :show="showInspectorSheet"
+ :actions="userSheetOptions"
+ @select="selectInspector"
+ @close="showInspectorSheet = false"
+ title="閫夋嫨妫�楠屽憳" />
+ <!-- 鎸囨爣閫夋嫨 -->
+ <up-action-sheet :show="showTestStandardSheet"
+ :actions="testStandardSheetOptions"
+ @select="selectTestStandard"
+ @close="showTestStandardSheet = false"
+ title="閫夋嫨鎸囨爣" />
+ <!-- 浜у搧鏍戝舰閫夋嫨鍣� -->
+ <up-popup v-model:show="showProductTree"
+ position="bottom"
+ :round="true"
+ :closeable="true"
+ @close="showProductTree = false">
+ <view class="tree-selector">
+ <view class="tree-header">
+ <text class="tree-title">閫夋嫨浜у搧</text>
+ </view>
+ <view class="tree-content">
+ <view class="tree-node"
+ v-for="(node, index) in productOptions"
+ :key="index">
+ <view v-if="node.children && node.children.length > 0"
+ class="tree-node-header"
+ @click="toggleNode(node)">
+ <up-icon :name="node.expanded ? 'arrow-down' : 'arrow-right'"
+ class="tree-node-icon" />
+ <text class="tree-node-label">{{ node.label }}</text>
+ </view>
+ <view v-else
+ class="tree-node-header"
+ @click="selectTreeNode(node)">
+ <text class="tree-node-icon-placeholder"></text>
+ <text class="tree-node-label">{{ node.label }}</text>
+ <up-icon name="checkmark"
+ v-if="form.productId == node.value"
+ class="tree-node-check" />
+ </view>
+ <view v-if="node.children && node.children.length > 0 && node.expanded"
+ class="tree-node-children">
+ <view class="tree-node"
+ v-for="(child, childIndex) in node.children"
+ :key="childIndex">
+ <view v-if="child.children && child.children.length > 0"
+ class="tree-node-header"
+ @click="toggleNode(child)">
+ <up-icon :name="child.expanded ? 'arrow-down' : 'arrow-right'"
+ class="tree-node-icon" />
+ <text class="tree-node-label">{{ child.label }}</text>
+ </view>
+ <view v-else
+ class="tree-node-header"
+ @click="selectTreeNode(child)">
+ <text class="tree-node-icon-placeholder"></text>
+ <text class="tree-node-label">{{ child.label }}</text>
+ <up-icon name="checkmark"
+ v-if="form.productId == child.value"
+ class="tree-node-check" />
+ </view>
+ <view v-if="child.children && child.children.length > 0 && child.expanded"
+ class="tree-node-children">
+ <view class="tree-node"
+ v-for="(grandchild, grandchildIndex) in child.children"
+ :key="grandchildIndex">
+ <view class="tree-node-header"
+ @click="selectTreeNode(grandchild)">
+ <text class="tree-node-icon-placeholder"></text>
+ <text class="tree-node-label">{{ grandchild.label }}</text>
+ <up-icon name="checkmark"
+ v-if="form.productId == grandchild.value"
+ class="tree-node-check" />
+ </view>
+ </view>
+ </view>
+ </view>
+ </view>
+ </view>
+ </view>
+ </view>
+ </up-popup>
+ </view>
+</template>
+
+<script setup>
+ import { ref, computed, onMounted, nextTick } from "vue";
+ import { onShow } from "@dcloudio/uni-app";
+ import PageHeader from "@/components/PageHeader.vue";
+ import dayjs from "dayjs";
+ import { getOptions } from "@/api/procurementManagement/procurementLedger.js";
+ import { modelList, productTreeList } from "@/api/basicData/product.js";
+ import {
+ qualityInspectAdd,
+ qualityInspectUpdate,
+ qualityInspectParamInfo,
+ qualityInspectDetailByProductId,
+ getQualityTestStandardParamByTestStandardId,
+ } from "@/api/qualityManagement/materialInspection.js";
+ import { userListNoPage } from "@/api/system/user.js";
+
+ // 鏄剧ず鎻愮ず淇℃伅
+ const showToast = message => {
+ uni.showToast({
+ title: message,
+ icon: "none",
+ });
+ };
+
+ // 琛ㄥ崟寮曠敤
+ const formRef = ref(null);
+ // 鍔犺浇鐘舵��
+ const loading = ref(false);
+ // 鏃ユ湡閫夋嫨鍣�
+ const showDate = ref(false);
+ // 渚涘簲鍟嗛�夋嫨
+ const showSupplierSheet = ref(false);
+ // 浜у搧閫夋嫨
+ const showProductSheet = ref(false);
+ // 浜у搧鏍戝舰閫夋嫨鍣�
+ const showProductTree = ref(false);
+ // 瑙勬牸鍨嬪彿閫夋嫨
+ const showModelSheet = ref(false);
+ // 妫�娴嬬粨鏋滈�夋嫨
+ const showResultSheet = ref(false);
+ // 妫�楠屽憳閫夋嫨
+ const showInspectorSheet = ref(false);
+ // 鎸囨爣閫夋嫨
+ const showTestStandardSheet = ref(false);
+
+ // 琛ㄥ崟鏁版嵁
+ const form = ref({
+ checkTime: dayjs().format("YYYY-MM-DD"),
+ supplier: "",
+ checkName: "",
+ productName: "",
+ productId: "",
+ productModelId: "",
+ model: "",
+ testStandardId: "",
+ unit: "",
+ quantity: "",
+ checkCompany: "",
+ checkResult: "",
+ productMainId: null,
+ purchaseLedgerId: null,
+ });
+
+ // 鏄剧ず鐢ㄧ殑鍙橀噺
+ const testStandardDisplay = ref("");
+
+ // 妫�楠岄」鐩�
+ const tableData = ref([]);
+ const tableLoading = ref(false);
+
+ // 渚涘簲鍟嗗垪琛�
+ const supplierList = ref([]);
+ // 浜у搧閫夐」
+ const productOptions = ref([]);
+ // 鍨嬪彿閫夐」
+ const modelOptions = ref([]);
+ // 妫�楠屽憳鍒楄〃
+ const userList = ref([]);
+ // 妫�娴嬬粨鏋滈�夐」
+ const resultOptions = ref([
+ { label: "鍚堟牸", value: "鍚堟牸" },
+ { label: "涓嶅悎鏍�", value: "涓嶅悎鏍�" },
+ ]);
+ // 鎸囨爣閫夐」
+ const testStandardOptions = ref([]);
+ // 褰撳墠浜у搧ID
+ const currentProductId = ref(0);
+
+ // ActionSheet閫夐」
+ const supplierOptions = computed(() => {
+ return supplierList.value.map(item => ({
+ name: item.supplierName,
+ value: item.supplierName,
+ }));
+ });
+
+ const productSheetOptions = computed(() => {
+ return productOptions.value.map(item => ({
+ name: item.label,
+ value: item.value,
+ }));
+ });
+
+ const modelSheetOptions = computed(() => {
+ return modelOptions.value.map(item => ({
+ name: item.model,
+ value: item.id,
+ }));
+ });
+
+ const resultSheetOptions = computed(() => {
+ return resultOptions.value.map(item => ({
+ name: item.label,
+ value: item.value,
+ }));
+ });
+
+ const userSheetOptions = computed(() => {
+ return userList.value.map(item => ({
+ name: item.nickName,
+ value: item.nickName,
+ }));
+ });
+
+ const testStandardSheetOptions = computed(() => {
+ return testStandardOptions.value.map(item => ({
+ name: item.standardName || item.standardNo,
+ value: item.id,
+ }));
+ });
+
+ // 琛ㄥ崟楠岃瘉瑙勫垯
+ const rules = {
+ checkTime: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ supplier: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ checkName: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
+ productId: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ productModelId: [
+ { required: true, message: "璇烽�夋嫨浜у搧鍨嬪彿", trigger: "change" },
+ ],
+ testStandardId: [
+ { required: false, message: "璇烽�夋嫨鎸囨爣", trigger: "change" },
+ ],
+ unit: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
+ quantity: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ checkCompany: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
+ checkResult: [
+ { required: true, message: "璇烽�夋嫨妫�娴嬬粨鏋�", trigger: "change" },
+ ],
+ };
+
+ // 鏄惁涓虹紪杈戞ā寮�
+ const isEdit = computed(() => {
+ const id = getPageId();
+ return !!id;
+ });
+
+ // 缂栬緫鏃讹細productMainId 鎴� purchaseLedgerId 浠讳竴鏈夊�煎垯渚涘簲鍟嗐�佹暟閲忕疆鐏�
+ const supplierQuantityDisabled = computed(() => {
+ const v = form.value || {};
+ return !!(v.productMainId != null || v.purchaseLedgerId != null);
+ });
+
+ // 鑾峰彇椤甸潰ID
+ const getPageId = () => {
+ const pages = getCurrentPages();
+ const currentPage = pages[pages.length - 1];
+ return currentPage.options.id;
+ };
+
+ // 杩斿洖涓婁竴椤�
+ const goBack = () => {
+ uni.navigateBack();
+ };
+
+ // 鏄剧ず鏃ユ湡閫夋嫨鍣�
+ const showDatePicker = () => {
+ showDate.value = true;
+ };
+
+ // 纭鏃ユ湡閫夋嫨
+ const confirmDate = e => {
+ form.value.checkTime = dayjs(e.value).format("YYYY-MM-DD");
+ };
+
+ // 閫夋嫨渚涘簲鍟�
+ const selectSupplier = e => {
+ form.value.supplier = e.value;
+ showSupplierSheet.value = false;
+ };
+
+ // 閫夋嫨浜у搧
+ const selectProduct = e => {
+ form.value.productId = e.value;
+ form.value.productName = e.name;
+ showProductSheet.value = false;
+ getModels(e.value);
+ };
+
+ // 鍒囨崲鏍戝舰鑺傜偣灞曞紑/鎶樺彔
+ const toggleNode = node => {
+ node.expanded = !node.expanded;
+ };
+
+ // 閫夋嫨鏍戝舰鑺傜偣
+ const selectTreeNode = node => {
+ // 纭繚鍙�夋嫨鏈鑺傜偣
+ if (!node.children || node.children.length == 0) {
+ form.value.productId = node.value;
+ form.value.productName = node.label;
+ showProductTree.value = false;
+ getModels(node.value);
+ }
+ };
+
+ // 杞崲浜у搧鏍戠粨鏋�
+ function convertIdToValue(data) {
+ return data.map(item => {
+ const { id, children, ...rest } = item;
+ const newItem = {
+ ...rest,
+ value: id, // 灏� id 鏀逛负 value
+ };
+ if (children && children.length > 0) {
+ newItem.children = convertIdToValue(children);
+ }
+
+ return newItem;
+ });
+ }
+
+ // 鏍规嵁ID鏌ユ壘鑺傜偣
+ const findNodeById = (nodes, productId) => {
+ for (let i = 0; i < nodes.length; i++) {
+ if (nodes[i].value === productId) {
+ return nodes[i].label; // 鎵惧埌鑺傜偣锛岃繑鍥炶鑺傜偣
+ }
+ if (nodes[i].children && nodes[i].children.length > 0) {
+ const foundNode = findNodeById(nodes[i].children, productId);
+ if (foundNode) {
+ return foundNode; // 鍦ㄥ瓙鑺傜偣涓壘鍒帮紝杩斿洖璇ヨ妭鐐�
+ }
+ }
+ }
+ return null; // 娌℃湁鎵惧埌鑺傜偣锛岃繑鍥瀗ull
+ };
+
+ // 閫夋嫨瑙勬牸鍨嬪彿
+ const selectModel = e => {
+ form.value.productModelId = e.value;
+ showModelSheet.value = false;
+ handleChangeModel(e.value);
+ };
+
+ // 澶勭悊鍨嬪彿鍙樺寲
+ const handleChangeModel = value => {
+ form.value.model =
+ modelOptions.value.find(item => item.id == value)?.model || "";
+ form.value.unit =
+ modelOptions.value.find(item => item.id == value)?.unit || "";
+ };
+
+ // 閫夋嫨妫�娴嬬粨鏋�
+ const selectResult = e => {
+ form.value.checkResult = e.value;
+ showResultSheet.value = false;
+ };
+
+ // 閫夋嫨妫�楠屽憳
+ const selectInspector = e => {
+ form.value.checkName = e.value;
+ showInspectorSheet.value = false;
+ };
+
+ // 閫夋嫨鎸囨爣
+ const selectTestStandard = e => {
+ form.value.testStandardId = e.value;
+ testStandardDisplay.value = e.name;
+ showTestStandardSheet.value = false;
+ handleTestStandardChange(e.value);
+ };
+
+ // 鎸囨爣閫夋嫨鍙樺寲澶勭悊
+ const handleTestStandardChange = testStandardId => {
+ if (!testStandardId) {
+ tableData.value = [];
+ return;
+ }
+ tableLoading.value = true;
+ getQualityTestStandardParamByTestStandardId(testStandardId)
+ .then(res => {
+ tableData.value = res.data || [];
+ })
+ .catch(error => {
+ console.error("鑾峰彇鏍囧噯鍙傛暟澶辫触:", error);
+ tableData.value = [];
+ })
+ .finally(() => {
+ tableLoading.value = false;
+ });
+ };
+ const openTestStandardSheet = () => {
+ console.log("openTestStandardSheet");
+ showTestStandardSheet.value = true;
+ };
+
+ // 鑾峰彇渚涘簲鍟嗗垪琛�
+ const getSuppliers = () => {
+ getOptions().then(res => {
+ supplierList.value = res.data;
+ });
+ };
+
+ // 鑾峰彇浜у搧閫夐」
+ const getProductOptions = () => {
+ return productTreeList().then(res => {
+ productOptions.value = convertIdToValue(res);
+ return productOptions.value;
+ });
+ };
+
+ // 鑾峰彇鐢ㄦ埛鍒楄〃
+ const getUserList = async () => {
+ try {
+ const userRes = await userListNoPage();
+ userList.value = userRes.data || [];
+ } catch (e) {
+ console.error("鍔犺浇妫�楠屽憳鍒楄〃澶辫触", e);
+ userList.value = [];
+ }
+ };
+
+ // 鑾峰彇鍨嬪彿鍒楄〃
+ const getModels = value => {
+ form.value.productModelId = "";
+ form.value.unit = "";
+ modelOptions.value = [];
+ currentProductId.value = value;
+ form.value.productName = findNodeById(productOptions.value, value);
+ modelList({ id: value }).then(res => {
+ modelOptions.value = res;
+ });
+ if (currentProductId.value) {
+ getList();
+ }
+ };
+
+ // 鑾峰彇鎸囨爣鍒楄〃
+ const getList = () => {
+ if (!currentProductId.value) {
+ testStandardOptions.value = [];
+ tableData.value = [];
+ return;
+ }
+ let params = {
+ productId: currentProductId.value,
+ inspectType: 0,
+ };
+ qualityInspectDetailByProductId(params).then(res => {
+ // 淇濆瓨涓嬫媺妗嗛�夐」鏁版嵁
+ testStandardOptions.value = res.data || [];
+ // 娓呯┖琛ㄦ牸鏁版嵁锛岀瓑寰呯敤鎴烽�夋嫨鎸囨爣
+ tableData.value = [];
+ // 娓呯┖鎸囨爣閫夋嫨
+ form.value.testStandardId = "";
+ testStandardDisplay.value = "";
+ });
+ };
+
+ // 鑾峰彇妫�楠屽弬鏁板垪琛紙缂栬緫妯″紡锛�
+ const getQualityInspectParamList = id => {
+ qualityInspectParamInfo(id).then(res => {
+ tableData.value = res.data;
+ });
+ };
+
+ // 鎻愪氦琛ㄥ崟
+ const submitForm = async () => {
+ console.log("submitForm", form.value, tableData.value);
+ try {
+ // await formRef.value.validate();
+ if (!form.value.productModelId) {
+ showToast("璇烽�夋嫨瑙勬牸鍨嬪彿");
+ return;
+ }
+ if (!form.value.supplier) {
+ showToast("璇烽�夋嫨渚涘簲鍟�");
+ return;
+ }
+ if (!form.value.quantity) {
+ showToast("璇疯緭鍏ユ暟閲�");
+ return;
+ }
+ if (!form.value.productId) {
+ showToast("璇烽�夋嫨浜у搧");
+ return;
+ }
+ if (!form.value.checkResult) {
+ showToast("璇烽�夋嫨妫�娴嬬粨鏋�");
+ return;
+ }
+
+ loading.value = true;
+
+ form.value.inspectType = 0;
+ if (isEdit.value) {
+ tableData.value.forEach(item => {
+ delete item.id;
+ });
+ }
+
+ const data = { ...form.value, qualityInspectParams: tableData.value };
+ data.quantity = Number(data.quantity);
+ if (isEdit.value) {
+ const res = await qualityInspectUpdate(data);
+ showToast("淇濆瓨鎴愬姛");
+ setTimeout(() => {
+ uni.navigateBack();
+ }, 1500);
+ } else {
+ const res = await qualityInspectAdd(data);
+ showToast("鎻愪氦鎴愬姛");
+ setTimeout(() => {
+ uni.navigateBack();
+ }, 1500);
+ }
+ } catch (error) {
+ console.error("琛ㄥ崟楠岃瘉澶辫触:", error);
+ showToast("鎻愪氦澶辫触锛岃閲嶈瘯");
+ } finally {
+ loading.value = false;
+ }
+ };
+
+ // 鍒濆鍖栬〃鍗�
+ const initForm = async () => {
+ const id = getPageId();
+ if (id) {
+ // 缂栬緫妯″紡锛屽姞杞芥暟鎹�
+ // 鍏堥噸缃〃鍗曟暟鎹�
+ form.value = {
+ checkTime: dayjs().format("YYYY-MM-DD"),
+ supplier: "",
+ checkName: "",
+ productName: "",
+ productId: "",
+ productModelId: "",
+ model: "",
+ testStandardId: "",
+ unit: "",
+ quantity: "",
+ checkCompany: "",
+ checkResult: "",
+ productMainId: null,
+ purchaseLedgerId: null,
+ };
+ testStandardOptions.value = [];
+ tableData.value = [];
+ // 鍏堢‘淇濅骇鍝佹爲宸插姞杞斤紝鍚﹀垯缂栬緫鏃朵骇鍝�/瑙勬牸鍨嬪彿鏃犳硶鍙嶆樉
+ await getProductOptions();
+ // 浠庢湰鍦板瓨鍌ㄨ幏鍙栫紪杈戞暟鎹�
+ const row = uni.getStorageSync("inspectionEditData") || {
+ id: id,
+ checkTime: "2026-03-03",
+ supplier: "涓婃捣閲戝睘鏉愭枡鏈夐檺鍏徃",
+ checkName: "寮犱笁",
+ productName: "涓嶉攬閽㈡澘鏉�",
+ productId: 1,
+ productModelId: 1,
+ model: "304",
+ testStandardId: "1",
+ unit: "kg",
+ quantity: 1000,
+ checkCompany: "绗笁鏂规娴嬫満鏋�",
+ checkResult: "鍚堟牸",
+ productMainId: null,
+ purchaseLedgerId: null,
+ };
+ // 鍏堜繚瀛� testStandardId锛岄伩鍏嶈娓呯┖
+ const savedTestStandardId = row.testStandardId;
+ form.value = { ...row };
+ currentProductId.value = row.productId || 0;
+ // 鍏抽敭锛氱紪杈戞椂鍔犺浇瑙勬牸鍨嬪彿涓嬫媺閫夐」锛屾墠鑳藉弽鏄� productModelId
+ if (currentProductId.value) {
+ try {
+ const res = await modelList({ id: currentProductId.value });
+ modelOptions.value = res || [];
+ // 鍚屾鍥炲~ model / unit
+ if (form.value.productModelId) {
+ handleChangeModel(form.value.productModelId);
+ }
+ } catch (e) {
+ console.error("鍔犺浇瑙勬牸鍨嬪彿澶辫触", e);
+ modelOptions.value = [];
+ }
+ }
+ // 缂栬緫妯″紡涓嬶紝鍏堝姞杞芥寚鏍囬�夐」锛岀劧鍚庡姞杞藉弬鏁板垪琛�
+ if (currentProductId.value) {
+ // 鍏堝姞杞芥寚鏍囬�夐」
+ let params = {
+ productId: currentProductId.value,
+ inspectType: 0,
+ };
+ qualityInspectDetailByProductId(params).then(res => {
+ testStandardOptions.value = res.data || [];
+ // 浣跨敤 nextTick 纭繚閫夐」宸茬粡娓叉煋
+ nextTick(() => {
+ // 濡傛灉缂栬緫鏁版嵁涓湁 testStandardId锛屽垯璁剧疆骞跺姞杞藉搴旂殑鍙傛暟
+ if (savedTestStandardId) {
+ // 纭繚绫诲瀷鍖归厤
+ const matchedOption = testStandardOptions.value.find(
+ item =>
+ item.id == savedTestStandardId ||
+ String(item.id) === String(savedTestStandardId)
+ );
+ if (matchedOption) {
+ // 纭繚浣跨敤鍖归厤椤圭殑 id
+ form.value.testStandardId = matchedOption.id;
+ testStandardDisplay.value =
+ matchedOption.standardName || matchedOption.standardNo;
+ // 缂栬緫淇濈暀鍘熸楠屽�硷紝鐩存帴鎷夊彇鍘熷弬鏁版暟鎹�
+ getQualityInspectParamList(row.id);
+ } else {
+ // 濡傛灉鎵句笉鍒板尮閰嶉」锛屽皾璇曠洿鎺ヤ娇鐢ㄥ師鍊�
+ console.warn(
+ "鏈壘鍒板尮閰嶇殑鎸囨爣閫夐」锛宼estStandardId:",
+ savedTestStandardId
+ );
+ form.value.testStandardId = savedTestStandardId;
+ getQualityInspectParamList(row.id);
+ }
+ } else {
+ // 鍚﹀垯浣跨敤鏃х殑閫昏緫
+ getQualityInspectParamList(row.id);
+ }
+ });
+ });
+ }
+ // 灞曞紑浜у搧鏍戝埌褰撳墠閫変腑鐨勮妭鐐�
+ expandProductTree(productOptions.value, row.productId);
+ } else {
+ // 鏂板妯″紡锛屽垵濮嬪寲琛ㄥ崟
+ form.value = {
+ checkTime: dayjs().format("YYYY-MM-DD"),
+ supplier: "",
+ checkName: "",
+ productName: "",
+ productId: "",
+ productModelId: "",
+ model: "",
+ testStandardId: "",
+ unit: "",
+ quantity: "",
+ checkCompany: "",
+ checkResult: "",
+ productMainId: null,
+ purchaseLedgerId: null,
+ };
+ }
+ };
+
+ // 灞曞紑浜у搧鏍戝埌鎸囧畾鑺傜偣
+ const expandProductTree = (nodes, targetId) => {
+ for (let i = 0; i < nodes.length; i++) {
+ const node = nodes[i];
+ if (node.value === targetId) {
+ return true; // 鎵惧埌鐩爣鑺傜偣
+ }
+ if (node.children && node.children.length > 0) {
+ const found = expandProductTree(node.children, targetId);
+ if (found) {
+ node.expanded = true; // 灞曞紑鐖惰妭鐐�
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+
+ onMounted(() => {
+ getSuppliers();
+ getProductOptions();
+ getUserList();
+ initForm();
+ });
+
+ onShow(() => {
+ initForm();
+ });
+</script>
+
+<style scoped lang="scss">
+ @import "@/static/scss/form-common.scss";
+
+ .material-inspection-add {
+ min-height: 100vh;
+ background: #f8f9fa;
+ padding-bottom: 100px;
+ }
+
+ // 妫�楠岄」鐩鍣�
+ .inspection-items-container {
+ padding: 20px;
+ background-color: #fff;
+ }
+
+ .steps-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 20px;
+ padding-bottom: 12px;
+ border-bottom: 1px solid #e4e7ed;
+ }
+
+ .steps-title {
+ font-size: 16px;
+ font-weight: 600;
+ color: #303133;
+ }
+
+ .steps-count {
+ font-size: 14px;
+ color: #909399;
+ }
+
+ .steps-list {
+ margin-bottom: 20px;
+ }
+
+ .exec-step-item {
+ position: relative;
+ display: flex;
+ margin-bottom: 16px;
+ padding: 16px;
+ background-color: #ffffff;
+ border: 1px solid #e4e7ed;
+ border-radius: 8px;
+ transition: all 0.3s ease;
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
+ }
+
+ .exec-step-item:hover {
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
+ border-color: #409eff;
+ transform: translateY(-1px);
+ }
+
+ .delete-btn {
+ position: absolute;
+ top: -25rpx;
+ right: -25rpx;
+ width: 50rpx;
+ height: 50rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ text-align: center;
+ font-size: 20px;
+ border-radius: 50%;
+ background-color: red;
+ border: none;
+ z-index: 10;
+ }
+
+ .delete-btn:hover {
+ transform: scale(1.1);
+ box-shadow: 0 3px 6px rgba(245, 108, 108, 0.4);
+ }
+
+ .step-number {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 32px;
+ height: 32px;
+ margin-right: 16px;
+ background-color: #ecf5ff;
+ color: #409eff;
+ font-size: 14px;
+ font-weight: 600;
+ border-radius: 50%;
+ flex-shrink: 0;
+ }
+
+ .step-content {
+ flex: 1;
+ min-width: 0;
+ }
+
+ .step-row {
+ display: flex;
+ align-items: flex-start;
+ margin-bottom: 12px;
+ }
+
+ .step-row:last-child {
+ margin-bottom: 0;
+ }
+
+ .step-label {
+ display: inline-block;
+ width: 80px;
+ font-size: 14px;
+ color: #606266;
+ margin-right: 12px;
+ flex-shrink: 0;
+ line-height: 36px;
+ }
+
+ .step-input {
+ flex: 1;
+ min-width: 0;
+ }
+
+ .step-input input {
+ font-size: 14px;
+ color: #303133;
+ }
+
+ .add-step-btn {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 100%;
+ height: 44px;
+ line-height: 44px;
+ font-size: 14px;
+ border-radius: 8px;
+ transition: all 0.3s ease;
+ gap: 8px;
+ }
+
+ .add-step-btn:hover {
+ transform: translateY(-1px);
+ box-shadow: 0 2px 8px rgba(64, 158, 255, 0.3);
+ }
+
+ .add-step-btn text {
+ font-size: 14px;
+ }
+
+ // 搴曢儴鎸夐挳
+ .bottom-buttons {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ display: flex;
+ padding: 16px 20px;
+ background: #ffffff;
+ border-top: 1px solid #f0f0f0;
+ gap: 16px;
+ }
+
+ .bottom-btn {
+ flex: 1;
+ }
+
+ // 鏍戝舰閫夋嫨鍣ㄦ牱寮�
+ .tree-selector {
+ width: 100%;
+ max-height: 70vh;
+ background: #ffffff;
+ border-radius: 16px 16px 0 0;
+ }
+
+ .tree-header {
+ padding: 16px 20px;
+ border-bottom: 1px solid #f0f0f0;
+ text-align: center;
+ }
+
+ .tree-title {
+ font-size: 16px;
+ font-weight: 600;
+ color: #303133;
+ }
+
+ .tree-content {
+ padding: 10px 0;
+ max-height: calc(70vh - 60px);
+ overflow-y: auto;
+ }
+
+ .tree-node {
+ padding: 0 20px;
+ }
+
+ .tree-node-header {
+ display: flex;
+ align-items: center;
+ padding: 12px 0;
+ cursor: pointer;
+ }
+
+ .tree-node-icon {
+ width: 20px;
+ height: 20px;
+ margin-right: 8px;
+ color: #909399;
+ }
+
+ .tree-node-icon-placeholder {
+ width: 20px;
+ height: 20px;
+ margin-right: 8px;
+ }
+
+ .tree-node-label {
+ flex: 1;
+ font-size: 14px;
+ color: #303133;
+ }
+
+ .tree-node-check {
+ width: 20px;
+ height: 20px;
+ color: #409eff;
+ }
+
+ .tree-node-children {
+ margin-left: 28px;
+ }
+</style>
diff --git a/src/pages/qualityManagement/materialInspection/detail.vue b/src/pages/qualityManagement/materialInspection/detail.vue
new file mode 100644
index 0000000..7bd3443
--- /dev/null
+++ b/src/pages/qualityManagement/materialInspection/detail.vue
@@ -0,0 +1,526 @@
+<template>
+ <view class="material-inspection-detail">
+ <!-- 浣跨敤閫氱敤椤甸潰澶撮儴缁勪欢 -->
+ <PageHeader title="鍘熸潗鏂欐楠岃鎯�"
+ @back="goBack" />
+ <!-- 璇︽儏鍐呭 -->
+ <view class="detail-section"
+ v-if="detailData">
+ <view class="detail-card">
+ <view class="card-header">
+ <view class="header-icon">
+ <up-icon name="file-text"
+ size="20"
+ color="#ffffff"></up-icon>
+ </view>
+ <text class="header-title">{{ detailData.productName || '-' }}</text>
+ <view class="status-tags">
+ <u-tag :type="getTagType(detailData.checkResult)"
+ size="small"
+ class="status-tag">
+ {{ detailData.checkResult || '-' }}
+ </u-tag>
+ <u-tag :type="getStateTagType(detailData.inspectState)"
+ size="small"
+ class="status-tag">
+ {{ detailData.inspectState ? '宸叉彁浜�' : '鏈彁浜�' }}
+ </u-tag>
+ </view>
+ </view>
+ <up-divider></up-divider>
+ <view class="detail-content">
+ <view class="detail-row">
+ <text class="detail-label">妫�娴嬫棩鏈�</text>
+ <text class="detail-value">{{ formatDateTime(detailData.checkTime) || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">閲囪喘璁㈠崟鍙�</text>
+ <text class="detail-value">{{ detailData.purchaseContractNo || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">渚涘簲鍟�</text>
+ <text class="detail-value">{{ detailData.supplier || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">妫�楠屽憳</text>
+ <text class="detail-value">{{ detailData.checkName || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">浜у搧鍚嶇О</text>
+ <text class="detail-value">{{ detailData.productName || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">瑙勬牸鍨嬪彿</text>
+ <text class="detail-value">{{ detailData.model || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">鍗曚綅</text>
+ <text class="detail-value">{{ detailData.unit || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">鏁伴噺</text>
+ <text class="detail-value">{{ detailData.quantity || 0 }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">妫�娴嬪崟浣�</text>
+ <text class="detail-value">{{ detailData.checkCompany || '-' }}</text>
+ </view>
+ <!-- <view class="detail-row">
+ <text class="detail-label">妫�楠屾爣鍑�</text>
+ <text class="detail-value">{{ detailData.testStandardName || '-' }}</text>
+ </view> -->
+ </view>
+ </view>
+ <!-- 妫�楠岄」鐩� -->
+ <view class="detail-card"
+ v-if="inspectionItems.length > 0">
+ <view class="card-header">
+ <view class="header-icon secondary">
+ <up-icon name="list"
+ size="20"
+ color="#ffffff"></up-icon>
+ </view>
+ <text class="header-title">妫�楠岄」鐩�</text>
+ </view>
+ <up-divider></up-divider>
+ <view class="inspection-items">
+ <view v-for="(item, index) in inspectionItems"
+ :key="index"
+ class="inspection-item">
+ <text class="item-name">{{ item.parameterItem || '妫�楠岄」鐩�' }}</text>
+ <view class="item-details">
+ <view class="item-detail-row">
+ <text class="item-detail-label">鍗曚綅:</text>
+ <text class="item-detail-value">{{ item.unit || '-' }}</text>
+ </view>
+ <view class="item-detail-row">
+ <text class="item-detail-label">鏍囧噯鍊�:</text>
+ <text class="item-detail-value">{{ item.standardValue || '-' }}</text>
+ </view>
+ <view class="item-detail-row">
+ <text class="item-detail-label">鍐呮帶鍊�:</text>
+ <text class="item-detail-value">{{ item.controlValue || '-' }}</text>
+ </view>
+ <view class="item-detail-row">
+ <text class="item-detail-label">妫�楠屽��:</text>
+ <text class="item-detail-value result"
+ :class="getResultClass(item.testValue, item.standardValue)">
+ {{ item.testValue || '-' }}
+ </text>
+ </view>
+ </view>
+ </view>
+ </view>
+ </view>
+ <!-- 鎿嶄綔鎸夐挳 -->
+ <!-- <view class="action-buttons">
+ <u-button type="primary"
+ class="action-btn"
+ @click="downloadReport">
+ 涓嬭浇鎶ュ憡
+ </u-button>
+ </view> -->
+ </view>
+ <view v-else
+ class="no-data">
+ <up-empty mode="data"
+ text="鏆傛棤妫�楠岃鎯�"></up-empty>
+ </view>
+ </view>
+</template>
+
+<script setup>
+ import { ref, onMounted } from "vue";
+ import { onShow } from "@dcloudio/uni-app";
+ import PageHeader from "@/components/PageHeader.vue";
+ import dayjs from "dayjs";
+ import { qualityInspectParamInfo } from "@/api/qualityManagement/materialInspection.js";
+
+ // 鏄剧ず鎻愮ず淇℃伅
+ const showToast = message => {
+ uni.showToast({
+ title: message,
+ icon: "none",
+ });
+ };
+
+ // 璇︽儏鏁版嵁
+ const detailData = ref(null);
+ // 妫�楠岄」鐩�
+ const inspectionItems = ref([]);
+
+ // 杩斿洖涓婁竴椤�
+ const goBack = () => {
+ uni.navigateBack();
+ };
+
+ // 鏍煎紡鍖栨棩鏈熸椂闂�
+ const formatDateTime = date => {
+ if (!date) return "";
+ return dayjs(date).format("YYYY-MM-DD");
+ };
+
+ // 鑾峰彇鏍囩绫诲瀷
+ const getTagType = result => {
+ switch (result) {
+ case "鍚堟牸":
+ return "success";
+ case "涓嶅悎鏍�":
+ return "error";
+ default:
+ return "info";
+ }
+ };
+
+ // 鑾峰彇鐘舵�佹爣绛剧被鍨�
+ const getStateTagType = state => {
+ return state ? "success" : "warning";
+ };
+
+ // 鑾峰彇缁撴灉鏍峰紡
+ const getResultClass = (testValue, standardValue) => {
+ // 绠�鍗曠殑缁撴灉鍒ゆ柇閫昏緫锛屽疄闄呴」鐩腑鍙兘闇�瑕佹洿澶嶆潅鐨勫垽鏂�
+ if (testValue === "鍚堟牸") {
+ return "result-passed";
+ } else if (testValue === "涓嶅悎鏍�") {
+ return "result-rejected";
+ }
+ return "";
+ };
+
+ // 涓嬭浇鎶ュ憡
+ const downloadReport = () => {
+ uni.showToast({
+ title: "鎶ュ憡涓嬭浇涓�...",
+ icon: "loading",
+ });
+
+ // 妯℃嫙涓嬭浇
+ setTimeout(() => {
+ uni.showToast({
+ title: "鎶ュ憡涓嬭浇鎴愬姛",
+ icon: "success",
+ });
+ }, 1500);
+ };
+
+ // 鑾峰彇椤甸潰ID
+ const getPageId = () => {
+ const pages = getCurrentPages();
+ const currentPage = pages[pages.length - 1];
+ return currentPage.options.id;
+ };
+
+ // 鑾峰彇璇︽儏鏁版嵁
+ const getDetail = () => {
+ const id = getPageId();
+ if (!id) {
+ showToast("鍙傛暟閿欒");
+ return;
+ }
+
+ // 浠庢湰鍦板瓨鍌ㄨ幏鍙栬鎯呮暟鎹�
+ try {
+ const detailDataFromStorage = uni.getStorageSync("inspectionEditData");
+ if (detailDataFromStorage) {
+ detailData.value = detailDataFromStorage;
+ // 浣跨敤qualityInspectParamInfo鑾峰彇妫�楠岄」鐩�
+ qualityInspectParamInfo(id)
+ .then(res => {
+ if (res.data && res.data.length > 0) {
+ inspectionItems.value = res.data;
+ } else if (
+ detailDataFromStorage.qualityInspectParams &&
+ detailDataFromStorage.qualityInspectParams.length > 0
+ ) {
+ // 濡傛灉鎺ュ彛娌℃湁杩斿洖鏁版嵁锛屼娇鐢ㄦ湰鍦板瓨鍌ㄤ腑鐨勬暟鎹�
+ inspectionItems.value = detailDataFromStorage.qualityInspectParams;
+ } else {
+ // 妯℃嫙妫�楠岄」鐩�
+ inspectionItems.value = [
+ {
+ parameterItem: "鍘氬害",
+ unit: "mm",
+ standardValue: "2.0 卤 0.1",
+ controlValue: "2.0 卤 0.05",
+ testValue: "2.05",
+ },
+ {
+ parameterItem: "纭害",
+ unit: "HB",
+ standardValue: "鈮� 200",
+ controlValue: "鈮� 210",
+ testValue: "220",
+ },
+ {
+ parameterItem: "琛ㄩ潰璐ㄩ噺",
+ unit: "",
+ standardValue: "鏃犲垝鐥曘�佹棤閿堣殌",
+ controlValue: "鏃犲垝鐥曘�佹棤閿堣殌",
+ testValue: "鍚堟牸",
+ },
+ ];
+ }
+ })
+ .catch(error => {
+ console.error("鑾峰彇妫�楠岄」鐩け璐�:", error);
+ // 鎺ュ彛璋冪敤澶辫触鏃讹紝浣跨敤鏈湴瀛樺偍涓殑鏁版嵁鎴栨ā鎷熸暟鎹�
+ if (
+ detailDataFromStorage.qualityInspectParams &&
+ detailDataFromStorage.qualityInspectParams.length > 0
+ ) {
+ inspectionItems.value = detailDataFromStorage.qualityInspectParams;
+ }
+ });
+ } else {
+ // 妯℃嫙鏁版嵁
+ detailData.value = {
+ id: id,
+ checkTime: "2026-03-03",
+ purchaseContractNo: "PO20260303001",
+ supplier: "涓婃捣閲戝睘鏉愭枡鏈夐檺鍏徃",
+ checkName: "寮犱笁",
+ productName: "涓嶉攬閽㈡澘鏉�",
+ model: "304",
+ unit: "kg",
+ quantity: 1000,
+ checkCompany: "绗笁鏂规娴嬫満鏋�",
+ checkResult: "鍚堟牸",
+ inspectState: true,
+ };
+
+ // 妯℃嫙妫�楠岄」鐩�
+ inspectionItems.value = [
+ {
+ parameterItem: "鍘氬害",
+ unit: "mm",
+ standardValue: "2.0 卤 0.1",
+ controlValue: "2.0 卤 0.05",
+ testValue: "2.05",
+ },
+ {
+ parameterItem: "纭害",
+ unit: "HB",
+ standardValue: "鈮� 200",
+ controlValue: "鈮� 210",
+ testValue: "220",
+ },
+ {
+ parameterItem: "琛ㄩ潰璐ㄩ噺",
+ unit: "",
+ standardValue: "鏃犲垝鐥曘�佹棤閿堣殌",
+ controlValue: "鏃犲垝鐥曘�佹棤閿堣殌",
+ testValue: "鍚堟牸",
+ },
+ ];
+ }
+ } catch (error) {
+ console.error("鍔犺浇璇︽儏鏁版嵁澶辫触:", error);
+ showToast("鍔犺浇璇︽儏鏁版嵁澶辫触锛岃閲嶈瘯");
+ // 鍔犺浇澶辫触鏃朵娇鐢ㄦā鎷熸暟鎹�
+ detailData.value = {
+ id: id,
+ checkTime: "2026-03-03",
+ purchaseContractNo: "PO20260303001",
+ supplier: "涓婃捣閲戝睘鏉愭枡鏈夐檺鍏徃",
+ checkName: "寮犱笁",
+ productName: "涓嶉攬閽㈡澘鏉�",
+ model: "304",
+ unit: "kg",
+ quantity: 1000,
+ checkCompany: "绗笁鏂规娴嬫満鏋�",
+ checkResult: "鍚堟牸",
+ inspectState: true,
+ };
+
+ inspectionItems.value = [
+ {
+ parameterItem: "鍘氬害",
+ unit: "mm",
+ standardValue: "2.0 卤 0.1",
+ controlValue: "2.0 卤 0.05",
+ testValue: "2.05",
+ },
+ {
+ parameterItem: "纭害",
+ unit: "HB",
+ standardValue: "鈮� 200",
+ controlValue: "鈮� 210",
+ testValue: "220",
+ },
+ {
+ parameterItem: "琛ㄩ潰璐ㄩ噺",
+ unit: "",
+ standardValue: "鏃犲垝鐥曘�佹棤閿堣殌",
+ controlValue: "鏃犲垝鐥曘�佹棤閿堣殌",
+ testValue: "鍚堟牸",
+ },
+ ];
+ }
+ };
+
+ onShow(() => {
+ getDetail();
+ });
+
+ onMounted(() => {
+ getDetail();
+ });
+</script>
+
+<style scoped lang="scss">
+ .material-inspection-detail {
+ min-height: 100vh;
+ background: #f5f5f5;
+ padding-bottom: 20px;
+ }
+
+ .detail-section {
+ padding: 15px;
+ }
+
+ .detail-card {
+ background: #fff;
+ border-radius: 12px;
+ padding: 16px;
+ margin-bottom: 12px;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
+ }
+
+ .card-header {
+ display: flex;
+ align-items: center;
+ margin-bottom: 12px;
+ }
+
+ .header-icon {
+ width: 40px;
+ height: 40px;
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
+ border-radius: 8px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-right: 12px;
+ }
+
+ .header-icon.secondary {
+ background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
+ }
+
+ .header-icon.tertiary {
+ background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
+ }
+
+ .header-title {
+ flex: 1;
+ font-size: 16px;
+ font-weight: 600;
+ color: #333;
+ }
+
+ .status-tag {
+ margin-left: 20rpx;
+ }
+
+ .detail-content {
+ padding-top: 8px;
+ }
+
+ .detail-row {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 10px 0;
+ border-bottom: 1px solid #f0f0f0;
+ }
+
+ .detail-row:last-child {
+ border-bottom: none;
+ }
+
+ .detail-label {
+ font-size: 14px;
+ color: #666;
+ min-width: 100px;
+ }
+
+ .detail-value {
+ font-size: 14px;
+ color: #333;
+ text-align: right;
+ flex: 1;
+ }
+
+ // 妫�楠岄」鐩�
+ .inspection-items {
+ padding-top: 8px;
+ }
+
+ .inspection-item {
+ padding: 12px;
+ background: #f8f9fa;
+ border-radius: 8px;
+ margin-bottom: 10px;
+ }
+
+ .inspection-item:last-child {
+ margin-bottom: 0;
+ }
+
+ .item-name {
+ display: block;
+ font-size: 14px;
+ font-weight: 500;
+ color: #333;
+ margin-bottom: 8px;
+ padding-bottom: 8px;
+ border-bottom: 1px solid #f0f0f0;
+ }
+
+ .item-details {
+ padding-top: 8px;
+ }
+
+ .item-detail-row {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 6px;
+ }
+
+ .item-detail-row:last-child {
+ margin-bottom: 0;
+ }
+
+ .item-detail-label {
+ font-size: 12px;
+ color: #666;
+ min-width: 60px;
+ }
+
+ .item-detail-value {
+ font-size: 12px;
+ color: #333;
+ text-align: right;
+ flex: 1;
+ }
+
+ .item-detail-value.result {
+ font-weight: 500;
+ }
+
+ .result-passed {
+ color: #67c23a;
+ }
+
+ .result-rejected {
+ color: #f56c6c;
+ }
+
+ // 绌虹姸鎬�
+ .no-data {
+ padding: 60px 20px;
+ text-align: center;
+ }
+</style>
diff --git a/src/pages/qualityManagement/materialInspection/fileList.vue b/src/pages/qualityManagement/materialInspection/fileList.vue
new file mode 100644
index 0000000..126158d
--- /dev/null
+++ b/src/pages/qualityManagement/materialInspection/fileList.vue
@@ -0,0 +1,566 @@
+<template>
+ <view class="file-list-page">
+ <!-- 椤甸潰澶撮儴 -->
+ <PageHeader title="闄勪欢绠$悊"
+ @back="goBack" />
+ <!-- 闄勪欢鍒楄〃 -->
+ <view class="file-list-container">
+ <view v-if="fileList.length > 0"
+ class="file-list">
+ <view v-for="(file, index) in fileList"
+ :key="file.id || index"
+ class="file-item">
+ <!-- 鏂囦欢鍥炬爣 -->
+ <!-- <view class="file-icon"
+ :class="getFileIconClass(file.fileType)">
+ <up-icon :name="getFileIcon(file.fileType)"
+ size="24"
+ color="#ffffff" />
+ </view> -->
+ <!-- 鏂囦欢淇℃伅 -->
+ <view class="file-info">
+ <text class="file-name">{{ file.name }}</text>
+ <!-- <text class="file-meta">{{ formatFileSize(file.fileSize) }} 路 {{ file.uploadTime || file.createTime }}</text> -->
+ </view>
+ <!-- 鎿嶄綔鎸夐挳 -->
+ <view class="file-actions">
+ <!-- <u-button size="small"
+ type="primary"
+ plain
+ @click="previewFile(file)">棰勮</u-button> -->
+ <u-button size="small"
+ type="info"
+ plain
+ @click="downloadFile(file)">涓嬭浇骞堕瑙�</u-button>
+ <u-button size="small"
+ type="error"
+ plain
+ @click="confirmDelete(file, index)">鍒犻櫎</u-button>
+ </view>
+ </view>
+ </view>
+ <!-- 绌虹姸鎬� -->
+ <view v-else
+ class="empty-state">
+ <up-icon name="document"
+ size="64"
+ color="#c0c4cc" />
+ <text class="empty-text">鏆傛棤闄勪欢</text>
+ </view>
+ </view>
+ <!-- <a rel="nofollow"
+ id="downloadLink"
+ href="#"
+ style="display:none;">涓嬭浇鏂囨湰鏂囦欢</a> -->
+ <!-- 涓婁紶鎸夐挳 -->
+ <view class="upload-button"
+ @click="chooseFile">
+ <up-icon name="plus"
+ size="24"
+ color="#ffffff" />
+ <text class="upload-text">涓婁紶闄勪欢</text>
+ </view>
+ </view>
+</template>
+
+<script setup>
+ import { ref, onMounted } from "vue";
+ import PageHeader from "@/components/PageHeader.vue";
+ import config from "@/config";
+ import { getToken } from "@/utils/auth";
+ // import { saveAs } from "file-saver";
+ import {
+ listRuleFiles,
+ delRuleFile,
+ } from "@/api/managementMeetings/rulesRegulationsManagement";
+ import {
+ qualityInspectFileAdd,
+ qualityInspectFileListPage,
+ qualityInspectFileDel,
+ } from "@/api/qualityManagement/materialInspection";
+ import { blobValidate } from "@/utils/ruoyi";
+
+ // 闄勪欢鍒楄〃
+ const fileList = ref([]);
+
+ // 杩斿洖涓婁竴椤�
+ const goBack = () => {
+ uni.navigateBack();
+ };
+ // const request = axios.create({
+ // baseURL: "URL.com",
+ // adapter: axiosAdapterUniapp,
+ // });
+ // 鑾峰彇鏂囦欢鍥炬爣
+ const getFileIcon = fileType => {
+ const iconMap = {
+ doc: "document",
+ docx: "document",
+ xls: "grid",
+ xlsx: "grid",
+ pdf: "document",
+ ppt: "copy",
+ pptx: "copy",
+ txt: "document",
+ jpg: "image",
+ jpeg: "image",
+ png: "image",
+ gif: "image",
+ zip: "folder",
+ rar: "folder",
+ };
+ return iconMap[fileType.toLowerCase()] || "document";
+ };
+
+ // 鑾峰彇鏂囦欢鍥炬爣鏍峰紡绫�
+ const getFileIconClass = fileType => {
+ const colorMap = {
+ doc: "blue",
+ docx: "blue",
+ xls: "green",
+ xlsx: "green",
+ pdf: "red",
+ ppt: "orange",
+ pptx: "orange",
+ txt: "gray",
+ jpg: "purple",
+ jpeg: "purple",
+ png: "purple",
+ gif: "purple",
+ zip: "yellow",
+ rar: "yellow",
+ };
+ return colorMap[fileType.toLowerCase()] || "gray";
+ };
+
+ // 鏍煎紡鍖栨枃浠跺ぇ灏�
+ const formatFileSize = bytes => {
+ if (bytes === 0) return "0 B";
+ const k = 1024;
+ const sizes = ["B", "KB", "MB", "GB"];
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
+ };
+
+ // 閫夋嫨鏂囦欢
+ const chooseFile = () => {
+ uni.chooseImage({
+ count: 9,
+ sizeType: ["original", "compressed"],
+ sourceType: ["album", "camera"],
+ success: res => {
+ console.log(res, "閫夋嫨鍥剧墖鎴愬姛");
+ uploadFiles(res.tempFiles);
+ },
+ fail: err => {
+ console.error("閫夋嫨鍥剧墖澶辫触:", err);
+ showToast("閫夋嫨鏂囦欢澶辫触");
+ },
+ });
+ // uni.chooseFile({
+ // count: 9,
+ // extension: [
+ // ".doc",
+ // ".docx",
+ // ".xls",
+ // ".xlsx",
+ // ".pdf",
+ // ".ppt",
+ // ".pptx",
+ // ".txt",
+ // ".jpg",
+ // ".jpeg",
+ // ".png",
+ // ".gif",
+ // ".zip",
+ // ".rar",
+ // ],
+ // success: res => {
+ // console.log(res, "閫夋嫨鏂囦欢鎴愬姛");
+ // uploadFiles(res.tempFiles);
+ // },
+ // fail: err => {
+ // showToast("閫夋嫨鏂囦欢澶辫触");
+ // },
+ // });
+ };
+
+ // 涓婁紶鏂囦欢
+ const uploadFiles = tempFiles => {
+ console.log(tempFiles, "涓婁紶鏂囦欢1");
+ tempFiles.forEach((tempFile, index) => {
+ // 鏄剧ず涓婁紶涓彁绀�
+ uni.showLoading({
+ title: "涓婁紶涓�...",
+ mask: true,
+ });
+ console.log(tempFile, "涓婁紶鏂囦欢2");
+ // 1. 鐩存帴浣跨敤 uni.uploadFile 涓婁紶鏂囦欢
+ uni.uploadFile({
+ url: config.baseUrl + "/file/upload",
+ filePath: tempFile.path,
+ name: "file",
+ header: {
+ Authorization: "Bearer " + getToken(),
+ },
+ success: uploadRes => {
+ uni.hideLoading();
+ console.log(uploadRes, "涓婁紶鏂囦欢3");
+
+ try {
+ const res = JSON.parse(uploadRes.data);
+ console.log(res, "涓婁紶鏂囦欢4");
+ if (res.code === 200) {
+ // 2. 鎻愬彇鏂囦欢淇℃伅
+ const fileName = tempFile.name
+ ? tempFile.name
+ : tempFile.path.split("/").pop();
+ // const fileType = fileName.split(".").pop();
+ // 3. 鏋勯�犱繚瀛樻枃浠朵俊鎭殑鍙傛暟
+ const saveData = {
+ name: fileName,
+ inspectId: rulesRegulationsManagementId.value,
+ url: res.data.tempPath || "",
+ };
+ console.log(saveData, "淇濆瓨鏂囦欢淇℃伅鍙傛暟");
+ // 4. 璋冪敤 addRuleFile 鎺ュ彛淇濆瓨鏂囦欢淇℃伅
+ qualityInspectFileAdd(saveData)
+ .then(addRes => {
+ if (addRes.code === 200) {
+ // 5. 娣诲姞鍒版枃浠跺垪琛�
+ const newFile = {
+ ...addRes.data,
+ uploadTime: new Date().toLocaleString(),
+ };
+ // fileList.value.push(newFile);
+ getFileList();
+ showToast("涓婁紶鎴愬姛");
+ } else {
+ showToast("淇濆瓨鏂囦欢淇℃伅澶辫触");
+ }
+ })
+ .catch(err => {
+ console.error("淇濆瓨鏂囦欢淇℃伅澶辫触:", err);
+ showToast("淇濆瓨鏂囦欢淇℃伅澶辫触");
+ });
+ } else {
+ showToast("鏂囦欢涓婁紶澶辫触");
+ }
+ } catch (e) {
+ console.error("瑙f瀽涓婁紶缁撴灉澶辫触:", e);
+ showToast("涓婁紶澶辫触");
+ }
+ },
+ fail: err => {
+ uni.hideLoading();
+ console.error("涓婁紶澶辫触:", err);
+ showToast("涓婁紶澶辫触");
+ },
+ });
+ });
+ };
+ // 涓嬭浇鏂囦欢
+ const downloadFile = file => {
+ var url =
+ config.baseUrl +
+ "/common/download?fileName=" +
+ encodeURIComponent(file.url) +
+ "&delete=true";
+ console.log(url, "url");
+
+ uni
+ .downloadFile({
+ url: url,
+ responseType: "blob",
+ header: { Authorization: "Bearer " + getToken() },
+ })
+ .then(res => {
+ let osType = uni.getStorageSync("deviceInfo").osName;
+ let filePath = res.tempFilePath;
+ if (osType === "ios") {
+ uni.openDocument({
+ filePath: filePath,
+ showMenu: true,
+ success: res => {
+ resolve(res);
+ },
+ fail: err => {
+ console.log("uni.openDocument--fail");
+ reject(err);
+ },
+ });
+ } else {
+ uni.saveFile({
+ tempFilePath: filePath,
+ success: fileRes => {
+ uni.showToast({
+ icon: "none",
+ mask: true,
+ title:
+ "鏂囦欢宸蹭繚瀛橈細Android/data/uni.UNI720216F/apps/__UNI__720216F/" +
+ fileRes.savedFilePath, //淇濆瓨璺緞
+ duration: 3000,
+ });
+ setTimeout(() => {
+ //鎵撳紑鏂囨。鏌ョ湅
+ uni.openDocument({
+ filePath: fileRes.savedFilePath,
+ success: function (res) {
+ resolve(fileRes);
+ },
+ });
+ }, 3000);
+ },
+ fail: err => {
+ console.log("uni.save--fail");
+ reject(err);
+ },
+ });
+ }
+ // const isBlob = blobValidate(res.data);
+ // if (isBlob) {
+ // const blob = new Blob([res.data], { type: "text/plain" });
+ // const url = URL.createObjectURL(blob);
+ // const downloadLink = document.getElementById("downloadLink");
+ // downloadLink.href = url;
+ // downloadLink.download = file.name;
+ // downloadLink.click();
+ // showToast("涓嬭浇鎴愬姛");
+ // } else {
+ // showToast("涓嬭浇澶辫触");
+ // }
+ })
+ .catch(err => {
+ console.error("涓嬭浇澶辫触:", err);
+ showToast("涓嬭浇澶辫触");
+ });
+ };
+
+ // 纭鍒犻櫎
+ const confirmDelete = (file, index) => {
+ uni.showModal({
+ title: "鍒犻櫎纭",
+ content: `纭畾瑕佸垹闄ら檮浠� "${file.name}" 鍚楋紵`,
+ success: res => {
+ if (res.confirm) {
+ deleteFile(file.id, index);
+ }
+ },
+ });
+ };
+
+ // 鍒犻櫎鏂囦欢
+ const deleteFile = (fileId, index) => {
+ uni.showLoading({
+ title: "鍒犻櫎涓�...",
+ mask: true,
+ });
+
+ qualityInspectFileDel([fileId])
+ .then(res => {
+ uni.hideLoading();
+ if (res.code === 200) {
+ // fileList.value.splice(index, 1);
+ getFileList();
+ showToast("鍒犻櫎鎴愬姛");
+ } else {
+ showToast("鍒犻櫎澶辫触");
+ }
+ })
+ .catch(err => {
+ uni.hideLoading();
+ showToast("鍒犻櫎澶辫触");
+ });
+ };
+
+ // 鏄剧ず鎻愮ず
+ const showToast = message => {
+ uni.showToast({
+ title: message,
+ icon: "none",
+ });
+ };
+ const rulesRegulationsManagementId = ref("");
+ // 椤甸潰鍔犺浇鏃�
+ onMounted(() => {
+ rulesRegulationsManagementId.value = uni.getStorageSync(
+ "qualityInspectFileId"
+ );
+ // 浠� API 鑾峰彇闄勪欢鍒楄〃
+ getFileList();
+ // 浠庢湰鍦板瓨鍌ㄨ幏鍙� rulesRegulationsManagementId
+ });
+
+ // 鑾峰彇闄勪欢鍒楄〃
+ const getFileList = () => {
+ uni.showLoading({
+ title: "鍔犺浇涓�...",
+ mask: true,
+ });
+
+ qualityInspectFileListPage({
+ inspectId: rulesRegulationsManagementId.value,
+ current: -1,
+ size: -1,
+ })
+ .then(res => {
+ uni.hideLoading();
+ if (res.code === 200) {
+ fileList.value = res.data.records || [];
+ } else {
+ showToast("鑾峰彇闄勪欢鍒楄〃澶辫触");
+ }
+ })
+ .catch(err => {
+ uni.hideLoading();
+ showToast("鑾峰彇闄勪欢鍒楄〃澶辫触");
+ });
+ };
+</script>
+
+<style scoped lang="scss">
+ @import "../../../styles/sales-common.scss";
+
+ .file-list-page {
+ min-height: 100vh;
+ background: #f8f9fa;
+ padding-bottom: 100rpx;
+ }
+
+ .file-list-container {
+ padding: 20rpx;
+ }
+
+ .file-list {
+ background: #ffffff;
+ border-radius: 8rpx;
+ overflow: hidden;
+ box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
+ }
+
+ .file-item {
+ display: flex;
+ align-items: center;
+ padding: 20rpx;
+ border-bottom: 1rpx solid #f0f0f0;
+
+ &:last-child {
+ border-bottom: none;
+ }
+ }
+
+ .file-icon {
+ width: 56rpx;
+ height: 56rpx;
+ border-radius: 8rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ margin-right: 20rpx;
+
+ &.blue {
+ background: #409eff;
+ }
+
+ &.green {
+ background: #67c23a;
+ }
+
+ &.red {
+ background: #f56c6c;
+ }
+
+ &.orange {
+ background: #e6a23c;
+ }
+
+ &.gray {
+ background: #909399;
+ }
+
+ &.purple {
+ background: #909399;
+ }
+
+ &.yellow {
+ background: #e6a23c;
+ }
+ }
+
+ .file-info {
+ flex: 1;
+ min-width: 0;
+ }
+
+ .file-name {
+ display: block;
+ font-size: 16px;
+ color: #303133;
+ margin-bottom: 8rpx;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ .file-meta {
+ display: block;
+ font-size: 12px;
+ color: #909399;
+ }
+
+ .file-actions {
+ display: flex;
+ gap: 12rpx;
+ }
+
+ .empty-state {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: 100rpx 0;
+ background: #ffffff;
+ border-radius: 8rpx;
+ box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
+ }
+
+ .empty-text {
+ font-size: 14px;
+ color: #909399;
+ margin-top: 20rpx;
+ }
+
+ .upload-button {
+ position: fixed;
+ bottom: 40rpx;
+ right: 40rpx;
+ width: 130rpx;
+ height: 130rpx;
+ border-radius: 50%;
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ box-shadow: 0 4rpx 16rpx rgba(102, 126, 234, 0.4);
+ z-index: 1000;
+ }
+
+ .upload-text {
+ font-size: 10px;
+ color: #ffffff;
+ margin-top: 4rpx;
+ }
+
+ .upload-progress {
+ padding: 40rpx 0;
+ }
+
+ .upload-progress-text {
+ display: block;
+ text-align: center;
+ margin-top: 20rpx;
+ font-size: 14px;
+ color: #606266;
+ }
+</style>
\ No newline at end of file
diff --git a/src/pages/qualityManagement/materialInspection/index.vue b/src/pages/qualityManagement/materialInspection/index.vue
new file mode 100644
index 0000000..c575493
--- /dev/null
+++ b/src/pages/qualityManagement/materialInspection/index.vue
@@ -0,0 +1,814 @@
+<template>
+ <view class="material-inspection-page">
+ <!-- 浣跨敤閫氱敤椤甸潰澶撮儴缁勪欢 -->
+ <PageHeader title="鍘熸潗鏂欐楠�"
+ @back="goBack" />
+ <!-- 鎼滅储鍖哄煙 -->
+ <view class="search-section">
+ <view class="search-bar">
+ <view class="search-input">
+ <up-input class="search-text"
+ placeholder="璇疯緭鍏ヤ緵搴斿晢鎼滅储"
+ v-model="searchForm.supplier"
+ @change="getList"
+ clearable />
+ </view>
+ <!-- <view class="filter-button"
+ @click="showDatePicker">
+ <up-icon name="calendar"
+ size="24"
+ color="#999"></up-icon>
+ </view> -->
+ <view class="filter-button"
+ @click="getList">
+ <up-icon name="search"
+ size="24"
+ color="#999"></up-icon>
+ </view>
+ </view>
+ <!-- 鏃ユ湡閫夋嫨 -->
+ <!-- <view class="date-range"
+ v-if="searchForm.entryDate">
+ <text class="date-text">{{ searchForm.entryDate[0] }} 鑷� {{ searchForm.entryDate[1] }}</text>
+ <up-icon name="close"
+ size="16"
+ color="#999"
+ @click="clearDateRange"></up-icon>
+ </view> -->
+ </view>
+ <!-- 缁熻淇℃伅鍗$墖 -->
+ <!-- <view class="stats-cards">
+ <view class="stat-card">
+ <text class="stat-number">{{ totalCount }}</text>
+ <text class="stat-label">鎬绘楠�</text>
+ </view>
+ <view class="stat-card">
+ <text class="stat-number">{{ submittedCount }}</text>
+ <text class="stat-label">宸叉彁浜�</text>
+ </view>
+ <view class="stat-card">
+ <text class="stat-number">{{ pendingCount }}</text>
+ <text class="stat-label">寰呮彁浜�</text>
+ </view>
+ <view class="stat-card">
+ <text class="stat-number">{{ qualifiedCount }}</text>
+ <text class="stat-label">宸插悎鏍�</text>
+ </view>
+ </view> -->
+ <!-- 妫�楠屽垪琛� -->
+ <view class="inspection-list"
+ v-if="inspectionList.length > 0">
+ <view v-for="(item, index) in inspectionList"
+ :key="index">
+ <view class="inspection-item"
+ @click="viewDetail(item)">
+ <view class="item-header">
+ <view class="item-left">
+ <!-- <view class="material-icon"
+ :class="getStateClass(item.inspectState)">
+ <up-icon :name="getStateIcon(item.inspectState)"
+ size="16"
+ color="#ffffff"></up-icon>
+ </view> -->
+ <view class="material-info">
+ <text class="material-name">{{ item.productName }}</text>
+ <text class="material-code">{{ item.model }}</text>
+ </view>
+ </view>
+ <view class="status-tags">
+ <u-tag :type="getTagType(item.checkResult)"
+ size="mini"
+ class="status-tag">
+ {{ item.checkResult }}
+ </u-tag>
+ <u-tag :type="getStateTagType(item.inspectState)"
+ size="mini"
+ class="status-tag">
+ {{ item.inspectState ? '宸叉彁浜�' : '鏈彁浜�' }}
+ </u-tag>
+ </view>
+ </view>
+ <up-divider></up-divider>
+ <view class="item-details">
+ <view class="detail-row">
+ <text class="detail-label">妫�娴嬫棩鏈�</text>
+ <text class="detail-value">{{ formatDateTime(item.checkTime) || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">閲囪喘璁㈠崟鍙�</text>
+ <text class="detail-value">{{ item.purchaseContractNo || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">渚涘簲鍟�</text>
+ <text class="detail-value">{{ item.supplier || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">妫�楠屽憳</text>
+ <text class="detail-value">{{ item.checkName || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">鏁伴噺</text>
+ <text class="detail-value">{{ item.quantity || 0 }} {{ item.unit || '' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">妫�娴嬪崟浣�</text>
+ <text class="detail-value">{{ item.checkCompany || '-' }}</text>
+ </view>
+ </view>
+ <!-- 鎿嶄綔鎸夐挳 -->
+ <view class="action-buttons">
+ <u-button type="primary"
+ size="small"
+ class="action-btn"
+ :disabled="item.inspectState"
+ @click.stop="startInspection(item)">
+ 缂栬緫
+ </u-button>
+ <u-button type="info"
+ size="small"
+ class="action-btn"
+ @click.stop="viewDetail(item)">
+ 璇︽儏
+ </u-button>
+ <u-button type="success"
+ size="small"
+ class="action-btn"
+ :disabled="item.inspectState"
+ @click.stop="submitInspection(item)">
+ 鎻愪氦
+ </u-button>
+ </view>
+ <view class="action-buttons">
+ <u-button type="info"
+ size="small"
+ class="action-btn"
+ @click.stop="viewFileList(item)">
+ 闄勪欢
+ </u-button>
+ <u-button type="warning"
+ size="small"
+ class="action-btn"
+ :disabled="item.inspectState || item.checkName !== ''"
+ @click.stop="assignInspector(item)">
+ 鍒嗛厤妫�楠屽憳
+ </u-button>
+ </view>
+ </view>
+ </view>
+ </view>
+ <view v-else
+ class="no-data">
+ <up-empty mode="data"
+ text="鏆傛棤妫�楠屼换鍔�"></up-empty>
+ </view>
+ <!-- 鍒嗛〉缁勪欢 -->
+ <!-- 娴姩鏂板鎸夐挳 -->
+ <view class="fab-button"
+ @click="addInspection">
+ <up-icon name="plus"
+ size="24"
+ color="#ffffff"></up-icon>
+ </view>
+ <!-- 鏃ユ湡閫夋嫨鍣� -->
+ <up-popup v-model:show="showDate"
+ mode="date"
+ :start-year="2020"
+ :end-year="2030"
+ :range="true"
+ @confirm="confirmDate" />
+ <!-- 鍒嗛厤妫�楠屽憳寮圭獥 -->
+ <up-popup v-model:show="showAssignDialog"
+ mode="center"
+ round
+ style="width: 80%">
+ <view class="assign-dialog">
+ <view class="dialog-header">
+ <text class="dialog-title">鍒嗛厤妫�楠屽憳</text>
+ <up-icon name="close"
+ size="20"
+ color="#999"
+ @click="showAssignDialog = false"></up-icon>
+ </view>
+ <view class="dialog-content">
+ <up-form-item label="妫�楠屽憳"
+ prop="checkName"
+ :label-width="60"
+ required>
+ <up-input v-model="assignForm.checkName"
+ placeholder="璇烽�夋嫨妫�楠屽憳"
+ readonly />
+ <template #right>
+ <up-icon @click="showInspectorSheet = true"
+ name="arrow-right" />
+ </template>
+ </up-form-item>
+ </view>
+ <view class="dialog-footer">
+ <u-button type="default"
+ class="footer-btn"
+ @click="showAssignDialog = false">
+ 鍙栨秷
+ </u-button>
+ <u-button type="primary"
+ class="footer-btn"
+ @click="submitAssign">
+ 纭畾
+ </u-button>
+ </view>
+ </view>
+ </up-popup>
+ <!-- 妫�楠屽憳閫夋嫨 -->
+ <up-action-sheet :show="showInspectorSheet"
+ :actions="userSheetOptions"
+ @select="selectInspector"
+ title="閫夋嫨妫�楠屽憳" />
+ </view>
+</template>
+
+<script setup>
+ import { ref, computed, onMounted } from "vue";
+ import { onShow } from "@dcloudio/uni-app";
+ import PageHeader from "@/components/PageHeader.vue";
+ import dayjs from "dayjs";
+ import {
+ submitQualityInspect,
+ qualityInspectUpdate,
+ qualityInspectListPage,
+ } from "@/api/qualityManagement/materialInspection.js";
+ import { userListNoPage } from "@/api/system/user.js";
+
+ // 鏄剧ず鎻愮ず淇℃伅
+ const showToast = message => {
+ uni.showToast({
+ title: message,
+ icon: "none",
+ });
+ };
+
+ // 鎼滅储琛ㄥ崟
+ const searchForm = ref({
+ supplier: "",
+ entryDate: undefined,
+ entryDateStart: undefined,
+ entryDateEnd: undefined,
+ });
+
+ // 鏃ユ湡閫夋嫨鍣�
+ const showDate = ref(false);
+
+ // 鍒嗛厤妫�楠屽憳寮圭獥
+ const showAssignDialog = ref(false);
+ const showInspectorSheet = ref(false);
+ const assignForm = ref({
+ checkName: "",
+ });
+ const currentAssignRow = ref(null);
+
+ // 妫�楠屽垪琛ㄦ暟鎹�
+ const inspectionList = ref([]);
+
+ // 鍒嗛〉鏁版嵁
+ const page = ref({
+ current: -1,
+ size: -1,
+ total: 0,
+ });
+
+ // 鍔犺浇鐘舵��
+ const tableLoading = ref(false);
+
+ // 缁熻鏁版嵁
+ const totalCount = ref(0);
+ const submittedCount = ref(0);
+ const pendingCount = ref(0);
+ const qualifiedCount = ref(0);
+
+ // 妫�楠屽憳鍒楄〃
+ const userList = ref([]);
+
+ // ActionSheet閫夐」
+ const userSheetOptions = computed(() => {
+ return userList.value.map(item => ({
+ name: item.nickName,
+ value: item.nickName,
+ }));
+ });
+
+ // 杩斿洖涓婁竴椤�
+ const goBack = () => {
+ uni.navigateBack();
+ };
+
+ // 鏍煎紡鍖栨棩鏈熸椂闂�
+ const formatDateTime = dateStr => {
+ if (!dateStr) return "";
+ return dayjs(dateStr).format("YYYY-MM-DD");
+ };
+
+ // 鑾峰彇鐘舵�佹牱寮�
+ const getStateClass = inspectState => {
+ return inspectState ? "state-submitted" : "state-pending";
+ };
+
+ // 鑾峰彇鐘舵�佸浘鏍�
+ const getStateIcon = inspectState => {
+ return inspectState ? "checkmark-circle" : "time";
+ };
+
+ // 鑾峰彇鏍囩绫诲瀷
+ const getTagType = checkResult => {
+ if (checkResult === "鍚堟牸") return "success";
+ if (checkResult === "涓嶅悎鏍�") return "error";
+ return "default";
+ };
+
+ // 鑾峰彇鐘舵�佹爣绛剧被鍨�
+ const getStateTagType = inspectState => {
+ return inspectState ? "success" : "warning";
+ };
+
+ // 鏄剧ず鏃ユ湡閫夋嫨鍣�
+ const showDatePicker = () => {
+ showDate.value = true;
+ };
+
+ // 纭鏃ユ湡閫夋嫨
+ const confirmDate = e => {
+ searchForm.value.entryDate = e.value;
+ searchForm.value.entryDateStart = dayjs(e.value[0]).format("YYYY-MM-DD");
+ searchForm.value.entryDateEnd = dayjs(e.value[1]).format("YYYY-MM-DD");
+ getList();
+ };
+ const viewFileList = item => {
+ uni.setStorageSync("qualityInspectFileId", item.id);
+ uni.navigateTo({
+ url: "/pages/qualityManagement/materialInspection/fileList",
+ });
+ };
+
+ // 娓呴櫎鏃ユ湡鑼冨洿
+ const clearDateRange = () => {
+ searchForm.value.entryDate = undefined;
+ searchForm.value.entryDateStart = undefined;
+ searchForm.value.entryDateEnd = undefined;
+ getList();
+ };
+
+ // 鑾峰彇鐢ㄦ埛鍒楄〃
+ const getUserList = async () => {
+ try {
+ const userRes = await userListNoPage();
+ userList.value = userRes.data || [];
+ } catch (e) {
+ console.error("鍔犺浇妫�楠屽憳鍒楄〃澶辫触", e);
+ userList.value = [];
+ }
+ };
+
+ // 鏌ヨ鍒楄〃
+ const getList = () => {
+ tableLoading.value = true;
+ const params = { ...searchForm.value, ...page.value };
+ params.entryDate = undefined;
+ qualityInspectListPage({ ...params, inspectType: 0 })
+ .then(res => {
+ tableLoading.value = false;
+ inspectionList.value = res.data.records || [];
+ page.value.total = res.data.total || 0;
+ totalCount.value = res.data.total || 0;
+ submittedCount.value = inspectionList.value.filter(
+ item => item.inspectState
+ ).length;
+ pendingCount.value = inspectionList.value.filter(
+ item => !item.inspectState
+ ).length;
+ qualifiedCount.value = inspectionList.value.filter(
+ item => item.checkResult === "鍚堟牸"
+ ).length;
+ })
+ .catch(err => {
+ tableLoading.value = false;
+ console.error("鑾峰彇鍒楄〃澶辫触:", err);
+ showToast("鑾峰彇鍒楄〃澶辫触锛岃閲嶈瘯");
+ });
+ };
+
+ // 缂栬緫妫�楠�
+ const startInspection = item => {
+ if (!item) {
+ showToast("鍙傛暟閿欒");
+ return;
+ }
+ // 瀛樺偍瀹屾暣鐨勬楠屾暟鎹�
+ uni.setStorageSync("inspectionEditData", item);
+ // 璺宠浆鍒扮紪杈戦〉闈�
+ uni.navigateTo({
+ url: `/pages/qualityManagement/materialInspection/add?id=${item.id}&isEdit=true`,
+ });
+ };
+
+ // 鏌ョ湅璇︽儏
+ const viewDetail = item => {
+ if (!item) {
+ showToast("鍙傛暟閿欒");
+ return;
+ }
+ // 璺宠浆鍒拌鎯呴〉闈�
+ uni.navigateTo({
+ url: `/pages/qualityManagement/materialInspection/detail?id=${item.id}`,
+ });
+ };
+
+ // 鏂板妫�楠�
+ const addInspection = () => {
+ uni.navigateTo({
+ url: "/pages/qualityManagement/materialInspection/add",
+ });
+ };
+
+ // 鎻愪氦妫�楠�
+ const submitInspection = async item => {
+ if (!item) {
+ showToast("鍙傛暟閿欒");
+ return;
+ }
+ try {
+ const res = await submitQualityInspect({ id: item.id });
+ if (res.code === 200) {
+ showToast("鎻愪氦鎴愬姛");
+ setTimeout(() => {
+ getList();
+ }, 1000);
+ } else {
+ showToast("鎻愪氦澶辫触锛�" + (res.msg || "鏈煡閿欒"));
+ }
+ } catch (error) {
+ console.error("鎻愪氦澶辫触:", error);
+ showToast("鎻愪氦澶辫触锛岃閲嶈瘯");
+ }
+ };
+
+ // 鍒嗛厤妫�楠屽憳
+ const assignInspector = item => {
+ if (!item) {
+ showToast("鍙傛暟閿欒");
+ return;
+ }
+ currentAssignRow.value = item;
+ getUserList();
+ showAssignDialog.value = true;
+ };
+
+ // 閫夋嫨妫�楠屽憳
+ const selectInspector = e => {
+ assignForm.value.checkName = e.value;
+ showInspectorSheet.value = false;
+ };
+
+ // 鎻愪氦鍒嗛厤
+ const submitAssign = async () => {
+ if (!currentAssignRow.value || !assignForm.value.checkName) {
+ showToast("璇烽�夋嫨妫�楠屽憳");
+ return;
+ }
+ try {
+ const data = {
+ ...assignForm.value,
+ id: currentAssignRow.value.id,
+ };
+ const res = await qualityInspectUpdate(data);
+ if (res.code === 200) {
+ showToast("鍒嗛厤鎴愬姛");
+ showAssignDialog.value = false;
+ setTimeout(() => {
+ getList();
+ }, 1000);
+ } else {
+ showToast("鍒嗛厤澶辫触锛�" + (res.msg || "鏈煡閿欒"));
+ }
+ } catch (error) {
+ console.error("鍒嗛厤澶辫触:", error);
+ showToast("鍒嗛厤澶辫触锛岃閲嶈瘯");
+ }
+ };
+
+ // 澶勭悊鍒嗛〉
+ const handlePagination = obj => {
+ page.value.current = obj.current;
+ page.value.size = obj.size;
+ getList();
+ };
+
+ onMounted(() => {
+ getList();
+ getUserList();
+ });
+
+ onShow(() => {
+ getList();
+ });
+</script>
+
+<style scoped lang="scss">
+ @import "../../../styles/sales-common.scss";
+
+ .material-inspection-page {
+ min-height: 100vh;
+ background: #f8f9fa;
+ padding-bottom: 80px;
+ }
+
+ // 鎼滅储鍖哄煙
+ .search-section {
+ padding: 10px 15px;
+ background: #fff;
+ border-bottom: 1px solid #f0f0f0;
+ }
+
+ .search-bar {
+ display: flex;
+ align-items: center;
+ background: #f8f9fa;
+ border-radius: 20px;
+ padding: 0 15px;
+ height: 40px;
+ }
+
+ .search-input {
+ flex: 1;
+ }
+
+ .search-text {
+ background: transparent;
+ border: none;
+ }
+
+ .filter-button {
+ margin-left: 10px;
+ padding: 5px;
+ }
+
+ // 缁熻鍗$墖
+ .stats-cards {
+ display: flex;
+ padding: 15px;
+ gap: 10px;
+ background: #fff;
+ margin-bottom: 10px;
+ }
+
+ .stat-card {
+ flex: 1;
+ background: #2979ff;
+ border-radius: 12px;
+ padding: 15px;
+ text-align: center;
+ color: #fff;
+ box-shadow: 0 2px 8px rgba(41, 121, 255, 0.2);
+ }
+
+ .stat-number {
+ display: block;
+ font-size: 20px;
+ font-weight: 600;
+ margin-bottom: 5px;
+ }
+
+ .stat-label {
+ font-size: 12px;
+ opacity: 0.9;
+ }
+
+ // 妫�楠屽垪琛�
+ .inspection-list {
+ padding: 20px;
+ }
+
+ .inspection-item {
+ background: #ffffff;
+ border-radius: 12px;
+ margin-bottom: 16px;
+ overflow: hidden;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
+ padding: 0 16px;
+
+ &:active {
+ transform: scale(0.98);
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
+ }
+ }
+
+ .item-header {
+ padding: 16px 0;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ }
+
+ .item-left {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ }
+
+ .material-icon {
+ width: 24px;
+ height: 24px;
+ background: #2979ff;
+ border-radius: 4px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+
+ .state-pending {
+ background: #ff9900;
+ }
+
+ .state-submitted {
+ background: #52c41a;
+ }
+
+ .material-info {
+ flex: 1;
+ }
+
+ .material-name {
+ font-size: 14px;
+ color: #333;
+ font-weight: 500;
+ }
+
+ .material-code {
+ font-size: 12px;
+ color: #999;
+ margin-left: 8px;
+ }
+
+ .status-tags {
+ display: flex;
+ gap: 8px;
+ }
+
+ .status-tag {
+ margin: 0;
+ }
+
+ .date-range {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-top: 10px;
+ padding: 8px 12px;
+ background: #f8f9fa;
+ border-radius: 8px;
+ }
+
+ .date-text {
+ font-size: 12px;
+ color: #666;
+ }
+
+ // 璇︽儏琛�
+ .item-details {
+ padding: 16px 0;
+ }
+
+ .detail-row {
+ display: flex;
+ align-items: flex-end;
+ justify-content: space-between;
+ margin-bottom: 8px;
+
+ &:last-child {
+ margin-bottom: 0;
+ }
+ }
+
+ .detail-label {
+ font-size: 12px;
+ color: #777777;
+ min-width: 60px;
+ }
+
+ .detail-value {
+ font-size: 12px;
+ color: #000000;
+ text-align: right;
+ flex: 1;
+ margin-left: 16px;
+ }
+
+ // 鎿嶄綔鎸夐挳
+ .action-buttons {
+ display: flex;
+ gap: 12px;
+ padding: 0 0 16px 0;
+ justify-content: space-between;
+ }
+
+ .action-btn {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 8px;
+ }
+
+ // 绌虹姸鎬�
+ .no-data {
+ padding: 60px 20px;
+ text-align: center;
+ }
+
+ // 娴姩鎸夐挳
+ .fab-button {
+ position: fixed;
+ bottom: 20px;
+ right: 20px;
+ width: 56px;
+ height: 56px;
+ background: #2979ff;
+ border-radius: 50%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ box-shadow: 0 4px 16px rgba(41, 121, 255, 0.3);
+ z-index: 1000;
+ }
+
+ // 鍒嗛厤妫�楠屽憳寮圭獥
+ .assign-dialog {
+ padding: 24px;
+ background: #ffffff;
+ border-radius: 12px;
+ }
+
+ .dialog-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 24px;
+ padding-bottom: 16px;
+ border-bottom: 1px solid #f0f0f0;
+ }
+
+ .dialog-title {
+ font-size: 18px;
+ font-weight: 600;
+ color: #303133;
+ }
+
+ .dialog-content {
+ margin-bottom: 24px;
+ }
+
+ .dialog-footer {
+ display: flex;
+ gap: 16px;
+ padding-top: 16px;
+ border-top: 1px solid #f0f0f0;
+ }
+
+ .footer-btn {
+ flex: 1;
+ height: 44px;
+ font-size: 16px;
+ }
+
+ // 杈撳叆妗嗘牱寮�
+ :deep(.up-input__inner) {
+ border-radius: 8px;
+ height: 44px;
+ font-size: 14px;
+ }
+
+ // 琛ㄥ崟椤规牱寮�
+ :deep(.up-form-item) {
+ margin-bottom: 0;
+ }
+
+ :deep(.up-form-item__label) {
+ font-size: 14px;
+ color: #606266;
+ margin-bottom: 8px;
+ }
+
+ // 鎸夐挳鏍峰紡
+ :deep(.up-button--primary) {
+ border-radius: 8px;
+ }
+
+ :deep(.up-button--default) {
+ border-radius: 8px;
+ }
+
+ // 鍒嗛〉缁勪欢
+ .pagination {
+ padding: 20px;
+ background: #fff;
+ margin-top: 10px;
+ display: flex;
+ justify-content: center;
+ }
+</style>
--
Gitblit v1.9.3