|
|
@@ -1,9 +1,8 @@
|
|
|
<!-- 用户编辑弹窗 -->
|
|
|
<template>
|
|
|
- <ele-modal width="1060px" :visible="visible" :append-to-body="true" :close-on-click-modal="true"
|
|
|
- custom-class="ele-dialog-form" :title="`给工序【${this.data?.code}${this.data?.name}】配置工序`"
|
|
|
- @update:visible="updateVisible">
|
|
|
+ <div>
|
|
|
<div class="ele-body">
|
|
|
+
|
|
|
<ele-pro-table ref="table" :needPage="false" :columns="columns" :datasource="datasource" row-key="id">
|
|
|
<!-- 表头工具栏 -->
|
|
|
<template v-slot:toolbar>
|
|
|
@@ -12,17 +11,19 @@
|
|
|
</el-button>
|
|
|
</template>
|
|
|
|
|
|
- <!-- 状态列 -->
|
|
|
+ <template v-slot:sort="{ row }">
|
|
|
+ <el-input v-model.number="row.sort" placeholder="请输入排序"></el-input>
|
|
|
+ </template>
|
|
|
|
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="{ row }">
|
|
|
<el-link type="primary" :underline="false" icon="el-icon-edit" @click="openEdit(row)">
|
|
|
修改
|
|
|
</el-link>
|
|
|
- <el-link :type="row.id ? 'primary' : 'info'" :underline="false" icon="el-icon-setting"
|
|
|
+ <!-- <el-link :type="row.id ? 'primary' : 'info'" :underline="false" icon="el-icon-setting"
|
|
|
@click="openSetting(row)">
|
|
|
配置工艺参数
|
|
|
- </el-link>
|
|
|
+ </el-link> -->
|
|
|
<el-popconfirm class="ele-action" title="删除数据操作立即生效!!!确定要删除当前工序吗?" @confirm="remove(row)">
|
|
|
<template v-slot:reference>
|
|
|
<el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
@@ -32,17 +33,21 @@
|
|
|
</el-popconfirm>
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
+
|
|
|
+ <div class="btn_box rx-bc">
|
|
|
+ <el-select v-model="versionUpgradeType" placeholder="请选择">
|
|
|
+ <el-option label="不升级" :value="0" />
|
|
|
+ <el-option label="小版本" :value="1" />
|
|
|
+ <el-option label="大版本" :value="2" />
|
|
|
+ </el-select>
|
|
|
+ <el-button type="primary" @click="save">
|
|
|
+ 确定
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
</div>
|
|
|
|
|
|
- <template v-slot:footer>
|
|
|
- <el-button @click="updateVisible(false)">取消</el-button>
|
|
|
- <el-button type="primary" :loading="loading" @click="save(false)">
|
|
|
- 保存
|
|
|
- </el-button>
|
|
|
- <el-button type="primary" :loading="loading" @click="save(true)">
|
|
|
- 保存并关闭
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
+
|
|
|
<ele-modal width="1720px" :visible="addDialog" :append-to-body="true" :close-on-click-modal="true"
|
|
|
@update:visible="closeAdd">
|
|
|
<Production :data="tableData" ref="ProductionCom" />
|
|
|
@@ -57,7 +62,7 @@
|
|
|
<user-edit :visible.sync="showEdit" :controlList="controlList" :data="current" @done="reload" ref="userEdit" />
|
|
|
<!-- 配置工艺参数 -->
|
|
|
<user-setting :visible.sync="showSetting" :data="current" ref="userSetting" />
|
|
|
- </ele-modal>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
@@ -69,10 +74,9 @@ import control from '@/api/technology/control';
|
|
|
export default {
|
|
|
components: { Production, UserEdit, UserSetting },
|
|
|
props: {
|
|
|
- // 弹窗是否打开
|
|
|
- visible: Boolean,
|
|
|
+
|
|
|
// 修改回显的数据
|
|
|
- data: Object
|
|
|
+ taskInfo: Object
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -82,15 +86,24 @@ export default {
|
|
|
],
|
|
|
// 表格列配置
|
|
|
columns: [
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'sort',
|
|
|
+ label: '排序',
|
|
|
+ align: 'center',
|
|
|
+ slot: 'sort',
|
|
|
+ minWidth: 160
|
|
|
+ },
|
|
|
{
|
|
|
prop: 'code',
|
|
|
label: '工序编码',
|
|
|
// sortable: 'custom',
|
|
|
showOverflowTooltip: true,
|
|
|
align: 'center',
|
|
|
-
|
|
|
minWidth: 110
|
|
|
},
|
|
|
+
|
|
|
+
|
|
|
{
|
|
|
prop: 'name',
|
|
|
label: '工序名称',
|
|
|
@@ -131,7 +144,10 @@ export default {
|
|
|
current: {},
|
|
|
removeList: [],
|
|
|
tableData: [],
|
|
|
- controlList: []
|
|
|
+ controlList: [],
|
|
|
+
|
|
|
+ visible: true,
|
|
|
+ versionUpgradeType: 0
|
|
|
};
|
|
|
},
|
|
|
|
|
|
@@ -156,9 +172,7 @@ export default {
|
|
|
showAddLog() {
|
|
|
this.tableData = this.$refs.table.getData();
|
|
|
this.addDialog = true;
|
|
|
- // this.$nextTick(() => {
|
|
|
- // this.$refs.ProductionCom.reload();
|
|
|
- // });
|
|
|
+
|
|
|
},
|
|
|
/* 打开编辑弹窗 */
|
|
|
openEdit(row) {
|
|
|
@@ -170,9 +184,6 @@ export default {
|
|
|
},
|
|
|
|
|
|
getControlList() {
|
|
|
- const params = {
|
|
|
- pageNum: 1, size: -1
|
|
|
- }
|
|
|
control.list().then(res => {
|
|
|
this.controlList = res.list
|
|
|
})
|
|
|
@@ -210,10 +221,9 @@ export default {
|
|
|
},
|
|
|
/* 表格数据源 */
|
|
|
async datasource({ page, limit, where }) {
|
|
|
- if (this.data?.id) {
|
|
|
- console.log(22222);
|
|
|
+ if (this.taskInfo?.id) {
|
|
|
const res = await route.taskinstanceList({
|
|
|
- routingId: this.data.id,
|
|
|
+ routingId: this.taskInfo.id,
|
|
|
isDetail: true,
|
|
|
pageNum: 1,
|
|
|
size: -1
|
|
|
@@ -226,7 +236,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
/* 保存编辑 */
|
|
|
- save(isClose) {
|
|
|
+ save() {
|
|
|
let arr = this.$refs.table.getData();
|
|
|
if (arr.length == 0) {
|
|
|
this.$message.warning('至少配置一条工序才能保存');
|
|
|
@@ -244,66 +254,19 @@ export default {
|
|
|
|
|
|
route
|
|
|
.taskinstanceSave({
|
|
|
- routingId: this.data.id,
|
|
|
+ routingId: this.taskInfo.id,
|
|
|
+ versionUpgradeType: this.versionUpgradeType,
|
|
|
taskInstanceList: arr1
|
|
|
})
|
|
|
.then((res) => {
|
|
|
if (res) {
|
|
|
this.$message.success('保存成功!');
|
|
|
- if (isClose) {
|
|
|
- this.updateVisible(false);
|
|
|
- } else {
|
|
|
- this.reload();
|
|
|
- }
|
|
|
+ this.$emit('refresh')
|
|
|
}
|
|
|
});
|
|
|
- // arr.forEach((it) => {
|
|
|
- // if (!it.taskId) {
|
|
|
- // this.$set(it, 'taskId', this.data.id);
|
|
|
- // }
|
|
|
- // });
|
|
|
- // producetask
|
|
|
- // .paramSave({
|
|
|
- // removeList: this.removeList,
|
|
|
- // saveList: arr
|
|
|
- // })
|
|
|
- // .then(() => {
|
|
|
- // this.$message.success('保存成功!');
|
|
|
- // this.updateVisible(false);
|
|
|
- // });
|
|
|
-
|
|
|
- // this.$refs.form.validate((valid) => {
|
|
|
- // if (!valid) {
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // if (!this.isUpdate) {
|
|
|
- // delete this.form.id;
|
|
|
- // }
|
|
|
-
|
|
|
- // this.form.workBeat.beatTimes = this.totalTime;
|
|
|
|
|
|
- // this.loading = true;
|
|
|
- // producetask
|
|
|
- // .save(this.form)
|
|
|
- // .then((msg) => {
|
|
|
- // this.form = {};
|
|
|
- // this.loading = false;
|
|
|
- // this.$message.success(msg);
|
|
|
- // this.updateVisible(false);
|
|
|
- // this.$emit('done');
|
|
|
- // })
|
|
|
- // .catch((e) => {
|
|
|
- // this.loading = false;
|
|
|
- // // this.$message.error(e.message);
|
|
|
- // });
|
|
|
- // });
|
|
|
},
|
|
|
- /* 更新visible */
|
|
|
- updateVisible(value) {
|
|
|
- this.removeList = [];
|
|
|
- this.$refs.table.setData([]);
|
|
|
- this.$emit('update:visible', value);
|
|
|
- }
|
|
|
+
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
@@ -317,3 +280,13 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.btn_box {
|
|
|
+ width: 100%;
|
|
|
+ margin-top: 10px;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+</style>
|