|
|
@ -1,5 +1,5 @@ |
|
|
|
<template> |
|
|
|
<div class='FirstResponders'> |
|
|
|
<div class="FirstResponders"> |
|
|
|
<div class="filter"> |
|
|
|
<div> |
|
|
|
<ButtonGradient @click.native="handleOpenDialogAddEdit()"> |
|
|
@ -22,15 +22,33 @@ |
|
|
|
</ButtonGradient> |
|
|
|
</div> |
|
|
|
|
|
|
|
<InputSearch style="width: 402px;" :formList="searchFormList" :formConfigOptions="{ labelWidth: '72px' }" |
|
|
|
@handleSearch="handleSearch" /> |
|
|
|
<InputSearch |
|
|
|
style="width: 402px" |
|
|
|
:formList="searchFormList" |
|
|
|
:formConfigOptions="{ labelWidth: '72px' }" |
|
|
|
placeholder="请输入姓名、电话,回车搜索" |
|
|
|
type="input" |
|
|
|
:valueData="valueData" |
|
|
|
:params="params" |
|
|
|
:queryParams="queryParams" |
|
|
|
@handleSearch="handleSearch" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class='body'> |
|
|
|
<ElEmpty v-if="!data.length && !isFirst" description="暂无数据" style="width: 100%;height: 100%;position: absolute;" /> |
|
|
|
<div class="body"> |
|
|
|
<ElEmpty |
|
|
|
v-if="!data.length && !isFirst" |
|
|
|
description="暂无数据" |
|
|
|
style="width: 100%; height: 100%; position: absolute" |
|
|
|
/> |
|
|
|
<template v-else> |
|
|
|
<PeopleCard v-for="(item, index) in data" :cardData="item" :key="index" |
|
|
|
@edit="data => handleOpenDialogAddEdit(data)" @delete="handleDelete" /> |
|
|
|
<PeopleCard |
|
|
|
v-for="(item, index) in data" |
|
|
|
:cardData="item" |
|
|
|
:key="index" |
|
|
|
@edit="(data) => handleOpenDialogAddEdit(data)" |
|
|
|
@delete="handleDelete" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
|
|
|
@ -40,27 +58,28 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import PeopleCard from "./../../components/PeopleCard/index.vue"; |
|
|
|
import InputSearch from '@screen/components/InputSearch/index.vue'; |
|
|
|
import ButtonGradient from '@screen/components/Buttons/ButtonGradient.vue'; |
|
|
|
import AddNEditDialog from "./components/AddNEditDialog.vue" |
|
|
|
import InputSearch from "@screen/components/InputSearch/index.vue"; |
|
|
|
import ButtonGradient from "@screen/components/Buttons/ButtonGradient.vue"; |
|
|
|
import AddNEditDialog from "./components/AddNEditDialog.vue"; |
|
|
|
|
|
|
|
import { Message } from "element-ui"; |
|
|
|
import { searchFormList } from "./data"; |
|
|
|
import request from "@/utils/request"; |
|
|
|
import { setLoading } from "@screen/utils/index.js" |
|
|
|
import { setLoading } from "@screen/utils/index.js"; |
|
|
|
import { delay, exportFile, confirm } from "@screen/utils/common"; |
|
|
|
import { getSelectOptionsStation } from "@screen/pages/control/event/businessDataManagement/utils.js"; |
|
|
|
import { values } from "lodash"; |
|
|
|
|
|
|
|
// 应急人员 |
|
|
|
export default { |
|
|
|
name: 'FirstResponders', |
|
|
|
name: "FirstResponders", |
|
|
|
components: { |
|
|
|
PeopleCard, |
|
|
|
ButtonGradient, |
|
|
|
InputSearch, |
|
|
|
AddNEditDialog |
|
|
|
AddNEditDialog, |
|
|
|
}, |
|
|
|
inject: ['getPagination', 'setTotal', 'setCurrentPage'], |
|
|
|
inject: ["getPagination", "setTotal", "setCurrentPage"], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
searchFormList, |
|
|
@ -68,7 +87,10 @@ export default { |
|
|
|
addNEditDialogVisible: false, |
|
|
|
dialogData: null, |
|
|
|
isFirst: true, |
|
|
|
} |
|
|
|
valueData: "", |
|
|
|
params: "value", |
|
|
|
queryParams: ["phone", "name"], |
|
|
|
}; |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getData(); |
|
|
@ -81,11 +103,11 @@ export default { |
|
|
|
request({ |
|
|
|
url: `/business/employees/${data.id}`, |
|
|
|
method: "DELETE", |
|
|
|
data: {} |
|
|
|
data: {}, |
|
|
|
}) |
|
|
|
.then((result) => { |
|
|
|
if (result.code != 200) return Message.error(`删除失败!`); |
|
|
|
this.setCurrentPage(1) |
|
|
|
this.setCurrentPage(1); |
|
|
|
Message.success(`删除成功!`); |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
@ -102,24 +124,28 @@ export default { |
|
|
|
request({ |
|
|
|
url: `/business/employees/sysPost`, |
|
|
|
method: "post", |
|
|
|
data: {} |
|
|
|
data: {}, |
|
|
|
}), |
|
|
|
|
|
|
|
// 机构 |
|
|
|
getSelectOptionsStation() |
|
|
|
]) |
|
|
|
.then(([post, organization]) => { |
|
|
|
if (post.status === 'fulfilled' && post.value.code == 200) { |
|
|
|
this.searchFormList[0].options.options = post.value.data.map(item => ({ |
|
|
|
getSelectOptionsStation(), |
|
|
|
]).then(([post, organization]) => { |
|
|
|
if (post.status === "fulfilled" && post.value.code == 200) { |
|
|
|
this.searchFormList[0].options.options = post.value.data.map( |
|
|
|
(item) => ({ |
|
|
|
key: item.postId, |
|
|
|
label: item.postName, |
|
|
|
})) |
|
|
|
}) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
if (organization.status === 'fulfilled' && Array.isArray(organization.value)) { |
|
|
|
if ( |
|
|
|
organization.status === "fulfilled" && |
|
|
|
Array.isArray(organization.value) |
|
|
|
) { |
|
|
|
this.searchFormList[1].options.options = organization.value; |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
handleExport() { |
|
|
|
exportFile({ |
|
|
@ -127,11 +153,12 @@ export default { |
|
|
|
filename: "应急人员", |
|
|
|
data: { |
|
|
|
...this.searchData, |
|
|
|
...this.getPagination() |
|
|
|
} |
|
|
|
...this.getPagination(), |
|
|
|
}, |
|
|
|
}); |
|
|
|
}, |
|
|
|
handleSearch(data) { |
|
|
|
console.log(88888, data); |
|
|
|
this.searchData = data; |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
@ -145,26 +172,27 @@ export default { |
|
|
|
method: "get", |
|
|
|
params: { |
|
|
|
...this.searchData, |
|
|
|
...this.getPagination() |
|
|
|
} |
|
|
|
}).then(result => { |
|
|
|
...this.getPagination(), |
|
|
|
}, |
|
|
|
}) |
|
|
|
.then((result) => { |
|
|
|
if (result.code != 200) return; |
|
|
|
|
|
|
|
this.data = result.rows; |
|
|
|
|
|
|
|
this.setTotal(result.total) |
|
|
|
}).finally(() => { |
|
|
|
this.setTotal(result.total); |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
this.isFirst = false; |
|
|
|
closeLoading(); |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang='scss' scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
.FirstResponders { |
|
|
|
|
|
|
|
.body { |
|
|
|
display: grid; |
|
|
|
grid-template-columns: repeat(10, 1fr); |
|
|
|