1
This commit is contained in:
parent
b92f40734a
commit
697e50c51e
@ -813,6 +813,95 @@ export function returnUnpackTransferByWaybills(
|
||||
} as any)
|
||||
}
|
||||
|
||||
// ============ returnUnpack.transferByOrders ============
|
||||
|
||||
/** returnUnpack.transferByOrders 请求参数 */
|
||||
export type ReturnUnpackTransferByOrdersParams = {
|
||||
/** 订单表主键ID列表(wms_order_delivery*.id,也兼容单个数值;服务端 Number() 归一化 + 过滤非正整数 + 去重,去重后单次上限 200) */
|
||||
ids: number[] | number
|
||||
}
|
||||
|
||||
/** returnUnpack.transferByOrders 成功项 */
|
||||
export type ReturnUnpackTransferByOrdersSuccessItem = {
|
||||
/** 订单ID */
|
||||
order_id: number
|
||||
/** 拆包单ID */
|
||||
unpack_id: number
|
||||
/** 拆包单号 */
|
||||
unpack_no: string
|
||||
/** 写入拆包单的运单号 */
|
||||
waybill_code: string
|
||||
/** 明细行数 */
|
||||
detail_count: number
|
||||
/** 明细数量合计 */
|
||||
total_quantity: number
|
||||
}
|
||||
|
||||
/** returnUnpack.transferByOrders 跳过项(静默跳过,不报错、不阻断其它订单) */
|
||||
export type ReturnUnpackTransferByOrdersSkippedItem = {
|
||||
/** 订单ID */
|
||||
order_id: number
|
||||
/** 跳过原因,如「非库内拦截订单」「订单已存在拆包单」「运单号已存在拆包单」「订单无明细可复制」 */
|
||||
reason: string
|
||||
}
|
||||
|
||||
/** returnUnpack.transferByOrders 失败项(非预期异常) */
|
||||
export type ReturnUnpackTransferByOrdersFailedItem = {
|
||||
/** 订单ID */
|
||||
order_id: number
|
||||
/** 失败原因 */
|
||||
reason: string
|
||||
}
|
||||
|
||||
/** returnUnpack.transferByOrders 响应(逐单处理,单条失败不阻断主流程,HTTP 整体仍成功) */
|
||||
export type ReturnUnpackTransferByOrdersResponse = {
|
||||
code?: number
|
||||
message?: string
|
||||
/** 去重后待处理订单总数 */
|
||||
total: number
|
||||
/** 成功创建拆包单的订单数量 */
|
||||
success_count: number
|
||||
/** 静默跳过的订单数量(非库内拦截/已有拆包单/无运单号/无明细等) */
|
||||
skipped_count: number
|
||||
/** 处理失败的订单数量(非预期异常,如数据库写入失败) */
|
||||
failed_count: number
|
||||
/** 成功项数组 */
|
||||
success: ReturnUnpackTransferByOrdersSuccessItem[]
|
||||
/** 跳过项数组 */
|
||||
skipped: ReturnUnpackTransferByOrdersSkippedItem[]
|
||||
/** 失败项数组 */
|
||||
failed: ReturnUnpackTransferByOrdersFailedItem[]
|
||||
}
|
||||
|
||||
/**
|
||||
* returnUnpack.transferByOrders:配送订单批量转退回拆包单(一次调用把多个配送订单批量转换为退回拆包单)
|
||||
* - `ids` 为订单表主键ID(wms_order_delivery*.id),支持单个数值或数组;服务端 Number() 归一化 + 过滤非正整数 + 去重,去重后单次上限 200
|
||||
* - 仓库隔离:warehouse_id 由服务端从 ctx.user.store_id 注入,禁止前端传入
|
||||
* - 逐单处理,单条失败不阻断主流程;转换限制为「静默跳过」(不报错、不阻断其它订单):
|
||||
* 仅允许「库内拦截」订单(intercept_status=intercepted_at_warehouse,兼容历史值 intercepted);
|
||||
* 已有有效拆包单(同仓库 + order_id 命中,或同运单号已存在,status != 'cancelled')跳过;
|
||||
* 订单不存在/不属于当前仓库、无运单号、无明细可复制的同样跳过
|
||||
* - 每单新建一张拆包单:订单主运单(business_key=1 优先)的 waybill_code 写入拆包单(无运单时回退订单发货单号),
|
||||
* 回填 order_express_id/order_id/store_id/source_order_codes/shop_name
|
||||
* - 明细:订单原本明细 1:1 复制(订单 items 优先,为空回退明细分表),product_status 固定 normal,
|
||||
* 写入后回填主表 total_items/total_quantity/detail_status
|
||||
*/
|
||||
export function returnUnpackTransferByOrders(
|
||||
data: ReturnUnpackTransferByOrdersParams
|
||||
): Promise<ReturnUnpackTransferByOrdersResponse> {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'returnUnpack.transferByOrders',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
// ============ 模块导出 ============
|
||||
|
||||
export const returnUnpackModule = {
|
||||
@ -829,5 +918,6 @@ export const returnUnpackModule = {
|
||||
forceRecord: returnUnpackForceRecord,
|
||||
export: returnUnpackExport,
|
||||
exportTaskProgress: returnUnpackExportTaskProgress,
|
||||
transferByWaybills: returnUnpackTransferByWaybills
|
||||
transferByWaybills: returnUnpackTransferByWaybills,
|
||||
transferByOrders: returnUnpackTransferByOrders
|
||||
}
|
||||
|
||||
@ -444,7 +444,7 @@ async function handleBatchSetPendingFeedback() {
|
||||
await ElMessageBox.confirm(
|
||||
`确认将 ${selectedRows.value.length} 个工单设为"待反馈"状态?`,
|
||||
'批量设待反馈',
|
||||
{ confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }
|
||||
{ confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', buttonSize: 'small' }
|
||||
)
|
||||
} catch {
|
||||
return
|
||||
@ -489,7 +489,7 @@ async function handleBatchStatus(status: 'completed' | 'closed', label: string,
|
||||
await ElMessageBox.confirm(
|
||||
`确认将 ${selectedRows.value.length} 个工单${label}?`,
|
||||
label,
|
||||
{ confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }
|
||||
{ confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', buttonSize: 'small' }
|
||||
)
|
||||
} catch { return }
|
||||
|
||||
|
||||
@ -94,7 +94,8 @@ async function handleActionClick(btn: OperationButtonConfig) {
|
||||
{
|
||||
confirmButtonText: btn.confirmButtonText || '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: (btn.confirmType || 'warning') as any
|
||||
type: (btn.confirmType || 'warning') as any,
|
||||
buttonSize: 'small'
|
||||
}
|
||||
)
|
||||
} catch {
|
||||
|
||||
@ -88,8 +88,8 @@
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="handleClosed">取消</el-button>
|
||||
<el-button type="primary" :loading="saving" @click="submitForm">保存</el-button>
|
||||
<el-button size="small" @click="handleClosed">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="saving" @click="submitForm">保存</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@ -201,6 +201,7 @@ async function handleRefresh() {
|
||||
try {
|
||||
await ElMessageBox.confirm('当前有未保存的关联修改,刷新后将被丢弃,是否继续?', '未保存修改', {
|
||||
type: 'warning',
|
||||
buttonSize: 'small',
|
||||
confirmButtonText: '放弃修改并继续',
|
||||
cancelButtonText: '取消',
|
||||
})
|
||||
|
||||
@ -172,6 +172,7 @@ async function handleRefresh() {
|
||||
try {
|
||||
await ElMessageBox.confirm('当前有未保存的白名单修改,刷新后将被丢弃,是否继续?', '未保存修改', {
|
||||
type: 'warning',
|
||||
buttonSize: 'small',
|
||||
confirmButtonText: '放弃修改并继续',
|
||||
cancelButtonText: '取消',
|
||||
})
|
||||
|
||||
@ -278,6 +278,7 @@ async function handleDelete(row: InboxV2KeywordItem) {
|
||||
try {
|
||||
await ElMessageBox.confirm(`确定删除关键词「${row.keyword}」吗?`, '删除确认', {
|
||||
type: 'warning',
|
||||
buttonSize: 'small',
|
||||
confirmButtonText: '删除',
|
||||
cancelButtonText: '取消',
|
||||
})
|
||||
|
||||
@ -172,6 +172,7 @@ async function handleRefresh() {
|
||||
try {
|
||||
await ElMessageBox.confirm('当前有未保存的关联修改,刷新后将被丢弃,是否继续?', '未保存修改', {
|
||||
type: 'warning',
|
||||
buttonSize: 'small',
|
||||
confirmButtonText: '放弃修改并继续',
|
||||
cancelButtonText: '取消',
|
||||
})
|
||||
|
||||
@ -184,6 +184,7 @@ async function handleRestore() {
|
||||
try {
|
||||
await ElMessageBox.confirm('删除仓库级配置后,该子类型将回退使用系统级配置,确定吗?', '还原确认', {
|
||||
type: 'warning',
|
||||
buttonSize: 'small',
|
||||
confirmButtonText: '还原',
|
||||
cancelButtonText: '取消',
|
||||
})
|
||||
|
||||
@ -429,6 +429,7 @@ async function confirmDiscardChanges(message: string): Promise<boolean> {
|
||||
try {
|
||||
await ElMessageBox.confirm(message, '未保存修改', {
|
||||
type: 'warning',
|
||||
buttonSize: 'small',
|
||||
confirmButtonText: '放弃修改并继续',
|
||||
cancelButtonText: '留在当前页',
|
||||
})
|
||||
@ -628,7 +629,7 @@ async function handleDeleteType() {
|
||||
await ElMessageBox.confirm(
|
||||
`确定删除类型「${type.name}」吗?该类型下存在子类型时无法删除。`,
|
||||
'删除确认',
|
||||
{ type: 'warning', confirmButtonText: '删除', cancelButtonText: '取消' }
|
||||
{ type: 'warning', confirmButtonText: '删除', cancelButtonText: '取消', buttonSize: 'small' }
|
||||
)
|
||||
} catch {
|
||||
return
|
||||
@ -713,7 +714,7 @@ async function handleDeleteSubType(row: InboxV2SubTypeItem) {
|
||||
await ElMessageBox.confirm(
|
||||
`确定删除子类型「${row.name}」吗?存在关键词/函数/取号/白名单/回复引用时无法删除。`,
|
||||
'删除确认',
|
||||
{ type: 'warning', confirmButtonText: '删除', cancelButtonText: '取消' }
|
||||
{ type: 'warning', confirmButtonText: '删除', cancelButtonText: '取消', buttonSize: 'small' }
|
||||
)
|
||||
} catch {
|
||||
return
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
@clear="handleClear"
|
||||
>
|
||||
<template #append>
|
||||
<el-button @click="openPicker">选择</el-button>
|
||||
<el-button size="small" @click="openPicker">选择</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
@keyup.enter="loadData(1)"
|
||||
>
|
||||
<template #append>
|
||||
<el-button :loading="loading" @click="loadData(1)">查询</el-button>
|
||||
<el-button size="small" :loading="loading" @click="loadData(1)">查询</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
@ -53,8 +53,8 @@
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" :disabled="!selectedItem" @click="applySelection">确定</el-button>
|
||||
<el-button size="small" @click="dialogVisible = false">取消</el-button>
|
||||
<el-button size="small" type="primary" :disabled="!selectedItem" @click="applySelection">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
@ -474,7 +474,7 @@ async function handleBatchSetPendingFeedback() {
|
||||
await ElMessageBox.confirm(
|
||||
`确认将 ${selectedRows.value.length} 个工单设为"待反馈"状态?`,
|
||||
'批量设待反馈',
|
||||
{ confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }
|
||||
{ confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', buttonSize: 'small' }
|
||||
)
|
||||
} catch {
|
||||
return // 用户取消
|
||||
@ -524,7 +524,7 @@ async function handleBatchStatus(status: 'completed' | 'closed', label: string,
|
||||
await ElMessageBox.confirm(
|
||||
`确认将 ${selectedRows.value.length} 个工单${label}?`,
|
||||
label,
|
||||
{ confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }
|
||||
{ confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', buttonSize: 'small' }
|
||||
)
|
||||
} catch { return }
|
||||
|
||||
|
||||
@ -0,0 +1,465 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:model-value="visible"
|
||||
title="配送订单批量转退回拆包单"
|
||||
width="800px"
|
||||
align-center
|
||||
:close-on-click-modal="false"
|
||||
@update:model-value="handleVisibleChange"
|
||||
@closed="resetState"
|
||||
>
|
||||
<!-- 确认态:入参 ids 取自勾选配送订单的 id(wms_order_delivery*.id) -->
|
||||
<template v-if="!result">
|
||||
<el-alert class="transfer-alert" type="info" :closable="false" show-icon>
|
||||
<template #title>
|
||||
仅「库内拦截」订单会被转换;已有有效拆包单、无运单号、无明细可复制的订单会静默跳过(不报错、不影响其它订单);单条失败不阻断整体提交。
|
||||
</template>
|
||||
</el-alert>
|
||||
|
||||
<div class="transfer-count">
|
||||
<span>
|
||||
已勾选 <b>{{ rows.length }}</b> 条,去重后待处理订单 <b>{{ submitIds.length }}</b> 条
|
||||
</span>
|
||||
<span class="transfer-count__limit">单次上限 {{ MAX_COUNT }} 条</span>
|
||||
</div>
|
||||
|
||||
<el-alert
|
||||
v-if="!submitIds.length"
|
||||
class="transfer-alert"
|
||||
type="warning"
|
||||
:closable="false"
|
||||
show-icon
|
||||
>
|
||||
<template #title>
|
||||
所选行均缺少订单ID(配送订单表主键 id),无可用订单可提交;请重新勾选列表中的配送订单。
|
||||
</template>
|
||||
</el-alert>
|
||||
<template v-else>
|
||||
<div v-if="blockedRows.length" class="transfer-note">
|
||||
其中 {{ blockedRows.length }} 条缺少订单ID(id),不会提交
|
||||
</div>
|
||||
<div v-if="advisorySkipRows.length" class="transfer-note">
|
||||
其中 {{ advisorySkipRows.length }} 条按当前列表状态预计会被跳过(非库内拦截),仍会提交并由服务端最终判定
|
||||
</div>
|
||||
<div v-if="overLimit" class="transfer-error">
|
||||
去重后 {{ submitIds.length }} 条已超过单次上限 {{ MAX_COUNT }} 条,请减少勾选后重试
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-table :data="previewRows" size="small" border max-height="320" class="transfer-preview">
|
||||
<el-table-column label="订单ID" width="100" align="center">
|
||||
<template #default="{ row }">{{ row.order_id ?? '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发货单号" min-width="170" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.delivery_order_code || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="运单号" min-width="170" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.waybill_codes || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="拦截状态" width="130" align="center">
|
||||
<template #default="{ row }">{{ row.intercept_status_label }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="能否转换" width="150" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag size="small" :type="row.tagType">{{ row.tagText }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="transfer-note">
|
||||
入参为配送订单表主键ID(id,去重后上限 200 条);归属仓库由服务端按当前登录仓库自动判定,无需选择仓库。
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 结果态:接口逐单返回 success[] / skipped[] / failed[],HTTP 整体仍成功 -->
|
||||
<template v-else>
|
||||
<div class="transfer-summary">
|
||||
<div class="transfer-summary__item">
|
||||
<span class="transfer-summary__label">待处理订单</span>
|
||||
<span class="transfer-summary__value">{{ result.total }}</span>
|
||||
</div>
|
||||
<div class="transfer-summary__item is-success">
|
||||
<span class="transfer-summary__label">成功创建拆包单</span>
|
||||
<span class="transfer-summary__value">{{ result.success_count }}</span>
|
||||
</div>
|
||||
<div class="transfer-summary__item" :class="{ 'is-warning': skippedList.length > 0 }">
|
||||
<span class="transfer-summary__label">跳过</span>
|
||||
<span class="transfer-summary__value">{{ result.skipped_count }}</span>
|
||||
</div>
|
||||
<div class="transfer-summary__item" :class="{ 'is-danger': failedList.length > 0 }">
|
||||
<span class="transfer-summary__label">失败</span>
|
||||
<span class="transfer-summary__value">{{ result.failed_count }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="successList.length" class="transfer-section">
|
||||
<div class="transfer-section__title">成功明细({{ successList.length }})</div>
|
||||
<el-table :data="successList" size="small" border max-height="240">
|
||||
<el-table-column prop="order_id" label="订单ID" width="100" align="center" />
|
||||
<el-table-column prop="waybill_code" label="运单号" min-width="170" show-overflow-tooltip />
|
||||
<el-table-column prop="unpack_id" label="拆包单ID" width="100" align="center" />
|
||||
<el-table-column prop="unpack_no" label="拆包单号" min-width="170" show-overflow-tooltip />
|
||||
<el-table-column prop="detail_count" label="明细行数" width="95" align="center" />
|
||||
<el-table-column prop="total_quantity" label="数量合计" width="95" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<div v-if="skippedList.length" class="transfer-section">
|
||||
<div class="transfer-section__title">
|
||||
<span>跳过明细({{ skippedList.length }})</span>
|
||||
<span class="transfer-section__actions">
|
||||
<el-button link type="primary" size="small" @click="copyIds(skippedList, '跳过')">复制跳过订单ID</el-button>
|
||||
</span>
|
||||
</div>
|
||||
<el-table :data="skippedList" size="small" border max-height="200">
|
||||
<el-table-column prop="order_id" label="订单ID" width="110" align="center" />
|
||||
<el-table-column prop="reason" label="跳过原因" min-width="320" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<div v-if="failedList.length" class="transfer-section">
|
||||
<div class="transfer-section__title">
|
||||
<span>失败明细({{ failedList.length }})</span>
|
||||
<span class="transfer-section__actions">
|
||||
<el-button link type="primary" size="small" @click="copyIds(failedList, '失败')">复制失败订单ID</el-button>
|
||||
</span>
|
||||
</div>
|
||||
<el-table :data="failedList" size="small" border max-height="200">
|
||||
<el-table-column prop="order_id" label="订单ID" width="110" align="center" />
|
||||
<el-table-column prop="reason" label="失败原因" min-width="320" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<div v-if="!successList.length && !skippedList.length && !failedList.length" class="transfer-empty">
|
||||
<el-empty description="本次提交没有可处理的订单" :image-size="60" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #footer>
|
||||
<template v-if="!result">
|
||||
<el-button size="small" :disabled="submitting" @click="handleVisibleChange(false)">取消</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
:loading="submitting"
|
||||
:disabled="!canSubmit"
|
||||
@click="submit"
|
||||
>
|
||||
确认转换
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-button size="small" type="primary" @click="handleVisibleChange(false)">完成</el-button>
|
||||
</template>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { returnUnpackTransferByOrders } from '@/api/returnunpack'
|
||||
import type {
|
||||
ReturnUnpackTransferByOrdersResponse,
|
||||
ReturnUnpackTransferByOrdersFailedItem,
|
||||
ReturnUnpackTransferByOrdersSkippedItem,
|
||||
ReturnUnpackTransferByOrdersSuccessItem,
|
||||
} from '@/api/returnunpack'
|
||||
import { translateInterceptStatus } from '../config/order-common-config'
|
||||
|
||||
/**
|
||||
* 配送订单批量转退回拆包单(returnUnpack.transferByOrders)
|
||||
* 由「配送订单(order/orderManagement/deliveryOrder)」页面使用:
|
||||
* 勾选配送订单行 → 取 wms_order_delivery*.id 作为入参 ids。
|
||||
*/
|
||||
/** 接口约定:ids 为订单表主键ID(wms_order_delivery*.id),服务端 Number() 归一化 + 过滤非正整数 + 去重,去重后单次上限 200 */
|
||||
const MAX_COUNT = 200
|
||||
|
||||
/** 文档口径:仅「库内拦截」订单允许转换(兼容历史值 intercepted) */
|
||||
const TRANSFERABLE_INTERCEPT_STATUS = new Set(['intercepted_at_warehouse', 'intercepted'])
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
visible: boolean
|
||||
/** 勾选的配送订单行(取 id = wms_order_delivery*.id 作为入参 ids) */
|
||||
rows?: any[]
|
||||
}>(),
|
||||
{ rows: () => [] }
|
||||
)
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:visible', value: boolean): void
|
||||
/** 提交成功(含跳过/部分失败)后触发,供父页面刷新列表 */
|
||||
(e: 'success'): void
|
||||
}>()
|
||||
|
||||
const submitting = ref(false)
|
||||
const result = ref<ReturnUnpackTransferByOrdersResponse | null>(null)
|
||||
|
||||
/** 订单表主键ID:仅正整数有效 */
|
||||
function toOrderId(value: unknown): number | null {
|
||||
const id = Number(value)
|
||||
return Number.isInteger(id) && id > 0 ? id : null
|
||||
}
|
||||
|
||||
/** 运单号展示:列表行为数组(waybill_codes),兼容单值/旧字段 */
|
||||
function formatWaybillCodes(row: any): string {
|
||||
const raw = row?.waybill_codes ?? row?.express_numbers ?? row?.express_codes ?? row?.waybill_code
|
||||
if (Array.isArray(raw)) return raw.filter((i) => i !== null && i !== undefined && i !== '').join(',')
|
||||
return raw === null || raw === undefined ? '' : String(raw)
|
||||
}
|
||||
|
||||
/** 拦截状态文案:translateInterceptStatus 未收录的历史值 intercepted(文档口径与 intercepted_at_warehouse 等价) */
|
||||
function formatInterceptStatus(value: unknown): string {
|
||||
const normalized = String(value ?? '').trim().toLowerCase()
|
||||
if (normalized === 'intercepted') return '仓库拦截成功(历史)'
|
||||
return translateInterceptStatus(value)
|
||||
}
|
||||
|
||||
type PreviewRow = {
|
||||
order_id: number | null
|
||||
delivery_order_code: string
|
||||
waybill_codes: string
|
||||
intercept_status_label: string
|
||||
/** 按当前列表状态预计:非库内拦截(仍会提交,服务端最终判定) */
|
||||
advisorySkip: boolean
|
||||
/** 有合法订单ID */
|
||||
transferable: boolean
|
||||
tagType: 'success' | 'info' | 'danger'
|
||||
tagText: string
|
||||
}
|
||||
|
||||
const previewRows = computed<PreviewRow[]>(() => {
|
||||
const seen = new Set<number>()
|
||||
const list: PreviewRow[] = []
|
||||
props.rows.forEach((row) => {
|
||||
const orderId = toOrderId(row?.id)
|
||||
if (orderId !== null) {
|
||||
if (seen.has(orderId)) return
|
||||
seen.add(orderId)
|
||||
}
|
||||
const status = String(row?.intercept_status ?? '').trim().toLowerCase()
|
||||
const known = Boolean(status) && status !== 'none'
|
||||
const advisorySkip = known && !TRANSFERABLE_INTERCEPT_STATUS.has(status)
|
||||
const transferable = orderId !== null
|
||||
|
||||
let tagType: PreviewRow['tagType'] = 'success'
|
||||
let tagText = '可转换'
|
||||
if (!transferable) {
|
||||
tagType = 'danger'
|
||||
tagText = '缺少订单ID'
|
||||
} else if (advisorySkip) {
|
||||
tagType = 'info'
|
||||
tagText = '非库内拦截·将跳过'
|
||||
} else if (!known) {
|
||||
tagType = 'info'
|
||||
tagText = '状态未知·以服务端为准'
|
||||
}
|
||||
|
||||
list.push({
|
||||
order_id: orderId,
|
||||
delivery_order_code: String(row?.delivery_order_code ?? row?.order_code ?? ''),
|
||||
waybill_codes: formatWaybillCodes(row),
|
||||
intercept_status_label: formatInterceptStatus(row?.intercept_status),
|
||||
advisorySkip,
|
||||
transferable,
|
||||
tagType,
|
||||
tagText
|
||||
})
|
||||
})
|
||||
return list
|
||||
})
|
||||
|
||||
/** 待提交订单主键ID(去重):缺少ID的行不提交,其余交给服务端判定 */
|
||||
const submitIds = computed<number[]>(() =>
|
||||
previewRows.value
|
||||
.filter((row) => row.transferable && row.order_id !== null)
|
||||
.map((row) => row.order_id as number)
|
||||
)
|
||||
|
||||
const blockedRows = computed(() => previewRows.value.filter((row) => !row.transferable))
|
||||
const advisorySkipRows = computed(() => previewRows.value.filter((row) => row.transferable && row.advisorySkip))
|
||||
|
||||
const overLimit = computed(() => submitIds.value.length > MAX_COUNT)
|
||||
const canSubmit = computed(() => submitIds.value.length > 0 && !overLimit.value && !submitting.value)
|
||||
|
||||
const successList = computed<ReturnUnpackTransferByOrdersSuccessItem[]>(() => result.value?.success ?? [])
|
||||
const skippedList = computed<ReturnUnpackTransferByOrdersSkippedItem[]>(() => result.value?.skipped ?? [])
|
||||
const failedList = computed<ReturnUnpackTransferByOrdersFailedItem[]>(() => result.value?.failed ?? [])
|
||||
|
||||
function handleVisibleChange(next: boolean) {
|
||||
emit('update:visible', next)
|
||||
}
|
||||
|
||||
function resetState() {
|
||||
result.value = null
|
||||
submitting.value = false
|
||||
}
|
||||
|
||||
async function submit() {
|
||||
if (!canSubmit.value) return
|
||||
submitting.value = true
|
||||
try {
|
||||
const res: any = await returnUnpackTransferByOrders({ ids: submitIds.value })
|
||||
if (!(res && (res.code === 1 || res.code === 200 || res.code === 20000 || res.flag === 'success'))) {
|
||||
ElMessage.error(res?.message || '批量转退回拆包失败')
|
||||
return
|
||||
}
|
||||
const payload = (res.data && typeof res.data === 'object' ? res.data : res) as ReturnUnpackTransferByOrdersResponse
|
||||
const success = Array.isArray(payload.success) ? payload.success : []
|
||||
const skipped = Array.isArray(payload.skipped) ? payload.skipped : []
|
||||
const failed = Array.isArray(payload.failed) ? payload.failed : []
|
||||
result.value = {
|
||||
total: Number(payload.total ?? success.length + skipped.length + failed.length),
|
||||
success_count: Number(payload.success_count ?? success.length),
|
||||
skipped_count: Number(payload.skipped_count ?? skipped.length),
|
||||
failed_count: Number(payload.failed_count ?? failed.length),
|
||||
success,
|
||||
skipped,
|
||||
failed
|
||||
}
|
||||
const summary = `转换完成:成功 ${result.value.success_count} 条,跳过 ${result.value.skipped_count} 条,失败 ${result.value.failed_count} 条`
|
||||
if (result.value.failed_count > 0 || result.value.skipped_count > 0) {
|
||||
ElMessage.warning(summary)
|
||||
} else {
|
||||
ElMessage.success(summary)
|
||||
}
|
||||
emit('success')
|
||||
} catch {
|
||||
// 请求层已统一提示错误
|
||||
} finally {
|
||||
submitting.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 复制订单ID(跳过/失败明细用) */
|
||||
async function copyIds(list: Array<{ order_id?: number | string }>, label: string) {
|
||||
const ids = list
|
||||
.map((item) => Number(item?.order_id))
|
||||
.filter((id) => Number.isInteger(id) && id > 0)
|
||||
if (!ids.length) {
|
||||
ElMessage.warning(`没有可复制的${label}订单ID`)
|
||||
return
|
||||
}
|
||||
const text = ids.join('\n')
|
||||
try {
|
||||
if (!navigator.clipboard?.writeText) throw new Error('no clipboard api')
|
||||
await navigator.clipboard.writeText(text)
|
||||
ElMessage.success(`已复制 ${ids.length} 个${label}订单ID`)
|
||||
} catch {
|
||||
try {
|
||||
const textarea = document.createElement('textarea')
|
||||
textarea.value = text
|
||||
textarea.setAttribute('readonly', 'readonly')
|
||||
textarea.style.position = 'fixed'
|
||||
textarea.style.left = '-9999px'
|
||||
document.body.appendChild(textarea)
|
||||
textarea.select()
|
||||
document.execCommand('copy')
|
||||
document.body.removeChild(textarea)
|
||||
ElMessage.success(`已复制 ${ids.length} 个${label}订单ID`)
|
||||
} catch {
|
||||
ElMessage.error('复制失败,请手动复制')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.transfer-alert {
|
||||
margin-bottom: 12px;
|
||||
|
||||
:deep(.el-alert__title) {
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
|
||||
.transfer-preview {
|
||||
margin-top: 8px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.transfer-count {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
margin-top: 6px;
|
||||
font-size: 12px;
|
||||
color: #606266;
|
||||
|
||||
.transfer-count__limit {
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
b {
|
||||
color: #409eff;
|
||||
}
|
||||
}
|
||||
|
||||
.transfer-error {
|
||||
margin-top: 4px;
|
||||
font-size: 12px;
|
||||
color: #f56c6c;
|
||||
}
|
||||
|
||||
.transfer-note {
|
||||
margin-top: 4px;
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.transfer-summary {
|
||||
display: flex;
|
||||
gap: 24px;
|
||||
margin-bottom: 12px;
|
||||
padding: 10px 14px;
|
||||
border-radius: 4px;
|
||||
background: #f5f7fa;
|
||||
|
||||
.transfer-summary__item {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.transfer-summary__label {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.transfer-summary__value {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.transfer-summary__item.is-success .transfer-summary__value {
|
||||
color: #67c23a;
|
||||
}
|
||||
|
||||
.transfer-summary__item.is-warning .transfer-summary__value {
|
||||
color: #e6a23c;
|
||||
}
|
||||
|
||||
.transfer-summary__item.is-danger .transfer-summary__value {
|
||||
color: #f56c6c;
|
||||
}
|
||||
}
|
||||
|
||||
.transfer-section {
|
||||
margin-top: 12px;
|
||||
|
||||
.transfer-section__title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 6px;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
}
|
||||
|
||||
.transfer-empty {
|
||||
padding: 12px 0;
|
||||
}
|
||||
</style>
|
||||
@ -585,6 +585,15 @@ export const ORDER_TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
|
||||
disabledKey: 'hasNoSelection',
|
||||
action: 'handleSubWaybillPrint'
|
||||
},
|
||||
/** 配送订单批量转退回拆包单(returnUnpack.transferByOrders):入参取勾选行 id(wms_order_delivery*.id) */
|
||||
transferToUnpack: {
|
||||
key: 'transferToUnpack',
|
||||
label: '转退回拆包',
|
||||
size: 'small',
|
||||
category: 'action',
|
||||
disabledKey: 'hasNoSelection',
|
||||
action: 'openTransferByOrdersDialog'
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
@ -1891,6 +1900,7 @@ export const deliveryOrderToolbarButtonKeys = [
|
||||
'batchPrint',
|
||||
'allocateSubOrderNumber',
|
||||
'subWaybillPrint',
|
||||
'transferToUnpack',
|
||||
]
|
||||
export const deliveryOrderToolbarButtons = pickToolbarButtons(deliveryOrderToolbarButtonKeys)
|
||||
|
||||
|
||||
@ -274,6 +274,13 @@
|
||||
@submit="submitAllocateSubOrderNumber"
|
||||
/>
|
||||
|
||||
<!-- 配送订单批量转退回拆包单(returnUnpack.transferByOrders):入参取勾选行 id -->
|
||||
<transfer-by-orders-dialog
|
||||
v-model:visible="transferByOrdersVisible"
|
||||
:rows="transferByOrderRows"
|
||||
@success="handleTransferByOrdersSuccess"
|
||||
/>
|
||||
|
||||
<order-export-columns-dialog
|
||||
v-model:visible="exportColumnsDialogVisible"
|
||||
:mode="exportColumnsMode"
|
||||
@ -334,6 +341,7 @@ import { useDeliveryOrderSubWaybillPrint } from './utils/use-delivery-sub-waybil
|
||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||
import OrderToolbarButtonGroup from './component/OrderToolbarButtonGroup.vue'
|
||||
import AllocateSubOrderNumberForm from './form/AllocateSubOrderNumberForm.vue'
|
||||
import TransferByOrdersDialog from './component/TransferByOrdersDialog.vue'
|
||||
import { createSimpleListToolbarController } from './utils/toolbar-actions'
|
||||
import { safeInvoke } from '@/utils/safe-invoke'
|
||||
const scanBox = ref<any>(null)
|
||||
@ -705,6 +713,28 @@ function resetAllocateSubOrderNumberDialog() {
|
||||
|
||||
toolbarActionMap.openAllocateSubOrderNumberDialog = openAllocateSubOrderNumberDialog
|
||||
|
||||
// 转退回拆包(returnUnpack.transferByOrders):入参取勾选配送订单的 id(wms_order_delivery*.id)
|
||||
const transferByOrdersVisible = ref(false)
|
||||
const transferByOrderRows = ref<any[]>([])
|
||||
|
||||
function openTransferByOrdersDialog() {
|
||||
const rows = selectionRows.value
|
||||
if (!rows.length) {
|
||||
ElMessage.warning('请先勾选需要转退回拆包的配送订单')
|
||||
return
|
||||
}
|
||||
transferByOrderRows.value = rows.slice()
|
||||
transferByOrdersVisible.value = true
|
||||
}
|
||||
|
||||
function handleTransferByOrdersSuccess() {
|
||||
upperTable.value?.clearSelection?.()
|
||||
selectionRows.value = []
|
||||
loadData()
|
||||
}
|
||||
|
||||
toolbarActionMap.openTransferByOrdersDialog = openTransferByOrdersDialog
|
||||
|
||||
function resolveButtonLoading(loadingKey?: string) {
|
||||
if (!loadingKey) return false
|
||||
return Boolean(buttonLoadingMap.value[loadingKey])
|
||||
|
||||
@ -735,6 +735,7 @@
|
||||
:rules="waveStrategyFormRules"
|
||||
label-width="130px"
|
||||
class="wave-strategy-form-grid"
|
||||
size="small"
|
||||
>
|
||||
<el-form-item label="策略名称" prop="strategy_name">
|
||||
<el-input v-model="waveStrategyFormModel.strategy_name" clearable placeholder="请输入策略名称" maxlength="80" />
|
||||
|
||||
@ -196,6 +196,7 @@
|
||||
:rules="waveStrategyActiveFormRules"
|
||||
label-width="130px"
|
||||
class="wave-strategy-form-grid"
|
||||
size="small"
|
||||
>
|
||||
<el-form-item label="策略名称" prop="strategy_name">
|
||||
<el-input v-model="waveStrategyFormModel.strategy_name" clearable placeholder="请输入策略名称" maxlength="80" />
|
||||
|
||||
@ -491,7 +491,7 @@ async function handleRemoveOrdersFromWave() {
|
||||
await ElMessageBox.confirm(
|
||||
`确定将选中的 ${ids.length} 条订单移出当前波次吗?`,
|
||||
'移出波次',
|
||||
{ type: 'warning', confirmButtonText: '确认移出', cancelButtonText: '取消' }
|
||||
{ type: 'warning', confirmButtonText: '确认移出', cancelButtonText: '取消', buttonSize: 'small' }
|
||||
)
|
||||
} catch {
|
||||
return
|
||||
|
||||
@ -99,7 +99,7 @@
|
||||
|
||||
<!-- 新增/编辑弹窗 -->
|
||||
<el-dialog :title="textMap[dialogStatus]" v-model="dialogFormVisible" width="1000px" align-center class="account-dialog" @close="handleDialogClose">
|
||||
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="top" class="custom-form">
|
||||
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="top" class="custom-form" size="small">
|
||||
<el-tabs v-model="activeTab" class="form-tabs">
|
||||
<el-tab-pane label="基本信息" name="base">
|
||||
<div class="form-section no-shadow">
|
||||
@ -177,8 +177,8 @@
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="listLoading" @click="dialogStatus==='create'?createData():updateData()">确认保存</el-button>
|
||||
<el-button size="small" @click="dialogFormVisible = false">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="listLoading" @click="dialogStatus==='create'?createData():updateData()">确认保存</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@ -193,12 +193,12 @@
|
||||
style="margin-bottom:12px"
|
||||
/>
|
||||
<!-- 过滤栏 -->
|
||||
<el-form :inline="true" :model="roleFilter" style="margin-bottom:10px">
|
||||
<el-form :inline="true" :model="roleFilter" style="margin-bottom:10px" size="small">
|
||||
<el-form-item label="关键词">
|
||||
<el-input v-model="roleFilter.keyword" placeholder="角色名称" clearable style="width:200px" @input="applyRoleFilter" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="toggleSelectAll">{{ isAllSelected ? '取消全选' : '全选当前页' }}</el-button>
|
||||
<el-button size="small" @click="toggleSelectAll">{{ isAllSelected ? '取消全选' : '全选当前页' }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- 角色表格 -->
|
||||
@ -224,15 +224,15 @@
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="roleDialogVisible = false">关闭</el-button>
|
||||
<el-button type="primary" :loading="roleSubmitting" @click="submitRoleUpdate">确认分配</el-button>
|
||||
<el-button size="small" @click="roleDialogVisible = false">关闭</el-button>
|
||||
<el-button size="small" type="primary" :loading="roleSubmitting" @click="submitRoleUpdate">确认分配</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 重置密码弹窗 -->
|
||||
<el-dialog title="重置密码" v-model="resetPwdDialogVisible" width="400px" align-center>
|
||||
<el-form ref="resetPwdFormRef" :model="resetPwdTemp" label-width="80px">
|
||||
<el-form ref="resetPwdFormRef" :model="resetPwdTemp" label-width="80px" size="small">
|
||||
<el-form-item label="工号" >
|
||||
<el-input :value="resetPwdTemp.real_name || resetPwdTemp.phone" disabled />
|
||||
</el-form-item>
|
||||
@ -246,8 +246,8 @@
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="resetPwdDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="resetPwdSubmitting" @click="submitResetPassword">确认重置</el-button>
|
||||
<el-button size="small" @click="resetPwdDialogVisible = false">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="resetPwdSubmitting" @click="submitResetPassword">确认重置</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@ -291,7 +291,7 @@
|
||||
</template>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="bindWechatDialogVisible = false">关闭</el-button>
|
||||
<el-button size="small" @click="bindWechatDialogVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@ -552,7 +552,8 @@ const handleDelete = (row: any) => {
|
||||
ElMessageBox.confirm('确认停用该工号吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
type: 'warning',
|
||||
buttonSize: 'small'
|
||||
}).then(async () => {
|
||||
await accountdelete({ employee_id: row.employee_id })
|
||||
ElMessage.success('已停用')
|
||||
@ -564,7 +565,8 @@ const handleEnable = (row: any) => {
|
||||
ElMessageBox.confirm('确认启用该工号吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'info'
|
||||
type: 'info',
|
||||
buttonSize: 'small'
|
||||
}).then(async () => {
|
||||
// 启用时保留原有角色组,ids 必传
|
||||
await accountUpdate({ employee_id: row.employee_id, ids: row.role_ids || [] })
|
||||
@ -851,7 +853,8 @@ const handleUnbindWechat = (row: any) => {
|
||||
ElMessageBox.confirm(`确定要解除工号「${row.real_name}」的微信绑定吗?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
type: 'warning',
|
||||
buttonSize: 'small'
|
||||
}).then(async () => {
|
||||
try {
|
||||
await unbindWechat({ user_id: row.account_id })
|
||||
|
||||
@ -96,7 +96,8 @@ async function handleActionClick(btn: OperationButtonConfig) {
|
||||
{
|
||||
confirmButtonText: btn.confirmButtonText || '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: (btn.confirmType || 'warning') as any
|
||||
type: (btn.confirmType || 'warning') as any,
|
||||
buttonSize: 'small'
|
||||
}
|
||||
)
|
||||
} catch {
|
||||
|
||||
@ -1520,12 +1520,6 @@ export const tabPages: TabPageRawConfig[] = [
|
||||
store_id: 'store_id',
|
||||
report_name: 'report_name'
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'viewDetail',
|
||||
label: '查看详情',
|
||||
actionType: 'action',
|
||||
type: 'primary'
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -1536,7 +1530,7 @@ export const tabPages: TabPageRawConfig[] = [
|
||||
label: '投递记录',
|
||||
scanBoxCacheKey: 'basic-settings-log',
|
||||
scanBoxFieldKeys: ['store_id', 'report_code', 'status'],
|
||||
tableColumnKeys: ['id', 'store_id', 'report_code', 'biz_date', 'time_point', 'status', 'channel', 'retry_count', 'file_url', 'error_message', 'delivered_at', 'created_at', 'operation'],
|
||||
tableColumnKeys: ['id', 'store_id', 'report_code', 'biz_date', 'time_point', 'status', 'channel', 'retry_count', 'file_url', 'error_message', 'delivered_at', 'created_at'],
|
||||
upperTableDefaults: {
|
||||
title: '报表投递记录',
|
||||
showSelection: false
|
||||
@ -1574,15 +1568,7 @@ export const tabPages: TabPageRawConfig[] = [
|
||||
...(sort?.prop ? { sort: { sortField: sort.prop, sortOrder: sort.order === 'ascending' ? 'ASC' : 'DESC' } } : {})
|
||||
}
|
||||
}
|
||||
},
|
||||
operationButtons: [
|
||||
{
|
||||
key: 'viewDetail',
|
||||
label: '查看详情',
|
||||
actionType: 'action',
|
||||
type: 'primary'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
// ===== 标签页五:报表定义(wms_report_definition 管理,report.definition.*) =====
|
||||
|
||||
@ -608,7 +608,8 @@ async function handleRegenerateSecret(row: Record<string, any>) {
|
||||
const newSecret = res.self_app_secret || ''
|
||||
ElMessageBox.alert(`新 AppSecret:${newSecret}`, '密钥已重置 — 请妥善保存', {
|
||||
confirmButtonText: '我已保存',
|
||||
type: 'warning'
|
||||
type: 'warning',
|
||||
buttonSize: 'small'
|
||||
})
|
||||
loadData()
|
||||
} else {
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
:rules="formRules"
|
||||
label-width="120px"
|
||||
label-position="right"
|
||||
size="small"
|
||||
>
|
||||
<el-form-item label="应用名称" prop="app_name">
|
||||
<el-input
|
||||
@ -139,8 +140,8 @@
|
||||
</template>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="handleClosed">取消</el-button>
|
||||
<el-button type="primary" :loading="submitting" @click="handleSubmit">
|
||||
<el-button size="small" @click="handleClosed">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="submitting" @click="handleSubmit">
|
||||
{{ isEdit ? '保存' : '创建' }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
<div class="form-tip" v-if="isEdit">报表类型一经创建不可更改</div>
|
||||
<div v-if="currentTypeInfo" class="form-tip type-desc">{{ currentTypeInfo.description }}</div>
|
||||
<!-- <div v-if="currentTypeInfo" class="form-tip type-desc">{{ currentTypeInfo.description }}</div> -->
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="导出文件名" prop="file_name">
|
||||
@ -51,9 +51,9 @@
|
||||
placeholder="导出文件名模板,支持 {date}/{time}/{datetime}/{timestamp} 占位(≤200 字符)"
|
||||
maxlength="200"
|
||||
/>
|
||||
<div class="form-tip">
|
||||
<!-- <div class="form-tip">
|
||||
如:库存变化报表_{date};{date} 数据日期、{time} 生成时刻 HHmmss、{datetime} 数据日期_生成时刻、{timestamp} 生成时刻毫秒时间戳
|
||||
</div>
|
||||
</div> -->
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="勾选字段" prop="fields">
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<span class="sub">按仓库自持域名部署并品牌化前端(域名设置 / HTTPS 证书 / 品牌配置)</span>
|
||||
</div>
|
||||
<div class="header-actions">
|
||||
<el-button :loading="frontPageLoading" @click="loadFrontConfig">刷新</el-button>
|
||||
<el-button size="small" :loading="frontPageLoading" @click="loadFrontConfig">刷新</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -75,7 +75,7 @@
|
||||
<h3 class="front-config-panel__title">品牌配置</h3>
|
||||
<p class="front-config-panel__desc">站点标题、Logo、favicon、登录页背景图与主题变量;图片可直接上传自动填入 URL,也可手填;留空即清空</p>
|
||||
</header>
|
||||
<el-form label-width="140px" label-position="right" class="front-config-form">
|
||||
<el-form label-width="140px" label-position="right" class="front-config-form" size="small">
|
||||
<el-form-item label="站点标题">
|
||||
<el-input v-model="frontForm.title" class="front-config-field" maxlength="100" clearable placeholder="站点标题(留空表示清空)" />
|
||||
</el-form-item>
|
||||
@ -145,7 +145,7 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="front-config-panel__footer">
|
||||
<el-button type="primary" :loading="frontSaving" @click="saveFrontConfig">保存品牌配置</el-button>
|
||||
<el-button size="small" type="primary" :loading="frontSaving" @click="saveFrontConfig">保存品牌配置</el-button>
|
||||
<span class="front-config-hint">品牌字段留空即清空;主题删空全部键后保存即清空主题;保存成功后自动重新加载</span>
|
||||
<span class="front-config-hint">最近更新:{{ formatFrontDateTime(frontInfoMeta.updated_at) }}</span>
|
||||
</div>
|
||||
@ -179,7 +179,7 @@
|
||||
:closable="false"
|
||||
class="front-config-alert"
|
||||
/>
|
||||
<el-form label-width="140px" label-position="right" class="front-config-form">
|
||||
<el-form label-width="140px" label-position="right" class="front-config-form" size="small">
|
||||
<el-form-item label="自持域名">
|
||||
<div class="front-config-field-row">
|
||||
<el-input
|
||||
@ -248,7 +248,7 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="front-config-panel__footer">
|
||||
<el-button :loading="frontDomainRefreshing" @click="refreshFrontDomain">刷新状态</el-button>
|
||||
<el-button size="small" :loading="frontDomainRefreshing" @click="refreshFrontDomain">刷新状态</el-button>
|
||||
<span class="front-config-hint">
|
||||
添加 TXT 记录后点击「校验 DNS」;校验通过后待验证域名才提升为生效域名(期间原生效域名继续服务),域名验证通过(domain_status=1)后方可上传证书。
|
||||
「刷新状态」仅重查域名验证状态,不覆盖未保存的输入
|
||||
@ -282,7 +282,7 @@
|
||||
:closable="false"
|
||||
class="front-config-alert"
|
||||
/>
|
||||
<el-form label-width="140px" label-position="right" class="front-config-form">
|
||||
<el-form label-width="140px" label-position="right" class="front-config-form" size="small">
|
||||
<el-form-item label="证书状态">
|
||||
<div class="front-cert-meta">
|
||||
<el-tag :type="frontCertTagType" size="small" effect="plain">{{ frontCertStatus.text }}</el-tag>
|
||||
@ -324,13 +324,14 @@
|
||||
<div class="front-config-panel__footer">
|
||||
<el-button
|
||||
type="warning"
|
||||
size="small"
|
||||
:loading="frontCertSaving"
|
||||
:disabled="!frontCanSetCert"
|
||||
@click="submitFrontCert"
|
||||
>
|
||||
上传证书
|
||||
</el-button>
|
||||
<el-button :loading="frontCertRefreshing" @click="refreshFrontCert">刷新状态</el-button>
|
||||
<el-button size="small" :loading="frontCertRefreshing" @click="refreshFrontCert">刷新状态</el-button>
|
||||
<span class="front-config-hint">
|
||||
{{ frontCanSetCert ? '点击上传生效(证书 PEM + 私钥 PEM 均必填;域名取已保存且验证通过的域名)' : frontCertDisabledReason }}
|
||||
</span>
|
||||
|
||||
@ -71,11 +71,12 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="header-actions">
|
||||
<el-button :disabled="pageLoading" @click="loadConfig">刷新</el-button>
|
||||
<el-button size="small" :disabled="pageLoading" @click="loadConfig">刷新</el-button>
|
||||
<!-- 同步微信侧基础信息(主体/认证类型/账号状态/权限集)→ 后端落库后刷新本页 -->
|
||||
<el-tooltip :disabled="authorized" content="需先完成小程序授权" placement="bottom-end">
|
||||
<span class="mp-auth-trigger">
|
||||
<el-button
|
||||
size="small"
|
||||
:disabled="!authorized"
|
||||
:loading="authorizerInfoLoading"
|
||||
@click="handleSyncAuthorizerInfo"
|
||||
@ -85,11 +86,12 @@
|
||||
</span>
|
||||
</el-tooltip>
|
||||
<!-- 代注册走纯后端接口(无微信页面跳转),不受主域名限制 -->
|
||||
<el-button @click="handleRegister">代注册小程序</el-button>
|
||||
<el-button size="small" @click="handleRegister">代注册小程序</el-button>
|
||||
<el-tooltip :disabled="isMainDomain" :content="mainDomainTip" placement="bottom-end">
|
||||
<span class="mp-auth-trigger">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
:disabled="!isMainDomain"
|
||||
:loading="authUrlLoading"
|
||||
@click="handleAuthorize"
|
||||
@ -125,6 +127,7 @@
|
||||
<span class="mp-auth-trigger">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
:disabled="!isMainDomain"
|
||||
:loading="authUrlLoading"
|
||||
@click="handleAuthorize"
|
||||
@ -174,6 +177,7 @@
|
||||
label-width="150px"
|
||||
label-position="right"
|
||||
class="mp-info-form"
|
||||
size="small"
|
||||
>
|
||||
<el-form-item
|
||||
v-for="item in infoItems"
|
||||
@ -233,6 +237,7 @@
|
||||
label-width="150px"
|
||||
label-position="right"
|
||||
class="mp-info-form"
|
||||
size="small"
|
||||
>
|
||||
<el-form-item
|
||||
v-for="item in otherItems"
|
||||
@ -286,7 +291,7 @@
|
||||
description="暂无认证状态数据"
|
||||
:image-size="72"
|
||||
>
|
||||
<el-button @click="loadAuthStatus">重新查询</el-button>
|
||||
<el-button size="small" @click="loadAuthStatus">重新查询</el-button>
|
||||
</el-empty>
|
||||
|
||||
<template v-else-if="certInfo">
|
||||
@ -378,7 +383,7 @@
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<el-form label-width="110px" label-position="right" class="mp-publish-form">
|
||||
<el-form label-width="110px" label-position="right" class="mp-publish-form" size="small">
|
||||
<el-form-item label="代码模板">
|
||||
<div class="mp-publish-row">
|
||||
<el-select
|
||||
@ -419,7 +424,7 @@
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<el-form label-width="110px" label-position="right" class="mp-publish-form">
|
||||
<el-form label-width="110px" label-position="right" class="mp-publish-form" size="small">
|
||||
<el-form-item label="页面路径">
|
||||
<div class="mp-publish-row">
|
||||
<el-input
|
||||
@ -460,7 +465,7 @@
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<el-form label-width="130px" label-position="right" class="mp-publish-form">
|
||||
<el-form label-width="130px" label-position="right" class="mp-publish-form" size="small">
|
||||
<el-form-item label="版本描述">
|
||||
<el-input
|
||||
v-model="auditForm.version_desc"
|
||||
@ -576,10 +581,10 @@
|
||||
<el-option value="unbound" label="未绑定" />
|
||||
</el-select>
|
||||
|
||||
<el-button type="primary" :loading="userLoading" @click="handleUserQueryChange">
|
||||
<el-button size="small" type="primary" :loading="userLoading" @click="handleUserQueryChange">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button :disabled="userLoading" @click="resetUserQuery">重置</el-button>
|
||||
<el-button size="small" :disabled="userLoading" @click="resetUserQuery">重置</el-button>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
@ -754,10 +759,11 @@
|
||||
</p>
|
||||
|
||||
<div class="mp-agreement__actions">
|
||||
<el-button type="primary" :loading="agreementSaving" @click="saveAgreement">
|
||||
<el-button size="small" type="primary" :loading="agreementSaving" @click="saveAgreement">
|
||||
保存
|
||||
</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
:loading="agreementPreviewLoading"
|
||||
@click="previewAgreementForMiniProgram"
|
||||
>
|
||||
@ -790,6 +796,7 @@
|
||||
@keyup.enter="queryAgreementVersionById()"
|
||||
/>
|
||||
<el-button
|
||||
size="small"
|
||||
:loading="agreementVersionLoading"
|
||||
@click="queryAgreementVersionById()"
|
||||
>
|
||||
@ -799,6 +806,7 @@
|
||||
v-if="agreementMeta.version_id"
|
||||
link
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="queryAgreementVersionById(agreementMeta.version_id)"
|
||||
>
|
||||
查看当前版本 #{{ agreementMeta.version_id }}
|
||||
@ -875,6 +883,7 @@
|
||||
:rules="registerRules"
|
||||
label-width="110px"
|
||||
label-position="right"
|
||||
size="small"
|
||||
>
|
||||
<el-form-item label="企业名称" prop="name">
|
||||
<el-input
|
||||
@ -930,8 +939,8 @@
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="registerDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="registerSubmitting" @click="submitRegister">
|
||||
<el-button size="small" @click="registerDialogVisible = false">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="registerSubmitting" @click="submitRegister">
|
||||
提交注册
|
||||
</el-button>
|
||||
</template>
|
||||
@ -961,6 +970,7 @@
|
||||
:rules="authApplyRules"
|
||||
label-width="140px"
|
||||
label-position="right"
|
||||
size="small"
|
||||
>
|
||||
<el-divider content-position="left">账号与联系人(必填)</el-divider>
|
||||
|
||||
@ -1103,8 +1113,8 @@
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="authApplyDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="authApplySubmitting" @click="submitAuthApply">
|
||||
<el-button size="small" @click="authApplyDialogVisible = false">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="authApplySubmitting" @click="submitAuthApply">
|
||||
发起认证
|
||||
</el-button>
|
||||
</template>
|
||||
@ -1128,7 +1138,7 @@
|
||||
description="后端按工号查账号并写入绑定关系;该微信已绑定其他账号 / 工号不属于当前仓库时会被拒绝。"
|
||||
/>
|
||||
|
||||
<el-form label-width="90px" label-position="right">
|
||||
<el-form label-width="90px" label-position="right" size="small">
|
||||
<el-form-item label="微信用户">
|
||||
<span class="mp-bind-target">
|
||||
{{ bindTargetUser?.nickname || '(无昵称)' }}
|
||||
@ -1160,8 +1170,8 @@
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="bindEmployeeDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="bindEmployeeSubmitting" @click="submitBindEmployee">
|
||||
<el-button size="small" @click="bindEmployeeDialogVisible = false">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="bindEmployeeSubmitting" @click="submitBindEmployee">
|
||||
绑定
|
||||
</el-button>
|
||||
</template>
|
||||
@ -1198,7 +1208,7 @@
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="agreementVersionDialogVisible = false">关闭</el-button>
|
||||
<el-button size="small" @click="agreementVersionDialogVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@ -2239,7 +2249,7 @@ async function saveAgreement() {
|
||||
const confirmed = await ElMessageBox.confirm(
|
||||
'当前内容为空,保存后会清空该仓库小程序的用户须知,确定继续?',
|
||||
'清空用户须知',
|
||||
{ type: 'warning', confirmButtonText: '确定清空', cancelButtonText: '取消' }
|
||||
{ type: 'warning', confirmButtonText: '确定清空', cancelButtonText: '取消', buttonSize: 'small' }
|
||||
)
|
||||
.then(() => true)
|
||||
.catch(() => false)
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
:title="loadError"
|
||||
/>
|
||||
|
||||
<el-form label-width="200px" label-position="right" class="settings-form">
|
||||
<el-form label-width="200px" label-position="right" class="settings-form" size="small">
|
||||
<template v-if="displayFields.length">
|
||||
<el-form-item
|
||||
v-for="field in displayFields"
|
||||
@ -131,7 +131,7 @@
|
||||
/>
|
||||
</div>
|
||||
<div class="array-table__op">
|
||||
<el-button type="danger" plain @click="removeArrayFieldItem(field.key, idx)">删除</el-button>
|
||||
<el-button size="small" type="danger" plain @click="removeArrayFieldItem(field.key, idx)">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -150,10 +150,10 @@
|
||||
placeholder="可输入文本,或输入 JSON(对象/数组)"
|
||||
@update:model-value="onArrayItemInput(field.key, idx, $event)"
|
||||
/>
|
||||
<el-button type="danger" plain @click="removeArrayFieldItem(field.key, idx)">删除</el-button>
|
||||
<el-button size="small" type="danger" plain @click="removeArrayFieldItem(field.key, idx)">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-button type="primary" plain @click="addArrayFieldItem(field)">新增一项</el-button>
|
||||
<el-button size="small" type="primary" plain @click="addArrayFieldItem(field)">新增一项</el-button>
|
||||
</div>
|
||||
<el-select
|
||||
v-else-if="field.type === 'select'"
|
||||
@ -221,8 +221,8 @@
|
||||
|
||||
<!-- 底部固定操作条:全页唯一操作入口,设置项再长也无需回到顶部保存 -->
|
||||
<div class="settings-footer">
|
||||
<el-button :loading="pageLoading" @click="loadAll">刷新</el-button>
|
||||
<el-button type="primary" :loading="saving" @click="handleSave">保存</el-button>
|
||||
<el-button size="small" :loading="pageLoading" @click="loadAll">刷新</el-button>
|
||||
<el-button size="small" type="primary" :loading="saving" @click="handleSave">保存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
<!-- 右侧容器 -->
|
||||
<div class="right-panel">
|
||||
<div class="filter-container">
|
||||
<el-form :inline="true" :model="listQuery" class="demo-form-inline" style="display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 0;">
|
||||
<el-form :inline="true" :model="listQuery" class="demo-form-inline" size="small" style="display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 0;">
|
||||
<el-form-item label="关键词" style="margin-bottom: 0;">
|
||||
<el-input v-model="listQuery.keyword" placeholder="路径/名称/标题" clearable @keyup.enter="handleFilter" style="width: 200px" />
|
||||
</el-form-item>
|
||||
@ -26,9 +26,9 @@
|
||||
<el-switch v-model="listQuery.includeDisabled" @change="handleFilter" />
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-bottom: 0; margin-left: auto;">
|
||||
<el-button type="primary" icon="Search" @click="handleFilter">搜索</el-button>
|
||||
<el-button type="success" icon="Plus" @click="handleCreate">新增权限</el-button>
|
||||
<el-button type="danger" icon="Delete" :disabled="selectedIds.length === 0" @click="handleBatchDelete">批量删除</el-button>
|
||||
<el-button size="small" type="primary" icon="Search" @click="handleFilter">搜索</el-button>
|
||||
<el-button size="small" type="success" icon="Plus" @click="handleCreate">新增权限</el-button>
|
||||
<el-button size="small" type="danger" icon="Delete" :disabled="selectedIds.length === 0" @click="handleBatchDelete">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@ -73,7 +73,7 @@
|
||||
|
||||
<!-- 新增权限弹窗 -->
|
||||
<el-dialog title="新增权限" v-model="createDialogVisible" width="600px" align-center>
|
||||
<el-form ref="createFormRef" :rules="rules" :model="tempCreate" label-width="100px" label-position="right">
|
||||
<el-form ref="createFormRef" :rules="rules" :model="tempCreate" label-width="100px" label-position="right" size="small">
|
||||
<el-form-item label="上级权限" prop="parent_id">
|
||||
<el-tree-select
|
||||
v-model="tempCreate.parent_id"
|
||||
@ -126,15 +126,15 @@
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="createDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="submitLoading" @click="createData()">确定</el-button>
|
||||
<el-button size="small" @click="createDialogVisible = false">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="submitLoading" @click="createData()">确定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 编辑权限弹窗 -->
|
||||
<el-dialog title="编辑权限" v-model="updateDialogVisible" width="620px" align-center>
|
||||
<el-form ref="updateFormRef" :rules="rules" :model="tempUpdate" label-width="100px" label-position="right">
|
||||
<el-form ref="updateFormRef" :rules="rules" :model="tempUpdate" label-width="100px" label-position="right" size="small">
|
||||
<el-form-item label="上级权限" prop="parent_id">
|
||||
<el-tree-select
|
||||
v-model="tempUpdate.parent_id"
|
||||
@ -193,8 +193,8 @@
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="updateDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="submitLoading" @click="updateData()">确定</el-button>
|
||||
<el-button size="small" @click="updateDialogVisible = false">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="submitLoading" @click="updateData()">确定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@ -354,7 +354,8 @@ const handleSelectionChange = (val: any[]) => {
|
||||
const handleBatchDelete = () => {
|
||||
if (selectedIds.value.length === 0) return
|
||||
ElMessageBox.confirm('确认删除选中的权限吗(软删除)?', '提示', {
|
||||
type: 'warning'
|
||||
type: 'warning',
|
||||
buttonSize: 'small'
|
||||
}).then(async () => {
|
||||
await permissionDelete({ ids: selectedIds.value })
|
||||
ElMessage.success('批量删除成功')
|
||||
@ -364,7 +365,8 @@ const handleBatchDelete = () => {
|
||||
|
||||
const handleDelete = (row: any) => {
|
||||
ElMessageBox.confirm(`确认删除权限 "${row.meta_title || row.path}" 吗?`, '提示', {
|
||||
type: 'warning'
|
||||
type: 'warning',
|
||||
buttonSize: 'small'
|
||||
}).then(async () => {
|
||||
await permissionDelete({ ids: [row.permission_id] })
|
||||
ElMessage.success('删除成功')
|
||||
|
||||
@ -94,7 +94,8 @@ async function handleActionClick(btn: OperationButtonConfig) {
|
||||
{
|
||||
confirmButtonText: btn.confirmButtonText || '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: (btn.confirmType || 'warning') as any
|
||||
type: (btn.confirmType || 'warning') as any,
|
||||
buttonSize: 'small'
|
||||
}
|
||||
)
|
||||
} catch {
|
||||
|
||||
@ -237,7 +237,7 @@
|
||||
destroy-on-close
|
||||
align-center
|
||||
>
|
||||
<el-form label-width="120px" label-position="right" :disabled="submitting">
|
||||
<el-form label-width="120px" label-position="right" size="small" :disabled="submitting">
|
||||
<template v-if="dialogMode === 'edit'">
|
||||
<el-form-item label="电脑名称" required>
|
||||
<el-input v-model="formData.name" placeholder="请输入电脑名称" clearable />
|
||||
@ -259,8 +259,8 @@
|
||||
</template>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="dialogVisible = false" :disabled="submitting">取消</el-button>
|
||||
<el-button type="primary" :loading="submitting" @click="handleDialogSubmit">
|
||||
<el-button size="small" @click="dialogVisible = false" :disabled="submitting">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="submitting" @click="handleDialogSubmit">
|
||||
{{ dialogMode === 'edit' ? '保存' : '设置录制' }}
|
||||
</el-button>
|
||||
</template>
|
||||
@ -469,7 +469,7 @@ const confirmBatchDelete = async () => {
|
||||
return
|
||||
}
|
||||
try {
|
||||
await ElMessageBox.confirm(`确认删除选中的 ${selectedRows.value.length} 台打印电脑?`, '批量删除确认', { type: 'warning' })
|
||||
await ElMessageBox.confirm(`确认删除选中的 ${selectedRows.value.length} 台打印电脑?`, '批量删除确认', { type: 'warning', buttonSize: 'small' })
|
||||
let hasError = false
|
||||
for (const row of selectedRows.value) {
|
||||
if (row.id == null) continue
|
||||
@ -576,7 +576,7 @@ async function handleDialogSubmit() {
|
||||
|
||||
async function handleCancelRecording(row: Record<string, any>) {
|
||||
try {
|
||||
await ElMessageBox.confirm(`确认取消电脑「${row.name || row.id}」的录制状态?`, '取消录制', { type: 'warning' })
|
||||
await ElMessageBox.confirm(`确认取消电脑「${row.name || row.id}」的录制状态?`, '取消录制', { type: 'warning', buttonSize: 'small' })
|
||||
const res: any = await printComputerCancelRecording({ id: row.id })
|
||||
if (res && okCode(res.code)) {
|
||||
ElMessage.success('已取消录制')
|
||||
@ -591,7 +591,7 @@ async function handleCancelRecording(row: Record<string, any>) {
|
||||
|
||||
async function handleDelete(row: Record<string, any>) {
|
||||
try {
|
||||
await ElMessageBox.confirm(`确认删除电脑「${row.name || row.id}」?`, '删除确认', { type: 'warning' })
|
||||
await ElMessageBox.confirm(`确认删除电脑「${row.name || row.id}」?`, '删除确认', { type: 'warning', buttonSize: 'small' })
|
||||
const res: any = await printComputerDel({ id: row.id })
|
||||
if (res && okCode(res.code)) {
|
||||
ElMessage.success('删除成功')
|
||||
|
||||
@ -53,7 +53,8 @@ async function handleActionClick(btn: OperationButtonConfig) {
|
||||
await ElMessageBox.confirm(btn.confirmMessage, btn.confirmTitle || '确认操作', {
|
||||
confirmButtonText: btn.confirmButtonText || '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: (btn.confirmType || 'warning') as any
|
||||
type: (btn.confirmType || 'warning') as any,
|
||||
buttonSize: 'small'
|
||||
})
|
||||
} catch {
|
||||
return // 取消
|
||||
|
||||
@ -472,7 +472,7 @@ async function handleDeleteRow(row: Record<string, any>) {
|
||||
await ElMessageBox.confirm(
|
||||
`确认删除角色「${row.role_name}」吗?删除后该角色将被停用。`,
|
||||
'删除确认',
|
||||
{ type: 'warning', confirmButtonText: '确定删除' }
|
||||
{ type: 'warning', confirmButtonText: '确定删除', buttonSize: 'small' }
|
||||
)
|
||||
} catch {
|
||||
return
|
||||
@ -500,7 +500,7 @@ async function handleBatchDelete() {
|
||||
await ElMessageBox.confirm(
|
||||
`确认删除选中的 ${ids.length} 个角色吗?删除后这些角色将被停用。`,
|
||||
'批量删除角色',
|
||||
{ type: 'warning', confirmButtonText: '确定删除' }
|
||||
{ type: 'warning', confirmButtonText: '确定删除', buttonSize: 'small' }
|
||||
)
|
||||
} catch {
|
||||
return
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
@update:model-value="handleVisibleChange"
|
||||
@close="handleClosed"
|
||||
>
|
||||
<el-form ref="formRef" :model="form" :rules="roleRules" label-width="90px">
|
||||
<el-form ref="formRef" :model="form" :rules="roleRules" label-width="90px" size="small">
|
||||
<el-form-item label="角色编码" prop="role_code">
|
||||
<el-input
|
||||
v-model="form.role_code"
|
||||
@ -76,8 +76,8 @@
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="handleVisibleChange(false)">取消</el-button>
|
||||
<el-button type="primary" :loading="submitLoading" :disabled="submitDisabled" @click="handleSubmit">
|
||||
<el-button size="small" @click="handleVisibleChange(false)">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="submitLoading" :disabled="submitDisabled" @click="handleSubmit">
|
||||
确定
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
>
|
||||
<div class="perm-dialog-body">
|
||||
<div class="perm-left">
|
||||
<el-form :inline="true" :model="permFilter" class="perm-filter">
|
||||
<el-form :inline="true" :model="permFilter" class="perm-filter" size="small">
|
||||
<el-form-item label="类型">
|
||||
<el-select v-model="permFilter.type" placeholder="全部" clearable style="width: 130px" @change="applyPermFilter">
|
||||
<el-option
|
||||
@ -79,8 +79,8 @@
|
||||
|
||||
<template #footer>
|
||||
<span class="perm-footer-tip">已选 {{ selectedPermIds.length }} 个权限</span>
|
||||
<el-button @click="handleVisibleChange(false)">取消</el-button>
|
||||
<el-button type="primary" :loading="permSubmitting" @click="handleSubmit">保存权限</el-button>
|
||||
<el-button size="small" @click="handleVisibleChange(false)">取消</el-button>
|
||||
<el-button size="small" type="primary" :loading="permSubmitting" @click="handleSubmit">保存权限</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user