index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  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. <image class="quit-spn" @click.stop="loginOff()" src="../../static/logout.svg"></image>
  8. </view>
  9. <view class="rom-set">
  10. <image class="park" src="../../static/iconPark.svg"></image>
  11. <view class="houseName">
  12. <view>{{ instData.spdName }}</view>
  13. </view>
  14. </view>
  15. <view class="section-view">
  16. <view class="user-cont">
  17. <span class="user-spn">欢迎</span>
  18. <span class="user-spn spnr">{{userData.userName}}</span>
  19. </view>
  20. <view class="sec-data">
  21. <view class="sec-item">
  22. <span class="item-spn spnVal">待受理</span>
  23. <span class="item-spn">{{userType=='mcs'?instData.wslnum:instData.unAcpNum}}</span>
  24. </view>
  25. <view class="sec-item">
  26. <span class="item-spn spnVal">待出库</span>
  27. <span class="item-spn">{{userType=='mcs'?instData.wcknum:instData.unStoOutNum}}</span>
  28. </view>
  29. <view class="sec-item">
  30. <span class="item-spn spnVal">待退货</span>
  31. <span class="item-spn">{{userType=='mcs'?instData.wqrnum:instData.unRetnNum}}</span>
  32. </view>
  33. <view class="sec-item">
  34. <span class="item-spn spnVal">采购单</span>
  35. <span class="item-spn">{{userType=='mcs'?instData.cgdcx:instData.sumPurcNum}}</span>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="message-view">
  40. <view class="all-message" @click.stop="allMessage()">
  41. 全部消息 >>
  42. </view>
  43. <view>
  44. <view class="message-item" v-for="(item,index) in msData" :key="index">
  45. <view class="item-mesage" v-html="messItem(item)">
  46. </view>
  47. <view class="fot-btn" @click="jumpDetails(item)">
  48. 查看详情>>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="all-app">
  54. <view class="all-title">
  55. 全部应用
  56. </view>
  57. <view class="all-app-view">
  58. <view class="app-view-item" v-for="(item,index) in appData[userType]" :key="index">
  59. <view class="app-item-img" :style="{background: item.bgColor}" @click.stop="appView(item)">
  60. <image class="app-item-svg" :src="item.iconUrl">
  61. </image>
  62. </view>
  63. <view class="app-item-text">
  64. {{item.name}}
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. import {
  75. mapState,
  76. mapMutations,
  77. mapActions
  78. } from 'vuex';
  79. export default {
  80. components: {},
  81. computed: {
  82. ...mapState(['houseData', 'houseSelectData', 'userData', 'homeAwaitData', 'messData', 'instData']),
  83. },
  84. data() {
  85. return {
  86. listData: [],
  87. msData: [],
  88. outRoom: "请选择仓库",
  89. romDetData: {
  90. unAcpNum: '待受理',
  91. unStoOutNum: '待出库',
  92. unRetnNum: "待退货",
  93. sumPurcNum: "采购单查询"
  94. },
  95. userType: "mcs",
  96. appData: {
  97. drug: [{
  98. iconUrl: "../../static/shangjia.svg",
  99. name: "订单受理",
  100. bgColor: "#F4CE98",
  101. path: "/durgsubpkg/pages/order-taking/index"
  102. },
  103. {
  104. iconUrl: "../../static/shangjia.svg",
  105. name: "订单明细出库",
  106. bgColor: "#FFB298",
  107. path: "/subpkg/pages/outbond-detal/details"
  108. },
  109. {
  110. iconUrl: "../../static/shangjia.svg",
  111. name: "退货管理",
  112. bgColor: "#2CE4BF",
  113. path: "/durgsubpkg/pages/depart-return/index"
  114. },
  115. {
  116. iconUrl: "../../static/shangjia.svg",
  117. name: "采购单查询",
  118. bgColor: "#2CE4BF",
  119. path: "/subpkg/pages/puhse-order/index"
  120. },
  121. // {
  122. // iconUrl: "../../static/shangjia.svg",
  123. // name: "数据监测",
  124. // bgColor: "#F4CE98",
  125. // path: "/subpkg/pages/mintir/index"
  126. // },
  127. // {
  128. // iconUrl: "../../static/shangjia.svg",
  129. // name: "验收管理",
  130. // bgColor: "#2CE4BF",
  131. // path: "/subpkg/pages/acceptance/index"
  132. // },
  133. // {
  134. // iconUrl: "../../static/shangjia.svg",
  135. // name: "采购计划审批",
  136. // bgColor: "#2CE4BF",
  137. // path: "/subpkg/pages/proplanconfirm/index"
  138. // },
  139. // {
  140. // iconUrl: "../../static/shangjia.svg",
  141. // name: "目录管理",
  142. // bgColor: "#2CE4BF",
  143. // path: "/subpkg/pages/dire-manment/index"
  144. // },
  145. ],
  146. mcs: [
  147. // {
  148. // iconUrl: "../../static/shangjia.svg",
  149. // name: "订单受理",
  150. // bgColor: "#F4CE98",
  151. // path: "/subpkg/pages/mcs-order-taking/index"
  152. // },
  153. // {
  154. // iconUrl: "../../static/shangjia.svg",
  155. // name: "订单出库",
  156. // bgColor: "#7DCEFF",
  157. // path: "/subpkg/pages/order-outbond/index"
  158. // },
  159. // {
  160. // iconUrl: "../../static/shangjia.svg",
  161. // name: "退货管理",
  162. // bgColor: "#2CE4BF",
  163. // path: "/subpkg/pages/mcs-depart-return/index"
  164. // },
  165. // {
  166. // iconUrl: "../../static/shangjia.svg",
  167. // name: "采购单查询",
  168. // bgColor: "#2CE4BF",
  169. // path: "/subpkg/pages/mcs-puhse-order/index"
  170. // },
  171. // {
  172. // iconUrl: "../../static/shangjia.svg",
  173. // name: "数据监测",
  174. // bgColor: "#F4CE98",
  175. // path: "/subpkg/pages/mintir/index"
  176. // },
  177. // {
  178. // iconUrl: "../../static/shangjia.svg",
  179. // name: "验收管理",
  180. // bgColor: "#2CE4BF",
  181. // path: "/subpkg/pages/acceptance/index"
  182. // },
  183. // {
  184. // iconUrl: "../../static/shangjia.svg",
  185. // name: "采购计划审批",
  186. // bgColor: "#2CE4BF",
  187. // path: "/subpkg/pages/proplanconfirm/index"
  188. // },
  189. // {
  190. // iconUrl: "../../static/shangjia.svg",
  191. // name: "目录管理",
  192. // bgColor: "#2CE4BF",
  193. // path: "/subpkg/pages/dire-manment/index"
  194. // },
  195. ]
  196. }
  197. }
  198. },
  199. onLoad() {
  200. },
  201. onShow() {
  202. let userType = uni.getStorageSync('userType') || "mcs";
  203. this.userType = userType;
  204. },
  205. mounted() {
  206. this.setInst();
  207. this.getUserData({
  208. sysType: "2"
  209. }).then(res => {
  210. if (res && res.data) {
  211. const menus = res.data.permission.menus;
  212. const colorMap = {
  213. 'mcs-order-taking': '#F4CE98',
  214. 'order-outbond': '#7DCEFF',
  215. 'mcs-depart-return': '#2CE4BF',
  216. 'mcs-puhse-order': '#2CE4BF',
  217. 'mintir': '#F4CE98'
  218. };
  219. this.appData.mcs = menus.map(menu => ({
  220. iconUrl: "../../static/shangjia.svg",
  221. name: menu.menuName,
  222. bgColor: colorMap[menu.menuId] || '#F4CE98',
  223. path: `/subpkg/pages/${menu.menuId}/index`
  224. }));
  225. }
  226. });
  227. },
  228. watch: {
  229. messData(newOld) {
  230. }
  231. },
  232. methods: {
  233. ...mapActions(['getHouseData', 'getUserData', 'getHomeAwaitData', 'getMessData']),
  234. ...mapMutations(['setHouseName', 'setInst']),
  235. onPullDownRefresh() {
  236. this.setInst();
  237. this.getUserData({
  238. sysType: "2"
  239. });
  240. setTimeout(function() {
  241. uni.stopPullDownRefresh(); //停止下拉刷新动画
  242. }, 1000);
  243. },
  244. //跳转页面
  245. appView(item) {
  246. uni.navigateTo({
  247. url: item.path,
  248. success: function(res) {}
  249. });
  250. },
  251. //退出当前账号
  252. dialogConfirm() {
  253. uni.redirectTo({
  254. url: '/pages/login/index',
  255. success: function(res) {}
  256. });
  257. uni.removeStorageSync('token');
  258. },
  259. dialogClose() {
  260. this.$refs.message.close();
  261. },
  262. //退出确认
  263. loginOff() {
  264. uni.redirectTo({
  265. url: '/subpkg/pages/home/home',
  266. success: function(res) {}
  267. });
  268. },
  269. //跳转更多页面
  270. moreView() {
  271. uni.navigateTo({
  272. url: '/pages/grounding/grounding',
  273. success: function(res) {}
  274. });
  275. },
  276. dateChange(slectd) {
  277. this.getDataList({
  278. type: slectd[0][0].value
  279. });
  280. },
  281. // 获取数据
  282. getDataList(data) {
  283. this.getGroundData(data);
  284. },
  285. jumpDetails(item) {
  286. this.$http('home.readData', [{
  287. id: item.id,
  288. msgStas: "1"
  289. }], '加载中', true).then((res) => {
  290. if (res.success == true) {
  291. }
  292. })
  293. // this.$http(item.msgColumnList[0].url, {
  294. // [item.msgColumnList[0].msgKey]: item.msgColumnList[0].msgColumn
  295. // }, '加载中', true).then((res) => {
  296. // if (res.success == true) {
  297. // uni.setStorage({
  298. // key: item.msgColumnList[0].msgRoutePath,
  299. // data: res.data.records[0] || {}
  300. // });
  301. // uni.navigateTo({
  302. // url: `/pages/${item.msgColumnList[0].msgRoutePath}/index`,
  303. // success: function(res) {
  304. // console.log(res, "res")
  305. // }
  306. // });
  307. // }
  308. // })
  309. }
  310. }
  311. }
  312. </script>
  313. <style lang="scss" scoped>
  314. .home-wrap {
  315. width: 100%;
  316. height: 100%;
  317. background-color: #F5F5F5;
  318. .home-title {
  319. width: 100%;
  320. height: auto;
  321. .title-bac {
  322. width: 100%;
  323. height: 392rpx;
  324. border-radius: 0rpx 0rpx 40rpx 40rpx;
  325. 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%);
  326. padding: 20rpx;
  327. box-sizing: border-box;
  328. .roomt {
  329. width: 100%;
  330. height: 70rpx;
  331. display: flex;
  332. align-items: center;
  333. justify-content: space-between;
  334. .rom-spn {
  335. color: rgba(255, 255, 255, 0.9);
  336. font-size: 36rpx;
  337. text-align: left;
  338. font-family: PingFangSC-bold;
  339. }
  340. .quit-spn {
  341. width: 48rpx;
  342. height: 48rpx;
  343. background-size: 100% 100%;
  344. }
  345. }
  346. .rom-set {
  347. width: 100%;
  348. height: 50rpx;
  349. display: flex;
  350. align-items: center;
  351. .park {
  352. width: 40rpx;
  353. height: 40rpx;
  354. background-size: 100% 100%;
  355. }
  356. .houseName {
  357. color: rgba(255, 255, 255, 0.9);
  358. font-size: 36rpx;
  359. text-align: left;
  360. font-family: OPPOSans-medium;
  361. margin-left: 20rpx;
  362. .romtitle {
  363. font-size: 36rpx;
  364. font-family: OPPOSans-medium;
  365. }
  366. .c-flex-align {
  367. display: flex;
  368. align-items: center;
  369. color: #fff;
  370. }
  371. .icon-triangle {
  372. width: 16rpx;
  373. height: 16rpx;
  374. margin-left: 10rpx;
  375. }
  376. }
  377. .down {
  378. width: 40rpx;
  379. height: 40rpx;
  380. background: url('../../static/down.svg');
  381. background-size: 100% 100%;
  382. margin-left: 20rpx;
  383. }
  384. }
  385. .section-view {
  386. width: 97%;
  387. margin: 70rpx auto 40rpx auto;
  388. height: 270rpx;
  389. background-color: rgba(255, 255, 255, 1);
  390. box-shadow: -2rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.4);
  391. border-radius: 20rpx;
  392. padding: 20rpx;
  393. box-sizing: border-box;
  394. .user-cont {
  395. width: 100%;
  396. height: 50rpx;
  397. .user-spn {
  398. color: rgba(0, 0, 0, 0.8);
  399. font-size: 36rpx;
  400. font-family: AlibabaPuHui-medium;
  401. }
  402. .spnr {
  403. margin-left: 20rpx;
  404. font-size: 35rpx;
  405. font-family: AlibabaPuHui-medium;
  406. }
  407. }
  408. .sec-data {
  409. width: 100%;
  410. height: 110rpx;
  411. display: flex;
  412. justify-content: space-around;
  413. margin-top: 60rpx;
  414. .sec-item {
  415. width: 130rpx;
  416. height: 100%;
  417. display: flex;
  418. flex-direction: column;
  419. align-items: center;
  420. justify-content: space-between;
  421. .item-spn {
  422. font-size: 32rpx;
  423. font-family: PingFangSC-bold;
  424. }
  425. .spnVal {
  426. color: rgba(7, 190, 167, 1);
  427. }
  428. }
  429. }
  430. }
  431. .message-view {
  432. width: 100%;
  433. margin-top: 20rpx;
  434. position: relative;
  435. padding-top: 20rpx;
  436. margin-bottom: 20rpx;
  437. .all-message {
  438. position: absolute;
  439. right: 0rpx;
  440. top: 5rpx;
  441. width: 117rpx;
  442. height: 20rpx;
  443. color: rgba(1, 169, 146, 1);
  444. font-size: 20rpx;
  445. font-family: AlibabaPuHui-regular;
  446. display: flex;
  447. align-items: center;
  448. }
  449. .message-item {
  450. margin-top: 20rpx;
  451. width: 100%;
  452. height: 50rpx;
  453. border-radius: 25rpx;
  454. display: flex;
  455. justify-content: space-between;
  456. align-items: center;
  457. padding: 0 20rpx;
  458. box-sizing: border-box;
  459. color: rgba(0, 0, 0, 0.8);
  460. font-size: 20rpx;
  461. text-align: left;
  462. font-family: AlibabaPuHui-regular;
  463. background-color: rgba(255, 255, 255, 1);
  464. box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.4);
  465. .item-mesage {
  466. overflow: hidden;
  467. white-space: nowrap;
  468. text-overflow: ellipsis;
  469. }
  470. .fot-btn {
  471. width: 170rpx;
  472. margin-left: 20rpx;
  473. }
  474. }
  475. }
  476. .all-app {
  477. width: 100%;
  478. .all-title {
  479. width: 100%;
  480. height: 46rpx;
  481. color: rgba(0, 0, 0, 0.8);
  482. font-size: 32rpx;
  483. text-align: left;
  484. font-family: AlibabaPuHui-bold;
  485. }
  486. .all-app-view {
  487. margin-top: 20rpx;
  488. width: 100%;
  489. height: auto;
  490. background-color: #fff;
  491. border-radius: 20rpx;
  492. display: flex;
  493. flex-wrap: wrap;
  494. align-content: flex-start;
  495. padding-bottom: 50rpx;
  496. .app-view-item {
  497. width: 24%;
  498. margin-left: 7rpx;
  499. height: 150rpx;
  500. display: flex;
  501. flex-direction: column;
  502. align-items: center;
  503. margin-top: 20rpx;
  504. margin-bottom: 20rpx;
  505. justify-content: space-between;
  506. .app-item-img {
  507. width: 102rpx;
  508. height: 102rpx;
  509. border-radius: 20rpx;
  510. display: flex;
  511. align-items: center;
  512. justify-content: center;
  513. .app-item-svg {
  514. width: 80rpx;
  515. height: 80rpx;
  516. background-size: 100% 100%;
  517. }
  518. }
  519. .app-item-text {
  520. width: 100%;
  521. height: 34rpx;
  522. color: rgba(0, 0, 0, 0.8);
  523. font-size: 28rpx;
  524. text-align: center;
  525. font-family: AlibabaPuHui-bold;
  526. }
  527. }
  528. }
  529. }
  530. }
  531. }
  532. }
  533. uni-page-body {
  534. width: 100%;
  535. height: 100%;
  536. }
  537. uni-page-wrapper {
  538. width: 100%;
  539. height: 100%;
  540. }
  541. uni-page {
  542. width: 100%;
  543. height: 100%;
  544. }
  545. </style>