| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form |
| | | :model="queryParams" |
| | | ref="queryForm" |
| | | :inline="true" |
| | | v-show="showSearch" |
| | | label-width="80px" |
| | | > |
| | | |
| | | class="opo-query-form" :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="80px"> |
| | | |
| | | <el-form-item label="账号类别" prop="usertype"> |
| | | <el-select |
| | | v-model="queryParams.usertype" |
| | | placeholder="请选择账号类别" |
| | | clearable |
| | | size="small" |
| | | > |
| | | <el-option |
| | | v-for="dict in dict.type.sys_UserType" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | <el-select v-model="queryParams.usertype" placeholder="请选择账号类别" clearable size="small"> |
| | | <el-option v-for="dict in dict.type.sys_UserType" :key="dict.value" :label="dict.label" :value="dict.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="账号编号" prop="userno"> |
| | | <el-input |
| | | v-model="queryParams.userno" |
| | | placeholder="请输入账号编号" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | <el-input v-model="queryParams.userno" placeholder="请输入账号编号" clearable size="small" |
| | | @keyup.enter.native="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="账号名称" prop="username"> |
| | | <el-input |
| | | v-model="queryParams.username" |
| | | placeholder="请输入账号名称" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | <el-input v-model="queryParams.username" placeholder="请输入账号名称" clearable size="small" |
| | | @keyup.enter.native="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="所在单位" prop="unitname"> |
| | | <el-input |
| | | v-model="queryParams.unitname" |
| | | placeholder="请输入所在单位" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | <el-input v-model="queryParams.unitname" placeholder="请输入所在单位" clearable size="small" |
| | | @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-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" |
| | | v-hasPermi="['project:externalperson:add']" |
| | | >新增</el-button |
| | | > |
| | | <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" |
| | | v-hasPermi="['project:externalperson:add']">新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['project:externalperson:edit']" |
| | | >修改</el-button |
| | | > |
| | | <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" |
| | | v-hasPermi="['project:externalperson:edit']">修改</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['project:externalperson:remove']" |
| | | >删除</el-button |
| | | > |
| | | <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" |
| | | v-hasPermi="['project:externalperson:remove']">删除</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | :loading="exportLoading" |
| | | @click="handleExport" |
| | | v-hasPermi="['project:externalperson:export']" |
| | | >导出</el-button |
| | | > |
| | | <el-button type="warning" plain icon="el-icon-download" size="mini" :loading="exportLoading" |
| | | @click="handleExport" v-hasPermi="['project:externalperson:export']">导出</el-button> |
| | | </el-col> |
| | | <right-toolbar |
| | | :showSearch.sync="showSearch" |
| | | @queryTable="getList" |
| | | ></right-toolbar> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="externalpersonList" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table v-loading="loading" :data="externalpersonList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="账号类别" align="center" prop="usertype"> |
| | | <el-table-column label="账号类别" align="center" prop="usertype" width="220"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag |
| | | :options="dict.type.sys_UserType" |
| | | :value="scope.row.usertype" |
| | | /> |
| | | <dict-tag v-for="t in splitUserType(scope.row.usertype)" :key="t" |
| | | :options="dict.type.sys_UserType" :value="t" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="账号编号" align="center" prop="userno" /> |
| | | <el-table-column label="账号名称" align="center" prop="username" /> |
| | | <el-table-column |
| | | label="身份证号" |
| | | width="200" |
| | | align="center" |
| | | prop="idcardno" |
| | | /> |
| | | <el-table-column label="身份证号" width="200" align="center" prop="idcardno" /> |
| | | <el-table-column label="职称" align="center" prop="title"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag |
| | | :options="dict.type.sys_professionaltitle" |
| | | :value="scope.row.title" |
| | | /> </template |
| | | ></el-table-column> |
| | | <el-table-column |
| | | label="所在单位" |
| | | width="250" |
| | | align="center" |
| | | prop="unitname" |
| | | /> |
| | | <dict-tag :options="dict.type.sys_professionaltitle" :value="scope.row.title" /> </template></el-table-column> |
| | | <el-table-column label="所在单位" width="250" align="center" prop="unitname" /> |
| | | <!-- |
| | | <el-table-column label="性别" align="center" prop="sex"> |
| | | <template slot-scope="scope"> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="联系电话" width="200" align="center" prop="telephone" /> |
| | | <el-table-column label="联系地址" width="250" align="center" prop="address" />-->x |
| | | <el-table-column |
| | | label="操作" |
| | | align="center" |
| | | class-name="small-padding fixed-width" |
| | | > |
| | | <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)" |
| | | v-hasPermi="['project:externalperson:edit']" |
| | | >修改</el-button |
| | | > |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | >删除</el-button |
| | | > |
| | | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['project:externalperson:edit']">修改</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" |
| | | /> |
| | | <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="800px" |
| | | append-to-body |
| | | :close-on-click-modal="false" |
| | | > |
| | | <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="120px"> |
| | | <el-row> |
| | | <el-col :span="12" |
| | | ><el-form-item label="账号类别" prop="usertype"> |
| | | <el-select v-model="form.usertype" placeholder="请选择账号类别"> |
| | | <el-option |
| | | v-for="dict in dict.type.sys_UserType" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | ></el-option> |
| | | <el-col :span="12"><el-form-item label="账号类别" prop="usertype"> |
| | | <el-select v-model="form.usertype" multiple collapse-tags placeholder="请选择账号类别(可多选)"> |
| | | <el-option v-for="dict in dict.type.sys_UserType" :key="dict.value" :label="dict.label" |
| | | :value="dict.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="账号编号" prop="userno"> |
| | | <el-input |
| | | disabled="true" |
| | | v-model="form.userno" |
| | | placeholder="请输入账号编号" |
| | | /> |
| | | <el-input disabled="true" v-model="form.userno" placeholder="请输入账号编号" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="启用状态" |
| | | prop="userstatus" |
| | | :disabled="ismanager == false" |
| | | > |
| | | <el-radio-group v-model="form.userstatus"> |
| | | <el-radio |
| | | v-for="dict in dict.type.sys_0_1" |
| | | :key="dict.value" |
| | | :label="parseInt(dict.value)" |
| | | >{{ dict.label }}</el-radio |
| | | > |
| | | <el-form-item label="启用状态" prop="userstatus" > |
| | | <el-radio-group v-model="form.userstatus" :disabled="!ismanager"> |
| | | <el-radio v-for="dict in dict.type.sys_0_1" :key="dict.value" :label="parseInt(dict.value)">{{ |
| | | dict.label |
| | | }}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="form.usertype != 'org'"> |
| | | <el-row v-if="!isUnitForm"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="身份证号" prop="idcardno"> |
| | | <el-input v-model="form.idcardno" placeholder="请输入身份证号" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="form.usertype != 'org'" |
| | | ><el-col :span="12"> |
| | | <el-row v-if="!isUnitForm"><el-col :span="12"> |
| | | <el-form-item label="性别" prop="sex"> |
| | | <el-select v-model="form.sex" placeholder="请选择性别"> |
| | | <el-option |
| | | v-for="dict in dict.type.sys_user_sex" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | ></el-option> </el-select |
| | | ></el-form-item> |
| | | <el-option v-for="dict in dict.type.sys_user_sex" :key="dict.value" :label="dict.label" |
| | | :value="dict.value"></el-option> </el-select></el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="职称" prop="title"> |
| | | <el-select v-model="form.title" placeholder="请选择人员职称"> |
| | | <el-option |
| | | v-for="dict in dict.type.sys_professionaltitle" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.label" |
| | | ></el-option> |
| | | <el-option v-for="dict in dict.type.sys_professionaltitle" :key="dict.value" :label="dict.label" |
| | | :value="dict.label"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="form.usertype != 'org'"> |
| | | <el-row v-if="!isUnitForm"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="所在单位" prop="unitname"> |
| | | <el-select |
| | | v-model="form.unitno" |
| | | placeholder="所在单位" |
| | | clearable |
| | | filterable |
| | | allow-create |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="(spec, index) in unitList" |
| | | :key="index" |
| | | :label="spec.organizationname" |
| | | :value="spec.organizationid" |
| | | ></el-option> |
| | | <el-select v-model="form.unitno" placeholder="所在单位" clearable filterable allow-create style="width: 100%"> |
| | | <el-option v-for="(spec, index) in unitList" :key="index" :label="spec.organizationname" |
| | | :value="spec.organizationid"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="单位工号" prop="personnelunitno"> |
| | | <el-input |
| | | v-model="form.personnelunitno" |
| | | placeholder="请输入所在单位的工号" |
| | | /> |
| | | <el-input v-model="form.personnelunitno" placeholder="请输入所在单位的工号" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="24" |
| | | ><el-form-item label="开户银行" prop="depositbank"> |
| | | <el-input |
| | | v-model="form.depositbank" |
| | | placeholder="请输入开户银行名称" |
| | | /> |
| | | <el-col :span="24"><el-form-item label="开户银行" prop="depositbank"> |
| | | <el-input v-model="form.depositbank" placeholder="请输入开户银行名称" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24" |
| | | ><el-form-item label="银行卡号" prop="bankcardno"> |
| | | <el-input |
| | | v-model="form.bankcardno" |
| | | placeholder="请输入银行卡号" |
| | | /> |
| | | <el-col :span="24"><el-form-item label="银行卡号" prop="bankcardno"> |
| | | <el-input v-model="form.bankcardno" placeholder="请输入银行卡号" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | addExternalperson, |
| | | updateExternalperson, |
| | | exportExternalperson, |
| | | getInfoByIDCardNo, |
| | | getOnlyCode |
| | | } from "@/api/project/externalperson"; |
| | | |
| | |
| | | usertype: null |
| | | }, |
| | | |
| | | //是否是专家费的OPO审批人员 |
| | | ismanager: false, |
| | | |
| | | // 查询最新序号参数 |
| | | seqnoParams: { |
| | | businessType: "externalperson", |
| | |
| | | { required: true, message: "请输入账户名称", trigger: "blur" } |
| | | ], |
| | | idcardno: [ |
| | | { required: true, message: "请输入身份证号码", trigger: "blur" } |
| | | { |
| | | //账号类别为"单位机构"时无需身份证号 |
| | | validator: (rule, value, callback) => { |
| | | if (this.hasUserType(this.form.usertype, "org")) { |
| | | return callback(); |
| | | } |
| | | if (!value || !String(value).trim()) { |
| | | return callback(new Error("请输入身份证号码")); |
| | | } |
| | | return callback(); |
| | | }, |
| | | trigger: "blur" |
| | | } |
| | | ], |
| | | bankcardno: [ |
| | | { required: true, message: "请输入银行账号", trigger: "blur" } |
| | |
| | | depositbank: [ |
| | | { required: true, message: "请输入开户银行", trigger: "blur" } |
| | | ] |
| | | }, |
| | | //是否是专家费的OPO审批人员 |
| | | ismanager: false |
| | | }, |
| | | }; |
| | | }, |
| | | computed: { |
| | | /** 表单是否选择了"单位机构"(账号类别为多值,含 org 即为单位) */ |
| | | isUnitForm() { |
| | | return this.hasUserType(this.form.usertype, "org"); |
| | | } |
| | | }, |
| | | created() { |
| | | this.getUserProfile(); |
| | |
| | | methods: { |
| | | //获取当前用户信息 |
| | | getUserProfile() { |
| | | getUserProfile().then(res => { |
| | | if ( |
| | | res.data.userName == "admin" || |
| | | res.data.userName == "053" || |
| | | res.data.userName == "047" |
| | | ) { |
| | | this.ismanager = true; |
| | | } else { |
| | | this.ismanager = false; |
| | | } |
| | | getUserProfile().then(res => { |
| | | const managerList = ["admin", "048", "047"]; |
| | | this.ismanager = managerList.includes(res.data.userName); |
| | | }); |
| | | }, |
| | | |
| | | /** 人员类型(多值,逗号分隔)转数组 */ |
| | | splitUserType(usertype) { |
| | | if (!usertype) { |
| | | return []; |
| | | } |
| | | if (Array.isArray(usertype)) { |
| | | return usertype; |
| | | } |
| | | return String(usertype) |
| | | .split(",") |
| | | .map(t => t.trim()) |
| | | .filter(t => t); |
| | | }, |
| | | /** 人员类型数组转逗号分隔字符串 */ |
| | | joinUserType(usertype) { |
| | | return Array.isArray(usertype) ? usertype.join(",") : usertype; |
| | | }, |
| | | /** 人员类型是否包含指定类型(如 org = 单位机构) */ |
| | | hasUserType(usertype, code) { |
| | | return this.splitUserType(usertype).indexOf(code) > -1; |
| | | }, |
| | | |
| | | /** 查询单位、人员账号列表 */ |
| | |
| | | return; |
| | | } |
| | | */ |
| | | |
| | | |
| | | // this.loading = true; |
| | | listExternalperson(this.queryParams).then(response => { |
| | | this.externalpersonList = response.rows; |
| | |
| | | userno: null, |
| | | username: null, |
| | | userstatus: 0, |
| | | usertype: null, |
| | | usertype: [], |
| | | personnelunitno: null, |
| | | delFlag: null, |
| | | createBy: null, |
| | |
| | | const id = row.id || this.ids; |
| | | getExternalperson(id).then(response => { |
| | | this.form = response.data; |
| | | //账号类别为多值(逗号分隔),表单用数组回显 |
| | | this.form.usertype = this.splitUserType(response.data.usertype); |
| | | this.open = true; |
| | | this.title = "人员/单位账号信息修改"; |
| | | }); |
| | |
| | | if (res.organizationid == this.form.unitno) |
| | | this.form.unitname = res.organizationname; |
| | | }); |
| | | //账号类别为多值:提交前转回逗号分隔的字符串 |
| | | this.form.usertype = this.joinUserType(this.form.usertype); |
| | | console.log(this.form); |
| | | if (this.form.id != null) { |
| | | updateExternalperson(this.form).then(response => { |
| | |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | getOnlyCode(this.seqnoParams).then(res => { |
| | | this.form.userno = res.data.currentvalue; |
| | | //保存信息(单位账号没有身份证号,跳过身份证查重) |
| | | const saveNew = () => { |
| | | getOnlyCode(this.seqnoParams).then(res => { |
| | | this.form.userno = res.data.currentvalue; |
| | | |
| | | addExternalperson(this.form).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.queryParams.username = this.form.username; |
| | | this.getList(); |
| | | addExternalperson(this.form).then(response => { |
| | | this.$modal.msgSuccess("专家信息保存成功!"); |
| | | this.open = false; |
| | | this.queryParams.username = this.form.username; |
| | | this.getList(); |
| | | }); |
| | | }); |
| | | }; |
| | | |
| | | if (!this.form.idcardno || !String(this.form.idcardno).trim()) { |
| | | saveNew(); |
| | | return; |
| | | } |
| | | |
| | | //检查身份证唯一 |
| | | getInfoByIDCardNo(this.form.idcardno).then(res => { |
| | | if (res.data.length > 1) { |
| | | this.$modal.msgWarning("身份证号信息已被登记,请检查身份证号!" |
| | | ); |
| | | return; |
| | | } |
| | | saveNew(); |
| | | }); |
| | | } |
| | | } |
| | |
| | | const ids = row.id || this.ids; |
| | | this.$modal |
| | | .confirm('是否确认删除人员/单位账号信息编号为"' + ids + '"的数据项?') |
| | | .then(function() { |
| | | .then(function () { |
| | | return delExternalperson(ids); |
| | | }) |
| | | .then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("删除成功"); |
| | | }) |
| | | .catch(() => {}); |
| | | .catch(() => { }); |
| | | }, |
| | | /** 导出按钮操作 */ |
| | | handleExport() { |
| | |
| | | this.$download.name(response.msg); |
| | | this.exportLoading = false; |
| | | }) |
| | | .catch(() => {}); |
| | | .catch(() => { }); |
| | | }, |
| | | |
| | | //获取医疗机构列表 |