InventoryDataProcessingStep8.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <div>
  3. <a-result v-if="isShow" status="success" title="操作成功!" sub-title="恭喜您,合并盘点单成功.">
  4. <template #extra>
  5. <div style="text-align: left; margin-bottom: 20px;">
  6. <a-table :columns="columns" :data-source="organizationNames">
  7. <template #bodyCell="{ column,record }">
  8. <template v-if="column.key === 'name'" />
  9. <template v-else-if="column.key === 'documentName'">
  10. <span>
  11. {{ record.documentName }}
  12. </span>
  13. </template>
  14. <template v-else-if="column.key === 'documentNo'">
  15. <span>
  16. {{ record.documentNo }}
  17. </span>
  18. </template>
  19. <template v-else-if="column.key === 'operation'">
  20. <a-button type="primary" @click="openCurdWindow(record.id)">查看盘点单</a-button>
  21. </template>
  22. </template>
  23. </a-table>
  24. </div>
  25. </template>
  26. </a-result>
  27. <a-result v-else title="合并盘点单">
  28. <template #extra>
  29. <a-button key="console" type="primary" @click="end">确定合并盘点</a-button>
  30. </template>
  31. </a-result>
  32. <a-divider />
  33. <Loading v-if="loading" />
  34. <a-button key="console" type="primary" @click="previous">上一步</a-button>
  35. <a-button key="console" style="float: right;" type="primary" @click="next">下一步</a-button>
  36. </div>
  37. </template>
  38. <script>
  39. import {
  40. Notify,
  41. Uuid,
  42. } from 'pc-component-v3';
  43. import Common from '../../common/Common.js';
  44. import AssetInventoryResource from '../../api/asset/AssetInventoryResource.js';
  45. export default {
  46. components: {},
  47. props: {
  48. currentStep: {
  49. type: Object,
  50. default () {
  51. return {};
  52. },
  53. },
  54. },
  55. // 定义抛出的事件名称
  56. emits: ['previous'],
  57. data: function() {
  58. this.treeList = [];
  59. return {
  60. treeData: [],
  61. expandedKeys: [],
  62. checkedKeys: [],
  63. autoExpandParent: true,
  64. inventorySheetName: null,
  65. currentStepTempory: {},
  66. isShow: false,
  67. loading: false,
  68. organizationNames: [],
  69. columns: [{
  70. title: '部门',
  71. dataIndex: 'name',
  72. key: 'name',
  73. }, {
  74. title: '盘点单名称',
  75. dataIndex: 'documentName',
  76. key: 'documentName',
  77. }, {
  78. title: '盘点单编号',
  79. dataIndex: 'documentNo',
  80. key: 'documentNo',
  81. },
  82. {
  83. title: '操作',
  84. dataIndex: 'operation',
  85. key: 'operation',
  86. },
  87. ],
  88. };
  89. },
  90. mounted: function() {
  91. console.log('333333');
  92. console.log(this.currentStep);
  93. },
  94. methods: {
  95. /**
  96. * 打开资产盘点单的CURD窗口
  97. */
  98. openCurdWindow: function(data) {
  99. let url = Common.getRedirectUrl('#/desktop/window1/window-read/view/041101/0/' + data +
  100. '?currPage=1&currIndex=1&totalCount=1&uuid=' + Uuid.createUUID());
  101. window.open(url);
  102. },
  103. end: function() {
  104. var _self = this;
  105. _self.loading = true;
  106. var mergeIntoInventoryIds = [];
  107. mergeIntoInventoryIds.push(_self.currentStep.mergeInventorySheetId);
  108. var param = {
  109. combinedInventoryIds: _self.currentStep.consolidatedInventorySheetIds,
  110. mergeIntoInventoryIds: mergeIntoInventoryIds,
  111. };
  112. AssetInventoryResource.consolidatedAssetInventory(param).then(
  113. successData => {
  114. if (successData.errorCode == 0) {
  115. _self.isShow = true;
  116. var organizationName = {
  117. name: successData.organizationName,
  118. documentNo: successData.documentNo,
  119. documentName: successData.name,
  120. id: successData.id,
  121. };
  122. _self.organizationNames.push(organizationName);
  123. Common.showDialog('提示', successData.errorMessage, 'success');
  124. } else {
  125. Common.showDialog('提示', successData.errorMessage, 'error');
  126. }
  127. console.log(successData);
  128. _self.loading = false;
  129. },
  130. errorData => {
  131. _self.loading = false;
  132. },
  133. );
  134. },
  135. previous: function() {
  136. var _self = this;
  137. var data = {
  138. currentStep: 1,
  139. showPage: 7,
  140. mergeInventorySheetId: _self.currentStep.mergeInventorySheetId,
  141. };
  142. this.$emit('previous', data);
  143. },
  144. next: function() {
  145. var _self = this;
  146. _self.$router.push('/eam/assetInventory');
  147. },
  148. },
  149. };
  150. </script>
  151. <style>
  152. </style>