|
|
@ -1,5 +1,5 @@ |
|
|
|
<template> |
|
|
|
<div class='DutyOfficer'> |
|
|
|
<div class="DutyOfficer"> |
|
|
|
<div class="filter"> |
|
|
|
<div> |
|
|
|
<ButtonGradient @click.native="handleExport"> |
|
|
@ -34,25 +34,28 @@ |
|
|
|
</ButtonGradient> |
|
|
|
</div> |
|
|
|
|
|
|
|
<InputSearch |
|
|
|
style="width: 402px;" |
|
|
|
:formList="searchFormList" |
|
|
|
<InputSearch |
|
|
|
style="width: 402px" |
|
|
|
:formList="searchFormList" |
|
|
|
:formConfigOptions="{ labelWidth: '100px' }" |
|
|
|
placeholder="请输入姓名、电话,回车搜索" |
|
|
|
type="input" |
|
|
|
:params="params" |
|
|
|
@handleSearch="handleSearch" /> |
|
|
|
@handleSearch="handleSearch" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="body"> |
|
|
|
<ElEmpty v-if="!data.length && !isFirst" description="暂无数据" style="width: 100%;height: 100%;position: absolute;" /> |
|
|
|
<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> --> |
|
|
|
|
|
|
|
<SpecialTable v-else :columns="columns" :data="data" class="body"> |
|
|
|
<template #title-DateDuty> |
|
|
|
<div class="special-title"> |
|
|
|
值班中心 |
|
|
|
</div> |
|
|
|
<div class="special-title">值班中心</div> |
|
|
|
</template> |
|
|
|
<template #content-date="{ data }"> |
|
|
|
<div class="item"> |
|
|
@ -64,46 +67,62 @@ |
|
|
|
<div class="parent"> |
|
|
|
<div class="item"> |
|
|
|
<img src="@screen/images/form/location.svg" /> |
|
|
|
{{ data['organizationName'] }} |
|
|
|
{{ data["organizationName"] }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<template #content-dayShift="{ data }"> |
|
|
|
<div class="item-parent" v-if="data.dayShift && data.dayShift.length"> |
|
|
|
<div class="item" v-for="(item,index) in data.dayShift" :key="index" > |
|
|
|
<div |
|
|
|
class="item" |
|
|
|
v-for="(item, index) in data.dayShift" |
|
|
|
:key="index" |
|
|
|
> |
|
|
|
<img src="@screen/images/form/people.svg" /> |
|
|
|
{{ item.name }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="no-data" v-else> |
|
|
|
无值班人员 |
|
|
|
</div> |
|
|
|
<div class="no-data" v-else>无值班人员</div> |
|
|
|
</template> |
|
|
|
<template #content-graveyardShift="{ data }"> |
|
|
|
<div class="item-parent" v-if="data.graveyardShift && data.graveyardShift.length"> |
|
|
|
<div class="item" v-for="(item,index) in data.graveyardShift" :key="index"> |
|
|
|
<div |
|
|
|
class="item-parent" |
|
|
|
v-if="data.graveyardShift && data.graveyardShift.length" |
|
|
|
> |
|
|
|
<div |
|
|
|
class="item" |
|
|
|
v-for="(item, index) in data.graveyardShift" |
|
|
|
:key="index" |
|
|
|
> |
|
|
|
<img src="@screen/images/form/people.svg" /> |
|
|
|
{{ item.name }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="no-data" v-else> |
|
|
|
无值班人员 |
|
|
|
</div> |
|
|
|
<div class="no-data" v-else>无值班人员</div> |
|
|
|
</template> |
|
|
|
<template #operation-content="{ data }"> |
|
|
|
<ButtonGradient class="operate-button" @click.native="handleModifyDutyInformationTable(true, data)"> |
|
|
|
<ButtonGradient |
|
|
|
class="operate-button" |
|
|
|
@click.native="handleModifyDutyInformationTable(true, data)" |
|
|
|
> |
|
|
|
<template #prefix> |
|
|
|
<img src="@screen/images/form/edit.svg" /> |
|
|
|
</template> |
|
|
|
修改 |
|
|
|
</ButtonGradient> |
|
|
|
<ButtonGradient class="operate-button" @click.native="handleOperateRecord(true, data)"> |
|
|
|
<ButtonGradient |
|
|
|
class="operate-button" |
|
|
|
@click.native="handleOperateRecord(true, data)" |
|
|
|
> |
|
|
|
<template #prefix> |
|
|
|
<img src="@screen/images/form/record.svg" /> |
|
|
|
</template> |
|
|
|
记录 |
|
|
|
</ButtonGradient> |
|
|
|
<ButtonGradient class="operate-button" @click.native="handleDelete(data)"> |
|
|
|
<ButtonGradient |
|
|
|
class="operate-button" |
|
|
|
@click.native="handleDelete(data)" |
|
|
|
> |
|
|
|
<template #prefix> |
|
|
|
<img src="@screen/images/form/delete.svg" /> |
|
|
|
</template> |
|
|
@ -112,61 +131,67 @@ |
|
|
|
</template> |
|
|
|
</SpecialTable> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<OperateRecord :visible="operateRecordVisible" @close="handleOperateRecord(false)" :data="dialogData" /> |
|
|
|
<OperateRecord |
|
|
|
:visible="operateRecordVisible" |
|
|
|
@close="handleOperateRecord(false)" |
|
|
|
:data="dialogData" |
|
|
|
/> |
|
|
|
|
|
|
|
<ModifyDutyInformationTable :visible="modifyDutyInformationTableVisible" :data="dialogData" |
|
|
|
@close="handleModifyDutyInformationTable(false)" /> |
|
|
|
<ModifyDutyInformationTable |
|
|
|
:visible="modifyDutyInformationTableVisible" |
|
|
|
:data="dialogData" |
|
|
|
@close="handleModifyDutyInformationTable(false)" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import SpecialTable from "./../../components/SpecialTable.vue" |
|
|
|
import OperateRecord from "./components/OperateRecord.vue" |
|
|
|
import ModifyDutyInformationTable from "./components/ModifyDutyInformationTable.vue" |
|
|
|
import ButtonGradient from '@screen/components/Buttons/ButtonGradient.vue'; |
|
|
|
import InputSearch from '@screen/components/InputSearch/index.vue'; |
|
|
|
import SpecialTable from "./../../components/SpecialTable.vue"; |
|
|
|
import OperateRecord from "./components/OperateRecord.vue"; |
|
|
|
import ModifyDutyInformationTable from "./components/ModifyDutyInformationTable.vue"; |
|
|
|
import ButtonGradient from "@screen/components/Buttons/ButtonGradient.vue"; |
|
|
|
import InputSearch from "@screen/components/InputSearch/index.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, uploadFile } from "@screen/utils/common"; |
|
|
|
import { Message } from "element-ui"; |
|
|
|
import { getSelectOptionsStation } from "@screen/pages/control/event/businessDataManagement/utils.js"; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'DutyOfficer', |
|
|
|
name: "DutyOfficer", |
|
|
|
components: { |
|
|
|
SpecialTable, |
|
|
|
OperateRecord, |
|
|
|
ModifyDutyInformationTable, |
|
|
|
ButtonGradient, |
|
|
|
InputSearch |
|
|
|
InputSearch, |
|
|
|
}, |
|
|
|
inject: ['getPagination', 'setTotal', 'setCurrentPage'], |
|
|
|
inject: ["getPagination", "setTotal", "setCurrentPage"], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
columns: [ |
|
|
|
{ |
|
|
|
key: "date", |
|
|
|
title: "值班日期", |
|
|
|
width: "210px" |
|
|
|
width: "210px", |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: "organizationName", |
|
|
|
title: "驻点", |
|
|
|
width: "240px" |
|
|
|
width: "240px", |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: "dayShift", |
|
|
|
title: "白班", |
|
|
|
width: "510px" |
|
|
|
width: "510px", |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: "graveyardShift", |
|
|
|
title: "夜班", |
|
|
|
width: "510px" |
|
|
|
width: "510px", |
|
|
|
}, |
|
|
|
], |
|
|
|
data: [], |
|
|
@ -177,8 +202,8 @@ export default { |
|
|
|
required: false, |
|
|
|
type: "datePicker", |
|
|
|
options: { |
|
|
|
valueFormat: "yyyy-MM-dd" |
|
|
|
} |
|
|
|
valueFormat: "yyyy-MM-dd", |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "驻点:", |
|
|
@ -195,7 +220,7 @@ export default { |
|
|
|
dialogData: null, |
|
|
|
isFirst: true, |
|
|
|
params: "name", |
|
|
|
} |
|
|
|
}; |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getData(); |
|
|
@ -203,7 +228,6 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
async getOptions() { |
|
|
|
|
|
|
|
const result = await getSelectOptionsStation(2); |
|
|
|
|
|
|
|
this.searchFormList[1].options.options = result; |
|
|
@ -230,8 +254,8 @@ export default { |
|
|
|
filename: "机构值班表", |
|
|
|
data: { |
|
|
|
...this.searchData, |
|
|
|
...this.getPagination() |
|
|
|
} |
|
|
|
...this.getPagination(), |
|
|
|
}, |
|
|
|
}); |
|
|
|
}, |
|
|
|
handleExportTemplate() { |
|
|
@ -240,8 +264,8 @@ export default { |
|
|
|
filename: "机构值班表面板", |
|
|
|
data: { |
|
|
|
...this.searchData, |
|
|
|
...this.getPagination() |
|
|
|
} |
|
|
|
...this.getPagination(), |
|
|
|
}, |
|
|
|
}); |
|
|
|
}, |
|
|
|
handleSearch(data) { |
|
|
@ -258,35 +282,36 @@ export default { |
|
|
|
method: "get", |
|
|
|
params: { |
|
|
|
...this.searchData, |
|
|
|
...this.getPagination() |
|
|
|
} |
|
|
|
...this.getPagination(), |
|
|
|
}, |
|
|
|
}) |
|
|
|
.then(result => { |
|
|
|
.then((result) => { |
|
|
|
if (result.code != 200) return; |
|
|
|
this.data = result.rows.map(item => { |
|
|
|
this.data = result.rows.map((item) => { |
|
|
|
const result = { |
|
|
|
date: item.date, |
|
|
|
organizationName: item.organizationName, |
|
|
|
station: item.station, |
|
|
|
id: item.id |
|
|
|
} |
|
|
|
id: item.id, |
|
|
|
}; |
|
|
|
|
|
|
|
item.shiftsList.forEach(item => { |
|
|
|
const key = { 1: 'dayShift', 2: 'graveyardShift' }[item.scheduling]; |
|
|
|
item.shiftsList.forEach((item) => { |
|
|
|
const key = { 1: "dayShift", 2: "graveyardShift" }[ |
|
|
|
item.scheduling |
|
|
|
]; |
|
|
|
if (!result[key]) result[key] = []; |
|
|
|
|
|
|
|
result[key].push(item); |
|
|
|
}) |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return result |
|
|
|
return result; |
|
|
|
}); |
|
|
|
this.setTotal(result.total); |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
this.isFirst = false; |
|
|
|
closeLoading(); |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
async handleDelete(data) { |
|
|
|
await confirm({ message: "是否要删除该值班信息?" }); |
|
|
@ -297,31 +322,30 @@ export default { |
|
|
|
data: { |
|
|
|
date: data.date, |
|
|
|
station: data.station, |
|
|
|
} |
|
|
|
}, |
|
|
|
}) |
|
|
|
.then(result => { |
|
|
|
.then((result) => { |
|
|
|
if (result.code != 200) return Message.error("删除失败"); |
|
|
|
this.setCurrentPage(1) |
|
|
|
this.setCurrentPage(1); |
|
|
|
|
|
|
|
Message.success("删除成功") |
|
|
|
Message.success("删除成功"); |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
Message.error("删除失败") |
|
|
|
}) |
|
|
|
Message.error("删除失败"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
uploadFile() { |
|
|
|
uploadFile({ url: "/business/shifts/importEquipment" }); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang='scss' scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
.DutyOfficer { |
|
|
|
|
|
|
|
.special-title { |
|
|
|
background: linear-gradient(180deg, #FFC071 0%, #D68D00 100%); |
|
|
|
background: linear-gradient(180deg, #ffc071 0%, #d68d00 100%); |
|
|
|
background-clip: text; |
|
|
|
color: transparent; |
|
|
|
} |
|
|
|