Browse Source

sit into master

戴艳蓉 3 years ago
parent
commit
b057b57996

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


+ 0 - 0
dist/static/css/chunk-054b02b6.fd73e55e.css → dist/static/css/chunk-4792c4f1.7e401a35.css


+ 0 - 0
dist/static/css/chunk-054b02b6.fd73e55e.css.gz → dist/static/css/chunk-4792c4f1.7e401a35.css.gz


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.9df3f6e0.js


BIN
dist/static/js/app.9df3f6e0.js.gz


BIN
dist/static/js/app.a7b55849.js.gz


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-054b02b6.9bbdf799.js


BIN
dist/static/js/chunk-054b02b6.9bbdf799.js.gz


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-4792c4f1.1550095c.js


BIN
dist/static/js/chunk-4792c4f1.1550095c.js.gz


+ 1 - 0
src/apis/service/network/orderEntry/index.js

@@ -20,4 +20,5 @@ export default {
   update: (data, params) => http(api + "intersave", data, "post", params),
   // 获取商品分类
   getcat: (data, params) => http(api + "getcat", data, "post", params),
+
 }

+ 6 - 0
src/apis/service/search/standBook/index.js

@@ -1,5 +1,6 @@
 // 企业客户/供应商账号相关
 import http from "@/apis/axios";
+import testHttp from "@/apis/testAxios";
 const api = "Admin/";
 export default {
   // 分页查询
@@ -14,6 +15,11 @@ export default {
   add: (data, params) => http(api + "execsave", data, "post", params),
   //获取预约导出业务需求表
   exportList: (data, params) => http(api + "execlist", data, "post", params),
+
+  // 历史数据导出列表
+  hlist: (data, params) => testHttp(api + "execnowlist", data, "post", params),
+  // 准备执行
+  download: (data, params) => testHttp(api + "execnowdown", data, "post", params),
   // // 分页查询确认单列表
   // qrdlist: (data, params) => http(api + "qrdlist", data, "post", params),
   // // 发票新建(金额)

+ 98 - 0
src/apis/testAxios.js

@@ -0,0 +1,98 @@
+import urlConfig from '@/apis/url-config'
+import {
+  getToken, removeMenu,
+  removeBtn, removeToken
+} from '@/utils/auth'
+const header = {
+  // "X-Requested-With": "XMLHttpRequest",
+  // "X-Frame-Options": "DENY", // 告诉浏览器不要(DENY)把这个网页放在iFrame内,通常的目的就是要帮助用户对抗点击劫持。
+  // "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
+}
+window.ajaxTimeout = 20000
+export default async (
+  url = '',
+  data = {},
+  type = 'GET',
+  params = {},
+  headers = header,
+  onUploadProgress
+) => {
+  type = type.toLowerCase()
+  const obj = {
+    method: type,
+    baseURL: '',
+    url: urlConfig.testURL + url,
+    data,
+    params,
+    // // `onUploadProgress` 允许为上传处理进度事件
+    // onUploadProgress: function(progressEvent) {
+    //   // 对原生进度事件的处理
+    // },
+    // // `onDownloadProgress` 允许为下载处理进度事件
+    // onDownloadProgress: function(progressEvent) {
+    //   // 对原生进度事件的处理
+    // },
+    // `cancelToken` 指定用于取消请求的 cancel token
+    // (查看后面的 Cancellation 这节了解更多)
+    // cancelToken: new CancelToken(function (cancel) {
+    // }),
+    processData: true, // 告诉axios不要去处理发送的数据(重要参数)
+    timeout: window.ajaxTimeout,
+    headers,
+    onUploadProgress
+  }
+  if (onUploadProgress && typeof onUploadProgress === 'function') {
+    obj.onUploadProgress = onUploadProgress
+  }
+  // return await axios(obj)
+  //   .then(response => {
+  //     return response;
+  //   })
+  //   .catch(res => {
+  //     return res;
+  //   });
+  // 请求拦截器
+  axios.interceptors.request.use(
+    config => {
+      if (!config.data.token) {
+        config.data.token = getToken()
+      }
+      return config
+    },
+    error => {
+      // 错误抛到业务代码
+      return Promise.reject(new Error('服务器异常,请联系管理员!'))
+    }
+  )
+  // 添加响应拦截器
+  axios.interceptors.response.use(
+    async response => {
+      if (response.status === 200) {
+        const code = response.data.code
+        if (code >= 100 && code <= 104) {
+          removeToken()
+          removeMenu()
+          removeBtn()
+        }
+      }
+      return response
+    },
+    error => {
+      return Promise.reject(error.response.data)
+    }
+  )
+  return new Promise((resolve, reject) => {
+    axios(obj)
+      .then(response => {
+        // console.log(response)
+        resolve(response.data)
+      })
+      .catch(res => {
+        if (res.response && res.response.data) {
+          reject(res.response.data);
+        } else {
+          reject(res);
+        }
+      });
+  })
+}

+ 1 - 0
src/apis/url-config.js

@@ -2,6 +2,7 @@ import { api, ding } from '@/config'
 export default {
   //后端接口url
   baseURL: api.baseApi,
+  testURL: api.testApi,
   //企业id
   corpId: ding.CorpId,
   //应用凭证

+ 1 - 1
src/config/env.development.js

@@ -6,7 +6,7 @@ module.exports = {
     // baseApi: 'http://inv.sit.wanyuhengtong.com/',
     // baseApi: 'http://inv.test241.wanyuhengtong.com/',
     baseApi: 'http://www.invoice.com/',
-    // baseApi: 'http://inv.sitw.wanyuhengtong.com/',
+    testApi: 'http://inv.test241.wanyuhengtong.com/',
   },
   fileURL: `https://api2.edusit.zretchome.com`,
   appId: 'wx5ac3a2c2d72b6f26',

+ 1 - 0
src/config/env.production.js

@@ -5,6 +5,7 @@ module.exports = {
   api: {
     baseApi: 'http://inv.sitw.wanyuhengtong.com/',
     // tableApi: 'http://inv.sit.wanyuhengtong.com/',
+    testApi: 'http://inv.test241.wanyuhengtong.com/',
   },
   fileURL: `https://api2.edu.futurelab.tv`,
   appId: 'wx5ac3a2c2d72b6f26',

+ 6 - 5
src/config/env.staging.js

@@ -6,13 +6,14 @@ module.exports = {
     // baseApi: 'http://inv.sitw.wanyuhengtong.com/',
     // baseApi: 'http://inv.sit.wanyuhengtong.com/',
     baseApi: 'http://inv.test241.wanyuhengtong.com/',
+    testApi: 'http://inv.test241.wanyuhengtong.com/',
   },
   fileURL: `https://api2.edusit.zretchome.com`,
   appId: 'wx5ac3a2c2d72b6f26',
-  ding:{
-     //企业id
-     CorpId: "dingc78fa4301e1a424a35c2f4657eb6378f",
-     //应用凭证
-     AgentId:"1184953963"
+  ding: {
+    //企业id
+    CorpId: "dingc78fa4301e1a424a35c2f4657eb6378f",
+    //应用凭证
+    AgentId: "1184953963"
   }
 }

+ 55 - 60
src/views/search/standBook/pre-export copy.vue → src/views/search/standBook/history-data.vue

@@ -28,7 +28,7 @@
               <el-col :span="12" style="width: 355px">
                 <el-alert
                   :closable="false"
-                  title="新建的需求业务报表,会在隔天01:00开始生成文件!"
+                  title="申请导出后,文件会在几分钟后生成!"
                   type="warning"
                 >
                 </el-alert>
@@ -48,20 +48,6 @@
                   刷新
                 </el-button>
               </el-col>
-              <!-- <el-col
-                :span="3"
-                style="width: 66px; float: right"
-                v-if="powers.some((item) => item == '003')"
-              >
-                <el-button
-                  :size="searchSize"
-                  type="success"
-                  style="float: right"
-                  @click="openModal('add', false)"
-                >
-                  添加
-                </el-button>
-              </el-col> -->
             </el-col>
           </el-row>
         </div>
@@ -69,7 +55,10 @@
       <template #status="{ scope }">
         <el-tag
           :size="tablebtnSize"
-          :type="scope.row.status == '1' ? 'warning' : 'success'"
+          :type="
+            (statusOptions.find((item) => item.id == scope.row.status) || {})
+              .type || ''
+          "
           v-text="
             (statusOptions.find((item) => item.id == scope.row.status) || {})
               .label || '--'
@@ -77,6 +66,14 @@
         ></el-tag>
       </template>
       <template #operation="{ scope }">
+        <el-tooltip
+          effect="dark"
+          content="申请导出"
+          placement="top"
+          v-if="powers.some((item) => item == '049')"
+        >
+          <i class="el-icon-thumb tb-icon" @click="setStatus(scope.row.id)"></i>
+        </el-tooltip>
         <el-tooltip
           v-if="powers.some((item) => item == '049') && scope.row.status == '2'"
           effect="dark"
@@ -88,36 +85,20 @@
             @click="batchExport(scope.row.down_url)"
           ></i>
         </el-tooltip>
-        <el-tooltip
-          v-if="powers.some((item) => item == '005')"
-          effect="dark"
-          content="编辑"
-          placement="top"
-        >
-          <i class="el-icon-edit tb-icon" @click="openModal(scope.row)"></i>
-        </el-tooltip>
       </template>
     </ex-table>
-    <add-edit
-      :sitem="sitem"
-      :show-model="showModel"
-      @refresh="searchList"
-      @cancel="showModel = false"
-    />
   </div>
 </template>
 <script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import asyncRequest from "@/apis/service/search/standBook";
 import ExTable from "@/components/ExTableNew.vue";
-import addEdit from "./addEdit";
 import { mapGetters } from "vuex";
 import urlConfig from "@/apis/url-config";
 import resToken from "@/mixins/resToken";
 export default {
   name: "Account",
   components: {
-    addEdit,
     ExTable,
   },
   mixins: [mixinPage, resToken],
@@ -137,15 +118,17 @@ export default {
   },
   data() {
     return {
-      fileUrl: urlConfig.baseURL,
+      fileUrl: urlConfig.testURL,
       // 状态
       statusOptions: [
-        { id: "1", label: "待执行" },
-        { id: "2", label: "已完成" },
+        { id: "0", label: "待申请", type: "info" },
+        { id: "1", label: "系统处理中", type: "warning" },
+        { id: "2", label: "已完成", type: "success" },
+        { id: "3", label: "导出失败", type: "danger" },
       ],
       loading: true,
       showModel: false,
-      sitem:null,
+      sitem: null,
       parmValue: {
         page: 1, // 页码
         size: 15, // 每页显示条数
@@ -169,48 +152,34 @@ export default {
         {
           prop: "name",
           label: "业务表名称",
-          "min-width": "130px",
-        },
-        {
-          prop: "start",
-          label: "数据开始时间",
-          "min-width": "140px",
-        },
-        {
-          prop: "end",
-          width: "140px",
-          "min-width": "数据结束时间",
-        },
-        {
-          prop: "apply_name",
-          label: "申请人",
-          "min-width": "70px",
         },
         {
           prop: "status",
           label: "状态",
           _slot_: "status",
-          "min-width": "70px",
+        },
+        {
+          prop: "remark",
+          label: "下载反馈备注",
         },
 
         {
           prop: "expiretime",
           label: "文件过期时间",
-          "min-width": "140px",
-          sortable: true,
+        },
+        {
+          prop: "updatetime",
+          label: "更新时间",
         },
         {
           prop: "addtime",
           label: "创建时间",
-          "min-width": "140px",
-          sortable: true,
         },
         {
           prop: "",
           label: "操作",
           fixed: "right",
-          width: "52px",
-          _noset_: true,
+          width: "80px",
           _slot_: "operation",
         },
       ],
@@ -246,11 +215,37 @@ export default {
         }, 500);
       }
     },
+    async setStatus(id) {
+      if (!this.loading) {
+        this.loading = true;
+        const model = {
+          id: id,
+        };
+        const res = await asyncRequest.download(model);
+        if (res && res.code === 0) {
+          this.loading = false;
+          this.$notify.success({
+            title: "申请成功,请等待系统执行完成!",
+            message: "",
+          });
+          await this.searchList();
+        } else if (res && res.code >= 100 && res.code <= 104) {
+          await this.logout();
+        } else {
+          this.$message.warning(res.message);
+        }
+      }
+    },
     async searchList() {
       this.loading = true;
-      const res = await asyncRequest.exportList(this.parmValue);
+      const res = await asyncRequest.hlist(this.parmValue);
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
+        this.tableData.forEach((v) => {
+          if (v.status !== "3") {
+            v.remark = "";
+          }
+        });
         this.pageInfo.total = Number(res.data.count);
       } else if (res && res.code >= 100 && res.code <= 104) {
         await this.logout();

+ 16 - 13
src/views/search/standBook/index.vue

@@ -6,10 +6,13 @@
     >
       <el-tabs type="border-card" v-model="activeName">
         <el-tab-pane label="实时导出" name="1">
-          <real-time-export/>
+          <real-time-export />
         </el-tab-pane>
-        <el-tab-pane label="预约导出" name="2"> 
-          <pre-export/>
+        <el-tab-pane label="预约导出" name="2">
+          <pre-export />
+        </el-tab-pane>
+        <el-tab-pane label="往年数据导出" name="3">
+          <history-data />
         </el-tab-pane>
       </el-tabs>
     </div>
@@ -19,15 +22,18 @@
 <script>
 import resToken from "@/mixins/resToken";
 import urlConfig from "@/apis/url-config";
-import realTimeExport from "./real-time-export"
-import preExport from "./pre-export"
+import realTimeExport from "./real-time-export";
+import preExport from "./pre-export";
+import historyData from "./history-data";
+
 import { mapGetters } from "vuex";
 export default {
   name: "standBook",
   mixins: [resToken],
   components: {
     realTimeExport,
-    preExport
+    preExport,
+    historyData,
   },
   computed: {
     //组件SIZE设置
@@ -47,22 +53,19 @@ export default {
   },
   data() {
     return {
-      activeName: "1",
+      activeName: "3",
       loading: false,
       fileUrl: urlConfig.baseURL,
     };
   },
-  mounted(){
-    this.activeName="1"
-  },
-  methods: {
-  
+  mounted() {
+    this.activeName = "3";
   },
+  methods: {},
 };
 </script>
 
 <style lang="scss" scoped>
 .standBook {
-  
 }
 </style>

Some files were not shown because too many files changed in this diff