From 496aa21138d93b8decdff962e13112dc4328444b Mon Sep 17 00:00:00 2001 From: "DESKTOP-8FGKA8Q\\chunfen" Date: Fri, 16 Aug 2024 14:45:07 +0800 Subject: [PATCH] =?UTF-8?q?sku=E9=94=80=E5=94=AE=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E3=80=81=E5=93=81=E7=A7=8D=E9=94=80=E5=94=AE=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E3=80=81=E4=BA=A4=E6=98=93=E8=B6=8B=E5=8A=BF=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=9B=B4=E6=8D=A2=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=8A=A5=E6=8D=9F=E7=BB=9F=E8=AE=A1=E6=95=B0=E6=8D=AE=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=85=A5=E5=BA=93=E9=87=87=E8=B4=AD=E3=80=81?= =?UTF-8?q?=E6=8A=A5=E6=8D=9F=E8=AE=B0=E5=BD=95=E3=80=81=E7=9B=98=E7=82=B9?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=89=B9=E9=87=8F=E6=B7=BB=E5=8A=A0=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=20=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8=E5=93=81?= =?UTF-8?q?=E7=A7=8D=E7=AD=9B=E9=80=89=E4=BB=85=E5=8F=AF=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E4=BA=8C=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/frontend/src/api/dataCenter.js | 8 + resources/frontend/src/api/goods.js | 10 +- resources/frontend/src/api/role.js | 7 + resources/frontend/src/api/supplyChain.js | 24 +++ resources/frontend/src/router/list.js | 9 +- resources/frontend/src/views/Login.vue | 52 ++--- .../src/views/dataCenter/gmvStatistics.vue | 52 ++++- .../src/views/dataCenter/lossStatistics.vue | 95 +++++++++ .../src/views/dataCenter/skuStatistics.vue | 52 ++++- .../src/views/dataCenter/spuStatistics.vue | 54 +++++- .../src/views/goods/addgoods/addgoods.vue | 27 ++- .../frontend/src/views/goods/editgoods.vue | 9 +- resources/frontend/src/views/goods/goods.vue | 163 +++++++++++++--- .../src/views/goodsType/goodsType.vue | 52 +++-- resources/frontend/src/views/index.vue | 4 +- .../src/views/supplyChain/dailyStock.vue | 67 +++++-- .../src/views/supplyChain/lossRecord.vue | 163 +++++++++++++--- .../src/views/supplyChain/procureLog.vue | 183 ++++++++++++++---- resources/frontend/vue.config.js | 2 +- 19 files changed, 825 insertions(+), 208 deletions(-) create mode 100644 resources/frontend/src/views/dataCenter/lossStatistics.vue diff --git a/resources/frontend/src/api/dataCenter.js b/resources/frontend/src/api/dataCenter.js index 0451fc3..fb0163b 100644 --- a/resources/frontend/src/api/dataCenter.js +++ b/resources/frontend/src/api/dataCenter.js @@ -31,3 +31,11 @@ export function getGmvCount(params) { params }) } + +export function getLossStatistics(params) { + return http({ + url: "/api/data_center/loss_record_statistics", + method: "get", + params + }) +} diff --git a/resources/frontend/src/api/goods.js b/resources/frontend/src/api/goods.js index 91d9dba..c4bf441 100644 --- a/resources/frontend/src/api/goods.js +++ b/resources/frontend/src/api/goods.js @@ -186,4 +186,12 @@ export function delGoodsCombination(id) { url: "/api/goods_combination/" + id, method: "delete", }); -} \ No newline at end of file +} + +export function updateSaleStock(data) { + return http({ + url: `/api/batch/goods_skus`, + method: "patch", + data + }) +} diff --git a/resources/frontend/src/api/role.js b/resources/frontend/src/api/role.js index b302181..cc430a8 100644 --- a/resources/frontend/src/api/role.js +++ b/resources/frontend/src/api/role.js @@ -33,3 +33,10 @@ export function jurisdictionEdit(id, data) { data, }); } + +export function getRoleInfo() { + return http({ + url: "/api/user/user_roles", + method: "get" + }) +} diff --git a/resources/frontend/src/api/supplyChain.js b/resources/frontend/src/api/supplyChain.js index 91b3b91..d744357 100644 --- a/resources/frontend/src/api/supplyChain.js +++ b/resources/frontend/src/api/supplyChain.js @@ -47,6 +47,14 @@ export function addPurchaseLog(data) { }) } +export function batchAddPurchaseLog(data) { + return http({ + url: "/api/purchase_record/purchase_batch_store", + method: "post", + data + }) +} + export function updatePurchaseLog(id, data) { return http({ url: `/api/supplier/purchase_record/${id}`, @@ -71,6 +79,14 @@ export function addLossLog(data) { }) } +export function batchAddLossLog(data) { + return http({ + url: "/api/loss_record/loss_batch_store", + method: "post", + data + }) +} + export function updateLossLog(id, data) { return http({ url: `/api/supplier/loss_record/${id}`, @@ -95,3 +111,11 @@ export function addDailyStock(data) { }) } +export function batchAddDailyStock(data) { + return http({ + url: "/api/daily_stock_record/inventory_batch_store", + method: "post", + data + }) +} + diff --git a/resources/frontend/src/router/list.js b/resources/frontend/src/router/list.js index 7bd5439..31931fa 100644 --- a/resources/frontend/src/router/list.js +++ b/resources/frontend/src/router/list.js @@ -122,14 +122,19 @@ const list = [ }, { path: "spu_sale_statistics", - name: "spu销售统计", + name: "品种销售统计", component: () => import("../views/dataCenter/spuStatistics.vue"), }, { path: "gmv_statistics", - name: "spu销售统计", + name: "交易趋势", component: () => import("../views/dataCenter/gmvStatistics.vue"), }, + { + path: "loss_record_statistics", + name: "报损统计", + component: () => import("../views/dataCenter/lossStatistics.vue"), + }, { path: "SUPPLIER_MANAGE", name: "供应商管理", diff --git a/resources/frontend/src/views/Login.vue b/resources/frontend/src/views/Login.vue index 2038332..057b767 100644 --- a/resources/frontend/src/views/Login.vue +++ b/resources/frontend/src/views/Login.vue @@ -6,22 +6,27 @@ ERP管理系统

登录

- -
- -
+
+ +
+
+ +
记住密码
- 登录 + 登 录 + + + \ No newline at end of file diff --git a/resources/frontend/src/views/dataCenter/skuStatistics.vue b/resources/frontend/src/views/dataCenter/skuStatistics.vue index fe44f99..b5e37d1 100644 --- a/resources/frontend/src/views/dataCenter/skuStatistics.vue +++ b/resources/frontend/src/views/dataCenter/skuStatistics.vue @@ -9,7 +9,7 @@ + + +
当前统计时间: @@ -99,7 +114,7 @@ export default { loading: false, time_type: 'day', timeTypeList: [ - { label: '自然日', value: 'day' }, + { label: '今日', value: 'day' }, { label: '自然周', value: 'week' }, { label: '自然月', value: 'month' }, { label: '近7天', value: 'seven' }, @@ -107,7 +122,7 @@ export default { { label: '自定义', value: 'custom' } ], TIMETYPE: { - 'day': '自然日', + 'day': '今日', 'week': '自然周', 'month': '自然月', 'seven': '近7天', @@ -125,7 +140,9 @@ export default { saleList: [], downloadLoading: false, autoWidth: true, - bookType: 'xlsx' + bookType: 'xlsx', + dayTimeList: [], + sku_id: '' } }, mounted() { @@ -134,13 +151,17 @@ export default { methods: { getInitList() { let time = this.getDayTime() - this.dayValue = this.startTime = this.endTime = time + this.startTime = time + ' 00:00:00' + this.endTime = time + ' 23:59:59' + this.dayTimeList = ['00:00:00', '23:59:59'] this.fetchData() }, changeTimeType() { if(this.time_type == 'day') { let time = this.getDayTime() - this.dayValue = this.startTime = this.endTime = time + this.startTime = time + ' 00:00:00' + this.endTime = time + ' 23:59:59' + this.dayTimeList = ['00:00:00', '23:59:59'] } else if(this.time_type == 'week') { this.dayValue = this.endTime = dayjs().format('YYYY-MM-DD') this.startTime = dayjs(this.getFirstDay(this.dayValue)).format('YYYY-MM-DD') @@ -165,10 +186,16 @@ export default { this.loading = true let params = { type: this.time_type == 'day' ? 1 : 2, - start_day: this.startTime, - end_day: this.endTime, page: this.page, - per_page: this.pageSize + per_page: this.pageSize, + sku_id: this.sku_id + } + if(params.type == 1) { + params.start_time = this.startTime + params.end_time = this.endTime + } else { + params.start_day = this.startTime + params.end_day = this.endTime } getSkuSalesCount(params).then((res) => { this.saleList = res.data.data.data @@ -223,6 +250,13 @@ export default { this.page = 1 this.fetchData() }, + changeTimePicker() { + let time = this.getDayTime() + this.startTime = time + ' ' + this.dayTimeList[0] + this.endTime = time + ' ' + this.dayTimeList[1] + this.page = 1 + this.fetchData() + }, handleSizeChange(val) { this.page = 1 this.pageSize = val diff --git a/resources/frontend/src/views/dataCenter/spuStatistics.vue b/resources/frontend/src/views/dataCenter/spuStatistics.vue index e81ea63..3241cdd 100644 --- a/resources/frontend/src/views/dataCenter/spuStatistics.vue +++ b/resources/frontend/src/views/dataCenter/spuStatistics.vue @@ -9,7 +9,7 @@ + + +
当前统计时间: @@ -82,7 +97,7 @@ export default { loading: false, time_type: 'day', timeTypeList: [ - { label: '自然日', value: 'day' }, + { label: '今日', value: 'day' }, { label: '自然周', value: 'week' }, { label: '自然月', value: 'month' }, { label: '近7天', value: 'seven' }, @@ -90,7 +105,7 @@ export default { { label: '自定义', value: 'custom' } ], TIMETYPE: { - 'day': '自然日', + 'day': '今日', 'week': '自然周', 'month': '自然月', 'seven': '近7天', @@ -105,7 +120,9 @@ export default { saleList: [], downloadLoading: false, autoWidth: true, - bookType: 'xlsx' + bookType: 'xlsx', + dayTimeList: [], + sku_id: '' } }, mounted() { @@ -114,13 +131,17 @@ export default { methods: { getInitList() { let time = this.getDayTime() - this.dayValue = this.startTime = this.endTime = time + this.startTime = time + ' 00:00:00' + this.endTime = time + ' 23:59:59' + this.dayTimeList = ['00:00:00', '23:59:59'] this.fetchData() }, changeTimeType() { if(this.time_type == 'day') { let time = this.getDayTime() - this.dayValue = this.startTime = this.endTime = time + this.startTime = time + ' 00:00:00' + this.endTime = time + ' 23:59:59' + this.dayTimeList = ['00:00:00', '23:59:59'] } else if(this.time_type == 'week') { this.dayValue = this.endTime = dayjs().format('YYYY-MM-DD') this.startTime = dayjs(this.getFirstDay(this.dayValue)).format('YYYY-MM-DD') @@ -144,8 +165,14 @@ export default { this.loading = true let params = { type: this.time_type == 'day' ? 1 : 2, - start_day: this.startTime, - end_day: this.endTime + sku_id: this.sku_id + } + if(params.type == 1) { + params.start_time = this.startTime + params.end_time = this.endTime + } else { + params.start_day = this.startTime + params.end_day = this.endTime } getSpuSalesCount(params).then((res) => { this.saleList = res.data.data @@ -173,7 +200,10 @@ export default { }, changeDayTime() { if(this.time_type == 'day') { - this.startTime = this.endTime = this.dayValue + let time = this.getDayTime() + this.startTime = time + ' 00:00:00' + this.endTime = time + ' 23:59:59' + this.dayTimeList = ['00:00:00', '23:59:59'] } else if(this.time_type == 'week') { this.endTime = this.dayValue this.startTime = dayjs(this.getFirstDay(this.dayValue)).format('YYYY-MM-DD') @@ -196,6 +226,12 @@ export default { this.endTime = this.customValue[1] this.fetchData() }, + changeTimePicker() { + let time = this.getDayTime() + this.startTime = time + ' ' + this.dayTimeList[0] + this.endTime = time + ' ' + this.dayTimeList[1] + this.fetchData() + }, handleExport() { if(!this.saleList.length) { this.$message({ diff --git a/resources/frontend/src/views/goods/addgoods/addgoods.vue b/resources/frontend/src/views/goods/addgoods/addgoods.vue index 7c90dc2..21e6f83 100644 --- a/resources/frontend/src/views/goods/addgoods/addgoods.vue +++ b/resources/frontend/src/views/goods/addgoods/addgoods.vue @@ -30,14 +30,11 @@ - - + - + 删除 diff --git a/resources/frontend/src/views/goods/editgoods.vue b/resources/frontend/src/views/goods/editgoods.vue index 8c76a62..fff022b 100644 --- a/resources/frontend/src/views/goods/editgoods.vue +++ b/resources/frontend/src/views/goods/editgoods.vue @@ -29,8 +29,9 @@ diff --git a/resources/frontend/src/views/goods/goods.vue b/resources/frontend/src/views/goods/goods.vue index 175a391..48237e2 100644 --- a/resources/frontend/src/views/goods/goods.vue +++ b/resources/frontend/src/views/goods/goods.vue @@ -11,8 +11,11 @@ 商品种类:
- 新增商品 - 导入商品 + 批量更新在售库存 + 新增商品 + 导入商品 表格导出
@@ -95,12 +99,12 @@ - + - + - +