Эх сурвалжийг харах

feat(zfgl): 增加操作者信息并控制收据权限

- 在合同信息中添加操作者字段,默认为当前用户- 根据用户权限控制收据和退据按钮的可用状态
- 从本地存储获取用户信息,用于显示和权限判断
nahida 9 сар өмнө
parent
commit
b587768276

+ 17 - 0
src/views/zfgl/zfhtgl.vue

@@ -73,6 +73,7 @@ interface ReceiptDto {
   wyf: number // 物业费
   sf: number // 水费
   paymentReason: string // 付款事由
+  operator: string
 }
 
 interface CanBeReturnReceiptDataReponse extends BaseResponse {
@@ -99,6 +100,19 @@ enum FileType {
   PNG = 'png',
 }
 
+//权限相关
+const permission = localStorage.getItem('userInfo')
+const userInfo = ref<{
+  personName: string
+  deptName: string
+  deptId: string
+  errorCode: number
+  personCode: string
+  userName: string
+  isBusinessAtt: boolean
+  message: string
+}>(permission ? JSON.parse(permission) : null)
+
 // 响应式数据
 const loading = ref(false)
 const tableData = ref<AContractInfo[]>([])
@@ -151,6 +165,7 @@ const receiptForm = reactive<ReceiptDto>({
   wyf: 0,
   sf: 0,
   paymentReason: '房屋租赁费用',
+  operator: userInfo.value.personName,
 })
 
 // 退据相关
@@ -1027,6 +1042,7 @@ onMounted(() => {
                   size="small"
                   text
                   :icon="Receipt"
+                  :disabled="!userInfo.isBusinessAtt"
                   @click="openReceiptDialog(row.id, row.contractNumber)"
                 >
                   获取收据
@@ -1038,6 +1054,7 @@ onMounted(() => {
                   size="small"
                   text
                   :icon="RotateCcw"
+                  :disabled="!userInfo.isBusinessAtt"
                   @click="openReturnReceiptDialog(row.id, row.contractNumber)"
                 >
                   获取退据