Browse Source

项目详情

zhaoxiaohai 2 years ago
parent
commit
8a877a50f0
4 changed files with 239 additions and 0 deletions
  1. 201 0
      packageA/project/detail.js
  2. 8 0
      packageA/project/detail.json
  3. 14 0
      packageA/project/detail.scss
  4. 16 0
      packageA/project/detail.wxml

+ 201 - 0
packageA/project/detail.js

@@ -0,0 +1,201 @@
+const _Http = getApp().globalData.http;
+Page({
+    data: {
+        tabsActive: 1, //tabs 选中项
+        sa_projectid: "",
+        tabsList: [{
+            label: "详细信息",
+            num: 132
+        }, {
+            label: "阶段任务",
+            num: 132
+        }, {
+            label: "跟进动态",
+            num: 132
+        }],
+    },
+    onLoad(options) {
+        this.setData({
+            sa_projectid: options.sa_projectid
+        });
+        this.getDetail()
+    },
+    getDetail() {
+        _Http.basic({
+            "id": 20221021103902,
+            "content": {
+                "sa_projectid": this.data.sa_projectid
+            },
+        }).then(res => {
+            console.log("项目商机详情", res)
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            });
+
+            this.setData({
+                detail: res.data,
+                briefs: [{
+                    label: "项目编号",
+                    value: res.data.projectnum
+                }, {
+                    label: "项目地址",
+                    value: res.data.province + res.data.city + res.data.county + res.data.address
+                }, {
+                    label: "项目类型",
+                    value: res.data.projecttype
+                }, {
+                    label: "负责人",
+                    value: res.data.name
+                }, {
+                    label: "当前项目阶段",
+                    value: res.data.stagename
+                }, {
+                    label: "赢率",
+                    value: res.data.winrate
+                }, {
+                    label: "最近跟进时间",
+                    value: res.data.followdate
+                }],
+                list1: [{
+                    label: "项目名称",
+                    value: res.data.projectname
+                }, {
+                    label: "项目编号",
+                    value: res.data.projectnum
+                }, {
+                    label: "项目类型",
+                    value: res.data.projecttype
+                }, {
+                    label: "省市县",
+                    value: res.data.province ? res.data.province + res.data.city + res.data.county : ''
+                }, {
+                    label: "详细地址",
+                    value: res.data.address
+                }, {
+                    label: "项目等级",
+                    value: res.data.grade
+                }, {
+                    label: "当前阶段",
+                    value: res.data.stagename
+                }, {
+                    label: "项目报备时间",
+                    value: res.data.createdate
+                }, {
+                    label: "项目规模",
+                    value: res.data.scale
+                }, {
+                    label: "项目状态",
+                    value: res.data.status
+                }, {
+                    label: "项目预算",
+                    value: res.data.budgetary
+                }, {
+                    label: "预计签约金额",
+                    value: res.data.signamount_due
+                }, {
+                    label: "预计签约月份",
+                    value: res.data.signdate_due
+                }, {
+                    label: "赢率",
+                    value: res.data.winrate
+                }, {
+                    label: "负责人",
+                    value: res.data.name
+                }],
+                list2: [{
+                    label: "创建人",
+                    value: res.data.createby
+                }, {
+                    label: "创建时间",
+                    value: res.data.createdate
+                }, {
+                    label: "最近编辑人",
+                    value: res.data.changeby
+                }, {
+                    label: "最近编辑时间",
+                    value: res.data.changedate
+                }, {
+                    label: "最近跟进人",
+                    value: res.data.followby
+                }, {
+                    label: "最近跟进时间",
+                    value: res.data.followdate
+                }, {
+                    label: "转手次数",
+                    value: res.data.changecount
+                }, {
+                    label: "报备人",
+                    value: res.data.reportby
+                }, {
+                    label: "报备时间",
+                    value: res.data.reportdate
+                }, {
+                    label: "报备审核通过时间",
+                    value: res.data.reportcheckdate
+                }]
+            })
+
+            this.getTags();
+            this.getGroup();
+            this.partialRenewal();
+        })
+    },
+    //tabs 切换
+    tabsChange({
+        detail
+    }) {
+        this.setData({
+            tabsActive: detail
+        });
+        this.partialRenewal();
+    },
+    //更新标签
+    getTags() {
+        this.selectComponent("#Tags").getTags();
+    },
+    //更新团队成员
+    getGroup() {
+        this.selectComponent("#Group").getList();
+    },
+    //局部数据更新 tabs
+    partialRenewal(init = false) {
+        const id = this.data.detail.sa_projectid;
+        let model = '';
+        let name = this.data.tabsList[this.data.tabsActive].label;
+        switch (name) {
+            case "跟进动态":
+                model = "#Trace"
+                break;
+            case "地址管理":
+                model = "#Address"
+                break;
+            case "阶段任务":
+                model = '#Task'
+                break;
+        };
+        if (model) {
+            // 确定好模块ID total = null 是第一次加载 加载数据
+            // init是新增或修改需要清数据
+            let Component = this.selectComponent(model);
+            const {
+                total,
+                pageNumber,
+                pageTotal
+            } = Component.data.content;
+            if (total == null || init) {
+                Component.getList(id, init);
+            } else if (pageNumber <= pageTotal) {
+                Component.getList(id, false);
+            } else {
+                //用来判断 在搜索页面修改,与tabs选项不一致 但是切换到该选项 重置数据
+            }
+        }
+    },
+    onReachBottom() {
+        this.partialRenewal();
+    },
+    onShareAppMessage() {
+
+    }
+})

+ 8 - 0
packageA/project/detail.json

@@ -0,0 +1,8 @@
+{
+    "usingComponents": {
+        "Preview": "../setclient/modules/preview/index",
+        "Trace": "../setclient/modules/trace/index",
+        "Task": "./modules/task/index"
+    },
+    "navigationBarTitleText": "项目详情"
+}

+ 14 - 0
packageA/project/detail.scss

@@ -0,0 +1,14 @@
+.header {
+    background-color: #fff;
+    padding: 20rpx 30rpx 0rpx;
+    box-sizing: border-box;
+
+    .title {
+        height: 40rpx;
+        font-size: 28rpx;
+        font-family: PingFang SC-Bold, PingFang SC;
+        font-weight: bold;
+        color: #333333;
+        margin-bottom: 16rpx;
+    }
+}

+ 16 - 0
packageA/project/detail.wxml

@@ -0,0 +1,16 @@
+<view class="header">
+    <view class="title">{{detail.projectname}}</view>
+    <Yl-tags id="Tags" add ownertable='sa_project' ownerid='{{detail.sa_projectid}}' />
+</view>
+<!-- 简介 -->
+<Yl_Detail list="{{briefs}}">
+    <Yl-group id='Group' slot='bottom' add ownertable='sa_project' ownerid='{{detail.sa_projectid}}' />
+</Yl_Detail>
+<view style="height: 20rpx;" />
+
+<Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
+    <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
+    <Task slot='阶段任务' id='Task' sa_projectid='{{detail.sa_projectid}}' sa_projstagetempid='{{detail.sa_projstagetempid}}' />
+    <Trace slot='跟进动态' id='Trace' ownertable='sa_project' ownerid='{{detail.sa_projectid}}' />
+    <view style="height: 140rpx;" />
+</Yl_FunTabs>