zhouhao 2 лет назад
Родитель
Сommit
6dddd11ef4

+ 7 - 1
src/api/sales.js

@@ -45,7 +45,13 @@ export function addFrontOrder(params) {
     data: params
   })
 }
-
+export function addRefund(params) {
+  return request({
+    url: '/customer/frontOrder/addRefund',
+    method: 'post',
+    data: params
+  })
+}
 export function getFrontOrderDetail(params) {
   return request({
     url: '/customer/frontOrder/detail',

+ 2 - 2
src/components/ReturnSalesHeader/ReturnSalesHeader.vue

@@ -5,10 +5,10 @@
         <el-col :span="8" class="item">
           <div class="label">销售订单号</div>
           <div class="value">
-            <el-input disabled placeholder="引用销售单"></el-input>
+            <el-input disabled v-model="details.customerOrderNo" placeholder="引用销售单"></el-input>
           </div>
         </el-col>
-        <el-col :span="16" class="item">
+        <el-col :span="16" class="item" v-if="details.id">
           <div class="label">退货订单号</div>
           <div class="value">{{ details.id }}</div>
         </el-col>

+ 1 - 3
src/views/sales/sales_management/components/customer_sales_details.vue

@@ -2,7 +2,7 @@
   <div>
     <el-page-header @back="$parent.pageType=0" content="详情" style=" padding: 20px 20px 0 20px;"></el-page-header>
     <sales-header ref="header" />
-    <sales-table :dataList="dataList" :column="column" isOperation isSelection @handleSelection="handleSelection">
+    <sales-table :dataList="dataList" :column="column"   @handleSelection="handleSelection">
       <!--      <template #bts>-->
       <!--        <div>-->
       <!--          <el-button type="primary" size="mini" @click="dialogVisible=true">添加</el-button>-->
@@ -127,7 +127,6 @@ export default {
           prop: 'qty',
           label: '数量',
           width: '180',
-          isInput: true
         },
         {
           prop: 'volume',
@@ -143,7 +142,6 @@ export default {
           prop: 'notes',
           label: '备注',
           width: '180',
-          isInput: true
 
         }
       ],

+ 1 - 1
src/views/sales/sales_management/components/customer_sales_form.vue

@@ -112,7 +112,7 @@ export default {
     }
   },
   created() {
-    if (this.$parent.pageType == 2 || this.detailsId) {
+    if (this.detailsId) {
       getFrontOrderDetail({ id: this.detailsId }).then(res => {
         this.dataList = res.data.orders
         this.$refs.header.screenForm = res.data

+ 1 - 3
src/views/sales/sales_management/components/return_sales_details.vue

@@ -2,7 +2,7 @@
   <div>
     <el-page-header @back="$parent.pageType=0" content="详情" style=" padding: 20px 20px 0 20px;"></el-page-header>
     <return-sales-header ref="header" :details="details" />
-    <sales-table :dataList="dataList" :column="column" isOperation isSelection @handleSelection="handleSelection">
+    <sales-table :dataList="dataList" :column="column"   @handleSelection="handleSelection">
       <template #bts>
         <div>
           <el-button type="primary" size="mini" @click="dialogVisible=true">添加</el-button>
@@ -84,7 +84,6 @@ export default {
           prop: 'qty',
           label: '数量',
           width: '180',
-          isInput: true
         },
         {
           prop: 'volume',
@@ -100,7 +99,6 @@ export default {
           prop: 'notes',
           label: '备注',
           width: '180',
-          isInput: true
 
         }
       ]

+ 8 - 6
src/views/sales/sales_management/components/return_sales_form.vue

@@ -46,6 +46,7 @@ import SalesTable from '@/components/SalesTable/SalesTable'
 import {
   addFrontOrder, detailRefund,
   getFrontOrderDetail,
+  addRefund,
   getFrontOrderList,
   sbumitFrontOrder,
   sendRefund,
@@ -122,10 +123,12 @@ export default {
     }
   },
   created() {
-    if (this.$parent.pageType == 2 || this.detailsId) {
+    if (this.detailsId) {
       detailRefund({id:this.detailsId}).then(res=>{
         this.dataList = res.data.orders
         this.details = res.data
+        this.details.customerOrderNo = this.dataList[0].id
+        this.customerNumber=this.dataList[0].customerNumber
       })
     }
   },
@@ -138,9 +141,9 @@ export default {
       console.log(selected)
       // console.log(selected)
       this.dataList = selected
-      console.log(this.dataList,selected,this.$refs.header)
       this.details = this.dataList[0]
-      this.details.id = this.dataList[0].id
+      this.details.customerOrderNo = this.dataList[0].id
+      this.details.id = ''
       this.customerNumber=this.dataList[0].customerNumber
        // this.$refs.header.details.customerName = this.dataList[0].customerName
        // this.$refs.header.details.customerNumber = this.dataList[0].customerNumber
@@ -185,7 +188,6 @@ export default {
         this.$errorMsg('请添加产品')
         return
       }
-      const  id = this.dataList[0].id
       for (let i = 0; i < this.dataList.length; i++) {
         this.dataList[i].id = ''
         this.dataList[i].directFlag = this.dataList[i].flag
@@ -198,12 +200,12 @@ export default {
       const params = {
         ...this.$refs.header.details,
         orders: this.dataList,
-        customerOrderNo:id,
+        customerOrderNo:this.details.customerOrderNo,
         status
       }
       if (type===1){
         params.id = ''
-        addFrontOrder(params).then(res => {
+        addRefund(params).then(res => {
           this.$successMsg('新增成功')
           this.$parent.pageType = 0
           this.dis =false

+ 1 - 1
src/views/sales/sales_management/return_sales_list.vue

@@ -12,7 +12,7 @@
       :optionsEvensGroup="optionsEvensGroup"
     >
     </template-page>
-    <return_sales_form v-else-if="pageType===1" :details-id="detailsId"/>
+    <return_sales_form v-else-if="pageType===1 || pageType ===2" :details-id="detailsId"/>
     <return_sales_details v-else :details-id="detailsId"/>
   </div>
 </template>