|
|
@@ -92,7 +92,15 @@
|
|
|
{{ row.name }}
|
|
|
</el-link>
|
|
|
<span v-else> {{ row.name }}</span> -->
|
|
|
- {{ row.name }}
|
|
|
+ <el-link type="primary" :underline="false" @click="openDetail(row)">
|
|
|
+ {{ row.name }}
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:code="{ row }">
|
|
|
+ <el-link type="primary" :underline="false" @click="openDetail(row)">
|
|
|
+ {{ row.code }}
|
|
|
+ </el-link>
|
|
|
</template>
|
|
|
<!-- 状态列 -->
|
|
|
|
|
|
@@ -102,8 +110,13 @@
|
|
|
|
|
|
<template v-slot:processLabel="{ row }">
|
|
|
<el-tag v-if="row.processLabel == 1">自制</el-tag>
|
|
|
- <el-tag v-if="row.processLabel == 2">委外</el-tag>
|
|
|
- <el-tag v-if="row.processLabel == 3">请托</el-tag>
|
|
|
+ <el-tag v-if="row.processLabel == 2" type="success">委外</el-tag>
|
|
|
+ <el-tag v-if="row.processLabel == 3" type="warning">请托</el-tag>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:isRelease="{ row }">
|
|
|
+ <el-tag v-if="row.isRelease == 1" type="success">已发布</el-tag>
|
|
|
+ <el-tag v-else type="info">未发布</el-tag>
|
|
|
</template>
|
|
|
|
|
|
<!-- 操作列 -->
|
|
|
@@ -111,9 +124,10 @@
|
|
|
<el-link
|
|
|
type="primary"
|
|
|
:underline="false"
|
|
|
- icon="el-icon-edit"
|
|
|
@click="openEdit(row)"
|
|
|
- v-if="$hasPermission('main:producetask:update')"
|
|
|
+ v-if="
|
|
|
+ $hasPermission('main:producetask:update') && row.isRelease != 1
|
|
|
+ "
|
|
|
>
|
|
|
修改
|
|
|
</el-link>
|
|
|
@@ -130,24 +144,39 @@
|
|
|
class="ele-action"
|
|
|
title="确定要删除当前工序吗?"
|
|
|
@confirm="remove(row)"
|
|
|
- v-if="$hasPermission('main:producetask:delete')"
|
|
|
+ v-if="
|
|
|
+ $hasPermission('main:producetask:delete') && row.isRelease != 1
|
|
|
+ "
|
|
|
>
|
|
|
<template v-slot:reference>
|
|
|
- <el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
- 删除
|
|
|
- </el-link>
|
|
|
+ <el-link type="danger" :underline="false"> 删除 </el-link>
|
|
|
</template>
|
|
|
</el-popconfirm>
|
|
|
|
|
|
<el-link
|
|
|
type="primary"
|
|
|
:underline="false"
|
|
|
- icon="el-icon-setting"
|
|
|
@click="openSettingMatterProcess(row)"
|
|
|
- v-if="$hasPermission('main:produce_task:config_item')"
|
|
|
+ v-if="
|
|
|
+ $hasPermission('main:produce_task:config_item') &&
|
|
|
+ row.isRelease != 1
|
|
|
+ "
|
|
|
>
|
|
|
配置
|
|
|
</el-link>
|
|
|
+
|
|
|
+ <el-popconfirm
|
|
|
+ class="ele-action"
|
|
|
+ title="确定要发布当前工序吗?"
|
|
|
+ @confirm="release(row)"
|
|
|
+ v-if="
|
|
|
+ $hasPermission('main:producetask:update') && row.isRelease != 1
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <template v-slot:reference>
|
|
|
+ <el-link type="primary" :underline="false"> 发布 </el-link>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
</el-card>
|
|
|
@@ -160,6 +189,7 @@
|
|
|
@done="reload"
|
|
|
ref="userEdit"
|
|
|
:typeList="typeList"
|
|
|
+ :detail="showDetail"
|
|
|
/>
|
|
|
|
|
|
<!-- 配置工艺参数 -->
|
|
|
@@ -244,10 +274,12 @@
|
|
|
{
|
|
|
prop: 'sort',
|
|
|
label: '排序',
|
|
|
- align: 'center'
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 40
|
|
|
},
|
|
|
{
|
|
|
prop: 'code',
|
|
|
+ slot: 'code',
|
|
|
label: '工序编码',
|
|
|
// sortable: 'custom',
|
|
|
showOverflowTooltip: true,
|
|
|
@@ -283,7 +315,15 @@
|
|
|
slot: 'processLabel',
|
|
|
label: '工序标签',
|
|
|
showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
+ minWidth: 100
|
|
|
+ },
|
|
|
+ {
|
|
|
+ align: 'center',
|
|
|
+ prop: 'isRelease',
|
|
|
+ slot: 'isRelease',
|
|
|
+ label: '是否发布',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 100
|
|
|
},
|
|
|
{
|
|
|
align: 'center',
|
|
|
@@ -291,7 +331,7 @@
|
|
|
slot: 'version',
|
|
|
label: '版本',
|
|
|
showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
+ minWidth: 80
|
|
|
},
|
|
|
{
|
|
|
align: 'center',
|
|
|
@@ -330,6 +370,7 @@
|
|
|
current: null,
|
|
|
// 是否显示编辑弹窗
|
|
|
showEdit: false,
|
|
|
+ showDetail: false,
|
|
|
// 是否显示参数弹窗
|
|
|
showSetting: false,
|
|
|
controlList: [],
|
|
|
@@ -501,6 +542,10 @@
|
|
|
this.$message.error('请至少选择一条数据');
|
|
|
return;
|
|
|
}
|
|
|
+ if (this.selection.some((item) => item.isRelease == 1)) {
|
|
|
+ this.$message.warning('已发布的工序不能批量设置工作中心');
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.$refs.centerRefs.open(this.selection[0]);
|
|
|
},
|
|
|
|
|
|
@@ -509,13 +554,32 @@
|
|
|
this.$refs.table.reload({ page: 1, where: where });
|
|
|
},
|
|
|
/* 打开编辑弹窗 */
|
|
|
- openEdit(row) {
|
|
|
+ openEdit(row, detail = false) {
|
|
|
this.getControlList();
|
|
|
this.current = row;
|
|
|
+ this.showDetail = detail;
|
|
|
this.showEdit = true;
|
|
|
this.$refs.userEdit.$refs.form &&
|
|
|
this.$refs.userEdit.$refs.form.clearValidate();
|
|
|
},
|
|
|
+ openDetail(row) {
|
|
|
+ this.openEdit(row, true);
|
|
|
+ },
|
|
|
+
|
|
|
+ async release(row) {
|
|
|
+ const loading = this.$loading({ lock: true });
|
|
|
+ try {
|
|
|
+ const detail = await producetask.getById(row.id);
|
|
|
+ await producetask.save({
|
|
|
+ ...detail,
|
|
|
+ isRelease: 1
|
|
|
+ });
|
|
|
+ this.$message.success('发布成功');
|
|
|
+ this.reload();
|
|
|
+ } finally {
|
|
|
+ loading.close();
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
determineChoose(row) {
|
|
|
if (row) {
|
|
|
@@ -612,6 +676,10 @@
|
|
|
this.$message.error('请至少选择一条数据');
|
|
|
return;
|
|
|
}
|
|
|
+ if (this.selection.some((item) => item.isRelease == 1)) {
|
|
|
+ this.$message.warning('已发布的工序不能删除');
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.$confirm('确定要删除选中的工序吗?', '提示', {
|
|
|
type: 'warning'
|
|
|
})
|