This commit is contained in:
2309368887@qq.com 2022-07-07 14:26:19 +08:00
parent ebcd31833a
commit 6865c67dc5
9 changed files with 535 additions and 85 deletions

View File

@ -471,6 +471,7 @@ const routes = [
"type": "menu"
},
"children": [
{
"name": "employee",
"path": "/hrm/employee",

View File

@ -0,0 +1,358 @@
<template>
<div style="display:flex;row nowrap">
<!-- <el-tag
v-for="user in userData"
:key="user.id"
>
{{ user.name }}
</el-tag>-->
<el-button
v-if="selectable"
type="primary"
circle
size="mini"
icon="el-icon-plus"
@click="showDialog()"
/>
</div>
<el-dialog
title="选择人员"
width="90%"
v-model="dialoguser"
:before-close="handleClose"
:append-to-body="true"
:close-on-click-modal="false"
>
<el-card>
<el-row>
<el-col :md="8" :sm="24">
<el-main class="nopadding">
<el-tabs type="border-card" stretch="true">
<el-tab-pane label="按部门分类">
<el-input placeholder="输入关键字进行过滤" v-model="filterText">
</el-input>
<el-tree
class="filter-tree"
style="padding-top: 15px"
:data="deptdata"
default-expand-all
:filter-node-method="filterNode"
ref="tree"
@node-click="handleNodeClick"
>
</el-tree>
</el-tab-pane>
<el-tab-pane label="按岗位分类">
<el-input
placeholder="输入关键字进行过滤"
v-model="filterTexts"
>
</el-input>
<el-tree
class="filter-tree"
style="padding-top: 15px"
:data="postdata"
default-expand-all
:filter-node-method="filterNodes"
ref="tree"
@node-click="handleNodeClicks"
>
</el-tree>
</el-tab-pane>
</el-tabs>
</el-main>
</el-col>
<el-col :md="16" :sm="24">
<el-header style="border-bottom: none">
<div class="left-panel">
<el-input
v-model="search.keyword"
placeholder="姓名"
clearable
@click="upsearch"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="upsearch"
></el-button>
</div>
<div class="right-panel">
<el-button type="primary" icon="el-icon-plus" @click="addUser"
>添加选择</el-button
>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:data="apiObj"
row-key="id"
@selection-change="selectionChange"
stripe
:hidePagination="true"
hideDo
@resetQuery="resetQuery"
>
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column
label="#"
type="index"
width="50"
></el-table-column>
<el-table-column label="姓名" prop="name"></el-table-column>
<el-table-column label="手机号" prop="phone"></el-table-column>
<el-table-column label="部门" prop="belong_dept">
<template #default="scope">
<span v-if="scope.row.belong_dept_">{{
scope.row.belong_dept_.name
}}</span>
</template>
</el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
></el-table-column>
<!--
<el-table-column
label="操作"
fixed="right"
align="left"
width="100"
>
<template #default="scope">
<el-button-group>
<el-button
type="primary"
icon="el-icon-plus"
@click="handleForm('add', scope.row)"
></el-button>
</el-button-group>
</template>
</el-table-column>-->
</scTable>
</el-main>
<div style="padding-top: 15px">
<el-input
style="width: 80%"
v-model="username"
placeholder="选择人员的姓名"
clearable
></el-input>
<el-button @click="visible = false" style="float: right"
> </el-button
>
<el-button
v-if="mode != 'show'"
style="float: right"
type="primary"
:loading="isSaveing"
@click="submitfrom()"
> </el-button
>
</div>
</el-col>
</el-row>
</el-card>
</el-dialog>
</template>
<script>
import { genTree } from "@/utils/verificate";
export default {
name: "employee",
components: {},
props: {
value: {
// v-model
type: [String],
default: "",
},
user: {
// v-model
type: [String],
default: "",
},
closable: {
//
type: Boolean,
default: () => {
return true;
},
},
selectable: {
//
type: Boolean,
default: () => {
return true;
},
},
multiple: {
// ,
type: Boolean,
default: true,
},
},
data() {
return {
apiObj: [],
query: {},
selection: [],
search: {
keyword: null,
},
filterText: "",
filterTexts: "",
deptdata: [],
postdata: [],
username: [],
userData: [],
dialoguser: false,
dataValue: this.value,
};
},
mounted() {
this.getUser();
this.getDept();
this.getPost();
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
},
filterTexts(val) {
this.$refs.tree.filter(val);
},
dataValue(val) {
this.$emit("input", val);
console.log(val)
},
userData(val) {
if (val) {
this.change();
}
},
},
methods: {
showDialog() {
this.dialoguser = true;
this.$nextTick(function () {
this.apiObj.map(item => {
if (item.id === this.user) {
this.$refs.table.toggleRowSelection(item, true)
}
})
})
},
//
getUser() {
this.$API.system.user.list.req({ page: 0 }).then((res) => {
this.apiObj = res;
});
},
upsearch() {
this.$API.system.user.list
.req({ name: this.search.keyword, page: 0 })
.then((res) => {
this.apiObj = res;
});
},
//
async getDept() {
let res = await this.$API.system.dept.list.req({ page: 0 });
this.deptdata = genTree(res);
},
//
async getPost() {
let res = await this.$API.system.post.list.req({ page: 0 });
this.postdata = genTree(res);
},
filterNode(value, data) {
console.log(value);
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
filterNodes(value, data) {
console.log(value);
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.$API.system.user.list
.req({ belong_dept: data.id, page: 0 })
.then((res) => {
this.apiObj = res;
});
},
//
handleNodeClicks(data) {
this.$API.system.user.list.req({ post: data.id, page: 0 }).then((res) => {
this.apiObj = res;
});
},
//
selectionChange(selection) {
this.selection = selection;
},
//Tag
closeTag(name) {
this.userData.splice(this.userData.indexOf(name), 1);
},
addUser() {
this.username = [];
this.userData = [];
if (!this.multiple && this.selection.length > 1) {
this.$message.error("对应的人员只允许选择一人!");
return;
}
if (!this.selection || this.selection.length === 0) {
this.msgError("请选择至少一个人员!");
return;
}
this.selection.forEach((item) => {
this.username.push(item.name);
this.userData.push({ id: item.id, name: item.name });
});
console.log(this.userData);
},
change() {
if (this.tags) {
alert(1);
this.dataValue = this.userData.map((e) => e.id).join(",");
console.log(this.dataValue);
this.$emit("change", this.dataValue);
}
},
submitfrom() {
this.dialoguser = false;
this.change(); //
this.dataValue = this.userData.map((e) => e.id).join(",");
this.$emit("submit", this.dataValue);
},
//
permission() {
this.dialog.permission = true;
this.$nextTick(() => {
this.$refs.permissionDialog.open();
});
},
resetQuery() {
this.query = {};
},
},
};
</script>

View File

@ -4,7 +4,6 @@
<el-container>
<el-header>
<div class="left-panel">
<!-- <el-button type="danger" plain icon="el-icon-delete" :disabled="selection.length==0" @click="batch_del"></el-button> -->
</div>
</el-header>
@ -26,7 +25,7 @@
<el-table-column
label="名称"
prop="name"
width="120"
width="100"
></el-table-column>
<el-table-column
label="标识"
@ -47,6 +46,13 @@
></el-switch>
</template>
</el-table-column>
<el-table-column label="喇叭开启区域" prop="name" width="120">
<template #default="scope">
<el-space v-if="scope.row.filter_area_level">{{
filter_area_[scope.row.filter_area_level]
}}</el-space></template
>
</el-table-column>
<el-table-column label="操作" fixed="right" align="right">
<template #default="scope">
<el-button
@ -54,8 +60,8 @@
link
size="small"
@click="adds_edit(scope.row)"
>批量布设</el-button>
>批量布设</el-button
>
</template>
</el-table-column>
</scTable>
@ -82,18 +88,34 @@
:hidePagination="true"
>
<el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column label="算法名称" prop="algo_.name" width="150"></el-table-column>
<el-table-column label="视频名称" prop="vchannel_.name" width="150"></el-table-column>
<el-table-column label="始终开启" prop="always_on" width="150"></el-table-column>
<el-table-column
label="算法名称"
prop="algo_.name"
width="150"
></el-table-column>
<el-table-column
label="视频名称"
prop="vchannel_.name"
width="150"
></el-table-column>
<el-table-column label="始终开启" prop="always_on" width="150">
<template #default="scope">
<el-switch
v-model="scope.row.always_on"
:disabled="true"
></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="right">
<template #default="scope">
<el-button
type="danger"
link
size="small"
@click="table_del(scope.row, scope.$index)"
>删除</el-button
<el-popconfirm
title="确定删除吗?"
@confirm="table_del(scope.row, scope.$index)"
>
<template #reference>
<el-button text type="danger" size="small">删除</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</scTable>
@ -132,11 +154,15 @@ export default {
save: false,
algos: false,
},
filter_area_: {
10: "办公生活区以上",
20: "生产一般区以上",
30: "生产重点区以上",
},
selection: [],
chosen_cate: null,
eventcateList:[],
vchannelList:[]
chosen_cate: "",
eventcateList: [],
vchannelList: [],
};
},
mounted() {
@ -146,21 +172,26 @@ export default {
methods: {
//
getEventCate() {
this.$API.ecm.event_cate.list.req({ self_algo:true,page: 0 }).then((res) => {
this.$API.ecm.event_cate.list
.req({ self_algo: true, page: 0 })
.then((res) => {
this.eventcateList = res;
});
},
//
rowClick(row) {
this.$API.ecm.vchannel.list.req({algo:row.id,page: 0 }).then((res) => {
this.$API.ecm.vchannel.list.req({ algo: row.id, page: 0 }).then((res) => {
this.vchannelList = res;
});
this.chosen_cate = row.id;
},
//
getVchannel() {
this.$API.ecm.vchannel.list.req({page: 0 }).then((res) => {
this.$API.ecm.vchannel.list.req({ page: 0 }).then((res) => {
this.vchannelList = res;
});
},
@ -189,19 +220,25 @@ export default {
});
},
table_del(row) {
this.$API.ecm.vchannel.delete.req(row.id).then((res) => {
this.$refs.tablevchannel.refresh();
this.$API.ecm.vchannel.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.getVchannel();
return res;
})
.catch((err) => {
return err;
});
},
//
handleSaveSuccess() {
this.$refs.tablevchannel.refresh();
},
//
handleSaveSuccessss() {
this.$refs.tablevchannel.refresh();
},
},
};
</script>

View File

@ -88,6 +88,7 @@ export default {
//
open(mode = "add") {
this.mode = mode;
this.form.algo = this.$parent.chosen_cate;
this.visible = true;
return this;
},

View File

@ -25,7 +25,7 @@
</el-select>
</el-form-item>
<el-form-item label="视频" prop="vchannel">
<el-form-item label="视频" prop="vchannels">
<el-select v-model="form.vchannels" multiple="true">
<el-option
v-for="item in vchanneloptions"
@ -68,13 +68,13 @@ export default {
//
form: {
algo: "",
vchannel: "",
vchannels: [],
always_on: false,
},
//
rules: {
algo: [{ required: true, message: "请选择算法" }],
vchannel: [{ required: true, message: "请选择视频" }],
vchannels: [{ required: true, message: "请选择视频" }],
},
algooptions: [],
vchanneloptions: [],
@ -89,6 +89,7 @@ export default {
open(mode = "add") {
this.mode = mode;
this.visible = true;
this.form.algo = this.$parent.chosen_cate;
return this;
},
//
@ -105,32 +106,15 @@ export default {
},
//
async submit() {
var valid = await this.$refs.dialogForm.validate().catch(() => {});
if (!valid) {
return false;
}
this.isSaveing = true;
try {
var res;
if (this.mode == "add") {
res = await this.$API.ecm.vchannel.creates.req(this.form);
} else if (this.mode == "edit") {
res = await this.$API.ecm.vchannel.update.req(
this.form.id,
this.form
);
}
this.isSaveing = false;
this.$emit("success", this.form, this.mode);
this.visible = false;
submit() {
this.$API.ecm.vchannel.creates.req(this.form).then((res) => {
this.$message.success("操作成功");
this.visible=false;
return res;
} catch (err) {
//
this.isSaveing = false;
return err;
}
})
},
//
setData(data) {

View File

@ -53,6 +53,18 @@
/>
</el-select>
</el-form-item>
<el-form-item label="喇叭声音" prop="voice_person">
<el-select v-model="form.voice_person">
<el-option
v-for="item in voiceoptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="喇叭开启" prop="speaker_on">
<el-switch v-model="form.speaker_on"></el-switch>
</el-form-item>
@ -97,7 +109,7 @@ export default {
form: {
speaker_on: true,
self_algo: false,
speakers:[]
speakers: [],
},
//
rules: {
@ -127,7 +139,17 @@ export default {
label: "定位",
},
],
speakersptions:[],
voiceoptions:[
{
value: 3,
label: "男生",
},
{
value: 0,
label: "女生",
},
],
speakersptions: [],
//
groups: [],
groupsProps: {
@ -149,7 +171,7 @@ export default {
},
//
getSpeakers() {
this.$API.third.tdevice.list.req({type:50, page: 0 }).then((res) => {
this.$API.third.tdevice.list.req({ type: 50, page: 0 }).then((res) => {
this.speakersptions = res;
});
},
@ -186,7 +208,7 @@ export default {
setData(data) {
Object.assign(this.form, data);
debugger;
console.log(this.form)
console.log(this.form);
},
},
};

View File

@ -199,9 +199,8 @@ export default {
this.$API.ecm.event.handle.req(this.form.id, this.form)
.then((res) => {
this.isSaveing = false;
this.visible = false;
this.$emit("success", this.form, this.mode);
this.$router.go(-1)
this.$message.success("操作成功");
return res;
})

View File

@ -27,11 +27,13 @@
label="#"
type="index"
width="50"
fixed="left"
></el-table-column>
<el-table-column
label="名称"
prop="name"
width="120"
fixed="left"
></el-table-column>
<el-table-column
label="标识"
@ -44,13 +46,31 @@
<span v-if="scope.row.trigger == 20">定位</span>
</template>
</el-table-column>
<el-table-column label="音响" prop="speaker_on" width="50">
<el-table-column
label="处理时间"
prop="hanle_minute"
width="80"
></el-table-column>
<el-table-column label="喇叭开启" prop="speaker_on" width="80">
<template #default="scope">
<el-switch
v-model="scope.row.speaker_on"
:disabled="true"
></el-switch>
</template>
</el-table-column>
<el-table-column
label="喇叭开启区域"
prop="name"
width="120"
>
<template #default="scope">
<el-space v-if="scope.row.filter_area_level">{{
filter_area_[scope.row.filter_area_level]
}}</el-space></template
>
</el-table-column>
<el-table-column label="操作" fixed="right" align="right">
<template #default="scope">
@ -224,6 +244,11 @@ export default {
30: "较大风险",
40: "重大风险",
},
filter_area_:
{ 10: "办公生活区以上",
20: "生产一般区以上",
30: "生产重点区以上",
},
};
},
mounted() {

View File

@ -64,7 +64,7 @@
</el-col>
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="接待人">
<el-select v-model="form.receptionist" placeholder="选择接待人">
<el-select v-model="form.receptionist" disabled placeholder="选择接待人">
<el-option
v-for="item in receptionistoptions"
:key="item.id"
@ -72,6 +72,11 @@
:value="item.id"
/>
</el-select>
<select-user ref="form.receptionist" :user="form.receptionist" :closable="true" :multiple="false" @submit="refresh" >
</select-user>
</el-form-item>
</el-col>
<el-col :md="24" :sm="12" :xs="24">
@ -99,6 +104,10 @@
:max="32767"
controls-position="right"
></el-input-number>
</el-form-item>
</el-col>
</el-row>
@ -116,8 +125,12 @@
<script>
import { genTree } from "@/utils/verificate";
import selectUser from '@/layout/components/userselect'
export default {
emits: ["success", "closed"],
components: {
selectUser,
},
data() {
return {
loading: false,
@ -170,6 +183,16 @@ export default {
this.visible = true;
return this;
},
refresh(data) {
//
console.log(data);
this.form.receptionist=data;
},
//
submit() {
this.$refs.dialogForm.validate(async (valid) => {