feat: 优化routepack 添加wf组件
This commit is contained in:
parent
a293bfe1ae
commit
83edbad12d
|
|
@ -1,13 +1,8 @@
|
|||
<template>
|
||||
<el-drawer
|
||||
title="查看"
|
||||
v-model="visible"
|
||||
:size="'90%'"
|
||||
destroy-on-close
|
||||
@closed="$emit('closed')"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-container v-loading="loading">
|
||||
|
||||
<el-main class="nopadding" style="padding-right: 1px;">
|
||||
<el-container>
|
||||
<el-header style="height: 80px;display: block;padding:0">
|
||||
<el-card shadow="hover">
|
||||
<el-descriptions :column="3" title="基本信息">
|
||||
|
|
@ -20,40 +15,22 @@
|
|||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-header>
|
||||
<el-main id="degInnerMain">
|
||||
<el-main>
|
||||
<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-aside 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>
|
||||
<scDegra
|
||||
style="margin-top: 50px;"
|
||||
v-if="limitedWatch"
|
||||
ref="degraDialogs"
|
||||
:nodes="nodes"
|
||||
:edges="edges"
|
||||
:rankdir="'DL'"
|
||||
@closeDialog="limitedWatch = false"
|
||||
>
|
||||
<scDegra style="margin-top: 50px;" v-if="limitedWatch" ref="degraDialogs" :nodes="nodes"
|
||||
:edges="edges" :rankdir="'DL'" @closeDialog="limitedWatch = false">
|
||||
</scDegra>
|
||||
</el-side>
|
||||
<el-main>
|
||||
<scTable
|
||||
ref="tables"
|
||||
:data="tableData"
|
||||
row-key="id"
|
||||
hidePagination
|
||||
hideDo
|
||||
stripe
|
||||
border
|
||||
>
|
||||
</el-aside>
|
||||
<el-main class="padding: 1px">
|
||||
<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">
|
||||
|
|
@ -81,17 +58,28 @@
|
|||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
|
||||
</el-main>
|
||||
|
||||
|
||||
</el-container>
|
||||
</el-main>
|
||||
<el-aside width="20%" v-if="form.ticket">
|
||||
<ticketd :ticketId="form.ticket"></ticketd>
|
||||
</el-aside>
|
||||
</el-container>
|
||||
</el-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import ticketd from '@/views/wf/ticketd.vue'
|
||||
export default {
|
||||
emits: ["success", "closed"],
|
||||
components: { ticketd },
|
||||
props: {
|
||||
modelId: { type: String, default: null },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
state_: {
|
||||
10: "创建中",
|
||||
|
|
@ -103,7 +91,9 @@ export default {
|
|||
10: "批次",
|
||||
20: "单个",
|
||||
},
|
||||
form: {},
|
||||
form: {
|
||||
ticket: null
|
||||
},
|
||||
nodes: [],
|
||||
edges: [],
|
||||
tabsTitle: ['总图'],
|
||||
|
|
@ -117,6 +107,9 @@ export default {
|
|||
mounted() {
|
||||
this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code;
|
||||
this.tableData = [];
|
||||
if (this.modelId) {
|
||||
this.getRoutePackDetail(this.modelId);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//显示
|
||||
|
|
@ -132,6 +125,10 @@ export default {
|
|||
that.getDEGdatas(data.id);
|
||||
this.getTabsList(data.id);
|
||||
},
|
||||
async getRoutePackDetail(id) {
|
||||
let res = await this.$API.mtm.routepack.item.req(id);
|
||||
this.setData(res);
|
||||
},
|
||||
getDEGdatas(id) {
|
||||
let that = this;
|
||||
that.$API.mtm.routepack.dag.req(id).then((res) => {
|
||||
|
|
|
|||
|
|
@ -185,11 +185,17 @@
|
|||
@closed="saveClose"
|
||||
>
|
||||
</save-dialog>
|
||||
<show-dialog
|
||||
v-if="dialog.show"
|
||||
ref="showDialog"
|
||||
<el-drawer
|
||||
v-model="dialog.show"
|
||||
title="查看"
|
||||
:size="'90%'"
|
||||
destroy-on-close
|
||||
@closed="dialog.show = false"
|
||||
></show-dialog>
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<show-dialog ref="showDialog"></show-dialog>
|
||||
</el-drawer>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import saveDialog from "./routepack_form.vue";
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@
|
|||
<!--工序!-->
|
||||
<el-main class="nopadding" v-if="active === 1">
|
||||
<el-container>
|
||||
<el-side style="width: 50%;overflow: scroll;">
|
||||
<el-aside style="width: 50%;overflow: scroll;">
|
||||
<div style="font-weight: 600;color: #303133;font-size: 16px;padding: 10px 0;position: fixed;width: 30px;">工艺路线流程图</div>
|
||||
<scDegra
|
||||
style="margin-top: 50px;"
|
||||
|
|
@ -104,7 +104,7 @@
|
|||
:rankdir="'DL'"
|
||||
>
|
||||
</scDegra>
|
||||
</el-side>
|
||||
</el-aside>
|
||||
<el-main style="width: 50%;overflow: scroll;">
|
||||
<el-container>
|
||||
<el-header>
|
||||
|
|
@ -177,15 +177,8 @@
|
|||
</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>
|
||||
<ticketd_b_start :workflow_key="'routepack'" :title="form.name" :t_id="form.id"
|
||||
@success="$emit('closed')"></ticketd_b_start>
|
||||
<el-button @click="$emit('closed')" type="warning">退出</el-button>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
|
|
@ -200,9 +193,10 @@
|
|||
</template>
|
||||
<script>
|
||||
import saveDialog from "./route_form.vue";
|
||||
import ticketd_b_start from "@/views/wf/ticketd_b_start.vue";
|
||||
export default {
|
||||
name: "routepack_form",
|
||||
components: { saveDialog },
|
||||
components: { saveDialog, ticketd_b_start },
|
||||
data() {
|
||||
return {
|
||||
active: 0,
|
||||
|
|
@ -250,7 +244,7 @@ export default {
|
|||
mounted() {
|
||||
this.isSaveing = false;
|
||||
this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code;
|
||||
this.getInit();
|
||||
// this.getInit();
|
||||
// this.getMaterials();
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -379,38 +373,6 @@ export default {
|
|||
return err;
|
||||
});
|
||||
},
|
||||
|
||||
//渲染工单提交按钮
|
||||
getInit() {
|
||||
let that = this;
|
||||
that.$API.wf.workflow.initkey.req("routepack").then((res) => {
|
||||
that.initForm = res;
|
||||
});
|
||||
},
|
||||
|
||||
//提交,创建工单
|
||||
submitTicketCreate(id) {
|
||||
let that = this;
|
||||
let ticket = {};
|
||||
that.isSaveing = true;
|
||||
ticket.title = that.form.name;
|
||||
ticket.workflow = that.initForm.workflow;
|
||||
ticket.ticket_data = {
|
||||
t_id: that.routepack,
|
||||
};
|
||||
ticket.transition = id;
|
||||
that.$API.wf.ticket.create
|
||||
.req(ticket)
|
||||
.then((res) => {
|
||||
that.tLoading = false;
|
||||
that.$message.success("提交成功");
|
||||
that.$emit("close");
|
||||
that.visible = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
that.tLoading = false;
|
||||
});
|
||||
},
|
||||
//本地更新数据
|
||||
handleSaveSuccess() {
|
||||
console.log("handleSaveSuccess");
|
||||
|
|
|
|||
Loading…
Reference in New Issue