xiaohaizhao 6 ay önce
ebeveyn
işleme
923b16201a

+ 190 - 0
salesPanel/dataOverview/Project/dataOverview.js

@@ -0,0 +1,190 @@
+const _Http = getApp().globalData.http;
+Component({
+    options: {
+        addGlobalClass: true,
+    },
+    properties: {
+        update: {
+            type: Function
+        }
+    },
+    lifetimes: {
+        attached: function () {
+            getApp().globalData.Language.getLanguagePackage(this)
+            this.setData({
+                dates: this.data.dates.map(v => {
+                    v.name = getApp().globalData.Language.getMapText(v.value);
+                    v.color = v.value == this.data.content.dateType ? "#3874F6" : "";
+                    return v
+                })
+            })
+        }
+    },
+    data: {
+        "content": {
+            dateType: "本年",
+            dataid: wx.getStorageSync('userMsg').userid,
+            username: wx.getStorageSync('userMsg').name,
+            type: 0,
+            "where": {
+                isleave: "1"
+            }
+        },
+        detaShow: false,
+        dates: [{
+            value: "全部"
+        }, {
+            value: "本年"
+        }, {
+            value: "本季"
+        }, {
+            value: "本月"
+        }, {
+            value: "去年"
+        }, ],
+    },
+    methods: {
+        getList() {
+            let content = this.data.content;
+            _Http.basic({
+                "id": 20231018110404,
+                content
+            }).then(res => {
+                console.log("项目数据概况", res)
+                if (res.code != '1') return wx.showToast({
+                    title: res.msg,
+                    icon: "none"
+                })
+                const getMapText = getApp().globalData.Language.getMapText;
+                let list = [{
+                        title: '项目总数',
+                        value: res.data.totalqty,
+                        tips: getMapText('项目总数:统计所有项目的数量'),
+                        link: true
+                    },
+                    {
+                        title: '报备项目数',
+                        value: res.data.reportProject,
+                        tips: getMapText('报备项目数:统计已报备的项目数量'),
+                        link: true
+                    },
+                    {
+                        title: '进行中项目数',
+                        value: res.data.dealProject,
+                        tips: getMapText('进行中项目数:进行中状态的项目数量'),
+                        link: true
+                    },
+                    {
+                        title: '项目成交数',
+                        value: res.data.dealProject,
+                        tips: getMapText('项目成交数:统计有关联审核过的订单的项目数量'),
+                        link: true
+                    },
+                    {
+                        title: '项目成交率',
+                        value: res.data.cjl + '%',
+                        tips: getMapText('项目成交率=有关联审核订单的项目数÷项目总数×100%'),
+                        link: false
+                    },
+                    {
+                        title: '项目失败数',
+                        value: res.data.failedproject,
+                        tips: getMapText('项目失败数:已失败状态的项目数量'),
+                        link: true
+                    },
+                    {
+                        title: '项目失败率',
+                        value: Math.round(((res.data.sbl) * 100) / 100) + '%',
+                        tips: getMapText('项目失败率=已失败项目数÷项目总数×100%'),
+                        link: false
+                    },
+                    {
+                        title: '参与项目数',
+                        value: res.data.joinProject,
+                        tips: getMapText('参与项目数:参与的并且至少有一次跟进的项目数量'),
+                        link: true
+                    },
+                    {
+                        title: '参与项目成交数',
+                        value: res.data.joinDealProject,
+                        tips: getMapText('参与项目成交数:参与的并且至少有一次跟进的项目的成交数量'),
+                        link: true
+                    },
+                    {
+                        title: '参与项目成交率',
+                        value: Math.round(((res.data.joinDealProjectcjl) * 100) / 100) + '%',
+                        tips: getMapText('参与项目成交率=参与项目成交数 ÷ 参与项目数 ×100%'),
+                        link: false
+                    },
+                ];
+
+                try {
+                    list = list.concat(res.data.projecttype.map(v => {
+                        return {
+                            title: v.value,
+                            value: v.qty,
+                            tips: "",
+                            link: true
+                        }
+                    }))
+                } catch (error) {
+
+                }
+                this.setData({
+                    list,
+                    content
+                })
+                this.onCancel()
+            })
+        },
+        showTips(e) {
+            const {
+                tips
+            } = e.currentTarget.dataset;
+            wx.showModal({
+                content: tips,
+                showCancel: false,
+                confirmText: getApp().globalData.Language.getMapText('确定'),
+            })
+        },
+        toDetail(e) {
+            const {
+                item
+            } = e.currentTarget.dataset;
+        },
+        openDateType() {
+            this.setData({
+                detaShow: true
+            })
+        },
+        dateOnSelect(event) {
+            const {
+                value
+            } = event.detail;
+            if (this.data.content.dateType == value) return this.onCancel();
+            this.setData({
+                "content.dateType": value,
+                dates: this.data.dates.map(item => {
+                    item.color = item.value == value ? "#3874F6" : "";
+                    item.loading = item.value == value ? true : false;
+                    return item
+                }),
+            })
+            this.getList(true)
+        },
+        onCancel() {
+            this.setData({
+                actionShow: false,
+                detaShow: false,
+                list: this.data.list.map(item => {
+                    item.loading = false;
+                    return item
+                }),
+                dates: this.data.dates.map(item => {
+                    item.loading = false;
+                    return item
+                })
+            })
+        },
+    }
+})

+ 4 - 0
salesPanel/dataOverview/Project/dataOverview.json

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

+ 71 - 0
salesPanel/dataOverview/Project/dataOverview.scss

@@ -0,0 +1,71 @@
+.head {
+	display: flex;
+	justify-content: space-between;
+	margin-bottom: 0;
+	line-height: 40rpx;
+	font-family: PingFang SC, PingFang SC;
+	font-weight: 700;
+	font-size: 28rpx;
+	color: #333333;
+	margin-top: 10rpx;
+
+	.right {
+		display: flex;
+		align-items: center;
+
+		.iconfont {
+			margin-left: 10rpx;
+		}
+	}
+}
+
+.list {
+	display: flex;
+	flex-wrap: wrap;
+	justify-content: space-between;
+
+	.item {
+		position: relative;
+		width: 314rpx;
+		padding: 10rpx 20rpx;
+		box-sizing: border-box;
+		border-radius: 20rpx;
+		border: 1rpx solid #E0E0E0;
+		margin-bottom: 20rpx;
+
+		.title {
+			display: flex;
+			align-items: center;
+			line-height: 28rpx;
+			font-family: PingFang SC, PingFang SC;
+			font-size: 20rpx;
+			color: #999999;
+			margin-top: 6rpx;
+
+			.iconfont{
+				font-size: 20rpx;
+				padding-left: 10rpx;
+			}
+		}
+
+		.value {
+			line-height: 44rpx;
+			font-family: PingFang SC, PingFang SC;
+			font-weight: bold;
+			font-size: 32rpx;
+			color: #333333;
+		}
+
+		.title,.value{
+			width: 90%;
+		}
+
+		.detail {
+			position: absolute;
+			right: 10rpx;
+			top: 50%;
+			transform: translateY(-50%) rotate(-90deg);
+		}
+
+	}
+}

+ 16 - 0
salesPanel/dataOverview/Project/dataOverview.wxml

@@ -0,0 +1,16 @@
+<view class="global-card head">
+    <view class="left">{{language[content.username]||content.username}}_{{language['数据概况']||'数据概况'}}</view>
+    <view class="right" bind:tap="openDateType">
+        {{language[content.dateType]||content.dateType}}
+        <text class="iconfont icon-xiangxiazhankai" />
+    </view>
+</view>
+<view class="global-card list">
+    <view class="item" hover-class="{{item.link?'navigator-hover':''}}" wx:for="{{list}}" wx:key="title" bind:tap="toDetail" data-item="{{item}}">
+        <view class="value">{{item.value}}</view>
+        <view class="title">{{language[item.title]||item.title}} <text catch:tap="showTips" wx:if="{{item.tips}}" data-tips="{{item.tips}}" class="iconfont icon-wenhao" /></view>
+        <view wx:if="{{item.link}}" class="iconfont icon-xiangxiazhankai detail" />
+    </view>
+</view>
+<My_empty wx:if="{{list.length==0}}" />
+<van-action-sheet show="{{  detaShow }}" actions="{{ dates }}" bind:select='dateOnSelect' bind:cancel='onCancel' bind:click-overlay='onCancel' cancel-text="{{language['取消']||'取消'}}" />

+ 2 - 1
salesPanel/dataOverview/index.json

@@ -1,7 +1,8 @@
 {
     "usingComponents": {
         "Clue": "./list/Clue",
-        "Client":"./list/client"
+        "Client": "./list/client",
+        "Project": "./list/Project"
     },
     "navigationBarTitleText": "数据总览"
 }

+ 52 - 0
salesPanel/dataOverview/list/Project.js

@@ -0,0 +1,52 @@
+const _Http = getApp().globalData.http;
+Component({
+    options: {
+        addGlobalClass: true,
+    },
+    properties: {
+        update: {
+            type: Function
+        }
+    },
+    lifetimes: {
+        attached: function () {
+            getApp().globalData.Language.getLanguagePackage(this)
+            this.triggerEvent('update', "Client")
+        }
+    },
+    data: {
+        tabsActive: 0,
+        tabsList: [{
+            label: "数据概况",
+            model: "#DataOverview"
+        }],
+        init: false
+    },
+    methods: {
+        getList() {
+            this.partialRenewal()
+            this.data.init = true;
+        },
+        tabsChange({
+            detail
+        }) {
+            this.setData({
+                tabsActive: detail
+            });
+            this.partialRenewal();
+        },
+        //局部数据更新 tabs
+        partialRenewal() {
+            const model = this.data.tabsList[this.data.tabsActive].model;
+            if (model) {
+                const Component = this.selectComponent(model);
+                Component.getList(true);
+            }
+            this.data.model = model;
+        },
+        getContent() {
+            const model = this.data.tabsList[this.data.tabsActive].model;
+            if (model) return this.selectComponent(model).data.content
+        }
+    }
+})

+ 6 - 0
salesPanel/dataOverview/list/Project.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "DataOverview": "../Project/dataOverview"
+    }
+}

+ 1 - 0
salesPanel/dataOverview/list/Project.scss

@@ -0,0 +1 @@
+@import "./Clue.scss";

+ 3 - 0
salesPanel/dataOverview/list/Project.wxml

@@ -0,0 +1,3 @@
+<Yl_FunTabs id='Yl_FunTabs' safety='{{false}}' list='{{tabsList}}' mode='buts' active='{{tabsActive}}' bind:onChenge="tabsChange">
+    <DataOverview slot='数据概况' id='DataOverview' />
+</Yl_FunTabs>