zhoux 1 год назад
Родитель
Сommit
81982a96e2

+ 1 - 1
app.wxss

@@ -582,7 +582,7 @@ end
   width: 100%;
 }
 .table-content-row{
-  padding: 10rpx 32rpx 10rpx 32rpx;
+  padding: 15rpx 32rpx;
 }
 .table-content-row-font{
   font-size: 14px;

+ 20 - 9
package-basic-data/pages/org/choose-org/choose-org.js

@@ -24,7 +24,6 @@ Page({
   },
 
 
-
   /**
    * @desc : 设置查询参数
    * @date : 2024/2/1 15:49
@@ -52,10 +51,22 @@ Page({
    * @author : 王英杰
    */
   handleSearchData(data) {
+    let tableData = []
+    // 先获取二级
+    let filters = data.filter(it=>it.levelNo == 2);
+    let childs = []
+    if(filters && filters.length > 0){
+      filters.forEach(it=>{
+        // 再获取二级的子级,根据levelCode过滤
+        childs = data.filter(t=>t.levelCode.startsWith(it.levelCode) && t.levelNo > 2);
+        it.children = childs
+        tableData.push(it);
+      })
+    }
+    console.log('etableData',tableData);
     this.setData({
-      tableData: this.dataHandling(data),
+      tableData: tableData,
     })
- 
   },
    /**
    * @desc : 重新排列下数据
@@ -63,6 +74,7 @@ Page({
    * @author : 王英杰
    */
   dataHandling(dataList) {
+    console.log('dataList',dataList);
     // 初始化data  
     let data = []; 
     // 初始化一个临时列表来存放当前level no等于2以及之后相连的数据  
@@ -91,12 +103,12 @@ Page({
     return data
   },
   /**
-   * @desc : dk-tree 控件回调点击事件
-   * @date : 2024/2/1 15:49
-   * @author : 王英杰
+   * @desc : 选择数据
+   * @date : 2024/4/29 15:49
+   * @author : 周兴
    */
-  clickName(e) {     
-    console.log("eee",e);
+  chooseData(e) { 
+    console.log('teee',e);    
     let item = e.currentTarget.dataset.item
     const eventChannel = this.getOpenerEventChannel();
     eventChannel.emit('bindData', {
@@ -105,7 +117,6 @@ Page({
         name: item.orgName
       }
     })
-     
     wx.navigateBack({
       delta: 1
     })

+ 27 - 19
package-basic-data/pages/org/choose-org/choose-org.wxml

@@ -4,32 +4,40 @@
 <loading wx:if="{{loading}}"></loading>
 <!-- 粘性布局的查询条件 -->
 <van-sticky scroll-top="0">
-    <van-search model:value="{{ searchText }}" bind:change="onSearchText" bind:search="doSearch" use-action-slot placeholder="搜索 客户名称/地址/标签/电话/备注">
+    <van-search model:value="{{ searchText }}" bind:change="onSearchText" bind:search="doSearch" use-action-slot placeholder="搜索">
     </van-search>
-    <view style="display: flex; padding: 4vw; background: white;">
-        <view class="image-frame">
-            <van-image round width="20rpx" height="24rpx" src="/static/image/Vector.png" />
+</van-sticky>
+
+<!-- 内容列表 -->
+<view style="width: 100%;">
+    <view wx:for="{{tableData}}" wx:for-item="item"  wx:key="index" class="main-class">
+        <view class="table-content">
+            <view class="table-title-row" data-item="{{item}}" catchtap="chooseData">
+                <view style="font-size: 16px;font-weight: 500;width: 100%;">
+                    {{item.orgName}}
+                </view>
+            </view>
+            <view class="table-content-row" wx:for="{{item.children}}" wx:for-item="cItem" data-item="{{cItem}}" bindtap="chooseData">
+                <view style="font-size: 14px;">{{cItem.orgName}}</view>
+            </view>
         </view>
-        <view>沈阳蒙娜丽莎红星美凯龙专营店</view>
+
     </view>
-</van-sticky>
+</view>
 
 <!-- 暂无数据 -->
 <van-empty wx:if="{{tableData.length<=0}}" description="{{$t['nodata']}}" />
 
-<!-- 列表 --> 
-<view wx:for="{{tableData}}" style="margin:10px;background:white;border-radius:15rpx;padding: 10px;"> 
-  <view wx:for="{{item}}" wx:for-item="item_" wx:for-index="index_" >
-    <view style="width: 100vw; display:flex;align-items:center; font-size:36rpx;margin-top: 5px;"data-item="{{item_}}"   bindtap="clickName"> 
-            <view style="margin-left: 5vw;font-size: 14px;" >
+<!-- 列表
+<view wx:for="{{tableData}}" style="margin:10px;background:white;border-radius:15rpx;padding: 10px;">
+    <view wx:for="{{item}}" wx:for-item="item_" wx:for-index="index_">
+        <view style="width: 100vw; display:flex;align-items:center; font-size:36rpx;margin-top: 5px;" data-item="{{item_}}" bindtap="clickName">
+            <view style="margin-left: 5vw;font-size: 14px;">
                 {{item_.orgName}}
-            </view> 
+            </view>
         </view>
-  </view> 
-</view>
- 
- <van-divider wx:if="{{noMore}}" contentPosition="center" borderColor="#DCDCDC">{{$t['noMore']}}</van-divider>
-<view style="height: 135rpx;"></view>
+    </view>
+</view> -->
 
- 
- 
+<van-divider wx:if="{{noMore}}" contentPosition="center" borderColor="#DCDCDC">{{$t['noMore']}}</van-divider>
+<view style="height: 135rpx;"></view>

+ 7 - 4
package-basic-data/pages/org/choose-org/choose-org.wxss

@@ -23,8 +23,11 @@
     box-shadow: 0px -8rpx 24rpx rgba(0, 16, 39, 0.1);
     border-radius: 30rpx 30rpx 0rpx 0rpx;
   }
-  /* .v-button{
-     background: #20365E;
-     
-  } */
+  .table-title-row{
+    background: linear-gradient(95.33deg, #ADC6FF -2.27%, #F0F5FF 60.66%),
+      linear-gradient(0deg, #F4F8FF, #F4F8FF),
+      radial-gradient(58.28% 235.72% at 10.78% 50%, rgba(191, 213, 255, 0.6) 0%, rgba(216, 229, 255, 0) 56.69%); 
+      padding: 30rpx 20rpx;
+      border-radius: 15rpx 15rpx 0  0 ;
+  }
  

+ 4 - 4
package-basic-data/pages/org/org.wxml

@@ -7,7 +7,7 @@
     <!-- 查询条件 -->
     <dk-dropdown-menu model:value="{{searchForm}}" menuList="{{searchContent}}" pullMenuList="{{pullMenuList}}" bind:search="searchData" searchTextPlaceholder="{{wxmlUtil.setSearchPlaceholder($t,['orgId'])}}">
     </dk-dropdown-menu>
-    <view style="display: flex; padding: 4vw; background: white;">
+    <view style="display: flex; padding: 4vw; background: white;font-weight: 500;">
         <view class="image-frame">
             <van-image round width="39rpx" height="39rpx" fit="fill" src="{{imageUrl + 'org-img.png'}}" />
         </view>
@@ -24,7 +24,7 @@
     <view style="display: flex;padding:3vw;   border-radius: 15rpx 15rpx 0 0 " class="tile-class" data-open="{{item.open}}" data-item="{{item}}" data-index="{{index}}" bindtap="onchange">
         <view style="display: flex;flex: 1;">
             <van-image round width="39rpx" height="39rpx" fit="fill" src="/static/image/ghxk.png" />
-            <view style="margin-left:5vw;font-size: 16px;">{{item.orgName}}</view>
+            <view style="margin-left:5vw;font-size: 16px;font-weight: 500;">{{item.orgName}}</view>
         </view>
         <view style=" text-align: right;">
             <van-icon wx:if="{{ item.open }}" color="#bdb7b7" name="arrow-down" style="font-size: 16px;" />
@@ -34,8 +34,8 @@
     <!-- 列表下半部分 -->
     <view wx:if="{{ !item.open}}" wx:for="{{item.children}}" wx:for-item="item_" wx:for-index="index_" class="list-below-item">
         <view style="width: 100vw; display:flex;align-items:center; font-size:36rpx;margin-top: 5px;">
-            <view class="tree_left">
-                <van-image round width="40rpx" height="40rpx" fit="fill" src="/static/image/tree.png" />
+            <view  >
+                <van-image src="{{imageUrl + 'tree.png'}}"  width="25rpx" height="25rpx" fit="heightFix"/>
             </view>
             <view style="margin-left: 5vw;font-size: 14px;" data-item="{{item_}}" data-type="sub" data-open="{{item.open}}" bindtap="clickName">
                 {{item_.orgName}}

+ 5 - 0
package-basic-data/pages/org/org.wxss

@@ -55,4 +55,9 @@
   align-items: center;
   padding: 20rpx;
   box-shadow: 0px 17px 22px 0px #1B365D33;
+}
+
+.image-class{
+  width: 30rpx;
+  height: 30rpx;
 }

+ 2 - 0
package-basic-data/pages/org/sub-org-choose/sub-org-choose.js

@@ -8,6 +8,7 @@
  *		王英杰		   2024-2-12	    1.00		   	    
  *******************************************************************************/
 const Constants = require('@/utils/Constants.js');
+const config = require('@/config/config.js');
 const mixins = require('@/mixins/index.js')
 const util = require('@/utils/util.js')
 const app = getApp()
@@ -17,6 +18,7 @@ Page({
    * 页面的初始数据
    */
   data: {
+    imageUrl: config.image_url + '/static/img/',
     readonly: false,
     // 查询条件
     searchContent: [],

+ 3 - 3
package-basic-data/pages/org/sub-org-choose/sub-org-choose.wxml

@@ -9,7 +9,7 @@
     </dk-dropdown-menu>
     <view style="display: flex; padding: 4vw; background: white;">
         <view class="image-frame">
-            <van-image round width="20rpx" height="24rpx" src="/static/image/Vector.png" />
+            <van-image round width="39rpx" height="39rpx" fit="fill" src="{{imageUrl + 'org-img.png'}}" />
         </view>
         <view>{{item.chooseOrgSort}}</view>
     </view>
@@ -22,8 +22,8 @@
 <view  class="Outer-frame"> 
     <view  wx:for="{{tableData}}"  class="list-below-item">
         <view style="width: 100vw; display:flex;align-items:center; font-size:36rpx;margin-top: 5px;">
-            <view class="tree_left">
-                <van-image round width="40rpx" height="40rpx" src="/static/image/tree.png" />
+            <view >
+                <van-image src="{{imageUrl + 'tree.png'}}"  width="25rpx" height="25rpx" fit="heightFix"/>
             </view>
             <view style="margin-left: 5vw;font-size: 14px;" data-item="{{item}}"   bindtap="clickName">
                 {{item.orgName}}

+ 4 - 2
package-basic-data/pages/org/sub-org-choose/sub-org-choose.wxss

@@ -1,10 +1,12 @@
 .image-frame {
-    width: 39rpx;
-    height: 39rpx;
+    width: 39rpx;height: 39rpx;
+    text-align: center;
     background-color: #95A8CB;
     border-radius: 50%;
     margin-top: 5rpx;
     margin-right: 3vw;
+    display: flex;
+    justify-content: center;
 }
 
 .list-below-item {