工艺模块:页面完全完善
This commit is contained in:
parent
000af662ee
commit
40f38ef660
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
|
||||||
<el-form :model="queryParams">
|
<el-form :model="queryParams">
|
||||||
<el-form-item label="项目令号" prop="routeDescription">
|
<el-form-item label="项目令号" prop="routeDescription">
|
||||||
<el-select v-model="queryParams.routeDescription" filterable remote :remote-method="handleQuery1"
|
<el-select v-model="queryParams.routeDescription" filterable remote :remote-method="handleQuery1"
|
||||||
@ -14,7 +14,7 @@
|
|||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@ -226,11 +226,11 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<template v-if="scope.row.id > 0">
|
<template v-if="scope.row.id > 0">
|
||||||
<el-button class="btn" size="mini" type="primary" @click="handleRowEdit(scope)"
|
<el-button class="btn" size="mini" type="primary" @click="handleRowEdit(scope)"
|
||||||
v-hasPermi="['system:route:edit']">
|
v-hasPermi="['system:route:edit']">
|
||||||
修改
|
修改
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button class="btn" size="mini" type="danger" @click="handleDelete(scope)"
|
<el-button class="btn" size="mini" type="danger" @click="handleDelete(scope)"
|
||||||
v-hasPermi="['system:route:remove']">
|
v-hasPermi="['system:route:remove']">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -314,10 +314,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 抽屉 -->
|
<!-- 抽屉 -->
|
||||||
<el-drawer
|
<el-drawer
|
||||||
title="BOM信息"
|
title="BOM信息"
|
||||||
:visible.sync="BOMpop"
|
:visible.sync="BOMpop"
|
||||||
:before-close="bomClose"
|
:before-close="bomClose"
|
||||||
:size="1100"
|
:size="1100"
|
||||||
:destroy-on-close="true">
|
:destroy-on-close="true">
|
||||||
<div style="padding: 20px;">
|
<div style="padding: 20px;">
|
||||||
@ -332,8 +332,8 @@
|
|||||||
|
|
||||||
<!-- 搜索和操作按钮 -->
|
<!-- 搜索和操作按钮 -->
|
||||||
<div class="table-operations" style="margin: 15px 0;">
|
<div class="table-operations" style="margin: 15px 0;">
|
||||||
|
|
||||||
|
|
||||||
<div class="right-operations">
|
<div class="right-operations">
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" size="small" @click="handleBomAdd">
|
<el-button type="primary" size="small" @click="handleBomAdd">
|
||||||
@ -350,10 +350,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- BOM数据表格 -->
|
<!-- BOM数据表格 -->
|
||||||
<el-table
|
<el-table
|
||||||
:data="filteredBomData"
|
:data="filteredBomData"
|
||||||
stripe
|
stripe
|
||||||
max-height="400px"
|
max-height="400px"
|
||||||
border
|
border
|
||||||
v-loading="bomLoading"
|
v-loading="bomLoading"
|
||||||
@selection-change="handleBomSelectionChange"
|
@selection-change="handleBomSelectionChange"
|
||||||
@ -643,14 +643,14 @@ export default {
|
|||||||
filter: ".filtered", // 过滤
|
filter: ".filtered", // 过滤
|
||||||
onEnd: (event, oldValue, newValue) => {
|
onEnd: (event, oldValue, newValue) => {
|
||||||
// 找到父节点
|
// 找到父节点
|
||||||
const parentIndex = this.form.routeList.findIndex(item =>
|
const parentIndex = this.form.routeList.findIndex(item =>
|
||||||
item.children && item.children.some(child => child.id === newValue.id)
|
item.children && item.children.some(child => child.id === newValue.id)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (parentIndex !== -1) {
|
if (parentIndex !== -1) {
|
||||||
// 获取子节点列表
|
// 获取子节点列表
|
||||||
const children = this.form.routeList[parentIndex].children;
|
const children = this.form.routeList[parentIndex].children;
|
||||||
|
|
||||||
// 重新排序工序号
|
// 重新排序工序号
|
||||||
children.forEach((child, index) => {
|
children.forEach((child, index) => {
|
||||||
child.processNo = (index + 1) * 10;
|
child.processNo = (index + 1) * 10;
|
||||||
@ -752,7 +752,7 @@ export default {
|
|||||||
if (!this.bomSearchKey) return this.bomData;
|
if (!this.bomSearchKey) return this.bomData;
|
||||||
const searchKey = this.bomSearchKey.toLowerCase();
|
const searchKey = this.bomSearchKey.toLowerCase();
|
||||||
return this.bomData.filter(item => {
|
return this.bomData.filter(item => {
|
||||||
return Object.values(item).some(value =>
|
return Object.values(item).some(value =>
|
||||||
String(value).toLowerCase().includes(searchKey)
|
String(value).toLowerCase().includes(searchKey)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@ -863,14 +863,14 @@ export default {
|
|||||||
this.showParentSaveBtn = props.row.id;
|
this.showParentSaveBtn = props.row.id;
|
||||||
},
|
},
|
||||||
// 保存子集
|
// 保存子集
|
||||||
onSave(props) {
|
/* onSave(props) {
|
||||||
this.$confirm('确认保存工艺路线数据?', '提示', {
|
this.$confirm('确认保存工艺路线数据?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
||||||
var list = this.form.routeList.find(item => item.id === props.row.id);
|
var list = this.form.routeList.find(item => item.id === props.row.id);
|
||||||
var newChildrenList = list.children.filter(item => item.id < 0).map(v => ({
|
var newChildrenList = list.children.filter(item => item.id < 0).map(v => ({
|
||||||
id: v.parentId,
|
id: v.parentId,
|
||||||
@ -913,7 +913,7 @@ export default {
|
|||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},*/
|
||||||
// 删除子集
|
// 删除子集
|
||||||
onDelete(props) {
|
onDelete(props) {
|
||||||
// 获取父级的所在下标
|
// 获取父级的所在下标
|
||||||
@ -933,7 +933,7 @@ export default {
|
|||||||
if (/单重|材料BOM物料编码|材料BOM物料名称|用量/.test(column.label)) {
|
if (/单重|材料BOM物料编码|材料BOM物料名称|用量/.test(column.label)) {
|
||||||
this.BOMpop = true;
|
this.BOMpop = true;
|
||||||
this.bomLoading = true;
|
this.bomLoading = true;
|
||||||
|
|
||||||
// 设置当前物料信息
|
// 设置当前物料信息
|
||||||
this.currentMaterial = {
|
this.currentMaterial = {
|
||||||
materialCode: row.materialCode,
|
materialCode: row.materialCode,
|
||||||
@ -961,19 +961,9 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
bomClose() {
|
|
||||||
this.BOMpop = false
|
|
||||||
},
|
|
||||||
shouhide() {
|
|
||||||
this.showtable = false
|
|
||||||
setTimeout(() => {
|
|
||||||
this.showtable = true
|
|
||||||
this.expand = !this.expand
|
|
||||||
}, 0);
|
|
||||||
|
|
||||||
},
|
|
||||||
setTotalWeight() {
|
setTotalWeight() {
|
||||||
const totalWeight = this.$route.query.productionOrderNo;
|
const totalWeight = this.$route.query.productionOrderNo;
|
||||||
if (totalWeight) {
|
if (totalWeight) {
|
||||||
@ -1109,7 +1099,7 @@ export default {
|
|||||||
async pushRouteBom() {
|
async pushRouteBom() {
|
||||||
// 获取生产订单号
|
// 获取生产订单号
|
||||||
const productionOrderNo = this.$route.query.productionOrderNo;
|
const productionOrderNo = this.$route.query.productionOrderNo;
|
||||||
|
|
||||||
if (!productionOrderNo) {
|
if (!productionOrderNo) {
|
||||||
this.$modal.msgError("未获取到生产订单号,请检查!");
|
this.$modal.msgError("未获取到生产订单号,请检查!");
|
||||||
return;
|
return;
|
||||||
@ -1118,8 +1108,8 @@ export default {
|
|||||||
try {
|
try {
|
||||||
// 显示确认对话框
|
// 显示确认对话框
|
||||||
await this.$confirm(
|
await this.$confirm(
|
||||||
'推送工艺可能需要较长时间,请耐心等待。是否继续?',
|
'推送工艺可能需要较长时间,请耐心等待。是否继续?',
|
||||||
'提示',
|
'提示',
|
||||||
{
|
{
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
@ -1162,7 +1152,7 @@ export default {
|
|||||||
|
|
||||||
// 关闭 loading
|
// 关闭 loading
|
||||||
loading.close();
|
loading.close();
|
||||||
|
|
||||||
// 显示成功消息
|
// 显示成功消息
|
||||||
this.$notify({
|
this.$notify({
|
||||||
title: '推送成功',
|
title: '推送成功',
|
||||||
@ -1174,7 +1164,7 @@ export default {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
// 错误处理
|
// 错误处理
|
||||||
console.error('[推送工艺失败]:', error);
|
console.error('[推送工艺失败]:', error);
|
||||||
|
|
||||||
// 显示错误通知
|
// 显示错误通知
|
||||||
this.$notify({
|
this.$notify({
|
||||||
title: '推送失败',
|
title: '推送失败',
|
||||||
@ -1349,7 +1339,7 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
const isUpdate = this.bomForm.id !== undefined;
|
const isUpdate = this.bomForm.id !== undefined;
|
||||||
const promise = isUpdate ? updateBom(this.bomForm) : addBom(this.bomForm);
|
const promise = isUpdate ? updateBom(this.bomForm) : addBom(this.bomForm);
|
||||||
|
|
||||||
promise.then(() => {
|
promise.then(() => {
|
||||||
this.$message.success(isUpdate ? '修改成功' : '新增成功');
|
this.$message.success(isUpdate ? '修改成功' : '新增成功');
|
||||||
this.bomDialogVisible = false;
|
this.bomDialogVisible = false;
|
||||||
@ -1373,7 +1363,7 @@ export default {
|
|||||||
this.materialOptions = [];
|
this.materialOptions = [];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.materialSearchLoading = true;
|
this.materialSearchLoading = true;
|
||||||
// 调用查询接口,支持物料名称和编码搜索
|
// 调用查询接口,支持物料名称和编码搜索
|
||||||
listMaterial({
|
listMaterial({
|
||||||
@ -1399,7 +1389,7 @@ export default {
|
|||||||
this.bomForm.unit = '';
|
this.bomForm.unit = '';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 从选项中获取选中的物料信息
|
// 从选项中获取选中的物料信息
|
||||||
const selectedMaterial = this.materialOptions.find(item => item.materialName === materialName);
|
const selectedMaterial = this.materialOptions.find(item => item.materialName === materialName);
|
||||||
if (selectedMaterial) {
|
if (selectedMaterial) {
|
||||||
@ -1410,28 +1400,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 修改现有的handleBomAdd方法
|
|
||||||
handleBomAdd() {
|
|
||||||
this.bomDialogTitle = '新增BOM';
|
|
||||||
this.bomForm = {
|
|
||||||
id: undefined,
|
|
||||||
materialCode: '',
|
|
||||||
materialName: '',
|
|
||||||
materialType: '',
|
|
||||||
quantity: 0,
|
|
||||||
unit: ''
|
|
||||||
};
|
|
||||||
// 重置物料搜索相关数据
|
|
||||||
this.materialOptions = [];
|
|
||||||
this.materialQuery = '';
|
|
||||||
this.materialPagination = {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
total: 0
|
|
||||||
};
|
|
||||||
this.hasMoreMaterial = true;
|
|
||||||
this.bomDialogVisible = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 开始编辑行
|
// 开始编辑行
|
||||||
handleRowEdit(scope) {
|
handleRowEdit(scope) {
|
||||||
@ -1453,7 +1422,7 @@ export default {
|
|||||||
onSaveRow(scope) {
|
onSaveRow(scope) {
|
||||||
// 显示加载状态
|
// 显示加载状态
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
||||||
// 获取行数据并创建副本
|
// 获取行数据并创建副本
|
||||||
const row = scope.row;
|
const row = scope.row;
|
||||||
const saveData = {
|
const saveData = {
|
||||||
@ -1514,7 +1483,7 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
||||||
var list = this.form.routeList.find(item => item.id === props.row.id);
|
var list = this.form.routeList.find(item => item.id === props.row.id);
|
||||||
var newChildrenList = list.children.filter(item => item.id < 0).map(v => ({
|
var newChildrenList = list.children.filter(item => item.id < 0).map(v => ({
|
||||||
id: v.parentId,
|
id: v.parentId,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user