姜永辉 2 лет назад
Родитель
Сommit
b5a9e552af

+ 25 - 0
api/pages/mac/receiptPayment.js

@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright(c) 2024 dongke All rights reserved. / Confidential
+ * 类的信息:
+ *		1.程序名称:
+ *		2.功能描述:收付款单
+ * 编辑履历:
+ *		作者				日期					版本				修改内容
+ *		姜永辉		  	    2024-1-19       		1.00		       	新建
+ *******************************************************************************/
+module.exports = {
+	receiptPaymentService: {
+		// 前缀
+		prefix: 'mdm-server/mac/receiptPayment/',
+	},
+
+	routeUrl: {
+		receiptPayment: {
+			add: { key: 'add', url: '/package-accounts-manage/pages/receipt/add/add' },
+			edit: { key: 'edit', url: '/package-accounts-manage/pages/receipt/detail/detail' },
+			detail: {
+				key: 'detail', url: '/package-purchase/pages/purchase-return/detail/detail'
+			},
+		}
+	}
+}; 

+ 5 - 1
app.js

@@ -34,6 +34,9 @@ const goodsSku = require('./api/pages/mst/goodsSku.js');
 const basicData = require('./api/pages/mst/basicData.js');
 const customerMst = require('./api/pages/mst/customer.js');
 const purchase = require('./api/pages/pur/purchase.js');
+
+const receiptPayment = require('./api/pages/mac/receiptPayment.js');
+
 const inbound = require('./api/pages/ivt/inbound.js');
 const inboundOther = require('./api/pages/ivt/inboundOther.js');
 const inboundProcessing = require('./api/pages/ivt/inboundProcessing.js');
@@ -48,7 +51,8 @@ const cusFollow = require('./api/pages/mst/cusFollow.js');
 const order = require('./api/pages/sale/order.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,inbound,inboundOther,inboundProcessing,inboundSaleReturn,outboundOther,outboundProcessing,outboundPurchaseReturn,moneyAccount,intoReturn,intoReturnItem,cusFollow,order]
+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,
+  receiptPayment,inbound,inboundOther,inboundProcessing,inboundSaleReturn,outboundOther,outboundProcessing,outboundPurchaseReturn,moneyAccount,intoReturn,intoReturnItem,cusFollow,order]
 
 const util = require('./utils/util.js')
 const baseMethod = require('./api/pages/baseMethod.js')

+ 1 - 0
app.json

@@ -194,6 +194,7 @@
             "name": "package-base-select",
             "pages": [
                 "pages/base-test/base-test",
+                "pages/select-collection_confirm/select-collection_confirm",
                 "pages/select-data-kind/select-data-kind",
                 "pages/select-data-dictionary/select-data-dictionary",
                 "pages/select-storage-object/select-storage-object",

+ 21 - 0
components/dkbusiness/dk-label-multiple-select/dk-label-multiple-select.js

@@ -107,6 +107,27 @@ Component({
         dataSourceCode = 'org'
         name = '业务部门'
       }
+       //收付款类型
+       if (typeName === 'rpType') {
+        dataSourceCode = 'rpType'
+        name = '收付款类型'
+        let stowList = [{
+          name: '收款',
+          id: '收付款类型-收款',
+          infotype: 'default'
+        },         
+        {
+          name: '付款',
+          id: '收付款类型-付款',
+          infotype: 'default'
+        },
+        ];
+        this.setData({
+          moreList: stowList,
+          moreFlag: false,
+          loadDataFlag: false
+        })
+      }
       //业务员
       if (typeName === 'staff') {
         dataSourceCode = 'staff'

+ 13 - 1
i18n/zh-CN.js

@@ -36,6 +36,18 @@ const button = {
   responsiblePerson:'责任人',
 }
 
+// 资金
+const mac = {
+  paymentOrder:'付款单',
+  receiptOrder:'收款单',
+  receiptDate:'收款日期',
+  paymentDate:'付款日期',
+  receiptInfo:'收款信息',
+  paymentInfo:'付款信息', 
+  paymentOrderNo:'付款单号',
+  receiptOrderNo:'收款单号',
+}
+
 const ivt = {
   warehousingProcessing: '待入库',
   outboundProcessing: '待出库',
@@ -358,5 +370,5 @@ const fund = {
 
 }
 module.exports = {
-  items: Object.assign({}, fund, home, ivt, basicData, columns, saleOrder, button, messages, others, accountsManage, org, supplier, goodsSku, customer)
+  items: Object.assign({}, fund, home, ivt,mac, basicData, columns, saleOrder, button, messages, others, accountsManage, org, supplier, goodsSku, customer)
 }

+ 48 - 21
package-accounts-manage/pages/receipt/add/add.js

@@ -1,11 +1,13 @@
 const mixins = require('@/mixins/index.js')
+const Constants = require('@/utils/Constants.js');
+
 Page({
   mixins: [mixins],
   /**
    * 页面的初始数据
    */
   data: {
-    cardList: [{name:'main'},{name:'items',title:'应收'},{name:'file'}],
+    cardList: [{ name: 'main' }, { name: 'items', title: '应收' }, { name: 'file' }],
     contentObj: {
       main: [
         { code: 'staffId', name: 'staffName', type: 'drop', required: true, dropType: 'staff', title: '收款人' },
@@ -14,38 +16,63 @@ Page({
         { code: 'collectAmount', type: 'number', title: '收款优惠', required: false },
         { code: 'staffId', name: 'staffName', type: 'drop', required: true, dropType: 'staff', title: '收款类型' },
       ],
-      items:[{ code: 'collectType', name: 'collectName', type: 'drop', required: true, dropType: 'collect' },{ code: 'collectAmount', type: 'number', title: '收款金额', required: true }],
-      file:[{ code: 'remarks', type: 'textarea', title: '备注' }, { code: 'file', type: 'uploader', title: '附件' }]
+      items: [{
+        code: 'collectType', name: 'collectName', type: 'drop', required: true, dropType: 'collect'
+      },
+      { code: 'collectAmount', type: 'number', title: '收款金额', required: true }
+      ],
+      file: [{ code: 'remarks', type: 'textarea', title: '备注' }, { code: 'file', type: 'uploader', title: '附件' }]
     },
-  },
-  getData() {
-
+    // 弹出按钮
+    buttonList: [{
+      name: 'merge',
+      title: '收款'
+    }],
+    contentList: [{
+      code: 'need',
+      title: mixins.$t('totalAmount'),
+      type: 'str'
+    }, {
+      code: 'amount',
+      content: 0,
+      type: 'number'
+    }],
+    btnFormData: null,
   },
 
+  /**
+  * @desc : 客户调转
+  * @date : 2024年3月8日
+  * @author : 姜永辉
+  */
   toCustomers() {
-    wx.navigateTo({
-      url: '../../selecting-customers/selecting-customers',
-    })
+    // wx.navigateTo({
+    //   url: '../../selecting-customers/selecting-customers',
+    // })
   },
 
-  openSingle(e) {
-    let key = e.currentTarget.dataset.key
-    if (key === 'payment-type') {
-      // wx.navigateTo({
-      //   url: '../../document-list/document-list',
-      // })
-    }
-  },
+  /**
+  * @desc : 客户调转
+  * @date : 2024年3月8日
+  * @author : 姜永辉
+  */
   toDocumentList() {
     wx.navigateTo({
       url: '../../document-list/document-list',
     })
   },
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad(options) {
 
+  /**
+  * @desc : 收款跳转
+  * @date : 2024年3月8日
+  * @author : 姜永辉
+  */
+  saveCollect(e) {
+    console.log(e, "saveCollect")
+    wx.navigateTo({
+      url: '/package-base-select/pages/select-collection_confirm/select-collection_confirm',
+    })
+    
   },
 
 })

+ 3 - 2
package-accounts-manage/pages/receipt/add/add.wxml

@@ -9,5 +9,6 @@
 </dk-form-more-items>
 
 <view style="height: 220rpx;"></view>
-<!-- 底部信息 -->
-<dk-save-bottom flagTypeName="receipt-add" totallength="{{2002}}" bind:submit="toClose" bind:allClean="toAdd" />
+
+<!-- 新建按钮 -->
+<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{false}}" btnRightFlag="{{true}}" buttonList="{{buttonList}}" contentList="{{contentList}}" bind:open="saveCollect"></dk-save-button>

+ 48 - 63
package-accounts-manage/pages/receipt/detail/detail.js

@@ -1,66 +1,51 @@
-// package-accounts-manage/pages/receipt/detail/detail.js
+const mixins = require('@/mixins/index.js')
 Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad(options) {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide() {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload() {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh() {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom() {
-
-    },
-
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage() {
-
+  mixins: [mixins],
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    cardList: [{name:'main'},{name:'items',title:'应收'},{name:'file'}],
+    contentObj: {
+      main: [
+        { code: 'staffId', name: 'staffName', type: 'drop', required: true, dropType: 'staff', title: '收款人' },
+        { code: 'staffId', name: 'staffName', type: 'drop', required: false, dropType: 'staff', title: '收款部门' },
+        { code: 'collectAmount', type: 'number', title: '本次收款', required: true },
+        { code: 'collectAmount', type: 'number', title: '收款优惠', required: false },
+        { code: 'staffId', name: 'staffName', type: 'drop', required: true, dropType: 'staff', title: '收款类型' },
+      ],
+      items:[{ code: 'collectType', name: 'collectName', type: 'drop', required: true, dropType: 'collect' },{ code: 'collectAmount', type: 'number', title: '收款金额', required: true }],
+      file:[{ code: 'remarks', type: 'textarea', title: '备注' }, { code: 'file', type: 'uploader', title: '附件' }]
+    },
+  },
+  getData() {
+
+  },
+
+  toCustomers() {
+    wx.navigateTo({
+      url: '../../selecting-customers/selecting-customers',
+    })
+  },
+
+  openSingle(e) {
+    let key = e.currentTarget.dataset.key
+    if (key === 'payment-type') {
+      // wx.navigateTo({
+      //   url: '../../document-list/document-list',
+      // })
     }
+  },
+  toDocumentList() {
+    wx.navigateTo({
+      url: '../../document-list/document-list',
+    })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
 })

+ 7 - 121
package-accounts-manage/pages/receipt/detail/detail.wxml

@@ -1,127 +1,13 @@
-<view class="dk-card-outer-class">
-  
-  <!-- 单据信息 -->
-  <view class="dk-card-class">
 
-    <van-field label-class="red-label" value="{{ '2024-12-03' }}" input-align="right" label="收款日期" placeholder="选客户" data-type='name' autosize border="{{ false }}" bind:change="fieldChange">
-    </van-field>
 
+<!-- 前台导入wxmlUtil.wxs -->
+<wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
 
-    <van-field label-class="red-label" value="{{ '王暖暖' }}" input-align="right" label="客户名称" placeholder="选客户" data-type='name' autosize border="{{ false }}" bind:change="fieldChange">
-    </van-field>
-    <van-field label-class="nomal-label" value="{{ '156 5678 5643' }}" input-align="right" label="客户电话" placeholder="选客户" data-type='name' autosize border="{{ false }}" bind:change="fieldChange">
-    </van-field>
+<loading wx:if="{{loading}}" loadingName="加载中" backgroundColor="#f2f2f2;" opacity="0.8"></loading>
 
+<dk-form-more-items id="{{formName}}" objCol="customerId" objLabel="客户名称" objType="customer"  dateCol="accountDate" dateLabel="收款日期"   cardList="{{cardList}}" contentObj="{{contentObj}}" model:value="{{formData}}" bind:chooseData="chooseData">
+</dk-form-more-items>
 
-    <van-cell border="{{false}}">
-      <view slot="title" style="color: #95A8CB;">
-        应收总额
-      </view>
-      <view Cell Slot="value" style="float:left;margin-left:1vw;width:98%;">
-        <dk-number-input fontSize="14" center="right" data-key="priceSale" inputColor="#CAA977" inputValue="{{ 2002 }}" bind:triggerBindValue="changeSumAmount"></dk-number-input>
-
-      </view>
-    </van-cell>
-
-
-
-  </view>
-
-
-
-
-  <view class="dk-card-class" style="margin-top: 20rpx;">
-
-    <van-field label-class="red-label" input-width="200rpx" input-align="right" data-key="product-brand" 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-align="right" data-key="product-brand" maxlength="25" type="text" value="{{ '三水红星门店' }}" label="收款部门" placeholder="请选择" autosize border="{{ false }}" right-icon="arrow" color="#95A8CB" catchtap="openSingle" readonly="{{true}}">
-    </van-field>
-
-
-
-    <van-cell border="{{false}}">
-      <view slot="title" style="color: #E4002B;">
-        本次收款
-      </view>
-      <view Cell Slot="value" style="float:left;margin-left:1vw;width:98%;">
-        <dk-number-input fontSize="14" center="right" data-key="priceSale" inputColor="#CAA977" inputValue="{{ 2000 }}" bind:triggerBindValue="changeSumAmount"></dk-number-input>
-
-      </view>
-    </van-cell>
-
-    <van-cell border="{{false}}">
-      <view slot="title" style="color: #95A8CB;">
-        收款优惠
-      </view>
-      <view Cell Slot="value" style="float:left;margin-left:1vw;width:98%;">
-        <dk-number-input fontSize="14" center="right" data-key="priceSale" inputColor="#CAA977" inputValue="{{ 2 }}" bind:triggerBindValue="changeSumAmount"></dk-number-input>
-
-      </view>
-    </van-cell>
-
-
-    <van-field label-class="red-label" input-width="200rpx" input-align="right" data-key="product-brand" maxlength="25" type="text" value="{{ '选源单收款' }}" label="收款类型" placeholder="请选择" autosize border="{{ false }}" right-icon="arrow" color="#95A8CB" catchtap="openSingle" readonly="{{true}}">
-    </van-field>
-
-  </view>
-
-
-  <view class="dk-card-class" style="margin-top: 20rpx;">
-    <view style="display: flex;font-size: 14px;padding: 20rpx;">
-
-      <view style="font-size:16px;color:#1B365D;font-weight: 600;width: 26%;">应收单据</view>
-      <view style="color:#95A8CB;font-size:12px;display: flex; align-items: flex-end;width: 59%;">共10单</view>
-      <view style="width: 15%;text-align: right;">
-      
-        <view style="height: 40rpx;border-radius: 6rpx;background-color:#9FAEE5;text-align: center;">
-              <text style=" font-size: 13px;color:  #FFFFFF;">收起</text>
-            </view>
-      </view>
-    </view>
-
-
-    <van-field label-class="nomal-label" value="{{ '100002225601' }}" input-align="right" label="单据单号" placeholder="" data-type='name' autosize border="{{ false }}" bind:change="fieldChange">
-    </van-field>
-
-    <van-field label-class="nomal-label" value="{{ '1000.00' }}" input-align="right" label="已核销金额" placeholder="" data-type='name' autosize border="{{ false }}" bind:change="fieldChange">
-    </van-field>
-
-    <van-field label-class="nomal-label" value="{{ '3002.00' }}" input-align="right" label="未核销金额" placeholder="" data-type='name' autosize border="{{ false }}" bind:change="fieldChange">
-    </van-field>
-
-    <van-cell border="{{false}}">
-      <view slot="title" style="color: #E4002B;">
-        本次核销
-      </view>
-      <view Cell Slot="value" style="float:left;margin-left:1vw;width:98%;">
-        <dk-number-input fontSize="14" center="right" data-key="priceSale" inputColor="#CAA977" inputValue="{{ 2002 }}" bind:triggerBindValue="changeSumAmount"></dk-number-input>
-
-      </view>
-    </van-cell>
-      
-      <view style="margin:20rpx; border:solid 3rpx #606EB2;height:30px;border-radius: 6px;background-color:#F8F9FD;display: flex;justify-content: center;align-items: center;">
-        <van-icon name="plus" color="#606EB2" size="40rpx"/> 
-      </view>
-  </view>
-
-
-  <view class="dk-card-class" style="margin-top: 20rpx;">
-  
-  <van-field input-width="200rpx" input-class="dk-cell-value-class" input-align="left" label-class="nomal-label" data-key="addressNo" maxlength="50" value="{{ showPopupItem.remark }}" input-align="right" label="备注" placeholder="请输入备注" autosize border="{{ false }}" bind:change="changeCustomerFormField">
-  </van-field>
-
-
-
-  <view style="display:flex;width:100%;margin: 1vw;padding-top:20rpx;">
-      <view style="width: 30%; flex:1;color: #95A8CB;font-size: 28rpx;padding-left: 27rpx;">附件</view>
-      <view style="width: 70%;text-align: left;">
-        <van-uploader max-count="5" accept="image" style="margin-left: 4%;border-radius: 15rpx;" preview-size="160rpx;" file-list="{{ fileList }}" bind:delete="deleteImg" bind:after-read="afterRead" multiple="true" imageFit="aspectFit" />
-      </view>
-    </view>
-</view>
-<!-- 保留高度 -->
 <view style="height: 220rpx;"></view>
-</view>
-
-
+<!-- 底部信息 -->
+<dk-save-bottom flagTypeName="receipt-add" totallength="{{2002}}" bind:submit="toClose" bind:allClean="toAdd" />

+ 163 - 155
package-accounts-manage/pages/receipt/receipt.js

@@ -1,5 +1,4 @@
 const Constants = require('@/utils/Constants.js');
-const util = require('@/utils/util.js')
 const mixins = require('@/mixins/index.js')
 Page({
   mixins: [mixins],
@@ -8,172 +7,181 @@ Page({
    */
   data: {
     // 查询条件
-    searchContent: [{ code: 'createtime', title: '本月', defaultValue: 3, searchType: Constants.searchType.date }, 
-    { code: 'staff', title: '业务员', dropType: 'staff' },
-    { code: 'org', title: '业务部门', dropType: 'org' },
-    { code: 'choose', title: '筛选', searchType: Constants.searchType.pick }],
+    searchContent: [
+      { code: 'createtime', 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: 'purchaseStatus', pullType: 'mSelect', typeName: 'purchaseStatus' },
-    { code: 'contactName', dataType: '' },
-    { code: 'deliveryPhone', dataType: '' },
-    { code: 'addressFull', dataType: '' },
-    { code: 'makingTime', dataType: 'date' }, { code: 'deliveryTime', dataType: 'date' }],
+    pullMenuList: [
+      {
+        code: 'rpType',
+        pullType: 'mSelect',
+        typeName: 'rpType'
+      },
+      {
+        code: 'orderNo',
+      },
+      {
+        code: 'cusName',
+      },
+      {
+        code: 'cusPhone',
+      },
+
+      {
+        code: 'receiptDate',
+        title: 'receiptDate',
+        dataType: 'date'
+      },
+
+      {
+        code: 'staffName',
+      },
+      {
+        code: 'orgName',
+      },
+    ],
     // 列表区(内容)
-    contentList: [{ name: 'orderNo', title: '订单编号' },
-    { name: [{ name: 'orgName', title: '' },{ name: 'staffName', title: '' }, ], title: '门店/业务员' },
-    { name: 'makingTime', title: '收款日期' }, {name: [{ name: 'number1', title: '' }, { name: 'number2', title: '' }], title: '占用/使用金额' }],
+    contentList: [
+      { name: 'rpNo', title: '收款单号' },
+      {
+        name: [{ name: 'orgName', title: '' },
+        { name: 'staffName', title: '' },],
+        title: '收款信息'
+      },
+      { name: 'amtReceipt', title: '核销应收' },],
     // 弹出按钮
-    buttonList: [{ name: 'follow', title: '采购作废' }, { name: 'followTask', title: '冲正重开' }, { name: 'purchase-return-repla-sup', title: '采购退货' },
-    { name: 'collection', title: '采购退货冲正' }, { name: 'merge', title: '打印票据' }],
-    totallength: 234999, //视图下方提醒数量
-    selectTotallength: 12,
+    buttonList: [
+      {
+        name: 'customerRefundList',
+        title: '客户退款',
+      },
+      {
+        name: 'customerRefundList',
+        title: '取消收款',
+      }, {
+        name: 'customerRefundList',
+        title: mixins.$t('ticketPirnt'),
+      }
+    ],
     selectlength: 5,
-    // 路由
-    routeObjName: 'receipt',
-    tableData: [],
-    active: 0,
-  },
-  getData() {
-    this.setData({
-      totallength: 6000,
-      tableData: [
-        {
-          supplierName: '张先生',
-          displayStatus: '应收收款',
-          makingTime: '2022-04-04',
-          orderNo: 'FQ202207061423001',
-          backgroundColor: '#95A8CB',
-          staffName:'王丽丽',
-          orgName:'佛山居然店',
-          number2:'900.00',
-          number1:'100.00',
-          sumAccount: 2000,
-          collectStatus:'availableBalance',
-          collectStatusAmount:1000,
-        },
-        {
-          supplierName: '张先生',
-          displayStatus: '应收收款',
-          makingTime: '2022-04-04',
-          orderNo: 'FQ202207061423001',
-          backgroundColor: '#95A8CB',
-          staffName:'王丽丽',
-          orgName:'佛山居然店',
-          number2:'900',
-          number1:'100',
-          sumAccount: 2000,
-          collectStatus:'availableBalance',
-          collectStatusAmount:1000,
-        },
-        {
-          supplierName: '张先生',
-          displayStatus: '其他收款',
-          makingTime: '2022-04-04',
-          orderNo: 'FQ202207061423001',
-          backgroundColor: '#95A8CB',
-          staffName:'王丽丽',
-          orgName:'佛山居然店',
-          number2:'900.00',
-          number1:'100.00',
-          sumAccount: 2000,
-          collectStatus:'availableBalance',
-          collectStatusAmount:1000,
-        }
-      ]
-    })
-  },
-  //抽屉打开
-  openSearchPop() {
-    this.setData({
-      show: true,
-    })
-  },
-  onclik(e) {
-    this.setData({
-      showShare: true,
-    })
-  },
-
-  onCloseShare(){
-    this.setData({
-      showShare: false,
-    })
-  },
-    /**
-   * @desc : 抽屉离焦关闭
-   * @author : 于继渤
-   * @date : 2022/5/27 12:16
-   */
-  onClose() {
-    this.setData({
-      show: false
-    })
-    this.selectComponent("#pick").toggle(false) //取消选中样式
-  },
-
-  toAdd(){
-    wx.navigateTo({
-      url: './add/add',
-    })
-  },
-  toDetail(){
-    wx.navigateTo({
-      url: './detail/detail',
-    })
-  },
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad(options) {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow() {
 
+    // 底部保存按钮
+    buttonFootList: [{
+      name: 'add',
+      title: mixins.$t('add'),
+    }],
+    contentnFootList: [
+      {
+        title: '合集金额:',
+        code: 'amount',
+        content: 0,
+        type: 'number'
+      }, {
+        type: 'count',
+        code: 'count',
+        bill: 1,
+        quantity: 2
+      }
+    ],
+    btnFormData: null,
+    // 路由
+    routeObjName: 'receiptPayment',
+    // 主键Id
+    primaryKey: 'rpId',
+    // linshi临时数据
+    tableData: [
+      {
+        supplierName: '张先生',
+        displayStatus: '应收收款',
+        accDate: '2022-04-04',
+        rpNo: 'FQ202207061423001',
+        backgroundColor: '#95A8CB',
+        staffName: '王丽丽',
+        orgName: '佛山居然店',
+        amtReceipt: '900.00',
+        number1: '100.00',
+        sumAccount: 2000,
+        collectStatus: 'availableBalance',
+        collectStatusAmount: 1000,
+      },
+      {
+        supplierName: '张先生',
+        displayStatus: '应收收款',
+        accDate: '2022-04-04',
+        rpNo: 'FQ202207061423001',
+        backgroundColor: '#95A8CB',
+        staffName: '王丽丽',
+        orgName: '佛山居然店',
+        amtReceipt: '900',
+        number1: '100',
+        sumAccount: 2000,
+        collectStatus: 'availableBalance',
+        collectStatusAmount: 1000,
+      },
+      {
+        supplierName: '张先生',
+        displayStatus: '其他收款',
+        accDate: '2022-04-04',
+        rpNo: 'FQ202207061423001',
+        backgroundColor: '#95A8CB',
+        staffName: '王丽丽',
+        orgName: '佛山居然店',
+        amtReceipt: '900.00',
+        number1: '100.00',
+        sumAccount: 2000,
+        collectStatus: 'availableBalance',
+        collectStatusAmount: 1000,
+      }
+    ],
   },
 
   /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide() {
-
+  * @desc : 设置查询参数
+  * @date : 2024年3月8日
+  * @author : 姜永辉
+  */
+  setSearchParams(params) {
+    //收付款类型-收款的查询参数
+    params.rpType = Constants.rpType.receipt
+    return params;
   },
 
-  /**
-   * 生命周期函数--监听页面卸载
+  /** 
+   * @desc : 查询 入库单
+   * @date : 2024年3月8日
+   * @author : 姜永辉
    */
-  onUnload() {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh() {
-
+  getData() {
+    // return this.excute(this.data.service, this.data.service.selectByCond, params);    
   },
-
   /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom() {
-
+     * @desc :   处理接口返回数据
+     * @date : 2024年3月8日
+     * @author : 姜永辉
+     */
+  handleSearchData(tableData) {
+    let temp = tableData
+    console.log("tableData", tableData);
+    temp.forEach(it => {
+      it.makeTime = it.makeTime.substring(0, 10)
+      // 入库对象
+      if (it.intoType == Constants.intoType.other) {
+        it.intoObject = it.cusName != null ? it.cusName : it.supplierName
+      }
+    })
+    let sumAmount = 0 //总的 合计金额
+    let sumNumber = 0 // 单数
+    let sumQty = 0 //总的 合集数量
+    sumAmount = tableData.sum('intoingAmt')
+    sumNumber = tableData.length
+    sumQty = tableData.sum('intoingQty')
+    this.setData({
+      tableData: temp,
+      sumAmount,
+      sumNumber,
+      sumQty
+    })
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage() {
-
-  }
 })

+ 8 - 10
package-accounts-manage/pages/receipt/receipt.wxml

@@ -1,20 +1,18 @@
 <!-- 前台导入wxmlUtil.wxs -->
 <wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
-<loading wx:if="{{loading}}" loadingName="加载中" backgroundColor="#f2f2f2;" opacity="0.8"></loading>
+<loading wx:if="{{loading}}"></loading>
 <van-sticky scroll-top="0">
   <!-- 查询条件 -->
-  <dk-dropdown-menu model:searchForm="{{searchForm}}" menuList="{{searchContent}}" pullMenuList="{{pullMenuList}}" bind:search="searchData" searchTextPlaceholder="{{wxmlUtil.setSearchPlaceholder($t,['customerName','telephone'])}}">
+  <dk-dropdown-menu model:searchForm="{{searchForm}}" menuList="{{searchContent}}" pullMenuList="{{pullMenuList}}" bind:search="searchData" searchTextPlaceholder="{{wxmlUtil.setSearchPlaceholder($t,['orderNo'])}}">
   </dk-dropdown-menu>
-</van-sticky>
+</van-sticky> 
 <!-- 暂无数据 -->
-<van-empty wx:if="{{tableData.length<=0}}" description="暂无数据" />
+<van-empty wx:if="{{tableData.length<=0}}" description="{{$t['nodata']}}" />
 <!-- 列表区 -->
-<dk-list list="{{tableData}}" titleCorner="" title="supplierName" status="displayStatus" content="{{contentList}}" collectCol="sumAccount" collectName="收款" contentObj="{{contentObj}}" contentCol="" footerAmount="{{footerAmount}}" footerInfo="{{footerInfo}}" bind:toDetail="toDetail" bind:toTitle="toTitle" bind:toStatus="toStatus" bind:toPoint="toPoint" routeObjName="{{routeObjName}}" buttonList="{{buttonList}}" bind:open="open"></dk-list>
+<dk-list list="{{tableData}}" titleCorner="" title="supplierName" subTitle="accDate" status="displayStatus" content="{{contentList}}" collectCol="sumAccount" collectName="收款" contentObj="{{contentObj}}" contentCol="" footerAmount="{{footerAmount}}" footerInfo="{{footerInfo}}" bind:toDetail="toDetail" bind:toTitle="toTitle" bind:toStatus="toStatus" bind:toPoint="toPoint" routeObjName="{{routeObjName}}" buttonList="{{buttonList}}" bind:open="open"></dk-list>
 
-<van-divider wx:if="{{noMore}}" contentPosition="center" borderColor="#DCDCDC">到底了~</van-divider>
+<van-divider wx:if="{{noMore}}" contentPosition="center" borderColor="#DCDCDC">{{$t['noMore']}}~</van-divider>
 
 <view style="height: 200rpx;"></view>
-
-
-<!-- 新建按钮 -->
-<dk-save-bottom purchasePriceFlag="{{false}}" flagTypeName="order-add" selectTotallength="{{selectTotallength}}" selectlength="{{selectlength}}" totallength="{{totallength}}" bind:submit="toAdd" submitFlag="{{true}}" />
+<!-- 新建按钮 --> 
+<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{false}}" btnRightFlag="{{true}}" buttonList="{{buttonFootList}}" contentList="{{contentnFootList}}" bind:open="open"></dk-save-button>

+ 1470 - 0
package-base-select/pages/select-collection_confirm/select-collection_confirm.js

@@ -0,0 +1,1470 @@
+/*******************************************************************************
+ * Copyright(c) 2021 dongke All rights reserved. / Confidential
+ * 类的信息:
+ *		1.程序名称:
+ *		2.功能描述:客户收款确认
+ * 编辑履历:
+ *		作者				日期					版本				修改内容
+ *		jyh		     2022-5-25		        1.00		   	    新建
+ *******************************************************************************/
+const api = require('@/utils/api');
+const app = getApp()
+const Constants = require('@/utils/Constants');
+const util = require('@/utils/util.js')
+const config = require('@/config/config.js');
+import Dialog from '@/dist/dialog/dialog.js'; 
+Page({
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        active: 0,
+        activeNames: [
+          "1"
+        ],
+        annexPaths: [],
+        btnTitle: "收款成交",
+        dealFalg: "true",
+        disabledSave: true,
+        fileList: [],
+        form: {
+          balanceAmount: 0,
+          customer: {
+            addressFull: "辽宁省沈阳市浑南区沈阳市浑南区人民政府(新聪街西)1",
+            addressName: "沈阳市浑南区人民政府(新聪街西)",
+            bankAccount: "",
+            customerName: "ZHANGZAHNG",
+            customerPhone: "13512341234"
+          },
+          fileList: [],
+          order: {},
+          orderDetail: [],
+          orderId: "",
+          orgCode: "",
+          receivable: 0,
+          remarks: "",
+          staffCode: "",
+          sumAmount: "70000"
+        },
+        guId: "474fd125-7b97-4c30-88f2-5dd731fd111b",
+        guid: "",
+        page: "orderBillingAdd",
+        pageIndex: "undefined",
+        settlementTypeFlag: true,
+        settlementTypeList: [
+            {
+                accountType: "收款账户类型-现金",
+                accountname: "现金",
+                addressFull: null,
+                ascpId: null,
+                categoryCode: null,
+                categoryId: null,
+                categoryName: null,
+                channelId: null,
+                checked: true,
+                code: null,
+                contactName: null,
+                deliveryPhone: null,
+                cpId: null,
+                customerPhone: null,
+                defSettlementType: 516,
+                defWhId: null,
+                erpOrgCode: null,
+                erpStaffCode: null,
+                flgStore: false,
+                flgValid: null,
+                id: null,
+                imageReceiptCode: null,
+                imageReceiptCode_ping: "https://hgscrm-dev.oss-cn-shenzhen.aliyuncs.com/null",
+                jobId: 0,
+                keyWords: null,
+                name: null,
+                objCode: null,
+                objId: null,
+                objName: null,
+                objType: null,
+                objTypeName: null,
+                orgAscpId: null,
+                orgAscpName: null,
+                orgCode: null,
+                orgId: null,
+                orgName: null,
+                orgSale2Id: null,
+                orgSale2Name: null,
+                orgSalesChannel: null,
+                orgSalesChannelName: null,
+                parentId: null,
+                phone: null,
+                postId: null,
+                postName: null,
+                qvUserid: null,
+                remarks: null,
+                sale1Id: null,
+                sale2Id: null,
+                salesChannel: null,
+                salesChannelName: null,
+                sumAmount: "70000",
+                toiletsNum: null,
+                typeId: 516,
+                typeName: "无库无ERP00001",
+                whId: null,
+                whName: null
+            },
+            {
+                accountType: "收款账户类型-现金",
+                accountname: "现金",
+                addressFull: null,
+                ascpId: null,
+                categoryCode: null,
+                categoryId: null,
+                categoryName: null,
+                channelId: null,
+                code: null,
+                contactName: null,
+                deliveryPhone: null,
+                cpId: null,
+                customerPhone: null,
+                defSettlementType: 516,
+                defWhId: null,
+                erpOrgCode: null,
+                erpStaffCode: null,
+                flgStore: false,
+                flgValid: null,
+                id: null,
+                imageReceiptCode: null,
+                imageReceiptCode_ping: "https://hgscrm-dev.oss-cn-shenzhen.aliyuncs.com/null",
+                jobId: 0,
+                keyWords: null,
+                name: null,
+                objCode: null,
+                objId: null,
+                objName: null,
+                objType: null,
+                objTypeName: null,
+                orgAscpId: null,
+                orgAscpName: null,
+                orgCode: null,
+                orgId: null,
+                orgName: null,
+                orgSale2Id: null,
+                orgSale2Name: null,
+                orgSalesChannel: null,
+                orgSalesChannelName: null,
+                parentId: null,
+                phone: null,
+                postId: null,
+                postName: null,
+                qvUserid: null,
+                remarks: null,
+                sale1Id: null,
+                sale2Id: null,
+                salesChannel: null,
+                salesChannelName: null,
+                sumAmount: 0,
+                toiletsNum: null,
+                typeId: 548,
+                typeName: "无库无ERP00002",
+                whId: null,
+                whName: null
+            }
+        ]
+     
+      
+      },
+
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+      
+    },
+    /**
+     * 显示放大图片
+     * @param {*} e 
+     */
+    previewImg: function (e) {
+        let imgs = [e.currentTarget.dataset.imgurl]
+        wx.previewImage({
+            urls: imgs,
+            current: e.currentTarget.dataset.imgurl, //当前图片地址
+            success: function (res) { },
+            fail: function (res) { },
+            complete: function (res) { },
+        })
+    },
+
+    /**
+     *得到初始化数据
+     */
+    getinitdata(orgId) {
+        let param = {
+            orgId: app.globalData.user.orgId,
+            cpId: app.globalData.user.cpId
+        }
+        //按单据的部门获取默认结算方式
+        if (this.data.page == 'orderBillingAdd' || this.data.page == 'orderBilling') {
+            param.orgId = this.data.typeForm.orgId
+        }
+
+
+
+
+        api.request(Constants.BASIC_COMMON_API + 'select_settlement_by_org', 'POST', param).then(res => {
+            if (res.data.code === 200) {
+                let list = res.data.data
+                if (list && list.length > 0) {
+                    list.forEach(element => {
+                        element.sumAmount = 0
+                        if (element.typeId == element.defSettlementType) { //根据组织机构中得默认结算方式id 勾选出默认得
+                            element.checked = true
+                            element.sumAmount = this.data.form.sumAmount
+                        }
+                        element.typeName = element.typeName ? element.typeName : ''
+                        element.typeId = element.typeId ? element.typeId : null
+                        element.imageReceiptCode_ping = config.server_img_http + element.imageReceiptCode
+                    });
+                    list.forEach(res => {
+                        if (res.accountType) {
+                            let accountTypeList = res.accountType.split('-')
+                            res.accountname = accountTypeList[1]
+                        }
+
+                    })
+                } else {
+                    //没有结算方式 设置变量 点击收款按钮返回 提示:当前没有结算方式
+                    this.setData({
+                        settlementTypeFlag: false
+                    })
+                }
+
+                this.setData({
+                    settlementTypeList: list
+                })
+            }
+        })
+    },
+
+    /**
+     * @desc : checkbox点击事件 
+     * @date : 2022/5/23 15:16
+     */
+    catchtapCheck(e) {
+        let item = e.currentTarget.dataset.item
+        let list = this.data.settlementTypeList
+        let form = this.data.form
+        let index = e.target.dataset.index
+
+
+        if (list && list.length > 0) {
+            if (this.data.type == 0 || this.data.type == 4 || this.data.type == 3 || (this.data.page == 'orderBilling' && this.data.type == 1)) {
+                //客户收款结算方式单选
+                list.forEach(item => {
+                    item.checked = false
+                })
+                list.forEach(res => {
+                    if (res.typeId === item.typeId) {
+                        res.checked = !res.checked
+                    }
+                })
+                let settlementTypeListLength = list.filter(item => {
+                    return item.checked
+                })
+                if (settlementTypeListLength.length == 1) {
+                    list.forEach(res => {
+                        if (res.checked) {
+                            res.sumAmount = form.sumAmount
+                        }
+                    })
+                }
+                this.setData({
+                    settlementTypeList: list,
+                    settlementTypeListLength: settlementTypeListLength.length //已选数量
+                })
+            } else {
+                //客户收款结算方式多选
+                if (list[index].checked) {
+                    list[index].sumAmount = Number(0)
+                }
+                list.forEach(res => {
+                    if (res.typeId === item.typeId) {
+                        res.checked = !res.checked
+                    }
+                })
+                //已选数量
+                let settlementTypeListLength = list.filter(item => {
+                    return item.checked
+                })
+
+                if (settlementTypeListLength.length == 1) {
+                    list.forEach(res => {
+                        if (res.checked) {
+                            res.sumAmount = form.sumAmount
+                        }
+                    })
+                }
+                let sumAmountFlag = true
+                if (settlementTypeListLength.length == 0) {
+                    form.sumAmount = form.sumTempAmount
+                    sumAmountFlag = false
+                    this.setData({
+                        sumAmountFlag: false
+                    })
+
+                } else {
+                    sumAmountFlag = true
+                    this.setData({
+                        sumAmountFlag: true
+                    })
+                }
+
+                this.setData({
+                    form: form,
+                    settlementTypeList: list,
+                    settlementTypeListLength: settlementTypeListLength.length //已选数量
+                })
+                if (sumAmountFlag) {
+                    this.getSumAmount(list)
+                }
+
+            }
+        }
+    },
+
+
+    //结算方式金额输入事件
+    sumAmountBindValue(e) {
+
+        let settlementTypeList = this.data.settlementTypeList
+        let value = e.detail.value ? Number(e.detail.value) : 0
+        let index = e.currentTarget.dataset.index
+        settlementTypeList[index].sumAmount = value
+        this.setData({
+            settlementTypeList: settlementTypeList
+        })
+        this.getSumAmount(settlementTypeList)
+    },
+
+    getSumAmount(settlementTypeList) {
+        let form = this.data.form
+        let sumAmountTemp = Number(0)
+        if (settlementTypeList && settlementTypeList.length > 0) {
+            settlementTypeList.forEach(res => {
+                if (res.checked) {
+                    sumAmountTemp = util.AddNumber(sumAmountTemp, res.sumAmount ? res.sumAmount : 0)
+                }
+            })
+            form.sumAmount = sumAmountTemp
+            this.setData({
+                form: form
+            })
+        }
+
+    },
+
+    /**
+     * @desc : 销售价格编辑
+     * @author : 常皓宁
+     * @date : 2022/5/31 14:45
+     */
+    changeSalesPriceField(e) {
+        let form = this.data.form
+        form.sumAmount = e.detail.value;
+        let settlementTypeList = this.data.settlementTypeList
+        if (settlementTypeList && settlementTypeList.length > 0) {
+            settlementTypeList.forEach(res => {
+                if (res.checked) {
+                    res.sumAmount = Number(e.detail.value ? e.detail.value : 0);
+                }
+            })
+        }
+
+        this.setData({
+            settlementTypeList: settlementTypeList,
+            form
+        })
+    },
+
+
+    /**
+     * @desc : checkbox点击事件 
+     * @date : 2022/5/23 15:16
+     */
+    onChangeFlag(e) {
+        let item = e.currentTarget.dataset.item
+        let list = this.data.settlementTypeList
+        list.forEach(res => {
+            if (res.settlementTypeId === item.settlementTypeId) {
+                res.checked = true
+            } else {
+                res.checked = false
+            }
+        })
+        this.setData({
+            settlementTypeList: list
+        })
+    },
+
+    /**
+     * @desc : 手风琴展开事件
+     * @author : 于继渤
+     * @date : 2022/5/26 12:16
+     */
+    onChange(event) {
+        this.setData({
+            activeNames: event.detail,
+        });
+    },
+    /* 客户收款-表单校验 */
+    checkForm() {
+        let form = this.data.form
+        if (!form.staffID) {
+            return {
+                flag: false,
+                msg: '请选择业务员'
+            };
+        }
+        if (!form.orgID) {
+            return {
+                flag: false,
+                msg: '请选择业务部门'
+            };
+        }
+        if (!form.salesChannelID) {
+            return {
+                flag: false,
+                msg: '请选择销售渠道'
+            };
+        }
+        if (!form.customer.customerId) {
+            return {
+                flag: false,
+                msg: '请选择客户'
+            };
+        }
+
+        return {
+            flag: true,
+            msg: '表单校验通过'
+        }
+    },
+    /**
+     * 收款保存
+     * @param {*} e 
+     */
+    btnOK(e) {
+        if (this.data.type == '0') {
+            if (this.data.form.sumAmount < 0) {
+                Dialog.confirm({
+                    title: '提示信息',
+                    showCancelButton: false,
+                    message: '收款不能为负数,如需退款请使用退款申请',
+                })
+                return
+            }
+        }
+        if (this.data.page == 'orderBilling' && (this.data.type == '1' || this.data.type == '0')) {
+            if (this.data.form.sumAmount < 0) {
+                Dialog.confirm({
+                    title: '提示信息',
+                    showCancelButton: false,
+                    message: '收款不能为负数,如需退款请使用退款申请',
+                })
+                return
+            }
+
+        }
+        this.setData({
+            loadingButtonFlag: true
+        })
+        if (this.data.settlementTypeList && this.data.settlementTypeList.length == 0) {
+            wx.showToast({
+                title: '当前没有结算方式',
+                icon: 'none',
+                duration: 1000
+            })
+            this.setData({
+                loadingButtonFlag: false
+            })
+            return
+        }
+        let settlementTypeListTempLength = this.data.settlementTypeList.filter(item => {
+            return item.checked
+        })
+        if (settlementTypeListTempLength.length == 0) {
+            wx.showToast({
+                title: '请选择结算方式',
+                icon: 'none',
+                duration: 1000
+            })
+            this.setData({
+                loadingButtonFlag: false
+            })
+            return
+        }
+        if (!this.data.sumAmountFlag) {
+            wx.showToast({
+                title: '当前没有结算方式',
+                icon: 'none',
+                duration: 1000
+            })
+            this.setData({
+                loadingButtonFlag: false
+            })
+            return
+        }
+        //没有结算方式 设置变量 点击收款按钮返回 提示:当前没有结算方式
+        if (!this.data.settlementTypeFlag) {
+            wx.showToast({
+                title: '当前没有结算方式',
+                icon: 'none',
+                duration: 1000
+            })
+            this.setData({
+                loadingButtonFlag: false
+            })
+            return
+        }
+        //表单提交分支
+        // 0: 无订单的客户收款  1:订单收款 2 退换补收款 3 销售退货收款 4 客户退款
+        if (this.data.type == 0) {
+            let result = this.checkForm();
+            if (!result.flag) {
+                wx.showToast({
+                    title: result.msg,
+                    image: '/static/image/warning.png',
+                    duration: 1000
+                })
+                this.setData({
+                    loadingButtonFlag: false
+                })
+                return
+            }
+            let settlementTypeList = this.data.settlementTypeList
+            let settlementTypeID = ''
+            let settlementTypeName = ''
+            settlementTypeList.forEach(element => {
+                if (element.checked) {
+                    settlementTypeID = element.typeId
+                    settlementTypeName = element.typeName
+                }
+            });
+            if (settlementTypeID == '') {
+                wx.showToast({
+                    title: "请选择收款方式",
+                    image: '/static/image/warning.png',
+                    duration: 1000
+                })
+                this.setData({
+                    loadingButtonFlag: false
+                })
+                return
+            }
+            this.setData({
+                loading: true,
+                loadingButtonFlag: true
+            })
+            let form = this.data.form
+
+            let param = {}
+            let fileList_ = this.data.fileList
+            let fileList = []
+            fileList_.forEach(item => {
+                fileList.push(
+                    {
+                        url: item.FilePath,
+                        type: 'image',
+                        name: '',
+                        createTime: util.formatDataTime(new Date())
+                    })
+            })
+            param.annexPaths = fileList
+
+            // 跟进附件 20220613
+            if (form.editTime) {
+                param.editTime = form.editTime
+            }
+            param.staffId = Number(form.staffID) // 业务员
+            param.orgId = Number(form.orgID) // 业务部门
+            param.salesChannel = Number(form.salesChannelID) // 渠道
+            param.customerId = form.customer.customerId //客户
+            //收款 
+            if (form.customerForm && form.customerForm.deliveryPhone && (form.customerForm.deliveryPhone.indexOf(',') != -1 || form.customerForm.deliveryPhone instanceof Array)) {
+                param.deliveryPhone = form.customerForm.deliveryPhone ? form.customerForm.deliveryPhone.join(",") : null
+            }
+            param.settlementType = settlementTypeID //结算方式
+            param.sumAmount = form.sumAmount
+            param.receiptDirection = 1
+            param.docCode = "客户收款"
+            param.ascpId = app.globalData.user.ascpId
+            param.sale1Id = app.globalData.user.sale1Id
+            param.userCode = app.globalData.user.userCode
+            param.makingUser = app.globalData.user.userId
+            param.makingTime = util.formatDataTime(new Date())
+            param.userName = app.globalData.user.userName
+            param.balanceAmount = form.receivable ? ((form.sumAmount - form.receivable) > 0 ? (form.sumAmount - form.receivable) : 0) : form.sumAmount
+            //如果关联了订单  剩余可用(可用余额) =  本次收款-应收 
+            param.sumRefundAmount = 0 //使用额
+            param.cpId = app.globalData.user.cpId,
+                param.orderId = form.orderId
+            let SAVE_API = 'insert'
+            //判断是否关联了订单 关联走下面的接口
+            if (param.orderId) {
+                SAVE_API = 'insert_deposit'
+            }
+            //2023/11/06 于继渤  微信小程序 收款网络异常重复提交问题
+            param.wxGuId = this.data.guId
+            // iboss用到的参数 下面
+            param.addressFull = form.addressFull //详细地址
+            param.salesChannelName = form.salesChannelName //渠道
+            param.organizationCode = form.orgCode //组织结构编码
+            param.staffCode = form.staffCode //业务员编码
+            param.settlementTypeName = settlementTypeName //结算方式
+            param.decisionMakerName = form.customer.decisionMakerName  //决策者
+            param.decorationStyleName = form.customer.fitupStyleName  //风格
+            param.customerAgeGroupName = form.customer.ageCompositionName  //年龄 (80后)
+            param.homeHouseTypeName = form.customer.houseTypeName //房屋类型    
+            param.customerCode = form.customer.customerCode //客户编码
+            param.customerName = form.customer.customerName
+            param.customerTelephone = form.customer.customerCode //客户编码
+            param.customerFromName = form.customer.customerFromName
+            param.remarks = form.remarks ? form.remarks : ''
+            param.erpPushStatus = Constants.ERP_PUSH_STATUS.NO_PUSH_STATUS
+            // 用户erpUserCode20220820
+            param.erpUserCode = app.globalData.user.erpUserCode//iboss用户
+
+            if (!param.remarks) {
+                param.remarks = ''
+            }
+            if (!param.annexPaths || param.annexPaths.length == 0) {
+                param.annexPaths = []
+            }
+            api.request(Constants.ORDER_RECEIPT_PC_API + SAVE_API, 'POST', param).then(res => {
+                this.setData({
+                    loading: false
+                })
+                if (res.data.code === 200) {
+                    wx.showToast({
+                        title: '保存成功',
+                        image: '/static/image/success.png',
+                        duration: 1000
+                    })
+                    var pages = getCurrentPages();
+                    var prevPage = pages[pages.length - 2];
+
+                    setTimeout(function () {
+                        wx.navigateBack({
+                            delta: 2
+                        })
+                    }, 1500)
+                } else {
+                    this.setData({
+                        loadingButtonFlag: false
+                    })
+                }
+            })
+        } else if (this.data.type == 1) {
+            //订单收款
+            this.setData({
+                loading: true,
+                loadingButtonFlag: true
+            })
+            let that = this
+            let param = this.data.typeForm
+            if (this.data.page == 'orderBilling' && this.data.form.sumAmount < 0) {
+                param.bankAccount = this.data.form.customer.bankAccount
+            }
+            let settlementTypeList = this.data.settlementTypeList
+            let tempOBJ = {}
+            settlementTypeList.forEach(res => {
+                if (res.checked) {
+                    tempOBJ = res
+                }
+            })
+            param.erpPushStatus = Constants.ERP_PUSH_STATUS.NO_PUSH_STATUS
+            let tsumAmount = param.sumAmount //合计金额
+            //收款金额 (输入的)
+            let sumAmount = that.data.form.sumAmount
+            if (this.data.page === 'orderBilling') {
+                param.erpPushStatus = Constants.ERP_PUSH_STATUS.NO_PUSH_STATUS
+                //客户收款 定金 
+                param.receiptVOList = []
+                tsumAmount = param.receivable
+            } else {
+                // 剩余应收=合计金额-收款金额
+                param.receivable = Number(tsumAmount - sumAmount - Number(param.sumUsePrestore ? param.sumUsePrestore : 0)) ? Number(tsumAmount - sumAmount - Number(param.sumUsePrestore ? param.sumUsePrestore : 0)) : 0
+
+            }
+            if (this.data.settlementTypeList && this.data.settlementTypeList.length > 0) {
+                let settlementTypeList = this.data.settlementTypeList.filter(item => {
+                    return item.checked
+                })
+                settlementTypeList.forEach(res => {
+                    if (isNaN(res.sumAmount)) {
+                        res.sumAmount = 0
+                    }
+                    let OBJ = {
+                        //结算方式
+                        settlementType: res.typeId,
+                        sumAmount: res.sumAmount ? Number(res.sumAmount) : 0,
+                        settlementTypeName: res.typeName,
+                        typeName: res.typeName,
+                        typeId: res.typeId,
+                    }
+                    if (app.globalData.user.sale1Id) {
+                        OBJ['sale1Id'] = app.globalData.user.sale1Id
+                    }
+                    if (app.globalData.user.sale2Id) {
+                        OBJ['sale2Id'] = app.globalData.user.sale2Id
+                    }
+                    if (app.globalData.user.ascpId) {
+                        OBJ['ascpId'] = app.globalData.user.ascpId
+                    }
+                    if (app.globalData.user.userId) {
+                        OBJ['makingUser'] = app.globalData.user.userId
+                    }
+
+
+
+                    OBJ['makingTime'] = util.formatDataTime(new Date())
+                    let annexPaths = []
+                    // if(this.data.annexPaths && this.data.annexPaths.length > 0){
+                    //     annexPaths.push({
+                    //         url: data.data.relativePath,
+                    //         type: 'image',
+                    //         docType:'客户收款',
+                    //         name: file[file.length - 1],
+                    //         createTime: util.formatDataTime(new Date())
+                    //       })
+                    // }
+                    OBJ['annexPaths'] = this.data.annexPaths
+                    //收款数组
+                    param.receiptVOList.push(OBJ)
+                })
+            }
+            let numOne = util.numSub(tsumAmount, Number(param.sumUsePrestoreTemp ? param.sumUsePrestoreTemp : 0))
+            // 收款状态
+            if (Number(sumAmount) == 0 && Number(sumAmount) != Number(numOne)) {
+                //未收款
+                param.receiptStatus = Constants.RECEIPT_STATUS_CONSTANT.RECEIPT_STATUS_UNCOLLECTED;
+            }
+            else if (Number(sumAmount) < Number(numOne)) {
+                //部分收款
+                param.receiptStatus = Constants.RECEIPT_STATUS_CONSTANT.RECEIPT_STATUS_PART;
+            } else if (Number(sumAmount) > Number(numOne)) {
+                //部分收款
+                param.receiptStatus = Constants.RECEIPT_STATUS_CONSTANT.RECEIPT_STATUS_PART;
+            }
+            else {
+                //收款完成
+                param.receiptStatus = Constants.RECEIPT_STATUS_CONSTANT.RECEIPT_STATUS_COMPLETE;
+            }
+            let SAVE_API = 'insert'
+            // //收款成交
+            if (this.data.dealFalg) {
+                //送货日期
+                param.deliveryTime = param.deliveryTime ? param.deliveryTime.replaceAll("/", "-") : util.formatDataTime(new Date())
+                SAVE_API = 'insert'
+            } else {
+                //订单收款,修改总单信息
+                SAVE_API = 'update'
+            }
+            let API = Constants.SALE_ORDER_API
+            if (this.data.page === 'orderBilling') {
+                param.sumReceiptAmount = Number(sumAmount) + Number(param.sumReceiptAmount)
+                param.sumCollectedAmount = Number(sumAmount)
+                param.sumAmount = Number(sumAmount)
+                param.settlementType = tempOBJ.typeId
+                param.settlementTypeName = tempOBJ.typeName,
+                    param.typeName = tempOBJ.typeName
+                param.makingUser = app.globalData.user.userId
+                //2023/11/06 于继渤  微信小程序 收款网络异常重复提交问题
+                param.wxGuId = this.data.guId
+                if (param.editTimeFlag) {
+                    param.editTime = util.formatTime(new Date(param.editTime)).replaceAll('/', '-')
+                } else {
+                    if (param.editTime.indexOf('/') != -1) {
+                        param.editTime = param.editTime.replaceAll('/', '-')
+                    } else {
+                        if (param.editTime.indexOf('T') != -1) {
+                            param.editTime = util.formatDataTime(new Date(param.editTime))
+                        }
+                    }
+
+                }
+                SAVE_API = 'insert_deposit'
+                API = Constants.ORDER_RECEIPT_PC_API
+
+            } else {
+                //2023/11/06 于继渤  微信小程序 收款网络异常重复提交问题
+                param.wxGuId = this.data.guId
+                //收款合计
+                param.sumReceiptAmount = util.AddNumber(Number(sumAmount ? sumAmount : 0), Number(param.sumReceiptAmount))
+                param.sumCollectedAmount = util.AddNumber(Number(param.sumUsePrestore), Number(param.sumReceiptAmount))
+            }
+            if (this.data.form.remarks != '') {
+                param.remarks = this.data.form.remarks
+            }
+            param.tSumGoodsAmount = Number(param.tSumGoodsAmount)
+            if (!param.remarks) {
+                param.remarks = ''
+            }
+            if (!param.annexPaths || param.annexPaths.length == 0) {
+                param.annexPaths = []
+            }
+            if (this.data.noConfirm && this.data.noConfirm == '1') {
+                delete param['sumReceipt']
+            }
+
+
+            this.getNetwork().then(res=>{
+                if (!res) {
+                    that.setData({
+                        loading: false,
+                        disabledSave: false
+                    })
+                    wx.showToast({
+                        title: '网络不可用!',
+                        icon: 'none'
+                    })
+    
+                    return
+                }
+            })
+   
+          
+            // console.log('param', param)
+       
+            api.request(API + SAVE_API, 'POST', param).then(res => {
+                that.setData({
+                    loading: false,
+                })
+                if (res.data.code === 200) {
+                    wx.showToast({
+                        title: '保存成功',
+                        image: '/static/image/success.png',
+                        duration: 1000
+                    })
+                    this.setData({
+                        disabledSave: false,
+                        loadingButtonFlag: true,
+                    })
+
+                    //首页购物车跳转列表页
+                    if (this.data.pageIndex == 'shopping') {
+                        setTimeout(function () {
+                            wx.reLaunch({
+                                url: '/pages/home-page/home-page?pageType=1',
+                            })
+                        }, 1000)
+                        return
+                    }
+                    if (this.data.pageIndex == 'receiveCustomers') {
+
+                        wx.navigateBack({
+                            delta: 4
+                        })
+
+                        return
+
+                    }
+                    var pages = getCurrentPages();
+                    // debugger
+                    if (this.data.page == 'orderBilling' && this.data.dealFalg == 'false') {
+                        //返回一览页面
+                        var prevPage = pages[pages.length - 2];
+                        if (prevPage) {
+                            prevPage.setData({
+                                orderAddFlag: true
+                            })
+                        }
+                        setTimeout(function () {
+                            wx.navigateBack({
+                                delta: 1
+                            })
+                        }, 1000)
+                        return
+                    }
+                    if (this.data.page == 'orderBilling' && this.data.dealFalg == 'true') {
+                        //返回一览页面
+                        var prevPage = pages[pages.length - 3];
+                        if (prevPage) {
+                            prevPage.setData({
+                                orderAddFlag: true
+                            })
+                        }
+                        setTimeout(function () {
+                            wx.navigateBack({
+                                delta: 2
+                            })
+                        }, 1000)
+                        return
+                    } if (this.data.page == 'orderBillingDeal') {
+                        //返回列表页面
+                        var prevPage = pages[pages.length - 3];
+                        if (prevPage) {
+                            prevPage.setData({
+                                orderAddFlag: true
+                            })
+                        }
+
+                        setTimeout(function () {
+                            wx.navigateBack({
+                                delta: 2
+                            })
+                        }, 1000)
+                        return
+                    } if ((this.data.page == 'orderBillingAdd') && this.data.typeForm.orderId) {
+                        //返回列表页面
+                        var prevPage = pages[pages.length - 5];
+                        if (prevPage) {
+                            prevPage.setData({
+                                orderAddFlag: true
+                            })
+                        }
+
+                        setTimeout(function () {
+                            wx.navigateBack({
+                                delta: 4
+                            })
+                        }, 1000)
+                        return
+                    } if ((this.data.page == 'orderBillingAdd') && this.data.noConfirm) {
+                        //返回列表页面
+                        var prevPage = pages[pages.length - 5];
+                        if (prevPage) {
+                            prevPage.setData({
+                                orderAddFlag: true
+                            })
+                        }
+
+                        setTimeout(function () {
+                            wx.navigateBack({
+                                delta: 4
+                            })
+                        }, 1000)
+                        return
+                    } if ((this.data.page == 'orderBillingAdd') && this.data.noConfirm == '1') {
+                        //返回列表页面
+                        var prevPage = pages[pages.length - 5];
+                        if (prevPage) {
+                            prevPage.setData({
+                                orderAddFlag: true
+                            })
+                        }
+
+                        setTimeout(function () {
+                            wx.navigateBack({
+                                delta: 4
+                            })
+                        }, 1000)
+                        return
+                    } if ((this.data.page == 'orderBillingAdd') && !this.data.typeForm.orderId) {
+                        //返回列表页面
+                        var prevPage = pages[pages.length - 6];
+                        if (prevPage) {
+                            prevPage.setData({
+                                orderAddFlag: true
+                            })
+                        }
+                        setTimeout(function () {
+                            wx.navigateBack({
+                                delta: 5
+                            })
+                        }, 1000)
+                        return
+                    } if (this.data.noConfirm == '1' && this.data.page != 'orderBillingAdd') {
+                        //返回一览页面
+                        var prevPage = pages[pages.length - 3];
+                        prevPage.setData({
+                            orderAddFlag: true
+                        })
+                        setTimeout(function () {
+                            wx.navigateBack({
+                                delta: 2
+                            })
+                        }, 1000)
+                    }
+                } else {
+                    this.setData({
+                        loadingButtonFlag: false
+                    })
+                }
+            })
+        } else if (this.data.type == 2) {
+            //退换补
+            this.setData({
+                loading: true,
+                loadingButtonFlag: true
+            })
+            let param = this.data.typeForm
+            let settlementTypeList = this.data.settlementTypeList
+            let tempOBJ = {}
+            param.receiptVOList = []
+            settlementTypeList.forEach(res => {
+                if (res.checked) {
+                    tempOBJ = res
+                }
+            })
+            //收款金额 (输入的)
+            let sumAmount = this.data.form.sumAmount
+            //收款数组
+            if (this.data.settlementTypeList && this.data.settlementTypeList.length > 0) {
+                let settlementTypeList = this.data.settlementTypeList.filter(item => {
+                    return item.checked
+                })
+                settlementTypeList.forEach(res => {
+                    let OBJ = {
+                        //结算方式
+                        settlementType: res.typeId,
+                        sumAmount: Number(res.sumAmount),
+                        settlementTypeName: res.typeName,
+                        typeName: res.typeName,
+                        typeId: res.typeId,
+                    }
+                    if (app.globalData.user.sale1Id) {
+                        OBJ['sale1Id'] = app.globalData.user.sale1Id
+                    }
+                    if (app.globalData.user.sale2Id) {
+                        OBJ['sale2Id'] = app.globalData.user.sale2Id
+                    }
+                    if (app.globalData.user.ascpId) {
+                        OBJ['ascpId'] = app.globalData.user.ascpId
+                    }
+                    if (app.globalData.user.userId) {
+                        OBJ['makingUser'] = app.globalData.user.userId
+                    }
+                    OBJ['makingTime'] = util.formatDataTime(new Date())
+                    OBJ['annexPaths'] = this.data.annexPaths
+                    //收款数组
+                    param.receiptVOList.push(OBJ)
+                })
+            }
+
+            let tsumAmount = param.sumAmount //合计金额
+            //服务费用 - 原单服务费用
+            param.sumFeeAmount = Number(param.sumFeeAmount - param.sumFeeAmountTemp)
+            param.cpId = app.globalData.user.cpId
+       
+            param.sumReceiptAmount = sumAmount
+            param.sumCollectedAmount = Number(param.sumReceiptAmount)
+
+            param.sumAmount = Number(sumAmount)
+            let receivableTemp = Number(param.receivable) - Number(sumAmount);
+
+            param.sumUsePrestore = Number(0)
+            param.sumReceiptAmount = Number(param.sumReceiptAmount)
+            param.receivable = Number(receivableTemp)
+            delete param['sumAmount']
+            delete param['tSumBackGoodsAmount']
+            delete param['tSumEndGoodsAmount']
+            delete param['sumReceipt']
+            delete param['usablePrestore']
+
+            delete param['sumAmount']
+            delete param['makingTime']
+            delete param['sumGoodsAmount']
+            delete param['sumOutAmount']
+            delete param['sumPromotion']
+            delete param['sumQuantity']
+            delete param['sumStandard']
+            delete param['sumRejectAmount']
+
+            api.request(Constants.SALE_ORDER_API + 'operation', 'POST', param).then(res => {
+                this.setData({
+                    loading: false
+                })
+                if (res.data.code === 200) {
+                    if (res.data.data.message === '操作成功') {
+                        wx.showToast({
+                            title: '保存成功',
+                            image: '/static/image/success.png',
+                            duration: 1000
+                        })
+                        var pages = getCurrentPages();
+                        var prevPage = pages[pages.length - 3];
+                        prevPage.setData({
+                            orderAddFlag: true
+                        })
+                        setTimeout(function () {
+
+                            wx.navigateBack({
+                                delta: 2
+                            })
+                        }, 1000)
+                    } else {
+                        this.setData({
+                            loadingButtonFlag: false
+                        })
+                        wx.showToast({
+                            title: res.data.data.message,
+                            icon: 'none',
+                            duration: 1500
+                        })
+                    }
+                }
+            })
+
+        } else if (this.data.type == 3) {
+            this.setData({
+                loading: true,
+                loadingButtonFlag: true
+            })
+            let settlementTypeList = this.data.settlementTypeList
+            let receiptVOList = []
+            let form = this.data.form
+            if (settlementTypeList && settlementTypeList.length > 0) {
+                let settlementTypeList = this.data.settlementTypeList.filter(item => {
+                    return item.checked
+                })
+                settlementTypeList.forEach(res => {
+                    let OBJ = {
+                        //结算方式
+                        settlementType: res.typeId,
+                        sumAmount: Number(res.sumAmount),
+                        itemAmount: Number(res.sumAmount),
+                        settlementTypeName: res.typeName,
+                        typeName: res.typeName,
+                        typeId: res.typeId,
+                    }
+                    if (app.globalData.user.sale1Id) {
+                        OBJ['sale1Id'] = app.globalData.user.sale1Id
+                    }
+                    if (app.globalData.user.sale2Id) {
+                        OBJ['sale2Id'] = app.globalData.user.sale2Id
+                    }
+                    if (app.globalData.user.ascpId) {
+                        OBJ['ascpId'] = app.globalData.user.ascpId
+                    }
+                    if (app.globalData.user.userId) {
+                        OBJ['makingUser'] = app.globalData.user.userId
+                    }
+                    OBJ['makingTime'] = util.formatDataTime(new Date())
+                    //收款数组
+                    receiptVOList.push(OBJ)
+                })
+            }
+            let sumAmount = this.data.form.sumAmount
+            let param = this.data.typeForm
+            delete param['tdiscountPromotion']
+            delete param['tdiscountStandard']
+            delete param['toiletCount']
+            delete param['toiletCountName']
+            delete param['tsumAmount']
+            delete param['tsumGoodsAmount']
+            delete param['tsumPromotion']
+            delete param['tsumQuantity']
+            delete param['tsumStandard']
+            delete param['merOrderType']
+            delete param['merOrderTypeName']
+            delete param['sumOutAmount']
+            delete param['receiptStatus']
+            delete param['outStatus']
+            param.editTime = param.editTimeTemp
+            param.cpId = app.globalData.user.cpId
+            param.receiptVOList = receiptVOList
+            param.rejectReason = this.data.form.mReasonForReturn  //退货原因
+            param.receivable = Number(param.receivable) - Number(sumAmount)
+            param.refundAccount = this.data.form.mRefundAccountNumber //退款账号
+            param.staffList = []
+            param.orgList = []
+            param.sumCollectedAmount = Number(sumAmount)
+            param.sumAmount = Number(sumAmount)
+            param.sumReceiptAmount = Number(sumAmount)
+            param.orderOutRejectItemVOList = this.data.typeForm.orderOutRejectItemVOList
+            api.request(Constants.ORDER_OUT_REJECT_PC_API + 'insert', 'POST', param).then(res => {
+                this.setData({
+                    loading: false
+                })
+                if (res.data.code === 200) {
+                    wx.showToast({
+                        title: '保存成功',
+                        image: '/static/image/success.png',
+                        duration: 1000
+                    })
+                    this.setData({
+                        disabledSave: false
+                    })
+                    var pages = getCurrentPages();
+                    var prevPage = pages[pages.length - 4];
+                    // prevPage.setData({
+                    //   orderAddFlag: true
+                    // })
+                    setTimeout(function () {
+                        wx.navigateBack({
+                            delta: 3
+                        })
+                    }, 1500)
+                } else {
+                    this.setData({
+                        loadingButtonFlag: false
+                    })
+                }
+            })
+
+        } else if (this.data.type == 4) {
+            let result = this.checkForm();
+            if (!result.flag) {
+                wx.showToast({
+                    title: result.msg,
+                    image: '/static/image/warning.png',
+                    duration: 1000
+                })
+                return
+            }
+            let settlementTypeList = this.data.settlementTypeList
+            let settlementTypeID = ''
+            let settlementTypeName = ''
+
+            settlementTypeList.forEach(element => {
+                if (element.checked) {
+                    settlementTypeID = element.typeId
+                    settlementTypeName = element.typeName
+                }
+            });
+            if (settlementTypeID == '') {
+                wx.showToast({
+                    title: "请选择收款方式",
+                    image: '/static/image/warning.png',
+                    duration: 1000
+                })
+                this.setData({
+                    loadingButtonFlag: false
+                })
+                return
+            }
+
+            this.setData({
+                loading: true,
+                loadingButtonFlag: true
+            })
+            let form = this.data.form
+            let param = {}
+            let fileList_ = this.data.fileList
+            let fileList = []
+            fileList_.forEach(item => {
+                fileList.push(
+                    {
+                        url: item.FilePath,
+                        type: 'image',
+                        name: '',
+                        createTime: util.formatDataTime(new Date())
+                    })
+            })
+            param.annexPaths = fileList
+            param.staffId = Number(form.staffID) // 业务员
+            param.orgId = Number(form.orgID) // 业务部门
+            param.salesChannel = Number(form.salesChannelID)// 渠道
+            param.customerId = form.customer.customerId //客户
+            //收款
+            param.sReceiptId = Number(form.sreceiptId)
+            param.sReceiptNo = form.sreceiptNo
+            param.settlementType = settlementTypeID
+            param.customerCode = form.customer.customerCode
+            param.customerName = form.customer.customerName
+            param.sumAmount = -1 * form.sumAmount
+            param.receiptDirection = -1
+            param.docCode = "客户取款"
+            param.balanceSumAmount = form.balanceSumAmount ? form.balanceSumAmount : 0
+            param.balanceAmount = ((form.balanceAmount + form.sumAmount) > 0 ? (form.balanceAmount + form.sumAmount) : 0)  //剩余可用 - 之前可用加上本次退款(退款是负的 故相加)
+            param.sumRefundAmount = -1 * form.sumAmount //使用额
+            param.cpId = app.globalData.user.cpId,
+                param.addressFull = form.customer.addressFull //详细地址
+            param.salesChannelName = form.salesChannelName //渠道
+            param.refundAccount = form.refundAccount //退款账号
+            param.organizationCode = form.orgCode //组织结构编码
+            param.staffCode = form.staffCode //业务员编码
+            param.decisionMakerName = form.customer.decisionMakerName  //决策者
+            param.decorationStyleName = form.customer.fitupStyleName  //风格
+            param.customerAgeGroupName = form.customer.ageCompositionName  //年龄 (80后)
+            param.settlementTypeName = settlementTypeName //结算方式
+            param.homeHouseTypeName = form.customer.houseTypeName //房屋类型    
+            param.customerCode = form.customer.customerCode //客户编码
+            param.customerTelephone = form.customer.customerCode //客户编码
+            param.erpPushStatus = Constants.ERP_PUSH_STATUS.NO_PUSH_STATUS
+            param.remarks = form.remarks
+            param.editTime = form.editTime ? form.editTime : null
+            param.receiptId = Number(form.receiptId) ? Number(form.receiptId) : null
+
+            api.request(Constants.ORDER_RECEIPT_PC_API + 'insert', 'POST', param).then(res => {
+                this.setData({
+                    loading: false
+                })
+                if (res.data.code === 200) {
+                    wx.showToast({
+                        title: '保存成功',
+                        image: '/static/image/success.png',
+                        duration: 1000
+                    })
+                    this.setData({
+                        disabledSave: false
+                    })
+                    var pages = getCurrentPages();
+                    var prevPage = pages[pages.length - 2];
+
+                    setTimeout(function () {
+                        wx.navigateBack({
+                            delta: 2
+                        })
+                    }, 1500)
+                } else {
+                    this.setData({
+                        loadingButtonFlag: false
+                    })
+                }
+            })
+        }
+    },
+    getNetwork() {
+        return new Promise((resolve, reject) => {
+            wx.getNetworkType({
+                success(res) {
+                    const networkType = res.networkType; if (networkType === 'none') {
+                        console.log('无网络,返回false')
+                        resolve(false)
+                    } else {
+                        console.log('有网络,返回true')
+                        resolve(true)
+                    }
+                }
+            })
+        })
+       
+    },
+    //tab切换
+    onChangeTabs(e) {
+
+        let title = e.detail.title
+        if (title == '结算方式') {
+            this.setData({
+                active: 0
+            })
+
+
+        }
+        if (title == '附件') {
+            this.setData({
+                active: 1
+            })
+        }
+    },
+
+
+    onChangeBankAccount(e) {
+
+        let form = this.data.form
+        form.customer.bankAccount = e.detail
+        this.setData({
+            form: form
+        })
+    },
+
+    /**
+     * @desc : 订单上传附件方法
+     * @author : 于继渤
+     * @date : 2022/6/02 16:16
+     */
+    afterRead(event) {
+        const _this = this;
+        const {
+            file
+        } = event.detail;
+
+        let typeForm = _this.data.typeForm
+        let arr = _this.data.fileList;
+        var annexPaths = _this.data.annexPaths
+        let type = this.data.type
+        let formDataUrl = 't_order/annex_paths'
+        if (type == 0 || type == 4) {
+            //客户收款
+            formDataUrl = 't_receipt/receipt'
+        } else {
+            annexPaths = typeForm.annexPaths ? typeForm.annexPaths : []
+        }
+
+        file.forEach(res => {
+            // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
+            wx.uploadFile({
+                url: `${config.server_add}:${config.server_port}` + '/basic-server/file/upload',
+                filePath: res.path,
+                name: 'file',
+                formData: {
+                    'folder': formDataUrl
+                },
+                header: {
+                    'Authorization': 'Bearer ' + app.globalData.token
+                },
+                success(res) {
+                    let data = JSON.parse(res.data)
+
+                    if (data.code === 200) {
+                        if (type == 0) {
+                            let fileList_ = _this.data.form.fileList
+                            fileList_.push({
+                                url: data.data.absolutelyPath,
+                                FilePath: data.data.relativePath,
+                                deletable: true
+                            })
+                        }
+
+                        arr.push({
+                            url: data.data.absolutelyPath,
+                            FilePath: data.data.relativePath,
+                            deletable: true
+                        })
+                        let annexPathsTemp = []
+                        let file = data.data.relativePath.split('/')
+                        annexPathsTemp.push({
+                            url: data.data.relativePath,
+                            type: 'image',
+                            insertFlag:true,
+                            docType: '客户收款',
+                            name: file[file.length - 1],
+                            createTime: util.formatDataTime(new Date())
+                        })
+                        annexPaths.push({
+                            url: data.data.relativePath,
+                            type: 'image',
+                            docType: '客户收款',
+                            insertFlag:true,
+                            name: file[file.length - 1],
+                            createTime: util.formatDataTime(new Date())
+                        })
+
+                        typeForm.annexPaths = annexPaths
+                        _this.setData({
+                            fileList: arr,
+                            annexPaths: annexPathsTemp,
+                            typeForm: typeForm
+                        })
+                    }
+                },
+            })
+        })
+
+    },
+
+    /**
+* @desc : 删除图片
+* @author : 于继渤
+* @date : 2022/5/31 18:16
+*/
+    deleteImg(e) {
+        let index = e.detail.index;
+        let arr = this.data.fileList;
+        arr.splice(index, 1);
+        this.setData({
+            fileList: arr,
+            annexPaths: arr
+        })
+        console.log('annexPaths', this.data.annexPaths)
+        console.log('fileList', this.data.fileList)
+    },
+
+    changeField(e) {
+
+        let form = this.data.form
+        form.remarks = e.detail
+        this.setData({ form: form })
+    },
+})

+ 4 - 0
package-base-select/pages/select-collection_confirm/select-collection_confirm.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText":"收款"
+}

+ 144 - 0
package-base-select/pages/select-collection_confirm/select-collection_confirm.wxml

@@ -0,0 +1,144 @@
+<wxs src='../../../../utils/numberFormat.wxs' module="numberFormat"></wxs>
+<wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
+<loading wx:if="{{loading}}" loadingName="加载中" backgroundColor="#f2f2f2;" opacity="0.8"></loading>
+<!-- 客户资料 -->
+<!-- 客户信息组件 -->
+<!-- <dk-customer-detail customerName="{{form.customer.customerName}}" textColor="black" backgroundColor="white,white,white"
+ customerPhone="{{form.customer.customerPhone}}"  
+ addressFull="{{form.customer.addressFull}}"></dk-customer-detail> -->
+ <van-dialog id="van-dialog" />
+
+<!-- 客户信息 -->
+<view style="margin: 42rpx 34rpx 0rpx 34rpx;border-radius: 15rpx;box-shadow:2px 2px 5px #e5e5e6;">
+  <view style="flex-direction: column;justify-content: center;align-items: flex-start;background: linear-gradient(90.12deg, #718AC6 0.84%, #4A5E98 99.43%);border-radius: 15rpx;">
+    <view style="display: flex;padding-right: 32rpx;">
+
+      <view style="padding-left: 32rpx;padding-top: 19rpx;width: 39rpx;">
+        <view catchtap="toCustomer" style="width: 39rpx;height: 39rpx;background-color: #95A8CB;border-radius:50%;">
+          <view style="width: 39rpx; height: 39rpx;text-align: center;">
+            <van-image round width="20rpx" height="24rpx" src="/static/img/Vector.png" />
+          </view>
+
+        </view>
+
+      </view>
+
+
+      <view style="padding-left: 14rpx;padding-top: 19rpx;font-size: 13px;line-height: 36rpx;color: #FFFFFF;">
+        {{form.customer.customerName}}
+      </view>
+
+
+      <view style="padding-left: 22rpx;padding-top: 19rpx;font-size: 13px;line-height: 36rpx;color: #FFFFFF;">
+        {{form.customer.customerPhone}}
+      </view>
+
+    </view>
+    <view style="display: flex;padding-right: 32rpx;padding-bottom: 15rpx;">
+
+      <view style="padding-left: 32rpx;padding-top: 15rpx;font-size: 13px;line-height: 36rpx;color: #FFFFFF;">
+        {{wxmlUtil.addressToIndexOf(form.customer.addressFull)}}
+      </view>
+    </view>
+
+
+    <van-field wx:if="{{page == 'orderBilling' && form.sumAmount < 0}}"  label="退货账号" data-key="bankAccount" placeholder="请输入退货账号"
+      value="{{form.customer.bankAccount}}" input-align="right" border="{{ false }}"   bind:change="onChangeBankAccount"/>
+
+  </view>
+</view>
+<view style="margin: 0rpx 34rpx 0rpx 34rpx;border-radius: 15rpx;" wx:if="{{type == 0 ||  type == 1 || type == 2 ||type == 4}}">
+  <van-tabs color="#1989FD" nav-class="van-tabs-class" active="{{ active }}" bind:change="onChangeTabs" color="#DEC9A3;" title-active-color="#1B365D" title-inactive-color=" #96A7C5;">
+    <van-tab title="结算方式">
+    </van-tab>
+    <van-tab title="附件">
+    </van-tab>
+  </van-tabs>
+
+</view>
+
+<!-- 收款方式 -->
+<view wx:if="{{active == 0}}" style="margin: 24rpx 34rpx 26rpx 34rpx;">
+  <scroll-view scroll-y="true" style="height:775rpx;" bindscrolltolower="paging" scroll-top="{{topNum}}">
+    <view wx:for="{{settlementTypeList}}" style="width: 100%;">
+    <view class="choose-item {{(item.checked == true && item.imageReceiptCode_ping) ? 'choose-item-select' : 'choose-item-unchecked'}}">
+      <view class="thick-line" wx:if="{{item.checked}}"></view>
+      <view style="width:40rpx;place-self: center;padding-left: 34rpx;">
+
+        <view style="position: relative;">
+          <van-checkbox value="{{item.checked}}" data-index="{{index}}" data-item="{{item}}" catchtap="catchtapCheck"  checked-color="#1989FA" />
+        </view>
+      </view>
+
+      <view class="choose-item-two" style="{{(item.checked == true && item.imageReceiptCode_ping) ? 'padding-top:63rpx;' : 'display: flex;  align-items: center;'}}">
+
+        <view class="type-name">
+          {{item.typeName ? item.typeName : ''}}
+        </view>
+
+
+        <view style="margin-left:{{item.checked == true ? '0rpx' : '27rpx'}}; ">
+          <dk-van-tag color="#EAF1FF" textColor="#606EB2" radius="3rpx" roundFlag="{{true}}" value="{{item.accountname ? item.accountname : ''}}账户"></dk-van-tag>
+        </view>
+
+        <view wx:if="{{item.checked && settlementTypeListLength > 1 }}" style="text-align:left;padding-top: 10rpx;">
+          <dk-number-input  negative="{{form.sumTempAmount < 0 ?true:false}}"  signSize="11px" center="left" fontSize="15" inputColor="#CAA977;" fontWeight="500" data-key="priceSale"  inputValue="{{item.sumAmount ? item.sumAmount : 0}}" data-value="{{item.sumAmount}}" data-index="{{index}}" bind:triggerBindValue="sumAmountBindValue" bind:triggerBindBlur=""></dk-number-input>
+        </view>
+      </view>
+      <view class="image-code" wx:if="{{item.checked && item.imageReceiptCode && item.imageReceiptCode_ping}}" style="margin-top: 32rpx;margin-right: 40rpx;margin-bottom: 26rpx;border: 1rpx solid #000000;border-radius: 15rpx;">
+        <image wx:if="{{item.imageReceiptCode && item.imageReceiptCode_ping}}" style="height:166rpx;width:166rpx;border-radius: 15rpx;" src="{{item.imageReceiptCode_ping}}" bindtap="previewImg" data-imgUrl="{{item.imageReceiptCode_ping}}" />
+      </view>
+    </view>
+  </view>
+  <view style="height: 180rpx;"></view>
+  </scroll-view>
+
+</view>
+
+
+
+<view wx:if="{{active == 1}}"  style="margin: 10px 32rpx 20px 32rpx;margin-top: 41rpx;border-radius: 15rpx;box-shadow:2px 2px 5px #e5e5e6;">
+    <view style="background: #FFFFFF;box-shadow: 0rpx 10rpx 20rpx rgba(225, 229, 238, 0.6);border-radius: 15rpx 15rpx 15rpx 15rpx;">
+   
+   
+      <dk-remarks-magnifier bind:onChange="changeField" data-key="remarks" label="备注" value="{{ form.remarks }}"></dk-remarks-magnifier>
+
+        <view style=" padding: 10px 32rpx 10px 32rpx;color: #95A8CB;font-size: 14px;">附件</view>
+
+
+        <view style="display:flex;width:100%;margin: 1vw; padding-top: 20rpx;padding-bottom: 25rpx;">
+            <!-- <view style="width: 30%; flex:1;color: #95A8CB;font-size: 28rpx;padding-left: 27rpx;"></view> -->
+            <view style="width: 98%;text-align: left;">
+                <van-uploader max-count="5" accept="image" style="margin-left: 4%;border-radius: 15rpx;" preview-size="160rpx;" file-list="{{ fileList }}" bind:delete="deleteImg" bind:after-read="afterRead" multiple="true" imageFit="aspectFit" />
+            </view>
+        </view>
+
+    </view>
+
+
+</view>
+
+
+<!-- 确认收款 -->
+<view style="position:fixed;bottom:0;width:100%;z-index: 10; ">
+
+  <!-- 请输入收款金额 -->
+  <view style="z-index: 11;background-color:white;margin-bottom:90rpx;margin-left: 55rpx;margin-right: 55rpx;border-radius: 15rpx;height:256rpx;">
+
+    <view style="height: 38rpx;"></view>
+    <view style="text-align:center;font-size: 15px;line-height: 20px;color: #1B365D;">
+      <dk-text fontSize="15px" value="需收款"></dk-text>
+    </view>
+    <view style="padding-top: 10rpx; text-align:center; display: flex; justify-content: center;">
+
+      <dk-number-input readonly="{{settlementTypeListLength > 1}}" negative="{{form.sumTempAmount < 0 ?true:false}}" signSize="15px" fontSize="27" color fontWeight="600" data-key="priceSale"  inputValue="{{form.sumAmount}}" data-value="{{form.sumAmount}}" bind:triggerBindValue="changeSalesPriceField" bind:triggerBindBlur="sumAmountBindinputBlur"></dk-number-input>
+    </view>
+
+    <view style="z-index: 12;margin-top:40rpx;box-shadow: 0px 4rpx 16rpx rgba(190, 144, 73, 0.5);border-radius: 15rpx;">
+
+      <van-button round size="large" disabled="{{loadingButtonFlag}}" loading="{{loadingButtonFlag}}" color="#CAA977" custom-style="width:100%;" bind:click="btnOK" type="info">确认收款
+        </van-button>
+    </view>
+  </view>
+
+</view>

+ 92 - 0
package-base-select/pages/select-collection_confirm/select-collection_confirm.wxss

@@ -0,0 +1,92 @@
+.input_red {
+    color: red !important;
+  }
+  
+  .choose-item {
+    display: flex;
+    background: #FFFFFF;
+    box-shadow: 0px 10rpx 20rpx rgba(225, 229, 238, 0.6);
+    border-radius: 15rpx;
+    margin-top: 25rpx;
+  }
+  .van-tabs-class{
+    background: #fff !important;
+   
+    /* margin: 42rpx 34rpx 26rpx 34rpx !important; */
+  }
+  .van-tabs__wrap{
+    border-radius: 0rpx  0rpx 15rpx  15rpx !important;
+    box-shadow:2px 2px 5px #e5e5e6  !important;
+  }
+  /* 选中的样式 */
+  .choose-item-select {
+    height: 229rpx;
+  
+    background: #FFFFFF;
+    border: 2rpx solid #606EB2;
+    box-shadow: 0px 10rpx 20rpx rgba(225, 229, 238, 0.6);
+    border-radius: 15rpx;
+  }
+  
+  .choose-item-two {
+    width: 78%;
+    padding-left: 29rpx;
+  
+  }
+  
+  .type-name {
+    font-size: 16px;
+    line-height: 20px;
+    text-align: left;
+    font-weight: bold;
+    color: #1B365D;
+  }
+  .account-name{
+    width: 96rpx;
+    font-size: 12px;
+    line-height: 20px; 
+    text-align: left;
+    margin: 3rpx 14rpx 3rpx 14rpx;
+    color: #1B365D;
+  }
+  
+  /* 没有选中的样式 */
+  .choose-item-unchecked {
+    height: 142rpx;
+  }
+  
+  image-code {
+  
+    align-items: center;
+    width: 166rpx;
+    height: 166rpx;
+    left: 510rpx;
+    top: 412rpx;
+    border: 1rpx solid #000000;
+    border-radius: 15rpx;
+  }
+  
+  .thick-line {
+    margin-top: 95rpx;
+    width: 5px;
+    height: 38rpx;
+    left: 36rpx;
+    top: 475rpx;
+    background: #606EB2;
+    border-radius: 0px 10rpx 10rpx 0px;
+  }
+  
+  .van-button--round {
+    border-radius: 15rpx !important;
+  }
+  
+  .van-field__placeholder{
+    color: #95A8CB !important;
+  }
+  .van-field__label{
+    color: #95A8CB !important;
+  }
+  .van-field__input{
+    color: #1B365D !important;
+  
+  }

+ 7 - 0
utils/Constants.js

@@ -101,6 +101,13 @@ module.exports = {
     { text: '自定义', value: -2 },
   ],
 
+    // 收付款类型
+    rpType: {
+      receipt: '收付款类型-收款',
+      payment: '收付款类型-付款', 
+    }
+    ,
+
   // 入库类型
   intoType: {
     pur: '入库类型-采购入库',