Sfoglia il codice sorgente

Merge branch 'develop_szhj05' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into develop_szhj05

# Conflicts:
#	public/version.json
lilei 2 anni fa
parent
commit
fba7811fa9

+ 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": 1666665812993
+  "version": 1666665867407
 }

+ 35 - 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,37 @@ 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'
+  })
+}
+
+// 客户分析-统计
+
+export const exportShelfOrderReport = (params) => {
+  return axios({
+    url: `/shelfOrderReport/exportShelfOrderReport`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 61 - 0
src/api/vinLog.js

@@ -0,0 +1,61 @@
+import { axios } from '@/utils/request'
+
+// VIN扫描纪录 - 分页数据
+export const queryPage = (params) => {
+  const url = `/vinLog/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  VIN扫描纪录 - 统计
+export const queryCount = (params) => {
+  return axios({
+    url: `/vinLog/queryCount`,
+    data: params,
+    method: 'post'
+  })
+}
+//  VIN扫描纪录 - 查看详情
+export const queryDetail = (params) => {
+  return axios({
+    url: `/vinLog/queryScanVinLogDetail`,
+    data: params,
+    method: 'post'
+  })
+}
+
+//  VIN扫描纪录 - 导出
+export const exportVinLog = (params) => {
+  return axios({
+    url: `/vinLog/exportVinLog`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+
+// 适配产品统计 - 分页数据
+
+export const reportPage = (params) => {
+  const url = `/vinFitReport/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 适配产品统计 - 导出
+export const exportReport = (params) => {
+  return axios({
+    url: `/vinFitReport/exportReport`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 10 - 1
src/views/chainReportData/chainSalesDetailsCountReport/list.vue

@@ -33,6 +33,11 @@
                 </a-select>
               </a-form-model-item>
             </a-col>
+            <a-col :md="2" :sm="8" style="margin-top: 6px;">
+              <a-checkbox @change="onChange" :default-checked="queryParam.oosFlag">
+                包含急件
+              </a-checkbox>
+            </a-col>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainSalesDetailsCountReportList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainSalesDetailsCountReportList-reset">重置</a-button>
@@ -82,7 +87,8 @@ export default {
         tenantId: undefined,
         time: [],
         beginDate: '',
-        endDate: ''
+        endDate: '',
+        oosFlag: true
       },
       rules: {
         'time': [{ required: true, message: '请选择审核日期', trigger: 'change' }]
@@ -157,6 +163,9 @@ export default {
     }
   },
   methods: {
+    onChange (e) {
+      this.queryParam.oosFlag = e.target.checked
+    },
     //  创建时间  change
     dateChange (date) {
       this.queryParam.time = date

+ 80 - 45
src/views/numsGoodsShelves/customerAnalysis/list.vue

@@ -3,11 +3,11 @@
     <a-card size="small" :bordered="false">
       <a-spin :spinning="spinning" tip="Loading...">
         <div ref="tableSearch" class="table-page-search-wrapper">
-          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-form-model 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">
@@ -68,30 +68,36 @@
               <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
                 <a-button type="primary" @click="$refs.table.refresh(true)" id="userd-refresh">查询</a-button>
                 <a-button type="" @click="reset" style="margin-left: 10px;" id="userd-reset">重置</a-button>
-                <a-button type="primary" class="button-warning" style="margin-left: 10px;" id="userd-reset">导出</a-button>
+                <a-button
+                  type="primary"
+                  @click="handleExport"
+                  :loading="exportLoading"
+                  class="button-warning"
+                  style="margin-left: 10px;"
+                  id="vinAnaly-export-btn">导出</a-button>
                 <a @click="advanced=!advanced" style="margin-left: 8px">
                   {{ advanced ? '收起' : '展开' }}
                   <a-icon :type="advanced ? 'up' : 'down'"/>
                 </a>
               </a-col>
             </a-row>
-          </a-form>
-        </div>
-        <div class="table-operator">
+            </a-form>
+          </a-form-model></div>
+        <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 +133,8 @@ 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 { downloadExcel } from '@/libs/JGPrint.js'
+import { queryShelfOrderReportPage, queryShelfOrderTotalReport, exportShelfOrderReport } from '@/api/shelf'
 export default {
   name: 'UserList',
   components: { STable, VSelect, rangeDate, shelfSList },
@@ -140,49 +147,59 @@ export default {
       orderTime: [],
       // 查询参数
       queryParam: {
-        shelfName: '',
-        state: undefined
+        providerSn: '',
+        beginDate: '',
+        endDate: '',
+        qhslMin: undefined,
+        qhslMax: undefined,
+        xsslMin: undefined,
+        xsslMax: undefined
       },
+      exportLoading: false,
       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 }
           ]
         }
       ],
+      rules: {
+        'providerSn': [{ required: true, message: '请选择货架', trigger: 'change' }]
+      },
       // 加载数据方法 必须为 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 +209,7 @@ export default {
               _item.no = no + i + 1
             }
           }
+          this.getStatistics(this.queryParam)
           this.spinning = false
           return data
         })
@@ -202,30 +220,23 @@ 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.orderDate.resetDate()
       this.$refs.table.refresh(true)
     },
     pageInit () {
@@ -237,6 +248,27 @@ export default {
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 250
+    },
+    getStatistics (ajaxData) { // 统计
+      queryShelfOrderTotalReport(ajaxData).then(res => {
+        if (res.status == 200) {
+          this.statisticsObj = res.data
+        } else {
+          this.$message.error(res.message)
+        }
+      })
+    },
+    // 导出
+    handleExport () {
+      const _this = this
+      const params = _this.queryParam
+      _this.exportLoading = true
+      _this.spinning = true
+      exportShelfOrderReport(params).then(res => {
+        downloadExcel(res, '客户分析表')
+        _this.exportLoading = false
+        _this.spinning = false
+      })
     }
   },
   watch: {
@@ -271,4 +303,7 @@ export default {
       margin-bottom: 6px;
     }
   }
+  .ant-select{
+    max-width: 300px !important;
+  }
 </style>

+ 24 - 30
src/views/numsGoodsShelves/vinAnalysis/detailModal.vue

@@ -9,15 +9,15 @@
     @cancel="isShow=false"
     width="60%">
     <!-- 详情 -->
-    <div v-if="detailsData">
+    <div v-if="itemData">
       <a-descriptions :column="2" size="default">
-        <a-descriptions-item label="扫描时间">{{ itemData&&itemData.settleTime || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="VIN">{{ itemData&&itemData.settleNo || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="车型" :span="1">{{ itemData&&itemData.bizNo || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="扫描时间">{{ itemData.scanTime || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="VIN">{{ itemData.vinCode || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="车型" :span="1">{{ itemData.carType || '--' }}</a-descriptions-item>
       </a-descriptions>
     </div>
     <!-- 表格 -->
-    <div class="table-body">
+    <div class="table-body" v-if="itemData">
       <table>
         <tr>
           <th width="10%">产品分类</th>
@@ -28,31 +28,31 @@
           <th width="10%">当前可用库存数量</th>
         </tr>
         <!-- 空调滤清器 -->
-        <tr v-for="(item,index) in 5">
+        <tr v-for="(item,index) in itemData.airConditionerFilter">
           <td v-if="index==0" rowspan="5">空调滤清器</td>
-          <td>K-234433</td>
-          <td>撒打发士大夫啊手动阀啊打发案说法</td>
-          <td>--</td>
-          <td></td>
-          <td>3</td>
+          <td>{{ item.productCode|| '--' }}</td>
+          <td>{{ item.productName|| '--' }}</td>
+          <td>{{ item.origCode || '--' }}</td>
+          <td>{{ item.isShelfProduct|| '--' }}</td>
+          <td>{{ item.currQty || '--' }}</td>
         </tr>
         <!-- 空气滤清器 -->
-        <tr v-for="(item,index) in 3">
+        <tr v-for="(item,index) in itemData.airFilterFlag">
           <td v-if="index==0" rowspan="3">空气滤清器</td>
-          <td>K-234433</td>
-          <td>撒打发士大夫啊手动阀啊打发案说法</td>
-          <td>--</td>
-          <td></td>
-          <td>3</td>
+          <td>{{ item.productCode|| '--' }}</td>
+          <td>{{ item.productName|| '--' }}</td>
+          <td>{{ item.origCode || '--' }}</td>
+          <td>{{ item.isShelfProduct|| '--' }}</td>
+          <td>{{ item.currQty || '--' }}</td>
         </tr>
         <!-- 机油滤清器 -->
-        <tr v-for="(item,index) in 6">
+        <tr v-for="(item,index) in itemData.engineOilFilterFlag">
           <td v-if="index==0" rowspan="6">机油滤清器</td>
-          <td>K-234433</td>
-          <td>撒打发士大夫啊手动阀啊打发案说法</td>
-          <td>--</td>
-          <td></td>
-          <td>3</td>
+          <td>{{ item.productCode|| '--' }}</td>
+          <td>{{ item.productName|| '--' }}</td>
+          <td>{{ item.origCode || '--' }}</td>
+          <td>{{ item.isShelfProduct|| '--' }}</td>
+          <td>{{ item.currQty || '--' }}</td>
         </tr>
       </table>
     </div>
@@ -77,13 +77,7 @@ export default {
   },
   data () {
     return {
-      isShow: this.openModal, //  是否打开弹框
-      list: []
-    }
-  },
-  methods: {
-    getDetailList (id) {
-
+      isShow: this.openModal//  是否打开弹框
     }
   },
   watch: {

+ 1 - 1
src/views/numsGoodsShelves/vinAnalysis/index.vue

@@ -3,7 +3,7 @@
     <div style="background-color: #fff;margin-bottom: 5px;">
       <a-tabs default-active-key="1" v-model="curTab">
         <a-tab-pane key="1" tab="VIN扫描记录"></a-tab-pane>
-        <a-tab-pane key="2" tab="适配产品统计" force-render></a-tab-pane>
+        <a-tab-pane key="2" tab="适配产品统计"></a-tab-pane>
       </a-tabs>
     </div>
     <a-card size="small" :bordered="false">

+ 43 - 63
src/views/numsGoodsShelves/vinAnalysis/spList.vue

@@ -20,23 +20,23 @@
           </a-col>
           <a-col :md="4" :sm="24">
             <a-form-model-item label="产品编码">
-              <a-input id="vinAnaly-VIN" v-model.trim="queryParam.vin" allowClear placeholder="请输入产品编码"/>
+              <a-input id="vinAnaly-VIN" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
             </a-form-model-item>
           </a-col>
           <a-col :md="4" :sm="24">
             <a-form-model-item label="产品名称">
-              <a-input id="vinAnaly-VIN" v-model.trim="queryParam.vin" allowClear placeholder="请输入产品名称"/>
+              <a-input id="vinAnaly-VIN" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
             </a-form-model-item>
           </a-col>
           <a-col :md="4" :sm="24">
             <a-form-model-item label="原厂编码">
-              <a-input id="vinAnaly-VIN" v-model.trim="queryParam.vin" allowClear placeholder="请输入VIN"/>
+              <a-input id="vinAnaly-VIN" v-model.trim="queryParam.origCode" allowClear placeholder="请输入VIN"/>
             </a-form-model-item>
           </a-col>
           <template v-if="advanced">
             <a-col :md="5" :sm="24">
               <a-form-item label="产品品牌">
-                <ProductBrand placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
+                <ProductBrand placeholder="请选择产品品牌" v-model="queryParam.brandSn"></ProductBrand>
               </a-form-item>
             </a-col>
             <a-col :md="5" :sm="24">
@@ -44,33 +44,9 @@
                 <ProductType placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
               </a-form-item>
             </a-col>
-            <a-col :md="5" :sm="24">
-              <a-form-item label="适配缺货次数">
-                <a-input-group compact>
-                  <a-input-number
-                    :precision="0"
-                    style=" width: 42%; text-align: center"
-                    v-model.trim="queryParam.qhslMin"
-                    allowClear
-                    placeholder="最小值"/>
-                  <a-input
-                    style=" width: 16%; pointer-events: none; backgroundColor: #fff"
-                    placeholder="~"
-                    disabled
-                  />
-                  <a-input-number
-                    :precision="0"
-                    :min="queryParam.qhslMin"
-                    style=" width: 42%; text-align: center"
-                    v-model.trim="queryParam.qhslMax"
-                    allowClear
-                    placeholder="最大值"/>
-                </a-input-group>
-              </a-form-item>
-            </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="最近VIN扫描时间">
-                <rangeDate ref="rangeDate" v-model="time" @change="dateChange" />
+                <rangeDate ref="scanDate" v-model="time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
           </template>
@@ -125,7 +101,7 @@ import { downloadExcel } from '@/libs/JGPrint.js'
 import shelfSList from '@/views/common/shelfList'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
-import { reportSalesBillList, reportSalesBillCount, reportSalesBillExport } from '@/api/reportData'
+import { reportPage, exportReport } from '@/api/vinLog'
 export default {
   components: { STable, VSelect, rangeDate, shelfSList, ProductType, ProductBrand },
   mixins: [commonMixin],
@@ -140,14 +116,14 @@ export default {
       queryParam: { //  查询条件
         beginDate: '',
         endDate: '',
-        shelfSn: undefined,
-        code: '', //  产品编码
-        name: '', //  产品名称
-        origCode: '', //  原厂编码
-        productBrandSn: undefined, //  产品品牌
-        productTypeSn1: '', //  产品一级分类
-        productTypeSn2: '', //  产品二级分类
-        productTypeSn3: '' //  产品三级分类
+        shelfSn: '',
+        productCode: undefined, //  产品编码
+        productName: undefined, //  产品名称
+        origCode: undefined, // 原厂编码
+        brandSn: undefined, //  产品品牌
+        productTypeSn1: undefined, //  产品一级分类
+        productTypeSn2: undefined, //  产品二级分类
+        productTypeSn3: undefined //  产品三级分类
       },
       time: [],
       rules: {
@@ -157,11 +133,12 @@ export default {
       exportLoading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
+        this.spinning = true
         this.disabled = true
         const params = Object.assign(parameter, this.queryParam)
-        this.spinning = true
+
         delete params.time
-        return reportSalesBillList(params).then(res => {
+        return reportPage(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -183,14 +160,14 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '产品编码', dataIndex: 'salesAuditDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'salesAuditDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'salesAuditDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品品牌', dataIndex: 'salesAuditDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品分类', dataIndex: 'salesAuditDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '适配有货次数', dataIndex: 'salesAuditDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
-        { title: '适配缺货次数', dataIndex: 'salesAuditDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
-        { title: '最近VIN扫描时间', dataIndex: 'settleStyleSnDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true }
+        { title: '产品编码', dataIndex: ' productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'origCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'brandSn', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', dataIndex: 'type', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '适配有货次数', dataIndex: 'cishu', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
+        { title: '适配缺货次数', dataIndex: 'que', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
+        { title: '最近VIN扫描时间', dataIndex: 'createDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true }
       ]
       return arr
     }
@@ -224,21 +201,25 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
+      this.queryParam = {
+        beginDate: '',
+        endDate: '',
+        shelfSn: '',
+        productCode: undefined, //  产品编码
+        productName: undefined, //  产品名称
+        origCode: undefined, // 原厂编码
+        brandSn: undefined, //  产品品牌
+        productTypeSn1: undefined, //  产品一级分类
+        productTypeSn2: undefined, //  产品二级分类
+        productTypeSn3: undefined //  产品三级分类
+      }
       this.time = []
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
-
-      this.queryParam.salesTargetName = ''
-      this.queryParam.salesTargetType = undefined
-      this.queryParam.provinceSn = undefined
-      this.queryParam.citySn = undefined
-      this.queryParam.countySn = undefined
-      this.queryParam.settleStyleSn = undefined
-      this.queryParam.salesBillNo = ''
-      this.queryParam.salesManName = ''
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
+      this.$refs.table.refresh(true)
+      if (this.advanced) {
+        this.$refs.scanDate.resetDate()
+      }
     },
     // 导出
     handleExport () {
@@ -246,11 +227,10 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const params = _this.queryParam
-          params.showCost = this.$hasPermissions('M_ShowAllCost') ? '1' : '0'
           _this.exportLoading = true
           _this.spinning = true
-          reportSalesBillExport(params).then(res => {
-            downloadExcel(res, '销售报表')
+          exportReport(params).then(res => {
+            downloadExcel(res, '适配产品统计报表')
             _this.exportLoading = false
             _this.spinning = false
           })

+ 55 - 60
src/views/numsGoodsShelves/vinAnalysis/vinList.vue

@@ -14,8 +14,8 @@
         @keyup.enter.native="handleSearch" >
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
-            <a-form-model-item label="货架名称" prop="shelfSn">
-              <shelfSList v-model="queryParam.shelfSn" @change="shelfChange"></shelfSList>
+            <a-form-model-item label="货架名称" prop="shelf_sn">
+              <shelfSList v-model="queryParam.shelf_sn" @change="shelfChange"></shelfSList>
             </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -26,17 +26,17 @@
           <template v-if="advanced">
             <a-col :md="4" :sm="24">
               <a-form-model-item label="vin">
-                <a-input id="vinAnaly-VIN" v-model.trim="queryParam.vin" allowClear placeholder="请输入VIN"/>
+                <a-input id="vinAnaly-VIN" v-model.trim="queryParam.vinCode" allowClear placeholder="请输入VIN"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="4" :sm="24">
               <a-form-model-item label="车辆品牌">
-                <a-input id="vinAnaly-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入车辆品牌"/>
+                <a-input id="vinAnaly-salesBillNo" v-model.trim="queryParam.brandName" allowClear placeholder="请输入车辆品牌"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="4" :sm="24">
               <a-form-model-item label="车型">
-                <a-input id="vinAnaly-salesManName" v-model.trim="queryParam.salesManName" allowClear placeholder="请输入车型"/>
+                <a-input id="vinAnaly-salesManName" v-model.trim="queryParam.modelName" allowClear placeholder="请输入车型"/>
               </a-form-model-item>
             </a-col>
           </template>
@@ -60,19 +60,19 @@
       </a-form-model>
     </div>
     <!-- 合计 -->
-    <a-alert type="info" style="margin-bottom:10px">
+    <a-alert type="info" style="margin-bottom:10px" v-if="queryCountData">
       <div class="ftext" slot="message">
         <div>
-          累计扫描VIN:<strong>1000</strong>次;
+          累计扫描VIN:<strong>{{ queryCountData.scanCount }}</strong>次;
         </div>
         <div>
-          空调滤清器 有适配:<strong>800</strong>次,<strong>80</strong>%;无适配:<strong>800</strong>次,<strong>80</strong>%;空(--):<strong>80</strong>次,<strong>5</strong>%
+          空调滤清器 有适配:<strong>{{ queryCountData.airConditionerFilterOnShelfCount }}</strong>次,<strong>{{ queryCountData.airConditionerFilterOnShelfRate }}</strong>;无适配:<strong>{{ queryCountData.airConditionerFilterOffShelfCount }}</strong>次,<strong>{{ queryCountData.airConditionerFilterOffShelfRate }}</strong>;空(--):<strong>{{ queryCountData.airConditionerFilterNotExistCount }}</strong>次,<strong>{{ queryCountData.airConditionerFilterNotExistRate }}</strong>
         </div>
         <div>
-          空气滤清器 有适配:<strong>800</strong>次,<strong>80</strong>%;无适配:<strong>800</strong>次,<strong>80</strong>%;空(--):<strong>80</strong>次,<strong>5</strong>%
+          空气滤清器 有适配:<strong>{{ queryCountData.airFilterOnShelfCount }}</strong>次,<strong>{{ queryCountData.airFilterOnShelfRate }}</strong>;无适配:<strong>{{ queryCountData.airFilterOffShelfCount }}</strong>次,<strong>{{ queryCountData.airFilterOffShelfRate }}</strong>;空(--):<strong>{{ queryCountData.airFilterNotExistCount }}</strong>次,<strong>{{ queryCountData.airFilterNotExistRate }}</strong>
         </div>
         <div>
-          机油滤清器 有适配:<strong>800</strong>次,<strong>80</strong>%;无适配:<strong>800</strong>次,<strong>80</strong>%;空(--):<strong>80</strong>次,<strong>5</strong>%
+          机油滤清器 有适配:<strong>{{ queryCountData.engineOilFilterOnShelfCount }}</strong>次,<strong>{{ queryCountData.engineOilFilterOnShelfRate }}</strong>;无适配:<strong>{{ queryCountData.engineOilFilterOffShelfCount }}</strong>次,<strong>{{ queryCountData.engineOilFilterOffShelfRate }}</strong>;空(--):<strong>{{ queryCountData.engineOilFilterNotExistCount }}</strong>次,<strong>{{ queryCountData.engineOilFilterNotExistRate }}</strong>
         </div>
       </div>
     </a-alert>
@@ -95,7 +95,7 @@
       <!-- vin -->
       <template slot="vin" slot-scope="text, record">
         <div>
-          <span class="table-td-link" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
+          <span class="table-td-link" @click="handleDetail(record)">{{ record.vinCode }}</span>
         </div>
       </template>
     </s-table>
@@ -111,7 +111,7 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import { downloadExcel } from '@/libs/JGPrint.js'
 import shelfSList from '@/views/common/shelfList'
 import detailModal from './detailModal'
-import { reportSalesBillList, reportSalesBillCount, reportSalesBillExport } from '@/api/reportData'
+import { queryPage, queryCount, queryDetail, exportVinLog } from '@/api/vinLog'
 export default {
   components: { STable, VSelect, rangeDate, shelfSList, detailModal },
   mixins: [commonMixin],
@@ -125,11 +125,14 @@ export default {
       queryParam: { //  查询条件
         beginDate: '',
         endDate: '',
-        shelfSn: undefined
+        vinCode: undefined,
+        shelf_sn: undefined,
+        brandName: undefined,
+        modelName: undefined
       },
       time: [],
       rules: {
-        'shelfSn': [{ required: true, message: '请选择货架', trigger: 'change' }]
+        'shelf_sn': [{ required: true, message: '请选择货架', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
@@ -138,24 +141,21 @@ export default {
         this.disabled = true
         const params = Object.assign(parameter, this.queryParam)
         this.spinning = true
-        delete params.time
-        return reportSalesBillList(params).then(res => {
+        return queryPage(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
-            // 总计
-            this.getCount(params)
             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.getQueryCount(this.queryParam)
           this.spinning = false
           return data
         })
       },
-      totalData: null, //  合计
+      queryCountData: null,
       shelfName: '',
       showColItem: [
         { label: '空调滤清器', value: 'kt' },
@@ -163,7 +163,7 @@ export default {
         { label: '机油滤清器', value: 'jy' }
       ],
       showCol: ['kt', 'kq', 'jy'],
-      filters: [{ text: '有', value: '1' }, { text: '无', value: '0' }, { text: '空(--)', value: '' }],
+      filters: [{ text: '有', value: 1 }, { text: '无', value: 2 }, { text: '空(--)', value: 0 }],
       showDetail: false,
       curItem: null
     }
@@ -172,20 +172,21 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '扫描时间', dataIndex: 'salesAuditDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '扫描时间', dataIndex: 'createDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: 'VIN', dataIndex: 'vinCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: 'VIN', scopedSlots: { customRender: 'vin' }, width: '15%', align: 'center' },
-        { title: '车辆品牌', dataIndex: 'settleStyleSnDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '车型', dataIndex: 'salesManName', width: '24%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+        { title: '车辆品牌', dataIndex: 'brandName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '车型', dataIndex: 'modelName', width: '24%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ]
       this.showCol.map(item => {
         if (item == 'kt') {
-          arr.push({ title: '空调滤清器适配', dataIndex: 'totalCategory', filters: this.filters, width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+          arr.push({ title: '空调滤清器适配', dataIndex: 'airConditionerFilterFlag', filters: this.filters, filterMultiple: false, width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
         }
         if (item == 'kq') {
-          arr.push({ title: '空气滤清器适配', dataIndex: 'totalProfit', filters: this.filters, width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+          arr.push({ title: '空气滤清器适配', dataIndex: 'airFilterFlag', filters: this.filters, filterMultiple: false, width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
         }
         if (item == 'jy') {
-          arr.push({ title: '机油滤清器适配', dataIndex: 'totalCost', filters: this.filters, width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+          arr.push({ title: '机油滤清器适配', dataIndex: 'engineOilFilterFlag', filters: this.filters, filterMultiple: false, width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
         }
       })
       return arr
@@ -195,17 +196,17 @@ export default {
     shelfChange (v, row) {
       this.shelfName = row ? row.shelfName : ''
     },
-    // 
-    getCount (params) {
-      reportSalesBillCount(params).then(res => {
+    // 累积扫描VIN次数统
+    getQueryCount (ajaxData) {
+      queryCount(ajaxData).then(res => {
         if (res.status == 200) {
-          this.totalData = res.data
+          this.queryCountData = res.data
         } else {
-          this.totalData = null
+          this.queryCountData = null
         }
       })
     },
-    //  创建时间  change
+    //  扫描时间  change
     dateChange (date) {
       this.time = date
       this.queryParam.beginDate = date[0] || ''
@@ -224,34 +225,27 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
-      this.time = []
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
-
-      this.queryParam.salesTargetName = ''
-      this.queryParam.salesTargetType = undefined
-      this.queryParam.provinceSn = undefined
-      this.queryParam.citySn = undefined
-      this.queryParam.countySn = undefined
-      this.queryParam.settleStyleSn = undefined
-      this.queryParam.salesBillNo = ''
-      this.queryParam.salesManName = ''
+      this.queryParam.vinCode = undefined
+      this.queryParam.shelf_sn = undefined
+      this.queryParam.brandName = undefined
+      this.queryParam.modelName = undefined
+      this.$refs.rangeDate.resetDate(this.time)
       this.$refs.ruleForm.resetFields()
-      this.totalData = null
-      this.$refs.table.clearTable()
+      this.$refs.table.refresh(true)
     },
+
     // 导出
     handleExport () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const params = _this.queryParam
-          params.showCost = this.$hasPermissions('M_ShowAllCost') ? '1' : '0'
           _this.exportLoading = true
           _this.spinning = true
-          reportSalesBillExport(params).then(res => {
-            downloadExcel(res, '销售报表')
+          exportVinLog(params).then(res => {
+            downloadExcel(res, 'VIN分析表')
             _this.exportLoading = false
             _this.spinning = false
           })
@@ -261,28 +255,29 @@ export default {
         }
       })
     },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
     handleDetail (row) {
-      this.curItem = row
-      this.showDetail = true
-    },
-    pageInit () {
+      queryDetail({ id: row.id }).then(res => {
+        if (res.status == 200) {
+          const detailObj = {
+            vinCode: row.vinCode,
+            scanTime: row.createDate,
+            carType: row.modelName
+          }
+          Object.assign(res.data, detailObj)
+          this.curItem = res.data
+          this.showDetail = true
+        }
+      })
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
       this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.pageInit()
       this.resetSearchForm()
     }
   },