index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <template>
  2. <view class="wrap">
  3. <view class='title'>仓库管理</view>
  4. <view class="dropdown">
  5. <view class="left" @click='show1=true'>
  6. <view>{{warehouseName}}</view>
  7. <u-icon name="arrow-right" color=""></u-icon>
  8. <u-picker @confirm="warehousechange" range-key='warehouseName' mode="selector" v-model="show1"
  9. :range="warehouseList"></u-picker>
  10. </view>
  11. <view class="right" @click='show2=true'>
  12. <view>{{positionName}}</view>
  13. <u-icon name="arrow-right" color=""></u-icon>
  14. <u-select v-model="show2" :default-value='[0]' :list="positionList" @confirm="confirmPositon">
  15. </u-select>
  16. </view>
  17. </view>
  18. <view class="cu-list grid" :class="['col-' + gridCol,gridBorder?'':'no-border']">
  19. <view class="cu-item" v-for="(item,index) in gridList" :key="index" @click="gridClick(item, index)"
  20. v-if="index<gridCol*2">
  21. <view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
  22. <image :src="item.src" class="sign"></image>
  23. </view>
  24. <text>{{item.name}}</text>
  25. </view>
  26. </view>
  27. <u-modal v-model="isShowAlert" confirm-color='#22C572' confirm-text='立即开通' title='您尚未开通ERP业务'
  28. :content="content"></u-modal>
  29. </view>
  30. </template>
  31. <script>
  32. import {
  33. mapState
  34. } from 'vuex';
  35. export default {
  36. components: {
  37. },
  38. data() {
  39. return {
  40. show1: false,
  41. show2: false,
  42. isShowAlert: false,
  43. content: '易粮易运ERP系统包含合同管理、仓库管理、运输管理、结算管理等多个模块,可为粮企提供粮食贸易的全流程服务,平台诚邀您的加入。',
  44. warehouseName: '',
  45. positionName: '102仓位',
  46. warehouseList: [],
  47. positionList: [{
  48. "label": '102仓位',
  49. "value": '1'
  50. }],
  51. gridCol: 4,
  52. gridBorder: false,
  53. gridList: [{
  54. num: 0,
  55. name: '入库',
  56. // icon: 'cuIcon-apps',
  57. src: '../../static/img/erp/yaoqingyonghu@3x.png',
  58. tips: 0,
  59. url: '/pages/erp/warehousing/warehousing',
  60. show: true
  61. },
  62. {
  63. num: 1,
  64. name: '待完善入库',
  65. // icon: 'cuIcon-calendar',
  66. src: '../../static/img/erp/shougouzhijian@3x.png',
  67. tips: 0,
  68. url: '/pages/erp/improvedWrehousing/improvedWrehousing',
  69. show: true
  70. },
  71. {
  72. num: 2,
  73. name: '出库',
  74. // icon: 'cuIcon-copy',
  75. src: '../../static/img/erp/shougoujianjin@3x.png',
  76. tips: 0,
  77. url: '/pages/erp/exWarehousing/exWarehousing',
  78. show: true
  79. },
  80. {
  81. num: 3,
  82. name: '待完善出库',
  83. // icon: 'cuIcon-edit',
  84. src: '../../static/img/erp/shougouzhijian@3x.png',
  85. tips: 0,
  86. url: `/pages/erp/improvedExWaehousing/improvedExWaehousing`,
  87. show: true
  88. },
  89. {
  90. num: 4,
  91. name: '开通业务',
  92. // icon: 'cuIcon-edit',
  93. src: '../../static/img/erp/shougouzhijian@3x.png',
  94. tips: 0,
  95. url: `/pages/erp/improvedExWaehousing/improvedExWaehousing`,
  96. show: true
  97. },
  98. {
  99. num: 5,
  100. name: '联系客服',
  101. // icon: 'cuIcon-edit',
  102. src: '../../static/img/erp/shougouzhijian@3x.png',
  103. tips: 0,
  104. url: `/pages/erp/improvedExWaehousing/improvedExWaehousing`,
  105. show: true
  106. }
  107. ],
  108. }
  109. },
  110. onLoad() {
  111. this.init()
  112. },
  113. // #ifndef MP
  114. onNavigationBarButtonTap(e) {
  115. const index = e.index;
  116. if (index === 0) {
  117. this.navTo('/pages/set/set');
  118. } else if (index === 1) {
  119. // #ifdef APP-PLUS
  120. const pages = getCurrentPages();
  121. const page = pages[pages.length - 1];
  122. const currentWebview = page.$getAppWebview();
  123. currentWebview.hideTitleNViewButtonRedDot({
  124. index
  125. });
  126. // #endif
  127. uni.navigateTo({
  128. url: '/pages/notice/notice'
  129. })
  130. }
  131. },
  132. // #endif
  133. computed: {
  134. ...mapState(['hasLogin', 'userInfo']),
  135. },
  136. onShow() {
  137. this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
  138. console.log("checkSession", res)
  139. if (res.data.data == "INVALID") {
  140. uni.showModal({
  141. title: '登录提示',
  142. content: 'Session过期需要重新登录,是否立即登录?',
  143. showCancel: true,
  144. confirmText: '登录',
  145. success: (e) => {
  146. if (e.confirm) {
  147. uni.navigateTo({
  148. url: '/pages/public/login'
  149. })
  150. }
  151. },
  152. fail: () => {},
  153. complete: () => {}
  154. })
  155. }
  156. })
  157. },
  158. methods: {
  159. /**
  160. * 统一跳转接口,拦截未登录路由
  161. * navigator标签现在默认没有转场动画,所以用view
  162. */
  163. navTo(url) {
  164. if (!this.hasLogin) {
  165. url = '/pages/public/login';
  166. }
  167. uni.navigateTo({
  168. url
  169. })
  170. },
  171. gridClick(item, index) {
  172. var that = this
  173. if (!this.hasLogin) {
  174. uni.showModal({
  175. title: '登录提示',
  176. content: '您尚未登录,是否立即登录?',
  177. showCancel: true,
  178. confirmText: '登录',
  179. success: (e) => {
  180. if (e.confirm) {
  181. uni.navigateTo({
  182. url: '/pages/public/login'
  183. })
  184. }
  185. },
  186. fail: () => {},
  187. complete: () => {}
  188. })
  189. } else {
  190. if (item.url) {
  191. uni.navigateTo({
  192. url: item.url
  193. })
  194. }
  195. }
  196. },
  197. confirmWarehouse() {},
  198. confirmPositon() {},
  199. init() {
  200. console.log(this.userInfo)
  201. this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelf', {
  202. compId: '',
  203. }).then(res => {
  204. if (res.data.data) {
  205. console.log('res',res.data.data)
  206. if (res.data.data.length == 0) {
  207. this.isShowAlert = true
  208. } else {
  209. this.warehouseName = res.data.data[0].warehouseName
  210. this.warehouseList = res.data.data;
  211. this.makeBinNumber()
  212. }
  213. }
  214. })
  215. },
  216. makeBinNumber(){debugger
  217. console.log(_arr)
  218. },
  219. warehousechange(e) {
  220. debugger
  221. this.warehouseName = this.warehouseList[e[0]].warehouseName
  222. console.log(e)
  223. },
  224. }
  225. }
  226. </script>
  227. <style lang='scss' scoped>
  228. page {
  229. background: #F5F6FA;
  230. }
  231. .container {
  232. padding-top: 85px;
  233. padding-top: 35px;
  234. background-color: #F5F6FA;
  235. position: relative;
  236. width: 100vw;
  237. height: 100vh;
  238. overflow: hidden;
  239. background: url('~@/static/img/login/bg_slices/bg@3x.png');
  240. background-size: 100% 100%;
  241. margin: 0 auto;
  242. }
  243. .wrap {
  244. background: #fff;
  245. margin: 10px;
  246. border-radius: 10px;
  247. padding: 10px;
  248. .title {
  249. font-size: 16px;
  250. }
  251. }
  252. .cu-list {
  253. /* height: 483rpx;
  254. overflow-y: scroll; */
  255. background: transparent;
  256. }
  257. .cu-list.grid.no-border {
  258. padding: 0;
  259. }
  260. .grid {
  261. display: flex;
  262. align-items: center;
  263. flex-wrap: wrap;
  264. /* border-top: 2upx solid rgba(172,172,172,.2); */
  265. .grid-item-3 {
  266. box-sizing: border-box;
  267. width: calc(100% / 3);
  268. border-bottom: 2upx solid rgba(172, 172, 172, .2);
  269. border-right: 2upx solid rgba(172, 172, 172, .2);
  270. text-align: center;
  271. padding: 40upx 0;
  272. position: relative;
  273. /* view{
  274. font-size: $font-sm;
  275. margin-top: 16upx;
  276. color: $font-color-dark;
  277. } */
  278. .grid_icon {
  279. font-size: 48upx;
  280. margin-bottom: 18upx;
  281. color: #fa436a;
  282. }
  283. .tip_text {
  284. display: block;
  285. padding: 4upx 8upx;
  286. text-align: center;
  287. border-radius: 36upx;
  288. font-size: 24upx;
  289. background-color: #fa436a;
  290. color: rgba(255, 255, 255, 1);
  291. position: absolute;
  292. right: 6upx;
  293. top: 6upx;
  294. }
  295. }
  296. .grid-item-3:nth-child(3n + 3),
  297. .grid-item-4:nth-child(4n + 4) {
  298. border-right: none;
  299. }
  300. }
  301. .sign {
  302. width: 40px;
  303. height: 40px;
  304. top: 4px;
  305. margin-right: 6px;
  306. }
  307. .dropdown {
  308. display: flex;
  309. margin: 20rpx 0;
  310. justify-content: space-between;
  311. .left,
  312. .right {
  313. display: flex;
  314. }
  315. }
  316. </style>