|
|
@ -1,5 +1,5 @@ |
|
|
|
<template> |
|
|
|
<div class='EmergencyAgencies'> |
|
|
|
<div class="EmergencyAgencies"> |
|
|
|
<div class="filter"> |
|
|
|
<div> |
|
|
|
<ButtonGradient @click.native="handleOpenDialogAddEdit()"> |
|
|
@ -22,21 +22,39 @@ |
|
|
|
</ButtonGradient> |
|
|
|
</div> |
|
|
|
|
|
|
|
<InputSearch style="width: 402px;" :formList="searchFormList" :formConfigOptions="{ labelWidth: '90px' }" |
|
|
|
@handleSearch="handleSearch" /> |
|
|
|
<InputSearch |
|
|
|
style="width: 402px" |
|
|
|
:formList="searchFormList" |
|
|
|
:formConfigOptions="{ labelWidth: '90px' }" |
|
|
|
@handleSearch="handleSearch" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class='body'> |
|
|
|
<div class="body"> |
|
|
|
<!-- <ElEmpty v-if="!data.length && !isFirst" description="暂无数据" style="width: 100%;height: 100%;position: absolute;" /> --> |
|
|
|
<div v-if="!data.length && !isFirst" class="no-data" style="position: absolute">暂无数据</div> |
|
|
|
<div |
|
|
|
v-if="!dataList.length && !isFirst" |
|
|
|
class="no-data" |
|
|
|
style="position: absolute" |
|
|
|
> |
|
|
|
暂无数据 |
|
|
|
</div> |
|
|
|
|
|
|
|
<template v-else> |
|
|
|
<Card v-for="(item, index) in data" :keyMap="keyMap" :cardData="item" :key="index"> |
|
|
|
<Card |
|
|
|
v-for="(item, index) in dataList" |
|
|
|
:keyMap="keyMap" |
|
|
|
:cardData="item" |
|
|
|
:key="index" |
|
|
|
> |
|
|
|
<template #button> |
|
|
|
<Button @click.native="() => handleOpenDialogAddEdit(item)"> |
|
|
|
修改 |
|
|
|
</Button> |
|
|
|
<Button style="background-color: #FF5F5F;" @click.native="handleDelete(item)"> |
|
|
|
<Button |
|
|
|
style="background-color: #ff5f5f" |
|
|
|
@click.native="handleDelete(item)" |
|
|
|
> |
|
|
|
删除 |
|
|
|
</Button> |
|
|
|
</template> |
|
|
@ -49,30 +67,30 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import Card from "@screen/components/Card1/index.vue" |
|
|
|
import InputSearch from '@screen/components/InputSearch/index.vue'; |
|
|
|
import ButtonGradient from '@screen/components/Buttons/ButtonGradient.vue'; |
|
|
|
import Button from '@screen/components/Buttons/Button.vue'; |
|
|
|
import AddNEditDialog from "./components/AddNEditDialog.vue" |
|
|
|
import Card from "@screen/components/Card1/index.vue"; |
|
|
|
import InputSearch from "@screen/components/InputSearch/index.vue"; |
|
|
|
import ButtonGradient from "@screen/components/Buttons/ButtonGradient.vue"; |
|
|
|
import Button from "@screen/components/Buttons/Button.vue"; |
|
|
|
import AddNEditDialog from "./components/AddNEditDialog.vue"; |
|
|
|
|
|
|
|
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 { Message } from "element-ui"; |
|
|
|
|
|
|
|
let vehicleTypeList = []; |
|
|
|
// let vehicleTypeList = []; |
|
|
|
|
|
|
|
// 应急机构 |
|
|
|
export default { |
|
|
|
name: 'EmergencyAgencies', |
|
|
|
inject: ['getPagination', 'setTotal', 'setCurrentPage'], |
|
|
|
name: "EmergencyAgencies", |
|
|
|
inject: ["getPagination", "setTotal", "setCurrentPage"], |
|
|
|
components: { |
|
|
|
Card, |
|
|
|
ButtonGradient, |
|
|
|
InputSearch, |
|
|
|
Button, |
|
|
|
AddNEditDialog |
|
|
|
AddNEditDialog, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -85,15 +103,15 @@ export default { |
|
|
|
// direction: "117.123456", |
|
|
|
// direction2: "37.12234", |
|
|
|
// })), |
|
|
|
data: [], |
|
|
|
dataList: [], |
|
|
|
keyMap: [ |
|
|
|
{ |
|
|
|
key: "dcOrganizations.organizationName", |
|
|
|
label: "机构名称" |
|
|
|
label: "机构名称", |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: "dcOrganizations.organizationAddress", |
|
|
|
label: "机构地址" |
|
|
|
label: "机构地址", |
|
|
|
}, |
|
|
|
// { |
|
|
|
// key: "coordinate.longitude", |
|
|
@ -105,24 +123,25 @@ export default { |
|
|
|
// }, |
|
|
|
{ |
|
|
|
key: "dcOrganizations.stakeMark", |
|
|
|
label: "桩号" |
|
|
|
label: "桩号", |
|
|
|
}, |
|
|
|
// { |
|
|
|
// key: "dcOrganizations.latitude", |
|
|
|
// label: "救援外协单位" |
|
|
|
// }, |
|
|
|
{ |
|
|
|
key: "car", |
|
|
|
key: "cars", |
|
|
|
label: "驻点车辆", |
|
|
|
value: "aaa" |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: "employeesNum", |
|
|
|
label: "驻点人员" |
|
|
|
} |
|
|
|
label: "驻点人员", |
|
|
|
suffix: "人", |
|
|
|
}, |
|
|
|
], |
|
|
|
isFirst: true |
|
|
|
} |
|
|
|
isFirst: true, |
|
|
|
vehicleTypeList: [], |
|
|
|
}; |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getData(); |
|
|
@ -130,24 +149,19 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getVehicleTypeList() { |
|
|
|
if (vehicleTypeList.length) return; |
|
|
|
if (this.vehicleTypeList.length) return; |
|
|
|
|
|
|
|
request({ |
|
|
|
url: `/system/dict/data/type/sys_vehicle_type`, |
|
|
|
method: "GET", |
|
|
|
params: {} |
|
|
|
params: {}, |
|
|
|
}) |
|
|
|
.then(({ data, code }) => { |
|
|
|
if (code != 200) return ;//Message.error("详情获取失败"); |
|
|
|
|
|
|
|
// vehicleTypeList = this.formList[5].options.options = data.map(item => ({ |
|
|
|
// key: item.dictValue, |
|
|
|
// label: item.dictLabel |
|
|
|
// })) |
|
|
|
console.log("Success", data); |
|
|
|
if (code != 200) return; //Message.error("详情获取失败"); |
|
|
|
this.vehicleTypeList = data; |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
|
|
|
|
}); |
|
|
|
.catch((err) => {}); |
|
|
|
}, |
|
|
|
async handleDelete(data) { |
|
|
|
await confirm({ message: "是否要删除该机构?" }); |
|
|
@ -155,11 +169,11 @@ export default { |
|
|
|
request({ |
|
|
|
url: `/business/organization/${data.dcOrganizations.id}`, |
|
|
|
method: "DELETE", |
|
|
|
data: {} |
|
|
|
data: {}, |
|
|
|
}) |
|
|
|
.then((result) => { |
|
|
|
if (result.code != 200) return Message.error(`删除失败!`); |
|
|
|
this.setCurrentPage(1) |
|
|
|
this.setCurrentPage(1); |
|
|
|
Message.success(`删除成功!`); |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
@ -182,8 +196,8 @@ export default { |
|
|
|
filename: "应急机构", |
|
|
|
data: { |
|
|
|
...this.searchData, |
|
|
|
...this.getPagination() |
|
|
|
} |
|
|
|
...this.getPagination(), |
|
|
|
}, |
|
|
|
}); |
|
|
|
}, |
|
|
|
async getData() { |
|
|
@ -196,26 +210,47 @@ export default { |
|
|
|
method: "get", |
|
|
|
params: { |
|
|
|
...this.searchData, |
|
|
|
...this.getPagination() |
|
|
|
} |
|
|
|
}).then(result => { |
|
|
|
if (result.code != 200) return; |
|
|
|
|
|
|
|
this.data = result.rows; |
|
|
|
this.setTotal(result.total) |
|
|
|
}).finally(() => { |
|
|
|
closeLoading(); |
|
|
|
this.isFirst = false; |
|
|
|
...this.getPagination(), |
|
|
|
}, |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
.then((result) => { |
|
|
|
if (result.code != 200) return; |
|
|
|
|
|
|
|
} |
|
|
|
this.dataList = result.rows; |
|
|
|
let data = []; |
|
|
|
this.vehicleTypeList.forEach((items) => { |
|
|
|
this.dataList.forEach((item) => { |
|
|
|
if (item.car.length > 0) { |
|
|
|
for (var i = 0; i < item.car.length; i++) { |
|
|
|
if (item.car[i].vehicleType == items.dictValue) { |
|
|
|
// let data = |
|
|
|
data.push(items.dictLabel + "*" + item.car[i].carNum); |
|
|
|
// item.cars = items.dictLabel + "*" + item.car[i].carNum; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
console.log(999, this.dataList); |
|
|
|
console.log(999, data); |
|
|
|
this.dataList.forEach((item) => { |
|
|
|
if (item.car.length > 0) { |
|
|
|
item.cars = data.join("、"); |
|
|
|
} |
|
|
|
}); |
|
|
|
this.setTotal(result.total); |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
closeLoading(); |
|
|
|
this.isFirst = false; |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang='scss' scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
.EmergencyAgencies { |
|
|
|
|
|
|
|
.body { |
|
|
|
display: grid; |
|
|
|
grid-template-columns: repeat(5, 1fr); |
|
|
@ -227,15 +262,15 @@ export default { |
|
|
|
.endSpecial { |
|
|
|
font-size: 14px; |
|
|
|
font-weight: 400; |
|
|
|
color: #00B3CC; |
|
|
|
color: #00b3cc; |
|
|
|
line-height: 16px; |
|
|
|
|
|
|
|
span:first-child { |
|
|
|
color: rgba(0, 179, 204, 1)#000; |
|
|
|
color: rgba(0, 179, 204, 1) #000; |
|
|
|
} |
|
|
|
|
|
|
|
span:last-child { |
|
|
|
color: rgba(217, 0, 27, 1) |
|
|
|
color: rgba(217, 0, 27, 1); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|