Selaa lähdekoodia

feat(admin): restrict profit share receiver binding by action type

- Add action type check in receiver binding logic
- Update UI conditions to include action type for button display
- Ensure only verified and newly added receivers can be bound
runphp 4 kuukautta sitten
vanhempi
sitoutus
1bb6d467c2

+ 2 - 2
resource/admin/ProfitShareReceiver.vue

@@ -152,7 +152,7 @@
       <template #footer>
         <span class="dialog-footer">
           <el-button 
-            v-if="detailData.status === 1"
+            v-if="detailData.status === 1 && detailData.action === 'ADD'"
             type="success" 
             @click="handleCreateApplication"
             :loading="applyLoading"
@@ -160,7 +160,7 @@
             分账接收方创建申请
           </el-button>
           <el-button 
-            v-if="detailData.status === 3"
+            v-if="detailData.status === 3 && detailData.action === 'ADD'"
             type="success" 
             @click="handleBindApplication"
             :loading="applyLoading"

+ 2 - 2
src/Entity/ProfitShareReceiverEntity.php

@@ -132,8 +132,8 @@ class ProfitShareReceiverEntity extends BaseEntity
     public function bind(int $id): self
     {
         $entity = $this->getReceiver(['id' => $id]);
-        if ($entity->status != ReceiverStatusEnum::VERIFIED) {
-            throw_logic_exception('验证通过状态才可以绑定!');
+        if ($entity->status != ReceiverStatusEnum::VERIFIED || $entity->action != ReceiverActionEnum::ADD) {
+            throw_logic_exception('验证通过状态新增记录才可以绑定!');
         }
         if (!$entity->entrust_file_path) {
             if (!$entity->entrust_local_path) {