register.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <div class="box-card">
  3. <el-form ref="form" :model="form" v-loading="loadingStatus" :element-loading-text="loadingText" element-loading-background="rgba(0, 0, 0, 0.2)">
  4. <el-card>
  5. <LabelTemplate title="入库信息"></LabelTemplate>
  6. <Storage :form="form" ref="storage"></Storage>
  7. </el-card>
  8. <div class="interval">
  9. <div></div>
  10. </div>
  11. <el-card>
  12. <LabelTemplate title="物料信息"></LabelTemplate>
  13. <Material :form="form" ref="material"></Material>
  14. <div style="width: 100%; text-align: center">
  15. <el-button type="primary" @click="clickSubmit()" size="small" v-db-click>提 交</el-button>
  16. <el-button @click="clickCancel" size="small" v-db-click>取 消</el-button>
  17. </div>
  18. <br />
  19. </el-card>
  20. </el-form>
  21. </div>
  22. </template>
  23. <script>
  24. import LabelTemplate from '@/components/LabelTemplate'
  25. import Storage from './storage'
  26. import Material from './material'
  27. import * as API from '@/api/shengde/warehouse/outAndInWarehouse'
  28. import Utils from '@/util/transit'
  29. import { mapGetters } from 'vuex'
  30. export default {
  31. name: 'putInStorageTransfer',
  32. components: { LabelTemplate, Storage, Material },
  33. data() {
  34. return {
  35. loadingText: '',
  36. loadingStatus: false,
  37. form: {
  38. comeSubsidiaryId: '',
  39. comeWarehouseId: '',
  40. putSubsidiaryId: '',
  41. putWarehouseId: '',
  42. proposer: '',
  43. content: '',
  44. allotDetailList: [],
  45. },
  46. }
  47. },
  48. created() {
  49. this.form.proposer = this.userInfo.real_name
  50. },
  51. mounted() {},
  52. computed: mapGetters(['userInfo']),
  53. methods: {
  54. clickSubmit() {
  55. let flagStorage = this.$refs.storage.validateForm()
  56. let flagProduct = true
  57. let flagMaterial = true
  58. flagMaterial = this.$refs.material.validateForm()
  59. if (flagStorage && flagProduct && flagMaterial) {
  60. if (this.form.allotDetailList && this.form.allotDetailList.length > 0) {
  61. this.loadingText = '提交数据中,请稍后'
  62. this.loadingStatus = true
  63. API.allotSave(this.form).then(
  64. () => {
  65. Utils.$emit('refreshPutList', true)
  66. this.msgSuccess('提交完成')
  67. this.form = {
  68. comeSubsidiaryId: '',
  69. comeWarehouseId: '',
  70. putSubsidiaryId: '',
  71. putWarehouseId: '',
  72. proposer: '',
  73. content: '',
  74. allotDetailList: [],
  75. }
  76. this.loadingStatus = false
  77. this.$store.dispatch('delView', this.$route)
  78. this.$router.replace({
  79. path: '/shengde/warehouse/putInStorage/index',
  80. })
  81. },
  82. (err) => {
  83. console.log('allotSave: ' + err)
  84. this.loadingStatus = false
  85. }
  86. )
  87. } else {
  88. this.msgInfo('请选择BOM信息')
  89. }
  90. } else {
  91. setTimeout(() => {
  92. const errorDiv = document.getElementsByClassName('is-error')
  93. errorDiv[0].scrollIntoView()
  94. }, 0)
  95. }
  96. },
  97. clickCancel() {
  98. this.$store.dispatch('delView', this.$route)
  99. this.$router.replace({
  100. path: '/shengde/warehouse/putInStorage/index',
  101. })
  102. },
  103. },
  104. }
  105. </script>
  106. <style lang="scss" scoped>
  107. * {
  108. font-size: 12px;
  109. }
  110. .box-card {
  111. height: calc(100vh - 110px);
  112. overflow-y: auto;
  113. }
  114. ::v-deep {
  115. .el-input__inner {
  116. border-radius: 1px;
  117. }
  118. .el-button--mini {
  119. border-radius: 1px;
  120. }
  121. .tableHeader th {
  122. background-color: #edf0f5;
  123. height: 35px;
  124. padding: 0;
  125. }
  126. }
  127. .interval {
  128. div {
  129. height: 12px;
  130. background-color: #f2f2f2;
  131. box-shadow: var(--devui-shadow-fullscreen-overlay, 0 10px 40px 0) var(--devui-shadow, rgba(0, 0, 0, 0.08));
  132. }
  133. }
  134. </style>