chenrui 2 anni fa
parent
commit
2f412792ed

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

@@ -9,7 +9,7 @@
     @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>

+ 42 - 47
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,7 +26,7 @@
           <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">
@@ -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 }}</strong>次;
         </div>
         <div>
-          空调滤清器 有适配:<strong>800</strong>次,<strong>80</strong>%;无适配:<strong>800</strong>次,<strong>80</strong>%;空(--):<strong>80</strong>次,<strong>5</strong>%;
+          空调滤清器 有适配:<strong>{{ queryCountData }}</strong>次,<strong>{{ queryCountData }}</strong>%;无适配:<strong>{{ queryCountData }}</strong>次,<strong>{{ queryCountData }}</strong>%;空(--):<strong>{{ queryCountData }}</strong>次,<strong>{{ queryCountData }}</strong>%;
         </div>
         <div>
-          空气滤清器 有适配:<strong>800</strong>次,<strong>80</strong>%;无适配:<strong>800</strong>次,<strong>80</strong>%;空(--):<strong>80</strong>次,<strong>5</strong>%;
+          空气滤清器 有适配:<strong>{{ queryCountData }}</strong>次,<strong>{{ queryCountData }}</strong>%;无适配:<strong>{{ queryCountData }}</strong>次,<strong>{{ queryCountData }}</strong>%;空(--):<strong>{{ queryCountData }}</strong>次,<strong>{{ queryCountData }}</strong>%;
         </div>
         <div>
-          机油滤清器 有适配:<strong>800</strong>次,<strong>80</strong>%;无适配:<strong>800</strong>次,<strong>80</strong>%;空(--):<strong>80</strong>次,<strong>5</strong>%;
+          机油滤清器 有适配:<strong>{{ queryCountData }}</strong>次,<strong>{{ queryCountData }}</strong>%;无适配:<strong>{{ queryCountData }}</strong>次,<strong>{{ queryCountData }}</strong>%;空(--):<strong>{{ queryCountData }}</strong>次,<strong>{{ queryCountData }}</strong>%;
         </div>
       </div>
     </a-alert>
@@ -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, exportShelfActiveUser } 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.spinning = false
           return data
         })
       },
-      totalData: null, //  合计
+      queryCountData: null,
       shelfName: '',
       showColItem: [
         { label: '空调滤清器', value: 'kt' },
@@ -172,10 +172,11 @@ 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: '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: '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: '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') {
@@ -195,17 +196,17 @@ export default {
     shelfChange (v, row) {
       this.shelfName = row ? row.shelfName : ''
     },
-    // 
-    getCount (params) {
-      reportSalesBillCount(params).then(res => {
+    // 累积扫描VIN次数统
+    getQueryCount () {
+      queryCount().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] || ''
@@ -228,30 +229,24 @@ export default {
       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.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, '销售报表')
+          exportShelfActiveUser(params).then(res => {
+            downloadExcel(res, 'VIN分析表')
             _this.exportLoading = false
             _this.spinning = false
           })
@@ -267,22 +262,22 @@ export default {
       )
     },
     handleDetail (row) {
-      this.curItem = row
-      this.showDetail = true
-    },
-    pageInit () {
+      queryDetail({ id: row.id }).then(res => {
+        if (res.status == 200) {
+          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()
     }
   },