feat: 进销存更新

This commit is contained in:
wwz 2025-04-08 17:41:30 +08:00
parent 6fb991ff32
commit 86f68a5cdf
7 changed files with 96 additions and 75 deletions

View File

@ -11,41 +11,41 @@ const Api = {
params,
});
},
/** 全部*/
getAllList(params: any) {
return request<any>({
url: `${baseURL}/list`,
method: "get",
params,
});
},
get(id: string | number) {
return request<any>({
url: `${baseURL}/` + id,
method: "get",
});
},
add(data: any) {
return request<any>({
url: `${baseURL}`,
method: "post",
data,
});
},
edit(data: any) {
return request<any>({
url: `${baseURL}`,
method: "put",
data,
});
},
// /** 全部*/
// getAllList(params: any) {
// return request<any>({
// url: `${baseURL}/list`,
// method: "get",
// params,
// });
// },
// get(id: string | number) {
// return request<any>({
// url: `${baseURL}/` + id,
// method: "get",
// });
// },
// add(data: any) {
// return request<any>({
// url: `${baseURL}`,
// method: "post",
// data,
// });
// },
// edit(data: any) {
// return request<any>({
// url: `${baseURL}`,
// method: "put",
// data,
// });
// },
delete(id: string | number) {
return request<any>({
url: `${baseURL}/` + id,
method: "delete",
});
},
// delete(id: string | number) {
// return request<any>({
// url: `${baseURL}/` + id,
// method: "delete",
// });
// },
};
export default Api;

View File

@ -168,7 +168,7 @@ const refAddHaocaiTakin = ref();
function refAddHaocaiTakinShow(item: any, type: string) {
console.log(item);
if (type === "manual-in") {
router.push({ path: "/inventory/libraryrecords", query: { type: type, conId: item.id } });
router.push({ path: "/inventory/libraryrecords", query: { inOutType: type, conId: item.id } });
return;
}
if (type === "delete") {
@ -222,7 +222,7 @@ function handleToolbarClick(name: string) {
return;
}
if (name == "damage-out" || name == "manual-out" || name == "manual-in") {
router.push({ path: "/inventory/libraryrecords", query: { type: name } });
router.push({ path: "/inventory/libraryrecords", query: { inOutType: name } });
return;
}
}

View File

@ -1,6 +1,5 @@
import Api from "@/api/product/libraryrecords";
import type { IContentConfig } from "@/components/CURD/types";
import { log } from "console";
const contentConfig: IContentConfig = {
pageName: "sys:user",
@ -15,7 +14,6 @@ const contentConfig: IContentConfig = {
pageSizes: [10, 20, 30, 50],
},
indexAction: function (params) {
console.log("params", params);
return Api.getList(params);
},
deleteAction: function (id) {
@ -56,6 +54,23 @@ const contentConfig: IContentConfig = {
align: "center",
prop: "unitName",
},
{
label: "所属商品",
align: "center",
prop: "unitName",
},
{
label: "供应商",
align: "center",
prop: "unitName",
},
{
label: "变动原因",
align: "center",
prop: "inOutItem",
template: "custom",
slotName: "inOutItem",
},
{
label: "变动前的库存",
align: "center",

View File

@ -36,7 +36,6 @@ const searchConfig: ISearchConfig = {
width: "200px",
},
},
initialValue: "",
options: [
{
label: "入库记录",
@ -51,6 +50,7 @@ const searchConfig: ISearchConfig = {
value: "damage-out",
},
],
initialValue: "",
},
],
};

View File

@ -19,6 +19,14 @@
@operat-click="handleOperatClick"
@filter-change="handleFilterChange"
>
<template #inOutItem="scope">
<text v-if="scope.row.inOutItem == 'manual-in'">手动入库</text>
<text v-if="scope.row.inOutItem == 'manual-out'">手动出库</text>
<text v-if="scope.row.inOutItem == 'win-in'">盘盈入库</text>
<text v-if="scope.row.inOutItem == 'loss-out'">盘亏出库</text>
<text v-if="scope.row.inOutItem == 'order-in'">订单退款入库</text>
<text v-if="scope.row.inOutItem == 'order-out'">订单消费出库</text>
</template>
<template #status="scope">
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
@ -77,17 +85,15 @@ const {
handleFilterChange,
} = usePage();
//
const route = useRoute();
const Query = route.query || "";
onMounted(() => {
if (Query.type) {
searchRef.value?.setQueryValue("inOutType", Query.type);
const { inOutType, conId } = route.query;
if (inOutType || conId) {
contentConfig.indexActionData = { inOutType, conId };
if (inOutType) {
searchConfig.formItems[1].initialValue = inOutType;
}
if (Query.conId) {
searchRef.value?.setQueryValue("conId", Query.conId);
}
});
}
//
async function handleAddClick() {
@ -102,7 +108,6 @@ async function handleEditClick(row: IObject) {
console.log(row);
editModalRef.value?.setFormData({ ...row });
}
1;
//
function handleToolbarClick(name: string) {
console.log(name);

View File

@ -1,16 +1,12 @@
<!-- 耗材列表 -->
<template>
<el-dialog title="选择耗材" v-model="dialogVisible">
<el-dialog v-model="dialogVisible" title="选择耗材">
<el-form :model="searchForm" inline>
<el-form-item>
<el-input
v-model="searchForm.conTypeName"
placeholder="耗材类型名称"
@input="onInput"
></el-input>
<el-input v-model="searchForm.conTypeName" placeholder="耗材类型名称" @input="onInput" />
</el-form-item>
<el-form-item>
<el-input v-model="searchForm.conName" placeholder="耗材名称" @input="onInput"></el-input>
<el-input v-model="searchForm.conName" placeholder="耗材名称" @input="onInput" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getTableData">查询</el-button>
@ -20,19 +16,20 @@
<div class="head-container">
<el-table
ref="table"
:data="tableData.list"
v-loading="tableData.loading"
@select="firstSelectChange"
:data="tableData.list"
:row-key="getRowKey"
@select="firstSelectChange"
@selection-change="onSelectionChange"
>
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column label="耗材名称" prop="conName"></el-table-column>
<el-table-column label="价格" prop="price"></el-table-column>
<el-table-column label="耗材代码" prop="conCode"></el-table-column>
<el-table-column label="耗材类型名称" prop="conTypeName"></el-table-column>
<el-table-column label="单位" prop="conUnit"></el-table-column>
<el-table-column label="最近入库量" prop="lasterInStock"></el-table-column>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="耗材名称" prop="conName" />
<el-table-column label="所属分类" prop="consGroupName" />
<el-table-column label="价格" prop="price" />
<el-table-column label="耗材代码" prop="conCode" />
<el-table-column label="耗材类型名称" prop="conTypeName" />
<el-table-column label="单位" prop="conUnit" />
<el-table-column label="最近入库量" prop="lasterInStock" />
<el-table-column label="库存数量" prop="stockNumber">
<template v-slot="scope">
{{ formatDecimal(scope.row.stockNumber, 2, true) }}
@ -49,10 +46,10 @@
:total="tableData.total"
:current-page="tableData.page + 1"
:page-size="tableData.size"
layout="total, sizes, prev, pager, next, jumper"
@current-change="paginationChange"
@size-change="sizeChange"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
/>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>

View File

@ -11,8 +11,8 @@
<el-row>
<el-form-item label="类型">
<el-radio-group :model-value="type" @change="tabChange">
<el-radio-button value="in">入库</el-radio-button>
<el-radio-button value="out">出库</el-radio-button>
<el-radio value="in">入库</el-radio>
<el-radio value="out">出库</el-radio>
</el-radio-group>
</el-form-item>
</el-row>
@ -45,6 +45,7 @@
value-format="YYYY-MM-DD"
placeholder="选择日期"
style="width: 220px"
disabled="false"
/>
</el-form-item>
</el-col>
@ -110,11 +111,9 @@
</el-form-item>
</el-form>
</div>
<div class="head-container">
<el-button type="primary" plain>
<div style="font-weight: bold; font-size: 16px; color: #666">
{{ tableData.list.length }}种耗材金额合计
<span style="color: red">{{ amountPayable }}</span>
</el-button>
</div>
<div class="head-container">
<el-table :data="tableData.list">
@ -123,6 +122,11 @@
{{ scope.row.conName }}
</template>
</el-table-column>
<el-table-column label="所属分类">
<template v-slot="scope">
{{ scope.row.consGroupName }}
</template>
</el-table-column>
<el-table-column label="进价">
<template v-slot="scope">
<el-input-number v-model="scope.row.price" :min="0" controls-position="right" />