Răsfoiți Sursa

账款核销

于继渤 1 an în urmă
părinte
comite
7c0bbb1cb5

+ 53 - 0
api/pages/mac/accReceiptPayment.js

@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright(c) 2024 dongke All rights reserved. / Confidential
+ * 类的信息:
+ *		1.程序名称:
+ *		2.功能描述:账款核销
+ * 编辑履历:
+ *		作者				日期					版本				修改内容
+ *		姜永辉		  	    2024-1-19       		1.00		       	新建
+ *******************************************************************************/
+module.exports = {
+	accReceiptPaymentService: {
+		// 前缀
+		prefix: 'mdm-server/mac/receipt/',
+		insertReceivableReceipt: 'insert_receivable_receipt',
+		updateReceivableReceipt: 'update_receivable_receipt',
+		insertPayableReceipt: 'insert_payable_receipt',
+		insertReceipt: 'insert_receipt',
+		insertRefund: 'insert_refund',
+		invalid: 'invalid/',
+
+	},
+
+	routeUrl: {
+		accReceiptPayment: {	
+			docName:{key:'receipt' ,title:'收款单'},
+			cusReturnCollection: { key: 'cusReturnCollection', method: 'cusReturnCollection',image: 'btn-customer-refund.png' },
+			invaidOrder: { key: 'invaidOrder', method: 'invaidOrder',image: 'btn-void.png',question:true  },
+			editOrder: { key: 'editOrder', method: 'editOrder', primaryKey: 'rpId',image: 'btn-edit.png' },
+			printedBill: { key: 'printedBill', method: 'printedBill', image:'btn-printing.png' },//打印
+			// 收款单新建
+			add: { key: 'add', url: '/package-accounts-manage/pages/receipt/add/add' },
+			// 收款单新建
+			addReturn: { key: 'addReturn', url: '/package-accounts-manage/pages/receipt/add-return/add-return' },
+			// 付款单新建
+			addPay: { key: 'addPay', url: '/package-accounts-manage/pages/payment-order/add/add' },
+			// 付款单新建
+			addReturnPay: { key: 'addReturnPay', url: '/package-accounts-manage/pages/payment-order/add-return/add-return' },
+
+			edit: { key: 'edit', url: '/package-accounts-manage/pages/receipt/detail/detail' },
+			detail: {
+				key: 'detail', url: '/package-purchase/pages/purchase-return/detail/detail'
+			},
+			selectBill: {
+				key: 'selectBill', url: '/package-base-select/pages/select-bill/select-bill'
+			},
+			chooseSupplier: { key: 'chooseSupplier', url: '/package-base-select/pages/select-data/select-data', type: 'supplier' },
+			chooseStaff: { key: 'chooseStaff', url: '/package-base-select/pages/select-data/select-data', type: 'staff' },
+			staffadd: { key: 'staffadd', url: '/package-basic-data/pages/staff/add/add' },
+			chooseOrg: { key: 'chooseOrg', url: '/package-base-select/pages/select-data/select-data', type: 'org' },
+			chooseWh: { key: 'chooseWh', url: '/package-base-select/pages/select-data/select-data', type: 'warehouse' },
+		}
+	}
+}; 

+ 2 - 1
app.js

@@ -74,10 +74,11 @@ const saleReport = require('./api/pages/mst/saleReport.js');
 const printLayout = require('./api/pages/mst/printLayout.js');
 const exportPage = require('./api/pages/common/export.js');
 const inboundItem = require('./api/pages/ivt/inboundItem.js');
+const accReceiptPayment = require('./api/pages/mac/accReceiptPayment.js');
 
 // api服务路由文件
 var apiList = [common, oauth,setting, company, wechatPay,user, staff, staffRight, staffPurview, settingValue, customer, role, roleFun, org, roleSensitive, goodsBrand, goodsCategory, goodsSeries, unit, supplier, warehouse, saleChannel, goodsSku, basicData,customerMst,purchase,account,payment,
-  receiptPayment,inbound,inboundOther,inboundProcessing,inboundPurchaseReturn,outbound,outboundOther,outboundProcessing,outboundSaleReturn,inventory,moneyAccount,intoReturn,intoReturnItem,cusFollow,order,transfer,saleOutBound,inboundReturn,cusReceiptPayment,menuFrequency,userMenuFrequency,comMenu,saleOutBoundReturn,activity,check,freeze,otherReceivable,otherPayable,inventoryAdjustment,report,saleReport,printLayout,exportPage,inboundItem]
+  receiptPayment,inbound,inboundOther,inboundProcessing,inboundPurchaseReturn,outbound,outboundOther,outboundProcessing,outboundSaleReturn,inventory,moneyAccount,intoReturn,intoReturnItem,cusFollow,order,transfer,saleOutBound,inboundReturn,cusReceiptPayment,menuFrequency,userMenuFrequency,comMenu,saleOutBoundReturn,activity,check,freeze,otherReceivable,otherPayable,inventoryAdjustment,report,saleReport,printLayout,exportPage,inboundItem,accReceiptPayment]
 
 const util = require('./utils/util.js')
 const baseMethod = require('./api/pages/baseMethod.js')

+ 250 - 47
package-accounts-manage/pages/acc-verification/acc-verification.js

@@ -1,66 +1,269 @@
-// package-accounts-manage/pages/acc-verification/acc-verification.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({
+  mixins: [mixins],
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    // 查询条件
+    searchContent: [
+      {
+        code: 'makeTime', title: mixins.$t('pastThirthtyDays'),
+        defaultValue: 5, searchType: Constants.searchType.date
+      },
+      { code: 'staff', title: mixins.$t('staffId'), dropType: 'staff' },
+      { code: 'org', title: mixins.$t('orgId'), dropType: 'org' },
+      { code: 'choose', title: mixins.$t('choose'), searchType: Constants.searchType.pick }],
+    // 查询条件-筛选
+    pullMenuList: [
+      {
+        code: 'rpNo',
+      },
+      {
+        code: 'cusName',
+      },
+      {
+        code: 'cusPhone',
+      },
+      {
+        code: 'accDate',
+        title: mixins.$t('accDate'),
+        dataType: 'date'
+      },
 
-    /**
-     * 页面的初始数据
-     */
-    data: {
-
-    },
+      {
+        code: 'staffName',
+      },
+      {
+        code: 'orgName',
+      },
+      {
+        code: 'flgValid',
+        title: mixins.$t('flgValid'),
+        dataType: 'checkbox'
+      },
+    ],
+    // 列表区(内容)
+    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: 'printedBill',
+        title: mixins.$t('printedBill'),
+      },
 
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad(options) {
+    ],
 
+    // 底部保存按钮
+    buttonFootList: [{
+      name: 'add',
+      title: mixins.$t('add'),
+    }],
+    // 列表区(脚部金额)
+    footerAmount: {
+      name: 'sumAmtRec',
+      title: mixins.$t('totalAmount')
     },
+    // 列表区(脚部信息)
+    footerInfo: [{ name: 'sumAmtRec', }],
+    contentnFootList: [
+      {
+        title: mixins.$t('totalAmount'),
+        code: 'sumAmtRec',
+        content: 0,
+        type: 'number'
+      }, {
+        type: 'count',
+        code: 'count', 
+        bill: 1,
+      }
+    ],
+    btnFormData: null,
+    // 路由
+    routeObjName: 'accReceiptPayment',
+    // 主键Id
+    primaryKey: 'rpId',
 
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady() {
+  },
 
-    },
+  /**
+  * @desc : 设置查询参数
+  * @date : 2024年3月8日
+  * @author : 于继渤
+  */
+  setSearchParams(params) {
+    //收付款类型-收款的查询参数
+    // params.rpType = Constants.rpType.receipt
+    params.staffIdList = params.staffIds
+    params.objectId = this.data.id
+    params.orgIdList = params.orgIds
+    if (params.flgValid) {
+      params.flgValidList = [true, false]
+    } else {
+      params.flgValidList = [true]
+    }
+    return params;
+  },
 
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow() {
+  /** 
+   * @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 : 于继渤
      */
-    onHide() {
-
-    },
+  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')
 
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload() {
+    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
+    })
+  },
 
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh() {
+  /**
+    * @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
+        })
+      }
+    })
 
-    },
+  },
 
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom() {
+  /**
+    * @desc : (编辑)
+    * @date : 2024/2/1 15:49
+    * @author : 于继渤
+    */
+  editOrder(e) {
+    let item = e
+    let id = item.rpId
+    console.log(item.rpType,);
+    // 收款
+    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,
+            item:item,
+            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,
+            item:item,
+            formMode: Constants.formMode.edit
+          })
+        }
+      })
+    }
 
-    },
+  },
 
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage() {
+  /**
+    * @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()
+      }
+    })
 
-    }
+  },
 })

+ 3 - 1
package-accounts-manage/pages/acc-verification/acc-verification.json

@@ -1,3 +1,5 @@
 {
-    "usingComponents": {}
+  "usingComponents": {},
+  "navigationBarTitleText":"账款核销",
+  "enablePullDownRefresh": true
 }

+ 19 - 2
package-accounts-manage/pages/acc-verification/acc-verification.wxml

@@ -1,2 +1,19 @@
-<!--package-accounts-manage/pages/acc-verification/acc-verification.wxml-->
-<text>package-accounts-manage/pages/acc-verification/acc-verification.wxml</text>
+<!-- 前台导入wxmlUtil.wxs -->
+<wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
+<van-dialog id="van-dialog" />
+<loading wx:if="{{loading}}"></loading>
+<van-sticky scroll-top="0">
+  <!-- 查询条件 -->
+  <dk-dropdown-menu model:value="{{searchForm}}" menuList="{{searchContent}}" pullMenuList="{{pullMenuList}}" 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>