Outbound.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. <template>
  2. <view class="content">
  3. <view class="confirm-view">
  4. <text class="text">出库库位:</text>
  5. <uni-easyinput
  6. errorMessage
  7. type="text"
  8. v-model="targetLocationld"
  9. focus
  10. :focus="focusState"
  11. @focus="focusFn"
  12. @input="input"
  13. :class="recshow ? 'rec' : ''"
  14. @blur="focusState = false"
  15. placeholder-style="font-size:16px;color: #a7a7a7;"
  16. :placeholder="placeholder"></uni-easyinput>
  17. <!-- <button
  18. type="default"
  19. @click="goto('/pages/Warehousing/select/index?show=3&tip=' + 2)">
  20. 选择
  21. </button> -->
  22. </view>
  23. <!-- <view class="confirm-view">
  24. <text class="text">数量:</text>
  25. <view class="" style="display: flex; align-items: center; width: 50%">
  26. <text>4桶</text>
  27. </view>
  28. </view>
  29. <view class="confirm-view">
  30. <text class="text">物料:</text>
  31. <view class="">
  32. <view class="view_icon" @click="inputDialogToggle">
  33. <text v-if="valueTmia != ''">{{ valueTmia }}</text>
  34. <text v-else>请选择物料</text>
  35. </view>
  36. </view>
  37. </view> -->
  38. <view class="vercode_content">
  39. <view class="vontent_boby" @click="warehous">
  40. <view class="uicon-volume_text">
  41. <text class="text">物料:</text>
  42. <text v-if="valueTmia != ''">{{ valueTmia }}</text>
  43. <text v-else>请选择物料</text>
  44. </view>
  45. <view class="uicon-volume_text">
  46. <text>数量:4桶</text>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="border-buttons">
  51. <view class="buttons2" v-throttle="1000" @click="WeakRefthree">
  52. <text>移动</text>
  53. </view>
  54. </view>
  55. <xw-scan></xw-scan>
  56. <uni-popup ref="inputDialog" type="dialog">
  57. <uni-popup-dialog
  58. ref="inputClose"
  59. title="选择物料"
  60. value="对话框预置提示内容!"
  61. placeholder="请输入内容"
  62. @confirm="dialogInputConfirm">
  63. <u-radio-group
  64. placement="column"
  65. :borderBottom="true"
  66. v-model="value"
  67. iconPlacement="right">
  68. <u-radio
  69. :customStyle="{ marginBottom: '8px' }"
  70. v-for="(item, index) in radiolist1"
  71. :key="index"
  72. :label="item.name"
  73. :name="item.name"
  74. @change="radioChange($event, item)"></u-radio>
  75. </u-radio-group>
  76. </uni-popup-dialog>
  77. </uni-popup>
  78. <u-toast ref="uToast" />
  79. </view>
  80. </template>
  81. <script>
  82. export default {
  83. data() {
  84. return {
  85. recshow: false,
  86. recshowto: false,
  87. focusState: false,
  88. palletNo: "",
  89. materialType: "",
  90. targetLocationld: "",
  91. qty: "4",
  92. valueTmia: "丁铵黑药",
  93. host: "",
  94. radiolist1: [
  95. {
  96. name: "丁铵黑药",
  97. disabled: true,
  98. id: 5,
  99. },
  100. ],
  101. range: [
  102. { value: "1", text: "1" },
  103. { value: "2", text: "2" },
  104. { value: "3", text: "3" },
  105. { value: "4", text: "4" },
  106. ],
  107. focusStateto: false,
  108. value: "丁铵黑药",
  109. value2: "",
  110. placeholders: "请输入托盘号",
  111. placeholder: "请输入出库单位",
  112. valueTmname: "",
  113. };
  114. },
  115. onLoad(option) {},
  116. onUnload() {
  117. // 移除监听事件
  118. uni.$off("xwscan");
  119. },
  120. onHide() {},
  121. onShow() {
  122. let that = this;
  123. let pages = getCurrentPages();
  124. let currPage = pages[pages.length - 1]; //当前页面
  125. if (currPage.testdata != undefined) {
  126. console.log("$attrs", currPage.testdata);
  127. this.targetLocationld = currPage.testdata.name;
  128. }
  129. this.materialType = this.radiolist1[0].id;
  130. },
  131. created() {},
  132. mounted() {
  133. let _this = this;
  134. uni.getStorage({
  135. key: "hostappst",
  136. success(res) {
  137. console.log("获取成功", res.data);
  138. _this.host = res.data;
  139. },
  140. });
  141. this.getData();
  142. },
  143. watch: {
  144. scanCodeValue(value) {
  145. if (!!value) {
  146. document.onkeydown = null;
  147. } else {
  148. this.placeholder = "扫码失败,请重新扫码...";
  149. }
  150. },
  151. },
  152. onHide() {
  153. this.recshow = false;
  154. },
  155. methods: {
  156. otherFun(obj) {
  157. console.log(obj);
  158. if (obj.show == 3) {
  159. this.valueTmname = obj.id;
  160. this.targetLocationld = obj.locationNo;
  161. }
  162. },
  163. radioChange(val, row) {
  164. console.log(val, row);
  165. this.valueTmianame = val;
  166. this.materialType = row.id;
  167. },
  168. dialogInputConfirm(val) {
  169. this.valueTmia = this.valueTmianame;
  170. },
  171. Material() {
  172. uni.navigateTo({
  173. url: "/pages/Warehousing/selectMaterial/index",
  174. });
  175. },
  176. inputDialogToggle() {
  177. this.$refs.inputDialog.open();
  178. },
  179. WeakRefthree() {
  180. let text = "";
  181. if (this.targetLocationld == "") {
  182. text = "请输入库位";
  183. } else if (this.materialType == "") {
  184. text = "请选择物料";
  185. } else if (this.quantity == "") {
  186. text = "请选择数量";
  187. }
  188. if (text != "") {
  189. return uni.showToast({
  190. title: text,
  191. icon: "none",
  192. });
  193. }
  194. this.GetBanner();
  195. },
  196. focusFn(e) {
  197. this.recshow = true;
  198. this.recshowto = false;
  199. uni.$off("xwscan");
  200. uni.$on("xwscan", (res) => {
  201. console.log("扫码结果:", res.code);
  202. this.targetLocationld = res.code;
  203. this.valueTmname = res.code;
  204. });
  205. console.log("focus事件");
  206. },
  207. focusFnto(e) {
  208. this.recshowto = true;
  209. this.recshow = false;
  210. uni.$off("xwscan");
  211. uni.$on("xwscan", (res) => {
  212. console.log("扫码结果:", res.code);
  213. this.palletNo = res.code;
  214. });
  215. console.log("focus事件");
  216. },
  217. startScan() {
  218. this.$nextTick(() => {
  219. this.focusState = true;
  220. });
  221. if (e.which === 13) {
  222. setTimeout(() => {
  223. if (this.targetLocationld.length < 3) return;
  224. this.targetLocationld = "";
  225. }, 500);
  226. return;
  227. }
  228. },
  229. change(e) {
  230. console.log("e", e);
  231. this.qty = e;
  232. },
  233. getScancode(code) {
  234. console.log("进", code);
  235. code = code.trim();
  236. this.targetLocationld = code;
  237. console.log(code);
  238. uni.showLoading({
  239. title: code,
  240. });
  241. setTimeout(() => {
  242. uni.hideLoading();
  243. }, 3000);
  244. },
  245. goto(data) {
  246. uni.navigateTo({
  247. url: data,
  248. });
  249. },
  250. input(e) {
  251. this.valueTmname = e;
  252. },
  253. GetBanner() {
  254. uni.showLoading({
  255. title: "加载中",
  256. });
  257. let params = {
  258. materialType: this.materialType.toString(),
  259. targetLocationId: this.valueTmname,
  260. quantity: Number(this.qty),
  261. };
  262. let that = this;
  263. uni.getStorage({
  264. key: "GetPhone_Token",
  265. success: function (res) {
  266. uni.request({
  267. url: `http://${that.host}` + "/pda/agvCall/bucketOutOfStorage",
  268. header: {
  269. Authorization: res.data,
  270. "content-type": "application/x-www-form-urlencoded",
  271. },
  272. data: params,
  273. method: "POST",
  274. success(respenon) {
  275. console.log("chaoShiPanDuan", respenon);
  276. if (respenon.data.code == 200) {
  277. uni.hideLoading();
  278. uni.showToast({
  279. title: respenon.data.msg,
  280. icon: "none",
  281. duration: 2000,
  282. });
  283. setTimeout(() => {
  284. uni.navigateTo({
  285. url: "/pages/index/tabbar/tabbar",
  286. });
  287. }, 1000);
  288. } else {
  289. uni.showToast({
  290. title: respenon.data.msg,
  291. icon: "none",
  292. });
  293. }
  294. console.log("res", res);
  295. },
  296. });
  297. },
  298. });
  299. },
  300. getData() {
  301. let that = this;
  302. let dataobj = {
  303. cacheZoneSceneCode: "bucketCacheZoneOut",
  304. locationSceneCode: "bucketCacheOut",
  305. };
  306. uni.getStorage({
  307. key: "GetPhone_Token",
  308. success: function (res) {
  309. // 恢复请求
  310. uni.request({
  311. url:
  312. `http://${that.host}` + "/inv/asn/getCacheLocationInfoCacheList",
  313. header: {
  314. Authorization: res.data,
  315. },
  316. method: "GET",
  317. data: dataobj,
  318. success(res) {
  319. console.log("chaoShiPanDuan", res);
  320. if (res.data.code == 200) {
  321. res.data.data.forEach((item, index) => {
  322. that.targetLocationld = res.data.data[0].locationNo;
  323. that.valueTmname = res.data.data[0].id;
  324. });
  325. } else if (respenon.data.code == 401) {
  326. uni.reLaunch({
  327. url: "/pages/index/login",
  328. });
  329. }
  330. console.log("res", res);
  331. },
  332. });
  333. },
  334. });
  335. },
  336. },
  337. };
  338. </script>
  339. <style scoped>
  340. /deep/.is-input-border {
  341. display: flex;
  342. box-sizing: border-box;
  343. flex-direction: row;
  344. align-items: center;
  345. border-radius: 4px;
  346. background-color: rgb(245 245 245) !important;
  347. /* background: #24bdbd; */
  348. }
  349. /deep/uni-button {
  350. color: #000;
  351. border: 1px solid #ff0000;
  352. border-radius: 31px;
  353. width: 21%;
  354. background-color: #f5f5f5;
  355. height: 42px;
  356. font-size: 16px;
  357. color: #ff0000;
  358. }
  359. /deep/.uni-easyinput__content-input[data-v-abe12412] {
  360. width: auto;
  361. position: relative;
  362. overflow: hidden;
  363. flex: 1;
  364. line-height: 1;
  365. font-size: 14px;
  366. height: 35px;
  367. /* border-bottom: 1px solid #ff0000 !important; */
  368. }
  369. /deep/.is-input-border {
  370. display: flex;
  371. box-sizing: border-box;
  372. flex-direction: row;
  373. align-items: center;
  374. border: none !important;
  375. border-radius: 4px;
  376. }
  377. .recto {
  378. box-sizing: border-box;
  379. position: relative;
  380. overflow: hidden;
  381. /* margin: 300px auto; */
  382. /* width: 300px; */
  383. /* height: 4px; */
  384. /* border: 0.1px solid #ccc; */
  385. }
  386. .recto::before {
  387. position: absolute;
  388. bottom: 0;
  389. content: "";
  390. height: 2px;
  391. width: 258px;
  392. background-color: red;
  393. /* 依次对应:动画名、时长、匀速、无限循环 */
  394. animation: move 3s;
  395. }
  396. @keyframes move {
  397. from {
  398. left: -100%;
  399. }
  400. to {
  401. left: 100%;
  402. }
  403. }
  404. </style>
  405. <style lang="scss" scoped>
  406. .content {
  407. padding: 15px;
  408. .confirm-view {
  409. display: flex;
  410. // margin-bottom: 15px;
  411. align-items: center;
  412. height: 65px;
  413. /* border-top: 1px solid #dbdbdb; */
  414. /* border-bottom: 1px solid; */
  415. border-bottom: 1px solid #dbdbdb;
  416. .text {
  417. font-size: 16px;
  418. color: #6e6860;
  419. font-weight: 500;
  420. width: 80px;
  421. text-align-last: justify;
  422. }
  423. }
  424. .vontent_boby {
  425. // margin: 15px 0;
  426. // border-top: 1px solid #dbdbdb;
  427. display: flex;
  428. justify-content: space-between;
  429. font-size: 15px;
  430. color: #838383;
  431. border-bottom: 1px solid #dbdbdb;
  432. height: 55px;
  433. align-items: center;
  434. }
  435. .border-buttons {
  436. display: flex;
  437. position: absolute;
  438. button: 0;
  439. bottom: 32px;
  440. justify-content: space-between;
  441. width: 91%;
  442. text-align: center;
  443. .buttons {
  444. width: 46%;
  445. border: 1px solid #f00;
  446. border-radius: 34px;
  447. height: 42px;
  448. display: flex;
  449. justify-content: center;
  450. align-items: center;
  451. font-size: 18px;
  452. color: red;
  453. font-weight: 500;
  454. }
  455. .buttons2 {
  456. width: 100%;
  457. border: 1px solid #ff0505;
  458. border-radius: 34px;
  459. height: 42px;
  460. background: red;
  461. display: flex;
  462. justify-content: center;
  463. align-items: center;
  464. font-size: 18px;
  465. color: white;
  466. font-weight: 500;
  467. }
  468. }
  469. }
  470. </style>