index.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937
  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"
  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="请选择" filterable clearable>
  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. },
  326. mounted() {
  327. listenfullscreen(this.setScreen)
  328. getcomp({userMobilePhone:this.UserInfo.loginInfo.userMobilePhone}).toPromise().then((res)=>{
  329. this.compNameoptions=res
  330. })
  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]
  389. let _qualityNo = this.barCode.split('&')[1]
  390. let _userHouseId = this.barCode.split('&')[2]
  391. this.cangid = this.barCode.split('&')[2]
  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. this.$message.error('当前身份不可操作');
  404. this.barCode = ''
  405. return
  406. }
  407. //判断二维码上的仓库当前账号是否有权限操作
  408. this.getLook(this.cangid, this.userINfo.userName)
  409. },
  410. compNameChange(){
  411. // this.complogin({username:this.UserInfo.loginInfo.userMobilePhone,
  412. // password: localStorage.getItem('ws-pf_pass'),
  413. // companyName: this.compName})
  414. var userInfo={
  415. username:this.UserInfo.loginInfo.userMobilePhone,
  416. password: localStorage.getItem('ws-pf_pass'),
  417. companyName: this.compName
  418. }
  419. // var status=0
  420. const redirect = this.$route.query.redirect
  421. const { username, password, domainName, companyName } = userInfo
  422. complogin({
  423. username: username.trim(),
  424. password: password,
  425. domainName: domainName,
  426. companyName: companyName
  427. }).toPromise().then((res)=>{
  428. if(res.data.code=='AUTH_001'){
  429. Message({showClose: true,
  430. message: '公司不可切换',
  431. type: 'error'
  432. });
  433. this.compName=localStorage.getItem('ws-pf_compName')
  434. localStorage.setItem('status', 1)
  435. }else{
  436. const { compId,
  437. tenantId,
  438. vesselId,
  439. vesselBankFlag,
  440. clientFag,
  441. userId
  442. } = res.data.data
  443. // {TYPE='' MESSAGE} [第一次,失效].indexOf(type){type,msg,到期时间}
  444. // EventBus.$emit('success', '登录成功')
  445. localStorage.setItem('ws-pf_compId', compId)
  446. localStorage.setItem('status', 2)
  447. localStorage.setItem('ws-pf_userId', userId)
  448. localStorage.setItem('ws-pf_tenantId', tenantId)
  449. localStorage.setItem('ws-pf_vesselId', vesselId) // 仅适用于一条船
  450. localStorage.setItem('ws-pf_vesselBankFlag', vesselBankFlag) // 当前登录人是船端还是岸端的人员
  451. localStorage.setItem('ws-pf_clientFag', clientFag)
  452. notification.setSessionId(userId) // 设置通知唯一标识
  453. notification.start() // 开始监听通知
  454. // 查询当前租户服务类型
  455. isLandBased().toPromise().then(response => {
  456. localStorage.setItem('ws-pf_serviceTypeFlag', response)
  457. })
  458. companyInfo({ compId: compId }).toPromise().then((res1)=>{
  459. localStorage.setItem('ws-pf_organMonetaryKey', res1.organizationMonetaryKey)
  460. localStorage.setItem('ws-pf_compName', res1.compName)
  461. localStorage.setItem('ws-pf_compDomainName', res1.compDomainName)
  462. localStorage.setItem('ws-pf_organMonetaryValue', res1.organizationMonetaryValue)
  463. this.getUserInfo({ vesselBankFlag, compName:res1.compName })
  464. })
  465. this.toSetShow( userId)
  466. setToken('Admin-Token')
  467. localStorage.setItem('ws_login_type', 2)
  468. Cookies.set('ws_login_companyShortName', companyName, {
  469. expires: 365,
  470. })
  471. Cookies.set('ws_login_account', username, {
  472. expires: 365,
  473. })
  474. console.log(username, password, domainName, companyName)
  475. var rememberMe = Cookies.get('ws_login_rememberMe') === '1'
  476. if (rememberMe) {
  477. Cookies.set('ws_login_pwd', password, {
  478. expires: 365,
  479. })
  480. Cookies.set('ws_login_rememberMe', 1, {
  481. expires: 365
  482. })
  483. } else {
  484. Cookies.remove('ws_login_companyShortName')
  485. Cookies.remove('ws_login_account')
  486. Cookies.remove('ws_login_pwd')
  487. Cookies.set('ws_login_rememberMe', 0, {
  488. expires: 365
  489. })
  490. }
  491. console.log(redirect)
  492. if (redirect) {
  493. this.$router.push(redirect)
  494. } else {
  495. this.$router.push('/')
  496. }
  497. let newList = {
  498. companyName: companyName,
  499. username: username,
  500. password: password,
  501. }
  502. getTenantInfoByUser(newList).toPromise().then((res2)=>{
  503. console.log(res2)
  504. localStorage.setItem(
  505. 'ws_login_getTenantInfoByUser',
  506. JSON.stringify({
  507. ...res2,
  508. loginInfo: res.data.data
  509. }))
  510. this.$router.go(0)
  511. })
  512. localStorage.setItem(
  513. 'ws_login_accountId',
  514. JSON.stringify(res.data.data.accountId)
  515. )
  516. }
  517. })
  518. console.log(localStorage.getItem('status'))
  519. // } else {
  520. // this.$message.error("您输入的用户名或密码错误!")
  521. // return false
  522. // }
  523. },
  524. cancel(){
  525. this.barCode = ''
  526. this.smAlert = false
  527. },
  528. // 查看二维码仓库负责人
  529. async getLook(compId, userName) {
  530. await getLook({
  531. id: compId,
  532. })
  533. .toPromise()
  534. .then((response) => {
  535. if (response.otherPersonCharge.indexOf(userName) != -1 || response.personCharge == userName) {
  536. //扫码枪扫码后显示弹框
  537. this.getQRCodeData(this.tmp)
  538. }else{
  539. this.$message.error('当前身份不可操作');
  540. this.barCode = ''
  541. return
  542. }
  543. })
  544. },
  545. // 二维码获取数据
  546. async getQRCodeData(tmp) {
  547. await getQRCodeData(tmp)
  548. .toPromise()
  549. .then((response) => {
  550. this.toPageData = response
  551. // 处理按钮显示状态
  552. // this.btnStatus
  553. // 检斤状态
  554. let _status1 = response.status
  555. //质检状态
  556. let _status2 = response.qualityInspectionManagement.status
  557. // 付款状态
  558. let _status3 = response.paymentManagement?response.paymentManagement.status:''
  559. if (_status2 == '已初检' && _status1 == '已质检') {
  560. this.btnStatus.status1 = true
  561. } else if (_status2 == '已初检' && (_status1 == '已称毛重' || _status1 == '已质检')) {
  562. this.btnStatus.status2 = true
  563. } else if (_status2 == '已复检' && (_status1 == '已称毛重' || _status1 == '已质检')) {
  564. this.btnStatus.status3 = true
  565. } else if (_status2 == '已复检' && this.toPageData.qualityInspectionManagement.confirm != '1' && (_status1 == '已称皮重' || _status1 == '已质检')) {
  566. this.btnStatus.status4 = true
  567. } else if (_status2 == '已复检' && _status1 == '已称皮重' && _status3 == '待结算') {
  568. this.btnStatus.status5 = true
  569. } else if (_status3 == '已结算') {
  570. this.btnStatus.status6 = true
  571. }
  572. if (_status3 == '已结算') {
  573. this.$message.error('业务已完结');
  574. } else {
  575. this.smAlert = true
  576. }
  577. })
  578. },
  579. setCodeGun() {
  580. this.$refs['hiddenFocus'].focus()
  581. },
  582. focus() {
  583. console.log('当前焦点状态')
  584. this.barCode = ''
  585. this.isOpenCodeGun = true
  586. },
  587. blur() {
  588. console.log('当前已失去焦点状态')
  589. this.isOpenCodeGun = false
  590. },
  591. goToPage(type) {
  592. this.barCode = ''
  593. let _url = ''
  594. if (type === 1) {
  595. // this.toPageData
  596. this.$router.push({
  597. name: 'inspectInfo',
  598. query: {
  599. type: 3,
  600. cangid: this.cangid,
  601. id: this.toPageData.qualityInspectionManagement.id,
  602. warehouseName: this.toPageData.qualityInspectionManagement.warehouseName,
  603. count: 0,
  604. warehouseNo: 0,
  605. allowEdit:this.toPageData.warehouseBaseInfo.allowEdit,
  606. status:this.toPageData.status
  607. },
  608. })
  609. } else if (type === 2) {
  610. this.$router.push({
  611. name: 'inspectInfo',
  612. query: {
  613. type: 5,
  614. cangid: this.cangid,
  615. id: this.toPageData.qualityInspectionManagement.id,
  616. warehouseName: this.toPageData.qualityInspectionManagement.warehouseName,
  617. count: 0,
  618. warehouseNo: 0,
  619. allowEdit:this.toPageData.warehouseBaseInfo.allowEdit,
  620. status:this.toPageData.status
  621. },
  622. })
  623. } else if (type === 3) {
  624. this.$router.push({
  625. name: 'inspectInfo',
  626. query: {
  627. type: 4,
  628. cangid: this.cangid,
  629. id: this.toPageData.qualityInspectionManagement.id,
  630. warehouseName: this.toPageData.qualityInspectionManagement.warehouseName,
  631. count: 0,
  632. warehouseNo: 0,
  633. allowEdit:this.toPageData.warehouseBaseInfo.allowEdit,
  634. status:this.toPageData.status
  635. },
  636. })
  637. } else if (type === 4) {
  638. this.$router.push({
  639. name: 'weightCheck',
  640. query: {
  641. tpyeNo: 1,
  642. id: this.toPageData.id,
  643. number: this.toPageData.number,
  644. binNumber: this.toPageData.binNumber,
  645. customer: this.toPageData.customer,
  646. storageNumber: this.toPageData.storageNumber,
  647. carNumber: this.toPageData.carNumber,
  648. boxNo: this.toPageData.qualityInspectionManagement.boxNo,
  649. boxNoOther: this.toPageData.qualityInspectionManagement.boxNoOther,
  650. titleNo: this.toPageData.qualityInspectionManagement.titleNo,
  651. titleNoOther: this.toPageData.qualityInspectionManagement.titleNoOther,
  652. goodsName: this.toPageData.goodsName,
  653. grossWeight: this.toPageData.grossWeight,
  654. tare: this.toPageData.tare,
  655. netWeight: this.toPageData.netWeight,
  656. relationId: this.toPageData.relationId,
  657. warehouseId: this.cangid,
  658. monitorUrl1: this.toPageData.warehouseBaseInfo.monitorUrl1,
  659. monitorUrl2: this.toPageData.warehouseBaseInfo.monitorUrl2,
  660. allowEdit: this.toPageData.warehouseBaseInfo.allowEdit,
  661. cangid: this.cangid,
  662. warehouseName: this.toPageData.qualityInspectionManagement.warehouseName,
  663. paramType: this.toPageData.qualityInspectionManagement.paramType,
  664. customerNumberCard: this.toPageData.customerNumberCard,
  665. automaticWeightAcquisition: this.toPageData.automaticWeightAcquisition
  666. },
  667. })
  668. } else if (type === 5) {
  669. localStorage.setItem('paymentManagementReturn', false)
  670. this.$router.push({
  671. name: 'settlement',
  672. query: {
  673. type: 1,
  674. id: this.toPageData.paymentManagement.id,
  675. },
  676. })
  677. } else if (type === 6) {
  678. this.$router.push({
  679. name: 'weightCheck',
  680. query: {
  681. tpyeNo: 2,
  682. id: this.toPageData.id,
  683. number: this.toPageData.number,
  684. binNumber: this.toPageData.binNumber,
  685. customer: this.toPageData.customer,
  686. storageNumber: this.toPageData.storageNumber,
  687. carNumber: this.toPageData.carNumber,
  688. boxNo: this.toPageData.qualityInspectionManagement.boxNo,
  689. boxNoOther: this.toPageData.qualityInspectionManagement.boxNoOther,
  690. titleNo: this.toPageData.qualityInspectionManagement.titleNo,
  691. titleNoOther: this.toPageData.qualityInspectionManagement.titleNoOther,
  692. goodsName: this.toPageData.goodsName,
  693. grossWeight: this.toPageData.grossWeight,
  694. tare: this.toPageData.tare,
  695. netWeight: this.toPageData.netWeight,
  696. relationId: this.toPageData.relationId,
  697. warehouseId: this.cangid,
  698. monitorUrl1: this.toPageData.warehouseBaseInfo.monitorUrl1,
  699. monitorUrl2: this.toPageData.warehouseBaseInfo.monitorUrl2,
  700. allowEdit: this.toPageData.warehouseBaseInfo.allowEdit,
  701. cangid: this.cangid,
  702. warehouseName: this.toPageData.qualityInspectionManagement.warehouseName,
  703. paramType: this.toPageData.qualityInspectionManagement.paramType,
  704. customerNumberCard: this.toPageData.customerNumberCard,
  705. automaticWeightAcquisition: this.toPageData.automaticWeightAcquisition
  706. },
  707. })
  708. }
  709. this.smAlert = false
  710. },
  711. //获取当前用户管理的仓库
  712. getUserWorseHouse() {
  713. },
  714. handleScreen() {
  715. fullscreenToggel()
  716. },
  717. setCollapse() {
  718. this.$store.commit('SET_COLLAPSE')
  719. },
  720. setScreen() {
  721. this.$store.commit('SET_FULLSCREN')
  722. },
  723. cancelPaw() {
  724. this.$refs.passwordMsg.resetFields()
  725. },
  726. // 修改管理员密码
  727. savePassword(formName) {
  728. this.$refs[formName].validate((valid) => {
  729. if (valid) {
  730. const data = {
  731. originalPassword: this.passwordMsg.originalPassword,
  732. password: this.passwordMsg.password,
  733. }
  734. changePasswordByPwd(data)
  735. .toPromise()
  736. .then(() => {
  737. EventBus.$emit('success', this.$t('message.updateMessage'))
  738. this.passwordFlag = false
  739. })
  740. } else {
  741. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  742. return false
  743. }
  744. })
  745. },
  746. // async getUserInfo () {
  747. // this.staffName = this.userInfo.staffName
  748. // this.phone = this.userInfo.staffMobilePhone
  749. // this.deptName = this.userInfo.deptName
  750. // this.roleName = this.userInfo.showRoleName
  751. // this.roleId = this.userInfo.showRoleId
  752. // this.compName = this.userInfo.compName
  753. // },
  754. toggleSideBar() {
  755. this.$store.dispatch('app/toggleSideBar')
  756. },
  757. logout() {
  758. this.$confirm(this.$t('logoutTip'), this.$t('tip'), {
  759. confirmButtonText: this.$t('submitText'),
  760. cancelButtonText: this.$t('cancelText'),
  761. type: 'warning',
  762. }).then(async () => {
  763. localStorage.removeItem('ws-pf_roleName')
  764. localStorage.removeItem('ws-pf_roleId')
  765. localStorage.removeItem('ws-pf_staffName')
  766. localStorage.removeItem('ws-pf_deptId')
  767. localStorage.removeItem('ws-pf_deptName')
  768. localStorage.removeItem('ws-pf_organMonetaryKey')
  769. localStorage.removeItem('ws-pf_organMonetaryValue')
  770. localStorage.removeItem('ws-pf_vessels')
  771. localStorage.removeItem('ws-pf_isLandBasedFlag')
  772. await this.$store.dispatch('user/logout')
  773. this.$router.push(
  774. process.env.VUE_APP_PACKAGE_ENV === 'ship' ? '/ship_login' : '/login'
  775. )
  776. })
  777. },
  778. },
  779. }
  780. </script>
  781. <style lang="scss" scoped>
  782. .dayClass {
  783. font-size: 14px !important;
  784. span {
  785. font-weight: 600;
  786. font-size: 14px;
  787. color: #ff3838;
  788. }
  789. }
  790. .hamburger-container {
  791. line-height: 40px;
  792. height: 100%;
  793. float: left;
  794. cursor: pointer;
  795. transition: background 0.3s;
  796. -webkit-tap-highlight-color: transparent;
  797. &:hover {
  798. background: rgba(0, 0, 0, 0.025);
  799. }
  800. }
  801. .breadcrumb-container {
  802. float: left;
  803. position: relative;
  804. }
  805. .errLog-container {
  806. display: inline-block;
  807. vertical-align: top;
  808. }
  809. .right-menu {
  810. float: right;
  811. height: 100%;
  812. line-height: 40px;
  813. &:focus {
  814. outline: none;
  815. }
  816. .right-menu-item {
  817. display: inline-block;
  818. padding: 0 8px;
  819. height: 100%;
  820. font-size: 18px;
  821. color: #5a5e66;
  822. // vertical-align: text-bottom;
  823. &.hover-effect {
  824. cursor: pointer;
  825. transition: background 0.3s;
  826. &:hover {
  827. background: rgba(0, 0, 0, 0.025);
  828. }
  829. }
  830. }
  831. .avatar-container {
  832. margin-right: 30px;
  833. .avatar-wrapper {
  834. position: relative;
  835. span {
  836. height: 40px;
  837. line-height: 40px;
  838. font-size: 12px;
  839. }
  840. .user-avatar {
  841. cursor: pointer;
  842. width: 40px;
  843. height: 40px;
  844. border-radius: 10px;
  845. }
  846. .el-icon-caret-bottom {
  847. cursor: pointer;
  848. position: absolute;
  849. right: -20px;
  850. top: 15px;
  851. font-size: 12px;
  852. }
  853. }
  854. }
  855. }
  856. .hidden-content {
  857. display: flex;
  858. font-size: 16px;
  859. margin-right: 20px;
  860. align-items: center;
  861. }
  862. .input-Style {
  863. opacity: 0;
  864. margin-right: 20px;
  865. // visibility: hidden;
  866. }
  867. .btn {
  868. background: #5878e8;
  869. color: white;
  870. }
  871. .btn-list{
  872. display: flex;
  873. flex-direction: column;
  874. justify-content: center;
  875. align-items: center;
  876. }
  877. .btn_css ,.btn{
  878. width: 80%;
  879. margin: 20px;
  880. height: auto;
  881. padding: 20px!important;
  882. font-size: 40px;
  883. }
  884. .compName{
  885. font-size: 16px;
  886. }
  887. .compName-row{
  888. // background: red;
  889. display: flex;
  890. height: 100%;
  891. }
  892. .code-scan-text{
  893. height: 30px;
  894. line-height: 30px;
  895. background: #EFF7FD;
  896. border-radius: 20px;
  897. color:#5473E8 ;
  898. border: 1px solid #5473E8;
  899. padding: 0 15px;
  900. }
  901. </style>