feat: 半屏扫码、改密退出与表格并升至1.1.19

This commit is contained in:
2026-11-11 11:35:39 +08:00
parent 4825cd13f2
commit 6273ec0f19
34 changed files with 1232 additions and 242 deletions
@@ -4,39 +4,26 @@
<slot name="before-list" />
<view class="summary-wrap">
<scroll-view scroll-x class="summary-scroll">
<view class="summary-table" :style="{ width: tableWidth }">
<view class="summary-row summary-head">
<view
v-for="col in columns"
:key="col.key"
class="summary-cell"
:style="cellStyle(col)"
>{{ col.label }}</view>
</view>
<view v-if="!rows.length" class="summary-empty">{{ emptyText }}</view>
<view
<t-table v-if="rows.length" border="1" border-color="#e5e5e5" :style="{ width: tableWidth }">
<t-tr class="summary-head" font-size="18" color="#666666" align="left">
<t-th v-for="col in columns" :key="col.key" :style="cellStyle(col)">{{ col.label }}</t-th>
</t-tr>
<t-tr
v-for="row in rows"
:key="row.group_key"
class="summary-row"
font-size="18"
color="#333333"
align="left"
:class="{ 'summary-row--open': expandedKey === row.group_key }"
@click="toggleRow(row.group_key)"
>
<view
v-for="col in columns"
:key="col.key"
class="summary-cell"
:style="cellStyle(col)"
>{{ formatCell(row, col.key) }}</view>
</view>
<view v-if="rows.length" class="summary-row summary-total">
<view
v-for="col in columns"
:key="col.key"
class="summary-cell"
:style="cellStyle(col)"
>{{ totalCell(col.key) }}</view>
</view>
</view>
<t-td v-for="col in columns" :key="col.key" :style="cellStyle(col)">{{ formatCell(row, col.key) }}</t-td>
</t-tr>
<t-tr class="summary-total" font-size="18" color="#333333" align="left">
<t-td v-for="col in columns" :key="col.key" :style="cellStyle(col)">{{ totalCell(col.key) }}</t-td>
</t-tr>
</t-table>
<view v-else class="summary-empty">{{ emptyText }}</view>
</scroll-view>
<view v-if="expandedRow" class="summary-fine">
@@ -46,30 +33,26 @@
</view>
<view v-if="!expandedRow.fine_codes.length" class="summary-empty">暂无细码</view>
<scroll-view v-else scroll-x class="summary-scroll">
<view class="summary-table" :style="{ width: fineTableWidth }">
<view class="summary-row summary-head">
<view
v-for="col in fineCols"
:key="col.key"
class="summary-cell"
:style="cellStyle(col)"
>{{ col.label }}</view>
</view>
<view
<t-table border="1" border-color="#e5e5e5" :style="{ width: fineTableWidth }">
<t-tr class="summary-head" font-size="18" color="#666666" align="left">
<t-th v-for="col in fineCols" :key="col.key" :style="cellStyle(col)">{{ col.label }}</t-th>
</t-tr>
<t-tr
v-for="(fc, fcIndex) in expandedRow.fine_codes"
:key="fc.id || fcIndex"
class="summary-row"
font-size="18"
color="#333333"
align="left"
>
<view
<t-td
v-for="col in fineCols"
:key="col.key"
class="summary-cell"
:class="{ 'summary-action': col.key === 'action' }"
:style="cellStyle(col)"
@click="onFineCellTap(col.key, fc)"
>{{ formatFineCell(fc, col.key) }}</view>
</view>
</view>
>{{ formatFineCell(fc, col.key) }}</t-td>
</t-tr>
</t-table>
</scroll-view>
<view v-if="deletable && expandedRow.fine_codes.length" class="summary-tip">
点击「删除」移除对应细码
@@ -80,6 +63,11 @@
</template>
<script>
import tTable from '@/components/t-table/t-table.vue';
import tTh from '@/components/t-table/t-th.vue';
import tTr from '@/components/t-table/t-tr.vue';
import tTd from '@/components/t-table/t-td.vue';
const SUMMARY_COLUMNS = [
{ label: '成品编号', key: 'product_code', width: 260 },
{ label: '色号', key: 'product_color_code', width: 220 },
@@ -104,6 +92,7 @@ const TARE_COLUMNS = [
];
export default {
components: { tTable, tTh, tTr, tTd },
props: {
groups: { type: Array, default: () => [] },
title: { type: String, default: '明细' },
@@ -191,10 +180,12 @@ export default {
return Number(total.toFixed(2));
},
cellStyle(col) {
const width = `${col.width}rpx`;
return {
width: `${col.width}rpx`,
minWidth: `${col.width}rpx`,
maxWidth: `${col.width}rpx`,
width,
minWidth: width,
maxWidth: width,
flex: `0 0 ${width}`,
};
},
joinName(code, name) {
@@ -255,46 +246,23 @@ export default {
.summary-scroll {
width: 100%;
}
.summary-table {
border-bottom: 1rpx solid #eee;
}
.summary-row {
display: flex;
align-items: stretch;
border-bottom: 1rpx solid #f0f0f0;
}
.summary-row:last-child {
border-bottom: none;
}
.summary-head {
background: #f7f8fa;
}
.summary-row--open {
background: #f0f7ff;
}
.summary-total {
background: #fff7e6;
}
.summary-cell {
::v-deep .t-th,
::v-deep .t-td {
box-sizing: border-box;
display: flex;
align-items: center;
min-height: $pda-row-min-height;
padding: 12rpx 16rpx;
font-size: $pda-font-body;
color: #333;
border-right: 1rpx solid #f0f0f0;
word-break: break-all;
}
.summary-head .summary-cell {
font-weight: bold;
color: #666;
::v-deep .summary-head {
background: #f7f8fa;
}
.summary-total .summary-cell {
font-weight: bold;
::v-deep .summary-row--open {
background: #f0f7ff;
}
.summary-cell:last-child {
border-right: none;
::v-deep .summary-total {
background: #fff7e6;
}
::v-deep .summary-action {
color: #f5222d;
}
.summary-empty {
padding: 28rpx 16rpx;