index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <template>
  2. <div class="h-full flex p-3 flex-col businessDetail">
  3. <div class="w-full bg-white p-2 mb-2 shadow-md rounded-md flex items-center" v-loading="allLoading.skeletonLoading">
  4. <div class="icon mr-4">
  5. <el-link :underline="false" @click="backPath()">
  6. <el-icon class="el-icon--right"><icon-view /></el-icon> 返回商机列表
  7. </el-link>
  8. </div>
  9. <div class="mr-8">
  10. <el-select v-model="optionVal" placeholder="请选择" style="width: 150px" filterable @change="getDetail()">
  11. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
  12. </el-select>
  13. </div>
  14. <div class="flex-1 flex h-full justify-end overflow-auto scroll-bar-hide cursor-pointer" @wheel="handleScroll">
  15. <div :class="`${index === 0 ? 'startStep' : 'nextStep'} relative rounded-md flex items-center backGray pl-6 pr-6`"
  16. v-for="(item, index) in stageList" :key="index">
  17. <div class="pr-3 text-nowrap">{{ item.name }}</div>
  18. <div class="text-nowrap">{{ item.plan }}</div>
  19. </div>
  20. </div>
  21. <div class="relative rounded-md flex items-center itemPing backGray endStep item pl-6 pr-6 mr-4">
  22. <el-select v-model="stageStatusVal" placeholder="结束" style="width: 100px" class="selectClas">
  23. <el-option v-for="(item, index) in stageListOption" :key="index" :label="item.label" :value="item.value" />
  24. </el-select>
  25. </div>
  26. <div class="bg-[#0052CC] rounded-md text itemPing pl-2 pr-2 flex items-center aloneText">
  27. <el-link :underline="false">推进至阶段【验证客户】</el-link>
  28. </div>
  29. </div>
  30. <!-- 内容 -->
  31. <div class="flex-1 flex flex-col overflow-y-auto overflow-x-hidden scroll-bar">
  32. <div class="w-full h-auto flex justify-between">
  33. <div class="bg-white shadow-md rounded-md" style="width: 46%;">
  34. <Information />
  35. </div>
  36. <div class="bg-white ml-2 shadow-md rounded-md flex-1">
  37. <Attachment />
  38. </div>
  39. </div>
  40. <div class="w-full h-auto flex justify-between mt-2">
  41. <div class="bg-white shadow-md rounded-md" style="width: 65%;">
  42. <RelatedTasks />
  43. </div>
  44. <div class="bg-white ml-2 shadow-md rounded-md flex-1">
  45. <OperationRecord />
  46. </div>
  47. </div>
  48. <div class="w-full h-auto flex justify-between mt-2">
  49. <div class="bg-white shadow-md rounded-md w-full">
  50. <Products />
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </template>
  56. <script lang="ts" setup>
  57. import { ref, reactive, onMounted, inject } from "vue";
  58. import type { FormInstance, FormRules } from 'element-plus'
  59. import { Edit, ArrowLeft as IconView } from '@element-plus/icons-vue'
  60. import { backPath } from '@/utils/tools'
  61. import { useRoute } from "vue-router";
  62. import { BUSIESS_ALL, BUSIESS_GETSATE, BUSIESS_INFO } from '../api'
  63. import Information from '../component/information.vue'
  64. import Attachment from '../component/attachment.vue'
  65. import RelatedTasks from '../component/relatedTasks.vue';
  66. import OperationRecord from '../component/operationRecord.vue';
  67. import Products from '../component/products.vue';
  68. import { post } from "@/utils/request";
  69. import { number } from "echarts";
  70. type stageListType = {
  71. name: string,
  72. plan: string
  73. }
  74. const route = useRoute()
  75. const optionVal = ref<any>('')
  76. const stageStatusVal = ref('')
  77. const options = ref<optionType[]>([])
  78. const allLoading = reactive({
  79. skeletonLoading: false
  80. })
  81. const businessInfo = ref({})
  82. const stageListOption = ref<optionType[]>([])
  83. const stageList = ref<stageListType[]>([])
  84. function getDetail() {
  85. allLoading.skeletonLoading
  86. post(BUSIESS_INFO, { id: optionVal.value }).then(({ data }) => {
  87. console.log(data, '<====== 数据')
  88. businessInfo.value = (data || []);
  89. }).finally(() => {
  90. allLoading.skeletonLoading
  91. })
  92. }
  93. function handleScroll(event: any) { // 滚表横向滚动
  94. if (event.deltaY) {
  95. event.preventDefault();
  96. const element = event.currentTarget;
  97. element.scrollLeft += event.deltaY;
  98. }
  99. }
  100. function getOptionAll() {
  101. post(BUSIESS_ALL, {}).then((res) => {
  102. const { data } = res
  103. options.value = (data || []).map((item: any) => ({
  104. value: item.id + '',
  105. label: item.name
  106. }))
  107. })
  108. }
  109. function getSatge() {
  110. post(BUSIESS_GETSATE, {}).then(({ data }) => {
  111. stageList.value = (data || []).sort((a: any, b: any) => { return a.seq - b.seq; }).filter((item: any) => !item.isFinish).map((item: any) => ({ name: item.name, plan: item.plan }))
  112. stageListOption.value = (data || []).sort((a: any, b: any) => { return a.seq - b.seq; }).filter((item: any) => item.isFinish).map((item: any) => ({ label: item.name, value: item.id }))
  113. })
  114. }
  115. onMounted(() => {
  116. const { id } = route.query
  117. optionVal.value = id
  118. getSatge()
  119. getOptionAll()
  120. getDetail()
  121. })
  122. </script>
  123. <style lang="scss" scoped>
  124. .businessDetail {
  125. .icon {
  126. .el-link {
  127. color: #0052CC;
  128. }
  129. }
  130. .text {
  131. .el-link {
  132. color: #fff;
  133. font-size: 14px;
  134. }
  135. }
  136. .backDarkBlue {
  137. background-color: #0052CC;
  138. color: #fff;
  139. }
  140. .backGray {
  141. background-color: #F4F5F7;
  142. color: #000;
  143. }
  144. .startStep {
  145. clip-path: polygon(0% 0%,
  146. 90% 0%,
  147. 100% 50%,
  148. 90% 100%,
  149. 0% 100%);
  150. }
  151. .nextStep {
  152. clip-path: polygon(0% 0%,
  153. 90% 0%,
  154. 100% 50%,
  155. 90% 100%,
  156. 0% 100%,
  157. 10% 50%);
  158. }
  159. .endStep {
  160. clip-path: polygon(0% 0%,
  161. 100% 0%,
  162. 100% 100%,
  163. 0% 100%,
  164. 10% 50%);
  165. }
  166. .itemPing {
  167. padding-top: 4px;
  168. padding-bottom: 4px;
  169. }
  170. .aloneText {
  171. padding-top: 9px;
  172. padding-bottom: 9px;
  173. }
  174. }
  175. </style>
  176. <style lang="scss">
  177. .businessDetail {
  178. .el-select__wrapper {
  179. background-color: #F4F5F7;
  180. box-shadow: none !important;
  181. }
  182. }
  183. </style>