qymljy 2 سال پیش
والد
کامیت
eedc55e94a

+ 1 - 1
src/HDrpManagement/cashcouponPay/component/detailed.vue

@@ -8,7 +8,7 @@
         <el-descriptions-item label="企业名称">{{ data.enterprisename?data.enterprisename:"--"}}</el-descriptions-item>
         <el-descriptions-item label="返利代金券">{{ data.rebate_billno?data.rebate_billno:"--" }}</el-descriptions-item>
         <el-descriptions-item label="返利金有效期">{{ data.rebate_enddate?data.rebate_enddate:"--" }}</el-descriptions-item>
-        <el-descriptions-item label="支出金额">{{ data.rebate_amount?data.rebate_amount:"--" }}</el-descriptions-item>
+        <el-descriptions-item label="支出金额">{{ data.amount?data.amount:"--" }}</el-descriptions-item>
         <el-descriptions-item label="备注">{{ data.remarks?data.remarks:"--" }}</el-descriptions-item>
         <el-descriptions-item :style="style(data.status)" label="状态">
           <sapn :style="colorStyle">{{ data.status?data.status:"--" }}</sapn>

+ 1 - 1
src/HDrpManagement/cashcouponPay/modules/detail.vue

@@ -69,7 +69,7 @@ export default {
         },
         {
           label:'支出金额',
-          value:this.mainData.rebate_amount
+          value:this.mainData.amount
         },
         {
           label:'备注',

+ 2 - 2
src/SDrpManagement/agentOrder/details/index.vue

@@ -24,7 +24,7 @@
         <default-info :mainData="mainData"></default-info>
       </div>
       <div slot="slot1">
-        <product-list :data="mainData" ref="prod" @qtyChange="queryMainData"></product-list>
+        <product-list :data="mainData" ref="prod" @qtyChange="queryMainData" @onSuccess="queryMainData"></product-list>
       </div>
       <div slot="slot2">
         <orderprogress ref="prod"></orderprogress>
@@ -161,7 +161,7 @@ export default {
         },
         {
           label:'合计金额',
-          value:this.mainData.amount,
+          value:this.mainData.defaultamount,
           style:function () {
             let style = {color:"#ff0000"}
             return style

+ 52 - 7
src/SDrpManagement/agentOrder/modules/edit.vue

@@ -41,10 +41,10 @@
             <p><small>本单金额:&nbsp;</small>{{tool.formatAmount(data.amount - rebateamount,2)}}</p>
           </div>
           <div v-if="(data.type === '标准订单' ||  data.type === '特殊订单') && isusedrebate === 1">
-            <el-checkbox v-model="checked" :true-label="1" :false-label="0">使用返利金</el-checkbox>
-            <div v-if="checked" class="flex-align-center">
-              <p class="inline-16"><b>返利金余额:{{tool.formatAmount(defaultData.rebatebalance,2)}}</b></p>
-              <el-input class="inline-16" size="mini" style="width:150px" v-model="rebateamount" @blur="useRebate" placeholder="输入使用金额"></el-input>
+            <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>
               <small>(返利金最高使用比例{{data.order_rebate_userate}})</small>
 <!--              <small>(返利金最高使用比例{{data.order_rebate_userate}},本单上限:{{tool.formatAmount(data.amount * data.order_rebate_userate / 100,2)}})</small>-->
             </div>
@@ -364,9 +364,9 @@ export default {
         this.$emit('onSuccess')
       })
     },
-    async useRebate () {
+    async useRebate (e) {
       let that = this
-      if (this.rebateamount > this.defaultData.rebatebalance ||this.rebateamount > (this.data.amount * this.data.order_rebate_userate / 100) ) return  this.$message({
+      /*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
@@ -388,7 +388,31 @@ export default {
       if (res.code === 0) this.$message({
         message:`使用返利金失败!${res.msg}`,
         type:'error'
-      })
+      })*/
+
+      /* 修改返利金 */
+        let rebatebalance = 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
+              }
+            })
+      if(res.data=='成功'){
+        if(rebatebalance>amount){
+          this.data.rebatebalance=amount
+          this.$message({
+            message: '返利金最大可用值'+ amount,
+            type: 'warning'
+          });
+        }
+      }else{
+        this.$message.error(res.msg);
+      }
+
     },
     // 查询站点是否使用返利金
     async queryUsedrebate () {
@@ -416,6 +440,27 @@ export default {
     async selectOptions () {
       const res = await this.$store.dispatch('optiontypeselect','saletype')
       this.saleroptions = res.data
+    },
+    async rebateUsedChange(){
+      console.log(this.data)
+
+
+      if(this.data.status != '新建') return 1
+
+
+      let amount = parseInt(this.data.order_rebate_userate * this.data.defaultamount); //最大可用金额
+      let rebatebalance = this.data.rebatebalance; //返利金账户余额
+      const res = await this.$api.requested({
+        "id": 20230218225002,
+        "content": {
+          "sa_orderid": this.data.sa_orderid, //订单金额
+          "isused": this.data.rebate_used == 1 ? 0 : 1, //是否使用
+          "rebateamount": rebatebalance > amount ? amount : rebatebalance //返利金使用金额
+        }
+      })
+      console.log(res)
+      this.data.rebate_used = res.msg !== '成功' ? this.data.rebate_used == 0?1:0:this.data.rebate_used
+
     }
   },
 }

+ 12 - 4
src/SDrpManagement/agentOrder/modules/productlist.vue

@@ -101,21 +101,28 @@
         label="价格"
         width="90">
         <template slot-scope="scope">
-          <p style="color:red;font-weight:500">¥&nbsp;{{tool.formatAmount(scope.row.price,2)}}</p>
+          <p style="color:red;font-weight:500">¥&nbsp;{{tool.formatAmount(scope.row.defaultprice,2)}}</p>
         </template>
       </el-table-column>
       <el-table-column
-        label="折后价"
+        label="折后价"
         prop="totalprice">
         <template slot-scope="scope">
-          <p style="color:red;font-weight:500">¥&nbsp;{{scope.row.price}}</p>
+          <p style="color:red;font-weight:500">¥&nbsp;{{Math.round(scope.row.price * 100)/100}}</p>
         </template>
       </el-table-column>
       <el-table-column
         label="小计"
         width="150">
         <template slot-scope="scope">
-          <p style="color:red;font-weight:500">¥&nbsp;{{tool.formatAmount(scope.row.price * scope.row.qty,2)}}</p>
+          <p style="color:red;font-weight:500">¥&nbsp;{{scope.row.defaultamount}}</p>
+        </template>
+      </el-table-column>
+      <el-table-column
+          label="折后总价"
+          width="150">
+        <template slot-scope="scope">
+          <p style="color:red;font-weight:500">¥&nbsp;{{scope.row.amount}}</p>
         </template>
       </el-table-column>
       <el-table-column v-if="data.status === '新建'" width="90" fixed="right">
@@ -309,6 +316,7 @@ export default {
       this.tool.showMessage(res,()=>{
         this.setcol = 24
         this.listData()
+        this.$emit('onSuccess')
       })
     },
   },