index.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. <template>
  2. <view class="query-wrap">
  3. <view class="inner-item">
  4. <view class="inventory-item">
  5. <view class="shuo-item-name its">
  6. <view class="shuo-label">
  7. {{formData.prodName||"" }}
  8. </view>
  9. <view class="shuo-unit">
  10. <span>{{ formData.purcUnt }} ({{ formData.convrat
  11. }}{{formData.prcUnt}}/{{ formData.purcUnt }})</span>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="inventory-item">
  16. <view class="shuo-item-name">
  17. <view class="shuo-label">
  18. 规格:
  19. </view>
  20. <view class="shuo-cont">
  21. {{formData.spec}}
  22. </view>
  23. </view>
  24. </view>
  25. <view class="inventory-item">
  26. <view class="shuo-item-name">
  27. <view class="shuo-label">
  28. 型号:
  29. </view>
  30. <view class="shuo-cont">
  31. {{formData.mol}}
  32. </view>
  33. </view>
  34. </view>
  35. <view class="inventory-item">
  36. <view class="shuo-item-name">
  37. <view class="shuo-label">
  38. 出库数量:
  39. </view>
  40. <view class="shuo-unit">
  41. {{formData.children.length}}
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="inner-item" v-for="(item,idex) in formData.children" :key="idex">
  47. <view class="text-title">
  48. {{idex+1}}
  49. </view>
  50. <liu-swipe-action :index="idex" @clickItem="clickItem">
  51. <view class="inventory-item">
  52. <view class="shuo-item">
  53. <view class="shuo-label">
  54. sn编码:
  55. </view>
  56. <view class="shuo-cont">
  57. {{item.id}}
  58. </view>
  59. </view>
  60. <view class="shuo-item">
  61. <view class="shuo-label">
  62. RFIF码:
  63. </view>
  64. <view class="shuo-cont">
  65. {{item.rfid}}
  66. </view>
  67. </view>
  68. </view>
  69. <view class="inventory-item">
  70. <view class="shuo-item">
  71. <view class="shuo-label">
  72. 批次:
  73. </view>
  74. <view class="shuo-cont">
  75. {{item.lotNum}}
  76. </view>
  77. </view>
  78. <view class="shuo-item">
  79. <view class="shuo-label">
  80. 包装单位:
  81. </view>
  82. <view class="shuo-cont">
  83. <span>{{ item.pacunt }}({{item.pacCnt }}{{ item.prcUnt }}/{{ item.pacunt }})</span>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="inventory-item">
  88. <view class="shuo-item-name">
  89. <view class="shuo-label">
  90. 有效期至:
  91. </view>
  92. <view class="shuo-cont">
  93. {{item.prodExpy}}
  94. </view>
  95. </view>
  96. </view>
  97. </liu-swipe-action>
  98. </view>
  99. <uni-popup ref="popup">
  100. <uni-popup-dialog type="warn" :before-close="true" cancelText="取消" confirmText="确定" content="你确定删除当前记录吗?"
  101. @confirm="dialogConfirm" @close="dialogClose"></uni-popup-dialog>
  102. </uni-popup>
  103. <view class="botm-btn" v-if="type=='outbond'">
  104. <button type="default" plain="true" style="width:240rpx;line-height: 70rpx;background: #01A992;color:#fff"
  105. @click.stop="subMitData()">确定</button>
  106. </view>
  107. </view>
  108. </template>
  109. <script>
  110. import {
  111. mapState,
  112. mapMutations,
  113. mapActions
  114. } from 'vuex';
  115. import moment from "moment";
  116. const paging = {
  117. current: 1,
  118. size: 10000
  119. };
  120. export default {
  121. data() {
  122. return {
  123. value: "",
  124. listData: [],
  125. formData: {},
  126. type: "",
  127. delIndex: 0,
  128. patIndex: 0
  129. }
  130. },
  131. computed: {
  132. ...mapState(['consumeData'])
  133. },
  134. onShow() {
  135. let that = this;
  136. this.$forceUpdate();
  137. uni.getStorage({
  138. key: 'sumeDetails',
  139. success: function(res) {
  140. that.formData = res.data.snData;
  141. that.patIndex = res.data.itx;
  142. }
  143. });
  144. },
  145. mounted() {
  146. },
  147. methods: {
  148. ...mapMutations(['setConmData']),
  149. //确定删除
  150. clickItem(e) {
  151. this.delIndex = e.index;
  152. this.$refs.popup.open();
  153. },
  154. dialogClose() {
  155. this.$refs.popup.close();
  156. },
  157. // 确定删除当前记录
  158. dialogConfirm() {
  159. let delData = {
  160. ...this.formData
  161. };
  162. let patData = [...this.consumeData];
  163. delData.children.splice(this.delIndex, 1);
  164. this.formData = delData;
  165. patData[this.patIndex] = delData;
  166. if (delData.children.length == 0) {
  167. patData.splice(this.patIndex, 1);
  168. }
  169. this.setConmData(patData);
  170. this.$refs.popup.close();
  171. this.$forceUpdate();
  172. uni.setStorage({
  173. key: 'sumeDetails',
  174. data: {
  175. snData: delData,
  176. itx: this.patIndex
  177. }
  178. });
  179. },
  180. },
  181. watch: {
  182. }
  183. }
  184. </script>
  185. <style lang="scss" scoped>
  186. .query-wrap {
  187. width: 100%;
  188. height: 100%;
  189. padding: 20rpx;
  190. box-sizing: border-box;
  191. background-color: #F1F1F1;
  192. overflow-y: scroll;
  193. overflow-x: hidden;
  194. position: relative;
  195. padding-bottom: 200rpx;
  196. .botm-btn {
  197. width: 100%;
  198. height: 120rpx;
  199. background-color: #fff;
  200. position: fixed;
  201. left: 0;
  202. bottom: 0;
  203. padding-top: 40rpx;
  204. }
  205. .inner-item {
  206. width: 100%;
  207. height: auto;
  208. border-bottom: 2rpx solid #BDBDBD;
  209. padding: 20rpx 20rpx 20rpx 70rpx;
  210. box-sizing: border-box;
  211. position: relative;
  212. background-color: #fff;
  213. border-radius: 20rpx;
  214. margin-top: 10rpx;
  215. .text-title {
  216. width: 40rpx;
  217. height: 100%;
  218. color: #01A992;
  219. font-size: 32rpx;
  220. text-align: left;
  221. font-family: PingFangSC-semiBold;
  222. position: absolute;
  223. left: 0;
  224. top: 0;
  225. z-index: 100;
  226. display: flex;
  227. align-items: center;
  228. justify-content: center;
  229. border-right: 1px solid #000;
  230. }
  231. .item-stats {
  232. position: absolute;
  233. right: 20rpx;
  234. top: 30rpx;
  235. width: 96rpx;
  236. height: 46rpx;
  237. line-height: 46rpx;
  238. color: rgba(1, 169, 146, 1);
  239. font-size: 32rpx;
  240. text-align: left;
  241. font-family: PingFangSC-bold;
  242. }
  243. .inventory-item {
  244. width: 100%;
  245. height: 40rpx;
  246. color: rgba(16, 16, 16, 1);
  247. font-size: 28rpx;
  248. text-align: left;
  249. font-family: PingFangSC-semiBold;
  250. margin-top: 15rpx;
  251. display: flex;
  252. align-items: center;
  253. .shuo-label {
  254. color: rgba(16, 16, 16, 1);
  255. font-size: 28rpx;
  256. text-align: left;
  257. font-family: PingFangSC-regular;
  258. font-weight: bold;
  259. }
  260. .shuo-unit {
  261. color: rgba(0, 193, 0, 1.0);
  262. font-weight: bold;
  263. height: 50rpx;
  264. line-height: 50rpx;
  265. overflow: hidden;
  266. white-space: nowrap;
  267. text-overflow: ellipsis
  268. }
  269. .shuo-cont-blue {
  270. color: #00BBFF;
  271. font-size: 25rpx;
  272. text-align: left;
  273. font-family: PingFangSC-regular;
  274. font-weight: bold;
  275. margin-left: 10rpx;
  276. }
  277. .shuo-cont,
  278. .suces,
  279. .shuo-error {
  280. color: rgba(16, 16, 16, 1);
  281. font-size: 25rpx;
  282. text-align: left;
  283. height: 40rpx;
  284. line-height: 40rpx;
  285. font-family: PingFangSC-regular;
  286. margin-left: 20rpx;
  287. overflow: hidden;
  288. white-space: nowrap;
  289. text-overflow: ellipsis
  290. }
  291. .suces {
  292. color: rgba(0, 193, 0, 1.0);
  293. font-weight: bold;
  294. }
  295. .shuo-error {
  296. color: red;
  297. font-weight: bold;
  298. }
  299. .shuo-item-name {
  300. width: 100%;
  301. height: 100%;
  302. line-height: 20rpx;
  303. display: flex;
  304. align-items: center;
  305. .shuo-label {
  306. color: rgba(16, 16, 16, 1);
  307. font-size: 28rpx;
  308. text-align: left;
  309. font-family: PingFangSC-regular;
  310. text-align: justify;
  311. text-align-last: justify;
  312. margin-right: 20rpx;
  313. height: 50rpx;
  314. line-height: 50rpx;
  315. overflow: hidden;
  316. white-space: nowrap;
  317. text-overflow: ellipsis
  318. }
  319. .shuo-cont {
  320. color: rgba(16, 16, 16, 1);
  321. font-size: 25rpx;
  322. text-align: left;
  323. font-family: PingFangSC-regular;
  324. margin-left: 20rpx;
  325. overflow: hidden;
  326. white-space: nowrap;
  327. text-overflow: ellipsis
  328. }
  329. }
  330. .shuo-item-tcl {
  331. width: 100%;
  332. height: 100%;
  333. line-height: 20rpx;
  334. display: flex;
  335. align-items: center;
  336. .shuo-label {
  337. width: 150rpx;
  338. color: rgba(16, 16, 16, 1);
  339. font-size: 28rpx;
  340. text-align: left;
  341. font-family: PingFangSC-regular;
  342. text-align: justify;
  343. text-align-last: justify;
  344. margin-right: 20rpx;
  345. }
  346. .shuo-cont {
  347. color: rgba(16, 16, 16, 1);
  348. font-size: 25rpx;
  349. text-align: left;
  350. font-family: PingFangSC-regular;
  351. margin-left: 20rpx;
  352. }
  353. }
  354. .shuo-item {
  355. width: 50%;
  356. height: 100%;
  357. line-height: 20rpx;
  358. display: flex;
  359. align-items: center;
  360. .shuo-label {
  361. width: 180rpx;
  362. color: rgba(16, 16, 16, 1);
  363. font-size: 28rpx;
  364. text-align: left;
  365. font-family: PingFangSC-regular;
  366. text-align-last: justify;
  367. }
  368. .shuo-cont {
  369. color: rgba(16, 16, 16, 1);
  370. font-size: 25rpx;
  371. text-align: left;
  372. font-family: PingFangSC-regular;
  373. margin-left: 10rpx;
  374. }
  375. .shuo-await {
  376. color: rgba(255, 191, 107, 1);
  377. font-size: 28rpx;
  378. text-align: left;
  379. font-family: PingFangSC-regular;
  380. margin-left: 20rpx;
  381. }
  382. .shuo-ready {
  383. color: rgba(162, 239, 77, 1);
  384. font-size: 28rpx;
  385. text-align: left;
  386. font-family: PingFangSC-regular;
  387. margin-left: 20rpx;
  388. }
  389. }
  390. .shuo-one-cont {
  391. width: 60%;
  392. }
  393. .shuo-min {
  394. width: 33%;
  395. }
  396. .max-item {
  397. width: 68%;
  398. margin-left: 10rpx;
  399. .shuo-cont {
  400. font-size: 20rpx;
  401. }
  402. }
  403. }
  404. }
  405. }
  406. uni-page-body {
  407. width: 100%;
  408. height: 100%;
  409. }
  410. </style>