index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  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. iconUrl: "../../static/shangjia.svg",
  148. name: "订单受理",
  149. bgColor: "#F4CE98",
  150. path: "/subpkg/pages/mcs-order-taking/index"
  151. },
  152. {
  153. iconUrl: "../../static/shangjia.svg",
  154. name: "订单出库",
  155. bgColor: "#7DCEFF",
  156. path: "/subpkg/pages/order-outbond/index"
  157. },
  158. {
  159. iconUrl: "../../static/shangjia.svg",
  160. name: "退货管理",
  161. bgColor: "#2CE4BF",
  162. path: "/subpkg/pages/mcs-depart-return/index"
  163. },
  164. {
  165. iconUrl: "../../static/shangjia.svg",
  166. name: "采购单查询",
  167. bgColor: "#2CE4BF",
  168. path: "/subpkg/pages/mcs-puhse-order/index"
  169. },
  170. {
  171. iconUrl: "../../static/shangjia.svg",
  172. name: "数据监测",
  173. bgColor: "#F4CE98",
  174. path: "/subpkg/pages/mintir/index"
  175. },
  176. // {
  177. // iconUrl: "../../static/shangjia.svg",
  178. // name: "验收管理",
  179. // bgColor: "#2CE4BF",
  180. // path: "/subpkg/pages/acceptance/index"
  181. // },
  182. // {
  183. // iconUrl: "../../static/shangjia.svg",
  184. // name: "采购计划审批",
  185. // bgColor: "#2CE4BF",
  186. // path: "/subpkg/pages/proplanconfirm/index"
  187. // },
  188. // {
  189. // iconUrl: "../../static/shangjia.svg",
  190. // name: "目录管理",
  191. // bgColor: "#2CE4BF",
  192. // path: "/subpkg/pages/dire-manment/index"
  193. // },
  194. ]
  195. }
  196. }
  197. },
  198. onLoad() {
  199. },
  200. onShow() {
  201. let userType = uni.getStorageSync('userType') || "mcs";
  202. this.userType = userType;
  203. },
  204. mounted() {
  205. this.setInst();
  206. this.getUserData({
  207. sysType: "2"
  208. });
  209. },
  210. watch: {
  211. messData(newOld) {
  212. }
  213. },
  214. methods: {
  215. ...mapActions(['getHouseData', 'getUserData', 'getHomeAwaitData', 'getMessData']),
  216. ...mapMutations(['setHouseName', 'setInst']),
  217. onPullDownRefresh() {
  218. this.setInst();
  219. this.getUserData({
  220. sysType: "2"
  221. });
  222. setTimeout(function() {
  223. uni.stopPullDownRefresh(); //停止下拉刷新动画
  224. }, 1000);
  225. },
  226. //跳转页面
  227. appView(item) {
  228. uni.navigateTo({
  229. url: item.path,
  230. success: function(res) {}
  231. });
  232. },
  233. //退出当前账号
  234. dialogConfirm() {
  235. uni.redirectTo({
  236. url: '/pages/login/index',
  237. success: function(res) {}
  238. });
  239. uni.removeStorageSync('token');
  240. },
  241. dialogClose() {
  242. this.$refs.message.close();
  243. },
  244. //退出确认
  245. loginOff() {
  246. uni.redirectTo({
  247. url: '/subpkg/pages/home/home',
  248. success: function(res) {}
  249. });
  250. },
  251. //跳转更多页面
  252. moreView() {
  253. uni.navigateTo({
  254. url: '/pages/grounding/grounding',
  255. success: function(res) {}
  256. });
  257. },
  258. dateChange(slectd) {
  259. this.getDataList({
  260. type: slectd[0][0].value
  261. });
  262. },
  263. // 获取数据
  264. getDataList(data) {
  265. this.getGroundData(data);
  266. },
  267. jumpDetails(item) {
  268. this.$http('home.readData', [{
  269. id: item.id,
  270. msgStas: "1"
  271. }], '加载中', true).then((res) => {
  272. if (res.success == true) {
  273. }
  274. })
  275. // this.$http(item.msgColumnList[0].url, {
  276. // [item.msgColumnList[0].msgKey]: item.msgColumnList[0].msgColumn
  277. // }, '加载中', true).then((res) => {
  278. // if (res.success == true) {
  279. // uni.setStorage({
  280. // key: item.msgColumnList[0].msgRoutePath,
  281. // data: res.data.records[0] || {}
  282. // });
  283. // uni.navigateTo({
  284. // url: `/pages/${item.msgColumnList[0].msgRoutePath}/index`,
  285. // success: function(res) {
  286. // console.log(res, "res")
  287. // }
  288. // });
  289. // }
  290. // })
  291. }
  292. }
  293. }
  294. </script>
  295. <style lang="scss" scoped>
  296. .home-wrap {
  297. width: 100%;
  298. height: 100%;
  299. background-color: #F5F5F5;
  300. .home-title {
  301. width: 100%;
  302. height: auto;
  303. .title-bac {
  304. width: 100%;
  305. height: 392rpx;
  306. border-radius: 0rpx 0rpx 40rpx 40rpx;
  307. 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%);
  308. padding: 20rpx;
  309. box-sizing: border-box;
  310. .roomt {
  311. width: 100%;
  312. height: 70rpx;
  313. display: flex;
  314. align-items: center;
  315. justify-content: space-between;
  316. .rom-spn {
  317. color: rgba(255, 255, 255, 0.9);
  318. font-size: 36rpx;
  319. text-align: left;
  320. font-family: PingFangSC-bold;
  321. }
  322. .quit-spn {
  323. width: 48rpx;
  324. height: 48rpx;
  325. background-size: 100% 100%;
  326. }
  327. }
  328. .rom-set {
  329. width: 100%;
  330. height: 50rpx;
  331. display: flex;
  332. align-items: center;
  333. .park {
  334. width: 40rpx;
  335. height: 40rpx;
  336. background-size: 100% 100%;
  337. }
  338. .houseName {
  339. color: rgba(255, 255, 255, 0.9);
  340. font-size: 36rpx;
  341. text-align: left;
  342. font-family: OPPOSans-medium;
  343. margin-left: 20rpx;
  344. .romtitle {
  345. font-size: 36rpx;
  346. font-family: OPPOSans-medium;
  347. }
  348. .c-flex-align {
  349. display: flex;
  350. align-items: center;
  351. color: #fff;
  352. }
  353. .icon-triangle {
  354. width: 16rpx;
  355. height: 16rpx;
  356. margin-left: 10rpx;
  357. }
  358. }
  359. .down {
  360. width: 40rpx;
  361. height: 40rpx;
  362. background: url('../../static/down.svg');
  363. background-size: 100% 100%;
  364. margin-left: 20rpx;
  365. }
  366. }
  367. .section-view {
  368. width: 97%;
  369. margin: 70rpx auto 40rpx auto;
  370. height: 270rpx;
  371. background-color: rgba(255, 255, 255, 1);
  372. box-shadow: -2rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.4);
  373. border-radius: 20rpx;
  374. padding: 20rpx;
  375. box-sizing: border-box;
  376. .user-cont {
  377. width: 100%;
  378. height: 50rpx;
  379. .user-spn {
  380. color: rgba(0, 0, 0, 0.8);
  381. font-size: 36rpx;
  382. font-family: AlibabaPuHui-medium;
  383. }
  384. .spnr {
  385. margin-left: 20rpx;
  386. font-size: 35rpx;
  387. font-family: AlibabaPuHui-medium;
  388. }
  389. }
  390. .sec-data {
  391. width: 100%;
  392. height: 110rpx;
  393. display: flex;
  394. justify-content: space-around;
  395. margin-top: 60rpx;
  396. .sec-item {
  397. width: 130rpx;
  398. height: 100%;
  399. display: flex;
  400. flex-direction: column;
  401. align-items: center;
  402. justify-content: space-between;
  403. .item-spn {
  404. font-size: 32rpx;
  405. font-family: PingFangSC-bold;
  406. }
  407. .spnVal {
  408. color: rgba(7, 190, 167, 1);
  409. }
  410. }
  411. }
  412. }
  413. .message-view {
  414. width: 100%;
  415. margin-top: 20rpx;
  416. position: relative;
  417. padding-top: 20rpx;
  418. margin-bottom: 20rpx;
  419. .all-message {
  420. position: absolute;
  421. right: 0rpx;
  422. top: 5rpx;
  423. width: 117rpx;
  424. height: 20rpx;
  425. color: rgba(1, 169, 146, 1);
  426. font-size: 20rpx;
  427. font-family: AlibabaPuHui-regular;
  428. display: flex;
  429. align-items: center;
  430. }
  431. .message-item {
  432. margin-top: 20rpx;
  433. width: 100%;
  434. height: 50rpx;
  435. border-radius: 25rpx;
  436. display: flex;
  437. justify-content: space-between;
  438. align-items: center;
  439. padding: 0 20rpx;
  440. box-sizing: border-box;
  441. color: rgba(0, 0, 0, 0.8);
  442. font-size: 20rpx;
  443. text-align: left;
  444. font-family: AlibabaPuHui-regular;
  445. background-color: rgba(255, 255, 255, 1);
  446. box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.4);
  447. .item-mesage {
  448. overflow: hidden;
  449. white-space: nowrap;
  450. text-overflow: ellipsis;
  451. }
  452. .fot-btn {
  453. width: 170rpx;
  454. margin-left: 20rpx;
  455. }
  456. }
  457. }
  458. .all-app {
  459. width: 100%;
  460. .all-title {
  461. width: 100%;
  462. height: 46rpx;
  463. color: rgba(0, 0, 0, 0.8);
  464. font-size: 32rpx;
  465. text-align: left;
  466. font-family: AlibabaPuHui-bold;
  467. }
  468. .all-app-view {
  469. margin-top: 20rpx;
  470. width: 100%;
  471. height: auto;
  472. background-color: #fff;
  473. border-radius: 20rpx;
  474. display: flex;
  475. flex-wrap: wrap;
  476. align-content: flex-start;
  477. padding-bottom: 50rpx;
  478. .app-view-item {
  479. width: 24%;
  480. margin-left: 7rpx;
  481. height: 150rpx;
  482. display: flex;
  483. flex-direction: column;
  484. align-items: center;
  485. margin-top: 20rpx;
  486. margin-bottom: 20rpx;
  487. justify-content: space-between;
  488. .app-item-img {
  489. width: 102rpx;
  490. height: 102rpx;
  491. border-radius: 20rpx;
  492. display: flex;
  493. align-items: center;
  494. justify-content: center;
  495. .app-item-svg {
  496. width: 80rpx;
  497. height: 80rpx;
  498. background-size: 100% 100%;
  499. }
  500. }
  501. .app-item-text {
  502. width: 100%;
  503. height: 34rpx;
  504. color: rgba(0, 0, 0, 0.8);
  505. font-size: 28rpx;
  506. text-align: center;
  507. font-family: AlibabaPuHui-bold;
  508. }
  509. }
  510. }
  511. }
  512. }
  513. }
  514. }
  515. uni-page-body {
  516. width: 100%;
  517. height: 100%;
  518. }
  519. uni-page-wrapper {
  520. width: 100%;
  521. height: 100%;
  522. }
  523. uni-page {
  524. width: 100%;
  525. height: 100%;
  526. }
  527. </style>