view.vue 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849
  1. <template>
  2. <div class="app-container">
  3. <el-card shadow="never" class="mb-3">
  4. <div class="flex items-center justify-between">
  5. <div class="flex items-center">
  6. <el-button icon="ArrowLeft" @click="handleBack">返回</el-button>
  7. <span class="ml-4 text-xl font-bold">查看商品</span>
  8. </div>
  9. </div>
  10. </el-card>
  11. <div class="product-wizard-page">
  12. <!-- 步骤内容 -->
  13. <div class="step-content" v-loading="loading">
  14. <!-- 步骤2: 填写商品信息 -->
  15. <el-card shadow="never" class="step-card">
  16. <template #header>
  17. <span class="text-lg font-bold">基本信息</span>
  18. </template>
  19. <el-form ref="productFormRef" :model="productForm" :rules="productRules" label-width="120px" class="product-info-form" disabled>
  20. <!-- 商品分类显示 -->
  21. <el-form-item label="商品分类:">
  22. <div class="category-display">
  23. <span class="category-text">{{ getCategoryPath() }}</span>
  24. </div>
  25. </el-form-item>
  26. <!-- 商品编号 -->
  27. <el-row :gutter="20">
  28. <el-col :span="12">
  29. <el-form-item label="商品编号:" prop="productNo">
  30. <el-input v-model="productForm.productNo" placeholder="002169745" maxlength="20" show-word-limit disabled />
  31. </el-form-item>
  32. </el-col>
  33. <el-col :span="12">
  34. <el-form-item label="状态:">
  35. <span class="category-text">上架在售</span>
  36. </el-form-item>
  37. </el-col>
  38. </el-row>
  39. <!-- 商品名称 -->
  40. <el-form-item label="商品名称:" prop="itemName" required>
  41. <el-input v-model="productForm.itemName" type="textarea" :rows="2" placeholder="请输入商品名称" maxlength="200" show-word-limit />
  42. </el-form-item>
  43. <!-- A10产品名称 -->
  44. <el-form-item label="A10产品名称:">
  45. <el-input
  46. :value="a10ProductNameComputed"
  47. type="textarea"
  48. :rows="2"
  49. disabled
  50. placeholder="自动拼接:品牌名 + 规格型号 + 产品分类 + 发票规格"
  51. />
  52. <div class="form-item-tip">A10产品名称由系统自动拼接:品牌名 + 规格型号 + 产品分类(三级分类)+ 发票规格,无需手动填写</div>
  53. </el-form-item>
  54. <!-- 规格型号 和 UPC(69)条码 -->
  55. <el-row :gutter="20">
  56. <el-col :span="12">
  57. <el-form-item label="规格型号:">
  58. <el-input v-model="productForm.specificationsCode" placeholder="请输入规格型号" maxlength="20" show-word-limit />
  59. </el-form-item>
  60. </el-col>
  61. <el-col :span="12">
  62. <el-form-item label="UPC(69)条码:">
  63. <el-input v-model="productForm.barCoding" placeholder="请输入UPC(69)条码" maxlength="20" show-word-limit @input="handleUpcInput" />
  64. </el-form-item>
  65. </el-col>
  66. </el-row>
  67. <!-- 发票名称 和 发票规格 -->
  68. <el-row :gutter="20">
  69. <el-col :span="12">
  70. <el-form-item label="发票名称:">
  71. <el-input v-model="productForm.invoiceName" placeholder="请输入发票名称" maxlength="20" show-word-limit />
  72. </el-form-item>
  73. </el-col>
  74. <el-col :span="12">
  75. <el-form-item label="发票规格:">
  76. <el-input v-model="productForm.invoiceSpecs" placeholder="请输入发票规格" maxlength="20" show-word-limit />
  77. </el-form-item>
  78. </el-col>
  79. </el-row>
  80. <el-row :gutter="20">
  81. <!-- 商品品牌 -->
  82. <el-col :span="12">
  83. <el-form-item label="商品品牌:" prop="brandId" required>
  84. <el-select
  85. v-model="productForm.brandId"
  86. placeholder="请输入品牌名称搜索"
  87. filterable
  88. remote
  89. clearable
  90. :remote-method="handleBrandSearch"
  91. :loading="brandLoading"
  92. class="w-full"
  93. >
  94. <el-option v-for="item in brandOptions" :key="item.id" :label="`${item.brandNo},${item.brandName}`" :value="item.id" />
  95. </el-select>
  96. </el-form-item>
  97. </el-col>
  98. <el-col :span="12">
  99. <el-form-item label="单位:">
  100. <el-select
  101. v-model="productForm.unitId"
  102. placeholder="请选择"
  103. clearable
  104. class="w-full"
  105. :disabled="productForm.productReviewStatus === 1"
  106. >
  107. <el-option v-for="option in unitOptions" :key="option.id" :label="`${option.unitNo},${option.unitName}`" :value="option.id" />
  108. </el-select>
  109. </el-form-item>
  110. </el-col>
  111. </el-row>
  112. <!-- 税率编码 、税率 和 币种 -->
  113. <el-row :gutter="20">
  114. <el-col :span="12">
  115. <el-form-item label="税率编码:">
  116. <el-input
  117. v-model="taxCodeNo"
  118. placeholder="点击选择税率编码"
  119. readonly
  120. class="w-full"
  121. />
  122. </el-form-item>
  123. </el-col>
  124. <el-col :span="12">
  125. <el-form-item label="税率:" required>
  126. <el-select v-model="productForm.taxRate" placeholder="请选择税率" clearable class="w-full">
  127. <el-option v-for="option in taxRateOptions" :key="option.id" :label="`${option.taxrateNo},${option.taxrateName}`" :value="option.taxrate" />
  128. </el-select>
  129. </el-form-item>
  130. </el-col>
  131. </el-row>
  132. <el-row :gutter="20">
  133. <el-col :span="12">
  134. <el-form-item label="币种:">
  135. <el-select v-model="productForm.currency" placeholder="请选择" class="w-full">
  136. <el-option label="人民币(RMB)" value="RMB" />
  137. <el-option label="美元(USD)" value="USD" />
  138. <el-option label="欧元(EUR)" value="EUR" />
  139. </el-select>
  140. </el-form-item>
  141. </el-col>
  142. </el-row>
  143. <!-- TaxCodeSelect 弹窗(查看模式下不启用) -->
  144. <!-- 销量人气 -->
  145. <el-row :gutter="20">
  146. <el-col :span="12">
  147. <el-form-item label="销量人气:">
  148. <el-input
  149. v-model="productForm.salesVolume"
  150. type="number"
  151. placeholder="请输入销量人气"
  152. :min="0"
  153. step="1"
  154. @input="handleSalesVolumeInput"
  155. />
  156. </el-form-item>
  157. </el-col>
  158. </el-row>
  159. <!-- 促销标题 -->
  160. <el-form-item label="促销标题:">
  161. <el-input v-model="productForm.promotionTitle" type="textarea" :rows="3" placeholder="请输入促销标题" maxlength="300" show-word-limit />
  162. </el-form-item>
  163. <!-- 商品简介 -->
  164. <el-form-item label="商品简介:">
  165. <el-input v-model="productForm.productDescription" type="textarea" :rows="3" placeholder="请输入商品简介" maxlength="500" show-word-limit />
  166. </el-form-item>
  167. <!-- 重量 和 体积 -->
  168. <el-row :gutter="20">
  169. <el-col :span="12">
  170. <el-form-item label="商品重量:">
  171. <el-input v-model="productForm.productWeight" placeholder="0" maxlength="10" show-word-limit>
  172. <template #append>
  173. <el-select v-model="productForm.weightUnit" placeholder="请选择" style="width: 100px">
  174. <el-option label="kg" value="kg" />
  175. <el-option label="g" value="g" />
  176. <el-option label="t" value="t" />
  177. </el-select>
  178. </template>
  179. </el-input>
  180. </el-form-item>
  181. </el-col>
  182. <el-col :span="12">
  183. <el-form-item label="商品体积:">
  184. <el-input v-model="productForm.productVolume" placeholder="0" maxlength="10" show-word-limit>
  185. <template #append>
  186. <el-select v-model="productForm.volumeUnit" placeholder="请选择" style="width: 80px">
  187. <el-option label="m³" value="m3" />
  188. <el-option label="cm³" value="cm3" />
  189. <el-option label="L" value="L" />
  190. </el-select>
  191. </template>
  192. </el-input>
  193. </el-form-item>
  194. </el-col>
  195. </el-row>
  196. <!-- 参考链接 -->
  197. <el-form-item label="参考链接">
  198. <el-input v-model="productForm.referenceLink" type="textarea" :rows="3" placeholder="请输入参考链接" />
  199. </el-form-item>
  200. <!-- 主供应商 -->
  201. <el-form-item label="主供应商:" prop="supplierNo" required>
  202. <el-select v-model="(productForm as any).supplierNo" placeholder="请选择" clearable class="w-full" value-key="id">
  203. <el-option
  204. v-for="option in supplierOptions"
  205. :key="option.id"
  206. :label="`${option.supplierNo},${option.enterpriseName}`"
  207. :value="String(option.id)"
  208. />
  209. </el-select>
  210. </el-form-item>
  211. <!-- 售后服务 -->
  212. <el-form-item label="售后服务:">
  213. <el-select v-model="productForm.afterSalesService" placeholder="请选择" clearable class="w-full">
  214. <el-option v-for="option in afterSalesOptions" :key="option.id" :label="option.afterSalesItems" :value="option.id" />
  215. </el-select>
  216. </el-form-item>
  217. <!-- 服务保障 -->
  218. <el-form-item label="服务保障:">
  219. <el-checkbox-group v-model="serviceGuarantees">
  220. <el-checkbox v-for="option in serviceGuaranteeOptions" :key="option.id" :label="option.ensureName" :value="option.id" />
  221. </el-checkbox-group>
  222. </el-form-item>
  223. <!-- 安装服务 -->
  224. <el-form-item label="安装服务:">
  225. <el-checkbox-group v-model="installationServices">
  226. <el-checkbox label="免费安装" value="freeInstallation" />
  227. </el-checkbox-group>
  228. </el-form-item>
  229. </el-form>
  230. </el-card>
  231. <!-- 销售价格 -->
  232. <el-card shadow="never" class="step-card mt-3">
  233. <template #header>
  234. <span class="text-lg font-bold">销售价格</span>
  235. </template>
  236. <el-form ref="priceFormRef" :model="productForm" :rules="productRules" label-width="120px" class="product-info-form" disabled>
  237. <el-row :gutter="20">
  238. <el-col :span="8">
  239. <el-form-item label="市场价:" prop="marketPrice" required>
  240. <el-input
  241. v-model="productForm.marketPrice"
  242. type="number"
  243. placeholder="请输入市场价"
  244. :min="0"
  245. @blur="formatPrice('marketPrice')"
  246. />
  247. </el-form-item>
  248. </el-col>
  249. <el-col :span="8">
  250. <el-form-item label="官网价:" prop="memberPrice" required>
  251. <el-input
  252. v-model="productForm.memberPrice"
  253. type="number"
  254. placeholder="请输入平台售价"
  255. :min="0"
  256. @blur="formatPrice('memberPrice')"
  257. />
  258. </el-form-item>
  259. </el-col>
  260. <el-col :span="8">
  261. <el-form-item label="最低售价:" prop="minSellingPrice" required>
  262. <el-input
  263. v-model="productForm.minSellingPrice"
  264. type="number"
  265. placeholder="请输入最低售价"
  266. :min="0"
  267. @blur="formatPrice('minSellingPrice')"
  268. />
  269. </el-form-item>
  270. </el-col>
  271. </el-row>
  272. <el-row :gutter="20">
  273. <el-col :span="8">
  274. <el-form-item label="最低起订量:" prop="minOrderQuantity" required>
  275. <el-input v-model="productForm.minOrderQuantity" type="number" placeholder="请输入最低起订量" />
  276. </el-form-item>
  277. </el-col>
  278. <el-col :span="8">
  279. <el-form-item label="备注:">
  280. <span class="currency-text">市场价>官网价>最低售价</span>
  281. </el-form-item>
  282. </el-col>
  283. </el-row>
  284. </el-form>
  285. </el-card>
  286. <!-- 供应价格 -->
  287. <el-card v-show="currentStep === 1" shadow="never" class="step-card mt-3">
  288. <template #header>
  289. <span class="text-lg font-bold">供应价格</span>
  290. </template>
  291. <el-form label-width="120px" class="product-info-form" disabled>
  292. <el-row :gutter="20">
  293. <el-col :span="8">
  294. <el-form-item label="供应价:">
  295. <el-input
  296. v-model="productForm.supplyPrice"
  297. type="number"
  298. placeholder="请输入供应价"
  299. :min="0"
  300. @blur="formatPrice('supplyPrice')"
  301. />
  302. </el-form-item>
  303. </el-col>
  304. <el-col :span="8">
  305. <el-form-item label="供应有效时间:">
  306. <el-date-picker
  307. v-model="productForm.supplyValidityPeriod"
  308. type="date"
  309. placeholder="请选择供应有效时间"
  310. value-format="YYYY-MM-DD"
  311. class="w-full"
  312. />
  313. </el-form-item>
  314. </el-col>
  315. <el-col :span="8">
  316. <el-form-item label="是否包邮:">
  317. <el-radio-group v-model="productForm.supplyPostStatus">
  318. <el-radio :value="0">不包邮</el-radio>
  319. <el-radio :value="1">包邮</el-radio>
  320. </el-radio-group>
  321. </el-form-item>
  322. </el-col>
  323. </el-row>
  324. </el-form>
  325. </el-card>
  326. <!-- 采购价格 -->
  327. <el-card shadow="never" class="step-card mt-3">
  328. <template #header>
  329. <span class="text-lg font-bold">采购价格</span>
  330. </template>
  331. <el-form ref="purchasePriceFormRef" :model="productForm" :rules="productRules" label-width="120px" class="product-info-form" disabled>
  332. <el-row :gutter="20">
  333. <el-col :span="12">
  334. <el-form-item label="采购价:" prop="purchasingPrice" required>
  335. <el-input
  336. v-model="productForm.purchasingPrice"
  337. type="number"
  338. placeholder="请输入采购价"
  339. :min="0"
  340. @blur="formatPrice('purchasingPrice')"
  341. />
  342. </el-form-item>
  343. </el-col>
  344. <el-col :span="12">
  345. <el-form-item label="最高采购价:">
  346. <el-input
  347. v-model="productForm.maxPurchasePrice"
  348. type="number"
  349. placeholder="请输入最高采购价"
  350. :min="0"
  351. @blur="formatPrice('maxPurchasePrice')"
  352. />
  353. </el-form-item>
  354. </el-col>
  355. </el-row>
  356. </el-form>
  357. </el-card>
  358. <!-- 采购信息 -->
  359. <el-card shadow="never" class="step-card mt-3">
  360. <template #header>
  361. <span class="text-lg font-bold">采购信息</span>
  362. </template>
  363. <el-form ref="purchaseInfoFormRef" :model="productForm" :rules="productRules" label-width="120px" class="product-info-form" disabled>
  364. <el-row :gutter="20">
  365. <el-col :span="12">
  366. <el-form-item label="产品经理:" prop="productNature" required>
  367. <el-select v-model="productForm.productNature" placeholder="请选择" clearable class="w-full" value-key="staffId">
  368. <el-option
  369. v-for="option in staffOptions"
  370. :key="option.staffId"
  371. :label="`${option.staffCode},${option.staffName}`"
  372. :value="String(option.staffId)"
  373. />
  374. </el-select>
  375. </el-form-item>
  376. </el-col>
  377. <el-col :span="12">
  378. <el-form-item label="采购人员:" prop="purchasingPersonnel" required>
  379. <el-select v-model="productForm.purchasingPersonnel" placeholder="请选择" clearable class="w-full" value-key="staffId">
  380. <el-option
  381. v-for="option in staffOptions"
  382. :key="option.staffId"
  383. :label="`${option.staffCode},${option.staffName}`"
  384. :value="String(option.staffId)"
  385. />
  386. </el-select>
  387. </el-form-item>
  388. </el-col>
  389. </el-row>
  390. </el-form>
  391. </el-card>
  392. <!-- 自定义属性 -->
  393. <el-card shadow="never" class="step-card mt-3">
  394. <template #header>
  395. <div class="flex items-center justify-between">
  396. <span class="text-lg font-bold">自定义属性</span>
  397. </div>
  398. </template>
  399. <el-form label-width="0px" class="product-info-form" disabled>
  400. <div v-if="diyAttributesList.length === 0" class="text-center text-gray-400 py-4 text-sm">
  401. 暂无自定义属性
  402. </div>
  403. <el-row v-for="(item, index) in diyAttributesList" :key="index" :gutter="20" class="mb-2">
  404. <el-col :span="12">
  405. <el-input v-model="item.attributeKey" placeholder="属性名称" />
  406. </el-col>
  407. <el-col :span="12">
  408. <el-input v-model="item.attributeValue" placeholder="属性值" />
  409. </el-col>
  410. </el-row>
  411. </el-form>
  412. </el-card>
  413. <!-- 商品属性 -->
  414. <el-card shadow="never" class="step-card mt-3">
  415. <template #header>
  416. <span class="text-lg font-bold">商品属性</span>
  417. </template>
  418. <el-form ref="attributeFormRef" :model="productForm" label-width="120px" class="product-info-form" disabled>
  419. <div v-if="attributesList.length === 0" class="text-center text-gray-500 py-8">该分类暂无属性配置</div>
  420. <template v-else>
  421. <el-row :gutter="20" v-for="(row, rowIndex) in Math.ceil(attributesList.length / 2)" :key="rowIndex">
  422. <el-col :span="12" v-for="colIndex in 2" :key="colIndex">
  423. <template v-if="attributesList[rowIndex * 2 + colIndex - 1]">
  424. <el-form-item
  425. :label="attributesList[rowIndex * 2 + colIndex - 1].productAttributesName + ':'"
  426. :required="attributesList[rowIndex * 2 + colIndex - 1].required === '1'"
  427. >
  428. <!-- 下拉选择 -->
  429. <el-select
  430. v-if="attributesList[rowIndex * 2 + colIndex - 1].isOptional === '0'"
  431. v-model="productAttributesValues[attributesList[rowIndex * 2 + colIndex - 1].productAttributesName]"
  432. placeholder="请选择"
  433. clearable
  434. class="w-full"
  435. >
  436. <el-option
  437. v-for="option in parseAttributesList(attributesList[rowIndex * 2 + colIndex - 1].attributesList)"
  438. :key="option"
  439. :label="option"
  440. :value="option"
  441. />
  442. </el-select>
  443. <!-- 多选 -->
  444. <el-select
  445. v-else-if="attributesList[rowIndex * 2 + colIndex - 1].isOptional === '2'"
  446. v-model="productAttributesValues[attributesList[rowIndex * 2 + colIndex - 1].productAttributesName]"
  447. placeholder="请选择"
  448. multiple
  449. clearable
  450. class="w-full"
  451. >
  452. <el-option
  453. v-for="option in parseAttributesList(attributesList[rowIndex * 2 + colIndex - 1].attributesList)"
  454. :key="option"
  455. :label="option"
  456. :value="option"
  457. />
  458. </el-select>
  459. <!-- 文本输入 -->
  460. <el-input
  461. v-else
  462. v-model="productAttributesValues[attributesList[rowIndex * 2 + colIndex - 1].productAttributesName]"
  463. placeholder="请输入"
  464. clearable
  465. />
  466. </el-form-item>
  467. </template>
  468. </el-col>
  469. </el-row>
  470. </template>
  471. </el-form>
  472. </el-card>
  473. <!-- 商品详情 -->
  474. <el-card shadow="never" class="step-card mt-3">
  475. <template #header>
  476. <span class="text-lg font-bold">商品详情</span>
  477. </template>
  478. <el-form ref="detailFormRef" :model="productForm" label-width="120px" class="product-info-form" disabled>
  479. <!-- 商品主图 -->
  480. <el-form-item label="商品主图:" required>
  481. <div class="view-disabled-wrapper">
  482. <upload-image v-model="productForm.productImage" :limit="1" width="178px" height="178px" imageText="选择图片" />
  483. </div>
  484. </el-form-item>
  485. <!-- 商品轮播图 -->
  486. <el-form-item label="商品轮播图:" required>
  487. <div class="view-disabled-wrapper">
  488. <upload-image v-model="carouselImages" :limit="20" width="120px" height="120px" imageText="添加图片" />
  489. </div>
  490. </el-form-item>
  491. <!-- 商品详情 -->
  492. <el-form-item label="商品详情:" required>
  493. <el-tabs v-model="activeDetailTab" type="border-card">
  494. <el-tab-pane label="电脑端详情" name="pc">
  495. <div class="view-disabled-wrapper">
  496. <Editor v-model="productForm.pcDetail" :height="400" :readOnly="true" />
  497. </div>
  498. </el-tab-pane>
  499. <el-tab-pane label="移动端详情" name="mobile">
  500. <div class="view-disabled-wrapper">
  501. <Editor v-model="productForm.mobileDetail" :height="400" :readOnly="true" />
  502. </div>
  503. </el-tab-pane>
  504. </el-tabs>
  505. </el-form-item>
  506. </el-form>
  507. </el-card>
  508. <!-- 定制说明 -->
  509. <el-card shadow="never" class="step-card mt-3">
  510. <template #header>
  511. <span class="text-lg font-bold">定制说明</span>
  512. </template>
  513. <el-form ref="customFormRef" :model="customForm" label-width="120px" class="product-info-form" disabled>
  514. <!-- 可定制开关 -->
  515. <el-form-item label="可定制:">
  516. <el-switch v-model="customForm.isCustomize" />
  517. </el-form-item>
  518. <!-- 定制内容 -->
  519. <template v-if="customForm.isCustomize">
  520. <!-- 定制方式 -->
  521. <el-form-item label="定制方式:">
  522. <div class="custom-options">
  523. <el-button
  524. v-for="option in customMethodOptions"
  525. :key="option.value"
  526. :type="customForm.selectedMethods.includes(option.value) ? 'primary' : 'default'"
  527. disabled
  528. >
  529. {{ option.label }}
  530. </el-button>
  531. </div>
  532. </el-form-item>
  533. <!-- 定制工艺 -->
  534. <el-form-item label="定制工艺:">
  535. <div class="custom-options">
  536. <el-button
  537. v-for="craft in customCraftOptions"
  538. :key="craft.value"
  539. :type="customForm.selectedCrafts.includes(craft.value) ? 'primary' : 'default'"
  540. disabled
  541. >
  542. {{ craft.label }}
  543. </el-button>
  544. </div>
  545. </el-form-item>
  546. <!-- 定制方式表格 -->
  547. <el-form-item label="" label-width="120">
  548. <el-table :data="customForm.customDetails" border class="custom-table">
  549. <el-table-column label="装饰方法" width="120">
  550. <template #default="{ row }">
  551. <span>{{ row.decorationMethod }}</span>
  552. </template>
  553. </el-table-column>
  554. <el-table-column label="定制工艺" width="120">
  555. <template #default="{ row }">
  556. <span>{{ row.craft }}</span>
  557. </template>
  558. </el-table-column>
  559. <el-table-column label="起订数量" width="150">
  560. <template #default="{ row }">
  561. <el-input v-model="row.minOrderQty" placeholder="请输入" />
  562. </template>
  563. </el-table-column>
  564. <el-table-column label="起订价格" width="150">
  565. <template #default="{ row }">
  566. <el-input
  567. v-model="row.minOrderPrice"
  568. type="number"
  569. :min="0"
  570. placeholder="请输入"
  571. @blur="formatRowPrice(row, 'minOrderPrice')"
  572. />
  573. </template>
  574. </el-table-column>
  575. <el-table-column label="打样工期[天]" width="150">
  576. <template #default="{ row }">
  577. <el-input v-model="row.samplePeriod" placeholder="请输入" />
  578. </template>
  579. </el-table-column>
  580. <el-table-column label="生产周期[天]" width="150">
  581. <template #default="{ row }">
  582. <el-input v-model="row.productionPeriod" placeholder="请输入" />
  583. </template>
  584. </el-table-column>
  585. </el-table>
  586. </el-form-item>
  587. <!-- 定制说明 -->
  588. <el-form-item label="定制说明:">
  589. <el-input v-model="customForm.customDescription" type="textarea" :rows="5" placeholder="请输入定制说明" />
  590. </el-form-item>
  591. </template>
  592. </el-form>
  593. </el-card>
  594. </div>
  595. </div>
  596. </div>
  597. </template>
  598. <script setup lang="ts">
  599. import { ref, reactive, computed, onMounted, watch, nextTick } from 'vue';
  600. import { useRoute, useRouter } from 'vue-router';
  601. import { ElMessage } from 'element-plus';
  602. import { Warning, ArrowRight, Check, Plus, CircleCheck, Search } from '@element-plus/icons-vue';
  603. import Editor from '@/components/Editor/index.vue';
  604. import UploadImage from '@/components/upload-image/index.vue';
  605. import TaxCodeSelect from '@/components/TaxCodeSelect/index.vue';
  606. import { categoryTreeVO, CategoryVO } from '@/api/product/category/types';
  607. import { BrandVO } from '@/api/product/brand/types';
  608. import { BaseForm } from '@/api/product/base/types';
  609. import { ClassificationDiyForm } from '@/api/product/classificationDiy/types';
  610. import { AttributesVO } from '@/api/product/attributes/types';
  611. import {
  612. addBase,
  613. updateBase,
  614. getBase,
  615. categoryTree,
  616. categoryList,
  617. categoryAttributeList,
  618. getAfterSaleList,
  619. getServiceList,
  620. getUnitList,
  621. getTaxRateList
  622. } from '@/api/product/base';
  623. import {
  624. addBaseAudit,
  625. updateBaseAudit,
  626. getBaseAudit,
  627. } from '@/api/product/baseAudit';
  628. import { BaseAuditVO, BaseAuditQuery, BaseAuditForm } from '@/api/product/baseAudit/types';
  629. import { getTaxCode } from '@/api/system/taxCode';
  630. import { listBrand, getBrand } from '@/api/product/brand';
  631. import { listInfo } from '@/api/customer/supplierInfo';
  632. import { InfoVO } from '@/api/customer/supplierInfo/types';
  633. import { listComStaff } from '@/api/system/comStaff';
  634. import { ComStaffVO } from '@/api/system/comStaff/types';
  635. const route = useRoute();
  636. const router = useRouter();
  637. const currentStep = ref(1);
  638. const loading = ref(false);
  639. const submitLoading = ref(false);
  640. const productFormRef = ref();
  641. // 服务保障和安装服务的多选框
  642. const serviceGuarantees = ref<(string | number)[]>([]);
  643. const installationServices = ref<string[]>([]);
  644. // 商品详情选项卡
  645. const activeDetailTab = ref('pc');
  646. // 轮播图URL数组(UI管理用)
  647. const carouselImages = ref<string[]>([]);
  648. // 税率选项
  649. const taxRateOptions = ref<any[]>([]);
  650. // 税率编码选择组件
  651. const taxCodeSelectRef = ref();
  652. // 已选的税率编码(显示用)
  653. const taxCodeNo = ref('');
  654. // 处理税率编码选择
  655. const handleTaxCodeSelect = async (row: any) => {
  656. (productForm as any).taxationId = row.id;
  657. try {
  658. const taxRes = await getTaxCode(row.id);
  659. if (taxRes.data) {
  660. taxCodeNo.value = `${taxRes.data.taxationNo},${taxRes.data.name}`;
  661. } else {
  662. taxCodeNo.value = row.taxationNo ? `${row.taxationNo},${row.name}` : (row.name || '');
  663. }
  664. } catch (e) {
  665. console.error('获取税率编码详情失败:', e);
  666. taxCodeNo.value = row.taxationNo ? `${row.taxationNo},${row.name}` : (row.name || '');
  667. }
  668. // 同时将显示值存入 form,方便编辑回显时直接读取
  669. (productForm as any).taxationNo = taxCodeNo.value;
  670. };
  671. // 定制说明表单
  672. const customForm = reactive({
  673. isCustomize: false,
  674. selectedMethods: [] as string[],
  675. selectedCrafts: [] as string[],
  676. customDetails: [] as Array<{
  677. decorationMethod: string;
  678. craft: string;
  679. minOrderQty: string;
  680. minOrderPrice: string;
  681. samplePeriod: string;
  682. productionPeriod: string;
  683. }>,
  684. customDescription: ''
  685. });
  686. // 定制方式选项
  687. const customMethodOptions = [
  688. { label: '包装定制', value: 'package' },
  689. { label: '商品定制', value: 'product' },
  690. { label: '开模定制', value: 'mold' }
  691. ];
  692. // 定制工艺选项
  693. const customCraftOptions = [
  694. { label: '丝印', value: 'silkScreen' },
  695. { label: '热转印', value: 'thermalTransfer' },
  696. { label: '激光', value: 'laser' },
  697. { label: '烤花', value: 'baking' },
  698. { label: '压印', value: 'embossing' }
  699. ];
  700. // 定制方式映射
  701. const customMethodMap: Record<string, string> = {
  702. 'package': '包装定制',
  703. 'product': '商品定制',
  704. 'mold': '开模定制'
  705. };
  706. // 定制工艺映射
  707. const customCraftMap: Record<string, string> = {
  708. 'silkScreen': '丝印',
  709. 'thermalTransfer': '热转印',
  710. 'laser': '激光',
  711. 'baking': '烤花',
  712. 'embossing': '压印'
  713. };
  714. // 服务保障选择不需要watch,在提交时直接转换为逗号分隔字符串
  715. // 监听安装服务复选框变化,同步到表单
  716. watch(
  717. installationServices,
  718. (newVal) => {
  719. productForm.freeInstallation = newVal.includes('freeInstallation') ? '1' : '0';
  720. },
  721. { deep: true }
  722. );
  723. // 监听定制方式和工艺选择变化,更新表格数据
  724. watch(
  725. [() => customForm.selectedMethods, () => customForm.selectedCrafts],
  726. ([newMethods, newCrafts]) => {
  727. const newDetails: typeof customForm.customDetails = [];
  728. // 遍历所有选中的定制方式和工艺组合
  729. newMethods.forEach((method) => {
  730. const decorationMethod = customMethodMap[method];
  731. newCrafts.forEach((craft) => {
  732. const craftName = customCraftMap[craft];
  733. // 查找是否已存在该组合的数据
  734. const existing = customForm.customDetails.find((item) => item.decorationMethod === decorationMethod && item.craft === craftName);
  735. newDetails.push(
  736. existing || {
  737. decorationMethod,
  738. craft: craftName,
  739. minOrderQty: '',
  740. minOrderPrice: '',
  741. samplePeriod: '',
  742. productionPeriod: ''
  743. }
  744. );
  745. });
  746. });
  747. customForm.customDetails = newDetails;
  748. },
  749. { deep: true }
  750. );
  751. // 切换定制方式选择
  752. const toggleMethod = (method: string) => {
  753. const index = customForm.selectedMethods.indexOf(method);
  754. if (index > -1) {
  755. customForm.selectedMethods.splice(index, 1);
  756. } else {
  757. customForm.selectedMethods.push(method);
  758. }
  759. };
  760. // 切换定制工艺选择
  761. const toggleCraft = (craft: string) => {
  762. const index = customForm.selectedCrafts.indexOf(craft);
  763. if (index > -1) {
  764. customForm.selectedCrafts.splice(index, 1);
  765. } else {
  766. customForm.selectedCrafts.push(craft);
  767. }
  768. };
  769. // 删除定制详情行
  770. const removeCustomDetail = (index: number) => {
  771. customForm.customDetails.splice(index, 1);
  772. };
  773. const pageTitle = computed(() => {
  774. return route.params.id ? '编辑商品' : '新增商品';
  775. });
  776. // 分类选择表单
  777. const categoryForm = reactive({
  778. topCategoryId: undefined as string | number | undefined,
  779. mediumCategoryId: undefined as string | number | undefined,
  780. bottomCategoryId: undefined as string | number | undefined
  781. });
  782. const autoCreateCategory = ref(false);
  783. const manualCategoryInput = ref('');
  784. // 商品信息表单
  785. const productForm = reactive<BaseForm>({
  786. id: undefined,
  787. productNo: undefined,
  788. itemName: undefined,
  789. brandId: undefined,
  790. topCategoryId: undefined,
  791. mediumCategoryId: undefined,
  792. bottomCategoryId: undefined,
  793. unitId: undefined,
  794. productImage: undefined,
  795. imageUrl: undefined,
  796. isSelf: 0,
  797. productReviewStatus: 0,
  798. homeRecommended: 0,
  799. categoryRecommendation: 0,
  800. cartRecommendation: 0,
  801. recommendedProductOrder: 0,
  802. isPopular: 0,
  803. isNew: 0,
  804. productStatus: '0',
  805. remark: undefined,
  806. a10ProductName: undefined,
  807. specificationsCode: undefined,
  808. barCoding: undefined,
  809. invoiceName: undefined,
  810. invoiceSpecs: undefined,
  811. packagingSpec: undefined,
  812. referenceLink: undefined,
  813. productWeight: undefined,
  814. weightUnit: 'kg',
  815. productVolume: undefined,
  816. volumeUnit: 'm3',
  817. productDescription: undefined,
  818. mainLibraryIntro: undefined,
  819. afterSalesService: undefined,
  820. serviceGuarantee: undefined, // 服务保障ID列表,逗号分隔
  821. freeInstallation: '0',
  822. marketPrice: undefined,
  823. memberPrice: undefined,
  824. minSellingPrice: undefined,
  825. purchasingPrice: undefined,
  826. maxPurchasePrice: undefined,
  827. productNature: '1',
  828. purchasingPersonnel: '1',
  829. pcDetail: undefined,
  830. mobileDetail: undefined,
  831. taxRate: undefined,
  832. currency: 'RMB',
  833. minOrderQuantity: undefined,
  834. salesVolume: undefined
  835. });
  836. // 表单验证规则
  837. const productRules = {
  838. // productNo: [{ required: true, message: '商品编号不能为空', trigger: 'blur' }],
  839. itemName: [{ required: true, message: '商品名称不能为空', trigger: 'blur' }],
  840. brandId: [{ required: true, message: '商品品牌不能为空', trigger: 'change' }],
  841. // mainLibraryIntro: [{ required: true, message: '主供应商不能为空', trigger: 'change' }],
  842. marketPrice: [{ required: true, message: '市场价不能为空', trigger: 'blur' }],
  843. memberPrice: [{ required: true, message: '平台售价不能为空', trigger: 'blur' }],
  844. minSellingPrice: [{ required: true, message: '最低售价不能为空', trigger: 'blur' }],
  845. purchasingPrice: [{ required: true, message: '采购价不能为空', trigger: 'blur' }],
  846. productNature: [{ required: true, message: '产品经理不能为空', trigger: 'change' }],
  847. purchasingPersonnel: [{ required: true, message: '采购人员不能为空', trigger: 'change' }],
  848. taxRate: [{ required: true, message: '税率不能为空', trigger: 'change' }],
  849. minOrderQuantity: [{ required: true, message: '最低起订量不能为空', trigger: 'blur' }]
  850. };
  851. // 分类和品牌选项
  852. const categoryOptions = ref<categoryTreeVO[]>([]);
  853. const brandOptions = ref<BrandVO[]>([]);
  854. const brandLoading = ref(false);
  855. let brandSearchTimer: ReturnType<typeof setTimeout> | null = null;
  856. // 商品属性列表
  857. const attributesList = ref<AttributesVO[]>([]);
  858. const productAttributesValues = ref<Record<string | number, any>>({});
  859. // 售后服务和服务保障选项
  860. const afterSalesOptions = ref<any[]>([]);
  861. const serviceGuaranteeOptions = ref<any[]>([]);
  862. // 单位选项
  863. const unitOptions = ref<any[]>([]);
  864. // 主供应商选项
  865. const supplierOptions = ref<InfoVO[]>([]);
  866. // 自定义属性列表
  867. const diyAttributesList = ref<ClassificationDiyForm[]>([]);
  868. // 添加自定义属性行
  869. const addDiyAttribute = () => {
  870. diyAttributesList.value.push({ attributeKey: '', attributeValue: '' });
  871. };
  872. // 删除自定义属性行
  873. const removeDiyAttribute = (index: number) => {
  874. diyAttributesList.value.splice(index, 1);
  875. };
  876. // 采购人员选项
  877. const staffOptions = ref<ComStaffVO[]>([]);
  878. // 搜索关键词
  879. const searchLevel1 = ref('');
  880. const searchLevel2 = ref('');
  881. const searchLevel3 = ref('');
  882. // 三级分类下拉搜索
  883. const level3SearchValue = ref<string | number | null>(null);
  884. const level3SearchOptions = ref<CategoryVO[]>([]);
  885. const level3SearchLoading = ref(false);
  886. // 一级分类列表
  887. const level1Categories = computed(() => {
  888. return categoryOptions.value || [];
  889. });
  890. // 二级分类列表
  891. const level2Categories = ref<categoryTreeVO[]>([]);
  892. // 三级分类列表
  893. const level3Categories = ref<categoryTreeVO[]>([]);
  894. // 过滤后的一级分类列表
  895. const filteredLevel1Categories = computed(() => {
  896. if (!searchLevel1.value) {
  897. return level1Categories.value;
  898. }
  899. return level1Categories.value.filter((item) => item.label.toLowerCase().includes(searchLevel1.value.toLowerCase()));
  900. });
  901. // 过滤后的二级分类列表
  902. const filteredLevel2Categories = computed(() => {
  903. if (!searchLevel2.value) {
  904. return level2Categories.value;
  905. }
  906. return level2Categories.value.filter((item) => item.label.toLowerCase().includes(searchLevel2.value.toLowerCase()));
  907. });
  908. // 过滤后的三级分类列表
  909. const filteredLevel3Categories = computed(() => {
  910. if (!searchLevel3.value) {
  911. return level3Categories.value;
  912. }
  913. return level3Categories.value.filter((item) => item.label.toLowerCase().includes(searchLevel3.value.toLowerCase()));
  914. });
  915. // 搜索三级分类(调用接口)
  916. const handleLevel3Search = async (keyword: string) => {
  917. if (!keyword) {
  918. level3SearchOptions.value = [];
  919. return;
  920. }
  921. level3SearchLoading.value = true;
  922. try {
  923. const res = await categoryList({ classLevel: 3, categoryName: keyword, pageNum: 1, pageSize: 50 });
  924. level3SearchOptions.value = (res as any).data || (res as any).rows || [];
  925. } catch (error) {
  926. console.error('搜索三级分类失败:', error);
  927. } finally {
  928. level3SearchLoading.value = false;
  929. }
  930. };
  931. // 选择三级分类搜索结果后,自动在树中定位
  932. const handleLevel3SearchSelect = async (categoryId: string | number) => {
  933. if (!categoryId) return;
  934. const selectedCategory = level3SearchOptions.value.find((item) => String(item.id) === String(categoryId));
  935. if (!selectedCategory) return;
  936. // 在分类树中查找对应的二级节点(三级的父节点)
  937. const level2Node = findCategoryById(categoryOptions.value, selectedCategory.parentId);
  938. if (!level2Node) return;
  939. // 在一级列表中查找(二级的父节点)
  940. const level1Node = level1Categories.value.find((item) => String(item.id) === String(level2Node.parentId));
  941. if (!level1Node) return;
  942. // 依次选中一级、二级、三级
  943. categoryForm.topCategoryId = level1Node.id;
  944. selectedLevel1Name.value = level1Node.label;
  945. level2Categories.value = level1Node.children || [];
  946. await nextTick();
  947. categoryForm.mediumCategoryId = level2Node.id;
  948. selectedLevel2Name.value = level2Node.label;
  949. level3Categories.value = level2Node.children || [];
  950. await nextTick();
  951. // 精确查找三级节点
  952. const level3Node = level3Categories.value.find((item) => String(item.id) === String(selectedCategory.id));
  953. if (level3Node) {
  954. categoryForm.bottomCategoryId = level3Node.id;
  955. selectedLevel3Name.value = level3Node.label;
  956. await loadCategoryAttributes(level3Node.id);
  957. } else {
  958. categoryForm.bottomCategoryId = selectedCategory.id;
  959. selectedLevel3Name.value = selectedCategory.categoryName;
  960. await loadCategoryAttributes(selectedCategory.id);
  961. }
  962. // 清空搜索框
  963. level3SearchValue.value = null;
  964. level3SearchOptions.value = [];
  965. };
  966. // 选中的分类名称
  967. const selectedLevel1Name = ref('');
  968. const selectedLevel2Name = ref('');
  969. const selectedLevel3Name = ref('');
  970. // 选择一级分类
  971. const selectLevel1 = (item: categoryTreeVO) => {
  972. if (!item.children || item.children.length === 0) {
  973. ElMessage.warning('该分类无子分类,请选择含三级分类的类别');
  974. return;
  975. }
  976. categoryForm.topCategoryId = item.id;
  977. categoryForm.mediumCategoryId = undefined;
  978. categoryForm.bottomCategoryId = undefined;
  979. selectedLevel1Name.value = item.label;
  980. selectedLevel2Name.value = '';
  981. selectedLevel3Name.value = '';
  982. level2Categories.value = item.children || [];
  983. level3Categories.value = [];
  984. };
  985. // 选择二级分类
  986. const selectLevel2 = (item: categoryTreeVO) => {
  987. if (!item.children || item.children.length === 0) {
  988. ElMessage.warning('该分类无子分类,请选择含三级分类的类别');
  989. return;
  990. }
  991. categoryForm.mediumCategoryId = item.id;
  992. categoryForm.bottomCategoryId = undefined;
  993. selectedLevel2Name.value = item.label;
  994. selectedLevel3Name.value = '';
  995. level3Categories.value = item.children || [];
  996. };
  997. // 选择三级分类
  998. const selectLevel3 = async (item: categoryTreeVO) => {
  999. categoryForm.bottomCategoryId = item.id;
  1000. selectedLevel3Name.value = item.label;
  1001. // 加载该分类下的属性列表
  1002. await loadCategoryAttributes(item.id);
  1003. };
  1004. // 获取分类路径
  1005. const getCategoryPath = () => {
  1006. const parts = [];
  1007. if (selectedLevel1Name.value) parts.push(selectedLevel1Name.value);
  1008. if (selectedLevel2Name.value) parts.push(selectedLevel2Name.value);
  1009. if (selectedLevel3Name.value) parts.push(selectedLevel3Name.value);
  1010. return parts.join(' > ') || '请选择分类';
  1011. };
  1012. // 清除分类
  1013. const clearCategory = () => {
  1014. categoryForm.topCategoryId = undefined;
  1015. categoryForm.mediumCategoryId = undefined;
  1016. categoryForm.bottomCategoryId = undefined;
  1017. selectedLevel1Name.value = '';
  1018. selectedLevel2Name.value = '';
  1019. selectedLevel3Name.value = '';
  1020. level2Categories.value = [];
  1021. level3Categories.value = [];
  1022. attributesList.value = [];
  1023. productAttributesValues.value = {};
  1024. };
  1025. // 下一步
  1026. const nextStep = async () => {
  1027. if (currentStep.value === 0) {
  1028. // 验证分类选择
  1029. if (!categoryForm.topCategoryId) {
  1030. ElMessage.warning('请选择一级分类');
  1031. return;
  1032. }
  1033. if (!categoryForm.mediumCategoryId) {
  1034. ElMessage.warning('请选择二级分类');
  1035. return;
  1036. }
  1037. if (!categoryForm.bottomCategoryId) {
  1038. ElMessage.warning('请选择三级分类');
  1039. return;
  1040. }
  1041. // 将分类信息同步到商品表单
  1042. productForm.topCategoryId = categoryForm.topCategoryId;
  1043. productForm.mediumCategoryId = categoryForm.mediumCategoryId;
  1044. productForm.bottomCategoryId = categoryForm.bottomCategoryId;
  1045. currentStep.value++;
  1046. } else if (currentStep.value === 1) {
  1047. // 验证商品信息表单并提交
  1048. try {
  1049. await productFormRef.value?.validate();
  1050. // 调用提交函数
  1051. await handleSubmit();
  1052. } catch (error) {
  1053. ElMessage.warning('请完善商品信息');
  1054. return;
  1055. }
  1056. }
  1057. };
  1058. // 上一步
  1059. const prevStep = () => {
  1060. if (currentStep.value > 0) {
  1061. currentStep.value--;
  1062. }
  1063. };
  1064. // 提交
  1065. const handleSubmit = async () => {
  1066. try {
  1067. submitLoading.value = true;
  1068. // 校验商品主图、轮播图、详情必填
  1069. if (!productForm.productImage) {
  1070. ElMessage.warning('请上传商品主图');
  1071. submitLoading.value = false;
  1072. return;
  1073. }
  1074. if (!carouselImages.value || carouselImages.value.length === 0) {
  1075. ElMessage.warning('请上传商品轮播图');
  1076. submitLoading.value = false;
  1077. return;
  1078. }
  1079. if (!productForm.pcDetail) {
  1080. ElMessage.warning('请填写电脑端商品详情');
  1081. submitLoading.value = false;
  1082. return;
  1083. }
  1084. // 校验价格关系:市场价 > 官网价 > 最低售价
  1085. const midRange = parseFloat(String(productForm.marketPrice));
  1086. const standard = parseFloat(String(productForm.memberPrice));
  1087. const certificate = parseFloat(String(productForm.minSellingPrice));
  1088. if (!isNaN(midRange) && !isNaN(standard) && !isNaN(certificate)) {
  1089. if (!(midRange > standard)) {
  1090. ElMessage.warning('市场价必须大于官网价');
  1091. submitLoading.value = false;
  1092. return;
  1093. }
  1094. if (!(standard > certificate)) {
  1095. ElMessage.warning('官网价必须大于最低售价');
  1096. submitLoading.value = false;
  1097. return;
  1098. }
  1099. }
  1100. // 准备提交数据,包含定制信息(A10产品名称由前端自动拼接,不传后端)
  1101. const submitProductData: any = {
  1102. ...productForm,
  1103. // 将服务保障ID数组转换为逗号分隔字符串
  1104. serviceGuarantee: serviceGuarantees.value.map((id) => String(id)).join(','),
  1105. // 轮播图URL逗号分隔
  1106. imageUrl: carouselImages.value.join(','),
  1107. // 将商品属性值转换为JSON字符串
  1108. attributesList: JSON.stringify(productAttributesValues.value),
  1109. isCustomize: customForm.isCustomize ? 1 : 0,
  1110. customizedStyle: customForm.selectedMethods.join(','),
  1111. customizedCraft: customForm.selectedCrafts.join(','),
  1112. customDescription: customForm.customDescription,
  1113. customDetailsJson: JSON.stringify(customForm.customDetails),
  1114. diyAttributesList: diyAttributesList.value.filter((item) => item.attributeKey || item.attributeValue)
  1115. };
  1116. // A10产品名称不传后端
  1117. delete submitProductData.a10ProductName;
  1118. const auditData: BaseAuditForm = {
  1119. id: route.params.id as string,
  1120. productData: JSON.stringify(submitProductData),
  1121. type: 0,
  1122. auditStatus: 0
  1123. };
  1124. if (auditData.id) {
  1125. await updateBaseAudit(auditData);
  1126. ElMessage.success('修改成功');
  1127. } else {
  1128. await addBaseAudit(auditData);
  1129. ElMessage.success('新增成功');
  1130. }
  1131. // 跳转到完成页面(步骤3)
  1132. currentStep.value = 2;
  1133. } catch (error) {
  1134. console.error('提交失败:', error);
  1135. } finally {
  1136. submitLoading.value = false;
  1137. }
  1138. };
  1139. // 返回
  1140. const handleBack = () => {
  1141. router.back();
  1142. };
  1143. // 返回列表
  1144. const handleBackToList = () => {
  1145. router.push('/product/base');
  1146. };
  1147. // UPC(69)条码只允许输入数字
  1148. const handleUpcInput = () => {
  1149. if (productForm.barCoding) {
  1150. productForm.barCoding = productForm.barCoding.replace(/\D/g, '');
  1151. }
  1152. };
  1153. // 销量人气只允许输入整数
  1154. const handleSalesVolumeInput = (val: string) => {
  1155. if (val !== undefined && val !== null && val !== '') {
  1156. const intVal = parseInt(String(val).replace(/[^\d]/g, ''), 10);
  1157. productForm.salesVolume = !isNaN(intVal) ? intVal : undefined;
  1158. } else {
  1159. productForm.salesVolume = undefined;
  1160. }
  1161. };
  1162. // A10产品名称自动拼接(品牌名 + 规格型号 + 产品分类 + 发票规格)
  1163. const a10ProductNameComputed = computed(() => {
  1164. const brand = brandOptions.value.find((b) => Number(b.id) === Number(productForm.brandId));
  1165. const brandName = brand?.brandName || '';
  1166. const specificationsCode = productForm.specificationsCode || '';
  1167. const categoryName = selectedLevel3Name.value || '';
  1168. const invoiceSpecs = productForm.invoiceSpecs || '';
  1169. return [brandName, specificationsCode, categoryName, invoiceSpecs].filter((s) => s.trim()).join(' ');
  1170. });
  1171. // 格式化价格为两位小数(不允许负数)
  1172. const formatPrice = (field: string) => {
  1173. const val = (productForm as any)[field];
  1174. if (val !== undefined && val !== null && val !== '') {
  1175. let num = parseFloat(String(val));
  1176. if (!isNaN(num)) {
  1177. // 不允许负数
  1178. if (num < 0) num = 0;
  1179. (productForm as any)[field] = num.toFixed(2);
  1180. }
  1181. }
  1182. };
  1183. // 格式化表格行中的价格为两位小数(不允许负数)
  1184. const formatRowPrice = (row: any, field: string) => {
  1185. const val = row[field];
  1186. if (val !== undefined && val !== null && val !== '') {
  1187. let num = parseFloat(String(val));
  1188. if (!isNaN(num)) {
  1189. // 不允许负数
  1190. if (num < 0) num = 0;
  1191. row[field] = num.toFixed(2);
  1192. }
  1193. }
  1194. };
  1195. // 获取分类树
  1196. const getCategoryTree = async () => {
  1197. try {
  1198. const res = await categoryTree();
  1199. categoryOptions.value = res.data || [];
  1200. } catch (error) {
  1201. console.error('获取分类树失败:', error);
  1202. }
  1203. };
  1204. // 加载品牌选项(默认100条)
  1205. const loadBrandOptions = async (keyword?: string) => {
  1206. brandLoading.value = true;
  1207. try {
  1208. const res = await listBrand({ pageNum: 1, pageSize: 100, brandName: keyword });
  1209. const newList = res.rows || [];
  1210. // 编辑模式下保留当前选中的品牌,避免被新列表覆盖后 A10产品名称 computed 失效
  1211. if (productForm.brandId) {
  1212. const exists = newList.find((item) => Number(item.id) === Number(productForm.brandId));
  1213. if (!exists) {
  1214. const currentBrand = brandOptions.value.find((item) => Number(item.id) === Number(productForm.brandId));
  1215. if (currentBrand) {
  1216. newList.unshift(currentBrand);
  1217. }
  1218. }
  1219. }
  1220. brandOptions.value = newList;
  1221. } catch (error) {
  1222. console.error('加载品牌列表失败:', error);
  1223. } finally {
  1224. brandLoading.value = false;
  1225. }
  1226. };
  1227. // 品牌远程搜索(防抖)
  1228. const handleBrandSearch = (query: string) => {
  1229. if (brandSearchTimer) clearTimeout(brandSearchTimer);
  1230. brandSearchTimer = setTimeout(() => {
  1231. loadBrandOptions(query || undefined);
  1232. }, 300);
  1233. };
  1234. // 处理品牌下拉框显示/隐藏
  1235. const handleBrandVisibleChange = (visible: boolean) => {
  1236. if (visible && brandOptions.value.length === 0) {
  1237. loadBrandOptions();
  1238. }
  1239. };
  1240. // 获取售后服务列表
  1241. const getAfterSalesOptions = async () => {
  1242. try {
  1243. const res = await getAfterSaleList();
  1244. afterSalesOptions.value = res.data || [];
  1245. // 如果是新增模式且有选项,设置第一个为默认值
  1246. if (!route.params.id && afterSalesOptions.value.length > 0 && !productForm.afterSalesService) {
  1247. productForm.afterSalesService = afterSalesOptions.value[0].id;
  1248. }
  1249. } catch (error) {
  1250. console.error('获取售后服务列表失败:', error);
  1251. }
  1252. };
  1253. // 获取服务保障列表
  1254. const getServiceGuaranteeOptions = async () => {
  1255. try {
  1256. const res = await getServiceList();
  1257. serviceGuaranteeOptions.value = res.data || [];
  1258. // 如果是新增模式且有选项,设置第一个为默认选中
  1259. if (!route.params.id && serviceGuaranteeOptions.value.length > 0 && serviceGuarantees.value.length === 0) {
  1260. serviceGuarantees.value = [serviceGuaranteeOptions.value[0].id];
  1261. }
  1262. } catch (error) {
  1263. console.error('获取服务保障列表失败:', error);
  1264. }
  1265. };
  1266. // 获取单位列表
  1267. const getUnitOptions = async () => {
  1268. try {
  1269. const res = await getUnitList();
  1270. unitOptions.value = res.data || [];
  1271. // 如果是新增模式且有选项,设置第一个为默认值
  1272. if (!route.params.id && unitOptions.value.length > 0 && !productForm.unitId) {
  1273. productForm.unitId = unitOptions.value[0].id;
  1274. }
  1275. } catch (error) {
  1276. console.error('获取单位列表失败:', error);
  1277. }
  1278. };
  1279. // 获取主供应商列表
  1280. const getSupplierOptions = async () => {
  1281. try {
  1282. const res = await listInfo();
  1283. console.log('供应商接口返回:', res);
  1284. // 处理可能的数据结构: res.data 或 res.rows
  1285. const dataList = res.data || res.rows || [];
  1286. supplierOptions.value = dataList;
  1287. console.log('供应商列表:', supplierOptions.value);
  1288. // 如果有选项且当前没有选中值,设置第一个为默认值
  1289. if (supplierOptions.value.length > 0 && !productForm.mainLibraryIntro) {
  1290. productForm.mainLibraryIntro = String(supplierOptions.value[0].id);
  1291. }
  1292. } catch (error) {
  1293. console.error('获取主供应商列表失败:', error);
  1294. }
  1295. };
  1296. // 获取采购人员列表
  1297. const getStaffOptions = async () => {
  1298. try {
  1299. const res = await listComStaff();
  1300. console.log('采购人员接口返回:', res);
  1301. // 处理可能的数据结构: res.data 或 res.rows
  1302. const dataList = res.data || res.rows || [];
  1303. staffOptions.value = dataList;
  1304. console.log('采购人员列表:', staffOptions.value);
  1305. // 如果有选项且当前没有选中值,设置第一个为默认值
  1306. if (staffOptions.value.length > 0 && !productForm.purchasingPersonnel) {
  1307. productForm.purchasingPersonnel = String(staffOptions.value[0].staffId);
  1308. }
  1309. } catch (error) {
  1310. console.error('获取采购人员列表失败:', error);
  1311. }
  1312. };
  1313. // 获取税率列表
  1314. const getTaxRateOptions = async () => {
  1315. try {
  1316. const res = await getTaxRateList();
  1317. taxRateOptions.value = res.rows || [];
  1318. } catch (error) {
  1319. console.error('获取税率列表失败:', error);
  1320. }
  1321. };
  1322. // 加载分类属性列表
  1323. const loadCategoryAttributes = async (categoryId: string | number) => {
  1324. try {
  1325. const res = await categoryAttributeList(categoryId);
  1326. attributesList.value = res.data || [];
  1327. // 清空之前的属性值
  1328. productAttributesValues.value = {};
  1329. // 如果是新增模式,为有选项的属性设置默认值
  1330. if (!route.params.id) {
  1331. attributesList.value.forEach((attr) => {
  1332. if (attr.entryMethod === '1' && attr.attributesList) {
  1333. // 下拉选择
  1334. const options = parseAttributesList(attr.attributesList);
  1335. if (options.length > 0) {
  1336. productAttributesValues.value[attr.id] = options[0];
  1337. }
  1338. } else if (attr.entryMethod === '3' && attr.attributesList) {
  1339. // 多选
  1340. const options = parseAttributesList(attr.attributesList);
  1341. if (options.length > 0) {
  1342. productAttributesValues.value[attr.id] = [options[0]];
  1343. }
  1344. }
  1345. });
  1346. }
  1347. } catch (error) {
  1348. console.error('加载分类属性失败:', error);
  1349. attributesList.value = [];
  1350. }
  1351. };
  1352. // 解析属性值列表(JSON数组或逗号分隔字符串)
  1353. const parseAttributesList = (attributesListStr: string): string[] => {
  1354. if (!attributesListStr) return [];
  1355. try {
  1356. // 尝试解析为JSON数组
  1357. const parsed = JSON.parse(attributesListStr);
  1358. if (Array.isArray(parsed)) {
  1359. return parsed;
  1360. }
  1361. } catch (e) {
  1362. // 如果不是JSON,按逗号分隔
  1363. return attributesListStr
  1364. .split(',')
  1365. .map((item) => item.trim())
  1366. .filter((item) => item);
  1367. }
  1368. return [];
  1369. };
  1370. // 加载商品详情(编辑模式)
  1371. const loadProductDetail = async () => {
  1372. const id = route.params.id;
  1373. if (id) {
  1374. try {
  1375. loading.value = true;
  1376. const res = await getBaseAudit(id as string);
  1377. Object.assign(productForm, res.data.productBaseVo);
  1378. // 回显产品经理 - 确保转换为字符串类型以匹配下拉框的value
  1379. if (res.data.productBaseVo.productNature !== undefined && res.data.productBaseVo.productNature !== null) {
  1380. productForm.productNature = String(res.data.productBaseVo.productNature);
  1381. }
  1382. // 回显采购人员 - 确保转换为字符串类型以匹配下拉框的value
  1383. if (res.data.productBaseVo.purchasingPersonnel !== undefined && res.data.productBaseVo.purchasingPersonnel !== null) {
  1384. productForm.purchasingPersonnel = String(res.data.productBaseVo.purchasingPersonnel);
  1385. }
  1386. // 回显税率编码显示值
  1387. const rawData = res.data.productBaseVo as any;
  1388. // 通过 taxationId 调接口获取中文名称回显
  1389. if (rawData.taxationId) {
  1390. try {
  1391. const taxRes = await getTaxCode(rawData.taxationId);
  1392. if (taxRes.data) {
  1393. taxCodeNo.value = `${taxRes.data.taxationNo},${taxRes.data.name}`;
  1394. }
  1395. } catch (e) {
  1396. console.error('获取税率编码失败:', e);
  1397. }
  1398. }
  1399. // 回显税率 - 在税率选项中查找匹配的值(处理浮点数精度问题)
  1400. if (res.data.productBaseVo.taxRate !== undefined && res.data.productBaseVo.taxRate !== null) {
  1401. const apiTaxRate = Number(res.data.productBaseVo.taxRate);
  1402. // 使用精度容差比较浮点数
  1403. const matchedOption = taxRateOptions.value.find((opt) => Math.abs(Number(opt.taxrate) - apiTaxRate) < 0.0001);
  1404. if (matchedOption) {
  1405. productForm.taxRate = matchedOption.taxrate;
  1406. } else {
  1407. productForm.taxRate = apiTaxRate;
  1408. }
  1409. }
  1410. // 回显单位 - 确保类型与下拉选项的id一致(数字类型)
  1411. if (res.data.productBaseVo.unitId !== undefined && res.data.productBaseVo.unitId !== null) {
  1412. productForm.unitId = Number(res.data.productBaseVo.unitId);
  1413. }
  1414. // 回显品牌 - 先加载对应的品牌信息到选项列表中
  1415. if (res.data.productBaseVo.brandId) {
  1416. productForm.brandId = Number(res.data.productBaseVo.brandId);
  1417. try {
  1418. const brandRes = await getBrand(res.data.productBaseVo.brandId);
  1419. if (brandRes.data) {
  1420. // 检查品牌是否已在选项列表中
  1421. const existBrand = brandOptions.value.find((item) => Number(item.id) === Number(res.data.productBaseVo.brandId));
  1422. if (!existBrand) {
  1423. brandOptions.value.unshift(brandRes.data);
  1424. }
  1425. }
  1426. } catch (e) {
  1427. console.error('加载品牌信息失败:', e);
  1428. }
  1429. }
  1430. // 回显售后服务 - 确保类型与下拉选项的id一致(数字类型)
  1431. if (res.data.productBaseVo.afterSalesService !== undefined && res.data.productBaseVo.afterSalesService !== null) {
  1432. productForm.afterSalesService = Number(res.data.productBaseVo.afterSalesService);
  1433. }
  1434. // 回显轮播图
  1435. if (res.data.productBaseVo.imageUrl) {
  1436. carouselImages.value = res.data.productBaseVo.imageUrl.split(',').filter((url: string) => url.trim());
  1437. } else {
  1438. carouselImages.value = [];
  1439. }
  1440. // 回显分类选择
  1441. categoryForm.topCategoryId = res.data.productBaseVo.topCategoryId;
  1442. categoryForm.mediumCategoryId = res.data.productBaseVo.mediumCategoryId;
  1443. categoryForm.bottomCategoryId = res.data.productBaseVo.bottomCategoryId;
  1444. // 回显服务保障复选框 - 将逗号分隔的ID字符串转换为数组
  1445. if (res.data.productBaseVo.serviceGuarantee) {
  1446. serviceGuarantees.value = res.data.productBaseVo.serviceGuarantee.split(',').map((id: string) => {
  1447. // 尝试转换为数字,如果失败则保持字符串
  1448. const numId = Number(id.trim());
  1449. return isNaN(numId) ? id.trim() : numId;
  1450. });
  1451. } else {
  1452. serviceGuarantees.value = [];
  1453. }
  1454. // 回显安装服务复选框
  1455. const services: string[] = [];
  1456. if (res.data.productBaseVo.freeInstallation === '1') services.push('freeInstallation');
  1457. installationServices.value = services;
  1458. // 回显分类名称 - 使用nextTick确保DOM更新后再查找子分类
  1459. await restoreCategorySelection();
  1460. // 回显商品属性值(必须在restoreCategorySelection之后,避免loadCategoryAttributes清空属性值)
  1461. if (res.data.productBaseVo.attributesList) {
  1462. try {
  1463. const parsedAttributes = JSON.parse(res.data.productBaseVo.attributesList);
  1464. productAttributesValues.value = parsedAttributes;
  1465. } catch (e) {
  1466. console.error('解析商品属性失败:', e);
  1467. productAttributesValues.value = {};
  1468. }
  1469. }
  1470. // 回显自定义属性列表
  1471. const rawResData = res.data as any;
  1472. if (Array.isArray(rawResData.productBaseVo.diyAttributesList) && rawResData.productBaseVo.diyAttributesList.length > 0) {
  1473. diyAttributesList.value = rawResData.productBaseVo.diyAttributesList;
  1474. } else {
  1475. diyAttributesList.value = [];
  1476. }
  1477. } catch (error) {
  1478. console.error('加载商品详情失败:', error);
  1479. ElMessage.error('加载商品详情失败');
  1480. } finally {
  1481. loading.value = false;
  1482. }
  1483. }
  1484. };
  1485. // 递归查找分类节点
  1486. const findCategoryById = (categories: categoryTreeVO[], id: string | number): categoryTreeVO | null => {
  1487. for (const category of categories) {
  1488. if (String(category.id) === String(id)) {
  1489. return category;
  1490. }
  1491. if (category.children && category.children.length > 0) {
  1492. const found = findCategoryById(category.children, id);
  1493. if (found) return found;
  1494. }
  1495. }
  1496. return null;
  1497. };
  1498. // 恢复分类选择状态
  1499. const restoreCategorySelection = async () => {
  1500. // 先保存原始的分类ID值
  1501. const originalTopCategoryId = categoryForm.topCategoryId;
  1502. const originalMediumCategoryId = categoryForm.mediumCategoryId;
  1503. const originalBottomCategoryId = categoryForm.bottomCategoryId;
  1504. console.log('回显分类 - 原始ID:', {
  1505. top: originalTopCategoryId,
  1506. medium: originalMediumCategoryId,
  1507. bottom: originalBottomCategoryId
  1508. });
  1509. if (!originalTopCategoryId) return;
  1510. // 查找一级分类
  1511. const level1 = level1Categories.value.find((item) => String(item.id) === String(originalTopCategoryId));
  1512. console.log('查找一级分类:', level1);
  1513. if (!level1) return;
  1514. // 设置一级分类选中状态
  1515. categoryForm.topCategoryId = level1.id;
  1516. selectedLevel1Name.value = level1.label;
  1517. level2Categories.value = level1.children || [];
  1518. await nextTick();
  1519. // 查找二级分类
  1520. if (originalMediumCategoryId) {
  1521. // 先在当前一级分类的children中查找
  1522. let level2 = level2Categories.value.find((item) => String(item.id) === String(originalMediumCategoryId));
  1523. // 如果找不到,尝试在整个分类树中查找(容错处理)
  1524. if (!level2) {
  1525. console.log('二级分类在当前一级下未找到,尝试全局查找...');
  1526. level2 = findCategoryById(categoryOptions.value, originalMediumCategoryId);
  1527. }
  1528. console.log('查找二级分类:', level2);
  1529. if (level2) {
  1530. categoryForm.mediumCategoryId = level2.id;
  1531. selectedLevel2Name.value = level2.label;
  1532. level3Categories.value = level2.children || [];
  1533. await nextTick();
  1534. // 查找三级分类
  1535. if (originalBottomCategoryId) {
  1536. // 先在当前二级分类的children中查找
  1537. let level3 = level3Categories.value.find((item) => String(item.id) === String(originalBottomCategoryId));
  1538. // 如果找不到,尝试在整个分类树中查找(容错处理)
  1539. if (!level3) {
  1540. console.log('三级分类在当前二级下未找到,尝试全局查找...');
  1541. level3 = findCategoryById(categoryOptions.value, originalBottomCategoryId);
  1542. }
  1543. console.log('查找三级分类:', level3, '原始ID:', originalBottomCategoryId);
  1544. if (level3) {
  1545. categoryForm.bottomCategoryId = level3.id;
  1546. selectedLevel3Name.value = level3.label;
  1547. console.log('设置三级分类名称:', selectedLevel3Name.value);
  1548. await loadCategoryAttributes(level3.id);
  1549. }
  1550. }
  1551. }
  1552. }
  1553. };
  1554. onMounted(async () => {
  1555. // 编辑模式下先直接跳到第二步,再加载数据,避免闪烁步骤一
  1556. if (route.params.id) {
  1557. currentStep.value = 1;
  1558. }
  1559. await getCategoryTree();
  1560. await getUnitOptions();
  1561. await getAfterSalesOptions();
  1562. await getServiceGuaranteeOptions();
  1563. await getTaxRateOptions();
  1564. // 先加载商品详情(如果是编辑模式)
  1565. await loadProductDetail();
  1566. // 再加载下拉选项,这样如果详情中没有值,会自动设置第一个
  1567. await getSupplierOptions();
  1568. await getStaffOptions();
  1569. loadBrandOptions();
  1570. });
  1571. </script>
  1572. <style scoped lang="scss">
  1573. .product-wizard-page {
  1574. .category-selection {
  1575. margin-top: 12px;
  1576. }
  1577. .category-box {
  1578. border: 1px solid #e4e7ed;
  1579. border-radius: 4px;
  1580. overflow: hidden;
  1581. .category-header {
  1582. background-color: #f5f7fa;
  1583. padding: 10px 12px;
  1584. font-weight: 600;
  1585. border-bottom: 1px solid #e4e7ed;
  1586. text-align: center;
  1587. font-size: 14px;
  1588. }
  1589. .category-search {
  1590. padding: 10px;
  1591. border-bottom: 1px solid #e4e7ed;
  1592. background-color: #fff;
  1593. }
  1594. .category-list {
  1595. height: 280px;
  1596. overflow-y: auto;
  1597. .category-item {
  1598. padding: 10px 12px;
  1599. cursor: pointer;
  1600. display: flex;
  1601. justify-content: space-between;
  1602. align-items: center;
  1603. border-bottom: 1px solid #f0f0f0;
  1604. transition: all 0.3s;
  1605. &:hover {
  1606. background-color: #f5f7fa;
  1607. }
  1608. &.active {
  1609. background-color: #ecf5ff;
  1610. color: #409eff;
  1611. font-weight: 600;
  1612. }
  1613. &:last-child {
  1614. border-bottom: none;
  1615. }
  1616. &.disabled {
  1617. cursor: not-allowed;
  1618. opacity: 0.45;
  1619. pointer-events: none;
  1620. }
  1621. }
  1622. }
  1623. }
  1624. .confirm-info {
  1625. margin-top: 12px;
  1626. text-align: left;
  1627. }
  1628. .product-info-form {
  1629. .category-display {
  1630. display: flex;
  1631. align-items: center;
  1632. .category-text {
  1633. color: #606266;
  1634. }
  1635. }
  1636. .form-item-tip {
  1637. font-size: 12px;
  1638. color: #909399;
  1639. line-height: 1.5;
  1640. margin-top: 4px;
  1641. }
  1642. .currency-text {
  1643. color: #303133;
  1644. font-size: 14px;
  1645. }
  1646. }
  1647. .custom-options {
  1648. display: flex;
  1649. gap: 10px;
  1650. flex-wrap: wrap;
  1651. }
  1652. .custom-table {
  1653. width: 100%;
  1654. margin-top: 10px;
  1655. }
  1656. .view-disabled-wrapper {
  1657. pointer-events: none;
  1658. opacity: 0.9;
  1659. width: 100%;
  1660. }
  1661. }
  1662. </style>