index.vue 8.8 KB

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