|  | @@ -57,18 +57,17 @@
 | 
	
		
			
				|  |  |        <trade-card title="商品信息" v-loading="loadingBtn">
 | 
	
		
			
				|  |  |          <avue-form ref="option2form" class="trading-form" v-model="form" :option="option2">
 | 
	
		
			
				|  |  |            <template slot="thisUsedProfit">
 | 
	
		
			
				|  |  | -            <el-input-number v-model="form.thisUsedProfit" :disabled="detailData.status == 1"
 | 
	
		
			
				|  |  | +            <el-input-number v-model="form.thisUsedProfit" :disabled="detailData.status == 1 || mebertype"
 | 
	
		
			
				|  |  |                placeholder="请输入" size="small" :controls="false" style="width:100%;"
 | 
	
		
			
				|  |  |                               @change="thisUsedchange" ></el-input-number>
 | 
	
		
			
				|  |  |                <!--@change="amountChange"-->
 | 
	
		
			
				|  |  |            </template>
 | 
	
		
			
				|  |  |              <template slot="memberBalance">
 | 
	
		
			
				|  |  | -                <el-input-number v-model="form.memberBalance" :disabled="form.debitAmount == form.settlmentAmount && mebertype"
 | 
	
		
			
				|  |  | -                                 placeholder="请输入" size="small" :controls="false"
 | 
	
		
			
				|  |  | -                                 @change="memberchange"></el-input-number>
 | 
	
		
			
				|  |  | -                <span style="margin-left: 10px;border: 1px solid #E4E7ED;padding: 6px;border-radius: 4px">
 | 
	
		
			
				|  |  | -                    余额:{{balanceAmounts}}
 | 
	
		
			
				|  |  | -                </span>
 | 
	
		
			
				|  |  | +                <el-input-number v-model="form.memberBalance" disabled style="width: 100%"
 | 
	
		
			
				|  |  | +                                 placeholder="请输入" size="small" :controls="false"></el-input-number>
 | 
	
		
			
				|  |  | +                <!--<span style="margin-left: 10px;border: 1px solid #E4E7ED;padding: 6px;border-radius: 4px">-->
 | 
	
		
			
				|  |  | +                <!--    余额:{{balanceAmounts}}-->
 | 
	
		
			
				|  |  | +                <!--</span>-->
 | 
	
		
			
				|  |  |              </template>
 | 
	
		
			
				|  |  |          </avue-form>
 | 
	
		
			
				|  |  |          <avue-crud ref="crud" :option="optionList" :data="data" :table-loading="loading" @saveColumn="saveColumn"
 | 
	
	
		
			
				|  | @@ -162,15 +161,26 @@
 | 
	
		
			
				|  |  |            width="35%"
 | 
	
		
			
				|  |  |            :before-close="paymentClose">
 | 
	
		
			
				|  |  |            <div>
 | 
	
		
			
				|  |  | -              <div>本次收款需要支付金额为{{form.currentAmount}}</div>
 | 
	
		
			
				|  |  | +              <div style="font-size: 16px">订单金额为{{zhifdingdan}}</div>
 | 
	
		
			
				|  |  |                <div style="display: flex;align-items: center;margin-top: 20px">
 | 
	
		
			
				|  |  | -                  <div style="margin-right: 10px">支付金额:</div>
 | 
	
		
			
				|  |  | +                  <div style="margin-right: 10px;width: 90px;text-align: right">会员卡金额:</div>
 | 
	
		
			
				|  |  | +                  <div style="display: flex">
 | 
	
		
			
				|  |  | +                      <el-input style="width: 200px;" v-model="form.memberAmout" size="small" placeholder="请输入会员卡金额"
 | 
	
		
			
				|  |  | +                                @change="memberchange"></el-input>
 | 
	
		
			
				|  |  | +                      <span style="margin-left: 10px;border: 1px solid #E4E7ED;padding: 6px;border-radius: 4px">
 | 
	
		
			
				|  |  | +                          余额:{{balanceAmounts}}
 | 
	
		
			
				|  |  | +                      </span>
 | 
	
		
			
				|  |  | +                  </div>
 | 
	
		
			
				|  |  | +              </div>
 | 
	
		
			
				|  |  | +              <div style="display: flex;align-items: center;margin-top: 20px">
 | 
	
		
			
				|  |  | +                  <div style="margin-right: 10px;width: 90px;text-align: right">收款金额:</div>
 | 
	
		
			
				|  |  |                    <div>
 | 
	
		
			
				|  |  | -                      <el-input v-model="form.currentAmount" placeholder="请输入支付金额"></el-input>
 | 
	
		
			
				|  |  | +                      <el-input style="width: 200px;" v-model="form.currentAmount" size="small" placeholder="请输入支付金额"
 | 
	
		
			
				|  |  | +                       ></el-input>
 | 
	
		
			
				|  |  |                    </div>
 | 
	
		
			
				|  |  |                </div>
 | 
	
		
			
				|  |  |                <div style="display: flex;align-items: center;margin-top: 20px">
 | 
	
		
			
				|  |  | -                  <div style="margin-right: 10px">支付账户:</div>
 | 
	
		
			
				|  |  | +                  <div style="margin-right: 10px;width: 90px;text-align: right">账户:</div>
 | 
	
		
			
				|  |  |                    <div>
 | 
	
		
			
				|  |  |                        <el-select v-model="form.account" size="small" placeholder="请选择">
 | 
	
		
			
				|  |  |                            <el-option
 | 
	
	
		
			
				|  | @@ -183,7 +193,7 @@
 | 
	
		
			
				|  |  |                    </div>
 | 
	
		
			
				|  |  |                </div>
 | 
	
		
			
				|  |  |            </div>
 | 
	
		
			
				|  |  | -          <span slot="footer" class="dialog-footer">
 | 
	
		
			
				|  |  | +          <span slot="footer" style="text-align: left" class="dialog-footer">
 | 
	
		
			
				|  |  |                <el-button @click="paymentVisible = false">取 消</el-button>
 | 
	
		
			
				|  |  |                <el-button type="primary" @click="querenfun">确 定</el-button>
 | 
	
		
			
				|  |  |            </span>
 | 
	
	
		
			
				|  | @@ -373,17 +383,17 @@ export default {
 | 
	
		
			
				|  |  |              prop: "thisUsedProfit",
 | 
	
		
			
				|  |  |              span: 4,
 | 
	
		
			
				|  |  |            },
 | 
	
		
			
				|  |  | -            {
 | 
	
		
			
				|  |  | -                label: "会员卡金额",
 | 
	
		
			
				|  |  | -                prop: "memberBalance",
 | 
	
		
			
				|  |  | -                span: 8,
 | 
	
		
			
				|  |  | -            },
 | 
	
		
			
				|  |  |            {
 | 
	
		
			
				|  |  |              label: "应收金额",
 | 
	
		
			
				|  |  |              prop: "debitAmount",
 | 
	
		
			
				|  |  |              disabled: true,
 | 
	
		
			
				|  |  |              span: 8,
 | 
	
		
			
				|  |  |            },
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                label: "会员卡金额",
 | 
	
		
			
				|  |  | +                prop: "memberBalance",s
 | 
	
		
			
				|  |  | +                span: 8,
 | 
	
		
			
				|  |  | +            },
 | 
	
		
			
				|  |  |            {
 | 
	
		
			
				|  |  |              label: "成本",
 | 
	
		
			
				|  |  |              prop: "costAmount",
 | 
	
	
		
			
				|  | @@ -529,6 +539,8 @@ export default {
 | 
	
		
			
				|  |  |        storageoptions: [],
 | 
	
		
			
				|  |  |          // 会员卡余额
 | 
	
		
			
				|  |  |          balanceAmounts:0,
 | 
	
		
			
				|  |  | +        // 付款弹窗的支付订单
 | 
	
		
			
				|  |  | +        zhifdingdan:0
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |    },
 | 
	
	
		
			
				|  | @@ -577,7 +589,7 @@ export default {
 | 
	
		
			
				|  |  |        // },
 | 
	
		
			
				|  |  |        // 优惠金额的监听
 | 
	
		
			
				|  |  |        thisUsedchange(){
 | 
	
		
			
				|  |  | -          this.form.memberBalance = this.form.memberBalance?this.form.memberBalance:0
 | 
	
		
			
				|  |  | +          // this.form.memberBalance = this.form.memberBalance?this.form.memberBalance:0
 | 
	
		
			
				|  |  |            if(Number(this.form.thisUsedProfit) < 0) {
 | 
	
		
			
				|  |  |                this.$nextTick(()=>{
 | 
	
		
			
				|  |  |                    this.form.thisUsedProfit = 0
 | 
	
	
		
			
				|  | @@ -586,15 +598,16 @@ export default {
 | 
	
		
			
				|  |  |            if (Number(this.form.thisUsedProfit) > Number(this.form.orderAmount)) {
 | 
	
		
			
				|  |  |                this.$nextTick(()=>{
 | 
	
		
			
				|  |  |                    this.form.thisUsedProfit = Number(this.form.orderAmount)
 | 
	
		
			
				|  |  | -                  this.form.memberBalance = 0
 | 
	
		
			
				|  |  | +                  // this.form.memberBalance = 0
 | 
	
		
			
				|  |  |                    this.form.currentAmount = 0
 | 
	
		
			
				|  |  |                })
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  | -          let sum = Number(this.form.orderAmount) - Number(this.form.memberBalance)
 | 
	
		
			
				|  |  | +          // let sum = Number(this.form.orderAmount) - Number(this.form.memberBalance)
 | 
	
		
			
				|  |  | +          let sum = Number(this.form.orderAmount)
 | 
	
		
			
				|  |  |            if (Number(this.form.thisUsedProfit) > sum){
 | 
	
		
			
				|  |  |                this.$nextTick(()=>{
 | 
	
		
			
				|  |  |                    console.log(this.form.thisUsedProfit)
 | 
	
		
			
				|  |  | -                  this.form.thisUsedProfit = sum
 | 
	
		
			
				|  |  | +                  // this.form.thisUsedProfit = sum
 | 
	
		
			
				|  |  |                    this.form.currentAmount = 0
 | 
	
		
			
				|  |  |                })
 | 
	
		
			
				|  |  |            }
 | 
	
	
		
			
				|  | @@ -614,25 +627,26 @@ export default {
 | 
	
		
			
				|  |  |            // 用$nextTick函数对绑定值进行更改,
 | 
	
		
			
				|  |  |            // 即在dom初次完成渲染挂载后,修改其值再次触发dom渲染挂载。
 | 
	
		
			
				|  |  |            this.form.thisUsedProfit = this.form.thisUsedProfit?this.form.thisUsedProfit:0
 | 
	
		
			
				|  |  | -          if (this.form.memberBalance < 0) {
 | 
	
		
			
				|  |  | +          this.form.memberAmout = this.form.memberAmout?this.form.memberAmout:0
 | 
	
		
			
				|  |  | +          if (this.form.memberAmout < 0) {
 | 
	
		
			
				|  |  |                this.$nextTick(()=>{
 | 
	
		
			
				|  |  | -                  this.form.memberBalance = 0
 | 
	
		
			
				|  |  | +                  this.form.memberAmout = 0
 | 
	
		
			
				|  |  |                })
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  | -          if (this.form.memberBalance > Number(this.balanceAmounts)) {
 | 
	
		
			
				|  |  | +          if (this.form.memberAmout > Number(this.balanceAmounts)) {
 | 
	
		
			
				|  |  |                this.$nextTick(()=>{
 | 
	
		
			
				|  |  | -                  this.form.memberBalance = Number(this.balanceAmounts)
 | 
	
		
			
				|  |  | +                  this.form.memberAmout = Number(this.balanceAmounts)
 | 
	
		
			
				|  |  |                })
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |            let sum = Number(this.form.orderAmount) - Number(this.form.thisUsedProfit)
 | 
	
		
			
				|  |  | -          if (this.form.memberBalance > sum) {
 | 
	
		
			
				|  |  | +          if (this.form.memberAmout > sum) {
 | 
	
		
			
				|  |  |                this.$nextTick(()=>{
 | 
	
		
			
				|  |  | -                  this.form.memberBalance = sum
 | 
	
		
			
				|  |  | +                  this.form.memberAmout = sum
 | 
	
		
			
				|  |  |                })
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |            this.$nextTick(()=>{
 | 
	
		
			
				|  |  | -              console.log(sum - this.form.memberBalance)
 | 
	
		
			
				|  |  | -              this.form.currentAmount = sum - this.form.memberBalance
 | 
	
		
			
				|  |  | +              console.log(sum - this.form.memberAmout)
 | 
	
		
			
				|  |  | +              this.form.currentAmount = (sum - this.form.memberAmout).toFixed(2)
 | 
	
		
			
				|  |  |            })
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |        // 收款点击事件
 | 
	
	
		
			
				|  | @@ -659,15 +673,20 @@ export default {
 | 
	
		
			
				|  |  |            this.getWorkDicts("account").then(res => {
 | 
	
		
			
				|  |  |                this.accountdata = res.data.data;
 | 
	
		
			
				|  |  |            });
 | 
	
		
			
				|  |  | +          this.zhifdingdan = Number(this.form.debitAmount) - Number(this.form.settlmentAmount)
 | 
	
		
			
				|  |  | +          this.form.memberAmout = this.form.memberAmout?this.form.memberAmout:0
 | 
	
		
			
				|  |  |            this.paymentVisible = true
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |        // 收款弹窗的确认
 | 
	
		
			
				|  |  |        querenfun(){
 | 
	
		
			
				|  |  | -          if(this.this.form.currentAmount <= 0){
 | 
	
		
			
				|  |  | -              return this.$message.error('支付金额不能为零和负数');
 | 
	
		
			
				|  |  | +          if(this.form.currentAmount < 0){
 | 
	
		
			
				|  |  | +              return this.$message.error('支付金额不能负数');
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          if (this.form.memberAmout < 0) {
 | 
	
		
			
				|  |  | +              return this.$message.error('会员卡金额不能为负数');
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |            let balance = Number(this.form.debitAmount) - Number(this.form.settlmentAmount)
 | 
	
		
			
				|  |  | -          if(this.this.form.currentAmount > balance){
 | 
	
		
			
				|  |  | +          if(this.form.currentAmount > balance){
 | 
	
		
			
				|  |  |                return this.$message.error('支付金额不能大于未收金额');
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |            let form = {
 | 
	
	
		
			
				|  | @@ -993,7 +1012,7 @@ export default {
 | 
	
		
			
				|  |  |                this.data = res.data.data.orderItemsList;
 | 
	
		
			
				|  |  |                this.settlementList = res.data.data.settlementList;
 | 
	
		
			
				|  |  |                this.orderFilesList = res.data.data.orderFilesList ? res.data.data.orderFilesList : [];
 | 
	
		
			
				|  |  | -              this.$emit("goBack");
 | 
	
		
			
				|  |  | +              // this.$emit("goBack");
 | 
	
		
			
				|  |  |              })
 | 
	
		
			
				|  |  |              .finally(() => {
 | 
	
		
			
				|  |  |                this.loadingBtn = false;
 |