wangyingjie před 2 roky
rodič
revize
14da7db611

+ 50 - 41
package-basic-data/pages/org/choose-org/choose-org.js

@@ -1,11 +1,24 @@
-// package-basic-data/pages/org/choose-org/choose-org.js
+/*******************************************************************************
+ * Copyright(c) 2022 dongke All rights reserved. / Confidential
+ * 类的信息:
+ *		1.程序名称:
+ *		2.组织机构列表
+ * 编辑履历:
+ *		作者				日期					版本				修改内容
+ *		王英杰		   2024-2-12	    1.00		   	    
+ *******************************************************************************/
+const Constants = require('@/utils/Constants.js');
+const mixins = require('@/mixins/index.js')
+const app = getApp()
 Page({
-
+    mixins: [mixins],
     /**
      * 页面的初始数据
      */
     data: {
-        list:[{},{}]
+
+    // 路由
+    routeObjName: 'org',
     },
 
     /**
@@ -14,53 +27,49 @@ Page({
     onLoad(options) {
 
     },
-
     /**
-     * 生命周期函数--监听页面初次渲染完成
+     * 打开新建
      */
-    onReady() {
-
+    toadd() {
+        this.setData({
+            showPopup: true
+        })
     },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow() {
-
+    onClosePopup(){
+        this.setData({
+            showPopup: false
+        })  
     },
-
     /**
-     * 生命周期函数--监听页面隐藏
+     * 保存
      */
-    onHide() {
+    addSave(){
 
     },
-
-    /**
-     * 生命周期函数--监听页面卸载
+     /**
+     * 打开选择客户
      */
-    onUnload() {
-
+    openChooseOrg(){
+        wx.navigateTo({
+            url: this.data.route.chooseOrg.url,
+            events: function (e) {
+              // 回调后,在这里给页面赋值
+      
+            },
+            success: function (res) {
+              // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
+              res.eventChannel.emit('params', {})
+            }
+          })
     },
+ 
+  /**
+   * @desc : 查询
+   * @date : 2024/2/1 15:49
+   * @author : 王英杰
+   */
+  getData(params) {
+    return this.excute(this.data.service, this.data.service.selectByCond, params);
+  },
 
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh() {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom() {
-
-    },
-
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage() {
-
-    }
 })

+ 5 - 2
package-basic-data/pages/org/choose-org/choose-org.json

@@ -1,3 +1,6 @@
 {
-    "usingComponents": {}
-}
+    "usingComponents": {},
+    "navigationBarTitleText": "选择部门",
+    "enablePullDownRefresh": true,
+    "backgroundTextStyle": "light"
+  }

+ 91 - 35
package-basic-data/pages/org/choose-org/choose-org.wxml

@@ -1,47 +1,103 @@
-<loading wx:if="{{loading}}" loadingName="加载中" backgroundColor="#f2f2f2;" opacity="0.8"></loading>
+<!-- 前台导入wxmlUtil.wxs -->
 <wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
+<!-- 加载图层 -->
+<loading wx:if="{{loading}}"></loading>
+<!-- 粘性布局的查询条件 -->
 <van-sticky scroll-top="0">
-  <van-search model:value="{{ searchText }}" placeholder="请输入客户名称/地址/电话" use-action-slot bind:search="doSearch">
-  </van-search></van-sticky>
-
-  <view wx:for="{{list}}" data-item="{{item}}" wx:for-index="childindex" wx:key="index" class="main-class">
-  <view class="main-foot">
-    <view class="table">
-      <view data-index="{{index}}" data-item="{{item}}" catchtap="catchtapCheck">
-        <view class="table-row-right">
-          <view>
-            <dk-text fontSize="13px" fontWeight="nomal" value="{{item.customerName ? item.customerName :''}}"></dk-text>
-          </view>
-          <view style="font-size: 27rpx;  text-align: right;display: flex;">
-            <view style="padding-right: 15rpx;padding-top:5rpx;">
-              <van-icon name="phone" />
-            </view>
-            <view>
-              <dk-text fontSize="13px" fontWeight="nomal" value="{{item.customerPhone ? item.customerPhone :''}}"></dk-text>
-            </view>
+    <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/img/Vector.png" />
+        </view>
+        <view>沈阳蒙娜丽莎红星美凯龙专营店</view>
+    </view>
+</van-sticky>
+
+<!-- 暂无数据 -->
+<van-empty wx:if="{{tableData.length<=0}}" description="{{$t['nodata']}}" />
 
-          </view>
+<!-- 列表 -->
+<view  wx:for="{{tableData}}" style="background: white;margin:3vw;border-radius: 15rpx;">
+    <!-- 列表上半部分 -->
+    <view style="display: flex;padding:3vw;border-radius: 15rpx 15rpx 0 0;background: gray; ">
+        <view style="display: flex;flex: 1;">
+            <view class="image-frame">
+                <van-image round width="20rpx" height="24rpx" src="/static/img/Vector.png" />
+            </view>
+            <view>{{item.orgName}}</view>
         </view>
-        <view style="width: 100%; display:flex;">
-          <view style="width:10%; margin-top:5px">
-            <van-checkbox value="{{item.checked}}" data-index="{{index}}" data-item="{{item}}" catchtap="catchtapCheck" checked-color="#1989FA" />
-          </view>
-          <view style="width:87%;">
-            <van-divider />
-          </view>
+        <view style=" text-align: right;"><van-icon name="arrow" /></view>
+    </view>
+    <!-- 列表下半部分 -->
+    <view wx:for="{{item.itemData}}" wx:for-item="sub_item" class="list-below-item">
+        <view class="image-frame">
+            <van-image round width="20rpx" height="24rpx" src="/static/img/Vector.png" />
         </view>
+        <view> {{sub_item.orgName}} </view>
+        <view style="flex:1;text-align: right;"><van-icon name="arrow" /></view>
+    </view>
+ 
+</view>
 
-        <view class="table-row-right">
-          <view style="display: flex;">
-            <van-icon name="location" color="#1B365D" />
-            <dk-text fontSize="13px" fontWeight="nomal" value="{{ wxmlUtil.addressToIndexOf(item.addressFull ? item.addressFull :'')}}"></dk-text>
-          </view>
+<van-divider wx:if="{{noMore}}" contentPosition="center" borderColor="#DCDCDC">{{$t['noMore']}}</van-divider>
+<view style="height: 135rpx;"></view>
+
+<!-- 底部按钮相关 -->
+<view class="bottom-class-org">
+    <view style="padding:10rpx 34rpx 61rpx 43rpx; display: flex;">
+        <view style="width: 50%;padding: 4vw;">
+            <van-button round plain size="large" color="#1B365D" custom-style="height:88rpx;" bind:click="submit" data-key="出库回退" data-type="save" type="info">
+                新建员工
+            </van-button>
+        </view>
+        <view style="width: 50%;padding: 4vw;">
+            <van-button round size="large" color="#20365E" custom-style="height:88rpx;" bind:click="toadd" data-key="出库回退" data-type="save" type="default">
+                新建子部门
+            </van-button>
 
         </view>
-      </view>
     </view>
+</view>
+
 
+<!-- 弹窗 编辑/新建-->
+<van-popup show="{{showPopup}}" position="bottom" bind:close="onClosePopup" custom-class="function-pop-class">
+
+<view style="background-color:#F8F9FD;color:#1B365D;font-size: 17px;font-weight: 600;display: flex;justify-content: left;align-items: center;padding: 40rpx;">
+  <view>新建部门</view>
+</view>
+
+ 
+  <van-field disabled="{{false}}" disabled="{{true}}" input-width="200rpx" input-class="dk-cell-value-class" input-align="left" label-class="nomal-label" maxlength="50" value="{{'PP00001'}}" input-align="right" label="部门编码" placeholder="{{'请输入' + '品牌编码'}}" autosize border="{{ false }}">
+  </van-field>
+ 
+  <van-field label-class="nomal-label" input-width="200rpx" input-class="dk-cell-value-class" input-align="right" data-key="supplier-list" maxlength="25" type="text" value="{{'' }}" label="上级部门" placeholder="请选择" autosize border="{{ false }}" right-icon="arrow" color="#95A8CB" catchtap="openChooseOrg" readonly="{{true}}">
+  </van-field>
+  <van-field disabled="{{false}}" disabled="{{true}}" input-width="200rpx" input-class="dk-cell-value-class" input-align="left" label-class="nomal-label" maxlength="50" value="{{'PP00001'}}" input-align="right" label="部门名称" placeholder="{{'请输入' + '品牌编码'}}" autosize border="{{ false }}">
+  </van-field>
+ 
+  <van-field label-class="nomal-label" input-width="200rpx" input-class="dk-cell-value-class" input-align="right" data-key="supplier-list" maxlength="25" type="text" value="{{'' }}" label="可用仓库" placeholder="看" autosize border="{{ false }}" right-icon="arrow" color="#95A8CB" catchtap="openSingle" readonly="{{true}}">
+  </van-field>  
+  <van-field label-class="nomal-label" input-width="200rpx" input-class="dk-cell-value-class" input-align="right" data-key="supplier-list" maxlength="25" type="text" value="{{'' }}" label="可用资金账号" placeholder="请选择" autosize border="{{ false }}" right-icon="arrow" color="#95A8CB" catchtap="openSingle" readonly="{{true}}">
+  </van-field>
+ 
+  <van-field disabled="{{false}}" disabled="{{true}}" input-width="200rpx" input-class="dk-cell-value-class" input-align="left" label-class="nomal-label" maxlength="50" value="{{'PP00001'}}" input-align="right" label="备注" placeholder="{{'请输入' + '品牌编码'}}" autosize border="{{ false }}">
+  </van-field>
+ 
+ 
+
+
+ 
+<view style="display: flex; padding:35rpx 34rpx 62rpx 34rpx;">
+  <view style="width:48%">
+    <van-button size="large" plain round color="#1B365D" custom-style="height:88rpx;" bind:click="onClosePopup" type="default">取消
+    </van-button>
+  </view>
+  <view style="width: 4%;"></view>
+  <view style="width:48%;">
+    <van-button size="large" round color="#1B365D" custom-style="height:88rpx;" bind:click="addSave" type="default">保存
+    </van-button>
   </view>
 </view>
-<view style="height: 250rpx;"></view>
-<van-empty wx:if="{{list.length<=0}}" description="暂无数据" />
+</van-popup>

+ 30 - 1
package-basic-data/pages/org/choose-org/choose-org.wxss

@@ -1 +1,30 @@
-/* package-basic-data/pages/org/choose-org/choose-org.wxss */
+.image-frame {
+    width: 39rpx;
+    height: 39rpx;
+    background-color: #95A8CB;
+    border-radius: 50%;
+    margin-top: 5rpx;
+    margin-right: 3vw;
+}
+
+.list-below-item {
+    padding: 3vw 5vw 3vw 8vw;
+    display: flex;
+
+}
+.bottom-class-org{
+    background:#fff;
+    position:fixed;
+    bottom:0;
+    width:100%;
+    height: 182rpx; 
+    border-top:1px solid #efefef;
+    z-index: 7;
+    box-shadow: 0px -8rpx 24rpx rgba(0, 16, 39, 0.1);
+    border-radius: 30rpx 30rpx 0rpx 0rpx;
+  }
+  /* .v-button{
+     background: #20365E;
+     
+  } */
+ 

+ 16 - 1
package-basic-data/pages/org/org.js

@@ -7,13 +7,18 @@
  *		作者				日期					版本				修改内容
  *		王英杰		   2024-2-12	    1.00		   	    
  *******************************************************************************/
+const Constants = require('@/utils/Constants.js');
+const mixins = require('@/mixins/index.js')
+const app = getApp()
 Page({
-
+    mixins: [mixins],
     /**
      * 页面的初始数据
      */
     data: {
 
+    // 路由
+    routeObjName: 'org',
     },
 
     /**
@@ -57,4 +62,14 @@ Page({
             }
           })
     },
+ 
+  /**
+   * @desc : 查询
+   * @date : 2024/2/1 15:49
+   * @author : 王英杰
+   */
+  getData(params) {
+    return this.excute(this.data.service, this.data.service.selectByCond, params);
+  },
+
 })

+ 5 - 18
package-basic-data/pages/org/org.wxml

@@ -18,39 +18,26 @@
 <van-empty wx:if="{{tableData.length<=0}}" description="{{$t['nodata']}}" />
 
 <!-- 列表 -->
-<view style="background: white;margin:3vw;border-radius: 15rpx;">
+<view  wx:for="{{tableData}}" style="background: white;margin:3vw;border-radius: 15rpx;">
     <!-- 列表上半部分 -->
     <view style="display: flex;padding:3vw;background: linear-gradient(to right,#A8D0EF, #DAEFFF);border-radius: 15rpx 15rpx 0 0 ">
         <view style="display: flex;flex: 1;">
             <view class="image-frame">
                 <van-image round width="20rpx" height="24rpx" src="/static/img/Vector.png" />
             </view>
-            <view>销售部门</view>
+            <view>{{item.orgName}}</view>
         </view>
         <view style=" text-align: right;"><van-icon name="arrow" /></view>
     </view>
     <!-- 列表下半部分 -->
-    <view class="list-below-item">
+    <view wx:for="{{item.itemData}}" wx:for-item="sub_item" class="list-below-item">
         <view class="image-frame">
             <van-image round width="20rpx" height="24rpx" src="/static/img/Vector.png" />
         </view>
-        <view> 浑南红星没开卢克店 </view>
-        <view style="flex:1;text-align: right;"><van-icon name="arrow" /></view>
-    </view>
-    <view class="list-below-item">
-        <view class="image-frame">
-            <van-image round width="20rpx" height="24rpx" src="/static/img/Vector.png" />
-        </view>
-        <view> 浑南红星没开卢克店 </view>
-        <view style="flex:1;text-align: right;"><van-icon name="arrow" /></view>
-    </view>
-    <view class="list-below-item">
-        <view class="image-frame">
-            <van-image round width="20rpx" height="24rpx" src="/static/img/Vector.png" />
-        </view>
-        <view> 浑南红星没开卢克店 </view>
+        <view> {{sub_item.orgName}} </view>
         <view style="flex:1;text-align: right;"><van-icon name="arrow" /></view>
     </view>
+ 
 </view>
 
 <van-divider wx:if="{{noMore}}" contentPosition="center" borderColor="#DCDCDC">{{$t['noMore']}}</van-divider>