提交
This commit is contained in:
1 parent
a79aee2614
commit
427bcb1551
274 files changed
+59416
-38342
No files matched your search
@@ -55,10 +55,6 @@
|
||||
<div class="list-toolbar-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
</div>
|
||||
<el-button class="btn-main" type="primary" @click="handleAdd">
|
||||
<el-icon><Plus /></el-icon>
|
||||
新增样本编码
|
||||
</el-button>
|
||||
<el-button class="btn-ghost" @click="openBatchGenerate">
|
||||
<el-icon><DocumentAdd /></el-icon>
|
||||
批量生成
|
||||
@@ -71,6 +67,10 @@
|
||||
<el-icon><Promotion /></el-icon>
|
||||
批量下发
|
||||
</el-button>
|
||||
<el-button class="btn-ghost" @click="handleAdd">
|
||||
<el-icon><Plus /></el-icon>
|
||||
样本手工编码
|
||||
</el-button>
|
||||
<el-button
|
||||
class="btn-ghost"
|
||||
:disabled="selectedRows.length === 0"
|
||||
|
||||
@@ -7,220 +7,256 @@
|
||||
<h2>细胞样本基础信息维护</h2>
|
||||
</div>
|
||||
|
||||
<el-tabs v-model="activeTab" class="panel-tabs">
|
||||
<el-tabs v-model="activeTab" class="panel-pill-tabs">
|
||||
<el-tab-pane label="细胞样本类型" name="type">
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
<el-form-item label="关键词">
|
||||
<el-input v-model="searchForm.keyword" placeholder="类型编码/名称" clearable />
|
||||
</el-form-item>
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
<el-form-item label="关键词">
|
||||
<el-input v-model="searchForm.keyword" placeholder="类型编码/名称" clearable />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="filter-actions-row">
|
||||
<span class="filter-hint">按编码、名称模糊查询。</span>
|
||||
<div class="filter-actions-end">
|
||||
<el-button class="btn-ghost" @click="handleReset"
|
||||
><el-icon><RefreshLeft /></el-icon>重置</el-button
|
||||
>
|
||||
<el-button class="btn-main" type="primary" @click="handleSearch"
|
||||
><el-icon><Search /></el-icon>搜索</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="filter-actions-row">
|
||||
<span class="filter-hint">按编码、名称模糊查询。</span>
|
||||
<div class="filter-actions-end">
|
||||
<el-button class="btn-ghost" @click="handleReset"
|
||||
><el-icon><RefreshLeft /></el-icon>重置</el-button
|
||||
>
|
||||
<el-button class="btn-main" type="primary" @click="handleSearch"
|
||||
><el-icon><Search /></el-icon>搜索</el-button
|
||||
|
||||
<div class="list-toolbar">
|
||||
<div class="list-toolbar-row">
|
||||
<div class="list-toolbar-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
</div>
|
||||
<el-button class="btn-main" type="primary" @click="handleAdd">
|
||||
<el-icon><Plus /></el-icon>
|
||||
新增类型
|
||||
</el-button>
|
||||
<el-button
|
||||
class="btn-ghost"
|
||||
type="danger"
|
||||
:disabled="selectedRows.length === 0"
|
||||
@click="handleBatchDelete"
|
||||
>
|
||||
批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="list-toolbar">
|
||||
<div class="list-toolbar-row">
|
||||
<div class="list-toolbar-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
</div>
|
||||
<el-button class="btn-main" type="primary" @click="handleAdd">
|
||||
<el-icon><Plus /></el-icon>
|
||||
新增类型
|
||||
</el-button>
|
||||
<el-button
|
||||
class="btn-ghost"
|
||||
type="danger"
|
||||
:disabled="selectedRows.length === 0"
|
||||
@click="handleBatchDelete"
|
||||
>
|
||||
批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<el-table
|
||||
class="list-table"
|
||||
:data="tableData"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
@row-dblclick="handleView"
|
||||
>
|
||||
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
min-width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
:index="(index) => (pagination.page - 1) * pagination.pageSize + index + 1"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="typeCode"
|
||||
label="类型编码"
|
||||
min-width="140"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="typeName"
|
||||
label="类型名称"
|
||||
min-width="180"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="storageYears"
|
||||
label="存储年限(年)"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="storagePrice"
|
||||
label="存储价格(元)"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
{{ row.storagePrice != null ? row.storagePrice : '—' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
label="创建时间"
|
||||
min-width="180"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
min-width="120"
|
||||
fixed="right"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<div style="display: flex; justify-content: center; gap: 8px">
|
||||
<el-button class="btn-op-item" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-dropdown trigger="hover" @command="(cmd: string) => handleDropdownCommand(cmd, row)">
|
||||
<el-button class="btn-op-item">
|
||||
<el-icon><More /></el-icon>
|
||||
<div class="list-body list-wrap">
|
||||
<div v-loading="loading" class="sample-type-card-grid">
|
||||
<div
|
||||
v-for="row in tableData"
|
||||
:key="row.id"
|
||||
class="sample-type-card"
|
||||
:class="{ 'is-selected': isRowSelected(row.id) }"
|
||||
@dblclick="handleView(row)"
|
||||
>
|
||||
<div class="sample-type-card__select" @click.stop>
|
||||
<el-checkbox
|
||||
:model-value="isRowSelected(row.id)"
|
||||
@change="(val) => toggleRowSelection(row, !!val)"
|
||||
/>
|
||||
</div>
|
||||
<div class="sample-type-card__media">
|
||||
<el-image
|
||||
v-if="row.typeLogo"
|
||||
:src="typeLogoUrl(row.typeLogo)"
|
||||
fit="cover"
|
||||
class="sample-type-card__logo"
|
||||
/>
|
||||
<div v-else class="sample-type-card__logo-placeholder">
|
||||
<el-icon><Collection /></el-icon>
|
||||
<span>暂无Logo</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sample-type-card__body">
|
||||
<div class="sample-type-card__title" :title="row.typeName">{{
|
||||
row.typeName
|
||||
}}</div>
|
||||
<div class="sample-type-card__code">{{ row.typeCode }}</div>
|
||||
<div class="sample-type-card__meta">
|
||||
<span v-if="row.storageYears != null">存储 {{ row.storageYears }} 年</span>
|
||||
<span v-if="row.storagePrice != null"> · ¥{{ row.storagePrice }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sample-type-card__footer">
|
||||
<el-button class="btn-op-item" @click.stop="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="edit">
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="delete" divided>
|
||||
<el-icon><Delete /></el-icon>删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<el-dropdown trigger="hover" @command="(cmd) => handleDropdownCommand(cmd, row)">
|
||||
<el-button class="btn-op-item" @click.stop>
|
||||
<el-icon><More /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="edit">
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="delete" divided>
|
||||
<el-icon><Delete /></el-icon>删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination list-pager-bar">
|
||||
<el-pagination
|
||||
:current-page="pagination.page"
|
||||
:page-size="pagination.pageSize"
|
||||
:total="pagination.total"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="(val) => ((pagination.page = 1), (pagination.pageSize = val), loadData())"
|
||||
@current-change="(val) => ((pagination.page = val), loadData())"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogTitle"
|
||||
width="640px"
|
||||
class="dialog-form-layout"
|
||||
align-center
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-position="top"
|
||||
class="biz-dialog-form"
|
||||
scroll-to-error
|
||||
:scroll-into-view-options="{ behavior: 'smooth', block: 'center' }"
|
||||
>
|
||||
<div class="form-grid-2">
|
||||
<el-form-item label="类型编码" prop="typeCode">
|
||||
<el-input v-model="formData.typeCode" placeholder="租户内唯一" :disabled="isEdit" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型名称" prop="typeName">
|
||||
<el-input v-model="formData.typeName" placeholder="必填" />
|
||||
</el-form-item>
|
||||
<el-form-item label="存储年限(年)">
|
||||
<el-input
|
||||
type="number"
|
||||
step="any"
|
||||
v-model="formData.storageYears"
|
||||
:min="0"
|
||||
:max="200"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="存储价格(元)">
|
||||
<el-input
|
||||
type="number"
|
||||
step="any"
|
||||
v-model="formData.storagePrice"
|
||||
:min="0"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" class="form-col-span-2">
|
||||
<el-input v-model="formData.remark" type="textarea" :rows="2" placeholder="可选" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-empty
|
||||
v-if="!loading && !tableData.length"
|
||||
description="暂无细胞样本类型"
|
||||
:image-size="80"
|
||||
/>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button class="btn-ghost" @click="dialogVisible = false">
|
||||
<el-icon><Close /></el-icon>
|
||||
取消
|
||||
</el-button>
|
||||
<el-button class="btn-main" type="primary" @click="handleSubmit" :loading="submitLoading">
|
||||
<el-icon><Check /></el-icon>
|
||||
确定
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<SystemViewDialog
|
||||
v-model:visible="viewVisible"
|
||||
:title="viewRow?.typeName || '类型详情'"
|
||||
:icon="Collection"
|
||||
:code="viewRow?.typeCode"
|
||||
code-label="类型编码"
|
||||
:sections="viewSections"
|
||||
/>
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogTitle"
|
||||
width="640px"
|
||||
class="dialog-form-layout"
|
||||
align-center
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-position="top"
|
||||
class="biz-dialog-form"
|
||||
scroll-to-error
|
||||
:scroll-into-view-options="{ behavior: 'smooth', block: 'center' }"
|
||||
>
|
||||
<div class="form-grid-2">
|
||||
<el-form-item label="类型编码" prop="typeCode">
|
||||
<el-input
|
||||
v-model="formData.typeCode"
|
||||
placeholder="租户内唯一"
|
||||
:disabled="isEdit"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型名称" prop="typeName">
|
||||
<el-input v-model="formData.typeName" placeholder="必填" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型Logo" style="grid-column: 1 / -1">
|
||||
<div class="sample-type-logo-row">
|
||||
<el-image
|
||||
v-if="formData.typeLogo"
|
||||
:src="typeLogoUrl(formData.typeLogo)"
|
||||
fit="cover"
|
||||
class="sample-type-logo-preview"
|
||||
/>
|
||||
<div v-else class="sample-type-logo-placeholder">暂无</div>
|
||||
<el-upload
|
||||
ref="typeLogoUploadRef"
|
||||
accept="image/*"
|
||||
:show-file-list="false"
|
||||
:auto-upload="false"
|
||||
:limit="1"
|
||||
:on-change="handleTypeLogoChange"
|
||||
:on-exceed="handleTypeLogoExceed"
|
||||
>
|
||||
<el-button type="primary" plain>
|
||||
<el-icon><Upload /></el-icon>上传Logo
|
||||
</el-button>
|
||||
</el-upload>
|
||||
<el-button
|
||||
v-if="formData.typeLogo"
|
||||
class="btn-ghost"
|
||||
@click="formData.typeLogo = ''"
|
||||
>
|
||||
<el-icon><Delete /></el-icon>移除
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="存储年限(年)">
|
||||
<el-input
|
||||
type="number"
|
||||
step="any"
|
||||
v-model="formData.storageYears"
|
||||
:min="0"
|
||||
:max="200"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="存储价格(元)">
|
||||
<el-input
|
||||
type="number"
|
||||
step="any"
|
||||
v-model="formData.storagePrice"
|
||||
:min="0"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="orderNum">
|
||||
<template #label>排序<span class="form-label-tip">数值越小越靠前</span></template>
|
||||
<el-input-number
|
||||
v-model="formData.orderNum"
|
||||
:min="0"
|
||||
:max="9999"
|
||||
:step="1"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" class="form-col-span-2">
|
||||
<el-input
|
||||
v-model="formData.remark"
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="可选"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button class="btn-ghost" @click="dialogVisible = false">
|
||||
<el-icon><Close /></el-icon>
|
||||
取消
|
||||
</el-button>
|
||||
<el-button
|
||||
class="btn-main"
|
||||
type="primary"
|
||||
@click="handleSubmit"
|
||||
:loading="submitLoading"
|
||||
>
|
||||
<el-icon><Check /></el-icon>
|
||||
确定
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<SystemViewDialog
|
||||
v-model:visible="viewVisible"
|
||||
:title="viewRow?.typeName || '类型详情'"
|
||||
:icon="Collection"
|
||||
:code="viewRow?.typeCode"
|
||||
code-label="类型编码"
|
||||
:sections="viewSections"
|
||||
>
|
||||
<template v-if="viewRow?.typeLogo" #type-logo>
|
||||
<dl class="sample-type-view-kv-grid">
|
||||
<div class="sample-type-view-kv">
|
||||
<dt>Logo</dt>
|
||||
<dd>
|
||||
<el-image
|
||||
:src="typeLogoUrl(viewRow.typeLogo)"
|
||||
fit="cover"
|
||||
class="sample-type-view-logo"
|
||||
:preview-src-list="[typeLogoUrl(viewRow.typeLogo)]"
|
||||
/>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</template>
|
||||
</SystemViewDialog>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="样本编码" name="sample-code" lazy>
|
||||
@@ -244,8 +280,10 @@
|
||||
Search,
|
||||
More,
|
||||
Edit,
|
||||
Delete
|
||||
Delete,
|
||||
Upload
|
||||
} from '@element-plus/icons-vue'
|
||||
import type { UploadFile } from 'element-plus'
|
||||
import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
|
||||
import {
|
||||
fetchCellSampleTypeList,
|
||||
@@ -253,6 +291,7 @@
|
||||
fetchUpdateCellSampleType,
|
||||
fetchDeleteCellSampleType
|
||||
} from '@/api/admin'
|
||||
import { fetchUploadAttachment } from '@/api/business'
|
||||
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
|
||||
import SampleCodeTab from './SampleCodeTab.vue'
|
||||
|
||||
@@ -260,11 +299,48 @@
|
||||
|
||||
const route = useRoute()
|
||||
const activeTab = ref('type')
|
||||
const typeLogoUploadRef = ref()
|
||||
const minioBaseUrl = (import.meta.env.VITE_MINIO_BASE_URL || '').replace(/\/$/, '')
|
||||
|
||||
function typeLogoUrl(url: string) {
|
||||
if (!url) return ''
|
||||
if (url.startsWith('http://') || url.startsWith('https://') || url.startsWith('/')) return url
|
||||
return `${minioBaseUrl}/${url}`
|
||||
}
|
||||
|
||||
async function uploadTypeLogoFile(file: File) {
|
||||
try {
|
||||
const fd = new FormData()
|
||||
fd.append('folder', 'cell-sample-type')
|
||||
fd.append('file', file)
|
||||
const res = await fetchUploadAttachment(fd)
|
||||
formData.typeLogo = res.fileUrl || ''
|
||||
ElMessage.success('Logo上传成功')
|
||||
} catch (e) {
|
||||
console.error('样本类型Logo上传失败:', e)
|
||||
ElMessage.error('Logo上传失败')
|
||||
} finally {
|
||||
typeLogoUploadRef.value?.clearFiles()
|
||||
}
|
||||
}
|
||||
|
||||
const handleTypeLogoChange = async (uploadFile: UploadFile) => {
|
||||
const file: any = (uploadFile as any).raw
|
||||
if (!file) return
|
||||
const status = (uploadFile as any).status
|
||||
if (status && status !== 'ready') return
|
||||
await uploadTypeLogoFile(file)
|
||||
}
|
||||
|
||||
const handleTypeLogoExceed = (files: File[]) => {
|
||||
const file = files[0]
|
||||
if (file) uploadTypeLogoFile(file)
|
||||
}
|
||||
|
||||
const searchForm = reactive<{ keyword: string }>({ keyword: '' })
|
||||
const tableData = ref<Api.BizCellSampleType.CellSampleTypeItem[]>([])
|
||||
const selectedRows = ref<Api.BizCellSampleType.CellSampleTypeItem[]>([])
|
||||
const loading = ref(false)
|
||||
const pagination = reactive({ page: 1, pageSize: 10, total: 0 })
|
||||
const dialogVisible = ref(false)
|
||||
const dialogTitle = ref('新增类型')
|
||||
const isEdit = ref(false)
|
||||
@@ -272,7 +348,6 @@
|
||||
const formRef = ref()
|
||||
const editingId = ref<string | null>(null)
|
||||
|
||||
// ---- 查看弹窗 ----
|
||||
const viewVisible = ref(false)
|
||||
const viewRow = ref<Api.BizCellSampleType.CellSampleTypeItem | null>(null)
|
||||
const viewSections = computed(() => {
|
||||
@@ -286,12 +361,34 @@
|
||||
{ label: '类型名称', value: row.typeName },
|
||||
{ label: '存储年限(年)', value: row.storageYears },
|
||||
{ label: '存储价格(元)', value: row.storagePrice },
|
||||
{ label: '排序', value: row.orderNum },
|
||||
{ label: '创建时间', value: row.createTime },
|
||||
{ label: '备注', value: row.remark, span: true }
|
||||
]
|
||||
}
|
||||
},
|
||||
row.typeLogo
|
||||
? {
|
||||
title: '类型Logo',
|
||||
fields: [],
|
||||
slot: 'type-logo'
|
||||
}
|
||||
: {
|
||||
title: '类型Logo',
|
||||
fields: [{ label: 'Logo', value: '无' }]
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const isRowSelected = (id: string) => selectedRows.value.some((r) => r.id === id)
|
||||
|
||||
const toggleRowSelection = (row: Api.BizCellSampleType.CellSampleTypeItem, checked: boolean) => {
|
||||
if (checked) {
|
||||
if (!isRowSelected(row.id)) selectedRows.value = [...selectedRows.value, row]
|
||||
return
|
||||
}
|
||||
selectedRows.value = selectedRows.value.filter((r) => r.id !== row.id)
|
||||
}
|
||||
|
||||
function handleView(row: Api.BizCellSampleType.CellSampleTypeItem) {
|
||||
viewRow.value = row
|
||||
viewVisible.value = true
|
||||
@@ -300,6 +397,7 @@
|
||||
const formData = reactive({
|
||||
typeCode: '',
|
||||
typeName: '',
|
||||
typeLogo: '',
|
||||
storageYears: null as number | null,
|
||||
storagePrice: null as number | null,
|
||||
orderNum: 0,
|
||||
@@ -311,39 +409,35 @@
|
||||
typeName: [{ required: true, message: '请输入类型名称', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
const handleSelectionChange = (rows: Api.BizCellSampleType.CellSampleTypeItem[]) => {
|
||||
selectedRows.value = rows
|
||||
}
|
||||
|
||||
async function loadData() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await fetchCellSampleTypeList({
|
||||
page: pagination.page,
|
||||
pageSize: pagination.pageSize,
|
||||
page: 1,
|
||||
pageSize: 100,
|
||||
keyword: searchForm.keyword || undefined
|
||||
})
|
||||
tableData.value = res.list || []
|
||||
pagination.total = res.total ?? 0
|
||||
const validIds = new Set(tableData.value.map((r) => r.id))
|
||||
selectedRows.value = selectedRows.value.filter((r) => validIds.has(r.id))
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
function handleReset() {
|
||||
searchForm.keyword = ''
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
formData.typeCode = ''
|
||||
formData.typeName = ''
|
||||
formData.typeLogo = ''
|
||||
formData.storageYears = null
|
||||
formData.storagePrice = null
|
||||
formData.orderNum = 0
|
||||
@@ -365,6 +459,7 @@
|
||||
editingId.value = row.id
|
||||
formData.typeCode = row.typeCode || ''
|
||||
formData.typeName = row.typeName || ''
|
||||
formData.typeLogo = row.typeLogo || ''
|
||||
formData.storageYears = row.storageYears ?? null
|
||||
formData.storagePrice = row.storagePrice ?? null
|
||||
formData.orderNum = row.orderNum ?? 0
|
||||
@@ -380,6 +475,7 @@
|
||||
const payload = {
|
||||
typeCode: formData.typeCode.trim(),
|
||||
typeName: formData.typeName.trim(),
|
||||
typeLogo: formData.typeLogo?.trim() ?? '',
|
||||
storageYears: formData.storageYears,
|
||||
storagePrice: formData.storagePrice,
|
||||
orderNum: formData.orderNum,
|
||||
@@ -388,6 +484,7 @@
|
||||
if (isEdit.value && editingId.value) {
|
||||
await fetchUpdateCellSampleType(editingId.value, {
|
||||
typeName: payload.typeName,
|
||||
typeLogo: payload.typeLogo,
|
||||
storageYears: payload.storageYears,
|
||||
storagePrice: payload.storagePrice,
|
||||
orderNum: payload.orderNum,
|
||||
@@ -408,8 +505,12 @@
|
||||
|
||||
function handleDropdownCommand(command: string, row: any) {
|
||||
switch (command) {
|
||||
case 'edit': handleEdit(row); break
|
||||
case 'delete': handleDelete(row); break
|
||||
case 'edit':
|
||||
handleEdit(row)
|
||||
break
|
||||
case 'delete':
|
||||
handleDelete(row)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,11 +534,10 @@
|
||||
await loadData()
|
||||
}, fullscreenLoadingText.batchDelete)
|
||||
}
|
||||
// 输入检索条件时自动搜索(防抖 300ms)
|
||||
|
||||
watchDebounced(
|
||||
searchForm,
|
||||
() => {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
},
|
||||
{ debounce: 300, deep: true }
|
||||
@@ -458,4 +558,180 @@
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.sample-type-logo-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.sample-type-logo-preview {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--mint-border, #e2e8f0);
|
||||
}
|
||||
|
||||
.sample-type-logo-placeholder {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 8px;
|
||||
border: 1px dashed var(--mint-border, #e2e8f0);
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
font-size: 12px;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.sample-type-card-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
||||
gap: 16px;
|
||||
min-height: 120px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.sample-type-card {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
border: 1px solid var(--mint-border, #e2e8f0);
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
|
||||
&:hover {
|
||||
border-color: #a8d4c4;
|
||||
box-shadow: 0 2px 12px rgba(4, 120, 87, 0.1);
|
||||
}
|
||||
|
||||
&.is-selected {
|
||||
border-color: var(--mint-primary, #10b981);
|
||||
box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25);
|
||||
}
|
||||
}
|
||||
|
||||
.sample-type-card__select {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.sample-type-card__media {
|
||||
width: 100%;
|
||||
height: 160px;
|
||||
flex-shrink: 0;
|
||||
background: #f1f5f9;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.sample-type-card__logo {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 160px;
|
||||
|
||||
:deep(.el-image__inner),
|
||||
:deep(img) {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.sample-type-card__logo-placeholder {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
width: 100%;
|
||||
height: 160px;
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
font-size: 12px;
|
||||
background: #f1f5f9;
|
||||
|
||||
.el-icon {
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
.sample-type-card__body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
flex: 1;
|
||||
padding: 10px 16px 8px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.sample-type-card__title {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: var(--mint-text, #0f172a);
|
||||
line-height: 1.4;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.sample-type-card__code {
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
.sample-type-card__meta {
|
||||
margin-top: 2px;
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
}
|
||||
|
||||
.sample-type-card__footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
padding: 10px 16px 14px;
|
||||
border-top: 1px solid var(--mint-border, #e2e8f0);
|
||||
}
|
||||
|
||||
.sample-type-view-kv-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 12px 20px;
|
||||
}
|
||||
|
||||
.sample-type-view-kv {
|
||||
display: grid;
|
||||
grid-template-columns: 96px 1fr;
|
||||
gap: 8px 12px;
|
||||
font-size: 13px;
|
||||
align-items: start;
|
||||
|
||||
dt {
|
||||
margin: 0;
|
||||
color: #64748b;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin: 0;
|
||||
color: #1e293b;
|
||||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
.sample-type-view-logo {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e2e8f0;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
@@ -7,7 +7,7 @@
|
||||
<h2>细胞采集基础信息维护</h2>
|
||||
</div>
|
||||
|
||||
<el-tabs v-model="activeTab" class="panel-tabs">
|
||||
<el-tabs v-model="activeTab" class="panel-pill-tabs">
|
||||
<el-tab-pane label="采集地区及医院" name="region">
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="page-container">
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2>保险公司列表</h2>
|
||||
<h2>保险公司及险种</h2>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
@@ -45,99 +45,118 @@
|
||||
</div>
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<el-table
|
||||
class="list-table"
|
||||
:data="tableData"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
@row-dblclick="handleView"
|
||||
>
|
||||
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
min-width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
:index="(i) => (pagination.page - 1) * pagination.pageSize + i + 1"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="companyName"
|
||||
label="保险公司名称"
|
||||
min-width="160"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="companyAddress"
|
||||
label="地址"
|
||||
min-width="180"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="contactName"
|
||||
label="联系人"
|
||||
min-width="100"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="contactPhone"
|
||||
label="联系电话"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="tag"
|
||||
label="状态"
|
||||
min-width="90"
|
||||
align="center"
|
||||
header-align="center"
|
||||
<div v-loading="loading" class="insurance-company-card-grid">
|
||||
<div
|
||||
v-for="row in tableData"
|
||||
:key="row.id"
|
||||
class="insurance-company-card"
|
||||
:class="{ 'is-selected': isRowSelected(row.id) }"
|
||||
@dblclick="handleView(row)"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.status == '1' ? 'success' : 'info'" size="small">{{
|
||||
row.status == '1' ? '正常' : '停用'
|
||||
}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
min-width="160"
|
||||
fixed="right"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<div style="display: flex; justify-content: center; gap: 8px">
|
||||
<el-button class="btn-op-item primary" @click="openItemDialog(row)">
|
||||
<el-icon><Setting /></el-icon>险种价格配置
|
||||
</el-button>
|
||||
<el-dropdown trigger="hover" @command="(cmd: string) => handleDropdownCommand(cmd, row)">
|
||||
<el-button class="btn-op-item">
|
||||
<el-icon><More /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="view">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="edit">
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="delete" divided>
|
||||
<el-icon><Delete /></el-icon>删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<div class="insurance-company-card__select" @click.stop>
|
||||
<el-checkbox
|
||||
:model-value="isRowSelected(row.id)"
|
||||
@change="(val) => toggleRowSelection(row, !!val)"
|
||||
/>
|
||||
</div>
|
||||
<div class="insurance-company-card__header">
|
||||
<div class="insurance-company-card__media">
|
||||
<el-image
|
||||
v-if="row.companyLogo"
|
||||
:src="companyLogoUrl(row.companyLogo)"
|
||||
fit="cover"
|
||||
class="insurance-company-card__logo"
|
||||
/>
|
||||
<div v-else class="insurance-company-card__logo-placeholder">
|
||||
<el-icon><OfficeBuilding /></el-icon>
|
||||
<span>暂无Logo</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="insurance-company-card__summary">
|
||||
<div class="insurance-company-card__title-row">
|
||||
<div class="insurance-company-card__title" :title="row.companyName">
|
||||
{{ row.companyName }}
|
||||
</div>
|
||||
<el-tag :type="row.status == '1' ? 'success' : 'info'" size="small">
|
||||
{{ row.status == '1' ? '正常' : '停用' }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div class="insurance-company-card__address" :title="row.companyAddress || ''">
|
||||
{{ row.companyAddress || ' ' }}
|
||||
</div>
|
||||
<div class="insurance-company-card__contact">
|
||||
<template v-if="row.contactName || row.contactPhone">
|
||||
<span v-if="row.contactName">{{ row.contactName }}</span>
|
||||
<span v-if="row.contactName && row.contactPhone"> · </span>
|
||||
<span v-if="row.contactPhone">{{ row.contactPhone }}</span>
|
||||
</template>
|
||||
<span v-else> </span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="insurance-company-card__projects">
|
||||
<div class="insurance-company-card__projects-head">
|
||||
<span class="insurance-company-card__projects-title">险种</span>
|
||||
<span class="insurance-company-card__projects-count">
|
||||
{{ (row.projectPrices || []).length }} 项
|
||||
</span>
|
||||
</div>
|
||||
<div class="insurance-company-card__project-body">
|
||||
<div
|
||||
v-for="item in (row.projectPrices || []).slice(0, 1)"
|
||||
:key="item.id"
|
||||
class="insurance-company-card__project-item"
|
||||
>
|
||||
<span class="insurance-company-card__project-name" :title="item.projectName">
|
||||
{{ item.projectName }}
|
||||
</span>
|
||||
<span class="insurance-company-card__project-fee">
|
||||
{{
|
||||
item.projectFee != null ? '¥' + formatMoneyDisplay(item.projectFee) : '—'
|
||||
}}
|
||||
</span>
|
||||
<el-tag :type="item.status == '1' ? 'success' : 'info'" size="small">
|
||||
{{ item.status == '1' ? '正常' : '停用' }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div
|
||||
v-if="!(row.projectPrices || []).length"
|
||||
class="insurance-company-card__project-empty"
|
||||
>
|
||||
暂无险种,请点击下方配置
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="insurance-company-card__footer">
|
||||
<el-button class="btn-op-item primary" @click.stop="openItemDialog(row)">
|
||||
<el-icon><Setting /></el-icon>险种价格配置
|
||||
</el-button>
|
||||
<el-dropdown trigger="hover" @command="(cmd) => handleDropdownCommand(cmd, row)">
|
||||
<el-button class="btn-op-item" @click.stop>
|
||||
<el-icon><More /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="view">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="edit">
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="delete" divided>
|
||||
<el-icon><Delete /></el-icon>删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-empty
|
||||
v-if="!loading && !tableData.length"
|
||||
description="暂无保险公司数据"
|
||||
:image-size="80"
|
||||
/>
|
||||
<div class="pagination list-pager-bar">
|
||||
<el-pagination
|
||||
:current-page="pagination.page"
|
||||
@@ -172,6 +191,37 @@
|
||||
<el-form-item label="保险公司名称" prop="companyName">
|
||||
<el-input v-model="companyForm.companyName" placeholder="请输入保险公司名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="公司Logo" class="form-col-span-2">
|
||||
<div class="company-logo-row">
|
||||
<el-image
|
||||
v-if="companyForm.companyLogo"
|
||||
:src="companyLogoUrl(companyForm.companyLogo)"
|
||||
fit="cover"
|
||||
class="company-logo-preview"
|
||||
/>
|
||||
<div v-else class="company-logo-placeholder">暂无</div>
|
||||
<el-upload
|
||||
ref="companyLogoUploadRef"
|
||||
accept="image/*"
|
||||
:show-file-list="false"
|
||||
:auto-upload="false"
|
||||
:limit="1"
|
||||
:on-change="handleCompanyLogoChange"
|
||||
:on-exceed="handleCompanyLogoExceed"
|
||||
>
|
||||
<el-button type="primary" plain>
|
||||
<el-icon><Upload /></el-icon>上传Logo
|
||||
</el-button>
|
||||
</el-upload>
|
||||
<el-button
|
||||
v-if="companyForm.companyLogo"
|
||||
class="btn-ghost"
|
||||
@click="companyForm.companyLogo = ''"
|
||||
>
|
||||
<el-icon><Delete /></el-icon>移除
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="公司地址">
|
||||
<el-input v-model="companyForm.companyAddress" placeholder="请输入公司地址" />
|
||||
</el-form-item>
|
||||
@@ -402,7 +452,23 @@
|
||||
:icon="OfficeBuilding"
|
||||
:meta="viewCompanyName"
|
||||
:sections="viewSections"
|
||||
/>
|
||||
>
|
||||
<template v-if="viewCompanyLogo" #company-logo>
|
||||
<dl class="company-view-kv-grid">
|
||||
<div class="company-view-kv">
|
||||
<dt>Logo</dt>
|
||||
<dd>
|
||||
<el-image
|
||||
:src="companyLogoUrl(viewCompanyLogo)"
|
||||
fit="cover"
|
||||
class="company-view-logo"
|
||||
:preview-src-list="[companyLogoUrl(viewCompanyLogo)]"
|
||||
/>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</template>
|
||||
</SystemViewDialog>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -419,8 +485,10 @@
|
||||
Edit,
|
||||
Delete,
|
||||
More,
|
||||
OfficeBuilding
|
||||
OfficeBuilding,
|
||||
Upload
|
||||
} from '@element-plus/icons-vue'
|
||||
import type { UploadFile } from 'element-plus'
|
||||
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
|
||||
import type { ViewSection } from '@/components/business/system-view-dialog/index.vue'
|
||||
import {
|
||||
@@ -437,12 +505,62 @@
|
||||
fetchUpdateInsuranceProjectPrice,
|
||||
fetchDeleteInsuranceProjectPrice
|
||||
} from '@/api/admin'
|
||||
import { fetchUploadAttachment } from '@/api/business'
|
||||
import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
|
||||
import AmountInput from '@/components/common/amount-input/index.vue'
|
||||
import { formatMoneyDisplay } from '@/utils/money-format'
|
||||
|
||||
defineOptions({ name: 'BasicInfoInsuranceCompany' })
|
||||
|
||||
const companyLogoUploadRef = ref()
|
||||
const minioBaseUrl = (import.meta.env.VITE_MINIO_BASE_URL || '').replace(/\/$/, '')
|
||||
|
||||
function companyLogoUrl(url: string) {
|
||||
if (!url) return ''
|
||||
if (url.startsWith('http://') || url.startsWith('https://') || url.startsWith('/')) return url
|
||||
return `${minioBaseUrl}/${url}`
|
||||
}
|
||||
|
||||
async function uploadCompanyLogoFile(file: File) {
|
||||
try {
|
||||
const fd = new FormData()
|
||||
fd.append('folder', 'insurance-company')
|
||||
fd.append('file', file)
|
||||
const res = await fetchUploadAttachment(fd)
|
||||
companyForm.companyLogo = res.fileUrl || ''
|
||||
ElMessage.success('Logo上传成功')
|
||||
} catch (e) {
|
||||
console.error('保险公司Logo上传失败:', e)
|
||||
ElMessage.error('Logo上传失败')
|
||||
} finally {
|
||||
companyLogoUploadRef.value?.clearFiles()
|
||||
}
|
||||
}
|
||||
|
||||
const handleCompanyLogoChange = async (uploadFile: UploadFile) => {
|
||||
const file: any = (uploadFile as any).raw
|
||||
if (!file) return
|
||||
const status = (uploadFile as any).status
|
||||
if (status && status !== 'ready') return
|
||||
await uploadCompanyLogoFile(file)
|
||||
}
|
||||
|
||||
const handleCompanyLogoExceed = (files: File[]) => {
|
||||
const file = files[0]
|
||||
if (file) uploadCompanyLogoFile(file)
|
||||
}
|
||||
|
||||
const isRowSelected = (id: string) => selectedRows.value.some((r) => r.id === id)
|
||||
|
||||
const toggleRowSelection = (row: any, checked: boolean) => {
|
||||
if (checked) {
|
||||
if (!isRowSelected(row.id)) selectedRows.value = [...selectedRows.value, row]
|
||||
return
|
||||
}
|
||||
selectedRows.value = selectedRows.value.filter((r) => r.id !== row.id)
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// 搜索 & 主表
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -463,6 +581,7 @@
|
||||
const editingId = ref<string | null>(null)
|
||||
const companyForm = reactive({
|
||||
companyName: '',
|
||||
companyLogo: '',
|
||||
companyAddress: '',
|
||||
contactName: '',
|
||||
contactPhone: '',
|
||||
@@ -512,6 +631,7 @@
|
||||
// ---------------------------------------------------------------------------
|
||||
const viewVisible = ref(false)
|
||||
const viewCompanyName = ref('')
|
||||
const viewCompanyLogo = ref('')
|
||||
const viewSections = ref<ViewSection[]>([])
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -528,6 +648,8 @@
|
||||
})
|
||||
tableData.value = (res as any)?.list || []
|
||||
pagination.total = (res as any)?.total ?? 0
|
||||
const validIds = new Set(tableData.value.map((r) => r.id))
|
||||
selectedRows.value = selectedRows.value.filter((r) => validIds.has(r.id))
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
@@ -545,15 +667,12 @@
|
||||
loadData()
|
||||
}
|
||||
|
||||
function handleSelectionChange(rows: any[]) {
|
||||
selectedRows.value = rows
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// 保险公司弹窗操作
|
||||
// ---------------------------------------------------------------------------
|
||||
function resetCompanyForm() {
|
||||
companyForm.companyName = ''
|
||||
companyForm.companyLogo = ''
|
||||
companyForm.companyAddress = ''
|
||||
companyForm.contactName = ''
|
||||
companyForm.contactPhone = ''
|
||||
@@ -578,6 +697,7 @@
|
||||
companyDialogTitle.value = '编辑保险公司'
|
||||
editingId.value = row.id
|
||||
companyForm.companyName = row.companyName || ''
|
||||
companyForm.companyLogo = row.companyLogo || ''
|
||||
companyForm.companyAddress = row.companyAddress || ''
|
||||
companyForm.contactName = row.contactName || ''
|
||||
companyForm.contactPhone = row.contactPhone || ''
|
||||
@@ -615,6 +735,7 @@
|
||||
try {
|
||||
const payload = {
|
||||
companyName: companyForm.companyName.trim(),
|
||||
companyLogo: companyForm.companyLogo?.trim() ?? '',
|
||||
companyAddress: companyForm.companyAddress?.trim() || undefined,
|
||||
contactName: companyForm.contactName?.trim() || undefined,
|
||||
contactPhone: companyForm.contactPhone?.trim() || undefined,
|
||||
@@ -693,6 +814,7 @@
|
||||
// ---------------------------------------------------------------------------
|
||||
async function handleView(row: any) {
|
||||
viewCompanyName.value = row.companyName || ''
|
||||
viewCompanyLogo.value = row.companyLogo || ''
|
||||
const sections: ViewSection[] = [
|
||||
{
|
||||
title: '基本信息',
|
||||
@@ -710,6 +832,27 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
if (row.companyLogo) {
|
||||
sections.push({
|
||||
title: '公司Logo',
|
||||
fields: [],
|
||||
slot: 'company-logo'
|
||||
})
|
||||
}
|
||||
const projectPrices = row.projectPrices || []
|
||||
if (projectPrices.length) {
|
||||
sections.push({
|
||||
title: '险种价格',
|
||||
fields: projectPrices.map((item: any) => ({
|
||||
label: item.projectName,
|
||||
value:
|
||||
(item.projectFee != null ? '¥' + formatMoneyDisplay(item.projectFee) : '—') +
|
||||
' · ' +
|
||||
(item.status == '1' ? '正常' : '停用'),
|
||||
tagType: item.status == '1' ? 'success' : 'info'
|
||||
}))
|
||||
})
|
||||
}
|
||||
// 加载开票信息
|
||||
try {
|
||||
const invRes = await fetchInsuranceCompanyInvoices(row.id)
|
||||
@@ -763,6 +906,7 @@
|
||||
currentCompanyId.value = ''
|
||||
currentCompanyName.value = ''
|
||||
itemTable.value = []
|
||||
loadData()
|
||||
}
|
||||
|
||||
function onItemSelectionChange(rows: any[]) {
|
||||
@@ -852,6 +996,275 @@
|
||||
}
|
||||
}
|
||||
|
||||
.company-logo-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.company-logo-preview {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--mint-border, #e2e8f0);
|
||||
}
|
||||
|
||||
.company-logo-placeholder {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 8px;
|
||||
border: 1px dashed var(--mint-border, #e2e8f0);
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
font-size: 12px;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.insurance-company-card-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
|
||||
gap: 16px;
|
||||
min-height: 120px;
|
||||
padding: 16px;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.insurance-company-card {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
min-height: 268px;
|
||||
background: #fff;
|
||||
border: 1px solid var(--mint-border, #e2e8f0);
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
|
||||
&:hover {
|
||||
border-color: #a8d4c4;
|
||||
box-shadow: 0 2px 12px rgba(4, 120, 87, 0.1);
|
||||
}
|
||||
|
||||
&.is-selected {
|
||||
border-color: var(--mint-primary, #10b981);
|
||||
box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25);
|
||||
}
|
||||
}
|
||||
|
||||
.insurance-company-card__select {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.insurance-company-card__header {
|
||||
display: flex;
|
||||
gap: 14px;
|
||||
min-height: 108px;
|
||||
box-sizing: border-box;
|
||||
padding: 16px 16px 12px 40px;
|
||||
background: #f8fafc;
|
||||
border-bottom: 1px solid var(--mint-border, #e2e8f0);
|
||||
}
|
||||
|
||||
.insurance-company-card__media {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.insurance-company-card__logo {
|
||||
display: block;
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid var(--mint-border, #e2e8f0);
|
||||
background: #fff;
|
||||
|
||||
:deep(.el-image__inner),
|
||||
:deep(img) {
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.insurance-company-card__logo-placeholder {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
border-radius: 10px;
|
||||
border: 1px dashed var(--mint-border, #e2e8f0);
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
font-size: 11px;
|
||||
background: #fff;
|
||||
|
||||
.el-icon {
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.insurance-company-card__summary {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.insurance-company-card__title-row {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.insurance-company-card__title {
|
||||
min-height: 42px;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: var(--mint-text, #0f172a);
|
||||
line-height: 1.4;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.insurance-company-card__address,
|
||||
.insurance-company-card__contact {
|
||||
min-height: 18px;
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.insurance-company-card__address {
|
||||
margin-bottom: 4px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.insurance-company-card__projects {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
min-height: 92px;
|
||||
padding: 12px 16px;
|
||||
}
|
||||
|
||||
.insurance-company-card__projects-head {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 20px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.insurance-company-card__projects-title {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--mint-text, #0f172a);
|
||||
}
|
||||
|
||||
.insurance-company-card__projects-count {
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
}
|
||||
|
||||
.insurance-company-card__project-body {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
min-height: 40px;
|
||||
}
|
||||
|
||||
.insurance-company-card__project-item {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) auto auto;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
gap: 8px;
|
||||
padding: 8px 10px;
|
||||
border-radius: 8px;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.insurance-company-card__project-name {
|
||||
font-size: 13px;
|
||||
color: var(--mint-text, #0f172a);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.insurance-company-card__project-fee {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: #047857;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.insurance-company-card__project-empty {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
}
|
||||
|
||||
.insurance-company-card__footer {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
height: 52px;
|
||||
box-sizing: border-box;
|
||||
padding: 10px 16px 14px;
|
||||
border-top: 1px solid var(--mint-border, #e2e8f0);
|
||||
}
|
||||
|
||||
.company-view-kv-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 12px 24px;
|
||||
}
|
||||
|
||||
.company-view-kv {
|
||||
dt {
|
||||
margin-bottom: 6px;
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
dd {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.company-view-logo {
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid var(--mint-border, #e2e8f0);
|
||||
}
|
||||
|
||||
.item-dialog-head {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -226,15 +226,25 @@
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
min-width="160"
|
||||
min-width="260"
|
||||
fixed="right"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-button class="btn-op-item" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<div class="table-op-btns">
|
||||
<el-button class="btn-op-item" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="canMarkFullyUsed(row)"
|
||||
class="btn-op-item"
|
||||
:loading="markFullyUsedLoadingId === row.id"
|
||||
@click="handleMarkFullyUsed(row)"
|
||||
>
|
||||
<el-icon><CircleCheck /></el-icon>标记已使用完
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -267,8 +277,9 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { Search, RefreshLeft, View, Document } from '@element-plus/icons-vue'
|
||||
import { fetchMaterialUsageList } from '@/api/material-usage'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Search, RefreshLeft, View, Document, CircleCheck } from '@element-plus/icons-vue'
|
||||
import { fetchMaterialUsageList, fetchMarkMaterialUsageFullyUsed } from '@/api/material-usage'
|
||||
import type { MaterialUsage } from '@/api/material-usage'
|
||||
import { fetchMaterialOptions } from '@/api/material'
|
||||
import type { MaterialOption } from '@/api/material'
|
||||
@@ -373,6 +384,32 @@
|
||||
return sourceType || '-'
|
||||
}
|
||||
|
||||
const markFullyUsedLoadingId = ref('')
|
||||
|
||||
function canMarkFullyUsed(row: MaterialUsage) {
|
||||
return isManualOutRow(row) && (row.requisitionStatus || 'open') !== 'closed'
|
||||
}
|
||||
|
||||
async function handleMarkFullyUsed(row: MaterialUsage) {
|
||||
try {
|
||||
await ElMessageBox.confirm('确认该领用记录已全部使用完?标记后将不再出现在盘点待登记列表。', '标记已使用完', {
|
||||
type: 'warning',
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消'
|
||||
})
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
markFullyUsedLoadingId.value = row.id
|
||||
try {
|
||||
await fetchMarkMaterialUsageFullyUsed(row.id)
|
||||
row.requisitionStatus = 'closed'
|
||||
ElMessage.success('已标记为使用完')
|
||||
} finally {
|
||||
markFullyUsedLoadingId.value = ''
|
||||
}
|
||||
}
|
||||
|
||||
async function loadMaterialOptions() {
|
||||
try {
|
||||
const res = await fetchMaterialOptions()
|
||||
@@ -516,3 +553,12 @@
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.table-op-btns {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -7,8 +7,24 @@
|
||||
<h2>市场物料库</h2>
|
||||
</div>
|
||||
|
||||
<el-tabs v-model="activeTab" class="panel-tabs">
|
||||
<el-tab-pane label="物料列表" name="list">
|
||||
<div class="panel-pill-tabs">
|
||||
<div class="panel-pill-tabs__track" role="tablist">
|
||||
<button
|
||||
v-for="tab in MATERIAL_TABS"
|
||||
:key="tab.name"
|
||||
type="button"
|
||||
role="tab"
|
||||
class="panel-pill-tabs__btn"
|
||||
:class="{ 'is-active': activeTab === tab.name }"
|
||||
:aria-selected="activeTab === tab.name"
|
||||
@click="handleTabChange(tab.name)"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-show="activeTab === 'list'" class="panel-track-pane">
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
@@ -1139,16 +1155,15 @@
|
||||
<p v-else class="view-empty-hint">暂无领用记录</p>
|
||||
</template>
|
||||
</SystemViewDialog>
|
||||
</el-tab-pane>
|
||||
</div>
|
||||
|
||||
<el-tab-pane label="变动记录" name="usage" lazy>
|
||||
<MaterialUsageTab />
|
||||
</el-tab-pane>
|
||||
<div v-show="activeTab === 'usage'" class="panel-track-pane">
|
||||
<MaterialUsageTab v-if="usageTabMounted" />
|
||||
</div>
|
||||
|
||||
<el-tab-pane label="库存盘点" name="stockCheck" lazy>
|
||||
<MaterialStockCheckTab />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div v-show="activeTab === 'stockCheck'" class="panel-track-pane">
|
||||
<MaterialStockCheckTab v-if="stockCheckTabMounted" />
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1196,7 +1211,26 @@
|
||||
defineOptions({ name: 'CellStorageMaterial' })
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const MATERIAL_TABS = [
|
||||
{ name: 'list', label: '物料列表' },
|
||||
{ name: 'usage', label: '变动记录' },
|
||||
{ name: 'stockCheck', label: '库存盘点' }
|
||||
] as const
|
||||
|
||||
const activeTab = ref('list')
|
||||
const usageTabMounted = ref(false)
|
||||
const stockCheckTabMounted = ref(false)
|
||||
|
||||
function ensureTabMounted(tab: string) {
|
||||
if (tab === 'usage') usageTabMounted.value = true
|
||||
if (tab === 'stockCheck') stockCheckTabMounted.value = true
|
||||
}
|
||||
|
||||
function handleTabChange(name: string) {
|
||||
activeTab.value = name
|
||||
ensureTabMounted(name)
|
||||
}
|
||||
const searchForm = reactive({ keyword: '', category: '', status: '' })
|
||||
const tableRef = ref()
|
||||
const tableData = ref<MaterialBatch[]>([])
|
||||
@@ -2278,8 +2312,9 @@
|
||||
|
||||
onMounted(() => {
|
||||
const tab = route.query.tab
|
||||
if (tab === 'usage') {
|
||||
activeTab.value = 'usage'
|
||||
if (tab === 'usage' || tab === 'stockCheck') {
|
||||
activeTab.value = tab as string
|
||||
ensureTabMounted(tab as string)
|
||||
}
|
||||
loadDictOptions()
|
||||
loadData()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="refund-confirm-tab">
|
||||
<el-tabs
|
||||
v-model="activeTab"
|
||||
class="work-order-type-tabs"
|
||||
class="panel-pill-tabs"
|
||||
@tab-change="handleStatusTabChange"
|
||||
>
|
||||
<el-tab-pane label="待确认" name="pending" />
|
||||
@@ -567,11 +567,6 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.work-order-type-tabs {
|
||||
padding: 0 16px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.filter-form :deep(.el-form-item) {
|
||||
margin-bottom: 0;
|
||||
min-width: 0;
|
||||
|
||||
@@ -35,14 +35,22 @@
|
||||
</div>
|
||||
|
||||
<div v-show="mainTab === 'payment'" class="panel-entity-body">
|
||||
<el-tabs
|
||||
v-model="activeTab"
|
||||
class="work-order-type-tabs"
|
||||
@tab-change="handleStatusTabChange"
|
||||
>
|
||||
<el-tab-pane label="待确认" name="pending" />
|
||||
<el-tab-pane label="已确认" name="confirmed" />
|
||||
</el-tabs>
|
||||
<div class="panel-pill-tabs">
|
||||
<div class="panel-pill-tabs__track" role="tablist">
|
||||
<button
|
||||
v-for="tab in CONFIRM_TABS"
|
||||
:key="tab.name"
|
||||
type="button"
|
||||
role="tab"
|
||||
class="panel-pill-tabs__btn"
|
||||
:class="{ 'is-active': activeTab === tab.name }"
|
||||
:aria-selected="activeTab === tab.name"
|
||||
@click="switchTab(tab.name)"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" label-position="top" @submit.prevent>
|
||||
@@ -440,6 +448,11 @@
|
||||
const searchForm = reactive({ keyword: '' })
|
||||
const installmentDueDateRange = ref<[string, string] | null>(getDefaultInstallmentDueDateRange())
|
||||
|
||||
const CONFIRM_TABS = [
|
||||
{ name: 'pending', label: '待确认' },
|
||||
{ name: 'confirmed', label: '已确认' }
|
||||
] as const
|
||||
|
||||
const activeTab = ref('pending')
|
||||
const tableData = ref<Record<string, unknown>[]>([])
|
||||
const loading = ref(false)
|
||||
@@ -520,6 +533,12 @@
|
||||
loadData()
|
||||
}
|
||||
|
||||
function switchTab(name: string) {
|
||||
if (activeTab.value === name) return
|
||||
activeTab.value = name
|
||||
handleStatusTabChange()
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
@@ -671,11 +690,6 @@
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.work-order-type-tabs {
|
||||
padding: 0 16px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.filter-form :deep(.el-form-item) {
|
||||
margin-bottom: 0;
|
||||
min-width: 0;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="payment-info-tab">
|
||||
<el-tabs
|
||||
v-model="activeTab"
|
||||
class="work-order-type-tabs"
|
||||
class="panel-pill-tabs"
|
||||
@tab-change="handleStatusTabChange"
|
||||
>
|
||||
<el-tab-pane label="待缴费" name="dfj" />
|
||||
@@ -726,11 +726,6 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.work-order-type-tabs {
|
||||
padding: 0 16px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.filter-form--inline-label :deep(.el-form-item) {
|
||||
margin-bottom: 0;
|
||||
min-width: 0;
|
||||
|
||||
@@ -22,11 +22,15 @@
|
||||
overflow: hidden;
|
||||
|
||||
#app-sidebar {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
flex-shrink: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#app-content {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -62,6 +62,18 @@
|
||||
>
|
||||
批量删除
|
||||
</el-button>
|
||||
<ArtExcelExport
|
||||
type="default"
|
||||
:data="batchExportData"
|
||||
:list-total="pagination.total"
|
||||
:load-all-data="loadAllAppointmentsForExport"
|
||||
:filename="appointmentExportFilename"
|
||||
sheet-name="展馆预约"
|
||||
:columns="appointmentExportColumns"
|
||||
auto-index
|
||||
>
|
||||
<el-icon><Download /></el-icon>导出 Excel
|
||||
</ArtExcelExport>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -249,9 +261,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Plus, Close, Check, View, Calendar, RefreshLeft, Search, More, Edit, Delete } from '@element-plus/icons-vue'
|
||||
import { Plus, Close, Check, View, Calendar, RefreshLeft, Search, More, Edit, Delete, Download } from '@element-plus/icons-vue'
|
||||
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
|
||||
import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
|
||||
import { fetchAllPagedRecords } from '@/utils/fetch-paged-list'
|
||||
import {
|
||||
fetchExhibitionAppointmentList,
|
||||
fetchCreateExhibitionAppointment,
|
||||
@@ -319,6 +332,47 @@
|
||||
selectedRows.value = rows
|
||||
}
|
||||
|
||||
const appointmentExportFilename = 'exhibition_appointment_export'
|
||||
|
||||
const appointmentExportColumns = {
|
||||
appointmentNo: { title: '预约编号' },
|
||||
visitOrg: { title: '来访单位' },
|
||||
contactName: { title: '联系人' },
|
||||
visitDate: { title: '到访日期' },
|
||||
visitorCount: { title: '人数' },
|
||||
remark: { title: '备注' },
|
||||
createTime: { title: '创建时间' }
|
||||
} as const
|
||||
|
||||
const mapAppointmentExportRow = (row: AppointmentRow) => ({
|
||||
appointmentNo: row.appointmentNo,
|
||||
visitOrg: row.visitOrg,
|
||||
contactName: row.contactName,
|
||||
visitDate: row.visitDate,
|
||||
visitorCount: row.visitorCount,
|
||||
remark: row.remark,
|
||||
createTime: row.createTime
|
||||
})
|
||||
|
||||
const batchExportData = computed(() => {
|
||||
const sel = selectedRows.value || []
|
||||
if (sel.length === 0) return []
|
||||
return sel.map(mapAppointmentExportRow)
|
||||
})
|
||||
|
||||
const loadAllAppointmentsForExport = async () => {
|
||||
const all = await fetchAllPagedRecords((page, pageSize) =>
|
||||
fetchExhibitionAppointmentList({
|
||||
page,
|
||||
pageSize,
|
||||
keyword: searchForm.keyword || undefined,
|
||||
visitDateStart: visitDateRange.value?.[0] || undefined,
|
||||
visitDateEnd: visitDateRange.value?.[1] || undefined
|
||||
})
|
||||
)
|
||||
return all.map((row) => mapAppointmentExportRow(row as AppointmentRow))
|
||||
}
|
||||
|
||||
const viewSections = computed(() => {
|
||||
if (!viewRow.value) return []
|
||||
const row = viewRow.value
|
||||
|
||||
@@ -1,7 +1,56 @@
|
||||
<!-- 细胞产品基础信息维护 · 价格体系 Tab -->
|
||||
<!-- eslint-disable vue/no-v-model-argument -->
|
||||
<template>
|
||||
<div class="cell-product-price-tab">
|
||||
<div :class="layout === 'kanban' ? 'kanban-col-body' : 'cell-product-price-tab'">
|
||||
<template v-if="layout === 'kanban'">
|
||||
<div class="kanban-col-search">
|
||||
<el-input v-model="searchForm.keyword" placeholder="项目名称/编码" clearable />
|
||||
</div>
|
||||
<div class="kanban-list" v-loading="loading">
|
||||
<article
|
||||
v-for="row in tableData"
|
||||
:key="row.id"
|
||||
class="entity-card"
|
||||
@dblclick="handleView(row)"
|
||||
>
|
||||
<div class="entity-card-del" @click.stop>
|
||||
<el-button class="btn-op-item" title="删除" @click="handleDelete(row)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="entity-card-body">
|
||||
<h3 class="entity-card-title">{{ row.projectName }}</h3>
|
||||
<div class="entity-card-meta">{{ row.projectCode }}</div>
|
||||
<div v-if="row.cellTypeName || row.specText" class="entity-card-tags">
|
||||
<span v-if="row.cellTypeName" class="tag success">{{ row.cellTypeName }}</span>
|
||||
<span v-if="row.specText" class="tag muted">{{ row.specText }}</span>
|
||||
</div>
|
||||
<div class="entity-card-ft" @click.stop>
|
||||
<span
|
||||
class="entity-card-ft-val"
|
||||
:class="{ 'entity-card-ft-val--muted': row.unitPrice == null }"
|
||||
>
|
||||
{{ row.unitPrice != null ? `${formatMoneyDisplay(row.unitPrice)} 元` : '未定价' }}
|
||||
</span>
|
||||
<div class="entity-card-ft-actions">
|
||||
<el-button class="btn-op-item" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-button class="btn-op-item" @click="handleEdit(row)">
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
<div v-if="!loading && !tableData.length" class="kanban-empty">
|
||||
<span>暂无价格数据</span>
|
||||
<span class="kanban-empty__hint">点击列头「新增」添加产品价格</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
@@ -127,10 +176,7 @@
|
||||
<el-button class="btn-op-item primary" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-dropdown
|
||||
trigger="hover"
|
||||
@command="(cmd) => handleDropdownCommand(cmd, row)"
|
||||
>
|
||||
<el-dropdown trigger="hover" @command="(cmd) => handleDropdownCommand(cmd, row)">
|
||||
<el-button class="btn-op-item">
|
||||
<el-icon><More /></el-icon>
|
||||
</el-button>
|
||||
@@ -161,92 +207,93 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogTitle"
|
||||
width="560px"
|
||||
class="dialog-form-layout"
|
||||
align-center
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogTitle"
|
||||
width="560px"
|
||||
class="dialog-form-layout"
|
||||
align-center
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-position="top"
|
||||
class="price-dialog-form"
|
||||
scroll-to-error
|
||||
:scroll-into-view-options="{ behavior: 'smooth', block: 'center' }"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-position="top"
|
||||
class="price-dialog-form"
|
||||
scroll-to-error
|
||||
:scroll-into-view-options="{ behavior: 'smooth', block: 'center' }"
|
||||
>
|
||||
<div class="form-grid-2">
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input v-model="formData.projectName" placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目编码" prop="projectCode">
|
||||
<el-input v-model="formData.projectCode" placeholder="请输入项目编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="细胞产品类型" prop="cellProductTypeId">
|
||||
<el-select
|
||||
v-model="formData.cellProductTypeId"
|
||||
placeholder="请选择细胞产品类型"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@change="handleTypeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in typeOptions"
|
||||
:key="item.id"
|
||||
:label="item.productTypeName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格" prop="specId">
|
||||
<el-select
|
||||
v-model="formData.specId"
|
||||
placeholder="请选择规格"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@change="handleSpecChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in specOptions"
|
||||
:key="item.id"
|
||||
:label="item.specName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单价(元)" prop="unitPrice">
|
||||
<AmountInput v-model="formData.unitPrice" :min="0" placeholder="请输入单价" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="formData.remark" type="textarea" :rows="3" placeholder="可选" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button class="btn-ghost" @click="dialogVisible = false">
|
||||
<el-icon><Close /></el-icon>
|
||||
取消
|
||||
</el-button>
|
||||
<el-button class="btn-main" type="primary" @click="handleSubmit" :loading="submitLoading">
|
||||
<el-icon><Check /></el-icon>
|
||||
确定
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<div class="form-grid-2">
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input v-model="formData.projectName" placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目编码" prop="projectCode">
|
||||
<el-input v-model="formData.projectCode" placeholder="请输入项目编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="细胞产品类型" prop="cellProductTypeId">
|
||||
<el-select
|
||||
v-model="formData.cellProductTypeId"
|
||||
placeholder="请选择细胞产品类型"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@change="handleTypeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in typeOptions"
|
||||
:key="item.id"
|
||||
:label="item.productTypeName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格" prop="specId">
|
||||
<el-select
|
||||
v-model="formData.specId"
|
||||
placeholder="请选择规格"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@change="handleSpecChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in specOptions"
|
||||
:key="item.id"
|
||||
:label="item.specName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单价(元)" prop="unitPrice">
|
||||
<AmountInput v-model="formData.unitPrice" :min="0" placeholder="请输入单价" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="formData.remark" type="textarea" :rows="3" placeholder="可选" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button class="btn-ghost" @click="dialogVisible = false">
|
||||
<el-icon><Close /></el-icon>
|
||||
取消
|
||||
</el-button>
|
||||
<el-button class="btn-main" type="primary" @click="handleSubmit" :loading="submitLoading">
|
||||
<el-icon><Check /></el-icon>
|
||||
确定
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<SystemViewDialog
|
||||
v-model:visible="viewVisible"
|
||||
:title="viewRow?.projectName || '价格详情'"
|
||||
:icon="ScaleToOriginal"
|
||||
:code="viewRow?.projectCode"
|
||||
code-label="项目编码"
|
||||
:sections="viewSections"
|
||||
/>
|
||||
<SystemViewDialog
|
||||
v-model:visible="viewVisible"
|
||||
:title="viewRow?.projectName || '价格详情'"
|
||||
:icon="ScaleToOriginal"
|
||||
:code="viewRow?.projectCode"
|
||||
code-label="项目编码"
|
||||
:sections="viewSections"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -280,6 +327,11 @@
|
||||
|
||||
defineOptions({ name: 'CellProductPriceTab' })
|
||||
|
||||
const props = withDefaults(defineProps<{ layout?: 'table' | 'kanban' }>(), { layout: 'table' })
|
||||
const emit = defineEmits<{ (e: 'meta-change', payload: { total: number }): void }>()
|
||||
|
||||
const KANBAN_PAGE_SIZE = 100
|
||||
|
||||
// --- Search ---
|
||||
const searchForm = reactive<{ keyword: string }>({ keyword: '' })
|
||||
|
||||
@@ -371,6 +423,7 @@
|
||||
})
|
||||
tableData.value = (res as any)?.list || []
|
||||
pagination.total = (res as any)?.total ?? 0
|
||||
emit('meta-change', { total: pagination.total })
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
@@ -533,12 +586,38 @@
|
||||
{ debounce: 300, deep: true }
|
||||
)
|
||||
|
||||
defineExpose({ handleAdd, loadData })
|
||||
|
||||
onMounted(() => {
|
||||
if (props.layout === 'kanban') {
|
||||
pagination.pageSize = KANBAN_PAGE_SIZE
|
||||
}
|
||||
loadData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.kanban-col-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.kanban-col-search {
|
||||
padding: 8px 10px 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.kanban-list {
|
||||
padding: 10px;
|
||||
overflow-y: auto;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
@import './cell-product-kanban.scss';
|
||||
|
||||
.price-dialog-form {
|
||||
:deep(.el-form-item) {
|
||||
margin-bottom: 0;
|
||||
|
||||
@@ -1,7 +1,49 @@
|
||||
<!-- 细胞产品基础信息维护 · 规格 Tab -->
|
||||
<!-- eslint-disable vue/no-v-model-argument -->
|
||||
<template>
|
||||
<div class="cell-product-spec-tab">
|
||||
<div :class="layout === 'kanban' ? 'kanban-col-body' : 'cell-product-spec-tab'">
|
||||
<template v-if="layout === 'kanban'">
|
||||
<div class="kanban-col-search">
|
||||
<el-input v-model="searchForm.keyword" placeholder="规格编码/名称" clearable />
|
||||
</div>
|
||||
<div class="kanban-list" v-loading="loading">
|
||||
<article
|
||||
v-for="row in tableData"
|
||||
:key="row.id"
|
||||
class="entity-card"
|
||||
@dblclick="handleView(row)"
|
||||
>
|
||||
<div class="entity-card-del" @click.stop>
|
||||
<el-button class="btn-op-item" title="删除" @click="handleDelete(row)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="entity-card-body">
|
||||
<h3 class="entity-card-title">{{ row.specName }}</h3>
|
||||
<div class="entity-card-meta">{{ row.specCode }}</div>
|
||||
<div v-if="row.remark" class="entity-card-tags">
|
||||
<span class="tag muted">{{ row.remark }}</span>
|
||||
</div>
|
||||
<div class="entity-card-ft" @click.stop>
|
||||
<div class="entity-card-ft-actions">
|
||||
<el-button class="btn-op-item" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-button class="btn-op-item" @click="handleEdit(row)">
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
<div v-if="!loading && !tableData.length" class="kanban-empty">
|
||||
<span>暂无规格数据</span>
|
||||
<span class="kanban-empty__hint">点击列头「新增」添加产品规格</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
@@ -102,7 +144,10 @@
|
||||
<el-button class="btn-op-item" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-dropdown trigger="hover" @command="(cmd: string) => handleDropdownCommand(cmd, row)">
|
||||
<el-dropdown
|
||||
trigger="hover"
|
||||
@command="(cmd: string) => handleDropdownCommand(cmd, row)"
|
||||
>
|
||||
<el-button class="btn-op-item">
|
||||
<el-icon><More /></el-icon>
|
||||
</el-button>
|
||||
@@ -133,57 +178,58 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogTitle"
|
||||
width="560px"
|
||||
class="dialog-form-layout"
|
||||
align-center
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogTitle"
|
||||
width="560px"
|
||||
class="dialog-form-layout"
|
||||
align-center
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-position="top"
|
||||
class="spec-dialog-form"
|
||||
scroll-to-error
|
||||
:scroll-into-view-options="{ behavior: 'smooth', block: 'center' }"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-position="top"
|
||||
class="spec-dialog-form"
|
||||
scroll-to-error
|
||||
:scroll-into-view-options="{ behavior: 'smooth', block: 'center' }"
|
||||
>
|
||||
<div class="form-grid-2">
|
||||
<el-form-item label="规格编码" prop="specCode">
|
||||
<el-input v-model="formData.specCode" placeholder="请输入规格编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规格名称" prop="specName">
|
||||
<el-input v-model="formData.specName" placeholder="请输入规格名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="formData.remark" placeholder="可选" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button class="btn-ghost" @click="dialogVisible = false">
|
||||
<el-icon><Close /></el-icon>
|
||||
取消
|
||||
</el-button>
|
||||
<el-button class="btn-main" type="primary" @click="handleSubmit" :loading="submitLoading">
|
||||
<el-icon><Check /></el-icon>
|
||||
确定
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<div class="form-grid-2">
|
||||
<el-form-item label="规格编码" prop="specCode">
|
||||
<el-input v-model="formData.specCode" placeholder="请输入规格编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规格名称" prop="specName">
|
||||
<el-input v-model="formData.specName" placeholder="请输入规格名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="formData.remark" placeholder="可选" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button class="btn-ghost" @click="dialogVisible = false">
|
||||
<el-icon><Close /></el-icon>
|
||||
取消
|
||||
</el-button>
|
||||
<el-button class="btn-main" type="primary" @click="handleSubmit" :loading="submitLoading">
|
||||
<el-icon><Check /></el-icon>
|
||||
确定
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<SystemViewDialog
|
||||
v-model:visible="viewVisible"
|
||||
:title="viewRow?.specName || '规格详情'"
|
||||
:icon="ScaleToOriginal"
|
||||
:code="viewRow?.specCode"
|
||||
code-label="规格编码"
|
||||
:sections="viewSections"
|
||||
/>
|
||||
<SystemViewDialog
|
||||
v-model:visible="viewVisible"
|
||||
:title="viewRow?.specName || '规格详情'"
|
||||
:icon="ScaleToOriginal"
|
||||
:code="viewRow?.specCode"
|
||||
code-label="规格编码"
|
||||
:sections="viewSections"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -213,6 +259,11 @@
|
||||
|
||||
defineOptions({ name: 'CellProductSpecTab' })
|
||||
|
||||
const props = withDefaults(defineProps<{ layout?: 'table' | 'kanban' }>(), { layout: 'table' })
|
||||
const emit = defineEmits<{ (e: 'meta-change', payload: { total: number }): void }>()
|
||||
|
||||
const KANBAN_PAGE_SIZE = 100
|
||||
|
||||
const searchForm = reactive<{ keyword: string }>({ keyword: '' })
|
||||
const tableData = ref<Api.CellProductSpec.CellProductSpecItem[]>([])
|
||||
const selectedRows = ref<Api.CellProductSpec.CellProductSpecItem[]>([])
|
||||
@@ -267,6 +318,7 @@
|
||||
})
|
||||
tableData.value = res.list || []
|
||||
pagination.total = res.total ?? 0
|
||||
emit('meta-change', { total: pagination.total })
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
@@ -381,12 +433,38 @@
|
||||
{ debounce: 300, deep: true }
|
||||
)
|
||||
|
||||
defineExpose({ handleAdd, loadData })
|
||||
|
||||
onMounted(() => {
|
||||
if (props.layout === 'kanban') {
|
||||
pagination.pageSize = KANBAN_PAGE_SIZE
|
||||
}
|
||||
loadData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.kanban-col-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.kanban-col-search {
|
||||
padding: 8px 10px 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.kanban-list {
|
||||
padding: 10px;
|
||||
overflow-y: auto;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
@import './cell-product-kanban.scss';
|
||||
|
||||
.spec-dialog-form {
|
||||
:deep(.el-form-item) {
|
||||
margin-bottom: 0;
|
||||
|
||||
@@ -0,0 +1,210 @@
|
||||
// 细胞产品看板 · P02 entity-card 风格(无封面图则不展示 cover 区)
|
||||
|
||||
.kanban-list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 10px;
|
||||
align-content: start;
|
||||
}
|
||||
|
||||
.entity-card {
|
||||
position: relative;
|
||||
border: 1px solid var(--mint-border, #d9e8e2);
|
||||
border-radius: 10px;
|
||||
background: var(--surface, #fff);
|
||||
overflow: visible;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
align-self: start;
|
||||
transition:
|
||||
border-color 0.15s ease,
|
||||
box-shadow 0.15s ease;
|
||||
|
||||
&:hover {
|
||||
border-color: rgb(16 185 129 / 45%);
|
||||
box-shadow: 0 4px 12px rgb(16 185 129 / 8%);
|
||||
}
|
||||
}
|
||||
|
||||
.entity-card-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
padding: 12px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.entity-card-title {
|
||||
margin: 0 0 6px;
|
||||
padding-right: 32px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
line-height: 1.4;
|
||||
color: var(--mint-text, #1e293b);
|
||||
word-break: break-word;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.entity-card-meta {
|
||||
font-size: 11px;
|
||||
line-height: 1.45;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
margin-bottom: 8px;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.entity-card-tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 4px;
|
||||
margin-bottom: 8px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.entity-card-tags .tag {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 2px 6px;
|
||||
border-radius: 6px;
|
||||
font-size: 10px;
|
||||
font-weight: 500;
|
||||
line-height: 1.4;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.entity-card-tags .tag.success {
|
||||
background: var(--primary-bg, #ecfdf5);
|
||||
color: var(--primary-dark, #059669);
|
||||
}
|
||||
|
||||
.entity-card-tags .tag.muted {
|
||||
background: var(--table-head, #f8fafc);
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
.entity-card-tags .tag.warning {
|
||||
background: #fffbeb;
|
||||
color: #d97706;
|
||||
}
|
||||
|
||||
.entity-card-del {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 8px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.entity-card .entity-card-del :deep(.btn-op-item.el-button) {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
padding: 0;
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
color: #94a3b8;
|
||||
border: none;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.entity-card .entity-card-del :deep(.btn-op-item.el-button:hover) {
|
||||
color: #dc2626;
|
||||
border: none;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.entity-card .entity-card-del :deep(.btn-op-item.el-button > span) {
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
.entity-card-ft {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 8px;
|
||||
margin-top: auto;
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid var(--mint-border, #d9e8e2);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.entity-card-ft-val {
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: var(--primary-dark, #059669);
|
||||
line-height: 1.2;
|
||||
|
||||
&--muted {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
}
|
||||
}
|
||||
|
||||
.entity-card-ft-actions {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 4px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.entity-card-ft-actions :deep(.btn-op-item.el-button) {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
height: 28px;
|
||||
padding: 0 4px;
|
||||
font-size: 11px;
|
||||
margin: 0;
|
||||
color: var(--mint-text, #1e293b);
|
||||
border-color: var(--mint-border, #d9e8e2);
|
||||
background: var(--mint-surface, #fff);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.entity-card-ft-actions :deep(.btn-op-item.el-button .el-icon) {
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
.entity-card-ft-actions :deep(.btn-op-item.el-button:hover),
|
||||
.entity-card-ft-actions :deep(.btn-op-item.el-button:focus-visible) {
|
||||
color: var(--mint-text, #1e293b);
|
||||
border-color: #cbd5e1;
|
||||
background: var(--table-head, #f8fafc);
|
||||
}
|
||||
|
||||
.entity-card-ft-actions :deep(.btn-op-item.el-button:hover .el-icon),
|
||||
.entity-card-ft-actions :deep(.btn-op-item.el-button:focus-visible .el-icon) {
|
||||
color: var(--mint-text, #1e293b);
|
||||
}
|
||||
|
||||
.entity-card-ft-actions :deep(.btn-op-item.el-button > span) {
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
.kanban-empty {
|
||||
grid-column: 1 / -1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
padding: 32px 16px;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
border: 1px dashed var(--mint-border, #d9e8e2);
|
||||
border-radius: 10px;
|
||||
background: rgb(255 255 255 / 60%);
|
||||
}
|
||||
|
||||
.kanban-empty__hint {
|
||||
font-size: 11px;
|
||||
color: #94a3b8;
|
||||
}
|
||||
@@ -1,152 +1,143 @@
|
||||
<!-- 细胞产品类型管理 -->
|
||||
<!-- 细胞产品基础信息维护 · 看板模式 P04 -->
|
||||
<!-- eslint-disable vue/no-v-model-argument -->
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<div class="page-container cell-product-kanban-page">
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2>细胞产品基础信息维护</h2>
|
||||
<h2 class="title-bar-heading">细胞产品基础信息维护</h2>
|
||||
</div>
|
||||
|
||||
<el-tabs v-model="activeTab" class="panel-tabs">
|
||||
<el-tab-pane label="细胞产品类型" name="type">
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
<el-form-item label="关键词">
|
||||
<el-input v-model="searchForm.keyword" placeholder="类型编码/名称" clearable />
|
||||
</el-form-item>
|
||||
<section class="cell-product-stats">
|
||||
<div class="stat-card">
|
||||
<div class="stat-icon">
|
||||
<img src="/money.png" alt="" />
|
||||
</div>
|
||||
<div class="filter-actions-row">
|
||||
<span class="filter-hint">按编码、名称模糊查询。</span>
|
||||
<div class="filter-actions-end">
|
||||
<el-button class="btn-ghost" @click="handleReset"
|
||||
><el-icon><RefreshLeft /></el-icon>重置</el-button
|
||||
>
|
||||
<el-button class="btn-main" type="primary" @click="handleSearch"
|
||||
><el-icon><Search /></el-icon>搜索</el-button
|
||||
>
|
||||
<div class="stat-main">
|
||||
<div class="stat-k">产品价格</div>
|
||||
<div class="stat-v">{{ priceTotal }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-icon">
|
||||
<img src="/lx.png" alt="" />
|
||||
</div>
|
||||
<div class="stat-main">
|
||||
<div class="stat-k">产品类型</div>
|
||||
<div class="stat-v">{{ typeTotal }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-icon">
|
||||
<img src="/gg.png" alt="" />
|
||||
</div>
|
||||
<div class="stat-main">
|
||||
<div class="stat-k">产品规格</div>
|
||||
<div class="stat-v">{{ specTotal }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="kanban">
|
||||
<!-- 列 1:产品价格 -->
|
||||
<div class="kanban-col">
|
||||
<div class="kanban-col-hd">
|
||||
<span class="kanban-col-title">
|
||||
细胞产品价格
|
||||
<span class="kanban-count">{{ priceTotal }}</span>
|
||||
</span>
|
||||
<el-button
|
||||
class="btn-main kanban-add-btn"
|
||||
type="primary"
|
||||
@click="priceTabRef?.handleAdd()"
|
||||
>
|
||||
<el-icon><Plus /></el-icon>
|
||||
新增
|
||||
</el-button>
|
||||
</div>
|
||||
<CellProductPriceTab ref="priceTabRef" layout="kanban" @meta-change="onPriceMetaChange" />
|
||||
</div>
|
||||
|
||||
<!-- 列 2:产品类型 -->
|
||||
<div class="kanban-col">
|
||||
<div class="kanban-col-hd">
|
||||
<span class="kanban-col-title">
|
||||
细胞产品类型
|
||||
<span class="kanban-count">{{ typeTotal }}</span>
|
||||
</span>
|
||||
<el-button class="btn-main kanban-add-btn" type="primary" @click="handleTypeAdd">
|
||||
<el-icon><Plus /></el-icon>
|
||||
新增
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="kanban-col-search">
|
||||
<el-input
|
||||
v-model="typeSearchForm.keyword"
|
||||
placeholder="类型编码/名称"
|
||||
clearable
|
||||
@keyup.enter="handleTypeSearch"
|
||||
/>
|
||||
</div>
|
||||
<div class="kanban-list" v-loading="typeLoading">
|
||||
<article
|
||||
v-for="row in typeTableData"
|
||||
:key="row.id"
|
||||
class="entity-card"
|
||||
@dblclick="handleTypeView(row)"
|
||||
>
|
||||
<div class="entity-card-del" @click.stop>
|
||||
<el-button class="btn-op-item" title="删除" @click="handleTypeDelete(row)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="entity-card-body">
|
||||
<h3 class="entity-card-title">{{ row.productTypeName }}</h3>
|
||||
<div class="entity-card-meta">{{ row.productTypeCode }}</div>
|
||||
<div v-if="row.remark" class="entity-card-tags">
|
||||
<span class="tag muted">{{ row.remark }}</span>
|
||||
</div>
|
||||
<div class="entity-card-ft" @click.stop>
|
||||
<div class="entity-card-ft-actions">
|
||||
<el-button class="btn-op-item" @click="handleTypeView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-button class="btn-op-item" @click="handleTypeEdit(row)">
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
<div v-if="!typeLoading && !typeTableData.length" class="kanban-empty">
|
||||
<span>暂无类型数据</span>
|
||||
<span class="kanban-empty__hint">点击右上角「新增」添加产品类型</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list-toolbar">
|
||||
<div class="list-toolbar-row">
|
||||
<div class="list-toolbar-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
<!-- 列 3:产品规格 -->
|
||||
<div class="kanban-col">
|
||||
<div class="kanban-col-hd">
|
||||
<span class="kanban-col-title">
|
||||
细胞产品规格
|
||||
<span class="kanban-count">{{ specTotal }}</span>
|
||||
</span>
|
||||
<el-button
|
||||
class="btn-main kanban-add-btn"
|
||||
type="primary"
|
||||
@click="specTabRef?.handleAdd()"
|
||||
>
|
||||
<el-icon><Plus /></el-icon>
|
||||
新增
|
||||
</el-button>
|
||||
</div>
|
||||
<el-button class="btn-main" type="primary" @click="handleAdd">
|
||||
<el-icon><Plus /></el-icon>
|
||||
新增类型
|
||||
</el-button>
|
||||
<el-button
|
||||
class="btn-ghost"
|
||||
type="danger"
|
||||
:disabled="selectedRows.length === 0"
|
||||
@click="handleBatchDelete"
|
||||
>
|
||||
批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<el-table
|
||||
class="list-table"
|
||||
:data="tableData"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
@row-dblclick="handleView"
|
||||
>
|
||||
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
min-width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
:index="(index) => (pagination.page - 1) * pagination.pageSize + index + 1"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="productTypeCode"
|
||||
label="类型编码"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="productTypeName"
|
||||
label="类型名称"
|
||||
min-width="150"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
label="备注"
|
||||
min-width="150"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
label="创建时间"
|
||||
min-width="180"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
min-width="160"
|
||||
fixed="right"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<div style="display: flex; justify-content: center; gap: 8px">
|
||||
<el-button class="btn-op-item primary" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-dropdown
|
||||
trigger="hover"
|
||||
@command="(cmd) => handleDropdownCommand(cmd, row)"
|
||||
>
|
||||
<el-button class="btn-op-item">
|
||||
<el-icon><More /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="edit">
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="delete" divided>
|
||||
<el-icon><Delete /></el-icon>删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination list-pager-bar">
|
||||
<el-pagination
|
||||
:current-page="pagination.page"
|
||||
:page-size="pagination.pageSize"
|
||||
:total="pagination.total"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="(val) => ((pagination.page = 1), (pagination.pageSize = val), loadData())"
|
||||
@current-change="(val) => ((pagination.page = val), loadData())"
|
||||
/>
|
||||
<CellProductSpecTab ref="specTabRef" layout="kanban" @meta-change="onSpecMetaChange" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 类型弹窗 -->
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogTitle"
|
||||
v-model="typeDialogVisible"
|
||||
:title="typeDialogTitle"
|
||||
width="560px"
|
||||
class="dialog-form-layout"
|
||||
align-center
|
||||
@@ -154,9 +145,9 @@
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
ref="typeFormRef"
|
||||
:model="typeFormData"
|
||||
:rules="typeFormRules"
|
||||
label-position="top"
|
||||
class="type-dialog-form"
|
||||
scroll-to-error
|
||||
@@ -164,22 +155,27 @@
|
||||
>
|
||||
<div class="form-grid-2">
|
||||
<el-form-item label="类型编码" prop="productTypeCode">
|
||||
<el-input v-model="formData.productTypeCode" placeholder="请输入类型编码" />
|
||||
<el-input v-model="typeFormData.productTypeCode" placeholder="请输入类型编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型名称" prop="productTypeName">
|
||||
<el-input v-model="formData.productTypeName" placeholder="请输入类型名称" />
|
||||
<el-input v-model="typeFormData.productTypeName" placeholder="请输入类型名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="formData.remark" placeholder="可选" />
|
||||
<el-input v-model="typeFormData.remark" placeholder="可选" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button class="btn-ghost" @click="dialogVisible = false">
|
||||
<el-button class="btn-ghost" @click="typeDialogVisible = false">
|
||||
<el-icon><Close /></el-icon>
|
||||
取消
|
||||
</el-button>
|
||||
<el-button class="btn-main" type="primary" @click="handleSubmit" :loading="submitLoading">
|
||||
<el-button
|
||||
class="btn-main"
|
||||
type="primary"
|
||||
@click="handleTypeSubmit"
|
||||
:loading="typeSubmitLoading"
|
||||
>
|
||||
<el-icon><Check /></el-icon>
|
||||
确定
|
||||
</el-button>
|
||||
@@ -187,27 +183,13 @@
|
||||
</el-dialog>
|
||||
|
||||
<SystemViewDialog
|
||||
v-model:visible="viewVisible"
|
||||
:title="viewRow?.productTypeName || '类型详情'"
|
||||
:icon="ScaleToOriginal"
|
||||
:code="viewRow?.productTypeCode"
|
||||
v-model:visible="typeViewVisible"
|
||||
:title="typeViewRow?.productTypeName || '类型详情'"
|
||||
:icon="Grid"
|
||||
:code="typeViewRow?.productTypeCode"
|
||||
code-label="类型编码"
|
||||
:sections="viewSections"
|
||||
:sections="typeViewSections"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="细胞产品规格" name="spec" lazy>
|
||||
<CellProductSpecTab />
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="价格体系" name="price" lazy>
|
||||
<CellProductPriceTab />
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="项目价格" name="project-price" lazy>
|
||||
<ProjectPriceSystemTab />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -215,18 +197,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, computed } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import {
|
||||
Plus,
|
||||
Close,
|
||||
Check,
|
||||
View,
|
||||
Edit,
|
||||
Delete,
|
||||
More,
|
||||
ScaleToOriginal,
|
||||
RefreshLeft,
|
||||
Search
|
||||
} from '@element-plus/icons-vue'
|
||||
import { Plus, Close, Check, View, Edit, Delete, Grid } from '@element-plus/icons-vue'
|
||||
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
|
||||
import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
|
||||
import {
|
||||
@@ -237,44 +208,44 @@
|
||||
} from '@/api/admin'
|
||||
import CellProductSpecTab from './CellProductSpecTab.vue'
|
||||
import CellProductPriceTab from './CellProductPriceTab.vue'
|
||||
import ProjectPriceSystemTab from './ProjectPriceSystemTab.vue'
|
||||
|
||||
defineOptions({ name: 'PilotCellProductType' })
|
||||
|
||||
const route = useRoute()
|
||||
const activeTab = ref('type')
|
||||
const searchForm = reactive<{ keyword: string }>({ keyword: '' })
|
||||
const tableData = ref<Api.CellProductType.CellProductTypeItem[]>([])
|
||||
const selectedRows = ref<Api.CellProductType.CellProductTypeItem[]>([])
|
||||
const loading = ref(false)
|
||||
const pagination = reactive({ page: 1, pageSize: 10, total: 0 })
|
||||
const dialogVisible = ref(false)
|
||||
const dialogTitle = ref('新增类型')
|
||||
const isEdit = ref(false)
|
||||
const submitLoading = ref(false)
|
||||
const formRef = ref()
|
||||
const editingId = ref<string | null>(null)
|
||||
const viewVisible = ref(false)
|
||||
const viewRow = ref<Api.CellProductType.CellProductTypeItem | null>(null)
|
||||
const KANBAN_PAGE_SIZE = 100
|
||||
|
||||
const formData = reactive({
|
||||
const specTabRef = ref<InstanceType<typeof CellProductSpecTab> | null>(null)
|
||||
const priceTabRef = ref<InstanceType<typeof CellProductPriceTab> | null>(null)
|
||||
|
||||
const specTotal = ref(0)
|
||||
const priceTotal = ref(0)
|
||||
|
||||
const typeSearchForm = reactive<{ keyword: string }>({ keyword: '' })
|
||||
const typeTableData = ref<Api.CellProductType.CellProductTypeItem[]>([])
|
||||
const typeLoading = ref(false)
|
||||
const typeTotal = ref(0)
|
||||
const typeDialogVisible = ref(false)
|
||||
const typeDialogTitle = ref('新增类型')
|
||||
const typeIsEdit = ref(false)
|
||||
const typeSubmitLoading = ref(false)
|
||||
const typeFormRef = ref()
|
||||
const typeEditingId = ref<string | null>(null)
|
||||
const typeViewVisible = ref(false)
|
||||
const typeViewRow = ref<Api.CellProductType.CellProductTypeItem | null>(null)
|
||||
|
||||
const typeFormData = reactive({
|
||||
productTypeCode: '',
|
||||
productTypeName: '',
|
||||
remark: ''
|
||||
})
|
||||
|
||||
const formRules = {
|
||||
const typeFormRules = {
|
||||
productTypeCode: [{ required: true, message: '请输入类型编码', trigger: 'blur' }],
|
||||
productTypeName: [{ required: true, message: '请输入类型名称', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
const handleSelectionChange = (rows: Api.CellProductType.CellProductTypeItem[]) => {
|
||||
selectedRows.value = rows
|
||||
}
|
||||
|
||||
const viewSections = computed(() => {
|
||||
if (!viewRow.value) return []
|
||||
const row = viewRow.value
|
||||
const typeViewSections = computed(() => {
|
||||
if (!typeViewRow.value) return []
|
||||
const row = typeViewRow.value
|
||||
return [
|
||||
{
|
||||
title: '基本信息',
|
||||
@@ -287,93 +258,90 @@
|
||||
]
|
||||
})
|
||||
|
||||
async function loadData() {
|
||||
loading.value = true
|
||||
function onSpecMetaChange(payload: { total: number }) {
|
||||
specTotal.value = payload.total
|
||||
}
|
||||
|
||||
function onPriceMetaChange(payload: { total: number }) {
|
||||
priceTotal.value = payload.total
|
||||
}
|
||||
|
||||
async function loadTypeData() {
|
||||
typeLoading.value = true
|
||||
try {
|
||||
const res = await fetchCellProductTypeList({
|
||||
page: pagination.page,
|
||||
pageSize: pagination.pageSize,
|
||||
keyword: searchForm.keyword || undefined
|
||||
page: 1,
|
||||
pageSize: KANBAN_PAGE_SIZE,
|
||||
keyword: typeSearchForm.keyword || undefined
|
||||
})
|
||||
tableData.value = res.list || []
|
||||
pagination.total = res.total ?? 0
|
||||
typeTableData.value = res.list || []
|
||||
typeTotal.value = res.total ?? 0
|
||||
} finally {
|
||||
loading.value = false
|
||||
typeLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
function handleTypeSearch() {
|
||||
loadTypeData()
|
||||
}
|
||||
|
||||
function handleReset() {
|
||||
searchForm.keyword = ''
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
function resetTypeForm() {
|
||||
typeFormData.productTypeCode = ''
|
||||
typeFormData.productTypeName = ''
|
||||
typeFormData.remark = ''
|
||||
typeEditingId.value = null
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
formData.productTypeCode = ''
|
||||
formData.productTypeName = ''
|
||||
formData.remark = ''
|
||||
editingId.value = null
|
||||
function handleTypeAdd() {
|
||||
typeIsEdit.value = false
|
||||
typeDialogTitle.value = '新增类型'
|
||||
resetTypeForm()
|
||||
typeDialogVisible.value = true
|
||||
typeFormRef.value?.clearValidate?.()
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
isEdit.value = false
|
||||
dialogTitle.value = '新增类型'
|
||||
resetForm()
|
||||
dialogVisible.value = true
|
||||
formRef.value?.clearValidate?.()
|
||||
function handleTypeEdit(row: Api.CellProductType.CellProductTypeItem) {
|
||||
typeIsEdit.value = true
|
||||
typeDialogTitle.value = '编辑类型'
|
||||
typeEditingId.value = row.id
|
||||
typeFormData.productTypeCode = row.productTypeCode || ''
|
||||
typeFormData.productTypeName = row.productTypeName || ''
|
||||
typeFormData.remark = row.remark || ''
|
||||
typeDialogVisible.value = true
|
||||
typeFormRef.value?.clearValidate?.()
|
||||
}
|
||||
|
||||
function handleEdit(row: Api.CellProductType.CellProductTypeItem) {
|
||||
isEdit.value = true
|
||||
dialogTitle.value = '编辑类型'
|
||||
editingId.value = row.id
|
||||
formData.productTypeCode = row.productTypeCode || ''
|
||||
formData.productTypeName = row.productTypeName || ''
|
||||
formData.remark = row.remark || ''
|
||||
dialogVisible.value = true
|
||||
formRef.value?.clearValidate?.()
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
await formRef.value?.validate?.()
|
||||
submitLoading.value = true
|
||||
async function handleTypeSubmit() {
|
||||
await typeFormRef.value?.validate?.()
|
||||
typeSubmitLoading.value = true
|
||||
try {
|
||||
const payload = {
|
||||
productTypeCode: formData.productTypeCode.trim(),
|
||||
productTypeName: formData.productTypeName.trim(),
|
||||
remark: formData.remark?.trim() || undefined
|
||||
productTypeCode: typeFormData.productTypeCode.trim(),
|
||||
productTypeName: typeFormData.productTypeName.trim(),
|
||||
remark: typeFormData.remark?.trim() || undefined
|
||||
}
|
||||
if (isEdit.value && editingId.value) {
|
||||
await fetchUpdateCellProductType(editingId.value, payload)
|
||||
if (typeIsEdit.value && typeEditingId.value) {
|
||||
await fetchUpdateCellProductType(typeEditingId.value, payload)
|
||||
} else {
|
||||
await fetchCreateCellProductType(payload)
|
||||
}
|
||||
ElMessage.success(isEdit.value ? '更新成功' : '创建成功')
|
||||
dialogVisible.value = false
|
||||
await loadData()
|
||||
ElMessage.success(typeIsEdit.value ? '更新成功' : '创建成功')
|
||||
typeDialogVisible.value = false
|
||||
await loadTypeData()
|
||||
priceTabRef.value?.loadData?.()
|
||||
} catch {
|
||||
/* 校验或接口错误已由全局处理 */
|
||||
} finally {
|
||||
submitLoading.value = false
|
||||
typeSubmitLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleView(row: Api.CellProductType.CellProductTypeItem) {
|
||||
viewRow.value = row
|
||||
viewVisible.value = true
|
||||
function handleTypeView(row: Api.CellProductType.CellProductTypeItem) {
|
||||
typeViewRow.value = row
|
||||
typeViewVisible.value = true
|
||||
}
|
||||
|
||||
function handleDropdownCommand(cmd: string, row: Api.CellProductType.CellProductTypeItem) {
|
||||
if (cmd === 'edit') handleEdit(row)
|
||||
else if (cmd === 'delete') handleDelete(row)
|
||||
}
|
||||
|
||||
async function handleDelete(row: Api.CellProductType.CellProductTypeItem) {
|
||||
async function handleTypeDelete(row: Api.CellProductType.CellProductTypeItem) {
|
||||
try {
|
||||
await ElMessageBox.confirm('确定要删除该类型吗?', '提示', { type: 'warning' })
|
||||
} catch {
|
||||
@@ -382,48 +350,170 @@
|
||||
await withFullscreenLoading(async () => {
|
||||
await fetchDeleteCellProductType(row.id)
|
||||
ElMessage.success('删除成功')
|
||||
await loadData()
|
||||
await loadTypeData()
|
||||
priceTabRef.value?.loadData?.()
|
||||
}, fullscreenLoadingText.delete)
|
||||
}
|
||||
|
||||
async function handleBatchDelete() {
|
||||
const ids = selectedRows.value.map((r) => r.id)
|
||||
if (!ids.length) return
|
||||
await ElMessageBox.confirm(`确定删除选中的 ${ids.length} 个类型吗?`, '提示', {
|
||||
type: 'warning'
|
||||
})
|
||||
await withFullscreenLoading(async () => {
|
||||
for (const id of ids) {
|
||||
await fetchDeleteCellProductType(id)
|
||||
}
|
||||
ElMessage.success('批量删除成功')
|
||||
selectedRows.value = []
|
||||
await loadData()
|
||||
}, fullscreenLoadingText.batchDelete)
|
||||
}
|
||||
// 输入检索条件时自动搜索(防抖 300ms)
|
||||
watchDebounced(
|
||||
searchForm,
|
||||
() => typeSearchForm.keyword,
|
||||
() => {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
loadTypeData()
|
||||
},
|
||||
{ debounce: 300, deep: true }
|
||||
{ debounce: 300 }
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
const tab = route.query.tab
|
||||
if (tab === 'spec' || tab === 'price' || tab === 'project-price') {
|
||||
activeTab.value = tab as string
|
||||
}
|
||||
loadData()
|
||||
loadTypeData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.cell-product-stats {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 12px;
|
||||
padding: 16px 16px 0;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
min-height: 72px;
|
||||
padding: 12px 16px;
|
||||
border: 1px solid var(--mint-border, #d9e8e2);
|
||||
border-radius: 10px;
|
||||
background: var(--surface, #fff);
|
||||
box-shadow: 0 1px 3px rgb(0 0 0 / 5%);
|
||||
}
|
||||
|
||||
.stat-icon {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
|
||||
img {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
object-fit: contain;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.stat-main {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.stat-k {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--mint-text, #1e293b);
|
||||
}
|
||||
|
||||
.stat-v {
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
color: var(--primary-dark, #059669);
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
.kanban {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 12px;
|
||||
padding: 16px;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.kanban-col {
|
||||
min-width: 0;
|
||||
background: var(--table-head, #f8fafc);
|
||||
border: 1px solid var(--mint-border, #d9e8e2);
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: calc(100vh - 280px);
|
||||
max-height: calc(100vh - 200px);
|
||||
}
|
||||
|
||||
.kanban-col-hd {
|
||||
padding: 10px 12px;
|
||||
border-bottom: 1px solid var(--mint-border, #d9e8e2);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.kanban-col-title {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--mint-text, #1e293b);
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.kanban-count {
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
padding: 2px 8px;
|
||||
border-radius: 999px;
|
||||
background: var(--surface, #fff);
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
border: 1px solid var(--mint-border, #d9e8e2);
|
||||
}
|
||||
|
||||
.kanban-add-btn {
|
||||
flex-shrink: 0;
|
||||
height: 32px;
|
||||
padding: 0 10px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.kanban-col-search {
|
||||
padding: 8px 10px 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.kanban-list {
|
||||
padding: 10px;
|
||||
overflow-y: auto;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
@import './cell-product-kanban.scss';
|
||||
|
||||
.type-dialog-form {
|
||||
:deep(.el-form-item) {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
.kanban {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.kanban-col {
|
||||
min-height: 320px;
|
||||
max-height: 420px;
|
||||
}
|
||||
|
||||
.cell-product-stats {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -6,10 +6,22 @@
|
||||
<h2>财务确认</h2>
|
||||
</div>
|
||||
|
||||
<el-tabs v-model="activeTab" class="panel-tabs" @tab-change="handleTabChange">
|
||||
<el-tab-pane label="待处理" name="pending" />
|
||||
<el-tab-pane label="已处理" name="done" />
|
||||
</el-tabs>
|
||||
<div class="panel-pill-tabs">
|
||||
<div class="panel-pill-tabs__track" role="tablist">
|
||||
<button
|
||||
v-for="tab in FINANCE_TABS"
|
||||
:key="tab.name"
|
||||
type="button"
|
||||
role="tab"
|
||||
class="panel-pill-tabs__btn"
|
||||
:class="{ 'is-active': activeTab === tab.name }"
|
||||
:aria-selected="activeTab === tab.name"
|
||||
@click="switchTab(tab.name)"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" label-position="top" @submit.prevent>
|
||||
@@ -645,6 +657,11 @@
|
||||
return [formatLocalDate(start), formatLocalDate(end)]
|
||||
}
|
||||
|
||||
const FINANCE_TABS = [
|
||||
{ name: 'pending', label: '待处理' },
|
||||
{ name: 'done', label: '已处理' }
|
||||
] as const
|
||||
|
||||
const activeTab = ref('pending')
|
||||
const createTimeRange = ref<[string, string] | null>(getDefaultLast30DaysRange())
|
||||
const searchForm = reactive({
|
||||
@@ -712,6 +729,12 @@
|
||||
loadData()
|
||||
}
|
||||
|
||||
function switchTab(name: string) {
|
||||
if (activeTab.value === name) return
|
||||
activeTab.value = name
|
||||
handleTabChange(name)
|
||||
}
|
||||
|
||||
// 检索条件变更时自动搜索(防抖 300ms)
|
||||
watchDebounced(
|
||||
[searchForm, createTimeRange],
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<h2>渠道信息管理</h2>
|
||||
</div>
|
||||
|
||||
<el-tabs v-model="mainTab" class="panel-tabs">
|
||||
<el-tabs v-model="mainTab" class="panel-pill-tabs">
|
||||
<el-tab-pane label="渠道信息" name="channel">
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="page-container">
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2>机构列表</h2>
|
||||
<h2>体检机构及项目</h2>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
@@ -45,106 +45,121 @@
|
||||
</div>
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<el-table
|
||||
class="list-table"
|
||||
:data="tableData"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
@row-dblclick="handleView"
|
||||
>
|
||||
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
min-width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
:index="(i) => (pagination.page - 1) * pagination.pageSize + i + 1"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="institutionName"
|
||||
label="机构名称"
|
||||
min-width="160"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="institutionAddress"
|
||||
label="机构地址"
|
||||
min-width="180"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="contactName"
|
||||
label="联系人"
|
||||
min-width="100"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="contactPhone"
|
||||
label="联系电话"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="status"
|
||||
label="状态"
|
||||
min-width="90"
|
||||
align="center"
|
||||
header-align="center"
|
||||
<div v-loading="loading" class="checkup-inst-card-grid">
|
||||
<div
|
||||
v-for="row in tableData"
|
||||
:key="row.id"
|
||||
class="checkup-inst-card"
|
||||
:class="{ 'is-selected': isRowSelected(row.id) }"
|
||||
@dblclick="handleView(row)"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.status == '1' ? 'success' : 'info'" size="small">{{
|
||||
row.status == '1' ? '正常' : '停用'
|
||||
}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
min-width="220"
|
||||
fixed="right"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<div style="display: flex; justify-content: center; gap: 8px">
|
||||
<el-button
|
||||
class="btn-op-item primary"
|
||||
type="primary"
|
||||
@click="openItemDialog(row)"
|
||||
>
|
||||
<el-icon><Setting /></el-icon>项目价格配置
|
||||
</el-button>
|
||||
<el-dropdown
|
||||
trigger="hover"
|
||||
@command="(cmd) => handleDropdownCommand(cmd, row)"
|
||||
>
|
||||
<el-button class="btn-op-item">
|
||||
<el-icon><More /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="view">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="edit">
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="delete" divided>
|
||||
<el-icon><Delete /></el-icon>删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<div class="checkup-inst-card__select" @click.stop>
|
||||
<el-checkbox
|
||||
:model-value="isRowSelected(row.id)"
|
||||
@change="(val) => toggleRowSelection(row, !!val)"
|
||||
/>
|
||||
</div>
|
||||
<div class="checkup-inst-card__header">
|
||||
<div class="checkup-inst-card__media">
|
||||
<el-image
|
||||
v-if="row.institutionLogo"
|
||||
:src="institutionLogoUrl(row.institutionLogo)"
|
||||
fit="cover"
|
||||
class="checkup-inst-card__logo"
|
||||
/>
|
||||
<div v-else class="checkup-inst-card__logo-placeholder">
|
||||
<el-icon><OfficeBuilding /></el-icon>
|
||||
<span>暂无Logo</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="checkup-inst-card__summary">
|
||||
<div class="checkup-inst-card__title-row">
|
||||
<div class="checkup-inst-card__title" :title="row.institutionName">
|
||||
{{ row.institutionName }}
|
||||
</div>
|
||||
<el-tag :type="row.status == '1' ? 'success' : 'info'" size="small">
|
||||
{{ row.status == '1' ? '正常' : '停用' }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div
|
||||
class="checkup-inst-card__address"
|
||||
:title="row.institutionAddress || ''"
|
||||
>
|
||||
{{ row.institutionAddress || ' ' }}
|
||||
</div>
|
||||
<div class="checkup-inst-card__contact">
|
||||
<template v-if="row.contactName || row.contactPhone">
|
||||
<span v-if="row.contactName">{{ row.contactName }}</span>
|
||||
<span v-if="row.contactName && row.contactPhone"> · </span>
|
||||
<span v-if="row.contactPhone">{{ row.contactPhone }}</span>
|
||||
</template>
|
||||
<span v-else> </span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="checkup-inst-card__projects">
|
||||
<div class="checkup-inst-card__projects-head">
|
||||
<span class="checkup-inst-card__projects-title">项目</span>
|
||||
<span class="checkup-inst-card__projects-count">
|
||||
{{ (row.projects || []).length }} 项
|
||||
</span>
|
||||
</div>
|
||||
<div class="checkup-inst-card__project-body">
|
||||
<div
|
||||
v-for="item in (row.projects || []).slice(0, 1)"
|
||||
:key="item.id"
|
||||
class="checkup-inst-card__project-item"
|
||||
>
|
||||
<span class="checkup-inst-card__project-name" :title="item.projectName">
|
||||
{{ item.projectName }}
|
||||
</span>
|
||||
<span class="checkup-inst-card__project-fee">
|
||||
{{
|
||||
item.projectFee != null ? '¥' + formatMoneyDisplay(item.projectFee) : '—'
|
||||
}}
|
||||
</span>
|
||||
<el-tag :type="item.status == '1' ? 'success' : 'info'" size="small">
|
||||
{{ item.status == '1' ? '正常' : '停用' }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div
|
||||
v-if="!(row.projects || []).length"
|
||||
class="checkup-inst-card__project-empty"
|
||||
>
|
||||
暂无项目,请点击下方配置
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="checkup-inst-card__footer">
|
||||
<el-button class="btn-op-item primary" @click.stop="openItemDialog(row)">
|
||||
<el-icon><Setting /></el-icon>项目价格配置
|
||||
</el-button>
|
||||
<el-dropdown trigger="hover" @command="(cmd) => handleDropdownCommand(cmd, row)">
|
||||
<el-button class="btn-op-item" @click.stop>
|
||||
<el-icon><More /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="view">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="edit">
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="delete" divided>
|
||||
<el-icon><Delete /></el-icon>删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-empty
|
||||
v-if="!loading && !tableData.length"
|
||||
description="暂无体检机构数据"
|
||||
:image-size="80"
|
||||
/>
|
||||
<div class="pagination list-pager-bar">
|
||||
<el-pagination
|
||||
:current-page="pagination.page"
|
||||
@@ -179,6 +194,37 @@
|
||||
<el-form-item label="机构名称" prop="institutionName">
|
||||
<el-input v-model="companyForm.institutionName" placeholder="请输入机构名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="机构Logo" class="form-col-span-2">
|
||||
<div class="institution-logo-row">
|
||||
<el-image
|
||||
v-if="companyForm.institutionLogo"
|
||||
:src="institutionLogoUrl(companyForm.institutionLogo)"
|
||||
fit="cover"
|
||||
class="institution-logo-preview"
|
||||
/>
|
||||
<div v-else class="institution-logo-placeholder">暂无</div>
|
||||
<el-upload
|
||||
ref="institutionLogoUploadRef"
|
||||
accept="image/*"
|
||||
:show-file-list="false"
|
||||
:auto-upload="false"
|
||||
:limit="1"
|
||||
:on-change="handleInstitutionLogoChange"
|
||||
:on-exceed="handleInstitutionLogoExceed"
|
||||
>
|
||||
<el-button type="primary" plain>
|
||||
<el-icon><Upload /></el-icon>上传Logo
|
||||
</el-button>
|
||||
</el-upload>
|
||||
<el-button
|
||||
v-if="companyForm.institutionLogo"
|
||||
class="btn-ghost"
|
||||
@click="companyForm.institutionLogo = ''"
|
||||
>
|
||||
<el-icon><Delete /></el-icon>移除
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="机构地址">
|
||||
<el-input v-model="companyForm.institutionAddress" placeholder="请输入机构地址" />
|
||||
</el-form-item>
|
||||
@@ -424,7 +470,23 @@
|
||||
:icon="OfficeBuilding"
|
||||
:meta="viewHeroMeta"
|
||||
:sections="viewSections"
|
||||
/>
|
||||
>
|
||||
<template v-if="viewRow?.institutionLogo" #institution-logo>
|
||||
<dl class="institution-view-kv-grid">
|
||||
<div class="institution-view-kv">
|
||||
<dt>Logo</dt>
|
||||
<dd>
|
||||
<el-image
|
||||
:src="institutionLogoUrl(viewRow.institutionLogo)"
|
||||
fit="cover"
|
||||
class="institution-view-logo"
|
||||
:preview-src-list="[institutionLogoUrl(viewRow.institutionLogo)]"
|
||||
/>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</template>
|
||||
</SystemViewDialog>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -443,8 +505,10 @@
|
||||
Edit,
|
||||
Delete,
|
||||
More,
|
||||
OfficeBuilding
|
||||
OfficeBuilding,
|
||||
Upload
|
||||
} from '@element-plus/icons-vue'
|
||||
import type { UploadFile } from 'element-plus'
|
||||
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
|
||||
import CheckupPackagePanel from './CheckupPackagePanel.vue'
|
||||
import AmountInput from '@/components/common/amount-input/index.vue'
|
||||
@@ -464,10 +528,59 @@
|
||||
fetchUpdateCheckupInstitutionProject,
|
||||
fetchDeleteCheckupInstitutionProject
|
||||
} from '@/api/admin'
|
||||
import { fetchUploadAttachment } from '@/api/business'
|
||||
import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
|
||||
|
||||
defineOptions({ name: 'PilotCheckupInstitution' })
|
||||
|
||||
const institutionLogoUploadRef = ref()
|
||||
const minioBaseUrl = (import.meta.env.VITE_MINIO_BASE_URL || '').replace(/\/$/, '')
|
||||
|
||||
function institutionLogoUrl(url: string) {
|
||||
if (!url) return ''
|
||||
if (url.startsWith('http://') || url.startsWith('https://') || url.startsWith('/')) return url
|
||||
return `${minioBaseUrl}/${url}`
|
||||
}
|
||||
|
||||
async function uploadInstitutionLogoFile(file: File) {
|
||||
try {
|
||||
const fd = new FormData()
|
||||
fd.append('folder', 'checkup-institution')
|
||||
fd.append('file', file)
|
||||
const res = await fetchUploadAttachment(fd)
|
||||
companyForm.institutionLogo = res.fileUrl || ''
|
||||
ElMessage.success('Logo上传成功')
|
||||
} catch (e) {
|
||||
console.error('体检机构Logo上传失败:', e)
|
||||
ElMessage.error('Logo上传失败')
|
||||
} finally {
|
||||
institutionLogoUploadRef.value?.clearFiles()
|
||||
}
|
||||
}
|
||||
|
||||
const handleInstitutionLogoChange = async (uploadFile: UploadFile) => {
|
||||
const file: any = (uploadFile as any).raw
|
||||
if (!file) return
|
||||
const status = (uploadFile as any).status
|
||||
if (status && status !== 'ready') return
|
||||
await uploadInstitutionLogoFile(file)
|
||||
}
|
||||
|
||||
const handleInstitutionLogoExceed = (files: File[]) => {
|
||||
const file = files[0]
|
||||
if (file) uploadInstitutionLogoFile(file)
|
||||
}
|
||||
|
||||
const isRowSelected = (id: string) => selectedRows.value.some((r) => r.id === id)
|
||||
|
||||
const toggleRowSelection = (row: any, checked: boolean) => {
|
||||
if (checked) {
|
||||
if (!isRowSelected(row.id)) selectedRows.value = [...selectedRows.value, row]
|
||||
return
|
||||
}
|
||||
selectedRows.value = selectedRows.value.filter((r) => r.id !== row.id)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// 搜索 & 主表
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -488,6 +601,7 @@
|
||||
const editingId = ref<string | null>(null)
|
||||
const companyForm = reactive({
|
||||
institutionName: '',
|
||||
institutionLogo: '',
|
||||
institutionAddress: '',
|
||||
contactName: '',
|
||||
contactPhone: '',
|
||||
@@ -561,6 +675,8 @@
|
||||
})
|
||||
tableData.value = (res as any)?.list || []
|
||||
pagination.total = (res as any)?.total ?? 0
|
||||
const validIds = new Set(tableData.value.map((r) => r.id))
|
||||
selectedRows.value = selectedRows.value.filter((r) => validIds.has(r.id))
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
@@ -578,15 +694,12 @@
|
||||
loadData()
|
||||
}
|
||||
|
||||
function handleSelectionChange(rows: any[]) {
|
||||
selectedRows.value = rows
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// 机构弹窗操作
|
||||
// ---------------------------------------------------------------------------
|
||||
function resetCompanyForm() {
|
||||
companyForm.institutionName = ''
|
||||
companyForm.institutionLogo = ''
|
||||
companyForm.institutionAddress = ''
|
||||
companyForm.contactName = ''
|
||||
companyForm.contactPhone = ''
|
||||
@@ -611,6 +724,7 @@
|
||||
companyDialogTitle.value = '编辑机构'
|
||||
editingId.value = row.id
|
||||
companyForm.institutionName = row.institutionName || ''
|
||||
companyForm.institutionLogo = row.institutionLogo || ''
|
||||
companyForm.institutionAddress = row.institutionAddress || ''
|
||||
companyForm.contactName = row.contactName || ''
|
||||
companyForm.contactPhone = row.contactPhone || ''
|
||||
@@ -648,6 +762,7 @@
|
||||
try {
|
||||
const payload = {
|
||||
institutionName: companyForm.institutionName.trim(),
|
||||
institutionLogo: companyForm.institutionLogo?.trim() ?? '',
|
||||
institutionAddress: companyForm.institutionAddress?.trim() || undefined,
|
||||
contactName: companyForm.contactName?.trim() || undefined,
|
||||
contactPhone: companyForm.contactPhone?.trim() || undefined,
|
||||
@@ -749,6 +864,27 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
if (row.institutionLogo) {
|
||||
sections.push({
|
||||
title: '机构Logo',
|
||||
fields: [],
|
||||
slot: 'institution-logo'
|
||||
})
|
||||
}
|
||||
const projects = row.projects || []
|
||||
if (projects.length) {
|
||||
sections.push({
|
||||
title: '项目价格',
|
||||
fields: projects.map((item: any) => ({
|
||||
label: item.projectName,
|
||||
value:
|
||||
(item.projectFee != null ? '¥' + formatMoneyDisplay(item.projectFee) : '—') +
|
||||
' · ' +
|
||||
(item.status == '1' ? '正常' : '停用'),
|
||||
tagType: item.status == '1' ? 'success' : 'info'
|
||||
}))
|
||||
})
|
||||
}
|
||||
// 加载开票信息
|
||||
try {
|
||||
const invRes = await fetchCheckupInstitutionInvoices(row.id)
|
||||
@@ -803,6 +939,7 @@
|
||||
currentInstitutionId.value = ''
|
||||
currentInstitutionName.value = ''
|
||||
itemTable.value = []
|
||||
loadData()
|
||||
}
|
||||
|
||||
function onItemSelectionChange(rows: any[]) {
|
||||
@@ -892,6 +1029,275 @@
|
||||
}
|
||||
}
|
||||
|
||||
.institution-logo-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.institution-logo-preview {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--mint-border, #e2e8f0);
|
||||
}
|
||||
|
||||
.institution-logo-placeholder {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 8px;
|
||||
border: 1px dashed var(--mint-border, #e2e8f0);
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
font-size: 12px;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.checkup-inst-card-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
|
||||
gap: 16px;
|
||||
min-height: 120px;
|
||||
padding: 16px;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.checkup-inst-card {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
min-height: 268px;
|
||||
background: #fff;
|
||||
border: 1px solid var(--mint-border, #e2e8f0);
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
|
||||
&:hover {
|
||||
border-color: #a8d4c4;
|
||||
box-shadow: 0 2px 12px rgba(4, 120, 87, 0.1);
|
||||
}
|
||||
|
||||
&.is-selected {
|
||||
border-color: var(--mint-primary, #10b981);
|
||||
box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25);
|
||||
}
|
||||
}
|
||||
|
||||
.checkup-inst-card__select {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.checkup-inst-card__header {
|
||||
display: flex;
|
||||
gap: 14px;
|
||||
min-height: 108px;
|
||||
box-sizing: border-box;
|
||||
padding: 16px 16px 12px 40px;
|
||||
background: #f8fafc;
|
||||
border-bottom: 1px solid var(--mint-border, #e2e8f0);
|
||||
}
|
||||
|
||||
.checkup-inst-card__media {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.checkup-inst-card__logo {
|
||||
display: block;
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid var(--mint-border, #e2e8f0);
|
||||
background: #fff;
|
||||
|
||||
:deep(.el-image__inner),
|
||||
:deep(img) {
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.checkup-inst-card__logo-placeholder {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
border-radius: 10px;
|
||||
border: 1px dashed var(--mint-border, #e2e8f0);
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
font-size: 11px;
|
||||
background: #fff;
|
||||
|
||||
.el-icon {
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.checkup-inst-card__summary {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.checkup-inst-card__title-row {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.checkup-inst-card__title {
|
||||
min-height: 42px;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: var(--mint-text, #0f172a);
|
||||
line-height: 1.4;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.checkup-inst-card__address,
|
||||
.checkup-inst-card__contact {
|
||||
min-height: 18px;
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.checkup-inst-card__address {
|
||||
margin-bottom: 4px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.checkup-inst-card__projects {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
min-height: 92px;
|
||||
padding: 12px 16px;
|
||||
}
|
||||
|
||||
.checkup-inst-card__projects-head {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 20px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.checkup-inst-card__projects-title {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--mint-text, #0f172a);
|
||||
}
|
||||
|
||||
.checkup-inst-card__projects-count {
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
}
|
||||
|
||||
.checkup-inst-card__project-body {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
min-height: 40px;
|
||||
}
|
||||
|
||||
.checkup-inst-card__project-item {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) auto auto;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
gap: 8px;
|
||||
padding: 8px 10px;
|
||||
border-radius: 8px;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.checkup-inst-card__project-name {
|
||||
font-size: 13px;
|
||||
color: var(--mint-text, #0f172a);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.checkup-inst-card__project-fee {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: #047857;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.checkup-inst-card__project-empty {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
}
|
||||
|
||||
.checkup-inst-card__footer {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
height: 52px;
|
||||
box-sizing: border-box;
|
||||
padding: 10px 16px 14px;
|
||||
border-top: 1px solid var(--mint-border, #e2e8f0);
|
||||
}
|
||||
|
||||
.institution-view-kv-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 12px 24px;
|
||||
}
|
||||
|
||||
.institution-view-kv {
|
||||
dt {
|
||||
margin-bottom: 6px;
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
dd {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.institution-view-logo {
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid var(--mint-border, #e2e8f0);
|
||||
}
|
||||
|
||||
.item-dialog-head {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!-- eslint-disable vue/no-v-model-argument -->
|
||||
<template>
|
||||
<div class="refund-confirm-tab">
|
||||
<el-tabs v-model="activeTab" class="work-order-type-tabs" @tab-change="handleStatusTabChange">
|
||||
<el-tabs v-model="activeTab" class="panel-pill-tabs" @tab-change="handleStatusTabChange">
|
||||
<el-tab-pane label="待确认" name="pending" />
|
||||
<el-tab-pane label="已确认" name="confirmed" />
|
||||
</el-tabs>
|
||||
@@ -582,11 +582,6 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.work-order-type-tabs {
|
||||
padding: 0 16px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.filter-form :deep(.el-form-item) {
|
||||
margin-bottom: 0;
|
||||
min-width: 0;
|
||||
|
||||
@@ -35,14 +35,22 @@
|
||||
</div>
|
||||
|
||||
<div v-show="mainTab === 'payment'" class="panel-entity-body">
|
||||
<el-tabs
|
||||
v-model="activeTab"
|
||||
class="work-order-type-tabs"
|
||||
@tab-change="handleStatusTabChange"
|
||||
>
|
||||
<el-tab-pane label="待确认" name="pending" />
|
||||
<el-tab-pane label="已确认" name="confirmed" />
|
||||
</el-tabs>
|
||||
<div class="panel-pill-tabs">
|
||||
<div class="panel-pill-tabs__track" role="tablist">
|
||||
<button
|
||||
v-for="tab in CONFIRM_TABS"
|
||||
:key="tab.name"
|
||||
type="button"
|
||||
role="tab"
|
||||
class="panel-pill-tabs__btn"
|
||||
:class="{ 'is-active': activeTab === tab.name }"
|
||||
:aria-selected="activeTab === tab.name"
|
||||
@click="switchTab(tab.name)"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" label-position="top" @submit.prevent>
|
||||
@@ -431,6 +439,11 @@
|
||||
|
||||
const mainTab = ref<'payment' | 'refund'>('payment')
|
||||
|
||||
const CONFIRM_TABS = [
|
||||
{ name: 'pending', label: '待确认' },
|
||||
{ name: 'confirmed', label: '已确认' }
|
||||
] as const
|
||||
|
||||
const activeTab = ref('pending')
|
||||
const searchForm = reactive({ keyword: '' })
|
||||
const tableData = ref<Record<string, unknown>[]>([])
|
||||
@@ -520,6 +533,12 @@
|
||||
loadData()
|
||||
}
|
||||
|
||||
function switchTab(name: string) {
|
||||
if (activeTab.value === name) return
|
||||
activeTab.value = name
|
||||
handleStatusTabChange()
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
@@ -715,11 +734,6 @@
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.work-order-type-tabs {
|
||||
padding: 0 16px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.filter-form :deep(.el-form-item) {
|
||||
margin-bottom: 0;
|
||||
min-width: 0;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="clinical-payment-tab">
|
||||
<el-tabs
|
||||
v-model="activeTab"
|
||||
class="work-order-type-tabs"
|
||||
class="panel-pill-tabs"
|
||||
@tab-change="handleStatusTabChange"
|
||||
>
|
||||
<el-tab-pane label="待缴费" name="dfj" />
|
||||
@@ -899,11 +899,6 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.work-order-type-tabs {
|
||||
padding: 0 16px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.filter-form :deep(.el-form-item) {
|
||||
margin-bottom: 0;
|
||||
min-width: 0;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<h2>耗材管理</h2>
|
||||
</div>
|
||||
|
||||
<el-tabs v-model="activeTab" class="panel-tabs">
|
||||
<el-tabs v-model="activeTab" class="panel-pill-tabs">
|
||||
<el-tab-pane label="耗材列表" name="list">
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
|
||||
@@ -6,10 +6,22 @@
|
||||
<h2 class="title-bar-heading">我的生产任务</h2>
|
||||
</div>
|
||||
|
||||
<el-tabs v-model="activeTab" class="my-production-task-tabs" @tab-change="handleTabChange">
|
||||
<el-tab-pane label="当前任务" name="current" />
|
||||
<el-tab-pane label="历史执行" name="history" />
|
||||
</el-tabs>
|
||||
<div class="panel-pill-tabs">
|
||||
<div class="panel-pill-tabs__track" role="tablist">
|
||||
<button
|
||||
v-for="tab in TASK_TABS"
|
||||
:key="tab.name"
|
||||
type="button"
|
||||
role="tab"
|
||||
class="panel-pill-tabs__btn"
|
||||
:class="{ 'is-active': activeTab === tab.name }"
|
||||
:aria-selected="activeTab === tab.name"
|
||||
@click="switchTab(tab.name)"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
@@ -86,6 +98,11 @@
|
||||
defineOptions({ name: 'ProductionMyProductionTask' })
|
||||
|
||||
const PAGE_BOTTOM_GAP = 20
|
||||
const TASK_TABS = [
|
||||
{ name: 'current', label: '当前任务' },
|
||||
{ name: 'history', label: '历史执行' }
|
||||
] as const
|
||||
|
||||
const activeTab = ref<'current' | 'history'>('current')
|
||||
|
||||
const pageRef = ref<HTMLElement>()
|
||||
@@ -168,6 +185,12 @@
|
||||
nextTick(updatePageHeight)
|
||||
}
|
||||
|
||||
function switchTab(name: 'current' | 'history') {
|
||||
if (activeTab.value === name) return
|
||||
activeTab.value = name
|
||||
handleTabChange()
|
||||
}
|
||||
|
||||
function handlePageChange() {
|
||||
refreshToken.value += 1
|
||||
}
|
||||
@@ -191,13 +214,6 @@
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.my-production-task-tabs {
|
||||
padding: 0 24px;
|
||||
:deep(.el-tabs__header) {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.my-production-task-list {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<h2>工艺基础信息维护</h2>
|
||||
</div>
|
||||
|
||||
<el-tabs v-model="activeTab" class="panel-tabs">
|
||||
<el-tabs v-model="activeTab" class="panel-pill-tabs">
|
||||
<el-tab-pane label="工艺工序分类" name="category">
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<h2>工艺库管理</h2>
|
||||
</div>
|
||||
|
||||
<el-tabs v-model="activeTab" class="panel-tabs">
|
||||
<el-tabs v-model="activeTab" class="panel-pill-tabs">
|
||||
<el-tab-pane label="工艺列表" name="list">
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
|
||||
+1080
-232
File diff suppressed because it is too large.
Load diff
@@ -257,15 +257,25 @@
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
min-width="160"
|
||||
min-width="260"
|
||||
fixed="right"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-button class="btn-op-item" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<div class="table-op-btns">
|
||||
<el-button class="btn-op-item" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="canMarkFullyUsed(row)"
|
||||
class="btn-op-item"
|
||||
:loading="markFullyUsedLoadingId === row.id"
|
||||
@click="handleMarkFullyUsed(row)"
|
||||
>
|
||||
<el-icon><CircleCheck /></el-icon>标记已使用完
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -345,11 +355,13 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { Search, RefreshLeft, View, Document } from '@element-plus/icons-vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Search, RefreshLeft, View, Document, CircleCheck } from '@element-plus/icons-vue'
|
||||
import {
|
||||
fetchMyProductionMaterialUsageList,
|
||||
fetchProductionMaterialUsageList,
|
||||
fetchProductionMaterialLinkedStepUsages
|
||||
fetchProductionMaterialLinkedStepUsages,
|
||||
fetchMarkProductionMaterialUsageFullyUsed
|
||||
} from '@/api/production-material'
|
||||
import type { ProductionMaterialUsage } from '@/api/production-material'
|
||||
import { fetchProductionMaterialOptions } from '@/api/production-material'
|
||||
@@ -474,6 +486,32 @@
|
||||
return productionMaterialUsageSourceTypeLabel(sourceType) || sourceType || '-'
|
||||
}
|
||||
|
||||
const markFullyUsedLoadingId = ref('')
|
||||
|
||||
function canMarkFullyUsed(row: ProductionMaterialUsage) {
|
||||
return isManualOutRow(row) && (row.requisitionStatus || 'open') !== 'closed'
|
||||
}
|
||||
|
||||
async function handleMarkFullyUsed(row: ProductionMaterialUsage) {
|
||||
try {
|
||||
await ElMessageBox.confirm('确认该领用记录已全部使用完?标记后将不再出现在盘点待登记列表。', '标记已使用完', {
|
||||
type: 'warning',
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消'
|
||||
})
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
markFullyUsedLoadingId.value = row.id
|
||||
try {
|
||||
await fetchMarkProductionMaterialUsageFullyUsed(row.id)
|
||||
row.requisitionStatus = 'closed'
|
||||
ElMessage.success('已标记为使用完')
|
||||
} finally {
|
||||
markFullyUsedLoadingId.value = ''
|
||||
}
|
||||
}
|
||||
|
||||
async function loadMaterialOptions() {
|
||||
try {
|
||||
const res = await fetchProductionMaterialOptions({
|
||||
@@ -659,3 +697,11 @@
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.table-op-btns {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
}
|
||||
</style>
|
||||
@@ -7,8 +7,24 @@
|
||||
<h2 class="title-bar-heading">生产物料库</h2>
|
||||
</div>
|
||||
|
||||
<el-tabs v-model="activeTab" class="panel-tabs">
|
||||
<el-tab-pane label="物料列表" name="list">
|
||||
<div class="panel-pill-tabs">
|
||||
<div class="panel-pill-tabs__track" role="tablist">
|
||||
<button
|
||||
v-for="tab in PRODUCTION_MATERIAL_TABS"
|
||||
:key="tab.name"
|
||||
type="button"
|
||||
role="tab"
|
||||
class="panel-pill-tabs__btn"
|
||||
:class="{ 'is-active': activeTab === tab.name }"
|
||||
:aria-selected="activeTab === tab.name"
|
||||
@click="handleTabChange(tab.name)"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-show="activeTab === 'list'" class="panel-track-pane">
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
@@ -1146,20 +1162,19 @@
|
||||
<p v-else class="view-empty-hint">暂无领用记录</p>
|
||||
</template>
|
||||
</SystemViewDialog>
|
||||
</el-tab-pane>
|
||||
</div>
|
||||
|
||||
<el-tab-pane label="变动记录" name="usage" lazy>
|
||||
<ProductionMaterialUsageTab />
|
||||
</el-tab-pane>
|
||||
<div v-show="activeTab === 'usage'" class="panel-track-pane">
|
||||
<ProductionMaterialUsageTab v-if="usageTabMounted" />
|
||||
</div>
|
||||
|
||||
<el-tab-pane label="库存盘点" name="stockCheck" lazy>
|
||||
<ProductionMaterialStockCheckTab />
|
||||
</el-tab-pane>
|
||||
<div v-show="activeTab === 'stockCheck'" class="panel-track-pane">
|
||||
<ProductionMaterialStockCheckTab v-if="stockCheckTabMounted" />
|
||||
</div>
|
||||
|
||||
<el-tab-pane label="配制单" name="prep" lazy>
|
||||
<ProductionMaterialPrepTab />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div v-show="activeTab === 'prep'" class="panel-track-pane">
|
||||
<ProductionMaterialPrepTab v-if="prepTabMounted" />
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<ProductionMaterialConfiguredCatalogDialog ref="configuredCatalogRef" @saved="loadData" />
|
||||
@@ -1221,7 +1236,29 @@
|
||||
}
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const PRODUCTION_MATERIAL_TABS = [
|
||||
{ name: 'list', label: '物料列表' },
|
||||
{ name: 'usage', label: '变动记录' },
|
||||
{ name: 'stockCheck', label: '库存盘点' },
|
||||
{ name: 'prep', label: '配制单' }
|
||||
] as const
|
||||
|
||||
const activeTab = ref('list')
|
||||
const usageTabMounted = ref(false)
|
||||
const stockCheckTabMounted = ref(false)
|
||||
const prepTabMounted = ref(false)
|
||||
|
||||
function ensureTabMounted(tab: string) {
|
||||
if (tab === 'usage') usageTabMounted.value = true
|
||||
if (tab === 'stockCheck') stockCheckTabMounted.value = true
|
||||
if (tab === 'prep') prepTabMounted.value = true
|
||||
}
|
||||
|
||||
function handleTabChange(name: string) {
|
||||
activeTab.value = name
|
||||
ensureTabMounted(name)
|
||||
}
|
||||
const searchForm = reactive({ keyword: '', materialType: '', status: '' })
|
||||
const tableRef = ref()
|
||||
const tableData = ref<ProductionMaterialBatch[]>([])
|
||||
@@ -2285,8 +2322,9 @@
|
||||
|
||||
onMounted(() => {
|
||||
const tab = route.query.tab
|
||||
if (tab === 'usage') {
|
||||
activeTab.value = 'usage'
|
||||
if (tab === 'usage' || tab === 'stockCheck' || tab === 'prep') {
|
||||
activeTab.value = tab as string
|
||||
ensureTabMounted(tab as string)
|
||||
}
|
||||
if (
|
||||
route.query.materialType === 'reagent' ||
|
||||
@@ -2295,7 +2333,6 @@
|
||||
) {
|
||||
searchForm.materialType = route.query.materialType as string
|
||||
}
|
||||
if (route.query.tab === 'prep') activeTab.value = 'prep'
|
||||
loadData()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -7,15 +7,22 @@
|
||||
<h2 class="title-bar-heading">生产工单</h2>
|
||||
</div>
|
||||
|
||||
<el-tabs
|
||||
v-model="activeTypeTab"
|
||||
class="work-order-type-tabs"
|
||||
@tab-change="handleTypeTabChange"
|
||||
>
|
||||
<el-tab-pane label="入库生产工单" name="inbound" />
|
||||
<el-tab-pane label="出库生产工单" name="outbound" />
|
||||
<el-tab-pane label="临时生产工单" name="temporary" />
|
||||
</el-tabs>
|
||||
<div class="panel-pill-tabs">
|
||||
<div class="panel-pill-tabs__track" role="tablist">
|
||||
<button
|
||||
v-for="tab in WORK_ORDER_TYPE_TABS"
|
||||
:key="tab.name"
|
||||
type="button"
|
||||
role="tab"
|
||||
class="panel-pill-tabs__btn"
|
||||
:class="{ 'is-active': activeTypeTab === tab.name }"
|
||||
:aria-selected="activeTypeTab === tab.name"
|
||||
@click="handleTabChange(tab.name)"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
@@ -403,6 +410,13 @@
|
||||
const router = useRouter()
|
||||
|
||||
type WorkOrderTypeTab = 'inbound' | 'temporary' | 'outbound'
|
||||
|
||||
const WORK_ORDER_TYPE_TABS = [
|
||||
{ name: 'inbound', label: '入库生产工单' },
|
||||
{ name: 'outbound', label: '出库生产工单' },
|
||||
{ name: 'temporary', label: '临时生产工单' }
|
||||
] as const
|
||||
|
||||
const activeTypeTab = ref<WorkOrderTypeTab>('inbound')
|
||||
const searchPlaceholder = computed(() => {
|
||||
if (activeTypeTab.value === 'temporary') return '工单号'
|
||||
@@ -446,6 +460,12 @@
|
||||
loadData()
|
||||
}
|
||||
|
||||
function handleTabChange(name: WorkOrderTypeTab) {
|
||||
if (activeTypeTab.value === name) return
|
||||
activeTypeTab.value = name
|
||||
handleTypeTabChange()
|
||||
}
|
||||
|
||||
async function submitAdd() {
|
||||
if (addMode.value !== 'temporary') {
|
||||
await addFormRef.value?.validate()
|
||||
@@ -1001,11 +1021,6 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.work-order-type-tabs {
|
||||
padding: 0 16px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.hint-muted {
|
||||
margin: 0 0 12px;
|
||||
font-size: 13px;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<h2>试剂列表</h2>
|
||||
</div>
|
||||
|
||||
<el-tabs v-model="activeTab" class="panel-tabs">
|
||||
<el-tabs v-model="activeTab" class="panel-pill-tabs">
|
||||
<el-tab-pane label="试剂列表" name="list">
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,140 +1,117 @@
|
||||
<!-- 质量检测 — 实验室自检项目 -->
|
||||
<!-- 质检项目管理 · 看板模式(双维度:实验室自检 | 第三方公司及项目) -->
|
||||
<!-- eslint-disable vue/no-v-model-argument -->
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<div class="page-container lab-test-kanban-page">
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2>质检项目管理</h2>
|
||||
<h2 class="title-bar-heading">质检项目管理</h2>
|
||||
</div>
|
||||
|
||||
<el-tabs v-model="activeTab" class="panel-tabs">
|
||||
<el-tab-pane label="实验室自检项目" name="lab">
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
<el-form-item label="关键词">
|
||||
<el-input v-model="searchForm.keyword" placeholder="编码/名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select
|
||||
v-model="searchForm.status"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option label="启用" value="1" />
|
||||
<el-option label="停用" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<section class="lab-test-stats">
|
||||
<div class="stat-card">
|
||||
<div class="stat-icon stat-icon--svg">
|
||||
<el-icon><Notebook /></el-icon>
|
||||
</div>
|
||||
<div class="filter-actions-row">
|
||||
<div class="filter-actions-end">
|
||||
<el-button class="btn-ghost" @click="handleReset"
|
||||
><el-icon><RefreshLeft /></el-icon>重置</el-button
|
||||
>
|
||||
<el-button class="btn-main" type="primary" @click="handleSearch"
|
||||
><el-icon><Search /></el-icon>搜索</el-button
|
||||
>
|
||||
<div class="stat-main">
|
||||
<div class="stat-k">实验室自检项目</div>
|
||||
<div class="stat-v">{{ labTotal }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-icon stat-icon--svg">
|
||||
<el-icon><OfficeBuilding /></el-icon>
|
||||
</div>
|
||||
<div class="stat-main">
|
||||
<div class="stat-k">三方检测公司</div>
|
||||
<div class="stat-v">{{ companyTotal }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-icon stat-icon--svg">
|
||||
<el-icon><Document /></el-icon>
|
||||
</div>
|
||||
<div class="stat-main">
|
||||
<div class="stat-k">三方检测项目</div>
|
||||
<div class="stat-v">{{ itemTotal }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="kanban">
|
||||
<!-- 维度 1:实验室自检项目 -->
|
||||
<div class="kanban-col">
|
||||
<div class="kanban-col-hd">
|
||||
<span class="kanban-col-title">
|
||||
实验室自检项目
|
||||
<span class="kanban-count">{{ labTotal }}</span>
|
||||
</span>
|
||||
<el-button class="btn-main kanban-add-btn" type="primary" @click="handleAdd">
|
||||
<el-icon><Plus /></el-icon>
|
||||
新增
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="kanban-col-search-row">
|
||||
<el-input
|
||||
v-model="searchForm.keyword"
|
||||
placeholder="编码/名称"
|
||||
clearable
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
<el-select v-model="searchForm.status" placeholder="状态" clearable>
|
||||
<el-option label="启用" value="1" />
|
||||
<el-option label="停用" value="0" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="kanban-list" v-loading="loading">
|
||||
<article
|
||||
v-for="row in tableData"
|
||||
:key="row.id"
|
||||
class="entity-card"
|
||||
@dblclick="handleView(row)"
|
||||
>
|
||||
<div class="entity-card-del" @click.stop>
|
||||
<el-button class="btn-op-item" title="删除" @click="handleDelete(row)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="entity-card-body">
|
||||
<h3 class="entity-card-title">{{ row.itemName }}</h3>
|
||||
<div class="entity-card-meta">{{ row.itemCode }}</div>
|
||||
<div class="entity-card-tags">
|
||||
<span class="tag" :class="row.status === '1' ? 'success' : 'muted'">
|
||||
{{ row.status === '1' ? '启用' : '停用' }}
|
||||
</span>
|
||||
<span v-if="row.description" class="tag muted">{{ row.description }}</span>
|
||||
</div>
|
||||
<div class="entity-card-ft" @click.stop>
|
||||
<div class="entity-card-ft-actions">
|
||||
<el-button class="btn-op-item" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-button class="btn-op-item" @click="handleEdit(row)">
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
<div v-if="!loading && !tableData.length" class="kanban-empty">
|
||||
<span>暂无自检项目</span>
|
||||
<span class="kanban-empty__hint">点击右上角「新增」添加实验室自检项目</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="list-toolbar">
|
||||
<div class="list-toolbar-row">
|
||||
<div class="list-toolbar-selected"
|
||||
>已选 <span class="sel-num">{{ selectedRows.length }}</span> 项</div
|
||||
>
|
||||
<el-button class="btn-main" type="primary" @click="handleAdd"
|
||||
><el-icon><Plus /></el-icon>新增项目</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<el-table
|
||||
class="list-table"
|
||||
:data="tableData"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
row-key="id"
|
||||
@selection-change="(r: QcLabTestItem[]) => (selectedRows.value = r)"
|
||||
@row-dblclick="handleView"
|
||||
>
|
||||
<el-table-column type="selection" min-width="55" align="center" />
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
min-width="68"
|
||||
align="center"
|
||||
:index="(i) => (pagination.page - 1) * pagination.pageSize + i + 1"
|
||||
/>
|
||||
<el-table-column prop="itemCode" label="项目编码" min-width="140" align="center" />
|
||||
<el-table-column prop="itemName" label="项目名称" min-width="160" align="center" />
|
||||
<el-table-column
|
||||
prop="description"
|
||||
label="描述"
|
||||
min-width="200"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column prop="status" label="状态" min-width="90" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.status === '1' ? 'success' : 'info'" size="small">{{
|
||||
row.status === '1' ? '启用' : '停用'
|
||||
}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
min-width="120"
|
||||
fixed="right"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<div style="display: flex; justify-content: center; gap: 8px">
|
||||
<el-button class="btn-op-item" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-dropdown trigger="hover" @command="(cmd: string) => handleDropdownCommand(cmd, row)">
|
||||
<el-button class="btn-op-item">
|
||||
<el-icon><More /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="edit">
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="delete" divided>
|
||||
<el-icon><Delete /></el-icon>删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination list-pager-bar">
|
||||
<el-pagination
|
||||
:current-page="pagination.page"
|
||||
:page-size="pagination.pageSize"
|
||||
:total="pagination.total"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="(v) => ((pagination.page = 1), (pagination.pageSize = v), loadData())"
|
||||
@current-change="(v) => ((pagination.page = v), loadData())"
|
||||
/>
|
||||
</div>
|
||||
<!-- 维度 2:第三方检测公司及项目 -->
|
||||
<ThirdPartyCompanyTab @meta-change="onThirdPartyMetaChange" />
|
||||
</div>
|
||||
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogTitle"
|
||||
width="840px"
|
||||
class="dialog-form-layout"
|
||||
align-center
|
||||
class="dialog-form-layout lab-test-item-form-dialog"
|
||||
modal-class="lab-test-item-dialog-mask"
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
@@ -167,7 +144,6 @@
|
||||
<el-input v-model="formData.remark" type="textarea" :rows="2" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<!-- 参数配置 -->
|
||||
<div class="form-section" style="margin-top: 8px">
|
||||
<div class="section-title">参数配置</div>
|
||||
<div class="param-row param-row-header">
|
||||
@@ -210,22 +186,27 @@
|
||||
<el-option label="数字" value="number" />
|
||||
</el-select>
|
||||
<el-switch v-model="param.requiredFlag" active-value="1" inactive-value="0" />
|
||||
<el-button class="btn-op-item" @click="removeParam(idx)"
|
||||
><el-icon><Delete /></el-icon
|
||||
></el-button>
|
||||
<el-button class="btn-op-item" @click="removeParam(idx)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
<el-button type="primary" plain style="margin-top: 8px" @click="addParam"
|
||||
><el-icon><Plus /></el-icon>添加参数</el-button
|
||||
>
|
||||
<el-button type="primary" plain style="margin-top: 8px" @click="addParam">
|
||||
<el-icon><Plus /></el-icon>添加参数
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button class="btn-ghost" @click="dialogVisible = false"
|
||||
><el-icon><Close /></el-icon>取消</el-button
|
||||
>
|
||||
<el-button class="btn-main" type="primary" :loading="submitLoading" @click="handleSubmit"
|
||||
><el-icon><Check /></el-icon>确定</el-button
|
||||
<el-button class="btn-ghost" @click="dialogVisible = false">
|
||||
<el-icon><Close /></el-icon>取消
|
||||
</el-button>
|
||||
<el-button
|
||||
class="btn-main"
|
||||
type="primary"
|
||||
:loading="submitLoading"
|
||||
@click="handleSubmit"
|
||||
>
|
||||
<el-icon><Check /></el-icon>确定
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
@@ -235,13 +216,9 @@
|
||||
:icon="Notebook"
|
||||
:meta="viewItemCode || undefined"
|
||||
:sections="viewSections"
|
||||
append-to-body
|
||||
modal-class="lab-test-item-dialog-mask"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="第三方检测公司及项目" name="third-party" lazy>
|
||||
<ThirdPartyCompanyTab />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -253,13 +230,12 @@
|
||||
Plus,
|
||||
Close,
|
||||
Check,
|
||||
Search,
|
||||
RefreshLeft,
|
||||
View,
|
||||
Edit,
|
||||
Delete,
|
||||
More,
|
||||
Notebook
|
||||
Notebook,
|
||||
OfficeBuilding,
|
||||
Document
|
||||
} from '@element-plus/icons-vue'
|
||||
import SystemViewDialog, {
|
||||
type ViewSection
|
||||
@@ -277,11 +253,19 @@
|
||||
|
||||
defineOptions({ name: 'QualityInspectionLabTestItem' })
|
||||
|
||||
const route = useRoute()
|
||||
const activeTab = ref('lab')
|
||||
const KANBAN_PAGE_SIZE = 100
|
||||
|
||||
const unitOptions = ref<{ label: string; value: string }[]>([])
|
||||
const unitOptionsLoading = ref(false)
|
||||
|
||||
const companyTotal = ref(0)
|
||||
const itemTotal = ref(0)
|
||||
|
||||
function onThirdPartyMetaChange(payload: { companyTotal: number; itemTotal: number }) {
|
||||
companyTotal.value = payload.companyTotal
|
||||
itemTotal.value = payload.itemTotal
|
||||
}
|
||||
|
||||
function mapUnitOption(u: { unitName?: string; unitCode?: string }) {
|
||||
const name = (u.unitName || '').trim()
|
||||
const code = (u.unitCode || '').trim()
|
||||
@@ -317,9 +301,8 @@
|
||||
|
||||
const searchForm = reactive({ keyword: '', status: '' })
|
||||
const tableData = ref<QcLabTestItem[]>([])
|
||||
const selectedRows = ref<QcLabTestItem[]>([])
|
||||
const loading = ref(false)
|
||||
const pagination = reactive({ page: 1, pageSize: 10, total: 0 })
|
||||
const labTotal = ref(0)
|
||||
const dialogVisible = ref(false)
|
||||
const dialogTitle = ref('新增项目')
|
||||
const isEdit = ref(false)
|
||||
@@ -362,28 +345,22 @@
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await fetchQcLabTestItemList({
|
||||
page: pagination.page,
|
||||
pageSize: pagination.pageSize,
|
||||
page: 1,
|
||||
pageSize: KANBAN_PAGE_SIZE,
|
||||
keyword: searchForm.keyword || undefined,
|
||||
status: searchForm.status || undefined
|
||||
})
|
||||
tableData.value = res.list || []
|
||||
pagination.total = res.total ?? 0
|
||||
labTotal.value = res.total ?? 0
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
}
|
||||
function handleReset() {
|
||||
searchForm.keyword = ''
|
||||
searchForm.status = ''
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
Object.assign(formData, {
|
||||
itemCode: '',
|
||||
@@ -395,6 +372,7 @@
|
||||
editingId.value = null
|
||||
itemParams.value = []
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
isEdit.value = false
|
||||
dialogTitle.value = '新增项目'
|
||||
@@ -402,6 +380,7 @@
|
||||
dialogVisible.value = true
|
||||
void searchUnitOptions('')
|
||||
}
|
||||
|
||||
function handleEdit(row: QcLabTestItem) {
|
||||
isEdit.value = true
|
||||
dialogTitle.value = '编辑项目'
|
||||
@@ -426,6 +405,7 @@
|
||||
dialogVisible.value = true
|
||||
void searchUnitOptions('')
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
if (!(await formRef.value?.validate?.().catch(() => false))) return
|
||||
submitLoading.value = true
|
||||
@@ -453,6 +433,7 @@
|
||||
submitLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleView(row: QcLabTestItem) {
|
||||
viewItemName.value = row.itemName || ''
|
||||
viewItemCode.value = row.itemCode || ''
|
||||
@@ -477,35 +458,158 @@
|
||||
]
|
||||
viewVisible.value = true
|
||||
}
|
||||
function handleDropdownCommand(command: string, row: QcLabTestItem) {
|
||||
if (command === 'edit') handleEdit(row)
|
||||
else if (command === 'delete') handleDelete(row)
|
||||
}
|
||||
|
||||
async function handleDelete(row: QcLabTestItem) {
|
||||
await ElMessageBox.confirm(`确定删除「${row.itemName}」?`, '提示', { type: 'warning' })
|
||||
try {
|
||||
await ElMessageBox.confirm(`确定删除「${row.itemName}」?`, '提示', { type: 'warning' })
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
await fetchDeleteQcLabTestItem(row.id)
|
||||
ElMessage.success('已删除')
|
||||
loadData()
|
||||
}
|
||||
// 输入检索条件时自动搜索(防抖 300ms)
|
||||
|
||||
watchDebounced(
|
||||
searchForm,
|
||||
() => [searchForm.keyword, searchForm.status],
|
||||
() => {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
},
|
||||
{ debounce: 300, deep: true }
|
||||
{ debounce: 300 }
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
const tab = route.query.tab
|
||||
if (tab === 'third-party') {
|
||||
activeTab.value = 'third-party'
|
||||
}
|
||||
loadData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.lab-test-stats {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 12px;
|
||||
padding: 16px 16px 0;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
min-height: 72px;
|
||||
padding: 12px 16px;
|
||||
border: 1px solid var(--mint-border, #d9e8e2);
|
||||
border-radius: 10px;
|
||||
background: var(--surface, #fff);
|
||||
box-shadow: 0 1px 3px rgb(0 0 0 / 5%);
|
||||
}
|
||||
|
||||
.stat-icon {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
|
||||
&--svg {
|
||||
border-radius: 10px;
|
||||
background: var(--primary-bg, #ecfdf5);
|
||||
color: var(--primary-dark, #059669);
|
||||
font-size: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
.stat-main {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.stat-k {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--mint-text, #1e293b);
|
||||
}
|
||||
|
||||
.stat-v {
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
color: var(--primary-dark, #059669);
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
.kanban {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 12px;
|
||||
padding: 16px;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.kanban-col--span-2 {
|
||||
grid-column: 2 / -1;
|
||||
}
|
||||
|
||||
.kanban-col {
|
||||
min-width: 0;
|
||||
background: var(--table-head, #f8fafc);
|
||||
border: 1px solid var(--mint-border, #d9e8e2);
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: calc(100vh - 280px);
|
||||
max-height: calc(100vh - 200px);
|
||||
}
|
||||
|
||||
.kanban-col-hd {
|
||||
padding: 10px 12px;
|
||||
border-bottom: 1px solid var(--mint-border, #d9e8e2);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.kanban-col-title {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--mint-text, #1e293b);
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.kanban-count {
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
padding: 2px 8px;
|
||||
border-radius: 999px;
|
||||
background: var(--surface, #fff);
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
border: 1px solid var(--mint-border, #d9e8e2);
|
||||
}
|
||||
|
||||
.kanban-add-btn {
|
||||
flex-shrink: 0;
|
||||
height: 32px;
|
||||
padding: 0 10px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.kanban-list {
|
||||
padding: 10px;
|
||||
overflow-y: auto;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
@import './lab-test-kanban.scss';
|
||||
|
||||
.biz-dialog-form .form-grid-3 + .form-grid-2 {
|
||||
margin-top: 12px;
|
||||
}
|
||||
@@ -543,4 +647,35 @@
|
||||
border-bottom: 1px solid #e2e8f0;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
.kanban {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.kanban-col--span-2 {
|
||||
grid-column: auto;
|
||||
}
|
||||
|
||||
.kanban-col {
|
||||
min-height: 320px;
|
||||
max-height: 420px;
|
||||
}
|
||||
|
||||
.lab-test-stats {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- 弹窗 teleport 到 body,顶距类名不可 scoped -->
|
||||
<style lang="scss">
|
||||
.lab-test-item-dialog-mask {
|
||||
align-items: flex-start !important;
|
||||
|
||||
.el-overlay-dialog {
|
||||
margin-top: 10px;
|
||||
margin-bottom: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,274 @@
|
||||
@import '../../pilot-service/cell-product-type/cell-product-kanban.scss';
|
||||
|
||||
.kanban-col-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.entity-card--selected {
|
||||
border-color: rgb(16 185 129 / 55%);
|
||||
background: var(--primary-bg, #ecfdf5);
|
||||
box-shadow: 0 2px 8px rgb(16 185 129 / 10%);
|
||||
}
|
||||
|
||||
.entity-card-ft-actions--3 {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.kanban-col-placeholder {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
padding: 32px 16px;
|
||||
margin: 10px;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
border: 1px dashed var(--mint-border, #d9e8e2);
|
||||
border-radius: 10px;
|
||||
background: rgb(255 255 255 / 60%);
|
||||
}
|
||||
|
||||
.kanban-col-placeholder__hint {
|
||||
font-size: 11px;
|
||||
color: #94a3b8;
|
||||
}
|
||||
|
||||
.kanban-col--span-2 {
|
||||
grid-column: 2 / -1;
|
||||
}
|
||||
|
||||
.kanban-col-search-row {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 120px;
|
||||
gap: 8px;
|
||||
padding: 8px 10px 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.kanban-list--merged {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.entity-card--group {
|
||||
align-self: stretch;
|
||||
cursor: default;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
|
||||
&:hover {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.entity-card-body {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.entity-card-title {
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.entity-card-top-actions {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 8px;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.entity-card-icon-btn {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
border: none !important;
|
||||
background: transparent !important;
|
||||
box-shadow: none !important;
|
||||
font-size: 14px;
|
||||
color: #94a3b8 !important;
|
||||
|
||||
&:hover,
|
||||
&:focus-visible {
|
||||
border: none !important;
|
||||
background: transparent !important;
|
||||
box-shadow: none !important;
|
||||
color: var(--mint-text, #1e293b) !important;
|
||||
}
|
||||
|
||||
&--danger:hover,
|
||||
&--danger:focus-visible {
|
||||
color: #dc2626 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.entity-card-hd {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 10px;
|
||||
min-height: 72px;
|
||||
}
|
||||
|
||||
.entity-card-hd-main {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.entity-card-media {
|
||||
flex-shrink: 0;
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--mint-border, #d9e8e2);
|
||||
background: var(--surface, #fff);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.entity-card-media-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
|
||||
:deep(.el-image__inner) {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
|
||||
.entity-card-media-placeholder {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.entity-card--group .entity-card-hd-main .entity-card-title {
|
||||
padding-right: 84px;
|
||||
}
|
||||
|
||||
.entity-card-nested {
|
||||
margin: 8px 0 10px;
|
||||
padding: 10px;
|
||||
border: 1px solid var(--mint-border, #d9e8e2);
|
||||
border-radius: 8px;
|
||||
background: var(--table-head, #f8fafc);
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.entity-card-nested-body {
|
||||
flex: 1;
|
||||
min-height: 118px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.entity-card-nested-hd {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.entity-card-nested-actions {
|
||||
margin-left: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.nested-action-btn {
|
||||
height: 26px;
|
||||
padding: 0 8px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.entity-card-nested-label {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
.entity-card-nested-list--scroll {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
gap: 10px;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding-bottom: 6px;
|
||||
scroll-snap-type: x proximity;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
scrollbar-width: thin;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
border-radius: 999px;
|
||||
background: rgb(148 163 184 / 45%);
|
||||
}
|
||||
|
||||
.entity-card--nested {
|
||||
flex: 0 0 calc(50% - 5px);
|
||||
min-width: 148px;
|
||||
scroll-snap-align: start;
|
||||
}
|
||||
}
|
||||
|
||||
.entity-card--nested {
|
||||
align-self: stretch;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.entity-card-nested-empty {
|
||||
flex: 1;
|
||||
min-height: 118px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 12px 8px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
border: 1px dashed var(--mint-border, #d9e8e2);
|
||||
border-radius: 8px;
|
||||
background: rgb(255 255 255 / 50%);
|
||||
}
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
.kanban-list--merged {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.entity-card-nested-list--scroll .entity-card--nested {
|
||||
flex-basis: min(280px, 72%);
|
||||
max-width: min(280px, 72%);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -165,14 +165,16 @@
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="!mineOnly"
|
||||
prop="qcTaskNo"
|
||||
label="关联任务号"
|
||||
min-width="160"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">
|
||||
{{ row.qcTaskNo || '-' }}
|
||||
{{ displayQcTaskNo(row) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@@ -243,15 +245,25 @@
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
min-width="160"
|
||||
min-width="280"
|
||||
fixed="right"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-button class="btn-op-item" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<div class="table-op-btns">
|
||||
<el-button class="btn-op-item" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="canMarkFullyUsed(row)"
|
||||
class="btn-op-item"
|
||||
:loading="markFullyUsedLoadingId === row.id"
|
||||
@click="handleMarkFullyUsed(row)"
|
||||
>
|
||||
<el-icon><CircleCheck /></el-icon>标记已使用完
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -331,11 +343,13 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { Search, RefreshLeft, View, Document } from '@element-plus/icons-vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Search, RefreshLeft, View, Document, CircleCheck } from '@element-plus/icons-vue'
|
||||
import {
|
||||
fetchMyQcMaterialUsageList,
|
||||
fetchQcMaterialUsageList,
|
||||
fetchQcMaterialLinkedTaskUsages
|
||||
fetchQcMaterialLinkedTaskUsages,
|
||||
fetchMarkQcMaterialUsageFullyUsed
|
||||
} from '@/api/qc-material-usage'
|
||||
import type { QcMaterialUsage } from '@/api/qc-material-usage'
|
||||
import { fetchQcMaterialOptions } from '@/api/qc-material'
|
||||
@@ -419,6 +433,11 @@
|
||||
return Math.abs(Number(row.changeQty) || 0)
|
||||
}
|
||||
|
||||
function displayQcTaskNo(row: QcMaterialUsage) {
|
||||
const taskNo = (row.qcTaskNo || '').trim()
|
||||
return taskNo || '—'
|
||||
}
|
||||
|
||||
function displayStockBefore(row: QcMaterialUsage) {
|
||||
if (row.stockBefore != null) return row.stockBefore
|
||||
const after = Number(row.stockAfter ?? 0)
|
||||
@@ -458,6 +477,32 @@
|
||||
return sourceType || '-'
|
||||
}
|
||||
|
||||
const markFullyUsedLoadingId = ref('')
|
||||
|
||||
function canMarkFullyUsed(row: QcMaterialUsage) {
|
||||
return isManualOutRow(row) && (row.requisitionStatus || 'open') !== 'closed'
|
||||
}
|
||||
|
||||
async function handleMarkFullyUsed(row: QcMaterialUsage) {
|
||||
try {
|
||||
await ElMessageBox.confirm('确认该领用记录已全部使用完?标记后将不再出现在盘点待登记列表。', '标记已使用完', {
|
||||
type: 'warning',
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消'
|
||||
})
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
markFullyUsedLoadingId.value = row.id
|
||||
try {
|
||||
await fetchMarkQcMaterialUsageFullyUsed(row.id)
|
||||
row.requisitionStatus = 'closed'
|
||||
ElMessage.success('已标记为使用完')
|
||||
} finally {
|
||||
markFullyUsedLoadingId.value = ''
|
||||
}
|
||||
}
|
||||
|
||||
async function loadMaterialOptions() {
|
||||
try {
|
||||
const res = await fetchQcMaterialOptions()
|
||||
@@ -551,7 +596,7 @@
|
||||
},
|
||||
{ label: '变动前库存', value: String(displayStockBefore(row)) },
|
||||
{ label: '变动后库存', value: String(row.stockAfter ?? 0) },
|
||||
{ label: '关联任务号', value: row.qcTaskNo || '—' },
|
||||
{ label: '关联任务号', value: displayQcTaskNo(row) },
|
||||
{
|
||||
label: '来源类型',
|
||||
value: getSourceLabel(row.sourceType),
|
||||
@@ -627,3 +672,11 @@
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.table-op-btns {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
}
|
||||
</style>
|
||||
@@ -7,8 +7,24 @@
|
||||
<h2>质检物料库</h2>
|
||||
</div>
|
||||
|
||||
<el-tabs v-model="activeTab" class="panel-tabs">
|
||||
<el-tab-pane label="物料列表" name="list">
|
||||
<div class="panel-pill-tabs">
|
||||
<div class="panel-pill-tabs__track" role="tablist">
|
||||
<button
|
||||
v-for="tab in QC_MATERIAL_TABS"
|
||||
:key="tab.name"
|
||||
type="button"
|
||||
role="tab"
|
||||
class="panel-pill-tabs__btn"
|
||||
:class="{ 'is-active': activeTab === tab.name }"
|
||||
:aria-selected="activeTab === tab.name"
|
||||
@click="handleTabChange(tab.name)"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-show="activeTab === 'list'" class="panel-track-pane">
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
@@ -1105,16 +1121,15 @@
|
||||
<p v-else class="view-empty-hint">暂无领用记录</p>
|
||||
</template>
|
||||
</SystemViewDialog>
|
||||
</el-tab-pane>
|
||||
</div>
|
||||
|
||||
<el-tab-pane label="变动记录" name="usage" lazy>
|
||||
<QcMaterialUsageTab />
|
||||
</el-tab-pane>
|
||||
<div v-show="activeTab === 'usage'" class="panel-track-pane">
|
||||
<QcMaterialUsageTab v-if="usageTabMounted" />
|
||||
</div>
|
||||
|
||||
<el-tab-pane label="库存盘点" name="stockCheck" lazy>
|
||||
<QcMaterialStockCheckTab />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div v-show="activeTab === 'stockCheck'" class="panel-track-pane">
|
||||
<QcMaterialStockCheckTab v-if="stockCheckTabMounted" />
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1162,7 +1177,26 @@
|
||||
defineOptions({ name: 'QualityInspectionQcMaterial' })
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const QC_MATERIAL_TABS = [
|
||||
{ name: 'list', label: '物料列表' },
|
||||
{ name: 'usage', label: '变动记录' },
|
||||
{ name: 'stockCheck', label: '库存盘点' }
|
||||
] as const
|
||||
|
||||
const activeTab = ref('list')
|
||||
const usageTabMounted = ref(false)
|
||||
const stockCheckTabMounted = ref(false)
|
||||
|
||||
function ensureTabMounted(tab: string) {
|
||||
if (tab === 'usage') usageTabMounted.value = true
|
||||
if (tab === 'stockCheck') stockCheckTabMounted.value = true
|
||||
}
|
||||
|
||||
function handleTabChange(name: string) {
|
||||
activeTab.value = name
|
||||
ensureTabMounted(name)
|
||||
}
|
||||
const searchForm = reactive({ keyword: '', status: '' })
|
||||
const tableRef = ref()
|
||||
const tableData = ref<QcMaterialBatch[]>([])
|
||||
@@ -2203,8 +2237,9 @@
|
||||
|
||||
onMounted(() => {
|
||||
const tab = route.query.tab
|
||||
if (tab === 'usage') {
|
||||
activeTab.value = 'usage'
|
||||
if (tab === 'usage' || tab === 'stockCheck') {
|
||||
activeTab.value = tab as string
|
||||
ensureTabMounted(tab as string)
|
||||
}
|
||||
loadData()
|
||||
})
|
||||
|
||||
@@ -7,15 +7,22 @@
|
||||
<h2 class="title-bar-heading">质检工单</h2>
|
||||
</div>
|
||||
|
||||
<el-tabs
|
||||
v-model="activeTypeTab"
|
||||
class="work-order-type-tabs"
|
||||
@tab-change="handleTypeTabChange"
|
||||
>
|
||||
<el-tab-pane label="入库质检工单" name="inbound" />
|
||||
<el-tab-pane label="出库质检工单" name="outbound" />
|
||||
<el-tab-pane label="临时质检工单" name="temporary" />
|
||||
</el-tabs>
|
||||
<div class="panel-pill-tabs">
|
||||
<div class="panel-pill-tabs__track" role="tablist">
|
||||
<button
|
||||
v-for="tab in WORK_ORDER_TYPE_TABS"
|
||||
:key="tab.name"
|
||||
type="button"
|
||||
role="tab"
|
||||
class="panel-pill-tabs__btn"
|
||||
:class="{ 'is-active': activeTypeTab === tab.name }"
|
||||
:aria-selected="activeTypeTab === tab.name"
|
||||
@click="handleTabChange(tab.name)"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
@@ -536,6 +543,13 @@
|
||||
const taskSubListRefreshToken = ref(0)
|
||||
|
||||
type WorkOrderTypeTab = 'inbound' | 'temporary' | 'outbound' | 'all'
|
||||
|
||||
const WORK_ORDER_TYPE_TABS = [
|
||||
{ name: 'inbound', label: '入库质检工单' },
|
||||
{ name: 'outbound', label: '出库质检工单' },
|
||||
{ name: 'temporary', label: '临时质检工单' }
|
||||
] as const
|
||||
|
||||
const activeTypeTab = ref<WorkOrderTypeTab>('inbound')
|
||||
const filterTimeLabel = computed(() =>
|
||||
activeTypeTab.value === 'outbound' ? '输注时间' : '创建时间'
|
||||
@@ -725,6 +739,12 @@
|
||||
loadData()
|
||||
}
|
||||
|
||||
function handleTabChange(name: WorkOrderTypeTab) {
|
||||
if (activeTypeTab.value === name) return
|
||||
activeTypeTab.value = name
|
||||
handleTypeTabChange()
|
||||
}
|
||||
|
||||
async function submitAdd() {
|
||||
await addFormRef.value?.validate()
|
||||
addLoading.value = true
|
||||
@@ -1487,11 +1507,6 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.work-order-type-tabs {
|
||||
padding: 0 16px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.qc-config-split {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
||||
|
||||
@@ -7,15 +7,22 @@
|
||||
<h2>{{ receivedOnly ? '样本接收信息完善' : '样本接收列表' }}</h2>
|
||||
</div>
|
||||
|
||||
<el-tabs
|
||||
v-if="!receivedOnly"
|
||||
v-model="activeTab"
|
||||
class="work-order-type-tabs"
|
||||
@tab-change="handleStatusTabChange"
|
||||
>
|
||||
<el-tab-pane label="待接收" name="pending" />
|
||||
<el-tab-pane label="已接收" name="received" />
|
||||
</el-tabs>
|
||||
<div v-if="!receivedOnly" class="panel-pill-tabs">
|
||||
<div class="panel-pill-tabs__track" role="tablist">
|
||||
<button
|
||||
v-for="tab in STATUS_TABS"
|
||||
:key="tab.name"
|
||||
type="button"
|
||||
role="tab"
|
||||
class="panel-pill-tabs__btn"
|
||||
:class="{ 'is-active': activeTab === tab.name }"
|
||||
:aria-selected="activeTab === tab.name"
|
||||
@click="handleTabChange(tab.name)"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
@@ -908,6 +915,12 @@
|
||||
defineOptions({ name: 'QualityInspectionSampleReception' })
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
const STATUS_TABS = [
|
||||
{ name: 'pending', label: '待接收' },
|
||||
{ name: 'received', label: '已接收' }
|
||||
] as const
|
||||
|
||||
const activeTab = ref(props.receivedOnly ? 'received' : 'pending')
|
||||
const searchForm = reactive({ keyword: '', sourceType: '' })
|
||||
|
||||
@@ -1552,6 +1565,12 @@
|
||||
loadData()
|
||||
}
|
||||
|
||||
function handleTabChange(name: string) {
|
||||
if (activeTab.value === name) return
|
||||
activeTab.value = name
|
||||
handleStatusTabChange()
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
@@ -1725,11 +1744,6 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.work-order-type-tabs {
|
||||
padding: 0 16px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.sample-reception-dialog {
|
||||
.detail-section-title {
|
||||
margin: 0 0 12px;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!-- 旧「第三方检测公司及项目」菜单入口:重定向至质检项目管理 · 第三方 Tab -->
|
||||
<!-- 旧「第三方检测公司及项目」菜单入口:重定向至质检项目管理 -->
|
||||
<template>
|
||||
<div />
|
||||
</template>
|
||||
@@ -12,7 +12,7 @@
|
||||
onMounted(() => {
|
||||
router.replace({
|
||||
name: 'QualityInspectionLabTestItem',
|
||||
query: { ...route.query, tab: 'third-party' }
|
||||
query: { ...route.query }
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@@ -49,87 +49,64 @@
|
||||
</div>
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<el-table
|
||||
class="list-table"
|
||||
:data="tableData"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
@row-dblclick="handleView"
|
||||
>
|
||||
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
min-width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
:index="(index) => (pagination.page - 1) * pagination.pageSize + index + 1"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="expressCode"
|
||||
label="快递编码"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="expressName"
|
||||
label="快递名称"
|
||||
min-width="140"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
label="创建时间"
|
||||
min-width="180"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
min-width="120"
|
||||
fixed="right"
|
||||
align="center"
|
||||
header-align="center"
|
||||
<div v-loading="loading" class="express-card-grid">
|
||||
<div
|
||||
v-for="row in tableData"
|
||||
:key="row.id"
|
||||
class="express-card"
|
||||
:class="{ 'is-selected': isRowSelected(row.id) }"
|
||||
@dblclick="handleView(row)"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<div style="display: flex; justify-content: center; gap: 8px">
|
||||
<el-button class="btn-op-item" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-dropdown trigger="hover" @command="(cmd: string) => handleDropdownCommand(cmd, row)">
|
||||
<el-button class="btn-op-item">
|
||||
<el-icon><More /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="edit">
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="delete" divided>
|
||||
<el-icon><Delete /></el-icon>删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<div class="express-card__select" @click.stop>
|
||||
<el-checkbox
|
||||
:model-value="isRowSelected(row.id)"
|
||||
@change="(val) => toggleRowSelection(row, !!val)"
|
||||
/>
|
||||
</div>
|
||||
<div class="express-card__media">
|
||||
<el-image
|
||||
v-if="row.expressLogo"
|
||||
:src="expressLogoUrl(row.expressLogo)"
|
||||
fit="cover"
|
||||
class="express-card__logo"
|
||||
/>
|
||||
<div v-else class="express-card__logo-placeholder">
|
||||
<el-icon><Van /></el-icon>
|
||||
<span>暂无Logo</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination list-pager-bar">
|
||||
<el-pagination
|
||||
:current-page="pagination.page"
|
||||
:page-size="pagination.pageSize"
|
||||
:total="pagination.total"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="(val) => ((pagination.page = 1), (pagination.pageSize = val), loadData())"
|
||||
@current-change="(val) => ((pagination.page = val), loadData())"
|
||||
/>
|
||||
</div>
|
||||
<div class="express-card__body">
|
||||
<div class="express-card__title" :title="row.expressName">{{ row.expressName }}</div>
|
||||
<div class="express-card__code">{{ row.expressCode }}</div>
|
||||
<div v-if="row.createTime" class="express-card__meta">{{ row.createTime }}</div>
|
||||
</div>
|
||||
<div class="express-card__footer">
|
||||
<el-button class="btn-op-item" @click.stop="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-dropdown trigger="hover" @command="(cmd) => handleDropdownCommand(cmd, row)">
|
||||
<el-button class="btn-op-item" @click.stop>
|
||||
<el-icon><More /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="edit">
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="delete" divided>
|
||||
<el-icon><Delete /></el-icon>删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-empty
|
||||
v-if="!loading && !tableData.length"
|
||||
description="暂无快递公司数据"
|
||||
:image-size="80"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<el-dialog
|
||||
@@ -157,6 +134,37 @@
|
||||
<el-form-item label="快递名称" prop="expressName">
|
||||
<el-input v-model="formData.expressName" placeholder="请输入快递名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="快递Logo" style="grid-column: 1 / -1">
|
||||
<div class="express-logo-row">
|
||||
<el-image
|
||||
v-if="formData.expressLogo"
|
||||
:src="expressLogoUrl(formData.expressLogo)"
|
||||
fit="cover"
|
||||
class="express-logo-preview"
|
||||
/>
|
||||
<div v-else class="express-logo-placeholder">暂无</div>
|
||||
<el-upload
|
||||
ref="expressLogoUploadRef"
|
||||
accept="image/*"
|
||||
:show-file-list="false"
|
||||
:auto-upload="false"
|
||||
:limit="1"
|
||||
:on-change="handleExpressLogoChange"
|
||||
:on-exceed="handleExpressLogoExceed"
|
||||
>
|
||||
<el-button type="primary" plain>
|
||||
<el-icon><Upload /></el-icon>上传Logo
|
||||
</el-button>
|
||||
</el-upload>
|
||||
<el-button
|
||||
v-if="formData.expressLogo"
|
||||
class="btn-ghost"
|
||||
@click="formData.expressLogo = ''"
|
||||
>
|
||||
<el-icon><Delete /></el-icon>移除
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="formData.remark" placeholder="可选" />
|
||||
</el-form-item>
|
||||
@@ -180,7 +188,23 @@
|
||||
:icon="Van"
|
||||
:meta="viewRow?.createTime || ''"
|
||||
:sections="viewSections"
|
||||
/>
|
||||
>
|
||||
<template v-if="viewRow?.expressLogo" #express-logo>
|
||||
<dl class="express-view-kv-grid">
|
||||
<div class="express-view-kv">
|
||||
<dt>Logo</dt>
|
||||
<dd>
|
||||
<el-image
|
||||
:src="expressLogoUrl(viewRow.expressLogo)"
|
||||
fit="cover"
|
||||
class="express-view-logo"
|
||||
:preview-src-list="[expressLogoUrl(viewRow.expressLogo)]"
|
||||
/>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</template>
|
||||
</SystemViewDialog>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -188,8 +212,22 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, computed } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Plus, Close, Check, View, Van, RefreshLeft, Search, More, Edit, Delete } from '@element-plus/icons-vue'
|
||||
import {
|
||||
Plus,
|
||||
Close,
|
||||
Check,
|
||||
View,
|
||||
Van,
|
||||
RefreshLeft,
|
||||
Search,
|
||||
More,
|
||||
Edit,
|
||||
Delete,
|
||||
Upload
|
||||
} from '@element-plus/icons-vue'
|
||||
import type { UploadFile } from 'element-plus'
|
||||
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
|
||||
import { fetchUploadAttachment } from '@/api/business'
|
||||
import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
|
||||
import {
|
||||
fetchExpressCompanyList,
|
||||
@@ -200,11 +238,48 @@
|
||||
|
||||
defineOptions({ name: 'SystemExpress' })
|
||||
|
||||
const expressLogoUploadRef = ref()
|
||||
const minioBaseUrl = (import.meta.env.VITE_MINIO_BASE_URL || '').replace(/\/$/, '')
|
||||
|
||||
function expressLogoUrl(url: string) {
|
||||
if (!url) return ''
|
||||
if (url.startsWith('http://') || url.startsWith('https://') || url.startsWith('/')) return url
|
||||
return `${minioBaseUrl}/${url}`
|
||||
}
|
||||
|
||||
async function uploadExpressLogoFile(file: File) {
|
||||
try {
|
||||
const fd = new FormData()
|
||||
fd.append('folder', 'express-company')
|
||||
fd.append('file', file)
|
||||
const res = await fetchUploadAttachment(fd)
|
||||
formData.expressLogo = res.fileUrl || ''
|
||||
ElMessage.success('Logo上传成功')
|
||||
} catch (e) {
|
||||
console.error('快递Logo上传失败:', e)
|
||||
ElMessage.error('Logo上传失败')
|
||||
} finally {
|
||||
expressLogoUploadRef.value?.clearFiles()
|
||||
}
|
||||
}
|
||||
|
||||
const handleExpressLogoChange = async (uploadFile: UploadFile) => {
|
||||
const file: any = (uploadFile as any).raw
|
||||
if (!file) return
|
||||
const status = (uploadFile as any).status
|
||||
if (status && status !== 'ready') return
|
||||
await uploadExpressLogoFile(file)
|
||||
}
|
||||
|
||||
const handleExpressLogoExceed = (files: File[]) => {
|
||||
const file = files[0]
|
||||
if (file) uploadExpressLogoFile(file)
|
||||
}
|
||||
|
||||
const searchForm = reactive<{ keyword: string }>({ keyword: '' })
|
||||
const tableData = ref<Api.ExpressCompany.ExpressCompanyItem[]>([])
|
||||
const selectedRows = ref<Api.ExpressCompany.ExpressCompanyItem[]>([])
|
||||
const loading = ref(false)
|
||||
const pagination = reactive({ page: 1, pageSize: 10, total: 0 })
|
||||
const dialogVisible = ref(false)
|
||||
const dialogTitle = ref('新增快递公司')
|
||||
const isEdit = ref(false)
|
||||
@@ -217,6 +292,7 @@
|
||||
const formData = reactive({
|
||||
expressCode: '',
|
||||
expressName: '',
|
||||
expressLogo: '',
|
||||
orderNum: 0,
|
||||
remark: ''
|
||||
})
|
||||
@@ -226,8 +302,14 @@
|
||||
expressName: [{ required: true, message: '请输入快递名称', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
const handleSelectionChange = (rows: Api.ExpressCompany.ExpressCompanyItem[]) => {
|
||||
selectedRows.value = rows
|
||||
const isRowSelected = (id: string) => selectedRows.value.some((r) => r.id === id)
|
||||
|
||||
const toggleRowSelection = (row: Api.ExpressCompany.ExpressCompanyItem, checked: boolean) => {
|
||||
if (checked) {
|
||||
if (!isRowSelected(row.id)) selectedRows.value = [...selectedRows.value, row]
|
||||
return
|
||||
}
|
||||
selectedRows.value = selectedRows.value.filter((r) => r.id !== row.id)
|
||||
}
|
||||
|
||||
const viewSections = computed(() => {
|
||||
@@ -241,7 +323,17 @@
|
||||
{ label: '快递名称', value: row.expressName },
|
||||
{ label: '备注', value: row.remark, span: true }
|
||||
]
|
||||
}
|
||||
},
|
||||
row.expressLogo
|
||||
? {
|
||||
title: '快递Logo',
|
||||
fields: [],
|
||||
slot: 'express-logo'
|
||||
}
|
||||
: {
|
||||
title: '快递Logo',
|
||||
fields: [{ label: 'Logo', value: '无' }]
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
@@ -249,31 +341,31 @@
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await fetchExpressCompanyList({
|
||||
page: pagination.page,
|
||||
pageSize: pagination.pageSize,
|
||||
page: 1,
|
||||
pageSize: 100,
|
||||
keyword: searchForm.keyword || undefined
|
||||
})
|
||||
tableData.value = res.list || []
|
||||
pagination.total = res.total ?? 0
|
||||
const validIds = new Set(tableData.value.map((r) => r.id))
|
||||
selectedRows.value = selectedRows.value.filter((r) => validIds.has(r.id))
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
function handleReset() {
|
||||
searchForm.keyword = ''
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
formData.expressCode = ''
|
||||
formData.expressName = ''
|
||||
formData.expressLogo = ''
|
||||
formData.orderNum = 0
|
||||
formData.remark = ''
|
||||
editingId.value = null
|
||||
@@ -293,6 +385,7 @@
|
||||
editingId.value = row.id
|
||||
formData.expressCode = row.expressCode || ''
|
||||
formData.expressName = row.expressName || ''
|
||||
formData.expressLogo = row.expressLogo || ''
|
||||
formData.orderNum = row.orderNum ?? 0
|
||||
formData.remark = row.remark || ''
|
||||
dialogVisible.value = true
|
||||
@@ -306,6 +399,7 @@
|
||||
const payload = {
|
||||
expressCode: formData.expressCode.trim(),
|
||||
expressName: formData.expressName.trim(),
|
||||
expressLogo: formData.expressLogo?.trim() ?? '',
|
||||
orderNum: formData.orderNum,
|
||||
remark: formData.remark?.trim() || undefined
|
||||
}
|
||||
@@ -368,7 +462,6 @@
|
||||
watchDebounced(
|
||||
searchForm,
|
||||
() => {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
},
|
||||
{ debounce: 300, deep: true }
|
||||
@@ -385,4 +478,186 @@
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.express-logo-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.express-logo-preview {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--mint-border, #e2e8f0);
|
||||
}
|
||||
|
||||
.express-logo-placeholder {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 8px;
|
||||
border: 1px dashed var(--mint-border, #e2e8f0);
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
font-size: 12px;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.express-card-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
||||
gap: 16px;
|
||||
min-height: 120px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.express-card {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
border: 1px solid var(--mint-border, #e2e8f0);
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
|
||||
&:hover {
|
||||
border-color: #a8d4c4;
|
||||
box-shadow: 0 2px 12px rgba(4, 120, 87, 0.1);
|
||||
}
|
||||
|
||||
&.is-selected {
|
||||
border-color: var(--mint-primary, #10b981);
|
||||
box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25);
|
||||
}
|
||||
}
|
||||
|
||||
.express-card__select {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.express-card__media {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 136px;
|
||||
padding: 16px 16px 8px;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.express-card__logo {
|
||||
display: block;
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid var(--mint-border, #e2e8f0);
|
||||
background: #fff;
|
||||
|
||||
:deep(.el-image__inner),
|
||||
:deep(img) {
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.express-card__logo-placeholder {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
border-radius: 10px;
|
||||
border: 1px dashed var(--mint-border, #e2e8f0);
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
font-size: 12px;
|
||||
background: #fff;
|
||||
|
||||
.el-icon {
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
.express-card__body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
flex: 1;
|
||||
padding: 10px 16px 8px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.express-card__title {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: var(--mint-text, #0f172a);
|
||||
line-height: 1.4;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.express-card__code {
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
.express-card__meta {
|
||||
margin-top: 2px;
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
}
|
||||
|
||||
.express-card__footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
padding: 10px 16px 14px;
|
||||
border-top: 1px solid var(--mint-border, #e2e8f0);
|
||||
}
|
||||
|
||||
.express-view-kv-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 12px 20px;
|
||||
}
|
||||
|
||||
.express-view-kv {
|
||||
display: grid;
|
||||
grid-template-columns: 96px 1fr;
|
||||
gap: 8px 12px;
|
||||
font-size: 13px;
|
||||
align-items: start;
|
||||
|
||||
dt {
|
||||
margin: 0;
|
||||
color: #64748b;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin: 0;
|
||||
color: #1e293b;
|
||||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
.express-view-logo {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e2e8f0;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
@@ -49,133 +49,81 @@
|
||||
</div>
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<el-table
|
||||
class="list-table"
|
||||
:data="tableData"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
@row-dblclick="handleView"
|
||||
>
|
||||
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
min-width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
:index="(index) => (pagination.page - 1) * pagination.pageSize + index + 1"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="siteName"
|
||||
label="站点名称"
|
||||
min-width="140"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="siteCode"
|
||||
label="站点编码"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="siteType"
|
||||
label="站点类型"
|
||||
min-width="100"
|
||||
align="center"
|
||||
header-align="center"
|
||||
<div v-loading="loading" class="site-card-grid">
|
||||
<div
|
||||
v-for="row in tableData"
|
||||
:key="row.id"
|
||||
class="site-card"
|
||||
:class="{ 'is-selected': isRowSelected(row.id) }"
|
||||
@dblclick="handleView(row)"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
{{ getSiteTypeLabel(row.siteType) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="status"
|
||||
label="状态"
|
||||
min-width="80"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.status === '1' ? 'success' : 'info'" size="small">
|
||||
{{ row.status === '1' ? '正常' : '停用' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="address"
|
||||
label="地址"
|
||||
min-width="160"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="contactName"
|
||||
label="联系人"
|
||||
min-width="100"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="contactPhone"
|
||||
label="联系电话"
|
||||
min-width="140"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
label="创建时间"
|
||||
min-width="180"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
min-width="120"
|
||||
fixed="right"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<div style="display: flex; justify-content: center; gap: 8px">
|
||||
<el-button class="btn-op-item" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-dropdown trigger="hover" @command="(cmd: string) => handleDropdownCommand(cmd, row)">
|
||||
<el-button class="btn-op-item">
|
||||
<el-icon><More /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="edit">
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="delete" divided>
|
||||
<el-icon><Delete /></el-icon>删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<div class="site-card__select" @click.stop>
|
||||
<el-checkbox
|
||||
:model-value="isRowSelected(row.id)"
|
||||
@change="(val) => toggleRowSelection(row, !!val)"
|
||||
/>
|
||||
</div>
|
||||
<div class="site-card__media">
|
||||
<el-image
|
||||
v-if="row.siteImage"
|
||||
:src="siteImageUrl(row.siteImage)"
|
||||
fit="cover"
|
||||
class="site-card__image"
|
||||
/>
|
||||
<div v-else class="site-card__image-placeholder">
|
||||
<el-icon><Picture /></el-icon>
|
||||
<span>暂无图片</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination list-pager-bar">
|
||||
<el-pagination
|
||||
:current-page="pagination.page"
|
||||
:page-size="pagination.pageSize"
|
||||
:total="pagination.total"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="(val) => ((pagination.page = 1), (pagination.pageSize = val), loadData())"
|
||||
@current-change="(val) => ((pagination.page = val), loadData())"
|
||||
/>
|
||||
</div>
|
||||
<div class="site-card__body">
|
||||
<div class="site-card__title" :title="row.siteName">{{ row.siteName }}</div>
|
||||
<div class="site-card__code">{{ row.siteCode }}</div>
|
||||
<div class="site-card__tags">
|
||||
<el-tag v-if="row.siteType" type="primary" size="small">
|
||||
{{ getSiteTypeLabel(row.siteType) }}
|
||||
</el-tag>
|
||||
<el-tag :type="row.status === '1' ? 'success' : 'info'" size="small">
|
||||
{{ row.status === '1' ? '正常' : '停用' }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div class="site-card__meta">
|
||||
<div v-if="row.address" class="site-card__meta-item" :title="row.address">
|
||||
<el-icon><Location /></el-icon>
|
||||
<span>{{ row.address }}</span>
|
||||
</div>
|
||||
<div v-if="row.contactName || row.contactPhone" class="site-card__meta-item">
|
||||
<el-icon><User /></el-icon>
|
||||
<span>{{ [row.contactName, row.contactPhone].filter(Boolean).join(' · ') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="site-card__footer">
|
||||
<el-button class="btn-op-item" @click.stop="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-dropdown trigger="hover" @command="(cmd) => handleDropdownCommand(cmd, row)">
|
||||
<el-button class="btn-op-item" @click.stop>
|
||||
<el-icon><More /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="edit">
|
||||
<el-icon><Edit /></el-icon>编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="delete" divided>
|
||||
<el-icon><Delete /></el-icon>删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-empty
|
||||
v-if="!loading && !tableData.length"
|
||||
description="暂无站点数据"
|
||||
:image-size="80"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<el-dialog
|
||||
@@ -227,6 +175,37 @@
|
||||
<el-form-item label="地址" style="grid-column: 1 / -1">
|
||||
<el-input v-model="formData.address" placeholder="请输入地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="站点图片" style="grid-column: 1 / -1">
|
||||
<div class="site-image-row">
|
||||
<el-image
|
||||
v-if="formData.siteImage"
|
||||
:src="siteImageUrl(formData.siteImage)"
|
||||
fit="cover"
|
||||
class="site-image-preview"
|
||||
/>
|
||||
<div v-else class="site-image-placeholder">暂无</div>
|
||||
<el-upload
|
||||
ref="siteImageUploadRef"
|
||||
accept="image/*"
|
||||
:show-file-list="false"
|
||||
:auto-upload="false"
|
||||
:limit="1"
|
||||
:on-change="handleSiteImageChange"
|
||||
:on-exceed="handleSiteImageExceed"
|
||||
>
|
||||
<el-button type="primary" plain>
|
||||
<el-icon><Upload /></el-icon>上传图片
|
||||
</el-button>
|
||||
</el-upload>
|
||||
<el-button
|
||||
v-if="formData.siteImage"
|
||||
class="btn-ghost"
|
||||
@click="formData.siteImage = ''"
|
||||
>
|
||||
<el-icon><Delete /></el-icon>移除
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人">
|
||||
<el-select
|
||||
v-model="contactUserId"
|
||||
@@ -292,7 +271,23 @@
|
||||
:icon="Location"
|
||||
:meta="`站点编码:${viewRow?.siteCode || ''}${viewRow?.createTime ? ' · ' + viewRow.createTime : ''}`"
|
||||
:sections="viewSections"
|
||||
/>
|
||||
>
|
||||
<template v-if="viewRow?.siteImage" #site-image>
|
||||
<dl class="site-view-kv-grid">
|
||||
<div class="site-view-kv">
|
||||
<dt>图片</dt>
|
||||
<dd>
|
||||
<el-image
|
||||
:src="siteImageUrl(viewRow.siteImage)"
|
||||
fit="cover"
|
||||
class="site-view-image"
|
||||
:preview-src-list="[siteImageUrl(viewRow.siteImage)]"
|
||||
/>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</template>
|
||||
</SystemViewDialog>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -300,9 +295,25 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted, nextTick } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Plus, Close, Check, View, Edit, Delete, More, Location, RefreshLeft, Search } from '@element-plus/icons-vue'
|
||||
import {
|
||||
Plus,
|
||||
Close,
|
||||
Check,
|
||||
View,
|
||||
Edit,
|
||||
Delete,
|
||||
More,
|
||||
Location,
|
||||
RefreshLeft,
|
||||
Search,
|
||||
Picture,
|
||||
User,
|
||||
Upload
|
||||
} from '@element-plus/icons-vue'
|
||||
import type { UploadFile } from 'element-plus'
|
||||
import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
|
||||
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
|
||||
import { fetchUploadAttachment } from '@/api/business'
|
||||
import {
|
||||
fetchSiteList,
|
||||
fetchCreateSite,
|
||||
@@ -314,6 +325,44 @@
|
||||
|
||||
defineOptions({ name: 'SystemSite' })
|
||||
|
||||
const siteImageUploadRef = ref()
|
||||
const minioBaseUrl = (import.meta.env.VITE_MINIO_BASE_URL || '').replace(/\/$/, '')
|
||||
|
||||
function siteImageUrl(url: string) {
|
||||
if (!url) return ''
|
||||
if (url.startsWith('http://') || url.startsWith('https://') || url.startsWith('/')) return url
|
||||
return `${minioBaseUrl}/${url}`
|
||||
}
|
||||
|
||||
async function uploadSiteImageFile(file: File) {
|
||||
try {
|
||||
const fd = new FormData()
|
||||
fd.append('folder', 'site')
|
||||
fd.append('file', file)
|
||||
const res = await fetchUploadAttachment(fd)
|
||||
formData.siteImage = res.fileUrl || ''
|
||||
ElMessage.success('图片上传成功')
|
||||
} catch (e) {
|
||||
console.error('站点图片上传失败:', e)
|
||||
ElMessage.error('图片上传失败')
|
||||
} finally {
|
||||
siteImageUploadRef.value?.clearFiles()
|
||||
}
|
||||
}
|
||||
|
||||
const handleSiteImageChange = async (uploadFile: UploadFile) => {
|
||||
const file: any = (uploadFile as any).raw
|
||||
if (!file) return
|
||||
const status = (uploadFile as any).status
|
||||
if (status && status !== 'ready') return
|
||||
await uploadSiteImageFile(file)
|
||||
}
|
||||
|
||||
const handleSiteImageExceed = (files: File[]) => {
|
||||
const file = files[0]
|
||||
if (file) uploadSiteImageFile(file)
|
||||
}
|
||||
|
||||
// ---- 查看弹窗 ----
|
||||
const viewVisible = ref(false)
|
||||
const viewRow = ref<Api.Site.SiteItem | null>(null)
|
||||
@@ -356,7 +405,17 @@
|
||||
{ label: '备注', value: row.remark, span: true },
|
||||
{ label: '创建时间', value: row.createTime }
|
||||
]
|
||||
}
|
||||
},
|
||||
row.siteImage
|
||||
? {
|
||||
title: '站点图片',
|
||||
fields: [],
|
||||
slot: 'site-image'
|
||||
}
|
||||
: {
|
||||
title: '站点图片',
|
||||
fields: [{ label: '图片', value: '无' }]
|
||||
}
|
||||
]
|
||||
})
|
||||
function handleView(row: Api.Site.SiteItem) {
|
||||
@@ -368,7 +427,6 @@
|
||||
const tableData = ref<Api.Site.SiteItem[]>([])
|
||||
const selectedRows = ref<Api.Site.SiteItem[]>([])
|
||||
const loading = ref(false)
|
||||
const pagination = reactive({ page: 1, pageSize: 10, total: 0 })
|
||||
const dialogVisible = ref(false)
|
||||
const dialogTitle = ref('新增站点')
|
||||
const isEdit = ref(false)
|
||||
@@ -385,6 +443,7 @@
|
||||
contactName: '',
|
||||
contactPhone: '',
|
||||
businessScopeList: [] as string[],
|
||||
siteImage: '',
|
||||
orderNum: 0,
|
||||
remark: ''
|
||||
})
|
||||
@@ -520,33 +579,38 @@
|
||||
return opt ? opt.label : code
|
||||
}
|
||||
|
||||
const handleSelectionChange = (rows: Api.Site.SiteItem[]) => {
|
||||
selectedRows.value = rows
|
||||
const isRowSelected = (id: string) => selectedRows.value.some((r) => r.id === id)
|
||||
|
||||
const toggleRowSelection = (row: Api.Site.SiteItem, checked: boolean) => {
|
||||
if (checked) {
|
||||
if (!isRowSelected(row.id)) selectedRows.value = [...selectedRows.value, row]
|
||||
return
|
||||
}
|
||||
selectedRows.value = selectedRows.value.filter((r) => r.id !== row.id)
|
||||
}
|
||||
|
||||
async function loadData() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await fetchSiteList({
|
||||
page: pagination.page,
|
||||
pageSize: pagination.pageSize,
|
||||
page: 1,
|
||||
pageSize: 100,
|
||||
keyword: searchForm.keyword || undefined
|
||||
})
|
||||
tableData.value = res.list || []
|
||||
pagination.total = res.total ?? 0
|
||||
const validIds = new Set(tableData.value.map((r) => r.id))
|
||||
selectedRows.value = selectedRows.value.filter((r) => validIds.has(r.id))
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
function handleReset() {
|
||||
searchForm.keyword = ''
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
@@ -559,6 +623,7 @@
|
||||
formData.contactName = ''
|
||||
formData.contactPhone = ''
|
||||
formData.businessScopeList = []
|
||||
formData.siteImage = ''
|
||||
formData.orderNum = 0
|
||||
formData.remark = ''
|
||||
editingId.value = null
|
||||
@@ -592,6 +657,7 @@
|
||||
formData.contactName = row.contactName || ''
|
||||
formData.contactPhone = row.contactPhone || ''
|
||||
formData.businessScopeList = row.businessScope ? row.businessScope.split(',') : []
|
||||
formData.siteImage = row.siteImage || ''
|
||||
formData.orderNum = row.orderNum ?? 0
|
||||
formData.remark = row.remark || ''
|
||||
dialogVisible.value = true
|
||||
@@ -616,6 +682,7 @@
|
||||
businessScope: formData.businessScopeList.length
|
||||
? formData.businessScopeList.join(',')
|
||||
: undefined,
|
||||
siteImage: formData.siteImage?.trim() ?? '',
|
||||
orderNum: formData.orderNum,
|
||||
remark: formData.remark?.trim() || undefined
|
||||
}
|
||||
@@ -671,7 +738,6 @@
|
||||
watchDebounced(
|
||||
searchForm,
|
||||
() => {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
},
|
||||
{ debounce: 300, deep: true }
|
||||
@@ -689,4 +755,209 @@
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.site-image-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.site-image-preview {
|
||||
width: 120px;
|
||||
height: 80px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--mint-border, #e2e8f0);
|
||||
}
|
||||
|
||||
.site-image-placeholder {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 120px;
|
||||
height: 80px;
|
||||
border-radius: 8px;
|
||||
border: 1px dashed var(--mint-border, #e2e8f0);
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
font-size: 12px;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.site-card-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
||||
gap: 16px;
|
||||
min-height: 120px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.site-card {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
border: 1px solid var(--mint-border, #e2e8f0);
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
|
||||
&:hover {
|
||||
border-color: #a8d4c4;
|
||||
box-shadow: 0 2px 12px rgba(4, 120, 87, 0.1);
|
||||
}
|
||||
|
||||
&.is-selected {
|
||||
border-color: var(--mint-primary, #10b981);
|
||||
box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25);
|
||||
}
|
||||
}
|
||||
|
||||
.site-card__select {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.site-card__media {
|
||||
width: 100%;
|
||||
height: 160px;
|
||||
flex-shrink: 0;
|
||||
background: #f1f5f9;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.site-card__image {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 160px;
|
||||
|
||||
:deep(.el-image__inner),
|
||||
:deep(img) {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.site-card__image-placeholder {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
width: 100%;
|
||||
height: 160px;
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
font-size: 12px;
|
||||
|
||||
.el-icon {
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
.site-card__body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
flex: 1;
|
||||
padding: 14px 16px 10px;
|
||||
}
|
||||
|
||||
.site-card__title {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: var(--mint-text, #0f172a);
|
||||
line-height: 1.4;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.site-card__code {
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
.site-card__tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.site-card__meta {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
margin-top: auto;
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
.site-card__meta-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 4px;
|
||||
line-height: 1.45;
|
||||
|
||||
.el-icon {
|
||||
flex-shrink: 0;
|
||||
margin-top: 2px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
span {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
}
|
||||
|
||||
.site-card__footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
padding: 10px 16px 14px;
|
||||
border-top: 1px solid var(--mint-border, #e2e8f0);
|
||||
}
|
||||
|
||||
.site-view-kv-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 12px 20px;
|
||||
}
|
||||
|
||||
.site-view-kv {
|
||||
display: grid;
|
||||
grid-template-columns: 96px 1fr;
|
||||
gap: 8px 12px;
|
||||
font-size: 13px;
|
||||
align-items: start;
|
||||
|
||||
dt {
|
||||
margin: 0;
|
||||
color: #64748b;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin: 0;
|
||||
color: #1e293b;
|
||||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
.site-view-image {
|
||||
width: 100%;
|
||||
max-width: 360px;
|
||||
height: 200px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e2e8f0;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
@@ -120,10 +120,17 @@
|
||||
<el-table-column
|
||||
prop="nickName"
|
||||
label="用户名"
|
||||
min-width="100"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
min-width="140"
|
||||
align="left"
|
||||
header-align="left"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<div class="user-nick-cell">
|
||||
<el-avatar :size="24" :src="resolveUserAvatarFromInfo(row)" />
|
||||
<span class="user-nick-cell__name">{{ row.nickName }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="deptName"
|
||||
label="所属组织"
|
||||
@@ -342,6 +349,7 @@
|
||||
fetchRoleOptions
|
||||
} from '@/api/admin'
|
||||
import { buildPathLabelMapFromTreeRoots } from '@/utils/tree-path'
|
||||
import { resolveUserAvatarFromInfo } from '@/utils/user-avatar'
|
||||
|
||||
const roleOptions = ref<Array<{ label: string; value: string }>>([])
|
||||
|
||||
@@ -730,4 +738,23 @@
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.user-nick-cell {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
max-width: 100%;
|
||||
|
||||
:deep(.el-avatar) {
|
||||
flex-shrink: 0;
|
||||
--el-avatar-bg-color: transparent;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
&__name {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user