docking.vue 13 KB

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