Outbound.vue 9.7 KB

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