fix:成品库、工艺路线、工艺路线详情、工艺路线编辑时展示流程图
This commit is contained in:
parent
d854913b09
commit
02d5b0f840
|
|
@ -142,23 +142,26 @@
|
|||
:mtype="wmtype"
|
||||
:apiObj="apiObjPrint"
|
||||
></print-dialog>
|
||||
<degraDialog
|
||||
v-if="limitedWatch"
|
||||
ref="degraDialogs"
|
||||
:code="showBatch"
|
||||
@closeDialog="limitedWatch = false"
|
||||
>
|
||||
</degraDialog>
|
||||
<el-drawer v-model="limitedWatch" title="工艺路线流程图" size="80%" @closeDialog="limitedWatch = false">
|
||||
<degrad3
|
||||
v-if="limitedWatch"
|
||||
ref="degraDialogs"
|
||||
:nodes="nodes"
|
||||
:edges="edges"
|
||||
:rankdir="'LR'"
|
||||
>
|
||||
</degrad3>
|
||||
</el-drawer>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
import degraDialog from "./../template/degraD3.vue";
|
||||
import degrad3 from "./../template/degraD3.vue";
|
||||
import printDialog from "./../template/printmaterial.vue";
|
||||
export default {
|
||||
name: "halfgood",
|
||||
components: {
|
||||
printDialog,
|
||||
degraDialog
|
||||
degrad3
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -169,7 +172,8 @@ export default {
|
|||
warehouseOptions: [],
|
||||
apiObjWm: this.$API.wpm.wmaterial.list,
|
||||
paramsWm: { count__gte: 1, material__type: 10 },
|
||||
// processOptions: [],
|
||||
nodes:[],
|
||||
edges:[],
|
||||
queryWm: {},
|
||||
wmtype:0,
|
||||
print_m:false,
|
||||
|
|
@ -206,11 +210,14 @@ export default {
|
|||
},
|
||||
handleWatch(row) {
|
||||
let that = this;
|
||||
that.showBatch = row.batch;
|
||||
that.limitedWatch = true;
|
||||
that.$nextTick(() => {
|
||||
that.$refs.degraDialogs.open('batch');
|
||||
});
|
||||
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();
|
||||
});
|
||||
})
|
||||
},
|
||||
//打印物料标签
|
||||
printMaterial(row){
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-container v-loading="loading">
|
||||
<el-main>
|
||||
<el-header style="height: 80px;display: block;padding:0">
|
||||
<el-card shadow="hover">
|
||||
<el-descriptions :column="3" title="基本信息">
|
||||
<el-descriptions-item label="工艺名称:">{{
|
||||
|
|
@ -19,43 +19,72 @@
|
|||
}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<el-card style="margin-top: 8px" shadow="hover">
|
||||
<scTable
|
||||
ref="tables"
|
||||
:data="tableData"
|
||||
row-key="id"
|
||||
hidePagination
|
||||
hideDo
|
||||
stripe
|
||||
>
|
||||
<el-table-column label="排序" prop="sort" width="50">
|
||||
</el-table-column>
|
||||
<el-table-column label="工序" prop="process_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="输入" prop="material_in_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="输出" prop="material_out_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="出材率" prop="out_rate">
|
||||
</el-table-column>
|
||||
<el-table-column label="切分融合数量" prop="div_number">
|
||||
</el-table-column>
|
||||
<el-table-column label="工时" prop="hour_work">
|
||||
</el-table-column>
|
||||
<el-table-column label="批次校验" v-if="project_code!=='bxerp'">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.batch_bind" type="success">是</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-card>
|
||||
</el-header>
|
||||
<el-main id="degInnerMain">
|
||||
<el-container>
|
||||
<el-side style="width: 50%;overflow: scroll;">
|
||||
<div style="font-weight: 600;color: #303133;font-size: 16px;padding: 10px 0;position: fixed;">工艺路线流程图</div>
|
||||
<el-tabs
|
||||
v-if="tabsTitle.length>1"
|
||||
v-model="activeName"
|
||||
:tab-position="'left'"
|
||||
style="flex-direction: row;"
|
||||
@tab-click="tabshandleClick"
|
||||
>
|
||||
<el-tab-pane :label="item" v-for="item in tabsTitle" :key="item"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<degrad3
|
||||
style="margin-top: 50px;"
|
||||
v-if="limitedWatch"
|
||||
ref="degraDialogs"
|
||||
:nodes="nodes"
|
||||
:edges="edges"
|
||||
:rankdir="'DL'"
|
||||
@closeDialog="limitedWatch = false"
|
||||
>
|
||||
</degrad3>
|
||||
</el-side>
|
||||
<el-main>
|
||||
<scTable
|
||||
ref="tables"
|
||||
:data="tableData"
|
||||
row-key="id"
|
||||
hidePagination
|
||||
hideDo
|
||||
stripe
|
||||
border
|
||||
>
|
||||
<el-table-column label="排序" prop="sort" width="50">
|
||||
</el-table-column>
|
||||
<el-table-column label="工序" prop="process_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="输入" prop="material_in_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="输出" prop="material_out_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="出材率" prop="out_rate">
|
||||
</el-table-column>
|
||||
<el-table-column label="切分融合数量" prop="div_number">
|
||||
</el-table-column>
|
||||
<el-table-column label="工时" prop="hour_work">
|
||||
</el-table-column>
|
||||
<el-table-column label="批次校验" v-if="project_code!=='bxerp'">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.batch_bind" type="success">是</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import degrad3 from "./../template/degraD3.vue";
|
||||
export default {
|
||||
emits: ["success", "closed"],
|
||||
components: { degrad3 },
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
|
|
@ -68,8 +97,14 @@ export default {
|
|||
50: "已完成",
|
||||
},
|
||||
form: {},
|
||||
nodes:[],
|
||||
edges:[],
|
||||
tabsTitle:['总图'],
|
||||
tabsData:{},
|
||||
tableData: [],
|
||||
project_code: "",
|
||||
activeName:"总图",
|
||||
limitedWatch:false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -87,6 +122,38 @@ export default {
|
|||
let that = this;
|
||||
Object.assign(that.form, data);
|
||||
that.getRoute(that.form.material);
|
||||
that.getDEGdatas(data.id);
|
||||
this.getTabsList(data.id);
|
||||
},
|
||||
getDEGdatas(id){
|
||||
let that = this;
|
||||
that.$API.mtm.routepack.dag.req(id).then((res) => {
|
||||
that.nodes = res.nodes;
|
||||
that.edges = res.edges;
|
||||
that.tabsData['总图'] = res;
|
||||
if(!that.limitedWatch){
|
||||
that.limitedWatch = true;
|
||||
that.$nextTick(() => {
|
||||
that.$refs.degraDialogs.open();
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
getTabsList(id){
|
||||
let that = this;
|
||||
that.$API.mtm.routepack.dags.req(id).then((res) => {
|
||||
let arr = [];
|
||||
for(let key in res){
|
||||
arr.push(key);
|
||||
}
|
||||
if(arr.length>1){
|
||||
for(let key in res){
|
||||
that.tabsTitle.push(res[key].name);
|
||||
that.tabsData[res[key].name]=res[key];
|
||||
}
|
||||
}
|
||||
console.log(that.tabsData);
|
||||
})
|
||||
},
|
||||
//文件列表加载
|
||||
getRoute(id) {
|
||||
|
|
@ -96,6 +163,14 @@ export default {
|
|||
this.tableData = res;
|
||||
});
|
||||
},
|
||||
tabshandleClick(val){
|
||||
let that = this;
|
||||
let label = val.props.label;
|
||||
that.$nextTick(() => {
|
||||
that.nodes = that.tabsData[label].nodes;
|
||||
that.edges = that.tabsData[label].edges;
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@
|
|||
link
|
||||
type="primary"
|
||||
size="small"
|
||||
v-if="scope.row.state != 10"
|
||||
@click="table_show(scope.row, scope.$index)"
|
||||
>查看
|
||||
</el-button>
|
||||
|
|
@ -118,9 +119,9 @@
|
|||
>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
<el-link :underline="false" type="primary"
|
||||
<!-- <el-link :underline="false" type="primary"
|
||||
@click="handleWatch(scope.row)"
|
||||
>流程图</el-link>
|
||||
>流程图</el-link> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
|
|
@ -138,24 +139,27 @@
|
|||
ref="showDialog"
|
||||
@closed="dialog.show = false"
|
||||
></show-dialog>
|
||||
<degraDialog
|
||||
v-if="limitedWatch"
|
||||
ref="degraDialogs"
|
||||
:code="showrotepack"
|
||||
@closeDialog="limitedWatch = false"
|
||||
>
|
||||
</degraDialog>
|
||||
<!-- <el-drawer v-model="limitedWatch" title="工艺路线流程图" size="80%" @closeDialog="limitedWatch = false">
|
||||
<degrad3
|
||||
v-if="limitedWatch"
|
||||
ref="degraDialogs"
|
||||
:nodes="nodes"
|
||||
:edges="edges"
|
||||
:rankdir="'DL'"
|
||||
>
|
||||
</degrad3>
|
||||
</el-drawer> -->
|
||||
</template>
|
||||
<script>
|
||||
import saveDialog from "./routepack_form.vue";
|
||||
import showDialog from "./route_show.vue";
|
||||
import degraDialog from "./../template/degraD3.vue";
|
||||
import degrad3 from "./../template/degraD3.vue";
|
||||
export default {
|
||||
name: "route",
|
||||
components: {
|
||||
saveDialog,
|
||||
showDialog,
|
||||
degraDialog
|
||||
degrad3
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -179,6 +183,8 @@ export default {
|
|||
search: "",
|
||||
keyword: null,
|
||||
},
|
||||
nodes:[],
|
||||
edges:[],
|
||||
timeRange: [],
|
||||
filteType: "all",
|
||||
stateOptions: [
|
||||
|
|
@ -200,7 +206,6 @@ export default {
|
|||
20: "审批中",
|
||||
30: "已确认",
|
||||
},
|
||||
showrotepack: "",
|
||||
filterType: "all",
|
||||
isSaveing:false,
|
||||
limitedWatch:false,
|
||||
|
|
@ -255,14 +260,17 @@ export default {
|
|||
return err;
|
||||
});
|
||||
},
|
||||
handleWatch(row) {
|
||||
let that = this;
|
||||
that.showrotepack = row.id;
|
||||
that.limitedWatch = true;
|
||||
that.$nextTick(() => {
|
||||
that.$refs.degraDialogs.open('routepack');
|
||||
});
|
||||
},
|
||||
// handleWatch(row) {
|
||||
// let that = this;
|
||||
// that.$API.mtm.routepack.dag.req(row.id).then((res) => {
|
||||
// that.nodes = res.nodes;
|
||||
// that.edges = res.edges;
|
||||
// that.limitedWatch = true;
|
||||
// that.$nextTick(() => {
|
||||
// that.$refs.degraDialogs.open();
|
||||
// });
|
||||
// })
|
||||
// },
|
||||
table_state(row){
|
||||
let that = this;
|
||||
that.$API.mtm.routepack.togglestate.req(row.id).then((res) => {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
v-for="(item, index) of stepes"
|
||||
:key="index"
|
||||
:title="item"
|
||||
style="50%"
|
||||
@click="handleStep(index)"
|
||||
>
|
||||
</el-step>
|
||||
|
|
@ -94,87 +93,96 @@
|
|||
<!--工序!-->
|
||||
<el-main class="nopadding" v-if="active === 1">
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel" style="margin: 10px">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="table_add"
|
||||
></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main>
|
||||
<scTable
|
||||
ref="tables"
|
||||
:apiObj="apiObj"
|
||||
:query="query"
|
||||
:params="query"
|
||||
row-key="id"
|
||||
stripe
|
||||
>
|
||||
<el-table-column label="排序" prop="sort" width="50">
|
||||
</el-table-column>
|
||||
<el-table-column label="工序" prop="process_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="输入" prop="material_in_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="输出" prop="material_out_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="出材率" prop="out_rate">
|
||||
</el-table-column>
|
||||
<el-table-column label="工时" prop="hour_work">
|
||||
</el-table-column>
|
||||
<el-table-column label="切分数量" prop="div_number" v-if="project_code=='bxerp'">
|
||||
</el-table-column>
|
||||
<el-table-column label="批次校验" prop="batch_bind" v-else>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
fixed="right"
|
||||
align="center"
|
||||
width="200"
|
||||
<el-side style="width: 50%;overflow: scroll;">
|
||||
<div style="font-weight: 600;color: #303133;font-size: 16px;padding: 10px 0;position: fixed;width: 30px;">工艺路线流程图</div>
|
||||
<degrad3
|
||||
style="margin-top: 50px;"
|
||||
v-if="limitedWatch"
|
||||
ref="degraDialogs"
|
||||
:nodes="nodes"
|
||||
:edges="edges"
|
||||
:rankdir="'DL'"
|
||||
>
|
||||
<template #default="scope">
|
||||
</degrad3>
|
||||
</el-side>
|
||||
<el-main style="width: 50%;overflow: scroll;">
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel" style="margin: 10px">
|
||||
<el-button
|
||||
text
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="table_edit(scope.row)"
|
||||
>编辑</el-button
|
||||
icon="el-icon-plus"
|
||||
@click="table_add"
|
||||
></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main>
|
||||
<scTable
|
||||
ref="tables"
|
||||
:apiObj="apiObj"
|
||||
:params="query"
|
||||
row-key="id"
|
||||
hidePagination
|
||||
hideDo
|
||||
stripe
|
||||
>
|
||||
<el-table-column label="排序" prop="sort" width="50">
|
||||
</el-table-column>
|
||||
<el-table-column label="工序" prop="process_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="输入" prop="material_in_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="输出" prop="material_out_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="出材率" prop="out_rate">
|
||||
</el-table-column>
|
||||
<el-table-column label="工时" prop="hour_work">
|
||||
</el-table-column>
|
||||
<el-table-column label="切分数量" prop="div_number" v-if="project_code=='bxerp'">
|
||||
</el-table-column>
|
||||
<el-table-column label="批次校验" prop="batch_bind" v-else>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
fixed="right"
|
||||
align="center"
|
||||
width="200"
|
||||
>
|
||||
<el-popconfirm
|
||||
title="确定删除该工序吗?"
|
||||
@confirm="delWorker(scope.row)"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button text type="danger" size="small"
|
||||
>删除</el-button
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
text
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="table_edit(scope.row)"
|
||||
>编辑</el-button>
|
||||
<el-popconfirm
|
||||
title="确定删除该工序吗?"
|
||||
@confirm="delWorker(scope.row)"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button text type="danger" size="small">删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-main>
|
||||
<el-footer v-if="active === 1" style="text-align: center">
|
||||
<el-button @click="handleLastStep" style="margin-right: 4px"
|
||||
>上一步</el-button
|
||||
>
|
||||
<el-button
|
||||
v-for="item in initForm.transitions"
|
||||
:key="item.id"
|
||||
type="primary"
|
||||
:loading="isSaveing"
|
||||
:disabled="isSaveing"
|
||||
@click="submitTicketCreate(item.id)"
|
||||
style="margin-right: 4px"
|
||||
>{{ item.name }}</el-button
|
||||
>
|
||||
<el-button @click="$emit('closed')" type="warning"
|
||||
>退出</el-button
|
||||
>
|
||||
<el-button @click="handleLastStep" style="margin-right: 4px">上一步</el-button>
|
||||
<el-button
|
||||
v-for="item in initForm.transitions"
|
||||
:key="item.id"
|
||||
type="primary"
|
||||
:loading="isSaveing"
|
||||
:disabled="isSaveing"
|
||||
@click="submitTicketCreate(item.id)"
|
||||
style="margin-right: 4px"
|
||||
>{{ item.name }}</el-button>
|
||||
<el-button @click="$emit('closed')" type="warning">退出</el-button>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
<save-dialog
|
||||
|
|
@ -188,10 +196,10 @@
|
|||
</template>
|
||||
<script>
|
||||
import saveDialog from "./route_form.vue";
|
||||
|
||||
import degrad3 from "./../template/degraD3.vue";
|
||||
export default {
|
||||
name: "routepack_form",
|
||||
components: { saveDialog },
|
||||
components: { saveDialog,degrad3 },
|
||||
data() {
|
||||
return {
|
||||
active: 0,
|
||||
|
|
@ -222,9 +230,12 @@ export default {
|
|||
rules: {
|
||||
name: [{ required: true, message: "请输入" }],
|
||||
},
|
||||
nodes:[],
|
||||
edges:[],
|
||||
routepack: "",
|
||||
project_code:'',
|
||||
productName:'',
|
||||
limitedWatch:false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -242,15 +253,14 @@ export default {
|
|||
setData(data) {
|
||||
Object.assign(this.form, data);
|
||||
let obj = {};
|
||||
obj.name=data.document_.name;
|
||||
obj.url=data.document_.file;
|
||||
this.fileList.push(obj);
|
||||
// console.log("setData this.form", this.form);
|
||||
if(data.document_&&data.document_.name){
|
||||
obj.name=data.document_.name;
|
||||
obj.url=data.document_.file;
|
||||
this.fileList.push(obj);
|
||||
}
|
||||
},
|
||||
fileUPSuccess(res) {
|
||||
let that = this;
|
||||
// console.log('res',res);
|
||||
// console.log('that.fileList',that.fileList);
|
||||
that.form.document = res.id;
|
||||
},
|
||||
getMaterials() {
|
||||
|
|
@ -288,7 +298,7 @@ export default {
|
|||
that.query.routepack = res.id;
|
||||
that.apiObj = that.$API.mtm.route.list;
|
||||
that.active = 1;
|
||||
// that.$refs.tables.refresh();
|
||||
that.getDEGdatas();
|
||||
});
|
||||
} else {
|
||||
that.$API.mtm.routepack.create.req(form).then((res) => {
|
||||
|
|
@ -303,6 +313,19 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
getDEGdatas(){
|
||||
let that = this;
|
||||
that.$API.mtm.routepack.dag.req(that.routepack).then((res) => {
|
||||
that.nodes = res.nodes;
|
||||
that.edges = res.edges;
|
||||
if(!that.limitedWatch){
|
||||
that.limitedWatch = true;
|
||||
that.$nextTick(() => {
|
||||
that.$refs.degraDialogs.open();
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
table_add() {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
|
|
@ -331,16 +354,14 @@ export default {
|
|||
//删除工序步骤
|
||||
delWorker(row) {
|
||||
let that = this;
|
||||
that.$API.mtm.route.delete
|
||||
.req(row.id)
|
||||
.then((res) => {
|
||||
that.$message.success("工序步骤删除成功");
|
||||
that.$refs.tables.refresh();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
that.$API.mtm.route.delete.req(row.id).then((res) => {
|
||||
that.$message.success("工序步骤删除成功");
|
||||
that.getDEGdatas();
|
||||
that.$refs.tables.refresh();
|
||||
return res;
|
||||
}).catch((err) => {
|
||||
return err;
|
||||
});
|
||||
},
|
||||
|
||||
//渲染工单提交按钮
|
||||
|
|
@ -378,6 +399,7 @@ export default {
|
|||
//本地更新数据
|
||||
handleSaveSuccess() {
|
||||
this.$refs.tables.refresh();
|
||||
this.getDEGdatas();
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue