Jelajahi Sumber

销售退货

lilei 4 tahun lalu
induk
melakukan
29a55eb0cb

+ 97 - 22
src/api/salesReturn.js

@@ -1,8 +1,49 @@
 import { axios } from '@/utils/request'
 
-//  销售退货 列表  分页
-export const salesReturnList = (params) => {
-  const url = `/salesReturn/queryPage/${params.pageNo}/${params.pageSize}`
+//  销售退货 审核
+export const salesReturnAudit = (params) => {
+  return axios({
+    url: `/salesReturn/audit/${params.sn}`,
+    method: 'get'
+  })
+}
+//  销售退货 删除
+export const salesReturnDel = (params) => {
+  return axios({
+    url: `/salesReturn/delete/${params.sn}`,
+    method: 'get'
+  })
+}
+
+//  销售退货明细 删除
+export const salesReturnDetailDel = (params) => {
+  return axios({
+    url: `/salesReturn/detail/delete/${params.id}`,
+    method: 'get'
+  })
+}
+
+//  销售退货明细 整单删除
+export const salesReturnDelAll = (params) => {
+  return axios({
+    url: `/salesReturn/detail/deleteAll/${params.sn}`,
+    method: 'get'
+  })
+}
+
+// 明细列表统计,不传sn 是所有统计
+export const salesReturnQueryCount = (params) => {
+  const url = `/salesReturn/detail/queryCount`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+//  销售退货 分页查询销售退货明细
+export const salesReturnDetailList = (params) => {
+  const url = `/salesReturn/detail/queryPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -11,14 +52,35 @@ export const salesReturnList = (params) => {
     method: 'post'
   })
 }
-//  销售退货 详情
-export const salesReturnDetail = (params) => {
+//  销售退货 分页查询产品
+export const salesReturnProductList = (params) => {
+  const url = `/salesReturn/detail/querySalesBillDetailPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
   return axios({
-    url: `/salesReturn/findById/${params.id}`,
+    url: url,
     data: params,
-    method: 'get'
+    method: 'post'
+  })
+}
+//  产品添加和修改
+export const salesReturnSaveProduct = (params) => {
+  return axios({
+    url: '/salesReturn/detail/save',
+    data: params,
+    method: 'post'
   })
 }
+
+// 退货打折
+export const salesReturnDiscount = (params) => {
+  return axios({
+    url: '/salesReturn/discount',
+    data: params,
+    method: 'post'
+  })
+}
+
 //  销售退货 导出
 export const salesReturnExport = (params) => {
   return axios({
@@ -27,15 +89,16 @@ export const salesReturnExport = (params) => {
     method: 'post'
   })
 }
-//  销售退货 审核
-export const salesReturnAudit = (params) => {
+
+// 根据SN查询销售退货单
+export const salesReturnDetail = (params) => {
   return axios({
-    url: '/salesReturn/audit',
-    data: params,
-    method: 'post'
+    url: `/salesReturn/findBySn/${params.sn}`,
+    method: 'get'
   })
 }
-//  销售退货 收款
+
+//  销售退货 付款
 export const salesReturnPay = (params) => {
   return axios({
     url: '/salesReturn/pay',
@@ -43,6 +106,7 @@ export const salesReturnPay = (params) => {
     method: 'post'
   })
 }
+
 //  销售退货 打印
 export const salesReturnPrint = (params) => {
   return axios({
@@ -51,6 +115,7 @@ export const salesReturnPrint = (params) => {
     method: 'post'
   })
 }
+
 //  销售退货 打印预览
 export const salesReturnprintPreview = (params) => {
   return axios({
@@ -59,15 +124,20 @@ export const salesReturnprintPreview = (params) => {
     method: 'post'
   })
 }
-//  销售退货 提交
-export const salesReturnSubmit = (params) => {
+
+//  销售退货 列表分页
+export const salesReturnList = (params) => {
+  const url = `/salesReturn/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
   return axios({
-    url: '/salesReturn/submit',
+    url: url,
     data: params,
     method: 'post'
   })
 }
-//  销售退货 保存
+
+//  销售退货单保存
 export const salesReturnSave = (params) => {
   return axios({
     url: '/salesReturn/save',
@@ -75,11 +145,16 @@ export const salesReturnSave = (params) => {
     method: 'post'
   })
 }
-//  销售退货 删除
-export const salesReturnDel = (params) => {
+
+//  销售退货 提交
+export const salesReturnSubmit = (params) => {
   return axios({
-    url: `/salesReturn/delete/${params.id}`,
-    data: params,
-    method: 'post'
+    url: `/salesReturn/submit/${params.sn}`,
+    method: 'get'
   })
 }
+
+
+
+
+

+ 3 - 3
src/config/router.config.js

@@ -218,8 +218,8 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'salesReturnGrabEdit/:id/:sn',
-                name: 'salesReturnNew',
+                path: 'salesReturnGrabEdit/:id/:sn/:buyerSn',
+                name: 'salesReturnGrabEdit',
                 component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesReturn/salesReturnGrabEdit.vue'),
                 meta: {
                   title: '编辑退货单',
@@ -229,7 +229,7 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'salesReturnEdit/:id/:sn',
+                path: 'salesReturnEdit/:id/:sn/:buyerSn',
                 name: 'salesReturnEdit',
                 component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesReturn/salesReturnEdit.vue'),
                 meta: {

+ 0 - 3
src/views/salesManagement/salesReturn/chooseCustomModal.vue

@@ -328,9 +328,6 @@ export default {
         if (res.status == 200) {
           _this.$message.success(res.message)
           _this.$emit('ok', res.data)
-          if (_this.form.id) {
-            _this.$emit('updateData')
-          }
           _this.cancel()
         }
       })

+ 72 - 45
src/views/salesManagement/salesReturn/list.vue

@@ -29,14 +29,14 @@
           <a-col :md="6" :sm="24">
             <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
               <a-select
-                id="salesReturn-buyerName"
+                id="salesReturn-buyerSn"
                 placeholder="请选择客户"
                 allowClear
-                v-model="queryParam.buyerName"
+                v-model="queryParam.buyerSn"
                 :showSearch="true"
                 option-filter-prop="children"
                 :filter-option="filterOption">
-                <a-select-option v-for="item in custAllList" :key="item.customerSn" :value="item.customerName">{{ item.customerName }}</a-select-option>
+                <a-select-option v-for="item in custAllList" :key="item.customerSn" :value="item.customerSn">{{ item.customerName }}</a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
@@ -52,7 +52,7 @@
                   v-model="queryParam.billStatus"
                   ref="billStatus"
                   id="salesManagementList-billStatus"
-                  code="SALES_BILL_STATUS"
+                  code="SALES_RETURN_BILL_STATUS"
                   placeholder="请选择业务状态"
                   allowClear></v-select>
               </a-form-item>
@@ -73,11 +73,16 @@
     </div>
     <!-- 操作按钮 -->
     <div class="table-operator">
-      <a-button type="primary" class="button-error" @click="handleAdd">新增</a-button>
+      <a-button type="primary" class="button-error" @click="openModal = true">新增</a-button>
     </div>
     <!-- alert -->
     <a-alert type="info" style="margin-bottom: 15px;">
-      <div slot="message">退货总金额:<strong>14.00</strong>元;总单数:<strong>6</strong>;总款数:<strong>6</strong>;总数量:<strong>6</strong>;</div>
+      <div slot="message">
+        退货总金额:<strong>{{ countData&&countData.totalAmount }}</strong>元;
+        总单数:<strong>{{ countData&&countData.totalBillNumber }}</strong>;
+        总款数:<strong>{{ countData&&countData.totalCategory }}</strong>;
+        总数量:<strong>{{ countData&&countData.totalQty }}</strong>;
+      </div>
     </a-alert>
     <!-- 列表 -->
     <s-table
@@ -87,16 +92,12 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 1590 }"
+      :scroll="{ x: 1590, y: tableHeight }"
       bordered>
       <!-- 单号 -->
       <template slot="salesReturnNo" slot-scope="text, record">
         <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.salesReturnNo }}</span>
       </template>
-      <!-- 财务状态 -->
-      <template slot="financialStatus" slot-scope="text, record">
-        <a-badge :color="text=='FINISH'?'#87d068':'gold'" :text="record.financialStatusDictValue" />
-      </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
         <a-button size="small" type="link" @click="handleEexamine(record)" id="salesReturn-eexamine-btn">审核</a-button>
@@ -117,7 +118,8 @@
 import { STable, VSelect } from '@/components'
 import chooseCustomModal from './chooseCustomModal.vue'
 import { custAllList } from '@/api/customer'
-import { salesReturnList, salesReturnDel } from '@/api/salesReturn'
+import { salesReturnList, salesReturnQueryCount, salesReturnAudit, salesReturnDel } from '@/api/salesReturn'
+import moment from 'moment'
 export default {
   name: 'TableList',
   components: {
@@ -127,6 +129,7 @@ export default {
   },
   data () {
     return {
+      tableHeight: 0,
       // 高级搜索 展开/关闭
       advanced: false,
       disabled: false, //  查询、重置按钮是否可操作
@@ -137,27 +140,51 @@ export default {
       custAllList: [], //  客户下拉数据
       // 查询参数
       queryParam: {
-        dealerName: undefined, //  客户名称
-        salesReturnNo: undefined //  销售退货单号
+        buyerSn: undefined, //  客户名称
+        salesReturnNo: undefined, //  销售退货单号
+        billStatus: undefined, // 业务状态
+        beginDate: undefined,
+        endDate: undefined,
+        auditBeginDate: undefined,
+        auditEndDate: undefined
       },
+      countData: null, // 统计数据
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
-        { title: '销售退货单号', scopedSlots: { customRender: 'salesReturnNo' }, width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售退货单号', scopedSlots: { customRender: 'salesReturnNo' }, width: 140, align: 'center' },
         { title: '客户名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '总款数', dataIndex: 'totalCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总数量', dataIndex: 'totalCelQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '退款总金额', dataIndex: 'totalAmount', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '是否抓单', dataIndex: 'grabFlag', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '是否抓单', dataIndex: 'grabFlag', width: 100, align: 'center', customRender: function (text) { return ['否', '是'][text] } },
         { title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: 110, align: 'center' },
-        { title: '财务状态', dataIndex: 'financialStatus', scopedSlots: { customRender: 'financialStatus' }, width: 110, align: 'center' },
+        { title: '状态', dataIndex: 'stateDictValue', width: 110, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 220, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 320
+        }
+        // 创建时间
+        if (this.createDate && this.createDate.length > 0) {
+          this.queryParam.beginDate = moment(this.createDate[0]).format(this.dateFormat)
+          this.queryParam.endDate = moment(this.createDate[1]).format(this.dateFormat)
+        } else {
+          this.queryParam.beginDate = undefined
+          this.queryParam.endDate = undefined
+        }
+        // 审核时间
+        if (this.examineTime && this.examineTime.length > 0) {
+          this.queryParam.auditBeginDate = moment(this.examineTime[0]).format(this.dateFormat)
+          this.queryParam.auditEndDate = moment(this.examineTime[1]).format(this.dateFormat)
+        } else {
+          this.queryParam.auditBeginDate = undefined
+          this.queryParam.auditEndDate = undefined
+        }
+        // 查询总计
+        this.getQueryCount(Object.assign(parameter, this.queryParam))
         return salesReturnList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -175,18 +202,16 @@ export default {
     disabledDate (date, dateStrings) {
       return date && date.valueOf() > Date.now()
     },
-    handleAdd () {
-      this.openModal = true
+    // 列表统计
+    getQueryCount (params) {
+      salesReturnQueryCount(params).then(res => {
+        this.countData = res.data || null
+      })
     },
     // 编辑
     handleEdit (row) {
-      if (row.grabFlag) {
-        // 抓单
-        this.$router.push({ name: 'salesReturnGrabEdit', params: { id: row.id, sn: row.salesReturnSn } })
-      } else {
-        // 不抓单
-        this.$router.push({ name: 'salesReturnEdit', params: { id: row.id, sn: row.salesReturnSn } })
-      }
+      console.log(row)
+      this.$router.push({ name: row.grabFlag ? 'salesReturnGrabEdit' : 'salesReturnEdit', params: { id: row.id, sn: row.salesReturnSn, buyerSn: row.buyerSn } })
     },
     // 详情
     handleDetail (row) {
@@ -200,7 +225,7 @@ export default {
         content: '确认要删除吗?',
         centered: true,
         onOk () {
-          salesReturnDel({ id: row.id }).then(res => {
+          salesReturnDel({ sn: row.salesReturnSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
@@ -217,25 +242,27 @@ export default {
         content: '确认要审核吗?',
         centered: true,
         onOk () {
-          // delectRolePower({
-          //   id: row.id
-          // }).then(res => {
-          //   console.log(res, 'res1111')
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //   }
-          // })
+          salesReturnAudit({
+            sn: row.salesReturnSn
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
         }
       })
     },
     resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
+      this.queryParam.buyerSn = undefined
+      this.queryParam.salesReturnNo = ''
+      this.queryParam.billStatus = ''
+      this.queryParam.beginDate = undefined
+      this.endDate = undefined
+      this.auditBeginDate = undefined
+      this.auditEndDate = undefined
+      this.createDate = []
+      this.examineTime = []
       this.$refs.table.refresh(true)
     },
     // 客户无分页列表数据

+ 23 - 41
src/views/salesManagement/salesReturn/queryPart.vue

@@ -11,18 +11,18 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="产品编码">
-              <a-input id="productInfoList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入产品编码"/>
+              <a-input id="productInfoList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="产品名称">
-              <a-input id="productInfoList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入产品名称"/>
+              <a-input id="productInfoList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
             </a-form-item>
           </a-col>
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
               <a-form-item label="销售单号">
-                <a-input id="productInfoList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入销售单号"/>
+                <a-input id="productInfoList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
               </a-form-item>
             </a-col>
           </template>
@@ -69,17 +69,25 @@
 </template>
 
 <script>
-// import { customerBundleDelayList, customerBundleExportDelay } from '@/api/FinancialManagement'
+import { salesReturnProductList } from '@/api/salesReturn'
 import { STable, VSelect } from '@/components'
 export default {
   name: 'QueryPart',
   components: { STable, VSelect },
+  props: {
+    buyerSn: {
+      type: [Number, String],
+      default: ''
+    },
+    newLoading: Boolean
+  },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
       queryParam: { //  查询条件
-        bundleName: '', //  供应商名称
-        state: undefined //  状态
+        salesBillNo: '', //  销售单号
+        productName: '', // 产品名称
+        productCode: '' //  产品编码
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
@@ -94,7 +102,7 @@ export default {
         },
         {
           title: '产品编码',
-          dataIndex: 'productNo',
+          dataIndex: 'productCode',
           align: 'center',
           sorter: true
         },
@@ -110,7 +118,7 @@ export default {
         },
         {
           title: '销售单号',
-          dataIndex: 'productBrand',
+          dataIndex: 'salesBillNo',
           align: 'center'
         },
         {
@@ -127,12 +135,12 @@ export default {
         },
         {
           title: '单位',
-          dataIndex: 'dw',
+          dataIndex: 'unit',
           align: 'center'
         },
         {
           title: '销售数量',
-          dataIndex: 'salesNums',
+          dataIndex: 'qty',
           align: 'center'
         },
         {
@@ -145,41 +153,15 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
-        //   const data = res.data
-        //   const no = (data.pageNo - 1) * data.pageSize
-        //   for (var i = 0; i < data.list.length; i++) {
-        //     data.list[i].no = no + i + 1
-        //   }
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              {
-                id: '1',
-                productNo: 'jgqp11111111111',
-                productName: '产品1',
-                ycNo: 'jgqp111123545',
-                productBrand: '箭冠品牌',
-                productType: '产品分类1',
-                price: 5.6,
-                salesNums: 12,
-                dw: '个'
-              }
-            ],
-            count: 10
-          }
+        this.queryParam.buyerSn = this.buyerSn
+        return salesReturnProductList(Object.assign(parameter, this.queryParam)).then(res => {
+          const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          return data
         })
       },
       openModal: false, //  查看客户详情  弹框

+ 45 - 39
src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue

@@ -6,10 +6,10 @@
         @back="() => $router.go(-1)"
       >
         <template slot="subTitle">
-          <a href="javascript:;" @click="() => $router.go(-1)">客户名称:车领主常青二路店</a>
-          <a-button size="small" @click="handleEditCustom" style="margin-left:50px" key="0">
+          <a href="javascript:;" @click="() => $router.go(-1)">客户名称:{{ ordeDetai&&ordeDetai.buyerName }}</a>
+          <!-- <a-button size="small" @click="handleEditCustom" style="margin-left:50px" key="0">
             编辑
-          </a-button>
+          </a-button> -->
         </template>
         <template slot="extra">
           <a-button key="2">
@@ -24,16 +24,16 @@
 
     <a-card size="small" :bordered="false" class="pages-wrap">
       <!-- 查询配件列表 -->
-      <queryPart></queryPart>
+      <queryPart :buyerSn="$route.params.buyerSn"></queryPart>
     </a-card>
     <a-card size="small" :bordered="false" class="pages-wrap">
       <!-- alert -->
       <a-alert style="margin-bottom: 15px;" type="info">
         <div slot="message">
-          <span>退货总金额:15;</span>
-          <span>总款数:6;</span>
-          <span>总数量:3;</span>
-          <span>废品总数量:7;</span>
+          <span>退货总金额:{{ countData&&countData.totalAmount }}元;</span>
+          <span>总款数:{{ countData&&countData.totalCategory }};</span>
+          <span>总数量:{{ countData&&countData.totalQty }};</span>
+          <span>废品总数量:{{ countData&&countData.totalCelQty }};</span>
         </div>
       </a-alert>
       <!-- 查询条件 -->
@@ -117,6 +117,7 @@ import { STable, VSelect } from '@/components'
 import queryPart from './queryPart.vue'
 import EditableCell from '@/views/common/editInput.js'
 import chooseCustomModal from './chooseCustomModal.vue'
+import { salesReturnDetail, salesReturnQueryCount, salesReturnDetailList } from '@/api/salesReturn'
 export default {
   name: 'SalesDetail',
   components: {
@@ -128,13 +129,19 @@ export default {
   },
   data () {
     return {
+      orderId: null,
+      orderSn: null,
+      buyerSn: null,
       disabled: false,
       openModal: false,
+      ordeDetai: null,
+      // 已选产品
       dataSource: [],
       productForm: {
         productNo: '',
         productName: ''
       },
+      countData: null,
       // 表头
       columns: [
         {
@@ -223,41 +230,17 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
-        //   const data = res.data
-        //   const no = (data.pageNo - 1) * data.pageSize
-        //   for (var i = 0; i < data.list.length; i++) {
-        //     data.list[i].no = no + i + 1
-        //   }
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              {
-                id: '1',
-                productNo: 'jgqp11111111111',
-                productName: '产品1',
-                ycNo: 'jgqp111123545',
-                productBrand: '箭冠品牌',
-                productType: '产品分类1',
-                price: 5.6,
-                salesNums: 12
-              }
-            ],
-            count: 10
-          }
+        // 查询总计
+        this.productForm.salesReturnBillSn = this.$route.params.sn
+        this.getQueryCount(Object.assign(parameter, this.productForm))
+        return salesReturnDetailList(Object.assign(parameter, this.productForm)).then(res => {
+          const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          _this.dataSource = data.list
-          resolve(data)
+          this.disabled = false
+          return data
         })
       }
     }
@@ -282,7 +265,30 @@ export default {
     },
     handleEditCustom () {
       this.openModal = true
+    },
+    // 明细统计
+    getQueryCount (params) {
+      salesReturnQueryCount(params).then(res => {
+        this.countData = res.data || null
+      })
+    },
+    // 获取单据详细
+    getOrderDetail () {
+      salesReturnDetail({ sn: this.orderSn }).then(res => {
+        this.ordeDetai = res.data || null
+      })
     }
+  },
+  mounted () {
+    this.orderId = this.$route.params.id
+    this.orderSn = this.$route.params.sn
+    this.buyerSn = this.$route.params.buyerSn
+    this.getOrderDetail()
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      console.log('beforeRouteEnter')
+    })
   }
 }
 </script>