add DateTimeNowPicker.vue
This commit is contained in:
@@ -96,23 +96,7 @@
|
||||
</t-form-item>
|
||||
</div>
|
||||
<t-form-item v-if="!isEditMode" label="登记时间" content-align="right">
|
||||
<div class="time-actions">
|
||||
<t-button
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
:content="registeredAtText || '此刻'"
|
||||
@click="openRegisteredAtPicker"
|
||||
/>
|
||||
<t-button
|
||||
v-if="registeredAtText"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="extra-small"
|
||||
content="此刻"
|
||||
@click="resetRegisteredAt"
|
||||
/>
|
||||
</div>
|
||||
<date-time-now-picker v-model="registeredAtText" title="登记时间" :start="minimumDateTimeText" />
|
||||
</t-form-item>
|
||||
<t-form-item v-else label="登记时间" content-align="right">
|
||||
<span class="readonly-time" v-text="registeredAtText || '此刻'" />
|
||||
@@ -182,21 +166,10 @@
|
||||
</div>
|
||||
</t-popup>
|
||||
</div>
|
||||
<t-popup v-model="registeredAtPickerVisible" placement="bottom">
|
||||
<t-date-time-picker
|
||||
v-if="registeredAtPickerVisible"
|
||||
v-model="registeredAtDraftText"
|
||||
:start="minimumDateTimeText"
|
||||
:mode="['date', 'minute']"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
title="登记时间"
|
||||
@cancel="registeredAtPickerVisible = false"
|
||||
@confirm="confirmRegisteredAt"
|
||||
/>
|
||||
</t-popup>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import DateTimeNowPicker from "@/components/DateTimeNowPicker.vue";
|
||||
import { Time } from "timi-web";
|
||||
import { useUserStore } from "timi-web-api";
|
||||
import { Message } from "@/utils/message";
|
||||
@@ -510,23 +483,6 @@ const {
|
||||
|
||||
const minimumDateTimeText = "1970-01-01 00:00";
|
||||
const registeredAtText = ref("");
|
||||
const registeredAtDraftText = ref("");
|
||||
const registeredAtPickerVisible = ref(false);
|
||||
|
||||
function openRegisteredAtPicker(): void {
|
||||
registeredAtDraftText.value = registeredAtText.value || Time.toDateTime(new Date());
|
||||
registeredAtPickerVisible.value = true;
|
||||
}
|
||||
|
||||
function confirmRegisteredAt(value?: string | number): void {
|
||||
registeredAtText.value = String(value || registeredAtDraftText.value);
|
||||
registeredAtPickerVisible.value = false;
|
||||
}
|
||||
|
||||
function resetRegisteredAt(): void {
|
||||
registeredAtText.value = "";
|
||||
registeredAtDraftText.value = "";
|
||||
}
|
||||
|
||||
function buildRegisteredAt(): number {
|
||||
return Time.toTimestamp(parseDateTime(registeredAtText.value));
|
||||
@@ -782,13 +738,6 @@ watch(customerCode, async (value) => {
|
||||
margin: 1rem 0 1rem 1rem;
|
||||
}
|
||||
|
||||
.time-actions {
|
||||
gap: .5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.edit-point-tip {
|
||||
padding: 0 1rem 1rem;
|
||||
font-size: .8125rem;
|
||||
|
||||
@@ -100,23 +100,7 @@
|
||||
<center-tips v-else :content="'暂无可履约明细,请返回订单详情检查'" />
|
||||
<t-form class="form card" label-width="7rem">
|
||||
<t-form-item label="履约时间" content-align="right">
|
||||
<div class="time-actions">
|
||||
<t-button
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
:content="deliveredAtText || '此刻'"
|
||||
@click="openDeliveredAtPicker"
|
||||
/>
|
||||
<t-button
|
||||
v-if="deliveredAtText"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="extra-small"
|
||||
content="此刻"
|
||||
@click="resetDeliveredAt"
|
||||
/>
|
||||
</div>
|
||||
<date-time-now-picker v-model="deliveredAtText" title="履约时间" />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="canDirectVerify" label="直接核销履约" content-align="right">
|
||||
<t-switch v-model="directVerify" size="small" :disabled="isSaving || isStockChecking" />
|
||||
@@ -140,17 +124,6 @@
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-popup v-model="pickerVisible" placement="bottom">
|
||||
<t-date-time-picker
|
||||
v-if="pickerVisible"
|
||||
v-model="draftTime"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
:mode="['date', 'minute']"
|
||||
title="履约时间"
|
||||
@cancel="pickerVisible = false"
|
||||
@confirm="confirmTime"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="unitPickerVisible" placement="bottom">
|
||||
<t-picker v-model="unitPickerDraft" :columns="unitPickerOptions" title="选择实际履约单位" @cancel="unitPickerVisible = false" @confirm="confirmUnitPicker" />
|
||||
</t-popup>
|
||||
@@ -158,10 +131,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import DateTimeNowPicker from "@/components/DateTimeNowPicker.vue";
|
||||
import SalesOrderAPI from "@/api/SalesOrderAPI";
|
||||
import FulfillmentAPI from "@/api/FulfillmentAPI";
|
||||
import ProductAPI from "@/api/ProductAPI";
|
||||
import { Time } from "timi-web";
|
||||
import AttachmentSelector from "@/components/attachmentSelector/AttachmentSelector.vue";
|
||||
import ProductSkuTags from "@/components/ProductSkuTags.vue";
|
||||
import ProductStockPreview from "@/components/ProductStockPreview.vue";
|
||||
@@ -206,8 +179,6 @@ const quantityMap = reactive<Record<string, string | number>>({});
|
||||
const fulfillmentSkuMap = reactive<Record<string, ProductSku>>({});
|
||||
const fulfillmentUnitMap = reactive<Record<string, string>>({});
|
||||
const deliveredAtText = ref("");
|
||||
const draftTime = ref("");
|
||||
const pickerVisible = ref(false);
|
||||
const remark = ref("");
|
||||
const requestNo = ref("");
|
||||
const isSaving = ref(false);
|
||||
@@ -420,21 +391,6 @@ async function confirmUnitPicker(value: Array<string | number>): Promise<void> {
|
||||
await refreshStockPreview();
|
||||
}
|
||||
|
||||
function confirmTime(value: string | number): void {
|
||||
deliveredAtText.value = String(value);
|
||||
pickerVisible.value = false;
|
||||
}
|
||||
|
||||
function openDeliveredAtPicker(): void {
|
||||
draftTime.value = deliveredAtText.value || Time.toDateTime(new Date());
|
||||
pickerVisible.value = true;
|
||||
}
|
||||
|
||||
function resetDeliveredAt(): void {
|
||||
deliveredAtText.value = "";
|
||||
draftTime.value = "";
|
||||
}
|
||||
|
||||
function resolveTimestamp(value: string): number | undefined {
|
||||
if (!value) return undefined;
|
||||
const timestamp = new Date(value.replace(" ", "T")).getTime();
|
||||
@@ -753,13 +709,6 @@ onUnmounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
.time-actions {
|
||||
gap: .5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: .875rem;
|
||||
}
|
||||
|
||||
@@ -50,23 +50,7 @@
|
||||
<t-cell-group title="履约信息" theme="card" v-entrance-transition>
|
||||
<t-cell title="履约时间" content-align="right">
|
||||
<template #note>
|
||||
<div class="time-actions" @click.stop>
|
||||
<t-button
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
:content="deliveredAtText || '此刻'"
|
||||
@click="openDeliveredAtPicker"
|
||||
/>
|
||||
<t-button
|
||||
v-if="deliveredAtText"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="extra-small"
|
||||
content="此刻"
|
||||
@click="resetDeliveredAt"
|
||||
/>
|
||||
</div>
|
||||
<date-time-now-picker v-model="deliveredAtText" title="履约时间" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell v-if="canDirectVerify" title="直接核销履约" content-align="right">
|
||||
@@ -109,22 +93,11 @@
|
||||
:selected-sku-id-list="selectedSkuIdList"
|
||||
@confirm="handleProductSkuSelectionChange"
|
||||
/>
|
||||
<t-popup v-model="timePickerVisible" placement="bottom">
|
||||
<t-date-time-picker
|
||||
v-if="timePickerVisible"
|
||||
v-model="draftTime"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
:mode="['date', 'minute']"
|
||||
title="履约时间"
|
||||
@cancel="timePickerVisible = false"
|
||||
@confirm="confirmTime"
|
||||
/>
|
||||
</t-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Time } from "timi-web";
|
||||
import DateTimeNowPicker from "@/components/DateTimeNowPicker.vue";
|
||||
import type { Attachment } from "timi-web-api";
|
||||
import { useUserStore } from "timi-web-api";
|
||||
import CustomerAPI from "@/api/CustomerAPI";
|
||||
@@ -178,8 +151,6 @@ const isStockChecking = ref(false);
|
||||
const directVerify = ref(false);
|
||||
const stockPreviewList = ref<ProductStockPreviewItem[]>([]);
|
||||
const deliveredAtText = ref("");
|
||||
const timePickerVisible = ref(false);
|
||||
const draftTime = ref("");
|
||||
const remark = ref("");
|
||||
const photoItems = ref<PhotoItem[]>([]);
|
||||
const requestNo = ref("");
|
||||
@@ -261,21 +232,6 @@ function handleFulfillmentChange(itemList: QuickFulfillmentItem[]): void {
|
||||
|
||||
// ---------- 来源订单状态由子组件管理 ----------
|
||||
|
||||
function openDeliveredAtPicker(): void {
|
||||
draftTime.value = deliveredAtText.value || Time.toDateTime(new Date());
|
||||
timePickerVisible.value = true;
|
||||
}
|
||||
|
||||
function confirmTime(value: string | number): void {
|
||||
deliveredAtText.value = String(value);
|
||||
timePickerVisible.value = false;
|
||||
}
|
||||
|
||||
function resetDeliveredAt(): void {
|
||||
deliveredAtText.value = "";
|
||||
draftTime.value = "";
|
||||
}
|
||||
|
||||
function resolveTimestamp(value: string): number | undefined {
|
||||
if (!value) {
|
||||
return undefined;
|
||||
@@ -460,13 +416,6 @@ onUnmounted(() => {
|
||||
margin: .75rem 1rem;
|
||||
}
|
||||
|
||||
.time-actions {
|
||||
gap: .5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.stock-wrap {
|
||||
padding: .5rem 1rem;
|
||||
}
|
||||
|
||||
@@ -169,23 +169,7 @@
|
||||
</t-form>
|
||||
</t-form-item>
|
||||
<t-form-item label="购买时间" content-align="right">
|
||||
<div class="time-actions">
|
||||
<t-button
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
:content="purchasedAtText || '此刻'"
|
||||
@click="openPurchasedAtPicker"
|
||||
/>
|
||||
<t-button
|
||||
v-if="purchasedAtText"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="extra-small"
|
||||
content="此刻"
|
||||
@click="resetPurchasedAt"
|
||||
/>
|
||||
</div>
|
||||
<date-time-now-picker v-model="purchasedAtText" title="购买时间" :start="minimumDateTimeText" />
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
v-if="canReceiveImmediately"
|
||||
@@ -324,21 +308,10 @@
|
||||
</div>
|
||||
</t-popup>
|
||||
</div>
|
||||
<t-popup v-model="purchasedAtPickerVisible" placement="bottom">
|
||||
<t-date-time-picker
|
||||
v-if="purchasedAtPickerVisible"
|
||||
v-model="purchasedAtDraftText"
|
||||
:start="minimumDateTimeText"
|
||||
:mode="['date', 'minute']"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
title="购买时间"
|
||||
@cancel="purchasedAtPickerVisible = false"
|
||||
@confirm="confirmPurchasedAt"
|
||||
/>
|
||||
</t-popup>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import DateTimeNowPicker from "@/components/DateTimeNowPicker.vue";
|
||||
import { Time } from "timi-web";
|
||||
import { useUserStore } from "timi-web-api";
|
||||
import { BottomPopup } from "timi-tdesign-mobile";
|
||||
@@ -499,23 +472,6 @@ function handleScanStatusChange(value: string): void {
|
||||
|
||||
const minimumDateTimeText = "1970-01-01 00:00";
|
||||
const purchasedAtText = ref("");
|
||||
const purchasedAtDraftText = ref("");
|
||||
const purchasedAtPickerVisible = ref(false);
|
||||
|
||||
function openPurchasedAtPicker(): void {
|
||||
purchasedAtDraftText.value = purchasedAtText.value || Time.toDateTime(new Date());
|
||||
purchasedAtPickerVisible.value = true;
|
||||
}
|
||||
|
||||
function confirmPurchasedAt(value?: string | number): void {
|
||||
purchasedAtText.value = String(value || purchasedAtDraftText.value);
|
||||
purchasedAtPickerVisible.value = false;
|
||||
}
|
||||
|
||||
function resetPurchasedAt(): void {
|
||||
purchasedAtText.value = "";
|
||||
purchasedAtDraftText.value = "";
|
||||
}
|
||||
|
||||
function buildPurchasedAt(): number {
|
||||
return Time.toTimestamp(parseDateTime(purchasedAtText.value));
|
||||
@@ -1129,13 +1085,6 @@ watch(config, value => {
|
||||
}
|
||||
}
|
||||
|
||||
.time-actions {
|
||||
gap: .5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.file-input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
@cancel="closeEditDialog"
|
||||
@confirm="saveCategory"
|
||||
>
|
||||
<t-form class="edit-form" label-align="left" label-width="5rem">
|
||||
<t-form class="edit-form" label-width="5rem">
|
||||
<t-form-item label="分类名称" required-mark>
|
||||
<t-input
|
||||
v-model="formModel.name"
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<strong v-text="`单位 ${unitIndex + 1}`" />
|
||||
<t-button v-if="1 < unitList.length" theme="danger" variant="text" size="extra-small" content="删除" @click="removeUnit(unitIndex)" />
|
||||
</div>
|
||||
<t-form class="unit-form" label-align="left" label-width="6rem">
|
||||
<t-form class="unit-form" label-width="6rem">
|
||||
<t-form-item label="单位名称" required-mark>
|
||||
<t-input v-model.trim="unit.name" borderless maxlength="32" placeholder="如 件、盒、箱" />
|
||||
</t-form-item>
|
||||
|
||||
@@ -22,23 +22,7 @@
|
||||
<t-input v-model="quantity" type="number" align="right" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item label="发生时间" content-align="right">
|
||||
<div class="time-actions">
|
||||
<t-button
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
:content="occurredAtText || '此刻'"
|
||||
@click="openOccurredAtPicker"
|
||||
/>
|
||||
<t-button
|
||||
v-if="occurredAtText"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="extra-small"
|
||||
content="此刻"
|
||||
@click="resetOccurredAt"
|
||||
/>
|
||||
</div>
|
||||
<date-time-now-picker v-model="occurredAtText" title="库存发生时间" :start="minimumDateTimeText" />
|
||||
</t-form-item>
|
||||
<t-form-item label="备注" required-mark>
|
||||
<div class="remark-wrap">
|
||||
@@ -70,18 +54,6 @@
|
||||
</t-form>
|
||||
</div>
|
||||
</bottom-popup>
|
||||
<t-popup v-model="occurredAtPickerVisible" placement="bottom">
|
||||
<t-date-time-picker
|
||||
v-if="occurredAtPickerVisible"
|
||||
v-model="occurredAtDraftText"
|
||||
:start="minimumDateTimeText"
|
||||
:mode="['date', 'minute']"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
title="库存发生时间"
|
||||
@cancel="occurredAtPickerVisible = false"
|
||||
@confirm="confirmOccurredAt"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup
|
||||
v-model="unitPickerVisible"
|
||||
placement="bottom"
|
||||
@@ -93,9 +65,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import DateTimeNowPicker from "@/components/DateTimeNowPicker.vue";
|
||||
import { watch } from "vue";
|
||||
import { BottomPopup } from "timi-tdesign-mobile";
|
||||
import { Time } from "timi-web";
|
||||
import ProductAPI from "@/api/ProductAPI";
|
||||
import AttachmentSelector from "@/components/attachmentSelector/AttachmentSelector.vue";
|
||||
import type {
|
||||
@@ -132,8 +104,6 @@ const quantity = ref("");
|
||||
const remark = ref("");
|
||||
const requestNo = ref("");
|
||||
const occurredAtText = ref("");
|
||||
const occurredAtDraftText = ref("");
|
||||
const occurredAtPickerVisible = ref(false);
|
||||
const photoItems = ref<PhotoItem[]>([]);
|
||||
const selectedUnitId = ref("");
|
||||
const unitPickerVisible = ref(false);
|
||||
@@ -153,27 +123,10 @@ function resetForm(): void {
|
||||
remark.value = "";
|
||||
requestNo.value = "";
|
||||
occurredAtText.value = "";
|
||||
occurredAtDraftText.value = "";
|
||||
occurredAtPickerVisible.value = false;
|
||||
photoItems.value = [];
|
||||
selectedUnitId.value = selectableUnits.value[0]?.id || "";
|
||||
}
|
||||
|
||||
function openOccurredAtPicker(): void {
|
||||
occurredAtDraftText.value = occurredAtText.value || Time.toDateTime(new Date());
|
||||
occurredAtPickerVisible.value = true;
|
||||
}
|
||||
|
||||
function confirmOccurredAt(value?: string | number): void {
|
||||
occurredAtText.value = String(value || occurredAtDraftText.value);
|
||||
occurredAtPickerVisible.value = false;
|
||||
}
|
||||
|
||||
function resetOccurredAt(): void {
|
||||
occurredAtText.value = "";
|
||||
occurredAtDraftText.value = "";
|
||||
}
|
||||
|
||||
function openUnitPicker(): void {
|
||||
if (selectableUnits.value.length) {
|
||||
unitDraft.value = [selectedUnitId.value];
|
||||
@@ -290,11 +243,5 @@ watch(() => [visible.value, props.operation] as const, ([isVisible]) => {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.time-actions {
|
||||
gap: .5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -54,23 +54,7 @@
|
||||
label="冲正时间"
|
||||
content-align="right"
|
||||
>
|
||||
<div class="time-actions">
|
||||
<t-button
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
:content="occurredAtText || '此刻'"
|
||||
@click="openOccurredAtPicker"
|
||||
/>
|
||||
<t-button
|
||||
v-if="occurredAtText"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="extra-small"
|
||||
content="此刻"
|
||||
@click="resetOccurredAt"
|
||||
/>
|
||||
</div>
|
||||
<date-time-now-picker v-model="occurredAtText" title="冲正时间" :start="minimumDateTimeText" />
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea
|
||||
@@ -102,22 +86,11 @@
|
||||
@confirm="confirmReason"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="occurredAtPickerVisible" placement="bottom">
|
||||
<t-date-time-picker
|
||||
v-if="occurredAtPickerVisible"
|
||||
v-model="occurredAtDraftText"
|
||||
:start="minimumDateTimeText"
|
||||
:mode="['date', 'minute']"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
title="冲正时间"
|
||||
@cancel="occurredAtPickerVisible = false"
|
||||
@confirm="confirmOccurredAt"
|
||||
/>
|
||||
</t-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import DateTimeNowPicker from "@/components/DateTimeNowPicker.vue";
|
||||
import { Time } from "timi-web";
|
||||
import { useUserStore, type Attachment } from "timi-web-api";
|
||||
import SalesOrderAPI from "@/api/SalesOrderAPI";
|
||||
@@ -146,8 +119,6 @@ const record = ref<FundRecord>();
|
||||
const reason = ref("");
|
||||
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[]>([]);
|
||||
@@ -167,21 +138,6 @@ const reasonPickerColumns = reasonOptions.map(item => ({ label: item, value: ite
|
||||
|
||||
const minimumDateTimeText = "1970-01-01 00:00";
|
||||
|
||||
function openOccurredAtPicker(): void {
|
||||
occurredAtDraftText.value = occurredAtText.value || Time.toDateTime(new Date());
|
||||
occurredAtPickerVisible.value = true;
|
||||
}
|
||||
|
||||
function confirmOccurredAt(value?: string | number): void {
|
||||
occurredAtText.value = String(value || occurredAtDraftText.value);
|
||||
occurredAtPickerVisible.value = false;
|
||||
}
|
||||
|
||||
function resetOccurredAt(): void {
|
||||
occurredAtText.value = "";
|
||||
occurredAtDraftText.value = "";
|
||||
}
|
||||
|
||||
function openReasonPicker(): void {
|
||||
const currentReason = reasonOptions.includes(reason.value.trim()) ? reason.value.trim() : reasonOptions[0];
|
||||
reasonPickerDraft.value = [currentReason];
|
||||
@@ -324,13 +280,6 @@ onMounted(async () => {
|
||||
}
|
||||
}
|
||||
|
||||
.time-actions {
|
||||
gap: .5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.photo-wrap {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
@@ -125,23 +125,7 @@
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item label="下单时间" content-align="right">
|
||||
<div class="time-actions">
|
||||
<t-button
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
:content="purchasedAtText || '此刻'"
|
||||
@click="openTimePicker"
|
||||
/>
|
||||
<t-button
|
||||
v-if="purchasedAtText"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="extra-small"
|
||||
content="此刻"
|
||||
@click="resetPurchasedAt"
|
||||
/>
|
||||
</div>
|
||||
<date-time-now-picker v-model="purchasedAtText" title="下单时间" />
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
v-if="canReceiveImmediately"
|
||||
@@ -223,15 +207,13 @@
|
||||
>提交订单</t-button>
|
||||
</div>
|
||||
<customer-selector v-model="customerIdList" v-model:visible="customerSelectorVisible" selection-mode="single" :enable-scan="false" @change="loadCustomer" />
|
||||
<t-popup v-model="pickerVisible" placement="bottom">
|
||||
<t-date-time-picker v-if="pickerVisible" v-model="draftTime" format="YYYY-MM-DD HH:mm" :mode="['date', 'minute']" title="下单时间" @cancel="pickerVisible = false" @confirm="confirmTime" />
|
||||
</t-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import DateTimeNowPicker from "@/components/DateTimeNowPicker.vue";
|
||||
import { type Attachment, useUserStore } from "timi-web-api";
|
||||
import { AnimatedAmount, Time } from "timi-web";
|
||||
import { AnimatedAmount } from "timi-web";
|
||||
import { DialogPlugin } from "tdesign-mobile-vue";
|
||||
import CustomerAPI from "@/api/CustomerAPI";
|
||||
import ProductAPI from "@/api/ProductAPI";
|
||||
@@ -270,8 +252,6 @@ const customerSelectorVisible = ref(false);
|
||||
const items = ref<FormItem[]>([]);
|
||||
const remark = ref("");
|
||||
const purchasedAtText = ref("");
|
||||
const draftTime = ref("");
|
||||
const pickerVisible = ref(false);
|
||||
const isSaving = ref(false);
|
||||
const photoItems = ref<PhotoItem[]>([]);
|
||||
const paymentPhotoItems = ref<PhotoItem[]>([]);
|
||||
@@ -481,9 +461,6 @@ async function applyScanCode(): Promise<void> {
|
||||
function handleScanStatusChange(value: string): void {
|
||||
scanStatus.value = value;
|
||||
}
|
||||
function openTimePicker(): void { draftTime.value = purchasedAtText.value || Time.toDateTime(new Date()); pickerVisible.value = true; }
|
||||
function confirmTime(value?: string | number): void { purchasedAtText.value = String(value || draftTime.value); pickerVisible.value = false; }
|
||||
function resetPurchasedAt(): void { purchasedAtText.value = ""; draftTime.value = ""; }
|
||||
function resolveTimestamp(value: string): number | undefined {
|
||||
if (!value) return undefined;
|
||||
const timestamp = new Date(value.replace(" ", "T")).getTime();
|
||||
@@ -649,13 +626,6 @@ onMounted(() => {
|
||||
margin: 1rem;
|
||||
}
|
||||
|
||||
.time-actions {
|
||||
gap: .5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.payment-item.disabled {
|
||||
color: var(--td-text-color-disabled);
|
||||
|
||||
|
||||
@@ -56,23 +56,7 @@
|
||||
</t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="收款时间" content-align="right">
|
||||
<div class="time-actions">
|
||||
<t-button
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
:content="occurredAtText || '此刻'"
|
||||
@click="openOccurredAtPicker"
|
||||
/>
|
||||
<t-button
|
||||
v-if="occurredAtText"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="extra-small"
|
||||
content="此刻"
|
||||
@click="resetOccurredAt"
|
||||
/>
|
||||
</div>
|
||||
<date-time-now-picker v-model="occurredAtText" title="收款时间" />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="canDirectVerify" label="直接核销收款" content-align="right">
|
||||
<t-switch v-model="directVerify" size="small" />
|
||||
@@ -101,15 +85,12 @@
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-empty v-if="!order" :description="loading ? '正在加载订单' : '订单不存在'" />
|
||||
<t-popup v-model="pickerVisible" placement="bottom">
|
||||
<t-date-time-picker v-if="pickerVisible" v-model="draftTime" format="YYYY-MM-DD HH:mm" :mode="['date', 'minute']" title="收款时间" @cancel="pickerVisible = false" @confirm="confirmOccurredAt" />
|
||||
</t-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import DateTimeNowPicker from "@/components/DateTimeNowPicker.vue";
|
||||
import { useUserStore, type Attachment } from "timi-web-api";
|
||||
import { Time } from "timi-web";
|
||||
import AttachmentSelector from "@/components/attachmentSelector/AttachmentSelector.vue";
|
||||
import SalesOrderAPI from "@/api/SalesOrderAPI";
|
||||
import type { PhotoItem } from "@/types/Photo";
|
||||
@@ -135,8 +116,6 @@ const loading = ref(false);
|
||||
const saving = ref(false);
|
||||
const amountText = ref("");
|
||||
const occurredAtText = ref("");
|
||||
const draftTime = ref("");
|
||||
const pickerVisible = ref(false);
|
||||
const remark = ref("");
|
||||
const photoItems = ref<PhotoItem[]>([]);
|
||||
const requestNo = ref("");
|
||||
@@ -145,21 +124,6 @@ const canDirectVerify = computed(() => userStore.hasRoles(gaoRoleCodes.storeMana
|
||||
&& userStore.hasPermissions(permissionCodes.fundReceive.create)
|
||||
&& userStore.hasPermissions(permissionCodes.fundReceive.verify));
|
||||
|
||||
function openOccurredAtPicker(): void {
|
||||
draftTime.value = occurredAtText.value || Time.toDateTime(new Date());
|
||||
pickerVisible.value = true;
|
||||
}
|
||||
|
||||
function confirmOccurredAt(value?: string | number): void {
|
||||
occurredAtText.value = String(value || draftTime.value);
|
||||
pickerVisible.value = false;
|
||||
}
|
||||
|
||||
function resetOccurredAt(): void {
|
||||
occurredAtText.value = "";
|
||||
draftTime.value = "";
|
||||
}
|
||||
|
||||
function fillUnpaidAmount(): void {
|
||||
amountText.value = formatPackageAmountInput(order.value?.unpaidAmount);
|
||||
}
|
||||
@@ -250,13 +214,6 @@ onMounted(async () => {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.time-actions {
|
||||
gap: .5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.photo-field {
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
@@ -64,23 +64,7 @@
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item label="退款时间" content-align="right">
|
||||
<div class="time-actions">
|
||||
<t-button
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
:content="occurredAtText || '此刻'"
|
||||
@click="openOccurredAtPicker"
|
||||
/>
|
||||
<t-button
|
||||
v-if="occurredAtText"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="extra-small"
|
||||
content="此刻"
|
||||
@click="resetOccurredAt"
|
||||
/>
|
||||
</div>
|
||||
<date-time-now-picker v-model="occurredAtText" title="退款时间" :start="minimumDateTimeText" />
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea
|
||||
@@ -112,23 +96,11 @@
|
||||
@confirm="confirmRefundReason"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="occurredAtPickerVisible" placement="bottom">
|
||||
<t-date-time-picker
|
||||
v-if="occurredAtPickerVisible"
|
||||
v-model="occurredAtDraftText"
|
||||
:start="minimumDateTimeText"
|
||||
:mode="['date', 'minute']"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
title="退款时间"
|
||||
@cancel="occurredAtPickerVisible = false"
|
||||
@confirm="confirmOccurredAt"
|
||||
/>
|
||||
</t-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Time } from "timi-web";
|
||||
import DateTimeNowPicker from "@/components/DateTimeNowPicker.vue";
|
||||
import { type Attachment, useUserStore } from "timi-web-api";
|
||||
import AttachmentSelector from "@/components/attachmentSelector/AttachmentSelector.vue";
|
||||
import SalesOrderAPI from "@/api/SalesOrderAPI";
|
||||
@@ -159,8 +131,6 @@ const amountText = ref("");
|
||||
const reason = ref("");
|
||||
const minimumDateTimeText = "1970-01-01 00:00";
|
||||
const occurredAtText = ref("");
|
||||
const occurredAtDraftText = ref("");
|
||||
const occurredAtPickerVisible = ref(false);
|
||||
const refundReasonPickerDraft = ref<string[]>([]);
|
||||
const refundReasonPickerVisible = ref(false);
|
||||
const remark = ref("");
|
||||
@@ -178,21 +148,6 @@ const refundReasonOptions = [
|
||||
];
|
||||
const refundReasonPickerColumns = refundReasonOptions.map(item => ({ label: item, value: item }));
|
||||
|
||||
function openOccurredAtPicker(): void {
|
||||
occurredAtDraftText.value = occurredAtText.value || Time.toDateTime(new Date());
|
||||
occurredAtPickerVisible.value = true;
|
||||
}
|
||||
|
||||
function confirmOccurredAt(value?: string | number): void {
|
||||
occurredAtText.value = String(value || occurredAtDraftText.value);
|
||||
occurredAtPickerVisible.value = false;
|
||||
}
|
||||
|
||||
function resetOccurredAt(): void {
|
||||
occurredAtText.value = "";
|
||||
occurredAtDraftText.value = "";
|
||||
}
|
||||
|
||||
function fillRefundAmount(): void {
|
||||
amountText.value = formatPackageAmountInput(refundableAmount.value);
|
||||
}
|
||||
@@ -289,12 +244,6 @@ onMounted(async () => {
|
||||
}
|
||||
}
|
||||
|
||||
.time-actions {
|
||||
gap: .5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user