home.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. <template>
  2. <view>
  3. <!-- background: url(../../static/homeBG.png)no-repeat; -->
  4. <view style="
  5. background-size:100%;
  6. box-shadow: 0px 0px 8px 0px rgba(165, 189, 251, 0.4);height:100%">
  7. <!-- <u-navbar :is-back="false" :is-fixed="false" :border-bottom="false" :background="background">
  8. <view style="width: 96%;margin: 0 auto;">
  9. <u-search placeholder="请输入您要搜索的内容" bg-color="#FFFFFF" :action-style="actionStyle"></u-search>
  10. </view>
  11. </u-navbar> -->
  12. <view class="content" style="
  13. background: linear-gradient(-36deg, #004FFF 0%, #0089CB 100%);
  14. border-radius: 10rpx;
  15. padding: 20rpx;
  16. margin-top: 40rpx;" :style="{'marginTop':height+'px'}">
  17. <view style="height: 290rpx;">
  18. <view style="width: 100%;height: 200rpx;">
  19. <view style="width: 75%;color: #FFFFFF;font-size: 38rpx;float: left;">
  20. <view style="width: 100%;text-overflow:ellipsis;overflow:hidden;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 1;overflow: hidden;">{{exhibition.customerName}}</view>
  21. <view style="margin-top: 30rpx;font-size: 28rpx;" v-if="exhibition.customerName">库存:<text
  22. style="font-size: 40rpx;font-weight:bold">{{exhibition.stockTotal}}</text>{{mode==1?'':mode==2?'吨':mode==3?'CMB':'TEU'}}</view>
  23. </view>
  24. <view style="float: right;display: flex;justify-content: space-around;width: 150rpx;">
  25. <u-button shape="circle" size="mini" ripple style="margin-top: 5rpx;border-top-right-radius: 0;border-bottom-right-radius: 0;"
  26. :style="{backgroundColor:type==true?'#3788fc':'#fff',color:type==true?'#fff':'#2979FF'}"
  27. type="primary" @click="type=true">周</u-button>
  28. <u-button shape="circle" size="mini" ripple style="margin-top: 5rpx;border-top-left-radius: 0;border-bottom-left-radius: 0;"
  29. :style="{backgroundColor:type==true?'#fff':'#3788fc',color:type==true?'#2979FF':'#fff'}"
  30. type="primary" @click="type=false">月</u-button>
  31. </view>
  32. <view style="float: right;display: flex;justify-content: space-around;width: 370rpx;margin-top: -55rpx;" v-if="exhibition.customerName">
  33. <u-button shape="circle" size="mini" ripple style="margin-top: 5rpx;border-radius: 10rpx;"
  34. :style="{backgroundColor:mode==1?'#3788fc':'#fff',color:mode==1?'#fff':'#2979FF'}"
  35. type="primary" @click="stockStatistics(mode = 1)">件数</u-button>
  36. <u-button shape="circle" size="mini" ripple style="margin-top: 5rpx;border-radius: 10rpx;"
  37. :style="{backgroundColor:mode==2?'#3788fc':'#fff',color:mode==2?'#fff':'#2979FF'}"
  38. type="primary" @click="stockStatistics(mode = 2)">重量</u-button>
  39. <u-button shape="circle" size="mini" ripple style="margin-top: 5rpx;border-radius: 10rpx;"
  40. :style="{backgroundColor:mode==3?'#3788fc':'#fff',color:mode==3?'#fff':'#2979FF'}"
  41. type="primary" @click="stockStatistics(mode = 3)">尺码</u-button>
  42. <u-button shape="circle" size="mini" ripple style="margin-top: 5rpx;border-radius: 10rpx;"
  43. :style="{backgroundColor:mode==4?'#3788fc':'#fff',color:mode==4?'#fff':'#2979FF'}"
  44. type="primary" @click="stockStatistics(mode = 4)">箱量</u-button>
  45. </view>
  46. </view>
  47. <view v-if="type"
  48. style="width: 100%;display: flex;justify-content: space-between;text-align: center;color: #FFFFFF;margin-top: 0rpx;font-size: 24rpx;">
  49. <view>
  50. <view>本周入库</view>
  51. <view style="font-size: 24rpx;">
  52. <text
  53. style="font-size: 32rpx;font-weight: bold;">{{exhibition.inStockTotalWeek}}</text>{{mode==1?'':mode==2?'吨':mode==3?'CMB':'TEU'}}
  54. </view>
  55. </view>
  56. <view>
  57. <view>本周出库</view>
  58. <view style="font-size: 24rpx;">
  59. <text
  60. style="font-size: 32rpx;font-weight: bold;">{{exhibition.outStockTotalWeek}}</text>{{mode==1?'':mode==2?'吨':mode==3?'CMB':'TEU'}}
  61. </view>
  62. </view>
  63. <view>
  64. <view>上周入库</view>
  65. <view style="font-size: 24rpx;">
  66. <text
  67. style="font-size: 32rpx;font-weight: bold;">{{exhibition.inStockTotalLastWeek}}</text>{{mode==1?'':mode==2?'吨':mode==3?'CMB':'TEU'}}
  68. </view>
  69. </view>
  70. <view>
  71. <view>上周出库</view>
  72. <view style="font-size: 24rpx;">
  73. <text
  74. style="font-size: 32rpx;font-weight: bold;">{{exhibition.outStockTotalLastWeek}}</text>{{mode==1?'':mode==2?'吨':mode==3?'CMB':'TEU'}}
  75. </view>
  76. </view>
  77. </view>
  78. <view v-else
  79. style="width: 100%;display: flex;justify-content: space-between;text-align: center;color: #FFFFFF;margin-top: 0rpx;font-size: 24rpx;">
  80. <view>
  81. <view>本日入库</view>
  82. <view style="font-size: 24rpx;"><text
  83. style="font-size: 32rpx;font-weight: bold;">{{exhibition.inStockTotalToday}}</text>{{mode==1?'':mode==2?'吨':mode==3?'CMB':'TEU'}}
  84. </view>
  85. </view>
  86. <view>
  87. <view>本日出库</view>
  88. <view style="font-size: 24rpx;"><text
  89. style="font-size: 32rpx;font-weight: bold;">{{exhibition.outStockTotalToday}}</text>{{mode==1?'':mode==2?'吨':mode==3?'CMB':'TEU'}}
  90. </view>
  91. </view>
  92. <view>
  93. <view>本月入库</view>
  94. <view style="font-size: 24rpx;">
  95. <text
  96. style="font-size: 32rpx;font-weight: bold;">{{exhibition.inStockTotalMonth}}</text>{{mode==1?'':mode==2?'吨':mode==3?'CMB':'TEU'}}
  97. </view>
  98. </view>
  99. <view>
  100. <view>本月出库</view>
  101. <view style="font-size: 24rpx;">
  102. <text
  103. style="font-size: 32rpx;font-weight: bold;">{{exhibition.outStockTotalMonth}}</text>{{mode==1?'':mode==2?'吨':mode==3?'CMB':'TEU'}}
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. <!-- 快捷功能 -->
  110. <!-- <view style="height: 150rpx;margin-top: -20rpx;" v-if="deptName != '外部用户'">
  111. <u-grid :col="3" :border="false">
  112. <u-grid-item bg-color="#ffffff00" style="background-color: rgba(0,0,0,0);">
  113. <u-icon name="order" color="#fff" size="60"></u-icon>
  114. <view class="grid-text" style="color: #FFFFFF;margin-top: 10px;">我的数据</view>
  115. </u-grid-item>
  116. <u-grid-item @click="myReview" bg-color="#ffffff00" style="background-color: rgba(0,0,0,0);">
  117. <u-badge type="error" :count="totalTwo" style="margin-right: 30rpx;" />
  118. <u-icon name="edit-pen" color="#fff" size="60"></u-icon>
  119. <view class="grid-text" style="color: #FFFFFF;margin-top: 10px;">我的审核</view>
  120. </u-grid-item>
  121. <u-grid-item @click="scanCode" bg-color="#ffffff00" style="background-color: rgba(0,0,0,0);">
  122. <u-icon name="scan" color="#fff" size="60"></u-icon>
  123. <view class="grid-text" style="color: #FFFFFF;margin-top: 10px;">扫一扫</view>
  124. </u-grid-item>
  125. </u-grid>
  126. </view> -->
  127. <!-- 正文内容 -->
  128. <view class="content">
  129. <u-grid :col="deptName=='外部用户'?3:4" :border="false">
  130. <u-grid-item @click="jumpPath(1)">
  131. <u-image width="58rpx" height="58rpx" src="../../static/image/warehousing.png"></u-image>
  132. <view class="grid-text">我的入库</view>
  133. </u-grid-item>
  134. <u-grid-item @click="jumpPath(2)">
  135. <u-image width="58rpx" height="58rpx" src="../../static/image/outOfStock.png"></u-image>
  136. <view class="grid-text">我的出库</view>
  137. </u-grid-item>
  138. <!-- <u-grid-item @click="jumpPath(3)">
  139. <u-icon name="hourglass" :size="46"></u-icon>
  140. <view class="grid-text">我的调拨</view>
  141. </u-grid-item>
  142. <u-grid-item @click="jumpPath(4)">
  143. <u-icon name="photo" :size="46"></u-icon>
  144. <view class="grid-text">我的货转</view>
  145. </u-grid-item> -->
  146. <u-grid-item @click="jumpPath(5)">
  147. <u-image width="58rpx" height="58rpx" src="../../static/image/stock.png"></u-image>
  148. <view class="grid-text">我的库存</view>
  149. </u-grid-item>
  150. <u-grid-item @click="myReview()" v-if="deptName != '外部用户'">
  151. <u-image width="58rpx" height="58rpx" src="../../static/image/toExamine.png"></u-image>
  152. <view class="grid-text">我的审核</view>
  153. </u-grid-item>
  154. <!-- <u-grid-item @click="jumpPath(6)">
  155. <u-icon name="order" :size="46"></u-icon>
  156. <view class="grid-text">运费计算</view>
  157. </u-grid-item> -->
  158. <!-- <u-grid-item @click="jumpPath(7)">
  159. <u-icon name="camera" :size="46"></u-icon>
  160. <view class="grid-text">我的巡检</view>
  161. </u-grid-item> -->
  162. <!-- <u-grid-item @click="jumpPath(12)">
  163. <u-icon name="eye" :size="46"></u-icon>
  164. <view class="grid-text">我的视频</view>
  165. </u-grid-item> -->
  166. <!-- <u-grid-item @click="jumpPath(8)">
  167. <u-badge type="error" :count="total" />
  168. <u-icon name="checkmark-circle" :size="46"></u-icon>
  169. <view class="grid-text">我的采购</view>
  170. </u-grid-item> -->
  171. <!-- <u-grid-item @click="jumpPath('null')">
  172. <u-icon name="grid" :size="46"></u-icon>
  173. <view class="grid-text">其他</view>
  174. </u-grid-item> -->
  175. </u-grid>
  176. </view>
  177. <view style="
  178. width: 100%;
  179. margin: 0 auto;
  180. margin-top: 20rpx;
  181. border-radius: 20rpx;
  182. margin-bottom: 20rpx;
  183. padding: 10rpx;">
  184. <view style="width: 42%;height: 440rpx;float: left;" @click="jumpPath(7)">
  185. <image src="../../static/patrolInspection.png" mode="" style="width: 100%;height: 100%;"></image>
  186. </view>
  187. <view style="width: 58%;height: 440rpx;float: right;">
  188. <view style="width: 100%;height: 220rpx;" @click="jumpPath(12)">
  189. <image src="../../static/monitor.png" mode="" style="width: 100%;height: 100%;"></image>
  190. </view>
  191. <view style="width: 100%;height: 220rpx;margin-top: 0rpx;" @click="jumpPath(13)">
  192. <image src="../../static/stockAgeStatistics.png" mode="" style="width: 100%;height: 100%;">
  193. </image>
  194. </view>
  195. </view>
  196. </view>
  197. <view style="width: 96%;margin: 0 auto;">
  198. <image src="../../static/activityDiagram.png" style="margin-top: 20rpx;width: 100%;height: 220rpx;">
  199. </image>
  200. </view>
  201. </view>
  202. <view class="ordertop" v-for="(item, index) in lisi" :key="index">
  203. <view>
  204. <view class="iconblue"></view>
  205. <text class="license">提单号:{{item.fMblno}}</text>
  206. <view class="various">{{item.fBillstatus}}</view>
  207. </view>
  208. <view class="line">
  209. <u-line color="#ccc" border-style='dashed' />
  210. </view>
  211. <view class="basic">
  212. <view>{{item.fBilltype}}日期</view>
  213. <view>{{item.fBsdate}}</view>
  214. </view>
  215. <view class="basic">
  216. <view>计划件数</view>
  217. <view>{{item.fPlanqty}}</view>
  218. </view>
  219. <view class="basic">
  220. <view>品名\属性详情</view>
  221. <view>{{item.goodsName}}\{{item.fMarks}}</view>
  222. </view>
  223. </view>
  224. <u-loadmore v-if="lisi.length > 0" :status="status" :icon-type="iconType" :load-text="loadText" />
  225. <!-- 更新组件 force 是否强制更新 tabbar:页面是否有原生tabbar组件-->
  226. <app-update ref="app_update" :force="false" :tabbar="true"></app-update>
  227. </view>
  228. </template>
  229. <script>
  230. import appUpdate from "@/components/yzhua006-update/app-update.vue"
  231. export default {
  232. components: {
  233. appUpdate
  234. },
  235. data() {
  236. return {
  237. background: {
  238. backgroundImage: 'none',
  239. backgroundColor: 'none'
  240. },
  241. status: 'loadmore',
  242. iconType: 'flower',
  243. loadText: {
  244. loadmore: '轻轻上拉',
  245. loading: '努力加载中',
  246. nomore: '实在没有了'
  247. },
  248. lisi: [],
  249. actionStyle: {
  250. color: '#fff'
  251. },
  252. mode:'1',
  253. deptName: '',
  254. form: {
  255. pageNum: 1,
  256. pageSize: 3,
  257. },
  258. exhibition: {},
  259. total: 0,
  260. totalTwo: '',
  261. height: 0,
  262. type: true,
  263. }
  264. },
  265. created() {
  266. let this_ = this
  267. uni.getSystemInfo({
  268. success: function(res) {
  269. this_.height = res.statusBarHeight
  270. }
  271. });
  272. },
  273. onReachBottom() {
  274. this.status = 'loading'
  275. if (this.lisi.length < this.total) {
  276. this.form.pageNum++
  277. this.query()
  278. } else {
  279. this.status = 'nomore'
  280. }
  281. },
  282. onShow() {
  283. this.$nextTick(function() {
  284. this.testUpgrade()
  285. })
  286. this.lisi=[]
  287. this.form = {
  288. pageNum: 1,
  289. pageSize: 3,
  290. }
  291. this.deptName = uni.getStorageSync('deptName')
  292. this.stockStatistics()
  293. },
  294. methods: {
  295. //获取主页顶部数据
  296. stockStatistics(){
  297. this.$u.get('/warehouseBusiness/summary/stockStatistics',{mode:this.mode}).then(res => {
  298. console.log(res)
  299. this.exhibition = res.data
  300. //成功后再查询
  301. this.query()
  302. })
  303. },
  304. testUpgrade() {
  305. this.$refs.app_update.update(); //调用子组件 检查更新
  306. },
  307. query() {
  308. this.$u.get('/warehouseBusiness/summary/inAndOutStockList', this.form).then(res => {
  309. this.lisi = this.lisi.concat(res.rows)
  310. this.total = res.total
  311. })
  312. },
  313. scanCode() {
  314. uni.scanCode({
  315. success: res => {
  316. console.log(res.result)
  317. }
  318. });
  319. },
  320. jumpPath(res) {
  321. switch (res) {
  322. case 1:
  323. this.$u.route('/pages/home/myorder/index');
  324. break;
  325. case 2:
  326. this.$u.route('/pages/home/delivery/index');
  327. break;
  328. // case 3:
  329. // this.$u.route('/pages/home/allocation/index');
  330. // break;
  331. // case 4:
  332. // this.$u.route('/pages/home/goodsTransfer/index');
  333. // break;
  334. case 5:
  335. this.$u.route('/pages/home/inventoryQuery/index');
  336. break;
  337. case 6:
  338. this.$u.route('/pages/home/freightCalculation/shipSchedule');
  339. break;
  340. case 7:
  341. this.$u.route('/pages/home/patrolInspection/index');
  342. break;
  343. case 8:
  344. this.$u.route('/pages/home/procurementApplicationApproval/index');
  345. break;
  346. case 12:
  347. this.$u.route('/pages/home/cameraList/index');
  348. break;
  349. case 13:
  350. this.$u.route('/pages/home/ageStatistics/index');
  351. break;
  352. default:
  353. uni.showToast({
  354. icon: 'none',
  355. title: '该功能暂未开发~',
  356. position: "bottom"
  357. })
  358. break;
  359. }
  360. },
  361. myReview() {
  362. this.$u.route('/pages/home/myReview/index');
  363. },
  364. myData() {
  365. uni.showToast({
  366. icon: 'none',
  367. title: '该功能暂未开发~',
  368. position: "bottom"
  369. })
  370. }
  371. }
  372. }
  373. </script>
  374. <style scoped lang="scss">
  375. .content {
  376. width: 96%;
  377. margin: 0 auto;
  378. box-shadow: 0px 0px 8px 0px rgba(165, 189, 251, 0.4);
  379. background-color: #FFFFFF;
  380. margin-top: 20rpx;
  381. border-radius: 20rpx;
  382. padding: 10rpx;
  383. }
  384. .shadow {
  385. box-shadow: 0px 0px 8px 0px rgba(165, 189, 251, 0.4);
  386. }
  387. .grid-text {
  388. font-size: 28rpx;
  389. margin-top: 4rpx;
  390. color: $u-type-info;
  391. }
  392. .basic {
  393. width: 94%;
  394. margin: 10rpx auto;
  395. display: flex;
  396. justify-content: space-between;
  397. }
  398. .basic>view {
  399. margin-bottom: 10rpx;
  400. }
  401. .basic>view:nth-child(1) {
  402. color: #797979;
  403. }
  404. .view {
  405. width: 96%;
  406. margin: 20rpx auto;
  407. display: flex;
  408. justify-content: space-between
  409. }
  410. .line {
  411. width: 92%;
  412. margin: 0 auto;
  413. }
  414. .oddnumber {
  415. width: 96%;
  416. margin: 20rpx auto;
  417. margin-bottom: 20rpx;
  418. }
  419. .ordertop {
  420. width: 96%;
  421. background-color: #fff;
  422. margin: 20rpx auto;
  423. border-radius: 20rpx;
  424. padding-top: 20rpx;
  425. box-shadow: 0px 0px 8px 0px rgba(165, 189, 251, 0.4);
  426. padding-bottom: 10rpx;
  427. }
  428. .ordertop>view:nth-child(1) {
  429. width: 98%;
  430. margin-bottom: 60rpx;
  431. }
  432. .search {
  433. width: 96%;
  434. margin: 10rpx auto;
  435. }
  436. .iconblue {
  437. width: 10rpx;
  438. height: 45rpx;
  439. float: left;
  440. background-color: #3a63cf;
  441. margin-right: 10rpx;
  442. }
  443. .license {
  444. float: left;
  445. font-size: 32rpx;
  446. }
  447. .various {
  448. float: right;
  449. width: 150rpx;
  450. border: 2rpx solid #3a63cf;
  451. text-align: center;
  452. border-radius: 100rpx;
  453. color: #1669e6;
  454. }
  455. .condition {
  456. background-color: #1669e6;
  457. height: 60rpx;
  458. }
  459. .conditionone {
  460. width: 92%;
  461. height: 44rpx;
  462. margin: 0rpx auto;
  463. display: flex;
  464. justify-content: space-between;
  465. color: #fff;
  466. }
  467. .conditionone>view {
  468. color: #e6e8e8;
  469. }
  470. </style>