|
@@ -1,247 +1,225 @@
|
|
|
<template>
|
|
|
- <div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
- <el-form-item label="编码" prop="code">
|
|
|
- <el-input v-model="queryParams.code" placeholder="请输入编码" clearable @keyup.enter.native="handleQuery" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="人员" prop="person">
|
|
|
- <el-input v-model="queryParams.person" placeholder="请输入人员" clearable @keyup.enter.native="handleQuery" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="人员姓名" prop="personName">
|
|
|
- <el-input v-model="queryParams.personName" placeholder="请输入人员姓名" clearable @keyup.enter.native="handleQuery" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="联系方式" prop="contactInformation">
|
|
|
- <el-input v-model="queryParams.contactInformation" placeholder="请输入联系方式" clearable
|
|
|
- @keyup.enter.native="handleQuery" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="描述" prop="description">
|
|
|
- <el-input v-model="queryParams.description" placeholder="请输入描述" clearable @keyup.enter.native="handleQuery" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
-
|
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate">修改</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
|
|
- </el-col>
|
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-table v-loading="loading" :data="powerList" @selection-change="handleSelectionChange">
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="编码" align="center" prop="code" />
|
|
|
- <el-table-column label="人员" align="center" prop="person" />
|
|
|
- <el-table-column label="人员姓名" align="center" prop="personName" />
|
|
|
- <el-table-column label="联系方式" align="center" prop="contactInformation" />
|
|
|
- <el-table-column label="描述" align="center" prop="description" />
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
-
|
|
|
- <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
|
|
- @pagination="getList" />
|
|
|
-
|
|
|
- <!-- 添加或修改医院竞争对手用户查看权限对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
+ <div>
|
|
|
+ <div class="app-container" v-if="isList">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" @submit.native.prevent>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="18">
|
|
|
+ <el-form-item label="员工" prop="staffName">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.params.staffOrStaffName"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="btnSearch"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item style="float:right">
|
|
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="btnSearch">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="btnResetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div style="float:right">
|
|
|
+ <el-button type="primary" size="mini" @click="btnAddPower">新增</el-button>
|
|
|
+ </div>
|
|
|
+ <el-table size="mini" height="500px" v-loading="loading" :data="listData" @row-dblclick="btnDetails">
|
|
|
+ <!-- <el-table-column label="员工编号" align="center" prop="staff" /> -->
|
|
|
+ <el-table-column label="员工姓名" align="center" prop="staffName" />
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createTime" />
|
|
|
+ <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="btnDelPower(scope.row)"
|
|
|
+ >删除</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="btnDetails(scope.row)"
|
|
|
+ >详情</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="paginationClass">
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <detail v-model="isList" v-if="!isList" :enterState="page" :rowId="rowId" :ids="ids" @refresh="refresh" />
|
|
|
+ <!-- 添加人员权限对话框 -->
|
|
|
+ <el-dialog title="新增" :visible.sync="open" width="500px" append-to-body :show-close="false">
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
- <el-form-item label="编码" prop="code">
|
|
|
- <el-input v-model="form.code" placeholder="请输入编码" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="人员" prop="person">
|
|
|
- <el-input v-model="form.person" placeholder="请输入人员" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="人员姓名" prop="personName">
|
|
|
- <el-input v-model="form.personName" placeholder="请输入人员姓名" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="联系方式" prop="contactInformation">
|
|
|
- <el-input v-model="form.contactInformation" placeholder="请输入联系方式" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="描述" prop="description">
|
|
|
- <el-input type="textarea" autosize v-model="form.description" placeholder="请输入描述" />
|
|
|
+ <el-form-item label="员工" prop="staffName">
|
|
|
+ <el-popover-select-v2
|
|
|
+ size="mini"
|
|
|
+ v-model="form.staffName"
|
|
|
+ title="员工"
|
|
|
+ valueKey="name"
|
|
|
+ referName="CONTACTS_PARAM"
|
|
|
+ :dataMapping="{staff:'id',staffName: 'name'}"
|
|
|
+ :source.sync="form"
|
|
|
+ >
|
|
|
+ </el-popover-select-v2>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
- <el-button @click="cancel">取 消</el-button>
|
|
|
+ <el-button size="mini" type="primary" @click="btnSubmitForm">确 定</el-button>
|
|
|
+ <el-button size="mini" @click="btnCancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {
|
|
|
- listPower,
|
|
|
- getPower,
|
|
|
- delPower,
|
|
|
- addPower,
|
|
|
- updatePower
|
|
|
- } from "@/api/business/spd/bo/power";
|
|
|
-
|
|
|
- export default {
|
|
|
- name: "Power",
|
|
|
- data() {
|
|
|
- return {
|
|
|
- // 遮罩层
|
|
|
- loading: true,
|
|
|
- // 选中数组
|
|
|
- ids: [],
|
|
|
- // 非单个禁用
|
|
|
- single: true,
|
|
|
- // 非多个禁用
|
|
|
- multiple: true,
|
|
|
- // 显示搜索条件
|
|
|
- showSearch: true,
|
|
|
- // 总条数
|
|
|
- total: 0,
|
|
|
- // 医院竞争对手用户查看权限表格数据
|
|
|
- powerList: [],
|
|
|
- // 弹出层标题
|
|
|
- title: "",
|
|
|
- // 是否显示弹出层
|
|
|
- open: false,
|
|
|
- // 查询参数
|
|
|
- queryParams: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- code: null,
|
|
|
- person: null,
|
|
|
- personName: null,
|
|
|
- contactInformation: null,
|
|
|
- description: null,
|
|
|
- tenantId: null,
|
|
|
- revision: null,
|
|
|
+import detail from './detail.vue'
|
|
|
+import { listPower,addPower,delPower} from "@/api/business/spd/bo/power";
|
|
|
+import ElPopoverSelectV2 from "@/components/popover-select-v2"
|
|
|
+export default {
|
|
|
+ name: "power",
|
|
|
+ components: {detail,ElPopoverSelectV2},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 表格数据
|
|
|
+ listData: [],
|
|
|
+ // id集合
|
|
|
+ ids: [],
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ params:{
|
|
|
+ staffOrStaffName: null,
|
|
|
},
|
|
|
- // 表单参数
|
|
|
- form: {},
|
|
|
- // 表单校验
|
|
|
- rules: {}
|
|
|
- };
|
|
|
+ },
|
|
|
+ //页面显示
|
|
|
+ isList: true,
|
|
|
+ //页面状态
|
|
|
+ page: '',
|
|
|
+ //详情id
|
|
|
+ rowId: '',
|
|
|
+ //新增的表单
|
|
|
+ form:{},
|
|
|
+ //
|
|
|
+ open:false,
|
|
|
+ //表单校验
|
|
|
+ rules:{
|
|
|
+ staffName: [
|
|
|
+ { required: true, message: "员工必输", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /** 查询绩效列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ listPower(this.queryParams).then(response => {
|
|
|
+ this.listData = response.rows;
|
|
|
+ this.ids = response.rows.map(item => item.id);
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
},
|
|
|
- created() {
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ btnSearch() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
this.getList();
|
|
|
},
|
|
|
- methods: {
|
|
|
- /** 查询医院竞争对手用户查看权限列表 */
|
|
|
- getList() {
|
|
|
- this.loading = true;
|
|
|
- listPower(this.queryParams).then(response => {
|
|
|
- this.powerList = response.rows;
|
|
|
- this.total = response.total;
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
- },
|
|
|
- // 取消按钮
|
|
|
- cancel() {
|
|
|
- this.open = false;
|
|
|
- this.reset();
|
|
|
- },
|
|
|
- // 表单重置
|
|
|
- reset() {
|
|
|
- this.form = {
|
|
|
- id: null,
|
|
|
- code: null,
|
|
|
- person: null,
|
|
|
- personName: null,
|
|
|
- contactInformation: null,
|
|
|
- description: null,
|
|
|
- tenantId: null,
|
|
|
- revision: null,
|
|
|
- createBy: null,
|
|
|
- createTime: null,
|
|
|
- updateBy: null,
|
|
|
- updateTime: null,
|
|
|
- delFlag: null
|
|
|
- };
|
|
|
- this.resetForm("form");
|
|
|
- },
|
|
|
- /** 搜索按钮操作 */
|
|
|
- handleQuery() {
|
|
|
- this.queryParams.pageNum = 1;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- /** 重置按钮操作 */
|
|
|
- resetQuery() {
|
|
|
- this.resetForm("queryForm");
|
|
|
- this.handleQuery();
|
|
|
- },
|
|
|
- // 多选框选中数据
|
|
|
- handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.id)
|
|
|
- this.single = selection.length !== 1
|
|
|
- this.multiple = !selection.length
|
|
|
- },
|
|
|
- /** 新增按钮操作 */
|
|
|
- handleAdd() {
|
|
|
- this.reset();
|
|
|
- this.open = true;
|
|
|
- this.title = "添加医院竞争对手用户查看权限";
|
|
|
- },
|
|
|
- /** 修改按钮操作 */
|
|
|
- handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
- const id = row.id || this.ids
|
|
|
- getPower(id).then(response => {
|
|
|
- this.form = response.data;
|
|
|
- this.open = true;
|
|
|
- this.title = "修改医院竞争对手用户查看权限";
|
|
|
- });
|
|
|
- },
|
|
|
- /** 提交按钮 */
|
|
|
- submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- if (this.form.id != null) {
|
|
|
- updatePower(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- } else {
|
|
|
- addPower(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- /** 删除按钮操作 */
|
|
|
- handleDelete(row) {
|
|
|
- if (row.id != undefined) {
|
|
|
- this.ids.push(row.id);
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ btnResetQuery() {
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.queryParams.params.staffOrStaffName = null;
|
|
|
+ this.btnSearch();
|
|
|
+ },
|
|
|
+ /** 刷新 */
|
|
|
+ refresh(){
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 进入详情 */
|
|
|
+ btnDetails(row){
|
|
|
+ this.rowId = row.id;
|
|
|
+ this.page = 'see';
|
|
|
+ this.isList = false;
|
|
|
+ },
|
|
|
+ //新增人员权限
|
|
|
+ btnAddPower(){
|
|
|
+ this.reset();
|
|
|
+ this.open = true;
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ id: null,
|
|
|
+ staff: null,
|
|
|
+ staffName: null,
|
|
|
+ tenantId: null,
|
|
|
+ revision: null,
|
|
|
+ createBy: null,
|
|
|
+ createTime: null,
|
|
|
+ updateBy: null,
|
|
|
+ updateTime: null,
|
|
|
+ delFlag: null
|
|
|
+ };
|
|
|
+ this.resetForm("form");
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ btnCancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ //确定按钮
|
|
|
+ btnSubmitForm() {
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ addPower(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
}
|
|
|
- const ids = this.ids;
|
|
|
- this.$modal.confirm('是否确认删除?').then(function () {
|
|
|
- return delPower(ids);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
- },
|
|
|
- /** 导出按钮操作 */
|
|
|
- handleExport() {
|
|
|
- this.download('bo/power/export', {
|
|
|
- ...this.queryParams
|
|
|
- }, `power_${new Date().getTime()}.xlsx`)
|
|
|
- }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //删除
|
|
|
+ btnDelPower(row){
|
|
|
+ this.$modal.confirm('是否确认删除?').then(function () {
|
|
|
+ return delPower(row.id);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {});
|
|
|
}
|
|
|
- };
|
|
|
-
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.btn_grooup {
|
|
|
+ margin-bottom: 10px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+}
|
|
|
+.paginationClass {
|
|
|
+ z-index: 500;
|
|
|
+ position: fixed;
|
|
|
+ bottom: 10px;
|
|
|
+ right: 10px;
|
|
|
+ width: 100%;
|
|
|
+ line-height: var(--footer-height);
|
|
|
+ color: #fff;
|
|
|
+}
|
|
|
+</style>
|