move.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. <template>
  2. <view class="content">
  3. <view class="">
  4. <view class="confirm-view">
  5. <text class="text">起始点位:</text>
  6. <!-- focus -->
  7. <uni-easyinput
  8. style="margin: 0 11px"
  9. errorMessage
  10. v-model="sourceLocationId"
  11. :adjust-position="false"
  12. :class="recshow ? 'rec' : ''"
  13. class="uni-mt-5"
  14. trim="all"
  15. @focus="focusFunc"
  16. placeholder-style="font-size:16px;color: #a7a7a7;"
  17. placeholder="请输入起始点位"
  18. @input="input"></uni-easyinput>
  19. <button
  20. type="default"
  21. @click="goto('/pages/Warehousing/select/index?show=1')">
  22. 选择
  23. </button>
  24. </view>
  25. <view class="confirm-view">
  26. <text class="text">终点点位:</text>
  27. <!-- focus -->
  28. <uni-easyinput
  29. style="margin: 0 11px"
  30. errorMessage
  31. v-model="targetLocationId"
  32. :class="recshowto ? 'rec' : ''"
  33. :adjust-position="false"
  34. @focus="focusFunvac"
  35. placeholder-style="font-size:16px;color: #a7a7a7;"
  36. placeholder="请输入终点点位"
  37. @input="inputEimt"></uni-easyinput>
  38. <button
  39. type="default"
  40. @click="goto('/pages/Warehousing/select/index?show=2')">
  41. 选择
  42. </button>
  43. </view>
  44. </view>
  45. <view class="border-buttons" @click="subfeom">
  46. <view class="buttons2">
  47. <text>移动</text>
  48. </view>
  49. </view>
  50. <xw-scan></xw-scan>
  51. </view>
  52. </template>
  53. <script>
  54. import { moveLocInv } from "@/libs/http/index.js";
  55. export default {
  56. data() {
  57. return {
  58. valueSian: "",
  59. curNow: 0,
  60. nameOut: "起始点位",
  61. valueSianid: "",
  62. recshow: false,
  63. sourceLocationIdcode: "",
  64. targetLocationIdcode: "",
  65. host: "",
  66. rangeValue: "in",
  67. sourceLocationId: "",
  68. targetLocationId: "",
  69. recshowminu: false,
  70. recshowto: false,
  71. type: "center",
  72. msgType: "success",
  73. messageText: "这是一条成功提示",
  74. value: "in",
  75. rangeValueto: "",
  76. value3: "",
  77. testdata: {},
  78. };
  79. },
  80. onShow() {
  81. let that = this;
  82. let pages = getCurrentPages();
  83. let currPage = pages[pages.length - 1];
  84. console.log("json", currPage.testdata);
  85. let json = currPage._data.testdata;
  86. this.testdata = json;
  87. },
  88. onUnload() {
  89. uni.$off("xwscan");
  90. },
  91. mounted() {
  92. let _this = this;
  93. uni.getStorage({
  94. key: "hostappst",
  95. success(res) {
  96. console.log("获取成功", res.data);
  97. _this.host = res.data;
  98. },
  99. });
  100. },
  101. methods: {
  102. otherFun(obj) {
  103. console.log(obj);
  104. if (obj.show == 1) {
  105. this.sourceLocationId = obj.locationNo;
  106. this.sourceLocationIdcode = obj.id;
  107. } else if (obj.show == 2) {
  108. this.targetLocationId = obj.locationNo;
  109. this.targetLocationIdcode = obj.id;
  110. }
  111. },
  112. focusFunc(e) {
  113. this.recshow = true;
  114. this.recshowto = false;
  115. uni.$off("xwscan");
  116. uni.$on("xwscan", (res) => {
  117. console.log("扫码结果:", res.code);
  118. this.sourceLocationId = res.code;
  119. this.sourceLocationIdcode = res.code;
  120. });
  121. console.log("focus事件");
  122. },
  123. sectionChange(index) {
  124. console.log("index", index);
  125. this.curNow = index;
  126. },
  127. focusFunvac(e) {
  128. this.recshow = false;
  129. this.recshowto = true;
  130. uni.$off("xwscan");
  131. uni.$on("xwscan", (res) => {
  132. console.log("扫码结果:", res.code);
  133. this.targetLocationId = res.code;
  134. this.targetLocationIdcode = res.code;
  135. });
  136. console.log("focus事件");
  137. },
  138. goto(data) {
  139. uni.navigateTo({
  140. url: data,
  141. });
  142. },
  143. input(e) {
  144. console.log(e);
  145. this.sourceLocationIdcode = e;
  146. },
  147. inputEimt(e) {
  148. this.targetLocationIdcode = e;
  149. },
  150. async subfeom() {
  151. let dataobj = {
  152. sourceLocationId: this.sourceLocationIdcode,
  153. targetLocationId: this.targetLocationIdcode,
  154. };
  155. let that = this;
  156. uni.getStorage({
  157. key: "GetPhone_Token",
  158. success: function (res) {
  159. // 恢复请求
  160. uni.request({
  161. url: `http://${that.host}` + "/ams/invLotLocId/moveLocInv",
  162. header: {
  163. Authorization: res.data,
  164. },
  165. method: "POST",
  166. data: dataobj,
  167. success(res) {
  168. console.log("chaoShiPanDuan", res);
  169. if (res.data.code == 200) {
  170. uni.showToast({
  171. title: res.data.msg,
  172. icon: "none",
  173. duration: 2000,
  174. });
  175. setTimeout(() => {
  176. uni.navigateTo({
  177. url: "/pages/index/tabbar/tabbar",
  178. });
  179. }, 1000);
  180. } else {
  181. uni.showToast({
  182. title: res.data.msg,
  183. icon: "none",
  184. });
  185. }
  186. },
  187. });
  188. },
  189. });
  190. // let res = await moveLocInv(dataobj);
  191. },
  192. inputDialogToggle() {
  193. this.$refs.inputDialog.open();
  194. },
  195. radioChange(val) {
  196. console.log(val);
  197. this.targetLocationId = val;
  198. },
  199. },
  200. };
  201. </script>
  202. <style scoped>
  203. /deep/.uni-select {
  204. font-size: 16px;
  205. border: 1px solid #e5e5e5;
  206. box-sizing: border-box;
  207. border-radius: 4px;
  208. padding: 13px 5px;
  209. padding-left: 10px;
  210. position: relative;
  211. display: flex;
  212. -webkit-user-select: none;
  213. user-select: none;
  214. flex-direction: row;
  215. align-items: center;
  216. border-bottom: solid 1px #e5e5e5;
  217. width: 100%;
  218. flex: 1;
  219. height: 35px;
  220. }
  221. /deep/.uni-select__input-placeholder {
  222. color: #6a6a6a;
  223. font-size: 16px;
  224. }
  225. /deep/.uni-icons {
  226. font-family: uniicons;
  227. text-decoration: none;
  228. text-align: center;
  229. font-size: 20px !important;
  230. }
  231. /deep/.u-subsection__item__text {
  232. font-size: 12px;
  233. line-height: 12px;
  234. display: flex;
  235. flex-direction: row;
  236. font-size: 15px !important;
  237. align-items: center;
  238. transition-property: color;
  239. transition-duration: 0.3s;
  240. }
  241. /deep/.is-input-border {
  242. display: flex;
  243. box-sizing: border-box;
  244. flex-direction: row;
  245. align-items: center;
  246. border-radius: 4px;
  247. background-color: rgb(245 245 245) !important;
  248. /* background: #24bdbd; */
  249. }
  250. /deep/.u-radio-label--right {
  251. flex-direction: row-reverse;
  252. justify-content: space-between;
  253. margin-bottom: 12px;
  254. }
  255. /deep/uni-button {
  256. color: #000;
  257. border: 1px solid #ff0000;
  258. border-radius: 31px;
  259. width: 21%;
  260. background-color: #f5f5f5;
  261. height: 42px;
  262. font-size: 16px;
  263. color: #ff0000;
  264. }
  265. /deep/.uni-easyinput__content-input[data-v-abe12412] {
  266. width: auto;
  267. position: relative;
  268. overflow: hidden;
  269. flex: 1;
  270. line-height: 1;
  271. font-size: 14px;
  272. height: 35px;
  273. /* border-bottom: 1px solid #ff0000 !important; */
  274. }
  275. /deep/.is-input-border {
  276. display: flex;
  277. box-sizing: border-box;
  278. flex-direction: row;
  279. align-items: center;
  280. border: none !important;
  281. border-radius: 4px;
  282. }
  283. </style>
  284. <style lang="scss" scoped>
  285. .content {
  286. // padding: 15px;
  287. .confirm-view {
  288. display: flex;
  289. padding: 15px;
  290. margin: 5px 0;
  291. align-items: center;
  292. border-bottom: 1px solid #d5d5d5;
  293. height: 56px;
  294. .text {
  295. font-size: 16px;
  296. color: #6e6860;
  297. font-weight: 500;
  298. }
  299. }
  300. .confirm-views {
  301. .title {
  302. display: flex;
  303. justify-content: space-between;
  304. font-size: 15px;
  305. color: #525151;
  306. padding: 15px;
  307. margin: 5px 0;
  308. align-items: center;
  309. border-bottom: 1px solid #d5d5d5;
  310. height: 56px;
  311. .view_icon {
  312. display: flex;
  313. align-content: center;
  314. align-items: center;
  315. }
  316. }
  317. }
  318. .border-buttons {
  319. display: flex;
  320. position: absolute;
  321. button: 0;
  322. bottom: 32px;
  323. padding: 0 15px;
  324. justify-content: space-between;
  325. width: 100%;
  326. text-align: center;
  327. .buttons2 {
  328. width: 100%;
  329. border: 1px solid #ff0505;
  330. border-radius: 34px;
  331. height: 42px;
  332. background: red;
  333. display: flex;
  334. justify-content: center;
  335. align-items: center;
  336. font-size: 18px;
  337. color: white;
  338. font-weight: 500;
  339. }
  340. }
  341. }
  342. </style>