diff --git a/pages/index/waitStorageDetail.vue b/pages/index/waitStorageDetail.vue index c2fdca4..65131fe 100644 --- a/pages/index/waitStorageDetail.vue +++ b/pages/index/waitStorageDetail.vue @@ -65,7 +65,18 @@ - + + + + 供应商:{{dealings.dealingsUserName?dealings.dealingsUserName:''}} + + + 之前欠款:{{dealings.lastDebtAmount}} + + + 客户余额:{{Math.abs(dealings.lastDebtAmount)}} + + 应付金额 @@ -75,14 +86,41 @@ 已付金额 - + - - 欠款 - - - + + 余额抵扣 + + + + + + + 累计欠款 + + + + + + 累计余额 + + + + + + 本次欠款 + + + + + + 本次余额 + + + 其他费用 @@ -147,10 +185,14 @@ noPay:0, alreadyPay:0, otherPay:0, - remark:'', + remark:'', + zhiqianqiankuan:0, + yuedikou:0, + leijiqiankuan:0, id:'', type:'', - supplier:[], + supplier:[], + dealings:[], collection:[] } }, @@ -195,7 +237,9 @@ } res.result.purchaseDetails[i].lsPrice = res.result.purchaseDetails[i].lsPrice } - this.sales = res.result.purchase + this.zhiqianqiankuan = res.result.dealingsRecords[0].lastDebtAmount + this.sales = res.result.purchase + this.dealings = res.result.dealingsRecords[0] this.noPay = res.result.purchase.noPay this.supplier = res.result.supplier this.remark = res.result.purchase.remark @@ -206,9 +250,52 @@ } }).catch((res) => {}) }, - //计算欠款 - changePay() { - this.noPay = this.shouldPay - this.alreadyPay + //计算欠款 + changePay(e) { + if (this.linshiPrice == e.target.value) { + this.alreadyPay = e.target.value + } else if (Number(e.detail.value) > Number(this.shouldPay)) { + this.alreadyPay = this.shouldPay + } else { + if (e.target.value == '') { + this.alreadyPay = this.linshiPrice + } else { + this.alreadyPay = e.target.value + if((this.shouldPay - this.alreadyPay) <= Math.abs(this.zhiqianqiankuan) && this.zhiqianqiankuan <0){ + this.yuedikou = this.shouldPay - this.alreadyPay + }else if((this.shouldPay - this.alreadyPay) > Math.abs(this.zhiqianqiankuan) && this.zhiqianqiankuan <0){ + this.yuedikou = Math.abs(this.zhiqianqiankuan) + } + + } + } + this.noPay = this.shouldPay - this.alreadyPay - this.yuedikou + this.noPay = this.noPay.toFixed(2) + this.leijiqiankuan = Number(this.zhiqianqiankuan) + Number(this.yuedikou) + Number(this.noPay) + }, + obtainPrice(e, type, num,num1) { + this.linshiPrice = e.target.value + if (type == 'danjia') { + this.carList.get(num).purchasePrice = '' + } else if (type == 'pifa') { + this.carList.get(num).wholesalePrice = '' + } else if (type == 'lingshou') { + this.carList.get(num).lsprice = '' + this.$forceUpdate() + }else if(type=='danjishu'){ + this.temporaryList[num].productCount = '' + this.$forceUpdate() + } else if (type == 'zongjishu') { + this.allChangeNum = '' + } else if (type == 'shouldPay') { + this.shouldPay = '' + }else if(type=='mapdanjishu'){ + this.carList.get(num).stockLogList.get(num1).productCount = '' + this.$forceUpdate() + }else if (type == 'alreadyPay') { + this.alreadyPay = '' + } + this.$forceUpdate() }, //回款金额输入框 inputDialogToggle() { @@ -305,7 +392,8 @@ let purchase = { id:this.id, alreadyPay: this.alreadyPay, //已付金额 - noPay: this.noPay, //欠款 + noPay: this.noPay, //欠款 + balanceDeductionAmount:this.yuedikou, shouldPay: this.shouldPay, //应付金额 totalAmount: this.sales.totalAmount, //总数量 remark: this.remark, @@ -360,10 +448,25 @@ this.goodsList.forEach(function(value, key) { that.shouldPay = that.shouldPay + value.zPrice }) - that.shouldPay = that.shouldPay.toFixed(2) - this.alreadyPay = this.shouldPay - that.noPay = this.shouldPay - this.alreadyPay - this.$forceUpdate() + this.$nextTick(()=>{ + if(parseFloat(that.zhiqianqiankuan) < 0){ + if(that.shouldPay > Math.abs(that.zhiqianqiankuan)){ + that.yuedikou = Math.abs(that.zhiqianqiankuan) + this.alreadyPay = this.shouldPay - Math.abs(that.zhiqianqiankuan) + }else if(that.shouldPay <= Math.abs(that.zhiqianqiankuan)){ + that.yuedikou = that.shouldPay + that.alreadyPay = 0 + } + }else{ + this.alreadyPay = this.shouldPay + } + that.shouldPay = that.shouldPay.toFixed(2) + + that.noPay = this.shouldPay - (this.alreadyPay == '' ? 0 : this.alreadyPay) - that.yuedikou + that.noPay = that.noPay.toFixed(2) + this.leijiqiankuan = Number(this.zhiqianqiankuan) + Number(this.yuedikou) + Number(this.noPay) + this.$forceUpdate() + }) }, }, } @@ -622,4 +725,19 @@ .uni-tooltip { display: flex !important; } + .price-box{ + width: 95%; + margin: 10px auto; + background: #eee; + height: 80rpx; + display: flex; + line-height: 80rpx; + text-align: center; + overflow: hidden; + border-radius: 10px; + background: #FDF5E6; + color: #EEB422; + background: linear-gradient(180deg, #fff, #FDF5E6); + border: 1px solid #FAEBD7; + } \ No newline at end of file diff --git a/pages/inventory/goodsList1.vue b/pages/inventory/goodsList1.vue index aa1e0d2..8538fe5 100644 --- a/pages/inventory/goodsList1.vue +++ b/pages/inventory/goodsList1.vue @@ -3086,9 +3086,8 @@ if(value.id == ''){ specMap.set(generateUUID(),value) }else{ - specMap.set(value.id,value) + specMap.set(value.productId?value.productId:value.id,value) } - }else{ specMap.set(key,value) }