| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="80px"> |
| | | <el-form |
| | | 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> |
| | | </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.username" placeholder="请输入账号名称" clearable size="small" |
| | | @keyup.enter.native="handleQuery" /> |
| | | </el-form-item> |
| | | <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> |
| | | <el-form-item label="所在单位" prop="unitname"> |
| | | <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> |
| | |
| | | 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> |
| | | </el-row> |
| | | |
| | | <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="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" /> |
| | | <el-table-column label="所在单位" width="250" align="center" prop="unitname" /> |
| | | <!-- |
| | | <el-table-column label="性别" align="center" prop="sex"> |
| | | <template slot-scope="scope"> |
| | |
| | | <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-delete" @click="handleDelete(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <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-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-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-form-item> |
| | | <el-input disabled="true" v-model="form.userno" placeholder="请输入账号编号" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="账号名称" prop="username"> |
| | | <el-input v-model="form.username" placeholder="请输入账号名称" /> </el-form-item> |
| | | <el-input v-model="form.username" placeholder="请输入账号名称" /> |
| | | </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-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-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" |
| | |
| | | <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.value"></el-option> </el-select> |
| | | :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.unitname" placeholder="所在单位" clearable filterable allow-create style="width: 100%"> |
| | | <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-row> |
| | | <el-row> |
| | | <el-col :span="24"><el-form-item label="开户银行" prop="depositbank"> |
| | | <el-input v-model="form.depositbank" placeholder="请输入开户银行名称" /> </el-form-item> |
| | | <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-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="联系地址" prop="address"> |
| | | <el-input v-model="form.address" placeholder="请输入联系地址" /> </el-form-item> |
| | | <el-input v-model="form.address" placeholder="请输入联系地址" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="联系电话" prop="telephone"> |
| | | <el-input v-model="form.telephone" placeholder="请输入联系电话" /> </el-form-item> |
| | | <el-input v-model="form.telephone" placeholder="请输入联系电话" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <!-- |
| | |
| | | addExternalperson, |
| | | updateExternalperson, |
| | | exportExternalperson, |
| | | getOnlyCode, |
| | | getInfoByIDCardNo, |
| | | getOnlyCode |
| | | } from "@/api/project/externalperson"; |
| | | |
| | | import { |
| | |
| | | pageSize: 10, |
| | | userno: null, |
| | | username: null, |
| | | usertype: null, |
| | | usertype: null |
| | | }, |
| | | |
| | | //是否是专家费的OPO审批人员 |
| | | ismanager: false, |
| | | |
| | | // 查询最新序号参数 |
| | | seqnoParams: { |
| | | businessType: "externalperson", |
| | | datequery: false, |
| | | datequery: false |
| | | }, |
| | | // 表单参数 |
| | | form: {}, |
| | |
| | | { 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 == "001" || |
| | | 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; |
| | | }, |
| | | |
| | | /** 查询单位、人员账号列表 */ |
| | | getList() { |
| | | if (this.queryParams.username === null || this.queryParams.username.replace(/\s/g, '') == "") { |
| | | this.$modal.msgWarning("查找账户时,账户名称不能为空,请输入账户名称!"); |
| | | /* |
| | | if ( |
| | | this.queryParams.username === null || |
| | | this.queryParams.username.replace(/\s/g, "") == "" |
| | | ) { |
| | | this.$modal.msgWarning( |
| | | "查找账户时,账户名称不能为空,请输入账户名称!" |
| | | ); |
| | | return; |
| | | } |
| | | */ |
| | | |
| | | // this.loading = true; |
| | | listExternalperson(this.queryParams).then((response) => { |
| | | listExternalperson(this.queryParams).then(response => { |
| | | this.externalpersonList = response.rows; |
| | | this.total = response.total; |
| | | // this.loading = false; |
| | |
| | | userno: null, |
| | | username: null, |
| | | userstatus: 0, |
| | | usertype: null, |
| | | usertype: [], |
| | | personnelunitno: null, |
| | | delFlag: null, |
| | | createBy: null, |
| | |
| | | updateBy: null, |
| | | updateTime: null, |
| | | pym: null, |
| | | wbm: null, |
| | | wbm: null |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** 搜索按钮操作 */ |
| | | handleQuery() { |
| | | console.log("handleQuery", this.queryParams); |
| | | if (this.queryParams.username === null || this.queryParams.username.replace(/\s/g, '') == "") { |
| | | this.$modal.msgWarning("为限制批量查找账户信息,限制账户名称为必输项,请输入账户名称后再搜索!"); |
| | | /* |
| | | if ( |
| | | this.queryParams.username === null || |
| | | this.queryParams.username.replace(/\s/g, "") == "" |
| | | ) { |
| | | this.$modal.msgWarning( |
| | | "为限制批量查找账户信息,限制账户名称为必输项,请输入账户名称后再搜索!" |
| | | ); |
| | | return; |
| | | } |
| | | */ |
| | | |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | |
| | | }, |
| | | // 多选框选中数据 |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map((item) => item.id); |
| | | this.ids = selection.map(item => item.id); |
| | | this.single = selection.length !== 1; |
| | | this.multiple = !selection.length; |
| | | }, |
| | |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | const id = row.id || this.ids; |
| | | getExternalperson(id).then((response) => { |
| | | getExternalperson(id).then(response => { |
| | | this.form = response.data; |
| | | //账号类别为多值(逗号分隔),表单用数组回显 |
| | | this.form.usertype = this.splitUserType(response.data.usertype); |
| | | this.open = true; |
| | | this.title = "人员/单位账号信息修改"; |
| | | }); |
| | | }, |
| | | /** 提交按钮 */ |
| | | submitForm() { |
| | | this.$refs["form"].validate((valid) => { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | console.log("unitList", this.unitList); |
| | | this.unitList.map(res => { |
| | | 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) => { |
| | | updateExternalperson(this.form).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.open = false; |
| | | this.queryParams.username = this.form.username; |
| | | 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(); |
| | | }); |
| | | } |
| | | } |
| | |
| | | this.exportLoading = true; |
| | | return exportExternalperson(queryParams); |
| | | }) |
| | | .then((response) => { |
| | | .then(response => { |
| | | this.$download.name(response.msg); |
| | | this.exportLoading = false; |
| | | }) |
| | |
| | | for (let i = 0; i < response.rows.length; i++) { |
| | | this.unitList.push({ |
| | | //organizationid: response.rows[i].organizationid, |
| | | organizationid: response.rows[i].id, |
| | | organizationid: response.rows[i].id.toString(), |
| | | organizationname: response.rows[i].organizationname |
| | | }); |
| | | console.log(this.unitList); |
| | | } |
| | | }); |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }; |
| | | </script> |