移动端首页修改

jg-waiwang-pro
XI_TENG\xixi_ 5 months ago
parent ac62a1f399
commit e25e93f22b

@ -13,19 +13,19 @@
<u-row gutter="16"> <u-row gutter="16">
<u-col span="4" text-align="center" class="line-right"> <u-col span="4" text-align="center" class="line-right">
<view class="sty-statistics-top-item"> <view class="sty-statistics-top-item">
<view><span class="fsizeA"></span></view> <view><span class="fsizeA">{{homeInfo.avgPurchasePrice}}</span></view>
<view><span class="fsizeA">磅单采购数</span></view> <view><span class="fsizeA">磅单采购数1</span></view>
</view> </view>
</u-col> </u-col>
<u-col span="4" text-align="center" class="line-right"> <u-col span="4" text-align="center" class="line-right">
<view class="sty-statistics-top-item"> <view class="sty-statistics-top-item">
<view><span class="fsizeA"></span></view> <view><span class="fsizeA">{{homeInfo.todayPurchasePrice}}</span></view>
<view><span class="fsizeA">今日采购量</span></view> <view><span class="fsizeA">今日采购量</span></view>
</view> </view>
</u-col> </u-col>
<u-col span="4" text-align="center"> <u-col span="4" text-align="center">
<view class="sty-statistics-top-item"> <view class="sty-statistics-top-item">
<view><span class="fsizeA"></span></view> <view><span class="fsizeA">{{homeInfo.salesVolumeToday}}</span></view>
<view><span class="fsizeA">今日销售量</span></view> <view><span class="fsizeA">今日销售量</span></view>
</view> </view>
</u-col> </u-col>
@ -51,7 +51,7 @@
<u-row> <u-row>
<u-col span="12" text-align="center"> <u-col span="12" text-align="center">
<view> <view>
待支付: 待支付:{{homeInfo.unpaid}}
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
@ -69,7 +69,7 @@
<u-row> <u-row>
<u-col span="12" text-align="center"> <u-col span="12" text-align="center">
<view> <view>
今日付款: 今日付款:{{homeInfo.todayPay}}
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
@ -93,7 +93,7 @@
<u-row> <u-row>
<u-col span="12" text-align="center"> <u-col span="12" text-align="center">
<view> <view>
待回款: 待回款:{{homeInfo.moneyCollected}}
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
@ -111,7 +111,7 @@
<u-row> <u-row>
<u-col span="12" text-align="center"> <u-col span="12" text-align="center">
<view> <view>
今日回款: 今日回款:{{homeInfo.todayPayment}}
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
@ -178,10 +178,12 @@
tabsClass: '', tabsClass: '',
activeItemStyle: { activeItemStyle: {
'background-color': '#fff', 'background-color': '#fff',
} },
homeInfo: {},
} }
}, },
created() { created() {
if (this.item.jnpfKey === 'tab') { if (this.item.jnpfKey === 'tab') {
const list = this.item.children const list = this.item.children
for (var i = 0; i < list.length; i++) { for (var i = 0; i < list.length; i++) {
@ -195,7 +197,11 @@
} }
} }
}, },
methods: { methods: {
change(index) { change(index) {
this.current = index; this.current = index;
}, },
@ -203,7 +209,7 @@
if (this.tabCurrent === index) return if (this.tabCurrent === index) return
this.tabCurrent = index; this.tabCurrent = index;
this.key = +new Date() this.key = +new Date()
}, },
} }
} }
</script> </script>

@ -116,6 +116,7 @@
</u-col> </u-col>
</u-row> </u-row>
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
</u-col> </u-col>

@ -95,8 +95,6 @@
import IndexMixin from './mixin.js' import IndexMixin from './mixin.js'
import chat from '@/libs/chat.js' import chat from '@/libs/chat.js'
import portalItem from '@/components/visualPortal/components/index.vue' import portalItem from '@/components/visualPortal/components/index.vue'
// import portalItem from '@/components/visualPortal/components/index1.vue'
import defaultPortal from '@/components/visualPortal/components/defaultPortal.vue' import defaultPortal from '@/components/visualPortal/components/defaultPortal.vue'
import { import {
auth auth

@ -3,5 +3,102 @@
<mapper namespace="jnpf.mapper.BusinessOrderProductRelationalMapper"> <mapper namespace="jnpf.mapper.BusinessOrderProductRelationalMapper">
<resultMap id="getHomePageDataMap" type="map">
<!--采购平均价-->
<result property="avgPurchasePrice" column="avgPurchasePrice"/>
<!--今日采购量-->
<result property="todayPurchasePrice" column="todayPurchasePrice"/>
<!--今日销售量-->
<result property="salesVolumeToday" column="salesVolumeToday"/>
<!--待支付-->
<result property="unpaid" column="unpaid"/>
<!--今日付款-->
<result property="todayPay" column="todayPay"/>
<!--待回款-->
<result property="moneyCollected" column="moneyCollected"/>
<!--今日回款-->
<result property="todayPayment" column="todayPayment"/>
</resultMap>
<select id="getHomePageData" resultMap="getHomePageDataMap">
SELECT
*
FROM
(
SELECT
COUNT( b.id ) AS avgPurchasePrice,
IFNULL( SUM( Round( IF ( b.unit = '千克', b.net_weight / 1000, net_weight ), 3 )), 0 ) AS todayPurchasePrice
FROM
jg_receipt_order a
LEFT JOIN jg_delivery_voucher_relation b ON a.id = b.order_id
AND b.f_delete_mark IS NULL
WHERE
-- to_days( a.f_creator_time ) = to_days(
-- now())
-- AND
a.f_delete_mark IS NULL
AND a.receipt_type = '1'
) a,
(
SELECT
IFNULL( SUM( Round( IF ( b.unit = '千克', b.net_weight / 1000, net_weight ), 3 )), 0 ) AS salesVolumeToday
FROM
jg_receipt_order a
LEFT JOIN jg_delivery_voucher_relation b ON a.id = b.order_id
AND b.f_delete_mark IS NULL
WHERE
to_days( a.f_creator_time ) = to_days(
now())
AND a.f_delete_mark IS NULL
AND a.receipt_type = '2'
) b,
(
SELECT
ROUND( IFNULL( SUM( IFNULL( a.apply_amount, 0 )), 0 ), 6 )/ 10000 unpaid -- 待支付
FROM
jg_cw_payment_receipt a
WHERE
a.`type` = '1'
AND a.apply_amount &lt; a.payment_amount
AND a.f_delete_mark IS NULL
) c,
(
SELECT
ROUND( IFNULL( SUM( IFNULL( a.payment_amount, 0 )), 0 ), 6 )/ 10000 todayPay -- 今日支付
FROM
jg_cw_payment_receipt a
WHERE
a.`type` = '1'
AND to_days( a.f_creator_time ) = to_days(
now())
AND a.f_delete_mark IS NULL
) d,
(
SELECT
ROUND( IFNULL( SUM( IFNULL( a.apply_amount, 0 )), 0 ), 6 )/ 10000 moneyCollected -- 待回款
FROM
jg_cw_payment_receipt a
WHERE
a.`type` = '2'
AND a.apply_amount &lt; a.payment_amount
AND a.f_delete_mark IS NULL
) e,
(
SELECT
ROUND( IFNULL( SUM( IFNULL( a.payment_amount, 0 )), 0 ), 6 )/ 10000 todayPayment -- 今日回款
FROM
jg_cw_payment_receipt a
WHERE
a.`type` = '2'
AND to_days( a.f_creator_time ) = to_days(
now())
AND a.f_delete_mark IS NULL
) f
</select>
</mapper> </mapper>

@ -4,6 +4,9 @@ package jnpf.mapper;
import jnpf.entity.BusinessEnterpriseRelationalEntity; import jnpf.entity.BusinessEnterpriseRelationalEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
/** /**
* businessEnterpriseRelational * businessEnterpriseRelational
* V3.5 * V3.5
@ -13,4 +16,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface BusinessEnterpriseRelationalMapper extends BaseMapper<BusinessEnterpriseRelationalEntity> { public interface BusinessEnterpriseRelationalMapper extends BaseMapper<BusinessEnterpriseRelationalEntity> {
/**
*
* @return
*/
List<Map> getHomePageData();
} }

@ -32,4 +32,7 @@ public interface BusinessEnterpriseRelationalService extends IService<BusinessEn
void saveOrUpdate(BusinessEnterpriseRelationalForm businessEnterpriseRelationalForm,String id, boolean isSave) throws Exception; void saveOrUpdate(BusinessEnterpriseRelationalForm businessEnterpriseRelationalForm,String id, boolean isSave) throws Exception;
//移动端首页统计
List<Map> getHomePage();
} }

@ -30,6 +30,9 @@ import jnpf.util.*;
import java.util.*; import java.util.*;
import jnpf.base.UserInfo; import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity; import jnpf.permission.entity.UserEntity;
import javax.annotation.Resource;
/** /**
* *
* businessEnterpriseRelational * businessEnterpriseRelational
@ -45,6 +48,8 @@ public class BusinessEnterpriseRelationalServiceImpl extends ServiceImpl<Busines
@Autowired @Autowired
private UserProvider userProvider; private UserProvider userProvider;
@Resource
private BusinessEnterpriseRelationalMapper businessEnterpriseRelationalMapper;
@Override @Override
public List<BusinessEnterpriseRelationalEntity> getList(BusinessEnterpriseRelationalPagination businessEnterpriseRelationalPagination){ public List<BusinessEnterpriseRelationalEntity> getList(BusinessEnterpriseRelationalPagination businessEnterpriseRelationalPagination){
@ -277,4 +282,9 @@ public class BusinessEnterpriseRelationalServiceImpl extends ServiceImpl<Busines
this.saveOrUpdate(entity); this.saveOrUpdate(entity);
} }
@Override
public List<Map> getHomePage() {
return businessEnterpriseRelationalMapper.getHomePageData();
}
} }

@ -2,6 +2,7 @@ package jnpf.controller;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult; import jnpf.base.ActionResult;
@ -321,4 +322,17 @@ public class BusinessEnterpriseRelationalController {
return ActionResult.success(businessEnterpriseRelationalMap); return ActionResult.success(businessEnterpriseRelationalMap);
} }
/**
*
*
* @param
* @return
*/
@GetMapping("/getHomePage")
@Operation(summary ="获取首页信息")
public ActionResult getHomePage() throws IOException {
List<Map> list = businessEnterpriseRelationalService.getHomePage();
return ActionResult.success(list);
}
} }

Loading…
Cancel
Save