index.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <template>
  2. <!-- #ifdef H5 -->
  3. <zj-page-layout
  4. :hasFooter="false"
  5. :isScroll="true"
  6. :refresherTriggered="refresherTriggered"
  7. @refresherrefresh="refresherrefresh"
  8. >
  9. <view class="all-container">
  10. <view class="card" v-if="type == 'M'">
  11. <view class="top">
  12. <text class="iconfont icon-kucun icon"></text>
  13. <view class="title">辅材库存</view>
  14. <view class="right" @tap="navToPage('/packageMaterial/pages/stock/index')"
  15. >我的库存<text class="iconfont icon-jinru"></text
  16. ></view>
  17. </view>
  18. <view class="center">
  19. <view class="text">无辅材/配件库存可以申请购买</view>
  20. <u-button
  21. type="primary"
  22. text="去购买"
  23. shape="circle"
  24. @click="navToPage(`/packageMaterial/pages/apply/index`)"
  25. ></u-button>
  26. </view>
  27. <!-- <view class="bottom">
  28. <view class="it" @tap="navToPage(`/packageMaterial/pages/stock/returnList?type=NEW`)">
  29. <view class="num">{{ count.newRefundCount || 0 }}</view>
  30. <view class="text">新件待返还</view>
  31. </view>
  32. <view class="it" @tap="navToPage(`/packageMaterial/pages/stock/returnList?type=OLD`)">
  33. <view class="num">{{ count.oldRefundCount || 0 }}</view>
  34. <view class="text">旧件待返还</view>
  35. </view>
  36. </view> -->
  37. </view>
  38. <view class="card" v-if="type == 'M'">
  39. <view class="top">
  40. <text class="iconfont icon-fucai icon"></text>
  41. <view class="title">辅材销售</view>
  42. <view class="right" @tap="navToPage(`/packageMaterial/pages/sale/orderList?type=M`)"
  43. >辅材订单<text class="iconfont icon-jinru"></text
  44. ></view>
  45. </view>
  46. <view class="center">
  47. <view class="text">用户需要使用辅材,销售收款</view>
  48. <u-button
  49. type="primary"
  50. text="辅材收款"
  51. shape="circle"
  52. @click="navToPage(`/packageMaterial/pages/sale/index?type=M`)"
  53. ></u-button>
  54. </view>
  55. <view class="bottom">
  56. <view class="it">
  57. <view class="num">{{ count.materialSalesCount || 0 }}</view>
  58. <view class="text">今日下单(单)</view>
  59. </view>
  60. <view class="it">
  61. <view class="num">{{ count.materialSalesAmount || 0 }}</view>
  62. <view class="text">今日销售金额</view>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="card" v-if="type == 'P'">
  67. <view class="top">
  68. <text class="iconfont icon-kucun icon"></text>
  69. <view class="title">配件库存</view>
  70. <view class="right" @tap="navToPage('/packageAttachment/pages/sparePartsInventory/index')"
  71. >我的库存<text class="iconfont icon-jinru"></text
  72. ></view>
  73. </view>
  74. <view class="center">
  75. <view class="text">无辅材/配件库存可以申请购买</view>
  76. <u-button
  77. type="primary"
  78. text="去购买"
  79. shape="circle"
  80. @click="navToPage(`/packageAttachment/pages/applicationParts/index`)"
  81. ></u-button>
  82. </view>
  83. <!-- <view class="bottom">
  84. <view class="it" @tap="navToPage(`/packageAttachment/pages/returnOfNewParts/index`)">
  85. <view class="num">{{ count.newRefundCount || 0 }}</view>
  86. <view class="text">新件待返还</view>
  87. </view>
  88. <view class="it" @tap="navToPage(`/packageAttachment/pages/returnOfOldParts/index`)">
  89. <view class="num">{{ count.oldRefundCount || 0 }}</view>
  90. <view class="text">旧件待返还</view>
  91. </view>
  92. </view> -->
  93. </view>
  94. <view class="card" v-if="type == 'P'">
  95. <view class="top">
  96. <text class="iconfont icon-peijian icon"></text>
  97. <view class="title">配件销售</view>
  98. <view class="right" @tap="navToPage(`/packageMaterial/pages/newSale/orderList?type=P`)"
  99. >配件订单<text class="iconfont icon-jinru"></text
  100. ></view>
  101. </view>
  102. <view class="center">
  103. <view class="text">用户需要使用配件,销售收款</view>
  104. <u-button
  105. type="primary"
  106. text="配件收款"
  107. shape="circle"
  108. @click="navToPage(`/packageMaterial/pages/newSale/index?type=P`)"
  109. ></u-button>
  110. </view>
  111. <view class="bottom">
  112. <view class="it">
  113. <view class="num">{{ count.partsSalesCount || 0 }}</view>
  114. <view class="text">今日下单(单)</view>
  115. </view>
  116. <view class="it">
  117. <view class="num">{{ count.partsSalesAmount || 0 }}</view>
  118. <view class="text">今日销售金额</view>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. </zj-page-layout>
  124. <!-- #endif -->
  125. <!-- #ifndef H5 -->
  126. <web-view
  127. :src="webViewHref(`/packageMaterial/pages/index`, pam, crossPagePam)"
  128. @message="crossPage.$listener"
  129. ></web-view>
  130. <!-- #endif -->
  131. </template>
  132. <script>
  133. // #ifdef H5
  134. export default {
  135. data() {
  136. return {
  137. refresherTriggered: false,
  138. count: {},
  139. }
  140. },
  141. onLoad({ type }) {
  142. this.type = type
  143. this.getDetail();
  144. },
  145. methods: {
  146. getDetail() {
  147. this.$api.post('/material/worker/stock/my/data/count')
  148. .then(res => {
  149. this.count = res.data || {};
  150. }).finally(res => {
  151. this.refresherTriggered = false;
  152. })
  153. },
  154. // 下拉刷新
  155. refresherrefresh() {
  156. this.refresherTriggered = true;
  157. this.getDetail();
  158. },
  159. navToPage(url) {
  160. if(!url) return this.$toast('敬请期待~');
  161. this.$navToPage({
  162. url
  163. })
  164. }
  165. },
  166. }
  167. // #endif
  168. // #ifndef H5
  169. export default {
  170. data() {
  171. return {
  172. pam: {},
  173. }
  174. },
  175. onLoad(pam) {
  176. this.pam = pam;
  177. }
  178. }
  179. // #endif
  180. </script>
  181. <style lang="scss" scoped>
  182. .all-container {
  183. padding: 20rpx;
  184. .card {
  185. @include zj-card;
  186. margin-bottom: 20rpx;
  187. padding: 40rpx 20rpx;
  188. &:nth-child(1),
  189. &:nth-child(3) {
  190. .top {
  191. .icon {
  192. background: $assist-color;
  193. }
  194. }
  195. }
  196. &:nth-child(2) {
  197. .top {
  198. .icon {
  199. background: $theme-color;
  200. }
  201. }
  202. }
  203. .top {
  204. display: flex;
  205. align-items: center;
  206. .icon {
  207. width: 40rpx;
  208. height: 40rpx;
  209. border-radius: 50%;
  210. font-size: 28rpx;
  211. color: #ffffff;
  212. display: flex;
  213. align-items: center;
  214. justify-content: center;
  215. }
  216. .title {
  217. flex: 1;
  218. margin-left: 12rpx;
  219. font-size: 32rpx;
  220. font-weight: 500;
  221. }
  222. .right {
  223. display: flex;
  224. align-items: center;
  225. font-size: 28rpx;
  226. color: $sec-font;
  227. .iconfont {
  228. font-size: 24rpx;
  229. margin-left: 8rpx;
  230. }
  231. }
  232. }
  233. .center {
  234. display: flex;
  235. align-items: center;
  236. justify-content: space-between;
  237. margin-top: 30rpx;
  238. .text {
  239. font-size: 28rpx;
  240. color: $sec-font;
  241. }
  242. ::v-deep .u-button {
  243. width: 160rpx;
  244. height: 60rpx;
  245. margin: 0;
  246. }
  247. }
  248. .bottom {
  249. display: flex;
  250. margin-top: 40rpx;
  251. .it {
  252. flex: 1;
  253. display: flex;
  254. flex-direction: column;
  255. align-items: center;
  256. .num {
  257. font-size: 40rpx;
  258. font-weight: 600;
  259. color: $theme-color;
  260. }
  261. .text {
  262. font-size: 24rpx;
  263. font-weight: 500;
  264. margin-top: 12rpx;
  265. }
  266. }
  267. }
  268. }
  269. }
  270. </style>