movement.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. <template>
  2. <view class="content">
  3. <view class="">
  4. <u-subsection
  5. :list="list"
  6. :current="curNow"
  7. active-color="red"
  8. @change="sectionChange"></u-subsection>
  9. </view>
  10. <view class="" v-if="curNow == 0">
  11. <view class="confirm-view">
  12. <text class="text">起始点位:</text>
  13. <!-- focus -->
  14. <uni-easyinput
  15. style="margin: 0 11px"
  16. errorMessage
  17. v-model="sourceLocationId"
  18. :adjust-position="false"
  19. :class="recshow ? 'rec' : ''"
  20. class="uni-mt-5"
  21. trim="all"
  22. @focus="focusFunc"
  23. placeholder-style="font-size:16px;color: #a7a7a7;"
  24. placeholder="请输入起始点位"
  25. @input="input"></uni-easyinput>
  26. <button
  27. type="default"
  28. @click="goto('/pages/Warehousing/select/index?show=1')">
  29. 选择
  30. </button>
  31. </view>
  32. <!-- <view class="confirm-views">
  33. <view class="title" @click="inputDialogToggle">
  34. <view class="">
  35. <text>任务优先级:</text>
  36. </view>
  37. <view class="view_icon">
  38. <text>{{ value }}</text>
  39. <u-icon name="arrow-right" color="#6e6860" size="20"></u-icon>
  40. </view>
  41. </view>
  42. </view> -->
  43. <view class="confirm-view">
  44. <text class="text">终点点位:</text>
  45. <!-- focus -->
  46. <uni-easyinput
  47. style="margin: 0 11px"
  48. errorMessage
  49. v-model="targetLocationId"
  50. :class="recshowto ? 'rec' : ''"
  51. :adjust-position="false"
  52. @focus="focusFunvac"
  53. placeholder-style="font-size:16px;color: #a7a7a7;"
  54. placeholder="请输入终点点位"
  55. @input="inputEimt"></uni-easyinput>
  56. <button
  57. type="default"
  58. @click="goto('/pages/Warehousing/select/index?show=2')">
  59. 选择
  60. </button>
  61. </view>
  62. </view>
  63. <view class="" v-else>
  64. <uni-data-select
  65. v-model="value"
  66. :localdata="range"
  67. @change="change"></uni-data-select>
  68. <view class="confirm-view">
  69. <text class="text">{{ nameOut }}:</text>
  70. <!-- focus -->
  71. <uni-easyinput
  72. style="margin: 0 11px"
  73. errorMessage
  74. v-model="valueSian"
  75. :adjust-position="false"
  76. :class="recshowminu ? 'rec' : ''"
  77. class="uni-mt-5"
  78. trim="all"
  79. @focus="focusFuncemyi"
  80. placeholder-style="font-size:16px;color: #a7a7a7;"
  81. :placeholder="'请输入' + nameOut"
  82. @input="inputSupport"></uni-easyinput>
  83. <button type="default" @click="naviga">选择</button>
  84. </view>
  85. </view>
  86. <view class="border-buttons" @click="subfeom">
  87. <view class="buttons2">
  88. <text>移动</text>
  89. </view>
  90. </view>
  91. <uni-popup ref="inputDialog" type="dialog">
  92. <uni-popup-dialog
  93. ref="inputClose"
  94. title="任务优先级"
  95. value="对话框预置提示内容!"
  96. placeholder="请输入内容"
  97. @confirm="dialogInputConfirm">
  98. <u-radio-group
  99. placement="column"
  100. :borderBottom="true"
  101. v-model="value"
  102. iconPlacement="right">
  103. <u-radio
  104. :customStyle="{ marginBottom: '8px' }"
  105. v-for="(item, index) in radiolist1"
  106. :key="index"
  107. :label="item.name"
  108. :name="item.name"
  109. @change="radioChange"></u-radio>
  110. </u-radio-group>
  111. </uni-popup-dialog>
  112. </uni-popup>
  113. <xw-scan></xw-scan>
  114. </view>
  115. </template>
  116. <script>
  117. export default {
  118. data() {
  119. return {
  120. valueSian: "",
  121. range: [
  122. { value: "out", text: "空托出库" },
  123. { value: "in", text: "空托入库" },
  124. ],
  125. list: [
  126. {
  127. name: "其他移库",
  128. },
  129. {
  130. name: "空托移库",
  131. },
  132. ],
  133. curNow: 0,
  134. nameOut: "起始点位",
  135. valueSianid: "",
  136. recshow: false,
  137. sourceLocationIdcode: "",
  138. targetLocationIdcode: "",
  139. host: "",
  140. rangeValue: "in",
  141. sourceLocationId: "",
  142. targetLocationId: "",
  143. recshowminu: false,
  144. recshowto: false,
  145. type: "center",
  146. msgType: "success",
  147. messageText: "这是一条成功提示",
  148. value: "in",
  149. rangeValueto: "",
  150. value3: "",
  151. testdata: {},
  152. radiolist1: [
  153. {
  154. name: "普通",
  155. disabled: false,
  156. },
  157. {
  158. name: "紧急",
  159. disabled: false,
  160. },
  161. ],
  162. };
  163. },
  164. onShow() {
  165. let that = this;
  166. let pages = getCurrentPages();
  167. let currPage = pages[pages.length - 1];
  168. console.log("json", currPage.testdata);
  169. let json = currPage._data.testdata;
  170. this.testdata = json;
  171. },
  172. onUnload() {
  173. uni.$off("xwscan");
  174. },
  175. mounted() {
  176. let _this = this;
  177. uni.getStorage({
  178. key: "hostappst",
  179. success(res) {
  180. console.log("获取成功", res.data);
  181. _this.host = res.data;
  182. },
  183. });
  184. },
  185. methods: {
  186. otherFun(obj) {
  187. console.log(obj);
  188. if (obj.show == 1) {
  189. this.sourceLocationId = obj.locationNo;
  190. this.sourceLocationIdcode = obj.id;
  191. } else if (obj.show == 2) {
  192. this.targetLocationId = obj.locationNo;
  193. this.targetLocationIdcode = obj.id;
  194. } else if (obj.show == 4) {
  195. this.valueSian = obj.locationNo;
  196. this.valueSianid = obj.id;
  197. }
  198. },
  199. focusFunc(e) {
  200. this.recshow = true;
  201. this.recshowto = false;
  202. uni.$off("xwscan");
  203. uni.$on("xwscan", (res) => {
  204. console.log("扫码结果:", res.code);
  205. this.sourceLocationId = res.code;
  206. this.sourceLocationIdcode = res.code;
  207. });
  208. console.log("focus事件");
  209. },
  210. focusFuncemyi(e) {
  211. this.recshowminu = true;
  212. uni.$off("xwscan");
  213. uni.$on("xwscan", (res) => {
  214. console.log("扫码结果:", res.code);
  215. this.valueSian = res.code;
  216. });
  217. console.log("focus事件");
  218. },
  219. change(e) {
  220. console.log("e", e, "1");
  221. this.rangeValue = e;
  222. if (e == "emptyPalletTargetOut") {
  223. this.nameOut = "目标点位";
  224. } else {
  225. this.nameOut = "起始点位";
  226. }
  227. },
  228. naviga() {
  229. if (this.rangeValue == "in") {
  230. this.rangeValueto = "emptyPalletSourceIn";
  231. } else {
  232. this.rangeValueto = "emptyPalletTargetOut";
  233. }
  234. uni.navigateTo({
  235. url:
  236. "/pages/Warehousing/select/index?show=4&rangeValue=" +
  237. this.rangeValueto,
  238. });
  239. },
  240. sectionChange(index) {
  241. console.log("index", index);
  242. this.curNow = index;
  243. },
  244. focusFunvac(e) {
  245. this.recshow = false;
  246. this.recshowto = true;
  247. uni.$off("xwscan");
  248. uni.$on("xwscan", (res) => {
  249. console.log("扫码结果:", res.code);
  250. this.targetLocationId = res.code;
  251. this.targetLocationIdcode = res.code;
  252. });
  253. console.log("focus事件");
  254. },
  255. goto(data) {
  256. uni.navigateTo({
  257. url: data,
  258. });
  259. },
  260. input(e) {
  261. console.log(e);
  262. this.sourceLocationIdcode = e;
  263. },
  264. inputEimt(e) {
  265. this.targetLocationIdcode = e;
  266. },
  267. inputSupport(e) {
  268. this.valueSianid = e;
  269. },
  270. subfeom() {
  271. let params = {
  272. locationId: this.valueSianid,
  273. moveType: this.rangeValue,
  274. };
  275. let dataobj = {
  276. sourceLocationId: this.sourceLocationIdcode,
  277. targetLocationId: this.targetLocationIdcode,
  278. };
  279. let that = this;
  280. uni.getStorage({
  281. key: "GetPhone_Token",
  282. success: function (res) {
  283. if (that.curNow == 0) {
  284. uni.request({
  285. url: `http://${that.host}` + "/ams/invLotLocId/moveLocInv",
  286. header: {
  287. Authorization: res.data,
  288. "content-type": "application/x-www-form-urlencoded",
  289. },
  290. data: dataobj,
  291. method: "POST",
  292. success(respenon) {
  293. console.log("chaoShiPanDuan", respenon);
  294. if (respenon.data.code == 200) {
  295. uni.showToast({
  296. title: respenon.data.msg,
  297. icon: "none",
  298. });
  299. uni.navigateTo({
  300. url: "/pages/index/tabbar/tabbar",
  301. });
  302. } else {
  303. uni.showToast({
  304. title: respenon.data.msg,
  305. icon: "none",
  306. });
  307. }
  308. console.log("res", res);
  309. },
  310. });
  311. } else {
  312. uni.request({
  313. url: `http://${that.host}` + "/ams/invLotLocId/moveEmptyPallet",
  314. header: {
  315. Authorization: res.data,
  316. "content-type": "application/x-www-form-urlencoded",
  317. },
  318. data: params,
  319. method: "POST",
  320. success(respenon) {
  321. console.log("chaoShiPanDuan", respenon);
  322. if (respenon.data.code == 200) {
  323. uni.showToast({
  324. title: respenon.data.msg,
  325. icon: "none",
  326. });
  327. uni.navigateTo({
  328. url: "/pages/index/tabbar/tabbar",
  329. });
  330. } else {
  331. uni.showToast({
  332. title: respenon.data.msg,
  333. icon: "none",
  334. });
  335. }
  336. console.log("res", res);
  337. },
  338. });
  339. }
  340. },
  341. });
  342. },
  343. inputDialogToggle() {
  344. this.$refs.inputDialog.open();
  345. },
  346. radioChange(val) {
  347. console.log(val);
  348. this.targetLocationId = val;
  349. },
  350. dialogInputConfirm(val) {
  351. console.log(this.value);
  352. setTimeout(() => {
  353. uni.hideLoading();
  354. console.log(val);
  355. this.value = this.value3;
  356. this.$refs.inputDialog.close();
  357. }, 100);
  358. },
  359. },
  360. };
  361. </script>
  362. <style scoped>
  363. /deep/.uni-select {
  364. font-size: 16px;
  365. border: 1px solid #e5e5e5;
  366. box-sizing: border-box;
  367. border-radius: 4px;
  368. padding: 13px 5px;
  369. padding-left: 10px;
  370. position: relative;
  371. display: flex;
  372. -webkit-user-select: none;
  373. user-select: none;
  374. flex-direction: row;
  375. align-items: center;
  376. border-bottom: solid 1px #e5e5e5;
  377. width: 100%;
  378. flex: 1;
  379. height: 35px;
  380. }
  381. /deep/.uni-select__input-placeholder {
  382. color: #6a6a6a;
  383. font-size: 16px;
  384. }
  385. /deep/.uni-icons {
  386. font-family: uniicons;
  387. text-decoration: none;
  388. text-align: center;
  389. font-size: 20px !important;
  390. }
  391. /deep/.u-subsection__item__text {
  392. font-size: 12px;
  393. line-height: 12px;
  394. display: flex;
  395. flex-direction: row;
  396. font-size: 15px !important;
  397. align-items: center;
  398. transition-property: color;
  399. transition-duration: 0.3s;
  400. }
  401. /deep/.is-input-border {
  402. display: flex;
  403. box-sizing: border-box;
  404. flex-direction: row;
  405. align-items: center;
  406. border-radius: 4px;
  407. background-color: rgb(245 245 245) !important;
  408. /* background: #24bdbd; */
  409. }
  410. /deep/.u-radio-label--right {
  411. flex-direction: row-reverse;
  412. justify-content: space-between;
  413. margin-bottom: 12px;
  414. }
  415. /deep/uni-button {
  416. color: #000;
  417. border: 1px solid #ff0000;
  418. border-radius: 31px;
  419. width: 21%;
  420. background-color: #f5f5f5;
  421. height: 42px;
  422. font-size: 16px;
  423. color: #ff0000;
  424. }
  425. /deep/.uni-easyinput__content-input[data-v-abe12412] {
  426. width: auto;
  427. position: relative;
  428. overflow: hidden;
  429. flex: 1;
  430. line-height: 1;
  431. font-size: 14px;
  432. height: 35px;
  433. /* border-bottom: 1px solid #ff0000 !important; */
  434. }
  435. /deep/.is-input-border {
  436. display: flex;
  437. box-sizing: border-box;
  438. flex-direction: row;
  439. align-items: center;
  440. border: none !important;
  441. border-radius: 4px;
  442. }
  443. </style>
  444. <style lang="scss" scoped>
  445. .content {
  446. // padding: 15px;
  447. .confirm-view {
  448. display: flex;
  449. padding: 15px;
  450. margin: 5px 0;
  451. align-items: center;
  452. border-bottom: 1px solid #d5d5d5;
  453. height: 56px;
  454. .text {
  455. font-size: 16px;
  456. color: #6e6860;
  457. font-weight: 500;
  458. }
  459. }
  460. .confirm-views {
  461. .title {
  462. display: flex;
  463. justify-content: space-between;
  464. font-size: 15px;
  465. color: #525151;
  466. padding: 15px;
  467. margin: 5px 0;
  468. align-items: center;
  469. border-bottom: 1px solid #d5d5d5;
  470. height: 56px;
  471. .view_icon {
  472. display: flex;
  473. align-content: center;
  474. align-items: center;
  475. }
  476. }
  477. }
  478. .border-buttons {
  479. display: flex;
  480. position: absolute;
  481. button: 0;
  482. bottom: 32px;
  483. padding: 0 15px;
  484. justify-content: space-between;
  485. width: 100%;
  486. text-align: center;
  487. .buttons2 {
  488. width: 100%;
  489. border: 1px solid #ff0505;
  490. border-radius: 34px;
  491. height: 42px;
  492. background: red;
  493. display: flex;
  494. justify-content: center;
  495. align-items: center;
  496. font-size: 18px;
  497. color: white;
  498. font-weight: 500;
  499. }
  500. }
  501. }
  502. </style>