store-out-list.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <div class="container">
  3. <my-nav @listener-helper="helperHandle"></my-nav>
  4. <div class="content">
  5. <!-- <InputNumber :max="10" :min="1" v-model="value1"></InputNumber>-->
  6. <my-modal-material ref="materialModal" @getselectedList="getselectedList"></my-modal-material>
  7. </div>
  8. </div>
  9. </template>
  10. <script>
  11. import MyNav from '@/components/my-nav'
  12. import MyModalMaterial from '@/components/my-modal-form/my-modal-material'
  13. import { ApplyTakeAdd } from '@/api/integrated'
  14. export default {
  15. name: "store-in",
  16. data() {
  17. return {
  18. data: [],
  19. show: false,
  20. material: {},
  21. otherData: []
  22. }
  23. },
  24. components: {
  25. MyNav,
  26. MyModalMaterial
  27. },
  28. methods: {
  29. /* 辅助扫描通知 */
  30. helperHandle (data) {
  31. this.otherData = data
  32. },
  33. getselectedList (data,newData) {
  34. const materialList = []
  35. for (let i = 0; i < data.length; i++) {
  36. const element = data[i];
  37. materialList.push({
  38. materialCode: element.code,
  39. takeQty: element.quantity
  40. })
  41. }
  42. for (let i = 0; i < newData.length; i++) {
  43. const element = newData[i];
  44. if(element.quantity != undefined && element.quantity != ''){
  45. materialList.push({
  46. materialCode: element.materialCode,
  47. takeQty: element.quantity
  48. })
  49. }
  50. }
  51. ApplyTakeAdd({
  52. materialList: materialList
  53. }).then(res => {
  54. if (res.code === 0) {
  55. this.$Message.success(res.msg || '领料成功!')
  56. this.handle(data,newData)
  57. }
  58. })
  59. },
  60. handle(data,newData) {
  61. this.$router.replace({
  62. name: 'store-out',
  63. query: {
  64. data: JSON.stringify(data),
  65. otherData: JSON.stringify(this.otherData),
  66. newData:JSON.stringify(newData)
  67. }
  68. })
  69. }
  70. },
  71. mounted() {
  72. },
  73. destroyed() {
  74. }
  75. }
  76. </script>
  77. <style lang="scss" scoped>
  78. .container {
  79. width: 100vw;
  80. height: 100vh;
  81. overflow: auto;
  82. //background: rgba(2, 125, 180, 1);
  83. background-image: linear-gradient(270deg,
  84. #2c3034 0%,
  85. #50575e 49%,
  86. #2c3034 100%);
  87. .content {
  88. padding: 10px 40px;
  89. margin: 10px;
  90. height: calc(100% - 142px);
  91. display: flex;
  92. align-items: center;
  93. justify-content: center;
  94. //background: rgba(1, 84, 120, 1);
  95. border-radius: 10px;
  96. .reading {
  97. height: 100%;
  98. display: flex;
  99. align-items: center;
  100. justify-content: center;
  101. font-size: 36px;
  102. font-weight: bold;
  103. color: #00FFFF;
  104. }
  105. .title {
  106. padding: 10px 0;
  107. text-align: center;
  108. font-size: 36px;
  109. font-weight: bold;
  110. color: #2dc57c;
  111. }
  112. .list-wrap {
  113. width: 100%;
  114. height: calc(100% - 74px);
  115. //background: rgba(2, 125, 180, 0.486274509803922);
  116. background: #2c3034;
  117. border-radius: 10px;
  118. border: solid 1px #3879e7;
  119. overflow: auto;
  120. .item {
  121. padding: 20px 40px;
  122. //background: rgba(215, 215, 215, 1);
  123. //border-radius: 10px;
  124. cursor: pointer;
  125. color: #ffffff;
  126. border-bottom: solid 1px #2655ad;;
  127. .row {
  128. margin-bottom: 10px;
  129. display: flex;
  130. justify-content: space-between;
  131. align-items: center;
  132. border-radius: 10px;
  133. &:last-child {
  134. margin-bottom: 0;
  135. }
  136. .col {
  137. flex: 1;
  138. font-size: 18px;
  139. text-align: left;
  140. }
  141. }
  142. }
  143. }
  144. }
  145. }
  146. </style>