Commit b550a0c64b51cb8b7931ade7a8115408c075772a

Authored by wuxw
1 parent 96aa66de

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

src/api/org/orgApi.js
... ... @@ -103,7 +103,7 @@ export function deleteOrg(data) {
103 103 if (res.code == 0) {
104 104 resolve(res)
105 105 } else {
106   - reject(new Error(res.msg || '删除组织失败'))
  106 + reject(res.msg)
107 107 }
108 108 }).catch(error => {
109 109 reject(error)
... ... @@ -180,7 +180,7 @@ export function deleteOrgRelStaff(data) {
180 180 if (res.code == 0) {
181 181 resolve(res)
182 182 } else {
183   - reject(new Error(res.msg || '删除员工与组织关系失败'))
  183 + reject(res.msg)
184 184 }
185 185 }).catch(error => {
186 186 reject(error)
... ...
src/api/room/importOwnerRoomApi.js
... ... @@ -12,7 +12,7 @@ export function importOwnerRoom(formData) {
12 12 }).then(response => {
13 13 resolve(response)
14 14 }).catch(error => {
15   - reject(error)
  15 + reject(error.response.data)
16 16 })
17 17 })
18 18 }
19 19 \ No newline at end of file
... ...
src/components/org/DeleteOrg.vue
... ... @@ -36,6 +36,9 @@
36 36 this.$message.success(this.$t('org.deleteSuccess'))
37 37 this.visible = false
38 38 this.$emit('refresh')
  39 + },error => {
  40 + console.log(error)
  41 + this.$message.error(error)
39 42 })
40 43 }
41 44 }
... ...
src/components/org/DeleteOrgRelStaff.vue
1 1 <template>
2   - <el-dialog
3   - :title="$t('org.confirmOperation')"
4   - :visible.sync="visible"
5   - width="30%"
6   - >
7   - <span>{{ $t('org.confirmDeleteRelStaff') }}</span>
8   - <span slot="footer" class="dialog-footer">
9   - <el-button @click="visible = false">{{ $t('org.cancelDelete') }}</el-button>
10   - <el-button type="primary" @click="handleConfirm">{{ $t('org.confirm') }}</el-button>
11   - </span>
12   - </el-dialog>
13   - </template>
14   -
15   - <script>
16   - import { deleteOrgRelStaff } from '@/api/org/orgApi'
17   -
18   - export default {
19   - name: 'DeleteOrgRelStaff',
20   - data() {
21   - return {
22   - visible: false,
23   - currentStaff: null
24   - }
  2 + <el-dialog :title="$t('common.confirm')" :visible.sync="visible" width="30%">
  3 + <span>{{ $t('org.confirmDelete') }}</span>
  4 + <span slot="footer" class="dialog-footer">
  5 + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button>
  6 + <el-button type="primary" @click="handleConfirm">{{ $t('common.confirm') }}</el-button>
  7 + </span>
  8 + </el-dialog>
  9 +</template>
  10 +
  11 +<script>
  12 +import { deleteOrgRelStaff } from '@/api/org/orgApi'
  13 +
  14 +export default {
  15 + name: 'DeleteOrgRelStaff',
  16 + data() {
  17 + return {
  18 + visible: false,
  19 + currentStaff: null
  20 + }
  21 + },
  22 + methods: {
  23 + show(staff) {
  24 + this.currentStaff = staff
  25 + this.visible = true
25 26 },
26   - methods: {
27   - show(staff) {
28   - this.currentStaff = staff
29   - this.visible = true
30   - },
31   - handleConfirm() {
32   - deleteOrgRelStaff({
33   - staffId: this.currentStaff.userId,
34   - orgId: this.currentStaff.orgId
35   - }).then(response => {
36   - console.log(response)
37   - this.$message.success(this.$t('org.deleteSuccess'))
38   - this.visible = false
39   - this.$emit('refresh')
40   - })
41   - }
  27 + handleConfirm() {
  28 + deleteOrgRelStaff({
  29 + staffId: this.currentStaff.userId,
  30 + orgId: this.currentStaff.orgId
  31 + }).then(response => {
  32 + console.log(response)
  33 + this.$message.success(this.$t('org.deleteSuccess'))
  34 + this.visible = false
  35 + this.$emit('refresh')
  36 + },error => {
  37 + console.log(error)
  38 + this.$message.error(error)
  39 + })
42 40 }
43 41 }
44   - </script>
45 42 \ No newline at end of file
  43 +}
  44 +</script>
46 45 \ No newline at end of file
... ...
src/components/room/importOwnerRoom.vue
... ... @@ -102,7 +102,7 @@ export default {
102 102 }
103 103 })
104 104 } catch (error) {
105   - this.$message.error(this.$t('room.importOwnerRoom.importError'))
  105 + this.$message.error(error)
106 106 }
107 107 },
108 108 }
... ...
src/views/machine/addEquipmentAccountList.vue
... ... @@ -37,8 +37,8 @@
37 37 <el-form-item :label="$t('addEquipmentAccount.state')" prop="state" required>
38 38 <el-select v-model="addEquipmentAccountInfo.state"
39 39 :placeholder="$t('addEquipmentAccount.statePlaceholder')" style="width:100%">
40   - <el-option v-for="(item, index) in addEquipmentAccountInfo.useStatus" :key="index" :label="item.name"
41   - :value="item.statusCd" />
  40 + <el-option v-for="(item, index) in addEquipmentAccountInfo.useStatus" :key="index"
  41 + :label="item.name" :value="item.statusCd" />
42 42 </el-select>
43 43 </el-form-item>
44 44 </el-col>
... ... @@ -77,14 +77,16 @@
77 77 <el-row :gutter="20">
78 78 <el-col :span="12">
79 79 <el-form-item :label="$t('addEquipmentAccount.firstEnableTime')">
80   - <el-date-picker v-model="addEquipmentAccountInfo.firstEnableTime" type="date" value-format="yyyy-MM-dd"
81   - :placeholder="$t('addEquipmentAccount.firstEnableTimePlaceholder')" style="width:100%" />
  80 + <el-date-picker v-model="addEquipmentAccountInfo.firstEnableTime" type="date"
  81 + value-format="yyyy-MM-dd" :placeholder="$t('addEquipmentAccount.firstEnableTimePlaceholder')"
  82 + style="width:100%" />
82 83 </el-form-item>
83 84 </el-col>
84 85 <el-col :span="12">
85 86 <el-form-item :label="$t('addEquipmentAccount.warrantyDeadline')">
86   - <el-date-picker v-model="addEquipmentAccountInfo.warrantyDeadline" type="date" value-format="yyyy-MM-dd"
87   - :placeholder="$t('addEquipmentAccount.warrantyDeadlinePlaceholder')" style="width:100%" />
  87 + <el-date-picker v-model="addEquipmentAccountInfo.warrantyDeadline" type="date"
  88 + value-format="yyyy-MM-dd" :placeholder="$t('addEquipmentAccount.warrantyDeadlinePlaceholder')"
  89 + style="width:100%" />
88 90 </el-form-item>
89 91 </el-col>
90 92 </el-row>
... ...
src/views/org/orgList.vue
... ... @@ -119,7 +119,7 @@ export default {
119 119 this.$refs.orgRelStaff.show(this.orgId);
120 120 },
121 121 openDeleteOrgRelStaff(staff) {
122   - this.$refs.deleteOrgRelStaff.open(staff);
  122 + this.$refs.deleteOrgRelStaff.show(staff);
123 123 },
124 124 toStaffDetail(staff) {
125 125 this.$router.push(`/views/staff/staffDetail?staffId=${staff.userId}`)
... ...