Browse Source

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss_wx_app

zhoux 2 years ago
parent
commit
84959ded63

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

@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright(c) 2024 dongke All rights reserved. / Confidential
+ * 类的信息:
+ *		1.程序名称:
+ *		2.功能描述:客户收款
+ * 编辑履历:
+ *		作者				日期					版本				修改内容
+ *		于继渤		  	    2024-1-19       		1.00		       	新建
+ *******************************************************************************/
+module.exports = {
+	cusReceiptPaymentService: {
+		// 前缀
+		prefix: 'mdm-server/mac/recPay/',
+		insertReceivableReceipt:'insert_receivable_receipt',
+		insertPayableReceipt:'insert_payable_receipt',
+	},
+
+	routeUrl: {
+		cusReceiptPayment: {
+			// 收款单新建
+			add: { key: 'add', url: '/package-sales/pages/customer-collection/add/add' },
+      selectCustomers: { key: 'add', url: '/package-base-select/pages/select-customers/select-customers' },
+		}
+	}
+}; 

+ 2 - 1
app.js

@@ -59,10 +59,11 @@ const order = require('./api/pages/sale/order.js');
 const income = require('./api/pages/mac/income.js');
 const saleOutBound = require('./api/pages/ivt/saleOutBound.js');
 const inboundReturn = require('./api/pages/ivt/inboundReturn.js');
+const cusReceiptPayment = require('./api/pages/mac/cusReceiptPayment.js');
 
 // api服务路由文件
 var apiList = [common, oauth,setting, company, wechatPay,user, staff, staffRight, staffPurview, settingValue, customer, role, roleFun, org, roleSensitive, goodsBrand, goodsCategory, goodsSeries, unit, supplier, warehouse, saleChannel, goodsSku, basicData,customerMst,purchase,account,
-  receiptPayment,inbound,inboundOther,inboundProcessing,inboundPurchaseReturn,outbound,outboundOther,outboundProcessing,outboundSaleReturn,inventory,moneyAccount,intoReturn,intoReturnItem,cusFollow,order,transfer,income,saleOutBound,inboundReturn]
+  receiptPayment,inbound,inboundOther,inboundProcessing,inboundPurchaseReturn,outbound,outboundOther,outboundProcessing,outboundSaleReturn,inventory,moneyAccount,intoReturn,intoReturnItem,cusFollow,order,transfer,income,saleOutBound,inboundReturn,cusReceiptPayment]
 
 const util = require('./utils/util.js')
 const baseMethod = require('./api/pages/baseMethod.js')

+ 105 - 650
package-sales/pages/customer-collection/add/add.js

@@ -7,684 +7,139 @@
  *		作者				日期					版本				修改内容
  *		于继渤		        2022-5-25		        1.00		   	    新建
  *******************************************************************************/
-import Dialog from '../../../../dist/dialog/dialog.js';
-const util = require('../../../../utils/util.js')
-const api = require('../../../../utils/api.js')
-const Constants = require('../../../../utils/Constants.js')
-const config = require('../../../../config/config.js')
-const common = require('../../../../utils/common');
+
+const Constants = require('@/utils/Constants.js');
+import Dialog from '@/dist/dialog/dialog.js';
+const mixins = require('@/mixins/index.js')
 const app = getApp()
 Page({
-
+  mixins: [mixins],
   /**
    * 页面的初始数据
    */
   data: {
-    CustomerRefundFlag: false,
-    activeNamese: [
-      "1"
-    ],
-    customList: [
-      {
-        "number": 0,
-        "text": "请选择"
-      }
-    ],
-    fileList: [],
-    form: {
-      "balanceAmount": 0,
-      "customerForm": {
-        "addressName": "",
-        "addressNo": "",
-        "ageComposition": null,
-        "ageCompositionName": "",
-        "deliveryPhone": null,
-        "customerCode": "",
-        "customerFrom": null,
-        "customerFromName": "",
-        "customerName": "",
-        "decisionMaker": null,
-        "decisionMakerName": "",
-        "fitupStyle": null,
-        "fitupStyleName": "",
-        "fitupType": null,
-        "fitupTypeName": "",
-        "houseType": null,
-        "houseTypeName": "",
-        "pice": 0,
-        "toiletCount": null,
-        "toiletCountName": ""
-      },
-      "designGraphics": false,
-      "feeItemAmount": 0,
-      "refundAccount": "",
-      "remarks": "",
-      "settlementAmount": 0,
-      "sreceiptId": "",
-      "sreceiptNo": "",
-      "sumAmount": 0,
-      "sumRefundAmount": 0,
-      "sumTempAmount": 0
-    },
-    loading: false,
-    orderINFO: {
-      "receivable": 0,
-      "sumAmount": 0
-    },
-    orgItem: {
-      "code": "",
-      "text": "北海富安居店",
-      "value": 32402
-    },
-    receiptList: [
-      {
-        "settlementAmonut": 0,
-        "settlementName": ""
-      }
+    cardList: [
+      { name: 'main', title: mixins.$t("customerInformation") },
+
     ],
-    salesChannelItem: {
-      "code": "",
-      "text": "零售",
-      "value": 1
-    },
-    selectTotallength: "0",
-    selectlength: "0",
-    staffItem: {
-      "code": null,
-      "text": "王英杰",
-      "value": 643
-    }, 
-  },
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {  },
-  //获取客户信息
+    contentObj: {
+      main: [
+        { code: 'cusName', type: 'selectIcon', urlKey: 'selectCustomers', required: true, readonly: false, title: mixins.$t('customerName') },
+        { code: 'cusPhone', type: 'phone', title: mixins.$t('cusPhone'), required: true },
+        { code: 'addressFull', type: 'address', title: mixins.$t('adddressFull'), required: false },
+        { code: 'amountCollected', type: 'number', title: mixins.$t("amountCollected"), readonly: false },
+
+        { code: 'sourceOrder', name: 'sourceOrder', type: 'drop', required: false, dropType: 'sourceOrder', title: mixins.$t('sourceOrder') },
+        { code: 'remarks', type: 'textarea', title: mixins.$t("remarks"), readonly: false },
+        { code: 'file', type: 'uploader', title: mixins.$t("uploader") }
+      ],
 
-  getCustomerDetail(param) {
-    this.setData({
-      loading: true
-    })
-    param.cpId = app.globalData.user.cpId
-    api.request(Constants.SALE_CUSTOMER_API + 'select_customer_detail_phone', 'POST', param).then(res => {
-      this.setData({
-        loading: false
-      })
-      if (res.data.code === 200) {
-        let item = res.data.data
-        if (item) {
-          let form = this.data.form
-          form.customerForm.customerId = item.customerId
-          form.customerForm.customerName = item.customerName
-          form.customerForm.customerPhone = item.customerPhone
-          form.customerForm.addressName = item.addressName
-          form.customerForm.addressNo = item.addressNo
-          form.customerForm.addressGcj02 = item.addressGcj02
-          form.customerForm.addressArea = item.addressArea
-          form.customerForm.addressFull = item.addressFull
-          form.customerForm.address = item.addressFull
-          form.customerForm.deliveryPhone = item.deliveryPhone ? item.deliveryPhone : item.customerPhone
-          form.customerForm.customerFrom = item.customerFrom
-          form.customerForm.decisionMaker = item.decisionMaker
-          form.customerForm.fitupStyle = item.fitupStyle
-          form.customerForm.fitupType = item.fitupType
-          form.customerForm.houseType = item.houseType
-          form.customerForm.toiletCount = item.toiletCount
-          form.customerForm.ageComposition = item.ageComposition
-          form.customerForm.customerFromName = item.customerFromName
-          form.customerForm.decisionMakerName = item.decisionMakerName
-          form.customerForm.fitupStyleName = item.fitupStyleName
-          form.customerForm.fitupTypeName = item.fitupTypeName
-          form.customerForm.houseTypeName = item.houseTypeName
-          form.customerForm.toiletCountName = item.toiletCountName
-          form.customerForm.ageCompositionName = item.ageCompositionName
-          form.customerForm.estateName = item.estateName
-          form.customerForm.estateId = item.estateId
-          this.setData({
-            form: form
-          })
-        }
+    },
+    buttonSaveList: [{ code: 'add', title: mixins.$t("collection"), color: '#CAA977' }],
+    contentSaveList: [{ code: 'need', title: mixins.$t("saleCollection"), type: 'str' }, { code: 'amount', content: 2000, type: 'number' }],
+    routeObjName: 'cusReceiptPayment',
+  },
+
+  /**
+    * @desc   : 选择回调
+    * @author : 于继渤
+    * @date   : 2024/1/26 11:46
+    */
+  chooseData(e) {
+    console.log('eee1', e);
+    let item = e.detail.data
+    let code = e.detail.code
+    let formData = JSON.parse(this.data.formData)
+    //设置客户信息
+    if (code == 'cusName') {
+      formData.cusCode = item.cusCode
+      formData.cusId = item.cusId
+      formData.cusName = item.cusName
+      formData.cusPhone = item.cusPhone
+      formData.cusFromName = item.cusFromName
+      formData.cusFrom = item.cusFrom
+      //处理地址
+      formData.address = {
+        address: item.addressFull,
+        addressFull: item.addressFull,
+        addressArea: item.addressArea,
+        addressGcj02: item.addressGcj02,
+        addressName: item.addressName,
       }
-    })
-  },
-  /**
-     * @desc : 销售价格编辑
-     * @author : 常皓宁
-     * @date : 2022/5/31 14:45
-     */
-  changeSalesPriceField(e) {
-    let form = this.data.form
-    form.sumAmount = e.detail.value;
-    this.setData({
-      form
-    })
-  },
-  /**
-   * 退款账号数值改变监听 
-   */
-  changeRefundAccountField(e) {
-
-    let form = this.data.form
-    form.refundAccount = e.detail;
-    this.setData({
-      form
-    })
-  },
-
-  /**
- * @desc : 上传方法
- * @author : 于继渤
- * @date : 2022/6/02 16:16
- */
-  afterRead(event) {
-    const _this = this;
-    const {
-      file
-    } = event.detail;
-    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': 't_receipt/receipt'
-        },
-        header: {
-          'Authorization': 'Bearer ' + app.globalData.token
-        },
-        success(res) {
-          res.data = JSON.parse(res.data)
-          if (res.data.code === 200) {
-            let arr = _this.data.fileList;
-            arr.push({
-              url: res.data.data.absolutelyPath,
-              FilePath: res.data.data.relativePath,
-              deletable: true
-            })
-            _this.setData({
-              fileList: arr
-            })
-
-          }
-        },
-      })
-    })
-  },
-
-  /**
-   * 收款金额输入数量监听
-   */
-  changeSumAmount(e) {
-    let orderINFO = this.data.orderINFO
-    orderINFO.sumAmount = e.detail.value;
-    this.setData({
-      orderINFO
-    })
-  },
-
-  /**
-   * @desc : 下拉多选确定
-   * @author : 王英杰
-   * @date : 2022/5/26 12:16
-   */
-  mutiSearchAll(e) {
-    let id = e.currentTarget.id
-    if (id === 'org') {
-      this.setData({
-        orgIds: e.detail.idList,
-        orgFlag: false
-      })
-      // this.selectComponent("#statusItemOrg").toggle(false)
-      this.doSearch()
+      formData.addressArea = item.addressArea
+      formData.addressFull = item.addressFull
+      formData.addressGcj02 = item.addressGcj02
+      formData.addressName = item.addressName
+      formData.addressNo = item.addressNo
+      //订单销售渠道 ,默认取的客户的渠道
+      formData.salesChannel = item.channelId
+      formData.channelId = item.channelId
+      formData.channelName = item.channelName
+      formData.contactPhone = item.contactPhone
+      formData.contactPhone = item.contactPhone
+    }
+    ///设置主从业务员
+    if (code == 'staff') {
+      formData.staff = item.staffItem
+      formData['staffId'] = item.staffMain.staffId
+      formData['staffName'] = item.staffMain.staffName
+      formData['staffList'] = item.staffList
+      console.log(item.staffList)
+    }
+    ///设置主从业务部门
+    if (code == 'org') {
+      console.log('item', item)
+      formData.org = item.orgItem
+      formData['orgId'] = item.orgMain.orgId
+      formData['orgName'] = item.orgMain.orgName
+      formData['orgList'] = item.orgList
     }
-    if (id === 'staff') {
-      this.setData({
-        staffIds: e.detail.idList,
-        staffFlag: false
-      })
-      // this.selectComponent("#statusItemStaff").toggle(false)
-      this.doSearch()
-    }
-
-  },
-  /**
-   * @desc : 下拉多选关闭
-   * @author : 于继渤
-   * @date : 2022/5/26 12:16
-   */
-  muticloseAll(e) {
-    let id = e.currentTarget.id
-    if (id === 'org') {
-      this.setData({
-        orgFlag: false
-      })
-      this.selectComponent("#statusItemOrg").toggle(false)
-    }
-    if (id === 'staff') {
-      this.setData({
-        staffFlag: false
-      })
-      this.selectComponent("#statusItemStaff").toggle(false)
-    }
-  },
-  /* 表单校验 */
-  checkForm() {
-
-    if (!this.data.staffItem.value) {
-      return {
-        flag: false,
-        msg: '请选择业务员'
-      };
-    }
-    if (!this.data.orgItem.value) {
-      return {
-        flag: false,
-        msg: '请选择业务部门'
-      };
-    }
-    if (!this.data.salesChannelItem.value) {
-      return {
-        flag: false,
-        msg: '请选择销售渠道'
-      };
-    }
-    if (!this.data.form.customerForm.customerId) {
-      return {
-        flag: false,
-        msg: '请选择客户'
-      };
-    }
-
-    return {
-      flag: true,
-      msg: '表单校验通过'
-    }
-  },
-  /**
-   * 备注
-   * @param {*} e 
-   */
-  changeRemarksField(e) {
-    let form = this.data.form
-    form.remarks = e.detail
     this.setData({
-      form
+      formData: JSON.stringify(formData)
     })
-  },
-  /**
-   * 保存
-   */
-  submit() {
-    
-    wx.navigateTo({
-        url: '../../order-billing/collection-confirm/collection-confirm'
-    })
-
-    wx.navigateTo({
-      url: '../customer-collection-confirm?type=' + type + "&customerForm=" + JSON.stringify(this.data.form.customerForm) +
-        "&orderINFO=" + JSON.stringify(this.data.orderINFO) +
-        "&staffID=" + this.data.staffItem.value +//员工 
-        "&staffCode=" + this.data.staffItem.code +//员工    
-        "&orgID=" + this.data.orgItem.value +// 部门
-        "&orgCode=" + this.data.orgItem.code +// 部门
-        "&salesChannelID=" + this.data.salesChannelItem.value + //渠道
-        "&salesChannelName=" + this.data.salesChannelItem.text + //渠道
-        "&sreceiptId=" + formInfo.sreceiptId +//原单id
-        "&sreceiptNo=" + formInfo.sreceiptNo +//原单单号
-        "&formInfo=" + JSON.stringify(formInfo) +
-        "&refundAccount=" + formInfo.refundAccount +
-        "&remarks=" + formInfo.remarks +
-        "&fileList=" + JSON.stringify(this.data.fileList) + //  图片
-        "&editTime=" + this.data.orderINFO.editTime + //  图片
-        "&receiptId=" + receiptId +
-        "&moneySynchroType=1" +'&orgId='+this.data.orgItem.value
-    })
-
-  },
-  /**
-   * 删除图片
-   */
-  deleteImg(e) {
-    let index = e.detail.index;
-    let arr = this.data.fileList;
-    arr.splice(index, 1);
-    this.setData({
-      fileList: arr
-    })
-  },
-  /**
-   * @desc : 客户费用合计
-   * @author : 于继渤
-   * @date : 2022/5/24 12:16
-   */
-  totalCustomerFees() {
-    let customList = this.data.customList
-    let feeListSum = 0
-    customList.forEach(res => {
-      feeListSum += parseFloat(res.number ? res.number : 0)
-    })
-
-    return feeListSum.toFixed(2)
 
   },
 
-  /**
-   * @desc : 组件单选下拉打开事件
-   * @author : 于继渤
-   * @date : 2022/5/26 17:16
-   */
-  openSingle(e) {
-    // let type = e.currentTarget.dataset.type
-
-    if (e.detail.currentTarget) {
-      let type_one = e.detail.currentTarget.dataset.type
-      if (type_one === 'settlement') {
-        let index = e.detail.currentTarget.dataset.index
-        this.setData({
-          settlementIndex: index,
-          settlementFlag: true
-        })
-      }
 
-    }
 
 
-  },
-  /**
-   * @desc : 组件单选确定
-   * @author : 于继渤
-   * @date : 2022/5/26 17:16
-   */
-  mutiSearch(e) {
-    let id = e.target.id
-    if (id === 'settlement') {
-      let settlementIndex = this.data.settlementIndex
-      let customList = this.data.customList
-      customList[settlementIndex].text = e.detail.name
-      customList[settlementIndex].id = e.detail.id
-      this.setData({
-        customList: customList
-      })
-    }
-  },
-  /**
-   * @desc : 客户收款费用明细组件输入事件删
-   * @author : 于继渤
-   * @date : 2022/6/02 12:16
-   */
-  changeSettlementFeeField(e) {
-    let key = e.currentTarget.dataset.key
-    let customList = this.data.customList
-    let index = e.detail.index
-    let number = e.detail.number
-    let form = this.data.form
-    if (key === 'settlement') {
-      customList[index].number = number
-      //调用计算费用总计函数
-      form.settlementAmount = this.totalCustomerFees()
-    }
-    this.setData({
-      form: form,
-
-      customList: customList
-    })
-
-  },
-  /**
-   * @desc : 结算方式添加数据
-   * @author : 于继渤
-   * @date : 2022/5/26 12:16
-   */
-  addItem_settlement() {
-    let customList = this.data.customList;
-    customList.push({
-      text: '请选择',
-      number: 0.00
-    })
-    this.setData({
-      customList: customList
-    })
-  },
-  /**
-   * @desc : 客户收款删除事件
-   * @author : 于继渤
-   * @date : 2022/5/26 12:16
-   */
-  del(e) {
-    let index = e.detail;
-    let key = e.currentTarget.dataset.key
 
-    if (key === 'settlement') {
 
-      let customList = this.data.customList;
-      customList.splice(index, 1)
-      this.setData({
-        customList: customList
-      })
-    }
-  },
-  /**
-   * @desc : 下拉打开事件
-   * @author : 于继渤
-   * @date : 2022/5/26 12:16
-   */
-  openSalesChannelDropdown(e) {
-    this.setData({
-      salesChannelFlag: true
-    })
-  },
 
   /**
-   * @desc : 下拉单选确认事件
-   * @author : 于继渤
-   * @date : 2022/5/26 12:16
-   */
-  singleSearchAll(e) {
-    let id = e.currentTarget.id
-    let salesChannelItem = this.data.salesChannelItem
-    let orgItem = this.data.orgItem
-    let staffItem = this.data.staffItem
-    if (id === 'salesChannel') {
-      salesChannelItem.text = e.detail.name
-      salesChannelItem.value = e.detail.id
-      this.setData({
-        salesChannelItem: salesChannelItem,
-        salesChannelFlag: false
-      })
-      // this.selectComponent("#salesChannelItem").toggle(false)
+  * 生命周期函数--监听页面加载
+  */
+  loadInit() {
+    let formData = JSON.parse(this.data.formData)
+    formData['staff'] = {
+      text: app.globalData.user.staffName,
+      value: [app.globalData.user.staffId]
     }
-    if (id === 'org') {
-      orgItem.text = e.detail.name
-      orgItem.value = e.detail.id
-      orgItem.code = e.detail.code
-      salesChannelItem.text = e.detail.salesChannelName
-      salesChannelItem.value = e.detail.salesChannel
-      this.setData({
-        orgItem: orgItem,
-        salesChannelItem,
-        orgFlag: false
-      })
-      this.selectComponent("#orgItem").toggle(false)
+    formData['org'] = {
+      text: app.globalData.user.orgName,
+      value: [app.globalData.user.orgId]
     }
-
-    if (id === 'staff') {
-      staffItem.text = e.detail.name
-      staffItem.value = e.detail.id
-      staffItem.code = e.detail.code
-      orgItem.text = e.detail.orgName
-      orgItem.value = e.detail.orgId
-      orgItem.code = e.detail.orgCode
-      this.setData({
-        orgItem: orgItem,
-        staffItem: staffItem,
-        staffFlag: false
-      })
-      this.selectComponent("#staffItem").toggle(false)
-    }
-  },
-  /**
-   * @desc : 跳转选择客户
-   * @author : 于继渤
-   * @date : 2022/5/26 12:16
-   */
-  onChooseCustomer() {
-    wx.navigateTo({
-      url: '../../choose-customer/choose-customer',
-    })
-  },
-  /**
-   * 跳转订单选择界面
-   */
-  chooseOrder() {
-    if (!this.data.form.customerForm.customerId) {
-      wx.showToast({
-        title: "请选择客户",
-        image: '/static/image/warning.png',
-        duration: 1000
-      })
-      return
-    }
-    wx.navigateTo({
-      url: '../relation-order/relation-order?customerId=' + this.data.form.customerForm.customerId,
-    })
-  },
-  /**
-   * @desc : 清除客户信息
-   * @author : 于继渤
-   * @date : 2022/5/26 12:16
-   */
-  onChooseCustomerClear() {
-    let form = this.data.form
-    form.customerForm = {
-      orderNo: '',
-      customerName: '', //客户姓名
-      pice: 0, //预收款
-      deliveryPhone: '',
-      addressName: '',
-      addressNo: '',
-      //客户来源
-      customerFrom: null,
-      customerFromName: '',
-      //卫生间数
-      toiletCount: null,
-      toiletCountName: '',
-      //装修类型
-      fitupType: null,
-      fitupTypeName: '',
-      //房屋类型
-      houseType: null,
-      houseTypeName: '',
-      //装修风格
-      fitupStyle: null,
-      fitupStyleName: '',
-      //年龄构成
-      ageComposition: null,
-      ageCompositionName: '',
-      //决策者
-      decisionMaker: null,
-      decisionMakerName: '',
-    }
-    this.setData({
-      form: form,
-      orderINFO:{
-        receivable:0,
-        sumAmount:0
+    formData.orgId = app.globalData.user.orgId
+    formData.orgList = [
+      {
+        orgId: app.globalData.user.orgId,
+        orgName: app.globalData.user.orgName,
+        ownerFlag: true,
+        allocationRatio: 100,
       }
-    })
-  },
-  /**
-   * @desc : 下拉单选关闭事件
-   * @author : 于继渤
-   * @date : 2022/5/26 12:16
-   */
-  singleCloseAll(e) {
-    let id = e.currentTarget.id
-    if (id === 'salesChannel') {
-      this.setData({
-        salesChannelFlag: false
-      })
-      //   this.selectComponent("#salesChannelItem").toggle(false)
-    }
-    this.selectComponent("#staffItem").toggle(false)
-    this.selectComponent("#orgItem").toggle(false)
-  },
-  /**
-   * @desc : 选择业务部门
-   * @author : 于继渤
-   * @date : 2022/5/26 12:16
-   */
-  openOrgDropdown() {
-    this.setData({
-      orgFlag: true
-    })
-
-  },
-
-  /**
-   * @desc : 选择业务员
-   * @author : 于继渤
-   * @date : 2022/5/26 12:16
-   */
-  openStaffDropdown() {
-    this.setData({
-      staffFlag: true
-    })
-
-  },
-
-
-  /**
-   * @desc : 加载数据
-   * @author : 于继渤
-   * @date : 2022/6/10 12:16
-   */
-  getsalesChanne() {
-    this.setData({
-      loading: true
-    })
-    let param = {}
-    param.cpId = app.globalData.user.cpId
-    param.orgId = app.globalData.user.orgId
-    api.request(Constants.BASIC_COMMON_API + 'select_salechannel_by_org', 'POST', param).then(res => {
-      this.setData({
-        loading: false
-      })
-      if (res.data.code === 200) {
-
-        let salesChannelItem = this.data.salesChannelItem
-        salesChannelItem.text = res.data.data.salesChannelName
-        salesChannelItem.value = res.data.data.salesChannel
-        this.setData({
-          salesChannelItem
-        })
-
+    ]
+    formData.staffId = app.globalData.user.staffId
+    formData.staffList = [
+      {
+        staffId: app.globalData.user.staffId,
+        staffName: app.globalData.user.staffName,
+        ownerFlag: true,
+        allocationRatio: 100,
       }
-
-    })
-  },
-
-  //获取来源单据
-  getRefund() {
+    ]
     this.setData({
-      loading: true
+      formData: JSON.stringify(formData)
     })
-    let param = {}
-    param.settlementTypeName = '微信(新)'//结算方式名称
-    param.orderNo = ''//订单单号
-    param.customerPhone = '13300006666'//客户电话
-    param.organizationCode = '' //部门编码
-    param.cpId = app.globalData.user.cpId
-    api.request(Constants.SALE_ORDER_REFUND + 'select_refund', 'POST', param).then(res => {
-      this.setData({
-        loading: false
-      })
 
-      if (res.data.code === 200) {
-       
-        
-      }
-    })
   },
-
 })

+ 5 - 143
package-sales/pages/customer-collection/add/add.wxml

@@ -1,146 +1,8 @@
-<wxs src='../../../../utils/numberFormat.wxs' module="numberFormat"></wxs>
-<wxs src='../../../../utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
-<van-dialog id="van-dialog" />
-<loading wx:if="{{loading}}" loadingName="加载中" backgroundColor="#f2f2f2;" opacity="0.8"></loading>
-<!-- 导航内容 -->
-<van-dropdown-menu active-color="#1B365D">
-   
-    <!-- 业务部门 -->
-    <van-dropdown-item id="orgItem" title="{{orgItem.text ? orgItem.text : '选择业务部门' }}" bind:open="openOrgDropdown">
-    </van-dropdown-item>
-    <!-- 业务员 -->
-    <van-dropdown-item id="staffItem" title="{{staffItem.text ? staffItem.text : '选择业务员' }}" bind:open="openStaffDropdown">
-    </van-dropdown-item>
-
-
-  </van-dropdown-menu>
-
-<view class="card-style">
-<!-- 客户名称 -->
-  <van-cell data-item="{{item}}" data-index="{{index}}" border="{{false}}">
-    <view slot="title" style="width: 150%;">
-      <view style="display: flex;">
-        <view style="color: red;">
-          客户名称
-        </view>
-        <view style="margin-left: 86rpx;">
-          <view>{{form.customerForm.customerName}}</view>
-          <!-- <view style="color: red;" wx:if="{{form.customerForm.customerName}}">预收款:¥{{form.customerForm.pice}}</view> -->
-        </view>
-      </view>
-    </view>
-    <!-- 客户收款 才显示得 -->
-    <view wx:if="{{!CustomerRefundFlag}}" Cell Slot="value" style="text-align: right;color: #95A8CB;">
-      <view wx:if="{{!form.customerForm.customerName}}" catchtap="onChooseCustomer">
-        <view>
-          <van-icon name="user-o" />选客户
-        </view>
-      </view>
-      <view wx:if="{{form.customerForm.customerName}}" catchtap="onChooseCustomerClear">
-        <view>
-          <van-icon name="close" />清客户
-        </view>
-      </view>
-
-    </view>
-  </van-cell>
-<!-- 联系电话 -->
-  <van-field readonly="{{true}}" data-key="customerPhone" value="{{ form.customerForm.customerPhone }}" input-align="left" label="联系电话" placeholder="" autosize border="{{false}}" bind:change="changeCustomerPhone" bind:blur="changeFieldCustomerPhoneblur" right-icon="phone">
-  </van-field>
-
-<!-- 客户地址 -->
-  <van-field readonly="{{true}}" data-key="addressName" value="{{  wxmlUtil.addressToIndexOf(form.customerForm.addressArea.province + form.customerForm.addressArea.city + form.customerForm.addressArea.district  +  form.customerForm.addressName) }}" input-align="left" label="客户地址" placeholder=" " autosize border="{{ false }}" bind:change="changeCustomerFormField" right-icon="location">
-  </van-field>
-<!-- 门牌号 -->
-  <van-field readonly="{{true}}" data-key="addressNo" value="{{ form.customerForm.addressNo }}" input-align="left" label="门牌号" placeholder=" " autosize border="{{false}}" bind:change="changeCustomerFormField" right-icon="">
-  </van-field>
-  <!-- 客户收款 才显示得 -->
-  <view wx:if="{{!CustomerRefundFlag}}">
-
-    <van-cell border="{{false}}"  >
-      <view slot="title" style="color: #95A8CB;width:172rpx;">
-        收款金额
-      </view>
-      <view Cell Slot="value"style="float:left;margin-left:1vw;width:80%;">
-        <dk-number-input fontSize="14" wx:if="{{orderINFO.orderNo}}"  center="left" data-key="priceSale"inputColor="#CAA977"   max="{{ orderINFO.receivable}}"  inputValue="{{orderINFO.sumAmount}}" bind:triggerBindValue="changeSumAmount"></dk-number-input>
-        <dk-number-input fontSize="14" wx:if="{{!orderINFO.orderNo}}"  center="left" data-key="priceSale"inputColor="#CAA977"    inputValue="{{orderINFO.sumAmount}}" bind:triggerBindValue="changeSumAmount"></dk-number-input>
-      </view>
-    </van-cell>
-
-
-
-    <van-field readonly="{{true}}" value="{{form.orderNo}}" input-align="left" label="关联订单" placeholder="{{orderINFO.orderNo?orderINFO.orderNo:'请选择订单'}}" autosize border="{{false}}" catchtap="chooseOrder" right-icon="">
-    </van-field>
-
-
-    <view style="height:5px;background: white;"></view>
-
-
 
+<van-dialog id="van-dialog" />
+<loading wx:if="{{loading}}" ></loading>
 
-  </view>
-  <!-- 客户退款 才显示得 -->
-  <view wx:if="{{CustomerRefundFlag}}">
-    <van-field readonly="{{true}}" data-key="addressNo" value="{{ form.sreceiptNo? form.sreceiptNo:'' }}" input-align="left" label="原单单号" placeholder=" " autosize  border="{{false}}" right-icon="">
-    </van-field>
-
-    <van-field value="{{form.refundAccount}}" type="text" input-align="left" label="退款账号" placeholder="{{form.refundAccount?form.refundAccount:'请输入退款账号'}}" autosize border="{{false}}" right-icon="" bind:change="changeRefundAccountField">
-    </van-field>
-<!-- 
-    <van-field readonly="{{true}}" value="¥{{ numberFormat.toThousandCents(form.balanceAmount)}}" input-align="left" label="可用余额" placeholder=" " autosize border="{{false}}" right-icon="">
-    </van-field> -->
-
-    <dk-cell fontSize="14" contentFontSize="13" contentColor="#1B365D" titleColor="#95A8CB;" spaceWidth="75rpx"
-        title="可用余额" content="{{form.balanceAmount}}"></dk-cell>
-
-    <van-cell border="{{false}}"  >
-      <view slot="title" style="color: #95A8CB;width:172rpx;">
-        退款金额
-      </view>
-      <view Cell Slot="value"style="float:left;margin-left:1vw;width:80%;">
-        <dk-number-input center="left" data-key="priceSale" max="{{form.sumTempAmount}}" inputValue="{{form.sumAmount}}" bind:triggerBindValue="changeSalesPriceField"></dk-number-input>
-      </view>
-    </van-cell>
-
-    <view style="height:5px;background: white;"></view>
-
-
-
-  </view>
-  <van-field label="备注" bind:change="changeRemarksField" data-key="remarks" value="{{form.remarks}}" input-align="left" placeholder="请输入备注" border="{{false}}" />
-  <view style="height:10px;background: white;"></view>
-  <view style="height:15px;background: white;"></view>
-  <view style="height:1px;background: #f3f3f3;"></view>
-  <!--分割线  -->
-  <view style="width: 100%; background-color: white;  height: 180px; ">
-    <view style="margin-left: 15px;padding-top:10px;color: #95A8CB;font-size: 14px;" >
-      图片
-    </view>
-    <!-- <van-button icon="plus" custom-style="height:60px;width:60px;margin:10px" square bind:click="submit" type="default">
-            </van-button> -->
-            <view>
-              <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 style="margin-left: 15px;color: #C8C9CC">
-      图片最多上传5张
-    </view>
-  </view>
-  <view style="height: 7vw;"></view>
-</view>
-
-
-<view style="height: 18vw;"> </view>
-<!-- 合计保存相关组件 -->
-<dk-save-bottom flagTypeName="order-save-amount" disabledFlag="{{loadingButtonFlag}}" totallength="{{numberFormat.toThousandCents(CustomerRefundFlag?form.sumAmount:orderINFO.sumAmount)}}" item="{{item}}" bind:submit="submit"></dk-save-bottom>
-
-<dk-single-dropdown-item show="{{salesChannelFlag}}" id='salesChannel' typeName='salesChannel' bind:muticommit='singleSearchAll' bind:muticlose='singleCloseAll'></dk-single-dropdown-item>
-
-<!-- 结算方式 -->
-<dk-single-dropdown-item show="{{settlementFlag}}" id='settlement' typeName='settlement' bind:muticommit='mutiSearch' bind:muticlose='muticlose'></dk-single-dropdown-item>
-
-<!-- 业务部门 -->
-<dk-single-dropdown-item show="{{orgFlag}}" docName="客户收款" id='org' typeName='org' bind:muticommit='singleSearchAll' bind:muticlose='singleCloseAll'></dk-single-dropdown-item>
+<dk-form-bill type="sale" id="dk-form-bill" routeObjName="{{routeObjName}}" cardList="{{cardList}}" titleTagCol="shortName" titleCol="skuCode" descCol="skuModel" priceCol="priceStandard" quantityCol="itemQty" sumAmountCol="sumAmount" discountStandardCol="saleDiscount" contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" bind:setGoods="setGoods" bind:editItems="editItems" bind:openChoosedItemInfo="openChoosedItemInfo" deleteName="deleteItemList" bind:customersChoose="customersChoose" popType="sale" priceTitle="售价:" staff="staff" org="org">
+</dk-form-bill>
 
-<!-- 业务员 -->
-<dk-single-dropdown-item show="{{staffFlag}}" id='staff' typeName='staff' bind:muticommit='singleSearchAll' bind:muticlose='singleCloseAll'></dk-single-dropdown-item>
+<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{true}}" btnRightFlag="{{true}}" buttonList="{{buttonSaveList}}" contentList="{{contentSaveList}}" bind:open="open"></dk-save-button>

+ 0 - 40
package-sales/pages/customer-collection/add/add.wxss

@@ -1,40 +0,0 @@
- 
-.van-dropdown-menu__title {
-    color: #1B365D !important;
-  }
-  .van-search__content {
-    background: #F8F9FD;
-    border: 1px solid #D6E4FF;
-    border-radius: 15rpx !important;
-  }
-  .van-field__placeholder{
-    color: #95A8CB !important;
-  }
-  .card-style {
-    background: #FFFFFF;
-    box-shadow: 0px 5px 11px rgba(225, 229, 238, 0.6);
-    border-radius: 8px !important;
-    margin: 18px;
-    padding: 1vw;
-  }
-  
-  .van-field__label{
-    color: #95A8CB !important;
-  }
-  .van-field__input{
-    color: #1B365D !important;
-  
-  }
-  .oas-status-two {
-    width: 30%;
-    font-size: 3.8vw;
-    color: #1989fa;
-    text-align: center;
-  }
-  .van-cell__title{
-    flex:none !important
-  }
-  .van-cell__value{
-    text-align: left !important;
-   
-  }

+ 25 - 248
package-sales/pages/customer-collection/customer-collection.js

@@ -5,10 +5,9 @@
  *		2.客户收款
  * 编辑履历:
  *		作者				日期					版本				修改内容
- *		王英杰		        2022-0-12	            1.00		   	    
+ *		于继渤		        2022-0-12	            1.00		   	    
  *******************************************************************************/
 const Constants = require('@/utils/Constants.js');
-const util = require('@/utils/util.js')
 const mixins = require('@/mixins/index.js')
 Page({
   mixins: [mixins],
@@ -42,13 +41,12 @@ Page({
           value: "1"
         },
       ]
-      
+
     }, {
       code: 'choose',
       title: '类型',
       searchType: Constants.searchType.switch
     }],
-
     // 查询条件-筛选
     pullMenuList: [{
       code: 'outStatus',
@@ -74,262 +72,41 @@ Page({
       code: 'delivery_Time',
       dataType: 'date'
     }],
-
-    // 假数据
-    dataList: [{
-      salesChannelName: '',
-      customerId: 11,
-      customerName: '张三',
-      displayStatus: '已收款',
-      orderNo: 'SA-LWYD-ZOO-202401300SBG',
-      customerPhone: '15659741980',
-      addressFull: '辽宁省沈阳市浑南区沈阳市浑南区人民政府(新聪街西)1',
-      orgName: '零售部',
-      staffName: '薛玉',
-      tsumAmount: 3000,
-      categoryQuantity: '',
-      tsumQuantity: 1,
-      data:'2024 03-12',
-      amont:1009,
-      makeTime: '',collectStatus:'noCollect',collectAmount:1000
-    }, {
-      salesChannelName: '',
-      customerName: '李四',
-      displayStatus: '取消',
-      backgroundColor:'red',
-      orderNo: 'SA-LWYD-ZOO-202401300SBD',
-      customerPhone: '15659741980',
-      addressFull: '辽宁省沈阳市浑南区沈阳市浑南区人民政府(新聪街西)2',
-      orgName: '零售部',
-      staffName: '薛玉',
-      tsumAmount: 4000,
-      categoryQuantity: '',
-      tsumQuantity: 2,
-      data:'2024 03-12',
-      amont:1009,
-      makeTime: '',collectStatus:'noCollect',collectAmount:1000
-    }],
-
- 
     // 列表区(内容)
-    contentList: [{
-      name: 'orderNo',
-      title: '收款单号'
-    }, {
-      name: [{
-        name: 'orgName',
-        title: ''
-      }, {
-        name: 'staffName',
-        title: '业务员'
-      }],
-      title: '门店/业务员'
-    },{
-      name: 'data',
-      title: '收款时间'
-    },{
-      name: 'amont',
-      title: '可用余额'
-    },],
-
-    contentObj: {
-      '成交': [{
-        name: 'orderNo',
-        title: '订单单号'
-      } , {
-        name: [{
-          name: 'orgName',
-          title: ''
-        }, {
-          name: 'staffName',
-          title: '业务员'
-        }],
-        title: '客户地址'
-      }],
-      '未成交': [{
-        name: 'orderNo',
-        title: '订单单号'
-      }, {
-        name: 'customerPhone',
-        title: '客户电话'
-      }, {
-        name: [{
-          name: 'orgName',
-          title: ''
-        }, {
-          name: 'staffName',
-          title: '业务员'
-        }],
-        title: '客户地址'
-      }]
-    },
-
-    // 弹出按钮
-    buttonList: [{
-      name: 'customerRefund',
-      title: '客户收款'
-      }, {
-        name: 'customerRefundList',
-        title: '客户退款'
-      } 
-     
+    contentList: [
+      { name: 'rpNo', title: '收款单号' },
+      { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: '业务员' }], title: '门店/业务员' },
+      { name: 'accDate', title: '收款时间' },
+      { name: 'biznisNo', title: '关联源单' },
     ],
-
-    totallength: 0, //视图下方提醒数量
-
+    buttonSaveList: [{ code: 'add', title: mixins.$t("add") }],
     // 路由
-    routeObjName: 'customer',
-  },
-  /**
-   * 跳转客户详细
-   */
-  toDetail(e) {
-    let ID = e.currentTarget.dataset.item.customerId
-    this.setData({
-      selectflag: true
-    })
-    wx.navigateTo({
-      url: '../detail/detail?ID=' + ID,
-    })
-  },
-  toTitle(e) {
-    console.log('t1', e);
-  },
-  toStatus(e) {
-    console.log('t2', e);
-  },
-  toPoint(e) {
-    console.log('t3', e);
-    this.setData({
-      showShare: true
-    })
-  },
-  toAdd() {
-    wx.navigateTo({
-      url: './add/add',
-    })
-  },
-  /**
-   * @desc : 右上角三个小点 点击回调事件
-   * @date : 2024/2/1 15:49
-   * @author : 王英杰
-   */
-  open(e) {
-     let name = e.detail.name
-     let item = e.detail.item 
-     if(name == 'customerRefund'){  //客户收款
-      wx.navigateTo({
-        url: '/package-sales/pages/order-billing/customer-collection-refund/customer-collection-refund?form='+ encodeURIComponent(JSON.stringify(item)) +'&page=customer-collection' + '&pageIndex=customer-collection',
-      })
-     }
-     if(name == 'customerRefundList'){  //客户退款
-      wx.navigateTo({
-        url: '/package-sales/pages/order-billing/customer-collection/refund-record/refund-record?form='+ encodeURIComponent(JSON.stringify(item)) +'&page=customer-collection',
-      })
-     }
-   
-       
-  
-  },
-  /**
-   * @desc : 校验
-   * @date : 2024/2/1 15:49
-   * @author : 周兴
-   */
-  openValidData(item, name) {
-    console.log('item', item, name, item.customerId);
-    if (!item.customerId) {
-      wx.showToast({
-        title: '无此联系人,或陌生接待',
-        icon: 'none'
-      })
-      return false;
-    }
-    return true;
+    routeObjName: 'cusReceiptPayment',
   },
 
+
   /**
-   * @desc : 查询
-   * @date : 2024/2/1 15:49
-   * @author : 周兴
+   * @desc : 加载数据
+   * @author : 于继渤
+   * @date : 2024/1/23 9:16
    */
   getData(params) {
-    console.log('fff', params);
+    return this.excute(this.data.service, this.data.service.selectByCond, params);
   },
 
   /**
-   * 生命周期函数--监听页面加载
+   * @desc : 处理查询数据
+   * @date : 2024/2/1 15:49
+   * @author : 于继渤
    */
-  onLoad: function (options) {
-    //按钮权限
-
-    // let Customer_Follow = common.hasButtonRight(Constants.Customer_Follow) //跟进
-    // let Customer_Follow_Task = common.hasButtonRight(Constants.Customer_Follow_Task) //跟进任务
-    // let Customer_Order = common.hasButtonRight(Constants.Customer_Order) //销售订单
-    // let Customer_Receive = common.hasButtonRight(Constants.Customer_Receive) //客户收款
-    // let Customer_Add = common.hasButtonRight(Constants.Customer_Add) //客户新建
-
+  handleSearchData(tableData) {
+    if (tableData && tableData.length > 0) {
+      tableData.forEach(res => {
+        res.collectStatus = 'cusCollection'
+      })
+    }
     this.setData({
-      Customer_Follow: true,
-      Customer_Follow_Task: true,
-      Customer_Order: true,
-      Customer_Receive: true,
-      Customer_Add: true
-
+      tableData: tableData
     })
-
-
-
-
-    if (JSON.stringify(options) !== '{}') {
-
-      if (options.frommine) {
-
-        let frommine = JSON.parse(options.frommine)
-        var createtime = this.selectComponent('#createtime');
-        createtime.data.dataDefaultSearch = util.jumpPageDate(frommine.date.value)
-        createtime.data.createTimeType = frommine.date
-
-        let keyType = this.selectComponent('#keyType')
-        let keyTypeList = keyType.data.moreList
-        keyTypeList.forEach(kIt => {
-          if (frommine.keyTypeList) {
-            if (frommine.keyTypeList.some(it => kIt.id === it)) {
-              kIt.infotype = 'info'
-            }
-          }
-        })
-        keyType.setData({
-          moreList: keyTypeList
-        })
-
-        let searchForm = {
-          ...this.data.searchForm
-        }
-        searchForm.keyTypeList = frommine.keyTypeNameList
-
-        this.setData({
-          active: frommine.active,
-          createTimeType: frommine.date,
-          searchForm: searchForm,
-          searchFormNumber: (frommine.keyTypeNameList && frommine.keyTypeNameList.length > 0) ? 1 : null,
-          createTimeSearch: util.jumpPageDate(frommine.date.value),
-          staffIds: frommine.staffId ? [frommine.staffId] : [],
-          staffNames: frommine.staffNames,
-        })
-
-        createtime.init()
-      }
-    } else {
-      // this.searchData()
-    }
-  },
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-    if (this.data.selectflag) {
-      // this.searchData()
-    }
-  },
+  }
 })

+ 3 - 9
package-sales/pages/customer-collection/customer-collection.wxml

@@ -7,16 +7,10 @@
   </dk-dropdown-menu>
 </van-sticky>
 
-<!-- 暂无数据 -->
-<van-empty wx:if="{{dataList.length<=0}}" description="{{$t['nodata']}}" />
-
 <!-- 列表区 -->
-<dk-list  list="{{dataList}}" titleCorner="salesChannelName" title="customerName"collectCol="collectAmount"  status="displayStatus" subTitle="makeTime" content="{{contentList}}" contentObj="{{contentObj}}"  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">{{$t['noMore']}}~</van-divider>
-<view style="height: 135rpx;"></view>
-
+<dk-list list="{{tableData}}" flgSubFormatDate="{{true}}" titleCorner="channelName" title="cusName" status="rpTypeName" subTitle="makeTime" content="{{contentList}}" collectCol="collectStatus" contentObj="{{contentObj}}" contentCol="" footerAmount="{{footerAmount}}" footerInfo="{{footerInfo}}" bind:toDetail="toDetail" bind:toTitle="toTitle" bind:toStatus="toStatus" bind:toPoint="toPoint"  collectName="收款"   routeObjName="{{routeObjName}}" buttonList="{{buttonList}}" bind:open="open"></dk-list>
+<view style="height: 200rpx;"></view>
 
 
 <!-- 新建按钮 -->
-<dk-save-bottom   flagTypeName="customer-collection" totallength="{{totallength}}" bind:submit="toAdd" />
+<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{true}}" btnRightFlag="{{true}}" buttonList="{{buttonSaveList}}" contentList="{{contentSaveList}}" bind:open="open"></dk-save-button>