index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  1. <template>
  2. <div class="winseaview-top" id="winseaview-top">
  3. <div class="top-bar__left">
  4. <!-- 伸缩icon -->
  5. <div class="winseaview-breadcrumb" :class="[{ 'winseaview-breadcrumb--active': isCollapse }]">
  6. <i class="iconfont icon-shouqi" @click="setCollapse"></i>
  7. </div>
  8. <!-- </div>
  9. <div class="top-bar__title"> -->
  10. <!-- 面包屑 -->
  11. <div class="top-bar__item top-bar__item--show">
  12. <top-menu v-if="showMenu"></top-menu>
  13. <bread-crumb v-if="!showMenu" />
  14. <smallTips v-if="showTooltip" />
  15. </div>
  16. <span class="top-bar__item" v-if="showSearch">
  17. <top-search></top-search>
  18. </span>
  19. </div>
  20. <div class="top-bar__right">
  21. <!-- 使用租户 -->
  22. <div class="hidden-content">
  23. <el-input ref="hiddenFocus" type="password" class="input-Style" v-model="barCode" size="small" @focus="focus" @blur="blur"
  24. @keyup.enter.native="payCode" placeholder="扫码枪内容"></el-input>
  25. <div v-show="isOpenCodeGun">扫码枪已连接</div>
  26. <div v-show="!isOpenCodeGun" @click="setCodeGun">点我扫码</div>
  27. <el-dialog title="扫描二维码" :visible.sync="smAlert">
  28. <el-button v-hasPermission="`acquisitionManagement.acquisitionQuality.initial`"
  29. v-if="btnStatus.status1||btnStatus.status2" @click="goToPage(1)">去初检
  30. </el-button>
  31. <el-button v-hasPermission="`acquisitionManagement.acquisitionQuality.con`"
  32. v-if="btnStatus.status3||btnStatus.status4" @click="goToPage(2)">去确认质检
  33. </el-button>
  34. <el-button v-hasPermission="`acquisitionManagement.acquisitionQuality.again`"
  35. v-if="btnStatus.status1||btnStatus.status2||btnStatus.status3||btnStatus.status4" @click="goToPage(3)">去复检
  36. </el-button>
  37. <el-button v-hasPermission="`acquisitionManagement.acquisitionWeight.mao`"
  38. v-if="btnStatus.status1||btnStatus.status2||btnStatus.status3" @click="goToPage(4)">去称毛重
  39. </el-button>
  40. <el-button v-hasPermission="`acquisitionManagement.acquisitionPay.add`" v-if="btnStatus.status5"
  41. @click="goToPage(5)">去结算</el-button>
  42. <el-button v-hasPermission="`acquisitionManagement.acquisitionWeight.weight`"
  43. v-if="btnStatus.status2||btnStatus.status3||btnStatus.status4||btnStatus.status5" @click="goToPage(6)">去称皮重
  44. </el-button>
  45. <el-button @click="smAlert = false" class="btn">关闭</el-button>
  46. </el-dialog>
  47. </div>
  48. <div v-if="getDay" class="right-menu-item hover-effect dayClass">
  49. {{ $t('common.trialDays') }}
  50. <span style="padding: 0 2px">{{ getDay }}</span>{{ $t('common.days') }}
  51. </div>
  52. <el-tooltip v-if="showColor" effect="dark" :content="$t('navbar.color')" placement="bottom">
  53. <div class="top-bar__item">
  54. <top-color></top-color>
  55. </div>
  56. </el-tooltip>
  57. <el-tooltip v-if="showTheme" effect="dark" :hide-after="1500" :content="$t('navbar.theme')" placement="bottom">
  58. <div class="top-bar__item top-bar__item--show">
  59. <top-theme></top-theme>
  60. </div>
  61. </el-tooltip>
  62. <!-- <el-tooltip effect="dark"
  63. :content="$t('navbar.language')"
  64. placement="bottom">
  65. <div class="top-bar__item top-bar__item--show">
  66. <top-lang></top-lang>
  67. </div>
  68. </el-tooltip> -->
  69. <el-tooltip v-if="showFullScren" effect="dark" :content="
  70. isFullScren ? $t('navbar.screenfull') : $t('navbar.screenfullF')
  71. " placement="bottom">
  72. <div class="top-bar__item">
  73. <i :class="isFullScren ? 'el-icon-full-screen' : 'el-icon-full-screen'" @click="handleScreen"></i>
  74. </div>
  75. </el-tooltip>
  76. <img class="top-bar__img" v-lazy="userInfo.avatar" />
  77. <el-dropdown>
  78. <span class="el-dropdown-link">
  79. <span>{{ userInfo.showRoleName }} : {{ userInfo.staffName }}</span>
  80. <i class="el-icon-arrow-down el-icon--right"></i>
  81. </span>
  82. <el-dropdown-menu slot="dropdown">
  83. <el-dropdown-item icon="el-icon-s-custom" @click.native="personalFlag = true">
  84. {{ $t('navbar.personalInformation') }}
  85. </el-dropdown-item>
  86. <el-dropdown-item icon="el-icon-s-promotion" @click.native="passwordFlag = true">
  87. {{ $t('navbar.uploadPsw') }}
  88. </el-dropdown-item>
  89. <!-- <el-dropdown-item>
  90. <router-link to="/info/index">{{$t('navbar.userinfo')}}</router-link>
  91. </el-dropdown-item> -->
  92. <el-dropdown-item v-if="showSetting" icon="el-icon-s-tools" @click.native="settingDrawer = true">
  93. {{ $t('navbar.layoutSetting') }}
  94. </el-dropdown-item>
  95. <el-dropdown-item @click.native="logout" divided>{{
  96. $t('navbar.logOut')
  97. }}</el-dropdown-item>
  98. </el-dropdown-menu>
  99. </el-dropdown>
  100. </div>
  101. <topSetting v-model="settingDrawer" @close="() => (settingDrawer = !settingDrawer)" />
  102. <!--个人信息-->
  103. <WinseaContentModal v-model="personalFlag" :title="$t('navbar.personalInformation')">
  104. <el-form ref="personalMsg" :model="passwordMsg" label-position="right" label-width="150px">
  105. <el-form-item :label="$t('login.name')" prop="originalPassword">
  106. {{ userInfo.staffName }}
  107. </el-form-item>
  108. <el-form-item :label="$t('login.account')" prop="newPassword">
  109. {{ account }}
  110. </el-form-item>
  111. <el-form-item :label="$t('login.phone')" prop="newPassword">
  112. {{ userInfo.staffMobilePhone }}
  113. </el-form-item>
  114. <el-form-item :label="$t('login.role')" prop="newPassword">
  115. {{ userInfo.showRoleName }}
  116. </el-form-item>
  117. <el-form-item :label="$t('login.dept')" prop="newPassword">
  118. {{ userInfo.deptName }}
  119. </el-form-item>
  120. <el-form-item :label="$t('login.company')" prop="newPassword">
  121. <div class="company-info">
  122. {{ userInfo.compName }}
  123. </div>
  124. </el-form-item>
  125. </el-form>
  126. </WinseaContentModal>
  127. <!--修改密码-->
  128. <WinseaContentModal v-model="passwordFlag" :title="$t('navbar.uploadPsw')">
  129. <el-form ref="passwordMsg" :model="passwordMsg" :label-width="language == 'en' ? '156px' : '100px'"
  130. :rules="passwordMsgRules">
  131. <el-form-item :label="$t('login.originalPassword') + $t('common.colon')" prop="originalPassword">
  132. <ws-input type="password" :placeholder="$t('login.message04')" v-model="passwordMsg.originalPassword"
  133. style="width: 318px" />
  134. </el-form-item>
  135. <el-form-item :label="$t('login.newPassword') + $t('common.colon')" prop="newPassword">
  136. <ws-input type="password" v-model="passwordMsg.newPassword" :placeholder="$t('login.verification01')"
  137. style="width: 318px" />
  138. </el-form-item>
  139. <el-form-item :label="$t('login.confirmPassword') + $t('common.colon')" prop="password">
  140. <ws-input type="password" v-model="passwordMsg.password" :placeholder="$t('login.verification01')"
  141. style="width: 318px" />
  142. </el-form-item>
  143. </el-form>
  144. <span slot="footer" class="dialog-footer">
  145. <ws-button @click="passwordFlag = false">{{
  146. $t('showMessage.cancel')
  147. }}</ws-button>
  148. <ws-button type="primary" @click="savePassword('passwordMsg')">{{
  149. $t('showMessage.confirm')
  150. }}</ws-button>
  151. </span>
  152. </WinseaContentModal>
  153. </div>
  154. </template>
  155. <script>
  156. import {
  157. changePasswordByPwd
  158. } from '@/model/indexRx'
  159. import {
  160. mapActions,
  161. mapGetters,
  162. mapState
  163. } from 'vuex'
  164. import {
  165. fullscreenToggel,
  166. listenfullscreen
  167. } from '@/utils/util'
  168. import topMenu from './top-menu'
  169. import topSearch from './top-search'
  170. import topTheme from './top-theme'
  171. import topColor from './top-color'
  172. import topNotice from './top-notice'
  173. import topLang from './top-lang'
  174. import topSetting from './top-setting'
  175. import breadCrumb from '@/components/Breadcrumb'
  176. import {
  177. EventBus
  178. } from 'base-core-lib'
  179. import {
  180. validPassword
  181. } from '@/utils/validate'
  182. import smallTips from '@/components/WinseaCom/smallTips'
  183. import {
  184. getLook
  185. } from '@/model/warehouse/index'
  186. import {
  187. getQRCodeData
  188. } from '@/model/houseSelfCollect/index'
  189. const validPasswordRule = function(rule, value, callback) {
  190. if (!validPassword(value)) {
  191. callback(new Error(this.$t('login.verification01')))
  192. } else {
  193. callback()
  194. }
  195. }
  196. const validPasswordRule2 = function(rule, value, callback) {
  197. if (!value) {
  198. callback(new Error(this.$t('login.verification02')))
  199. } else if (value !== this.passwordMsg.newPassword) {
  200. callback(new Error(this.$t('login.verification03')))
  201. } else {
  202. callback()
  203. }
  204. }
  205. export default {
  206. components: {
  207. topMenu,
  208. topSearch,
  209. topTheme,
  210. topColor,
  211. topNotice,
  212. topLang,
  213. topSetting,
  214. breadCrumb,
  215. smallTips,
  216. },
  217. name: 'top',
  218. data() {
  219. return {
  220. //status1:已初检未称毛重状态 status2:已初检且已称毛重状态 status3:已复检且已称毛重 status4:已复检且已称皮重状态
  221. //status5:已确认质检且已称皮重且未结算状态 status6:已结算状态
  222. btnStatus: {
  223. status1: false,
  224. status2: false,
  225. status3: false,
  226. status4: false,
  227. status5: false,
  228. status6: false,
  229. },
  230. toPageData: {},
  231. userINfo: {},
  232. barCode: '',
  233. isOpenCodeGun: false,
  234. smAlert: false,
  235. showList: [
  236. 'maintenancePlanList',
  237. 'maintenanceReportList',
  238. 'navigationMaterialList',
  239. 'protectionEntry',
  240. 'protection',
  241. 'newlyIncreased',
  242. 'clientEdit',
  243. 'staticDetail',
  244. 'maApplicationAdd',
  245. 'maApplicationEdit',
  246. 'maApplicationLabel',
  247. 'monthContrastList',
  248. ],
  249. settingDrawer: false,
  250. personalFlag: false,
  251. passwordFlag: false,
  252. passwordMsgRules: {
  253. originalPassword: [{
  254. required: true,
  255. message: ' ',
  256. trigger: 'blur'
  257. }],
  258. // newPassword: [
  259. // {
  260. // required: true,
  261. // trigger: 'blur',
  262. // validator: validPasswordRule.bind(this),
  263. // },
  264. // ],
  265. // password: [
  266. // {
  267. // required: true,
  268. // trigger: 'blur',
  269. // validator: validPasswordRule2.bind(this),
  270. // },
  271. // ],
  272. },
  273. passwordMsg: {
  274. originalPassword: '', // 原始密码
  275. newPassword: '', // 新密码
  276. password: '', // 二次输入密码
  277. },
  278. // roleName: '',
  279. // phone: '',
  280. // roleId: '',
  281. // deptName: '',
  282. // deptId: '',
  283. // staffName: '',
  284. account: localStorage.getItem('ws-pf_account'),
  285. // compName: '',
  286. companyId: localStorage.getItem('ws-pf_compId'),
  287. cangid:''
  288. }
  289. },
  290. filters: {},
  291. created() {
  292. // this.getUserInfo()
  293. this.getUserWorseHouse();
  294. this.userINfo = {
  295. userCompany: localStorage.getItem('ws-pf_compId'),
  296. userName: localStorage.getItem('ws-pf_staffName'),
  297. }
  298. },
  299. mounted() {
  300. listenfullscreen(this.setScreen)
  301. },
  302. computed: {
  303. ...mapState({
  304. showDebug: (state) => state.commonStore.showDebug,
  305. showTheme: (state) => state.commonStore.showTheme,
  306. showLock: (state) => state.commonStore.showLock,
  307. showFullScren: (state) => state.commonStore.showFullScren,
  308. showCollapse: (state) => state.commonStore.showCollapse,
  309. showSearch: (state) => state.commonStore.showSearch,
  310. showSetting: (state) => state.commonStore.showSetting,
  311. showMenu: (state) => state.commonStore.showMenu,
  312. showColor: (state) => state.commonStore.showColor,
  313. }),
  314. ...mapGetters([
  315. 'userInfo',
  316. 'isFullScren',
  317. 'tagWel',
  318. 'tagList',
  319. 'isCollapse',
  320. 'tag',
  321. 'logsLen',
  322. 'logsFlag',
  323. 'language',
  324. ]),
  325. getDay() {
  326. const {
  327. statusFlag = -1, daysRemaining
  328. } =
  329. JSON.parse(localStorage.getItem('ws_login_getTenantInfoByUser')) || {}
  330. return statusFlag * 1 === 2 ? daysRemaining + '' : ''
  331. },
  332. showTooltip() {
  333. return this.showList.indexOf(this.$route.name) > -1 && !this.showMenu
  334. },
  335. },
  336. methods: {
  337. ...mapActions('common', ['setLocalVessels']),
  338. payCode() {debugger
  339. console.log("input", this.barCode)
  340. this.btnStatus = {
  341. status1: false,
  342. status2: false,
  343. status3: false,
  344. status4: false,
  345. status5: false,
  346. status6: false,
  347. }
  348. // let _userCompId = "2710b21efc1e4393930c5dc800010dc4"
  349. // let _qualityNo = "SGRK202112140060003"
  350. let _userCompId = this.barCode.split('&')[0]
  351. let _qualityNo = this.barCode.split('&')[1]
  352. let _userHouseId = this.barCode.split('&')[2]
  353. this.cangid = this.barCode.split('&')[2]
  354. let tmp = {
  355. compId: _userCompId,
  356. number: _qualityNo,
  357. warehouseId: _userHouseId
  358. }
  359. this.barCode = ''
  360. //判断当前账号公司是否是二维码上公司
  361. if (this.userINfo.userCompany != _userCompId) {
  362. this.$message.error('当前身份不可操作');
  363. return
  364. }
  365. //判断二维码上的仓库当前账号是否有权限操作
  366. this.getLook(this.cangid, this.userINfo.userName)
  367. //扫码枪扫码后显示弹框
  368. this.getQRCodeData(tmp)
  369. },
  370. // 查看二维码仓库负责人
  371. async getLook(compId, userName) {
  372. await getLook({
  373. id: compId,
  374. })
  375. .toPromise()
  376. .then((response) => {
  377. if (response.code == 200) {
  378. if (response.personCharge != userName || response.otherPersonCharge.indexOf(userName) <= -1) {
  379. this.$message.error('当前身份不可操作');
  380. return
  381. }
  382. }
  383. })
  384. },
  385. // 二维码获取数据
  386. async getQRCodeData(tmp) {
  387. await getQRCodeData(tmp)
  388. .toPromise()
  389. .then((response) => {
  390. debugger
  391. this.toPageData = response
  392. // 处理按钮显示状态
  393. // this.btnStatus
  394. // 检斤状态
  395. let _status1 = response.status
  396. //质检状态
  397. let _status2 = response.qualityInspectionManagement.status
  398. // 付款状态
  399. let _status3 = response.paymentManagement?response.paymentManagement.status:''
  400. if (_status2 == '已初检' && _status1 == '已质检') {
  401. this.btnStatus.status1 = true
  402. } else if (_status2 == '已初检' && _status1 == '已称毛重') {
  403. this.btnStatus.status2 = true
  404. } else if (_status2 == '已复检' && _status1 == '已称毛重') {
  405. this.btnStatus.status3 = true
  406. } else if (_status2 == '已复检' && _status1 == '已称皮重') {
  407. this.btnStatus.status4 = true
  408. } else if (_status2 == '已确认' && _status1 == '已称皮重' && _status3 == '待结算') {
  409. this.btnStatus.status5 = true
  410. } else if (_status3 == '已结算') {
  411. this.btnStatus.status6 = true
  412. }
  413. if (_status3 == '已结算') {
  414. this.$message.error('业务已完结');
  415. } else {
  416. this.smAlert = true
  417. }
  418. })
  419. },
  420. setCodeGun() {
  421. this.$refs['hiddenFocus'].focus()
  422. },
  423. focus() {
  424. console.log("当前焦点状态")
  425. this.isOpenCodeGun = true
  426. },
  427. blur() {
  428. console.log("当前已失去焦点状态")
  429. this.isOpenCodeGun = false
  430. },
  431. goToPage(type) {
  432. let _url = ''
  433. if (type === 1) {
  434. // this.toPageData
  435. this.$router.push({
  436. path: 'inspectInfo',
  437. query: {
  438. type: 3,
  439. cangid: this.cangid,
  440. id: this.toPageData.qualityInspectionManagement.id,
  441. warehouseName: this.toPageData.qualityInspectionManagement.warehouseName,
  442. count: 0,
  443. warehouseNo: 0,
  444. allowEdit:this.toPageData.warehouseBaseInfo.allowEdit,
  445. status:this.toPageData.status
  446. },
  447. })
  448. } else if (type === 2) {
  449. this.$router.push({
  450. path: 'inspectInfo',
  451. query: {
  452. type: 5,
  453. cangid: this.cangid,
  454. id: this.toPageData.qualityInspectionManagement.id,
  455. warehouseName: this.toPageData.qualityInspectionManagement.warehouseName,
  456. count: 0,
  457. warehouseNo: 0,
  458. allowEdit:this.toPageData.warehouseBaseInfo.allowEdit,
  459. status:this.toPageData.status
  460. },
  461. })
  462. } else if (type === 3) {
  463. this.$router.push({
  464. path: 'inspectInfo',
  465. query: {
  466. type: 4,
  467. cangid: this.cangid,
  468. id: this.toPageData.qualityInspectionManagement.id,
  469. warehouseName: this.toPageData.qualityInspectionManagement.warehouseName,
  470. count: 0,
  471. warehouseNo: 0,
  472. allowEdit:this.toPageData.warehouseBaseInfo.allowEdit,
  473. status:this.toPageData.status
  474. },
  475. })
  476. } else if (type === 4) {
  477. this.$router.push({
  478. path: 'weightCheck',
  479. query: {
  480. tpyeNo: 1,
  481. id: this.toPageData.id,
  482. number: this.toPageData.number,
  483. binNumber: this.toPageData.binNumber,
  484. customer: this.toPageData.customer,
  485. storageNumber: this.toPageData.storageNumber,
  486. carNumber: this.toPageData.carNumber,
  487. boxNo: this.toPageData.qualityInspectionManagement.boxNo,
  488. boxNoOther: this.toPageData.qualityInspectionManagement.boxNoOther,
  489. titleNo: this.toPageData.qualityInspectionManagement.titleNo,
  490. titleNoOther: this.toPageData.qualityInspectionManagement.titleNoOther,
  491. goodsName: this.toPageData.goodsName,
  492. grossWeight: this.toPageData.grossWeight,
  493. tare: this.toPageData.tare,
  494. netWeight: this.toPageData.netWeight,
  495. relationId: this.toPageData.relationId,
  496. warehouseId: this.cangid,
  497. monitorUrl1: this.toPageData.warehouseBaseInfo.monitorUrl1,
  498. monitorUrl2: this.toPageData.warehouseBaseInfo.monitorUrl2,
  499. allowEdit: this.toPageData.warehouseBaseInfo.allowEdit,
  500. cangid: this.cangid,
  501. warehouseName: this.toPageData.qualityInspectionManagement.warehouseName,
  502. paramType: this.toPageData.qualityInspectionManagement.paramType,
  503. customerNumberCard: this.toPageData.customerNumberCard,
  504. automaticWeightAcquisition: this.toPageData.automaticWeightAcquisition
  505. },
  506. })
  507. } else if (type === 5) {
  508. localStorage.setItem('paymentManagementReturn', false)
  509. this.$router.push({
  510. path: 'settlement',
  511. query: {
  512. type: 1,
  513. id: this.toPageData.paymentList.id,
  514. },
  515. })
  516. } else if (type === 6) {
  517. this.$router.push({
  518. path: 'weightCheck',
  519. query: {
  520. tpyeNo: 2,
  521. id: this.toPageData.id,
  522. number: this.toPageData.number,
  523. binNumber: this.toPageData.binNumber,
  524. customer: this.toPageData.customer,
  525. storageNumber: this.toPageData.storageNumber,
  526. carNumber: this.toPageData.carNumber,
  527. boxNo: this.toPageData.qualityInspectionManagement.boxNo,
  528. boxNoOther: this.toPageData.qualityInspectionManagement.boxNoOther,
  529. titleNo: this.toPageData.qualityInspectionManagement.titleNo,
  530. titleNoOther: this.toPageData.qualityInspectionManagement.titleNoOther,
  531. goodsName: this.toPageData.goodsName,
  532. grossWeight: this.toPageData.grossWeight,
  533. tare: this.toPageData.tare,
  534. netWeight: this.toPageData.netWeight,
  535. relationId: this.toPageData.relationId,
  536. warehouseId: this.cangid,
  537. monitorUrl1: this.toPageData.warehouseBaseInfo.monitorUrl1,
  538. monitorUrl2: this.toPageData.warehouseBaseInfo.monitorUrl2,
  539. allowEdit: this.toPageData.warehouseBaseInfo.allowEdit,
  540. cangid: this.cangid,
  541. warehouseName: this.toPageData.qualityInspectionManagement.warehouseName,
  542. paramType: this.toPageData.qualityInspectionManagement.paramType,
  543. customerNumberCard: this.toPageData.customerNumberCard,
  544. automaticWeightAcquisition: this.toPageData.automaticWeightAcquisition
  545. },
  546. })
  547. }
  548. this.smAlert = false
  549. },
  550. //获取当前用户管理的仓库
  551. getUserWorseHouse() {
  552. },
  553. handleScreen() {
  554. fullscreenToggel()
  555. },
  556. setCollapse() {
  557. this.$store.commit('SET_COLLAPSE')
  558. },
  559. setScreen() {
  560. this.$store.commit('SET_FULLSCREN')
  561. },
  562. cancelPaw() {
  563. this.$refs.passwordMsg.resetFields()
  564. },
  565. // 修改管理员密码
  566. savePassword(formName) {
  567. this.$refs[formName].validate((valid) => {
  568. if (valid) {
  569. const data = {
  570. originalPassword: this.passwordMsg.originalPassword,
  571. password: this.passwordMsg.password,
  572. }
  573. changePasswordByPwd(data)
  574. .toPromise()
  575. .then(() => {
  576. EventBus.$emit('success', this.$t('message.updateMessage'))
  577. this.passwordFlag = false
  578. })
  579. } else {
  580. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  581. return false
  582. }
  583. })
  584. },
  585. // async getUserInfo () {
  586. // this.staffName = this.userInfo.staffName
  587. // this.phone = this.userInfo.staffMobilePhone
  588. // this.deptName = this.userInfo.deptName
  589. // this.roleName = this.userInfo.showRoleName
  590. // this.roleId = this.userInfo.showRoleId
  591. // this.compName = this.userInfo.compName
  592. // },
  593. toggleSideBar() {
  594. this.$store.dispatch('app/toggleSideBar')
  595. },
  596. logout() {
  597. this.$confirm(this.$t('logoutTip'), this.$t('tip'), {
  598. confirmButtonText: this.$t('submitText'),
  599. cancelButtonText: this.$t('cancelText'),
  600. type: 'warning',
  601. }).then(async () => {
  602. localStorage.removeItem('ws-pf_roleName')
  603. localStorage.removeItem('ws-pf_roleId')
  604. localStorage.removeItem('ws-pf_staffName')
  605. localStorage.removeItem('ws-pf_deptId')
  606. localStorage.removeItem('ws-pf_deptName')
  607. localStorage.removeItem('ws-pf_organMonetaryKey')
  608. localStorage.removeItem('ws-pf_organMonetaryValue')
  609. localStorage.removeItem('ws-pf_vessels')
  610. localStorage.removeItem('ws-pf_isLandBasedFlag')
  611. await this.$store.dispatch('user/logout')
  612. this.$router.push(
  613. process.env.VUE_APP_PACKAGE_ENV === 'ship' ? '/ship_login' : '/login'
  614. )
  615. })
  616. },
  617. },
  618. }
  619. </script>
  620. <style lang="scss" scoped>
  621. .dayClass {
  622. font-size: 14px !important;
  623. span {
  624. font-weight: 600;
  625. font-size: 14px;
  626. color: #ff3838;
  627. }
  628. }
  629. .hamburger-container {
  630. line-height: 40px;
  631. height: 100%;
  632. float: left;
  633. cursor: pointer;
  634. transition: background 0.3s;
  635. -webkit-tap-highlight-color: transparent;
  636. &:hover {
  637. background: rgba(0, 0, 0, 0.025);
  638. }
  639. }
  640. .breadcrumb-container {
  641. float: left;
  642. position: relative;
  643. }
  644. .errLog-container {
  645. display: inline-block;
  646. vertical-align: top;
  647. }
  648. .right-menu {
  649. float: right;
  650. height: 100%;
  651. line-height: 40px;
  652. &:focus {
  653. outline: none;
  654. }
  655. .right-menu-item {
  656. display: inline-block;
  657. padding: 0 8px;
  658. height: 100%;
  659. font-size: 18px;
  660. color: #5a5e66;
  661. // vertical-align: text-bottom;
  662. &.hover-effect {
  663. cursor: pointer;
  664. transition: background 0.3s;
  665. &:hover {
  666. background: rgba(0, 0, 0, 0.025);
  667. }
  668. }
  669. }
  670. .avatar-container {
  671. margin-right: 30px;
  672. .avatar-wrapper {
  673. position: relative;
  674. span {
  675. height: 40px;
  676. line-height: 40px;
  677. font-size: 12px;
  678. }
  679. .user-avatar {
  680. cursor: pointer;
  681. width: 40px;
  682. height: 40px;
  683. border-radius: 10px;
  684. }
  685. .el-icon-caret-bottom {
  686. cursor: pointer;
  687. position: absolute;
  688. right: -20px;
  689. top: 15px;
  690. font-size: 12px;
  691. }
  692. }
  693. }
  694. }
  695. .hidden-content {
  696. display: flex;
  697. font-size: 16px;
  698. }
  699. .input-Style {
  700. opacity: 1;
  701. margin-right: 20px;
  702. // visibility: hidden;
  703. }
  704. .btn {
  705. background: #5878e8;
  706. color: white;
  707. }
  708. </style>