fix layout
This commit is contained in:
@@ -1,163 +1,167 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="客户详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="customer?.id && userStore.hasPermissions(permissionCodes.customer.update)"
|
||||
@click="toEdit"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="编辑"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div
|
||||
v-if="customer"
|
||||
v-can="permissionCodes.customer.read"
|
||||
class="customer-detail"
|
||||
>
|
||||
<customer-profile-card
|
||||
v-entrance-transition
|
||||
class="customer"
|
||||
:customer="customer"
|
||||
/>
|
||||
<t-cell-group v-entrance-transition class="info" theme="card">
|
||||
<t-cell title="出生日期">
|
||||
<span
|
||||
v-if="isLunarBirthdate"
|
||||
class="birthdate-trigger gray"
|
||||
type="button"
|
||||
@click.stop="toggleBirthdateText"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="客户详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="customer?.id && userStore.hasPermissions(permissionCodes.customer.update)"
|
||||
@click="toEdit"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="编辑"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div
|
||||
v-if="customer"
|
||||
v-can="permissionCodes.customer.read"
|
||||
class="customer-detail"
|
||||
>
|
||||
<customer-profile-card
|
||||
v-entrance-transition
|
||||
class="customer"
|
||||
:customer="customer"
|
||||
/>
|
||||
<t-cell-group v-entrance-transition class="info" theme="card">
|
||||
<t-cell title="出生日期">
|
||||
<span
|
||||
v-if="isLunarBirthdate"
|
||||
class="birthdate-trigger gray"
|
||||
type="button"
|
||||
@click.stop="toggleBirthdateText"
|
||||
>
|
||||
<span v-text="birthdateText" />
|
||||
</span>
|
||||
<span v-else v-text="birthdateText" />
|
||||
</t-cell>
|
||||
<t-cell title="年龄" :note="ageText" />
|
||||
<t-cell title="调理部位" :note="selectedAreaText" arrow @click="openBodyAreaPicker" />
|
||||
<t-cell title="住址" :note="Text.display(customer.address)" />
|
||||
<t-cell title="病症" :note="Text.display(customer.disease)" />
|
||||
<t-cell title="备注" :note="Text.display(customer.remark)" />
|
||||
<t-cell title="录入用户" :note="Text.display(customer.creatorUser?.nick || customer.creatorUser?.name)" />
|
||||
<t-cell title="录入时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="customer.createdAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<card-container v-entrance-transition>
|
||||
<attachment-selector
|
||||
class="attachment-selector"
|
||||
:items="photoItemList"
|
||||
title="照片列表"
|
||||
readonly
|
||||
>
|
||||
<template #item-label="{ item }">
|
||||
<span v-text="getAttachmentTypeText(item.attachType)" />
|
||||
</template>
|
||||
<template #viewer-actions="{ item, index, close }">
|
||||
<attachment-viewer-actions
|
||||
v-if="canUpdateCustomer"
|
||||
:attach-type="item.attachType"
|
||||
:busy="isPhotoSaving"
|
||||
@change-type="changePhotoType(index, $event, close)"
|
||||
@remove="removePhoto(index, close)"
|
||||
/>
|
||||
</template>
|
||||
</attachment-selector>
|
||||
</card-container>
|
||||
<customer-tag-card
|
||||
v-if="canReadTag"
|
||||
:editable="canApplyTag"
|
||||
:tag-list="customerTagList"
|
||||
v-entrance-transition
|
||||
@edit="openTagSelector"
|
||||
/>
|
||||
<t-cell-group v-if="canReadSalesOrder" title="销售订单" theme="card" v-entrance-transition>
|
||||
<t-cell title="产品订单列表" arrow @click="toProductOrderList">
|
||||
<template #left-icon>
|
||||
<t-icon name="task" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="套餐订单列表" arrow @click="toPackageOrderList">
|
||||
<template #left-icon>
|
||||
<t-icon name="gift" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group theme="card" v-entrance-transition>
|
||||
<t-cell v-if="canReadEventRecord" title="最近登记事件" arrow @click="toEventRecordList">
|
||||
<template #left-icon>
|
||||
<t-icon name="history" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell v-if="canReadStat" title="客户数据图表" arrow @click="toCustomerDataCharts">
|
||||
<template #left-icon>
|
||||
<t-icon name="chart" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell
|
||||
v-if="canReadPointAccount"
|
||||
title="积分余额"
|
||||
:note="pointBalanceText"
|
||||
arrow
|
||||
@click="toPointAccount"
|
||||
>
|
||||
<template #left-icon>
|
||||
<t-icon name="money" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group
|
||||
v-if="inviter"
|
||||
:title="`由 ${inviter.name} 邀请`"
|
||||
theme="card"
|
||||
v-entrance-transition
|
||||
>
|
||||
<span v-text="birthdateText" />
|
||||
</span>
|
||||
<span v-else v-text="birthdateText" />
|
||||
</t-cell>
|
||||
<t-cell title="年龄" :note="ageText" />
|
||||
<t-cell title="调理部位" :note="selectedAreaText" arrow @click="openBodyAreaPicker" />
|
||||
<t-cell title="住址" :note="Text.display(customer.address)" />
|
||||
<t-cell title="病症" :note="Text.display(customer.disease)" />
|
||||
<t-cell title="备注" :note="Text.display(customer.remark)" />
|
||||
<t-cell title="录入用户" :note="Text.display(customer.creatorUser?.nick || customer.creatorUser?.name)" />
|
||||
<t-cell title="录入时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="customer.createdAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<card-container v-entrance-transition>
|
||||
<attachment-selector
|
||||
class="attachment-selector"
|
||||
:items="photoItemList"
|
||||
title="照片列表"
|
||||
readonly
|
||||
>
|
||||
<template #item-label="{ item }">
|
||||
<span v-text="getAttachmentTypeText(item.attachType)" />
|
||||
</template>
|
||||
<template #viewer-actions="{ item, index, close }">
|
||||
<attachment-viewer-actions
|
||||
v-if="canUpdateCustomer"
|
||||
:attach-type="item.attachType"
|
||||
:busy="isPhotoSaving"
|
||||
@change-type="changePhotoType(index, $event, close)"
|
||||
@remove="removePhoto(index, close)"
|
||||
/>
|
||||
</template>
|
||||
</attachment-selector>
|
||||
</card-container>
|
||||
<customer-tag-card
|
||||
v-if="canReadTag"
|
||||
:editable="canApplyTag"
|
||||
:tag-list="customerTagList"
|
||||
v-entrance-transition
|
||||
@edit="openTagSelector"
|
||||
/>
|
||||
<t-cell-group v-if="canReadSalesOrder" title="销售订单" theme="card" v-entrance-transition>
|
||||
<t-cell title="产品订单列表" arrow @click="toProductOrderList">
|
||||
<template #left-icon>
|
||||
<t-icon name="task" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="套餐订单列表" arrow @click="toPackageOrderList">
|
||||
<template #left-icon>
|
||||
<t-icon name="gift" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group theme="card" v-entrance-transition>
|
||||
<t-cell v-if="canReadEventRecord" title="最近登记事件" arrow @click="toEventRecordList">
|
||||
<template #left-icon>
|
||||
<t-icon name="history" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell v-if="canReadStat" title="客户数据图表" arrow @click="toCustomerDataCharts">
|
||||
<template #left-icon>
|
||||
<t-icon name="chart" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell
|
||||
v-if="canReadPointAccount"
|
||||
title="积分余额"
|
||||
:note="pointBalanceText"
|
||||
arrow
|
||||
@click="toPointAccount"
|
||||
>
|
||||
<template #left-icon>
|
||||
<t-icon name="money" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group
|
||||
v-if="inviter"
|
||||
:title="`由 ${inviter.name} 邀请`"
|
||||
theme="card"
|
||||
v-entrance-transition
|
||||
>
|
||||
<customer-profile-card :customer="inviter" @click="toCustomerDetail(inviter)"/>
|
||||
</t-cell-group>
|
||||
<t-cell-group theme="card">
|
||||
<t-cell title="邀请客户" :note="inviteeCountText" arrow @click="toInviteeList" />
|
||||
</t-cell-group>
|
||||
<t-cell-group v-if="canReadFollowUpReminder" title="客户跟进" theme="card">
|
||||
<t-cell title="跟进提醒" note="查看客户提醒" arrow @click="toFollowUpReminderList" />
|
||||
</t-cell-group>
|
||||
<t-button
|
||||
v-can="permissionCodes.customer.delete"
|
||||
class="delete-action"
|
||||
theme="danger"
|
||||
:loading="isRemoving"
|
||||
@click="confirmRemoveCustomer"
|
||||
>
|
||||
删除客户
|
||||
</t-button>
|
||||
<tag-selector
|
||||
v-model="selectedTagIdList"
|
||||
v-model:visible="tagSelectorVisible"
|
||||
@change="handleTagSelected"
|
||||
/>
|
||||
<bottom-popup
|
||||
v-model="bodyAreaPickerVisible"
|
||||
title="调理部位"
|
||||
height="38rem"
|
||||
left-button-text="关闭"
|
||||
right-button-text=""
|
||||
@left-button-click="closeBodyAreaPicker"
|
||||
>
|
||||
<body-area-selector :model-value="selectedAreas" readonly />
|
||||
</bottom-popup>
|
||||
<customer-remove-dialog
|
||||
v-model:visible="removeDialogVisible"
|
||||
:customer="removeTarget"
|
||||
:loading="isRemoving"
|
||||
@confirm="removeConfirmedCustomer"
|
||||
/>
|
||||
<customer-profile-card :customer="inviter" @click="toCustomerDetail(inviter)"/>
|
||||
</t-cell-group>
|
||||
<t-cell-group theme="card">
|
||||
<t-cell title="邀请客户" :note="inviteeCountText" arrow @click="toInviteeList" />
|
||||
</t-cell-group>
|
||||
<t-cell-group v-if="canReadFollowUpReminder" title="客户跟进" theme="card">
|
||||
<t-cell title="跟进提醒" note="查看客户提醒" arrow @click="toFollowUpReminderList" />
|
||||
</t-cell-group>
|
||||
<t-button
|
||||
v-can="permissionCodes.customer.delete"
|
||||
class="delete-action"
|
||||
theme="danger"
|
||||
:loading="isRemoving"
|
||||
@click="confirmRemoveCustomer"
|
||||
>
|
||||
删除客户
|
||||
</t-button>
|
||||
<tag-selector
|
||||
v-model="selectedTagIdList"
|
||||
v-model:visible="tagSelectorVisible"
|
||||
@change="handleTagSelected"
|
||||
/>
|
||||
<bottom-popup
|
||||
v-model="bodyAreaPickerVisible"
|
||||
title="调理部位"
|
||||
height="38rem"
|
||||
left-button-text="关闭"
|
||||
right-button-text=""
|
||||
@left-button-click="closeBodyAreaPicker"
|
||||
>
|
||||
<body-area-selector :model-value="selectedAreas" readonly />
|
||||
</bottom-popup>
|
||||
<customer-remove-dialog
|
||||
v-model:visible="removeDialogVisible"
|
||||
:customer="removeTarget"
|
||||
:loading="isRemoving"
|
||||
@confirm="removeConfirmedCustomer"
|
||||
/>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -569,7 +573,7 @@ watch(() => route.params.id, loadCustomer);
|
||||
<style scoped lang="less">
|
||||
.customer-detail {
|
||||
gap: 1rem;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 2rem;
|
||||
padding: 0 0 2rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
+223
-219
@@ -1,230 +1,234 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(savePermissionCode)"
|
||||
:disabled="isCustomerBound"
|
||||
@click="doSubmit"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="保存"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="savePermissionCode" class="customer-edit">
|
||||
<t-form class="form card" label-width="5rem" :disabled="isCustomerBound" v-entrance-transition>
|
||||
<t-form-item label="客户编码">
|
||||
<t-input
|
||||
v-model.trim="formData.code"
|
||||
placeholder="客户编码"
|
||||
borderless
|
||||
:disabled="false"
|
||||
@blur="handleCodeBlur"
|
||||
>
|
||||
<template #suffix-icon>
|
||||
<t-button
|
||||
theme="primary"
|
||||
size="extra-small"
|
||||
:disabled="false"
|
||||
@click="toggleScanner"
|
||||
>
|
||||
<span v-text="scannerVisible ? '关闭扫码' : '扫码'" />
|
||||
</t-button>
|
||||
</template>
|
||||
</t-input>
|
||||
</t-form-item>
|
||||
<div v-if="scannerVisible" class="code-scanner-wrapper">
|
||||
<code-scanner
|
||||
visible
|
||||
:status-text="scanStatus"
|
||||
active-text="正在识别客户编码"
|
||||
@decode="handleDecodedText"
|
||||
@status-change="handleScanStatusChange"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="isCustomerBound" class="bound-customer">
|
||||
<customer-profile-card :customer="boundCodeCustomer" />
|
||||
<div class="tips red">
|
||||
<t-icon name="error-circle" />
|
||||
<span v-text="isCreateMode ? '该编码已绑定客户,不可新录入' : '该编码已绑定其他客户,请使用新的编码'" />
|
||||
</div>
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
block
|
||||
v-if="userStore.hasPermissions(savePermissionCode)"
|
||||
:disabled="isCustomerBound"
|
||||
@click="doSubmit"
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
:disabled="false"
|
||||
@click="toBoundCustomerEdit"
|
||||
>编辑该客户</t-button>
|
||||
</div>
|
||||
<t-form-item label="姓名" required-mark>
|
||||
<t-input
|
||||
v-model.trim="formData.name"
|
||||
placeholder="姓名"
|
||||
borderless
|
||||
:disabled="isCustomerBound"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="保存"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="出生日期">
|
||||
<birthdate-picker
|
||||
v-model="formData.birthdate"
|
||||
v-model:calendar="formData.birthdateCalendar"
|
||||
:disabled="isCustomerBound"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="年龄">
|
||||
<t-input
|
||||
v-model.trim="formData.age"
|
||||
type="number"
|
||||
:readonly="!!formData.birthdate"
|
||||
:placeholder="formData.birthdate ? '根据出生日期自动计算' : '年龄'"
|
||||
borderless
|
||||
:disabled="isCustomerBound"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<div class="photo">
|
||||
<attachment-selector
|
||||
:readonly="!!isCustomerBound"
|
||||
v-model:items="photoItemList"
|
||||
:busy="isPhotoUploading"
|
||||
@select-start="handlePhotoPickerStart"
|
||||
@select="handlePhotoSelected($event.files)"
|
||||
>
|
||||
<template #capture-actions="{ capturePhoto }">
|
||||
<t-button
|
||||
class="add-action"
|
||||
variant="text"
|
||||
theme="primary"
|
||||
:disabled="isPhotoUploading"
|
||||
@click="handlePointCardCapture(capturePhoto)"
|
||||
>
|
||||
<template #icon>
|
||||
<t-icon name="camera" />
|
||||
</template>
|
||||
拍积分卡
|
||||
</t-button>
|
||||
</template>
|
||||
<template #item-label="{ item }">
|
||||
<span v-text="getAttachmentTypeText(item.attachType)" />
|
||||
</template>
|
||||
</attachment-selector>
|
||||
<div class="tips orange" v-if="!hasCustomerDeletePermission">当前账户权限编辑客户需要上传照片和积分卡</div>
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item label="性别">
|
||||
<t-radio-group class="sex" v-model="formData.gender" variant="default-filled" :disabled="isCustomerBound">
|
||||
<t-radio :block="false" borderless value="MALE">男</t-radio>
|
||||
<t-radio :block="false" borderless value="FEMALE">女</t-radio>
|
||||
<t-radio :block="false" borderless value="">未知</t-radio>
|
||||
</t-radio-group>
|
||||
</t-form-item>
|
||||
<t-form-item label="手机号">
|
||||
<t-input v-model.trim="formData.telephone" type="tel" placeholder="手机号" borderless :disabled="isCustomerBound" />
|
||||
</t-form-item>
|
||||
<t-form-item label="介绍人">
|
||||
<div class="selector">
|
||||
<t-input
|
||||
:value="formData.introducerCustomer?.name"
|
||||
readonly
|
||||
placeholder="选择介绍人"
|
||||
borderless
|
||||
:disabled="isCustomerBound"
|
||||
/>
|
||||
<div class="actions">
|
||||
<t-button
|
||||
v-if="introducerCustomerId"
|
||||
variant="text"
|
||||
theme="danger"
|
||||
size="extra-small"
|
||||
:disabled="isCustomerBound"
|
||||
@click="clearIntroducer"
|
||||
>清除</t-button>
|
||||
<t-button
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
:disabled="isCustomerBound"
|
||||
@click="selectorVisible = true"
|
||||
>选择客户</t-button>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="savePermissionCode" class="customer-edit">
|
||||
<t-form class="form card" label-width="5rem" :disabled="isCustomerBound" v-entrance-transition>
|
||||
<t-form-item label="客户编码">
|
||||
<t-input
|
||||
v-model.trim="formData.code"
|
||||
placeholder="客户编码"
|
||||
borderless
|
||||
:disabled="false"
|
||||
@blur="handleCodeBlur"
|
||||
>
|
||||
<template #suffix-icon>
|
||||
<t-button
|
||||
theme="primary"
|
||||
size="extra-small"
|
||||
:disabled="false"
|
||||
@click="toggleScanner"
|
||||
>
|
||||
<span v-text="scannerVisible ? '关闭扫码' : '扫码'" />
|
||||
</t-button>
|
||||
</template>
|
||||
</t-input>
|
||||
</t-form-item>
|
||||
<div v-if="scannerVisible" class="code-scanner-wrapper">
|
||||
<code-scanner
|
||||
visible
|
||||
:status-text="scanStatus"
|
||||
active-text="正在识别客户编码"
|
||||
@decode="handleDecodedText"
|
||||
@status-change="handleScanStatusChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item v-if="formData.introducerCustomer" label-width="0">
|
||||
<customer-profile-card
|
||||
class="introducer-profile"
|
||||
:customer="formData.introducerCustomer"
|
||||
<div v-if="isCustomerBound" class="bound-customer">
|
||||
<customer-profile-card :customer="boundCodeCustomer" />
|
||||
<div class="tips red">
|
||||
<t-icon name="error-circle" />
|
||||
<span v-text="isCreateMode ? '该编码已绑定客户,不可新录入' : '该编码已绑定其他客户,请使用新的编码'" />
|
||||
</div>
|
||||
<t-button
|
||||
block
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
:disabled="false"
|
||||
@click="toBoundCustomerEdit"
|
||||
>编辑该客户</t-button>
|
||||
</div>
|
||||
<t-form-item label="姓名" required-mark>
|
||||
<t-input
|
||||
v-model.trim="formData.name"
|
||||
placeholder="姓名"
|
||||
borderless
|
||||
:disabled="isCustomerBound"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="出生日期">
|
||||
<birthdate-picker
|
||||
v-model="formData.birthdate"
|
||||
v-model:calendar="formData.birthdateCalendar"
|
||||
:disabled="isCustomerBound"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="年龄">
|
||||
<t-input
|
||||
v-model.trim="formData.age"
|
||||
type="number"
|
||||
:readonly="!!formData.birthdate"
|
||||
:placeholder="formData.birthdate ? '根据出生日期自动计算' : '年龄'"
|
||||
borderless
|
||||
:disabled="isCustomerBound"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<div class="photo">
|
||||
<attachment-selector
|
||||
:readonly="!!isCustomerBound"
|
||||
v-model:items="photoItemList"
|
||||
:busy="isPhotoUploading"
|
||||
@select-start="handlePhotoPickerStart"
|
||||
@select="handlePhotoSelected($event.files)"
|
||||
>
|
||||
<template #capture-actions="{ capturePhoto }">
|
||||
<t-button
|
||||
class="add-action"
|
||||
variant="text"
|
||||
theme="primary"
|
||||
:disabled="isPhotoUploading"
|
||||
@click="handlePointCardCapture(capturePhoto)"
|
||||
>
|
||||
<template #icon>
|
||||
<t-icon name="camera" />
|
||||
</template>
|
||||
拍积分卡
|
||||
</t-button>
|
||||
</template>
|
||||
<template #item-label="{ item }">
|
||||
<span v-text="getAttachmentTypeText(item.attachType)" />
|
||||
</template>
|
||||
</attachment-selector>
|
||||
<div class="tips orange" v-if="!hasCustomerDeletePermission">当前账户权限编辑客户需要上传照片和积分卡</div>
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item label="性别">
|
||||
<t-radio-group class="sex" v-model="formData.gender" variant="default-filled" :disabled="isCustomerBound">
|
||||
<t-radio :block="false" borderless value="MALE">男</t-radio>
|
||||
<t-radio :block="false" borderless value="FEMALE">女</t-radio>
|
||||
<t-radio :block="false" borderless value="">未知</t-radio>
|
||||
</t-radio-group>
|
||||
</t-form-item>
|
||||
<t-form-item label="手机号">
|
||||
<t-input v-model.trim="formData.telephone" type="tel" placeholder="手机号" borderless :disabled="isCustomerBound" />
|
||||
</t-form-item>
|
||||
<t-form-item label="介绍人">
|
||||
<div class="selector">
|
||||
<t-input
|
||||
:value="formData.introducerCustomer?.name"
|
||||
readonly
|
||||
placeholder="选择介绍人"
|
||||
borderless
|
||||
:disabled="isCustomerBound"
|
||||
/>
|
||||
<div class="actions">
|
||||
<t-button
|
||||
v-if="introducerCustomerId"
|
||||
variant="text"
|
||||
theme="danger"
|
||||
size="extra-small"
|
||||
:disabled="isCustomerBound"
|
||||
@click="clearIntroducer"
|
||||
>清除</t-button>
|
||||
<t-button
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
:disabled="isCustomerBound"
|
||||
@click="selectorVisible = true"
|
||||
>选择客户</t-button>
|
||||
</div>
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item v-if="formData.introducerCustomer" label-width="0">
|
||||
<customer-profile-card
|
||||
class="introducer-profile"
|
||||
:customer="formData.introducerCustomer"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="调理部位" :arrow="!isCustomerBound" @click="openBodyAreaPicker">
|
||||
<div class="picker-text" v-text="selectedAreaText" />
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<customer-tag-card
|
||||
v-if="canReadTag"
|
||||
class="tag-card"
|
||||
:editable="canEditTag && !isCustomerBound"
|
||||
:tag-list="customerTagList"
|
||||
v-entrance-transition
|
||||
@edit="openTagSelector"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="调理部位" :arrow="!isCustomerBound" @click="openBodyAreaPicker">
|
||||
<div class="picker-text" v-text="selectedAreaText" />
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<customer-tag-card
|
||||
v-if="canReadTag"
|
||||
class="tag-card"
|
||||
:editable="canEditTag && !isCustomerBound"
|
||||
:tag-list="customerTagList"
|
||||
v-entrance-transition
|
||||
@edit="openTagSelector"
|
||||
/>
|
||||
<t-form class="form card" label-width="3rem" :disabled="isCustomerBound" v-entrance-transition>
|
||||
<t-form-item label="住址">
|
||||
<t-textarea
|
||||
class="textarea"
|
||||
v-model.trim="formData.address"
|
||||
:autosize="{ minRows: 3, maxRows: 5 }"
|
||||
placeholder="住址"
|
||||
:disabled="isCustomerBound"
|
||||
<t-form class="form card" label-width="3rem" :disabled="isCustomerBound" v-entrance-transition>
|
||||
<t-form-item label="住址">
|
||||
<t-textarea
|
||||
class="textarea"
|
||||
v-model.trim="formData.address"
|
||||
:autosize="{ minRows: 3, maxRows: 5 }"
|
||||
placeholder="住址"
|
||||
:disabled="isCustomerBound"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="病症">
|
||||
<t-textarea
|
||||
class="textarea"
|
||||
v-model.trim="formData.disease"
|
||||
:autosize="{ minRows: 3, maxRows: 5 }"
|
||||
placeholder="病症"
|
||||
:disabled="isCustomerBound"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea
|
||||
class="textarea"
|
||||
v-model.trim="formData.remark"
|
||||
:autosize="{ minRows: 3, maxRows: 5 }"
|
||||
placeholder="客户备注"
|
||||
:disabled="isCustomerBound"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<customer-selector
|
||||
v-if="!isCustomerBound"
|
||||
v-model="introducerCustomerId"
|
||||
v-model:visible="selectorVisible"
|
||||
@change="handleIntroducerChange"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="病症">
|
||||
<t-textarea
|
||||
class="textarea"
|
||||
v-model.trim="formData.disease"
|
||||
:autosize="{ minRows: 3, maxRows: 5 }"
|
||||
placeholder="病症"
|
||||
:disabled="isCustomerBound"
|
||||
<tag-selector
|
||||
v-if="canEditTag && !isCustomerBound"
|
||||
v-model="selectedTagIdList"
|
||||
v-model:visible="tagSelectorVisible"
|
||||
@change="handleTagSelected"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea
|
||||
class="textarea"
|
||||
v-model.trim="formData.remark"
|
||||
:autosize="{ minRows: 3, maxRows: 5 }"
|
||||
placeholder="客户备注"
|
||||
:disabled="isCustomerBound"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<customer-selector
|
||||
v-if="!isCustomerBound"
|
||||
v-model="introducerCustomerId"
|
||||
v-model:visible="selectorVisible"
|
||||
@change="handleIntroducerChange"
|
||||
/>
|
||||
<tag-selector
|
||||
v-if="canEditTag && !isCustomerBound"
|
||||
v-model="selectedTagIdList"
|
||||
v-model:visible="tagSelectorVisible"
|
||||
@change="handleTagSelected"
|
||||
/>
|
||||
</div>
|
||||
</main>
|
||||
<bottom-popup
|
||||
v-model="bodyAreaPickerVisible"
|
||||
title="选择调理部位"
|
||||
height="32rem"
|
||||
@left-button-click="cancelBodyAreaPicker"
|
||||
@right-button-click="confirmBodyAreaPicker"
|
||||
>
|
||||
<body-area-selector v-model="bodyAreaDraft" :readonly="isCustomerBound" />
|
||||
</bottom-popup>
|
||||
</div>
|
||||
<bottom-popup
|
||||
v-model="bodyAreaPickerVisible"
|
||||
title="选择调理部位"
|
||||
height="32rem"
|
||||
@left-button-click="cancelBodyAreaPicker"
|
||||
@right-button-click="confirmBodyAreaPicker"
|
||||
>
|
||||
<body-area-selector v-model="bodyAreaDraft" :readonly="isCustomerBound" />
|
||||
</bottom-popup>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -722,7 +726,7 @@ function buildAttachmentList(): Attachment[] {
|
||||
<style scoped lang="less">
|
||||
.customer-edit {
|
||||
gap: 1rem;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 1rem 0;
|
||||
padding: 0 0 1rem 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main v-can="permissionCodes.customer.read" class="page-content scroll list">
|
||||
<main v-can="permissionCodes.customer.read" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="list-wrapper pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -1,89 +1,95 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="邀请客户"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div v-can="permissionCodes.customer.read" class="customer-invitee-list">
|
||||
<customer-profile-card
|
||||
v-if="customer"
|
||||
class="customer"
|
||||
:customer="customer"
|
||||
v-entrance-transition
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="邀请客户"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div class="invite-list">
|
||||
<div class="header" v-entrance-transition>
|
||||
<div class="title">邀请客户</div>
|
||||
<div v-can="permissionCodes.customer.update" class="actions">
|
||||
<t-button
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
content="选择添加"
|
||||
@click="selectorVisible = true"
|
||||
/>
|
||||
<t-button
|
||||
theme="primary"
|
||||
size="extra-small"
|
||||
content="扫码添加"
|
||||
@click="openScanPopup"
|
||||
/>
|
||||
<main class="page-content scroll column list">
|
||||
<div class="pull-refresh">
|
||||
<div v-can="permissionCodes.customer.read" class="customer-invitee-list">
|
||||
<customer-profile-card
|
||||
v-if="customer"
|
||||
class="customer"
|
||||
:customer="customer"
|
||||
v-entrance-transition
|
||||
/>
|
||||
<div class="invite-list">
|
||||
<div class="header" v-entrance-transition>
|
||||
<div class="title">邀请客户</div>
|
||||
<div v-can="permissionCodes.customer.update" class="actions">
|
||||
<t-button
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
content="选择添加"
|
||||
@click="selectorVisible = true"
|
||||
/>
|
||||
<t-button
|
||||
theme="primary"
|
||||
size="extra-small"
|
||||
content="扫码添加"
|
||||
@click="openScanPopup"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<t-cell-group theme="card">
|
||||
<t-swipe-cell
|
||||
v-for="(item, index) in invitees"
|
||||
:key="item.id || item.code || index"
|
||||
class="item"
|
||||
v-entrance-transition="{ step: 30 }"
|
||||
>
|
||||
<customer-cell
|
||||
class="cell"
|
||||
:customer="item"
|
||||
arrow
|
||||
hover
|
||||
@click="toCustomerDetail(item)"
|
||||
>
|
||||
<template #description>
|
||||
<telephone-link :value="item.telephone" placeholder="未填写电话" />
|
||||
</template>
|
||||
</customer-cell>
|
||||
<template #right>
|
||||
<div v-can="permissionCodes.customer.update" class="remove bg-red white" @click="removeInvitee(item)">删除</div>
|
||||
</template>
|
||||
</t-swipe-cell>
|
||||
<center-tips v-if="!invitees.length" :content="isLoading ? '正在加载邀请客户' : '暂无邀请客户'" />
|
||||
</t-cell-group>
|
||||
</div>
|
||||
</div>
|
||||
<t-cell-group theme="card">
|
||||
<t-swipe-cell
|
||||
v-for="(item, index) in invitees"
|
||||
:key="item.id || item.code || index"
|
||||
class="item"
|
||||
v-entrance-transition="{ step: 30 }"
|
||||
>
|
||||
<customer-cell
|
||||
class="cell"
|
||||
:customer="item"
|
||||
arrow
|
||||
hover
|
||||
@click="toCustomerDetail(item)"
|
||||
>
|
||||
<template #description>
|
||||
<telephone-link :value="item.telephone" placeholder="未填写电话" />
|
||||
</template>
|
||||
</customer-cell>
|
||||
<template #right>
|
||||
<div v-can="permissionCodes.customer.update" class="remove bg-red white" @click="removeInvitee(item)">删除</div>
|
||||
</template>
|
||||
</t-swipe-cell>
|
||||
<center-tips v-if="!invitees.length" :content="isLoading ? '正在加载邀请客户' : '暂无邀请客户'" />
|
||||
</t-cell-group>
|
||||
</div>
|
||||
</div>
|
||||
<customer-selector
|
||||
v-model="selectedInviteeId"
|
||||
v-model:visible="selectorVisible"
|
||||
:enable-scan="false"
|
||||
@change="handleInviteeSelected"
|
||||
/>
|
||||
<bottom-popup
|
||||
v-model="scanPopupVisible"
|
||||
title="扫码添加邀请客户"
|
||||
@left-button-click="closeScanPopup"
|
||||
@right-button-click="confirmScannedInvitee"
|
||||
>
|
||||
<div class="scan-popup">
|
||||
<code-scanner
|
||||
v-if="scanPopupVisible"
|
||||
:visible="scanPopupVisible"
|
||||
:status-text="scanStatus"
|
||||
active-text="正在识别客户编码,请将二维码移入取景框"
|
||||
@decode="handleDecodedText"
|
||||
@status-change="handleScanStatusChange"
|
||||
/>
|
||||
<div v-if="pendingInvitee" class="confirm">
|
||||
<customer-profile-card :customer="pendingInvitee" />
|
||||
</div>
|
||||
</div>
|
||||
</bottom-popup>
|
||||
</main>
|
||||
<customer-selector
|
||||
v-model="selectedInviteeId"
|
||||
v-model:visible="selectorVisible"
|
||||
:enable-scan="false"
|
||||
@change="handleInviteeSelected"
|
||||
/>
|
||||
<bottom-popup
|
||||
v-model="scanPopupVisible"
|
||||
title="扫码添加邀请客户"
|
||||
@left-button-click="closeScanPopup"
|
||||
@right-button-click="confirmScannedInvitee"
|
||||
>
|
||||
<div class="scan-popup">
|
||||
<code-scanner
|
||||
v-if="scanPopupVisible"
|
||||
:visible="scanPopupVisible"
|
||||
:status-text="scanStatus"
|
||||
active-text="正在识别客户编码,请将二维码移入取景框"
|
||||
@decode="handleDecodedText"
|
||||
@status-change="handleScanStatusChange"
|
||||
/>
|
||||
<div v-if="pendingInvitee" class="confirm">
|
||||
<customer-profile-card :customer="pendingInvitee" />
|
||||
</div>
|
||||
</div>
|
||||
</bottom-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -271,7 +277,7 @@ watch(() => route.params.id, loadCustomer);
|
||||
<style scoped lang="less">
|
||||
.customer-invitee-list {
|
||||
gap: 1rem;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 2rem;
|
||||
padding: 0 0 2rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<navbar-actions :actions="actionList" :visible="canCreateCustomer" />
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main v-can="permissionCodes.customer.read" class="page-content scroll list">
|
||||
<main v-can="permissionCodes.customer.read" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh fix-last-cell-line"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -1,83 +1,87 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="生成二维码"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div v-can="permissionCodes.qrCode.create" class="qr-page">
|
||||
<t-form class="form card" v-entrance-transition>
|
||||
<t-form-item label="编码前缀">
|
||||
<t-input v-model.trim="formModel.prefix" placeholder="如 GAO" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item label="起始编号">
|
||||
<t-input
|
||||
:model-value="formModel.start"
|
||||
type="number"
|
||||
inputmode="numeric"
|
||||
borderless
|
||||
@change="value => handleNumberChange('start', value)"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="编号位数" contentAlign="right">
|
||||
<t-stepper
|
||||
v-model="formModel.digits"
|
||||
:min="startMinDigits"
|
||||
:max="maxDigits"
|
||||
default-value="3"
|
||||
theme="outline"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="生成数量">
|
||||
<t-input
|
||||
:model-value="formModel.quantity"
|
||||
type="number"
|
||||
inputmode="numeric"
|
||||
borderless
|
||||
@change="value => handleNumberChange('quantity', value)"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-cell-group theme="card" v-entrance-transition>
|
||||
<t-cell title="最终起始编码" :note="finalStartCode" />
|
||||
<t-cell title="最终结束编码" :note="finalEndCode" />
|
||||
</t-cell-group>
|
||||
<div class="actions" v-entrance-transition>
|
||||
<t-button
|
||||
class="bg-white"
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
block
|
||||
:loading="printing"
|
||||
@click="printQrCode"
|
||||
>打印</t-button>
|
||||
<t-button
|
||||
theme="primary"
|
||||
block
|
||||
:loading="downloading"
|
||||
@click="downloadImages"
|
||||
>
|
||||
<span v-text="downloadText" />
|
||||
</t-button>
|
||||
</div>
|
||||
<div class="actions orange tips" v-entrance-transition>微信内可能无法发起打印或批量下载,建议使用默认浏览器打开</div>
|
||||
<section class="preview" v-entrance-transition>
|
||||
<div class="header">
|
||||
<h2 class="title">预览</h2>
|
||||
<p class="tips" v-text="previewSummary" />
|
||||
</div>
|
||||
<div class="paper" :style="paperStyle">
|
||||
<div
|
||||
class="item"
|
||||
v-for="item in visiblePreviewPages[0].codes"
|
||||
:key="item"
|
||||
>
|
||||
<div class="qr-code" />
|
||||
<div class="text-mark bg-gray" />
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="生成二维码"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.qrCode.create" class="qr-page">
|
||||
<t-form class="form card" v-entrance-transition>
|
||||
<t-form-item label="编码前缀">
|
||||
<t-input v-model.trim="formModel.prefix" placeholder="如 GAO" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item label="起始编号">
|
||||
<t-input
|
||||
:model-value="formModel.start"
|
||||
type="number"
|
||||
inputmode="numeric"
|
||||
borderless
|
||||
@change="value => handleNumberChange('start', value)"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="编号位数" contentAlign="right">
|
||||
<t-stepper
|
||||
v-model="formModel.digits"
|
||||
:min="startMinDigits"
|
||||
:max="maxDigits"
|
||||
default-value="3"
|
||||
theme="outline"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="生成数量">
|
||||
<t-input
|
||||
:model-value="formModel.quantity"
|
||||
type="number"
|
||||
inputmode="numeric"
|
||||
borderless
|
||||
@change="value => handleNumberChange('quantity', value)"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-cell-group theme="card" v-entrance-transition>
|
||||
<t-cell title="最终起始编码" :note="finalStartCode" />
|
||||
<t-cell title="最终结束编码" :note="finalEndCode" />
|
||||
</t-cell-group>
|
||||
<div class="actions" v-entrance-transition>
|
||||
<t-button
|
||||
class="bg-white"
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
block
|
||||
:loading="printing"
|
||||
@click="printQrCode"
|
||||
>打印</t-button>
|
||||
<t-button
|
||||
theme="primary"
|
||||
block
|
||||
:loading="downloading"
|
||||
@click="downloadImages"
|
||||
>
|
||||
<span v-text="downloadText" />
|
||||
</t-button>
|
||||
</div>
|
||||
<div class="actions orange tips" v-entrance-transition>微信内可能无法发起打印或批量下载,建议使用默认浏览器打开</div>
|
||||
<section class="preview" v-entrance-transition>
|
||||
<div class="header">
|
||||
<h2 class="title">预览</h2>
|
||||
<p class="tips" v-text="previewSummary" />
|
||||
</div>
|
||||
<div class="paper" :style="paperStyle">
|
||||
<div
|
||||
class="item"
|
||||
v-for="item in visiblePreviewPages[0].codes"
|
||||
:key="item"
|
||||
>
|
||||
<div class="qr-code" />
|
||||
<div class="text-mark bg-gray" />
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -245,7 +249,7 @@ async function printQrCode(): Promise<void> {
|
||||
.qr-page {
|
||||
gap: 1rem;
|
||||
min-height: 100vh;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 2rem 0;
|
||||
padding: 0 0 2rem 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
+138
-134
@@ -1,141 +1,145 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="登记事件详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="canUpdate"
|
||||
@click="toEdit"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="编辑"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div
|
||||
v-can="permissionCodes.event.read"
|
||||
class="registration-event-detail"
|
||||
>
|
||||
<div v-entrance-transition v-if="event" class="event-header">
|
||||
<div class="color" :style="{ background: event.color || defaultColor }" />
|
||||
<div class="header-content">
|
||||
<div class="title-row">
|
||||
<h2 v-text="event.name || '未命名事件'" />
|
||||
<t-tag :theme="getStatusTheme(event.status)" variant="light-outline" :content="getStatusText(event.status)" />
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="登记事件详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="canUpdate"
|
||||
@click="toEdit"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="编辑"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div
|
||||
v-can="permissionCodes.event.read"
|
||||
class="registration-event-detail"
|
||||
>
|
||||
<div v-entrance-transition v-if="event" class="event-header">
|
||||
<div class="color" :style="{ background: event.color || defaultColor }" />
|
||||
<div class="header-content">
|
||||
<div class="title-row">
|
||||
<h2 v-text="event.name || '未命名事件'" />
|
||||
<t-tag :theme="getStatusTheme(event.status)" variant="light-outline" :content="getStatusText(event.status)" />
|
||||
</div>
|
||||
<div class="description" v-text="Text.display(event.description)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="description" v-text="Text.display(event.description)" />
|
||||
</div>
|
||||
<t-cell-group v-entrance-transition v-if="event" title="基本信息" theme="card">
|
||||
<t-cell title="所属门店" :note="storeName" />
|
||||
<t-cell title="业务类型" :note="getEventBizTypeText(event.bizType)" />
|
||||
<t-cell v-if="isPackagePurchaseEvent(event)" title="绑定套餐">
|
||||
<template #note>
|
||||
<div class="package-note">
|
||||
<strong v-text="event.packageConfig?.name || '未返回套餐配置'" />
|
||||
<span v-if="event.packageConfig" v-text="`${formatPackageAmount(event.packageConfig.standardAmount)}|${getPackageConfigStatusText(event.packageConfig.status)}`" />
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="事件颜色">
|
||||
<template #note>
|
||||
<div class="color-note">
|
||||
<span class="color-dot" :style="{ background: event.color || defaultColor }" />
|
||||
<span v-text="(event.color || defaultColor).toLowerCase()" />
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="说明" :note="Text.display(event.description)" />
|
||||
<t-cell title="可登记角色">
|
||||
<template #note>
|
||||
<div v-if="event.roleCodeList?.length" class="tag-list">
|
||||
<t-tag
|
||||
v-for="roleCode in event.roleCodeList"
|
||||
:key="roleCode"
|
||||
theme="primary"
|
||||
variant="light-outline"
|
||||
:content="getRoleName(roleCode)"
|
||||
/>
|
||||
</div>
|
||||
<span v-else>未配置</span>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell
|
||||
v-if="canReadEventRecord && event.bizType !== 'PACKAGE_PURCHASE'"
|
||||
title="登记记录"
|
||||
note="查看该事件登记记录"
|
||||
arrow
|
||||
:hover="true"
|
||||
@click="toEventRecordList"
|
||||
/>
|
||||
<t-cell
|
||||
v-else-if="event.bizType === 'PACKAGE_PURCHASE'"
|
||||
title="购买记录"
|
||||
note="请在套餐订单列表或订单详情中查看"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-entrance-transition v-if="event" title="登记配置" theme="card">
|
||||
<t-cell title="数值类型" :note="getValueTypeText(event.valueType)" />
|
||||
<t-cell v-if="event.valueType === 'NUMBER'" title="数值单位" :note="getValueUnitText(event.valueUnit)" />
|
||||
<t-cell v-if="event.valueType === 'NUMBER'" title="登记必填数值" :note="event.requireValue ? '是' : '否'" />
|
||||
<t-cell title="需要拍照" :note="event.requirePhoto ? '是' : '否'" />
|
||||
<t-cell title="需要核销" :note="event.requireVerification ? '是' : '否'" />
|
||||
<t-cell title="次数约束" :note="getLimitText(event)" />
|
||||
<t-cell
|
||||
title="登记可选项"
|
||||
:note="`${(event?.optionGroupList || []).length} 个选项组`"
|
||||
:arrow="hasOptionGroup"
|
||||
:hover="hasOptionGroup"
|
||||
@click="openOptionPopup"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-entrance-transition v-if="event" title="生效时间" theme="card">
|
||||
<t-cell title="起始时间" :note="formatDate(event.beginAt)" />
|
||||
<t-cell title="终止时间" :note="formatDate(event.endAt)" />
|
||||
<t-cell title="创建时间" :note="formatDate(event.createdAt, '未知时间')" />
|
||||
<t-cell title="更新时间" :note="formatDate(event.updatedAt, '未知时间')" />
|
||||
</t-cell-group>
|
||||
<t-button
|
||||
v-if="event && canDeleteEvent"
|
||||
v-can="permissionCodes.event.delete"
|
||||
class="cell-button"
|
||||
theme="danger"
|
||||
:loading="isRemoving"
|
||||
:disabled="isRemoving"
|
||||
@click="confirmRemoveEvent"
|
||||
v-entrance-transition
|
||||
content="删除事件"
|
||||
/>
|
||||
<t-empty v-if="!event" :description="isLoading ? '正在加载登记事件' : '登记事件不存在'" />
|
||||
</div>
|
||||
<t-cell-group v-entrance-transition v-if="event" title="基本信息" theme="card">
|
||||
<t-cell title="所属门店" :note="storeName" />
|
||||
<t-cell title="业务类型" :note="getEventBizTypeText(event.bizType)" />
|
||||
<t-cell v-if="isPackagePurchaseEvent(event)" title="绑定套餐">
|
||||
<template #note>
|
||||
<div class="package-note">
|
||||
<strong v-text="event.packageConfig?.name || '未返回套餐配置'" />
|
||||
<span v-if="event.packageConfig" v-text="`${formatPackageAmount(event.packageConfig.standardAmount)}|${getPackageConfigStatusText(event.packageConfig.status)}`" />
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="事件颜色">
|
||||
<template #note>
|
||||
<div class="color-note">
|
||||
<span class="color-dot" :style="{ background: event.color || defaultColor }" />
|
||||
<span v-text="(event.color || defaultColor).toLowerCase()" />
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="说明" :note="Text.display(event.description)" />
|
||||
<t-cell title="可登记角色">
|
||||
<template #note>
|
||||
<div v-if="event.roleCodeList?.length" class="tag-list">
|
||||
<t-tag
|
||||
v-for="roleCode in event.roleCodeList"
|
||||
:key="roleCode"
|
||||
theme="primary"
|
||||
variant="light-outline"
|
||||
:content="getRoleName(roleCode)"
|
||||
/>
|
||||
</div>
|
||||
<span v-else>未配置</span>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell
|
||||
v-if="canReadEventRecord && event.bizType !== 'PACKAGE_PURCHASE'"
|
||||
title="登记记录"
|
||||
note="查看该事件登记记录"
|
||||
arrow
|
||||
:hover="true"
|
||||
@click="toEventRecordList"
|
||||
</main>
|
||||
<bottom-popup
|
||||
v-model="optionPopupVisible"
|
||||
title="登记可选项"
|
||||
height="min(88vh, 48rem)"
|
||||
left-button-text="关闭"
|
||||
right-button-text=""
|
||||
@left-button-click="closeOptionPopup"
|
||||
>
|
||||
<div v-if="event && hasOptionGroup" class="option-popup">
|
||||
<event-option-selector
|
||||
v-model="optionSelectionMap"
|
||||
:event-list="[event]"
|
||||
:selected-event-id-list="selectedEventIdList"
|
||||
readonly
|
||||
/>
|
||||
<t-cell
|
||||
v-else-if="event.bizType === 'PACKAGE_PURCHASE'"
|
||||
title="购买记录"
|
||||
note="请在套餐订单列表或订单详情中查看"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-entrance-transition v-if="event" title="登记配置" theme="card">
|
||||
<t-cell title="数值类型" :note="getValueTypeText(event.valueType)" />
|
||||
<t-cell v-if="event.valueType === 'NUMBER'" title="数值单位" :note="getValueUnitText(event.valueUnit)" />
|
||||
<t-cell v-if="event.valueType === 'NUMBER'" title="登记必填数值" :note="event.requireValue ? '是' : '否'" />
|
||||
<t-cell title="需要拍照" :note="event.requirePhoto ? '是' : '否'" />
|
||||
<t-cell title="需要核销" :note="event.requireVerification ? '是' : '否'" />
|
||||
<t-cell title="次数约束" :note="getLimitText(event)" />
|
||||
<t-cell
|
||||
title="登记可选项"
|
||||
:note="`${(event?.optionGroupList || []).length} 个选项组`"
|
||||
:arrow="hasOptionGroup"
|
||||
:hover="hasOptionGroup"
|
||||
@click="openOptionPopup"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-entrance-transition v-if="event" title="生效时间" theme="card">
|
||||
<t-cell title="起始时间" :note="formatDate(event.beginAt)" />
|
||||
<t-cell title="终止时间" :note="formatDate(event.endAt)" />
|
||||
<t-cell title="创建时间" :note="formatDate(event.createdAt, '未知时间')" />
|
||||
<t-cell title="更新时间" :note="formatDate(event.updatedAt, '未知时间')" />
|
||||
</t-cell-group>
|
||||
<t-button
|
||||
v-if="event && canDeleteEvent"
|
||||
v-can="permissionCodes.event.delete"
|
||||
class="cell-button"
|
||||
theme="danger"
|
||||
:loading="isRemoving"
|
||||
:disabled="isRemoving"
|
||||
@click="confirmRemoveEvent"
|
||||
v-entrance-transition
|
||||
content="删除事件"
|
||||
/>
|
||||
<t-empty v-if="!event" :description="isLoading ? '正在加载登记事件' : '登记事件不存在'" />
|
||||
</div>
|
||||
</bottom-popup>
|
||||
<event-remove-dialog
|
||||
v-model:visible="removeDialogVisible"
|
||||
:event="removeTarget"
|
||||
:loading="isRemoving"
|
||||
@confirm="removeEvent"
|
||||
/>
|
||||
</div>
|
||||
<bottom-popup
|
||||
v-model="optionPopupVisible"
|
||||
title="登记可选项"
|
||||
height="min(88vh, 48rem)"
|
||||
left-button-text="关闭"
|
||||
right-button-text=""
|
||||
@left-button-click="closeOptionPopup"
|
||||
>
|
||||
<div v-if="event && hasOptionGroup" class="option-popup">
|
||||
<event-option-selector
|
||||
v-model="optionSelectionMap"
|
||||
:event-list="[event]"
|
||||
:selected-event-id-list="selectedEventIdList"
|
||||
readonly
|
||||
/>
|
||||
</div>
|
||||
</bottom-popup>
|
||||
<event-remove-dialog
|
||||
v-model:visible="removeDialogVisible"
|
||||
:event="removeTarget"
|
||||
:loading="isRemoving"
|
||||
@confirm="removeEvent"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -397,7 +401,7 @@ onMounted(() => {
|
||||
.registration-event-detail {
|
||||
gap: 1rem;
|
||||
min-height: 100vh;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 1rem;
|
||||
padding: 0 0 1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
+242
-238
@@ -1,246 +1,250 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(savePermissionCode)"
|
||||
@click="saveEventItem"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="保存"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="pageAccess" class="event-edit">
|
||||
<t-form class="form card" label-width="7rem" v-entrance-transition>
|
||||
<t-form-item label="颜色">
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
size="extra-small"
|
||||
variant="outline"
|
||||
class="color-trigger"
|
||||
@click="openColorPicker"
|
||||
>
|
||||
<div class="content">
|
||||
<span class="swatch" :style="{ background: formModel.color }" />
|
||||
<span v-text="formModel.color.toLowerCase()" />
|
||||
</div>
|
||||
</t-button>
|
||||
</t-form-item>
|
||||
<t-form-item label="名称">
|
||||
<t-input
|
||||
class="name"
|
||||
v-model.trim="formModel.name"
|
||||
placeholder="登记事件名称"
|
||||
borderless
|
||||
v-if="userStore.hasPermissions(savePermissionCode)"
|
||||
@click="saveEventItem"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="保存"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="业务类型" :arrow="false">
|
||||
<div class="picker-text" v-text="getBizTypeText(formModel.bizType)" />
|
||||
</t-form-item>
|
||||
<t-form-item label="说明">
|
||||
<t-textarea
|
||||
class="description"
|
||||
v-model.trim="formModel.description"
|
||||
placeholder="事件说明"
|
||||
borderless
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="数值类型"
|
||||
:class="{ disabled: isPackagePurchase }"
|
||||
:arrow="!isPackagePurchase"
|
||||
@click="openValueTypePicker"
|
||||
>
|
||||
<div class="picker-text" v-text="getValueTypeText(formModel.valueType)" />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="isNumberValueType(formModel.valueType)" label="数值单位" required-mark arrow @click="openValueUnitPicker">
|
||||
<div class="picker-text" v-text="getValueUnitText(formModel.valueUnit)" />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="isNumberValueType(formModel.valueType)" label="登记必填数值" content-align="right">
|
||||
<t-switch v-model="formModel.requireValue" />
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="起始时间"
|
||||
:class="{ disabled: isPackagePurchase }"
|
||||
:arrow="!isPackagePurchase"
|
||||
@click="openBeginAtPicker"
|
||||
>
|
||||
<div class="begin-at">
|
||||
<div class="picker-text" v-text="formModel.beginAtText || '不限'" />
|
||||
<t-button
|
||||
v-if="formModel.beginAtText"
|
||||
:disabled="isPackagePurchase"
|
||||
size="extra-small"
|
||||
content="不限"
|
||||
@click.stop="clearBeginAt"
|
||||
/>
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="终止时间"
|
||||
:class="{ disabled: isPackagePurchase }"
|
||||
:arrow="!isPackagePurchase"
|
||||
@click="openEndAtPicker"
|
||||
>
|
||||
<div class="end-at">
|
||||
<div class="picker-text" v-text="formModel.endAtText || '不限'" />
|
||||
<t-button
|
||||
v-if="formModel.endAtText"
|
||||
:disabled="isPackagePurchase"
|
||||
size="extra-small"
|
||||
content="不限"
|
||||
@click.stop="clearEndAt"
|
||||
/>
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<div class="form-tips">套餐购买类型的事件中,事件数值、起止时间、核销状况由套餐系统处理</div>
|
||||
</t-form-item>
|
||||
<t-form-item label="约束" arrow @click="openLimitPicker">
|
||||
<div class="picker-text" v-text="getLimitText(formModel.limitType)" />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="isValueLimitType(formModel.limitType)" label="约束数值">
|
||||
<t-input
|
||||
v-model.trim="formModel.limitValueText"
|
||||
type="number"
|
||||
:placeholder="limitValuePlaceholder"
|
||||
borderless
|
||||
align="right"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="需要拍照" content-align="right">
|
||||
<t-switch v-model="formModel.requirePhoto" />
|
||||
</t-form-item>
|
||||
<t-form-item label="需要核销" content-align="right" :class="{ disabled: isPackagePurchase }">
|
||||
<t-switch v-model="formModel.requireVerification" :disabled="isPackagePurchase" />
|
||||
</t-form-item>
|
||||
<t-form-item label="状态" arrow @click="openStatusPicker">
|
||||
<div class="picker-text" v-text="getStatusText(formModel.status)" />
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<div class="form-tips status-tip">
|
||||
<div class="status">
|
||||
<span class="orange">草稿:</span>
|
||||
<span class="gray">普通店员角色不可见,不可登记、查询</span>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="pageAccess" class="event-edit">
|
||||
<t-form class="form card" label-width="7rem" v-entrance-transition>
|
||||
<t-form-item label="颜色">
|
||||
<t-button
|
||||
size="extra-small"
|
||||
variant="outline"
|
||||
class="color-trigger"
|
||||
@click="openColorPicker"
|
||||
>
|
||||
<div class="content">
|
||||
<span class="swatch" :style="{ background: formModel.color }" />
|
||||
<span v-text="formModel.color.toLowerCase()" />
|
||||
</div>
|
||||
</t-button>
|
||||
</t-form-item>
|
||||
<t-form-item label="名称">
|
||||
<t-input
|
||||
class="name"
|
||||
v-model.trim="formModel.name"
|
||||
placeholder="登记事件名称"
|
||||
borderless
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="业务类型" :arrow="false">
|
||||
<div class="picker-text" v-text="getBizTypeText(formModel.bizType)" />
|
||||
</t-form-item>
|
||||
<t-form-item label="说明">
|
||||
<t-textarea
|
||||
class="description"
|
||||
v-model.trim="formModel.description"
|
||||
placeholder="事件说明"
|
||||
borderless
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="数值类型"
|
||||
:class="{ disabled: isPackagePurchase }"
|
||||
:arrow="!isPackagePurchase"
|
||||
@click="openValueTypePicker"
|
||||
>
|
||||
<div class="picker-text" v-text="getValueTypeText(formModel.valueType)" />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="isNumberValueType(formModel.valueType)" label="数值单位" required-mark arrow @click="openValueUnitPicker">
|
||||
<div class="picker-text" v-text="getValueUnitText(formModel.valueUnit)" />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="isNumberValueType(formModel.valueType)" label="登记必填数值" content-align="right">
|
||||
<t-switch v-model="formModel.requireValue" />
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="起始时间"
|
||||
:class="{ disabled: isPackagePurchase }"
|
||||
:arrow="!isPackagePurchase"
|
||||
@click="openBeginAtPicker"
|
||||
>
|
||||
<div class="begin-at">
|
||||
<div class="picker-text" v-text="formModel.beginAtText || '不限'" />
|
||||
<t-button
|
||||
v-if="formModel.beginAtText"
|
||||
:disabled="isPackagePurchase"
|
||||
size="extra-small"
|
||||
content="不限"
|
||||
@click.stop="clearBeginAt"
|
||||
/>
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="终止时间"
|
||||
:class="{ disabled: isPackagePurchase }"
|
||||
:arrow="!isPackagePurchase"
|
||||
@click="openEndAtPicker"
|
||||
>
|
||||
<div class="end-at">
|
||||
<div class="picker-text" v-text="formModel.endAtText || '不限'" />
|
||||
<t-button
|
||||
v-if="formModel.endAtText"
|
||||
:disabled="isPackagePurchase"
|
||||
size="extra-small"
|
||||
content="不限"
|
||||
@click.stop="clearEndAt"
|
||||
/>
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<div class="form-tips">套餐购买类型的事件中,事件数值、起止时间、核销状况由套餐系统处理</div>
|
||||
</t-form-item>
|
||||
<t-form-item label="约束" arrow @click="openLimitPicker">
|
||||
<div class="picker-text" v-text="getLimitText(formModel.limitType)" />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="isValueLimitType(formModel.limitType)" label="约束数值">
|
||||
<t-input
|
||||
v-model.trim="formModel.limitValueText"
|
||||
type="number"
|
||||
:placeholder="limitValuePlaceholder"
|
||||
borderless
|
||||
align="right"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="需要拍照" content-align="right">
|
||||
<t-switch v-model="formModel.requirePhoto" />
|
||||
</t-form-item>
|
||||
<t-form-item label="需要核销" content-align="right" :class="{ disabled: isPackagePurchase }">
|
||||
<t-switch v-model="formModel.requireVerification" :disabled="isPackagePurchase" />
|
||||
</t-form-item>
|
||||
<t-form-item label="状态" arrow @click="openStatusPicker">
|
||||
<div class="picker-text" v-text="getStatusText(formModel.status)" />
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<div class="form-tips status-tip">
|
||||
<div class="status">
|
||||
<span class="orange">草稿:</span>
|
||||
<span class="gray">普通店员角色不可见,不可登记、查询</span>
|
||||
</div>
|
||||
<div class="status">
|
||||
<span class="orange">可登记:</span>
|
||||
<span class="gray">正常状态,可登记、可查询</span>
|
||||
</div>
|
||||
<div class="status">
|
||||
<span class="orange">不可登记:</span>
|
||||
<span class="gray">登记时不会出现在事件列表,但仍可在登记事件记录列表中可以查找,标记为“不可登记”,所有店员角色可见。店长角色可进入详情和编辑,可恢复为“可登记”</span>
|
||||
</div>
|
||||
</div>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<event-option-editor v-model="optionGroupList" />
|
||||
<section class="roles" v-entrance-transition>
|
||||
<div class="title">
|
||||
<span>可登记角色</span>
|
||||
<span class="hint">必须至少选择一个角色,上级角色拥有子级角色可登记事件的登记权限</span>
|
||||
</div>
|
||||
<div class="status">
|
||||
<span class="orange">可登记:</span>
|
||||
<span class="gray">正常状态,可登记、可查询</span>
|
||||
</div>
|
||||
<div class="status">
|
||||
<span class="orange">不可登记:</span>
|
||||
<span class="gray">登记时不会出现在事件列表,但仍可在登记事件记录列表中可以查找,标记为“不可登记”,所有店员角色可见。店长角色可进入详情和编辑,可恢复为“可登记”</span>
|
||||
</div>
|
||||
</div>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<event-option-editor v-model="optionGroupList" />
|
||||
<section class="roles" v-entrance-transition>
|
||||
<div class="title">
|
||||
<span>可登记角色</span>
|
||||
<span class="hint">必须至少选择一个角色,上级角色拥有子级角色可登记事件的登记权限</span>
|
||||
<t-checkbox-group v-model="formModel.roleCodeList" class="group">
|
||||
<t-checkbox
|
||||
v-for="item in roleOptions"
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
class="item"
|
||||
borderless
|
||||
>
|
||||
<span v-text="item.name || item.code" />
|
||||
</t-checkbox>
|
||||
</t-checkbox-group>
|
||||
</section>
|
||||
</div>
|
||||
<t-checkbox-group v-model="formModel.roleCodeList" class="group">
|
||||
<t-checkbox
|
||||
v-for="item in roleOptions"
|
||||
:key="item.code"
|
||||
:value="item.code"
|
||||
class="item"
|
||||
borderless
|
||||
>
|
||||
<span v-text="item.name || item.code" />
|
||||
</t-checkbox>
|
||||
</t-checkbox-group>
|
||||
</section>
|
||||
</main>
|
||||
<t-popup v-model="colorPickerVisible" placement="bottom" @opened="handleColorPickerOpened">
|
||||
<div class="color-popup">
|
||||
<div class="header">
|
||||
<t-button variant="text" size="small" @click="cancelColorPicker">取消</t-button>
|
||||
<span class="title" v-text="'颜色选择'" />
|
||||
<t-button theme="primary" variant="text" size="small" @click="confirmColorPicker">确定</t-button>
|
||||
</div>
|
||||
<t-color-picker
|
||||
v-if="colorPickerVisible"
|
||||
:key="colorPickerRenderKey"
|
||||
v-model="colorDraft"
|
||||
format="HEX8"
|
||||
type="multiple"
|
||||
:swatch-colors="colorSwatchList"
|
||||
@palette-bar-change="updateColorDraftFromPalette"
|
||||
/>
|
||||
</div>
|
||||
</t-popup>
|
||||
<t-popup v-model="limitPickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="limitPickerDraft"
|
||||
:columns="limitPickerColumns"
|
||||
title="约束"
|
||||
@cancel="limitPickerVisible = false"
|
||||
@confirm="confirmLimitPicker"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="statusPickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="statusPickerDraft"
|
||||
:columns="statusPickerColumns"
|
||||
title="状态"
|
||||
@cancel="statusPickerVisible = false"
|
||||
@confirm="confirmStatusPicker"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="valueTypePickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="valueTypePickerDraft"
|
||||
:columns="valueTypePickerColumns"
|
||||
title="数值类型"
|
||||
@cancel="valueTypePickerVisible = false"
|
||||
@confirm="confirmValueType"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="valueUnitPickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="valueUnitPickerDraft"
|
||||
:columns="valueUnitPickerColumns"
|
||||
title="数值单位"
|
||||
@cancel="valueUnitPickerVisible = false"
|
||||
@confirm="confirmValueUnit"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="beginAtPickerVisible" placement="bottom">
|
||||
<div class="picker-popup">
|
||||
<t-date-time-picker
|
||||
v-if="beginAtPickerVisible"
|
||||
v-model="beginAtDraftText"
|
||||
:start="minimumDateTimeText"
|
||||
:mode="['date', 'minute']"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
title="起始时间"
|
||||
@cancel="beginAtPickerVisible = false"
|
||||
@confirm="confirmBeginAt"
|
||||
/>
|
||||
</div>
|
||||
</t-popup>
|
||||
<t-popup v-model="endAtPickerVisible" placement="bottom">
|
||||
<div class="picker-popup">
|
||||
<t-date-time-picker
|
||||
v-if="endAtPickerVisible"
|
||||
v-model="endAtDraftText"
|
||||
:start="endAtMinimumDateTimeText"
|
||||
:mode="['date', 'minute']"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
title="终止时间"
|
||||
@cancel="endAtPickerVisible = false"
|
||||
@confirm="confirmEndAt"
|
||||
/>
|
||||
</div>
|
||||
</t-popup>
|
||||
</div>
|
||||
<t-popup v-model="colorPickerVisible" placement="bottom" @opened="handleColorPickerOpened">
|
||||
<div class="color-popup">
|
||||
<div class="header">
|
||||
<t-button variant="text" size="small" @click="cancelColorPicker">取消</t-button>
|
||||
<span class="title" v-text="'颜色选择'" />
|
||||
<t-button theme="primary" variant="text" size="small" @click="confirmColorPicker">确定</t-button>
|
||||
</div>
|
||||
<t-color-picker
|
||||
v-if="colorPickerVisible"
|
||||
:key="colorPickerRenderKey"
|
||||
v-model="colorDraft"
|
||||
format="HEX8"
|
||||
type="multiple"
|
||||
:swatch-colors="colorSwatchList"
|
||||
@palette-bar-change="updateColorDraftFromPalette"
|
||||
/>
|
||||
</div>
|
||||
</t-popup>
|
||||
<t-popup v-model="limitPickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="limitPickerDraft"
|
||||
:columns="limitPickerColumns"
|
||||
title="约束"
|
||||
@cancel="limitPickerVisible = false"
|
||||
@confirm="confirmLimitPicker"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="statusPickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="statusPickerDraft"
|
||||
:columns="statusPickerColumns"
|
||||
title="状态"
|
||||
@cancel="statusPickerVisible = false"
|
||||
@confirm="confirmStatusPicker"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="valueTypePickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="valueTypePickerDraft"
|
||||
:columns="valueTypePickerColumns"
|
||||
title="数值类型"
|
||||
@cancel="valueTypePickerVisible = false"
|
||||
@confirm="confirmValueType"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="valueUnitPickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="valueUnitPickerDraft"
|
||||
:columns="valueUnitPickerColumns"
|
||||
title="数值单位"
|
||||
@cancel="valueUnitPickerVisible = false"
|
||||
@confirm="confirmValueUnit"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="beginAtPickerVisible" placement="bottom">
|
||||
<div class="picker-popup">
|
||||
<t-date-time-picker
|
||||
v-if="beginAtPickerVisible"
|
||||
v-model="beginAtDraftText"
|
||||
:start="minimumDateTimeText"
|
||||
:mode="['date', 'minute']"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
title="起始时间"
|
||||
@cancel="beginAtPickerVisible = false"
|
||||
@confirm="confirmBeginAt"
|
||||
/>
|
||||
</div>
|
||||
</t-popup>
|
||||
<t-popup v-model="endAtPickerVisible" placement="bottom">
|
||||
<div class="picker-popup">
|
||||
<t-date-time-picker
|
||||
v-if="endAtPickerVisible"
|
||||
v-model="endAtDraftText"
|
||||
:start="endAtMinimumDateTimeText"
|
||||
:mode="['date', 'minute']"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
title="终止时间"
|
||||
@cancel="endAtPickerVisible = false"
|
||||
@confirm="confirmEndAt"
|
||||
/>
|
||||
</div>
|
||||
</t-popup>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -763,7 +767,7 @@ onMounted(async () => {
|
||||
<style scoped lang="less">
|
||||
.event-edit {
|
||||
gap: 1rem;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 1rem 0;
|
||||
padding: 0 0 1rem 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</t-navbar>
|
||||
<main
|
||||
v-can="{ value: [permissionCodes.event.read, permissionCodes.user.read], mode: 'and' }"
|
||||
class="page-content scroll list"
|
||||
class="page-content scroll column list"
|
||||
>
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh"
|
||||
|
||||
@@ -1,119 +1,123 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="登记事件记录详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="canUpdateRecord"
|
||||
@click="toEdit"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="编辑"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="permissionCodes.eventRecord.read" class="event-record-detail">
|
||||
<customer-profile-card
|
||||
v-entrance-transition
|
||||
v-if="record?.customer"
|
||||
class="customer-profile"
|
||||
:customer="record.customer"
|
||||
@click="toCustomerDetail"
|
||||
/>
|
||||
<t-cell-group v-entrance-transition v-if="record" title="登记信息" theme="card">
|
||||
<t-cell
|
||||
title="登记事件"
|
||||
:note="record.event?.name || '未知事件'"
|
||||
:arrow="canReadEvent && !!(record.event?.id || record.eventId)"
|
||||
:hover="canReadEvent && !!(record.event?.id || record.eventId)"
|
||||
@click="toEventDetail"
|
||||
/>
|
||||
<t-cell title="业务类型" :note="getEventBizTypeText(record.event?.bizType)" />
|
||||
<t-cell v-if="record.numberValue !== undefined && record.numberValue !== null" title="事件数值" :note="getNumberValueText(record)" />
|
||||
<t-cell v-if="record.pointValue !== undefined && record.pointValue !== null" title="提交积分值" :note="getPointValueText(record.pointValue, pointLedgerChangeType)" />
|
||||
<t-cell v-if="record.earnedPointValue !== undefined && record.earnedPointValue !== null" title="本次积分变化" :note="getPointValueText(record.earnedPointValue, pointLedgerChangeType)" />
|
||||
<t-cell title="登记时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="record.registeredAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="登记人" :note="Text.display(record.operator?.nick || record.operator?.name)" />
|
||||
<t-cell title="备注" :note="Text.display(record.remark)" />
|
||||
</t-cell-group>
|
||||
<t-cell-group
|
||||
v-if="record?.verificationStatus && record.verificationStatus !== 'NOT_REQUIRED'"
|
||||
title="核销信息"
|
||||
theme="card"
|
||||
v-entrance-transition
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="登记事件记录详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<t-cell title="核销状态" :note="getVerificationStatusText(record.verificationStatus)" />
|
||||
<t-cell v-if="record.verificationStatus === 'VERIFIED'" title="核销人" :note="Text.display(record.verifier?.nick || record.verifier?.name)" />
|
||||
<t-cell v-if="record.verificationStatus === 'VERIFIED'" title="核销时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="record.verifiedAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<card-container
|
||||
v-if="recordOptionEvent"
|
||||
description="登记选项"
|
||||
v-entrance-transition
|
||||
>
|
||||
<event-option-selector
|
||||
class="option-selector"
|
||||
:model-value="recordOptionSelectionMap"
|
||||
:event-list="[recordOptionEvent]"
|
||||
:selected-event-id-list="recordOptionEventIdList"
|
||||
readonly
|
||||
/>
|
||||
</card-container>
|
||||
<t-button
|
||||
v-if="canVerifyRecord && record?.verificationStatus === 'PENDING'"
|
||||
class="verify-button cell-button bg-orange white"
|
||||
variant="text"
|
||||
:loading="isVerifying"
|
||||
@click="confirmVerifyRecord"
|
||||
v-entrance-transition
|
||||
>
|
||||
核销登记记录
|
||||
</t-button>
|
||||
<div v-if="record" class="photo-wrapper" v-entrance-transition>
|
||||
<attachment-selector :items="recordPhotoItemList" title="登记照片" readonly>
|
||||
<template #viewer-actions="{ item, index, close }">
|
||||
<attachment-viewer-actions
|
||||
v-if="canUpdateRecord"
|
||||
:attach-type="item.attachType"
|
||||
:busy="isPhotoSaving"
|
||||
@change-type="changePhotoType(index, $event, close)"
|
||||
@remove="removePhoto(index, close)"
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="canUpdateRecord"
|
||||
@click="toEdit"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="编辑"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.eventRecord.read" class="event-record-detail">
|
||||
<customer-profile-card
|
||||
v-entrance-transition
|
||||
v-if="record?.customer"
|
||||
class="customer-profile"
|
||||
:customer="record.customer"
|
||||
@click="toCustomerDetail"
|
||||
/>
|
||||
<t-cell-group v-entrance-transition v-if="record" title="登记信息" theme="card">
|
||||
<t-cell
|
||||
title="登记事件"
|
||||
:note="record.event?.name || '未知事件'"
|
||||
:arrow="canReadEvent && !!(record.event?.id || record.eventId)"
|
||||
:hover="canReadEvent && !!(record.event?.id || record.eventId)"
|
||||
@click="toEventDetail"
|
||||
/>
|
||||
</template>
|
||||
</attachment-selector>
|
||||
</div>
|
||||
<t-button
|
||||
v-if="record && canDeleteRecord"
|
||||
class="delete-button cell-button"
|
||||
theme="danger"
|
||||
:loading="isDeleting"
|
||||
:disabled="isDeleting"
|
||||
@click="confirmRemoveRecord"
|
||||
v-entrance-transition
|
||||
content="删除登记记录"
|
||||
<t-cell title="业务类型" :note="getEventBizTypeText(record.event?.bizType)" />
|
||||
<t-cell v-if="record.numberValue !== undefined && record.numberValue !== null" title="事件数值" :note="getNumberValueText(record)" />
|
||||
<t-cell v-if="record.pointValue !== undefined && record.pointValue !== null" title="提交积分值" :note="getPointValueText(record.pointValue, pointLedgerChangeType)" />
|
||||
<t-cell v-if="record.earnedPointValue !== undefined && record.earnedPointValue !== null" title="本次积分变化" :note="getPointValueText(record.earnedPointValue, pointLedgerChangeType)" />
|
||||
<t-cell title="登记时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="record.registeredAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="登记人" :note="Text.display(record.operator?.nick || record.operator?.name)" />
|
||||
<t-cell title="备注" :note="Text.display(record.remark)" />
|
||||
</t-cell-group>
|
||||
<t-cell-group
|
||||
v-if="record?.verificationStatus && record.verificationStatus !== 'NOT_REQUIRED'"
|
||||
title="核销信息"
|
||||
theme="card"
|
||||
v-entrance-transition
|
||||
>
|
||||
<t-cell title="核销状态" :note="getVerificationStatusText(record.verificationStatus)" />
|
||||
<t-cell v-if="record.verificationStatus === 'VERIFIED'" title="核销人" :note="Text.display(record.verifier?.nick || record.verifier?.name)" />
|
||||
<t-cell v-if="record.verificationStatus === 'VERIFIED'" title="核销时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="record.verifiedAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<card-container
|
||||
v-if="recordOptionEvent"
|
||||
description="登记选项"
|
||||
v-entrance-transition
|
||||
>
|
||||
<event-option-selector
|
||||
class="option-selector"
|
||||
:model-value="recordOptionSelectionMap"
|
||||
:event-list="[recordOptionEvent]"
|
||||
:selected-event-id-list="recordOptionEventIdList"
|
||||
readonly
|
||||
/>
|
||||
</card-container>
|
||||
<t-button
|
||||
v-if="canVerifyRecord && record?.verificationStatus === 'PENDING'"
|
||||
class="verify-button cell-button bg-orange white"
|
||||
variant="text"
|
||||
:loading="isVerifying"
|
||||
@click="confirmVerifyRecord"
|
||||
v-entrance-transition
|
||||
>
|
||||
核销登记记录
|
||||
</t-button>
|
||||
<div v-if="record" class="photo-wrapper" v-entrance-transition>
|
||||
<attachment-selector :items="recordPhotoItemList" title="登记照片" readonly>
|
||||
<template #viewer-actions="{ item, index, close }">
|
||||
<attachment-viewer-actions
|
||||
v-if="canUpdateRecord"
|
||||
:attach-type="item.attachType"
|
||||
:busy="isPhotoSaving"
|
||||
@change-type="changePhotoType(index, $event, close)"
|
||||
@remove="removePhoto(index, close)"
|
||||
/>
|
||||
</template>
|
||||
</attachment-selector>
|
||||
</div>
|
||||
<t-button
|
||||
v-if="record && canDeleteRecord"
|
||||
class="delete-button cell-button"
|
||||
theme="danger"
|
||||
:loading="isDeleting"
|
||||
:disabled="isDeleting"
|
||||
@click="confirmRemoveRecord"
|
||||
v-entrance-transition
|
||||
content="删除登记记录"
|
||||
/>
|
||||
<t-empty v-if="!record" :description="isLoading ? '正在加载登记事件记录' : '登记事件记录不存在'" />
|
||||
</div>
|
||||
</main>
|
||||
<event-record-verify-dialog
|
||||
v-model:visible="verifyDialogVisible"
|
||||
:record="record"
|
||||
:can-update="canUpdateRecord"
|
||||
:submit="submitVerifyRecord"
|
||||
@verified="handleVerifySuccess"
|
||||
/>
|
||||
<t-empty v-if="!record" :description="isLoading ? '正在加载登记事件记录' : '登记事件记录不存在'" />
|
||||
</div>
|
||||
<event-record-verify-dialog
|
||||
v-model:visible="verifyDialogVisible"
|
||||
:record="record"
|
||||
:can-update="canUpdateRecord"
|
||||
:submit="submitVerifyRecord"
|
||||
@verified="handleVerifySuccess"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -442,7 +446,7 @@ watch(() => route.params.id, async () => {
|
||||
.event-record-detail {
|
||||
gap: 1rem;
|
||||
min-height: 100vh;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 1rem 0;
|
||||
padding: 0 0 1rem 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
+169
-165
@@ -1,171 +1,175 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(pageAccess)"
|
||||
@click="submitRecord"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
:content="saveButtonText"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="pageAccess" class="registration-record-edit">
|
||||
<t-form class="form card" v-entrance-transition>
|
||||
<t-form-item label="客户" required-mark>
|
||||
<t-input
|
||||
:model-value="customerDisplayText"
|
||||
class="customer"
|
||||
readonly
|
||||
borderless
|
||||
placeholder="选择或扫码客户"
|
||||
@click="!isEditMode && openSelectedCustomerList()"
|
||||
>
|
||||
<template v-if="!isEditMode" #suffix-icon>
|
||||
<div class="actions">
|
||||
<t-button
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
@click.stop="selectorVisible = true"
|
||||
>选择</t-button>
|
||||
<t-button
|
||||
theme="primary"
|
||||
size="extra-small"
|
||||
@click.stop="toggleScanner"
|
||||
>
|
||||
<span v-text="scannerVisible ? '关闭扫码' : '扫码'" />
|
||||
</t-button>
|
||||
</div>
|
||||
</template>
|
||||
</t-input>
|
||||
</t-form-item>
|
||||
<div v-if="scannerVisible" class="code-scanner-wrapper">
|
||||
<code-scanner
|
||||
visible
|
||||
:status-text="scanStatus"
|
||||
active-text="正在识别客户编码,请将条码或二维码移入取景框。"
|
||||
@decode="handleDecodedText"
|
||||
@status-change="handleScanStatusChange"
|
||||
/>
|
||||
</div>
|
||||
<customer-profile-card
|
||||
v-if="showSelectedCustomerProfile"
|
||||
class="customer-profile"
|
||||
:customer="selectedCustomer"
|
||||
v-entrance-transition
|
||||
/>
|
||||
<div v-if="isEditMode" class="edit-point-tip red">涉及积分变动的数据不能修改,已产生积分流水的登记记录不会因修改客户、事件或时间而重算;如需修改这些事实,请删除后重新创建,删除会自动回流积分。</div>
|
||||
<event-selector
|
||||
:model-value="selectedEventIdList"
|
||||
class="event-selector"
|
||||
:event-list="eventList"
|
||||
:disabled="isEditMode"
|
||||
selection-mode="multiple"
|
||||
required-mark
|
||||
@update:model-value="handleEventSelectionChange"
|
||||
/>
|
||||
<event-option-selector
|
||||
class="option-selector"
|
||||
v-model="selectedOptionSelectionMap"
|
||||
:event-list="eventList"
|
||||
:selected-event-id-list="selectedEventIdList"
|
||||
:disabled="isSaving"
|
||||
/>
|
||||
<div v-if="!isEditMode && selectedNumberEventList.length" class="event-value-list">
|
||||
<t-form-item
|
||||
v-for="item in selectedNumberEventList"
|
||||
:key="item.id"
|
||||
:label="`${item.name || '未命名事件'}数值`"
|
||||
:required-mark="item.requireValue === true"
|
||||
label-align="top"
|
||||
>
|
||||
<t-input
|
||||
v-model.trim="numberValueTextMap[item.id || '']"
|
||||
type="number"
|
||||
align="right"
|
||||
borderless
|
||||
:placeholder="getNumberValuePlaceholder(item)"
|
||||
/>
|
||||
</t-form-item>
|
||||
</div>
|
||||
<t-form-item v-if="!isEditMode" label="登记时间" content-align="right">
|
||||
<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 || '此刻'" />
|
||||
</t-form-item>
|
||||
<t-form-item label="登记备注">
|
||||
<t-textarea
|
||||
v-model.trim="note"
|
||||
class="textarea"
|
||||
:autosize="{ minRows: 3, maxRows: 5 }"
|
||||
placeholder="登记说明"
|
||||
/>
|
||||
</t-form-item>
|
||||
|
||||
<div class="photo-part">
|
||||
<attachment-selector
|
||||
title="登记事件照片"
|
||||
:required="selectedRequiredPhotoEventList.length > 0"
|
||||
v-model:items="photoItemList"
|
||||
:busy="isPhotoUploading"
|
||||
@select="handleRecordPhotoSelected($event.files)"
|
||||
/>
|
||||
</div>
|
||||
</t-form>
|
||||
<t-cell-group
|
||||
v-if="recentRecordList.length"
|
||||
title="最近登记事件列表"
|
||||
class="record-list"
|
||||
theme="card"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<t-cell
|
||||
v-for="item in recentRecordList"
|
||||
:key="item.id"
|
||||
:title="getRecordEventName(item)"
|
||||
:description="item.registeredAt ? Time.toDateTime(item.registeredAt) : '-'"
|
||||
arrow
|
||||
hover
|
||||
@click="toRecordDetail(item.id || '')"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-image v-if="getRecordPhotoURL(item)" :src="getRecordPhotoURL(item)" alt="事件照片" fit="cover" class="record-photo" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<center-tips v-else>当前客户暂无事件记录</center-tips>
|
||||
<customer-selector
|
||||
v-if="!isEditMode"
|
||||
v-model="selectedCustomerIdList"
|
||||
v-model:visible="selectorVisible"
|
||||
:selection-mode="isEditMode ? 'single' : 'multiple'"
|
||||
:enable-scan="false"
|
||||
@change="handleCustomerChange"
|
||||
/>
|
||||
<t-popup v-model="selectedCustomerListVisible" placement="bottom">
|
||||
<div class="selected-customer-popup bg-white">
|
||||
<div class="popup-header">
|
||||
<t-button variant="text" size="small" @click="selectedCustomerListVisible = false">关闭</t-button>
|
||||
<h3>已选客户</h3>
|
||||
<t-button theme="primary" variant="text" size="small" @click="openCustomerSelector">选择</t-button>
|
||||
</div>
|
||||
<customer-list
|
||||
class="list"
|
||||
:customer-list="selectedCustomerList"
|
||||
:removable="!isEditMode"
|
||||
empty-text="暂未选择客户"
|
||||
@remove="removeSelectedCustomer"
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(pageAccess)"
|
||||
@click="submitRecord"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
:content="saveButtonText"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="pageAccess" class="registration-record-edit">
|
||||
<t-form class="form card" v-entrance-transition>
|
||||
<t-form-item label="客户" required-mark>
|
||||
<t-input
|
||||
:model-value="customerDisplayText"
|
||||
class="customer"
|
||||
readonly
|
||||
borderless
|
||||
placeholder="选择或扫码客户"
|
||||
@click="!isEditMode && openSelectedCustomerList()"
|
||||
>
|
||||
<template v-if="!isEditMode" #suffix-icon>
|
||||
<div class="actions">
|
||||
<t-button
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
@click.stop="selectorVisible = true"
|
||||
>选择</t-button>
|
||||
<t-button
|
||||
theme="primary"
|
||||
size="extra-small"
|
||||
@click.stop="toggleScanner"
|
||||
>
|
||||
<span v-text="scannerVisible ? '关闭扫码' : '扫码'" />
|
||||
</t-button>
|
||||
</div>
|
||||
</template>
|
||||
</t-input>
|
||||
</t-form-item>
|
||||
<div v-if="scannerVisible" class="code-scanner-wrapper">
|
||||
<code-scanner
|
||||
visible
|
||||
:status-text="scanStatus"
|
||||
active-text="正在识别客户编码,请将条码或二维码移入取景框。"
|
||||
@decode="handleDecodedText"
|
||||
@status-change="handleScanStatusChange"
|
||||
/>
|
||||
</div>
|
||||
<customer-profile-card
|
||||
v-if="showSelectedCustomerProfile"
|
||||
class="customer-profile"
|
||||
:customer="selectedCustomer"
|
||||
v-entrance-transition
|
||||
/>
|
||||
<div v-if="isEditMode" class="edit-point-tip red">涉及积分变动的数据不能修改,已产生积分流水的登记记录不会因修改客户、事件或时间而重算;如需修改这些事实,请删除后重新创建,删除会自动回流积分。</div>
|
||||
<event-selector
|
||||
:model-value="selectedEventIdList"
|
||||
class="event-selector"
|
||||
:event-list="eventList"
|
||||
:disabled="isEditMode"
|
||||
selection-mode="multiple"
|
||||
required-mark
|
||||
@update:model-value="handleEventSelectionChange"
|
||||
/>
|
||||
<event-option-selector
|
||||
class="option-selector"
|
||||
v-model="selectedOptionSelectionMap"
|
||||
:event-list="eventList"
|
||||
:selected-event-id-list="selectedEventIdList"
|
||||
:disabled="isSaving"
|
||||
/>
|
||||
<div v-if="!isEditMode && selectedNumberEventList.length" class="event-value-list">
|
||||
<t-form-item
|
||||
v-for="item in selectedNumberEventList"
|
||||
:key="item.id"
|
||||
:label="`${item.name || '未命名事件'}数值`"
|
||||
:required-mark="item.requireValue === true"
|
||||
label-align="top"
|
||||
>
|
||||
<t-input
|
||||
v-model.trim="numberValueTextMap[item.id || '']"
|
||||
type="number"
|
||||
align="right"
|
||||
borderless
|
||||
:placeholder="getNumberValuePlaceholder(item)"
|
||||
/>
|
||||
</t-form-item>
|
||||
</div>
|
||||
<t-form-item v-if="!isEditMode" label="登记时间" content-align="right">
|
||||
<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 || '此刻'" />
|
||||
</t-form-item>
|
||||
<t-form-item label="登记备注">
|
||||
<t-textarea
|
||||
v-model.trim="note"
|
||||
class="textarea"
|
||||
:autosize="{ minRows: 3, maxRows: 5 }"
|
||||
placeholder="登记说明"
|
||||
/>
|
||||
</t-form-item>
|
||||
|
||||
<div class="photo-part">
|
||||
<attachment-selector
|
||||
title="登记事件照片"
|
||||
:required="selectedRequiredPhotoEventList.length > 0"
|
||||
v-model:items="photoItemList"
|
||||
:busy="isPhotoUploading"
|
||||
@select="handleRecordPhotoSelected($event.files)"
|
||||
/>
|
||||
</div>
|
||||
</t-form>
|
||||
<t-cell-group
|
||||
v-if="recentRecordList.length"
|
||||
title="最近登记事件列表"
|
||||
class="record-list"
|
||||
theme="card"
|
||||
>
|
||||
<t-cell
|
||||
v-for="item in recentRecordList"
|
||||
:key="item.id"
|
||||
:title="getRecordEventName(item)"
|
||||
:description="item.registeredAt ? Time.toDateTime(item.registeredAt) : '-'"
|
||||
arrow
|
||||
hover
|
||||
@click="toRecordDetail(item.id || '')"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-image v-if="getRecordPhotoURL(item)" :src="getRecordPhotoURL(item)" alt="事件照片" fit="cover" class="record-photo" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<center-tips v-else>当前客户暂无事件记录</center-tips>
|
||||
<customer-selector
|
||||
v-if="!isEditMode"
|
||||
v-model="selectedCustomerIdList"
|
||||
v-model:visible="selectorVisible"
|
||||
:selection-mode="isEditMode ? 'single' : 'multiple'"
|
||||
:enable-scan="false"
|
||||
@change="handleCustomerChange"
|
||||
/>
|
||||
<t-popup v-model="selectedCustomerListVisible" placement="bottom">
|
||||
<div class="selected-customer-popup bg-white">
|
||||
<div class="popup-header">
|
||||
<t-button variant="text" size="small" @click="selectedCustomerListVisible = false">关闭</t-button>
|
||||
<h3>已选客户</h3>
|
||||
<t-button theme="primary" variant="text" size="small" @click="openCustomerSelector">选择</t-button>
|
||||
</div>
|
||||
<customer-list
|
||||
class="list"
|
||||
:customer-list="selectedCustomerList"
|
||||
:removable="!isEditMode"
|
||||
empty-text="暂未选择客户"
|
||||
@remove="removeSelectedCustomer"
|
||||
/>
|
||||
</div>
|
||||
</t-popup>
|
||||
</div>
|
||||
</t-popup>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -685,7 +689,7 @@ watch(customerCode, async (value) => {
|
||||
.registration-record-edit {
|
||||
gap: 1rem;
|
||||
display: flex;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 1rem 0;
|
||||
padding: 0 0 1rem 0;
|
||||
flex-direction: column;
|
||||
|
||||
.form,
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<navbar-actions :actions="actionList" :visible="canCreateRecord" />
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main v-can="permissionCodes.eventRecord.read" class="page-content scroll list">
|
||||
<main v-can="permissionCodes.eventRecord.read" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main v-can="permissionCodes.stat.read" class="page-content scroll list">
|
||||
<main v-can="permissionCodes.stat.read" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="list-wrapper pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -1,92 +1,96 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="跟进提醒详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="canUpdate"
|
||||
@click="toEdit"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="编辑"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="permissionCodes.customerFollowUpReminder.read" class="follow-up-reminder-detail">
|
||||
<t-empty v-if="!detail" :description="isLoading ? '正在加载跟进提醒' : '跟进提醒不存在'" />
|
||||
<template v-else>
|
||||
<customer-profile-card
|
||||
class="customer"
|
||||
:customer="detail.customer"
|
||||
v-entrance-transition
|
||||
@click="toCustomer"
|
||||
/>
|
||||
<t-cell-group title="提醒信息" theme="card" v-entrance-transition>
|
||||
<t-cell title="业务状态">
|
||||
<template #note>
|
||||
<t-tag size="small" :theme="getStatusTheme(detail.status)" :content="getStatusText(detail.status)" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="负责人" :note="getResponsibleName(detail)" />
|
||||
<t-cell title="提醒时间" :note="detail.remindAt ? Time.toDateTime(detail.remindAt) : '-'" />
|
||||
<t-cell title="创建时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="detail.createdAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group title="跟进内容" theme="card" v-entrance-transition>
|
||||
<div class="content bg-white" v-text="detail.content || '未填写跟进内容'" />
|
||||
<div class="media-wrap bg-white">
|
||||
<attachment-selector :items="attachmentItemList" title="附件" readonly />
|
||||
</div>
|
||||
</t-cell-group>
|
||||
<t-cell-group title="通知方式" theme="card" v-entrance-transition>
|
||||
<t-cell v-if="hasChannel('INTERNAL')" title="站内通知">
|
||||
<template #note>
|
||||
<t-tag
|
||||
size="small"
|
||||
variant="outline"
|
||||
:theme="internalNotifyStatus ? getNotifyStatusTheme(internalNotifyStatus.status) : 'primary'"
|
||||
:content="internalNotifyStatus ? getNotifyStatusText(internalNotifyStatus.status) : '已配置'"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell v-if="hasChannel('SMS')" title="短信通知">
|
||||
<template #note>
|
||||
<t-tag
|
||||
size="small"
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
:content="detail.smsNotifyDetailId ? '已进入当天批次' : '等待当天 08:00 批次'"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell v-if="!detail.notifyChannelList?.length" title="通知方式" note="不发送通知" />
|
||||
<div class="tips gray bg-white" v-text="'站内通知在提醒时间后生效;短信按提醒日期在 08:00 聚合发送。通知状态仅作辅助展示,不代表跟进提醒业务状态。'" />
|
||||
</t-cell-group>
|
||||
<div class="actions" v-entrance-transition>
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="跟进提醒详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="canComplete && detail.status === 'PENDING'"
|
||||
v-if="canUpdate"
|
||||
@click="toEdit"
|
||||
theme="primary"
|
||||
:disabled="isOperating"
|
||||
:loading="isCompleting"
|
||||
@click="confirmComplete"
|
||||
>完成跟进</t-button>
|
||||
<t-button
|
||||
v-if="canDelete"
|
||||
theme="danger"
|
||||
:loading="isDeleting"
|
||||
:disabled="isOperating"
|
||||
@click="confirmDelete"
|
||||
>删除提醒</t-button>
|
||||
variant="text"
|
||||
size="small"
|
||||
content="编辑"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.customerFollowUpReminder.read" class="follow-up-reminder-detail">
|
||||
<t-empty v-if="!detail" :description="isLoading ? '正在加载跟进提醒' : '跟进提醒不存在'" />
|
||||
<template v-else>
|
||||
<customer-profile-card
|
||||
class="customer"
|
||||
:customer="detail.customer"
|
||||
v-entrance-transition
|
||||
@click="toCustomer"
|
||||
/>
|
||||
<t-cell-group title="提醒信息" theme="card" v-entrance-transition>
|
||||
<t-cell title="业务状态">
|
||||
<template #note>
|
||||
<t-tag size="small" :theme="getStatusTheme(detail.status)" :content="getStatusText(detail.status)" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="负责人" :note="getResponsibleName(detail)" />
|
||||
<t-cell title="提醒时间" :note="detail.remindAt ? Time.toDateTime(detail.remindAt) : '-'" />
|
||||
<t-cell title="创建时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="detail.createdAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group title="跟进内容" theme="card" v-entrance-transition>
|
||||
<div class="content bg-white" v-text="detail.content || '未填写跟进内容'" />
|
||||
<div class="media-wrap bg-white">
|
||||
<attachment-selector :items="attachmentItemList" title="附件" readonly />
|
||||
</div>
|
||||
</t-cell-group>
|
||||
<t-cell-group title="通知方式" theme="card" v-entrance-transition>
|
||||
<t-cell v-if="hasChannel('INTERNAL')" title="站内通知">
|
||||
<template #note>
|
||||
<t-tag
|
||||
size="small"
|
||||
variant="outline"
|
||||
:theme="internalNotifyStatus ? getNotifyStatusTheme(internalNotifyStatus.status) : 'primary'"
|
||||
:content="internalNotifyStatus ? getNotifyStatusText(internalNotifyStatus.status) : '已配置'"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell v-if="hasChannel('SMS')" title="短信通知">
|
||||
<template #note>
|
||||
<t-tag
|
||||
size="small"
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
:content="detail.smsNotifyDetailId ? '已进入当天批次' : '等待当天 08:00 批次'"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell v-if="!detail.notifyChannelList?.length" title="通知方式" note="不发送通知" />
|
||||
<div class="tips gray bg-white" v-text="'站内通知在提醒时间后生效;短信按提醒日期在 08:00 聚合发送。通知状态仅作辅助展示,不代表跟进提醒业务状态。'" />
|
||||
</t-cell-group>
|
||||
<div class="actions" v-entrance-transition>
|
||||
<t-button
|
||||
v-if="canComplete && detail.status === 'PENDING'"
|
||||
theme="primary"
|
||||
:disabled="isOperating"
|
||||
:loading="isCompleting"
|
||||
@click="confirmComplete"
|
||||
>完成跟进</t-button>
|
||||
<t-button
|
||||
v-if="canDelete"
|
||||
theme="danger"
|
||||
:loading="isDeleting"
|
||||
:disabled="isOperating"
|
||||
@click="confirmDelete"
|
||||
>删除提醒</t-button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -330,7 +334,7 @@ watch(() => route.params.id, async () => {
|
||||
<style scoped lang="less">
|
||||
.follow-up-reminder-detail {
|
||||
gap: 1rem;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 2rem;
|
||||
padding: 0 0 2rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
@@ -1,123 +1,127 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
@click="save"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
:content="isEditMode ? '保存' : '提交'"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="pageAccess" class="follow-up-reminder-edit">
|
||||
<t-form class="form card" label-width="6rem">
|
||||
<t-form-item label="客户" content-align="right" required-mark>
|
||||
<div class="customer-picker">
|
||||
<span v-if="!selectedCustomer" class="picker-text" v-text="'请选择客户'" />
|
||||
<t-button
|
||||
theme="primary"
|
||||
size="extra-small"
|
||||
content="选择"
|
||||
@click="customerSelectorVisible = true"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
@click="save"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
:content="isEditMode ? '保存' : '提交'"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="pageAccess" class="follow-up-reminder-edit">
|
||||
<t-form class="form card" label-width="6rem">
|
||||
<t-form-item label="客户" content-align="right" required-mark>
|
||||
<div class="customer-picker">
|
||||
<span v-if="!selectedCustomer" class="picker-text" v-text="'请选择客户'" />
|
||||
<t-button
|
||||
theme="primary"
|
||||
size="extra-small"
|
||||
content="选择"
|
||||
@click="customerSelectorVisible = true"
|
||||
/>
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item v-if="selectedCustomer" label-width="0">
|
||||
<customer-profile-card class="customer-profile" :customer="selectedCustomer" />
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="负责人"
|
||||
content-align="right"
|
||||
required-mark
|
||||
arrow
|
||||
@click="responsibleSelectorVisible = true"
|
||||
>
|
||||
<span v-text="selectedResponsibleName" />
|
||||
</t-form-item>
|
||||
<t-form-item label="跟进内容" required-mark>
|
||||
<t-textarea
|
||||
v-model="formModel.content"
|
||||
class="textarea"
|
||||
:autosize="{ minRows: 1, maxRows: 8 }"
|
||||
maxlength="1000"
|
||||
borderless
|
||||
placeholder="请输入跟进内容"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<attachment-selector
|
||||
v-model:items="photoItems"
|
||||
:upload="uploadReminderPhotoList"
|
||||
:busy="isSaving || isUploading"
|
||||
title="附件照片"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-form class="form card">
|
||||
<t-form-item class="remind-at" label="提醒时间" content-align="right" required-mark>
|
||||
<span class="picker-text" v-text="formModel.remindAtText || '请选择提醒时间'" />
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0" content-align="right">
|
||||
<t-radio-group
|
||||
v-model="selectedRemindAtPreset"
|
||||
@change="handleRemindAtPresetChange"
|
||||
>
|
||||
<t-radio :block="false" borderless value="tomorrow">明天</t-radio>
|
||||
<t-radio :block="false" borderless value="afterTomorrow">后天</t-radio>
|
||||
<t-radio :block="false" borderless value="custom">指定时间</t-radio>
|
||||
</t-radio-group>
|
||||
</t-form-item>
|
||||
<t-form-item label="站内通知" content-align="right">
|
||||
<t-switch
|
||||
size="small"
|
||||
:model-value="hasChannel('INTERNAL')"
|
||||
borderless
|
||||
@change="value => setChannel('INTERNAL', value === true)"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="短信通知" content-align="right">
|
||||
<t-switch
|
||||
size="small"
|
||||
:model-value="hasChannel('SMS')"
|
||||
:disabled="!canSelectSms"
|
||||
borderless
|
||||
@change="value => setChannel('SMS', value === true)"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<div class="tips red"
|
||||
v-text="'提醒时间精确到分钟,不能早于当前时间。短信会在提醒日期 08:00 聚合发送,不会在你选择的精确时间发送。'" />
|
||||
<customer-selector
|
||||
v-model="formModel.customerId"
|
||||
v-model:visible="customerSelectorVisible"
|
||||
:store-id="customerPickerStoreId"
|
||||
@change="handleCustomerChange"
|
||||
/>
|
||||
<managed-user-selector
|
||||
v-model="formModel.responsibleUserId"
|
||||
v-model:visible="responsibleSelectorVisible"
|
||||
:store-id="responsiblePickerStoreId"
|
||||
@change="handleResponsibleChange"
|
||||
/>
|
||||
<t-popup v-model="remindAtPickerVisible" placement="bottom">
|
||||
<t-date-time-picker
|
||||
v-if="remindAtPickerVisible"
|
||||
v-model="remindAtDraftText"
|
||||
:start="minimumDateTimeText"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
:mode="['date', 'minute']"
|
||||
title="提醒时间"
|
||||
@cancel="cancelRemindAtPicker"
|
||||
@confirm="confirmRemindAt"
|
||||
/>
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item v-if="selectedCustomer" label-width="0">
|
||||
<customer-profile-card class="customer-profile" :customer="selectedCustomer" />
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="负责人"
|
||||
content-align="right"
|
||||
required-mark
|
||||
arrow
|
||||
@click="responsibleSelectorVisible = true"
|
||||
>
|
||||
<span v-text="selectedResponsibleName" />
|
||||
</t-form-item>
|
||||
<t-form-item label="跟进内容" required-mark>
|
||||
<t-textarea
|
||||
v-model="formModel.content"
|
||||
class="textarea"
|
||||
:autosize="{ minRows: 1, maxRows: 8 }"
|
||||
maxlength="1000"
|
||||
borderless
|
||||
placeholder="请输入跟进内容"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<attachment-selector
|
||||
v-model:items="photoItems"
|
||||
:upload="uploadReminderPhotoList"
|
||||
:busy="isSaving || isUploading"
|
||||
title="附件照片"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-form class="form card">
|
||||
<t-form-item class="remind-at" label="提醒时间" content-align="right" required-mark>
|
||||
<span class="picker-text" v-text="formModel.remindAtText || '请选择提醒时间'" />
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0" content-align="right">
|
||||
<t-radio-group
|
||||
v-model="selectedRemindAtPreset"
|
||||
@change="handleRemindAtPresetChange"
|
||||
>
|
||||
<t-radio :block="false" borderless value="tomorrow">明天</t-radio>
|
||||
<t-radio :block="false" borderless value="afterTomorrow">后天</t-radio>
|
||||
<t-radio :block="false" borderless value="custom">指定时间</t-radio>
|
||||
</t-radio-group>
|
||||
</t-form-item>
|
||||
<t-form-item label="站内通知" content-align="right">
|
||||
<t-switch
|
||||
size="small"
|
||||
:model-value="hasChannel('INTERNAL')"
|
||||
borderless
|
||||
@change="value => setChannel('INTERNAL', value === true)"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="短信通知" content-align="right">
|
||||
<t-switch
|
||||
size="small"
|
||||
:model-value="hasChannel('SMS')"
|
||||
:disabled="!canSelectSms"
|
||||
borderless
|
||||
@change="value => setChannel('SMS', value === true)"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<div class="tips red"
|
||||
v-text="'提醒时间精确到分钟,不能早于当前时间。短信会在提醒日期 08:00 聚合发送,不会在你选择的精确时间发送。'" />
|
||||
<customer-selector
|
||||
v-model="formModel.customerId"
|
||||
v-model:visible="customerSelectorVisible"
|
||||
:store-id="customerPickerStoreId"
|
||||
@change="handleCustomerChange"
|
||||
/>
|
||||
<managed-user-selector
|
||||
v-model="formModel.responsibleUserId"
|
||||
v-model:visible="responsibleSelectorVisible"
|
||||
:store-id="responsiblePickerStoreId"
|
||||
@change="handleResponsibleChange"
|
||||
/>
|
||||
<t-popup v-model="remindAtPickerVisible" placement="bottom">
|
||||
<t-date-time-picker
|
||||
v-if="remindAtPickerVisible"
|
||||
v-model="remindAtDraftText"
|
||||
:start="minimumDateTimeText"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
:mode="['date', 'minute']"
|
||||
title="提醒时间"
|
||||
@cancel="cancelRemindAtPicker"
|
||||
@confirm="confirmRemindAt"
|
||||
/>
|
||||
</t-popup>
|
||||
</t-popup>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -606,7 +610,7 @@ onMounted(async () => {
|
||||
.follow-up-reminder-edit {
|
||||
gap: 1rem;
|
||||
display: flex;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 4rem;
|
||||
padding: 0 0 4rem;
|
||||
flex-direction: column;
|
||||
|
||||
.form {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main v-can="permissionCodes.customerFollowUpReminder.read" class="page-content scroll list">
|
||||
<main v-can="permissionCodes.customerFollowUpReminder.read" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -1,132 +1,136 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="创建履约单"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
@click="save"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="提交"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="permissionCodes.orderFulfillment.create" class="fulfillment-create">
|
||||
<t-cell-group title="履约来源" theme="card">
|
||||
<t-cell title="销售订单" :note="order?.orderNo || order?.id || '未找到来源订单'" />
|
||||
<t-cell title="客户" :note="order?.customer?.name || order?.customerId || '未选择'" />
|
||||
<t-cell title="来源类型" :note="isPackage ? '套餐权益' : '直接产品'" />
|
||||
</t-cell-group>
|
||||
<t-form v-if="sourceItems.length" class="items form">
|
||||
<t-form-item v-for="item in sourceItems" :key="item.id" class="item" label-width="0">
|
||||
<div class="content">
|
||||
<div class="photo">
|
||||
<t-image
|
||||
v-if="getProductPhotoURL(item)"
|
||||
:src="getProductPhotoURL(item)"
|
||||
:alt="item.productNameSnapshot || '产品图片'"
|
||||
fit="cover"
|
||||
class="avatar"
|
||||
/>
|
||||
<div
|
||||
v-else
|
||||
class="avatar fallback"
|
||||
v-text="(item.productNameSnapshot || '产').slice(0, 1)"
|
||||
/>
|
||||
</div>
|
||||
<div class="main">
|
||||
<div class="title">
|
||||
<div class="heading">
|
||||
<div class="name-gift">
|
||||
<strong v-text="item.productNameSnapshot || '未命名产品'"/>
|
||||
<t-tag
|
||||
v-if="item.gifted"
|
||||
size="small"
|
||||
theme="primary"
|
||||
content="赠送"
|
||||
/>
|
||||
<div
|
||||
v-if="item.skuCodeSnapshot || item.skuSpecSnapshot?.length || item.skuNameSnapshot || item.specSummarySnapshot || item.unitSnapshot"
|
||||
class="sku-tags"
|
||||
>
|
||||
<product-sku-tags
|
||||
:product-name="item.productNameSnapshot"
|
||||
:snapshot="item.skuSpecSnapshot"
|
||||
:fallback="item.specSummarySnapshot || item.skuNameSnapshot"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="创建履约单"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
@click="save"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="提交"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.orderFulfillment.create" class="fulfillment-create">
|
||||
<t-cell-group title="履约来源" theme="card">
|
||||
<t-cell title="销售订单" :note="order?.orderNo || order?.id || '未找到来源订单'" />
|
||||
<t-cell title="客户" :note="order?.customer?.name || order?.customerId || '未选择'" />
|
||||
<t-cell title="来源类型" :note="isPackage ? '套餐权益' : '直接产品'" />
|
||||
</t-cell-group>
|
||||
<t-form v-if="sourceItems.length" class="items form">
|
||||
<t-form-item v-for="item in sourceItems" :key="item.id" class="item" label-width="0">
|
||||
<div class="content">
|
||||
<div class="photo">
|
||||
<t-image
|
||||
v-if="getProductPhotoURL(item)"
|
||||
:src="getProductPhotoURL(item)"
|
||||
:alt="item.productNameSnapshot || '产品图片'"
|
||||
fit="cover"
|
||||
class="avatar"
|
||||
/>
|
||||
<div
|
||||
v-else
|
||||
class="avatar fallback"
|
||||
v-text="(item.productNameSnapshot || '产').slice(0, 1)"
|
||||
/>
|
||||
</div>
|
||||
<div class="main">
|
||||
<div class="title">
|
||||
<div class="heading">
|
||||
<div class="name-gift">
|
||||
<strong v-text="item.productNameSnapshot || '未命名产品'"/>
|
||||
<t-tag
|
||||
v-if="item.gifted"
|
||||
size="small"
|
||||
theme="primary"
|
||||
content="赠送"
|
||||
/>
|
||||
<div
|
||||
v-if="item.skuCodeSnapshot || item.skuSpecSnapshot?.length || item.skuNameSnapshot || item.specSummarySnapshot || item.unitSnapshot"
|
||||
class="sku-tags"
|
||||
>
|
||||
<product-sku-tags
|
||||
:product-name="item.productNameSnapshot"
|
||||
:snapshot="item.skuSpecSnapshot"
|
||||
:fallback="item.specSummarySnapshot || item.skuNameSnapshot"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<span class="can-fulfill" v-text="getItemDescription(item)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="input">
|
||||
<div class="quantity">
|
||||
<t-stepper
|
||||
v-model="quantityMap[item.id || '']"
|
||||
class="stepper"
|
||||
size="large"
|
||||
:max="Number.MAX_SAFE_INTEGER"
|
||||
:min="0"
|
||||
:step="getQuantityStep(item)"
|
||||
:integer="!allowsDecimalQuantity(item)"
|
||||
:disabled="!getFulfillmentUnit(item)"
|
||||
theme="outline"
|
||||
@change="scheduleStockPreview"
|
||||
/>
|
||||
<t-button
|
||||
class="unit"
|
||||
size="extra-small"
|
||||
variant="outline"
|
||||
:content="getFulfillmentUnit(item)?.name || '选择实际单位'"
|
||||
@click.stop="openUnitPicker(item)"
|
||||
/>
|
||||
<t-button
|
||||
size="extra-small"
|
||||
variant="outline"
|
||||
:disabled="getAvailableBaseQuantity(item) === '0' || (directVerify && isStockChecking)"
|
||||
@click.stop="fillAllQuantity(item)"
|
||||
>全部履约</t-button>
|
||||
</div>
|
||||
</div>
|
||||
<span class="can-fulfill" v-text="getItemDescription(item)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="input">
|
||||
<div class="quantity">
|
||||
<t-stepper
|
||||
v-model="quantityMap[item.id || '']"
|
||||
class="stepper"
|
||||
size="large"
|
||||
:max="Number.MAX_SAFE_INTEGER"
|
||||
:min="0"
|
||||
:step="getQuantityStep(item)"
|
||||
:integer="!allowsDecimalQuantity(item)"
|
||||
:disabled="!getFulfillmentUnit(item)"
|
||||
theme="outline"
|
||||
@change="scheduleStockPreview"
|
||||
/>
|
||||
<t-button
|
||||
class="unit"
|
||||
size="extra-small"
|
||||
variant="outline"
|
||||
:content="getFulfillmentUnit(item)?.name || '选择实际单位'"
|
||||
@click.stop="openUnitPicker(item)"
|
||||
/>
|
||||
<t-button
|
||||
size="extra-small"
|
||||
variant="outline"
|
||||
:disabled="getAvailableBaseQuantity(item) === '0' || (directVerify && isStockChecking)"
|
||||
@click.stop="fillAllQuantity(item)"
|
||||
>全部履约</t-button>
|
||||
</div>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<center-tips v-else :content="'暂无可履约明细,请返回订单详情检查'" />
|
||||
<t-form class="form card" label-width="7rem">
|
||||
<t-form-item label="履约时间" content-align="right">
|
||||
<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" />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="directVerify || stockPreviewList.length" label-width="0">
|
||||
<div class="stock-tips">
|
||||
<span v-if="directVerify" class="tips red">直接核销会立即扣减实物库存</span>
|
||||
<product-stock-preview v-if="stockPreviewList.length" :items="stockPreviewList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<center-tips v-else :content="'暂无可履约明细,请返回订单详情检查'" />
|
||||
<t-form class="form card" label-width="7rem">
|
||||
<t-form-item label="履约时间" content-align="right">
|
||||
<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" />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="directVerify || stockPreviewList.length" label-width="0">
|
||||
<div class="stock-tips">
|
||||
<span v-if="directVerify" class="tips red">直接核销会立即扣减实物库存</span>
|
||||
<product-stock-preview v-if="stockPreviewList.length" :items="stockPreviewList" />
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea v-model="remark" borderless autosize maxlength="500" />
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<attachment-selector
|
||||
v-if="order"
|
||||
v-model:items="photoItems"
|
||||
:upload="uploadPhotoList"
|
||||
required
|
||||
title="履约凭证照片"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-popup v-model="unitPickerVisible" placement="bottom">
|
||||
<t-picker v-model="unitPickerDraft" :columns="unitPickerOptions" title="选择实际履约单位" @cancel="unitPickerVisible = false" @confirm="confirmUnitPicker" />
|
||||
</t-popup>
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea v-model="remark" borderless autosize maxlength="500" />
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<attachment-selector
|
||||
v-if="order"
|
||||
v-model:items="photoItems"
|
||||
:upload="uploadPhotoList"
|
||||
required
|
||||
title="履约凭证照片"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-popup v-model="unitPickerVisible" placement="bottom">
|
||||
<t-picker v-model="unitPickerDraft" :columns="unitPickerOptions" title="选择实际履约单位" @cancel="unitPickerVisible = false" @confirm="confirmUnitPicker" />
|
||||
</t-popup>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -598,7 +602,7 @@ onUnmounted(() => {
|
||||
<style scoped lang="less">
|
||||
.fulfillment-create {
|
||||
gap: 1rem;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 2rem;
|
||||
padding: 0 0 2rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
@@ -1,173 +1,177 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="履约单详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div v-can="permissionCodes.orderFulfillment.read" class="fulfillment-detail">
|
||||
<template v-if="fulfillment">
|
||||
<t-cell-group title="履约单信息" theme="card" v-entrance-transition>
|
||||
<t-cell title="销售订单" arrow @click="toOrder" />
|
||||
<t-cell title="订单项类型" :note="getSalesOrderItemTypeText(sourceItemType)" />
|
||||
<t-cell title="状态"><template #note><t-tag :content="getFulfillmentStatusText(fulfillment.status)" variant="light-outline" :theme="getStatusTheme(fulfillment.status)" /></template></t-cell>
|
||||
<t-cell title="履约时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="fulfillment.deliveredAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell v-if="fulfillment.returnedAt" title="退货时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="fulfillment.returnedAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="提交人" :note="fulfillment.operator?.nick || fulfillment.operator?.name || fulfillment.operatorUserId || '未知'" />
|
||||
<t-cell title="处理人" :note="fulfillment.verifier?.nick || fulfillment.verifier?.name || fulfillment.verifierUserId || '未处理'" />
|
||||
<t-cell v-if="fulfillment.reason" title="原因" :note="fulfillment.reason" />
|
||||
<t-cell v-if="fulfillment.remark" title="备注" :note="fulfillment.remark" />
|
||||
<div class="photo-wrap bg-white">
|
||||
<attachment-selector :items="fulfillmentPhotoItems" title="履约照片" readonly />
|
||||
</div>
|
||||
</t-cell-group>
|
||||
<t-cell-group class="items" title="履约明细" theme="card" v-entrance-transition>
|
||||
<t-cell
|
||||
class="item"
|
||||
v-for="item in fulfillment.itemList || []"
|
||||
:key="item.id"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-image
|
||||
v-if="getProductPhotoURL(item)"
|
||||
:src="getProductPhotoURL(item)"
|
||||
:alt="item.productNameSnapshot || '产品图片'"
|
||||
fit="cover"
|
||||
class="avatar"
|
||||
/>
|
||||
<div
|
||||
v-else
|
||||
class="avatar fallback"
|
||||
v-text="(item.productNameSnapshot || '产').slice(0, 1)"
|
||||
/>
|
||||
</template>
|
||||
<template #title>
|
||||
<div class="title">
|
||||
<span class="clip-text" v-text="item.productNameSnapshot || '未命名产品'" />
|
||||
<t-tag v-if="isGiftedFulfillmentItem(item)" size="small" theme="success" content="赠送" />
|
||||
<product-sku-tags
|
||||
class="tags"
|
||||
:product-name="item.productNameSnapshot"
|
||||
:snapshot="item.skuSpecSnapshot"
|
||||
:fallback="item.specSummarySnapshot || item.skuNameSnapshot || '默认 SKU'"
|
||||
/>
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="履约单详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.orderFulfillment.read" class="fulfillment-detail">
|
||||
<template v-if="fulfillment">
|
||||
<t-cell-group title="履约单信息" theme="card" v-entrance-transition>
|
||||
<t-cell title="销售订单" arrow @click="toOrder" />
|
||||
<t-cell title="订单项类型" :note="getSalesOrderItemTypeText(sourceItemType)" />
|
||||
<t-cell title="状态"><template #note><t-tag :content="getFulfillmentStatusText(fulfillment.status)" variant="light-outline" :theme="getStatusTheme(fulfillment.status)" /></template></t-cell>
|
||||
<t-cell title="履约时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="fulfillment.deliveredAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell v-if="fulfillment.returnedAt" title="退货时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="fulfillment.returnedAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="提交人" :note="fulfillment.operator?.nick || fulfillment.operator?.name || fulfillment.operatorUserId || '未知'" />
|
||||
<t-cell title="处理人" :note="fulfillment.verifier?.nick || fulfillment.verifier?.name || fulfillment.verifierUserId || '未处理'" />
|
||||
<t-cell v-if="fulfillment.reason" title="原因" :note="fulfillment.reason" />
|
||||
<t-cell v-if="fulfillment.remark" title="备注" :note="fulfillment.remark" />
|
||||
<div class="photo-wrap bg-white">
|
||||
<attachment-selector :items="fulfillmentPhotoItems" title="履约照片" readonly />
|
||||
</div>
|
||||
</template>
|
||||
<template #note>
|
||||
<span class="keep-text" v-text="getFulfillmentQuantityText(item)" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell v-if="!fulfillment.itemList?.length" title="暂无履约明细" />
|
||||
</t-cell-group>
|
||||
<section
|
||||
v-if="stockPreviewVisible && (stockPreviewLoading || stockPreviewList.length)"
|
||||
class="stock-preview"
|
||||
v-entrance-transition
|
||||
>
|
||||
<div class="title">库存预览</div>
|
||||
<t-loading v-if="stockPreviewLoading" size="1.5rem" text="加载中" />
|
||||
<product-stock-preview v-else-if="stockPreviewList.length" :items="stockPreviewList" />
|
||||
</section>
|
||||
<section
|
||||
v-if="(!isOrderCancelled && (isWaitingStock || isPending) && (canVerify || canCancel)) || (isVerified && (canReturn || canRevoke))"
|
||||
class="actions"
|
||||
v-entrance-transition
|
||||
>
|
||||
<t-button
|
||||
v-if="!isOrderCancelled && isWaitingStock && canVerify"
|
||||
theme="primary"
|
||||
content="准备库存"
|
||||
@click="prepareStock"
|
||||
/>
|
||||
<div v-if="!isOrderCancelled && isPending && canVerify" class="pair">
|
||||
<t-button theme="primary" content="核销履约" @click="verify" />
|
||||
<t-button theme="danger" content="拒绝履约" @click="openReason('reject')" />
|
||||
</div>
|
||||
<t-button
|
||||
v-if="!isOrderCancelled && (isWaitingStock || isPending) && canCancel"
|
||||
theme="default"
|
||||
content="撤销履约"
|
||||
@click="openReason('cancel')"
|
||||
/>
|
||||
<t-button
|
||||
v-if="isVerified && canReturn"
|
||||
theme="primary"
|
||||
content="履约退货"
|
||||
@click="returnVisible = true"
|
||||
/>
|
||||
<t-button
|
||||
v-if="isVerified && canRevoke"
|
||||
theme="danger"
|
||||
content="履约冲正"
|
||||
@click="revokeVisible = true"
|
||||
/>
|
||||
</section>
|
||||
</template>
|
||||
<t-empty v-else :description="loading ? '正在加载履约单' : '履约单不存在'" />
|
||||
<t-dialog
|
||||
v-model:visible="reasonVisible"
|
||||
:title="reasonAction === 'reject' ? '拒绝履约' : '撤销履约'"
|
||||
cancel-btn="取消"
|
||||
:confirm-btn="reasonAction === 'reject' ? '拒绝' : '撤销'"
|
||||
@cancel="reasonVisible = false"
|
||||
@confirm="submitReason"
|
||||
>
|
||||
<div class="reason">
|
||||
<t-input
|
||||
label="原因"
|
||||
v-model="reason"
|
||||
borderless
|
||||
autosize
|
||||
maxlength="500"
|
||||
placeholder="请输入原因"
|
||||
>
|
||||
<template #suffix>
|
||||
</t-cell-group>
|
||||
<t-cell-group class="items" title="履约明细" theme="card" v-entrance-transition>
|
||||
<t-cell
|
||||
class="item"
|
||||
v-for="item in fulfillment.itemList || []"
|
||||
:key="item.id"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-image
|
||||
v-if="getProductPhotoURL(item)"
|
||||
:src="getProductPhotoURL(item)"
|
||||
:alt="item.productNameSnapshot || '产品图片'"
|
||||
fit="cover"
|
||||
class="avatar"
|
||||
/>
|
||||
<div
|
||||
v-else
|
||||
class="avatar fallback"
|
||||
v-text="(item.productNameSnapshot || '产').slice(0, 1)"
|
||||
/>
|
||||
</template>
|
||||
<template #title>
|
||||
<div class="title">
|
||||
<span class="clip-text" v-text="item.productNameSnapshot || '未命名产品'" />
|
||||
<t-tag v-if="isGiftedFulfillmentItem(item)" size="small" theme="success" content="赠送" />
|
||||
<product-sku-tags
|
||||
class="tags"
|
||||
:product-name="item.productNameSnapshot"
|
||||
:snapshot="item.skuSpecSnapshot"
|
||||
:fallback="item.specSummarySnapshot || item.skuNameSnapshot || '默认 SKU'"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template #note>
|
||||
<span class="keep-text" v-text="getFulfillmentQuantityText(item)" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell v-if="!fulfillment.itemList?.length" title="暂无履约明细" />
|
||||
</t-cell-group>
|
||||
<section
|
||||
v-if="stockPreviewVisible && (stockPreviewLoading || stockPreviewList.length)"
|
||||
class="stock-preview"
|
||||
v-entrance-transition
|
||||
>
|
||||
<div class="title">库存预览</div>
|
||||
<t-loading v-if="stockPreviewLoading" size="1.5rem" text="加载中" />
|
||||
<product-stock-preview v-else-if="stockPreviewList.length" :items="stockPreviewList" />
|
||||
</section>
|
||||
<section
|
||||
v-if="(!isOrderCancelled && (isWaitingStock || isPending) && (canVerify || canCancel)) || (isVerified && (canReturn || canRevoke))"
|
||||
class="actions"
|
||||
v-entrance-transition
|
||||
>
|
||||
<t-button
|
||||
size="extra-small"
|
||||
v-if="!isOrderCancelled && isWaitingStock && canVerify"
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
content="选择"
|
||||
@click="openReasonPicker"
|
||||
content="准备库存"
|
||||
@click="prepareStock"
|
||||
/>
|
||||
</template>
|
||||
</t-input>
|
||||
<div v-if="!isOrderCancelled && isPending && canVerify" class="pair">
|
||||
<t-button theme="primary" content="核销履约" @click="verify" />
|
||||
<t-button theme="danger" content="拒绝履约" @click="openReason('reject')" />
|
||||
</div>
|
||||
<t-button
|
||||
v-if="!isOrderCancelled && (isWaitingStock || isPending) && canCancel"
|
||||
theme="default"
|
||||
content="撤销履约"
|
||||
@click="openReason('cancel')"
|
||||
/>
|
||||
<t-button
|
||||
v-if="isVerified && canReturn"
|
||||
theme="primary"
|
||||
content="履约退货"
|
||||
@click="returnVisible = true"
|
||||
/>
|
||||
<t-button
|
||||
v-if="isVerified && canRevoke"
|
||||
theme="danger"
|
||||
content="履约冲正"
|
||||
@click="revokeVisible = true"
|
||||
/>
|
||||
</section>
|
||||
</template>
|
||||
<t-empty v-else :description="loading ? '正在加载履约单' : '履约单不存在'" />
|
||||
<t-dialog
|
||||
v-model:visible="reasonVisible"
|
||||
:title="reasonAction === 'reject' ? '拒绝履约' : '撤销履约'"
|
||||
cancel-btn="取消"
|
||||
:confirm-btn="reasonAction === 'reject' ? '拒绝' : '撤销'"
|
||||
@cancel="reasonVisible = false"
|
||||
@confirm="submitReason"
|
||||
>
|
||||
<div class="reason">
|
||||
<t-input
|
||||
label="原因"
|
||||
v-model="reason"
|
||||
borderless
|
||||
autosize
|
||||
maxlength="500"
|
||||
placeholder="请输入原因"
|
||||
>
|
||||
<template #suffix>
|
||||
<t-button
|
||||
size="extra-small"
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
content="选择"
|
||||
@click="openReasonPicker"
|
||||
/>
|
||||
</template>
|
||||
</t-input>
|
||||
</div>
|
||||
</t-dialog>
|
||||
<t-popup
|
||||
v-model="reasonPickerVisible"
|
||||
placement="bottom"
|
||||
:z-index="reasonPickerZIndex"
|
||||
:overlay-props="{ zIndex: reasonPickerZIndex - 1 }"
|
||||
>
|
||||
<t-picker
|
||||
v-model="reasonPickerDraft"
|
||||
:columns="reasonPickerColumns"
|
||||
:title="reasonAction === 'reject' ? '选择拒绝原因' : '选择撤销原因'"
|
||||
@cancel="reasonPickerVisible = false"
|
||||
@confirm="confirmReason"
|
||||
/>
|
||||
</t-popup>
|
||||
<order-fulfillment-revoke
|
||||
v-if="fulfillment"
|
||||
v-model:visible="revokeVisible"
|
||||
:fulfillment="fulfillment"
|
||||
@success="loadData"
|
||||
/>
|
||||
<order-fulfillment-return
|
||||
v-if="fulfillment"
|
||||
v-model:visible="returnVisible"
|
||||
:fulfillment="fulfillment"
|
||||
@success="loadData"
|
||||
/>
|
||||
</div>
|
||||
</t-dialog>
|
||||
<t-popup
|
||||
v-model="reasonPickerVisible"
|
||||
placement="bottom"
|
||||
:z-index="reasonPickerZIndex"
|
||||
:overlay-props="{ zIndex: reasonPickerZIndex - 1 }"
|
||||
>
|
||||
<t-picker
|
||||
v-model="reasonPickerDraft"
|
||||
:columns="reasonPickerColumns"
|
||||
:title="reasonAction === 'reject' ? '选择拒绝原因' : '选择撤销原因'"
|
||||
@cancel="reasonPickerVisible = false"
|
||||
@confirm="confirmReason"
|
||||
/>
|
||||
</t-popup>
|
||||
<order-fulfillment-revoke
|
||||
v-if="fulfillment"
|
||||
v-model:visible="revokeVisible"
|
||||
:fulfillment="fulfillment"
|
||||
@success="loadData"
|
||||
/>
|
||||
<order-fulfillment-return
|
||||
v-if="fulfillment"
|
||||
v-model:visible="returnVisible"
|
||||
:fulfillment="fulfillment"
|
||||
@success="loadData"
|
||||
/>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -440,7 +444,7 @@ onMounted(loadData);
|
||||
<style scoped lang="less">
|
||||
.fulfillment-detail {
|
||||
gap: 1rem;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 2rem;
|
||||
padding: 0 0 2rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<navbar-actions :actions="actions" :visible="canCreate" />
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main v-can="permissionCodes.orderFulfillment.read" class="page-content scroll list">
|
||||
<main v-can="permissionCodes.orderFulfillment.read" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh"
|
||||
v-model="refreshing"
|
||||
|
||||
+143
-139
@@ -1,145 +1,149 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="快速扫码登记"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div v-can="permissionCodes.eventRecord.create" class="quick-sign-in-page">
|
||||
<t-cell-group v-if="!isEventLoading && !eventLoadFailed" theme="card">
|
||||
<t-cell title="登记事件" arrow @click="eventPopupVisible = true">
|
||||
<template #left-icon>
|
||||
<t-icon name="task-setting" />
|
||||
</template>
|
||||
<template #note>
|
||||
<span class="red text-bold" v-text="selectedEventName" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="识别成功自动登记">
|
||||
<template #left-icon>
|
||||
<t-icon name="task-checked" />
|
||||
</template>
|
||||
<template #right-icon>
|
||||
<t-switch v-model="autoRegisterEnabled" />
|
||||
</template>
|
||||
<template #description>
|
||||
<div class="red">扫码匹配客户后自动提交登记,请注意已选登记事件和选项</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<center-tips v-else-if="isEventLoading">正在加载登记事件</center-tips>
|
||||
<center-tips v-else>登记事件加载失败</center-tips>
|
||||
<div v-if="selectedEventList && selectedEventList[0]?.optionGroupList?.length !== 0" class="content-margin">
|
||||
<event-option-selector
|
||||
v-model="selectedOptionSelectionMap"
|
||||
:event-list="eventList"
|
||||
:selected-event-id-list="selectedEventIdList"
|
||||
/>
|
||||
</div>
|
||||
<div class="content-margin">
|
||||
<code-scanner
|
||||
visible
|
||||
:session-key="scannerSessionKey"
|
||||
:status-text="scanStatus"
|
||||
active-text="请将客户二维码移入取景框"
|
||||
@decode="handleDecodedText"
|
||||
@status-change="handleScanStatusChange"
|
||||
/>
|
||||
</div>
|
||||
<t-button
|
||||
class="cell-button"
|
||||
theme="primary"
|
||||
:disabled="!canSubmitRegister"
|
||||
:loading="submitting"
|
||||
v-entrance-transition
|
||||
@click="doSubmit()"
|
||||
>登记</t-button>
|
||||
<customer-profile-card
|
||||
v-if="matchedCustomer"
|
||||
class="content-margin"
|
||||
:customer="matchedCustomer"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="快速扫码登记"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<t-form
|
||||
v-if="selectedNumberEventList.length"
|
||||
class="input-form"
|
||||
label-align="left"
|
||||
label-width="8rem"
|
||||
>
|
||||
<t-form-item
|
||||
v-for="item in selectedNumberEventList"
|
||||
:key="item.id"
|
||||
:label="`${item.name || '未命名事件'}数值`"
|
||||
:required-mark="item.requireValue === true"
|
||||
>
|
||||
<t-input
|
||||
v-model.trim="numberValueTextMap[item.id || '']"
|
||||
type="number"
|
||||
align="right"
|
||||
borderless
|
||||
:placeholder="getNumberValuePlaceholder(item)"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<div v-if="showRecordPhotoInput" class="input-form photo-form content-margin">
|
||||
<attachment-selector
|
||||
title="登记事件照片"
|
||||
:required="selectedRequiredPhotoEventList.length > 0"
|
||||
v-model:items="recordPhotoItemList"
|
||||
:busy="recordPhotoUploading"
|
||||
@select="handleRecordPhotoSelected($event.files)"
|
||||
/>
|
||||
</div>
|
||||
<t-cell-group
|
||||
v-if="recentRecordList.length"
|
||||
title="最近登记记录"
|
||||
theme="card"
|
||||
>
|
||||
<t-cell
|
||||
v-for="item in recentRecordList"
|
||||
:key="item.id"
|
||||
:title="item.event?.name || '未知事件'"
|
||||
:description="Time.toDateTime(item.registeredAt)"
|
||||
:note="item.remark || '无备注'"
|
||||
arrow
|
||||
hover
|
||||
@click="toRecordDetail(item.id || '')"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-image
|
||||
v-if="getEventRecordPhotoURL(item, 64)"
|
||||
:src="getEventRecordPhotoURL(item, 64)"
|
||||
:alt="item.event?.name || '未知事件'"
|
||||
fit="cover"
|
||||
class="record-photo"
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.eventRecord.create" class="quick-sign-in-page">
|
||||
<t-cell-group v-if="!isEventLoading && !eventLoadFailed" theme="card">
|
||||
<t-cell title="登记事件" arrow @click="eventPopupVisible = true">
|
||||
<template #left-icon>
|
||||
<t-icon name="task-setting" />
|
||||
</template>
|
||||
<template #note>
|
||||
<span class="red text-bold" v-text="selectedEventName" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="识别成功自动登记">
|
||||
<template #left-icon>
|
||||
<t-icon name="task-checked" />
|
||||
</template>
|
||||
<template #right-icon>
|
||||
<t-switch v-model="autoRegisterEnabled" />
|
||||
</template>
|
||||
<template #description>
|
||||
<div class="red">扫码匹配客户后自动提交登记,请注意已选登记事件和选项</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<center-tips v-else-if="isEventLoading">正在加载登记事件</center-tips>
|
||||
<center-tips v-else>登记事件加载失败</center-tips>
|
||||
<div v-if="selectedEventList && selectedEventList[0]?.optionGroupList?.length !== 0" class="content-margin">
|
||||
<event-option-selector
|
||||
v-model="selectedOptionSelectionMap"
|
||||
:event-list="eventList"
|
||||
:selected-event-id-list="selectedEventIdList"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
</div>
|
||||
<bottom-popup
|
||||
v-model="eventPopupVisible"
|
||||
title="选择登记事件"
|
||||
left-button-text="关闭"
|
||||
right-button-text=""
|
||||
@left-button-click="eventPopupVisible = false"
|
||||
>
|
||||
<div class="event-popup">
|
||||
<event-selector
|
||||
v-if="!isEventLoading && !eventLoadFailed"
|
||||
:model-value="selectedEventIdList"
|
||||
:event-list="eventList"
|
||||
selection-mode="single"
|
||||
label=""
|
||||
@update:model-value="handleEventSelectionChange"
|
||||
/>
|
||||
<center-tips v-else-if="isEventLoading">正在加载登记事件</center-tips>
|
||||
<div v-else class="event-load-error">
|
||||
<span>登记事件加载失败</span>
|
||||
<t-button size="small" theme="primary" variant="text" @click="loadActions">重试</t-button>
|
||||
</div>
|
||||
<div class="content-margin">
|
||||
<code-scanner
|
||||
visible
|
||||
:session-key="scannerSessionKey"
|
||||
:status-text="scanStatus"
|
||||
active-text="请将客户二维码移入取景框"
|
||||
@decode="handleDecodedText"
|
||||
@status-change="handleScanStatusChange"
|
||||
/>
|
||||
</div>
|
||||
<t-button
|
||||
class="cell-button"
|
||||
theme="primary"
|
||||
:disabled="!canSubmitRegister"
|
||||
:loading="submitting"
|
||||
v-entrance-transition
|
||||
@click="doSubmit()"
|
||||
>登记</t-button>
|
||||
<customer-profile-card
|
||||
v-if="matchedCustomer"
|
||||
class="content-margin"
|
||||
:customer="matchedCustomer"
|
||||
/>
|
||||
<t-form
|
||||
v-if="selectedNumberEventList.length"
|
||||
class="input-form"
|
||||
label-align="left"
|
||||
label-width="8rem"
|
||||
>
|
||||
<t-form-item
|
||||
v-for="item in selectedNumberEventList"
|
||||
:key="item.id"
|
||||
:label="`${item.name || '未命名事件'}数值`"
|
||||
:required-mark="item.requireValue === true"
|
||||
>
|
||||
<t-input
|
||||
v-model.trim="numberValueTextMap[item.id || '']"
|
||||
type="number"
|
||||
align="right"
|
||||
borderless
|
||||
:placeholder="getNumberValuePlaceholder(item)"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<div v-if="showRecordPhotoInput" class="input-form photo-form content-margin">
|
||||
<attachment-selector
|
||||
title="登记事件照片"
|
||||
:required="selectedRequiredPhotoEventList.length > 0"
|
||||
v-model:items="recordPhotoItemList"
|
||||
:busy="recordPhotoUploading"
|
||||
@select="handleRecordPhotoSelected($event.files)"
|
||||
/>
|
||||
</div>
|
||||
<t-cell-group
|
||||
v-if="recentRecordList.length"
|
||||
title="最近登记记录"
|
||||
theme="card"
|
||||
>
|
||||
<t-cell
|
||||
v-for="item in recentRecordList"
|
||||
:key="item.id"
|
||||
:title="item.event?.name || '未知事件'"
|
||||
:description="Time.toDateTime(item.registeredAt)"
|
||||
:note="item.remark || '无备注'"
|
||||
arrow
|
||||
hover
|
||||
@click="toRecordDetail(item.id || '')"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-image
|
||||
v-if="getEventRecordPhotoURL(item, 64)"
|
||||
:src="getEventRecordPhotoURL(item, 64)"
|
||||
:alt="item.event?.name || '未知事件'"
|
||||
fit="cover"
|
||||
class="record-photo"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
</div>
|
||||
</div>
|
||||
</bottom-popup>
|
||||
</main>
|
||||
<bottom-popup
|
||||
v-model="eventPopupVisible"
|
||||
title="选择登记事件"
|
||||
left-button-text="关闭"
|
||||
right-button-text=""
|
||||
@left-button-click="eventPopupVisible = false"
|
||||
>
|
||||
<div class="event-popup">
|
||||
<event-selector
|
||||
v-if="!isEventLoading && !eventLoadFailed"
|
||||
:model-value="selectedEventIdList"
|
||||
:event-list="eventList"
|
||||
selection-mode="single"
|
||||
label=""
|
||||
@update:model-value="handleEventSelectionChange"
|
||||
/>
|
||||
<center-tips v-else-if="isEventLoading">正在加载登记事件</center-tips>
|
||||
<div v-else class="event-load-error">
|
||||
<span>登记事件加载失败</span>
|
||||
<t-button size="small" theme="primary" variant="text" @click="loadActions">重试</t-button>
|
||||
</div>
|
||||
</div>
|
||||
</bottom-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -510,7 +514,7 @@ async function doSubmit(isAutoRegister = false): Promise<void> {
|
||||
<style scoped lang="less">
|
||||
.quick-sign-in-page {
|
||||
gap: 1rem;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 1rem 0;
|
||||
padding: 0 0 1rem 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
@@ -1,57 +1,61 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="通知详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="detail?.id && canDeleteNotify"
|
||||
@click="confirmDelete"
|
||||
theme="danger"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="删除"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="corePermissionCodes.notify.read" class="notify-detail">
|
||||
<t-empty
|
||||
v-if="!detail"
|
||||
:description="isLoading ? '正在加载通知' : '通知不存在'"
|
||||
/>
|
||||
<template v-else>
|
||||
<t-cell-group title="通知状态" theme="card" v-entrance-transition>
|
||||
<t-cell title="发送用户" :note="`${detail.detailList?.length || 0} 人`" arrow @click="openRecipientList"/>
|
||||
<t-cell title="已读用户" :note="`${readCount} 人`" arrow @click="openReadRecipientList"/>
|
||||
<t-cell title="未读用户" :note="`${unreadCount} 人`" arrow @click="openUnreadRecipientList"/>
|
||||
<t-cell title="当前状态">
|
||||
<template #note>
|
||||
<t-tag size="small" :theme="getSummaryTheme" :content="getSummaryStatus" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-button
|
||||
v-if="canCancelNotify && canCancel"
|
||||
class="bg-white red cell-button"
|
||||
variant="text"
|
||||
block
|
||||
:loading="isCanceling"
|
||||
v-entrance-transition
|
||||
@click="confirmCancel"
|
||||
content="取消发送"
|
||||
/>
|
||||
<notify-content
|
||||
class="preview"
|
||||
:detail="mainDetail"
|
||||
:subject="getSubject(detail)"
|
||||
:time="getSendTime(mainDetail)"
|
||||
:resolve-attachment-url="resolveAttachmentUrl"
|
||||
v-entrance-transition
|
||||
/>
|
||||
</template>
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="通知详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="detail?.id && canDeleteNotify"
|
||||
@click="confirmDelete"
|
||||
theme="danger"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="删除"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="corePermissionCodes.notify.read" class="notify-detail">
|
||||
<t-empty
|
||||
v-if="!detail"
|
||||
:description="isLoading ? '正在加载通知' : '通知不存在'"
|
||||
/>
|
||||
<template v-else>
|
||||
<t-cell-group title="通知状态" theme="card" v-entrance-transition>
|
||||
<t-cell title="发送用户" :note="`${detail.detailList?.length || 0} 人`" arrow @click="openRecipientList"/>
|
||||
<t-cell title="已读用户" :note="`${readCount} 人`" arrow @click="openReadRecipientList"/>
|
||||
<t-cell title="未读用户" :note="`${unreadCount} 人`" arrow @click="openUnreadRecipientList"/>
|
||||
<t-cell title="当前状态">
|
||||
<template #note>
|
||||
<t-tag size="small" :theme="getSummaryTheme" :content="getSummaryStatus" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-button
|
||||
v-if="canCancelNotify && canCancel"
|
||||
class="bg-white red cell-button"
|
||||
variant="text"
|
||||
block
|
||||
:loading="isCanceling"
|
||||
v-entrance-transition
|
||||
@click="confirmCancel"
|
||||
content="取消发送"
|
||||
/>
|
||||
<notify-content
|
||||
class="preview"
|
||||
:detail="mainDetail"
|
||||
:subject="getSubject(detail)"
|
||||
:time="getSendTime(mainDetail)"
|
||||
:resolve-attachment-url="resolveAttachmentUrl"
|
||||
v-entrance-transition
|
||||
/>
|
||||
</template>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -275,7 +279,7 @@ watch(() => route.params.id, async () => {
|
||||
.notify-detail {
|
||||
gap: 1rem;
|
||||
min-height: 100%;
|
||||
padding: var(--app-nav-height) 0 1rem;
|
||||
padding: 0 0 1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main v-can="corePermissionCodes.notify.read" class="page-content scroll list">
|
||||
<main v-can="corePermissionCodes.notify.read" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -1,59 +1,65 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="发送用户"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div v-can="corePermissionCodes.notify.read" class="notify-recipient-list">
|
||||
<template v-if="detail">
|
||||
<t-segmented
|
||||
v-model="recipientFilter"
|
||||
class="filter"
|
||||
block
|
||||
:options="recipientFilterOptions"
|
||||
v-entrance-transition
|
||||
/>
|
||||
<t-cell-group v-if="filteredDetailList.length" theme="card" class="recipients">
|
||||
<t-cell
|
||||
v-for="item in filteredDetailList"
|
||||
:key="item.id"
|
||||
v-entrance-transition="{ step: 30 }"
|
||||
>
|
||||
<template #title>
|
||||
<div class="recipient-title">
|
||||
<span v-text="getRecipientName(item)" />
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="recipientFilter === 'all'" #description>
|
||||
<div class="recipient-description">
|
||||
<time-label :timestamp="item.sendAt" underline />
|
||||
<span v-if="item.resultDesc" v-text="item.resultDesc" />
|
||||
</div>
|
||||
</template>
|
||||
<template #note>
|
||||
<t-tag
|
||||
v-if="recipientFilter === 'all'"
|
||||
size="small"
|
||||
:theme="getStatusTheme(item)"
|
||||
:content="getStatusText(item)"
|
||||
/>
|
||||
<time-label
|
||||
v-else-if="recipientFilter === 'read'"
|
||||
:timestamp="item.readAt"
|
||||
underline
|
||||
/>
|
||||
<telephone-link v-else :value="item.toUser?.phoneNo" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-empty v-else description="暂无匹配的接收用户" v-entrance-transition />
|
||||
</template>
|
||||
<t-empty
|
||||
v-else
|
||||
:description="isLoading ? '正在加载发送用户' : '通知不存在'"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="发送用户"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main class="page-content scroll column list">
|
||||
<div class="pull-refresh">
|
||||
<div v-can="corePermissionCodes.notify.read" class="notify-recipient-list">
|
||||
<template v-if="detail">
|
||||
<t-segmented
|
||||
v-model="recipientFilter"
|
||||
class="filter"
|
||||
block
|
||||
:options="recipientFilterOptions"
|
||||
v-entrance-transition
|
||||
/>
|
||||
<t-cell-group v-if="filteredDetailList.length" theme="card" class="recipients">
|
||||
<t-cell
|
||||
v-for="item in filteredDetailList"
|
||||
:key="item.id"
|
||||
v-entrance-transition="{ step: 30 }"
|
||||
>
|
||||
<template #title>
|
||||
<div class="recipient-title">
|
||||
<span v-text="getRecipientName(item)" />
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="recipientFilter === 'all'" #description>
|
||||
<div class="recipient-description">
|
||||
<time-label :timestamp="item.sendAt" underline />
|
||||
<span v-if="item.resultDesc" v-text="item.resultDesc" />
|
||||
</div>
|
||||
</template>
|
||||
<template #note>
|
||||
<t-tag
|
||||
v-if="recipientFilter === 'all'"
|
||||
size="small"
|
||||
:theme="getStatusTheme(item)"
|
||||
:content="getStatusText(item)"
|
||||
/>
|
||||
<time-label
|
||||
v-else-if="recipientFilter === 'read'"
|
||||
:timestamp="item.readAt"
|
||||
underline
|
||||
/>
|
||||
<telephone-link v-else :value="item.toUser?.phoneNo" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-empty v-else description="暂无匹配的接收用户" v-entrance-transition />
|
||||
</template>
|
||||
<t-empty
|
||||
v-else
|
||||
:description="isLoading ? '正在加载发送用户' : '通知不存在'"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -176,7 +182,7 @@ watch(() => route.query.filter, () => {
|
||||
.notify-recipient-list {
|
||||
gap: 1rem;
|
||||
min-height: 100%;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 1rem;
|
||||
padding: 0 0 1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
@@ -1,34 +1,38 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="通知详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="detail?.id"
|
||||
@click="confirmDelete"
|
||||
theme="danger"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="删除"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="corePermissionCodes.notify.read" class="notify-detail">
|
||||
<notify-content
|
||||
v-if="detail"
|
||||
:detail="detail"
|
||||
:sender="getSenderName(detail)"
|
||||
:timestamp="detail.sendAt"
|
||||
:resolve-attachment-url="resolveAttachmentUrl"
|
||||
/>
|
||||
<t-empty
|
||||
v-else
|
||||
:description="isLoading ? '正在加载通知' : '通知不存在'"
|
||||
/>
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="通知详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="detail?.id"
|
||||
@click="confirmDelete"
|
||||
theme="danger"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="删除"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="corePermissionCodes.notify.read" class="notify-detail">
|
||||
<notify-content
|
||||
v-if="detail"
|
||||
:detail="detail"
|
||||
:sender="getSenderName(detail)"
|
||||
:timestamp="detail.sendAt"
|
||||
:resolve-attachment-url="resolveAttachmentUrl"
|
||||
/>
|
||||
<t-empty
|
||||
v-else
|
||||
:description="isLoading ? '正在加载通知' : '通知不存在'"
|
||||
/>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -166,7 +170,7 @@ watch(() => route.params.id, async () => {
|
||||
|
||||
<style scoped lang="less">
|
||||
.notify-detail {
|
||||
padding: var(--app-nav-height) 0 1rem 0;
|
||||
padding: 0 0 1rem 0;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main v-can="corePermissionCodes.notify.read" class="page-content scroll list">
|
||||
<main v-can="corePermissionCodes.notify.read" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -1,105 +1,109 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="套餐配置详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="canUpdate"
|
||||
@click="toEdit"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="编辑"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="permissionCodes.packageConfig.read" class="package-config-detail">
|
||||
<template v-if="config">
|
||||
<section class="hero" v-entrance-transition>
|
||||
<div class="header">
|
||||
<span class="eyebrow" v-text="'套餐管理'" />
|
||||
<t-tag
|
||||
:content="getPackageConfigStatusText(config.status)"
|
||||
variant="light-outline"
|
||||
:theme="getStatusTheme(config.status)"
|
||||
/>
|
||||
</div>
|
||||
<h1 class="title" v-text="config.name || '未命名套餐'" />
|
||||
<p class="description" v-text="config.description || '暂无套餐说明'" />
|
||||
<div class="items-price">
|
||||
<span v-text="`${config.itemList?.length || 0} 项产品权益`" />
|
||||
<div class="price text-bold">
|
||||
<span class="red">¥</span>
|
||||
<span class="red value" v-text="formatPackageAmount(config.standardAmount)" />
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<t-cell-group v-if="canReadSalesOrder" theme="card" v-entrance-transition>
|
||||
<t-cell title="套餐订单列表" arrow @click="toPackageOrderList">
|
||||
<template #left-icon>
|
||||
<t-icon name="gift" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group title="基本信息" theme="card" v-entrance-transition>
|
||||
<t-cell title="标准价" :note="formatPackageAmount(config.standardAmount)" />
|
||||
<t-cell title="起始日期" :note="config.beginAt ? Time.toDateTime(config.beginAt) : '不限'" />
|
||||
<t-cell title="终止日期" :note="config.endAt ? Time.toDateTime(config.endAt) : '不限'" />
|
||||
<t-cell title="最后修改人" :note="config.updater?.nick || config.updater?.name || '未知'" />
|
||||
</t-cell-group>
|
||||
<t-cell-group class="product" title="产品权益" theme="card" v-entrance-transition>
|
||||
<t-cell
|
||||
class="item"
|
||||
v-for="item in config.itemList || []"
|
||||
:key="item.id || `${item.skuId}-${item.skuUnitId}`"
|
||||
:note="`${item.defaultQuantity} ${item.unitSnapshot || ''}${item.remark ? `|${item.remark}` : ''}`"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-image
|
||||
v-if="getItemPhotoURL(item)"
|
||||
:src="getItemPhotoURL(item)"
|
||||
:alt="item.productNameSnapshot || '产品图片'"
|
||||
fit="cover"
|
||||
class="avatar"
|
||||
/>
|
||||
<div
|
||||
v-else
|
||||
class="avatar fallback"
|
||||
v-text="(item.productNameSnapshot || '产').slice(0, 1)"
|
||||
/>
|
||||
</template>
|
||||
<template #title>
|
||||
<div class="title">
|
||||
<span v-text="item.productNameSnapshot || '未命名产品'" />
|
||||
<product-sku-tags
|
||||
:product-name="item.productNameSnapshot"
|
||||
:fallback="item.specSummarySnapshot || item.skuNameSnapshot || '默认 SKU'"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="套餐配置详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="canUpdate"
|
||||
@click="toEdit"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="编辑"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.packageConfig.read" class="package-config-detail">
|
||||
<template v-if="config">
|
||||
<section class="hero" v-entrance-transition>
|
||||
<div class="header">
|
||||
<span class="eyebrow" v-text="'套餐管理'" />
|
||||
<t-tag
|
||||
:content="getPackageConfigStatusText(config.status)"
|
||||
variant="light-outline"
|
||||
:theme="getStatusTheme(config.status)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
<center-tips v-if="!config.itemList?.length" :content="'暂无产品权益'" />
|
||||
</t-cell-group>
|
||||
<t-button
|
||||
v-if="canPurchase"
|
||||
class="cell-button"
|
||||
theme="primary"
|
||||
content="购买套餐"
|
||||
@click="toPurchase"
|
||||
/>
|
||||
<t-button
|
||||
v-if="canDelete"
|
||||
class="cell-button"
|
||||
theme="danger"
|
||||
@click="removeConfig"
|
||||
content="删除"
|
||||
/>
|
||||
</template>
|
||||
<t-empty v-else :description="isLoading ? '正在加载套餐配置' : '套餐配置不存在'" />
|
||||
<h1 class="title" v-text="config.name || '未命名套餐'" />
|
||||
<p class="description" v-text="config.description || '暂无套餐说明'" />
|
||||
<div class="items-price">
|
||||
<span v-text="`${config.itemList?.length || 0} 项产品权益`" />
|
||||
<div class="price text-bold">
|
||||
<span class="red">¥</span>
|
||||
<span class="red value" v-text="formatPackageAmount(config.standardAmount)" />
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<t-cell-group v-if="canReadSalesOrder" theme="card" v-entrance-transition>
|
||||
<t-cell title="套餐订单列表" arrow @click="toPackageOrderList">
|
||||
<template #left-icon>
|
||||
<t-icon name="gift" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group title="基本信息" theme="card" v-entrance-transition>
|
||||
<t-cell title="标准价" :note="formatPackageAmount(config.standardAmount)" />
|
||||
<t-cell title="起始日期" :note="config.beginAt ? Time.toDateTime(config.beginAt) : '不限'" />
|
||||
<t-cell title="终止日期" :note="config.endAt ? Time.toDateTime(config.endAt) : '不限'" />
|
||||
<t-cell title="最后修改人" :note="config.updater?.nick || config.updater?.name || '未知'" />
|
||||
</t-cell-group>
|
||||
<t-cell-group class="product" title="产品权益" theme="card" v-entrance-transition>
|
||||
<t-cell
|
||||
class="item"
|
||||
v-for="item in config.itemList || []"
|
||||
:key="item.id || `${item.skuId}-${item.skuUnitId}`"
|
||||
:note="`${item.defaultQuantity} ${item.unitSnapshot || ''}${item.remark ? `|${item.remark}` : ''}`"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-image
|
||||
v-if="getItemPhotoURL(item)"
|
||||
:src="getItemPhotoURL(item)"
|
||||
:alt="item.productNameSnapshot || '产品图片'"
|
||||
fit="cover"
|
||||
class="avatar"
|
||||
/>
|
||||
<div
|
||||
v-else
|
||||
class="avatar fallback"
|
||||
v-text="(item.productNameSnapshot || '产').slice(0, 1)"
|
||||
/>
|
||||
</template>
|
||||
<template #title>
|
||||
<div class="title">
|
||||
<span v-text="item.productNameSnapshot || '未命名产品'" />
|
||||
<product-sku-tags
|
||||
:product-name="item.productNameSnapshot"
|
||||
:fallback="item.specSummarySnapshot || item.skuNameSnapshot || '默认 SKU'"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
<center-tips v-if="!config.itemList?.length" :content="'暂无产品权益'" />
|
||||
</t-cell-group>
|
||||
<t-button
|
||||
v-if="canPurchase"
|
||||
class="cell-button"
|
||||
theme="primary"
|
||||
content="购买套餐"
|
||||
@click="toPurchase"
|
||||
/>
|
||||
<t-button
|
||||
v-if="canDelete"
|
||||
class="cell-button"
|
||||
theme="danger"
|
||||
@click="removeConfig"
|
||||
content="删除"
|
||||
/>
|
||||
</template>
|
||||
<t-empty v-else :description="isLoading ? '正在加载套餐配置' : '套餐配置不存在'" />
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -228,7 +232,7 @@ onMounted(async () => {
|
||||
<style scoped lang="less">
|
||||
.package-config-detail {
|
||||
gap: 1rem;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 2rem;
|
||||
padding: 0 0 2rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
@@ -1,131 +1,135 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(savePermissionCode)"
|
||||
@click="save"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="保存"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="savePermissionCode" class="package-config-edit">
|
||||
<t-form class="form card" label-width="6rem" v-entrance-transition>
|
||||
<t-form-item label="套餐名称" required-mark>
|
||||
<t-input v-model="form.name" borderless maxlength="100" placeholder="请输入套餐名称" />
|
||||
</t-form-item>
|
||||
<t-form-item label="套餐说明">
|
||||
<t-textarea v-model="form.description" borderless maxlength="500" autosize placeholder="可填写套餐说明" />
|
||||
</t-form-item>
|
||||
<t-form-item label="标准价(元)" required-mark>
|
||||
<t-input v-model.trim="standardAmountText" type="number" align="right" borderless placeholder="例如 1288.00" />
|
||||
</t-form-item>
|
||||
<t-form-item label="状态" arrow @click="openStatusPicker" content-align="right">
|
||||
<span class="picker-text" v-text="getPackageConfigStatusText(form.status)" />
|
||||
</t-form-item>
|
||||
<t-form-item label="开始时间" arrow @click="openBeginPicker" content-align="right">
|
||||
<span class="picker-text" v-text="beginAtText || '不限'" />
|
||||
</t-form-item>
|
||||
<t-form-item label="结束时间" arrow @click="openEndPicker" content-align="right">
|
||||
<span class="picker-text" v-text="endAtText || '不限'" />
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<card-container
|
||||
title="产品权益"
|
||||
description="至少一项,配额最多三位小数"
|
||||
v-entrance-transition
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<div class="items">
|
||||
<t-form
|
||||
class="item"
|
||||
v-for="(item, index) in form.itemList"
|
||||
:key="item.clientKey"
|
||||
label-width="6rem"
|
||||
>
|
||||
<div class="header">
|
||||
<span class="no" v-text="String(index + 1).padStart(2, '0')" />
|
||||
<strong v-text="getItemTitle(item)" />
|
||||
<t-button
|
||||
v-if="1 < form.itemList.length"
|
||||
theme="danger"
|
||||
variant="text"
|
||||
size="small"
|
||||
@click="removeItem(index)"
|
||||
>删除</t-button>
|
||||
</div>
|
||||
<product-select-form-item
|
||||
:model-value="item.skuId ? { skuId: item.skuId, skuUnitId: item.skuUnitId || '' } : undefined"
|
||||
:selected-product="getProduct(item)"
|
||||
label="产品"
|
||||
placeholder="请选择产品"
|
||||
required-mark
|
||||
@update:model-value="applyProduct(index, $event)"
|
||||
@select="applyProductSelection(index, $event)"
|
||||
/>
|
||||
<t-form-item label="默认配额" content-align="right" required-mark>
|
||||
<t-stepper
|
||||
v-model="item.defaultQuantity"
|
||||
size="large"
|
||||
:max="Number.MAX_SAFE_INTEGER"
|
||||
:min="getQuantityStep(item)"
|
||||
:step="getQuantityStep(item)"
|
||||
:integer="!getSku(item)?.allowDecimalQuantity"
|
||||
theme="outline"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-input v-model.trim="item.remark" borderless placeholder="选填" />
|
||||
</t-form-item>
|
||||
<div class="price">
|
||||
<span>预估价(原价)</span>
|
||||
<animated-amount
|
||||
class="red text-bold"
|
||||
prefix="¥"
|
||||
empty-text="未定价"
|
||||
:value="calculateOriginalAmount(item)"
|
||||
/>
|
||||
</div>
|
||||
</t-form>
|
||||
<template #right>
|
||||
<t-button
|
||||
class="add"
|
||||
type="button"
|
||||
theme="light"
|
||||
variant="dashed"
|
||||
@click="addItem"
|
||||
content="添加产品权益"
|
||||
v-if="userStore.hasPermissions(savePermissionCode)"
|
||||
@click="save"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="保存"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="savePermissionCode" class="package-config-edit">
|
||||
<t-form class="form card" label-width="6rem" v-entrance-transition>
|
||||
<t-form-item label="套餐名称" required-mark>
|
||||
<t-input v-model="form.name" borderless maxlength="100" placeholder="请输入套餐名称" />
|
||||
</t-form-item>
|
||||
<t-form-item label="套餐说明">
|
||||
<t-textarea v-model="form.description" borderless maxlength="500" autosize placeholder="可填写套餐说明" />
|
||||
</t-form-item>
|
||||
<t-form-item label="标准价(元)" required-mark>
|
||||
<t-input v-model.trim="standardAmountText" type="number" align="right" borderless placeholder="例如 1288.00" />
|
||||
</t-form-item>
|
||||
<t-form-item label="状态" arrow @click="openStatusPicker" content-align="right">
|
||||
<span class="picker-text" v-text="getPackageConfigStatusText(form.status)" />
|
||||
</t-form-item>
|
||||
<t-form-item label="开始时间" arrow @click="openBeginPicker" content-align="right">
|
||||
<span class="picker-text" v-text="beginAtText || '不限'" />
|
||||
</t-form-item>
|
||||
<t-form-item label="结束时间" arrow @click="openEndPicker" content-align="right">
|
||||
<span class="picker-text" v-text="endAtText || '不限'" />
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<card-container
|
||||
title="产品权益"
|
||||
description="至少一项,配额最多三位小数"
|
||||
v-entrance-transition
|
||||
>
|
||||
<template #icon>
|
||||
<t-icon name="add" size="1.125rem" />
|
||||
</template>
|
||||
</t-button>
|
||||
<div class="summary">
|
||||
<span>产品权益预估价(原价)</span>
|
||||
<animated-amount
|
||||
class="red text-bold"
|
||||
prefix="¥"
|
||||
empty-text="未确定"
|
||||
:value="estimatedOriginalAmount"
|
||||
/>
|
||||
</div>
|
||||
<div class="items">
|
||||
<t-form
|
||||
class="item"
|
||||
v-for="(item, index) in form.itemList"
|
||||
:key="item.clientKey"
|
||||
label-width="6rem"
|
||||
>
|
||||
<div class="header">
|
||||
<span class="no" v-text="String(index + 1).padStart(2, '0')" />
|
||||
<strong v-text="getItemTitle(item)" />
|
||||
<t-button
|
||||
v-if="1 < form.itemList.length"
|
||||
theme="danger"
|
||||
variant="text"
|
||||
size="small"
|
||||
@click="removeItem(index)"
|
||||
>删除</t-button>
|
||||
</div>
|
||||
<product-select-form-item
|
||||
:model-value="item.skuId ? { skuId: item.skuId, skuUnitId: item.skuUnitId || '' } : undefined"
|
||||
:selected-product="getProduct(item)"
|
||||
label="产品"
|
||||
placeholder="请选择产品"
|
||||
required-mark
|
||||
@update:model-value="applyProduct(index, $event)"
|
||||
@select="applyProductSelection(index, $event)"
|
||||
/>
|
||||
<t-form-item label="默认配额" content-align="right" required-mark>
|
||||
<t-stepper
|
||||
v-model="item.defaultQuantity"
|
||||
size="large"
|
||||
:max="Number.MAX_SAFE_INTEGER"
|
||||
:min="getQuantityStep(item)"
|
||||
:step="getQuantityStep(item)"
|
||||
:integer="!getSku(item)?.allowDecimalQuantity"
|
||||
theme="outline"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-input v-model.trim="item.remark" borderless placeholder="选填" />
|
||||
</t-form-item>
|
||||
<div class="price">
|
||||
<span>预估价(原价)</span>
|
||||
<animated-amount
|
||||
class="red text-bold"
|
||||
prefix="¥"
|
||||
empty-text="未定价"
|
||||
:value="calculateOriginalAmount(item)"
|
||||
/>
|
||||
</div>
|
||||
</t-form>
|
||||
<t-button
|
||||
class="add"
|
||||
type="button"
|
||||
theme="light"
|
||||
variant="dashed"
|
||||
@click="addItem"
|
||||
content="添加产品权益"
|
||||
>
|
||||
<template #icon>
|
||||
<t-icon name="add" size="1.125rem" />
|
||||
</template>
|
||||
</t-button>
|
||||
<div class="summary">
|
||||
<span>产品权益预估价(原价)</span>
|
||||
<animated-amount
|
||||
class="red text-bold"
|
||||
prefix="¥"
|
||||
empty-text="未确定"
|
||||
:value="estimatedOriginalAmount"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</card-container>
|
||||
<t-popup v-model="statusPickerVisible" placement="bottom">
|
||||
<t-picker v-model="statusPickerDraft" :columns="statusOptions" title="状态" @cancel="statusPickerVisible = false" @confirm="confirmStatus" />
|
||||
</t-popup>
|
||||
<t-popup v-model="beginPickerVisible" placement="bottom">
|
||||
<t-date-time-picker v-model="beginDraft" format="YYYY-MM-DD HH:mm" :mode="['date', 'minute']" title="开始时间" @cancel="beginPickerVisible = false" @confirm="confirmBegin" />
|
||||
</t-popup>
|
||||
<t-popup v-model="endPickerVisible" placement="bottom">
|
||||
<t-date-time-picker v-model="endDraft" format="YYYY-MM-DD HH:mm" :mode="['date', 'minute']" title="结束时间" @cancel="endPickerVisible = false" @confirm="confirmEnd" />
|
||||
</t-popup>
|
||||
</div>
|
||||
</card-container>
|
||||
<t-popup v-model="statusPickerVisible" placement="bottom">
|
||||
<t-picker v-model="statusPickerDraft" :columns="statusOptions" title="状态" @cancel="statusPickerVisible = false" @confirm="confirmStatus" />
|
||||
</t-popup>
|
||||
<t-popup v-model="beginPickerVisible" placement="bottom">
|
||||
<t-date-time-picker v-model="beginDraft" format="YYYY-MM-DD HH:mm" :mode="['date', 'minute']" title="开始时间" @cancel="beginPickerVisible = false" @confirm="confirmBegin" />
|
||||
</t-popup>
|
||||
<t-popup v-model="endPickerVisible" placement="bottom">
|
||||
<t-date-time-picker v-model="endDraft" format="YYYY-MM-DD HH:mm" :mode="['date', 'minute']" title="结束时间" @cancel="endPickerVisible = false" @confirm="confirmEnd" />
|
||||
</t-popup>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -477,7 +481,7 @@ onMounted(async () => {
|
||||
.package-config-edit {
|
||||
gap: 1rem;
|
||||
display: flex;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 calc(1rem + env(safe-area-inset-bottom, 0));
|
||||
padding: 0 0 calc(1rem + env(safe-area-inset-bottom, 0));
|
||||
flex-direction: column;
|
||||
|
||||
.form {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main v-can="permissionCodes.packageConfig.read" class="page-content scroll list">
|
||||
<main v-can="permissionCodes.packageConfig.read" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main v-can="permissionCodes.packageConfig.read" class="page-content scroll list">
|
||||
<main v-can="permissionCodes.packageConfig.read" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh"
|
||||
v-model="refreshing"
|
||||
|
||||
@@ -1,329 +1,333 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(permissionCodes.customerPackage.create)"
|
||||
@click="submitRecord"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="提交"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="permissionCodes.customerPackage.create" class="package-purchase">
|
||||
<t-form class="form card" v-entrance-transition>
|
||||
<t-form-item label="客户" required-mark>
|
||||
<t-input
|
||||
:model-value="customerDisplayText"
|
||||
class="customer"
|
||||
readonly
|
||||
borderless
|
||||
placeholder="选择或扫码客户"
|
||||
@click="openSelectedCustomerList()"
|
||||
>
|
||||
<template #suffix-icon>
|
||||
<div class="actions">
|
||||
<t-button
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
@click.stop="selectorVisible = true"
|
||||
>选择</t-button>
|
||||
<t-button
|
||||
theme="primary"
|
||||
size="extra-small"
|
||||
@click.stop="toggleScanner"
|
||||
>
|
||||
<span v-text="scannerVisible ? '关闭扫码' : '扫码'" />
|
||||
</t-button>
|
||||
</div>
|
||||
</template>
|
||||
</t-input>
|
||||
</t-form-item>
|
||||
<div v-if="scannerVisible" class="code-scanner-wrapper">
|
||||
<code-scanner
|
||||
visible
|
||||
:status-text="scanStatus"
|
||||
active-text="正在识别客户编码,请将条码或二维码移入取景框。"
|
||||
@decode="handleDecodedText"
|
||||
@status-change="handleScanStatusChange"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(permissionCodes.customerPackage.create)"
|
||||
@click="submitRecord"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="提交"
|
||||
/>
|
||||
</div>
|
||||
<customer-profile-card
|
||||
v-if="selectedCustomer"
|
||||
class="customer-profile"
|
||||
:customer="selectedCustomer"
|
||||
v-entrance-transition
|
||||
/>
|
||||
<t-form-item
|
||||
v-if="isCustomerPackageCreate"
|
||||
label="套餐"
|
||||
required-mark
|
||||
content-align="right"
|
||||
arrow
|
||||
@click="configSelectorVisible = true"
|
||||
>选择套餐</t-form-item>
|
||||
<div v-if="config && !isSaleable" class="saleable-tip red">套餐当前不可购买,请检查套餐状态和有效期</div>
|
||||
<t-form-item v-if="config" label-width="0">
|
||||
<div class="config-summary">
|
||||
<div class="header">
|
||||
<div class="name text-bold clip-text" v-text="config.name || '未命名套餐'" />
|
||||
<div class="price">
|
||||
<span class="label gray">标准价:</span>
|
||||
<span class="value red text-bold" v-text="formatPackageAmount(config.standardAmount)" />
|
||||
</div>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.customerPackage.create" class="package-purchase">
|
||||
<t-form class="form card" v-entrance-transition>
|
||||
<t-form-item label="客户" required-mark>
|
||||
<t-input
|
||||
:model-value="customerDisplayText"
|
||||
class="customer"
|
||||
readonly
|
||||
borderless
|
||||
placeholder="选择或扫码客户"
|
||||
@click="openSelectedCustomerList()"
|
||||
>
|
||||
<template #suffix-icon>
|
||||
<div class="actions">
|
||||
<t-button
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
@click.stop="selectorVisible = true"
|
||||
>选择</t-button>
|
||||
<t-button
|
||||
theme="primary"
|
||||
size="extra-small"
|
||||
@click.stop="toggleScanner"
|
||||
>
|
||||
<span v-text="scannerVisible ? '关闭扫码' : '扫码'" />
|
||||
</t-button>
|
||||
</div>
|
||||
</template>
|
||||
</t-input>
|
||||
</t-form-item>
|
||||
<div v-if="scannerVisible" class="code-scanner-wrapper">
|
||||
<code-scanner
|
||||
visible
|
||||
:status-text="scanStatus"
|
||||
active-text="正在识别客户编码,请将条码或二维码移入取景框。"
|
||||
@decode="handleDecodedText"
|
||||
@status-change="handleScanStatusChange"
|
||||
/>
|
||||
</div>
|
||||
<div class="description" v-text="config.description" />
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item v-if="canPriceOverride" label="成交价" label-width="6rem" required-mark>
|
||||
<t-input
|
||||
v-model.trim="saleAmountText"
|
||||
type="number"
|
||||
align="right"
|
||||
borderless
|
||||
placeholder="请输入成交价"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item v-if="config" class="detail" label-width="0">
|
||||
<t-form class="items" label-width="0">
|
||||
<span v-if="!canPriceOverride">当前账号无定制权限,仅可等值转换单位</span>
|
||||
<customer-profile-card
|
||||
v-if="selectedCustomer"
|
||||
class="customer-profile"
|
||||
:customer="selectedCustomer"
|
||||
v-entrance-transition
|
||||
/>
|
||||
<t-form-item
|
||||
v-for="(item, index) in packagePurchaseItemList"
|
||||
:key="`${index}-${item.skuId}-${item.skuUnitId}-${item.gifted}`"
|
||||
class="item"
|
||||
>
|
||||
<div class="content">
|
||||
<div class="photo">
|
||||
<t-image
|
||||
v-if="getItemPhotoURL(item)"
|
||||
:src="getItemPhotoURL(item)"
|
||||
:alt="getItemName(item)"
|
||||
fit="cover"
|
||||
class="avatar"
|
||||
/>
|
||||
<div
|
||||
v-else
|
||||
class="avatar fallback"
|
||||
v-text="getItemName(item).slice(0, 1)"
|
||||
/>
|
||||
</div>
|
||||
<div class="main">
|
||||
<div class="title">
|
||||
<div class="heading">
|
||||
<div class="name-tags">
|
||||
<strong v-text="getItemName(item)" />
|
||||
<div v-if="hasItemSkuText(item)" class="sku-tags">
|
||||
<product-sku-tags
|
||||
:product-name="getItemName(item)"
|
||||
:fallback="getItemSkuFallback(item)"
|
||||
/>
|
||||
</div>
|
||||
<t-tag v-if="item.gifted" size="small" theme="success" content="赠" />
|
||||
</div>
|
||||
<t-button
|
||||
v-if="canRemoveItem(item)"
|
||||
class="remove"
|
||||
size="extra-small"
|
||||
theme="danger"
|
||||
variant="text"
|
||||
content="移除"
|
||||
@click="removePurchaseItem(index)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input">
|
||||
<div class="quantity">
|
||||
<t-stepper
|
||||
:model-value="getItemQuantity(item)"
|
||||
class="stepper"
|
||||
size="large"
|
||||
:max="Number.MAX_SAFE_INTEGER"
|
||||
:min="0"
|
||||
:step="getQuantityStep(item)"
|
||||
:integer="!getItemSku(item)?.allowDecimalQuantity"
|
||||
:disabled="!canEditItem(item)"
|
||||
theme="outline"
|
||||
@update:model-value="updateItemQuantity(index, $event)"
|
||||
/>
|
||||
<t-button
|
||||
class="unit"
|
||||
size="extra-small"
|
||||
variant="outline"
|
||||
:content="getItemUnit(item)?.name || '选择单位'"
|
||||
:disabled="!canEditItem(item)"
|
||||
@click.stop="openItemUnitPicker(index)"
|
||||
/>
|
||||
</div>
|
||||
<t-input
|
||||
v-if="item.gifted"
|
||||
class="gift-remark"
|
||||
:model-value="item.remark || ''"
|
||||
align="right"
|
||||
borderless
|
||||
placeholder="赠送说明(选填)"
|
||||
@update:model-value="updateItemRemark(index, $event)"
|
||||
/>
|
||||
v-if="isCustomerPackageCreate"
|
||||
label="套餐"
|
||||
required-mark
|
||||
content-align="right"
|
||||
arrow
|
||||
@click="configSelectorVisible = true"
|
||||
>选择套餐</t-form-item>
|
||||
<div v-if="config && !isSaleable" class="saleable-tip red">套餐当前不可购买,请检查套餐状态和有效期</div>
|
||||
<t-form-item v-if="config" label-width="0">
|
||||
<div class="config-summary">
|
||||
<div class="header">
|
||||
<div class="name text-bold clip-text" v-text="config.name || '未命名套餐'" />
|
||||
<div class="price">
|
||||
<span class="label gray">标准价:</span>
|
||||
<span class="value red text-bold" v-text="formatPackageAmount(config.standardAmount)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="description" v-text="config.description" />
|
||||
</div>
|
||||
</t-form-item>
|
||||
<product-select-form-item
|
||||
v-if="canGiftCreate"
|
||||
:model-value="undefined"
|
||||
label=""
|
||||
placeholder="添加可售赠送产品"
|
||||
@update:model-value="addGiftProduct"
|
||||
/>
|
||||
<center-tips v-if="!packagePurchaseItemList.length" :content="'当前套餐暂无权益明细'" />
|
||||
</t-form>
|
||||
</t-form-item>
|
||||
<t-form-item label="购买时间" content-align="right">
|
||||
<date-time-now-picker v-model="purchasedAtText" title="购买时间" :start="minimumDateTimeText" />
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
v-if="canReceiveImmediately"
|
||||
class="payment-item"
|
||||
:class="{ disabled: receiveFullPayment }"
|
||||
:label="receiveFullPayment ? '收款和核销金额' : '已部分收款和核销'"
|
||||
label-width="9rem"
|
||||
content-align="right"
|
||||
>
|
||||
<t-input
|
||||
:model-value="receiveFullPayment ? formatPackageAmount(parsedSaleAmount || 0) : paymentAmountText"
|
||||
type="number"
|
||||
align="right"
|
||||
borderless
|
||||
:disabled="receiveFullPayment"
|
||||
:placeholder="paymentAmountPlaceholder"
|
||||
@update:model-value="paymentAmountText = String($event)"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item v-if="canReceiveImmediately" label="已全额收款和核销" content-align="right">
|
||||
<t-switch
|
||||
v-model="receiveFullPayment"
|
||||
size="small"
|
||||
:disabled="!canReceiveImmediately"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item v-if="canFulfillImmediately" label="已全部产品履约和核销" content-align="right">
|
||||
<t-switch
|
||||
v-model="fulfillAll"
|
||||
size="small"
|
||||
:disabled="!canFulfillImmediately || isStockChecking"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item v-if="canFulfillImmediately" label-width="0">
|
||||
<div class="stock-tips">
|
||||
<div class="tips red">全部履约会同步启用全额收款;请先准备充足的库存,任意一步失败都会下单失败。</div>
|
||||
<product-stock-preview v-if="stockPreviewList.length" :items="stockPreviewList" />
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item v-if="(paymentVerified && parsedPaymentAmount) || (receiveFullPayment && parsedSaleAmount)" label-width="0">
|
||||
<attachment-selector
|
||||
v-model:items="paymentPhotoItems"
|
||||
:upload="uploadPhotoList"
|
||||
title="收款凭证照片(必要)"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item v-if="fulfillAll" label-width="0">
|
||||
<attachment-selector
|
||||
v-model:items="fulfillmentPhotoItems"
|
||||
:upload="uploadPhotoList"
|
||||
title="履约凭证照片(必要)"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="购买备注">
|
||||
<t-textarea
|
||||
v-model.trim="note"
|
||||
class="textarea"
|
||||
:autosize="{ minRows: 3, maxRows: 5 }"
|
||||
placeholder="购买说明"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<attachment-selector
|
||||
v-model:items="photoItems"
|
||||
:upload="uploadPhotoList"
|
||||
title="订单照片"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<customer-selector
|
||||
v-model="selectedCustomerId"
|
||||
v-model:visible="selectorVisible"
|
||||
selection-mode="single"
|
||||
:enable-scan="false"
|
||||
@change="handleCustomerChange"
|
||||
/>
|
||||
<bottom-popup
|
||||
v-model="configSelectorVisible"
|
||||
title="选择套餐"
|
||||
height="70vh"
|
||||
right-button-text=""
|
||||
@left-button-click="configSelectorVisible = false"
|
||||
>
|
||||
<div class="config-selector fix-cell-title-clip empty-cell-title-margin">
|
||||
<t-cell-group v-if="configList.length">
|
||||
<t-cell
|
||||
v-for="item in configList"
|
||||
:key="item.id"
|
||||
class="config-option"
|
||||
arrow
|
||||
@click="selectConfig(item)"
|
||||
>
|
||||
<template #title>
|
||||
<div class="title">
|
||||
<div class="clip-text" v-text="item.name || '未命名套餐'" />
|
||||
<div class="price keep-text">
|
||||
<span class="label gray">标准价:</span>
|
||||
<span class="red" v-text="formatPackageAmount(item.standardAmount)" />
|
||||
<t-form-item v-if="canPriceOverride" label="成交价" label-width="6rem" required-mark>
|
||||
<t-input
|
||||
v-model.trim="saleAmountText"
|
||||
type="number"
|
||||
align="right"
|
||||
borderless
|
||||
placeholder="请输入成交价"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item v-if="config" class="detail" label-width="0">
|
||||
<t-form class="items" label-width="0">
|
||||
<span v-if="!canPriceOverride">当前账号无定制权限,仅可等值转换单位</span>
|
||||
<t-form-item
|
||||
v-for="(item, index) in packagePurchaseItemList"
|
||||
:key="`${index}-${item.skuId}-${item.skuUnitId}-${item.gifted}`"
|
||||
class="item"
|
||||
>
|
||||
<div class="content">
|
||||
<div class="photo">
|
||||
<t-image
|
||||
v-if="getItemPhotoURL(item)"
|
||||
:src="getItemPhotoURL(item)"
|
||||
:alt="getItemName(item)"
|
||||
fit="cover"
|
||||
class="avatar"
|
||||
/>
|
||||
<div
|
||||
v-else
|
||||
class="avatar fallback"
|
||||
v-text="getItemName(item).slice(0, 1)"
|
||||
/>
|
||||
</div>
|
||||
<div class="main">
|
||||
<div class="title">
|
||||
<div class="heading">
|
||||
<div class="name-tags">
|
||||
<strong v-text="getItemName(item)" />
|
||||
<div v-if="hasItemSkuText(item)" class="sku-tags">
|
||||
<product-sku-tags
|
||||
:product-name="getItemName(item)"
|
||||
:fallback="getItemSkuFallback(item)"
|
||||
/>
|
||||
</div>
|
||||
<t-tag v-if="item.gifted" size="small" theme="success" content="赠" />
|
||||
</div>
|
||||
<t-button
|
||||
v-if="canRemoveItem(item)"
|
||||
class="remove"
|
||||
size="extra-small"
|
||||
theme="danger"
|
||||
variant="text"
|
||||
content="移除"
|
||||
@click="removePurchaseItem(index)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input">
|
||||
<div class="quantity">
|
||||
<t-stepper
|
||||
:model-value="getItemQuantity(item)"
|
||||
class="stepper"
|
||||
size="large"
|
||||
:max="Number.MAX_SAFE_INTEGER"
|
||||
:min="0"
|
||||
:step="getQuantityStep(item)"
|
||||
:integer="!getItemSku(item)?.allowDecimalQuantity"
|
||||
:disabled="!canEditItem(item)"
|
||||
theme="outline"
|
||||
@update:model-value="updateItemQuantity(index, $event)"
|
||||
/>
|
||||
<t-button
|
||||
class="unit"
|
||||
size="extra-small"
|
||||
variant="outline"
|
||||
:content="getItemUnit(item)?.name || '选择单位'"
|
||||
:disabled="!canEditItem(item)"
|
||||
@click.stop="openItemUnitPicker(index)"
|
||||
/>
|
||||
</div>
|
||||
<t-input
|
||||
v-if="item.gifted"
|
||||
class="gift-remark"
|
||||
:model-value="item.remark || ''"
|
||||
align="right"
|
||||
borderless
|
||||
placeholder="赠送说明(选填)"
|
||||
@update:model-value="updateItemRemark(index, $event)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #description>
|
||||
<div class="products">
|
||||
<t-tag
|
||||
v-for="productItem in item.itemList || []"
|
||||
:key="productItem.id || `${productItem.skuId}-${productItem.skuUnitId}`"
|
||||
:content="getConfigProductText(productItem)"
|
||||
theme="primary"
|
||||
variant="light"
|
||||
/>
|
||||
<t-tag v-if="!item.itemList?.length" content="暂无产品权益" />
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<center-tips v-else :content="'暂无可购买套餐'" />
|
||||
</div>
|
||||
</bottom-popup>
|
||||
<t-popup v-model="unitPickerVisible" placement="bottom">
|
||||
<t-picker v-model="unitPickerDraft" :columns="unitPickerOptions" title="调整权益单位" @cancel="unitPickerVisible = false" @confirm="confirmItemUnitPicker" />
|
||||
</t-popup>
|
||||
<t-popup v-model="selectedCustomerListVisible" placement="bottom">
|
||||
<div class="selected-customer-popup bg-white">
|
||||
<div class="popup-header">
|
||||
<t-button variant="text" size="small" @click="selectedCustomerListVisible = false">关闭</t-button>
|
||||
<h3>已选客户</h3>
|
||||
<t-button theme="primary" variant="text" size="small" @click="openCustomerSelector">选择</t-button>
|
||||
</div>
|
||||
<customer-list
|
||||
class="list"
|
||||
:customer-list="selectedCustomerList"
|
||||
removable
|
||||
empty-text="暂未选择客户"
|
||||
@remove="removeSelectedCustomer"
|
||||
</t-form-item>
|
||||
<product-select-form-item
|
||||
v-if="canGiftCreate"
|
||||
:model-value="undefined"
|
||||
label=""
|
||||
placeholder="添加可售赠送产品"
|
||||
@update:model-value="addGiftProduct"
|
||||
/>
|
||||
<center-tips v-if="!packagePurchaseItemList.length" :content="'当前套餐暂无权益明细'" />
|
||||
</t-form>
|
||||
</t-form-item>
|
||||
<t-form-item label="购买时间" content-align="right">
|
||||
<date-time-now-picker v-model="purchasedAtText" title="购买时间" :start="minimumDateTimeText" />
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
v-if="canReceiveImmediately"
|
||||
class="payment-item"
|
||||
:class="{ disabled: receiveFullPayment }"
|
||||
:label="receiveFullPayment ? '收款和核销金额' : '已部分收款和核销'"
|
||||
label-width="9rem"
|
||||
content-align="right"
|
||||
>
|
||||
<t-input
|
||||
:model-value="receiveFullPayment ? formatPackageAmount(parsedSaleAmount || 0) : paymentAmountText"
|
||||
type="number"
|
||||
align="right"
|
||||
borderless
|
||||
:disabled="receiveFullPayment"
|
||||
:placeholder="paymentAmountPlaceholder"
|
||||
@update:model-value="paymentAmountText = String($event)"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item v-if="canReceiveImmediately" label="已全额收款和核销" content-align="right">
|
||||
<t-switch
|
||||
v-model="receiveFullPayment"
|
||||
size="small"
|
||||
:disabled="!canReceiveImmediately"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item v-if="canFulfillImmediately" label="已全部产品履约和核销" content-align="right">
|
||||
<t-switch
|
||||
v-model="fulfillAll"
|
||||
size="small"
|
||||
:disabled="!canFulfillImmediately || isStockChecking"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item v-if="canFulfillImmediately" label-width="0">
|
||||
<div class="stock-tips">
|
||||
<div class="tips red">全部履约会同步启用全额收款;请先准备充足的库存,任意一步失败都会下单失败。</div>
|
||||
<product-stock-preview v-if="stockPreviewList.length" :items="stockPreviewList" />
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item v-if="(paymentVerified && parsedPaymentAmount) || (receiveFullPayment && parsedSaleAmount)" label-width="0">
|
||||
<attachment-selector
|
||||
v-model:items="paymentPhotoItems"
|
||||
:upload="uploadPhotoList"
|
||||
title="收款凭证照片(必要)"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item v-if="fulfillAll" label-width="0">
|
||||
<attachment-selector
|
||||
v-model:items="fulfillmentPhotoItems"
|
||||
:upload="uploadPhotoList"
|
||||
title="履约凭证照片(必要)"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="购买备注">
|
||||
<t-textarea
|
||||
v-model.trim="note"
|
||||
class="textarea"
|
||||
:autosize="{ minRows: 3, maxRows: 5 }"
|
||||
placeholder="购买说明"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<attachment-selector
|
||||
v-model:items="photoItems"
|
||||
:upload="uploadPhotoList"
|
||||
title="订单照片"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<customer-selector
|
||||
v-model="selectedCustomerId"
|
||||
v-model:visible="selectorVisible"
|
||||
selection-mode="single"
|
||||
:enable-scan="false"
|
||||
@change="handleCustomerChange"
|
||||
/>
|
||||
<bottom-popup
|
||||
v-model="configSelectorVisible"
|
||||
title="选择套餐"
|
||||
height="70vh"
|
||||
right-button-text=""
|
||||
@left-button-click="configSelectorVisible = false"
|
||||
>
|
||||
<div class="config-selector fix-cell-title-clip empty-cell-title-margin">
|
||||
<t-cell-group v-if="configList.length">
|
||||
<t-cell
|
||||
v-for="item in configList"
|
||||
:key="item.id"
|
||||
class="config-option"
|
||||
arrow
|
||||
@click="selectConfig(item)"
|
||||
>
|
||||
<template #title>
|
||||
<div class="title">
|
||||
<div class="clip-text" v-text="item.name || '未命名套餐'" />
|
||||
<div class="price keep-text">
|
||||
<span class="label gray">标准价:</span>
|
||||
<span class="red" v-text="formatPackageAmount(item.standardAmount)" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #description>
|
||||
<div class="products">
|
||||
<t-tag
|
||||
v-for="productItem in item.itemList || []"
|
||||
:key="productItem.id || `${productItem.skuId}-${productItem.skuUnitId}`"
|
||||
:content="getConfigProductText(productItem)"
|
||||
theme="primary"
|
||||
variant="light"
|
||||
/>
|
||||
<t-tag v-if="!item.itemList?.length" content="暂无产品权益" />
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<center-tips v-else :content="'暂无可购买套餐'" />
|
||||
</div>
|
||||
</bottom-popup>
|
||||
<t-popup v-model="unitPickerVisible" placement="bottom">
|
||||
<t-picker v-model="unitPickerDraft" :columns="unitPickerOptions" title="调整权益单位" @cancel="unitPickerVisible = false" @confirm="confirmItemUnitPicker" />
|
||||
</t-popup>
|
||||
<t-popup v-model="selectedCustomerListVisible" placement="bottom">
|
||||
<div class="selected-customer-popup bg-white">
|
||||
<div class="popup-header">
|
||||
<t-button variant="text" size="small" @click="selectedCustomerListVisible = false">关闭</t-button>
|
||||
<h3>已选客户</h3>
|
||||
<t-button theme="primary" variant="text" size="small" @click="openCustomerSelector">选择</t-button>
|
||||
</div>
|
||||
<customer-list
|
||||
class="list"
|
||||
:customer-list="selectedCustomerList"
|
||||
removable
|
||||
empty-text="暂未选择客户"
|
||||
@remove="removeSelectedCustomer"
|
||||
/>
|
||||
</div>
|
||||
</t-popup>
|
||||
</div>
|
||||
</t-popup>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -966,7 +970,7 @@ watch(config, value => {
|
||||
.package-purchase {
|
||||
gap: 1rem;
|
||||
display: flex;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 1rem 0;
|
||||
padding: 0 0 1rem 0;
|
||||
flex-direction: column;
|
||||
|
||||
.form {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main v-can="{ value: [corePermissionCodes.role.read, corePermissionCodes.permission.read], mode: 'and' }" class="page-content scroll list">
|
||||
<main v-can="{ value: [corePermissionCodes.role.read, corePermissionCodes.permission.read], mode: 'and' }" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="list-wrapper pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -1,87 +1,91 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="权限设置"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div
|
||||
v-can="{ value: [corePermissionCodes.role.read, corePermissionCodes.permission.read], mode: 'and' }"
|
||||
class="permission-settings"
|
||||
>
|
||||
<t-cell-group v-entrance-transition title="权限配置" theme="card">
|
||||
<t-cell
|
||||
v-can="corePermissionCodes.role.read"
|
||||
title="角色管理"
|
||||
:note="`${roleCount} 个角色`"
|
||||
arrow
|
||||
@click="router.push('/management/permissions/roles')"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="权限设置"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main class="page-content scroll column">
|
||||
<div
|
||||
v-can="{ value: [corePermissionCodes.role.read, corePermissionCodes.permission.read], mode: 'and' }"
|
||||
class="permission-settings"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-icon name="user-setting" size="1.75rem" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell
|
||||
v-can="corePermissionCodes.permission.read"
|
||||
title="权限管理"
|
||||
:note="`${permissionCount} 个权限`"
|
||||
arrow
|
||||
@click="router.push('/management/permissions/items')"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-icon name="secured" size="1.75rem" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell
|
||||
v-can="rolePermissionAssignAccess"
|
||||
title="角色直接授权 P"
|
||||
arrow
|
||||
@click="router.push('/management/permissions/assign/p')"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-icon name="secured" size="1.75rem" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell
|
||||
v-can="rolePermissionAssignAccess"
|
||||
title="角色转授权限 D"
|
||||
arrow
|
||||
@click="router.push('/management/permissions/assign/d')"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-icon name="user-checked" size="1.75rem" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell
|
||||
v-can="corePermissionCodes.userRole.read"
|
||||
title="用户角色授权"
|
||||
arrow
|
||||
@click="router.push('/management/permissions/user-roles')"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-icon name="usergroup" size="1.75rem" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-entrance-transition title="当前角色结构" theme="card">
|
||||
<t-cell
|
||||
v-can="{ value: [corePermissionCodes.role.read, corePermissionCodes.permission.read], mode: 'and' }"
|
||||
v-for="item in visibleRoleTree"
|
||||
:key="item.id"
|
||||
:arrow="canAssignRole(item)"
|
||||
:hover="canAssignRole(item)"
|
||||
v-entrance-transition="{ step: 30 }"
|
||||
@click="canAssignRole(item) && toAssign(item.id)"
|
||||
>
|
||||
<template #title>
|
||||
<div class="title" :style="{ paddingLeft: `${item.level * 1.25}rem` }">
|
||||
<span v-text="item.name" />
|
||||
<span class="scope" v-text="getRoleScopeLabel(item)" />
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-entrance-transition title="权限配置" theme="card">
|
||||
<t-cell
|
||||
v-can="corePermissionCodes.role.read"
|
||||
title="角色管理"
|
||||
:note="`${roleCount} 个角色`"
|
||||
arrow
|
||||
@click="router.push('/management/permissions/roles')"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-icon name="user-setting" size="1.75rem" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell
|
||||
v-can="corePermissionCodes.permission.read"
|
||||
title="权限管理"
|
||||
:note="`${permissionCount} 个权限`"
|
||||
arrow
|
||||
@click="router.push('/management/permissions/items')"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-icon name="secured" size="1.75rem" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell
|
||||
v-can="rolePermissionAssignAccess"
|
||||
title="角色直接授权 P"
|
||||
arrow
|
||||
@click="router.push('/management/permissions/assign/p')"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-icon name="secured" size="1.75rem" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell
|
||||
v-can="rolePermissionAssignAccess"
|
||||
title="角色转授权限 D"
|
||||
arrow
|
||||
@click="router.push('/management/permissions/assign/d')"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-icon name="user-checked" size="1.75rem" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell
|
||||
v-can="corePermissionCodes.userRole.read"
|
||||
title="用户角色授权"
|
||||
arrow
|
||||
@click="router.push('/management/permissions/user-roles')"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-icon name="usergroup" size="1.75rem" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-entrance-transition title="当前角色结构" theme="card">
|
||||
<t-cell
|
||||
v-can="{ value: [corePermissionCodes.role.read, corePermissionCodes.permission.read], mode: 'and' }"
|
||||
v-for="item in visibleRoleTree"
|
||||
:key="item.id"
|
||||
:arrow="canAssignRole(item)"
|
||||
:hover="canAssignRole(item)"
|
||||
v-entrance-transition="{ step: 30 }"
|
||||
@click="canAssignRole(item) && toAssign(item.id)"
|
||||
>
|
||||
<template #title>
|
||||
<div class="title" :style="{ paddingLeft: `${item.level * 1.25}rem` }">
|
||||
<span v-text="item.name" />
|
||||
<span class="scope" v-text="getRoleScopeLabel(item)" />
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -167,7 +171,7 @@ onMounted(async () => {
|
||||
<style scoped lang="less">
|
||||
.permission-settings {
|
||||
gap: 1rem;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 1rem 0;
|
||||
padding: 0 0 1rem 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
+118
-114
@@ -1,119 +1,123 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="hasSavePermission"
|
||||
:disabled="!canSaveBaseInfo"
|
||||
@click="saveBaseInfo"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="保存"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="pageAccess" class="role-edit">
|
||||
<t-form v-entrance-transition class="form card">
|
||||
<t-form-item label="名称">
|
||||
<t-input v-model.trim="formModel.name" placeholder="角色名称" borderless :disabled="!canEditRoleInfo" />
|
||||
</t-form-item>
|
||||
<t-form-item label="代码" :help="isBuiltinRole ? '内建角色代码不可修改' : ''">
|
||||
<t-input v-model.trim="formModel.code" placeholder="如 ROLE_CODE" borderless :disabled="!canEditRoleCode" />
|
||||
</t-form-item>
|
||||
<t-form-item label="模块">
|
||||
<t-input v-model.trim="formModel.moduleCode" placeholder="模块代码" borderless disabled />
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="上级"
|
||||
:arrow="canEditParentRole"
|
||||
@click.stop="openParentRolePicker"
|
||||
>
|
||||
<div class="picker-text" v-text="selectedParentRoleName" />
|
||||
</t-form-item>
|
||||
<t-form-item label="说明">
|
||||
<t-textarea v-model.trim="formModel.description" class="textarea" placeholder="角色说明" autosize borderless :disabled="!canEditRoleInfo" />
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="继承角色"
|
||||
:arrow="canEditRoleRelation"
|
||||
@click.stop="openChildRolePicker"
|
||||
>
|
||||
<div class="picker-text" v-text="selectedChildRoleName" />
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-cell-group v-entrance-transition v-if="!isCreateMode && canManageRole" title="权限授权" theme="card">
|
||||
<t-cell
|
||||
v-can="rolePermissionReadAccess"
|
||||
title="直接授权权限 P"
|
||||
arrow
|
||||
@click="toRolePermissionPage"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-icon name="secured" size="1.5rem" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell
|
||||
v-can="rolePermissionReadAccess"
|
||||
title="可转授权限 D"
|
||||
arrow
|
||||
@click="toRoleDelegationPage"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-icon name="user-checked" size="1.5rem" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<card-container v-entrance-transition v-if="aggregatePermissionList.length" title="聚合权限 P">
|
||||
<template #description>
|
||||
<div>该角色拥有以下权限,可执行权限对应的功能,这些权限来自上级角色直接授权或子角色继承。</div>
|
||||
<permission-legend />
|
||||
</template>
|
||||
<t-cell-group class="permission-list" theme="card">
|
||||
<permission-cell
|
||||
v-for="item in aggregatePermissionList"
|
||||
:key="item.id"
|
||||
:permission="item"
|
||||
:source="item.source"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="hasSavePermission"
|
||||
:disabled="!canSaveBaseInfo"
|
||||
@click="saveBaseInfo"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="保存"
|
||||
/>
|
||||
</t-cell-group>
|
||||
</card-container>
|
||||
</div>
|
||||
<t-popup v-model="parentRolePickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="parentRolePickerDraft"
|
||||
:columns="parentRolePickerColumns"
|
||||
title="选择上级"
|
||||
@cancel="cancelParentRolePicker"
|
||||
@confirm="confirmParentRolePicker"
|
||||
/>
|
||||
</t-popup>
|
||||
<bottom-popup
|
||||
v-model="childRolePickerVisible"
|
||||
title="继承角色"
|
||||
left-button-text="取消"
|
||||
right-button-text="保存"
|
||||
@leftButtonClick="cancelChildRolePicker"
|
||||
@rightButtonClick="saveRoleInherit"
|
||||
>
|
||||
<t-checkbox-group v-if="childOptions.length" v-model="childRolePickerDraft" class="role-options">
|
||||
<t-checkbox
|
||||
v-for="item in childOptions"
|
||||
:key="item.id"
|
||||
class="item"
|
||||
:value="item.id"
|
||||
:label="item.name || item.code"
|
||||
icon="line"
|
||||
borderless
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="pageAccess" class="role-edit">
|
||||
<t-form v-entrance-transition class="form card">
|
||||
<t-form-item label="名称">
|
||||
<t-input v-model.trim="formModel.name" placeholder="角色名称" borderless :disabled="!canEditRoleInfo" />
|
||||
</t-form-item>
|
||||
<t-form-item label="代码" :help="isBuiltinRole ? '内建角色代码不可修改' : ''">
|
||||
<t-input v-model.trim="formModel.code" placeholder="如 ROLE_CODE" borderless :disabled="!canEditRoleCode" />
|
||||
</t-form-item>
|
||||
<t-form-item label="模块">
|
||||
<t-input v-model.trim="formModel.moduleCode" placeholder="模块代码" borderless disabled />
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="上级"
|
||||
:arrow="canEditParentRole"
|
||||
@click.stop="openParentRolePicker"
|
||||
>
|
||||
<div class="picker-text" v-text="selectedParentRoleName" />
|
||||
</t-form-item>
|
||||
<t-form-item label="说明">
|
||||
<t-textarea v-model.trim="formModel.description" class="textarea" placeholder="角色说明" autosize borderless :disabled="!canEditRoleInfo" />
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="继承角色"
|
||||
:arrow="canEditRoleRelation"
|
||||
@click.stop="openChildRolePicker"
|
||||
>
|
||||
<div class="picker-text" v-text="selectedChildRoleName" />
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-cell-group v-entrance-transition v-if="!isCreateMode && canManageRole" title="权限授权" theme="card">
|
||||
<t-cell
|
||||
v-can="rolePermissionReadAccess"
|
||||
title="直接授权权限 P"
|
||||
arrow
|
||||
@click="toRolePermissionPage"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-icon name="secured" size="1.5rem" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell
|
||||
v-can="rolePermissionReadAccess"
|
||||
title="可转授权限 D"
|
||||
arrow
|
||||
@click="toRoleDelegationPage"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-icon name="user-checked" size="1.5rem" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<card-container v-entrance-transition v-if="aggregatePermissionList.length" title="聚合权限 P">
|
||||
<template #description>
|
||||
<div>该角色拥有以下权限,可执行权限对应的功能,这些权限来自上级角色直接授权或子角色继承。</div>
|
||||
<permission-legend />
|
||||
</template>
|
||||
<t-cell-group class="permission-list" theme="card">
|
||||
<permission-cell
|
||||
v-for="item in aggregatePermissionList"
|
||||
:key="item.id"
|
||||
:permission="item"
|
||||
:source="item.source"
|
||||
/>
|
||||
</t-cell-group>
|
||||
</card-container>
|
||||
</div>
|
||||
</main>
|
||||
<t-popup v-model="parentRolePickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="parentRolePickerDraft"
|
||||
:columns="parentRolePickerColumns"
|
||||
title="选择上级"
|
||||
@cancel="cancelParentRolePicker"
|
||||
@confirm="confirmParentRolePicker"
|
||||
/>
|
||||
</t-checkbox-group>
|
||||
<t-empty v-else description="暂无可继承角色" />
|
||||
</bottom-popup>
|
||||
</t-popup>
|
||||
<bottom-popup
|
||||
v-model="childRolePickerVisible"
|
||||
title="继承角色"
|
||||
left-button-text="取消"
|
||||
right-button-text="保存"
|
||||
@leftButtonClick="cancelChildRolePicker"
|
||||
@rightButtonClick="saveRoleInherit"
|
||||
>
|
||||
<t-checkbox-group v-if="childOptions.length" v-model="childRolePickerDraft" class="role-options">
|
||||
<t-checkbox
|
||||
v-for="item in childOptions"
|
||||
:key="item.id"
|
||||
class="item"
|
||||
:value="item.id"
|
||||
:label="item.name || item.code"
|
||||
icon="line"
|
||||
borderless
|
||||
/>
|
||||
</t-checkbox-group>
|
||||
<t-empty v-else description="暂无可继承角色" />
|
||||
</bottom-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -504,7 +508,7 @@ onMounted(async () => {
|
||||
.role-edit {
|
||||
gap: 1rem;
|
||||
display: flex;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 2rem 0;
|
||||
padding: 0 0 2rem 0;
|
||||
flex-direction: column;
|
||||
|
||||
.form {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main v-can="{ value: [corePermissionCodes.role.read, corePermissionCodes.permission.read], mode: 'and' }" class="page-content scroll list">
|
||||
<main v-can="{ value: [corePermissionCodes.role.read, corePermissionCodes.permission.read], mode: 'and' }" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="list-wrapper pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -1,51 +1,55 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="积分账户详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div v-can="permissionCodes.point.accountRead" class="point-account-detail">
|
||||
<card-container v-if="customer" v-entrance-transition>
|
||||
<customer-profile-card :customer="customer" />
|
||||
</card-container>
|
||||
<section v-if="account" class="account-card" v-entrance-transition>
|
||||
<div class="header">
|
||||
<div>积分卡</div>
|
||||
<div class="time dark-white" v-text="formatTimestamp(account.createdAt!)" />
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="积分账户详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.point.accountRead" class="point-account-detail">
|
||||
<card-container v-if="customer" v-entrance-transition>
|
||||
<customer-profile-card :customer="customer" />
|
||||
</card-container>
|
||||
<section v-if="account" class="account-card" v-entrance-transition>
|
||||
<div class="header">
|
||||
<div>积分卡</div>
|
||||
<div class="time dark-white" v-text="formatTimestamp(account.createdAt!)" />
|
||||
</div>
|
||||
<div class="balance">
|
||||
<t-icon name="money" size="2rem" />
|
||||
<div class="value" v-text="balanceText" />
|
||||
</div>
|
||||
<div class="id" v-text="account.id?.toUpperCase()" />
|
||||
</section>
|
||||
<t-cell-group v-if="account" title="积分统计" theme="card" v-entrance-transition>
|
||||
<t-cell title="累计获得" :note="formatPoints(account.totalEarned)" />
|
||||
<t-cell title="累计消耗" :note="formatPoints(account.totalConsumed)" />
|
||||
<t-cell title="累计撤销" :note="formatPoints(account.totalRevoked)" />
|
||||
<t-cell title="人工调整" :note="formatSignedPoints(account.totalAdjusted)" />
|
||||
</t-cell-group>
|
||||
<section v-if="customer" class="actions" v-entrance-transition>
|
||||
<t-button
|
||||
v-can="permissionCodes.point.ledgerRead"
|
||||
class="bg-white"
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
@click="toLedger"
|
||||
>
|
||||
查看积分流水
|
||||
</t-button>
|
||||
<t-button
|
||||
v-can="permissionCodes.point.adjust"
|
||||
theme="primary"
|
||||
@click="toAdjust"
|
||||
>
|
||||
人工调整积分
|
||||
</t-button>
|
||||
</section>
|
||||
<t-empty v-if="!account" :description="isLoading ? '正在加载积分账户' : '积分账户不存在或已被删除'" />
|
||||
</div>
|
||||
<div class="balance">
|
||||
<t-icon name="money" size="2rem" />
|
||||
<div class="value" v-text="balanceText" />
|
||||
</div>
|
||||
<div class="id" v-text="account.id?.toUpperCase()" />
|
||||
</section>
|
||||
<t-cell-group v-if="account" title="积分统计" theme="card" v-entrance-transition>
|
||||
<t-cell title="累计获得" :note="formatPoints(account.totalEarned)" />
|
||||
<t-cell title="累计消耗" :note="formatPoints(account.totalConsumed)" />
|
||||
<t-cell title="累计撤销" :note="formatPoints(account.totalRevoked)" />
|
||||
<t-cell title="人工调整" :note="formatSignedPoints(account.totalAdjusted)" />
|
||||
</t-cell-group>
|
||||
<section v-if="customer" class="actions" v-entrance-transition>
|
||||
<t-button
|
||||
v-can="permissionCodes.point.ledgerRead"
|
||||
class="bg-white"
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
@click="toLedger"
|
||||
>
|
||||
查看积分流水
|
||||
</t-button>
|
||||
<t-button
|
||||
v-can="permissionCodes.point.adjust"
|
||||
theme="primary"
|
||||
@click="toAdjust"
|
||||
>
|
||||
人工调整积分
|
||||
</t-button>
|
||||
</section>
|
||||
<t-empty v-if="!account" :description="isLoading ? '正在加载积分账户' : '积分账户不存在或已被删除'" />
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -190,7 +194,7 @@ onMounted(async () => {
|
||||
.point-account-detail {
|
||||
gap: 1rem;
|
||||
display: flex;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 1rem;
|
||||
padding: 0 0 1rem;
|
||||
flex-direction: column;
|
||||
|
||||
.account-card {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main v-can="permissionCodes.point.accountRead" class="page-content scroll list">
|
||||
<main v-can="permissionCodes.point.accountRead" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -1,87 +1,91 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="积分流水详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div v-if="customer" v-can="permissionCodes.point.ledgerRead" class="point-ledger-detail">
|
||||
<customer-profile-card
|
||||
class="customer-profile"
|
||||
:customer="customer"
|
||||
v-entrance-transition
|
||||
@click="toCustomerDetail"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="积分流水详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<t-cell-group
|
||||
v-if="ledger?.accountId && canReadPointAccount"
|
||||
theme="card"
|
||||
v-entrance-transition
|
||||
>
|
||||
<t-cell title="积分账户" arrow @click="toPointAccount" />
|
||||
</t-cell-group>
|
||||
<template v-if="ledger">
|
||||
<t-cell-group title="积分流水" theme="card" v-entrance-transition>
|
||||
<t-cell title="流水类型">
|
||||
<template #note>
|
||||
<t-tag
|
||||
:theme="getDeltaTheme(ledger.pointDelta)"
|
||||
:content="getChangeTypeText(ledger.changeType)"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="积分变化" :note="getPointDeltaText(ledger.pointDelta)" />
|
||||
<t-cell title="变化前余额" :note="getPointText(ledger.balanceBefore)" />
|
||||
<t-cell title="变化后余额" :note="getPointText(ledger.balanceAfter)" />
|
||||
<t-cell title="发生时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="ledger.occurredAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="流水备注" :note="Text.display(ledger.remark)" />
|
||||
</t-cell-group>
|
||||
<t-cell-group title="触发事件" theme="card" v-entrance-transition>
|
||||
<template v-if="triggerEvent">
|
||||
<t-cell title="事件名称" :note="triggerEvent.name || '未命名事件'" />
|
||||
<t-cell title="事件类型" :note="getEventValueTypeText(triggerEvent)" />
|
||||
<t-cell title="事件说明" :note="Text.display(triggerEvent.description)" />
|
||||
<t-cell title="查看事件详情" :arrow="canReadEvent" :hover="canReadEvent" @click="toEventDetail" />
|
||||
</template>
|
||||
<center-tips v-else :content="getEventEmptyText()" />
|
||||
</t-cell-group>
|
||||
<t-cell-group title="事件记录" theme="card" v-entrance-transition>
|
||||
<template v-if="eventRecord">
|
||||
<t-cell title="登记事件" :note="eventRecord.event?.name || triggerEvent?.name || '未知事件'" />
|
||||
<t-cell title="登记时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="eventRecord.registeredAt" underline />
|
||||
<main class="page-content scroll column">
|
||||
<div v-if="customer" v-can="permissionCodes.point.ledgerRead" class="point-ledger-detail">
|
||||
<customer-profile-card
|
||||
class="customer-profile"
|
||||
:customer="customer"
|
||||
v-entrance-transition
|
||||
@click="toCustomerDetail"
|
||||
/>
|
||||
<t-cell-group
|
||||
v-if="ledger?.accountId && canReadPointAccount"
|
||||
theme="card"
|
||||
v-entrance-transition
|
||||
>
|
||||
<t-cell title="积分账户" arrow @click="toPointAccount" />
|
||||
</t-cell-group>
|
||||
<template v-if="ledger">
|
||||
<t-cell-group title="积分流水" theme="card" v-entrance-transition>
|
||||
<t-cell title="流水类型">
|
||||
<template #note>
|
||||
<t-tag
|
||||
:theme="getDeltaTheme(ledger.pointDelta)"
|
||||
:content="getChangeTypeText(ledger.changeType)"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="积分变化" :note="getPointDeltaText(ledger.pointDelta)" />
|
||||
<t-cell title="变化前余额" :note="getPointText(ledger.balanceBefore)" />
|
||||
<t-cell title="变化后余额" :note="getPointText(ledger.balanceAfter)" />
|
||||
<t-cell title="发生时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="ledger.occurredAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="流水备注" :note="Text.display(ledger.remark)" />
|
||||
</t-cell-group>
|
||||
<t-cell-group title="触发事件" theme="card" v-entrance-transition>
|
||||
<template v-if="triggerEvent">
|
||||
<t-cell title="事件名称" :note="triggerEvent.name || '未命名事件'" />
|
||||
<t-cell title="事件类型" :note="getEventValueTypeText(triggerEvent)" />
|
||||
<t-cell title="事件说明" :note="Text.display(triggerEvent.description)" />
|
||||
<t-cell title="查看事件详情" :arrow="canReadEvent" :hover="canReadEvent" @click="toEventDetail" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell v-if="hasEventNumberValue" title="事件数值" :note="getEventNumberValueText()" />
|
||||
<t-cell v-if="hasSubmittedPointValue" title="提交积分值" :note="getSignedPointText(eventRecord.pointValue)" />
|
||||
<t-cell v-if="hasEarnedPointValue" title="本次积分变化" :note="getSignedPointText(eventRecord.earnedPointValue)" />
|
||||
<t-cell title="登记人" :note="Text.display(eventRecord.operator?.nick || eventRecord.operator?.name)" />
|
||||
<t-cell title="记录备注" :note="Text.display(eventRecord.remark)" />
|
||||
<t-cell title="查看记录详情" arrow hover @click="toEventRecordDetail" />
|
||||
<center-tips v-else :content="getEventEmptyText()" />
|
||||
</t-cell-group>
|
||||
<t-cell-group title="事件记录" theme="card" v-entrance-transition>
|
||||
<template v-if="eventRecord">
|
||||
<t-cell title="登记事件" :note="eventRecord.event?.name || triggerEvent?.name || '未知事件'" />
|
||||
<t-cell title="登记时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="eventRecord.registeredAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell v-if="hasEventNumberValue" title="事件数值" :note="getEventNumberValueText()" />
|
||||
<t-cell v-if="hasSubmittedPointValue" title="提交积分值" :note="getSignedPointText(eventRecord.pointValue)" />
|
||||
<t-cell v-if="hasEarnedPointValue" title="本次积分变化" :note="getSignedPointText(eventRecord.earnedPointValue)" />
|
||||
<t-cell title="登记人" :note="Text.display(eventRecord.operator?.nick || eventRecord.operator?.name)" />
|
||||
<t-cell title="记录备注" :note="Text.display(eventRecord.remark)" />
|
||||
<t-cell title="查看记录详情" arrow hover @click="toEventRecordDetail" />
|
||||
</template>
|
||||
<center-tips v-else :content="getRecordEmptyText()" />
|
||||
</t-cell-group>
|
||||
<t-cell-group title="命中规则" theme="card" v-entrance-transition>
|
||||
<template v-if="hitRule">
|
||||
<t-cell title="规则名称" :note="hitRule.name || '未命名规则'" />
|
||||
<t-cell title="规则模式" :note="hitRule.ruleMode === 'GROOVY' ? '脚本规则' : '简单规则'" />
|
||||
<t-cell title="规则积分" :note="getRulePointText(hitRule)" />
|
||||
<t-cell v-if="hitRule.ruleMode === 'GROOVY'" title="执行脚本" :note="getRuleScriptText(hitRule)" />
|
||||
<t-cell title="规则状态" :note="getRuleStatusText(hitRule.status)" />
|
||||
<t-cell title="规则优先级" :note="getPointText(hitRule.priority)" />
|
||||
<t-cell title="命中后停止匹配" :note="hitRule.exclusive ? '是' : '否'" />
|
||||
<t-cell title="规则备注" :note="Text.display(hitRule.remark)" />
|
||||
<t-cell title="查看规则详情" :arrow="canReadRule" :hover="canReadRule" @click="toPointRuleDetail" />
|
||||
</template>
|
||||
<center-tips v-else :content="getRuleEmptyText()" />
|
||||
</t-cell-group>
|
||||
</template>
|
||||
<center-tips v-else :content="getRecordEmptyText()" />
|
||||
</t-cell-group>
|
||||
<t-cell-group title="命中规则" theme="card" v-entrance-transition>
|
||||
<template v-if="hitRule">
|
||||
<t-cell title="规则名称" :note="hitRule.name || '未命名规则'" />
|
||||
<t-cell title="规则模式" :note="hitRule.ruleMode === 'GROOVY' ? '脚本规则' : '简单规则'" />
|
||||
<t-cell title="规则积分" :note="getRulePointText(hitRule)" />
|
||||
<t-cell v-if="hitRule.ruleMode === 'GROOVY'" title="执行脚本" :note="getRuleScriptText(hitRule)" />
|
||||
<t-cell title="规则状态" :note="getRuleStatusText(hitRule.status)" />
|
||||
<t-cell title="规则优先级" :note="getPointText(hitRule.priority)" />
|
||||
<t-cell title="命中后停止匹配" :note="hitRule.exclusive ? '是' : '否'" />
|
||||
<t-cell title="规则备注" :note="Text.display(hitRule.remark)" />
|
||||
<t-cell title="查看规则详情" :arrow="canReadRule" :hover="canReadRule" @click="toPointRuleDetail" />
|
||||
</template>
|
||||
<center-tips v-else :content="getRuleEmptyText()" />
|
||||
</t-cell-group>
|
||||
</template>
|
||||
<t-empty v-else :description="isLoading ? '正在加载积分流水' : '积分流水快照不存在,请从积分流水列表进入'" />
|
||||
<t-empty v-else :description="isLoading ? '正在加载积分流水' : '积分流水快照不存在,请从积分流水列表进入'" />
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -372,7 +376,7 @@ watch(() => [route.params.id, route.query.snapshot], async () => {
|
||||
.point-ledger-detail {
|
||||
gap: 1rem;
|
||||
min-height: 100vh;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 1rem;
|
||||
padding: 0 0 1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main v-can="permissionCodes.point.ledgerRead" class="page-content scroll list">
|
||||
<main v-can="permissionCodes.point.ledgerRead" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -1,75 +1,79 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
@click="save"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="保存"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="permissionCodes.pointRedeemSku.manage" class="redeem-sku-edit">
|
||||
<t-form class="form card" v-entrance-transition>
|
||||
<product-select-form-item
|
||||
v-model="selection"
|
||||
:selected-product="form.product"
|
||||
required-mark
|
||||
@select="handleProductSelection"
|
||||
/>
|
||||
<t-form-item label="默认积分" required-mark>
|
||||
<t-input
|
||||
v-model.trim="form.pointText"
|
||||
type="number"
|
||||
align="right"
|
||||
borderless
|
||||
placeholder="每单位所需积分"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
@click="save"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="保存"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="配置状态" content-align="right" arrow @click="statusVisible = true">
|
||||
<span v-text="statusText(form.status)" />
|
||||
</t-form-item>
|
||||
<t-form-item label="累计上限">
|
||||
<t-input v-model.trim="form.totalText" type="number" align="right" borderless placeholder="不限" />
|
||||
</t-form-item>
|
||||
<t-form-item label="每日上限">
|
||||
<t-input v-model.trim="form.dailyText" type="number" align="right" borderless placeholder="不限" />
|
||||
</t-form-item>
|
||||
<t-form-item label="每月上限">
|
||||
<t-input v-model.trim="form.monthlyText" type="number" align="right" borderless placeholder="不限" />
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<span class="tips gray">数量上限按兑换业务单位计算,最多三位小数。留空表示不限</span>
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea v-model.trim="form.remark" maxlength="500" autosize />
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-button
|
||||
v-if="form.id"
|
||||
class="cell-button"
|
||||
theme="danger"
|
||||
v-entrance-transition
|
||||
content="删除"
|
||||
@click="remove"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.pointRedeemSku.manage" class="redeem-sku-edit">
|
||||
<t-form class="form card" v-entrance-transition>
|
||||
<product-select-form-item
|
||||
v-model="selection"
|
||||
:selected-product="form.product"
|
||||
required-mark
|
||||
@select="handleProductSelection"
|
||||
/>
|
||||
<t-form-item label="默认积分" required-mark>
|
||||
<t-input
|
||||
v-model.trim="form.pointText"
|
||||
type="number"
|
||||
align="right"
|
||||
borderless
|
||||
placeholder="每单位所需积分"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="配置状态" content-align="right" arrow @click="statusVisible = true">
|
||||
<span v-text="statusText(form.status)" />
|
||||
</t-form-item>
|
||||
<t-form-item label="累计上限">
|
||||
<t-input v-model.trim="form.totalText" type="number" align="right" borderless placeholder="不限" />
|
||||
</t-form-item>
|
||||
<t-form-item label="每日上限">
|
||||
<t-input v-model.trim="form.dailyText" type="number" align="right" borderless placeholder="不限" />
|
||||
</t-form-item>
|
||||
<t-form-item label="每月上限">
|
||||
<t-input v-model.trim="form.monthlyText" type="number" align="right" borderless placeholder="不限" />
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<span class="tips gray">数量上限按兑换业务单位计算,最多三位小数。留空表示不限</span>
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea v-model.trim="form.remark" maxlength="500" autosize />
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-button
|
||||
v-if="form.id"
|
||||
class="cell-button"
|
||||
theme="danger"
|
||||
v-entrance-transition
|
||||
content="删除"
|
||||
@click="remove"
|
||||
/>
|
||||
</div>
|
||||
</main>
|
||||
<t-popup v-model="statusVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="statusDraft"
|
||||
:columns="statusOptions"
|
||||
title="配置状态"
|
||||
@cancel="statusVisible = false"
|
||||
@confirm="confirmStatus"
|
||||
/>
|
||||
</t-popup>
|
||||
</div>
|
||||
<t-popup v-model="statusVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="statusDraft"
|
||||
:columns="statusOptions"
|
||||
title="配置状态"
|
||||
@cancel="statusVisible = false"
|
||||
@confirm="confirmStatus"
|
||||
/>
|
||||
</t-popup>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -227,7 +231,7 @@ onMounted(async () => {
|
||||
.redeem-sku-edit {
|
||||
gap: 1rem;
|
||||
display: flex;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 2rem;
|
||||
padding: 0 0 2rem;
|
||||
flex-direction: column;
|
||||
|
||||
.tips {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main v-can="permissionCodes.pointRedeemSku.manage" class="page-content scroll list">
|
||||
<main v-can="permissionCodes.pointRedeemSku.manage" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -1,143 +1,147 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="客户兑换"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
@click="save"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="兑换"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="permissionCodes.pointRedemption.create" class="redemption-create">
|
||||
<t-form class="form card" label-width="7rem" v-entrance-transition>
|
||||
<t-form-item label="客户" required-mark>
|
||||
<t-input
|
||||
:model-value="customerName || '请选择客户'"
|
||||
class="customer"
|
||||
readonly
|
||||
borderless
|
||||
placeholder="选择或扫码客户"
|
||||
@click="customerVisible = true"
|
||||
>
|
||||
<template #suffix-icon>
|
||||
<div class="actions">
|
||||
<t-button
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
@click.stop="customerVisible = true"
|
||||
>选择</t-button>
|
||||
<t-button theme="primary" size="extra-small" @click.stop="toggleScanner">
|
||||
<span v-text="scannerVisible ? '关闭扫码' : '扫码'" />
|
||||
</t-button>
|
||||
</div>
|
||||
</template>
|
||||
</t-input>
|
||||
</t-form-item>
|
||||
<div v-if="scannerVisible" class="code-scanner-wrapper">
|
||||
<code-scanner
|
||||
visible
|
||||
:status-text="scanStatus"
|
||||
active-text="正在识别客户编码,请将条码或二维码移入取景框。"
|
||||
@decode="handleDecodedText"
|
||||
@status-change="handleScanStatusChange"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="客户兑换"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
@click="save"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="兑换"
|
||||
/>
|
||||
</div>
|
||||
<customer-profile-card
|
||||
v-if="customer"
|
||||
class="customer-profile"
|
||||
:customer="customer"
|
||||
v-entrance-transition
|
||||
/>
|
||||
<t-form-item v-if="customer" label="积分余额" content-align="right">
|
||||
<span class="orange" v-text="pointBalanceText" />
|
||||
</t-form-item>
|
||||
<t-form-item label="兑换商品" required-mark content-align="right" arrow @click="skuVisible = true">
|
||||
<span v-text="skuName || '请选择兑换商品'" />
|
||||
</t-form-item>
|
||||
<product-sku-form-item
|
||||
:sku="selectedSku?.sku"
|
||||
:unit="selectedSku?.unit"
|
||||
/>
|
||||
<t-form-item label="兑换数量" content-align="right" required-mark>
|
||||
<t-stepper
|
||||
v-model="quantity"
|
||||
size="large"
|
||||
:min="quantityStep"
|
||||
:step="quantityStep"
|
||||
:integer="quantityIsInteger"
|
||||
theme="outline"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="预计消耗积分" content-align="right">
|
||||
<span v-text="estimatedPointText" />
|
||||
</t-form-item>
|
||||
<template v-if="canAdjust">
|
||||
<t-form-item label="实际消耗扣分">
|
||||
<t-input v-model.trim="actualPointText" type="number" align="right" borderless placeholder="默认扣分" />
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea v-model="remark" maxlength="500" autosize />
|
||||
</t-form-item>
|
||||
</template>
|
||||
<div class="photo-wrap">
|
||||
<attachment-selector
|
||||
v-model:items="photos"
|
||||
:upload="uploadPhotoList"
|
||||
required
|
||||
title="兑换凭证照片"
|
||||
/>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.pointRedemption.create" class="redemption-create">
|
||||
<t-form class="form card" label-width="7rem" v-entrance-transition>
|
||||
<t-form-item label="客户" required-mark>
|
||||
<t-input
|
||||
:model-value="customerName || '请选择客户'"
|
||||
class="customer"
|
||||
readonly
|
||||
borderless
|
||||
placeholder="选择或扫码客户"
|
||||
@click="customerVisible = true"
|
||||
>
|
||||
<template #suffix-icon>
|
||||
<div class="actions">
|
||||
<t-button
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
@click.stop="customerVisible = true"
|
||||
>选择</t-button>
|
||||
<t-button theme="primary" size="extra-small" @click.stop="toggleScanner">
|
||||
<span v-text="scannerVisible ? '关闭扫码' : '扫码'" />
|
||||
</t-button>
|
||||
</div>
|
||||
</template>
|
||||
</t-input>
|
||||
</t-form-item>
|
||||
<div v-if="scannerVisible" class="code-scanner-wrapper">
|
||||
<code-scanner
|
||||
visible
|
||||
:status-text="scanStatus"
|
||||
active-text="正在识别客户编码,请将条码或二维码移入取景框。"
|
||||
@decode="handleDecodedText"
|
||||
@status-change="handleScanStatusChange"
|
||||
/>
|
||||
</div>
|
||||
<customer-profile-card
|
||||
v-if="customer"
|
||||
class="customer-profile"
|
||||
:customer="customer"
|
||||
v-entrance-transition
|
||||
/>
|
||||
<t-form-item v-if="customer" label="积分余额" content-align="right">
|
||||
<span class="orange" v-text="pointBalanceText" />
|
||||
</t-form-item>
|
||||
<t-form-item label="兑换商品" required-mark content-align="right" arrow @click="skuVisible = true">
|
||||
<span v-text="skuName || '请选择兑换商品'" />
|
||||
</t-form-item>
|
||||
<product-sku-form-item
|
||||
:sku="selectedSku?.sku"
|
||||
:unit="selectedSku?.unit"
|
||||
/>
|
||||
<t-form-item label="兑换数量" content-align="right" required-mark>
|
||||
<t-stepper
|
||||
v-model="quantity"
|
||||
size="large"
|
||||
:min="quantityStep"
|
||||
:step="quantityStep"
|
||||
:integer="quantityIsInteger"
|
||||
theme="outline"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="预计消耗积分" content-align="right">
|
||||
<span v-text="estimatedPointText" />
|
||||
</t-form-item>
|
||||
<template v-if="canAdjust">
|
||||
<t-form-item label="实际消耗扣分">
|
||||
<t-input v-model.trim="actualPointText" type="number" align="right" borderless placeholder="默认扣分" />
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea v-model="remark" maxlength="500" autosize />
|
||||
</t-form-item>
|
||||
</template>
|
||||
<div class="photo-wrap">
|
||||
<attachment-selector
|
||||
v-model:items="photos"
|
||||
:upload="uploadPhotoList"
|
||||
required
|
||||
title="兑换凭证照片"
|
||||
/>
|
||||
</div>
|
||||
</t-form>
|
||||
</div>
|
||||
</t-form>
|
||||
</main>
|
||||
<customer-selector
|
||||
v-model="customerId"
|
||||
v-model:visible="customerVisible"
|
||||
:enable-scan="false"
|
||||
@change="loadCustomer"
|
||||
/>
|
||||
<bottom-popup
|
||||
v-model="skuVisible"
|
||||
title="选择兑换商品"
|
||||
height="70vh"
|
||||
right-button-text=""
|
||||
@left-button-click="closeSkuPicker"
|
||||
>
|
||||
<div class="sku-picker">
|
||||
<t-cell
|
||||
v-for="item in skuList"
|
||||
:key="item.id"
|
||||
:title="item.product?.name || item.sku?.name || '未命名产品'"
|
||||
:note="`${formatPoint(item.defaultPointCost)} / ${item.unit?.name || '单位未知'}`"
|
||||
class="item"
|
||||
@click="selectSku(item)"
|
||||
>
|
||||
<template #left-icon>
|
||||
<t-image
|
||||
v-if="getProductPhoto(item)"
|
||||
:src="getProductPhoto(item)"
|
||||
:alt="item.product?.name || item.sku?.name || '产品图片'"
|
||||
fit="cover"
|
||||
class="avatar"
|
||||
/>
|
||||
<div
|
||||
v-else
|
||||
class="avatar fallback"
|
||||
v-text="(item.product?.name || item.sku?.name || '产').slice(0, 1)"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-empty v-if="!skuList.length" description="暂无启用的兑换商品" />
|
||||
</div>
|
||||
</bottom-popup>
|
||||
</div>
|
||||
<customer-selector
|
||||
v-model="customerId"
|
||||
v-model:visible="customerVisible"
|
||||
:enable-scan="false"
|
||||
@change="loadCustomer"
|
||||
/>
|
||||
<bottom-popup
|
||||
v-model="skuVisible"
|
||||
title="选择兑换商品"
|
||||
height="70vh"
|
||||
right-button-text=""
|
||||
@left-button-click="closeSkuPicker"
|
||||
>
|
||||
<div class="sku-picker">
|
||||
<t-cell
|
||||
v-for="item in skuList"
|
||||
:key="item.id"
|
||||
:title="item.product?.name || item.sku?.name || '未命名产品'"
|
||||
:note="`${formatPoint(item.defaultPointCost)} / ${item.unit?.name || '单位未知'}`"
|
||||
class="item"
|
||||
@click="selectSku(item)"
|
||||
>
|
||||
<template #left-icon>
|
||||
<t-image
|
||||
v-if="getProductPhoto(item)"
|
||||
:src="getProductPhoto(item)"
|
||||
:alt="item.product?.name || item.sku?.name || '产品图片'"
|
||||
fit="cover"
|
||||
class="avatar"
|
||||
/>
|
||||
<div
|
||||
v-else
|
||||
class="avatar fallback"
|
||||
v-text="(item.product?.name || item.sku?.name || '产').slice(0, 1)"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-empty v-if="!skuList.length" description="暂无启用的兑换商品" />
|
||||
</div>
|
||||
</bottom-popup>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -359,7 +363,7 @@ onMounted(async () => {
|
||||
|
||||
<style scoped lang="less">
|
||||
.redemption-create {
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 2rem;
|
||||
padding: 0 0 2rem;
|
||||
|
||||
.form {
|
||||
|
||||
|
||||
@@ -1,78 +1,82 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="兑换详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div v-can="permissionCodes.pointRedemption.create" class="redemption-detail">
|
||||
<customer-profile-card
|
||||
v-if="customer"
|
||||
class="customer-profile"
|
||||
:customer="customer"
|
||||
v-entrance-transition
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="兑换详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<t-cell-group v-if="item" title="兑换信息" theme="card" v-entrance-transition>
|
||||
<t-cell title="客户" :note="item.customer?.name || item.customerId || '-'" />
|
||||
<t-cell title="兑换商品" :note="item.productNameSnapshot || item.skuNameSnapshot || '-'" />
|
||||
<t-cell title="兑换数量" :note="`${quantityText(item.quantity)} ${item.unitSnapshot || ''}`" />
|
||||
<t-cell title="积分" :note="`${formatPoint(item.actualPointCost)}${item.actualPointCost !== item.defaultPointCost ? '(已减免)' : ''}`" />
|
||||
<t-cell title="状态" :note="statusText(item.status)" />
|
||||
<t-cell title="兑换时间" :note="timeText(item.redeemedAt)" />
|
||||
<t-cell v-if="item.remark" title="备注" :note="item.remark" />
|
||||
<div class="photo-wrap bg-white">
|
||||
<attachment-selector :items="redemptionPhotoItems" title="兑换凭证" readonly />
|
||||
</div>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-if="returnList.length" title="退货记录" theme="card" v-entrance-transition>
|
||||
<t-cell
|
||||
v-for="record in returnList"
|
||||
:key="record.id"
|
||||
:title="`退货 ${quantityText(record.quantity)} ${item?.unitSnapshot || ''}`"
|
||||
:note="`${formatPoint(record.pointCost)} · ${timeText(record.returnedAt)}`"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<t-empty v-if="!item" :description="loading ? '正在加载兑换单' : '兑换单不存在'" />
|
||||
<t-button
|
||||
v-if="canReturn"
|
||||
class="return-button cell-button"
|
||||
theme="danger"
|
||||
content="冲正兑换"
|
||||
v-entrance-transition
|
||||
@click="returnVisible = true"
|
||||
/>
|
||||
</div>
|
||||
<bottom-popup
|
||||
v-model="returnVisible"
|
||||
title="冲正兑换"
|
||||
left-button-text="取消"
|
||||
:right-button-text="returning ? '提交中' : '确认冲正'"
|
||||
@left-button-click="returnVisible = false"
|
||||
@right-button-click="submitReturn"
|
||||
>
|
||||
<div class="return-form">
|
||||
<t-form class="form card" label-width="6rem">
|
||||
<t-form-item label="剩余数量">
|
||||
<span v-text="`${remainText} ${item?.unitSnapshot || ''}`" />
|
||||
</t-form-item>
|
||||
<t-form-item label="冲正数量" required-mark>
|
||||
<t-input v-model.trim="returnQuantity" type="number" align="right" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item label="冲正原因">
|
||||
<t-textarea v-model.trim="returnRemark" maxlength="500" autosize />
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<attachment-selector
|
||||
v-model:items="returnPhotos"
|
||||
:upload="uploadPhotoList"
|
||||
required
|
||||
title="冲正凭证照片"
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.pointRedemption.create" class="redemption-detail">
|
||||
<customer-profile-card
|
||||
v-if="customer"
|
||||
class="customer-profile"
|
||||
:customer="customer"
|
||||
v-entrance-transition
|
||||
/>
|
||||
<t-cell-group v-if="item" title="兑换信息" theme="card" v-entrance-transition>
|
||||
<t-cell title="客户" :note="item.customer?.name || item.customerId || '-'" />
|
||||
<t-cell title="兑换商品" :note="item.productNameSnapshot || item.skuNameSnapshot || '-'" />
|
||||
<t-cell title="兑换数量" :note="`${quantityText(item.quantity)} ${item.unitSnapshot || ''}`" />
|
||||
<t-cell title="积分" :note="`${formatPoint(item.actualPointCost)}${item.actualPointCost !== item.defaultPointCost ? '(已减免)' : ''}`" />
|
||||
<t-cell title="状态" :note="statusText(item.status)" />
|
||||
<t-cell title="兑换时间" :note="timeText(item.redeemedAt)" />
|
||||
<t-cell v-if="item.remark" title="备注" :note="item.remark" />
|
||||
<div class="photo-wrap bg-white">
|
||||
<attachment-selector :items="redemptionPhotoItems" title="兑换凭证" readonly />
|
||||
</div>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-if="returnList.length" title="退货记录" theme="card" v-entrance-transition>
|
||||
<t-cell
|
||||
v-for="record in returnList"
|
||||
:key="record.id"
|
||||
:title="`退货 ${quantityText(record.quantity)} ${item?.unitSnapshot || ''}`"
|
||||
:note="`${formatPoint(record.pointCost)} · ${timeText(record.returnedAt)}`"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</div>
|
||||
</bottom-popup>
|
||||
</t-cell-group>
|
||||
<t-empty v-if="!item" :description="loading ? '正在加载兑换单' : '兑换单不存在'" />
|
||||
<t-button
|
||||
v-if="canReturn"
|
||||
class="return-button cell-button"
|
||||
theme="danger"
|
||||
content="冲正兑换"
|
||||
v-entrance-transition
|
||||
@click="returnVisible = true"
|
||||
/>
|
||||
</div>
|
||||
</main>
|
||||
<bottom-popup
|
||||
v-model="returnVisible"
|
||||
title="冲正兑换"
|
||||
left-button-text="取消"
|
||||
:right-button-text="returning ? '提交中' : '确认冲正'"
|
||||
@left-button-click="returnVisible = false"
|
||||
@right-button-click="submitReturn"
|
||||
>
|
||||
<div class="return-form">
|
||||
<t-form class="form card" label-width="6rem">
|
||||
<t-form-item label="剩余数量">
|
||||
<span v-text="`${remainText} ${item?.unitSnapshot || ''}`" />
|
||||
</t-form-item>
|
||||
<t-form-item label="冲正数量" required-mark>
|
||||
<t-input v-model.trim="returnQuantity" type="number" align="right" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item label="冲正原因">
|
||||
<t-textarea v-model.trim="returnRemark" maxlength="500" autosize />
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<attachment-selector
|
||||
v-model:items="returnPhotos"
|
||||
:upload="uploadPhotoList"
|
||||
required
|
||||
title="冲正凭证照片"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</div>
|
||||
</bottom-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -225,7 +229,7 @@ onMounted(load);
|
||||
.redemption-detail {
|
||||
gap: 1rem;
|
||||
display: flex;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 2rem;
|
||||
padding: 0 0 2rem;
|
||||
flex-direction: column;
|
||||
|
||||
.return-button {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main v-can="permissionCodes.pointRedemption.create" class="page-content scroll list">
|
||||
<main v-can="permissionCodes.pointRedemption.create" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh"
|
||||
v-model="refreshing"
|
||||
|
||||
+107
-103
@@ -1,108 +1,112 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="积分规则详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="rule?.id && canUpdate"
|
||||
@click="toEdit"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="编辑"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="permissionCodes.pointRule.read" class="point-rule-detail">
|
||||
<section v-if="rule" class="rule-header" v-entrance-transition>
|
||||
<div class="point-icon" :class="{ consume: isConsumeRule }">
|
||||
<t-icon name="money" size="1.75rem" />
|
||||
</div>
|
||||
<div class="header-content">
|
||||
<div class="title-row">
|
||||
<h2 v-text="rule.name || '未命名规则'" />
|
||||
<t-tag :theme="getStatusTheme(rule.status)" variant="light-outline" :content="getStatusText(rule.status)" />
|
||||
</div>
|
||||
<div class="point-value" v-text="rulePointText" />
|
||||
</div>
|
||||
</section>
|
||||
<t-cell-group v-if="rule" title="基本信息" theme="card" v-entrance-transition>
|
||||
<t-cell
|
||||
v-if="rule.triggerSourceType === 'EVENT_RECORD'"
|
||||
title="触发事件"
|
||||
:note="event?.name || '未绑定事件'"
|
||||
:arrow="canReadEvent && !!event?.id"
|
||||
:hover="canReadEvent && !!event?.id"
|
||||
@click="toEventDetail"
|
||||
/>
|
||||
<t-cell v-else-if="rule.triggerSourceType === 'SALES_ORDER_PAID'" title="触发来源" note="订单首次全额实收" />
|
||||
<t-cell title="规则名称" :note="rule.name || '未命名规则'" />
|
||||
<t-cell title="规则状态">
|
||||
<template #note>
|
||||
<t-tag :theme="getStatusTheme(rule.status)" variant="light-outline" :content="getStatusText(rule.status)" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="规则备注" :note="Text.display(rule.remark)" />
|
||||
</t-cell-group>
|
||||
<t-cell-group
|
||||
v-if="rule"
|
||||
class="script"
|
||||
title="积分配置"
|
||||
theme="card"
|
||||
v-entrance-transition
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="积分规则详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<t-cell title="规则模式" :note="rule.ruleMode === 'GROOVY' ? '脚本规则' : '简单规则'" />
|
||||
<t-cell v-if="rule.ruleMode !== 'GROOVY'" title="固定积分" :note="formatPointValue(rule.pointValue)" />
|
||||
<template v-if="rule?.ruleMode === 'GROOVY'">
|
||||
<t-cell title="执行脚本" :note="scriptName" />
|
||||
<t-cell class="description empty-cell-title-margin">
|
||||
<template #title>
|
||||
<div class="title">
|
||||
<span>脚本说明</span>
|
||||
<span class="tips orange">如需调整规则请联系技术支持</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #description>
|
||||
<markdown-view :content="rule.groovyScript?.description || '暂无脚本说明'" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell class="empty-cell-title-margin" title="脚本代码">
|
||||
<template #description>
|
||||
<code-editor
|
||||
v-if="scriptContent"
|
||||
:value="scriptContent"
|
||||
language="groovy"
|
||||
readonly
|
||||
line-numbers
|
||||
class="code"
|
||||
/>
|
||||
<center-tips v-else :content="'暂无脚本代码'" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="rule?.id && canUpdate"
|
||||
@click="toEdit"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="编辑"
|
||||
/>
|
||||
</template>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-if="rule" title="其他配置" theme="card" v-entrance-transition>
|
||||
<t-cell title="规则优先级" :note="formatNumber(rule.priority)" />
|
||||
<t-cell title="命中后停止匹配" :note="rule.exclusive ? '是' : '否'" />
|
||||
<t-cell title="生效开始" :note="formatDate(rule.beginAt)" />
|
||||
<t-cell title="生效结束" :note="formatDate(rule.endAt)" />
|
||||
<t-cell title="创建时间" :note="formatDate(rule.createdAt, '未知时间')" />
|
||||
<t-cell title="更新时间" :note="formatDate(rule.updatedAt, '未知时间')" />
|
||||
</t-cell-group>
|
||||
<t-button
|
||||
v-if="rule && canDelete"
|
||||
class="cell-button"
|
||||
:loading="isDeleting"
|
||||
theme="danger"
|
||||
@click="confirmRemove"
|
||||
>
|
||||
删除
|
||||
</t-button>
|
||||
<t-empty v-if="!rule" :description="isLoading ? '正在加载积分规则' : '积分规则不存在'" />
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.pointRule.read" class="point-rule-detail">
|
||||
<section v-if="rule" class="rule-header" v-entrance-transition>
|
||||
<div class="point-icon" :class="{ consume: isConsumeRule }">
|
||||
<t-icon name="money" size="1.75rem" />
|
||||
</div>
|
||||
<div class="header-content">
|
||||
<div class="title-row">
|
||||
<h2 v-text="rule.name || '未命名规则'" />
|
||||
<t-tag :theme="getStatusTheme(rule.status)" variant="light-outline" :content="getStatusText(rule.status)" />
|
||||
</div>
|
||||
<div class="point-value" v-text="rulePointText" />
|
||||
</div>
|
||||
</section>
|
||||
<t-cell-group v-if="rule" title="基本信息" theme="card" v-entrance-transition>
|
||||
<t-cell
|
||||
v-if="rule.triggerSourceType === 'EVENT_RECORD'"
|
||||
title="触发事件"
|
||||
:note="event?.name || '未绑定事件'"
|
||||
:arrow="canReadEvent && !!event?.id"
|
||||
:hover="canReadEvent && !!event?.id"
|
||||
@click="toEventDetail"
|
||||
/>
|
||||
<t-cell v-else-if="rule.triggerSourceType === 'SALES_ORDER_PAID'" title="触发来源" note="订单首次全额实收" />
|
||||
<t-cell title="规则名称" :note="rule.name || '未命名规则'" />
|
||||
<t-cell title="规则状态">
|
||||
<template #note>
|
||||
<t-tag :theme="getStatusTheme(rule.status)" variant="light-outline" :content="getStatusText(rule.status)" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="规则备注" :note="Text.display(rule.remark)" />
|
||||
</t-cell-group>
|
||||
<t-cell-group
|
||||
v-if="rule"
|
||||
class="script"
|
||||
title="积分配置"
|
||||
theme="card"
|
||||
v-entrance-transition
|
||||
>
|
||||
<t-cell title="规则模式" :note="rule.ruleMode === 'GROOVY' ? '脚本规则' : '简单规则'" />
|
||||
<t-cell v-if="rule.ruleMode !== 'GROOVY'" title="固定积分" :note="formatPointValue(rule.pointValue)" />
|
||||
<template v-if="rule?.ruleMode === 'GROOVY'">
|
||||
<t-cell title="执行脚本" :note="scriptName" />
|
||||
<t-cell class="description empty-cell-title-margin">
|
||||
<template #title>
|
||||
<div class="title">
|
||||
<span>脚本说明</span>
|
||||
<span class="tips orange">如需调整规则请联系技术支持</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #description>
|
||||
<markdown-view :content="rule.groovyScript?.description || '暂无脚本说明'" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell class="empty-cell-title-margin" title="脚本代码">
|
||||
<template #description>
|
||||
<code-editor
|
||||
v-if="scriptContent"
|
||||
:value="scriptContent"
|
||||
language="groovy"
|
||||
readonly
|
||||
line-numbers
|
||||
class="code"
|
||||
/>
|
||||
<center-tips v-else :content="'暂无脚本代码'" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</template>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-if="rule" title="其他配置" theme="card" v-entrance-transition>
|
||||
<t-cell title="规则优先级" :note="formatNumber(rule.priority)" />
|
||||
<t-cell title="命中后停止匹配" :note="rule.exclusive ? '是' : '否'" />
|
||||
<t-cell title="生效开始" :note="formatDate(rule.beginAt)" />
|
||||
<t-cell title="生效结束" :note="formatDate(rule.endAt)" />
|
||||
<t-cell title="创建时间" :note="formatDate(rule.createdAt, '未知时间')" />
|
||||
<t-cell title="更新时间" :note="formatDate(rule.updatedAt, '未知时间')" />
|
||||
</t-cell-group>
|
||||
<t-button
|
||||
v-if="rule && canDelete"
|
||||
class="cell-button"
|
||||
:loading="isDeleting"
|
||||
theme="danger"
|
||||
@click="confirmRemove"
|
||||
>
|
||||
删除
|
||||
</t-button>
|
||||
<t-empty v-if="!rule" :description="isLoading ? '正在加载积分规则' : '积分规则不存在'" />
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -326,7 +330,7 @@ watch(() => route.params.id, async () => {
|
||||
.point-rule-detail {
|
||||
gap: 1rem;
|
||||
min-height: 100vh;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 1rem;
|
||||
padding: 0 0 1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
+158
-154
@@ -1,159 +1,163 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(savePermissionCode)"
|
||||
@click="saveRule"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="保存"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(savePermissionCode)"
|
||||
@click="saveRule"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="保存"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="pageAccess" class="point-rule-edit">
|
||||
<t-form class="form card" label-width="7rem">
|
||||
<card-container v-entrance-transition>
|
||||
<t-form-item label="触发来源" required-mark arrow @click="openTriggerSourcePicker">
|
||||
<span class="picker-text" v-text="getTriggerSourceText(formModel.triggerSourceType)" />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="formModel.triggerSourceType === 'EVENT_RECORD'" label="触发事件" required-mark arrow @click="openEventPicker">
|
||||
<span class="picker-text" v-text="selectedEventName" />
|
||||
</t-form-item>
|
||||
<t-form-item v-else label-width="0" class="form-tips">订单首次全额实收时触发,同一订单每条规则只生效一次</t-form-item>
|
||||
<t-form-item label="规则名称" required-mark>
|
||||
<t-input v-model.trim="formModel.name" align="right" borderless placeholder="例如:每次登记加 10 分" />
|
||||
</t-form-item>
|
||||
<t-form-item label="规则状态" arrow @click="openStatusPicker">
|
||||
<span class="picker-text" v-text="getStatusText(formModel.status)" />
|
||||
</t-form-item>
|
||||
<t-form-item label="规则备注">
|
||||
<t-textarea v-model.trim="formModel.remark" :autosize="{ minRows: 3, maxRows: 5 }" placeholder="规则说明" />
|
||||
</t-form-item>
|
||||
</card-container>
|
||||
<card-container v-entrance-transition>
|
||||
<t-form-item label="规则模式" arrow @click="openRuleModePicker">
|
||||
<span class="picker-text" v-text="getRuleModeText(formModel.ruleMode)" />
|
||||
</t-form-item>
|
||||
<template v-if="formModel.ruleMode === 'GROOVY'">
|
||||
<t-form-item label="执行脚本" required-mark arrow @click="openScriptPicker">
|
||||
<span class="picker-text" v-text="selectedScriptText" />
|
||||
</t-form-item>
|
||||
</template>
|
||||
<template v-else>
|
||||
<t-form-item label="积分动作" arrow @click="openPointActionPicker">
|
||||
<span class="picker-text" v-text="getPointActionText(formModel.pointAction)" />
|
||||
</t-form-item>
|
||||
<t-form-item label="积分数量" required-mark>
|
||||
<t-input
|
||||
v-model.trim="formModel.pointValueText"
|
||||
type="number"
|
||||
align="right"
|
||||
borderless
|
||||
placeholder="请输入数量"
|
||||
/>
|
||||
</t-form-item>
|
||||
</template>
|
||||
</card-container>
|
||||
<card-container v-entrance-transition>
|
||||
<t-form-item label="生效开始" arrow @click="openBeginAtPicker">
|
||||
<div class="time-value">
|
||||
<span class="picker-text" v-text="formModel.beginAtText || '不限'" />
|
||||
<t-button v-if="formModel.beginAtText" size="extra-small" content="不限" @click.stop="clearBeginAt" />
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item label="生效结束" arrow @click="openEndAtPicker">
|
||||
<div class="time-value">
|
||||
<span class="picker-text" v-text="formModel.endAtText || '不限'" />
|
||||
<t-button v-if="formModel.endAtText" size="extra-small" content="不限" @click.stop="clearEndAt" />
|
||||
</div>
|
||||
</t-form-item>
|
||||
</card-container>
|
||||
<card-container tips="命中规则并执行积分动作后不再匹配后续规则" v-entrance-transition>
|
||||
<t-form-item label="独占匹配" content-align="right">
|
||||
<t-switch size="small" v-model="formModel.exclusive" />
|
||||
</t-form-item>
|
||||
</card-container>
|
||||
</t-form>
|
||||
</div>
|
||||
</main>
|
||||
<t-popup v-model="eventPickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="eventPickerDraft"
|
||||
:columns="eventPickerColumns"
|
||||
title="选择触发事件"
|
||||
@cancel="eventPickerVisible = false"
|
||||
@confirm="confirmEventPicker"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="pageAccess" class="point-rule-edit">
|
||||
<t-form class="form card" label-width="7rem">
|
||||
<card-container v-entrance-transition>
|
||||
<t-form-item label="触发来源" required-mark arrow @click="openTriggerSourcePicker">
|
||||
<span class="picker-text" v-text="getTriggerSourceText(formModel.triggerSourceType)" />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="formModel.triggerSourceType === 'EVENT_RECORD'" label="触发事件" required-mark arrow @click="openEventPicker">
|
||||
<span class="picker-text" v-text="selectedEventName" />
|
||||
</t-form-item>
|
||||
<t-form-item v-else label-width="0" class="form-tips">订单首次全额实收时触发,同一订单每条规则只生效一次</t-form-item>
|
||||
<t-form-item label="规则名称" required-mark>
|
||||
<t-input v-model.trim="formModel.name" align="right" borderless placeholder="例如:每次登记加 10 分" />
|
||||
</t-form-item>
|
||||
<t-form-item label="规则状态" arrow @click="openStatusPicker">
|
||||
<span class="picker-text" v-text="getStatusText(formModel.status)" />
|
||||
</t-form-item>
|
||||
<t-form-item label="规则备注">
|
||||
<t-textarea v-model.trim="formModel.remark" :autosize="{ minRows: 3, maxRows: 5 }" placeholder="规则说明" />
|
||||
</t-form-item>
|
||||
</card-container>
|
||||
<card-container v-entrance-transition>
|
||||
<t-form-item label="规则模式" arrow @click="openRuleModePicker">
|
||||
<span class="picker-text" v-text="getRuleModeText(formModel.ruleMode)" />
|
||||
</t-form-item>
|
||||
<template v-if="formModel.ruleMode === 'GROOVY'">
|
||||
<t-form-item label="执行脚本" required-mark arrow @click="openScriptPicker">
|
||||
<span class="picker-text" v-text="selectedScriptText" />
|
||||
</t-form-item>
|
||||
</template>
|
||||
<template v-else>
|
||||
<t-form-item label="积分动作" arrow @click="openPointActionPicker">
|
||||
<span class="picker-text" v-text="getPointActionText(formModel.pointAction)" />
|
||||
</t-form-item>
|
||||
<t-form-item label="积分数量" required-mark>
|
||||
<t-input
|
||||
v-model.trim="formModel.pointValueText"
|
||||
type="number"
|
||||
align="right"
|
||||
borderless
|
||||
placeholder="请输入数量"
|
||||
/>
|
||||
</t-form-item>
|
||||
</template>
|
||||
</card-container>
|
||||
<card-container v-entrance-transition>
|
||||
<t-form-item label="生效开始" arrow @click="openBeginAtPicker">
|
||||
<div class="time-value">
|
||||
<span class="picker-text" v-text="formModel.beginAtText || '不限'" />
|
||||
<t-button v-if="formModel.beginAtText" size="extra-small" content="不限" @click.stop="clearBeginAt" />
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item label="生效结束" arrow @click="openEndAtPicker">
|
||||
<div class="time-value">
|
||||
<span class="picker-text" v-text="formModel.endAtText || '不限'" />
|
||||
<t-button v-if="formModel.endAtText" size="extra-small" content="不限" @click.stop="clearEndAt" />
|
||||
</div>
|
||||
</t-form-item>
|
||||
</card-container>
|
||||
<card-container tips="命中规则并执行积分动作后不再匹配后续规则" v-entrance-transition>
|
||||
<t-form-item label="独占匹配" content-align="right">
|
||||
<t-switch size="small" v-model="formModel.exclusive" />
|
||||
</t-form-item>
|
||||
</card-container>
|
||||
</t-form>
|
||||
</t-popup>
|
||||
<t-popup v-model="triggerSourcePickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="triggerSourcePickerDraft"
|
||||
:columns="triggerSourcePickerColumns"
|
||||
title="触发来源"
|
||||
@cancel="triggerSourcePickerVisible = false"
|
||||
@confirm="confirmTriggerSourcePicker"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="statusPickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="statusPickerDraft"
|
||||
:columns="statusPickerColumns"
|
||||
title="规则状态"
|
||||
@cancel="statusPickerVisible = false"
|
||||
@confirm="confirmStatusPicker"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="pointActionPickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="pointActionPickerDraft"
|
||||
:columns="pointActionPickerColumns"
|
||||
title="积分动作"
|
||||
@cancel="pointActionPickerVisible = false"
|
||||
@confirm="confirmPointActionPicker"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="ruleModePickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="ruleModePickerDraft"
|
||||
:columns="ruleModePickerColumns"
|
||||
title="规则模式"
|
||||
@cancel="ruleModePickerVisible = false"
|
||||
@confirm="confirmRuleModePicker"
|
||||
/>
|
||||
</t-popup>
|
||||
<point-rule-script-picker
|
||||
v-model="formModel.groovyScriptId"
|
||||
v-model:visible="scriptPickerVisible"
|
||||
:scripts="availableScriptList"
|
||||
/>
|
||||
<t-popup v-model="beginAtPickerVisible" placement="bottom">
|
||||
<t-date-time-picker
|
||||
v-model="beginAtDraftText"
|
||||
:start="minimumDateTimeText"
|
||||
:mode="['date', 'minute']"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
title="生效开始"
|
||||
@cancel="beginAtPickerVisible = false"
|
||||
@confirm="confirmBeginAt"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="endAtPickerVisible" placement="bottom">
|
||||
<t-date-time-picker
|
||||
v-model="endAtDraftText"
|
||||
:start="endAtMinimumDateTimeText"
|
||||
:mode="['date', 'minute']"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
title="生效结束"
|
||||
@cancel="endAtPickerVisible = false"
|
||||
@confirm="confirmEndAt"
|
||||
/>
|
||||
</t-popup>
|
||||
</div>
|
||||
<t-popup v-model="eventPickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="eventPickerDraft"
|
||||
:columns="eventPickerColumns"
|
||||
title="选择触发事件"
|
||||
@cancel="eventPickerVisible = false"
|
||||
@confirm="confirmEventPicker"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="triggerSourcePickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="triggerSourcePickerDraft"
|
||||
:columns="triggerSourcePickerColumns"
|
||||
title="触发来源"
|
||||
@cancel="triggerSourcePickerVisible = false"
|
||||
@confirm="confirmTriggerSourcePicker"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="statusPickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="statusPickerDraft"
|
||||
:columns="statusPickerColumns"
|
||||
title="规则状态"
|
||||
@cancel="statusPickerVisible = false"
|
||||
@confirm="confirmStatusPicker"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="pointActionPickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="pointActionPickerDraft"
|
||||
:columns="pointActionPickerColumns"
|
||||
title="积分动作"
|
||||
@cancel="pointActionPickerVisible = false"
|
||||
@confirm="confirmPointActionPicker"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="ruleModePickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="ruleModePickerDraft"
|
||||
:columns="ruleModePickerColumns"
|
||||
title="规则模式"
|
||||
@cancel="ruleModePickerVisible = false"
|
||||
@confirm="confirmRuleModePicker"
|
||||
/>
|
||||
</t-popup>
|
||||
<point-rule-script-picker
|
||||
v-model="formModel.groovyScriptId"
|
||||
v-model:visible="scriptPickerVisible"
|
||||
:scripts="availableScriptList"
|
||||
/>
|
||||
<t-popup v-model="beginAtPickerVisible" placement="bottom">
|
||||
<t-date-time-picker
|
||||
v-model="beginAtDraftText"
|
||||
:start="minimumDateTimeText"
|
||||
:mode="['date', 'minute']"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
title="生效开始"
|
||||
@cancel="beginAtPickerVisible = false"
|
||||
@confirm="confirmBeginAt"
|
||||
/>
|
||||
</t-popup>
|
||||
<t-popup v-model="endAtPickerVisible" placement="bottom">
|
||||
<t-date-time-picker
|
||||
v-model="endAtDraftText"
|
||||
:start="endAtMinimumDateTimeText"
|
||||
:mode="['date', 'minute']"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
title="生效结束"
|
||||
@cancel="endAtPickerVisible = false"
|
||||
@confirm="confirmEndAt"
|
||||
/>
|
||||
</t-popup>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -574,7 +578,7 @@ onMounted(async () => {
|
||||
|
||||
<style scoped lang="less">
|
||||
.point-rule-edit {
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 calc(1rem + env(safe-area-inset-bottom, 0));
|
||||
padding: 0 0 calc(1rem + env(safe-area-inset-bottom, 0));
|
||||
|
||||
.form {
|
||||
gap: 1rem;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<navbar-actions :actions="actionList" :visible="canShowActionMenu" />
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main v-can="permissionCodes.pointRule.read" class="page-content scroll list">
|
||||
<main v-can="permissionCodes.pointRule.read" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="list-wrapper pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<navbar-actions :actions="actionList" :visible="canShowActionMenu" />
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main v-can="permissionCodes.productCategory.read" class="page-content scroll list">
|
||||
<main v-can="permissionCodes.productCategory.read" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
+124
-120
@@ -1,127 +1,131 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="产品详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<navbar-actions :actions="actionList" />
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="permissionCodes.product.read" class="product-detail">
|
||||
<t-loading v-if="isLoading" class="loading" size="32px" />
|
||||
<template v-if="product">
|
||||
<product-profile :product="product" v-entrance-transition />
|
||||
<t-cell-group title="基本信息" theme="card" v-entrance-transition>
|
||||
<t-cell title="产品分类" :note="product.category?.name || '未分类'" />
|
||||
<t-cell title="库存管理" :note="product.stockEnabled ? '启用' : '关闭'" />
|
||||
<t-cell title="状态" :note="getProductStatusText(product.status)" />
|
||||
<t-cell title="备注" :note="Text.display(product.remark)"></t-cell>
|
||||
<t-cell>
|
||||
<attachment-selector :items="attachmentItemList" readonly />
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group theme="card" v-entrance-transition>
|
||||
<t-cell
|
||||
v-if="product.stockEnabled && userStore.hasPermissions(permissionCodes.productStock.read)"
|
||||
title="库存"
|
||||
:note="product.skuList?.length === 1 ? '查看 SKU 库存详情' : '查看全部 SKU 库存'"
|
||||
arrow
|
||||
@click="viewStock"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<t-cell-group title="SKU 列表" theme="card" class="skus" v-entrance-transition>
|
||||
<t-cell
|
||||
class="sku"
|
||||
v-for="sku in product.skuList || []"
|
||||
:key="sku.id || sku.code"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
arrow
|
||||
hover
|
||||
@click="openSkuDetail(sku)"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-image
|
||||
v-if="getProductPhotoURL(sku)"
|
||||
:src="getProductPhotoURL(sku)"
|
||||
:alt="getSkuTitle(sku)"
|
||||
fit="cover"
|
||||
class="avatar"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="产品详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<navbar-actions :actions="actionList" />
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.product.read" class="product-detail">
|
||||
<t-loading v-if="isLoading" class="loading" size="32px" />
|
||||
<template v-if="product">
|
||||
<product-profile :product="product" v-entrance-transition />
|
||||
<t-cell-group title="基本信息" theme="card" v-entrance-transition>
|
||||
<t-cell title="产品分类" :note="product.category?.name || '未分类'" />
|
||||
<t-cell title="库存管理" :note="product.stockEnabled ? '启用' : '关闭'" />
|
||||
<t-cell title="状态" :note="getProductStatusText(product.status)" />
|
||||
<t-cell title="备注" :note="Text.display(product.remark)"></t-cell>
|
||||
<t-cell>
|
||||
<attachment-selector :items="attachmentItemList" readonly />
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group theme="card" v-entrance-transition>
|
||||
<t-cell
|
||||
v-if="product.stockEnabled && userStore.hasPermissions(permissionCodes.productStock.read)"
|
||||
title="库存"
|
||||
:note="product.skuList?.length === 1 ? '查看 SKU 库存详情' : '查看全部 SKU 库存'"
|
||||
arrow
|
||||
@click="viewStock"
|
||||
/>
|
||||
<div v-else class="avatar fallback" v-text="getSkuTitle(sku).slice(0, 1)" />
|
||||
</template>
|
||||
<template #title>
|
||||
<div class="title">
|
||||
<h5 class="name" v-text="getSkuTitle(sku)" />
|
||||
</div>
|
||||
</template>
|
||||
<template #note>
|
||||
<t-tag
|
||||
size="small"
|
||||
variant="light-outline"
|
||||
:theme="sku.status === 'ACTIVE' ? 'success' : 'warning'"
|
||||
:content="sku.status === 'ACTIVE' ? '启用' : '停用'"
|
||||
/>
|
||||
</template>
|
||||
<template #description>
|
||||
<div class="tags">
|
||||
<t-tag
|
||||
v-for="unit in sku.unitList || []"
|
||||
:key="unit.id || unit.name"
|
||||
size="small"
|
||||
theme="primary"
|
||||
variant="light-outline"
|
||||
:content="`${unit.name}${unit.isBase ? '(基础)' : ''}`"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
<center-tips v-if="!product.skuList?.length" :content="'暂无 SKU'" />
|
||||
</t-cell-group>
|
||||
</template>
|
||||
</div>
|
||||
</t-cell-group>
|
||||
<t-cell-group title="SKU 列表" theme="card" class="skus" v-entrance-transition>
|
||||
<t-cell
|
||||
class="sku"
|
||||
v-for="sku in product.skuList || []"
|
||||
:key="sku.id || sku.code"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
arrow
|
||||
hover
|
||||
@click="openSkuDetail(sku)"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-image
|
||||
v-if="getProductPhotoURL(sku)"
|
||||
:src="getProductPhotoURL(sku)"
|
||||
:alt="getSkuTitle(sku)"
|
||||
fit="cover"
|
||||
class="avatar"
|
||||
/>
|
||||
<div v-else class="avatar fallback" v-text="getSkuTitle(sku).slice(0, 1)" />
|
||||
</template>
|
||||
<template #title>
|
||||
<div class="title">
|
||||
<h5 class="name" v-text="getSkuTitle(sku)" />
|
||||
</div>
|
||||
</template>
|
||||
<template #note>
|
||||
<t-tag
|
||||
size="small"
|
||||
variant="light-outline"
|
||||
:theme="sku.status === 'ACTIVE' ? 'success' : 'warning'"
|
||||
:content="sku.status === 'ACTIVE' ? '启用' : '停用'"
|
||||
/>
|
||||
</template>
|
||||
<template #description>
|
||||
<div class="tags">
|
||||
<t-tag
|
||||
v-for="unit in sku.unitList || []"
|
||||
:key="unit.id || unit.name"
|
||||
size="small"
|
||||
theme="primary"
|
||||
variant="light-outline"
|
||||
:content="`${unit.name}${unit.isBase ? '(基础)' : ''}`"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
<center-tips v-if="!product.skuList?.length" :content="'暂无 SKU'" />
|
||||
</t-cell-group>
|
||||
</template>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<bottom-popup
|
||||
v-model="skuDetailVisible"
|
||||
title="SKU 详情"
|
||||
height="min(80vh, 48rem)"
|
||||
left-button-text="关闭"
|
||||
right-button-text=""
|
||||
:z-index="skuDetailPopupZIndex"
|
||||
:overlay-props="{ zIndex: skuDetailPopupZIndex - 1 }"
|
||||
@left-button-click="closeSkuDetail"
|
||||
>
|
||||
<div v-if="selectedSku" class="sku-popup">
|
||||
<t-cell-group>
|
||||
<t-cell title="明细名称" :note="selectedSku.name || '未命名 SKU'" />
|
||||
<t-cell title="SKU 编码" :note="selectedSku.code || '无编码'" />
|
||||
<t-cell v-if="selectedSku.barcode" title="SKU 条码" :note="selectedSku.barcode" />
|
||||
<t-cell title="库存管理" :note="selectedSku.stockEnabled ? '启用' : '关闭'" />
|
||||
<t-cell title="允许小数数量" :note="selectedSku.allowDecimalQuantity ? '允许' : '不允许'" />
|
||||
<t-cell v-if="selectedSku.stockEnabled" title="最低库存" :note="`${getProductQuantityText(selectedSku.minStockQuantity)} 基础单位`" />
|
||||
<t-cell v-if="selectedSku.remark" title="备注" :note="Text.display(selectedSku.remark)" />
|
||||
</t-cell-group>
|
||||
<div class="media-wrap">
|
||||
<attachment-selector
|
||||
v-if="skuPhotoItemList.length"
|
||||
:items="skuPhotoItemList"
|
||||
title="SKU 图片"
|
||||
readonly
|
||||
/>
|
||||
</div>
|
||||
<div class="unit">
|
||||
<div class="header">
|
||||
<strong>销售单位</strong>
|
||||
<span>采购、销售和库存操作共用</span>
|
||||
<bottom-popup
|
||||
v-model="skuDetailVisible"
|
||||
title="SKU 详情"
|
||||
height="min(80vh, 48rem)"
|
||||
left-button-text="关闭"
|
||||
right-button-text=""
|
||||
:z-index="skuDetailPopupZIndex"
|
||||
:overlay-props="{ zIndex: skuDetailPopupZIndex - 1 }"
|
||||
@left-button-click="closeSkuDetail"
|
||||
>
|
||||
<div v-if="selectedSku" class="sku-popup">
|
||||
<t-cell-group>
|
||||
<t-cell title="明细名称" :note="selectedSku.name || '未命名 SKU'" />
|
||||
<t-cell title="SKU 编码" :note="selectedSku.code || '无编码'" />
|
||||
<t-cell v-if="selectedSku.barcode" title="SKU 条码" :note="selectedSku.barcode" />
|
||||
<t-cell title="库存管理" :note="selectedSku.stockEnabled ? '启用' : '关闭'" />
|
||||
<t-cell title="允许小数数量" :note="selectedSku.allowDecimalQuantity ? '允许' : '不允许'" />
|
||||
<t-cell v-if="selectedSku.stockEnabled" title="最低库存" :note="`${getProductQuantityText(selectedSku.minStockQuantity)} 基础单位`" />
|
||||
<t-cell v-if="selectedSku.remark" title="备注" :note="Text.display(selectedSku.remark)" />
|
||||
</t-cell-group>
|
||||
<div class="media-wrap">
|
||||
<attachment-selector
|
||||
v-if="skuPhotoItemList.length"
|
||||
:items="skuPhotoItemList"
|
||||
title="SKU 图片"
|
||||
readonly
|
||||
/>
|
||||
</div>
|
||||
<div class="unit">
|
||||
<div class="header">
|
||||
<strong>销售单位</strong>
|
||||
<span>采购、销售和库存操作共用</span>
|
||||
</div>
|
||||
<product-sku-unit-list v-if="selectedSku.unitList?.length" :unit-list="selectedSku.unitList" />
|
||||
<center-tips v-else :content="'暂无销售单位'" />
|
||||
</div>
|
||||
<product-sku-unit-list v-if="selectedSku.unitList?.length" :unit-list="selectedSku.unitList" />
|
||||
<center-tips v-else :content="'暂无销售单位'" />
|
||||
</div>
|
||||
</div>
|
||||
</bottom-popup>
|
||||
</bottom-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -311,7 +315,7 @@ onMounted(async () => {
|
||||
.product-detail {
|
||||
gap: 1rem;
|
||||
display: flex;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 1rem 0;
|
||||
padding: 0 0 1rem 0;
|
||||
flex-direction: column;
|
||||
|
||||
.skus {
|
||||
|
||||
+207
-203
@@ -1,216 +1,220 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(savePermissionCode)"
|
||||
@click="save"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="保存"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="savePermissionCode" class="product-edit">
|
||||
<t-form class="form card" label-width="6rem" v-entrance-transition>
|
||||
<t-form-item label="产品编码" required-mark help="使用英语、拼音或唯一数字">
|
||||
<t-input v-model="form.code" borderless maxlength="64" placeholder="门店内唯一编码" />
|
||||
</t-form-item>
|
||||
<t-form-item label="产品名称" required-mark>
|
||||
<t-input v-model="form.name" borderless maxlength="128" placeholder="请输入产品名称" />
|
||||
</t-form-item>
|
||||
<t-form-item label="产品类型" arrow content-align="right" @click="openTypePicker">
|
||||
<span class="picker-text" v-text="getProductTypeText(form.productType)" />
|
||||
</t-form-item>
|
||||
<t-form-item label="产品分类" arrow content-align="right" @click="openCategoryPicker">
|
||||
<span class="picker-text" v-text="selectedCategoryName" />
|
||||
</t-form-item>
|
||||
<t-form-item label="库存管理" content-align="right">
|
||||
<t-switch v-model="form.stockEnabled" size="small" :disabled="form.productType === 'SERVICE'" />
|
||||
</t-form-item>
|
||||
<t-form-item label="状态" arrow content-align="right" @click="openStatusPicker">
|
||||
<span class="picker-text" v-text="getProductStatusText(form.status)" />
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea v-model="form.remark" borderless maxlength="255" autosize placeholder="可填写产品说明" />
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<attachment-selector
|
||||
v-model:items="attachmentItemList"
|
||||
title="产品公共图片及附件"
|
||||
:busy="isAttachmentUploading"
|
||||
@select="handleAttachmentSelected($event.files, $event.source)"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="纯色封面" label-width="8rem" content-align="right">
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
size="extra-small"
|
||||
variant="outline"
|
||||
class="color-trigger"
|
||||
:disabled="isAttachmentUploading"
|
||||
@click="openCoverColorPicker"
|
||||
>
|
||||
<div class="content">
|
||||
<span
|
||||
class="swatch"
|
||||
:class="{ 'no-color': !solidColorCoverColor }"
|
||||
:style="{ background: solidColorCoverColor || undefined }"
|
||||
/>
|
||||
<span v-text="solidColorCoverColor || '选择颜色'" />
|
||||
</div>
|
||||
</t-button>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
|
||||
<card-container title="产品规格" description="无多规格产品无需配置规格;有规格时每条 SKU 明细必须覆盖全部规格项" v-entrance-transition>
|
||||
<div class="spec-list">
|
||||
<t-form v-for="(spec, specIndex) in form.specList" :key="spec.clientKey" class="form spec">
|
||||
<t-form-item label="名称" label-width="2.5rem">
|
||||
<t-input
|
||||
class="name"
|
||||
v-model="spec.name"
|
||||
borderless
|
||||
maxlength="32"
|
||||
placeholder="如 颜色、尺寸"
|
||||
v-if="userStore.hasPermissions(savePermissionCode)"
|
||||
@click="save"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="保存"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="savePermissionCode" class="product-edit">
|
||||
<t-form class="form card" label-width="6rem" v-entrance-transition>
|
||||
<t-form-item label="产品编码" required-mark help="使用英语、拼音或唯一数字">
|
||||
<t-input v-model="form.code" borderless maxlength="64" placeholder="门店内唯一编码" />
|
||||
</t-form-item>
|
||||
<t-form-item label="产品名称" required-mark>
|
||||
<t-input v-model="form.name" borderless maxlength="128" placeholder="请输入产品名称" />
|
||||
</t-form-item>
|
||||
<t-form-item label="产品类型" arrow content-align="right" @click="openTypePicker">
|
||||
<span class="picker-text" v-text="getProductTypeText(form.productType)" />
|
||||
</t-form-item>
|
||||
<t-form-item label="产品分类" arrow content-align="right" @click="openCategoryPicker">
|
||||
<span class="picker-text" v-text="selectedCategoryName" />
|
||||
</t-form-item>
|
||||
<t-form-item label="库存管理" content-align="right">
|
||||
<t-switch v-model="form.stockEnabled" size="small" :disabled="form.productType === 'SERVICE'" />
|
||||
</t-form-item>
|
||||
<t-form-item label="状态" arrow content-align="right" @click="openStatusPicker">
|
||||
<span class="picker-text" v-text="getProductStatusText(form.status)" />
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea v-model="form.remark" borderless maxlength="255" autosize placeholder="可填写产品说明" />
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<attachment-selector
|
||||
v-model:items="attachmentItemList"
|
||||
title="产品公共图片及附件"
|
||||
:busy="isAttachmentUploading"
|
||||
@select="handleAttachmentSelected($event.files, $event.source)"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="纯色封面" label-width="8rem" content-align="right">
|
||||
<t-button
|
||||
v-if="!spec.id"
|
||||
theme="danger"
|
||||
variant="text"
|
||||
size="extra-small"
|
||||
content="删除"
|
||||
@click="removeSpec(specIndex)"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item v-if="getNamedSpecValues(spec).length" label-width="0">
|
||||
<div class="tags">
|
||||
<t-tag
|
||||
v-for="value in getNamedSpecValues(spec)"
|
||||
:key="value.clientKey"
|
||||
class="tag"
|
||||
variant="light-outline"
|
||||
closable
|
||||
@close="removeSpecValue(spec, spec.valueList.indexOf(value))"
|
||||
>
|
||||
<t-input v-model.trim="value.name" class="value-name" borderless maxlength="32" />
|
||||
</t-tag>
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item label="规格值" label-width="3.5rem">
|
||||
<t-input
|
||||
v-model.trim="specValueDraftMap[spec.clientKey]"
|
||||
borderless
|
||||
maxlength="32"
|
||||
placeholder="输入规格值"
|
||||
variant="outline"
|
||||
class="color-trigger"
|
||||
:disabled="isAttachmentUploading"
|
||||
@click="openCoverColorPicker"
|
||||
>
|
||||
<template #suffix-icon>
|
||||
<t-button
|
||||
size="extra-small"
|
||||
theme="light"
|
||||
content="添加"
|
||||
@click="addSpecValue(spec)"
|
||||
<div class="content">
|
||||
<span
|
||||
class="swatch"
|
||||
:class="{ 'no-color': !solidColorCoverColor }"
|
||||
:style="{ background: solidColorCoverColor || undefined }"
|
||||
/>
|
||||
</template>
|
||||
</t-input>
|
||||
<span v-text="solidColorCoverColor || '选择颜色'" />
|
||||
</div>
|
||||
</t-button>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-button
|
||||
class="add"
|
||||
size="small"
|
||||
theme="primary"
|
||||
variant="dashed"
|
||||
content="添加规格项"
|
||||
@click="addSpec"
|
||||
|
||||
<card-container title="产品规格" description="无多规格产品无需配置规格;有规格时每条 SKU 明细必须覆盖全部规格项" v-entrance-transition>
|
||||
<div class="spec-list">
|
||||
<t-form v-for="(spec, specIndex) in form.specList" :key="spec.clientKey" class="form spec">
|
||||
<t-form-item label="名称" label-width="2.5rem">
|
||||
<t-input
|
||||
class="name"
|
||||
v-model="spec.name"
|
||||
borderless
|
||||
maxlength="32"
|
||||
placeholder="如 颜色、尺寸"
|
||||
/>
|
||||
<t-button
|
||||
v-if="!spec.id"
|
||||
theme="danger"
|
||||
variant="text"
|
||||
size="extra-small"
|
||||
content="删除"
|
||||
@click="removeSpec(specIndex)"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item v-if="getNamedSpecValues(spec).length" label-width="0">
|
||||
<div class="tags">
|
||||
<t-tag
|
||||
v-for="value in getNamedSpecValues(spec)"
|
||||
:key="value.clientKey"
|
||||
class="tag"
|
||||
variant="light-outline"
|
||||
closable
|
||||
@close="removeSpecValue(spec, spec.valueList.indexOf(value))"
|
||||
>
|
||||
<t-input v-model.trim="value.name" class="value-name" borderless maxlength="32" />
|
||||
</t-tag>
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item label="规格值" label-width="3.5rem">
|
||||
<t-input
|
||||
v-model.trim="specValueDraftMap[spec.clientKey]"
|
||||
borderless
|
||||
maxlength="32"
|
||||
placeholder="输入规格值"
|
||||
>
|
||||
<template #suffix-icon>
|
||||
<t-button
|
||||
size="extra-small"
|
||||
theme="light"
|
||||
content="添加"
|
||||
@click="addSpecValue(spec)"
|
||||
/>
|
||||
</template>
|
||||
</t-input>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-button
|
||||
class="add"
|
||||
size="small"
|
||||
theme="primary"
|
||||
variant="dashed"
|
||||
content="添加规格项"
|
||||
@click="addSpec"
|
||||
/>
|
||||
</div>
|
||||
</card-container>
|
||||
<card-container
|
||||
class="sku-wrap"
|
||||
title="SKU 明细"
|
||||
description="每条 SKU 明细都是独立的销售、库存和履约单元;生成后可移除不需要的组合,点列表项配置具体内容"
|
||||
v-entrance-transition
|
||||
>
|
||||
<div class="content-wrap">
|
||||
<t-cell-group theme="card">
|
||||
<t-cell title="销售单位">
|
||||
<template #note>
|
||||
<t-button
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
content="统一配置销售单位"
|
||||
:disabled="!form.skuList.length"
|
||||
@click="openBatchUnitEditor"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="生成 SKU">
|
||||
<template #note>
|
||||
<t-button
|
||||
theme="primary"
|
||||
size="extra-small"
|
||||
:content="generateSkuButtonText"
|
||||
:disabled="!canGenerateSku"
|
||||
@click="regenerateSkuList"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="当前 SKU" :note="`${form.skuList.length} 个`" />
|
||||
</t-cell-group>
|
||||
<t-cell-group v-if="form.skuList.length" theme="card" class="sku-list fix-last-cell-line">
|
||||
<product-sku-editor
|
||||
v-for="(sku, skuIndex) in form.skuList"
|
||||
:key="sku.clientKey"
|
||||
:product-type="form.productType"
|
||||
v-model:sku="form.skuList[skuIndex]"
|
||||
:sku-index="skuIndex"
|
||||
:spec-list="form.specList"
|
||||
@configure-units="openUnitEditor(sku)"
|
||||
@remove="removeSku(skuIndex)"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<div v-else class="load-state" v-text="form.specList.length ? '请先添加规格值,再生成 SKU 组合' : '正在准备默认 SKU'" />
|
||||
</div>
|
||||
</card-container>
|
||||
<t-popup v-model="typePickerVisible" placement="bottom">
|
||||
<t-picker v-model="typeDraft" :columns="productTypeOptions" title="产品类型" @cancel="typePickerVisible = false" @confirm="confirmType" />
|
||||
</t-popup>
|
||||
<t-popup v-model="categoryPickerVisible" placement="bottom">
|
||||
<t-picker v-model="categoryDraft" :columns="categoryOptions" title="产品分类" @cancel="categoryPickerVisible = false" @confirm="confirmCategory" />
|
||||
</t-popup>
|
||||
<t-popup v-model="statusPickerVisible" placement="bottom">
|
||||
<t-picker v-model="statusDraft" :columns="statusOptions" title="产品状态" @cancel="statusPickerVisible = false" @confirm="confirmStatus" />
|
||||
</t-popup>
|
||||
<product-sku-unit-editor
|
||||
v-model="unitEditorVisible"
|
||||
:product-type="form.productType"
|
||||
v-model:sku="editingSku"
|
||||
:spec-list="form.specList"
|
||||
@close="closeUnitEditor"
|
||||
/>
|
||||
<product-sku-unit-batch-editor
|
||||
v-model="batchUnitEditorVisible"
|
||||
v-model:unit-list="batchUnitList"
|
||||
v-model:base-unit-migration-ratio-text="batchBaseUnitMigrationRatioText"
|
||||
:product-type="form.productType"
|
||||
:sku-count="form.skuList.length"
|
||||
@apply="applyBatchUnitTemplate"
|
||||
@close="closeBatchUnitEditor"
|
||||
/>
|
||||
<bottom-popup
|
||||
v-model="coverColorPickerVisible"
|
||||
title="颜色选择"
|
||||
:right-button-text="isAttachmentUploading ? '上传中' : '确定'"
|
||||
@left-button-click="cancelCoverColorPicker"
|
||||
@right-button-click="confirmCoverColorPicker"
|
||||
>
|
||||
<t-color-picker v-if="coverColorPickerVisible" v-model="coverColorDraft" format="HEX" type="multiple" :swatch-colors="colorSwatchList" @palette-bar-change="updateCoverColorDraftFromPalette" />
|
||||
</bottom-popup>
|
||||
</div>
|
||||
</card-container>
|
||||
<card-container
|
||||
class="sku-wrap"
|
||||
title="SKU 明细"
|
||||
description="每条 SKU 明细都是独立的销售、库存和履约单元;生成后可移除不需要的组合,点列表项配置具体内容"
|
||||
v-entrance-transition
|
||||
>
|
||||
<div class="content-wrap">
|
||||
<t-cell-group theme="card">
|
||||
<t-cell title="销售单位">
|
||||
<template #note>
|
||||
<t-button
|
||||
variant="outline"
|
||||
size="extra-small"
|
||||
content="统一配置销售单位"
|
||||
:disabled="!form.skuList.length"
|
||||
@click="openBatchUnitEditor"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="生成 SKU">
|
||||
<template #note>
|
||||
<t-button
|
||||
theme="primary"
|
||||
size="extra-small"
|
||||
:content="generateSkuButtonText"
|
||||
:disabled="!canGenerateSku"
|
||||
@click="regenerateSkuList"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="当前 SKU" :note="`${form.skuList.length} 个`" />
|
||||
</t-cell-group>
|
||||
<t-cell-group v-if="form.skuList.length" theme="card" class="sku-list fix-last-cell-line">
|
||||
<product-sku-editor
|
||||
v-for="(sku, skuIndex) in form.skuList"
|
||||
:key="sku.clientKey"
|
||||
:product-type="form.productType"
|
||||
v-model:sku="form.skuList[skuIndex]"
|
||||
:sku-index="skuIndex"
|
||||
:spec-list="form.specList"
|
||||
@configure-units="openUnitEditor(sku)"
|
||||
@remove="removeSku(skuIndex)"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<div v-else class="load-state" v-text="form.specList.length ? '请先添加规格值,再生成 SKU 组合' : '正在准备默认 SKU'" />
|
||||
</div>
|
||||
</card-container>
|
||||
<t-popup v-model="typePickerVisible" placement="bottom">
|
||||
<t-picker v-model="typeDraft" :columns="productTypeOptions" title="产品类型" @cancel="typePickerVisible = false" @confirm="confirmType" />
|
||||
</t-popup>
|
||||
<t-popup v-model="categoryPickerVisible" placement="bottom">
|
||||
<t-picker v-model="categoryDraft" :columns="categoryOptions" title="产品分类" @cancel="categoryPickerVisible = false" @confirm="confirmCategory" />
|
||||
</t-popup>
|
||||
<t-popup v-model="statusPickerVisible" placement="bottom">
|
||||
<t-picker v-model="statusDraft" :columns="statusOptions" title="产品状态" @cancel="statusPickerVisible = false" @confirm="confirmStatus" />
|
||||
</t-popup>
|
||||
<product-sku-unit-editor
|
||||
v-model="unitEditorVisible"
|
||||
:product-type="form.productType"
|
||||
v-model:sku="editingSku"
|
||||
:spec-list="form.specList"
|
||||
@close="closeUnitEditor"
|
||||
/>
|
||||
<product-sku-unit-batch-editor
|
||||
v-model="batchUnitEditorVisible"
|
||||
v-model:unit-list="batchUnitList"
|
||||
v-model:base-unit-migration-ratio-text="batchBaseUnitMigrationRatioText"
|
||||
:product-type="form.productType"
|
||||
:sku-count="form.skuList.length"
|
||||
@apply="applyBatchUnitTemplate"
|
||||
@close="closeBatchUnitEditor"
|
||||
/>
|
||||
<bottom-popup
|
||||
v-model="coverColorPickerVisible"
|
||||
title="颜色选择"
|
||||
:right-button-text="isAttachmentUploading ? '上传中' : '确定'"
|
||||
@left-button-click="cancelCoverColorPicker"
|
||||
@right-button-click="confirmCoverColorPicker"
|
||||
>
|
||||
<t-color-picker v-if="coverColorPickerVisible" v-model="coverColorDraft" format="HEX" type="multiple" :swatch-colors="colorSwatchList" @palette-bar-change="updateCoverColorDraftFromPalette" />
|
||||
</bottom-popup>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1131,7 +1135,7 @@ onMounted(async () => {
|
||||
.product-edit {
|
||||
gap: 1rem;
|
||||
display: flex;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 1rem;
|
||||
padding: 0 0 1rem;
|
||||
flex-direction: column;
|
||||
|
||||
.form {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main ref="productListRef" v-can="permissionCodes.product.read" class="page-content scroll list">
|
||||
<main ref="productListRef" v-can="permissionCodes.product.read" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -1,151 +1,155 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="批量入库"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(permissionCodes.productStock.create)"
|
||||
:disabled="!canSubmit"
|
||||
@click="submit"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
:content="isSaving ? '提交中' : '提交'"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="permissionCodes.productStock.create" class="product-stock-batch-configure">
|
||||
<t-form class="form card" label-width="5rem" v-entrance-transition>
|
||||
<t-form-item label="入库备注" required-mark>
|
||||
<div class="remark-wrap">
|
||||
<t-input
|
||||
v-model="productStockBatchStore.remark"
|
||||
:disabled="isSaving"
|
||||
borderless
|
||||
maxlength="500"
|
||||
autosize
|
||||
placeholder="本批次入库备注"
|
||||
@update:model-value="invalidateRequestNo"
|
||||
/>
|
||||
<t-button
|
||||
type="button"
|
||||
size="extra-small"
|
||||
variant="outline"
|
||||
:content="quickRemarkText"
|
||||
:disabled="isSaving"
|
||||
@click="applyQuickRemark"
|
||||
/>
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<attachment-selector
|
||||
v-model:items="productStockBatchStore.attachmentItems"
|
||||
:upload="uploadPhotos"
|
||||
:busy="isSaving"
|
||||
title="共有入库记录(无专有记录时使用)"
|
||||
@update:items="invalidateRequestNo"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-form
|
||||
v-if="productStockBatchStore.selectedItemList.length"
|
||||
class="items form"
|
||||
label-width="0"
|
||||
v-entrance-transition
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="批量入库"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<t-form-item
|
||||
v-for="item in productStockBatchStore.selectedItemList"
|
||||
:key="item.sku.id"
|
||||
class="item"
|
||||
label-width="0"
|
||||
>
|
||||
<div class="content">
|
||||
<div class="main">
|
||||
<div class="left">
|
||||
<t-image
|
||||
v-if="getProductPhotoURL(item.sku)"
|
||||
:src="getProductPhotoURL(item.sku)"
|
||||
:alt="item.productName || '产品图片'"
|
||||
fit="cover"
|
||||
class="avatar"
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(permissionCodes.productStock.create)"
|
||||
:disabled="!canSubmit"
|
||||
@click="submit"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
:content="isSaving ? '提交中' : '提交'"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.productStock.create" class="product-stock-batch-configure">
|
||||
<t-form class="form card" label-width="5rem" v-entrance-transition>
|
||||
<t-form-item label="入库备注" required-mark>
|
||||
<div class="remark-wrap">
|
||||
<t-input
|
||||
v-model="productStockBatchStore.remark"
|
||||
:disabled="isSaving"
|
||||
borderless
|
||||
maxlength="500"
|
||||
autosize
|
||||
placeholder="本批次入库备注"
|
||||
@update:model-value="invalidateRequestNo"
|
||||
/>
|
||||
<div
|
||||
v-else
|
||||
class="avatar fallback"
|
||||
v-text="(item.productName || item.sku.name || '产').slice(0, 1)"
|
||||
<t-button
|
||||
type="button"
|
||||
size="extra-small"
|
||||
variant="outline"
|
||||
:content="quickRemarkText"
|
||||
:disabled="isSaving"
|
||||
@click="applyQuickRemark"
|
||||
/>
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="header">
|
||||
<div class="title">
|
||||
<div class="name clip-text" v-text="item.productName || '未命名产品'" />
|
||||
<t-tag
|
||||
v-if="!isDefaultSku(item) && item.sku.name"
|
||||
size="small"
|
||||
theme="primary"
|
||||
variant="light-outline"
|
||||
:content="item.sku.name"
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<attachment-selector
|
||||
v-model:items="productStockBatchStore.attachmentItems"
|
||||
:upload="uploadPhotos"
|
||||
:busy="isSaving"
|
||||
title="共有入库记录(无专有记录时使用)"
|
||||
@update:items="invalidateRequestNo"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-form
|
||||
v-if="productStockBatchStore.selectedItemList.length"
|
||||
class="items form"
|
||||
label-width="0"
|
||||
v-entrance-transition
|
||||
>
|
||||
<t-form-item
|
||||
v-for="item in productStockBatchStore.selectedItemList"
|
||||
:key="item.sku.id"
|
||||
class="item"
|
||||
label-width="0"
|
||||
>
|
||||
<div class="content">
|
||||
<div class="main">
|
||||
<div class="left">
|
||||
<t-image
|
||||
v-if="getProductPhotoURL(item.sku)"
|
||||
:src="getProductPhotoURL(item.sku)"
|
||||
:alt="item.productName || '产品图片'"
|
||||
fit="cover"
|
||||
class="avatar"
|
||||
/>
|
||||
<div
|
||||
v-else
|
||||
class="avatar fallback"
|
||||
v-text="(item.productName || item.sku.name || '产').slice(0, 1)"
|
||||
/>
|
||||
</div>
|
||||
<t-button
|
||||
theme="danger"
|
||||
variant="text"
|
||||
size="extra-small"
|
||||
content="移除"
|
||||
:disabled="isSaving"
|
||||
@click.stop="removeItem(item.sku.id || '')"
|
||||
/>
|
||||
</div>
|
||||
<div class="input">
|
||||
<t-stepper
|
||||
v-model="item.quantity"
|
||||
class="quantity"
|
||||
:max="Number.MAX_SAFE_INTEGER"
|
||||
:min="0"
|
||||
size="large"
|
||||
:step="getProductQuantityStep(item.sku)"
|
||||
:integer="!item.sku.allowDecimalQuantity"
|
||||
:disabled="isSaving"
|
||||
theme="outline"
|
||||
@change="invalidateRequestNo"
|
||||
/>
|
||||
<t-button
|
||||
size="extra-small"
|
||||
variant="outline"
|
||||
:content="getSelectedUnitName(item)"
|
||||
:disabled="isSaving"
|
||||
@click.stop="openUnitPicker(item)"
|
||||
/>
|
||||
<t-button
|
||||
size="extra-small"
|
||||
variant="outline"
|
||||
content="专有入库记录"
|
||||
:disabled="isSaving"
|
||||
:aria-expanded="isAttachmentVisible(item.sku.id || '')"
|
||||
@click.stop="toggleAttachmentVisibility(item.sku.id || '')"
|
||||
/>
|
||||
<div class="right">
|
||||
<div class="header">
|
||||
<div class="title">
|
||||
<div class="name clip-text" v-text="item.productName || '未命名产品'" />
|
||||
<t-tag
|
||||
v-if="!isDefaultSku(item) && item.sku.name"
|
||||
size="small"
|
||||
theme="primary"
|
||||
variant="light-outline"
|
||||
:content="item.sku.name"
|
||||
/>
|
||||
</div>
|
||||
<t-button
|
||||
theme="danger"
|
||||
variant="text"
|
||||
size="extra-small"
|
||||
content="移除"
|
||||
:disabled="isSaving"
|
||||
@click.stop="removeItem(item.sku.id || '')"
|
||||
/>
|
||||
</div>
|
||||
<div class="input">
|
||||
<t-stepper
|
||||
v-model="item.quantity"
|
||||
class="quantity"
|
||||
:max="Number.MAX_SAFE_INTEGER"
|
||||
:min="0"
|
||||
size="large"
|
||||
:step="getProductQuantityStep(item.sku)"
|
||||
:integer="!item.sku.allowDecimalQuantity"
|
||||
:disabled="isSaving"
|
||||
theme="outline"
|
||||
@change="invalidateRequestNo"
|
||||
/>
|
||||
<t-button
|
||||
size="extra-small"
|
||||
variant="outline"
|
||||
:content="getSelectedUnitName(item)"
|
||||
:disabled="isSaving"
|
||||
@click.stop="openUnitPicker(item)"
|
||||
/>
|
||||
<t-button
|
||||
size="extra-small"
|
||||
variant="outline"
|
||||
content="专有入库记录"
|
||||
:disabled="isSaving"
|
||||
:aria-expanded="isAttachmentVisible(item.sku.id || '')"
|
||||
@click.stop="toggleAttachmentVisibility(item.sku.id || '')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<attachment-selector
|
||||
v-if="isAttachmentVisible(item.sku.id || '')"
|
||||
v-model:items="item.attachmentItems"
|
||||
:upload="uploadPhotos"
|
||||
title=""
|
||||
:busy="isSaving"
|
||||
@update:items="invalidateRequestNo"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<attachment-selector
|
||||
v-if="isAttachmentVisible(item.sku.id || '')"
|
||||
v-model:items="item.attachmentItems"
|
||||
:upload="uploadPhotos"
|
||||
title=""
|
||||
:busy="isSaving"
|
||||
@update:items="invalidateRequestNo"
|
||||
/>
|
||||
</div>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-empty v-else description="没有已选 SKU,请返回重新选择" />
|
||||
<t-popup v-model="unitPickerVisible" placement="bottom">
|
||||
<t-picker v-model="unitPickerDraft" :columns="unitPickerOptions" title="选择入库单位" @cancel="unitPickerVisible = false" @confirm="confirmUnitPicker" />
|
||||
</t-popup>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-empty v-else description="没有已选 SKU,请返回重新选择" />
|
||||
<t-popup v-model="unitPickerVisible" placement="bottom">
|
||||
<t-picker v-model="unitPickerDraft" :columns="unitPickerOptions" title="选择入库单位" @cancel="unitPickerVisible = false" @confirm="confirmUnitPicker" />
|
||||
</t-popup>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -444,7 +448,7 @@ onActivated(() => {
|
||||
<style scoped lang="less">
|
||||
.product-stock-batch-configure {
|
||||
gap: 1rem;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 1rem 0;
|
||||
padding: 0 0 1rem 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main v-can="permissionCodes.productStock.create" class="page-content scroll list">
|
||||
<main v-can="permissionCodes.productStock.create" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="list-wrap empty-cell-title-margin pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -1,105 +1,109 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="库存详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div v-can="permissionCodes.productStock.read" class="product-stock-detail">
|
||||
<t-loading v-if="isLoading" class="loading" size="32px" />
|
||||
<template v-else-if="product && sku && stock">
|
||||
<product-profile :product="product" v-entrance-transition>
|
||||
<template #tags>
|
||||
<t-tag :content="sku?.specSummary || sku?.name || '默认 SKU'" variant="light-outline" theme="primary" />
|
||||
<t-tag :content="getStockStatusText(stock)" variant="light-outline" :theme="getStockTheme(stock)" />
|
||||
</template>
|
||||
</product-profile>
|
||||
<t-cell-group theme="card" title="库存" v-entrance-transition>
|
||||
<t-cell v-if="1 < unitList.length" class="units" title="显示单位">
|
||||
<template #note>
|
||||
<div class="options" role="group" aria-label="选择库存展示单位">
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="库存详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.productStock.read" class="product-stock-detail">
|
||||
<t-loading v-if="isLoading" class="loading" size="32px" />
|
||||
<template v-else-if="product && sku && stock">
|
||||
<product-profile :product="product" v-entrance-transition>
|
||||
<template #tags>
|
||||
<t-tag :content="sku?.specSummary || sku?.name || '默认 SKU'" variant="light-outline" theme="primary" />
|
||||
<t-tag :content="getStockStatusText(stock)" variant="light-outline" :theme="getStockTheme(stock)" />
|
||||
</template>
|
||||
</product-profile>
|
||||
<t-cell-group theme="card" title="库存" v-entrance-transition>
|
||||
<t-cell v-if="1 < unitList.length" class="units" title="显示单位">
|
||||
<template #note>
|
||||
<div class="options" role="group" aria-label="选择库存展示单位">
|
||||
<t-button
|
||||
v-for="item in unitList"
|
||||
:key="item.id"
|
||||
size="extra-small"
|
||||
:theme="selectedUnit?.id === item.id ? 'primary' : 'default'"
|
||||
:variant="selectedUnit?.id === item.id ? 'base' : 'outline'"
|
||||
:aria-label="`切换到${item.name || '未命名单位'}`"
|
||||
:aria-pressed="selectedUnit?.id === item.id"
|
||||
@click="selectUnit(item.id || '')"
|
||||
>
|
||||
<span v-text="item.name || '未命名单位'" />
|
||||
</t-button>
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell class="empty-cell-title-margin">
|
||||
<template #title>
|
||||
<span></span>
|
||||
</template>
|
||||
<template #description>
|
||||
<div class="stock">
|
||||
<div class="main">
|
||||
<span class="label">库存</span>
|
||||
<div class="value">
|
||||
<strong class="text" v-text="displayStock.onHandQuantity" />
|
||||
<span class="unit" v-text="selectedUnitName" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="available">
|
||||
<span class="label">可用</span>
|
||||
<strong class="value" v-text="displayStock.availableQuantity" />
|
||||
<span class="unit" v-text="selectedUnitName" />
|
||||
</div>
|
||||
<div class="reserved">
|
||||
<span class="label">预占</span>
|
||||
<strong class="value" v-text="displayStock.reservedQuantity" />
|
||||
<span class="unit" v-text="selectedUnitName" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
<product-stock-package-summary :sku="sku" :stock="stock" />
|
||||
<t-cell title="查看库存流水" arrow @click="openRecordList" />
|
||||
<t-cell v-if="0 < Number(stock.reservedQuantity || 0)" title="查看库存预占流水" arrow @click="openReservedRecordList" />
|
||||
</t-cell-group>
|
||||
<card-container
|
||||
v-if="canOperate && sku?.status === 'ACTIVE' && sku.stockEnabled"
|
||||
class="actions-wrap"
|
||||
title="库存操作"
|
||||
description="所有操作必须选择业务单位、上传照片并填写备注"
|
||||
v-entrance-transition
|
||||
>
|
||||
<div class="actions">
|
||||
<t-button
|
||||
v-for="item in unitList"
|
||||
:key="item.id"
|
||||
size="extra-small"
|
||||
:theme="selectedUnit?.id === item.id ? 'primary' : 'default'"
|
||||
:variant="selectedUnit?.id === item.id ? 'base' : 'outline'"
|
||||
:aria-label="`切换到${item.name || '未命名单位'}`"
|
||||
:aria-pressed="selectedUnit?.id === item.id"
|
||||
@click="selectUnit(item.id || '')"
|
||||
v-for="item in operationList"
|
||||
:key="item.type"
|
||||
class="action"
|
||||
:theme="item.theme"
|
||||
block
|
||||
@click="openOperation(item.type)"
|
||||
>
|
||||
<span v-text="item.name || '未命名单位'" />
|
||||
<template #icon>
|
||||
<t-icon :name="item.icon" size="1.25rem" />
|
||||
</template>
|
||||
<span v-text="item.text" />
|
||||
</t-button>
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell class="empty-cell-title-margin">
|
||||
<template #title>
|
||||
<span></span>
|
||||
</template>
|
||||
<template #description>
|
||||
<div class="stock">
|
||||
<div class="main">
|
||||
<span class="label">库存</span>
|
||||
<div class="value">
|
||||
<strong class="text" v-text="displayStock.onHandQuantity" />
|
||||
<span class="unit" v-text="selectedUnitName" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="available">
|
||||
<span class="label">可用</span>
|
||||
<strong class="value" v-text="displayStock.availableQuantity" />
|
||||
<span class="unit" v-text="selectedUnitName" />
|
||||
</div>
|
||||
<div class="reserved">
|
||||
<span class="label">预占</span>
|
||||
<strong class="value" v-text="displayStock.reservedQuantity" />
|
||||
<span class="unit" v-text="selectedUnitName" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
<product-stock-package-summary :sku="sku" :stock="stock" />
|
||||
<t-cell title="查看库存流水" arrow @click="openRecordList" />
|
||||
<t-cell v-if="0 < Number(stock.reservedQuantity || 0)" title="查看库存预占流水" arrow @click="openReservedRecordList" />
|
||||
</t-cell-group>
|
||||
<card-container
|
||||
v-if="canOperate && sku?.status === 'ACTIVE' && sku.stockEnabled"
|
||||
class="actions-wrap"
|
||||
title="库存操作"
|
||||
description="所有操作必须选择业务单位、上传照片并填写备注"
|
||||
v-entrance-transition
|
||||
>
|
||||
<div class="actions">
|
||||
<t-button
|
||||
v-for="item in operationList"
|
||||
:key="item.type"
|
||||
class="action"
|
||||
:theme="item.theme"
|
||||
block
|
||||
@click="openOperation(item.type)"
|
||||
>
|
||||
<template #icon>
|
||||
<t-icon :name="item.icon" size="1.25rem" />
|
||||
</template>
|
||||
<span v-text="item.text" />
|
||||
</t-button>
|
||||
</div>
|
||||
</card-container>
|
||||
</template>
|
||||
<t-empty v-else description="库存或产品不存在" />
|
||||
<product-stock-operation-popup
|
||||
v-if="product && sku && stock"
|
||||
v-model:visible="operationVisible"
|
||||
:product="product"
|
||||
:sku="sku"
|
||||
:stock="stock"
|
||||
:operation="operationType"
|
||||
@success="loadAll"
|
||||
/>
|
||||
</card-container>
|
||||
</template>
|
||||
<t-empty v-else description="库存或产品不存在" />
|
||||
<product-stock-operation-popup
|
||||
v-if="product && sku && stock"
|
||||
v-model:visible="operationVisible"
|
||||
:product="product"
|
||||
:sku="sku"
|
||||
:stock="stock"
|
||||
:operation="operationType"
|
||||
@success="loadAll"
|
||||
/>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -264,7 +268,7 @@ onMounted(async () => {
|
||||
.product-stock-detail {
|
||||
gap: 1rem;
|
||||
display: flex;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 1rem;
|
||||
padding: 0 0 1rem;
|
||||
flex-direction: column;
|
||||
|
||||
.loading {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main ref="productStockListRef" v-can="permissionCodes.productStock.read" class="page-content scroll list">
|
||||
<main ref="productStockListRef" v-can="permissionCodes.productStock.read" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="list-wrap empty-cell-title-margin pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -1,132 +1,136 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="库存流水详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div v-can="permissionCodes.productStock.read" class="product-stock-record-detail">
|
||||
<t-loading v-if="isLoading" class="loading" size="32px" />
|
||||
<template v-else-if="record">
|
||||
<section class="snapshot-head" v-entrance-transition>
|
||||
<div class="eyebrow">库存 SKU 快照</div>
|
||||
<h2 v-text="record.productNameSnapshot || '未命名产品'" />
|
||||
<product-sku-tags
|
||||
class="sku"
|
||||
:product-name="record.productNameSnapshot"
|
||||
:snapshot="record.skuSpecSnapshot"
|
||||
:fallback="record.specSummarySnapshot || record.skuNameSnapshot || '默认 SKU'"
|
||||
:unit="record.unitSnapshot"
|
||||
/>
|
||||
<div class="meta">
|
||||
<span v-text="record.skuCodeSnapshot || '无 SKU 编码'" />
|
||||
<t-tag size="small" variant="light-outline" :theme="getOperationTheme(record.onHandDelta)" :content="getStockOperationText(record.operationType)" />
|
||||
</div>
|
||||
</section>
|
||||
<card-container description="库存变动信息" v-entrance-transition>
|
||||
<div class="data">
|
||||
<div class="card">
|
||||
<span class="label">业务数量</span>
|
||||
<strong :class="getDeltaClass(record.quantity)" v-text="getQuantityText(record)" />
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="库存流水详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.productStock.read" class="product-stock-record-detail">
|
||||
<t-loading v-if="isLoading" class="loading" size="32px" />
|
||||
<template v-else-if="record">
|
||||
<section class="snapshot-head" v-entrance-transition>
|
||||
<div class="eyebrow">库存 SKU 快照</div>
|
||||
<h2 v-text="record.productNameSnapshot || '未命名产品'" />
|
||||
<product-sku-tags
|
||||
class="sku"
|
||||
:product-name="record.productNameSnapshot"
|
||||
:snapshot="record.skuSpecSnapshot"
|
||||
:fallback="record.specSummarySnapshot || record.skuNameSnapshot || '默认 SKU'"
|
||||
:unit="record.unitSnapshot"
|
||||
/>
|
||||
<div class="meta">
|
||||
<span v-text="record.skuCodeSnapshot || '无 SKU 编码'" />
|
||||
<t-tag size="small" variant="light-outline" :theme="getOperationTheme(record.onHandDelta)" :content="getStockOperationText(record.operationType)" />
|
||||
</div>
|
||||
</section>
|
||||
<card-container description="库存变动信息" v-entrance-transition>
|
||||
<div class="data">
|
||||
<div class="card">
|
||||
<span class="label">业务数量</span>
|
||||
<strong :class="getDeltaClass(record.quantity)" v-text="getQuantityText(record)" />
|
||||
</div>
|
||||
<div class="card">
|
||||
<span class="label">基础单位数量</span>
|
||||
<strong :class="getDeltaClass(record.baseQuantity)" v-text="getSignedQuantityText(record.baseQuantity)" />
|
||||
</div>
|
||||
<div class="card">
|
||||
<span class="label">实际库存变动</span>
|
||||
<strong :class="getDeltaClass(record.onHandDelta)" v-text="getDeltaText(record.onHandDelta)" />
|
||||
</div>
|
||||
<div class="card">
|
||||
<span class="label">预占库存变动</span>
|
||||
<strong :class="getDeltaClass(record.reservedDelta)" v-text="getDeltaText(record.reservedDelta)" />
|
||||
</div>
|
||||
</div>
|
||||
</card-container>
|
||||
<t-cell-group title="库存快照" theme="card" v-entrance-transition>
|
||||
<t-cell title="实际库存">
|
||||
<template #note>
|
||||
<span class="balance">
|
||||
<span v-text="getProductQuantityText(record.onHandBefore)" />
|
||||
<t-icon name="arrow-right" />
|
||||
<span :class="getDeltaClass(record.onHandDelta)" v-text="getProductQuantityText(record.onHandAfter)" />
|
||||
<span class="unit" v-text="baseUnitName || '基础单位'" />
|
||||
</span>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="预占库存">
|
||||
<template #note>
|
||||
<span class="balance">
|
||||
<span v-text="getProductQuantityText(record.reservedBefore)" />
|
||||
<t-icon name="arrow-right" />
|
||||
<span :class="getDeltaClass(record.reservedDelta)" v-text="getProductQuantityText(record.reservedAfter)" />
|
||||
<span class="unit" v-text="baseUnitName || '基础单位'" />
|
||||
</span>
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group title="库存流水" theme="card" v-entrance-transition>
|
||||
<t-cell title="操作类型" :note="getStockOperationText(record.operationType)" />
|
||||
<t-cell title="业务类型" :note="getBizTypeText(record.bizType)" />
|
||||
<t-cell
|
||||
v-if="relatedFulfillmentId && canReadFulfillment"
|
||||
title="关联履约单"
|
||||
note="查看履约详情"
|
||||
arrow
|
||||
@click="toFulfillment"
|
||||
/>
|
||||
<t-cell title="发生时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="record.occurredAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="操作人" :note="record.operator?.nick || record.operator?.name || record.operatorUserId || '未知操作人'" />
|
||||
<t-cell v-if="record.sourceRecordId" title="原库存流水" :note="record.sourceRecordId" arrow @click="openRelatedRecord(record.sourceRecordId)" />
|
||||
<t-cell v-if="record.revokeRecordId" title="冲正流水" :note="record.revokeRecordId" arrow @click="openRelatedRecord(record.revokeRecordId)" />
|
||||
<t-cell v-if="record.remark" title="备注" :note="record.remark" />
|
||||
<t-cell class="empty-cell-title-margin">
|
||||
<template #title>
|
||||
<span></span>
|
||||
</template>
|
||||
<template #description>
|
||||
<attachment-selector :items="photoItemList" title="操作照片" readonly />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-button
|
||||
v-if="canManualRevoke"
|
||||
class="cell-button"
|
||||
theme="danger"
|
||||
@click="openManualRevoke"
|
||||
v-entrance-transition
|
||||
content="手工流水冲正"
|
||||
/>
|
||||
</template>
|
||||
<t-empty v-else :description="isLoading ? '正在加载库存流水' : '库存流水不存在'" />
|
||||
<bottom-popup
|
||||
v-model="revokeVisible"
|
||||
title="手工流水冲正"
|
||||
left-button-text="取消"
|
||||
:right-button-text="isOperating ? '提交中' : '提交'"
|
||||
@left-button-click="revokeVisible = false"
|
||||
@right-button-click="submitManualRevoke"
|
||||
>
|
||||
<div class="revoke-popup">
|
||||
<p class="tip">将新增一条反向库存流水,原流水不会被修改或删除。</p>
|
||||
<t-form>
|
||||
<t-form-item label="冲正备注" required-mark>
|
||||
<t-textarea v-model="revokeRemark" borderless autosize maxlength="500" placeholder="请输入冲正备注" />
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<attachment-selector
|
||||
v-model:items="revokePhotoItems"
|
||||
:upload="uploadPhotoList"
|
||||
required
|
||||
title="冲正凭证照片"
|
||||
/>
|
||||
</div>
|
||||
<div class="card">
|
||||
<span class="label">基础单位数量</span>
|
||||
<strong :class="getDeltaClass(record.baseQuantity)" v-text="getSignedQuantityText(record.baseQuantity)" />
|
||||
</div>
|
||||
<div class="card">
|
||||
<span class="label">实际库存变动</span>
|
||||
<strong :class="getDeltaClass(record.onHandDelta)" v-text="getDeltaText(record.onHandDelta)" />
|
||||
</div>
|
||||
<div class="card">
|
||||
<span class="label">预占库存变动</span>
|
||||
<strong :class="getDeltaClass(record.reservedDelta)" v-text="getDeltaText(record.reservedDelta)" />
|
||||
</div>
|
||||
</div>
|
||||
</card-container>
|
||||
<t-cell-group title="库存快照" theme="card" v-entrance-transition>
|
||||
<t-cell title="实际库存">
|
||||
<template #note>
|
||||
<span class="balance">
|
||||
<span v-text="getProductQuantityText(record.onHandBefore)" />
|
||||
<t-icon name="arrow-right" />
|
||||
<span :class="getDeltaClass(record.onHandDelta)" v-text="getProductQuantityText(record.onHandAfter)" />
|
||||
<span class="unit" v-text="baseUnitName || '基础单位'" />
|
||||
</span>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="预占库存">
|
||||
<template #note>
|
||||
<span class="balance">
|
||||
<span v-text="getProductQuantityText(record.reservedBefore)" />
|
||||
<t-icon name="arrow-right" />
|
||||
<span :class="getDeltaClass(record.reservedDelta)" v-text="getProductQuantityText(record.reservedAfter)" />
|
||||
<span class="unit" v-text="baseUnitName || '基础单位'" />
|
||||
</span>
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group title="库存流水" theme="card" v-entrance-transition>
|
||||
<t-cell title="操作类型" :note="getStockOperationText(record.operationType)" />
|
||||
<t-cell title="业务类型" :note="getBizTypeText(record.bizType)" />
|
||||
<t-cell
|
||||
v-if="relatedFulfillmentId && canReadFulfillment"
|
||||
title="关联履约单"
|
||||
note="查看履约详情"
|
||||
arrow
|
||||
@click="toFulfillment"
|
||||
/>
|
||||
<t-cell title="发生时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="record.occurredAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="操作人" :note="record.operator?.nick || record.operator?.name || record.operatorUserId || '未知操作人'" />
|
||||
<t-cell v-if="record.sourceRecordId" title="原库存流水" :note="record.sourceRecordId" arrow @click="openRelatedRecord(record.sourceRecordId)" />
|
||||
<t-cell v-if="record.revokeRecordId" title="冲正流水" :note="record.revokeRecordId" arrow @click="openRelatedRecord(record.revokeRecordId)" />
|
||||
<t-cell v-if="record.remark" title="备注" :note="record.remark" />
|
||||
<t-cell class="empty-cell-title-margin">
|
||||
<template #title>
|
||||
<span></span>
|
||||
</template>
|
||||
<template #description>
|
||||
<attachment-selector :items="photoItemList" title="操作照片" readonly />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-button
|
||||
v-if="canManualRevoke"
|
||||
class="cell-button"
|
||||
theme="danger"
|
||||
@click="openManualRevoke"
|
||||
v-entrance-transition
|
||||
content="手工流水冲正"
|
||||
/>
|
||||
</template>
|
||||
<t-empty v-else :description="isLoading ? '正在加载库存流水' : '库存流水不存在'" />
|
||||
<bottom-popup
|
||||
v-model="revokeVisible"
|
||||
title="手工流水冲正"
|
||||
left-button-text="取消"
|
||||
:right-button-text="isOperating ? '提交中' : '提交'"
|
||||
@left-button-click="revokeVisible = false"
|
||||
@right-button-click="submitManualRevoke"
|
||||
>
|
||||
<div class="revoke-popup">
|
||||
<p class="tip">将新增一条反向库存流水,原流水不会被修改或删除。</p>
|
||||
<t-form>
|
||||
<t-form-item label="冲正备注" required-mark>
|
||||
<t-textarea v-model="revokeRemark" borderless autosize maxlength="500" placeholder="请输入冲正备注" />
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<attachment-selector
|
||||
v-model:items="revokePhotoItems"
|
||||
:upload="uploadPhotoList"
|
||||
required
|
||||
title="冲正凭证照片"
|
||||
/>
|
||||
</bottom-popup>
|
||||
</div>
|
||||
</bottom-popup>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -327,7 +331,7 @@ watch(() => String(route.params.id || ""), async (id, previousId) => {
|
||||
.product-stock-record-detail {
|
||||
gap: 1rem;
|
||||
display: flex;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 2rem;
|
||||
padding: 0 0 2rem;
|
||||
flex-direction: column;
|
||||
|
||||
.loading {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
left-arrow
|
||||
@left-click="handleNavBarBack"
|
||||
/>
|
||||
<main v-can="permissionCodes.productStock.read" class="page-content scroll list">
|
||||
<main v-can="permissionCodes.productStock.read" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh has-dropdown-menu-navbar"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main v-can="permissionCodes.productStock.read" class="page-content scroll list">
|
||||
<main v-can="permissionCodes.productStock.read" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="list-wrap empty-cell-title-margin pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main v-can="permissionCodes.salesOrder.read" class="page-content scroll list">
|
||||
<main v-can="permissionCodes.salesOrder.read" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -1,121 +1,125 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="资金记录详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div v-can="pageAccess" class="package-record-detail">
|
||||
<template v-if="record">
|
||||
<section class="hero" v-entrance-transition>
|
||||
<div class="header">
|
||||
<span class="eyebrow" v-text="'资金流水'" />
|
||||
<t-tag :content="getRecordStatusText(record)" :theme="getRecordStatusTheme(record)" variant="light-outline" />
|
||||
</div>
|
||||
<h1 class="title" v-text="getFundOperationText(record.operationType)" />
|
||||
<div class="amount">
|
||||
<span class="red">¥</span>
|
||||
<strong class="value red text-bold" v-text="formatPackageAmount(record.amount)" />
|
||||
</div>
|
||||
</section>
|
||||
<t-cell-group title="订单信息" theme="card" v-entrance-transition>
|
||||
<t-cell title="订单总价" :note="formatPackageAmount(record.salesOrderAmount)" />
|
||||
<t-cell title="剩余待收款(流水快照)" :note="formatPackageAmount(record.salesOrderUnpaidAmountSnapshot)" />
|
||||
</t-cell-group>
|
||||
<t-cell-group title="资金记录" theme="card" v-entrance-transition>
|
||||
<t-cell title="操作类型" :note="getFundOperationText(record.operationType)" />
|
||||
<t-cell title="状态">
|
||||
<template #note>
|
||||
<t-tag
|
||||
:content="getRecordStatusText(record)"
|
||||
:theme="getRecordStatusTheme(record)"
|
||||
variant="light-outline"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="资金记录详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="pageAccess" class="package-record-detail">
|
||||
<template v-if="record">
|
||||
<section class="hero" v-entrance-transition>
|
||||
<div class="header">
|
||||
<span class="eyebrow" v-text="'资金流水'" />
|
||||
<t-tag :content="getRecordStatusText(record)" :theme="getRecordStatusTheme(record)" variant="light-outline" />
|
||||
</div>
|
||||
<h1 class="title" v-text="getFundOperationText(record.operationType)" />
|
||||
<div class="amount">
|
||||
<span class="red">¥</span>
|
||||
<strong class="value red text-bold" v-text="formatPackageAmount(record.amount)" />
|
||||
</div>
|
||||
</section>
|
||||
<t-cell-group title="订单信息" theme="card" v-entrance-transition>
|
||||
<t-cell title="订单总价" :note="formatPackageAmount(record.salesOrderAmount)" />
|
||||
<t-cell title="剩余待收款(流水快照)" :note="formatPackageAmount(record.salesOrderUnpaidAmountSnapshot)" />
|
||||
</t-cell-group>
|
||||
<t-cell-group title="资金记录" theme="card" v-entrance-transition>
|
||||
<t-cell title="操作类型" :note="getFundOperationText(record.operationType)" />
|
||||
<t-cell title="状态">
|
||||
<template #note>
|
||||
<t-tag
|
||||
:content="getRecordStatusText(record)"
|
||||
:theme="getRecordStatusTheme(record)"
|
||||
variant="light-outline"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="金额" :note="formatPackageAmount(record.amount)" />
|
||||
<t-cell
|
||||
v-if="record.sourceRecordId"
|
||||
title="冲正流水"
|
||||
arrow
|
||||
@click="toSourceRecord"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="金额" :note="formatPackageAmount(record.amount)" />
|
||||
<t-cell
|
||||
v-if="record.sourceRecordId"
|
||||
title="冲正流水"
|
||||
arrow
|
||||
@click="toSourceRecord"
|
||||
/>
|
||||
<t-cell title="备注" :note="Text.display(record.remark)" />
|
||||
<t-cell v-if="record.reason" title="拒绝/撤销原因" :note="Text.display(record.reason)" />
|
||||
<t-cell
|
||||
title="销售订单详情"
|
||||
:arrow="!!record.bizId && canReadSalesOrder"
|
||||
@click="toSalesOrder"
|
||||
/>
|
||||
<div class="photo-wrap bg-white">
|
||||
<attachment-selector :items="photoItems" title="业务照片" readonly />
|
||||
</div>
|
||||
</t-cell-group>
|
||||
<t-cell-group theme="card" v-entrance-transition>
|
||||
<t-cell
|
||||
title="发起人"
|
||||
:note="record.operator?.nick || record.operator?.name || '未知'"
|
||||
/>
|
||||
<t-cell title="发起时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="record.occurredAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell
|
||||
title="处理人"
|
||||
:note="record.verifier?.nick || record.verifier?.name || '未处理'"
|
||||
/>
|
||||
<t-cell title="处理时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="record.verifiedAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<section
|
||||
v-if="isPendingReceive || canRevoke"
|
||||
class="actions"
|
||||
v-entrance-transition
|
||||
>
|
||||
<div class="pair">
|
||||
<t-button
|
||||
v-if="canVerifyReceive"
|
||||
theme="primary"
|
||||
content="核销收款"
|
||||
@click="verifyReceive"
|
||||
/>
|
||||
<t-button
|
||||
v-if="canVerifyReceive"
|
||||
theme="danger"
|
||||
content="拒绝收款"
|
||||
@click="openReasonDialog('reject')"
|
||||
/>
|
||||
</div>
|
||||
<t-button
|
||||
v-if="canCancelReceive"
|
||||
theme="default"
|
||||
content="撤销收款"
|
||||
@click="openReasonDialog('cancel')"
|
||||
/>
|
||||
<t-button
|
||||
v-if="canRevoke"
|
||||
theme="danger"
|
||||
content="资金冲正"
|
||||
@click="toRevoke"
|
||||
/>
|
||||
</section>
|
||||
</template>
|
||||
<t-empty v-else :description="isLoading ? '正在加载资金记录' : '资金记录不存在'" />
|
||||
<t-dialog
|
||||
v-model:visible="reasonDialogVisible"
|
||||
:title="reasonTitle"
|
||||
cancel-btn="取消"
|
||||
:confirm-btn="reasonActionText"
|
||||
@cancel="reasonDialogVisible = false"
|
||||
@confirm="submitReason"
|
||||
>
|
||||
<t-textarea v-model.trim="reasonText" borderless autosize placeholder="请输入原因" />
|
||||
</t-dialog>
|
||||
<t-cell title="备注" :note="Text.display(record.remark)" />
|
||||
<t-cell v-if="record.reason" title="拒绝/撤销原因" :note="Text.display(record.reason)" />
|
||||
<t-cell
|
||||
title="销售订单详情"
|
||||
:arrow="!!record.bizId && canReadSalesOrder"
|
||||
@click="toSalesOrder"
|
||||
/>
|
||||
<div class="photo-wrap bg-white">
|
||||
<attachment-selector :items="photoItems" title="业务照片" readonly />
|
||||
</div>
|
||||
</t-cell-group>
|
||||
<t-cell-group theme="card" v-entrance-transition>
|
||||
<t-cell
|
||||
title="发起人"
|
||||
:note="record.operator?.nick || record.operator?.name || '未知'"
|
||||
/>
|
||||
<t-cell title="发起时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="record.occurredAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell
|
||||
title="处理人"
|
||||
:note="record.verifier?.nick || record.verifier?.name || '未处理'"
|
||||
/>
|
||||
<t-cell title="处理时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="record.verifiedAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<section
|
||||
v-if="isPendingReceive || canRevoke"
|
||||
class="actions"
|
||||
v-entrance-transition
|
||||
>
|
||||
<div class="pair">
|
||||
<t-button
|
||||
v-if="canVerifyReceive"
|
||||
theme="primary"
|
||||
content="核销收款"
|
||||
@click="verifyReceive"
|
||||
/>
|
||||
<t-button
|
||||
v-if="canVerifyReceive"
|
||||
theme="danger"
|
||||
content="拒绝收款"
|
||||
@click="openReasonDialog('reject')"
|
||||
/>
|
||||
</div>
|
||||
<t-button
|
||||
v-if="canCancelReceive"
|
||||
theme="default"
|
||||
content="撤销收款"
|
||||
@click="openReasonDialog('cancel')"
|
||||
/>
|
||||
<t-button
|
||||
v-if="canRevoke"
|
||||
theme="danger"
|
||||
content="资金冲正"
|
||||
@click="toRevoke"
|
||||
/>
|
||||
</section>
|
||||
</template>
|
||||
<t-empty v-else :description="isLoading ? '正在加载资金记录' : '资金记录不存在'" />
|
||||
<t-dialog
|
||||
v-model:visible="reasonDialogVisible"
|
||||
:title="reasonTitle"
|
||||
cancel-btn="取消"
|
||||
:confirm-btn="reasonActionText"
|
||||
@cancel="reasonDialogVisible = false"
|
||||
@confirm="submitReason"
|
||||
>
|
||||
<t-textarea v-model.trim="reasonText" borderless autosize placeholder="请输入原因" />
|
||||
</t-dialog>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -332,7 +336,7 @@ onMounted(loadData);
|
||||
<style scoped lang="less">
|
||||
.package-record-detail {
|
||||
gap: 1rem;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 2rem;
|
||||
padding: 0 0 2rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main v-can="pageAccess" class="page-content scroll list">
|
||||
<main v-can="pageAccess" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -1,91 +1,95 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="资金冲正"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(permissionCodes.fund.revoke)"
|
||||
@click="save"
|
||||
theme="danger"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="提交"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="permissionCodes.fund.revoke" class="package-operation-edit">
|
||||
<t-cell-group v-if="record" title="原资金记录" theme="card" v-entrance-transition>
|
||||
<t-cell title="操作类型" :note="getFundOperationText(record.operationType)" />
|
||||
<t-cell title="金额">
|
||||
<template #note>
|
||||
<div class="red" v-text="formatPackageAmount(record.amount)" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="原状态" :note="getRecordStatusText(record)" />
|
||||
<t-cell
|
||||
title="销售订单详情"
|
||||
:arrow="!!record.bizId && canReadSalesOrder"
|
||||
@click="toSalesOrder"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<t-form v-if="record" class="form card" v-entrance-transition>
|
||||
<t-form-item label="冲正原因" required-mark>
|
||||
<div class="reason">
|
||||
<t-textarea
|
||||
v-model="reason"
|
||||
borderless
|
||||
autosize
|
||||
maxlength="500"
|
||||
placeholder="请输入或选择冲正原因"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="资金冲正"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(permissionCodes.fund.revoke)"
|
||||
@click="save"
|
||||
theme="danger"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="提交"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.fund.revoke" class="package-operation-edit">
|
||||
<t-cell-group v-if="record" title="原资金记录" theme="card" v-entrance-transition>
|
||||
<t-cell title="操作类型" :note="getFundOperationText(record.operationType)" />
|
||||
<t-cell title="金额">
|
||||
<template #note>
|
||||
<div class="red" v-text="formatPackageAmount(record.amount)" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="原状态" :note="getRecordStatusText(record)" />
|
||||
<t-cell
|
||||
title="销售订单详情"
|
||||
:arrow="!!record.bizId && canReadSalesOrder"
|
||||
@click="toSalesOrder"
|
||||
/>
|
||||
<t-button
|
||||
size="extra-small"
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
@click="openReasonPicker"
|
||||
>选择</t-button>
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="冲正时间"
|
||||
content-align="right"
|
||||
>
|
||||
<date-time-now-picker v-model="occurredAtText" title="冲正时间" :start="minimumDateTimeText" />
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea
|
||||
v-model="remark"
|
||||
borderless
|
||||
autosize
|
||||
maxlength="500"
|
||||
placeholder="备注(可选)"
|
||||
/>
|
||||
</t-form-item>
|
||||
<div class="photo-wrap">
|
||||
<attachment-selector
|
||||
v-if="record"
|
||||
v-model:items="photoItems"
|
||||
:upload="uploadPhotoList"
|
||||
required
|
||||
title="冲正凭证照片"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<t-form v-if="record" class="form card" v-entrance-transition>
|
||||
<t-form-item label="冲正原因" required-mark>
|
||||
<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="冲正时间"
|
||||
content-align="right"
|
||||
>
|
||||
<date-time-now-picker v-model="occurredAtText" title="冲正时间" :start="minimumDateTimeText" />
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea
|
||||
v-model="remark"
|
||||
borderless
|
||||
autosize
|
||||
maxlength="500"
|
||||
placeholder="备注(可选)"
|
||||
/>
|
||||
</t-form-item>
|
||||
<div class="photo-wrap">
|
||||
<attachment-selector
|
||||
v-if="record"
|
||||
v-model:items="photoItems"
|
||||
:upload="uploadPhotoList"
|
||||
required
|
||||
title="冲正凭证照片"
|
||||
/>
|
||||
</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>
|
||||
</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>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -264,7 +268,7 @@ onMounted(async () => {
|
||||
<style scoped lang="less">
|
||||
.package-operation-edit {
|
||||
gap: 1rem;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 2rem;
|
||||
padding: 0 0 2rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
@@ -1,228 +1,232 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="销售订单详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div v-can="permissionCodes.salesOrder.read" class="sales-order-detail">
|
||||
<template v-if="order">
|
||||
<customer-profile-card
|
||||
v-if="order.customer"
|
||||
class="customer"
|
||||
:customer="order.customer"
|
||||
v-entrance-transition
|
||||
@click="toCustomerDetail"
|
||||
/>
|
||||
<section class="hero" v-entrance-transition>
|
||||
<div class="header">
|
||||
<span class="eyebrow">销售订单</span>
|
||||
<div class="tags">
|
||||
<t-tag :content="getSalesOrderTypeText(order.orderType)" theme="primary" variant="light-outline" />
|
||||
<t-tag :content="getSalesOrderStatusText(order.status)" variant="light-outline" :theme="getStatusTheme(order.status)" />
|
||||
</div>
|
||||
</div>
|
||||
<h1 class="no selectable" v-text="order.orderNo" />
|
||||
<div class="meta">
|
||||
<time-label class="time" :timestamp="order.purchasedAt" underline />
|
||||
<div class="amount red text-bold">
|
||||
<span>¥</span>
|
||||
<strong class="value" v-text="formatPackageAmount(order.saleAmount)" />
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<t-form class="info form card" title="订单信息" @submit="saveEdit" v-entrance-transition>
|
||||
<t-form-item v-if="order.sourceEventRecord?.id" label="来源登记记录" arrow @click="toEventRecord">
|
||||
<span>查看来源记录</span>
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea v-if="isEditing" v-model.trim="editRemark" class="remark-editor" borderless autosize maxlength="500" placeholder="记录本单需要注意的内容" />
|
||||
<span v-else v-text="Text.display(order.remark)" />
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<div class="photo-wrap" v-entrance-transition>
|
||||
<attachment-selector :readonly="!isEditing"
|
||||
v-model:items="photoItems"
|
||||
:upload="isEditing ? uploadPhotoList : undefined"
|
||||
title="订单照片"
|
||||
/>
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item v-if="canUpdate" label-width="0">
|
||||
<div class="edit-actions">
|
||||
<t-button
|
||||
v-if="!isEditing"
|
||||
type="button"
|
||||
size="extra-small"
|
||||
theme="primary"
|
||||
@click="toEdit"
|
||||
>编辑</t-button>
|
||||
<template v-else>
|
||||
<t-button
|
||||
type="button"
|
||||
size="extra-small"
|
||||
:disabled="isSaving"
|
||||
@click="cancelEdit"
|
||||
>取消</t-button>
|
||||
<t-button
|
||||
type="submit"
|
||||
theme="primary"
|
||||
size="extra-small"
|
||||
:loading="isSaving"
|
||||
:disabled="isSaving"
|
||||
>保存</t-button>
|
||||
</template>
|
||||
</div>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-form
|
||||
v-if="order.itemList?.length"
|
||||
class="form card product"
|
||||
title="订单明细"
|
||||
theme="card"
|
||||
label-width="0"
|
||||
v-entrance-transition
|
||||
>
|
||||
<t-form-item class="form-item" v-for="item in order.itemList" :key="item.id">
|
||||
<div class="item">
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="销售订单详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.salesOrder.read" class="sales-order-detail">
|
||||
<template v-if="order">
|
||||
<customer-profile-card
|
||||
v-if="order.customer"
|
||||
class="customer"
|
||||
:customer="order.customer"
|
||||
v-entrance-transition
|
||||
@click="toCustomerDetail"
|
||||
/>
|
||||
<section class="hero" v-entrance-transition>
|
||||
<div class="header">
|
||||
<div class="left">
|
||||
<t-image
|
||||
v-if="getProductPhotoURL(item)"
|
||||
:src="getProductPhotoURL(item)"
|
||||
:alt="item.productNameSnapshot || '产品图片'"
|
||||
fit="cover"
|
||||
class="avatar"
|
||||
/>
|
||||
<div
|
||||
v-else
|
||||
class="avatar fallback"
|
||||
v-text="(item.productNameSnapshot || '产').slice(0, 1)"
|
||||
<span class="eyebrow">销售订单</span>
|
||||
<div class="tags">
|
||||
<t-tag :content="getSalesOrderTypeText(order.orderType)" theme="primary" variant="light-outline" />
|
||||
<t-tag :content="getSalesOrderStatusText(order.status)" variant="light-outline" :theme="getStatusTheme(order.status)" />
|
||||
</div>
|
||||
</div>
|
||||
<h1 class="no selectable" v-text="order.orderNo" />
|
||||
<div class="meta">
|
||||
<time-label class="time" :timestamp="order.purchasedAt" underline />
|
||||
<div class="amount red text-bold">
|
||||
<span>¥</span>
|
||||
<strong class="value" v-text="formatPackageAmount(order.saleAmount)" />
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<t-form class="info form card" title="订单信息" @submit="saveEdit" v-entrance-transition>
|
||||
<t-form-item v-if="order.sourceEventRecord?.id" label="来源登记记录" arrow @click="toEventRecord">
|
||||
<span>查看来源记录</span>
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea v-if="isEditing" v-model.trim="editRemark" class="remark-editor" borderless autosize maxlength="500" placeholder="记录本单需要注意的内容" />
|
||||
<span v-else v-text="Text.display(order.remark)" />
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<div class="photo-wrap" v-entrance-transition>
|
||||
<attachment-selector :readonly="!isEditing"
|
||||
v-model:items="photoItems"
|
||||
:upload="isEditing ? uploadPhotoList : undefined"
|
||||
title="订单照片"
|
||||
/>
|
||||
</div>
|
||||
<div class="main">
|
||||
<div class="title">
|
||||
<div class="name-gift">
|
||||
<span class="name text-bold" v-text="item.productNameSnapshot || '未命名产品'" />
|
||||
<t-tag v-if="item.gifted" size="small" theme="success" content="赠送" />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="canUpdate" label-width="0">
|
||||
<div class="edit-actions">
|
||||
<t-button
|
||||
v-if="!isEditing"
|
||||
type="button"
|
||||
size="extra-small"
|
||||
theme="primary"
|
||||
@click="toEdit"
|
||||
>编辑</t-button>
|
||||
<template v-else>
|
||||
<t-button
|
||||
type="button"
|
||||
size="extra-small"
|
||||
:disabled="isSaving"
|
||||
@click="cancelEdit"
|
||||
>取消</t-button>
|
||||
<t-button
|
||||
type="submit"
|
||||
theme="primary"
|
||||
size="extra-small"
|
||||
:loading="isSaving"
|
||||
:disabled="isSaving"
|
||||
>保存</t-button>
|
||||
</template>
|
||||
</div>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-form
|
||||
v-if="order.itemList?.length"
|
||||
class="form card product"
|
||||
title="订单明细"
|
||||
theme="card"
|
||||
label-width="0"
|
||||
v-entrance-transition
|
||||
>
|
||||
<t-form-item class="form-item" v-for="item in order.itemList" :key="item.id">
|
||||
<div class="item">
|
||||
<div class="header">
|
||||
<div class="left">
|
||||
<t-image
|
||||
v-if="getProductPhotoURL(item)"
|
||||
:src="getProductPhotoURL(item)"
|
||||
:alt="item.productNameSnapshot || '产品图片'"
|
||||
fit="cover"
|
||||
class="avatar"
|
||||
/>
|
||||
<div
|
||||
v-else
|
||||
class="avatar fallback"
|
||||
v-text="(item.productNameSnapshot || '产').slice(0, 1)"
|
||||
/>
|
||||
</div>
|
||||
<div class="main">
|
||||
<div class="title">
|
||||
<div class="name-gift">
|
||||
<span class="name text-bold" v-text="item.productNameSnapshot || '未命名产品'" />
|
||||
<t-tag v-if="item.gifted" size="small" theme="success" content="赠送" />
|
||||
</div>
|
||||
<t-tag
|
||||
:content="getItemFulfillmentStatus(item).text"
|
||||
:theme="getItemFulfillmentStatus(item).theme"
|
||||
variant="light-outline"
|
||||
/>
|
||||
</div>
|
||||
<div class="description">
|
||||
<strong
|
||||
v-if="item.lineAmount !== null && item.lineAmount !== undefined"
|
||||
class="red"
|
||||
v-text="`¥${formatPackageAmount(item.lineAmount)}`"
|
||||
/>
|
||||
<t-tag v-else size="small" content="套餐权益" />
|
||||
<product-sku-tags
|
||||
:product-name="item.productNameSnapshot"
|
||||
:snapshot="item.skuSpecSnapshot"
|
||||
:fallback="item.specSummarySnapshot || item.skuNameSnapshot"
|
||||
:unit="item.unitSnapshot"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<t-tag
|
||||
:content="getItemFulfillmentStatus(item).text"
|
||||
:theme="getItemFulfillmentStatus(item).theme"
|
||||
variant="light-outline"
|
||||
/>
|
||||
</div>
|
||||
<div class="description">
|
||||
<strong
|
||||
v-if="item.lineAmount !== null && item.lineAmount !== undefined"
|
||||
class="red"
|
||||
v-text="`¥${formatPackageAmount(item.lineAmount)}`"
|
||||
/>
|
||||
<t-tag v-else size="small" content="套餐权益" />
|
||||
<product-sku-tags
|
||||
:product-name="item.productNameSnapshot"
|
||||
:snapshot="item.skuSpecSnapshot"
|
||||
:fallback="item.specSummarySnapshot || item.skuNameSnapshot"
|
||||
:unit="item.unitSnapshot"
|
||||
/>
|
||||
<div class="content">
|
||||
<div class="metric">
|
||||
<strong v-text="getPackageQuantityText(item.quantity)" />
|
||||
<span>订单数量</span>
|
||||
</div>
|
||||
<div class="metric">
|
||||
<strong :class="getAvailableQuantityClass(item)" v-text="getItemQuantityText(item, item.availableBaseQuantity)" />
|
||||
<span>可履约</span>
|
||||
</div>
|
||||
<div class="metric">
|
||||
<strong v-text="getItemQuantityText(item, item.pendingBaseQuantity)" />
|
||||
<span>待核销</span>
|
||||
</div>
|
||||
<div class="metric">
|
||||
<strong :class="getFulfilledQuantityClass(item)" v-text="getItemQuantityText(item, item.fulfilledBaseQuantity)" />
|
||||
<span>已履约</span>
|
||||
</div>
|
||||
<div class="metric">
|
||||
<strong :class="getRemainingQuantityClass(item)" v-text="getItemQuantityText(item, item.remainingBaseQuantity)" />
|
||||
<span>剩余</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="metric">
|
||||
<strong v-text="getPackageQuantityText(item.quantity)" />
|
||||
<span>订单数量</span>
|
||||
</div>
|
||||
<div class="metric">
|
||||
<strong :class="getAvailableQuantityClass(item)" v-text="getItemQuantityText(item, item.availableBaseQuantity)" />
|
||||
<span>可履约</span>
|
||||
</div>
|
||||
<div class="metric">
|
||||
<strong v-text="getItemQuantityText(item, item.pendingBaseQuantity)" />
|
||||
<span>待核销</span>
|
||||
</div>
|
||||
<div class="metric">
|
||||
<strong :class="getFulfilledQuantityClass(item)" v-text="getItemQuantityText(item, item.fulfilledBaseQuantity)" />
|
||||
<span>已履约</span>
|
||||
</div>
|
||||
<div class="metric">
|
||||
<strong :class="getRemainingQuantityClass(item)" v-text="getItemQuantityText(item, item.remainingBaseQuantity)" />
|
||||
<span>剩余</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item label="履约记录" arrow @click="toFulfillmentList">
|
||||
查看本单所有履约单
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-button
|
||||
v-if="canCreateFulfillment && canFulfillByPayment && order.status === 'ACTIVE'"
|
||||
class="cell-button"
|
||||
theme="primary"
|
||||
content="履约产品"
|
||||
@click="toCreateFulfillment"
|
||||
/>
|
||||
<t-cell-group class="finance-panel" title="资金摘要" theme="card">
|
||||
<t-cell title="成交金额">
|
||||
<template #note><span :class="getPaymentAmountClass(order.paymentStatus)" v-text="formatPackageAmount(order.saleAmount)" /></template>
|
||||
</t-cell>
|
||||
<t-cell title="已生效收款">
|
||||
<template #note><span :class="getAmountClass(order.paidAmount, 'green')" v-text="formatPackageAmount(order.paidAmount)" /></template>
|
||||
</t-cell>
|
||||
<t-cell title="待核销收款">
|
||||
<template #note><span :class="getAmountClass(order.pendingPaidAmount, 'orange')" v-text="formatPackageAmount(order.pendingPaidAmount)" /></template>
|
||||
</t-cell>
|
||||
<t-cell title="剩余待收款">
|
||||
<template #note><span :class="getRemainingAmountClass(order.unpaidAmount)" v-text="formatPackageAmount(order.unpaidAmount)" /></template>
|
||||
</t-cell>
|
||||
<t-cell title="有效退款">
|
||||
<template #note><span :class="getAmountClass(order.refundedAmount, 'red')" v-text="formatPackageAmount(order.refundedAmount)" /></template>
|
||||
</t-cell>
|
||||
<t-cell title="收款状态" :note="getSalesPaymentStatusText(order.paymentStatus)" />
|
||||
<t-cell v-if="order.paymentStatus === 'PAID'" title="全额实收时间" :note="getPaidAtText(order.paidAt)" />
|
||||
<t-cell title="退款状态" :note="getSalesRefundStatusText(order.refundStatus)" />
|
||||
<t-cell
|
||||
v-if="canReadFund || canReadMyReceive"
|
||||
:title="canReadFund ? '查看全部资金流水' : '查看我的收款申请'"
|
||||
arrow
|
||||
@click="toFundRecords"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-if="order.status === 'CANCELLED'" class="cancel-info" title="取消记录" theme="card">
|
||||
<t-cell title="取消时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="order.cancelledAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="取消人" :note="order.cancelOperator?.nick || order.cancelOperator?.name || order.cancelOperatorUserId || '未知'" />
|
||||
<t-cell title="取消原因" :note="order.cancelReason || '未填写'" />
|
||||
</t-cell-group>
|
||||
<section class="actions" v-entrance-transition>
|
||||
<t-button
|
||||
v-if="canReceive"
|
||||
theme="primary"
|
||||
@click="toPayment"
|
||||
>登记收款</t-button>
|
||||
<t-button
|
||||
v-if="canRefund"
|
||||
theme="danger"
|
||||
@click="toRefund"
|
||||
>登记退款</t-button>
|
||||
<t-button
|
||||
v-if="canConfirmNoRefund"
|
||||
theme="default"
|
||||
@click="toNoRefund"
|
||||
>确认无需退款</t-button>
|
||||
<t-button
|
||||
v-if="canCancel"
|
||||
theme="danger"
|
||||
@click="toCancel"
|
||||
>取消订单</t-button>
|
||||
</section>
|
||||
</template>
|
||||
<t-empty v-else :description="loading ? '正在加载订单' : '订单不存在'" />
|
||||
</t-form-item>
|
||||
<t-form-item label="履约记录" arrow @click="toFulfillmentList">
|
||||
查看本单所有履约单
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-button
|
||||
v-if="canCreateFulfillment && canFulfillByPayment && order.status === 'ACTIVE'"
|
||||
class="cell-button"
|
||||
theme="primary"
|
||||
content="履约产品"
|
||||
@click="toCreateFulfillment"
|
||||
/>
|
||||
<t-cell-group class="finance-panel" title="资金摘要" theme="card">
|
||||
<t-cell title="成交金额">
|
||||
<template #note><span :class="getPaymentAmountClass(order.paymentStatus)" v-text="formatPackageAmount(order.saleAmount)" /></template>
|
||||
</t-cell>
|
||||
<t-cell title="已生效收款">
|
||||
<template #note><span :class="getAmountClass(order.paidAmount, 'green')" v-text="formatPackageAmount(order.paidAmount)" /></template>
|
||||
</t-cell>
|
||||
<t-cell title="待核销收款">
|
||||
<template #note><span :class="getAmountClass(order.pendingPaidAmount, 'orange')" v-text="formatPackageAmount(order.pendingPaidAmount)" /></template>
|
||||
</t-cell>
|
||||
<t-cell title="剩余待收款">
|
||||
<template #note><span :class="getRemainingAmountClass(order.unpaidAmount)" v-text="formatPackageAmount(order.unpaidAmount)" /></template>
|
||||
</t-cell>
|
||||
<t-cell title="有效退款">
|
||||
<template #note><span :class="getAmountClass(order.refundedAmount, 'red')" v-text="formatPackageAmount(order.refundedAmount)" /></template>
|
||||
</t-cell>
|
||||
<t-cell title="收款状态" :note="getSalesPaymentStatusText(order.paymentStatus)" />
|
||||
<t-cell v-if="order.paymentStatus === 'PAID'" title="全额实收时间" :note="getPaidAtText(order.paidAt)" />
|
||||
<t-cell title="退款状态" :note="getSalesRefundStatusText(order.refundStatus)" />
|
||||
<t-cell
|
||||
v-if="canReadFund || canReadMyReceive"
|
||||
:title="canReadFund ? '查看全部资金流水' : '查看我的收款申请'"
|
||||
arrow
|
||||
@click="toFundRecords"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-if="order.status === 'CANCELLED'" class="cancel-info" title="取消记录" theme="card">
|
||||
<t-cell title="取消时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="order.cancelledAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="取消人" :note="order.cancelOperator?.nick || order.cancelOperator?.name || order.cancelOperatorUserId || '未知'" />
|
||||
<t-cell title="取消原因" :note="order.cancelReason || '未填写'" />
|
||||
</t-cell-group>
|
||||
<section class="actions" v-entrance-transition>
|
||||
<t-button
|
||||
v-if="canReceive"
|
||||
theme="primary"
|
||||
@click="toPayment"
|
||||
>登记收款</t-button>
|
||||
<t-button
|
||||
v-if="canRefund"
|
||||
theme="danger"
|
||||
@click="toRefund"
|
||||
>登记退款</t-button>
|
||||
<t-button
|
||||
v-if="canConfirmNoRefund"
|
||||
theme="default"
|
||||
@click="toNoRefund"
|
||||
>确认无需退款</t-button>
|
||||
<t-button
|
||||
v-if="canCancel"
|
||||
theme="danger"
|
||||
@click="toCancel"
|
||||
>取消订单</t-button>
|
||||
</section>
|
||||
</template>
|
||||
<t-empty v-else :description="loading ? '正在加载订单' : '订单不存在'" />
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -501,7 +505,7 @@ watch(() => route.params.id, loadData);
|
||||
<style scoped lang="less">
|
||||
.sales-order-detail {
|
||||
gap: 1rem;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 2rem;
|
||||
padding: 0 0 2rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<navbar-actions :actions="actions" :visible="route.name === 'SalesOrderList'" />
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main ref="salesOrderListRef" v-can="permissionCodes.salesOrder.read" class="page-content scroll list">
|
||||
<main ref="salesOrderListRef" v-can="permissionCodes.salesOrder.read" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="list-wrap pull-refresh"
|
||||
v-model="refreshing"
|
||||
|
||||
@@ -1,58 +1,62 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="确认无需退款"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(permissionCodes.fund.refund)"
|
||||
@click="save"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="提交"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="permissionCodes.fund.refund" class="sales-order-operation">
|
||||
<t-cell-group v-if="order" title="销售订单" theme="card" v-entrance-transition>
|
||||
<t-cell title="订单号" :note="order.orderNo || order.id" />
|
||||
<t-cell title="当前退款状态" :note="getSalesRefundStatusText(order.refundStatus)" />
|
||||
</t-cell-group>
|
||||
<t-form v-if="order" class="form card" v-entrance-transition>
|
||||
<t-form-item label="确认原因" required-mark>
|
||||
<div class="reason">
|
||||
<t-textarea
|
||||
class="value"
|
||||
v-model="reason"
|
||||
borderless
|
||||
autosize
|
||||
maxlength="500"
|
||||
placeholder="请说明原因"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="确认无需退款"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(permissionCodes.fund.refund)"
|
||||
@click="save"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="提交"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.fund.refund" class="sales-order-operation">
|
||||
<t-cell-group v-if="order" title="销售订单" theme="card" v-entrance-transition>
|
||||
<t-cell title="订单号" :note="order.orderNo || order.id" />
|
||||
<t-cell title="当前退款状态" :note="getSalesRefundStatusText(order.refundStatus)" />
|
||||
</t-cell-group>
|
||||
<t-form v-if="order" class="form card" v-entrance-transition>
|
||||
<t-form-item label="确认原因" required-mark>
|
||||
<div class="reason">
|
||||
<t-textarea
|
||||
class="value"
|
||||
v-model="reason"
|
||||
borderless
|
||||
autosize
|
||||
maxlength="500"
|
||||
placeholder="请说明原因"
|
||||
/>
|
||||
<t-button
|
||||
size="extra-small"
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
@click="openNoRefundReasonPicker"
|
||||
>选择</t-button>
|
||||
</div>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-empty v-if="!order" :description="loading ? '正在加载订单' : '订单不存在'" />
|
||||
<t-popup v-model="noRefundReasonPickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-if="noRefundReasonPickerVisible"
|
||||
v-model="noRefundReasonPickerDraft"
|
||||
:columns="noRefundReasonPickerColumns"
|
||||
title="选择无需退款原因"
|
||||
@cancel="noRefundReasonPickerVisible = false"
|
||||
@confirm="confirmNoRefundReason"
|
||||
/>
|
||||
<t-button
|
||||
size="extra-small"
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
@click="openNoRefundReasonPicker"
|
||||
>选择</t-button>
|
||||
</div>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-empty v-if="!order" :description="loading ? '正在加载订单' : '订单不存在'" />
|
||||
<t-popup v-model="noRefundReasonPickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-if="noRefundReasonPickerVisible"
|
||||
v-model="noRefundReasonPickerDraft"
|
||||
:columns="noRefundReasonPickerColumns"
|
||||
title="选择无需退款原因"
|
||||
@cancel="noRefundReasonPickerVisible = false"
|
||||
@confirm="confirmNoRefundReason"
|
||||
/>
|
||||
</t-popup>
|
||||
</t-popup>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -140,7 +144,7 @@ onMounted(async () => {
|
||||
<style scoped lang="less">
|
||||
.sales-order-operation {
|
||||
gap: 1rem;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 2rem;
|
||||
padding: 0 0 2rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
@@ -1,90 +1,94 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="登记收款"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(permissionCodes.fundReceive.create)"
|
||||
@click="save"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="提交"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="permissionCodes.fundReceive.create" class="sales-order-operation">
|
||||
<t-cell-group
|
||||
v-if="order"
|
||||
title="销售订单"
|
||||
theme="card"
|
||||
v-entrance-transition
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="登记收款"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<t-cell title="订单号" :note="order.orderNo || order.id" />
|
||||
<t-cell
|
||||
title="剩余待收款"
|
||||
:note="formatPackageAmount(order.unpaidAmount)"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<t-form
|
||||
v-if="order"
|
||||
class="form card"
|
||||
label-width="7rem"
|
||||
v-entrance-transition
|
||||
>
|
||||
<t-form-item label="收款金额" required-mark>
|
||||
<t-input
|
||||
v-model.trim="amountText"
|
||||
type="number"
|
||||
align="right"
|
||||
borderless
|
||||
placeholder="输入收款金额"
|
||||
>
|
||||
<template #suffix-icon>
|
||||
<t-button
|
||||
size="extra-small"
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
content="全额收款"
|
||||
@click="fillUnpaidAmount"
|
||||
/>
|
||||
</template>
|
||||
</t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="收款时间" content-align="right">
|
||||
<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" />
|
||||
<template #help v-if="directVerify">
|
||||
<span class="red">直接核销后,收款会立即计入订单已收款,不再进入待核销队列。</span>
|
||||
</template>
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea
|
||||
v-model="remark"
|
||||
borderless
|
||||
autosize
|
||||
maxlength="500"
|
||||
placeholder="请输入备注"
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(permissionCodes.fundReceive.create)"
|
||||
@click="save"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="提交"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<attachment-selector
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.fundReceive.create" class="sales-order-operation">
|
||||
<t-cell-group
|
||||
v-if="order"
|
||||
v-model:items="photoItems"
|
||||
class="photo-field"
|
||||
:upload="uploadPhotoList"
|
||||
required
|
||||
title="收款凭证照片"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-empty v-if="!order" :description="loading ? '正在加载订单' : '订单不存在'" />
|
||||
title="销售订单"
|
||||
theme="card"
|
||||
v-entrance-transition
|
||||
>
|
||||
<t-cell title="订单号" :note="order.orderNo || order.id" />
|
||||
<t-cell
|
||||
title="剩余待收款"
|
||||
:note="formatPackageAmount(order.unpaidAmount)"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<t-form
|
||||
v-if="order"
|
||||
class="form card"
|
||||
label-width="7rem"
|
||||
v-entrance-transition
|
||||
>
|
||||
<t-form-item label="收款金额" required-mark>
|
||||
<t-input
|
||||
v-model.trim="amountText"
|
||||
type="number"
|
||||
align="right"
|
||||
borderless
|
||||
placeholder="输入收款金额"
|
||||
>
|
||||
<template #suffix-icon>
|
||||
<t-button
|
||||
size="extra-small"
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
content="全额收款"
|
||||
@click="fillUnpaidAmount"
|
||||
/>
|
||||
</template>
|
||||
</t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="收款时间" content-align="right">
|
||||
<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" />
|
||||
<template #help v-if="directVerify">
|
||||
<span class="red">直接核销后,收款会立即计入订单已收款,不再进入待核销队列。</span>
|
||||
</template>
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea
|
||||
v-model="remark"
|
||||
borderless
|
||||
autosize
|
||||
maxlength="500"
|
||||
placeholder="请输入备注"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<attachment-selector
|
||||
v-if="order"
|
||||
v-model:items="photoItems"
|
||||
class="photo-field"
|
||||
:upload="uploadPhotoList"
|
||||
required
|
||||
title="收款凭证照片"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-empty v-if="!order" :description="loading ? '正在加载订单' : '订单不存在'" />
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -205,7 +209,7 @@ onMounted(async () => {
|
||||
<style scoped lang="less">
|
||||
.sales-order-operation {
|
||||
gap: 1rem;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 2rem;
|
||||
padding: 0 0 2rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
@@ -1,103 +1,107 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="登记退款"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(permissionCodes.fund.refund)"
|
||||
@click="save"
|
||||
theme="danger"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="提交"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="permissionCodes.fund.refund" class="sales-order-operation">
|
||||
<t-cell-group
|
||||
v-if="order"
|
||||
title="销售订单"
|
||||
theme="card"
|
||||
v-entrance-transition
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="登记退款"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<t-cell title="订单号" :note="order.orderNo || order.id"/>
|
||||
<t-cell
|
||||
title="可退款金额"
|
||||
:note="formatPackageAmount(refundableAmount)"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<t-form
|
||||
v-if="order"
|
||||
class="form card"
|
||||
label-width="6rem"
|
||||
v-entrance-transition
|
||||
>
|
||||
<t-form-item label="退款金额" required-mark>
|
||||
<t-input
|
||||
v-model.trim="amountText"
|
||||
type="number"
|
||||
align="right"
|
||||
borderless
|
||||
placeholder="输入退款金额"
|
||||
>
|
||||
<template #suffix-icon>
|
||||
<t-button
|
||||
size="extra-small"
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
@click="fillRefundAmount"
|
||||
>全额退款</t-button>
|
||||
</template>
|
||||
</t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="退款原因" required-mark>
|
||||
<div class="reason">
|
||||
<t-textarea v-model="reason" borderless autosize maxlength="500" placeholder="输入退款原因" />
|
||||
<t-button
|
||||
size="extra-small"
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
@click="openRefundReasonPicker"
|
||||
>选择</t-button>
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item label="退款时间" content-align="right">
|
||||
<date-time-now-picker v-model="occurredAtText" title="退款时间" :start="minimumDateTimeText" />
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea
|
||||
v-model="remark"
|
||||
borderless
|
||||
autosize
|
||||
maxlength="500"
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(permissionCodes.fund.refund)"
|
||||
@click="save"
|
||||
theme="danger"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="提交"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<attachment-selector
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.fund.refund" class="sales-order-operation">
|
||||
<t-cell-group
|
||||
v-if="order"
|
||||
v-model:items="photoItems"
|
||||
class="photo-field"
|
||||
:upload="uploadPhotoList"
|
||||
required
|
||||
title="退款凭证照片"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-empty v-if="!order" :description="loading ? '正在加载订单' : '订单不存在'"/>
|
||||
<t-popup v-model="refundReasonPickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-if="refundReasonPickerVisible"
|
||||
v-model="refundReasonPickerDraft"
|
||||
:columns="refundReasonPickerColumns"
|
||||
title="选择退款原因"
|
||||
@cancel="refundReasonPickerVisible = false"
|
||||
@confirm="confirmRefundReason"
|
||||
/>
|
||||
</t-popup>
|
||||
title="销售订单"
|
||||
theme="card"
|
||||
v-entrance-transition
|
||||
>
|
||||
<t-cell title="订单号" :note="order.orderNo || order.id"/>
|
||||
<t-cell
|
||||
title="可退款金额"
|
||||
:note="formatPackageAmount(refundableAmount)"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<t-form
|
||||
v-if="order"
|
||||
class="form card"
|
||||
label-width="6rem"
|
||||
v-entrance-transition
|
||||
>
|
||||
<t-form-item label="退款金额" required-mark>
|
||||
<t-input
|
||||
v-model.trim="amountText"
|
||||
type="number"
|
||||
align="right"
|
||||
borderless
|
||||
placeholder="输入退款金额"
|
||||
>
|
||||
<template #suffix-icon>
|
||||
<t-button
|
||||
size="extra-small"
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
@click="fillRefundAmount"
|
||||
>全额退款</t-button>
|
||||
</template>
|
||||
</t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="退款原因" required-mark>
|
||||
<div class="reason">
|
||||
<t-textarea v-model="reason" borderless autosize maxlength="500" placeholder="输入退款原因" />
|
||||
<t-button
|
||||
size="extra-small"
|
||||
theme="primary"
|
||||
variant="outline"
|
||||
@click="openRefundReasonPicker"
|
||||
>选择</t-button>
|
||||
</div>
|
||||
</t-form-item>
|
||||
<t-form-item label="退款时间" content-align="right">
|
||||
<date-time-now-picker v-model="occurredAtText" title="退款时间" :start="minimumDateTimeText" />
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea
|
||||
v-model="remark"
|
||||
borderless
|
||||
autosize
|
||||
maxlength="500"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label-width="0">
|
||||
<attachment-selector
|
||||
v-if="order"
|
||||
v-model:items="photoItems"
|
||||
class="photo-field"
|
||||
:upload="uploadPhotoList"
|
||||
required
|
||||
title="退款凭证照片"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-empty v-if="!order" :description="loading ? '正在加载订单' : '订单不存在'"/>
|
||||
<t-popup v-model="refundReasonPickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-if="refundReasonPickerVisible"
|
||||
v-model="refundReasonPickerDraft"
|
||||
:columns="refundReasonPickerColumns"
|
||||
title="选择退款原因"
|
||||
@cancel="refundReasonPickerVisible = false"
|
||||
@confirm="confirmRefundReason"
|
||||
/>
|
||||
</t-popup>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -234,7 +238,7 @@ onMounted(async () => {
|
||||
<style scoped lang="less">
|
||||
.sales-order-operation {
|
||||
gap: 1rem;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 2rem;
|
||||
padding: 0 0 2rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
+41
-37
@@ -1,41 +1,45 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="关于"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div class="about-page">
|
||||
<section class="brand" v-entrance-transition>
|
||||
<logo @click="handleLogoClick" />
|
||||
<h1 v-text="appName" />
|
||||
<p v-text="appDescription" />
|
||||
</section>
|
||||
<t-cell-group v-if="agreementItemList.length" theme="card" v-entrance-transition>
|
||||
<t-cell
|
||||
v-for="item in agreementItemList"
|
||||
:key="item.id"
|
||||
:title="item.title"
|
||||
arrow
|
||||
hover
|
||||
@click="openAgreement(item)"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-icon :name="item.icon" size="1.75rem" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-empty
|
||||
v-else
|
||||
:description="isLoading ? '正在加载协议配置' : '暂无可用协议'"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="关于"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<footer class="footer" v-entrance-transition>
|
||||
<p>技术支持:夜雨</p>
|
||||
<p>联系技术:imyeyu@qq.com</p>
|
||||
<p>短信服务支持:广州易保网络科技有限公司</p>
|
||||
<p>Copyright © 2026 imyeyu.com</p>
|
||||
</footer>
|
||||
<main class="page-content scroll column">
|
||||
<div class="about-page">
|
||||
<section class="brand" v-entrance-transition>
|
||||
<logo @click="handleLogoClick" />
|
||||
<h1 v-text="appName" />
|
||||
<p v-text="appDescription" />
|
||||
</section>
|
||||
<t-cell-group v-if="agreementItemList.length" theme="card" v-entrance-transition>
|
||||
<t-cell
|
||||
v-for="item in agreementItemList"
|
||||
:key="item.id"
|
||||
:title="item.title"
|
||||
arrow
|
||||
hover
|
||||
@click="openAgreement(item)"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-icon :name="item.icon" size="1.75rem" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-empty
|
||||
v-else
|
||||
:description="isLoading ? '正在加载协议配置' : '暂无可用协议'"
|
||||
/>
|
||||
<footer class="footer" v-entrance-transition>
|
||||
<p>技术支持:夜雨</p>
|
||||
<p>联系技术:imyeyu@qq.com</p>
|
||||
<p>短信服务支持:广州易保网络科技有限公司</p>
|
||||
<p>Copyright © 2026 imyeyu.com</p>
|
||||
</footer>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -153,7 +157,7 @@ onMounted(async () => {
|
||||
.about-page {
|
||||
gap: 1rem;
|
||||
display: flex;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 5rem;
|
||||
padding: 0 0 5rem;
|
||||
flex-direction: column;
|
||||
|
||||
.brand {
|
||||
|
||||
@@ -1,31 +1,35 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div class="agreement-page">
|
||||
<template v-if="article">
|
||||
<header class="header" v-entrance-transition>
|
||||
<h3 v-text="article.title || '协议'" />
|
||||
<markdown-view
|
||||
v-if="article.description"
|
||||
class="description"
|
||||
:content="article.description"
|
||||
/>
|
||||
</header>
|
||||
<article-view
|
||||
:article="article"
|
||||
empty-text="暂无协议正文"
|
||||
:resolve-attachment-url="resolveAttachmentUrl"
|
||||
/>
|
||||
</template>
|
||||
<t-empty
|
||||
v-else
|
||||
:description="isLoading ? '正在加载协议' : '协议不存在'"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main class="page-content scroll column">
|
||||
<div class="agreement-page">
|
||||
<template v-if="article">
|
||||
<header class="header" v-entrance-transition>
|
||||
<h3 v-text="article.title || '协议'" />
|
||||
<markdown-view
|
||||
v-if="article.description"
|
||||
class="description"
|
||||
:content="article.description"
|
||||
/>
|
||||
</header>
|
||||
<article-view
|
||||
:article="article"
|
||||
empty-text="暂无协议正文"
|
||||
:resolve-attachment-url="resolveAttachmentUrl"
|
||||
/>
|
||||
</template>
|
||||
<t-empty
|
||||
v-else
|
||||
:description="isLoading ? '正在加载协议' : '协议不存在'"
|
||||
/>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -96,7 +100,7 @@ watch(() => route.params.id, async () => {
|
||||
|
||||
<style scoped lang="less">
|
||||
.agreement-page {
|
||||
padding: var(--app-nav-height) 0 1rem 0;
|
||||
padding: 0 0 1rem 0;
|
||||
|
||||
.header {
|
||||
padding: .5rem 1rem;
|
||||
|
||||
@@ -1,50 +1,54 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="应用设置"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div class="settings-page">
|
||||
<t-cell-group title="显示" theme="card" v-entrance-transition>
|
||||
<t-cell class="theme" title="显示模式">
|
||||
<template #right-icon>
|
||||
<segmented-slider
|
||||
class="theme-slider"
|
||||
:model-value="globalUIStore.themeMode"
|
||||
:options="themeOptions"
|
||||
@change="handleThemeChange"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group title="声音" theme="card" v-entrance-transition>
|
||||
<t-cell title="扫码成功">
|
||||
<template #right-icon>
|
||||
<t-switch :model-value="settingStore.sound.scanSuccess" @change="value => handleScanSuccessChange(value === true)" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="登记成功">
|
||||
<template #right-icon>
|
||||
<t-switch :model-value="settingStore.sound.registerSuccess" @change="value => handleRegisterSuccessChange(value === true)" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="音量">
|
||||
<template #right-icon>
|
||||
<div class="volume-field">
|
||||
<t-slider
|
||||
:model-value="settingStore.sound.volume"
|
||||
:min="0"
|
||||
:max="100"
|
||||
:step="1"
|
||||
@change="handleVolumeChange"
|
||||
/>
|
||||
<span v-text="`${settingStore.sound.volume}%`" />
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="应用设置"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main class="page-content scroll column">
|
||||
<div class="settings-page">
|
||||
<t-cell-group title="显示" theme="card" v-entrance-transition>
|
||||
<t-cell class="theme" title="显示模式">
|
||||
<template #right-icon>
|
||||
<segmented-slider
|
||||
class="theme-slider"
|
||||
:model-value="globalUIStore.themeMode"
|
||||
:options="themeOptions"
|
||||
@change="handleThemeChange"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group title="声音" theme="card" v-entrance-transition>
|
||||
<t-cell title="扫码成功">
|
||||
<template #right-icon>
|
||||
<t-switch :model-value="settingStore.sound.scanSuccess" @change="value => handleScanSuccessChange(value === true)" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="登记成功">
|
||||
<template #right-icon>
|
||||
<t-switch :model-value="settingStore.sound.registerSuccess" @change="value => handleRegisterSuccessChange(value === true)" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="音量">
|
||||
<template #right-icon>
|
||||
<div class="volume-field">
|
||||
<t-slider
|
||||
:model-value="settingStore.sound.volume"
|
||||
:min="0"
|
||||
:max="100"
|
||||
:step="1"
|
||||
@change="handleVolumeChange"
|
||||
/>
|
||||
<span v-text="`${settingStore.sound.volume}%`" />
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -112,7 +116,7 @@ async function playSettingSoundPreview(type: "scanSuccess" | "registerSuccess"):
|
||||
|
||||
<style scoped lang="less">
|
||||
.settings-page {
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 1rem 0;
|
||||
padding: 0 0 1rem 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
+44
-51
@@ -1,45 +1,49 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="使用说明"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div class="help-page empty-cell-title-margin">
|
||||
<div class="filters glass">
|
||||
<t-input
|
||||
v-model.trim="searchKeyword"
|
||||
class="search"
|
||||
type="search"
|
||||
borderless
|
||||
aria-label="搜索使用说明"
|
||||
placeholder="搜索使用说明"
|
||||
>
|
||||
<template #prefix-icon>
|
||||
<t-icon name="search" />
|
||||
</template>
|
||||
</t-input>
|
||||
</div>
|
||||
<t-cell-group v-if="visibleItemList.length" theme="card">
|
||||
<t-cell
|
||||
v-for="entry in visibleItemList"
|
||||
:key="entry.path.join('-')"
|
||||
:title="entry.item.title"
|
||||
:description="entry.description"
|
||||
arrow
|
||||
v-entrance-transition="{ step: 30 }"
|
||||
@click="openItem(entry)"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-icon :name="getItemIcon(entry.item)" size="1.75rem" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-empty
|
||||
v-else
|
||||
:description="emptyDescription"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="使用说明"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main class="page-content scroll column list help-page">
|
||||
<div class="pull-refresh empty-cell-title-margin">
|
||||
<div class="filters glass">
|
||||
<t-input
|
||||
v-model.trim="searchKeyword"
|
||||
class="search"
|
||||
type="search"
|
||||
borderless
|
||||
aria-label="搜索使用说明"
|
||||
placeholder="搜索使用说明"
|
||||
>
|
||||
<template #prefix-icon>
|
||||
<t-icon name="search" />
|
||||
</template>
|
||||
</t-input>
|
||||
</div>
|
||||
<t-cell-group v-if="visibleItemList.length" theme="card">
|
||||
<t-cell
|
||||
v-for="entry in visibleItemList"
|
||||
:key="entry.path.join('-')"
|
||||
:title="entry.item.title"
|
||||
:description="entry.description"
|
||||
arrow
|
||||
v-entrance-transition="{ step: 30 }"
|
||||
@click="openItem(entry)"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-icon :name="getItemIcon(entry.item)" size="1.75rem" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-empty
|
||||
v-else
|
||||
:description="emptyDescription"
|
||||
/>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -295,19 +299,8 @@ onMounted(async () => {
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.help-page {
|
||||
display: flex;
|
||||
padding: var(--app-nav-height) 0 1rem;
|
||||
flex-direction: column;
|
||||
|
||||
}
|
||||
|
||||
:global(html.theme-dark) {
|
||||
.help-page {
|
||||
.search-wrap {
|
||||
background: #10161f;
|
||||
}
|
||||
|
||||
.search {
|
||||
background: rgba(30, 41, 59, .9);
|
||||
}
|
||||
|
||||
@@ -1,24 +1,28 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="pageNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div class="help-article-page">
|
||||
<template v-if="article">
|
||||
<article-view
|
||||
:article="article"
|
||||
empty-text="暂无使用说明正文"
|
||||
v-entrance-transition
|
||||
:resolve-attachment-url="resolveAttachmentUrl"
|
||||
/>
|
||||
</template>
|
||||
<t-empty
|
||||
v-else
|
||||
:description="isLoading ? '正在加载使用说明' : '使用说明不存在'"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="pageNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main class="page-content scroll column">
|
||||
<div class="help-article-page">
|
||||
<template v-if="article">
|
||||
<article-view
|
||||
:article="article"
|
||||
empty-text="暂无使用说明正文"
|
||||
v-entrance-transition
|
||||
:resolve-attachment-url="resolveAttachmentUrl"
|
||||
/>
|
||||
</template>
|
||||
<t-empty
|
||||
v-else
|
||||
:description="isLoading ? '正在加载使用说明' : '使用说明不存在'"
|
||||
/>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -91,7 +95,7 @@ onBeforeRouteLeave(() => {
|
||||
|
||||
<style scoped lang="less">
|
||||
.help-article-page {
|
||||
padding: var(--app-nav-height) 0 1rem;
|
||||
padding: 0 0 1rem;
|
||||
|
||||
.header {
|
||||
padding: .5rem 1rem;
|
||||
|
||||
@@ -1,94 +1,98 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="营业日管理"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div
|
||||
v-if="store"
|
||||
v-can="permissionCodes.store.read"
|
||||
class="store-business-day-calendar"
|
||||
>
|
||||
<header class="summary bg-white" v-entrance-transition>
|
||||
<header class="header">
|
||||
<div class="text-bold" v-text="store.name" />
|
||||
<t-tag variant="outline" :content="store.code" />
|
||||
</header>
|
||||
<div class="address gray">
|
||||
<span>地址:</span>
|
||||
<span v-text="store.address" />
|
||||
</div>
|
||||
</header>
|
||||
<card-container
|
||||
class="calendar-card"
|
||||
description="设置门店休息日,该日无任何登记记录不视为中断连续登记事件。已有登记不可设为休息,标记休息不能产生登记"
|
||||
tips="点击日期即可新增营休日"
|
||||
v-entrance-transition
|
||||
>
|
||||
<t-calendar
|
||||
:key="calendarRenderKey"
|
||||
class="calendar"
|
||||
:value="selectedCalendarDate"
|
||||
:min-date="calendarMinDate"
|
||||
:max-date="calendarMaxDate"
|
||||
:format="calendarFormat"
|
||||
switch-mode="month"
|
||||
:use-popup="false"
|
||||
@panel-change="handlePanelChange"
|
||||
@select="selectCalendarDate"
|
||||
/>
|
||||
<div v-if="isCalendarLoading" class="loading" v-text="'正在加载当月营业日'" />
|
||||
</card-container>
|
||||
</div>
|
||||
<t-popup v-model="editorVisible" placement="bottom">
|
||||
<div class="editor">
|
||||
<div class="header">
|
||||
<div class="text-bold" v-text="editingId ? '编辑营业日' : '新增营业日'" />
|
||||
<div v-text="formModel.dateText" />
|
||||
</div>
|
||||
<t-form>
|
||||
<t-form-item label="状态">
|
||||
<t-radio-group v-model="formModel.status" variant="default-filled">
|
||||
<t-radio :block="false" borderless value="OPEN">营业</t-radio>
|
||||
<t-radio :block="false" borderless value="CLOSED">休息</t-radio>
|
||||
</t-radio-group>
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
class="reason"
|
||||
:class="{ 'is-hidden': formModel.status !== 'CLOSED' }"
|
||||
label="原因"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="营业日管理"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main class="page-content scroll column">
|
||||
<div
|
||||
v-if="store"
|
||||
v-can="permissionCodes.store.read"
|
||||
class="store-business-day-calendar"
|
||||
>
|
||||
<header class="summary bg-white" v-entrance-transition>
|
||||
<header class="header">
|
||||
<div class="text-bold" v-text="store.name" />
|
||||
<t-tag variant="outline" :content="store.code" />
|
||||
</header>
|
||||
<div class="address gray">
|
||||
<span>地址:</span>
|
||||
<span v-text="store.address" />
|
||||
</div>
|
||||
</header>
|
||||
<card-container
|
||||
class="calendar-card"
|
||||
description="设置门店休息日,该日无任何登记记录不视为中断连续登记事件。已有登记不可设为休息,标记休息不能产生登记"
|
||||
tips="点击日期即可新增营休日"
|
||||
v-entrance-transition
|
||||
>
|
||||
<t-input
|
||||
v-model.trim="formModel.reason"
|
||||
:disabled="formModel.status !== 'CLOSED'"
|
||||
placeholder="休息原因或备注"
|
||||
borderless
|
||||
<t-calendar
|
||||
:key="calendarRenderKey"
|
||||
class="calendar"
|
||||
:value="selectedCalendarDate"
|
||||
:min-date="calendarMinDate"
|
||||
:max-date="calendarMaxDate"
|
||||
:format="calendarFormat"
|
||||
switch-mode="month"
|
||||
:use-popup="false"
|
||||
@panel-change="handlePanelChange"
|
||||
@select="selectCalendarDate"
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<span class="hint orange">切换营业或休息可能影响连续登记统计,系统重排营业日事件序列可能需要较长时间。</span>
|
||||
<div class="actions">
|
||||
<t-button
|
||||
v-if="editingId"
|
||||
v-can="deletePermissionCode"
|
||||
class="action"
|
||||
theme="danger"
|
||||
variant="outline"
|
||||
:loading="isDeleting"
|
||||
@click="confirmRemoveDay"
|
||||
>删除</t-button>
|
||||
<t-button
|
||||
v-can="savePermissionCode"
|
||||
class="action"
|
||||
theme="primary"
|
||||
:loading="isSaving"
|
||||
@click="saveDay"
|
||||
>保存</t-button>
|
||||
<div v-if="isCalendarLoading" class="loading" v-text="'正在加载当月营业日'" />
|
||||
</card-container>
|
||||
</div>
|
||||
</div>
|
||||
</t-popup>
|
||||
</main>
|
||||
<t-popup v-model="editorVisible" placement="bottom">
|
||||
<div class="editor">
|
||||
<div class="header">
|
||||
<div class="text-bold" v-text="editingId ? '编辑营业日' : '新增营业日'" />
|
||||
<div v-text="formModel.dateText" />
|
||||
</div>
|
||||
<t-form>
|
||||
<t-form-item label="状态">
|
||||
<t-radio-group v-model="formModel.status" variant="default-filled">
|
||||
<t-radio :block="false" borderless value="OPEN">营业</t-radio>
|
||||
<t-radio :block="false" borderless value="CLOSED">休息</t-radio>
|
||||
</t-radio-group>
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
class="reason"
|
||||
:class="{ 'is-hidden': formModel.status !== 'CLOSED' }"
|
||||
label="原因"
|
||||
>
|
||||
<t-input
|
||||
v-model.trim="formModel.reason"
|
||||
:disabled="formModel.status !== 'CLOSED'"
|
||||
placeholder="休息原因或备注"
|
||||
borderless
|
||||
/>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<span class="hint orange">切换营业或休息可能影响连续登记统计,系统重排营业日事件序列可能需要较长时间。</span>
|
||||
<div class="actions">
|
||||
<t-button
|
||||
v-if="editingId"
|
||||
v-can="deletePermissionCode"
|
||||
class="action"
|
||||
theme="danger"
|
||||
variant="outline"
|
||||
:loading="isDeleting"
|
||||
@click="confirmRemoveDay"
|
||||
>删除</t-button>
|
||||
<t-button
|
||||
v-can="savePermissionCode"
|
||||
class="action"
|
||||
theme="primary"
|
||||
:loading="isSaving"
|
||||
@click="saveDay"
|
||||
>保存</t-button>
|
||||
</div>
|
||||
</div>
|
||||
</t-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -331,7 +335,7 @@ onMounted(async () => {
|
||||
.store-business-day-calendar {
|
||||
gap: .75rem;
|
||||
display: grid;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 6rem;
|
||||
padding: 0 0 6rem;
|
||||
|
||||
.summary {
|
||||
gap: .75rem;
|
||||
|
||||
@@ -1,76 +1,80 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="门店日记详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="article?.id && canUpdate && !isDeleting"
|
||||
@click="toEdit"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="编辑"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="permissionCodes.storeDiary.read" class="store-diary-detail">
|
||||
<template v-if="article">
|
||||
<header class="header" v-entrance-transition>
|
||||
<h1 v-text="article.title || '未命名日记'" />
|
||||
<div v-if="article.description" class="description" v-text="article.description" />
|
||||
<time-label
|
||||
class="time gray"
|
||||
v-if="article.createdAt"
|
||||
:timestamp="article.createdAt"
|
||||
underline
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="门店日记详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="article?.id && canUpdate && !isDeleting"
|
||||
@click="toEdit"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="编辑"
|
||||
/>
|
||||
</header>
|
||||
<div v-if="additionalPhotoItemList.length" class="additional-photos-wrapper" v-entrance-transition>
|
||||
<attachment-selector :items="additionalPhotoItemList" readonly />
|
||||
</div>
|
||||
<section class="content" v-entrance-transition>
|
||||
<article-view
|
||||
:article="article"
|
||||
empty-text="暂无日记正文"
|
||||
:resolve-attachment-url="resolveAttachmentUrl"
|
||||
/>
|
||||
</section>
|
||||
<footer class="footer gray">
|
||||
<div class="updater">
|
||||
<div>最近更新人:</div>
|
||||
<div v-if="article.updater" class="updater">
|
||||
<t-image
|
||||
class="avatar"
|
||||
:src="getUpdaterAvatar(article.updater)"
|
||||
:alt="getUpdaterName(article.updater)"
|
||||
fit="cover"
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="permissionCodes.storeDiary.read" class="store-diary-detail">
|
||||
<template v-if="article">
|
||||
<header class="header" v-entrance-transition>
|
||||
<h1 v-text="article.title || '未命名日记'" />
|
||||
<div v-if="article.description" class="description" v-text="article.description" />
|
||||
<time-label
|
||||
class="time gray"
|
||||
v-if="article.createdAt"
|
||||
:timestamp="article.createdAt"
|
||||
underline
|
||||
/>
|
||||
<span v-text="getUpdaterName(article.updater)" />
|
||||
</header>
|
||||
<div v-if="additionalPhotoItemList.length" class="additional-photos-wrapper" v-entrance-transition>
|
||||
<attachment-selector :items="additionalPhotoItemList" readonly />
|
||||
</div>
|
||||
<span v-else v-text="'未知用户'" />
|
||||
</div>
|
||||
<div class="updated-at">
|
||||
<span>最近更新时间:</span>
|
||||
<time-label v-if="article.updatedAt" :timestamp="article.updatedAt" />
|
||||
<span v-else v-text="'未知时间'" />
|
||||
</div>
|
||||
</footer>
|
||||
<t-button
|
||||
v-if="canDelete"
|
||||
class="delete cell-button"
|
||||
theme="danger"
|
||||
block
|
||||
:loading="isDeleting"
|
||||
@click="confirmDelete"
|
||||
>
|
||||
删除日记
|
||||
</t-button>
|
||||
</template>
|
||||
<t-empty v-else :description="isLoading ? '正在加载门店日记' : '门店日记不存在'" />
|
||||
<section class="content" v-entrance-transition>
|
||||
<article-view
|
||||
:article="article"
|
||||
empty-text="暂无日记正文"
|
||||
:resolve-attachment-url="resolveAttachmentUrl"
|
||||
/>
|
||||
</section>
|
||||
<footer class="footer gray">
|
||||
<div class="updater">
|
||||
<div>最近更新人:</div>
|
||||
<div v-if="article.updater" class="updater">
|
||||
<t-image
|
||||
class="avatar"
|
||||
:src="getUpdaterAvatar(article.updater)"
|
||||
:alt="getUpdaterName(article.updater)"
|
||||
fit="cover"
|
||||
/>
|
||||
<span v-text="getUpdaterName(article.updater)" />
|
||||
</div>
|
||||
<span v-else v-text="'未知用户'" />
|
||||
</div>
|
||||
<div class="updated-at">
|
||||
<span>最近更新时间:</span>
|
||||
<time-label v-if="article.updatedAt" :timestamp="article.updatedAt" />
|
||||
<span v-else v-text="'未知时间'" />
|
||||
</div>
|
||||
</footer>
|
||||
<t-button
|
||||
v-if="canDelete"
|
||||
class="delete cell-button"
|
||||
theme="danger"
|
||||
block
|
||||
:loading="isDeleting"
|
||||
@click="confirmDelete"
|
||||
>
|
||||
删除日记
|
||||
</t-button>
|
||||
</template>
|
||||
<t-empty v-else :description="isLoading ? '正在加载门店日记' : '门店日记不存在'" />
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -213,7 +217,7 @@ onMounted(loadArticle);
|
||||
|
||||
<style scoped lang="less">
|
||||
.store-diary-detail {
|
||||
padding: var(--app-nav-height) 0 calc(1rem + env(safe-area-inset-bottom, 0));
|
||||
padding: 0 0 calc(1rem + env(safe-area-inset-bottom, 0));
|
||||
|
||||
.header {
|
||||
margin: 0 1rem;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll list">
|
||||
<main class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
v-can="permissionCodes.storeDiary.read"
|
||||
class="store-diary-list pull-refresh"
|
||||
|
||||
@@ -1,75 +1,79 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(savePermissionCode)"
|
||||
@click="doSave"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="保存"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="savePermissionCode" class="store-edit">
|
||||
<t-form class="form card" v-entrance-transition>
|
||||
<t-form-item v-if="!isStoreManagerScope" label="编码">
|
||||
<t-input v-model.trim="formData.code" placeholder="门店编码" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item label="名称">
|
||||
<t-input v-model.trim="formData.name" placeholder="门店名称" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="!isStoreManagerScope" label="启用" content-align="right">
|
||||
<t-switch v-model="formData.status" :custom-value="['ACTIVE', 'INACTIVE']" />
|
||||
</t-form-item>
|
||||
<t-form-item label="电话">
|
||||
<t-input v-model.trim="formData.telephone" type="tel" placeholder="联系电话" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item label="地址">
|
||||
<t-input v-model.trim="formData.address" placeholder="门店地址" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea v-model.trim="formData.remark" class="textarea" placeholder="备注" autosize borderless />
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-cell-group v-if="!isCreateMode" theme="card" v-entrance-transition>
|
||||
<t-cell
|
||||
title="营业日管理"
|
||||
note="配置营业或休息日期"
|
||||
arrow
|
||||
@click="router.push(`/management/stores/${routeId}/business-days`)"
|
||||
/>
|
||||
<t-cell
|
||||
title="自动休息日"
|
||||
description="全天无任何登记记录时自动判定为休息日,休息日不视为中断连续登记事件"
|
||||
>
|
||||
<template #right-icon>
|
||||
<t-switch v-model="formData.autoClosedDay" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-button
|
||||
v-if="!isCreateMode && !isStoreManagerScope"
|
||||
v-can="permissionCodes.store.delete"
|
||||
class="cell-button"
|
||||
theme="danger"
|
||||
:loading="isRemoving"
|
||||
content="删除"
|
||||
v-entrance-transition
|
||||
@click="confirmRemoveStore"
|
||||
/>
|
||||
<store-remove-dialog
|
||||
v-model:visible="removeDialogVisible"
|
||||
:store="formData"
|
||||
:loading="isRemoving"
|
||||
@confirm="removeConfirmedStore"
|
||||
/>
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(savePermissionCode)"
|
||||
@click="doSave"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="保存"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="savePermissionCode" class="store-edit">
|
||||
<t-form class="form card" v-entrance-transition>
|
||||
<t-form-item v-if="!isStoreManagerScope" label="编码">
|
||||
<t-input v-model.trim="formData.code" placeholder="门店编码" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item label="名称">
|
||||
<t-input v-model.trim="formData.name" placeholder="门店名称" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="!isStoreManagerScope" label="启用" content-align="right">
|
||||
<t-switch v-model="formData.status" :custom-value="['ACTIVE', 'INACTIVE']" />
|
||||
</t-form-item>
|
||||
<t-form-item label="电话">
|
||||
<t-input v-model.trim="formData.telephone" type="tel" placeholder="联系电话" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item label="地址">
|
||||
<t-input v-model.trim="formData.address" placeholder="门店地址" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item label="备注">
|
||||
<t-textarea v-model.trim="formData.remark" class="textarea" placeholder="备注" autosize borderless />
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-cell-group v-if="!isCreateMode" theme="card" v-entrance-transition>
|
||||
<t-cell
|
||||
title="营业日管理"
|
||||
note="配置营业或休息日期"
|
||||
arrow
|
||||
@click="router.push(`/management/stores/${routeId}/business-days`)"
|
||||
/>
|
||||
<t-cell
|
||||
title="自动休息日"
|
||||
description="全天无任何登记记录时自动判定为休息日,休息日不视为中断连续登记事件"
|
||||
>
|
||||
<template #right-icon>
|
||||
<t-switch v-model="formData.autoClosedDay" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-button
|
||||
v-if="!isCreateMode && !isStoreManagerScope"
|
||||
v-can="permissionCodes.store.delete"
|
||||
class="cell-button"
|
||||
theme="danger"
|
||||
:loading="isRemoving"
|
||||
content="删除"
|
||||
v-entrance-transition
|
||||
@click="confirmRemoveStore"
|
||||
/>
|
||||
<store-remove-dialog
|
||||
v-model:visible="removeDialogVisible"
|
||||
:store="formData"
|
||||
:loading="isRemoving"
|
||||
@confirm="removeConfirmedStore"
|
||||
/>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -222,7 +226,7 @@ async function removeStore(id: string): Promise<void> {
|
||||
<style scoped lang="less">
|
||||
.store-edit {
|
||||
gap: 1rem;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 calc(1rem + env(safe-area-inset-bottom, 0)) 0;
|
||||
padding: 0 0 calc(1rem + env(safe-area-inset-bottom, 0)) 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main v-can="corePermissionCodes.tag.read" class="page-content scroll list">
|
||||
<main v-can="corePermissionCodes.tag.read" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main v-can="corePermissionCodes.tag.read" class="page-content scroll list">
|
||||
<main v-can="corePermissionCodes.tag.read" class="page-content scroll column list">
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh"
|
||||
v-model="isRefreshing"
|
||||
|
||||
@@ -1,74 +1,78 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="用户详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="currentUser && userStore.hasPermissions(permissionCodes.user.update)"
|
||||
@click="toEdit"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="编辑"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div
|
||||
v-if="managedUser"
|
||||
v-can="permissionCodes.user.read"
|
||||
class="user-edit"
|
||||
>
|
||||
<t-cell-group v-if="managedUser.user" theme="card" v-entrance-transition>
|
||||
<t-cell
|
||||
:title="managedUser.user.nick || managedUser.user.name"
|
||||
:description="getRoleDisplayName(getManagedUserRoleList(managedUser)[0], permissionStore.roleList)"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="用户详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="currentUser && userStore.hasPermissions(permissionCodes.user.update)"
|
||||
@click="toEdit"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="编辑"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div
|
||||
v-if="managedUser"
|
||||
v-can="permissionCodes.user.read"
|
||||
class="user-edit"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-image
|
||||
class="avatar"
|
||||
:src="buildUserAvatar(managedUser.user)"
|
||||
:alt="managedUser.user.nick || managedUser.user.name"
|
||||
fit="cover"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-if="managedUser.user" theme="card" v-entrance-transition>
|
||||
<t-cell title="状态" :note="managedUser.enabled ? '启用' : '禁用'" />
|
||||
<t-cell title="备注" :note="managedUser.remark" />
|
||||
<t-cell title="手机号">
|
||||
<template #note>
|
||||
<telephone-link :value="managedUser.user.phoneNo" placeholder="未填写" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="上次登录时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="managedUser.user.lastLoginAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-if="currentUser" theme="card" v-entrance-transition>
|
||||
<t-cell
|
||||
v-can="permissionCodes.user.update"
|
||||
title="配置角色"
|
||||
note="为用户授权业务角色"
|
||||
arrow
|
||||
hover
|
||||
@click="toRoleAssign"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-icon name="usergroup" size="1.75rem" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-if="currentUser" title="可登记事件" theme="card" v-entrance-transition>
|
||||
<t-cell v-for="item in scopeList" :key="item.id" :title="item.name"/>
|
||||
<t-cell v-if="!scopeList.length" title="未配置" />
|
||||
</t-cell-group>
|
||||
<t-cell-group v-if="managedUser.user" theme="card" v-entrance-transition>
|
||||
<t-cell
|
||||
:title="managedUser.user.nick || managedUser.user.name"
|
||||
:description="getRoleDisplayName(getManagedUserRoleList(managedUser)[0], permissionStore.roleList)"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-image
|
||||
class="avatar"
|
||||
:src="buildUserAvatar(managedUser.user)"
|
||||
:alt="managedUser.user.nick || managedUser.user.name"
|
||||
fit="cover"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-if="managedUser.user" theme="card" v-entrance-transition>
|
||||
<t-cell title="状态" :note="managedUser.enabled ? '启用' : '禁用'" />
|
||||
<t-cell title="备注" :note="managedUser.remark" />
|
||||
<t-cell title="手机号">
|
||||
<template #note>
|
||||
<telephone-link :value="managedUser.user.phoneNo" placeholder="未填写" />
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="上次登录时间">
|
||||
<template #note>
|
||||
<time-label :timestamp="managedUser.user.lastLoginAt" underline />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-if="currentUser" theme="card" v-entrance-transition>
|
||||
<t-cell
|
||||
v-can="permissionCodes.user.update"
|
||||
title="配置角色"
|
||||
note="为用户授权业务角色"
|
||||
arrow
|
||||
hover
|
||||
@click="toRoleAssign"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-icon name="usergroup" size="1.75rem" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-if="currentUser" title="可登记事件" theme="card" v-entrance-transition>
|
||||
<t-cell v-for="item in scopeList" :key="item.id" :title="item.name"/>
|
||||
<t-cell v-if="!scopeList.length" title="未配置" />
|
||||
</t-cell-group>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -213,7 +217,7 @@ onMounted(async () => {
|
||||
.user-edit {
|
||||
gap: 1rem;
|
||||
display: flex;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 4rem 0;
|
||||
padding: 0 0 4rem 0;
|
||||
flex-direction: column;
|
||||
|
||||
.avatar {
|
||||
|
||||
+46
-42
@@ -1,47 +1,51 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(savePermissionCode)"
|
||||
@click="saveUser"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="保存"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
:title="routeNavBarTitle"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="userStore.hasPermissions(savePermissionCode)"
|
||||
@click="saveUser"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="保存"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div v-can="savePermissionCode" class="user-edit">
|
||||
<t-form class="form card">
|
||||
<t-form-item label="姓名">
|
||||
<t-input v-model.trim="formModel.name" placeholder="姓名" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="isCreateMode" label="手机号">
|
||||
<t-input v-model.trim="formModel.mobile" type="tel" placeholder="手机号" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="isCreateMode" label="密码">
|
||||
<t-input v-model.trim="formModel.password" type="password" placeholder="密码" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="isGlobalManager" label="门店" arrow @click="openStorePicker">
|
||||
<div class="picker-text" v-text="selectedStoreName" />
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</div>
|
||||
</main>
|
||||
<t-popup v-model="storePickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="storePickerDraft"
|
||||
:columns="storePickerColumns"
|
||||
title="选择门店"
|
||||
@cancel="storePickerVisible = false"
|
||||
@confirm="confirmStorePicker"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div v-can="savePermissionCode" class="user-edit">
|
||||
<t-form class="form card">
|
||||
<t-form-item label="姓名">
|
||||
<t-input v-model.trim="formModel.name" placeholder="姓名" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="isCreateMode" label="手机号">
|
||||
<t-input v-model.trim="formModel.mobile" type="tel" placeholder="手机号" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="isCreateMode" label="密码">
|
||||
<t-input v-model.trim="formModel.password" type="password" placeholder="密码" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item v-if="isGlobalManager" label="门店" arrow @click="openStorePicker">
|
||||
<div class="picker-text" v-text="selectedStoreName" />
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</t-popup>
|
||||
</div>
|
||||
<t-popup v-model="storePickerVisible" placement="bottom">
|
||||
<t-picker
|
||||
v-model="storePickerDraft"
|
||||
:columns="storePickerColumns"
|
||||
title="选择门店"
|
||||
@cancel="storePickerVisible = false"
|
||||
@confirm="confirmStorePicker"
|
||||
/>
|
||||
</t-popup>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -244,7 +248,7 @@ onMounted(async () => {
|
||||
|
||||
<style scoped lang="less">
|
||||
.user-edit {
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 4rem 0;
|
||||
padding: 0 0 4rem 0;
|
||||
|
||||
.form {
|
||||
border-radius: 1rem;
|
||||
|
||||
@@ -1,36 +1,40 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="邀请注册海报"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div class="poster-page">
|
||||
<section class="poster-wrap" v-entrance-transition>
|
||||
<img v-if="posterImage" class="poster" :src="posterImage" alt="邀请注册海报" />
|
||||
<center-tips v-else :content="message" />
|
||||
</section>
|
||||
<div
|
||||
class="tips gray"
|
||||
v-entrance-transition
|
||||
>微信内可能无法发起下载海报,可长按保存为图片、转发连接或使用默认浏览器打开</div>
|
||||
<div v-if="posterImage" class="actions" v-entrance-transition>
|
||||
<t-button
|
||||
class="button bg-white"
|
||||
variant="outline"
|
||||
theme="primary"
|
||||
block
|
||||
@click="copyLink"
|
||||
>复制链接</t-button>
|
||||
<t-button
|
||||
class="button"
|
||||
theme="primary"
|
||||
block
|
||||
:loading="isDownloading"
|
||||
@click="savePoster"
|
||||
>下载海报</t-button>
|
||||
</div>
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="邀请注册海报"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main class="page-content scroll column">
|
||||
<div class="poster-page">
|
||||
<section class="poster-wrap" v-entrance-transition>
|
||||
<img v-if="posterImage" class="poster" :src="posterImage" alt="邀请注册海报" />
|
||||
<center-tips v-else :content="message" />
|
||||
</section>
|
||||
<div
|
||||
class="tips gray"
|
||||
v-entrance-transition
|
||||
>微信内可能无法发起下载海报,可长按保存为图片、转发连接或使用默认浏览器打开</div>
|
||||
<div v-if="posterImage" class="actions" v-entrance-transition>
|
||||
<t-button
|
||||
class="button bg-white"
|
||||
variant="outline"
|
||||
theme="primary"
|
||||
block
|
||||
@click="copyLink"
|
||||
>复制链接</t-button>
|
||||
<t-button
|
||||
class="button"
|
||||
theme="primary"
|
||||
block
|
||||
:loading="isDownloading"
|
||||
@click="savePoster"
|
||||
>下载海报</t-button>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -102,7 +106,7 @@ onMounted(() => {
|
||||
.poster-page {
|
||||
gap: 1rem;
|
||||
min-height: 100vh;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 1rem 6rem;
|
||||
padding: 0 1rem 6rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</t-navbar>
|
||||
<main
|
||||
v-can="permissionCodes.user.read"
|
||||
class="page-content scroll list"
|
||||
class="page-content scroll column list"
|
||||
>
|
||||
<t-pull-down-refresh
|
||||
class="pull-refresh"
|
||||
|
||||
@@ -1,30 +1,34 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="修改密码"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<div class="password-page">
|
||||
<t-form class="form card" v-entrance-transition>
|
||||
<t-form-item label="旧密码">
|
||||
<t-input v-model.trim="formModel.oldPassword" type="password" placeholder="旧密码" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item label="新密码">
|
||||
<t-input v-model.trim="formModel.newPassword" type="password" placeholder="新密码" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item label="确认密码">
|
||||
<t-input v-model.trim="formModel.confirmPassword" type="password" placeholder="确认密码" borderless />
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-button
|
||||
class="save cell-button"
|
||||
theme="primary"
|
||||
:loading="isSaving"
|
||||
v-entrance-transition
|
||||
@click="savePassword"
|
||||
>保存</t-button>
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="修改密码"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
/>
|
||||
<main class="page-content scroll column">
|
||||
<div class="password-page">
|
||||
<t-form class="form card" v-entrance-transition>
|
||||
<t-form-item label="旧密码">
|
||||
<t-input v-model.trim="formModel.oldPassword" type="password" placeholder="旧密码" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item label="新密码">
|
||||
<t-input v-model.trim="formModel.newPassword" type="password" placeholder="新密码" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item label="确认密码">
|
||||
<t-input v-model.trim="formModel.confirmPassword" type="password" placeholder="确认密码" borderless />
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-button
|
||||
class="save cell-button"
|
||||
theme="primary"
|
||||
:loading="isSaving"
|
||||
v-entrance-transition
|
||||
@click="savePassword"
|
||||
>保存</t-button>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -78,7 +82,7 @@ async function savePassword(): Promise<void> {
|
||||
.password-page {
|
||||
gap: 1rem;
|
||||
display: flex;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 4rem 0;
|
||||
padding: 0 0 4rem 0;
|
||||
flex-direction: column;
|
||||
|
||||
.form {
|
||||
|
||||
@@ -1,71 +1,75 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="当前用户"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
@click="saveProfile"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="保存"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div class="profile-page">
|
||||
<t-form class="form card" v-entrance-transition>
|
||||
<t-form-item label="头像">
|
||||
<photo-field
|
||||
v-model="formModel.avatar"
|
||||
add-text="更换"
|
||||
alt-text="用户头像"
|
||||
size="compact"
|
||||
:loading="isAvatarUploading"
|
||||
:preview="false"
|
||||
:show-remove="false"
|
||||
@add="changeAvatar"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="用户名">
|
||||
<t-input v-model.trim="formModel.name" placeholder="用户名" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item label="昵称">
|
||||
<t-input v-model.trim="formModel.nickname" placeholder="昵称" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item label="性别">
|
||||
<t-radio-group class="sex" v-model="formModel.gender" variant="default-filled">
|
||||
<t-radio :block="false" borderless value="MALE">男</t-radio>
|
||||
<t-radio :block="false" borderless value="FEMALE">女</t-radio>
|
||||
<t-radio :block="false" borderless value="">未知</t-radio>
|
||||
</t-radio-group>
|
||||
</t-form-item>
|
||||
<t-form-item label="手机号">
|
||||
<div class="mobile-value">
|
||||
<div v-if="formModel.mobile" v-text="formModel.mobile" />
|
||||
<span v-else v-text="'未填写'" />
|
||||
</div>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-cell-group theme="card" v-entrance-transition>
|
||||
<t-cell title="修改密码" arrow hover @click="toPassword" />
|
||||
</t-cell-group>
|
||||
<t-button
|
||||
class="red bg-white cell-button"
|
||||
variant="text"
|
||||
v-entrance-transition
|
||||
@click="confirmLogout"
|
||||
>退出登录</t-button>
|
||||
<input
|
||||
ref="avatarInputRef"
|
||||
class="avatar-input"
|
||||
type="file"
|
||||
accept="image/*"
|
||||
@change="handleAvatarSelected"
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="当前用户"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
@click="saveProfile"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="保存"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div class="profile-page">
|
||||
<t-form class="form card" v-entrance-transition>
|
||||
<t-form-item label="头像">
|
||||
<photo-field
|
||||
v-model="formModel.avatar"
|
||||
add-text="更换"
|
||||
alt-text="用户头像"
|
||||
size="compact"
|
||||
:loading="isAvatarUploading"
|
||||
:preview="false"
|
||||
:show-remove="false"
|
||||
@add="changeAvatar"
|
||||
/>
|
||||
</t-form-item>
|
||||
<t-form-item label="用户名">
|
||||
<t-input v-model.trim="formModel.name" placeholder="用户名" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item label="昵称">
|
||||
<t-input v-model.trim="formModel.nickname" placeholder="昵称" borderless />
|
||||
</t-form-item>
|
||||
<t-form-item label="性别">
|
||||
<t-radio-group class="sex" v-model="formModel.gender" variant="default-filled">
|
||||
<t-radio :block="false" borderless value="MALE">男</t-radio>
|
||||
<t-radio :block="false" borderless value="FEMALE">女</t-radio>
|
||||
<t-radio :block="false" borderless value="">未知</t-radio>
|
||||
</t-radio-group>
|
||||
</t-form-item>
|
||||
<t-form-item label="手机号">
|
||||
<div class="mobile-value">
|
||||
<div v-if="formModel.mobile" v-text="formModel.mobile" />
|
||||
<span v-else v-text="'未填写'" />
|
||||
</div>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<t-cell-group theme="card" v-entrance-transition>
|
||||
<t-cell title="修改密码" arrow hover @click="toPassword" />
|
||||
</t-cell-group>
|
||||
<t-button
|
||||
class="red bg-white cell-button"
|
||||
variant="text"
|
||||
v-entrance-transition
|
||||
@click="confirmLogout"
|
||||
>退出登录</t-button>
|
||||
<input
|
||||
ref="avatarInputRef"
|
||||
class="avatar-input"
|
||||
type="file"
|
||||
accept="image/*"
|
||||
@change="handleAvatarSelected"
|
||||
>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -240,7 +244,7 @@ onMounted(() => {
|
||||
<style scoped lang="less">
|
||||
.profile-page {
|
||||
gap: 1rem;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 calc(1rem + env(safe-area-inset-bottom, 0)) 0;
|
||||
padding: 0 0 calc(1rem + env(safe-area-inset-bottom, 0)) 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user