From 207c564c2b8d46fd86160c4f6583c2fc9d4a4e5c Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 21 四月 2026 10:44:45 +0800
Subject: [PATCH] 湟水峡app 1.协同审批功能删减

---
 src/pages/cooperativeOffice/collaborativeApproval/approve.vue |  301 +++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 282 insertions(+), 19 deletions(-)

diff --git a/src/pages/cooperativeOffice/collaborativeApproval/approve.vue b/src/pages/cooperativeOffice/collaborativeApproval/approve.vue
index 6011e7b..c17236e 100644
--- a/src/pages/cooperativeOffice/collaborativeApproval/approve.vue
+++ b/src/pages/cooperativeOffice/collaborativeApproval/approve.vue
@@ -9,6 +9,11 @@
         <text class="info-title">鐢宠淇℃伅</text>
       </view>
       <view class="info-content">
+        <!-- 瀹℃壒鏍囬锛堜粎 approveType=9 鎴� 10 鏄剧ず锛� -->
+        <view v-if="approvalData.approveType === 9 || approvalData.approveType === 10" class="info-row">
+          <text class="info-label">瀹℃壒鏍囬</text>
+          <text class="info-value">{{ approvalData.approveTitle || '-' }}</text>
+        </view>
         <view class="info-row">
           <text class="info-label">鐢宠浜�</text>
           <text class="info-value">{{ approvalData.approveUserName }}</text>
@@ -18,14 +23,108 @@
           <text class="info-value">{{ approvalData.approveDeptName }}</text>
         </view>
         <view class="info-row">
-          <text class="info-label">鐢宠浜嬬敱</text>
+          <text class="info-label">{{ getApproveReasonLabel() }}</text>
           <text class="info-value">{{ approvalData.approveReason }}</text>
         </view>
         <view class="info-row">
           <text class="info-label">鐢宠鏃ユ湡</text>
           <text class="info-value">{{ approvalData.approveTime }}</text>
         </view>
+
+        <!-- approveType=2 璇峰亣鐩稿叧瀛楁 -->
+        <template v-if="approvalData.approveType === 2">
+          <view class="info-row">
+            <text class="info-label">璇峰亣寮�濮嬫椂闂�</text>
+            <text class="info-value">{{ approvalData.startDate || '-' }}</text>
+          </view>
+          <view class="info-row">
+            <text class="info-label">璇峰亣缁撴潫鏃堕棿</text>
+            <text class="info-value">{{ approvalData.endDate || '-' }}</text>
+          </view>
+        </template>
+
+        <!-- approveType=3 鍑哄樊鐩稿叧瀛楁 -->
+        <view v-if="approvalData.approveType === 3" class="info-row">
+          <text class="info-label">鍑哄樊鍦扮偣</text>
+          <text class="info-value">{{ approvalData.location || '-' }}</text>
+        </view>
+
+        <!-- approveType=4 鎶ラ攢鐩稿叧瀛楁 -->
+        <view v-if="approvalData.approveType === 4" class="info-row">
+          <text class="info-label">鎶ラ攢閲戦</text>
+          <text class="info-value">{{ approvalData.price ? `楼${approvalData.price}` : '-' }}</text>
+        </view>
       </view>
+    </view>
+
+    <!-- 閿�鍞鎯咃紙approveType=9锛� -->
+    <view v-if="isSalesApproval && currentSales.salesContractNo" class="sales-detail">
+      <view class="detail-header">
+        <text class="detail-title">閿�鍞鎯�</text>
+      </view>
+      <view class="detail-content">
+        <view class="detail-row">
+          <text class="detail-label">閿�鍞悎鍚屽彿</text>
+          <text class="detail-value">{{ currentSales.salesContractNo }}</text>
+        </view>
+        <view class="detail-row">
+          <text class="detail-label">瀹㈡埛鍚嶇О</text>
+          <text class="detail-value">{{ currentSales.customerName }}</text>
+        </view>
+        <view class="detail-row">
+          <text class="detail-label">涓氬姟鍛�</text>
+          <text class="detail-value">{{ currentSales.salesman }}</text>
+        </view>
+        <view class="detail-row">
+          <text class="detail-label">褰曞叆浜�</text>
+          <text class="detail-value">{{ currentSales.entryPersonName }}</text>
+        </view>
+        <view class="detail-row">
+          <text class="detail-label">绛捐鏃ユ湡</text>
+          <text class="detail-value">{{ currentSales.executionDate }}</text>
+        </view>
+        <view class="detail-row">
+          <text class="detail-label">浠樻鏂瑰紡</text>
+          <text class="detail-value">{{ currentSales.paymentMethod }}</text>
+        </view>
+        <view class="detail-row total-row">
+          <text class="detail-label">鍚堝悓閲戦</text>
+          <text class="detail-value highlight">楼{{ calculateSalesTotalAmount() }}</text>
+        </view>
+        <!-- 浜у搧鏄庣粏 -->
+        <view v-if="currentSales.productData && currentSales.productData.length > 0" class="product-list">
+          <view class="product-header">
+            <text class="product-title">浜у搧鏄庣粏</text>
+          </view>
+          <view v-for="(product, pIndex) in currentSales.productData" :key="pIndex" class="product-item">
+            <view class="product-row">
+              <text class="product-label">浜у搧鍚嶇О</text>
+              <text class="product-value">{{ product.productCategory }}</text>
+            </view>
+            <view class="product-row">
+              <text class="product-label">瑙勬牸鍨嬪彿</text>
+              <text class="product-value">{{ product.specificationModel }}</text>
+            </view>
+            <view class="product-row">
+              <text class="product-label">鏁伴噺</text>
+              <text class="product-value">{{ product.quantity }}</text>
+            </view>
+            <view class="product-row">
+              <text class="product-label">鍚◣鍗曚环</text>
+              <text class="product-value">楼{{ Number(product.taxInclusiveUnitPrice || 0).toFixed(2) }}</text>
+            </view>
+            <view class="product-row">
+              <text class="product-label">鍚◣鎬讳环</text>
+              <text class="product-value">楼{{ Number(product.taxInclusiveTotalPrice || 0).toFixed(2) }}</text>
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+
+    <!-- 鍔犺浇鐘舵�� -->
+    <view v-if="salesLoading" class="loading-state">
+      <text>鍔犺浇閿�鍞鎯呬腑...</text>
     </view>
 
     <!-- 瀹℃壒娴佺▼ -->
@@ -83,21 +182,20 @@
       </view>
       
       <view class="input-content">
-        <van-field
+        <u-textarea
           v-model="approvalOpinion"
-          type="textarea"
           rows="4"
           placeholder="璇疯緭鍏ュ鏍告剰瑙�"
           maxlength="200"
-          show-word-limit
+          count
         />
       </view>
     </view>
 
     <!-- 搴曢儴鎿嶄綔鎸夐挳 -->
     <view v-if="canApprove" class="footer-actions">
-      <van-button class="reject-btn" @click="handleReject">椹冲洖</van-button>
-      <van-button class="approve-btn" @click="handleApprove">閫氳繃</van-button>
+      <u-button class="reject-btn" @click="handleReject">椹冲洖</u-button>
+      <u-button class="approve-btn" @click="handleApprove">閫氳繃</u-button>
     </view>
   </view>
 </template>
@@ -105,8 +203,15 @@
 <script setup>
 import { ref, onMounted, computed } from 'vue'
 import { approveProcessGetInfo, approveProcessDetails, updateApproveNode } from '@/api/collaborativeApproval/approvalProcess'
+import { getSalesByCode } from '@/api/procurementManagement/procurementLedger.js'
 import useUserStore from '@/store/modules/user'
-import { showToast } from 'vant'
+
+const showToast = (message) => {
+	uni.showToast({
+		title: message,
+		icon: 'none'
+	})
+}
 import PageHeader from "@/components/PageHeader.vue";
 
 const userStore = useUserStore()
@@ -114,16 +219,44 @@
 const approvalSteps = ref([])
 const approvalOpinion = ref('')
 const approveId = ref('')
+const approveType = ref(0)
+const isSalesApproval = computed(() => Number(approveType.value) === 9)
+const currentSales = ref({})
+const salesLoading = ref(false)
 
 // 浠庤鎯呮帴鍙e瓧娈靛榻� canApprove锛氫粎褰撴湁 isShen 鐨勮妭鐐规椂鍙鎵�
 const canApprove = computed(() => {
   return approvalSteps.value.some(step => step.isShen === true)
 })
 
+// 鑾峰彇瀹℃壒浜嬬敱鏍囩
+const getApproveReasonLabel = () => {
+  const type = Number(approveType.value)
+  if (type === 5) {
+    return '閲囪喘鍚堝悓鍙�'
+  } else if (type === 9) {
+    return '閿�鍞悎鍚屽彿'
+  } else if (type === 10) {
+    return '瀹℃壒浜嬬敱'
+  }
+  return '鐢宠浜嬬敱'
+}
+
+// 璁$畻閿�鍞悎鍚岄噾棰濓紙浜у搧鏄庣粏鍚◣鎬讳环涔嬪拰锛�
+const calculateSalesTotalAmount = () => {
+  const products = currentSales.value?.productData || []
+  const total = products.reduce((sum, item) => {
+    return sum + Number(item.taxInclusiveTotalPrice || 0)
+  }, 0)
+  return total.toFixed(2)
+}
+
 onMounted(() => {
-  const pages = getCurrentPages()
-  const currentPage = pages[pages.length - 1]
-  approveId.value = currentPage.options.approveId
+  approveId.value = uni.getStorageSync('approveId')
+  const storedApproveType = uni.getStorageSync('approveType')
+  if (storedApproveType) {
+    approveType.value = Number(storedApproveType)
+  }
   if (approveId.value) {
     loadApprovalData()
   }
@@ -133,6 +266,24 @@
   // 鍩烘湰鐢宠淇℃伅
   approveProcessGetInfo({ id: approveId.value }).then(res => {
     approvalData.value = res.data || {}
+    // 璁剧疆瀹℃壒绫诲瀷
+    if (res.data && res.data.approveType) {
+      approveType.value = Number(res.data.approveType)
+    }
+    // 閿�鍞鎵癸細鐢ㄥ鎵逛簨鐢卞瓧娈垫壙杞界殑"閿�鍞悎鍚屽彿"鍘绘煡閿�鍞鎯�
+    if (isSalesApproval.value) {
+      const salesContractNo = res.data?.approveReason
+      if (salesContractNo) {
+        salesLoading.value = true
+        getSalesByCode({ salesContractNo }).then(salesRes => {
+          currentSales.value = salesRes || {}
+        }).catch((err) => {
+          console.error('鏌ヨ閿�鍞鎯呭け璐�:', err)
+        }).finally(() => {
+          salesLoading.value = false
+        })
+      }
+    }
   })
   // 瀹℃壒鑺傜偣璇︽儏
   approveProcessDetails(approveId.value).then(res => {
@@ -160,6 +311,7 @@
 }
 
 const goBack = () => {
+  uni.removeStorageSync('approveId');
   uni.navigateBack()
 }
 
@@ -466,17 +618,128 @@
 }
 
 .reject-btn {
-  width: 120px;
-  background: #ff4d4f;
-  color: #fff;
-  border: none;
+    width: 120px;
+    background: #ff4d4f;
+    color: #fff;
+  }
+
+  .approve-btn {
+    width: 120px;
+    background: #52c41a;
+    color: #fff;
+  }
+  
+  /* 閫傞厤u-button鏍峰紡 */
+:deep(.u-button) {
+  border-radius: 6px;
 }
 
-.approve-btn {
-  width: 120px;
-  background: #52c41a;
-  color: #fff;
-  border: none;
+/* 閿�鍞鎯呮牱寮� */
+.sales-detail {
+  background: #fff;
+  margin: 16px;
+  border-radius: 12px;
+  overflow: hidden;
+}
+
+.detail-header {
+  padding: 16px;
+  border-bottom: 1px solid #f0f0f0;
+  background: #f8f9fa;
+}
+
+.detail-title {
+  font-size: 16px;
+  font-weight: 600;
+  color: #333;
+}
+
+.detail-content {
+  padding: 16px;
+}
+
+.detail-row {
+  display: flex;
+  align-items: center;
+  margin-bottom: 12px;
+}
+
+.detail-label {
+  font-size: 14px;
+  color: #666;
+  width: 80px;
+  flex-shrink: 0;
+}
+
+.detail-value {
+  font-size: 14px;
+  color: #333;
+  flex: 1;
+}
+
+.detail-value.highlight {
+  font-size: 18px;
+  color: #e6a23c;
+  font-weight: bold;
+}
+
+.total-row {
+  padding-top: 8px;
+  border-top: 1px solid #f0f0f0;
+  margin-top: 8px;
+}
+
+.product-list {
+  margin-top: 16px;
+  padding-top: 16px;
+  border-top: 1px solid #f0f0f0;
+}
+
+.product-header {
+  margin-bottom: 12px;
+}
+
+.product-title {
+  font-size: 15px;
+  font-weight: 600;
+  color: #333;
+}
+
+.product-item {
+  background: #f8f9fa;
+  border-radius: 8px;
+  padding: 12px;
+  margin-bottom: 8px;
+}
+
+.product-row {
+  display: flex;
+  align-items: center;
+  margin-bottom: 6px;
+}
+
+.product-row:last-child {
+  margin-bottom: 0;
+}
+
+.product-label {
+  font-size: 13px;
+  color: #666;
+  width: 70px;
+  flex-shrink: 0;
+}
+
+.product-value {
+  font-size: 13px;
+  color: #333;
+  flex: 1;
+}
+
+.loading-state {
+  text-align: center;
+  padding: 16px;
+  color: #999;
+  font-size: 14px;
 }
 
 @keyframes pulse {

--
Gitblit v1.9.3