|
@@ -19,10 +19,10 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</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>
|
|
|
- <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>
|
|
</el-button>
|
|
|
</div>
|
|
</div>
|
|
@@ -48,6 +48,7 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { computed } from 'vue'
|
|
import { computed } from 'vue'
|
|
|
import moment from 'moment'
|
|
import moment from 'moment'
|
|
|
|
|
+import { ElMessageBox } from 'element-plus'
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
const props = defineProps<{
|
|
|
projects: any
|
|
projects: any
|
|
@@ -58,6 +59,32 @@ const emit = defineEmits<{
|
|
|
'renew-txb': []
|
|
'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 warningClass = computed(() => {
|
|
|
const days = props.projects?.days
|
|
const days = props.projects?.days
|
|
@@ -179,3 +206,12 @@ const warningClass = computed(() => {
|
|
|
color: var(--text3);
|
|
color: var(--text3);
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|
|
|
|
|
+
|
|
|
|
|
+<!-- MessageBox 挂到 body,需非 scoped 才能突出「续签/续标」 -->
|
|
|
|
|
+<style>
|
|
|
|
|
+.project-renew-confirm-box .renew-confirm-keyword {
|
|
|
|
|
+ color: var(--danger, #dc2626);
|
|
|
|
|
+ font-weight: 700;
|
|
|
|
|
+ font-size: 1.15em;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|