detailDialog.vue 7.6 KB

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