index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659
  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: 2,
  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: 3,
  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/warehouse/acquisitionInspection/acquisitionInspection',
  197. url: '/pages/erp/exWarehousing/exWarehousing',
  198. show: true
  199. },
  200. {
  201. num: 3,
  202. name: '出库质检',
  203. // icon: 'cuIcon-edit',
  204. src: '../../static/img/erp/shougouzhijian@3x.png',
  205. tips: 0,
  206. url: `/pages/warehouse/quality_testing?managementType=1`,
  207. show: true
  208. }
  209. // {
  210. // num: 4,
  211. // name: '开通业务',
  212. // // icon: 'cuIcon-edit',
  213. // src: '../../static/img/erp/shougouzhijian@3x.png',
  214. // tips: 0,
  215. // url: `/pages/erp/openService/openService`,
  216. // show: true
  217. // },
  218. // {
  219. // num: 5,
  220. // name: '联系客服',
  221. // // icon: 'cuIcon-edit',
  222. // src: '../../static/img/erp/shougouzhijian@3x.png',
  223. // tips: 0,
  224. // url: `/pages/erp/contactCustomerService/contactCustomerService`,
  225. // show: true
  226. // }
  227. ],
  228. gridList1: [{
  229. num: 0,
  230. name: '发货反馈',
  231. // icon: 'cuIcon-copy',
  232. src: '../../static/img/erp/delivery@3x.png',
  233. tips: 0,
  234. url: '/pages/erp/deliveryfeedback/list',
  235. show: true
  236. },
  237. {
  238. num: 1,
  239. name: '收货反馈',
  240. // icon: 'cuIcon-edit',
  241. src: '../../static/img/erp/receiving@3x.png',
  242. tips: 0,
  243. url: `/pages/erp/receivingfeedback/list`,
  244. show: true
  245. },
  246. // {
  247. // num: 4,
  248. // name: '开通业务',
  249. // // icon: 'cuIcon-edit',
  250. // src: '../../static/img/erp/shougouzhijian@3x.png',
  251. // tips: 0,
  252. // url: `/pages/erp/openService/openService`,
  253. // show: true
  254. // },
  255. // {
  256. // num: 5,
  257. // name: '联系客服',
  258. // // icon: 'cuIcon-edit',
  259. // src: '../../static/img/erp/shougouzhijian@3x.png',
  260. // tips: 0,
  261. // url: `/pages/erp/contactCustomerService/contactCustomerService`,
  262. // show: true
  263. // }
  264. ],
  265. }
  266. },
  267. onLoad() {},
  268. // #ifndef MP
  269. onNavigationBarButtonTap(e) {
  270. const index = e.index;
  271. if (index === 0) {
  272. this.navTo('/pages/set/set');
  273. } else if (index === 1) {
  274. // #ifdef APP-PLUS
  275. const pages = getCurrentPages();
  276. const page = pages[pages.length - 1];
  277. const currentWebview = page.$getAppWebview();
  278. currentWebview.hideTitleNViewButtonRedDot({
  279. index
  280. });
  281. // #endif
  282. uni.navigateTo({
  283. url: '/pages/notice/notice'
  284. })
  285. }
  286. },
  287. onBackPress() {
  288. uni.switchTab({
  289. url: '/pages/user/user'
  290. });
  291. return true
  292. },
  293. // #endif
  294. computed: {
  295. ...mapState(['hasLogin', 'userInfo']),
  296. },
  297. onShow() {
  298. uni.showLoading({
  299. title:"加载中...",
  300. mask:true
  301. })
  302. this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
  303. if (res.data.data == "INVALID") {
  304. uni.hideLoading()
  305. this.isShowAlert1 = true;
  306. // uni.showModal({
  307. // title: '提示',
  308. // content: '当前登入信息验证失败,是否重新登录?',
  309. // showCancel: true,
  310. // confirmText: '登录',
  311. // success: (e) => {
  312. // if (e.confirm) {
  313. // uni.navigateTo({
  314. // url: '/pages/public/login'
  315. // })
  316. // }
  317. // },
  318. // fail: () => {},
  319. // complete: () => {}
  320. // })
  321. }
  322. })
  323. this.$api.doRequest('get', '/openServiceInfo/selectCommonCompany', {
  324. phone: this.userInfo.phone
  325. }).then(res => {
  326. if (res.data.code == 200) {
  327. if (res.data.data.length == 0) {
  328. this.isShowAlert = true
  329. uni.hideLoading()
  330. } else {
  331. this.isShowAlert = false
  332. }
  333. this.compList = res.data.data
  334. this.compName = res.data.data[0].compName
  335. this.init(res.data.data[0].compId)
  336. }
  337. })
  338. // 发货执行中
  339. this.$api.doRequest('get', '/tranProcessInfo/selectTranProcessInfo', {
  340. feedbackFlag: 1,
  341. currentPage: 1,
  342. pageSize: 1
  343. }).then(res => {
  344. if (res.data.code == 200) {
  345. this.ysFNumber = res.data.data.total
  346. }
  347. })
  348. // 收货执行中
  349. this.$api.doRequest('get', '/tranProcessInfo/selectTranProcessInfo', {
  350. feedbackFlag: 4,
  351. currentPage: 1,
  352. pageSize: 1
  353. }).then(res => {
  354. if (res.data.code == 200) {
  355. this.ysSNumber = res.data.data.total
  356. }
  357. })
  358. },
  359. methods: {
  360. cancelClick() {
  361. uni.navigateBack(-1)
  362. },
  363. getCompWarehouse() {},
  364. alertBtn1() {
  365. uni.navigateTo({
  366. url: '/pages/public/login'
  367. })
  368. },
  369. cancelClick1() {
  370. this.isShowAlert = false
  371. },
  372. goOpenService() {
  373. if (!this.hasLogin) {
  374. url = '/pages/public/login';
  375. }
  376. uni.navigateTo({
  377. url: '/pages/erp/openService/openService'
  378. })
  379. },
  380. /**
  381. * 统一跳转接口,拦截未登录路由
  382. * navigator标签现在默认没有转场动画,所以用view
  383. */
  384. navTo(url) {
  385. if (!this.hasLogin) {
  386. url = '/pages/public/login';
  387. }
  388. uni.navigateTo({
  389. url
  390. })
  391. },
  392. gridClick(item, index) {
  393. var that = this
  394. if (!this.hasLogin) {
  395. this.isShowAlert1 = true;
  396. // uni.showModal({
  397. // title: '提示',
  398. // content: '您尚未登录,是否立即登录?',
  399. // showCancel: true,
  400. // confirmText: '登录',
  401. // success: (e) => {
  402. // if (e.confirm) {
  403. // uni.navigateTo({
  404. // url: '/pages/public/login'
  405. // })
  406. // }
  407. // },
  408. // fail: () => {},
  409. // complete: () => {}
  410. // })
  411. } else {
  412. if (item.url) {
  413. helper.erpWarehouse = {
  414. warehouseName: this.warehouseName,
  415. binNumber: this.binNumber,
  416. compId: this.compId,
  417. warehouseId: this.warehouseId,
  418. baseId: this.baseId,
  419. allWarehouse: this.allWarehouse,
  420. warehouseCWList: this.warehouseCWList,
  421. positionId: this.positionId,
  422. personCharge: this.personCharge
  423. }
  424. uni.navigateTo({
  425. url: item.url
  426. })
  427. }
  428. }
  429. },
  430. confirmWarehouse() {},
  431. confirmPositon() {},
  432. compChange(e) {
  433. this.compName = this.compList[e[0]].compName
  434. this.init(this.compList[e[0]].compId)
  435. },
  436. init(compId) {
  437. this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelfApp', {
  438. compId: compId,
  439. }).then(res => {
  440. if (res.data.data.length != 0) {
  441. let _showData = uni.getStorageSync("erpSelectWarehous")
  442. let _showCWData = uni.getStorageSync("erpSelectWarehousCW")
  443. this.allWarehouse = res.data.data
  444. this.warehouseList = res.data.data
  445. this.isShowBtn = true
  446. uni.hideLoading()
  447. if (_showData) {
  448. this.warehouseName = _showData.warehouseName
  449. this.compId = _showData.compId
  450. this.agent = _showData.agent
  451. this.binNumber = _showCWData.binNumber
  452. this.warehouseCWList = _showData.positionInfos
  453. this.warehouseId = _showData.id
  454. this.baseId = _showCWData.baseId
  455. this.positionId = _showCWData.id
  456. this.personCharge = _showData.personCharge
  457. } else {
  458. this.allWarehouse = res.data.data
  459. this.warehouseName = res.data.data[0].warehouseName
  460. this.warehouseList = res.data.data;
  461. this.compId = res.data.data[0].compId
  462. this.agent = res.data.data[0].agent
  463. this.warehouseCWList = res.data.data[0].positionInfos
  464. this.binNumber = res.data.data[0].positionInfos ? res.data.data[0].positionInfos[0]
  465. .binNumber : '暂无'
  466. this.warehouseId = res.data.data[0].id
  467. this.baseId = res.data.data[0].positionInfos ? res.data.data[0].positionInfos[0]
  468. .baseId : ''
  469. this.positionId = res.data.data[0].positionInfos ? res.data.data[0].positionInfos[0]
  470. .id : ''
  471. this.personCharge = res.data.data[0].personCharge
  472. }
  473. } else {
  474. uni.hideLoading()
  475. this.warehouseList = []
  476. this.warehouseCWList = []
  477. this.warehouseName = '暂无仓库'
  478. this.binNumber = '暂无'
  479. }
  480. })
  481. },
  482. makeBinNumber() {
  483. },
  484. warehousechange(e) {
  485. this.warehouseName = this.warehouseList[e[0]].warehouseName
  486. this.compId = this.warehouseList[e[0]].compId
  487. this.agent = this.warehouseList[e[0]].agent
  488. this.warehouseId = this.warehouseList[e[0]].id
  489. this.warehouseCWList = this.warehouseList[e[0]].positionInfos
  490. uni.setStorageSync('erpSelectWarehous', this.warehouseList[e[0]])
  491. this.warehouseCWchange([0])
  492. },
  493. warehouseCWchange(e) {
  494. this.binNumber = this.warehouseCWList ? this.warehouseCWList[e[0]].binNumber : '暂无'
  495. this.baseId = this.warehouseCWList ? this.warehouseCWList[e[0]].baseId : ''
  496. this.positionId = this.warehouseCWList ? this.warehouseCWList[e[0]].id : ''
  497. uni.setStorageSync('erpSelectWarehousCW', this.warehouseCWList ? this.warehouseCWList[e[0]] : '')
  498. }
  499. }
  500. }
  501. </script>
  502. <style lang='scss' scoped>
  503. page {
  504. background: #F5F6FA;
  505. }
  506. .container {
  507. padding-top: 85px;
  508. padding-top: 35px;
  509. background-color: #F5F6FA;
  510. position: relative;
  511. width: 100vw;
  512. height: 100vh;
  513. overflow: hidden;
  514. background: url('~@/static/img/login/bg_slices/bg@3x.png');
  515. background-size: 100% 100%;
  516. margin: 0 auto;
  517. }
  518. .wrap {
  519. background: #fff;
  520. margin: 10px;
  521. border-radius: 10px;
  522. padding: 10px;
  523. .title {
  524. font-size: 16px;
  525. font-weight: 700;
  526. }
  527. }
  528. .cu-list {
  529. /* height: 483rpx;
  530. overflow-y: scroll; */
  531. background: transparent;
  532. }
  533. .cu-list.grid.no-border {
  534. padding: 0;
  535. }
  536. .grid {
  537. display: flex;
  538. align-items: center;
  539. flex-wrap: wrap;
  540. /* border-top: 2upx solid rgba(172,172,172,.2); */
  541. .grid-item-3 {
  542. box-sizing: border-box;
  543. width: calc(100% / 3);
  544. border-bottom: 2upx solid rgba(172, 172, 172, .2);
  545. border-right: 2upx solid rgba(172, 172, 172, .2);
  546. text-align: center;
  547. padding: 40upx 0;
  548. position: relative;
  549. /* view{
  550. font-size: $font-sm;
  551. margin-top: 16upx;
  552. color: $font-color-dark;
  553. } */
  554. .grid_icon {
  555. font-size: 48upx;
  556. margin-bottom: 18upx;
  557. color: #fa436a;
  558. }
  559. .tip_text {
  560. display: block;
  561. padding: 4upx 8upx;
  562. text-align: center;
  563. border-radius: 36upx;
  564. font-size: 24upx;
  565. background-color: #fa436a;
  566. color: rgba(255, 255, 255, 1);
  567. position: absolute;
  568. right: 6upx;
  569. top: 6upx;
  570. }
  571. }
  572. .grid-item-3:nth-child(3n + 3),
  573. .grid-item-4:nth-child(4n + 4) {
  574. border-right: none;
  575. }
  576. }
  577. .sign {
  578. width: 40px;
  579. height: 40px;
  580. top: 4px;
  581. margin-right: 6px;
  582. }
  583. .dropdown {
  584. display: flex;
  585. margin: 20rpx 0;
  586. justify-content: space-between;
  587. border-bottom: 1px solid #EEEEEE;
  588. padding-bottom: 20rpx;
  589. .left,
  590. .right {
  591. display: flex;
  592. align-items: center;
  593. }
  594. }
  595. .comp {
  596. display: flex;
  597. font-size: 36rpx;
  598. font-weight: 500;
  599. color: #333333;
  600. margin-bottom: 20rpx;
  601. padding-bottom: 20rpx;
  602. font-weight: 700;
  603. border-bottom: 1px solid #EEEEEE;
  604. }
  605. .-model__title {
  606. background: red;
  607. color: red;
  608. }
  609. .ys-item {
  610. position: relative;
  611. .ys-number {
  612. color: #fff;
  613. border: 1px solid #fff;
  614. background-color: #FF6600;
  615. display: inline-block;
  616. padding: .25em .25em;
  617. position: absolute;
  618. font-size: 9px;
  619. font-weight: 700;
  620. line-height: 1;
  621. text-align: center;
  622. white-space: nowrap;
  623. vertical-align: top;
  624. right: 20px;
  625. top: -5px;
  626. z-index: 2;
  627. border-radius: 50%;
  628. width: 40rpx;
  629. }
  630. }
  631. </style>