diff --git a/subPages/home/maintainanceSubmit.vue b/subPages/home/maintainanceSubmit.vue index d1bcca7..650c585 100644 --- a/subPages/home/maintainanceSubmit.vue +++ b/subPages/home/maintainanceSubmit.vue @@ -16,6 +16,7 @@ placeholder="请填写" class="input-field" ref="maintainerInput" + disabled /> @@ -263,6 +264,7 @@ export default { data() { return { + userId: '', timeValue: Number(new Date()), nextTimeValue: Number(new Date()), // 表单数据 @@ -291,6 +293,19 @@ export default { } }, methods: { + // 获取个人信息 + async getPersonalInfo() { + try { + const res = await this.$api.user.queryUser() + if (res.code === 200) { + this.userId = res.result.id + this.maintenanceName = res.result.nickName + } + } catch (error) { + console.error('获取个人信息失败:', error) + + } + }, // 显示日期选择器 showDatePicker() { this.$refs.datePicker.open() @@ -441,7 +456,7 @@ export default { // 把costList切换成字符串并用,,;分割 // 提交数据 const formData = { - maintenanceName: this.maintenanceName, + maintenanceName: this.userId, maintenanceDate: this.maintenanceDate, stateFrontText: this.stateFrontText, stateFrontImage: this.stateFrontImage?.join(',') || '', @@ -481,7 +496,8 @@ export default { } } }, - onLoad(options) { + async onLoad(options) { + await this.getPersonalInfo() this.showpieceId = options.id