Ver Fonte

Merge remote-tracking branch 'origin/master'

zyp há 10 meses atrás
pai
commit
108fee333a

+ 31 - 5
src/api/company/statistics.js

@@ -1,6 +1,6 @@
 import request from '@/utils/request'
 
- 
+
 export function voiceLogs(query) {
   return request({
     url: '/company/statistics/voiceLogs',
@@ -37,8 +37,34 @@ export function exportTuiMoney(query) {
   })
 }
 
+export function storeProduct(query) {
+  return request({
+    url: '/company/statistics/storeProduct',
+    method: 'get',
+    params: query
+  })
+}
+export function exportStoreProduct(query) {
+  return request({
+    url: '/company/statistics/exportStoreProduct',
+    method: 'get',
+    params: query
+  })
+}
+export function userTuiMoney(query) {
+  return request({
+    url: '/company/statistics/userTuiMoney',
+    method: 'get',
+    params: query
+  })
+}
+export function exportUserTuiMoney(query) {
+  return request({
+    url: '/company/statistics/exportUserTuiMoney',
+    method: 'get',
+    params: query
+  })
+}
+
+
 
- 
-  
- 
-  

+ 211 - 0
src/views/company/statistics/storeProduct.vue

@@ -0,0 +1,211 @@
+<template>
+  <div class="app-container">
+      <div class="app-content">
+        <div class="title" style="display: flex; justify-content: center; align-items: center;">药品销售统计</div>
+        <el-form class="search-form" :inline="true" label-width="90px">
+                <el-form-item   label="统计">
+                  <el-select v-model="queryParams.type" placeholder="请选择日期" size="small">
+                    <el-option
+                      v-for="item in options"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value">
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+                <el-form-item>
+                   <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+                   <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+                </el-form-item>
+              </el-form>
+              </div>
+              <el-button class="export" size="small"  @click="handleExport" style="float: right; margin-bottom: 15px; margin-right: 40px;" >导出</el-button>
+              <div class="table-box" style="margin-left: 40px; margin-right: 40px;">
+                <el-table
+                :data="list"
+                border
+                show-summary
+                style="width: 100%;" class="centered-table">
+                <el-table-column
+                  label="商品名称"  >
+                  <template slot-scope="scope">
+                <span>{{ JSON.parse(scope.row.json).productName}}</span>
+                 </template>
+                </el-table-column>
+               <el-table-column
+                 label="商品编号"  >
+                 <template slot-scope="scope">
+               <span>{{ JSON.parse(scope.row.json).barCode}}</span>
+                </template>
+               </el-table-column>
+               <el-table-column
+                 label="组合编号"  >
+                 <template slot-scope="scope">
+               <span>{{ JSON.parse(scope.row.json).groupBarCode}}</span>
+                </template>
+               </el-table-column>
+                <el-table-column
+                  label="单价"  >
+                  <template slot-scope="scope">
+                <span>{{ JSON.parse(scope.row.json).price}}</span>
+                 </template>
+                </el-table-column>
+                <el-table-column
+                  label="销售金额"  >
+                  <template slot-scope="scope">
+                <span>{{ JSON.parse(scope.row.json).price * scope.row.num}}</span>
+                 </template>
+                </el-table-column>
+                <el-table-column
+                  prop="num"
+                  label="销售数量" >
+                </el-table-column>
+              </el-table>
+          </div>
+  </div>
+</template>
+
+<script>
+import { storeProduct,exportStoreProduct } from "@/api/company/statistics";
+export default {
+  data() {
+    return {
+      exportLoading: false,
+      queryParams:{
+        type: "9",
+        storeId: null,
+      },
+      options: [{
+         value: '1',
+         label: '今天'
+       }, {
+         value: '2',
+         label: '昨天'
+       }, {
+         value: '3',
+         label: '本周'
+       }, {
+         value: '4',
+         label: '上周'
+       }, {
+         value: '5',
+         label: '本月'
+       }
+       , {
+         value: '6',
+         label: '上月'
+       },
+       {
+         value: '7',
+         label: '本季度'
+       },
+       {
+         value: '8',
+         label: '上季度'
+       }
+       , {
+         value: '9',
+         label: '本年'
+       }
+       , {
+         value: '10',
+         label: '去年'
+       }],
+      list:[],
+      storeOPtions:[],
+      chart: null,
+      data: [
+      ],
+    };
+  },
+  created() {
+    storeProduct(this.queryParams).then(response => {
+      this.list = response.list;
+    });
+  },
+
+  methods: {
+
+ /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有数据?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+            this.exportLoading = true;
+          return exportStoreProduct(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    },
+
+    handleQuery(){
+      storeProduct(this.queryParams).then(response => {
+        this.list = response.list;
+      });
+    },
+ /** 重置按钮操作 */
+    resetQuery() {
+     this.queryParams={
+       type: null,
+       storeId: null,
+     }
+     this.getorderChartData()
+    },
+
+  },
+};
+</script>
+<style>
+  .title{
+    padding: 20px 30px 0px 30px;
+    font-size: 18px;
+    font-weight: bold;
+    color: black;
+
+  }
+  .search-form{
+    margin: 20px 30px 0px 30px;
+  }
+  .echart-box{
+    margin: 0 auto;
+    text-align: center;
+  }
+  .el-select{
+    margin: 5px 10px;
+  }
+  .table-box{
+    margin-top: 15px;
+    .export{
+      float: right;
+      margin: 10px 0px;
+    }
+  }
+.app-container{
+    border: 1px solid #e6e6e6;
+    padding: 12px;
+
+
+}
+ .app-content{
+      background-color: white;
+
+
+
+    }
+    .data-box{
+      padding: 30px;
+      background-color:  rgb(255, 255, 255);
+      height: 100%;
+
+
+    }
+
+
+    .centered-table .cell {
+      text-align: center;
+    }
+</style>

+ 192 - 0
src/views/company/statistics/userTuiMoney.vue

@@ -0,0 +1,192 @@
+<template>
+  <div class="app-container">
+      <div class="app-content">
+        <div class="title" style="display: flex; justify-content: center; align-items: center;">推广员佣金统计</div>
+        <el-form class="search-form" :inline="true" label-width="90px">
+                <el-form-item   label="统计">
+                  <el-select v-model="queryParams.type" placeholder="请选择日期" size="small">
+                    <el-option
+                      v-for="item in options"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value">
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+                <el-form-item>
+                   <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+                   <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+                </el-form-item>
+              </el-form>
+              </div>
+              <el-button class="export" size="small"  @click="handleExport" style="float: right; margin-bottom: 15px; margin-right: 40px;" >导出</el-button>
+              <div class="table-box" style="margin-left: 40px; margin-right: 40px;">
+                <el-table
+                :data="list"
+                border
+                show-summary
+                style="width: 100%;" class="centered-table">
+
+                <el-table-column
+                  prop="nickname"
+                  label="昵称">
+                </el-table-column>
+               <el-table-column
+                 prop="phone"
+                 label="手机号">
+               </el-table-column>
+                <el-table-column
+                  prop="tuiMoney"
+                  label="金额">
+                </el-table-column>
+
+
+              </el-table>
+          </div>
+  </div>
+</template>
+
+<script>
+import { userTuiMoney,exportUserTuiMoney } from "@/api/company/statistics";
+export default {
+  data() {
+    return {
+      exportLoading: false,
+      queryParams:{
+        type: "9",
+        storeId: null,
+      },
+      options: [{
+         value: '1',
+         label: '今天'
+       }, {
+         value: '2',
+         label: '昨天'
+       }, {
+         value: '3',
+         label: '本周'
+       }, {
+         value: '4',
+         label: '上周'
+       }, {
+         value: '5',
+         label: '本月'
+       }
+       , {
+         value: '6',
+         label: '上月'
+       },
+       {
+         value: '7',
+         label: '本季度'
+       },
+       {
+         value: '8',
+         label: '上季度'
+       }
+       , {
+         value: '9',
+         label: '本年'
+       }
+       , {
+         value: '10',
+         label: '去年'
+       }],
+      list:[],
+      storeOPtions:[],
+      chart: null,
+      data: [
+      ],
+    };
+  },
+  created() {
+    userTuiMoney(this.queryParams).then(response => {
+      this.list = response.list;
+    });
+  },
+
+  methods: {
+
+ /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有数据?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+            this.exportLoading = true;
+          return exportUserTuiMoney(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    },
+
+    handleQuery(){
+      userTuiMoney(this.queryParams).then(response => {
+        this.list = response.list;
+      });
+    },
+ /** 重置按钮操作 */
+    resetQuery() {
+     this.queryParams={
+       type: null,
+       storeId: null,
+     }
+     this.getorderChartData()
+    },
+
+  },
+};
+</script>
+<style>
+  .title{
+    padding: 20px 30px 0px 30px;
+    font-size: 18px;
+    font-weight: bold;
+    color: black;
+
+  }
+  .search-form{
+    margin: 20px 30px 0px 30px;
+  }
+  .echart-box{
+    margin: 0 auto;
+    text-align: center;
+  }
+  .el-select{
+    margin: 5px 10px;
+  }
+  .table-box{
+    margin-top: 15px;
+    .export{
+      float: right;
+      margin: 10px 0px;
+    }
+  }
+.app-container{
+    border: 1px solid #e6e6e6;
+    padding: 12px;
+
+
+}
+ .app-content{
+      background-color: white;
+
+
+
+    }
+    .data-box{
+      padding: 30px;
+      background-color:  rgb(255, 255, 255);
+      height: 100%;
+
+
+    }
+
+
+    .centered-table .cell {
+      text-align: center;
+    }
+</style>

+ 42 - 0
src/views/system/config/config.vue

@@ -45,6 +45,22 @@
                 <el-input-number  v-model="form1.storeAfterSalesDay" :min="0" :max="100"    ></el-input-number>
               </el-tooltip>
             </el-form-item>
+            <el-form-item label="企业理念视频" prop="videoUrl">
+             <div>
+                 <el-upload
+                   ref="upload"
+                   class="upload-demo"
+                   :action="uploadUrl"
+                   :on-success="handleSuccess"
+                   :before-upload="beforeUpload"
+                   :limit="1"
+                   :accept="videoAccept"
+                 >
+                <el-button size="small" type="primary">点击上传视频</el-button>
+                </el-upload>
+                <video v-if="form1.videoUrl" :src="form1.videoUrl" controls style="max-width: 400px; max-height: 400px;"></video>
+             </div>
+            </el-form-item>
             <el-form-item  label="退货收货人" prop="refundConsignee">
               <el-tooltip class="item" effect="dark" content="退货收货人" placement="top-end">
                 <el-input style="width:200px"  v-model="form1.refundConsignee"   ></el-input>
@@ -248,6 +264,8 @@ export default {
       signform: {
 
       },
+      uploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS",
+      videoAccept:"video/*",
       photoArr:[],
       activeName:"store.config",
       configId:null,
@@ -297,6 +315,30 @@ export default {
     this.getConfigByKey(this.activeName);
   },
   methods: {
+      handleSuccess(response, file) {
+            // 上传成功后的回调函数
+            this.myloading.close();
+            this.form1.videoUrl = response.url;
+            this.$refs.upload.clearFiles();
+          },
+      beforeUpload(file) {
+        // 上传前的钩子函数,可以在这里对文件进行处理
+        // 返回 false 则取消上传
+
+        // 例如限制文件大小
+        const isLt2M = file.size / 1024 / 1024 < 200;
+        if (!isLt2M) {
+          this.$message.error('上传视频文件大小不能超过 200MB!');
+          return false;
+        }
+        this.myloading = this.$loading({
+          lock: true,
+          text: '上传中',
+          spinner: 'el-icon-loading',
+          background: 'rgba(0, 0, 0, 0.7)'
+        });
+
+      },
       handleSignEdit(item){
         this.signform=item;
         this.sign.open=true;