浏览代码

修改vin分析

chenrui 2 年之前
父节点
当前提交
d0914fb834
共有 2 个文件被更改,包括 99 次插入70 次删除
  1. 43 31
      src/views/numsGoodsShelves/vinAnalysis/spList.vue
  2. 56 39
      src/views/numsGoodsShelves/vinAnalysis/vinList.vue

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

@@ -69,27 +69,33 @@
         </a-row>
       </a-form-model>
     </div>
-    <div class="t-title" style="display: flex;align-items: center;justify-content: space-between;padding:5px 0;">
-      <div style="border-left:2px solid #eee;padding:0 5px;font-weight: bold;font-size:14px;">{{ shelfName||'' }}</div>
-      <div></div>
+    <div v-show="isSearchFlag">
+      <div class="t-title" style="display: flex;align-items: center;justify-content: space-between;padding:5px 0;">
+        <div style="border-left:2px solid #eee;padding:0 5px;font-weight: bold;font-size:14px;">{{ shelfName||'' }}</div>
+        <div></div>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :defaultLoadData="false"
+        bordered>
+        <template slot="type" slot-scope="text, record">
+          <div>
+            {{ record.productTypeSn2 }}->{{ record.productTypeSn3 }}
+          </div>
+        </template>
+      </s-table>
+    </div>
+    <div class="unChoose" v-show="!isSearchFlag">
+      <a-icon type="exclamation-circle" theme="filled" :style="{ fontSize: '18px', color: '#ff9900', verticalAlign: 'sub', marginRight: '5px' }" />
+      <span>请选择一个货架后点击查询按钮</span>
+    </div>
     </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :defaultLoadData="false"
-      bordered>
-      <!-- vin -->
-      <template slot="vin" slot-scope="text, record">
-        <div>
-          <span class="table-td-link" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
-        </div>
-      </template>
-    </s-table>
   </a-spin>
 </template>
 
@@ -125,6 +131,7 @@ export default {
         productTypeSn2: undefined, //  产品二级分类
         productTypeSn3: undefined //  产品三级分类
       },
+      isSearchFlag: false,
       time: [],
       rules: {
         'shelfSn': [{ required: true, message: '请选择货架', trigger: 'change' }]
@@ -160,14 +167,14 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '产品编码', dataIndex: ' productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { 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 }
+        { title: '产品品牌', dataIndex: 'brandName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', slots: { title: 'type' }, scopedSlots: { customRender: 'type' }, width: '10%', align: 'center' },
+        { title: '适配有货次数', dataIndex: 'isStockCount', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
+        { title: '适配缺货次数', dataIndex: 'notStockCount', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
+        { title: '最近VIN扫描时间', dataIndex: 'scanVinDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true }
       ]
       return arr
     }
@@ -192,6 +199,7 @@ export default {
     handleSearch () {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
+          this.isSearchFlag = true
           this.$refs.table.refresh(true)
         } else {
           console.log('error submit!!')
@@ -201,6 +209,7 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.isSearchFlag = false
       this.queryParam = {
         beginDate: '',
         endDate: '',
@@ -216,7 +225,7 @@ export default {
       this.time = []
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
-      this.$refs.table.refresh(true)
+      this.handleSearch()
       if (this.advanced) {
         this.$refs.scanDate.resetDate()
       }
@@ -248,20 +257,16 @@ export default {
     handleDetail (row) {
       this.curItem = row
       this.showDetail = true
-    },
-    pageInit () {
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
       this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.pageInit()
       this.resetSearchForm()
     }
   },
@@ -270,3 +275,10 @@ export default {
   }
 }
 </script>
+<style lang="less" scoped>
+  .unChoose {
+    text-align: center;
+    margin: 280px 0 340px;
+    font-size: 16px;
+  }
+</style>

+ 56 - 39
src/views/numsGoodsShelves/vinAnalysis/vinList.vue

@@ -59,46 +59,52 @@
         </a-row>
       </a-form-model>
     </div>
-    <!-- 合计 -->
-    <a-alert type="info" style="margin-bottom:10px" v-if="queryCountData">
-      <div class="ftext" slot="message">
-        <div>
-          累计扫描VIN:<strong>{{ queryCountData.scanCount }}</strong>次;
-        </div>
-        <div>
-          空调滤清器 有适配:<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>{{ queryCountData.airFilterOnShelfCount }}</strong>次,<strong>{{ queryCountData.airFilterOnShelfRate }}</strong>;无适配:<strong>{{ queryCountData.airFilterOffShelfCount }}</strong>次,<strong>{{ queryCountData.airFilterOffShelfRate }}</strong>;空(--):<strong>{{ queryCountData.airFilterNotExistCount }}</strong>次,<strong>{{ queryCountData.airFilterNotExistRate }}</strong>;
+    <duv v-show="isSearch">
+      <!-- 合计 -->
+      <a-alert type="info" style="margin-bottom:10px" v-if="queryCountData">
+        <div class="ftext" slot="message">
+          <div>
+            累计扫描VIN:<strong>{{ queryCountData.scanCount }}</strong>次;
+          </div>
+          <div>
+            空调滤清器 有适配:<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>{{ 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>{{ 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>
+      <div class="t-title" style="display: flex;align-items: center;justify-content: space-between;padding:5px 0;">
+        <div style="border-left:2px solid #eee;padding:0 5px;font-weight: bold;font-size:14px;">{{ shelfName||'' }}</div>
         <div>
-          机油滤清器 有适配:<strong>{{ queryCountData.engineOilFilterOnShelfCount }}</strong>次,<strong>{{ queryCountData.engineOilFilterOnShelfRate }}</strong>;无适配:<strong>{{ queryCountData.engineOilFilterOffShelfCount }}</strong>次,<strong>{{ queryCountData.engineOilFilterOffShelfRate }}</strong>;空(--):<strong>{{ queryCountData.engineOilFilterNotExistCount }}</strong>次,<strong>{{ queryCountData.engineOilFilterNotExistRate }}</strong>;
+          <a-checkbox-group v-model="showCol" :options="showColItem" />
         </div>
       </div>
-    </a-alert>
-    <div class="t-title" style="display: flex;align-items: center;justify-content: space-between;padding:5px 0;">
-      <div style="border-left:2px solid #eee;padding:0 5px;font-weight: bold;font-size:14px;">{{ shelfName||'' }}</div>
-      <div>
-        <a-checkbox-group v-model="showCol" :options="showColItem" />
-      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :defaultLoadData="false"
+        bordered>
+        <!-- vin -->
+        <template slot="vin" slot-scope="text, record">
+          <div>
+            <span class="table-td-link" @click="handleDetail(record)">{{ record.vinCode }}</span>
+          </div>
+        </template>
+      </s-table>
+    </duv>
+    <div class="unChoose" v-show="!isSearch">
+      <a-icon type="exclamation-circle" theme="filled" :style="{ fontSize: '18px', color: '#ff9900', verticalAlign: 'sub', marginRight: '5px' }" />
+      <span>请选择一个货架后点击查询按钮</span>
     </div>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :defaultLoadData="false"
-      bordered>
-      <!-- vin -->
-      <template slot="vin" slot-scope="text, record">
-        <div>
-          <span class="table-td-link" @click="handleDetail(record)">{{ record.vinCode }}</span>
-        </div>
-      </template>
-    </s-table>
     <!-- 详情 -->
     <detailModal :openModal="showDetail" :itemData="curItem" @close="showDetail=false"></detailModal>
   </a-spin>
@@ -130,6 +136,7 @@ export default {
         brandName: undefined,
         modelName: undefined
       },
+      isSearch: false,
       time: [],
       rules: {
         'shelf_sn': [{ required: true, message: '请选择货架', trigger: 'change' }]
@@ -180,13 +187,13 @@ export default {
       ]
       this.showCol.map(item => {
         if (item == 'kt') {
-          arr.push({ title: '空调滤清器适配', dataIndex: 'airConditionerFilterFlag', filters: this.filters, filterMultiple: false, width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+          arr.push({ title: '空调滤清器适配', dataIndex: 'airConditionerFilterFlagDesc', filters: this.filters, filterMultiple: false, width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
         }
         if (item == 'kq') {
-          arr.push({ title: '空气滤清器适配', dataIndex: 'airFilterFlag', filters: this.filters, filterMultiple: false, width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+          arr.push({ title: '空气滤清器适配', dataIndex: 'airFilterFlagDesc', filters: this.filters, filterMultiple: false, width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
         }
         if (item == 'jy') {
-          arr.push({ title: '机油滤清器适配', dataIndex: 'engineOilFilterFlag', filters: this.filters, filterMultiple: false, width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+          arr.push({ title: '机油滤清器适配', dataIndex: 'engineOilFilterFlagDesc', filters: this.filters, filterMultiple: false, width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
         }
       })
       return arr
@@ -217,6 +224,7 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           this.$refs.table.refresh(true)
+          this.isSearch = true
         } else {
           console.log('error submit!!')
           return false
@@ -225,6 +233,7 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.isSearch = false
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
       this.queryParam.vinCode = undefined
@@ -233,7 +242,8 @@ export default {
       this.queryParam.modelName = undefined
       this.$refs.rangeDate.resetDate(this.time)
       this.$refs.ruleForm.resetFields()
-      this.$refs.table.refresh(true)
+      // this.$refs.table.refresh(true)
+      this.handleSearch()
     },
 
     // 导出
@@ -286,3 +296,10 @@ export default {
   }
 }
 </script>
+<style  lang="less" scoped>
+  .unChoose {
+    text-align: center;
+    margin: 280px 0 340px;
+    font-size: 16px;
+  }
+</style>