优化bug

This commit is contained in:
duan 2024-06-21 17:41:00 +08:00
parent 776ad6dc26
commit 15b9dddc4c
2 changed files with 13 additions and 3 deletions

View File

@ -9,7 +9,7 @@
<el-option label="其他出库" value="other-out"></el-option>
</el-select>
<el-date-picker v-model="query.createdAt" type="daterange" range-separator="" start-placeholder="开始日期"
end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss">
end-placeholder="结束日期" value-format="yyyy-MM-dd">
</el-date-picker>
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
@ -38,7 +38,7 @@
</el-table-column>
<el-table-column label="剩余库存">
<template v-slot="scope">
{{ scope.row.leftNumber - scope.row.stockNumber }} {{ scope.row.unitName }}
{{ scope.row.leftNumber + scope.row.stockNumber }} {{ scope.row.unitName }}
</template>
</el-table-column>
<el-table-column label="操作时间" prop="updatedAt">
@ -81,6 +81,13 @@ export default {
methods: {
async getTableData() {
this.tableData.loading = true
console.log(this.query.createdAt, '调试111')
let arr = []
if (this.query.createdAt.length) {
arr = [this.query.createdAt[0] + ' 00:00:00', this.query.createdAt[1] + ' 23:59:59']
} else {
arr = []
}
try {
const res = await tbProductStockDetail({
page: this.tableData.page,
@ -89,7 +96,7 @@ export default {
shopId: localStorage.getItem('shopId'),
productId: this.goods.proId,
type: this.query.type,
createdAt: this.query.createdAt
createdAt: arr
})
this.tableData.loading = false
this.tableData.list = res.content
@ -109,6 +116,8 @@ export default {
this.query.blurry = ''
this.tableData.page = 0
this.tableData.list = []
this.query.type = ''
this.query.createdAt = []
this.getTableData()
},
async show(obj) {

View File

@ -7,6 +7,7 @@
<el-table :data="tableData.detail.stockSnap" v-loading="tableData.loading" height="400px">
<el-table-column :label="`商品名称`" prop="name"></el-table-column>
<el-table-column label="规格" prop="specSnap"></el-table-column>
<el-table-column label="原库存" prop="stockNumber"></el-table-column>
<el-table-column label="变动数量" prop="number">
<template v-slot="scope">
{{ scope.row.number }} {{ scope.row.unitName }}