index.vue 9.8 KB

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