Commit e3a5cd02 by LJM

优化

parent 02480e31
......@@ -6,7 +6,10 @@
<view class="picking-sort-wrap">
<view class="search-type row bothSide verCenter">
<view class="left" style="width: 49%;">
<view class="row bothSide verCenter">
<view class="title row verCenter" style="height: 45rpx;">库 位:</view>
<view style="font-size:24rpx;color: #1969f9;margin-right:13rpx;" @click="copy">复制</view>
</view>
<view class="search-bar row bothSide verCenter">
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
......@@ -782,7 +785,7 @@
setTimeout(() => {
this.is_focus = true;
this.$forceUpdate();
}, 1000);
}, 500);
} else if (type == 2) {
//入库批次号为自营仓库的时候,旧标签开启状态,输入文本后自动截取前8位,。
if (this.warehouse_id == 9 && this.old_Label) {
......@@ -1448,6 +1451,28 @@
setTimeout(() => {
this.is_focus = true;
}, 200);
},
/**
* 复制
*/
copy() {
uni.setClipboardData({
data: this.stock_out_sn,
success: function() {
console.log('复制成功');
uni.showToast({
title: '复制成功',
icon: 'success'
});
},
fail: function() {
console.log('复制失败');
uni.showToast({
title: '复制失败',
icon: 'fail'
});
}
});
}
}
};
......
......@@ -252,8 +252,9 @@
this.is_batch = e.detail.value;
this.searchParams.is_full_sweep = this.is_batch ? 1 : 0;
//批量模式下分页显示为20条
if (this.is_batch) {
this.limit = 50;
this.limit = 20;
} else {
this.limit = 16;
}
......@@ -270,7 +271,7 @@
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 800);
}, 200);
this.getData();
},
/**
......@@ -408,13 +409,15 @@
if (!this.history_id.includes(val)) {
this.history_id.push(val);
}
this.searchParams.search_keyword = this.history_id.join(',');
this.getData((data, msg) => {
//回调data里数据,加是否选中交互
if (data.length > 0) {
this.is_batch_active = true;
this.list = data;
this.list.forEach((item, index) => {
this.list.forEach((_item, index) => {
this.filterChange(index);
});
}
......@@ -426,7 +429,7 @@
content: msg,
confirmText: '关闭',
showCancel: false,
success: res => {
success: () => {
let index_history_id = this.history_id.indexOf(val);
this.history_id.splice(index_history_id, 1);
try {
......@@ -436,7 +439,7 @@
this.is_focus = true;
this.search_keyword = ''; //清空入库批次号
this.$forceUpdate();
}, 500);
}, 200);
} catch (e) {
//TODO handle the exception
}
......
......@@ -8,8 +8,11 @@
<view class="left" style="width: 49%;">
<view class="box-info row bothSide verCenter">
<view class="title row bothSide verCenter">打包箱号:</view>
<view class="row verCenter">
<view style="font-size:24rpx;color: #1969f9;margin-right:23rpx;" @click="copy">复制</view>
<view class="info" @click="showBox()">箱信息</view>
</view>
</view>
<view class="search-bar row bothSide verCenter">
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
......@@ -607,7 +610,7 @@
<view class="box-title row bothSide verCenter">
<view class="row verCenter">
<text class="t1">打包箱号:</text>
<input type="text" placeholder="箱号" placeholder-style="color:#919399" class="uni-input" v-model="packList[i].box_name" style="width: 78rpx;height: 25rpx;" />
<input type="text" placeholder="箱号" placeholder-style="color:#919399" class="uni-input" v-model="packList[i].box_name" style="width: 78rpx;height: 25rpx;" @input="validateInput($event,i)" />
</view>
<view>
<picker @change="bindPickerBoxChange($event, i)" :value="index" :range="packConfigList" :range-key="'name'">
......@@ -1336,6 +1339,22 @@
var parmas = {
pack_list: JSON.stringify(this.packList)
};
// 定义匹配中文字符的正则表达式
const chineseRegex = /[\u4e00-\u9fa5]/;
// 使用 some 方法检查是否存在包含中文字符的 box_name
const hasChinese = this.packList.some(({ box_name }) => chineseRegex.test(box_name));
if (hasChinese) {
uni.showToast({
title: '箱号不合法',
icon: 'success'
});
return false;
}
this.request(API.updatePackInfo, 'POST', parmas, true).then(res => {
if (res.code === 0) {
uni.showToast({
......@@ -1439,6 +1458,34 @@
this.$refs.showRight.close(); //按货品复核
this.$refs.showRightPack.close(); //按容器复核
this.$refs.showRightAll.close(); //一键复核
},
/**
* 验证输入框
*/
validateInput(event, index) {
},
/**
* 复制
*/
copy() {
uni.setClipboardData({
data: this.stock_out_sn,
success: function() {
console.log('复制成功');
uni.showToast({
title: '复制成功',
icon: 'success'
});
},
fail: function() {
console.log('复制失败');
uni.showToast({
title: '复制失败',
icon: 'fail'
});
}
});
}
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment