优化房产导入,错误不提示的bug

This commit is contained in:
wuxw 2025-08-21 11:36:08 +08:00
parent 96aa66defb
commit b550a0c64b
7 changed files with 55 additions and 51 deletions

View File

@ -103,7 +103,7 @@ export function deleteOrg(data) {
if (res.code == 0) {
resolve(res)
} else {
reject(new Error(res.msg || '删除组织失败'))
reject(res.msg)
}
}).catch(error => {
reject(error)
@ -180,7 +180,7 @@ export function deleteOrgRelStaff(data) {
if (res.code == 0) {
resolve(res)
} else {
reject(new Error(res.msg || '删除员工与组织关系失败'))
reject(res.msg)
}
}).catch(error => {
reject(error)

View File

@ -12,7 +12,7 @@ export function importOwnerRoom(formData) {
}).then(response => {
resolve(response)
}).catch(error => {
reject(error)
reject(error.response.data)
})
})
}

View File

@ -36,6 +36,9 @@
this.$message.success(this.$t('org.deleteSuccess'))
this.visible = false
this.$emit('refresh')
},error => {
console.log(error)
this.$message.error(error)
})
}
}

View File

@ -1,44 +1,43 @@
<template>
<el-dialog
:title="$t('org.confirmOperation')"
:visible.sync="visible"
width="30%"
>
<span>{{ $t('org.confirmDeleteRelStaff') }}</span>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">{{ $t('org.cancelDelete') }}</el-button>
<el-button type="primary" @click="handleConfirm">{{ $t('org.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { deleteOrgRelStaff } from '@/api/org/orgApi'
export default {
name: 'DeleteOrgRelStaff',
data() {
return {
visible: false,
currentStaff: null
}
<el-dialog :title="$t('common.confirm')" :visible.sync="visible" width="30%">
<span>{{ $t('org.confirmDelete') }}</span>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">{{ $t('common.cancel') }}</el-button>
<el-button type="primary" @click="handleConfirm">{{ $t('common.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { deleteOrgRelStaff } from '@/api/org/orgApi'
export default {
name: 'DeleteOrgRelStaff',
data() {
return {
visible: false,
currentStaff: null
}
},
methods: {
show(staff) {
this.currentStaff = staff
this.visible = true
},
methods: {
show(staff) {
this.currentStaff = staff
this.visible = true
},
handleConfirm() {
deleteOrgRelStaff({
staffId: this.currentStaff.userId,
orgId: this.currentStaff.orgId
}).then(response => {
console.log(response)
this.$message.success(this.$t('org.deleteSuccess'))
this.visible = false
this.$emit('refresh')
})
}
handleConfirm() {
deleteOrgRelStaff({
staffId: this.currentStaff.userId,
orgId: this.currentStaff.orgId
}).then(response => {
console.log(response)
this.$message.success(this.$t('org.deleteSuccess'))
this.visible = false
this.$emit('refresh')
},error => {
console.log(error)
this.$message.error(error)
})
}
}
</script>
}
</script>

View File

@ -102,7 +102,7 @@ export default {
}
})
} catch (error) {
this.$message.error(this.$t('room.importOwnerRoom.importError'))
this.$message.error(error)
}
},
}

View File

@ -37,8 +37,8 @@
<el-form-item :label="$t('addEquipmentAccount.state')" prop="state" required>
<el-select v-model="addEquipmentAccountInfo.state"
:placeholder="$t('addEquipmentAccount.statePlaceholder')" style="width:100%">
<el-option v-for="(item, index) in addEquipmentAccountInfo.useStatus" :key="index" :label="item.name"
:value="item.statusCd" />
<el-option v-for="(item, index) in addEquipmentAccountInfo.useStatus" :key="index"
:label="item.name" :value="item.statusCd" />
</el-select>
</el-form-item>
</el-col>
@ -77,14 +77,16 @@
<el-row :gutter="20">
<el-col :span="12">
<el-form-item :label="$t('addEquipmentAccount.firstEnableTime')">
<el-date-picker v-model="addEquipmentAccountInfo.firstEnableTime" type="date" value-format="yyyy-MM-dd"
:placeholder="$t('addEquipmentAccount.firstEnableTimePlaceholder')" style="width:100%" />
<el-date-picker v-model="addEquipmentAccountInfo.firstEnableTime" type="date"
value-format="yyyy-MM-dd" :placeholder="$t('addEquipmentAccount.firstEnableTimePlaceholder')"
style="width:100%" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('addEquipmentAccount.warrantyDeadline')">
<el-date-picker v-model="addEquipmentAccountInfo.warrantyDeadline" type="date" value-format="yyyy-MM-dd"
:placeholder="$t('addEquipmentAccount.warrantyDeadlinePlaceholder')" style="width:100%" />
<el-date-picker v-model="addEquipmentAccountInfo.warrantyDeadline" type="date"
value-format="yyyy-MM-dd" :placeholder="$t('addEquipmentAccount.warrantyDeadlinePlaceholder')"
style="width:100%" />
</el-form-item>
</el-col>
</el-row>

View File

@ -119,7 +119,7 @@ export default {
this.$refs.orgRelStaff.show(this.orgId);
},
openDeleteOrgRelStaff(staff) {
this.$refs.deleteOrgRelStaff.open(staff);
this.$refs.deleteOrgRelStaff.show(staff);
},
toStaffDetail(staff) {
this.$router.push(`/views/staff/staffDetail?staffId=${staff.userId}`)