Răsfoiți Sursa

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

zhoux 1 an în urmă
părinte
comite
c2d5b08537

+ 4 - 1
api/pages/mac/supReceiptPayment.js

@@ -15,13 +15,16 @@ module.exports = {
 		insertSupReceipt: 'insert_sup_receipt',
     getRpForUpdate: 'get_rp_for_update',
     selectRpInfoById: 'select_rp_info_by_id',
+    updateSupReceipt: 'update_sup_receipt',
+    insertSupRefund: 'insert_sup_refund',
+    invalidSup: 'invalid_sup',
 	},
 
 	routeUrl: {
 		supReceiptPayment: {	
 			docName:{key:'receipt' ,title:'收款单'},
 			cusReturnCollection: { key: 'cusReturnCollection', method: 'cusReturnCollection',image: 'btn-customer-refund.png' },
-			invaidOrder: { key: 'invaidOrder', method: 'invaidOrder',image: 'btn-void.png',question:true  },
+      invalid: { key: 'invalid', method: 'invalid', primaryKey: 'rpId', image: 'btn-void.png' },
 			editOrder: { key: 'editOrder', method: 'editOrder', primaryKey: 'rpId',image: 'btn-edit.png' },
 			printedBill: { key: 'printedBill', method: 'printedBill', image:'btn-printing.png' },//打印
 			// 收款单新建

+ 0 - 1
components/dkbase/dk-number-input/dk-number-input.js

@@ -256,7 +256,6 @@ Component({
 
       let minFlag = this.data.minFlag
       let min = this.data.min
-
       // 如果输入后让数据变成非数字,那么就要还原成之前的数据
       if (isNaN(e.detail)) {
         // 如果最小值在0之上 ,就不允许输入负数

+ 4 - 1
components/dkbase/dk-stepper/dk-stepper.js

@@ -44,7 +44,6 @@ Component({
     dataValue: null,
     max: 0
   },
-
   /**
    * 组件的方法列表
    */
@@ -69,6 +68,10 @@ Component({
       let dataValue = this.data.dataValue
       let min = this.data.min
       dataValue = dataValue - this.data.step
+      if(dataValue < 0){
+        min = min * -1
+      }
+      // 当数值计算后小于最大值或大于最小值都可以触发减法
       if (dataValue >= min) {
         this.setData({
           dataValue: dataValue,

+ 1 - 1
components/dkbase/dk-stepper/dk-stepper.wxml

@@ -3,7 +3,7 @@
     <!-- 将文字显示上方获取焦点相关事件处理遮罩文字显隐 -->
     <view class="number-view">
       <!-- <input disabled class="number-content" style="width: {{inputWidth ? inputWidth: ''}};" bindtap="inputOnFocus" wx:if="{{ !checkFocus && shieldShow }}" value="{{ inputValue }}"></input> -->
-      <image src="{{dataValue>min?'/static/image/btn-minus.png':'/static/image/btn-minus-d.png'}}" style="width: 36rpx;height:36rpx;" catchtap="handleMinus"></image>
+      <image src="{{(dataValue>min || dataValue == max)?'/static/image/btn-minus.png':'/static/image/btn-minus-d.png'}}" style="width: 36rpx;height:36rpx;" catchtap="handleMinus"></image>
       <view style="width: 200rpx;">
         <dk-number-input digits="{{decimalLength}}"  fontSize="14" left="30rpx" formatThousandth="{{false}}" sign=""  min="{{min}}" negative="{{false}}" center="center" readonly="{{!!readonly }}" contentRight="{{false}}" inputColor="#FF7B1A" requiredLeft="15rpx" inputValue="{{dataValue}}" bind:triggerBindBlur="changeStep"></dk-number-input>
       </view>

+ 9 - 5
package-base-select/pages/select-collection_confirm/select-collection_confirm.js

@@ -638,7 +638,7 @@ Page({
           macCode: item.macCode,
           macId: item.macId,
           macName: item.macName,
-          makeStaff: item.makeStaff ? item.makeStaff : null,
+          makeStaff: item.makeStaff ? item.makeStaff : form.makeStaff,
           accDate: utils.formatDayTime(new Date())
         })
       })
@@ -703,7 +703,11 @@ Page({
     } else if (this.data.formType == 11) { //销售出库 >>> 客户收款 
       return this.excute(this.data.saleOutBoundService, this.data.saleOutBoundService.outboundInsertCollection, this.data.params);
     } else if (this.data.formType == 12) { //供应商 付款
-      return this.excute(this.data.supReceiptPaymentService, this.data.supReceiptPaymentService.insertSupReceipt, this.data.params);
+      if (this.data.form.editFlag) {
+        return this.excute(this.data.supReceiptPaymentService, this.data.supReceiptPaymentService.updateSupReceipt, this.data.params);
+      } else {
+        return this.excute(this.data.supReceiptPaymentService, this.data.supReceiptPaymentService.insertSupReceipt, this.data.params);
+      }
     }
 
     
@@ -714,14 +718,14 @@ Page({
    * @author : 姜永辉
    */
   handleData() {
-    if (this.data.formType == 3 || this.data.formType == 4) { //客户收款/退款 
+    if (this.data.formType == 3 || this.data.formType == 4  || this.data.formType == 12) { //客户/供应商收款/退款 
       let pages = getCurrentPages();
       if (this.data.formReturnMode == 'customer') {
         let prevPage = pages[pages.length - 4]; //上三页
         prevPage.setData({
           refreshByAdd: true
         })
-      } else if(this.data.formReturnMode == 'customer-collection' || this.data.formReturnMode == 'refund-detail'){ //客户收款/退款详情进入
+      } else if(this.data.formReturnMode == 'customer-collection' || this.data.formReturnMode == 'refund-detail'|| this.data.formReturnMode =='pur-receipt-detail'){ //客户/供应商收款/退款详情进入
         this.setData({
           navigateBackFlag:true
         })
@@ -744,7 +748,7 @@ Page({
           delta: 2
         })
       }
-      if (this.data.formReturnMode == 'customer-collection' || this.data.formReturnMode == 'refund-detail') { //客户收款/退款详情进入详情进入
+      if (this.data.formReturnMode == 'customer-collection' || this.data.formReturnMode == 'refund-detail' ||  this.data.formReturnMode =='pur-receipt-detail') { //客户收款/退款详情进入详情进入
         wx.navigateBack({
           delta: 2
         })

+ 5 - 1
package-base-select/pages/select-data/select-data.js

@@ -385,7 +385,11 @@ Page({
     if (chooseType == Constants.chooseType.supplier) {
       params.supType = "";
       let active = this.data.active
-      params.supType = Constants.kindCode.supplierPur;
+      // params.supType = Constants.kindCode.supplierPur;
+      params.supTypeList =  [
+        Constants.kindCode.supplierPur,
+        Constants.kindCode.supplierOutsourcing,
+      ];
 
       if (active == 1) { //采购供应商
         params.supType = Constants.kindCode.supplierPur;

+ 1 - 4
package-basic-data/pages/func-buy/add-confirm/add-confirm.js

@@ -36,10 +36,7 @@ Page({
             this.setData({
                 userEndDate: app.globalData.company.userEndDate
             })
-        }
-        this.setData({
-            userEndDate: '2024-12-31'
-        })
+        } 
     },
 
     /**

+ 11 - 101
package-purchase/pages/pur-receipt/add/add.js

@@ -29,24 +29,7 @@ Page({
     contentObj: {
       main: [
 
-        {
-          code: 'contactName',
-          type: 'str',
-          title: mixins.$t('contactName'),
-          required: false,
-        },
-        {
-          code: 'contactPhone',
-          type: 'phone',
-          title: mixins.$t('contactPhone'),
-          required: false,
-        },
-        {
-          code: 'returnAddress',
-          type: 'str',
-          title: mixins.$t('returnAddress'),
 
-        },
         {
           code: 'staffId',
           name: 'staffName',
@@ -177,31 +160,10 @@ Page({
             })
           } else {
             let formData = {}
-            formData.staff = {
-              text: _this.data.orgStaffInfo.staffName,
-              value: [_this.data.orgStaffInfo.staffId]
-            }
-            formData.org = {
-              text: _this.data.orgStaffInfo.orgName,
-              value: [_this.data.orgStaffInfo.orgId]
-            }
             formData.orgId = _this.data.orgStaffInfo.orgId
             formData.orgName = _this.data.orgStaffInfo.orgName
-            formData.orgList = [{
-              orgId: _this.data.orgStaffInfo.orgId,
-              orgName: _this.data.orgStaffInfo.orgName,
-              ownerFlag: true,
-              allocationRatio: 100,
-            }]
             formData.staffId = _this.data.orgStaffInfo.staffId
             formData.staffName = _this.data.orgStaffInfo.staffName
-            formData.staffList = [{
-              staffId: _this.data.orgStaffInfo.staffId,
-              staffName: _this.data.orgStaffInfo.staffName,
-              ownerFlag: true,
-              allocationRatio: 100,
-            }]
-
             // 需收款
             let contentSaveList = _this.data.contentSaveList
             contentSaveList.forEach(item => {
@@ -247,7 +209,6 @@ Page({
     param.objInfo['objectId'] = formData.supId
     param.objInfo['returnAddress'] = formData.returnAddress
     param.supName = formData.supName
-    param.supPhone = formData.supPhone
     param.returnAddress = formData.returnAddress
     if (this.data.formMode !== Constants.formMode.other) {
       param.orgId = formData.orgId ? formData.orgId : app.globalData.user.orgId
@@ -260,31 +221,21 @@ Page({
       param.editFlag = true
       this.data.dataItem.forEach(res => {
         res.checked = true
-        res.sumAmount = Number(res.amtRec).toFixed(2)
+        res.sumAmount = Number(res.amtPay).toFixed(2)
       })
       param.dataItem = this.data.dataItem
     }
     param.annexPaths = formData.annexPaths
-    param.rpType = '收付款类型-款'
+    param.rpType = '收付款类型-款'
     param.sumAmtPay = formData.sumAmtPay
     param.sumAmount = formData.sumAmtPay
     // 设定当前多业务部门业务员
     this.setData({
       orgStaffInfo: {
-        staff: {
-          text: param.staffName ? param.staffName : app.globalData.user.staffName,
-          value: [param.staffId ? param.staffId : app.globalData.user.staffId]
-        },
-        org: {
-          text: param.orgName ? param.orgName : app.globalData.user.orgName,
-          value: [param.orgId ? param.orgId : app.globalData.user.orgId]
-        },
         orgId: param.orgId ? param.orgId : app.globalData.user.orgId,
         staffId: param.staffId ? param.staffId : app.globalData.user.staffId,
         orgName: param.orgName,
         staffName: param.staffName,
-        staffList: param.staffList,
-        orgList: param.orgList,
       }
     })
     return JSON.stringify(param)
@@ -343,42 +294,16 @@ Page({
     return this.excute(this.data.service, this.data.service.getRpForUpdate + '/' + id, {}).then(res => {
       if (res.data.code == 200) {
         let data = res.data.data.data
-        data.customerId = data.cusId
         data.objInfo = {
-          cusId: data.cusId,
-          cusName: data.cusName,
-          cusPhone: data.cusPhone,
-          cusCode: data.cusCode
-        }
-        //处理地址
-        data.address = {
-          address: data.addressFull,
-          addressFull: data.addressFull,
-          addressArea: data.addressArea,
-          addressGcj02: data.addressGcj02,
-          addressName: data.addressName,
+          supId: data.supId,
+          supName: data.supName,
+          supPhone: data.supPhone,
+          supCode: data.supCode,
+          payableResidue: data.payableResidue
         }
-        //处理顶部
-        data['staff'] = {
-          text: data.staffName,
-          value: [data.staffId]
-        }
-        data['org'] = {
-          text: data.orgName,
-          value: [data.orgId]
-        }
-        data.orgList = [{
-          orgId: data.orgId,
-          orgName: data.orgName,
-          ownerFlag: true,
-          allocationRatio: 100,
-        }]
-        data.staffList = [{
-          staffId: data.staffId,
-          staffName: data.staffName,
-          ownerFlag: true,
-          allocationRatio: 100,
-        }]
+
+        
+
         this.setData({
           formData: JSON.stringify(data),
           dataItem: res.data.data.dataItem
@@ -432,25 +357,10 @@ Page({
     //编辑收款
     if (this.data.formMode == Constants.formMode.other) {
       wx.setNavigationBarTitle({
-        title: '编辑客户收款',
+        title: '编辑供应商付款',
       })
       this.getRpForUpdate(this.data.id)
-      // 控制客户名称和电话不能修改
-      let contentObj = this.data.contentObj
-      contentObj.main.forEach(it => {
-        if (it.code == 'cusName' || it.code == 'cusPhone' || it.code == 'addressFull') {
-          it.readonly = true
-          it.readonlyItem = true
-        }
-      })
-      this.setData({
-        contentObj: contentObj
-      })
-      console.log('contentObj', contentObj);
     }
-
-
-
     this.setData({
       formData: JSON.stringify(formData)
     })

+ 7 - 24
package-purchase/pages/pur-receipt/detail/detail.js

@@ -33,25 +33,6 @@ Page({
     },],
     contentObj: {
       main: [
-
-        {
-          code: 'contactName',
-          type: 'str',
-          title: mixins.$t('contactName'),
-          required: false,
-        },
-        {
-          code: 'contactPhone',
-          type: 'phone',
-          title: mixins.$t('contactPhone'),
-          required: false,
-        },
-        {
-          code: 'returnAddress',
-          type: 'str',
-          title: mixins.$t('returnAddress'),
-          required: false,
-        },
         {
           code: 'staffId',
           name: 'staffName',
@@ -118,6 +99,7 @@ Page({
         let data = {
           id: _this.data.id,
           formMode: Constants.formMode.other,
+          formReturnMode: _this.data.formReturnMode ? _this.data.formReturnMode : 'pur-receipt-detail'
         }
         res.eventChannel.emit('params', data);
       }
@@ -263,6 +245,7 @@ Page({
         data.objInfo = {
           supId: data.supId,
           supName: data.supName,
+          payableResidue: data.payableResidue,
           contactPhone: data.contactPhone,
           contactName: data.contactName
         }
@@ -346,9 +329,9 @@ Page({
      * @date : 2024/2/1 15:49
      * @author : 于继渤
      */
-  // customQuery(){
-  //   if (this.data.formMode == Constants.formMode.other) {
-  //     this.getRpForUpdate(this.data.id)
-  //   }
-  // },
+  customQuery(){
+    if (this.data.formMode == Constants.formMode.other) {
+      this.getRpForUpdate(this.data.id)
+    }
+  },
 })

+ 1 - 1
package-purchase/pages/pur-receipt/detail/detail.json

@@ -1,4 +1,4 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText":"付款详情"
+  "navigationBarTitleText":"供应商付款详情"
 }

+ 1 - 1
package-purchase/pages/pur-receipt/detail/detail.wxml

@@ -4,7 +4,7 @@
 <!-- <import src="/utils/template.wxml" />
 <template is="myTemplate" /> -->
 
-<dk-form-bill type="sale" id="{{formName}}" routeObjName="{{routeObjName}}" cardList="{{cardList}}" titleCol="skuCode" descCol="skuModel" priceCol="priceStandard" quantityCol="itemQty" sumAmountCol="sumAmount"  
+<dk-form-bill type="sale" id="{{formName}}" routeObjName="{{routeObjName}}" cardList="{{cardList}}" titleCol="skuCode" descCol="skuModel" priceCol="priceStandard" quantityCol="itemQty" sumAmountCol="sumAmount"    amountTitle="应付金额" amountCol="payableResidue"
 objIdCol="supId" objTitle="supName"   objCol="supId" objLabel="{{$t['supName']}}" objType="supplier" cardList="{{cardList}}" discountStandardCol="saleDiscount" contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" saleStaffAndOrgFlag="{{false}}" bind:chooseData="chooseData" popType="sale" staff="staff" org="org" bind:changeNumberBlur="changeNumberBlur" bind:chooseObjTypeData="chooseObjTypeData" readonly="{{true}}" 
 saleStaffAndOrgFlag="{{false}}" 
 >

+ 31 - 2
package-purchase/pages/pur-receipt/pur-receipt.js

@@ -56,9 +56,38 @@ Page({
     routeObjName: 'supReceiptPayment',
     refreshByAdd: false,
     // 弹出按钮
-    buttonList: [],
+    buttonList: [
+      { name: 'invalid', title: mixins.$t("invaidOrder") },//作废 
+      { name: 'printedBill', title: mixins.$t("printedBill") }, //打印
+    ],
+  },
+ /**
+   * @desc :   作废
+   * @date : 2024年3月8日
+   * @author : 于继渤
+   */
+  invalid(e) {
+    let that = this
+    // 是否弹出询问框
+    Dialog.confirm({
+      message: mixins.$t('isInvalidDetail'),
+    }).then(() => {
+      that.setData({
+        loading:true
+      })
+      return this.excute(this.data.service, this.data.service.invalidSup + '/' + e.rpId, {}).then(res => {
+        if (res.data.code == 200) {
+          that.searchData()
+          wx.showToast({
+            title: mixins.$t('invalidSuccessfully'),
+            image: '/static/image/success.png',
+            duration: 1000
+          })
+        }
+      })
+    }).catch(() => {
+    })
   },
-
   /**
    * @desc : 设置查询参数
    * @date : 2024/2/1 15:49

+ 50 - 53
package-purchase/pages/purchase-order/purchase-order.js

@@ -16,34 +16,7 @@ Page({
    * 页面的初始数据 
    */
   data: {
-    popbuttonList: [{
-        name: 'transferToWarehouse',
-        title: mixins.$t('transferToWarehouse'), //转入库 
-        formMode: Constants.formMode.other,
-        other: {
-          idKey: 'purId'
-        },
-      }, {
-        name: 'editPur',
-        title: mixins.$t('edit'),
-      }, {
-        name: 'purchaseCancellation',
-        title: mixins.$t('purchaseCancellation'), //采购作废 
-      }, //title:mixins.$t('followUp') 
-      {
-
-        name: 'selectSourcePurchaseOrder',
-        title: mixins.$t('purReturnOutBound'), //采购退货
-        formMode: Constants.formMode.index,
-        formType: Constants.formMode.add,
-        idKey: 'purId',
-      },
-      {
-        name: 'printedBill',
-        title: mixins.$t('printedBill') //打印票据
-      },
-
-    ],
+    popbuttonList: [],
     // 弹出按钮
     buttonList: [{
       name: 'merge',
@@ -206,6 +179,7 @@ Page({
    * @author : 刘尧
    */
   loadInit(){
+    console.log('this.data.gradeCode', this.data.gradeCode);
     if (this.data.gradeCode == Constants.gradeCode.PRO) {
        const tagList = [{
         title: mixins.$t('all'), //"全部单据"
@@ -234,34 +208,57 @@ Page({
       }, ] //打印
     } else {
       // 0702
-      buttonList = [{
-          name: 'transferToWarehouse',
-          title: mixins.$t('transferToWarehouse'), //转入库 
-          formMode: Constants.formMode.other,
-          other: {
-            idKey: 'purId'
+      if (this.data.gradeCode == Constants.gradeCode.PRO) {
+        buttonList = [{
+            name: 'transferToWarehouse',
+            title: mixins.$t('transferToWarehouse'), //转入库 
+            formMode: Constants.formMode.other,
+            other: {
+              idKey: 'purId'
+            },
+          }, {
+            name: 'editPur',
+            title: mixins.$t('edit'),
+          }, {
+            name: 'purchaseCancellation',
+            title: mixins.$t('purchaseCancellation'), //采购作废 
+          }, //title:mixins.$t('followUp') 
+          {
+
+            name: 'selectSourcePurchaseOrder',
+            title: mixins.$t('purReturnOutBound'), //采购退货
+            formMode: Constants.formMode.index,
+            formType: Constants.formMode.add,
+            idKey: 'purId',
+          },
+          {
+            name: 'printedBill',
+            title: mixins.$t('printedBill') //打印票据
           },
-        }, {
-          name: 'editPur',
-          title: mixins.$t('edit'),
-        }, {
-          name: 'purchaseCancellation',
-          title: mixins.$t('purchaseCancellation'), //采购作废 
-        }, //title:mixins.$t('followUp') 
-        {
 
-          name: 'selectSourcePurchaseOrder',
-          title: mixins.$t('purReturnOutBound'), //采购退货
-          formMode: Constants.formMode.index,
-          formType: Constants.formMode.add,
-          idKey: 'purId',
-        },
-        {
-          name: 'printedBill',
-          title: mixins.$t('printedBill') //打印票据
-        },
+        ]
+      }else {
+          buttonList = [{
+            name: 'editPur',
+            title: mixins.$t('edit'),
+          }, {
+            name: 'purchaseCancellation',
+            title: mixins.$t('purchaseCancellation'), //采购作废 
+          }, //title:mixins.$t('followUp') 
+          {
 
-      ]
+            name: 'selectSourcePurchaseOrder',
+            title: mixins.$t('purReturnOutBound'), //采购退货
+            formMode: Constants.formMode.index,
+            formType: Constants.formMode.add,
+            idKey: 'purId',
+          },
+          {
+            name: 'printedBill',
+            title: mixins.$t('printedBill') //打印票据
+          },
+        ]
+      }
     }
     this.setData({
       // 弹出按钮