feat(receiving): 收货管理模块界面优化,统一字号与状态色

- 收货详情/收货单信息(info-container)
  * 表单标签、输入框、单选、文本域、状态标签字号统一为 36rpx
  * 状态色统一:收货中-橙、已完成-绿、已取消-红
  * 备注框由 u-input 改为 u-textarea 长文本
  * 打印按钮字号 36rpx,并增加与收货单号框的间隔
  * 物流单号相机按钮调大
  * 货主选择框样式对齐新建页,单选选项增加间隔
- 新建收货任务(receivingCreate)
  * 表单字号统一 36rpx
  * 货主选择改为底部弹窗,来货照片与装卸信息优化
- 收货列表(receiving)
  * 新增状态/货主/日期筛选弹窗与创建收货任务入口
  * 状态标签按状态着色
  * 界面字号统一
- 收货明细/清单(detail-container、receivingList)
  * 空状态提示字号 34rpx
  * 明细状态色统一,标题字号调整
- random-storage
  * 样式微调:增加底部间距与分隔线
This commit is contained in:
zm2000 2026-11-17 18:11:53 +08:00
parent 1469179ff2
commit 7c90d2f498
7 changed files with 986 additions and 174 deletions

View File

@ -453,6 +453,8 @@ export default {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 15rpx;
border-bottom: 1rpx solid #f0f0f0;
::v-deep .u-tag__text {
font-size: 36rpx;

View File

@ -32,7 +32,7 @@
</view>
<!-- 空状态 -->
<view class="empty-detail" v-else>
<u-empty mode="list" text="请选择商品明细"></u-empty>
<u-empty mode="list" text="请选择商品明细" text-size="34rpx"></u-empty>
</view>
<!-- 商品列表分页显示区 -->
@ -277,7 +277,7 @@
getDetailStatusType(status) {
const map = {
'pending': 'warning',
'receiving': 'primary',
'receiving': 'warning',
'completed': 'success',
'cancelled': 'error'
};
@ -432,7 +432,7 @@
}
.section-title {
font-size: 32rpx;
font-size: 34rpx;
font-weight: bold;
color: #333;
margin-bottom: 20rpx;

View File

@ -1,12 +1,12 @@
<template>
<scroll-view class="scroll-container" scroll-y v-if="receivingInfo">
<u-form :model="receivingInfo" :rules="rules" ref="infoFormRef" label-width="180rpx">
<u-form class="form_box" :model="receivingInfo" :rules="rules" ref="infoFormRef" label-width="180rpx">
<view class="section">
<view class="section-title">基础信息</view>
<u-form-item label="收货单号">
<u-input v-model="receivingInfo.receiving_number" disabled />
<u-button style="width: 150rpx;" type="primary" @click="print">打印</u-button>
<u-button class="print-btn" style="width: 150rpx;" type="primary" @click="print">打印</u-button>
</u-form-item>
<u-form-item label="货主" prop="store_id">
@ -21,13 +21,13 @@
<u-icon name="arrow-right" size="24rpx" color="#2979ff"></u-icon>
</view>
</view>
<view v-else>{{ receivingInfo.store ? receivingInfo.store.store_remask : '未设置' }}</view>
<view v-else class="store-value-text">{{ receivingInfo.store ? receivingInfo.store.store_remask : '未设置' }}</view>
</u-form-item>
<u-form-item label="来货方式" prop="delivery_method">
<u-radio-group v-model="receivingInfo.delivery_method" disabled>
<u-radio v-for="item in deliveryMethods" :key="item.value" :name="item.value"
:label="item.label"></u-radio>
label-size="36rpx" :label="item.label"></u-radio>
</u-radio-group>
</u-form-item>
@ -39,7 +39,7 @@
<view class="tracking-input-wrap">
<u-input v-model="receivingInfo.tracking_number" placeholder="请输入物流单号" />
<view class="scan-camera-btn" @click="handleTrackingScan">
<u-icon name="camera" size="34rpx" color="#2979ff"></u-icon>
<u-icon name="camera" size="48rpx" color="#2979ff"></u-icon>
</view>
</view>
</u-form-item>
@ -55,7 +55,7 @@
<u-form-item label="装卸方式" prop="loading_method">
<u-radio-group v-model="receivingInfo.loading_method" disabled>
<u-radio v-for="item in loadingMethods" :key="item.value" :name="item.value"
:label="item.label"></u-radio>
label-size="36rpx" :label="item.label"></u-radio>
</u-radio-group>
</u-form-item>
@ -91,7 +91,7 @@
<view class="section">
<view class="section-title">备注信息</view>
<u-form-item label="备注">
<u-input v-model="receivingInfo.remark" type="textarea" placeholder="请输入备注" height="120" />
<u-textarea v-model="receivingInfo.remark" placeholder="请输入备注" height="120" />
</u-form-item>
</view>
<view class="section">
@ -395,7 +395,7 @@
},
getStatusType(status) {
const map = {
'receiving': 'primary',
'receiving': 'warning',
'completed': 'success',
'cancelled': 'error'
};
@ -411,26 +411,63 @@
};
</script>
<style scoped>
<style lang="scss" scoped>
.scroll-container {
height: 100%;
}
.form_box {
/* 表单标签、输入框字号统一为 36rpx */
::v-deep .u-form-item__body__left__content__label {
font-size: 36rpx;
white-space: nowrap;
}
::v-deep .u-input__content__field-wrapper__field {
font-size: 36rpx !important;
}
::v-deep .input-placeholder {
font-size: 36rpx;
}
::v-deep .u-textarea__field {
font-size: 36rpx;
color: #303133;
}
/* 单选项之间间隔 */
::v-deep .u-radio-group .u-radio + .u-radio {
margin-left: 24rpx;
}
/* 标签文字字号 36rpx */
::v-deep .u-tag__text {
font-size: 36rpx;
}
/* 表单校验错误提示字号 34rpx */
::v-deep .u-form-item__body__right__message {
font-size: 34rpx;
line-height: 1.4;
}
}
.tracking-input-wrap {
width: 100%;
display: flex;
align-items: center;
gap: 16rpx;
}
.tracking-input-wrap :deep(.u-input) {
flex: 1;
::v-deep .u-input {
flex: 1;
}
}
.scan-camera-btn {
width: 76rpx;
height: 76rpx;
border-radius: 38rpx;
width: 88rpx;
height: 88rpx;
border-radius: 44rpx;
background: #eef4ff;
display: flex;
align-items: center;
@ -443,6 +480,12 @@
opacity: 0.85;
}
.print-btn {
margin-left: 20rpx;
flex-shrink: 0;
font-size: 36rpx !important;
}
.store-bind-trigger {
width: 100%;
min-height: 72rpx;
@ -450,12 +493,24 @@
align-items: center;
justify-content: space-between;
gap: 16rpx;
padding: 14rpx 20rpx;
background: #ecf5ff;
border: 1rpx solid #d9ecff;
border-radius: 10rpx;
box-sizing: border-box;
}
.store-bind-text {
flex: 1;
font-size: 28rpx;
font-size: 36rpx;
color: #303133;
line-height: 1.4;
}
.store-value-text {
font-size: 36rpx;
color: #303133;
line-height: 1.4;
}
.store-bind-action {
@ -478,7 +533,7 @@
}
.section-title {
font-size: 32rpx;
font-size: 34rpx;
font-weight: bold;
color: #333;
margin-bottom: 20rpx;

View File

@ -1,7 +1,23 @@
<template>
<view class="receiving-list">
<view class="normar_container">
<page-nav :title="title"></page-nav>
<!-- 顶部状态栏 -->
<view class="status-bar"></view>
<!-- 自定义页头:返回 + 标题 + 右上角操作 -->
<view class="page-header">
<view class="back-btn" @click="handleBack">
<u-icon name="arrow-left" size="18" color="#333"></u-icon>
</view>
<text class="header-title">{{ title }}</text>
<view class="header-side header-side--right">
<view class="header-side__btn" @click="showFilterPopup">
<text class="header-side__btn-text">筛选</text>
</view>
<view class="header-btn-refresh" @click="createReceiving">
<text class="header-btn-refresh__text">新建收货</text>
</view>
</view>
</view>
<!-- 搜索和筛选区域 -->
<view class="search-filter">
<!-- 搜索框 -->
@ -18,24 +34,10 @@
</view>
<!-- 筛选按钮 -->
<view class="filter-actions">
<view class="filter-buttons">
<u-button size="mini" type="primary" plain @click="showFilterPopup">
筛选
</u-button>
<u-button size="mini" type="success" @click="createReceiving">
<u-icon name="plus" size="16"></u-icon>
新建收货
</u-button>
</view>
</view>
<!-- 状态标签 -->
<view class="status-tags">
<view class="status-tag" v-for="status in statusList" :key="status.value"
:class="{ active: activeStatus === status.value }" @click="changeStatus(status.value)">
:class="statusTagClass(status)" @click="changeStatus(status.value)">
<text class="tag-name">{{ status.label }}</text>
<u-badge :value="status.count" size="mini"></u-badge>
</view>
@ -65,24 +67,20 @@
<!-- 基本信息 -->
<view class="item-info">
<view class="info-row">
<u-icon name="home" size="16" color="#999"></u-icon>
<text class="info-label">货主:</text>
<text class="info-value">{{ item['store.store_remask'] || '--' }}</text>
</view>
<view class="info-row">
<u-icon name="car" size="16" color="#999"></u-icon>
<text class="info-label">车牌/运单:</text>
<text class="info-value">{{ item.license_plate || item.tracking_number || '--' }}</text>
</view>
<view class="info-row">
<u-icon name="account" size="16" color="#999"></u-icon>
<text class="info-label">创建人:</text>
<text class="info-value">{{ item['creator.real_name'] || '--' }}</text>
</view>
<view class="info-row" v-if="item.images && item.images.length>0">
<u-icon name="photo" size="16" color="#999"></u-icon>
<text class="info-label">照片:</text>
<span class="info-value" @click.stop="showImgs(item.images)">
<image class="miniImg" v-for="(url, index) in item.images" :key="index" :src="url"></image>
@ -102,29 +100,38 @@
<!-- 底部安全区域 -->
<view class="safe-area-bottom"></view>
</scroll-view>
<pagination :pageNum.sync="currentPage" :pageSize="pageSize" :total="totalItems" :showTotal="true"
:prevText="'上一页'" :nextText="'下一页'" :showFirstLast="true" :firstText="'首页'" :lastText="'末页'"
@change="handlePageChange" />
<view class="pagination-wrap">
<pagination :pageNum.sync="currentPage" :pageSize="pageSize" :total="totalItems" :showTotal="true"
:prevText="'上一页'" :nextText="'下一页'" :showFirstLast="true" :firstText="'首页'" :lastText="'末页'"
@change="handlePageChange" />
</view>
</view>
<!-- 筛选弹出层 -->
<u-popup :show="filterVisible" mode="bottom" :closeable="true" border-radius="20" @close="filterVisible = false">
<u-popup :show="filterVisible" mode="bottom" :closeable="false" round="20" @close="filterVisible = false">
<view class="filter-popup">
<view class="popup-header">
<text class="popup-title">筛选条件</text>
<view class="popup-close" @click="filterVisible = false">
<u-icon name="close" color="#909399" size="18"></u-icon>
</view>
</view>
<u--form class="filter-content" labelWidth="auto" labelPosition="left" :model="where" ref="uForm">
<u-form-item label="货主" prop="store" borderBottom @click="handleShowStore">
<view>{{storeName}}</view>
</u-form-item>
<u-form-item label="创建时间" borderBottom>
<view class="date-range" @click="openDateFilter">
<text>{{where.startDate}} - {{where.endDate}}</text>
<u-form-item class="store-form-item" label="货主:" prop="store" @click="handleShowStore">
<view class="store-value">
<text>{{storeName}}</text>
<u-icon name="arrow-right" color="#2979ff" size="16"></u-icon>
</view>
</u-form-item>
<u-form-item label="" borderBottom>
<u-form-item class="date-form-item" label="创建时间:">
<view class="date-range" @click="openDateFilter">
<text>{{where.startDate}} - {{where.endDate}}</text>
<u-icon name="arrow-right" color="#2979ff" size="16"></u-icon>
</view>
</u-form-item>
<u-form-item label="">
<view class="quick-date-buttons">
<view class="quick-date-buttons__item" :class="{ 'is-active': dateModel === 'today' }">
<u-button size="mini" :type="dateModel === 'today' ? 'primary' : 'default'" @click="setDateRange('today')">今日</u-button>
@ -148,23 +155,83 @@
</u-form-item>
</u--form>
<view class="popup-actions">
<u-button type="default" shape="circle" @click="resetFilter">
<u-button type="info" shape="square" @click="resetFilter">
重置
</u-button>
<u-button type="primary" shape="circle" @click="applyFilter">
<u-button color="#2979ff" shape="square" @click="applyFilter">
确定
</u-button>
</view>
</view>
</u-popup>
<!-- 货主选择组件 -->
<inputAndSelect title="选择货主" :list="stores" :show="showStore" :value="storeId"
searchBorder="none" @change="handleStoreChange" @close="showStore=false"></inputAndSelect>
<!-- 货主选择弹窗 -->
<u-popup :show="showStore" mode="bottom" round="20" :closeable="false" :safe-area-inset-bottom="true" :close-on-click-overlay="true" @close="handleStoreDrawerClose">
<view class="store-drawer">
<view class="store-drawer__header">
<text class="store-drawer__title">选择货主</text>
<view class="store-drawer__close" @click="handleStoreDrawerClose">
<u-icon name="close" color="#909399" size="18"></u-icon>
</view>
</view>
<view class="store-drawer__search">
<SearchBar
v-model="storeSearchText"
placeholder="输入货主名称搜索"
:show-scan="false"
:input-font-size="'34rpx'"
:search-text-font-size="'34rpx'"
@search="handleStoreSearchAction"
@clear="handleStoreSearchAction"
></SearchBar>
</view>
<scroll-view class="store-drawer__list" scroll-y :scroll-into-view="storeListScrollInto">
<view
id="store-all-item"
class="store-drawer__item"
:class="{ 'store-drawer__item--active': allStoresSelected }"
@click="selectAllStores"
>
<text class="store-drawer__item-name">全部</text>
<u-icon
:name="allStoresSelected ? 'checkmark-circle-fill' : 'checkmark-circle'"
:color="allStoresSelected ? '#07c160' : '#c8c9cc'"
size="22"
></u-icon>
</view>
<view
v-for="store in filteredStores"
:key="getStoreId(store)"
class="store-drawer__item"
:class="{ 'store-drawer__item--active': isStoreSelected(store) }"
@click="selectStore(store)"
>
<text class="store-drawer__item-name">{{ getStoreName(store) }}</text>
<u-icon
:name="isStoreSelected(store) ? 'checkmark-circle-fill' : 'checkmark-circle'"
:color="isStoreSelected(store) ? '#07c160' : '#c8c9cc'"
size="22"
></u-icon>
</view>
<u-empty v-if="filteredStores.length === 0" mode="data" text="暂无货主"></u-empty>
</scroll-view>
<view class="store-drawer__footer">
<view class="store-drawer__footer-btns">
<view class="store-drawer__footer-btn store-drawer__footer-btn--reset" @click="resetStoreSelection">重置</view>
<view class="store-drawer__footer-btn store-drawer__footer-btn--confirm" @click="applyStoreSelection">确定</view>
</view>
</view>
</view>
</u-popup>
<!-- 时间选择器 -->
<u-calendar :show="showSelectDate" mode="range" @confirm="handleDateConfirm" @close="showSelectDate=false" :minDate="minDate" :maxDate="maxDate" :monthNum="calendarMonthNum"></u-calendar>
<u-calendar ref="calendar" :show="showSelectDate" mode="range" title="选择日期" round="20" @confirm="handleDateConfirm" @close="showSelectDate=false" :minDate="minDate" :maxDate="maxDate" :monthNum="calendarMonthNum">
<view slot="footer" class="calendar-footer">
<view class="calendar-footer__btn calendar-footer__btn--close" @click="closeCalendar">关闭</view>
<view class="calendar-footer__btn calendar-footer__btn--confirm" @click="confirmCalendar">确定</view>
</view>
</u-calendar>
<!-- 加载遮罩 -->
<u-loading-page :loading="loading" bg-color="rgba(255,255,255,0.9)"></u-loading-page>
@ -239,6 +306,10 @@
// 货主列表
stores: [],
// 货主弹窗搜索与临时选择
storeSearchText: '',
pendingStoreId: null,
storeListScrollInto: '',
}
},
computed: {
@ -246,6 +317,19 @@
const min = new Date(this.minDate);
const max = new Date(this.maxDate);
return (max.getFullYear() - min.getFullYear()) * 12 + (max.getMonth() - min.getMonth()) + 1;
},
// 是否选中「全部」
allStoresSelected() {
return this.pendingStoreId === null || this.pendingStoreId === undefined;
},
// 货主列表按关键字过滤
filteredStores() {
const keyword = String(this.storeSearchText || '').trim().toLowerCase();
if (!keyword) return this.stores;
return this.stores.filter(store => {
const name = String(this.getStoreName(store) || '').toLowerCase();
return name.includes(keyword);
});
}
},
onLoad() {
@ -443,6 +527,18 @@
this.dateModel = 'custom';
this.showSelectDate = false;
},
// 关闭日历弹窗
closeCalendar() {
if (this.$refs.calendar) {
this.$refs.calendar.close();
}
},
// 确定选择的日期
confirmCalendar() {
if (this.$refs.calendar) {
this.$refs.calendar.confirm();
}
},
parseCalendarRange(data) {
let startDate = '';
let endDate = '';
@ -550,16 +646,44 @@
},
// 货主选择
handleStoreChange(option) {
if(!option){
this.storeName = "全部";
this.storeId = null;
}else{
this.storeName = option.label;
this.storeId = option.value;
}
getStoreId(store) {
return store?.value ?? store?.id ?? store?.store_id ?? store?.storeId;
},
getStoreName(store) {
return store?.label || store?.name || store?.store_name || '-';
},
isStoreSelected(store) {
const id = this.getStoreId(store);
if (id === undefined || id === null) return false;
return String(this.pendingStoreId) === String(id);
},
selectStore(store) {
this.pendingStoreId = this.getStoreId(store);
},
selectAllStores() {
this.pendingStoreId = null;
},
resetStoreSelection() {
this.pendingStoreId = null;
this.storeListScrollInto = '';
this.$nextTick(() => {
this.storeListScrollInto = 'store-all-item';
});
},
applyStoreSelection() {
this.storeId = this.pendingStoreId;
const matched = this.stores.find(store => String(this.getStoreId(store)) === String(this.pendingStoreId));
this.storeName = matched ? this.getStoreName(matched) : '全部';
this.showStore = false;
},
handleStoreDrawerClose() {
this.showStore = false;
},
handleStoreSearchAction() {
if (typeof uni !== 'undefined' && uni.hideKeyboard) {
uni.hideKeyboard();
}
},
async scan(data) {
console.log("扫描数据:", data.data);
@ -756,15 +880,19 @@
// 获取状态类型
getStatusType(status) {
const typeMap = {
'cancelled': 'warning',
'receiving': 'primary',
'cancelled': 'error',
'receiving': 'warning',
'completed': 'success',
};
return typeMap[status] || 'info';
},
handleShowStore(){
this.pendingStoreId = this.storeId;
this.storeSearchText = '';
this.showStore = true;
console.log("显示选择货主")
if (this.stores.length === 0) {
this.loadStore();
}
},
// 搜索处理
handleSearch() {
@ -790,6 +918,22 @@
silentVoice: false
});
},
// 状态按钮样式:选中时按状态色调高亮,参考库存盘点页
statusTagClass(status) {
const toneMap = {
all: 'strong',
receiving: 'warning',
completed: 'success',
cancelled: 'muted'
};
const isActive = this.activeStatus === status.value;
const tone = toneMap[status.value] || '';
return {
active: isActive,
[`status-tag--tone-${tone}`]: isActive && !!tone
};
},
// 下拉刷新
onRefresh() {
@ -804,6 +948,10 @@
});
},
// 返回上一页
handleBack() {
uni.navigateBack({ delta: 1 });
},
// 显示筛选弹窗
showFilterPopup() {
this.filterVisible = true;
@ -904,6 +1052,84 @@
min-height: 100vh;
background-color: #f8f8f8;
// 顶部状态栏
.status-bar {
height: var(--status-bar-height);
background: #ffffff;
flex-shrink: 0;
}
// 自定义页头
.page-header {
position: relative;
height: 88rpx;
padding: 0 24rpx;
display: flex;
align-items: center;
background: #ffffff;
box-sizing: border-box;
flex-shrink: 0;
}
.back-btn {
flex-shrink: 0;
width: 56rpx;
height: 56rpx;
display: flex;
align-items: center;
justify-content: center;
}
.header-title {
flex: 1;
font-size: 36rpx;
font-weight: bold;
color: #333;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.header-side {
flex-shrink: 0;
display: flex;
align-items: center;
}
.header-side .header-side__btn + .header-btn-refresh {
margin-left: 16rpx;
}
.header-side__btn {
display: flex;
align-items: center;
padding: 12rpx 16rpx;
border-radius: 8rpx;
background: #2979ff;
}
.header-side__btn-text {
font-size: 36rpx;
color: #ffffff;
line-height: 1;
}
.header-btn-refresh {
display: flex;
align-items: center;
padding: 12rpx 24rpx;
background: #2979ff;
color: #ffffff;
font-size: 36rpx;
border-radius: 8rpx;
line-height: 1;
}
.header-btn-refresh__text {
line-height: 1;
}
// 搜索和筛选区域
.search-filter {
background: white;
@ -914,31 +1140,20 @@
margin-bottom: 20rpx;
}
.filter-actions {
margin-bottom: 20rpx;
.filter-buttons {
display: flex;
gap: 20rpx;
::v-deep .u-btn {
flex: 1;
}
}
}
.status-tags {
display: flex;
align-items: center;
.status-tag {
flex: 1;
height: 56rpx;
padding: 0 12rpx;
display: flex;
align-items: center;
justify-content: center;
padding: 10rpx 12rpx;
background: #f5f5f5;
border-radius: 30rpx;
background: #f5f7fa;
border: 1rpx solid #ebeef5;
border-radius: 28rpx;
position: relative;
& + .status-tag {
@ -946,16 +1161,37 @@
}
&.active {
background: #007aff;
background: #2979ff;
border-color: #2979ff;
box-shadow: 0 4rpx 12rpx rgba(41, 121, 255, 0.28);
.tag-name {
color: white;
color: #ffffff;
font-weight: bold;
}
}
&.active.status-tag--tone-warning {
background: #ff9800;
border-color: #ff9800;
box-shadow: 0 4rpx 12rpx rgba(255, 152, 0, 0.28);
}
&.active.status-tag--tone-success {
background: #18a058;
border-color: #18a058;
box-shadow: 0 4rpx 12rpx rgba(24, 160, 88, 0.28);
}
&.active.status-tag--tone-muted {
background: #909399;
border-color: #909399;
box-shadow: 0 4rpx 12rpx rgba(144, 147, 153, 0.28);
}
.tag-name {
font-size: 30rpx;
color: #666;
font-size: 34rpx;
color: #606266;
margin-right: 8rpx;
}
}
@ -990,54 +1226,74 @@
}
.receiving-items {
padding: 20rpx;
display: flex;
flex-direction: column;
padding: 20rpx 24rpx 24rpx;
.receiving-item + .receiving-item {
margin-top: 20rpx;
}
.receiving-item {
background: white;
border-radius: 16rpx;
padding: 30rpx;
margin-bottom: 20rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
background: #ffffff;
border-radius: 18rpx;
padding: 22rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
&:active {
opacity: 0.92;
}
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 25rpx;
justify-content: space-between;
padding-bottom: 15rpx;
border-bottom: 1rpx solid #f0f0f0;
.order-no {
font-size: 42rpx;
font-weight: 600;
color: #333;
font-size: 40rpx;
font-weight: bold;
color: #303133;
flex: 1;
min-width: 0;
word-break: break-all;
}
::v-deep .u-tag__text {
font-size: 36rpx;
line-height: 36rpx;
}
}
.item-info {
margin-bottom: 25rpx;
margin-top: 18rpx;
.info-row {
display: flex;
align-items: center;
margin-bottom: 15rpx;
align-items: flex-start;
font-size: 36rpx;
line-height: 1.5;
&:last-child {
margin-bottom: 0;
& + .info-row {
margin-top: 12rpx;
}
.info-label {
font-size: 32rpx;
color: #666;
margin-left: 10rpx;
margin-right: 15rpx;
font-size: 36rpx;
color: #909399;
margin-right: 12rpx;
min-width: 180rpx;
flex-shrink: 0;
white-space: nowrap;
}
.info-value {
font-size: 30rpx;
color: #333;
font-size: 36rpx;
color: #303133;
flex: 1;
min-width: 0;
word-break: break-all;
display: flex;
align-items: center;
flex-wrap: wrap;
@ -1054,15 +1310,14 @@
}
.item-actions {
margin-top: 18rpx;
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 20rpx;
border-top: 1rpx solid #f0f0f0;
flex-direction: column;
.create-time {
font-size: 32rpx;
color: #999;
font-size: 36rpx;
line-height: 1.5;
color: #909399;
}
.action-right {
@ -1088,24 +1343,74 @@
padding-bottom: env(safe-area-inset-bottom);
.popup-header {
padding: 40rpx 30rpx 20rpx;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
padding: 32rpx 30rpx 24rpx;
flex-shrink: 0;
border-bottom: 1rpx solid #f0f0f0;
}
.popup-title {
font-size: 36rpx;
font-weight: 600;
color: #333;
}
.popup-close {
position: absolute;
top: 50%;
right: 24rpx;
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
padding: 8rpx;
}
.popup-title {
font-size: 38rpx;
font-weight: bold;
color: #333;
}
.filter-content {
max-height: 800rpx;
padding: 30rpx;
padding: 20rpx 30rpx;
// 统一表单项上下间距
::v-deep .u-form-item__body {
padding: 20rpx 0;
}
.store-value,
.date-range {
flex: 1;
min-width: 0;
display: flex;
align-items: center;
justify-content: space-between;
padding: 14rpx 20rpx;
background: #ecf5ff;
border: 1rpx solid #d9ecff;
border-radius: 10rpx;
box-sizing: border-box;
color: #303133;
}
.store-value {
font-size: 38rpx;
}
.date-range {
font-size: 28rpx;
color: #333;
padding: 10rpx 0;
font-size: 36rpx;
}
.store-form-item {
::v-deep .u-form-item__body__left__content__label {
font-size: 38rpx;
}
}
.date-form-item {
::v-deep .u-form-item__body__left__content__label {
font-size: 36rpx;
}
}
.quick-date-buttons {
@ -1113,7 +1418,7 @@
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 24rpx 12rpx;
width: 100%;
padding: 0 12rpx;
padding: 0;
box-sizing: border-box;
align-items: stretch;
justify-content: center;
@ -1136,6 +1441,19 @@
color: #666 !important;
}
}
&.is-active {
::v-deep .u-btn,
::v-deep .u-button {
background: #2979ff !important;
border-color: #2979ff !important;
}
::v-deep .u-btn-text,
::v-deep .u-button__text {
color: #ffffff !important;
}
}
}
::v-deep .u-btn {
@ -1145,11 +1463,11 @@
padding: 0 12rpx;
margin: 0;
box-sizing: border-box;
font-size: 32rpx;
font-size: 36rpx;
}
::v-deep .u-btn-text {
font-size: 32rpx !important;
font-size: 36rpx !important;
font-weight: 500;
}
@ -1160,29 +1478,194 @@
padding: 0 12rpx;
margin: 0;
box-sizing: border-box;
font-size: 32rpx;
font-size: 36rpx;
}
::v-deep .u-button__text {
font-size: 32rpx !important;
font-size: 36rpx !important;
font-weight: 500;
}
}
}
.popup-actions {
padding: 30rpx;
padding: 20rpx 30rpx;
border-top: 1rpx solid #f0f0f0;
display: flex;
gap: 20rpx;
::v-deep .u-btn {
::v-deep .u-btn,
::v-deep .u-button {
flex: 1;
height: 90rpx;
font-size: 32rpx;
font-size: 36rpx;
}
::v-deep .u-btn-text,
::v-deep .u-button__text {
font-size: 36rpx !important;
}
// 真机兼容:用兄弟选择器留出间隔
::v-deep .u-btn + .u-btn,
::v-deep .u-button + .u-button {
margin-left: 20rpx;
}
}
}
// 货主选择弹窗
.store-drawer {
display: flex;
flex-direction: column;
height: 70vh;
background: #ffffff;
border-radius: 20px 20px 0 0;
overflow: hidden;
.store-drawer__header {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
padding: 32rpx 30rpx 24rpx;
flex-shrink: 0;
}
.store-drawer__close {
position: absolute;
top: 50%;
right: 24rpx;
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
padding: 8rpx;
}
.store-drawer__title {
font-size: 38rpx;
font-weight: bold;
color: #333;
}
.store-drawer__search {
padding: 16rpx 24rpx;
border-bottom: 1rpx solid #f0f2f5;
flex-shrink: 0;
}
.store-drawer__list {
flex: 1;
min-height: 0;
padding: 16rpx 24rpx;
box-sizing: border-box;
}
.store-drawer__item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 26rpx 28rpx;
margin-bottom: 16rpx;
background: #f6f8fb;
border-radius: 12rpx;
}
.store-drawer__item--active {
background: #f0f9f0;
}
.store-drawer__item-name {
flex: 1;
min-width: 0;
margin-right: 16rpx;
font-size: 36rpx;
color: #303133;
line-height: 1.4;
word-break: break-all;
}
.store-drawer__footer {
flex-shrink: 0;
padding: 20rpx 24rpx;
border-top: 1rpx solid #ebeef5;
background: #ffffff;
}
.store-drawer__footer-btns {
display: flex;
}
.store-drawer__footer-btn + .store-drawer__footer-btn {
margin-left: 16rpx;
}
.store-drawer__footer-btn {
flex: 1;
height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 8rpx;
font-size: 36rpx;
line-height: 1;
}
.store-drawer__footer-btn--reset {
background: #f5f7fa;
color: #606266;
}
.store-drawer__footer-btn--confirm {
background: #2979ff;
color: #ffffff;
}
}
// 日期选择弹窗标题样式
::v-deep .u-calendar-header__title {
font-size: 38rpx;
font-weight: bold;
color: #333;
}
// 日期选择弹窗底部按钮
.calendar-footer {
display: flex;
align-items: center;
padding: 20rpx 24rpx;
border-top: 1rpx solid #f0f0f0;
}
.calendar-footer__btn {
flex: 1;
height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 8rpx;
font-size: 36rpx;
line-height: 1;
}
.calendar-footer__btn--close {
background: #f5f7fa;
color: #606266;
margin-right: 20rpx;
}
.calendar-footer__btn--confirm {
background: #2979ff;
color: #ffffff;
}
// 底部分页
.pagination-wrap {
flex-shrink: 0;
padding: 12rpx 12rpx 0;
background: #ffffff;
border-top: 1rpx solid #f2f2f2;
}
}
.u-form-item__body__left {

View File

@ -3,7 +3,7 @@
<view class="normar_container">
<page-nav title="新建收货任务"></page-nav>
<scroll-view class="container" scroll-y>
<u-form class="form_box" :model="formData" :rules="rules" ref="formRef" label-width="150rpx">
<u-form class="form_box" :model="formData" :rules="rules" ref="formRef" label-width="170rpx">
<!-- 基础信息 -->
<view class="section">
<view class="section-title">基础信息</view>
@ -12,7 +12,7 @@
<u-form-item label="货主" @click="openStorePicker">
<view class="store-select-display">
<text :class="['store-select-text', !formData.store_id ? 'store-select-placeholder' : '']">{{ storeName || '请选择货主' }}</text>
<u-icon name="arrow-right" size="24rpx" color="#c0c4cc"></u-icon>
<u-icon name="arrow-right" size="16" color="#2979ff"></u-icon>
</view>
</u-form-item>
@ -20,7 +20,7 @@
<u-form-item label="来货方式" prop="delivery_method" required>
<u-radio-group v-model="formData.delivery_method">
<u-radio v-for="item in deliveryMethods" :key="item.value" :name="item.value"
:label="item.label"></u-radio>
label-size="36rpx" :label="item.label"></u-radio>
</u-radio-group>
</u-form-item>
@ -29,7 +29,7 @@
<view class="tracking-input-wrap">
<u-input v-model="formData.license_plate" placeholder="请输入车牌号" maxlength="20" />
<view class="scan-camera-btn" @click="handleLicensePlateCapture">
<u-icon name="camera" size="34rpx" color="#2979ff"></u-icon>
<u-icon name="camera" size="48rpx" color="#2979ff"></u-icon>
</view>
</view>
</u-form-item>
@ -40,7 +40,7 @@
<view class="tracking-input-wrap">
<u-input v-model="formData.tracking_number" placeholder="请输入快递/物流单号" maxlength="100" />
<view class="scan-camera-btn" @click="handleTrackingScan">
<u-icon name="camera" size="34rpx" color="#2979ff"></u-icon>
<u-icon name="camera" size="48rpx" color="#2979ff"></u-icon>
</view>
</view>
</u-form-item>
@ -50,7 +50,9 @@
<view class="section-title">来货照片</view>
<view class="incoming-toolbar">
<view class="incoming-picker-trigger" @click="handleChooseIncomingImages">
<view class="incoming-picker-icon">+</view>
<view class="incoming-picker-icon">
<u-icon name="plus" size="20" color="#ffffff"></u-icon>
</view>
<view class="incoming-picker-texts">
<text class="incoming-picker-title">选择来货照片</text>
<text class="incoming-picker-desc">创建成功后自动上传并关联</text>
@ -79,17 +81,17 @@
<u-form-item label="装卸方式" prop="loading_method" required>
<u-radio-group v-model="formData.loading_method">
<u-radio v-for="item in loadingMethods" :key="item.value" :name="item.value"
:label="item.label"></u-radio>
label-size="36rpx" :label="item.label"></u-radio>
</u-radio-group>
</u-form-item>
<!-- 总箱数 -->
<u-form-item label="总箱数" prop="total_boxes">
<u-form-item class="num-form-item" label="总箱数" prop="total_boxes">
<u-input v-model="formData.total_boxes" type="number" placeholder="请输入总箱数" />
</u-form-item>
<!-- 总托盘数 -->
<u-form-item label="总托盘数" prop="total_pallets">
<u-form-item class="num-form-item" label="总托盘数" prop="total_pallets">
<u-input v-model="formData.total_pallets" type="number" placeholder="请输入总托盘数" />
</u-form-item>
@ -103,7 +105,7 @@
<view class="section">
<view class="section-title">备注信息</view>
<u-form-item label="备注">
<u-input v-model="formData.remark" type="textarea" placeholder="请输入备注信息" height="120" />
<u-textarea v-model="formData.remark" placeholder="请输入备注信息" height="120" />
</u-form-item>
</view>
@ -117,18 +119,73 @@
</u-form>
</scroll-view>
<view class="submit-area">
<u-button type="primary" @click="handleSubmit" :loading="submitting">
创建收货任务
</u-button>
<u-button @click="handleReset">
重置
</u-button>
<u-button color="#2979ff" @click="handleSubmit" :loading="submitting">
创建收货任务
</u-button>
</view>
</view>
<!-- 货主选择器 -->
<inputAndSelect title="选择货主" :list="storeList" :show="showStorePicker" :value="formData.store_id"
searchBorder="none" @change="handleStoreChange" @close="showStorePicker=false"></inputAndSelect>
<!-- 货主选择弹窗 -->
<u-popup :show="showStorePicker" mode="bottom" round="20" :closeable="false" :safe-area-inset-bottom="true" :close-on-click-overlay="true" @close="handleStoreDrawerClose">
<view class="store-drawer">
<view class="store-drawer__header">
<text class="store-drawer__title">选择货主</text>
<view class="store-drawer__close" @click="handleStoreDrawerClose">
<u-icon name="close" color="#909399" size="18"></u-icon>
</view>
</view>
<view class="store-drawer__search">
<SearchBar
v-model="storeSearchText"
placeholder="输入货主名称搜索"
:show-scan="false"
:input-font-size="'34rpx'"
:search-text-font-size="'34rpx'"
@search="handleStoreSearchAction"
@clear="handleStoreSearchAction"
></SearchBar>
</view>
<scroll-view class="store-drawer__list" scroll-y :scroll-into-view="storeListScrollInto">
<view
id="store-all-item"
class="store-drawer__item"
:class="{ 'store-drawer__item--active': allStoresSelected }"
@click="selectAllStores"
>
<text class="store-drawer__item-name">不设置</text>
<u-icon
:name="allStoresSelected ? 'checkmark-circle-fill' : 'checkmark-circle'"
:color="allStoresSelected ? '#07c160' : '#c8c9cc'"
size="22"
></u-icon>
</view>
<view
v-for="store in filteredStores"
:key="getStoreId(store)"
class="store-drawer__item"
:class="{ 'store-drawer__item--active': isStoreSelected(store) }"
@click="selectStore(store)"
>
<text class="store-drawer__item-name">{{ getStoreName(store) }}</text>
<u-icon
:name="isStoreSelected(store) ? 'checkmark-circle-fill' : 'checkmark-circle'"
:color="isStoreSelected(store) ? '#07c160' : '#c8c9cc'"
size="22"
></u-icon>
</view>
<u-empty v-if="filteredStores.length === 0" mode="data" text="暂无货主"></u-empty>
</scroll-view>
<view class="store-drawer__footer">
<view class="store-drawer__footer-btns">
<view class="store-drawer__footer-btn store-drawer__footer-btn--reset" @click="resetStoreSelection">重置</view>
<view class="store-drawer__footer-btn store-drawer__footer-btn--confirm" @click="applyStoreSelection">确定</view>
</view>
</view>
</view>
</u-popup>
</view>
</template>
@ -180,6 +237,9 @@
],
storeList: [],
storeSearchText: '',
pendingStoreId: null,
storeListScrollInto: '',
rules: {
'delivery_method': [{
@ -229,6 +289,22 @@
};
},
computed: {
// 是否选中「不设置」
allStoresSelected() {
return this.pendingStoreId === null || this.pendingStoreId === undefined;
},
// 货主列表按关键字过滤
filteredStores() {
const keyword = String(this.storeSearchText || '').trim().toLowerCase();
if (!keyword) return this.storeList;
return this.storeList.filter(store => {
const name = String(this.getStoreName(store) || '').toLowerCase();
return name.includes(keyword);
});
}
},
methods: {
normalizeSpeechText(message) {
const rawText = String(message || '').trim();
@ -781,19 +857,52 @@
},
openStorePicker() {
this.pendingStoreId = this.formData.store_id;
this.storeSearchText = '';
this.showStorePicker = true;
if (this.storeList.length === 0) {
this.loadStore();
}
},
handleStoreChange(option) {
if (!option) {
this.storeName = "不设置";
this.formData.store_id = null;
} else {
this.storeName = option.label;
this.formData.store_id = option.value;
}
getStoreId(store) {
return store?.value ?? store?.id ?? store?.store_id ?? store?.storeId;
},
getStoreName(store) {
return store?.label || store?.name || store?.store_name || '-';
},
isStoreSelected(store) {
const id = this.getStoreId(store);
if (id === undefined || id === null) return false;
return String(this.pendingStoreId) === String(id);
},
selectStore(store) {
this.pendingStoreId = this.getStoreId(store);
},
selectAllStores() {
this.pendingStoreId = null;
},
resetStoreSelection() {
this.pendingStoreId = null;
this.storeListScrollInto = '';
this.$nextTick(() => {
this.storeListScrollInto = 'store-all-item';
});
},
applyStoreSelection() {
this.formData.store_id = this.pendingStoreId;
const matched = this.storeList.find(store => String(this.getStoreId(store)) === String(this.pendingStoreId));
this.storeName = matched ? this.getStoreName(matched) : '不设置';
this.showStorePicker = false;
},
handleStoreDrawerClose() {
this.showStorePicker = false;
},
handleStoreSearchAction() {
if (typeof uni !== 'undefined' && uni.hideKeyboard) {
uni.hideKeyboard();
}
},
},
onLoad() {
@ -824,6 +933,41 @@
.form_box {
padding: 20rpx;
// 表单标签、输入框、单选字号统一为 36rpx
::v-deep .u-form-item__body__left__content__label {
font-size: 36rpx;
white-space: nowrap;
}
::v-deep .u-input__content__field-wrapper__field {
font-size: 36rpx !important;
}
::v-deep .input-placeholder {
font-size: 36rpx;
}
::v-deep .u-textarea__field {
font-size: 36rpx;
color: #303133;
}
// 总箱数、总托盘数值字号 38rpx
::v-deep .num-form-item .u-input__content__field-wrapper__field {
font-size: 38rpx !important;
}
// 表单校验错误提示字号 34rpx
::v-deep .u-form-item__body__right__message {
font-size: 34rpx;
line-height: 1.4;
}
// 单选项之间间隔
::v-deep .u-radio-group .u-radio + .u-radio {
margin-left: 24rpx;
}
}
}
@ -834,7 +978,7 @@
margin-bottom: 30rpx;
.section-title {
font-size: 32rpx;
font-size: 34rpx;
font-weight: bold;
color: #333;
margin-bottom: 30rpx;
@ -874,29 +1018,45 @@
display: flex;
flex-direction: row;
padding: 20rpx;
gap: 20rpx;
border-top: 1px solid rgba(0, 0, 0, .3);
border-top: 1rpx solid #f0f0f0;
background-color: #FFF;
::v-deep .u-button {
flex: 1;
font-size: 36rpx;
}
::v-deep .u-button__text {
font-size: 36rpx !important;
}
// 真机兼容:用兄弟选择器留出间隔
::v-deep .u-button + .u-button {
margin-left: 20rpx;
}
}
.store-select-display {
width: 100%;
min-height: 72rpx;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16rpx;
padding: 14rpx 20rpx;
background: #ecf5ff;
border: 1rpx solid #d9ecff;
border-radius: 10rpx;
box-sizing: border-box;
}
.store-select-text {
flex: 1;
font-size: 28rpx;
font-size: 36rpx;
color: #303133;
line-height: 1.4;
}
.store-select-placeholder {
color: #c0c4cc;
color: #909399;
}
.incoming-toolbar {
@ -922,10 +1082,9 @@
height: 52rpx;
border-radius: 26rpx;
background: #2979ff;
color: #ffffff;
font-size: 36rpx;
line-height: 52rpx;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
box-shadow: 0 8rpx 20rpx rgba(41, 121, 255, 0.16);
}
@ -938,14 +1097,14 @@
}
.incoming-picker-title {
font-size: 28rpx;
font-size: 36rpx;
font-weight: 600;
color: #303133;
line-height: 1.4;
}
.incoming-picker-desc {
font-size: 24rpx;
font-size: 34rpx;
color: #909399;
line-height: 1.4;
}
@ -985,4 +1144,113 @@
align-items: center;
justify-content: center;
}
// 货主选择弹窗
.store-drawer {
display: flex;
flex-direction: column;
height: 70vh;
background: #ffffff;
border-radius: 20px 20px 0 0;
overflow: hidden;
.store-drawer__header {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
padding: 32rpx 30rpx 24rpx;
flex-shrink: 0;
}
.store-drawer__close {
position: absolute;
top: 50%;
right: 24rpx;
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
padding: 8rpx;
}
.store-drawer__title {
font-size: 38rpx;
font-weight: bold;
color: #333;
}
.store-drawer__search {
padding: 16rpx 24rpx;
border-bottom: 1rpx solid #f0f2f5;
flex-shrink: 0;
}
.store-drawer__list {
flex: 1;
min-height: 0;
padding: 16rpx 24rpx;
box-sizing: border-box;
}
.store-drawer__item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 26rpx 28rpx;
margin-bottom: 16rpx;
background: #f6f8fb;
border-radius: 12rpx;
}
.store-drawer__item--active {
background: #f0f9f0;
}
.store-drawer__item-name {
flex: 1;
min-width: 0;
margin-right: 16rpx;
font-size: 36rpx;
color: #303133;
line-height: 1.4;
word-break: break-all;
}
.store-drawer__footer {
flex-shrink: 0;
padding: 20rpx 24rpx;
border-top: 1rpx solid #ebeef5;
background: #ffffff;
}
.store-drawer__footer-btns {
display: flex;
}
.store-drawer__footer-btn + .store-drawer__footer-btn {
margin-left: 16rpx;
}
.store-drawer__footer-btn {
flex: 1;
height: 88rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 8rpx;
font-size: 36rpx;
line-height: 1;
}
.store-drawer__footer-btn--reset {
background: #f5f7fa;
color: #606266;
}
.store-drawer__footer-btn--confirm {
background: #2979ff;
color: #ffffff;
}
}
</style>

View File

@ -1088,6 +1088,10 @@
background: #fff;
border-radius: 16rpx;
margin-bottom: 20rpx;
::v-deep .u-tabs__wrapper__nav__item__text {
font-size: 34rpx;
}
}
.nav-right {

View File

@ -161,7 +161,7 @@
<slot name="bottom"></slot>
<!-- 空状态 -->
<u-empty v-if="details.length === 0" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"
text="暂无商品明细"></u-empty>
text="暂无商品明细" text-size="34rpx"></u-empty>
</scroll-view>
</template>