feat: 更新版本号至1.3.23并新增真实库区选择器组件

refactor(warehouse-picker): 重构逻辑库区选择器组件
feat(actual-warehouse-picker): 新增真实库区选择器组件
fix(easycode.vue): 调整钢卷质量状态校验逻辑
style(search.vue): 优化表单样式和字段显示
This commit is contained in:
砂糖
2026-01-13 15:49:43 +08:00
parent 32a2210a5f
commit 5bae1f405b
10 changed files with 555 additions and 155 deletions

View File

@@ -42,3 +42,13 @@ export function delActualWarehouse(actualWarehouseId) {
method: 'delete'
})
}
// 获取两级的树结构
export function treeActualWarehouseTwoLevel(query) {
return request({
url: '/wms/actualWarehouse/levelTwo',
method: 'get',
params: query
})
}

View File

@@ -0,0 +1,402 @@
<template>
<view class="klp-actual-warehouse-picker">
<!-- 输入框触发器 - 全部修复阻止冒泡+固定右侧按钮+文字颜色差异化 -->
<view class="picker-input" @click="openPopup">
<!-- 文本区域未选择=浅灰色(占位色) 选中=深灰色(内容色) -->
<span class="picker-text" :class="{selected: selectedNode.actualWarehouseCode}">
{{ selectedNode.actualWarehouseCode || '请选择真实库区' }}
</span>
<!-- 终极防冒泡原生view包裹图标 + stop.prevent 双重阻断 + 绝对定位固定右侧 -->
<view class="clear-btn-wrap" v-show="selectedNode.actualWarehouseCode" @click.stop.prevent="handleClear">
<uni-icons type="clear" size="24" color="#999"></uni-icons>
</view>
</view>
<!-- uni-popup 原生组件 纯属性使用 无任何样式 -->
<uni-popup ref="popup" type="bottom" background-color="#fff" :mask-click="true" @mask-click="closePopup">
<!-- 弹窗内部根容器 承载所有样式 固定高度核心 -->
<view class="popup-inner-container">
<!-- 弹窗头部标题 -->
<view class="popup-header">选择实际库区</view>
<!-- 第一层横向滚动tab -->
<scroll-view scroll-x class="tab-scroll-view" scroll-with-animation>
<view class="tab-item-wrap">
<view class="tab-item" :class="{active: activeFirstId === item.actualWarehouseId}"
@click="handleFirstTabClick(item)" v-for="item in treeData" :key="item.actualWarehouseId">
{{ item.actualWarehouseName }}
</view>
</view>
</scroll-view>
<!-- 第二层横向滚动tab点选第一层tab后才出现 -->
<scroll-view v-if="activeFirstId" scroll-x class="tab-scroll-view tab-second" scroll-with-animation>
<view class="tab-item-wrap">
<view class="tab-item" :class="{active: activeSecondId === item.actualWarehouseId}"
@click="handleSecondTabClick(item)" v-for="item in secondLevelList" :key="item.actualWarehouseId">
{{ item.actualWarehouseName }}
</view>
</view>
</scroll-view>
<!-- 核心修改筛选框抽离出来 独立节点 固定置顶 永不滚动 -->
<view class="search-box">
<uni-icons type="search" size="24" color="#999"></uni-icons>
<input type="text" v-model="searchKeyword" placeholder="输入编码搜索仓库" class="search-input"
placeholder-class="search-placeholder" />
<uni-icons v-if="searchKeyword" type="clear" size="24" color="#999" class="clear-icon"
@click="searchKeyword = ''"></uni-icons>
</view>
<!-- 仅这个区域滚动纯数据列表区 -->
<view class="select-scroll-content">
<!-- 加载中状态 -->
<view class="loading" v-if="loading">加载中...</view>
<!-- 情况1只选中第一层 展示筛选后的二级数据 -->
<view v-else-if="activeFirstId && !activeSecondId" class="select-list">
<view class="select-item" @click="handleSelectSecondItem(item)" v-for="item in filterSecondList"
:key="item.actualWarehouseId">
{{ item.name }}
<text class="code">{{ item.actualWarehouseCode }}</text>
</view>
</view>
<!-- 情况2选中第二层 展示筛选后的三级数据 -->
<view v-else-if="activeSecondId" class="select-list">
<view class="select-item" @click="handleSelectThirdItem(item)" v-for="item in filterThirdList"
:key="item.actualWarehouseId">
{{ item.name }}
<text class="code">{{ item.actualWarehouseCode }}</text>
</view>
</view>
<!-- 空数据展示 -->
<view class="empty" v-else-if="showEmpty">暂无仓库数据</view>
<!-- 筛选后无数据的兜底提示 -->
<view class="empty"
v-else-if="searchKeyword && (filterSecondList.length === 0 && filterThirdList.length === 0)">暂无匹配的仓库编码
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import {
treeActualWarehouseTwoLevel,
listActualWarehouse
} from '@/api/wms/actualWarehouse.js'
export default {
name: "klp-actual-warehouse-picker",
props: {
showEmpty: {
default: false,
type: Boolean
},
value: {
default: undefined,
}
},
data() {
return {
treeData: [],
secondLevelList: [],
thirdLevelList: [],
selectedNode: {},
activeFirstId: '',
activeSecondId: '',
loading: false,
searchKeyword: '' // 筛选关键词
};
},
computed: {
// 完美双向绑定
innerValue: {
get() {
return this.value
},
set(val) {
this.$emit('input', val);
this.$emit('change', this.selectedNode);
}
},
// ✅ 精准匹配:只做 actualWarehouseCode 仓库编码的模糊筛选(纯编码匹配,无名称)
filterSecondList() {
if (!this.searchKeyword) return this.secondLevelList
const keyword = this.searchKeyword.trim().toLowerCase()
return this.secondLevelList.filter(item => {
const code = item.actualWarehouseCode?.toLowerCase() || ''
return code.includes(keyword)
})
},
// ✅ 精准匹配:只做 actualWarehouseCode 仓库编码的模糊筛选(纯编码匹配,无名称)
filterThirdList() {
if (!this.searchKeyword) return this.thirdLevelList
const keyword = this.searchKeyword.trim().toLowerCase()
return this.thirdLevelList.filter(item => {
const code = item.actualWarehouseCode?.toLowerCase() || ''
return code.includes(keyword)
})
}
},
created() {
this.getTwoLevelData()
},
methods: {
async getTwoLevelData() {
try {
this.loading = true
const res = await treeActualWarehouseTwoLevel()
this.treeData = res.data || []
} catch (err) {
uni.showToast({
title: '加载仓库数据失败',
icon: 'none'
})
console.error('仓库数据加载异常:', err)
} finally {
this.loading = false
}
},
// ✅ 新增:清空选中的仓库数据 + 重置所有状态
handleClear() {
// 1. 清空选中的仓库节点数据
this.selectedNode = {}
// 2. 双向绑定同步清空父组件v-model能拿到空值
this.innerValue = undefined
// 3. 重置一级/二级选中的tab id
this.activeFirstId = ''
this.activeSecondId = ''
// 4. 清空二级、三级仓库列表数据
this.secondLevelList = []
this.thirdLevelList = []
// 5. 清空搜索关键词
this.searchKeyword = ''
// 可选:清空成功的轻提示,和你原有提示风格一致
uni.showToast({
title: '已清空选择',
icon: 'none',
duration: 1200
})
},
openPopup() {
this.$refs.popup.open()
},
closePopup() {
this.$refs.popup.close()
this.searchKeyword = ''
},
handleFirstTabClick(item) {
this.activeFirstId = item.actualWarehouseId
this.activeSecondId = ''
this.thirdLevelList = []
this.searchKeyword = ''
this.secondLevelList = item.children || []
},
async handleSecondTabClick(item) {
this.activeSecondId = item.actualWarehouseId
this.thirdLevelList = []
this.searchKeyword = ''
try {
this.loading = true
const res = await listActualWarehouse({
parentId: item.actualWarehouseId
})
this.thirdLevelList = res.data || []
} catch (err) {
uni.showToast({
title: '加载库区数据失败',
icon: 'none'
})
console.error('三级仓库加载异常:', err)
} finally {
this.loading = false
}
},
handleSelectSecondItem(item) {
this.selectedNode = item
this.innerValue = item.actualWarehouseId
this.closePopup()
},
handleSelectThirdItem(item) {
this.selectedNode = item
this.innerValue = item.actualWarehouseId
this.closePopup()
}
}
}
</script>
<style scoped lang="scss">
.klp-actual-warehouse-picker {
width: 100%;
box-sizing: border-box;
}
// 输入框触发器样式 - 全部优化:父容器相对定位 + 文本颜色区分 + 按钮绝对定位固定右侧
.picker-input {
width: 100%;
height: 88rpx;
line-height: 88rpx;
padding: 0 30rpx;
// ✅ 给右侧清除按钮预留空间,防止文本和按钮重叠
padding-right: 70rpx;
border: 1px solid #e5e5e5;
background-color: #f8f9fa;
border-radius: 12rpx;
font-size: 28rpx;
box-sizing: border-box;
// ✅ 关键:父容器相对定位,为子元素绝对定位做铺垫
position: relative;
// ✅ 文本颜色差异化核心样式
.picker-text {
// 未选择仓库 - 占位文本颜色浅灰色placeholder色
color: #999;
&.selected {
// 选中仓库后 - 内容文本颜色(深灰色,主色)
color: #333;
}
}
// ✅ 清除按钮:绝对定位 死死固定在输入框最右侧 永不偏移
.clear-btn-wrap {
position: absolute;
right: 20rpx; // 距离右侧固定间距
top: 50%;
transform: translateY(-50%); // 垂直居中完美对齐
width: 40rpx;
height: 40rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
// 按钮点击按压反馈,和你原有风格一致
&:active {
background-color: #e5e5e5;
}
}
}
// ✅ 弹窗内部根容器 - 固定高度核心 样式100%生效
.popup-inner-container {
width: 100%;
height: 80vh; // 弹窗固定高度,适配所有手机
// max-height: 900rpx; // 大屏高度上限,防止过高
overflow: hidden; // 禁止整体滚动
display: flex;
flex-direction: column; // 垂直布局核心
}
// 弹窗头部标题 - 固定不滚动
.popup-header {
height: 90rpx;
line-height: 90rpx;
text-align: center;
font-size: 32rpx;
font-weight: bold;
border-bottom: 1px solid #f5f5f5;
flex-shrink: 0; // 固定高度 不被压缩
}
// 横向滚动tab容器 - 固定不滚动
.tab-scroll-view {
width: 100%;
white-space: nowrap;
padding: 20rpx 0;
border-bottom: 1px solid #f5f5f5;
flex-shrink: 0; // 固定高度 不被压缩
.tab-item-wrap {
display: inline-block;
padding: 0 20rpx;
}
.tab-item {
display: inline-block;
padding: 12rpx 30rpx;
margin: 0 10rpx;
font-size: 28rpx;
border-radius: 20rpx;
color: #666;
&.active {
background: #007aff;
color: #fff;
}
}
}
// 二级tab区分隔线
.tab-second {
border-top: 1px solid #f5f5f5;
}
// ✅✅✅ 筛选框样式 - 固定置顶 永不滚动 核心样式
.search-box {
display: flex;
align-items: center;
padding: 16rpx 30rpx;
margin: 10rpx 20rpx 0;
background: #f8f8f8;
border-radius: 30rpx;
flex-shrink: 0; // 关键:固定高度 不参与滚动 不被压缩
.search-input {
flex: 1;
height: 50rpx;
line-height: 50rpx;
font-size: 26rpx;
color: #333;
margin: 0 10rpx;
}
.search-placeholder {
font-size: 26rpx;
color: #999;
}
.clear-icon {
padding: 0 8rpx;
}
}
// ✅✅✅ 唯一滚动区域:纯数据列表区
.select-scroll-content {
flex: 1; // 占满弹窗剩余所有高度
overflow-y: auto; // 仅此处滚动 核心!
padding: 10rpx 0;
box-sizing: border-box;
.select-list {
.select-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
font-size: 40rpx;
border-bottom: 1px solid #f5f5f5;
&:active {
background-color: #f5f5f5;
}
.code {
color: #000;
font-size: 30rpx;
}
}
}
.loading,
.empty {
text-align: center;
padding: 50rpx 0;
font-size: 28rpx;
color: #999;
}
}
</style>

View File

@@ -7,7 +7,9 @@
<text class="picker-text" :class="{ 'picker-placeholder': !itemType }">
{{ itemType === 'product' ? '成品' : itemType === 'raw_material' ? '原料' : '请选择物品类型' }}
</text>
<text class="picker-arrow" v-if="!disabled"></text>
<!-- 互斥显示选中类型=清除按钮 未选中=下拉箭头 -->
<!-- <text class="picker-clear" v-if="itemType && !disabled" @click.stop.prevent="handleClearItemType"></text> -->
<text class="picker-arrow"></text>
</view>
</view>
@@ -18,7 +20,9 @@
<text class="picker-text" :class="{ 'picker-placeholder': !selectedName }">
{{ loadingProducts ? '加载中...' : selectedName || '请选择产品' }}
</text>
<text class="picker-arrow" v-if="!disabled && !loadingProducts"></text>
<!-- 互斥显示选中产品=清除按钮 未选中/加载中=下拉箭头 -->
<text class="picker-clear" v-if="selectedName && !disabled && !loadingProducts" @click.stop.prevent="handleClearProduct"></text>
<text class="picker-arrow" v-else-if="!disabled && !loadingProducts"></text>
</view>
</view>
@@ -29,7 +33,9 @@
<text class="picker-text" :class="{ 'picker-placeholder': !selectedName }">
{{ loadingRawMaterials ? '加载中...' : selectedName || '请选择原材料' }}
</text>
<text class="picker-arrow" v-if="!disabled && !loadingRawMaterials"></text>
<!-- 互斥显示选中原料=清除按钮 未选中/加载中=下拉箭头 -->
<text class="picker-clear" v-if="selectedName && !disabled && !loadingRawMaterials" @click.stop.prevent="handleClearRawMaterial"></text>
<text class="picker-arrow" v-else-if="!disabled && !loadingRawMaterials"></text>
</view>
</view>
@@ -259,7 +265,6 @@
const keyword = this.rawMaterialSearchKeyword.trim().toLowerCase();
this.filteredRawMaterials = keyword
? this.rawMaterials.filter(m => {
console.log(m.specification)
// 只基于原材料名称过滤,且确保是原材料数据
return (m.rawMaterialName && m.rawMaterialName.toLowerCase().includes(keyword))
|| m?.specification?.toLowerCase()?.includes(keyword)
@@ -324,13 +329,36 @@
},
closeRawMaterialPicker() {
this.$refs.rawMaterialPopup.close();
},
// ✅ 新增核心清除方法1清空物品类型 + 所有关联数据(完全重置)
handleClearItemType() {
this.$emit('update:itemType', '');
this.$emit('update:itemId', undefined);
this.$emit('update:materialType', undefined);
this.selectedName = '';
uni.showToast({ title: '已清空物品类型', icon: 'none' });
},
// ✅ 新增核心清除方法2仅清空选中的产品保留物品类型为成品
handleClearProduct() {
this.$emit('update:itemId', undefined);
this.selectedName = '';
uni.showToast({ title: '已清空产品选择', icon: 'none' });
},
// ✅ 新增核心清除方法3仅清空选中的原材料保留物品类型为原料
handleClearRawMaterial() {
this.$emit('update:itemId', undefined);
this.selectedName = '';
uni.showToast({ title: '已清空原材料选择', icon: 'none' });
}
}
};
</script>
<style scoped lang="scss">
/* 样式保持不变 */
/* 样式保持不变 + 新增清除按钮样式 */
.form-item-optional {
margin-bottom: 30rpx;
@@ -347,6 +375,7 @@
width: 100%;
height: 88rpx;
padding: 0 24rpx;
padding-right: 60rpx; // ✅ 新增:给清除按钮/箭头预留空间,防止文本遮挡
background: #f8f9fa;
border: 2rpx solid #e8e8e8;
border-radius: 12rpx;
@@ -382,6 +411,23 @@
color: #999;
margin-left: 10rpx;
}
// ✅ 新增:清除按钮样式,与箭头风格统一,点击有按压反馈
.picker-clear {
font-size: 28rpx;
color: #999;
width: 40rpx;
height: 40rpx;
display: flex;
align-items: center;
justify-content: center;
margin-left: 8rpx;
border-radius: 50%;
&:active {
background-color: #e8e8e8;
color: #666;
}
}
}
.warehouse-popup {

View File

@@ -1,6 +1,6 @@
<template>
<view>
<!-- 选择器触发按钮 -->
<!-- 选择器触发按钮 - 核心互斥未选中=箭头 / 选中=清除按钮二选一 -->
<view
class="picker-input"
@click="handleOpen"
@@ -9,15 +9,21 @@
<text class="picker-text" :class="{ 'picker-placeholder': !selectedName }">
{{ selectedName || placeholder }}
</text>
<text class="picker-arrow" v-if="!disabled"></text>
<!-- 互斥核心选中库区 清除按钮 | 未选中 下拉箭头永不共存 -->
<text
class="picker-clear"
v-if="selectedName && !disabled"
@click.stop.prevent="handleClear"
></text>
<text class="picker-arrow" v-else-if="!disabled"></text>
</view>
<!-- 弹窗内容 -->
<!-- 弹窗内容 - 固定逻辑库区标题无任何真实库区相关内容 -->
<uni-popup ref="popup" type="bottom" @close="handlePopupClose">
<view class="warehouse-popup">
<!-- 弹窗头部 -->
<!-- 弹窗头部 - 固定标题选择逻辑库区 -->
<view class="popup-header">
<text class="popup-title">{{ title || (wareType === 'virtual' ? '选择逻辑库区' : '选择真实库区') }}</text>
<text class="popup-title">选择逻辑库区</text>
<text class="popup-close" @click="handleClose"></text>
</view>
@@ -42,11 +48,11 @@
<view
class="warehouse-item"
v-for="item in filteredList"
:key="getItemId(item)"
:key="item.warehouseId"
@click="handleSelect(item)"
>
<text class="warehouse-name">{{ getItemName(item) }}</text>
<text class="warehouse-check" v-if="getItemId(item) === selectedId"></text>
<text class="warehouse-name">{{ item.warehouseName }}</text>
<text class="warehouse-check" v-if="item.warehouseId === selectedId"></text>
</view>
<view class="empty-tip" v-if="filteredList.length === 0">
<text>未找到匹配的库区</text>
@@ -65,13 +71,13 @@
</template>
<script>
// ✅ 只保留逻辑库区接口,彻底删除真实库区接口引入
import { listWarehouse } from '@/api/wms/warehouse.js'
import { listActualWarehouse } from '@/api/wms/actualWarehouse.js'
export default {
name: 'WarehousePicker',
props: {
// 已选中的库区ID用于回显
// 已选中的逻辑库区ID用于回显
value: {
type: [String, Number],
default: ''
@@ -86,25 +92,17 @@ export default {
type: String,
default: '请选择库区'
},
// 弹窗标题
// 弹窗标题(保留该属性,如需自定义可传,默认固定为选择逻辑库区)
title: {
type: String,
default: ''
},
// 库区类型virtual-逻辑库区actual-真实库区
wareType: {
type: String,
default: 'virtual',
validator: (value) => {
return ['virtual', 'actual'].includes(value)
}
}
},
data() {
return {
// 弹窗显示状态
showPopup: false,
// 所有库区列表
// 所有逻辑库区列表
dataList: [],
// 过滤后的库区列表
filteredList: [],
@@ -137,31 +135,17 @@ export default {
immediate: true,
handler(val) {
if (val && this.dataList.length) {
const matched = this.dataList.find(item => this.getItemId(item) === val)
this.selectedName = matched ? this.getItemName(matched) : ''
const matched = this.dataList.find(item => item.warehouseId === val)
this.selectedName = matched ? matched.warehouseName : ''
}
}
},
// 监听库区类型变化,重新加载数据
wareType: {
immediate: true,
handler() {
this.loadWarehouses()
}
}
},
mounted() {
this.loadWarehouses()
},
methods: {
// 根据类型获取项目ID
getItemId(item) {
return this.wareType === 'virtual' ? item.warehouseId : item.actualWarehouseId
},
// 根据类型获取项目名称
getItemName(item) {
return this.wareType === 'virtual' ? item.warehouseName : item.actualWarehouseName
},
// 加载库区列表
// 加载逻辑库区列表 ✅ 精简后:只保留逻辑库区接口请求,无任何类型判断
async loadWarehouses() {
if (this.loading) return
@@ -170,23 +154,18 @@ export default {
this.errorMsg = ''
try {
// 根据类型选择不同的API
const res = this.wareType === 'virtual'
? await listWarehouse({ pageNum: 1, pageSize: 1000 })
: await listActualWarehouse({ pageNum: 1, pageSize: 1000 })
const res = await listWarehouse({ pageNum: 1, pageSize: 1000 })
if (res.code === 200) {
this.dataList = res[this.wareType === 'virtual' ? 'data' : 'rows'] || []
this.dataList = res.data || []
this.filteredList = [...this.dataList]
// 初始化选中项名称
this.updateSelectedName()
} else {
throw new Error(res.msg || `${this.wareType === 'virtual' ? '逻辑' : '真实'}库区数据加载失败`)
throw new Error(res.msg || '逻辑库区数据加载失败')
}
} catch (err) {
this.error = true
this.errorMsg = err.message
console.error(`${this.wareType === 'virtual' ? '逻辑' : '真实'}库区加载失败:`, err)
console.error('逻辑库区加载失败:', err)
} finally {
this.loading = false
}
@@ -196,29 +175,33 @@ export default {
updateSelectedName() {
if (!this.selectedId) return
const matched = this.dataList.find(
item => this.getItemId(item) === this.selectedId
)
this.selectedName = matched ? this.getItemName(matched) : ''
const matched = this.dataList.find(item => item.warehouseId === this.selectedId)
this.selectedName = matched ? matched.warehouseName : ''
},
// 搜索过滤
// 搜索过滤:只匹配逻辑库区名称
handleSearch() {
const keyword = this.searchKeyword.trim().toLowerCase()
if (!keyword) {
this.filteredList = [...this.dataList]
} else {
this.filteredList = this.dataList.filter(item =>
this.getItemName(item).toLowerCase().includes(keyword)
item.warehouseName.toLowerCase().includes(keyword)
)
}
},
// 选择库区
// 选择逻辑库区:保留禁用库区过滤逻辑
handleSelect(item) {
this.selectedId = this.getItemId(item)
this.selectedName = this.getItemName(item)
// 通知父组件选中的完整信息
if (item.isEnabled == 0) {
uni.showToast({
title: '该库区已禁用',
icon: 'none'
});
return;
}
this.selectedId = item.warehouseId
this.selectedName = item.warehouseName
this.$emit('change', item)
this.handleClose()
},
@@ -226,7 +209,6 @@ export default {
// 打开弹窗
handleOpen() {
if (this.disabled) return
// 每次打开前重置搜索
this.searchKeyword = ''
this.filteredList = [...this.dataList]
this.showPopup = true
@@ -242,17 +224,25 @@ export default {
// 弹窗关闭回调
handlePopupClose() {
this.showPopup = false
},
// ✅ 清空选中的库区数据清空ID+名称,双向绑定同步,触发空回调
handleClear() {
this.selectedId = '';
this.selectedName = '';
this.$emit('change', {});
}
}
}
</script>
<style scoped lang="scss">
/* 保持原有样式不变 */
/* 保持原有样式不变,样式适配互斥显示,无需任何修改 */
.picker-input {
width: 100%;
height: 88rpx;
padding: 0 24rpx;
padding-right: 60rpx; // 预留按钮/箭头空间,防止文本遮挡
background: #f8f9fa;
border: 2rpx solid #e8e8e8;
border-radius: 12rpx;
@@ -283,11 +273,29 @@ export default {
}
}
// 下拉箭头样式
.picker-arrow {
font-size: 24rpx;
color: #999;
margin-left: 10rpx;
}
// 清除按钮样式 (和箭头位置一致,样式协调)
.picker-clear {
font-size: 28rpx;
color: #999;
width: 40rpx;
height: 40rpx;
display: flex;
align-items: center;
justify-content: center;
margin-left: 8rpx;
border-radius: 50%;
&:active {
background-color: #e8e8e8;
color: #666;
}
}
}
.warehouse-popup {
@@ -417,7 +425,7 @@ export default {
.empty-tip {
text-align: center;
padding: 60rpx 0;
padding: 60rpx 0;
color: #999;
font-size: 28rpx;
}

View File

@@ -8,7 +8,7 @@ module.exports = {
// 应用名称
name: "ruoyi-app",
// 应用版本
version: "1.3.22",
version: "1.3.23",
// 应用logo
logo: "/static/logo.jpg",
// 官方网站

View File

@@ -2,7 +2,7 @@
"name" : "科伦普",
"appid" : "__UNI__E781B49",
"description" : "",
"versionName" : "1.3.22",
"versionName" : "1.3.23",
"versionCode" : 1,
"transformPx" : false,
"app-plus" : {

View File

@@ -500,73 +500,11 @@
this.$refs.shipPopup.open('bottom');
this.currentAction = 'ship';
this.coilDetail = coilRes.data
// uni.showModal({
// cancelText: '取消',
// confirmText: '确认',
// title: '确定要将钢卷号为:' + coilRes.data.currentCoilNo + '发货吗?',
// showCancel: true,
// success: async (res) => {
// console.log(res)
// if (res.cancel) {
// uni.showToast({
// title: '已取消发货',
// icon: 'none'
// })
// return;
// }
// try {
// // 判断钢卷的质量状态必须是A+, AA-, B+其中之一
// if (!['A+', 'A', 'A-', 'B+'].includes(coilRes.data.qualityStatus)) {
// uni.showToast({
// title: '只能发货B+以上品质的钢卷',
// icon: 'none'
// });
// return;
// }
// // 1. 更新钢卷状态为已发货
// await exportCoil(coilRes.data.coilId);
// // 2. 插入一条已完成的待操作记录
// await addPendingAction({
// coilId: coilRes.data.coilId,
// currentCoilNo: coilRes.data.currentCoilNo,
// actionType: 402, // 402=发货
// actionStatus: 2, // 直接标记为完成状态
// scanTime: new Date(),
// scanDevice: this.getDeviceInfo(),
// priority: 0, // 0=普通
// sourceType: 'scan',
// warehouseId: coilRes.data.warehouseId,
// processTime: new Date(),
// completeTime: new Date()
// });
// uni.showToast({
// title: '发货成功',
// icon: 'none'
// });
// } catch (error) {
// console.error('发货失败:', error);
// uni.showToast({
// title: error?.message || '发货失败',
// icon: 'none'
// });
// }
// },
// fail() {
// uni.showToast({
// title: '已取消发货',
// icon: 'none'
// })
// }
// });
// uni.hideLoading();
},
async handleShipSubmit() {
try {
// 判断钢卷的质量状态必须是A+, AA-, B+其中之一
// 判断钢卷的质量状态必须是A+, AA-, B+,B,B-其中之一
if (!['A+', 'A', 'A-', 'B+', 'B', 'B-'].includes(this.coilDetail.qualityStatus)
&& !(this.coilDetail.qualityStatus == null
|| this.coilDetail.qualityStatus == undefined

View File

@@ -7,23 +7,22 @@
</view>
<!-- 当前钢卷号 -->
<view class="form-item">
<view class="form-item form-item-optional">
<text class="form-label">入场钢卷号</text>
<input v-model="form.enterCoilNo" placeholder="请输入当前钢卷号" class="form-input"
:disabled="coilDetail.dataType === 0" :class="{ 'form-input-disabled': coilDetail.dataType === 0 }" />
:disabled="coilDetail.dataType === 0" />
</view>
<view class="form-item">
<view class="form-item form-item-optional">
<text class="form-label">当前钢卷号</text>
<input v-model="form.currentCoilNo" placeholder="请输入当前钢卷号" class="form-input"
:disabled="coilDetail.dataType === 0" :class="{ 'form-input-disabled': coilDetail.dataType === 0 }" />
</view>
</view>
<!-- 班组 -->
<view class="form-item">
<view class="form-item form-item-optional">
<text class="form-label">班组</text>
<input v-model="form.team" placeholder="请输入班组名称" class="form-input" :disabled="coilDetail.dataType === 0"
:class="{ 'form-input-disabled': coilDetail.dataType === 0 }" />
<input v-model="form.team" placeholder="请输入班组名称" class="form-input" />
</view>
<!-- 库区选择 -->
@@ -32,11 +31,11 @@
<klp-warehouse-picker v-model="form.warehouseId" :disabled="coilDetail.dataType === 0" placeholder="请选择目标库区" />
</view>
<!-- <view class="form-item form-item-optional">
<view class="form-item form-item-optional">
<text class="form-label-optional">真实库区</text>
<klp-warehouse-picker v-model="form.actualWarehouseId" :disabled="coilDetail.dataType === 0"
placeholder="请选择目标库区" ware-type="actual" />
</view> -->
<klp-actual-warehouse-picker v-model="form.actualWarehouseId" :disabled="coilDetail.dataType === 0"
placeholder="请选择目标库区" />
</view>
<!-- 物品类型产品原材料选择使用封装组件 -->
<klp-material-picker
@@ -84,15 +83,12 @@
<!-- 长度 -->
<view class="form-item form-item-optional">
<text class="form-label-optional">长度 ()</text>
<input v-model="form.length" type="digit" placeholder="请输入长度(选填)" class="form-input"
<input v-model="form.length" type="digit" placeholder="请输入长度" class="form-input"
:disabled="coilDetail.dataType === 0" :class="{ 'form-input-disabled': coilDetail.dataType === 0 }" />
</view>
<!-- 移除原查询按钮 -->
</view>
<view v-show='currentView == "list"' class="list-wrap">
<!-- 移除原重新查找按钮的外层容器 -->
<!-- 列表中尽可能多的展示信息 -->
<uni-list v-if="list.length > 0">
<uni-list-item
@@ -131,7 +127,7 @@
<text class="item-value">{{ coilDetail.currentCoilNo || '-' }}</text>
</view>
<view class="info-item">
<text class="item-label">供应商卷号</text>
<text class="item-label">厂家卷号</text>
<text class="item-value">{{ coilDetail.supplierCoilNo || '-' }}</text>
</view>
<view class="info-item">
@@ -563,11 +559,11 @@
margin-bottom: 15rpx;
font-weight: 500;
&::before {
content: '*';
color: #ff4d4f;
margin-right: 6rpx;
}
// &::before {
// content: '*';
// color: #ff4d4f;
// margin-right: 6rpx;
// }
}
.form-label-optional {

View File

@@ -73,7 +73,7 @@ function checkStorageSpace() {
function checkUpdate(forceCheck = false) {
// 1. 准备本地版本信息
const localVersion = plus.runtime.version; // 基座版本
const staticVersion = '1.3.22'; // 静态默认版本
const staticVersion = '1.3.23'; // 静态默认版本
const localWgtVersion = uni.getStorageSync('wgtVersion') || staticVersion; // 本地wgt版本从存储获取或用默认
const currentVersion = compareVersion(localWgtVersion, localVersion) > 0
? localWgtVersion

View File

@@ -1,5 +1,5 @@
{
"version": "klp 1.3.22",
"version": "klp 1.3.23",
"wgtUrl": "http://49.232.154.205:10900/fadapp-update/klp/klp.wgt",
"apkUrl": "http://49.232.154.205:10900/fadapp-update/klp/klp.apk"
}