1
This commit is contained in:
@@ -8,17 +8,35 @@
|
||||
<text :class="{ active: biz==='expense' }" @click="switchBiz('expense')">其他支出</text>
|
||||
</view>
|
||||
|
||||
<!-- 子类目按钮 -->
|
||||
<view class="subtabs" v-if="biz==='sale'">
|
||||
<button class="subbtn" :class="{ active: saleType==='out' }" @click="saleType='out'">出货</button>
|
||||
<button class="subbtn" :class="{ active: saleType==='return' }" @click="saleType='return'">退货</button>
|
||||
<button class="subbtn" :class="{ active: saleType==='collect' }" @click="saleType='collect'">收款</button>
|
||||
</view>
|
||||
<view class="subtabs" v-else-if="biz==='purchase'">
|
||||
<button class="subbtn" :class="{ active: purchaseType==='in' }" @click="purchaseType='in'">进货</button>
|
||||
<button class="subbtn" :class="{ active: purchaseType==='return' }" @click="purchaseType='return'">退货</button>
|
||||
<button class="subbtn" :class="{ active: purchaseType==='pay' }" @click="purchaseType='pay'">付款</button>
|
||||
</view>
|
||||
<!-- 子类目:改为分段式圆角胶囊,与需求截图一致 -->
|
||||
<view class="seg3" v-if="biz==='sale'">
|
||||
<view :class="['seg3-item', saleType==='out' && 'active']" @click="saleType='out'">
|
||||
<image :src="SEG_ICONS.sale.out" class="seg3-icon" mode="aspectFit" />
|
||||
<text>出货</text>
|
||||
</view>
|
||||
<view :class="['seg3-item', saleType==='return' && 'active']" @click="saleType='return'">
|
||||
<image :src="SEG_ICONS.sale.return" class="seg3-icon" mode="aspectFit" />
|
||||
<text>退货</text>
|
||||
</view>
|
||||
<view :class="['seg3-item', saleType==='collect' && 'active']" @click="saleType='collect'">
|
||||
<image :src="SEG_ICONS.sale.collect" class="seg3-icon" mode="aspectFit" />
|
||||
<text>收款</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="seg3" v-else-if="biz==='purchase'">
|
||||
<view :class="['seg3-item', purchaseType==='in' && 'active']" @click="purchaseType='in'">
|
||||
<image :src="SEG_ICONS.purchase.in" class="seg3-icon" mode="aspectFit" />
|
||||
<text>进货</text>
|
||||
</view>
|
||||
<view :class="['seg3-item', purchaseType==='return' && 'active']" @click="purchaseType='return'">
|
||||
<image :src="SEG_ICONS.purchase.return" class="seg3-icon" mode="aspectFit" />
|
||||
<text>退货</text>
|
||||
</view>
|
||||
<view :class="['seg3-item', purchaseType==='pay' && 'active']" @click="purchaseType='pay'">
|
||||
<image :src="SEG_ICONS.purchase.pay" class="seg3-icon" mode="aspectFit" />
|
||||
<text>付款</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 日期与客户 -->
|
||||
<picker mode="date" :value="order.orderTime" @change="onDateChange">
|
||||
@@ -79,25 +97,25 @@
|
||||
<!-- 已选商品与合计(销售/进货 出入库) -->
|
||||
<view v-else-if="biz==='sale' || biz==='purchase'">
|
||||
<!-- 快捷操作:加商品/选择客户(或供应商)/选择日期 → 不改功能,只换排版 -->
|
||||
<view class="info-card">
|
||||
<view class="info-field" @click="biz==='sale' ? chooseCustomer() : chooseSupplier()">
|
||||
<text class="info-label">{{ biz==='sale' ? '客户' : '供应商' }}</text>
|
||||
<text class="info-value">{{ biz==='sale' ? customerLabel : supplierLabel }}</text>
|
||||
</view>
|
||||
<picker class="info-field" mode="date" :value="order.orderTime" @change="onDateChange">
|
||||
<view>
|
||||
<text class="info-label">时间</text>
|
||||
<text class="info-value">{{ order.orderTime }}</text>
|
||||
</view>
|
||||
</picker>
|
||||
<button class="info-action" @click="chooseProduct">
|
||||
<image src="/static/icons/icons8-shopping-cart-100.png" class="info-icon" mode="aspectFit" />
|
||||
<text>加商品</text>
|
||||
</button>
|
||||
</view>
|
||||
<view class="info-card">
|
||||
<view class="info-field party-field" @click="biz==='sale' ? chooseCustomer() : chooseSupplier()">
|
||||
<text class="info-label">{{ biz==='sale' ? '客户' : '供应商' }}</text>
|
||||
<text class="info-value">{{ biz==='sale' ? customerLabel : supplierLabel }}</text>
|
||||
</view>
|
||||
<picker class="info-field time-field" mode="date" :value="order.orderTime" @change="onDateChange">
|
||||
<view>
|
||||
<text class="info-label">时间</text>
|
||||
<text class="info-value">{{ order.orderTime }}</text>
|
||||
</view>
|
||||
</picker>
|
||||
<button class="info-action" @click="chooseProduct">
|
||||
<image src="/static/icons/icons8-shopping-cart-100.png" class="info-icon" mode="aspectFit" />
|
||||
<text>加商品</text>
|
||||
</button>
|
||||
</view>
|
||||
<view class="summary">
|
||||
<text>选中货品({{ totalQuantity }})</text>
|
||||
<text>合计金额:¥ {{ totalAmount.toFixed(2) }}</text>
|
||||
<text class="sel">选中货品({{ totalQuantity }})</text>
|
||||
<view class="total-pill">合计: ¥ {{ totalAmount.toFixed(2) }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 加号添加商品 -->
|
||||
@@ -196,7 +214,19 @@
|
||||
selectedAccountName: '',
|
||||
// 收款/付款输入
|
||||
payments: { cash: 0, bank: 0, wechat: 0 },
|
||||
showMore: false
|
||||
showMore: false,
|
||||
SEG_ICONS: {
|
||||
sale: {
|
||||
out: '/static/icons/sale.png',
|
||||
return: '/static/icons/other-pay.png',
|
||||
collect: '/static/icons/report.png'
|
||||
},
|
||||
purchase: {
|
||||
in: '/static/icons/purchase.png',
|
||||
return: '/static/icons/other-pay.png',
|
||||
pay: '/static/icons/account.png'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -366,9 +396,12 @@
|
||||
.tabs { display: flex; justify-content: space-around; padding: 16rpx 24rpx; }
|
||||
.tabs text { color: $uni-text-color-grey; }
|
||||
.tabs text.active { color: $uni-text-color; font-weight: 700; }
|
||||
.subtabs { display: flex; gap: 16rpx; padding: 0 24rpx 16rpx; }
|
||||
.subbtn { padding: 10rpx 20rpx; border-radius: 999rpx; background: $uni-bg-color-hover; color: $uni-text-color-grey; }
|
||||
.subbtn.active { background: $uni-color-primary; color: #fff; }
|
||||
/* 三段式胶囊切换 */
|
||||
.seg3 { display:flex; gap: 0; margin: 12rpx 16rpx; padding: 6rpx; background:#fff; border:2rpx solid #e6ebf2; border-radius: 999rpx; box-shadow: 0 6rpx 16rpx rgba(0,0,0,0.04); }
|
||||
.seg3-item { flex:1; display:flex; align-items:center; justify-content:center; gap: 8rpx; padding: 12rpx 0; color:$uni-text-color; border-radius: 999rpx; }
|
||||
/* 间隔通过内边距处理,避免空选择器 */
|
||||
.seg3-item.active { background:#fff; color:#4C8DFF; box-shadow: 0 4rpx 12rpx rgba(76,141,255,0.20), 0 0 0 2rpx #4C8DFF inset; }
|
||||
.seg3-icon { width: 28rpx; height: 28rpx; opacity: .9; }
|
||||
.field { display:flex; justify-content: space-between; padding: 22rpx 24rpx; background: $uni-bg-color-grey; border-bottom: 1rpx solid $uni-border-color; }
|
||||
.label { color:$uni-text-color-grey; }
|
||||
.value { color:$uni-text-color; }
|
||||
@@ -395,16 +428,15 @@
|
||||
.chip { padding: 10rpx 20rpx; border-radius: 999rpx; background: $uni-bg-color-hover; color:$uni-text-color-grey; }
|
||||
.chip.active { background: $uni-color-primary; color:#fff; }
|
||||
|
||||
/* 顶部旧 tabs 简化隐藏(改为更简洁布局) */
|
||||
.tabs { display: none; }
|
||||
/* 顶部业务 Tabs 显示 */
|
||||
|
||||
/* 快捷操作宫格 */
|
||||
/* 信息卡片式表达(更稳重) */
|
||||
.info-card { display:grid; grid-template-columns: 1fr 1fr auto; gap: 10rpx; margin: 12rpx 16rpx 0; background:#fff; border:2rpx solid $uni-border-color; border-radius: 16rpx; padding: 10rpx; align-items:center; }
|
||||
.info-field { background:$uni-bg-color-grey; border:2rpx solid $uni-border-color; border-radius: 12rpx; padding: 10rpx 12rpx; }
|
||||
.info-card { display:grid; grid-template-columns: 1fr 1fr auto; gap: 10rpx; margin: 10rpx 12rpx 0; background:transparent; padding: 0; align-items:center; }
|
||||
.info-field { background:#fff; border:2rpx solid #e6ebf2; border-radius: 12rpx; padding: 10rpx 12rpx; box-shadow: 0 6rpx 16rpx rgba(0,0,0,0.04); }
|
||||
.info-label { color:$uni-text-color-grey; font-size: 24rpx; margin-right: 8rpx; }
|
||||
.info-value { color:$uni-text-color; font-weight: 700; }
|
||||
.info-action { display:flex; align-items:center; gap: 6rpx; background:$uni-color-primary; color:#fff; border-radius: 12rpx; padding: 12rpx 14rpx; }
|
||||
.info-action { display:flex; align-items:center; gap: 6rpx; background:$uni-color-primary; color:#fff; border-radius: 12rpx; padding: 14rpx 16rpx; box-shadow: 0 8rpx 18rpx rgba(76,141,255,0.26); }
|
||||
.info-icon { width: 32rpx; height: 32rpx; }
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user