|
@@ -1,24 +1,17 @@
|
|
|
<script>
|
|
|
import TimeRange from "@/components/common/timeRange.vue";
|
|
|
+import apiSecurityPerson from "@/api/security/apiSecurityPerson";
|
|
|
|
|
|
export default {
|
|
|
components: {TimeRange},
|
|
|
data() {
|
|
|
return {
|
|
|
+ loading: false,
|
|
|
showDetail: false,
|
|
|
currRecord: {},
|
|
|
formData: {},
|
|
|
- tableData: [{
|
|
|
- id: 1,
|
|
|
- name: '123'
|
|
|
- }],
|
|
|
+ tableData: [],
|
|
|
columns: [
|
|
|
- {
|
|
|
- title: '图片',
|
|
|
- dataIndex: "image",
|
|
|
- key: "image",
|
|
|
- align: 'center',
|
|
|
- },
|
|
|
{
|
|
|
title: '姓名',
|
|
|
dataIndex: "name",
|
|
@@ -30,11 +23,12 @@ export default {
|
|
|
dataIndex: "type",
|
|
|
key: "type",
|
|
|
align: 'center',
|
|
|
+ scopedSlots: {customRender: 'type'},
|
|
|
},
|
|
|
{
|
|
|
title: '工作区域',
|
|
|
- dataIndex: "area",
|
|
|
- key: "area",
|
|
|
+ dataIndex: "scope",
|
|
|
+ key: "scope",
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
@@ -42,6 +36,7 @@ export default {
|
|
|
dataIndex: "duty",
|
|
|
key: "duty",
|
|
|
align: 'center',
|
|
|
+ scopedSlots: {customRender: 'duty'},
|
|
|
},
|
|
|
{
|
|
|
title: '操作',
|
|
@@ -54,15 +49,43 @@ export default {
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.getPersonData()
|
|
|
+ },
|
|
|
methods: {
|
|
|
viewDetail(record) {
|
|
|
this.currRecord = JSON.parse(JSON.stringify(record));
|
|
|
this.showDetail = true;
|
|
|
-
|
|
|
+ },
|
|
|
+ getPersonData() {
|
|
|
+ this.loading = true
|
|
|
+ apiSecurityPerson.getPersonDuty({
|
|
|
+ }).then(res=>{
|
|
|
+ this.tableData = res;
|
|
|
+ this.oriData= JSON.parse(JSON.stringify(this.tableData));
|
|
|
+ this.loading = false;
|
|
|
+ }).catch(err=>{
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
},
|
|
|
handleCancel() {
|
|
|
this.currRecord = {};
|
|
|
this.showDetail = false;
|
|
|
+ },
|
|
|
+ reset() {
|
|
|
+ this.formData = {};
|
|
|
+ this.search()
|
|
|
+ },
|
|
|
+ search() {
|
|
|
+ this.tableData = this.oriData.filter(item=>{
|
|
|
+ if (this.formData.type && this.formData.type!='' && item.type!=this.formData.type) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (this.formData.name && this.formData.name!='' && item.name.indexOf(this.formData.name)<0) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -74,20 +97,21 @@ export default {
|
|
|
<a-form-model :model="formData" layout="inline">
|
|
|
<a-form-model-item label="人员类型">
|
|
|
<a-select v-model="formData.type" placeholder="人员类型" style="width: 130px">
|
|
|
- <a-select-option value="front">前台人员</a-select-option>
|
|
|
- <a-select-option value="security">安防人员</a-select-option>
|
|
|
+ <a-select-option value="1">前台人员</a-select-option>
|
|
|
+ <a-select-option value="2">安防人员</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-model-item>
|
|
|
- <a-form-model-item label="值班时段">
|
|
|
- <TimeRange :disabled-time="false"
|
|
|
- :show-time="{ hideDisabledOptions: true, defaultValue: [ $moment('00:00:00', 'HH:mm:ss'), $moment('23:59:59', 'HH:mm:ss'), ], }"
|
|
|
- :time-format="'YYYY/MM/DD HH:mm:ss'"
|
|
|
- >
|
|
|
- </TimeRange>
|
|
|
+ <a-form-model-item label="姓名">
|
|
|
+ <!--<TimeRange :disabled-time="false"-->
|
|
|
+ <!-- :show-time="{ hideDisabledOptions: true, defaultValue: [ $moment('00:00:00', 'HH:mm:ss'), $moment('23:59:59', 'HH:mm:ss'), ], }"-->
|
|
|
+ <!-- :time-format="'YYYY/MM/DD HH:mm:ss'"-->
|
|
|
+ <!-->-->
|
|
|
+ <!--</TimeRange>-->
|
|
|
+ <a-input v-model="formData.name" placeholder="请输入姓名" />
|
|
|
</a-form-model-item>
|
|
|
- <a-form-model-item>
|
|
|
- <a-button type="primary">重置</a-button>
|
|
|
- <a-button type="primary">查询</a-button>
|
|
|
+ <a-form-model-item >
|
|
|
+ <a-button style="width: 80px" size="small" type="info" @click="reset">重置</a-button>
|
|
|
+ <a-button style="width: 80px" size="small" type="primary" @click="search">查询</a-button>
|
|
|
</a-form-model-item>
|
|
|
</a-form-model>
|
|
|
</div>
|
|
@@ -95,21 +119,31 @@ export default {
|
|
|
<div style="font-weight: 400;color: #333333;line-height: 45px;font-size: 16px;margin-bottom: 6px">人员信息</div>
|
|
|
<a-table
|
|
|
:rowKey=" (record, index) => index"
|
|
|
+ :loading="loading"
|
|
|
:columns="columns"
|
|
|
:data-source="tableData"
|
|
|
:pagination="true"
|
|
|
- style="height: 300px"
|
|
|
+ style="height: 300px;background-color: white"
|
|
|
>
|
|
|
<template #operation="text, record">
|
|
|
<a-button type="link" @click="viewDetail(record)">查看详情</a-button>
|
|
|
</template>
|
|
|
+ <template #type="text, record">
|
|
|
+ <span v-if="record.type=='1'" >前台人员</span>
|
|
|
+ <span v-else-if="record.type=='2'" >安防人员</span>
|
|
|
+ <span v-else>未知</span>
|
|
|
+ </template>
|
|
|
+ <template #duty="text, record">
|
|
|
+ <span>{{ record.duty_start_time }}</span>/
|
|
|
+ <span>{{ record.duty_end_time }}</span>
|
|
|
+ </template>
|
|
|
</a-table>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<a-modal class="securityPersonMoreDetail" v-if="showDetail"
|
|
|
:visible="true"
|
|
|
- :width="600"
|
|
|
+ :width="650"
|
|
|
:footer="null"
|
|
|
@cancel="handleCancel"
|
|
|
>
|
|
@@ -117,34 +151,31 @@ export default {
|
|
|
<a-divider/>
|
|
|
|
|
|
<div style="width: 100%;height: 100%">
|
|
|
- <div style="width: 40%;display: inline-block">
|
|
|
- <img width="100%" height="100%" src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"/>
|
|
|
+ <div style="width: 40%;display: inline-block;margin-right: 5%">
|
|
|
+ <img width="100%" height="100%" :src="currRecord.photo"/>
|
|
|
</div>
|
|
|
- <div style="width: 60%;display: inline-block;vertical-align: top">
|
|
|
+ <div style="width: 50%;display: inline-block;vertical-align: top">
|
|
|
<a-descriptions :column="1" size="small">
|
|
|
<a-descriptions-item label="姓名">
|
|
|
- 刘玉英
|
|
|
- </a-descriptions-item>
|
|
|
- <a-descriptions-item label="性别">
|
|
|
- 女
|
|
|
+ {{ currRecord.name }}
|
|
|
</a-descriptions-item>
|
|
|
<a-descriptions-item label="工号">
|
|
|
- 31313131
|
|
|
+ {{ currRecord.work_number }}
|
|
|
</a-descriptions-item>
|
|
|
<a-descriptions-item label="工作类型">
|
|
|
前台人员
|
|
|
</a-descriptions-item>
|
|
|
<a-descriptions-item label="联系电话">
|
|
|
- 18611111111
|
|
|
+ {{ currRecord.phone }}
|
|
|
</a-descriptions-item>
|
|
|
<a-descriptions-item label="工作区域">
|
|
|
- 一层大厅前台
|
|
|
+ {{ currRecord.scope }}
|
|
|
</a-descriptions-item>
|
|
|
<a-descriptions-item label="入职日期">
|
|
|
- 2022年3月1日
|
|
|
+ -
|
|
|
</a-descriptions-item>
|
|
|
<a-descriptions-item label="今日工作时段">
|
|
|
- 上午8:00-12:00 下午13::30-17:30
|
|
|
+ {{ currRecord.duty_start_time }}/{{ currRecord.duty_end_time }}
|
|
|
</a-descriptions-item>
|
|
|
</a-descriptions>
|
|
|
</div>
|
|
@@ -156,7 +187,7 @@ export default {
|
|
|
<style lang="less" scoped>
|
|
|
.security-person-more {
|
|
|
width: 100%;
|
|
|
- height: auto;
|
|
|
+ height: 100%;
|
|
|
.security-person-more-query {
|
|
|
padding-left: 30px;
|
|
|
}
|
|
@@ -165,6 +196,8 @@ export default {
|
|
|
margin-top: 15px;
|
|
|
background-color: #ffffff;
|
|
|
padding: 0 30px;
|
|
|
+ height: 600px;
|
|
|
+ overflow-y: auto;
|
|
|
}
|
|
|
}
|
|
|
</style>
|