quotation-editor.component.html 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. <!-- 基于Product表的报价编辑器组件 -->
  2. <div class="quotation-editor">
  3. <!-- 加载状态 -->
  4. @if (loading) {
  5. <div class="loading-container">
  6. <div class="spinner">
  7. <div class="spinner-circle"></div>
  8. </div>
  9. <p>加载报价数据...</p>
  10. </div>
  11. }
  12. @if (!loading) {
  13. <!-- 产品管理区域 -->
  14. @if (canEdit) {
  15. <div class="product-management">
  16. <div class="product-header">
  17. <h3>设计产品 ({{ products.length }}个空间)</h3>
  18. <div class="product-actions">
  19. <button class="btn-primary" (click)="generateQuotationFromProducts()">
  20. <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
  21. <path fill="currentColor" d="M447.1 96h-288C131.3 96 112 115.3 112 140.4v231.2C112 396.7 131.3 416 159.1 416h288c27.6 0 48-19.3 48-44.4V140.4C495.1 115.3 475.6 96 447.1 96zM447.1 144v192h-288V144H447.1z"/>
  22. </svg>
  23. 生成报价
  24. </button>
  25. <button class="btn-secondary" (click)="openAddProductModal()">
  26. <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
  27. <path fill="currentColor" d="M256 512c141.4 0 256-114.6 256-256S397.4 0 256 0S0 114.6 0 256S114.6 512 256 512zM256 48c114.7 0 208 93.31 208 208s-93.31 208-208 208S48 370.7 48 256S141.3 48 256 48zM256 336c13.25 0 24-10.75 24-24V280h32c13.25 0 24-10.75 24-24s-10.75-24-24-24h-32V176c0-13.25-10.75-24-24-24s-24 10.75-24 24v56H200c-13.25 0-24 10.75-24 24s10.75 24 24 24h32v32C232 325.3 242.8 336 256 336z"/>
  28. </svg>
  29. 添加产品
  30. </button>
  31. <button class="btn-outline" (click)="saveQuotation()">
  32. <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
  33. <path fill="currentColor" d="M504.1 141C490.6 121.4 471.1 107.5 447.8 96C424.6 84.51 400.8 80 376.1 80H136c-24.74 0-48.48 4.511-71.79 16.01C40.88 107.5 21.36 121.4 7.85 141C-5.654 160.6-1.466 180.2 11.66 195.7L144.1 353c11.14 13.4 27.62 21 44.8 21h124.3c17.18 0 33.66-7.6 44.8-21l133.3-157.4C504.5 180.2 508.6 160.6 504.1 141z"/>
  34. </svg>
  35. 保存报价
  36. </button>
  37. </div>
  38. </div>
  39. </div>
  40. }
  41. @if (quotation.spaces.length === 0 && products.length > 0) {
  42. <!-- 空状态 - 有产品但未生成报价 -->
  43. <div class="empty-state">
  44. <svg class="icon empty-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
  45. <path fill="currentColor" d="M447.1 96h-288C131.3 96 112 115.3 112 140.4v231.2C112 396.7 131.3 416 159.1 416h288c27.6 0 48-19.3 48-44.4V140.4C495.1 115.3 475.6 96 447.1 96zM447.1 144v192h-288V144H447.1z"/>
  46. </svg>
  47. <p class="empty-message">尚未生成报价</p>
  48. <p class="empty-hint">已加载 {{ products.length }} 个设计空间,请点击"生成报价"按钮</p>
  49. @if (canEdit) {
  50. <button class="btn-primary" (click)="generateQuotationFromProducts()">立即生成报价</button>
  51. }
  52. </div>
  53. } @else if (quotation.spaces.length === 0) {
  54. <!-- 完全空状态 - 无产品 -->
  55. <div class="empty-state">
  56. <svg class="icon empty-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
  57. <path fill="currentColor" d="M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464z"/>
  58. </svg>
  59. <p class="empty-message">暂无设计产品</p>
  60. <p class="empty-hint">该项目还没有创建任何设计产品</p>
  61. @if (canEdit) {
  62. <button class="btn-primary" (click)="openAddProductModal()">创建第一个产品</button>
  63. }
  64. </div>
  65. } @else {
  66. <!-- 报价工具栏 -->
  67. <div class="quotation-toolbar">
  68. <div class="toolbar-left">
  69. <h4 class="toolbar-title">报价明细 ({{ quotation.spaces.length }}个设计空间)</h4>
  70. <div class="toolbar-meta">
  71. @if (quotation.generatedAt) {
  72. <span class="generate-time">生成于: {{ quotation.generatedAt | date:'MM-dd HH:mm' }}</span>
  73. }
  74. @if (quotation.validUntil) {
  75. <span class="valid-until">有效期至: {{ quotation.validUntil | date:'yyyy-MM-dd' }}</span>
  76. }
  77. </div>
  78. </div>
  79. <div class="toolbar-right">
  80. <button class="btn-icon" (click)="expandAll()" title="展开全部">
  81. <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
  82. <path fill="currentColor" d="M112 184l144 144 144-144M256 328V88"/>
  83. </svg>
  84. </button>
  85. <button class="btn-icon" (click)="collapseAll()" title="折叠全部">
  86. <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
  87. <path fill="currentColor" d="M112 328l144-144 144 144M256 184v240"/>
  88. </svg>
  89. </button>
  90. </div>
  91. </div>
  92. <!-- 卡片视图 -->
  93. @if (viewMode === 'card') {
  94. <div class="quotation-products">
  95. @for (space of quotation.spaces; track space.name) {
  96. <div class="product-card" [class.expanded]="isProductExpanded(space.name)">
  97. <!-- 产品头部 -->
  98. <div class="product-header" (click)="toggleProductExpand(space.name)">
  99. <div class="product-info">
  100. <div class="product-title">
  101. <div class="product-icon">
  102. <i class="icon-{{ getProductIconForSpace(space.name) }}"></i>
  103. </div>
  104. <div class="product-details">
  105. <h3 class="product-name">{{ space.name }}</h3>
  106. <div class="product-meta">
  107. <span class="badge" [attr.data-color]="getStatusColorForSpace(space.productId)">
  108. {{ getStatusTextForSpace(space.productId) }}
  109. </span>
  110. <span class="designer-name">{{ getDesignerNameForSpace(space.productId) }}</span>
  111. </div>
  112. </div>
  113. </div>
  114. <div class="product-pricing">
  115. <p class="product-subtotal">{{ formatPrice(calculateSpaceSubtotal(space)) }}</p>
  116. @if (quotation.spaceBreakdown?.length > 1) {
  117. <span class="percentage">{{ formatPercentage(getSpacePercentage(space.productId)) }}</span>
  118. }
  119. </div>
  120. </div>
  121. <div class="product-actions">
  122. @if (canEdit) {
  123. <button class="btn-icon" (click)="openEditProductModal(space.productId); $event.stopPropagation()" title="编辑">
  124. <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
  125. <path fill="currentColor" d="M362.7 19.32C387.7-5.678 428.3-5.678 453.3 19.32l39.38 39.38c25 25 25 65.62 0 90.62l-109.5 109.5c-25 25-65.62 25-90.62 0l-109.5-109.5c-25-25-25-65.62 0-90.62L272.1 19.32z"/>
  126. </svg>
  127. </button>
  128. <button class="btn-icon danger" (click)="deleteProduct(space.productId); $event.stopPropagation()" title="删除">
  129. <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
  130. <path fill="currentColor" d="M96 480c0 17.67 14.33 32 32 32h256c17.67 0 32-14.33 32-32V128H96V480zM312 192c13.25 0 24 10.75 24 24v208c0 13.25-10.75 24-24 24c-13.25 0-24-10.75-24-24V216C288 202.8 298.8 192 312 192zM200 192c13.25 0 24 10.75 24 24v208c0 13.25-10.75 24-24 24s-24-10.75-24-24V216C176 202.8 186.8 192 200 192z"/>
  131. </svg>
  132. </button>
  133. }
  134. <div class="product-toggle">
  135. <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
  136. <path fill="currentColor" d="M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"/>
  137. </svg>
  138. </div>
  139. </div>
  140. </div>
  141. <!-- 产品详情 -->
  142. @if (isProductExpanded(space.name)) {
  143. <div class="product-content">
  144. <!-- 产品信息 -->
  145. @if (getProductForSpace(space.productId)) {
  146. <div class="product-details-section">
  147. <h5 class="section-title">产品信息</h5>
  148. <div class="detail-grid">
  149. <div class="detail-item">
  150. <span class="detail-label">产品类型:</span>
  151. <span class="detail-value">{{ getProductForSpace(space.productId)?.get('productType') }}</span>
  152. </div>
  153. <div class="detail-item">
  154. <span class="detail-label">空间面积:</span>
  155. <span class="detail-value">{{ getProductForSpace(space.productId)?.get('space')?.area || 0 }}㎡</span>
  156. </div>
  157. <div class="detail-item">
  158. <span class="detail-label">复杂度:</span>
  159. <span class="detail-value">{{ getProductForSpace(space.productId)?.get('space')?.complexity || 'medium' }}</span>
  160. </div>
  161. <div class="detail-item">
  162. <span class="detail-label">基础报价:</span>
  163. <span class="detail-value price">{{ formatPrice(getProductForSpace(space.productId)?.get('quotation')?.basePrice || 0) }}</span>
  164. </div>
  165. </div>
  166. </div>
  167. }
  168. <!-- 内部分配明细(3个分配:建模阶段10%、软装渲染40%、公司分配50%) -->
  169. <div class="allocation-section-detail">
  170. <h5 class="section-title">内部执行分配 <span class="section-subtitle">(基于设计图总价自动分配)</span></h5>
  171. <div class="allocation-grid-detail">
  172. @for (allocationType of allocationTypes; track allocationType.key) {
  173. <div
  174. class="allocation-item-detail"
  175. [class.enabled]="isProcessEnabled(space, allocationType.key)"
  176. [attr.data-type]="allocationType.key">
  177. <div class="allocation-header-detail">
  178. <div class="allocation-left">
  179. <label class="checkbox-wrapper">
  180. <input
  181. type="checkbox"
  182. class="checkbox-input"
  183. [checked]="isProcessEnabled(space, allocationType.key)"
  184. (change)="canEdit && toggleProcess(space, allocationType.key)"
  185. [disabled]="!canEdit" />
  186. <span class="checkbox-custom"></span>
  187. </label>
  188. <div class="allocation-info-detail">
  189. <span class="allocation-name-detail">{{ allocationType.name }}</span>
  190. <span class="allocation-desc-detail">{{ allocationType.description }}</span>
  191. </div>
  192. </div>
  193. <span class="allocation-percentage-badge">{{ allocationType.percentage }}%</span>
  194. </div>
  195. @if (isProcessEnabled(space, allocationType.key)) {
  196. <div class="allocation-input-section">
  197. <label class="input-label-small">分配金额(可编辑)</label>
  198. <div class="input-with-currency">
  199. <span class="currency-symbol">¥</span>
  200. <input
  201. class="input-field amount-input"
  202. type="number"
  203. [ngModel]="getAllocationAmount(space, allocationType.key)"
  204. (ngModelChange)="setAllocationAmount(space, allocationType.key, $event); onProcessChange()"
  205. [disabled]="!canEdit"
  206. placeholder="0" />
  207. </div>
  208. <div class="allocation-hint">
  209. 建议金额: {{ forSpacePrice(space,allocationType) }}
  210. </div>
  211. </div>
  212. }
  213. </div>
  214. }
  215. </div>
  216. </div>
  217. </div>
  218. }
  219. </div>
  220. }
  221. </div>
  222. }
  223. <!-- 报价汇总 -->
  224. <div class="quotation-summary">
  225. <div class="summary-header">
  226. <h4>报价汇总</h4>
  227. @if (quotation.spaceBreakdown?.length > 1) {
  228. <div class="breakdown-toggle">
  229. <button class="btn-text" (click)="showBreakdown = !showBreakdown">
  230. {{ showBreakdown ? '隐藏' : '显示'}}明细
  231. </button>
  232. </div>
  233. }
  234. </div>
  235. @if (quotation.spaceBreakdown?.length > 1 && showBreakdown) {
  236. <div class="breakdown-list">
  237. @for (item of quotation.spaceBreakdown; track item.spaceId) {
  238. <div class="breakdown-item">
  239. <span class="breakdown-name">{{ item.spaceName }}</span>
  240. <span class="breakdown-amount">{{ formatPrice(item.amount) }}</span>
  241. <span class="breakdown-percentage">{{ formatPercentage(item.percentage) }}</span>
  242. </div>
  243. }
  244. </div>
  245. }
  246. <!-- 内部执行分配 -->
  247. @if (quotation.allocation) {
  248. <div class="allocation-section">
  249. <div class="allocation-header">
  250. <h4>内部执行分配</h4>
  251. <button class="btn-text" (click)="toggleAllocation()">
  252. {{ showAllocation ? '隐藏' : '显示' }}
  253. </button>
  254. </div>
  255. @if (showAllocation) {
  256. <div class="allocation-list">
  257. <!-- 建模阶段 -->
  258. <div class="allocation-item modeling">
  259. <div class="allocation-icon">
  260. <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
  261. <path fill="currentColor" d="M234.5 5.709C248.4 .7377 263.6 .7377 277.5 5.709L469.5 74.28C494.1 83.38 512 107.5 512 134.6C512 161.7 494.1 185.8 469.5 194.9L277.5 263.5C263.6 268.5 248.4 268.5 234.5 263.5L42.47 194.9C17.05 185.8 0 161.7 0 134.6C0 107.5 17.05 83.38 42.47 74.28L234.5 5.709z"/>
  262. </svg>
  263. </div>
  264. <div class="allocation-info">
  265. <span class="allocation-name">{{ allocationRules.modeling.label }}</span>
  266. <span class="allocation-desc">{{ allocationRules.modeling.description }}</span>
  267. </div>
  268. <div class="allocation-values">
  269. <span class="allocation-percentage">{{ quotation.allocation.modeling.percentage }}%</span>
  270. <span class="allocation-amount">{{ formatPrice(quotation.allocation.modeling.amount) }}</span>
  271. </div>
  272. </div>
  273. <!-- 软装渲染 -->
  274. <div class="allocation-item decoration">
  275. <div class="allocation-icon">
  276. <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
  277. <path fill="currentColor" d="M384 160C366.3 160 352 145.7 352 128C352 110.3 366.3 96 384 96C401.7 96 416 110.3 416 128C416 145.7 401.7 160 384 160z"/>
  278. </svg>
  279. </div>
  280. <div class="allocation-info">
  281. <span class="allocation-name">{{ allocationRules.decoration.label }}</span>
  282. <span class="allocation-desc">{{ allocationRules.decoration.description }}</span>
  283. </div>
  284. <div class="allocation-values">
  285. <span class="allocation-percentage">{{ quotation.allocation.decoration.percentage }}%</span>
  286. <span class="allocation-amount">{{ formatPrice(quotation.allocation.decoration.amount) }}</span>
  287. </div>
  288. </div>
  289. <!-- 公司分配 -->
  290. <div class="allocation-item company">
  291. <div class="allocation-icon">
  292. <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
  293. <path fill="currentColor" d="M320 32c-8.1 0-16.1 1.4-23.7 4.1L15.8 137.4C6.3 140.9 0 149.9 0 160s6.3 19.1 15.8 22.6l57.9 20.9C57.3 229.3 48 259.8 48 291.9v28.1c0 28.4-10.8 57.7-22.3 80.8c-6.5 13-13.9 25.8-22.5 37.6C0 442.7-.9 448.3 .9 453.4s6 8.9 11.2 10.2l64 16c4.2 1.1 8.7 .3 12.4-2s6.3-6.1 7.1-10.4c8.6-42.8 4.3-81.2-2.1-108.7C90.3 344.3 86 329.8 80 316.5V295.6c0-4.2 .3-8.4 1-12.4L288.1 406.6c8.4 3.2 17.4 4.8 26.6 4.8H448c17.7 0 32-14.3 32-32V256c0-17.7-14.3-32-32-32H448c-17.7 0-32-14.3-32-32s14.3-32 32-32h32c9.7 0 18.5-5.8 22.2-14.8s1.7-19.3-5.2-26.2l-64-64c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8h32c17.7 0 32 14.3 32 32s-14.3 32-32 32H320z"/>
  294. </svg>
  295. </div>
  296. <div class="allocation-info">
  297. <span class="allocation-name">{{ allocationRules.company.label }}</span>
  298. <span class="allocation-desc">{{ allocationRules.company.description }}</span>
  299. </div>
  300. <div class="allocation-values">
  301. <span class="allocation-percentage">{{ quotation.allocation.company.percentage }}%</span>
  302. <span class="allocation-amount">{{ formatPrice(quotation.allocation.company.amount) }}</span>
  303. </div>
  304. </div>
  305. </div>
  306. <div class="allocation-note">
  307. <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
  308. <path fill="currentColor" d="M256 512c141.4 0 256-114.6 256-256S397.4 0 256 0S0 114.6 0 256S114.6 512 256 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24z"/>
  309. </svg>
  310. <span>内部执行分配为系统自动计算,基于报价总额按固定比例拆分,所有金额均为整数</span>
  311. </div>
  312. }
  313. </div>
  314. }
  315. <div class="total-section">
  316. <div class="total-row">
  317. <span class="total-label">报价总额</span>
  318. <span class="total-amount">{{ formatPrice(quotation.total) }}</span>
  319. </div>
  320. @if (quotation.generatedAt) {
  321. <div class="total-meta">
  322. <span class="generate-info">生成于 {{ quotation.generatedAt | date:'yyyy-MM-dd HH:mm' }}</span>
  323. @if (quotation.validUntil) {
  324. <span class="valid-info">有效期至 {{ quotation.validUntil | date:'yyyy-MM-dd' }}</span>
  325. }
  326. </div>
  327. }
  328. </div>
  329. </div>
  330. }
  331. }
  332. </div>
  333. <!-- 产品添加/编辑模态框 -->
  334. @if (showAddProductModal) {
  335. <div class="modal-overlay" (click)="closeAddProductModal()">
  336. <div class="modal-container add-product-modal" (click)="$event.stopPropagation()">
  337. <div class="modal-header">
  338. <h3>{{ isEditMode ? '编辑设计产品' : '添加设计产品' }}</h3>
  339. <button class="close-btn" (click)="closeAddProductModal()">
  340. <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
  341. <path fill="currentColor" d="M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm52.7 283.3L256 278.6l-52.7 52.7c-6.2 6.2-16.4 6.2-22.6 0-3.1-3.1-4.7-7.2-4.7-11.3 0-4.1 1.6-8.2 4.7-11.3l52.7-52.7-52.7-52.7c-3.1-3.1-4.7-7.2-4.7-11.3 0-4.1 1.6-8.2 4.7-11.3 6.2-6.2 16.4-6.2 22.6 0l52.7 52.7 52.7-52.7c6.2-6.2 16.4-6.2 22.6 0 6.2 6.2 6.2 16.4 0 22.6L278.6 256l52.7 52.7c6.2 6.2 6.2 16.4 0 22.6-6.2 6.3-16.4 6.3-22.6 0z"/>
  342. </svg>
  343. </button>
  344. </div>
  345. <div class="modal-body">
  346. <!-- 预设场景选择 -->
  347. <div class="form-group">
  348. <label class="form-label">选择空间场景</label>
  349. <div class="scene-grid">
  350. @for (scene of getPresetScenes(); track scene) {
  351. <button
  352. class="scene-card"
  353. [class.selected]="newProduct.sceneName === scene"
  354. (click)="selectScene(scene)">
  355. <span class="scene-name">{{ scene }}</span>
  356. </button>
  357. }
  358. <button
  359. class="scene-card custom"
  360. [class.selected]="newProduct.isCustom"
  361. (click)="selectCustomScene()">
  362. <span class="scene-name">自定义</span>
  363. </button>
  364. </div>
  365. </div>
  366. <!-- 自定义名称 -->
  367. @if (newProduct.isCustom) {
  368. <div class="form-group">
  369. <label class="form-label">产品名称</label>
  370. <input
  371. type="text"
  372. [(ngModel)]="newProduct.productName"
  373. placeholder="例如:客厅、主卧、大堂等"
  374. class="form-input">
  375. </div>
  376. }
  377. <!-- 家装专属配置 -->
  378. @if (projectInfo.projectType === '家装') {
  379. <div class="form-group">
  380. <label class="form-label">空间类型</label>
  381. <div class="radio-group">
  382. <label class="radio-label">
  383. <input type="radio" name="spaceType" value="平层" [(ngModel)]="newProduct.spaceType">
  384. <span>平层</span>
  385. </label>
  386. <label class="radio-label">
  387. <input type="radio" name="spaceType" value="跃层" [(ngModel)]="newProduct.spaceType">
  388. <span>跃层</span>
  389. </label>
  390. <label class="radio-label">
  391. <input type="radio" name="spaceType" value="挑空" [(ngModel)]="newProduct.spaceType">
  392. <span>挑空</span>
  393. </label>
  394. <label class="radio-label">
  395. <input type="radio" name="spaceType" value="卧室" [(ngModel)]="newProduct.spaceType">
  396. <span>卧室</span>
  397. </label>
  398. </div>
  399. </div>
  400. <div class="form-group">
  401. <label class="form-label">风格等级</label>
  402. <select [(ngModel)]="newProduct.styleLevel" class="form-select">
  403. <option value="基础风格组">基础风格组</option>
  404. <option value="中级风格组">中级风格组</option>
  405. <option value="高级风格组">高级风格组</option>
  406. <option value="顶级风格组">顶级风格组</option>
  407. </select>
  408. </div>
  409. }
  410. <!-- 工装专属配置 -->
  411. @if (projectInfo.projectType === '工装') {
  412. <div class="form-group">
  413. <label class="form-label">业态类型</label>
  414. <select [(ngModel)]="newProduct.businessType" class="form-select">
  415. <option value="办公空间">办公空间</option>
  416. <option value="商业空间">商业空间</option>
  417. <option value="娱乐空间">娱乐空间</option>
  418. <option value="酒店餐厅">酒店餐厅</option>
  419. <option value="公共空间">公共空间</option>
  420. </select>
  421. </div>
  422. <div class="form-group">
  423. <label class="form-label">空间类型</label>
  424. <div class="radio-group">
  425. <label class="radio-label">
  426. <input type="radio" name="spaceType" value="门厅空间" [(ngModel)]="newProduct.spaceType">
  427. <span>门厅空间</span>
  428. </label>
  429. <label class="radio-label">
  430. <input type="radio" name="spaceType" value="封闭空间" [(ngModel)]="newProduct.spaceType">
  431. <span>封闭空间</span>
  432. </label>
  433. </div>
  434. </div>
  435. }
  436. <!-- 建筑类专属配置 -->
  437. @if (projectInfo.projectType === '建筑类') {
  438. <div class="form-group">
  439. <label class="form-label">建筑类型</label>
  440. <select [(ngModel)]="newProduct.architectureType" class="form-select">
  441. <option value="门头">门头</option>
  442. <option value="小型单体">小型单体</option>
  443. <option value="大型单体">大型单体</option>
  444. <option value="鸟瞰">鸟瞰</option>
  445. </select>
  446. </div>
  447. }
  448. <!-- 加价规则配置 -->
  449. <div class="pricing-adjustments">
  450. <h5 class="section-title">加价规则配置(可选)</h5>
  451. @if (projectInfo.projectType === '家装' || projectInfo.projectType === '工装') {
  452. <div class="form-group">
  453. <label class="form-label">额外功能区数量</label>
  454. <div class="input-with-hint">
  455. <input
  456. type="number"
  457. [(ngModel)]="newProduct.adjustments.extraFunction"
  458. min="0"
  459. class="form-input"
  460. placeholder="0">
  461. <span class="input-hint">
  462. @if (projectInfo.projectType === '家装') {
  463. 每增加一个功能区 +100元
  464. } @else {
  465. 每增加一个功能区 +400元
  466. }
  467. </span>
  468. </div>
  469. </div>
  470. }
  471. <div class="form-group">
  472. <label class="form-label">造型复杂度加价</label>
  473. <div class="input-with-hint">
  474. <input
  475. type="number"
  476. [(ngModel)]="newProduct.adjustments.complexity"
  477. min="0"
  478. max="200"
  479. class="form-input"
  480. placeholder="0">
  481. <span class="input-hint">立面和吊顶造型复杂: 0-200元</span>
  482. </div>
  483. </div>
  484. <div class="form-group">
  485. <label class="checkbox-label">
  486. <input type="checkbox" [(ngModel)]="newProduct.adjustments.design">
  487. <span>需要我们设计(原价×2)</span>
  488. </label>
  489. </div>
  490. @if (projectInfo.projectType === '工装') {
  491. <div class="form-group">
  492. <label class="checkbox-label">
  493. <input type="checkbox" [(ngModel)]="newProduct.adjustments.panoramic">
  494. <span>需要全景渲染(原价×2)</span>
  495. </label>
  496. </div>
  497. }
  498. </div>
  499. <!-- 价格预览 -->
  500. <div class="price-preview">
  501. <div class="price-preview-row">
  502. <span class="label">基础价格:</span>
  503. <span class="price">{{ formatPrice(calculatePreviewBasePrice()) }}</span>
  504. </div>
  505. @if (calculatePreviewAdjustmentTotal() > 0) {
  506. <div class="price-preview-row adjustment">
  507. <span class="label">加价合计:</span>
  508. <span class="price">+{{ formatPrice(calculatePreviewAdjustmentTotal()) }}</span>
  509. </div>
  510. }
  511. <div class="price-preview-row total">
  512. <span class="label">最终价格:</span>
  513. <span class="price">{{ formatPrice(calculatePreviewFinalPrice()) }}</span>
  514. </div>
  515. </div>
  516. </div>
  517. <div class="modal-footer">
  518. <button class="btn-secondary" (click)="closeAddProductModal()">取消</button>
  519. <button
  520. class="btn-primary"
  521. (click)="confirmAddProduct()"
  522. [disabled]="!isNewProductValid()">
  523. {{ isEditMode ? '确认修改' : '确认添加' }}
  524. </button>
  525. </div>
  526. </div>
  527. </div>
  528. }