|
|
@@ -42,40 +42,29 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
- <header-title title="工序">
|
|
|
- </header-title>
|
|
|
-
|
|
|
- <ele-pro-table ref="table" :needPage="false" :columns="columns" :datasource="datasource" row-key="produceTaskId">
|
|
|
+ <header-title title="工序"> </header-title>
|
|
|
|
|
|
+ <ele-pro-table ref="table" :needPage="false" :columns="columns" :datasource="datasource"
|
|
|
+ row-key="produceTaskId">
|
|
|
<!-- 表头工具栏 -->
|
|
|
<template v-slot:toolbar>
|
|
|
<el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon"
|
|
|
@click="openEdit">新增</el-button>
|
|
|
-
|
|
|
-
|
|
|
</template>
|
|
|
|
|
|
- <template v-slot:palletName="{ row, $index }">
|
|
|
- <el-input :value="row.palletName" placeholder="请选择"
|
|
|
- @click.native="palletSelect(row, $index)"></el-input>
|
|
|
+ <template v-slot:palletBomCode="{ row }">
|
|
|
+ <el-input :value="row.palletBomCode" placeholder="请输入模具BOM编码"></el-input>
|
|
|
</template>
|
|
|
|
|
|
- <template v-slot:palletCode="{ row }">
|
|
|
- <el-input :value="row.palletCode" disabled placeholder="自动带入"></el-input>
|
|
|
+ <template v-slot:palletBomName="{ row }">
|
|
|
+ <el-input :value="row.palletBomName" placeholder="请输入模具BOM名称"></el-input>
|
|
|
</template>
|
|
|
|
|
|
-
|
|
|
- <template v-slot:palletModelType="{ row }">
|
|
|
- <el-input :value="row.palletModelType" disabled placeholder="自动带入"></el-input>
|
|
|
- </template>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="{ row, $index }">
|
|
|
+ <el-link type="primary" @click="openMould(row)" :underline="false">
|
|
|
+ 配置模具
|
|
|
+ </el-link>
|
|
|
|
|
|
<el-popconfirm class="ele-action" title="确定要删除当前工序吗?" @confirm="handleDel(row, $index)">
|
|
|
<template v-slot:reference>
|
|
|
@@ -86,12 +75,27 @@
|
|
|
</el-popconfirm>
|
|
|
</template>
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ <template v-slot:expand="{ row }">
|
|
|
+ <div style="width: 100%; min-height: 60px" v-if="row.palletList">
|
|
|
+ <ele-pro-table :toolbar="false" toolsTheme="none" ref="table2" :need-page="false"
|
|
|
+ :datasource="row.palletList" :columns="columns2" row-key="id">
|
|
|
+
|
|
|
+ <!-- 操作列 -->
|
|
|
+ <template v-slot:action="{ row }">
|
|
|
+ <el-popconfirm class="ele-action" title="确定要删除当前模具吗?" @confirm="remove2(row)">
|
|
|
+ <template v-slot:reference>
|
|
|
+ <el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
+ 删除
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
+ </template>
|
|
|
+
|
|
|
+
|
|
|
+ </ele-pro-table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</ele-pro-table>
|
|
|
-
|
|
|
-
|
|
|
</el-form>
|
|
|
|
|
|
<div slot="footer" class="footer">
|
|
|
@@ -99,24 +103,22 @@
|
|
|
<el-button @click="visible = false">返回</el-button>
|
|
|
</div>
|
|
|
|
|
|
-
|
|
|
<processModal ref="processRefs" @chooseProcess="chooseProcess"></processModal>
|
|
|
- <ProductModal ref="productRefs" @changeProduct='determineChoose' />
|
|
|
|
|
|
+ <!-- 选择模具 -->
|
|
|
+ <SelectProduct ref="productRefs" @chooseProcess="chooseModal"></SelectProduct>
|
|
|
</ele-modal>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import processModal from '@/views/technology/productParam/components/processModal.vue';
|
|
|
+import SelectProduct from '@/components/select/SelectProduct';
|
|
|
|
|
|
-
|
|
|
-import processModal from '@/views/technology/productParam/components/processModal.vue'
|
|
|
-import ProductModal from '@/views/technology/productParam/components/ProductModal.vue'
|
|
|
-import { categoryTaskPallet, getCategoryTaskPallet } from '@/api/material/list'
|
|
|
+import { categoryTaskPallet, getCategoryTaskPallet } from '@/api/material/list';
|
|
|
export default {
|
|
|
components: {
|
|
|
processModal,
|
|
|
- ProductModal
|
|
|
-
|
|
|
+ SelectProduct
|
|
|
},
|
|
|
props: {
|
|
|
// 弹窗是否打开
|
|
|
@@ -149,34 +151,20 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
|
|
|
-
|
|
|
-
|
|
|
// 提交状态
|
|
|
loading: false,
|
|
|
current: null,
|
|
|
|
|
|
columns: [
|
|
|
-
|
|
|
{
|
|
|
- label: '模具名称',
|
|
|
- prop: 'palletName',
|
|
|
- slot: 'palletName',
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- label: '模具编码',
|
|
|
- prop: 'palletCode',
|
|
|
- slot: 'palletCode',
|
|
|
- minWidth: 110
|
|
|
+ width: 45,
|
|
|
+ type: 'expand',
|
|
|
+ columnKey: 'palletList',
|
|
|
+ align: 'center',
|
|
|
+ slot: 'expand'
|
|
|
},
|
|
|
|
|
|
- {
|
|
|
- label: '模具型号',
|
|
|
- prop: 'palletModelType',
|
|
|
- slot: 'palletModelType',
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
+
|
|
|
|
|
|
{
|
|
|
prop: 'code',
|
|
|
@@ -208,6 +196,21 @@ export default {
|
|
|
minWidth: 110
|
|
|
},
|
|
|
|
|
|
+ {
|
|
|
+ prop: 'palletBomCode',
|
|
|
+ label: '模具BOM编码',
|
|
|
+ align: 'center',
|
|
|
+ slot: 'palletBomCode',
|
|
|
+ minWidth: 150
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'palletBomName',
|
|
|
+ label: '模具BOM名称',
|
|
|
+ align: 'center',
|
|
|
+ slot: 'palletBomName',
|
|
|
+ minWidth: 150
|
|
|
+ },
|
|
|
+
|
|
|
{
|
|
|
columnKey: 'action',
|
|
|
label: '操作',
|
|
|
@@ -219,12 +222,50 @@ export default {
|
|
|
}
|
|
|
],
|
|
|
|
|
|
- removeList: [],
|
|
|
- categoryId: null
|
|
|
|
|
|
+ // 表格列配置
|
|
|
+ columns2: [
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'code',
|
|
|
+ label: '编码'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '名称',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'brandNum',
|
|
|
+ label: '牌号'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'modelType',
|
|
|
+ label: '型号',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'specification',
|
|
|
+ label: '规格',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
|
|
|
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ slot: 'action',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ }
|
|
|
+ ],
|
|
|
|
|
|
+ removeList: [],
|
|
|
+ categoryId: null
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -234,127 +275,122 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
/* 表格数据源 */
|
|
|
datasource({ page, limit, where }) {
|
|
|
return [];
|
|
|
},
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/* 更新visible */
|
|
|
updateVisible(value) {
|
|
|
this.$emit('update:visible', value);
|
|
|
},
|
|
|
|
|
|
openEdit() {
|
|
|
- let _arr = this.$refs.table.getData()
|
|
|
+ let _arr = this.$refs.table.getData();
|
|
|
_arr.map((m) => {
|
|
|
- m.id = m.produceTaskId
|
|
|
- delete m.produceTaskId
|
|
|
- return {
|
|
|
- ...m,
|
|
|
- }
|
|
|
- })
|
|
|
- this.$refs.processRefs.open(_arr)
|
|
|
+ m.id = m.produceTaskId;
|
|
|
+ delete m.produceTaskId;
|
|
|
+ return {
|
|
|
+ ...m
|
|
|
+ };
|
|
|
+ });
|
|
|
+ this.$refs.processRefs.open(_arr);
|
|
|
},
|
|
|
|
|
|
chooseProcess(data) {
|
|
|
data.map((m) => {
|
|
|
- m['produceTaskId'] = m.id
|
|
|
- delete m.id
|
|
|
- return {
|
|
|
- ...m,
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
+ m['produceTaskId'] = m.id;
|
|
|
+ delete m.id;
|
|
|
+ return {
|
|
|
+ ...m
|
|
|
+ };
|
|
|
+ });
|
|
|
this.$refs.table.setData([...data, ...this.$refs.table.getData()]);
|
|
|
},
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
handleDel(row, index) {
|
|
|
- let _arr = this.$refs.table.getData()
|
|
|
- _arr.splice(index, 1)
|
|
|
- this.$refs.table.setData(_arr)
|
|
|
+ let _arr = this.$refs.table.getData();
|
|
|
+ _arr.splice(index, 1);
|
|
|
+ this.$refs.table.setData(_arr);
|
|
|
if (row?.produceTaskId) {
|
|
|
- this.removeList.push(row.produceTaskId)
|
|
|
+ this.removeList.push(row.produceTaskId);
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- palletSelect(row, idx) {
|
|
|
- let _arr = this.$refs.table.getData()
|
|
|
- let param = {
|
|
|
- categoryId: _arr[idx].palletId,
|
|
|
- categoryName: _arr[idx].palletName,
|
|
|
- categoryCode: _arr[idx].palletCode
|
|
|
- }
|
|
|
- this.$refs.productRefs.open(param, '模具', '5', idx)
|
|
|
+ openMould(row) {
|
|
|
+ this.$refs.productRefs.open([], '模具', '5', row);
|
|
|
},
|
|
|
|
|
|
- determineChoose(title, row, idx) {
|
|
|
+ chooseModal(data, current) {
|
|
|
+ data.map((m => {
|
|
|
+ m.parentId = current.produceTaskId
|
|
|
+ return {
|
|
|
+ ...m,
|
|
|
+ }
|
|
|
+ }))
|
|
|
|
|
|
- if (title == '模具') {
|
|
|
- let _arr = this.$refs.table.getData()
|
|
|
- this.$set(_arr[idx], 'palletId', row.id)
|
|
|
- this.$set(_arr[idx], 'palletName', row.name)
|
|
|
- this.$set(_arr[idx], 'palletCode', row.code)
|
|
|
- this.$set(_arr[idx], 'palletModelType', row.modelType)
|
|
|
+ let tableList = [];
|
|
|
+ tableList = this.$refs.table.getData();
|
|
|
+ tableList.forEach((e) => {
|
|
|
+ if (e.produceTaskId == current.produceTaskId) {
|
|
|
+ e.palletList = data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.$refs.table.setData([...tableList]);
|
|
|
+ },
|
|
|
|
|
|
+ remove2(row) {
|
|
|
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.table.setData(_arr);
|
|
|
- })
|
|
|
+ const data = this.$refs.table.getData() ?? [];
|
|
|
|
|
|
- }
|
|
|
+ data.forEach((e) => {
|
|
|
+ if (row.parentId == e.produceTaskId) {
|
|
|
+ e.palletList = e.palletList.filter((d) => d.id !== row.id);
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
+ this.$refs.table.setData([...data])
|
|
|
|
|
|
},
|
|
|
|
|
|
- async getCategoryTaskDetail() {
|
|
|
- const res = await getCategoryTaskPallet(this.categoryId)
|
|
|
- this.$refs.table.setData(res);
|
|
|
-
|
|
|
- },
|
|
|
|
|
|
+ async getCategoryTaskDetail() {
|
|
|
+ const res = await getCategoryTaskPallet(this.categoryId);
|
|
|
+ this.$refs.table.setData(res);
|
|
|
+ },
|
|
|
|
|
|
save() {
|
|
|
- let _arr = this.$refs.table.getData()
|
|
|
+ let _arr = this.$refs.table.getData();
|
|
|
let param = {
|
|
|
categoryId: this.categoryId,
|
|
|
taskList: _arr
|
|
|
- }
|
|
|
- categoryTaskPallet(param).then((msg) => {
|
|
|
- this.loading = false;
|
|
|
- this.$message.success(msg);
|
|
|
- this.visible = false;
|
|
|
- this.$emit('done');
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- this.loading = false;
|
|
|
- this.$message.error(e.message);
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ };
|
|
|
+ categoryTaskPallet(param)
|
|
|
+ .then((msg) => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.success(msg);
|
|
|
+ this.visible = false;
|
|
|
+ this.$emit('done');
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.error(e.message);
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
async visible(visible) {
|
|
|
if (visible) {
|
|
|
-
|
|
|
if (this.data) {
|
|
|
- this.categoryId = this.data.id
|
|
|
+ this.categoryId = this.data.id;
|
|
|
this.$util.assignObject(this.form, {
|
|
|
...this.data
|
|
|
});
|
|
|
} else {
|
|
|
}
|
|
|
|
|
|
- this.getCategoryTaskDetail()
|
|
|
-
|
|
|
+ this.getCategoryTaskDetail();
|
|
|
} else {
|
|
|
this.$refs.form.clearValidate();
|
|
|
this.form = { ...this.defaultForm };
|