|
|
@@ -10,18 +10,30 @@
|
|
|
<el-row type="flex" :gutter="24">
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="工序编码:" label-width="100px">
|
|
|
- <el-input clearable v-model.trim="where.code" placeholder="请输入" />
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model.trim="where.code"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="工序名称:" label-width="100px">
|
|
|
- <el-input clearable v-model.trim="where.name" placeholder="请输入" />
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model.trim="where.name"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="所属工作中心" label-width="100px">
|
|
|
- <el-input clearable v-model.trim="where.workCenterName" placeholder="请输入" />
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model.trim="where.workCenterName"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="4">
|
|
|
@@ -45,7 +57,6 @@
|
|
|
ref="table"
|
|
|
:columns="columns"
|
|
|
:datasource="datasource"
|
|
|
-
|
|
|
:need-page="false"
|
|
|
row-key="id"
|
|
|
>
|
|
|
@@ -79,11 +90,14 @@
|
|
|
:key="row.code + '-' + $index"
|
|
|
>
|
|
|
<template v-slot:sort="{ row }">
|
|
|
- <el-input v-model="row.sort"></el-input>
|
|
|
+ <el-input
|
|
|
+ @input="(e) => validateNumber(e, row)"
|
|
|
+ v-model.number="row.sort"
|
|
|
+ ></el-input>
|
|
|
</template>
|
|
|
|
|
|
<!-- 默认值 -->
|
|
|
- <template v-slot:defaultValue="{ row }">
|
|
|
+ <!-- <template v-slot:defaultValue="{ row }">
|
|
|
<el-input
|
|
|
v-if="
|
|
|
row.textType == 1 || row.textType == 4 || row.textType == 5
|
|
|
@@ -99,17 +113,33 @@
|
|
|
<el-option label="TRUE" :value="'TRUE'" />
|
|
|
<el-option label="FALSE" :value="'FALSE'" />
|
|
|
</el-select>
|
|
|
+ </template> -->
|
|
|
+ <template v-slot:name="{ row }">
|
|
|
+ <el-input v-model="row.name" placeholder="请输入"></el-input>
|
|
|
+ </template>
|
|
|
+ <template v-slot:defaultValue="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-model="row.defaultValue"
|
|
|
+ placeholder="请输入"
|
|
|
+ ></el-input>
|
|
|
</template>
|
|
|
-
|
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="{ row }">
|
|
|
- <el-link
|
|
|
+ <!-- <el-link
|
|
|
type="primary"
|
|
|
:underline="false"
|
|
|
icon="el-icon-edit"
|
|
|
@click="editWorkingStep(row)"
|
|
|
>
|
|
|
修改
|
|
|
+ </el-link> -->
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ :underline="false"
|
|
|
+ icon="el-icon-house"
|
|
|
+ @click="saveWorking(row)"
|
|
|
+ >
|
|
|
+ 保存
|
|
|
</el-link>
|
|
|
<el-link
|
|
|
type="primary"
|
|
|
@@ -134,7 +164,6 @@
|
|
|
>
|
|
|
<template v-slot:reference>
|
|
|
<el-link
|
|
|
-
|
|
|
type="danger"
|
|
|
:underline="false"
|
|
|
icon="el-icon-delete"
|
|
|
@@ -149,7 +178,7 @@
|
|
|
</template>
|
|
|
|
|
|
<!-- 操作列 -->
|
|
|
- <template v-slot:action="{ row }" >
|
|
|
+ <template v-slot:action="{ row }">
|
|
|
<el-link
|
|
|
type="primary"
|
|
|
:underline="false"
|
|
|
@@ -222,7 +251,8 @@
|
|
|
import {
|
|
|
workingProcedureUpdate,
|
|
|
getStepListById,
|
|
|
- workingStepSave
|
|
|
+ workingStepSave,
|
|
|
+ workingSingleUpdate
|
|
|
} from '@/api/material/BOM';
|
|
|
import ProcessModal from './processModal.vue';
|
|
|
import ParamModal from './ParamModal.vue';
|
|
|
@@ -240,21 +270,21 @@
|
|
|
workingStep
|
|
|
},
|
|
|
props: {
|
|
|
- resourceBomId: Number,
|
|
|
+ resourceBomId: String,
|
|
|
|
|
|
taskParam: Object,
|
|
|
attributeData: {
|
|
|
type: Object,
|
|
|
default: {}
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
attributeData: {
|
|
|
handler(val) {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.reload()
|
|
|
- })
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.reload();
|
|
|
+ });
|
|
|
},
|
|
|
deep: true,
|
|
|
immediate: true
|
|
|
@@ -330,21 +360,23 @@
|
|
|
},
|
|
|
{
|
|
|
prop: 'code',
|
|
|
- label: '工步类型',
|
|
|
+ label: '工步编码',
|
|
|
showOverflowTooltip: true,
|
|
|
align: 'center',
|
|
|
minWidth: 110
|
|
|
},
|
|
|
{
|
|
|
prop: 'name',
|
|
|
- label: '工步编码',
|
|
|
+ slot: 'name',
|
|
|
+ label: '工步名称',
|
|
|
showOverflowTooltip: true,
|
|
|
align: 'center',
|
|
|
minWidth: 110
|
|
|
},
|
|
|
{
|
|
|
- prop: 'name',
|
|
|
- label: '工序名称',
|
|
|
+ slot: 'defaultValue',
|
|
|
+ prop: 'defaultValue',
|
|
|
+ label: '工序内容',
|
|
|
showOverflowTooltip: true,
|
|
|
align: 'center',
|
|
|
minWidth: 110
|
|
|
@@ -378,6 +410,46 @@
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 单个工步数据保存
|
|
|
+ saveWorking(row) {
|
|
|
+ if (!row.name) {
|
|
|
+ this.$message.warning('请输入工步名称');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!row.sort) {
|
|
|
+ this.$message.warning('请输入工步排序');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let data = {
|
|
|
+ stepName: row.name,
|
|
|
+ id: row.id,
|
|
|
+ defaultValue: row.defaultValue,
|
|
|
+ sort: row.sort
|
|
|
+ };
|
|
|
+ workingSingleUpdate(data)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data) {
|
|
|
+ this.$message.success('保存成功');
|
|
|
+ }else{
|
|
|
+ this.$message.error('保存失败');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err, 'err');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ validateNumber(e, row) {
|
|
|
+ if (e == 0) {
|
|
|
+ row.sort = '';
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let value = '';
|
|
|
+ value = e.replace(/[^\d]/g, '');
|
|
|
+ if (value.startsWith('0') && value.length > 1) {
|
|
|
+ value = value.replace(/^0+/, '');
|
|
|
+ }
|
|
|
+ row.sort = value;
|
|
|
+ },
|
|
|
// expandChange(row, rows) {
|
|
|
// if (rows.length > 0) {
|
|
|
// // 展开
|
|
|
@@ -454,7 +526,6 @@
|
|
|
this.$refs.table.reload({ where });
|
|
|
},
|
|
|
chooseProcess(data) {
|
|
|
-
|
|
|
// let _arr = [...data, ...this.$refs.table.getData()];
|
|
|
// this.$refs.table.setData([...data, ...this.$refs.table.getData()]);
|
|
|
// this.$emit('chooseProcess', _arr);
|
|
|
@@ -503,15 +574,16 @@
|
|
|
categoryId: this.taskParam.categoryId,
|
|
|
bomCategoryId: this.taskParam.id,
|
|
|
categoryCode: this.taskParam.categoryCode
|
|
|
- }
|
|
|
+ };
|
|
|
itemData.type = item.type.code;
|
|
|
return itemData;
|
|
|
});
|
|
|
workingStepSave(params).then((data) => {
|
|
|
this.$message.success('保存成功');
|
|
|
+ this.reload();
|
|
|
});
|
|
|
}
|
|
|
- this.reload();
|
|
|
+ // this.reload();
|
|
|
console.log(data);
|
|
|
console.log(current);
|
|
|
},
|