add DateTimeNowPicker.vue
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user