forked from TencentBlueKing/blueking-dbm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(frontend): 单据管理迭代_6 TencentBlueKing#7190
- Loading branch information
Showing
10 changed files
with
149 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
dbm-ui/frontend/src/views/ticket-center/common/action-confirm/ProcessFailedTerminate.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<template> | ||
<DbPopconfirm | ||
:confirm-handler="handleTerminate" | ||
placement="bottom" | ||
:title="t('单据终止确认')" | ||
trigger="click" | ||
:width="400"> | ||
<slot /> | ||
<template #content> | ||
<div style="font-size: 12px; color: #63656e"> | ||
<div> | ||
{{ t('操作:') }} | ||
<BkTag | ||
class="mr-4" | ||
theme="danger" | ||
type="stroke"> | ||
{{ t('终止单据') }} | ||
</BkTag> | ||
<span>{{ t('终止后,单据将作废处理') }}</span> | ||
</div> | ||
<BkForm | ||
ref="terminateForm" | ||
class="mt-14" | ||
form-type="vertical" | ||
:model="terminateFormMode"> | ||
<BkFormItem | ||
:label="t('备注')" | ||
property="remark" | ||
required> | ||
<BkInput | ||
v-model="terminateFormMode.remark" | ||
:maxlength="100" | ||
:rows="3" | ||
type="textarea" /> | ||
</BkFormItem> | ||
</BkForm> | ||
</div> | ||
</template> | ||
</DbPopconfirm> | ||
</template> | ||
<script setup lang="ts"> | ||
import { ref, useTemplateRef } from 'vue'; | ||
import { useI18n } from 'vue-i18n'; | ||
import FlowMode from '@services/model/ticket/flow'; | ||
import TicketModel from '@services/model/ticket/ticket'; | ||
import { revokeFlow, revokeTicket } from '@services/source/ticketFlow'; | ||
import { useEventBus } from '@hooks'; | ||
import { messageSuccess } from '@utils'; | ||
interface Props { | ||
data: TicketModel; | ||
flowData?: FlowMode; | ||
} | ||
const props = defineProps<Props>(); | ||
const { t } = useI18n(); | ||
const eventBus = useEventBus(); | ||
const terminateForm = useTemplateRef('terminateForm'); | ||
const terminateFormMode = reactive({ | ||
remark: '', | ||
}); | ||
const isSubmitting = ref(false); | ||
const handleTerminate = () => { | ||
isSubmitting.value = true; | ||
return terminateForm | ||
.value!.validate() | ||
.then(() => { | ||
if (props.data) { | ||
return revokeTicket({ | ||
ticket_ids: [props.data.id], | ||
}); | ||
} | ||
if (props.flowData) { | ||
return revokeFlow({ | ||
id: props.data.id, | ||
flow_id: props.flowData.id, | ||
}); | ||
} | ||
return Promise.reject(); | ||
}) | ||
.then(() => { | ||
messageSuccess(t('操作成功')); | ||
eventBus.emit('refreshTicketStatus'); | ||
}) | ||
.finally(() => { | ||
isSubmitting.value = false; | ||
}); | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters