瀏覽代碼

修改bug

zhaoxiaohai 3 年之前
父節點
當前提交
bd78c26d47

+ 6 - 3
packageA/contract/add/submit.js

@@ -9,10 +9,13 @@ module.exports = {
                 page = pages[pages.length - 2]
             if (page.__route__ == 'packageA/contract/index') {
                 page.getList(true);
-                wx.redirectTo({
-                    url: `/packageA/contract/detail?sa_contractid=${res.data.sa_contractid}`,
-                })
+            } else if (page.__route__ == 'packageA/project/detail') {
+                let p = page.selectComponent("#Contract");
+                if (p) p.getList(p.data.sa_projectid, true);
             }
+            wx.redirectTo({
+                url: `/packageA/contract/detail?sa_contractid=${res.data.sa_contractid}`,
+            })
         }, 500)
     }
 }

+ 5 - 0
packageA/contract/add/type2/index.js

@@ -118,6 +118,11 @@ Page({
                 })
             })
         }
+        if (options.project) {
+            this.setData({
+                "form[2].value": JSON.parse(options.project)
+            })
+        };                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
     },
     /* 打断处理form */
     interrupt(e) {

+ 6 - 1
packageA/contract/add/type3/index.js

@@ -119,7 +119,12 @@ Page({
                     return v
                 })
             })
-        }
+        };
+        if (options.project) {
+            this.setData({
+                "form[2].value": JSON.parse(options.project)
+            })
+        };
     },
     /* 打断处理form */
     interrupt(e) {

+ 6 - 0
packageA/contract/add/type4/index.js

@@ -170,6 +170,12 @@ Page({
                 })
             })
         }
+
+        if (options.project) {
+            this.setData({
+                "form[3].value": JSON.parse(options.project)
+            })
+        };
     },
     /* 打断处理form */
     interrupt(e) {

+ 0 - 3
packageA/contract/detail.js

@@ -105,9 +105,6 @@ Page({
                     }]);
                     tabsActive = 1;
                     break;
-                default:
-                    result = '--'
-                    break;
             };
             tabsList.push({
                 label: "任务",

+ 7 - 1
packageA/project/detail.js

@@ -11,7 +11,7 @@ Page({
             label: "项目评估",
             num: 132
         }, {
-            label: "跟进动态",
+            label: "合同",
             num: 132
         }, {
             label: "关联客户",
@@ -28,6 +28,9 @@ Page({
         }, {
             label: "联系人",
             num: 132
+        }, {
+            label: "跟进动态",
+            num: 132
         }, {
             label: "附件",
             num: 132
@@ -347,6 +350,9 @@ Page({
             case "任务":
                 model = "#Work"
                 break;
+            case "合同":
+                model = "#Contract"
+                break;
             case "跟进动态":
                 model = "#Trace"
                 break;

+ 2 - 1
packageA/project/detail.json

@@ -11,7 +11,8 @@
         "Record": "/packageA/public/record/index",
         "Files": "/packageA/public/files/index",
         "Opponent": "./modules/opponent/index",
-        "Work": "/packageA/public/work/index"
+        "Work": "/packageA/public/work/index",
+        "Contract": "./modules/contract/index"
     },
     "navigationBarTitleText": "项目详情"
 }

+ 1 - 0
packageA/project/detail.wxml

@@ -16,6 +16,7 @@
     <Trace slot='跟进动态' id='Trace' ownertable='sa_project' ownerid='{{detail.sa_projectid}}' />
     <Work slot='任务' id='Work' ownertable='sa_project' ownerid='{{detail.sa_projectid}}' disabled="{{isAdmin||isLeader}}" />
     <Task slot='项目评估' id='Task' disabled="{{per.query(options,'assess')||isAdmin||isLeader}}" />
+    <Contract slot='合同' id='Contract' disabled="{{per.query(options,'assess')||isAdmin||isLeader}}" />
     <Treaty slot='关联客户' disabled="{{per.query(options,'client')||isAdmin||isLeader}}" id='Treaty' />
     <Product slot='产品配置单' disabled="{{per.query(options,'product')||isAdmin||isLeader}}" id='Product' />
     <Contacts slot='联系人' disabled="{{per.query(options,'contacts')||isAdmin||isLeader}}" id='Contacts' />

+ 84 - 0
packageA/project/modules/contract/index.js

@@ -0,0 +1,84 @@
+const _Http = getApp().globalData.http;
+Component({
+    properties: {
+        sa_projectid: String,
+        disabled: Boolean
+    },
+    data: {
+        typeShow: false,
+        typeList: [{
+            name: '项目协议',
+            route: 'type2'
+        }, {
+            name: '居间协议',
+            route: 'type4'
+        }],
+        "sa_projectid": 1,
+        "content": {
+            "nocache": true,
+            "sa_projectid": 1,
+            pageNumbe: 1,
+            pageTotal: 1,
+            total: null,
+            "where": {
+                "conditino": ""
+            }
+        }
+    },
+    methods: {
+        /* 获取地址列表 */
+        getList(id, init) {
+            let content = this.data.content;
+            content.sa_projectid = id;
+            if (init) content.pageNumber = 1
+            _Http.basic({
+                "id": "20221223102102",
+                content
+            }).then(res => {
+                console.log("关联联系人列表", res)
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                })
+                this.setData({
+                    list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+                    "content.pageNumber": res.pageNumber + 1,
+                    "content.pageSize": res.pageSize,
+                    "content.pageTotal": res.pageTotal,
+                    "content.sa_projectid": id,
+                    "content.total": res.total,
+                    sa_projectid: id,
+                })
+            })
+        },
+        /* 修改总数 */
+        changeTotal() {
+            this.setData({
+                "content.total": this.data.content.total - 1
+            })
+        },
+        /* 去添加 */
+        openType() {
+            this.setData({
+                typeShow: true
+            })
+        },
+        typeCancel() {
+            this.setData({
+                typeShow: false
+            })
+        },
+        /* 选择添加报价形式 */
+        typeSelect({
+            detail
+        }) {
+            let type = 'type4';
+            let page = getCurrentPages()[getCurrentPages().length - 1];
+            if (detail.name != '居间协议') type = page.selectComponent("#Tags").data.datatag.some(v => v == '直销') ? 'type3' : 'type2';
+            wx.navigateTo({
+                url: `/packageA/contract/add/${type}/index?project=${JSON.stringify([page.data.detail.projectname,[page.data.detail.sa_projectid]])}`,
+            })
+            this.typeCancel();
+        },
+    }
+})

+ 6 - 0
packageA/project/modules/contract/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "List": "/packageA/contract/modules/list/index"
+    }
+}

+ 1 - 0
packageA/project/modules/contract/index.scss

@@ -0,0 +1 @@
+@import "../../../setclient/modules/address/head.scss";

+ 14 - 0
packageA/project/modules/contract/index.wxml

@@ -0,0 +1,14 @@
+<view class="head">
+    <view class="count">总共{{content.total}}个</view>
+    <view class="expand">
+        <!-- <navigator url="/packageA/project/modules/contacts/quickly/index?sa_projectid={{sa_projectid}}" class="but" bindtap="toSearch">
+            <van-icon name="search" />
+        </navigator> -->
+        <navigator wx:if="{{disabled}}" url="#" class="but" bindtap="openType">
+            <van-icon name="plus" />
+        </navigator>
+    </view>
+</view>
+<List list='{{list}}' disabled="{{disabled}}" bindchangeTotal="changeTotal" />
+
+<van-action-sheet show="{{ typeShow }}" actions="{{ typeList }}" z-index='99999' cancel-text="取消" bind:cancel='typeCancel' bind:select='typeSelect' />

+ 1 - 1
packageA/publicClue/addClue.js

@@ -165,7 +165,7 @@ Page({
         let item = detail;
         this.setData({
             [`form[0].value`]: item.companyName,
-            [`form[5].value`]: item.address,
+            [`form[4].value`]: item.address,
             [`form[3].value`]: [item.regProvince, item.regCity, item.regArea],
         })
     },

+ 1 - 1
packageA/saleClue/addClue.js

@@ -154,7 +154,7 @@ Page({
         let item = detail;
         this.setData({
             [`form[0].value`]: item.companyName,
-            [`form[5].value`]: item.address,
+            [`form[4].value`]: item.address,
             [`form[3].value`]: [item.regProvince, item.regCity, item.regArea],
         })
     },