CCL_QMS检验
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

452 lines
14 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
5 months ago
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <template>
  2. <nav class="site-navbar" :class="'site-navbar--' + navbarLayoutType">
  3. <div class="site-navbar__header">
  4. <!-- @click="$router.push({ name: 'home' })"-->
  5. <h1 class="site-navbar__brand">
  6. <el-menu
  7. class="site-navbar__menu"
  8. mode="horizontal">
  9. <el-menu-item class="site-navbar__switch" index="0" @click="sidebarFold = !sidebarFold">
  10. <icon-svg name="zhedie"></icon-svg>
  11. </el-menu-item>
  12. <!-- <el-menu-item class="site-navbar__switch menu-toggle-btn" index="0-1" @click="toggleMenuMode" :title="menuModeTitle">-->
  13. <!-- <i class="el-icon-refresh"></i>-->
  14. <!-- </el-menu-item>-->
  15. </el-menu>
  16. <!-- brand-gradient-text-->
  17. <a class="site-navbar__brand-lg brand-gradient-text" href="javascript:;" v-if="store.state.common.effectsEnabled==='Y'">{{ pageLanguage.XjSysManage }}</a>
  18. <a class="site-navbar__brand-lg " href="javascript:;" v-if="store.state.common.effectsEnabled==='N'">{{ pageLanguage.XjSysManage }}</a>
  19. <a class="site-navbar__brand-mini" href="javascript:;">{{ pageLanguage.abbreviation }}</a>
  20. </h1>
  21. </div>
  22. <div class="site-navbar__body clearfix">
  23. <el-menu
  24. class="site-navbar__menu site-navbar__menu--right"
  25. mode="horizontal">
  26. <el-menu-item class="site-navbar__avatar" index="1">
  27. <span class="el-dropdown-link" @click="userSetting">
  28. <icon-svg name="editTable" style="width: 25px;height: 25px;margin-top: 5px"></icon-svg>
  29. </span>
  30. </el-menu-item>
  31. <!-- <el-menu-item v-if="isAuth('review:show')" class="site-navbar__avatar" index="1">-->
  32. <!-- <span class="el-dropdown-link">-->
  33. <!-- <router-link :to="{path:'purchaseorder-procurementReview',query:{'': ''}}">-->
  34. <!-- 工具待审核-->
  35. <!-- </router-link>-->
  36. <!-- <el-badge isAuth :value="pending.pendingReview" class="item" style="margin-top: 10px"/>-->
  37. <!-- </span>-->
  38. <!-- </el-menu-item>-->
  39. <el-menu-item class="site-navbar__avatar" index="2">
  40. <span style=" color: #909399;" @click="helpFileList()">
  41. {{ $t('main.help') }}
  42. <!-- <icon-svg name="help" style="width: 25px;height: 25px;margin-top: 5px"></icon-svg>-->
  43. </span>
  44. </el-menu-item>
  45. <el-submenu index="3">
  46. <template slot="title">{{ pageLanguage.setting }}</template>
  47. <el-submenu index="2-1">
  48. <template slot="title">{{ pageLanguage.languageSetting }}</template>
  49. <el-menu-item index="2-1-1" :key="index" :value="item.languageCode" v-for="(item,index) in languageList "
  50. @click.native="switch_the_language(item.languageCode)">{{ item.languageName }}
  51. </el-menu-item>
  52. </el-submenu>
  53. <el-submenu index="2-2">
  54. <template slot="title">{{ pageLanguage.userSetting }}</template>
  55. <el-menu-item index="2-2-1" @click.native="updatePasswordHandle()">{{ pageLanguage.updatePassword }}
  56. </el-menu-item>
  57. <el-menu-item index="2-2-2" @click.native="updateLanguageHandle()">{{ pageLanguage.updateDefaultLanguage }}
  58. </el-menu-item>
  59. </el-submenu>
  60. <el-menu-item index="2-3" @click="$router.push({ name: 'theme' })">{{ pageLanguage.cssSetting }}</el-menu-item>
  61. <!-- <el-menu-item index="2-4" @click="printList()">{{ pageLanguage.printSetting }}</el-menu-item>-->
  62. </el-submenu>
  63. <el-menu-item class="site-navbar__avatar" index="4">
  64. <el-dropdown :show-timeout="0" placement="bottom">
  65. <span class="el-dropdown-link">
  66. <img src="~@/assets/img/avatar.png" :alt="userName">{{ userName }}
  67. </span>
  68. <el-dropdown-menu slot="dropdown">
  69. <el-dropdown-item @click.native="logoutHandle()">{{ $t('main.logout') }}</el-dropdown-item>
  70. </el-dropdown-menu>
  71. </el-dropdown>
  72. </el-menu-item>
  73. </el-menu>
  74. </div>
  75. <!-- 弹窗, 修改密码 -->
  76. <update-password v-if="updatePassowrdVisible" ref="updatePassowrd"></update-password>
  77. <!-- 弹窗, 修改默认语言 -->
  78. <update-language v-if="updateLanguageVisible" ref="updateLanguage"></update-language>
  79. <!-- 文件列表 -->
  80. <FileListView ref="fileListView" v-if="helpFileVisible"></FileListView>
  81. <!-- 打印机列表 -->
  82. <UserPrintList ref="userPrintList" v-if="printListVisible"></UserPrintList>
  83. <!-- 动态列 -->
  84. <column v-if="visible" ref="column" @refreshData="getTableUserColumn" v-drag></column>
  85. </nav>
  86. </template>
  87. <script>
  88. import UpdatePassword from './main-navbar-update-password'
  89. import UpdateLanguage from './main-navbar-update-language'
  90. import {clearLoginInfo} from '@/utils'
  91. import FileListView from './modules/common/file-list-view'
  92. import UserPrintList from './modules/common/user-print-list'
  93. import column from "./modules/common/column";
  94. import {
  95. searchFunctionButtonList,
  96. saveButtonList,
  97. } from "@/api/sysLanguage.js"
  98. import {
  99. getReviewToolCount
  100. } from '@/api/purchaseorder/procurementReview.js'
  101. import store from '../store'
  102. export default {
  103. inject: ['refresh'],
  104. data() {
  105. return {
  106. visible: false,
  107. updatePassowrdVisible: false,
  108. updateLanguageVisible: false,
  109. helpFileVisible: false,
  110. printListVisible: false,
  111. message: this.$t('language.name'),
  112. languageList: [],
  113. pageLanguage: {
  114. XjSysManage: this.$t('main.appName'),
  115. abbreviation: this.$t('main.abbreviation'),
  116. setting: this.$t('main.setting'),
  117. languageSetting: this.$t('main.languageSetting'),
  118. userSetting: this.$t('main.userSetting'),
  119. updatePassword: this.$t('main.updatePassword'),
  120. updateDefaultLanguage: this.$t('main.updateDefaultLanguage'),
  121. cssSetting: this.$t('main.cssSetting'),
  122. printSetting: this.$t('main.cssSetting'),
  123. },
  124. // 导出 end
  125. pageLanguageList: [
  126. {
  127. functionId: "systemInformation",
  128. languageValue: 'CCLQMS管理系统',
  129. objectId: 'XjSysManage',
  130. objectType: "label",
  131. tableId: "systemInformation"
  132. },
  133. {
  134. functionId: "systemInformation",
  135. languageValue: '首页',
  136. objectId: 'homePage',
  137. objectType: "label",
  138. tableId: "systemInformation"
  139. },
  140. {
  141. functionId: "systemInformation",
  142. languageValue: '旭捷',
  143. objectId: 'abbreviation',
  144. objectType: "label",
  145. tableId: "systemInformation"
  146. },
  147. {
  148. functionId: "systemInformation",
  149. languageValue: '设置',
  150. objectId: 'setting',
  151. objectType: "label",
  152. tableId: "systemInformation"
  153. },
  154. {
  155. functionId: "systemInformation",
  156. languageValue: '语言设置',
  157. objectId: 'languageSetting',
  158. objectType: "label",
  159. tableId: "systemInformation"
  160. },
  161. {
  162. functionId: "systemInformation",
  163. languageValue: '用户设置',
  164. objectId: 'userSetting',
  165. objectType: "label",
  166. tableId: "systemInformation"
  167. },
  168. {
  169. functionId: "systemInformation",
  170. languageValue: '修改密码',
  171. objectId: 'updatePassword',
  172. objectType: "label",
  173. tableId: "systemInformation"
  174. },
  175. {
  176. functionId: "systemInformation",
  177. languageValue: '修改用户语言',
  178. objectId: 'updateDefaultLanguage',
  179. objectType: "label",
  180. tableId: "systemInformation"
  181. },
  182. {
  183. functionId: "systemInformation",
  184. languageValue: '主题设置',
  185. objectId: 'cssSetting',
  186. objectType: "label",
  187. tableId: "systemInformation"
  188. },
  189. {
  190. functionId: "systemInformation",
  191. languageValue: '打印设置',
  192. objectId: 'printSetting',
  193. objectType: "label",
  194. tableId: "systemInformation"
  195. }
  196. ],
  197. pending: {
  198. pendingReview: 0,
  199. pendingSum: 0,
  200. },
  201. queryToolReview: {
  202. site: this.$store.state.user.site,
  203. userId: this.$store.state.user.name,
  204. strUserId: this.$store.state.user.id,
  205. },
  206. toolReviewTimer: null,
  207. }
  208. },
  209. watch: {
  210. pending: {
  211. deep: true,
  212. handler: function (newV, oldV) {
  213. this.pending.pendingSum = this.pending.pendingReview
  214. }
  215. },
  216. },
  217. components: {
  218. UpdatePassword,
  219. UpdateLanguage,
  220. FileListView,
  221. UserPrintList,
  222. column,
  223. },
  224. computed: {
  225. store () {
  226. return store
  227. },
  228. navbarLayoutType: {
  229. get() {
  230. return this.$store.state.common.navbarLayoutType
  231. }
  232. },
  233. sidebarFold: {
  234. get() {
  235. return this.$store.state.common.sidebarFold
  236. },
  237. set(val) {
  238. this.$store.commit('common/updateSidebarFold', val)
  239. }
  240. },
  241. mainTabs: {
  242. get() {
  243. return this.$store.state.common.mainTabs
  244. },
  245. set(val) {
  246. this.$store.commit('common/updateMainTabs', val)
  247. }
  248. },
  249. userName: {
  250. get() {
  251. return this.$store.state.user.userDisplay
  252. }
  253. },
  254. useHoverMenu: {
  255. get() {
  256. return this.$store.state.common.useHoverMenu
  257. },
  258. set(val) {
  259. this.$store.commit('common/updateUseHoverMenu', val)
  260. }
  261. },
  262. menuModeIcon() {
  263. return this.useHoverMenu ? 'zhedie' : 'zhedie'
  264. },
  265. menuModeTitle() {
  266. return this.useHoverMenu ? this.$t('main.menuMode.toClassic') : this.$t('main.menuMode.toHover')
  267. }
  268. },
  269. activated() {
  270. },
  271. mounted() {
  272. this.toolReviewTimer = setInterval(this.getReviewToolCount, 1000 * 60);
  273. },
  274. beforeDestroy() {
  275. clearInterval(this.toolReviewTimer);
  276. },
  277. methods: {
  278. // 打开页面设置
  279. userSetting() {
  280. this.visible = true;
  281. let queryTable = {
  282. userId: this.$store.state.user.name,
  283. functionId: this.$route.meta.menuId,
  284. languageCode: this.$i18n.locale,
  285. tableId: '',
  286. }
  287. this.$nextTick(() => {
  288. this.$refs.column.init(queryTable);
  289. })
  290. },
  291. getTableUserColumn() {
  292. this.$nextTick(() => {
  293. this.refresh()
  294. })
  295. },
  296. // 获取待审核的是工具申请单数量
  297. getReviewToolCount() {
  298. getReviewToolCount(this.queryToolReview).then(({data}) => {
  299. if (data.code == 0) {
  300. this.pending.pendingReview = data.data
  301. }
  302. })
  303. },
  304. // 打印机列表
  305. printList() {
  306. this.printListVisible = true;
  307. this.$nextTick(() => {
  308. this.$refs.userPrintList.init()
  309. })
  310. },
  311. // 帮助文档列表
  312. helpFileList() {
  313. let fileMappingDto = {
  314. fileId: '',
  315. fileType: '功能帮助文档',
  316. orderRef1: this.$route.meta.menuId,
  317. orderRef2: '',
  318. orderRef3: '',
  319. }
  320. this.helpFileVisible = true;
  321. this.$nextTick(() => {
  322. this.$refs.fileListView.init(fileMappingDto)
  323. })
  324. },
  325. // 获取多语言列表
  326. getLanguageList() {
  327. this.languageList = [
  328. { languageCode: 'cn', languageName: this.$t('main.languageName.cn') },
  329. { languageCode: 'en', languageName: this.$t('main.languageName.en') }
  330. ]
  331. },
  332. // 获取页面多语言数据
  333. getFunctionButtonList() {
  334. let queryButton = {
  335. functionId: 'systemInformation',
  336. tableId: 'systemInformation',
  337. languageCode: this.$i18n.locale,
  338. objectType: 'label'
  339. }
  340. searchFunctionButtonList(queryButton).then(({data}) => {
  341. if (data.code === 0) {
  342. this.pageLanguage = data.data
  343. }
  344. })
  345. },
  346. // 注3:增加语言切换函数
  347. switch_the_language(val) {
  348. localStorage.setItem('locale', val)
  349. location.reload()
  350. },
  351. // 修改密码
  352. updatePasswordHandle() {
  353. this.updatePassowrdVisible = true
  354. this.$nextTick(() => {
  355. this.$refs.updatePassowrd.init()
  356. })
  357. },
  358. // 修改用户默认语言
  359. updateLanguageHandle() {
  360. this.updateLanguageVisible = true
  361. this.$nextTick(() => {
  362. this.$refs.updateLanguage.init()
  363. })
  364. },
  365. // 退出
  366. logoutHandle() {
  367. this.$confirm(this.$t('main.logoutDialog.message'), this.$t('main.common.tip'), {
  368. confirmButtonText: this.$t('main.common.confirm'),
  369. cancelButtonText: this.$t('main.common.cancel'),
  370. type: 'warning'
  371. }).then(() => {
  372. this.$http({
  373. url: this.$http.adornUrl('/sys/logout'),
  374. method: 'post',
  375. data: this.$http.adornData()
  376. }).then(({data}) => {
  377. if (data && data.code === 0) {
  378. clearLoginInfo()
  379. this.$router.push({name: 'login'})
  380. }
  381. })
  382. }).catch(() => {
  383. })
  384. },
  385. // 切换菜单模式
  386. toggleMenuMode() {
  387. this.useHoverMenu = !this.useHoverMenu
  388. this.$message.success(this.useHoverMenu ? this.$t('main.menuMode.switchedHover') : this.$t('main.menuMode.switchedClassic'))
  389. }
  390. },
  391. created() {
  392. this.getLanguageList()
  393. // this.getFunctionButtonList()
  394. this.getReviewToolCount()
  395. }
  396. }
  397. </script>
  398. <style lang="scss">
  399. .icon-svg {
  400. width: 2em;
  401. }
  402. .el-menu--collapse .el-menu .el-submenu, .el-menu--popup, .el-menu-item {
  403. min-width: 50px !important;
  404. }
  405. .site-navbar__brand-lg, .site-navbar__brand-mini {
  406. margin: 0 5px;
  407. color: #fff;
  408. margin-left: -45px;
  409. }
  410. .el-menu--horizontal > .el-menu-item {
  411. color: #3b4249;
  412. }
  413. /* 菜单切换按钮悬停显示效果 */
  414. .menu-toggle-btn {
  415. opacity: 0;
  416. visibility: hidden;
  417. transition: all 0.3s ease;
  418. transform: translateX(-10px);
  419. }
  420. .site-navbar__menu:hover .menu-toggle-btn,
  421. .menu-toggle-btn:hover {
  422. opacity: 1;
  423. visibility: visible;
  424. transform: translateX(0);
  425. }
  426. /* 为了更好的用户体验,也可以在整个导航栏悬停时显示 */
  427. .site-navbar__brand:hover .menu-toggle-btn {
  428. opacity: 1;
  429. visibility: visible;
  430. transform: translateX(0);
  431. }
  432. </style>