index.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963
  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" autocomplete="off" auto-complete="new-password"
  24. @keyup.enter.native="payCode" placeholder="扫码枪内容"></el-input>
  25. <div v-show="isOpenCodeGun" class="code-scan-text">扫码枪已连接</div>
  26. <div v-show="!isOpenCodeGun" @click="setCodeGun" class="code-scan-text">点我扫码</div>
  27. <!-- -->
  28. <el-dialog title="扫描二维码" :visible.sync="smAlert" :before-close="cancel">
  29. <div class="btn-list">
  30. <el-button v-hasPermission="`acquisitionManagement.acquisitionQuality.initial`"
  31. v-if="btnStatus.status1||btnStatus.status2" @click="goToPage(1)" class="btn_css">去初检
  32. </el-button>
  33. <el-button v-hasPermission="`acquisitionManagement.acquisitionQuality.con`"
  34. v-if="btnStatus.status3||btnStatus.status4" v-show="toPageData.qualityInspectionManagement.confirm != '1'" @click="goToPage(2)" class="btn_css">去确认质检
  35. </el-button>
  36. <el-button v-hasPermission="`acquisitionManagement.acquisitionQuality.again`"
  37. v-if="btnStatus.status1||btnStatus.status2||btnStatus.status3||btnStatus.status4" v-show="toPageData.qualityInspectionManagement.confirm != '1'" @click="goToPage(3)" class="btn_css">去复检
  38. </el-button>
  39. <el-button v-hasPermission="`acquisitionManagement.acquisitionWeight.mao`"
  40. v-if="btnStatus.status1||btnStatus.status2||btnStatus.status3" @click="goToPage(4)" class="btn_css">去称毛重
  41. </el-button>
  42. <el-button v-hasPermission="`acquisitionManagement.acquisitionPay.add`" v-if="btnStatus.status5"
  43. @click="goToPage(5)" class="btn_css">去结算</el-button>
  44. <el-button v-hasPermission="`acquisitionManagement.acquisitionWeight.weight`"
  45. v-if="btnStatus.status2||btnStatus.status3||btnStatus.status4||btnStatus.status5" @click="goToPage(6)" v-show="toPageData.qualityInspectionManagement.confirm != '1'" class="btn_css">去称皮重
  46. </el-button>
  47. <el-button @click="cancel" class="btn" >关闭</el-button>
  48. </div>
  49. </el-dialog>
  50. </div>
  51. <div class="compName-row">
  52. <!-- <span class="compName">{{compName}}</span> -->
  53. <el-select style='width:260px;' @change='compNameChange' v-model="compName" placeholder="请选择">
  54. <el-option
  55. v-for="item in compNameoptions"
  56. :key="item"
  57. :label="item"
  58. :value="item">
  59. </el-option>
  60. </el-select>
  61. </div>
  62. <div v-if="getDay" class="right-menu-item hover-effect dayClass">
  63. {{ $t('common.trialDays') }}
  64. <span style="padding: 0 2px">{{ getDay }}</span>{{ $t('common.days') }}
  65. </div>
  66. <el-tooltip v-if="showColor" effect="dark" :content="$t('navbar.color')" placement="bottom">
  67. <div class="top-bar__item">
  68. <top-color></top-color>
  69. </div>
  70. </el-tooltip>
  71. <el-tooltip v-if="showTheme" effect="dark" :hide-after="1500" :content="$t('navbar.theme')" placement="bottom">
  72. <div class="top-bar__item top-bar__item--show">
  73. <top-theme></top-theme>
  74. </div>
  75. </el-tooltip>
  76. <!-- <el-tooltip effect="dark"
  77. :content="$t('navbar.language')"
  78. placement="bottom">
  79. <div class="top-bar__item top-bar__item--show">
  80. <top-lang></top-lang>
  81. </div>
  82. </el-tooltip> -->
  83. <el-tooltip v-if="showFullScren" effect="dark" :content="
  84. isFullScren ? $t('navbar.screenfull') : $t('navbar.screenfullF')
  85. " placement="bottom">
  86. <div class="top-bar__item">
  87. <i :class="isFullScren ? 'el-icon-full-screen' : 'el-icon-full-screen'" @click="handleScreen"></i>
  88. </div>
  89. </el-tooltip>
  90. <img class="top-bar__img" v-lazy="userInfo.avatar" />
  91. <el-dropdown>
  92. <span class="el-dropdown-link">
  93. <span>{{ userInfo.showRoleName }} : {{ userInfo.staffName }}</span>
  94. <i class="el-icon-arrow-down el-icon--right"></i>
  95. </span>
  96. <el-dropdown-menu slot="dropdown">
  97. <el-dropdown-item icon="el-icon-s-custom" @click.native="personalFlag = true">
  98. {{ $t('navbar.personalInformation') }}
  99. </el-dropdown-item>
  100. <el-dropdown-item icon="el-icon-s-promotion" @click.native="passwordFlag = true">
  101. {{ $t('navbar.uploadPsw') }}
  102. </el-dropdown-item>
  103. <!-- <el-dropdown-item>
  104. <router-link to="/info/index">{{$t('navbar.userinfo')}}</router-link>
  105. </el-dropdown-item> -->
  106. <el-dropdown-item v-if="showSetting" icon="el-icon-s-tools" @click.native="settingDrawer = true">
  107. {{ $t('navbar.layoutSetting') }}
  108. </el-dropdown-item>
  109. <el-dropdown-item @click.native="logout" divided>{{
  110. $t('navbar.logOut')
  111. }}</el-dropdown-item>
  112. </el-dropdown-menu>
  113. </el-dropdown>
  114. </div>
  115. <topSetting v-model="settingDrawer" @close="() => (settingDrawer = !settingDrawer)" />
  116. <!--个人信息-->
  117. <WinseaContentModal v-model="personalFlag" :title="$t('navbar.personalInformation')">
  118. <el-form ref="personalMsg" :model="passwordMsg" label-position="right" label-width="150px">
  119. <el-form-item :label="$t('login.name')" prop="originalPassword">
  120. {{ userInfo.staffName }}
  121. </el-form-item>
  122. <el-form-item :label="$t('login.account')" prop="newPassword">
  123. {{ account }}
  124. </el-form-item>
  125. <el-form-item :label="$t('login.phone')" prop="newPassword">
  126. {{ userInfo.staffMobilePhone }}
  127. </el-form-item>
  128. <el-form-item :label="$t('login.role')" prop="newPassword">
  129. {{ userInfo.showRoleName }}
  130. </el-form-item>
  131. <el-form-item :label="$t('login.dept')" prop="newPassword">
  132. {{ userInfo.deptName }}
  133. </el-form-item>
  134. <el-form-item :label="$t('login.company')" prop="newPassword">
  135. <div class="company-info">
  136. {{ userInfo.compName }}
  137. </div>
  138. </el-form-item>
  139. </el-form>
  140. </WinseaContentModal>
  141. <!--修改密码-->
  142. <WinseaContentModal v-model="passwordFlag" :title="$t('navbar.uploadPsw')">
  143. <el-form ref="passwordMsg" :model="passwordMsg" :label-width="language == 'en' ? '156px' : '100px'"
  144. :rules="passwordMsgRules">
  145. <el-form-item :label="$t('login.originalPassword') + $t('common.colon')" prop="originalPassword">
  146. <ws-input type="password" :placeholder="$t('login.message04')" v-model="passwordMsg.originalPassword"
  147. style="width: 318px" />
  148. </el-form-item>
  149. <el-form-item :label="$t('login.newPassword') + $t('common.colon')" prop="newPassword">
  150. <ws-input type="password" v-model="passwordMsg.newPassword" :placeholder="$t('login.verification01')"
  151. style="width: 318px" />
  152. </el-form-item>
  153. <el-form-item :label="$t('login.confirmPassword') + $t('common.colon')" prop="password">
  154. <ws-input type="password" v-model="passwordMsg.password" :placeholder="$t('login.verification01')"
  155. style="width: 318px" />
  156. </el-form-item>
  157. </el-form>
  158. <span slot="footer" class="dialog-footer">
  159. <ws-button @click="passwordFlag = false">{{
  160. $t('showMessage.cancel')
  161. }}</ws-button>
  162. <ws-button type="primary" @click="savePassword('passwordMsg')">{{
  163. $t('showMessage.confirm')
  164. }}</ws-button>
  165. </span>
  166. </WinseaContentModal>
  167. </div>
  168. </template>
  169. <script>
  170. import {
  171. changePasswordByPwd,
  172. getcomp
  173. } from '@/model/indexRx'
  174. import { fastLogin, logout, login,complogin, getRoule, getCurrentUserInfo, companyInfo, isLandBased, getAccountLoginHistoryCount, updateShowInfo }
  175. from '@/model/indexRx'
  176. import Cookies from 'js-cookie'
  177. import { setToken, getCompanyId, clearStorage } from '@/utils/auth'
  178. import {
  179. mapActions,
  180. mapGetters,
  181. mapState
  182. } from 'vuex'
  183. import {
  184. fullscreenToggel,
  185. listenfullscreen
  186. } from '@/utils/util'
  187. import {
  188. getTenantInfoByUser,
  189. } from '@/model/signIn/index'
  190. import notification from '../../../notification'
  191. import topMenu from './top-menu'
  192. import topSearch from './top-search'
  193. import topTheme from './top-theme'
  194. import topColor from './top-color'
  195. import topNotice from './top-notice'
  196. import topLang from './top-lang'
  197. import topSetting from './top-setting'
  198. import breadCrumb from '@/components/Breadcrumb'
  199. import {
  200. EventBus
  201. } from 'base-core-lib'
  202. import {
  203. validPassword
  204. } from '@/utils/validate'
  205. import smallTips from '@/components/WinseaCom/smallTips'
  206. import {
  207. getLook
  208. } from '@/model/warehouse/index'
  209. import {
  210. getQRCodeData
  211. } from '@/model/houseSelfCollect/index'
  212. const validPasswordRule = function(rule, value, callback) {
  213. if (!validPassword(value)) {
  214. callback(new Error(this.$t('login.verification01')))
  215. } else {
  216. callback()
  217. }
  218. }
  219. const validPasswordRule2 = function(rule, value, callback) {
  220. if (!value) {
  221. callback(new Error(this.$t('login.verification02')))
  222. } else if (value !== this.passwordMsg.newPassword) {
  223. callback(new Error(this.$t('login.verification03')))
  224. } else {
  225. callback()
  226. }
  227. }
  228. export default {
  229. components: {
  230. topMenu,
  231. topSearch,
  232. topTheme,
  233. topColor,
  234. topNotice,
  235. topLang,
  236. topSetting,
  237. breadCrumb,
  238. smallTips,
  239. },
  240. name: 'top',
  241. data() {
  242. return {
  243. //status1:已初检未称毛重状态 status2:已初检且已称毛重状态 status3:已复检且已称毛重 status4:已复检且已称皮重状态
  244. //status5:已确认质检且已称皮重且未结算状态 status6:已结算状态
  245. btnStatus: {
  246. status1: false,
  247. status2: false,
  248. status3: false,
  249. status4: false,
  250. status5: false,
  251. status6: false,
  252. },
  253. toPageData: {},
  254. userINfo: {},
  255. barCode: '',
  256. compNameoptions:[],
  257. isOpenCodeGun: false,
  258. smAlert: false,
  259. showList: [
  260. 'maintenancePlanList',
  261. 'maintenanceReportList',
  262. 'navigationMaterialList',
  263. 'protectionEntry',
  264. 'protection',
  265. 'newlyIncreased',
  266. 'clientEdit',
  267. 'staticDetail',
  268. 'maApplicationAdd',
  269. 'maApplicationEdit',
  270. 'maApplicationLabel',
  271. 'monthContrastList',
  272. ],
  273. settingDrawer: false,
  274. personalFlag: false,
  275. passwordFlag: false,
  276. passwordMsgRules: {
  277. originalPassword: [{
  278. required: true,
  279. message: ' ',
  280. trigger: 'blur'
  281. }],
  282. // newPassword: [
  283. // {
  284. // required: true,
  285. // trigger: 'blur',
  286. // validator: validPasswordRule.bind(this),
  287. // },
  288. // ],
  289. // password: [
  290. // {
  291. // required: true,
  292. // trigger: 'blur',
  293. // validator: validPasswordRule2.bind(this),
  294. // },
  295. // ],
  296. },
  297. passwordMsg: {
  298. originalPassword: '', // 原始密码
  299. newPassword: '', // 新密码
  300. password: '', // 二次输入密码
  301. },
  302. loginForm:{},
  303. // roleName: '',
  304. // phone: '',
  305. // roleId: '',
  306. // deptName: '',
  307. // deptId: '',
  308. // staffName: '',
  309. account: localStorage.getItem('ws-pf_account'),
  310. compName: localStorage.getItem('ws-pf_compName'),
  311. companyId: localStorage.getItem('ws-pf_compId'),
  312. cangid:'',
  313. UserInfo:JSON.parse(localStorage.getItem('ws_login_getTenantInfoByUser')),
  314. tmp:{},
  315. }
  316. },
  317. filters: {},
  318. created() {
  319. // this.getUserInfo()
  320. this.getUserWorseHouse();
  321. this.userINfo = {
  322. userCompany: localStorage.getItem('ws-pf_compId'),
  323. userName: localStorage.getItem('ws-pf_staffName'),
  324. }
  325. listenfullscreen(this.setScreen)
  326. getcomp({userMobilePhone:this.UserInfo.loginInfo.userMobilePhone}).toPromise().then((res)=>{
  327. this.compNameoptions=res
  328. })
  329. },
  330. mounted() {
  331. // this.complogin({username: Cookies.get('ws_login_account'),
  332. // password: Cookies.get('ws_login_pwd'),
  333. // companyName: this.compName})
  334. // var res=this.complogin({username: Cookies.get('ws_login_account'),
  335. // password: 111111,
  336. // companyName: this.compName})
  337. // console.log(res)
  338. },
  339. computed: {
  340. ...mapState({
  341. showDebug: (state) => state.commonStore.showDebug,
  342. showTheme: (state) => state.commonStore.showTheme,
  343. showLock: (state) => state.commonStore.showLock,
  344. showFullScren: (state) => state.commonStore.showFullScren,
  345. showCollapse: (state) => state.commonStore.showCollapse,
  346. showSearch: (state) => state.commonStore.showSearch,
  347. showSetting: (state) => state.commonStore.showSetting,
  348. showMenu: (state) => state.commonStore.showMenu,
  349. showColor: (state) => state.commonStore.showColor,
  350. }),
  351. ...mapGetters([
  352. 'userInfo',
  353. 'isFullScren',
  354. 'tagWel',
  355. 'tagList',
  356. 'isCollapse',
  357. 'tag',
  358. 'logsLen',
  359. 'logsFlag',
  360. 'language',
  361. ]),
  362. getDay() {
  363. const {
  364. statusFlag = -1, daysRemaining
  365. } =
  366. JSON.parse(localStorage.getItem('ws_login_getTenantInfoByUser')) || {}
  367. return statusFlag * 1 === 2 ? daysRemaining + '' : ''
  368. },
  369. showTooltip() {
  370. return this.showList.indexOf(this.$route.name) > -1 && !this.showMenu
  371. },
  372. },
  373. methods: {
  374. ...mapActions('common', ['setLocalVessels']),
  375. ...mapActions('user', ['getUserInfo','toSetShow']),
  376. payCode() {
  377. console.log('input', this.barCode)
  378. this.btnStatus = {
  379. status1: false,
  380. status2: false,
  381. status3: false,
  382. status4: false,
  383. status5: false,
  384. status6: false,
  385. }
  386. // let _userCompId = "2710b21efc1e4393930c5dc800010dc4"
  387. // let _qualityNo = "SGRK202112140060003"
  388. let _userCompId = this.barCode.split('&')[0].toLocaleLowerCase()
  389. let _qualityNo = this.barCode.split('&')[1]
  390. let _userHouseId = this.barCode.split('&')[2].toLocaleLowerCase()
  391. this.cangid = this.barCode.split('&')[2].toLocaleLowerCase()
  392. if(_userCompId.indexOf(',') != -1){
  393. _userCompId = _userCompId.split(',')[1]
  394. }
  395. this.tmp = {
  396. compId: _userCompId,
  397. number: _qualityNo,
  398. warehouseId: _userHouseId
  399. }
  400. // this.barCode = ''
  401. //判断当前账号公司是否是二维码上公司
  402. if (this.userINfo.userCompany != _userCompId) {
  403. console.log("请切换公司在试!")
  404. this.$message.error('当前身份不可操作');
  405. this.barCode = ''
  406. return
  407. }
  408. //判断二维码上的仓库当前账号是否有权限操作
  409. this.getLook(this.cangid,localStorage.getItem('ws-pf_staffName'))
  410. },
  411. compNameChange(){
  412. // this.complogin({username:this.UserInfo.loginInfo.userMobilePhone,
  413. // password: localStorage.getItem('ws-pf_pass'),
  414. // companyName: this.compName})
  415. var userInfo={
  416. username:this.UserInfo.loginInfo.userMobilePhone,
  417. password: localStorage.getItem('ws-pf_pass'),
  418. companyName: this.compName
  419. }
  420. // var status=0
  421. const redirect = this.$route.query.redirect
  422. const { username, password, domainName, companyName } = userInfo
  423. complogin({
  424. username: username.trim(),
  425. password: password,
  426. domainName: domainName,
  427. companyName: companyName
  428. }).toPromise().then((res)=>{
  429. if(res.data.code=='AUTH_001'){
  430. Message({showClose: true,
  431. message: '公司不可切换',
  432. type: 'error'
  433. });
  434. this.compName=localStorage.getItem('ws-pf_compName')
  435. localStorage.setItem('status', 1)
  436. }else{
  437. const { compId,
  438. tenantId,
  439. vesselId,
  440. vesselBankFlag,
  441. clientFag,
  442. userId
  443. } = res.data.data
  444. // {TYPE='' MESSAGE} [第一次,失效].indexOf(type){type,msg,到期时间}
  445. // EventBus.$emit('success', '登录成功')
  446. localStorage.setItem('ws-pf_compId', compId)
  447. localStorage.setItem('status', 2)
  448. localStorage.setItem('ws-pf_userId', userId)
  449. localStorage.setItem('ws-pf_tenantId', tenantId)
  450. localStorage.setItem('ws-pf_vesselId', vesselId) // 仅适用于一条船
  451. localStorage.setItem('ws-pf_vesselBankFlag', vesselBankFlag) // 当前登录人是船端还是岸端的人员
  452. localStorage.setItem('ws-pf_clientFag', clientFag)
  453. notification.setSessionId(userId) // 设置通知唯一标识
  454. notification.start() // 开始监听通知
  455. // 查询当前租户服务类型
  456. isLandBased().toPromise().then(response => {
  457. localStorage.setItem('ws-pf_serviceTypeFlag', response)
  458. })
  459. companyInfo({ compId: compId }).toPromise().then((res1)=>{
  460. localStorage.setItem('ws-pf_organMonetaryKey', res1.organizationMonetaryKey)
  461. localStorage.setItem('ws-pf_compName', res1.compName)
  462. localStorage.setItem('ws-pf_compDomainName', res1.compDomainName)
  463. localStorage.setItem('ws-pf_organMonetaryValue', res1.organizationMonetaryValue)
  464. this.getUserInfo({ vesselBankFlag, compName:res1.compName })
  465. })
  466. this.toSetShow( userId)
  467. setToken('Admin-Token')
  468. localStorage.setItem('ws_login_type', 2)
  469. Cookies.set('ws_login_companyShortName', companyName, {
  470. expires: 365,
  471. })
  472. Cookies.set('ws_login_account', username, {
  473. expires: 365,
  474. })
  475. console.log(username, password, domainName, companyName)
  476. var rememberMe = Cookies.get('ws_login_rememberMe') === '1'
  477. if (rememberMe) {
  478. Cookies.set('ws_login_pwd', password, {
  479. expires: 365,
  480. })
  481. Cookies.set('ws_login_rememberMe', 1, {
  482. expires: 365
  483. })
  484. } else {
  485. Cookies.remove('ws_login_companyShortName')
  486. Cookies.remove('ws_login_account')
  487. Cookies.remove('ws_login_pwd')
  488. Cookies.set('ws_login_rememberMe', 0, {
  489. expires: 365
  490. })
  491. }
  492. console.log(redirect)
  493. if (redirect) {
  494. this.$router.push(redirect)
  495. } else {
  496. this.$router.push('/')
  497. }
  498. let newList = {
  499. companyName: companyName,
  500. username: username,
  501. password: password,
  502. }
  503. getTenantInfoByUser(newList).toPromise().then((res2)=>{
  504. console.log(res2)
  505. localStorage.setItem(
  506. 'ws_login_getTenantInfoByUser',
  507. JSON.stringify({
  508. ...res2,
  509. loginInfo: res.data.data
  510. }))
  511. var that=this
  512. setTimeout(function(){
  513. that.$router.go(0)
  514. },1000)
  515. })
  516. localStorage.setItem(
  517. 'ws_login_accountId',
  518. JSON.stringify(res.data.data.accountId)
  519. )
  520. }
  521. })
  522. console.log(localStorage.getItem('status'))
  523. // } else {
  524. // this.$message.error("您输入的用户名或密码错误!")
  525. // return false
  526. // }
  527. },
  528. cancel(){
  529. this.barCode = ''
  530. this.smAlert = false
  531. },
  532. // 查看二维码仓库负责人
  533. async getLook(compId, userName) {
  534. await getLook({
  535. id: compId,
  536. })
  537. .toPromise()
  538. .then((response) => {
  539. if (response.otherPersonCharge.indexOf(userName) != -1 || response.personCharge == userName) {
  540. //扫码枪扫码后显示弹框
  541. this.getQRCodeData(this.tmp)
  542. }else{
  543. console.log("你没有该权限,不可操作")
  544. this.$message.error('当前身份不可操作');
  545. this.barCode = ''
  546. return
  547. }
  548. })
  549. },
  550. // 二维码获取数据
  551. async getQRCodeData(tmp) {
  552. await getQRCodeData(tmp)
  553. .toPromise()
  554. .then((response) => {
  555. this.toPageData = response
  556. // 处理按钮显示状态
  557. // this.btnStatus
  558. // 检斤状态
  559. let _status1 = response.status
  560. //质检状态
  561. let _status2 = response.qualityInspectionManagement.status
  562. // 付款状态
  563. let _status3 = response.paymentManagement?response.paymentManagement.status:''
  564. if (_status2 == '已初检' && _status1 == '已质检') {
  565. this.btnStatus.status1 = true
  566. } else if (_status2 == '已初检' && (_status1 == '已称毛重' || _status1 == '已质检')) {
  567. this.btnStatus.status2 = true
  568. } else if (_status2 == '已复检' && (_status1 == '已称毛重' || _status1 == '已质检')) {
  569. this.btnStatus.status3 = true
  570. } else if (_status2 == '已复检' && this.toPageData.qualityInspectionManagement.confirm != '1' && (_status1 == '已称皮重' || _status1 == '已质检')) {
  571. this.btnStatus.status4 = true
  572. } else if (_status2 == '已复检' && _status1 == '已称皮重' && _status3 == '待结算') {
  573. this.btnStatus.status5 = true
  574. } else if (_status3 == '已结算') {
  575. this.btnStatus.status6 = true
  576. }
  577. if (_status3 == '已结算') {
  578. this.$message.error('业务已完结');
  579. } else {
  580. this.smAlert = true
  581. }
  582. })
  583. },
  584. setCodeGun() {
  585. this.$refs['hiddenFocus'].focus()
  586. },
  587. focus(e) {
  588. setTimeout(() => {
  589. e.target.removeAttribute('readonly');
  590. }, 300)
  591. console.log('当前焦点状态')
  592. this.barCode = ''
  593. this.isOpenCodeGun = true
  594. },
  595. blur(e) {
  596. e.target.setAttribute("readonly", 'true');
  597. console.log('当前已失去焦点状态')
  598. this.isOpenCodeGun = false
  599. },
  600. goToPage(type) {
  601. this.barCode = ''
  602. let _url = ''
  603. if (type === 1) {
  604. // this.toPageData
  605. this.$router.push({
  606. name: 'inspectInfo',
  607. query: {
  608. type: 3,
  609. cangid: this.cangid,
  610. id: this.toPageData.qualityInspectionManagement.id,
  611. warehouseName: this.toPageData.qualityInspectionManagement.warehouseName,
  612. count: 0,
  613. warehouseNo: 0,
  614. allowEdit:this.toPageData.warehouseBaseInfo.allowEdit,
  615. status:this.toPageData.status
  616. },
  617. })
  618. } else if (type === 2) {
  619. this.$router.push({
  620. name: 'inspectInfo',
  621. query: {
  622. type: 5,
  623. cangid: this.cangid,
  624. id: this.toPageData.qualityInspectionManagement.id,
  625. warehouseName: this.toPageData.qualityInspectionManagement.warehouseName,
  626. count: 0,
  627. warehouseNo: 0,
  628. allowEdit:this.toPageData.warehouseBaseInfo.allowEdit,
  629. status:this.toPageData.status
  630. },
  631. })
  632. } else if (type === 3) {
  633. this.$router.push({
  634. name: 'inspectInfo',
  635. query: {
  636. type: 4,
  637. cangid: this.cangid,
  638. id: this.toPageData.qualityInspectionManagement.id,
  639. warehouseName: this.toPageData.qualityInspectionManagement.warehouseName,
  640. count: 0,
  641. warehouseNo: 0,
  642. allowEdit:this.toPageData.warehouseBaseInfo.allowEdit,
  643. status:this.toPageData.status
  644. },
  645. })
  646. } else if (type === 4) {
  647. this.$router.push({
  648. name: 'weightCheck',
  649. query: {
  650. tpyeNo: 1,
  651. id: this.toPageData.id,
  652. number: this.toPageData.number,
  653. binNumber: this.toPageData.binNumber,
  654. customer: this.toPageData.customer,
  655. storageNumber: this.toPageData.storageNumber,
  656. carNumber: this.toPageData.carNumber,
  657. boxNo: this.toPageData.qualityInspectionManagement.boxNo,
  658. boxNoOther: this.toPageData.qualityInspectionManagement.boxNoOther,
  659. titleNo: this.toPageData.qualityInspectionManagement.titleNo,
  660. titleNoOther: this.toPageData.qualityInspectionManagement.titleNoOther,
  661. goodsName: this.toPageData.goodsName,
  662. grossWeight: this.toPageData.grossWeight,
  663. tare: this.toPageData.tare,
  664. netWeight: this.toPageData.netWeight,
  665. relationId: this.toPageData.relationId,
  666. warehouseId: this.cangid,
  667. monitorUrl1: this.toPageData.warehouseBaseInfo.monitorUrl1,
  668. monitorUrl2: this.toPageData.warehouseBaseInfo.monitorUrl2,
  669. allowEdit: this.toPageData.warehouseBaseInfo.allowEdit,
  670. cangid: this.cangid,
  671. warehouseName: this.toPageData.qualityInspectionManagement.warehouseName,
  672. paramType: this.toPageData.qualityInspectionManagement.paramType,
  673. customerNumberCard: this.toPageData.customerNumberCard,
  674. automaticWeightAcquisition: this.toPageData.automaticWeightAcquisition
  675. },
  676. })
  677. } else if (type === 5) {
  678. localStorage.setItem('paymentManagementReturn', false)
  679. this.$router.push({
  680. name: 'settlement',
  681. query: {
  682. type: 1,
  683. id: this.toPageData.paymentManagement.id,
  684. },
  685. })
  686. } else if (type === 6) {
  687. this.$router.push({
  688. name: 'weightCheck',
  689. query: {
  690. tpyeNo: 2,
  691. id: this.toPageData.id,
  692. number: this.toPageData.number,
  693. binNumber: this.toPageData.binNumber,
  694. customer: this.toPageData.customer,
  695. storageNumber: this.toPageData.storageNumber,
  696. carNumber: this.toPageData.carNumber,
  697. boxNo: this.toPageData.qualityInspectionManagement.boxNo,
  698. boxNoOther: this.toPageData.qualityInspectionManagement.boxNoOther,
  699. titleNo: this.toPageData.qualityInspectionManagement.titleNo,
  700. titleNoOther: this.toPageData.qualityInspectionManagement.titleNoOther,
  701. goodsName: this.toPageData.goodsName,
  702. grossWeight: this.toPageData.grossWeight,
  703. tare: this.toPageData.tare,
  704. netWeight: this.toPageData.netWeight,
  705. relationId: this.toPageData.relationId,
  706. warehouseId: this.cangid,
  707. monitorUrl1: this.toPageData.warehouseBaseInfo.monitorUrl1,
  708. monitorUrl2: this.toPageData.warehouseBaseInfo.monitorUrl2,
  709. allowEdit: this.toPageData.warehouseBaseInfo.allowEdit,
  710. cangid: this.cangid,
  711. warehouseName: this.toPageData.qualityInspectionManagement.warehouseName,
  712. paramType: this.toPageData.qualityInspectionManagement.paramType,
  713. customerNumberCard: this.toPageData.customerNumberCard,
  714. automaticWeightAcquisition: this.toPageData.automaticWeightAcquisition
  715. },
  716. })
  717. }
  718. this.smAlert = false
  719. },
  720. //获取当前用户管理的仓库
  721. getUserWorseHouse() {
  722. },
  723. handleScreen() {
  724. fullscreenToggel()
  725. },
  726. setCollapse() {
  727. this.$store.commit('SET_COLLAPSE')
  728. },
  729. setScreen() {
  730. this.$store.commit('SET_FULLSCREN')
  731. },
  732. cancelPaw() {
  733. this.$refs.passwordMsg.resetFields()
  734. },
  735. // 修改管理员密码
  736. savePassword(formName) {
  737. this.$refs[formName].validate((valid) => {
  738. if (valid) {
  739. const data = {
  740. originalPassword: this.passwordMsg.originalPassword,
  741. password: this.passwordMsg.password,
  742. }
  743. changePasswordByPwd(data)
  744. .toPromise()
  745. .then(async() => {
  746. EventBus.$emit('success', this.$t('message.updateMessage'))
  747. this.passwordFlag = false
  748. localStorage.removeItem('ws-pf_roleName')
  749. localStorage.removeItem('ws-pf_roleId')
  750. localStorage.removeItem('ws-pf_staffName')
  751. localStorage.removeItem('ws-pf_deptId')
  752. localStorage.removeItem('ws-pf_deptName')
  753. localStorage.removeItem('ws-pf_organMonetaryKey')
  754. localStorage.removeItem('ws-pf_organMonetaryValue')
  755. localStorage.removeItem('ws-pf_vessels')
  756. localStorage.removeItem('ws-pf_isLandBasedFlag')
  757. await this.$store.dispatch('user/logout')
  758. this.$router.push(
  759. process.env.VUE_APP_PACKAGE_ENV === 'ship' ? '/ship_login' : '/login'
  760. )
  761. })
  762. } else {
  763. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  764. return false
  765. }
  766. })
  767. },
  768. // async getUserInfo () {
  769. // this.staffName = this.userInfo.staffName
  770. // this.phone = this.userInfo.staffMobilePhone
  771. // this.deptName = this.userInfo.deptName
  772. // this.roleName = this.userInfo.showRoleName
  773. // this.roleId = this.userInfo.showRoleId
  774. // this.compName = this.userInfo.compName
  775. // },
  776. toggleSideBar() {
  777. this.$store.dispatch('app/toggleSideBar')
  778. },
  779. logout() {
  780. this.$confirm(this.$t('logoutTip'), this.$t('tip'), {
  781. confirmButtonText: this.$t('submitText'),
  782. cancelButtonText: this.$t('cancelText'),
  783. type: 'warning',
  784. }).then(async () => {
  785. localStorage.removeItem('ws-pf_roleName')
  786. localStorage.removeItem('ws-pf_roleId')
  787. localStorage.removeItem('ws-pf_staffName')
  788. localStorage.removeItem('ws-pf_deptId')
  789. localStorage.removeItem('ws-pf_deptName')
  790. localStorage.removeItem('ws-pf_organMonetaryKey')
  791. localStorage.removeItem('ws-pf_organMonetaryValue')
  792. localStorage.removeItem('ws-pf_vessels')
  793. localStorage.removeItem('ws-pf_isLandBasedFlag')
  794. await this.$store.dispatch('user/logout')
  795. this.$router.push(
  796. process.env.VUE_APP_PACKAGE_ENV === 'ship' ? '/ship_login' : '/login'
  797. )
  798. })
  799. },
  800. },
  801. }
  802. </script>
  803. <style lang="scss" scoped>
  804. .dayClass {
  805. font-size: 14px !important;
  806. span {
  807. font-weight: 600;
  808. font-size: 14px;
  809. color: #ff3838;
  810. }
  811. }
  812. .hamburger-container {
  813. line-height: 40px;
  814. height: 100%;
  815. float: left;
  816. cursor: pointer;
  817. transition: background 0.3s;
  818. -webkit-tap-highlight-color: transparent;
  819. &:hover {
  820. background: rgba(0, 0, 0, 0.025);
  821. }
  822. }
  823. .breadcrumb-container {
  824. float: left;
  825. position: relative;
  826. }
  827. .errLog-container {
  828. display: inline-block;
  829. vertical-align: top;
  830. }
  831. .right-menu {
  832. float: right;
  833. height: 100%;
  834. line-height: 40px;
  835. &:focus {
  836. outline: none;
  837. }
  838. .right-menu-item {
  839. display: inline-block;
  840. padding: 0 8px;
  841. height: 100%;
  842. font-size: 18px;
  843. color: #5a5e66;
  844. // vertical-align: text-bottom;
  845. &.hover-effect {
  846. cursor: pointer;
  847. transition: background 0.3s;
  848. &:hover {
  849. background: rgba(0, 0, 0, 0.025);
  850. }
  851. }
  852. }
  853. .avatar-container {
  854. margin-right: 30px;
  855. .avatar-wrapper {
  856. position: relative;
  857. span {
  858. height: 40px;
  859. line-height: 40px;
  860. font-size: 12px;
  861. }
  862. .user-avatar {
  863. cursor: pointer;
  864. width: 40px;
  865. height: 40px;
  866. border-radius: 10px;
  867. }
  868. .el-icon-caret-bottom {
  869. cursor: pointer;
  870. position: absolute;
  871. right: -20px;
  872. top: 15px;
  873. font-size: 12px;
  874. }
  875. }
  876. }
  877. }
  878. .hidden-content {
  879. display: flex;
  880. font-size: 16px;
  881. margin-right: 20px;
  882. align-items: center;
  883. }
  884. .input-Style {
  885. opacity: 1;
  886. margin-right: 20px;
  887. // visibility: hidden;
  888. }
  889. .btn {
  890. background: #5878e8;
  891. color: white;
  892. }
  893. .btn-list{
  894. display: flex;
  895. flex-direction: column;
  896. justify-content: center;
  897. align-items: center;
  898. }
  899. .btn_css ,.btn{
  900. width: 80%;
  901. margin: 20px;
  902. height: auto;
  903. padding: 20px!important;
  904. font-size: 40px;
  905. }
  906. .compName{
  907. font-size: 16px;
  908. }
  909. .compName-row{
  910. // background: red;
  911. display: flex;
  912. height: 100%;
  913. }
  914. .code-scan-text{
  915. height: 30px;
  916. line-height: 30px;
  917. background: #EFF7FD;
  918. border-radius: 20px;
  919. color:#5473E8 ;
  920. border: 1px solid #5473E8;
  921. padding: 0 15px;
  922. }
  923. </style>