Browse Source

1.0版本------派单、订单管理、坐席下单修改用户名称字段

qianduan 10 months ago
parent
commit
a0883b0705

+ 50 - 12
package-lock.json

@@ -8,7 +8,6 @@
       "name": "gas-cylinder",
       "name": "gas-cylinder",
       "version": "0.1.0",
       "version": "0.1.0",
       "dependencies": {
       "dependencies": {
-        "@amap/amap-jsapi-loader": "^1.0.1",
         "axios": "^1.6.3",
         "axios": "^1.6.3",
         "core-js": "^3.8.3",
         "core-js": "^3.8.3",
         "echarts": "^5.4.3",
         "echarts": "^5.4.3",
@@ -18,7 +17,8 @@
         "nprogress": "^0.2.0",
         "nprogress": "^0.2.0",
         "vue": "^2.6.14",
         "vue": "^2.6.14",
         "vue-router": "^3.5.1",
         "vue-router": "^3.5.1",
-        "vuex": "^3.6.2"
+        "vuex": "^3.6.2",
+        "vuex-persistedstate": "^4.1.0"
       },
       },
       "devDependencies": {
       "devDependencies": {
         "@babel/core": "^7.12.16",
         "@babel/core": "^7.12.16",
@@ -65,11 +65,6 @@
         "node": "8 || 9 || 10 || 11 || 12 || 13 || 14 || 15 || 16 || 17 || 18 || 19 || 20 || 21"
         "node": "8 || 9 || 10 || 11 || 12 || 13 || 14 || 15 || 16 || 17 || 18 || 19 || 20 || 21"
       }
       }
     },
     },
-    "node_modules/@amap/amap-jsapi-loader": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmmirror.com/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz",
-      "integrity": "sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw=="
-    },
     "node_modules/@ampproject/remapping": {
     "node_modules/@ampproject/remapping": {
       "version": "2.2.1",
       "version": "2.2.1",
       "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz",
       "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz",
@@ -11375,6 +11370,12 @@
         "url": "https://github.com/sponsors/ljharb"
         "url": "https://github.com/sponsors/ljharb"
       }
       }
     },
     },
+    "node_modules/shvl": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmmirror.com/shvl/-/shvl-2.0.3.tgz",
+      "integrity": "sha512-V7C6S9Hlol6SzOJPnQ7qzOVEWUQImt3BNmmzh40wObhla3XOYMe4gGiYzLrJd5TFa+cI2f9LKIRJTTKZSTbWgw==",
+      "deprecated": "older versions vulnerable to prototype pollution"
+    },
     "node_modules/side-channel": {
     "node_modules/side-channel": {
       "version": "1.0.4",
       "version": "1.0.4",
       "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
       "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
@@ -12644,6 +12645,27 @@
         "vue": "^2.0.0"
         "vue": "^2.0.0"
       }
       }
     },
     },
+    "node_modules/vuex-persistedstate": {
+      "version": "4.1.0",
+      "resolved": "https://registry.npmmirror.com/vuex-persistedstate/-/vuex-persistedstate-4.1.0.tgz",
+      "integrity": "sha512-3SkEj4NqwM69ikJdFVw6gObeB0NHyspRYMYkR/EbhR0hbvAKyR5gksVhtAfY1UYuWUOCCA0QNGwv9pOwdj+XUQ==",
+      "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.",
+      "dependencies": {
+        "deepmerge": "^4.2.2",
+        "shvl": "^2.0.3"
+      },
+      "peerDependencies": {
+        "vuex": "^3.0 || ^4.0.0-rc"
+      }
+    },
+    "node_modules/vuex-persistedstate/node_modules/deepmerge": {
+      "version": "4.3.1",
+      "resolved": "https://registry.npmmirror.com/deepmerge/-/deepmerge-4.3.1.tgz",
+      "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
     "node_modules/watchpack": {
     "node_modules/watchpack": {
       "version": "2.4.0",
       "version": "2.4.0",
       "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
       "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
@@ -13262,11 +13284,6 @@
         "js-message": "1.0.7"
         "js-message": "1.0.7"
       }
       }
     },
     },
-    "@amap/amap-jsapi-loader": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmmirror.com/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz",
-      "integrity": "sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw=="
-    },
     "@ampproject/remapping": {
     "@ampproject/remapping": {
       "version": "2.2.1",
       "version": "2.2.1",
       "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz",
       "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz",
@@ -20998,6 +21015,11 @@
       "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==",
       "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==",
       "dev": true
       "dev": true
     },
     },
+    "shvl": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmmirror.com/shvl/-/shvl-2.0.3.tgz",
+      "integrity": "sha512-V7C6S9Hlol6SzOJPnQ7qzOVEWUQImt3BNmmzh40wObhla3XOYMe4gGiYzLrJd5TFa+cI2f9LKIRJTTKZSTbWgw=="
+    },
     "side-channel": {
     "side-channel": {
       "version": "1.0.4",
       "version": "1.0.4",
       "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
       "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
@@ -21872,6 +21894,22 @@
       "integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==",
       "integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==",
       "requires": {}
       "requires": {}
     },
     },
+    "vuex-persistedstate": {
+      "version": "4.1.0",
+      "resolved": "https://registry.npmmirror.com/vuex-persistedstate/-/vuex-persistedstate-4.1.0.tgz",
+      "integrity": "sha512-3SkEj4NqwM69ikJdFVw6gObeB0NHyspRYMYkR/EbhR0hbvAKyR5gksVhtAfY1UYuWUOCCA0QNGwv9pOwdj+XUQ==",
+      "requires": {
+        "deepmerge": "^4.2.2",
+        "shvl": "^2.0.3"
+      },
+      "dependencies": {
+        "deepmerge": {
+          "version": "4.3.1",
+          "resolved": "https://registry.npmmirror.com/deepmerge/-/deepmerge-4.3.1.tgz",
+          "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="
+        }
+      }
+    },
     "watchpack": {
     "watchpack": {
       "version": "2.4.0",
       "version": "2.4.0",
       "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
       "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",

+ 2 - 1
package.json

@@ -17,7 +17,8 @@
     "nprogress": "^0.2.0",
     "nprogress": "^0.2.0",
     "vue": "^2.6.14",
     "vue": "^2.6.14",
     "vue-router": "^3.5.1",
     "vue-router": "^3.5.1",
-    "vuex": "^3.6.2"
+    "vuex": "^3.6.2",
+    "vuex-persistedstate": "^4.1.0"
   },
   },
   "devDependencies": {
   "devDependencies": {
     "@babel/core": "^7.12.16",
     "@babel/core": "^7.12.16",

+ 27 - 0
src/api/inspection.js

@@ -59,3 +59,30 @@ export function getUserFillData(parameter) {
     params: parameter
     params: parameter
   })
   })
 }
 }
+
+// 添加钢瓶
+export function addGasCylinder(parameter) {
+  return request({
+    url: '/api/gas-cylinder',
+    method: 'post',
+    data: parameter
+  })
+}
+
+// 编辑钢瓶
+export function putGasCylinder(parameter) {
+  return request({
+    url: '/api/gas-cylinder',
+    method: 'put',
+    data: parameter
+  })
+}
+
+// 删除钢瓶
+export function delGasCylinder(parameter) {
+  return request({
+    url: '/api/gas-cylinder',
+    method: 'delete',
+    data: parameter
+  })
+}

+ 8 - 0
src/api/login.js

@@ -38,6 +38,14 @@ export function refreshToken(parameter) {
   })
   })
 }
 }
 
 
+// 获取用户信息
+export function getProfile(parameter) {
+  return request({
+    url: '/api/user/profile',
+    method: 'get',
+    data: parameter
+  })
+}
 // mock
 // mock
 export function getToken(parameter) {
 export function getToken(parameter) {
   return request({
   return request({

+ 9 - 0
src/api/user.js

@@ -1,5 +1,14 @@
 import request from '@/utils/request'
 import request from '@/utils/request'
 
 
+// 获取首页数据
+export function getUserHome(parameter) {
+  return request({
+    url: '/api/user/home',
+    method: 'get',
+    params: parameter
+  })
+}
+
 // 获取用户列表
 // 获取用户列表
 export function getUser(parameter) {
 export function getUser(parameter) {
   return request({
   return request({

+ 18 - 2
src/components/forms.vue

@@ -52,6 +52,12 @@
             </el-date-picker>
             </el-date-picker>
           </el-form-item>
           </el-form-item>
           <el-form-item :label="item.label" :prop="item.field" :rules="detail ? item.rules : {}"
           <el-form-item :label="item.label" :prop="item.field" :rules="detail ? item.rules : {}"
+            v-if="item.type === 'datetime'">
+            <el-date-picker type="datetime" value-format="yyyy-MM-dd HH:mm:ss" v-model="ruleForm[`${item.field}`]"
+              :placeholder="item.placeholder" :disabled="item.disabled" :default-time="defaultTime">
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item :label="item.label" :prop="item.field" :rules="detail ? item.rules : {}"
             v-if="item.type === 'section'">
             v-if="item.type === 'section'">
             <el-date-picker align="center" v-model="ruleForm[`${item.field}`]" :disabled="item.disabled"
             <el-date-picker align="center" v-model="ruleForm[`${item.field}`]" :disabled="item.disabled"
               type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期"
               type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期"
@@ -164,8 +170,9 @@
     },
     },
     watch: {
     watch: {
       formNewList: {
       formNewList: {
-        immediate: true, // 立即触发监听函数
-        handler() {
+        deep: true, // 立即触发监听函数
+        immediate: true,
+        handler(newVal) {
           this.formList = this.formNewList;
           this.formList = this.formNewList;
         },
         },
       },
       },
@@ -183,6 +190,15 @@
         curLoading: false,
         curLoading: false,
       }
       }
     },
     },
+    computed: {
+      defaultTime() {
+        var date = new Date();
+        var hour = date.getHours();
+        var minute = date.getMinutes();
+        var second = date.getSeconds();
+        return hour + ':' + minute + ':' + second;
+      }
+    },
     methods: {
     methods: {
       //下拉框下拉事件
       //下拉框下拉事件
       changeSelect(row, field) {
       changeSelect(row, field) {

+ 38 - 13
src/components/growthStatistics.vue

@@ -24,13 +24,31 @@
         type: String,
         type: String,
         default: () => '95%',
         default: () => '95%',
       },
       },
+      dataList: {
+        type: Array,
+        default: () => [],
+      },
     },
     },
-    data() {
-      return {}
+    watch: {
+      dataList: {
+        deep: true, // 立即触发监听函数
+        immediate: true,
+        handler(newVal) {
+          if (newVal) {
+            this.growthList = newVal;
+          }
+          this.$nextTick(() => {
+            this.getEnterpriseCylinder()
+          })
+        },
+      },
     },
     },
-    mounted() {
-      this.getEnterpriseCylinder()
+    data() {
+      return {
+        growthList: [],
+      }
     },
     },
+    mounted() {},
     methods: {
     methods: {
       getEnterpriseCylinder() {
       getEnterpriseCylinder() {
         var chartDom = document.getElementById('statistics');
         var chartDom = document.getElementById('statistics');
@@ -38,16 +56,23 @@
         var option;
         var option;
         // 近12个月
         // 近12个月
         var nameArr = [];
         var nameArr = [];
-        var data = new Date();
-        var year = data.getFullYear();
-        data.setMonth(data.getMonth() + 1, 1) //获取到当前月份,设置月份
-        for (var i = 0; i < 12; i++) {
-          data.setMonth(data.getMonth() - 1); //每次循环一次 月份值减1
-          var m = data.getMonth() + 1;
-          m = m < 10 ? "0" + m : m;
-          nameArr.push(data.getFullYear() + "-" + (m));
+        // var data = new Date();
+        // var year = data.getFullYear();
+        // data.setMonth(data.getMonth() + 1, 1) //获取到当前月份,设置月份
+        // for (var i = 0; i < 12; i++) {
+        //   data.setMonth(data.getMonth() - 1); //每次循环一次 月份值减1
+        //   var m = data.getMonth() + 1;
+        //   m = m < 10 ? "0" + m : m;
+        //   nameArr.push(data.getFullYear() + "-" + (m));
+        // }
+        // const valueArr = [150, 60, 80, 180, 120, 160, 80, 40, 20, 30, 22, 13]
+        const valueArr = []
+        if (this.growthList.length > 0) {
+          this.growthList.forEach((item, index) => {
+            nameArr.push(item.month)
+            valueArr.push(item.count)
+          })
         }
         }
-        const valueArr = [150, 60, 80, 180, 120, 160, 80, 40, 20, 30, 22, 13]
         option = {
         option = {
           grid: {
           grid: {
             top: '10%',
             top: '10%',

File diff suppressed because it is too large
+ 21 - 5
src/components/proportion.vue


+ 1 - 1
src/components/tables.vue

@@ -29,7 +29,7 @@
           </template>
           </template>
         </el-table-column>
         </el-table-column>
         <el-table-column :prop="item.field" :label="item.label" :width="item.colWidth" :align="item.align"
         <el-table-column :prop="item.field" :label="item.label" :width="item.colWidth" :align="item.align"
-          v-else-if="['isShow', 'type', 'state', 'storeId', 'personCode', 'optType', 'corrosion', 'crackle', 'deform', 'damage', 'safeAnnex', 'gasPressure', 'bodyDeform', 'fillingLeak', 'bodyTemperature', 'filledLeak', 'warnSign', 'fillLabel', 'seal','fill_media'].includes(item.field)">
+          v-else-if="['isShow', 'type', 'state', 'storeId', 'personCode', 'optType', 'corrosion', 'crackle', 'deform', 'damage', 'safeAnnex', 'gasPressure', 'bodyDeform', 'fillingLeak', 'bodyTemperature', 'filledLeak', 'warnSign', 'fillLabel', 'seal'].includes(item.field)">
           <template slot-scope="scope">
           <template slot-scope="scope">
             <div :style="{color: filterColor(scope.row,item.options,item.field)}">
             <div :style="{color: filterColor(scope.row,item.options,item.field)}">
               {{initDictvalueil(scope.row,item.options,item.field)}}
               {{initDictvalueil(scope.row,item.options,item.field)}}

+ 2 - 0
src/config/router.config.js

@@ -11,10 +11,12 @@ const RouteView = {
  */
  */
 export const constantRouterMap = [{
 export const constantRouterMap = [{
     path: '/login',
     path: '/login',
+    name: 'login',
     component: () => import( /* webpackChunkName: "user" */ '@/views/user/Login'),
     component: () => import( /* webpackChunkName: "user" */ '@/views/user/Login'),
   },
   },
   {
   {
     path: '/404',
     path: '/404',
+    name: '404',
     component: () => import( /* webpackChunkName: "fail" */ '@/views/404')
     component: () => import( /* webpackChunkName: "fail" */ '@/views/404')
   }
   }
 ]
 ]

+ 6 - 5
src/permission.js

@@ -11,7 +11,7 @@ import 'nprogress/nprogress.css' // progress bar style
 NProgress.configure({
 NProgress.configure({
   showSpinner: false
   showSpinner: false
 })
 })
-const whiteList = ['/login'] // 白名单
+const whiteList = ['login', '404'] // 白名单
 
 
 //全局前置路由,若无next()则不会进行下一步骤
 //全局前置路由,若无next()则不会进行下一步骤
 router.beforeEach(async (to, from, next) => {
 router.beforeEach(async (to, from, next) => {
@@ -41,9 +41,10 @@ router.beforeEach(async (to, from, next) => {
               ...to,
               ...to,
               replace: true
               replace: true
             })
             })
-          }).catch(()=>{
-            store.dispatch('Logout').then(() => {
-              next('/login')
+          }).catch((err) => {
+            next({
+              ...to,
+              replace: true
             })
             })
           })
           })
         }).catch(() => {
         }).catch(() => {
@@ -59,7 +60,7 @@ router.beforeEach(async (to, from, next) => {
     }
     }
   } else {
   } else {
     /* has no token*/
     /* has no token*/
-    if (whiteList.indexOf(to.path) !== -1) {
+    if (whiteList.includes(to.name)) {
       // in the free login whitelist, go directly
       // in the free login whitelist, go directly
       next()
       next()
     } else {
     } else {

+ 1 - 0
src/store/getters.js

@@ -6,6 +6,7 @@ const getters = {
   token: state => state.user.token,
   token: state => state.user.token,
   nickname: state => state.user.name,
   nickname: state => state.user.name,
   welcome: state => state.user.welcome,
   welcome: state => state.user.welcome,
+  companyName: state => state.user.companyName,
   roles: state => state.user.roles,
   roles: state => state.user.roles,
   permission_routes: state => state.permission.routes,
   permission_routes: state => state.permission.routes,
   userInfo: state => state.user.info,
   userInfo: state => state.user.info,

+ 1 - 1
src/store/index.js

@@ -16,5 +16,5 @@ export default new Vuex.Store({
     user,
     user,
     permission
     permission
   },
   },
-  getters
+  getters,
 })
 })

+ 4 - 1
src/store/modules/permission.js

@@ -1,4 +1,7 @@
 import {
 import {
+  getProfile
+} from '@/api/login'
+import {
   constantRouterMap
   constantRouterMap
 } from '@/config/router.config'
 } from '@/config/router.config'
 import {
 import {
@@ -16,7 +19,7 @@ const permission = {
     SET_ROUTERS: (state, routers) => {
     SET_ROUTERS: (state, routers) => {
       state.addRouters = routers
       state.addRouters = routers
       state.routers = constantRouterMap.concat(routers)
       state.routers = constantRouterMap.concat(routers)
-    }
+    },
   },
   },
   getters: {
   getters: {
     getMenu(state) {
     getMenu(state) {

+ 18 - 1
src/store/modules/user.js

@@ -1,6 +1,8 @@
+import createPersistedState from 'vuex-persistedstate';
 import {
 import {
   login,
   login,
-  logout
+  logout,
+  getProfile
 } from '@/api/login'
 } from '@/api/login'
 import {
 import {
   getMenuRole
   getMenuRole
@@ -8,7 +10,14 @@ import {
 
 
 
 
 const user = {
 const user = {
+  plugins: [
+    createPersistedState({
+      storage: window.localStorage, // 或者使用 sessionStorage
+      paths: ['user']
+    }),
+  ],
   state: {
   state: {
+    companyName: localStorage.getItem('companyName'),
     token: '',
     token: '',
     name: '',
     name: '',
     welcome: '',
     welcome: '',
@@ -28,6 +37,9 @@ const user = {
     },
     },
     SET_INFO: (state, info) => {
     SET_INFO: (state, info) => {
       state.info = info
       state.info = info
+    },
+    SET_NAME: (state, companyName) => {
+      state.companyName = companyName
     }
     }
   },
   },
 
 
@@ -46,6 +58,11 @@ const user = {
             commit('SET_TOKEN', data.token)
             commit('SET_TOKEN', data.token)
             // setToken(data.token)
             // setToken(data.token)
             localStorage.setItem('T_tokey', data.token);
             localStorage.setItem('T_tokey', data.token);
+            getProfile().then(userRes => {
+              var company = userRes.data.user.dept.name
+              commit('SET_NAME', company)
+              localStorage.setItem('companyName', company);
+            })
             resolve()
             resolve()
           } else {
           } else {
             reject(data)
             reject(data)

+ 14 - 10
src/utils/request.js

@@ -10,8 +10,8 @@ import {
 } from '@/api/login'
 } from '@/api/login'
 import Cookies from "js-cookie";
 import Cookies from "js-cookie";
 // 创建 axios 实例
 // 创建 axios 实例
-// const Url = "http://192.168.11.77:6500"
-const Url = "http://gascylindertest.baozhida.cn/gas_cylinder"
+const Url = "https://gascylinder.baozhida.cn/gas_cylinder"
+// const Url = "http://gascylindertest.baozhida.cn/gas_cylinder"
 const request = axios.create({
 const request = axios.create({
   // API 请求的默认前缀
   // API 请求的默认前缀
   baseURL: process.env.NODE_ENV === 'production' ? Url : '/api',
   baseURL: process.env.NODE_ENV === 'production' ? Url : '/api',
@@ -25,6 +25,7 @@ const request = axios.create({
 
 
 // 异常拦截处理器
 // 异常拦截处理器
 const errorHandler = (error) => {
 const errorHandler = (error) => {
+  console.log(error, 222)
   if (error.response) {
   if (error.response) {
     const data = error.response.data
     const data = error.response.data
     if (error.response.status === 403) {
     if (error.response.status === 403) {
@@ -34,7 +35,7 @@ const errorHandler = (error) => {
       Message.error(data.message)
       Message.error(data.message)
     }
     }
   }
   }
-  return Promise.reject(error)
+  // return Promise.reject(error)
 }
 }
 
 
 // request interceptor
 // request interceptor
@@ -51,27 +52,30 @@ request.interceptors.request.use(config => {
   return config
   return config
 }, errorHandler)
 }, errorHandler)
 
 
+let is404AlertShown = false;
 // response interceptor
 // response interceptor
 request.interceptors.response.use((response) => {
 request.interceptors.response.use((response) => {
   if (response.data.Code || response.data.code) {
   if (response.data.Code || response.data.code) {
     const res = response.data
     const res = response.data
     if (res.code == 6401) {
     if (res.code == 6401) {
-      return refreshToken().then(res => {
-        // console.log(res, 24)
+      return refreshToken().then((itmds) => {
         // 更新本地存储的 Token
         // 更新本地存储的 Token
-        localStorage.setItem("T_tokey", res.token);
+        localStorage.setItem("T_tokey", itmds.token);
         // 重新发送原请求
         // 重新发送原请求
         return request(response.config);
         return request(response.config);
       })
       })
-    } else if (res.Code == 401 || res.code == 401) {
+    }
+    if (res.code == 401 && !is404AlertShown) {
+      is404AlertShown = true;
       localStorage.removeItem('T_tokey');
       localStorage.removeItem('T_tokey');
       localStorage.removeItem('username');
       localStorage.removeItem('username');
-      store.dispatch('Logout').then(() => {
+      return store.dispatch('Logout').then(() => {
         router.push('/login');
         router.push('/login');
+        Message.error(res.msg || res.message)
       })
       })
-      return Message.error(res.msg || res.message)
     }
     }
-    if (res.Code == 200 || res.code == 200 || res.code == 404) {
+    if (res.code == 200 || res.code == 404) {
+      is404AlertShown = false;
       return res
       return res
     } else {
     } else {
       Message.error(res.msg || res.message)
       Message.error(res.msg || res.message)

+ 37 - 1
src/views/common/Base.vue

@@ -6,7 +6,7 @@
           <el-col :span="7">
           <el-col :span="7">
             <div class="topRight">
             <div class="topRight">
               <topNav></topNav>
               <topNav></topNav>
-              <div></div>
+              <div class="title_firmname">{{firmName}}</div>
               <!-- <el-divider direction="vertical"></el-divider>
               <!-- <el-divider direction="vertical"></el-divider>
               <img class="image_logo" src="../../assets/logo.png" alt="" /> -->
               <img class="image_logo" src="../../assets/logo.png" alt="" /> -->
             </div>
             </div>
@@ -38,6 +38,9 @@
 </template>
 </template>
 
 
 <script>
 <script>
+  import {
+    mapState
+  } from 'vuex'
   import comTags from './Tags.vue';
   import comTags from './Tags.vue';
   import Bus from './bus.js';
   import Bus from './bus.js';
   import UserInfo from './userInfo.vue'
   import UserInfo from './userInfo.vue'
@@ -56,8 +59,29 @@
         tagComponent: [],
         tagComponent: [],
         timer: undefined,
         timer: undefined,
         hourMinuteSecond: null,
         hourMinuteSecond: null,
+        firmName: '',
       }
       }
     },
     },
+    watch: {
+      companyName: {
+        deep: true, // 立即触发监听函数
+        immediate: true,
+        handler(newVal) {
+          if (newVal) {
+            this.firmName = newVal
+          }
+        },
+      }
+    },
+    computed: {
+      companyName() {
+        return this.$store.state.user.companyName;
+      },
+      ...mapState({
+        // 动态公司
+        mainMenu: state => state.user.companyName
+      })
+    },
     created() {
     created() {
       Bus.$on('collapse', isCollapse => {
       Bus.$on('collapse', isCollapse => {
         this.collapse = isCollapse;
         this.collapse = isCollapse;
@@ -178,6 +202,18 @@
     height: 64px;
     height: 64px;
   }
   }
 
 
+  .title_firmname {
+    width: 170px;
+    font-size: 16px;
+    color: #fff;
+    /* 超出隐藏 */
+    overflow: hidden;
+    /* 不换行 */
+    white-space: nowrap;
+    /* 使用省略号 */
+    text-overflow: ellipsis;
+  }
+
   ::v-deep .topRight .el-divider--vertical {
   ::v-deep .topRight .el-divider--vertical {
     height: 1.5rem;
     height: 1.5rem;
   }
   }

+ 4 - 4
src/views/customer/agentOrdering.vue

@@ -1,8 +1,8 @@
 <template>
 <template>
   <!-- 坐席下单 -->
   <!-- 坐席下单 -->
   <div>
   <div>
-    <actionBar menuTitle="坐席下单" :operateList="operateList" :formList="formList" :ruleForm="searchRuleForm" @openModel="openModel"
-      @searchProtocol="searchProtocol"></actionBar>
+    <actionBar menuTitle="坐席下单" :operateList="operateList" :formList="formList" :ruleForm="searchRuleForm"
+      @openModel="openModel" @searchProtocol="searchProtocol"></actionBar>
     <tables :key="Math.random()" :suspension="true" :tableList="tableList" :tableData="tableData"
     <tables :key="Math.random()" :suspension="true" :tableList="tableList" :tableData="tableData"
       @buttonData="buttonData"></tables>
       @buttonData="buttonData"></tables>
     <!-- 分页 -->
     <!-- 分页 -->
@@ -130,7 +130,7 @@
         Total: 0,
         Total: 0,
         formRuleList: [],
         formRuleList: [],
         orderRecordList: [],
         orderRecordList: [],
-        informationList:[],
+        informationList: [],
         ruleForm: {},
         ruleForm: {},
         operationType: '',
         operationType: '',
         confirmLoading: false,
         confirmLoading: false,
@@ -476,7 +476,7 @@
           this.getCourier(row.storeId)
           this.getCourier(row.storeId)
           this.ruleForm.phone = row.customer.principalPhone
           this.ruleForm.phone = row.customer.principalPhone
           this.$set(this.ruleForm, 'type', row.customer.type)
           this.$set(this.ruleForm, 'type', row.customer.type)
-          this.$set(this.ruleForm, 'name', row.customer.principalName)
+          this.$set(this.ruleForm, 'name', row.customer.name)
           this.$set(this.ruleForm, 'address', row.customer.address)
           this.$set(this.ruleForm, 'address', row.customer.address)
           var arr1 = []
           var arr1 = []
           arr1.push(row.customer.city)
           arr1.push(row.customer.city)

+ 1 - 1
src/views/customer/entrySecurity.vue

@@ -172,7 +172,7 @@
         }
         }
         this.$set(this.ruleForm, 'state', row.state)
         this.$set(this.ruleForm, 'state', row.state)
         this.$set(this.ruleForm, 'remark', row.remark)
         this.$set(this.ruleForm, 'remark', row.remark)
-        this.$set(this.ruleForm, 'name', row.customer.principalName)
+        this.$set(this.ruleForm, 'name', row.customer.name)
         this.$set(this.ruleForm, 'nickName', row.user.nickName)
         this.$set(this.ruleForm, 'nickName', row.user.nickName)
         this.checkEntry.forEach((item, index) => {
         this.checkEntry.forEach((item, index) => {
           let arr = row.inspectExpandList
           let arr = row.inspectExpandList

+ 1 - 1
src/views/customer/orderProcessing.vue

@@ -151,7 +151,7 @@
         this.orderId = row.id
         this.orderId = row.id
         this.operationType = type
         this.operationType = type
         this.getAcquireGoods(row.goodsId)
         this.getAcquireGoods(row.goodsId)
-        this.$set(this.ruleForm, 'name', row.customer.principalName)
+        this.$set(this.ruleForm, 'name', row.customer.name)
         this.$set(this.ruleForm, 'phone', row.customer.principalPhone)
         this.$set(this.ruleForm, 'phone', row.customer.principalPhone)
         var arr1 = ''
         var arr1 = ''
         var cityArr = urbanArea()
         var cityArr = urbanArea()

+ 1 - 1
src/views/customer/orderTable.js

@@ -31,7 +31,7 @@ export const employee = () => {
       }
       }
     ]
     ]
   }, {
   }, {
-    field: 'customer.principalName',
+    field: 'customer.name',
     label: '客户名称',
     label: '客户名称',
     align: 'center',
     align: 'center',
     colWidth: '150px',
     colWidth: '150px',

+ 1 - 1
src/views/customer/sendOrders.js

@@ -28,7 +28,7 @@ export const employee = () => {
       }
       }
     ]
     ]
   }, {
   }, {
-    field: 'customer.principalName',
+    field: 'customer.name',
     label: '客户名称',
     label: '客户名称',
     align: 'center',
     align: 'center',
     colWidth: '150px',
     colWidth: '150px',

+ 125 - 172
src/views/manufacture/cylinder.js

@@ -16,21 +16,50 @@ export const employee = () => {
     field: 'inner_code',
     field: 'inner_code',
     label: '单位内编号',
     label: '单位内编号',
     align: 'center',
     align: 'center',
+    colWidth: '180px',
+  }, {
+    field: 'status',
+    label: '状态',
+    align: 'center',
+    colWidth: '150px',
+  }, {
+    field: 'station_name',
+    label: '上次充装气站',
+    align: 'center',
+    colWidth: '200px',
+  }, {
+    field: 'fill_time',
+    label: '上次充装时间',
+    align: 'center',
+    colWidth: '200px',
+  }, {
+    field: 'register_supervise_name',
+    label: '使用登记审批单位',
+    align: 'center',
+    colWidth: '220px',
+  }, {
+    field: 'register_time',
+    label: '使用登记日期',
+    align: 'center',
     colWidth: '200px',
     colWidth: '200px',
   }, {
   }, {
     field: 'pro_variety',
     field: 'pro_variety',
-    operation: true,
     label: '设备品种',
     label: '设备品种',
     align: 'center',
     align: 'center',
-    colWidth: '200px',
+    colWidth: '160px',
+  }, {
+    field: 'enterprise_name',
+    label: '产权单位',
+    align: 'center',
+    colWidth: '230px',
   }, {
   }, {
     field: 'pro_name',
     field: 'pro_name',
     label: '产品名称',
     label: '产品名称',
     align: 'center',
     align: 'center',
-    colWidth: '200px',
+    colWidth: '150px',
   }, {
   }, {
     field: 'pro_no',
     field: 'pro_no',
-    label: '气瓶生产编号',
+    label: '(出厂)编号',
     align: 'center',
     align: 'center',
     colWidth: '200px',
     colWidth: '200px',
   }, {
   }, {
@@ -38,7 +67,6 @@ export const employee = () => {
     label: '充装介质',
     label: '充装介质',
     align: 'center',
     align: 'center',
     colWidth: '200px',
     colWidth: '200px',
-    options: neurogen(),
   }, {
   }, {
     field: 'make_unit',
     field: 'make_unit',
     label: '制造单位',
     label: '制造单位',
@@ -58,7 +86,7 @@ export const employee = () => {
     field: 'volume',
     field: 'volume',
     label: '容积(L)',
     label: '容积(L)',
     align: 'center',
     align: 'center',
-    colWidth: '200px',
+    colWidth: '100px',
   }, {
   }, {
     field: 'check_time',
     field: 'check_time',
     label: '最近一次检验日日期',
     label: '最近一次检验日日期',
@@ -70,216 +98,141 @@ export const employee = () => {
     align: 'center',
     align: 'center',
     colWidth: '200px',
     colWidth: '200px',
   }, {
   }, {
-    field: 'pro_uuid',
-    label: '产品唯一性编码',
-    align: 'center',
-    colWidth: '200px',
-  }, {
-    field: 'deadline_time',
-    label: '使用年限',
-    align: 'center',
-    colWidth: '200px',
-  }, {
-    field: 'check_in_time',
-    label: '录入日期',
-    align: 'center',
-    colWidth: '200px',
-  }, {
     field: 'action',
     field: 'action',
     label: '操作',
     label: '操作',
-    colWidth: '100px',
+    colWidth: '230px',
     align: 'center',
     align: 'center',
     labelButton: [{
     labelButton: [{
       type: 'logs',
       type: 'logs',
       label: '查看',
       label: '查看',
       icon: 'el-icon-tickets',
       icon: 'el-icon-tickets',
       style: 'info',
       style: 'info',
+    }, {
+      type: 'edit',
+      label: '编辑',
+      icon: 'el-icon-edit',
+      style: 'primary',
+    }, {
+      type: 'del',
+      label: '删除',
+      icon: 'el-icon-tickets',
+      style: 'danger',
     }]
     }]
   }]
   }]
 }
 }
-export const formRules = () => {
+
+export const cylinderformRules = () => {
   return [{
   return [{
-    field: 'pro_variety',
-    label: '设备品种 :',
-    type: 'descriptions',
-    colWidth: 12,
-  }, {
-    field: 'pro_name',
-    label: '产品名称 :',
-    type: 'descriptions',
-    colWidth: 12,
-  }, {
-    field: 'pro_no',
-    label: '气瓶生产编号 :',
-    type: 'descriptions',
-    colWidth: 12,
-  }, {
-    field: 'fill_media',
-    label: '充装介质 :',
-    type: 'prdfterence',
-    colWidth: 12,
-    options: neurogen(),
-  }, {
-    field: 'make_unit',
-    label: '制造单位 :',
-    type: 'descriptions',
-    colWidth: 12,
-  }, {
-    field: 'make_time',
-    type: '生产日期 :',
-    label: '商品',
-    colWidth: 12,
-  }, {
-    field: 'work_pressure',
-    label: '公称工作压力(MPa)',
-    type: 'descriptions',
-    colWidth: 12,
-  }, {
-    field: 'volume',
-    type: 'descriptions',
-    label: '容积(L)',
-    colWidth: 12,
-  }, {
-    field: 'check_time',
-    type: 'descriptions',
-    label: '最近一次检验日日期 :',
-    colWidth: 12,
-  }, {
-    field: 'next_check_time',
-    label: '下次检验日期 :',
-    type: 'descriptions',
-    colWidth: 12,
-  }, {
-    field: 'regist_code',
-    label: '气瓶使用登记代码 :',
-    type: 'descriptions',
-    colWidth: 12,
-  }, {
-    field: 'change_event',
-    label: '变更情况 :',
-    type: 'descriptions',
-    colWidth: 12,
-  }, {
-    field: 'memo',
-    label: '备注 :',
-    type: 'descriptions',
-    colWidth: 24,
-  }, {
     field: 'inner_code',
     field: 'inner_code',
-    label: '单位内编号 :',
-    type: 'descriptions',
-    colWidth: 12,
-  }, {
-    field: 'stamp_make_unit',
-    label: '气瓶钢印制造单位名称 :',
-    type: 'descriptions',
-    colWidth: 12,
-  }, {
-    field: 'pro_uuid',
-    label: '产品唯一性编码 :',
-    type: 'descriptions',
-    colWidth: 12,
-  }, {
-    field: 'chip_id',
-    label: '芯片id :',
-    type: 'descriptions',
-    colWidth: 12,
-  }, {
-    field: 'location',
-    label: '归属地 :',
-    type: 'prdfterence',
+    label: '单位内编号',
+    placeholder: '单位内编号',
+    type: 'input',
     colWidth: 12,
     colWidth: 12,
-    options: attribution(),
+    rules: [{
+      required: true,
+      message: '请输入单位内编号',
+      trigger: 'blur'
+    }]
   }, {
   }, {
     field: 'status',
     field: 'status',
-    label: '气瓶状态 :',
-    type: 'prdfterence',
-    colWidth: 12,
-    options: cylinderCondition(),
-  }, {
-    field: 'check_organization',
-    label: '检测机构 :',
-    type: 'descriptions',
-    colWidth: 12,
+    label: '状态',
+    placeholder: '状态',
+    type: 'input',
+    colWidth: 12,
+    rules: [{
+      required: true,
+      message: '请输入状态',
+      trigger: 'blur'
+    }]
   }, {
   }, {
-    field: 'empty_bottle',
-    label: '是否空瓶 :',
-    type: 'prdfterence',
+    field: 'station_name',
+    label: '上次充装气站',
+    placeholder: '上次充装气站',
+    type: 'input',
     colWidth: 12,
     colWidth: 12,
-    options: havenot(),
   }, {
   }, {
-    field: 'uid',
-    label: '高频编码 :',
-    type: 'descriptions',
+    field: 'fill_time',
+    label: '上次充装时间',
+    placeholder: '上次充装时间',
+    type: 'datetime',
     colWidth: 12,
     colWidth: 12,
   }, {
   }, {
-    field: 'tid',
-    label: '超高频编码 :',
-    type: 'descriptions',
+    field: 'register_supervise_name',
+    label: '使用登记审批单位',
+    placeholder: '使用登记审批单位',
+    type: 'input',
     colWidth: 12,
     colWidth: 12,
   }, {
   }, {
-    field: 'chip_status',
-    label: '是否改造 :',
-    type: 'prdfterence',
+    field: 'register_time',
+    label: '使用登记日期',
+    placeholder: '使用登记日期',
+    type: 'datetime',
     colWidth: 12,
     colWidth: 12,
-    options: remould(),
   }, {
   }, {
-    field: 'is_lose',
-    label: '是否丢失 :',
-    type: 'prdfterence',
+    field: 'pro_variety',
+    label: '设备品种',
+    placeholder: '设备品种',
+    type: 'input',
     colWidth: 12,
     colWidth: 12,
-    options: missing(),
   }, {
   }, {
-    field: 'old_bottle',
-    label: '是否旧瓶 :',
-    type: 'prdfterence',
+    field: 'enterprise_name',
+    label: '产权单位',
+    placeholder: '产权单位',
+    type: 'input',
     colWidth: 12,
     colWidth: 12,
-    options: havenot(),
   }, {
   }, {
-    field: 'design_thickness',
-    label: '设计壁厚 :',
-    type: 'descriptions',
+    field: 'pro_name',
+    label: '产品名称',
+    placeholder: '产品名称',
+    type: 'input',
     colWidth: 12,
     colWidth: 12,
   }, {
   }, {
-    field: 'result_code',
-    label: '检测结果 :',
-    type: 'descriptions',
+    field: 'pro_no',
+    label: '(出厂)编号',
+    placeholder: '(出厂)编号',
+    type: 'input',
     colWidth: 12,
     colWidth: 12,
   }, {
   }, {
-    field: 'audit_remark',
-    label: '审批备注 :',
-    type: 'descriptions',
+    field: 'fill_media',
+    label: '充装介质',
+    placeholder: '充装介质',
+    type: 'input',
     colWidth: 12,
     colWidth: 12,
   }, {
   }, {
-    field: 'deadline_time',
-    label: '使用年限 :',
-    type: 'descriptions',
+    field: 'make_unit',
+    label: '制造单位',
+    placeholder: '制造单位',
+    type: 'input',
     colWidth: 12,
     colWidth: 12,
   }, {
   }, {
-    field: 'check_in_time',
-    label: '录入日期 :',
-    type: 'descriptions',
+    field: 'make_time',
+    label: '生产日期',
+    placeholder: '生产日期',
+    type: 'time',
     colWidth: 12,
     colWidth: 12,
   }, {
   }, {
-    field: 'scrap_time',
-    label: '报废日期 :',
-    type: 'descriptions',
+    field: 'work_pressure',
+    label: '公称工作压力(MPa)',
+    placeholder: '公称工作压力(MPa)',
+    type: 'input',
     colWidth: 12,
     colWidth: 12,
   }, {
   }, {
-    field: 'analysis_status',
-    label: '统计状态值 :',
-    type: 'prdfterence',
+    field: 'volume',
+    label: '容积(L)',
+    placeholder: '容积(L)',
+    type: 'input',
     colWidth: 12,
     colWidth: 12,
-    options: statisticalState(),
   }, {
   }, {
-    field: 'operation_id',
-    label: '操作人 :',
-    type: 'descriptions',
+    field: 'check_time',
+    label: '最近一次检验日日期',
+    placeholder: '最近一次检验日日期',
+    type: 'time',
     colWidth: 12,
     colWidth: 12,
   }, {
   }, {
-    field: 'operation_time',
-    label: '操作时间 :',
-    type: 'descriptions',
+    field: 'next_check_time',
+    label: '下次检验日期',
+    placeholder: '下次检验日期',
+    type: 'time',
     colWidth: 12,
     colWidth: 12,
-  }, ]
+  }]
 }
 }

+ 115 - 21
src/views/manufacture/cylinderFile.vue

@@ -1,7 +1,8 @@
 <template>
 <template>
   <!-- 钢瓶档案 -->
   <!-- 钢瓶档案 -->
   <div>
   <div>
-    <actionBar menuTitle="钢瓶档案" :formList="formList" :ruleForm="searchRuleForm" @searchProtocol="searchProtocol">
+    <actionBar menuTitle="钢瓶档案" :operateList="operateList" :formList="formList" :ruleForm="searchRuleForm"
+      @openModel="openModel" @searchProtocol="searchProtocol">
     </actionBar>
     </actionBar>
     <tables :key="Math.random()" :suspension="true" :tableList="tableList" :tableData="tableData"
     <tables :key="Math.random()" :suspension="true" :tableList="tableList" :tableData="tableData"
       @buttonData="buttonData"></tables>
       @buttonData="buttonData"></tables>
@@ -11,10 +12,13 @@
         @changeCurrent="changeCurrent">
         @changeCurrent="changeCurrent">
       </pagination>
       </pagination>
     </div>
     </div>
-    <el-dialog v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
-      element-loading-background="rgba(0, 0, 0, 0.8)" :title="staffTitle" :visible.sync="staffDialogVisible" width="60%"
-      :close-on-click-modal="false">
-      <forms ref="childRules" :formNewList="formRuleList" :ruleForm="ruleForm" labelWidth="180px"></forms>
+    <el-dialog :title="staffTitle" :visible.sync="cylinderDialog" width="800px" :close-on-click-modal="false"
+      @close="closeDialog">
+      <forms ref="childRules" :formNewList="cylinderRule" :ruleForm="cylinderForm" labelWidth="160px"></forms>
+      <span slot="footer" class="dialog-footer" v-if="operationType != 'logs'">
+        <el-button plain @click="cylinderDialog = false">取 消</el-button>
+        <el-button type="primary" :loading="confirmLoading" @click="handleAdd">确 定</el-button>
+      </span>
     </el-dialog>
     </el-dialog>
   </div>
   </div>
 </template>
 </template>
@@ -22,15 +26,18 @@
 <script>
 <script>
   import {
   import {
     getGasCylinder,
     getGasCylinder,
-    getGasCylinderDetails
+    getGasCylinderDetails,
+    addGasCylinder,
+    putGasCylinder,
+    delGasCylinder,
   } from '@/api/inspection'
   } from '@/api/inspection'
   import actionBar from '@/components/actionBar'
   import actionBar from '@/components/actionBar'
   import tables from '@/components/tables'
   import tables from '@/components/tables'
   import pagination from '@/components/pagination'
   import pagination from '@/components/pagination'
   import forms from '@/components/forms'
   import forms from '@/components/forms'
   import {
   import {
-    formRules,
-    employee
+    employee,
+    cylinderformRules
   } from "./cylinder.js";
   } from "./cylinder.js";
   export default {
   export default {
     components: {
     components: {
@@ -46,10 +53,15 @@
           label: '单位内编号',
           label: '单位内编号',
           field: 'innerCode',
           field: 'innerCode',
           placeholder: '单位内编号',
           placeholder: '单位内编号',
-        },],
+        }, ],
         searchRuleForm: {
         searchRuleForm: {
           innerCode: '',
           innerCode: '',
         },
         },
+        operateList: [{
+          type: 'add',
+          title: '添加钢瓶',
+          icon: 'el-icon-plus',
+        }],
         tableList: employee(),
         tableList: employee(),
         tableData: [],
         tableData: [],
         Pagination: {
         Pagination: {
@@ -57,18 +69,17 @@
           PageSize: 10,
           PageSize: 10,
         },
         },
         Total: 0,
         Total: 0,
-        formRuleList: [],
-        staffTitle: '查看',
-        staffDialogVisible: false,
-        formRuleList: [],
+        staffTitle: '添加钢瓶',
         searchValue: {},
         searchValue: {},
-        ruleForm: {},
-        loading: false,
+        cylinderDialog: false,
+        cylinderRule: cylinderformRules(),
+        cylinderForm: {},
+        confirmLoading: false,
+        operationType: '',
+        clientId: '',
       }
       }
     },
     },
     mounted() {
     mounted() {
-      const dataList = formRules();
-      this.formRuleList = dataList;
       this.getList()
       this.getList()
     },
     },
     methods: {
     methods: {
@@ -101,13 +112,87 @@
           this.loading = false
           this.loading = false
         })
         })
       },
       },
-      buttonData(row, type) {
+      openModel(type) {
         this.operationType = type
         this.operationType = type
+        if (type == 'add') {
+          this.staffTitle = '添加钢瓶'
+        }
+        const arr = [...this.cylinderRule]
+        arr.forEach((item, index) => {
+          item.disabled = false
+        })
+        this.cylinderRule = arr
+        this.cylinderDialog = true
+      },
+      buttonData(row, type) {
         if (type == 'logs') {
         if (type == 'logs') {
-          this.staffTitle = '详情'
-          this.getDetails(row.inner_code)
+          this.cylinderForm = row
+          this.staffTitle = '钢瓶详情'
+          const arr = [...this.cylinderRule]
+          arr.forEach((item, index) => {
+            item.disabled = true
+          })
+          this.cylinderRule = arr
+          this.cylinderDialog = true
+          // this.getDetails(row.inner_code)
+        } else if (type == 'edit') {
+          this.cylinderForm = row
+          this.staffTitle = '编辑钢瓶'
+          this.clientId = row.id
+          this.cylinderDialog = true
+        } else if (type == 'del') {
+          this.getCancelOrder(row.id)
         }
         }
-        this.staffDialogVisible = true
+        this.operationType = type
+      },
+      // 弹窗表单添加
+      handleAdd() {
+        let flag = this.$refs['childRules'].validateForm();
+        if (flag) {
+          var params = {
+            ...this.cylinderForm,
+          }
+          if (this.operationType == 'edit') {
+            params.id = this.clientId
+            putGasCylinder(params).then(res => {
+              if (res.code == 200) {
+                this.getList()
+                this.cylinderDialog = false
+              }
+            })
+          } else {
+            addGasCylinder(params).then(res => {
+              if (res.code == 200) {
+                this.getList()
+                this.cylinderDialog = false
+              }
+            })
+          }
+        } else {
+          this.$message.error('表单信息不完整,请继续填写完整');
+        }
+      },
+      // 删除钢瓶
+      getCancelOrder(ID) {
+        this.$confirm('此操作将永久删除该钢瓶, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          delGasCylinder({
+            id: ID,
+          }).then((res) => {
+            if (res.code == 200) {
+              this.$message({
+                message: '操作成功',
+                type: 'success'
+              });
+              this.getList()
+            }
+          })
+        }).catch(() => {
+          // console.log('取消')
+        });
       },
       },
       changeSize(val) {
       changeSize(val) {
         this.Pagination.PageSize = val
         this.Pagination.PageSize = val
@@ -117,6 +202,15 @@
         this.Pagination.PageIndex = val
         this.Pagination.PageIndex = val
         this.getList()
         this.getList()
       },
       },
+      closeDialog() {
+        const arr = [...this.cylinderRule]
+        arr.forEach((item, index) => {
+          item.disabled = false
+        })
+        this.cylinderRule = arr
+        this.cylinderForm = {}
+        this.$refs['childRules'].resetCheck();
+      }
     }
     }
   }
   }
 </script>
 </script>

+ 1 - 0
src/views/manufacture/tankFilling.vue

@@ -101,6 +101,7 @@
         if (value.time) {
         if (value.time) {
           this.searchValue.orderStartTime = value.time[0]
           this.searchValue.orderStartTime = value.time[0]
           this.searchValue.orderEndTime = value.time[1]
           this.searchValue.orderEndTime = value.time[1]
+          delete this.searchValue.time
         }
         }
         this.getList()
         this.getList()
       },
       },

+ 1 - 1
src/views/manufacture/vehicle.vue

@@ -71,7 +71,7 @@
         }, ],
         }, ],
         searchRuleForm: {
         searchRuleForm: {
           carNo: '',
           carNo: '',
-          transportTime: '',
+          transportTime: [],
         },
         },
         operateList: [{
         operateList: [{
           type: 'add',
           type: 'add',

+ 1 - 1
src/views/marketing/order.js

@@ -29,7 +29,7 @@ export const employee = () => {
       }
       }
     ]
     ]
   }, {
   }, {
-    field: 'customer.principalName',
+    field: 'customer.name',
     label: '客户名称',
     label: '客户名称',
     align: 'center',
     align: 'center',
     colWidth: '150px',
     colWidth: '150px',

+ 1 - 1
src/views/marketing/orderManagement.vue

@@ -150,7 +150,7 @@
       buttonData(row, type) {
       buttonData(row, type) {
         this.operationType = type
         this.operationType = type
         this.getAcquireGoods(row.goodsId)
         this.getAcquireGoods(row.goodsId)
-        this.$set(this.ruleForm, 'name', row.customer.principalName)
+        this.$set(this.ruleForm, 'name', row.customer.name)
         this.$set(this.ruleForm, 'phone', row.customer.principalPhone)
         this.$set(this.ruleForm, 'phone', row.customer.principalPhone)
         var arr1 = ''
         var arr1 = ''
         var cityArr = urbanArea()
         var cityArr = urbanArea()

+ 40 - 23
src/views/page/Home.vue

@@ -2,13 +2,14 @@
   <div class="home" id="home">
   <div class="home" id="home">
     <div class="card_left_home">
     <div class="card_left_home">
       <div class="scale-up-hor-left card_block center_in">
       <div class="scale-up-hor-left card_block center_in">
-        <growthStatistics title="近12月钢瓶数增长统计"></growthStatistics>
+        <growthStatistics :dataList="growthList" title="近12月钢瓶数增长统计"></growthStatistics>
       </div>
       </div>
       <div class="scale-up-hor-left card_block center_in">
       <div class="scale-up-hor-left card_block center_in">
-        <securityCheck title="气瓶安检汇总"></securityCheck>
+        <proportion :dataList="proportionList" title="企业钢瓶占比"></proportion>
+        <!-- <securityCheck title="气瓶安检汇总"></securityCheck> -->
       </div>
       </div>
       <div class="scale-up-hor-left card_block center_in">
       <div class="scale-up-hor-left card_block center_in">
-        <abnormalCylinder title="气站钢瓶投入"></abnormalCylinder>
+        <!-- <abnormalCylinder title="气站钢瓶投入"></abnormalCylinder> -->
       </div>
       </div>
     </div>
     </div>
     <div class="card_center_home">
     <div class="card_center_home">
@@ -22,23 +23,22 @@
         <wavyBlock title="钢瓶数据汇总" :list="list1"></wavyBlock>
         <wavyBlock title="钢瓶数据汇总" :list="list1"></wavyBlock>
       </div>
       </div>
       <div class="scale-up-hor-right card_block center_in">
       <div class="scale-up-hor-right card_block center_in">
-        <proportion title="企业钢瓶占比"></proportion>
+        <!-- <proportion title="企业钢瓶占比"></proportion> -->
       </div>
       </div>
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
+  import {
+    getUserHome
+  } from '@/api/user'
   import growthStatistics from '@/components/growthStatistics.vue'
   import growthStatistics from '@/components/growthStatistics.vue'
   import securityCheck from '@/components/securityCheck.vue'
   import securityCheck from '@/components/securityCheck.vue'
   import abnormalCylinder from '@/components/abnormalCylinder.vue'
   import abnormalCylinder from '@/components/abnormalCylinder.vue'
   import proportion from '@/components/proportion.vue'
   import proportion from '@/components/proportion.vue'
   import wavyBlock from '@/components/wavyBlock.vue'
   import wavyBlock from '@/components/wavyBlock.vue'
   import mapStore from './mapStore.vue'
   import mapStore from './mapStore.vue'
-  import {
-    getToken,
-    getTokenil
-  } from '@/api/login'
   import request from '@/utils/request'
   import request from '@/utils/request'
   export default {
   export default {
     name: 'HomeView',
     name: 'HomeView',
@@ -52,47 +52,43 @@
     },
     },
     data() {
     data() {
       return {
       return {
+        mapData: [],
+        growthList: [],
+        proportionList: [],
         list: [{
         list: [{
-          num: '99',
-          title: '气站总数',
-          icon: 'station.png',
-        }, {
-          num: '34',
+          num: 0,
           title: '门店数',
           title: '门店数',
           icon: 'shop.png',
           icon: 'shop.png',
         }, {
         }, {
-          num: '123',
-          title: '充装瓶数',
-          icon: 'liquefiedgas.png',
-        }, {
-          num: '34',
+          num: 0,
           title: '送气工数',
           title: '送气工数',
           icon: 'aspirated.png',
           icon: 'aspirated.png',
         }, {
         }, {
-          num: '62',
+          num: 0,
           title: '燃气户数',
           title: '燃气户数',
           icon: 'client.png',
           icon: 'client.png',
         }],
         }],
         list1: [{
         list1: [{
-          num: '99',
+          num: 0,
           title: '钢瓶总数',
           title: '钢瓶总数',
           icon: 'liquefiedgas.png',
           icon: 'liquefiedgas.png',
         }, {
         }, {
-          num: '34',
+          num: 0,
           title: '正常瓶数',
           title: '正常瓶数',
           icon: 'liquefiedgas.png',
           icon: 'liquefiedgas.png',
         }, {
         }, {
-          num: '123',
+          num: 0,
           title: '过期瓶数',
           title: '过期瓶数',
           icon: 'liquefiedgas.png',
           icon: 'liquefiedgas.png',
         }, {
         }, {
-          num: '34',
+          num: 0,
           title: '报废瓶数',
           title: '报废瓶数',
           icon: 'liquefiedgas.png',
           icon: 'liquefiedgas.png',
         }]
         }]
       }
       }
     },
     },
     mounted() {
     mounted() {
+      this.getList()
       var box = document.getElementById("app");
       var box = document.getElementById("app");
       box.style.background = 'url(' + require('@/assets/image/login-bg.png') +
       box.style.background = 'url(' + require('@/assets/image/login-bg.png') +
         ') center center / 100% 100% no-repeat fixed'
         ') center center / 100% 100% no-repeat fixed'
@@ -103,6 +99,27 @@
         ') center center / 100% 100% no-repeat fixed'
         ') center center / 100% 100% no-repeat fixed'
     },
     },
     methods: {
     methods: {
+      getList() {
+        getUserHome().then(res => {
+          if (res.code == 200) {
+            var arr = res.data
+            // 地图
+            this.mapData = arr.storeStat
+            // 近12统计
+            this.growthList = arr.gasCylinderMonthStat
+            this.proportionList = arr.gasCylinderDeptStat
+            // 企业数据总汇
+            this.list[0].num = arr.storeCount
+            this.list[1].num = arr.deliveryCount
+            this.list[2].num = arr.customerCount
+            // 钢瓶数据汇总
+            this.list1[0].num = arr.gasCylinderCount
+            if (arr.gasCylinderStat != null) {
+              this.list1[1].num = arr.gasCylinderStat[0].count
+            }
+          }
+        })
+      },
       lookVideoGo(value) {
       lookVideoGo(value) {
         this.$router.push({
         this.$router.push({
           path: '/system/salesStore',
           path: '/system/salesStore',

+ 2 - 0
src/views/system/salesStore.vue

@@ -316,6 +316,8 @@
           this.shopDialogVisible = true
           this.shopDialogVisible = true
         } else if (type == 'entry') {
         } else if (type == 'entry') {
           // 进入
           // 进入
+          this.$store.commit('SET_NAME', row.name)
+          localStorage.setItem('companyName', row.name);
           this.enterInto(row.id)
           this.enterInto(row.id)
         }
         }
       },
       },

+ 3 - 0
src/views/system/transport.vue

@@ -221,6 +221,9 @@
           this.parentId = row.id
           this.parentId = row.id
           this.shopDialogVisible = true
           this.shopDialogVisible = true
         } else if (type == 'entry') {
         } else if (type == 'entry') {
+          // 进入
+          this.$store.commit('SET_NAME', row.name)
+          localStorage.setItem('companyName', row.name);
           this.enterInto(row.id)
           this.enterInto(row.id)
         }
         }
       },
       },

+ 2 - 1
vue.config.js

@@ -16,7 +16,8 @@ module.exports = defineConfig({
   devServer: {
   devServer: {
     proxy: {
     proxy: {
       '/api': {
       '/api': {
-        target: 'http://gascylindertest.baozhida.cn/gas_cylinder',
+        target: 'https://gascylinder.baozhida.cn/gas_cylinder', //线上
+        // target: 'http://gascylindertest.baozhida.cn/gas_cylinder', //测试
         ws: false,
         ws: false,
         changeOrigin: true,
         changeOrigin: true,
         pathRewrite: {
         pathRewrite: {

+ 19 - 6
yarn.lock

@@ -16,11 +16,6 @@
     "event-pubsub" "4.3.0"
     "event-pubsub" "4.3.0"
     "js-message" "1.0.7"
     "js-message" "1.0.7"
 
 
-"@amap/amap-jsapi-loader@^1.0.1":
-  "integrity" "sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw=="
-  "resolved" "https://registry.npmmirror.com/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz"
-  "version" "1.0.1"
-
 "@ampproject/remapping@^2.2.0":
 "@ampproject/remapping@^2.2.0":
   "integrity" "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg=="
   "integrity" "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg=="
   "resolved" "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz"
   "resolved" "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz"
@@ -2823,6 +2818,11 @@
   "resolved" "https://registry.npmjs.org/deepmerge/-/deepmerge-1.5.2.tgz"
   "resolved" "https://registry.npmjs.org/deepmerge/-/deepmerge-1.5.2.tgz"
   "version" "1.5.2"
   "version" "1.5.2"
 
 
+"deepmerge@^4.2.2":
+  "integrity" "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="
+  "resolved" "https://registry.npmmirror.com/deepmerge/-/deepmerge-4.3.1.tgz"
+  "version" "4.3.1"
+
 "default-gateway@^6.0.3":
 "default-gateway@^6.0.3":
   "integrity" "sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg=="
   "integrity" "sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg=="
   "resolved" "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz"
   "resolved" "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz"
@@ -6091,6 +6091,11 @@
   "resolved" "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz"
   "resolved" "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz"
   "version" "1.8.1"
   "version" "1.8.1"
 
 
+"shvl@^2.0.3":
+  "integrity" "sha512-V7C6S9Hlol6SzOJPnQ7qzOVEWUQImt3BNmmzh40wObhla3XOYMe4gGiYzLrJd5TFa+cI2f9LKIRJTTKZSTbWgw=="
+  "resolved" "https://registry.npmmirror.com/shvl/-/shvl-2.0.3.tgz"
+  "version" "2.0.3"
+
 "side-channel@^1.0.4":
 "side-channel@^1.0.4":
   "integrity" "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw=="
   "integrity" "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw=="
   "resolved" "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz"
   "resolved" "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz"
@@ -6759,7 +6764,15 @@
     "@vue/compiler-sfc" "2.7.16"
     "@vue/compiler-sfc" "2.7.16"
     "csstype" "^3.1.0"
     "csstype" "^3.1.0"
 
 
-"vuex@^3.6.2":
+"vuex-persistedstate@^4.1.0":
+  "integrity" "sha512-3SkEj4NqwM69ikJdFVw6gObeB0NHyspRYMYkR/EbhR0hbvAKyR5gksVhtAfY1UYuWUOCCA0QNGwv9pOwdj+XUQ=="
+  "resolved" "https://registry.npmmirror.com/vuex-persistedstate/-/vuex-persistedstate-4.1.0.tgz"
+  "version" "4.1.0"
+  dependencies:
+    "deepmerge" "^4.2.2"
+    "shvl" "^2.0.3"
+
+"vuex@^3.0 || ^4.0.0-rc", "vuex@^3.6.2":
   "integrity" "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw=="
   "integrity" "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw=="
   "resolved" "https://registry.npmjs.org/vuex/-/vuex-3.6.2.tgz"
   "resolved" "https://registry.npmjs.org/vuex/-/vuex-3.6.2.tgz"
   "version" "3.6.2"
   "version" "3.6.2"

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