Ver código fonte

同步协议

xiaohaizhao 2 anos atrás
pai
commit
cf1db9830e

+ 2 - 1
packageA/contract/detail.js

@@ -120,7 +120,8 @@ Page({
             };
             if (this.data.appAuth.isdatafollowup) tabsList.push({
                 label: "跟进动态",
-                icon: "icon-tabgenjindongtai1"
+                icon: "icon-tabgenjindongtai1",
+                model: "#Trace"
             })
             if (this.data.appAuth.istask) tabsList.push({
                 label: "任务",

+ 34 - 3
packageA/contract/modules/discount/product/index.js

@@ -9,10 +9,17 @@ let queue = [],
     downCounter = null;
 
 Component({
+    options: {
+        addGlobalClass: true
+    },
     properties: {
         disabled: {
             type: Boolean
         }, //禁用
+        isSync: { //居间同步
+            type: Boolean,
+            value: true
+        }
     },
     data: {
         sa_contractid: 0,
@@ -36,7 +43,7 @@ Component({
         getList(id, init) {
             let content = this.data.content;
             content.sa_contractid = id;
-            console.log("id", id)
+            this.data.sa_contractid = id;
             content.sys_enterpriseid = getCurrentPages().find(v => v.__route__ == 'packageA/contract/detail').data.detail.sys_enterpriseid;
             if (init) content.pageNumber = 1;
             _Http.basic({
@@ -65,8 +72,7 @@ Component({
                     "content.pageNumber": res.pageNumber + 1,
                     "content.pageSize": res.pageSize,
                     "content.pageTotal": res.pageTotal,
-                    "content.total": res.total,
-                    sa_contractid: id
+                    "content.total": res.total
                 })
             })
         },
@@ -198,6 +204,31 @@ Component({
                     }
                 });
             })
+        },
+        brokerSync() {
+            let that = this;
+            wx.showModal({
+                title: '同步协议',
+                content: '是否添加关联的项目或客户合同中的产品明细同步更新到列表',
+                complete: ({
+                    confirm
+                }) => {
+                    if (confirm) _Http.basic({
+                        "id": 20240518155604,
+                        "content": {
+                            "sa_contractid": that.data.sa_contractid
+                        },
+                    }).then(res => {
+                        console.log("同步", res)
+                        wx.showToast({
+                            title: res.msg == '成功' ? '同步成功' : res.msg,
+                            icon: "none"
+                        })
+                        if (res.msg != '成功') return
+                        that.getList(that.data.sa_contractid, true)
+                    })
+                }
+            })
         }
     }
 })

+ 3 - 0
packageA/contract/modules/discount/product/index.wxml

@@ -4,6 +4,9 @@
         <!-- <navigator url="#" class="but">
             <van-icon name="search" />
         </navigator> -->
+        <navigator wx:if="{{isSync && disabled}}" url="#" class="but" bindtap="brokerSync">
+            <text class="iconfont icon-tongbuhezuoxieyi" />
+        </navigator>
         <navigator wx:if="{{disabled}}" url="#" class="but" bindtap="addProduct">
             <van-icon name="plus" />
         </navigator>

+ 31 - 1
packageA/contract/modules/discount/type/index.js

@@ -17,6 +17,10 @@ Component({
         synchronous: {
             type: Boolean
         },
+        isSync: { //居间同步
+            type: Boolean,
+            value: true
+        }
     },
     data: {
         sa_contractid: 0,
@@ -113,6 +117,7 @@ Component({
             content.sa_contractid = id;
             content.sa_quotedpriceid = id;
             if (init) content.pageNumber = 1;
+            this.data.sa_contractid = id;
             _Http.basic({
                 "id": this.data.type == "合同" ? 20221124135602 : 20230219161403,
                 content
@@ -132,7 +137,6 @@ Component({
                     "content.pageSize": res.pageSize,
                     "content.pageTotal": res.pageTotal,
                     "content.total": res.total,
-                    sa_contractid: id,
                     sa_quotedpriceid: id,
                     idname: this.data.type == "合同" ? "sa_contract_itemsaleclassids" : "sa_quotedprice_itemclassids"
                 })
@@ -235,5 +239,31 @@ Component({
                 })
             })
         },
+        brokerSync() {
+            let that = this;
+            wx.showModal({
+                title: '同步协议',
+                content: '是否添加关联的项目或客户合同中的产品类别同步更新到列表',
+                complete: ({
+                    confirm
+                }) => {
+                    if (confirm) _Http.basic({
+                        "id": 20240518160504,
+                        "content": {
+                            "sa_contractid": that.data.sa_contractid
+                        },
+                    }).then(res => {
+                        console.log("同步", res)
+                        wx.showToast({
+                            title: res.msg == '成功' ? '同步成功' : res.msg,
+                            icon: "none"
+                        })
+                        if (res.msg != '成功') return
+                        that.getList(that.data.sa_contractid, true)
+                    })
+                }
+            })
+
+        }
     }
 })

+ 4 - 1
packageA/contract/modules/discount/type/index.wxml

@@ -1,7 +1,10 @@
 <view class="head">
     <view class="count">产品类型折扣</view>
     <view class="expand">
-        <navigator wx:if="{{synchronous}}" url="#" class="but" bindtap="openSynchronous">
+        <navigator wx:if="{{synchronous && disabled}}" url="#" class="but" bindtap="openSynchronous">
+            <text class="iconfont icon-tongbuhezuoxieyi" />
+        </navigator>
+        <navigator wx:if="{{isSync && disabled}}" url="#" class="but" bindtap="brokerSync">
             <text class="iconfont icon-tongbuhezuoxieyi" />
         </navigator>
         <navigator wx:if="{{disabled}}" url="#" class="but" bindtap="addType">

+ 7 - 0
project.private.config.json

@@ -8,6 +8,13 @@
     "condition": {
         "miniprogram": {
             "list": [
+                {
+                    "name": "居间协议同步协议",
+                    "pathName": "packageA/contract/detail",
+                    "query": "id=4966",
+                    "launchMode": "default",
+                    "scene": null
+                },
                 {
                     "name": "项目详情",
                     "pathName": "packageA/project/detail",