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

+ 5 - 5
packageA/project/detail.js

@@ -1,7 +1,7 @@
 const _Http = getApp().globalData.http;
 Page({
     data: {
-        tabsActive: 3, //tabs 选中项
+        tabsActive: 1, //tabs 选中项
         sa_projectid: "",
         tabsList: [{
             label: "详细信息",
@@ -62,7 +62,6 @@ Page({
             },
         }).then(res => {
             console.log("项目商机详情", res)
-
             if (res.msg != '成功') return wx.showToast({
                 title: res.data,
                 icon: "none"
@@ -166,12 +165,10 @@ Page({
                     value: res.data.reportcheckdate
                 }]
             })
-
             this.getTags();
             this.getGroup();
-
             this.partialRenewal();
-            this.selectComponent("#Task").getList();
+            this.selectComponent("#TaskTabs").getList();
         })
     },
     /* 工作任务切换 */
@@ -246,6 +243,9 @@ Page({
             case "跟进动态":
                 model = "#Trace"
                 break;
+            case "工作任务":
+                model = "#Task"
+                break;
             case "关联客户":
                 model = "#Treaty"
                 break;

+ 2 - 2
packageA/project/detail.wxml

@@ -6,14 +6,14 @@
 <Yl_Detail list="{{briefs}}">
     <view slot='bottom'>
         <Yl-group id='Group' add ownertable='sa_project' ownerid='{{detail.sa_projectid}}' />
-        <TaskTabs id='Task' sa_projectid='{{detail.sa_projectid}}' sa_projstagetempid='{{detail.sa_projstagetempid}}' bindchangeCallBack="taskTabsChange" />
+        <TaskTabs id='TaskTabs' sa_projectid='{{detail.sa_projectid}}' sa_projstagetempid='{{detail.sa_projstagetempid}}' bindchangeCallBack="taskTabsChange" />
     </view>
 </Yl_Detail>
 <view style="height: 20rpx;" />
 
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
     <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
-    <Task slot='工作任务' />
+    <Task slot='工作任务' id='Task' />
     <Trace slot='跟进动态' id='Trace' ownertable='sa_project' ownerid='{{detail.sa_projectid}}' />
     <Treaty slot='关联客户' id='Treaty' />
     <Offers slot='报价单' id='Offers' />

+ 38 - 4
packageA/project/modules/task/index.js

@@ -1,11 +1,45 @@
 const _Http = getApp().globalData.http;
 Component({
-    properties: {
-        sa_projectid: String,
-        sa_projstagetempid: String
-    },
+    properties: {},
     data: {
+        sa_projectid: null,
+        "content": {
+            "isAll": 0,
+            "total": null
+        }
     },
     methods: {
+        getList(id, init) {
+            let content = this.data.content;
+            content.sa_projectid = id;
+            if (init) content.pageNumber = 1
+            _Http.basic({
+                "id": "20221201140104",
+                content
+            }).then(res => {
+                console.log("工作任务列表", res)
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                })
+                this.setData({
+                    list: res.data.rows,
+                    "content.total": res.data.sumscore,
+                    sa_projectid: id
+                })
+                console.log(this.data.sumscore,this.data.list)
+            })
+        },
+        onChange({
+            detail
+        }) {
+            this.setData({
+                "content.isAll": detail ? 1 : 0
+            });
+            this.getList(this.data.sa_projectid, true)
+        },
+        handleRoute(item, list){
+            console.log(item, list)
+        }
     }
 })

+ 2 - 1
packageA/project/modules/task/index.json

@@ -1,6 +1,7 @@
 {
     "component": true,
     "usingComponents": {
-        "List": "./list/index"
+        "List": "./list/index",
+        "van-switch": "@vant/weapp/switch/index"
     }
 }

+ 28 - 0
packageA/project/modules/task/index.scss

@@ -1,6 +1,34 @@
 .task-head {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
     width: 100vw;
     height: 74rpx;
     box-sizing: border-box;
     padding: 0 30rpx;
+    font-family: PingFang SC-Bold, PingFang SC;
+
+    .left {
+        font-size: 24rpx;
+        color: #333333;
+
+        text {
+            font-weight: bold;
+        }
+    }
+
+    .right {
+        .switch {
+            display: flex;
+            align-items: center;
+            font-size: 0;
+
+            text {
+                display: inline-block;
+                font-size: 28rpx;
+                color: #999999;
+                margin-right: 6rpx;
+            }
+        }
+    }
 }

+ 11 - 3
packageA/project/modules/task/index.wxml

@@ -1,5 +1,13 @@
 <view class="task-head">
-    <view>
-
+    <view class="left">
+        总分值:<text>{{content.total}}</text>
+    </view>
+    <view class="right">
+        <view class="switch">
+            <text>仅显示当前阶段任务</text>
+            <van-switch checked="{{ content.isAll==1 }}" active-color="#085CDF" size="40rpx" bind:change='onChange' />
+        </view>
     </view>
-</view>
+</view>
+
+<List list="{{list}}" />

+ 54 - 6
packageA/project/modules/task/list/index.js

@@ -1,18 +1,66 @@
+const _Http = getApp().globalData.http;
 Component({
     properties: {
-        list: Array,
-        isFollow: Boolean
+        list: Array
     },
     data: {
-
+        viewIndex: null
     },
     methods: {
-        toEdit(e) {
+        handleDetail(e) {
+            const {
+                index
+            } = e.currentTarget.dataset,
+                item = this.data.list[index],
+                pages = getCurrentPages(),
+                page = pages[pages.length - 1];
+            _Http.basic({
+                "id": 20221128144904,
+                "content": {
+                    "sa_projectid": page.data.detail.sa_projectid,
+                    "sa_projtaskmagid": item.sa_projtaskmagid,
+                    "sa_projstagemagid": item.sa_projtaskmagid || 0,
+                    "pageNumber": 1,
+                    "pageSize": 999
+                }
+            }).then(res => {
+                console.log(res)
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.msg,
+                    icon: "none"
+                });
+                this.setData({
+                    viewIndex: index == this.data.viewIndex ? null : index,
+                    workList: res.data
+                })
+            })
+
+
+        },
+        selectClient(e) {
             const {
                 item
-            } = e.currentTarget.dataset;
+            } = e.currentTarget.dataset,
+                pages = getCurrentPages(),
+                page = pages[pages.length - 1];
+            console.log(item)
             wx.navigateTo({
-                url: '/packageA/project/modules/task/add?data=' + JSON.stringify(item) + '&isFollow=' + this.data.isFollow
+                url: '/packageA/select/setclient/select?params=' + JSON.stringify({
+                    id: 20221129152204,
+                    model: "#Task",
+                    content: {
+                        nocache: true,
+                        sa_projectid: page.data.detail.sa_projectid,
+                        "sa_projtaskmagid": item.sa_projtaskmagid,
+                        pageNumber: 1,
+                        pageTotal: 1,
+                        pageSize: 20,
+                        total: null,
+                        where: {
+                            condition: "",
+                        }
+                    },
+                }),
             })
         },
     }

+ 1 - 0
packageA/project/modules/task/list/index.json

@@ -1,5 +1,6 @@
 {
     "component": true,
     "usingComponents": {
+        "van-transition": "@vant/weapp/transition/index"
     }
 }

+ 59 - 16
packageA/project/modules/task/list/index.scss

@@ -1,29 +1,72 @@
-.box {
+.task-item {
+    width: 100vw;
+    box-sizing: border-box;
     background-color: #fff;
     margin-bottom: 20rpx;
 
-    .item {
-        width: 100vw;
-        box-sizing: border-box;
+    .head {
+        display: flex;
         padding: 20rpx 30rpx;
-        font-size: 24rpx;
-        font-family: PingFang SC-Regular, PingFang SC;
-        color: #666666;
-        border-bottom: 2rpx solid #DDDDDD;
 
-        .title {
+        .left {
+            width: 80%;
+            font-size: 24rpx;
+            color: #333333;
+            line-height: 34rpx;
+            word-wrap: break-word;
+        }
+
+        .right {
+            text-align: right;
+            flex: 1;
+            height: 34rpx;
+            line-height: 34rpx;
+            font-size: 24rpx;
+            color: #3874F6;
+        }
+    }
+
+    .footer {
+        padding-left: 30rpx;
+        box-sizing: border-box;
+
+        .box {
             display: flex;
+            align-items: center;
+            justify-content: space-between;
+            height: 50rpx;
+            width: 100%;
+            box-sizing: border-box;
+            border-bottom: 1rpx solid #ddd;
+            padding-right: 40rpx;
+
+            .tag-box {
+                display: flex;
+                width: 90%;
+                height: 100%;
 
-            .line-1 {
-                flex: 1;
-                overflow: hidden;
-                white-space: nowrap;
-                text-overflow: ellipsis;
+                .tag {
+                    height: 40rpx;
+                    line-height: 40rpx;
+                    border-radius: 20rpx;
+                    background-color: #FAAB16;
+                    font-size: 20rpx;
+                    color: #FFFFFF;
+                    padding: 0 10rpx;
+                    margin-right: 10rpx;
+                }
             }
         }
+    }
+
 
-        .remarks{
-            margin-top: 20rpx;
+    .unfold {
+        .empty {
+            width: 100%;
+            text-align: center;
+            padding: 20rpx 0;
+            font-size: 24rpx;
+            color: #999;
         }
     }
 }

+ 26 - 10
packageA/project/modules/task/list/index.wxml

@@ -1,15 +1,31 @@
-<view class="box" wx:for="{{list}}" wx:key="item.sa_projstagetemp_workid">
-    <navigator class="item" url="#" data-item="{{item}}" bindtap="toEdit">
-        <view class="title">
-            <view class="line-1">
-                {{item.workname}}
-            </view>
-            <view wx:if="{{item.finished==1}}" style="color: #3874F6;">已完成</view>
-            <view wx:else style="color:{{isFollow?'#52C41A':'#999999'}};">{{isFollow?'跟进中':'未开始'}}</view>
+<view class="task-item" wx:for="{{list}}" wx:key="item.sa_projtaskmagid">
+    <navigator url="#" class="head" data-item="{{item}}" bindtap="selectClient">
+        <view class="left">
+            {{item.rowindex}}、{{item.taskname}}
+        </view>
+        <view class="right">
+            分值:{{item.sequence}}
         </view>
-        <view class="remarks">
-            任务:{{item.remarks}}
+    </navigator>
+
+    <navigator url="#" class="footer" data-index="{{index}}" bindtap="handleDetail">
+        <view class="box">
+            <view class="tag-box">
+                <view class="tag" wx:for="{{item.partiestype}}" wx:for-item="it" wx:key="index">{{it}}</view>
+            </view>
+            <van-icon wx:if="{{index == viewIndex}}" name="arrow-up" />
+            <van-icon wx:else name="arrow-down" />
         </view>
     </navigator>
+
+    <van-transition show="{{ index == viewIndex }}" custom-class="block">
+        <view class="unfold">
+            <view wx:if="{{workList.length==0}}" class="empty">
+                暂无数据
+            </view>
+        </view>
+    </van-transition>
 </view>
+
+
 <My_empty wx:if="{{list.length==0}}" />