index.vue 11 KB

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