index.vue 9.3 KB

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