This commit is contained in:
wtq
2026-01-08 15:05:27 +08:00
parent 5518351303
commit 1b6c21efe2
9 changed files with 636 additions and 2 deletions

View File

@@ -1033,6 +1033,51 @@ async function jxPrinterList(json) {
}
}
/**
* 统计门店订单结算以及京西收益,与美团订单对比
* @Param token header string true "认证token"
* @Param storeIDs query string false "京西门店ID列表[1,2,3],缺省不限制"
* @Param vendorIds query string false "京西门店ID列表[1,2,3],缺省不限制"
* @Param start query string true "起始时间1970-01-01 00:00:00"
* @Param end query string true "结束时间1970-01-01 23:59:59"
* @Param size query int true "每页最大数"
* @Param offset query int true "跳过数量"
*/
export const getStoreSettlementInfo = async(params,noLoading = true) => {
try {
let res = await api('v2/store/GetStoreSettlementInfo', {
params,
noLoading
})
return res
} catch (error) {
throw error
}
}
/**
* 根据城市code统计京西收益
* @Param token header string true "认证token"
* @Param cityCode query string false "京西门店城市列表["1","2","3"],缺省不限制"
* @Param vendorIds query string false "京西门店ID列表[1,2,3],缺省不限制"
* @Param start query string true "起始时间1970-01-01 00:00:00"
* @Param end query string true "结束时间1970-01-01 23:59:59"
* @Param size query int true "每页最大数"
* @Param offset query int true "跳过数量"
*/
export const getCitySettlementInfo = async (params,noLoading = true) => {
try {
let res = await api('v2/store/GetCitySettlementInfo', {
params,
noLoading
})
return res
} catch (error) {
throw error
}
}
export {
setMTStoreAutoText,
getMTStoreAutoText,

View File

@@ -172,6 +172,21 @@ export const newMenu2 = [
type: 0,
updatedAt: '2021-01-21T17:21:50+08:00',
url: '/storeMerPage',
},
{
children: [],
color: '',
createdAt: '2021-01-21T17:21:47+08:00',
deletedAt: '1970-01-01T00:00:00+08:00',
id: 7848,
imgURL: '',
lastOperator: 'suyl',
level: 2,
name: '结算统计',
parentID: 42,
type: 0,
updatedAt: '2021-01-21T17:21:50+08:00',
url: '/settleStatic',
}
// {
// children: [],

View File

@@ -0,0 +1,563 @@
<template>
<div class="baselayout supplement">
<el-form
:model="searchForm"
size="mini"
style="display: flex; flex-wrap: wrap"
:inline="true"
ref="form"
label-width="50px">
<el-form-item >
<el-button v-show="searchForm.queryType === '1'" type="success" style="width: 110px;" @click="openStorePick">门店选择({{searchForm.storeIDs.length}})</el-button>
</el-form-item>
<el-form-item label="日期范围:" label-width="80px">
<!-- :picker-options="pickerOptions" -->
<el-date-picker
style="width: 373px"
v-model="searchForm.timeRange"
type="datetimerange"
align="left"
unlink-panels
:clearable="false"
:default-value="Date.now() - 3600 * 1000 * 24 * 1"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
<!-- 时间范围组件 -->
</el-form-item>
<!-- if(this.$store.getters['jxStorePick/allCity'].length === 0) this.$store.dispatch('jxStorePick/getCity') // 获取城市信息 -->
<!-- @change="changeSkuNamePlaces" -->
<el-form-item label="城市">
<el-select
filterable
v-model="searchForm.cityCode"
multiple
placeholder="请选择城市,可多选"
style="width: 200px;"
clearable
>
<!-- <el-option label="全国" value="-1" select>全国</el-option> -->
<el-option
v-for="item in cityData"
:key="item.code"
:label="item.name"
:value="'' + item.code"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="查询方式" label-width="80px">
<el-select
v-model="searchForm.queryType"
placeholder="查询方式"
style="width: 100px;"
>
<el-option label="门店" value="1" select>门店</el-option>
<el-option label="城市" value="2" select>城市</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="query">查询</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="exportExcel">导出excel</el-button>
</el-form-item>
</el-form>
<div >
<el-table :data="dataList" empty="暂无数据~~~" border stripe v-if="searchForm.queryType === '1'" tooltip-effect="dark" style="width: 100%" height="calc(100vh - 340px)" >
<el-table-column label="门店ID" prop="jx_store_id" ></el-table-column>
<el-table-column label="门店名称" prop="name" ></el-table-column>
<!-- <el-table-column label="品牌ID" prop="brand_id" ></el-table-column> -->
<el-table-column label="品牌名称" prop="brand_name" ></el-table-column>
<el-table-column label="美团平台ID" prop="mt_store_id" ></el-table-column>
<el-table-column label="京东平台ID" prop="jd_store_id" ></el-table-column>
<el-table-column label="闪购平台ID" prop="sg_store_id" ></el-table-column>
<el-table-column label="市" prop="city_name" ></el-table-column>
<el-table-column label="区" prop="district_name" ></el-table-column>
<el-table-column label="平台负责人电话" prop="market_man_phone" >
<div slot-scope="scope">
{{ scope.row.market_man_phone }}
</div>
</el-table-column>
<el-table-column label="平台负责人名称" prop="market_man_name">
<div slot-scope="scope">
{{ scope.row.market_man_name }}
</div>
</el-table-column>
<el-table-column label="美团负责人" prop="operator1_name" >
<div slot-scope="scope">
{{ scope.row.operator1_name }}
</div>
</el-table-column>
<el-table-column label="京东负责人" prop="operator2_name" >
<div slot-scope="scope">
{{ scope.row.operator2_name }}
</div>
</el-table-column>
<el-table-column label="闪购负责人" prop="operator3_name" >
<div slot-scope="scope">
{{ scope.row.operator3_name }}
</div>
</el-table-column>
<el-table-column label="品牌费因子" prop="jx_brand_fee_factor" ></el-table-column>
<el-table-column label="市场费因子" prop="market_add_fee_factor" ></el-table-column>
<el-table-column label="扣点模式" prop="pay_percentage" >
<div slot-scope="scope">
{{ (scope.row.pay_percentage/100).toFixed(2) }}
</div>
</el-table-column>
<el-table-column label="有效订单数" prop="order_count" ></el-table-column>
<el-table-column label="平台结算金额(元)" prop="total_shop_money" >
<div slot-scope="scope">
{{ (scope.row.total_shop_money/100).toFixed(2) }}
</div>
</el-table-column>
<el-table-column label="总运费(元)" prop="total_desired_fee" >
<div slot-scope="scope">
{{ (scope.row.total_desired_fee/100).toFixed(2) }}
</div>
</el-table-column>
<el-table-column label="订单售后金额(元)" prop="refund_money" >
<div slot-scope="scope">
{{ (scope.row.refund_money/100).toFixed(2) }}
</div>
</el-table-column>
<el-table-column label="服务费(元)" prop="package_setting" >
<div slot-scope="scope">
{{ (scope.row.package_setting/100).toFixed(2) }}
</div>
</el-table-column>
<el-table-column label="包装费(元)" prop="packaging_fee" >
<div slot-scope="scope">
{{ (scope.row.packaging_fee/100).toFixed(2) }}
</div>
</el-table-column>
<el-table-column label="门店收入(元)" prop="store_income" >
<div slot-scope="scope">
{{ (scope.row.store_income/100).toFixed(2) }}
</div>
</el-table-column>
<el-table-column label="平台收益(元)" prop="platform_income" >
<div slot-scope="scope">
{{ (scope.row.platform_income/100).toFixed(2) }}
</div>
</el-table-column>
<el-table-column label="京西收益(元)" prop="jx_income" >
<div slot-scope="scope">
{{ (scope.row.jx_income/100).toFixed(2) }}
</div>
</el-table-column>
<el-table-column label="市场收益(元)" prop="market_income" >
<div slot-scope="scope">
{{ (scope.row.market_income/100).toFixed(2) }}
</div>
</el-table-column>
<!-- <el-table-column label="纯收益" prop="-" ></el-table-column> -->
</el-table>
<el-table :data="dataList" empty="暂无数据~~~" border stripe v-if="searchForm.queryType === '2'" tooltip-effect="dark" style="width: 100%" height="calc(100vh - 340px)" >
<el-table-column label="城市名" prop="city_name" ></el-table-column>
<el-table-column label="门店ID" prop="jx_store_id" >
<div slot-scope="scope">
{{ scope.row.jx_store_id }}
</div>
</el-table-column>
<!-- <el-table-column label="品牌ID" prop="brand_id" ></el-table-column> -->
<el-table-column label="名称" prop="user_name" ></el-table-column>
<el-table-column label="电话" prop="mobile" ></el-table-column>
<el-table-column label="有效订单数" prop="order_count" ></el-table-column>
<el-table-column label="服务费(元)" prop="package_setting" >
<div slot-scope="scope">
{{ (scope.row.package_setting/100).toFixed(2) }}
</div>
</el-table-column>
<!-- 包装费-每单0.4 -->
<el-table-column label="包装费(元)" prop="packaging_fee" >
<div slot-scope="scope">
{{ (scope.row.packaging_fee/100).toFixed(2) }}
</div>
</el-table-column>
<el-table-column label="总运费(元)" prop="total_desired_fee" >
<div slot-scope="scope">
{{ (scope.row.total_desired_fee/100).toFixed(2) }}
</div>
</el-table-column>
<el-table-column label="京西收益(元)" prop="jx_income" >
<div slot-scope="scope">
{{ (scope.row.jx_income/100).toFixed(2) }}
</div>
</el-table-column>
<el-table-column label="市场收益(元)" prop="market_income" >
<div slot-scope="scope">
{{ (scope.row.market_income/100).toFixed(2) }}
</div>
</el-table-column>
<el-table-column label="门店收入(元)" prop="store_income" >
<div slot-scope="scope">
{{ (scope.row.store_income/100).toFixed(2) }}
</div>
</el-table-column>
<el-table-column label="平台结算金额(元)" prop="total_shop_money" >
<div slot-scope="scope">
{{ (scope.row.total_shop_money/100).toFixed(2) }}
</div>
</el-table-column>
<el-table-column label="平台收益(元)" prop="platform_income" >
<div slot-scope="scope">
{{ (scope.row.platform_income/100).toFixed(2) }}
</div>
</el-table-column>
<el-table-column label="订单售后金额(元)" prop="refund_money" >
<div slot-scope="scope">
{{ (scope.row.refund_money/100).toFixed(2) }}
</div>
</el-table-column>
<!-- <el-table-column label="纯收益" prop="-" ></el-table-column> -->
</el-table>
</div>
<!-- 分页 -->
<div class="page">
<el-pagination
@size-change="sizeChange"
@current-change="handleCurrentChange"
:page-sizes="[15, 30, 50]"
:page-size.sync="size"
layout="total, sizes, prev, pager, next"
:current-page="pageSize"
:total="totalCount">
</el-pagination>
</div>
<!-- 分页 -->
<el-dialog
title="门店筛选"
:visible.sync="storePickShow"
custom-class="store-pick"
width="800px"
:show-close="false"
>
<div style="text-align: right;">
<el-button size="mini" type="danger" @click="storePickShow = false"> </el-button>
<el-button size="mini" type="primary" @click="confirmStorePick"> </el-button>
</div>
<!-- 平台多选 -->
<div style="display: flex;margin: 20px 0;">
<span style="font-size: 14px; color: #666;line-height: 1.4;">门店平台限制</span>
<!-- @change="vendorIDsChange" -->
<el-checkbox-group v-model="searchForm.vendorIDs">
<el-checkbox v-for="item in ConVendorName" :key="item.vendorID" :label="item.vendorID">{{item.name}}</el-checkbox>
</el-checkbox-group>
</div>
<StoresPick
ref="treeStorePick"
@updateStoreIDs="updateStoreIDs"
:vendorIDs="searchForm.vendorIDs"
></StoresPick>
</el-dialog>
</div>
<!--
// @Title 统计门店订单结算以及京西收益,与美团订单对比
// @Description 统计门店订单结算以及京西收益,与美团订单对比
// @Param token header string true "认证token"
// @Param storeIDs query string false "京西门店ID列表[1,2,3],缺省不限制"
// @Param vendorIds query string false "京西门店ID列表[1,2,3],缺省不限制"
// @Param start query string true "起始时间1970-01-01 00:00:00"
// @Param end query string true "结束时间1970-01-01 23:59:59"
// @Param size query int true "每页最大数"
// @Param offset query int true "跳过数量"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetStoreSettlementInfo [get]
type JxSettlementInfo struct {
JxStoreId int `json:"jx_store_id"` // jx门店ID
Name string `json:"name"` // 门店名称
BrandId int `json:"brand_id"` // 品牌ID
BrandName string `json:"brand_name"` // 品牌名称
MtStoreId string `json:"mt_store_id"` // 美团平台ID
JdStoreId string `json:"jd_store_id"` // 京东平台ID
SgStoreId string `json:"sg_store_id"` // 闪购平台ID
CityName string `json:"city_name"` // 市
DistrictName string `json:"district_name"` // 市
MarketManPhone string `json:"market_man_phone"` // 平台负责人电话
MarketManName string `json:"market_man_name"` // 平台负责人名称
Operator1Name string `json:"operator1_name"` // 美团负责人
Operator2Name string `json:"operator2_name"` // 京东负责人
Operator3Name string `json:"operator3_name"` // 闪购负责人
JxBrandFeeFactor string `json:"jx_brand_fee_factor"` // 京西品牌费因子
MarketAddFeeFactor string `json:"market_add_fee_factor"` // 市场费因子
PayPercentage int `json:"pay_percentage"` // 扣点模式,小于50为扣点,其他为报价
OrderCount int `json:"order_count"` // 有效订单数
TotalShopMoney int `json:"total_shop_money"` // 平台结算金额
TotalDesiredFee int `json:"total_desired_fee"` // 总运费
RefundMoney int `json:"refund_money"` // 订单售后金额
PackageSetting int `json:"package_setting"` // 服务费
PackagingFee int `json:"packaging_fee"` // 包装费-每单0.4元
StoreInCome float64 `json:"store_income"` // 门店收入
PlatformIncome float64 `json:"platform_income"` // 平台收益
JxIncome float64 `json:"jx_income"` // 京西收益
MarketIncome float64 `json:"market_income"` // 市场收益
Profit float64 `json:"-"` // 纯收益
}
// @Title 根据城市code统计京西收益
// @Description 根据城市code统计京西收益
// @Param token header string true "认证token"
// @Param cityCode query string false "京西门店城市列表["1","2","3"],缺省不限制"
// @Param vendorIds query string false "京西门店ID列表[1,2,3],缺省不限制"
// @Param start query string true "起始时间1970-01-01 00:00:00"
// @Param end query string true "结束时间1970-01-01 23:59:59"
// @Param size query int true "每页最大数"
// @Param offset query int true "跳过数量"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetCitySettlementInfo [get]
// SettlementByCityCode 根据城市统计
type SettlementByCityCode struct {
CityName string `json:"city_name"` // 市
JxStoreID int `json:"jx_store_id"` // jx门店ID
BrandId int `json:"brand_id"` // 品牌ID
UserName string `json:"user_name"` // 名称
Mobile string `json:"mobile"` // 电话
OrderCount int `json:"order_count"` // 有效订单数
PackageSetting int `json:"package_setting"` // 服务费
PackagingFee int `json:"packaging_fee"` // 包装费-每单0.4元
TotalDesiredFee int `json:"total_desired_fee"` // 总运费
JxIncome float64 `json:"jx_income"` // 京西收益
MarketIncome float64 `json:"market_income"` // 市场收益
StoreInCome float64 `json:"store_income"` // 门店收入
TotalShopMoney int `json:"total_shop_money"` // 平台结算金额
PlatformIncome float64 `json:"platform_income"` // 平台收益
RefundMoney int `json:"refund_money"` // 订单售后金额
Profit float64 `json:"-"` // 纯收益
}
-->
</template>
<script>
import StoresPick from "@/components/cmp/storePick/index.vue";
import moment from 'moment'
import { getStoreSettlementInfo,getCitySettlementInfo } from '@/apis/store'
import { mapGetters } from "vuex";
import { arr2excel } from '@/tools/excel2'
export default {
components: {
StoresPick
},
data () {
return {
searchForm:{
storeIDs: [],
vendorIDs:[],
timeRange:[],
cityCode:[],
queryType:'1'
},
dataList:[],
// dataListCity:[],
totalCount:0,
size:30,
// size:-1,
offset:0, // 跳过条数
pageSize:1,
storePickShow:false,
}
},
watch:{
"searchForm.queryType":{
handler(val){
this.dataList = []
this.query()
}
}
},
computed:{
...mapGetters({
cityData:"jxStorePick/allCity",
})
},
created () {
let now = new Date().getTime()
now = moment(now).format('YYYY-MM-DD')
this.searchForm.timeRange = [now + ' 00:00:00',now + ' 23:59:59']
},
methods: {
// 导出excel
async exportExcel(){
let excelData = []
let arr = await this.query('all')
console.log('导出excel',arr)
if(this.searchForm.queryType === '1'){
excelData.push([
"jx门店ID",
"门店名称",
"品牌ID",
"品牌名称",
"美团平台ID",
"京东平台ID",
"闪购平台ID",
"市",
"区",
"平台负责人电话",
"平台负责人名称",
"美团负责人",
"京东负责人",
"闪购负责人",
"京西品牌费因子",
"市场费因子",
"扣点模式",
"有效订单数",
"平台结算金额(元)",
"总运费(元)",
"订单售后金额(元)",
"服务费(元)",
"包装费-每单0.4元",
"门店收入(元)",
"平台收益(元)",
"京西收益(元)",
"市场收益(元)",
// "纯收益",
]);
arr.map(item => {
excelData.push([
item.jx_store_id,
item.name,
item.brand_id,
item.brand_name,
item.mt_store_id,
item.jd_store_id,
item.sg_store_id,
item.city_name,
item.district_name,
item.market_man_phone,
item.market_man_name,
item.operator1_name,
item.operator2_name,
item.operator3_name,
item.jx_brand_fee_factor,
item.market_add_fee_factor,
item.pay_percentage,
item.order_count,
item.total_shop_money / 100,
item.total_desired_fee / 100,
item.refund_money / 100,
item.package_setting / 100,
item.packaging_fee / 100,
item.store_income / 100,
item.platform_income / 100,
item.jx_income / 100,
item.market_income / 100,
// item['-']
])
})
}else{
excelData.push([
"市",
"jx门店ID",
"品牌ID",
"名称",
"电话",
"有效订单数",
"服务费(元)",
"包装费-每单0.4元",
"总运费(元)",
"京西收益(元)",
"市场收益(元)",
"门店收入(元)",
"平台结算金额(元)",
"平台收益(元)",
"订单售后金额(元)",
// "纯收益",
]);
arr.map(item => {
excelData.push([
item.city_name,
item.jx_store_id,
item.brand_id,
item.user_name,
item.mobile,
item.order_count,
item.package_setting / 100,
item.packaging_fee / 100,
item.total_desired_fee / 100,
item.jx_income / 100,
item.market_income / 100,
item.store_income / 100,
item.total_shop_money / 100,
item.platform_income / 100,
item.refund_money / 100,
// item['-']
])
})
}
let fileName = `结算统计(${this.searchForm.queryType == '1' ? '门店' : '城市'})导出${+new Date()}`+ '.xlsx'
console.log(excelData,'导出excel,,,文件名',fileName)
arr2excel(excelData, fileName)
},
// 每页个数改变
sizeChange (size) {
this.$nextTick(() => {
this.size = size
this.query()
})
},
// 点击页码
handleCurrentChange (val) {
this.offset = (val -1) * this.size
this.query()
},
confirmStorePick(){
this.storePickShow = false
},
openStorePick(){
this.storePickShow = true
},
updateStoreIDs(storeIDs){
this.searchForm.storeIDs = storeIDs
},
// 查询
async query(type){
this.dataList = []
// console.log(this.searchForm,'查询数据',this.searchForm)
let obj = {
start:this.searchForm.timeRange[0],
end:this.searchForm.timeRange[1],
size:type && type === 'all' ? -1 : this.size,
offset:type && type === 'all' ? 0 : this.offset
}
if(this.searchForm.queryType === '1'){
if(this.searchForm.storeIDs.length >0) obj['storeIDs'] = JSON.stringify(this.searchForm.storeIDs)
if(this.searchForm.vendorIDs.length >0) obj['vendorIDs'] = JSON.stringify(this.searchForm.vendorIDs)
let res = await getStoreSettlementInfo(obj)
if(type && type === 'all') return res.data
this.dataList = res.data
this.totalCount = res.totalCount
}else{
if(this.searchForm.cityCode.length >0) obj['cityCode'] = JSON.stringify(this.searchForm.cityCode)
if(this.searchForm.vendorIDs.length >0) obj['vendorIDs'] = JSON.stringify(this.searchForm.vendorIDs)
let res = await getCitySettlementInfo(obj)
if(type && type === 'all') return res.data
this.dataList = res.data
this.totalCount = res.totalCount
}
console.log('this.dataList',this.dataList)
}
}
}
</script>
<style lang="scss" scoped>
.page {
text-align: center;
margin-top: 10px;
}
</style>

View File

@@ -53,7 +53,8 @@ const SystemLog = () => import('@/pages/system/system-log')
const CityConfig = () => import('@/pages/system/cityConfig') // 系统管理-城市管理
const SystemTool = () => import('@/components/system/systemTool/system-tool.vue') // 系统管理-系统工具
const storeMerLka = () => import('@/pages/storeMerLka/index.vue') // 拉卡拉
const storeMerLka = () => import('@/pages/financial/storeMerLka/index.vue') // 拉卡拉
const SettleStatic = () => import('@/pages/financial/settleStatic/settleStatic.vue') // 拉卡拉
const JDSettlement = () => import('@/components/finance/jd-settlement') // 财务-京东结算
const StoreGoodsCheck = () => import('@/components/storegoodscheck/store-goods-check') // 门店商品价格审核
@@ -160,7 +161,7 @@ const Convert2JDSPU = () => import('@/components/temporary/convert-JDSPU')
// 测试页面
const Test01 = () => import('@/components/temporary/test01')
const Test02 = () => import('@/components/temporary/test02')
const CreateOrder = () => import('@/pages/createOrderTemp/index.vue')
const CreateOrder = () => import('@/pages/financial/createOrderTemp/index.vue')
/* ---------门店管理--------- */
// 京西门店管理
@@ -479,6 +480,14 @@ const router = new Router({
title: '商户入驻'
}
},
{
path: 'settleStatic',
name: 'settleStatic',
component: SettleStatic,
meta: {
title: '结算统计'
}
},
{
path: 'jdCatManager',
name: 'jdCatManager',

View File

@@ -68,6 +68,8 @@ export default async (url, options) => {
return desc
}else if(code === '-1' && url.includes('v2/order/SelfDelivered')){
return desc
}else if(code === '-1' && url.includes('v2/sku/GetMTProductRule')){
return [] // 防止淘宝闪购报错,后续东西不加载
}
/* eslint-disable-line */
else if (code === '-105') {