|
|
@@ -1,8 +1,19 @@
|
|
|
<template>
|
|
|
<AidopDemoShell :title="pageTitle" subtitle="只读列表">
|
|
|
+ <!--
|
|
|
+ S5 盘点结果查询 · 只读页(S5z-STOCKTAKE-RESULT-1)。
|
|
|
+ 数据源:aidopdev.MissedPrint(盘点标签 IsTag=1),sql.txt 口径 join ItemMaster;只读,无 mock。
|
|
|
+ 列/口径来自证据 sql.txt + 字段配置图(账面=Qty/实盘=CompQty/差异=CompQty-Qty/盘点状态=CompQty≠Qty?有差异:正常)。
|
|
|
+ -->
|
|
|
<el-form :inline="true" :model="query" class="mb12" @submit.prevent>
|
|
|
- <el-form-item label="盘点名称">
|
|
|
- <el-select v-model="query.stocktakeName" placeholder="请选择" clearable style="width: 220px" />
|
|
|
+ <el-form-item label="物料编码">
|
|
|
+ <el-input v-model="query.materialCode" clearable style="width: 200px" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="盘点状态">
|
|
|
+ <el-select v-model="query.invStatus" placeholder="请选择" clearable style="width: 160px">
|
|
|
+ <el-option label="有差异" value="有差异" />
|
|
|
+ <el-option label="正常" value="正常" />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="doSearch">查询</el-button>
|
|
|
@@ -10,20 +21,26 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
- <el-table :data="rows" row-key="id" v-loading="loading" border stripe>
|
|
|
- <el-table-column prop="billNo" label="单号" min-width="150" show-overflow-tooltip resizable />
|
|
|
+ <el-table :data="rows" v-loading="loading" border stripe>
|
|
|
+ <el-table-column type="index" label="#" width="55" align="center" />
|
|
|
<el-table-column prop="materialCode" label="物料编码" min-width="140" 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="location" label="库位" min-width="100" show-overflow-tooltip resizable />
|
|
|
<el-table-column prop="shelf" label="货架" min-width="110" show-overflow-tooltip resizable />
|
|
|
- <el-table-column prop="unit" label="单位" min-width="90" resizable />
|
|
|
- <el-table-column prop="firstCountQty" label="初盘量" min-width="110" resizable />
|
|
|
- <el-table-column prop="recountQty" label="重盘量" min-width="110" resizable />
|
|
|
- <el-table-column prop="frozenQty" label="冻结数量" min-width="110" resizable />
|
|
|
- <el-table-column prop="firstRecountDiff" label="初盘与重盘差异" min-width="140" resizable />
|
|
|
- <el-table-column prop="recountFrozenDiff" label="重盘与冻结差异" min-width="140" resizable />
|
|
|
- <el-table-column prop="remark" label="备注" min-width="160" show-overflow-tooltip resizable />
|
|
|
+ <el-table-column prop="actLocation" label="实际库位" min-width="110" show-overflow-tooltip resizable />
|
|
|
+ <el-table-column prop="actShelf" label="实际货架" min-width="110" show-overflow-tooltip resizable />
|
|
|
+ <el-table-column prop="batchNo" label="批次号" min-width="140" show-overflow-tooltip resizable />
|
|
|
+ <el-table-column prop="unit" label="单位" width="80" resizable />
|
|
|
+ <el-table-column prop="tagQty" label="标签数量" width="100" align="right" resizable />
|
|
|
+ <el-table-column prop="countQty" label="实盘数量" width="100" align="right" resizable />
|
|
|
+ <el-table-column prop="qtyDiff" label="差异数量" width="100" align="right" resizable />
|
|
|
+ <el-table-column prop="status" label="状态" width="80" resizable />
|
|
|
+ <el-table-column prop="invStatus" label="盘点状态" width="100" resizable />
|
|
|
+ <el-table-column prop="countUser" label="盘点人" width="110" show-overflow-tooltip resizable />
|
|
|
+ <el-table-column prop="countTime" label="盘点时间" width="170" resizable>
|
|
|
+ <template #default="{ row }">{{ fmtDateTime(row.countTime) }}</template>
|
|
|
+ </el-table-column>
|
|
|
<template #empty>
|
|
|
<el-empty description="暂无数据" />
|
|
|
</template>
|
|
|
@@ -36,38 +53,74 @@
|
|
|
: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="aidopS5InventoryStocktakeResult">
|
|
|
-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 { fetchStocktakeResultList, type StocktakeResultRow } from '../api/stocktakeResult';
|
|
|
|
|
|
const route = useRoute();
|
|
|
const pageTitle = computed(() => (route.meta?.title as string) || '盘点结果查询');
|
|
|
|
|
|
const query = reactive({
|
|
|
- stocktakeName: '',
|
|
|
+ materialCode: '',
|
|
|
+ invStatus: '',
|
|
|
page: 1,
|
|
|
pageSize: 10,
|
|
|
});
|
|
|
|
|
|
-// 本批次为只读 UI 骨架,尚无真实盘点结果接口:渲染空表,不发请求、不造数据。
|
|
|
const loading = ref(false);
|
|
|
-const rows = ref<Record<string, unknown>[]>([]);
|
|
|
+const rows = ref<StocktakeResultRow[]>([]);
|
|
|
const total = ref(0);
|
|
|
|
|
|
+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', ' ');
|
|
|
+}
|
|
|
+
|
|
|
+async function loadList() {
|
|
|
+ loading.value = true;
|
|
|
+ try {
|
|
|
+ const data = await fetchStocktakeResultList({
|
|
|
+ materialCode: query.materialCode,
|
|
|
+ invStatus: query.invStatus,
|
|
|
+ page: query.page,
|
|
|
+ pageSize: query.pageSize,
|
|
|
+ });
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
function doSearch() {
|
|
|
query.page = 1;
|
|
|
+ loadList();
|
|
|
}
|
|
|
|
|
|
function resetQuery() {
|
|
|
- query.stocktakeName = '';
|
|
|
+ query.materialCode = '';
|
|
|
+ query.invStatus = '';
|
|
|
query.page = 1;
|
|
|
+ loadList();
|
|
|
}
|
|
|
+
|
|
|
+onMounted(() => loadList());
|
|
|
+onActivated(() => loadList());
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|