feat: 进销存更改

This commit is contained in:
wwz
2025-04-10 17:51:14 +08:00
parent 2922de551a
commit 6cb1968b80
7 changed files with 98 additions and 171 deletions

View File

@@ -77,7 +77,39 @@
</div> </div>
</div> </div>
</div> </div>
<!--<div style="
width: 200px;
flex-direction: column;
justify-content: center;
align-items: center;
background: #fff;
">
<div style="font-weight: bold">入库</div>
<div style="margin-top: 10px">{{ data.stockInNum || 0 }}</div>
<div style="margin-top: 10px">{{ data.totalRow || 0 }}</div>
</div>
<div style="
width: 200px;
flex-direction: column;
justify-content: center;
align-items: center;
background: #fff;
">
<div style="font-weight: bold">出库</div>
<div style="margin-top: 10px">{{ data.stockOutNum || 0 }}</div>
<div style="margin-top: 10px">{{ data.totalRow || 0 }}</div>
</div>
<div style="
width: 200px;
flex-direction: column;
justify-content: center;
align-items: center;
background: #fff;
">
<div style="font-weight: bold">报损</div>
<div style="margin-top: 10px">{{ data.damageNum || 0 }}</div>
<div style="margin-top: 10px">{{ data.totalRow || 0 }}</div>
</div> -->
<stockHistory ref="refStockHistory" /> <stockHistory ref="refStockHistory" />
</div> </div>
</template> </template>
@@ -109,7 +141,7 @@ function refStockHistoryShow(key) {
align-items: center; align-items: center;
justify-content: space-around; justify-content: space-around;
> div { >div {
height: 80px; height: 80px;
background-color: #f4f9ff; background-color: #f4f9ff;
display: flex; display: flex;
@@ -129,6 +161,7 @@ function refStockHistoryShow(key) {
span { span {
color: #666; color: #666;
font-size: 14px; font-size: 14px;
&.num { &.num {
color: #3f9eff; color: #3f9eff;
cursor: pointer; cursor: pointer;

View File

@@ -39,11 +39,6 @@ const contentConfig: IContentConfig = {
name: "chuku", name: "chuku",
auth: "", auth: "",
}, },
{
text: "报损",
name: "reportinglosses",
auth: "",
},
{ {
text: "分类管理", text: "分类管理",
name: "category", name: "category",
@@ -69,6 +64,11 @@ const contentConfig: IContentConfig = {
name: "damage-out", name: "damage-out",
auth: "", auth: "",
}, },
{
text: "报损",
name: "reportinglosses",
auth: "",
},
], ],
defaultToolbar: ["refresh", "filter", "search"], defaultToolbar: ["refresh", "filter", "search"],
cols: [ cols: [

View File

@@ -44,21 +44,21 @@ const searchConfig: ISearchConfig = {
}, },
initialValue: "", initialValue: "",
}, },
{ // {
type: "date-picker", // type: "date-picker",
label: "创建时间", // label: "创建时间",
prop: "createAt", // prop: "createAt",
attrs: { // attrs: {
type: "daterange", // type: "daterange",
"range-separator": "~", // "range-separator": "~",
"start-placeholder": "开始时间", // "start-placeholder": "开始时间",
"end-placeholder": "截止时间", // "end-placeholder": "截止时间",
"value-format": "YYYY-MM-DD", // "value-format": "YYYY-MM-DD",
style: { // style: {
width: "240px", // width: "240px",
}, // },
}, // },
}, // },
], ],
}; };

View File

@@ -2,26 +2,14 @@
<div class="app-container"> <div class="app-container">
<!-- 列表 --> <!-- 列表 -->
<!-- 搜索 --> <!-- 搜索 -->
<page-search <page-search ref="searchRef" :search-config="searchConfig" @query-click="newHandleQueryClick"
ref="searchRef" @reset-click="handleResetClick" />
:search-config="searchConfig"
@query-click="newHandleQueryClick"
@reset-click="handleResetClick"
/>
<!-- 统计 --> <!-- 统计 -->
<data-tongji :data="gongjiData" /> <data-tongji :data="gongjiData" />
<!-- 列表 --> <!-- 列表 -->
<page-content <page-content ref="contentRef" :content-config="contentConfig" @add-click="handleAddClick"
ref="contentRef" @edit-click="handleEditClick" @export-click="handleExportClick" @search-click="handleSearchClick"
:content-config="contentConfig" @toolbar-click="handleToolbarClick" @operat-click="handleOperatClick" @filter-change="handleFilterChange">
@add-click="handleAddClick"
@edit-click="handleEditClick"
@export-click="handleExportClick"
@search-click="handleSearchClick"
@toolbar-click="handleToolbarClick"
@operat-click="handleOperatClick"
@filter-change="handleFilterChange"
>
<template #status="scope"> <template #status="scope">
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'"> <el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }} {{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
@@ -33,28 +21,22 @@
<template #goods="scope"> <template #goods="scope">
<div class="goodslang"> <div class="goodslang">
<div class="goods-list"> <div class="goods-list">
<el-button <el-button v-for="item in scope.row.productList" :key="item.productId" type="text"
v-for="item in scope.row.productList" @click="toGoods(item.id)">
:key="item.productId"
type="text"
@click="toGoods(item.id)"
>
{{ item.name }} {{ item.name }}
</el-button> </el-button>
<span v-if="scope.row.productList.length > 1">,</span> <span v-if="scope.row.productList.length > 1">,</span>
</div> </div>
<el-dropdown v-if="scope.row.productList.length > 1" trigger="click" @command="toGoods"> <el-dropdown v-if="scope.row.productList.length > 1" trigger="click" @command="toGoods">
<span class="el-dropdown-link" style="color: blue"> <span class="el-dropdown-link" style="color: blue">
<el-icon><CaretBottom /></el-icon> <el-icon>
<CaretBottom />
</el-icon>
</span> </span>
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item <el-dropdown-item v-for="item in scope.row.productList" :key="item.id" class="clearfix"
v-for="item in scope.row.productList" :command="item.id">
:key="item.id"
class="clearfix"
:command="item.id"
>
{{ item.name }} {{ item.name }}
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
@@ -73,21 +55,15 @@
</template> </template>
<template #mobile="scope"> <template #mobile="scope">
<el-text>{{ scope.row[scope.prop] }}</el-text> <el-text>{{ scope.row[scope.prop] }}</el-text>
<copy-button <copy-button v-if="scope.row[scope.prop]" :text="scope.row[scope.prop]" style="margin-left: 2px" />
v-if="scope.row[scope.prop]"
:text="scope.row[scope.prop]"
style="margin-left: 2px"
/>
</template> </template>
<template #operate="scope"> <template #operate="scope">
<div <div style="
style="
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
" ">
>
<el-button type="primary" link @click="refAddHaocaiOpen(scope.row)">编辑</el-button> <el-button type="primary" link @click="refAddHaocaiOpen(scope.row)">编辑</el-button>
<el-button link type="primary" @click="refAddHaocaiTakinShow(scope.row, 'consumables')"> <el-button link type="primary" @click="refAddHaocaiTakinShow(scope.row, 'consumables')">
耗材盘点 耗材盘点

View File

@@ -65,11 +65,6 @@ const contentConfig: IContentConfig = {
templet: "custom", templet: "custom",
slotName: "conUnit", slotName: "conUnit",
}, },
{
label: "变动前的库存",
align: "center",
prop: "beforeNumber",
},
{ {
label: "出入库数量", label: "出入库数量",
align: "center", align: "center",

View File

@@ -14,22 +14,13 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="head-container"> <div class="head-container">
<el-table <el-table ref="table" v-loading="tableData.loading" :data="tableData.list" :row-key="getRowKey"
ref="table" @select="firstSelectChange" @selection-change="onSelectionChange">
v-loading="tableData.loading"
:data="tableData.list"
:row-key="getRowKey"
@select="firstSelectChange"
@selection-change="onSelectionChange"
>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="耗材名称" prop="conName" /> <el-table-column label="耗材名称" prop="conName" />
<el-table-column label="所属分类" prop="consGroupName" /> <el-table-column label="所属分类" prop="consGroupName" />
<el-table-column label="价格" prop="price" /> <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="conUnit" />
<el-table-column label="最近入库量" prop="lasterInStock" />
<el-table-column label="库存数量" prop="stockNumber"> <el-table-column label="库存数量" prop="stockNumber">
<template v-slot="scope"> <template v-slot="scope">
{{ formatDecimal(scope.row.stockNumber, 2, true) }} {{ formatDecimal(scope.row.stockNumber, 2, true) }}
@@ -42,14 +33,8 @@
</el-table-column> --> </el-table-column> -->
</el-table> </el-table>
</div> </div>
<el-pagination <el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
:total="tableData.total" layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChange" @size-change="sizeChange" />
:current-page="tableData.page + 1"
:page-size="tableData.size"
layout="total, sizes, prev, pager, next, jumper"
@current-change="paginationChange"
@size-change="sizeChange"
/>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>

View File

@@ -1,13 +1,7 @@
<template> <template>
<div class="app-container bg-fff u-m-20"> <div class="app-container bg-fff u-m-20">
<div class="head-container"> <div class="head-container">
<el-form <el-form ref="queryForm" :model="queryForm" :rules="queryRules" label-position="left" label-width="100px">
ref="queryForm"
:model="queryForm"
:rules="queryRules"
label-position="left"
label-width="100px"
>
<el-row> <el-row>
<el-form-item label="类型"> <el-form-item label="类型">
<el-radio-group :model-value="type" @change="tabChange"> <el-radio-group :model-value="type" @change="tabChange">
@@ -19,68 +13,37 @@
<el-row> <el-row>
<el-col v-if="type == 'in'" :span="8"> <el-col v-if="type == 'in'" :span="8">
<el-form-item label="供应商"> <el-form-item label="供应商">
<el-select <el-select v-model="queryForm.vendorId" placeholder="请选择供应商" clearable style="width: 220px"
v-model="queryForm.vendorId" @change="changeTypeEnum">
placeholder="请选择供应商" <el-option v-for="item in purveyorList" :key="item.id" :label="item.name" :value="item.id" />
clearable
style="width: 220px"
@change="changeTypeEnum"
>
<el-option
v-for="item in purveyorList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select> </el-select>
{{ queryForm.waitAmount }} {{ queryForm.waitAmount }}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="出入库时间" prop="inOutDate"> <el-form-item label="出入库时间" prop="inOutDate">
<el-date-picker <el-date-picker v-model="queryForm.inOutDate" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
v-model="queryForm.inOutDate" placeholder="选择日期" style="width: 220px" disabled="false" />
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
placeholder="选择日期"
style="width: 220px"
disabled="false"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="应付金额"> <el-form-item label="应付金额">
<el-input <el-input v-model="queryForm.amountPayable" placeholder="请输入应收金额" style="width: 220px" />
v-model="queryForm.amountPayable"
placeholder="请输入应收金额"
style="width: 220px"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="实付金额"> <el-form-item label="实付金额">
<el-input <el-input v-model="queryForm.actualPaymentAmount" placeholder="请输入实收金额" style="width: 220px" />
v-model="queryForm.actualPaymentAmount"
placeholder="请输入实收金额"
style="width: 220px"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="付款时间"> <el-form-item label="付款时间">
<el-date-picker <el-date-picker v-model="queryForm.paymentDate" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
v-model="queryForm.paymentDate" placeholder="选择日期" style="width: 220px" />
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
placeholder="选择日期"
style="width: 220px"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="8"> <!-- <el-col :span="8">
@@ -100,14 +63,8 @@
<div /> <div />
<el-button type="primary" @click="showHaocai">选择耗材</el-button> <el-button type="primary" @click="showHaocai">选择耗材</el-button>
<el-autocomplete <el-autocomplete v-model="autocompletename" :fetch-suggestions="querySearchAsync" value-key="conName"
v-model="autocompletename" placeholder="耗材搜索" style="width: 200px; margin-left: 20px" @select="handleSelect" />
:fetch-suggestions="querySearchAsync"
value-key="conName"
placeholder="耗材搜索"
style="width: 200px; margin-left: 20px"
@select="handleSelect"
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@@ -141,30 +98,17 @@
</el-table-column> </el-table-column>
<el-table-column label="单位"> <el-table-column label="单位">
<template v-slot="scope"> <template v-slot="scope">
<el-select <el-select v-model="scope.row.unit" :placeholder="scope.row.unit" @change="changeUnit(scope.row)">
v-model="scope.row.unit"
:placeholder="scope.row.unit"
@change="changeUnit(scope.row)"
>
<el-option :label="scope.row.conUnit" :value="scope.row.conUnit" /> <el-option :label="scope.row.conUnit" :value="scope.row.conUnit" />
<el-option <el-option v-if="scope.row.conUnitTwo" :label="scope.row.conUnitTwo" :value="scope.row.conUnitTwo" />
v-if="scope.row.conUnitTwo"
:label="scope.row.conUnitTwo"
:value="scope.row.conUnitTwo"
/>
</el-select> </el-select>
<div class="tips">&nbsp;</div> <div class="tips">&nbsp;</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="数量"> <el-table-column label="数量">
<template v-slot="scope"> <template v-slot="scope">
<el-input-number <el-input-number v-model="scope.row.stockNumber" :min="0" :step="1" step-strictly
v-model="scope.row.stockNumber" controls-position="right" />
:min="0"
:step="1"
step-strictly
controls-position="right"
/>
<div class="tips" style="font-size: 16px"> <div class="tips" style="font-size: 16px">
{{ type == "in" ? "入库" : "出库" }} {{ type == "in" ? "入库" : "出库" }}
{{ returnStockNumber(scope.row, scope.row.number) }} {{ returnStockNumber(scope.row, scope.row.number) }}
@@ -178,7 +122,11 @@
<el-input :value="xiaoji(scope.row)" readonly style="width: 100px" /> <el-input :value="xiaoji(scope.row)" readonly style="width: 100px" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注">
<template v-slot="scope">
<el-input v-model="textarea" stype="textarea" placeholder="" />
</template>
</el-table-column>
<el-table-column label="操作" width="80"> <el-table-column label="操作" width="80">
<template v-slot="scope"> <template v-slot="scope">
<el-button link @click="tableData.list.splice(scope.$index, 1)">删除</el-button> <el-button link @click="tableData.list.splice(scope.$index, 1)">删除</el-button>
@@ -191,17 +139,8 @@
</div> </div>
<!-- 选择耗材 --> <!-- 选择耗材 -->
<ConsumableList ref="ConsumableList" @success="selectConsumable" /> <ConsumableList ref="ConsumableList" @success="selectConsumable" />
<el-dialog <el-dialog v-model="showResult" :show-close="false" :close-on-press-escape="false" :close-on-click-modal="false">
v-model="showResult" <el-result icon="success" title="入库提交成功" :subTitle="`共操作${tableData.list.length}件商品`">
:show-close="false"
:close-on-press-escape="false"
:close-on-click-modal="false"
>
<el-result
icon="success"
title="入库提交成功"
:subTitle="`共操作${tableData.list.length}件商品`"
>
<template #extra> <template #extra>
<template> <template>
<el-button type="primary" size="medium" @click="resetHandle">创建新的入库单</el-button> <el-button type="primary" size="medium" @click="resetHandle">创建新的入库单</el-button>
@@ -500,6 +439,5 @@ export default {
} }
} }
.app-container { .app-container {}
}
</style> </style>