index.vue 15 KB

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