feat: split storage release list by review role and dual conclusions.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
2c0bee3941
commit
021abd8283
1 file changed
+83
-47
@@ -49,9 +49,24 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核结论">
|
||||
<el-form-item label="生产结论">
|
||||
<el-select
|
||||
v-model="searchForm.reviewConclusion"
|
||||
v-model="searchForm.prodReviewConclusion"
|
||||
clearable
|
||||
placeholder="全部"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in reviewConclusionOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="质检结论">
|
||||
<el-select
|
||||
v-model="searchForm.qcReviewConclusion"
|
||||
clearable
|
||||
placeholder="全部"
|
||||
style="width: 100%"
|
||||
@@ -111,6 +126,7 @@
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
</div>
|
||||
<el-button
|
||||
v-if="canWrite"
|
||||
type="primary"
|
||||
class="btn-main"
|
||||
:disabled="!canBatchReview"
|
||||
@@ -119,7 +135,12 @@
|
||||
<el-icon><CircleCheck /></el-icon>
|
||||
批量审核
|
||||
</el-button>
|
||||
<el-button class="btn-ghost" :disabled="!canBatchStore" @click="handleBatchStore">
|
||||
<el-button
|
||||
v-if="canWrite"
|
||||
class="btn-ghost"
|
||||
:disabled="!canBatchStore"
|
||||
@click="handleBatchStore"
|
||||
>
|
||||
<el-icon><Box /></el-icon>
|
||||
批量入库
|
||||
</el-button>
|
||||
@@ -235,19 +256,37 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="reviewConclusion"
|
||||
label="审核结论"
|
||||
prop="prodReviewConclusion"
|
||||
label="生产结论"
|
||||
min-width="100"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-tag
|
||||
v-if="row.reviewConclusion"
|
||||
:type="storageReleaseConclusionTagType(row.reviewConclusion)"
|
||||
v-if="row.prodReviewConclusion"
|
||||
:type="storageReleaseConclusionTagType(row.prodReviewConclusion)"
|
||||
size="small"
|
||||
>
|
||||
{{ storageReleaseConclusionLabel(row.reviewConclusion) }}
|
||||
{{ storageReleaseConclusionLabel(row.prodReviewConclusion) }}
|
||||
</el-tag>
|
||||
<el-tag v-else type="info" size="small">待审核</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="qcReviewConclusion"
|
||||
label="质检结论"
|
||||
min-width="100"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-tag
|
||||
v-if="row.qcReviewConclusion"
|
||||
:type="storageReleaseConclusionTagType(row.qcReviewConclusion)"
|
||||
size="small"
|
||||
>
|
||||
{{ storageReleaseConclusionLabel(row.qcReviewConclusion) }}
|
||||
</el-tag>
|
||||
<el-tag v-else type="info" size="small">待审核</el-tag>
|
||||
</template>
|
||||
@@ -265,20 +304,6 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="reviewByName"
|
||||
label="审核人"
|
||||
min-width="100"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="reviewTime"
|
||||
label="审核时间"
|
||||
min-width="170"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
min-width="280"
|
||||
@@ -290,16 +315,9 @@
|
||||
<el-button class="btn-op-item" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
</el-button>
|
||||
<el-button class="btn-op-item" @click="openReviewDialog(row)">
|
||||
<el-button v-if="canWrite" class="btn-op-item" @click="openReviewDialog(row)">
|
||||
<el-icon><CircleCheck /></el-icon>审核
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="row.reviewConclusion === 'tg' && row.storageStatus === 'drk'"
|
||||
class="btn-op-item"
|
||||
@click="handleStore(row)"
|
||||
>
|
||||
<el-icon><Box /></el-icon>样本入库
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -322,6 +340,7 @@
|
||||
v-model="reviewDialogVisible"
|
||||
:review-ids="reviewDialogIds"
|
||||
:review-items="reviewDialogItems"
|
||||
:review-side="reviewRole === 'overview' ? 'qc' : reviewRole"
|
||||
@submitted="onReviewSubmitted"
|
||||
/>
|
||||
</section>
|
||||
@@ -337,7 +356,6 @@
|
||||
import SampleCodeWithSpecialDisplay from '@/components/business/sample-code-with-special-display/index.vue'
|
||||
import {
|
||||
fetchStorageReleaseReviewList,
|
||||
storeSample,
|
||||
batchStoreSample,
|
||||
type StorageReleaseReview
|
||||
} from '@/api/storage-release-review'
|
||||
@@ -359,6 +377,18 @@
|
||||
|
||||
defineOptions({ name: 'QualityInspectionStorageReleaseReview' })
|
||||
|
||||
const props = defineProps<{
|
||||
reviewRole?: 'overview' | 'production' | 'qc'
|
||||
}>()
|
||||
|
||||
const reviewRole = computed<'overview' | 'production' | 'qc'>(() => {
|
||||
const r = props.reviewRole
|
||||
if (r === 'production' || r === 'qc' || r === 'overview') return r
|
||||
return 'overview'
|
||||
})
|
||||
|
||||
const canWrite = computed(() => reviewRole.value !== 'overview')
|
||||
|
||||
type ReviewTab = 'pending' | 'reviewed'
|
||||
|
||||
const STATUS_TABS = [
|
||||
@@ -403,7 +433,8 @@
|
||||
|
||||
const searchForm = reactive({
|
||||
receptionSource: '',
|
||||
reviewConclusion: '',
|
||||
prodReviewConclusion: '',
|
||||
qcReviewConclusion: '',
|
||||
storageStatus: '',
|
||||
keyword: '',
|
||||
showAllPending: false
|
||||
@@ -422,7 +453,12 @@
|
||||
const canBatchStore = computed(
|
||||
() =>
|
||||
selectedRows.value.length > 0 &&
|
||||
selectedRows.value.every((r) => r.reviewConclusion === 'tg' && r.storageStatus === 'drk')
|
||||
selectedRows.value.every(
|
||||
(r) =>
|
||||
r.prodReviewConclusion === 'tg' &&
|
||||
r.qcReviewConclusion === 'tg' &&
|
||||
r.storageStatus === 'drk'
|
||||
)
|
||||
)
|
||||
|
||||
async function loadData() {
|
||||
@@ -434,7 +470,9 @@
|
||||
page: pagination.page,
|
||||
pageSize: pagination.pageSize,
|
||||
receptionSource: searchForm.receptionSource || undefined,
|
||||
reviewConclusion: searchForm.reviewConclusion || undefined,
|
||||
reviewSide: reviewRole.value,
|
||||
prodReviewConclusion: searchForm.prodReviewConclusion || undefined,
|
||||
qcReviewConclusion: searchForm.qcReviewConclusion || undefined,
|
||||
storageStatus: searchForm.storageStatus || undefined,
|
||||
keyword: searchForm.keyword || undefined,
|
||||
reviewPhase: activeTab.value,
|
||||
@@ -465,7 +503,8 @@
|
||||
|
||||
function handleReset() {
|
||||
searchForm.receptionSource = ''
|
||||
searchForm.reviewConclusion = ''
|
||||
searchForm.prodReviewConclusion = ''
|
||||
searchForm.qcReviewConclusion = ''
|
||||
searchForm.storageStatus = ''
|
||||
searchForm.keyword = ''
|
||||
searchForm.showAllPending = false
|
||||
@@ -517,17 +556,6 @@
|
||||
loadData()
|
||||
}
|
||||
|
||||
async function handleStore(row: StorageReleaseReview) {
|
||||
await ElMessageBox.confirm(`确认将样本「${row.sampleCode || ''}」执行入库操作?`, '入库确认', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
await storeSample(String(row.id))
|
||||
ElMessage.success('入库成功')
|
||||
loadData()
|
||||
}
|
||||
|
||||
async function handleBatchStore() {
|
||||
if (!selectedRows.value.length) return
|
||||
await ElMessageBox.confirm(
|
||||
@@ -557,9 +585,17 @@
|
||||
{ debounce: 300, deep: true }
|
||||
)
|
||||
|
||||
watch(reviewRole, () => {
|
||||
pagination.page = 1
|
||||
selectedRows.value = []
|
||||
loadData()
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
loadData()
|
||||
})
|
||||
|
||||
onActivated(() => loadData())
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -601,7 +637,7 @@
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
/* 操作列:查看 / 审核 / 样本入库 */
|
||||
/* 操作列:查看 / 审核 */
|
||||
.storage-release-review-table {
|
||||
:deep(td.el-table__cell:has(.btn-op-item)),
|
||||
:deep(td.el-table-fixed-column--right:has(.btn-op-item)),
|
||||
|
||||
Reference in new issue
Block a user