Jelajahi Sumber

客户分析

lilei 2 tahun lalu
induk
melakukan
d1e2b9a67b

+ 1 - 1
public/version.json

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

+ 24 - 0
src/config/router.config.js

@@ -631,6 +631,30 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/numsGoodsShelves/customerAnalysis',
+            redirect: '/numsGoodsShelves/customerAnalysis/list',
+            name: 'customerAnalysis',
+            component: BlankLayout,
+            meta: {
+              title: '客户分析',
+              icon: 'monitor',
+              // permission: 'M_customerAnalysis'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'customerAnalysisList',
+                component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/customerAnalysis/list.vue'),
+                meta: {
+                  title: '客户分析列表',
+                  icon: 'monitor',
+                  hidden: true
+                }
+              },
+            ]
+          },
           // {
           //   path: '/numsGoodsShelves/accountManagement',
           //   redirect: '/numsGoodsShelves/accountManagement/list',

+ 274 - 0
src/views/numsGoodsShelves/customerAnalysis/list.vue

@@ -0,0 +1,274 @@
+<template>
+  <div class="userd-baseInfo">
+    <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-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>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="下单时间">
+                  <rangeDate ref="orderDate" :value="orderTime" @change="orderDateChange" />
+                </a-form-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="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 @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-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>;
+              </div>
+              <div>
+                急送数量合计:<strong>399</strong>;
+                急送金额合计:<strong>26545</strong>;
+                销售数量合计:<strong>399</strong>;
+                销售金额合计:<strong>26545</strong>;
+              </div>
+            </div>
+          </a-alert>
+        </div>
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+84.5+'px', wordBreak: 'break-all' }"
+          size="small"
+          rowKey="id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <span slot="customTitle">
+            <a-popover>
+              <template slot="content">
+                货架铺货情况为实时数据,<br>与查询条件查询中的下单时间无关
+              </template>
+              <a-icon type="question-circle" theme="twoTone" />
+            </a-popover>
+            货架铺货情况
+          </span>
+        </s-table>
+      </a-spin>
+    </a-card>
+  </div>
+</template>
+
+<script>
+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'
+export default {
+  name: 'UserList',
+  components: { STable, VSelect, rangeDate, shelfSList },
+  data () {
+    return {
+      spinning: false,
+      advanced: false,
+      tableHeight: 0,
+      time: [],
+      orderTime: [],
+      // 查询参数
+      queryParam: {
+        shelfName: '',
+        state: undefined
+      },
+      showModal: false,
+      itemData: null, // 编辑行数据
+      openStatusModal: false, // 货架状态弹窗初始状态
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
+        { title: '货架名称', dataIndex: 'createDate', 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: '货架订单',
+          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: '急送订单',
+          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: '销售单',
+          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 }
+          ]
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        return orderBillQueryPage(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (let i = 0; i < data.list.length; i++) {
+              const _item = data.list[i]
+              _item.no = no + i + 1
+            }
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    handleBack () {
+      this.$router.go(-1)
+    },
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    //  时间  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
+      }
+      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 - 225
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.reset()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.reset()
+    }
+  }
+}
+</script>
+<style lang="less">
+  .userd-baseInfo{
+    .userd-back{
+      margin-bottom: 6px;
+    }
+  }
+</style>