Kaynağa Gözat

医院产品类型

xiaohaizhao 3 ay önce
ebeveyn
işleme
57e41ed089

+ 21 - 5
salesPanel/headOptionBox/index.js

@@ -13,15 +13,31 @@ Component({
         showText: {
             type: String,
         },
-        isEmpty: {
-            type: Boolean,
-            value: false
-        },
         placeholder: {
             type: String,
             value: "请选择"
+        },
+        isClear: {
+            type: Boolean,
+            value: false
+        },
+        clearCallBack: {
+            type: Function
         }
     },
     data: {},
-    methods: {}
+    methods: {
+        clearResults() {
+            let that = this;
+            wx.showModal({
+                title: '提示',
+                content: '是否确定清空选择项',
+                complete: (res) => {
+                    if (res.confirm) {
+                        that.triggerEvent("clearCallBack", that.data.title)
+                    }
+                }
+            })
+        }
+    }
 })

+ 2 - 2
salesPanel/headOptionBox/index.wxml

@@ -5,8 +5,8 @@
     <view class="right">
         <view wx:if="{{showText}}" style='color:#3874F6;'>{{showText}}</view>
         <view wx:else>{{placeholder}}</view>
-        <block wx:if='{{isEmpty}}'>
-            <view wx:if="{{showText != '全部'}}" class="iconfont icon-quxiao" catchtap="clearResults" />
+        <block wx:if='{{isClear}}'>
+            <view wx:if="{{showText}}" class="iconfont icon-quxiao" catchtap="clearResults" />
             <view wx:else class="iconfont icon-webxialaxuanxiangjiantou" />
         </block>
         <view wx:else class="iconfont icon-webxialaxuanxiangjiantou" />

+ 52 - 6
salesPanel/hospitalTarget/productType/index.js

@@ -32,7 +32,8 @@ Component({
         },
         areaList: [],
         active: "",
-        details: {}
+        details: {},
+        hospitalName: ""
     },
     methods: {
         async getList(init = false) {
@@ -69,11 +70,11 @@ Component({
         },
         async getData() {
             let content = this.data.content
-            if (content.sa_saleareaid == 0) await this.getArea().then(res => {
-                if (res.length > 0) {
-                    content.sa_saleareaid = res[0].sa_saleareaid
-                }
-            })
+            /*  if (content.sa_saleareaid == 0) await this.getArea().then(res => {
+                 if (res.length > 0) {
+                     content.sa_saleareaid = res[0].sa_saleareaid
+                 }
+             }) */
             _Http.basic({
                 "id": 2026010714131502,
                 content
@@ -171,5 +172,50 @@ Component({
                 })
             })
         },
+        toSelectHospital(e) {
+            let params = {
+                "content": {
+                    "pageNumber": 1,
+                    pageTotal: 1,
+                    "pageSize": 20,
+                    "where": {
+                        "condition": "",
+                        "sa_saleareaid": ""
+                    }
+                },
+                "id": 2026010516151802,
+            }
+            wx.navigateTo({
+                url: `/prsx/select/hospital/index?params=${JSON.stringify(params)}&radio=true`,
+            });
+            let that = this;
+            getApp().globalData.handleSelect = function ({
+                item
+            }) {
+                console.log(item)
+                wx.showModal({
+                    title: '提示',
+                    content: `是否确定选择“${item.enterprisename}”`,
+                    complete: (res) => {
+                        if (res.confirm) {
+                            that.setData({
+                                hospitalName: item.enterprisename,
+                                "content.sa_customersid": item.sa_customersid
+                            })
+                            that.getData()
+                            wx.navigateBack()
+                            delete getApp().globalData.handleSelect
+                        }
+                    }
+                })
+            }
+        },
+        clearCallBack(e) {
+            this.setData({
+                hospitalName:'',
+                "content.sa_customersid": 0
+            })
+            this.getData()
+        }
     }
 })

+ 1 - 1
salesPanel/hospitalTarget/productType/index.wxml

@@ -1,5 +1,5 @@
 <view style="height: 10rpx;"></view>
-<headOptionBox iconName='icon-bumen' title='营销区域' />
+<headOptionBox iconName='icon-bumen' title='医院' showText='{{hospitalName}}' isClear bind:clearCallBack='clearCallBack' placeholder="选择医院" bind:tap="toSelectHospital" />
 <viewDate iconName='icon-shijian1' type='sameYear' fields='year' value='{{content.year}}' startMonth="{{content.month_start}}" endMonth="{{content.month_end}}" title='时间范围' bind:onChange='changeDate' />
 <view style="height: 20rpx;"></view>
 <view class="global-card" style="overflow: hidden;">