xiaohaizhao пре 4 месеци
родитељ
комит
6de433c073

+ 4 - 1
salesPanel/agencyTarget/index.js

@@ -1,13 +1,16 @@
 Page({
     data: {
         tabsList: [{
+            label: "经销商",
+            model: "#target"
+        }, {
             label: "产品类别",
             model: "#productType"
         }, {
             label: "订单情况",
             model: "#orderForm"
         }],
-        tabsActive: 1,
+        tabsActive: 0,
     },
     onLoad(options) {
         this.partialRenewal();

+ 1 - 0
salesPanel/agencyTarget/index.json

@@ -1,6 +1,7 @@
 {
     "usingComponents": {
         "orderForm":"./orderForm/index",
+        "target":"./target/index",
         "productType":"./productType/index"
     },
     "navigationBarTitleText": "经销商目标"

+ 2 - 0
salesPanel/agencyTarget/index.wxml

@@ -1,4 +1,6 @@
+<view style="height: 10rpx;"></view>
 <Yl_FunTabs id='Yl_FunTabs' safety='{{false}}' list='{{tabsList}}' mode='buts' active='{{tabsActive}}' bind:onChenge="tabsChange">
     <productType slot='产品类别' id='productType' />
     <orderForm slot='订单情况' id='orderForm' />
+    <target slot='经销商' id='target' />
 </Yl_FunTabs>

+ 113 - 0
salesPanel/agencyTarget/target/index.js

@@ -0,0 +1,113 @@
+const _Http = getApp().globalData.http,
+    currency = require("../../../utils/currency"),
+    CNY = (value, symbol = "¥", precision = 2) => currency(value, {
+        symbol,
+        precision
+    }).format();
+
+Component({
+    properties: {
+
+    },
+    options: {
+        addGlobalClass: true
+    },
+    lifetimes: {
+        attached: function () {}
+    },
+    data: {
+        content: {
+            year: new Date().getFullYear(),
+            sa_saleareaid: 0,
+            "type": 3, //1:人员,2:医院,3:经销商
+            "month_start": 1,
+            "month_end": 12,
+            "userid": wx.getStorageSync('userMsg').userid,
+            "sa_customersid": 0,
+            "sa_agentsid": 0,
+            where: {}
+        },
+        detail: {},
+        enterprisename:""
+    },
+    methods: {
+        async getList(init = false) {
+            if (init) this.getData()
+        },
+        async getData() {
+            let content = this.data.content
+            _Http.basic({
+                "id": 2026010610085402,
+                content
+            }).then(res => {
+                console.log("目标", res)
+                if (res.code != 1) return wx.showToast({
+                    title: res.msg,
+                    icon: "none"
+                });
+                let item = res.data[0];
+                item.m_balanceamount = CNY(item.m_balanceamount)
+                item.m_saleamount = CNY(item.m_saleamount)
+                item.m_targetamount = CNY(item.m_targetamount)
+                this.setData({
+                    detail: item
+                })
+                console.log(this.data.detail)
+            })
+        },
+        changeDate({
+            detail
+        }) {
+            this.setData({
+                "content.year": detail.year,
+                "content.month_start": detail.startMonth,
+                "content.month_end": detail.endMonth,
+            })
+            this.getData()
+        },
+        toSelect(e) {
+            let params = {
+                "content": {
+                    "pageNumber": 1,
+                    "pageSize": 20,
+                    "sa_saleareaids": [],
+                    "where": {
+                        "condition": ""
+                    }
+                },
+                "id": 2026010516152802,
+            }
+            wx.navigateTo({
+                url: `/prsx/select/firm/index?params=${JSON.stringify(params)}&radio=true`,
+            });
+            let that = this;
+            getApp().globalData.handleSelect = function ({
+                item
+            }) {
+                console.log(item)
+                wx.showModal({
+                    title: '提示',
+                    content: `是否确定选择“${item.enterprisename}”`,
+                    complete: (res) => {
+                        if (res.confirm) {
+                            that.setData({
+                                enterprisename: item.enterprisename,
+                                "content.sa_agentsid": item.sa_agentsid
+                            })
+                            that.getData()
+                            wx.navigateBack()
+                            delete getApp().globalData.handleSelect
+                        }
+                    }
+                })
+            }
+        },
+        clearCallBack(e) {
+            this.setData({
+                enterprisename: '',
+                "content.sa_agentsid": 0
+            })
+            this.getData()
+        }
+    }
+})

+ 6 - 0
salesPanel/agencyTarget/target/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "headOptionBox": "../../headOptionBox/index"
+    }
+}

+ 126 - 0
salesPanel/agencyTarget/target/index.scss

@@ -0,0 +1,126 @@
+page {
+    width: 100vw;
+    overflow: hidden;
+}
+
+.head {
+    display: flex;
+    margin-bottom: 30rpx;
+
+    .item {
+        font-weight: bold;
+    }
+}
+
+.chart {
+    margin: 0 auto;
+    width: 280rpx;
+    flex-shrink: 0;
+    margin-bottom: 20rpx;
+
+    .circle {
+        width: 280rpx;
+        height: 280rpx;
+        position: relative;
+        border-radius: 50%;
+        box-shadow: inset 0 0 0 20rpx var(--assist);
+
+        .ab {
+            position: absolute;
+            left: 0;
+            right: 0;
+            top: 0;
+            bottom: 0;
+            margin: auto;
+        }
+
+        &_left {
+            border: 20rpx solid #EBEEF5;
+            border-radius: 50%;
+            clip: rect(0, 140rpx, 280rpx, 0);
+        }
+
+        &_right {
+            border: 20rpx solid #EBEEF5;
+            border-radius: 50%;
+            clip: rect(0, 280rpx, 280rpx, 140rpx);
+        }
+
+        &_text {
+            height: 100%;
+            display: flex;
+            flex-direction: column;
+            justify-content: center;
+            align-items: center;
+            font-size: 32rpx;
+
+            .value {
+                font-family: Microsoft YaHei, Microsoft YaHei;
+                font-weight: bold;
+                font-size: 32rpx;
+                color: #333333;
+                margin-top: 12rpx;
+            }
+
+            .name {
+                font-family: Microsoft YaHei, Microsoft YaHei;
+                color: #999999;
+                margin-top: 16rpx;
+            }
+        }
+    }
+}
+
+.card {
+    width: 100%;
+    border-radius: 20rpx;
+    border: 1rpx solid #E0E0E0;
+    padding: 20rpx 40rpx;
+    margin-top: 20rpx;
+
+    .title {
+        line-height: 32rpx;
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-size: 24rpx;
+        color: #999999;
+    }
+
+    .price {
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-size: 24rpx;
+        color: #3685FC;
+        margin-top: 10rpx;
+
+        text {
+            font-size: 40rpx;
+            margin-right: 6rpx;
+        }
+    }
+
+    .row {
+        line-height: 32rpx;
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-size: 24rpx;
+        color: #999999;
+        margin-top: 6rpx;
+
+        .increase,
+        .decrease {
+            display: inline-block;
+            width: 0;
+            height: 0;
+            border-left: 8rpx solid transparent;
+            border-right: 8rpx solid transparent;
+            margin-left: 10rpx;
+        }
+
+        .increase {
+            border-bottom: 14rpx solid #009966;
+        }
+
+        .decrease {
+            border-top: 14rpx solid #EF0606;
+        }
+    }
+
+}

+ 63 - 0
salesPanel/agencyTarget/target/index.wxml

@@ -0,0 +1,63 @@
+<view style="height: 10rpx;"></view>
+<filtrate id='Filtrate' iconName='icon-bumen' wx:if='{{areaList.length}}' list='{{areaList}}' type="{{active}}" title='营销区域' bind:onChange='changeArea' />
+<headOptionBox iconName='icon-bumen' title='经销商' showText='{{enterprisename}}' isClear bind:clearCallBack='clearCallBack' placeholder="选择经销商" bind:tap="toSelect" />
+<viewDate iconName='icon-shijian1' type='sameYear' fields='year' value='{{content.year}}' startMonth="{{content.month_start}}" endMonth="{{content.month_end}}" title='时间范围' bind:onChange='changeDate' />
+<view style="height: 20rpx;"></view>
+
+<view class="global-card" style="overflow: hidden;">
+	<view class="chart">
+		<view class="circle">
+			<view class="circle_left ab" style="{{render.leftRate(detail[ 'm_' +'rate_achieve'])}}" />
+			<view class="circle_right ab" style="{{render.rightRate(detail[ 'm_' +'rate_achieve'])}}" />
+			<view class="circle_text">
+				<text class="name">目标达成率</text>
+				<text class="value">{{detail[ 'm_' + 'rate_achieve' ]}}%</text>
+			</view>
+		</view>
+	</view>
+
+	<view class="card">
+		<view class="title">销售额</view>
+		<view class="price">
+			<text>{{detail[ 'm_' + 'saleamount' ]}}</text>
+		</view>
+		<view class="row">
+			同比:{{detail[ 'm_' + 'rate_yoy' ]}}%
+			<view wx:if="{{detail[ 'm_'  + 'rate_yoy'] != 0}}" class="{{detail[ 'm_' + 'rate_yoy']>=0?'increase':'decrease'}}" />
+		</view>
+		<view class="row">
+			环比:{{detail[ 'm_' + 'rate_mom' ]}}%
+			<view wx:if="{{detail[ 'm_' + 'rate_mom'] != 0}}" class="{{detail[ 'm_' + 'rate_mom']>=0?'increase':'decrease'}}" />
+		</view>
+	</view>
+
+	<view class="card">
+		<view class="title">任务量</view>
+		<view class="price">
+			<text>{{detail[ 'm_' + 'targetamount' ]}}</text>
+		</view>
+		<view class="row">
+			目标达成率:{{detail[ 'm_' + 'rate_achieve' ]}}%
+		</view>
+		<view class="row">
+			销售额与任务量差额:{{detail[ 'm_' + 'balanceamount' ]}}
+		</view>
+	</view>
+</view>
+
+<wxs module="render">
+	module.exports = {
+		rightRate: function (rate) {
+			if (rate - 0 < 50) {
+				return 'transform: rotate(' + 3.6 * (rate - 0) + 'deg);';
+			} else {
+				return 'transform: rotate(0);border-color: var(--assist);';
+			}
+		},
+		leftRate: function (rate) {
+			if (rate - 0 >= 50) {
+				return 'transform: rotate(' + 3.6 * (rate - 50) + 'deg);';
+			}
+		}
+	}
+</wxs>

+ 4 - 1
salesPanel/hospitalTarget/index.js

@@ -1,6 +1,9 @@
 Page({
     data: {
         tabsList: [{
+            label: "医院",
+            model: "#target"
+        }, {
             label: "产品类别",
             model: "#productType"
         }, {
@@ -10,7 +13,7 @@ Page({
             label: "订单情况",
             model: "#orderForm"
         }],
-        tabsActive: 2,
+        tabsActive: 0,
     },
     onLoad(options) {
         this.partialRenewal();

+ 4 - 3
salesPanel/hospitalTarget/index.json

@@ -1,8 +1,9 @@
 {
     "usingComponents": {
-        "productTarget":"./productTarget/index",
-        "orderForm":"./orderForm/index",
-        "productType":"./productType/index"
+        "productTarget": "./productTarget/index",
+        "orderForm": "./orderForm/index",
+        "productType": "./productType/index",
+        "target": "./target/index"
     },
     "navigationBarTitleText": "医院目标"
 }

+ 2 - 0
salesPanel/hospitalTarget/index.wxml

@@ -1,5 +1,7 @@
+<view style="height: 10rpx;"></view>
 <Yl_FunTabs id='Yl_FunTabs' safety='{{false}}' list='{{tabsList}}' mode='buts' active='{{tabsActive}}' bind:onChenge="tabsChange">
     <productType slot='产品类别' id='productType' />
     <productTarget slot='产品目标' id='productTarget' />
     <orderForm slot='订单情况' id='orderForm' />
+    <target slot='医院' id='target' />
 </Yl_FunTabs>

+ 114 - 0
salesPanel/hospitalTarget/target/index.js

@@ -0,0 +1,114 @@
+const _Http = getApp().globalData.http,
+    currency = require("../../../utils/currency"),
+    CNY = (value, symbol = "¥", precision = 2) => currency(value, {
+        symbol,
+        precision
+    }).format();
+
+Component({
+    properties: {
+
+    },
+    options: {
+        addGlobalClass: true
+    },
+    lifetimes: {
+        attached: function () {}
+    },
+    data: {
+        content: {
+            year: new Date().getFullYear(),
+            sa_saleareaid: 0,
+            "type": 2, //1:人员,2:医院,3:经销商
+            "month_start": 1,
+            "month_end": 12,
+            "userid": wx.getStorageSync('userMsg').userid,
+            "sa_customersid": 0,
+            "sa_agentsid": 0,
+            where: {}
+        },
+        detail: {},
+        hospitalName: ""
+    },
+    methods: {
+        async getList(init = false) {
+            if (init) this.getData()
+        },
+        async getData() {
+            let content = this.data.content
+            _Http.basic({
+                "id": 2026010610085402,
+                content
+            }).then(res => {
+                console.log("目标", res)
+                if (res.code != 1) return wx.showToast({
+                    title: res.msg,
+                    icon: "none"
+                });
+                let item = res.data[0];
+                item.m_balanceamount = CNY(item.m_balanceamount)
+                item.m_saleamount = CNY(item.m_saleamount)
+                item.m_targetamount = CNY(item.m_targetamount)
+                this.setData({
+                    detail: item
+                })
+                console.log(this.data.detail)
+            })
+        },
+        changeDate({
+            detail
+        }) {
+            this.setData({
+                "content.year": detail.year,
+                "content.month_start": detail.startMonth,
+                "content.month_end": detail.endMonth,
+            })
+            this.getData()
+        },
+        toSelectHospital(e) {
+            let params = {
+                "content": {
+                    "pageNumber": 1,
+                    pageTotal: 1,
+                    "pageSize": 20,
+                    "where": {
+                        "condition": "",
+                        "sa_saleareaid": ""
+                    }
+                },
+                "id": 2026010516151802,
+            }
+            wx.navigateTo({
+                url: `/prsx/select/hospital/index?params=${JSON.stringify(params)}&radio=true`,
+            });
+            let that = this;
+            getApp().globalData.handleSelect = function ({
+                item
+            }) {
+                console.log(item)
+                wx.showModal({
+                    title: '提示',
+                    content: `是否确定选择“${item.enterprisename}”`,
+                    complete: (res) => {
+                        if (res.confirm) {
+                            that.setData({
+                                hospitalName: item.enterprisename,
+                                "content.sa_customersid": item.sa_customersid
+                            })
+                            that.getData()
+                            wx.navigateBack()
+                            delete getApp().globalData.handleSelect
+                        }
+                    }
+                })
+            }
+        },
+        clearCallBack(e) {
+            this.setData({
+                hospitalName:'',
+                "content.sa_customersid": 0
+            })
+            this.getData()
+        }
+    }
+})

+ 6 - 0
salesPanel/hospitalTarget/target/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "headOptionBox": "../../headOptionBox/index"
+    }
+}

+ 126 - 0
salesPanel/hospitalTarget/target/index.scss

@@ -0,0 +1,126 @@
+page {
+    width: 100vw;
+    overflow: hidden;
+}
+
+.head {
+    display: flex;
+    margin-bottom: 30rpx;
+
+    .item {
+        font-weight: bold;
+    }
+}
+
+.chart {
+    margin: 0 auto;
+    width: 280rpx;
+    flex-shrink: 0;
+    margin-bottom: 20rpx;
+
+    .circle {
+        width: 280rpx;
+        height: 280rpx;
+        position: relative;
+        border-radius: 50%;
+        box-shadow: inset 0 0 0 20rpx var(--assist);
+
+        .ab {
+            position: absolute;
+            left: 0;
+            right: 0;
+            top: 0;
+            bottom: 0;
+            margin: auto;
+        }
+
+        &_left {
+            border: 20rpx solid #EBEEF5;
+            border-radius: 50%;
+            clip: rect(0, 140rpx, 280rpx, 0);
+        }
+
+        &_right {
+            border: 20rpx solid #EBEEF5;
+            border-radius: 50%;
+            clip: rect(0, 280rpx, 280rpx, 140rpx);
+        }
+
+        &_text {
+            height: 100%;
+            display: flex;
+            flex-direction: column;
+            justify-content: center;
+            align-items: center;
+            font-size: 32rpx;
+
+            .value {
+                font-family: Microsoft YaHei, Microsoft YaHei;
+                font-weight: bold;
+                font-size: 32rpx;
+                color: #333333;
+                margin-top: 12rpx;
+            }
+
+            .name {
+                font-family: Microsoft YaHei, Microsoft YaHei;
+                color: #999999;
+                margin-top: 16rpx;
+            }
+        }
+    }
+}
+
+.card {
+    width: 100%;
+    border-radius: 20rpx;
+    border: 1rpx solid #E0E0E0;
+    padding: 20rpx 40rpx;
+    margin-top: 20rpx;
+
+    .title {
+        line-height: 32rpx;
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-size: 24rpx;
+        color: #999999;
+    }
+
+    .price {
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-size: 24rpx;
+        color: #3685FC;
+        margin-top: 10rpx;
+
+        text {
+            font-size: 40rpx;
+            margin-right: 6rpx;
+        }
+    }
+
+    .row {
+        line-height: 32rpx;
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-size: 24rpx;
+        color: #999999;
+        margin-top: 6rpx;
+
+        .increase,
+        .decrease {
+            display: inline-block;
+            width: 0;
+            height: 0;
+            border-left: 8rpx solid transparent;
+            border-right: 8rpx solid transparent;
+            margin-left: 10rpx;
+        }
+
+        .increase {
+            border-bottom: 14rpx solid #009966;
+        }
+
+        .decrease {
+            border-top: 14rpx solid #EF0606;
+        }
+    }
+
+}

+ 62 - 0
salesPanel/hospitalTarget/target/index.wxml

@@ -0,0 +1,62 @@
+<view style="height: 10rpx;"></view>
+<headOptionBox iconName='icon-bumen' title='医院' showText='{{hospitalName}}' isClear bind:clearCallBack='clearCallBack' placeholder="选择医院" bind:tap="toSelectHospital" />
+<viewDate iconName='icon-shijian1' type='sameYear' fields='year' value='{{content.year}}' startMonth="{{content.month_start}}" endMonth="{{content.month_end}}" title='时间范围' bind:onChange='changeDate' />
+<view style="height: 20rpx;"></view>
+
+<view class="global-card" style="overflow: hidden;">
+	<view class="chart">
+		<view class="circle">
+			<view class="circle_left ab" style="{{render.leftRate(detail[ 'm_' +'rate_achieve'])}}" />
+			<view class="circle_right ab" style="{{render.rightRate(detail[ 'm_' +'rate_achieve'])}}" />
+			<view class="circle_text">
+				<text class="name">目标达成率</text>
+				<text class="value">{{detail[ 'm_' + 'rate_achieve' ]}}%</text>
+			</view>
+		</view>
+	</view>
+
+	<view class="card">
+		<view class="title">销售额</view>
+		<view class="price">
+			<text>{{detail[ 'm_' + 'saleamount' ]}}</text>
+		</view>
+		<view class="row">
+			同比:{{detail[ 'm_' + 'rate_yoy' ]}}%
+			<view wx:if="{{detail[ 'm_'  + 'rate_yoy'] != 0}}" class="{{detail[ 'm_' + 'rate_yoy']>=0?'increase':'decrease'}}" />
+		</view>
+		<view class="row">
+			环比:{{detail[ 'm_' + 'rate_mom' ]}}%
+			<view wx:if="{{detail[ 'm_' + 'rate_mom'] != 0}}" class="{{detail[ 'm_' + 'rate_mom']>=0?'increase':'decrease'}}" />
+		</view>
+	</view>
+
+	<view class="card">
+		<view class="title">任务量</view>
+		<view class="price">
+			<text>{{detail[ 'm_' + 'targetamount' ]}}</text>
+		</view>
+		<view class="row">
+			目标达成率:{{detail[ 'm_' + 'rate_achieve' ]}}%
+		</view>
+		<view class="row">
+			销售额与任务量差额:{{detail[ 'm_' + 'balanceamount' ]}}
+		</view>
+	</view>
+</view>
+
+<wxs module="render">
+	module.exports = {
+		rightRate: function (rate) {
+			if (rate - 0 < 50) {
+				return 'transform: rotate(' + 3.6 * (rate - 0) + 'deg);';
+			} else {
+				return 'transform: rotate(0);border-color: var(--assist);';
+			}
+		},
+		leftRate: function (rate) {
+			if (rate - 0 >= 50) {
+				return 'transform: rotate(' + 3.6 * (rate - 50) + 'deg);';
+			}
+		}
+	}
+</wxs>

+ 3 - 0
salesPanel/personTarget/index.js

@@ -3,6 +3,9 @@ Page({
         tabsList: [{
             label: "概况",
             model: "#GK"
+        }, {
+            label: "人员",
+            model: "#target"
         }, {
             label: "产品类别",
             model: "#productType"

+ 2 - 1
salesPanel/personTarget/index.json

@@ -1,7 +1,8 @@
 {
     "usingComponents": {
         "GK": "./GK/index",
-        "productType":"./productType/index"
+        "productType": "./productType/index",
+        "target": "./target/index"
     },
     "navigationBarTitleText": "人员目标"
 }

+ 2 - 0
salesPanel/personTarget/index.wxml

@@ -1,4 +1,6 @@
+<view style="height: 10rpx;" />
 <Yl_FunTabs id='Yl_FunTabs' safety='{{false}}' list='{{tabsList}}' mode='buts' active='{{tabsActive}}' bind:onChenge="tabsChange">
     <GK slot='概况' id='GK' />
+    <target slot='人员' id='target' />
     <productType slot='产品类别' id='productType' />
 </Yl_FunTabs>

+ 129 - 0
salesPanel/personTarget/target/index.js

@@ -0,0 +1,129 @@
+const _Http = getApp().globalData.http,
+    currency = require("../../../utils/currency"),
+    CNY = (value, symbol = "¥", precision = 2) => currency(value, {
+        symbol,
+        precision
+    }).format();
+
+Component({
+    properties: {
+
+    },
+    options: {
+        addGlobalClass: true
+    },
+    lifetimes: {
+        attached: function () {}
+    },
+    data: {
+        content: {
+            year: new Date().getFullYear(),
+            sa_saleareaid: 0,
+            "type": 1, //1:人员,2:医院,3:经销商
+            "month_start": 1,
+            "month_end": 12,
+            "userid": 0,
+            "sa_customersid": 0,
+            "sa_agentsid": 0,
+            where: {}
+        },
+        detail: {},
+        showFiltrate: false,
+        areaname: "",
+        userName: ""
+    },
+    methods: {
+        async getList(init = false) {
+            if (init) this.getData()
+        },
+        async getData() {
+            let content = this.data.content;
+            if (content.sa_saleareaid == 0) {
+                let organization = this.selectComponent("#organization");
+                await organization.initDepAndUser().then(res => {
+                    if (res.sa_saleareaid) {
+                        this.data.content.sa_saleareaid = res.sa_saleareaid
+                        this.setData({
+                            areaname: res.areaname
+                        })
+                    }
+                })
+            }
+            _Http.basic({
+                "id": 2026010610085402,
+                content
+            }).then(res => {
+                console.log("目标", res)
+                if (res.code != 1) return wx.showToast({
+                    title: res.msg,
+                    icon: "none"
+                });
+                let item = res.data[0];
+                item.m_balanceamount = CNY(item.m_balanceamount)
+                item.m_saleamount = CNY(item.m_saleamount)
+                item.m_targetamount = CNY(item.m_targetamount)
+                this.setData({
+                    detail: item
+                })
+                console.log(this.data.detail)
+            })
+        },
+        changeDate({
+            detail
+        }) {
+            this.setData({
+                "content.year": detail.year,
+                "content.month_start": detail.startMonth,
+                "content.month_end": detail.endMonth,
+            })
+            this.getData()
+        },
+        openFiltrate() {
+            this.setData({
+                showFiltrate: true
+            })
+        },
+        async handleFilter({
+            detail
+        }) {
+            let organization = this.selectComponent("#organization");
+
+            if (detail.name == "close") return;
+            if (detail.name == 'reset') {
+                organization.setData({
+                    isleave: "0"
+                })
+                await organization.initDepAndUser().then(res => {
+                    if (res.sa_saleareaid) {
+                        this.data.content.sa_saleareaid = res.sa_saleareaid
+                        this.data.content.userid = ''
+                        this.setData({
+                            areaname: res.areaname,
+                            userName: ""
+                        })
+                        this.getData()
+                    }
+                })
+            } else {
+                let res = organization.data.result;
+                if (res.userid) {
+                    let dep = organization.data.selectDepObj;
+                    this.data.content.sa_saleareaid = dep.sa_saleareaid;
+                    this.data.content.userid = res.userid;
+                    this.setData({
+                        areaname: dep.areaname,
+                        userName: res.name
+                    })
+                } else {
+                    this.data.content.sa_saleareaid = res.sa_saleareaid
+                    this.data.content.userid = 0
+                    this.setData({
+                        areaname: res.areaname,
+                        userName: ''
+                    })
+                }
+                this.getData()
+            }
+        },
+    }
+})

+ 6 - 0
salesPanel/personTarget/target/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "headOptionBox": "../../headOptionBox/index"
+    }
+}

+ 126 - 0
salesPanel/personTarget/target/index.scss

@@ -0,0 +1,126 @@
+page {
+    width: 100vw;
+    overflow: hidden;
+}
+
+.head {
+    display: flex;
+    margin-bottom: 30rpx;
+
+    .item {
+        font-weight: bold;
+    }
+}
+
+.chart {
+    margin: 0 auto;
+    width: 280rpx;
+    flex-shrink: 0;
+    margin-bottom: 20rpx;
+
+    .circle {
+        width: 280rpx;
+        height: 280rpx;
+        position: relative;
+        border-radius: 50%;
+        box-shadow: inset 0 0 0 20rpx var(--assist);
+
+        .ab {
+            position: absolute;
+            left: 0;
+            right: 0;
+            top: 0;
+            bottom: 0;
+            margin: auto;
+        }
+
+        &_left {
+            border: 20rpx solid #EBEEF5;
+            border-radius: 50%;
+            clip: rect(0, 140rpx, 280rpx, 0);
+        }
+
+        &_right {
+            border: 20rpx solid #EBEEF5;
+            border-radius: 50%;
+            clip: rect(0, 280rpx, 280rpx, 140rpx);
+        }
+
+        &_text {
+            height: 100%;
+            display: flex;
+            flex-direction: column;
+            justify-content: center;
+            align-items: center;
+            font-size: 32rpx;
+
+            .value {
+                font-family: Microsoft YaHei, Microsoft YaHei;
+                font-weight: bold;
+                font-size: 32rpx;
+                color: #333333;
+                margin-top: 12rpx;
+            }
+
+            .name {
+                font-family: Microsoft YaHei, Microsoft YaHei;
+                color: #999999;
+                margin-top: 16rpx;
+            }
+        }
+    }
+}
+
+.card {
+    width: 100%;
+    border-radius: 20rpx;
+    border: 1rpx solid #E0E0E0;
+    padding: 20rpx 40rpx;
+    margin-top: 20rpx;
+
+    .title {
+        line-height: 32rpx;
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-size: 24rpx;
+        color: #999999;
+    }
+
+    .price {
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-size: 24rpx;
+        color: #3685FC;
+        margin-top: 10rpx;
+
+        text {
+            font-size: 40rpx;
+            margin-right: 6rpx;
+        }
+    }
+
+    .row {
+        line-height: 32rpx;
+        font-family: Microsoft YaHei, Microsoft YaHei;
+        font-size: 24rpx;
+        color: #999999;
+        margin-top: 6rpx;
+
+        .increase,
+        .decrease {
+            display: inline-block;
+            width: 0;
+            height: 0;
+            border-left: 8rpx solid transparent;
+            border-right: 8rpx solid transparent;
+            margin-left: 10rpx;
+        }
+
+        .increase {
+            border-bottom: 14rpx solid #009966;
+        }
+
+        .decrease {
+            border-top: 14rpx solid #EF0606;
+        }
+    }
+
+}

+ 69 - 0
salesPanel/personTarget/target/index.wxml

@@ -0,0 +1,69 @@
+<view style="height: 10rpx;"></view>
+<view bind:tap="openFiltrate">
+	<headOptionBox iconName='icon-bumen' title='营销区域' showText="{{areaname}}" placeholder='请选择营销区域' />
+	<headOptionBox iconName='icon-a-biaoqianlanwode' showText="{{userName}}" title='业务员' placeholder='请选择业务员' />
+</view>
+<viewDate iconName='icon-shijian1' type='sameYear' fields='year' value='{{content.year}}' startMonth="{{content.month_start}}" endMonth="{{content.month_end}}" title='时间范围' bind:onChange='changeDate' />
+<view style="height: 20rpx;"></view>
+
+<Yl_Filtrate1 id="Yl_Filtrate1" show='{{showFiltrate}}' list="{{[]}}" bindhandle="handleFilter">
+	<organization slot='head' defaultIsleave='0' dimissionF id='organization' />
+</Yl_Filtrate1>
+
+<view class="global-card" style="overflow: hidden;">
+	<view class="chart">
+		<view class="circle">
+			<view class="circle_left ab" style="{{render.leftRate(detail[ 'm_' +'rate_achieve'])}}" />
+			<view class="circle_right ab" style="{{render.rightRate(detail[ 'm_' +'rate_achieve'])}}" />
+			<view class="circle_text">
+				<text class="name">目标达成率</text>
+				<text class="value">{{detail[ 'm_' + 'rate_achieve' ]}}%</text>
+			</view>
+		</view>
+	</view>
+
+	<view class="card">
+		<view class="title">销售额</view>
+		<view class="price">
+			<text>{{detail[ 'm_' + 'saleamount' ]}}</text>
+		</view>
+		<view class="row">
+			同比:{{detail[ 'm_' + 'rate_yoy' ]}}%
+			<view wx:if="{{detail[ 'm_'  + 'rate_yoy'] != 0}}" class="{{detail[ 'm_' + 'rate_yoy']>=0?'increase':'decrease'}}" />
+		</view>
+		<view class="row">
+			环比:{{detail[ 'm_' + 'rate_mom' ]}}%
+			<view wx:if="{{detail[ 'm_' + 'rate_mom'] != 0}}" class="{{detail[ 'm_' + 'rate_mom']>=0?'increase':'decrease'}}" />
+		</view>
+	</view>
+
+	<view class="card">
+		<view class="title">任务量</view>
+		<view class="price">
+			<text>{{detail[ 'm_' + 'targetamount' ]}}</text>
+		</view>
+		<view class="row">
+			目标达成率:{{detail[ 'm_' + 'rate_achieve' ]}}%
+		</view>
+		<view class="row">
+			销售额与任务量差额:{{detail[ 'm_' + 'balanceamount' ]}}
+		</view>
+	</view>
+</view>
+
+<wxs module="render">
+	module.exports = {
+		rightRate: function (rate) {
+			if (rate - 0 < 50) {
+				return 'transform: rotate(' + 3.6 * (rate - 0) + 'deg);';
+			} else {
+				return 'transform: rotate(0);border-color: var(--assist);';
+			}
+		},
+		leftRate: function (rate) {
+			if (rate - 0 >= 50) {
+				return 'transform: rotate(' + 3.6 * (rate - 50) + 'deg);';
+			}
+		}
+	}
+</wxs>