商品列表新增时间筛选,增加库存预警,优化耗材绑定显示

This commit is contained in:
gyq 2024-10-08 16:37:39 +08:00
parent 976aecb7bf
commit 44c2f6c3dd
2 changed files with 34 additions and 12 deletions

View File

@ -736,11 +736,11 @@ export function queryShopUserFlow(params) {
}
// 商品列表 V2
export function tbProductListV2(params) {
export function tbProductListV2(data) {
return request({
url: `/api/tbProduct/list/v2`,
method: "get",
params
method: "post",
data
});
}

View File

@ -16,6 +16,11 @@
<el-option :label="item.label" :value="item.typeEnum" v-for="item in typeEnums" :key="item.typeEnum" />
</el-select>
</el-col>
<el-col :span="6">
<el-date-picker v-model="query.createdAt" type="daterange" range-separator="" start-placeholder="开始日期"
end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-col>
<el-col :span="6">
<el-button type="primary" @click="queryHandle">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
@ -142,10 +147,11 @@
<template v-slot="scope">
<div class="cons_wrap" v-if="scope.row.typeEnum">
<div v-if="scope.row.conInfos && scope.row.conInfos.length">
<el-button type="text" v-for="item in scope.row.conInfos" :key="item.id"
@click="showBindCons(scope.row)">{{ item.conName }}</el-button>
<el-button type="text" @click="showBindCons(scope.row)">
{{ scope.row.conInfos | conInfosFilter }}
</el-button>
</div>
<el-button type="text" @click="showBindCons(scope.row)">
<el-button v-else type="text" @click="showBindCons(scope.row)">
绑定
<i class="el-icon-edit"></i>
</el-button>
@ -227,7 +233,7 @@
<el-dialog title="修改库存预警" :visible.sync="showStockWarning" :show-close="false" width="300px">
<el-form :model="editorForm">
<el-form-item label="库存预警">
<el-input-number v-model="warnLine" :min="0" />
<el-input-number v-model="warnLineValue" :min="0" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@ -257,7 +263,8 @@ export default {
productId: '',
name: '',
categoryId: '',
typeEnum: ''
typeEnum: '',
createdAt: []
},
categorys: [],
typeEnums: settings.typeEnum,
@ -287,7 +294,14 @@ export default {
countInfo: {},
showStockWarning: false, //
warnLineLoading: false,
warnLine: 0
warnLine: 0,
warnLineValue: 0
}
},
filters: {
conInfosFilter(arr) {
let newarr = arr.map(item => item.conName)
return newarr.join('、')
}
},
async mounted() {
@ -311,6 +325,7 @@ export default {
// 线
showStockWarningHandle() {
this.showStockWarning = true
this.warnLineValue = this.warnLine
},
// 线
async stockWarnLineConfirm() {
@ -318,11 +333,13 @@ export default {
this.warnLineLoading = true
const res = await stockWarnLine({
shopId: localStorage.getItem('shopId'),
warnLine: this.warnLine
warnLine: this.warnLineValue
})
this.warnLineLoading = false
this.showStockWarning = false
this.$message.success('修改成功')
this.getTableData()
} catch (error) {
this.warnLineLoading = false
console.log(error);
@ -336,7 +353,11 @@ export default {
async tbProductStockDetailStockCount() {
try {
const res = await tbProductStockDetailStockCount({
shopId: localStorage.getItem('shopId')
shopId: localStorage.getItem('shopId'),
productName: this.query.name,
categoryId: this.query.categoryId,
startTime: this.query.createdAt[0] || '',
endTime: this.query.createdAt[1] || ''
})
this.countInfo = res
} catch (error) {
@ -480,7 +501,8 @@ export default {
id: this.query.productId,
type: this.query.typeEnum,
shopId: localStorage.getItem('shopId'),
sort: this.tableData.sort
sort: this.tableData.sort,
createdAt: this.query.createdAt
})
this.warnLine = res.warnLine