|
|
@@ -1,8 +1,16 @@
|
|
|
<template>
|
|
|
<AidopDemoShell :title="pageTitle" subtitle="只读列表">
|
|
|
+ <!--
|
|
|
+ S5 盘点标签确认 · 只读页(S5-INVENTORY-TAG-CONFIRM-READONLY-LIST-1)。
|
|
|
+ 数据源:aidopdev.MissedPrint(IsTag=1) + ItemMaster,后端 api/S5StocktakeLabelConfirm 直读。
|
|
|
+ 只读:无确认写回/批量确认/反确认/保存/库存事务/状态流转/导出。MissedPrint 无租户列,不做租户过滤。
|
|
|
+ 上游 IsTag=1 为 0 行时为真实接口空态,无 mock。
|
|
|
+ -->
|
|
|
<el-form :inline="true" :model="query" class="mb12" @submit.prevent>
|
|
|
<el-form-item label="库位">
|
|
|
- <el-select v-model="query.location" placeholder="请选择" clearable style="width: 200px" />
|
|
|
+ <el-select v-model="query.location" placeholder="请选择" clearable filterable style="width: 200px">
|
|
|
+ <el-option v-for="loc in locationOptions" :key="loc" :label="loc" :value="loc" />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="货架">
|
|
|
<el-input v-model="query.shelf" clearable style="width: 200px" />
|
|
|
@@ -14,7 +22,10 @@
|
|
|
<el-input v-model="query.batchNo" clearable style="width: 200px" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="核查结果">
|
|
|
- <el-select v-model="query.checkResult" placeholder="请选择" clearable style="width: 200px" />
|
|
|
+ <el-select v-model="query.checkResult" placeholder="请选择" clearable style="width: 200px">
|
|
|
+ <el-option label="有差异" value="有差异" />
|
|
|
+ <el-option label="正常" value="正常" />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="doSearch">查询</el-button>
|
|
|
@@ -22,23 +33,25 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
- <el-table :data="rows" row-key="id" v-loading="loading" border stripe>
|
|
|
- <el-table-column prop="materialCode" label="物料编码" min-width="140" show-overflow-tooltip resizable />
|
|
|
+ <el-table :data="rows" row-key="id" v-loading="loading" border stripe @sort-change="onSortChange">
|
|
|
+ <el-table-column prop="materialCode" label="物料编码" min-width="140" sortable="custom" show-overflow-tooltip resizable />
|
|
|
<el-table-column prop="materialName" label="物料名称" min-width="160" show-overflow-tooltip resizable />
|
|
|
<el-table-column prop="spec" label="规格型号" min-width="140" show-overflow-tooltip resizable />
|
|
|
- <el-table-column prop="location" label="库位" min-width="110" show-overflow-tooltip resizable />
|
|
|
- <el-table-column prop="shelf" label="货架" min-width="110" show-overflow-tooltip resizable />
|
|
|
+ <el-table-column prop="location" label="库位" min-width="110" sortable="custom" show-overflow-tooltip resizable />
|
|
|
+ <el-table-column prop="shelf" label="货架" min-width="110" sortable="custom" show-overflow-tooltip resizable />
|
|
|
<el-table-column prop="actualLocation" label="实盘库位" min-width="120" show-overflow-tooltip resizable />
|
|
|
<el-table-column prop="actualShelf" label="实盘货架" min-width="120" show-overflow-tooltip resizable />
|
|
|
- <el-table-column prop="batchNo" label="批次号" min-width="140" show-overflow-tooltip resizable />
|
|
|
+ <el-table-column prop="batchNo" label="批次号" min-width="140" sortable="custom" show-overflow-tooltip resizable />
|
|
|
<el-table-column prop="unit" label="单位" min-width="90" resizable />
|
|
|
- <el-table-column prop="labelQty" label="标签数量" min-width="110" resizable />
|
|
|
- <el-table-column prop="actualQty" label="实盘数量" min-width="110" resizable />
|
|
|
- <el-table-column prop="diffQty" label="差异数量" min-width="110" resizable />
|
|
|
+ <el-table-column prop="labelQty" label="标签数量" min-width="110" align="right" sortable="custom" resizable />
|
|
|
+ <el-table-column prop="actualQty" label="实盘数量" min-width="110" align="right" sortable="custom" resizable />
|
|
|
+ <el-table-column prop="diffQty" label="差异数量" min-width="110" align="right" sortable="custom" resizable />
|
|
|
<el-table-column prop="status" label="状态" min-width="100" resizable />
|
|
|
- <el-table-column prop="stocktakeResult" label="盘点结果" min-width="120" resizable />
|
|
|
+ <el-table-column prop="stocktakeResult" label="盘点结果" min-width="120" sortable="custom" resizable />
|
|
|
<el-table-column prop="stocktakePerson" label="盘点人" min-width="120" show-overflow-tooltip resizable />
|
|
|
- <el-table-column prop="stocktakeTime" label="盘点时间" min-width="170" resizable />
|
|
|
+ <el-table-column prop="stocktakeTime" label="盘点时间" min-width="170" sortable="custom" resizable>
|
|
|
+ <template #default="{ row }">{{ fmtDateTime(row.stocktakeTime) }}</template>
|
|
|
+ </el-table-column>
|
|
|
<template #empty>
|
|
|
<el-empty description="暂无数据" />
|
|
|
</template>
|
|
|
@@ -51,15 +64,23 @@
|
|
|
:total="total"
|
|
|
:page-sizes="[10, 20, 50]"
|
|
|
layout="total, sizes, prev, pager, next"
|
|
|
+ @current-change="loadList"
|
|
|
+ @size-change="loadList"
|
|
|
/>
|
|
|
</div>
|
|
|
</AidopDemoShell>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts" name="aidopS5InventoryStocktakeLabel">
|
|
|
-import { computed, reactive, ref } from 'vue';
|
|
|
+import { computed, onActivated, onMounted, reactive, ref } from 'vue';
|
|
|
import { useRoute } from 'vue-router';
|
|
|
+import { ElMessage } from 'element-plus';
|
|
|
import AidopDemoShell from '/@/views/aidop/components/AidopDemoShell.vue';
|
|
|
+import {
|
|
|
+ fetchStocktakeLabelConfirmList,
|
|
|
+ fetchStocktakeLabelConfirmLocations,
|
|
|
+ type StocktakeLabelConfirmRow,
|
|
|
+} from '../api/stocktakeLabelConfirm';
|
|
|
|
|
|
const route = useRoute();
|
|
|
const pageTitle = computed(() => (route.meta?.title as string) || '盘点标签确认');
|
|
|
@@ -72,15 +93,64 @@ const query = reactive({
|
|
|
checkResult: '',
|
|
|
page: 1,
|
|
|
pageSize: 10,
|
|
|
+ orderBy: '',
|
|
|
+ orderDir: '',
|
|
|
});
|
|
|
|
|
|
-// 本批次为只读 UI 骨架,尚无真实盘点标签接口:渲染空表,不发请求、不造数据。
|
|
|
const loading = ref(false);
|
|
|
-const rows = ref<Record<string, unknown>[]>([]);
|
|
|
+const rows = ref<StocktakeLabelConfirmRow[]>([]);
|
|
|
const total = ref(0);
|
|
|
+const locationOptions = ref<string[]>([]);
|
|
|
+
|
|
|
+function fmtDateTime(v?: string | null) {
|
|
|
+ if (!v) return '';
|
|
|
+ const s = String(v);
|
|
|
+ return s.length > 19 ? s.slice(0, 19).replace('T', ' ') : s.replace('T', ' ');
|
|
|
+}
|
|
|
+
|
|
|
+function onSortChange({ prop, order }: { prop: string; order: string | null }) {
|
|
|
+ query.orderBy = prop || '';
|
|
|
+ query.orderDir = order === 'ascending' ? 'asc' : order === 'descending' ? 'desc' : '';
|
|
|
+ loadList();
|
|
|
+}
|
|
|
+
|
|
|
+async function loadList() {
|
|
|
+ loading.value = true;
|
|
|
+ try {
|
|
|
+ const data = await fetchStocktakeLabelConfirmList({
|
|
|
+ location: query.location,
|
|
|
+ shelf: query.shelf,
|
|
|
+ itemNum: query.materialCode,
|
|
|
+ lotSerial: query.batchNo,
|
|
|
+ invStatus: query.checkResult,
|
|
|
+ page: query.page,
|
|
|
+ pageSize: query.pageSize,
|
|
|
+ orderBy: query.orderBy,
|
|
|
+ orderDir: query.orderDir,
|
|
|
+ });
|
|
|
+ rows.value = data.list || [];
|
|
|
+ total.value = data.total || 0;
|
|
|
+ } catch (e: any) {
|
|
|
+ rows.value = [];
|
|
|
+ total.value = 0;
|
|
|
+ ElMessage.error(e?.message || '加载盘点标签确认列表失败');
|
|
|
+ } finally {
|
|
|
+ loading.value = false;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+async function loadLocations() {
|
|
|
+ try {
|
|
|
+ const data = await fetchStocktakeLabelConfirmLocations();
|
|
|
+ locationOptions.value = (data || []).map((o) => o.val || '').filter((v) => v);
|
|
|
+ } catch {
|
|
|
+ locationOptions.value = [];
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
function doSearch() {
|
|
|
query.page = 1;
|
|
|
+ loadList();
|
|
|
}
|
|
|
|
|
|
function resetQuery() {
|
|
|
@@ -90,7 +160,16 @@ function resetQuery() {
|
|
|
query.batchNo = '';
|
|
|
query.checkResult = '';
|
|
|
query.page = 1;
|
|
|
+ query.orderBy = '';
|
|
|
+ query.orderDir = '';
|
|
|
+ loadList();
|
|
|
}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ loadLocations();
|
|
|
+ loadList();
|
|
|
+});
|
|
|
+onActivated(() => loadList());
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|