index.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  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, watchEffect } 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. const tabList = ref<{ key: number; name: string }[]>([]);
  88. const activeKey = ref<number>(1);
  89. const loading = ref<boolean>(false);
  90. const tableList = ref<any[]>([]);
  91. // 表头数据
  92. const { columns, registerColumn } = getTableColumns();
  93. watchEffect(() => {
  94. if (visible.value && props.selectedRow.contracctstatus) {
  95. // 审核拒绝和未提交不显示后面的选项
  96. console.log(props.selectedRow.contracctstatus);
  97. tabList.value = [0, 4, 6].includes(props.selectedRow.contracctstatus)
  98. ? [{ key: 1, name: '合同详情' }]
  99. : [
  100. { key: 1, name: '合同详情' },
  101. { key: 2, name: '点价记录' },
  102. { key: 3, name: '交收记录' },
  103. { key: 4, name: '款项记录' },
  104. { key: 5, name: '发票记录' },
  105. { key: 6, name: '入库记录' },
  106. { key: 7, name: '出库记录' },
  107. { key: 8, name: '变更记录' },
  108. ];
  109. activeKey.value = 1;
  110. }
  111. });
  112. function tabClick() {
  113. const relatedid = props.selectedRow.spotcontractid;
  114. switch (activeKey.value) {
  115. case 1:
  116. break;
  117. case 2: // 点价记录
  118. registerColumn('table_pcweb_someprice_detail_dj', []);
  119. queryResultLoadingAndInfo(QueryBusinessDj, loading, { relatedid }).then((res) => {
  120. tableList.value = res;
  121. });
  122. break;
  123. case 3: // 交收记录
  124. registerColumn('table_pcweb_someprice_detail_js', []);
  125. queryResultLoadingAndInfo(QueryBusinessJs, loading, { relatedid }).then((res) => {
  126. tableList.value = res;
  127. });
  128. break;
  129. case 4: //款项记录
  130. registerColumn('table_pcweb_someprice_detail_kx', []);
  131. queryResultLoadingAndInfo(QueryBusinessKx, loading, { relatedid }).then((res) => {
  132. tableList.value = res;
  133. });
  134. break;
  135. case 5: // 发票记录
  136. registerColumn('table_pcweb_someprice_detail_fp', []);
  137. queryResultLoadingAndInfo(QueryBusinessFp, loading, { relatedid }).then((res) => {
  138. tableList.value = res;
  139. });
  140. break;
  141. case 6: // 入库记录
  142. registerColumn('table_pcweb_someprice_detail_stock', []);
  143. queryResultLoadingAndInfo(QueryAreaStockApply, loading, {
  144. spotcontractid: relatedid,
  145. inouttype: '1,3',
  146. }).then((res) => {
  147. tableList.value = res;
  148. });
  149. break;
  150. case 7: // 出库记录
  151. registerColumn('table_pcweb_someprice_detail_stock_out', []);
  152. queryResultLoadingAndInfo(QueryAreaStockApply, loading, {
  153. spotcontractid: relatedid,
  154. inouttype: '2,4',
  155. }).then((res) => {
  156. tableList.value = res;
  157. });
  158. break;
  159. case 8: //// 变更记录
  160. registerColumn('table_pcweb_someprice_detail_change', []);
  161. queryResultLoadingAndInfo(QueryChangeLog, loading, { RelatedId: relatedid }).then((res) => {
  162. tableList.value = res;
  163. });
  164. break;
  165. }
  166. }
  167. return {
  168. visible,
  169. cancel,
  170. loading,
  171. maskClosableFlag: false,
  172. activeKey,
  173. columns,
  174. tableList,
  175. tabList,
  176. tabClick,
  177. getApplyStatusName,
  178. invoiceStatusName,
  179. getPlanContractType,
  180. InOutTypeName,
  181. };
  182. },
  183. });
  184. </script>
  185. <style lang="less">
  186. .custom-detail {
  187. .ant-modal-content {
  188. .ant-modal-body {
  189. padding-top: 0;
  190. padding-left: 0;
  191. padding-right: 0;
  192. .ant-tabs {
  193. background: @m-black11;
  194. width: 100%;
  195. padding: 0 24px;
  196. .ant-tabs-bar {
  197. margin-bottom: 0;
  198. border-bottom: 0;
  199. }
  200. .anticon {
  201. color: #88a0ae;
  202. }
  203. .ant-tabs-nav-container {
  204. .ant-tabs-nav-wrap {
  205. .ant-tabs-nav {
  206. .ant-tabs-tab {
  207. width: 70px;
  208. margin-right: 43px;
  209. text-align: center;
  210. font-size: 16px;
  211. color: #88a0ae;
  212. padding: 0;
  213. line-height: 45px;
  214. }
  215. .ant-tabs-tab-active.ant-tabs-tab {
  216. color: #3a87f7;
  217. }
  218. .ant-tabs-ink-bar {
  219. width: 70px !important;
  220. background: #3a87f7;
  221. .rounded-corners(1px);
  222. }
  223. }
  224. }
  225. }
  226. }
  227. }
  228. }
  229. .tableDatas {
  230. margin-top: 26px;
  231. padding: 0 24px;
  232. overflow: hidden;
  233. .dialogTable {
  234. width: 100%;
  235. overflow: overlay;
  236. }
  237. }
  238. .ant-form.inlineForm {
  239. margin-top: 20px;
  240. padding: 0 24px;
  241. }
  242. }
  243. </style
  244. >;