|
|
@@ -2,25 +2,12 @@
|
|
|
<div class="ele-body">
|
|
|
<el-card shadow="never">
|
|
|
<!-- 数据表格 -->
|
|
|
-
|
|
|
- <ele-pro-table
|
|
|
- ref="table"
|
|
|
- :columns="columns"
|
|
|
- :datasource="datasource"
|
|
|
- :selection.sync="selection"
|
|
|
- row-key="id"
|
|
|
- >
|
|
|
+
|
|
|
+ <ele-pro-table ref="table" :columns="columns" :datasource="datasource" :selection.sync="selection" row-key="id">
|
|
|
<!-- 表头工具栏 -->
|
|
|
<template v-slot:toolbar>
|
|
|
- <el-button
|
|
|
- v-if="attributeData.status != 1"
|
|
|
- size="small"
|
|
|
- type="primary"
|
|
|
- icon="el-icon-plus"
|
|
|
- class="ele-btn-icon"
|
|
|
- @click="add"
|
|
|
- >新增</el-button
|
|
|
- >
|
|
|
+ <el-button v-if="attributeData.status != 1" size="small" type="primary" icon="el-icon-plus"
|
|
|
+ class="ele-btn-icon" @click="add">新增</el-button>
|
|
|
</template>
|
|
|
<!-- 状态列 -->
|
|
|
<template v-slot:status="{ row }">
|
|
|
@@ -28,11 +15,11 @@
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:routeType="{ row }">
|
|
|
- {{ row.routeType == 2 ? '委外' : row.routeType == 1 ? '生产' : row.routeType == 3 ? '质检' : ''}}
|
|
|
+ {{ row.routeType == 2 ? '委外' : row.routeType == 1 ? '生产' : row.routeType == 3 ? '质检' : '' }}
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:action="{ row, $index }">
|
|
|
- <el-link type="danger" @click="handleDel(row)" v-if="attributeData.status != 1">删除</el-link>
|
|
|
+ <el-link type="danger" @click="handleDel(row)" v-if="attributeData.status != 1">删除</el-link>
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
</el-card>
|
|
|
@@ -41,163 +28,185 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { getMbomPage } from '@/api/material/BOM';
|
|
|
- import routingDialog from './routingDialog.vue';
|
|
|
-
|
|
|
- import { workingProcedureUpdate } from '@/api/material/BOM';
|
|
|
- export default {
|
|
|
- name: 'technologyRoute',
|
|
|
- components: {
|
|
|
- routingDialog
|
|
|
- },
|
|
|
- props: {
|
|
|
- taskParam: Object,
|
|
|
+import { getMbomPage } from '@/api/material/BOM';
|
|
|
+import routingDialog from './routingDialog.vue';
|
|
|
+import route from '@/api/technology/route';
|
|
|
|
|
|
- attributeData: {
|
|
|
- type: Object,
|
|
|
- default: {}
|
|
|
- },
|
|
|
+import { workingProcedureUpdate } from '@/api/material/BOM';
|
|
|
+export default {
|
|
|
+ name: 'technologyRoute',
|
|
|
+ components: {
|
|
|
+ routingDialog
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ taskParam: Object,
|
|
|
|
|
|
+ attributeData: {
|
|
|
+ type: Object,
|
|
|
+ default: {}
|
|
|
},
|
|
|
- watch: {
|
|
|
- attributeData: {
|
|
|
- handler(val) {
|
|
|
- this.$nextTick(() => {
|
|
|
+
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ attributeData: {
|
|
|
+ handler(val) {
|
|
|
+ this.$nextTick(() => {
|
|
|
this.reload()
|
|
|
- })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tableData: [],
|
|
|
+ selection: [],
|
|
|
+ versionList: [],
|
|
|
+ where: {},
|
|
|
+ // 表格列配置
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ prop: 'code',
|
|
|
+ label: '工艺路线组编码',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110,
|
|
|
+ slot: 'code'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '工艺路线名称',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'version',
|
|
|
+ label: '工艺路线版本',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'produceVersionName',
|
|
|
+ label: '生产版本',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
},
|
|
|
- deep: true,
|
|
|
- immediate: true
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'status',
|
|
|
+ label: '状态',
|
|
|
+ align: 'center',
|
|
|
+ slot: 'status',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ slot: 'routeType',
|
|
|
+ label: '类型',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'action',
|
|
|
+ label: '操作',
|
|
|
+ align: 'center',
|
|
|
+ slot: 'action'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+
|
|
|
+ // 表格选中数据
|
|
|
+ selection: [],
|
|
|
+ // 当前编辑数据
|
|
|
+ current: null,
|
|
|
+ // 是否显示编辑弹窗
|
|
|
+ showEdit: false,
|
|
|
+ detailEdit: false,
|
|
|
+
|
|
|
+ statusList: [
|
|
|
+ { label: '草稿', value: -1 },
|
|
|
+ { label: '失效', value: 0 },
|
|
|
+ { label: '生效', value: 1 }
|
|
|
+ ],
|
|
|
+ loading: false
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ add() {
|
|
|
+
|
|
|
+ console.log(this.taskParam, this.tableData);
|
|
|
+
|
|
|
+ this.$refs.routingDialogRef.open(this.taskParam, this.tableData);
|
|
|
+ },
|
|
|
+ search(e) {
|
|
|
+
|
|
|
+
|
|
|
+ this.reload(this.where);
|
|
|
+ },
|
|
|
+ /* 表格数据源 */
|
|
|
+ async datasource({ page, limit, where }) {
|
|
|
+ let data = await getMbomPage({
|
|
|
+ ...where,
|
|
|
+ bomCategoryId: this.taskParam.id,
|
|
|
+ pageNum: page,
|
|
|
+ size: limit
|
|
|
+ });
|
|
|
+ if (data?.length > 0) {
|
|
|
+ this.tableData = data[0];
|
|
|
+ return data[0].processRoute.list || [];
|
|
|
+ } else {
|
|
|
+ this.tableData = {};
|
|
|
+ return [];
|
|
|
}
|
|
|
},
|
|
|
- data() {
|
|
|
- return {
|
|
|
- tableData: [],
|
|
|
- selection: [],
|
|
|
- versionList: [],
|
|
|
- where: {},
|
|
|
- // 表格列配置
|
|
|
- columns: [
|
|
|
- {
|
|
|
- prop: 'code',
|
|
|
- label: '工艺路线组编码',
|
|
|
- showOverflowTooltip: true,
|
|
|
- align: 'center',
|
|
|
- minWidth: 110,
|
|
|
- slot: 'code'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'name',
|
|
|
- label: '工艺路线名称',
|
|
|
- showOverflowTooltip: true,
|
|
|
- align: 'center',
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
|
|
|
- {
|
|
|
- prop: 'version',
|
|
|
- label: '工艺路线版本',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
+ handleDel(row) {
|
|
|
|
|
|
- {
|
|
|
- prop: 'produceVersionName',
|
|
|
- label: '生产版本',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
- },
|
|
|
+ // route.getProcessById([row.id]).then((data) => {
|
|
|
|
|
|
- {
|
|
|
- prop: 'status',
|
|
|
- label: '状态',
|
|
|
- align: 'center',
|
|
|
- slot: 'status',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
|
|
|
- {
|
|
|
- slot: 'routeType',
|
|
|
- label: '类型',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'action',
|
|
|
- label: '操作',
|
|
|
- align: 'center',
|
|
|
- slot: 'action'
|
|
|
- }
|
|
|
- ],
|
|
|
-
|
|
|
- // 表格选中数据
|
|
|
- selection: [],
|
|
|
- // 当前编辑数据
|
|
|
- current: null,
|
|
|
- // 是否显示编辑弹窗
|
|
|
- showEdit: false,
|
|
|
- detailEdit: false,
|
|
|
-
|
|
|
- statusList: [
|
|
|
- { label: '草稿', value: -1 },
|
|
|
- { label: '失效', value: 0 },
|
|
|
- { label: '生效', value: 1 }
|
|
|
- ],
|
|
|
- loading: false
|
|
|
- };
|
|
|
- },
|
|
|
- methods: {
|
|
|
- add() {
|
|
|
-
|
|
|
- this.$refs.routingDialogRef.open(this.taskParam, this.tableData);
|
|
|
- },
|
|
|
- search() {
|
|
|
- this.reload(this.where);
|
|
|
- },
|
|
|
- /* 表格数据源 */
|
|
|
- async datasource({ page, limit, where }) {
|
|
|
- let data = await getMbomPage({
|
|
|
- ...where,
|
|
|
- bomCategoryId: this.taskParam.id,
|
|
|
- pageNum: page,
|
|
|
- size: limit
|
|
|
- });
|
|
|
- if (data?.length > 0) {
|
|
|
- this.tableData = data[0];
|
|
|
- return data[0].processRoute.list || [];
|
|
|
- } else {
|
|
|
- this.tableData = {};
|
|
|
- return [];
|
|
|
- }
|
|
|
- },
|
|
|
+ // })
|
|
|
|
|
|
- handleDel(row) {
|
|
|
|
|
|
+ // console.log(row,'41444444',this.tableData.processRoute.list);
|
|
|
+ // return
|
|
|
+ this.$confirm('是否删除?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
workingProcedureUpdate({
|
|
|
id: this.tableData.id,
|
|
|
categoryId: this.taskParam.categoryId,
|
|
|
bomCategoryId: this.taskParam.id,
|
|
|
categoryCode: this.taskParam.categoryCode,
|
|
|
+ isRouting:1,
|
|
|
processRoute: {
|
|
|
list: this.tableData.processRoute.list.filter(
|
|
|
(item) => item.id !== row.id
|
|
|
)
|
|
|
- }
|
|
|
+ },
|
|
|
}).then((data) => {
|
|
|
this.$message.success('删除成功');
|
|
|
this.reload();
|
|
|
});
|
|
|
- },
|
|
|
- checkStatus(row) {
|
|
|
- let obj = this.statusList.find((it) => it.value == row.status);
|
|
|
- return obj.label;
|
|
|
- },
|
|
|
- /* 刷新表格 */
|
|
|
- reload(where) {
|
|
|
- this.$refs.table.reload({ page: 1, where: where });
|
|
|
- }
|
|
|
+ })
|
|
|
+ .catch(() => console.info("操作取消"));
|
|
|
+ },
|
|
|
+ checkStatus(row) {
|
|
|
+ let obj = this.statusList.find((it) => it.value == row.status);
|
|
|
+ return obj.label;
|
|
|
+ },
|
|
|
+ /* 刷新表格 */
|
|
|
+ reload(where) {
|
|
|
+
|
|
|
+ this.$refs.table.reload({ page: 1, where: where });
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|