工艺模块:页面完全完善

This commit is contained in:
tzy1042411602 2024-12-02 17:34:21 +08:00
parent 000af662ee
commit 40f38ef660

View File

@ -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,