Merge branch 'dev' of e.coding.net:g-cphe0354/yinshoukeguanliduan/management into dwb

This commit is contained in:
duan 2024-07-09 16:14:54 +08:00
commit d955593106
26 changed files with 1337 additions and 243 deletions

View File

@ -1,7 +1,7 @@
ENV = 'development'
# 接口地址
# VUE_APP_BASE_API = 'http://192.168.2.17:8000'
# VUE_APP_BASE_API = 'http://192.168.2.202:8000'
# VUE_APP_BASE_API = 'http://192.168.2.42:8000'
# VUE_APP_BASE_API = 'http://192.168.2.133:8000'
# 测试

View File

@ -38,6 +38,13 @@ npm run build:prod
#### 常见问题
0、运行报错
解决方案:
```
$env:NODE_OPTIONS="--openssl-legacy-provider"
```
1、linux 系统在安装依赖的时候会出现 node-sass 无法安装的问题
解决方案:

View File

@ -0,0 +1,54 @@
import request from "@/utils/request";
/**
* 查询歌曲列表
* @returns
*/
export function tbShopSonglist(params) {
return request({
url: "/api/tbShopSong",
method: "get",
params: {
shopId: localStorage.getItem("shopId"),
...params
}
});
}
/**
* 新增歌曲
* @returns
*/
export function tbShopSongAdd(data) {
return request({
url: "/api/tbShopSong",
method: "post",
data: {
shopId: localStorage.getItem("shopId"),
...data
}
});
}
/**
* 修改歌曲
* @returns
*/
export function tbShopSongEdit(data) {
return request({
url: "/api/tbShopSong",
method: "put",
data
});
}
/**
* 删除歌曲
* @returns
*/
export function tbShopSongDel(ids) {
return request({
url: 'api/tbProduct/',
method: 'delete',
data: ids
})
}

View File

@ -63,7 +63,7 @@ export function posttbConsInfostockIn(data) {
export function postapitbConsInfo(data) {
return request({
url: '/api/tbConsInfo',
method: "post",
method: "put",
data
});
}

View File

@ -443,6 +443,21 @@ export function queryAllShopUser(params) {
}
});
}
/**
* 查询商家用户概述信息
* @returns
*/
export function queryAllShopInfo(params) {
return request({
url: `/api/tbShopUser/summary`,
method: "get",
params: {
shopId: localStorage.getItem("shopId"),
...params
}
});
}
/**
* 修改商品排序

View File

@ -85,3 +85,36 @@ export function downloadTableCode(data) {
responseType: "blob"
});
}
/**
* 桌台统计
* @returns
*/
export function summaryTable(params) {
return request({
url: `/api/summary/table`,
method: "get",
params:{
shopId: localStorage.getItem("shopId"),
...params
}
});
}
/**
* 桌台统计导出文档
* @returns
*/
export function summaryTableDownload(data) {
return request({
url: `/api/summary/table/download`,
method: "POST",
data:{
shopId: localStorage.getItem("shopId"),
...data
},
responseType: 'blob'
});
}

View File

@ -52,6 +52,12 @@ export const constantRouterMap = [
component: (resolve) => require(['@/views/home/data_forms'], resolve),
name: 'data_forms',
meta: { title: '数据报表' }
},
{
path: 'data_tables',
component: (resolve) => require(['@/views/home/data_tables'], resolve),
name: 'data_tables',
meta: { title: '桌台统计' }
}
]
},

View File

@ -1,3 +1,139 @@
<template>
<div>点歌</div>
</template>
<div class="app-container">
<div class="head-container">
<el-button type="primary" icon="el-icon-plus" @click="$refs.addSong.show()">
添加歌曲
</el-button>
</div>
<div class="head-container" id="table_drag">
<el-table :data="tableData.list" v-loading="tableData.loading" row-key="id">
<el-table-column label="排序" sortable prop="sort"></el-table-column>
<el-table-column label="id" prop="id"></el-table-column>
<el-table-column label="歌曲图片" prop="img">
<template v-slot="scope">
<el-image :src="scope.row.img"
style="width:40px;height: 40px;border-radius: 4px;background-color: #efefef;">
<div class="img_error" slot="error">
<i class="icon el-icon-document-delete"></i>
</div>
</el-image>
</template>
</el-table-column>
<el-table-column label="歌曲名称" prop="name"></el-table-column>
<el-table-column label="演出歌手" prop="singer"></el-table-column>
<el-table-column label="单价" prop="price"></el-table-column>
<el-table-column label="点唱次数" prop="salesNumber"></el-table-column>
<el-table-column label="歌曲状态" prop="status">
<template v-slot="scope">
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0"
@change="showChange($event, scope.row)"></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" width="240">
<template v-slot="scope">
<!-- <el-button type="text" icon="el-icon-rank" v-if="isPcBowser">排序</el-button>
<el-button type="text" size="mini" round icon="el-icon-edit" @click="$refs.addSong.show(scope.row)"
style="margin-left: 20px !important;">编辑</el-button> -->
<el-button type="text" size="mini" round icon="el-icon-edit" @click="$refs.addSong.show(scope.row)">编辑</el-button>
<el-popconfirm title="确定删除吗?" @confirm="delHandle([scope.row.id])">
<el-button type="text" size="mini" round icon="el-icon-delete" slot="reference">
删除
</el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
</div>
<addSong ref="addSong" @success="addSongSuccess"></addSong>
<el-pagination @size-change="paginationSizeChange" :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</div>
</template>
<script>
import Sortable from 'sortablejs'
import {
tbShopSonglist,tbShopSongDel,tbShopSongEdit
} from '@/api/application-song'
import addSong from './componentsCompoents/add-song.vue'
export default {
components: {
addSong
},
data() {
return {
tableData: {
page: 0,
size: 10,
total: 0,
loading: false,
list: []
}
}
},
mounted() {
this.getTableData()
},
methods: {
addSongSuccess() {
this.getTableData()
},
paginationSizeChange(e){
this.tableData.size = e
this.getTableData()
},
async showChange(e,row){
try {
this.tableData.loading = true
const data = { ...row }
data.status = e
await tbShopSongEdit(data, 'put')
this.getTableData()
} catch (error) {
console.log(error)
this.tableData.loading = false
}
},
//
resetHandle() {
this.tableData.page = 0;
this.getTableData()
},
//
paginationChange(e) {
this.tableData.page = e - 1
this.getTableData()
},
//
async delHandle(ids) {
try {
await tbShopSongDel(ids)
this.$notify({
title: '成功',
message: `删除成功`,
type: 'success'
});
this.getTableData()
} catch (error) {
console.log(error)
}
},
//
async getTableData() {
try {
this.tableData.loading = true
const res = await tbShopSonglist({
page: this.tableData.page+1,
size: this.tableData.size,
sort: 'id',
shopId: localStorage.getItem('shopId')
})
this.tableData.loading = false
this.tableData.list = res.content
this.tableData.total = res.totalElements
} catch (error) {}
}
}
}
</script>

View File

@ -0,0 +1,161 @@
<template>
<el-dialog :title="title" width="500px" :visible.sync="dialogVisible">
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="left">
<el-form-item label="歌曲图片">
<uploadImg ref="uploadImg" :limit="1" @success="uploadSuccess" @remove="uploadRemove" />
<div class="tips"></div>
</el-form-item>
<el-form-item label="歌曲名称" prop="name">
<el-input v-model="form.name"></el-input>
</el-form-item>
<el-form-item label="原唱歌手">
<el-input v-model="form.originSinger"></el-input>
</el-form-item>
<el-form-item label="演出歌手名称" prop="singer">
<el-input v-model="form.singer"></el-input>
</el-form-item>
<el-form-item label="单价" prop="price">
<el-input type="number" v-model="form.price"></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input type="number" v-model="form.sort"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="onSubmitHandle"> </el-button>
</span>
</el-dialog>
</template>
<script>
import uploadImg from '@/components/uploadImg'
import {
tbShopSongAdd,tbShopSongEdit
} from '@/api/application-song'
export default {
components: {
uploadImg
},
data() {
return {
title: '新增歌曲',
dialogVisible: false,
rules: {
name: [{
required: true,
message: '歌曲名称必填',
trigger: 'blur'
}],
singer: [{
required: true,
message: '演出歌手名称必填',
trigger: 'blur'
}],
price: [{
required: true,
message: '单价必填',
trigger: 'blur'
}],
sort: [{
required: true,
message: '排序必填',
trigger: 'blur'
}]
},
form: {
img: '',
name: '',
singer: '',
originSinger: '',
price: 0,
sort: 0
}
}
},
mounted() {
console.log(this.form);
},
methods: {
uploadSuccess(res) {
this.form.img = res[0]
console.log(this.form.img);
},
uploadRemove() {
this.form.img = ''
},
//
onSubmitHandle() {
console.log(this.form)
this.$refs.form.validate(async valid => {
if (valid) {
try {
let res = ''
if (this.form.id) { //
res = await tbShopSongEdit(this.form)
this.$notify({
title: '成功',
message: `修改成功`,
type: 'success'
});
} else {
//
res = await tbShopSongAdd(this.form)
this.$notify({
title: '成功',
message: `添加成功`,
type: 'success'
});
}
this.$emit('success', res)
this.close()
} catch (error) {
console.log(error)
}
}
})
},
async show(obj = {}, wine = false) {
console.log(obj);
this.dialogVisible = true
if (obj && obj.id) {
this.form = {
...obj
}
}
if (obj && obj.img) {
this.form.img = obj.img
requestAnimationFrame(()=>{
this.$refs.uploadImg.fileList = [{
url: obj.img
}]
})
}
},
close() {
this.dialogVisible = false
},
reset() {
this.form = {
...this.resetForm
}
}
}
}
</script>
<style scoped lang="scss">
.goods_info {
background-color: #f9f9f9;
padding: 10px;
display: flex;
align-items: center;
.info {
flex: 1;
padding-left: 10px;
}
}
</style>

View File

@ -86,11 +86,17 @@
{{ scope.row.cash }}
</template>
</el-table-column>
<el-table-column label="会员支付" prop="deposit">
<el-table-column label="会员充值" prop="cash">
<template v-slot="scope">
{{ scope.row.recharge }}
</template>
</el-table-column>
<el-table-column label="会员支付" prop="cash">
<template v-slot="scope">
{{ scope.row.deposit }}
</template>
</el-table-column>
<!-- <el-table-column label="充值金额" prop="cash">
<template v-slot="scope">
{{ scope.row.recharge }}

View File

@ -0,0 +1,389 @@
<template>
<div class="app-container">
<!-- <el-tabs v-model="orderType" @tab-click="getTableData">
<el-tab-pane label="收款" name="1"></el-tab-pane>
<el-tab-pane label="销量" name="2"></el-tab-pane>
</el-tabs> -->
<div class="head-container">
<el-form :model="query" inline label-position="left">
<el-radio-group v-model="timeValue" @change="timeChange">
<el-radio-button label="">全部</el-radio-button>
<el-radio-button label="0">今天</el-radio-button>
<el-radio-button label="-1">昨天</el-radio-button>
<el-radio-button label="-7">最近7天</el-radio-button>
<el-radio-button label="-30">最近30天</el-radio-button>
<el-radio-button label="week">本周</el-radio-button>
<el-radio-button label="month">本月</el-radio-button>
<el-radio-button label="custom">自定义</el-radio-button>
</el-radio-group>
<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-form-item>
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
<el-button icon="el-icon-download" v-loading="downloadLoading" @click="downloadHandle">
<span v-if="!downloadLoading">导出Excel</span>
<span v-else>下载中...</span>
</el-button>
</el-form-item>
</el-form>
</div>
<!-- <div class="head-container">
<div class="collect_wrap">
<div class="item" v-for="item in payCountList" :key="item.id">
<div class="icon_wrap" style="--bg-color:#C978EE">
<i class="icon" :class="item.icon"></i>
</div>
<div class="info">
<div class="m">
<template v-if="item.isAmount == 1"></template>
{{ item.payAmount }}
</div>
<div class="t">{{ item.payType }}</div>
</div>
</div>
</div>
</div> -->
<div class="head-container">
<el-table :data="tableData.data" v-loading="tableData.loading" v-if="orderType == 1">
<el-table-column
type="index"
width="50">
</el-table-column>
<!-- <el-table-column label="序号" prop="id"></el-table-column> -->
<!-- <el-table-column label="区域id" prop="areaId"></el-table-column> -->
<el-table-column label="区域名称" prop="areaName"></el-table-column>
<!-- <el-table-column label="门店id" prop="shopId"></el-table-column> -->
<!-- <el-table-column label="台桌Id" prop="tableId"></el-table-column> -->
<el-table-column label="台桌号" prop="tableName"></el-table-column>
<el-table-column label="订单数量" prop="orderCount">
<template v-slot="scope">
<div class="cursor-pointer" @click="toTableOrderList(scope.row)">
{{ scope.row.orderCount }}
</div>
</template>
</el-table-column>
<el-table-column label="订单金额" prop="orderAmount"></el-table-column>
</el-table>
<!-- <el-table :data="tableData.data" v-loading="tableData.loading" v-if="orderType == 2">
<el-table-column label="商品名称" prop="productName"></el-table-column>
<el-table-column label="商品分类" prop="cateName"></el-table-column>
<el-table-column label="商品描述" prop="productSkuName"></el-table-column>
<el-table-column label="销量" prop="salesNum"></el-table-column>
<el-table-column label="退单量" prop="refNum"></el-table-column>
<el-table-column label="销售金额" prop="salesAmount">
<template v-slot="scope">
{{ scope.row.salesAmount }}
</template>
</el-table-column>
<el-table-column label="退款金额" prop="refAmount">
<template v-slot="scope">
{{ scope.row.refAmount }}
</template>
</el-table-column>
</el-table> -->
</div>
<div class="head-container">
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
@current-change="paginationChange" @size-change="sizeChange"
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</div>
</div>
</template>
<script>
import { summaryTable,summaryTableDownload } from '@/api/table'
import dayjs from "dayjs";
import { downloadFile } from "@/utils/index";
export default {
data() {
return {
timeValue: "",
resetQuery: null,
orderType: "1",
categorys: [],
query: {
createdAt: [],
proName: '',
cateId: ''
},
tableData: {
data: [],
page: 0,
size: 10,
loading: false,
total: 0
},
downloadLoading: false,
payCountList: "",
payCountTotal: 0
};
},
filters: {
timeFilter(time) {
return dayjs(time).format("YYYY-MM-DD HH:mm:ss");
}
},
mounted() {
this.resetQuery = { ...this.query };
this.getTableData();
},
methods: {
//table id
toTableOrderList(data){
console.log(data)
this.$router.push({
path:'/order_manage/order_list',
query:{
tableName: data.tableName
}
})
},
// Excel
async downloadHandle() {
try {
this.downloadLoading = true;
const file = await summaryTableDownload({
startTime: this.query.createdAt[0],
endTime: this.query.createdAt[1],
});
downloadFile(file, "数据", "xlsx");
this.downloadLoading = false;
} catch (error) {
this.downloadLoading = false;
console.log(error);
}
},
//
resetHandle() {
this.timeValue = "";
this.query = { ...this.resetQuery };
this.page = 0;
this.getTableData();
},
//
sizeChange(e) {
this.tableData.size = e;
this.getTableData();
},
//
paginationChange(e) {
this.tableData.page = e - 1;
this.getTableData();
},
async getTableData() {
this.tableData.loading = true;
try {
const res = await summaryTable({
page: this.tableData.page+1,
size: this.tableData.size,
startTime:this.query.createdAt[0],
endTime:this.query.createdAt[1]
});
this.tableData.loading = false;
this.tableData.data = res;
this.tableData.total = res.length;
} catch (error) {
console.log(error);
}
},
//
timeChange(e) {
const format = ["YYYY-MM-DD 00:00:00", "YYYY-MM-DD 23:59:59"];
switch (e) {
case "":
//
this.query.createdAt = [];
break;
case "0":
//
this.query.createdAt = [
dayjs().format(format[0]),
dayjs().format(format[1])
];
break;
case "-1":
//
this.query.createdAt = [
dayjs()
.add(-1, "d")
.format(format[0]),
dayjs()
.add(-1, "d")
.format(format[1])
];
break;
case "-7":
// 7
this.query.createdAt = [
dayjs()
.add(-7, "d")
.format(format[0]),
dayjs().format(format[1])
];
break;
case "-30":
// 7
this.query.createdAt = [
dayjs()
.add(-30, "d")
.format(format[0]),
dayjs().format(format[1])
];
break;
case "week":
//
this.query.createdAt = [
dayjs()
.startOf("week")
.format(format[0]),
dayjs()
.endOf("week")
.format(format[1])
];
break;
case "month":
//
this.query.createdAt = [
dayjs()
.startOf("month")
.format(format[0]),
dayjs()
.endOf("month")
.format(format[1])
];
break;
case "custom":
//
this.query.createdAt = [];
break;
default:
break;
}
}
}
};
</script>
<style scoped lang="scss">
.cursor-pointer{
cursor: pointer;
color: #1890ff;
transition: all 0.3s;
}
.cursor-pointer:hover{
opacity: .7;
}
.collect_wrap {
display: flex;
gap: 14px;
.item {
flex: 1;
display: flex;
align-items: center;
background-color: #f5f5f5;
padding: 20px;
.icon_wrap {
$size: 34px;
$border: 6px;
width: $size;
height: $size;
display: flex;
align-items: center;
justify-content: center;
background-color: var(--bg-color);
border-radius: 50%;
position: relative;
&::after {
content: "";
width: $size + $border;
height: $size + $border;
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: var(--bg-color);
opacity: 0.3;
}
.icon {
font-size: 16px;
color: #fff;
}
.img {
width: 20px;
height: 20px;
}
}
.info {
flex: 1;
display: flex;
flex-direction: column;
padding-left: 10px;
.m {
font-weight: bold;
}
.t {
font-size: 12px;
color: #999;
padding-top: 4px;
}
}
}
}
.refund {
color: #ff9731;
font-weight: bold;
}
.table_order_info {
.order_no {
color: #999;
}
.type {
color: #e6a23c;
}
}
.goods_info {
.row {
display: flex;
&:not(:first-child) {
margin-top: 10px;
}
.cover {
width: 40px;
height: 40px;
}
.info {
flex: 1;
display: flex;
flex-direction: column;
padding-left: 10px;
.sku {
color: #999;
}
}
}
}
</style>

View File

@ -1,7 +1,7 @@
<template>
<el-dialog title="详情" width="80%" :visible.sync="dialogVisible" @close="dialogVisible = false">
<div class="head-container">
<span>{{ tableData.detail.subType == '-1' ? '退货出库' : '供应商入库' }}</span>
<span>{{ row.type }}</span>
</div>
<div class="head-container">
<el-table :data="tableData.detail.stockSnap" v-loading="tableData.loading" height="400px">
@ -10,13 +10,14 @@
<el-table-column label="原库存" prop="stockNumber"></el-table-column>
<el-table-column label="变动数量" prop="number">
<template v-slot="scope">
<span v-if="tableData.detail.subType==-1">-</span> {{ scope.row.number }} {{ scope.row.unitName }}
<span v-if="tableData.detail.subType == -1">-</span> {{ scope.row.number }} {{
scope.row.unitName
}}
</template>
</el-table-column>
<el-table-column label="现有库存" prop="number">
<template v-slot="scope">
{{ returnNowHasNumbr( scope.row)}}
{{ returnNowHasNumbr(scope.row) }}
<!-- {{ scope.row.stockNumber*1 + scope.row.number*1 }} {{ scope.row.unitName }} -->
</template>
</el-table-column>
@ -37,6 +38,7 @@ export default {
data() {
return {
dayjs,
row: '',
dialogVisible: false,
tableData: {
loading: false,
@ -51,12 +53,13 @@ export default {
},
methods: {
//
returnNowHasNumbr(row){
return row.stockNumber*1 + row.number*1 +row.unitName
returnNowHasNumbr(row) {
return row.stockNumber * 1 + row.number * 1 + row.unitName
},
show(id) {
show(row) {
this.dialogVisible = true
this.getTableData(id)
this.row = row
this.getTableData(row.id)
},
async getTableData(id) {
this.tableData.loading = true

View File

@ -38,7 +38,8 @@
<div class="head-container">
<el-pagination :total="clickseetableData.total" :current-page="clickseetableData.page + 1"
:page-size="clickseetableData.size" layout="total, sizes, prev, pager, next, jumper"
@current-change="paginationChangetype" />
@current-change="paginationChangetype"
@size-change="e => { clickseetableData.size = e; clickseetableData.page = 0; getTableData() }" />
</div>
</div>
</template>
@ -64,8 +65,12 @@ export default {
this.getTableData()
},
methods: {
pageSizeChange(e) {
this.clickseetableData.size = e
this.getTableData()
},
paginationChangetype(e) {
this.tableDatatype.page = e - 1
this.clickseetableData.page = e - 1
this.getTableData()
},
//

View File

@ -4,24 +4,61 @@
<div class="head-container">
<el-row :gutter="20">
<el-col :span="3">
<el-input v-model="query.conTypeId" size="small" clearable placeholder="请输入类型id" style="width: 100%;"
class="filter-item" @keyup.enter.native="getTableData" />
<el-input
v-model="query.conTypeId"
size="small"
clearable
placeholder="请输入类型id"
style="width: 100%;"
class="filter-item"
@keyup.enter.native="getTableData"
/>
</el-col>
<el-col :span="3">
<el-input v-model="query.conTypeName" size="small" clearable placeholder="请输入类型名称" style="width: 100%;"
class="filter-item" @keyup.enter.native="getTableData" />
<el-input
v-model="query.conTypeName"
size="small"
clearable
placeholder="请输入类型名称"
style="width: 100%;"
class="filter-item"
@keyup.enter.native="getTableData"
/>
</el-col>
<el-col :span="3">
<el-input v-model="query.conCode" size="small" clearable placeholder="请输入耗材代码" style="width: 100%;"
class="filter-item" @keyup.enter.native="getTableData" />
<el-input
v-model="query.conCode"
size="small"
clearable
placeholder="请输入耗材代码"
style="width: 100%;"
class="filter-item"
@keyup.enter.native="getTableData"
/>
</el-col>
<el-col :span="3">
<el-input v-model="query.conName" size="small" clearable placeholder="请输入耗材名称" style="width: 100%;"
class="filter-item" @keyup.enter.native="getTableData" />
<el-input
v-model="query.conName"
size="small"
clearable
placeholder="请输入耗材名称"
style="width: 100%;"
class="filter-item"
@keyup.enter.native="getTableData"
/>
</el-col>
<el-col :span="3">
<el-select v-model="query.status" placeholder="请选择商品规格" style="width: 100%;">
<el-option :label="item.label" :value="item.value" v-for="item in typeEnums" :key="item.label" />
<el-select
v-model="query.status"
placeholder="请选择商品规格"
style="width: 100%;"
>
<el-option
:label="item.label"
:value="item.value"
v-for="item in typeEnums"
:key="item.label"
/>
</el-select>
</el-col>
<el-col :span="6">
@ -33,12 +70,22 @@
<div class="head-container">
<el-row>
<el-col>
<el-button type="primary" icon="el-icon-plus" @click="clickdialogframe('add')">添加</el-button>
<el-button
type="primary"
icon="el-icon-plus"
@click="clickdialogframe('add')"
>添加</el-button
>
</el-col>
</el-row>
</div>
<div class="head-container" id="table_drag">
<el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="id">
<el-table
ref="table"
:data="tableData.data"
v-loading="tableData.loading"
row-key="id"
>
<el-table-column prop="id" label="ID" width="50px" />
<el-table-column label="耗材名称" prop="conName" />
<el-table-column label="耗材代码" prop="conCode" />
@ -47,7 +94,7 @@
<el-table-column label="单位" prop="conUnit" />
<el-table-column label="创建时间" prop="createTime" width="200">
<template v-slot="scope">
{{ dayjs(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
{{ dayjs(scope.row.createTime).format("YYYY-MM-DD HH:mm:ss") }}
</template>
</el-table-column>
<!-- <el-table-column label="最近入库量" prop="lasterInStock" /> -->
@ -65,11 +112,24 @@
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
</template> -->
</el-table-column>
<el-table-column label="操作" width="160" fixed="right">
<el-table-column label="操作" width="180" fixed="right">
<template v-slot="scope">
<el-button type="text" @click="clicksee(scope.row)">耗材记录</el-button>
<el-button type="text" size="mini" style="margin-left: 10px !important;"
@click="$refs.AddConsTakin.show(scope.row)">耗材盘点</el-button>
<el-button type="text" @click="editorHandle(scope.row)"
>编辑</el-button
>
<el-button
type="text"
@click="clicksee(scope.row)"
style="margin-left: 10px !important;"
>耗材记录</el-button
>
<el-button
type="text"
size="mini"
style="margin-left: 10px !important;"
@click="$refs.AddConsTakin.show(scope.row)"
>耗材盘点</el-button
>
<!-- <el-button type="text" icon="el-icon-rank">排序</el-button> -->
<!-- <el-button type="text" @click="clickdialogfadd(scope.row)"
style="margin-left: 10px !important;">入库</el-button> -->
@ -83,70 +143,160 @@
</el-table>
</div>
<div class="head-container">
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChange" />
<el-pagination
:total="tableData.total"
:current-page="tableData.page + 1"
:page-size="tableData.size"
layout="total, sizes, prev, pager, next, jumper"
@current-change="paginationChange"
@size-change="
e => {
tableData.size = e;
tableData.page = 0;
getTableData();
}
"
/>
</div>
<!-- 耗材入库 -->
<el-dialog title="耗材入库" :visible.sync="libraryshow">
<el-form :inline="true" ref="reflibrary" :model="libraryshowdata" :rules="ruleslibrary" class="demo-form-inline">
<el-form
:inline="true"
ref="reflibrary"
:model="libraryshowdata"
:rules="ruleslibrary"
class="demo-form-inline"
>
<el-form-item label="耗材入库数量" prop="stockNumber">
<el-input v-model.number="libraryshowdata.stockNumber" type="number" placeholder="请输入单位"></el-input>
<el-input
v-model.number="libraryshowdata.stockNumber"
type="number"
placeholder="请输入单位"
></el-input>
</el-form-item>
<el-form-item style="display: flex;justify-content: flex-end;">
<el-button @click="libraryshow = false"> </el-button>
<el-button type="primary" @click="clickdialoglibraryshow('reflibrary')"> </el-button>
<el-button
type="primary"
@click="clickdialoglibraryshow('reflibrary')"
> </el-button
>
</el-form-item>
</el-form>
</el-dialog>
<!-- 修改和增加 -->
<el-dialog :title="dialogtitle" :visible.sync="dialogshow" width="70%">
<el-form :inline="true" ref="refruleForm" :model="ruleForm" :rules="rules" class="demo-form-inline">
<el-form
:inline="true"
ref="refruleForm"
:model="ruleForm"
:rules="rules"
class="demo-form-inline"
>
<el-form-item label="单位" prop="conUnit" v-if="dialogtitle == '添加'">
<el-input v-model="ruleForm.conUnit" placeholder="请输入单位"></el-input>
<el-input
v-model="ruleForm.conUnit"
placeholder="请输入单位"
></el-input>
</el-form-item>
<el-form-item label="耗材类型" prop="conNames" v-if="dialogtitle == '添加'">
<el-input v-model="ruleForm.conNames" placeholder="请输耗材信息名称" disabled></el-input>
<el-form-item
label="耗材类型"
prop="conNames"
v-if="dialogtitle == '添加'"
>
<el-input
v-model="ruleForm.conNames"
placeholder="请输耗材信息名称"
disabled
></el-input>
</el-form-item>
<el-form-item v-if="dialogtitle == '添加'">
<el-button type="primary" @click="typedialogshow = true">去选择</el-button>
<el-button type="primary" @click="typedialogshow = true"
>去选择</el-button
>
</el-form-item>
<el-form-item label="耗材信息名称" prop="conName">
<el-input v-model="ruleForm.conName" placeholder="请输入耗材信息名称"></el-input>
<el-input
v-model="ruleForm.conName"
placeholder="请输入耗材信息名称"
></el-input>
</el-form-item>
<el-form-item label="耗材信息代码" prop="conCode">
<el-input v-model="ruleForm.conCode" placeholder="请输入耗材信息代码"></el-input>
<el-input
v-model="ruleForm.conCode"
placeholder="请输入耗材信息代码"
></el-input>
</el-form-item>
<el-form-item label="耗材价格" prop="price">
<el-input v-model="ruleForm.price" placeholder="请输入耗材价格"></el-input>
<el-input
v-model="ruleForm.price"
placeholder="请输入耗材价格"
></el-input>
</el-form-item>
<el-form-item label="预警值" prop="conWarning">
<el-input v-model="ruleForm.conWarning" placeholder="请输入耗材预警值"></el-input>
<el-input
v-model="ruleForm.conWarning"
placeholder="请输入耗材预警值"
></el-input>
</el-form-item>
<!-- <el-form-item label="单位耗材值" prop="surplusStock">
<el-input v-model="ruleForm.surplusStock" placeholder="请输入单位耗材值"></el-input>
</el-form-item> -->
<el-form-item style="display: flex;justify-content: flex-end;">
<el-button @click="dialogshow = false"> </el-button>
<el-button type="primary" @click="submitForm('refruleForm')"> </el-button>
<el-button
type="primary"
:loading="ruleFormLoading"
@click="submitForm('refruleForm')"
>
</el-button>
</el-form-item>
</el-form>
</el-dialog>
<el-dialog title="选择类型" :visible.sync="typedialogshow">
<div class="head-container">
<el-input v-model="querytypedialogshowquery.conTypeName" size="small" clearable placeholder="请输入耗材类型名称"
style="width: 100%;" class="filter-item" @keyup.enter.native="getTableDatatype" />
<el-input v-model="querytypedialogshowquery.conTypeCode" size="small" clearable placeholder="请输入耗材类型代码"
style="width: 100%;" class="filter-item" @keyup.enter.native="getTableDatatype" />
<el-select v-model="querytypedialogshowquery.status" placeholder="请选择商品规格" style="width: 100%;">
<el-option :label="item.label" :value="item.value" v-for="item in typeEnums" :key="item.label" />
<el-input
v-model="querytypedialogshowquery.conTypeName"
size="small"
clearable
placeholder="请输入耗材类型名称"
style="width: 100%;"
class="filter-item"
@keyup.enter.native="getTableDatatype"
/>
<el-input
v-model="querytypedialogshowquery.conTypeCode"
size="small"
clearable
placeholder="请输入耗材类型代码"
style="width: 100%;"
class="filter-item"
@keyup.enter.native="getTableDatatype"
/>
<el-select
v-model="querytypedialogshowquery.status"
placeholder="请选择商品规格"
style="width: 100%;"
>
<el-option
:label="item.label"
:value="item.value"
v-for="item in typeEnums"
:key="item.label"
/>
</el-select>
<div style="margin-top: 10px;">
<el-button type="primary" @click="getTableDatatype">查询</el-button>
<el-button @click="resetHandletype">重置</el-button>
</div>
</div>
<el-table ref="table" :data="tableDatatype.data" v-loading="tableDatatype.loading" row-key="id">
<el-table
ref="table"
:data="tableDatatype.data"
v-loading="tableDatatype.loading"
row-key="id"
>
<el-table-column label="耗材类型名称" prop="conTypeName" />
<el-table-column label="耗材类型代码" prop="conTypeCode" />
<el-table-column label="店铺ID" prop="shopId" />
@ -163,19 +313,30 @@
</el-table-column>
</el-table>
<div class="head-container">
<el-pagination :total="tableDatatype.total" :current-page="tableDatatype.page + 1"
:page-size="tableDatatype.size" layout="total, sizes, prev, pager, next, jumper"
@current-change="paginationChangetype" />
<el-pagination
:total="tableDatatype.total"
:current-page="tableDatatype.page + 1"
:page-size="tableDatatype.size"
layout="total, sizes, prev, pager, next, jumper"
@current-change="paginationChangetype"
/>
</div>
</el-dialog>
<el-dialog title="耗材信息" :visible.sync="clickseetypedialogshow">
<div class="head-container">
<el-table ref="table" :data="clickseetableData.data" v-loading="clickseetableData.loading" row-key="id"
height="450">
<el-table
ref="table"
:data="clickseetableData.data"
v-loading="clickseetableData.loading"
row-key="id"
height="450"
>
<el-table-column label="耗材名称" prop="conName" />
<el-table-column label="变动库存" prop="amount">
<template v-slot="scope">
<span :class="{ red: scope.row.bizType == '-' }">{{ scope.row.bizType }}{{ scope.row.amount }}</span>
<span :class="{ red: scope.row.bizType == '-' }"
>{{ scope.row.bizType }}{{ scope.row.amount }}</span
>
</template>
</el-table-column>
<el-table-column label="现有库存" prop="balance" />
@ -183,7 +344,10 @@
<el-table-column label="业务说明" prop="bizName" />
<!-- <el-table-column label="正负号标识" prop="bizType" /> -->
<!-- <el-table-column label="耗材id" prop="consId" /> -->
<el-table-column label="商品信息" prop="productName"></el-table-column>
<el-table-column
label="商品信息"
prop="productName"
></el-table-column>
<el-table-column label="创建时间" prop="createTime"></el-table-column>
<!-- <el-table-column label="更新时间" prop="updateTime">
<template v-slot="scope">
@ -193,9 +357,13 @@
</el-table>
</div>
<div class="head-container">
<el-pagination :total="clickseetableData.total" :current-page="clickseetableData.page + 1"
:page-size="clickseetableData.size" layout="total, sizes, prev, pager, next, jumper"
@current-change="paginationChangetype" />
<el-pagination
:total="clickseetableData.total"
:current-page="clickseetableData.page + 1"
:page-size="clickseetableData.size"
layout="total, sizes, prev, pager, next, jumper"
@current-change="paginationChangetype"
/>
</div>
</el-dialog>
<!-- 耗材盘点 -->
@ -204,43 +372,53 @@
</template>
<script>
import Sortable from 'sortablejs'
import dayjs from 'dayjs'
import settings from '@/settings'
import { upProSort } from '@/api/shop'
import { gettbConsType, gettbConsInfo, posttbConsInfo, gettbConsInfoFlow, posttbConsInfostockIn, postapitbConsInfo } from '@/api/consumable'
import AddConsTakin from '../components/addConsTakin'
import Sortable from "sortablejs";
import dayjs from "dayjs";
import settings from "@/settings";
import { upProSort } from "@/api/shop";
import {
gettbConsType,
gettbConsInfo,
posttbConsInfo,
gettbConsInfoFlow,
posttbConsInfostockIn,
postapitbConsInfo
} from "@/api/consumable";
import AddConsTakin from "../components/addConsTakin";
export default {
components: { AddConsTakin },
data() {
return {
dayjs,
query: {
conTypeId: '',
conTypeName: '',
conCode: '',
conName: ''
conTypeId: "",
conTypeName: "",
conCode: "",
conName: ""
},
libraryshow: false,//
libraryshow: false, //
libraryshowdata: {
id: '',
stockNumber: ''
id: "",
stockNumber: ""
},
ruleslibrary: {
stockNumber: [
{ required: true, message: '请输入入库数量', trigger: 'blur' }
],
{ required: true, message: "请输入入库数量", trigger: "blur" }
]
},
categorys: [],
typeEnums: [{
label: '正常',
value: '1'
}, {
label: '禁用',
value: '0'
}],
typeEnums: [
{
label: "正常",
value: "1"
},
{
label: "禁用",
value: "0"
}
],
dialogshow: false, //
dialogtitle: '', //
dialogtitle: "", //
typedialogshow: false,
tableData: {
data: [],
@ -250,9 +428,9 @@ export default {
total: 0
},
querytypedialogshowquery: {
conTypeCode: '',
conTypeName: '',
status: ''
conTypeCode: "",
conTypeName: "",
status: ""
},
tableDatatype: {
data: [],
@ -269,71 +447,81 @@ export default {
loading: false,
total: 0
},
ruleFormLoading: false,
ruleForm: {
conCode: '',
conName: '',
conTypeId: '',
conCode: "",
conName: "",
conTypeId: "",
price: "",
conNames: "",
// surplusStock: '',
conUnit: '',
conWarning: '',
shopId: localStorage.getItem('shopId'),
conUnit: "",
conWarning: "",
shopId: localStorage.getItem("shopId")
},
rules: {
conCode: [
{ required: true, message: '请输入耗材信息代码', trigger: 'blur' }
{ required: true, message: "请输入耗材信息代码", trigger: "blur" }
],
conName: [
{ required: true, message: '请输入耗材信息名称', trigger: 'blur' }
{ required: true, message: "请输入耗材信息名称", trigger: "blur" }
],
conNames: [
{ required: true, message: '请选择耗材类型', trigger: 'blur' }
],
price: [
{ required: true, message: '请输入耗材价格', trigger: 'blur' }
{ required: true, message: "请选择耗材类型", trigger: "blur" }
],
price: [{ required: true, message: "请输入耗材价格", trigger: "blur" }],
conWarning: [
{ required: true, message: '请输入耗材预警值', trigger: 'blur' }
{ required: true, message: "请输入耗材预警值", trigger: "blur" }
],
conTypeId: [
{ required: true, message: '请输入耗材类型id', trigger: 'blur' }
{ required: true, message: "请输入耗材类型id", trigger: "blur" }
],
conUnit: [
{ required: true, message: '请输入单位', trigger: 'blur' }
],
conWarning: [{
required: true, message: '请输入单位', trigger: 'blur'
}]
conUnit: [{ required: true, message: "请输入单位", trigger: "blur" }],
conWarning: [
{
required: true,
message: "请输入单位",
trigger: "blur"
}
]
}
}
};
},
mounted() {
this.getTableData()
this.getTableDatatype()
this.getTableData();
this.getTableDatatype();
},
methods: {
//
editorHandle(row) {
this.dialogtitle = "编辑";
for (let key in this.ruleForm) {
this.ruleForm[key] = row[key];
}
this.ruleForm.id = row.id;
this.dialogshow = true;
},
//
resetHandle() {
this.query.conTypeId = ''
this.query.conTypeName = ''
this.query.conCode = ''
this.query.conName = ''
this.tableData.page = 0
this.getTableData()
this.query.conTypeId = "";
this.query.conTypeName = "";
this.query.conCode = "";
this.query.conName = "";
this.tableData.page = 0;
this.getTableData();
},
//
paginationChange(e) {
this.tableData.page = e - 1
this.getTableData()
this.tableData.page = e - 1;
this.getTableData();
},
paginationChangetype(e) {
this.tableDatatype.page = e - 1
this.getTableDatatype()
this.tableDatatype.page = e - 1;
this.getTableDatatype();
},
//
async getTableData() {
this.tableData.loading = true
this.tableData.loading = true;
try {
const res = await gettbConsInfo({
page: this.tableData.page,
@ -342,18 +530,18 @@ export default {
conTypeName: this.query.conTypeName,
conCode: this.query.conCode,
conName: this.query.conName,
shopId: localStorage.getItem('shopId')
})
this.tableData.loading = false
this.tableData.data = res.content
this.tableData.total = res.totalElements
shopId: localStorage.getItem("shopId")
});
this.tableData.loading = false;
this.tableData.data = res.content;
this.tableData.total = res.totalElements;
} catch (error) {
console.log(error)
console.log(error);
}
},
//
async getTableDatatype() {
this.tableDatatype.loading = true
this.tableDatatype.loading = true;
try {
const res = await gettbConsType({
page: this.tableDatatype.page,
@ -361,136 +549,130 @@ export default {
conTypeCode: this.querytypedialogshowquery.conTypeCode,
conTypeName: this.querytypedialogshowquery.conTypeName,
status: this.querytypedialogshowquery.status,
shopId: localStorage.getItem('shopId')
})
this.tableDatatype.loading = false
this.tableDatatype.data = res.content
this.tableDatatype.total = res.totalElements
shopId: localStorage.getItem("shopId")
});
this.tableDatatype.loading = false;
this.tableDatatype.data = res.content;
this.tableDatatype.total = res.totalElements;
} catch (error) {
console.log(error)
console.log(error);
}
},
//
resetHandletype() {
this.querytypedialogshowquery.conTypeName = ''
this.querytypedialogshowquery.conTypeCode = ''
this.querytypedialogshowquery.status = ''
this.tableData.page = 0
this.getTableDatatype()
this.querytypedialogshowquery.conTypeName = "";
this.querytypedialogshowquery.conTypeCode = "";
this.querytypedialogshowquery.status = "";
this.tableData.page = 0;
this.getTableDatatype();
},
//
tableDatatypetable(item) {
// this.ruleForm.conCode = item.conTypeCode
this.ruleForm.conNames = item.conTypeName
this.ruleForm.conTypeId = item.id
this.typedialogshow = false
this.ruleForm.conNames = item.conTypeName;
this.ruleForm.conTypeId = item.id;
this.typedialogshow = false;
},
async clickdialogfadd(item) {
this.libraryshow = true
this.libraryshowdata.id = item.id
this.libraryshow = true;
this.libraryshowdata.id = item.id;
},
async clickdialoglibraryshow(formName) {
this.$refs[formName].validate(async (valid) => {
this.$refs[formName].validate(async valid => {
if (valid) {
await posttbConsInfostockIn({
id: this.libraryshowdata.id,
stockNumber: this.libraryshowdata.stockNumber
})
this.libraryshow = false
this.$refs[formName].resetFields()
this.getTableData()
});
this.libraryshow = false;
this.$refs[formName].resetFields();
this.getTableData();
} else {
console.log('error submit!!')
return false
console.log("error submit!!");
return false;
}
})
});
},
//
clickdialogframe(type, item) {
if (type == 'add') { //
this.dialogtitle = '添加'
if (type == "add") {
//
this.dialogtitle = "添加";
this.$nextTick(() => {
this.$refs.refruleForm.resetFields()
})
this.$refs.refruleForm.resetFields();
});
} else {
this.dialogtitle = '编辑'
this.ruleForm.id = item.id
this.ruleForm.conTypeId = item.conTypeId
this.ruleForm.conCode = item.conCode
this.ruleForm.conName = item.conName
this.dialogtitle = "编辑";
this.ruleForm.id = item.id;
this.ruleForm.conTypeId = item.conTypeId;
this.ruleForm.conCode = item.conCode;
this.ruleForm.conName = item.conName;
// this.ruleForm.surplusStock = item.surplusStock
this.ruleForm.conWarning = item.conWarning
this.ruleForm.conUnit = item.conUnit
console.log(this.ruleForm, item)
this.ruleForm.conWarning = item.conWarning;
this.ruleForm.conUnit = item.conUnit;
console.log(this.ruleForm, item);
}
this.dialogshow = true
this.dialogshow = true;
},
submitForm(formName) {
this.$refs[formName].validate(async (valid) => {
this.$refs[formName].validate(async valid => {
if (valid) {
if (this.dialogtitle == '编辑') {
await postapitbConsInfo({
id: this.ruleForm.id,
conCode: this.ruleForm.conCode,
conName: this.ruleForm.conName,
conTypeId: this.ruleForm.conTypeId,
// surplusStock: this.ruleForm.surplusStock,
conUnit: this.ruleForm.conUnit,
conWarning: item.conWarning,
shopId: this.ruleForm.shopId
})
this.dialogshow = false
} else {//
this.ruleFormLoading = true;
if (this.dialogtitle == "编辑") {
await postapitbConsInfo(this.ruleForm);
this.$message({ type: "success", message: "编辑成功" });
this.dialogshow = false;
} else {
//
await posttbConsInfo({
...this.ruleForm
})
this.$message({ type: 'success', message: '添加成功' })
});
this.$message({ type: "success", message: "添加成功" });
}
this.dialogshow = false
this.$refs[formName].resetFields()
this.getTableData()
this.dialogshow = false;
this.$refs[formName].resetFields();
this.ruleFormLoading = false;
this.getTableData();
} else {
console.log('error submit!!')
return false
console.log("error submit!!");
return false;
}
})
});
},
resetForm(formName) {
this.$refs[formName].resetFields()
this.$refs[formName].resetFields();
},
//
async delTableHandle(ids) {
try {
await tbProductDelete(ids)
this.getTableData()
await tbProductDelete(ids);
this.getTableData();
} catch (error) {
console.log(error)
console.log(error);
}
},
//
async clicksee(item) {
console.log(item)
this.clickseetypedialogshow = true
this.clickseetableData.loading = true
console.log(item);
this.clickseetypedialogshow = true;
this.clickseetableData.loading = true;
try {
const res = await gettbConsInfoFlow({
page: this.clickseetableData.page,
size: this.clickseetableData.size,
consId: item.id,
conName: item.conName,
shopId: localStorage.getItem('shopId')
})
this.clickseetableData.loading = false
this.clickseetableData.data = res.content
this.clickseetableData.total = res.totalElements
shopId: localStorage.getItem("shopId")
});
this.clickseetableData.loading = false;
this.clickseetableData.data = res.content;
this.clickseetableData.total = res.totalElements;
} catch (error) {
console.log(error)
console.log(error);
}
}
}
}
};
</script>
<style scoped lang="scss">
@ -521,4 +703,4 @@ export default {
.red {
color: rgb(219, 32, 32);
}
</style>
</style>

View File

@ -78,7 +78,8 @@
</div>
<div class="head-container">
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChange" />
layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChange"
@size-change="e => { tableData.size = e; getTableData() }" />
</div>
<el-dialog :title="dialogtitle" :visible.sync="dialogshow" width="1000px">
<el-form ref="addSelect" :inline="true">
@ -103,7 +104,7 @@
<el-button type="primary" @click="informationdialogshow = true">去选择耗材信息</el-button>
</el-form-item>
<el-form-item label="单位耗材值">
<el-input v-model="addSelect[0].surplusStock" type=number placeholder="请输入单位耗材值"></el-input>
<el-input v-model="addSelect[0].surplusStock" type=number placeholder="请输入单位耗材值"></el-input>
</el-form-item>
</template>
<template v-else>
@ -123,7 +124,7 @@
<el-button type="primary" @click="selecthaocai(i)">去选择耗材信息</el-button>
</el-form-item>
<el-form-item label="单位耗材值">
<el-input v-model="item.surplusStock" type=number placeholder="请输入单位耗材值"></el-input>
<el-input v-model="item.surplusStock" type=number placeholder="请输入单位耗材值"></el-input>
</el-form-item>
</template>
</template>
@ -177,7 +178,8 @@
<div class="head-container">
<el-pagination :total="tableDatainformation.total" :current-page="tableDatainformation.page + 1"
:page-size="tableDatainformation.size" layout="total, sizes, prev, pager, next, jumper"
@current-change="paginationChangeinformation" />
@current-change="paginationChangeinformation"
@size-change="e => { tableDatainformation.size = e; tableDatainformation.page = 0; getTableDatainformation() }" />
</div>
</el-dialog>
<el-dialog title="编辑" :visible.sync="informationdialogshowedit" width="20%">

View File

@ -66,7 +66,8 @@
</div>
<div class="head-container">
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChange" />
layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChange"
@size-change="e => { tableData.size = e; tableData.page = 0; getTableData() }" />
</div>
<el-dialog :title="dialogtitle" :visible.sync="dialogshow">
<el-form ref="refruleForm" :model="ruleForm" :rules="rules">

View File

@ -6,6 +6,11 @@
<el-input v-model="query.name" size="small" clearable placeholder="商品名称"
@keyup.enter.native="getTableData" />
<!-- <el-input v-model="query.num" placeholder="库存数量少于多少xx" /> -->
<div style="width: 300px;">
<el-select v-model="query.categoryId" placeholder="商品分类" style="width: 100%;">
<el-option :label="item.name" :value="item.id" v-for="item in categorys" :key="item.id" />
</el-select>
</div>
<div style="width: 300px;">
<el-select v-model="query.isStock" placeholder="库存开关" style="width: 100%;">
<el-option label="开" :value="1"></el-option>
@ -96,8 +101,9 @@
</el-table>
</div>
<div class="head-container">
<el-pagination @size-change="paginationSizeChange" :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
<el-pagination @size-change="paginationSizeChange" :total="tableData.total"
:current-page="tableData.page + 1" :page-size="tableData.size" @current-change="paginationChange"
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</div>
<invoicingDetail ref="invoicingDetail" />
<!-- 导入库存弹窗 -->
@ -123,6 +129,7 @@
<script>
import { stock, stockdownload, stockdoImport, stockStatewarnLine, stockStateChanges, stocks } from '@/api/invoicing'
import { tbShopCategoryGet } from '@/api/shop'
import settings from '@/settings'
import invoicingDetail from './components/invoicingDetail'
import AddStockTakin from './components/addStockTakin'
@ -139,11 +146,14 @@ export default {
dialogVisible: false,
dialogTableVisible: false,
montey: "",
categorys: [],
query: {
name: '',
isStock: '',
num: ''
num: '',
categoryId: ''
},
resetQuery: '',
downloadLoading: false,
uploadLoading: false,
warnLine: null, // 线
@ -158,6 +168,8 @@ export default {
}
},
mounted() {
this.resetQuery = { ...this.query }
this.tbShopCategoryGet()
this.getTableData()
},
methods: {
@ -277,6 +289,7 @@ export default {
name: this.query.name,
isStock: this.query.isStock,
num: this.query.num,
categoryId: this.query.categoryId,
shopId: localStorage.getItem('shopId')
})
this.tableData.loading = false
@ -287,7 +300,6 @@ export default {
element.hasChildren = true
} else {
element.hasChildren = false
}
});
this.warnLine = res.warnLine
@ -297,12 +309,41 @@ export default {
console.log(error);
}
},
//
async tbShopCategoryGet() {
try {
const res = await tbShopCategoryGet({
shopId: localStorage.getItem('shopId'),
page: 0,
size: 100,
sort: 'id'
})
let categorys = []
for (let item of res.content) {
categorys.push({
name: `|----${item.name}`,
id: item.id
})
if (item.childrenList.length) {
for (let val of item.childrenList) {
categorys.push({
name: `|----|----${val.name}`,
id: val.id
})
}
}
}
this.categorys = categorys
} catch (error) {
console.log(error)
}
},
//
paginationSizeChange(e){
paginationSizeChange(e) {
console.log(e);
this.tableData.size = e
this.tableData.page = 0
this.getTableData()
},
//
paginationChange(e) {
@ -313,9 +354,7 @@ export default {
},
//
resetHandle() {
this.query.name = ''
this.query.num = ''
this.query.isStock = ''
this.query = { ...this.resetQuery }
this.tableData.page = 0;
this.tableData.list = []
this.getTableData()
@ -367,4 +406,4 @@ export default {
align-items: center;
/* flex-direction: row-reverse; */
}
</style>
</style>

View File

@ -19,7 +19,7 @@
<el-table-column label="供应商名称" prop="purveyorName"></el-table-column>
<el-table-column label="商品数量" prop="totalAmount">
<template v-slot="scope">
{{ scope.row.stockSnap.length }}
{{ scope.row.stockSnap && scope.row.stockSnap.length }}
</template>
</el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column>
@ -33,9 +33,9 @@
{{ dayjs(scope.row.stockTime).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column label="操作" width="120">
<el-table-column label="操作" width="80">
<template v-slot="scope">
<el-button type="text" size="mini" @click="$refs.operatingDetail.show(scope.row.id)">
<el-button type="text" size="mini" @click="$refs.operatingDetail.show(scope.row)">
详情
</el-button>
<!-- <el-button type="text" size="mini" @click="$refs.operatingDetail.show(scope.row.id)">
@ -46,7 +46,9 @@
</el-table>
</div>
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
@current-change="paginationChange"
@size-change="e => { tableData.size = e; tableData.page = 0; getTableData() }"
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
<operatingDetail ref="operatingDetail" />
</div>
</template>
@ -82,7 +84,7 @@ export default {
async getTableData() {
this.tableData.loading = true
let arr = []
console.log(this.query,'tiaoshi1')
console.log(this.query, 'tiaoshi1')
if (this.query.createdAt.length) {
arr = [this.query.createdAt[0] + ' 00:00:00', this.query.createdAt[1] + ' 23:59:59']
} else {

View File

@ -297,8 +297,10 @@ export default {
methods: {
//
tabChange(value, type) {
console.log(type);
this.inTabValue = value
this.shopTypesActive = 0
this.resetHandle()
this.queryForm.type = type
},
//

View File

@ -295,6 +295,7 @@ export default {
tabChange(value, type) {
this.inTabValue = value
this.shopTypesActive = 0
this.resetHandle()
this.queryForm.type = type
},
//

View File

@ -142,6 +142,7 @@ export default {
},
pagesizeChange(e) {
this.tableData.size = e
this.tableData.page = 0;
this.getTableData()
},
//

View File

@ -259,6 +259,9 @@ export default {
}
},
mounted() {
if(this.$route.query.tableName){
this.query.tableName = this.$route.query.tableName
}
this.resetQuery = { ...this.query };
this.tbShopPayTypeGet();
this.getTableData();

View File

@ -106,7 +106,8 @@ export default {
page: this.tableData.page,
size: this.tableData.size,
sort: 'id',
shopId: localStorage.getItem('shopId')
shopId: localStorage.getItem('shopId'),
name: this.query.blurry
})
this.tableData.loading = false
this.tableData.list = res.content

View File

View File

View File

@ -23,29 +23,30 @@
添加活动
</el-button>
</div> -->
<!-- <div class="head-container">
<div class="head-container">
<div class="card">
<div class="title">统计数据</div>
<!-- <div class="title">统计数据</div> -->
<div class="row">
<div class="item">
<div class="t">用户数</div>
<div class="n">13</div>
</div>
<div class="item">
<div class="t">会员数</div>
<div class="n">1</div>
<div class="n">{{ shopInfo.userTotal||0 }}</div>
</div>
<div class="item">
<div class="t">余额</div>
<div class="n">0.00</div>
<div class="t">会员余额</div>
<div class="n">{{ shopInfo.balanceTotal||0 }}</div>
</div>
<div class="item">
<div class="t">总积分</div>
<div class="n">0</div>
<div class="t">充值金额</div>
<div class="n">{{ shopInfo.chageTotal||0 }}</div>
</div>
<!-- <div class="item">
<el-button type="success" @click="toPage('charge')">充值记录</el-button>
<el-button type="danger" @click="toPage('cost')">消费记录</el-button>
</div> -->
</div>
</div>
</div> -->
</div>
<div class="head-container">
<el-table :data="tableData.data" v-loading="tableData.loading">
<el-table-column label="ID" prop="id"></el-table-column>
@ -99,14 +100,16 @@
</div>
<div class="head-container">
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
@size-change="sizeChange"
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</div>
</div>
</template>
<script>
import { queryAllShopUser } from '@/api/shop'
import { queryAllShopUser ,queryAllShopInfo} from '@/api/shop'
import dayjs from 'dayjs'
let cacheData = {}
export default {
data() {
return {
@ -114,6 +117,11 @@ export default {
name: '',
isVip: 1
},
shopInfo:{
balanceTotal:0,
userTotal:0,
chageTotal:0
},
tableData: {
data: [],
page: 0,
@ -129,9 +137,34 @@ export default {
}
},
mounted() {
cacheData={...this.query}
this.getTableData()
this.getShopInfo()
},
methods: {
toPage(type){
const pages={
charge:'charge_list',
cost:'cost_list'
}
this.$router.push({
name: pages[type]
})
console.log(pages[type])
},
//
async getShopInfo(){
try {
const res = await queryAllShopInfo(this.query)
this.shopInfo=res
} catch (error) {
console.log(error)
}
},
sizeChange(){
this.tableData.page=0
this.getTableData()
},
//
async statusChange(e, row) {
try {
@ -158,8 +191,17 @@ export default {
//
async getTableData() {
this.tableData.loading = true
//2
if(cacheData.isVip!==this.query.isVip){
this.tableData.page=0
}
cacheData.isVip=this.query.isVip
try {
const res = await queryAllShopUser(this.query)
const res = await queryAllShopUser({
...this.query,
size:this.tableData.size,
page:this.tableData.page+1
})
this.tableData.loading = false
this.tableData.data = res.content
this.tableData.total = res.totalElements
@ -178,6 +220,7 @@ export default {
.name {
margin-left: 10px;
}
}
@ -209,6 +252,7 @@ export default {
flex: 1;
.t {
text-align: center;
color: #555;
}
@ -217,6 +261,7 @@ export default {
font-size: 20px;
font-weight: bold;
padding-top: 6px;
text-align: center;
}
}
}