wuhb 5 дней назад
Родитель
Сommit
b209a43b59
4 измененных файлов с 42 добавлено и 20 удалено
  1. 2 1
      pages/apply/applyInfo.uvue
  2. 25 10
      pages/index/index.uvue
  3. 6 7
      pages/pro/create.uvue
  4. 9 2
      pages/pro/detail.uvue

+ 2 - 1
pages/apply/applyInfo.uvue

@@ -94,6 +94,7 @@
 <script setup lang="uts">
     import { ref, computed } from 'vue'
     import { getPurchaseApplyById, confirmPurchaseApply, deletePurchaseApply } from '../../api/apply/index'
+	import { checkPermission } from '../../utils/permission'
 
     const applyId = ref<string>("")
     const applyCode = ref<string>("")
@@ -105,7 +106,7 @@
 
     const showPurchaseButton = computed((): boolean => {
         const status = applyStatus.value
-        if (status != null && status.trim() === 'CONFIRMED') {
+        if (status != null && status.trim() === 'CONFIRMED' && checkPermission('mes:wm:mergePurchase:add')) {
             return true
         }
         return false

+ 25 - 10
pages/index/index.uvue

@@ -6,7 +6,7 @@
 		</view> -->
         <!-- 快捷功能卡片 -->
         <view class="quick-cards">
-            <view v-for="(item, index) in quickFunctions" :key="index" class="quick-card" @click="handleQuickClick(item)">
+            <view v-for="(item, index) in filteredQuickFunctions" :key="index" class="quick-card" @click="handleQuickClick(item)">
                 <image class="quick-card-bg" :src="item.bgImage" mode="aspectFill"></image>
                 <view class="quick-card-content">
                     <text class="quick-card-title">{{ item.title }}</text>
@@ -80,6 +80,7 @@
         icon: string
         path: string
 		badge:number
+		permission: string
     }
 	const receiveListData = ref<UTSJSONObject[]>([])
 	const receiveLoading = ref<boolean>(false)
@@ -88,15 +89,15 @@
 	let refreshTimer: number | null = null
 	let timerLock = false
 	
-	// 快捷功能列表
-    const quickFunctions = ref<QuickFunction[]>([
+	const quickFunctions = ref<QuickFunction[]>([
         {
             id: 1,
             title: '物料申请',
             bgImage: '/static/images/workbench/3.png',
             icon: '',
             path: '/pages/apply/index',
-			badge: 0
+			badge: 0,
+			permission: 'mes:wm:purchaseApply:list'
         },
         {
             id: 2,
@@ -104,7 +105,8 @@
             bgImage: '/static/images/workbench/2.png',
             icon: '',
             path: '/pages/out/index',
-			badge: 0
+			badge: 0,
+			permission: 'mes:wm:productsalse:list'
         },
         {
             id: 3,
@@ -112,7 +114,8 @@
             bgImage: '/static/images/workbench/4.png',
             icon: '',
             path: '/pages/item/index',
-			badge: 0
+			badge: 0,
+			permission: 'mes:md:mditem:list'
         },
         {
             id: 4,
@@ -120,15 +123,17 @@
             bgImage: '/static/images/workbench/5.png',
             icon: '',
             path: '/pages/pro/index',
-			badge: 0
+			badge: 0,
+			permission: 'mes:pro:proreport:list'
         },
         {
             id: 5,
-            title: '质检',
+            title: '采购订单',
             bgImage: '/static/images/workbench/6.png',
             icon: '',
             path: '/pages/quality/index',
-			badge: 0
+			badge: 0,
+			permission: 'wm:purchase:list'
         },
         {
             id: 6,
@@ -136,9 +141,19 @@
             bgImage: '/static/images/workbench/7.png',
             icon: '',
             path: '/pages/warehouse/index',
-			badge: 0
+			badge: 0,
+			permission: 'mes:wm:productrecpt:list'
         }
     ])
+
+	const filteredQuickFunctions = computed(() => {
+		return quickFunctions.value.filter(item => {
+			if (!item.permission || item.permission.length === 0) {
+				return true
+			}
+			return checkPermission(item.permission)
+		})
+	})
 	
 	// 快捷功能点击
 	const handleQuickClick = (item: QuickFunction): void => {

+ 6 - 7
pages/pro/create.uvue

@@ -76,13 +76,9 @@
 			</view>
 		</scroll-view>
 
-		<view class="bottom-buttons" v-if="isEdit && formStatus === 'PREPARE'">
+		<view class="bottom-buttons" v-if="formStatus === 'PREPARE'">
 			<button class="save-btn" @click="handleSave">保存</button>
-			<button class="confirm-btn" @click="handleConfirm">确认</button>
-		</view>
-		<view class="bottom-buttons" v-if="!isEdit">
-			<button class="save-btn" @click="handleSave">保存</button>
-			<button class="confirm-btn" @click="handleSaveAndConfirm">保存并确认</button>
+			<button class="confirm-btn" @click="handleSaveAndConfirm">保存&确认</button>
 		</view>
 
 		<view v-if="showProductPicker" class="picker-modal">
@@ -399,7 +395,10 @@
 		const endTime = formData.value['endTime']
 		data['endTime'] = endTime ? `${reportDate} ${endTime}:00` : ''
 		
-		data['remark'] = formData.value['remark']
+		const remark = formData.value['remark']
+		if (remark && remark.trim().length > 0) {
+			data['remark'] = remark.trim()
+		}
 		return data
 	}
 

+ 9 - 2
pages/pro/detail.uvue

@@ -1,7 +1,7 @@
 <template>
 	<uni-navbar-lite :showRight=false :title="title"></uni-navbar-lite>
 	<view class="page-container">
-		<scroll-view class="page-content" :scroll-y="true">
+		<scroll-view class="page-content" :scroll-y="true" :style="pageContentStyle">
 			<view class="section">
 				<view class="section-header">
 					<view class="section-indicator"></view>
@@ -66,7 +66,7 @@
 				</view>
 			</view>
 
-			<view class="section" v-if="remark.length > 0">
+			<view class="section" v-if="remark && remark.length > 0">
 				<view class="section-header">
 					<view class="section-indicator"></view>
 					<text class="section-title">备注</text>
@@ -114,9 +114,16 @@
 	})
 
 	const showBottomButtons = computed(() => {
+		if (!status.value || status.value.length === 0) return false
 		return status.value === 'CONFIRMED' && (hasFinishPermission.value || hasUndoPermission.value)
 	})
 
+	const pageContentStyle = computed(() => {
+		return {
+			paddingBottom: showBottomButtons.value ? '130rpx' : '20rpx'
+		}
+	})
+
 	const statusText = computed(() => {
 		switch (status.value) {
 			case 'PREPARE': return '草稿'