index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  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" :range="compList"
  8. 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']" v-if="isShowBtn">
  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. <view>
  36. <view class='title'>运输管理</view>
  37. <view class="cu-list grid" :class="['col-' + gridCol,gridBorder?'':'no-border']" v-if="isShowBtn">
  38. <view class="cu-item" v-for="(item,index) in gridList1" :key="index" @click="gridClick(item, index)"
  39. v-if="index<gridCol*2">
  40. <view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]" class="ys-item">
  41. <view class="ys-number" v-if="index==0&&ysFNumber!=0">
  42. {{ysFNumber}}
  43. </view>
  44. <view class="ys-number" v-if="index==1&&ysSNumber!=0">
  45. {{ysSNumber}}
  46. </view>
  47. <image :src="item.src" class="sign"></image>
  48. </view>
  49. <text>{{item.name}}</text>
  50. </view>
  51. </view>
  52. </view>
  53. <u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
  54. :content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='立即开通'
  55. title='您尚未开通ERP业务' showCancelButton='false' :content="content" @confirm="goOpenService"
  56. @cancel="cancelClick"></u-modal>
  57. <u-modal v-model="isShowAlert1" :title-style="{fontSize: '18px',fontWeight:'500'}"
  58. :content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='提示'
  59. showCancelButton='false' :content="content1" @confirm="alertBtn1" @cancel="cancelClick1"></u-modal>
  60. </view>
  61. </template>
  62. <script>
  63. import {
  64. mapState
  65. } from 'vuex';
  66. import helper from '@/common/helper.js';
  67. export default {
  68. components: {
  69. },
  70. data() {
  71. return {
  72. ysSNumber: '',
  73. ysFNumber: '',
  74. isShowAlert1: false,
  75. content1: '您尚未登录,是否立即登录?',
  76. show0: false,
  77. show1: false,
  78. show2: false,
  79. isShowAlert: false,
  80. compName: '',
  81. compList: [],
  82. isShowBtn: false,
  83. content: '易粮易运ERP系统包含合同管理、仓库管理、运输管理、结算管理等多个模块,可为粮企提供粮食贸易的全流程服务,平台诚邀您的加入。',
  84. warehouseName: '暂无仓库',
  85. binNumber: '暂无',
  86. compId: '',
  87. warehouseId: "",
  88. positionId: "",
  89. warehouseList: [],
  90. warehouseCWList: [],
  91. allWarehouse: [],
  92. gridCol: 4,
  93. gridBorder: false,
  94. personCharge: '',
  95. gridList: [{
  96. num: 0,
  97. name: '入库',
  98. // icon: 'cuIcon-apps',
  99. src: '../../static/img/erp/yaoqingyonghu@3x.png',
  100. tips: 0,
  101. url: '/pages/erp/warehousing/warehousing',
  102. show: true
  103. },
  104. {
  105. num: 1,
  106. name: '待完善入库',
  107. // icon: 'cuIcon-calendar',
  108. src: '../../static/img/erp/shougouzhijian@3x.png',
  109. tips: 0,
  110. url: '/pages/erp/improvedWrehousing/improvedWrehousing',
  111. show: true
  112. },
  113. {
  114. num: 2,
  115. name: '出库',
  116. // icon: 'cuIcon-copy',
  117. src: '../../static/img/erp/shougoujianjin@3x.png',
  118. tips: 0,
  119. url: '/pages/erp/exWarehousing/exWarehousing',
  120. show: true
  121. },
  122. {
  123. num: 3,
  124. name: '待完善出库',
  125. // icon: 'cuIcon-edit',
  126. src: '../../static/img/erp/shougouzhijian@3x.png',
  127. tips: 0,
  128. url: `/pages/erp/improvedExWaehousing/improvedExWaehousing`,
  129. show: true
  130. }
  131. // {
  132. // num: 4,
  133. // name: '开通业务',
  134. // // icon: 'cuIcon-edit',
  135. // src: '../../static/img/erp/shougouzhijian@3x.png',
  136. // tips: 0,
  137. // url: `/pages/erp/openService/openService`,
  138. // show: true
  139. // },
  140. // {
  141. // num: 5,
  142. // name: '联系客服',
  143. // // icon: 'cuIcon-edit',
  144. // src: '../../static/img/erp/shougouzhijian@3x.png',
  145. // tips: 0,
  146. // url: `/pages/erp/contactCustomerService/contactCustomerService`,
  147. // show: true
  148. // }
  149. ],
  150. gridList1: [{
  151. num: 0,
  152. name: '发货反馈',
  153. // icon: 'cuIcon-copy',
  154. src: '../../static/img/erp/delivery@3x.png',
  155. tips: 0,
  156. url: '/pages/erp/deliveryfeedback/list',
  157. show: true
  158. },
  159. {
  160. num: 1,
  161. name: '收货反馈',
  162. // icon: 'cuIcon-edit',
  163. src: '../../static/img/erp/receiving@3x.png',
  164. tips: 0,
  165. url: `/pages/erp/receivingfeedback/list`,
  166. show: true
  167. },
  168. // {
  169. // num: 4,
  170. // name: '开通业务',
  171. // // icon: 'cuIcon-edit',
  172. // src: '../../static/img/erp/shougouzhijian@3x.png',
  173. // tips: 0,
  174. // url: `/pages/erp/openService/openService`,
  175. // show: true
  176. // },
  177. // {
  178. // num: 5,
  179. // name: '联系客服',
  180. // // icon: 'cuIcon-edit',
  181. // src: '../../static/img/erp/shougouzhijian@3x.png',
  182. // tips: 0,
  183. // url: `/pages/erp/contactCustomerService/contactCustomerService`,
  184. // show: true
  185. // }
  186. ],
  187. }
  188. },
  189. onLoad() {},
  190. // #ifndef MP
  191. onNavigationBarButtonTap(e) {
  192. const index = e.index;
  193. if (index === 0) {
  194. this.navTo('/pages/set/set');
  195. } else if (index === 1) {
  196. // #ifdef APP-PLUS
  197. const pages = getCurrentPages();
  198. const page = pages[pages.length - 1];
  199. const currentWebview = page.$getAppWebview();
  200. currentWebview.hideTitleNViewButtonRedDot({
  201. index
  202. });
  203. // #endif
  204. uni.navigateTo({
  205. url: '/pages/notice/notice'
  206. })
  207. }
  208. },
  209. onBackPress() {
  210. uni.switchTab({
  211. url: '/pages/user/user'
  212. });
  213. return true
  214. },
  215. // #endif
  216. computed: {
  217. ...mapState(['hasLogin', 'userInfo']),
  218. },
  219. onShow() {
  220. uni.showLoading({
  221. title:"加载中...",
  222. mask:true
  223. })
  224. this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
  225. if (res.data.data == "INVALID") {
  226. uni.hideLoading()
  227. this.isShowAlert1 = true;
  228. // uni.showModal({
  229. // title: '提示',
  230. // content: '当前登入信息验证失败,是否重新登录?',
  231. // showCancel: true,
  232. // confirmText: '登录',
  233. // success: (e) => {
  234. // if (e.confirm) {
  235. // uni.navigateTo({
  236. // url: '/pages/public/login'
  237. // })
  238. // }
  239. // },
  240. // fail: () => {},
  241. // complete: () => {}
  242. // })
  243. }
  244. })
  245. this.$api.doRequest('get', '/openServiceInfo/selectCommonCompany', {
  246. phone: this.userInfo.phone
  247. }).then(res => {
  248. if (res.data.code == 200) {
  249. if (res.data.data.length == 0) {
  250. this.isShowAlert = true
  251. uni.hideLoading()
  252. } else {
  253. this.isShowAlert = false
  254. }
  255. this.compList = res.data.data
  256. this.compName = res.data.data[0].compName
  257. this.init(res.data.data[0].compId)
  258. }
  259. })
  260. // 发货执行中
  261. this.$api.doRequest('get', '/tranProcessInfo/selectTranProcessInfo', {
  262. feedbackFlag: 1,
  263. currentPage: 1,
  264. pageSize: 1
  265. }).then(res => {
  266. if (res.data.code == 200) {
  267. this.ysFNumber = res.data.data.total
  268. }
  269. })
  270. // 收货执行中
  271. this.$api.doRequest('get', '/tranProcessInfo/selectTranProcessInfo', {
  272. feedbackFlag: 4,
  273. currentPage: 1,
  274. pageSize: 1
  275. }).then(res => {
  276. if (res.data.code == 200) {
  277. this.ysSNumber = res.data.data.total
  278. }
  279. })
  280. },
  281. methods: {
  282. cancelClick() {
  283. uni.navigateBack(-1)
  284. },
  285. getCompWarehouse() {},
  286. alertBtn1() {
  287. uni.navigateTo({
  288. url: '/pages/public/login'
  289. })
  290. },
  291. cancelClick1() {
  292. this.isShowAlert = false
  293. },
  294. goOpenService() {
  295. if (!this.hasLogin) {
  296. url = '/pages/public/login';
  297. }
  298. uni.navigateTo({
  299. url: '/pages/erp/openService/openService'
  300. })
  301. },
  302. /**
  303. * 统一跳转接口,拦截未登录路由
  304. * navigator标签现在默认没有转场动画,所以用view
  305. */
  306. navTo(url) {
  307. if (!this.hasLogin) {
  308. url = '/pages/public/login';
  309. }
  310. uni.navigateTo({
  311. url
  312. })
  313. },
  314. gridClick(item, index) {
  315. var that = this
  316. if (!this.hasLogin) {
  317. this.isShowAlert1 = true;
  318. // uni.showModal({
  319. // title: '提示',
  320. // content: '您尚未登录,是否立即登录?',
  321. // showCancel: true,
  322. // confirmText: '登录',
  323. // success: (e) => {
  324. // if (e.confirm) {
  325. // uni.navigateTo({
  326. // url: '/pages/public/login'
  327. // })
  328. // }
  329. // },
  330. // fail: () => {},
  331. // complete: () => {}
  332. // })
  333. } else {
  334. if (item.url) {
  335. helper.erpWarehouse = {
  336. warehouseName: this.warehouseName,
  337. binNumber: this.binNumber,
  338. compId: this.compId,
  339. warehouseId: this.warehouseId,
  340. baseId: this.baseId,
  341. allWarehouse: this.allWarehouse,
  342. warehouseCWList: this.warehouseCWList,
  343. positionId: this.positionId,
  344. personCharge: this.personCharge
  345. }
  346. uni.navigateTo({
  347. url: item.url
  348. })
  349. }
  350. }
  351. },
  352. confirmWarehouse() {},
  353. confirmPositon() {},
  354. compChange(e) {
  355. this.compName = this.compList[e[0]].compName
  356. this.init(this.compList[e[0]].compId)
  357. },
  358. init(compId) {
  359. this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelfApp', {
  360. compId: compId,
  361. }).then(res => {
  362. if (res.data.data.length != 0) {
  363. let _showData = uni.getStorageSync("erpSelectWarehous")
  364. let _showCWData = uni.getStorageSync("erpSelectWarehousCW")
  365. this.allWarehouse = res.data.data
  366. this.warehouseList = res.data.data
  367. this.isShowBtn = true
  368. uni.hideLoading()
  369. if (_showData) {
  370. this.warehouseName = _showData.warehouseName
  371. this.compId = _showData.compId
  372. this.agent = _showData.agent
  373. this.binNumber = _showCWData.binNumber
  374. this.warehouseCWList = _showData.positionInfos
  375. this.warehouseId = _showData.id
  376. this.baseId = _showCWData.baseId
  377. this.positionId = _showCWData.id
  378. this.personCharge = _showData.personCharge
  379. } else {
  380. this.allWarehouse = res.data.data
  381. this.warehouseName = res.data.data[0].warehouseName
  382. this.warehouseList = res.data.data;
  383. this.compId = res.data.data[0].compId
  384. this.agent = res.data.data[0].agent
  385. this.warehouseCWList = res.data.data[0].positionInfos
  386. this.binNumber = res.data.data[0].positionInfos ? res.data.data[0].positionInfos[0]
  387. .binNumber : '暂无'
  388. this.warehouseId = res.data.data[0].id
  389. this.baseId = res.data.data[0].positionInfos ? res.data.data[0].positionInfos[0]
  390. .baseId : ''
  391. this.positionId = res.data.data[0].positionInfos ? res.data.data[0].positionInfos[0]
  392. .id : ''
  393. this.personCharge = res.data.data[0].personCharge
  394. }
  395. } else {
  396. uni.hideLoading()
  397. this.warehouseList = []
  398. this.warehouseCWList = []
  399. this.warehouseName = '暂无仓库'
  400. this.binNumber = '暂无'
  401. }
  402. })
  403. },
  404. makeBinNumber() {
  405. },
  406. warehousechange(e) {
  407. this.warehouseName = this.warehouseList[e[0]].warehouseName
  408. this.compId = this.warehouseList[e[0]].compId
  409. this.agent = this.warehouseList[e[0]].agent
  410. this.warehouseId = this.warehouseList[e[0]].id
  411. this.warehouseCWList = this.warehouseList[e[0]].positionInfos
  412. uni.setStorageSync('erpSelectWarehous', this.warehouseList[e[0]])
  413. this.warehouseCWchange([0])
  414. },
  415. warehouseCWchange(e) {
  416. this.binNumber = this.warehouseCWList ? this.warehouseCWList[e[0]].binNumber : '暂无'
  417. this.baseId = this.warehouseCWList ? this.warehouseCWList[e[0]].baseId : ''
  418. this.positionId = this.warehouseCWList ? this.warehouseCWList[e[0]].id : ''
  419. uni.setStorageSync('erpSelectWarehousCW', this.warehouseCWList ? this.warehouseCWList[e[0]] : '')
  420. }
  421. }
  422. }
  423. </script>
  424. <style lang='scss' scoped>
  425. page {
  426. background: #F5F6FA;
  427. }
  428. .container {
  429. padding-top: 85px;
  430. padding-top: 35px;
  431. background-color: #F5F6FA;
  432. position: relative;
  433. width: 100vw;
  434. height: 100vh;
  435. overflow: hidden;
  436. background: url('~@/static/img/login/bg_slices/bg@3x.png');
  437. background-size: 100% 100%;
  438. margin: 0 auto;
  439. }
  440. .wrap {
  441. background: #fff;
  442. margin: 10px;
  443. border-radius: 10px;
  444. padding: 10px;
  445. .title {
  446. font-size: 16px;
  447. font-weight: 700;
  448. }
  449. }
  450. .cu-list {
  451. /* height: 483rpx;
  452. overflow-y: scroll; */
  453. background: transparent;
  454. }
  455. .cu-list.grid.no-border {
  456. padding: 0;
  457. }
  458. .grid {
  459. display: flex;
  460. align-items: center;
  461. flex-wrap: wrap;
  462. /* border-top: 2upx solid rgba(172,172,172,.2); */
  463. .grid-item-3 {
  464. box-sizing: border-box;
  465. width: calc(100% / 3);
  466. border-bottom: 2upx solid rgba(172, 172, 172, .2);
  467. border-right: 2upx solid rgba(172, 172, 172, .2);
  468. text-align: center;
  469. padding: 40upx 0;
  470. position: relative;
  471. /* view{
  472. font-size: $font-sm;
  473. margin-top: 16upx;
  474. color: $font-color-dark;
  475. } */
  476. .grid_icon {
  477. font-size: 48upx;
  478. margin-bottom: 18upx;
  479. color: #fa436a;
  480. }
  481. .tip_text {
  482. display: block;
  483. padding: 4upx 8upx;
  484. text-align: center;
  485. border-radius: 36upx;
  486. font-size: 24upx;
  487. background-color: #fa436a;
  488. color: rgba(255, 255, 255, 1);
  489. position: absolute;
  490. right: 6upx;
  491. top: 6upx;
  492. }
  493. }
  494. .grid-item-3:nth-child(3n + 3),
  495. .grid-item-4:nth-child(4n + 4) {
  496. border-right: none;
  497. }
  498. }
  499. .sign {
  500. width: 40px;
  501. height: 40px;
  502. top: 4px;
  503. margin-right: 6px;
  504. }
  505. .dropdown {
  506. display: flex;
  507. margin: 20rpx 0;
  508. justify-content: space-between;
  509. border-bottom: 1px solid #EEEEEE;
  510. padding-bottom: 20rpx;
  511. .left,
  512. .right {
  513. display: flex;
  514. align-items: center;
  515. }
  516. }
  517. .comp {
  518. display: flex;
  519. font-size: 36rpx;
  520. font-weight: 500;
  521. color: #333333;
  522. margin-bottom: 20rpx;
  523. padding-bottom: 20rpx;
  524. font-weight: 700;
  525. border-bottom: 1px solid #EEEEEE;
  526. }
  527. .-model__title {
  528. background: red;
  529. color: red;
  530. }
  531. .ys-item {
  532. position: relative;
  533. .ys-number {
  534. color: #fff;
  535. border: 1px solid #fff;
  536. background-color: #FF6600;
  537. display: inline-block;
  538. padding: .25em .25em;
  539. position: absolute;
  540. font-size: 9px;
  541. font-weight: 700;
  542. line-height: 1;
  543. text-align: center;
  544. white-space: nowrap;
  545. vertical-align: top;
  546. right: 20px;
  547. top: -5px;
  548. z-index: 2;
  549. border-radius: 50%;
  550. width: 40rpx;
  551. }
  552. }
  553. </style>