Selaa lähdekoodia

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

wangyingjie 2 vuotta sitten
vanhempi
commit
03b4dc7ba3

+ 4 - 0
api/pages/mac/account.js

@@ -20,6 +20,10 @@ module.exports = {
 			detail: {
 				key: 'detail', url: '/package-purchase/pages/purchase-return/detail/detail'
 			},
+			selectBill: {
+				key: 'selectBill', url: '/package-base-select/pages/select-bill/select-bill'
+			},
+			
 		}
 	}
 }; 

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

@@ -20,6 +20,14 @@ module.exports = {
 			detail: {
 				key: 'detail', url: '/package-purchase/pages/purchase-return/detail/detail'
 			},
+			selectBill: {
+				key: 'selectBill', url: '/package-base-select/pages/select-bill/select-bill'
+			},
+			chooseSupplier: { key: 'chooseSupplier', url: '/package-base-select/pages/select-suppliers/select-suppliers' },
+			chooseStaff: { key: 'chooseStaff', url: '/package-base-select/pages/select-choose-staff/select-choose-staff' },
+			staffadd: { key: 'staffadd', url: '/package-basic-data/pages/staff/add/add' },
+			chooseOrg: { key: 'chooseOrg', url: '/package-base-select/pages/select-choose-org/select-choose-org' },
+			chooseWh: { key: 'chooseWh', url: '/package-base-select/pages/select-warehouse/select-warehouse' },
 		}
 	}
 }; 

+ 133 - 19
package-accounts-manage/pages/receipt/add/add.js

@@ -7,21 +7,52 @@ Page({
    * 页面的初始数据
    */
   data: {
-    cardList: [{ name: 'main' }, { name: 'bill', title: '应收', chooseFlag: true, chooseTitle: '选应收',urlKey:''}, { name: 'file' }],
+    cardList: [
+      { name: 'main' },
+      { name: 'bill', title: '应收', chooseFlag: true, chooseTitle: '选应收', urlKey: 'selectBill' },
+      { 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: '收款类型' },
+        {
+          code: 'accDate',
+          name: 'accDate',
+          type: 'date',
+          required: true,
+        },
+        {
+          code: 'staffId',
+          name: 'staffName',
+          required: true,
+          title: '收款人',
+          type: 'choose',
+          urlKey: 'chooseStaff'
+        },
+        {
+          code: 'orgId',
+          name: 'orgName',
+          required: true,
+          type: 'choose',
+          urlKey: 'chooseOrg'
+        },
+        {
+          code: 'collectAmount',
+          type: 'number',
+          title: '本次收款',
+          required: true
+        },
+
       ],
       bill: [
-        { code: 'collectType', name: 'collectName', type: 'drop', required: true, dropType: 'collect' },
-        { code: 'collectAmount', type: 'number', title: '收款金额', required: true },
-        { code: 'cancelAmount', type: 'cancel', title: '核销应收', bill:3,amount:500 }
+        { code: 'cancelAmount', type: 'cancel', title: '核销应收', bill: 3, amount: 500 },
+        { code: 'receivableWaive', type: 'number', title: '待核销金额', readonly: true, },
+        { code: 'receiptResidue', type: 'number', title: '使用预存', },
+        { code: 'sumWaiveAmt', type: 'number', title: '优惠金额', },
+        { code: 'currentReceivableWaive', type: 'number', title: '本次核销', required: true },
       ],
-      file: [{ code: 'remarks', type: 'textarea', title: '备注' }, { code: 'file', type: 'uploader', title: '附件' }]
+      file: [{
+        code: 'remarks', type: 'textarea', title: '备注'
+      },
+      { code: 'file', type: 'uploader', title: '附件' }]
     },
     // 弹出按钮
     buttonList: [{
@@ -38,21 +69,104 @@ Page({
       type: 'number'
     }],
     btnFormData: null,
-    routeObjName:''
+    routeObjName: 'receiptPayment'
+  },
+
+  /**
+      * @desc   : 绑定数据-选择页面返回的逻辑处理
+      * @author : 姜永辉
+      * @date   : 2024年3月12日
+      */
+  chooseData(e) {
+    console.log("t", e, this.data.formData);
+    let formData = JSON.parse(this.data.formData)
+    let cardList_ = this.data.cardList
+    let code = e.detail.code
+    let data = e.detail.data.data
+    if (code == "supId") { //供应商
+      formData.supId = data.id
+      formData.supName = data.name
+    }
+    if (code == "staffId") { //员工
+      formData.staffId = data.id
+      formData.staffName = data.name
+    }
+    if (code == "orgId") { //部门
+      formData.orgId = data.id
+      formData.orgName = data.name
+    }
+   
+     
+    this.setData({
+      cardList: cardList_,
+      formData: JSON.stringify(formData)
+    })
   },
 
 
+
   /**
-  * @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',
+   * @desc : 保存数据服务--校验
+   * @date : 2024/2/1 15:49
+   * @author : 姜永辉
+   */
+  validData() { 
+    let formData = JSON.parse(this.data.formData)
+    if (formData.goodsList == null || formData.goodsList.length == 0) {
+      wx.showToast({
+        title: mixins.$t("chooseGoodsInfo"),
+        icon: 'none'
+      })
+      return false
+    } 
+    return true
+  },
+
+  /**
+   * @desc : 保存的參數設置
+   * @date : 2024/2/1 15:49
+   * @author : 姜永辉
+   */
+  setParams(params) {
+    let btnFormData = this.data.btnFormData ? JSON.parse(this.data.btnFormData) : ''
+    let formData = JSON.parse(this.data.formData)
+    // 总单的 出库中数量和金额合计
+    params.outingAmt = formData.goodsList.sum("outingAmt")   //金额
+    params.outingQty = formData.goodsList.sum("outingQty")     //一共的商品数量
+    params.outAmt = 0     //  已出库金额
+    params.outQty = 0     //  已出库数量         
+    params.automaticFlg = btnFormData ? btnFormData.flag : false //自动出出库标识 
+    // params.fromId = this.data.purIdArray  //来源id
+    // params.fromNo = formData.fromNo  //来源单号
+    params.orgId = formData.orgId  //组织部门
+    params.staffId = formData.staffId  // 员工
+    //  // 供应商1 客户2 所有 传空
+    if (formData.objType == 1) {
+      params.supId = formData.outObject  // 供应商
+    }
+    if (formData.objType == 2) {
+      params.cusId = formData.outObject  // 客户
+    }
+    // params.whId = formData.whId  // 仓库
+    params.remarks = formData.remarks  // 备注
+    params.makeStaff = app.globalData.user.staffId  // 制单人
+    // 明细的顺序
+    let i = 0
+    formData.goodsList.forEach(it => {
+      it.itemIndex = (i++)
     })
+    params.itemList = formData.goodsList //商品明细
+    console.log("setParams", params);
+    return params
+  },
 
+  /**
+  * @desc : 保存数据服务
+  * @date : 2024/2/1 15:49
+  * @author : 姜永辉
+  */
+  saveData() {
+    return this.excute(this.data.service, this.data.service.save, this.data.params)
   },
 
 })

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

@@ -3,10 +3,10 @@
 
 <loading wx:if="{{loading}}"></loading>
 
-<dk-form-more-items id="{{formName}}" routeObjName="{{routeObjName}}" objCol="customerId" objLabel="客户名称" objType="customer" dateCol="accountDate" dateLabel="收款日期" cardList="{{cardList}}" contentObj="{{contentObj}}" model:value="{{formData}}" bind:chooseData="chooseData">
+<dk-form-more-items id="{{formName}}" routeObjName="{{routeObjName}}" objCol="customerId" objLabel="客户名称" objType="customer"  cardList="{{cardList}}" contentObj="{{contentObj}}" model:value="{{formData}}" bind:chooseData="chooseData">
 </dk-form-more-items>
 
 <view style="height: 220rpx;"></view>
 
 <!-- 新建按钮 -->
-<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{false}}" btnRightFlag="{{true}}" buttonList="{{buttonList}}" contentList="{{contentList}}" bind:open="saveCollect"></dk-save-button>
+<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{false}}" btnRightFlag="{{true}}" buttonList="{{buttonList}}" contentList="{{contentList}}" bind:open="save"></dk-save-button>

+ 1 - 1
package-base-select/pages/select-bill/select-bill.js

@@ -312,7 +312,7 @@ Page({
    * @author : 姜永辉
    */
   getData(params) { 
-    return this.excute(this.data.service, this.data.service.selectInboundAndItem, params);
+    return this.excute(this.data.service, this.data.service.seleccon, params);
   },
 
   /**