index.vue 12 KB

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