index.vue 8.7 KB

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