contractDetails.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <template>
  2. <div style="background: #fff; padding: 0 20px">
  3. <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" @tab-change="handleChange" stretch>
  4. <el-tab-pane label="销售订单" name="first"></el-tab-pane>
  5. <el-tab-pane label="采购订单" name="second"></el-tab-pane>
  6. <el-tab-pane label="交易明细" name="third"></el-tab-pane>
  7. <el-tab-pane label="外销跟单" name="four"> </el-tab-pane>
  8. <el-tab-pane label="预算表" name="five" v-if="isShowSalesFinancemanArrange">
  9. </el-tab-pane>
  10. <el-tab-pane label="结算表" name="six" v-if="isShowSalesFinancemanArrange">
  11. </el-tab-pane>
  12. <el-tab-pane label="单证" name="seven" v-if="isShowSalesFinancemanArrange"></el-tab-pane>
  13. </el-tabs>
  14. <div class="content-box" v-if="['first', 'second'].includes(activeName)">
  15. <div class="left">
  16. <!-- <div style="text-align: center; margin-bottom: 10px" v-if="activeName === 'first'">
  17. <el-button type="primary" @click="openPDF(currentItem)">查看PDF</el-button>
  18. </div> -->
  19. <div v-for="i in leftList" :key="i.id" class="left-item" :style="{ color: currentItem.id === i.id ? '#409eff' : '' }"
  20. @click="handleItemClick(i)">
  21. <div v-if="activeName === 'first'">{{ i.code }}</div>
  22. <div v-if="activeName === 'second'">
  23. {{ i.code }}
  24. </div>
  25. </div>
  26. </div>
  27. <div class="center"></div>
  28. <div class="right">
  29. <div v-if="leftList && leftList.length > 0">
  30. <!-- <div style="text-align: right; margin-bottom: 20px" v-if="activeName === 'first'">
  31. <el-button type="primary" @click="openPDF(currentItem)">查看PDF</el-button>
  32. </div> -->
  33. <div v-if="activeName === 'first'">
  34. <!-- <ContractPDFOne :rowData="rowData"></ContractPDFOne> -->
  35. <ApprovalDetails :query="approvalData"></ApprovalDetails>
  36. </div>
  37. <div v-if="activeName === 'second'">
  38. <!-- <PurchasePDFOne :rowData="rowDataOne"></PurchasePDFOne> -->
  39. <PurchasePDFOneNew :rowData="rowDataOne"></PurchasePDFOneNew>
  40. </div>
  41. </div>
  42. <div v-else style="padding-left: 43.5%">暂无数据</div>
  43. </div>
  44. </div>
  45. <div v-if="activeName === 'third'">
  46. <byTable :hidePagination="true" :hideSearch="true" :source="tableData" :config="config" highlight-current-row :action-list="[]">
  47. <template #amount="{ item }">
  48. <div>{{ item.currency }} {{ moneyFormat(item.amount, 2) }}</div>
  49. </template>
  50. <template #accountManagementName="{ item }">
  51. <div>
  52. {{ item.accountManagementName }}{{
  53. item.accountManagementOpening
  54. }}
  55. </div>
  56. </template>
  57. </byTable>
  58. </div>
  59. <div v-if="activeName === 'four'">
  60. <ExportTracking> </ExportTracking>
  61. </div>
  62. <div v-if="activeName === 'five'">
  63. <ProfitBudgetEHSD> </ProfitBudgetEHSD>
  64. </div>
  65. <div v-if="activeName === 'six'">
  66. <ProfitSettlementEHSD> </ProfitSettlementEHSD>
  67. </div>
  68. <div v-if="activeName === 'seven'">
  69. <Document> </Document>
  70. </div>
  71. <el-dialog title="PDF查看" v-if="pdfDialog" v-model="pdfDialog" width="920">
  72. <!-- <ContractPDFOne :rowData="rowData"></ContractPDFOne> -->
  73. <ContractPDFOneNew :rowData="rowData" ref="PdfDom"></ContractPDFOneNew>
  74. <template #footer>
  75. <el-button @click="pdfDialog = false" size="default">关闭</el-button>
  76. </template>
  77. </el-dialog>
  78. </div>
  79. </template>
  80. <script setup >
  81. import PurchasePDFOne from "@/components/PDF/purchasePDFOne.vue";
  82. import PurchasePDFOneNew from "@/components/PDF/purchasePDFOneNew.vue";
  83. import ContractPDFOne from "@/components/PDF/contractPDFOne.vue";
  84. import ContractPDFOneNew from "@/components/PDF/contractPDFOneNew.vue";
  85. import ApprovalDetails from "@/views/process/processApproval/index.vue";
  86. import ExportTracking from "@/components/detailCom/exportTracking/index.vue";
  87. import ProfitBudgetEHSD from "@/components/detailCom/profitBudgetEHSD/index.vue";
  88. import ProfitSettlementEHSD from "@/components/detailCom/profitSettlementEHSD/index.vue";
  89. import Document from "@/components/detailCom/document/index.vue";
  90. import byTable from "@/components/byTable/index";
  91. import useUserStore from "@/store/modules/user";
  92. const userInfo = useUserStore();
  93. const { proxy } = getCurrentInstance();
  94. import { useRoute } from "vue-router";
  95. const route = useRoute();
  96. const props = defineProps({
  97. contractId: String,
  98. });
  99. const activeName = ref("first");
  100. const currentItem = ref({});
  101. const approvalData = ref({});
  102. const rowData = ref({});
  103. const rowDataOne = ref({});
  104. const leftList = ref([]);
  105. const contractDataList = ref([]);
  106. const purchaseDataList = ref([]);
  107. const tableData = ref([]);
  108. const transactionType = ref([
  109. {
  110. label: "请款",
  111. value: "1",
  112. },
  113. {
  114. label: "采购付款",
  115. value: "20",
  116. },
  117. {
  118. label: "到账认领",
  119. value: "30",
  120. },
  121. ]);
  122. const config = computed(() => {
  123. return [
  124. {
  125. attrs: {
  126. label: "交易时间",
  127. prop: "createTime",
  128. width: 155,
  129. },
  130. },
  131. {
  132. attrs: {
  133. label: "交易类型",
  134. prop: "type",
  135. width: 80,
  136. },
  137. render(type) {
  138. return proxy.dictValueLabel(type, transactionType.value);
  139. },
  140. },
  141. {
  142. attrs: {
  143. label: "交易金额",
  144. prop: "amount",
  145. slot: "amount",
  146. width: 130,
  147. },
  148. },
  149. {
  150. attrs: {
  151. label: "摘要",
  152. prop: "remarks",
  153. },
  154. },
  155. {
  156. attrs: {
  157. label: "资金账户",
  158. prop: "accountManagementName",
  159. slot: "accountManagementName",
  160. },
  161. },
  162. {
  163. attrs: {
  164. label: "对方账户",
  165. prop: "name",
  166. width: 120,
  167. },
  168. },
  169. ];
  170. });
  171. const handleClick = () => {};
  172. const handleItemClick = (item) => {
  173. currentItem.value = item;
  174. if (activeName.value === "first") {
  175. // rowData.value = {
  176. // id: item.id,
  177. // };
  178. approvalData.value = {
  179. flowKey: "contract_flow",
  180. id: currentItem.value.flowId,
  181. processType: 20,
  182. random: proxy.random(),
  183. flowName: "销售订单详情",
  184. businessId: currentItem.value.id,
  185. };
  186. } else if (activeName.value === "second") {
  187. rowDataOne.value = {
  188. id: item.id,
  189. };
  190. }
  191. };
  192. const pdfDialog = ref(false);
  193. const openPDF = (row) => {
  194. rowData.value = {
  195. id: row.id,
  196. };
  197. pdfDialog.value = true;
  198. };
  199. const pushProcessApproval = (row) => {
  200. proxy.$router.push({
  201. path: "/platform_manage/process/processApproval",
  202. query: {
  203. flowKey: "contract_flow",
  204. id: row.flowId,
  205. processType: 20,
  206. random: proxy.random(),
  207. flowName: "销售订单详情",
  208. businessId: row.id,
  209. },
  210. });
  211. return;
  212. };
  213. // const pushProcessApproval = (row) => {
  214. // // 新页面打开方式
  215. // const page = proxy.$router.resolve({
  216. // path: "/platform_manage/process/processApproval",
  217. // query: {
  218. // flowKey: "contract_flow",
  219. // id: row.flowId,
  220. // processType: 20,
  221. // random: proxy.random(),
  222. // flowName: "销售订单详情",
  223. //
  224. // businessId: row.id,
  225. // },
  226. // });
  227. // window.open(page.href, "_blank");
  228. // };
  229. const handleChange = (val) => {
  230. if (["first", "second"].includes(val)) {
  231. if (val === "first") {
  232. leftList.value = contractDataList.value;
  233. }
  234. if (val === "second") {
  235. leftList.value = purchaseDataList.value;
  236. }
  237. if (leftList.value && leftList.value.length > 0) {
  238. handleItemClick(leftList.value[0]);
  239. }
  240. }
  241. };
  242. const getDetailsData = (id) => {
  243. proxy.post("/contract/getVersionList", { id: id }).then((res) => {
  244. contractDataList.value = res;
  245. leftList.value = contractDataList.value;
  246. if (contractDataList.value && contractDataList.value.length > 0) {
  247. handleItemClick(contractDataList.value[0]);
  248. }
  249. });
  250. proxy
  251. .post("/contract/getPurchaseListByContractId", { id: id })
  252. .then((res) => {
  253. purchaseDataList.value = res;
  254. });
  255. proxy
  256. .post("/contract/getAccountRunningWaterByContractId", {
  257. id: id,
  258. })
  259. .then((res) => {
  260. tableData.value = res;
  261. });
  262. };
  263. if (props.contractId) {
  264. getDetailsData(props.contractId);
  265. }
  266. if (route.query.currentContractId) {
  267. getDetailsData(route.query.currentContractId);
  268. }
  269. const isShowSalesFinancemanArrange = ref(false);
  270. const checkShow = () => {
  271. // 当前账号角色如果是业务总监、总经理、业务员、财务,则可查看
  272. if (
  273. userInfo.roles.includes("salesDirector") ||
  274. userInfo.roles.includes("ceo") ||
  275. userInfo.roles.includes("financeOfficer")
  276. ) {
  277. isShowSalesFinancemanArrange.value = true;
  278. }
  279. };
  280. checkShow();
  281. </script>
  282. <style lang="scss" scoped>
  283. .content-box {
  284. display: flex;
  285. font-size: 14px;
  286. .left {
  287. width: 150px;
  288. // background: #ccc;
  289. .left-item {
  290. height: 30px;
  291. line-height: 30px;
  292. text-align: center;
  293. cursor: pointer;
  294. font-size: 14px;
  295. }
  296. }
  297. .center {
  298. // height: calc(100% + 10px);
  299. margin-top: -15px;
  300. width: 20px;
  301. background-color: #f0f2f5;
  302. }
  303. .right {
  304. width: calc(100% - 150px - 20px);
  305. padding-left: 10px;
  306. }
  307. }
  308. .baseRow {
  309. min-height: 24px;
  310. border-top: 1px solid black;
  311. border-left: 1px solid black;
  312. }
  313. .contentRow {
  314. border-right: 1px solid black;
  315. line-height: 24px;
  316. padding-left: 4px;
  317. }
  318. </style>