index.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  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. agent:this.agent
  195. }
  196. uni.navigateTo({
  197. url: item.url
  198. })
  199. }
  200. }
  201. },
  202. confirmWarehouse() {},
  203. confirmPositon() {},
  204. init() {
  205. console.log(this.userInfo)
  206. this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelf', {
  207. compId: '',
  208. }).then(res => {
  209. if (res.data.data) {
  210. console.log('res',res.data.data)
  211. if (res.data.data.length == 0) {
  212. this.isShowAlert = true
  213. } else {
  214. this.warehouseName = res.data.data[0].warehouseName
  215. this.warehouseList = res.data.data;
  216. this.compId = res.data.data[0].compId
  217. this.agent = res.data.data[0].agent
  218. this.binNumber = res.data.data[0].positionInfos[0].binNumber
  219. this.warehouseCWList = res.data.data[0].positionInfos
  220. console.log('this.warehouseCWList',this.warehouseCWList)
  221. // this.makeBinNumber()
  222. }
  223. }
  224. })
  225. },
  226. makeBinNumber(){
  227. },
  228. warehousechange(e) {
  229. this.warehouseName = this.warehouseList[e[0]].warehouseName
  230. this.compId = this.warehouseList[e[0]].compId
  231. this.agent = this.warehouseList[e[0]].agent
  232. this.warehouseCWList = this.warehouseList[e[0]].positionInfos
  233. console.log(e)
  234. },
  235. warehouseCWchange(e){
  236. this.binNumber = this.warehouseCWList[e[0]].binNumber
  237. }
  238. }
  239. }
  240. </script>
  241. <style lang='scss' scoped>
  242. page {
  243. background: #F5F6FA;
  244. }
  245. .container {
  246. padding-top: 85px;
  247. padding-top: 35px;
  248. background-color: #F5F6FA;
  249. position: relative;
  250. width: 100vw;
  251. height: 100vh;
  252. overflow: hidden;
  253. background: url('~@/static/img/login/bg_slices/bg@3x.png');
  254. background-size: 100% 100%;
  255. margin: 0 auto;
  256. }
  257. .wrap {
  258. background: #fff;
  259. margin: 10px;
  260. border-radius: 10px;
  261. padding: 10px;
  262. .title {
  263. font-size: 16px;
  264. }
  265. }
  266. .cu-list {
  267. /* height: 483rpx;
  268. overflow-y: scroll; */
  269. background: transparent;
  270. }
  271. .cu-list.grid.no-border {
  272. padding: 0;
  273. }
  274. .grid {
  275. display: flex;
  276. align-items: center;
  277. flex-wrap: wrap;
  278. /* border-top: 2upx solid rgba(172,172,172,.2); */
  279. .grid-item-3 {
  280. box-sizing: border-box;
  281. width: calc(100% / 3);
  282. border-bottom: 2upx solid rgba(172, 172, 172, .2);
  283. border-right: 2upx solid rgba(172, 172, 172, .2);
  284. text-align: center;
  285. padding: 40upx 0;
  286. position: relative;
  287. /* view{
  288. font-size: $font-sm;
  289. margin-top: 16upx;
  290. color: $font-color-dark;
  291. } */
  292. .grid_icon {
  293. font-size: 48upx;
  294. margin-bottom: 18upx;
  295. color: #fa436a;
  296. }
  297. .tip_text {
  298. display: block;
  299. padding: 4upx 8upx;
  300. text-align: center;
  301. border-radius: 36upx;
  302. font-size: 24upx;
  303. background-color: #fa436a;
  304. color: rgba(255, 255, 255, 1);
  305. position: absolute;
  306. right: 6upx;
  307. top: 6upx;
  308. }
  309. }
  310. .grid-item-3:nth-child(3n + 3),
  311. .grid-item-4:nth-child(4n + 4) {
  312. border-right: none;
  313. }
  314. }
  315. .sign {
  316. width: 40px;
  317. height: 40px;
  318. top: 4px;
  319. margin-right: 6px;
  320. }
  321. .dropdown {
  322. display: flex;
  323. margin: 20rpx 0;
  324. justify-content: space-between;
  325. .left,
  326. .right {
  327. display: flex;
  328. }
  329. }
  330. </style>