user 界面显示岗位
This commit is contained in:
parent
986c09bc22
commit
d81a6c77c8
|
@ -73,32 +73,36 @@
|
||||||
remoteFilter
|
remoteFilter
|
||||||
@selection-change="selectionChange"
|
@selection-change="selectionChange"
|
||||||
>
|
>
|
||||||
<!-- <el-table-column
|
<el-table-column
|
||||||
type="selection"
|
type="index"
|
||||||
width="50"
|
width="50"
|
||||||
></el-table-column> -->
|
></el-table-column>
|
||||||
<el-table-column label="ID" prop="id" width="160"></el-table-column>
|
<!-- <el-table-column label="ID" prop="id" width="160"></el-table-column> -->
|
||||||
<el-table-column label="姓名" prop="name"></el-table-column>
|
<el-table-column label="姓名" prop="name"></el-table-column>
|
||||||
<el-table-column label="登录账号" prop="username"></el-table-column>
|
<el-table-column label="登录账号" prop="username" width="140"></el-table-column>
|
||||||
<el-table-column label="是否启用" prop="is_active">
|
<el-table-column label="是否启用" prop="is_active">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tag type="success" v-if="scope.row.is_active">启用</el-tag>
|
<el-tag type="success" v-if="scope.row.is_active">启用</el-tag>
|
||||||
<el-tag v-else type="danger">禁用</el-tag>
|
<el-tag v-else type="danger">禁用</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="微信通知" width="80">
|
<!-- <el-table-column label="微信通知" width="80">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-icon v-if="scope.row.wx_openid" color="green"
|
<el-icon v-if="scope.row.wx_openid" color="green"
|
||||||
><CircleCheckFilled
|
><CircleCheckFilled
|
||||||
/></el-icon>
|
/></el-icon>
|
||||||
<el-icon v-else color="red"><CircleCloseFilled /></el-icon>
|
<el-icon v-else color="red"><CircleCloseFilled /></el-icon>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column label="账号类型" prop="type">
|
<el-table-column label="账号类型" prop="type">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span>{{userTypeOptions[scope.row.type]}}</span>
|
<span>{{userTypeOptions[scope.row.type]}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="部门" prop="belong_dept_name">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="岗位" prop="post_name">
|
||||||
|
</el-table-column>
|
||||||
<!-- <el-table-column label="小程序" width="80">
|
<!-- <el-table-column label="小程序" width="80">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-icon v-if="scope.row.wxmp_openid" color="green"
|
<el-icon v-if="scope.row.wxmp_openid" color="green"
|
||||||
|
|
|
@ -1,286 +1,326 @@
|
||||||
<template>
|
<template>
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'visit.create'"></el-button>
|
<el-button
|
||||||
</div>
|
type="primary"
|
||||||
<div class="right-panel">
|
icon="el-icon-plus"
|
||||||
<div class="right-panel-search">
|
@click="add"
|
||||||
<el-input
|
v-auth="'visit.create'"
|
||||||
v-model="query.search"
|
></el-button>
|
||||||
placeholder="名称"
|
<el-select
|
||||||
clearable
|
v-model="query.purpose"
|
||||||
@keyup.enter="handleQuery"
|
placeholder="来访事由"
|
||||||
></el-input>
|
@change="handleQuery"
|
||||||
<el-button
|
clearable
|
||||||
type="primary"
|
style="margin-left: 2px"
|
||||||
icon="el-icon-search"
|
>
|
||||||
@click="handleQuery"
|
<el-option
|
||||||
></el-button>
|
v-for="item in purposeOptions"
|
||||||
</div>
|
:key="item.value"
|
||||||
</div>
|
:label="item.label"
|
||||||
</el-header>
|
:value="item.value"
|
||||||
<el-main class="nopadding">
|
></el-option>
|
||||||
<scTable
|
</el-select>
|
||||||
ref="table"
|
<el-date-picker
|
||||||
:apiObj="apiObj"
|
v-model="timeRange"
|
||||||
row-key="id"
|
type="datetimerange"
|
||||||
@selection-change="selectionChange"
|
range-separator="至"
|
||||||
stripe
|
start-placeholder="来访时间始"
|
||||||
@resetQuery="resetQuery"
|
end-placeholder="来访时间止"
|
||||||
>
|
style="margin-left: 2px"
|
||||||
<el-table-column
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
label="#"
|
@change="handleQuery"
|
||||||
fixed="left"
|
clearable
|
||||||
type="index"
|
/>
|
||||||
width="50"
|
</div>
|
||||||
></el-table-column>
|
<div class="right-panel">
|
||||||
|
<div class="right-panel-search">
|
||||||
|
<el-input
|
||||||
|
v-model="query.search"
|
||||||
|
placeholder="名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
></el-input>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleQuery"
|
||||||
|
></el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-header>
|
||||||
|
<el-main class="nopadding">
|
||||||
|
<scTable
|
||||||
|
ref="table"
|
||||||
|
:apiObj="apiObj"
|
||||||
|
row-key="id"
|
||||||
|
@selection-change="selectionChange"
|
||||||
|
stripe
|
||||||
|
@resetQuery="resetQuery"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
label="#"
|
||||||
|
fixed="left"
|
||||||
|
type="index"
|
||||||
|
width="50"
|
||||||
|
></el-table-column>
|
||||||
|
|
||||||
<el-table-column label="来访事由" prop="state" width="180" fixed="left">
|
<el-table-column label="来访事由" prop="state" width="180" fixed="left">
|
||||||
<template #default="scope">{{purpose_[scope.row.purpose] }}</template>
|
<template #default="scope">{{
|
||||||
</el-table-column>
|
purpose_[scope.row.purpose]
|
||||||
<el-table-column
|
}}</template>
|
||||||
label="访问级别"
|
</el-table-column>
|
||||||
prop="level"
|
<el-table-column
|
||||||
min-width="100"
|
label="访问级别"
|
||||||
fixed="left"
|
prop="level"
|
||||||
>
|
min-width="100"
|
||||||
<template #default="scope">
|
fixed="left"
|
||||||
<el-space v-if="scope.row.level==10">一般</el-space>
|
>
|
||||||
<el-space v-else>重要</el-space>
|
<template #default="scope">
|
||||||
</template>
|
<el-space v-if="scope.row.level == 10">一般</el-space>
|
||||||
</el-table-column>
|
<el-space v-else>重要</el-space>
|
||||||
<el-table-column
|
</template>
|
||||||
label="来访单位"
|
</el-table-column>
|
||||||
prop="company"
|
<el-table-column
|
||||||
min-width="180"
|
label="来访单位"
|
||||||
fixed="left"
|
prop="company"
|
||||||
></el-table-column>
|
min-width="180"
|
||||||
<el-table-column
|
fixed="left"
|
||||||
label="项目状态"
|
></el-table-column>
|
||||||
prop="state"
|
<el-table-column label="项目状态" prop="state" min-width="180">
|
||||||
min-width="180"
|
<template #default="scope">{{ state_[scope.row.state] }}</template>
|
||||||
>
|
</el-table-column>
|
||||||
<template #default="scope">{{state_[scope.row.state] }}</template>
|
<el-table-column label="审批状态" prop="state" min-width="150">
|
||||||
</el-table-column>
|
<template #default="scope">
|
||||||
<el-table-column
|
<span
|
||||||
label="审批状态"
|
v-if="scope.row.ticket_ && scope.row.ticket_.state_"
|
||||||
prop="state"
|
style="margin-right: 5px"
|
||||||
min-width="150"
|
>{{ scope.row.ticket_.state_.name }}</span
|
||||||
>
|
>
|
||||||
<template #default="scope">
|
<el-tag
|
||||||
<span v-if="scope.row.ticket_&&scope.row.ticket_.state_" style="margin-right: 5px;">{{scope.row.ticket_.state_.name }}</span>
|
v-if="scope.row.ticket_ && scope.row.ticket_.act_state"
|
||||||
<el-tag
|
class="mx-1"
|
||||||
v-if="scope.row.ticket_&&scope.row.ticket_.act_state"
|
size="small"
|
||||||
class="mx-1"
|
:type="
|
||||||
size="small"
|
scope.row.ticket_.act_state === 0
|
||||||
:type="scope.row.ticket_.act_state===0?'':scope.row.ticket_.act_state===1?'':scope.row.ticket_.act_state===2?'danger':scope.row.ticket_.act_state===3?'danger':scope.row.ticket_.act_state===5?'danger':scope.row.ticket_.act_state===4?'success':''"
|
? ''
|
||||||
>{{act_states[scope.row.ticket_.act_state]}}</el-tag>
|
: scope.row.ticket_.act_state === 1
|
||||||
</template>
|
? ''
|
||||||
</el-table-column>
|
: scope.row.ticket_.act_state === 2
|
||||||
<el-table-column
|
? 'danger'
|
||||||
|
: scope.row.ticket_.act_state === 3
|
||||||
|
? 'danger'
|
||||||
|
: scope.row.ticket_.act_state === 5
|
||||||
|
? 'danger'
|
||||||
|
: scope.row.ticket_.act_state === 4
|
||||||
|
? 'success'
|
||||||
|
: ''
|
||||||
|
"
|
||||||
|
>{{ act_states[scope.row.ticket_.act_state] }}</el-tag
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column
|
||||||
label="来访概述"
|
label="来访概述"
|
||||||
prop="name"
|
prop="name"
|
||||||
min-width="180"
|
min-width="180"
|
||||||
></el-table-column>
|
></el-table-column> -->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="来访详述"
|
label="来访时间"
|
||||||
prop="description"
|
prop="visit_time"
|
||||||
min-width="180"
|
width="180"
|
||||||
></el-table-column>
|
></el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="来访时间"
|
label="离开时间"
|
||||||
prop="visit_time"
|
prop="leave_time"
|
||||||
width="180"
|
width="180"
|
||||||
></el-table-column>
|
></el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="离开时间"
|
label="来访人数"
|
||||||
prop="leave_time"
|
prop="count_people"
|
||||||
width="180"
|
min-width="80"
|
||||||
></el-table-column>
|
></el-table-column>
|
||||||
<el-table-column
|
<el-table-column label="接待人" prop="receptionist_name" min-width="80">
|
||||||
label="来访人数"
|
<template #default="scope">
|
||||||
prop="count_people"
|
<span v-if="scope.row.receptionist_">{{
|
||||||
min-width="80"
|
scope.row.receptionist_.name
|
||||||
></el-table-column>
|
}}</span>
|
||||||
<el-table-column
|
</template>
|
||||||
label="属地部门"
|
</el-table-column>
|
||||||
prop="belong_dept"
|
<el-table-column
|
||||||
min-width="150"
|
label="创建时间"
|
||||||
></el-table-column>
|
prop="create_time"
|
||||||
<el-table-column
|
width="180"
|
||||||
label="接待人"
|
></el-table-column>
|
||||||
prop="receptionist_name"
|
<el-table-column label="操作" fixed="right" align="left" width="170">
|
||||||
min-width="80"
|
<template #default="scope">
|
||||||
>
|
<el-button
|
||||||
<template #default="scope">
|
link
|
||||||
<span v-if="scope.row.receptionist_">{{scope.row.receptionist_.name}}</span>
|
v-if="scope.row.state == 10"
|
||||||
</template>
|
type="primary"
|
||||||
</el-table-column>
|
size="small"
|
||||||
<el-table-column
|
@click="addpepple(scope.row, scope.$index)"
|
||||||
label="创建时间"
|
v-auth="'visit.update'"
|
||||||
prop="create_time"
|
>继续编辑
|
||||||
width="180"
|
</el-button>
|
||||||
></el-table-column>
|
<el-button
|
||||||
<el-table-column label="操作" fixed="right" align="left" width="170">
|
link
|
||||||
<template #default="scope">
|
type="primary"
|
||||||
<el-button
|
size="small"
|
||||||
link
|
@click="table_show(scope.row, scope.$index)"
|
||||||
v-if="scope.row.state==10"
|
>查看
|
||||||
type="primary"
|
</el-button>
|
||||||
size="small"
|
<el-button
|
||||||
@click="addpepple(scope.row, scope.$index)"
|
link
|
||||||
v-auth="'visit.update'"
|
type="primary"
|
||||||
>继续编辑
|
size="small"
|
||||||
</el-button>
|
@click="table_del(scope.row)"
|
||||||
<el-button
|
v-auth="'visit.delete'"
|
||||||
link
|
>删除
|
||||||
type="primary"
|
</el-button>
|
||||||
size="small"
|
</template>
|
||||||
@click="table_show(scope.row, scope.$index)"
|
</el-table-column>
|
||||||
>查看
|
</scTable>
|
||||||
</el-button>
|
</el-main>
|
||||||
<el-button
|
<save-dialog
|
||||||
link
|
v-if="dialog.save"
|
||||||
type="primary"
|
ref="saveDialog"
|
||||||
size="small"
|
@success="handleSaveSuccess"
|
||||||
@click="table_del(scope.row)"
|
@closed="dialog.save = false"
|
||||||
v-auth="'visit.delete'"
|
></save-dialog>
|
||||||
>删除
|
<detial-dialog v-if="dialog.save" ref="detialDialog"></detial-dialog>
|
||||||
</el-button>
|
</el-container>
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</scTable>
|
|
||||||
</el-main>
|
|
||||||
<save-dialog
|
|
||||||
v-if="dialog.save"
|
|
||||||
ref="saveDialog"
|
|
||||||
@success="handleSaveSuccess"
|
|
||||||
@closed="dialog.save = false"
|
|
||||||
></save-dialog>
|
|
||||||
<detial-dialog
|
|
||||||
v-if="dialog.save"
|
|
||||||
ref="detialDialog"
|
|
||||||
></detial-dialog>
|
|
||||||
</el-container>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import saveDialog from "./visit_form.vue";
|
import saveDialog from "./visit_form.vue";
|
||||||
import detialDialog from "./visit_detial.vue";
|
import detialDialog from "./visit_detial.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "visit",
|
name: "visit",
|
||||||
components: {
|
components: {
|
||||||
saveDialog,
|
saveDialog,
|
||||||
detialDialog
|
detialDialog,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialog: {
|
timeRange: [],
|
||||||
save: false,
|
dialog: {
|
||||||
permission: false,
|
save: false,
|
||||||
},
|
permission: false,
|
||||||
apiObj: this.$API.vm.visit.list,
|
},
|
||||||
query: {},
|
apiObj: this.$API.vm.visit.list,
|
||||||
selection: [],
|
query: {},
|
||||||
search: {
|
selection: [],
|
||||||
keyword: null,
|
search: {
|
||||||
},
|
keyword: null,
|
||||||
|
},
|
||||||
|
purposeOptions: [
|
||||||
|
{ label: "参观", value: 10 },
|
||||||
|
{ label: "拜访", value: 20 },
|
||||||
|
{ label: "面试", value: 30 },
|
||||||
|
{ label: "开会", value: 40 },
|
||||||
|
{ label: "拉送货", value: 50 },
|
||||||
|
],
|
||||||
|
purpose_: {
|
||||||
|
10: "参观",
|
||||||
|
20: "拜访",
|
||||||
|
30: "面试",
|
||||||
|
40: "开会",
|
||||||
|
50: "拉送货",
|
||||||
|
},
|
||||||
|
state_: {
|
||||||
|
10: "创建中",
|
||||||
|
20: "审批中",
|
||||||
|
30: "待入厂",
|
||||||
|
40: "进行中",
|
||||||
|
50: "已完成",
|
||||||
|
60: "已关闭",
|
||||||
|
},
|
||||||
|
act_states: {
|
||||||
|
0: "草稿中", //p
|
||||||
|
1: "进行中", //p
|
||||||
|
|
||||||
purpose_: {
|
2: "被退回", //d
|
||||||
10: "参观",
|
3: "被撤回", //d
|
||||||
20: "拜访",
|
|
||||||
30: "面试",
|
|
||||||
40: "开会"
|
|
||||||
},
|
|
||||||
state_: {
|
|
||||||
10: "创建中",
|
|
||||||
20: "审批中",
|
|
||||||
30: "待入厂",
|
|
||||||
40: "进行中",
|
|
||||||
50: "已完成",
|
|
||||||
60: "已关闭"
|
|
||||||
},
|
|
||||||
act_states: {
|
|
||||||
0: "草稿中",//p
|
|
||||||
1: "进行中",//p
|
|
||||||
|
|
||||||
2: "被退回",//d
|
4: "已完成", //s
|
||||||
3: "被撤回",//d
|
5: "已关闭", //d
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//添加
|
||||||
|
add() {
|
||||||
|
this.dialog.save = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.saveDialog.open("add");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
addpepple(row) {
|
||||||
|
this.$router.push({
|
||||||
|
name: "vistoradd",
|
||||||
|
query: {
|
||||||
|
visitid: row.id, //访问项目id
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
4: "已完成",//s
|
//查看
|
||||||
5: "已关闭",//d
|
table_show(row) {
|
||||||
},
|
this.dialog.save = true;
|
||||||
};
|
this.$nextTick(() => {
|
||||||
},
|
this.$refs.detialDialog.open("show").setData(row);
|
||||||
methods: {
|
});
|
||||||
//添加
|
},
|
||||||
add() {
|
|
||||||
this.dialog.save = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.saveDialog.open("add");
|
|
||||||
});
|
|
||||||
},
|
|
||||||
addpepple(row) {
|
|
||||||
this.$router.push({
|
|
||||||
name: "vistoradd",
|
|
||||||
query: {
|
|
||||||
visitid: row.id, //访问项目id
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
|
//权限设置
|
||||||
|
permission() {
|
||||||
|
this.dialog.permission = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.permissionDialog.open();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//删除
|
||||||
|
table_del(row) {
|
||||||
|
this.$API.vm.visit.delete
|
||||||
|
.req(row.id)
|
||||||
|
.then((res) => {
|
||||||
|
this.$message.success("删除成功");
|
||||||
|
|
||||||
//查看
|
return res;
|
||||||
table_show(row) {
|
})
|
||||||
this.dialog.save = true;
|
.catch((err) => {
|
||||||
this.$nextTick(() => {
|
return err;
|
||||||
this.$refs.detialDialog.open("show").setData(row);
|
});
|
||||||
});
|
},
|
||||||
},
|
|
||||||
|
|
||||||
//权限设置
|
//表格选择后回调事件
|
||||||
permission() {
|
selectionChange(selection) {
|
||||||
this.dialog.permission = true;
|
this.selection = selection;
|
||||||
this.$nextTick(() => {
|
},
|
||||||
this.$refs.permissionDialog.open();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//删除
|
|
||||||
table_del(row) {
|
|
||||||
this.$API.vm.visit.delete
|
|
||||||
.req(row.id)
|
|
||||||
.then((res) => {
|
|
||||||
this.$message.success("删除成功");
|
|
||||||
|
|
||||||
return res;
|
//本地更新数据
|
||||||
})
|
handleSaveSuccess(data, mode) {
|
||||||
.catch((err) => {
|
if (mode == "add") {
|
||||||
return err;
|
this.$refs.table.refresh();
|
||||||
});
|
} else if (mode == "edit") {
|
||||||
|
this.$refs.table.refresh();
|
||||||
},
|
}
|
||||||
|
},
|
||||||
//表格选择后回调事件
|
resetQuery() {
|
||||||
selectionChange(selection) {
|
this.query = {};
|
||||||
this.selection = selection;
|
},
|
||||||
},
|
handleQuery() {
|
||||||
|
if (this.timeRange) {
|
||||||
|
this.query.start_come = this.timeRange[0];
|
||||||
//本地更新数据
|
this.query.end_come = this.timeRange[1];
|
||||||
handleSaveSuccess(data, mode) {
|
} else {
|
||||||
if (mode == "add") {
|
this.query.end_come = null;
|
||||||
this.$refs.table.refresh();
|
this.query.start_come = null;
|
||||||
} else if (mode == "edit") {
|
}
|
||||||
this.$refs.table.refresh();
|
this.$refs.table.queryData(this.query);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
resetQuery() {
|
};
|
||||||
this.query = {};
|
|
||||||
},
|
|
||||||
handleQuery() {
|
|
||||||
this.$refs.table.queryData(this.query)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue