index.vue 17 KB

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