index.vue 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570
  1. <template>
  2. <view class="order-container">
  3. <erp-nav-bar title="ERP 下单" />
  4. <!-- 0. 全屏加载过渡 -->
  5. <view class="loading-state-full" v-if="isLoading">
  6. <view class="loading-anim-box">
  7. <view class="dot-spinner">
  8. <view class="dot"></view>
  9. <view class="dot"></view>
  10. <view class="dot"></view>
  11. </view>
  12. <text class="loading-text">正在同步 ERP 数据...</text>
  13. </view>
  14. </view>
  15. <!-- 1. 未登录状态 -->
  16. <view class="auth-waiting-full" v-else-if="!isLoggedIn">
  17. <view class="auth-card">
  18. <image class="auth-icon" src="https://img.icons8.com/color/192/hourglass-sand-top.png" mode="aspectFit">
  19. </image>
  20. <text class="auth-title">未登录</text>
  21. <text class="auth-desc">您还未登录账号,请先登录以后在进行下单操作</text>
  22. <button class="contact-btn" @click="goToLogin">前往登录</button>
  23. </view>
  24. </view>
  25. <!-- 2. 已登录但未分配授权客户 -->
  26. <view class="auth-waiting-full" v-else-if="!myInfo.authClientFRowIDs">
  27. <view class="auth-card">
  28. <image class="auth-icon" src="https://img.icons8.com/color/192/hourglass-sand-top.png" mode="aspectFit">
  29. </image>
  30. <text class="auth-title">待管理员授权</text>
  31. <text class="auth-desc">您的账户尚未获得下单权限,请联系管理员核准授权后即可进行下单操作。</text>
  32. <button class="contact-btn" @click="contactAdmin">联系管理员</button>
  33. </view>
  34. </view>
  35. <!-- 2.5 已授权但未选择客户:客户选择页 -->
  36. <view class="client-pick-full" v-else-if="waitingClientPick">
  37. <view class="pick-card">
  38. <text class="pick-title">选择下单客户</text>
  39. <text class="pick-desc">请选择本次下单的客户</text>
  40. <view class="pick-list">
  41. <view class="pick-item" v-for="(c, i) in myInfo.authClientList" :key="c.rowId || i"
  42. @click="selectClient(c)">
  43. <view class="pick-index">{{ i + 1 }}</view>
  44. <view class="pick-info">
  45. <text class="pick-name">{{ c.name || '-' }}</text>
  46. <text class="pick-code" v-if="c.num">{{ c.num }}</text>
  47. </view>
  48. <view class="pick-arrow">›</view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <!-- 3. 已登录且已分配授权客户:显示下单页面 -->
  54. <template v-else>
  55. <scroll-view scroll-y class="order-scroll-list" :show-scrollbar="false" :enhanced="true">
  56. <view class="list-wrapper">
  57. <!-- 已选客户信息 -->
  58. <view class="client-info-bar" v-if="selectedClientName">
  59. <text class="client-label">下单客户:</text>
  60. <text class="client-name-text">{{ selectedClientName }}</text>
  61. </view>
  62. <!-- 列表头部:仅在有数据时显示 -->
  63. <view class="list-header" v-if="selectedModels.length > 0">
  64. <view class="header-left">
  65. <text class="header-text" v-if="!batchMode">已选型号列表:</text>
  66. <text class="header-text" v-else>批量修改({{ selectedIds.length }}/{{ selectedModels.length
  67. }})</text>
  68. <view class="select-all-toggle" v-if="batchMode" @click="toggleSelectAll">
  69. <text class="select-all-icon" :class="{ checked: isAllSelected }">☐</text>
  70. <text class="select-all-text">{{ isAllSelected ? '取消全选' : '全选' }}</text>
  71. </view>
  72. </view>
  73. <view class="batch-toggle" :class="{ active: batchMode }" @click="toggleBatchMode">
  74. <text>{{ batchMode ? '退出' : '批量修改' }}</text>
  75. </view>
  76. </view>
  77. <!-- 1. 列表渲染 (精品化设计) -->
  78. <view class="model-item-card" v-for="(item, index) in selectedModels" :key="index"
  79. v-if="selectedModels.length > 0"
  80. :class="{ 'batch-mode-card': batchMode, 'batch-selected': batchMode && isSelected(item.rowId) }">
  81. <view class="batch-checkbox" v-if="batchMode" @click.stop="toggleSelect(item.rowId)">
  82. <view class="checkbox-circle" :class="{ checked: isSelected(item.rowId) }">
  83. <text class="check-icon" v-if="isSelected(item.rowId)">✓</text>
  84. </view>
  85. </view>
  86. <view class="card-body" @click="batchMode ? toggleSelect(item.rowId) : editItem(index, item)">
  87. <view class="remove-icon" @click.stop="removeItem(index)">
  88. <text class="x-icon">×</text>
  89. </view>
  90. <view class="card-line">
  91. <view class="model-info">
  92. <text class="model-value">{{ item.modelNum }}</text>
  93. </view>
  94. <view class="count-tag">
  95. 支数<text class="count-num">{{ item.count }}</text>
  96. </view>
  97. </view>
  98. <view class="card-line secondary">
  99. <text class="surface-label">表面名称:</text>
  100. <text class="surface-text">{{ item.surfaceName }}</text>
  101. </view>
  102. </view>
  103. </view>
  104. <!-- 2. 全屏缺省状态:美化后的引导页 -->
  105. <view class="empty-state-full" v-else>
  106. <view class="empty-visual">
  107. <image class="empty-img" src="https://img.icons8.com/clouds/200/shopping-cart.png"
  108. mode="aspectFit"></image>
  109. <view class="empty-bg-glow"></view>
  110. </view>
  111. <text class="empty-title">暂无已选型号</text>
  112. <button class="empty-action-btn" @click="goToAddModel">选型下单</button>
  113. </view>
  114. <view class="bottom-safe-space"></view>
  115. </view>
  116. </scroll-view>
  117. <!-- 悬浮添加按钮 (仅在有数据时且非批量模式显示) -->
  118. <view class="floating-add-btn" @click="goToAddModel" v-if="selectedModels.length > 0 && !batchMode">
  119. <view class="plus-icon"></view>
  120. </view>
  121. <!-- 批量操作栏(批量模式下常驻) -->
  122. <view class="batch-action-bar" v-if="batchMode">
  123. <view class="batch-count" v-if="selectedIds.length > 0">已选 {{ selectedIds.length }} 项</view>
  124. <view class="batch-count placeholder" v-else>请勾选型号</view>
  125. <view class="batch-btns">
  126. <button class="batch-btn surface-btn" :disabled="selectedIds.length === 0"
  127. @click="openBatchSurfacePicker">批量修改表面</button>
  128. <button class="batch-btn pack-btn" :disabled="selectedIds.length === 0"
  129. @click="openBatchPackPicker">批量修改包装</button>
  130. </view>
  131. </view>
  132. <!-- 底部支付/下单汇总栏 (仅在有数据时且非批量模式显示) -->
  133. <view class="footer-summary-bar" v-if="selectedModels.length > 0 && !batchMode">
  134. <view class="summary-info">
  135. <text class="count-label">共计:</text>
  136. <text class="num-highlight">{{ selectedModels.length }}</text>
  137. <text class="unit">条</text>
  138. <view class="split-line"></view>
  139. <text class="num-highlight green">{{ totalCount }}</text>
  140. <text class="unit">支</text>
  141. </view>
  142. <button class="submit-order-btn" :disabled="selectedModels.length === 0"
  143. @click="submitFinalOrder">立即下单</button>
  144. </view>
  145. </template>
  146. <!-- 批量修改 - 表面处理选择弹层 -->
  147. <view class="custom-picker-mask" v-if="showBatchSurfacePicker" @click="showBatchSurfacePicker = false"
  148. @touchmove.stop.prevent>
  149. <view class="picker-popup" @click.stop>
  150. <view class="popup-header">
  151. <text class="cancel-text" @click="showBatchSurfacePicker = false">取消</text>
  152. <text class="popup-title">选择表面处理</text>
  153. <text class="confirm-text" @click="confirmBatchSurface">确定</text>
  154. </view>
  155. <!-- 搜索栏 -->
  156. <view class="search-bar">
  157. <view class="search-input-wrap">
  158. <text class="search-icon">🔍</text>
  159. <input class="search-input" type="text" v-model="batchSurfaceSearchKey" placeholder="输入名称检索"
  160. @input="onBatchSurfaceSearch" />
  161. </view>
  162. </view>
  163. <!-- 层级面包屑 -->
  164. <view class="breadcrumb-bar" v-if="batchSurfaceLevel > 1">
  165. <text class="back-btn" @click="goBackBatchSurfaceLevel">← 返回</text>
  166. <text class="breadcrumb-path">{{batchSurfaceBreadcrumbs.map(b => b.label).join(' / ')}}</text>
  167. </view>
  168. <!-- 列表区 -->
  169. <scroll-view scroll-y class="item-list">
  170. <view class="option-item kind-item" v-for="(item, index) in batchSurfaceKindList"
  171. :key="'bsk' + index" @click="drillDownBatchSurface(item)">
  172. <text class="option-text kind-text">{{ item.num }} - {{ item.name }}</text>
  173. <text class="arrow-right">›</text>
  174. </view>
  175. <view class="option-item" v-for="item in batchSurfaceItemList" :key="'bsi' + item.rowId"
  176. :class="{ active: batchSurfaceId === item.rowId }">
  177. <text class="option-text" @click="selectBatchSurfaceItem(item)">{{ item.num }} - {{ item.name
  178. }}</text>
  179. </view>
  180. </scroll-view>
  181. </view>
  182. </view>
  183. <!-- 批量修改 - 包装方式选择弹层 -->
  184. <view class="custom-picker-mask" v-if="showBatchPackPicker" @click="showBatchPackPicker = false"
  185. @touchmove.stop.prevent>
  186. <view class="picker-popup" @click.stop>
  187. <view class="popup-header">
  188. <text class="cancel-text" @click="showBatchPackPicker = false">取消</text>
  189. <text class="popup-title">选择包装方式</text>
  190. <text class="confirm-text" @click="confirmBatchPack">确定</text>
  191. </view>
  192. <view class="search-bar">
  193. <view class="search-input-wrap">
  194. <text class="search-icon">🔍</text>
  195. <input class="search-input" type="text" v-model="batchPackSearchKey" placeholder="输入名称检索"
  196. @input="onBatchPackSearch" />
  197. </view>
  198. </view>
  199. <scroll-view scroll-y class="item-list" @scrolltolower="loadMorePackBatch">
  200. <view class="option-item" v-for="item in batchPackList" :key="item.rowId"
  201. :class="{ active: batchPackId === item.rowId }"
  202. @click="batchPackId = item.rowId; batchPackName = item.name">
  203. <text>{{ item.num }} - {{ item.name }}</text>
  204. <icon type="success_no_circle" size="16" color="#C1001C" v-if="batchPackId === item.rowId">
  205. </icon>
  206. </view>
  207. </scroll-view>
  208. </view>
  209. </view>
  210. <order-confirm-popup :visible="showConfirmPopup" :models="selectedModels" :clientName="confirmClientName"
  211. :submitting="confirmSubmitting" @confirm="handleConfirmOrder" @close="showConfirmPopup = false" />
  212. </view>
  213. </template>
  214. <script>
  215. import ErpNavBar from '@/components/erp-nav-bar.vue';
  216. import OrderConfirmPopup from './components/order-confirm-popup.vue';
  217. import { getMyInfo } from '@/api/system/employee.js';
  218. import { getClientByIds } from '@/api/erp/client.js';
  219. import { listOrderDetail, batchUpdateOrderDetail } from '@/api/erp/orderDetail.js';
  220. import { listColor } from '@/api/erp/color.js';
  221. import { listColorKind } from '@/api/erp/colorKind.js';
  222. import { listPagePack } from '@/api/erp/pack.js';
  223. import { addOrder } from '@/api/erp/order.js';
  224. export default {
  225. components: { ErpNavBar, OrderConfirmPopup },
  226. data() {
  227. return {
  228. isLoggedIn: false,
  229. isLoading: true,
  230. myInfo: {},
  231. selectedModels: [],
  232. selectedClientId: '',
  233. selectedClientName: '',
  234. waitingClientPick: false,
  235. clientIdParam: '',
  236. clientNameParam: '',
  237. // 批量修改相关
  238. batchMode: false,
  239. selectedIds: [],
  240. // 表面处理选择器
  241. showBatchSurfacePicker: false,
  242. batchSurfaceId: '',
  243. batchSurfaceName: '',
  244. batchSurfaceSearchKey: '',
  245. batchSurfaceBreadcrumbs: [],
  246. batchSurfaceLevel: 1,
  247. batchSurfaceKindList: [],
  248. batchSurfaceItemList: [],
  249. // 包装方式选择器
  250. showBatchPackPicker: false,
  251. batchPackList: [],
  252. batchPackPageNum: 1,
  253. batchPackHasMore: true,
  254. batchPackLoading: false,
  255. batchPackId: '',
  256. batchPackName: '',
  257. batchPackSearchKey: '',
  258. batchPackSearchTimer: null,
  259. showConfirmPopup: false,
  260. confirmClientId: '',
  261. confirmClientName: '',
  262. confirmSubmitting: false
  263. }
  264. },
  265. computed: {
  266. totalCount() {
  267. return this.selectedModels.reduce((sum, item) => sum + parseInt(item.count || 0), 0);
  268. },
  269. isAllSelected() {
  270. return this.selectedModels.length > 0 && this.selectedIds.length === this.selectedModels.length;
  271. }
  272. },
  273. onLoad(options) {
  274. if (options.clientId) this.clientIdParam = options.clientId;
  275. if (options.clientName) this.clientNameParam = decodeURIComponent(options.clientName);
  276. uni.$on('add_order_item', (data) => {
  277. this.loadOrderItems(false);
  278. });
  279. uni.$on('update_order_item', (res) => {
  280. this.loadOrderItems(false);
  281. });
  282. },
  283. onShow() {
  284. this.checkLoginStatus();
  285. },
  286. onUnload() {
  287. uni.$off('add_order_item');
  288. uni.$off('update_order_item');
  289. },
  290. methods: {
  291. /**
  292. * 加载已选型号列表(OrderID 为空的草稿)
  293. * @Author: Antigravity
  294. */
  295. async loadOrderItems(showFullLoading = true) {
  296. if (showFullLoading) this.isLoading = true;
  297. try {
  298. const res = await listOrderDetail({
  299. orderId: '',
  300. placer: this.myInfo.id || '',
  301. clientId: this.selectedClientId || ''
  302. });
  303. this.selectedModels = res.data || [];
  304. } catch (e) {
  305. console.error('加载型号列表失败', e);
  306. uni.showToast({ title: e || '加载型号列表失败', icon: 'none' });
  307. } finally {
  308. this.isLoading = false;
  309. }
  310. },
  311. async checkLoginStatus() {
  312. const token = uni.getStorageSync('token');
  313. if (!token) {
  314. this.isLoggedIn = false;
  315. this.myInfo = {};
  316. this.selectedClientId = '';
  317. this.selectedClientName = '';
  318. this.waitingClientPick = false;
  319. this.isLoading = false;
  320. return;
  321. }
  322. try {
  323. const res = await getMyInfo();
  324. this.isLoggedIn = true;
  325. const info = res.data || {};
  326. if (info.authClientFRowIDs) {
  327. try {
  328. const clientRes = await getClientByIds(info.authClientFRowIDs);
  329. info.authClientList = clientRes.data || [];
  330. } catch (e) {
  331. console.error('加载授权客户失败', e);
  332. info.authClientList = [];
  333. }
  334. } else {
  335. info.authClientList = [];
  336. }
  337. this.myInfo = info;
  338. this.resolveClient();
  339. this.loadOrderItems();
  340. } catch (e) {
  341. uni.showToast({ title: e || '登录状态校验失败', icon: 'none' });
  342. uni.removeStorageSync('token');
  343. uni.removeStorageSync('isLogin');
  344. this.isLoggedIn = false;
  345. this.myInfo = {};
  346. this.selectedClientId = '';
  347. this.selectedClientName = '';
  348. this.waitingClientPick = false;
  349. this.isLoading = false;
  350. }
  351. },
  352. resolveClient() {
  353. const clientList = this.myInfo.authClientList || [];
  354. if (clientList.length === 0) {
  355. this.waitingClientPick = false;
  356. return;
  357. }
  358. if (this.clientIdParam) {
  359. const matched = clientList.find(c => c.rowId === this.clientIdParam);
  360. if (matched) {
  361. this.selectedClientId = matched.rowId;
  362. this.selectedClientName = matched.name;
  363. this.waitingClientPick = false;
  364. return;
  365. }
  366. }
  367. if (clientList.length === 1) {
  368. this.selectedClientId = clientList[0].rowId;
  369. this.selectedClientName = clientList[0].name;
  370. this.waitingClientPick = false;
  371. } else {
  372. this.waitingClientPick = true;
  373. }
  374. },
  375. selectClient(client) {
  376. this.selectedClientId = client.rowId;
  377. this.selectedClientName = client.name;
  378. this.waitingClientPick = false;
  379. },
  380. goToLogin() {
  381. uni.reLaunch({ url: '/pages/login/index' });
  382. },
  383. contactAdmin() { uni.showModal({ title: '联系管理员', content: '管理员电话:138-0000-0000', showCancel: false, confirmColor: '#C1001C' }); },
  384. goToAddModel() {
  385. const placer = this.myInfo.id || '';
  386. const clientId = this.selectedClientId || '';
  387. uni.navigateTo({
  388. url: `/pages/order/add-model/index?placer=${placer}&clientId=${clientId}`
  389. });
  390. },
  391. editItem(index, item) {
  392. uni.navigateTo({
  393. url: `/pages/order/edit-model/index?index=${index}&data=${encodeURIComponent(JSON.stringify(item))}`
  394. });
  395. },
  396. removeItem(index) {
  397. const self = this;
  398. uni.showModal({
  399. title: '提示',
  400. content: '确定移除该型号吗?',
  401. success: (res) => {
  402. if (res.confirm) {
  403. self.selectedModels.splice(index, 1);
  404. }
  405. }
  406. });
  407. },
  408. /**
  409. * 切换全选 / 取消全选
  410. * @Author: Trae
  411. */
  412. toggleSelectAll() {
  413. if (this.isAllSelected) {
  414. this.selectedIds = [];
  415. } else {
  416. this.selectedIds = this.selectedModels.map(item => item.rowId);
  417. }
  418. },
  419. /**
  420. * 切换批量修改模式
  421. * @Author: Trae
  422. */
  423. toggleBatchMode() {
  424. this.batchMode = !this.batchMode;
  425. if (!this.batchMode) {
  426. this.selectedIds = [];
  427. }
  428. },
  429. /**
  430. * 切换选中状态
  431. * @Author: Trae
  432. */
  433. toggleSelect(rowId) {
  434. const idx = this.selectedIds.indexOf(rowId);
  435. if (idx > -1) {
  436. this.selectedIds.splice(idx, 1);
  437. } else {
  438. this.selectedIds.push(rowId);
  439. }
  440. },
  441. /**
  442. * 判断是否已选中
  443. * @Author: Trae
  444. */
  445. isSelected(rowId) {
  446. return this.selectedIds.indexOf(rowId) > -1;
  447. },
  448. /**
  449. * 打开批量修改表面处理选择器(二级级联)
  450. * @Author: Trae
  451. */
  452. openBatchSurfacePicker() {
  453. if (this.selectedIds.length === 0) {
  454. uni.showToast({ title: '请先选择型号', icon: 'none' });
  455. return;
  456. }
  457. this.showBatchSurfacePicker = true;
  458. this.batchSurfaceId = '';
  459. this.batchSurfaceName = '';
  460. this.batchSurfaceSearchKey = '';
  461. this.batchSurfaceLevel = 1;
  462. this.batchSurfaceBreadcrumbs = [];
  463. this.loadBatchSurfaceList('');
  464. },
  465. /**
  466. * 加载表面处理系列,点击系列后同时加载子系列和具体颜色(批量选择器)
  467. * @Author: Trae
  468. */
  469. async loadBatchSurfaceList(parentRowId) {
  470. try {
  471. const keyword = (this.batchSurfaceSearchKey || '').trim();
  472. const kindParams = { name: keyword || undefined };
  473. if (parentRowId) {
  474. kindParams.parentRowId = parentRowId;
  475. }
  476. const kindRes = await listColorKind(kindParams);
  477. this.batchSurfaceKindList = kindRes.data || [];
  478. if (parentRowId) {
  479. const colorParams = { name: keyword || undefined, parentRowId };
  480. const colorRes = await listColor(colorParams);
  481. this.batchSurfaceItemList = colorRes.data || [];
  482. } else {
  483. this.batchSurfaceItemList = [];
  484. }
  485. } catch (e) {
  486. uni.showToast({ title: e || '加载表面处理失败', icon: 'none' });
  487. }
  488. },
  489. /**
  490. * 表面处理搜索
  491. * @Author: Trae
  492. */
  493. onBatchSurfaceSearch() {
  494. const parentRowId = this.batchSurfaceBreadcrumbs.length > 0
  495. ? this.batchSurfaceBreadcrumbs[this.batchSurfaceBreadcrumbs.length - 1].rowId : '';
  496. this.loadBatchSurfaceList(parentRowId);
  497. },
  498. selectBatchSurfaceItem(item) {
  499. this.batchSurfaceId = item.rowId;
  500. this.batchSurfaceName = item.name;
  501. },
  502. drillDownBatchSurface(item) {
  503. this.batchSurfaceBreadcrumbs.push({ rowId: item.rowId, label: item.num });
  504. this.batchSurfaceId = '';
  505. this.batchSurfaceName = '';
  506. this.batchSurfaceLevel++;
  507. this.loadBatchSurfaceList(item.rowId);
  508. },
  509. goBackBatchSurfaceLevel() {
  510. this.batchSurfaceBreadcrumbs.pop();
  511. this.batchSurfaceLevel--;
  512. this.batchSurfaceId = '';
  513. this.batchSurfaceName = '';
  514. const parentRowId = this.batchSurfaceBreadcrumbs.length > 0
  515. ? this.batchSurfaceBreadcrumbs[this.batchSurfaceBreadcrumbs.length - 1].rowId : '';
  516. this.loadBatchSurfaceList(parentRowId);
  517. },
  518. /**
  519. * 确认批量修改表面处理
  520. * @Author: Trae
  521. */
  522. async confirmBatchSurface() {
  523. if (!this.batchSurfaceId) {
  524. uni.showToast({ title: '请选择表面处理', icon: 'none' });
  525. return;
  526. }
  527. this.showBatchSurfacePicker = false;
  528. uni.showLoading({ title: '修改中...', mask: true });
  529. try {
  530. await batchUpdateOrderDetail({
  531. rowIds: this.selectedIds,
  532. surfaceId: this.batchSurfaceId,
  533. surfaceName: this.batchSurfaceName
  534. });
  535. uni.hideLoading();
  536. uni.showToast({ title: '修改成功', icon: 'success' });
  537. this.selectedIds = [];
  538. this.loadOrderItems(false);
  539. } catch (e) {
  540. uni.hideLoading();
  541. uni.showToast({ title: e || '修改失败', icon: 'none' });
  542. }
  543. this.batchSurfaceLevel = 1;
  544. this.batchSurfaceBreadcrumbs = [];
  545. this.batchSurfaceId = '';
  546. this.batchSurfaceName = '';
  547. },
  548. /**
  549. * 打开批量修改包装方式选择器
  550. * @Author: Trae
  551. */
  552. openBatchPackPicker() {
  553. if (this.selectedIds.length === 0) {
  554. uni.showToast({ title: '请先选择型号', icon: 'none' });
  555. return;
  556. }
  557. this.showBatchPackPicker = true;
  558. this.batchPackId = '';
  559. this.batchPackName = '';
  560. this.batchPackSearchKey = '';
  561. this.batchPackPageNum = 1;
  562. if (this.batchPackList.length === 0) {
  563. this.loadBatchPackList();
  564. }
  565. },
  566. /**
  567. * 加载包装方式列表(批量选择器)
  568. * @Author: Trae
  569. */
  570. async loadBatchPackList(pageNum = 1, keyword = '') {
  571. if (this.batchPackLoading) return;
  572. this.batchPackLoading = true;
  573. try {
  574. const res = await listPagePack({
  575. pageNum,
  576. pageSize: 10,
  577. name: keyword || undefined
  578. });
  579. const rows = res.rows || [];
  580. if (pageNum === 1) {
  581. this.batchPackList = rows;
  582. } else {
  583. this.batchPackList = [...this.batchPackList, ...rows];
  584. }
  585. this.batchPackHasMore = rows.length >= 20;
  586. } catch (e) {
  587. uni.showToast({ title: e || '加载包装方式失败', icon: 'none' });
  588. } finally {
  589. this.batchPackLoading = false;
  590. }
  591. },
  592. /**
  593. * 加载更多包装方式列表
  594. * @Author: Trae
  595. */
  596. loadMorePackBatch() {
  597. if (!this.batchPackHasMore || this.batchPackLoading) return;
  598. this.batchPackPageNum++;
  599. this.loadBatchPackList(this.batchPackPageNum, this.batchPackSearchKey);
  600. },
  601. /**
  602. * 包装方式搜索(防抖)
  603. * @Author: Trae
  604. */
  605. onBatchPackSearch() {
  606. if (this.batchPackSearchTimer) clearTimeout(this.batchPackSearchTimer);
  607. this.batchPackSearchTimer = setTimeout(() => {
  608. this.batchPackPageNum = 1;
  609. this.loadBatchPackList(1, this.batchPackSearchKey);
  610. }, 300);
  611. },
  612. /**
  613. * 确认批量修改包装方式
  614. * @Author: Trae
  615. */
  616. async confirmBatchPack() {
  617. if (!this.batchPackId) {
  618. uni.showToast({ title: '请选择包装方式', icon: 'none' });
  619. return;
  620. }
  621. this.showBatchPackPicker = false;
  622. uni.showLoading({ title: '修改中...', mask: true });
  623. try {
  624. await batchUpdateOrderDetail({
  625. rowIds: this.selectedIds,
  626. packId: this.batchPackId,
  627. packName: this.batchPackName
  628. });
  629. uni.hideLoading();
  630. uni.showToast({ title: '修改成功', icon: 'success' });
  631. this.selectedIds = [];
  632. this.loadOrderItems(false);
  633. } catch (e) {
  634. uni.hideLoading();
  635. uni.showToast({ title: e || '修改失败', icon: 'none' });
  636. }
  637. },
  638. /**
  639. * 提交最终订单 - 选择客户后弹出确认弹窗
  640. * @Author: Antigravity
  641. */
  642. async submitFinalOrder() {
  643. if (this.selectedModels.length === 0) return;
  644. if (!this.selectedClientId) {
  645. uni.showToast({ title: '请先选择下单客户', icon: 'none' });
  646. return;
  647. }
  648. this.confirmClientId = this.selectedClientId;
  649. this.confirmClientName = this.selectedClientName;
  650. this.showConfirmPopup = true;
  651. },
  652. /**
  653. * 确认弹窗回调 - 正式执行下单
  654. * @Author: Trae
  655. */
  656. async handleConfirmOrder() {
  657. this.confirmSubmitting = true;
  658. uni.showLoading({ title: '正在提交订单', mask: true });
  659. try {
  660. const detailIds = this.selectedModels.map(item => item.rowId);
  661. const submitRes = await addOrder({
  662. detailIds,
  663. clientId: this.confirmClientId,
  664. clientName: this.confirmClientName
  665. });
  666. uni.hideLoading();
  667. this.confirmSubmitting = false;
  668. this.showConfirmPopup = false;
  669. const orderId = submitRes.data;
  670. uni.showToast({ title: '下单成功', icon: 'success' });
  671. const query = `orderId=${orderId}&clientId=${encodeURIComponent(this.confirmClientId || '')}&clientName=${encodeURIComponent(this.confirmClientName || '')}`;
  672. setTimeout(() => {
  673. uni.navigateTo({
  674. url: '/pages/order/success/index?' + query
  675. });
  676. }, 1500);
  677. } catch (e) {
  678. uni.hideLoading();
  679. this.confirmSubmitting = false;
  680. uni.showToast({ title: e || '下单失败', icon: 'none' });
  681. }
  682. }
  683. }
  684. }
  685. </script>
  686. <style scoped>
  687. /deep/ ::-webkit-scrollbar {
  688. display: none !important;
  689. width: 0 !important;
  690. height: 0 !important;
  691. }
  692. .order-container {
  693. width: 100%;
  694. height: 100vh;
  695. background: #f8fafc;
  696. display: flex;
  697. flex-direction: column;
  698. overflow: hidden;
  699. }
  700. /* 授权等待样式保持一致 */
  701. .auth-waiting-full {
  702. flex: 1;
  703. display: flex;
  704. flex-direction: column;
  705. align-items: center;
  706. justify-content: flex-start;
  707. padding: 200rpx 40rpx 40rpx;
  708. background: linear-gradient(180deg, rgba(0, 122, 255, 0.08) 0%, rgba(247, 248, 250, 1) 100%);
  709. }
  710. .auth-card {
  711. display: flex;
  712. flex-direction: column;
  713. align-items: center;
  714. text-align: center;
  715. }
  716. .auth-icon {
  717. width: 200rpx;
  718. height: 200rpx;
  719. margin-bottom: 50rpx;
  720. }
  721. .auth-title {
  722. font-size: 44rpx;
  723. font-weight: bold;
  724. color: #1a1a1a;
  725. margin-bottom: 24rpx;
  726. }
  727. .auth-desc {
  728. font-size: 28rpx;
  729. color: #666;
  730. line-height: 1.8;
  731. margin-bottom: 80rpx;
  732. padding: 0 20rpx;
  733. }
  734. .contact-btn {
  735. width: 360rpx;
  736. height: 96rpx;
  737. background: linear-gradient(135deg, #C1001C 0%, #FF4D4F 100%);
  738. color: #fff;
  739. border-radius: 48rpx;
  740. display: flex;
  741. align-items: center;
  742. justify-content: center;
  743. font-size: 32rpx;
  744. font-weight: bold;
  745. border: none;
  746. box-shadow: 0 12rpx 30rpx rgba(193, 0, 28, 0.2);
  747. }
  748. .authorized-btn {
  749. width: 360rpx;
  750. height: 96rpx;
  751. background: #fff;
  752. color: #C1001C;
  753. border-radius: 48rpx;
  754. display: flex;
  755. align-items: center;
  756. justify-content: center;
  757. font-size: 32rpx;
  758. font-weight: bold;
  759. border: 2rpx solid #C1001C;
  760. margin-top: 30rpx;
  761. }
  762. /* 客户选择页 */
  763. .client-pick-full {
  764. flex: 1;
  765. display: flex;
  766. flex-direction: column;
  767. align-items: center;
  768. padding: 80rpx 40rpx;
  769. background: #f7f8fa;
  770. }
  771. .pick-card {
  772. width: 100%;
  773. max-width: 680rpx;
  774. background: #fff;
  775. border-radius: 24rpx;
  776. padding: 48rpx 36rpx 36rpx;
  777. box-shadow: 0 4rpx 24rpx rgba(0, 0, 0, 0.04);
  778. }
  779. .pick-title {
  780. display: block;
  781. font-size: 36rpx;
  782. font-weight: 700;
  783. color: #1a1a1a;
  784. text-align: center;
  785. margin-bottom: 12rpx;
  786. }
  787. .pick-desc {
  788. display: block;
  789. font-size: 26rpx;
  790. color: #999;
  791. text-align: center;
  792. margin-bottom: 36rpx;
  793. }
  794. .pick-list {
  795. display: flex;
  796. flex-direction: column;
  797. gap: 16rpx;
  798. }
  799. .pick-item {
  800. display: flex;
  801. align-items: center;
  802. padding: 28rpx 24rpx;
  803. border-radius: 16rpx;
  804. background: #f9fafb;
  805. transition: background 0.15s;
  806. }
  807. .pick-item:active {
  808. background: #f0f1f5;
  809. }
  810. .pick-index {
  811. width: 48rpx;
  812. height: 48rpx;
  813. border-radius: 12rpx;
  814. background: #eef0f4;
  815. color: #888;
  816. font-size: 24rpx;
  817. font-weight: 700;
  818. display: flex;
  819. align-items: center;
  820. justify-content: center;
  821. margin-right: 20rpx;
  822. flex-shrink: 0;
  823. }
  824. .pick-info {
  825. flex: 1;
  826. display: flex;
  827. flex-direction: column;
  828. min-width: 0;
  829. }
  830. .pick-name {
  831. font-size: 30rpx;
  832. font-weight: 600;
  833. color: #333;
  834. overflow: hidden;
  835. text-overflow: ellipsis;
  836. white-space: nowrap;
  837. }
  838. .pick-code {
  839. font-size: 24rpx;
  840. color: #bbb;
  841. margin-top: 4rpx;
  842. }
  843. .pick-arrow {
  844. font-size: 36rpx;
  845. color: #ccc;
  846. margin-left: 12rpx;
  847. }
  848. /* 已授权列表页样式 */
  849. .order-container {
  850. width: 100%;
  851. height: 100vh;
  852. background: #f7f8fa;
  853. display: flex;
  854. flex-direction: column;
  855. overflow: hidden;
  856. }
  857. .order-scroll-list {
  858. flex: 1;
  859. height: 0;
  860. }
  861. .list-wrapper {
  862. padding: 30rpx;
  863. padding-bottom: 30rpx;
  864. }
  865. .list-header {
  866. padding: 10rpx 0 20rpx;
  867. display: flex;
  868. align-items: center;
  869. justify-content: space-between;
  870. flex-wrap: wrap;
  871. gap: 10rpx;
  872. }
  873. .header-left {
  874. display: flex;
  875. align-items: center;
  876. gap: 16rpx;
  877. }
  878. .header-text {
  879. font-size: 34rpx;
  880. font-weight: bold;
  881. color: #1a1a1a;
  882. position: relative;
  883. padding-left: 24rpx;
  884. }
  885. .header-text::before {
  886. content: '';
  887. position: absolute;
  888. left: 0;
  889. top: 10%;
  890. height: 80%;
  891. width: 8rpx;
  892. background: #C1001C;
  893. border-radius: 4rpx;
  894. }
  895. .select-all-toggle {
  896. display: flex;
  897. align-items: center;
  898. gap: 6rpx;
  899. padding: 6rpx 16rpx;
  900. background: #f5f5f5;
  901. border-radius: 20rpx;
  902. }
  903. .select-all-icon {
  904. font-size: 28rpx;
  905. color: #999;
  906. }
  907. .select-all-icon.checked {
  908. color: #C1001C;
  909. }
  910. .select-all-text {
  911. font-size: 22rpx;
  912. color: #666;
  913. }
  914. /* 型号卡片:大幅升级美化 */
  915. .model-item-card {
  916. background: #fff;
  917. border-radius: 24rpx;
  918. padding: 36rpx;
  919. margin-bottom: 30rpx;
  920. position: relative;
  921. box-shadow: 0 8rpx 30rpx rgba(0, 0, 0, 0.04);
  922. border: 1rpx solid rgba(0, 0, 0, 0.02);
  923. display: flex;
  924. align-items: stretch;
  925. transition: border 0.25s, background 0.25s, transform 0.15s;
  926. }
  927. .model-item-card.batch-mode-card {
  928. padding-left: 20rpx;
  929. gap: 16rpx;
  930. }
  931. .batch-checkbox {
  932. display: flex;
  933. align-items: center;
  934. justify-content: center;
  935. padding-top: 6rpx;
  936. flex-shrink: 0;
  937. }
  938. .checkbox-circle {
  939. width: 44rpx;
  940. height: 44rpx;
  941. border-radius: 50%;
  942. border: 2rpx solid #ddd;
  943. display: flex;
  944. align-items: center;
  945. justify-content: center;
  946. background: #fff;
  947. transition: all 0.2s;
  948. }
  949. .checkbox-circle.checked {
  950. background: #C1001C;
  951. border-color: #C1001C;
  952. }
  953. .check-icon {
  954. font-size: 26rpx;
  955. color: #fff;
  956. font-weight: bold;
  957. }
  958. .card-body {
  959. flex: 1;
  960. min-width: 0;
  961. position: relative;
  962. }
  963. .remove-icon {
  964. position: absolute;
  965. right: -36rpx;
  966. top: -36rpx;
  967. width: 50rpx;
  968. height: 50rpx;
  969. background: rgba(255, 77, 79, 0.1);
  970. border-radius: 0 24rpx 0 24rpx;
  971. display: flex;
  972. align-items: center;
  973. justify-content: center;
  974. z-index: 5;
  975. }
  976. .x-icon {
  977. font-size: 32rpx;
  978. color: #ff4d4f;
  979. font-weight: bold;
  980. }
  981. .card-line {
  982. display: flex;
  983. align-items: center;
  984. margin-bottom: 20rpx;
  985. }
  986. .card-line.secondary {
  987. margin-bottom: 0;
  988. padding-top: 20rpx;
  989. border-top: 1rpx dashed #f0f0f0;
  990. }
  991. .model-value {
  992. font-size: 34rpx;
  993. font-weight: bold;
  994. color: #333;
  995. flex: 1;
  996. }
  997. .count-tag {
  998. background: #FFF1F2;
  999. color: #C1001C;
  1000. padding: 4rpx 16rpx;
  1001. border-radius: 8rpx;
  1002. font-size: 24rpx;
  1003. font-weight: bold;
  1004. }
  1005. .count-num {
  1006. font-size: 30rpx;
  1007. margin-left: 8rpx;
  1008. }
  1009. .surface-label {
  1010. font-size: 26rpx;
  1011. color: #999;
  1012. }
  1013. .surface-text {
  1014. font-size: 28rpx;
  1015. color: #666;
  1016. }
  1017. /* 悬浮添加按钮:位置上移避免拥挤 */
  1018. .floating-add-btn {
  1019. position: fixed;
  1020. right: 40rpx;
  1021. bottom: calc(150rpx + env(safe-area-inset-bottom));
  1022. width: 110rpx;
  1023. height: 110rpx;
  1024. background: #C1001C;
  1025. border-radius: 50%;
  1026. display: flex;
  1027. align-items: center;
  1028. justify-content: center;
  1029. box-shadow: 0 12rpx 40rpx rgba(193, 0, 28, 0.4);
  1030. z-index: 100;
  1031. transition: transform 0.2s;
  1032. }
  1033. .floating-add-btn:active {
  1034. transform: scale(0.9);
  1035. }
  1036. .plus-icon {
  1037. width: 40rpx;
  1038. height: 4rpx;
  1039. background: #fff;
  1040. border-radius: 2rpx;
  1041. position: relative;
  1042. }
  1043. .plus-icon::after {
  1044. content: '';
  1045. position: absolute;
  1046. top: 0;
  1047. left: 0;
  1048. width: 100%;
  1049. height: 100%;
  1050. background: #fff;
  1051. transform: rotate(90deg);
  1052. border-radius: 2rpx;
  1053. }
  1054. /* 底部汇总栏:微调间距与样式 */
  1055. .footer-summary-bar {
  1056. position: fixed;
  1057. bottom: 0;
  1058. left: 0;
  1059. width: 100%;
  1060. background: #fff;
  1061. border-top: 1rpx solid #f0f0f0;
  1062. display: flex;
  1063. align-items: center;
  1064. justify-content: space-between;
  1065. padding: 20rpx 40rpx;
  1066. padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  1067. box-sizing: border-box;
  1068. z-index: 99;
  1069. box-shadow: 0 -10rpx 40rpx rgba(0, 0, 0, 0.05);
  1070. }
  1071. .summary-info {
  1072. display: flex;
  1073. align-items: center;
  1074. }
  1075. .count-label {
  1076. font-size: 26rpx;
  1077. color: #999;
  1078. }
  1079. .num-highlight {
  1080. font-size: 36rpx;
  1081. font-weight: bold;
  1082. color: #1a1a1a;
  1083. margin: 0 4rpx;
  1084. }
  1085. .num-highlight.green {
  1086. color: #C1001C;
  1087. }
  1088. .unit {
  1089. font-size: 24rpx;
  1090. color: #999;
  1091. margin-left: 2rpx;
  1092. }
  1093. .split-line {
  1094. width: 1rpx;
  1095. height: 30rpx;
  1096. background: #eee;
  1097. margin: 0 20rpx;
  1098. }
  1099. .submit-order-btn {
  1100. width: 220rpx;
  1101. height: 80rpx;
  1102. background: #e0e0e0;
  1103. color: #666;
  1104. font-size: 28rpx;
  1105. border-radius: 40rpx;
  1106. display: flex;
  1107. align-items: center;
  1108. justify-content: center;
  1109. border: none;
  1110. margin: 0;
  1111. transition: all 0.3s;
  1112. }
  1113. .submit-order-btn:not([disabled]) {
  1114. background: #C1001C;
  1115. color: #fff;
  1116. font-weight: bold;
  1117. }
  1118. /* 全屏缺省页样式 */
  1119. .empty-state-full {
  1120. display: flex;
  1121. flex-direction: column;
  1122. align-items: center;
  1123. justify-content: center;
  1124. padding-top: 120rpx;
  1125. }
  1126. .empty-visual {
  1127. position: relative;
  1128. margin-bottom: 40rpx;
  1129. width: 400rpx;
  1130. height: 400rpx;
  1131. display: flex;
  1132. align-items: center;
  1133. justify-content: center;
  1134. }
  1135. .empty-img {
  1136. width: 320rpx;
  1137. height: 320rpx;
  1138. z-index: 2;
  1139. }
  1140. .empty-bg-glow {
  1141. position: absolute;
  1142. width: 240rpx;
  1143. height: 240rpx;
  1144. background: radial-gradient(circle, rgba(193, 0, 28, 0.15) 0%, rgba(248, 250, 252, 0) 70%);
  1145. z-index: 1;
  1146. border-radius: 50%;
  1147. }
  1148. .empty-title {
  1149. font-size: 36rpx;
  1150. font-weight: bold;
  1151. color: #1a1a1a;
  1152. margin-bottom: 80rpx;
  1153. }
  1154. .empty-desc {
  1155. font-size: 26rpx;
  1156. color: #999;
  1157. margin-bottom: 60rpx;
  1158. text-align: center;
  1159. padding: 0 80rpx;
  1160. line-height: 1.6;
  1161. }
  1162. .empty-action-btn {
  1163. width: 320rpx;
  1164. height: 90rpx;
  1165. background: #C1001C;
  1166. color: #fff;
  1167. border-radius: 45rpx;
  1168. font-size: 30rpx;
  1169. font-weight: bold;
  1170. display: flex;
  1171. align-items: center;
  1172. justify-content: center;
  1173. box-shadow: 0 10rpx 30rpx rgba(193, 0, 28, 0.2);
  1174. border: none;
  1175. }
  1176. .empty-action-btn:active {
  1177. opacity: 0.8;
  1178. transform: scale(0.96);
  1179. }
  1180. .bottom-safe-space {
  1181. height: calc(140rpx + env(safe-area-inset-bottom));
  1182. }
  1183. /* 加载动画样式 */
  1184. .loading-state-full {
  1185. flex: 1;
  1186. display: flex;
  1187. align-items: center;
  1188. justify-content: center;
  1189. padding-bottom: 200rpx;
  1190. }
  1191. .loading-anim-box {
  1192. display: flex;
  1193. flex-direction: column;
  1194. align-items: center;
  1195. }
  1196. .dot-spinner {
  1197. display: flex;
  1198. justify-content: center;
  1199. align-items: center;
  1200. margin-bottom: 30rpx;
  1201. }
  1202. .dot {
  1203. width: 16rpx;
  1204. height: 16rpx;
  1205. background-color: #C1001C;
  1206. border-radius: 50%;
  1207. margin: 0 8rpx;
  1208. animation: dot-pulse 1.4s infinite ease-in-out both;
  1209. }
  1210. .dot:nth-child(1) {
  1211. animation-delay: -0.32s;
  1212. }
  1213. .dot:nth-child(2) {
  1214. animation-delay: -0.16s;
  1215. }
  1216. @keyframes dot-pulse {
  1217. 0%,
  1218. 80%,
  1219. 100% {
  1220. transform: scale(0);
  1221. opacity: 0.3;
  1222. }
  1223. 40% {
  1224. transform: scale(1);
  1225. opacity: 1;
  1226. }
  1227. }
  1228. .loading-text {
  1229. font-size: 26rpx;
  1230. color: #999;
  1231. letter-spacing: 2rpx;
  1232. }
  1233. /* 已选客户信息栏 */
  1234. .client-info-bar {
  1235. display: flex;
  1236. align-items: center;
  1237. padding: 24rpx 32rpx;
  1238. margin-bottom: 20rpx;
  1239. background: linear-gradient(135deg, #FFF1F2 0%, #FFFFFF 100%);
  1240. border-radius: 16rpx;
  1241. border: 1rpx solid rgba(193, 0, 28, 0.1);
  1242. }
  1243. .client-label {
  1244. font-size: 26rpx;
  1245. color: #999;
  1246. }
  1247. .client-name-text {
  1248. font-size: 30rpx;
  1249. font-weight: bold;
  1250. color: #C1001C;
  1251. }
  1252. /* 批量修改按钮 */
  1253. .batch-toggle {
  1254. flex-shrink: 0;
  1255. padding: 8rpx 24rpx;
  1256. background: #C1001C;
  1257. border-radius: 40rpx;
  1258. font-size: 24rpx;
  1259. color: #fff;
  1260. display: flex;
  1261. align-items: center;
  1262. }
  1263. .batch-selected {
  1264. border-color: #C1001C !important;
  1265. background: #FFF1F2 !important;
  1266. }
  1267. /* 批量操作栏 */
  1268. .batch-action-bar {
  1269. position: fixed;
  1270. bottom: 0;
  1271. left: 0;
  1272. width: 100%;
  1273. background: #fff;
  1274. border-top: 1rpx solid #f0f0f0;
  1275. display: flex;
  1276. align-items: center;
  1277. justify-content: space-between;
  1278. padding: 20rpx 30rpx;
  1279. padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  1280. box-sizing: border-box;
  1281. z-index: 100;
  1282. box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.05);
  1283. }
  1284. .batch-count {
  1285. font-size: 28rpx;
  1286. color: #333;
  1287. font-weight: 500;
  1288. }
  1289. .batch-count.placeholder {
  1290. color: #ccc;
  1291. }
  1292. .batch-btns {
  1293. display: flex;
  1294. gap: 16rpx;
  1295. }
  1296. .batch-btn {
  1297. width: auto;
  1298. height: 64rpx;
  1299. padding: 0 28rpx;
  1300. border-radius: 32rpx;
  1301. font-size: 26rpx;
  1302. font-weight: 500;
  1303. display: flex;
  1304. align-items: center;
  1305. border: none;
  1306. line-height: 64rpx;
  1307. transition: opacity 0.2s;
  1308. }
  1309. .batch-btn[disabled] {
  1310. opacity: 0.4;
  1311. }
  1312. .surface-btn {
  1313. background: linear-gradient(135deg, #1890FF, #096DD9);
  1314. color: #fff;
  1315. }
  1316. .pack-btn {
  1317. background: linear-gradient(135deg, #52C41A, #389E0D);
  1318. color: #fff;
  1319. }
  1320. /* 选择器弹层(参照 edit-model 模式) */
  1321. .custom-picker-mask {
  1322. position: fixed;
  1323. top: 0;
  1324. left: 0;
  1325. right: 0;
  1326. bottom: 0;
  1327. background: rgba(0, 0, 0, 0.4);
  1328. z-index: 1000;
  1329. display: flex;
  1330. align-items: flex-end;
  1331. }
  1332. .picker-popup {
  1333. width: 100%;
  1334. background: #fff;
  1335. border-radius: 32rpx 32rpx 0 0;
  1336. padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx);
  1337. animation: slideUp 0.15s ease-out;
  1338. }
  1339. @keyframes slideUp {
  1340. from {
  1341. transform: translateY(100%);
  1342. }
  1343. to {
  1344. transform: translateY(0);
  1345. }
  1346. }
  1347. .popup-header {
  1348. display: flex;
  1349. justify-content: space-between;
  1350. align-items: center;
  1351. padding: 30rpx 40rpx;
  1352. border-bottom: 1rpx solid #f0f0f0;
  1353. }
  1354. .popup-title {
  1355. font-size: 32rpx;
  1356. font-weight: bold;
  1357. color: #333;
  1358. }
  1359. .cancel-text,
  1360. .confirm-text {
  1361. font-size: 30rpx;
  1362. padding: 10rpx;
  1363. }
  1364. .confirm-text {
  1365. color: #C1001C;
  1366. font-weight: bold;
  1367. }
  1368. .item-list {
  1369. max-height: 50vh;
  1370. padding: 0 40rpx;
  1371. }
  1372. .option-item {
  1373. height: 110rpx;
  1374. display: flex;
  1375. align-items: center;
  1376. justify-content: space-between;
  1377. border-bottom: 1rpx solid #f8f8f8;
  1378. font-size: 32rpx;
  1379. color: #333;
  1380. }
  1381. .option-item.active {
  1382. color: #C1001C;
  1383. font-weight: bold;
  1384. }
  1385. .kind-item {
  1386. background: #fafbfc;
  1387. }
  1388. .kind-text {
  1389. color: #556;
  1390. }
  1391. .option-text {
  1392. flex: 1;
  1393. padding: 10rpx 0;
  1394. }
  1395. .arrow-right {
  1396. font-size: 56rpx;
  1397. color: #bbb;
  1398. padding: 10rpx 0 10rpx 20rpx;
  1399. font-weight: 300;
  1400. }
  1401. /* 级联面包屑 */
  1402. .breadcrumb-bar {
  1403. display: flex;
  1404. align-items: center;
  1405. padding: 16rpx 40rpx;
  1406. background: #fafafa;
  1407. border-bottom: 1rpx solid #f0f0f0;
  1408. }
  1409. .back-btn {
  1410. color: #C1001C;
  1411. font-size: 28rpx;
  1412. margin-right: 16rpx;
  1413. }
  1414. .breadcrumb-path {
  1415. font-size: 28rpx;
  1416. color: #666;
  1417. }
  1418. /* 搜索栏样式 */
  1419. .search-bar {
  1420. padding: 16rpx 40rpx;
  1421. border-bottom: 1rpx solid #f0f0f0;
  1422. }
  1423. .search-input-wrap {
  1424. display: flex;
  1425. align-items: center;
  1426. background: #f5f6f8;
  1427. border-radius: 32rpx;
  1428. padding: 12rpx 24rpx;
  1429. }
  1430. .search-icon {
  1431. font-size: 28rpx;
  1432. margin-right: 12rpx;
  1433. }
  1434. .search-input {
  1435. flex: 1;
  1436. font-size: 26rpx;
  1437. color: #333;
  1438. height: 56rpx;
  1439. }
  1440. </style>