movement.vue 14 KB

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