|
|
@@ -1,72 +1,112 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-dialog
|
|
|
- title="工艺路线"
|
|
|
- :visible.sync="visible"
|
|
|
- :before-close="handleClose"
|
|
|
- :close-on-click-modal="false"
|
|
|
- :close-on-press-escape="false"
|
|
|
- append-to-body
|
|
|
- width="70%"
|
|
|
- >
|
|
|
- <el-tag type="warning" style="margin-bottom: 40px">{{
|
|
|
- routeObj.produceRoutingName
|
|
|
- }}</el-tag>
|
|
|
-
|
|
|
+ <el-dialog title="工艺路线" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
|
|
|
+ :close-on-press-escape="false" append-to-body width="70%">
|
|
|
+ <div class="routing_box">
|
|
|
+ 工艺路线: <span>{{ routeObj.produceRoutingName }}</span></div>
|
|
|
<div>
|
|
|
<el-steps :active="activeIndex" space="20px" align-center>
|
|
|
- <el-step
|
|
|
- v-for="(item, index) in routeList"
|
|
|
- :key="index"
|
|
|
- :title="item.taskTypeName"
|
|
|
- ></el-step>
|
|
|
+ <el-step v-for="(item, index) in routeList" :key="index" :title="item.taskTypeName"
|
|
|
+ @click.native="handIdx(index, item.taskId)" :description="desIndex == index ? '此处' : ''"></el-step>
|
|
|
</el-steps>
|
|
|
+
|
|
|
+
|
|
|
+ <el-tabs type="border-card">
|
|
|
+ <el-tab-pane label="投料详情">
|
|
|
+ <feedDetails :routeObj="routeObj" :curTaskId="curTaskId"></feedDetails>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="报工详情"></el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+
|
|
|
+
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
- import { getTaskInstanceList } from '@/api/produce/job';
|
|
|
- export default {
|
|
|
- props: {
|
|
|
- routeObj: {
|
|
|
- type: Object,
|
|
|
- default() {
|
|
|
- return {};
|
|
|
- }
|
|
|
+import { getTaskInstanceList } from '@/api/produce/job';
|
|
|
+import feedDetails from '../components/feeding/details.vue'
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ feedDetails
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ routeObj: {
|
|
|
+ type: Object,
|
|
|
+ default() {
|
|
|
+ return {};
|
|
|
}
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- visible: true,
|
|
|
- routeList: [],
|
|
|
- activeIndex: 0
|
|
|
- };
|
|
|
- },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ visible: true,
|
|
|
+ routeList: [],
|
|
|
+ activeIndex: 0,
|
|
|
+ desIndex: 0,
|
|
|
+ curTaskId: null
|
|
|
+ };
|
|
|
+ },
|
|
|
|
|
|
- methods: {
|
|
|
- getTaskFn() {
|
|
|
- getTaskInstanceList(this.routeObj.id).then((res) => {
|
|
|
- this.routeList = res;
|
|
|
+ methods: {
|
|
|
+ getTaskFn() {
|
|
|
+ getTaskInstanceList(this.routeObj.id).then((res) => {
|
|
|
+ this.routeList = res;
|
|
|
|
|
|
- // 使用findIndex方法查找
|
|
|
- const index = this.routeList.findIndex(
|
|
|
- (item) => Number(item.taskId) == Number(this.routeObj.taskId)
|
|
|
- );
|
|
|
- this.activeIndex = index;
|
|
|
- });
|
|
|
- },
|
|
|
+ // 使用findIndex方法查找
|
|
|
+ const index = this.routeList.findIndex(
|
|
|
+ (item) => Number(item.taskId) == Number(this.routeObj.taskId)
|
|
|
+ );
|
|
|
|
|
|
- handleClose() {
|
|
|
- this.activeIndex = 0;
|
|
|
- this.$emit('closeRoute');
|
|
|
- }
|
|
|
+
|
|
|
+ this.desIndex = index;
|
|
|
+
|
|
|
+ if( this.routeObj.taskId != -2) {
|
|
|
+ this.curTaskId = this.routeObj.taskId
|
|
|
+ } else {
|
|
|
+ this.curTaskId = this.routeList[0].taskId
|
|
|
+ this.desIndex = 0;
|
|
|
+ }
|
|
|
+ this.activeIndex = index;
|
|
|
+
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ handleClose() {
|
|
|
+ this.activeIndex = 0;
|
|
|
+ this.$emit('closeRoute');
|
|
|
},
|
|
|
|
|
|
- created() {
|
|
|
- this.getTaskFn();
|
|
|
+ handIdx(index,taskId) {
|
|
|
+ this.curTaskId = taskId;
|
|
|
+ if(taskId == -2) {
|
|
|
+ this.$message.info('完结状态不能点击')
|
|
|
+ } else {
|
|
|
+ this.desIndex = index;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- };
|
|
|
+ },
|
|
|
+
|
|
|
+ created() {
|
|
|
+ this.getTaskFn();
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped></style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+::v-deep .el-step__icon {
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.routing_box {
|
|
|
+ margin-bottom: 20px;
|
|
|
+ margin-left: 20px;
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ span {
|
|
|
+ color: #157a2c;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|