index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737
  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() {
  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. this.toPageData = response
  391. // 处理按钮显示状态
  392. // this.btnStatus
  393. // 检斤状态
  394. let _status1 = response.status
  395. //质检状态
  396. let _status2 = response.qualityInspectionManagement.status
  397. // 付款状态
  398. let _status3 = response.paymentManagement?response.paymentManagement.status:''
  399. if (_status2 == '已初检' && _status1 == '已质检') {
  400. this.btnStatus.status1 = true
  401. } else if (_status2 == '已初检' && _status1 == '已称毛重') {
  402. this.btnStatus.status2 = true
  403. } else if (_status2 == '已复检' && _status1 == '已称毛重') {
  404. this.btnStatus.status3 = true
  405. } else if (_status2 == '已复检' && _status1 == '已称皮重') {
  406. this.btnStatus.status4 = true
  407. } else if (_status2 == '已确认' && _status1 == '已称皮重' && _status3 == '待结算') {
  408. this.btnStatus.status5 = true
  409. } else if (_status3 == '已结算') {
  410. this.btnStatus.status6 = true
  411. }
  412. if (_status3 == '已结算') {
  413. this.$message.error('业务已完结');
  414. } else {
  415. this.smAlert = true
  416. }
  417. })
  418. },
  419. setCodeGun() {
  420. this.$refs['hiddenFocus'].focus()
  421. },
  422. focus() {
  423. console.log("当前焦点状态")
  424. this.isOpenCodeGun = true
  425. },
  426. blur() {
  427. console.log("当前已失去焦点状态")
  428. this.isOpenCodeGun = false
  429. },
  430. goToPage(type) {
  431. let _url = ''
  432. if (type === 1) {
  433. // this.toPageData
  434. this.$router.push({
  435. path: 'inspectInfo',
  436. query: {
  437. type: 3,
  438. cangid: this.cangid,
  439. id: this.toPageData.qualityInspectionManagement.id,
  440. warehouseName: this.toPageData.qualityInspectionManagement.warehouseName,
  441. count: 0,
  442. warehouseNo: 0,
  443. allowEdit:this.toPageData.warehouseBaseInfo.allowEdit,
  444. status:this.toPageData.status
  445. },
  446. })
  447. } else if (type === 2) {
  448. this.$router.push({
  449. path: 'inspectInfo',
  450. query: {
  451. type: 5,
  452. cangid: this.cangid,
  453. id: this.toPageData.qualityInspectionManagement.id,
  454. warehouseName: this.toPageData.qualityInspectionManagement.warehouseName,
  455. count: 0,
  456. warehouseNo: 0,
  457. allowEdit:this.toPageData.warehouseBaseInfo.allowEdit,
  458. status:this.toPageData.status
  459. },
  460. })
  461. } else if (type === 3) {
  462. this.$router.push({
  463. path: 'inspectInfo',
  464. query: {
  465. type: 4,
  466. cangid: this.cangid,
  467. id: this.toPageData.qualityInspectionManagement.id,
  468. warehouseName: this.toPageData.qualityInspectionManagement.warehouseName,
  469. count: 0,
  470. warehouseNo: 0,
  471. allowEdit:this.toPageData.warehouseBaseInfo.allowEdit,
  472. status:this.toPageData.status
  473. },
  474. })
  475. } else if (type === 4) {
  476. this.$router.push({
  477. path: 'weightCheck',
  478. query: {
  479. tpyeNo: 1,
  480. id: this.toPageData.id,
  481. number: this.toPageData.number,
  482. binNumber: this.toPageData.binNumber,
  483. customer: this.toPageData.customer,
  484. storageNumber: this.toPageData.storageNumber,
  485. carNumber: this.toPageData.carNumber,
  486. boxNo: this.toPageData.qualityInspectionManagement.boxNo,
  487. boxNoOther: this.toPageData.qualityInspectionManagement.boxNoOther,
  488. titleNo: this.toPageData.qualityInspectionManagement.titleNo,
  489. titleNoOther: this.toPageData.qualityInspectionManagement.titleNoOther,
  490. goodsName: this.toPageData.goodsName,
  491. grossWeight: this.toPageData.grossWeight,
  492. tare: this.toPageData.tare,
  493. netWeight: this.toPageData.netWeight,
  494. relationId: this.toPageData.relationId,
  495. warehouseId: this.cangid,
  496. monitorUrl1: this.toPageData.warehouseBaseInfo.monitorUrl1,
  497. monitorUrl2: this.toPageData.warehouseBaseInfo.monitorUrl2,
  498. allowEdit: this.toPageData.warehouseBaseInfo.allowEdit,
  499. cangid: this.cangid,
  500. warehouseName: this.toPageData.qualityInspectionManagement.warehouseName,
  501. paramType: this.toPageData.qualityInspectionManagement.paramType,
  502. customerNumberCard: this.toPageData.customerNumberCard,
  503. automaticWeightAcquisition: this.toPageData.automaticWeightAcquisition
  504. },
  505. })
  506. } else if (type === 5) {
  507. localStorage.setItem('paymentManagementReturn', false)
  508. this.$router.push({
  509. path: 'settlement',
  510. query: {
  511. type: 1,
  512. id: this.toPageData.paymentList.id,
  513. },
  514. })
  515. } else if (type === 6) {
  516. this.$router.push({
  517. path: 'weightCheck',
  518. query: {
  519. tpyeNo: 2,
  520. id: this.toPageData.id,
  521. number: this.toPageData.number,
  522. binNumber: this.toPageData.binNumber,
  523. customer: this.toPageData.customer,
  524. storageNumber: this.toPageData.storageNumber,
  525. carNumber: this.toPageData.carNumber,
  526. boxNo: this.toPageData.qualityInspectionManagement.boxNo,
  527. boxNoOther: this.toPageData.qualityInspectionManagement.boxNoOther,
  528. titleNo: this.toPageData.qualityInspectionManagement.titleNo,
  529. titleNoOther: this.toPageData.qualityInspectionManagement.titleNoOther,
  530. goodsName: this.toPageData.goodsName,
  531. grossWeight: this.toPageData.grossWeight,
  532. tare: this.toPageData.tare,
  533. netWeight: this.toPageData.netWeight,
  534. relationId: this.toPageData.relationId,
  535. warehouseId: this.cangid,
  536. monitorUrl1: this.toPageData.warehouseBaseInfo.monitorUrl1,
  537. monitorUrl2: this.toPageData.warehouseBaseInfo.monitorUrl2,
  538. allowEdit: this.toPageData.warehouseBaseInfo.allowEdit,
  539. cangid: this.cangid,
  540. warehouseName: this.toPageData.qualityInspectionManagement.warehouseName,
  541. paramType: this.toPageData.qualityInspectionManagement.paramType,
  542. customerNumberCard: this.toPageData.customerNumberCard,
  543. automaticWeightAcquisition: this.toPageData.automaticWeightAcquisition
  544. },
  545. })
  546. }
  547. this.smAlert = false
  548. },
  549. //获取当前用户管理的仓库
  550. getUserWorseHouse() {
  551. },
  552. handleScreen() {
  553. fullscreenToggel()
  554. },
  555. setCollapse() {
  556. this.$store.commit('SET_COLLAPSE')
  557. },
  558. setScreen() {
  559. this.$store.commit('SET_FULLSCREN')
  560. },
  561. cancelPaw() {
  562. this.$refs.passwordMsg.resetFields()
  563. },
  564. // 修改管理员密码
  565. savePassword(formName) {
  566. this.$refs[formName].validate((valid) => {
  567. if (valid) {
  568. const data = {
  569. originalPassword: this.passwordMsg.originalPassword,
  570. password: this.passwordMsg.password,
  571. }
  572. changePasswordByPwd(data)
  573. .toPromise()
  574. .then(() => {
  575. EventBus.$emit('success', this.$t('message.updateMessage'))
  576. this.passwordFlag = false
  577. })
  578. } else {
  579. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  580. return false
  581. }
  582. })
  583. },
  584. // async getUserInfo () {
  585. // this.staffName = this.userInfo.staffName
  586. // this.phone = this.userInfo.staffMobilePhone
  587. // this.deptName = this.userInfo.deptName
  588. // this.roleName = this.userInfo.showRoleName
  589. // this.roleId = this.userInfo.showRoleId
  590. // this.compName = this.userInfo.compName
  591. // },
  592. toggleSideBar() {
  593. this.$store.dispatch('app/toggleSideBar')
  594. },
  595. logout() {
  596. this.$confirm(this.$t('logoutTip'), this.$t('tip'), {
  597. confirmButtonText: this.$t('submitText'),
  598. cancelButtonText: this.$t('cancelText'),
  599. type: 'warning',
  600. }).then(async () => {
  601. localStorage.removeItem('ws-pf_roleName')
  602. localStorage.removeItem('ws-pf_roleId')
  603. localStorage.removeItem('ws-pf_staffName')
  604. localStorage.removeItem('ws-pf_deptId')
  605. localStorage.removeItem('ws-pf_deptName')
  606. localStorage.removeItem('ws-pf_organMonetaryKey')
  607. localStorage.removeItem('ws-pf_organMonetaryValue')
  608. localStorage.removeItem('ws-pf_vessels')
  609. localStorage.removeItem('ws-pf_isLandBasedFlag')
  610. await this.$store.dispatch('user/logout')
  611. this.$router.push(
  612. process.env.VUE_APP_PACKAGE_ENV === 'ship' ? '/ship_login' : '/login'
  613. )
  614. })
  615. },
  616. },
  617. }
  618. </script>
  619. <style lang="scss" scoped>
  620. .dayClass {
  621. font-size: 14px !important;
  622. span {
  623. font-weight: 600;
  624. font-size: 14px;
  625. color: #ff3838;
  626. }
  627. }
  628. .hamburger-container {
  629. line-height: 40px;
  630. height: 100%;
  631. float: left;
  632. cursor: pointer;
  633. transition: background 0.3s;
  634. -webkit-tap-highlight-color: transparent;
  635. &:hover {
  636. background: rgba(0, 0, 0, 0.025);
  637. }
  638. }
  639. .breadcrumb-container {
  640. float: left;
  641. position: relative;
  642. }
  643. .errLog-container {
  644. display: inline-block;
  645. vertical-align: top;
  646. }
  647. .right-menu {
  648. float: right;
  649. height: 100%;
  650. line-height: 40px;
  651. &:focus {
  652. outline: none;
  653. }
  654. .right-menu-item {
  655. display: inline-block;
  656. padding: 0 8px;
  657. height: 100%;
  658. font-size: 18px;
  659. color: #5a5e66;
  660. // vertical-align: text-bottom;
  661. &.hover-effect {
  662. cursor: pointer;
  663. transition: background 0.3s;
  664. &:hover {
  665. background: rgba(0, 0, 0, 0.025);
  666. }
  667. }
  668. }
  669. .avatar-container {
  670. margin-right: 30px;
  671. .avatar-wrapper {
  672. position: relative;
  673. span {
  674. height: 40px;
  675. line-height: 40px;
  676. font-size: 12px;
  677. }
  678. .user-avatar {
  679. cursor: pointer;
  680. width: 40px;
  681. height: 40px;
  682. border-radius: 10px;
  683. }
  684. .el-icon-caret-bottom {
  685. cursor: pointer;
  686. position: absolute;
  687. right: -20px;
  688. top: 15px;
  689. font-size: 12px;
  690. }
  691. }
  692. }
  693. }
  694. .hidden-content {
  695. display: flex;
  696. font-size: 16px;
  697. }
  698. .input-Style {
  699. opacity: 1;
  700. margin-right: 20px;
  701. // visibility: hidden;
  702. }
  703. .btn {
  704. background: #5878e8;
  705. color: white;
  706. }
  707. </style>