diff --git a/src/views/wpm_bx/wprList.vue b/src/views/wpm_bx/wprList.vue
index 9a32db72..de0e49a8 100644
--- a/src/views/wpm_bx/wprList.vue
+++ b/src/views/wpm_bx/wprList.vue
@@ -9,11 +9,17 @@
关联产品
发货编号
清空编号
+ 批量喷码
-
+
+
+
{
- if(item.number.indexOf(that.search) > -1){
- that.$refs.wprTable.setCurrentRow(item);
- let rows = document.querySelectorAll("#wprTable .el-table__row");
- let row = rows[index];
- let rowTop = row.offsetTop;
- that.$refs.wprTable.scrollTo({ top: rowTop });
- }
- })
+ let foundIndex = that.wprList.findIndex(item => item.number.indexOf(that.search) > -1);
+ if(foundIndex > -1){
+ let found = that.wprList.splice(foundIndex, 1)[0];
+ that.wprList.unshift(found);
+ that.$nextTick(() => {
+ that.$refs.wprTable.setCurrentRow(that.wprList[0]);
+ that.$refs.wprTable.toggleRowSelection(that.wprList[0], true);
+ that.$refs.wprTable.scrollTo({ top: 0 });
+ });
+ }
},
//打签
printMaterial(row){
@@ -350,7 +360,7 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => {
delete map[row.id];
that.coderLoadingIds = map;
};
- that.$API.cm.labeltemplate.list.req({search: templateName, page: 0}).then((res) => {
+ that.$API.cm.labeltemplate.list.req({name: templateName, page: 0}).then((res) => {
let list = Array.isArray(res) ? res : (res && res.results) || [];
let template = list.find(t => t.name === templateName);
if (!template) {
@@ -368,6 +378,15 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => {
}).finally(release);
}).catch(release);
},
+ handleSelectionChange(rows){
+ this.selectedRows = rows;
+ },
+ batchSendToCoder(){
+ let that = this;
+ that.selectedRows.forEach(row => {
+ that.sendToCoder(row);
+ });
+ },
//本地更新数据
handleSaveSuccess() {
this.$refs.tables.refresh();