feat:玻纤板未完成段列表搜索前置并选中,添加批量喷码
This commit is contained in:
parent
fcb7474f17
commit
ac45b9726a
|
|
@ -9,11 +9,17 @@
|
||||||
<h4>关联产品</h4>
|
<h4>关联产品</h4>
|
||||||
<el-button v-if="mode=='out'" type="primary" @click="wprNumberChange">发货编号</el-button>
|
<el-button v-if="mode=='out'" type="primary" @click="wprNumberChange">发货编号</el-button>
|
||||||
<el-button v-if="mode=='out'" type="warning" @click="wprNumberClear">清空编号</el-button>
|
<el-button v-if="mode=='out'" type="warning" @click="wprNumberClear">清空编号</el-button>
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
:disabled="selectedRows.length === 0"
|
||||||
|
@click="batchSendToCoder"
|
||||||
|
>批量喷码</el-button>
|
||||||
<el-input
|
<el-input
|
||||||
style="margin-right: 5px;width: 200px;"
|
style="margin-right: 5px;width: 200px;"
|
||||||
v-model="search"
|
v-model="search"
|
||||||
placeholder="编号"
|
placeholder="编号"
|
||||||
clearable
|
clearable
|
||||||
|
@keyup.enter="handleWprQuery"
|
||||||
></el-input>
|
></el-input>
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
|
|
@ -22,7 +28,9 @@
|
||||||
></el-button>
|
></el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #default>
|
<template #default>
|
||||||
<el-table ref="wprTable" id="wprTable" :data="wprList" :height="wprTableHeight" border highlight-current-row>
|
<el-table ref="wprTable" id="wprTable" :data="wprList" :height="wprTableHeight" border highlight-current-row @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="50"></el-table-column>
|
||||||
|
<el-table-column label="序号" type="index" width="50"></el-table-column>
|
||||||
<el-table-column label="产品编号" prop="number" min-width="100px" ></el-table-column>
|
<el-table-column label="产品编号" prop="number" min-width="100px" ></el-table-column>
|
||||||
<el-table-column label="对外编号" prop="number_out" min-width="100px"
|
<el-table-column label="对外编号" prop="number_out" min-width="100px"
|
||||||
v-if="mgroupName=='成品内外初检'||mgroupName=='成品内质复检'||mgroupName=='成品性能检测'||mgroupName=='成品尺寸检测'||mgroupName=='成品外观复检一'||mgroupName=='成品外观复检二'"
|
v-if="mgroupName=='成品内外初检'||mgroupName=='成品内质复检'||mgroupName=='成品性能检测'||mgroupName=='成品尺寸检测'||mgroupName=='成品外观复检一'||mgroupName=='成品外观复检二'"
|
||||||
|
|
@ -120,6 +128,7 @@ export default {
|
||||||
wmtype:'',
|
wmtype:'',
|
||||||
scQr_code:'',
|
scQr_code:'',
|
||||||
wprList:[],
|
wprList:[],
|
||||||
|
selectedRows:[],
|
||||||
digitNum:3,
|
digitNum:3,
|
||||||
wprTableHeight:500,
|
wprTableHeight:500,
|
||||||
printer_name:localStorage.getItem("printer_name"),
|
printer_name:localStorage.getItem("printer_name"),
|
||||||
|
|
@ -242,15 +251,16 @@ export default {
|
||||||
},
|
},
|
||||||
handleWprQuery(){
|
handleWprQuery(){
|
||||||
let that = this;
|
let that = this;
|
||||||
that.wprList.forEach((item,index)=>{
|
let foundIndex = that.wprList.findIndex(item => item.number.indexOf(that.search) > -1);
|
||||||
if(item.number.indexOf(that.search) > -1){
|
if(foundIndex > -1){
|
||||||
that.$refs.wprTable.setCurrentRow(item);
|
let found = that.wprList.splice(foundIndex, 1)[0];
|
||||||
let rows = document.querySelectorAll("#wprTable .el-table__row");
|
that.wprList.unshift(found);
|
||||||
let row = rows[index];
|
that.$nextTick(() => {
|
||||||
let rowTop = row.offsetTop;
|
that.$refs.wprTable.setCurrentRow(that.wprList[0]);
|
||||||
that.$refs.wprTable.scrollTo({ top: rowTop });
|
that.$refs.wprTable.toggleRowSelection(that.wprList[0], true);
|
||||||
}
|
that.$refs.wprTable.scrollTo({ top: 0 });
|
||||||
})
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
//打签
|
//打签
|
||||||
printMaterial(row){
|
printMaterial(row){
|
||||||
|
|
@ -350,7 +360,7 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => {
|
||||||
delete map[row.id];
|
delete map[row.id];
|
||||||
that.coderLoadingIds = map;
|
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 list = Array.isArray(res) ? res : (res && res.results) || [];
|
||||||
let template = list.find(t => t.name === templateName);
|
let template = list.find(t => t.name === templateName);
|
||||||
if (!template) {
|
if (!template) {
|
||||||
|
|
@ -368,6 +378,15 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => {
|
||||||
}).finally(release);
|
}).finally(release);
|
||||||
}).catch(release);
|
}).catch(release);
|
||||||
},
|
},
|
||||||
|
handleSelectionChange(rows){
|
||||||
|
this.selectedRows = rows;
|
||||||
|
},
|
||||||
|
batchSendToCoder(){
|
||||||
|
let that = this;
|
||||||
|
that.selectedRows.forEach(row => {
|
||||||
|
that.sendToCoder(row);
|
||||||
|
});
|
||||||
|
},
|
||||||
//本地更新数据
|
//本地更新数据
|
||||||
handleSaveSuccess() {
|
handleSaveSuccess() {
|
||||||
this.$refs.tables.refresh();
|
this.$refs.tables.refresh();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue