|
@@ -1,5 +1,6 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { ref } from "vue";
|
|
import { ref } from "vue";
|
|
|
|
|
+import { useInventoryLogs } from "./utils/hook";
|
|
|
import { PureTableBar } from "@/components/RePureTableBar";
|
|
import { PureTableBar } from "@/components/RePureTableBar";
|
|
|
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
|
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
|
|
import Refresh from "~icons/ep/refresh";
|
|
import Refresh from "~icons/ep/refresh";
|
|
@@ -11,87 +12,19 @@ defineOptions({
|
|
|
const formRef = ref();
|
|
const formRef = ref();
|
|
|
const tableRef = ref();
|
|
const tableRef = ref();
|
|
|
|
|
|
|
|
-const loading = ref(false);
|
|
|
|
|
-const dataList = ref([]);
|
|
|
|
|
-const pagination = ref({
|
|
|
|
|
- total: 0,
|
|
|
|
|
- pageSize: 10,
|
|
|
|
|
- currentPage: 1
|
|
|
|
|
-});
|
|
|
|
|
-
|
|
|
|
|
-const form = ref({
|
|
|
|
|
- deviceId: "",
|
|
|
|
|
- productId: ""
|
|
|
|
|
-});
|
|
|
|
|
-
|
|
|
|
|
-const columns = [
|
|
|
|
|
- {
|
|
|
|
|
- label: "设备名称",
|
|
|
|
|
- prop: "deviceName",
|
|
|
|
|
- minWidth: 120
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: "商品名称",
|
|
|
|
|
- prop: "productName",
|
|
|
|
|
- minWidth: 120
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: "变动类型",
|
|
|
|
|
- prop: "changeType",
|
|
|
|
|
- minWidth: 100
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: "变动数量",
|
|
|
|
|
- prop: "quantity",
|
|
|
|
|
- minWidth: 100
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: "变动前库存",
|
|
|
|
|
- prop: "beforeStock",
|
|
|
|
|
- minWidth: 100
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: "变动后库存",
|
|
|
|
|
- prop: "afterStock",
|
|
|
|
|
- minWidth: 100
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: "操作人",
|
|
|
|
|
- prop: "operator",
|
|
|
|
|
- minWidth: 100
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: "变动时间",
|
|
|
|
|
- prop: "createTime",
|
|
|
|
|
- minWidth: 160
|
|
|
|
|
- }
|
|
|
|
|
-];
|
|
|
|
|
-
|
|
|
|
|
-const onSearch = () => {
|
|
|
|
|
- loading.value = true;
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- dataList.value = [];
|
|
|
|
|
- loading.value = false;
|
|
|
|
|
- }, 500);
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-const resetForm = (formEl: any) => {
|
|
|
|
|
- if (!formEl) return;
|
|
|
|
|
- formEl.resetFields();
|
|
|
|
|
- onSearch();
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-const handleSizeChange = (val: number) => {
|
|
|
|
|
- pagination.value.pageSize = val;
|
|
|
|
|
- onSearch();
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-const handleCurrentChange = (val: number) => {
|
|
|
|
|
- pagination.value.currentPage = val;
|
|
|
|
|
- onSearch();
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-onSearch();
|
|
|
|
|
|
|
+const {
|
|
|
|
|
+ form,
|
|
|
|
|
+ loading,
|
|
|
|
|
+ columns,
|
|
|
|
|
+ dataList,
|
|
|
|
|
+ pagination,
|
|
|
|
|
+ deviceOptions,
|
|
|
|
|
+ productOptions,
|
|
|
|
|
+ onSearch,
|
|
|
|
|
+ resetForm,
|
|
|
|
|
+ handleSizeChange,
|
|
|
|
|
+ handleCurrentChange
|
|
|
|
|
+} = useInventoryLogs();
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -108,8 +41,14 @@ onSearch();
|
|
|
placeholder="请选择设备"
|
|
placeholder="请选择设备"
|
|
|
clearable
|
|
clearable
|
|
|
filterable
|
|
filterable
|
|
|
- class="w-[180px]!"
|
|
|
|
|
|
|
+ class="w-[220px]!"
|
|
|
>
|
|
>
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in deviceOptions"
|
|
|
|
|
+ :key="item.deviceId"
|
|
|
|
|
+ :label="item.shopName ? `${item.deviceId} — ${item.shopName}` : item.deviceId"
|
|
|
|
|
+ :value="item.deviceId"
|
|
|
|
|
+ />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="商品:" prop="productId">
|
|
<el-form-item label="商品:" prop="productId">
|
|
@@ -118,8 +57,28 @@ onSearch();
|
|
|
placeholder="请选择商品"
|
|
placeholder="请选择商品"
|
|
|
clearable
|
|
clearable
|
|
|
filterable
|
|
filterable
|
|
|
- class="w-[180px]!"
|
|
|
|
|
|
|
+ class="w-[200px]!"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in productOptions"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ :label="item.name"
|
|
|
|
|
+ :value="item.id"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="变动类型:" prop="changeType">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="form.changeType"
|
|
|
|
|
+ placeholder="全部"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ class="w-[130px]!"
|
|
|
>
|
|
>
|
|
|
|
|
+ <el-option label="上货增加" :value="1" />
|
|
|
|
|
+ <el-option label="销售减少" :value="2" />
|
|
|
|
|
+ <el-option label="调整增加" :value="3" />
|
|
|
|
|
+ <el-option label="调整减少" :value="4" />
|
|
|
|
|
+ <el-option label="盘点调整" :value="5" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
@@ -138,11 +97,11 @@ onSearch();
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
|
|
<PureTableBar
|
|
<PureTableBar
|
|
|
- title="库存变动"
|
|
|
|
|
|
|
+ title="库存变动日志"
|
|
|
:columns="columns"
|
|
:columns="columns"
|
|
|
@refresh="onSearch"
|
|
@refresh="onSearch"
|
|
|
>
|
|
>
|
|
|
- <template v-slot="{ size, dynamic_columns }">
|
|
|
|
|
|
|
+ <template v-slot="{ size, dynamicColumns }">
|
|
|
<pure-table
|
|
<pure-table
|
|
|
ref="tableRef"
|
|
ref="tableRef"
|
|
|
row-key="id"
|
|
row-key="id"
|
|
@@ -153,7 +112,7 @@ onSearch();
|
|
|
:loading="loading"
|
|
:loading="loading"
|
|
|
:size="size"
|
|
:size="size"
|
|
|
:data="dataList"
|
|
:data="dataList"
|
|
|
- :columns="dynamic_columns"
|
|
|
|
|
|
|
+ :columns="dynamicColumns"
|
|
|
:pagination="{ ...pagination, size }"
|
|
:pagination="{ ...pagination, size }"
|
|
|
:header-cell-style="{
|
|
:header-cell-style="{
|
|
|
background: 'var(--el-fill-color-light)',
|
|
background: 'var(--el-fill-color-light)',
|
|
@@ -161,8 +120,7 @@ onSearch();
|
|
|
}"
|
|
}"
|
|
|
@page-size-change="handleSizeChange"
|
|
@page-size-change="handleSizeChange"
|
|
|
@page-current-change="handleCurrentChange"
|
|
@page-current-change="handleCurrentChange"
|
|
|
- >
|
|
|
|
|
- </pure-table>
|
|
|
|
|
|
|
+ />
|
|
|
</template>
|
|
</template>
|
|
|
</PureTableBar>
|
|
</PureTableBar>
|
|
|
</div>
|
|
</div>
|