project-detail.component.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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 (groupChat) {
  60. <app-group-chat-summary
  61. [groupChat]="groupChat"
  62. [contact]="contact"
  63. [cid]="cid">
  64. </app-group-chat-summary>
  65. }
  66. <!-- 项目问卷卡片 -->
  67. @if (contact && (currentStage=='order' || currentStage=='requirements')) {
  68. <div class="survey-card">
  69. <div class="survey-header">
  70. <div class="survey-title">
  71. <svg class="icon" viewBox="0 0 512 512">
  72. <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"/>
  73. <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"/>
  74. <path fill="currentColor" d="M176 208h160v16H176zm0 64h160v16H176zm0 64h160v16H176z"/>
  75. </svg>
  76. <span>项目需求调查</span>
  77. </div>
  78. <div class="survey-badge" [class.filled]="surveyStatus.filled">
  79. {{ surveyStatus.filled ? '已填写' : '待填写' }}
  80. </div>
  81. </div>
  82. <div class="survey-content">
  83. @if (surveyStatus.filled) {
  84. <!-- 已填写状态 -->
  85. <div class="survey-info">
  86. <svg class="icon success-icon" viewBox="0 0 512 512">
  87. <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"/>
  88. </svg>
  89. <div class="survey-text">
  90. <p class="survey-desc">
  91. {{ surveyStatus.contact.get('realname') || surveyStatus.contact.get('name') }} 已完成需求调查
  92. </p>
  93. <p class="survey-meta">
  94. 完成时间: {{ surveyStatus.surveyLog?.get('completedAt') | date:'yyyy-MM-dd HH:mm' }}
  95. </p>
  96. </div>
  97. </div>
  98. <button class="button secondary" (click)="handleSurveyClick($event)">
  99. <svg class="icon" viewBox="0 0 512 512">
  100. <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"/>
  101. <circle cx="256" cy="256" r="80" fill="currentColor"/>
  102. </svg>
  103. <span>查看答卷</span>
  104. </button>
  105. } @else {
  106. <!-- 未填写状态 -->
  107. <div class="survey-info">
  108. <svg class="icon pending-icon" viewBox="0 0 512 512">
  109. <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"/>
  110. </svg>
  111. <div class="survey-text">
  112. <p class="survey-desc">
  113. 邀请 客户 填写项目需求调查表
  114. </p>
  115. <p class="survey-meta">
  116. 了解客户需求,提供更精准的服务方案
  117. </p>
  118. </div>
  119. </div>
  120. @if (canEdit && groupChat) {
  121. <button class="button primary" (click)="handleSurveyClick($event)">
  122. <svg class="icon" viewBox="0 0 512 512">
  123. <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"/>
  124. </svg>
  125. <span>发送问卷</span>
  126. </button>
  127. } @else {
  128. <div class="survey-tips">
  129. <svg class="icon" viewBox="0 0 512 512">
  130. <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"/>
  131. </svg>
  132. <span>需要在企微群聊中发送问卷</span>
  133. </div>
  134. }
  135. }
  136. </div>
  137. <!-- 问卷说明 -->
  138. @if (!surveyStatus.filled) {
  139. <div class="survey-footer">
  140. <div class="survey-highlights">
  141. <div class="highlight-item">
  142. <svg class="icon" viewBox="0 0 512 512">
  143. <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"/>
  144. </svg>
  145. <span>3-5分钟</span>
  146. </div>
  147. <div class="highlight-item">
  148. <svg class="icon" viewBox="0 0 512 512">
  149. <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"/>
  150. <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"/>
  151. </svg>
  152. <span>8道题目</span>
  153. </div>
  154. <div class="highlight-item">
  155. <svg class="icon" viewBox="0 0 512 512">
  156. <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"/>
  157. <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"/>
  158. </svg>
  159. <span>选择题为主</span>
  160. </div>
  161. </div>
  162. </div>
  163. }
  164. </div>
  165. }
  166. <!-- 子路由内容(各阶段组件) -->
  167. <div class="stage-content">
  168. <!-- 组长审批面板(订单分配阶段 + 待审批状态) -->
  169. @if (showApprovalPanel) {
  170. <app-order-approval-panel
  171. [project]="project"
  172. [currentUser]="currentUser"
  173. (approvalCompleted)="onApprovalCompleted($event)">
  174. </app-order-approval-panel>
  175. } @else {
  176. <router-outlet></router-outlet>
  177. }
  178. </div>
  179. }
  180. <!-- 项目底部卡片 -->
  181. @if (!loading && !error && project) {
  182. <app-project-bottom-card
  183. [project]="project"
  184. [groupChat]="groupChat"
  185. [currentUser]="currentUser"
  186. [cid]="cid"
  187. [issueCount]="issueCount"
  188. (showFiles)="showFiles()"
  189. (showMembers)="showMembers()"
  190. (showIssues)="showIssues()">
  191. </app-project-bottom-card>
  192. }
  193. <!-- 文件模态框 -->
  194. <app-project-files-modal
  195. [project]="project"
  196. [currentUser]="currentUser"
  197. [isVisible]="showFilesModal"
  198. (close)="closeFilesModal()">
  199. </app-project-files-modal>
  200. <!-- 成员模态框 -->
  201. <app-project-members-modal
  202. [project]="project"
  203. [groupChat]="groupChat"
  204. [currentUser]="currentUser"
  205. [cid]="cid"
  206. [isVisible]="showMembersModal"
  207. (close)="closeMembersModal()">
  208. </app-project-members-modal>
  209. <!-- 问题模态框 -->
  210. <app-project-issues-modal
  211. [project]="project"
  212. [currentUser]="currentUser"
  213. [isVisible]="showIssuesModal"
  214. (close)="closeIssuesModal()">
  215. </app-project-issues-modal>
  216. </div>