Jelajahi Sumber

二维码扫码

姜永辉 1 tahun lalu
induk
melakukan
df4bf8703f

+ 232 - 61
package-accounts-manage/pages/daily-reconciliation-statement/daily-reconciliation-statement.js

@@ -1,66 +1,237 @@
-// package-accounts-manage/pages/daily-reconciliation-statement/daily-reconciliation-statement.js
+/*******************************************************************************
+ * Copyright(c) 2022 dongke All rights reserved. / Confidential
+ * 类的信息:
+ *		1.程序名称:  收款单列表
+ * 编辑履历:
+ *		作者				日期					版本				修改内容
+ *		姜永辉      2024-03-22    1.00		   	    
+ *******************************************************************************/
+const Constants = require('@/utils/Constants.js');
+const mixins = require('@/mixins/index.js')
 Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad(options) {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload() {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh() {
-
+  mixins: [mixins],
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    // 查询条件
+    searchContent: [
+      {
+        code: 'makeTime', title: mixins.$t('pastThirthtyDays'),
+        defaultValue: 5, searchType: Constants.searchType.date
+      },
+      { code: 'staff', title: mixins.$t('staffId'), dropType: 'staff' }, 
+       ],
+     
+    // 列表区(内容)
+    contentList: [
+      { name: 'rpNo', title: mixins.$t('receiptOrderNo') },
+      {
+        name: [{ name: 'orgName', title: '' },
+        { name: 'staffName', title: '' },],
+        title: mixins.$t('receiptInfo')
+      },
+      { name: 'sumAmtReceivableHandle', title: mixins.$t('sumAmtReceivableHandle') },
+    ],
+    // 弹出按钮
+    buttonList: [
+      {
+        name: 'cusReturnCollection',
+        title: mixins.$t('cusReturnCollection'),
+      },
+      //  {
+      //   name: 'editOrder',
+      //   title: mixins.$t('edit'),
+      // },
+      {
+        name: 'invaidOrder',
+        title: mixins.$t('invaidOrder'),
+      },
+      {
+        name: 'ticketPirnt',
+        title: mixins.$t('ticketPirnt'),
+      },
+
+    ],
+
+    // 底部保存按钮
+    buttonFootList: [{
+      name: 'add',
+      title: mixins.$t('add'),
+    }],
+    // 列表区(脚部金额)
+    footerAmount: {
+      name: 'sumAmtRec',
+      title: mixins.$t('totalAmount')
     },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom() {
-
-    },
-
-    /**
-     * 用户点击右上角分享
+    // 列表区(脚部信息)
+    footerInfo: [{ name: 'sumAmtRec', }],
+    contentnFootList: [
+      {
+        title: mixins.$t('totalAmount'),
+        code: 'sumAmtRec',
+        content: 0,
+        type: 'number'
+      }, {
+        type: 'count',
+        code: 'count',
+        quantity: -1,
+        bill: 1,
+      }
+    ],
+    btnFormData: null,
+    // 路由
+    routeObjName: 'receiptPayment',
+    // 主键Id
+    primaryKey: 'rpId',
+
+  },
+
+  /**
+  * @desc : 设置查询参数
+  * @date : 2024年3月8日
+  * @author : 姜永辉
+  */
+  setSearchParams(params) {
+    //收付款类型-收款的查询参数
+    params.rpType = Constants.rpType.receipt
+    params.staffIdList = params.staffIds
+    params.orgIdList = params.orgIds
+    if (params.flgValid) {
+      params.flgValidList = [true, false]
+    } else {
+      params.flgValidList = [true]
+    }
+    return params;
+  },
+
+  /** 
+   * @desc : 查询 入库单
+   * @date : 2024年3月8日
+   * @author : 姜永辉
+   */
+  getData(params) {
+    return this.excute(this.data.service, this.data.service.selectByCond, params);
+  },
+
+  /**
+     * @desc :   处理接口返回数据
+     * @date : 2024年3月8日
+     * @author : 姜永辉
      */
-    onShareAppMessage() {
-
+  handleSearchData(tableData) {
+    let temp = tableData
+    let contentnFootList = this.data.contentnFootList
+    console.log(tableData);
+    temp.forEach(it => {
+      it.makeTime = it.makeTime.substring(0, 10)
+      it.sumAmtReceivableHandle = it.sumAmtReceivableHandle != null ? Number(it.sumAmtReceivableHandle).toFixed(2) : '0.00'
+      // 不加这个字段不显示收款字样
+      it.collectStatus = ' '
+    })
+    let sumAmount = 0 //总的 合计金额 
+    let sumQty = 0 //总的 合集数量
+    sumAmount = tableData.sum('sumAmtRec')
+    sumQty = tableData.sum('sumAmtReceivableHandle')
+
+    contentnFootList.forEach(it => {
+      if (it.type == 'count') {
+        it.bill = tableData.length
+      }
+      if (it.type == 'number') {
+        it.content = sumAmount
+      }
+    })
+
+    this.setData({
+      tableData: temp,
+      sumAmount,
+      sumQty,
+      contentnFootList
+    })
+  },
+
+  /**
+    * @desc : (客户退款)-退收款单
+    * @date : 2024/2/1 15:49
+    * @author : 姜永辉
+    */
+  cusReturnCollection(e) {
+    let item = e
+    wx.navigateTo({
+      url: this.data.route.addReturn.url,
+      events: {
+        // 回调后,在这里给页面赋值
+        bandData: function (e) { }
+      },
+      success: function (res) {
+        res.eventChannel.emit('params', {
+          item: item,
+          formType: 5,
+          formMode: Constants.formMode.add
+        })
+      }
+    })
+
+  },
+
+  /**
+    * @desc : (编辑)
+    * @date : 2024/2/1 15:49
+    * @author : 姜永辉
+    */
+  editOrder(e) {
+    let item = e
+    let id = item.rpId
+    // 收款
+    if (item.rpType == Constants.rpType.receipt) {
+      wx.navigateTo({
+        url: this.data.route.add.url,
+        events: {
+          // 回调后,在这里给页面赋值
+          bandData: function (e) { }
+        },
+        success: function (res) {
+          res.eventChannel.emit('params', {
+            id: id,
+            formMode: Constants.formMode.edit
+          })
+        }
+      })
     }
+    // 退收款
+    else if (item.rpType == Constants.rpType.returnReceipt) {
+      wx.navigateTo({
+        url: this.data.route.addReturn.url,
+        events: {
+          // 回调后,在这里给页面赋值
+          bandData: function (e) { }
+        },
+        success: function (res) {
+          res.eventChannel.emit('params', {
+            id: id,
+            formMode: Constants.formMode.edit
+          })
+        }
+      })
+    }
+
+  },
+
+  /**
+    * @desc : 作废
+    * @date : 2024/2/1 15:49
+    * @author : 姜永辉
+    */
+  invaidOrder(e) {
+    let item = e
+    let id = item.rpId
+    this.excute(this.data.service, this.data.service.invalid + id, null).then(res => {
+      if (res.data.code == Constants.SUCESS_CODE) {
+        // 重新查询
+        this.searchData()
+      }
+    })
+
+  },
 })

+ 18 - 2
package-accounts-manage/pages/daily-reconciliation-statement/daily-reconciliation-statement.wxml

@@ -1,2 +1,18 @@
-<!--package-accounts-manage/pages/daily-reconciliation-statement/daily-reconciliation-statement.wxml-->
-<text>package-accounts-manage/pages/daily-reconciliation-statement/daily-reconciliation-statement.wxml</text>
+<!-- 前台导入wxmlUtil.wxs -->
+<wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
+<loading wx:if="{{loading}}"></loading>
+<van-sticky scroll-top="0">
+	<!-- 查询条件 -->
+	<dk-dropdown-menu model:value="{{searchForm}}" flgSearchText="{{false}}" menuList="{{searchContent}}" bind:search="searchData" searchTextPlaceholder="{{wxmlUtil.setSearchPlaceholder($t,['orderNo','cusName'])}}">
+	</dk-dropdown-menu>
+</van-sticky>
+<!-- 暂无数据 -->
+<van-empty wx:if="{{tableData.length<=0}}" description="{{$t['nodata']}}" />
+<!-- 列表区 -->
+<dk-list list="{{tableData}}" title="cusName" content="{{contentList}}" collectCol="sumAmtRec" collectName="收款" contentObj="{{contentObj}}" contentCol="" footerAmount="{{footerAmount}}" footerInfo="{{footerInfo}}" bind:toDetail="toDetail" bind:toTitle="toTitle" routeObjName="{{routeObjName}}" buttonList="{{buttonList}}" bind:open="open"></dk-list>
+
+<van-divider wx:if="{{noMore}}" contentPosition="center" borderColor="#DCDCDC">{{$t['noMore']}}~</van-divider>
+
+<view style="height: 180rpx;"></view>
+<!-- 新建按钮 -->
+<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{false}}" btnRightFlag="{{true}}" buttonList="{{buttonFootList}}" contentList="{{contentnFootList}}" bind:open="open"></dk-save-button>

+ 0 - 1
package-accounts-manage/pages/daily-reconciliation-statement/daily-reconciliation-statement.wxss

@@ -1 +0,0 @@
-/* package-accounts-manage/pages/daily-reconciliation-statement/daily-reconciliation-statement.wxss */

+ 8 - 8
package-basic-data/pages/staff/detail/detail.js

@@ -19,11 +19,11 @@ Page({
   data: {
     cardList: ['main'],
     contentObj: {
-      main: [ 
+      main: [
         { code: 'staffName', type: 'str', required: true, title: mixins.$t('staffName') },
-        { code: 'staffPhone', type: 'phone', title: mixins.$t('staffPhone'), required: true },
+        { code: 'staffPhone', type: 'phone', title: mixins.$t('staffPhone'), readonly: true, required: true },
         { code: 'orgId', name: 'orgName', type: 'drop', required: true, dropType: 'org' },
-        { code: 'roleId', name: 'roleName', type: 'mutidrop', required: false, dropType: 'role' }, 
+        { code: 'roleId', name: 'roleName', type: 'mutidrop', required: false, dropType: 'role' },
       ]
     },
     // 路由
@@ -61,7 +61,7 @@ Page({
     return this.excute(this.data.service, this.data.service.insertRequestStaff, this.data.params)
   },
 
- 
+
   /**
    * @desc : 给表单赋值
    * @date : 2024/2/1 15:49
@@ -83,9 +83,9 @@ Page({
   * @date : 2024/2/1 15:49
   * @author : 姜永辉
   */
-  setSearchParams(params) { 
+  setSearchParams(params) {
     // openid
-    params.userWxid =  this.data.formType
+    params.userWxid = this.data.formType
     return params
   },
 
@@ -104,8 +104,8 @@ Page({
   * 生命周期函数--监听页面加载
   */
   onLoad: function (options) {
-    console.log("onLoad",options);
-    
+    console.log("扫码页面的值", options, this.data.formType);
+
   },
 
   /**

+ 8 - 6
pages/home-page/home-page.js

@@ -29,7 +29,7 @@ Page({
         // 收款额
         collectionAmount: 0,
         // 背景
-        background:'linear-gradient(105.85deg, #F0F5FF -56.04%, #0E23E1 96.41%)'
+        background: 'linear-gradient(105.85deg, #F0F5FF -56.04%, #0E23E1 96.41%)'
       },
       {
         title: '本周数据',
@@ -39,7 +39,7 @@ Page({
         collectionAmount: 0,
         // 背景
         // background:'linear-gradient(105.85deg, #C1D1ED -56.04%, #507BCC 96.41%)'
-        background:'linear-gradient(105.85deg, #C1D1ED -56.04%, #2b63cc 96.41%)'
+        background: 'linear-gradient(105.85deg, #C1D1ED -56.04%, #2b63cc 96.41%)'
       }
     ],
     statusHeight: 0, // 状态栏高度
@@ -385,12 +385,14 @@ Page({
     this.getReceivableAccountSum('week');
     // 查询应收和收款额(本月)
     this.getReceivableAccountSum('month');
-    // options 中的 scene  
+    // options 中的 scene  todo.. 先不要删除日志
+    console.log("homepage---", options.scene);
     if (options.scene) {
       // var scene = options.scene
-      var scene = decodeURIComponent(options.scene)
-      let openid = scene.s
-
+      var openid = decodeURIComponent(options.scene)
+      console.log("homepage---", openid);
+      // let openid = scene.s
+      // console.log("homepage---", openid);
       // 邀请员工的确认
       wx.navigateTo({
         url: '/package-basic-data/pages/staff/detail/detail',