home.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. <template>
  2. <view class="home-wrap">
  3. <view class="home-title">
  4. <view class="title-bac">
  5. <view class="roomt">
  6. <span class="rom-spn">当前所在仓库</span>
  7. <span class="quit-spn" @click.stop="loginOff()"></span>
  8. </view>
  9. <view class="rom-set">
  10. <view class="park"></view>
  11. <view class="houseName">
  12. <picker mode="selector" @change="homeRomDate" :range="houseData" range-key='text'>
  13. <view class="date c-flex-align" :style="{ height:'100rpx'}">
  14. <view>{{ houseSelectData.houseName }}</view>
  15. <view class="down">
  16. </view>
  17. </view>
  18. </picker>
  19. </view>
  20. </view>
  21. <view class="section-view">
  22. <view class="user-cont">
  23. <span class="user-spn">欢迎</span>
  24. <span class="user-spn spnr">{{userData.userName}}</span>
  25. </view>
  26. <view class="sec-data">
  27. <view class="sec-item" v-for="(item,key,index) in homeAwaitData" :key="index">
  28. <span class="item-spn spnVal">{{item}}</span>
  29. <span class="item-spn">{{romDetData[key]}}</span>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="app-view">
  34. <view class="app-item" @click="queryData()">
  35. <view class="app-title">
  36. 耗材检索
  37. </view>
  38. <view class="app-item-mut">
  39. <view class="app-item-spn">
  40. 耗材所在位置及属性信息查询
  41. </view>
  42. <view class="app-item-img">
  43. </view>
  44. </view>
  45. </view>
  46. <view class="app-item" @click="invenyData()">
  47. <view class="app-title">
  48. 库存盘点
  49. </view>
  50. <view class="app-item-mut">
  51. <view class="app-item-spn">
  52. 多种方式盘点核对库内耗材
  53. </view>
  54. <view class="app-item-img-pan">
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="message-view">
  60. <view class="all-message" @click.stop="allMessage()">
  61. 全部消息 >>
  62. </view>
  63. <view>
  64. <view class="message-item" v-for="(item,index) in msData" :key="index">
  65. <view class="item-mesage" v-html="messItem(item)">
  66. </view>
  67. <view class="fot-btn" @click="jumpDetails(item)">
  68. 查看详情>>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. <view class="all-app">
  74. <view class="all-title">
  75. 全部应用
  76. </view>
  77. <view class="all-app-view">
  78. <view class="app-view-item" v-for="(item,index) in appData" :key="index">
  79. <view class="app-item-img" :style="{background: item.bgColor}" @click.stop="appView(item)">
  80. <image class="app-item-svg" :src="item.iconUrl">
  81. </image>
  82. </view>
  83. <view class="app-item-text">
  84. {{item.name}}
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. <uni-popup ref="message" type="dialog">
  92. <uni-popup-dialog type="warn" cancelText="取消" confirmText="确定" content="确定退出当前账号?" @confirm="dialogConfirm"
  93. @close="dialogClose"></uni-popup-dialog>
  94. </uni-popup>
  95. </view>
  96. </template>
  97. <script>
  98. import {
  99. mapState,
  100. mapMutations,
  101. mapActions
  102. } from 'vuex';
  103. export default {
  104. components: {},
  105. computed: {
  106. ...mapState(['houseData', 'houseSelectData', 'userData', 'homeAwaitData', 'messData']),
  107. },
  108. data() {
  109. return {
  110. listData: [],
  111. msData: [],
  112. outRoom: "请选择仓库",
  113. romDetData: {
  114. acpCnt: '待验收',
  115. groundCnt: '待上架',
  116. stooutCnt: "待出库",
  117. stostrCnt: "待配送"
  118. },
  119. appData: [{
  120. iconUrl: "../../static/yanshou.svg",
  121. name: "验收",
  122. bgColor: "#F4CE98",
  123. path: "/pages/acceptance/index"
  124. },
  125. {
  126. iconUrl: "../../static/shangjia.svg",
  127. name: "上架",
  128. bgColor: "#7DCEFF",
  129. path: "/pages/grounding/grounding"
  130. },
  131. {
  132. iconUrl: "../../static/peisong.svg",
  133. name: "配送",
  134. bgColor: "#FFB298",
  135. path: "/pages/delivery/index"
  136. },
  137. {
  138. iconUrl: "../../static/jianhuo.svg",
  139. name: "拣货",
  140. bgColor: "#2CE4BF",
  141. path: "/pages/outbound/outbound"
  142. },
  143. {
  144. iconUrl: "../../static/pandian.svg",
  145. name: "盘点",
  146. bgColor: "#2CE4BF",
  147. path: "/pages/Inventory/index"
  148. },
  149. {
  150. iconUrl: "../../static/jiansuo.svg",
  151. name: "检索",
  152. bgColor: "#FFB867",
  153. path: "/pages/query/query"
  154. },
  155. {
  156. iconUrl: "../../static/xiaohao.svg",
  157. name: "耗材出库",
  158. bgColor: "#94BE5B",
  159. path: "/pages/consume/consume"
  160. },
  161. {
  162. iconUrl: "../../static/gentaiq.svg",
  163. name: "跟台清台",
  164. bgColor: "#7DCEFF",
  165. path: "/pages/followplat/index"
  166. },
  167. {
  168. iconUrl: "../../static/shousb.svg",
  169. name: "手术包清台",
  170. bgColor: "#66DEC3",
  171. path: "/pages/surgical/index"
  172. },
  173. ]
  174. }
  175. },
  176. onLoad() {
  177. },
  178. mounted() {
  179. this.getHouseData();
  180. this.getUserData();
  181. this.getMessData({
  182. spdId: "SPDID",
  183. msgStas: 0
  184. }).then((res) => {
  185. if (res.data.records.length > 0) {
  186. let newData = res.data.records.splice(0, 2);
  187. this.msData = newData;
  188. }
  189. })
  190. },
  191. watch: {
  192. messData(newOld) {
  193. }
  194. },
  195. methods: {
  196. ...mapActions(['getHouseData', 'getUserData', 'getHomeAwaitData', 'getMessData']),
  197. ...mapMutations(['setHouseName']),
  198. messItem(itm) {
  199. let newMessage = itm.msgText;
  200. itm.msgColumnList.forEach((item) => {
  201. newMessage = newMessage.replace(
  202. item.msgColumnNo,
  203. `<span style='color:${
  204. item.msgColumnColor
  205. }'>【${item.msgColumn}】</span>`
  206. );
  207. });
  208. return newMessage;
  209. },
  210. //跳转页面
  211. appView(item) {
  212. uni.navigateTo({
  213. url: item.path,
  214. success: function(res) {}
  215. });
  216. },
  217. //退出当前账号
  218. dialogConfirm() {
  219. uni.redirectTo({
  220. url: '/pages/login/index',
  221. success: function(res) {}
  222. });
  223. uni.removeStorageSync('token');
  224. },
  225. //检索跳转
  226. queryData() {
  227. uni.navigateTo({
  228. url: '/pages/query/query',
  229. success: function(res) {}
  230. });
  231. },
  232. //盘点跳转
  233. invenyData() {
  234. uni.navigateTo({
  235. url: '/pages/Inventory/index',
  236. success: function(res) {}
  237. });
  238. },
  239. // 查看全部消息
  240. allMessage() {
  241. uni.navigateTo({
  242. url: '/pages/messgecont/index',
  243. success: function(res) {}
  244. });
  245. },
  246. dialogClose() {
  247. this.$refs.message.close();
  248. },
  249. //退出确认
  250. loginOff() {
  251. this.$refs.message.open();
  252. },
  253. homeRomDate(e) {
  254. let idx = e.detail.value;
  255. this.setHouseName({
  256. houseName: this.houseData[idx].text,
  257. houseId: this.houseData[idx].value
  258. })
  259. this.getHomeAwaitData({
  260. stroomId: this.houseData[idx].value
  261. })
  262. this.outRoom = this.houseData[idx].text;
  263. },
  264. onchange(e) {
  265. this.setHouseName({
  266. houseName: e.detail.value[0].text,
  267. houseId: e.detail.value[0].value
  268. })
  269. },
  270. //跳转更多页面
  271. moreView() {
  272. uni.navigateTo({
  273. url: '/pages/grounding/grounding',
  274. success: function(res) {}
  275. });
  276. },
  277. dateChange(slectd) {
  278. this.getDataList({
  279. type: slectd[0][0].value
  280. });
  281. },
  282. // 获取数据
  283. getDataList(data) {
  284. this.getGroundData(data);
  285. },
  286. jumpDetails(item) {
  287. this.$http('home.readData', [{
  288. id: item.id,
  289. msgStas: "1"
  290. }], '加载中', true).then((res) => {
  291. if (res.success == true) {
  292. }
  293. })
  294. this.$http(item.msgColumnList[0].url, {
  295. [item.msgColumnList[0].msgKey]: item.msgColumnList[0].msgColumn
  296. }, '加载中', true).then((res) => {
  297. if (res.success == true) {
  298. uni.setStorage({
  299. key: item.msgColumnList[0].msgRoutePath,
  300. data: res.data.records[0] || {}
  301. });
  302. uni.navigateTo({
  303. url: `/pages/${item.msgColumnList[0].msgRoutePath}/index`,
  304. success: function(res) {
  305. console.log(res, "res")
  306. }
  307. });
  308. }
  309. })
  310. }
  311. }
  312. }
  313. </script>
  314. <style lang="scss" scoped>
  315. .home-wrap {
  316. width: 100%;
  317. height: 100%;
  318. background-color: #F5F5F5;
  319. .home-title {
  320. width: 100%;
  321. height: auto;
  322. .title-bac {
  323. width: 100%;
  324. height: 392rpx;
  325. border-radius: 0rpx 0rpx 40rpx 40rpx;
  326. background: linear-gradient(180deg, rgba(1, 169, 146, 1) 0%, rgba(1, 176, 164, 0.54) 46%, rgba(2, 181, 176, 0.24) 100%, rgba(2, 185, 185, 0) 100%);
  327. padding: 20rpx;
  328. box-sizing: border-box;
  329. .roomt {
  330. width: 100%;
  331. height: 70rpx;
  332. display: flex;
  333. align-items: center;
  334. justify-content: space-between;
  335. .rom-spn {
  336. color: rgba(255, 255, 255, 0.9);
  337. font-size: 36rpx;
  338. text-align: left;
  339. font-family: PingFangSC-bold;
  340. }
  341. .quit-spn {
  342. width: 48rpx;
  343. height: 48rpx;
  344. background: url('../../static/logout.svg');
  345. background-size: 100% 100%;
  346. }
  347. }
  348. .rom-set {
  349. width: 100%;
  350. height: 50rpx;
  351. display: flex;
  352. align-items: center;
  353. .park {
  354. width: 40rpx;
  355. height: 40rpx;
  356. background: url('../../static/iconPark.svg');
  357. background-size: 100% 100%;
  358. }
  359. .houseName {
  360. color: rgba(255, 255, 255, 0.9);
  361. font-size: 36rpx;
  362. text-align: left;
  363. font-family: OPPOSans-medium;
  364. margin-left: 20rpx;
  365. .romtitle {
  366. font-size: 36rpx;
  367. font-family: OPPOSans-medium;
  368. }
  369. .c-flex-align {
  370. display: flex;
  371. align-items: center;
  372. color: #fff;
  373. }
  374. .icon-triangle {
  375. width: 16rpx;
  376. height: 16rpx;
  377. margin-left: 10rpx;
  378. }
  379. }
  380. .down {
  381. width: 40rpx;
  382. height: 40rpx;
  383. background: url('../../static/down.svg');
  384. background-size: 100% 100%;
  385. margin-left: 20rpx;
  386. }
  387. }
  388. .section-view {
  389. width: 97%;
  390. margin: 70rpx auto 40rpx auto;
  391. height: 270rpx;
  392. background-color: rgba(255, 255, 255, 1);
  393. box-shadow: -2rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.4);
  394. border-radius: 20rpx;
  395. padding: 20rpx;
  396. box-sizing: border-box;
  397. .user-cont {
  398. width: 100%;
  399. height: 50rpx;
  400. .user-spn {
  401. color: rgba(0, 0, 0, 0.8);
  402. font-size: 36rpx;
  403. font-family: AlibabaPuHui-medium;
  404. }
  405. .spnr {
  406. margin-left: 20rpx;
  407. font-size: 35rpx;
  408. font-family: AlibabaPuHui-medium;
  409. }
  410. }
  411. .sec-data {
  412. width: 100%;
  413. height: 110rpx;
  414. display: flex;
  415. justify-content: space-around;
  416. margin-top: 60rpx;
  417. .sec-item {
  418. width: 130rpx;
  419. height: 100%;
  420. display: flex;
  421. flex-direction: column;
  422. align-items: center;
  423. justify-content: space-between;
  424. .item-spn {
  425. font-size: 32rpx;
  426. font-family: PingFangSC-bold;
  427. }
  428. .spnVal {
  429. color: rgba(7, 190, 167, 1);
  430. }
  431. }
  432. }
  433. }
  434. .app-view {
  435. width: 100%;
  436. height: 200rpx;
  437. display: flex;
  438. justify-content: space-between;
  439. .app-item {
  440. width: 48%;
  441. height: 100%;
  442. border-radius: 16rpx;
  443. background-color: rgba(255, 255, 255, 1);
  444. border: 2rpx solid rgba(187, 187, 187, 0.5);
  445. padding: 20rpx;
  446. box-sizing: border-box;
  447. .app-title {
  448. font-size: 32rpx;
  449. font-family: SourceHanSansSC-bold;
  450. color: rgba(0, 0, 0, 1);
  451. }
  452. .app-item-mut {
  453. width: 100%;
  454. height: 120rpx;
  455. display: flex;
  456. justify-content: space-between;
  457. align-items: center;
  458. .app-item-spn {
  459. color: rgba(154, 154, 154, 0.8);
  460. font-size: 20rpx;
  461. font-family: AlibabaPuHui-medium;
  462. width: 140rpx;
  463. height: 50rpx;
  464. }
  465. .app-item-img {
  466. width: 140rpx;
  467. height: 106.68rpx;
  468. background: url('../../static/queryData.svg');
  469. background-size: 100% 100%;
  470. }
  471. .app-item-img-pan {
  472. width: 140rpx;
  473. height: 106.68rpx;
  474. background: url('../../static/jihua.svg');
  475. background-size: 100% 100%;
  476. }
  477. }
  478. }
  479. }
  480. .message-view {
  481. width: 100%;
  482. margin-top: 20rpx;
  483. position: relative;
  484. padding-top: 20rpx;
  485. margin-bottom: 20rpx;
  486. .all-message {
  487. position: absolute;
  488. right: 0rpx;
  489. top: 5rpx;
  490. width: 117rpx;
  491. height: 20rpx;
  492. color: rgba(1, 169, 146, 1);
  493. font-size: 20rpx;
  494. font-family: AlibabaPuHui-regular;
  495. display: flex;
  496. align-items: center;
  497. }
  498. .message-item {
  499. margin-top: 20rpx;
  500. width: 100%;
  501. height: 50rpx;
  502. border-radius: 25rpx;
  503. display: flex;
  504. justify-content: space-between;
  505. align-items: center;
  506. padding: 0 20rpx;
  507. box-sizing: border-box;
  508. color: rgba(0, 0, 0, 0.8);
  509. font-size: 20rpx;
  510. text-align: left;
  511. font-family: AlibabaPuHui-regular;
  512. background-color: rgba(255, 255, 255, 1);
  513. box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.4);
  514. .item-mesage {
  515. overflow: hidden;
  516. white-space: nowrap;
  517. text-overflow: ellipsis;
  518. }
  519. .fot-btn {
  520. width: 170rpx;
  521. margin-left: 20rpx;
  522. }
  523. }
  524. }
  525. .all-app {
  526. width: 100%;
  527. .all-title {
  528. width: 100%;
  529. height: 46rpx;
  530. color: rgba(0, 0, 0, 0.8);
  531. font-size: 32rpx;
  532. text-align: left;
  533. font-family: AlibabaPuHui-bold;
  534. }
  535. .all-app-view {
  536. margin-top: 20rpx;
  537. width: 100%;
  538. height: auto;
  539. background-color: #fff;
  540. border-radius: 20rpx;
  541. display: flex;
  542. flex-wrap: wrap;
  543. align-content: flex-start;
  544. padding-bottom: 50rpx;
  545. .app-view-item {
  546. width: 24%;
  547. margin-left: 7rpx;
  548. height: 150rpx;
  549. display: flex;
  550. flex-direction: column;
  551. align-items: center;
  552. margin-top: 20rpx;
  553. margin-bottom: 20rpx;
  554. justify-content: space-between;
  555. .app-item-img {
  556. width: 102rpx;
  557. height: 102rpx;
  558. border-radius: 20rpx;
  559. display: flex;
  560. align-items: center;
  561. justify-content: center;
  562. .app-item-svg {
  563. width: 80rpx;
  564. height: 80rpx;
  565. background-size: 100% 100%;
  566. }
  567. }
  568. .app-item-text {
  569. width: 100%;
  570. height: 34rpx;
  571. color: rgba(0, 0, 0, 0.8);
  572. font-size: 28rpx;
  573. text-align: center;
  574. font-family: AlibabaPuHui-bold;
  575. }
  576. }
  577. }
  578. }
  579. }
  580. }
  581. }
  582. uni-page-body {
  583. width: 100%;
  584. height: 100%;
  585. }
  586. uni-page-wrapper {
  587. width: 100%;
  588. height: 100%;
  589. }
  590. uni-page {
  591. width: 100%;
  592. height: 100%;
  593. }
  594. </style>