Ver código fonte

居间合同

xiaohaizhao 1 ano atrás
pai
commit
b24196b6a4

+ 2 - 1
app.json

@@ -164,7 +164,8 @@
                 "contacts/modules/client/index",
                 "contacts/modules/project/index",
                 "offers/delete",
-                "contract/delete"
+                "contract/delete",
+                "contract/add/type4/select"
             ]
         }
     ],

+ 195 - 77
packageA/contract/add/type4/index.js

@@ -21,7 +21,7 @@ Page({
             checking: "base",
             required: true
         }, {
-            label: "居间服务商",
+            label: "居间商",
             error: false,
             errMsg: "",
             type: "route",
@@ -32,23 +32,22 @@ Page({
                 "content": {
                     "where": {
                         "condition": "",
-                        "type": 21,
+                        "type": 22,
                         typemx: "居间协议"
                     }
                 }
             },
-            interrupt: true,
             query: "&radio=true&idname=sys_enterpriseid&title=选择服务商",
-            placeholder: "选择居间服务商",
+            placeholder: "选择居间商",
             valueName: "sys_enterpriseid",
             checking: "base",
-            required: true
+            required: false
         }, {
-            label: "项目合同",
+            label: "合同",
             error: false,
             errMsg: "",
             type: "route",
-            url: "/packageA/select/contract/select",
+            url: "/packageA/contract/add/type4/select",
             value: "",
             params: {
                 "id": 20221217145402,
@@ -61,32 +60,10 @@ Page({
             },
             query: "&radio=true",
             interrupt: true,
-            placeholder: "选择项目合同",
+            placeholder: "选择合同",
             valueName: "ascription_contractid",
             checking: "base",
             required: true
-        }, {
-            label: "项目名称",
-            error: false,
-            errMsg: "",
-            type: "route",
-            url: "/packageA/select/project/select",
-            disabled: true,
-            value: "",
-            params: {
-                "id": 20221201090802,
-                "content": {
-                    "type": 3, //1直销 2经销 3居间
-                    nocache: true,
-                    "where": {
-                        "condition": "",
-                    }
-                }
-            },
-            placeholder: "项目名称",
-            valueName: "sa_projectid",
-            checking: "base",
-            required: true
         }, {
             label: "计算方式",
             error: false,
@@ -159,40 +136,93 @@ Page({
         if (options.data) {
             let data = JSON.parse(options.data);
             let form = this.data.form.map(v => {
-                if (v.valueName == "invaliddate") v.start = "";
-                v.value = data[v.valueName];
+                if (v.valueName == 'sys_enterpriseid') {
+                    v.value = data.sys_enterpriseid[1][0] ? data.sys_enterpriseid : ""
+                } else {
+                    if (v.valueName == "invaliddate") v.start = "";
+                    v.value = data[v.valueName];
+                }
                 return v
             });
+            let index = form.findIndex(v => v.label == '订单金额比例')
             if (data.radios == 1) {
-                form[5].label = '订单金额比例'
-                form[5].placeholder = '请填写订单金额比例'
-                form[5].valueName = 'orderratio'
-                form[5].value = data.orderratio == 1 ? 100 : (data.orderratio * 100).toFixed(2)
+                form[index].label = '订单金额比例'
+                form[index].placeholder = '请填写订单金额比例'
+                form[index].valueName = 'orderratio'
+                form[index].value = data.orderratio == 1 ? 100 : (data.orderratio * 100).toFixed(2)
             } else {
-                form[5].label = '居间产品折扣'
-                form[5].placeholder = '请填写居间产品折扣'
-                form[5].valueName = 'productdiscount'
-                form[5].value = data.productdiscount == 1 ? 100 : (data.productdiscount * 100).toFixed(2)
+                form[index].label = '居间产品折扣'
+                form[index].placeholder = '请填写居间产品折扣'
+                form[index].valueName = 'productdiscount'
+                form[index].value = data.productdiscount == 1 ? 100 : (data.productdiscount * 100).toFixed(2)
             }
-            form.splice(2, 0, {
+            let ywyParams = {
+                "id": 20230305201202,
+                "content": {
+                    nocache: true
+                },
+            }
+            if (data.projectname) {
+                //项目合同
+                ywyParams.content.sa_projectid = data.sa_projectid[1][0];
+                ywyParams.content.type = 2;
+                form.splice(3, 0, {
+                    label: "项目名称",
+                    error: false,
+                    errMsg: "",
+                    type: "route",
+                    url: "/packageA/select/project/select",
+                    disabled: true,
+                    value: data.sa_projectid,
+                    params: {
+                        "id": 20221201090802,
+                        "content": {
+                            "type": 3, //1直销 2经销 3居间
+                            nocache: true,
+                            "where": {
+                                "condition": "",
+                            }
+                        }
+                    },
+                    placeholder: "项目名称",
+                    valueName: "sa_projectid",
+                    checking: "base",
+                    required: false
+                })
+            } else {
+                //客户合同
+                ywyParams.content.sys_enterpriseid = data.ascription_enterpriseid;
+                ywyParams.content.type = 4;
+                form.splice(3, 0, {
+                    label: "客户名称",
+                    error: false,
+                    errMsg: "",
+                    type: "route",
+                    url: "/packageA/select/project/select",
+                    disabled: true,
+                    value: data.sys_enterpriseid1,
+                    params: {},
+                    placeholder: "客户名称",
+                    valueName: "sys_enterpriseid1",
+                    checking: "base",
+                    required: false,
+                    disabled: true,
+                })
+            }
+
+            form.splice(4, 0, {
                 label: "业务员",
                 error: false,
                 errMsg: "",
                 type: "route",
                 url: "/packageA/select/contacts/select",
                 value: [data.leader[0].name, [data.saler_hrid]],
-                params: {
-                    "id": 20230305201202,
-                    "content": {
-                        nocache: true,
-                        "type": "1",
-                        "sys_enterpriseid": data.sys_enterpriseid[1][0]
-                    },
-                },
+                params: ywyParams,
                 query: "&radio=true&idname=hrid",
                 placeholder: "选择业务员",
                 valueName: "saler_hrid",
                 checking: "base",
+                disabled: true,
                 required: true
             })
             this.setData({
@@ -201,22 +231,67 @@ Page({
                 "content.sa_contractid": data.sa_contractid
             })
         }
-        //项目进入 修改经销商选择范围
+        //项目进入 修改合同选择范围
         if (options.project) {
             let form = this.data.form,
                 project = JSON.parse(options.project);
             form[2].params = {
-                "id": 20220920083901,
+                "id": 20221217145402,
                 "content": {
+                    nocache: true,
                     "where": {
                         "condition": "",
-                        "type": 14,
-                        typemx: "居间协议",
                         "sa_projectid": project.sa_projectid
                     }
                 }
             };
-            form[3].value = [project.projectname, [project.sa_projectid]]
+            form.splice(3, 0, {
+                label: "项目名称",
+                error: false,
+                errMsg: "",
+                type: "route",
+                url: "/packageA/select/project/select",
+                disabled: true,
+                value: [project.projectname, [project.sa_projectid]],
+                params: {
+                    "id": 20221201090802,
+                    "content": {
+                        "type": 3, //1直销 2经销 3居间
+                        nocache: true,
+                        "where": {
+                            "condition": "",
+                        }
+                    }
+                },
+                placeholder: "项目名称",
+                valueName: "sa_projectid",
+                checking: "base",
+                required: false
+            })
+
+            form.splice(4, 0, {
+                label: "业务员",
+                error: false,
+                errMsg: "",
+                type: "route",
+                url: "/packageA/select/contacts/select",
+                value: [project.leader[0].name, [project.leader[0].hr.hrid]],
+                params: {
+                    "id": 20230305201202,
+                    "content": {
+                        nocache: true,
+                        type: 2,
+                        sa_projectid: project.sa_projectid,
+                    },
+                },
+                query: "&radio=true&idname=hrid",
+                placeholder: "选择业务员",
+                disabled: true,
+                valueName: "saler_hrid",
+                checking: "base",
+                required: true
+            })
+
             source = 1;
             this.setData({
                 form
@@ -230,7 +305,6 @@ Page({
             form,
             temporary
         } = e.detail;
-        console.log(data, form, temporary)
         form[temporary.index].value = data.value;
         if (temporary.item.label == '计算方式') {
             let index = form.findIndex(item => item.valueName == 'radios')
@@ -244,33 +318,78 @@ Page({
                 form[i].placeholder = '请填写居间产品折扣'
                 form[i].valueName = 'productdiscount'
             }
-
-        } else if (temporary.item.label == '项目合同') {
-            let index = form.findIndex(v => v.label == '项目名称');
-            if (index != -1 && source == 0) form[index].value = [data.item.projectname, [data.item.sa_projectid]]
+        } else if (temporary.item.label == '合同') {
+            let index = form.findIndex(v => v.label == '项目名称'),
+                item = data.item;
+            if (index != -1 && source == 0) form[index].value = [item.projectname, [item.sa_projectid]]
             form[temporary.index].value = data.value;
-            wx.navigateBack()
+            let ywyParams = {
+                "id": 20230305201202,
+                "content": {
+                    nocache: true,
+                },
+            };
+            if (item.projectname) {
+                //项目合同
+                ywyParams.content.sa_projectid = item.sa_projectid;
+                ywyParams.content.type = 2;
+                form.splice(3, form.some(v => v.label == '项目名称' || v.label == '客户名称') ? 1 : 0, {
+                    label: "项目名称",
+                    error: false,
+                    errMsg: "",
+                    type: "route",
+                    url: "/packageA/select/project/select",
+                    disabled: true,
+                    value: [item.projectname, [item.sa_projectid]],
+                    params: {
+                        "id": 20221201090802,
+                        "content": {
+                            "type": 3, //1直销 2经销 3居间
+                            nocache: true,
+                            "where": {
+                                "condition": "",
+                            }
+                        }
+                    },
+                    placeholder: "项目名称",
+                    valueName: "sa_projectid",
+                    checking: "base",
+                    required: false
+                })
+            } else {
+                //客户合同
+                ywyParams.content.sys_enterpriseid = item.sys_enterpriseid;
+                ywyParams.content.type = 4;
+                form.splice(3, form.some(v => v.label == '项目名称' || v.label == '客户名称') ? 1 : 0, {
+                    label: "客户名称",
+                    error: false,
+                    errMsg: "",
+                    type: "route",
+                    url: "/packageA/select/project/select",
+                    disabled: true,
+                    value: [item.enterprisename, [item.sys_enterpriseid]],
+                    params: {},
+                    placeholder: "客户名称",
+                    valueName: "sys_enterpriseid1",
+                    checking: "base",
+                    required: false,
+                    disabled: true,
+                })
 
-        } else if (temporary.item.label == '居间服务商') {
-            form.splice(2, form[2].label == '业务员' ? 1 : 0, {
+            }
+            form.splice(4, form.some(v => v.label == '业务员') ? 1 : 0, {
                 label: "业务员",
                 error: false,
                 errMsg: "",
                 type: "route",
                 url: "/packageA/select/contacts/select",
-                value: "",
-                params: {
-                    "id": 20230305201202,
-                    "content": {
-                        nocache: true,
-                        "type": "1",
-                        "sys_enterpriseid": data.id[0]
-                    },
-                },
+                value: [item.name, [item.hrid]],
+                params: ywyParams,
                 query: "&radio=true&idname=hrid",
                 placeholder: "选择业务员",
                 valueName: "saler_hrid",
                 checking: "base",
+                disabled: true,
                 required: true
             })
             wx.navigateBack()
@@ -295,13 +414,12 @@ Page({
         }
         content.begdate = content.invaliddate[0];
         content.enddate = content.invaliddate[1];
-        content.ascription_contractid = content.ascription_contractid[1] ? content.ascription_contractid[1][0] : 0;
-        content.sys_enterpriseid = content.sys_enterpriseid[1] ? content.sys_enterpriseid[1][0] : 0;
-        content.sa_projectid = content.sa_projectid[1] ? content.sa_projectid[1][0] : 0;
-        content.saler_hrid = content.saler_hrid[1] ? content.saler_hrid[1][0] : 0;
-        content.paytype = ""
+        content.ascription_contractid = content.ascription_contractid[1] ? content.ascription_contractid[1][0] : 0; //合同
+        content.sys_enterpriseid = content.sys_enterpriseid[1] ? content.sys_enterpriseid[1][0] : 0; //居间商
+        content.sa_projectid = content.sa_projectid ? content.sa_projectid[1][0] : 0; //项目合同
+        content.saler_hrid = content.saler_hrid[1] ? content.saler_hrid[1][0] : 0; //业务员
+        content.paytype = "";
         if (this.data.source) content.source = 1;
-        console.log(content)
         delete(content.invaliddate)
         _Http.basic({
             "id": 20221121185302,

+ 131 - 0
packageA/contract/add/type4/select.js

@@ -0,0 +1,131 @@
+const _Http = getApp().globalData.http;
+
+Page({
+    data: {
+        params: {}, //请求体
+        result: [], //返回结果
+        radio: false, //是否为单选
+        idname: "sa_contractid", //idkey
+        showName: "title", //表单用 显示名称
+        active: "项目合同",
+        showTabs: true
+    },
+    onLoad(options) {
+        if (options.params) {
+            let params = JSON.parse(options.params);
+            if (!params.content.pageNumber || !params.content.pageTotal) {
+                params.content.pageNumber = 1;
+                params.content.pageTotal = 1;
+            }
+            this.setData({
+                params,
+                showTabs: params.content.where.sa_projectid ? false : true
+            });
+        }
+        if (options.title) wx.setNavigationBarTitle({
+            title: options.title,
+        })
+        this.setData({
+            radio: options.radio ? true : false,
+            idname: options.idname || this.data.idname,
+            showName: options.showName || this.data.showName,
+            result: (!options.result || options.result == 'undefined') ? [] : JSON.parse(options.result)
+        });
+        this.getList()
+    },
+    onChange(e) {
+        this.setData({
+            active: e.detail.title
+        });
+        this.data.params.id = e.detail.title == '项目合同' ? 20221217145402 : 20240509112704;
+        this.getList(true)
+    },
+    getList(init = false) {
+        //init 用于初始化分页
+        if (init.detail != undefined) init = init.detail;
+        let params = this.data.params;
+        if (init) params.content.pageNumber = 1;
+        if (params.content.pageNumber > params.content.pageTotal) return;
+        _Http.basic(params).then(res => {
+            console.log("选择合同列表", res)
+            this.selectComponent('#ListBox').RefreshToComplete();
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            })
+            if (params.excludeid) res.data = res.data.filter(v => v[this.data.idname] != params.excludeid);
+            this.setData({
+                'params.content.pageNumber': res.pageNumber + 1,
+                'params.content.pageTotal': res.pageTotal,
+                'params.content.total': res.total,
+                list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
+            })
+        })
+    },
+    /* 删除项 */
+    deteleItem(id) {
+        this.setData({
+            list: this.data.list.filter(v => v[this.data.idname] != id),
+            "params.content.total": this.data.params.content.total - 1
+        })
+    },
+    /* 选中 */
+    changeResult(e) {
+        let {
+            id
+        } = e.currentTarget.dataset, result = this.data.result;
+        if (this.data.radio) {
+            result = [id];
+        } else {
+            result.some(v => v == id) ? result = result.filter(v => v != id) : result.push(id)
+        }
+        this.setData({
+            result
+        });
+        if (this.data.radio) this.submit();
+    },
+    /* 提交 */
+    submit() {
+        let result = this.data.result,
+            obj = this.data.radio ? {
+                id: result,
+                item: this.data.list.find(value => value[this.data.idname] == result),
+                value: [this.data.list.find(value => value[this.data.idname] == result)[this.data.showName], result]
+            } : {
+                result,
+                list: result.map(v => this.data.list.find(value => value[this.data.idname] == v)),
+                value: [result.map(v => {
+                    let data = this.data.list.find(value => value[this.data.idname] == v);
+                    return data ? data[this.data.showName] : ""
+                }), result]
+            }
+        getApp().globalData.handleSelect && getApp().globalData.handleSelect(obj)
+    },
+    /* 开始搜索 */
+    startSearch({
+        detail
+    }) {
+        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,
+            'params.content.where.condition': detail
+        });
+        this.getList(true);
+    },
+    /* 取消搜索 */
+    onClear() {
+        this.setData({
+            'content.where.condition': "",
+            'params.content.where.condition': ""
+        });
+        this.getList(true);
+    },
+    onReady() {
+        this.selectComponent("#ListBox").setHeight(".total", this);
+    },
+    onUnload() {
+        //回收数据
+        getApp().globalData.handleSelect = null;
+    }
+})

+ 4 - 0
packageA/contract/add/type4/select.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "选择合同"
+}

+ 106 - 0
packageA/contract/add/type4/select.scss

@@ -0,0 +1,106 @@
+.offer-list {
+	display: flex;
+	align-items: center;
+	width: 100%;
+	padding: 20rpx 30rpx;
+	box-sizing: border-box;
+	background-color: #fff;
+	border-bottom: 1rpx solid #ddd;
+	font-family: PingFang SC-Regular, PingFang SC;
+
+	.box {
+		.title {
+			position: relative;
+			display: flex;
+			height: 42rpx;
+			align-items: center;
+			font-size: 30rpx;
+			color: #333333;
+	
+		}
+
+		.tag-box {
+			display: flex;
+			align-items: center;
+			width: 100%;
+
+			.datatag,
+			.systemtag {
+				flex-shrink: 0;
+				margin-top: 6rpx;
+				background: #FAAB16;
+				color: #ffffff;
+				margin-right: 10rpx;
+				display: flex;
+				align-items: center;
+				height: 40rpx;
+				font-size: 20rpx;
+				padding: 0 10rpx;
+				border-radius: 20rpx;
+				font-family: PingFang SC-Regular, PingFang SC;
+			}
+
+			.systemtag {
+				background: #FA8C16;
+			}
+		}
+
+		.exp {
+			height: 34rpx;
+			font-size: 24rpx;
+			color: #666;
+			margin-top: 8rpx;
+
+			text {
+				color: #333333;
+			}
+		}
+	}
+
+
+}
+
+page {
+	height: 100vh;
+	overflow: hidden;
+}
+
+.total {
+	height: 60rpx;
+	line-height: 60rpx;
+	font-size: 24rpx;
+	font-family: PingFang SC-Regular, PingFang SC;
+	color: #666666;
+	padding-left: 30rpx;
+}
+
+.footer {
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	padding: 0 30rpx;
+	position: fixed;
+	width: 100vw;
+	height: 130rpx;
+	background: #FFFFFF;
+	box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+	bottom: 0;
+	box-sizing: border-box;
+
+	.count {
+		font-size: 28rpx;
+		font-family: PingFang SC-Regular, PingFang SC;
+		color: #333333;
+	}
+
+	.but {
+		width: 156rpx;
+		height: 90rpx;
+		background: #3874F6;
+		border-radius: 8rpx;
+		font-size: 28rpx;
+		font-family: PingFang SC-Bold, PingFang SC;
+		font-weight: bold;
+		color: #FFFFFF;
+	}
+}

+ 61 - 0
packageA/contract/add/type4/select.wxml

@@ -0,0 +1,61 @@
+<van-tabs wx:if="{{showTabs}}" active="{{ active }}" color='#3874F6' title-active-color='#3874F6' bind:change="onChange">
+    <van-tab title="项目合同" />
+    <van-tab title="客户合同" />
+</van-tabs>
+<van-search class="search" value="{{ params.content.where.condition }}" shape="round" placeholder="请输入搜索关键词" bind:search='startSearch' bind:clear='onClear' />
+<Yl_ListBox id='ListBox' bind:getlist='getList'>
+    <view class="total">共{{params.content.total}}个</view>
+    <navigator class="offer-list" url="#" wx:for="{{list}}" wx:key="index" data-id="{{item[idname]}}" bindtap="changeResult">
+        <van-checkbox wx:if="{{!radio}}" value="{{ handle.isCheck(item[idname],result) }}" shape="square" icon-size='28rpx' />
+        <view class="box">
+            <view class="title line-1">
+                {{item.title||'--'}}
+            </view>
+            <view class="exp line-1">合同编号:<text>{{item.billno||' --'}}</text></view>
+            <view class="exp line-1">合同类型:<text>{{active}}</text></view>
+            <view wx:if="{{active=='项目合同'}}" class="exp line-1">项目名称:<text>{{item.projectname||' --'}}</text></view>
+            <view wx:else class="exp line-1">客户名称:<text>{{item.enterprisename||' --'}}</text></view>
+            <view class="exp line-1">负责人:<text>{{item.name||' --'}}</text></view>
+        </view>
+    </navigator>
+    <view style="height: 230rpx;" />
+    <My_empty wx:if="{{!list.length}}" />
+</Yl_ListBox>
+
+<block wx:if="{{!radio}}">
+    <view style="height: 130rpx;" />
+    <view class="footer">
+        <view class="count">
+            已选:{{result.length}}
+        </view>
+        <van-button custom-class='but' disabled='{{result.length==0}}' bind:click="submit">添加</van-button>
+    </view>
+</block>
+
+<wxs module="handle">
+    module.exports = {
+        isCheck: function (id, list) {
+            return list.some(function (v) {
+                return v == id
+            });
+        },
+        getType: function (type) {
+            var result = "";
+            switch (type) {
+                case "框架":
+                    result = '经销商合作协议'
+                    break;
+                case "工具借用":
+                    result = '工具使用(借用)协议'
+                    break;
+                case "居间":
+                    result = '居间协议'
+                    break;
+                default:
+                    result = '--'
+                    break;
+            };
+            return result;
+        }
+    }
+</wxs>

+ 31 - 6
packageA/contract/detail.js

@@ -94,6 +94,15 @@ Page({
                     break;
                 case "居间":
                     data.type = '居间协议'
+                    tabsList = tabsList.concat([{
+                        label: "产品明细折扣",
+                        icon: "icon-tabchanpin",
+                        model: '#PiscountProduct'
+                    }, {
+                        label: "产品类别折扣",
+                        icon: "icon-tabchanpinleibie",
+                        model: '#PiscountType'
+                    }]);
                     break;
                 case "项目":
                     data.type = data.typemx + '项目协议'
@@ -363,23 +372,27 @@ Page({
             switch (data.type) {
                 case "居间协议":
                     briefs.splice(2, 1, {
-                        label: "居间服务商",
+                        label: "居间商",
                         value: data.enterprisename
                     })
                     briefs.splice(3, 0, {
                         label: "项目",
                         value: data.projectname
                     })
+                    briefs.splice(4, 0, {
+                        label: "客户名称",
+                        value: data.ascription_enterprisename
+                    })
                     briefs.splice(4, 0, {
                         label: "项目编号",
                         value: data.projectnum
                     })
                     briefs.splice(5, 1, {
-                        label: data.calculatemodel == 1 ? '订单金额比例' : '产品折扣',
+                        label: data.calculatemodel == 1 ? '订单金额比例' : '居间产品折扣',
                         value: data.calculatemodel == 1 ? data.orderratio * 100 + '%' : data.productdiscount * 100 + '%'
                     })
                     briefs.splice(3, 0, {
-                        label: "项目合同",
+                        label: "合同",
                         value: data.ascription_title
                     })
                     briefs.splice(7, 0, {
@@ -387,17 +400,21 @@ Page({
                         value: data.begdate + "-" + data.enddate
                     })
                     list1.splice(3, 0, {
-                        label: "居间服务商",
+                        label: "居间商",
                         value: data.enterprisename
                     })
                     list1.splice(4, 0, {
-                        label: "项目合同",
+                        label: "合同",
                         value: data.ascription_title
                     })
                     list1.splice(5, 0, {
                         label: "项目",
                         value: data.projectname
                     })
+                    list1.splice(6, 0, {
+                        label: "客户名称",
+                        value: data.ascription_enterprisename
+                    })
                     list1.splice(6, 0, {
                         label: "项目编号",
                         value: data.projectnum
@@ -733,8 +750,16 @@ Page({
                 break;
 
             case "居间协议":
-                data.ascription_contractid = [data.ascription_title, [data.ascription_contractid]];
+                if (data.ascription_title) {
+                    //客户合同
+                    data.ascription_contractid = [data.title, [data.ascription_contractid]]
+                    data.sys_enterpriseid1 = [data.ascription_enterprisename, [data.ascription_enterpriseid]]
+                    console.log(data.sys_enterpriseid)
+                } else {
+
+                }
                 data.radios = data.calculatemodel + "";
+
                 type = "type4"
                 break;
             case "工具使用(借用)协议":

+ 1 - 1
packageA/contract/detail.wxml

@@ -14,7 +14,7 @@
     <Trace slot='跟进动态' id='Trace' ownertable='sa_contract' ownerid='{{detail.sa_contractid}}' />
     <Work slot='任务' id='Work' ownertable='sa_contract' ownerid='{{detail.sa_contractid}}' disabled="{{isAdmin||isLeader}}" />
 
-    <PiscountProduct wx:if="{{detail.type=='经销商合作协议'||detail.type=='直销客户合作协议'}}" slot='产品明细折扣' id='PiscountProduct' disabled="{{(isAdmin||isLeader)&&detail.status=='新建'}}" />
+    <PiscountProduct wx:if="{{detail.type=='经销商合作协议'||detail.type=='直销客户合作协议'||detail.type=='居间协议'}}" slot='产品明细折扣' id='PiscountProduct' disabled="{{(isAdmin||isLeader)&&detail.status=='新建'}}" />
     <Product wx:else slot='{{detail.type=="工具使用(借用)协议"?  "工具清单": "产品明细折扣"}}' synchronous='{{detail.type=="经销项目协议" && isLeader && detail.status=="新建"}}' disabled="{{(isAdmin||isLeader)&&detail.status=='新建'}}" id='Product' />
     <PiscountType slot='产品类别折扣' id='PiscountType' synchronous='{{detail.type=="经销项目协议" && isLeader && detail.status=="新建"}}' disabled="{{(isAdmin||isLeader)&&detail.status=='新建'}}" />
 

+ 2 - 0
packageA/contract/modules/discount/product/index.js

@@ -36,6 +36,7 @@ Component({
         getList(id, init) {
             let content = this.data.content;
             content.sa_contractid = id;
+            console.log("id", id)
             content.sys_enterpriseid = getCurrentPages().find(v => v.__route__ == 'packageA/contract/detail').data.detail.sys_enterpriseid;
             if (init) content.pageNumber = 1;
             _Http.basic({
@@ -80,6 +81,7 @@ Component({
                         sa_contractid: this.data.sa_contractid,
                         where: {
                             condition: "",
+                            istool: 0
                         }
                     }
                 })

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

@@ -74,7 +74,7 @@ Component({
         addType() {
             let page = getCurrentPages()[getCurrentPages().length - 1];
             if (page.route == 'packageA/contract/detail') {
-                if (page.data.detail.type == '经销商合作协议') {
+                if (page.data.detail.type == '经销商合作协议' || page.data.detail.type == '居间协议') {
                     wx.navigateTo({
                         url: '/packageA/contract/modules/discount/type/add/index?sa_contractid=' + this.data.sa_contractid
                     })

+ 21 - 0
project.private.config.json

@@ -8,6 +8,27 @@
     "condition": {
         "miniprogram": {
             "list": [
+                {
+                    "name": "项目详情",
+                    "pathName": "packageA/project/detail",
+                    "query": "id=1401",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "合同列表",
+                    "pathName": "packageA/contract/index",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "居间协议",
+                    "pathName": "packageA/contract/add/type4/index",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                },
                 {
                     "name": "销售管理",
                     "pathName": "packageA/saleAdmin/index",