xiaohaizhao 2 роки тому
батько
коміт
8965c94437

+ 108 - 104
app.json

@@ -29,109 +29,112 @@
         "pages/tabbar/mine/webView",
         "pages/tabbar/mine/webView",
         "pages/tabbar/mine/associatedPublicNumber"
         "pages/tabbar/mine/associatedPublicNumber"
     ],
     ],
-    "subpackages": [{
-        "root": "packageA",
-        "pages": [
-            "contacts/index",
-            "contacts/list",
-            "contacts/details",
-            "contacts/edit",
-            "forecast/index",
-            "forecast/detail",
-            "forecast/record",
-            "forecast/reportForms",
-            "target/index",
-            "target/person",
-            "target/project",
-            "target/addProject",
-            "setclient/index",
-            "setclient/detail",
-            "setclient/addAndEditor",
-            "setclient/modules/address/add/index",
-            "setclient/modules/contacts/add/index",
-            "project/index",
-            "setclient/modules/trace/add/index",
-            "setclient/modules/trace/list/delete",
-            "setclient/modules/financing/add/index",
-            "setclient/modules/contacts/detail/index",
-            "setclient/modules/financing/detail/index",
-            "setclient/modules/trace/detail/index",
-            "setclient/delete",
-            "setclient/modules/contacts/quickly/index",
-            "setclient/modules/address/search/index",
-            "setclient/modules/contacts/search/index",
-            "setclient/modules/financing/search/index",
-            "options/index",
-            "project/addAndEdit",
-            "project/detail",
-            "project/modules/task/add",
-            "project/modules/treaty/add/index",
-            "project/modules/contacts/search/index",
-            "project/delete",
-            "offers/index",
-            "offers/addProjectOffer",
-            "offers/addSetclientOffer",
-            "select/setclient/select",
-            "select/project/select",
-            "select/contacts/select",
-            "offers/detail",
-            "select/product/select",
-            "contract/index",
-            "contract/detail",
-            "contract/add/type1/index",
-            "contract/add/type2/index",
-            "contract/add/type3/index",
-            "contract/add/type4/index",
-            "contract/add/type5/index",
-            "contract/modules/discount/type/add/index",
-            "activity/index",
-            "activity/detail",
-            "activity/addActivity",
-            "activity/modules/clue/addClue",
-            "contract/modules/discount/product/index",
-            "publicClue/index",
-            "publicClue/detail",
-            "publicClue/addClue",
-            "publicClue/distribution",
-            "saleClue/index",
-            "saleClue/addClue",
-            "saleClue/detail",
-            "saleClue/change",
-            "opponent/index",
-            "opponent/detail",
-            "opponent/add",
-            "publicCustomer/index",
-            "publicCustomer/detail",
-            "publicCustomer/addAndEditor",
-            "publicCustomer/pond/index",
-            "saleClue/addFollow",
-            "project/modules/task/history",
-            "salesForecasting/index",
-            "salesForecasting/detail",
-            "work/index",
-            "work/add",
-            "work/detail",
-            "select/selectActivity/index",
-            "select/contract/select",
-            "saleClue/translate",
-            "project/modules/contacts/quickly/index",
-            "project/modules/contacts/add/index",
-            "project/modules/contacts/select/index",
-            "select/offers/select",
-            "contract/modules/objective/add",
-            "clockIn/index",
-            "clockIn/signIn",
-            "contract/modules/objective/setUp",
-            "offers/modules/pettyExpense/update",
-            "select/brand/select",
-            "select/paytype/select",
-            "contract/add/setclient/select",
-            "setclient/modules/bankcard/update",
-            "report/index",
-            "report/insert",
-            "report/detail"
-        ]
-    }],
+    "subpackages": [
+        {
+            "root": "packageA",
+            "pages": [
+                "contacts/index",
+                "contacts/list",
+                "contacts/details",
+                "contacts/edit",
+                "forecast/index",
+                "forecast/detail",
+                "forecast/record",
+                "forecast/reportForms",
+                "target/index",
+                "target/person",
+                "target/project",
+                "target/addProject",
+                "setclient/index",
+                "setclient/detail",
+                "setclient/addAndEditor",
+                "setclient/modules/address/add/index",
+                "setclient/modules/contacts/add/index",
+                "project/index",
+                "setclient/modules/trace/add/index",
+                "setclient/modules/trace/list/delete",
+                "setclient/modules/financing/add/index",
+                "setclient/modules/contacts/detail/index",
+                "setclient/modules/financing/detail/index",
+                "setclient/modules/trace/detail/index",
+                "setclient/delete",
+                "setclient/modules/contacts/quickly/index",
+                "setclient/modules/address/search/index",
+                "setclient/modules/contacts/search/index",
+                "setclient/modules/financing/search/index",
+                "options/index",
+                "project/addAndEdit",
+                "project/detail",
+                "project/modules/task/add",
+                "project/modules/treaty/add/index",
+                "project/modules/contacts/search/index",
+                "project/delete",
+                "offers/index",
+                "offers/addProjectOffer",
+                "offers/addSetclientOffer",
+                "select/setclient/select",
+                "select/project/select",
+                "select/contacts/select",
+                "offers/detail",
+                "select/product/select",
+                "contract/index",
+                "contract/detail",
+                "contract/add/type1/index",
+                "contract/add/type2/index",
+                "contract/add/type3/index",
+                "contract/add/type4/index",
+                "contract/add/type5/index",
+                "contract/modules/discount/type/add/index",
+                "activity/index",
+                "activity/detail",
+                "activity/addActivity",
+                "activity/modules/clue/addClue",
+                "contract/modules/discount/product/index",
+                "publicClue/index",
+                "publicClue/detail",
+                "publicClue/addClue",
+                "publicClue/distribution",
+                "saleClue/index",
+                "saleClue/addClue",
+                "saleClue/detail",
+                "saleClue/change",
+                "opponent/index",
+                "opponent/detail",
+                "opponent/add",
+                "publicCustomer/index",
+                "publicCustomer/detail",
+                "publicCustomer/addAndEditor",
+                "publicCustomer/pond/index",
+                "saleClue/addFollow",
+                "project/modules/task/history",
+                "salesForecasting/index",
+                "salesForecasting/detail",
+                "work/index",
+                "work/add",
+                "work/detail",
+                "select/selectActivity/index",
+                "select/contract/select",
+                "saleClue/translate",
+                "project/modules/contacts/quickly/index",
+                "project/modules/contacts/add/index",
+                "project/modules/contacts/select/index",
+                "select/offers/select",
+                "contract/modules/objective/add",
+                "clockIn/index",
+                "clockIn/signIn",
+                "contract/modules/objective/setUp",
+                "offers/modules/pettyExpense/update",
+                "select/brand/select",
+                "select/paytype/select",
+                "contract/add/setclient/select",
+                "setclient/modules/bankcard/update",
+                "report/index",
+                "report/insert",
+                "report/detail",
+                "achievement/index"
+            ]
+        }
+    ],
     "preloadRule": {
     "preloadRule": {
         "pages/login/phone": {
         "pages/login/phone": {
             "packages": [
             "packages": [
@@ -182,7 +185,8 @@
         "color": "#000000",
         "color": "#000000",
         "selectedColor": "#000000",
         "selectedColor": "#000000",
         "backgroundColor": "#000000",
         "backgroundColor": "#000000",
-        "list": [{
+        "list": [
+            {
                 "pagePath": "pages/tabbar/home/index"
                 "pagePath": "pages/tabbar/home/index"
             },
             },
             {
             {

+ 299 - 0
packageA/achievement/index.js

@@ -0,0 +1,299 @@
+const _Http = getApp().globalData.http,
+    currency = require("../../utils/currency"),
+    CNY = (value, symbol = "", precision = 2) => currency(value, {
+        symbol,
+        precision
+    }).format();
+Page({
+    data: {
+        dropdownItem: 4,
+        dropdown: [{
+                text: '作业看板',
+                value: 0
+            },
+            {
+                text: '线索',
+                value: 1
+            },
+            {
+                text: '客户',
+                value: 2
+            },
+            {
+                text: '项目商机',
+                value: 3
+            },
+            {
+                text: '作业单据',
+                value: 4
+            }
+        ],
+        filtratelist: [],
+        showFiltrate: false
+    },
+    onLoad(options) {
+        _Http.basic({
+            "id": 20230620102004,
+            "content": {}
+        }).then(res => {
+            console.log("获取下级部门和下级人员", res)
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            })
+            let data = {
+                label: "查询范围",
+                index: 0,
+                showName: "name", //显示字段
+                valueKey: "active", //返回Key
+                value: "id", //选中值
+                list: res.data.hr.map(v => {
+                    v.id = v.userid;
+                    // v.key = v.name + v.userid;
+                    v.type = '人员'
+                    delete(v.rowindex)
+                    delete(v.userid)
+                    return v
+                })
+            };
+            const mflat = (v, prefix) => {
+                v.subdep.forEach(s => mflat(s, v.depname));
+                v.name = v.depname; //prefix ? prefix + '/' + v.depname : v.depname
+                v.type = '部门';
+                v.id = v.departmentid;
+                // v.key = v.name + v.id;
+                delete(v.depname)
+                delete(v.departmentid)
+                delete(v.parentid)
+                delete(v.rowindex)
+                delete(v.subdep)
+                data.list.unshift(v)
+            };
+            res.data.dep.forEach(v => mflat(v))
+            data.list.map((v, i) => {
+                v.index = i;
+                if (v.type == '人员' && v.id == wx.getStorageSync('userMsg').userid) data.index = i;
+                return v
+            })
+            this.setData({
+                "filtratelist[0]": data,
+                active: data.list[data.index]
+            });
+            this.refreshModel();
+        });
+        this.refreshData();
+    },
+    openFiltrate() {
+        this.setData({
+            showFiltrate: true
+        })
+    },
+    handleFilter(e) {
+        let {
+            active
+        } = e.detail;
+        this.setData({
+            active
+        });
+        this.refreshData(active.type == '人员' ? 0 : 1, active.id);
+        this.refreshModel();
+    },
+    refreshData(type = 0, dataid = wx.getStorageSync('userMsg').userid) {
+        const conversion = (n) => {
+            const integer = (n + '').split(".")[0] + '',
+                length = integer.length,
+                regexp = /(?:\.0*|(\.\d+?)0+)$/
+            if (length <= 4) {
+                const index = 4 - length;
+                return { //元
+                    show: CNY(n, "", index).replace(regexp, '$1'),
+                    value: CNY(n, '¥')
+                }
+            } else if (length <= 8) {
+                return { //万-千万
+                    show: CNY(currency(n).divide(10000)).replace(regexp, '$1') + '万',
+                    value: CNY(n)
+                }
+            } else {
+                return { //亿
+                    show: CNY(currency(n).divide(100000000)).replace(regexp, '$1') + '亿',
+                    value: CNY(n)
+                }
+            }
+        };
+        const sortOut = (obj, data, isConversion = false) => {
+            for (const key in obj) {
+                if (key == 'tab') continue;
+                for (const k in obj[key]) {
+                    obj[key][k] = isConversion ? conversion(data[key + k]) : data[key + k]
+                }
+            }
+            return obj
+        };
+        const getData = (dataType) => {
+            return _Http.basic({
+                "id": 20230616131404,
+                "content": {
+                    nocache: true,
+                    dataType, // 1 作业数据 2 销售数据 3业绩数据
+                    type,
+                    dataid
+                }
+            }).then(res => {
+                let data = {};
+                switch (dataType) {
+                    case 1:
+                        data = {
+                            tab: {
+                                active: "bz",
+                                list: [{
+                                    name: "本周",
+                                    id: "bz"
+                                }, {
+                                    name: "本月",
+                                    id: "by"
+                                }, {
+                                    name: "本年",
+                                    id: "bn"
+                                }]
+                            },
+                            bz: {
+                                khgj: 0,
+                                khxz: 0,
+                                xmgj: 0,
+                                xmxz: 0
+                            },
+                            by: {
+                                khgj: 0,
+                                khxz: 0,
+                                xmgj: 0,
+                                xmxz: 0
+                            },
+                            bn: {
+                                khgj: 0,
+                                khxz: 0,
+                                xmgj: 0,
+                                xmxz: 0
+                            }
+                        }
+                        break;
+                    case 2:
+                        data = {
+                            tab: {
+                                active: "bz",
+                                list: [{
+                                    name: "本周",
+                                    id: "bz"
+                                }, {
+                                    name: "本月",
+                                    id: "by"
+                                }, {
+                                    name: "本年",
+                                    id: "bn"
+                                }]
+                            },
+                            bz: {
+                                chje: 0,
+                                kpje: 0,
+                                skje: 0,
+                                xsje: 0
+                            },
+                            by: {
+                                chje: 0,
+                                kpje: 0,
+                                skje: 0,
+                                xsje: 0
+                            },
+                            bn: {
+                                chje: 0,
+                                kpje: 0,
+                                skje: 0,
+                                xsje: 0
+                            }
+                        }
+                        break;
+                    default:
+                        data = res.data
+                        data.tab = {
+                            active: "by",
+                            list: [{
+                                name: "本月",
+                                id: "by"
+                            }, {
+                                name: "本季",
+                                id: "bj"
+                            }, {
+                                name: "本年",
+                                id: "bn"
+                            }]
+                        }
+                        break;
+                }
+                return dataType == 3 ? data : sortOut(data, res.data, dataType == 2)
+            })
+        };
+        getData(1).then(res => {
+            this.setData({
+                zysj: res
+            })
+        });
+        getData(2).then(res => {
+            this.setData({
+                xssj: res
+            })
+        });
+        getData(3).then(res => {
+            for (const key in res) {
+                if (key == 'tab') continue;
+                res[key].target_l = conversion(res[key].target_l);
+                //实际
+                res[key].amount = conversion(res[key].amount);
+                res[key].outamount = conversion(res[key].outamount);
+                res[key].invoiceamount = conversion(res[key].invoiceamount);
+                //差额
+                res[key].unamount = CNY(res[key].unamount, '¥');
+                res[key].unamountcolor = res[key].unamount >= 0 ? '#5AB73F' : '#EB4B5C';
+                res[key].unoutamount = CNY(res[key].unoutamount, '¥');
+                res[key].unoutamountcolor = res[key].unoutamount >= 0 ? '#5AB73F' : '#EB4B5C';
+                res[key].uninvoiceamount = CNY(res[key].uninvoiceamount, '¥');
+                res[key].uninvoiceamountcolor = res[key].uninvoiceamount >= 0 ? '#5AB73F' : '#EB4B5C';
+                //达成率
+                res[key].wcamount = currency(res[key].wcamount).multiply(100) + '%';
+                res[key].wcoutamount = currency(res[key].wcoutamount).multiply(100) + '%';
+                res[key].wcinvoiceamount = currency(res[key].wcinvoiceamount).multiply(100) + '%';
+            }
+            this.setData({
+                yjsj: res
+            })
+        });
+    },
+    dropdownItemChange({
+        detail
+    }) {
+        this.setData({
+            dropdownItem: detail
+        })
+        this.refreshModel();
+    },
+    changeId(e) {
+        const {
+            id,
+            name
+        } = e.currentTarget.dataset;
+        if (this.data[name].tab.active == id) return;
+        this.setData({
+            [`${name}.tab.active`]: id
+        })
+    },
+    refreshModel() {
+        const dropdownItem = this.data.dropdownItem;
+        if (dropdownItem == 0) return;
+        const model = this.selectComponent("#model" + dropdownItem);
+        if (!model) return;
+        const active = this.data.active;
+        model.init(active.type == '人员' ? '0' : '1', active.id);
+    },
+    onReady(){
+        this.selectComponent("#ListBox").setHeight(".head", this);
+    }
+})

+ 11 - 0
packageA/achievement/index.json

@@ -0,0 +1,11 @@
+{
+    "usingComponents": {
+        "van-dropdown-menu": "@vant/weapp/dropdown-menu/index",
+        "van-dropdown-item": "@vant/weapp/dropdown-item/index",
+        "clue": "./modules/clue",
+        "client": "./modules/client",
+        "project": "./modules/project",
+        "bills": "./modules/bills"
+    },
+    "navigationBarTitleText": "作业看板"
+}

+ 154 - 0
packageA/achievement/index.scss

@@ -0,0 +1,154 @@
+page {
+    height: 100vh;
+    width: 100vw;
+    overflow: hidden;
+}
+
+.box {
+    width: 100vw;
+    padding: 20rpx 30rpx;
+    box-sizing: border-box;
+    background-color: #fff;
+    margin-top: 20rpx;
+
+    .top {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        width: 100%;
+        height: 60rpx;
+
+        .title {
+            font-size: 28rpx;
+            font-weight: bold;
+            color: #333333;
+        }
+
+        .tabs-box {
+            display: flex;
+            align-items: center;
+            height: 60rpx;
+            background: #F5F5F5;
+            border-radius: 30rpx;
+            padding: 4rpx;
+            background-color: #F5F5F5;
+            box-sizing: content-box;
+
+            .item {
+                font-size: 24rpx;
+                font-family: PingFang SC-Regular, PingFang SC;
+                color: #FFFFFF;
+                height: 52rpx;
+                line-height: 52rpx;
+                padding: 0 16rpx;
+                background-color: #F5F5F5;
+                color: #999999;
+                border-radius: 26rpx;
+                box-sizing: border-box;
+            }
+
+            .active {
+                background-color: #3874F6;
+                color: #FFFFFF;
+                transition: color 0.3s;
+            }
+        }
+    }
+
+    .spectaculars {
+        display: flex;
+        width: 690rpx;
+        background: #F6F6F6;
+        border-radius: 8rpx;
+        padding: 20rpx;
+        box-sizing: border-box;
+        margin-top: 20rpx;
+
+        .item {
+            width: 25%;
+            text-align: center;
+
+            .label {
+                height: 34rpx;
+                line-height: 34rpx;
+                font-size: 24rpx;
+                color: rgba(23, 26, 29, 0.6);
+            }
+
+            .value {
+                height: 42rpx;
+                font-size: 30rpx;
+                line-height: 42rpx;
+                font-family: PingFangSC-Semibold-, PingFangSC-Semibold;
+                color: #171A1D;
+                margin-top: 10rpx;
+                font-weight: 700;
+            }
+        }
+    }
+
+    .performance {
+        width: 690rpx;
+        background: #F6F6F6;
+        border-radius: 8rpx;
+        padding: 20rpx;
+        box-sizing: border-box;
+        margin-top: 20rpx;
+
+        .title {
+            margin-right: 40rpx;
+            font-size: 30rpx;
+            font-family: PingFangSC-Semibold-, PingFangSC-Semibold;
+            color: #171A1D;
+            font-weight: 700;
+            line-height: 42rpx;
+
+            text {
+                margin-left: 40rpx;
+                font-size: 24rpx;
+                font-family: PingFang SC-Regular, PingFang SC;
+                font-weight: 400;
+            }
+        }
+
+        .row {
+            margin-top: 20rpx;
+            display: flex;
+
+            .item {
+                flex: 1;
+
+                .title {
+                    font-size: 24rpx;
+                    font-family: PingFangSC-Regular-, PingFangSC-Regular;
+                    font-weight: normal;
+                    color: rgba(23, 26, 29, 0.6);
+                    line-height: 34rpx;
+                }
+
+                .value {
+                    height: 42rpx;
+                    line-height: 42rpx;
+                    font-size: 30rpx;
+                    font-weight: 700;
+                    font-family: PingFang SC-Regular, PingFang SC;
+                    color: #171A1D;
+                    margin-top: 10rpx;
+                }
+            }
+        }
+    }
+}
+
+.filtrate {
+    display: flex;
+    height: 100%;
+    align-items: center;
+    justify-content: flex-end;
+    color: var(--dropdown-menu-title-text-color, #323233);
+    font-size: var(--dropdown-menu-title-font-size, 15px);
+    line-height: var(--dropdown-menu-title-line-height, 18px);
+    max-width: 100%;
+    padding-right: 30rpx;
+    width: 72%;
+}

+ 150 - 0
packageA/achievement/index.wxml

@@ -0,0 +1,150 @@
+<van-dropdown-menu active-color="#3874F6">
+    <van-dropdown-item value="{{ dropdownItem }}" options="{{ dropdown }}" bindchange='dropdownItemChange' />
+    <view class="filtrate" url="#" bindtap="openFiltrate">
+        <text style="margin-right: 6rpx;">{{active.name}}-{{active.type}}</text>
+        <van-icon name="arrow-down" />
+    </view>
+</van-dropdown-menu>
+<view class="head" />
+<view hidden="{{dropdownItem!=0}}">
+    <Yl_ListBox pullDown='{{false}}' id='ListBox'>
+        <view class="box">
+            <view class="top">
+                <view class="title">
+                    作业数据
+                </view>
+                <view class="tabs-box">
+                    <view class="item {{zysj.tab.active==item.id?'active':''}}" wx:for="{{zysj.tab.list}}" wx:key="id" data-name="zysj" data-id="{{item.id}}" catchtap='changeId'>{{item.name}}</view>
+                </view>
+            </view>
+            <view class="spectaculars">
+                <view class="item">
+                    <view class="label">新增客户数</view>
+                    <view class="value">{{zysj[zysj.tab.active].khxz}}</view>
+                </view>
+                <view class="item">
+                    <view class="label">客户跟进次数</view>
+                    <view class="value">{{zysj[zysj.tab.active].khgj}}</view>
+                </view>
+                <view class="item">
+                    <view class="label">新增项目数</view>
+                    <view class="value">{{zysj[zysj.tab.active].xmxz}}</view>
+                </view>
+                <view class="item">
+                    <view class="label">项目跟进次数</view>
+                    <view class="value">{{zysj[zysj.tab.active].xmgj}}</view>
+                </view>
+            </view>
+        </view>
+        <view class="box">
+            <view class="top">
+                <view class="title">
+                    销售数据
+                </view>
+                <view class="tabs-box">
+                    <view class="item {{xssj.tab.active==item.id?'active':''}}" wx:for="{{xssj.tab.list}}" wx:key="id" data-name="xssj" data-id="{{item.id}}" catchtap='changeId'>{{item.name}}</view>
+                </view>
+            </view>
+            <view class="spectaculars">
+                <view class="item">
+                    <view class="label">销售金额</view>
+                    <view class="value">{{xssj[xssj.tab.active].xsje.show}}</view>
+                </view>
+                <view class="item">
+                    <view class="label">出货金额</view>
+                    <view class="value">{{xssj[xssj.tab.active].chje.show}}</view>
+                </view>
+                <view class="item">
+                    <view class="label">收款金额</view>
+                    <view class="value">{{xssj[xssj.tab.active].skje.show}}</view>
+                </view>
+                <view class="item">
+                    <view class="label">开票金额</view>
+                    <view class="value">{{xssj[xssj.tab.active].kpje.show}}</view>
+                </view>
+            </view>
+        </view>
+        <view class="box">
+            <view class="top">
+                <view class="title">
+                    业绩数据
+                </view>
+                <view class="tabs-box">
+                    <view class="item {{yjsj.tab.active==item.id?'active':''}}" wx:for="{{yjsj.tab.list}}" wx:key="id" data-name="yjsj" data-id="{{item.id}}" catchtap='changeId'>{{item.name}}</view>
+                </view>
+            </view>
+
+            <view class="performance">
+                <view class="title">订单 <text style="color: {{yjsj[yjsj.tab.active].unamountcolor}};">{{yjsj[yjsj.tab.active].unamount.value}}</text></view>
+                <view class="row">
+                    <view class="item">
+                        <view class="title">目标达成</view>
+                        <view class="value">{{yjsj[yjsj.tab.active].wcamount}}</view>
+                    </view>
+                    <view class="item">
+                        <view class="title">实际金额</view>
+                        <view class="value">{{yjsj[yjsj.tab.active].amount.show}}</view>
+                    </view>
+                    <view class="item">
+                        <view class="title">目标金额</view>
+                        <view class="value">{{yjsj[yjsj.tab.active].target_l.show}}</view>
+                    </view>
+                </view>
+            </view>
+
+            <view class="performance">
+                <view class="title">出货 <text style="color: {{yjsj[yjsj.tab.active].unoutamountcolor}};">{{yjsj[yjsj.tab.active].unoutamount.value}}</text></view>
+                <view class="row">
+                    <view class="item">
+                        <view class="title">目标达成</view>
+                        <view class="value">{{yjsj[yjsj.tab.active].wcoutamount}}</view>
+                    </view>
+                    <view class="item">
+                        <view class="title">实际金额</view>
+                        <view class="value">{{yjsj[yjsj.tab.active].outamount.show}}</view>
+                    </view>
+                    <view class="item">
+                        <view class="title">目标金额</view>
+                        <view class="value">{{yjsj[yjsj.tab.active].target_l.show}}</view>
+                    </view>
+                </view>
+            </view>
+
+            <view class="performance">
+                <view class="title">开票 <text style="color: {{yjsj[yjsj.tab.active].uninvoiceamountcolor}};">{{yjsj[yjsj.tab.active].uninvoiceamount.value}}</text></view>
+                <view class="row">
+                    <view class="item">
+                        <view class="title">目标达成</view>
+                        <view class="value">{{yjsj[yjsj.tab.active].wcinvoiceamount}}</view>
+                    </view>
+                    <view class="item">
+                        <view class="title">实际金额</view>
+                        <view class="value">{{yjsj[yjsj.tab.active].invoiceamount.show}}</view>
+                    </view>
+                    <view class="item">
+                        <view class="title">目标金额</view>
+                        <view class="value">{{yjsj[yjsj.tab.active].target_l.show}}</view>
+                    </view>
+                </view>
+            </view>
+
+        </view>
+    </Yl_ListBox>
+</view>
+
+<view hidden="{{dropdownItem!=1}}">
+    <clue id='model1' />
+</view>
+
+<view hidden="{{dropdownItem!=2}}">
+    <client id='model2' />
+</view>
+
+<view hidden="{{dropdownItem!=3}}">
+    <project id='model3' />
+</view>
+
+<view hidden="{{dropdownItem!=4}}">
+    <bills id='model4' />
+</view>
+<Yl_Filtrate1 show='{{showFiltrate}}' isReset='{{false}}' list="{{filtratelist}}" bindhandle="handleFilter" />

+ 118 - 0
packageA/achievement/modules/bills.js

@@ -0,0 +1,118 @@
+const _Http = getApp().globalData.http;
+Component({
+    options: {
+        addGlobalClass: true
+    },
+    data: {
+        content: {
+            nocache: true,
+            type: 0,
+            dataid: 0,
+            pageNumber: 1,
+            pageSize: 20,
+            dataType: "10",
+            dateType: '周',
+            where: {
+                dateType: '周',
+                begindate: "",
+                enddate: ""
+            }
+        },
+        showFiltrete: false,
+        filtratelist: [{
+            label: "时间筛选",
+            index: 1,
+            showName: "name", //显示字段
+            valueKey: "dateType", //返回Key
+            value: "value", //选中值
+            selectKey: "value",
+            list: [{
+                name: "本日",
+                value: "日"
+            }, {
+                name: "本周",
+                value: "周"
+            }, {
+                name: "本月",
+                value: "月"
+            }, {
+                name: "本年",
+                value: "年"
+            }]
+        }]
+    },
+    methods: {
+        handleFilter({
+            detail
+        }) {
+            this.setData({
+                "content.dateType": detail.dateType,
+                "content.where.dateType": detail.dateType,
+                "content.where.begindate": detail.startdate,
+                "content.where.enddate": detail.enddate,
+            });
+            this.getList(true);
+        },
+        init(type, dataid) {
+            console.log(this.data.filtratelist)
+            if (this.data.content.dataid != dataid) {
+                this.setData({
+                    'content.dataid': dataid,
+                    'content.type': type,
+                    list: []
+                });
+                this.getList(true);
+            }
+        },
+        getList(init = false) {
+            if (init.detail != undefined) init = init.detail;
+            let content = this.data.content;
+            if (init) {
+                content.pageNumber = 1;
+                content.pageTotal = 1;
+            }
+            if (content.pageNumber > content.pageTotal) return;
+            _Http.basic({
+                "id": 20230617143104,
+                content
+            }).then(res => {
+                console.log(content.dataType + "项目", res)
+                this.selectComponent("#ListBox").setHeight(".head", this);
+                this.selectComponent('#ListBox').RefreshToComplete();
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.msg,
+                    icon: "none"
+                });
+                content.pageNumber = res.pageNumber + 1;
+                content.pageTotal = res.pageTotal;
+                this.setData({
+                    list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+                    content
+                })
+            })
+        },
+        changeDataType(e) {
+            const id = e.target.id;
+            if (!id || this.data.content.dataType == id) return;
+            this.setData({
+                "content.dataType": e.target.id,
+                list: []
+            });
+            this.getList(true)
+        },
+        openFiltrete() {
+            this.setData({
+                showFiltrete: true
+            })
+        },
+        callphonenumber(e) {
+            const {
+                phonenumber
+            } = e.currentTarget.dataset;
+            if (!phonenumber) return;
+            wx.makePhoneCall({
+                phoneNumber: phonenumber
+            })
+        }
+    }
+})

+ 4 - 0
packageA/achievement/modules/bills.json

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

+ 19 - 0
packageA/achievement/modules/bills.scss

@@ -0,0 +1,19 @@
+@import "./head.scss";
+@import "./content.scss";
+
+.content-box .title {
+    position: relative;
+    overflow: visible;
+
+    .status {
+        position: absolute;
+        right: -30rpx;
+        width: 128rpx;
+        text-align: center;
+        height: 42rpx;
+        border-radius: 20rpx 0rpx 0rpx 20rpx;
+        font-size: 24rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #FFFFFF;
+    }
+}

+ 79 - 0
packageA/achievement/modules/bills.wxml

@@ -0,0 +1,79 @@
+<view class="head" bindtap="changeDataType">
+    <view class="item {{content.dataType==10?'active':''}}" id='10'>
+        报价单
+    </view>
+    <view class="item {{content.dataType==11?'active':''}}" id='11'>
+        合同
+    </view>
+    <view class="item" style="opacity: 0;">
+
+    </view>
+    <navigator url="#" class="filter" catchtap="openFiltrete">
+        <text class="iconfont icon-shaixuan" />
+    </navigator>
+</view>
+
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+    <view class="content-box" wx:for="{{list}}" wx:key="changedate">
+        <block wx:if="{{content.dataType==10}}">
+            <view class="title line-1">
+                <text wx:if="{{item.quotedpricetype}}">{{item.quotedpricetype}}</text>
+                <view class="line-1" style="width: 430rpx;">
+                    单号:{{item.projectnum}}
+                </view>
+                <view class="status" style="background-color: {{item.status=='新建'?'#3874F6':item.status=='提交'?'#5AB73F':'#F29C37'}};">
+                    {{item.status}}
+                </view>
+            </view>
+            <view class="rep">
+                业务员:{{item.name}}
+                <block wx:if="{{item.name && item.depname}}">
+                    -
+                </block>
+                {{item.depname}}
+            </view>
+            <view class="rep">
+                项目:{{item.projectnum?item.projectnum+'-'+item.projectname :' --'}}
+            </view>
+            <view class="rep">
+                客户:{{item.enterprisename ||' --'}}
+            </view>
+            <view class="rep">
+                创建时间:{{item.createdate ||' --'}}
+            </view>
+        </block>
+        <block wx:if="{{content.dataType==11}}">
+            <view class="title">
+                <view class="line-1" style="width: 550rpx;">
+                    {{item.title}}
+                </view>
+                <view class="status" style="background-color: {{item.status=='新建'?'#3874F6':item.status=='提交'?'#5AB73F':'#F29C37'}};">
+                    {{item.status}}
+                </view>
+            </view>
+            <view class="rep">
+                编号:{{item.billno ||' --'}}
+            </view>
+            <view class="rep">
+                业务员:{{item.name}}
+                <block wx:if="{{item.name && item.depname}}">
+                    -
+                </block>
+                {{item.depname}}
+            </view>
+            <view class="rep">
+                合同类型:{{item.projectname ||' --'}}
+            </view>
+            <view class="rep">
+                客户:{{item.enterprisename ||' --'}}
+            </view>
+            <view class="rep">
+                创建时间:{{item.createdate ||' --'}}
+            </view>
+        </block>
+    </view>
+    <My_empty wx:if="{{!list.length}}" />
+    <view style="height: 80rpx;" />
+</Yl_ListBox>
+
+<Yl_Filtrate1 show='{{showFiltrete}}' list='{{filtratelist}}' dateRange bindhandle="handleFilter" />

+ 2 - 2
packageA/achievement/modules/project.wxml

@@ -25,8 +25,8 @@
             编号:{{item.projectnum}}
             编号:{{item.projectnum}}
         </view>
         </view>
         <view class="rep">
         <view class="rep">
-            业务员:{{item.hrname}}
-            <block wx:if="{{item.hrname && item.depname}}">
+            业务员:{{item.name}}
+            <block wx:if="{{item.name && item.depname}}">
                 -
                 -
             </block>
             </block>
             {{item.depname}}
             {{item.depname}}

+ 501 - 497
pages/tabbar/home/index.js

@@ -1,501 +1,505 @@
 let _Http = getApp().globalData.http,
 let _Http = getApp().globalData.http,
-	DataCarousel = null;
+    DataCarousel = null;
 Page({
 Page({
-	data: {
-		appid: wx.getStorageSync('appid'),
-		bannerList: [], //banner列表
-		gridList: [],
-		notice: "",
-		msgCount: 1,
-		msgList: [], //消息列表
-	},
-	onLoad(options) {
-		this.setData({ //获取胶囊位置信息
-			capsule: wx.getMenuButtonBoundingClientRect()
-		})
-		this.refreshData() //更新权限等信息
-		this.getTabBar().unReadMessageCount(); //更新信息数量
-		_Http.basic({
-			"classname": "sysmanage.develop.querytemplet.querytemplet",
-			"method": "query",
-			"content": {}
-		}).then(res => {
-			console.log("获取列表查询条件", res)
-			if (res.msg != '成功') return;
-			let data = res.data.find(v => v.templetname == '站点全部');
-			if (data) {
-				res.data = res.data.filter(v => v.templetname != '站点全部')
-				res.data.unshift(data)
-			}
-			wx.setStorageSync('templetList', res.data)
-		})
-	},
-	/* 更新站点信息 */
-	refreshData() {
-		this.setData({
-			user: wx.getStorageSync('userMsg')
-		})
-		if (wx.getStorageSync('userauth').length != 0) {
-			let authList = {},
-				entrance = [{
-					label: "通用",
-					icon: "work-tongyong",
-					appid: "wx197f219a82a89d7b",
-					list: getapps()
-				}, {
-					label: "营销工具",
-					icon: "work-yingxiaogongju",
-					appid: "wx197f219a82a89d7b",
-					list: gettool()
-				}, {
-					label: "CRM",
-					appid: "wx197f219a82a89d7b",
-					icon: "work-CRM",
-					list: getcrm()
-				}, {
-					label: "E-订单",
-					appid: "wxc1b6ae925ac1d06a",
-					icon: "work-E-dingdan",
-					list: getedd()
-				}, {
-					label: "E-服务",
-					appid: "wxc1b6ae925ac1d06a",
-					icon: "work-E-fuwu",
-					list: geteservice()
-				}];
-			//通用
-			function getapps() {
-				const paths = [{
-					name: "签到",
-					path: "/packageA/clockIn/index",
-					icon: "work-a-wodemendianxinxidizhi"
-				}, {
-					name: "任务",
-					path: "/packageA/work/index",
-					icon: "work-a-woderenwuzhongxin"
-				}, {
-					name: "通讯录",
-					path: "/packageA/contacts/index",
-					icon: "work-xiaochengxutongxunlu"
-				}, {
-					name: "工作汇报",
-					path: "/packageA/report/index",
-					icon: "work-gongzuohuibao"
-				}];
-				let app = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['通用']),
-					list = [];
-				app.forEach((v, i) => {
-					v.apps.forEach(s => {
-						authList[s.name] = {
-							options: s.meta.auth.map(a => a.option),
-							optionnames: s.meta.auth.map(a => a.optionname),
-						}
-						if (authList[s.name].options.some(s => s == "read")) {
-							let i = paths.findIndex(k => k.name == s.meta.title);
-							if (i != -1) {
-								paths[i].index = i;
-								list.push(paths[i])
-							}
-						}
-					})
-				});
-				return dye(list)
-			}
-			//营销工具
-			function gettool() {
-				const paths = [{
-					name: "通告",
-					path: "/pages/annunciate/index",
-					icon: "work-a-shouyejingangqutonggao",
-					objectname: "sat_notice"
-				}, {
-					name: "营销物料",
-					path: "/pages/mediaLibrary/index",
-					icon: "work-a-shouyejingangquyingxiaowuliao",
-					objectname: "sys_attachment"
-				}, {
-					name: "推广素材",
-					path: "/pages/promotional/index",
-					icon: "work-a-shouyejingangqutuiguangsucai",
-					objectname: "sat_sharematerial"
-				}, {
-					name: "商学院",
-					path: "/pages/college/index",
-					icon: "work-a-shangxueyuanxuexi",
-					objectname: "sat_courseware"
-				}, {
-					name: "提报",
-					path: "/pages/submission/index",
-					icon: "work-a-tibaoguanlitibao",
-					objectname: "sat_submiteditmodel"
-				}];
-				let tool = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], paths.map(v => v.name)),
-					list = [];
-				tool.forEach(v => {
-					let auth = v.apps[0].meta.auth;
-					if (!auth.some(r => r.option == 'read')) return;
-					authList[v.apps[0].name] = {
-						options: auth.map(a => a.option),
-						optionnames: auth.map(a => a.optionname)
-					};
-					let item = paths.find(s => s.name == v.systemmodulename);
-					item && list.push(item)
-				});
+    data: {
+        appid: wx.getStorageSync('appid'),
+        bannerList: [], //banner列表
+        gridList: [],
+        notice: "",
+        msgCount: 1,
+        msgList: [], //消息列表
+    },
+    onLoad(options) {
+        this.setData({ //获取胶囊位置信息
+            capsule: wx.getMenuButtonBoundingClientRect()
+        })
+        this.refreshData() //更新权限等信息
+        this.getTabBar().unReadMessageCount(); //更新信息数量
+        _Http.basic({
+            "classname": "sysmanage.develop.querytemplet.querytemplet",
+            "method": "query",
+            "content": {}
+        }).then(res => {
+            console.log("获取列表查询条件", res)
+            if (res.msg != '成功') return;
+            let data = res.data.find(v => v.templetname == '站点全部');
+            if (data) {
+                res.data = res.data.filter(v => v.templetname != '站点全部')
+                res.data.unshift(data)
+            }
+            wx.setStorageSync('templetList', res.data)
+        })
+    },
+    /* 更新站点信息 */
+    refreshData() {
+        this.setData({
+            user: wx.getStorageSync('userMsg')
+        })
+        if (wx.getStorageSync('userauth').length != 0) {
+            let authList = {},
+                entrance = [{
+                    label: "通用",
+                    icon: "work-tongyong",
+                    appid: "wx197f219a82a89d7b",
+                    list: getapps()
+                }, {
+                    label: "营销工具",
+                    icon: "work-yingxiaogongju",
+                    appid: "wx197f219a82a89d7b",
+                    list: gettool()
+                }, {
+                    label: "CRM",
+                    appid: "wx197f219a82a89d7b",
+                    icon: "work-CRM",
+                    list: getcrm()
+                }, {
+                    label: "E-订单",
+                    appid: "wxc1b6ae925ac1d06a",
+                    icon: "work-E-dingdan",
+                    list: getedd()
+                }, {
+                    label: "E-服务",
+                    appid: "wxc1b6ae925ac1d06a",
+                    icon: "work-E-fuwu",
+                    list: geteservice()
+                }];
+            //通用
+            function getapps() {
+                const paths = [{
+                    name: "签到",
+                    path: "/packageA/clockIn/index",
+                    icon: "work-a-wodemendianxinxidizhi"
+                }, {
+                    name: "任务",
+                    path: "/packageA/work/index",
+                    icon: "work-a-woderenwuzhongxin"
+                }, {
+                    name: "通讯录",
+                    path: "/packageA/contacts/index",
+                    icon: "work-xiaochengxutongxunlu"
+                }, {
+                    name: "工作汇报",
+                    path: "/packageA/report/index",
+                    icon: "work-gongzuohuibao"
+                }, {
+                    name: "作业看板",
+                    path: "/packageA/achievement/index",
+                    icon: "work-xiaochengxu_xiaoshouyuce"
+                }];
+                let app = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['通用', '数据看板']),
+                    list = [];
+                app.forEach((v, i) => {
+                    v.apps.forEach(s => {
+                        authList[s.name] = {
+                            options: s.meta.auth.map(a => a.option),
+                            optionnames: s.meta.auth.map(a => a.optionname),
+                        }
+                        if (authList[s.name].options.some(s => s == "read")) {
+                            let i = paths.findIndex(k => k.name == s.meta.title);
+                            if (i != -1) {
+                                paths[i].index = i;
+                                list.push(paths[i])
+                            }
+                        }
+                    })
+                });
+                return dye(list.sort((a, b) => a.index - b.index))
+            }
+            //营销工具
+            function gettool() {
+                const paths = [{
+                    name: "通告",
+                    path: "/pages/annunciate/index",
+                    icon: "work-a-shouyejingangqutonggao",
+                    objectname: "sat_notice"
+                }, {
+                    name: "营销物料",
+                    path: "/pages/mediaLibrary/index",
+                    icon: "work-a-shouyejingangquyingxiaowuliao",
+                    objectname: "sys_attachment"
+                }, {
+                    name: "推广素材",
+                    path: "/pages/promotional/index",
+                    icon: "work-a-shouyejingangqutuiguangsucai",
+                    objectname: "sat_sharematerial"
+                }, {
+                    name: "商学院",
+                    path: "/pages/college/index",
+                    icon: "work-a-shangxueyuanxuexi",
+                    objectname: "sat_courseware"
+                }, {
+                    name: "提报",
+                    path: "/pages/submission/index",
+                    icon: "work-a-tibaoguanlitibao",
+                    objectname: "sat_submiteditmodel"
+                }];
+                let tool = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], paths.map(v => v.name)),
+                    list = [];
+                tool.forEach(v => {
+                    let auth = v.apps[0].meta.auth;
+                    if (!auth.some(r => r.option == 'read')) return;
+                    authList[v.apps[0].name] = {
+                        options: auth.map(a => a.option),
+                        optionnames: auth.map(a => a.optionname)
+                    };
+                    let item = paths.find(s => s.name == v.systemmodulename);
+                    item && list.push(item)
+                });
 
 
-				return dye(list)
-			};
-			//CRM
-			function getcrm() {
-				const paths = [{
-					name: "市场活动",
-					path: "/packageA/activity/index",
-					icon: "work-shichanghuodong",
-					objectname: "sat_campaign"
-				}, {
-					name: "公海线索",
-					path: "/packageA/publicClue/index",
-					icon: "work-xiaochengxu_xiaoshoumubiao",
-					objectname: "sat_orderclue"
-				}, {
-					name: "销售线索",
-					path: "/packageA/saleClue/index",
-					icon: "work-xiaoshouxiansuo",
-					objectname: "sat_orderclue"
-				}, {
-					name: "公海客户",
-					path: "/packageA/publicCustomer/index",
-					icon: "work-gonghaikehu",
-					objectname: "sa_customers"
-				}, {
-					name: "我的客户",
-					path: "/packageA/setclient/index",
-					icon: "work-kehu",
-					objectname: "sa_customers"
-				}, {
-					name: "项目商机",
-					path: "/packageA/project/index",
-					icon: "work-xiangmushangji",
-					objectname: "sa_project"
-				}, {
-					name: "报价单",
-					path: "/packageA/offers/index",
-					icon: "work-xiangmubaojia",
-					objectname: "sa_quotedprice"
-				}, {
-					name: "竞争对手",
-					path: "/packageA/opponent/index",
-					icon: "work-jingzhengduishou",
-					objectname: "sa_competitor"
-				}, {
-					name: "合同",
-					path: "/packageA/contract/index",
-					icon: "work-hetong",
-					objectname: "sa_contract"
-				}, {
-					name: "销售目标",
-					path: "/packageA/target/index",
-					icon: "work-xiaochengxu_xiaoshoumubiao",
-					objectname: "sa_salestarget"
-				}, {
-					name: "销售预测",
-					path: "/packageA/salesForecasting/index",
-					icon: "work-xiaochengxu_xiaoshouyuce",
-					objectname: "sa_salesforecastbill"
-				}];
-				let crm = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['CRM'], ['销售预测', '销售线索', '销售目标', '合同管理', '客户管理', '项目管理']),
-					list = [];
-				crm.forEach(v => {
-					v.apps.forEach(s => {
-						authList[s.name] = {
-							options: s.meta.auth.map(a => a.option),
-							optionnames: s.meta.auth.map(a => a.optionname),
-						}
-						if (authList[s.name].options.some(s => s == "read")) {
-							let i = paths.findIndex(k => k.name == s.meta.title);
-							if (i != -1) {
-								paths[i].index = i;
-								list.push(paths[i])
-							}
-						}
-					})
-				});
-				return dye(list.sort((a, b) => a.index - b.index))
-			};
-			//E订单
-			function getedd() {
-				let paths = [{
-					name: "商城",
-					path: "/packageA/market/index",
-					icon: "work-shangcheng",
-					objectname: "sa_itemgroup"
-				}, {
-					name: "销售订单",
-					path: "/packageA/orderForm/index",
-					icon: "work-dingdan",
-					objectname: "sa_order"
-				}, {
-					name: "收货",
-					path: "/packageA/shipment/index",
-					icon: "work-shouhuo",
-					objectname: "sa_logistics"
-				}, {
-					name: "业绩目标",
-					path: "/packageA/target/index",
-					icon: "work-yejimubiao"
-				}, {
-					name: "账户",
-					path: "/packageA/account/index",
-					icon: "work-zhanghu",
-					objectname: "sa_accountbalance"
-				}, {
-					name: "促销活动",
-					path: "/packageA/activity/index",
-					icon: "work-cuxiaohuodong",
-					objectname: "sa_promotion"
-				}, {
-					name: "工具查询",
-					path: "/packageA/tool/index",
-					icon: "work-gongjuchaxun"
-				}, {
-					name: "购物车",
-					path: "/packageA/shopping/index",
-					icon: "work-gouwuche"
-				}, {
-					name: "开票",
-					path: "/packageA/invoice/index",
-					icon: "work-kaipiao",
-					objectname: "sa_invoiceapplyid"
-				}, {
-					name: "打款凭证",
-					path: "/packageA/remitVoucher/index",
-					icon: "work-dakuanpingzheng"
-				}, {
-					name: "工具借用",
-					path: "/packageA/borrow/index",
-					icon: "work-shujuchaxun",
-					objectname: "sa_order"
-				}, {
-					name: "工具归还",
-					path: "/packageA/toolBill/index",
-					icon: "work-shujuchaxun",
-					objectname: "sa_order"
-				}, {
-					name: "退返申请",
-					path: "/packageA/returnOne/index",
-					icon: "work-shujuchaxun",
-					objectname: "sa_aftersalesmag"
-				}, {
-					name: "居间费结算",
-					path: "/packageA/betweenFee/index",
-					icon: "work-jujianfeijiesuan"
-				}, ];
-				/* {
-				    name: "数据查询",
-				    path: "#",
-				    icon: "work-shujuchaxun"
-				} */
-				let edd = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-订单"], ["商品档案", "销售管理", "财务管理", "售后管理", "发货与库存", "业绩查询"]),
-					list = [];
-				edd.forEach(v => {
-					v.apps.forEach(s => {
-						authList[s.name] = {
-							options: s.meta.auth.map(a => a.option),
-							optionnames: s.meta.auth.map(a => a.optionname),
-						}
-						if (authList[s.name].options.some(s => s == "read")) {
-							let i = paths.findIndex(k => k.name == s.meta.title);
-							if (i != -1) {
-								paths[i].index = i;
-								list.push(paths[i])
-							}
-						}
-					})
-				});
-				return dye(list.sort((a, b) => a.index - b.index))
-			};
-			//E服务
-			function geteservice() {
-				let paths = [{
-					name: "工单",
-					path: "/Eservice/workOrder/index",
-					icon: "work-gongdan",
-					objectname: "sa_workorder"
-				}, {
-					name: "申请单",
-					path: "/Eservice/agent/serviceBillList/index",
-					icon: "work-shenqingdan",
-					// objectname: "sa_serviceorder"
-				}, {
-					name: "申请单管理",
-					path: "/Eservice/workerLeader/serviceBillList/index",
-					icon: "work-shenqingdanguanli",
-					// objectname: "sa_serviceorder"
-				}, {
-					name: "业务员服务申请单",
-					path: "/Eservice/saler/serviceBillList/index",
-					icon: "work-yewuyuanfuwushenqingdan",
-					// objectname: "sa_serviceorder"
-				}];
-				let eservice = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-服务"], ["工单管理"]),
-					list = [];
-				eservice.forEach(v => {
-					v.apps.forEach(s => {
-						authList[s.name] = {
-							options: s.meta.auth.map(a => a.option),
-							optionnames: s.meta.auth.map(a => a.optionname),
-						}
-						if (authList[s.name].options.some(s => s == "read")) {
-							let i = paths.findIndex(k => k.name == s.meta.title);
-							if (i != -1) {
-								paths[i].index = i;
-								list.push(paths[i])
-							}
-						}
-					})
-				});
-				return dye(list.sort((a, b) => a.index - b.index))
-			}
-			//染色
-			function dye(list) {
-				let colorList = [{
-					color: "#3874F6",
-					bColor: "#F0F3FF",
-				}, {
-					color: "#5AB73F",
-					bColor: "#F4FAEF",
-				}, {
-					color: "#F29C37",
-					bColor: "#FCF6EF",
-				}, {
-					color: "#EB4B5C",
-					bColor: "#FDF1ED",
-				}, {
-					color: "#3874F6",
-					bColor: "#F0F3FF",
-				}, {
-					color: "#F29C37",
-					bColor: "#FCF6EF",
-				}, {
-					color: "#EB4B5C",
-					bColor: "#FDF1ED",
-				}, {
-					color: "#3874F6",
-					bColor: "#F0F3FF",
-				}, {
-					color: "#5AB73F",
-					bColor: "#F4FAEF",
-				}, {
-					color: "#F29C37",
-					bColor: "#FCF6EF",
-				}, {
-					color: "#5AB73F",
-					bColor: "#F4FAEF",
-				}, {
-					color: "#3874F6",
-					bColor: "#F0F3FF",
-				}, {
-					color: "#F29C37",
-					bColor: "#FCF6EF",
-				}, {
-					color: "#EB4B5C",
-					bColor: "#FDF1ED",
-				}, {
-					color: "#5AB73F",
-					bColor: "#F4FAEF",
-				}];
-				return list.map((v, i) => {
-					return {
-						...v,
-						...colorList[i > colorList.length - 1 ? i - colorList.length : i]
-					}
-				})
-			};
-			wx.setStorageSync('auth', authList)
-			this.setData({
-				entrance,
-				auth: JSON.stringify(authList),
-				userMsg: JSON.stringify(wx.getStorageSync('userMsg')),
-				site: JSON.stringify(wx.getStorageSync('siteP'))
-			})
-			/* 获取首页banner */
-			let banner = wx.getStorageSync('banner_list').find(v => v.location == "index_top");
-			if (banner) this.setData({
-				bannerList: banner.ads
-			})
-			//用于消息跳转对照权限以及路径
-			wx.setStorageSync('authComparison', entrance.map(v => {
-				v = v.list.map(s => {
-					s.appid = v.appid;
-					return s
-				})
-				return v
-			}).flat())
-		} else {
-			setTimeout(this.refreshData, 10);
-			return;
-		}
-	},
-	/* 获取最新信息 */
-	queryMessage(i = 0) {
-		_Http.basic({
-			"classname": "system.message.Message",
-			"method": "queryMessage",
-			content: {
-				nocache: true,
-				pageNumber: 1,
-				pageSize: 5,
-				pageTotal: 1,
-				type: "",
-				where: {}
-			},
-		}, false).then(res => {
-			if (res.msg != '成功') return (i <= 5) ? this.queryMessage(i + 1) : wx.showToast({
-				title: res.msg,
-				icon: "none"
-			})
-			this.setData({
-				msgList: res.data,
-				notice: res.data[0]
-			})
-			if (this.data.msgList.length > 2) this.startDataCarousel();
-		})
-	},
-	/* 开启消息轮播 */
-	startDataCarousel() {
-		clearInterval(DataCarousel);
-		DataCarousel = setInterval(() => {
-			let count = this.data.msgCount < this.data.msgList.length ? this.data.msgCount : 0;
-			this.setData({
-				msgCount: count + 1,
-				notice: this.data.msgList[count]
-			})
-		}, 5000)
-	},
-	/* 去消息详情 */
-	toMsg(e) {
-		const {
-			item
-		} = e.currentTarget.dataset;
-		wx.navigateTo({
-			url: '/pages/tabbar/message/details?id=' + item.messageid,
-		})
-	},
-	/* banner */
-	bannerClick(e) {
-		const {
-			item
-		} = e.currentTarget.dataset,
-			hyperlink = item.hyperlink.split(":");
-		if (hyperlink[0] == 'path') wx.navigateTo({
-			url: hyperlink[1]
-		})
-	},
-	onShow() {
-		this.getTabBar().init();
-		if (this.data.msgList.length > 2) this.startDataCarousel();
-		this.queryMessage(0); //更新最新消息
-	},
-	onHide() {
-		clearInterval(DataCarousel);
-	},
+                return dye(list)
+            };
+            //CRM
+            function getcrm() {
+                const paths = [{
+                    name: "市场活动",
+                    path: "/packageA/activity/index",
+                    icon: "work-shichanghuodong",
+                    objectname: "sat_campaign"
+                }, {
+                    name: "公海线索",
+                    path: "/packageA/publicClue/index",
+                    icon: "work-xiaochengxu_xiaoshoumubiao",
+                    objectname: "sat_orderclue"
+                }, {
+                    name: "销售线索",
+                    path: "/packageA/saleClue/index",
+                    icon: "work-xiaoshouxiansuo",
+                    objectname: "sat_orderclue"
+                }, {
+                    name: "公海客户",
+                    path: "/packageA/publicCustomer/index",
+                    icon: "work-gonghaikehu",
+                    objectname: "sa_customers"
+                }, {
+                    name: "我的客户",
+                    path: "/packageA/setclient/index",
+                    icon: "work-kehu",
+                    objectname: "sa_customers"
+                }, {
+                    name: "项目商机",
+                    path: "/packageA/project/index",
+                    icon: "work-xiangmushangji",
+                    objectname: "sa_project"
+                }, {
+                    name: "报价单",
+                    path: "/packageA/offers/index",
+                    icon: "work-xiangmubaojia",
+                    objectname: "sa_quotedprice"
+                }, {
+                    name: "竞争对手",
+                    path: "/packageA/opponent/index",
+                    icon: "work-jingzhengduishou",
+                    objectname: "sa_competitor"
+                }, {
+                    name: "合同",
+                    path: "/packageA/contract/index",
+                    icon: "work-hetong",
+                    objectname: "sa_contract"
+                }, {
+                    name: "销售目标",
+                    path: "/packageA/target/index",
+                    icon: "work-xiaochengxu_xiaoshoumubiao",
+                    objectname: "sa_salestarget"
+                }, {
+                    name: "销售预测",
+                    path: "/packageA/salesForecasting/index",
+                    icon: "work-xiaochengxu_xiaoshouyuce",
+                    objectname: "sa_salesforecastbill"
+                }];
+                let crm = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['CRM'], ['销售预测', '销售线索', '销售目标', '合同管理', '客户管理', '项目管理']),
+                    list = [];
+                crm.forEach(v => {
+                    v.apps.forEach(s => {
+                        authList[s.name] = {
+                            options: s.meta.auth.map(a => a.option),
+                            optionnames: s.meta.auth.map(a => a.optionname),
+                        }
+                        if (authList[s.name].options.some(s => s == "read")) {
+                            let i = paths.findIndex(k => k.name == s.meta.title);
+                            if (i != -1) {
+                                paths[i].index = i;
+                                list.push(paths[i])
+                            }
+                        }
+                    })
+                });
+                return dye(list.sort((a, b) => a.index - b.index))
+            };
+            //E订单
+            function getedd() {
+                let paths = [{
+                    name: "商城",
+                    path: "/packageA/market/index",
+                    icon: "work-shangcheng",
+                    objectname: "sa_itemgroup"
+                }, {
+                    name: "销售订单",
+                    path: "/packageA/orderForm/index",
+                    icon: "work-dingdan",
+                    objectname: "sa_order"
+                }, {
+                    name: "收货",
+                    path: "/packageA/shipment/index",
+                    icon: "work-shouhuo",
+                    objectname: "sa_logistics"
+                }, {
+                    name: "业绩目标",
+                    path: "/packageA/target/index",
+                    icon: "work-yejimubiao"
+                }, {
+                    name: "账户",
+                    path: "/packageA/account/index",
+                    icon: "work-zhanghu",
+                    objectname: "sa_accountbalance"
+                }, {
+                    name: "促销活动",
+                    path: "/packageA/activity/index",
+                    icon: "work-cuxiaohuodong",
+                    objectname: "sa_promotion"
+                }, {
+                    name: "工具查询",
+                    path: "/packageA/tool/index",
+                    icon: "work-gongjuchaxun"
+                }, {
+                    name: "购物车",
+                    path: "/packageA/shopping/index",
+                    icon: "work-gouwuche"
+                }, {
+                    name: "开票",
+                    path: "/packageA/invoice/index",
+                    icon: "work-kaipiao",
+                    objectname: "sa_invoiceapplyid"
+                }, {
+                    name: "打款凭证",
+                    path: "/packageA/remitVoucher/index",
+                    icon: "work-dakuanpingzheng"
+                }, {
+                    name: "工具借用",
+                    path: "/packageA/borrow/index",
+                    icon: "work-shujuchaxun",
+                    objectname: "sa_order"
+                }, {
+                    name: "工具归还",
+                    path: "/packageA/toolBill/index",
+                    icon: "work-shujuchaxun",
+                    objectname: "sa_order"
+                }, {
+                    name: "退返申请",
+                    path: "/packageA/returnOne/index",
+                    icon: "work-shujuchaxun",
+                    objectname: "sa_aftersalesmag"
+                }, {
+                    name: "居间费结算",
+                    path: "/packageA/betweenFee/index",
+                    icon: "work-jujianfeijiesuan"
+                }, ];
+                /* {
+                    name: "数据查询",
+                    path: "#",
+                    icon: "work-shujuchaxun"
+                } */
+                let edd = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-订单"], ["商品档案", "销售管理", "财务管理", "售后管理", "发货与库存", "业绩查询"]),
+                    list = [];
+                edd.forEach(v => {
+                    v.apps.forEach(s => {
+                        authList[s.name] = {
+                            options: s.meta.auth.map(a => a.option),
+                            optionnames: s.meta.auth.map(a => a.optionname),
+                        }
+                        if (authList[s.name].options.some(s => s == "read")) {
+                            let i = paths.findIndex(k => k.name == s.meta.title);
+                            if (i != -1) {
+                                paths[i].index = i;
+                                list.push(paths[i])
+                            }
+                        }
+                    })
+                });
+                return dye(list.sort((a, b) => a.index - b.index))
+            };
+            //E服务
+            function geteservice() {
+                let paths = [{
+                    name: "工单",
+                    path: "/Eservice/workOrder/index",
+                    icon: "work-gongdan",
+                    objectname: "sa_workorder"
+                }, {
+                    name: "申请单",
+                    path: "/Eservice/agent/serviceBillList/index",
+                    icon: "work-shenqingdan",
+                    // objectname: "sa_serviceorder"
+                }, {
+                    name: "申请单管理",
+                    path: "/Eservice/workerLeader/serviceBillList/index",
+                    icon: "work-shenqingdanguanli",
+                    // objectname: "sa_serviceorder"
+                }, {
+                    name: "业务员服务申请单",
+                    path: "/Eservice/saler/serviceBillList/index",
+                    icon: "work-yewuyuanfuwushenqingdan",
+                    // objectname: "sa_serviceorder"
+                }];
+                let eservice = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["E-服务"], ["工单管理"]),
+                    list = [];
+                eservice.forEach(v => {
+                    v.apps.forEach(s => {
+                        authList[s.name] = {
+                            options: s.meta.auth.map(a => a.option),
+                            optionnames: s.meta.auth.map(a => a.optionname),
+                        }
+                        if (authList[s.name].options.some(s => s == "read")) {
+                            let i = paths.findIndex(k => k.name == s.meta.title);
+                            if (i != -1) {
+                                paths[i].index = i;
+                                list.push(paths[i])
+                            }
+                        }
+                    })
+                });
+                return dye(list.sort((a, b) => a.index - b.index))
+            }
+            //染色
+            function dye(list) {
+                let colorList = [{
+                    color: "#3874F6",
+                    bColor: "#F0F3FF",
+                }, {
+                    color: "#5AB73F",
+                    bColor: "#F4FAEF",
+                }, {
+                    color: "#F29C37",
+                    bColor: "#FCF6EF",
+                }, {
+                    color: "#EB4B5C",
+                    bColor: "#FDF1ED",
+                }, {
+                    color: "#3874F6",
+                    bColor: "#F0F3FF",
+                }, {
+                    color: "#F29C37",
+                    bColor: "#FCF6EF",
+                }, {
+                    color: "#EB4B5C",
+                    bColor: "#FDF1ED",
+                }, {
+                    color: "#3874F6",
+                    bColor: "#F0F3FF",
+                }, {
+                    color: "#5AB73F",
+                    bColor: "#F4FAEF",
+                }, {
+                    color: "#F29C37",
+                    bColor: "#FCF6EF",
+                }, {
+                    color: "#5AB73F",
+                    bColor: "#F4FAEF",
+                }, {
+                    color: "#3874F6",
+                    bColor: "#F0F3FF",
+                }, {
+                    color: "#F29C37",
+                    bColor: "#FCF6EF",
+                }, {
+                    color: "#EB4B5C",
+                    bColor: "#FDF1ED",
+                }, {
+                    color: "#5AB73F",
+                    bColor: "#F4FAEF",
+                }];
+                return list.map((v, i) => {
+                    return {
+                        ...v,
+                        ...colorList[i > colorList.length - 1 ? i - colorList.length : i]
+                    }
+                })
+            };
+            wx.setStorageSync('auth', authList)
+            this.setData({
+                entrance,
+                auth: JSON.stringify(authList),
+                userMsg: JSON.stringify(wx.getStorageSync('userMsg')),
+                site: JSON.stringify(wx.getStorageSync('siteP'))
+            })
+            /* 获取首页banner */
+            let banner = wx.getStorageSync('banner_list').find(v => v.location == "index_top");
+            if (banner) this.setData({
+                bannerList: banner.ads
+            })
+            //用于消息跳转对照权限以及路径
+            wx.setStorageSync('authComparison', entrance.map(v => {
+                v = v.list.map(s => {
+                    s.appid = v.appid;
+                    return s
+                })
+                return v
+            }).flat())
+        } else {
+            setTimeout(this.refreshData, 10);
+            return;
+        }
+    },
+    /* 获取最新信息 */
+    queryMessage(i = 0) {
+        _Http.basic({
+            "classname": "system.message.Message",
+            "method": "queryMessage",
+            content: {
+                nocache: true,
+                pageNumber: 1,
+                pageSize: 5,
+                pageTotal: 1,
+                type: "",
+                where: {}
+            },
+        }, false).then(res => {
+            if (res.msg != '成功') return (i <= 5) ? this.queryMessage(i + 1) : wx.showToast({
+                title: res.msg,
+                icon: "none"
+            })
+            this.setData({
+                msgList: res.data,
+                notice: res.data[0]
+            })
+            if (this.data.msgList.length > 2) this.startDataCarousel();
+        })
+    },
+    /* 开启消息轮播 */
+    startDataCarousel() {
+        clearInterval(DataCarousel);
+        DataCarousel = setInterval(() => {
+            let count = this.data.msgCount < this.data.msgList.length ? this.data.msgCount : 0;
+            this.setData({
+                msgCount: count + 1,
+                notice: this.data.msgList[count]
+            })
+        }, 5000)
+    },
+    /* 去消息详情 */
+    toMsg(e) {
+        const {
+            item
+        } = e.currentTarget.dataset;
+        wx.navigateTo({
+            url: '/pages/tabbar/message/details?id=' + item.messageid,
+        })
+    },
+    /* banner */
+    bannerClick(e) {
+        const {
+            item
+        } = e.currentTarget.dataset,
+            hyperlink = item.hyperlink.split(":");
+        if (hyperlink[0] == 'path') wx.navigateTo({
+            url: hyperlink[1]
+        })
+    },
+    onShow() {
+        this.getTabBar().init();
+        if (this.data.msgList.length > 2) this.startDataCarousel();
+        this.queryMessage(0); //更新最新消息
+    },
+    onHide() {
+        clearInterval(DataCarousel);
+    },
 })
 })

+ 7 - 0
project.private.config.json

@@ -49,6 +49,13 @@
                     "query": "",
                     "query": "",
                     "launchMode": "default",
                     "launchMode": "default",
                     "scene": null
                     "scene": null
+                },
+                {
+                    "name": "工作看板",
+                    "pathName": "packageA/achievement/index",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
                 }
                 }
             ]
             ]
         }
         }