project-detail.component.html 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <!-- 四阶段导航 -->
  2. <div class="stage-toolbar">
  3. <div class="stage-navigation">
  4. @for (stage of stages; track stage.id) {
  5. <div
  6. class="stage-item"
  7. [class.completed]="getStageStatus(stage.id) === 'completed'"
  8. [class.active]="getStageStatus(stage.id) === 'active'"
  9. [class.pending]="getStageStatus(stage.id) === 'pending'"
  10. (click)="switchStage(stage.id)">
  11. <div class="stage-circle">
  12. @if (getStageStatus(stage.id) === 'completed') {
  13. <svg class="icon" viewBox="0 0 512 512">
  14. <path fill="currentColor" d="M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192 192-86 192-192z" opacity=".3"/>
  15. <path fill="currentColor" d="M352 176L217.6 336 160 272"/>
  16. </svg>
  17. } @else {
  18. <span>{{ stage.number }}</span>
  19. }
  20. </div>
  21. <div class="stage-label">{{ stage.name }}</div>
  22. </div>
  23. @if (!$last) {
  24. <div class="stage-connector" [class.completed]="getStageStatus(stage.id) === 'completed'"></div>
  25. }
  26. }
  27. </div>
  28. </div>
  29. <div class="content">
  30. <!-- 加载中 -->
  31. @if (loading) {
  32. <div class="loading-container">
  33. <div class="spinner">
  34. <div class="spinner-circle"></div>
  35. </div>
  36. <p>加载项目信息...</p>
  37. </div>
  38. }
  39. <!-- 错误 -->
  40. @if (error && !loading) {
  41. <div class="error-container">
  42. <svg class="icon error-icon" viewBox="0 0 512 512">
  43. <path fill="currentColor" d="M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm0 319.91a20 20 0 1120-20 20 20 0 01-20 20zm21.72-201.15l-5.74 122a16 16 0 01-32 0l-5.74-121.94v-.05a21.74 21.74 0 1143.44 0z"/>
  44. </svg>
  45. <p>{{ error }}</p>
  46. <button class="button outline" (click)="loadData()">重试</button>
  47. </div>
  48. }
  49. <!-- 项目详情内容 -->
  50. @if (!loading && !error && project) {
  51. <!-- 客户选择组件(剥离为外部组件) -->
  52. <app-contact-selector
  53. [project]="project"
  54. [groupChat]="groupChat"
  55. [currentUser]="currentUser"
  56. (contactSelected)="onContactSelected($event)">
  57. </app-contact-selector>
  58. <!-- 项目问卷卡片 -->
  59. @if (contact && (currentStage=='order' || currentStage=='requirements')) {
  60. <div class="survey-card">
  61. <div class="survey-header">
  62. <div class="survey-title">
  63. <svg class="icon" viewBox="0 0 512 512">
  64. <path fill="currentColor" d="M336 64h32a48 48 0 0148 48v320a48 48 0 01-48 48H144a48 48 0 01-48-48V112a48 48 0 0148-48h32" opacity=".3"/>
  65. <path fill="currentColor" d="M336 64h-80a48 48 0 00-96 0h-80a48 48 0 00-48 48v320a48 48 0 0048 48h224a48 48 0 0048-48V112a48 48 0 00-48-48zM256 32a16 16 0 11-16 16 16 16 0 0116-16zm112 400H144V112h224z"/>
  66. <path fill="currentColor" d="M176 208h160v16H176zm0 64h160v16H176zm0 64h160v16H176z"/>
  67. </svg>
  68. <span>项目需求调查</span>
  69. </div>
  70. <div class="survey-badge" [class.filled]="surveyStatus.filled">
  71. {{ surveyStatus.filled ? '已填写' : '待填写' }}
  72. </div>
  73. </div>
  74. <div class="survey-content">
  75. @if (surveyStatus.filled) {
  76. <!-- 已填写状态 -->
  77. <div class="survey-info">
  78. <svg class="icon success-icon" viewBox="0 0 512 512">
  79. <path fill="currentColor" d="M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm108.25 138.29l-134.4 160a16 16 0 01-12 5.71h-.27a16 16 0 01-11.89-5.3l-57.6-64a16 16 0 1123.78-21.4l45.29 50.32 122.59-145.91a16 16 0 0124.5 20.58z"/>
  80. </svg>
  81. <div class="survey-text">
  82. <p class="survey-desc">
  83. {{ surveyStatus.contact.get('realname') || surveyStatus.contact.get('name') }} 已完成需求调查
  84. </p>
  85. <p class="survey-meta">
  86. 完成时间: {{ surveyStatus.surveyLog?.get('completedAt') | date:'yyyy-MM-dd HH:mm' }}
  87. </p>
  88. </div>
  89. </div>
  90. <button class="button secondary" (click)="handleSurveyClick($event)">
  91. <svg class="icon" viewBox="0 0 512 512">
  92. <path fill="currentColor" d="M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 00-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 000-17.47C428.89 172.28 347.8 112 255.66 112z" opacity=".3"/>
  93. <circle cx="256" cy="256" r="80" fill="currentColor"/>
  94. </svg>
  95. <span>查看答卷</span>
  96. </button>
  97. } @else {
  98. <!-- 未填写状态 -->
  99. <div class="survey-info">
  100. <svg class="icon pending-icon" viewBox="0 0 512 512">
  101. <path fill="currentColor" d="M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm0 319.91a20 20 0 1120-20 20 20 0 01-20 20zm21.72-201.15l-5.74 122a16 16 0 01-32 0l-5.74-121.94v-.05a21.74 21.74 0 1143.44 0z"/>
  102. </svg>
  103. <div class="survey-text">
  104. <p class="survey-desc">
  105. 邀请 客户 填写项目需求调查表
  106. </p>
  107. <p class="survey-meta">
  108. 了解客户需求,提供更精准的服务方案
  109. </p>
  110. </div>
  111. </div>
  112. @if (canEdit && groupChat) {
  113. <button class="button primary" (click)="handleSurveyClick($event)">
  114. <svg class="icon" viewBox="0 0 512 512">
  115. <path fill="currentColor" d="M476.59 227.05l-.16-.07L49.35 49.84A23.56 23.56 0 0027.14 52 24.65 24.65 0 0016 72.59v113.29a24 24 0 0019.52 23.57l232.93 43.07a4 4 0 010 7.86L35.53 303.45A24 24 0 0016 327v113.31A23.57 23.57 0 0026.59 460a23.94 23.94 0 0013.22 4 24.55 24.55 0 009.52-1.93L476.4 285.94l.19-.09a32 32 0 000-58.8z"/>
  116. </svg>
  117. <span>发送问卷</span>
  118. </button>
  119. } @else {
  120. <div class="survey-tips">
  121. <svg class="icon" viewBox="0 0 512 512">
  122. <path fill="currentColor" d="M256 56C145.72 56 56 145.72 56 256s89.72 200 200 200 200-89.72 200-200S366.28 56 256 56zm0 82a26 26 0 11-26 26 26 26 0 0126-26zm48 226h-88a16 16 0 010-32h28v-88h-16a16 16 0 010-32h32a16 16 0 0116 16v104h28a16 16 0 010 32z"/>
  123. </svg>
  124. <span>需要在企微群聊中发送问卷</span>
  125. </div>
  126. }
  127. }
  128. </div>
  129. <!-- 问卷说明 -->
  130. @if (!surveyStatus.filled) {
  131. <div class="survey-footer">
  132. <div class="survey-highlights">
  133. <div class="highlight-item">
  134. <svg class="icon" viewBox="0 0 512 512">
  135. <path fill="currentColor" d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm61.8-104.4l-84.9-61.7c-3.1-2.3-4.9-5.9-4.9-9.7V116c0-6.6 5.4-12 12-12h32c6.6 0 12 5.4 12 12v141.7l66.8 48.6c5.4 3.9 6.5 11.4 2.6 16.8L334.6 349c-3.9 5.3-11.4 6.5-16.8 2.6z"/>
  136. </svg>
  137. <span>3-5分钟</span>
  138. </div>
  139. <div class="highlight-item">
  140. <svg class="icon" viewBox="0 0 512 512">
  141. <path fill="currentColor" d="M144 144v296a8 8 0 008 8h56V144zm144 0v304h56a8 8 0 008-8V144zm144 0v272a24 24 0 01-24 24h-40V144zM64 144v328a24 24 0 0024 24h40V144z" opacity=".3"/>
  142. <path fill="currentColor" d="M496 124a12 12 0 00-12-12H432V40a24 24 0 00-24-24H104a24 24 0 00-24 24v72H28a12 12 0 00-12 12v20a12 12 0 0012 12h456a12 12 0 0012-12zm-96-12H112V48h288z"/>
  143. </svg>
  144. <span>8道题目</span>
  145. </div>
  146. <div class="highlight-item">
  147. <svg class="icon" viewBox="0 0 512 512">
  148. <path fill="currentColor" d="M400 192H32L16 448l16 32h448l16-32-16-256zm-280 96h-16a8 8 0 01-8-8v-16a8 8 0 018-8h16a8 8 0 018 8v16a8 8 0 01-8 8z"/>
  149. <path fill="currentColor" d="M464 32H48C21.5 32 0 53.5 0 80v96h512V80c0-26.5-21.5-48-48-48zM148 140a12 12 0 01-12 12h-52a12 12 0 01-12-12v-24a12 12 0 0112-12h52a12 12 0 0112 12zm216 0a12 12 0 01-12 12H212a12 12 0 01-12-12v-24a12 12 0 0112-12h140a12 12 0 0112 12z"/>
  150. </svg>
  151. <span>选择题为主</span>
  152. </div>
  153. </div>
  154. </div>
  155. }
  156. </div>
  157. }
  158. <!-- 子路由内容(各阶段组件) -->
  159. <div class="stage-content">
  160. <router-outlet></router-outlet>
  161. </div>
  162. }
  163. <!-- 项目底部卡片 -->
  164. @if (!loading && !error && project) {
  165. <app-project-bottom-card
  166. [project]="project"
  167. [groupChat]="groupChat"
  168. [currentUser]="currentUser"
  169. [cid]="cid"
  170. [issueCount]="issueCount"
  171. (showFiles)="showFiles()"
  172. (showMembers)="showMembers()"
  173. (showIssues)="showIssues()">
  174. </app-project-bottom-card>
  175. }
  176. <!-- 文件模态框 -->
  177. <app-project-files-modal
  178. [project]="project"
  179. [currentUser]="currentUser"
  180. [isVisible]="showFilesModal"
  181. (close)="closeFilesModal()">
  182. </app-project-files-modal>
  183. <!-- 成员模态框 -->
  184. <app-project-members-modal
  185. [project]="project"
  186. [groupChat]="groupChat"
  187. [currentUser]="currentUser"
  188. [cid]="cid"
  189. [isVisible]="showMembersModal"
  190. (close)="closeMembersModal()">
  191. </app-project-members-modal>
  192. <!-- 问题模态框 -->
  193. <app-project-issues-modal
  194. [project]="project"
  195. [currentUser]="currentUser"
  196. [isVisible]="showIssuesModal"
  197. (close)="closeIssuesModal()">
  198. </app-project-issues-modal>
  199. </div>