优化库存管理

This commit is contained in:
gyq 2024-07-02 14:09:43 +08:00
parent 67207be4f2
commit 06101c6ed2
3 changed files with 16 additions and 13 deletions

View File

@ -423,7 +423,7 @@ export function isPcBowser() {
* decimal你保留的几位,默认保留小数后两位
*/
export function formatDecimal(num, decimal = 2) {
num = num.toString();
num = num.toFixed(3).toString();
const index = num.indexOf(".");
if (index !== -1) {
num = num.substring(0, decimal + index + 1);

View File

@ -1,24 +1,27 @@
<!-- 新增库存盘点 -->
<template>
<el-dialog title="库存盘点" :visible.sync="dialogVisible">
<el-dialog title="库存盘点" :visible.sync="dialogVisible" width="80%" @open="form.note = ''">
<el-form ref="form" :model="form" :rules="rules" label-position="left" inline>
<el-form-item label="账存数量">
<el-input v-model="detail.stockNumber" readonly></el-input>
<el-input v-model="detail.stockNumber" readonly style="width: 180px;"></el-input>
</el-form-item>
<el-form-item label="实际数量" prop="stocktakinNum">
<el-input-number v-model="form.stocktakinNum"></el-input-number>
<el-form-item label="实际数量">
<el-input-number v-model="form.stocktakinNum" :min="0" :step="1" step-strictly
style="width: 180px;"></el-input-number>
</el-form-item>
<el-form-item label="盈亏数量">
<el-input v-model="profitNumber" readonly :class="{ lose: profitNumber < 0 }"></el-input>
<el-input v-model="profitNumber" readonly :class="{ lose: profitNumber < 0 }"
style="width: 180px;"></el-input>
</el-form-item>
<el-form-item label="单价">
<el-input v-model="detail.salePrice" readonly></el-input>
</el-form-item>
<el-form-item label="盈亏金额">
<el-input v-model="profitPrice" readonly :class="{ lose: profitNumber < 0 }"></el-input>
<el-input v-model="profitPrice" readonly :class="{ lose: profitNumber < 0 }"
style="width: 180px;"></el-input>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form.note" placeholder="请输入备注"></el-input>
<el-input v-model="form.note" placeholder="请输入备注" style="width: 300px;"></el-input>
</el-form-item>
<el-form-item>
<el-button @click="dialogVisible = false"> </el-button>
@ -44,14 +47,14 @@
{{ scope.row.price }}
</template>
</el-table-column>
<el-table-column label="库存" prop="stock"></el-table-column>
<el-table-column label="帐存库存" prop="stock"></el-table-column>
<el-table-column label="盈亏数量" prop="phaseNum"></el-table-column>
<el-table-column label="盈亏金额" prop="phasePrice">
<template v-slot="scope">
{{ scope.row.phasePrice }}
</template>
</el-table-column>
<el-table-column label="盘点数量" prop="inventoryStock"></el-table-column>
<el-table-column label="实际库存" prop="inventoryStock"></el-table-column>
<el-table-column label="盘点时间" prop="createTime"></el-table-column>
<el-table-column label="盘点备注" prop="note"></el-table-column>
</el-table>
@ -131,7 +134,7 @@ export default {
});
this.getTableData()
} catch (error) {
this.dialogVisible = false
this.loading = false
console.log(error)
}
}
@ -169,7 +172,7 @@ export default {
name: this.searhForm.name,
skuId: this.searhForm.category,
productId: this.searhForm.productId,
sort: 'id',
sort: 'id,desc',
})
this.tableData.list = res.content
this.tableData.total = res.totalElements

View File

@ -117,7 +117,7 @@
</div>
</el-dialog>
<!-- 新增库存盘点 -->
<AddStockTakin ref="AddStockTakin" @success="getTableData" />
<AddStockTakin ref="AddStockTakin" @success="resetHandle" />
</div>
</template>