Przeglądaj źródła

1、修改选择组织机构页面
2、修改打印票据

zhoux 1 rok temu
rodzic
commit
84b6c2a4b4

+ 1 - 1
mixins/index.js

@@ -411,7 +411,7 @@ module.exports = {
     wx.navigateTo({
       url: '/package-base-select/pages/web-view-select/web-view-select',
       success: function (res) {
-        res.eventChannel.emit('url', 'https://s.dev01.dkiboss.com:7000/wx-print?svc_code=' + app.globalData.company.svcCode + '&doc=' + docName + '&layout_id=' + layoutId + '&data_id=' + dataId);
+        res.eventChannel.emit('url', 'https://s.dev01.dkiboss.com:7000/wx-print?svc_code=' + app.globalData.company.svcCode + '&cp_id=' +  app.globalData.user.cpId + '&doc=' + docName + '&layout_id=' + layoutId + '&data_id=' + dataId);
       }
     })
   },

+ 18 - 14
package-basic-data/pages/org/choose-org/choose-org.js

@@ -55,23 +55,27 @@ 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);
-      })
-    }
-    let tableTopData = data.filter(it => it.levelNo == 1);
+    let tableData = util.convertToChildren(data,'parentId','orgId');
+    // // 先获取二级
+    // 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);
+    //   })
+    // }
+    // let tableTopData = data.filter(it => it.levelNo == 1);
+
     this.setData({
       tableData: tableData,
-      tableTopData: tableTopData
+      // tableTopData: tableTopData
     })
+    const myComponent = this.selectComponent('#treeSelect');
+    myComponent.setDataFromPage(this.data.tableData);
+    console.log('tableData',tableData);
   },
   /**
    * @desc : 选择数据

+ 6 - 14
package-basic-data/pages/org/choose-org/choose-org.wxml

@@ -4,29 +4,18 @@
 <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>
 </van-sticky>
 
 <!-- 内容列表 -->
-<view style="width: 100%;">
-    <!--当前数据-->
+<!-- <view style="width: 100%;">
     <view wx:if="{{item && item.orgName_socail}}" class="main-class">
         <view class="table-content table-content-row table-content-location ">
             <van-image src="{{imageUrl + 'location.png'}}" width="25rpx" height="25rpx" fit="heightFix" />
             {{item.orgName_socail}}
         </view>
     </view>
-    <!--一级-->
-    <view wx:if="{{tableTopData && tableTopData.length > 0}}" wx:for="{{tableTopData}}" 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>
-    </view>
     <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">
@@ -43,7 +32,10 @@
         </view>
 
     </view>
-</view>
+</view> -->
+
+<!-- 列表 --> 
+<dk-tree-form  bind:clickName="clickName"   treeList="{{tableData}}" idKey="orgId"   nameKey="orgName" parentIdKey="parentId" itemListKey="children" id="treeSelect" isLastClickFlag="{{true}}" ></dk-tree-form>
 
 <!-- 暂无数据 -->
 <van-empty wx:if="{{tableData.length<=0}}" description="{{$t['nodata']}}" />

+ 3 - 1
package-basic-data/pages/print-layout/print-layout.js

@@ -34,11 +34,13 @@ Page({
         let layoutId = e.currentTarget.dataset.item.layoutId;
         let docName = this.data.docName;
         let dataId = this.data.dataId;
+        console.log('tttt',app.globalData.company);
         let url = config.image_url.replace('/file','');
         wx.navigateTo({
             url: '/package-base-select/pages/web-view-select/web-view-select',
             success: function (res) {
-                res.eventChannel.emit('url', url + '/wx-print?svc_code=' + app.globalData.company.svcCode + '&doc=' + docName + '&layout_id=' + layoutId + '&data_id=' + dataId);
+                res.eventChannel.emit('url', url + '/wx-print?svc_code=' + app.globalData.company.svcCode 
+                + '&cp_id=' +  app.globalData.company.cpId + '&doc=' + docName + '&layout_id=' + layoutId + '&data_id=' + dataId);
             }
         })
     },

+ 1 - 0
pages/mine/mine.js

@@ -23,6 +23,7 @@ Page({
    */
   data: {
     imageUrl: config.image_url + '/static/img/',
+    pageFlag:false,
     companyName: null,
     staffName: 'null',
     orgName: null,