Browse Source

团队管理

xiaohaizhao 1 năm trước cách đây
mục cha
commit
65a2ba22d8

+ 60 - 35
team/agency/check.vue

@@ -8,14 +8,9 @@
                 共{{ total }}个
             </text>
         </view>
-        <My_listbox ref="List" @getlist="getList" bottomHeight="70">
-            <store-list check ref="storeList" :list="list" @onClick="onClick" />
+        <My_listbox ref="List" @getlist="getList" bottomHeight="30">
+            <store-list check ref="storeList" :list="list" @onClick="onClick" @onHandle="onHandle" />
         </My_listbox>
-        <view class="footer">
-            <navigator class="invite" @click="onInsert" url="/store/insert/store">
-                新增门店
-            </navigator>
-        </view>
     </view>
 </template>
 
@@ -37,6 +32,9 @@ export default {
     },
     onLoad() {
         this.getList()
+        uni.setNavigationBarTitle({
+            title: '门店信息审核'
+        });
     },
     methods: {
         getList(init = false) {
@@ -56,11 +54,65 @@ export default {
                 this.content = this.$refs.List.paging(this.content, res)
             })
         },
+
+        updateList() {
+            if (this.content.pageNumber && this.content.pageNumber >= 2) {
+                let content = this.paging(this.content, true, true)
+                this.$Http.basic({
+                    "id": "20240411141602",
+                    content
+                }).then(res => {
+                    console.log("更新待审核门店列表", res)
+                    if (this.cutoff(res.msg)) return;
+                    this.$refs.List.setHeight()
+                    this.list = this.$refs.storeList.handleList(res.data);
+                    this.total = res.total;
+                    this.$refs.List.paging(content, res, true)
+                })
+            }
+        },
         onClick(item) {
             this.onInsert();
             uni.navigateTo({
                 url: '/store/center/detail?id=' + item.sa_storeid,
             });
+        },
+        onHandle(item, funname) {
+            console.log(item, funname)
+            let id = '',
+                that = this;
+            switch (funname) {
+                case "退回":
+                    id = 20240410135402;
+                    break;
+                case "审核":
+                    id = 20240410141002;
+                    break;
+                case "反审核":
+                    id = 20240410141402;
+                    break;
+            }
+            uni.showModal({
+                title: '提醒',
+                content: `确定对“${item.storename}”执行“${funname}”操作吗?`,
+                confirmText: funname,
+                success: ({
+                    confirm
+                }) => {
+                    if (confirm) that.$Http.basic({
+                        id,
+                        "content": {
+                            "sa_storeid": item.sa_storeid
+                        }
+                    }).then(res => {
+                        console.log(`${funname}门店`, res)
+                        if (that.cutoff(res.msg, `门店“${funname}”成功`)) return;
+                        that.updateList()
+                    })
+                },
+            })
+
+
         },
         onInsert() {
             this.$Http.uploadStoreList = function () {
@@ -74,7 +126,7 @@ export default {
                         if (this.cutoff(res.msg)) return;
                         this.$refs.List.setHeight()
                         this.list = this.$refs.storeList.handleList(res.data);
-                        this.$refs.List.paging(current, res, true)
+                        this.$refs.List.paging(content, res, true)
                     })
                 }
             }.bind(this)
@@ -95,31 +147,4 @@ export default {
     font-size: 12px;
     color: #666666;
 }
-
-.footer {
-    position: fixed;
-    bottom: 0;
-    display: flex;
-    justify-content: space-between;
-    width: 100vw;
-    height: 65px;
-    background: #FFFFFF;
-    box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
-    padding: 5px 10px;
-    box-sizing: border-box;
-
-    .invite {
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        flex: 1;
-        height: 45px;
-        background: #C30D23;
-        border-radius: 5px;
-        font-family: PingFang SC, PingFang SC;
-        font-weight: 500;
-        font-size: 16px;
-        color: #FFFFFF;
-    }
-}
 </style>

+ 88 - 4
team/agency/detail.vue

@@ -1,24 +1,108 @@
 <template>
     <view>
-
+        <agency-list :list="[detail]" boxWidth="100vw" />
+        <view class="head">
+            <view>
+                门店信息
+            </view>
+            <view>
+                共<text class="total">{{ total }}</text>个
+            </view>
+        </view>
+        <My_listbox ref="List" @getlist="getList" bottomHeight="30">
+            <store-list ref="storeList" :list="list" @onClick="onClick" />
+        </My_listbox>
     </view>
 </template>
 
 <script>
+import agencyList from "../team/modules/agencyList"
+import storeList from "../team/modules/storeList"
+
 export default {
+    components: { agencyList, storeList },
     data() {
         return {
             detail: {},
+            total: 0,
+            list: [],
+            "content": {
+                "where": {
+                    "condition": "",
+                    "storetype": "",
+                    "status": "审核"
+                }
+            }
         }
     },
     onLoad(options) {
         this.detail = JSON.parse(options.data);
-        
+        this.content.sys_enterpriseid = this.detail.sys_enterpriseid;
+        this.getList();
         uni.setNavigationBarTitle({
             title: options.title || '团队信息'
         });
-    }
+    },
+    methods: {
+        getList(init = false) {
+            if (this.paging(this.content, init)) return;
+            this.$Http.basic({
+                "id": "20240410095602",
+                content: this.content
+            }).then(res => {
+                console.log("经销商门店列表", res)
+                this.$refs.List.RefreshToComplete()
+                if (this.cutoff(res.msg)) return;
+                this.uninitialized = false;
+                this.$refs.List.setHeight()
+                res.data = this.$refs.storeList.handleList(res.data)
+                this.total = res.total;
+                this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data);
+                this.content = this.$refs.List.paging(this.content, res)
+            })
+        },
+        onClick(item) {
+            // this.onInsert();
+            uni.navigateTo({
+                url: '/store/center/detail?id=' + item.sa_storeid,
+            });
+        },
+        /*  onInsert() {
+             this.$Http.uploadStoreList = function () {
+                 if (this.content.pageNumber && this.content.pageNumber >= 2) {
+                     let content = this.paging(this.content, true, true)
+                     this.$Http.basic({
+                         "id": "20240410095602",
+                         content
+                     }).then(res => {
+                         console.log("更新门店列表", res)
+                         if (this.cutoff(res.msg)) return;
+                         this.$refs.List.setHeight()
+                         this.list = this.$refs.storeList.handleList(res.data);
+                         this.$refs.List.paging(content, res, true)
+                     })
+                 }
+             }.bind(this)
+         }, */
+    },
 }
 </script>
 
-<style></style>
+<style lang="scss" scoped>
+.head {
+    display: flex;
+    justify-content: space-between;
+    width: 100vw;
+    height: 27px;
+    padding: 10px;
+    padding-top: 0;
+    font-family: Source Han Sans SC, Source Han Sans SC;
+    font-size: 12px;
+    color: #666666;
+    box-sizing: border-box;
+
+    .total {
+        padding: 0 5px;
+    }
+}
+</style>

+ 14 - 9
team/team/index.vue

@@ -2,7 +2,7 @@
     <view>
         <u-tabs :scrollable="false" lineColor="#C30D23" :activeStyle="{ color: '#C30D23', fontWeight: 'bold' }" :list="tabs"
             @click="changeCurrent" />
-        <!-- <agency ref="经销商" v-show="pageNmae == '经销商'" /> -->
+        <agency ref="经销商" v-show="pageNmae == '经销商'" />
         <users ref="人员" v-show="pageNmae == '人员'" />
         <store ref="门店" v-show="pageNmae == '门店'" />
     </view>
@@ -16,19 +16,24 @@ export default {
     components: { users, store, agency },
     data() {
         return {
-            pageNmae: "人员",
+            pageNmae: "",
             tabs: [{
                 name: '人员',
-            }, {
-                name: '门店',
-            }]
-
-            /* {
-                name: '经销商',
-            }, */
+            }],
         }
     },
     onLoad() {
+        if (uni.getStorageSync('userMsg').usertype == 1) {
+            this.tabs.unshift({
+                name: '经销商',
+            });
+            this.pageNmae = '经销商';
+        } else {
+            this.tabs.push({
+                name: '门店',
+            });
+            this.pageNmae = '人员';
+        }
         uni.setNavigationBarTitle({
             title: '团队管理'
         });

+ 4 - 43
team/team/modules/agency.vue

@@ -1,5 +1,5 @@
 <template>
-    <view class="">
+    <view>
         <view class="search-box">
             <My_search background="#fff" @onSearch="onSearch" />
         </view>
@@ -34,51 +34,13 @@ export default {
                 }
             },
             total: 0,
-            list: [{
-                "agentnum": "LSA皖0004",
-                "detailaddress": "",
-                "address": "",
-                "province": "",
-                "city": "",
-                "contact": "方明忠",
-                "phonenumber": "18005646075",
-                "county": "",
-                "sys_enterpriseid": 11957,
-                "enterprisename": "安徽 六安市 方明忠1",
-                "rowindex": 1
-            },
-            {
-                "agentnum": "LSA皖0013",
-                "detailaddress": "",
-                "address": "",
-                "province": "",
-                "city": "",
-                "contact": "董文",
-                "phonenumber": "15605578577",
-                "county": "",
-                "sys_enterpriseid": 11959,
-                "enterprisename": "安徽宿州董文3",
-                "rowindex": 2
-            },
-            {
-                "agentnum": "LSA鄂0003",
-                "detailaddress": "",
-                "address": "",
-                "province": "",
-                "city": "",
-                "contact": "刘春阳",
-                "phonenumber": "15972519917",
-                "county": "",
-                "sys_enterpriseid": 11979,
-                "enterprisename": "湖北崇阳 刘春阳1",
-                "rowindex": 3
-            }],
+            list: [],
             uninitialized: true,
         }
     },
     methods: {
         init() {
-            // this.getList(true)
+            this.getList(true)
         },
         getList(init = false) {
             if (this.paging(this.content, init)) return;
@@ -114,7 +76,7 @@ export default {
                         if (this.cutoff(res.msg)) return;
                         this.$refs.List.setHeight()
                         this.list = res.data;
-                        this.$refs.List.paging(current, res, true)
+                        this.$refs.List.paging(content, res, true)
                     })
                 }
             }.bind(this)
@@ -129,7 +91,6 @@ export default {
 
 <style lang="scss" scoped>
 .search-box {
-
     margin-top: 10px;
     padding: 0 10px;
     box-sizing: border-box;

+ 122 - 78
team/team/modules/storeList.vue

@@ -1,41 +1,51 @@
 <template>
     <view>
-        <view class="item" v-for="item in list" :key="item.sa_storeid" hover-class="navigator-hover"
-            @click="itemClick(item)">
-            <view class="title u-line-1">{{ item.storename || '' }}</view>
-            <view class="content">
-                <view class="left">
-                    <view class="tag-box">
-                        <view v-if="item.storetype" class="storetype">
-                            {{ item.storetype }}
+        <view class="item-box" v-for="item in list" :key="item.sa_storeid">
+            <view class="item" hover-class="navigator-hover" @click="itemClick(item)">
+                <view class="title u-line-1">{{ item.storename || '' }}</view>
+                <view class="content">
+                    <view class="left">
+                        <view class="tag-box">
+                            <view v-if="item.storetype" class="storetype">
+                                {{ item.storetype }}
+                            </view>
+                            <view v-if="item.markettype" class="markettype">
+                                {{ item.markettype }}
+                            </view>
                         </view>
-                        <view v-if="item.markettype" class="markettype">
-                            {{ item.markettype }}
+                        <view class="row">
+                            <text class="iconfont icon-renyuan-hui" />
+                            <text>
+                                {{ item.name }}
+                            </text>
+                            <text style="margin-left: 5px;">
+                                {{ item.phonenumber }}
+                            </text>
+                        </view>
+                        <view class="row">
+                            <text class="iconfont icon-dizhi-hui1" />
+                            {{ getCity(item) }}
+                        </view>
+                        <view class="row">
+                            状态:<text :style="{ color: item.color }">{{ item.status }}</text>
                         </view>
                     </view>
-                    <view class="row">
-                        <text class="iconfont icon-renyuan-hui" />
-                        <text>
-                            {{ item.name }}
-                        </text>
-                        <text style="margin-left: 5px;">
-                            {{ item.phonenumber }}
-                        </text>
-                    </view>
-                    <view class="row">
-                        <text class="iconfont icon-dizhi-hui1" />
-                        {{ getCity(item) }}
-                    </view>
-                    <view class="row">
-                        状态:<text :style="{ color: item.color }">{{ item.status }}</text>
+                    <view class="right">
+                        <u--image :src="item.cover" :width="tovw(100)" :height="tovw(100)" radius="5">
+                            <template v-slot:loading>
+                                <u-loading-icon color="red"></u-loading-icon>
+                            </template>
+                        </u--image>
                     </view>
                 </view>
-                <view class="right">
-                    <u--image :src="item.cover" :width="tovw(100)" :height="tovw(100)" radius="5">
-                        <template v-slot:loading>
-                            <u-loading-icon color="red"></u-loading-icon>
-                        </template>
-                    </u--image>
+            </view>
+            <view class="bottom">
+                <view class="but" hover-class="navigator-hover" @click="onCheck(item, '退回')">
+                    退回
+                </view>
+                <view class="line" />
+                <view class="but" style="color:#C30D23;" hover-class="navigator-hover" @click="onCheck(item, '审核')">
+                    审核通过
                 </view>
             </view>
         </view>
@@ -54,6 +64,9 @@ export default {
         },
         check: {
             type: Boolean
+        },
+        onHandle: {
+            type: Function
         }
     },
     methods: {
@@ -76,79 +89,110 @@ export default {
         },
         itemClick(item) {
             this.$emit("onClick", item)
+        },
+        onCheck(item, funname) {
+            this.$emit("onHandle", item, funname)
         }
     },
 }
 </script>
 
 <style lang="scss" scoped>
-.item {
-    width: 355px;
+.item-box {
     background: #FFFFFF;
+    width: 355px;
     border-radius: 8px;
-    padding: 10px;
-    box-sizing: border-box;
     margin: 0 auto 10px;
+    box-sizing: border-box;
+    overflow: hidden;
 
-    .title {
-        line-height: 24px;
-        font-family: Source Han Sans SC, Source Han Sans SC;
-        font-weight: bold;
-        font-size: 16px;
-        color: #333333;
-    }
+    .item {
+        padding: 10px;
+        box-sizing: border-box;
+
+        .title {
+            line-height: 24px;
+            font-family: Source Han Sans SC, Source Han Sans SC;
+            font-weight: bold;
+            font-size: 16px;
+            color: #333333;
+        }
+
+        .content {
+            position: relative;
+
+            .left {
+                width: 220px;
+
+                .tag-box {
+                    display: flex;
 
-    .content {
-        position: relative;
+                    .storetype,
+                    .markettype {
+                        font-family: Source Han Sans SC, Source Han Sans SC;
+                        font-size: 12px;
+                        color: #FFFFFF;
+                        height: 24px;
+                        line-height: 24px;
+                        padding: 0 4px;
+                        border-radius: 2px;
+                        margin-top: 5px;
+                    }
 
-        .left {
-            width: 220px;
+                    .storetype {
+                        background: #095DE0;
+                    }
 
-            .tag-box {
-                display: flex;
+                    .markettype {
+                        background: #FC9228;
+                        margin-left: 5px;
+                    }
+                }
 
-                .storetype,
-                .markettype {
+                .row {
+                    line-height: 17px;
                     font-family: Source Han Sans SC, Source Han Sans SC;
                     font-size: 12px;
-                    color: #FFFFFF;
-                    height: 24px;
-                    line-height: 24px;
-                    padding: 0 4px;
-                    border-radius: 2px;
+                    color: #888888;
                     margin-top: 5px;
-                }
-
-                .storetype {
-                    background: #095DE0;
-                }
 
-                .markettype {
-                    background: #FC9228;
-                    margin-left: 5px;
+                    .iconfont {
+                        margin-right: 5px;
+                        font-size: 12px;
+                    }
                 }
             }
 
-            .row {
-                line-height: 17px;
-                font-family: Source Han Sans SC, Source Han Sans SC;
-                font-size: 12px;
-                color: #888888;
-                margin-top: 5px;
-
-                .iconfont {
-                    margin-right: 5px;
-                    font-size: 12px;
-                }
+            .right {
+                position: absolute;
+                right: 0;
+                bottom: 0;
             }
+
         }
+    }
+
+    .bottom {
+        display: flex;
+        align-items: center;
+        border-top: 0.5px solid #ddd;
 
-        .right {
-            position: absolute;
-            right: 0;
-            bottom: 0;
+        .line {
+            width: 0.5px;
+            height: 20px;
+            background: #DDDDDD;
         }
 
+        .but {
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            flex: 1;
+            height: 40px;
+            font-family: Source Han Sans SC, Source Han Sans SC;
+            font-size: 14px;
+            color: #666666;
+        }
     }
 }
 </style>

+ 43 - 8
team/userCenter/personal.vue

@@ -9,13 +9,24 @@
 
         <view style="height: 70px;" />
         <view class="footer">
-            <navigator class="insert" v-if="detail.iswechatbind == 0"
-                :url="'/team/userCenter/wechatbind?id=' + detail.sys_enterprise_hrid + '&name=' + detail.name">
-                绑定微信
-            </navigator>
-            <view class="invite" style="flex: 1;" @click="toEdit" hover-class="navigator-hover">
-                编辑
-            </view>
+            <block v-if="userType == 1">
+                <navigator class="insert" style="flex:1;margin-right: 0;" v-if="detail.iswechatbind == 0"
+                    :url="'/team/userCenter/wechatbind?id=' + detail.sys_enterprise_hrid + '&name=' + detail.name">
+                    绑定微信
+                </navigator>
+                <view v-else class="invite" style="flex: 1;" @click="setStatus" hover-class="navigator-hover">
+                    {{ detail.status == '停用' ? '启用' : '停用' }}
+                </view>
+            </block>
+            <block v-else>
+                <navigator class="insert" v-if="detail.iswechatbind == 0"
+                    :url="'/team/userCenter/wechatbind?id=' + detail.sys_enterprise_hrid + '&name=' + detail.name">
+                    绑定微信
+                </navigator>
+                <view class="invite" style="flex: 1;" @click="toEdit" hover-class="navigator-hover">
+                    编辑
+                </view>
+            </block>
         </view>
     </view>
 </template>
@@ -30,11 +41,13 @@ export default {
             detail: {
                 userid: 0
             },
-            showList: []
+            showList: [],
+            userType: 0,
         }
     },
     onLoad(options) {
         console.log("options", options)
+        this.userType = uni.getStorageSync('userMsg').usertype;
         this.sys_enterprise_hrid = options.id;
         uni.setNavigationBarTitle({
             title: '人员信息'
@@ -90,6 +103,28 @@ export default {
             uni.navigateTo({
                 url: '/team/userCenter/insert?title=编辑人员&data=' + JSON.stringify(this.detail)
             });
+        },
+        setStatus() {
+            let detail = this.detail,
+                that = this;
+
+            uni.showModal({
+                title: '提醒',
+                content: `确定${detail.status == '停用' ? '启用' : '停用'}“${detail.name}”账号吗?`,
+                success: ({ confirm }) => {
+                    if (confirm) that.$Http.basic({
+                        "id": "20240428091402",
+                        "content": {
+                            "enable": detail.status == '停用' ? 1 : 0,
+                            "userid": detail.userid
+                        }
+                    }).then(res => {
+                        if (that.cutoff(res.msg, (detail.status == '停用' ? '启用' : '停用') + '成功!')) return;
+                        that.getDetail()
+                        that.$Http.uploadUserList && that.$Http.uploadUserList();
+                    })
+                },
+            })
         }
     },
 }