zhangqiOMG 2 years ago
parent
commit
33e5cece5a

+ 6 - 4
src/HDrpManagement/orderManage/details/index.vue

@@ -15,7 +15,8 @@
         @pageChange="pageChange"
         @onEditSuccess="queryMainData($route.query.id)">
         <div slot="customOperation" class="inline-16" v-if="Object.keys(mainData).length > 0">
-          <Edit class="inline-16" v-if="tool.checkAuth($route.name,'update') && (mainData.status == '新建' || mainData.status == '提交')" :data="mainData" @onSuccess="queryMainData();$refs.prod && $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()" />
+          <EditRemark :data="mainData" @onSuccess="queryMainData"></EditRemark>
           <changeSaler class="inline-16" ref="saler" @selectRow="salerChange">
             <el-button v-if="tool.checkAuth($route.name,'changeSaler')" type="primary" slot="input" size="mini" @click="$refs.saler.visible=true;$refs.saler.listData()">变更业务员</el-button>
           </changeSaler>
@@ -115,6 +116,7 @@ import writeOff from './tabs/writeoff.vue'
 import erpHistory from './tabs/erpHistory.vue'
 import changeHistory from './tabs/changeHistory.vue'
 import importFile from './importFile.vue'
+import EditRemark from '../modules/EditRemark.vue'
 export default {
   name: "detail",
   data() {
@@ -151,7 +153,8 @@ export default {
     writeOff,
     erpHistory,
     changeHistory,
-    importFile
+    importFile,
+    EditRemark
   },
   methods:{
     async orderreviewtype () {
@@ -169,7 +172,6 @@ export default {
           }
         })
         this.mainData = res.data
-        console.log(this.mainData,'楚大');
         
         this.changeDataStructure()
         this.orderreviewtype()
@@ -276,7 +278,7 @@ export default {
         },
         {
           label:'销售分类',
-          value:this.mainData.saletype + '--' + this.mainData.saletyperemarks
+          value:`${this.mainData.saletype}${this.mainData.saletyperemarks?'-':''}${this.mainData.saletyperemarks}`
         },
         {
           label:'备注',

+ 2 - 2
src/HDrpManagement/orderManage/details/tabs/productlist.vue

@@ -270,8 +270,8 @@
           width="300"
           prop="remarks">
           <template slot-scope="scope">
-            <el-input v-if="data.status === '新建'" v-model="scope.row.remarks" placeholder="输入订单备注" size="mini" @change="rowChange(scope.row,scope.$index)"></el-input>
-            <p v-else>{{scope.row.remarks}}</p>
+            <el-input v-model="scope.row.remarks" placeholder="输入订单备注" size="mini" @change="rowChange(scope.row,scope.$index)"></el-input>
+            <!-- <p v-else>{{scope.row.remarks}}</p> -->
           </template>
         </el-table-column>
         <el-table-column v-if="data.status === '新建'" width="90" fixed="right">

+ 75 - 0
src/HDrpManagement/orderManage/modules/EditRemark.vue

@@ -0,0 +1,75 @@
+<template>
+  <div class="inline-16">
+    <el-button v-if="data.status !== '新建' && data.status !== '关闭'" type="primary" size="mini" @click="onShow">修改备注</el-button>
+    <el-dialog title="修改备注信息" :visible.sync="dialogFormVisible" append-to-body width="500px">
+      <el-form :model="form" size="small">
+        <el-form-item label="营销类别" :label-width="formLabelWidth">
+          <el-select v-model="form.saletype" size="small" placeholder="请选择">
+            <el-option
+              style="width:100%"
+              v-for="item in saleroptions"
+              :key="item.value"
+              :label="item.remarks"
+              :value="item.value">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="订单备注" :label-width="formLabelWidth">
+          <el-input type="textarea" :autosize="{minRows:4}" v-model="form.remarks" autocomplete="off"></el-input>
+        </el-form-item>
+        <el-form-item v-if="data.type === '标准订单' || data.type === '特殊订单'" label="项目备注" :label-width="formLabelWidth">
+          <el-input type="textarea" :autosize="{minRows:4}" v-model="form.projectnote" autocomplete="off"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormVisible = false" size="small">取 消</el-button>
+        <el-button type="primary" @click="onSubmit()" size="small">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  props:['data'],
+  data () {
+    return {
+      formLabelWidth:'80px',
+      dialogFormVisible:false,
+      saletype:'',
+      form:{},
+      saleroptions:[]
+    }
+  },
+  methods:{
+    onShow () {
+      this.form = Object.assign({},this.form,this.data)
+      this.dialogFormVisible = true
+      this.selectOptions()
+    },
+    async selectOptions () {
+      const res = await this.$store.dispatch('optiontypeselect','saletype')
+      this.saleroptions = res.data
+    },
+    async onSubmit() {
+      const res = await this.$api.requested({
+        "id": 20230301152702,
+        "content": {
+          "sa_orderid": this.data.sa_orderid,
+          "projectnote": this.form.projectnote,
+          "remarks":this.form.remarks,
+          "saletype":this.form.saletype
+        },
+
+      })
+      this.tool.showMessage(res,()=>{
+        this.$emit('onSuccess')
+        this.dialogFormVisible = false
+      })
+    },
+  }
+}
+
+</script>
+<style>
+</style>

+ 10 - 9
src/HDrpManagement/orderManage/modules/edit.vue

@@ -327,7 +327,7 @@ export default {
     async rebateUsedChange(){
       console.log(this.data)
       if(this.data.status != '新建') return 1
-      let amount = parseInt(this.data.order_rebate_userate * this.data.defaultamount); //最大可用金额
+      let amount = this.data.order_rebate_userate * this.data.defaultamount; //最大可用金额
       let rebatebalance = this.data.rebatebalance; //返利金账户余额
       const res = await this.$api.requested({
         "id": 20230218225002,
@@ -339,6 +339,7 @@ export default {
       })
       console.log(res)
       this.data.rebate_used = res.msg !== '成功' ? this.data.rebate_used == 0?1:0:this.data.rebate_used
+      res.msg === '成功' ?this.data.rebateamount = res.data:''
     },
     onShow () {
       this.initPage()
@@ -433,14 +434,14 @@ export default {
       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":rebateamount>amount?amount:rebateamount
-              }
-            })
-      if(res.data=='成功'){
+        "id":20230218225002,
+        "content":{
+          "sa_orderid":this.data.sa_orderid,//订单金额
+          "isused":1,//是否使用
+          "rebateamount":rebateamount>amount?amount:rebateamount
+        }
+      })
+      if(res.msg=='成功'){
         this.$emit('onSuccess')
         this.initPage()
         if(rebateamount>amount){

+ 1 - 1
src/SDrpManagement/agentOrder/modules/edit.vue

@@ -476,7 +476,7 @@ export default {
       if(this.data.status != '新建') return 1
 
 
-      let amount = parseInt(this.data.order_rebate_userate * this.data.defaultamount); //最大可用金额
+      let amount = this.data.order_rebate_userate * this.data.defaultamount; //最大可用金额
       let rebatebalance = this.data.rebatebalance; //返利金账户余额
       const res = await this.$api.requested({
         "id": 20230218225002,

+ 1 - 1
src/SDrpManagement/salerOrder/modules/edit.vue

@@ -299,7 +299,7 @@ export default {
     async rebateUsedChange(){
       console.log(this.data)
       if(this.data.status != '新建') return 1
-      let amount = parseInt(this.data.order_rebate_userate * this.data.defaultamount); //最大可用金额
+      let amount = this.data.order_rebate_userate * this.data.defaultamount; //最大可用金额
       let rebatebalance = this.data.rebatebalance; //返利金账户余额
       const res = await this.$api.requested({
         "id": 20230218225002,