grounding.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <template>
  2. <view class="query-wrap">
  3. <uni-easyinput prefixIcon="search" :value="value" placeholder="请输入或扫描SN码" @iconClick="iconClick" @input="input"
  4. @blur="blur" @confirm="confirm">
  5. </uni-easyinput>
  6. <qs-scanlistener @scan="scan"></qs-scanlistener>
  7. <v-tabs v-model="index" :tabs="tabList" @change="changeTab" :scroll="false"></v-tabs>
  8. <z-paging ref="paging" @query="queryList" v-model="dataList" :use-page-scroll="true">
  9. <view class="inner-item" v-for="(item,indx) in dataList" :key="indx" @click="itemDetails(item)">
  10. <view class="inventory-item">
  11. <view class="shuo-item-name">
  12. <view class="shuo-label-podnme">
  13. {{item.prodName}}
  14. </view>
  15. <view class="shuo-unit">
  16. <span>{{ item.pacunt }} ({{ item.pacCnt
  17. }}{{ item.prcUnt }}/{{ item.pacunt }})</span>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="inventory-item">
  22. <view class="shuo-item">
  23. <view class="shuo-label">
  24. 规格:
  25. </view>
  26. <view class="shuo-cont">
  27. {{item.spec}}
  28. </view>
  29. </view>
  30. <view class="shuo-item">
  31. <view class="shuo-label">
  32. 型号:
  33. </view>
  34. <view class="shuo-cont">
  35. {{item.mol}}
  36. </view>
  37. </view>
  38. </view>
  39. <view class="inventory-item">
  40. <view class="shuo-item">
  41. <view class="shuo-label">
  42. 耗材类别:
  43. </view>
  44. <view class="shuo-cont-blue">
  45. <span v-if="item.mcsType == '0'"> 普通耗材 </span>
  46. <span v-if="item.mcsType == '1'"> 高值耗材 </span>
  47. <span v-if="item.mcsType == '2'"> 试剂 </span>
  48. <span v-if="item.mcsType == '3'"> 总务耗材 </span>
  49. </view>
  50. </view>
  51. <view class="shuo-item">
  52. <view class="shuo-label">
  53. 生产来源:
  54. </view>
  55. <view class="shuo-cont-blue">
  56. <span v-if="item.prodSouc == '1'" type="success"> 国产 </span>
  57. <span v-if="item.prodSouc == '2'" type="danger"> 进口 </span>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="inventory-item">
  62. <view class="shuo-item-name">
  63. <view class="shuo-label">
  64. 生产企业:
  65. </view>
  66. <view class="shuo-cont">
  67. {{item.prodEntp}}
  68. </view>
  69. </view>
  70. </view>
  71. <view class="inventory-item">
  72. <view class="shuo-item-name">
  73. <view class="shuo-label">
  74. 供应商:
  75. </view>
  76. <view class="shuo-cont">
  77. {{item.splerName}}
  78. </view>
  79. </view>
  80. </view>
  81. <view class="inventory-item">
  82. <view class="shuo-item">
  83. <view class="shuo-label">
  84. RFID码:
  85. </view>
  86. <view class="shuo-cont-blue">
  87. {{item.rfid}}
  88. </view>
  89. </view>
  90. <view class="shuo-item">
  91. <view class="shuo-label">
  92. SN编码:
  93. </view>
  94. <view class="shuo-cont">
  95. {{item.id}}
  96. </view>
  97. </view>
  98. </view>
  99. <view class="inventory-item">
  100. <view class="shuo-item">
  101. <view class="shuo-label">
  102. 上架货位:
  103. </view>
  104. <view class="shuo-label-green">
  105. {{item.cgoLocName}}
  106. </view>
  107. </view>
  108. <!-- <view class="shuo-item">
  109. <view class="shuo-label">
  110. 状态:
  111. </view>
  112. <view class="shuo-cont-blue">
  113. {{}}
  114. </view>
  115. </view> -->
  116. </view>
  117. <view class="inventory-item">
  118. <view class="shuo-item">
  119. <view class="shuo-label">
  120. 上架人员:
  121. </view>
  122. <view class="shuo-cont-blue">
  123. {{item.groundName}}
  124. </view>
  125. </view>
  126. <view class="shuo-item">
  127. <view class="shuo-label">
  128. 上架时间:
  129. </view>
  130. <view class="shuo-cont" style="font-size: 18rpx;">
  131. {{item.groundDate}}
  132. </view>
  133. </view>
  134. </view>
  135. <uv-button text="上架" plain size="normal" type="primary" style="margin-top:20rpx;"
  136. @click.native.stop="handleShelf(item)" v-if="index=='0'"></uv-button>
  137. </view>
  138. </z-paging>
  139. <uni-popup ref="inputDialog" type="dialog">
  140. <uni-popup-dialog ref="inputClose" mode="input" title="上架" @confirm="dialogInputConfirm"
  141. :beforeClose="beforeClose" @close="oncloseList">
  142. <uni-data-picker :localdata="storageData" popup-title="货位" @change="onchange" v-model="classes"
  143. @popupclosed="onpopupclosed" @nodeclick="onnodeclick"></uni-data-picker>
  144. </uni-popup-dialog>
  145. </uni-popup>
  146. </view>
  147. </template>
  148. <script>
  149. import {
  150. mapState,
  151. mapMutations,
  152. mapActions
  153. } from 'vuex';
  154. import {
  155. debounce
  156. } from 'lodash';
  157. import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin.js';
  158. export default {
  159. mixins: [ZPMixin],
  160. data() {
  161. return {
  162. index: 0,
  163. value1: "",
  164. value: "",
  165. dataList: [],
  166. inputVal: "",
  167. codeVal: "",
  168. confirmVal: "",
  169. changeVal: "",
  170. classes: [],
  171. tabList: ['待上架', '已上架'],
  172. valueList: 0,
  173. beforeClose: true,
  174. itemData: {}
  175. }
  176. },
  177. computed: {
  178. ...mapState(['storageData'])
  179. },
  180. onShow() {
  181. uni.$once('update', function(data) {
  182. // uni.redirectTo({
  183. // url: '/pages/grounding/grounding' //写你的路径
  184. // });
  185. })
  186. },
  187. mounted() {
  188. this.getStorageData();
  189. },
  190. methods: {
  191. ...mapActions(['getGroundData', 'getStorageData', 'listIngData']),
  192. ...mapMutations(['setMentItemData']),
  193. async queryList(pageNo, pageSize) {
  194. await this.getGroundData({
  195. pam: {
  196. current: pageNo,
  197. size: pageSize,
  198. groundStas: this.index,
  199. id: this.value.trim()
  200. },
  201. that: this
  202. })
  203. },
  204. //跳转上架详情
  205. itemDetails(item) {
  206. uni.setStorage({
  207. key: 'ListingData',
  208. data: item
  209. });
  210. uni.navigateTo({
  211. url: '/pages/groundetials/groundetials',
  212. success: function(res) {
  213. console.log(res, "res")
  214. }
  215. });
  216. },
  217. scan(code) {
  218. this.value = code;
  219. let codeVal = code.trim();
  220. this.getGroundData({
  221. pam: {
  222. id: codeVal,
  223. groundStas: this.index,
  224. },
  225. that: this
  226. })
  227. },
  228. input: debounce(function(e) {
  229. this.value = e;
  230. this.getGroundData({
  231. pam: {
  232. id: e,
  233. groundStas: this.index,
  234. },
  235. that: this
  236. })
  237. this.$nextTick(() => {
  238. // this.value = e;
  239. // this.inputVal = e;
  240. })
  241. }, 500),
  242. iconClick(e) {
  243. console.log(e, '点击搜索拿到的数据');
  244. },
  245. blur(e) {
  246. this.$nextTick(() => {
  247. // this.value = e.target.value;
  248. })
  249. },
  250. confirm(e) {
  251. this.$nextTick(() => {
  252. // this.value = e;
  253. // this.confirmVal = e;
  254. })
  255. },
  256. changeTab(index) {
  257. this.index = index;
  258. this.$refs.paging.reload();
  259. },
  260. oncloseList() {
  261. this.$refs.inputDialog.close()
  262. },
  263. handleShelf(item) {
  264. this.itemData = item;
  265. this.$refs.inputDialog.open();
  266. },
  267. dialogInputConfirm() {
  268. if (this.classes.length === 0) {
  269. uni.showToast({
  270. title: '请选择货位',
  271. icon: 'none',
  272. });
  273. this.beforeClose = true;
  274. return;
  275. }
  276. let pamdata = [{
  277. sn: this.itemData.id,
  278. clibId: this.classes,
  279. }]
  280. this.listIngData(pamdata).then((res) => {
  281. this.$refs.paging.reload();
  282. this.classes = "";
  283. this.beforeClose = false;
  284. this.$refs.inputDialog.close();
  285. })
  286. },
  287. changeList(e) {
  288. // console.log(e)
  289. },
  290. onchange(e) {
  291. // console.log(e, 44)
  292. },
  293. onnodeclick(node) {
  294. console.log(node, "node");
  295. },
  296. onpopupclosed(e) {
  297. // console.log(e, 33)
  298. }
  299. },
  300. watch: {
  301. groundData(newData, flodData) {
  302. this.$refs.paging.complete(newData);
  303. },
  304. }
  305. }
  306. </script>
  307. <style lang="scss" scoped>
  308. .query-wrap {
  309. width: 100%;
  310. padding: 20rpx;
  311. box-sizing: border-box;
  312. background-color: #F1F1F1;
  313. overflow-y: scroll;
  314. overflow-x: hidden;
  315. }
  316. uni-page-body {
  317. width: 100%;
  318. height: 100%;
  319. }
  320. </style>