index.vue 8.0 KB

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