detailDialog.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <div>
  3. <!-- <div class="switch">
  4. <div class="switch_left">
  5. <ul>
  6. <li v-for="item in tabOptions" :key="item.key" :class="{ active: activeComp == item.key }"
  7. @click="changeActive(item)">
  8. {{ item.name }}
  9. </li>
  10. </ul>
  11. </div>
  12. </div> -->
  13. <div>
  14. <div v-for="item in tabOptions" :label="item.name" :name="item.name">
  15. <headerTitle :title="item.name"></headerTitle>
  16. <div v-if="item.key == 'main'">
  17. <receiptInfo ref="modalRefs" :businessId="businessId" :form="form" :detailData="detailData">
  18. </receiptInfo>
  19. </div>
  20. <div v-if="item.key == 'inoutBound'">
  21. <add ref="modalRefs" :form="form" :sourceBizNo="form.receiveNo" :saleProductList="form.productList"
  22. :bizType="2" :detailProductList="detailData.productList"></add>
  23. </div>
  24. <div v-if="item.key == 'inoutBoundView'">
  25. <detailDialog ref="modalRefs" :bizType="2" :businessId="form.receiveNo" :isUpload="isUpload">
  26. </detailDialog>
  27. </div>
  28. <div v-if="item.key == 'inoutBoundEdit'">
  29. <procurementWarehousing :businessId="form.receiveNo" :qualityInspectionItems="qualityInspectionItems"
  30. ref="modalRefs">
  31. </procurementWarehousing>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </template>
  37. <script>
  38. import dictMixins from '@/mixins/dictMixins';
  39. import { getReceiveSaleOrderrecordDetail } from '@/api/bpm/components/purchasingManage/purchaseorderreceive';
  40. import detailDialog from '@/views/bpm/stockManagement/details.vue';
  41. import procurementWarehousing from '@/views/bpm/stockManagement/quality.vue';
  42. import receiptInfo from './receiptInfo.vue';
  43. import add from '@/views/bpm/stockManagement/storage.vue';
  44. import storageApi from '@/api/warehouseManagement';
  45. import fileMain from '@/components/addDoc/index.vue';
  46. export default {
  47. props: {
  48. businessId: {
  49. default: ''
  50. },
  51. taskId: {
  52. default: ''
  53. },
  54. taskDefinitionKey: {
  55. default: ''
  56. }
  57. },
  58. components: {
  59. fileMain,
  60. detailDialog,
  61. procurementWarehousing,
  62. add,
  63. receiptInfo
  64. },
  65. mixins: [dictMixins],
  66. data() {
  67. return {
  68. qualityInspectionItems: [
  69. 'materielDesignation',
  70. 'clientCode',
  71. 'engrave',
  72. 'weight',
  73. 'result'
  74. ],
  75. isUpload: false,
  76. activeComp: 'main',
  77. tabOptions: [{ key: 'main', name: '收货单详情' }],
  78. visible: false,
  79. detailId: '',
  80. title: '详情',
  81. row: {},
  82. activeName: 'base',
  83. form: {
  84. orderFiles: [{ name: '222' }]
  85. },
  86. detailData: {},
  87. };
  88. },
  89. async created() {
  90. await this.getDetailData(this.businessId);
  91. // getOutInBySourceBizNoOrError(this.form.receiveNo)
  92. await storageApi
  93. .getInfoBySourceBizNo(this.form.receiveNo)
  94. .then((res) => {
  95. if (JSON.stringify(res) == '{}') {
  96. // 未查询到相关信息(未入库)
  97. if (this.taskDefinitionKey == 'storeManagerApprove') {
  98. this.tabOptions.push({ key: 'inoutBound', name: '入库单' });
  99. this.activeComp = 'inoutBound';
  100. this.$emit('activeCompChange', 'inoutBound');
  101. // this.$nextTick(() => {
  102. // this.$refs.add.pickerSuccess(this.form);
  103. // });
  104. }
  105. } else {
  106. if (this.taskDefinitionKey == 'qualityInspection') {
  107. this.tabOptions.push({
  108. key: 'inoutBoundEdit',
  109. name: '入库单详情(已入库)'
  110. });
  111. this.activeComp = 'inoutBoundEdit';
  112. } else if (this.taskDefinitionKey == 'qualityInspectionFeedback') {
  113. this.tabOptions.push({
  114. key: 'inoutBoundView',
  115. name: '入库单详情'
  116. });
  117. this.isUpload = true;
  118. this.activeComp = 'inoutBoundView';
  119. } else {
  120. this.tabOptions.push({
  121. key: 'inoutBoundView',
  122. name: '入库单详情'
  123. });
  124. this.isUpload = false;
  125. this.activeComp = 'inoutBoundView';
  126. }
  127. // if (
  128. // ![
  129. // 'starter',
  130. // 'deptLeaderApprove',
  131. // 'storeManagerApprove',
  132. // 'qualityInspection'
  133. // ].includes(this.taskDefinitionKey)
  134. // ) {
  135. // this.tabOptions.push({
  136. // key: 'inoutBoundView',
  137. // name: '入库单详情'
  138. // });
  139. // this.isUpload = true;
  140. // this.activeComp = 'inoutBoundView';
  141. // } else {
  142. // this.tabOptions.push({
  143. // key: 'inoutBoundEdit',
  144. // name: '入库单详情(已入库)'
  145. // });
  146. // this.activeComp = 'inoutBoundEdit';
  147. // }
  148. }
  149. })
  150. .catch(() => {
  151. this.$message.error('获取入库单详情失败');
  152. });
  153. console.log(this.tabOptions, 'this.tabOptions')
  154. },
  155. methods: {
  156. changeActive(item) {
  157. this.activeComp = item.key;
  158. this.$emit('activeCompChange', item.key);
  159. // if (
  160. // this.taskDefinitionKey == 'storeManagerApprove' &&
  161. // item.key == 'inoutBound'
  162. // ) {
  163. // this.$nextTick(() => {
  164. // this.$refs.add.pickerSuccess(this.form);
  165. // });
  166. // }
  167. },
  168. save(data) {
  169. this.$refs.modalRefs[1].handleSave(data);
  170. },
  171. success() {
  172. // this.$parent.handleClose()
  173. this.$emit('handleClose');
  174. },
  175. // 判断质检状态是否全部已检
  176. allListChecked() {
  177. return (
  178. this.$refs.modalRefs[3] &&
  179. this.$refs.modalRefs[3].getStatus()
  180. );
  181. },
  182. async getTableValue() {
  183. console.log(this.$refs.modalRefs[1], 'aaaaaaaad')
  184. return {
  185. form: this.form,
  186. returnStorageData: this.$refs.modalRefs[1].getReturnStorage(),
  187. isAllChecked:
  188. this.$refs.modalRefs[3] &&
  189. (await this.$refs.modalRefs[3].getStatus()),
  190. qualityInspector:
  191. (this.$refs.modalRefs[2] &&
  192. this.$refs.modalRefs[2].getQualityFile()) ||
  193. {}
  194. // qualityInspector:
  195. // (this.$refs.detailDialog &&
  196. // this.$refs.detailDialog.getQualityFile()) ||
  197. // {}
  198. };
  199. },
  200. async getDetailData(id) {
  201. this.loading = true;
  202. const data = await getReceiveSaleOrderrecordDetail(id);
  203. this.loading = false;
  204. if (data) {
  205. console.log(data, '1111111111111111111111');
  206. this.form = data;
  207. this.detailData = data;
  208. }
  209. }
  210. }
  211. };
  212. </script>
  213. <style scoped lang="scss">
  214. .ele-dialog-form {
  215. .el-form-item {
  216. margin-bottom: 10px;
  217. }
  218. }
  219. .headbox {
  220. display: flex;
  221. justify-content: flex-start;
  222. align-items: center;
  223. .amount {
  224. font-size: 14px;
  225. font-weight: bold;
  226. margin-right: 20px;
  227. }
  228. }
  229. </style>