detailDialog.vue 6.9 KB

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