index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. <template>
  2. <view class="query-wrap">
  3. <uni-easyinput prefixIcon="search" :value="value" placeholder="请输入SN码/RFID" :focus="true" @input="input">
  4. </uni-easyinput>
  5. <qs-scanlistener @scan="scan"></qs-scanlistener>
  6. <view class="inner-item">
  7. <view class="inventory-item">
  8. <view class="shuo-item-name">
  9. <view class="shuo-label-podnme">
  10. {{formData.prodName||"" }}
  11. </view>
  12. <view class="shuo-unit">
  13. <span>{{ formData.purcUnt }} ({{ formData.convrat
  14. }}{{formData.prcUnt}}/{{ formData.purcUnt }})</span>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="inventory-item">
  19. <view class="shuo-item-name">
  20. <view class="shuo-label">
  21. 规格:
  22. </view>
  23. <view class="shuo-cont">
  24. {{formData.spec}}
  25. </view>
  26. </view>
  27. </view>
  28. <view class="inventory-item">
  29. <view class="shuo-item-name">
  30. <view class="shuo-label">
  31. 型号:
  32. </view>
  33. <view class="shuo-cont">
  34. {{formData.mol}}
  35. </view>
  36. </view>
  37. </view>
  38. <view class="inventory-item">
  39. <view class="shuo-item-name">
  40. <view class="shuo-label">
  41. 出库数量:
  42. </view>
  43. <view class="shuo-unit">
  44. {{formData.stooutCnt}}
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="inner-item" v-for="(item,idex) in listData" :key="idex">
  50. <view class="text-title">
  51. {{idex+1}}
  52. </view>
  53. <liu-swipe-action :index="idex" @clickItem="clickItem(idex)" :disable="stas=='A'?false:true">
  54. <view class="inventory-item">
  55. <view class="shuo-item">
  56. <view class="shuo-label">
  57. sn编码:
  58. </view>
  59. <view class="shuo-cont">
  60. {{item.id}}
  61. </view>
  62. </view>
  63. <view class="shuo-item">
  64. <view class="shuo-label">
  65. RFIF码:
  66. </view>
  67. <view class="shuo-cont">
  68. {{item.rfid}}
  69. </view>
  70. </view>
  71. </view>
  72. <view class="inventory-item">
  73. <view class="shuo-item">
  74. <view class="shuo-label">
  75. 批次:
  76. </view>
  77. <view class="shuo-cont">
  78. {{item.lotNum}}
  79. </view>
  80. </view>
  81. <view class="shuo-item">
  82. <view class="shuo-label">
  83. 包装单位:
  84. </view>
  85. <view class="shuo-cont">
  86. <span>{{ item.pacunt }}({{item.pacCnt }}{{ item.prcUnt }}/{{ item.pacunt }})</span>
  87. </view>
  88. </view>
  89. </view>
  90. <view class="inventory-item">
  91. <view class="shuo-item-name">
  92. <view class="shuo-label">
  93. 有效期至:
  94. </view>
  95. <view class="shuo-cont">
  96. {{item.prodExpy}}
  97. </view>
  98. </view>
  99. </view>
  100. </liu-swipe-action>
  101. </view>
  102. <view class="empty-cont" v-if="listData.length==0">
  103. 暂无明细
  104. </view>
  105. <uni-popup ref="popup">
  106. <uni-popup-dialog type="warn" :before-close="true" cancelText="取消" confirmText="确定" content="你确定删除当前记录吗?"
  107. @confirm="dialogConfirm" @close="dialogClose"></uni-popup-dialog>
  108. </uni-popup>
  109. <view class="botm-btn" v-if="type=='outbond'">
  110. <button type="default" plain="true" style="width:240rpx;line-height: 70rpx;background: #01A992;color:#fff"
  111. @click.stop="subMitData()">确定</button>
  112. </view>
  113. </view>
  114. </template>
  115. <script>
  116. import {
  117. mapState,
  118. mapMutations,
  119. mapActions
  120. } from 'vuex';
  121. import moment from "moment";
  122. const paging = {
  123. current: 1,
  124. size: 10000
  125. };
  126. export default {
  127. data() {
  128. return {
  129. value: "",
  130. listData: [],
  131. formData: {},
  132. type: "",
  133. stas:"",
  134. delIndex: 0,
  135. icontext: "还没触发"
  136. }
  137. },
  138. computed: {
  139. ...mapState(['refusaData', 'udiData'])
  140. },
  141. onShow() {
  142. let that = this;
  143. this.$forceUpdate();
  144. uni.getStorage({
  145. key: 'pickIngData',
  146. success: function(res) {
  147. //soucStroomId
  148. that.formData = res.data;
  149. that.type = res.data.type;
  150. that.stas=res.data.stas;
  151. }
  152. });
  153. },
  154. mounted() {
  155. if (this.type != 'outbond') {
  156. this.getData();
  157. }
  158. },
  159. methods: {
  160. getData() {
  161. this.$http('delivery.getPickData', {
  162. prodCode: this.formData.prodCode,
  163. size: 1000,
  164. stooutId: this.formData.stooutId
  165. }, '加载中', true).then((res) => {
  166. if (res.success == true) {
  167. this.listData = res.data.records;
  168. }
  169. })
  170. },
  171. //确定删除
  172. clickItem(idx) {
  173. this.delIndex = idx;
  174. this.$refs.popup.open();
  175. },
  176. dialogClose() {
  177. this.$refs.popup.close();
  178. },
  179. requsData(e) {
  180. if (!e) return;
  181. this.$http('outbound.outbQueryData', {
  182. prodCode: this.formData.prodCode,
  183. soucStroomId: this.formData.soucStroomId,
  184. stooutId: this.formData.stooutId,
  185. sn: e
  186. }, '加载中', true).then((res) => {
  187. if (res.success == true) {
  188. res.data.records.length > 0 &&
  189. res.data.records.forEach((item) => {
  190. item["stooutId"] = this.formData.stooutId;
  191. item["sn"] = item.id;
  192. });
  193. let filterData = this.listData.filter((item) => {
  194. return item.id == res.data.records[0].id;
  195. });
  196. if (filterData.length <= 0) {
  197. this.listData = [...this.listData, ...res.data.records]
  198. } else {
  199. uni.showToast({
  200. title: '重复数据',
  201. icon: 'none',
  202. duration: 1000,
  203. });
  204. }
  205. }
  206. })
  207. },
  208. //拣货查询
  209. input(e) {
  210. this.requsData(e);
  211. },
  212. // 确定删除当前记录
  213. dialogConfirm() {
  214. if (this.type != 'outbond') {
  215. this.deteteAreadyData();
  216. }
  217. let delData = [...this.listData];
  218. delData.splice(this.delIndex, 1);
  219. this.listData = delData;
  220. this.$refs.popup.close();
  221. },
  222. //删除已拣耗材
  223. deteteAreadyData(){
  224. this.$http('outbound.deAreayData', {
  225. id: this.listData[this.delIndex].id,
  226. stooutId: this.formData.stooutId
  227. }, '加载中', true).then((res)=>{
  228. if(res.success==true){
  229. this.getData();
  230. }
  231. })
  232. },
  233. //拣货确认
  234. subMitData() {
  235. this.$http('outbound.confrimPickIng', this.listData, '加载中', true).then((res) => {
  236. if (res.success == true) {
  237. uni.showToast({
  238. title: '拣货成功',
  239. icon: 'none',
  240. duration: 1000,
  241. });
  242. uni.redirectTo({
  243. url: '/pages/picking-details/index'
  244. });
  245. }
  246. })
  247. },
  248. scan(code) {
  249. this.value = code;
  250. this.requsData(code.trim());
  251. }
  252. },
  253. watch: {
  254. }
  255. }
  256. </script>
  257. <style lang="scss" scoped>
  258. .query-wrap {
  259. width: 100%;
  260. height: 100%;
  261. padding: 20rpx;
  262. box-sizing: border-box;
  263. background-color: #F1F1F1;
  264. overflow-y: scroll;
  265. overflow-x: hidden;
  266. position: relative;
  267. padding-bottom: 200rpx;
  268. .botm-btn {
  269. width: 100%;
  270. height: 120rpx;
  271. background-color: #fff;
  272. position: fixed;
  273. left: 0;
  274. bottom: 0;
  275. padding-top: 40rpx;
  276. }
  277. .empty-cont {
  278. width: 100%;
  279. height: 500rpx;
  280. display: flex;
  281. align-items: center;
  282. justify-content: center;
  283. }
  284. .inner-item {
  285. width: 100%;
  286. height: auto;
  287. border-bottom: 2rpx solid #BDBDBD;
  288. padding: 20rpx 20rpx 20rpx 70rpx;
  289. box-sizing: border-box;
  290. position: relative;
  291. background-color: #fff;
  292. border-radius: 20rpx;
  293. margin-top: 10rpx;
  294. .text-title {
  295. width: 40rpx;
  296. height: 100%;
  297. color: #01A992;
  298. font-size: 32rpx;
  299. text-align: left;
  300. font-family: PingFangSC-semiBold;
  301. position: absolute;
  302. left: 0;
  303. top: 0;
  304. z-index: 100;
  305. display: flex;
  306. align-items: center;
  307. justify-content: center;
  308. border-right: 1px solid #000;
  309. }
  310. .item-stats {
  311. position: absolute;
  312. right: 20rpx;
  313. top: 30rpx;
  314. width: 96rpx;
  315. height: 46rpx;
  316. line-height: 46rpx;
  317. color: rgba(1, 169, 146, 1);
  318. font-size: 32rpx;
  319. text-align: left;
  320. font-family: PingFangSC-bold;
  321. }
  322. .inventory-item {
  323. width: 100%;
  324. height: 40rpx;
  325. color: rgba(16, 16, 16, 1);
  326. font-size: 28rpx;
  327. text-align: left;
  328. font-family: PingFangSC-semiBold;
  329. margin-top: 15rpx;
  330. display: flex;
  331. align-items: center;
  332. .shuo-label {
  333. color: rgba(16, 16, 16, 1);
  334. font-size: 28rpx;
  335. text-align: left;
  336. font-family: PingFangSC-regular;
  337. font-weight: bold;
  338. }
  339. .shuo-unit {
  340. color: rgba(0, 193, 0, 1.0);
  341. font-weight: bold;
  342. height: 50rpx;
  343. line-height: 50rpx;
  344. overflow: hidden;
  345. white-space: nowrap;
  346. text-overflow: ellipsis
  347. }
  348. .shuo-cont-blue {
  349. color: #00BBFF;
  350. font-size: 25rpx;
  351. text-align: left;
  352. font-family: PingFangSC-regular;
  353. font-weight: bold;
  354. margin-left: 10rpx;
  355. }
  356. .shuo-cont,
  357. .suces,
  358. .shuo-error {
  359. color: rgba(16, 16, 16, 1);
  360. font-size: 25rpx;
  361. text-align: left;
  362. height: 40rpx;
  363. line-height: 40rpx;
  364. font-family: PingFangSC-regular;
  365. margin-left: 20rpx;
  366. overflow: hidden;
  367. white-space: nowrap;
  368. text-overflow: ellipsis
  369. }
  370. .suces {
  371. color: rgba(0, 193, 0, 1.0);
  372. font-weight: bold;
  373. }
  374. .shuo-error {
  375. color: red;
  376. font-weight: bold;
  377. }
  378. .shuo-item-name {
  379. width: 100%;
  380. height: 100%;
  381. line-height: 20rpx;
  382. display: flex;
  383. align-items: center;
  384. .shuo-label {
  385. color: rgba(16, 16, 16, 1);
  386. font-size: 28rpx;
  387. text-align: left;
  388. font-family: PingFangSC-regular;
  389. text-align: justify;
  390. text-align-last: justify;
  391. margin-right: 20rpx;
  392. height: 50rpx;
  393. line-height: 50rpx;
  394. overflow: hidden;
  395. white-space: nowrap;
  396. text-overflow: ellipsis
  397. }
  398. .shuo-cont {
  399. color: rgba(16, 16, 16, 1);
  400. font-size: 25rpx;
  401. text-align: left;
  402. font-family: PingFangSC-regular;
  403. margin-left: 10rpx;
  404. overflow: hidden;
  405. white-space: nowrap;
  406. text-overflow: ellipsis;
  407. }
  408. }
  409. .shuo-item-tcl {
  410. width: 100%;
  411. height: 100%;
  412. line-height: 20rpx;
  413. display: flex;
  414. align-items: center;
  415. .shuo-label {
  416. width: 150rpx;
  417. color: rgba(16, 16, 16, 1);
  418. font-size: 28rpx;
  419. text-align: left;
  420. font-family: PingFangSC-regular;
  421. text-align: justify;
  422. text-align-last: justify;
  423. margin-right: 20rpx;
  424. }
  425. .shuo-cont {
  426. color: rgba(16, 16, 16, 1);
  427. font-size: 25rpx;
  428. text-align: left;
  429. font-family: PingFangSC-regular;
  430. margin-left: 20rpx;
  431. }
  432. }
  433. .shuo-item {
  434. width: 50%;
  435. height: 100%;
  436. line-height: 20rpx;
  437. display: flex;
  438. align-items: center;
  439. .shuo-label {
  440. width: 150rpx;
  441. color: rgba(16, 16, 16, 1);
  442. font-size: 28rpx;
  443. text-align: left;
  444. font-family: PingFangSC-regular;
  445. text-align-last: justify;
  446. }
  447. .shuo-cont {
  448. color: rgba(16, 16, 16, 1);
  449. font-size: 25rpx;
  450. text-align: left;
  451. font-family: PingFangSC-regular;
  452. margin-left: 10rpx;
  453. }
  454. .shuo-await {
  455. color: rgba(255, 191, 107, 1);
  456. font-size: 28rpx;
  457. text-align: left;
  458. font-family: PingFangSC-regular;
  459. margin-left: 20rpx;
  460. }
  461. .shuo-ready {
  462. color: rgba(162, 239, 77, 1);
  463. font-size: 28rpx;
  464. text-align: left;
  465. font-family: PingFangSC-regular;
  466. margin-left: 20rpx;
  467. }
  468. }
  469. .shuo-one-cont {
  470. width: 60%;
  471. }
  472. .shuo-min {
  473. width: 33%;
  474. }
  475. .max-item {
  476. width: 68%;
  477. margin-left: 10rpx;
  478. .shuo-cont {
  479. font-size: 20rpx;
  480. }
  481. }
  482. }
  483. }
  484. }
  485. uni-page-body {
  486. width: 100%;
  487. height: 100%;
  488. background-color: #F1F1F1;
  489. ;
  490. }
  491. </style>