Răsfoiți Sursa

采购订单

王英杰 1 an în urmă
părinte
comite
2aa5d14dea

+ 3 - 1
api/pages/pur/purchase.js

@@ -39,7 +39,9 @@ module.exports = {
       returnAndOutbound: { key: 'returnAndOutbound', url: '/package-inventory/pages/outbound-processing/outbound-processing' }, 
       detailSup:{
         key:'detailSup',url:'/package-purchase/pages/supplier-list/detail/detail'
-      },
+      }, 
+      supCollection:{ key: 'supCollection', url: '/package-purchase/pages/pur-receipt/add/add', formMode: 'add', idKey: 'supId',image:'btn-customer-collection.png',formType:'add' }, //跳转客户收款
+      supReturnCollection: { key: 'supReturnCollection', url: '/package-purchase/pages/pur-refund/add/add', idKey: 'supId', formType: 'add', image: 'btn-customer-refund.png' },
     }
   } 
 };

+ 2 - 1
api/pages/sale/order.js

@@ -40,11 +40,12 @@ module.exports = {
       chooseChannel: { key: 'chooseChannel', url: '/package-base-select/pages/select-data/select-data', type: 'saleChannel'},
       choosecusFrom: { key: 'choosecusFrom', url: '/package-base-select/pages/select-data/select-data', type: 'customerFrom' },
       collection:{ key: 'collection', url: '/package-sales/pages/customer-collection/add/add', formMode: 'add', idKey: 'cusId',image:'btn-customer-collection.png',formType:'add' }, //跳转客户收款
+      cusReturnCollection: { key: 'cusReturnCollection', url: '/package-sales/pages/customer-collection/refund/refund', idKey: 'rpId', formMode: 'edit', image: 'btn-customer-refund.png' },
       printedBill:{ key: 'printedBill', method:'printedBill', formMode: 'index', idKey: 'cusId',image:'btn-printing.png' },
       detailCustomer: {
         key: 'detailCustomer', url: '/package-basic-data/pages/customer-list/detail/detail'
       },
-      cusReturnCollection: { key: 'cusReturnCollection', url: '/package-sales/pages/customer-collection/refund/refund', idKey: 'rpId', formMode: 'edit', image: 'btn-customer-refund.png' },
+ 
     }
 
   }

+ 3 - 1
i18n/zh-CN.js

@@ -466,7 +466,9 @@ const customer = {
   storeInformation: '门店信息',
   nextFollowTime: '提醒时间',
   cusCollection: '客户收款',
-  cusReturnCollection: '客户退款',
+  cusReturnCollection: '客户退款', 
+  supCollection: '供应商收款',
+  supReturnCollection: '供应商退款',
   cusReturnCollectionAmt: '退款金额',
   cusNotCollection: '取消收款',
   saleOrder: '销售订单',

+ 34 - 14
package-purchase/pages/pur-receipt/add/add.js

@@ -22,14 +22,12 @@ Page({
     amountArr: [{
       title: mixins.$t('payAmount'),
       code: 'payableResidue'
-    }
-    ],
+    }],
     cardList: [{
       name: 'main'
-    },],
+    }, ],
     contentObj: {
-      main: [
-        {
+      main: [{
           code: 'staffId',
           name: 'staffName',
           title: mixins.$t('staffId'),
@@ -143,7 +141,7 @@ Page({
     // }
     // 校验
     let valid = this.selectComponent('#dkForm').validData();
-    if(!valid){
+    if (!valid) {
       return;
     }
 
@@ -333,21 +331,21 @@ Page({
   },
 
   /**
-  * @desc : 获取当前客户的账款信息
-  * @date : 2024/2/1 15:49
-  * @author : 姜永辉
-  */
+   * @desc : 获取当前客户的账款信息
+   * @date : 2024/2/1 15:49
+   * @author : 姜永辉
+   */
   getAccount(id) {
+    let formData = JSON.parse(this.data.formData)
     return this.excute(this.data.accountService, this.data.accountService.getAccount + id, {}).then(res => {
-      if (res.data.code == 200) {
-        let formData = JSON.parse(this.data.formData)
+      if (res.data.code == 200) { 
         if (res.data.data) {
           let data = res.data.data
           if (data != null) {
             data.receivableResidue = data.receivableResidue ? Number(data.receivableResidue) : 0
             data.receiptResidue = data.receiptResidue ? Number(data.receiptResidue) : 0
             formData.cusDebt = Number(data.receivableResidue - data.receiptResidue) > 0 ? Number(data.receivableResidue - data.receiptResidue) : 0
-
+            formData.objInfo.arrearsResidue = Number(data.payableResidue - data.paymentResidue)
           } else {
             formData.cusDebt = 0
           }
@@ -377,7 +375,7 @@ Page({
         title: '编辑供应商付款',
       })
       this.getRpForUpdate(this.data.id)
-    } else {
+    }    else {
       if (this.data.formReturnMode == 'supplier') {
         let item = this.data.item
         //供应商详情跳转来的 新建 
@@ -395,6 +393,28 @@ Page({
     this.setData({
       formData: JSON.stringify(formData)
     })
+    if (this.data.formType == Constants.formMode.add) { //采购订单 转 新建供应商付款
+      let formData = JSON.parse(this.data.formData)
+      formData.supId = this.data.item.supId
+      formData.supCode = this.data.item.supCode
+      formData.supName = this.data.item.supplierName
+      formData.supType = this.data.item.supType
+      formData.contactName = this.data.item.contactName
+      formData.contactPhone = this.data.item.contactPhone
+      formData.returnAddress = this.data.item.returnAddress
+      formData.objInfo = {
+        supId: this.data.item.supId,
+        supName: this.data.item.supplierName,
+        supType: this.data.item.supType,
+        supCode: this.data.item.supCode,
+        returnAddress: this.data.item.returnAddress,
+      }
+      this.setData({
+        formData: JSON.stringify(formData)
+      }) 
+         // 获取当前客户的账款信息
+   this.getAccount(formData.supId)
+    } 
 
   },
 

+ 23 - 2
package-purchase/pages/pur-refund/add/add.js

@@ -350,7 +350,7 @@ Page({
             data.receivableResidue = data.receivableResidue ? Number(data.receivableResidue) : 0
             data.receiptResidue = data.receiptResidue ? Number(data.receiptResidue) : 0
             formData.cusDebt = Number(data.receivableResidue - data.receiptResidue) > 0 ? Number(data.receivableResidue - data.receiptResidue) : 0
-
+            formData.objInfo.arrearsResidue = Number(data.payableResidue - data.paymentResidue)
           } else {
             formData.cusDebt = 0
           }
@@ -406,7 +406,28 @@ Page({
     this.setData({
       formData: JSON.stringify(formData)
     })
-
+    if (this.data.formType == Constants.formMode.add) { //采购订单 转 新建供应商付款
+      let formData = JSON.parse(this.data.formData)
+      formData.supId = this.data.item.supId
+      formData.supCode = this.data.item.supCode
+      formData.supName = this.data.item.supplierName
+      formData.supType = this.data.item.supType
+      formData.contactName = this.data.item.contactName
+      formData.contactPhone = this.data.item.contactPhone
+      formData.returnAddress = this.data.item.returnAddress
+      formData.objInfo = {
+        supId: this.data.item.supId,
+        supName: this.data.item.supplierName,
+        supType: this.data.item.supType,
+        supCode: this.data.item.supCode,
+        returnAddress: this.data.item.returnAddress,
+      }
+      this.setData({
+        formData: JSON.stringify(formData)
+      }) 
+         // 获取当前客户的账款信息
+   this.getAccount(formData.supId)
+    } 
   },
 
 

+ 21 - 0
package-purchase/pages/purchase-order/purchase-order.js

@@ -271,6 +271,15 @@ Page({
               idKey: 'purId',
             },
             {
+              name: 'supCollection',
+              title: mixins.$t("supCollection"),
+              idKey: 'supId'
+            }, //跳转客户收款
+            {
+              name: 'supReturnCollection',formType:Constants.formMode.add,
+              title: mixins.$t("supReturnCollection")
+            }, 
+            {
               name: 'purchaseCancellation',
               title: mixins.$t('purchaseCancellation'), //采购作废 
             }, //title:mixins.$t('followUp') 
@@ -303,6 +312,15 @@ Page({
               idKey: 'purId',
             },
             {
+              name: 'supCollection',
+              title: mixins.$t("supCollection"),
+              idKey: 'supId'
+            }, //跳转客户收款
+            {
+              name: 'supReturnCollection',formType:Constants.formMode.add,
+              title: mixins.$t("supReturnCollection")
+            }, 
+            {
               name: 'purchaseCancellation',
               title: mixins.$t('purchaseCancellation'), //采购作废 
             }, //title:mixins.$t('followUp') 
@@ -461,6 +479,9 @@ Page({
         } else {
           res.statusName = res.intoStatusName
         }
+        if(res.returnQty){
+          res.customText = '有退货'
+        }
       });
     }
     sumAmount = tableData.sum('sumAmount')

+ 1 - 1
package-purchase/pages/purchase-order/purchase-order.wxml

@@ -16,7 +16,7 @@
    list="{{tableData}}" flgPoint = "{{true}}" title="supplierName"  bind:toTitle="toTitle" 
    status="statusName"  contentCol="displayedStatus" buttonList = "{{popbuttonList}}"routeObjName="{{routeObjName}}"
      contentObj="{{contentObj}}" footerAmount="{{footerAmount}}" 
-     footerInfo="{{footerInfo}}" bind:open="open" ></dk-list>
+     footerInfo="{{footerInfo}}" bind:open="open" customText="customText"></dk-list>
 
 <!-- 显示没用更多 -->
 <van-divider wx:if="{{noMore}}" contentPosition="center" borderColor="#DCDCDC">{{$t['noMore']}}~</van-divider>