add reasonOptions
This commit is contained in:
@@ -16,13 +16,21 @@
|
||||
</t-cell-group>
|
||||
<t-form v-if="record" class="form" v-entrance-transition="70">
|
||||
<t-form-item label="冲正原因" required-mark>
|
||||
<t-textarea
|
||||
v-model="reason"
|
||||
borderless
|
||||
autosize
|
||||
maxlength="500"
|
||||
placeholder="请输入冲正原因"
|
||||
/>
|
||||
<div class="reason">
|
||||
<t-textarea
|
||||
v-model="reason"
|
||||
borderless
|
||||
autosize
|
||||
maxlength="500"
|
||||
placeholder="请输入或选择冲正原因"
|
||||
/>
|
||||
<t-button
|
||||
size="extra-small"
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
@click="openReasonPicker"
|
||||
>选择</t-button>
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="冲正时间"
|
||||
@@ -68,6 +76,16 @@
|
||||
</div>
|
||||
</t-form>
|
||||
<t-empty v-if="!record" :description="isLoading ? '正在加载资金记录' : '资金记录不存在'" />
|
||||
<t-popup v-model="reasonPickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-if="reasonPickerVisible"
|
||||
v-model="reasonPickerDraft"
|
||||
:columns="reasonPickerColumns"
|
||||
title="选择冲正原因"
|
||||
@cancel="reasonPickerVisible = false"
|
||||
@confirm="confirmReason"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="occurredAtPickerVisible" placement="bottom">
|
||||
<t-date-time-picker
|
||||
v-if="occurredAtPickerVisible"
|
||||
@@ -111,12 +129,23 @@ const remark = ref("");
|
||||
const occurredAtText = ref("");
|
||||
const occurredAtDraftText = ref("");
|
||||
const occurredAtPickerVisible = ref(false);
|
||||
const reasonPickerDraft = ref<string[]>([]);
|
||||
const reasonPickerVisible = ref(false);
|
||||
const photoItems = ref<PhotoItem[]>([]);
|
||||
const isLoading = ref(false);
|
||||
const isSaving = ref(false);
|
||||
const requestNo = ref("");
|
||||
const photoUrlList = computed(() => photoItems.value.map(item => item.url));
|
||||
const canReadSalesOrder = computed(() => userStore.hasPermissions(permissionCodes.salesOrder.read));
|
||||
const reasonOptions = [
|
||||
"客户申请撤销本次资金操作",
|
||||
"收款金额填写有误",
|
||||
"退款金额填写有误",
|
||||
"资金操作重复",
|
||||
"资金操作有误",
|
||||
"订单信息有误"
|
||||
];
|
||||
const reasonPickerColumns = reasonOptions.map(item => ({ label: item, value: item }));
|
||||
|
||||
const minimumDateTimeText = "1970-01-01 00:00";
|
||||
|
||||
@@ -135,6 +164,17 @@ function resetOccurredAt(): void {
|
||||
occurredAtDraftText.value = "";
|
||||
}
|
||||
|
||||
function openReasonPicker(): void {
|
||||
const currentReason = reasonOptions.includes(reason.value.trim()) ? reason.value.trim() : reasonOptions[0];
|
||||
reasonPickerDraft.value = [currentReason];
|
||||
reasonPickerVisible.value = true;
|
||||
}
|
||||
|
||||
function confirmReason(value: Array<string | number>): void {
|
||||
reason.value = String(value[0] || reasonPickerDraft.value[0] || "");
|
||||
reasonPickerVisible.value = false;
|
||||
}
|
||||
|
||||
function buildOccurredAt(): number {
|
||||
return Time.toTimestamp(parseDateTime(occurredAtText.value));
|
||||
}
|
||||
@@ -256,6 +296,18 @@ onUnmounted(() => navBarStore.clearRight());
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.reason {
|
||||
gap: .5rem;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
|
||||
.t-textarea {
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.time-actions {
|
||||
gap: .5rem;
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user