detailDialog.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <div>
  3. <div class="switch">
  4. <div class="switch_left">
  5. <ul>
  6. <li
  7. v-for="item in tabOptions"
  8. :key="item.key"
  9. :class="{ active: activeComp == item.key }"
  10. @click="changeActive(item)"
  11. >
  12. {{ item.name }}
  13. </li>
  14. </ul>
  15. </div>
  16. </div>
  17. <div v-show="activeComp == 'main'">
  18. <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  19. <headerTitle title="入库单详情"></headerTitle>
  20. <el-row>
  21. <el-col :span="12">
  22. <el-form-item label="物品名称:" prop="categoryName">
  23. {{ form.categoryName }}
  24. </el-form-item>
  25. <el-form-item label="物品分类:" prop="categoryLevelName">
  26. {{ form.categoryLevelName }}
  27. </el-form-item>
  28. <el-form-item label="包装数量:" prop="totalPackage">
  29. {{ form.totalPackage }}
  30. </el-form-item>
  31. <el-form-item label="包装单位:" prop="packingUnit">
  32. {{ form.packingUnit }}
  33. </el-form-item>
  34. <el-form-item label="计量单位:" prop="totalCount">
  35. {{ form.totalCount }}
  36. </el-form-item>
  37. </el-col>
  38. <!-- <el-col :span="12">
  39. <el-form-item label="车牌号:" prop="carNo">
  40. {{ form.carNo }}
  41. </el-form-item>
  42. <el-form-item label="收货单编码:" prop="receiveNo">
  43. {{ form.receiveNo }}
  44. </el-form-item>
  45. <el-form-item label="制单人:" prop="makerName">
  46. {{ form.makerName }}
  47. </el-form-item>
  48. <el-form-item prop="orderNo" label="订单编码:">
  49. {{ form.orderNo }}
  50. </el-form-item>
  51. </el-col> -->
  52. </el-row>
  53. </el-form>
  54. </div>
  55. <keep-alive>
  56. <add
  57. ref="add"
  58. v-if="activeComp == 'storage'"
  59. :inboundType="form.sourceType"
  60. type="sourceBizNo"
  61. @success="success"
  62. ></add>
  63. </keep-alive>
  64. </div>
  65. </template>
  66. <script>
  67. import { getStorageDetail } from '@/api/mes/index';
  68. import dictMixins from '@/mixins/dictMixins';
  69. import { reviewStatusEnum } from '@/enum/dict';
  70. import add from './productionWarehousing.vue';
  71. export default {
  72. props: {
  73. businessId: {
  74. default: ''
  75. },
  76. taskId: {
  77. default: ''
  78. },
  79. taskDefinitionKey: {
  80. default: ''
  81. }
  82. },
  83. components: {
  84. add
  85. },
  86. mixins: [dictMixins],
  87. data() {
  88. return {
  89. activeComp: 'main',
  90. tabOptions: [
  91. { key: 'main', name: '生产入库单详情' },
  92. { key: 'storage', name: '生产入库' }
  93. ],
  94. reviewStatusEnum,
  95. rules: {},
  96. form: {},
  97. detailData: {}
  98. };
  99. },
  100. async created() {
  101. await this.getDetailData(this.businessId);
  102. // if (this.taskDefinitionKey == 'storeman') {
  103. // this.activeComp = 'storage';
  104. // this.$emit('activeCompChange', 'storage');
  105. // this.$nextTick(() => {
  106. // this.$refs.add.pickerSuccess(this.form);
  107. // });
  108. // }
  109. },
  110. methods: {
  111. changeActive(item) {
  112. this.activeComp = item.key;
  113. this.$emit('activeCompChange', item.key);
  114. if (this.taskDefinitionKey == 'storeman' && item.key == 'storage') {
  115. this.$nextTick(() => {
  116. this.$refs.add.pickerSuccess(this.form);
  117. });
  118. }
  119. },
  120. success() {
  121. this.$emit('handleClose');
  122. },
  123. async getTableValue() {
  124. return {
  125. form: this.form,
  126. returnStorageData:
  127. this.$refs.add && (await this.$refs.add.getReturnStorage())
  128. };
  129. },
  130. async getDetailData(id) {
  131. this.loading = true;
  132. const data = await getStorageDetail(id);
  133. console.log('data-----------', data);
  134. this.loading = false;
  135. if (data) {
  136. this.form = data;
  137. this.detailData = data;
  138. }
  139. }
  140. }
  141. };
  142. </script>
  143. <style scoped lang="scss">
  144. .ele-dialog-form {
  145. .el-form-item {
  146. margin-bottom: 10px;
  147. }
  148. }
  149. .headbox {
  150. display: flex;
  151. justify-content: flex-start;
  152. align-items: center;
  153. .amount {
  154. font-size: 14px;
  155. font-weight: bold;
  156. margin-right: 20px;
  157. }
  158. }
  159. </style>