luobang пре 2 година
родитељ
комит
2643d568ad

+ 5 - 0
.prettierrc.json

@@ -0,0 +1,5 @@
+{ 
+ "singleQuote": true,
+ "semi": false,
+ "trailingComma":"none"
+}

+ 1 - 11
build/utils.js

@@ -15,17 +15,7 @@ const devPathSrc = path.resolve(__dirname, "../../../src"); // node_modules应
 // ['index','appoint','configManager','homepage',''inward,'queue','RMS','sale','serviceManager','SporadicManage'
 //       统计报表       组织机构/系统管理 采购  仓储
 //  'statisticalReport','systemConfig','TMS','WMS','workFlow']
-// let devModules = ["index", "appoint", "statisticalReport", "WMS","TMS"];
-// let devModules = ["index", "TMS", "appoint", "WMS", "queue"];
-// let devModules = ["index", "statisticalReport", "inward"];
-// let devModules = ["index", "WMS", "inward"];
-// let devModules = ["index", "inward", "WMS", "queue"];
-// let devModules = ["index", "appoint", "statisticalReport", "sale"];
-// let devModules = ["index", "appoint", "statisticalReport", "WMS", "sale"];
-let devModules = ["all"];
-//let devModules = ["BMS","index","sale","appoint","AMS","queue","QMS","RMS",'statisticalReport',"inward"];
-
-//let devModules = ["BMS","index","sale","appoint","AMS","queue","QMS","RMS",'statisticalReport'];
+let devModules = ["index", "statisticalReport", "appoint", "sale"];
 
 if (pathSrc.indexOf("node_modules") > -1) {
   devModules = require("../../../cors.js").devModules;

+ 2 - 2
config/index.js

@@ -65,8 +65,8 @@ let proxyTable = {
   },
   // 所有数据的请求域名地址
   "/api/v1": {
-    target: "http://172.16.33.166:80",
-    // target: "http://localhost:8080",
+    // target: "http://172.16.33.166:80",
+    target: "http://localhost:8080",
     // target: "http://192.168.1.101:8080",
     ws: true,
     pathRewrite: {

+ 254 - 199
src/config/routerBefore.js

@@ -1,22 +1,21 @@
 // 路由前置操作
-import store from '@/store/index.js';
-import {
-  Message
-} from 'element-ui';
-import {
-  getCookie,
-  setCookie,
-  dgTree
-} from '@/utils/util.js';
-import axios from '@/config/axios.js';
-import {
-  stDev,
-  stProd,
-  proPath
-} from '@/config/config.js';
+import store from '@/store/index.js'
+import { Message } from 'element-ui'
+import { getCookie, setCookie, dgTree } from '@/utils/util.js'
+import axios from '@/config/axios.js'
+import { stDev, stProd, proPath } from '@/config/config.js'
 
 // 免登录白名单
-const whiteList = ['/', '/login', '/download', '/page404', '/dingtalkTaskMobileEnd', '/dingtalkWorkFlowMobileEnd', '/luckDraw', '/printScan'];
+const whiteList = [
+  '/',
+  '/login',
+  '/download',
+  '/page404',
+  '/dingtalkTaskMobileEnd',
+  '/dingtalkWorkFlowMobileEnd',
+  '/luckDraw',
+  '/printScan'
+]
 
 /**
  * 当前路由取标题
@@ -25,22 +24,22 @@ const whiteList = ['/', '/login', '/download', '/page404', '/dingtalkTaskMobileE
  * @param {Array} menu 菜单树
  * @returns {String} 标题
  */
-const titleFn = function (to, menu) {
-  let title = '';
+const titleFn = function(to, menu) {
+  let title = ''
   if (to.meta && to.meta.title) {
-    return to.meta.title;
+    return to.meta.title
   }
   //
   if (to.meta && to.meta.code) {
     //  查找标题
-    let code = to.meta.code;
+    let code = to.meta.code
     dgTree(menu, '', item => {
       if (item.menuCode === code) {
-        title = item.menuLabel;
+        title = item.menuLabel
       }
-    });
+    })
   }
-  return title;
+  return title
 }
 
 /**
@@ -49,274 +48,330 @@ const titleFn = function (to, menu) {
  * @param {Array} menu 菜单树
  * @returns {Array} matched
  */
-const breadcrumbFn = function (to, menu) {
-  let code = to.meta.code;
-  let list = [];
-  let item = null;
-  let data = [];
-  let getPid = function (pId) {
+const breadcrumbFn = function(to, menu) {
+  let code = to.meta.code
+  let list = []
+  let item = null
+  let data = []
+  let getPid = function(pId) {
     for (let ii of list) {
       if (ii.menuId === pId) {
-        return ii;
+        return ii
       }
     }
-    return null;
+    return null
   }
   dgTree(menu, '', leaf => {
-    list.push(leaf);
+    list.push(leaf)
     if (leaf.menuCode === code) {
-      item = leaf;
+      item = leaf
     }
-  });
-  let init = function (pId) {
-    let itemPid = getPid(pId);
+  })
+  let init = function(pId) {
+    let itemPid = getPid(pId)
     if (itemPid) {
-      data.push(itemPid);
-      init(itemPid.pId);
+      data.push(itemPid)
+      init(itemPid.pId)
     }
   }
   //
   if (item) {
-    data.push(item);
-    init(item.pId);
+    data.push(item)
+    init(item.pId)
   }
   if (data.length > 1) {
-    return data.reverse();
+    return data.reverse()
   }
   //
   to.matched.forEach(item => {
     dgTree(menu, '', leaf => {
       if (item.meta && item.meta.code === leaf.menuCode) {
-        data.push(leaf);
+        data.push(leaf)
       }
-    });
-  });
-  return data;
+    })
+  })
+  return data
 }
 //  路由前置操作
-const routerBefore = function (router, constantRouterMap) {
+const routerBefore = function(router, constantRouterMap) {
   let flag = false
   console.log('开始了')
   router.beforeEach((to, from, next) => {
     //  面包屑
     if (document.domain.indexOf('steerinfo.com') > -1) {
-      document.domain = 'steerinfo.com';
+      document.domain = 'steerinfo.com'
     }
-    store.commit('breadcrumb', breadcrumbFn(to, store.state.routes));
+    store.commit('breadcrumb', breadcrumbFn(to, store.state.routes))
     //  标题
     if (to.meta && !to.meta.title) {
-      document.title = titleFn(to, store.state.routes) + ' ' + document.title.substr(document.title.indexOf('-'));
+      document.title =
+        titleFn(to, store.state.routes) +
+        ' ' +
+        document.title.substr(document.title.indexOf('-'))
     } else {
-      document.title = to.meta.title + ' ' + document.title.substr(document.title.indexOf('-'));
+      document.title =
+        to.meta.title + ' ' + document.title.substr(document.title.indexOf('-'))
     }
     if (to.query.ticket) {
       console.log('开始了2')
-      setCookie('ticket', to.query.ticket, '', '/');
+      setCookie('ticket', to.query.ticket, '', '/')
       let res = axios.get('pass/auth/ticket', {
         params: {
           ticket: to.query.ticket || '-5696372145848366561'
         }
-      });
-        res.then(res => {
-            if (res.succeed) {
-              DoneCookie(to, from, next, res.data.accessToken, flag)
-            }
-        }).catch(err => {
+      })
+      res
+        .then(res => {
+          if (res.succeed) {
+            DoneCookie(to, from, next, res.data.accessToken, flag)
+          }
+        })
+        .catch(err => {
           console.log(err)
           Message('登陆账户异常, 请联系管理员')
-        });
+        })
     } else {
       console.log('开始了3')
       DoneCookie(to, from, next, to.query.accessToken, flag)
     }
-  });
+  })
 }
+
 function DoneCookie(to, from, next, accessToken, flag) {
   if (accessToken) {
     if (to.query.menuLeave) {
-      setCookie('menuLeave', to.query.menuLeave, '', '/', '', '', true);
+      setCookie('menuLeave', to.query.menuLeave, '', '/', '', '', true)
     } else {
-      setCookie('menuLeave', '', '', '/', '', '', true);
+      setCookie('menuLeave', '', '', '/', '', '', true)
     }
-    setCookie('accessToken', accessToken, '', '/');
-    store.dispatch('getLoginInfo').then(res => { // 拉取info
-      if (res.code === '0') {
-        setCookie('userId', res.data.user.userId);
-        setCookie('loginId', res.data.user.userId); // 为配合bms取值添加
-        setCookie('loginName', res.data.user.userCode);
-        let info = JSON.parse(JSON.stringify(res.data.user));
-        for (let k in info) {
-          if (k === 'sysGroup' || k === 'sysCompanys' || k === 'sysRoles') {
-            delete info[k];
-          }
-        }
-        setCookie('userInfo', JSON.stringify(info));
-        // 判断用户集团公司情况跳转
-        let userInfo = res.data.user;
-        // 超级管理员
-        if (userInfo.userCode === 'admin') {
-          if (userInfo.sysCompanys) {
-            // 公司列表过多时cookie存放失败,存至localStorage
-            // setCookie('companys', JSON.stringify(userInfo.sysCompanys));
-            window.top.localStorage.setItem('sysGroup', JSON.stringify(userInfo.sysGroup));
-            window.top.localStorage.setItem('companys', JSON.stringify(userInfo.sysCompanys));
-            if (userInfo.hasOwnProperty('sysCompanys')) {
-              window.top.localStorage.setItem('companyId', userInfo.sysCompanys[0].id);
+    setCookie('accessToken', accessToken, '', '/')
+    store
+      .dispatch('getLoginInfo')
+      .then(res => {
+        // 拉取info
+        if (res.code === '0') {
+          setCookie('userId', res.data.user.userId)
+          setCookie('loginId', res.data.user.userId) // 为配合bms取值添加
+          setCookie('loginName', res.data.user.userCode)
+          let info = JSON.parse(JSON.stringify(res.data.user))
+          for (let k in info) {
+            if (k === 'sysGroup' || k === 'sysCompanys' || k === 'sysRoles') {
+              delete info[k]
             }
           }
-          next({
-            path: '/default'
-          });
-          // 普通用户
-        } else if (userInfo.orgCode === 'zizhuyitiji') {
-          next({
-            path: '/printScan'
-          });
-        } else {
-          if (userInfo.hasOwnProperty('sysGroup') && userInfo.sysGroup !== '' && userInfo.sysGroup !== null && JSON.stringify(userInfo.sysGroup) !== '{}' && JSON.stringify(userInfo.sysGroup) !== '[]') {
-            window.top.localStorage.setItem('sysGroup', JSON.stringify(userInfo.sysGroup));
-            if (userInfo.hasOwnProperty('sysCompanys')) {
-              window.top.localStorage.setItem('companys', JSON.stringify(userInfo.sysCompanys));
-              window.top.localStorage.setItem('companyId', userInfo.sysCompanys[0].id);
-              if (userInfo.sysCompanys.length > 1) {
-                // 跳转选择集团公司页面
-                next({
-                  path: '/selectCompany'
-                });
+          setCookie('userInfo', JSON.stringify(info))
+          // 判断用户集团公司情况跳转
+          let userInfo = res.data.user
+          // 超级管理员
+          if (userInfo.userCode === 'admin') {
+            if (userInfo.sysCompanys) {
+              // 公司列表过多时cookie存放失败,存至localStorage
+              // setCookie('companys', JSON.stringify(userInfo.sysCompanys));
+              window.top.localStorage.setItem(
+                'sysGroup',
+                JSON.stringify(userInfo.sysGroup)
+              )
+              window.top.localStorage.setItem(
+                'companys',
+                JSON.stringify(userInfo.sysCompanys)
+              )
+              if (userInfo.hasOwnProperty('sysCompanys')) {
+                window.top.localStorage.setItem(
+                  'companyId',
+                  userInfo.sysCompanys[0].id
+                )
+              }
+            }
+            next({
+              path: '/default'
+            })
+            // 普通用户
+          } else {
+            if (
+              userInfo.hasOwnProperty('sysGroup') &&
+              userInfo.sysGroup !== '' &&
+              userInfo.sysGroup !== null &&
+              JSON.stringify(userInfo.sysGroup) !== '{}' &&
+              JSON.stringify(userInfo.sysGroup) !== '[]'
+            ) {
+              window.top.localStorage.setItem(
+                'sysGroup',
+                JSON.stringify(userInfo.sysGroup)
+              )
+              if (userInfo.hasOwnProperty('sysCompanys')) {
+                window.top.localStorage.setItem(
+                  'companys',
+                  JSON.stringify(userInfo.sysCompanys)
+                )
+                window.top.localStorage.setItem(
+                  'companyId',
+                  userInfo.sysCompanys[0].id
+                )
+                if (userInfo.sysCompanys.length > 1) {
+                  // 跳转选择集团公司页面
+                  next({
+                    path: '/selectCompany'
+                  })
+                } else {
+                  next({
+                    path: '/default'
+                  })
+                }
               } else {
-                next({
-                  path: '/default'
-                });
+                this.$message.error(
+                  '后台返回数据缺少company信息,请联系开发人员!'
+                )
               }
             } else {
-              this.$message.error('后台返回数据缺少company信息,请联系开发人员!');
+              this.$message.error(
+                '必须隶属一个集团!请先联系管理员添加集团信息!'
+              )
             }
-          } else {
-            this.$message.error('必须隶属一个集团!请先联系管理员添加集团信息!');
           }
+        } else {
+          Message('登录已过期,请重新登录')
+          setCookie('accessToken', '', -1, '/')
+          setCookie('refreshToken', '', -1, '/')
+          setCookie('workDate', '', -1)
+          setCookie('appId', '', -1, '/')
+          setCookie('ticket', '', -1, '/')
+          setTimeout(() => {
+            window.top.location.href = store.getters.ctx
+          }, 500)
         }
-      } else {
-        Message('登录已过期,请重新登录');
-        setCookie('accessToken', '', -1, '/');
-        setCookie('refreshToken', '', -1, '/');
-        setCookie('workDate', '', -1);
-        setCookie('appId', '', -1, '/');
-        setCookie('ticket', '', -1, '/');
-        setTimeout(() => {
-          window.top.location.href = store.getters.ctx;
-        }, 500)
-      }
-    }).catch(err => {
-      console.log(err);
-      Message('登录已过期,请重新登录');
-      setCookie('accessToken', '', -1, '/');
-      setCookie('refreshToken', '', -1, '/');
-      setCookie('workDate', '', -1);
-      setCookie('appId', '', -1, '/');
-      setCookie('ticket', '', -1, '/');
-      window.top.location.href = store.getters.ctx;
-    });
-  } else if (getCookie('accessToken')) { // 判断是否有token
-    if (window.top.document.URL === window.document.URL && !window.top.localStorage.getItem('allPrivilege')) {
-      let userInfo = JSON.parse(getCookie('userInfo'));
-      setCookie('userId', userInfo.userId);
-      let companyId = window.top.localStorage.getItem('companyId');
-      let menuId = window.top.localStorage.getItem('activeMenu');
+      })
+      .catch(err => {
+        console.log(err)
+        Message('登录已过期,请重新登录')
+        setCookie('accessToken', '', -1, '/')
+        setCookie('refreshToken', '', -1, '/')
+        setCookie('workDate', '', -1)
+        setCookie('appId', '', -1, '/')
+        setCookie('ticket', '', -1, '/')
+        window.top.location.href = store.getters.ctx
+      })
+  } else if (getCookie('accessToken')) {
+    // 判断是否有token
+    if (
+      window.top.document.URL === window.document.URL &&
+      !window.top.localStorage.getItem('allPrivilege')
+    ) {
+      let userInfo = JSON.parse(getCookie('userInfo'))
+      setCookie('userId', userInfo.userId)
+      let companyId = window.top.localStorage.getItem('companyId')
+      let menuId = window.top.localStorage.getItem('activeMenu')
       // 查询所有注释掉
       // store.dispatch('getAllMenuUrl', { companyId: companyId });
       // store.dispatch('getOwnMenuUrl', { userId: userId, menuId: menuId });
-      store.dispatch('getOwnMenuUrl', { companyId: companyId });
+      store.dispatch('getOwnMenuUrl', {
+        companyId: companyId
+      })
     }
-    console.log('to.path: ' + to.path);
+    console.log('to.path: ' + to.path)
     if (to.path === '/login' || to.path === '/') {
       // 判断非本地模式登录页面不可访问
       if (document.location.origin.indexOf('steerinfo.com') !== -1) {
         next({
           path: '/page404'
-        });
+        })
       } else {
-        console.log('to.path:======= ');
+        console.log('to.path:======= ')
         /**
         next({
           path: '/'
         }); */
-        next();
+        next()
       }
     } else {
-      if (window.top.document.URL === window.document.URL && store.state.userInfo === null) { // 判断当前用户是否已拉取完路由信息
-        store.dispatch('getUserInfo').then(res => { // 拉取info
-          if (res.code === '0') {
-            const userInfo = res.data;
-            let appId = getCookie('appId');
-            userInfo.appId = appId;
-            store.dispatch('generateRoutes', {
-              userInfo
-            }).then(() => { // 生成可访问的路由表
-              // router.addRoutes(store.state.routes) // 动态添加可访问路由表
-              if (flag) {
-                next()
-              } else {
-                next({
-                  ...to,
-                  replace: true
+      if (
+        window.top.document.URL === window.document.URL &&
+        store.state.userInfo === null
+      ) {
+        // 判断当前用户是否已拉取完路由信息
+        store
+          .dispatch('getUserInfo')
+          .then(res => {
+            // 拉取info
+            if (res.code === '0') {
+              const userInfo = res.data
+              let appId = getCookie('appId')
+              userInfo.appId = appId
+              store
+                .dispatch('generateRoutes', {
+                  userInfo
                 })
-                flag = true
-              }
-              // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
-              console.log('这是个什么东西', {
-                ...to,
-                replace: true
-              })
-            })
-          } else {
-            Message('登录已过期,请重新登录');
+                .then(() => {
+                  // 生成可访问的路由表
+                  // router.addRoutes(store.state.routes) // 动态添加可访问路由表
+                  if (flag) {
+                    next()
+                  } else {
+                    next({
+                      ...to,
+                      replace: true
+                    })
+                    flag = true
+                  }
+                  // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
+                  console.log('这是个什么东西', {
+                    ...to,
+                    replace: true
+                  })
+                })
+            } else {
+              Message('登录已过期,请重新登录')
+              // next('/login'); // 否则全部重定向到登录页
+              // window.location.href = '/views/index.html';
+              setCookie('accessToken', '', -1, '/')
+              setCookie('refreshToken', '', -1, '/')
+              setCookie('appId', '', -1, '/')
+              setCookie('workDate', '', -1)
+              setCookie('ticket', '', -1, '/')
+              window.top.location.href = store.getters.ctx
+            }
+          })
+          .catch(err => {
+            console.log(err)
+            Message('登录已过期,请重新登录')
             // next('/login'); // 否则全部重定向到登录页
             // window.location.href = '/views/index.html';
-            setCookie('accessToken', '', -1, '/');
-            setCookie('refreshToken', '', -1, '/');
-            setCookie('appId', '', -1, '/');
-            setCookie('workDate', '', -1);
-            setCookie('ticket', '', -1, '/');
-            window.top.location.href = store.getters.ctx;
-          }
-        }).catch(err => {
-          console.log(err);
-          Message('登录已过期,请重新登录');
-          // next('/login'); // 否则全部重定向到登录页
-          // window.location.href = '/views/index.html';
-          setCookie('accessToken', '', -1, '/');
-          setCookie('refreshToken', '', -1, '/');
-          setCookie('appId', '', -1, '/');
-          setCookie('workDate', '', -1);
-          setCookie('ticket', '', -1, '/');
-          window.top.location.href = store.getters.ctx;
-        });
+            setCookie('accessToken', '', -1, '/')
+            setCookie('refreshToken', '', -1, '/')
+            setCookie('appId', '', -1, '/')
+            setCookie('workDate', '', -1)
+            setCookie('ticket', '', -1, '/')
+            window.top.location.href = store.getters.ctx
+          })
       } else {
         next() // 当有用户权限的时候,说明所有可访问路由已生成 如访问没权限的全面会自动进入404页面
       }
     }
   } else {
-    if (whiteList.indexOf(to.path) !== -1) { // 在免登录白名单,直接进入
+    if (whiteList.indexOf(to.path) !== -1) {
+      // 在免登录白名单,直接进入
       // 判断非本地模式登录页面不可访问
-      if ((to.path === '/login' || to.path === '/') && document.location.origin.indexOf('steerinfo.com') !== -1) {
+      if (
+        (to.path === '/login' || to.path === '/') &&
+        document.location.origin.indexOf('steerinfo.com') !== -1
+      ) {
         next({
           path: '/page404'
-        });
+        })
       } else {
-        next();
+        next()
       }
     } else {
-      Message('未登录');
+      Message('未登录')
       // next('/login'); // 否则全部重定向到登录页
       // window.location.href = '/views/index.html';
-      setCookie('accessToken', '', -1, '/');
-      setCookie('refreshToken', '', -1, '/');
-      setCookie('workDate', '', -1);
-      setCookie('appId', '', -1, '/');
-      setCookie('ticket', '', -1, '/');
-      window.top.location.href = store.getters.ctx;
+      setCookie('accessToken', '', -1, '/')
+      setCookie('refreshToken', '', -1, '/')
+      setCookie('workDate', '', -1)
+      setCookie('appId', '', -1, '/')
+      setCookie('ticket', '', -1, '/')
+      window.top.location.href = store.getters.ctx
     }
   }
 }
 
-export default routerBefore;
+export default routerBefore

+ 4 - 9
src/views/index/components/login.vue

@@ -146,8 +146,8 @@ export default {
                 // 判断用户集团公司情况跳转
                 let userInfo = res.data.user;
                 let sRedirect = this.$route.query.redirect;
-                console.log(userInfo)
-                console.log("userInfo")
+                console.log(userInfo);
+                console.log("userInfo");
                 // 超级管理员
                 if (userInfo.userCode === "admin") {
                   if (userInfo.sysCompanys) {
@@ -174,10 +174,7 @@ export default {
                     this.$router.push({ name: "default" }).catch(() => {});
                   }
                   // 普通用户
-                }
-                else if(userInfo.orgCode == 'zizhuyitiji'){
-                  this.$router.push("/printScan")
-                }else {
+                } else {
                   if (
                     userInfo.hasOwnProperty("sysGroup") &&
                     userInfo.sysGroup !== "" &&
@@ -209,7 +206,6 @@ export default {
                             .push({ name: "default" })
                             .catch(() => {});
                         }
-
                       }
                     } else {
                       this.$message.error(
@@ -221,7 +217,6 @@ export default {
                       "必须隶属一个集团!请先联系管理员添加集团信息!"
                     );
                   }
-
                 }
               } else {
                 //  登录失败
@@ -233,7 +228,7 @@ export default {
               }
               this.loginBtnLoading = false;
               setTimeout(() => {
-                // this.$router.go(0);
+                this.$router.go(0);
               }, 2000);
             })
             .catch(() => {

+ 22 - 29
src/views/index/components/printReceipt.vue

@@ -1,17 +1,5 @@
 <template>
   <div class="tableAllDate">
-    <div class="button-box">
-      <el-button
-        type="primary"
-        @click="print1()"
-        v-print="'#pdfDom1'"
-        style="width: 500px;height: 120px;font-size: 100px"
-      >
-        <!--class="el-icon-printer"-->
-        <!---->
-        打印
-      </el-button>
-    </div>
     <div id="pdfDom1">
       <div id="pdfDom" v-for="(item, index) in dataList" :key="index">
         <div class="blank"></div>
@@ -52,7 +40,7 @@
               <th style="width: 22.5%; text-align: center">规格型号</th>
               <th style="width: 14%">件数</th>
               <th style="width: 35%">重量</th>
-<!--              <th style="width: 21%">订单日期</th>-->
+              <!--              <th style="width: 21%">订单日期</th>-->
             </tr>
             <tr v-for="(item, index) in deliveryOrderMaterialList" :key="index">
               <td>{{ index + 1 }}</td>
@@ -60,7 +48,7 @@
               <td>{{ item.materialSpe }}{{ item.materialModel }}</td>
               <td>{{ item.materialNumber }}</td>
               <td>{{ item.materialWeight }}</td>
-<!--              <td>{{ item.makeDate }}</td>-->
+              <!--              <td>{{ item.makeDate }}</td>-->
             </tr>
           </table>
 
@@ -199,7 +187,7 @@
       </div>-->
         <!--设置中间的间隔以及虚线-->
         <div style="height: 80px"></div>
-        <hr width=1500px style="border:1px dashed black;height:1px">
+        <hr width="1500px" style="border:1px dashed black;height:1px" />
       </div>
     </div>
     <!-- <el-button style="margin-left: 45%;" type="primary" @click="getPdf()">
@@ -248,7 +236,7 @@ export default {
       htmlTitle: "客户换票送货单",
       note: "",
       dataList: ["1", "2", "3"],
-      timer1:''
+      timer1: ""
     };
   },
   created() {
@@ -267,6 +255,7 @@ export default {
   },
   methods: {
     getDeliveryOrder() {
+      const that = this;
       let orderNumber = this.$route.query.orderNumber;
       this.axios
         .post("/api/v1/tms/getDeliveryOrder?orderNumber=" + orderNumber)
@@ -288,21 +277,25 @@ export default {
           this.deliveryAddress = res.data.deliveryAddress;
           this.deliveryOrderMaterialList = res.data.deliveryOrderMaterialList;
           this.note = res.data.note;
+          that.print();
+          that.print1();
+          /*document.body.innerHTML=oldstr*/
         });
     },
-   print(){
-     let newstr=document.getElementById("pdfDom1").innerHTML
-     let oldstr=document.body.innerHTML
-     document.body.innerHTML=newstr
-     window.print()
-     /*document.body.innerHTML=oldstr*/
-     let orderNumber = this.$route.query.orderNumber;
-     this.axios.post("/api/v1/tms/changeNumber?orderNumber=" + orderNumber)
-   },
-    print1(){
+    print() {
+      console.log("执行了");
+      let newstr = document.getElementById("pdfDom1").innerHTML;
+      let oldstr = document.body.innerHTML;
+      document.body.innerHTML = newstr;
+      window.print();
+      /*document.body.innerHTML=oldstr*/
       let orderNumber = this.$route.query.orderNumber;
-      this.axios.post("/api/v1/tms/changeNumber?orderNumber=" + orderNumber)
-      this.backScan();
+      this.axios.post("/api/v1/tms/changeNumber?orderNumber=" + orderNumber);
+    },
+    print1() {
+      // let orderNumber = this.$route.query.orderNumber;
+      // this.axios.post("/api/v1/tms/changeNumber?orderNumber=" + orderNumber);
+      // this.backScan();
     },
     backScan() {
       this.$router.go(-1);
@@ -312,7 +305,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-#id{
+#id {
   width: 1500px;
   height: 700px;
 }

+ 59 - 60
src/views/index/router/index.js

@@ -11,8 +11,7 @@ import download from "@/views/index/components/download.vue";
 // 抽奖结果
 //import luckDraw from "@/views/index/components/luckDraw.vue";
 
-import luckDraw from '@/views/index/components/luckDraw.vue'
-
+import luckDraw from "@/views/index/components/luckDraw.vue";
 
 import printReceipt from "../components/printReceipt";
 // 网页登录不可访问
@@ -25,78 +24,78 @@ import printScan from "@/views/index/components/printScan.vue";
 
 Vue.use(Router);
 
-export const constantRouterMap = [{
-        path: '/',
-        meta: {
-            'title': '登录'
-        },
-        component: login
+export const constantRouterMap = [
+  {
+    path: "/",
+    meta: {
+      title: "登录"
     },
+    component: login
+  },
 
-    {
-        path: '/download',
-        name: 'download',
-        meta: {
-            'title': '下载'
-        },
-        component: download
-    },
   {
-    path: '/printScan',
-    name: 'printScan',
+    path: "/download",
+    name: "download",
     meta: {
-      'title': '下载'
+      title: "下载"
     },
-    component: printScan
+    component: download
   },
   {
-    path: '/printReceipt',
-    name: 'printReceipt',
+    path: "/printScan",
+    name: "printScan",
     meta: {
-      'title': '下载'
+      title: "下载"
     },
+    component: printScan
+  },
+  {
+    path: "/printReceipt",
+    name: "printReceipt",
     component: printReceipt
   },
-    {
-        path: '/login',
-        name: 'login',
-        meta: {
-            'title': '登录'
-        },
-        component: login
+  {
+    path: "/login",
+    name: "login",
+    meta: {
+      title: "登录"
     },
-    {
-        path:'/luckDraw',
-        name:'luckDraw',
-        meta:{
-            'title':'抽奖结果'
-        },
-        component:luckDraw
+    component: login
+  },
+  {
+    path: "/luckDraw",
+    name: "luckDraw",
+    meta: {
+      title: "抽奖结果"
     },
-    {
-        path: '/default',
-        name: 'default',
-        component: main,
-        meta: {
-            'title': '首页'
-        }
+    component: luckDraw
+  },
+  {
+    path: "/default",
+    name: "default",
+    component: main,
+    meta: {
+      title: "首页"
+    }
+  },
+  {
+    path: "/selectCompany",
+    name: "selectCompany",
+    component: selectCompany,
+    meta: {
+      title: "集团与公司用户跳转页"
+    }
+  },
+  ,
+  {
+    path: "/page404",
+    name: "page404",
+    meta: {
+      title: "404"
     },
-    {
-        path: '/selectCompany',
-        name: 'selectCompany',
-        component: selectCompany,
-        meta: {
-            'title': '集团与公司用户跳转页'
-        }
-    },,
-    {
-        path: '/page404',
-        name: 'page404',
-        meta: {
-            'title': '404'
-        },
-        component: page404
-}];
+    component: page404
+  }
+];
 
 const router = new Router({
   // mode: 'history', // require service support

+ 208 - 184
src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelAllReport.vue

@@ -382,7 +382,11 @@
         </el-table-column>
         <el-table-column prop="canwork" label="继续装">
           <template slot-scope="scope">
-            <el-button  type="primary" size="small" @click="continue1(scope.row)">
+            <el-button
+              type="primary"
+              size="small"
+              @click="continue1(scope.row)"
+            >
               继续装
             </el-button>
           </template>
@@ -670,28 +674,28 @@ export default {
           .then(res => {
             if (res.data.code == "200") {
               this.$message({
-                duration:600,
-                message:"反关闭成功",
-                type:"success"
-              })
-                //.success("反关闭成功");
+                duration: 600,
+                message: "反关闭成功",
+                type: "success"
+              });
+              //.success("反关闭成功");
               this.getSteelReport();
             } else {
               this.$message({
-                duration:600,
-                message:"反关闭失败",
-                type:"error"
-              })
+                duration: 600,
+                message: "反关闭失败",
+                type: "error"
+              });
               //this.$message.error("反关闭失败");
               this.getSteelReport();
             }
           })
           .catch(() => {
             this.$message({
-              duration:600,
-              message:"反关闭失败",
-              type:"error"
-            })
+              duration: 600,
+              message: "反关闭失败",
+              type: "error"
+            });
             //this.$message.error("反关闭失败");
             this.getSteelReport();
           });
@@ -790,10 +794,10 @@ export default {
               this.carrierList = [];
               if (res.data.data.length == 0) {
                 this.$message({
-                  duration:600,
-                  message:"承运商不存在,请前往注册",
-                  type:"info"
-                })
+                  duration: 600,
+                  message: "承运商不存在,请前往注册",
+                  type: "info"
+                });
                 //this.$message.info("承运商不存在,请前往注册");
                 return;
               }
@@ -825,10 +829,10 @@ export default {
             if (res.data.code == "200") {
               if (res.data.data.length == 0) {
                 this.$message({
-                  duration:600,
-                  message:"车牌号不存在,请前往注册",
-                  type:"info"
-                })
+                  duration: 600,
+                  message: "车牌号不存在,请前往注册",
+                  type: "info"
+                });
                 //this.$message.info("车牌号不存在,请前往注册");
                 return;
               }
@@ -863,19 +867,19 @@ export default {
       row.capacityId = row.newsCapacityId;
       if (row.newsCapacityId == null) {
         this.$message({
-          duration:600,
-          message:"请先注册车牌号或者选中弹出后再提交!",
-          type:"warning"
-        })
+          duration: 600,
+          message: "请先注册车牌号或者选中弹出后再提交!",
+          type: "warning"
+        });
         //this.$message.warning("请先注册车牌号或者选中弹出后再提交!");
         return;
       }
       if (!isVehicleNumber(row.capacityNo)) {
         this.$message({
-          duration:600,
-          message:"请输入正确格式的车牌号!",
-          type:"error"
-        })
+          duration: 600,
+          message: "请输入正确格式的车牌号!",
+          type: "error"
+        });
         //this.$message.error("请输入正确格式的车牌号!");
         return;
       }
@@ -891,19 +895,30 @@ export default {
           .then(res => {
             if (res.data.code == 200) {
               this.$message({
-                duration:600,
-                message:"变更车牌号成功",
-                type:"success"
-              })
+                duration: 600,
+                message: "变更车牌号成功",
+                type: "success"
+              });
+              this.axios
+                .post(
+                  "/api/v1/ams/matchingDriverTelRecently?capacityNumber=" +
+                    row.capacityNo
+                )
+                .then(res => {
+                  if (res.data.data != null) {
+                    this.steelMap.capacityTel = res.data.data;
+                    this.updateDriverTel(row);
+                  }
+                });
               //this.$message.success("变更车牌号成功!");
               this.getSteelReport();
               loading.close();
             } else {
               this.$message({
-                duration:600,
-                message:"变更失败,请联系管理员",
-                type:"error"
-              })
+                duration: 600,
+                message: "变更失败,请联系管理员",
+                type: "error"
+              });
               //this.$message.success("变更失败,请联系管理员");
               this.getSteelReport();
               loading.close();
@@ -911,10 +926,10 @@ export default {
           })
           .catch(() => {
             this.$message({
-              duration:600,
-              message:"变更失败,请联系管理员",
-              type:"error"
-            })
+              duration: 600,
+              message: "变更失败,请联系管理员",
+              type: "error"
+            });
             //this.$message.success("变更失败,请联系管理员");
             this.getSteelReport();
             loading.close();
@@ -922,10 +937,10 @@ export default {
       } else {
         if (row.carrierIds == 0) {
           this.$message({
-            duration:600,
-            message:"请先选择承运商!",
-            type:"error"
-          })
+            duration: 600,
+            message: "请先选择承运商!",
+            type: "error"
+          });
           //this.$message.error("请先选择承运商!");
           return;
         }
@@ -942,7 +957,7 @@ export default {
         arr.push(row);
         const loading = this.$loading({
           lock: true,
-          text: "正在变更车牌号",
+          text: "正在派车",
           spinner: "el-icon-loading",
           background: "rgba(0, 0, 0, 0.7)"
         });
@@ -951,19 +966,30 @@ export default {
           .then(res => {
             if (res.data.code == "200") {
               this.$message({
-                duration:600,
-                message:"派车成功!",
-                type:"success"
-              })
+                duration: 600,
+                message: "派车成功!",
+                type: "success"
+              });
+              this.axios
+                .post(
+                  "/api/v1/ams/matchingDriverTelRecently?capacityNumber=" +
+                    row.capacityNo
+                )
+                .then(res => {
+                  if (res.data.data != null) {
+                    this.steelMap.capacityTel = res.data.data;
+                    this.updateDriverTel(row);
+                  }
+                });
               //this.$message.success("派车成功!");
               this.getSteelReport();
               loading.close();
             } else {
               this.$message({
-                duration:600,
-                message:"派车失败,请联系管理员",
-                type:"error"
-              })
+                duration: 600,
+                message: "派车失败,请联系管理员",
+                type: "error"
+              });
               //this.$message.error("派车失败,请联系管理员");
               this.getSteelReport();
               loading.close();
@@ -971,10 +997,10 @@ export default {
           })
           .catch(() => {
             this.$message({
-              duration:600,
-              message:"派车失败,请联系管理员",
-              type:"error"
-            })
+              duration: 600,
+              message: "派车失败,请联系管理员",
+              type: "error"
+            });
             //this.$message.error("派车失败,请联系管理员");
             this.getSteelReport();
             loading.close();
@@ -991,11 +1017,11 @@ export default {
       });
       if (row.capacityTel == null || row.capacityTel == "") {
         this.$message({
-          duration:100,
-          message:'电话号码不能为空',
-          type:'error'
-        })
-          //.error("电话号码不能为空");
+          duration: 100,
+          message: "电话号码不能为空",
+          type: "error"
+        });
+        //.error("电话号码不能为空");
         return;
       }
       this.axios
@@ -1006,19 +1032,19 @@ export default {
         .then(res => {
           if (res.data.code == "200") {
             this.$message({
-              duration:600,
-              message:"修改成功",
-              type:"success"
-            })
+              duration: 600,
+              message: "修改成功",
+              type: "success"
+            });
             //this.$message.success("修改成功");
             this.getSteelReport();
             loading.close();
           } else {
             this.$message({
-              duration:600,
-              message:"修改失败",
-              type:"error"
-            })
+              duration: 600,
+              message: "修改失败",
+              type: "error"
+            });
             //this.$message.error("修改失败");
             this.getSteelReport();
             loading.close();
@@ -1026,10 +1052,10 @@ export default {
         })
         .catch(() => {
           this.$message({
-            duration:600,
-            message:"修改失败",
-            type:"error"
-          })
+            duration: 600,
+            message: "修改失败",
+            type: "error"
+          });
           //this.$message.error("修改失败");
           this.getSteelReport();
           loading.close();
@@ -1045,11 +1071,11 @@ export default {
       });
       if (row.consigneeTel == null || row.consigneeTel == "") {
         this.$message({
-          duration:600,
-          message:'电话号码不能为空',
-          type:"error"
-        })
-          //.error("电话号码不能为空");
+          duration: 600,
+          message: "电话号码不能为空",
+          type: "error"
+        });
+        //.error("电话号码不能为空");
         this.getSteelReport();
         loading.close();
         return;
@@ -1063,19 +1089,19 @@ export default {
         .then(res => {
           if (res.data.code == "200") {
             this.$message({
-              duration:600,
-              message:"修改成功",
-              type:"success"
-            })
+              duration: 600,
+              message: "修改成功",
+              type: "success"
+            });
             //this.$message.success("修改成功");
             this.getSteelReport();
             loading.close();
           } else {
             this.$message({
-              duration:600,
-              message:"修改失败",
-              type:"error"
-            })
+              duration: 600,
+              message: "修改失败",
+              type: "error"
+            });
             //this.$message.error("修改失败");
             this.getSteelReport();
             loading.close();
@@ -1083,10 +1109,10 @@ export default {
         })
         .catch(() => {
           this.$message({
-            duration:600,
-            message:"修改失败",
-            type:"error"
-          })
+            duration: 600,
+            message: "修改失败",
+            type: "error"
+          });
           //this.$message.error("修改失败");
           this.getSteelReport();
           loading.close();
@@ -1114,19 +1140,19 @@ export default {
             .then(res => {
               if (res.data.code == "200") {
                 this.$message({
-                  duration:600,
-                  message:"关闭车辆成功",
-                  type:"errsuccessor"
-                })
+                  duration: 600,
+                  message: "关闭车辆成功",
+                  type: "errsuccessor"
+                });
                 //this.$message.success("关闭车辆成功");
                 this.getSteelReport();
                 loading.close();
               } else {
                 this.$message({
-                  duration:600,
-                  message:"关闭车辆失败",
-                  type:"error"
-                })
+                  duration: 600,
+                  message: "关闭车辆失败",
+                  type: "error"
+                });
                 //this.$message.error("关闭车辆失败");
                 this.getSteelReport();
                 loading.close();
@@ -1134,10 +1160,10 @@ export default {
             })
             .catch(() => {
               this.$message({
-                duration:600,
-                message:"关闭车辆失败",
-                type:"error"
-              })
+                duration: 600,
+                message: "关闭车辆失败",
+                type: "error"
+              });
               //this.$message.error("关闭车辆失败");
               this.getSteelReport();
               loading.close();
@@ -1145,10 +1171,10 @@ export default {
         })
         .catch(() => {
           this.$message({
-            duration:600,
-            message:"取消关闭",
-            type:"info"
-          })
+            duration: 600,
+            message: "取消关闭",
+            type: "info"
+          });
           //this.$message.info("取消关闭");
         });
     },
@@ -1156,10 +1182,10 @@ export default {
     updateTruckCarrier(row) {
       if (row.newCarrierId == null) {
         this.$message({
-          duration:600,
-          message:"注册承运商或者选中弹出层之后再提交!",
-          type:"warning"
-        })
+          duration: 600,
+          message: "注册承运商或者选中弹出层之后再提交!",
+          type: "warning"
+        });
         //this.$message.warning("请注册承运商或者选中弹出层之后再提交!");
         this.getSteelReport();
         return;
@@ -1176,19 +1202,19 @@ export default {
           .then(res => {
             if (res.data.code == "200") {
               this.$message({
-                duration:600,
-                message:"修改承运商授权成功!",
-                type:"success"
-              })
+                duration: 600,
+                message: "修改承运商授权成功!",
+                type: "success"
+              });
               //this.$message.success("修改承运商授权成功");
               this.getSteelReport();
               loading.close();
             } else {
               this.$message({
-                duration:600,
-                message:"修改失败,请联系管理员!",
-                type:"error"
-              })
+                duration: 600,
+                message: "修改失败,请联系管理员!",
+                type: "error"
+              });
               //this.$message.error("修改失败,请联系管理员!");
               this.getSteelReport();
               loading.close();
@@ -1196,10 +1222,10 @@ export default {
           })
           .catch(() => {
             this.$message({
-              duration:600,
-              message:"修改失败,请联系管理员!",
-              type:"error"
-            })
+              duration: 600,
+              message: "修改失败,请联系管理员!",
+              type: "error"
+            });
             //this.$message.error("修改失败,请联系管理员!");
             this.getSteelReport();
             loading.close();
@@ -1222,7 +1248,7 @@ export default {
                 duration: 1000,
                 message: "授权承运商成功",
                 type: "success"
-              })
+              });
               //this.$message.success("授权承运商成功");
               if (res.data.code == "0") {
                 this.$message.success("授权承运商成功");
@@ -1233,7 +1259,7 @@ export default {
                   duration: 1000,
                   message: "授权失败,请联系管理员",
                   type: "error"
-                })
+                });
                 //this.$message.error("授权失败,请联系管理员");
                 this.getSteelReport();
                 loading.close();
@@ -1242,10 +1268,10 @@ export default {
           })
           .catch(() => {
             this.$message({
-              duration:1000,
-              message:"授权失败,请联系管理员",
-              type:"error"
-            })
+              duration: 1000,
+              message: "授权失败,请联系管理员",
+              type: "error"
+            });
             //this.$message.error("授权失败,请联系管理员");
             this.getSteelReport();
             loading.close();
@@ -1358,20 +1384,20 @@ export default {
         .then(res => {
           if (res.data.code == "200") {
             this.$message({
-              duration:1000,
-              message:"修改收货地址成功!",
-              type:"success"
-            })
+              duration: 1000,
+              message: "修改收货地址成功!",
+              type: "success"
+            });
             //this.$message.success("修改收货地址成功!");
             this.getSteelReport();
             this.drawer = false;
             loading.close();
           } else {
             this.$message({
-              duration:1000,
-              message:"修改失败,请联系管理员!",
-              type:"error"
-            })
+              duration: 1000,
+              message: "修改失败,请联系管理员!",
+              type: "error"
+            });
             //this.$message.error("修改失败,请联系管理员!");
             this.getSteelReport();
             this.drawer = false;
@@ -1380,10 +1406,10 @@ export default {
         })
         .catch(() => {
           this.$message({
-            duration:1000,
-            message:"修改失败,请联系管理员!",
-            type:"error"
-          })
+            duration: 1000,
+            message: "修改失败,请联系管理员!",
+            type: "error"
+          });
           //this.$message.error("修改失败,请联系管理员!");
           this.getSteelReport();
           this.drawer = false;
@@ -1452,19 +1478,19 @@ export default {
         .then(res => {
           if (res.data.code == "200") {
             this.$message({
-              duration:1000,
-              message:"修改物资数量成功",
-              type:"success"
-            })
+              duration: 1000,
+              message: "修改物资数量成功",
+              type: "success"
+            });
             //this.$message.success("修改物资数量成功");
             this.getSteelReport();
             loading.close();
           } else {
             this.$message({
-              duration:1000,
-              message:"修改物资数量失败,请联系管理员",
-              type:"error"
-            })
+              duration: 1000,
+              message: "修改物资数量失败,请联系管理员",
+              type: "error"
+            });
             //this.$message.error("修改物资数量失败,请联系管理员");
             this.getSteelReport();
             loading.close();
@@ -1472,29 +1498,27 @@ export default {
         })
         .catch(() => {
           this.$message({
-            duration:1000,
-            message:"修改物资数量失败,请联系管理员",
-            type:"error"
-          })
+            duration: 1000,
+            message: "修改物资数量失败,请联系管理员",
+            type: "error"
+          });
           //this.$message.error("修改物资数量失败,请联系管理员");
           this.getSteelReport();
           loading.close();
         });
     },
     //继续装
-    continue1(row){
-      let map={
-        orderId:row.orderId
-      }
-      this.axios
-        .post("/api/v1/oms/updateContinueStaus", map)
-        .then((res)=>{
-          if (res.data.code=="200"){
-            this.$message.success("修改成功")
-          }else {
-            this.$message.error("修改失败")
-          }
-        })
+    continue1(row) {
+      let map = {
+        orderId: row.orderId
+      };
+      this.axios.post("/api/v1/oms/updateContinueStaus", map).then(res => {
+        if (res.data.code == "200") {
+          this.$message.success("修改成功");
+        } else {
+          this.$message.error("修改失败");
+        }
+      });
       this.getSteelReport();
     },
     //关闭单条分录
@@ -1527,19 +1551,19 @@ export default {
               .then(res => {
                 if (res.data.code == "200") {
                   this.$message({
-                    duration:1000,
-                    message:"关闭成功",
-                    type:"success"
-                  })
+                    duration: 1000,
+                    message: "关闭成功",
+                    type: "success"
+                  });
                   //this.$message.success("关闭成功");
                   this.getSteelReport();
                   loading.close();
                 } else {
                   this.$message({
-                    duration:1000,
-                    message:"关闭失败,请联系管理员",
-                    type:"error"
-                  })
+                    duration: 1000,
+                    message: "关闭失败,请联系管理员",
+                    type: "error"
+                  });
                   //this.$message.error("关闭失败,请联系管理员");
                   this.getSteelReport();
                   loading.close();
@@ -1547,10 +1571,10 @@ export default {
               })
               .catch(() => {
                 this.$message({
-                  duration:1000,
-                  message:"关闭失败,请联系管理员",
-                  type:"error"
-                })
+                  duration: 1000,
+                  message: "关闭失败,请联系管理员",
+                  type: "error"
+                });
                 //this.$message.error("关闭失败,请联系管理员");
                 this.getSteelReport();
                 loading.close();
@@ -1559,10 +1583,10 @@ export default {
         })
         .catch(() => {
           this.$message({
-            duration:1000,
-            message:"取消输入",
-            type:"info"
-          })
+            duration: 1000,
+            message: "取消输入",
+            type: "info"
+          });
           //this.$message.info("取消输入");
         });
     },