index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882
  1. <template>
  2. <view class="order-container">
  3. <erp-nav-bar title="添加型号" />
  4. <scroll-view :scroll-y="!showTypePicker && !showSurfacePicker && !showPackagePicker" class="order-scroll"
  5. :show-scrollbar="false" :enhanced="true" @scrolltolower="onScrollToLower">
  6. <view class="form-content">
  7. <!-- 模块 1:型材 -->
  8. <view class="section-card">
  9. <view class="section-header">
  10. <view class="blue-bar"></view>
  11. <text class="section-title">型材</text>
  12. </view>
  13. <view class="form-item">
  14. <text class="label required">型号</text>
  15. <view class="picker-box" @click="openTypePicker">
  16. <view class="picker-inner">
  17. <view class="picker-val" :class="{ placeholder: !formData.type }">
  18. {{ formData.type || '请选择型号' }}
  19. </view>
  20. <view class="line-arrow-down"></view>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="row-flex">
  25. <view class="half-item">
  26. <text class="label">名称</text>
  27. <input class="input-box readonly small-font" v-model="formData.name" disabled
  28. placeholder="型号名称" />
  29. </view>
  30. <view class="half-item">
  31. <text class="label">材质</text>
  32. <input class="input-box readonly small-font" v-model="formData.material" disabled
  33. placeholder="材质" />
  34. </view>
  35. </view>
  36. </view>
  37. <!-- 模块 2:表面处理 -->
  38. <view class="section-card">
  39. <view class="section-header">
  40. <view class="blue-bar"></view>
  41. <text class="section-title">表面处理</text>
  42. </view>
  43. <view class="form-item">
  44. <text class="label required">表面名称</text>
  45. <view class="picker-box" @click="openSurfacePicker">
  46. <view class="picker-inner">
  47. <view class="picker-val" :class="{ placeholder: !formData.surfaceName }">
  48. {{ formData.surfaceName || '请选择表面名称' }}
  49. </view>
  50. <view class="line-arrow-down"></view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <!-- 模块 3:包装 -->
  56. <view class="section-card">
  57. <view class="section-header">
  58. <view class="blue-bar"></view>
  59. <text class="section-title">包装</text>
  60. </view>
  61. <view class="form-item">
  62. <text class="label required">包装方式</text>
  63. <view class="picker-box" @click="openPackagePicker">
  64. <view class="picker-inner">
  65. <view class="picker-val" :class="{ placeholder: !formData.packageMethod }">
  66. {{ formData.packageMethod || '请选择包装方式' }}
  67. </view>
  68. <view class="line-arrow-down"></view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. <!-- 模块 4:壁厚 -->
  74. <view class="section-card">
  75. <view class="section-header">
  76. <view class="blue-bar"></view>
  77. <text class="section-title">壁厚</text>
  78. </view>
  79. <view class="row-flex">
  80. <view class="half-item">
  81. <text class="label required">长度</text>
  82. <view class="input-wrap">
  83. <input class="input-box" type="digit" v-model="formData.length" placeholder="请输入" />
  84. <text class="unit">mm</text>
  85. </view>
  86. </view>
  87. <view class="half-item">
  88. <text class="label required">壁厚</text>
  89. <view class="input-wrap">
  90. <input class="input-box" type="digit" v-model="formData.wallThickness"
  91. placeholder="请输入" />
  92. <text class="unit">mm</text>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. <!-- 模块 5:数量 -->
  98. <view class="section-card">
  99. <view class="section-header">
  100. <view class="blue-bar"></view>
  101. <text class="section-title">数量</text>
  102. </view>
  103. <view class="form-item no-margin-bottom">
  104. <text class="label required">支数</text>
  105. <input class="input-box full-width" type="number" v-model="formData.count"
  106. placeholder="请输入支数" />
  107. </view>
  108. </view>
  109. <view class="bottom-placeholder"></view>
  110. </view>
  111. </scroll-view>
  112. <erp-submit-bar text="确认并添加" @click="confirmAddModel" />
  113. <!-- 型号选择 -->
  114. <view class="custom-picker-mask" v-if="showTypePicker" @click="closeTypePicker" @touchmove.stop.prevent>
  115. <view class="picker-popup" @click.stop>
  116. <view class="popup-header">
  117. <text class="cancel-text" @click="closeTypePicker">取消</text>
  118. <text class="popup-title">选择产品型号</text>
  119. <text class="confirm-text" @click="confirmTypeSelect">确定</text>
  120. </view>
  121. <!-- 搜索栏 -->
  122. <view class="search-bar">
  123. <view class="search-input-wrap">
  124. <text class="search-icon">🔍</text>
  125. <input class="search-input" type="text" v-model="typeSearchKey" placeholder="输入名称检索"
  126. @input="onTypeSearch" />
  127. </view>
  128. </view>
  129. <!-- 层级面包屑 -->
  130. <view class="breadcrumb-bar" v-if="typePickerLevel > 1">
  131. <text class="back-btn" @click="goBackModelLevel">← 返回</text>
  132. <text class="breadcrumb-path">
  133. {{typeBreadcrumbs.map(b => b.label).join(' / ')}}
  134. </text>
  135. </view>
  136. <!-- 列表区 -->
  137. <scroll-view scroll-y class="item-list">
  138. <view class="option-item kind-item" v-for="(item, index) in modelKindList" :key="'mk' + index"
  139. @click="drillDownType(item)">
  140. <text class="option-text kind-text">{{ item.num }} - {{ item.name }}</text>
  141. <text class="arrow-right">›</text>
  142. </view>
  143. <view class="option-item" v-for="(item, index) in modelItemList" :key="'mi' + index"
  144. :class="{ active: tempSelectedIndex === index }">
  145. <text class="option-text" @click="selectTypeItem(index)">{{ item.num }} - {{ item.name }}</text>
  146. </view>
  147. </scroll-view>
  148. </view>
  149. </view>
  150. <!-- 表面处理选择 -->
  151. <view class="custom-picker-mask" v-if="showSurfacePicker" @click="closeSurfacePicker" @touchmove.stop.prevent>
  152. <view class="picker-popup" @click.stop>
  153. <view class="popup-header">
  154. <text class="cancel-text" @click="closeSurfacePicker">取消</text>
  155. <text class="popup-title">选择表面处理</text>
  156. <text class="confirm-text" @click="confirmSurfaceSelect">确定</text>
  157. </view>
  158. <!-- 搜索栏 -->
  159. <view class="search-bar">
  160. <view class="search-input-wrap">
  161. <text class="search-icon">🔍</text>
  162. <input class="search-input" type="text" v-model="surfaceSearchKey" placeholder="输入名称检索"
  163. @input="onSurfaceSearch" />
  164. </view>
  165. </view>
  166. <!-- 层级面包屑 -->
  167. <view class="breadcrumb-bar" v-if="surfacePickerLevel > 1">
  168. <text class="back-btn" @click="goBackSurfaceLevel">← 返回</text>
  169. <text class="breadcrumb-path">{{surfaceBreadcrumbs.map(b => b.label).join(' / ')}}</text>
  170. </view>
  171. <!-- 列表区 -->
  172. <scroll-view scroll-y class="item-list">
  173. <view class="option-item kind-item" v-for="(item, index) in colorKindList" :key="'ck' + index"
  174. @click="drillDownSurface(item)">
  175. <text class="option-text kind-text">{{ item.num }} - {{ item.name }}</text>
  176. <text class="arrow-right">›</text>
  177. </view>
  178. <view class="option-item" v-for="(item, index) in colorItemList" :key="'ci' + index"
  179. :class="{ active: tempSurfaceIndex === index }">
  180. <text class="option-text" @click="selectSurfaceItem(index)">{{ item.num }} - {{ item.name
  181. }}</text>
  182. </view>
  183. </scroll-view>
  184. </view>
  185. </view>
  186. <!-- 包装方式选择 -->
  187. <view class="custom-picker-mask" v-if="showPackagePicker" @click="closePackagePicker" @touchmove.stop.prevent>
  188. <view class="picker-popup" @click.stop>
  189. <view class="popup-header">
  190. <text class="cancel-text" @click="closePackagePicker">取消</text>
  191. <text class="popup-title">选择包装方式</text>
  192. <text class="confirm-text" @click="confirmPackageSelect">确定</text>
  193. </view>
  194. <view class="search-bar">
  195. <view class="search-input-wrap">
  196. <text class="search-icon">🔍</text>
  197. <input class="search-input" type="text" v-model="packageSearchKey" placeholder="输入名称检索"
  198. @input="onPackageSearch" />
  199. </view>
  200. </view>
  201. <scroll-view scroll-y class="item-list" @scrolltolower="loadMorePackage">
  202. <view class="option-item" v-for="(item, index) in packageList" :key="index"
  203. :class="{ active: tempPackageIndex === index }" @click="selectPackageItem(index)">
  204. <text>{{ item.num }} - {{ item.name }}</text>
  205. <icon type="success_no_circle" size="16" color="#C1001C" v-if="tempPackageIndex === index">
  206. </icon>
  207. </view>
  208. <view class="loading-tip" v-if="packageLoading && packageHasMore">
  209. <text class="loading-text">加载中...</text>
  210. </view>
  211. <view class="loading-tip" v-if="!packageHasMore && packageList.length > 0">
  212. <text class="loading-text">已加载全部</text>
  213. </view>
  214. </scroll-view>
  215. </view>
  216. </view>
  217. </view>
  218. </template>
  219. <script>
  220. import ErpNavBar from '@/components/erp-nav-bar.vue';
  221. import ErpSubmitBar from '@/components/erp-submit-bar.vue';
  222. import { listModel } from '@/api/erp/model.js';
  223. import { listModelKind } from '@/api/erp/modelKind.js';
  224. import { listColor } from '@/api/erp/color.js';
  225. import { listColorKind } from '@/api/erp/colorKind.js';
  226. import { listPagePack } from '@/api/erp/pack.js';
  227. import { addOrderDetail } from '@/api/erp/orderDetail.js';
  228. export default {
  229. components: { ErpNavBar, ErpSubmitBar },
  230. data() {
  231. return {
  232. showTypePicker: false, showSurfacePicker: false, showPackagePicker: false,
  233. tempSelectedIndex: -1, tempSurfaceIndex: -1, tempPackageIndex: -1,
  234. modelKindList: [],
  235. modelItemList: [],
  236. colorKindList: [],
  237. colorItemList: [],
  238. packageList: [],
  239. typeSearchKey: '', surfaceSearchKey: '', packageSearchKey: '',
  240. typeBreadcrumbs: [],
  241. typePickerLevel: 1,
  242. surfaceBreadcrumbs: [],
  243. surfacePickerLevel: 1,
  244. packagePageNum: 1, packagePageSize: 10, packageHasMore: true, packageLoading: false,
  245. formData: {
  246. type: '', modelId: '', name: '', material: '',
  247. surfaceName: '', surfaceId: '', packageMethod: '', packageId: '', length: '',
  248. wallThickness: '', count: '', meterWeight: ''
  249. }
  250. }
  251. },
  252. async onLoad() {
  253. await this.loadPackageMethods();
  254. },
  255. methods: {
  256. async loadPackageMethods(pageNum = 1, keyword = '') {
  257. if (this.packageLoading) return;
  258. this.packageLoading = true;
  259. try {
  260. const res = await listPagePack({
  261. pageNum: pageNum,
  262. pageSize: this.packagePageSize,
  263. name: keyword
  264. });
  265. const rows = res.rows || [];
  266. const total = res.total || 0;
  267. if (pageNum === 1) {
  268. this.packageList = rows;
  269. } else {
  270. this.packageList = [...this.packageList, ...rows];
  271. }
  272. this.packageHasMore = this.packageList.length < total;
  273. } catch (e) {
  274. uni.showToast({ title: e || '加载包装方式失败', icon: 'none' });
  275. } finally {
  276. this.packageLoading = false;
  277. }
  278. },
  279. loadMorePackage() {
  280. if (this.packageHasMore && !this.packageLoading) {
  281. this.packagePageNum++;
  282. this.loadPackageMethods(this.packagePageNum, this.packageSearchKey);
  283. }
  284. },
  285. /**
  286. * 包装方式搜索(防抖)
  287. * @Author: Antigravity
  288. */
  289. onPackageSearch() {
  290. if (this.packageSearchTimer) clearTimeout(this.packageSearchTimer);
  291. this.packageSearchTimer = setTimeout(() => {
  292. this.packagePageNum = 1;
  293. this.loadPackageMethods(1, this.packageSearchKey);
  294. }, 300);
  295. },
  296. /**
  297. * 加载型材系列,点击系列后同时加载子系列和具体型号
  298. * @Author: Trae
  299. */
  300. async loadTypes(parentRowId) {
  301. try {
  302. const keyword = (this.typeSearchKey || '').trim();
  303. const kindParams = { name: keyword || undefined };
  304. if (parentRowId) {
  305. kindParams.parentRowId = parentRowId;
  306. }
  307. const kindRes = await listModelKind(kindParams);
  308. this.modelKindList = kindRes.data || [];
  309. if (parentRowId) {
  310. const modelParams = { name: keyword || undefined, parentRowId };
  311. const modelRes = await listModel(modelParams);
  312. this.modelItemList = modelRes.data || [];
  313. } else {
  314. this.modelItemList = [];
  315. }
  316. } catch (e) {
  317. uni.showToast({ title: e || '加载型号失败', icon: 'none' });
  318. }
  319. },
  320. /**
  321. * 型号搜索
  322. * @Author: Trae
  323. */
  324. onTypeSearch() {
  325. const parentRowId = this.typeBreadcrumbs.length > 0
  326. ? this.typeBreadcrumbs[this.typeBreadcrumbs.length - 1].rowId : '';
  327. this.loadTypes(parentRowId);
  328. },
  329. /**
  330. * 加载表面处理系列,点击系列后同时加载子系列和具体颜色
  331. * @Author: Trae
  332. */
  333. async loadSurfaces(parentRowId) {
  334. try {
  335. const keyword = (this.surfaceSearchKey || '').trim();
  336. const kindParams = { name: keyword || undefined };
  337. if (parentRowId) {
  338. kindParams.parentRowId = parentRowId;
  339. }
  340. const kindRes = await listColorKind(kindParams);
  341. this.colorKindList = kindRes.data || [];
  342. if (parentRowId) {
  343. const colorParams = { name: keyword || undefined, parentRowId };
  344. const colorRes = await listColor(colorParams);
  345. this.colorItemList = colorRes.data || [];
  346. } else {
  347. this.colorItemList = [];
  348. }
  349. } catch (e) {
  350. uni.showToast({ title: e || '加载表面处理失败', icon: 'none' });
  351. }
  352. },
  353. /**
  354. * 表面处理搜索
  355. * @Author: Trae
  356. */
  357. onSurfaceSearch() {
  358. const parentRowId = this.surfaceBreadcrumbs.length > 0
  359. ? this.surfaceBreadcrumbs[this.surfaceBreadcrumbs.length - 1].rowId : '';
  360. this.loadSurfaces(parentRowId);
  361. },
  362. /**
  363. * 打开型号选择器
  364. * @Author: Trae
  365. */
  366. openTypePicker() {
  367. this.typePickerLevel = 1;
  368. this.typeBreadcrumbs = [];
  369. this.tempSelectedIndex = -1;
  370. this.showTypePicker = true;
  371. this.loadTypes('');
  372. },
  373. /**
  374. * 钻取到子级
  375. * @Author: Trae
  376. */
  377. drillDownType(item) {
  378. this.typeBreadcrumbs.push({ rowId: item.rowId, label: item.num });
  379. this.typePickerLevel++;
  380. this.tempSelectedIndex = -1;
  381. this.loadTypes(item.rowId);
  382. },
  383. /**
  384. * 返回上一级
  385. * @Author: Trae
  386. */
  387. goBackModelLevel() {
  388. this.typeBreadcrumbs.pop();
  389. this.typePickerLevel--;
  390. this.tempSelectedIndex = -1;
  391. const parentRowId = this.typeBreadcrumbs.length > 0
  392. ? this.typeBreadcrumbs[this.typeBreadcrumbs.length - 1].rowId : '';
  393. this.loadTypes(parentRowId);
  394. },
  395. closeTypePicker() {
  396. this.showTypePicker = false;
  397. this.typeSearchKey = '';
  398. this.typePickerLevel = 1;
  399. this.typeBreadcrumbs = [];
  400. this.tempSelectedIndex = -1;
  401. },
  402. selectTypeItem(index) { this.tempSelectedIndex = index; },
  403. /**
  404. * 确认选择型材
  405. * @Author: Trae
  406. */
  407. confirmTypeSelect() {
  408. if (this.tempSelectedIndex === -1) {
  409. uni.showToast({ title: '请先选择一个选项', icon: 'none' });
  410. return;
  411. }
  412. const item = this.modelItemList[this.tempSelectedIndex];
  413. this.formData.type = item.num;
  414. this.formData.modelId = item.rowId;
  415. this.formData.name = item.name;
  416. this.formData.material = '6063-T5';
  417. this.formData.meterWeight = item.meterWt || '';
  418. this.closeTypePicker();
  419. },
  420. /**
  421. * 打开表面处理选择器
  422. * @Author: Trae
  423. */
  424. openSurfacePicker() {
  425. this.surfacePickerLevel = 1;
  426. this.surfaceBreadcrumbs = [];
  427. this.tempSurfaceIndex = -1;
  428. this.showSurfacePicker = true;
  429. this.loadSurfaces('');
  430. },
  431. /**
  432. * 钻取到子级
  433. * @Author: Trae
  434. */
  435. drillDownSurface(item) {
  436. this.surfaceBreadcrumbs.push({ rowId: item.rowId, label: item.num });
  437. this.surfacePickerLevel++;
  438. this.tempSurfaceIndex = -1;
  439. this.loadSurfaces(item.rowId);
  440. },
  441. /**
  442. * 返回上一级
  443. * @Author: Trae
  444. */
  445. goBackSurfaceLevel() {
  446. this.surfaceBreadcrumbs.pop();
  447. this.surfacePickerLevel--;
  448. this.tempSurfaceIndex = -1;
  449. const parentRowId = this.surfaceBreadcrumbs.length > 0
  450. ? this.surfaceBreadcrumbs[this.surfaceBreadcrumbs.length - 1].rowId : '';
  451. this.loadSurfaces(parentRowId);
  452. },
  453. closeSurfacePicker() {
  454. this.showSurfacePicker = false;
  455. this.surfaceSearchKey = '';
  456. this.surfacePickerLevel = 1;
  457. this.surfaceBreadcrumbs = [];
  458. this.tempSurfaceIndex = -1;
  459. },
  460. selectSurfaceItem(index) { this.tempSurfaceIndex = index; },
  461. /**
  462. * 确认选择表面处理
  463. * @Author: Trae
  464. */
  465. confirmSurfaceSelect() {
  466. if (this.tempSurfaceIndex === -1) {
  467. uni.showToast({ title: '请先选择一个选项', icon: 'none' });
  468. return;
  469. }
  470. const item = this.colorItemList[this.tempSurfaceIndex];
  471. this.formData.surfaceName = item.name;
  472. this.formData.surfaceId = item.rowId;
  473. this.closeSurfacePicker();
  474. },
  475. openPackagePicker() {
  476. if (this.formData.packageMethod) {
  477. this.tempPackageIndex = this.packageList.findIndex(item => item.name === this.formData.packageMethod);
  478. } else {
  479. this.tempPackageIndex = -1;
  480. }
  481. this.showPackagePicker = true;
  482. },
  483. closePackagePicker() {
  484. this.showPackagePicker = false;
  485. this.packageSearchKey = '';
  486. this.packagePageNum = 1;
  487. },
  488. selectPackageItem(index) { this.tempPackageIndex = index; },
  489. confirmPackageSelect() {
  490. if (this.tempPackageIndex === -1) return;
  491. const item = this.packageList[this.tempPackageIndex];
  492. this.formData.packageMethod = item.name;
  493. this.formData.packageId = item.rowId;
  494. this.closePackagePicker();
  495. },
  496. async confirmAddModel() {
  497. const fields = [
  498. { key: 'type', label: '型号' },
  499. { key: 'surfaceName', label: '表面名称' },
  500. { key: 'packageMethod', label: '包装方式' },
  501. { key: 'length', label: '长度' },
  502. { key: 'wallThickness', label: '壁厚' },
  503. { key: 'count', label: '支数' }
  504. ];
  505. for (let item of fields) {
  506. if (!this.formData[item.key]) {
  507. uni.showToast({ title: `请完善项目:${item.label}`, icon: 'none' });
  508. return;
  509. }
  510. }
  511. const finalData = {
  512. orderId: null,
  513. modelId: this.formData.modelId,
  514. modelNum: this.formData.type,
  515. modelName: this.formData.name,
  516. material: this.formData.material,
  517. surfaceId: this.formData.surfaceId,
  518. surfaceName: this.formData.surfaceName,
  519. packId: this.formData.packageId,
  520. packName: this.formData.packageMethod,
  521. length: parseFloat(this.formData.length || 0).toFixed(4),
  522. wallThickness: parseFloat(this.formData.wallThickness || 0).toFixed(4),
  523. meterWeight: this.formData.meterWeight ? parseFloat(this.formData.meterWeight || 0).toFixed(4) : null,
  524. count: parseInt(this.formData.count || 0)
  525. };
  526. uni.showLoading({ title: '正在保存...' });
  527. try {
  528. await addOrderDetail(finalData);
  529. uni.hideLoading();
  530. uni.showToast({ title: '添加成功', icon: 'success' });
  531. uni.$emit('add_order_item', finalData);
  532. setTimeout(() => {
  533. uni.navigateBack();
  534. }, 1000);
  535. } catch (e) {
  536. uni.hideLoading();
  537. uni.showToast({ title: e || '添加失败', icon: 'none' });
  538. }
  539. }
  540. }
  541. }
  542. </script>
  543. <style scoped>
  544. /deep/ ::-webkit-scrollbar {
  545. display: none !important;
  546. width: 0 !important;
  547. height: 0 !important;
  548. }
  549. .order-container {
  550. width: 100%;
  551. height: 100vh;
  552. background: #f7f8fa;
  553. display: flex;
  554. flex-direction: column;
  555. overflow: hidden;
  556. }
  557. .order-scroll {
  558. flex: 1;
  559. height: 0;
  560. }
  561. .form-content {
  562. padding: 30rpx;
  563. padding-bottom: calc(180rpx + env(safe-area-inset-bottom));
  564. }
  565. .section-card {
  566. background: #fff;
  567. border-radius: 24rpx;
  568. padding: 30rpx;
  569. margin-bottom: 30rpx;
  570. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.02);
  571. }
  572. .section-header {
  573. display: flex;
  574. align-items: center;
  575. margin-bottom: 40rpx;
  576. }
  577. .blue-bar {
  578. width: 8rpx;
  579. height: 32rpx;
  580. background: #C1001C;
  581. border-radius: 4rpx;
  582. margin-right: 16rpx;
  583. }
  584. .section-title {
  585. font-size: 32rpx;
  586. font-weight: bold;
  587. color: #333;
  588. }
  589. .form-item {
  590. margin-bottom: 40rpx;
  591. }
  592. .no-margin-bottom {
  593. margin-bottom: 0;
  594. }
  595. .row-flex {
  596. display: flex;
  597. justify-content: space-between;
  598. }
  599. .half-item {
  600. width: 48%;
  601. }
  602. .label {
  603. font-size: 28rpx;
  604. color: #333;
  605. margin-bottom: 20rpx;
  606. display: block;
  607. font-weight: 500;
  608. }
  609. .label.required::after {
  610. content: ' *';
  611. color: #ff4d4f;
  612. font-weight: bold;
  613. margin-left: 4rpx;
  614. }
  615. .picker-box {
  616. background: #f9fafc;
  617. border-radius: 12rpx;
  618. height: 100rpx;
  619. border: 1rpx solid #eee;
  620. display: flex;
  621. align-items: center;
  622. }
  623. .picker-inner {
  624. width: 100%;
  625. height: 100%;
  626. display: flex;
  627. align-items: center;
  628. justify-content: space-between;
  629. padding: 0 30rpx;
  630. box-sizing: border-box;
  631. }
  632. .picker-val {
  633. font-size: 30rpx;
  634. color: #333;
  635. }
  636. .picker-val.placeholder {
  637. color: #ccc;
  638. font-size: 28rpx;
  639. }
  640. .line-arrow-down {
  641. width: 14rpx;
  642. height: 14rpx;
  643. border-right: 3rpx solid #bbb;
  644. border-bottom: 3rpx solid #bbb;
  645. transform: rotate(45deg);
  646. margin-top: -8rpx;
  647. margin-right: 4rpx;
  648. }
  649. .input-wrap {
  650. position: relative;
  651. width: 100%;
  652. }
  653. .input-box {
  654. font-size: 30rpx;
  655. color: #333;
  656. width: 100%;
  657. height: 100rpx;
  658. background: #f9fafc;
  659. border-radius: 12rpx;
  660. padding: 0 80rpx 0 30rpx;
  661. box-sizing: border-box;
  662. border: 1rpx solid #eee;
  663. }
  664. .input-box.readonly {
  665. background: #f8f9fa;
  666. color: #666;
  667. border-color: #f0f0f0;
  668. }
  669. .input-box.full-width {
  670. padding: 0 30rpx;
  671. }
  672. .unit {
  673. position: absolute;
  674. right: 24rpx;
  675. top: 50%;
  676. transform: translateY(-50%);
  677. font-size: 26rpx;
  678. color: #999;
  679. font-weight: 500;
  680. }
  681. .small-font {
  682. font-size: 26rpx !important;
  683. }
  684. .custom-picker-mask {
  685. position: fixed;
  686. top: 0;
  687. left: 0;
  688. right: 0;
  689. bottom: 0;
  690. background: rgba(0, 0, 0, 0.4);
  691. z-index: 1000;
  692. display: flex;
  693. align-items: flex-end;
  694. }
  695. .picker-popup {
  696. width: 100%;
  697. background: #fff;
  698. border-radius: 32rpx 32rpx 0 0;
  699. padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx);
  700. animation: slideUp 0.15s ease-out;
  701. }
  702. @keyframes slideUp {
  703. from {
  704. transform: translateY(100%);
  705. }
  706. to {
  707. transform: translateY(0);
  708. }
  709. }
  710. .popup-header {
  711. display: flex;
  712. justify-content: space-between;
  713. align-items: center;
  714. padding: 30rpx 40rpx;
  715. border-bottom: 1rpx solid #f0f0f0;
  716. }
  717. .popup-title {
  718. font-size: 32rpx;
  719. font-weight: bold;
  720. color: #333;
  721. }
  722. .cancel-text,
  723. .confirm-text {
  724. font-size: 30rpx;
  725. padding: 10rpx;
  726. }
  727. .confirm-text {
  728. color: #C1001C;
  729. font-weight: bold;
  730. }
  731. .item-list {
  732. max-height: 50vh;
  733. padding: 0 40rpx;
  734. }
  735. /* 搜索栏样式 */
  736. .search-bar {
  737. padding: 16rpx 40rpx;
  738. border-bottom: 1rpx solid #f0f0f0;
  739. }
  740. .search-input-wrap {
  741. display: flex;
  742. align-items: center;
  743. background: #f5f6f8;
  744. border-radius: 32rpx;
  745. padding: 12rpx 24rpx;
  746. }
  747. .search-icon {
  748. font-size: 28rpx;
  749. margin-right: 12rpx;
  750. }
  751. .search-input {
  752. flex: 1;
  753. font-size: 26rpx;
  754. color: #333;
  755. height: 56rpx;
  756. }
  757. .option-item {
  758. height: 110rpx;
  759. display: flex;
  760. align-items: center;
  761. justify-content: space-between;
  762. border-bottom: 1rpx solid #f8f8f8;
  763. font-size: 32rpx;
  764. color: #333;
  765. }
  766. .option-item.active {
  767. color: #C1001C;
  768. font-weight: bold;
  769. }
  770. .kind-item {
  771. background: #fafbfc;
  772. }
  773. .kind-text {
  774. color: #556;
  775. }
  776. .option-text {
  777. flex: 1;
  778. padding: 10rpx 0;
  779. }
  780. .loading-tip {
  781. padding: 20rpx 0;
  782. text-align: center;
  783. }
  784. .loading-text {
  785. font-size: 26rpx;
  786. color: #999;
  787. }
  788. /* 级联面包屑 */
  789. .breadcrumb-bar {
  790. display: flex;
  791. align-items: center;
  792. padding: 16rpx 40rpx;
  793. background: #fafafa;
  794. border-bottom: 1rpx solid #f0f0f0;
  795. }
  796. .back-btn {
  797. font-size: 28rpx;
  798. color: #C1001C;
  799. padding-right: 20rpx;
  800. flex-shrink: 0;
  801. }
  802. .breadcrumb-path {
  803. font-size: 26rpx;
  804. color: #666;
  805. flex: 1;
  806. overflow: hidden;
  807. text-overflow: ellipsis;
  808. white-space: nowrap;
  809. }
  810. .arrow-right {
  811. font-size: 56rpx;
  812. color: #bbb;
  813. padding: 10rpx 0 10rpx 20rpx;
  814. font-weight: 300;
  815. }
  816. .bottom-placeholder {
  817. height: 60rpx;
  818. }
  819. </style>