소스 검색

添加 导出记录和限制导出

hzj18279462576@163.com 1 년 전
부모
커밋
9b053c18bb

+ 3 - 2
config/index.js

@@ -15,7 +15,8 @@ module.exports = {
     proxyTable: devEnv.OPEN_PROXY === false ? {} : {
       '/proxyApi': {
 // target: 'http://192.168.0.128:8171/sqx_fast/',
-        target: 'https://mxys.chuanghai-tech.com/sqx_fast/',//mxys.chuanghai-tech.com
+        // target: 'https://mxys.chuanghai-tech.com/sqx_fast/',//mxys.chuanghai-tech.com
+        target: 'https://mxys.chuanghai-tech.com/wm-test/wm-api',//mxys.chuanghai-tech.com
 		changeOrigin: true,
         pathRewrite: {
           '^/proxyApi': ''
@@ -25,7 +26,7 @@ module.exports = {
 
     // Various Dev Server settings
     host: '127.0.0.1', // can be overwritten by process.env.HOST
-    port: 8001, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
+    port: 8008, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
     autoOpenBrowser: true,
     errorOverlay: true,
     notifyOnErrors: true,

BIN
dist.zip


BIN
src/assets/img/error.png


BIN
src/assets/img/loading.png


BIN
src/assets/img/success.png


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 0
src/icons/svg/icon-xiazai.svg


+ 1 - 1
src/main.js

@@ -14,7 +14,7 @@ import '@/assets/styles/fonts.css' //字体样式
 Vue.prototype.Tupiantou ='https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload'//线上
 // Vue.prototype.Tupiantou ='https://www.daweilinli.com/sqx_fast/alioss/upload'//线下
 Vue.prototype.Tupian =function(img){
-	return 'https://moxuanyunshang.oss-cn-beijing.aliyuncs.com'+img
+	return 'https://mxys.chuanghai-tech.com/wmfile'+img
 }//全局图片请求头
 
 import {

+ 6 - 0
src/router/index.js

@@ -86,6 +86,12 @@ const mainRoutes = {
       meta: { title: "消息中心", isTab: true }
     },
     {
+      path: "/downList",
+      component: _import("downLoad/downList"),
+      name: "downList",
+      meta: { title: "导出记录", isTab: true }
+    },
+    {
       path: "/taskConfig",
       component: _import("taskConfig/taskConfig"),
       name: "taskConfig",

+ 8 - 5
src/utils/httpRequest.js

@@ -59,8 +59,9 @@ http.adornUrl = (actionName) => {
   // 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截!
   // return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl) + actionName
 // return 'https://chtech.ncjti.edu.cn/testingServer/waiMaiAdmin/' + actionName}
-	return 'https://mxys.chuanghai-tech.com/sqx_fast/' + actionName
-  // return 'https://www.daweilinli.com/sqx_fast/' + actionName
+// return 'https://www.daweilinli.com/sqx_fast/' + actionName
+// return 'https://mxys.chuanghai-tech.com/sqx_fast/' + actionName
+return 'https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast/' + actionName
 }
 
 http.adornUrl2 = (actionName) => {
@@ -72,14 +73,16 @@ http.adornUrlMsg = (actionName) => {
   // 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截!
   // return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl) + actionName
 // return 'https://chtech.ncjti.edu.cn/testingServer/waiMaiAdmin/' + actionName}
-	return 'https://mxys.chuanghai-tech.com/sqx_fast/' + actionName
-  // return 'https://www.daweilinli.com/sqx_fast/' + actionName
+// return 'https://www.daweilinli.com/sqx_fast/' + actionName
+// return 'https://mxys.chuanghai-tech.com/sqx_fast/' + actionName
+return 'https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast/' + actionName
 }
 http.adornWss = (actionName) => {
   // 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截!
   // return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl) + actionName
-	return 'wss://mxys.chuanghai-tech.com/wss/' + actionName
 	// return 'wss://www.daweilinli.com/wss/' + actionName
+	// return 'wss://mxys.chuanghai-tech.com/wss/' + actionName
+	return 'wss://mxys.chuanghai-tech.com/wss-test/' + actionName
 }
 /**
  * get请求参数处理

+ 2 - 1
src/views/common/login.vue

@@ -128,11 +128,12 @@
 							data
 						}) => {
 							if (data && data.code === 0) {
+
 								this.$cookie.set('token', data.token)
 								this.$router.replace({
 									name: 'home'
 								})
-								console.log('登录成功············')
+								// console.log(data,'登录成功············')
 							} else {
 								this.getCaptcha()
 								this.$message.error(data.msg)

+ 304 - 0
src/views/downLoad/downList.vue

@@ -0,0 +1,304 @@
+<template>
+  <div>
+    <div style="display: inline-block;">
+      <span>状态:</span>
+      <el-select
+        v-model="state"
+        style="width:150px;margin-left: 10px;"
+        @change="select"
+        :clearable="true"
+      >
+        <el-option
+          v-for="item in statesnum2"
+          :key="item.value"
+          :label="item.label"
+          :value="item.value"
+        >
+        </el-option> </el-select
+      >
+      <div style="margin:5px;display: inline-block;">
+        <span>开始时间:</span>
+        <el-date-picker
+          style="width: 220px;margin-left: 10px;"
+          v-model="startTime"
+          align="right"
+          type="datetime"
+          format="yyyy-MM-dd HH:mm:ss"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          placeholder="选择开始时间"
+        >
+        </el-date-picker
+        >&nbsp;&nbsp;&nbsp;
+      </div>
+      <div style="margin:5px;display: inline-block;">
+        <span>截止时间:</span>
+        <el-date-picker
+          style="width: 220px;margin-left: 10px;"
+          v-model="endTime"
+          align="right"
+          type="datetime"
+          format="yyyy-MM-dd HH:mm:ss"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          placeholder="选择截止时间"
+        >
+        </el-date-picker>
+      </div>
+      <el-button
+        style="margin-left:15px;"
+        size="mini"
+        type="primary"
+        icon="document"
+        @click="select"
+        >查询
+      </el-button>
+      <el-button
+        style="margin-left:15px;"
+        size="mini"
+        type="primary"
+        icon="document"
+        @click="cleans"
+        >重置
+      </el-button>
+      <el-button
+        style="margin-left:15px;"
+        size="mini"
+        type="primary"
+        icon="document"
+        @click="refresh"
+        >刷新
+      </el-button>
+    </div>
+    <el-table v-loading="tableDataLoading" :data="duanxinData.list">
+      <el-table-column fixed prop="complaintId" label="编号" width="100">
+        <template slot-scope="scope">
+          <span>{{ scope.$index + 1 }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="fileName" label="任务名称" align="center">
+      </el-table-column>
+      <el-table-column prop="updateTime" label="导出时间" align="center">
+      </el-table-column>
+      <el-table-column
+        prop="exportId"
+        label="导出id"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        prop="conditionDetail"
+        label="导出条件"
+        align="center"
+      >
+      </el-table-column>
+      <el-table-column
+        prop="fileSize"
+        label="文件大小/kb"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        prop="sendFromShopName"
+        label="状态"
+        align="center"
+      >
+        <template slot-scope="scope">
+          <span v-if="scope.row.flag==0">待导出</span>
+          <span v-if="scope.row.flag==1">导出完成</span>
+          <span v-if="scope.row.flag==2">导出失败</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" width="150" align="center">
+        <template slot-scope="scope" v-if="scope.row.flag==1">
+          <el-button
+            size="mini"
+            type="primary"
+            @click="downFile(scope.row)"
+            style="margin: 5px;"
+          >
+            下载
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div style="text-align: center;margin-top: 10px;">
+      <el-pagination
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :page-sizes="[10, 20, 30, 40]"
+        :page-size="limit"
+        :current-page="page"
+        layout="total,sizes, prev, pager, next,jumper"
+        :total="duanxinData.totalCount"
+      >
+      </el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      limit: 10,
+      page: 1,
+      activeName: "first",
+      tableDataLoading: false,
+      dialogFormVisible: false,
+      checkBoxData: [], //多选框选择的值
+
+      startTime: "",
+      endTime: "",
+      filename: "",
+      state: "",
+
+      statesnum2:[
+        {label:"待导出",value:0},
+        {label:"导出完成",value:1},
+        {label:"导出失败",value:2},
+      ],
+      duanxinData: []
+    };
+  },
+  methods: {
+    handleSizeChange(val) {
+      this.limit = val;
+      this.dataSelect();
+    },
+    handleCurrentChange(val) {
+      this.page = val;
+      this.dataSelect();
+    },
+    //处理默认选中当前日期
+    getNowTime1() {
+      var now = new Date();
+      var year = now.getFullYear(); //得到年份
+      var month = now.getMonth(); //得到月份
+      var date = now.getDate(); //得到日期
+      var hh = now.getHours() < 10 ? "0" + now.getHours() : now.getHours();
+      var mm =
+        now.getMinutes() < 10 ? "0" + now.getMinutes() : now.getMinutes();
+      var ss =
+        now.getSeconds() < 10 ? "0" + now.getSeconds() : now.getSeconds();
+      month = month + 1;
+      month = month.toString().padStart(2, "0");
+      date = date.toString().padStart(2, "0");
+      var defaultDate = `${year}-${month}-${date} ${hh}:${mm}:${ss}`;
+      return defaultDate;
+      this.$set(this.info, "stockDate", defaultDate);
+    },
+    getNowTime2() {
+      var now = new Date();
+      var year = now.getFullYear(); //得到年份
+      var month = now.getMonth(); //得到月份
+      var date = now.getDate(); //得到日期
+      month = month + 1;
+      month = month.toString().padStart(2, "0");
+      date = date.toString().padStart(2, "0");
+      var defaultDate = `${year}-${month}-${date}`;
+      return defaultDate;
+      this.$set(this.info, "stockDate", defaultDate);
+    },
+    //处理默认选中当前日期
+    getNowTime() {
+      var now = new Date();
+      var year = now.getFullYear(); //得到年份
+      var month = now.getMonth() - now.getMonth(); //得到月份
+      var date = now.getDate() - now.getDate() + 1; //得到日期
+      month = month + 1;
+      month = month.toString().padStart(2, "0");
+      date = date.toString().padStart(2, "0");
+      var defaultDate = `${year}-${month}-${date}`;
+      return defaultDate;
+      this.$set(this.info, "stockDate", defaultDate);
+    },
+    // 查询
+    select() {
+      if(this.state==null){
+        this.state=''
+      }
+      this.page = 1;
+      this.limit = 10;
+      this.dataSelect();
+    },
+    // 重置
+    cleans() {
+      // this.filename = "";
+      this.state = "";
+      this.startTime = "";
+      this.endTime = "";
+      this.page = 1;
+      this.dataSelect();
+    },
+    refresh() {
+      this.dataSelect();
+    },
+    // 获取派单数据列表
+    dataSelect() {
+      console.log(this.state);
+
+      // if (this.endTime == '') {
+      // 	  this.endTime = this.info2.stockDate2
+      //   }
+      //   if (this.startTime == '') {
+      // 	  this.startTime = this.info.stockDate
+      //   }
+      this.tableDataLoading = true;
+      var userId = this.$cookie.get('userId')
+      this.$http({
+        url: this.$http.adornUrl("admin/export/listByUser"),
+        method: "get",
+        params: this.$http.adornParams({
+          curretPage: this.page,
+          pageSize: this.limit,
+          filename:'',// 文件名称
+          userId:userId,
+          state: this.state, //订单id
+          startTime: this.startTime, //开始时间
+          endTime: this.endTime, //结束时间
+        })
+      }).then(({ data }) => {
+        if (data && data.code === 0) {
+          this.tableDataLoading = false;
+          let returnData = data.data;
+          this.duanxinData = returnData;
+          console.log(data.data,'导出文件列表');
+        }
+      });
+    },
+    // 下载文件
+    downFile(row){
+      var userId = this.$cookie.get('userId')
+      this.$http({
+        url: this.$http.adornUrl("admin/export/readBuffer"),
+        method: "get",
+        responseType: "blob",
+        params: this.$http.adornParams({
+          filename:row.fileName,// 文件名称
+          userId:userId,
+        })
+      }).then(({ data }) => {
+        console.log(data, "导出");
+        let blob = new Blob([data], {
+          type:
+            "application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
+        });
+        if (window.navigator.msSaveOrOpenBlob) {
+          navigator.msSaveBlob(blob);
+        } else {
+          let url = window.URL.createObjectURL(blob);
+          let elink = document.createElement("a");
+          elink.download = row.fileName;
+          elink.style.display = "none";
+          elink.href = url;
+          document.body.appendChild(elink);
+          elink.click();
+          document.body.removeChild(elink);
+        }
+      });
+    }
+  },
+  mounted() {
+    this.dataSelect();
+  },
+};
+</script>
+
+<style></style>

+ 6 - 1
src/views/main-navbar.vue

@@ -24,6 +24,11 @@
               controls hidden></audio>
           </template>
         </el-menu-item> -->
+        <el-menu-item index="10" style="position: relative;" @click="$router.push({ name: 'downList' })">
+          <template slot="title">
+            <icon-svg name="xiazai" class="el-icon-setting" style="font-size: 22px;"></icon-svg>
+          </template>
+        </el-menu-item>
 				<el-menu-item index="1" style="position: relative;" @click="$router.push({ name: 'vueMchat' })">
 					<template slot="title">
 						<span class="left-number" v-if="chatNum2">{{chatNum2}}</span>
@@ -416,7 +421,7 @@
 							this.aplayAudio()
 						}
 					} else {
-						console.log('this.chatNum2', this.chatNum2)
+						// console.log('this.chatNum2', this.chatNum2)
 						this.chatNum2 = 0
 						this.errCount2 = 0
 						this.lodNum = 0

+ 7 - 0
src/views/main-sidebar.vue

@@ -45,6 +45,13 @@
           <span slot="title">消息中心</span>
         </el-menu-item>
         <el-menu-item
+          index="downList"
+          @click="$router.push({ name: 'downList' })"
+        >
+          <icon-svg name="xiazai" class="site-sidebar__menu-icon"></icon-svg>
+          <span slot="title">导出记录</span>
+        </el-menu-item>
+        <el-menu-item
           index="vueMchat"
           @click="$router.push({ name: 'vueMchat' })"
         >

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1377 - 979
src/views/shopManagement/mission.vue