index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  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:uni.getStorageSync('compName1')? uni.getStorageSync('compName1').company:'',
  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. if(this.compName){
  334. for (var i = 0; i < res.data.data.length; i++) {
  335. if(res.data.data[i].compName==this.compName){
  336. this.init(res.data.data[i].compId)
  337. }
  338. }
  339. }else{
  340. this.compName = res.data.data[0].compName
  341. this.init(res.data.data[0].compId)
  342. }
  343. }
  344. })
  345. // 发货执行中
  346. this.$api.doRequest('get', '/tranProcessInfo/selectTranProcessInfo', {
  347. feedbackFlag: 1,
  348. currentPage: 1,
  349. pageSize: 1
  350. }).then(res => {
  351. if (res.data.code == 200) {
  352. this.ysFNumber = res.data.data.total
  353. }
  354. })
  355. // 收货执行中
  356. this.$api.doRequest('get', '/tranProcessInfo/selectTranProcessInfo', {
  357. feedbackFlag: 4,
  358. currentPage: 1,
  359. pageSize: 1
  360. }).then(res => {
  361. if (res.data.code == 200) {
  362. this.ysSNumber = res.data.data.total
  363. }
  364. })
  365. },
  366. methods: {
  367. cancelClick() {
  368. uni.navigateBack(-1)
  369. },
  370. getCompWarehouse() {},
  371. alertBtn1() {
  372. uni.navigateTo({
  373. url: '/pages/public/login'
  374. })
  375. },
  376. cancelClick1() {
  377. this.isShowAlert = false
  378. },
  379. goOpenService() {
  380. if (!this.hasLogin) {
  381. url = '/pages/public/login';
  382. }
  383. uni.navigateTo({
  384. url: '/pages/erp/openService/openService'
  385. })
  386. },
  387. /**
  388. * 统一跳转接口,拦截未登录路由
  389. * navigator标签现在默认没有转场动画,所以用view
  390. */
  391. navTo(url) {
  392. if (!this.hasLogin) {
  393. url = '/pages/public/login';
  394. }
  395. uni.navigateTo({
  396. url
  397. })
  398. },
  399. gridClick(item, index) {
  400. var that = this
  401. if (!this.hasLogin) {
  402. this.isShowAlert1 = true;
  403. // uni.showModal({
  404. // title: '提示',
  405. // content: '您尚未登录,是否立即登录?',
  406. // showCancel: true,
  407. // confirmText: '登录',
  408. // success: (e) => {
  409. // if (e.confirm) {
  410. // uni.navigateTo({
  411. // url: '/pages/public/login'
  412. // })
  413. // }
  414. // },
  415. // fail: () => {},
  416. // complete: () => {}
  417. // })
  418. } else {
  419. if (item.url) {
  420. helper.erpWarehouse = {
  421. warehouseName: this.warehouseName,
  422. binNumber: this.binNumber,
  423. compId: this.compId,
  424. warehouseId: this.warehouseId,
  425. baseId: this.baseId,
  426. allWarehouse: this.allWarehouse,
  427. warehouseCWList: this.warehouseCWList,
  428. positionId: this.positionId,
  429. personCharge: this.personCharge
  430. }
  431. uni.navigateTo({
  432. url: item.url
  433. })
  434. }
  435. }
  436. },
  437. confirmWarehouse() {},
  438. confirmPositon() {},
  439. compChange(e) {
  440. this.compName = this.compList[e[0]].compName
  441. this.init(this.compList[e[0]].compId)
  442. },
  443. init(compId) {
  444. this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelfNew', {
  445. compId: compId,
  446. }).then(res => {
  447. if (res.data.data.length != 0) {
  448. let _showData = uni.getStorageSync("erpSelectWarehous")
  449. let _showCWData = uni.getStorageSync("erpSelectWarehousCW")
  450. this.allWarehouse = res.data.data
  451. this.warehouseList = res.data.data
  452. this.isShowBtn = true
  453. uni.hideLoading()
  454. if (_showData) {
  455. this.warehouseName = _showData.warehouseName
  456. this.compId = _showData.compId
  457. this.agent = _showData.agent
  458. this.binNumber = _showCWData.binNumber
  459. this.warehouseCWList = _showData.positionInfos
  460. this.warehouseId = _showData.id
  461. this.baseId = _showCWData.baseId
  462. this.positionId = _showCWData.id
  463. this.personCharge = _showData.personCharge
  464. } else {
  465. this.allWarehouse = res.data.data
  466. this.warehouseName = res.data.data[0].warehouseName
  467. this.warehouseList = res.data.data;
  468. this.compId = res.data.data[0].compId
  469. this.agent = res.data.data[0].agent
  470. this.warehouseCWList = res.data.data[0].positionInfos
  471. this.binNumber = res.data.data[0].positionInfos ? res.data.data[0].positionInfos[0]
  472. .binNumber : '暂无'
  473. this.warehouseId = res.data.data[0].id
  474. this.baseId = res.data.data[0].positionInfos ? res.data.data[0].positionInfos[0]
  475. .baseId : ''
  476. this.positionId = res.data.data[0].positionInfos ? res.data.data[0].positionInfos[0]
  477. .id : ''
  478. this.personCharge = res.data.data[0].personCharge
  479. }
  480. } else {
  481. uni.hideLoading()
  482. this.warehouseList = []
  483. this.warehouseCWList = []
  484. this.warehouseName = '暂无仓库'
  485. this.binNumber = '暂无'
  486. }
  487. })
  488. },
  489. makeBinNumber() {
  490. },
  491. warehousechange(e) {
  492. this.warehouseName = this.warehouseList[e[0]].warehouseName
  493. this.compId = this.warehouseList[e[0]].compId
  494. this.agent = this.warehouseList[e[0]].agent
  495. this.warehouseId = this.warehouseList[e[0]].id
  496. this.warehouseCWList = this.warehouseList[e[0]].positionInfos
  497. uni.setStorageSync('erpSelectWarehous', this.warehouseList[e[0]])
  498. this.warehouseCWchange([0])
  499. },
  500. warehouseCWchange(e) {
  501. this.binNumber = this.warehouseCWList ? this.warehouseCWList[e[0]].binNumber : '暂无'
  502. this.baseId = this.warehouseCWList ? this.warehouseCWList[e[0]].baseId : ''
  503. this.positionId = this.warehouseCWList ? this.warehouseCWList[e[0]].id : ''
  504. uni.setStorageSync('erpSelectWarehousCW', this.warehouseCWList ? this.warehouseCWList[e[0]] : '')
  505. }
  506. }
  507. }
  508. </script>
  509. <style lang='scss' scoped>
  510. page {
  511. background: #F5F6FA;
  512. }
  513. .container {
  514. padding-top: 85px;
  515. padding-top: 35px;
  516. background-color: #F5F6FA;
  517. position: relative;
  518. width: 100vw;
  519. height: 100vh;
  520. overflow: hidden;
  521. background: url('~@/static/img/login/bg_slices/bg@3x.png');
  522. background-size: 100% 100%;
  523. margin: 0 auto;
  524. }
  525. .wrap {
  526. background: #fff;
  527. margin: 10px;
  528. border-radius: 10px;
  529. padding: 10px;
  530. .title {
  531. font-size: 16px;
  532. font-weight: 700;
  533. }
  534. }
  535. .cu-list {
  536. /* height: 483rpx;
  537. overflow-y: scroll; */
  538. background: transparent;
  539. }
  540. .cu-list.grid.no-border {
  541. padding: 0;
  542. }
  543. .grid {
  544. display: flex;
  545. align-items: center;
  546. flex-wrap: wrap;
  547. /* border-top: 2upx solid rgba(172,172,172,.2); */
  548. .grid-item-3 {
  549. box-sizing: border-box;
  550. width: calc(100% / 3);
  551. border-bottom: 2upx solid rgba(172, 172, 172, .2);
  552. border-right: 2upx solid rgba(172, 172, 172, .2);
  553. text-align: center;
  554. padding: 40upx 0;
  555. position: relative;
  556. /* view{
  557. font-size: $font-sm;
  558. margin-top: 16upx;
  559. color: $font-color-dark;
  560. } */
  561. .grid_icon {
  562. font-size: 48upx;
  563. margin-bottom: 18upx;
  564. color: #fa436a;
  565. }
  566. .tip_text {
  567. display: block;
  568. padding: 4upx 8upx;
  569. text-align: center;
  570. border-radius: 36upx;
  571. font-size: 24upx;
  572. background-color: #fa436a;
  573. color: rgba(255, 255, 255, 1);
  574. position: absolute;
  575. right: 6upx;
  576. top: 6upx;
  577. }
  578. }
  579. .grid-item-3:nth-child(3n + 3),
  580. .grid-item-4:nth-child(4n + 4) {
  581. border-right: none;
  582. }
  583. }
  584. .sign {
  585. width: 40px;
  586. height: 40px;
  587. top: 4px;
  588. /* margin-right: 6px; */
  589. }
  590. .dropdown {
  591. display: flex;
  592. margin: 20rpx 0;
  593. justify-content: space-between;
  594. border-bottom: 1px solid #EEEEEE;
  595. padding-bottom: 20rpx;
  596. .left,
  597. .right {
  598. display: flex;
  599. align-items: center;
  600. }
  601. }
  602. .comp {
  603. display: flex;
  604. font-size: 36rpx;
  605. font-weight: 500;
  606. color: #333333;
  607. margin-bottom: 20rpx;
  608. padding-bottom: 20rpx;
  609. font-weight: 700;
  610. border-bottom: 1px solid #EEEEEE;
  611. }
  612. .-model__title {
  613. background: red;
  614. color: red;
  615. }
  616. .ys-item {
  617. position: relative;
  618. .ys-number {
  619. color: #fff;
  620. border: 1px solid #fff;
  621. background-color: #FF6600;
  622. display: inline-block;
  623. padding: .25em .25em;
  624. position: absolute;
  625. font-size: 9px;
  626. font-weight: 700;
  627. line-height: 1;
  628. text-align: center;
  629. white-space: nowrap;
  630. vertical-align: top;
  631. right: 20px;
  632. top: -5px;
  633. z-index: 2;
  634. border-radius: 50%;
  635. width: 40rpx;
  636. }
  637. }
  638. </style>