xiaohaizhao hace 11 meses
padre
commit
ab1485d146

+ 8 - 1
app.json

@@ -182,13 +182,20 @@
                 "details/sales",
                 "details/sales",
                 "details/contacts"
                 "details/contacts"
             ]
             ]
+        },
+        {
+            "root": "salesPanel",
+            "pages": [
+                "index/index"
+            ]
         }
         }
     ],
     ],
     "preloadRule": {
     "preloadRule": {
         "pages/login/phone": {
         "pages/login/phone": {
             "packages": [
             "packages": [
                 "packageA",
                 "packageA",
-                "portrayal"
+                "portrayal",
+                "salesPanel"
             ],
             ],
             "network": "all"
             "network": "all"
         }
         }

+ 57 - 0
salesPanel/index/index.js

@@ -0,0 +1,57 @@
+Page({
+    data: {
+        active: 0,
+        ops: [{
+            title: '销售数据',
+            name: '0',
+        }, {
+            title: '',
+            name: '',
+        }, {
+            title: '',
+            name: '',
+        }],
+        tabsList: [{
+            label: "销售面板",
+            model: "#Panel"
+        }, {
+            label: "客户账户余额分析"
+        }, {
+            label: "销售TOP10"
+        }, {
+            label: "报价分析"
+        }],
+        tabsActive: 0,
+    },
+    onLoad(options) {
+        getApp().globalData.Language.getLanguagePackage(this, '销售数据');
+        this.partialRenewal();
+    }, //tabs 切换
+    tabsChange({
+        detail
+    }) {
+        this.setData({
+            tabsActive: detail
+        });
+        this.partialRenewal();
+    },
+    //局部数据更新 tabs
+    partialRenewal(init = false) {
+        const model = this.data.tabsList[this.data.tabsActive].model;
+        if (model) {
+            const Component = this.selectComponent(model),
+                {
+                    total,
+                    pageNumber,
+                    pageTotal
+                } = Component.data.content,
+                id = this.data.sa_projectid;
+            if (total == null || init) {
+                Component.getList(id, init);
+                //initialize
+            } else if (pageNumber <= pageTotal) {
+                Component.getList(id, false);
+            }
+        }
+    },
+})

+ 6 - 0
salesPanel/index/index.json

@@ -0,0 +1,6 @@
+{
+    "usingComponents": {
+        "Panel": "../panel/index"
+    },
+    "navigationBarTitleText": "销售数据"
+}

+ 40 - 0
salesPanel/index/index.scss

@@ -0,0 +1,40 @@
+.tab-box {
+    display: flex;
+
+    .left {
+        width: 0;
+        flex: 1;
+
+        .tab-class {
+            font-family: Microsoft YaHei, Microsoft YaHei;
+            font-weight: bold;
+            font-size: 28rpx;
+            color: #333333;
+        }
+    }
+
+    .right {
+        display: flex;
+        align-items: center;
+        height: 86rpx;
+        background-color: #fff;
+        flex-shrink: 0;
+
+        .filtrate-box {
+            display: flex;
+            height: 100%;
+            align-items: center;
+            padding: 0 20rpx;
+
+            font-family: PingFang SC, PingFang SC;
+            font-size: 28rpx;
+            color: #666666;
+
+            .iconfont {
+                margin-right: 6rpx;
+                color: #999999;
+            }
+
+        }
+    }
+}

+ 16 - 0
salesPanel/index/index.wxml

@@ -0,0 +1,16 @@
+<view class='tab-box'>
+    <view class="left">
+        <van-tabs active="{{ active }}" tab-class='tab-class' color='#3874F6'>
+            <van-tab wx:for="{{ops}}" wx:key="name" disabled='{{!item.title}}' title="{{language[item.title]||item.title}}" name="{{item.name}}" />
+        </van-tabs>
+    </view>
+    <view class="right">
+        <view class="filtrate-box" hover-class="navigator-hover" bindtap="openFiltrate">
+            <text class="iconfont  icon-shaixuan" />
+            {{language['筛选']||'筛选'}}
+        </view>
+    </view>
+</view>
+<Yl_FunTabs id='Yl_FunTabs' safety='{{false}}' list='{{tabsList}}' mode='buts' active='{{tabsActive}}' bind:onChenge="tabsChange">
+    <Panel slot='销售面板' id='Panel' />
+</Yl_FunTabs>

+ 100 - 0
salesPanel/panel/index.js

@@ -0,0 +1,100 @@
+const _Http = getApp().globalData.http,
+    currency = require("../../utils/currency"),
+    CNY = (value, symbol = "¥", precision = 2) => currency(value, {
+        symbol,
+        precision
+    }).format();
+import {
+    getHeight
+} from "../../utils/getHeight";
+Component({
+    properties: {
+
+    },
+    options: {
+        addGlobalClass: true
+    },
+    lifetimes: {
+        attached: function () {
+            getApp().globalData.Language.getLanguagePackage(this)
+        }
+    },
+    data: {
+        list: [{
+                type: "订单",
+                datatype: 1
+            },
+            {
+                type: "出货",
+                datatype: 2
+            },
+            {
+                type: "开票",
+                datatype: 3
+            },
+            {
+                type: "回款",
+                datatype: 4
+            }
+        ],
+        "content": {
+            "type": 1,
+            "dataid": 54,
+            "dateType": "本年",
+            "datatype": 1
+        },
+        initialize: false, // 是否初始化
+        height: 0,
+    },
+    methods: {
+        getList(init = false) {
+            let content = this.data.content,
+                item = this.data.list[content.datatype - 1];
+            if (!init && item.init) return;
+            _Http.basic({
+                "id": 20231009125304,
+                content
+            }).then(res => {
+                console.log(item.type + "面板", res)
+                this.selectComponent('#ListBox' + content.datatype).RefreshToComplete();
+                if (res.code != '1') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                })
+                let data = res.data,
+                    dividend = wx.getStorageSync('languagecode') == 'ZH' ? 10000 : 1000;
+                data.target_l = CNY(data.target_l / dividend);
+                data.nowTarget_l = CNY(data.nowTarget_l / dividend);
+                data.unamount = CNY(data.unamount / dividend);
+                data.amount = CNY(data.amount / dividend);
+                data.unnowTarget_l = CNY(data.unnowTarget_l / dividend);
+                data.wcamount = (data.wcamount * 100).toFixed(2); // 达成率
+                data.tbxsje = (data.tbxsje * 100).toFixed(2); // 同比增长率
+                data.hbxsje = (data.hbxsje * 100).toFixed(2); // 环比增长率
+                data.wcnowTarget_l = (data.wcnowTarget_l * 100).toFixed(2); // 累计目标达成率
+                data.init = true;
+                this.setData({
+                    [`list[${content.datatype - 1}]`]: Object.assign(item, data),
+                })
+                console.log("list", this.data.list)
+                this.setHeight()
+            })
+
+        },
+        setHeight() {
+            getHeight("#head", this).then(height => {
+                this.setData({
+                    height: height - 20
+                })
+            })
+        },
+        swiperChange({
+            detail
+        }) {
+            this.setData({
+                "content.datatype": detail.currentItemId
+            })
+            this.getList();
+        },
+    }
+})

+ 4 - 0
salesPanel/panel/index.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 5 - 0
salesPanel/panel/index.scss

@@ -0,0 +1,5 @@
+.head {
+	display: flex;
+	height: 40rpx;
+	line-height: 40rpx;
+}

+ 14 - 0
salesPanel/panel/index.wxml

@@ -0,0 +1,14 @@
+<view id="head" />
+<swiper class='swiper' style="height: {{height}}px;" current='{{ content.datatype -1 }}' indicator-dots circular bindchange='swiperChange'>
+    <swiper-item class='swiper-item' wx:for='{{list}}' item-id='{{item.datatype}}' wx:key="type">
+        <Yl_ListBox id='ListBox{{item.datatype}}' bind:getlist='getList'>
+            <view style="width: 100vw;">
+                <view class="global-card">
+                    <view class="head">
+                        
+                    </view>
+                </view>
+            </view>
+        </Yl_ListBox>
+    </swiper-item>
+</swiper>

+ 5 - 1
utils/work/apps.js

@@ -32,8 +32,12 @@ function getapps() {
 		icon: "work-xiaoshouloudou"
 		icon: "work-xiaoshouloudou"
 	}, {
 	}, {
 		name: "360°画像",
 		name: "360°画像",
-		path: "/portrayal/index/index",
+		path: "/packageA/portrayal/index",
 		icon: "work-kehuhuaxiang"
 		icon: "work-kehuhuaxiang"
+	}, {
+		name: "销售数据",
+		path: "/salesPanel/index/index",
+		icon: "work-xiaoshoushuju"
 	}];
 	}];
 	let app = [...getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['通用']), ...getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['数据统计'], ['数据分析'])],
 	let app = [...getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['通用']), ...getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['数据统计'], ['数据分析'])],
 		list = [];
 		list = [];

+ 4 - 0
utils/work/work-icon.wxss

@@ -8,6 +8,10 @@
     -moz-osx-font-smoothing: grayscale;
     -moz-osx-font-smoothing: grayscale;
 }
 }
 
 
+.work-xiaoshoushuju:before {
+    content: "\e625";
+}
+
 .work-qiandao:before {
 .work-qiandao:before {
     content: "\e615";
     content: "\e615";
 }
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 1
utils/work/work.wxss


Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio