| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040 |
- <!-- 常用领料 -->
- <template>
- <div class="page-container">
- <!-- 顶部信息栏 -->
- <PageHeader :is-go-home="false" title="常用领料">
- <template #actions>
- <button class="action-btn cart-btn" @click="openStockOutCar">
- <van-badge :content="count" :show-zero="true">
- <i class="fas fa-shopping-cart text-xl" />
- </van-badge>
- <span class="ml-2">领料车</span>
- </button>
- </template>
- </PageHeader>
- <!-- 主内容区域 -->
- <main class="main-content">
- <!-- 页面标题 -->
- <!-- <div class="page-title">
- <h2>常用领料</h2>
- </div> -->
- <!-- 筛选区域 -->
- <FilterPanel :default-collapsed="false" :enable-collapse="false" :active-count="getActiveFilterCount()">
- <div class="filter-form">
- <div class="filter-item">
- <label class="filter-label">仓库</label>
- <v-select
- v-model="warehouseId" :options="warehouseList" :reduce="item => item.id" label="name"
- placeholder="选择仓库" :clearable="true" :filterable="true" class="filter-select"
- @update:model-value="getDatas"
- >
- <template #no-options>
- <span>无该选项数据</span>
- </template>
- </v-select>
- </div>
- <div class="filter-item">
- <label class="filter-label">名称</label>
- <van-field v-model="inventoryName" placeholder="输入名称" class="filter-input" @keyup.enter="getDatas" />
- </div>
- <div class="filter-item">
- <label class="filter-label">编号</label>
- <van-field v-model="inventoryNo" placeholder="输入编号" class="filter-input" @keyup.enter="getDatas" />
- </div>
- <div class="filter-item">
- <label class="filter-label">类型</label>
- <v-select
- v-model="inventoryType" :options="inventoryTypeList" :reduce="item => item.value" label="label"
- placeholder="选择类型" :clearable="true" :filterable="true" class="filter-select"
- @update:model-value="getDatas"
- >
- <template #no-options>
- <span>无该选项数据</span>
- </template>
- </v-select>
- </div>
- <div class="filter-item filter-buttons">
- <van-button type="primary" @click="getDatas">
- <i class="fas fa-search mr-1" /> 搜索
- </van-button>
- <van-button class="ml-2" @click="handleReset">
- <i class="fas fa-redo mr-1" /> 重置
- </van-button>
- </div>
- </div>
- </FilterPanel>
- <!-- 卡片容器 -->
- <div class="card-container">
- <!-- 全选控制栏 -->
- <div v-if="stockRequisitionList.length > 0" class="select-all-bar">
- <van-checkbox :model-value="isAllSelected" @update:model-value="toggleSelectAll">
- <span class="select-all-text">全选当前页(已选 {{ selectedIds.length }} 项)</span>
- </van-checkbox>
- </div>
- <!-- 卡片列表区域 -->
- <div class="card-list-wrapper">
- <!-- 空状态 -->
- <van-empty v-if="stockRequisitionList.length === 0" description="暂无数据" />
- <!-- 卡片列表 -->
- <div v-else class="card-list">
- <div
- v-for="(item, index) in stockRequisitionList" :key="item.id || index"
- :class="{ 'selected-card': selectedIds.includes(item.id) }" class="inventory-card"
- @click="toggleSelect(item.id)"
- >
- <div class="card-header">
- <div class="card-header-left">
- <van-checkbox
- :model-value="selectedIds.includes(item.id)" @click.stop
- @update:model-value="checked => handleCheckboxChange(checked, item.id)"
- />
- <div class="custom-avatar ml-3">
- <i :class="getInventoryIcon(item.inventoryType)" />
- </div>
- <div class="ml-4 card-title-info">
- <div class="card-name">{{ item.inventoryName }}</div>
- <div class="card-subtitle">编号: {{ item.inventoryNo }}</div>
- </div>
- </div>
- <div class="card-header-center">
- <div class="card-stats">
- <div class="stat-item">
- <i class="fas fa-history" />
- <span class="stat-label">借用次数</span>
- <span class="stat-value">{{ item.borrowTotal || 0 }}次</span>
- </div>
- <div class="stat-item">
- <i class="fas fa-clock" />
- <span class="stat-label">上次借用</span>
- <span class="stat-value">{{ item.lastBorrowTime || '暂无记录' }}</span>
- </div>
- </div>
- </div>
- <div class="card-header-right">
- <div class="card-location">
- <i class="fas fa-map-marker-alt mr-2" />
- <span>{{ item.inventoryActulPosition || item.inventoryPosition || '-' }}</span>
- <span class="mx-2">/</span>
- <span>{{ item.inventoryWarehouse || '-' }}</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 分页区域(固定底部) -->
- <div v-if="stockRequisitionList.length > 0" class="pagination-wrapper">
- <div class="pagination-info">
- 第{{ (pagination.current_page - 1) * pagination.per_page + 1 }}-{{ Math.min(pagination.current_page *
- pagination.per_page, pagination.total) }}条,共{{ pagination.total }}条
- </div>
- <div class="pagination-controls">
- <button
- class="pagination-btn" :disabled="pagination.current_page === 1"
- @click="handlePageChange(pagination.current_page - 1)"
- >
- <
- </button>
- <template v-for="page in getPageNumbers()" :key="page">
- <button
- v-if="page !== '...'" class="pagination-btn" :class="{ active: page === pagination.current_page }"
- @click="handlePageChange(page)"
- >
- {{ page }}
- </button>
- <span v-else class="pagination-ellipsis">...</span>
- </template>
- <button
- class="pagination-btn"
- :disabled="pagination.current_page === Math.ceil(pagination.total / pagination.per_page)"
- @click="handlePageChange(pagination.current_page + 1)"
- >
- >
- </button>
- </div>
- <div class="pagination-size">
- <v-select
- v-model="pagination.per_page" :options="pageSizeOptions" :clearable="false" :searchable="false"
- :append-to-body="true" :calculate-position="withPopper" class="size-select"
- @update:model-value="handlePageSizeChange"
- >
- <template #selected-option="{ label }">
- {{ label }}条/页
- </template>
- <template #option="{ label }">
- {{ label }}条/页
- </template>
- </v-select>
- </div>
- </div>
- </div>
- </main>
- <!-- 底部操作按钮 -->
- <div class="bottom-actions">
- <van-button
- type="primary" size="large" :disabled="selectedIds.length === 0" class="add-to-cart-btn"
- @click="submitStock"
- >
- <i class="fas fa-cart-plus mr-2" />
- 加入领料车
- </van-button>
- </div>
- <Loading v-if="loading" />
- </div>
- </template>
- <script setup>
- import { ref, computed, onMounted } from 'vue';
- import { useRouter } from 'vue-router';
- import Common from '../common/Common.js';
- import { showNotify } from 'vant';
- import vSelect from 'vue-select';
- import 'vue-select/dist/vue-select.css';
- import { createPopper } from '@popperjs/core';
- // 为 vue-select 配置 popper
- const withPopper = (dropdownList, component, { width }) => {
- dropdownList.style.width = width;
- const popper = createPopper(component.$refs.toggle, dropdownList, {
- placement: 'bottom',
- modifiers: [
- {
- name: 'offset',
- options: { offset: [0, -1] },
- },
- {
- name: 'toggleClass',
- enabled: true,
- phase: 'write',
- fn({ state }) {
- component.$el.classList.toggle('drop-up', state.placement === 'top');
- },
- },
- ],
- });
- return () => popper.destroy();
- };
- import PageHeader from '../common/PageHeader.vue';
- import FilterPanel from '../common/FilterPanel.vue';
- import { getWarehouseList } from '../api/stock.js';
- import { queryCommonUse, createStockOutPrepareLine, queryPickingCarNumber } from '../api/stockOut.js';
- const router = useRouter();
- const warehouseId = ref(undefined);
- const inventoryName = ref('');
- const inventoryNo = ref('');
- const inventoryType = ref(undefined);
- const count = ref(0);
- const warehouseList = ref([]);
- const stockRequisitionList = ref([]);
- const selectedIds = ref([]);
- // 计算是否全选
- const isAllSelected = computed(() => {
- if (stockRequisitionList.value.length === 0) return false;
- return stockRequisitionList.value.every(item => selectedIds.value.includes(item.id));
- });
- const loading = ref(false);
- const inventoryTypeList = ref([
- { value: 'Clamp', label: '工装' },
- { value: 'Instrument', label: '设备' },
- { value: 'FinishProduct', label: '成品' },
- ]);
- const pagination = ref({
- total: 0,
- current_page: 1,
- per_page: 20,
- });
- const pageSizeOptions = [10, 20, 50, 100, 200, 500];
- // 计算激活的筛选条件数量
- const getActiveFilterCount = () => {
- let count = 0;
- if (warehouseId.value) count++;
- if (inventoryName.value) count++;
- if (inventoryNo.value) count++;
- if (inventoryType.value) count++;
- return count;
- };
- // 打开领料车
- const openStockOutCar = () => {
- router.push('/stock-picking-car?isRegular=true');
- };
- // 切换选择
- const toggleSelect = id => {
- const index = selectedIds.value.indexOf(id);
- if (index > -1) {
- selectedIds.value.splice(index, 1);
- } else {
- selectedIds.value.push(id);
- }
- };
- // 处理复选框变化
- const handleCheckboxChange = (checked, id) => {
- if (checked) {
- if (!selectedIds.value.includes(id)) {
- selectedIds.value.push(id);
- }
- } else {
- const index = selectedIds.value.indexOf(id);
- if (index > -1) {
- selectedIds.value.splice(index, 1);
- }
- }
- };
- // 全选/取消全选
- const toggleSelectAll = checked => {
- if (checked) {
- // 全选当前页所有项(累加模式)
- stockRequisitionList.value.forEach(item => {
- if (!selectedIds.value.includes(item.id)) {
- selectedIds.value.push(item.id);
- }
- });
- } else {
- // 取消全选当前页
- const currentPageIds = stockRequisitionList.value.map(item => item.id);
- selectedIds.value = selectedIds.value.filter(id => !currentPageIds.includes(id));
- }
- };
- // 获取设备类型图标
- const getInventoryIcon = type => {
- const iconMap = {
- '工装': 'fas fa-cube',
- '设备': 'fas fa-cogs',
- '成品': 'fas fa-box',
- };
- return iconMap[type] || 'fas fa-cube';
- };
- // 分页改变
- const handlePageChange = page => {
- pagination.value.current_page = page;
- getStockRequisitionList();
- };
- // 每页大小改变
- const handlePageSizeChange = pageSize => {
- pagination.value.per_page = pageSize;
- pagination.value.current_page = 1;
- getStockRequisitionList();
- };
- // 获取分页页码数组
- const getPageNumbers = () => {
- const totalPages = Math.ceil(pagination.value.total / pagination.value.per_page);
- const current = pagination.value.current_page;
- const pages = [];
- if (totalPages <= 7) {
- for (let i = 1; i <= totalPages; i++) {
- pages.push(i);
- }
- } else {
- if (current <= 3) {
- for (let i = 1; i <= 5; i++) pages.push(i);
- pages.push('...');
- pages.push(totalPages);
- } else if (current >= totalPages - 2) {
- pages.push(1);
- pages.push('...');
- for (let i = totalPages - 4; i <= totalPages; i++) pages.push(i);
- } else {
- pages.push(1);
- pages.push('...');
- for (let i = current - 1; i <= current + 1; i++) pages.push(i);
- pages.push('...');
- pages.push(totalPages);
- }
- }
- return pages;
- };
- // 查询物料数据
- const getStockRequisitionList = async () => {
- loading.value = true;
- const params = {
- inventoryName: inventoryName.value,
- inventoryNo: inventoryNo.value,
- inventoryType: inventoryType.value,
- warehouseId: warehouseId.value,
- range: {
- start: (pagination.value.current_page - 1) * pagination.value.per_page,
- length: pagination.value.per_page,
- },
- };
- try {
- const res = await queryCommonUse(params);
- if (res.errorCode == 0) {
- if (res.datas && res.datas.length > 0) {
- stockRequisitionList.value = res.datas;
- pagination.value.total = res.total;
- } else {
- stockRequisitionList.value = [];
- pagination.value.total = 0;
- }
- }
- } catch (error) {
- showNotify({ type: 'danger', message: '查询常用物料API失败' });
- console.error('查询常用物料API失败', error);
- } finally {
- loading.value = false;
- }
- };
- // 获取仓库列表
- const getWarehouses = async () => {
- try {
- const res = await getWarehouseList();
- if (res.errorCode == 0) {
- if (res.datas && res.datas.length > 0) {
- warehouseList.value = res.datas;
- } else {
- warehouseList.value = [];
- }
- } else {
- showNotify({ type: 'danger', message: res.errorMessage });
- }
- } catch (error) {
- console.error('获取仓库数据失败:', error);
- showNotify({ type: 'danger', message: '获取库存数据失败' });
- }
- };
- // 重置筛选条件
- const handleReset = () => {
- warehouseId.value = undefined;
- inventoryName.value = '';
- inventoryNo.value = '';
- inventoryType.value = undefined;
- getDatas();
- };
- // 查询
- const getDatas = () => {
- pagination.value.current_page = 1;
- getStockRequisitionList();
- };
- // 加入领料车
- const submitStock = async () => {
- if (selectedIds.value.length == 0) {
- showNotify({ type: 'warning', message: '请至少选择一个物料' });
- return;
- }
- loading.value = true;
- const params = {
- inventoryIds: selectedIds.value,
- };
- try {
- const res = await createStockOutPrepareLine(params);
- if (res.errorCode == 0) {
- selectedIds.value = [];
- getDatas();
- queryPickingCarCount();
- showNotify({ type: 'success', message: '已添加到领料车' });
- }
- } catch (error) {
- console.error('添加领料车失败:', error);
- showNotify({ type: 'danger', message: '添加到领料车失败' });
- } finally {
- loading.value = false;
- }
- };
- /**
- * 查询领料车中的数量
- */
- const queryPickingCarCount = async () => {
- try {
- const res = await queryPickingCarNumber();
- if (res.errorCode == 0) {
- if (res.data) {
- count.value = res.data;
- } else {
- count.value = 0;
- }
- } else {
- showNotify({ type: 'warning', message: res.errorMessage });
- }
- } catch (error) {
- console.error('查询领料车数量失败:', error);
- showNotify({ type: 'danger', message: '查询领料车数量失败' });
- }
- };
- onMounted(() => {
- getDatas();
- getWarehouses();
- queryPickingCarCount();
- });
- </script>
- <style scoped>
- /* 页面容器 - 固定高度布局 */
- .page-container {
- display: flex;
- flex-direction: column;
- height: 100vh;
- background-color: #f9fafb;
- overflow: hidden;
- }
- /* 主内容区 - 可滚动 */
- .main-content {
- flex: 1;
- overflow-y: auto;
- padding: 1rem;
- display: flex;
- flex-direction: column;
- }
- /* 页面标题 */
- .page-title {
- margin-bottom: 1.5rem;
- }
- .page-title h2 {
- font-size: 1.5rem;
- font-weight: 700;
- color: #111827;
- margin: 0;
- }
- /* 卡片容器 */
- .card-container {
- flex: 1;
- background-color: white;
- border-radius: 0.5rem;
- box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
- display: flex;
- flex-direction: column;
- overflow: hidden;
- min-height: 0;
- }
- /* 卡片列表包装器(可滚动区域) */
- .card-list-wrapper {
- flex: 1;
- overflow-y: auto;
- padding: 1.5rem;
- min-height: 0;
- }
- /* 卡片列表(单列布局) */
- .card-list {
- display: flex;
- flex-direction: column;
- font-weight: 600;
- }
- .card-list > * {
- margin-bottom: 1rem;
- }
- .card-list > *:last-child {
- margin-bottom: 0;
- }
- /* 分页包装器(固定底部) */
- .pagination-wrapper {
- padding: 0.5rem 1.5rem;
- border-top: 1px solid #e5e7eb;
- background-color: #fafafa;
- display: flex;
- justify-content: flex-end;
- align-items: center;
- }
- .pagination-wrapper > * {
- margin-left: 1rem;
- }
- .pagination-wrapper > *:first-child {
- margin-left: 0;
- }
- .pagination-info {
- font-size: 14px;
- color: #6b7280;
- white-space: nowrap;
- }
- .pagination-controls {
- display: flex;
- align-items: center;
- }
- .pagination-controls > * {
- margin-right: 0.25rem;
- }
- .pagination-controls > *:last-child {
- margin-right: 0;
- }
- .pagination-btn {
- min-width: 32px;
- height: 32px;
- padding: 0 8px;
- border: 1px solid #d1d5db;
- background: white;
- color: #374151;
- border-radius: 4px;
- cursor: pointer;
- font-size: 14px;
- transition: all 0.2s;
- }
- .pagination-btn:hover:not(:disabled) {
- border-color: #3b82f6;
- color: #3b82f6;
- }
- .pagination-btn.active {
- background: #3b82f6;
- border-color: #3b82f6;
- color: white;
- }
- .pagination-btn:disabled {
- opacity: 0.5;
- cursor: not-allowed;
- }
- .pagination-ellipsis {
- padding: 0 4px;
- color: #6b7280;
- }
- .pagination-size {
- display: flex;
- align-items: center;
- }
- .pagination-size > * {
- margin-right: 0.5rem;
- }
- .pagination-size > *:last-child {
- margin-right: 0;
- }
- .size-select {
- width: 150px;
- position: relative;
- z-index: 50;
- }
- :deep(.size-select .vs__dropdown-menu) {
- z-index: 9999 !important;
- }
- /* 底部操作按钮 */
- .bottom-actions {
- position: sticky;
- bottom: 0;
- padding: 0 1rem 1rem 1rem;
- background-color: #f9fafb;
- display: flex;
- justify-content: flex-end;
- z-index: 10;
- }
- /* 领料车按钮样式 */
- .cart-btn {
- background-color: #d1fae5;
- color: #065f46;
- padding: 0.5rem 1rem;
- border-radius: 0.5rem;
- font-weight: 500;
- transition: all 0.2s;
- display: inline-flex;
- align-items: center;
- border: none;
- cursor: pointer;
- font-size: 14px;
- }
- .cart-btn:hover {
- background-color: #a7f3d0;
- }
- /* 筛选表单 */
- .filter-form {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- }
- .filter-form > * {
- margin-right: 1rem;
- margin-bottom: 0.4rem;
- }
- .filter-item {
- display: flex;
- align-items: center;
- }
- .filter-item > * {
- margin-right: 0.5rem;
- }
- .filter-item > *:last-child {
- margin-right: 0;
- }
- .filter-label {
- font-size: 14px;
- font-weight: 600;
- white-space: nowrap;
- color: #374151;
- }
- .filter-select {
- width: 200px;
- position: relative;
- z-index: 100;
- }
- .filter-input {
- width: 200px;
- }
- :deep(.filter-input .van-cell) {
- padding: 8px 12px !important;
- border: 1px solid #d1d5db !important;
- border-radius: 4px !important;
- background-color: white !important;
- min-height: 32px !important;
- box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
- }
- :deep(.filter-input .van-cell::after) {
- display: none !important;
- }
- :deep(.filter-input .van-field__body) {
- border: none !important;
- }
- :deep(.filter-input .van-field__control) {
- font-size: 14px;
- }
- /* Vue Select 样式 */
- :deep(.v-select) {
- font-size: 14px;
- }
- :deep(.v-select .vs__dropdown-toggle) {
- border: 1px solid #d1d5db;
- border-radius: 4px;
- padding: 4px 8px;
- min-height: 32px;
- background: white;
- }
- :deep(.v-select .vs__dropdown-menu) {
- z-index: 9999 !important;
- border: 1px solid #d1d5db;
- box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
- }
- :deep(.v-select .vs__selected) {
- margin: 2px;
- padding: 0 4px;
- }
- :deep(.v-select .vs__search) {
- padding: 0;
- margin: 0;
- }
- :deep(.v-select .vs__actions) {
- padding: 0 4px;
- }
- .filter-buttons {
- display: flex;
- }
- .filter-buttons > * {
- margin-right: 0.5rem;
- }
- .filter-buttons > *:last-child {
- margin-right: 0;
- }
- /* 库存卡片样式 */
- .inventory-card {
- cursor: pointer;
- transition: all 0.25s ease;
- border: 2px solid #e5e7eb;
- background-color: #ffffff;
- border-radius: 0.5rem;
- }
- .inventory-card:hover {
- border-color: #93c5fd;
- box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
- }
- .inventory-card.selected-card {
- border-color: #3b82f6 !important;
- background-color: #eff6ff;
- box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
- }
- /* 卡片标题区域 */
- .card-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- width: 100%;
- }
- .card-header > * {
- margin-right: 1.5rem;
- }
- .card-header > *:last-child {
- margin-right: 0;
- }
- .card-header-left {
- display: flex;
- align-items: center;
- flex: 1;
- min-width: 0;
- }
- .card-header-center {
- display: flex;
- align-items: center;
- flex-shrink: 0;
- }
- .card-header-right {
- display: flex;
- align-items: center;
- flex-shrink: 0;
- }
- .card-header-right > * {
- margin-left: 1rem;
- }
- .card-header-right > *:first-child {
- margin-left: 0;
- }
- /* 卡片标题信息 */
- .card-title-info {
- display: flex;
- flex-direction: column;
- min-width: 0;
- }
- .card-title-info > * {
- margin-bottom: 0.25rem;
- }
- .card-title-info > *:last-child {
- margin-bottom: 0;
- }
- .card-name {
- font-size: 1.2rem;
- font-weight: 600;
- color: #111827;
- line-height: 1.5;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .card-subtitle {
- font-size: 0.875rem;
- color: #6b7280;
- line-height: 1.4;
- }
- /* 卡片位置信息 */
- .card-location {
- display: flex;
- align-items: center;
- padding: 0.5rem 1rem;
- background-color: #f3f4f6;
- border-radius: 0.375rem;
- font-size: 0.875rem;
- color: #374151;
- white-space: nowrap;
- }
- .card-location i {
- color: #3b82f6;
- }
- .card-location {
- flex-shrink: 0;
- }
- /* 卡片统计信息 */
- .card-stats {
- display: flex;
- align-items: center;
- padding: 0.4rem 1.25rem;
- background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
- border-radius: 0.5rem;
- margin-top: 0.75rem;
- }
- .card-stats > * {
- margin-right: 1.5rem;
- }
- .card-stats > *:last-child {
- margin-right: 0;
- }
- .stat-item {
- display: flex;
- align-items: center;
- color: #0369a1;
- }
- .stat-item > * {
- margin-right: 0.5rem;
- }
- .stat-item > *:last-child {
- margin-right: 0;
- }
- .stat-item i {
- font-size: 0.875rem;
- color: #0284c7;
- }
- .stat-label {
- font-size: 0.75rem;
- color: #64748b;
- font-weight: 500;
- }
- .stat-value {
- font-size: 0.875rem;
- font-weight: 600;
- color: #0c4a6e;
- }
- /* 自定义头像 */
- .custom-avatar {
- width: 42px;
- height: 42px;
- border-radius: 50%;
- background-color: #3b82f6;
- display: flex;
- align-items: center;
- justify-content: center;
- color: white;
- font-size: 20px;
- flex-shrink: 0;
- }
- /* 卡片内部样式 */
- .inventory-card .card-header {
- padding: 1rem 1.5rem;
- }
- /* 按钮样式 */
- :deep(.van-button--primary) {
- background-color: #3b82f6;
- border-color: #3b82f6;
- }
- :deep(.van-button--primary:active) {
- background-color: #2563eb;
- border-color: #2563eb;
- }
- .add-to-cart-btn {
- background-color: #10b981 !important;
- border-color: #10b981 !important;
- width: auto;
- padding: 0 24px;
- }
- :deep(.add-to-cart-btn.van-button--primary) {
- background-color: #10b981 !important;
- border-color: #10b981 !important;
- }
- :deep(.add-to-cart-btn.van-button--primary:active) {
- background-color: #059669 !important;
- border-color: #059669 !important;
- }
- :deep(.van-button--disabled) {
- opacity: 0.5;
- cursor: not-allowed;
- }
- .action-btn {
- padding: 0.5rem 1rem;
- border-radius: 0.5rem;
- font-weight: 500;
- transition: all 0.2s;
- display: inline-flex;
- align-items: center;
- border: none;
- cursor: pointer;
- }
- :deep(.van-cell) {
- border: 1px solid #ddd;
- border-radius: 6px;
- padding: 6px 8px !important;
- }
- :deep(.v-select .vs__dropdown-toggle) {
- padding: 6px 8px !important;
- }
- /* 全选控制栏 */
- .select-all-bar {
- background-color: white;
- padding: 1rem 1.5rem;
- border-bottom: 1px solid #e5e7eb;
- display: flex;
- align-items: center;
- }
- .select-all-text {
- font-size: 0.95rem;
- color: #374151;
- font-weight: 500;
- }
- </style>
|