Forráskód Böngészése

报价单增加业务员

xiaohaizhao 2 éve
szülő
commit
cff03a64da

+ 52 - 0
packageA/offers/addProjectOffer.js

@@ -114,6 +114,31 @@ Page({
                     checking: "base",
                     required: true
                 });
+                //业务员
+                form.splice(6, 0, {
+                    label: "业务员",
+                    error: false,
+                    errMsg: "",
+                    type: "route",
+                    url: "/packageA/select/contacts/select",
+                    value: "",
+                    params: {
+                        "id": "20230306144402",
+                        "content": {
+                            nocache: true,
+                            "type": 2, //type:1客户2:项目
+                            "sa_projectid": data.sa_projectid[1][0],
+                            "where": {
+                                "condition": ""
+                            }
+                        }
+                    },
+                    query: "&radio=true&idname=hrid",
+                    placeholder: "选择业务员",
+                    valueName: "saler_hrid",
+                    checking: "base",
+                    required: false
+                });
             };
             this.setData({
                 disabled: false,
@@ -162,6 +187,32 @@ Page({
                 this.setData({
                     address: data.item.province + data.item.city + data.item.county + data.item.address
                 })
+                //业务员
+                let hr = {
+                    label: "业务员",
+                    error: false,
+                    errMsg: "",
+                    type: "route",
+                    url: "/packageA/select/contacts/select",
+                    value: "",
+                    params: {
+                        "id": "20230306144402",
+                        "content": {
+                            nocache: true,
+                            "type": 2, //type:1客户2:项目
+                            "sa_projectid": data.value[1][0],
+                            "where": {
+                                "condition": ""
+                            }
+                        }
+                    },
+                    query: "&radio=true&idname=hrid",
+                    placeholder: "选择业务员",
+                    valueName: "saler_hrid",
+                    checking: "base",
+                    required: false
+                };
+                form.splice(6, form[6].label == "业务员" ? 1 : 0, hr);
                 break;
             case "sys_enterpriseid":
                 obj = {
@@ -211,6 +262,7 @@ Page({
         content.sa_projectid = content.sa_projectid[1] ? content.sa_projectid[1][0] : 0;
         content.contactsid = content.contactsid ? content.contactsid[1][0] : 0;
         content.discountrate = (content.discountrate / 100).toFixed(4) || 1;
+        content.saler_hrid = content.saler_hrid[1] ? content.saler_hrid[1][0] : 0;
         content.begdate = content.invaliddate[0];
         content.enddate = content.invaliddate[1];
         content.address = this.data.address;

+ 32 - 2
packageA/offers/addSetclientOffer.js

@@ -133,8 +133,10 @@ Page({
         console.log("处理", data, form, temporary)
         if (temporary.item.value[0] == data.value[0]) return wx.navigateBack();
         temporary.item.value = data.value;
+
         if (temporary.item.valueName == "sys_enterpriseid") {
-            let obj = {
+            //联系人
+            let contacts = {
                 label: "联系人",
                 error: false,
                 errMsg: "",
@@ -159,7 +161,34 @@ Page({
                 checking: "base",
                 required: false
             };
-            form.splice(1, form[1].label == "联系人" ? 1 : 0, obj);
+            form.splice(1, form[1].label == "联系人" ? 1 : 0, contacts);
+
+            //业务员
+            let hr = {
+                label: "业务员",
+                error: false,
+                errMsg: "",
+                type: "route",
+                url: "/packageA/select/contacts/select",
+                value: "",
+                params: {
+                    "id": "20230306144402",
+                    "content": {
+                        nocache: true,
+                        "type": 1, //type:1客户2:项目
+                        "sys_enterpriseid": data.value[1][0],
+                        "where": {
+                            "condition": ""
+                        }
+                    }
+                },
+                query: "&radio=true&idname=hrid",
+                placeholder: "选择业务员",
+                valueName: "saler_hrid",
+                checking: "base",
+                required: false
+            };
+            form.splice(6, form[6].label == "业务员" ? 1 : 0, hr);
         }
         form[temporary.index] = temporary.item;
         wx.navigateBack()
@@ -177,6 +206,7 @@ Page({
         };
         content.sys_enterpriseid = content.sys_enterpriseid[1] ? content.sys_enterpriseid[1][0] : 0;
         content.contactsid = content.contactsid[1] ? content.contactsid[1][0] : 0;
+        content.saler_hrid = content.saler_hrid[1] ? content.saler_hrid[1][0] : 0;
         content.discountrate = (content.discountrate / 100).toFixed(4) || 1;
         content.begdate = content.invaliddate[0];
         content.enddate = content.invaliddate[1];