|
@@ -206,10 +206,10 @@
|
|
|
</view>
|
|
|
</u-modal>
|
|
|
</view>
|
|
|
- <view style='flex:1;' class='deductfreight' @click="deductPayment()" v-if="!payfreightCli">扣货款</view>
|
|
|
+ <view style='flex:1;' class='deductfreight' @click="deductPayment()" v-if="item.status=='待结算'">扣货款</view>
|
|
|
<view class="freightAlert-model">
|
|
|
<u-modal v-model="deductPaymentAlert" cancel-color="#AFB3BF" confirm-color="#22C572"
|
|
|
- :show-title="false" show-cancel-button=true @confirm="confirmeductPayment(item)">
|
|
|
+ :show-title="false" show-cancel-button=true @confirm="confirmeductPayment(item,0)">
|
|
|
<view class="freightAlert-warp payAlert">
|
|
|
<view class="freightAlert-row">
|
|
|
<view class="title">扣货款</view>
|
|
@@ -231,10 +231,10 @@
|
|
|
</view>
|
|
|
</u-modal>
|
|
|
</view>
|
|
|
- <view style='flex:1;' class='payfreight' @click="Payment()" v-if="!payfreightCli">付货款</view>
|
|
|
+ <view style='flex:1;' class='payfreight' @click="Payment()" v-if="item.status=='待结算'">付货款</view>
|
|
|
<view class="freightAlert-model">
|
|
|
<u-modal v-model="paymentAlert" cancel-color="#AFB3BF" confirm-color="#22C572" :show-title="false"
|
|
|
- show-cancel-button=true @confirm="confirmPayPayment(item)">
|
|
|
+ show-cancel-button=true @confirm="confirmeductPayment(item,1)">
|
|
|
<view class="freightAlert-warp payAlert">
|
|
|
<view class="freightAlert-row">
|
|
|
<view class="title">付货款</view>
|
|
@@ -286,7 +286,7 @@
|
|
|
</u-modal>
|
|
|
</view>
|
|
|
|
|
|
- <view @click='confirmpaygoods(item)' style='flex:2;' class='payfreight' v-if="payfreightCli">确认收货</view>
|
|
|
+ <view @click='confirmpaygoods(item)' style='flex:2;' class='payfreight' v-if="item.status!='待结算'">确认收货</view>
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
@@ -349,13 +349,12 @@
|
|
|
onReachBottom() { //上拉触底函数
|
|
|
},
|
|
|
methods: {
|
|
|
- confirmpaygoods(item) {debugger
|
|
|
+ confirmpaygoods(item) {
|
|
|
uni.navigateTo({
|
|
|
- url: '/pageA/freightTransport/confirmpaygoods?toINfo=' + JSON.stringify(item)
|
|
|
+ url: '/pageA/freightTransport/confirmpaygoods?toINfo=' + JSON.stringify(item)+'&id='+this.id
|
|
|
})
|
|
|
},
|
|
|
commit() {
|
|
|
- console.log(1111)
|
|
|
uni.navigateTo({
|
|
|
url: '/pageA/freightTransport/addpaygoods?id=' + this.id
|
|
|
})
|
|
@@ -441,10 +440,6 @@
|
|
|
console.log("付货款")
|
|
|
this.paymentAlert = true
|
|
|
},
|
|
|
- confirmPayPayment() {
|
|
|
- console.log("付货款提交")
|
|
|
- },
|
|
|
-
|
|
|
//判断输入值
|
|
|
checkVal(e, state, item) {
|
|
|
console.log(e)
|
|
@@ -478,28 +473,47 @@
|
|
|
closeModel() {
|
|
|
this.freightAlert = false;
|
|
|
this.payAlert = false;
|
|
|
- this.ductPaymentAlert = false;
|
|
|
+ this.deductPaymentAlert = false;
|
|
|
this.paymentAlert = false;
|
|
|
},
|
|
|
- confirmeductPayment(val) {
|
|
|
+ confirmPayPayment() {
|
|
|
+ console.log("付货款提交")
|
|
|
+ },
|
|
|
+ confirmeductPayment(val,type) {
|
|
|
console.log(val)
|
|
|
- val.goodsDeductionAmount = parseInt(this.ductPayment);
|
|
|
- this.$api.doRequest('post', 'freightReceivingDispatching/api/PaymentDeduction', val).then(
|
|
|
+ let _title = ''
|
|
|
+ let _title1 = ''
|
|
|
+ if(type==0){
|
|
|
+ _title = "扣款成功!"
|
|
|
+ _title1 = "扣款失败!"
|
|
|
+ }else{
|
|
|
+ _title = "付款成功!"
|
|
|
+ _title1 = "扣款失败!"
|
|
|
+ }
|
|
|
+
|
|
|
+ let that = this;
|
|
|
+ val.goodsDeductionAmount = parseInt(that.ductPayment);
|
|
|
+ val.money = 0
|
|
|
+ val.goodsEdPayable = parseInt(that.paymenMoney);
|
|
|
+ that.$api.doRequest('post', 'freightReceivingDispatching/api/PaymentDeduction', val).then(
|
|
|
res => {
|
|
|
if (res.data.code == 200) {
|
|
|
uni.showToast({
|
|
|
- title: "扣款成功!",
|
|
|
+ title:_title,
|
|
|
icon: 'none',
|
|
|
- duration: 2000
|
|
|
+ duration: 2000,
|
|
|
+ success() {
|
|
|
+ getDetail(that.id, that)
|
|
|
+ }
|
|
|
})
|
|
|
- location.reload()
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
- title: "扣款失败!",
|
|
|
+ title:_title1,
|
|
|
icon: 'none',
|
|
|
duration: 2000
|
|
|
})
|
|
|
- this.ductPayment = 0
|
|
|
+ that.ductPayment = 0
|
|
|
+ that.goodsEdPayable = 0
|
|
|
}
|
|
|
|
|
|
}).catch(res => {
|