feat(storefabric): 新增坯布出库相关页面及功能
- 在 manifest.json 中添加 Android 包名配置 - 在 package.json 中添加 pnpm 依赖覆盖配置 - 在 pages.json 中注册坯布出库相关页面路由 - 重命名 storefabricBusinessOutAdd.vue 为 storeFabricBusinessOutAdd.vue - 重构坯布出库新增页面,优化界面布局和交互逻辑 - 添加坯布出库列表、编辑、查看等功能页面 - 集成订单状态栏、面料信息弹窗、细码弹窗等组件 - 实现坯布出库详情列表和扫码功能模块 - 优化表单验证和数据提交流程
This commit is contained in:
@@ -0,0 +1,154 @@
|
||||
<template>
|
||||
<view class="fabric-out-scanDetail">
|
||||
<view class="fabric-out-scanDetailRow fabric-out-scanDetailRow--2col">
|
||||
<text class="fabric-out-scanDetailCell">已扫条数:{{ formatCount(detail.scanned_roll) }}条</text>
|
||||
<text class="fabric-out-scanDetailCell">机台库存:{{ formatRoll(detail.machine_stock) }}条</text>
|
||||
</view>
|
||||
<view class="fabric-out-scanDetailRow fabric-out-scanDetailRow--2col">
|
||||
<text class="fabric-out-scanDetailCell">合计条数:{{ formatRoll(detail.total_roll) }}条</text>
|
||||
<text class="fabric-out-scanDetailCell">合计重量:{{ formatWeight(detail.total_weight) }}KG</text>
|
||||
</view>
|
||||
<view class="fabric-out-scanDetailRow">
|
||||
<text class="fabric-out-scanDetailLabel">客户:</text>
|
||||
<text class="fabric-out-scanDetailValue">{{ detail.customer_name || '' }}</text>
|
||||
</view>
|
||||
<view class="fabric-out-scanDetailRow fabric-out-scanDetailRow--2col">
|
||||
<view class="fabric-out-scanDetailCheck" @click="toggleGroup('produce_order_no')">
|
||||
<checkbox :checked="isGroupChecked('produce_order_no')" />
|
||||
<text class="fabric-out-scanDetailLabel">生产通知单:</text>
|
||||
<text class="fabric-out-scanDetailValue">{{ detail.produce_order_no || '' }}</text>
|
||||
</view>
|
||||
<view class="fabric-out-scanDetailCheck" @click="toggleGroup('grey_fabric_code')">
|
||||
<checkbox :checked="isGroupChecked('grey_fabric_code')" />
|
||||
<text class="fabric-out-scanDetailLabel">布编:</text>
|
||||
<text class="fabric-out-scanDetailValue">{{ detail.grey_fabric_code || '' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fabric-out-scanDetailRow">
|
||||
<text class="fabric-out-scanDetailLabel">布名:</text>
|
||||
<text class="fabric-out-scanDetailValue">{{ detail.grey_fabric_name || '' }}</text>
|
||||
</view>
|
||||
<view class="fabric-out-scanDetailRow">
|
||||
<view class="fabric-out-scanDetailCheck" @click="toggleGroup('yarn_batch')">
|
||||
<checkbox :checked="isGroupChecked('yarn_batch')" />
|
||||
<text class="fabric-out-scanDetailLabel">纱批:</text>
|
||||
<text class="fabric-out-scanDetailValue">{{ detail.yarn_batch || '' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fabric-out-scanDetailRow fabric-out-scanDetailRow--2col">
|
||||
<view class="fabric-out-scanDetailCheck" @click="toggleGroup('machine_number')">
|
||||
<checkbox :checked="isGroupChecked('machine_number')" />
|
||||
<text class="fabric-out-scanDetailLabel">机号:</text>
|
||||
<text class="fabric-out-scanDetailValue">{{ detail.machine_number || '' }}</text>
|
||||
</view>
|
||||
<view class="fabric-out-scanDetailCheck" @click="toggleGroup('volume_number')">
|
||||
<checkbox :checked="isGroupChecked('volume_number')" />
|
||||
<text class="fabric-out-scanDetailLabel">布号:</text>
|
||||
<text class="fabric-out-scanDetailValue">{{ detail.volume_number || '' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fabric-out-scanDetailRow fabric-out-scanDetailRow--2col">
|
||||
<view class="fabric-out-scanDetailCheck" @click="toggleGroup('grey_fabric_level_name')">
|
||||
<checkbox :checked="isGroupChecked('grey_fabric_level_name')" />
|
||||
<text class="fabric-out-scanDetailLabel">等级:</text>
|
||||
<text class="fabric-out-scanDetailValue">{{ detail.grey_fabric_level_name || '' }}</text>
|
||||
</view>
|
||||
<view class="fabric-out-scanDetailCell">
|
||||
<text class="fabric-out-scanDetailLabel">重量:</text>
|
||||
<text class="fabric-out-scanDetailValue">{{ formatWeight(detail.weight) }}Kg</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<scroll-view scroll-x class="fabric-out-scanDetailTableScroll">
|
||||
<view class="fabric-out-scanDetailTable" :style="{ width: tableWidth }">
|
||||
<view class="fabric-out-scanDetailTableRow fabric-out-scanDetailTableHead">
|
||||
<view
|
||||
v-for="col in columns"
|
||||
:key="col.key"
|
||||
class="fabric-out-scanDetailTableCell"
|
||||
:style="cellStyle(col)"
|
||||
>{{ col.label }}</view>
|
||||
</view>
|
||||
<view v-if="!tableRows.length" class="fabric-out-scanDetailEmpty">暂无数据~~</view>
|
||||
<view
|
||||
v-for="(row, rowIndex) in tableRows"
|
||||
:key="rowIndex"
|
||||
class="fabric-out-scanDetailTableRow"
|
||||
>
|
||||
<view
|
||||
v-for="col in columns"
|
||||
:key="col.key"
|
||||
class="fabric-out-scanDetailTableCell"
|
||||
:style="cellStyle(col)"
|
||||
>{{ formatCell(row, col.key) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
SCAN_DETAIL_TABLE_COLUMNS,
|
||||
getScanDetailTableWidth,
|
||||
buildScanDetailTableRows,
|
||||
} from '@/common/storeFabricBusinessOut';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
detail: { type: Object, default: () => ({}) },
|
||||
itemData: { type: Array, default: () => [] },
|
||||
groupKeys: { type: Array, default: () => [] },
|
||||
},
|
||||
computed: {
|
||||
columns() {
|
||||
return SCAN_DETAIL_TABLE_COLUMNS;
|
||||
},
|
||||
tableWidth() {
|
||||
return getScanDetailTableWidth(this.columns);
|
||||
},
|
||||
tableRows() {
|
||||
return buildScanDetailTableRows(this.itemData, this.groupKeys);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
cellStyle(col) {
|
||||
return {
|
||||
width: `${col.width}rpx`,
|
||||
minWidth: `${col.width}rpx`,
|
||||
maxWidth: `${col.width}rpx`,
|
||||
};
|
||||
},
|
||||
isGroupChecked(key) {
|
||||
return (this.groupKeys || []).includes(key);
|
||||
},
|
||||
toggleGroup(key) {
|
||||
const next = [...(this.groupKeys || [])];
|
||||
const index = next.indexOf(key);
|
||||
if (index >= 0) next.splice(index, 1);
|
||||
else next.push(key);
|
||||
this.$emit('group-change', next);
|
||||
},
|
||||
formatRoll(value) {
|
||||
const n = Number(value || 0);
|
||||
return Number.isInteger(n) ? n : Number(n.toFixed(2));
|
||||
},
|
||||
formatCount(value) {
|
||||
return Number(value || 0);
|
||||
},
|
||||
formatWeight(value) {
|
||||
const n = Number(value || 0);
|
||||
return Number(n.toFixed(2));
|
||||
},
|
||||
formatCell(row, key) {
|
||||
if (key === 'roll') return this.formatRoll(row.roll);
|
||||
if (key === 'weight') return this.formatWeight(row.weight);
|
||||
return row[key] || '';
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
|
||||
</style>
|
||||
Reference in New Issue
Block a user