qymljy 2 yıl önce
ebeveyn
işleme
c82c24c02f
1 değiştirilmiş dosya ile 6 ekleme ve 30 silme
  1. 6 30
      src/SDrpManagement/agentOrder/modules/edit.vue

+ 6 - 30
src/SDrpManagement/agentOrder/modules/edit.vue

@@ -43,8 +43,8 @@
           <div v-if="(data.type === '标准订单' ||  data.type === '特殊订单') && isusedrebate === 1">
             <el-checkbox v-model="data.rebate_used" :true-label="1" :false-label="0" @change="rebateUsedChange">使用返利金</el-checkbox>
             <div v-if="data.rebate_used" class="flex-align-center">
-              <p class="inline-16"><b>返利金余额:{{tool.formatAmount(data.rebateamount,2)}}</b></p>
-              <el-input class="inline-16" size="mini" style="width:150px" v-model="data.rebatebalance" @blur="useRebate(data.rebatebalance)" placeholder="输入使用金额"></el-input>
+              <p class="inline-16"><b>返利金余额:{{tool.formatAmount(data.rebatebalance,2)}}</b></p>
+              <el-input class="inline-16" size="mini" style="width:150px" v-model="data.rebateamount" @blur="useRebate(data.rebateamount)" placeholder="输入使用金额"></el-input>
               <small>(返利金最高使用比例{{data.order_rebate_userate}})</small>
 <!--              <small>(返利金最高使用比例{{data.order_rebate_userate}},本单上限:{{tool.formatAmount(data.amount * data.order_rebate_userate / 100,2)}})</small>-->
             </div>
@@ -377,44 +377,20 @@ export default {
     },
     async useRebate (e) {
       let that = this
-      /*if (this.rebateamount > this.defaultData.rebatebalance ||this.rebateamount > (this.data.amount * this.data.order_rebate_userate ) ) return  this.$message({
-        message:`余额不足或已超过可用上限!`,
-        type:function () {
-          that.rebateamount = 0
-          return 'error'
-        }()
-      })
-      if (this.rebateamount == null) return this.$message({
-          message:"返利金不能为空",
-          type:'error'
-        })
-      const res = await this.$api.requested({
-        "id": 20230218225002,
-        "content": {
-          "sa_orderid": this.data.sa_orderid, //订单金额
-          "isused": this.checked, //是否使用
-          "rebateamount": this.rebateamount //返利金使用金额
-        },
-      })
-      if (res.code === 0) this.$message({
-        message:`使用返利金失败!${res.msg}`,
-        type:'error'
-      })*/
-
       /* 修改返利金 */
-        let rebatebalance = e;
+        let rebateamount = e;
         let amount = this.data.order_rebate_userate * this.data.defaultamount;//最大可用金额
       const res = await this.$api.requested({
               "id":20230218225002,
               "content":{
                 "sa_orderid":this.data.sa_orderid,//订单金额
                 "isused":1,//是否使用
-                "rebateamount":rebatebalance>amount?amount:rebatebalance
+                "rebateamount":rebateamount>amount?amount:rebateamount
               }
             })
       if(res.data=='成功'){
-        if(rebatebalance>amount){
-          this.data.rebatebalance=amount
+        if(rebateamount>amount){
+          this.data.rebateamount=amount
           this.$message({
             message: '返利金最大可用值'+ amount,
             type: 'warning'