grounding.vue 10 KB

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