index.vue 32 KB

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