lilei 3 лет назад
Родитель
Сommit
5ecce21f07

+ 59 - 0
src/api/reportData.js

@@ -1,5 +1,64 @@
 import { axios } from '@/utils/request'
 
+// 销售退货-分页列表
+export const reportSalesReturnPageList = (params) => {
+  const url = `report/reportSalesReturnBill/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 销售退货-列表合计
+export const reportSalesReturnBillTotal = (params) => {
+  return axios({
+    url: 'report/reportSalesReturnBill/reportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 销售退货-报表导出
+export const reportSalesReturnExport = params => {
+  return axios.request({
+    url: `/report/reportSalesReturnBill/export`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+
+// 销售退货明细-分页列表
+export const reportSalesReturnDetailPageList = (params) => {
+  const url = `report/reportSalesReturnBill/reportDetailPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 销售退货明细-列表合计
+export const reportSalesReturnDetailTotal = (params) => {
+  return axios({
+    url: 'report/reportSalesReturnBill/reportDetailCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 销售退货明细-报表导出
+export const reportSalesReturnDetailExport = params => {
+  return axios.request({
+    url: `/report/reportSalesReturnBill/detailExport`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+
+
 // 店内调出-分页列表
 export const reportStoreCallOutPageList = (params) => {
   const url = `report/reportStoreCallOut/reportPage/${params.pageNo}/${params.pageSize}`

+ 28 - 27
src/views/reportData/salesReturnReport/detailList.vue

@@ -20,12 +20,12 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-model-item label="销售退货单号">
-              <a-input id="salesDetailReportList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售退货单号"/>
+              <a-input id="salesDetailReportList-salesReturnNo" v-model.trim="queryParam.salesReturnNo" allowClear placeholder="请输入销售退货单号"/>
             </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-model-item label="客户名称">
-              <a-input id="salesDetailReportList-salesTargetName" v-model.trim="queryParam.salesTargetName" allowClear placeholder="请输入客户名称"/>
+              <a-input id="salesDetailReportList-buyerName" v-model.trim="queryParam.buyerName" allowClear placeholder="请输入客户名称"/>
             </a-form-model-item>
           </a-col>
           <template v-if="advanced">
@@ -73,13 +73,13 @@
     <!-- 合计 -->
     <a-alert type="info" style="margin-bottom:10px">
       <div class="ftext" slot="message">
-        总退货数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
-        废品数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
-        入库数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
-        退货金额:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? '¥'+totalData.totalCost : '--' }}</strong>;
-        折扣金额:<strong>{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? '¥'+totalData.totalPrice : '--' }}</strong>;
-        折后退货金额:<strong>{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? '¥'+totalData.totalProfit : '--' }}</strong>。
-        退货成本:<strong>{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? '¥'+totalData.totalProfit : '--' }}</strong>。
+        总退货数量:<strong>{{ (totalData && (totalData.qty || totalData.qty==0)) ? totalData.qty : '--' }}</strong>;
+        废品数量:<strong>{{ (totalData && (totalData.celQty || totalData.celQty==0)) ? totalData.celQty : '--' }}</strong>;
+        入库数量:<strong>{{ (totalData && (totalData.qty || totalData.qty==0)) ? totalData.qty : '--' }}</strong>;
+        退货金额:<strong>{{ (totalData && (totalData.price || totalData.price==0)) ? '¥'+totalData.price : '--' }}</strong>;
+        折扣金额:<strong>{{ (totalData && (totalData.discountAmount || totalData.discountAmount==0)) ? '¥'+totalData.discountAmount : '--' }}</strong>;
+        折后退货金额:<strong>{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? '¥'+totalData.discountedAmount : '--' }}</strong>;
+        退货成本:<strong>{{ (totalData && (totalData.cost || totalData.cost==0)) ? '¥'+totalData.cost : '--' }}</strong>。
       </div>
     </a-alert>
     <!-- 列表 -->
@@ -103,7 +103,7 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import { downloadExcel } from '@/libs/JGPrint.js'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
-import { reportSalesBillDetailList, reportSalesBillDetailCount, reportSalesBillDetailExport } from '@/api/reportData'
+import { reportSalesReturnDetailPageList, reportSalesReturnDetailTotal, reportSalesReturnDetailExport } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDate, ProductType, ProductBrand },
   mixins: [commonMixin],
@@ -119,7 +119,7 @@ export default {
         beginDate: '',
         endDate: '',
         productType: undefined,
-        salesTargetName: '',
+        buyerName: '',
         productEntity: {
           productBrandSn: undefined, //  产品品牌
           productTypeSn1: '', //  产品一级分类
@@ -128,7 +128,7 @@ export default {
           code: '', //  产品编码
           name: '' //  产品名称
         },
-        salesBillNo: ''
+        salesReturnNo: ''
       },
       rules: {
         'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }]
@@ -137,19 +137,19 @@ export default {
       exportLoading: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '销售退货单号', dataIndex: 'salesBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'salesTargetName', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '销售退货单号', dataIndex: 'salesReturnNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'buyerName', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品编码', dataIndex: 'productEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '废品数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货金额', dataIndex: 'totalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '折扣金额', dataIndex: 'totalPrice', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '折后退货金额', dataIndex: 'totalProfit', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货成本', dataIndex: 'totalProfit', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '审核时间', dataIndex: 'salesAuditDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '退货数量', dataIndex: 'qty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '废品数量', dataIndex: 'celQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库数量', dataIndex: 'inStockQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货金额', dataIndex: 'price', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '折扣金额', dataIndex: 'discountAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '折后退货金额', dataIndex: 'discountedAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货成本', dataIndex: 'cost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -157,7 +157,7 @@ export default {
         const params = Object.assign(parameter, this.queryParam)
         this.spinning = true
         delete params.time
-        return reportSalesBillDetailList(params).then(res => {
+        return reportSalesReturnDetailPageList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -166,6 +166,7 @@ export default {
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
+              data.list[i].inStockQty = data.list[i].qty
             }
             this.disabled = false
           }
@@ -179,7 +180,7 @@ export default {
   methods: {
     // 合计
     getCount (params) {
-      reportSalesBillDetailCount(params).then(res => {
+      reportSalesReturnDetailTotal(params).then(res => {
         if (res.status == 200) {
           this.totalData = res.data
         } else {
@@ -210,8 +211,8 @@ export default {
       this.queryParam.time = []
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
-      this.queryParam.salesBillNo = ''
-      this.queryParam.salesTargetName = ''
+      this.queryParam.salesReturnNo = ''
+      this.queryParam.buyerName = ''
       this.queryParam.productEntity.productBrandSn = undefined
       this.queryParam.productEntity.productTypeSn1 = ''
       this.queryParam.productEntity.productTypeSn2 = ''
@@ -232,7 +233,7 @@ export default {
           const params = _this.queryParam
           _this.exportLoading = true
           _this.spinning = true
-          reportSalesBillDetailExport(params).then(res => {
+          reportSalesReturnDetailExport(params).then(res => {
             downloadExcel(res, '销售退货明细报表')
             _this.exportLoading = false
             _this.spinning = false

+ 26 - 25
src/views/reportData/salesReturnReport/list.vue

@@ -20,12 +20,12 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-model-item label="销售退货单号">
-              <a-input id="salesReturnReportList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售退货单号"/>
+              <a-input id="salesReturnReportList-salesReturnNo" v-model.trim="queryParam.salesReturnNo" allowClear placeholder="请输入销售退货单号"/>
             </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-model-item label="客户名称">
-              <a-input id="salesReturnReportList-salesTargetName" v-model.trim="queryParam.salesTargetName" allowClear placeholder="请输入客户名称"/>
+              <a-input id="salesReturnReportList-buyerName" v-model.trim="queryParam.buyerName" allowClear placeholder="请输入客户名称"/>
             </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
@@ -47,14 +47,14 @@
     <!-- 合计 -->
     <a-alert type="info" style="margin-bottom:10px">
       <div class="ftext" slot="message">
-        总单数:<strong>{{ (totalData && (totalData.totalRowSize || totalData.totalRowSize==0)) ? totalData.totalRowSize : '--' }}</strong>;
+        总单数:<strong>{{ (totalData && (totalData.totalCategory || totalData.totalCategory==0)) ? totalData.totalCategory : '--' }}</strong>;
         总退货数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
-        废品数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
+        废品数量:<strong>{{ (totalData && (totalData.totalCelQty || totalData.totalCelQty==0)) ? totalData.totalCelQty : '--' }}</strong>;
         入库数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
-        退货金额:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? '¥'+totalData.totalCost : '--' }}</strong>;
-        折扣金额:<strong>{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? '¥'+totalData.totalPrice : '--' }}</strong>;
-        折后退货金额:<strong>{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? '¥'+totalData.totalProfit : '--' }}</strong>。
-        退货成本:<strong>{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? '¥'+totalData.totalProfit : '--' }}</strong>。
+        退货金额:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? '¥'+totalData.totalAmount : '--' }}</strong>;
+        折扣金额:<strong>{{ (totalData && (totalData.discountAmount || totalData.discountAmount==0)) ? '¥'+totalData.discountAmount : '--' }}</strong>;
+        折后退货金额:<strong>{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? '¥'+totalData.discountedAmount : '--' }}</strong>;
+        退货成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? '¥'+totalData.totalCost : '--' }}</strong>。
       </div>
     </a-alert>
     <!-- 列表 -->
@@ -76,7 +76,7 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { downloadExcel } from '@/libs/JGPrint.js'
-import { reportSalesBillList, reportSalesBillCount, reportSalesBillExport } from '@/api/reportData'
+import { reportSalesReturnPageList, reportSalesReturnBillTotal, reportSalesReturnExport } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDate },
   mixins: [commonMixin],
@@ -91,8 +91,8 @@ export default {
         time: [],
         beginDate: '',
         endDate: '',
-        salesTargetName: '',
-        salesBillNo: ''
+        buyerName: '',
+        salesReturnNo: ''
       },
       rules: {
         'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }]
@@ -101,17 +101,17 @@ export default {
       exportLoading: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '销售退货单号', dataIndex: 'salesBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'salesTargetName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '销售退货单号', dataIndex: 'salesReturnNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'buyerName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '款数', dataIndex: 'totalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总退货数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '废品数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货金额', dataIndex: 'totalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '折扣金额', dataIndex: 'totalPrice', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '折后退货金额', dataIndex: 'totalProfit', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货成本', dataIndex: 'totalProfit', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '审核时间', dataIndex: 'salesAuditDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '废品数量', dataIndex: 'totalCelQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库数量', dataIndex: 'inStockQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货金额', dataIndex: 'totalAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '折扣金额', dataIndex: 'discountAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '折后退货金额', dataIndex: 'discountedAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货成本', dataIndex: 'totalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditTime', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -119,7 +119,7 @@ export default {
         const params = Object.assign(parameter, this.queryParam)
         this.spinning = true
         delete params.time
-        return reportSalesBillList(params).then(res => {
+        return reportSalesReturnPageList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -128,6 +128,7 @@ export default {
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
+              data.list[i].inStockQty = data.list[i].totalQty
             }
             this.disabled = false
           }
@@ -141,7 +142,7 @@ export default {
   methods: {
     // 合计
     getCount (params) {
-      reportSalesBillCount(params).then(res => {
+      reportSalesReturnBillTotal(params).then(res => {
         if (res.status == 200) {
           this.totalData = res.data
         } else {
@@ -172,8 +173,8 @@ export default {
       this.queryParam.time = []
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
-      this.queryParam.salesBillNo = ''
-      this.queryParam.salesTargetName = ''
+      this.queryParam.salesReturnNo = ''
+      this.queryParam.buyerName = ''
       this.$refs.ruleForm.resetFields()
       this.totalData = null
       this.$refs.table.clearTable()
@@ -186,7 +187,7 @@ export default {
           const params = _this.queryParam
           _this.exportLoading = true
           _this.spinning = true
-          reportSalesBillExport(params).then(res => {
+          reportSalesReturnExport(params).then(res => {
             downloadExcel(res, '销售退货报表')
             _this.exportLoading = false
             _this.spinning = false