grounding.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  1. <template>
  2. <view class="query-wrap">
  3. <qs-scanlistener @scan="scan"></qs-scanlistener>
  4. <uni-easyinput prefixIcon="search" :value="value" placeholder="请输入或扫描入库单号" @iconClick="iconClick" :focus="true"
  5. @input="input" @blur="blur" @confirm="confirm">
  6. </uni-easyinput>
  7. <v-tabs v-model="index" :tabs="tabList" @change="changeTab" :scroll="false"></v-tabs>
  8. <z-paging ref="paging" @query="" v-model="dataList" :use-page-scroll="true">
  9. <view class="inner-item" v-for="(item,index) in listData" :key="index" @click="itemDetails(item)">
  10. <view class="inventory-item">
  11. <view class="shuo-item-name">
  12. <view class="shuo-label">
  13. {{item.name}}
  14. </view>
  15. <view class="shuo-unit">
  16. {{item.unit}}
  17. </view>
  18. </view>
  19. </view>
  20. <view class="inventory-item">
  21. <view class="shuo-item">
  22. <view class="shuo-label">
  23. 规格:
  24. </view>
  25. <view class="shuo-cont">
  26. {{item.guige}}
  27. </view>
  28. </view>
  29. <view class="shuo-item">
  30. <view class="shuo-label">
  31. 型号:
  32. </view>
  33. <view class="shuo-cont">
  34. {{item.xinghao}}
  35. </view>
  36. </view>
  37. </view>
  38. <view class="inventory-item">
  39. <view class="shuo-item">
  40. <view class="shuo-label">
  41. 耗材类别:
  42. </view>
  43. <view class="shuo-cont-blue">
  44. {{item.liebie}}
  45. </view>
  46. </view>
  47. <view class="shuo-item">
  48. <view class="shuo-label">
  49. 生产来源:
  50. </view>
  51. <view class="shuo-cont-blue">
  52. {{item.laiyuan}}
  53. </view>
  54. </view>
  55. </view>
  56. <view class="inventory-item">
  57. <view class="shuo-item-qy">
  58. <view class="shuo-label">
  59. 生产企业:
  60. </view>
  61. <view class="shuo-cont">
  62. {{item.qiye}}
  63. </view>
  64. </view>
  65. </view>
  66. <view class="inventory-item">
  67. <view class="shuo-item-qy">
  68. <view class="shuo-label">
  69. 供应商:
  70. </view>
  71. <view class="shuo-cont">
  72. {{item.suozaikw}}
  73. </view>
  74. </view>
  75. </view>
  76. <view class="inventory-item">
  77. <view class="shuo-item">
  78. <view class="shuo-label">
  79. RFID码:
  80. </view>
  81. <view class="shuo-cont-blue">
  82. {{item.bianma}}
  83. </view>
  84. </view>
  85. <view class="shuo-item">
  86. <view class="shuo-label">
  87. SN编码:
  88. </view>
  89. <view class="shuo-cont-blue">
  90. {{item.bianma}}
  91. </view>
  92. </view>
  93. </view>
  94. <view class="inventory-item">
  95. <view class="shuo-item">
  96. <view class="shuo-label">
  97. 上架货位:
  98. </view>
  99. <view class="shuo-cont-blue">
  100. {{item.xianykc}}
  101. </view>
  102. </view>
  103. <view class="shuo-item">
  104. <view class="shuo-label">
  105. 状态:
  106. </view>
  107. <view class="shuo-cont-blue">
  108. {{item.xianykc}}
  109. </view>
  110. </view>
  111. </view>
  112. <uv-button text="上架" plain size="normal" type="primary" style="margin-top:20rpx;"
  113. @click.native.stop="handleShelf(item)"></uv-button>
  114. </view>
  115. </z-paging>
  116. <uni-popup ref="inputDialog" type="dialog">
  117. <uni-popup-dialog ref="inputClose" mode="input" title="上架" @confirm="dialogInputConfirm">
  118. <uni-data-picker :localdata="items" popup-title="库位" @change="onchange" v-model="classes"
  119. @nodeclick="onnodeclick"></uni-data-picker>
  120. </uni-popup-dialog>
  121. </uni-popup>
  122. </view>
  123. </template>
  124. <script>
  125. import {
  126. listData
  127. } from "./home.js";
  128. import {
  129. mapState,
  130. mapMutations,
  131. mapActions
  132. } from 'vuex';
  133. import {
  134. debounced
  135. } from '@/utils/debounced.js';
  136. import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin.js';
  137. import renTime from '@/components/ren-time/ren-time.vue';
  138. export default {
  139. mixins: [ZPMixin],
  140. components: {
  141. renTime,
  142. },
  143. data() {
  144. return {
  145. index: "0",
  146. title: 'Hello',
  147. value1: "",
  148. value: "",
  149. dataList: [],
  150. inputVal: "",
  151. codeVal: "",
  152. confirmVal: "",
  153. changeVal: "",
  154. classes: "",
  155. listData: listData,
  156. tabList: ['待上架', '已上架'],
  157. valueList: 0,
  158. defaultIndex: [0],
  159. items: [{
  160. text: "一级",
  161. value: "1-0",
  162. children: [{
  163. text: "1.1班",
  164. value: "1-1"
  165. },
  166. {
  167. text: "1.2班",
  168. value: "1-2"
  169. }
  170. ]
  171. },
  172. {
  173. text: "二级",
  174. value: "2-0",
  175. children: [{
  176. text: "2.1班",
  177. value: "2-1"
  178. },
  179. {
  180. text: "2.2班",
  181. value: "2-2"
  182. }
  183. ]
  184. },
  185. {
  186. text: "三级",
  187. value: "3-0",
  188. children: [{
  189. text: "3.1班",
  190. value: "3-1"
  191. },
  192. {
  193. text: "3.2班",
  194. value: "3-2"
  195. }
  196. ]
  197. }
  198. ],
  199. }
  200. },
  201. onLoad() {
  202. },
  203. computed: {
  204. ...mapState(['groundData'])
  205. },
  206. onShow() {
  207. uni.$once('update', function(data) {
  208. // uni.redirectTo({
  209. // url: '/pages/grounding/grounding' //写你的路径
  210. // });
  211. })
  212. },
  213. mounted() {
  214. },
  215. methods: {
  216. ...mapActions(['getGroundData']),
  217. ...mapMutations(['setMentItemData']),
  218. // queryList(pageNo, pageSize) {
  219. // this.getGroundData();
  220. // },
  221. //跳转上架详情
  222. itemDetails(item) {
  223. this.setMentItemData([item]);
  224. uni.navigateTo({
  225. url: '/pages/groundetials/groundetials',
  226. success: function(res) {
  227. console.log(res,"res")
  228. }
  229. });
  230. },
  231. input(e) {
  232. this.$nextTick(() => {
  233. this.value = e;
  234. this.inputVal = e;
  235. })
  236. this.getGroundData({
  237. id_instock: e,
  238. type: ""
  239. })
  240. },
  241. iconClick(e) {
  242. console.log(e, '点击搜索拿到的数据');
  243. },
  244. blur(e) {
  245. this.$nextTick(() => {
  246. this.value = e.target.value;
  247. })
  248. },
  249. confirm(e) {
  250. this.$nextTick(() => {
  251. this.value = e;
  252. this.confirmVal = e;
  253. })
  254. },
  255. scan(code) {
  256. this.codeVal = code;
  257. this.$nextTick(() => {
  258. this.value = code;
  259. this.$debounced(this.getGroundData({
  260. id_instock: code,
  261. type: ""
  262. }), 2000)
  263. })
  264. },
  265. changeTab(index) {
  266. console.log('当前选中的项:' + index)
  267. },
  268. handleShelf(item) {
  269. this.$refs.inputDialog.open();
  270. console.log(111, item)
  271. },
  272. changeList(e) {
  273. console.log(e)
  274. },
  275. onchange(e) {
  276. const value = e.detail.value
  277. },
  278. onnodeclick(node) {
  279. console.log(node)
  280. }
  281. },
  282. watch: {
  283. groundData(newData, flodData) {
  284. this.$refs.paging.complete(newData);
  285. }
  286. }
  287. }
  288. </script>
  289. <style lang="scss" scoped>
  290. .query-wrap {
  291. width: 100%;
  292. padding: 20rpx;
  293. box-sizing: border-box;
  294. background-color: #F1F1F1;
  295. overflow-y: scroll;
  296. overflow-x: hidden;
  297. .inner-item {
  298. width: 100%;
  299. height: 500rpx;
  300. border-bottom: 2rpx solid #BDBDBD;
  301. padding: 20rpx 20rpx 20rpx 50rpx;
  302. box-sizing: border-box;
  303. position: relative;
  304. background-color: #fff;
  305. border-radius: 20rpx;
  306. position: relative;
  307. margin-top: 10rpx;
  308. .inventory-item {
  309. width: 105%;
  310. height: 40rpx;
  311. color: rgba(16, 16, 16, 1);
  312. font-size: 28rpx;
  313. text-align: left;
  314. font-family: PingFangSC-semiBold;
  315. margin-top: 10rpx;
  316. display: flex;
  317. align-items: center;
  318. .shuo-label {
  319. color: rgba(16, 16, 16, 1);
  320. font-size: 28rpx;
  321. text-align: left;
  322. font-family: PingFangSC-regular;
  323. font-weight: bold;
  324. }
  325. .shuo-unit {
  326. color: rgba(0, 193, 0, 1.0);
  327. font-weight: bold;
  328. }
  329. .shuo-cont-blue {
  330. color: #00BBFF;
  331. font-size: 25rpx;
  332. text-align: left;
  333. font-family: PingFangSC-regular;
  334. font-weight: bold;
  335. margin-left: 10rpx;
  336. }
  337. .shuo-cont {
  338. color: rgba(16, 16, 16, 1);
  339. font-size: 25rpx;
  340. text-align: left;
  341. font-family: PingFangSC-regular;
  342. margin-left: 20rpx;
  343. }
  344. .shuo-item-qy {
  345. width: 100%;
  346. height: 100%;
  347. line-height: 20rpx;
  348. display: flex;
  349. align-items: center;
  350. .shuo-label {
  351. width: 130rpx;
  352. color: rgba(16, 16, 16, 1);
  353. font-size: 28rpx;
  354. text-align: left;
  355. font-family: PingFangSC-regular;
  356. text-align: justify;
  357. text-align-last: justify;
  358. }
  359. .shuo-cont {
  360. color: rgba(16, 16, 16, 1);
  361. font-size: 25rpx;
  362. text-align: left;
  363. font-family: PingFangSC-regular;
  364. margin-left: 20rpx;
  365. }
  366. }
  367. .shuo-item-name {
  368. width: 100%;
  369. height: 100%;
  370. line-height: 20rpx;
  371. display: flex;
  372. align-items: center;
  373. .shuo-label {
  374. width: 200rpx;
  375. color: rgba(16, 16, 16, 1);
  376. font-size: 28rpx;
  377. text-align: left;
  378. font-family: PingFangSC-regular;
  379. text-align: justify;
  380. text-align-last: justify;
  381. margin-right: 20rpx;
  382. }
  383. .shuo-cont {
  384. color: rgba(16, 16, 16, 1);
  385. font-size: 25rpx;
  386. text-align: left;
  387. font-family: PingFangSC-regular;
  388. margin-left: 20rpx;
  389. }
  390. }
  391. .shuo-item {
  392. width: 50%;
  393. height: 100%;
  394. line-height: 20rpx;
  395. display: flex;
  396. align-items: center;
  397. .shuo-label {
  398. width: 130rpx;
  399. color: rgba(16, 16, 16, 1);
  400. font-size: 28rpx;
  401. text-align: left;
  402. font-family: PingFangSC-regular;
  403. text-align: justify;
  404. text-align-last: justify;
  405. }
  406. .shuo-cont {
  407. color: rgba(16, 16, 16, 1);
  408. font-size: 25rpx;
  409. text-align: left;
  410. font-family: PingFangSC-regular;
  411. margin-left: 20rpx;
  412. }
  413. .shuo-await {
  414. color: rgba(255, 191, 107, 1);
  415. font-size: 28rpx;
  416. text-align: left;
  417. font-family: PingFangSC-regular;
  418. margin-left: 20rpx;
  419. }
  420. .shuo-ready {
  421. color: rgba(162, 239, 77, 1);
  422. font-size: 28rpx;
  423. text-align: left;
  424. font-family: PingFangSC-regular;
  425. margin-left: 20rpx;
  426. }
  427. }
  428. .shuo-one-cont {
  429. width: 60%;
  430. }
  431. .shuo-min {
  432. width: 33%;
  433. }
  434. .max-item {
  435. width: 68%;
  436. margin-left: 10rpx;
  437. .shuo-cont {
  438. font-size: 20rpx;
  439. }
  440. }
  441. }
  442. }
  443. }
  444. uni-page-body {
  445. width: 100%;
  446. height: 100%;
  447. }
  448. </style>