Compare commits
2 Commits
8cd7bdb879
...
a2a0b75c09
| Author | SHA1 | Date |
|---|---|---|
|
|
a2a0b75c09 | |
|
|
bff9408474 |
|
|
@ -1,547 +0,0 @@
|
||||||
<template>
|
|
||||||
<el-container>
|
|
||||||
<el-header>
|
|
||||||
<div class="left-panel">
|
|
||||||
<el-button type="primary" @click="tomio('do_out')" v-auth="'mio.do'" v-if="route_code=='qingxi'">领料</el-button>
|
|
||||||
<el-button type="primary" v-auth="'handover.create'" @click="table_add(40)">报废</el-button>
|
|
||||||
<el-button type="primary" v-auth="'handover.create'" @click="batchConcat()">合批</el-button>
|
|
||||||
<el-button type="primary" @click="tomio('do_in')" v-auth="'mio.do'"
|
|
||||||
v-if="route_code=='chengpingneiwaichujian'||route_code=='chengpneizhifujian'||route_code=='chengpingxinengjiance'||
|
|
||||||
route_code=='chenpjianchicunjiance'||route_code=='chengpwaiguanfujianyi'||route_code=='chengpwaiguanfujianer'"
|
|
||||||
>入库</el-button>
|
|
||||||
</div>
|
|
||||||
<div class="right-panel">
|
|
||||||
<el-select
|
|
||||||
v-model="query.state"
|
|
||||||
placeholder="物料状态"
|
|
||||||
clearable
|
|
||||||
@change="searchStateChange"
|
|
||||||
style="width: 250px"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in stateOptions"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
<el-input
|
|
||||||
style="margin-right: 5px"
|
|
||||||
v-model="query.search"
|
|
||||||
placeholder="名称"
|
|
||||||
clearable
|
|
||||||
></el-input>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-search"
|
|
||||||
@click="handleQuery"
|
|
||||||
></el-button>
|
|
||||||
</div>
|
|
||||||
</el-header>
|
|
||||||
<el-main class="nopadding">
|
|
||||||
<scTable
|
|
||||||
ref="table"
|
|
||||||
:apiObj="apiObj"
|
|
||||||
row-key="id"
|
|
||||||
:params="params"
|
|
||||||
:query="query"
|
|
||||||
@selection-change="selectionChange"
|
|
||||||
>
|
|
||||||
<el-table-column type="selection" width="50"></el-table-column>
|
|
||||||
<el-table-column label="状态" prop="state" width="100" >
|
|
||||||
<template #default="scope">
|
|
||||||
<el-tag :type="wmState[scope.row.state]?.type">
|
|
||||||
{{wmState[scope.row.state]?.text}}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="物料名称"
|
|
||||||
prop="material_name"
|
|
||||||
min-width="150"
|
|
||||||
>
|
|
||||||
<template #default="scope">
|
|
||||||
{{ scope.row.material_name }}
|
|
||||||
<span v-if="scope.row.material_origin != null">
|
|
||||||
({{ scope.row.material_origin_name }})
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="物料已到工序"
|
|
||||||
prop="material_name"
|
|
||||||
min-width="100"
|
|
||||||
>
|
|
||||||
<template #default="scope">
|
|
||||||
{{ scope.row.material_name.split('|').at(-1) }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="原始物料"
|
|
||||||
prop="material_ofrom_name"
|
|
||||||
min-width="120"
|
|
||||||
></el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="批次号"
|
|
||||||
prop="batch"
|
|
||||||
min-width="120"
|
|
||||||
></el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="部门/工段"
|
|
||||||
prop="belong_dept_name"
|
|
||||||
>
|
|
||||||
<template #default="scope">
|
|
||||||
{{scope.row.belong_dept_name}}/{{scope.row.mgroup_name}}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="数量"
|
|
||||||
prop="count"
|
|
||||||
min-width="80"
|
|
||||||
>
|
|
||||||
<template #default="scope">
|
|
||||||
<span v-if="scope.row.material_&&scope.row.material_.tracking==10">{{scope.row.count}}</span>
|
|
||||||
<el-link v-else :underline="false" type="primary" @click="showWpr(scope.row)">{{scope.row.count}}</el-link>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="备注"
|
|
||||||
prop="note"
|
|
||||||
></el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="生产中"
|
|
||||||
prop="count_working"
|
|
||||||
min-width="80"
|
|
||||||
></el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="不合格标记"
|
|
||||||
prop="defect_name"
|
|
||||||
></el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="创建时间"
|
|
||||||
prop="create_time"
|
|
||||||
width="150"
|
|
||||||
></el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="操作"
|
|
||||||
fixed="right"
|
|
||||||
align="center"
|
|
||||||
width="120"
|
|
||||||
>
|
|
||||||
<template #default="scope">
|
|
||||||
<el-link :underline="false" @click="printMaterial(scope.row,'wm')" 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
|
|
||||||
v-if="scope.row.material_&&scope.row.material_.tracking==10&&scope.row.state!==20"
|
|
||||||
:underline="false"
|
|
||||||
@click="inmCheck(scope.row)"
|
|
||||||
type="primary"
|
|
||||||
style="margin-left: 10px;"
|
|
||||||
>检验</el-link>
|
|
||||||
<el-link :underline="false" type="primary"
|
|
||||||
@click="handleWatch(scope.row)"
|
|
||||||
>流程图</el-link>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</scTable>
|
|
||||||
</el-main>
|
|
||||||
<el-dialog title="选择物料" v-model="materialsVisible" width="90%">
|
|
||||||
<materials
|
|
||||||
style="height: 500px"
|
|
||||||
:materialType="materialType"
|
|
||||||
ref="materialsChose"
|
|
||||||
@choseChange="choseChange"
|
|
||||||
></materials>
|
|
||||||
</el-dialog>
|
|
||||||
<check-dialog
|
|
||||||
v-if="dialog.check"
|
|
||||||
ref="checkDialog"
|
|
||||||
:itemObj = "checkItem"
|
|
||||||
@success="handleSaveSuccess"
|
|
||||||
@closed="dialog.check = false"
|
|
||||||
>
|
|
||||||
</check-dialog>
|
|
||||||
<scrap-dialog
|
|
||||||
v-if="dialog.scrap"
|
|
||||||
ref="scrapDialog"
|
|
||||||
:type="type"
|
|
||||||
:mgroupName="mgroup_name"
|
|
||||||
:mgroupId="mgroupId"
|
|
||||||
@success="handleScrapSuccess"
|
|
||||||
@closed="dialog.scrap = false"
|
|
||||||
>
|
|
||||||
</scrap-dialog>
|
|
||||||
<showDrawer
|
|
||||||
ref="showDrawer"
|
|
||||||
v-if="visibleDrawer"
|
|
||||||
:wm="wm"
|
|
||||||
:material="wmMaterial"
|
|
||||||
@closed="visibleDrawer = false"
|
|
||||||
>
|
|
||||||
</showDrawer>
|
|
||||||
<save-dialog
|
|
||||||
v-if="dialog.inmRecord"
|
|
||||||
ref="inmRecordDialog"
|
|
||||||
:cate = "cate_type"
|
|
||||||
:process = "process"
|
|
||||||
:mgroupId = "params.mgroupx"
|
|
||||||
:deptId = " params.belong_dept"
|
|
||||||
@success="handleinmSuccess"
|
|
||||||
>
|
|
||||||
</save-dialog>
|
|
||||||
<el-drawer v-model="wprVisibleDrawer" :size="'70%'">
|
|
||||||
<template #header>
|
|
||||||
<h4>关联产品</h4>
|
|
||||||
</template>
|
|
||||||
<template #default>
|
|
||||||
<scTable ref="wprTable" hidePagination :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="操作"
|
|
||||||
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-drawer v-model="limitedWatch" title="工艺路线流程图" size="80%" @closeDialog="limitedWatch = false">
|
|
||||||
<scDegra
|
|
||||||
v-if="limitedWatch"
|
|
||||||
ref="degraDialogs"
|
|
||||||
:nodes="nodes"
|
|
||||||
:edges="edges"
|
|
||||||
:rankdir="'LR'"
|
|
||||||
>
|
|
||||||
</scDegra>
|
|
||||||
</el-drawer>
|
|
||||||
</el-container>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import { wmState } from "@/utils/enum.js";
|
|
||||||
import materials from "./../mtm/materials.vue";
|
|
||||||
import checkDialog from "./check_form.vue";
|
|
||||||
import showDrawer from "./check_drawer.vue";
|
|
||||||
import scrapDialog from "./handover_form.vue";
|
|
||||||
import saveDialog from "./inm_record.vue";
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
deptId: {
|
|
||||||
type: String,
|
|
||||||
default: "",
|
|
||||||
},
|
|
||||||
mgroupId: {
|
|
||||||
type: String,
|
|
||||||
default: "",
|
|
||||||
},
|
|
||||||
mgroupName: {
|
|
||||||
type: String,
|
|
||||||
default: "",
|
|
||||||
},
|
|
||||||
mgroup_code: {
|
|
||||||
type: String,
|
|
||||||
default: "",
|
|
||||||
},
|
|
||||||
process: {
|
|
||||||
type: String,
|
|
||||||
default: "",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
saveDialog,
|
|
||||||
materials,
|
|
||||||
checkDialog,
|
|
||||||
showDrawer,
|
|
||||||
scrapDialog
|
|
||||||
},
|
|
||||||
name: "wmaterial",
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
wmState,
|
|
||||||
apiObj: null,
|
|
||||||
params: {
|
|
||||||
mgroupx: "",
|
|
||||||
belong_dept:''
|
|
||||||
},
|
|
||||||
wmtype:0,
|
|
||||||
query: {
|
|
||||||
search: "",
|
|
||||||
state: null,
|
|
||||||
},
|
|
||||||
dialog: {
|
|
||||||
save: false,
|
|
||||||
check: false,
|
|
||||||
scrap: false,
|
|
||||||
permission: false,
|
|
||||||
inmRecord:false,
|
|
||||||
},
|
|
||||||
nodes:[],
|
|
||||||
edges:[],
|
|
||||||
wprList:[],
|
|
||||||
tableData: [],
|
|
||||||
selection: [],
|
|
||||||
stateOptions:[
|
|
||||||
{ value: 10, name: "合格"},
|
|
||||||
{ value: 20, name: "不合格"},
|
|
||||||
{ value: 30, name: "返工"},
|
|
||||||
// { value: 40, name: "检验"},
|
|
||||||
// { value: 50, name: "报废"},
|
|
||||||
],
|
|
||||||
queryWm: {
|
|
||||||
search: "",
|
|
||||||
material: "",
|
|
||||||
},
|
|
||||||
wprParams:{
|
|
||||||
page:0,
|
|
||||||
wm: ""
|
|
||||||
},
|
|
||||||
route_code:"",
|
|
||||||
showBatch: "",
|
|
||||||
wmMaterial:'',
|
|
||||||
cate_type:'',
|
|
||||||
materialType: "wm",
|
|
||||||
limitedWatch:false,
|
|
||||||
materialsVisible:false,
|
|
||||||
visibleDrawer: false,
|
|
||||||
wprVisibleDrawer:false,
|
|
||||||
wprApiObj:this.$API.wpm.wpr.list,
|
|
||||||
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
|
||||||
printer_name:localStorage.getItem("printer_name"),
|
|
||||||
mgroup_name:'',
|
|
||||||
ofrom_name:'',
|
|
||||||
ofrom_batch :'',
|
|
||||||
checkItem:{},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
let that = this;
|
|
||||||
let paths = that.$route.path;
|
|
||||||
let arr = paths.split("/");
|
|
||||||
that.route_code = arr[2];
|
|
||||||
that.params.mgroupx = that.mgroupId;
|
|
||||||
// that.params.belong_dept =that.deptId;
|
|
||||||
that.$TOOL.data.set('bx_deptID',that.deptId);
|
|
||||||
that.apiObj = that.$API.wpm.wmaterial.list;
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleWatch(row) {
|
|
||||||
let that = this;
|
|
||||||
that.$API.wpm.batchlog.dag.req({batch:row.batch}).then((res) => {
|
|
||||||
that.nodes = res.nodes;
|
|
||||||
that.edges = res.edges;
|
|
||||||
that.limitedWatch = true;
|
|
||||||
that.$nextTick(() => {
|
|
||||||
that.$refs.degraDialogs.open();
|
|
||||||
});
|
|
||||||
})
|
|
||||||
},
|
|
||||||
add() {
|
|
||||||
this.dialog.save = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.saveDialog.open("add");
|
|
||||||
});
|
|
||||||
},
|
|
||||||
materialsChoses(str) {
|
|
||||||
this.materialType = str;
|
|
||||||
this.materialsVisible = true;
|
|
||||||
},
|
|
||||||
choseChange(data) {
|
|
||||||
this.queryWm.material = data;
|
|
||||||
this.$refs.table_wm.queryData(this.queryWm);
|
|
||||||
this.materialsVisible = false;
|
|
||||||
},
|
|
||||||
tomio(type) {
|
|
||||||
let that = this;
|
|
||||||
that.cate_type=type;
|
|
||||||
that.dialog.inmRecord = true;
|
|
||||||
that.$nextTick(() => {
|
|
||||||
that.$refs.inmRecordDialog.open("add");
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//获取当前批次车间物料的检验记录
|
|
||||||
tableCheckList(row){
|
|
||||||
this.wm = row.id;
|
|
||||||
this.wmMaterial = row.material;
|
|
||||||
this.visibleDrawer = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.showDrawer.open();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//表格选择后回调事件
|
|
||||||
selectionChange(selection) {
|
|
||||||
let that = this;
|
|
||||||
that.selection = selection;
|
|
||||||
//合批
|
|
||||||
if(selection.length>0){
|
|
||||||
let material = selection[0].material;
|
|
||||||
selection.forEach((item)=>{
|
|
||||||
if(item.material!==material){
|
|
||||||
that.$refs.table.toggleRowSelection(item, false);
|
|
||||||
that.$message.warning("该批次物料与前面的不一样");
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//添加报废
|
|
||||||
table_add(type) {
|
|
||||||
this.dialog.scrap = true;
|
|
||||||
this.type = type;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.scrapDialog.open("add");
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//合批
|
|
||||||
batchConcat(){
|
|
||||||
this.changebatch = true;
|
|
||||||
let handoverb = [];
|
|
||||||
if(this.selection.length>0){
|
|
||||||
this.selection.forEach(item=>{
|
|
||||||
let obj = {};
|
|
||||||
obj.wm = item.id;
|
|
||||||
obj.batch = item.batch;
|
|
||||||
obj.process = item.material_.process_name;
|
|
||||||
obj.count_cando = item.count_cando;
|
|
||||||
obj.count = item.count_cando;
|
|
||||||
handoverb.push(obj)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.type = 10;
|
|
||||||
this.dialog.scrap = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.scrapDialog.open("add",handoverb,30);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleScrapSuccess(){
|
|
||||||
this.dialog.scrap = false;
|
|
||||||
this.$refs.table.refresh();
|
|
||||||
},
|
|
||||||
//出入库后刷新页面
|
|
||||||
handleinmSuccess(){
|
|
||||||
this.$refs.table.refresh();
|
|
||||||
},
|
|
||||||
//搜索
|
|
||||||
handleQuery() {
|
|
||||||
this.$refs.table.queryData(this.query);
|
|
||||||
},
|
|
||||||
showWpr(row){
|
|
||||||
let that = this;
|
|
||||||
that.ofrom_name = row.material_ofrom_name;
|
|
||||||
that.ofrom_batch = row.batch;
|
|
||||||
that.wprParams.wm = row.id;
|
|
||||||
that.wprVisibleDrawer = true;
|
|
||||||
this.$API.wpm.wpr.list.req(that.wprParams).then((res) => {
|
|
||||||
that.wprList = res;
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//本地更新数据
|
|
||||||
handleSaveSuccess(data, mode) {
|
|
||||||
this.dialog.save = false;
|
|
||||||
this.$refs.table.refresh();
|
|
||||||
},
|
|
||||||
//打印物料标签
|
|
||||||
printMaterial(row,type){
|
|
||||||
let that = this;
|
|
||||||
if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){
|
|
||||||
if(type=='wm'){
|
|
||||||
let params = {};
|
|
||||||
params.tid = row.id;
|
|
||||||
if(that.route_code=='paiyicibang'){
|
|
||||||
params.label_template_name = '排一次棒打印模板';
|
|
||||||
}else{
|
|
||||||
params.extra_data={count:row.count};
|
|
||||||
params.label_template_name = '其他工序打印模板';
|
|
||||||
}
|
|
||||||
that.apiObjPrint.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(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{
|
|
||||||
that.$message.warning("请先设置打印机");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
inmCheck(row){
|
|
||||||
let that = this;
|
|
||||||
that.checkItem = row;
|
|
||||||
that.dialog.check = true;
|
|
||||||
that.$nextTick(() => {
|
|
||||||
that.$refs.checkDialog.open("add");
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style scoped></style>
|
|
||||||
|
|
@ -1,117 +0,0 @@
|
||||||
<!-- 左侧工段列表的 生产执行页面 -->
|
|
||||||
<template>
|
|
||||||
<el-container>
|
|
||||||
<el-aside style="width: 100px;background: #ffffff;">
|
|
||||||
<ul style="padding-left: 7px;">
|
|
||||||
<li
|
|
||||||
v-for="(item,index) in mgroups"
|
|
||||||
:key="item.id"
|
|
||||||
:class="['mgroupItem',selectedIndex === index?'mgroupItemActive':'']"
|
|
||||||
@click="changeMgroup(item.id,index)"
|
|
||||||
>{{item.name}}</li>
|
|
||||||
</ul>
|
|
||||||
</el-aside>
|
|
||||||
<el-main>
|
|
||||||
<el-container>
|
|
||||||
<el-header>
|
|
||||||
<el-segmented
|
|
||||||
v-model="values"
|
|
||||||
:options="options"
|
|
||||||
size="default"
|
|
||||||
></el-segmented>
|
|
||||||
</el-header>
|
|
||||||
<el-main id="elMain" class="nopadding">
|
|
||||||
<!-- 日志 -->
|
|
||||||
<mlogs
|
|
||||||
v-if="values == '日志'"
|
|
||||||
:mgroupName="mgroupName"
|
|
||||||
style="height: 60%"
|
|
||||||
></mlogs>
|
|
||||||
<mtask
|
|
||||||
v-if="values == '日志'"
|
|
||||||
:mgroupName="mgroupName"
|
|
||||||
style="height: 40%"
|
|
||||||
></mtask>
|
|
||||||
<!-- 交接记录 -->
|
|
||||||
<handover
|
|
||||||
v-else-if="values == '交接记录'"
|
|
||||||
:mgroupName="mgroupName"
|
|
||||||
></handover>
|
|
||||||
<!-- 库存 -->
|
|
||||||
<inm v-else-if="values == '库存'" :mgroupName="mgroupName"></inm>
|
|
||||||
|
|
||||||
</el-main>
|
|
||||||
</el-container>
|
|
||||||
</el-main>
|
|
||||||
</el-container>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import inm from "./inm.vue";
|
|
||||||
import mlogs from "./mlogs.vue";
|
|
||||||
import mtask from "./mtask.vue";
|
|
||||||
import handover from "./handover.vue";
|
|
||||||
export default {
|
|
||||||
name: "bx",
|
|
||||||
components: { inm, mlogs, mtask, handover },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
mgroups:[],
|
|
||||||
tableHieght: 200,
|
|
||||||
options: ["日志", "交接记录", "库存"],
|
|
||||||
values: "日志",
|
|
||||||
mgroupName: "",
|
|
||||||
mgroupId: "",
|
|
||||||
selectedIndex:0,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
let that = this;
|
|
||||||
that.getMgroups();
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
let that = this;
|
|
||||||
let height = document.getElementById("elMain").clintHeight / 2;
|
|
||||||
that.tableHieght = height;
|
|
||||||
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleChange(value) {
|
|
||||||
this.value = value;
|
|
||||||
console.log("Selected value:", value);
|
|
||||||
},
|
|
||||||
getMgroups(){
|
|
||||||
let that = this;
|
|
||||||
that.$API.mtm.mgroup.list.req({page:0}).then((res) => {
|
|
||||||
that.mgroups = res;
|
|
||||||
that.mgroupName = res[0].name;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
changeMgroup(id,index){
|
|
||||||
let that = this;
|
|
||||||
that.selectedIndex = index;
|
|
||||||
console.log(that.selectedIndex);
|
|
||||||
that.mgroupId = id;
|
|
||||||
that.mgroupName = that.mgroups[index].name;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style scoped>
|
|
||||||
.countBlock {
|
|
||||||
width: 80px;
|
|
||||||
color: #ffffff;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.mgroupItem{
|
|
||||||
height: 35px;
|
|
||||||
width: 80px;
|
|
||||||
line-height: 35px;
|
|
||||||
margin: 5px 0;
|
|
||||||
text-align: center;
|
|
||||||
color: #6e80ff;
|
|
||||||
}
|
|
||||||
.mgroupItem:hover,.mgroupItemActive{
|
|
||||||
color: #6e80ff;
|
|
||||||
background: rgba(83, 109, 254, 0.2);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
[
|
|
||||||
{
|
|
||||||
"x":2.5,
|
|
||||||
"y":3.5,
|
|
||||||
"z":5.0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
@ -1,141 +0,0 @@
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<div id="pdfDom" class="container" ref="pdfContent">
|
|
||||||
<div class="title">
|
|
||||||
<span>光芯科技</span>
|
|
||||||
<span>交接单</span>
|
|
||||||
</div>
|
|
||||||
<canvas id="barcode"></canvas>
|
|
||||||
<p class="lineStyle">物料:{{ name }}</p>
|
|
||||||
<p class="lineStyle">批次号:{{ batch }}</p>
|
|
||||||
<p class="lineStyle">数量:{{ count }}</p>
|
|
||||||
</div>
|
|
||||||
<el-button type="primary" @click="toGetPdf1">打印 </el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import axios from "axios";
|
|
||||||
import config from "@/config";
|
|
||||||
import http from "@/utils/request";
|
|
||||||
import getPdf from "@/utils/htmlToPdf";
|
|
||||||
import PdfLoader from "@/utils/html2pdf";
|
|
||||||
|
|
||||||
import html2canvas from "html2canvas";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
material_name: "玻璃片",
|
|
||||||
batch: "20240723_001",
|
|
||||||
count: "1000",
|
|
||||||
date: "2023-01-01",
|
|
||||||
sender: "切片-石小静",
|
|
||||||
resave: "活化-白海军",
|
|
||||||
visible: false,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
var canvas = document.getElementById("barcode");
|
|
||||||
var context = canvas.getContext("2d");
|
|
||||||
context.clearRect(0, 0, 210, 270);
|
|
||||||
JsBarcode("#barcode", "9780199532179", {
|
|
||||||
format: "CODE128",
|
|
||||||
displayValue: true,
|
|
||||||
fontSize: 24,
|
|
||||||
lineColor: "#000000",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
toGetPdf(val = false, download = false) {
|
|
||||||
let that = this;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
let title = "交接单";
|
|
||||||
getPdf(title, download).then((res) => {
|
|
||||||
console.log("res", res);
|
|
||||||
|
|
||||||
// 创建 FormData 对象
|
|
||||||
let formData = new FormData();
|
|
||||||
formData.append("file", res, "document.pdf"); // 添加文件到 FormData
|
|
||||||
formData.append("printer_name", "GP-3150TN"); // 添加其他字段
|
|
||||||
|
|
||||||
// 发送 POST 请求
|
|
||||||
that.$API.wpm.prints.req(formData)
|
|
||||||
// http.post("http://localhost:8080/prints/", formData)
|
|
||||||
.then((response) => {
|
|
||||||
console.log("postRes", response);
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
console.error("postError", error);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}, 1000);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/* 将base64转换为文件,接收2个参数,第一是base64,第二个是文件名字 最后返回文件对象 */
|
|
||||||
dataURLtoFile(dataurl, filename) {
|
|
||||||
var arr = dataurl.split(","),
|
|
||||||
mime = arr[0].match(/:(.*?);/)[1],
|
|
||||||
bstr = atob(arr[1]),
|
|
||||||
n = bstr.length,
|
|
||||||
u8arr = new Uint8Array(n);
|
|
||||||
while (n--) {
|
|
||||||
u8arr[n] = bstr.charCodeAt(n);
|
|
||||||
}
|
|
||||||
return new File([u8arr], filename, { type: mime });
|
|
||||||
},
|
|
||||||
|
|
||||||
toGetPdf1() {
|
|
||||||
let str = [
|
|
||||||
"SIZE 70 mm,90 mm",
|
|
||||||
"GAP 2 mm,0 mm",
|
|
||||||
"CLS",
|
|
||||||
"WINTEXT 100,80,36,0,0,0,Simhei,光芯科技——交接单",
|
|
||||||
'BARCODE 100,140,"128",108,0,0,2,4,"' + this.batch + '"',
|
|
||||||
"WINTEXT 100,280,36,0,0,0,Simhei,物料:" + this.material_name,
|
|
||||||
"WINTEXT 100,340,36,0,0,0,Simhei,批次:" + this.batch,
|
|
||||||
"WINTEXT 100,400,36,0,0,0,Simhei,数量:" + this.count,
|
|
||||||
"WINTEXT 100,460,36,0,0,0,Simhei,日期:" + this.date,
|
|
||||||
"WINTEXT 100,520,36,0,0,0,Simhei,送料:" + this.sender,
|
|
||||||
"WINTEXT 100,580,36,0,0,0,Simhei,收料:" + this.resave,
|
|
||||||
"PRINT 1",
|
|
||||||
];
|
|
||||||
// 送料:工段-姓名
|
|
||||||
// 收料:工段-姓名
|
|
||||||
let obj = {};
|
|
||||||
obj.printer_commands = str;
|
|
||||||
obj.printer_name = "GP-3150TNS";
|
|
||||||
that.$API.wpm.prints.req(obj)
|
|
||||||
// http.post("http://localhost:8080/prints/", obj)
|
|
||||||
.then((response) => {
|
|
||||||
console.log("postRes", response);
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
console.error("postError", error);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style scoped>
|
|
||||||
.container {
|
|
||||||
width: 210px;
|
|
||||||
height: 270px;
|
|
||||||
padding: 10px 5px;
|
|
||||||
border: 1px solid #dddddd;
|
|
||||||
background-color: #ffffff;
|
|
||||||
}
|
|
||||||
.title {
|
|
||||||
/* display: flex;
|
|
||||||
justify-content: space-between; */
|
|
||||||
font-size: 18px;
|
|
||||||
}
|
|
||||||
#barcode {
|
|
||||||
/* position: absolute; */
|
|
||||||
width: 200px;
|
|
||||||
height: 100px;
|
|
||||||
}
|
|
||||||
.lineStyle {
|
|
||||||
font-size: 14px;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
Loading…
Reference in New Issue