前台存酒取酒功能完善
This commit is contained in:
parent
4b7edf5407
commit
a2e3cae366
|
@ -34,11 +34,3 @@ export function updateStorage(data) {
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除存酒
|
|
||||||
export function delStorage(id) {
|
|
||||||
return request({
|
|
||||||
url: '/bst/storage/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
|
@ -101,10 +101,12 @@ export default {
|
||||||
this.$refs.tree.filter(this.searchValue);
|
this.$refs.tree.filter(this.searchValue);
|
||||||
},
|
},
|
||||||
filterNode(value, data) {
|
filterNode(value, data) {
|
||||||
if (!value) {
|
if (!value) return true;
|
||||||
return true;
|
|
||||||
|
if (data.type === "location" && data.originalName) {
|
||||||
|
return data.originalName.includes(value);
|
||||||
}
|
}
|
||||||
return data.name.indexOf(value) !== -1;
|
return data.name.includes(value);
|
||||||
},
|
},
|
||||||
async getList() {
|
async getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
@ -128,11 +130,13 @@ export default {
|
||||||
.filter(location => location.storeId === store.storeId)
|
.filter(location => location.storeId === store.storeId)
|
||||||
.map(location => ({
|
.map(location => ({
|
||||||
id: location.id,
|
id: location.id,
|
||||||
name: location.name,
|
name: `${location.name}(${location.currentNum || 0})`,
|
||||||
|
originalName: location.name,
|
||||||
storeId: location.storeId,
|
storeId: location.storeId,
|
||||||
storeName: store.storeName,
|
storeName: store.storeName,
|
||||||
locationId: location.id,
|
locationId: location.id,
|
||||||
type: "location"
|
type: "location",
|
||||||
|
currentNum: location.currentNum
|
||||||
}))
|
}))
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -163,14 +167,14 @@ export default {
|
||||||
this.form = {
|
this.form = {
|
||||||
id: data.locationId || data.id,
|
id: data.locationId || data.id,
|
||||||
storeId: data.storeId,
|
storeId: data.storeId,
|
||||||
name: data.name
|
name: data.originalName
|
||||||
};
|
};
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 删除按钮点击
|
// 删除按钮点击
|
||||||
handleDelete(data) {
|
handleDelete(data) {
|
||||||
this.$confirm(`是否确认删除【${data.name}】?`, "提示", {
|
this.$confirm(`是否确认删除【${data.originalName}】?`, "提示", {
|
||||||
type: "warning"
|
type: "warning"
|
||||||
}).then(async () => {
|
}).then(async () => {
|
||||||
await delLocation(data.locationId);
|
await delLocation(data.locationId);
|
||||||
|
|
|
@ -1,26 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="存放位置" prop="locationName">
|
<el-form-item label="所属用户" prop="userName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.locationName"
|
v-model="queryParams.userName"
|
||||||
placeholder="请输入存放位置ID"
|
placeholder="请输入手机号"
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="店铺名称" prop="storeName">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.storeName"
|
|
||||||
placeholder="请输入店铺名称"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="用户名称" prop="userName">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.userId"
|
|
||||||
placeholder="请输入用户名称"
|
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
|
@ -38,17 +22,9 @@
|
||||||
v-model="queryParams.deadline"
|
v-model="queryParams.deadline"
|
||||||
type="date"
|
type="date"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
||||||
placeholder="请选择存放期限">
|
placeholder="请选择截止时间">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.remark"
|
|
||||||
placeholder="请输入备注"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
@ -66,17 +42,6 @@
|
||||||
v-has-permi="['bst:storage:add']"
|
v-has-permi="['bst:storage:add']"
|
||||||
>新增</el-button>
|
>新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-has-permi="['bst:storage:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
|
@ -96,7 +61,7 @@
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:key="column.key"
|
:key="column.key"
|
||||||
:label="column.label"
|
:label="column.label"
|
||||||
:prop="column.key"
|
:prop="column.prop"
|
||||||
:align="column.align"
|
:align="column.align"
|
||||||
:min-width="column.minWidth"
|
:min-width="column.minWidth"
|
||||||
:sort-orders="orderSorts"
|
:sort-orders="orderSorts"
|
||||||
|
@ -108,6 +73,12 @@
|
||||||
<template v-if="column.key === 'id'">
|
<template v-if="column.key === 'id'">
|
||||||
{{d.row[column.key]}}
|
{{d.row[column.key]}}
|
||||||
</template>
|
</template>
|
||||||
|
<template v-else-if="column.key === 'currentNum'">
|
||||||
|
{{ d.row.totalNum - d.row.takenNum }}
|
||||||
|
</template>
|
||||||
|
<template v-else-if="column.key === 'specValue'">
|
||||||
|
{{ formatSpecValues(d.row.specValue) }}
|
||||||
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
{{d.row[column.key]}}
|
{{d.row[column.key]}}
|
||||||
</template>
|
</template>
|
||||||
|
@ -123,13 +94,6 @@
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-has-permi="['bst:storage:edit']"
|
v-has-permi="['bst:storage:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-has-permi="['bst:storage:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -189,11 +153,10 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listStorage, getStorage, delStorage, addStorage, updateStorage } from "@/api/bst/storage";
|
import { listStorage, getStorage, addStorage, updateStorage } from "@/api/bst/storage";
|
||||||
import { $showColumns } from '@/utils/mixins';
|
import { $showColumns } from '@/utils/mixins';
|
||||||
import FormCol from "@/components/FormCol/index.vue";
|
import FormCol from "@/components/FormCol/index.vue";
|
||||||
import {listBooth} from "@/api/bst/booth";
|
|
||||||
import {listLocation} from "@/api/bst/location";
|
|
||||||
|
|
||||||
// 默认排序字段
|
// 默认排序字段
|
||||||
const defaultSort = {
|
const defaultSort = {
|
||||||
|
@ -221,14 +184,13 @@ export default {
|
||||||
// 字段列表
|
// 字段列表
|
||||||
columns: [
|
columns: [
|
||||||
{key: 'locationName', visible: true, label: '存放位置', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'locationName', visible: true, label: '存放位置', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
{key: 'storeName', visible: true, label: '店铺名称', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'userName', visible: true, label: '所属用户', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
{key: 'userName', visible: true, label: '用户名称', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
|
||||||
{key: 'goodsName', visible: true, label: '商品名称', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'goodsName', visible: true, label: '商品名称', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
{key: 'totalNum', visible: true, label: '存放数量', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'currentNum', visible: true, label: '当前数量', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
{key: 'takenNum', visible: true, label: '已取数量', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'deadline', visible: true, label: '存放期限', minWidth: null, sortable: true, overflow: false, align: 'center', width: "100"},
|
||||||
{key: 'deadline', visible: true, label: '存放期限', minWidth: null, sortable: false, overflow: false, align: 'center', width: "100"},
|
{key: 'specValue', visible: true, label: '商品规格', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
{key: 'specValue', visible: true, label: '规格值JSON', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
|
||||||
{key: 'remark', visible: true, label: '备注', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'remark', visible: true, label: '备注', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
|
{key: 'createTime', visible: true, label: '存入时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
],
|
],
|
||||||
// 排序方式
|
// 排序方式
|
||||||
orderSorts: ['ascending', 'descending', null],
|
orderSorts: ['ascending', 'descending', null],
|
||||||
|
@ -301,6 +263,10 @@ export default {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
formatSpecValues(specValue) {
|
||||||
|
if (!Array.isArray(specValue)) return '';
|
||||||
|
return specValue.map(item => item.value).join(', ');
|
||||||
|
},
|
||||||
/** 当排序按钮被点击时触发 **/
|
/** 当排序按钮被点击时触发 **/
|
||||||
onSortChange(column) {
|
onSortChange(column) {
|
||||||
if (column.order == null) {
|
if (column.order == null) {
|
||||||
|
|
|
@ -1,46 +1,23 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="存放明细ID" prop="storageId">
|
<el-form-item label="店铺名称" prop="storeName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.storageId"
|
v-model="queryParams.storeName"
|
||||||
placeholder="请输入存放明细ID"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="店铺ID" prop="storeId">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.storeId"
|
|
||||||
placeholder="请输入店铺ID"
|
placeholder="请输入店铺ID"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="用户ID" prop="userId">
|
<el-form-item label="用户名称" prop="userName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.userId"
|
v-model="queryParams.userName"
|
||||||
placeholder="请输入用户ID"
|
placeholder="请输入用户名称"
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="原因" prop="reason">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.reason"
|
|
||||||
placeholder="请输入原因"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="取酒数量" prop="number">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.number"
|
|
||||||
placeholder="请输入取酒数量"
|
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
@ -58,17 +35,6 @@
|
||||||
v-has-permi="['bst:storageRecord:add']"
|
v-has-permi="['bst:storageRecord:add']"
|
||||||
>新增</el-button>
|
>新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-has-permi="['bst:storageRecord:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
|
@ -83,7 +49,6 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="storageRecordList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="onSortChange">
|
<el-table v-loading="loading" :data="storageRecordList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="onSortChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<template v-for="column of showColumns">
|
<template v-for="column of showColumns">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:key="column.key"
|
:key="column.key"
|
||||||
|
@ -100,30 +65,15 @@
|
||||||
<template v-if="column.key === 'id'">
|
<template v-if="column.key === 'id'">
|
||||||
{{d.row[column.key]}}
|
{{d.row[column.key]}}
|
||||||
</template>
|
</template>
|
||||||
|
<template v-else-if="column.key === 'specValue'">
|
||||||
|
{{ formatSpecValues(d.row.specValue) }}
|
||||||
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
{{d.row[column.key]}}
|
{{d.row[column.key]}}
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</template>
|
</template>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-has-permi="['bst:storageRecord:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-has-permi="['bst:storageRecord:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
|
@ -183,11 +133,13 @@ export default {
|
||||||
span: 24,
|
span: 24,
|
||||||
// 字段列表
|
// 字段列表
|
||||||
columns: [
|
columns: [
|
||||||
{key: 'id', visible: true, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'storeName', visible: true, label: '店铺名称', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
{key: 'storageId', visible: true, label: '存放明细ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'userName', visible: true, label: '用户名称', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
{key: 'storeId', visible: true, label: '店铺ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'goodsName', visible: true, label: '商品名称', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
{key: 'userId', visible: true, label: '用户ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'specValue', visible: true, label: '规格', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
{key: 'reason', visible: true, label: '原因', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'reason', visible: true, label: '原因', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
|
{key: 'beforeNumber', visible: true, label: '取前数量', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
|
{key: 'afterNumber', visible: true, label: '取后数量', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
{key: 'number', visible: true, label: '取酒数量', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
{key: 'number', visible: true, label: '取酒数量', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
],
|
],
|
||||||
// 排序方式
|
// 排序方式
|
||||||
|
@ -249,6 +201,10 @@ export default {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
formatSpecValues(specValue) {
|
||||||
|
if (!Array.isArray(specValue)) return '';
|
||||||
|
return specValue.map(item => item.value).join(', ');
|
||||||
|
},
|
||||||
/** 当排序按钮被点击时触发 **/
|
/** 当排序按钮被点击时触发 **/
|
||||||
onSortChange(column) {
|
onSortChange(column) {
|
||||||
if (column.order == null) {
|
if (column.order == null) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user