From a27edc14f632e878ede9c7b16de10b01626e938b Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期三, 25 三月 2026 14:39:08 +0800
Subject: [PATCH] fix: 检测提交后,管理员还能进行编辑

---
 src/pages/consumablesLogistics/stockManagement/view.vue      |    4 +-
 src/pages/consumablesLogistics/stockReport/index.vue         |    2 
 src/pages/inventoryManagement/stockReport/index.vue          |    2 
 src/pages/consumablesLogistics/stockManagement/index.vue     |    6 +-
 src/pages/inventoryManagement/stockManagement/view.vue       |    4 +-
 src/pages/inventoryManagement/stockManagement/index.vue      |    6 +-
 src/pages/qualityManagement/rawMaterial/form.vue             |   57 +++++++++++++++++++---------
 src/pages/qualityManagement/rawMaterial/index.vue            |   13 +++++-
 src/pages/consumablesLogistics/stockManagement/Qualified.vue |    2 
 9 files changed, 62 insertions(+), 34 deletions(-)

diff --git a/src/pages/consumablesLogistics/stockManagement/Qualified.vue b/src/pages/consumablesLogistics/stockManagement/Qualified.vue
index ab42864..7362da7 100644
--- a/src/pages/consumablesLogistics/stockManagement/Qualified.vue
+++ b/src/pages/consumablesLogistics/stockManagement/Qualified.vue
@@ -27,7 +27,7 @@
         <el-table-column label="瑙勬牸鍨嬪彿" prop="model" min-width="160" show-overflow-tooltip />
         <el-table-column label="鍗曚綅" prop="unit" width="100" show-overflow-tooltip />
         <el-table-column label="搴撳瓨鏁伴噺" prop="qualitity" width="110" show-overflow-tooltip />
-        <el-table-column label="鍐荤粨鏁伴噺" prop="lockedQuantity" width="110" show-overflow-tooltip />
+        <!-- <el-table-column label="鍐荤粨鏁伴噺" prop="lockedQuantity" width="110" show-overflow-tooltip /> -->
         <el-table-column label="鏈�杩戞洿鏂版椂闂�" prop="updateTime" width="180" show-overflow-tooltip />
         <el-table-column label="澶囨敞" prop="remark" min-width="140" show-overflow-tooltip />
       </el-table>
diff --git a/src/pages/consumablesLogistics/stockManagement/index.vue b/src/pages/consumablesLogistics/stockManagement/index.vue
index 6fff930..98dc629 100644
--- a/src/pages/consumablesLogistics/stockManagement/index.vue
+++ b/src/pages/consumablesLogistics/stockManagement/index.vue
@@ -39,7 +39,7 @@
               <view class="row"><text class="l">瑙勬牸鍨嬪彿</text><text class="r">{{ item.model }}</text></view>
               <view class="row"><text class="l">鍗曚綅</text><text class="r">{{ item.unit }}</text></view>
               <view class="row"><text class="l">鎬诲簱瀛樻暟</text><text class="r highlight">{{ item.qualitity }}</text></view>
-              <view class="row"><text class="l">鍐荤粨鏁伴噺</text><text class="r">{{ item.lockedQuantity || 0 }}</text></view>
+              <!-- <view class="row"><text class="l">鍐荤粨鏁伴噺</text><text class="r">{{ item.lockedQuantity || 0 }}</text></view> -->
               <view class="row"><text class="l">鍙敤搴撳瓨</text><text class="r">{{ item.unLockedQuantity ?? (item.qualitity - (item.lockedQuantity || 0)) }}</text></view>
               <view class="row"><text class="l">鏈�杩戞洿鏂版椂闂�</text><text class="r">{{ item.updateTime }}</text></view>
             </view>
@@ -50,11 +50,11 @@
               :class="{ disabled: !(item.unLockedQuantity > 0) }"
               @click="openSubtract(item)"
             >鍑哄簱</view>
-            <view
+            <!-- <view
               class="btn-link btn-link-warn"
               v-if="item.unLockedQuantity > 0"
               @click="openFrozen(item)"
-            >鍐荤粨</view>
+            >鍐荤粨</view> -->
             <view
               class="btn-link btn-link-plain"
               v-if="(item.lockedQuantity || 0) > 0"
diff --git a/src/pages/consumablesLogistics/stockManagement/view.vue b/src/pages/consumablesLogistics/stockManagement/view.vue
index 43d6cac..a306114 100644
--- a/src/pages/consumablesLogistics/stockManagement/view.vue
+++ b/src/pages/consumablesLogistics/stockManagement/view.vue
@@ -31,10 +31,10 @@
             <text class="label">鎬诲簱瀛�</text>
             <text class="value value-num">{{ detail.qualitity ?? '-' }}</text>
           </view>
-          <view class="detail-row">
+          <!-- <view class="detail-row">
             <text class="label">鍐荤粨鏁伴噺</text>
             <text class="value">{{ detail.lockedQuantity ?? 0 }}</text>
-          </view>
+          </view> -->
           <view class="detail-row">
             <text class="label">鍙敤搴撳瓨</text>
             <text class="value">{{ detail.unLockedQuantity ?? '-' }}</text>
diff --git a/src/pages/consumablesLogistics/stockReport/index.vue b/src/pages/consumablesLogistics/stockReport/index.vue
index efbe3b2..19b1b74 100644
--- a/src/pages/consumablesLogistics/stockReport/index.vue
+++ b/src/pages/consumablesLogistics/stockReport/index.vue
@@ -64,7 +64,7 @@
             <view class="row" v-if="searchForm.reportType === 'inout'"><text class="l">鍑哄簱鏁伴噺</text><text class="r">{{ item.totalStockOut }}</text></view>
             <view class="row"><text class="l">鐜板湪搴撳瓨</text><text class="r highlight">{{ item.currentStock }}</text></view>
             <view class="row" v-if="item.createBy"><text class="l">鍏ュ簱浜�</text><text class="r">{{ item.createBy }}</text></view>
-            <view class="row" v-if="item.currentWeight"><text class="l">鐜板噣閲�(鍚�)</text><text class="r">{{ item.currentWeight }}</text></view>
+            <!-- <view class="row" v-if="item.currentWeight"><text class="l">鐜板噣閲�(鍚�)</text><text class="r">{{ item.currentWeight }}</text></view> -->
             <view class="row" v-if="item.recordType"><text class="l">鏉ユ簮</text><text class="r">{{ getRecordType(item.recordType) }}</text></view>
           </view>
         </view>
diff --git a/src/pages/inventoryManagement/stockManagement/index.vue b/src/pages/inventoryManagement/stockManagement/index.vue
index 3b707a7..3c79368 100644
--- a/src/pages/inventoryManagement/stockManagement/index.vue
+++ b/src/pages/inventoryManagement/stockManagement/index.vue
@@ -41,7 +41,7 @@
               <view class="row"><text class="l">瑙勬牸鍨嬪彿</text><text class="r">{{ item.model }}</text></view>
               <view class="row"><text class="l">鍗曚綅</text><text class="r">{{ item.unit }}</text></view>
               <view class="row"><text class="l">鎬诲簱瀛樻暟</text><text class="r highlight">{{ item.qualitity }}</text></view>
-              <view class="row"><text class="l">鍐荤粨鏁伴噺</text><text class="r">{{ item.lockedQuantity || 0 }}</text></view>
+              <!-- <view class="row"><text class="l">鍐荤粨鏁伴噺</text><text class="r">{{ item.lockedQuantity || 0 }}</text></view> -->
               <view class="row"><text class="l">鍙敤搴撳瓨</text><text class="r">{{ item.unLockedQuantity ?? (item.qualitity - (item.lockedQuantity || 0)) }}</text></view>
               <view class="row"><text class="l">鏈�杩戞洿鏂版椂闂�</text><text class="r">{{ item.updateTime }}</text></view>
             </view>
@@ -52,11 +52,11 @@
               :class="{ disabled: !(item.unLockedQuantity > 0) }"
               @click="openSubtract(item)"
             >鍑哄簱</view>
-            <view
+            <!-- <view
               class="btn-link btn-link-warn"
               v-if="item.unLockedQuantity > 0"
               @click="openFrozen(item)"
-            >鍐荤粨</view>
+            >鍐荤粨</view> -->
             <view
               class="btn-link btn-link-plain"
               v-if="(item.lockedQuantity || 0) > 0"
diff --git a/src/pages/inventoryManagement/stockManagement/view.vue b/src/pages/inventoryManagement/stockManagement/view.vue
index d9e6a1a..b286dec 100644
--- a/src/pages/inventoryManagement/stockManagement/view.vue
+++ b/src/pages/inventoryManagement/stockManagement/view.vue
@@ -41,10 +41,10 @@
             <text class="label">鎬诲簱瀛樻暟</text>
             <text class="value value-num">{{ detail.qualitity ?? '-' }}</text>
           </view>
-          <view class="detail-row">
+          <!-- <view class="detail-row">
             <text class="label">鍐荤粨鏁伴噺</text>
             <text class="value">{{ detail.lockedQuantity ?? 0 }}</text>
-          </view>
+          </view> -->
           <view class="detail-row">
             <text class="label">鍙敤搴撳瓨</text>
             <text class="value">{{ detail.unLockedQuantity ?? (detail.qualitity - (detail.lockedQuantity || 0)) }}</text>
diff --git a/src/pages/inventoryManagement/stockReport/index.vue b/src/pages/inventoryManagement/stockReport/index.vue
index 52b4783..e5bc0b4 100644
--- a/src/pages/inventoryManagement/stockReport/index.vue
+++ b/src/pages/inventoryManagement/stockReport/index.vue
@@ -69,7 +69,7 @@
             <view class="row" v-if="searchForm.reportType === 'inout'"><text class="l">鍑哄簱鏁伴噺</text><text class="r">{{ item.totalStockOut }}</text></view>
             <view class="row"><text class="l">鐜板湪搴撳瓨</text><text class="r highlight">{{ item.currentStock }}</text></view>
             <view class="row" v-if="item.createBy"><text class="l">鍏ュ簱浜�</text><text class="r">{{ item.createBy }}</text></view>
-            <view class="row" v-if="item.currentWeight"><text class="l">鐜板噣閲�(鍚�)</text><text class="r">{{ item.currentWeight }}</text></view>
+            <!-- <view class="row" v-if="item.currentWeight"><text class="l">鐜板噣閲�(鍚�)</text><text class="r">{{ item.currentWeight }}</text></view> -->
             <view class="row" v-if="item.recordType"><text class="l">鏉ユ簮</text><text class="r">{{ getRecordType(item.recordType) }}</text></view>
           </view>
         </view>
diff --git a/src/pages/qualityManagement/rawMaterial/form.vue b/src/pages/qualityManagement/rawMaterial/form.vue
index 3f84f70..7d54340 100644
--- a/src/pages/qualityManagement/rawMaterial/form.vue
+++ b/src/pages/qualityManagement/rawMaterial/form.vue
@@ -1,6 +1,6 @@
 <template>
   <view class="rm-form-page">
-    <PageHeader :title="operationType === 'add' ? '鏂板鍘熸枡妫�' : '缂栬緫鍘熸枡妫�'" @back="goBack" />
+    <PageHeader :title="operationType === 'add' ? '鏂板鍘熸枡妫�' : (operationType === 'detail' ? '鍘熸枡妫�楠岃鎯�' : '缂栬緫鍘熸枡妫�')" @back="goBack" />
 
     <scroll-view scroll-y class="content-scroll">
       <view class="section-card">
@@ -8,7 +8,11 @@
 
         <view class="form-row">
           <text class="form-label required">浜у搧鍚嶇О</text>
-          <view class="selector-trigger" @click="openProductSelector" :class="{ disabled: operationType === 'edit' }">
+          <view
+            class="selector-trigger"
+            @click="!isReadOnly && openProductSelector()"
+            :class="{ disabled: operationType === 'edit' || isReadOnly }"
+          >
             <text class="selector-text" :class="{ placeholder: !form.productName }">
               {{ form.productName || '璇烽�夋嫨浜у搧' }}
             </text>
@@ -28,12 +32,12 @@
 
         <view class="form-row">
           <text class="form-label required">鎵瑰彿</text>
-          <up-input v-model="form.batchNo" placeholder="璇疯緭鍏ユ壒鍙�" />
+          <up-input v-model="form.batchNo" :disabled="isReadOnly" placeholder="璇疯緭鍏ユ壒鍙�" />
         </view>
 
         <view class="form-row">
           <text class="form-label required">妫�楠岀被鍨�</text>
-          <view class="selector-trigger" @click="showCheckTypeSheet = true">
+          <view class="selector-trigger" @click="!isReadOnly && (showCheckTypeSheet = true)">
             <text class="selector-text" :class="{ placeholder: form.checkType === '' || form.checkType == null }">
               {{ checkTypeLabel }}
             </text>
@@ -43,7 +47,7 @@
 
         <view class="form-row">
           <text class="form-label required">妫�娴嬬粨鏋�</text>
-          <view class="selector-trigger" @click="showCheckResultSheet = true">
+          <view class="selector-trigger" @click="!isReadOnly && (showCheckResultSheet = true)">
             <text class="selector-text" :class="{ placeholder: form.checkResult === '' || form.checkResult == null }">
               {{ checkResultLabel }}
             </text>
@@ -53,12 +57,12 @@
 
         <view class="form-row">
           <text class="form-label required">妫�楠屽憳</text>
-          <up-input v-model="form.checkUserName" placeholder="璇疯緭鍏ユ楠屽憳" />
+          <up-input v-model="form.checkUserName" :disabled="isReadOnly" placeholder="璇疯緭鍏ユ楠屽憳" />
         </view>
 
         <view class="form-row">
           <text class="form-label required">妫�娴嬫棩鏈�</text>
-          <view class="selector-trigger" @click="openCheckDatePicker">
+          <view class="selector-trigger" @click="!isReadOnly && openCheckDatePicker()">
             <text class="selector-text" :class="{ placeholder: !form.checkTime }">
               {{ form.checkTime || '璇烽�夋嫨妫�娴嬫棩鏈�' }}
             </text>
@@ -70,36 +74,36 @@
       <view class="section-card">
         <view class="section-title row-between">
           <text>妫�娴嬮」鐩�</text>
-          <view class="btn-inline" @click="openItemSelector">娣诲姞妫�娴嬮」鐩�</view>
+          <view class="btn-inline" v-if="!isReadOnly" @click="openItemSelector">娣诲姞妫�娴嬮」鐩�</view>
         </view>
 
         <view v-if="inspectItems.length > 0">
           <view v-for="(it, idx) in inspectItems" :key="it.id || idx" class="item-card">
             <view class="item-head">
               <text class="item-name">{{ it.name }}</text>
-              <view class="item-del" @click="removeItem(it.id)">鍒犻櫎</view>
+              <view class="item-del" v-if="!isReadOnly" @click="removeItem(it.id)">鍒犻櫎</view>
             </view>
             <view class="item-row"><text class="l">鍗曚綅</text><text class="r">{{ it.unit || '-' }}</text></view>
             <view class="item-row"><text class="l">鏍囧噯鍊�</text><text class="r">{{ it.standardValue || '-' }}</text></view>
             <view class="item-row"><text class="l">鍐呮帶鍊�</text><text class="r">{{ it.internalControl || '-' }}</text></view>
             <view class="item-row input-row">
               <text class="l">鍖栭獙鍊�</text>
-              <up-input v-model="it.testValue" placeholder="璇疯緭鍏�" class="test-value-input" />
+              <up-input v-model="it.testValue" :disabled="isReadOnly" placeholder="璇疯緭鍏�" class="test-value-input" />
             </view>
           </view>
         </view>
-        <view v-else class="no-data">璇锋坊鍔犳娴嬮」鐩�</view>
+        <view v-else class="no-data">{{ isReadOnly ? '鏆傛棤妫�娴嬮」鐩�' : '璇锋坊鍔犳娴嬮」鐩�' }}</view>
       </view>
     </scroll-view>
 
-    <view class="bottom-bar">
+    <view class="bottom-bar" v-if="!isReadOnly">
       <view class="btn-submit" :class="{ disabled: submitLoading }" @click="handleSubmit">
         {{ submitLoading ? '鎻愪氦涓�...' : '淇濆瓨' }}
       </view>
     </view>
 
     <!-- 浜у搧閫夋嫨寮圭獥锛堝鐢� pageModel 鎺ュ彛锛� -->
-    <up-popup :show="showProductPopup" mode="bottom" @close="showProductPopup = false">
+    <up-popup :show="showProductPopup && !isReadOnly" mode="bottom" @close="showProductPopup = false">
       <view class="popup-wrap">
         <view class="popup-header">
           <text class="popup-title">閫夋嫨浜у搧</text>
@@ -123,7 +127,7 @@
     </up-popup>
 
     <!-- 妫�娴嬮」鐩�夋嫨寮圭獥锛堢畝鍖栵細浠庢娴嬮」缁存姢琛ㄩ噷閫夛級 -->
-    <up-popup :show="showItemPopup" mode="bottom" @close="showItemPopup = false">
+    <up-popup :show="showItemPopup && !isReadOnly" mode="bottom" @close="showItemPopup = false">
       <view class="popup-wrap">
         <view class="popup-header">
           <text class="popup-title">閫夋嫨妫�娴嬮」鐩�</text>
@@ -164,11 +168,23 @@
     </up-popup>
 
     <!-- 閫夋嫨鍣細妫�楠岀被鍨�/缁撴灉 -->
-    <up-action-sheet :actions="checkTypeActions" :show="showCheckTypeSheet" @close="showCheckTypeSheet = false" @select="onSelectCheckType" title="妫�楠岀被鍨�" />
-    <up-action-sheet :actions="checkResultActions" :show="showCheckResultSheet" @close="showCheckResultSheet = false" @select="onSelectCheckResult" title="妫�娴嬬粨鏋�" />
+    <up-action-sheet
+      :actions="checkTypeActions"
+      :show="showCheckTypeSheet && !isReadOnly"
+      @close="showCheckTypeSheet = false"
+      @select="onSelectCheckType"
+      title="妫�楠岀被鍨�"
+    />
+    <up-action-sheet
+      :actions="checkResultActions"
+      :show="showCheckResultSheet && !isReadOnly"
+      @close="showCheckResultSheet = false"
+      @select="onSelectCheckResult"
+      title="妫�娴嬬粨鏋�"
+    />
 
     <!-- 鏃ユ湡閫夋嫨 -->
-    <up-popup :show="showCheckDatePicker" mode="bottom" @close="showCheckDatePicker = false">
+    <up-popup :show="showCheckDatePicker && !isReadOnly" mode="bottom" @close="showCheckDatePicker = false">
       <up-datetime-picker :show="true" v-model="checkDateValue" mode="date" @confirm="onCheckDateConfirm" @cancel="showCheckDatePicker = false" />
     </up-popup>
   </view>
@@ -187,6 +203,7 @@
 const userStore = useUserStore()
 
 const operationType = ref('add')
+const isReadOnly = computed(() => operationType.value === 'detail')
 const submitLoading = ref(false)
 
 const form = reactive({
@@ -240,7 +257,7 @@
 const productList = ref([])
 const productLoading = ref(false)
 const openProductSelector = () => {
-  if (operationType.value === 'edit') return
+  if (operationType.value === 'edit' || isReadOnly.value) return
   showProductPopup.value = true
   if (productList.value.length === 0) loadProductList()
 }
@@ -270,6 +287,7 @@
 const selectedItemIds = ref(new Set())
 const isItemSelected = (id) => selectedItemIds.value.has(id)
 const openItemSelector = () => {
+  if (isReadOnly.value) return
   showItemPopup.value = true
   selectedItemIds.value = new Set(inspectItems.value.map(i => i.id))
   if (itemList.value.length === 0) loadItemList()
@@ -320,6 +338,7 @@
 }
 
 const handleSubmit = () => {
+  if (isReadOnly.value) return
   if (submitLoading.value) return
   const msg = validate()
   if (msg) {
@@ -343,7 +362,7 @@
 onLoad((options) => {
   operationType.value = options?.type || 'add'
   const id = options?.id
-  if (operationType.value === 'edit' && id) {
+  if ((operationType.value === 'edit' || operationType.value === 'detail') && id) {
     findRawMaterialDetail(id).then(res => {
       const d = res?.data || {}
       form.id = d.id
diff --git a/src/pages/qualityManagement/rawMaterial/index.vue b/src/pages/qualityManagement/rawMaterial/index.vue
index a661bc4..a3dcdd3 100644
--- a/src/pages/qualityManagement/rawMaterial/index.vue
+++ b/src/pages/qualityManagement/rawMaterial/index.vue
@@ -60,7 +60,8 @@
           </view>
         </view>
         <view class="item-actions">
-          <up-button v-if="item.inspectState != 1" type="primary" size="mini" @click.stop="openForm('edit', item)">缂栬緫</up-button>
+          <up-button v-if="item.inspectState != 1||hasRawCancel" type="primary" size="mini" @click.stop="openForm('edit', item)">缂栬緫</up-button>
+          <up-button type="warning" size="mini" @click.stop="openDetail(item)">璇︽儏</up-button>
           <up-button type="info" size="mini" @click.stop="openFiles(item)">闄勪欢</up-button>
           <up-button v-if="item.inspectState != 1" type="success" size="mini" @click.stop="handleConfirmSubmit(item)">鎻愪氦</up-button>
           <up-button v-if="hasRawCancel" type="error" size="mini" @click.stop="handleDelete(item)">鍒犻櫎</up-button>
@@ -203,13 +204,21 @@
 };
 
 const openForm = (type, item) => {
-  if (type === 'edit' && !hasRawEdit.value) return
+  // if (type === 'edit' && !hasRawEdit.value) return
   const id = item?.id
   uni.navigateTo({
     url: `/pages/qualityManagement/rawMaterial/form?type=${type}${id ? `&id=${id}` : ''}`
   })
 };
 
+const openDetail = (item) => {
+  const id = item?.id
+  if (!id) return
+  uni.navigateTo({
+    url: `/pages/qualityManagement/rawMaterial/form?type=detail&id=${id}`
+  })
+}
+
 const handleConfirmSubmit = (row) => {
   showConfirm('纭鎻愪氦璇ユ楠岃褰曞悧锛�').then(res => {
     if (res.confirm) {

--
Gitblit v1.9.3