codeMan 2 роки тому
батько
коміт
ada206e10a

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

@@ -15,7 +15,7 @@
         @pageChange="pageChange"
         @onEditSuccess="queryMainData($route.query.id)">
         <div slot="customOperation" class="inline-16">
-          <Edit class="inline-16" v-if="tool.checkAuth($route.name,'update') && mainData.status == '新建'" :data="mainData" @onSuccess="queryMainData();$refs.prod.listData()" />
+          <Edit class="inline-16" v-if="tool.checkAuth($route.name,'update') && mainData.status == '新建'" :data="mainData" @onSuccess="queryMainData();$refs.prod && $refs.prod.listData()" />
           <el-button :disabled="mainData.status !== '交期待确认'"  type="primary" size="mini" @click="confirmdate">确认交期</el-button>
           <el-button v-if="tool.checkAuth($route.name,'submit')" :disabled="mainData.status !== '新建'"  type="primary" size="mini" @click="onSubmit('提交')">提 交</el-button>
           <el-button v-if="tool.checkAuth($route.name,'insert')"  type="primary" size="mini" @click="onCopy">复 制</el-button>
@@ -98,6 +98,7 @@ export default {
         const res = await this.$api.requested({
           "id":'20221108151302',
           "content": {
+            "nocache":true,
             "sa_orderid": this.$route.query.id
           }
         })

+ 5 - 1
src/SDrpManagement/agentOrder/index.vue

@@ -10,7 +10,8 @@
       :oldFormPath="{add:'SDrpManagement/agentOrder/modules'}"
       :detailPath="{
         path:'/agent_orderDetails'
-      }">
+      }"
+      @listCreate="list">
       <div slot="custom" style="display:flex">
         <div class="label_center">
           <p class="search__label">订单状态:</p>
@@ -71,6 +72,9 @@ export default {
     }
   },
   methods:{
+    list (param) {
+      param.content.nocache = true
+    }
   }
 }
 

+ 11 - 5
src/SDrpManagement/agentOrder/modules/edit.vue

@@ -9,7 +9,7 @@
     size="80%">
     <div slot="title">
       <div class="flex-align-center">
-        <p ><span style="font-size:14px">订单合计:</span><span style="color:red;font-size:16px;"><b>¥&nbsp;{{tool.formatAmount(data.amount,2)}}</b></span></p>
+        <p ><span style="font-size:14px">订单合计:</span><span style="color:red;font-size:16px;"><b>¥&nbsp;{{tool.formatAmount(data.defaultamount,2)}}</b></span></p>
         <!-- <label style="font-size:14px;margin-left:10px" for="">备注:</label>
         <input class="order__note__input" v-model="defaultData.remarks" type="text" placeholder="请输入订单备注"> -->
 <!--        <p>运费:{{data.amount > data.freefreightamount >= 0?'当前订单免运费':`订单满${data.freefreightamount}元免运费,当前还差${data.freefreightamount - data.amount}元`}}</p>-->
@@ -38,7 +38,7 @@
           <div class="flex-align-center">
             <p class="inline-16"><small>账户余额:&nbsp;</small><b>¥{{tool.formatAmount(defaultData.accountclass.balance?defaultData.accountclass.balance:0,2)}}</b></p>
             <p class="inline-16"><small>账户名称:&nbsp;</small>{{defaultData.accountclass.accountname?defaultData.accountclass.accountname:'未选择账户'}}</p>
-            <p><small>本单金额:&nbsp;</small>{{tool.formatAmount(data.amount - rebateamount,2)}}</p>
+            <p><small>本单金额:&nbsp;</small>{{data.rebate_used ? tool.formatAmount(data.defaultamount - rebateamount,2) : data.defaultamount}}</p>
           </div>
           <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>
@@ -278,7 +278,11 @@ export default {
       this.selectOptions()
 
       this.checked = this.data.rebate_used
-      this.rebateamount = this.data.rebateamount
+      if (this.data.rebateamount > this.data.defaultamount) {
+        this.rebateamount = this.tool.formatAmount(+this.data.defaultamount / 2)
+      } else {
+        this.rebateamount = this.data.rebateamount
+      }
     },
     // 收货信息:合作企业联系人
     async receiveAddress (fn) {
@@ -330,7 +334,7 @@ export default {
           "pay_enterpriseid":this.data.pay_enterpriseid,
           "tradefield":this.data.tradefield,
           "saletype":this.saletype,
-          "rebate_used":this.checked,//默认0,是否使用返利金
+          "rebate_used":this.data.rebate_used,//默认0,是否使用返利金
           "signbacknum":'',
           "sa_promotionid":this.data.sa_promotionid,
           "billdate":this.data.billdate
@@ -339,7 +343,7 @@ export default {
       this.tool.showMessage(res,()=>{
         this.$emit('onSuccess')
         if (this.data.type === '标准订单' ||  this.data.type === '特殊订单') {
-          this.isusedrebate === 1?this.useRebate():""
+          this.isusedrebate === 1?this.useRebate(this.data.rebateamount):""
         }
         this.drawer = false
       })
@@ -389,6 +393,8 @@ export default {
               }
             })
       if(res.data=='成功'){
+        this.$emit('onSuccess')
+        this.initPage()
         if(rebateamount>amount){
           this.data.rebateamount=amount
           this.$message({

+ 26 - 36
src/SDrpManagement/agentOrder/modules/productlist.vue

@@ -46,25 +46,32 @@
       </el-table-column>
       
       <el-table-column
-        prop="price"
-        label="价"
+        prop="defaultprice"
+        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="金额"
+        width="150">
+        <template slot-scope="scope">
+          <p style="color:red;font-weight:500">¥&nbsp;{{scope.row.defaultamount}}</p>
         </template>
       </el-table-column>
       <el-table-column
-        label="折后价格"
-        prop="totalprice">
+        label="折后价"
+        prop="price">
         <template slot-scope="scope">
           <p style="color:red;font-weight:500">¥&nbsp;{{scope.row.price}}</p>
         </template>
       </el-table-column>
       <el-table-column
-        label="小计"
+        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.amount}}</p>
         </template>
       </el-table-column>
       <el-table-column
@@ -119,36 +126,17 @@
           <el-tag size="mini" type="info" effect="plain">{{scope.row.unit}}</el-tag>
         </template>
       </el-table-column>
+     
       <el-table-column
-        prop="price"
-        label="价格"
-        width="90">
+        prop="remarks"
+        label="备注"
+        width="300"
+        fixed="right">
         <template slot-scope="scope">
-          <p style="color:red;font-weight:500">¥&nbsp;{{tool.formatAmount(scope.row.defaultprice,2)}}</p>
+          <el-input type="textarea"  @blur="onConfirm([scope.row],true)" size="small" v-model="scope.row.remarks" placeholder="请输入备注"></el-input>
         </template>
       </el-table-column>
-      <el-table-column
-        label="折后单价"
-        prop="totalprice">
-        <template slot-scope="scope">
-          <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;{{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">
+       <el-table-column v-if="data.status === '新建'" width="90" fixed="right">
         <template slot-scope="scope">
           <el-button type="text" size="mini" @click="deleteOrderProduct(scope.row)">删 除</el-button>
         </template>
@@ -209,6 +197,7 @@ export default {
     addProduct
   },
   methods:{
+
     async listData () {
       this.param.content.sa_orderid = this.$route.query.id
       const res = await this.$api.requested(this.param)
@@ -319,7 +308,7 @@ export default {
       }
     },
     // 订单添加商品
-    async onConfirm (data) {
+    async onConfirm (data,edit) {
       const res = await this.$api.requested({
         "id": 20221109093602,
         "content": {
@@ -328,10 +317,11 @@ export default {
           "type": this.data.type, //订单类型
           "items": data.map(e=>{
             return {
-              sa_orderitemsid:0,
+              sa_orderitemsid:edit?e.sa_orderitemsid : 0,
               itemid:e.itemid,
               qty:e.orderminqty,
-              needdate:e.deliverydate
+              needdate:e.deliverydate,
+              remarks:e.remarks
             }
           })
         },