detailDialog.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <ele-modal
  3. custom-class="ele-dialog-form long-dialog-form"
  4. :centered="true"
  5. :visible.sync="detailDialogFlag"
  6. :title="title"
  7. :append-to-body="true"
  8. :close-on-click-modal="false"
  9. width="70%"
  10. :before-close="cancel"
  11. :maxable="true"
  12. :resizable="true"
  13. >
  14. <el-card shadow="never">
  15. <div class="switch">
  16. <div class="switch_left">
  17. <ul>
  18. <li
  19. v-for="item in tabOptions"
  20. :key="item.key"
  21. :class="{ active: activeComp == item.key }"
  22. @click="activeComp = item.key"
  23. >
  24. {{ item.name }}
  25. </li>
  26. </ul>
  27. </div>
  28. </div>
  29. </el-card>
  30. <div v-show="activeComp === 'main'">
  31. <!--采购对账单信息-->
  32. <purchase-form
  33. :dataForm.sync="dataForm"
  34. :datasource.sync="datasource"
  35. dialogType="view"
  36. ></purchase-form>
  37. <headerTitle title="应付信息" style="margin-top: 30px"></headerTitle>
  38. <payables-info
  39. :dataForm.sync="dataForm"
  40. :payablesList="payablesList"
  41. :dialogType="dialogType"
  42. ref="payablesInfoRef"
  43. ></payables-info>
  44. <headerTitle title="对账明细" style="margin-top: 30px"></headerTitle>
  45. <account-detail-table
  46. ref="accountDetailTableRef"
  47. :datasource.sync="datasource"
  48. :dialogType="dialogType"
  49. :queryDimension="dataForm.queryDimension"
  50. @totalChange="handleTotalChange"
  51. @countChange="handleCountChange"
  52. @statementAmountChange="handleStatementAmountChange"
  53. ></account-detail-table>
  54. </div>
  55. <bpmDetail
  56. v-if="activeComp === 'bpm' && form.processInstanceId"
  57. :id="form.processInstanceId"
  58. ></bpmDetail>
  59. <div slot="footer" class="footer">
  60. <el-button @click="cancel">返回</el-button>
  61. </div>
  62. </ele-modal>
  63. </template>
  64. <script>
  65. import bpmDetail from '@/views/bpm/processInstance/detail.vue';
  66. import { accountstatementInfoAPI } from '@/api/saleManage/accountstatement';
  67. import purchaseForm from './purchaseForm.vue';
  68. import payablesInfo from './payablesInfo.vue';
  69. import AccountDetailTable from '@/views/saleManage/saleOrder/accountstatement/components/accountDetailTable.vue';
  70. export default {
  71. props: ['detailDialogFlag'],
  72. components: {
  73. purchaseForm,
  74. payablesInfo,
  75. AccountDetailTable,
  76. bpmDetail
  77. },
  78. data() {
  79. return {
  80. activeComp: 'main',
  81. tabOptions: [
  82. { key: 'main', name: '对账单详情' },
  83. { key: 'bpm', name: '流程详情' }
  84. ],
  85. visible: false,
  86. form: {},
  87. dataForm: {},
  88. datasource: [],
  89. payablesList: [],
  90. statPayable: null,
  91. dialogType: 'view',
  92. title: '详情',
  93. fullscreen: false
  94. };
  95. },
  96. methods: {
  97. async open(dialogType, row, type = '') {
  98. this.form = row;
  99. this.dialogType = dialogType;
  100. this.dataForm.type = type;
  101. let data = await accountstatementInfoAPI(row.id);
  102. this.datasource = data.productList || [];
  103. this.payablesList =
  104. (data.statPayable && data.statPayable.statPayableDetailList) || [];
  105. // 保存查询到的完整 statPayable 对象,提交时回填使用(详情页只读,但保留字段方便编辑场景扩展)
  106. this.statPayable = data.statPayable || null;
  107. this.dataForm = {
  108. ...this.dataForm,
  109. ...data
  110. };
  111. switch (this.dataForm.dateType) {
  112. case 1:
  113. this.dataForm.year = this.dataForm.dateValue;
  114. break;
  115. case 2:
  116. //2023年-四季度
  117. let dateArr = this.dataForm.dateValue.split('年-');
  118. this.dataForm.year = dateArr[0];
  119. this.dataForm.quarter = dateArr[1];
  120. break;
  121. case 3:
  122. this.dataForm.month = this.dataForm.dateValue;
  123. break;
  124. default:
  125. this.dataForm.dateValue = '';
  126. this.dataForm.dateTimeRange = [
  127. this.dataForm.startDate,
  128. this.dataForm.endDate
  129. ];
  130. }
  131. },
  132. handleTotalChange(total) {
  133. this.dataForm.amountTotalPrice = total;
  134. },
  135. handleCountChange(count) {
  136. this.dataForm.totalStatementCount = count;
  137. },
  138. // 对账明细按采购单号汇总本次对账金额,同步到应付信息对应行
  139. handleStatementAmountChange(summaryMap) {
  140. if (this.$refs.payablesInfoRef) {
  141. this.$refs.payablesInfoRef.syncStatementAmount(summaryMap);
  142. }
  143. },
  144. cancel() {
  145. this.$emit('update:detailDialogFlag', false);
  146. }
  147. }
  148. };
  149. </script>
  150. <style scoped lang="scss">
  151. .ele-dialog-form {
  152. .el-form-item {
  153. margin-bottom: 10px;
  154. }
  155. }
  156. .none {
  157. display: none;
  158. }
  159. .headbox {
  160. display: flex;
  161. justify-content: flex-start;
  162. align-items: center;
  163. .amount {
  164. font-size: 14px;
  165. font-weight: bold;
  166. margin-right: 20px;
  167. }
  168. }
  169. ::v-deep.el-divider {
  170. margin: 10px;
  171. font-weight: bold;
  172. }
  173. </style>