Просмотр исходного кода

完善任务模块逻辑,项目商机添加 结束和恢复功能 完善功能逻辑

zhaoxiaohai 3 лет назад
Родитель
Сommit
0e7597c97a

+ 6 - 6
packageA/contract/detail.js

@@ -10,10 +10,7 @@ Page({
             label: "详细信息",
             num: 132
         }],
-        tabbarList: [{
-            icon: "icon-genjin",
-            label: "跟进"
-        }],
+        tabbarList: [],
     },
     onLoad(options) {
         this.setData({
@@ -36,7 +33,10 @@ Page({
             });
 
             let isLeader = res.data.leader.some(some => some.userid == wx.getStorageSync('userMsg').userid),
-                tabbarList = this.data.tabbarList;
+                tabbarList = [{
+                    icon: "icon-genjin",
+                    label: "跟进"
+                }];
 
             if (this.data.isAdmin) tabbarList = [{
                 icon: "icon-genjin",
@@ -234,7 +234,7 @@ Page({
                     })
                     briefs.splice(5, 0, {
                         label: data.calculatemodel == 1 ? '订单金额比例' : '产品折扣',
-                        value: data.calculatemodel == 1 ? data.orderratio * 100 + '%' : data.productdiscount* 100 + '%'
+                        value: data.calculatemodel == 1 ? data.orderratio * 100 + '%' : data.productdiscount * 100 + '%'
                     })
                     list1.splice(4, 0, {
                         label: "居间服务商",

+ 5 - 5
packageA/offers/detail.js

@@ -31,10 +31,7 @@ Page({
             label: "任务",
             num: 132
         }],
-        tabbarList: [{
-            icon: "icon-genjin",
-            label: "跟进"
-        }],
+        tabbarList: [],
     },
     onLoad(options) {
         this.setData({
@@ -62,7 +59,10 @@ Page({
                     num: 132
                 })
             }
-            let tabbarList = this.data.tabbarList,
+            let tabbarList = [{
+                    icon: "icon-genjin",
+                    label: "跟进"
+                }],
                 isLeader = res.data.createuserid == wx.getStorageSync('userMsg').userid;
 
             if (this.data.isAdmin) tabbarList = [{

+ 68 - 8
packageA/project/detail.js

@@ -41,10 +41,7 @@ Page({
             label: "任务",
             num: 132
         }],
-        tabbarList: [{
-            icon: "icon-genjin",
-            label: "跟进"
-        }],
+        tabbarList: [],
     },
     onLoad(options) {
         this.setData({
@@ -56,6 +53,7 @@ Page({
         _Http.basic({
             "id": 20221021103902,
             "content": {
+                nocache: true,
                 "sa_projectid": this.data.sa_projectid
             },
         }).then(res => {
@@ -64,10 +62,11 @@ Page({
                 title: res.data,
                 icon: "none"
             });
-
-
             let isLeader = res.data.leader.some(some => some.userid == wx.getStorageSync('userMsg').userid),
-                tabbarList = this.data.tabbarList;
+                tabbarList = [{
+                    icon: "icon-genjin",
+                    label: "跟进"
+                }];
 
             if (this.data.isAdmin) tabbarList = [{
                 icon: "icon-genjin",
@@ -82,7 +81,13 @@ Page({
             }, {
                 icon: "icon-genjin",
                 label: "提交报备"
-            }, , {
+            }, {
+                icon: "icon-dibu-jieshu",
+                label: "结束"
+            }, {
+                icon: "icon-dibu-chehui",
+                label: "恢复"
+            }, {
                 icon: "icon-zhuanyi",
                 label: "更换负责人"
             }, {
@@ -201,6 +206,61 @@ Page({
         let data = this.data.detail,
             that = this;
         switch (detail.label) {
+            case "结束":
+                if (data.status != '跟进中') return wx.showToast({
+                    title: '当前状态不可结束',
+                    icon: "none"
+                });
+
+                wx.showModal({
+                    title: '提示',
+                    content: '是否确认结束项目',
+                    complete: ({
+                        confirm
+                    }) => {
+                        if (confirm) _Http.basic({
+                            "id": 20221215163702,
+                            "content": {
+                                "sa_projectid": data.sa_projectid
+                            }
+                        }).then(res => {
+                            console.log('结束', res)
+                            wx.showToast({
+                                title: res.msg == '成功' ? '已结束' : res.msg,
+                                icon: "none"
+                            });
+                            if (res.msg == '成功') setTimeout(this.getDetail, 300);
+                        })
+                    }
+                })
+                break;
+            case "恢复":
+                if (data.status != '已失败') return wx.showToast({
+                    title: '失败项目才可恢复!',
+                    icon: "none"
+                });
+                wx.showModal({
+                    title: '提示',
+                    content: '是否确认恢复项目',
+                    complete: ({
+                        confirm
+                    }) => {
+                        if (confirm) _Http.basic({
+                            "id": 20221215164002,
+                            "content": {
+                                "sa_projectid": data.sa_projectid
+                            }
+                        }).then(res => {
+                            console.log('恢复', res)
+                            wx.showToast({
+                                title: res.msg == '成功' ? '已恢复' : res.msg,
+                                icon: "none"
+                            });
+                            if (res.msg == '成功') setTimeout(this.getDetail, 300);
+                        })
+                    }
+                })
+                break;
             case "提交报备":
                 wx.showModal({
                     title: '提示',

+ 8 - 8
packageA/publicCustomer/detail.js

@@ -35,13 +35,7 @@ Page({
         }],
         list1: [], //基本信息
         list2: [], //系统信息
-        tabbarList: [{
-            icon: "icon-paixushaixuanxuanzhong",
-            label: "领取"
-        }, {
-            icon: "icon-genjin",
-            label: "跟进"
-        }]
+        tabbarList: []
     },
     onLoad(options) {
         this.setData({
@@ -270,7 +264,13 @@ Page({
                 console.log("负责人", s)
                 let userList = s.data.map(user => user.team[0]),
                     isLeader = userList.some(some => some.userid == wx.getStorageSync('userMsg').userid),
-                    tabbarList = this.data.tabbarList;
+                    tabbarList = [{
+                        icon: "icon-paixushaixuanxuanzhong",
+                        label: "领取"
+                    }, {
+                        icon: "icon-genjin",
+                        label: "跟进"
+                    }];
                 if (isLeader || this.data.isAdmin) tabbarList = tabbarList.concat([{
                     icon: "icon-bianji",
                     label: "编辑"

+ 5 - 3
packageA/select/contacts/select.js

@@ -12,8 +12,10 @@ Page({
             let item = JSON.parse(options.item);
             this.setData({
                 item,
+                radio: item.radio ? true : false,
                 params: item.params,
-                result: item.value.length ? item.value[1] : []
+                idName: item.params.idname ? item.params.idname : this.data.idName,
+                result: item.value.length ? item.value[1].map(v => v + "") : []
             })
         };
         if (options.params) this.setData({
@@ -22,7 +24,7 @@ Page({
         if (options.idName) this.setData({
             idName: options.idName
         })
-        this.setData({
+        if (options.radio) this.setData({
             radio: options.radio ? true : false
         })
         this.getList();
@@ -58,7 +60,7 @@ Page({
     startSearch({
         detail
     }) {
-        let condition = this.data.content?this.data.content.where.condition:this.data.params.content.where.condition;
+        let condition = this.data.content ? this.data.content.where.condition : this.data.params.content.where.condition;
         if (detail == condition) return;
         this.setData({
             'content.where.condition': detail,

+ 9 - 7
packageA/setclient/detail.js

@@ -35,10 +35,7 @@ Page({
         }],
         list1: [], //基本信息
         list2: [], //系统信息
-        tabbarList: [{
-            icon: "icon-genjin",
-            label: "跟进"
-        }]
+        tabbarList: []
     },
     onLoad(options) {
         this.setData({
@@ -294,10 +291,13 @@ Page({
                 }
             }).then(s => {
                 console.log("负责人", s)
+                let tabbarList = [{
+                    icon: "icon-genjin",
+                    label: "跟进"
+                }];
                 if (s.data.length != 0) {
                     let userList = s.data.map(user => user.team[0]),
-                        isLeader = userList.some(some => some.userid == wx.getStorageSync('userMsg').userid),
-                        tabbarList = this.data.tabbarList;
+                        isLeader = userList.some(some => some.userid == wx.getStorageSync('userMsg').userid);
                     if (isLeader || this.data.isAdmin) tabbarList = [{
                         icon: "icon-bianji",
                         label: "编辑"
@@ -329,7 +329,6 @@ Page({
                     list[5].value = s.data.length > 0 ? '已分配' : '未分配';
                     this.setData({
                         isLeader,
-                        tabbarList,
                         principal: s.data,
                         list1: list,
                         briefs: this.data.briefs.concat([{
@@ -341,6 +340,9 @@ Page({
                         }])
                     });
                 }
+                this.setData({
+                    tabbarList,
+                })
             });
             //系统信息
             _Http.basic({

+ 86 - 27
packageA/work/add.js

@@ -24,6 +24,55 @@ Page({
             valueName: "remarks",
             checking: "base",
             required: false
+        }, {
+            label: "负责人",
+            error: false,
+            errMsg: "",
+            type: "route",
+            url: "/packageA/select/contacts/select",
+            model: "#Form",
+            value: "",
+            radio: true,
+            params: {
+                "id": "20221018122201",
+                idname: "userid",
+                "content": {
+                    "ownertable": "sys_task",
+                    "ownerid": 0,
+                    "where": {
+                        "condition": "",
+                        "withoutselect": 1
+                    }
+                }
+            },
+            placeholder: "选择任务负责人",
+            valueName: "principal",
+            checking: "base",
+            required: true
+        }, {
+            label: "参与人",
+            error: false,
+            errMsg: "",
+            type: "route",
+            url: "/packageA/select/contacts/select",
+            model: "#Form",
+            value: "",
+            params: {
+                "id": "20221018122201",
+                idname: "userid",
+                "content": {
+                    "ownertable": "sys_task",
+                    "ownerid": 0,
+                    "where": {
+                        "condition": "",
+                        "withoutselect": 1
+                    }
+                }
+            },
+            placeholder: "选择任务参与人",
+            valueName: "member",
+            checking: "base",
+            required: false
         }, {
             label: "开始日期",
             error: false,
@@ -36,6 +85,17 @@ Page({
             valueName: "starttime",
             checking: "base",
             required: true
+        }, {
+            label: "开始时间",
+            error: false,
+            errMsg: "",
+            type: "time",
+            value: "",
+            interrupt: true,
+            placeholder: "开始时间",
+            valueName: "starttime1",
+            checking: "base",
+            required: false
         }],
         "content": {
             "sys_taskid": 0,
@@ -47,23 +107,22 @@ Page({
         if (options.data) {
             let data = JSON.parse(options.data);
             console.log(data)
+            if (options.group) {
+                let group = JSON.parse(options.group)
+                let leader = group.findIndex(v => v.userid == data.leader[0].userid);
+                if (leader != -1) {
+                    data.principal = [group[leader].name, [group[leader].userid]]
+                    group.splice(leader, 1)
+                    data.member = [group.map(s => s.name), group.map(s => s.userid-0)]
+
+                }
+            }
             data.starttime1 = data.starttime.split(" ")[1]
             data.starttime = data.starttime.split(" ")[0]
             data.endtime1 = data.endtime ? data.endtime.split(" ")[1] : ""
             data.endtime = data.endtime ? data.endtime.split(" ")[0] : ""
 
             let form = this.data.form.concat([{
-                label: "开始时间",
-                error: false,
-                errMsg: "",
-                type: "time",
-                value: "00:00",
-                interrupt: true,
-                placeholder: "开始时间",
-                valueName: "starttime1",
-                checking: "base",
-                required: false
-            }, {
                 label: "截止日期",
                 error: false,
                 errMsg: "",
@@ -120,19 +179,6 @@ Page({
             form
         } = e.detail;
         if (data.label == '开始日期') {
-            let i = form.findIndex(v => v.label == '开始时间');
-            if (i == -1) form.push({
-                label: "开始时间",
-                error: false,
-                errMsg: "",
-                type: "time",
-                value: "00:00",
-                interrupt: true,
-                placeholder: "开始时间",
-                valueName: "starttime1",
-                checking: "base",
-                required: false
-            });
             let obj = {
                 label: "截止日期",
                 error: false,
@@ -190,6 +236,10 @@ Page({
         content.endtime = content.endtime + (content.endtime1 ? ' ' + content.endtime1 : "");
         delete(content.starttime1)
         delete(content.endtime1)
+        content.leaderuserid = content.principal[1][0];
+        let userids = content.member.length ? content.member[1] : "";
+        delete(content.principal)
+        delete(content.member)
         _Http.basic({
             "id": 20221211112101,
             content
@@ -199,12 +249,21 @@ Page({
                 title: res.msg == '成功' ? "保存成功" : res.msg,
                 icon: "none"
             });
+            _Http.basic({
+                "id": 20220930103601,
+                "content": {
+                    "ownertable": "sys_task",
+                    "ownerid": res.data.sys_taskid,
+                    "userids": userids,
+                    "justuserids": 1
+                }
+            }, false).then(e => {
+                console.log("设置团队", e)
+            })
             if (res.msg == '成功') setTimeout(() => {
                 getCurrentPages().forEach(v => {
                     if (v.__route__ == 'packageA/work/index') {
-                        console.log(555)
                         let index = v.data.list.findIndex(v => v.sys_taskid == res.data.sys_taskid);
-                        console.log(555)
                         if (index == -1) {
                             v.data.list.unshift(res.data)
                             v.setData({
@@ -235,7 +294,7 @@ Page({
                     if (p) p.getList(0, true);
                     wx.navigateBack();
                 }
-            }, 300);
+            }, 500);
         })
     },
     // 是否显示全部

+ 34 - 21
packageA/work/detail.js

@@ -17,16 +17,7 @@ Page({
             label: "附件",
             num: 132
         }],
-        tabbarList: [{
-            icon: "icon-genjin",
-            label: "跟进"
-        }, {
-            icon: "icon-guanlian-bianji",
-            label: "编辑"
-        }, {
-            icon: "icon-dibu-chengjiao",
-            label: "完成"
-        }],
+        tabbarList: [],
         confirmShow: false,
         finishnotes: "", //完成说明
     },
@@ -78,7 +69,28 @@ Page({
                 title: res.msg,
                 icon: "none"
             });
+
+            let isLeader = res.data.leader.some(v => v.userid == wx.getStorageSync('userMsg').userid),
+                isCreateby = res.data.createuserid == wx.getStorageSync('userMsg').userid,
+                tabbarList = [{
+                    icon: "icon-genjin",
+                    label: "跟进"
+                }];
+
+            if (isLeader) tabbarList = tabbarList.concat({
+                icon: "icon-guanlian-bianji",
+                label: "编辑"
+            }, {
+                icon: "icon-dibu-chengjiao",
+                label: "完成"
+            });
+            if (tabbarList.length == 1 && isCreateby) tabbarList.push({
+                icon: "icon-guanlian-bianji",
+                label: "编辑"
+            });
+
             this.setData({
+                tabbarList,
                 detail: res.data,
                 briefs: [{
                         label: "任务要求",
@@ -135,10 +147,6 @@ Page({
                 }]
             });
 
-            // createuserid
-
-            /*  */
-
 
 
             /* 更新列表中状态 */
@@ -154,12 +162,14 @@ Page({
             } else {
                 let pages = getCurrentPages(),
                     p = pages[pages.length - 2].selectComponent("#Work");
-                let index = p.data.list.findIndex(v => v.sys_taskid == res.data.sys_taskid);
-                if (index != -1) p.setData({
-                    [`list[${index}].status`]: res.data.status,
-                    [`list[${index}].title`]: res.data.title,
-                    [`list[${index}].remarks`]: res.data.remarks
-                })
+                if (p) {
+                    let index = p.data.list.findIndex(v => v.sys_taskid == res.data.sys_taskid);
+                    if (index != -1) p.setData({
+                        [`list[${index}].status`]: res.data.status,
+                        [`list[${index}].title`]: res.data.title,
+                        [`list[${index}].remarks`]: res.data.remarks
+                    })
+                }
             }
             this.getTags();
             this.getGroup();
@@ -231,9 +241,12 @@ Page({
     }) {
         switch (detail.label) {
             case "编辑":
+                let group = this.selectComponent("#Group").query();
                 wx.navigateTo({
-                    url: `/packageA/work/add?data=${JSON.stringify(this.data.detail)}`,
+                    url: `/packageA/work/add?data=${JSON.stringify(this.data.detail)}&group=${JSON.stringify(group)}`,
                 })
+
+
                 break;
             case "完成":
                 this.setData({

+ 12 - 15
packageA/work/index.js

@@ -1,6 +1,13 @@
 const _Http = getApp().globalData.http,
     getHeight = require("../../utils/getRheRemainingHeight");
 Page({
+    /* , {
+            label: "筛选",
+            icon: "icon-shaixuan",
+            color: "",
+            width: "",
+            id: "2"
+        } */
     data: {
         list: [],
         navList: [{
@@ -15,19 +22,13 @@ Page({
             color: "",
             width: "",
             id: "sort"
-        }, {
-            label: "筛选",
-            icon: "icon-shaixuan",
-            color: "",
-            width: "",
-            id: "2"
         }],
         content: {
             nocache: true,
-            "type": 0,
             "pageNumber": 1,
             "pageSize": 20,
             "isExport": 0,
+            "type": 0,
             "where": {
                 "condition": "",
                 "startdate": "",
@@ -56,8 +57,6 @@ Page({
             }
         ],
         filter: {
-            show: false,
-            status: ['潜在', '合作中', '已终止'],
             statusActive: "",
             startdate: "",
             enddate: ""
@@ -121,14 +120,12 @@ Page({
     getList(init = false) {
         //init 用于初始化分页
         if (init.detail != undefined) init = init.detail;
-        if (init) this.setData({
-            ['content.pageNumber']: 1
-        })
-        if (this.data.content.pageNumber > this.data.content.pageTotal) return;
-        console.log(this.data.content)
+        let content = this.data.content;
+        if (init) content.pageNumber = 1;
+        if (content.pageNumber > content.pageTotal) return;
         _Http.basic({
             "id": 20220901162901,
-            content: this.data.content
+            content
         }).then(res => {
             console.log("任务列表", res)
             this.selectComponent('#ListBox').RefreshToComplete();

+ 0 - 8
packageA/work/index.wxml

@@ -7,14 +7,6 @@
 <van-action-sheet show="{{ classShow }}" actions="{{ classActions }}" cancel-text="取消" bind:click-overlay='classClose' bind:cancel="classClose" bind:select="classSelect" />
 <!-- 筛选条件 -->
 <Yl_filtrate show="{{filter.show}}" bind:handle="handleFilter">
-    <view class="groud">
-        <view class="label">
-            合作状态
-        </view>
-        <view class="content">
-            <van-button custom-class='but {{filter.statusActive==item?"active":""}}' wx:for="{{filter.status}}" wx:key="item" bindtap="selectStatus" data-item="{{item}}">{{item}}</van-button>
-        </view>
-    </view>
     <view class="groud">
         <view class="label">
             筛选范围

+ 3 - 0
pages/group/modules/Yl-group/index.js

@@ -51,5 +51,8 @@ Component({
                 })
             }
         },
+        query() {
+            return this.data.list
+        }
     }
 })

+ 3 - 3
pages/tabbar/home/index.js

@@ -96,7 +96,7 @@ Page({
                         gridList.push({
                             name: "公海线索",
                             path: "/packageA/publicClue/index",
-                            icon: "icon-xiaochengxu_xiaoshoumubiao",
+                            icon: "icon-gonghaixiansuo",
                             apps: v.apps
                         })
                         break;
@@ -154,7 +154,7 @@ Page({
                                     if (value.meta.auth.some(r => r.option == 'read')) gridList.push({
                                         name: "竞争对手",
                                         path: "/packageA/opponent/index",
-                                        icon: "icon-xiaochengxutongxunlu",
+                                        icon: "icon-jingzhengduishou",
                                         apps: {}
                                     })
                                     getApp().globalData.auth.wcompetitor = {
@@ -218,7 +218,7 @@ Page({
                                         gridList.push({
                                             name: "市场活动",
                                             path: "/packageA/activity/index",
-                                            icon: "icon-xiaochengxutongxunlu",
+                                            icon: "icon-shichanghuodong",
                                             apps: {}
                                         })
                                     }

+ 8 - 2
project.config.json

@@ -1,7 +1,12 @@
 {
     "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
     "packOptions": {
-        "ignore": [],
+        "ignore": [
+            {
+                "value": "/minitest",
+                "type": "folder"
+            }
+        ],
         "include": []
     },
     "setting": {
@@ -58,5 +63,6 @@
     "editorSetting": {
         "tabIndent": "insertSpaces",
         "tabSize": 4
-    }
+    },
+    "testRoot": "minitest/"
 }

+ 7 - 0
project.private.config.json

@@ -91,6 +91,13 @@
                     "query": "",
                     "launchMode": "default",
                     "scene": null
+                },
+                {
+                    "name": "创建任务",
+                    "pathName": "packageA/work/add",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
                 }
             ]
         }

+ 33 - 1
static/font-icon.wxss

@@ -8,7 +8,39 @@
     -moz-osx-font-smoothing: grayscale;
 }
 
-.icon-kehu:before {
+.icon-gonghaixiansuo:before {
+    content: "\e6c6";
+  }
+  
+  .icon-jingzhengduishou:before {
+    content: "\e6c4";
+  }
+  
+  .icon-shichanghuodong:before {
+    content: "\e6c5";
+  }
+  
+  .icon-chakanshijuan:before {
+    content: "\e6c2";
+  }
+  
+  .icon-kaoshi:before {
+    content: "\e6c3";
+  }
+  
+  .icon-xuexizuji:before {
+    content: "\e6c0";
+  }
+  
+  .icon-kaoshixuexi:before {
+    content: "\e6c1";
+  }
+  
+  .icon-xiaoshouxiansuogenjinmoshi:before {
+    content: "\e6bf";
+  }
+  
+  .icon-kehu:before {
     content: "\e6ba";
   }
   

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
static/stylesheet.wxss


Некоторые файлы не были показаны из-за большого количества измененных файлов