浏览代码

bug 修复

lilei 2 年之前
父节点
当前提交
04877e7905

+ 24 - 0
src/api/report.js

@@ -42,4 +42,28 @@ export const useUserQueryPage = params => {
     data: params,
     method: 'post'
   })
+}
+// 导出
+export const exportShelfUseUser = params => {
+  return axios({
+    url: `/report/shelf/exportShelfUseUser`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 参数设置查询
+export const queryStoreLevelParamMap = params => {
+  return axios({
+    url: `/bizparam/queryStoreLevelParamMap`,
+    data: params,
+    method: 'post'
+  })
+}
+export const saveStoreLevelParam = params => {
+  return axios({
+    url: `/bizparam/saveStoreLevelParam`,
+    data: params,
+    method: 'post'
+  })
 }

+ 10 - 1
src/views/dataStatistics/userAnalysis/activeUser.vue

@@ -107,7 +107,7 @@
               <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
                 <a-button type="primary" @click="$refs.table.refresh(true)" id="activeuser-refresh">查询</a-button>
                 <a-button type="" @click="reset" style="margin-left: 10px;" id="activeuser-reset">重置</a-button>
-                <a-button type="primary" class="button-warning" style="margin-left: 10px;" id="activeuser-reset">导出</a-button>
+                <a-button type="primary" @click="exportFile" class="button-warning" style="margin-left: 10px;" id="activeuser-reset">导出</a-button>
                 <a @click="advanced=!advanced" style="margin-left: 8px">
                   {{ advanced ? '收起' : '展开' }}
                   <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -156,6 +156,7 @@ import areaList from '@/views/common/areaList.js'
 import dealerList from '@/views/common/dealerList.vue'
 import storeList from '@/views/common/storeList.vue'
 import { toThousands } from '@/libs/tools.js'
+import { hdExportExcel } from '@/libs/exportExcel'
 import setModal from './setModal.vue'
 export default {
   name: 'UserList',
@@ -231,6 +232,14 @@ export default {
     storeChange (obj) {
       this.queryParam.storeSn = obj.key || undefined
     },
+    // 导出
+    exportFile () {
+      const _this = this
+      this.spinning = true
+      hdExportExcel(exportShelfUseUser, this.queryParam, '用户分析(活跃用户)详情', function () {
+        _this.spinning = false
+      })
+    },
     // 重置
     reset () {
       this.queryParam = {

+ 31 - 34
src/views/dataStatistics/userAnalysis/setModal.vue

@@ -17,15 +17,15 @@
           :rules="rules"
         >
           <div style="margin-bottom: 10px;text-align: center;">
-            <strong>近30天下单额</strong>
+            <strong>近{{ form&&form.day_limit||'' }}天下单额</strong>
           </div>
-          <a-form-model-item label="LV1" prop="lv1" :label-col="{span: 4}" :wrapper-col="{span: 18}">
-            <a-input-number style="width:80%;" v-model.trim="form.lv1" :precision="2" allowClear placeholder="请输入LV1下单额"/>
+          <a-form-model-item label="LV1" prop="LV1" :label-col="{span: 4}" :wrapper-col="{span: 18}">
+            <a-input-number style="width:80%;" v-model.trim="form.LV1" :precision="2" allowClear placeholder="请输入LV1下单额"/>
             元以下
           </a-form-model-item>
-          <a-form-model-item label="LV2" prop="lv2" :label-col="{span: 4}" :wrapper-col="{span: 18}">
+          <a-form-model-item label="LV2" prop="LV2" :label-col="{span: 4}" :wrapper-col="{span: 18}">
             <a-input-group style="width: 90%;" compact>
-              <a-input style="width: 43%; text-align: center;pointer-events: none; backgroundColor: #f8f8f8;color:#666;" disabled v-model.trim="form.lv1"/>
+              <a-input style="width: 43%; text-align: center;pointer-events: none; backgroundColor: #f8f8f8;color:#666;" disabled v-model.trim="form.LV1"/>
               <a-input
                 style=" width: 12%; pointer-events: none; backgroundColor: #fff"
                 placeholder="至"
@@ -33,17 +33,17 @@
               />
               <a-input-number
                 :precision="2"
-                :min="form.lv1"
+                :min="form.LV1"
                 style="width: 43%; text-align: center"
-                v-model.trim="form.lv2"
+                v-model.trim="form.LV2"
                 allowClear
                 placeholder="请输入LV2下单额"/>
             </a-input-group>
           </a-form-model-item>
-          <a-form-model-item label="LV3" prop="lv3" :label-col="{span: 4}" :wrapper-col="{span: 18}">
+          <a-form-model-item label="LV3" prop="LV3" :label-col="{span: 4}" :wrapper-col="{span: 18}">
             <a-input-group style="width: 90%;" compact>
-              <a-input style=" width: 43%; text-align: center;pointer-events: none; backgroundColor: #f8f8f8;color:#666;" disabled v-model.trim="form.lv2"/>
+              <a-input style=" width: 43%; text-align: center;pointer-events: none; backgroundColor: #f8f8f8;color:#666;" disabled v-model.trim="form.LV2"/>
               <a-input
                 style=" width: 12%; pointer-events: none; backgroundColor: #fff"
                 placeholder="至"
@@ -51,17 +51,17 @@
               />
               <a-input-number
                 :precision="2"
-                :min="form.lv2"
+                :min="form.LV2"
                 style=" width: 43%; text-align: center"
-                v-model.trim="form.lv3"
+                v-model.trim="form.LV3"
                 allowClear
                 placeholder="请输入LV3下单额"/>
             </a-input-group>
           </a-form-model-item>
-          <a-form-model-item label="LV4" prop="lv4" :label-col="{span: 4}" :wrapper-col="{span: 18}">
+          <a-form-model-item label="LV4" prop="LV4" :label-col="{span: 4}" :wrapper-col="{span: 18}">
             <a-input-group style="width: 90%;" compact>
-              <a-input style=" width: 43%; text-align: center;pointer-events: none; backgroundColor: #f8f8f8;color:#666;" disabled v-model.trim="form.lv3"/>
+              <a-input style=" width: 43%; text-align: center;pointer-events: none; backgroundColor: #f8f8f8;color:#666;" disabled v-model.trim="form.LV3"/>
               <a-input
                 style=" width: 12%; pointer-events: none; backgroundColor: #fff"
                 placeholder="至"
@@ -69,16 +69,16 @@
               />
               <a-input-number
                 :precision="2"
-                :min="form.lv3"
+                :min="form.LV3"
                 style=" width: 43%; text-align: center"
-                v-model.trim="form.lv4"
+                v-model.trim="form.LV4"
                 allowClear
                 placeholder="请输入LV4下单额"/>
             </a-input-group>
           </a-form-model-item>
           <a-form-model-item label="LV5" :label-col="{span: 4}" :wrapper-col="{span: 18}">
-            <a-input style="width: 80%; text-align: center;pointer-events: none; backgroundColor: #f8f8f8;color:#666;" disabled v-model.trim="form.lv4"/>
+            <a-input style="width: 80%; text-align: center;pointer-events: none; backgroundColor: #f8f8f8;color:#666;" disabled v-model.trim="form.LV4"/>
             元以上
           </a-form-model-item>
 
@@ -93,7 +93,7 @@
 </template>
 
 <script>
-import { saveHw, shelfHWDetail } from '@/api/shelf.js'
+import { queryStoreLevelParamMap, saveStoreLevelParam } from '@/api/report.js'
 export default {
   name: 'AddHWModal',
   props: {
@@ -121,24 +121,26 @@ export default {
       roleList: [],
       pageInfo: null,
       form: {
-        lv1: '',
-        lv2: '',
-        lv3: '',
-        lv4: ''
+        LV1: '',
+        LV2: '',
+        LV3: '',
+        lv4: '',
+        LV5: '',
+        day_limit: '30'
       },
       rules: {
-        lv1: [{ required: true, message: '请输入LV1下单金额', trigger: 'blur' }],
-        lv2: [{ required: true, message: '请输入LV2下单金额', trigger: 'blur' }],
-        lv3: [{ required: true, message: '请输入LV3下单金额', trigger: 'blur' }],
-        lv4: [{ required: true, message: '请输入LV4下单金额', trigger: 'blur' }]
+        LV1: [{ required: true, message: '请输入LV1下单金额', trigger: 'blur' }],
+        LV2: [{ required: true, message: '请输入LV2下单金额', trigger: 'blur' }],
+        LV3: [{ required: true, message: '请输入LV3下单金额', trigger: 'blur' }],
+        LV4: [{ required: true, message: '请输入LV4下单金额', trigger: 'blur' }]
       }
     }
   },
   methods: {
     // 查询货位详情
-    getShelfHWDetail () {
+    getDetail () {
       this.spinning = true
-      shelfHWDetail({ shelfPlaceSn: this.nowData.shelfPlaceSn }).then(res => {
+      queryStoreLevelParamMap().then(res => {
         if (res.status == 200) {
           this.form = Object.assign({}, res.data)
         }
@@ -150,11 +152,8 @@ export default {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          const params = JSON.parse(JSON.stringify(_this.form))
-          params.shelfSn = _this.shelfSn ? _this.shelfSn : null
-          console.log(params.id, params.shelfSn, '------------编辑新增')
           _this.spinning = true
-          saveHw(params).then(res => {
+          saveStoreLevelParam(_this.form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$emit('refresh')
@@ -183,9 +182,7 @@ export default {
         this.form = {}
         this.$emit('close')
       } else {
-        if (this.nowData && this.nowData.id) { //  编辑
-          this.getShelfHWDetail()
-        }
+        this.getDetail()
       }
     }
   }

+ 11 - 2
src/views/dataStatistics/userAnalysis/usedUser.vue

@@ -47,7 +47,7 @@
               <a-col :md="4" :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="exportFile" 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'"/>
@@ -98,10 +98,11 @@
 <script>
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { useUserQueryPage, useUserStatistics } from '@/api/report.js'
+import { useUserQueryPage, useUserStatistics, exportShelfUseUser } from '@/api/report.js'
 import areaList from '@/views/common/areaList.js'
 import dealerList from '@/views/common/dealerList.vue'
 import storeList from '@/views/common/storeList.vue'
+import { hdExportExcel } from '@/libs/exportExcel'
 import { toThousands } from '@/libs/tools.js'
 export default {
   name: 'UserList',
@@ -195,6 +196,14 @@ export default {
     storeChange (obj) {
       this.queryParam.storeSn = obj.key || undefined
     },
+    // 导出
+    exportFile () {
+      const _this = this
+      this.spinning = true
+      hdExportExcel(exportShelfUseUser, this.queryParam, '用户分析(使用用户)详情', function () {
+        _this.spinning = false
+      })
+    },
     // 重置
     reset () {
       this.queryParam = {

+ 2 - 2
vue.config.js

@@ -108,8 +108,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://p.xprh.360arrow.com/xprh-admin',
-        // target: 'http://192.168.0.215:8701/xprh-admin',
+        // target: 'http://p.xprh.360arrow.com/xprh-admin',
+        target: 'http://192.168.0.115:8701/xprh-admin',
         // ws: false,
         ws: true,
         changeOrigin: true,