index.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <!-- 现货合同详情-->
  3. <a-modal class="add-custom custom-detail"
  4. title="现货合同详情"
  5. v-model:visible="visible"
  6. centered
  7. :maskClosable="maskClosableFlag"
  8. @cancel="cancel"
  9. width="890px">
  10. <template #footer>
  11. <a-button key="submit"
  12. type="primary"
  13. :loading="loading"
  14. @click="cancel">关闭
  15. </a-button>
  16. </template>
  17. <a-tabs v-model:activeKey="activeKey"
  18. @change="tabClick">
  19. <a-tab-pane v-for="item in tabList"
  20. :key="item.key"
  21. :tab="item.name">
  22. </a-tab-pane>
  23. </a-tabs>
  24. <InfoDetail :selectedRow="selectedRow"
  25. :businessManager="businessManager"
  26. v-if="activeKey == 1"/>
  27. <div class="tableDatas"
  28. v-else>
  29. <a-table class="dialogTable"
  30. :columns="columns"
  31. :data-source="tableList"
  32. :pagination="false">
  33. <template #status="{ text }">
  34. <span class="yellow">{{ text }}</span>
  35. <!-- 审核通过'green' 审核拒绝 'orange' 待审核'yellow' -->
  36. </template>
  37. <template #applystatus="{ text }">
  38. <a>{{ getApplyStatusName(text) }}</a>
  39. </template>
  40. <!-- 发票金额-->
  41. <template #invoicetype="{ text }">
  42. <a>{{ invoiceStatusName(text) }}</a>
  43. </template>
  44. <!-- 发票类型-->
  45. <template #contracttype="{ text }">
  46. <a>{{ getPlanContractType(text) }}</a>
  47. </template>
  48. <!-- 出入库类型 -->
  49. <template #inouttype="{ text }">
  50. <a>{{ InOutTypeName(text) }}</a>
  51. </template>
  52. </a-table>
  53. </div>
  54. </a-modal>
  55. </template>
  56. <script lang="ts">
  57. import {defineComponent, PropType, ref} from 'vue';
  58. import {closeModal} from '@/common/setup/modal/index';
  59. import {Ermcp3ContractRsp} from '@/services/go/ermcp/spot-contract/interface';
  60. import {queryResultLoadingAndInfo} from '@/common/methods/request/resultInfo';
  61. import {QueryBusinessFp, QueryBusinessKx} from '@/services/go/ermcp/finance-review';
  62. import {QueryBusinessDj, QueryBusinessJs} from '@/services/go/ermcp/business-review';
  63. import {QueryAreaStockApply} from '@/services/go/ermcp/inventory-review';
  64. import {QueryChangeLog} from '@/services/go/ermcp/spot-contract';
  65. import {ErmcpLoginUserEx} from '@/services/go/ermcp/account/interface';
  66. import InfoDetail from '../infoDetail/index.vue';
  67. import {getApplyStatusName} from '@/views/manage/business-review/setup';
  68. import {getTableColumns} from '@/common/setup/table';
  69. import {invoiceStatusName} from "@/views/manage/finance-review/setup";
  70. import {getPlanContractType} from "@/views/business/plan/setup";
  71. import {InOutTypeName} from "@/views/manage/inventory-review/setup";
  72. export default defineComponent({
  73. name: 'spot-contract-detail',
  74. components: {InfoDetail},
  75. props: {
  76. selectedRow: {
  77. type: Object as PropType<Ermcp3ContractRsp>,
  78. default: {},
  79. },
  80. businessManager: {
  81. type: Array as PropType<ErmcpLoginUserEx[]>,
  82. default: [],
  83. },
  84. },
  85. setup: function (props, context) {
  86. const {visible, cancel} = closeModal('detail');
  87. let tabList = ref<any[]> (props.selectedRow.contracctstatus === 4 || 0 ? // 审核拒绝和未提交不显示后面的选项
  88. [{key: 1, name: '合同详情'},]
  89. : [
  90. {key: 1, name: '合同详情'},
  91. {key: 2, name: '点价记录'},
  92. {key: 3, name: '交收记录'},
  93. {key: 4, name: '款项记录'},
  94. {key: 5, name: '发票记录'},
  95. {key: 6, name: '入库记录'},
  96. {key: 7, name: '出库记录'},
  97. {key: 8, name: '变更记录'},
  98. ]);
  99. const activeKey = ref<number>(1);
  100. const loading = ref<boolean>(false);
  101. const tableList = ref<any[]>([]);
  102. // 表头数据
  103. const {columns, registerColumn} = getTableColumns();
  104. function tabClick() {
  105. const relatedid = props.selectedRow.spotcontractid;
  106. switch (activeKey.value) {
  107. case 1:
  108. break;
  109. case 2: // 点价记录
  110. registerColumn('table_pcweb_someprice_detail_dj', []);
  111. queryResultLoadingAndInfo(QueryBusinessDj, loading, {relatedid}).then((res) => {
  112. tableList.value = res;
  113. });
  114. break;
  115. case 3: // 交收记录
  116. registerColumn('table_pcweb_someprice_detail_js', []);
  117. queryResultLoadingAndInfo(QueryBusinessJs, loading, {relatedid}).then((res) => {
  118. tableList.value = res;
  119. });
  120. break;
  121. case 4: //款项记录
  122. registerColumn('table_pcweb_someprice_detail_kx', []);
  123. queryResultLoadingAndInfo(QueryBusinessKx, loading, {relatedid}).then((res) => {
  124. tableList.value = res;
  125. });
  126. break;
  127. case 5: // 发票记录
  128. registerColumn('table_pcweb_someprice_detail_fp', []);
  129. queryResultLoadingAndInfo(QueryBusinessFp, loading, {relatedid}).then((res) => {
  130. tableList.value = res;
  131. });
  132. break;
  133. case 6: // 入库记录
  134. registerColumn('table_pcweb_someprice_detail_stock', []);
  135. queryResultLoadingAndInfo(QueryAreaStockApply, loading, {
  136. spotcontractid: relatedid,
  137. inouttype: '1,3',
  138. }).then((res) => {
  139. tableList.value = res;
  140. });
  141. break;
  142. case 7: // 出库记录
  143. registerColumn('table_pcweb_someprice_detail_stock_out', []);
  144. queryResultLoadingAndInfo(QueryAreaStockApply, loading, {
  145. spotcontractid: relatedid,
  146. inouttype: '2,4',
  147. }).then((res) => {
  148. tableList.value = res;
  149. });
  150. break;
  151. case 8: //// 变更记录
  152. registerColumn('table_pcweb_someprice_detail_change', []);
  153. queryResultLoadingAndInfo(QueryChangeLog, loading, {RelatedId: relatedid}).then((res) => {
  154. tableList.value = res;
  155. });
  156. break;
  157. }
  158. }
  159. return {
  160. visible,
  161. cancel,
  162. loading,
  163. maskClosableFlag: false,
  164. activeKey,
  165. columns,
  166. tableList,
  167. tabList,
  168. tabClick,
  169. getApplyStatusName,
  170. invoiceStatusName,
  171. getPlanContractType,
  172. InOutTypeName,
  173. };
  174. },
  175. });
  176. </script>
  177. <style lang="less">
  178. .custom-detail {
  179. .ant-modal-content {
  180. .ant-modal-body {
  181. padding-top: 0;
  182. padding-left: 0;
  183. padding-right: 0;
  184. .ant-tabs {
  185. background: @m-black11;
  186. width: 100%;
  187. padding: 0 24px;
  188. .ant-tabs-bar {
  189. margin-bottom: 0;
  190. border-bottom: 0;
  191. }
  192. .ant-tabs-nav-container {
  193. .ant-tabs-nav-wrap {
  194. .ant-tabs-nav {
  195. .ant-tabs-tab {
  196. width: 70px;
  197. margin-right: 43px;
  198. text-align: center;
  199. font-size: 16px;
  200. color: #88a0ae;
  201. padding: 0;
  202. line-height: 45px;
  203. }
  204. .ant-tabs-tab-active.ant-tabs-tab {
  205. color: #3a87f7;
  206. }
  207. .ant-tabs-ink-bar {
  208. width: 70px !important;
  209. background: #3a87f7;
  210. .rounded-corners(1px);
  211. }
  212. }
  213. }
  214. }
  215. }
  216. }
  217. }
  218. .tableDatas {
  219. margin-top: 26px;
  220. padding: 0 24px;
  221. overflow: hidden;
  222. .dialogTable {
  223. width: 100%;
  224. overflow: overlay;
  225. }
  226. }
  227. .ant-form.inlineForm {
  228. margin-top: 20px;
  229. padding: 0 24px;
  230. }
  231. }
  232. </style
  233. >;