浏览代码

完善id和注释

lilei 11 月之前
父节点
当前提交
4a7079eba7

+ 1 - 1
public/version.json

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

+ 12 - 82
src/views/numsGoodsShelves/customerAnalysis/list.vue

@@ -7,64 +7,14 @@
             <a-row :gutter="10">
               <a-col :md="6" :sm="24">
                 <a-form-item label="下单时间">
-                  <rangeDate style="width: 100%;" ref="orderDate" :value="orderTime" @change="orderDateChange" />
+                  <rangeDate id="analysis-time" style="width: 100%;" ref="orderDate" :value="orderTime" @change="orderDateChange" />
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="货架名称" prop="shelfSn">
-                  <shelfSList style="width: 100%;" v-model="queryParam.shelfSn"></shelfSList>
+                  <shelfSList id="analysis-shelf" style="width: 100%;" v-model="queryParam.shelfSn"></shelfSList>
                 </a-form-model-item>
               </a-col>
-              <!-- <a-col :md="6" :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>
-              <template v-if="advanced">
-                <a-col :md="6" :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.xsslMin"
-                        allowClear
-                        placeholder="请输入最小值"/>
-                      <a-input
-                        style=" width: 16%; pointer-events: none; backgroundColor: #fff"
-                        placeholder="~"
-                        disabled
-                      />
-                      <a-input-number
-                        :precision="0"
-                        :min="queryParam.xsslMin"
-                        style=" width: 42%; text-align: center"
-                        v-model.trim="queryParam.xsslMax"
-                        allowClear
-                        placeholder="请输入最大值"/>
-                    </a-input-group>
-                  </a-form-item>
-                </a-col>
-              </template> -->
               <a-col :md="8" :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>
@@ -75,10 +25,6 @@
                   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-model></div>
@@ -142,25 +88,16 @@ export default {
     return {
       toThousands,
       spinning: false,
-      // advanced: false,
-      tableHeight: 0,
-      time: [],
-      orderTime: [],
+      tableHeight: 0, // 表格高度
+      orderTime: [], // 下单时间默认值
       // 查询参数
       queryParam: {
-        shelfSn: undefined,
-        beginDate: '',
-        endDate: ''
-        // qhslMin: undefined,
-        // qhslMax: undefined,
-        // xsslMin: undefined,
-        // xsslMax: undefined
+        shelfSn: undefined, // 货架sn
+        beginDate: '', // 开始时间
+        endDate: ''// 结束时间
       },
-      exportLoading: false,
-      showModal: false,
-      itemData: null, // 编辑行数据
-      openStatusModal: false, // 货架状态弹窗初始状态
-      statisticsObj: null,
+      exportLoading: false, // 导出按钮loading
+      statisticsObj: null, // 统计数据
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
@@ -218,6 +155,7 @@ export default {
     }
   },
   methods: {
+    // 返回
     handleBack () {
       this.$router.go(-1)
     },
@@ -232,20 +170,18 @@ export default {
         shelfSn: undefined,
         beginDate: '',
         endDate: ''
-        // qhslMin: undefined,
-        // qhslMax: undefined,
-        // xsslMin: undefined,
-        // xsslMax: undefined
       }
       this.$refs.orderDate.resetDate()
       this.$refs.table.refresh(true)
     },
+    // 页面初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 250
@@ -273,12 +209,6 @@ export default {
     }
   },
   watch: {
-    // advanced (newValue, oldValue) {
-    //   const _this = this
-    //   this.$nextTick(() => { // 页面渲染完成后的回调
-    //     _this.setTableH()
-    //   })
-    // },
     '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
       this.setTableH()
     }

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

@@ -68,7 +68,7 @@ export default {
       type: Boolean,
       default: false
     },
-    itemData: {
+    itemData: { // 当前数据
       type: Object,
       default: function () {
         return []
@@ -90,9 +90,6 @@ export default {
       if (!newValue) {
         this.$emit('close')
       }
-      // else {
-      //   this.getDetailList()
-      // }
     }
   }
 }

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

@@ -19,8 +19,8 @@ import spList from './spList.vue'
 export default {
   name: 'SalesReportIndex',
   components: {
-    vinList,
-    spList
+    vinList, // vin扫描记录
+    spList // 适配产品统计
   },
   data () {
     return {

+ 19 - 30
src/views/numsGoodsShelves/vinAnalysis/spList.vue

@@ -15,38 +15,38 @@
         <a-row :gutter="15">
           <a-col :md="5" :sm="24">
             <a-form-model-item label="货架名称" prop="shelfSn">
-              <shelfSList v-model="queryParam.shelfSn" @change="shelfChange"></shelfSList>
+              <shelfSList id="vinAnaly-shelf" v-model="queryParam.shelfSn" @change="shelfChange"></shelfSList>
             </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.productCode" allowClear placeholder="请输入产品编码"/>
+              <a-input id="vinAnaly-productCode" 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.productName" allowClear placeholder="请输入产品名称"/>
+              <a-input id="vinAnaly-productName" 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.origCode" allowClear placeholder="请输入原厂编码"/>
+              <a-input id="vinAnaly-origCode" v-model.trim="queryParam.origCode" allowClear placeholder="请输入原厂编码"/>
             </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.brandSn"></ProductBrand>
+                <ProductBrand id="vinAnaly-brandSn" placeholder="请选择产品品牌" v-model="queryParam.brandSn"></ProductBrand>
               </a-form-item>
             </a-col>
             <a-col :md="5" :sm="24">
               <a-form-item label="产品分类">
-                <ProductType placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
+                <ProductType id="vinAnaly-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="VIN扫描时间">
-                <rangeDate ref="scanDate" v-model="time" @change="dateChange" />
+                <rangeDate id="vinAnaly-scanDate" ref="scanDate" v-model="time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
           </template>
@@ -61,7 +61,7 @@
               :loading="exportLoading"
               class="button-warning"
               id="vinAnaly-export-btn">导出</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 5px">
+            <a @click="advanced=!advanced" style="margin-left: 5px" id="vinAnaly-advanced-btn">
               {{ advanced ? '收起' : '展开' }}
               <a-icon :type="advanced ? 'up' : 'down'"/>
             </a>
@@ -118,12 +118,12 @@ export default {
       labelCol: { span: 8 },
       wrapperCol: { span: 16 },
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      productType: [],
+      tableHeight: 0, // 表格高度
+      productType: [], // 产品类型默认值
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
-        shelfSn: undefined,
+        beginDate: '', // 开始时间
+        endDate: '', // 结束时间
+        shelfSn: undefined, // 货架
         productCode: undefined, //  产品编码
         productName: undefined, //  产品名称
         origCode: undefined, // 原厂编码
@@ -132,14 +132,14 @@ export default {
         productTypeSn2: undefined, //  产品二级分类
         productTypeSn3: undefined //  产品三级分类
       },
-      isSearchFlag: false,
-      time: [],
+      isSearchFlag: false, // 是否查询
+      time: [], // 时间默认值
       rules: {
         'shelfSn': [{ required: true, message: '请选择货架', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
-      order_by: '',
+      exportLoading: false, // 导出按钮loading
+      order_by: '', // 排序字段
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
@@ -186,8 +186,7 @@ export default {
           return data
         })
       },
-      shelfName: '',
-      filters: [{ text: '有', value: '1' }, { text: '无', value: '0' }, { text: '空(--)', value: '' }]
+      shelfName: '' // 货架名称
     }
   },
   computed: {
@@ -201,12 +200,12 @@ export default {
         { title: '产品分类', slots: { title: 'type' }, scopedSlots: { customRender: 'type' }, width: '10%', align: 'center' },
         { title: '适配有货次数', dataIndex: 'inStockCount', width: '10%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' }, sorter: (a, b) => a.inStockCount - b.inStockCount },
         { title: '适配缺货次数', dataIndex: 'notStockCount', width: '10%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' }, sorter: (a, b) => a.notStockCount - b.notStockCount }
-        // { title: '最近VIN扫描时间', dataIndex: 'scanVinDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true }
       ]
       return arr
     }
   },
   methods: {
+    // 选择货架
     shelfChange (v, row) {
       this.shelfName = row ? row.shelfName : ''
     },
@@ -273,19 +272,9 @@ export default {
             _this.spinning = false
           })
         } else {
-          console.log('error submit!!')
           return false
         }
       })
-    },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
-    handleDetail (row) {
-      this.curItem = row
-      this.showDetail = true
     }
   },
   mounted () {

+ 31 - 31
src/views/numsGoodsShelves/vinAnalysis/vinList.vue

@@ -15,34 +15,34 @@
         <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>
+              <shelfSList id="vinAnaly-form-shelfSn" v-model="queryParam.shelfSn" @change="shelfChange"></shelfSList>
             </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-model-item label="扫描时间">
-              <rangeDate ref="rangeDate" v-model="time" @change="dateChange" />
+              <rangeDate id="vinAnaly-form-time" ref="rangeDate" v-model="time" @change="dateChange" />
             </a-form-model-item>
           </a-col>
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
               <a-form-model-item label="VIN">
-                <a-input id="vinAnaly-VIN" v-model.trim="queryParam.vinCode" allowClear placeholder="请输入VIN"/>
+                <a-input id="vinAnaly-form-vinCode" v-model.trim="queryParam.vinCode" allowClear placeholder="请输入VIN"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="车辆品牌">
-                <a-input id="vinAnaly-salesBillNo" v-model.trim="queryParam.brandName" allowClear placeholder="请输入车辆品牌"/>
+                <a-input id="vinAnaly-form-brandName" v-model.trim="queryParam.brandName" allowClear placeholder="请输入车辆品牌"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="车型">
-                <a-input id="vinAnaly-salesManName" v-model.trim="queryParam.modelInfo" allowClear placeholder="请输入车型"/>
+                <a-input id="vinAnaly-form-modelInfo" v-model.trim="queryParam.modelInfo" allowClear placeholder="请输入车型"/>
               </a-form-model-item>
             </a-col>
           </template>
           <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="vinAnaly-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="vinAnaly-reset">重置</a-button>
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="vinAnaly-form-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="vinAnaly-form-reset">重置</a-button>
             <a-button
               type="primary"
               style="margin-left: 5px"
@@ -50,8 +50,8 @@
               :disabled="disabled"
               :loading="exportLoading"
               class="button-warning"
-              id="vinAnaly-export-btn">导出</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 5px">
+              id="vinAnaly-form-export-btn">导出</a-button>
+            <a @click="advanced=!advanced" style="margin-left: 5px" id="vinAnaly-form-advanced">
               {{ advanced ? '收起' : '展开' }}
               <a-icon :type="advanced ? 'up' : 'down'"/>
             </a>
@@ -96,7 +96,7 @@
         <!-- vin -->
         <template slot="vin" slot-scope="text, record">
           <div>
-            <span class="table-td-link" @click="handleDetail(record)">{{ record.vinCode }}</span>
+            <span :id="'vinAnaly-form-detail-'+record.id" class="table-td-link" @click="handleDetail(record)">{{ record.vinCode }}</span>
           </div>
         </template>
       </s-table>
@@ -127,25 +127,25 @@ export default {
       labelCol: { span: 8 },
       wrapperCol: { span: 16 },
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
-        vinCode: undefined,
-        shelfSn: undefined,
-        brandName: undefined,
-        modelInfo: undefined
+        beginDate: '', // 开始时间
+        endDate: '', // 结束时间
+        vinCode: undefined, // vin码
+        shelfSn: undefined, // 货架sn
+        brandName: undefined, // 品牌
+        modelInfo: undefined // 车型
       },
-      airConditionerFilterData: null,
+      airConditionerFilterData: null, // 过滤条件
       airFilterFlagData: null,
       engineOilFilterFlagData: null,
-      isSearch: false,
-      time: [],
+      isSearch: false, // 是否查询
+      time: [], // 时间默认值
       rules: {
         'shelfSn': [{ required: true, message: '请选择货架', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
+      exportLoading: false, // 导出loading
       // 加载数据方法 必须为 Promise 对象
       loadData: (parameter) => {
         const dataObj = parameter
@@ -185,17 +185,17 @@ export default {
           return data
         })
       },
-      queryCountData: null,
-      shelfName: '',
-      showColItem: [
+      queryCountData: null, // 合计数据
+      shelfName: '', // 货架名称
+      showColItem: [ // 筛选类型
         { label: '空调滤清器', value: 'kt' },
         { label: '空气滤清器', value: 'kq' },
         { label: '机油滤清器', value: 'jy' }
       ],
-      showCol: ['kt', 'kq', 'jy'],
-      filters: [{ text: '有', value: 1 }, { text: '无', value: 2 }, { text: '空(--)', value: 0 }],
-      showDetail: false,
-      curItem: null
+      showCol: ['kt', 'kq', 'jy'], // 筛选类型值
+      filters: [{ text: '有', value: 1 }, { text: '无', value: 2 }, { text: '空(--)', value: 0 }], // 筛选条件
+      showDetail: false, // 详情弹框
+      curItem: null // 详情数据
     }
   },
   computed: {
@@ -208,6 +208,7 @@ export default {
         { title: '车辆品牌', dataIndex: 'brandName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '车型', dataIndex: 'modelInfo', width: '24%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ]
+      // 隐藏、显示列
       this.showCol.map(item => {
         if (item == 'kt') {
           arr.push({ title: '空调滤清器适配', dataIndex: 'airConditionerFilterFlagDesc', filters: this.filters, filterMultiple: false, width: '120px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
@@ -223,6 +224,7 @@ export default {
     }
   },
   methods: {
+    // 选择货架
     shelfChange (v, row) {
       this.shelfName = row ? row.shelfName : ''
     },
@@ -266,10 +268,8 @@ export default {
       this.time = []
       this.$refs.rangeDate.resetDate(this.time)
       this.$refs.ruleForm.resetFields()
-      // this.$refs.table.refresh(true)
       this.handleSearch()
     },
-
     // 导出
     handleExport () {
       const _this = this
@@ -293,11 +293,11 @@ export default {
             _this.spinning = false
           })
         } else {
-          console.log('error submit!!')
           return false
         }
       })
     },
+    // 获取详情信息
     handleDetail (row) {
       queryDetail({ id: row.id }).then(res => {
         if (res.status == 200) {