Material.vue 11 KB

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