diff --git a/src/views/productionManagement/beforeAndAfterPlating/components/afterPlatingEntryDialog.vue b/src/views/productionManagement/beforeAndAfterPlating/components/afterPlatingEntryDialog.vue
index ee5eb0b..9ae41ef 100644
--- a/src/views/productionManagement/beforeAndAfterPlating/components/afterPlatingEntryDialog.vue
+++ b/src/views/productionManagement/beforeAndAfterPlating/components/afterPlatingEntryDialog.vue
@@ -87,8 +87,8 @@
@@ -109,6 +109,7 @@ export default {
},
data() {
return {
+ sunmitLoading:false,
tableLoading: false,
formError: '',
cardNo: '',
@@ -199,25 +200,24 @@ export default {
}
// 校验通过:准备提交数据(过滤无用字段)
- const submitData = this.form.tableData.map(row => {
+ const submitData = this.form.beforePlatingEntryData.map(row => {
const { _select, ...validData } = row; // 剔除选择状态字段
return validData;
});
-
+ this.sunmitLoading =true
// 调用接口提交(实际项目替换)
try {
- savePlateAroundPlateAfterEnter({ ...this.form.beforePlatingEntryData , paType: 3 }).then(
- res => {
- this.$message.success('提交成功');
- this.closeDialog();
- this.$emit('submitSuccess', submitData);
- }
- );
-
- // 演示用
+ savePlateAroundPlateAfterEnter(this.form.beforePlatingEntryData).then(res => {
+ this.$message.success('提交成功');
+ this.closeDialog();
+ this.$emit('submitSuccess', submitData);
+ this.sunmitLoading =false
+ }).catch(err=>{
+ this.sunmitLoading =false
+ })
} catch (err) {
- this.$message.error('网络错误,请稍后重试');
console.error('提交失败:', err);
+ this.sunmitLoading =false
}
});
},
diff --git a/src/views/productionManagement/beforeAndAfterPlating/components/beforePlatingBoundDialog.vue b/src/views/productionManagement/beforeAndAfterPlating/components/beforePlatingBoundDialog.vue
index 1a3ebcf..4de569c 100644
--- a/src/views/productionManagement/beforeAndAfterPlating/components/beforePlatingBoundDialog.vue
+++ b/src/views/productionManagement/beforeAndAfterPlating/components/beforePlatingBoundDialog.vue
@@ -43,7 +43,8 @@
-
+
+
@@ -62,13 +63,15 @@
-
-
+
+
+
+
-
+
*出库人员
@@ -100,8 +103,8 @@
@@ -122,6 +125,7 @@ export default {
},
data() {
return {
+ sunmitLoading: false,
tableLoading: false,
formError: '',
cardNo: '',
@@ -210,27 +214,29 @@ export default {
});
return;
}
+ this.sunmitLoading = true;
// 校验通过:准备提交数据(过滤无用字段)
- const submitData = this.form.tableData.map(row => {
+ const submitData = this.form.beforePlatingEntryData.map(row => {
const { _select, ...validData } = row; // 剔除选择状态字段
return validData;
});
// 调用接口提交(实际项目替换)
try {
- savePlateAroundPlateFrontIssue({ ...this.form.beforePlatingEntryData , paType: 2 }).then(
- res => {
+ savePlateAroundPlateFrontIssue(this.form.beforePlatingEntryData)
+ .then(res => {
this.$message.success('提交成功');
this.closeDialog();
this.$emit('submitSuccess', submitData);
- }
- );
-
- // 演示用
+ this.sunmitLoading = false;
+ })
+ .catch(err => {
+ this.sunmitLoading = false;
+ });
} catch (err) {
- this.$message.error('网络错误,请稍后重试');
console.error('提交失败:', err);
+ this.sunmitLoading = false;
}
});
},
diff --git a/src/views/productionManagement/beforeAndAfterPlating/components/beforePlatingEntryDialog.vue b/src/views/productionManagement/beforeAndAfterPlating/components/beforePlatingEntryDialog.vue
index a9423c1..0616119 100644
--- a/src/views/productionManagement/beforeAndAfterPlating/components/beforePlatingEntryDialog.vue
+++ b/src/views/productionManagement/beforeAndAfterPlating/components/beforePlatingEntryDialog.vue
@@ -29,11 +29,12 @@
@selection-change="selectionChangeProject"
@select="selectChange"
v-loading="tableLoading"
+ :height="tableHeight"
>
-
-
-
+
+
+
-
-
+
+
-
+
+
-
+
*入库人员
@@ -65,11 +72,24 @@
:prop="`beforePlatingEntryData[${scope.$index}].userName`"
:rules="formRules.userName"
>
-
+
+
+
+
-
+
*入库时间
@@ -78,7 +98,14 @@
:prop="`beforePlatingEntryData[${scope.$index}].createTime`"
:rules="formRules.createTime"
>
-
+
+
@@ -87,8 +114,8 @@
@@ -100,6 +127,7 @@ import {
getBeforePlatInCardNo,
savePlateAroundPlateFrontEnter,
} from '@/api/productionManagement/beforeAndAfterPlating';
+import { getUserList } from '@/api/workLicense/workLicense';
export default {
props: {
showDialog: {
@@ -109,6 +137,9 @@ export default {
},
data() {
return {
+ sunmitLoading: false,
+ userList: [], //用户列表
+ tableHeight: 400,
tableLoading: false,
formError: '',
cardNo: '',
@@ -134,17 +165,11 @@ export default {
trigger: 'submit',
},
],
- woCode: [
- {
- required: true,
- message: '请输入',
- trigger: 'blur',
- },
- ],
- userName: [
+
+ userId: [
{
required: true,
- message: '请输入',
+ message: '请选择',
trigger: 'blur',
},
],
@@ -158,8 +183,40 @@ export default {
},
};
},
- mounted() {},
+ mounted() {
+ this.$nextTick(() => {
+ this.calculateTableHeight();
+ this.getUserInfo();
+ });
+ },
methods: {
+ // 获取用户信息
+ getUserInfo() {
+ getUserList({ size: 999999, current: 1 }).then(res => {
+ this.userList = res.data.data.records;
+ });
+ },
+ // 计算表格高度
+ calculateTableHeight() {
+ this.$nextTick(() => {
+ const dialogContainer = document.querySelector('.el-dialog__body');
+ if (!dialogContainer) return;
+
+ const containerHeight = dialogContainer.clientHeight;
+
+ // 减去其他元素高度
+ const inputAreaHeight = 50;
+ const errorHeight = 30;
+ const formPadding = 40;
+ const footerHeight = 10;
+
+ const calculatedHeight =
+ containerHeight - inputAreaHeight - errorHeight - formPadding - footerHeight;
+
+ this.tableHeight = Math.max(300, Math.min(calculatedHeight, 800));
+ });
+ },
+
open() {
this.cardNo = '';
this.form.beforePlatingEntryData = [];
@@ -168,7 +225,11 @@ export default {
this.tableLoading = true;
getBeforePlatInCardNo({ cardNo: this.cardNo })
.then(res => {
- this.form.beforePlatingEntryData = res.data;
+ this.form.beforePlatingEntryData.push(res.data.data);
+ this.tableLoading = false;
+ this.$nextTick(() => {
+ this.calculateTableHeight();
+ });
})
.catch(err => {
this.tableLoading = false;
@@ -197,26 +258,28 @@ export default {
});
return;
}
+ this.sunmitLoading = true;
// 校验通过:准备提交数据(过滤无用字段)
- const submitData = this.form.tableData.map(row => {
+ const submitData = this.form.beforePlatingEntryData.map(row => {
const { _select, ...validData } = row; // 剔除选择状态字段
return validData;
});
- // 调用接口提交(实际项目替换)
+ // 调用接口提交(实际项目替换)hrTypeBool: 0-转工 1-入库
try {
- savePlateAroundPlateFrontEnter({...this.form.beforePlatingEntryData, paType: 1 }).then(
- res => {
+ savePlateAroundPlateFrontEnter(this.form.beforePlatingEntryData)
+ .then(res => {
+ this.sunmitLoading = false;
this.$message.success('提交成功');
this.closeDialog();
this.$emit('submitSuccess', submitData);
- }
- );
-
- // 演示用
+ })
+ .catch(err => {
+ this.sunmitLoading = false;
+ });
} catch (err) {
- this.$message.error('网络错误,请稍后重试');
+ this.sunmitLoading = false;
console.error('提交失败:', err);
}
});
@@ -230,4 +293,20 @@ export default {
};
-
+