diff --git a/src/api/consumable.js b/src/api/consumable.js index 6e7eff7..423f664 100644 --- a/src/api/consumable.js +++ b/src/api/consumable.js @@ -38,16 +38,16 @@ export function puttbConsType(data) { * 查询耗材信息 * @returns */ -export function gettbConsInfo(params) { +export function gettbConsInfo(data) { // return request({ // url: '/api/tbConsInfo', // method: "get", // params // }); return request({ - url: "/api/viewConInfoFlow", - method: "get", - params + url: "/api/viewConInfoFlow/get", + method: "post", + data }); } diff --git a/src/api/home.js b/src/api/home.js index 23f222d..6aaed21 100644 --- a/src/api/home.js +++ b/src/api/home.js @@ -64,7 +64,8 @@ export function dateAmount(day) { */ export function dateProduct(day, page, size) { return request({ - url: "/api/summary/dateProduct", + // url: "/api/summary/dateProduct", + url: "/api/summary/productSaleDate", method: "get", params: { shopId: localStorage.getItem("shopId"), diff --git a/src/api/shop.js b/src/api/shop.js index 8d42f75..6e99bf6 100644 --- a/src/api/shop.js +++ b/src/api/shop.js @@ -573,7 +573,6 @@ export function tbPlussShopStaff(data) { }); } - export function tbShopPermissionlist(params) { return request({ url: `/api/tbShopPermission/list`, @@ -582,8 +581,6 @@ export function tbShopPermissionlist(params) { }); } - - /** * 通过id获取员工信息 * @returns @@ -615,11 +612,11 @@ export function callRecord(params) { }); } export function callTablecall(data) { - return request({ - url: `/callTable/call`, - method: 'post', - data - }); + return request({ + url: `/callTable/call`, + method: "post", + data + }); } // 删除桌型 export function callTabledelete(data) { @@ -755,3 +752,21 @@ export function updateProductData(data) { data }); } + +// 商品库存统计列表 统计 +export function tbProductStockDetailStockCount(data) { + return request({ + url: `/api/tbProductStockDetail/stock/count`, + method: "post", + data + }); +} + +// 商品库存记录列表 +export function tbProductStockDetailStock(data) { + return request({ + url: `/api/tbProductStockDetail/stock`, + method: "post", + data + }); +} diff --git a/src/layout/index.vue b/src/layout/index.vue index 3beb9a5..1c34f42 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -110,6 +110,8 @@ import { mapState, mapGetters } from 'vuex' import Theme from '@/components/ThemePicker' import Cookies from 'js-cookie' import Avatar from '@/assets/images/avatar.png' +import { updatePass } from '@/api/login.js' +import { encrypt } from '@/utils/rsaEncrypt' export default { name: 'Layout', components: { @@ -213,6 +215,14 @@ export default { } }, methods: { + // 修改密码框类型 + changeInputType(key) { + if (this[key] == 'text') { + this[key] = 'password' + } else { + this[key] = 'text' + } + }, handleClickOutside() { this.$store.dispatch('app/closeSideBar', { withoutAnimation: false }) }, diff --git a/src/views/home/home.vue b/src/views/home/home.vue index 68d9e60..ed71035 100644 --- a/src/views/home/home.vue +++ b/src/views/home/home.vue @@ -72,7 +72,20 @@
{{ formatDecimal(tradeSale.incomeAmountAll || 0) }}
-
营业实收(元)
+
营业实收(元) + +
+
+
+ + {{ item.payType }} +
+ {{ item.payAmount }} +
+
+ +
+
@@ -82,9 +95,11 @@
+ :style="{ width: `${tradeSale.incomeAmount ? (tradeSale.incomeAmount / tradeSale.totalSaleAmount * 100) : 0}%` }"> +
+ :style="{ width: `${tradeSale.refundAmount ? (tradeSale.refundAmount / tradeSale.totalSaleAmount * 100) : 0}%` }"> +
@@ -100,10 +115,12 @@
{{ formatDecimal(tradeSale.totalVipAmount || 0) }}
-
+
+ :style="{ width: `${tradeSale.inAmount ? (tradeSale.outAmount / tradeSale.totalVipAmount * 100) : 0}%` }"> +
@@ -119,7 +136,7 @@
{{ formatDecimal(tradeVip.useAmount || 0) }}
-
会员消费(元)
+
会员消费(元)
@@ -137,7 +154,11 @@
-
翻台率
+
翻台率 + + + +
{{ tradeCount.turnoverRate }}
@@ -186,7 +207,7 @@
商品销售排行
- 今天 + 近7天 30天 @@ -209,10 +230,10 @@
- + - - + +
{ @@ -666,7 +689,10 @@ export default { this.payChart = echarts.init(this.$refs.payChart); this.payChart.setOption({ tooltip: { - trigger: "item" + trigger: "item", + formatter: params => { + return `${params.name}:${params.value}笔` + } }, legend: { top: "5%", @@ -734,10 +760,12 @@ export default { this.saleTablePage, this.saleTableSize ); - this.saleTable = res.totalProduct; - this.saleTableTotal = res.total; - this.productCount = res.productCount; - this.productSum = res.productSum; + this.saleTable = res.productList.content; + this.saleTableTotal = res.productList.totalElements; + this.productCount = res.productCount.payAmount; + this.productSum = res.productSum.payAmount; + + this.summaryDateGet(res.countList) setTimeout(() => { this.saleTableLoading = false; }, 300); @@ -788,7 +816,7 @@ export default { }, rankChange() { this.dateProduct(); - this.summaryDateGet(); + // this.summaryDateGet(); }, // 初始化销售图标 initProduceChart(p1, p2) { @@ -938,17 +966,23 @@ export default { }); }, // 日期汇总数据 - async summaryDateGet() { + async summaryDateGet(res) { try { - const res = await summaryDateGet(this.saleTableActive); + console.log(res); + + // const res = await summaryDateGet(this.saleTableActive); let p1 = [ - res.numList.map(item => item.tradeDay), - res.numList.map(item => item.count) + res.map(item => item.tradeDay), + res.map(item => item.saleNum) ]; let p2 = [ - res.amountList.map(item => item.tradeDay), - res.amountList.map(item => item.count) + res.map(item => item.tradeDay), + res.map(item => item.saleAmount) ]; + + console.log(p1); + console.log(p2); + this.initProduceChart(p1, p2); } catch (error) { console.log(error); @@ -958,7 +992,43 @@ export default { }; + \ No newline at end of file diff --git a/src/views/product/index.vue b/src/views/product/index.vue index b300d01..7f082cf 100644 --- a/src/views/product/index.vue +++ b/src/views/product/index.vue @@ -23,13 +23,72 @@
- - - - 添加商品 - - - +
+ + 添加商品 + + + + + +
+
+
+
+
+
+ +
+
+
+ 现有数量 + {{ countInfo.stockNumber || 0 }} +
+
+
+
+
+ +
+
+
+ 增加数量 + {{ countInfo.addCountNumber || 0 }} +
+
+ 手动增加: + {{ countInfo.addNumber || 0 }} +
+
+
+
+
+ +
+
+
+ 减少数量 + {{ countInfo.subCountNumber || 0 }} +
+
+
+ 手动减少: + {{ countInfo.subNumber || 0 }} +
+
+
+ 销售量: + {{ countInfo.saleNumber || 0 }} +
+
+
+ 报损: + {{ countInfo.lossNumber || 0 }} +
+
+
+
+
- + + + + - + + + @@ -151,10 +222,12 @@ import Sortable from 'sortablejs' import dayjs from 'dayjs' import settings from '@/settings' import BindCons from './components/bindCons.vue' -import { tbProductListV2, tbShopCategoryGet, tbProductDelete, tbProductIsHot, upProSort, updateProductData } from '@/api/shop' +import StockHistory from './components/stockHistory.vue' +import { tbProductListV2, tbShopCategoryGet, tbProductDelete, tbProductIsHot, upProSort, updateProductData, tbProductStockDetailStockCount } from '@/api/shop' export default { components: { - BindCons + BindCons, + StockHistory }, data() { return { @@ -168,6 +241,7 @@ export default { categorys: [], typeEnums: settings.typeEnum, tableData: { + sort: 'createdAt,desc', data: [], page: 0, size: 30, @@ -188,7 +262,8 @@ export default { id: '', key: '', value: '' - } + }, + countInfo: {} } }, async mounted() { @@ -205,10 +280,40 @@ export default { this.tableDrag() }) } + + this.tbProductStockDetailStockCount() }, methods: { - changeGrounding(event, row) { - this.editorForm.key = 'grounding' + // 显示库存记录 + showStockHistory(key) { + this.$refs.stockHistory.show(key) + }, + // 库存统计列表 统计 + async tbProductStockDetailStockCount() { + try { + const res = await tbProductStockDetailStockCount({ + shopId: localStorage.getItem('shopId') + }) + this.countInfo = res + } catch (error) { + console.log(error); + } + }, + // 编辑退款是否退回库存 + refundChange(e) { + let row = this.tableData.data.find(item => item.id == e.id) + + if (row.isRefundStock != e.isRefundStock) { + this.editorForm.key = 'refundStock' + this.editorForm.id = e.id + this.editorForm.isSku = !e.typeEnum + this.editorForm.value = e.isRefundStock + + this.editorConfirmChange() + } + }, + changeGrounding(event, row, key) { + this.editorForm.key = key this.editorForm.id = row.id this.editorForm.isSku = !row.typeEnum this.editorForm.value = event @@ -221,7 +326,7 @@ export default { this.editorFormLoading = true const res = await updateProductData([this.editorForm]) this.editorFormLoading = false - this.$message.success('修改成功') + // this.$message.success('修改成功') this.editorVisable = false this.getTableData() } catch (error) { @@ -320,7 +425,7 @@ export default { } this.tableData.loading = true - console.log(this.query, '调试2') + // console.log(this.query, '调试2') const res = await tbProductListV2({ page: this.tableData.page, size: this.tableData.size, @@ -328,7 +433,8 @@ export default { categoryId: this.query.categoryId, id: this.query.productId, type: this.query.typeEnum, - shopId: localStorage.getItem('shopId') + shopId: localStorage.getItem('shopId'), + sort: this.tableData.sort }) this.tableData.loading = false this.tableData.data = res.content @@ -369,6 +475,73 @@ export default {