zhaoxiaohai hace 3 años
padre
commit
fc658993d8

+ 76 - 33
packageA/setclient/addAndEditor.js

@@ -8,16 +8,26 @@ Page({
         repetitionList: [],
         isSubmit: false,
         form: [{
-            label: "客户名称",
+            label: "客户(企业)",
             error: false,
             errMsg: "",
             type: "textarea",
             value: "",
-            placeholder: "企业全称",
+            placeholder: "客户(企业)名称",
             valueName: "enterprisename",
             checking: "base",
             slot: "info",
             required: true
+        }, {
+            label: "企业简称",
+            error: false,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "企业简称",
+            valueName: "abbreviation",
+            checking: "base",
+            required: false
         }, {
             label: "客户类型",
             error: false,
@@ -31,39 +41,43 @@ Page({
             checking: "base",
             required: true
         }, {
-            label: "客户来源",
+            label: "企业等级",
             error: false,
             errMsg: "",
-            type: "textarea",
+            type: "option",
+            optionNmae: "agentgrade",
+            optionType: "radio", //复选   radio 单选
             value: "",
-            placeholder: "客户来源",
-            valueName: "source",
+            placeholder: "企业等级",
+            valueName: "grade",
             checking: "base",
             required: false
         }, {
-            label: "客户等级",
+            label: "客户分类",
             error: false,
             errMsg: "",
             type: "option",
-            optionNmae: "agentgrade",
+            optionNmae: "customergrade",
             optionType: "radio", //复选   radio 单选
             value: "",
-            placeholder: "客户等级",
-            valueName: "grade",
+            placeholder: "客户分类",
+            valueName: "customergrade",
             checking: "base",
             required: false
         }, {
-            label: "企业简称",
+            label: "客户行业",
             error: false,
             errMsg: "",
-            type: "textarea",
+            type: "option", //自定义选择  配合预定接口
+            optionNmae: "industry", //选择类型
+            optionType: "checkbox", //复选   radio 单选
             value: "",
-            placeholder: "企业简称",
-            valueName: "abbreviation",
+            placeholder: "客户所属行业",
+            valueName: "industry",
             checking: "base",
             required: false
         }, {
-            label: "企业税号",
+            label: "税号",
             error: false,
             errMsg: "",
             type: "textarea",
@@ -83,15 +97,13 @@ Page({
             checking: "base",
             required: false
         }, {
-            label: "所属行业",
+            label: "电话",
             error: false,
             errMsg: "",
-            type: "option", //自定义选择  配合预定接口
-            optionNmae: "industry", //选择类型
-            optionType: "radio", //复选   radio 单选
+            type: "number",
             value: "",
-            placeholder: "企业所属行业",
-            valueName: "industry",
+            placeholder: "联系电话",
+            valueName: "telephone",
             checking: "base",
             required: false
         }, {
@@ -100,16 +112,16 @@ Page({
             errMsg: "",
             type: "region",
             value: [],
-            placeholder: "省/市/县",
+            placeholder: "所在地区",
             valueName: "region",
             required: false
         }, {
-            label: "企业地址",
+            label: "详细地址",
             error: false,
             errMsg: "",
             type: "textarea",
             value: "",
-            placeholder: "企业所在地址",
+            placeholder: "详细地址",
             valueName: "address",
             checking: "base",
             required: false
@@ -119,7 +131,6 @@ Page({
             errMsg: "",
             type: "route",
             url: "/packageA/select/setclient/select",
-            radio: true,
             value: "",
             params: {
                 id: 20221012164402,
@@ -127,9 +138,8 @@ Page({
                 content: {
                     nocache: true,
                     "type": 1,
-                    "pageNumber": 1,
-                    "pageSize": 20,
                     "isExport": 0,
+                    isend: 0,
                     "where": {
                         "condition": "",
                         "status": "", //状态
@@ -144,11 +154,45 @@ Page({
                     }]
                 },
             },
+            query: "&radio=true",
             placeholder: "选择上级企业",
             valueName: "parentid",
             checking: "base",
             required: false
+        }, {
+            label: "客户来源",
+            error: false,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "客户来源",
+            valueName: "source",
+            checking: "base",
+            required: false
         }],
+
+        /* {
+            label: "归属经销商",
+            error: false,
+            errMsg: "",
+            type: "route",
+            url: "/packageA/select/setclient/select",
+            value: "",
+            params: {
+                "id": 20230214162602,
+                "content": {
+                    "hrid": wx.getStorageSync('userMsg').hrid,
+                    "where": {
+                        "condition": ""
+                    }
+                },
+            },
+            query: "&radio=true&idname=sa_agentsid",
+            placeholder: "归属经销商",
+            valueName: "sa_agentsid",
+            checking: "base",
+            required: false
+        } */
         content: {
             "sa_customersid": 0, //新增是传0
             "parentid": 0, //上级客户ID,默认或没有上级的时候传0
@@ -341,12 +385,11 @@ Page({
     },
     handleSubmit(tag = false) {
         let data = this.selectComponent("#Form").submit();
-        if (data.region.length != 0) {
-            data.province = data.region[0]
-            data.city = data.region[1]
-            data.county = data.region[2]
-        };
-        if (data.parentid) data.parentid = data.parentid[1][0]
+        data.province = data.region[0] || "";
+        data.city = data.region[1] || "";
+        data.county = data.region[2] || "";
+        data.parentid = data.parentid[1] ? data.parentid[1][0] : 0;
+        // data.sa_agentsid = data.sa_agentsid[1] ? data.sa_agentsid[1][0] : 0;
         delete(data.region);
         _Http.basic({
             "id": 20221012163902,

+ 146 - 147
packageA/setclient/detail.js

@@ -2,10 +2,8 @@ const _Http = getApp().globalData.http;
 Page({
     data: {
         isLeader: false, //是否为负责人
-        tabsActive: 0, //tabs 选中项
+        tabsActive: 1, //tabs 选中项
         sa_customersid: 0,
-        detail: {}, //详情数据
-        briefs: [], //简介列表
         tabsList: [{
             label: "跟进动态",
             icon: "icon-tabgenjinjilu",
@@ -29,15 +27,21 @@ Page({
             label: "联系人",
             icon: "icon-tablianxiren",
             model: "#Contacts"
-
         }, {
             label: "报价单",
             icon: "icon-tabbaojiadan",
             model: "#Offers"
-
         }, {
-            label: "开票信息",
+            label: "合同",
+            icon: "icon-tabhetong",
+            model: "#Contract"
+        }, {
+            label: "账户余额",
             icon: "icon-tabkaipiaoxinxi",
+            model: "#Account"
+        }, {
+            label: "开票信息",
+            icon: "icon-tabbaojiadan",
             model: "#Financing"
         }, {
             label: "任务",
@@ -54,9 +58,6 @@ Page({
             icon: "icon-tabfujian1",
             model: "#Files"
         }],
-        list1: [], //基本信息
-        list2: [], //系统信息
-        tabbarList: []
     },
     onLoad(options) {
         this.setData({
@@ -236,150 +237,148 @@ Page({
                 title: res.data,
                 icon: "none"
             })
-            /* 摘要信息 */
-            let briefs = [{
-                label: "客户级别",
-                value: res.data.grade
-            }, {
-                label: "客户类型",
-                value: res.data.type
-            }, {
-                label: "上级企业",
-                value: res.data.superiorenterprisename
-            }];
-            /* 基本信息 */
-            let list1 = [{
-                label: "客户名称",
-                value: res.data.enterprisename
-            }, {
-                label: "客户编号",
-                value: res.data.sa_customersid
-            }, {
-                label: "客户级别",
-                value: res.data.grade
-            }, {
-                label: "客户类型",
-                value: res.data.type
-            }, {
-                label: "上级企业",
-                value: res.data.superiorenterprisename
-            }, {
-                label: "分配状态",
-                value: ""
-            }, {
-                label: "合作状态",
-                value: res.data.status
-            }, {
-                label: "成交次数",
-                value: res.data.contact_signnum
-            }, {
-                label: "来源",
-                value: res.data.source
-            }];
-            /* 系统信息 */
-            let list2 = [{
-                label: "创建人",
-                value: res.data.createby
-            }, {
-                label: "创建时间",
-                value: res.data.createdate
-            }, {
-                label: "成交状态",
-                value: res.data.tradingstatus
-            }];
-            this.setData({
-                detail: res.data,
-                briefs,
-                list1,
-                list2
-            });
-            //负责人
-            _Http.basic({
-                "id": 20220930103501,
-                "content": {
-                    "ownertable": "sa_customers",
-                    "ownerid": this.data.sa_customersid
-                }
-            }).then(s => {
-                console.log("负责人", s)
-                let tabbarList = [{
-                    icon: "icon-genjin",
-                    label: "跟进"
-                }];
-                if (s.data.length != 0) {
-                    let userList = s.data.map(user => user.team[0]),
-                        isLeader = userList.some(some => some.userid == wx.getStorageSync('userMsg').userid);
-                    if (isLeader || this.data.isAdmin) tabbarList = [{
-                        icon: "icon-bianji",
-                        label: "编辑"
-                    }, {
-                        icon: "icon-zhuanyi",
-                        label: "更换负责人"
-                    }, {
-                        icon: "icon-shanchu",
-                        label: "作废"
-                    }].concat(tabbarList);
-                    if (isLeader && res.data.ispublic == 1) tabbarList = tabbarList.concat([{
-                        icon: "icon-dibu-chehui",
-                        label: "退回"
-                    }]);
-                    if (isLeader) tabbarList.splice(0, 0, {
-                        icon: "icon-dibu-tuihui",
-                        label: "回收"
-                    })
-                    let list = list1.concat([{
-                        label: "负责人",
-                        value: s.data[0].teamleader[0].name
-                    }, {
-                        label: "负责人部门",
-                        value: s.data[0].teamleader[0].position
-                    }])
-                    list[5].value = s.data.length > 0 ? '已分配' : '未分配';
-                    this.setData({
-                        isLeader,
-                        principal: s.data,
-                        list1: list,
-                        briefs: this.data.briefs.concat([{
-                            label: "负责人",
-                            value: s.data[0].teamleader[0].name
-                        }, {
-                            label: "最近跟进时间",
-                            value: s.data[0].teamleader[0].changedate
-                        }])
-                    });
-                }
-                this.setData({
-                    tabbarList,
-                })
-            });
-            //系统信息
-            _Http.basic({
-                "id": 20221019091602,
-                "content": {
-                    "sa_customersid": this.data.sa_customersid
-                }
-            }).then(s => {
-                console.log("系统信息", s)
-                let list = this.data.list2.concat([{
-                    label: "最近编辑人",
-                    value: s.data.changeby
-                }, {
-                    label: "最近编辑时间",
-                    value: s.data.changedate
-                }, {
-                    label: "转手次数",
-                    value: s.data.changecount
-                }])
-                this.setData({
-                    list2: list
-                })
-            })
+            this.setPreview(res);
             //获取标签
             this.getTags();
             this.getGroup()
             this.partialRenewal();
         });
     },
+    setPreview(res) {
+        /* 摘要信息 */
+        let briefs = [{
+            label: "客户类型",
+            value: res.data.type
+        }, {
+            label: "企业等级",
+            value: res.data.grade
+        }, {
+            label: "上级企业",
+            value: res.data.superiorenterprisename
+        }, {
+            label: "负责人",
+            value: res.data.leader.map(v => v.name) || ""
+        }];
+
+        /* , {
+            label: "归属经销商",
+            value: res.data.agentname
+        } */
+        /* 基本信息 */
+        let list1 = [{
+            label: "客户名称",
+            value: res.data.enterprisename
+        }, {
+            label: "客户编号",
+            value: res.data.sa_customersid
+        }, {
+            label: "企业简称",
+            value: res.data.abbreviation
+        }, {
+            label: "客户类型",
+            value: res.data.type
+        }, {
+            label: "企业等级",
+            value: res.data.grade
+        }, {
+            label: "客户分类",
+            value: res.data.customergrade
+        }, {
+            label: "客户行业",
+            value: res.data.industry
+        }, {
+            label: "税号",
+            value: res.data.taxno
+        }, {
+            label: "法人",
+            value: res.data.contact
+        }, {
+            label: "电话",
+            value: res.data.telephone
+        }, {
+            label: "省市县",
+            value: res.data.province ? [res.data.province, res.data.city, res.data.county] : ""
+        }, {
+            label: "详细地址",
+            value: res.data.address
+        }, {
+            label: "上级企业",
+            value: res.data.superiorenterprisename
+        }, {
+            label: "客户来源",
+            value: res.data.source
+        }, {
+            label: "来源公海",
+            value: res.data.sourcepoolname
+        }, {
+            label: "成交状态",
+            value: res.data.tradingstatus
+        }, {
+            label: "成交次数",
+            value: res.data.contact_signnum
+        }, {
+            label: "合作状态",
+            value: res.data.status
+        }, {
+            label: "负责人",
+            value: res.data.leader.map(v => v.name) || ""
+        }];
+        /* , {
+            label: "归属经销商",
+            value: res.data.agentname
+        } */
+        /* 系统信息 */
+        let 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.deletereason
+        }, {
+            label: "转手次数",
+            value: res.data.leader[0] ? res.data.leader[0].leadernum : 0
+        }];
+        /* 底部功能 */
+        let isAdmin = this.data.isAdmin,
+            isLeader = res.data.leader.some(some => some.userid == wx.getStorageSync('userMsg').userid),
+            tabbarList = [];
+        //负责人或管理员基础功能
+        if (isLeader || isAdmin) tabbarList = [{
+            icon: "icon-bianji",
+            label: "编辑"
+        }, {
+            icon: "icon-zhuanyi",
+            label: "更换负责人"
+        }, {
+            icon: "icon-shanchu",
+            label: "作废"
+        }];
+        //来自公海+负责人 可以退回/回收
+        if (isLeader && res.data.ispublic == 1) tabbarList = tabbarList.concat([{
+            icon: "icon-dibu-chehui",
+            label: "回收"
+        }, {
+            icon: "icon-dibu-chehui",
+            label: "退回"
+        }])
+        this.setData({
+            detail: res.data,
+            briefs,
+            list1,
+            list2,
+            tabbarList,
+            isLeader
+        });
+    },
     //tabs 切换
     tabsChange({
         detail

+ 3 - 1
packageA/setclient/detail.json

@@ -11,7 +11,9 @@
         "Work": "/packageA/public/work/index",
         "Record": "/packageA/public/record/index",
         "Files": "/packageA/public/files/index",
-        "Project": "./modules/project/index"
+        "Project": "./modules/project/index",
+        "Account": "./modules/account/index",
+        "Contract":"./modules/contract/index"
     },
     "navigationBarTitleText": "客户详情"
 }

+ 2 - 0
packageA/setclient/detail.wxml

@@ -29,6 +29,8 @@
     <Address slot='客户地址' id='Address' disabled="{{per.query(options,'address')||isAdmin||isLeader}}" />
     <Contacts slot='联系人' id='Contacts' disabled="{{per.query(options,'contact')||isAdmin||isLeader}}" path='/packageA/setclient/modules/contacts/quickly/index' />
     <Offers slot='报价单' id='Offers' disabled="{{per.query(options,'offer')||isAdmin||isLeader}}" />
+    <Contract slot='合同' id='Contract' />
+    <Account slot='账户余额' id='Account' />
     <Financing slot='开票信息' id="Financing" disabled="{{per.query(options,'invoice')||isAdmin||isLeader}}" />
     <Record slot="操作" id="Record" ownertable='sa_customers' ownerid='{{detail.sa_customersid}}' />
     <Files slot="附件" id="Files" ownertable='sa_customers' ownerid='{{detail.sa_customersid}}' />

+ 1 - 0
packageA/setclient/index.js

@@ -21,6 +21,7 @@ Page({
             id: "2"
         }],
         content: {
+            isend: 0,
             nocache: true,
             "type": 1,
             deleted: 0,

+ 1 - 0
packageA/setclient/index.wxml

@@ -2,6 +2,7 @@
 <view class="total">共{{content.total}}个</view>
 <Yl_ListBox id='ListBox' bind:getlist='getList'>
     <list list='{{list}}' />
+    <view style="height: 40px;" />
 </Yl_ListBox>
 <!-- 显示类型 -->
 <van-action-sheet show="{{ classShow }}" actions="{{ classActions }}" cancel-text="取消" bind:click-overlay='classClose' bind:cancel="classClose" bind:select="classSelect" />