ReturnManagement.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263
  1. <!-- 还料区管理 - 深色科技风格 -->
  2. <template>
  3. <div class="return-page">
  4. <!-- 背景层 -->
  5. <div class="bg-layer" :style="{ backgroundImage: `url(${bgImg})` }" />
  6. <!-- 顶部标题区域 -->
  7. <div class="header-section">
  8. <button class="back-btn" @click="$router.push('/home')">
  9. <i class="fas fa-arrow-left" />
  10. <span>返回</span>
  11. </button>
  12. <h1 class="page-title">还料区管理</h1>
  13. </div>
  14. <!-- 主内容区域 -->
  15. <main class="main-content">
  16. <div class="stations-grid">
  17. <div
  18. v-for="station in stations" :key="station.positionNo" class="station-card"
  19. :class="getStationClass(station)" @click="openStation(station)"
  20. >
  21. <div class="card-header">
  22. <div class="card-title">{{ station.positionName }}</div>
  23. <span class="status-badge" :class="getStatusClass(station.positionStatus)">
  24. {{ station.positionStatus }}
  25. </span>
  26. </div>
  27. <!-- 卡片内容 -->
  28. <div class="card-content">
  29. <!-- 占用状态 - 显示物料图片 -->
  30. <div v-if="station.positionStatus === '已占用'" class="material-display">
  31. <div class="material-image">
  32. <i class="fas fa-car" style="font-size: 60px; color: #fff;" />
  33. </div>
  34. </div>
  35. <!-- 空闲状态 -->
  36. <div v-else class="empty-state">
  37. <i class="fas fa-inbox" />
  38. <span>暂无物料车</span>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. </main>
  44. <!-- 确认还料弹窗 -->
  45. <van-dialog
  46. v-model:show="visible" title="确认还料" show-cancel-button class-name="large-dialog"
  47. confirm-button-text="确认" cancel-button-text="取消" :before-close="handleDialogClose"
  48. >
  49. <div class="large-dialog-content">
  50. <p>请确认您已经把待归还的料车推到【{{ positionName }}】上,请输入料车编号:</p>
  51. <div class="dialog-form-item">
  52. <v-select
  53. v-model="truckNo" :options="truckNos" :reduce="item => item.value" label="label"
  54. placeholder="请输入料车编号搜索" :clearable="true" :filterable="true" class="dialog-select" @search="handleSearch"
  55. >
  56. <template #no-options>
  57. <span>{{ hasSearched ? '无该编号相关数据' : '请输入料车编号进行搜索' }}</span>
  58. </template>
  59. </v-select>
  60. </div>
  61. <!-- 接驳车工装设备选择 -->
  62. <transition name="fade-slide">
  63. <div v-if="isTransferTruck" class="tooling-section">
  64. <div class="section-title">
  65. <van-icon name="cluster-o" />
  66. <span>工装设备选择</span>
  67. <van-tag type="primary" size="small">接驳车</van-tag>
  68. </div>
  69. <!-- 工装设备搜索 + 已选标签 -->
  70. <div class="tooling-header-row">
  71. <van-field
  72. v-model="toolingSearchKeyword" placeholder="请输入名称..." left-icon="search" class="tooling-input"
  73. @update:model-value="handleToolingSearch"
  74. />
  75. <div v-if="selectedToolings.length > 0" class="selected-count">
  76. <van-tag type="primary" size="small">已选 {{ selectedToolings.length }}</van-tag>
  77. </div>
  78. </div>
  79. <!-- 已选工装设备(可点击切换位置) -->
  80. <div v-if="selectedToolings.length > 0" class="selected-toolings">
  81. <div
  82. v-for="id in selectedToolings" :key="id" class="selected-chip"
  83. :class="toolingPositions[id] === 'top' ? 'chip-top' : 'chip-bottom'" @click="toggleToolingPosition(id)"
  84. >
  85. <span class="chip-text">{{ getToolingById(id)?.no }}</span>
  86. <span class="chip-pos">{{ toolingPositions[id] === 'top' ? '上' : '下' }}</span>
  87. <van-icon name="cross" class="chip-close" @click.stop="removeTooling(id)" />
  88. </div>
  89. </div>
  90. <!-- 工装设备列表 -->
  91. <div class="tooling-list">
  92. <div
  93. v-for="tooling in toolingDevices" :key="tooling.id" class="tooling-item"
  94. :class="{ 'tooling-selected': selectedToolings.includes(tooling.id) }"
  95. >
  96. <div class="tooling-header" @click="toggleTooling(tooling.id)">
  97. <van-checkbox
  98. :model-value="selectedToolings.includes(tooling.id)"
  99. @click.stop="toggleTooling(tooling.id)"
  100. >
  101. <div class="tooling-info">
  102. <span class="tooling-no">{{ tooling.no }}</span>
  103. <span class="tooling-name">{{ tooling.name }}</span>
  104. </div>
  105. </van-checkbox>
  106. </div>
  107. <!-- 位置选择 -->
  108. <transition name="expand">
  109. <div v-if="selectedToolings.includes(tooling.id)" class="position-selector">
  110. <div class="position-label">选择位置:</div>
  111. <van-radio-group
  112. :model-value="toolingPositions[tooling.id] || 'top'" direction="horizontal"
  113. @update:model-value="(val) => updatePosition(tooling.id, val)"
  114. >
  115. <van-radio name="top" icon-size="18px">
  116. <template #icon="props">
  117. <van-icon :name="props.checked ? 'success' : 'circle'" />
  118. </template>
  119. <span class="position-text">上层</span>
  120. </van-radio>
  121. <van-radio name="bottom" icon-size="18px">
  122. <template #icon="props">
  123. <van-icon :name="props.checked ? 'success' : 'circle'" />
  124. </template>
  125. <span class="position-text">下层</span>
  126. </van-radio>
  127. </van-radio-group>
  128. </div>
  129. </transition>
  130. </div>
  131. </div>
  132. <!-- 选择汇总 -->
  133. <div v-if="selectedToolings.length > 0" class="tooling-summary">
  134. <span class="summary-text">上层: <b>{{ topToolings.length }}</b></span>
  135. <span class="summary-divider">|</span>
  136. <span class="summary-text">下层: <b>{{ bottomToolings.length }}</b></span>
  137. </div>
  138. <!-- 无数据提示 -->
  139. <div v-if="toolingDevices.length === 0 && !loading" class="tooling-empty">
  140. <van-icon name="search" size="24" color="#9ca3af" />
  141. <span>输入名称关键词</span>
  142. </div>
  143. </div>
  144. </transition>
  145. </div>
  146. </van-dialog>
  147. <!-- Loading -->
  148. <div v-if="loading" class="loading-overlay">
  149. <div class="loading-dots">
  150. <div class="dot" />
  151. <div class="dot" />
  152. <div class="dot" />
  153. </div>
  154. <span class="loading-text">加载中...</span>
  155. </div>
  156. </div>
  157. </template>
  158. <script setup>
  159. import { ref, onMounted, watch, computed } from 'vue';
  160. import { showNotify } from 'vant';
  161. import { getLocatorStatus, getNoInStorageTruck, generateTaskByBlankNo, findDeviceByCondition } from '../api/agv.js';
  162. import vSelect from 'vue-select';
  163. import 'vue-select/dist/vue-select.css';
  164. // 图片资源
  165. import bgImg from '../assets/images/bj.png';
  166. // 加载状态
  167. const loading = ref(false);
  168. // 获取卡片样式类
  169. const getStationClass = station => {
  170. if (station.positionStatus === '已占用') return 'station-occupied';
  171. if (station.positionStatus === '空闲中') return 'station-idle';
  172. return '';
  173. };
  174. // 获取状态徽章类
  175. const getStatusClass = status => {
  176. if (status === '已占用') return 'status-danger';
  177. if (status === '空闲中') return 'status-success';
  178. return '';
  179. };
  180. // 还料位数据
  181. const stations = ref([]);
  182. const visible = ref(false);
  183. const positionName = ref('');
  184. const positionNo = ref('');
  185. const truckNo = ref('');
  186. const truckNos = ref([]);
  187. const hasSearched = ref(false);
  188. let searchTimeout = null;
  189. // 料车完整数据
  190. const truckData = ref([]);
  191. const selectedTruck = ref(null);
  192. // 是否为接驳车
  193. const isTransferTruck = ref(false);
  194. // 工装设备数据(从接口获取)
  195. const toolingDevices = ref([]);
  196. // 工装设备搜索关键词
  197. const toolingSearchKeyword = ref('');
  198. let toolingSearchTimeout = null;
  199. // 选中的工装设备ID列表
  200. const selectedToolings = ref([]);
  201. // 工装设备位置映射 { toolingId: 'top' | 'bottom' }
  202. const toolingPositions = ref({});
  203. // 已选工装设备信息缓存 { toolingId: { id, no, name } }
  204. const selectedToolingCache = ref({});
  205. // 远程搜索料车(带防抖)
  206. const handleSearch = value => {
  207. if (!value || value.trim() === '') {
  208. truckNos.value = [];
  209. truckData.value = [];
  210. hasSearched.value = false;
  211. return;
  212. }
  213. // 清除之前的定时器
  214. if (searchTimeout) {
  215. clearTimeout(searchTimeout);
  216. }
  217. // 设置新的定时器,500ms 后执行搜索
  218. searchTimeout = setTimeout(async () => {
  219. try {
  220. const res = await getNoInStorageTruck(value);
  221. hasSearched.value = true;
  222. if (res.errorCode === 0) {
  223. if (res.datas && res.datas.length > 0) {
  224. // 保存完整的料车数据
  225. truckData.value = res.datas;
  226. // 将数据转换为 v-select 需要的格式
  227. truckNos.value = res.datas.map(item => ({
  228. label: item.truckNo + ' - ' + item.truckType,
  229. value: item.truckNo,
  230. }));
  231. } else {
  232. truckNos.value = [];
  233. truckData.value = [];
  234. }
  235. } else {
  236. showNotify({ type: 'danger', message: res.errorMessage || '搜索料车失败' });
  237. truckNos.value = [];
  238. truckData.value = [];
  239. }
  240. } catch (error) {
  241. console.error('搜索料车失败:', error);
  242. truckNos.value = [];
  243. truckData.value = [];
  244. }
  245. }, 500);
  246. };
  247. // 打开弹窗
  248. const openStation = station => {
  249. if (station.positionStatus === '已占用') {
  250. showNotify({ type: 'danger', message: '请选择空闲的还料区' });
  251. } else {
  252. visible.value = true;
  253. positionName.value = station.positionName;
  254. positionNo.value = station.positionNo;
  255. // 重置选择
  256. truckNo.value = '';
  257. truckNos.value = [];
  258. truckData.value = [];
  259. selectedTruck.value = null;
  260. hasSearched.value = false;
  261. // 重置工装设备选择
  262. isTransferTruck.value = false;
  263. selectedToolings.value = [];
  264. toolingPositions.value = {};
  265. selectedToolingCache.value = {};
  266. toolingDevices.value = [];
  267. toolingSearchKeyword.value = '';
  268. }
  269. };
  270. // 切换工装设备选择
  271. const toggleTooling = toolingId => {
  272. const index = selectedToolings.value.indexOf(toolingId);
  273. if (index > -1) {
  274. // 取消选择
  275. selectedToolings.value.splice(index, 1);
  276. delete toolingPositions.value[toolingId];
  277. delete selectedToolingCache.value[toolingId];
  278. } else {
  279. // 添加选择,默认位置为上层
  280. selectedToolings.value.push(toolingId);
  281. toolingPositions.value[toolingId] = 'top';
  282. // 缓存设备信息
  283. const device = toolingDevices.value.find(item => item.id === toolingId);
  284. if (device) {
  285. selectedToolingCache.value[toolingId] = { ...device };
  286. }
  287. }
  288. };
  289. // 更新工装设备位置
  290. const updatePosition = (toolingId, position) => {
  291. toolingPositions.value[toolingId] = position;
  292. };
  293. // 切换工装设备位置(上层/下层)
  294. const toggleToolingPosition = toolingId => {
  295. toolingPositions.value[toolingId] = toolingPositions.value[toolingId] === 'top' ? 'bottom' : 'top';
  296. };
  297. // 上层的工装设备ID集合
  298. const topToolings = computed(() => {
  299. return selectedToolings.value.filter(id => toolingPositions.value[id] === 'top');
  300. });
  301. // 下层的工装设备ID集合
  302. const bottomToolings = computed(() => {
  303. return selectedToolings.value.filter(id => toolingPositions.value[id] === 'bottom');
  304. });
  305. // 根据ID获取工装设备信息
  306. const getToolingById = id => {
  307. return selectedToolingCache.value[id] || toolingDevices.value.find(item => item.id === id);
  308. };
  309. // 移除工装设备选择
  310. const removeTooling = toolingId => {
  311. const index = selectedToolings.value.indexOf(toolingId);
  312. if (index > -1) {
  313. selectedToolings.value.splice(index, 1);
  314. delete toolingPositions.value[toolingId];
  315. delete selectedToolingCache.value[toolingId];
  316. }
  317. };
  318. // 搜索工装设备
  319. const searchToolingDevices = async () => {
  320. loading.value = true;
  321. try {
  322. const params = {
  323. name: toolingSearchKeyword.value.trim(),
  324. inStock: false,
  325. start: 0,
  326. length: 100,
  327. positionType: 'Stereoscopic',
  328. };
  329. const res = await findDeviceByCondition(params);
  330. if (res.errorCode === 0) {
  331. if (res.datas && res.datas.length > 0) {
  332. toolingDevices.value = res.datas.map(item => ({
  333. id: item.invId,
  334. no: item.no,
  335. name: item.name,
  336. position: item.position,
  337. inStock: item.inStock,
  338. }));
  339. } else {
  340. toolingDevices.value = [];
  341. showNotify({ type: 'danger', message: '未找到相关工装设备' });
  342. }
  343. } else {
  344. showNotify({ type: 'danger', message: res.errorMessage || '搜索工装设备失败' });
  345. toolingDevices.value = [];
  346. }
  347. } catch (error) {
  348. console.error('搜索工装设备失败:', error);
  349. showNotify({ type: 'danger', message: '搜索工装设备失败' });
  350. toolingDevices.value = [];
  351. } finally {
  352. loading.value = false;
  353. }
  354. };
  355. // 清空工装设备搜索
  356. const clearToolingSearch = () => {
  357. toolingSearchKeyword.value = '';
  358. loadInitialToolings();
  359. };
  360. // 输入时防抖搜索工装设备
  361. const handleToolingSearch = value => {
  362. // 清除之前的定时器
  363. if (toolingSearchTimeout) {
  364. clearTimeout(toolingSearchTimeout);
  365. }
  366. // 如果清空了,重新加载全部
  367. if (!value || value.trim() === '') {
  368. loadInitialToolings();
  369. return;
  370. }
  371. // 500ms 防抖
  372. toolingSearchTimeout = setTimeout(() => {
  373. searchToolingDevices();
  374. }, 500);
  375. };
  376. // 初始加载工装设备(选择接驳车后自动查询)
  377. const loadInitialToolings = async () => {
  378. loading.value = true;
  379. try {
  380. const params = {
  381. name: '',
  382. inStock: false,
  383. start: 0,
  384. length: 100,
  385. positionType: 'Stereoscopic',
  386. };
  387. const res = await findDeviceByCondition(params);
  388. if (res.errorCode === 0 && res.datas && res.datas.length > 0) {
  389. toolingDevices.value = res.datas.map(item => ({
  390. id: item.invId,
  391. no: item.no,
  392. name: item.name,
  393. position: item.position,
  394. inStock: item.inStock,
  395. }));
  396. } else {
  397. toolingDevices.value = [];
  398. }
  399. } catch (error) {
  400. console.error('加载工装设备失败:', error);
  401. toolingDevices.value = [];
  402. } finally {
  403. loading.value = false;
  404. }
  405. };
  406. // 弹窗关闭前的回调
  407. const handleDialogClose = async action => {
  408. if (action === 'cancel') {
  409. cancelTask();
  410. return true;
  411. }
  412. if (action === 'confirm') {
  413. return await generateTask();
  414. }
  415. return true;
  416. };
  417. // 根据还料货位和料车编号生成归还单和调度任务
  418. const generateTask = async () => {
  419. if (!truckNo.value) {
  420. showNotify({ type: 'danger', message: '请输入料车编号' });
  421. return false; // 返回 false 阻止关闭
  422. }
  423. // 如果是接驳车,检查是否选择了工装设备
  424. if (isTransferTruck.value && selectedToolings.value.length === 0) {
  425. showNotify({ type: 'danger', message: '接驳车需要至少选择一个工装设备' });
  426. return false; // 返回 false 阻止关闭
  427. }
  428. const params = {
  429. truckNo: truckNo.value,
  430. positionNo: positionNo.value,
  431. };
  432. // 如果是接驳车,添加工装设备参数
  433. if (isTransferTruck.value) {
  434. params.positionOneIds = topToolings.value;
  435. params.positionTwoIds = bottomToolings.value;
  436. }
  437. console.log('生成任务参数:', params);
  438. loading.value = true;
  439. try {
  440. const res = await generateTaskByBlankNo(params);
  441. if (res.errorCode === 0) {
  442. showNotify({ type: 'success', message: '绑定成功,等待AGV归还' });
  443. visible.value = false;
  444. truckNo.value = '';
  445. truckNos.value = [];
  446. truckData.value = [];
  447. selectedTruck.value = null;
  448. isTransferTruck.value = false;
  449. selectedToolings.value = [];
  450. toolingPositions.value = {};
  451. selectedToolingCache.value = {};
  452. toolingDevices.value = [];
  453. toolingSearchKeyword.value = '';
  454. await getStations();
  455. return true; // 成功后关闭弹窗
  456. } else {
  457. showNotify({ type: 'danger', message: res.errorMessage || '绑定失败' });
  458. return false; // 失败不关闭
  459. }
  460. } catch (error) {
  461. console.error('绑定失败:', error);
  462. showNotify({ type: 'danger', message: '绑定失败' });
  463. return false; // 异常不关闭
  464. } finally {
  465. loading.value = false;
  466. }
  467. };
  468. // 取消任务
  469. const cancelTask = () => {
  470. truckNo.value = '';
  471. truckNos.value = [];
  472. truckData.value = [];
  473. selectedTruck.value = null;
  474. hasSearched.value = false;
  475. visible.value = false;
  476. isTransferTruck.value = false;
  477. selectedToolings.value = [];
  478. toolingPositions.value = {};
  479. selectedToolingCache.value = {};
  480. toolingDevices.value = [];
  481. toolingSearchKeyword.value = '';
  482. };
  483. // 获取还料位数据
  484. const getStations = async () => {
  485. loading.value = true;
  486. try {
  487. const res = await getLocatorStatus();
  488. if (res.errorCode === 0) {
  489. if (res.datas && res.datas.length > 0) {
  490. stations.value = res.datas;
  491. } else {
  492. stations.value = [];
  493. }
  494. } else {
  495. showNotify({ type: 'danger', message: res.errorMessage });
  496. }
  497. } catch (error) {
  498. console.error('获取还料位数据失败:', error);
  499. showNotify({ type: 'danger', message: '获取还料位数据失败' });
  500. } finally {
  501. loading.value = false;
  502. }
  503. };
  504. // 监听料车编号变化,判断是否为接驳车
  505. watch(truckNo, newVal => {
  506. if (newVal) {
  507. // 从完整数据中找到对应的料车
  508. const truck = truckData.value.find(item => item.truckNo === newVal);
  509. if (truck) {
  510. selectedTruck.value = truck;
  511. // 判断是否为接驳车
  512. isTransferTruck.value = truck.truckType === '接驳车';
  513. // 如果切换料车,重置工装设备选择
  514. selectedToolings.value = [];
  515. toolingPositions.value = {};
  516. selectedToolingCache.value = {};
  517. toolingDevices.value = [];
  518. toolingSearchKeyword.value = '';
  519. // 如果是接驳车,自动查询工装设备
  520. if (isTransferTruck.value) {
  521. loadInitialToolings();
  522. }
  523. }
  524. } else {
  525. selectedTruck.value = null;
  526. isTransferTruck.value = false;
  527. selectedToolings.value = [];
  528. toolingPositions.value = {};
  529. selectedToolingCache.value = {};
  530. toolingDevices.value = [];
  531. toolingSearchKeyword.value = '';
  532. }
  533. });
  534. onMounted(() => {
  535. getStations();
  536. });
  537. </script>
  538. <style scoped>
  539. /* ========== 基础样式 ========== */
  540. .return-page {
  541. width: 100%;
  542. height: 100vh;
  543. position: relative;
  544. font-family: 'Microsoft YaHei', sans-serif;
  545. color: #fff;
  546. overflow: hidden;
  547. display: flex;
  548. flex-direction: column;
  549. }
  550. /* 背景层 */
  551. .bg-layer {
  552. position: fixed;
  553. top: 0;
  554. left: 0;
  555. width: 100%;
  556. height: 100%;
  557. background-color: #041c3d;
  558. background-size: cover;
  559. background-position: center;
  560. z-index: 0;
  561. }
  562. /* ========== 顶部标题区域 ========== */
  563. .header-section {
  564. position: relative;
  565. width: 100%;
  566. padding: 20px 30px;
  567. z-index: 10;
  568. display: flex;
  569. align-items: center;
  570. justify-content: center;
  571. flex-shrink: 0;
  572. }
  573. .back-btn {
  574. position: absolute;
  575. left: 30px;
  576. display: flex;
  577. align-items: center;
  578. gap: 8px;
  579. background: linear-gradient(90deg, #1a4a7a 0%, #0d3a6a 100%);
  580. border: 1px solid #2a7fff;
  581. border-radius: 8px;
  582. padding: 10px 20px;
  583. color: #fff;
  584. font-size: 16px;
  585. cursor: pointer;
  586. transition: all 0.3s;
  587. }
  588. .back-btn:hover {
  589. box-shadow: 0 0 15px rgba(30, 144, 255, 0.4);
  590. }
  591. .page-title {
  592. font-size: 28px;
  593. font-weight: bold;
  594. color: #ffffff;
  595. text-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
  596. }
  597. /* ========== 主内容区域 ========== */
  598. .main-content {
  599. flex: 1;
  600. overflow-y: auto;
  601. padding: 20px 30px;
  602. position: relative;
  603. z-index: 10;
  604. }
  605. /* 网格布局 */
  606. .stations-grid {
  607. display: grid;
  608. grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  609. gap: 20px;
  610. }
  611. /* ========== 卡片样式 ========== */
  612. .station-card {
  613. background: rgba(9, 61, 140, 0.6);
  614. border: 1px solid #049FD8;
  615. border-radius: 12px;
  616. padding: 20px;
  617. min-height: 280px;
  618. display: flex;
  619. flex-direction: column;
  620. cursor: pointer;
  621. transition: all 0.3s;
  622. }
  623. .station-card:hover {
  624. transform: translateY(-4px);
  625. box-shadow: 0 0 25px rgba(4, 159, 216, 0.4);
  626. }
  627. .station-occupied {
  628. border-color: #ef4444;
  629. background: rgba(239, 68, 68, 0.15);
  630. }
  631. .station-idle {
  632. border-color: #10b981;
  633. background: rgba(16, 185, 129, 0.1);
  634. }
  635. /* 卡片头部 */
  636. .card-header {
  637. display: flex;
  638. align-items: center;
  639. justify-content: space-between;
  640. margin-bottom: 15px;
  641. padding-bottom: 15px;
  642. border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  643. }
  644. .card-title {
  645. font-size: 20px;
  646. font-weight: bold;
  647. color: #fff;
  648. }
  649. /* 状态徽章 */
  650. .status-badge {
  651. padding: 6px 14px;
  652. border-radius: 20px;
  653. font-size: 14px;
  654. font-weight: 600;
  655. }
  656. .status-success {
  657. background: rgba(16, 185, 129, 0.2);
  658. color: #34d399;
  659. }
  660. .status-danger {
  661. background: rgba(239, 68, 68, 0.2);
  662. color: #f87171;
  663. }
  664. /* 卡片内容 */
  665. .card-content {
  666. flex: 1;
  667. display: flex;
  668. flex-direction: column;
  669. align-items: center;
  670. justify-content: center;
  671. }
  672. /* 物料显示区域 */
  673. .material-display {
  674. width: 100%;
  675. display: flex;
  676. flex-direction: column;
  677. align-items: center;
  678. }
  679. .material-image {
  680. width: 150px;
  681. height: 150px;
  682. display: flex;
  683. align-items: center;
  684. justify-content: center;
  685. background: rgba(255, 255, 255, 0.1);
  686. border-radius: 10px;
  687. padding: 15px;
  688. }
  689. .material-image img {
  690. max-width: 100%;
  691. max-height: 100%;
  692. object-fit: contain;
  693. filter: brightness(0) invert(1);
  694. }
  695. /* 空状态 */
  696. .empty-state {
  697. display: flex;
  698. flex-direction: column;
  699. align-items: center;
  700. gap: 10px;
  701. color: #7ec8ff;
  702. }
  703. .empty-state i {
  704. font-size: 48px;
  705. opacity: 0.5;
  706. }
  707. .empty-state span {
  708. font-size: 14px;
  709. }
  710. /* ========== 科技感弹窗样式覆盖 ========== */
  711. :deep(.large-dialog) {
  712. width: 90vw !important;
  713. max-width: 600px !important;
  714. border-radius: 16px !important;
  715. background: linear-gradient(135deg, #0a3d6d 0%, #041c3d 100%) !important;
  716. border: 1px solid #049FD8 !important;
  717. box-shadow: 0 0 40px rgba(4, 159, 216, 0.3) !important;
  718. }
  719. :deep(.large-dialog .van-dialog__header) {
  720. font-size: 22px !important;
  721. font-weight: bold !important;
  722. padding: 25px 25px 15px !important;
  723. color: #fff !important;
  724. }
  725. :deep(.large-dialog .van-dialog__content) {
  726. padding: 15px 25px 20px !important;
  727. }
  728. :deep(.large-dialog .van-dialog__footer) {
  729. padding: 15px 25px 25px !important;
  730. display: flex !important;
  731. gap: 15px !important;
  732. }
  733. :deep(.large-dialog .van-dialog__cancel),
  734. :deep(.large-dialog .van-dialog__confirm) {
  735. flex: 1 !important;
  736. height: 50px !important;
  737. font-size: 16px !important;
  738. font-weight: 600 !important;
  739. border-radius: 8px !important;
  740. }
  741. :deep(.large-dialog .van-dialog__cancel) {
  742. background: transparent !important;
  743. border: 1px solid #2a7fff !important;
  744. color: #7ec8ff !important;
  745. }
  746. :deep(.large-dialog .van-dialog__confirm) {
  747. background: linear-gradient(90deg, #1e90ff 0%, #00bfff 100%) !important;
  748. border: none !important;
  749. color: #fff !important;
  750. }
  751. .large-dialog-content {
  752. min-height: 100px;
  753. display: flex;
  754. flex-direction: column;
  755. }
  756. .large-dialog-content p {
  757. margin: 0;
  758. font-size: 16px;
  759. line-height: 1.8;
  760. color: #7ec8ff;
  761. text-align: center;
  762. }
  763. .dialog-form-item {
  764. width: 100%;
  765. margin-top: 15px;
  766. }
  767. /* v-select 深色科技风格样式 */
  768. .dialog-select {
  769. font-size: 1rem;
  770. }
  771. :deep(.dialog-select .vs__dropdown-toggle) {
  772. border: 1px solid #2a7fff;
  773. border-radius: 6px;
  774. padding: 8px 12px;
  775. min-height: 44px;
  776. background: rgba(13, 58, 106, 0.8);
  777. }
  778. :deep(.dialog-select .vs__search) {
  779. font-size: 1rem;
  780. padding: 0;
  781. margin: 0;
  782. color: #fff;
  783. }
  784. :deep(.dialog-select .vs__search::placeholder) {
  785. color: #7ec8ff;
  786. opacity: 0.7;
  787. }
  788. :deep(.dialog-select .vs__selected) {
  789. margin: 2px;
  790. padding: 0 4px;
  791. font-size: 1rem;
  792. color: #fff;
  793. }
  794. :deep(.dialog-select .vs__actions svg) {
  795. fill: #7ec8ff;
  796. }
  797. :deep(.dialog-select .vs__clear svg) {
  798. fill: #7ec8ff;
  799. }
  800. :deep(.dialog-select .vs__dropdown-menu) {
  801. z-index: 9999 !important;
  802. border: 1px solid #2a7fff;
  803. border-radius: 6px;
  804. background: rgba(13, 58, 106, 0.95);
  805. box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  806. font-size: 1rem;
  807. }
  808. :deep(.dialog-select .vs__dropdown-option) {
  809. padding: 10px 12px;
  810. color: #fff;
  811. }
  812. :deep(.dialog-select .vs__dropdown-option--highlight) {
  813. background: rgba(30, 144, 255, 0.3);
  814. }
  815. /* ========== 工装设备选择区域样式 ========== */
  816. .tooling-section {
  817. margin-top: 14px;
  818. padding: 12px 14px;
  819. border-radius: 12px;
  820. border: 1px solid rgba(4, 159, 216, 0.7);
  821. background: radial-gradient(circle at top, rgba(30, 144, 255, 0.15) 0%, rgba(4, 28, 61, 0.95) 55%, rgba(4, 28, 61, 0.98) 100%);
  822. box-shadow: 0 0 25px rgba(4, 159, 216, 0.35);
  823. }
  824. .section-title {
  825. display: flex;
  826. align-items: center;
  827. gap: 8px;
  828. margin-bottom: 10px;
  829. font-size: 14px;
  830. font-weight: 600;
  831. color: #e5f4ff;
  832. }
  833. .section-title .van-icon {
  834. font-size: 18px;
  835. color: #38bdf8;
  836. }
  837. /* 搜索行 */
  838. .tooling-header-row {
  839. display: flex;
  840. align-items: center;
  841. gap: 8px;
  842. margin-bottom: 8px;
  843. }
  844. .tooling-input {
  845. flex: 1;
  846. }
  847. :deep(.tooling-input.van-field) {
  848. padding: 4px 10px;
  849. background: rgba(5, 40, 80, 0.95);
  850. border-radius: 8px;
  851. border: 1px solid rgba(56, 189, 248, 0.6);
  852. font-size: 13px;
  853. color: #e5f4ff;
  854. }
  855. :deep(.tooling-input .van-field__control) {
  856. color: #e5f4ff;
  857. }
  858. :deep(.tooling-input .van-field__control::placeholder) {
  859. color: rgba(148, 163, 184, 0.85);
  860. }
  861. :deep(.tooling-input .van-field__left-icon) {
  862. color: #38bdf8;
  863. margin-right: 4px;
  864. }
  865. .selected-count {
  866. flex-shrink: 0;
  867. }
  868. /* 已选工装设备芯片 */
  869. .selected-toolings {
  870. display: flex;
  871. flex-wrap: wrap;
  872. gap: 6px;
  873. margin-bottom: 8px;
  874. padding: 6px 8px;
  875. background: linear-gradient(90deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.9));
  876. border-radius: 8px;
  877. min-height: 32px;
  878. max-height: 72px;
  879. overflow-y: auto;
  880. }
  881. .selected-chip {
  882. display: inline-flex;
  883. align-items: center;
  884. gap: 4px;
  885. padding: 3px 6px 3px 8px;
  886. border-radius: 999px;
  887. font-size: 12px;
  888. cursor: pointer;
  889. transition: all 0.15s ease;
  890. user-select: none;
  891. }
  892. .chip-top {
  893. background: rgba(16, 185, 129, 0.15);
  894. color: #bbf7d0;
  895. border: 1px solid rgba(34, 197, 94, 0.8);
  896. box-shadow: 0 0 10px rgba(34, 197, 94, 0.45);
  897. }
  898. .chip-top:hover {
  899. background: rgba(16, 185, 129, 0.25);
  900. }
  901. .chip-bottom {
  902. background: rgba(245, 158, 11, 0.16);
  903. color: #fed7aa;
  904. border: 1px solid rgba(245, 158, 11, 0.85);
  905. box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
  906. }
  907. .chip-bottom:hover {
  908. background: rgba(245, 158, 11, 0.24);
  909. }
  910. .chip-text {
  911. font-weight: 600;
  912. }
  913. .chip-pos {
  914. font-size: 10px;
  915. padding: 1px 6px;
  916. border-radius: 999px;
  917. font-weight: 700;
  918. }
  919. .chip-top .chip-pos {
  920. background: #22c55e;
  921. color: #0b1120;
  922. }
  923. .chip-bottom .chip-pos {
  924. background: #f97316;
  925. color: #0b1120;
  926. }
  927. .chip-close {
  928. font-size: 12px;
  929. color: #9ca3af;
  930. margin-left: 2px;
  931. transition: color 0.15s;
  932. }
  933. .chip-close:hover {
  934. color: #ef4444;
  935. }
  936. /* 工装设备列表 */
  937. .tooling-list {
  938. display: flex;
  939. flex-direction: column;
  940. gap: 6px;
  941. max-height: 220px;
  942. overflow-y: auto;
  943. padding: 2px;
  944. }
  945. /* 工装设备项 */
  946. .tooling-item {
  947. background: rgba(15, 23, 42, 0.95);
  948. border: 1px solid rgba(51, 136, 255, 0.6);
  949. border-radius: 8px;
  950. padding: 8px 10px;
  951. transition: all 0.18s ease;
  952. cursor: pointer;
  953. box-shadow: 0 4px 14px rgba(15, 23, 42, 0.8);
  954. }
  955. .tooling-item:hover {
  956. border-color: #38bdf8;
  957. box-shadow: 0 0 18px rgba(56, 189, 248, 0.5);
  958. }
  959. .tooling-item.tooling-selected {
  960. background: radial-gradient(circle at top, rgba(56, 189, 248, 0.4) 0%, rgba(15, 23, 42, 0.98) 45%, rgba(15, 23, 42, 1) 100%);
  961. border-color: #38bdf8;
  962. }
  963. .tooling-header {
  964. display: flex;
  965. align-items: center;
  966. }
  967. .tooling-info {
  968. display: flex;
  969. align-items: center;
  970. gap: 8px;
  971. }
  972. .tooling-no {
  973. display: inline-block;
  974. padding: 2px 8px;
  975. background: linear-gradient(120deg, #22d3ee, #6366f1);
  976. color: #0b1120;
  977. border-radius: 4px;
  978. font-size: 0.75rem;
  979. font-weight: 600;
  980. }
  981. .tooling-name {
  982. font-size: 0.8125rem;
  983. font-weight: 500;
  984. color: #e5e7eb;
  985. max-width: 180px;
  986. overflow: hidden;
  987. text-overflow: ellipsis;
  988. white-space: nowrap;
  989. }
  990. /* 位置选择器 */
  991. .position-selector {
  992. margin-top: 6px;
  993. padding-top: 6px;
  994. padding-left: 24px;
  995. border-top: 1px dashed rgba(148, 163, 184, 0.6);
  996. display: flex;
  997. align-items: center;
  998. gap: 8px;
  999. }
  1000. .position-label {
  1001. font-size: 0.75rem;
  1002. font-weight: 500;
  1003. color: #cbd5f5;
  1004. white-space: nowrap;
  1005. }
  1006. :deep(.position-selector .van-radio-group) {
  1007. display: flex;
  1008. gap: 12px;
  1009. }
  1010. :deep(.position-selector .van-radio) {
  1011. display: flex;
  1012. align-items: center;
  1013. }
  1014. .position-text {
  1015. font-size: 0.8125rem;
  1016. font-weight: 500;
  1017. color: #e5e7eb;
  1018. }
  1019. /* 选择汇总 */
  1020. .tooling-summary {
  1021. margin-top: 8px;
  1022. padding-top: 8px;
  1023. border-top: 1px solid rgba(148, 163, 184, 0.6);
  1024. display: flex;
  1025. justify-content: center;
  1026. align-items: center;
  1027. gap: 16px;
  1028. }
  1029. .summary-text {
  1030. font-size: 0.8125rem;
  1031. color: #e5f4ff;
  1032. }
  1033. .summary-text b {
  1034. color: #38bdf8;
  1035. font-weight: 700;
  1036. }
  1037. .summary-divider {
  1038. color: #64748b;
  1039. }
  1040. /* 无数据提示 */
  1041. .tooling-empty {
  1042. display: flex;
  1043. flex-direction: column;
  1044. align-items: center;
  1045. justify-content: center;
  1046. gap: 8px;
  1047. padding: 24px 16px;
  1048. color: #9ca3af;
  1049. font-size: 0.8125rem;
  1050. }
  1051. /* 过渡动画 */
  1052. .fade-slide-enter-active,
  1053. .fade-slide-leave-active {
  1054. transition: all 0.3s ease;
  1055. }
  1056. .fade-slide-enter-from {
  1057. opacity: 0;
  1058. transform: translateY(-10px);
  1059. }
  1060. .fade-slide-leave-to {
  1061. opacity: 0;
  1062. transform: translateY(-10px);
  1063. }
  1064. .expand-enter-active,
  1065. .expand-leave-active {
  1066. transition: all 0.3s ease;
  1067. overflow: hidden;
  1068. }
  1069. .expand-enter-from,
  1070. .expand-leave-to {
  1071. opacity: 0;
  1072. max-height: 0;
  1073. padding-top: 0;
  1074. margin-top: 0;
  1075. }
  1076. .expand-enter-to,
  1077. .expand-leave-from {
  1078. opacity: 1;
  1079. max-height: 100px;
  1080. }
  1081. @media screen and (orientation: landscape) {
  1082. :deep(.v-select .vs__dropdown-toggle,
  1083. .dark-select .vs__dropdown-toggle,
  1084. .filter-select .vs__dropdown-toggle,
  1085. .dialog-select .vs__dropdown-toggle) {
  1086. padding: 8px 12px !important;
  1087. min-height: 48px !important;
  1088. }
  1089. }
  1090. /* 工装列表滚动条 - 深色科技风 */
  1091. .tooling-list::-webkit-scrollbar {
  1092. width: 6px;
  1093. }
  1094. .tooling-list::-webkit-scrollbar-track {
  1095. background: rgba(15, 23, 42, 0.9);
  1096. border-radius: 3px;
  1097. }
  1098. .tooling-list::-webkit-scrollbar-thumb {
  1099. background: linear-gradient(180deg, #38bdf8, #6366f1);
  1100. border-radius: 3px;
  1101. box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  1102. }
  1103. .tooling-list::-webkit-scrollbar-thumb:hover {
  1104. background: linear-gradient(180deg, #0ea5e9, #4f46e5);
  1105. }
  1106. </style>