main.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. <template>
  2. <view>
  3. <view class="head">
  4. <view class="header-wrap">
  5. <view class="index-header">
  6. <view class="map-wrap"></view>
  7. <view class="input-wrap">
  8. <text class="iconfont">仓库管理</text>
  9. </view>
  10. <view class="map-wrap"></view>
  11. </view>
  12. </view>
  13. <view class="blank"></view>
  14. </view>
  15. <view class="uni-padding-wrap uni-common-mt">
  16. <view class="button-sp-area">
  17. <button type="success" @click="groupDisk()" style="
  18. border-radius: 50%;width: 95px;
  19. height: 95px;margin: auto;text-align: center;
  20. line-height: 95px;background-color: #4bbf73;
  21. color:#ffffff;margin-top:16px;font-size: 15px;" class="button">
  22. 组盘
  23. </button>
  24. <!--
  25. <button type="success" @click="emergencyDisk()" style="
  26. border-radius: 50%;width: 95px;
  27. height: 95px;margin: auto;text-align: center;
  28. line-height: 95px;background-color: #4bbf73;
  29. color:#ffffff;font-size: 16px;" class="button">
  30. 超限管理
  31. </button>
  32. <br>
  33. <button type="success" @click="emptyDisk()" style="
  34. border-radius: 50%;width: 95px;
  35. height: 95px;margin: auto;text-align: center;
  36. line-height: 95px;background-color: #4bbf73;
  37. color:#ffffff;font-size: 16px;" class="button">
  38. 空托入库
  39. </button>
  40. <br>
  41. <button type="success" @click="sortingDisk()" style="
  42. border-radius: 50%;width: 95px;
  43. height: 95px;margin: auto;text-align: center;
  44. line-height: 95px;background-color: #4bbf73;
  45. color:#ffffff;font-size: 16px;" class="button">
  46. 分拣入库
  47. </button>
  48. -->
  49. <br>
  50. <button type="primary" @click="sorting_out()" style="border-radius: 50%;width: 95px;
  51. height: 95px;margin: auto;text-align: center;
  52. line-height: 95px;border-color: #0039a6;font-size: 16px;" class="button">
  53. 出库</button>
  54. <!-- <br>
  55. <button type="primary" @click="container()" style="border-radius: 50%;width: 95px;
  56. height: 95px;margin: auto;text-align: center;
  57. line-height: 95px;border-color: #0039a6;font-size: 16px;" class="button">
  58. 容器管理</button> -->
  59. <br>
  60. <button type="primary" @click="batch()" style="border-radius: 50%;width: 95px;
  61. height: 95px;margin: auto;text-align: center;
  62. line-height: 95px;border-color: #4bbf73;font-size: 16px;" class="button">
  63. 批次管理</button>
  64. <br>
  65. <button type="primary" @click="task()" style="border-radius: 50%;width: 95px;
  66. height: 95px;margin: auto;text-align: center;
  67. line-height: 95px;border-color: #0039a6;font-size: 16px;" class="button">
  68. 任务管理</button>
  69. <br>
  70. <!-- <button type="success" @click="moveError()" style="
  71. border-radius: 50%;width: 95px;
  72. height: 95px;margin: auto;text-align: center;
  73. line-height: 95px;background-color: #4bbf73;
  74. color:#ffffff;margin-top:16px;font-size: 15px;" class="button">
  75. 任务处理
  76. </button> -->
  77. </view>
  78. </view>
  79. <view>
  80. <!-- 提示窗示例 -->
  81. <uni-popup ref="alertDialog" type="dialog">
  82. <uni-popup-dialog type="info" cancelText="忽略" confirmText="确定" title="提示" :content="tips"
  83. @confirm="dialogConfirm" @close="dialogClose"></uni-popup-dialog>
  84. </uni-popup>
  85. </view>
  86. </view>
  87. </template>
  88. <script>
  89. let _this = null;
  90. let reqRootUrl = plus.storage.getItem("reqRootUrl");
  91. export default {
  92. data() {
  93. return {
  94. title: 'button',
  95. loading: false,
  96. tips: "",
  97. timer: null, // 定时器
  98. }
  99. },
  100. onLoad() {
  101. this._timer = null;
  102. _this = this;
  103. },
  104. onShow() {
  105. this.clearTimer();
  106. this._timer = setTimeout(() => {
  107. this.loading = true;
  108. _this.GetUseErpStatus();
  109. }, 300)
  110. },
  111. onUnload() {
  112. this.clearTimer();
  113. this.loading = false;
  114. },
  115. methods: {
  116. openTypeError(error) {
  117. console.error('open-type error:', error);
  118. },
  119. clearTimer() {
  120. if (this._timer != null) {
  121. clearTimeout(this._timer);
  122. }
  123. },
  124. groupDisk: function() {
  125. setTimeout(() => {
  126. uni.vibrateShort();
  127. uni.navigateTo({
  128. url: '/pages/sample/group',
  129. })
  130. }, 500);
  131. },
  132. emergencyDisk: function() {
  133. setTimeout(() => {
  134. uni.vibrateShort();
  135. uni.navigateTo({
  136. url: '/pages/sample/emergency',
  137. })
  138. }, 500);
  139. },
  140. sortingDisk: function() {
  141. setTimeout(() => {
  142. uni.vibrateShort();
  143. uni.navigateTo({
  144. url: '/pages/sample/sorting',
  145. })
  146. }, 500);
  147. },
  148. emptyDisk: function() {
  149. setTimeout(() => {
  150. uni.vibrateShort();
  151. uni.navigateTo({
  152. url: '/pages/sample/empty',
  153. })
  154. }, 500);
  155. },
  156. planGroupDisk: function() {
  157. setTimeout(() => {
  158. uni.vibrateShort();
  159. uni.navigateTo({
  160. url: '/pages/sample/plan_group',
  161. })
  162. }, 500);
  163. },
  164. sorting_out: function(code) {
  165. setTimeout(() => {
  166. uni.vibrateShort();
  167. uni.navigateTo({
  168. // url: '/pages/sample/tts',
  169. url: '/pages/sample/sorting_out',
  170. })
  171. }, 500);
  172. },
  173. container: function(code) {
  174. setTimeout(() => {
  175. uni.vibrateShort();
  176. uni.navigateTo({
  177. // url: '/pages/sample/tts',
  178. url: '/pages/sample/container',
  179. })
  180. }, 500);
  181. },
  182. task: function(code) {
  183. setTimeout(() => {
  184. uni.vibrateShort();
  185. uni.navigateTo({
  186. // url: '/pages/sample/tts',
  187. url: '/pages/sample/task',
  188. })
  189. }, 500);
  190. },
  191. batch: function(code) {
  192. setTimeout(() => {
  193. uni.vibrateShort();
  194. uni.navigateTo({
  195. // url: '/pages/sample/tts',
  196. url: '/pages/sample/batch',
  197. })
  198. }, 500);
  199. },
  200. InStore: function(code) {
  201. setTimeout(() => {
  202. uni.vibrateShort();
  203. uni.navigateTo({
  204. url: '/pages/sample/InStore',
  205. })
  206. }, 500);
  207. },
  208. moveError: function(code) {
  209. setTimeout(() => {
  210. uni.vibrateShort();
  211. uni.navigateTo({
  212. url: '/pages/sample/moveError',
  213. })
  214. }, 500);
  215. },
  216. GetUseErpStatus() {
  217. // console.log("daaa")
  218. uni.request({
  219. url: reqRootUrl + '/wms/api',
  220. method: 'POST',
  221. headers: {
  222. 'Content-Type': 'application/json'
  223. },
  224. data: JSON.stringify({
  225. "method": "GetUseErpStatus",
  226. "param": {}
  227. }),
  228. success: (ret) => {
  229. //处理成功逻辑
  230. uni.setStorageSync("UseErpStatus", ret.data.data)
  231. },
  232. })
  233. },
  234. dialogConfirm() {
  235. setTimeout(() => {
  236. // this.$refs.alertDialog.close()
  237. clearInterval(this.timer);
  238. this.timer = null;
  239. uni.navigateTo({
  240. url: '/pages/sample/moveError',
  241. })
  242. }, 30)
  243. },
  244. dialogClose() {
  245. clearInterval(this.timer);
  246. this.timer = null;
  247. },
  248. isEmpty: function(obj) {
  249. return typeof obj === undefined || obj == null || obj === "" || obj ===
  250. "000000000000000000000000" ||
  251. obj.length === 0;
  252. },
  253. }
  254. }
  255. </script>
  256. <style>
  257. button {
  258. margin-top: 30rpx;
  259. margin-bottom: 30rpx;
  260. }
  261. .button-sp-area {
  262. margin: 0 auto;
  263. width: 60%;
  264. }
  265. .mini-btn {
  266. margin-right: 10rpx;
  267. }
  268. .button {
  269. background-color: #4CAF50;
  270. /* 设置背景色 */
  271. color: white;
  272. /* 设置文字颜色 */
  273. text-align: center;
  274. border-radius: 6px;
  275. /* 添加边角半径 */
  276. box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  277. /* 添加阴影效果 */
  278. transition: all 0.3s ease;
  279. /* 过渡动画时间为0.3秒 */
  280. }
  281. .button:hover {
  282. transform: scale(1.1);
  283. /* 当鼠标悬停在按钮上时放大到原始比例的1.1倍 */
  284. }
  285. </style>
  286. <style lang="scss">
  287. $color-base: #0039a6;
  288. $words-color-base: #333333;
  289. $words-color-light: #999999;
  290. .header-wrap {
  291. width: 100%;
  292. position: fixed;
  293. top: 0;
  294. z-index: 999;
  295. .index-header {
  296. height: 88upx;
  297. line-height: 88upx;
  298. padding: 0 30upx;
  299. padding-top: 40upx;
  300. background-color: $color-base;
  301. font-Size: 28upx;
  302. color: #fff;
  303. display: flex;
  304. align-items: center;
  305. justify-content: space-between;
  306. .fanhui {
  307. color: #fff !important;
  308. font-size: 28px;
  309. padding-top: 5px;
  310. font-weight: 700;
  311. }
  312. .lanya {
  313. color: #fff !important;
  314. font-size: 28px;
  315. padding-top: 5px;
  316. }
  317. .map-wrap {
  318. padding-top: 5px;
  319. }
  320. }
  321. }
  322. .blank {
  323. height: 126upx;
  324. }
  325. </style>