workbench.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. <template>
  2. <div class="app-main app-content">
  3. <!-- 用户信息 -->
  4. <div class="user-wrap">
  5. <div class="user-top">
  6. <div class="app-size-28">今日概况</div>
  7. </div>
  8. <div class="income-amount">
  9. <div>收入金额</div>
  10. <div class="price">{{ $util.numberFormat(data.todayData.income) }}</div>
  11. </div>
  12. <div class="user-bottom">
  13. <navigator url="/admin/home/order" open-type="switchTab" class="info-list">
  14. <div class="info-list-name">开单</div>
  15. <div class="info-list-value">
  16. {{ $util.numberFormat(data.todayData.order) || 0 }}
  17. </div>
  18. </navigator>
  19. <navigator class="info-list" url="/admin/custom/visit">
  20. <div class="info-list-name">访客</div>
  21. <div class="info-list-value">
  22. {{ $util.numberFormat(data.todayData.visitCustom) || 0 }}
  23. </div>
  24. </navigator>
  25. <navigator url="/pagesStore/me/incomeExpenses" class="info-list">
  26. <div class="info-list-name">支出</div>
  27. <div class="info-list-value">
  28. {{ $util.numberFormat(data.todayData.expend) || 0 }}
  29. </div>
  30. </navigator>
  31. </div>
  32. </div>
  33. <!-- 消息 -->
  34. <div class="module-com news-wrap">
  35. <div
  36. class="news-list"
  37. v-for="(item, index) in data.notice"
  38. :key="index"
  39. @click="pageToFn(item)"
  40. >
  41. <div class="news-left">
  42. <i class="iconfont iconxiaoxi2"></i>
  43. <span>{{ item.title }}</span>
  44. </div>
  45. <div class="news-right">
  46. <span>{{item.action}}</span>
  47. <i class="iconfont iconxiangyou"></i>
  48. </div>
  49. </div>
  50. </div>
  51. <!-- 客户按钮 -->
  52. <view class="module-com">
  53. <view class="tabs-head_bx">
  54. <image @click="skKd()" :src="skSrc" mode="widthFix"></image>
  55. <image @click="pageTo({ url: '/admin/custom/selectCustom',query: {style:1}})" :src="pfSrc" mode="widthFix" ></image>
  56. </view>
  57. <view v-if="showBook == 1" style="text-align:center;position:relative;" @click="pageTo({ url: '/admin/book/index'})">
  58. <view @click.stop="closeBook" style="position:absolute;right:38rpx;top:8rpx;"><image style="width:38rpx;" :src="`${constant.imgUrl}/book/close1.png`" mode="widthFix"></image></view>
  59. <image style="border:4rpx solid #DDDDDD;margin:0 auto;width:695rpx;border-radius:15rpx;" :src="`${constant.imgUrl}/book/book3.png`" mode="widthFix"></image>
  60. </view>
  61. <div class="tabs-wrap">
  62. <div class="tabs-list" v-for="(item, index) in tabsData" :key="index">
  63. <div @click="goPage(item)">
  64. <div class="tabs-img">
  65. <img :src="`${constant.imgUrl}/${item.img}`" alt mode="widthFix" />
  66. </div>
  67. <div class="tabs-name">{{ item.name }}</div>
  68. </div>
  69. </div>
  70. </div>
  71. </view>
  72. <!-- 总览 -->
  73. <div class="module-com total-wrap">
  74. <div class="total-tit">总览</div>
  75. <div class="total-blo">
  76. <div class="total-list" v-for="(item, index) in totalData" :key="index" @click="pageTo(item)">
  77. <div class="list-num">{{ $util.numberFormat(item.value) }}</div>
  78. <div class="app-color-3">{{ item.name }}</div>
  79. </div>
  80. </div>
  81. </div>
  82. <!-- <fab-module /> -->
  83. <!-- 续费遮罩层 -->
  84. <modal-module
  85. :show="renewMask"
  86. :custom="true"
  87. :maskClosable="true"
  88. padding="30rpx 30rpx"
  89. >
  90. <template>
  91. <div class="renew-wrap">
  92. <div class="renew-wrap-text">你的账号已到期</div>
  93. <button class="admin-button-com middle" @click="renewFn()">
  94. 立即续费
  95. </button>
  96. </div>
  97. </template>
  98. </modal-module>
  99. <none-hd :show="AUTHORITY_SHOW" :title="MODEL_TITLE" :btnText="MODEL_BTN_TEXT" @bthClick="toFreeApply_HOME" :authShow="EXPER_AUTH_SHOW" @comfirm="experienceFun"></none-hd>
  100. </div>
  101. </template>
  102. <script>
  103. import { mapGetters, mapState } from "vuex";
  104. import FabModule from "@/components/plugin/fab";
  105. import AppAvatarModule from "@/components/module/app-avatar";
  106. import ModalModule from "@/components/plugin/modal";
  107. import { getDataTimestamp } from "@/utils/common";
  108. import { getUser } from "@/utils/auth";
  109. import { consoleIndex } from "@/api/workbench";
  110. import { closeBook } from "@/api/book";
  111. import noneHd from "@/components/none-hd";
  112. export default {
  113. name: "admin-workbench",
  114. components: {
  115. ModalModule,
  116. FabModule,
  117. AppAvatarModule,
  118. noneHd
  119. },
  120. data() {
  121. return {
  122. constant: this.$constant,
  123. renewMask: false,
  124. getappIdList: {},
  125. skCustomId:0,
  126. showBook:0,
  127. data: {
  128. admin: {},
  129. asset: {},
  130. notice: {},
  131. todayData: {
  132. income:0.00,
  133. order:0,
  134. custom:0,
  135. expend:0.00
  136. }
  137. },
  138. orderData: [
  139. {
  140. name: "待付款",
  141. url: "/admin/home/order",
  142. type: 4,
  143. query: {
  144. tabIndex: 1
  145. },
  146. value: 0
  147. },
  148. {
  149. name: "待配送",
  150. value: 0,
  151. url: "/admin/home/order",
  152. type: 4,
  153. query: {
  154. tabIndex: 2
  155. }
  156. },
  157. {
  158. name: "配送中",
  159. value: 0,
  160. url: "/admin/home/order",
  161. type: 4,
  162. query: {
  163. tabIndex: 3
  164. }
  165. }
  166. ],
  167. tabsData: [
  168. {
  169. name: "商城",
  170. img: 'ghs/home/shop.png',
  171. url: "/admin/home/mall"
  172. },
  173. {
  174. name: "改价",
  175. img: 'ghs/home/gj.png',
  176. url: "/admin/changePrice/list"
  177. },
  178. {
  179. name: "供应商",
  180. img: 'ghs/home/icon_ghs.png',
  181. url: "/pagesPurchase/supplier"
  182. },
  183. {
  184. name: "报损单",
  185. img: 'ghs/home/kcyjs.png',
  186. url: "/admin/breakage/list"
  187. },
  188. {
  189. name: "库存预警",
  190. img: 'ghs/home/kcyjs.png',
  191. url: "/pagesStorehouse/stockWarn/manage"
  192. },
  193. {
  194. name: "花材",
  195. img: 'ghs/home/hcgl.png',
  196. url: "/admin/item/list"
  197. },
  198. {
  199. name: "调拨出库",
  200. img: 'ghs/home/dbck.png',
  201. url: "/pagesStorehouse/allot/allotEx"
  202. },
  203. {
  204. name: "调拨入库",
  205. img: 'ghs/home/dbrk.png',
  206. url: "/pagesStorehouse/allot/allotPut"
  207. }
  208. ],
  209. totalData: [
  210. {
  211. name: "客户数",
  212. value: 0,
  213. url:'/admin/home/member',
  214. type:4
  215. },
  216. {
  217. name: "总访客",
  218. value: 0,
  219. url:'/admin/custom/visit',
  220. type:1,
  221. },
  222. {
  223. name: "总订单",
  224. value: 0,
  225. url:'/admin/home/order',
  226. type:4
  227. },
  228. {
  229. name: "总收入(元)",
  230. value: 0.00,
  231. url:'/pagesStore/me/incomeExpenses',
  232. type:1
  233. },
  234. {
  235. name: "总支出(元)",
  236. value: 0.00,
  237. url:'/pagesStore/me/incomeExpenses',
  238. type:1
  239. },
  240. {
  241. name: "总采购(元)",
  242. value: 0.00,
  243. url:'/admin/statistics/cgStat',
  244. type:1
  245. }
  246. ],
  247. skSrc: `${this.$constant.imgUrl}/ghs/home/sk.jpg`,
  248. pfSrc: `${this.$constant.imgUrl}/ghs/home/pf.jpg`
  249. };
  250. },
  251. onShareAppMessage(res) {
  252. if (res.target.id === "shareStore") {
  253. return {
  254. title: "商城分享",
  255. desc: "",
  256. imgUrl: "",
  257. path: `/admin/billing/customerPlace?shopId=${this.loginInfo.shopId}`
  258. };
  259. } else if (res.target.id === "sharePay") {
  260. return {
  261. title: "分享收款",
  262. desc: "",
  263. imgUrl: "",
  264. path: "pagesShare/pay"
  265. };
  266. }
  267. },
  268. computed: {
  269. ...mapGetters({ userInfo: "getUser" }),
  270. ...mapGetters({ loginInfo: "getLoginInfo" }),
  271. ...mapGetters({ myShopInfo: "getMyShopInfo" }),
  272. },
  273. onLoad(option) {
  274. },
  275. onPullDownRefresh() {
  276. this.init();
  277. uni.stopPullDownRefresh();
  278. },
  279. onShow() {
  280. },
  281. methods: {
  282. closeBook(){
  283. let that = this
  284. uni.showModal({
  285. title: "确定关闭?",
  286. content: "关闭后可以在底部菜单【我的】-【新人手册】重新打开",
  287. success: function (res) {
  288. if (res.confirm) {
  289. that.showBook = 0
  290. closeBook().then((res) => {});
  291. }
  292. },
  293. })
  294. },
  295. skKd(){
  296. if((this.myShopInfo.skCustomId && this.myShopInfo.skCustomId > 0) || this.skCustomId > 0){
  297. let currentId = 0;
  298. if(this.skCustomId > 0){
  299. currentId = this.skCustomId
  300. }else{
  301. currentId = this.myShopInfo.skCustomId
  302. }
  303. this.$util.pageTo({url: '/admin/billing/index',query: {customId: currentId,customName:'散客开单'}})
  304. }else{
  305. let that = this
  306. uni.showModal({
  307. title: '提示',
  308. content: '请设置散客开单门店',
  309. cancelText: "取消",
  310. confirmText: "好的",
  311. success: function (res) {
  312. if (res.confirm) {
  313. that.$util.pageTo({url: '/admin/shop/sk'})
  314. }
  315. }
  316. });
  317. }
  318. },
  319. init() {
  320. getUser().then(res => {
  321. console.log('resres',res,res.name)
  322. uni.setNavigationBarTitle({
  323. title: res.name
  324. });
  325. let nowTime = getDataTimestamp(new Date(), true);
  326. if (nowTime > res.setDeadline) {
  327. this.renewMask = true;
  328. }
  329. });
  330. consoleIndex().then(res => {
  331. this.data = res.data;
  332. const { asset, todayData,menu,showBook } = res.data;
  333. this.showBook = showBook
  334. this.tabsData = menu
  335. if (!this.$util.isEmpty(asset)) {
  336. // 订单总览
  337. this.orderData[0].value = asset.unPayOrder;
  338. this.orderData[1].value = asset.unSendOrder;
  339. this.orderData[2].value = asset.sendingOrder;
  340. // 总览数据
  341. this.totalData[0].value = asset.totalUser;
  342. this.totalData[1].value = asset.totalVisit;
  343. this.totalData[2].value = asset.finishOrder;
  344. this.totalData[3].value = asset.totalIncome;
  345. this.totalData[4].value = asset.totalExpend;
  346. this.totalData[5].value = asset.totalPurchase;
  347. }
  348. });
  349. },
  350. goPage (item) {
  351. this.$util.pageTo(item)
  352. },
  353. // 跳转
  354. pageToFn(item) {
  355. this.$util.pageTo({url: item.page})
  356. },
  357. // 续费
  358. renewFn() {
  359. this.$util.pageTo({url: "/pagesClient/official/index",query: {pay: 1},type: 2})
  360. },
  361. getMyMall(){
  362. console.log('pagesPurchase/ghsProduct?shopId='+ this.loginInfo.shopId+'&id=0&ghsShopAdminId='+this.loginInfo.shopAdminId)
  363. uni.navigateToMiniProgram({
  364. //姜枫-2021.04.13
  365. appId: this.getappIdList.hd.miniAppId,
  366. path: 'pagesPurchase/ghsProduct?shopId='+ this.loginInfo.shopId+'&id=0&ghsShopAdminId='+this.loginInfo.shopAdminId,
  367. //develop 开发版 trial 体验版 release 正式版
  368. envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
  369. extraData: {
  370. 'shopId': this.loginInfo.shopId,
  371. 'id': 0,
  372. 'name': '假数据',
  373. },
  374. success(res) {
  375. // 打开成功
  376. }
  377. })
  378. },
  379. }
  380. };
  381. </script>
  382. <style lang="scss" scoped>
  383. .app-content {
  384. padding-bottom: 10px;
  385. }
  386. .module-com {
  387. margin-bottom: 20px;
  388. background-color: #fff;
  389. }
  390. // 用户信息
  391. .user-wrap {
  392. padding: 20px 30px 34px 30px;
  393. color: #fff;
  394. text-align: center;
  395. background-image: url("../../static/images/admin/bg.png");
  396. background-size: 100% 380px;
  397. background-repeat: no-repeat;
  398. .user-top {
  399. @include disFlex(center, space-between);
  400. .open-bt_bx {
  401. display: flex;
  402. align-items: center;
  403. line-height: 1upx;
  404. & > button {
  405. padding:0;
  406. line-height: auto;
  407. background-color: transparent;
  408. border: 1px solid #ffffff;
  409. border-radius: 22px;
  410. padding: 10upx 17upx!important;
  411. font-size: 24px;
  412. font-family: PingFang SC;
  413. font-weight: 400;
  414. color: #ffffff;
  415. & > .iconfont {
  416. font-size: 25px;
  417. padding-right: 10px;
  418. margin-top: -3px;
  419. }
  420. }
  421. }
  422. }
  423. .income-amount {
  424. margin-top: 36px;
  425. margin-bottom: 37px;
  426. .price {
  427. font-size: 50px;
  428. font-weight: bold;
  429. margin-top: 4px;
  430. }
  431. }
  432. .user-bottom {
  433. @include disFlex(center, space-around);
  434. .info-list-name {
  435. color: #bfd4ff;
  436. }
  437. .info-list-value {
  438. font-size: 36px;
  439. font-weight: bold;
  440. margin-top: 4px;
  441. }
  442. }
  443. }
  444. // 消息
  445. .news-wrap {
  446. .news-list {
  447. @include disFlex(center, space-between);
  448. padding: 30px 24px 30px 30px;
  449. border-bottom: 1px solid $borderColor;
  450. font-size: 26px;
  451. color: $fontColor2;
  452. &:active {
  453. background-color: $backColor;
  454. }
  455. & > div {
  456. @include disFlex(center, flex-start);
  457. }
  458. .news-left {
  459. .iconfont {
  460. color: $mainColor;
  461. margin-right: 10px;
  462. font-size:30rpx;
  463. }
  464. }
  465. .news-right {
  466. font-size: 24px;
  467. color: $mainColor;
  468. transform: scale(0.9);
  469. @include disFlex(flex-end, flex-start);
  470. .iconfont {
  471. font-size: 24px;
  472. margin-left: 10px;
  473. }
  474. }
  475. }
  476. }
  477. // 总览
  478. .total-wrap,
  479. .order-wrap {
  480. .total-tit {
  481. padding: 18px 0 18px 20px;
  482. border-bottom: 1px solid $borderColor;
  483. font-weight: 600;
  484. font-size: 24px;
  485. color: #333333;
  486. }
  487. .total-blo {
  488. @include disFlex(center, space-between);
  489. flex-wrap: wrap;
  490. padding: 30px 0 40px;
  491. .total-list {
  492. width: 33%;
  493. text-align: center;
  494. margin: 20px 0px;
  495. border-right: 1px solid $borderColor;
  496. .list-num {
  497. margin-bottom: 8px;
  498. font-size: 36px;
  499. font-weight: bold;
  500. }
  501. }
  502. .total-list:nth-child(3n) {
  503. border-right: none;
  504. }
  505. .total-list:nth-child(n + 4) {
  506. padding-bottom: 0;
  507. }
  508. }
  509. }
  510. .tabs-head_bx {
  511. display: flex;
  512. align-items: center;
  513. padding: 20px 15px 10px 15px;
  514. }
  515. // tabs
  516. .tabs-wrap {
  517. padding: 20px 10px;
  518. @include disFlex(center, flex-start);
  519. flex-wrap: wrap;
  520. .tabs-list {
  521. width: 25%;
  522. margin-top: 50px;
  523. text-align: center;
  524. .tabs-img {
  525. width: 100px;
  526. height: 100px;
  527. margin: 0 auto;
  528. img {
  529. height: 100%;
  530. }
  531. }
  532. .tabs-name {
  533. color: $fontColor2;
  534. margin-top: 10px;
  535. }
  536. &:nth-child(-n + 4) {
  537. margin-top: 0;
  538. }
  539. }
  540. }
  541. // 遮罩层
  542. .renew-wrap {
  543. text-align: center;
  544. .renew-wrap-text {
  545. margin-top: 30px;
  546. margin-bottom: 60px;
  547. font-size: 34px;
  548. }
  549. }
  550. </style>