feat: 新增手动进仓并统一PDA字号标准
This commit is contained in:
@@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
description: PDA 小屏界面字号与排版标准(以手动进仓页为准)
|
||||||
|
alwaysApply: true
|
||||||
|
---
|
||||||
|
|
||||||
|
# PDA 字号标准
|
||||||
|
|
||||||
|
本项目面向工业 PDA 小屏。新增/改版业务页时,**以后台手动进仓页**(`storeFabricManualIn.vue`)的字号为准,不要用偏小的默认字号。
|
||||||
|
|
||||||
|
共用变量:`@import '@/common/pda-typography.scss';`(或等价路径)。
|
||||||
|
|
||||||
|
## 字号(rpx)
|
||||||
|
|
||||||
|
| 用途 | 字号 | 变量 |
|
||||||
|
|------|------|------|
|
||||||
|
| 表单标签 / 正文 / 输入值 | **36** | `$pda-font-body` |
|
||||||
|
| 扫码输入框 | **36** | `$pda-font-body` |
|
||||||
|
| 占位提示 | **34** | `$pda-font-placeholder` |
|
||||||
|
| 行内操作(取消/修改) | **34** | `$pda-font-action` |
|
||||||
|
| 单位角标(如 KG) | **32** | `$pda-font-unit` |
|
||||||
|
| 顶栏次要文字(设置等) | **32** | `$pda-font-nav-sub` |
|
||||||
|
| 主按钮文字 | **36** | `$pda-font-button` |
|
||||||
|
| 弹层标题 / 选项 | **36** | `$pda-font-popup-title` / `$pda-font-popup-item` |
|
||||||
|
| 弹层取消 / 空态 | **34** | `$pda-font-popup-sub` |
|
||||||
|
|
||||||
|
## 行高与触控
|
||||||
|
|
||||||
|
- 列表行最小高度约 **100rpx**,可略加上下 padding
|
||||||
|
- 扫码输入框高度约 **100rpx**
|
||||||
|
- 主按钮高度约 **92rpx**
|
||||||
|
- 标签列宽约 **200rpx**(中文四字标签)
|
||||||
|
|
||||||
|
## 注意
|
||||||
|
|
||||||
|
- 登录环境选择、出仓明细等已放大过的页面,新改动保持不低于上表
|
||||||
|
- 不要为了“好看”再缩小字号;宁可少露内容、可滚动,也要可读
|
||||||
|
- 选择类弹层(如 `SearchSelectPopup`)与表单页使用同一套字号
|
||||||
@@ -46,6 +46,12 @@ const install = (Vue, vm) => {
|
|||||||
detailList: (params = {}) => vm.$u.get(gfmWarehouseUrl('getGfmWarehouseList'), params),
|
detailList: (params = {}) => vm.$u.get(gfmWarehouseUrl('getGfmWarehouseList'), params),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// PDA 生产进仓(排产单细码扫码进仓)
|
||||||
|
productionScheduleOrder: {
|
||||||
|
getScanFineCodeDetail: (params = {}) => vm.$u.get('/produce/productionScheduleOrder/getScanFineCodeDetail', params),
|
||||||
|
scanInWarehouseFineCode: (params = {}) => vm.$u.putJson('/produce/productionScheduleOrder/scanInWarehouseFineCode', params),
|
||||||
|
},
|
||||||
|
|
||||||
// 营销体系下拉(路径相对 apiurl:.../pda/v1/saleSystem/getSaleSystemDropdownList)
|
// 营销体系下拉(路径相对 apiurl:.../pda/v1/saleSystem/getSaleSystemDropdownList)
|
||||||
saleSystem: {
|
saleSystem: {
|
||||||
getDropdownList: (params = {}) => vm.$u.get('/saleSystem/getSaleSystemDropdownList', params),
|
getDropdownList: (params = {}) => vm.$u.get('/saleSystem/getSaleSystemDropdownList', params),
|
||||||
@@ -56,6 +62,11 @@ const install = (Vue, vm) => {
|
|||||||
list: (params = {}) => vm.$u.get('/business_unit/list', params),
|
list: (params = {}) => vm.$u.get('/business_unit/list', params),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 员工枚举(路径相对 apiurl:.../pda/v1/employee/list_enum)
|
||||||
|
employee: {
|
||||||
|
listEnum: (params = {}) => vm.$u.get('/employee/list_enum', params),
|
||||||
|
},
|
||||||
|
|
||||||
// 字典明细枚举(路径相对 apiurl:.../pda/v1/dictionaryDetail/getDictionaryDetailEnumList)
|
// 字典明细枚举(路径相对 apiurl:.../pda/v1/dictionaryDetail/getDictionaryDetailEnumList)
|
||||||
dictionary: {
|
dictionary: {
|
||||||
getDetailEnumList: (params = {}) => vm.$u.get('/dictionaryDetail/getDictionaryDetailEnumList', params),
|
getDetailEnumList: (params = {}) => vm.$u.get('/dictionaryDetail/getDictionaryDetailEnumList', params),
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* PDA 小屏字号标准(以手动进仓页为准)
|
||||||
|
* 业务页请优先引用这些变量,避免字号再次变小。
|
||||||
|
*/
|
||||||
|
|
||||||
|
$pda-font-body: 36rpx;
|
||||||
|
$pda-font-placeholder: 34rpx;
|
||||||
|
$pda-font-action: 34rpx;
|
||||||
|
$pda-font-unit: 32rpx;
|
||||||
|
$pda-font-nav-sub: 32rpx;
|
||||||
|
$pda-font-button: 36rpx;
|
||||||
|
$pda-font-popup-title: 36rpx;
|
||||||
|
$pda-font-popup-item: 36rpx;
|
||||||
|
$pda-font-popup-sub: 34rpx;
|
||||||
|
|
||||||
|
$pda-row-min-height: 100rpx;
|
||||||
|
$pda-scan-input-height: 100rpx;
|
||||||
|
$pda-button-height: 92rpx;
|
||||||
|
$pda-label-width: 200rpx;
|
||||||
@@ -84,7 +84,9 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped lang="scss">
|
||||||
|
@import '@/common/pda-typography.scss';
|
||||||
|
|
||||||
.search-select {
|
.search-select {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding-bottom: 20rpx;
|
padding-bottom: 20rpx;
|
||||||
@@ -101,12 +103,12 @@ export default {
|
|||||||
padding: 24rpx 30rpx 12rpx;
|
padding: 24rpx 30rpx 12rpx;
|
||||||
}
|
}
|
||||||
.search-select__title {
|
.search-select__title {
|
||||||
font-size: 32rpx;
|
font-size: $pda-font-popup-title;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #202328;
|
color: #202328;
|
||||||
}
|
}
|
||||||
.search-select__cancel {
|
.search-select__cancel {
|
||||||
font-size: 28rpx;
|
font-size: $pda-font-popup-sub;
|
||||||
color: #888;
|
color: #888;
|
||||||
}
|
}
|
||||||
.search-select__search {
|
.search-select__search {
|
||||||
@@ -121,11 +123,11 @@ export default {
|
|||||||
padding: 80rpx 0;
|
padding: 80rpx 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 28rpx;
|
font-size: $pda-font-popup-sub;
|
||||||
}
|
}
|
||||||
.search-select__item {
|
.search-select__item {
|
||||||
padding: 28rpx 30rpx;
|
padding: 32rpx 30rpx;
|
||||||
font-size: 30rpx;
|
font-size: $pda-font-popup-item;
|
||||||
color: #202328;
|
color: #202328;
|
||||||
border-bottom: 1px solid #f2f2f2;
|
border-bottom: 1px solid #f2f2f2;
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-1
@@ -569,7 +569,7 @@
|
|||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},{
|
},{
|
||||||
"path" : "pages/storefabric/storeFabricBusinessOutList",
|
"path" : "pages/storefabric/storeFabricBusinessOutList",
|
||||||
"style" :
|
"style" :
|
||||||
{
|
{
|
||||||
@@ -577,6 +577,13 @@
|
|||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},{
|
},{
|
||||||
|
"path": "pages/storefabric/storeFabricManualIn",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "手动进仓",
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
},{
|
||||||
"path" : "pages/storefabric/storeFabricBusinessOutAdd",
|
"path" : "pages/storefabric/storeFabricBusinessOutAdd",
|
||||||
"style" :
|
"style" :
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,551 @@
|
|||||||
|
<template>
|
||||||
|
<view class="manual-in">
|
||||||
|
<common-navbar title="手动进仓">
|
||||||
|
<template #right>
|
||||||
|
<view class="manual-in__setting" @click="navToSetting">
|
||||||
|
<u-icon name="setting" color="#333333" size="34"></u-icon>
|
||||||
|
<text>设置</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</common-navbar>
|
||||||
|
|
||||||
|
<view class="manual-in__scan">
|
||||||
|
<input
|
||||||
|
class="manual-in__scan-input"
|
||||||
|
type="text"
|
||||||
|
confirm-type="done"
|
||||||
|
:focus="scanFocus"
|
||||||
|
v-model="scanCode"
|
||||||
|
placeholder="请点击扫描/输入布票编码"
|
||||||
|
placeholder-class="manual-in__placeholder"
|
||||||
|
@confirm="onScanConfirm"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="manual-in__panel">
|
||||||
|
<view class="manual-in__row">
|
||||||
|
<text class="manual-in__label">布票编码</text>
|
||||||
|
<text class="manual-in__value">{{ detail.fabric_piece_code || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="manual-in__row">
|
||||||
|
<text class="manual-in__label">生产单号</text>
|
||||||
|
<text class="manual-in__value">{{ detail.production_order_no || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="manual-in__row">
|
||||||
|
<text class="manual-in__label">机台</text>
|
||||||
|
<text class="manual-in__value">{{ detail.machine_number || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="manual-in__row">
|
||||||
|
<text class="manual-in__label">布种名称</text>
|
||||||
|
<text class="manual-in__value">{{ detail.grey_fabric_name || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="manual-in__row">
|
||||||
|
<text class="manual-in__label">坯布编号</text>
|
||||||
|
<text class="manual-in__value">{{ detail.grey_fabric_code || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="manual-in__row manual-in__row--input">
|
||||||
|
<text class="manual-in__label">重量</text>
|
||||||
|
<view class="manual-in__right">
|
||||||
|
<input
|
||||||
|
class="manual-in__field"
|
||||||
|
type="digit"
|
||||||
|
v-model="weightKg"
|
||||||
|
placeholder="请输入"
|
||||||
|
placeholder-class="manual-in__placeholder"
|
||||||
|
/>
|
||||||
|
<text class="manual-in__unit">KG</text>
|
||||||
|
<text class="manual-in__action" @click="clearWeight">取消</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="manual-in__row manual-in__row--input" @click="openLevelPicker">
|
||||||
|
<text class="manual-in__label">等级</text>
|
||||||
|
<view class="manual-in__right">
|
||||||
|
<text :class="levelDisplayName ? 'manual-in__field-text' : 'manual-in__placeholder'">
|
||||||
|
{{ levelDisplayName || '请选择等级' }}
|
||||||
|
</text>
|
||||||
|
<text class="manual-in__action" @click.stop="clearLevel">取消</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="manual-in__row manual-in__row--input" @click="openInspectorPicker">
|
||||||
|
<text class="manual-in__label">查布工</text>
|
||||||
|
<view class="manual-in__right">
|
||||||
|
<text :class="detail.inspector_name ? 'manual-in__field-text' : 'manual-in__placeholder'">
|
||||||
|
{{ detail.inspector_name || '请选择查布工' }}
|
||||||
|
</text>
|
||||||
|
<text class="manual-in__action" @click.stop="clearInspector">取消</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="manual-in__row manual-in__row--input">
|
||||||
|
<text class="manual-in__label">存放仓位</text>
|
||||||
|
<view class="manual-in__right">
|
||||||
|
<input
|
||||||
|
class="manual-in__field"
|
||||||
|
type="text"
|
||||||
|
v-model="warehouseBinName"
|
||||||
|
placeholder="/"
|
||||||
|
placeholder-class="manual-in__placeholder"
|
||||||
|
/>
|
||||||
|
<text class="manual-in__action" @click="editWarehouseBin">修改</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="manual-in__row" v-if="detail.volume_number != null && detail.volume_number !== ''">
|
||||||
|
<text class="manual-in__label">卷号</text>
|
||||||
|
<text class="manual-in__value">{{ detail.volume_number }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="manual-in__footer">
|
||||||
|
<u-button
|
||||||
|
type="primary"
|
||||||
|
shape="circle"
|
||||||
|
:loading="submitting"
|
||||||
|
:disabled="submitting || loadingDetail"
|
||||||
|
@click="submitInWarehouse"
|
||||||
|
>确定进仓</u-button>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<SearchSelectPopup
|
||||||
|
:show.sync="levelPickerShow"
|
||||||
|
title="选择等级"
|
||||||
|
placeholder="请输入等级名称"
|
||||||
|
:list="levelOptions"
|
||||||
|
@confirm="onLevelConfirm"
|
||||||
|
/>
|
||||||
|
<SearchSelectPopup
|
||||||
|
:show.sync="inspectorPickerShow"
|
||||||
|
title="选择查布工"
|
||||||
|
placeholder="请输入查布工姓名"
|
||||||
|
:list="inspectorOptions"
|
||||||
|
@confirm="onInspectorConfirm"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import CommonNavbar from '@/components/common-navbar/index';
|
||||||
|
import SearchSelectPopup from '@/components/storefabric/SearchSelectPopup.vue';
|
||||||
|
import scanMixin from '@/common/scanMixin.js';
|
||||||
|
import { formatWeightKg } from '@/common/storeFabricBusinessOut.js';
|
||||||
|
|
||||||
|
// 坯布等级字典 id(与后台字典配置一致)
|
||||||
|
const DICTIONARY_TYPE_GREY_FABRIC_LEVEL = 10025;
|
||||||
|
// 查布工岗位 duty(验布/查布相关)
|
||||||
|
const INSPECTOR_DUTY = '20004,20011';
|
||||||
|
const WEIGHT_SCALE = 10000;
|
||||||
|
|
||||||
|
function emptyDetail() {
|
||||||
|
return {
|
||||||
|
fabric_piece_code: '',
|
||||||
|
production_order_no: '',
|
||||||
|
machine_number: '',
|
||||||
|
grey_fabric_name: '',
|
||||||
|
grey_fabric_code: '',
|
||||||
|
inspection_weight: null,
|
||||||
|
grey_fabric_level_id: [],
|
||||||
|
grey_fabric_level_name: '',
|
||||||
|
inspector_id: null,
|
||||||
|
inspector_name: '',
|
||||||
|
volume_number: '',
|
||||||
|
grey_fabric_id: '',
|
||||||
|
id: '',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function toWeightInt(kg) {
|
||||||
|
const n = Number(kg);
|
||||||
|
if (!Number.isFinite(n) || n < 0) return null;
|
||||||
|
return Math.round(n * WEIGHT_SCALE);
|
||||||
|
}
|
||||||
|
|
||||||
|
function normalizeLevelIds(value) {
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
return value.map((item) => Number(item)).filter((item) => Number.isFinite(item));
|
||||||
|
}
|
||||||
|
if (value == null || value === '') return [];
|
||||||
|
const n = Number(value);
|
||||||
|
return Number.isFinite(n) ? [n] : [];
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { CommonNavbar, SearchSelectPopup },
|
||||||
|
mixins: [scanMixin],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
scanCode: '',
|
||||||
|
scanFocus: true,
|
||||||
|
submitting: false,
|
||||||
|
loadingDetail: false,
|
||||||
|
warehouseBinId: null,
|
||||||
|
warehouseBinName: '',
|
||||||
|
weightKg: '',
|
||||||
|
detail: emptyDetail(),
|
||||||
|
levelPickerShow: false,
|
||||||
|
levelOptions: [],
|
||||||
|
levelOptionsLoaded: false,
|
||||||
|
inspectorPickerShow: false,
|
||||||
|
inspectorOptions: [],
|
||||||
|
inspectorOptionsLoaded: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
levelDisplayName() {
|
||||||
|
return this.detail.grey_fabric_level_name || '';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.registerScanBroadcast(this.handleScanCode);
|
||||||
|
this.loadLevelOptions();
|
||||||
|
this.loadInspectorOptions();
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.scanFocus = false;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.scanFocus = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
navToSetting() {
|
||||||
|
uni.navigateTo({ url: '/pages/sys/user/scan-settings' });
|
||||||
|
},
|
||||||
|
clearWeight() {
|
||||||
|
this.weightKg = '';
|
||||||
|
this.detail.inspection_weight = null;
|
||||||
|
},
|
||||||
|
clearLevel() {
|
||||||
|
this.detail.grey_fabric_level_id = [];
|
||||||
|
this.detail.grey_fabric_level_name = '';
|
||||||
|
},
|
||||||
|
clearInspector() {
|
||||||
|
this.detail.inspector_id = null;
|
||||||
|
this.detail.inspector_name = '';
|
||||||
|
},
|
||||||
|
editWarehouseBin() {
|
||||||
|
uni.showModal({
|
||||||
|
title: '存放仓位',
|
||||||
|
editable: true,
|
||||||
|
placeholderText: '请输入仓位名称',
|
||||||
|
content: this.warehouseBinName || '',
|
||||||
|
success: (res) => {
|
||||||
|
if (!res.confirm) return;
|
||||||
|
this.warehouseBinName = (res.content || '').trim();
|
||||||
|
this.warehouseBinId = null;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async loadLevelOptions() {
|
||||||
|
try {
|
||||||
|
const res = await this.$u.api.dictionary.getDetailEnumList({
|
||||||
|
dictionary_id: DICTIONARY_TYPE_GREY_FABRIC_LEVEL,
|
||||||
|
status: 1,
|
||||||
|
size: 200,
|
||||||
|
});
|
||||||
|
const list = Array.isArray(res) ? res : (Array.isArray(res && res.list) ? res.list : []);
|
||||||
|
this.levelOptions = list
|
||||||
|
.map((item) => ({
|
||||||
|
value: item.id,
|
||||||
|
label: item.name || item.code || String(item.id),
|
||||||
|
}))
|
||||||
|
.filter((item) => item.value != null);
|
||||||
|
this.levelOptionsLoaded = true;
|
||||||
|
} catch (error) {
|
||||||
|
console.log('加载坯布等级枚举失败', error);
|
||||||
|
this.levelOptions = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async openLevelPicker() {
|
||||||
|
if (!this.levelOptionsLoaded || !this.levelOptions.length) {
|
||||||
|
await this.loadLevelOptions();
|
||||||
|
}
|
||||||
|
if (!this.levelOptions.length) {
|
||||||
|
this.$u.toast('暂无等级可选,请检查等级字典配置');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.levelPickerShow = true;
|
||||||
|
},
|
||||||
|
onLevelConfirm(item) {
|
||||||
|
if (!item) return;
|
||||||
|
this.detail.grey_fabric_level_id = [Number(item.value)];
|
||||||
|
this.detail.grey_fabric_level_name = item.label || '';
|
||||||
|
},
|
||||||
|
async loadInspectorOptions() {
|
||||||
|
try {
|
||||||
|
const res = await this.$u.api.employee.listEnum({
|
||||||
|
size: 50,
|
||||||
|
duty: INSPECTOR_DUTY,
|
||||||
|
});
|
||||||
|
const list = Array.isArray(res) ? res : (Array.isArray(res && res.list) ? res.list : []);
|
||||||
|
this.inspectorOptions = list
|
||||||
|
.map((item) => ({
|
||||||
|
value: item.id,
|
||||||
|
label: item.name || item.employee_name || item.real_name || item.code || String(item.id),
|
||||||
|
}))
|
||||||
|
.filter((item) => item.value != null);
|
||||||
|
this.inspectorOptionsLoaded = true;
|
||||||
|
} catch (error) {
|
||||||
|
console.log('加载查布工枚举失败', error);
|
||||||
|
this.inspectorOptions = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async openInspectorPicker() {
|
||||||
|
if (!this.inspectorOptionsLoaded || !this.inspectorOptions.length) {
|
||||||
|
await this.loadInspectorOptions();
|
||||||
|
}
|
||||||
|
if (!this.inspectorOptions.length) {
|
||||||
|
this.$u.toast('暂无查布工可选');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.inspectorPickerShow = true;
|
||||||
|
},
|
||||||
|
onInspectorConfirm(item) {
|
||||||
|
if (!item) return;
|
||||||
|
this.detail.inspector_id = Number(item.value);
|
||||||
|
this.detail.inspector_name = item.label || '';
|
||||||
|
},
|
||||||
|
handleScanCode(scanResult) {
|
||||||
|
const code = String(scanResult || '').trim().replace(/[\r\n]/g, '');
|
||||||
|
if (!code) return;
|
||||||
|
this.fetchScanDetail(code);
|
||||||
|
},
|
||||||
|
onScanConfirm() {
|
||||||
|
const code = String(this.scanCode || '').trim();
|
||||||
|
if (!code) {
|
||||||
|
this.$u.toast('请扫描或输入布票编码');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.fetchScanDetail(code);
|
||||||
|
},
|
||||||
|
async fetchScanDetail(code) {
|
||||||
|
if (this.loadingDetail) return;
|
||||||
|
this.loadingDetail = true;
|
||||||
|
this.scanCode = code;
|
||||||
|
try {
|
||||||
|
const res = await this.$u.api.productionScheduleOrder.getScanFineCodeDetail({
|
||||||
|
fabric_piece_code: code,
|
||||||
|
});
|
||||||
|
this.applyScanDetail(res, code);
|
||||||
|
} catch (error) {
|
||||||
|
console.log('扫码获取细码失败', error);
|
||||||
|
this.detail = {
|
||||||
|
...emptyDetail(),
|
||||||
|
fabric_piece_code: code,
|
||||||
|
};
|
||||||
|
this.weightKg = '';
|
||||||
|
} finally {
|
||||||
|
this.loadingDetail = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
applyScanDetail(res, fallbackCode) {
|
||||||
|
const data = res || {};
|
||||||
|
const levelIds = normalizeLevelIds(data.grey_fabric_level_id);
|
||||||
|
this.detail = {
|
||||||
|
...emptyDetail(),
|
||||||
|
fabric_piece_code: data.fabric_piece_code || fallbackCode || '',
|
||||||
|
production_order_no: data.production_order_no || '',
|
||||||
|
machine_number: data.machine_number || '',
|
||||||
|
grey_fabric_name: data.grey_fabric_name || '',
|
||||||
|
grey_fabric_code: data.grey_fabric_code || '',
|
||||||
|
inspection_weight: data.inspection_weight != null ? data.inspection_weight : null,
|
||||||
|
grey_fabric_level_id: levelIds,
|
||||||
|
grey_fabric_level_name: data.grey_fabric_level_name || '',
|
||||||
|
inspector_id: data.inspector_id != null ? data.inspector_id : null,
|
||||||
|
inspector_name: data.inspector_name || '',
|
||||||
|
};
|
||||||
|
this.weightKg = data.inspection_weight != null
|
||||||
|
? String(formatWeightKg(data.inspection_weight))
|
||||||
|
: '';
|
||||||
|
this.scanCode = this.detail.fabric_piece_code;
|
||||||
|
},
|
||||||
|
async submitInWarehouse() {
|
||||||
|
const fabricPieceCode = String(this.detail.fabric_piece_code || this.scanCode || '').trim();
|
||||||
|
if (!fabricPieceCode) {
|
||||||
|
this.$u.toast('请先扫描或输入布票编码');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const actualWeight = toWeightInt(this.weightKg);
|
||||||
|
if (actualWeight == null) {
|
||||||
|
this.$u.toast('请输入有效重量');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const levelIds = normalizeLevelIds(this.detail.grey_fabric_level_id);
|
||||||
|
if (!levelIds.length) {
|
||||||
|
this.$u.toast('请选择等级');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.submitting) return;
|
||||||
|
this.submitting = true;
|
||||||
|
try {
|
||||||
|
const payload = {
|
||||||
|
fabric_piece_code: fabricPieceCode,
|
||||||
|
actual_weight: actualWeight,
|
||||||
|
electronic_scale_weight: actualWeight,
|
||||||
|
grey_fabric_level_id: levelIds,
|
||||||
|
};
|
||||||
|
const inspectorName = String(this.detail.inspector_name || '').trim();
|
||||||
|
if (inspectorName) {
|
||||||
|
payload.inspector_name = inspectorName;
|
||||||
|
}
|
||||||
|
if (this.detail.inspector_id != null && this.detail.inspector_id !== '') {
|
||||||
|
payload.inspector_id = Number(this.detail.inspector_id);
|
||||||
|
}
|
||||||
|
const binName = String(this.warehouseBinName || '').trim();
|
||||||
|
if (binName && binName !== '/') {
|
||||||
|
payload.warehouse_bin_name = binName;
|
||||||
|
}
|
||||||
|
if (this.warehouseBinId != null && this.warehouseBinId !== '') {
|
||||||
|
payload.warehouse_bin_id = Number(this.warehouseBinId);
|
||||||
|
}
|
||||||
|
const res = await this.$u.api.productionScheduleOrder.scanInWarehouseFineCode(payload);
|
||||||
|
if (res) {
|
||||||
|
this.detail.volume_number = res.volume_number != null ? res.volume_number : this.detail.volume_number;
|
||||||
|
this.detail.grey_fabric_id = res.grey_fabric_id != null ? res.grey_fabric_id : this.detail.grey_fabric_id;
|
||||||
|
this.detail.id = res.id != null ? res.id : this.detail.id;
|
||||||
|
if (res.fabric_piece_code) {
|
||||||
|
this.detail.fabric_piece_code = res.fabric_piece_code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const volumeText = res && res.volume_number != null ? `,卷号 ${res.volume_number}` : '';
|
||||||
|
this.$u.toast(`进仓成功${volumeText}`);
|
||||||
|
this.resetForNextScan();
|
||||||
|
} catch (error) {
|
||||||
|
console.log('手动进仓失败', error);
|
||||||
|
} finally {
|
||||||
|
this.submitting = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
resetForNextScan() {
|
||||||
|
this.scanCode = '';
|
||||||
|
this.detail = emptyDetail();
|
||||||
|
this.weightKg = '';
|
||||||
|
this.warehouseBinId = null;
|
||||||
|
this.warehouseBinName = '';
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.scanFocus = false;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.scanFocus = true;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import '@/common/pda-typography.scss';
|
||||||
|
|
||||||
|
.manual-in {
|
||||||
|
min-height: 100vh;
|
||||||
|
background: #f5f6f8;
|
||||||
|
padding-bottom: 180rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__setting {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8rpx;
|
||||||
|
font-size: $pda-font-nav-sub;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__scan {
|
||||||
|
margin: 16rpx 0;
|
||||||
|
padding: 0 28rpx;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__scan-input {
|
||||||
|
height: $pda-scan-input-height;
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
color: #202328;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__placeholder {
|
||||||
|
color: #b0b4bb;
|
||||||
|
font-size: $pda-font-placeholder;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__panel {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
min-height: $pda-row-min-height;
|
||||||
|
padding: 12rpx 28rpx;
|
||||||
|
border-bottom: 1rpx solid #eceff3;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__row--input {
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__label {
|
||||||
|
width: $pda-label-width;
|
||||||
|
flex-shrink: 0;
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__value {
|
||||||
|
flex: 1;
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
color: #202328;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__right {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 18rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__field {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
text-align: right;
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
color: #202328;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__field-text {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
text-align: right;
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
color: #202328;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__unit {
|
||||||
|
font-size: $pda-font-unit;
|
||||||
|
color: #666;
|
||||||
|
padding: 6rpx 14rpx;
|
||||||
|
border: 1rpx solid #d7dbe3;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__action {
|
||||||
|
font-size: $pda-font-action;
|
||||||
|
color: #2f78e6;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__footer {
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
padding: 24rpx 40rpx calc(24rpx + env(safe-area-inset-bottom));
|
||||||
|
background: #fff;
|
||||||
|
box-shadow: 0 -4rpx 16rpx rgba(0, 0, 0, 0.04);
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .manual-in__footer .u-btn {
|
||||||
|
height: $pda-button-height !important;
|
||||||
|
line-height: $pda-button-height !important;
|
||||||
|
font-size: $pda-font-button !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -63,6 +63,14 @@ export default {
|
|||||||
path: '/pages/storefabric/storeFabricWarehouseGroupList',
|
path: '/pages/storefabric/storeFabricWarehouseGroupList',
|
||||||
tone: 'tone-stock',
|
tone: 'tone-stock',
|
||||||
bg: '/static/img/workbench/fabric-stock.jpg'
|
bg: '/static/img/workbench/fabric-stock.jpg'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '手动进仓',
|
||||||
|
en: 'MANUAL ENTRY',
|
||||||
|
tag: '进仓',
|
||||||
|
path: '/pages/storefabric/storeFabricManualIn',
|
||||||
|
tone: 'tone-in',
|
||||||
|
bg: '/static/img/workbench/fabric-stock.jpg'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
@@ -281,4 +289,16 @@ page {
|
|||||||
.tone-stock .menu-card__tag text {
|
.tone-stock .menu-card__tag text {
|
||||||
color: #2f78e6;
|
color: #2f78e6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tone-in {
|
||||||
|
background: #3f51b5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tone-in .menu-card__mask {
|
||||||
|
background: rgba(63, 81, 181, 0.72);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tone-in .menu-card__tag text {
|
||||||
|
color: #3f51b5;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user