luobang 1 rok pred
rodič
commit
82b6f34451

+ 1 - 1
build/utils.js

@@ -17,7 +17,7 @@ const devPathSrc = path.resolve(__dirname, '../../../src') // node_modules应用
 //  'statisticalReport','systemConfig','TMS','WMS','workFlow','ADMINISTRATORS']
 
 let devModules = ['all']
-// let devModules = ['index', 'statisticalReport', 'appoint']
+// let devModules = ['index', 'ADMINISTRATORS']
 // let devModules = ['all']/
 // let devModules = ['index', 'sale']
 

+ 77 - 62
src/views/ADMINISTRATORS/app.js

@@ -1,117 +1,132 @@
 // The Vue build version to load with the `import` command
 // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
-import Vue from 'vue';
-import App from '@/components/App.vue';
+import Vue from 'vue'
+import App from '@/components/App.vue'
 // include
-import '@/config/include.js';
+import '@/config/include.js'
 
 // 通用store
-import store from '@/store/index.js';
+import store from '@/store/index.js'
 
 // router
-import router from './router/index.js';
+import router from './router/index.js'
 
 import VueApollo from 'vue-apollo'
 
 import apollo from '@/config/apolloConfig.js'
 
 // 关闭生产模式下给出的提示
-Vue.config.productionTip = false;
+Vue.config.productionTip = false
 
 Vue.use(VueApollo)
 
 // 注册表格的全局组件
-import DilCommonUI from "@/components/DilCommonUI";
-Vue.use(DilCommonUI);
+import DilCommonUI from '@/components/DilCommonUI'
+Vue.use(DilCommonUI)
 
-import vuescroll from "vuescroll";//引入vuescroll
-import "vuescroll/dist/vuescroll.css";//引入vuescroll样式
-Vue.use(vuescroll);//使用
+import vuescroll from 'vuescroll' //引入vuescroll
+import 'vuescroll/dist/vuescroll.css' //引入vuescroll样式
+Vue.use(vuescroll) //使用
 
 // 导出Excel全局组件
 import tableToExcel from '@/components/exportExcel/exportExcel'
 Vue.use(tableToExcel)
 
 const apolloProvider = new VueApollo({
-    defaultClient: apollo
+  defaultClient: apollo
 })
 
- //把时间戳改为正常可读的时间
- export function renderTime(date) {
-  if(date !== null){
-      let dateee = new Date(date).toJSON();
-      return new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, " ").replace(/\.[\d]{3}Z/, "");
+//把时间戳改为正常可读的时间
+export function renderTime(date) {
+  if (date !== null) {
+    let dateee = new Date(date).toJSON()
+    return new Date(+new Date(dateee) + 8 * 3600 * 1000)
+      .toISOString()
+      .replace(/T/g, ' ')
+      .replace(/\.[\d]{3}Z/, '')
   }
-  return null;
+  return null
 }
 //把毫秒数转换分
-export function getDuration(my_time) { 
-  if(my_time !== null){
-      return Math.floor(my_time / 1000 / 60);
+export function getDuration(my_time) {
+  if (my_time !== null) {
+    return Math.floor(my_time / 1000 / 60)
   }
-  return null;
+  return null
 }
 export function sjTime(orderPlanInTime) {
-  var stringTime = renderTime(orderPlanInTime);
-  var timestamp1 = stringTime.replace(/-/g, "/");
-  return new Date(timestamp1).getTime();
+  var stringTime = renderTime(orderPlanInTime)
+  var timestamp1 = stringTime.replace(/-/g, '/')
+  return new Date(timestamp1).getTime()
 }
 //验证电话号码
 export function VerifyPhoneNumber(Phone) {
-  var myreg=/^(13[0-9]|14[5|7]|15[0|1|2|3|4|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9]|19[0|1|2|3|5|6|7|8|9])\d{8}$/;
+  var myreg = /^(13[0-9]|14[5|7]|15[0|1|2|3|4|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9]|19[0|1|2|3|5|6|7|8|9])\d{8}$/
   if (!myreg.test(Phone)) {
-      return false;
+    return false
   } else {
-      return true;
+    return true
   }
 }
 export function isNumber(value) {
   //验证是否为数字
-  var patrn = /^(-)?\d+(\.\d+)?$/;
-  if (patrn.exec(value) == null || value == "") {
-    return false;
+  var patrn = /^(-)?\d+(\.\d+)?$/
+  if (patrn.exec(value) == null || value == '') {
+    return false
   } else {
-    return true;
+    return true
   }
 }
 export function isIntegerNumber(value) {
   //验证是否为整数
-  var patrn = /^\+?[1-9][0-9]*$/g;
-  if (patrn.exec(value) == null || value == "") {
-    return false;
+  var patrn = /^\+?[1-9][0-9]*$/g
+  if (patrn.exec(value) == null || value == '') {
+    return false
   } else {
-    return true;
+    return true
   }
 }
-
+export function toDateString(value) {
+  if (value == null) {
+    return
+  }
+  var Year = value.getFullYear()
+  var Month = ('0' + (value.getMonth() + 1)).slice(-2)
+  var Day = ('0' + value.getDate()).slice(-2)
+  var Hours = ('0' + value.getHours()).slice(-2)
+  var Minutes = ('0' + value.getMinutes()).slice(-2)
+  var Seconds = ('0' + value.getSeconds()).slice(-2)
+  var DATE =
+    Year + '-' + Month + '-' + Day + ' ' + Hours + ':' + Minutes + ':' + Seconds
+  return DATE
+}
 //写一个方法封装date对象转换为时间字符串
-  export function toDateString(value){
-      if(value==null){
-          return
-      }
-      var Year = value.getFullYear();
-      var Month = ("0" + (value.getMonth() + 1)).slice(-2)
-      var Day = ("0" + (value.getDate())).slice(-2)
-      var Hours = ("0" + (value.getHours())).slice(-2)
-      var Minutes = ("0" + (value.getMinutes())).slice(-2)
-      var Seconds = ("0" + (value.getSeconds())).slice(-2)
-      var DATE = Year + "-" + Month + "-" + Day + " " + Hours + ":" + Minutes + ":" + Seconds
-      return DATE
+export function toDateStringDay(value) {
+  if (value == null) {
+    return
   }
+  var Year = value.getFullYear()
+  var Month = ('0' + (value.getMonth() + 1)).slice(-2)
+  var Day = ('0' + value.getDate()).slice(-2)
+  var Hours = ('0' + value.getHours()).slice(-2)
+  var DATE = Year + '-' + Month + '-' + Day
+  return DATE
+}
 //写一个方法封装date对象转换为时间字符串
-  export function toDateNo(value){
-      if(value==null){
-          return
-      }
-      var Year = value.getFullYear();
-      var Month = ("0" + (value.getMonth() + 1)).slice(-2)
-      var Day = ("0" + (value.getDate())).slice(-2)
-      var Hours = ("0" + (value.getHours())).slice(-2)
-      var Minutes = ("0" + (value.getMinutes())).slice(-2)
-      var Seconds = ("0" + (value.getSeconds())).slice(-2)
-      var DATE = Year + "" + Month + "" + Day + "" + Hours + "" + Minutes + "" + Seconds
-      return DATE
+export function toDateNo(value) {
+  if (value == null) {
+    return
   }
+  var Year = value.getFullYear()
+  var Month = ('0' + (value.getMonth() + 1)).slice(-2)
+  var Day = ('0' + value.getDate()).slice(-2)
+  var Hours = ('0' + value.getHours()).slice(-2)
+  var Minutes = ('0' + value.getMinutes()).slice(-2)
+  var Seconds = ('0' + value.getSeconds()).slice(-2)
+  var DATE =
+    Year + '' + Month + '' + Day + '' + Hours + '' + Minutes + '' + Seconds
+  return DATE
+}
 
 /* eslint-disable no-new */
 new Vue({
@@ -121,4 +136,4 @@ new Vue({
   components: { App },
   provide: apolloProvider.provide(),
   template: '<App/>'
-});
+})

+ 119 - 22
src/views/ADMINISTRATORS/components/ADMINISTRATORS1.vue

@@ -638,17 +638,105 @@
               >
             </div>
           </el-tab-pane>
+          <el-tab-pane label="下载日志文件" name="eleven">
+            <div class="admin02">
+              <el-date-picker
+                v-model="startTime"
+                type="date"
+                placeholder="选择日期"
+                style="width:140px"
+                :picker-options="pickerOptions"
+              >
+              </el-date-picker>
+              <el-select
+                v-model="saleLog"
+                placeholder="请选择需筛选的内容"
+                clearable
+                style="width:200px"
+              >
+                <el-option
+                  v-for="item in options"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </el-select>
+              <el-button type="primary" size="middle" @click="downLoadFile"
+                >下载</el-button
+              >
+            </div>
+          </el-tab-pane>
         </el-tabs>
       </div>
     </template>
   </div>
 </template>
 <script>
-import { toDateString, toDateNo } from '../app.js'
+import { toDateString, toDateNo, toDateStringDay } from '../app.js'
 import { jsonStrToMap } from '@/utils/sharedJsFile'
+
 export default {
   data() {
     return {
+      pickerOptions: {
+        disabledDate(time) {
+          return time.getTime() > Date.now()
+        },
+        shortcuts: [
+          {
+            text: '今天',
+            onClick(picker) {
+              picker.$emit('pick', new Date())
+            }
+          },
+          {
+            text: '昨天',
+            onClick(picker) {
+              const date = new Date()
+              date.setTime(date.getTime() - 3600 * 1000 * 24)
+              picker.$emit('pick', date)
+            }
+          },
+          {
+            text: '一周前',
+            onClick(picker) {
+              const date = new Date()
+              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
+              picker.$emit('pick', date)
+            }
+          },
+          {
+            text: '元年',
+            onClick(picker) {
+              const date = new Date()
+              date.setTime(0)
+              picker.$emit('pick', date)
+            }
+          }
+        ]
+      },
+      startTime: null,
+      saleLog: '',
+      options: [
+        {
+          label: '计量传输物流实绩',
+          value: '计量传输物流实绩'
+        },
+        {
+          label: '委托发送报文',
+          value: '委托发送报文'
+        },
+        {
+          label: '物流金蝶订单操作',
+          value: '物流金蝶订单操作'
+        },
+        {
+          label: '金蝶通讯报文',
+          value: '金蝶通讯报文'
+        }
+      ],
+      serverName: '',
       orderNumber: null,
       first: true,
       second: true,
@@ -691,28 +779,37 @@ export default {
   mounted() {
     this.information()
   },
+  watch: {
+    saleLog() {
+      if (
+        this.saleLog == '计量传输物流实绩' ||
+        this.saleLog == '物流金蝶订单操作'
+      ) {
+        this.serverName = 'dil-join-api/'
+      } else if (this.saleLog == '委托发送报文') {
+        this.serverName = 'dil-tms-truck-api/'
+      } else if (this.saleLog == '金蝶通讯报文') {
+        this.serverName = 'dil-ams-api/'
+      }
+    }
+  },
   methods: {
-    //  transfer() {
-    //   console.log(jsonStrToMap(this.jsonStringValue), 'map')
-    //   const map = jsonStrToMap(this.jsonStringValue)
-    //   const obj = Array.from(map).reduce((obj, [key, value]) => {
-    //     Object.assign(obj, { [key]: value })
-    //   }, {})
-    //   this.transferMap = obj
-    //   console.log(this.transferMap, 'this.transferMap')
-    //   this.capacityName = map.get('carNo')
-    //   //判断是不是钢材销售,如果是钢材销售那就通过车牌号去查信息,如果不是钢材销售就拿运输订单号
-    //   if (map.get('flag') == 'GCXS') {
-    //     this.capacityName = map.get('carNo')
-    //      this.axios
-    //       .get('/api/v1/uc/getCapacityNumber?index=' + this.capacityName)
-    //       .then(res => {
-    //         this.transferList = res.data.data
-    //       })
-    //     console.log(this.transferList)
-    //     this.handleSelectCapacity(this.transferList[0])
-    //   }
-    // },
+    downLoadFile() {
+      console.log(
+        toDateStringDay(new Date(this.startTime)) + '-' + this.saleLog
+      )
+      const ele = document.createElement('a')
+      const url =
+        'https://wl.dasteel.cn:32322/api/v1/uc/getFile?path=/data/' +
+        this.serverName +
+        toDateStringDay(new Date(this.startTime)) +
+        '-' +
+        this.saleLog +
+        '.txt'
+      ele.setAttribute('href', url) //设置下载文件的url地址
+      ele.setAttribute('download', 'download') //用于设置下载文件的文件名
+      ele.click()
+    },
     selectLoadingIdRemark() {
       if (
         this.loadDetail.orderNumber &&

+ 1 - 1
src/views/index/components/login.vue

@@ -119,7 +119,7 @@ export default {
             .then(res => {
               console.log(res)
               if (res.code === '0') {
-                console.log('login resonse', res.data)
+                console.log('login resonse', res.data.user)
                 //  登录成功
                 //  设置缓存信息
                 setCookie('accessToken', res.data.accessToken, cookieTime, '/')