qymljy 4 meses atrás
pai
commit
a944dac307

+ 1 - 1
prsx/dealer/detail.wxml

@@ -22,7 +22,7 @@
     <Department slot='科室' id='Department'></Department>
     <Department slot='科室' id='Department'></Department>
     <Hospital slot='医院' id='Hospital'></Hospital>
     <Hospital slot='医院' id='Hospital'></Hospital>
     <Contract slot='合同' id='Contract' />
     <Contract slot='合同' id='Contract' />
-    <Address slot='地址管理' id='Address' disabled="{{(per.query(appAuth.options,'address')||isAdmin||isLeader)&& detail.status != '已终止'}}" />
+    <Address slot='地址管理' id='Address' enterpriseid="{{detail.sys_enterpriseid}}" type='经销商' disabled="{{(per.query(appAuth.options,'address')||isAdmin||isLeader)&& detail.status != '已终止'}}" />
     <Record slot="操作" id="Record" ownertable='sa_agents' ownerid='{{sa_agentsid}}' />
     <Record slot="操作" id="Record" ownertable='sa_agents' ownerid='{{sa_agentsid}}' />
     <Files slot="附件" id="Files" ownertable='sa_agents' ownerid='{{sa_agentsid}}' disabled="{{detail.status != '已终止'}}" />
     <Files slot="附件" id="Files" ownertable='sa_agents' ownerid='{{sa_agentsid}}' disabled="{{detail.status != '已终止'}}" />
 </Yl_FunTabs>
 </Yl_FunTabs>

+ 12 - 0
prsx/department/detail.js

@@ -258,6 +258,18 @@ Page({
             editdataleader = isLeader ? 1 : 0,
             editdataleader = isLeader ? 1 : 0,
             tabbarList = [],
             tabbarList = [],
             appAuth = this.data.appAuth;
             appAuth = this.data.appAuth;
+            console.log(editdataleader,'editdataleader')
+            console.log(isLeader,'isLeader')
+            if (!isLeader) {
+              let res = await getApp().agentOrNot('sa_hospitaldep', this.data.detail.sa_hospitaldepid),
+                  data = res.code == '1' ? res.data : {
+                      editable: 0,
+                      editdataleader: 0
+                  }
+              if (this.data.appAuth.isdatateam) isLeader = this.selectComponent("#Group").data.editable == 1;
+              if (!isLeader) isLeader = data.editable == 1;
+              editdataleader = data.editdataleader;
+          }
         if (isLeader && isAdmin) {
         if (isLeader && isAdmin) {
             tabbarList.push({
             tabbarList.push({
                 icon: "color-bianji",
                 icon: "color-bianji",

+ 11 - 2
prsx/hospital/address/index.js

@@ -7,6 +7,9 @@ Component({
         type: {
         type: {
             type: String,
             type: String,
             value: "客户"
             value: "客户"
+        },
+        enterpriseid : {
+          type: String
         }
         }
     },
     },
     options: {
     options: {
@@ -40,14 +43,20 @@ Component({
         },
         },
         /* 获取地址列表 */
         /* 获取地址列表 */
         getList(id, init) {
         getList(id, init) {
+          console.log(this.data.enterpriseid,'输出数据')
             let content = this.data.content;
             let content = this.data.content;
-            content.sys_enterpriseid = id || this.data.sys_enterpriseid;
+            let paramId = ''
+            content.sys_enterpriseid = this.data.type == '经销商' ? this.data.enterpriseid : id || this.data.sys_enterpriseid;
             if (init) {
             if (init) {
                 content.pageNumber = 1
                 content.pageNumber = 1
                 content.pageTotal = 1
                 content.pageTotal = 1
             }
             }
+            if (this.data.type == '经销商') {
+              paramId = 20221009155803
+            }
+            console.log(paramId)
             _Http.basic({
             _Http.basic({
-                "id": "20221022165503",
+                "id": paramId?paramId:"20221022165503",
                 content
                 content
             }).then(res => {
             }).then(res => {
                 console.log("地址列表", res)
                 console.log("地址列表", res)

+ 139 - 128
prsx/hospital/address/list/index.js

@@ -1,140 +1,151 @@
 const _Http = getApp().globalData.http;
 const _Http = getApp().globalData.http;
 Component({
 Component({
-    options: {
-        addGlobalClass: true
+  options: {
+    addGlobalClass: true
+  },
+  properties: {
+    list: {
+      type: Array
     },
     },
-    properties: {
-        list: {
-            type: Array
-        },
-        changeTotal: {
-            type: Function
-        },
-        disabled: {
-            type: Boolean
-        },
-        type: {
-            type: String
-        }
+    changeTotal: {
+      type: Function
     },
     },
-    data: {
-        radio: 0, //默认
+    disabled: {
+      type: Boolean
     },
     },
-    lifetimes: {
-        attached: function () {
-            getApp().globalData.Language.getLanguagePackage(this)
+    type: {
+      type: String
+    }
+  },
+  data: {
+    radio: 0, //默认
+  },
+  lifetimes: {
+    attached: function () {
+      getApp().globalData.Language.getLanguagePackage(this)
+    }
+  },
+  methods: {
+    // 修改默认
+    radioChange({
+      detail
+    }) {
+      let list = this.data.list,
+        data = list.find(v => v.contactsid == detail)
+      _Http.basic({
+        "id": "20221018144702",
+        "content": {
+          "contactsid": data.contactsid,
+          "sys_enterpriseid": data.sys_enterpriseid
         }
         }
-    },
-    methods: {
-        // 修改默认
-        radioChange({
-            detail
-        }) {
-            let list = this.data.list,
-                data = list.find(v => v.contactsid == detail)
-            _Http.basic({
-                "id": "20221018144702",
-                "content": {
-                    "contactsid": data.contactsid,
-                    "sys_enterpriseid": data.sys_enterpriseid
-                }
-            }, false).then(res => {
-                if (res.code != '1') return wx.showToast({
+      }, false).then(res => {
+        if (res.code != '1') return wx.showToast({
+          title: res.data,
+          icon: "none"
+        });
+
+        getCurrentPages().forEach(v => {
+          //更新列表
+          if (["prsx/hospital/detail"].includes(v.__route__)) {
+            let page = v.selectComponent("#Address").selectComponent("#List");
+            const lists = page.data.list.map(value => {
+              value.isdefault = value.contactsid == data.contactsid ? 1 : 0
+              return value
+            });
+            page.setData({
+              list: lists
+            })
+            setTimeout(() => {
+              page.initRadio();
+            }, 200)
+          };
+        })
+      })
+    }, //处理操作
+    handleItem(e) {
+      const {
+        name,
+        item
+      } = e.target.dataset,
+        that = this;
+      if (!name) return;
+      switch (name) {
+        case 'call':
+          wx.makePhoneCall({
+            phoneNumber: item.phonenumber,
+          })
+          break;
+        case 'copy':
+          let str = `${getApp().globalData.Language.getMapText('联系人')}:${item.name}\n${getApp().globalData.Language.getMapText('手机号码')}:${item.phonenumber}\n${getApp().globalData.Language.getMapText('所在地区')}:${item.province+item.city+item.county}\n${getApp().globalData.Language.getMapText('详细地址')}:${item.province+item.city+item.county+item.address}`
+          wx.setClipboardData({
+            data: str,
+          })
+          break;
+        case 'edit':
+          wx.navigateTo({
+            url: '/prsx/hospital/address/add/index?data=' + JSON.stringify(item) + '&type=' + this.data.type,
+          })
+          break;
+        case 'delete':
+          wx.showModal({
+            title: getApp().globalData.Language.getMapText('提示'),
+            content: getApp().globalData.Language.getMapText('是否确认删除') + `"${item.name}"`,
+            cancelText: getApp().globalData.Language.getMapText('取消'),
+            confirmText: getApp().globalData.Language.getMapText('确定'),
+            complete: (res) => {
+              if (res.confirm) {
+                _Http.basic({
+                  "id": "20221018145502",
+                  "content": {
+                    "contactsid": item.contactsid,
+                    "sys_enterpriseid": item.sys_enterpriseid
+                  }
+                }).then(res => {
+                  console.log("删除地址", res)
+                  if (res.code != '1') return wx.showToast({
                     title: res.data,
                     title: res.data,
                     icon: "none"
                     icon: "none"
-                });
+                  });
+                  wx.showToast({
+                    title: getApp().globalData.Language.getMapText('删除成功') + `!`,
+                    icon: "none"
+                  });
+                  getCurrentPages().forEach(v => {
+                    if (v.__route__ == "packageA/setclient/detail" || v.__route__ == "packageA/opponent/detail" || v.__route__ == "packageA/publicCustomer/detail") {
+                      let model = v.selectComponent("#Address");
+                      model.setData({
+                        list: model.data.list.filter(value => value.contactsid != item.contactsid)
+                      });
+                      model.changeTotal();
+                    } else if (v.__route__ == "packageA/setclient/modules/address/search/index") {
+                      v.setData({
+                        list: v.data.list.filter(value => value.contactsid != item.contactsid)
+                      });
+                    }
+                  })
+                  setTimeout(() => {
 
 
-                getCurrentPages().forEach(v => {
-                    //更新列表
-                    if (["prsx/hospital/detail"].includes(v.__route__)) {
-                        let page = v.selectComponent("#Address").selectComponent("#List");
-                        const lists = page.data.list.map(value => {
-                            value.isdefault = value.contactsid == data.contactsid ? 1 : 0
-                            return value
-                        });
-                        page.setData({
-                            list: lists
-                        })
-                        setTimeout(() => {
-                            page.initRadio();
-                        }, 200)
-                    };
-                })
-            })
-        }, //处理操作
-        handleItem(e) {
-            const {
-                name,
-                item
-            } = e.target.dataset,
-                that = this;
-            if (!name) return;
-            switch (name) {
-                case 'call':
-                    wx.makePhoneCall({
-                        phoneNumber: item.phonenumber,
+                    getCurrentPages().forEach(v => {
+                      //更新列表
+                      if (v.selectComponent("#Address")) {
+                        let page = v.selectComponent("#Address");
+                        page.getList('', true)
+                        // wx.navigateBack();
+                      };
                     })
                     })
-                    break;
-                case 'copy':
-                    let str = `${getApp().globalData.Language.getMapText('联系人')}:${item.name}\n${getApp().globalData.Language.getMapText('手机号码')}:${item.phonenumber}\n${getApp().globalData.Language.getMapText('所在地区')}:${item.province+item.city+item.county}\n${getApp().globalData.Language.getMapText('详细地址')}:${item.province+item.city+item.county+item.address}`
-                    wx.setClipboardData({
-                        data: str,
-                    })
-                    break;
-                case 'edit':
-                    wx.navigateTo({
-                        url: '/prsx/hospital/address/add/index?data=' + JSON.stringify(item) + '&type=' + this.data.type,
-                    })
-                    break;
-                case 'delete':
-                    wx.showModal({
-                        title: getApp().globalData.Language.getMapText('提示'),
-                        content: getApp().globalData.Language.getMapText('是否确认删除') + `"${item.name}"`,
-                        cancelText: getApp().globalData.Language.getMapText('取消'),
-                        confirmText: getApp().globalData.Language.getMapText('确定'),
-                        complete: (res) => {
-                            if (res.confirm) {
-                                _Http.basic({
-                                    "id": "20221018145502",
-                                    "content": {
-                                        "contactsid": item.contactsid,
-                                        "sys_enterpriseid": item.sys_enterpriseid
-                                    }
-                                }).then(res => {
-                                    console.log("删除地址", res)
-                                    if (res.code != '1') return wx.showToast({
-                                        title: res.data,
-                                        icon: "none"
-                                    });
-                                    wx.showToast({
-                                        title: getApp().globalData.Language.getMapText('删除成功') + `!`,
-                                        icon: "none"
-                                    });
-                                    getCurrentPages().forEach(v => {
-                                        if (v.__route__ == "packageA/setclient/detail" || v.__route__ == "packageA/opponent/detail" || v.__route__ == "packageA/publicCustomer/detail") {
-                                            let model = v.selectComponent("#Address");
-                                            model.setData({
-                                                list: model.data.list.filter(value => value.contactsid != item.contactsid)
-                                            });
-                                            model.changeTotal();
-                                        } else if (v.__route__ == "packageA/setclient/modules/address/search/index") {
-                                            v.setData({
-                                                list: v.data.list.filter(value => value.contactsid != item.contactsid)
-                                            });
-                                        }
-                                    })
-                                })
-                            }
-                        }
-                    })
-                    break;
+                  }, 300)
+                })
+              }
             }
             }
-        },
-        initRadio() {
-            let data = this.data.list.find(v => v.isdefault == 1);
-            this.setData({
-                radio: data ? data.contactsid : 0
-            })
-        },
-    }
+          })
+          break;
+      }
+    },
+    initRadio() {
+      let data = this.data.list.find(v => v.isdefault == 1);
+      this.setData({
+        radio: data ? data.contactsid : 0
+      })
+    },
+  }
 })
 })

+ 8 - 2
prsx/orderForm/add/add.js

@@ -152,7 +152,10 @@ Page({
         "content": {
         "content": {
           "pageSize": 20,
           "pageSize": 20,
           "pageNumber": 1,
           "pageNumber": 1,
-          sa_customersid: 0
+          "sa_customersid": 0,
+          "where": {
+            "condition": ""
+          }
         },
         },
       },
       },
       query: "&radio=true",
       query: "&radio=true",
@@ -176,7 +179,10 @@ Page({
         "content": {
         "content": {
           "pageSize": 20,
           "pageSize": 20,
           "pageNumber": 1,
           "pageNumber": 1,
-          sa_customersid: 0
+          "sa_customersid": 0,
+          "where": {
+            "condition": ""
+          }
         },
         },
       },
       },
       query: "&radio=true",
       query: "&radio=true",

+ 1 - 0
prsx/select/firm/index.js

@@ -102,6 +102,7 @@ Page({
   startSearch({
   startSearch({
     detail
     detail
   }) {
   }) {
+    console.log(this.data.params,'params')
     let condition = this.data.content ? this.data.content.where.condition : this.data.params.content.where.condition;
     let condition = this.data.content ? this.data.content.where.condition : this.data.params.content.where.condition;
     if (detail == condition) return;
     if (detail == condition) return;
     this.setData({
     this.setData({

+ 1 - 0
prsx/select/hospital/index.js

@@ -10,6 +10,7 @@ Page({
         sColors: getApp().globalData.sColors,
         sColors: getApp().globalData.sColors,
     },
     },
     onLoad(options) {
     onLoad(options) {
+      console.log("options",options)
         if (options.params) {
         if (options.params) {
             let params = JSON.parse(options.params);
             let params = JSON.parse(options.params);
             if (!params.content.pageNumber || !params.content.pageTotal) {
             if (!params.content.pageNumber || !params.content.pageTotal) {