index.vue 13 KB

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