Explorar o código

Merge branch 'sit'

snow %!s(int64=2) %!d(string=hai) anos
pai
achega
72c5e3aca6
Modificáronse 1 ficheiros con 44 adicións e 68 borrados
  1. 44 68
      src/views/reportQuery/financeReport/real-time-export-new.vue

+ 44 - 68
src/views/reportQuery/financeReport/real-time-export-new.vue

@@ -2,88 +2,48 @@
   <div class="pre-export">
     <el-row style="padding: 0 0 14px 0">
       <el-col :span="12" style="width: 355px">
-        <el-alert
-          :closable="false"
-          title="申请下载后,文件会在几分钟后生成!"
-          type="warning"
-        >
+        <el-alert :closable="false" title="申请下载后,文件会在几分钟后生成!" type="warning">
         </el-alert>
       </el-col>
 
-      <el-col
-        :span="3"
-        style="width: 66px; float: right"
-
-      >
-        <el-button
-          :size="searchSize"
-          type="primary"
-          style="float: right; margin-left: 5px"
-          @click="searchList"
-        >
+      <el-col :span="3" style="width: 66px; float: right">
+        <el-button :size="searchSize" type="primary" style="float: right; margin-left: 5px" @click="searchList">
           刷新
         </el-button>
       </el-col>
     </el-row>
 
-    <el-table
-      :data="tableData"
-      border
-      v-loading="loading"
-      :size="size"
-      style="width: 100%"
-    >
-      <el-table-column  prop="name" label="业务表名称" min-width="140"/>
-      <el-table-column prop="start" label="数据开始时间" min-width="140"/>
-      <el-table-column prop="end" label="数据结束时间" min-width="140"/>
-      <el-table-column prop="apply_name" label="申请人" min-width="70"/>
+    <el-table :data="tableData" border v-loading="loading" :size="size" style="width: 100%">
+      <el-table-column prop="name" label="业务表名称" min-width="140" />
+      <el-table-column prop="start" label="数据开始时间" min-width="140" />
+      <el-table-column prop="end" label="数据结束时间" min-width="140" />
+      <el-table-column prop="apply_name" label="申请人" min-width="70" />
       <el-table-column prop="status" label="状态" min-width="70">
-          <template slot-scope="scope">
-               <el-tag
-          :size="tablebtnSize"
-          :type="scope.row.status == '2' ? 'success' : scope.row.status == '1'?'warning':'info'"
-          v-text="
-            (statusOptions.find((item) => item.id == scope.row.status) || {})
-              .label || '--'
-          "
-        ></el-tag>
-          </template>
+        <template slot-scope="scope">
+          <el-tag :size="tablebtnSize"
+            :type="scope.row.status == '2' ? 'success' : scope.row.status == '1'?'warning':'info'" v-text="
+              (statusOptions.find((item) => item.id == scope.row.status) || {})
+                .label || '--'
+            "></el-tag>
+        </template>
       </el-table-column>
-      <el-table-column prop="updatetime" label="状态更新时间" min-width="140"/>
-      <el-table-column prop="addtime" label="创建时间" min-width="140"/>
+      <el-table-column prop="updatetime" label="状态更新时间" min-width="140" />
+      <el-table-column prop="addtime" label="创建时间" min-width="140" />
       <el-table-column fixed="right" label="操作" width="82">
         <template slot-scope="scope">
-          <el-tooltip
-            effect="dark"
-            content="编辑"
-            placement="top"
-          >
+          <el-tooltip effect="dark" content="编辑" placement="top">
             <i class="el-icon-edit tb-icon" @click="openModal(scope.row)"></i>
           </el-tooltip>
-          <el-tooltip
-            effect="dark"
-            content="下载"
-            placement="top"
-            v-if="
- scope.row.status == '2'
-            "
-          >
-            <i
-              class="el-icon-download tb-icon"
-              @click="batchExport(scope.row.down_url)"
-            ></i>
+          <el-tooltip effect="dark" content="下载" placement="top" v-if="
+           scope.row.status == '2'
+          ">
+            <i class="el-icon-download tb-icon" @click="batchExport(scope.row.down_url)"></i>
           </el-tooltip>
         </template>
       </el-table-column>
     </el-table>
 
-    <add-edit
-      :sitem="sitem"
-      :show-model="showModel"
-      :type="'2'"
-      @refresh="searchList"
-      @cancel="showModel = false"
-    />
+    <add-edit :sitem="sitem" :show-model="showModel" :type="'2'" @refresh="searchList" @cancel="showModel = false" />
   </div>
 </template>
 <script>
@@ -97,7 +57,7 @@ export default {
   components: {
     addEdit,
   },
-  mixins: [ resToken],
+  mixins: [resToken],
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
@@ -140,7 +100,24 @@ export default {
       };
       this.searchList();
     },
+    checkAuditTime(beginTime, endTime) {
+      var nowDate = new Date();
+      var beginDate = new Date(nowDate);
+      var endDate = new Date(nowDate);
+
+      var beginIndex = beginTime.lastIndexOf("\:");
+      var beginHour = beginTime.substring(0, beginIndex);
+      var beginMinue = beginTime.substring(beginIndex + 1, beginTime.length);
+      beginDate.setHours(beginHour, beginMinue, 0, 0);
+
+      var endIndex = endTime.lastIndexOf("\:");
+      var endHour = endTime.substring(0, endIndex);
+      var endMinue = endTime.substring(endIndex + 1, endTime.length);
+      endDate.setHours(endHour, endMinue, 0, 0);
+      return nowDate.getTime() - beginDate.getTime() >= 0 && nowDate.getTime() <= endDate.getTime();
+    },
     openModal(sitem) {
+      if (this.checkAuditTime('9:00','18:00')) return this.$message.warning('9:00至18:00不可编辑')
       this.showModel = true;
       this.sitem = sitem;
     },
@@ -161,7 +138,7 @@ export default {
       this.loading = true;
       const res = await asyncRequest.realNewList(this.parmValue);
       if (res && res.code === 0 && res.data) {
-           this.tableData = res.data.list;
+        this.tableData = res.data.list;
       } else if (res && res.code >= 100 && res.code <= 104) {
         await this.logout();
       } else {
@@ -172,7 +149,6 @@ export default {
   },
 };
 </script>
-   <style lang="scss" scoped>
-.account {
-}
+<style lang="scss" scoped>
+.account {}
 </style>