Explorar o código

添加退回功能

yuanmingze hai 1 mes
pai
achega
d998391520

+ 2 - 2
.env.development

@@ -1,4 +1,4 @@
 VITE_APP_ENV = dev
 VITE_APP_ENV = dev
-# VITE_APP_URL = https://hcppreapi.yaoyi.net
+VITE_APP_URL = https://hcppre.yaoyi.net
 
 
-VITE_APP_URL = https://hcpapi.yaoyi.net
+# VITE_APP_URL = https://hcpapi.yaoyi.net

+ 1 - 1
src/components/ModernDialog.vue

@@ -103,7 +103,7 @@ const handleClose = () => {
   inset: 50% auto auto 50%;
   inset: 50% auto auto 50%;
   transform: translate(-50%, -50%);
   transform: translate(-50%, -50%);
   z-index: 9999;
   z-index: 9999;
-  width: 80vw;
+  width: 90vw;
   border-radius: 5vw;
   border-radius: 5vw;
   background: #fff;
   background: #fff;
   box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
   box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);

+ 7 - 0
src/services/modules/invoiceInformation/index.ts

@@ -28,3 +28,10 @@ export const submitInvoiceApplyApi = (data: PushRecordIdRequest) => {
     data: data,
     data: data,
   })
   })
 }
 }
+
+export const invoiceRecordInvalidateApi = (data: PushRecordIdRequest) => {
+  return http.post({
+    url: '/admin/invoice-record/invalidate-for-h5',
+    data: data,
+  })
+}

+ 81 - 10
src/views/invoice-information/index.vue

@@ -104,31 +104,51 @@
       </template>
       </template>
     </div>
     </div>
 
 
+    <!-- 底部操作按钮 -->
     <!-- 底部操作按钮 -->
     <!-- 底部操作按钮 -->
     <div class="bottom-bar">
     <div class="bottom-bar">
+      <van-button type="primary" plain round class="reject-btn btn" @click="rejectAndReturn">
+        拒绝并退回
+      </van-button>
+
       <van-button
       <van-button
         type="primary"
         type="primary"
-        block
         :disabled="btnDisabled"
         :disabled="btnDisabled"
         round
         round
-        class="next-btn"
+        class="next-btn btn"
         @click="handleNextDebounced"
         @click="handleNextDebounced"
       >
       >
         下一步
         下一步
       </van-button>
       </van-button>
     </div>
     </div>
+
+    <!-- 拒绝并退回 -->
+    <ModernDialog
+      v-model:show="rejectAndReturnDialog"
+      title="提示"
+      message="确认拒绝后,信息会同步给项目执行人员"
+      cancelText="返回开票页"
+      @cancel="rejectAndReturnDialog = false"
+      confirmText="确认拒绝"
+      @confirm="rejectAndReturnDialogConfirm"
+    />
   </div>
   </div>
 </template>
 </template>
 
 
 <script setup lang="ts">
 <script setup lang="ts">
 import { ref, reactive, onMounted } from 'vue'
 import { ref, reactive, onMounted } from 'vue'
-import { showToast } from 'vant'
+
+import { showToast, showSuccessToast } from 'vant'
 import { useRouter } from 'vue-router'
 import { useRouter } from 'vue-router'
 import { useDebounceFn } from '@/utils/util'
 import { useDebounceFn } from '@/utils/util'
 import StepProgress from '@/components/StepProgress.vue'
 import StepProgress from '@/components/StepProgress.vue'
-import { getConfirmInvoiceInfoApi } from '@/services/modules/invoiceInformation'
+import {
+  getConfirmInvoiceInfoApi,
+  invoiceRecordInvalidateApi,
+} from '@/services/modules/invoiceInformation'
 import type { PushRecordIdRequest } from '@/services/modules/invoiceInformation/type.d.ts'
 import type { PushRecordIdRequest } from '@/services/modules/invoiceInformation/type.d.ts'
 import { useUserStore } from '@/stores/modules/user'
 import { useUserStore } from '@/stores/modules/user'
+import ModernDialog from '@/components/ModernDialog.vue'
 
 
 // ✅ 使用封装好的 Hook
 // ✅ 使用封装好的 Hook
 import { useInvoice } from '@/hooks/useInvoice'
 import { useInvoice } from '@/hooks/useInvoice'
@@ -183,6 +203,27 @@ const handleNext = async () => {
   await submitInvoiceApply()
   await submitInvoiceApply()
 }
 }
 
 
+const rejectAndReturnDialog = ref(false)
+// 拒绝并退回
+const rejectAndReturn = () => {
+  rejectAndReturnDialog.value = true
+}
+
+const rejectAndReturnDialogConfirm = async () => {
+  const res = await invoiceRecordInvalidateApi(params)
+  if (res.code === 0 && res.data) {
+    showSuccessToast('提交成功')
+    setTimeout(() => {
+      router.replace({
+        path: '/login',
+        query: {
+          pushRecordId: userStore.pushRecordId,
+        },
+      })
+      userStore.LogOut()
+    }, 1500)
+  }
+}
 /** 防抖包装 */
 /** 防抖包装 */
 const handleNextDebounced = useDebounceFn(handleNext, 1000)
 const handleNextDebounced = useDebounceFn(handleNext, 1000)
 
 
@@ -329,19 +370,49 @@ onMounted(async () => {
   }
   }
 
 
   /* ---------- 底部按钮 ---------- */
   /* ---------- 底部按钮 ---------- */
+
   .bottom-bar {
   .bottom-bar {
     position: fixed;
     position: fixed;
-    bottom: 4vw;
+    bottom: 0;
     left: 0;
     left: 0;
     right: 0;
     right: 0;
-    width: 100%;
+    z-index: 1000;
 
 
-    .next-btn {
+    padding: 3vw 4vw 4vw;
+    background: #f7f9fc;
+    box-shadow: 0 -2vw 6vw rgba(0, 0, 0, 0.08);
+
+    display: flex;
+    gap: 3vw;
+
+    /* ---------- 通用按钮 ---------- */
+    .btn {
+      flex: 1;
+      min-width: 0; // ⭐ 关键:防止被挤出
+      height: 12vw;
       font-size: 4.2vw;
       font-size: 4.2vw;
+      border-radius: 6vw;
+
+      white-space: normal; // 覆盖 van-button 默认 nowrap
+    }
+
+    /* ---------- 左侧按钮(次操作) ---------- */
+    .reject-btn {
+      background: #ffffff;
+      color: #3a7afe;
+      border: 1px solid #3a7afe;
+    }
+
+    /* ---------- 右侧按钮(主操作) ---------- */
+    .next-btn {
+      color: #fff;
       background: linear-gradient(90deg, #0072f8 0%, #3a9fff 100%);
       background: linear-gradient(90deg, #0072f8 0%, #3a9fff 100%);
-      width: 90%;
-      margin: 0 auto;
-      height: 12vw;
+      border: none;
+    }
+
+    /* ---------- 禁用态兜底(Vant) ---------- */
+    :deep(.van-button--disabled) {
+      opacity: 0.6;
     }
     }
   }
   }
 
 

+ 3 - 0
src/views/login/index.vue

@@ -310,6 +310,9 @@ const getPubName = async () => {
       registerUrlParams.value.areaId = res.data.cityCode
       registerUrlParams.value.areaId = res.data.cityCode
       userStore.setNeedFaceId(res.data.needFaceId)
       userStore.setNeedFaceId(res.data.needFaceId)
       registerUrlParams.value.pushRecordId = sendEtsSms.pushRecordId
       registerUrlParams.value.pushRecordId = sendEtsSms.pushRecordId
+    } else {
+      codeMessage.value = res.msg
+      showDialog.value = true
     }
     }
   } catch (err) {
   } catch (err) {
     console.log('err', err)
     console.log('err', err)