Files
pda-cli/src/components/storefabric/FabricOutScanDetail.vue
T

101 lines
4.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<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">
<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>
<view class="fabric-out-scanDetailRow">
<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>
</view>
</template>
<script>
export default {
props: {
detail: { type: Object, default: () => ({}) },
groupKeys: { type: Array, default: () => [] },
},
methods: {
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));
},
},
};
</script>
<style scoped lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
</style>