feat: 优化routepack 添加wf组件

This commit is contained in:
caoqianming 2025-09-23 13:24:15 +08:00
parent a293bfe1ae
commit 83edbad12d
3 changed files with 96 additions and 131 deletions

View File

@ -1,13 +1,8 @@
<template> <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-container v-loading="loading">
<el-main class="nopadding" style="padding-right: 1px;">
<el-container>
<el-header style="height: 80px;display: block;padding:0"> <el-header style="height: 80px;display: block;padding:0">
<el-card shadow="hover"> <el-card shadow="hover">
<el-descriptions :column="3" title="基本信息"> <el-descriptions :column="3" title="基本信息">
@ -20,40 +15,22 @@
</el-descriptions> </el-descriptions>
</el-card> </el-card>
</el-header> </el-header>
<el-main id="degInnerMain"> <el-main>
<el-container> <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;">工艺路线流程图</div> <div
<el-tabs style="font-weight: 600;color: #303133;font-size: 16px;padding: 10px 0;position: fixed;">
v-if="tabsTitle.length>1" 工艺路线流程图</div>
v-model="activeName" <el-tabs v-if="tabsTitle.length > 1" v-model="activeName" :tab-position="'left'"
:tab-position="'left'" style="flex-direction: row;" @tab-click="tabshandleClick">
style="flex-direction: row;"
@tab-click="tabshandleClick"
>
<el-tab-pane :label="item" v-for="item in tabsTitle" :key="item"></el-tab-pane> <el-tab-pane :label="item" v-for="item in tabsTitle" :key="item"></el-tab-pane>
</el-tabs> </el-tabs>
<scDegra <scDegra style="margin-top: 50px;" v-if="limitedWatch" ref="degraDialogs" :nodes="nodes"
style="margin-top: 50px;" :edges="edges" :rankdir="'DL'" @closeDialog="limitedWatch = false">
v-if="limitedWatch"
ref="degraDialogs"
:nodes="nodes"
:edges="edges"
:rankdir="'DL'"
@closeDialog="limitedWatch = false"
>
</scDegra> </scDegra>
</el-side> </el-aside>
<el-main> <el-main class="padding: 1px">
<scTable <scTable ref="tables" :data="tableData" row-key="id" hidePagination hideDo stripe border>
ref="tables"
:data="tableData"
row-key="id"
hidePagination
hideDo
stripe
border
>
<el-table-column label="排序" prop="sort" width="50"> <el-table-column label="排序" prop="sort" width="50">
</el-table-column> </el-table-column>
<el-table-column label="工序" prop="process_name"> <el-table-column label="工序" prop="process_name">
@ -81,17 +58,28 @@
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container>
</el-main> </el-main>
</el-container>
</el-main>
<el-aside width="20%" v-if="form.ticket">
<ticketd :ticketId="form.ticket"></ticketd>
</el-aside>
</el-container> </el-container>
</el-drawer>
</template> </template>
<script> <script>
import ticketd from '@/views/wf/ticketd.vue'
export default { export default {
emits: ["success", "closed"], emits: ["success", "closed"],
components: { ticketd },
props: {
modelId: { type: String, default: null },
},
data() { data() {
return { return {
loading: false, loading: false,
visible: false,
isSaveing: false, isSaveing: false,
state_: { state_: {
10: "创建中", 10: "创建中",
@ -103,7 +91,9 @@ export default {
10: "批次", 10: "批次",
20: "单个", 20: "单个",
}, },
form: {}, form: {
ticket: null
},
nodes: [], nodes: [],
edges: [], edges: [],
tabsTitle: ['总图'], tabsTitle: ['总图'],
@ -117,6 +107,9 @@ export default {
mounted() { mounted() {
this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code; this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code;
this.tableData = []; this.tableData = [];
if (this.modelId) {
this.getRoutePackDetail(this.modelId);
}
}, },
methods: { methods: {
// //
@ -132,6 +125,10 @@ export default {
that.getDEGdatas(data.id); that.getDEGdatas(data.id);
this.getTabsList(data.id); this.getTabsList(data.id);
}, },
async getRoutePackDetail(id) {
let res = await this.$API.mtm.routepack.item.req(id);
this.setData(res);
},
getDEGdatas(id) { getDEGdatas(id) {
let that = this; let that = this;
that.$API.mtm.routepack.dag.req(id).then((res) => { that.$API.mtm.routepack.dag.req(id).then((res) => {

View File

@ -185,11 +185,17 @@
@closed="saveClose" @closed="saveClose"
> >
</save-dialog> </save-dialog>
<show-dialog <el-drawer
v-if="dialog.show" v-model="dialog.show"
ref="showDialog" title="查看"
:size="'90%'"
destroy-on-close
@closed="dialog.show = false" @closed="dialog.show = false"
></show-dialog> :close-on-click-modal="false"
>
<show-dialog ref="showDialog"></show-dialog>
</el-drawer>
</template> </template>
<script> <script>
import saveDialog from "./routepack_form.vue"; import saveDialog from "./routepack_form.vue";

View File

@ -93,7 +93,7 @@
<!--工序!--> <!--工序!-->
<el-main class="nopadding" v-if="active === 1"> <el-main class="nopadding" v-if="active === 1">
<el-container> <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> <div style="font-weight: 600;color: #303133;font-size: 16px;padding: 10px 0;position: fixed;width: 30px;">工艺路线流程图</div>
<scDegra <scDegra
style="margin-top: 50px;" style="margin-top: 50px;"
@ -104,7 +104,7 @@
:rankdir="'DL'" :rankdir="'DL'"
> >
</scDegra> </scDegra>
</el-side> </el-aside>
<el-main style="width: 50%;overflow: scroll;"> <el-main style="width: 50%;overflow: scroll;">
<el-container> <el-container>
<el-header> <el-header>
@ -177,15 +177,8 @@
</el-main> </el-main>
<el-footer v-if="active === 1" style="text-align: center"> <el-footer v-if="active === 1" style="text-align: center">
<el-button @click="handleLastStep" style="margin-right: 4px">上一步</el-button> <el-button @click="handleLastStep" style="margin-right: 4px">上一步</el-button>
<el-button <ticketd_b_start :workflow_key="'routepack'" :title="form.name" :t_id="form.id"
v-for="item in initForm.transitions" @success="$emit('closed')"></ticketd_b_start>
: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="$emit('closed')" type="warning">退出</el-button>
</el-footer> </el-footer>
</el-container> </el-container>
@ -200,9 +193,10 @@
</template> </template>
<script> <script>
import saveDialog from "./route_form.vue"; import saveDialog from "./route_form.vue";
import ticketd_b_start from "@/views/wf/ticketd_b_start.vue";
export default { export default {
name: "routepack_form", name: "routepack_form",
components: { saveDialog }, components: { saveDialog, ticketd_b_start },
data() { data() {
return { return {
active: 0, active: 0,
@ -250,7 +244,7 @@ export default {
mounted() { mounted() {
this.isSaveing = false; this.isSaveing = false;
this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code; this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code;
this.getInit(); // this.getInit();
// this.getMaterials(); // this.getMaterials();
}, },
methods: { methods: {
@ -379,38 +373,6 @@ export default {
return err; 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() { handleSaveSuccess() {
console.log("handleSaveSuccess"); console.log("handleSaveSuccess");