fix: 抽取wprList
This commit is contained in:
parent
8aa32be6dd
commit
70af588001
|
|
@ -129,7 +129,7 @@
|
||||||
width="120"
|
width="120"
|
||||||
>
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-link :underline="false" @click="printMaterial(scope.row,'wm')" type="primary">物料标签</el-link>
|
<el-link :underline="false" @click="printMaterial(scope.row)" type="primary">物料标签</el-link>
|
||||||
<el-link :underline="false" v-if="scope.row.material_&&scope.row.material_.tracking==10&&scope.row.state!==20" @click="tableCheckList(scope.row)" type="primary">检验记录</el-link>
|
<el-link :underline="false" v-if="scope.row.material_&&scope.row.material_.tracking==10&&scope.row.state!==20" @click="tableCheckList(scope.row)" type="primary">检验记录</el-link>
|
||||||
<el-link
|
<el-link
|
||||||
v-if="scope.row.material_&&scope.row.material_.tracking==10&&scope.row.state!==20"
|
v-if="scope.row.material_&&scope.row.material_.tracking==10&&scope.row.state!==20"
|
||||||
|
|
@ -211,58 +211,6 @@
|
||||||
@success="handleWprSuccess"
|
@success="handleWprSuccess"
|
||||||
@closed="dialog.wprList = false"
|
@closed="dialog.wprList = false"
|
||||||
></wpr-dialog>
|
></wpr-dialog>
|
||||||
<el-drawer v-model="wprVisibleDrawer" :size="'70%'">
|
|
||||||
<template #header>
|
|
||||||
<h4>关联产品</h4>
|
|
||||||
<el-input
|
|
||||||
style="margin-right: 5px;width: 200px;"
|
|
||||||
v-model="wprsearch"
|
|
||||||
placeholder="编号"
|
|
||||||
clearable
|
|
||||||
></el-input>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-search"
|
|
||||||
@click="handleWprQuery"
|
|
||||||
></el-button>
|
|
||||||
</template>
|
|
||||||
<template #default>
|
|
||||||
<el-table ref="wprTable" id="wprTable" :height="wprTableHeight" hidePagination highlight-current-row border :data="wprList">
|
|
||||||
<el-table-column label="产品编号" prop="number" min-width="100px"
|
|
||||||
v-if="mgroupName=='成品内外初检'||mgroupName=='成品内质复检'||mgroupName=='成品性能检测'||mgroupName=='成品尺寸检测'||mgroupName=='成品外观复检一'||mgroupName=='成品外观复检二'"
|
|
||||||
></el-table-column>
|
|
||||||
<el-table-column label="对外编号" prop="number_out" min-width="100px"></el-table-column>
|
|
||||||
<el-table-column label="记录数据" prop="oinfo">
|
|
||||||
<template #default="scope">
|
|
||||||
<div v-for="(item,index) in scope.row.oinfo" :key="item.id">
|
|
||||||
{{ item.name }}:{{ item.val}}
|
|
||||||
<span v-if="index<(scope.row.oinfo.length-1)">,</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="缺陷项" min-width="200px">
|
|
||||||
<template #default="scope">
|
|
||||||
<span v-for="item in scope.row.wprdefect" :key="item.id">
|
|
||||||
<el-tag
|
|
||||||
type="warning"
|
|
||||||
>{{ item.defect_name }}</el-tag>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="操作"
|
|
||||||
fixed="right"
|
|
||||||
align="center"
|
|
||||||
width="200"
|
|
||||||
>
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button v-if="mgroupName=='毛坯检测后打码'" @click="QRCode(scope.row,'wpr')" type="success">二维码</el-button>
|
|
||||||
<el-button @click="printMaterial(scope.row,'wpr')" type="primary">打印标签</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</template>
|
|
||||||
</el-drawer>
|
|
||||||
<el-drawer v-model="limitedWatch" title="工艺路线流程图" size="80%" @closeDialog="limitedWatch = false">
|
<el-drawer v-model="limitedWatch" title="工艺路线流程图" size="80%" @closeDialog="limitedWatch = false">
|
||||||
<scDegra
|
<scDegra
|
||||||
v-if="limitedWatch"
|
v-if="limitedWatch"
|
||||||
|
|
@ -273,13 +221,6 @@
|
||||||
>
|
>
|
||||||
</scDegra>
|
</scDegra>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
<el-dialog title="二维码" v-model="dialog.qrcode" width="500px">
|
|
||||||
<el-container>
|
|
||||||
<el-main style="text-align: center;padding: 50px 0;">
|
|
||||||
<scQrCode :text="scQr_code"></scQrCode>
|
|
||||||
</el-main>
|
|
||||||
</el-container>
|
|
||||||
</el-dialog>
|
|
||||||
</el-container>
|
</el-container>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -344,11 +285,9 @@ export default {
|
||||||
scrap: false,
|
scrap: false,
|
||||||
permission: false,
|
permission: false,
|
||||||
inmRecord:false,
|
inmRecord:false,
|
||||||
qrcode:false
|
|
||||||
},
|
},
|
||||||
nodes:[],
|
nodes:[],
|
||||||
edges:[],
|
edges:[],
|
||||||
wprList:[],
|
|
||||||
tableData: [],
|
tableData: [],
|
||||||
selection: [],
|
selection: [],
|
||||||
stateOptions:[
|
stateOptions:[
|
||||||
|
|
@ -364,9 +303,7 @@ export default {
|
||||||
page:0,
|
page:0,
|
||||||
wm: ""
|
wm: ""
|
||||||
},
|
},
|
||||||
wprTableHeight: 500,
|
|
||||||
wmId:"",
|
wmId:"",
|
||||||
wprsearch:"",
|
|
||||||
route_code:"",
|
route_code:"",
|
||||||
showBatch: "",
|
showBatch: "",
|
||||||
wmMaterial:'',
|
wmMaterial:'',
|
||||||
|
|
@ -375,14 +312,12 @@ export default {
|
||||||
limitedWatch:false,
|
limitedWatch:false,
|
||||||
materialsVisible:false,
|
materialsVisible:false,
|
||||||
visibleDrawer: false,
|
visibleDrawer: false,
|
||||||
wprVisibleDrawer:false,
|
|
||||||
wprApiObj:this.$API.wpm.wpr.list,
|
wprApiObj:this.$API.wpm.wpr.list,
|
||||||
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
||||||
printer_name:localStorage.getItem("printer_name"),
|
printer_name:localStorage.getItem("printer_name"),
|
||||||
mgroup_name:'',
|
mgroup_name:'',
|
||||||
ofrom_name:'',
|
ofrom_name:'',
|
||||||
ofrom_batch :'',
|
ofrom_batch :'',
|
||||||
scQr_code:'',
|
|
||||||
checkItem:{},
|
checkItem:{},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
@ -496,17 +431,7 @@ export default {
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.$refs.table.queryData(this.query);
|
this.$refs.table.queryData(this.query);
|
||||||
},
|
},
|
||||||
handleWprQuery(){
|
|
||||||
let that = this;
|
|
||||||
that.wprList.forEach((item,index)=>{
|
|
||||||
if(item.number.indexOf(that.wprsearch) > -1){
|
|
||||||
let rows = document.querySelectorAll("#wprTable .el-table__row");
|
|
||||||
let row = rows[index];
|
|
||||||
let rowTop = row.offsetTop;
|
|
||||||
this.$refs.wprTable.scrollTo({ top: rowTop });
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
showWpr(row){
|
showWpr(row){
|
||||||
let that = this;
|
let that = this;
|
||||||
that.wmId = row.id;
|
that.wmId = row.id;
|
||||||
|
|
@ -516,20 +441,6 @@ export default {
|
||||||
that.$nextTick(() => {
|
that.$nextTick(() => {
|
||||||
that.$refs.inmWprDialog.open("ins");
|
that.$refs.inmWprDialog.open("ins");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// that.ofrom_name = row.material_ofrom_name;
|
|
||||||
// that.ofrom_batch = row.batch;
|
|
||||||
// that.wprParams.wm = row.id;
|
|
||||||
// that.wprVisibleDrawer = true;
|
|
||||||
// that.$nextTick(() => {
|
|
||||||
// let heights = document.getElementsByClassName("el-drawer__body")[0].clientHeight;
|
|
||||||
// that.wprTableHeight = heights-20;
|
|
||||||
// })
|
|
||||||
// this.$API.wpm.wpr.list.req(that.wprParams).then((res) => {
|
|
||||||
// that.wprList = res;
|
|
||||||
// })
|
|
||||||
},
|
},
|
||||||
//本地更新数据
|
//本地更新数据
|
||||||
handleSaveSuccess(data, mode) {
|
handleSaveSuccess(data, mode) {
|
||||||
|
|
@ -544,18 +455,11 @@ export default {
|
||||||
this.$refs.handoverDialog.open("add",row,20);
|
this.$refs.handoverDialog.open("add",row,20);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
QRCode(row){
|
|
||||||
this.dialog.qrcode = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.scQr_code=row.number;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//打印物料标签
|
//打印物料标签
|
||||||
printMaterial(row,type){
|
printMaterial(row){
|
||||||
let that = this;
|
let that = this;
|
||||||
if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){
|
if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){
|
||||||
if(type=='wm'){
|
let params = {};
|
||||||
let params = {};
|
|
||||||
params.tid = row.id;
|
params.tid = row.id;
|
||||||
let materialname = row.material_.name + '|' + row.material_.process_name;
|
let materialname = row.material_.name + '|' + row.material_.process_name;
|
||||||
let specification = row.material_.specification;
|
let specification = row.material_.specification;
|
||||||
|
|
@ -612,50 +516,6 @@ export default {
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if(type=='wpr'){
|
|
||||||
let params = {};
|
|
||||||
let name = row.material_name.split('|')[0];
|
|
||||||
if(that.route_code=='paiban'||that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'||
|
|
||||||
that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'||that.route_code=='banduangunyuanhoudama'||that.route_code=='banduangunyuantuihuo'
|
|
||||||
){
|
|
||||||
let oinfo = [];
|
|
||||||
for(let key in row.oinfo){
|
|
||||||
oinfo.push(row.oinfo[key])
|
|
||||||
}
|
|
||||||
let data = {sigao:'',duibian:'',moban:'',istest:'否',number:row.number,name:name,ofrom_name:that.ofrom_name,ofrom_batch:that.ofrom_batch};
|
|
||||||
if(that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'||that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'){
|
|
||||||
params.label_template_name = '脱膜测量单件标签模板';
|
|
||||||
}else{
|
|
||||||
params.label_template_name = '排扳单件打印模板';
|
|
||||||
}
|
|
||||||
if(oinfo.length>0){
|
|
||||||
oinfo.forEach((item)=>{
|
|
||||||
if(item.name=="丝高"){
|
|
||||||
data.sigao = item.val;
|
|
||||||
}else if(item.name=="对边"){
|
|
||||||
data.duibian = item.val;
|
|
||||||
}else if(item.name=="模具号"){
|
|
||||||
data.moban = item.val;
|
|
||||||
}else if(item.name=="实验板段"){
|
|
||||||
data.istest = item.val?'是':'否';
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
params.data = data;
|
|
||||||
}else{
|
|
||||||
params.label_template_name = '单件打印模板';
|
|
||||||
params.data = {number:row.number,name:name};
|
|
||||||
}
|
|
||||||
that.$API.cm.labeltemplate.commands.req(params).then((res) => {
|
|
||||||
let obj = {};
|
|
||||||
obj.printer_commands = res.commands;
|
|
||||||
obj.printer_name = that.printer_name;
|
|
||||||
that.$API.wpm.prints.req(obj).then((response) => {
|
|
||||||
that.$message.success("打印成功");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
that.$message.warning("请先设置打印机");
|
that.$message.warning("请先设置打印机");
|
||||||
}
|
}
|
||||||
|
|
@ -669,9 +529,7 @@ export default {
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleWprSuccess(row){
|
handleWprSuccess(row){}
|
||||||
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -225,76 +225,6 @@
|
||||||
@closed="dialog.handover = false"
|
@closed="dialog.handover = false"
|
||||||
>
|
>
|
||||||
</handover-dialog>
|
</handover-dialog>
|
||||||
|
|
||||||
<el-drawer v-model="wprVisibleDrawer" :size="'70%'">
|
|
||||||
<template #header>
|
|
||||||
<h4>关联产品</h4>
|
|
||||||
<el-button type="primary" @click="wprNumberChange">发货编号</el-button>
|
|
||||||
<el-button type="warning" @click="wprNumberClear">清空编号</el-button>
|
|
||||||
</template>
|
|
||||||
<template #default>
|
|
||||||
<scTable ref="wprTable" hidePagination hideDo :data="wprList">
|
|
||||||
<el-table-column label="产品编号" prop="number" min-width="100px"></el-table-column>
|
|
||||||
<el-table-column label="记录数据" prop="oinfo">
|
|
||||||
<template #default="scope">
|
|
||||||
<div v-for="(item,index) in scope.row.oinfo" :key="item.id">
|
|
||||||
{{ item.name }}:{{ item.val}}
|
|
||||||
<span v-if="index<(scope.row.oinfo.length-1)">,</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="缺陷项" min-width="200px">
|
|
||||||
<template #default="scope">
|
|
||||||
<span v-for="item in scope.row.wprdefect" :key="item.id">
|
|
||||||
<el-tag
|
|
||||||
type="warning"
|
|
||||||
>{{ item.defect_name }}</el-tag>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="对外编号"
|
|
||||||
v-if="mgroupName=='成品内外初检'||mgroupName=='成品内质复检'||mgroupName=='成品性能检测'||mgroupName=='成品尺寸检测'||mgroupName=='成品外观复检一'||mgroupName=='成品外观复检二'"
|
|
||||||
prop="number_out" min-width="100px"></el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="操作"
|
|
||||||
fixed="right"
|
|
||||||
align="center"
|
|
||||||
width="120"
|
|
||||||
>
|
|
||||||
<template #default="scope">
|
|
||||||
<el-link :underline="false" @click="printMaterial(scope.row,'wpr')" type="primary">打印标签</el-link>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</scTable>
|
|
||||||
</template>
|
|
||||||
<template #footer>
|
|
||||||
<div style="flex: auto">
|
|
||||||
<el-button @click="wprVisibleDrawer=false">关闭</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-drawer>
|
|
||||||
<el-dialog title="设置发货编号" v-model="showBatch">
|
|
||||||
<el-form :model="wprParams" label-width="80px">
|
|
||||||
<el-form-item label="编号前缀">
|
|
||||||
<el-input v-model="prefix"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<el-button @click="getWprNum">确定</el-button>
|
|
||||||
<el-button @click="showBatch=false">取消</el-button>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
<el-dialog title="设置发货流水位数" v-model="showDigit">
|
|
||||||
<h4>没有找到该前缀的发货编号,请完善发货流水号位数(填整数)</h4>
|
|
||||||
<el-form :model="wprParams" label-width="80px">
|
|
||||||
<el-form-item label="流水位数">
|
|
||||||
<el-input-number controls-position="right" precision="0" v-model="digitNum"></el-input-number>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<el-button @click="digitSure">确定</el-button>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
<el-drawer v-model="limitedWatch" title="工艺路线流程图" size="80%" @closeDialog="limitedWatch = false">
|
<el-drawer v-model="limitedWatch" title="工艺路线流程图" size="80%" @closeDialog="limitedWatch = false">
|
||||||
<scDegra
|
<scDegra
|
||||||
v-if="limitedWatch"
|
v-if="limitedWatch"
|
||||||
|
|
@ -374,7 +304,6 @@ export default {
|
||||||
},
|
},
|
||||||
nodes:[],
|
nodes:[],
|
||||||
edges:[],
|
edges:[],
|
||||||
wprList:[],
|
|
||||||
tableData: [],
|
tableData: [],
|
||||||
selection: [],
|
selection: [],
|
||||||
defectOptions: [],
|
defectOptions: [],
|
||||||
|
|
@ -391,19 +320,15 @@ export default {
|
||||||
page:0,
|
page:0,
|
||||||
wm: ""
|
wm: ""
|
||||||
},
|
},
|
||||||
prefix:'',
|
|
||||||
number_out_last:'',
|
number_out_last:'',
|
||||||
route_code:"",
|
route_code:"",
|
||||||
wmMaterial:'',
|
wmMaterial:'',
|
||||||
cate_type:'',
|
cate_type:'',
|
||||||
digitNum:null,
|
|
||||||
materialType: "wm",
|
materialType: "wm",
|
||||||
showDigit: false,
|
|
||||||
showBatch: false,
|
showBatch: false,
|
||||||
limitedWatch:false,
|
limitedWatch:false,
|
||||||
materialsVisible:false,
|
materialsVisible:false,
|
||||||
visibleDrawer: false,
|
visibleDrawer: false,
|
||||||
wprVisibleDrawer:false,
|
|
||||||
wprApiObj:this.$API.wpm.wpr.list,
|
wprApiObj:this.$API.wpm.wpr.list,
|
||||||
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
||||||
printer_name:localStorage.getItem("printer_name"),
|
printer_name:localStorage.getItem("printer_name"),
|
||||||
|
|
@ -546,18 +471,8 @@ export default {
|
||||||
that.$nextTick(() => {
|
that.$nextTick(() => {
|
||||||
that.$refs.inmWprDialog.open("out");
|
that.$refs.inmWprDialog.open("out");
|
||||||
});
|
});
|
||||||
// that.ofrom_name = row.material_ofrom_name;
|
|
||||||
// that.ofrom_batch = row.batch;
|
|
||||||
// that.wprParams.wm = row.id;
|
|
||||||
// that.wprVisibleDrawer = true;
|
|
||||||
// that.getRowWpr();
|
|
||||||
},
|
|
||||||
getRowWpr(){
|
|
||||||
let that = this;
|
|
||||||
that.$API.wpm.wpr.list.req(that.wprParams).then((res) => {
|
|
||||||
that.wprList = res;
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//分批mtype:20
|
//分批mtype:20
|
||||||
rowClick(row){
|
rowClick(row){
|
||||||
this.dialog.handover = true;
|
this.dialog.handover = true;
|
||||||
|
|
@ -566,87 +481,7 @@ export default {
|
||||||
this.$refs.handoverDialog.open("add",row,20);
|
this.$refs.handoverDialog.open("add",row,20);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
wprNumberChange(){
|
|
||||||
let that = this;
|
|
||||||
that.showBatch = true;
|
|
||||||
},
|
|
||||||
wprNumberClear(){
|
|
||||||
let that = this;
|
|
||||||
let items = [];
|
|
||||||
for(let i=0;i< that.wprList.length;i++){
|
|
||||||
let obj = {};
|
|
||||||
obj.id = that.wprList[i].id;
|
|
||||||
obj.number_out = null;
|
|
||||||
items.push(obj)
|
|
||||||
}
|
|
||||||
let params = {};
|
|
||||||
params.items = items;
|
|
||||||
that.$API.wpm.wpr.assginNumberOut.req(params).then((res) => {
|
|
||||||
that.getRowWpr();
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getWprNum(){
|
|
||||||
let that = this;
|
|
||||||
let params0 = {};
|
|
||||||
params0.prefix = that.prefix;
|
|
||||||
that.$API.wpm.wpr.numberOutLast.req(params0).then((res) => {
|
|
||||||
let number_out_last = '';
|
|
||||||
if(res.number_out_last==null){//没有该前缀的发货编号
|
|
||||||
number_out_last = null;
|
|
||||||
that.showBatch=false;
|
|
||||||
that.showDigit = true;
|
|
||||||
}else{//有该前缀的发货编号
|
|
||||||
let items = [];
|
|
||||||
number_out_last = res.number_out_last;
|
|
||||||
let str = number_out_last.replace(/[^a-zA-Z]/g, ''); // 提取字母
|
|
||||||
let num = number_out_last.replace(/[^0-9]/g, ''); // 提取数字
|
|
||||||
let length = num.length;//流水号的长度
|
|
||||||
for(let i=0;i< that.wprList.length;i++){
|
|
||||||
let numb = Number(num)+i+1;
|
|
||||||
let numbs = numb+'';
|
|
||||||
let len = numbs.length;
|
|
||||||
let zoreStr = '';
|
|
||||||
for(let j=0;j<length-len;j++){
|
|
||||||
zoreStr+='0';
|
|
||||||
}
|
|
||||||
let obj = {};
|
|
||||||
obj.id = that.wprList[i].id;
|
|
||||||
obj.number_out = str + zoreStr + numb;
|
|
||||||
items.push(obj)
|
|
||||||
}
|
|
||||||
let params = {};
|
|
||||||
params.items = items;
|
|
||||||
that.$API.wpm.wpr.assginNumberOut.req(params).then((res) => {
|
|
||||||
that.showBatch=false;
|
|
||||||
that.getRowWpr();
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//没有找到前缀的发货编号,从1开始编号时
|
|
||||||
digitSure(){
|
|
||||||
let that = this;
|
|
||||||
//根据前缀和流水位数获取编号
|
|
||||||
let items = [];
|
|
||||||
for(let i=0;i< that.wprList.length;i++){
|
|
||||||
let numb = i+1,zoreStr = '';
|
|
||||||
numb+= '';
|
|
||||||
let len = numb.length;
|
|
||||||
for(let j=0;j<that.digitNum-len;j++){
|
|
||||||
zoreStr+='0';
|
|
||||||
}
|
|
||||||
let obj = {};
|
|
||||||
obj.id = that.wprList[i].id;
|
|
||||||
obj.number_out = that.prefix + zoreStr + numb;
|
|
||||||
items.push(obj)
|
|
||||||
}
|
|
||||||
let params = {};
|
|
||||||
params.items = items;
|
|
||||||
that.$API.wpm.wpr.assginNumberOut.req(params).then((res) => {
|
|
||||||
that.showDigit = false;
|
|
||||||
that.getRowWpr();
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//本地更新数据
|
//本地更新数据
|
||||||
handleSaveSuccess(data, mode) {
|
handleSaveSuccess(data, mode) {
|
||||||
this.dialog.save = false;
|
this.dialog.save = false;
|
||||||
|
|
@ -656,8 +491,7 @@ export default {
|
||||||
printMaterial(row,type){
|
printMaterial(row,type){
|
||||||
let that = this;
|
let that = this;
|
||||||
if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){
|
if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){
|
||||||
if(type=='wm'){
|
let params = {};
|
||||||
let params = {};
|
|
||||||
params.tid = row.id;
|
params.tid = row.id;
|
||||||
let materialname = row.material_.name + '|' + row.material_.process_name;
|
let materialname = row.material_.name + '|' + row.material_.process_name;
|
||||||
let specification = row.material_.specification;
|
let specification = row.material_.specification;
|
||||||
|
|
@ -728,69 +562,6 @@ export default {
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}else if(type=='wpr'){
|
|
||||||
let params = {};
|
|
||||||
let name = row.material_name.split('|')[0];
|
|
||||||
if(that.route_code=='paiyicibang'){
|
|
||||||
that.$API.mtm.route.list.req({material_out:row.material,page:0}).then((res) => {
|
|
||||||
console.log('排一次棒单件打印res',res);
|
|
||||||
let data = res[0].params_json;
|
|
||||||
data.number = row.number;
|
|
||||||
data.name=name;
|
|
||||||
data.ofrom_name=that.ofrom_name;
|
|
||||||
params.data = data;
|
|
||||||
params.label_template_name = '排一次棒单件打印模板';
|
|
||||||
that.$API.cm.labeltemplate.commands.req(params).then((res) => {
|
|
||||||
let obj = {};
|
|
||||||
obj.printer_commands = res.commands;
|
|
||||||
obj.printer_name = that.printer_name;
|
|
||||||
that.$API.wpm.prints.req(obj).then((response) => {
|
|
||||||
that.$message.success("打印成功");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
if(that.route_code=='paiban'||that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'||
|
|
||||||
that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'||that.route_code=='banduangunyuanhoudama'||that.route_code=='banduangunyuantuihuo'
|
|
||||||
){
|
|
||||||
let oinfo = [];
|
|
||||||
for(let key in row.oinfo){
|
|
||||||
oinfo.push(row.oinfo[key])
|
|
||||||
}
|
|
||||||
let data = {sigao:'',duibian:'',moban:'',istest:'否',number:row.number,name:name,ofrom_name:that.ofrom_name,ofrom_batch:that.ofrom_batch};
|
|
||||||
if(that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'||that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'){
|
|
||||||
params.label_template_name = '脱膜测量单件标签模板';
|
|
||||||
}else{
|
|
||||||
params.label_template_name = '排扳单件打印模板';
|
|
||||||
}
|
|
||||||
if(oinfo.length>0){
|
|
||||||
oinfo.forEach((item)=>{
|
|
||||||
if(item.name=="丝高"){
|
|
||||||
data.sigao = item.val;
|
|
||||||
}else if(item.name=="对边"){
|
|
||||||
data.duibian = item.val;
|
|
||||||
}else if(item.name=="模具号"){
|
|
||||||
data.moban = item.val;
|
|
||||||
}else if(item.name=="实验板段"){
|
|
||||||
data.istest = item.val?'是':'否';
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
params.data = data;
|
|
||||||
}else{
|
|
||||||
params.label_template_name = '单件打印模板';
|
|
||||||
params.data = {number:row.number,name:name};
|
|
||||||
}
|
|
||||||
that.$API.cm.labeltemplate.commands.req(params).then((res) => {
|
|
||||||
let obj = {};
|
|
||||||
obj.printer_commands = res.commands;
|
|
||||||
obj.printer_name = that.printer_name;
|
|
||||||
that.$API.wpm.prints.req(obj).then((response) => {
|
|
||||||
that.$message.success("打印成功");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
that.$message.warning("请先设置打印机");
|
that.$message.warning("请先设置打印机");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,12 @@ export default {
|
||||||
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {},
|
mounted() {
|
||||||
|
let that = this;
|
||||||
|
let paths = that.$route.path;
|
||||||
|
let arr = paths.split("/");
|
||||||
|
that.route_code = arr[2];
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open(mode) {
|
open(mode) {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|
@ -251,45 +256,65 @@ export default {
|
||||||
if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){
|
if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){
|
||||||
let params = {};
|
let params = {};
|
||||||
let name = row.material_name.split('|')[0];
|
let name = row.material_name.split('|')[0];
|
||||||
if(that.route_code=='paiban'||that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'||
|
if(that.route_code=='paiyicibang'){
|
||||||
that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'||that.route_code=='banduangunyuanhoudama'||that.route_code=='banduangunyuantuihuo'
|
that.$API.mtm.route.list.req({material_out:row.material,page:0}).then((res) => {
|
||||||
){
|
console.log('排一次棒单件打印res',res);
|
||||||
let oinfo = [];
|
let data = res[0].params_json;
|
||||||
for(let key in row.oinfo){
|
data.number = row.number;
|
||||||
oinfo.push(row.oinfo[key])
|
data.name=name;
|
||||||
}
|
data.ofrom_name=that.ofrom_name;
|
||||||
let data = {sigao:'',duibian:'',moban:'',istest:'否',number:row.number,name:name,ofrom_name:that.ofrom_name,ofrom_batch:that.ofrom_batch};
|
params.data = data;
|
||||||
if(that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'||that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'){
|
params.label_template_name = '排一次棒单件打印模板';
|
||||||
params.label_template_name = '脱膜测量单件标签模板';
|
that.$API.cm.labeltemplate.commands.req(params).then((res) => {
|
||||||
}else{
|
let obj = {};
|
||||||
params.label_template_name = '排扳单件打印模板';
|
obj.printer_commands = res.commands;
|
||||||
}
|
obj.printer_name = that.printer_name;
|
||||||
if(oinfo.length>0){
|
that.$API.wpm.prints.req(obj).then((response) => {
|
||||||
oinfo.forEach((item)=>{
|
that.$message.success("打印成功");
|
||||||
if(item.name=="丝高"){
|
});
|
||||||
data.sigao = item.val;
|
});
|
||||||
}else if(item.name=="对边"){
|
})
|
||||||
data.duibian = item.val;
|
|
||||||
}else if(item.name=="模具号"){
|
|
||||||
data.moban = item.val;
|
|
||||||
}else if(item.name=="实验板段"){
|
|
||||||
data.istest = item.val?'是':'否';
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
params.data = data;
|
|
||||||
}else{
|
}else{
|
||||||
params.label_template_name = '单件打印模板';
|
if(that.route_code=='paiban'||that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'||
|
||||||
params.data = {number:row.number,name:name};
|
that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'||that.route_code=='banduangunyuanhoudama'||that.route_code=='banduangunyuantuihuo'
|
||||||
}
|
){
|
||||||
that.$API.cm.labeltemplate.commands.req(params).then((res) => {
|
let oinfo = [];
|
||||||
let obj = {};
|
for(let key in row.oinfo){
|
||||||
obj.printer_commands = res.commands;
|
oinfo.push(row.oinfo[key])
|
||||||
obj.printer_name = that.printer_name;
|
}
|
||||||
that.$API.wpm.prints.req(obj).then((response) => {
|
let data = {sigao:'',duibian:'',moban:'',istest:'否',number:row.number,name:name,ofrom_name:that.ofrom_name,ofrom_batch:that.ofrom_batch};
|
||||||
that.$message.success("打印成功");
|
if(that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'||that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'){
|
||||||
|
params.label_template_name = '脱膜测量单件标签模板';
|
||||||
|
}else{
|
||||||
|
params.label_template_name = '排扳单件打印模板';
|
||||||
|
}
|
||||||
|
if(oinfo.length>0){
|
||||||
|
oinfo.forEach((item)=>{
|
||||||
|
if(item.name=="丝高"){
|
||||||
|
data.sigao = item.val;
|
||||||
|
}else if(item.name=="对边"){
|
||||||
|
data.duibian = item.val;
|
||||||
|
}else if(item.name=="模具号"){
|
||||||
|
data.moban = item.val;
|
||||||
|
}else if(item.name=="实验板段"){
|
||||||
|
data.istest = item.val?'是':'否';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
params.data = data;
|
||||||
|
}else{
|
||||||
|
params.label_template_name = '单件打印模板';
|
||||||
|
params.data = {number:row.number,name:name};
|
||||||
|
}
|
||||||
|
that.$API.cm.labeltemplate.commands.req(params).then((res) => {
|
||||||
|
let obj = {};
|
||||||
|
obj.printer_commands = res.commands;
|
||||||
|
obj.printer_name = that.printer_name;
|
||||||
|
that.$API.wpm.prints.req(obj).then((response) => {
|
||||||
|
that.$message.success("打印成功");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
}else{
|
}else{
|
||||||
that.$message.warning("请先设置打印机");
|
that.$message.warning("请先设置打印机");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue