index.vue 101 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134
  1. <!-- 订单管理页面 -->
  2. <template>
  3. <div class="page-container">
  4. <div class="page-head">
  5. <h1>订单列表</h1>
  6. <p class="page-desc">集中查看各区域订单状态、配送进度与支付情况,支持筛选、展开查看商品明细与运营处理。</p>
  7. </div>
  8. <section class="panel">
  9. <div class="panel-top">
  10. <h2>
  11. <el-icon class="title-ic"><Setting /></el-icon>
  12. <span>订单列表</span>
  13. </h2>
  14. </div>
  15. <div class="filter-block">
  16. <el-form :model="searchForm" class="filter-form" label-position="top">
  17. <p class="filter-hint">支持按订单状态、配送状态、支付状态等维度快速筛选;可展开更多条件进行精细检索。</p>
  18. <div class="filter-grid order-filter-main-grid">
  19. <el-form-item label="关键词">
  20. <el-input
  21. v-model="searchForm.keyword"
  22. placeholder="订单编号/客户名称"
  23. clearable
  24. @keyup.enter="handleSearch"
  25. />
  26. </el-form-item>
  27. <el-form-item label="订单状态">
  28. <el-select v-model="searchForm.orderStatus" placeholder="全部" clearable>
  29. <el-option label="全部" value="" />
  30. <el-option label="待支付" value="pending_payment" />
  31. <el-option label="待收货" value="pending_confirm" />
  32. <el-option label="已完成" value="completed" />
  33. <el-option label="已取消" value="cancelled" />
  34. </el-select>
  35. </el-form-item>
  36. <el-form-item label="配送状态">
  37. <el-select v-model="searchForm.deliveryStatus" placeholder="全部" clearable>
  38. <el-option label="全部" value="" />
  39. <el-option label="待分配配送" value="pending_dispatch" />
  40. <el-option label="配送中" value="delivering" />
  41. <el-option label="配送完成" value="delivered" />
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item label="支付状态">
  45. <el-select v-model="searchForm.payStatus" placeholder="全部" clearable>
  46. <el-option label="全部" value="" />
  47. <el-option label="待支付" value="pending_payment" />
  48. <el-option label="已支付" value="paid" />
  49. </el-select>
  50. </el-form-item>
  51. </div>
  52. <div v-show="filterExpanded" class="filter-extra">
  53. <div class="filter-grid order-filter-extra-grid">
  54. <el-form-item label="支付方式">
  55. <el-select v-model="searchForm.paymentMethod" placeholder="全部" clearable>
  56. <el-option label="全部" value="" />
  57. <el-option label="线上支付" value="online" />
  58. <el-option label="线下支付" value="offline" />
  59. </el-select>
  60. </el-form-item>
  61. <el-form-item label="区域">
  62. <el-select
  63. v-model="searchForm.regionId"
  64. placeholder="全部"
  65. clearable
  66. @visible-change="(open) => open && loadRegions()"
  67. >
  68. <el-option v-for="r in regionList" :key="r.id" :label="r.name" :value="r.id" />
  69. </el-select>
  70. </el-form-item>
  71. </div>
  72. </div>
  73. <div class="filter-actions">
  74. <el-button
  75. class="btn-link btn-filter-toggle"
  76. :aria-expanded="String(filterExpanded)"
  77. @click="filterExpanded = !filterExpanded"
  78. >
  79. <el-icon class="btn-filter-toggle-ic">
  80. <ArrowDown v-if="!filterExpanded" />
  81. <ArrowUp v-else />
  82. </el-icon>
  83. {{ filterExpanded ? '收起更多条件' : '展开更多条件' }}
  84. </el-button>
  85. <div class="filter-actions-end">
  86. <el-button class="btn-ghost" @click="handleReset">
  87. <el-icon><RefreshLeft /></el-icon>重置
  88. </el-button>
  89. <el-button class="btn-main" type="primary" @click="handleSearch">
  90. <el-icon><Search /></el-icon>搜索
  91. </el-button>
  92. </div>
  93. </div>
  94. </el-form>
  95. </div>
  96. <!-- 数据表格:单元格 flex 纵向居中,避免订单状态列 el-space 与其它列 el-tag 错位 -->
  97. <div class="list-body list-wrap">
  98. <el-table
  99. ref="orderListTableRef"
  100. class="order-list-table list-table"
  101. :data="tableData"
  102. v-loading="loading"
  103. stripe
  104. @expand-change="handleOrderRowExpand"
  105. >
  106. <el-table-column type="expand" width="48">
  107. <template #default="{ row }">
  108. <div class="order-row-expand-wrap" v-loading="!!expandedRowLoadingMap[row.id]">
  109. <div
  110. v-if="getExpandedItems(row.id).length"
  111. class="order-row-expand-table-wrap sqxp-subtable-wrap"
  112. >
  113. <el-table
  114. :data="getExpandedItems(row.id)"
  115. stripe
  116. size="small"
  117. class="order-row-expand-table sqxp-subtable"
  118. @row-dblclick="openOrderProductView"
  119. >
  120. <el-table-column prop="productName" label="商品" min-width="220">
  121. <template #default="{ row: line }">
  122. <div class="expand-product-cell">
  123. <div class="expand-product-thumb-wrap">
  124. <el-image v-if="line.imageUrl" :src="line.imageUrl" fit="cover" class="expand-product-thumb" />
  125. <span v-else class="expand-product-thumb placeholder">无图</span>
  126. </div>
  127. <span class="expand-product-name">{{ line.productName || '-' }}</span>
  128. </div>
  129. </template>
  130. </el-table-column>
  131. <el-table-column prop="supplierName" label="供应商" min-width="120" />
  132. <el-table-column label="计量" width="88" align="center">
  133. <template #default="{ row: line }">{{ formatMeasureCell(line.measureValue) }}</template>
  134. </el-table-column>
  135. <el-table-column prop="unitName" label="单位" width="70" align="center" />
  136. <el-table-column prop="quantity" label="数量" width="80" align="right" />
  137. <el-table-column label="供货单价(元)" min-width="110" align="right">
  138. <template #default="{ row: line }">¥{{ formatAmount(line.supplierUnitPrice) }}</template>
  139. </el-table-column>
  140. <el-table-column label="供货金额(元)" min-width="110" align="right">
  141. <template #default="{ row: line }">¥{{ formatAmount(line.supplierAmount) }}</template>
  142. </el-table-column>
  143. <el-table-column label="售价单价(元)" min-width="110" align="right">
  144. <template #default="{ row: line }">¥{{ formatAmount(line.sellingUnitPrice ?? line.unitPrice) }}</template>
  145. </el-table-column>
  146. <el-table-column label="售出金额(元)" min-width="110" align="right">
  147. <template #default="{ row: line }">¥{{ formatAmount(line.sellingAmount ?? line.amount) }}</template>
  148. </el-table-column>
  149. </el-table>
  150. <div class="order-row-expand-summary sqxp-subtable-summary">
  151. <span
  152. >供货总金额(元):<span class="sqxp-subtable-summary__amount"
  153. >¥{{ formatAmount(getExpandedSummary(row.id).supplierTotal) }}</span
  154. ></span
  155. >
  156. <span
  157. >售出总金额(元):<span class="sqxp-subtable-summary__amount"
  158. >¥{{ formatAmount(getExpandedSummary(row.id).sellingTotal) }}</span
  159. ></span
  160. >
  161. </div>
  162. </div>
  163. <el-empty v-else-if="!expandedRowLoadingMap[row.id]" description="暂无商品明细" :image-size="72" />
  164. </div>
  165. </template>
  166. </el-table-column>
  167. <el-table-column prop="orderNo" label="订单编号" min-width="180">
  168. <template #default="{ row }">
  169. <el-button link type="primary" @click="toggleRowExpand(row)">{{ row.orderNo }}</el-button>
  170. </template>
  171. </el-table-column>
  172. <el-table-column prop="clientName" label="客户名称" min-width="150" />
  173. <el-table-column prop="regionName" label="区域" min-width="100" />
  174. <el-table-column prop="supplierTotalAmount" label="供货总金额(元)" min-width="140">
  175. <template #default="{ row }">
  176. <span class="amount-text">¥{{ formatAmount(row.supplierTotalAmount) }}</span>
  177. </template>
  178. </el-table-column>
  179. <el-table-column prop="totalAmount" label="订单金额(元)" min-width="120">
  180. <template #default="{ row }">
  181. <span class="amount-text">¥{{ row.totalAmount }}</span>
  182. </template>
  183. </el-table-column>
  184. <el-table-column prop="orderStatus" label="订单状态" min-width="120">
  185. <template #default="{ row }">
  186. <el-space :size="6">
  187. <el-tag :type="getOrderStatusType(resolveOrderStatus(row))" size="small">{{
  188. getOrderStatusText(resolveOrderStatus(row))
  189. }}</el-tag>
  190. <el-tag v-if="row.cancelStatus === 'pending_review'" type="warning" size="small"
  191. >取消审核中</el-tag
  192. >
  193. </el-space>
  194. </template>
  195. </el-table-column>
  196. <el-table-column prop="deliveryStatus" label="配送状态" min-width="120">
  197. <template #default="{ row }">
  198. <el-tag :type="getDeliveryStatusType(resolveDeliveryStatus(row))" size="small">{{
  199. getDeliveryStatusText(resolveDeliveryStatus(row))
  200. }}</el-tag>
  201. </template>
  202. </el-table-column>
  203. <el-table-column prop="payStatus" label="支付状态" min-width="120">
  204. <template #default="{ row }">
  205. <el-tag :type="getPayStatusType(resolvePayStatus(row))" size="small">{{
  206. getPayStatusText(resolvePayStatus(row))
  207. }}</el-tag>
  208. </template>
  209. </el-table-column>
  210. <el-table-column prop="paymentMethod" label="支付方式" min-width="110" align="center">
  211. <template #default="{ row }">
  212. <el-tag :type="row.paymentMethod === 'offline' ? 'warning' : 'primary'" size="small">
  213. {{ getPaymentMethod(row.paymentMethod) }}
  214. </el-tag>
  215. </template>
  216. </el-table-column>
  217. <el-table-column prop="createAt" label="下单时间" min-width="180" />
  218. <el-table-column label="操作" min-width="260" fixed="right" align="center" header-align="center">
  219. <template #default="{ row }">
  220. <el-button class="btn-op-item primary" @click="handleView(row)">查看/运营</el-button>
  221. <el-button class="btn-op-item" v-if="canAssign(row)" @click="handleAssign(row)">分配配送员</el-button>
  222. <el-button class="btn-op-item op-warn" v-if="row.cancelStatus === 'pending_review'" @click="handleReviewCancel(row)"
  223. >审核取消</el-button>
  224. </template>
  225. </el-table-column>
  226. </el-table>
  227. <!-- 分页 -->
  228. <div class="pagination list-pager-bar">
  229. <el-pagination
  230. :current-page="pagination.page"
  231. :page-size="pagination.pageSize"
  232. :total="pagination.total"
  233. :page-sizes="[10, 20, 50, 100]"
  234. layout="total, sizes, prev, pager, next, jumper"
  235. @update:current-page="
  236. (v) => {
  237. pagination.page = v
  238. loadData()
  239. }
  240. "
  241. @update:page-size="
  242. (v) => {
  243. pagination.pageSize = v
  244. pagination.page = 1
  245. loadData()
  246. }
  247. "
  248. />
  249. </div>
  250. </div>
  251. </section>
  252. <!-- 订单详情弹窗(固定内容区高度,内部纵向滚动) -->
  253. <el-dialog
  254. v-model="viewVisible"
  255. title="订单详情"
  256. width="1400px"
  257. top="50px"
  258. destroy-on-close
  259. class="order-module-dialog order-detail-dialog"
  260. modal-class="order-module-dialog-mask"
  261. >
  262. <div v-loading="detailLoading" class="dialog-scroll order-detail-dialog-scroll">
  263. <div class="view-hero order-view-hero">
  264. <div class="order-view-hero-icon">
  265. <el-icon><ShoppingBag /></el-icon>
  266. </div>
  267. <div class="view-hero-main">
  268. <h2>{{ displayValue(viewData.orderNo) }}</h2>
  269. <div class="view-hero-tags">
  270. <el-tag :type="getOrderStatusType(resolveOrderStatus(viewData))" size="small">
  271. {{ getOrderStatusText(resolveOrderStatus(viewData)) }}
  272. </el-tag>
  273. <el-tag :type="getDeliveryStatusType(resolveDeliveryStatus(viewData))" size="small">
  274. {{ getDeliveryStatusText(resolveDeliveryStatus(viewData)) }}
  275. </el-tag>
  276. <el-tag :type="getPayStatusType(resolvePayStatus(viewData))" size="small">
  277. {{ getPayStatusText(resolvePayStatus(viewData)) }}
  278. </el-tag>
  279. <el-tag v-if="viewData.cancelStatus === 'pending_review'" type="warning" size="small">取消审核中</el-tag>
  280. </div>
  281. <p class="view-hero-meta">
  282. 客户:{{ displayValue(viewData.clientName) }}
  283. <span class="dot">·</span>
  284. 区域:{{ displayValue(viewData.regionName) }}
  285. <span class="dot">·</span>
  286. 下单时间:{{ displayValue(viewData.createAt) }}
  287. </p>
  288. </div>
  289. </div>
  290. <!-- Tab切换 -->
  291. <div class="detail-tabs">
  292. <div
  293. v-for="tab in detailTabs"
  294. :key="tab.key"
  295. class="detail-tab"
  296. :class="{ active: activeTab === tab.key }"
  297. @click="activeTab = tab.key"
  298. >
  299. {{ tab.label }}
  300. </div>
  301. </div>
  302. <!-- 订单锁定提示 -->
  303. <div v-if="viewData.lockInfo && viewData.lockInfo.isLocked" class="lock-tip">
  304. <el-icon><WarningFilled /></el-icon>
  305. <span>
  306. 此订单已被 <strong>{{ viewData.lockInfo.lockBy }}</strong> 锁定编辑中,锁定时间:{{
  307. viewData.lockInfo.lockTime
  308. }}<br />
  309. 请等待其完成操作或联系解除锁定后再进行操作。
  310. </span>
  311. <el-button type="danger" size="small">强制解锁</el-button>
  312. </div>
  313. <!-- Tab: 订单信息 -->
  314. <div v-show="activeTab === 'order'" class="order-tab-pane">
  315. <div class="view-section">
  316. <h3>基础信息</h3>
  317. <dl class="view-kv-grid">
  318. <div class="view-kv">
  319. <dt>订单编号</dt>
  320. <dd>{{ displayValue(viewData.orderNo) }}</dd>
  321. </div>
  322. <div class="view-kv">
  323. <dt>价格版本</dt>
  324. <dd>
  325. <el-button
  326. v-if="viewData.priceListId"
  327. class="price-version-link"
  328. @click="openOrderPriceVersionView"
  329. >
  330. V{{ viewData.priceVersion ?? '-' }}
  331. </el-button>
  332. <span v-else>V{{ viewData.priceVersion ?? '-' }}</span>
  333. </dd>
  334. </div>
  335. <div class="view-kv">
  336. <dt>客户名称</dt>
  337. <dd>{{ displayValue(viewData.clientName) }}</dd>
  338. </div>
  339. <div class="view-kv">
  340. <dt>所属区域</dt>
  341. <dd>{{ displayValue(viewData.regionName) }}</dd>
  342. </div>
  343. <div class="view-kv">
  344. <dt>支付方式</dt>
  345. <dd>{{ getPaymentMethod(viewData.paymentMethod) }}</dd>
  346. </div>
  347. <div class="view-kv">
  348. <dt>支付时间</dt>
  349. <dd>{{ displayValue(viewData.payTime) }}</dd>
  350. </div>
  351. <div class="view-kv view-multiline">
  352. <dt>备注</dt>
  353. <dd>{{ displayValue(viewData.remark) }}</dd>
  354. </div>
  355. </dl>
  356. </div>
  357. <h4 class="section-title">订单明细</h4>
  358. <div class="order-detail-items-scroll">
  359. <el-table
  360. :data="viewData.items"
  361. stripe
  362. :fit="false"
  363. table-layout="auto"
  364. class="order-detail-items-table"
  365. header-align="center"
  366. @row-dblclick="openOrderProductView"
  367. >
  368. <el-table-column
  369. prop="productName"
  370. label="商品名称"
  371. min-width="220"
  372. align="left"
  373. header-align="left"
  374. class-name="order-detail-product-col"
  375. >
  376. <template #default="{ row }">
  377. <div class="order-item-name-cell">
  378. <div class="order-item-thumb-wrap">
  379. <el-image
  380. v-if="row.imageUrl"
  381. :src="row.imageUrl"
  382. fit="cover"
  383. class="order-item-thumb"
  384. />
  385. <span v-else class="order-item-thumb placeholder">无图</span>
  386. </div>
  387. <el-tooltip
  388. :content="orderProductNameTooltip(row.productName)"
  389. placement="top"
  390. :disabled="!isOrderProductNameTruncated(row.productName)"
  391. >
  392. <span class="order-item-name-text">{{
  393. formatOrderProductNameDisplay(row.productName)
  394. }}</span>
  395. </el-tooltip>
  396. </div>
  397. </template>
  398. </el-table-column>
  399. <el-table-column
  400. prop="categoryName"
  401. label="分类"
  402. min-width="140"
  403. align="center"
  404. show-overflow-tooltip
  405. >
  406. <template #default="{ row }">
  407. {{ formatOrderCategory(row) }}
  408. </template>
  409. </el-table-column>
  410. <el-table-column label="商品计量" width="100" align="center">
  411. <template #default="{ row }">{{ formatMeasureCell(row.measureValue) }}</template>
  412. </el-table-column>
  413. <el-table-column prop="unitName" label="单位" min-width="80" align="center" />
  414. <el-table-column prop="supplierName" label="供应商" min-width="130" align="center" />
  415. <el-table-column prop="supplierUnitPrice" label="供货单价(元)" min-width="110" align="center">
  416. <template #default="{ row }">¥{{ formatAmount(row.supplierUnitPrice) }}</template>
  417. </el-table-column>
  418. <el-table-column prop="sellingUnitPrice" label="售价单价(元)" min-width="110" align="center">
  419. <template #default="{ row }">¥{{ formatAmount(row.sellingUnitPrice ?? row.unitPrice) }}</template>
  420. </el-table-column>
  421. <el-table-column prop="quantity" label="数量" min-width="88" align="center" />
  422. <el-table-column prop="supplierAmount" label="供货金额(元)" min-width="110" align="center">
  423. <template #default="{ row }">¥{{ formatAmount(row.supplierAmount) }}</template>
  424. </el-table-column>
  425. <el-table-column prop="sellingAmount" label="售出金额(元)" min-width="110" align="center">
  426. <template #default="{ row }">¥{{ formatAmount(row.sellingAmount ?? row.amount) }}</template>
  427. </el-table-column>
  428. <el-table-column
  429. prop="deliveredQuantity"
  430. class-name="order-delivered-cell"
  431. min-width="200"
  432. align="center"
  433. >
  434. <template #header>
  435. <span>已配送</span>
  436. <el-tooltip
  437. placement="top"
  438. content="本列表示该行商品「已向客户登记送达」的数量(与配送员送达填报一致)。尚未登记时,括号内为 0;若配送员尚未取货,会显示「待取货」等阶段说明,与整单配送状态不同。"
  439. >
  440. <el-icon class="order-delivered-th-icon"><QuestionFilled /></el-icon>
  441. </el-tooltip>
  442. </template>
  443. <template #default="{ row }">
  444. <span class="order-delivered-text">{{ formatDeliveredDisplay(row) }}</span>
  445. </template>
  446. </el-table-column>
  447. <el-table-column prop="status" label="状态" min-width="100" align="center">
  448. <template #default="{ row }">
  449. <el-tag :type="getItemStatusType(row.status)" size="small">{{
  450. getItemStatusText(row.status)
  451. }}</el-tag>
  452. </template>
  453. </el-table-column>
  454. </el-table>
  455. </div>
  456. <div class="amount-summary">
  457. <div class="amount-item">
  458. <span class="label">供货总金额(元):</span>
  459. <span class="value">¥{{ formatAmount(viewData.supplierTotalAmount) }}</span>
  460. </div>
  461. <div class="amount-item">
  462. <span class="label">订单总金额(元):</span>
  463. <span class="value">¥{{ formatAmount(viewData.totalAmount) }}</span>
  464. </div>
  465. <div class="amount-item">
  466. <span class="label">已付金额(元):</span>
  467. <span class="value success">¥{{ formatAmount(viewData.paidAmount) }}</span>
  468. </div>
  469. </div>
  470. </div>
  471. <!-- Tab: 配送信息 -->
  472. <div v-show="activeTab === 'delivery'" class="order-delivery-tab">
  473. <div class="view-section order-delivery-top">
  474. <h3>配送概要</h3>
  475. <dl class="view-kv-grid">
  476. <div class="view-kv">
  477. <dt>配送单号</dt>
  478. <dd>{{ displayValue(viewData.deliveryTaskNo) }}</dd>
  479. </div>
  480. <div class="view-kv">
  481. <dt>订单配送状态</dt>
  482. <dd>
  483. <el-tag :type="getDeliveryStatusType(viewData.deliveryStatus)" size="small">
  484. {{ getDeliveryStatusText(viewData.deliveryStatus) }}
  485. </el-tag>
  486. </dd>
  487. </div>
  488. <div class="view-kv">
  489. <dt>配送员状态</dt>
  490. <dd>
  491. <el-tag
  492. v-if="viewData.deliveryTaskDelivererStatus"
  493. :type="getDelivererTaskStatusType(viewData.deliveryTaskDelivererStatus)"
  494. size="small"
  495. >
  496. {{ getDelivererTaskStatusText(viewData.deliveryTaskDelivererStatus) }}
  497. </el-tag>
  498. <span v-else>-</span>
  499. </dd>
  500. </div>
  501. <div class="view-kv">
  502. <dt>供应商备货状态</dt>
  503. <dd>
  504. <el-tag
  505. v-if="viewData.deliveryTaskSupplierPrepareStatus"
  506. :type="getSupplierPrepareStatusType(viewData.deliveryTaskSupplierPrepareStatus)"
  507. size="small"
  508. >
  509. {{ getSupplierPrepareStatusText(viewData.deliveryTaskSupplierPrepareStatus) }}
  510. </el-tag>
  511. <span v-else>-</span>
  512. </dd>
  513. </div>
  514. <div class="view-kv">
  515. <dt>配送员</dt>
  516. <dd>{{ displayValue(viewData.deliverName) }}</dd>
  517. </div>
  518. <div class="view-kv">
  519. <dt>配送员电话</dt>
  520. <dd>{{ displayValue(viewData.deliverPhone) }}</dd>
  521. </div>
  522. <div class="view-kv">
  523. <dt>配送时效</dt>
  524. <dd>{{ displayValue(formatOrderDetailTime(viewData.expectedTime)) }}</dd>
  525. </div>
  526. <div class="view-kv view-multiline">
  527. <dt>配送备注(运营分配)</dt>
  528. <dd>{{ displayValue(viewData.deliveryDispatchRemark) }}</dd>
  529. </div>
  530. </dl>
  531. </div>
  532. <div class="order-delivery-address-blocks">
  533. <el-card shadow="never" class="od-address-card od-address-card--supplier">
  534. <template #header>
  535. <span class="od-address-card-title">供应商与取货地址</span>
  536. </template>
  537. <div class="od-address-card-body">
  538. <div class="od-address-line">
  539. <span class="od-label">供应商</span>
  540. <span class="od-value">{{ displayValue(viewData.supplierName) }}</span>
  541. </div>
  542. <div v-if="viewData.supplierPhone" class="od-address-line">
  543. <span class="od-label">联系电话</span>
  544. <span class="od-value">{{ viewData.supplierPhone }}</span>
  545. </div>
  546. <div class="od-address-line">
  547. <span class="od-label">取货地址</span>
  548. <span class="od-value">{{ supplierPickupDisplay.address || '-' }}</span>
  549. </div>
  550. <div
  551. v-if="supplierPickupDisplay.contactPerson || supplierPickupDisplay.contactPhone"
  552. class="od-address-line"
  553. >
  554. <span class="od-label">地址联系人</span>
  555. <span class="od-value">
  556. {{ supplierPickupDisplay.contactPerson || '-' }}
  557. <template v-if="supplierPickupDisplay.contactPhone">
  558. / {{ supplierPickupDisplay.contactPhone }}</template
  559. >
  560. </span>
  561. </div>
  562. <div class="od-address-line">
  563. <span class="od-label">取货时间</span>
  564. <span class="od-value">{{
  565. formatOrderDetailTime(viewData.deliveryPickupTime) || '-'
  566. }}</span>
  567. </div>
  568. <div class="od-address-line">
  569. <span class="od-label">取货备注</span>
  570. <span class="od-value od-text-wrap">{{
  571. displayValue(viewData.deliveryPickupRemark)
  572. }}</span>
  573. </div>
  574. <div class="od-address-line od-address-line--block">
  575. <span class="od-label">备货凭证</span>
  576. <div class="od-value">
  577. <div v-if="(viewData.deliveryPrepareImages || []).length" class="evidence-grid">
  578. <el-image
  579. v-for="(img, idx) in viewData.deliveryPrepareImages"
  580. :key="`prepare-${idx}`"
  581. :src="img"
  582. :preview-src-list="viewData.deliveryPrepareImages"
  583. :initial-index="idx"
  584. fit="cover"
  585. class="evidence-image"
  586. />
  587. </div>
  588. <span v-else>-</span>
  589. </div>
  590. </div>
  591. </div>
  592. </el-card>
  593. <el-card shadow="never" class="od-address-card od-address-card--customer">
  594. <template #header>
  595. <span class="od-address-card-title">客户送货信息</span>
  596. </template>
  597. <div class="od-address-card-body">
  598. <div class="od-address-line">
  599. <span class="od-label">送货地址</span>
  600. <span class="od-value">{{ displayValue(viewData.deliveryAddress) }}</span>
  601. </div>
  602. <div class="od-address-line">
  603. <span class="od-label">联系人</span>
  604. <span class="od-value">{{ displayValue(viewData.contactPerson) }}</span>
  605. </div>
  606. <div class="od-address-line">
  607. <span class="od-label">联系电话</span>
  608. <span class="od-value">{{ displayValue(viewData.contactPhone) }}</span>
  609. </div>
  610. <div class="od-address-line">
  611. <span class="od-label">送达时间</span>
  612. <span class="od-value">{{
  613. formatOrderDetailTime(viewData.deliveryDeliveryTime) || '-'
  614. }}</span>
  615. </div>
  616. <div class="od-address-line">
  617. <span class="od-label">送达备注</span>
  618. <span class="od-value od-text-wrap">{{
  619. displayValue(viewData.deliveryDeliveryRemark)
  620. }}</span>
  621. </div>
  622. <div class="od-address-line od-address-line--block">
  623. <span class="od-label">取货凭证</span>
  624. <div class="od-value">
  625. <div v-if="(viewData.deliveryPickupImages || []).length" class="evidence-grid">
  626. <el-image
  627. v-for="(img, idx) in viewData.deliveryPickupImages"
  628. :key="`pickup-${idx}`"
  629. :src="img"
  630. :preview-src-list="viewData.deliveryPickupImages"
  631. :initial-index="idx"
  632. fit="cover"
  633. class="evidence-image"
  634. />
  635. </div>
  636. <span v-else>-</span>
  637. </div>
  638. </div>
  639. <div class="od-address-line od-address-line--block">
  640. <span class="od-label">送达凭证</span>
  641. <div class="od-value">
  642. <div v-if="(viewData.deliveryDeliverImages || []).length" class="evidence-grid">
  643. <el-image
  644. v-for="(img, idx) in viewData.deliveryDeliverImages"
  645. :key="`deliver-${idx}`"
  646. :src="img"
  647. :preview-src-list="viewData.deliveryDeliverImages"
  648. :initial-index="idx"
  649. fit="cover"
  650. class="evidence-image"
  651. />
  652. </div>
  653. <span v-else>-</span>
  654. </div>
  655. </div>
  656. </div>
  657. </el-card>
  658. </div>
  659. <h4 class="section-title">配送进度</h4>
  660. <el-empty
  661. v-if="!viewData.deliveryTimeline || viewData.deliveryTimeline.length === 0"
  662. description="暂无配送进度记录"
  663. />
  664. <div v-else class="timeline-horizontal">
  665. <div class="timeline-horizontal-list">
  666. <div
  667. v-for="(item, index) in viewData.deliveryTimeline"
  668. :key="index"
  669. class="timeline-horizontal-item"
  670. >
  671. <div class="timeline-index">{{ index + 1 }}</div>
  672. <div class="timeline-content">
  673. <div class="timeline-time">{{ formatOrderDetailTime(item.time) || '-' }}</div>
  674. <div class="timeline-title">{{ item.title }}</div>
  675. <div v-if="item.description" class="timeline-desc">{{ item.description }}</div>
  676. </div>
  677. <div
  678. v-if="index < viewData.deliveryTimeline.length - 1"
  679. class="timeline-horizontal-arrow"
  680. >→</div
  681. >
  682. </div>
  683. </div>
  684. </div>
  685. </div>
  686. <!-- Tab: 操作记录 -->
  687. <div v-show="activeTab === 'logs'">
  688. <h4 class="section-title">状态变更记录</h4>
  689. <el-empty
  690. v-if="!viewData.operationLogs || viewData.operationLogs.length === 0"
  691. description="暂无状态变更记录"
  692. />
  693. <div v-else class="timeline-horizontal">
  694. <div class="timeline-horizontal-list">
  695. <div
  696. v-for="(item, index) in viewData.operationLogs"
  697. :key="index"
  698. class="timeline-horizontal-item"
  699. >
  700. <div class="timeline-index">{{ index + 1 }}</div>
  701. <div class="timeline-content">
  702. <div class="timeline-time">{{ item.time || '-' }}</div>
  703. <div class="timeline-title">{{ item.title }}</div>
  704. <div class="timeline-desc">{{ item.operator }}</div>
  705. <div v-if="item.description" class="timeline-desc" :style="{ color: item.color }">{{
  706. item.description
  707. }}</div>
  708. </div>
  709. <div
  710. v-if="index < viewData.operationLogs.length - 1"
  711. class="timeline-horizontal-arrow"
  712. >→</div
  713. >
  714. </div>
  715. </div>
  716. </div>
  717. </div>
  718. </div>
  719. <template #footer>
  720. <el-button class="btn-ghost" @click="viewVisible = false"><el-icon><Close /></el-icon>关闭</el-button>
  721. <template v-if="showOrderDetailActions">
  722. <el-button v-if="showCancelOrderAction" type="danger" @click="showCancelDialog">
  723. <el-icon><Close /></el-icon>取消订单
  724. </el-button>
  725. <el-button
  726. v-if="showDelivererAssignAction"
  727. class="btn-main"
  728. type="primary"
  729. @click="showAssignDialogFromDetail"
  730. >
  731. <el-icon><Check /></el-icon>{{ delivererActionLabel }}
  732. </el-button>
  733. </template>
  734. </template>
  735. </el-dialog>
  736. <!-- 分配 / 更换配送员 -->
  737. <el-dialog
  738. v-model="assignVisible"
  739. :title="assignReassignMode ? '更换配送员' : '分配配送员'"
  740. width="560px"
  741. destroy-on-close
  742. class="order-module-dialog"
  743. modal-class="order-module-dialog-mask"
  744. :close-on-click-modal="false"
  745. >
  746. <el-alert v-if="assignReassignMode" type="info" :closable="false" class="mb-4">
  747. 当前订单已分配配送员,提交后将更新为新的配送员(与运营端分配接口一致)。
  748. </el-alert>
  749. <el-form :model="assignForm" label-position="top">
  750. <div class="form-grid-2">
  751. <el-form-item label="选择配送员" class="form-col-span-2">
  752. <el-select
  753. v-model="assignForm.deliverId"
  754. :placeholder="assignForm.regionId ? '请选择本区域配送员' : '订单无区域信息'"
  755. filterable
  756. :disabled="!assignForm.regionId"
  757. >
  758. <el-option
  759. v-for="d in deliverList"
  760. :key="d.id"
  761. :label="d.realName || d.username"
  762. :value="d.id"
  763. />
  764. </el-select>
  765. </el-form-item>
  766. <el-form-item label="配送时效" required class="form-col-span-2">
  767. <el-date-picker
  768. v-model="assignForm.deliveryDeadlineAt"
  769. type="datetime"
  770. placeholder="截止时间(年月日时分)"
  771. format="YYYY-MM-DD HH:mm"
  772. value-format="YYYY-MM-DDTHH:mm:00"
  773. style="width: 100%"
  774. />
  775. <div class="hint-text">
  776. 默认已按「当前时间 +
  777. 区域预计配送(分钟)」计算;区域未配置时使用系统设置中的默认分钟数。须在此时间前完成配送;区域「预警提前」内未完成将出现在时效预警列表。
  778. </div>
  779. </el-form-item>
  780. <el-form-item label="配送备注" class="form-col-span-2">
  781. <el-input
  782. v-model="assignForm.dispatchRemark"
  783. type="textarea"
  784. :rows="2"
  785. maxlength="500"
  786. show-word-limit
  787. placeholder="给配送员或运营的说明(可选)"
  788. />
  789. </el-form-item>
  790. </div>
  791. </el-form>
  792. <template #footer>
  793. <el-button class="btn-ghost" @click="assignVisible = false"><el-icon><Close /></el-icon>取消</el-button>
  794. <el-button class="btn-main" type="primary" @click="confirmAssign" :loading="submitLoading">
  795. <el-icon><Check /></el-icon>确定
  796. </el-button>
  797. </template>
  798. </el-dialog>
  799. <!-- 审核取消弹窗 -->
  800. <el-dialog v-model="cancelVisible" title="审核取消" width="500px">
  801. <el-form :model="cancelForm" label-width="100px">
  802. <el-form-item label="审核结果">
  803. <el-radio-group v-model="cancelForm.approved">
  804. <el-radio :label="true">通过</el-radio>
  805. <el-radio :label="false">拒绝</el-radio>
  806. </el-radio-group>
  807. </el-form-item>
  808. <el-form-item label="审核备注">
  809. <el-input
  810. v-model="cancelForm.note"
  811. type="textarea"
  812. placeholder="请输入审核备注"
  813. :rows="3"
  814. />
  815. </el-form-item>
  816. </el-form>
  817. <template #footer>
  818. <el-button @click="cancelVisible = false">取消</el-button>
  819. <el-button type="primary" @click="confirmCancel" :loading="submitLoading">确定</el-button>
  820. </template>
  821. </el-dialog>
  822. <!-- 取消订单弹窗 -->
  823. <el-dialog v-model="cancelDialogVisible" title="取消订单" width="500px">
  824. <el-alert type="warning" :closable="false" class="mb-4">
  825. 取消订单后,订单将被标记为已取消状态,已支付的款项将原路退回。
  826. </el-alert>
  827. <el-form :model="cancelDialogForm" :rules="cancelDialogRules" label-width="100px">
  828. <el-form-item label="订单编号">
  829. <span class="info-text">{{ cancelDialogForm.orderId }}</span>
  830. </el-form-item>
  831. <el-form-item label="取消原因" prop="reason">
  832. <el-input
  833. v-model="cancelDialogForm.reason"
  834. type="textarea"
  835. placeholder="请输入取消原因"
  836. :rows="3"
  837. />
  838. </el-form-item>
  839. <el-form-item label="取消备注" prop="note">
  840. <el-input
  841. v-model="cancelDialogForm.note"
  842. type="textarea"
  843. placeholder="请输入备注(可选)"
  844. :rows="2"
  845. />
  846. </el-form-item>
  847. <el-form-item label="佐证图片">
  848. <el-upload
  849. action="#"
  850. list-type="picture-card"
  851. :auto-upload="false"
  852. :on-change="handleCancelEvidenceChange"
  853. :on-remove="handleCancelEvidenceRemove"
  854. :limit="6"
  855. >
  856. <el-icon><Plus /></el-icon>
  857. </el-upload>
  858. </el-form-item>
  859. </el-form>
  860. <template #footer>
  861. <el-button @click="cancelDialogVisible = false">取消</el-button>
  862. <el-button type="danger" @click="confirmCancelOrder" :loading="cancelDialogLoading"
  863. >确认取消</el-button
  864. >
  865. </template>
  866. </el-dialog>
  867. <!-- 调整订单弹窗 -->
  868. <el-dialog
  869. v-model="adjustDialogVisible"
  870. title="订单调整"
  871. width="1100px"
  872. @opened="loadOrderItemsForAdjust"
  873. >
  874. <el-alert type="info" :closable="false" class="mb-4">
  875. 双击商品行可查看商品详情;新数量默认等于原数量,支持增量、减量和删除(新数量为0)。
  876. </el-alert>
  877. <el-table
  878. :data="adjustOrderItems"
  879. stripe
  880. class="adjust-order-items-table"
  881. max-height="360"
  882. v-loading="adjustItemsLoading"
  883. @row-dblclick="openOrderProductView"
  884. >
  885. <el-table-column
  886. prop="productName"
  887. label="商品名称"
  888. min-width="240"
  889. align="left"
  890. header-align="left"
  891. class-name="adjust-product-col"
  892. >
  893. <template #default="{ row }">
  894. <div class="order-item-name-cell">
  895. <div class="order-item-thumb-wrap">
  896. <el-image v-if="row.imageUrl" :src="row.imageUrl" fit="cover" class="order-item-thumb" />
  897. <span v-else class="order-item-thumb placeholder">无图</span>
  898. </div>
  899. <span class="order-item-name-text">{{ formatOrderProductNameDisplay(row.productName) }}</span>
  900. </div>
  901. </template>
  902. </el-table-column>
  903. <el-table-column label="计量单位" min-width="110" align="center">
  904. <template #default="{ row }">
  905. {{ formatMeasureWithUnit(row) }}
  906. </template>
  907. </el-table-column>
  908. <el-table-column prop="quantity" label="原数量" min-width="100" align="center" />
  909. <el-table-column label="新数量" min-width="140" align="center">
  910. <template #default="{ row }">
  911. <el-input-number
  912. v-model="row.newQuantity"
  913. :min="0"
  914. :controls-position="'right'"
  915. @change="(val) => handleAdjustQuantityCommit(row, val)"
  916. @dblclick.stop
  917. />
  918. </template>
  919. </el-table-column>
  920. <el-table-column prop="supplierName" label="供应商" min-width="130" align="center" />
  921. <el-table-column prop="supplierUnitPrice" label="供货单价(元)" min-width="110" align="center">
  922. <template #default="{ row }">¥{{ formatAmount(row.supplierUnitPrice) }}</template>
  923. </el-table-column>
  924. <el-table-column prop="unitPrice" label="售价单价(元)" min-width="110" align="center">
  925. <template #default="{ row }">¥{{ formatAmount(row.unitPrice) }}</template>
  926. </el-table-column>
  927. <el-table-column label="供货金额(元)" min-width="120" align="center">
  928. <template #default="{ row }">
  929. ¥{{
  930. formatAmount(
  931. Number(row.newQuantity ?? row.quantity ?? 0) * Number(row.supplierUnitPrice || 0)
  932. )
  933. }}
  934. </template>
  935. </el-table-column>
  936. <el-table-column label="售出金额(元)" min-width="120" align="center">
  937. <template #default="{ row }">
  938. ¥{{ formatAmount(Number(row.newQuantity ?? row.quantity ?? 0) * Number(row.unitPrice || 0)) }}
  939. </template>
  940. </el-table-column>
  941. </el-table>
  942. <el-form :model="adjustAddressForm" label-width="100px" class="mt-4">
  943. <el-form-item label="收货地址">
  944. <el-input v-model="adjustAddressForm.deliveryAddress" placeholder="请输入送货地址" maxlength="500" />
  945. </el-form-item>
  946. <el-form-item label="联系人">
  947. <el-input v-model="adjustAddressForm.contactPerson" placeholder="请输入联系人" maxlength="100" />
  948. </el-form-item>
  949. <el-form-item label="联系电话">
  950. <el-input v-model="adjustAddressForm.contactPhone" placeholder="请输入联系电话" maxlength="20" />
  951. </el-form-item>
  952. <el-form-item label="调整原因">
  953. <el-input v-model="adjustForm.reason" type="textarea" placeholder="商品调整原因(有商品调整时必填)" :rows="2" />
  954. </el-form-item>
  955. <el-form-item label="地址备注">
  956. <el-input
  957. v-model="adjustAddressForm.reason"
  958. type="textarea"
  959. :rows="2"
  960. placeholder="地址调整说明(仅调整地址时可选)"
  961. />
  962. </el-form-item>
  963. </el-form>
  964. <template #footer>
  965. <el-button @click="adjustDialogVisible = false">取消</el-button>
  966. <el-button type="primary" @click="confirmAdjustOrder" :loading="adjustDialogLoading">确认提交</el-button>
  967. </template>
  968. </el-dialog>
  969. <ProductViewDialog v-model="productViewDialogVisible" :product-id="productViewTargetId" />
  970. <!-- 订单所用价格版本明细(只读,对齐询价「选中供应商报价」信息结构) -->
  971. <el-dialog
  972. v-model="orderPriceVersionVisible"
  973. title="价格版本明细"
  974. width="1100px"
  975. destroy-on-close
  976. class="order-module-dialog order-price-version-dialog"
  977. modal-class="order-module-dialog-mask"
  978. @opened="loadOrderPriceVersionDetail"
  979. >
  980. <div v-loading="orderPriceVersionLoading" class="order-pv-body">
  981. <template v-if="orderPriceVersionDetail">
  982. <div class="view-hero order-pv-hero">
  983. <div class="order-view-hero-icon">
  984. <el-icon><Setting /></el-icon>
  985. </div>
  986. <div class="view-hero-main">
  987. <h2>价格版本 V{{ orderPriceVersionDetail.version ?? orderPriceVersionDetail.versionNo ?? '-' }}</h2>
  988. <div class="view-hero-tags">
  989. <el-tag type="success" size="small">{{ orderPriceVersionDetail.supplierName || '-' }}</el-tag>
  990. <el-tag type="primary" size="small">{{ orderPriceVersionDetail.regionName || '-' }}</el-tag>
  991. </div>
  992. <p class="view-hero-meta">用于订单下单时的价格快照,仅供查看,不可编辑。</p>
  993. </div>
  994. </div>
  995. <div class="view-section order-pv-info-section">
  996. <h3>基础信息</h3>
  997. <dl class="view-kv-grid">
  998. <div class="view-kv">
  999. <dt>区域</dt>
  1000. <dd>{{ orderPriceVersionDetail.regionName || '-' }}</dd>
  1001. </div>
  1002. <div class="view-kv">
  1003. <dt>供应商</dt>
  1004. <dd>{{ orderPriceVersionDetail.supplierName || '-' }}</dd>
  1005. </div>
  1006. <div class="view-kv">
  1007. <dt>版本号</dt>
  1008. <dd>V{{ orderPriceVersionDetail.version ?? orderPriceVersionDetail.versionNo ?? '-' }}</dd>
  1009. </div>
  1010. <div class="view-kv view-multiline">
  1011. <dt>来源询价</dt>
  1012. <dd>{{ orderPriceVersionDetail.inquiryTitle || '-' }}</dd>
  1013. </div>
  1014. </dl>
  1015. </div>
  1016. </template>
  1017. <el-table
  1018. v-if="orderPriceVersionDetail?.items?.length"
  1019. :data="orderPriceVersionDetail.items"
  1020. stripe
  1021. max-height="480"
  1022. header-align="center"
  1023. @row-dblclick="openOrderProductView"
  1024. >
  1025. <el-table-column prop="productName" label="商品名称" min-width="200" align="center">
  1026. <template #default="{ row }">
  1027. <div class="order-pv-name-cell">
  1028. <div class="order-item-thumb-wrap">
  1029. <el-image
  1030. v-if="row.imageUrl"
  1031. :src="row.imageUrl"
  1032. fit="cover"
  1033. class="order-item-thumb"
  1034. />
  1035. <span v-else class="order-item-thumb placeholder">无图</span>
  1036. </div>
  1037. <el-tooltip
  1038. :content="orderProductNameTooltip(row.productName)"
  1039. placement="top"
  1040. :disabled="!isOrderProductNameTruncated(row.productName)"
  1041. >
  1042. <span class="order-pv-name-text">{{
  1043. formatOrderProductNameDisplay(row.productName)
  1044. }}</span>
  1045. </el-tooltip>
  1046. </div>
  1047. </template>
  1048. </el-table-column>
  1049. <el-table-column
  1050. prop="categoryName"
  1051. label="分类"
  1052. min-width="120"
  1053. align="center"
  1054. show-overflow-tooltip
  1055. />
  1056. <el-table-column label="计量" width="88" align="center">
  1057. <template #default="{ row }">{{ formatMeasureCell(row.measureValue) }}</template>
  1058. </el-table-column>
  1059. <el-table-column prop="unitName" label="单位" min-width="72" align="center" />
  1060. <el-table-column label="供应商报价(元)" min-width="130" align="center">
  1061. <template #default="{ row }">
  1062. <span v-if="!orderPriceVersionDetail?.quotationId">-</span>
  1063. <span v-else>¥{{ (Number(row.supplierPrice || 0) || 0).toFixed(2) }}</span>
  1064. </template>
  1065. </el-table-column>
  1066. <el-table-column label="调价系数(%)" min-width="110" align="center">
  1067. <template #default="{ row }"
  1068. >{{ (Number(row.pricingCoefficient) || 0).toFixed(2) }}%</template
  1069. >
  1070. </el-table-column>
  1071. <el-table-column label="最终售价(元)" min-width="120" align="center">
  1072. <template #default="{ row }"
  1073. >¥{{ (Number(row.finalPrice ?? row.price) || 0).toFixed(2) }}</template
  1074. >
  1075. </el-table-column>
  1076. </el-table>
  1077. <el-empty v-else-if="!orderPriceVersionLoading" description="暂无明细" />
  1078. </div>
  1079. <template #footer>
  1080. <el-button class="btn-ghost" @click="orderPriceVersionVisible = false"><el-icon><Close /></el-icon>关闭</el-button>
  1081. </template>
  1082. </el-dialog>
  1083. </div>
  1084. </template>
  1085. <script setup lang="ts">
  1086. import {
  1087. ref,
  1088. reactive,
  1089. computed,
  1090. onMounted,
  1091. onActivated,
  1092. onDeactivated,
  1093. onUnmounted,
  1094. watch
  1095. } from 'vue'
  1096. import { ElMessage, ElMessageBox } from 'element-plus'
  1097. import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
  1098. import {
  1099. ArrowDown,
  1100. ArrowUp,
  1101. Check,
  1102. Close,
  1103. Plus,
  1104. QuestionFilled,
  1105. RefreshLeft,
  1106. Search,
  1107. Setting,
  1108. ShoppingBag,
  1109. WarningFilled
  1110. } from '@element-plus/icons-vue'
  1111. import ProductViewDialog from '@/components/business/product-view-dialog/index.vue'
  1112. import {
  1113. fetchOrderList,
  1114. fetchOrderDetail,
  1115. fetchAssignDelivery,
  1116. fetchReviewCancel,
  1117. fetchCancelOrder,
  1118. fetchOrderItems,
  1119. fetchAdjustOrder,
  1120. fetchUploadAttachment,
  1121. fetchOrderAdjusts,
  1122. fetchPriceVersionDetail,
  1123. fetchSystemConfig
  1124. } from '@/api/business'
  1125. import { fetchActiveRegions, fetchUserList } from '@/api/admin'
  1126. import { fetchAllPagedRecords } from '@/utils/fetch-paged-list'
  1127. import { ensureCategoryPathDataLoaded, formatCategoryPathLabel } from '@/utils/category-path-display'
  1128. defineOptions({ name: 'OrderManagement' })
  1129. const searchForm = reactive({
  1130. keyword: '',
  1131. orderStatus: '',
  1132. deliveryStatus: '',
  1133. payStatus: '',
  1134. paymentMethod: '',
  1135. regionId: ''
  1136. })
  1137. const orderListTableRef = ref()
  1138. const expandedOrderItemsMap = ref<Record<string, any[]>>({})
  1139. const expandedRowLoadingMap = ref<Record<string, boolean>>({})
  1140. const tableData = ref<any[]>([])
  1141. const loading = ref(false)
  1142. const pagination = reactive({ page: 1, pageSize: 10, total: 0 })
  1143. const regionList = ref<any[]>([])
  1144. const filterExpanded = ref(false)
  1145. const viewVisible = ref(false)
  1146. const detailLoading = ref(false)
  1147. const activeTab = ref('order')
  1148. const detailTabs = [
  1149. { key: 'order', label: '订单信息' },
  1150. { key: 'delivery', label: '配送信息' },
  1151. { key: 'logs', label: '操作记录' }
  1152. ]
  1153. const viewData = ref<any>({ items: [], deliveryTimeline: [], operationLogs: [], adjustLogs: [] })
  1154. const productViewDialogVisible = ref(false)
  1155. const productViewTargetId = ref('')
  1156. const orderPriceVersionVisible = ref(false)
  1157. const orderPriceVersionLoading = ref(false)
  1158. const orderPriceVersionDetail = ref<any>(null)
  1159. const formatMeasureCell = (v: unknown) => {
  1160. if (v == null || v === '') return '-'
  1161. const n = Number(v)
  1162. if (Number.isNaN(n)) return '-'
  1163. return n.toFixed(3).replace(/\.?0+$/, '')
  1164. }
  1165. const formatMeasureWithUnit = (row: any) => {
  1166. const m = formatMeasureCell(row?.measureValue)
  1167. const u = row?.unitName != null && String(row.unitName).trim() !== '' ? String(row.unitName).trim() : '-'
  1168. if (m === '-' && u === '-') return '-'
  1169. if (m === '-') return u
  1170. if (u === '-') return m
  1171. return `${m} ${u}`
  1172. }
  1173. /** 订单明细 / 价格版本弹窗:商品名称过长时省略并 tooltip 展示全文 */
  1174. const ORDER_ITEM_PRODUCT_NAME_MAX_LEN = 12
  1175. const formatOrderProductNameDisplay = (name?: string | null) => {
  1176. const s = name != null && String(name).trim() !== '' ? String(name).trim() : '-'
  1177. if (s === '-') return s
  1178. return s.length > ORDER_ITEM_PRODUCT_NAME_MAX_LEN
  1179. ? `${s.slice(0, ORDER_ITEM_PRODUCT_NAME_MAX_LEN)}...`
  1180. : s
  1181. }
  1182. const isOrderProductNameTruncated = (name?: string | null) => {
  1183. const s = name != null && String(name).trim() !== '' ? String(name).trim() : ''
  1184. return s.length > ORDER_ITEM_PRODUCT_NAME_MAX_LEN
  1185. }
  1186. const orderProductNameTooltip = (name?: string | null) => {
  1187. const s = name != null && String(name).trim() !== '' ? String(name).trim() : '-'
  1188. return s
  1189. }
  1190. const formatOrderCategory = (row: any) => {
  1191. return formatCategoryPathLabel(row?.categoryId ?? row?.category_id, row?.categoryName)
  1192. }
  1193. /** 已配送数量展示:数量×计量 单位(计量取自商品计量列,与明细表一致) */
  1194. const formatDeliveredQtyMeasureUnit = (row: any, q: number) => {
  1195. const u =
  1196. row?.unitName != null && String(row.unitName).trim() !== '' ? String(row.unitName).trim() : ''
  1197. const m = formatMeasureCell(row?.measureValue)
  1198. const hasMeasure = m !== '' && m !== '-'
  1199. if (hasMeasure && u) return `${q}×${m} ${u}`
  1200. if (hasMeasure) return `${q}×${m}`
  1201. if (u) return `${q}${u}`
  1202. return String(q)
  1203. }
  1204. /** 订单明细「已配送」:按行已登记送达数量展示;与订单/任务配送阶段区分,避免配送中仍显示「未配送」的误解 */
  1205. const formatDeliveredDisplay = (row: any) => {
  1206. const dq = Number(row?.deliveredQuantity ?? 0)
  1207. const qty = Number(row?.quantity ?? 0)
  1208. if (dq > 0) {
  1209. if (qty > 0 && dq >= qty) return `已全部送达 ${formatDeliveredQtyMeasureUnit(row, dq)}`
  1210. return `已送 ${formatDeliveredQtyMeasureUnit(row, dq)} / ${formatDeliveredQtyMeasureUnit(row, qty)}`
  1211. }
  1212. const delivererSt = String(viewData.value?.deliveryTaskDelivererStatus || '').toLowerCase()
  1213. const legacyTaskSt = String(viewData.value?.deliveryTaskStatus || '').toLowerCase()
  1214. const orderDelivery = resolveDeliveryStatus(viewData.value)
  1215. if (delivererSt === 'pending_pickup' || legacyTaskSt === 'assigned') {
  1216. return `待取货 · 已登记送达 ${formatDeliveredQtyMeasureUnit(row, dq)}`
  1217. }
  1218. if (delivererSt === 'delivering' || legacyTaskSt === 'delivering') return '配送中(待发量)'
  1219. if (orderDelivery === 'delivering' || orderDelivery === 'partial_delivered')
  1220. return '配送中(待发量)'
  1221. if (delivererSt === 'delivered' || orderDelivery === 'delivered')
  1222. return qty > 0
  1223. ? `已送 ${formatDeliveredQtyMeasureUnit(row, 0)} / ${formatDeliveredQtyMeasureUnit(row, qty)}`
  1224. : '—'
  1225. return '待发运'
  1226. }
  1227. const openOrderProductView = (row: any) => {
  1228. const pid = row?.productId
  1229. if (!pid) {
  1230. ElMessage.warning('无法获取商品信息')
  1231. return
  1232. }
  1233. productViewTargetId.value = String(pid)
  1234. productViewDialogVisible.value = true
  1235. }
  1236. const openOrderPriceVersionView = () => {
  1237. if (!viewData.value.priceListId) {
  1238. ElMessage.warning('暂无关联价格清单')
  1239. return
  1240. }
  1241. orderPriceVersionDetail.value = null
  1242. orderPriceVersionVisible.value = true
  1243. }
  1244. const loadOrderPriceVersionDetail = async () => {
  1245. const id = viewData.value.priceListId
  1246. if (!id) return
  1247. orderPriceVersionLoading.value = true
  1248. try {
  1249. orderPriceVersionDetail.value = await fetchPriceVersionDetail(String(id))
  1250. } catch (e) {
  1251. console.error(e)
  1252. orderPriceVersionDetail.value = null
  1253. } finally {
  1254. orderPriceVersionLoading.value = false
  1255. }
  1256. }
  1257. const assignVisible = ref(false)
  1258. const assignReassignMode = ref(false)
  1259. const assignForm = reactive({
  1260. orderId: '',
  1261. regionId: '',
  1262. deliverId: '',
  1263. deliveryDeadlineAt: '' as string,
  1264. dispatchRemark: ''
  1265. })
  1266. /** 区域未配置预计配送时,与后端 system-config 默认一致(接口未返回前先用 600) */
  1267. const defaultRegionExpectedDeliveryMinutes = ref(600)
  1268. const resolveAssignOffsetMinutes = (regionMinutes: unknown): number => {
  1269. const fallback = defaultRegionExpectedDeliveryMinutes.value
  1270. if (regionMinutes == null || regionMinutes === '') return fallback
  1271. const n = Number(regionMinutes)
  1272. if (!Number.isFinite(n) || n <= 0) return fallback
  1273. return Math.floor(n)
  1274. }
  1275. /** 配送截止时间:当前时间 + 区域预计配送分钟(未配置则用系统默认) */
  1276. const computeAssignDeadline = (regionExpectedDeliveryMinutes?: unknown) => {
  1277. const minutes = resolveAssignOffsetMinutes(regionExpectedDeliveryMinutes)
  1278. const d = new Date()
  1279. d.setMinutes(d.getMinutes() + minutes, 0, 0)
  1280. const pad = (n: number) => String(n).padStart(2, '0')
  1281. return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}:00`
  1282. }
  1283. const deliverList = ref<any[]>([])
  1284. const cancelVisible = ref(false)
  1285. const cancelForm = reactive({ orderId: '', approved: true, note: '' })
  1286. const submitLoading = ref(false)
  1287. // 取消订单弹窗
  1288. const cancelDialogVisible = ref(false)
  1289. const cancelDialogForm = reactive({
  1290. orderId: '',
  1291. reason: '',
  1292. note: '',
  1293. evidenceImageUrls: [] as string[]
  1294. })
  1295. const cancelDialogLoading = ref(false)
  1296. const cancelDialogRules = {
  1297. reason: [{ required: true, message: '请输入取消原因', trigger: 'blur' }]
  1298. }
  1299. // 调整订单弹窗
  1300. const adjustDialogVisible = ref(false)
  1301. const adjustDialogLoading = ref(false)
  1302. const adjustItemsLoading = ref(false)
  1303. const adjustLoadSeq = ref(0)
  1304. const adjustOrderItems = ref<any[]>([])
  1305. const adjustAddressForm = reactive({
  1306. deliveryAddress: '',
  1307. contactPerson: '',
  1308. contactPhone: '',
  1309. reason: ''
  1310. })
  1311. const adjustForm = reactive({
  1312. reason: ''
  1313. })
  1314. const changedAdjustItems = computed(() =>
  1315. (adjustOrderItems.value || []).filter((item) => {
  1316. const original = Number(item.quantity || 0)
  1317. const after = Number(item.newQuantity ?? original)
  1318. return after >= 0 && after !== original
  1319. })
  1320. )
  1321. const handleAdjustQuantityCommit = (row: any, val: number | string | undefined) => {
  1322. const original = Number(row?.quantity || 0)
  1323. const next = Number(val ?? row?.newQuantity ?? original)
  1324. let normalized = next
  1325. if (!Number.isFinite(next)) {
  1326. normalized = original
  1327. } else if (next < 0) {
  1328. normalized = 0
  1329. }
  1330. row.newQuantity = normalized
  1331. console.log('[order-adjust] quantity updated', {
  1332. rowId: row?.id,
  1333. original,
  1334. input: val,
  1335. normalized,
  1336. amount: Number(row.unitPrice || 0) * normalized
  1337. })
  1338. }
  1339. const getOrderStatusType = (status: string) => {
  1340. const map: Record<string, string> = {
  1341. pending_payment: 'warning',
  1342. pending_confirm: 'primary',
  1343. pending: 'primary',
  1344. pending_review_cancel: 'warning',
  1345. completed: 'success',
  1346. cancelled: 'info'
  1347. }
  1348. return map[status] || 'info'
  1349. }
  1350. const getOrderStatusText = (status: string) => {
  1351. const map: Record<string, string> = {
  1352. pending_payment: '待支付',
  1353. pending_confirm: '待收货',
  1354. pending: '待收货',
  1355. pending_review_cancel: '待审核取消',
  1356. completed: '已完成',
  1357. cancelled: '已取消'
  1358. }
  1359. return map[status] || status
  1360. }
  1361. const getPayStatusType = (status: string) => {
  1362. const map: Record<string, string> = {
  1363. pending_payment: 'warning',
  1364. paid: 'success'
  1365. }
  1366. return map[status] || 'info'
  1367. }
  1368. const getPayStatusText = (status: string) => {
  1369. const map: Record<string, string> = {
  1370. pending_payment: '待支付',
  1371. paid: '已支付'
  1372. }
  1373. return map[status] || status
  1374. }
  1375. const getItemStatusType = (status: string) => {
  1376. const map: Record<string, string> = {
  1377. normal: '',
  1378. pending: 'warning',
  1379. delivered: 'success',
  1380. partial: 'warning'
  1381. }
  1382. return map[status] || ''
  1383. }
  1384. const getItemStatusText = (status: string) => {
  1385. const map: Record<string, string> = {
  1386. normal: '正常',
  1387. pending: '待配送',
  1388. delivered: '已送达',
  1389. partial: '部分送达'
  1390. }
  1391. return map[status] || status
  1392. }
  1393. const getDeliveryStatusType = (status: string) => {
  1394. const map: Record<string, string> = {
  1395. pending_dispatch: 'warning',
  1396. pending_delivery: 'warning',
  1397. delivering: 'info',
  1398. partial_delivered: 'warning',
  1399. delivered: 'success',
  1400. pending: 'warning',
  1401. picking: 'primary',
  1402. completed: 'success'
  1403. }
  1404. return map[status] || 'info'
  1405. }
  1406. const getDeliveryStatusText = (status: string) => {
  1407. const map: Record<string, string> = {
  1408. pending_dispatch: '待分配配送',
  1409. pending_delivery: '待配送',
  1410. delivering: '配送中',
  1411. partial_delivered: '部分送达',
  1412. delivered: '配送完成',
  1413. pending: '待取货',
  1414. picking: '取货中',
  1415. completed: '已完成'
  1416. }
  1417. return map[status] || status
  1418. }
  1419. const getDelivererTaskStatusType = (status: string) => {
  1420. const map: Record<string, string> = {
  1421. pending_pickup: 'warning',
  1422. delivering: 'primary',
  1423. delivered: 'success'
  1424. }
  1425. const k = (status || '').toLowerCase()
  1426. return map[k] || 'info'
  1427. }
  1428. const getDelivererTaskStatusText = (status: string) => {
  1429. const map: Record<string, string> = {
  1430. pending_pickup: '待取货',
  1431. delivering: '送货中',
  1432. delivered: '送货成功'
  1433. }
  1434. const k = (status || '').toLowerCase()
  1435. return (k && map[k]) || status || '-'
  1436. }
  1437. const getSupplierPrepareStatusType = (status: string) => {
  1438. const map: Record<string, string> = {
  1439. pending_prepare: 'warning',
  1440. prepared: 'primary',
  1441. picked_up: 'success'
  1442. }
  1443. const k = (status || '').toLowerCase()
  1444. return map[k] || 'info'
  1445. }
  1446. const getSupplierPrepareStatusText = (status: string) => {
  1447. const map: Record<string, string> = {
  1448. pending_prepare: '待备货',
  1449. prepared: '备货完成',
  1450. picked_up: '取货完成'
  1451. }
  1452. const k = (status || '').toLowerCase()
  1453. return (k && map[k]) || status || '-'
  1454. }
  1455. const formatOrderDetailTime = (t: string | undefined | null) => {
  1456. if (t == null || t === '') return ''
  1457. return String(t).replace('T', ' ').slice(0, 19)
  1458. }
  1459. const resolveOrderStatus = (row: any) => {
  1460. if (row?.cancelStatus === 'pending_review') return 'pending_review_cancel'
  1461. if (row?.orderStatus) return row.orderStatus
  1462. if (row?.status === 'pending_payment') return 'pending_payment'
  1463. if (['completed'].includes(row?.status)) return 'completed'
  1464. if (['cancelled'].includes(row?.status)) return 'cancelled'
  1465. return 'pending_confirm'
  1466. }
  1467. /** 已完成、已取消订单在详情弹窗中不展示调整/取消/分配或更换配送员 */
  1468. const showOrderDetailActions = computed(() => {
  1469. const s = resolveOrderStatus(viewData.value)
  1470. return s !== 'completed' && s !== 'cancelled'
  1471. })
  1472. /** 订单配送已完成则不再允许分配/更换配送员 */
  1473. const showDelivererAssignAction = computed(() => {
  1474. if (!showOrderDetailActions.value) return false
  1475. return canAssign(viewData.value)
  1476. })
  1477. /** 调整仅在配送过程中的订单展示 */
  1478. const showAdjustOrderAction = computed(() => {
  1479. if (!showOrderDetailActions.value) return false
  1480. const s = resolveOrderStatus(viewData.value)
  1481. return ['pending_delivery', 'delivering', 'partial_delivered', 'pending_confirm'].includes(s)
  1482. })
  1483. /** 取消按钮在已申请取消审核状态下隐藏 */
  1484. const showCancelOrderAction = computed(() => {
  1485. if (!showOrderDetailActions.value) return false
  1486. return resolveOrderStatus(viewData.value) !== 'pending_review_cancel'
  1487. })
  1488. const delivererActionLabel = computed(() => {
  1489. if (viewData.value.deliverId || viewData.value.deliverName) return '更换配送员'
  1490. return '分配配送员'
  1491. })
  1492. const supplierPickupDisplay = computed(() => {
  1493. const p = viewData.value.supplierPickup
  1494. if (p && typeof p === 'object') {
  1495. return {
  1496. address: p.address || '',
  1497. contactPerson: p.contactPerson || '',
  1498. contactPhone: p.contactPhone || ''
  1499. }
  1500. }
  1501. return { address: '', contactPerson: '', contactPhone: '' }
  1502. })
  1503. const resolveDeliveryStatus = (row: any) =>
  1504. row.deliveryStatus ||
  1505. (['pending_payment', 'pending_dispatch', 'pending_delivery', 'pending_review_cancel'].includes(
  1506. row.status
  1507. )
  1508. ? 'pending_dispatch'
  1509. : row.status === 'delivering'
  1510. ? 'delivering'
  1511. : row.status === 'partial_delivered'
  1512. ? 'partial_delivered'
  1513. : ['pending_confirm', 'completed'].includes(row.status)
  1514. ? 'delivered'
  1515. : 'pending_dispatch')
  1516. const resolvePayStatus = (row: any) =>
  1517. row.payStatus ||
  1518. (row.status === 'refunding' ? 'refunding' : row.paidAmount > 0 ? 'paid' : 'pending_payment')
  1519. const canAssign = (row: any) =>
  1520. resolveOrderStatus(row) === 'pending_confirm' &&
  1521. ['pending_dispatch', 'pending_delivery'].includes(resolveDeliveryStatus(row))
  1522. const getPaymentMethod = (method: string) => {
  1523. const m = (method || '').toLowerCase()
  1524. const map: Record<string, string> = {
  1525. online: '线上支付',
  1526. wechat: '线上支付',
  1527. wx: '线上支付',
  1528. offline: '线下支付'
  1529. }
  1530. return map[m] || method || '-'
  1531. }
  1532. const formatAmount = (amount: number | string) => {
  1533. const num = typeof amount === 'string' ? parseFloat(amount) : amount
  1534. return isNaN(num) ? '0.00' : num.toFixed(2)
  1535. }
  1536. const displayValue = (value: any) => {
  1537. if (value === null || value === undefined) return '-'
  1538. if (typeof value === 'string' && value.trim() === '') return '-'
  1539. return value
  1540. }
  1541. const getExpandedItems = (orderId: string) => expandedOrderItemsMap.value[orderId] || []
  1542. const getExpandedSummary = (orderId: string) => {
  1543. const rows = getExpandedItems(orderId)
  1544. return rows.reduce(
  1545. (acc, it) => {
  1546. acc.supplierTotal += Number(it.supplierAmount || 0)
  1547. acc.sellingTotal += Number(it.sellingAmount ?? it.amount ?? 0)
  1548. return acc
  1549. },
  1550. { supplierTotal: 0, sellingTotal: 0 }
  1551. )
  1552. }
  1553. const ensureExpandedItems = async (orderId: string) => {
  1554. if (expandedOrderItemsMap.value[orderId]) return
  1555. expandedRowLoadingMap.value = { ...expandedRowLoadingMap.value, [orderId]: true }
  1556. try {
  1557. const res: any = await fetchOrderItems(orderId)
  1558. expandedOrderItemsMap.value = {
  1559. ...expandedOrderItemsMap.value,
  1560. [orderId]: Array.isArray(res?.list) ? res.list : []
  1561. }
  1562. } finally {
  1563. expandedRowLoadingMap.value = { ...expandedRowLoadingMap.value, [orderId]: false }
  1564. }
  1565. }
  1566. const handleOrderRowExpand = async (row: any, expandedRows: any[]) => {
  1567. const expanded = expandedRows.some((r) => r.id === row.id)
  1568. if (!expanded) return
  1569. await ensureExpandedItems(row.id)
  1570. }
  1571. const toggleRowExpand = async (row: any) => {
  1572. orderListTableRef.value?.toggleRowExpansion?.(row)
  1573. await ensureExpandedItems(row.id)
  1574. }
  1575. const loadData = async () => {
  1576. loading.value = true
  1577. try {
  1578. const res = await fetchOrderList({
  1579. page: pagination.page,
  1580. pageSize: pagination.pageSize,
  1581. keyword: searchForm.keyword || undefined,
  1582. orderStatus: searchForm.orderStatus || undefined,
  1583. deliveryStatus: searchForm.deliveryStatus || undefined,
  1584. payStatus: searchForm.payStatus || undefined,
  1585. paymentMethod: searchForm.paymentMethod || undefined,
  1586. regionId: searchForm.regionId || undefined
  1587. })
  1588. tableData.value = res.list
  1589. pagination.total = res.total
  1590. } catch (error) {
  1591. console.error('加载数据失败:', error)
  1592. } finally {
  1593. loading.value = false
  1594. }
  1595. }
  1596. const AUTO_REFRESH_INTERVAL_MS = 3000
  1597. let lastAutoRefreshAt = 0
  1598. const tryAutoRefresh = () => {
  1599. const now = Date.now()
  1600. if (loading.value) return
  1601. if (now - lastAutoRefreshAt < AUTO_REFRESH_INTERVAL_MS) return
  1602. lastAutoRefreshAt = now
  1603. void loadData()
  1604. }
  1605. const handleWindowFocus = () => {
  1606. tryAutoRefresh()
  1607. }
  1608. const handleVisibilityChange = () => {
  1609. if (document.visibilityState === 'visible') {
  1610. tryAutoRefresh()
  1611. }
  1612. }
  1613. const addAutoRefreshListeners = () => {
  1614. window.addEventListener('focus', handleWindowFocus)
  1615. document.addEventListener('visibilitychange', handleVisibilityChange)
  1616. }
  1617. const loadRegions = async () => {
  1618. try {
  1619. const res = await fetchActiveRegions()
  1620. regionList.value = res
  1621. } catch (error) {
  1622. console.error('加载区域失败:', error)
  1623. }
  1624. }
  1625. const loadDeliverList = async () => {
  1626. if (!assignForm.regionId) {
  1627. deliverList.value = []
  1628. return
  1629. }
  1630. try {
  1631. const all = await fetchAllPagedRecords((page, pageSize) =>
  1632. fetchUserList({ role: 'deliver', regionId: assignForm.regionId, page, pageSize })
  1633. )
  1634. deliverList.value = all
  1635. } catch (error) {
  1636. console.error('加载配送员失败:', error)
  1637. }
  1638. }
  1639. watch(
  1640. () => assignVisible.value,
  1641. (visible) => {
  1642. if (visible) void loadDeliverList()
  1643. }
  1644. )
  1645. const handleSearch = () => {
  1646. pagination.page = 1
  1647. loadData()
  1648. }
  1649. const handleReset = () => {
  1650. Object.assign(searchForm, {
  1651. keyword: '',
  1652. orderStatus: '',
  1653. deliveryStatus: '',
  1654. payStatus: '',
  1655. paymentMethod: '',
  1656. regionId: ''
  1657. })
  1658. filterExpanded.value = false
  1659. pagination.page = 1
  1660. loadData()
  1661. }
  1662. const handleView = async (row: any, opts?: { preserveTab?: boolean }) => {
  1663. const tabToUse = opts?.preserveTab === true ? activeTab.value : 'order'
  1664. detailLoading.value = true
  1665. viewVisible.value = true
  1666. try {
  1667. const res: any = await fetchOrderDetail(row.id)
  1668. const statusLogs = Array.isArray(res.statusLogs) ? res.statusLogs : []
  1669. const operationLogs = statusLogs.map((log: any) => {
  1670. let description = (log.note as string) || ''
  1671. const rawReason = log.reason as string | undefined
  1672. if (rawReason && rawReason.trim().startsWith('{')) {
  1673. try {
  1674. const o = JSON.parse(rawReason) as Record<string, string | null | undefined>
  1675. if (o.toDeliverName != null || o.fromDeliverName != null) {
  1676. description = `配送员:${o.fromDeliverName ?? '—'} → ${o.toDeliverName ?? '—'}`
  1677. if (log.note) description += `;${log.note}`
  1678. } else if (!description) {
  1679. description = rawReason
  1680. }
  1681. } catch {
  1682. if (!description) description = rawReason
  1683. }
  1684. } else if (rawReason && !description) {
  1685. description = rawReason
  1686. }
  1687. const fromT = (log.fromStatusText as string | undefined)?.trim()
  1688. const toT = (log.statusText as string | undefined)?.trim() || (log.status as string) || '-'
  1689. const title = fromT ? `${fromT} → ${toT}` : toT
  1690. return {
  1691. time: log.createAt || '-',
  1692. title,
  1693. operator: log.operatorName || '-',
  1694. type: 'primary',
  1695. hollow: false,
  1696. description
  1697. }
  1698. })
  1699. viewData.value = {
  1700. ...res,
  1701. priceListId: res.priceListId,
  1702. priceVersion: res.priceVersion ?? '-',
  1703. payStatus: res.payStatus || '',
  1704. payTime: res.paymentTime || '',
  1705. deliverId: res.deliverId || '',
  1706. deliverName: res.deliverName || '',
  1707. deliverPhone: res.deliverPhone || '',
  1708. deliveryStatus: res.deliveryStatus || '',
  1709. expectedTime: res.expectedTime || '',
  1710. deliveryDispatchRemark: res.deliveryDispatchRemark || '',
  1711. supplierId: res.supplierId || '',
  1712. supplierName: res.supplierName || '',
  1713. supplierPhone: res.supplierPhone || '',
  1714. regionExpectedDeliveryMinutes: res.regionExpectedDeliveryMinutes ?? null,
  1715. supplierPickup: res.supplierPickup ?? null,
  1716. deliveryTaskNo: res.deliveryTaskNo || '',
  1717. deliveryTaskStatus: res.deliveryTaskStatus || '',
  1718. deliveryTaskDelivererStatus: res.deliveryTaskDelivererStatus || '',
  1719. deliveryTaskSupplierPrepareStatus: res.deliveryTaskSupplierPrepareStatus || '',
  1720. deliveryPickupTime: res.deliveryPickupTime || '',
  1721. deliveryPickupRemark: res.deliveryPickupRemark || '',
  1722. deliveryDeliveryTime: res.deliveryDeliveryTime || '',
  1723. deliveryDeliveryRemark: res.deliveryDeliveryRemark || '',
  1724. lockInfo: res.lockInfo || { isLocked: false },
  1725. deliveryTimeline: Array.isArray(res.deliveryTimeline) ? res.deliveryTimeline : [],
  1726. operationLogs,
  1727. items: Array.isArray(res.items) ? res.items : []
  1728. }
  1729. const adjustRes: any = await fetchOrderAdjusts(row.id)
  1730. viewData.value.adjustLogs = Array.isArray(adjustRes?.list) ? adjustRes.list : []
  1731. activeTab.value = tabToUse
  1732. } catch (error) {
  1733. console.error('加载详情失败:', error)
  1734. viewVisible.value = false
  1735. } finally {
  1736. detailLoading.value = false
  1737. }
  1738. }
  1739. const handleAssign = (row: any) => {
  1740. assignReassignMode.value = false
  1741. assignForm.orderId = row.id
  1742. assignForm.regionId = row.regionId || ''
  1743. assignForm.deliverId = ''
  1744. assignForm.deliveryDeadlineAt = computeAssignDeadline(row.regionExpectedDeliveryMinutes)
  1745. assignForm.dispatchRemark = ''
  1746. assignVisible.value = true
  1747. }
  1748. const showAssignDialogFromDetail = () => {
  1749. assignReassignMode.value = !!(viewData.value.deliverId || viewData.value.deliverName)
  1750. assignForm.orderId = viewData.value.id
  1751. assignForm.regionId = viewData.value.regionId || ''
  1752. assignForm.deliverId = assignReassignMode.value ? viewData.value.deliverId || '' : ''
  1753. assignForm.deliveryDeadlineAt = computeAssignDeadline(
  1754. viewData.value.regionExpectedDeliveryMinutes
  1755. )
  1756. assignForm.dispatchRemark = viewData.value.deliveryDispatchRemark || ''
  1757. assignVisible.value = true
  1758. }
  1759. const confirmAssign = async () => {
  1760. if (!assignForm.regionId) {
  1761. ElMessage.warning('订单缺少区域信息,无法分配')
  1762. return
  1763. }
  1764. if (!assignForm.deliverId) {
  1765. ElMessage.warning('请选择配送员')
  1766. return
  1767. }
  1768. if (!assignForm.deliveryDeadlineAt) {
  1769. ElMessage.warning('请选择配送时效')
  1770. return
  1771. }
  1772. const orderIdSaved = assignForm.orderId
  1773. const wasReassign = assignReassignMode.value
  1774. submitLoading.value = true
  1775. try {
  1776. await fetchAssignDelivery({
  1777. orderId: assignForm.orderId,
  1778. deliverId: assignForm.deliverId,
  1779. deliveryDeadlineAt: assignForm.deliveryDeadlineAt,
  1780. dispatchRemark: assignForm.dispatchRemark
  1781. })
  1782. ElMessage.success(wasReassign ? '更换成功' : '分配成功')
  1783. assignVisible.value = false
  1784. await loadData()
  1785. if (viewVisible.value && viewData.value.id === orderIdSaved) {
  1786. await handleView({ id: orderIdSaved }, { preserveTab: true })
  1787. }
  1788. } catch (error) {
  1789. console.error('分配失败:', error)
  1790. } finally {
  1791. submitLoading.value = false
  1792. }
  1793. }
  1794. const handleReviewCancel = (row: any) => {
  1795. cancelForm.orderId = row.id
  1796. cancelForm.approved = true
  1797. cancelForm.note = ''
  1798. cancelVisible.value = true
  1799. }
  1800. const confirmCancel = async () => {
  1801. submitLoading.value = true
  1802. try {
  1803. await fetchReviewCancel({
  1804. orderId: cancelForm.orderId,
  1805. approved: cancelForm.approved,
  1806. note: cancelForm.note
  1807. })
  1808. ElMessage.success('审核完成')
  1809. cancelVisible.value = false
  1810. loadData()
  1811. } catch (error) {
  1812. console.error('审核失败:', error)
  1813. } finally {
  1814. submitLoading.value = false
  1815. }
  1816. }
  1817. const showCancelDialog = () => {
  1818. cancelDialogForm.orderId = viewData.value.id
  1819. cancelDialogForm.reason = ''
  1820. cancelDialogForm.note = ''
  1821. cancelDialogForm.evidenceImageUrls = []
  1822. cancelDialogVisible.value = true
  1823. }
  1824. const handleCancelEvidenceChange = async (uploadFile: any) => {
  1825. const file = uploadFile?.raw
  1826. if (!file) return
  1827. const fd = new FormData()
  1828. fd.append('business_type', 'order')
  1829. fd.append('business_id', cancelDialogForm.orderId)
  1830. fd.append('file', file)
  1831. const res: any = await fetchUploadAttachment(fd)
  1832. if (res?.fileUrl) cancelDialogForm.evidenceImageUrls.push(res.fileUrl)
  1833. }
  1834. const handleCancelEvidenceRemove = (_file: any, fileList: any[]) => {
  1835. const urls = fileList.map((f: any) => f?.response?.fileUrl || f?.url).filter(Boolean)
  1836. cancelDialogForm.evidenceImageUrls = urls
  1837. }
  1838. const confirmCancelOrder = async () => {
  1839. if (!cancelDialogForm.reason) {
  1840. ElMessage.warning('请输入取消原因')
  1841. return
  1842. }
  1843. cancelDialogLoading.value = true
  1844. try {
  1845. await withFullscreenLoading(async () => {
  1846. await fetchCancelOrder({
  1847. orderId: cancelDialogForm.orderId,
  1848. reason: cancelDialogForm.reason,
  1849. note: cancelDialogForm.note,
  1850. evidenceImageUrls: cancelDialogForm.evidenceImageUrls
  1851. })
  1852. ElMessage.success('订单取消成功')
  1853. cancelDialogVisible.value = false
  1854. viewVisible.value = false
  1855. loadData()
  1856. }, fullscreenLoadingText.delete)
  1857. } catch (error) {
  1858. console.error('取消订单失败:', error)
  1859. ElMessage.error('取消订单失败,请重试')
  1860. } finally {
  1861. cancelDialogLoading.value = false
  1862. }
  1863. }
  1864. const showAdjustDialog = () => {
  1865. adjustForm.reason = ''
  1866. adjustAddressForm.deliveryAddress = viewData.value.deliveryAddress || ''
  1867. adjustAddressForm.contactPerson = viewData.value.contactPerson || ''
  1868. adjustAddressForm.contactPhone = viewData.value.contactPhone || ''
  1869. adjustAddressForm.reason = ''
  1870. adjustOrderItems.value = []
  1871. console.log('[order-adjust] open dialog', { orderId: viewData.value.id })
  1872. adjustDialogVisible.value = true
  1873. }
  1874. // 加载订单商品用于调整
  1875. const loadOrderItemsForAdjust = async () => {
  1876. if (!viewData.value.id) return
  1877. adjustItemsLoading.value = true
  1878. const seq = ++adjustLoadSeq.value
  1879. console.log('[order-adjust] start load items', { orderId: viewData.value.id, seq })
  1880. try {
  1881. const res: any = await fetchOrderItems(viewData.value.id)
  1882. if (seq !== adjustLoadSeq.value) {
  1883. console.log('[order-adjust] skip stale load result', { seq, currentSeq: adjustLoadSeq.value })
  1884. return
  1885. }
  1886. const src = Array.isArray(res?.list) ? res.list : viewData.value.items || []
  1887. adjustOrderItems.value = src.map((item: any) => ({
  1888. ...item,
  1889. newQuantity: Number(item.quantity || 0)
  1890. }))
  1891. console.log('[order-adjust] load items success', {
  1892. seq,
  1893. total: adjustOrderItems.value.length,
  1894. sample: adjustOrderItems.value.slice(0, 3).map((it: any) => ({
  1895. id: it.id,
  1896. quantity: it.quantity,
  1897. unitPrice: it.unitPrice
  1898. }))
  1899. })
  1900. } catch (error) {
  1901. console.error('加载订单商品失败:', error)
  1902. const src = Array.isArray(viewData.value.items) ? viewData.value.items : []
  1903. adjustOrderItems.value = src.map((item: any) => ({
  1904. ...item,
  1905. newQuantity: Number(item.quantity || 0)
  1906. }))
  1907. console.log('[order-adjust] fallback items from detail', { total: adjustOrderItems.value.length })
  1908. } finally {
  1909. if (seq === adjustLoadSeq.value) adjustItemsLoading.value = false
  1910. }
  1911. }
  1912. const confirmAdjustOrder = async () => {
  1913. console.log('[order-adjust] submit check', {
  1914. changedCount: changedAdjustItems.value.length,
  1915. changedItems: changedAdjustItems.value.map((item) => ({
  1916. id: item.id,
  1917. original: item.quantity,
  1918. newQuantity: item.newQuantity
  1919. }))
  1920. })
  1921. const hasAddressChanged =
  1922. (adjustAddressForm.deliveryAddress || '') !== (viewData.value.deliveryAddress || '') ||
  1923. (adjustAddressForm.contactPerson || '') !== (viewData.value.contactPerson || '') ||
  1924. (adjustAddressForm.contactPhone || '') !== (viewData.value.contactPhone || '')
  1925. if (changedAdjustItems.value.length === 0 && !hasAddressChanged) {
  1926. ElMessage.warning('请至少调整商品或修改地址信息')
  1927. return
  1928. }
  1929. if (changedAdjustItems.value.length > 0 && !String(adjustForm.reason || '').trim()) {
  1930. ElMessage.warning('有商品调整时,调整原因必填')
  1931. return
  1932. }
  1933. const invalidQty = changedAdjustItems.value.some((item) => {
  1934. const original = Number(item.quantity || 0)
  1935. const after = Number(item.newQuantity ?? original)
  1936. return Number.isNaN(after) || after < 0
  1937. })
  1938. if (invalidQty) {
  1939. ElMessage.warning('新数量不能小于0')
  1940. return
  1941. }
  1942. try {
  1943. await ElMessageBox.confirm('确认提交本次订单调整吗?', '确认调整', {
  1944. type: 'warning',
  1945. confirmButtonText: '确认提交',
  1946. cancelButtonText: '取消'
  1947. })
  1948. } catch {
  1949. return
  1950. }
  1951. adjustDialogLoading.value = true
  1952. try {
  1953. const adjustments = changedAdjustItems.value.map((item) => {
  1954. const originalQty = Number(item.quantity ?? 0)
  1955. const afterQty = Number(item.newQuantity ?? item.quantity ?? 0)
  1956. const adjustType: 'increase' | 'reduce' | 'delete' =
  1957. afterQty === 0 ? 'delete' : afterQty > originalQty ? 'increase' : 'reduce'
  1958. return {
  1959. orderItemId: item.id,
  1960. adjustType,
  1961. newQuantity: afterQty,
  1962. reason: adjustForm.reason
  1963. }
  1964. })
  1965. const addressUpdate = hasAddressChanged
  1966. ? {
  1967. deliveryAddress: adjustAddressForm.deliveryAddress,
  1968. contactPerson: adjustAddressForm.contactPerson,
  1969. contactPhone: adjustAddressForm.contactPhone,
  1970. reason: adjustAddressForm.reason || '运营调整收货地址'
  1971. }
  1972. : undefined
  1973. await fetchAdjustOrder({
  1974. orderId: viewData.value.id,
  1975. adjustments,
  1976. addressUpdate
  1977. })
  1978. ElMessage.success('订单调整已提交')
  1979. adjustDialogVisible.value = false
  1980. await loadData()
  1981. await handleView({ id: viewData.value.id }, { preserveTab: true })
  1982. activeTab.value = 'logs'
  1983. } catch (error) {
  1984. console.error('订单调整失败:', error)
  1985. ElMessage.error('订单调整失败,请重试')
  1986. } finally {
  1987. adjustDialogLoading.value = false
  1988. }
  1989. }
  1990. const loadSystemDefaultsForAssign = async () => {
  1991. try {
  1992. const res: any = await fetchSystemConfig()
  1993. const m = res?.order?.defaultRegionExpectedDeliveryMinutes
  1994. if (m != null && Number.isFinite(Number(m)) && Number(m) > 0) {
  1995. defaultRegionExpectedDeliveryMinutes.value = Math.floor(Number(m))
  1996. }
  1997. } catch (e) {
  1998. console.error('加载系统默认配送时长失败:', e)
  1999. }
  2000. }
  2001. onMounted(() => {
  2002. void ensureCategoryPathDataLoaded()
  2003. loadData()
  2004. loadRegions()
  2005. loadSystemDefaultsForAssign()
  2006. addAutoRefreshListeners()
  2007. })
  2008. onActivated(() => {
  2009. addAutoRefreshListeners()
  2010. tryAutoRefresh()
  2011. })
  2012. const removeAutoRefreshListeners = () => {
  2013. window.removeEventListener('focus', handleWindowFocus)
  2014. document.removeEventListener('visibilitychange', handleVisibilityChange)
  2015. }
  2016. onDeactivated(() => {
  2017. removeAutoRefreshListeners()
  2018. })
  2019. onUnmounted(() => {
  2020. removeAutoRefreshListeners()
  2021. })
  2022. </script>
  2023. <style lang="scss" scoped>
  2024. .order-list-table :deep(th.el-table__cell > .cell),
  2025. .order-list-table :deep(td.el-table__cell > .cell) {
  2026. display: flex;
  2027. align-items: center;
  2028. justify-content: center;
  2029. }
  2030. .page-container {
  2031. display: flex;
  2032. flex-direction: column;
  2033. gap: 16px;
  2034. }
  2035. /* 订单检索区:对齐 fresh-mint-green.html 的筛选块节奏 */
  2036. .filter-hint {
  2037. margin: 0 0 10px;
  2038. font-size: 11px;
  2039. color: var(--mint-text-muted, #64748b);
  2040. line-height: 1.45;
  2041. }
  2042. .order-filter-main-grid {
  2043. grid-template-columns: repeat(4, minmax(0, 1fr));
  2044. }
  2045. .order-filter-extra-grid {
  2046. grid-template-columns: repeat(4, minmax(0, 1fr));
  2047. }
  2048. @media (max-width: 1100px) {
  2049. .order-filter-main-grid,
  2050. .order-filter-extra-grid {
  2051. grid-template-columns: repeat(2, minmax(0, 1fr));
  2052. }
  2053. }
  2054. @media (max-width: 560px) {
  2055. .order-filter-main-grid,
  2056. .order-filter-extra-grid {
  2057. grid-template-columns: 1fr;
  2058. }
  2059. }
  2060. .filter-form :deep(.el-form-item) {
  2061. margin-bottom: 0;
  2062. min-width: 0;
  2063. }
  2064. .filter-form :deep(.el-form-item__label) {
  2065. font-size: 13px;
  2066. font-weight: 500;
  2067. color: var(--mint-text-muted, #64748b);
  2068. padding: 0 0 4px;
  2069. line-height: 1.2;
  2070. }
  2071. .filter-extra {
  2072. padding-top: 10px;
  2073. margin-top: 8px;
  2074. border-top: 0; /* 设计图:筛选内部不加分割线 */
  2075. }
  2076. .filter-actions {
  2077. display: flex;
  2078. flex-wrap: wrap;
  2079. align-items: center;
  2080. justify-content: space-between;
  2081. gap: 10px;
  2082. padding-top: 10px;
  2083. margin-top: 10px;
  2084. border-top: 0; /* 设计图:筛选内部不加分割线 */
  2085. }
  2086. .filter-actions-end {
  2087. display: inline-flex;
  2088. align-items: center;
  2089. gap: 8px;
  2090. flex-wrap: wrap;
  2091. }
  2092. .btn-filter-toggle {
  2093. height: 36px;
  2094. padding: 0 8px;
  2095. }
  2096. .btn-filter-toggle-ic {
  2097. margin-right: 4px;
  2098. }
  2099. .order-row-expand-wrap {
  2100. padding: 0;
  2101. background: #f8fafc;
  2102. border-radius: 0;
  2103. }
  2104. .order-list-table :deep(td.el-table__expanded-cell) {
  2105. padding: 0 !important;
  2106. text-align: left !important;
  2107. }
  2108. .order-list-table :deep(td.el-table__expanded-cell > .cell) {
  2109. display: block !important;
  2110. padding: 0 !important;
  2111. text-align: left !important;
  2112. }
  2113. /* 展开按钮:边框 + hover + 展开态旋转(对齐设计图树形列表) */
  2114. .order-list-table :deep(.el-table__expand-icon) {
  2115. width: 28px;
  2116. height: 28px;
  2117. border-radius: 6px;
  2118. border: 1px solid var(--mint-border, #d9e8e2);
  2119. display: inline-flex;
  2120. align-items: center;
  2121. justify-content: center;
  2122. transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  2123. color: var(--mint-text-muted, #64748b);
  2124. background: var(--mint-surface, #fff);
  2125. }
  2126. .order-list-table :deep(.el-table__expand-icon:hover) {
  2127. background: var(--mint-primary-bg, #ecfdf5);
  2128. border-color: #10b981;
  2129. color: var(--mint-primary-dark, #059669);
  2130. }
  2131. .order-list-table :deep(.el-table__expand-icon--expanded) {
  2132. background: var(--mint-primary-bg, #ecfdf5);
  2133. border-color: #10b981;
  2134. color: var(--mint-primary-dark, #059669);
  2135. }
  2136. .order-list-table :deep(.el-table__expand-icon svg) {
  2137. transition: transform 0.15s ease;
  2138. }
  2139. .order-list-table :deep(.el-table__expand-icon--expanded svg) {
  2140. transform: rotate(180deg);
  2141. }
  2142. .order-row-expand-table {
  2143. width: max-content;
  2144. max-width: 100%;
  2145. :deep(.el-table__body-wrapper) {
  2146. overflow-x: auto;
  2147. }
  2148. }
  2149. .order-row-expand-table-wrap {
  2150. display: block;
  2151. width: 100%;
  2152. max-width: 100%;
  2153. overflow: hidden;
  2154. border-radius: 0;
  2155. text-align: left;
  2156. :deep(.el-table__inner-wrapper),
  2157. :deep(.el-table__header-wrapper),
  2158. :deep(.el-table__body-wrapper) {
  2159. width: max-content;
  2160. }
  2161. }
  2162. /* 树形展开子表(对齐 fresh-mint-green.html / 规范 §8) */
  2163. .order-row-expand-wrap {
  2164. padding: 0;
  2165. }
  2166. .order-row-expand-wrap .sqxp-subtable-wrap {
  2167. width: 100%;
  2168. background: #f8fafc;
  2169. }
  2170. .order-row-expand-wrap .sqxp-subtable-wrap::before {
  2171. content: '';
  2172. display: block;
  2173. height: 0;
  2174. }
  2175. .order-row-expand-wrap .sqxp-subtable-wrap {
  2176. border: 0;
  2177. }
  2178. .order-row-expand-table-wrap.sqxp-subtable-wrap {
  2179. padding: 0;
  2180. }
  2181. .order-row-expand-wrap .sqxp-subtable-wrap {
  2182. position: relative;
  2183. }
  2184. .order-row-expand-wrap .sqxp-subtable-wrap::after {
  2185. content: '';
  2186. position: absolute;
  2187. left: 0;
  2188. top: 0;
  2189. bottom: 0;
  2190. width: 3px;
  2191. background: #10b981;
  2192. }
  2193. .order-row-expand-wrap .order-row-expand-table-wrap {
  2194. padding: 12px 12px 14px 16px;
  2195. }
  2196. .order-row-expand-wrap .order-row-expand-table {
  2197. width: 100%;
  2198. border: 1px solid var(--mint-border, #d9e8e2);
  2199. border-radius: 8px;
  2200. overflow: hidden;
  2201. background: #fff;
  2202. }
  2203. .order-row-expand-wrap .order-row-expand-table :deep(th.el-table__cell) {
  2204. background: #e2e8f0 !important;
  2205. color: var(--mint-text-muted, #64748b);
  2206. font-size: 11px;
  2207. font-weight: 600;
  2208. }
  2209. .order-row-expand-wrap .order-row-expand-table :deep(td.el-table__cell) {
  2210. font-size: 13px;
  2211. }
  2212. .order-row-expand-wrap .order-row-expand-table :deep(.el-table__cell) {
  2213. padding: 8px 10px;
  2214. }
  2215. .order-row-expand-summary {
  2216. margin-top: 10px;
  2217. display: flex;
  2218. gap: 16px;
  2219. justify-content: flex-end;
  2220. color: var(--mint-text-muted, #64748b);
  2221. font-size: 13px;
  2222. }
  2223. .order-row-expand-summary {
  2224. margin-top: 10px;
  2225. display: flex;
  2226. gap: 20px;
  2227. justify-content: flex-end;
  2228. color: #606266;
  2229. font-size: 13px;
  2230. }
  2231. .expand-product-cell {
  2232. display: inline-flex;
  2233. align-items: center;
  2234. gap: 10px;
  2235. max-width: 100%;
  2236. min-width: 0;
  2237. }
  2238. .expand-product-thumb-wrap {
  2239. flex: 0 0 auto;
  2240. }
  2241. .expand-product-thumb {
  2242. width: 34px;
  2243. height: 34px;
  2244. border-radius: 6px;
  2245. display: block;
  2246. }
  2247. .expand-product-thumb.placeholder {
  2248. width: 34px;
  2249. height: 34px;
  2250. border-radius: 6px;
  2251. display: flex;
  2252. align-items: center;
  2253. justify-content: center;
  2254. font-size: 11px;
  2255. color: #909399;
  2256. background: #f5f7fa;
  2257. border: 1px dashed #dcdfe6;
  2258. }
  2259. .expand-product-name {
  2260. min-width: 0;
  2261. overflow: hidden;
  2262. text-overflow: ellipsis;
  2263. white-space: nowrap;
  2264. }
  2265. .amount-text {
  2266. color: #dc2626;
  2267. font-weight: 600;
  2268. }
  2269. .amount-text.danger {
  2270. color: #dc2626;
  2271. }
  2272. .mt-4 {
  2273. margin-top: 16px;
  2274. }
  2275. .mb-2 {
  2276. margin-bottom: 8px;
  2277. }
  2278. .font-medium {
  2279. font-weight: 500;
  2280. }
  2281. .mb-4 {
  2282. margin-bottom: 16px;
  2283. }
  2284. .order-delivered-th-icon {
  2285. margin-left: 4px;
  2286. vertical-align: middle;
  2287. cursor: help;
  2288. color: #c0c4cc;
  2289. font-size: 14px;
  2290. }
  2291. .hint-text {
  2292. margin-top: 6px;
  2293. font-size: 12px;
  2294. color: #909399;
  2295. line-height: 1.5;
  2296. }
  2297. .section-title {
  2298. font-size: 15px;
  2299. font-weight: 600;
  2300. margin-bottom: 12px;
  2301. padding-left: 12px;
  2302. border-left: 4px solid #10b981;
  2303. }
  2304. .detail-tabs {
  2305. display: flex;
  2306. gap: 4px;
  2307. background: #f5f7fa;
  2308. padding: 4px;
  2309. border-radius: 8px;
  2310. margin: 8px 22px 16px;
  2311. width: fit-content;
  2312. }
  2313. .order-tab-pane {
  2314. margin-top: 6px;
  2315. }
  2316. .price-version-link {
  2317. border: 0 !important;
  2318. background: transparent !important;
  2319. padding: 0 !important;
  2320. height: auto !important;
  2321. min-height: 0 !important;
  2322. color: #059669 !important;
  2323. font-weight: 600;
  2324. }
  2325. .price-version-link:hover,
  2326. .price-version-link:focus {
  2327. color: #047857 !important;
  2328. text-decoration: underline;
  2329. }
  2330. .detail-tab {
  2331. padding: 10px 20px;
  2332. cursor: pointer;
  2333. border-radius: 6px;
  2334. font-size: 14px;
  2335. color: #606266;
  2336. transition: all 0.3s;
  2337. &.active {
  2338. background: #fff;
  2339. color: #059669;
  2340. font-weight: 500;
  2341. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  2342. }
  2343. &:hover:not(.active) {
  2344. color: #059669;
  2345. }
  2346. }
  2347. .lock-tip {
  2348. background: #fff1f0;
  2349. border: 1px solid #ffccc7;
  2350. border-radius: 8px;
  2351. padding: 12px 16px;
  2352. margin-bottom: 16px;
  2353. display: flex;
  2354. align-items: center;
  2355. gap: 12px;
  2356. color: #dc2626;
  2357. font-size: 14px;
  2358. strong {
  2359. color: #dc2626;
  2360. }
  2361. }
  2362. .amount-summary {
  2363. display: flex;
  2364. justify-content: center;
  2365. flex-wrap: wrap;
  2366. gap: 40px;
  2367. padding: 16px 0;
  2368. border-top: 2px solid #10b981;
  2369. margin-top: 16px;
  2370. .amount-item {
  2371. .label {
  2372. font-size: 16px;
  2373. color: #606266;
  2374. }
  2375. .value {
  2376. font-size: 20px;
  2377. font-weight: 600;
  2378. color: #dc2626;
  2379. margin-left: 8px;
  2380. &.success {
  2381. color: #059669;
  2382. }
  2383. }
  2384. }
  2385. }
  2386. .order-delivery-tab {
  2387. padding: 0 22px 8px;
  2388. }
  2389. .order-delivery-address-blocks {
  2390. display: grid;
  2391. grid-template-columns: 1fr 1fr;
  2392. gap: 16px;
  2393. margin-bottom: 20px;
  2394. }
  2395. @media (max-width: 960px) {
  2396. .order-delivery-address-blocks {
  2397. grid-template-columns: 1fr;
  2398. }
  2399. }
  2400. .od-address-card {
  2401. border-radius: 12px;
  2402. :deep(.el-card__header) {
  2403. padding: 12px 16px;
  2404. background: #f5f7fa;
  2405. }
  2406. :deep(.el-card__body) {
  2407. padding: 16px;
  2408. }
  2409. }
  2410. .od-address-card--supplier :deep(.el-card__header) {
  2411. border-left: 4px solid #d97706;
  2412. }
  2413. .od-address-card--customer :deep(.el-card__header) {
  2414. border-left: 4px solid #059669;
  2415. }
  2416. .od-address-card-title {
  2417. font-weight: 600;
  2418. font-size: 14px;
  2419. color: #303133;
  2420. }
  2421. .od-address-card-body {
  2422. font-size: 13px;
  2423. color: #606266;
  2424. }
  2425. .od-address-line {
  2426. display: flex;
  2427. gap: 12px;
  2428. margin-bottom: 10px;
  2429. align-items: flex-start;
  2430. .od-label {
  2431. flex-shrink: 0;
  2432. width: 88px;
  2433. color: #909399;
  2434. }
  2435. .od-value {
  2436. flex: 1;
  2437. min-width: 0;
  2438. word-break: break-all;
  2439. }
  2440. .od-value.od-text-wrap {
  2441. white-space: pre-wrap;
  2442. }
  2443. }
  2444. .od-address-line--block {
  2445. align-items: flex-start;
  2446. }
  2447. .evidence-grid {
  2448. display: flex;
  2449. flex-wrap: wrap;
  2450. gap: 8px;
  2451. }
  2452. .evidence-image {
  2453. width: 72px;
  2454. height: 72px;
  2455. border-radius: 6px;
  2456. border: 1px solid #ebeef5;
  2457. overflow: hidden;
  2458. }
  2459. .order-delivery-tab {
  2460. padding-bottom: 8px;
  2461. }
  2462. .order-delivery-address-blocks {
  2463. display: grid;
  2464. grid-template-columns: 1fr 1fr;
  2465. gap: 16px;
  2466. margin-bottom: 20px;
  2467. }
  2468. @media (max-width: 960px) {
  2469. .order-delivery-address-blocks {
  2470. grid-template-columns: 1fr;
  2471. }
  2472. }
  2473. .od-address-card {
  2474. border-radius: 12px;
  2475. :deep(.el-card__header) {
  2476. padding: 12px 16px;
  2477. background: #f5f7fa;
  2478. }
  2479. :deep(.el-card__body) {
  2480. padding: 16px;
  2481. }
  2482. }
  2483. .od-address-card--supplier :deep(.el-card__header) {
  2484. border-left: 4px solid #d97706;
  2485. }
  2486. .od-address-card--customer :deep(.el-card__header) {
  2487. border-left: 4px solid #059669;
  2488. }
  2489. .od-address-card-title {
  2490. font-weight: 600;
  2491. font-size: 14px;
  2492. color: #303133;
  2493. }
  2494. .od-address-card-body {
  2495. font-size: 13px;
  2496. color: #606266;
  2497. }
  2498. .od-address-line {
  2499. display: flex;
  2500. gap: 12px;
  2501. margin-bottom: 10px;
  2502. align-items: flex-start;
  2503. .od-label {
  2504. flex-shrink: 0;
  2505. width: 88px;
  2506. color: #909399;
  2507. }
  2508. .od-value {
  2509. flex: 1;
  2510. min-width: 0;
  2511. word-break: break-all;
  2512. }
  2513. .od-value.od-text-wrap {
  2514. white-space: pre-wrap;
  2515. }
  2516. }
  2517. .timeline-content {
  2518. width: 240px;
  2519. min-width: 240px;
  2520. max-width: 240px;
  2521. min-height: 116px;
  2522. height: 100%;
  2523. padding: 10px 12px;
  2524. border: 1px solid #e4e7ed;
  2525. border-radius: 10px;
  2526. background: #fff;
  2527. display: flex;
  2528. flex-direction: column;
  2529. .timeline-time {
  2530. font-size: 12px;
  2531. color: #909399;
  2532. margin-bottom: 6px;
  2533. }
  2534. .timeline-title {
  2535. font-size: 14px;
  2536. color: #303133;
  2537. font-weight: 500;
  2538. }
  2539. .timeline-desc {
  2540. font-size: 13px;
  2541. color: #909399;
  2542. margin-top: 4px;
  2543. }
  2544. }
  2545. .timeline-horizontal {
  2546. width: 100%;
  2547. overflow: hidden;
  2548. padding: 8px 0 14px;
  2549. }
  2550. .timeline-horizontal-list {
  2551. display: flex;
  2552. align-items: stretch;
  2553. flex-wrap: wrap;
  2554. gap: 8px;
  2555. }
  2556. .timeline-horizontal-item {
  2557. display: flex;
  2558. align-items: stretch;
  2559. gap: 8px;
  2560. max-width: 100%;
  2561. }
  2562. .timeline-index {
  2563. width: 22px;
  2564. height: 22px;
  2565. border-radius: 50%;
  2566. background: #10b981;
  2567. color: #fff;
  2568. font-size: 12px;
  2569. font-weight: 600;
  2570. line-height: 22px;
  2571. text-align: center;
  2572. flex: 0 0 22px;
  2573. margin-top: 8px;
  2574. }
  2575. .timeline-horizontal-item:last-child .timeline-horizontal-arrow {
  2576. display: none;
  2577. }
  2578. @media (max-width: 1200px) {
  2579. .timeline-content {
  2580. width: 210px;
  2581. min-width: 210px;
  2582. max-width: 210px;
  2583. }
  2584. }
  2585. .timeline-horizontal-arrow {
  2586. color: #c0c4cc;
  2587. font-size: 16px;
  2588. font-weight: 600;
  2589. user-select: none;
  2590. align-self: center;
  2591. }
  2592. .info-text {
  2593. color: #606266;
  2594. }
  2595. .unit-text {
  2596. margin-left: 8px;
  2597. color: #909399;
  2598. }
  2599. .adjust-summary {
  2600. margin-bottom: 16px;
  2601. }
  2602. .adjust-preview {
  2603. margin-top: 16px;
  2604. }
  2605. /* 覆盖全局表格居中:调整弹窗内商品名称左对齐 */
  2606. .adjust-order-items-table :deep(.el-table__cell.adjust-product-col > .cell) {
  2607. justify-content: flex-start;
  2608. text-align: left;
  2609. }
  2610. .adjust-order-items-table :deep(.el-table__cell:not(.adjust-product-col) > .cell) {
  2611. justify-content: center;
  2612. text-align: center;
  2613. }
  2614. .adjust-order-items-table :deep(.el-table__body-wrapper) {
  2615. overflow-y: auto;
  2616. }
  2617. .text-danger {
  2618. color: #dc2626;
  2619. }
  2620. /* 订单明细:横向滚动,列保持 min-width 可读 */
  2621. .order-detail-items-scroll {
  2622. width: 100%;
  2623. max-width: 100%;
  2624. overflow-x: hidden;
  2625. overflow-y: visible;
  2626. margin-bottom: 12px;
  2627. -webkit-overflow-scrolling: touch;
  2628. }
  2629. /*
  2630. * 全局 el-ui.scss 对 .el-table / .el-table__inner-wrapper 使用了 width:100%!important,
  2631. * 会把列压进弹窗宽度导致末列被裁切且无横向滚动。此处覆盖为按列宽撑开并由外层滚动。
  2632. */
  2633. .order-detail-items-scroll :deep(.el-table) {
  2634. width: 100% !important;
  2635. min-width: 100%;
  2636. }
  2637. .order-detail-items-scroll :deep(.el-table .el-table__inner-wrapper) {
  2638. width: 100% !important;
  2639. min-width: 100%;
  2640. }
  2641. .order-detail-items-scroll :deep(.el-table__body-wrapper) {
  2642. overflow-x: auto !important;
  2643. overflow-y: auto !important;
  2644. }
  2645. .order-detail-items-scroll :deep(.el-table__header-wrapper) {
  2646. overflow-x: hidden !important;
  2647. }
  2648. /* 已配送列:全局表格 nowrap 会截断长文案,此处允许换行完整展示 */
  2649. .order-detail-items-table :deep(.el-table__cell.order-delivered-cell .cell) {
  2650. white-space: normal;
  2651. word-break: break-word;
  2652. line-height: 1.45;
  2653. overflow: visible;
  2654. text-overflow: clip;
  2655. }
  2656. .order-detail-items-table :deep(.order-delivered-text) {
  2657. display: inline-block;
  2658. max-width: 100%;
  2659. text-align: center;
  2660. }
  2661. /* 订单明细:除商品名称外均居中(覆盖全局 el-table 与下方通用规则) */
  2662. .order-detail-items-table :deep(.el-table__cell:not(.order-detail-product-col)) {
  2663. text-align: center;
  2664. }
  2665. .order-detail-items-table :deep(.el-table__cell:not(.order-detail-product-col) > .cell) {
  2666. justify-content: center;
  2667. text-align: center;
  2668. }
  2669. /*
  2670. * showOverflowTooltip 会给 tbody 内层 .cell 设置固定像素宽,块级时贴齐单元格一侧,
  2671. * 表头仍按整格居中,易出现「分类」等列表头与数据纵向不对齐。
  2672. */
  2673. .order-detail-items-table
  2674. :deep(td.el-table__cell:not(.order-detail-product-col) .cell.el-tooltip) {
  2675. width: 100% !important;
  2676. max-width: 100%;
  2677. box-sizing: border-box;
  2678. display: flex;
  2679. justify-content: center;
  2680. align-items: center;
  2681. text-align: center;
  2682. }
  2683. .order-detail-items-table :deep(th.el-table__cell:not(.order-detail-product-col) > .cell) {
  2684. display: flex;
  2685. justify-content: center;
  2686. align-items: center;
  2687. width: 100%;
  2688. box-sizing: border-box;
  2689. text-align: center;
  2690. }
  2691. .order-detail-items-table :deep(.el-table__cell.order-detail-product-col) {
  2692. text-align: left;
  2693. }
  2694. .order-detail-items-table :deep(.el-table__cell.order-detail-product-col > .cell) {
  2695. justify-content: flex-start;
  2696. text-align: left;
  2697. }
  2698. .order-detail-items-table :deep(.el-table__cell) {
  2699. vertical-align: middle;
  2700. }
  2701. .order-item-name-cell {
  2702. display: inline-flex;
  2703. align-items: center;
  2704. justify-content: flex-start;
  2705. gap: 8px;
  2706. max-width: 100%;
  2707. }
  2708. .order-item-thumb-wrap {
  2709. flex-shrink: 0;
  2710. }
  2711. .order-item-thumb {
  2712. width: 40px;
  2713. height: 40px;
  2714. border-radius: 4px;
  2715. display: block;
  2716. }
  2717. .order-item-thumb.placeholder {
  2718. display: flex;
  2719. align-items: center;
  2720. justify-content: center;
  2721. font-size: 11px;
  2722. color: #909399;
  2723. background: #f5f7fa;
  2724. border: 1px dashed #dcdfe6;
  2725. }
  2726. .order-item-name-text {
  2727. text-align: left;
  2728. flex: 1;
  2729. min-width: 0;
  2730. }
  2731. .order-pv-name-cell {
  2732. display: inline-flex;
  2733. align-items: center;
  2734. justify-content: center;
  2735. gap: 8px;
  2736. max-width: 100%;
  2737. }
  2738. .order-pv-name-text {
  2739. text-align: left;
  2740. flex: 1;
  2741. min-width: 0;
  2742. }
  2743. .order-pv-body {
  2744. min-height: 120px;
  2745. }
  2746. </style>
  2747. <!-- Teleport 到 body,需非 scoped 才能命中 .order-detail-dialog -->
  2748. <style lang="scss">
  2749. .order-module-dialog.el-dialog {
  2750. display: flex;
  2751. flex-direction: column;
  2752. max-height: calc(100vh - 64px);
  2753. }
  2754. .order-module-dialog .el-dialog__header {
  2755. flex-shrink: 0;
  2756. background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 70%);
  2757. }
  2758. .order-module-dialog .el-dialog__body {
  2759. flex: 1 1 auto;
  2760. min-height: 0;
  2761. padding: 0;
  2762. overflow: hidden;
  2763. }
  2764. .order-module-dialog .dialog-scroll {
  2765. height: min(720px, calc(100vh - 180px));
  2766. max-height: min(720px, calc(100vh - 180px));
  2767. overflow-y: auto;
  2768. overflow-x: hidden;
  2769. padding: 0;
  2770. }
  2771. .order-module-dialog .el-dialog__footer {
  2772. flex-shrink: 0;
  2773. background: #f8fafc;
  2774. }
  2775. .order-module-dialog .el-dialog__footer .el-button {
  2776. height: 36px;
  2777. border-radius: 8px;
  2778. font-weight: 600;
  2779. display: inline-flex;
  2780. align-items: center;
  2781. justify-content: center;
  2782. }
  2783. .order-module-dialog .el-dialog__footer .el-button .el-icon {
  2784. margin-right: 6px;
  2785. }
  2786. .order-module-dialog-mask {
  2787. backdrop-filter: none !important;
  2788. }
  2789. .order-view-hero {
  2790. align-items: center;
  2791. border-bottom: 1px solid #d9e8e2;
  2792. }
  2793. .order-view-hero-icon {
  2794. width: 72px;
  2795. height: 72px;
  2796. border-radius: 12px;
  2797. border: 1px solid rgba(16, 185, 129, 0.2);
  2798. background: rgba(16, 185, 129, 0.08);
  2799. color: #059669;
  2800. display: inline-flex;
  2801. align-items: center;
  2802. justify-content: center;
  2803. font-size: 28px;
  2804. flex: 0 0 auto;
  2805. }
  2806. .order-module-dialog .view-hero {
  2807. display: flex;
  2808. gap: 16px;
  2809. padding: 20px 22px;
  2810. background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 55%);
  2811. }
  2812. .order-module-dialog .view-hero-main h2 {
  2813. margin: 0 0 8px;
  2814. font-size: 18px;
  2815. font-weight: 700;
  2816. color: #1e293b;
  2817. }
  2818. .order-module-dialog .view-hero-tags {
  2819. display: flex;
  2820. align-items: center;
  2821. gap: 8px;
  2822. margin-bottom: 8px;
  2823. flex-wrap: wrap;
  2824. }
  2825. .order-module-dialog .view-hero-meta {
  2826. margin: 0;
  2827. font-size: 13px;
  2828. color: #64748b;
  2829. line-height: 1.5;
  2830. }
  2831. .order-module-dialog .view-hero-meta .dot {
  2832. margin: 0 6px;
  2833. opacity: 0.7;
  2834. }
  2835. .order-module-dialog .view-section {
  2836. padding: 18px 22px;
  2837. border-bottom: 1px solid #d9e8e2;
  2838. }
  2839. .order-module-dialog .view-section:last-child {
  2840. border-bottom: 0;
  2841. }
  2842. .order-module-dialog .view-section h3 {
  2843. margin: 0 0 14px;
  2844. font-size: 13px;
  2845. font-weight: 700;
  2846. letter-spacing: 0.06em;
  2847. color: #64748b;
  2848. }
  2849. .order-module-dialog .view-kv-grid {
  2850. display: grid;
  2851. grid-template-columns: repeat(2, minmax(0, 1fr));
  2852. gap: 12px 28px;
  2853. }
  2854. .order-module-dialog .view-kv {
  2855. display: grid;
  2856. grid-template-columns: 96px 1fr;
  2857. gap: 8px 12px;
  2858. font-size: 13px;
  2859. align-items: start;
  2860. }
  2861. .order-module-dialog .view-kv dt {
  2862. color: #64748b;
  2863. font-weight: 500;
  2864. }
  2865. .order-module-dialog .view-kv dd {
  2866. color: #1e293b;
  2867. word-break: break-word;
  2868. }
  2869. .order-module-dialog .view-kv.view-multiline {
  2870. grid-column: 1 / -1;
  2871. }
  2872. @media (max-width: 760px) {
  2873. .order-module-dialog .view-kv-grid {
  2874. grid-template-columns: 1fr;
  2875. }
  2876. .order-module-dialog .view-kv {
  2877. grid-template-columns: 1fr;
  2878. gap: 4px;
  2879. }
  2880. .order-module-dialog .view-kv.view-multiline {
  2881. grid-column: auto;
  2882. }
  2883. }
  2884. </style>