index.vue 10 KB

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