chenrui 2 лет назад
Родитель
Сommit
cc8e23a2c6
4 измененных файлов с 75 добавлено и 44 удалено
  1. 1 0
      package.json
  2. 1 1
      public/version.json
  3. 24 2
      src/api/shelf.js
  4. 49 41
      src/views/numsGoodsShelves/customerAnalysis/list.vue

+ 1 - 0
package.json

@@ -87,6 +87,7 @@
       "parser": "babel-eslint"
     },
     "rules": {
+       "eqeqeq":["off"],
       "generator-star-spacing": "off",
       "no-mixed-operators": 0,
       "vue/max-attributes-per-line": [

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1665716624979
+  "version": 1666236618250
 }

+ 24 - 2
src/api/shelf.js

@@ -83,7 +83,7 @@ export const shelfProductParseProducts = params => {
     method: 'post'
   })
 }
- // POST 解析货位的导入模板
+// POST 解析货位的导入模板
 export const shelfPlaceReadExcel = params => {
   return axios({
     url: '/shelf/place/readExcel',
@@ -201,4 +201,26 @@ export const orderBillQueryCount = (params) => {
     data: params,
     method: 'post'
   })
-}
+}
+
+// 客户分析-分页列表
+export const queryShelfOrderReportPage = (params) => {
+  const url = `/shelfOrderReport/queryShelfOrderReportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 客户分析-统计
+
+export const queryShelfOrderTotalReport = (params) => {
+  return axios({
+    url: `/shelfOrderReport/queryShelfOrderTotalReport`,
+    data: params,
+    method: 'post'
+  })
+}

+ 49 - 41
src/views/numsGoodsShelves/customerAnalysis/list.vue

@@ -6,8 +6,8 @@
           <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
             <a-row :gutter="15">
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="货架名称" prop="shelfSn">
-                  <shelfSList v-model="queryParam.shelfSn"></shelfSList>
+                <a-form-model-item label="货架名称" prop="providerSn">
+                  <shelfSList v-model="queryParam.providerSn"></shelfSList>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -77,21 +77,21 @@
             </a-row>
           </a-form>
         </div>
-        <div class="table-operator">
+        <div class="table-operator" v-if="statisticsObj">
           <a-alert type="info">
             <div slot="message" class="total-bar">
               <div>
-                货架数量:<strong>399</strong>;
-                铺货数量合计:<strong>399</strong>;
-                铺货金额合计:<strong>26545</strong>;
-                货架取货数量合计:<strong>399</strong>;
-                货架取货金额合计:<strong>26545</strong>;
+                货架数量:<strong>{{ statisticsObj.shelfNum }}</strong>;
+                铺货数量合计:<strong>{{ statisticsObj.totalShelfMaxQty }}</strong>;
+                铺货金额合计:<strong>{{ statisticsObj.totalShelfMaxCost }}</strong>;
+                货架取货数量合计:<strong>{{ statisticsObj.totalOrderQty }}</strong>;
+                货架取货金额合计:<strong>{{ statisticsObj.totalOrderAmount }}</strong>;
               </div>
               <div>
-                急送数量合计:<strong>399</strong>;
-                急送金额合计:<strong>26545</strong>;
-                销售数量合计:<strong>399</strong>;
-                销售金额合计:<strong>26545</strong>;
+                急送数量合计:<strong>{{ statisticsObj.tempOrderQty }}</strong>;
+                急送金额合计:<strong>{{ statisticsObj.tempOrderAmount }}</strong>;
+                销售数量合计:<strong>{{ statisticsObj.saleOrderQty }}</strong>;
+                销售金额合计:<strong>{{ statisticsObj.saleOrderAmount }}</strong>;
               </div>
             </div>
           </a-alert>
@@ -127,7 +127,7 @@ import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import shelfSList from '@/views/common/shelfList'
 import { toThousands } from '@/libs/tools.js'
-import { orderBillQueryPage } from '@/api/shelf'
+import { queryShelfOrderReportPage, queryShelfOrderTotalReport } from '@/api/shelf'
 export default {
   name: 'UserList',
   components: { STable, VSelect, rangeDate, shelfSList },
@@ -140,49 +140,55 @@ export default {
       orderTime: [],
       // 查询参数
       queryParam: {
-        shelfName: '',
-        state: undefined
+        providerSn: '',
+        beginDate: '',
+        endDate: '',
+        qhslMin: undefined,
+        qhslMax: undefined,
+        xsslMin: undefined,
+        xsslMax: undefined
       },
       showModal: false,
       itemData: null, // 编辑行数据
       openStatusModal: false, // 货架状态弹窗初始状态
+      statisticsObj: null,
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
-        { title: '货架名称', dataIndex: 'createDate', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '货架名称', dataIndex: 'shelfName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         {
           slots: { title: 'customTitle' },
           children: [
-            { title: '铺货数量', dataIndex: 'bondAmount', width: '8%', align: 'center', customRender: function (text) { return text && toThousands(text, 2) || '--' }, sorter: true },
-            { title: '铺货金额', dataIndex: 'bondAmount', width: '8%', align: 'center', customRender: function (text) { return text && toThousands(text, 2) || '--' }, sorter: true }
+            { title: '铺货数量', dataIndex: 'totalShelfMaxQty', width: '8%', align: 'center', customRender: function (text) { return text && toThousands(text, 2) || '--' }, sorter: true },
+            { title: '铺货金额', dataIndex: 'totalShelfMaxCost', width: '8%', align: 'center', customRender: function (text) { return text && toThousands(text, 2) || '--' }, sorter: true }
           ]
         },
         {
           title: '货架订单',
           children: [
-            { title: '取货数量', dataIndex: 'bondAmount', width: '8%', align: 'center', customRender: function (text) { return text && toThousands(text, 2) || '--' }, sorter: true },
-            { title: '取货金额', dataIndex: 'bondAmount', width: '8%', align: 'center', customRender: function (text) { return text && toThousands(text, 2) || '--' }, sorter: true }
+            { title: '取货数量', dataIndex: 'totalOrderQty', width: '8%', align: 'center', customRender: function (text) { return text && toThousands(text, 2) || '--' }, sorter: true },
+            { title: '取货金额', dataIndex: 'totalOrderAmount', width: '8%', align: 'center', customRender: function (text) { return text && toThousands(text, 2) || '--' }, sorter: true }
           ]
         },
         {
           title: '急送订单',
           children: [
-            { title: '急送数量', dataIndex: 'bondAmount', width: '8%', align: 'center', customRender: function (text) { return text && toThousands(text, 2) || '--' }, sorter: true },
-            { title: '急送金额', dataIndex: 'bondAmount', width: '8%', align: 'center', customRender: function (text) { return text && toThousands(text, 2) || '--' }, sorter: true }
+            { title: '急送数量', dataIndex: 'tempOrderQty', width: '8%', align: 'center', customRender: function (text) { return text && toThousands(text, 2) || '--' }, sorter: true },
+            { title: '急送金额', dataIndex: 'tempOrderAmount', width: '8%', align: 'center', customRender: function (text) { return text && toThousands(text, 2) || '--' }, sorter: true }
           ]
         },
         {
           title: '销售单',
           children: [
-            { title: '销售数量', dataIndex: 'bondAmount', width: '8%', align: 'center', customRender: function (text) { return text && toThousands(text, 2) || '--' }, sorter: true },
-            { title: '销售金额', dataIndex: 'bondAmount', width: '8%', align: 'center', customRender: function (text) { return text && toThousands(text, 2) || '--' }, sorter: true }
+            { title: '销售数量', dataIndex: 'saleOrderQty', width: '8%', align: 'center', customRender: function (text) { return text && toThousands(text, 2) || '--' }, sorter: true },
+            { title: '销售金额', dataIndex: 'saleOrderAmount', width: '8%', align: 'center', customRender: function (text) { return text && toThousands(text, 2) || '--' }, sorter: true }
           ]
         }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
-        return orderBillQueryPage(Object.assign(parameter, this.queryParam)).then(res => {
+        return queryShelfOrderReportPage(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -192,6 +198,7 @@ export default {
               _item.no = no + i + 1
             }
           }
+          this.getStatistics()
           this.spinning = false
           return data
         })
@@ -202,29 +209,21 @@ export default {
     handleBack () {
       this.$router.go(-1)
     },
-    //  时间  change
-    dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
-    },
-    //  时间  change
+    //  下单时间  change
     orderDateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
-    // 经销商 change
-    dealerChange (obj) {
-      this.queryParam.dealerSn = obj.key || undefined
-    },
-    // 汽车修理厂 change
-    storeChange (obj) {
-      this.queryParam.storeSn = obj.key || undefined
-    },
     // 重置
     reset () {
       this.queryParam = {
-        shelfName: '',
-        state: undefined
+        providerSn: '',
+        beginDate: '',
+        endDate: '',
+        qhslMin: undefined,
+        qhslMax: undefined,
+        xsslMin: undefined,
+        xsslMax: undefined
       }
       this.$refs.table.refresh(true)
     },
@@ -237,6 +236,15 @@ export default {
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 250
+    },
+    getStatistics () { // 统计
+      queryShelfOrderTotalReport({}).then(res => {
+        if (res.status == 200) {
+          this.statisticsObj = res.data
+        } else {
+          this.$message.error(res.message)
+        }
+      })
     }
   },
   watch: {