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