Răsfoiți Sursa

台账详情进入续签/续标前增加确认提示,并更新忽略与变更记录。

Co-authored-by: Cursor <cursoragent@cursor.com>
wdq 2 zile în urmă
părinte
comite
7d9d618a37
3 a modificat fișierele cu 44 adăugiri și 3 ștergeri
  1. 2 0
      .gitignore
  2. 4 1
      README.md
  3. 38 2
      src/components/ledger/ProjectDetailHeader.vue

+ 2 - 0
.gitignore

@@ -4,6 +4,8 @@ node_modules
 /harness
 AGENTS.md
 sq_manage-原版.zip
+/docs
+/.cursor
 
 # local env files
 .env.local

+ 4 - 1
README.md

@@ -404,4 +404,7 @@ Internal use only.
 7、 增加项目详情页的地图展示,支持点击面展示相关信息,如有员工可查看员工相关数据
 
 - **2026-09-16**
-1、使用AI整理代码,增加代码可读性
+
+1、使用AI整理代码,增加代码可读性
+
+2、从项目台账中进入续签或续标时,增加确认提示

+ 38 - 2
src/components/ledger/ProjectDetailHeader.vue

@@ -19,10 +19,10 @@
         </div>
       </div>
       <div>
-        <el-button type="primary" class="btn enter-btn" @click="emit('renew-xq')">
+        <el-button type="primary" class="btn enter-btn" @click="confirmRenew('xq')">
           进入本项目续签
         </el-button>
-        <el-button type="primary" class="btn enter-btn" @click="emit('renew-txb')">
+        <el-button type="primary" class="btn enter-btn" @click="confirmRenew('txb')">
           进入本项目续标
         </el-button>
       </div>
@@ -48,6 +48,7 @@
 <script setup lang="ts">
 import { computed } from 'vue'
 import moment from 'moment'
+import { ElMessageBox } from 'element-plus'
 
 const props = defineProps<{
   projects: any
@@ -58,6 +59,32 @@ const emit = defineEmits<{
   'renew-txb': []
 }>()
 
+/**
+ * 点击续签/续标前先确认;取消不向上抛事件(父级不会创建数据)。
+ * 确认后再 emit,由父级查重/创建并进入流程页。
+ */
+const confirmRenew = async (type: 'xq' | 'txb') => {
+  const keyword = type === 'xq' ? '续签' : '续标'
+  try {
+    await ElMessageBox.confirm(
+      `是否确认对本项目进行<span class="renew-confirm-keyword">${keyword}</span>?`,
+      '提示',
+      {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning',
+        dangerouslyUseHTMLString: true,
+        customClass: 'project-renew-confirm-box',
+        distinguishCancelAndClose: true,
+      }
+    )
+    if (type === 'xq') emit('renew-xq')
+    else emit('renew-txb')
+  } catch {
+    // 取消或关闭:不创建、不跳转
+  }
+}
+
 /** 与原页一致:按剩余天数映射预警底色 */
 const warningClass = computed(() => {
   const days = props.projects?.days
@@ -179,3 +206,12 @@ const warningClass = computed(() => {
   color: var(--text3);
 }
 </style>
+
+<!-- MessageBox 挂到 body,需非 scoped 才能突出「续签/续标」 -->
+<style>
+.project-renew-confirm-box .renew-confirm-keyword {
+  color: var(--danger, #dc2626);
+  font-weight: 700;
+  font-size: 1.15em;
+}
+</style>