新增单位修改、单位列表修改接口

lijinlong
吕天方 2 months ago
parent e4ea3b8f62
commit 5d9aa666bc

@ -5,7 +5,7 @@ VUE_APP_TITLE = 若依管理系统
ENV = 'development'
# 若依管理系统/开发环境
VUE_APP_BASE_API = 'http://192.168.0.109:9015'
VUE_APP_BASE_API = 'http://192.168.0.110:9015'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

@ -0,0 +1,33 @@
import request from '@/utils/request'
// 新增单位
export function postUnit(method,data) {
return request({
url: '/tc/unit',
method: method,
data,
})
}
// 查询单位列表
export function listUnit(query) {
return request({
url: '/tc/unit/list',
method: 'get',
params: query
})
}
// 删除单位
export function delUnit(unitId) {
return request({
url: '/tc/unit/' + unitId,
method: 'delete'
})
}
// 单位详情
export function lookUnit(unitId) {
return request({
url: '/tc/unit/' + unitId,
method: 'get'
})
}

@ -379,4 +379,13 @@
}
}
}
}
}
input[aria-hidden="true"] {
display: none !important;
}
.el-radio:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner {
box-shadow: none;
}

@ -6,35 +6,41 @@
<span class="top-title-box">基本信息</span>
</el-row>
<div class="assets-info-box">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="170px" class="demo-ruleForm" label-position="right">
<el-form v-loading="loading" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="170px" class="demo-ruleForm" label-position="right" :disabled="disabled">
<el-row>
<el-col :span="12">
<el-form-item label="新增单位名称">
<el-input v-model="ruleForm.xtmc" placeholder="请输入单位名称"></el-input>
<el-form-item label="新增单位名称" required>
<el-input v-model="ruleForm.nickName" placeholder="请输入单位名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位简称">
<el-input v-model="ruleForm.dwmc" placeholder="请输入单位简称"></el-input>
<el-input v-model="ruleForm.dwjc" placeholder="请输入单位简称"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="所属区域">
<el-input v-model="ruleForm.xtmc"></el-input>
<el-form-item label="所属区域" required>
<el-cascader
size="large"
:props="props"
:options="options"
v-model="ruleForm.ssqy"
>
</el-cascader>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位详细地址">
<el-input v-model="ruleForm.dwmc" placeholder="请输入单位详细地址"></el-input>
<el-form-item label="单位详细地址" required>
<el-input v-model="ruleForm.dwxxdz" placeholder="请输入单位详细地址"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="所属行业">
<el-select v-model="ruleForm.xtzyx" placeholder="请选择系统重要性">
<el-form-item label="所属行业" required>
<el-select v-model="ruleForm.sshy" placeholder="请选择系统重要性">
<el-option
v-for="dict in dict.type.zc_xtzyx"
:key="dict.value"
@ -45,10 +51,10 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位类型">
<el-select v-model="ruleForm.xtzyx" placeholder="请选择系统重要性">
<el-form-item label="单位类型" required>
<el-select v-model="ruleForm.dwlx" placeholder="请选择系统重要性">
<el-option
v-for="dict in dict.type.zc_xtzyx"
v-for="dict in dict.type.dwlx"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@ -60,7 +66,7 @@
<el-row>
<el-col :span="12">
<el-form-item label="单位标签">
<el-select v-model="ruleForm.xtzyx" placeholder="请选择系统重要性">
<el-select v-model="ruleForm.dwbq" placeholder="请选择系统重要性">
<el-option
v-for="dict in dict.type.zc_xtzyx"
:key="dict.value"
@ -72,16 +78,16 @@
</el-col>
<el-col :span="12">
<el-form-item label="所属监管单位">
<el-input v-model="ruleForm.dwmc" placeholder="请输入监管单位"></el-input>
<el-input v-model="ruleForm.ssjgdw" placeholder="请输入监管单位"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="单位角色">
<el-select v-model="ruleForm.xtzyx" placeholder="请选择系统重要性">
<el-select v-model="ruleForm.dwjs" placeholder="请选择系统重要性">
<el-option
v-for="dict in dict.type.zc_xtzyx"
v-for="dict in dict.type.dwjs"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@ -91,9 +97,9 @@
</el-col>
<el-col :span="12">
<el-form-item label="单位直属性质">
<el-select v-model="ruleForm.xtzyx" placeholder="请选择系统重要性">
<el-select v-model="ruleForm.dwzsxz" placeholder="请选择系统重要性">
<el-option
v-for="dict in dict.type.zc_xtzyx"
v-for="dict in dict.type.dwzsxz"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@ -104,15 +110,15 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="统一社会信用代码">
<el-input v-model="ruleForm.xtmc" placeholder="请输入统一社会信用代码"></el-input>
<el-form-item label="统一社会信用代码" required>
<el-input v-model="ruleForm.userName" placeholder="请输入统一社会信用代码"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否关基单位">
<el-select v-model="ruleForm.xtzyx" placeholder="请选择系统重要性">
<el-select v-model="ruleForm.gjdw" placeholder="请选择系统重要性">
<el-option
v-for="dict in dict.type.zc_xtzyx"
v-for="dict in dict.type.is_no"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@ -121,6 +127,13 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="日常运营负责部门" required>
<el-input v-model="ruleForm.rcyyfzbm" placeholder="请输入日常运营负责部门"></el-input>
</el-form-item>
</el-col>
</el-row>
<!-- 联系人 -->
<el-row style="margin: 10px 0;">
<span class="top-title-box">联系人</span>
@ -129,23 +142,31 @@
<el-form-item label="单位负责人" required class="daoqitixingren">
<el-row>
<el-col :span="6">
<el-form-item prop="name">
<el-input v-model="ruleForm.fgfzrxm" style="width: 100%;" placeholder="请输入联系人"></el-input>
<el-form-item prop="dwfzrxm">
<el-input v-model="ruleForm.dwfzrxm" style="width: 100%;" placeholder="请输入联系人"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 10px;">
<el-form-item prop="phoneNumber">
<el-input v-model="ruleForm.fgfzrlxfs" style="width: 100%;" placeholder="请输入联系方式"></el-input>
<el-form-item
:rules="[
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: '请输入正确的手机号码',
trigger: 'blur'
}
]"
>
<el-input v-model="ruleForm.dwfzrlxfs" style="width: 100%;" placeholder="请输入联系方式"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 10px;">
<el-form-item prop="email">
<el-input v-model="ruleForm.fgfzryx" style="width: 100%;" placeholder="请输入邮箱"></el-input>
<el-form-item prop="dwfzryx">
<el-input v-model="ruleForm.dwfzryx" style="width: 100%;" placeholder="请输入邮箱"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 10px;">
<el-form-item prop="zhiwu">
<el-input v-model="ruleForm.fgfzryx" style="width: 100%;" placeholder="请输入职务职称"></el-input>
<el-form-item prop="dwfzrzwzc">
<el-input v-model="ruleForm.dwfzrzwzc" style="width: 100%;" placeholder="请输入职务职称"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -154,15 +175,15 @@
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="分管负责人" required class="daoqitixingren">
<el-form-item label="分管负责人" class="daoqitixingren">
<el-row>
<el-col :span="6">
<el-form-item prop="name">
<el-form-item prop="fgfzrxm">
<el-input v-model="ruleForm.fgfzrxm" style="width: 100%;" placeholder="请输入联系人"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 10px;">
<el-form-item prop="phoneNumber">
<el-form-item prop="phonenumber">
<el-input v-model="ruleForm.fgfzrlxfs" style="width: 100%;" placeholder="请输入联系方式"></el-input>
</el-form-item>
</el-col>
@ -172,8 +193,8 @@
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 10px;">
<el-form-item prop="zhiwu">
<el-input v-model="ruleForm.fgfzryx" style="width: 100%;" placeholder="请输入职务职称"></el-input>
<el-form-item prop="fgfzrzwzc">
<el-input v-model="ruleForm.fgfzrzwzc" style="width: 100%;" placeholder="请输入职务职称"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -182,26 +203,26 @@
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="部门负责人" required class="daoqitixingren">
<el-form-item label="部门负责人" class="daoqitixingren">
<el-row>
<el-col :span="6">
<el-form-item prop="name">
<el-input v-model="ruleForm.fgfzrxm" style="width: 100%;" placeholder="请输入联系人"></el-input>
<el-form-item prop="bmfzrxm">
<el-input v-model="ruleForm.bmfzrxm" style="width: 100%;" placeholder="请输入联系人"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 10px;">
<el-form-item prop="phoneNumber">
<el-input v-model="ruleForm.fgfzrlxfs" style="width: 100%;" placeholder="请输入联系方式"></el-input>
<el-form-item prop="phonenumber">
<el-input v-model="ruleForm.bmfzrlxfs" style="width: 100%;" placeholder="请输入联系方式"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 10px;">
<el-form-item prop="email">
<el-input v-model="ruleForm.fgfzryx" style="width: 100%;" placeholder="请输入邮箱"></el-input>
<el-input v-model="ruleForm.bmfzryx" style="width: 100%;" placeholder="请输入邮箱"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 10px;">
<el-form-item prop="zhiwu">
<el-input v-model="ruleForm.fgfzryx" style="width: 100%;" placeholder="请输入职务职称"></el-input>
<el-form-item prop="bmfzrzwzc">
<el-input v-model="ruleForm.bmfzrzwzc" style="width: 100%;" placeholder="请输入职务职称"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -210,26 +231,26 @@
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="第一联系人" required class="daoqitixingren">
<el-form-item label="第一联系人" class="daoqitixingren">
<el-row>
<el-col :span="6">
<el-form-item prop="name">
<el-input v-model="ruleForm.fgfzrxm" style="width: 100%;" placeholder="请输入联系人"></el-input>
<el-form-item prop="dylxrxm">
<el-input v-model="ruleForm.dylxrxm" style="width: 100%;" placeholder="请输入联系人"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 10px;">
<el-form-item prop="phoneNumber">
<el-input v-model="ruleForm.fgfzrlxfs" style="width: 100%;" placeholder="请输入联系方式"></el-input>
<el-form-item prop="phonenumber">
<el-input v-model="ruleForm.dylxrlxfs" style="width: 100%;" placeholder="请输入联系方式"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 10px;">
<el-form-item prop="email">
<el-input v-model="ruleForm.fgfzryx" style="width: 100%;" placeholder="请输入邮箱"></el-input>
<el-input v-model="ruleForm.dylxryx" style="width: 100%;" placeholder="请输入邮箱"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 10px;">
<el-form-item prop="zhiwu">
<el-input v-model="ruleForm.fgfzryx" style="width: 100%;" placeholder="请输入职务职称"></el-input>
<el-form-item prop="dylxrzwzc">
<el-input v-model="ruleForm.dylxrzwzc" style="width: 100%;" placeholder="请输入职务职称"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -238,41 +259,30 @@
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="其他联系人" required class="daoqitixingren">
<el-form-item label="其他联系人" class="daoqitixingren" v-for="(domain, index) in ruleForm.otherConcat" :key="domain.key" :prop="'otherConcat.' + index + '.value'">
<el-row>
<el-col :span="6">
<el-form-item prop="name">
<el-input v-model="ruleForm.fgfzrxm" style="width: 100%;" placeholder="请输入联系人"></el-input>
<el-input v-model="domain.qtlxrxm" style="width: 100%;" placeholder="请输入联系人"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 10px;">
<el-form-item prop="phoneNumber">
<el-input v-model="ruleForm.fgfzrlxfs" style="width: 100%;" placeholder="请输入联系方式"></el-input>
<el-form-item prop="phonenumber">
<el-input v-model="domain.qtlxrlxfs" style="width: 100%;" placeholder="请输入联系方式"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 10px;">
<el-form-item prop="email">
<el-input v-model="ruleForm.fgfzryx" style="width: 100%;" placeholder="请输入邮箱"></el-input>
<el-input v-model="domain.qtlxryx" style="width: 100%;" placeholder="请输入邮箱"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 10px;">
<el-form-item prop="zhiwu">
<el-input v-model="ruleForm.fgfzryx" style="width: 100%;" placeholder="请输入职务职称"></el-input>
<el-input v-model="domain.qtlxrzwzc" style="width: 100%;" placeholder="请输入职务职称"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item :label="'其他联系人' + (index + 1)" v-for="(domain, index) in ruleForm.restContacts" :key="domain.key" :prop="'restContacts.' + index + '.value'">
<el-row>
<el-col :span="23">
<el-input v-model="domain.value"></el-input>
</el-col>
<el-col :span="1" style="text-align: center;">
<i @click="removeDomain(domain,'restContacts')" class="el-icon-remove-outline" style="margin-left: 5px;font-size: 16px;cursor: pointer;"></i>
<i @click="removeDomain(domain,'otherConcat')" class="el-icon-remove-outline" style="margin-left: 5px;font-size: 16px;cursor: pointer;"></i>
</el-col>
</el-row>
</el-form-item>
@ -281,7 +291,7 @@
<el-row>
<el-col :span="24">
<el-form-item prop="btn">
<el-button @click="addForm('restContacts')"></el-button>
<el-button @click="addForm('otherConcat')"></el-button>
</el-form-item>
</el-col>
</el-row>
@ -290,12 +300,12 @@
<el-row style="margin: 10px 0;">
<span class="top-title-box">检查信息</span>
</el-row>
<div v-for="(domain, index) in ruleForm.jcxxUnit" :key="domain.key" :prop="'jcxxUnit.' + index + '.value'">
<div v-for="(domain, index) in ruleForm.jcxxList" :key="domain.key" :prop="'jcxxList.' + index + '.value'">
<el-row style="display: flex;">
<el-col :span="8">
<el-form-item class="daoqitixingren" required :label="'时间' + (index == 0 ? '' : index)">
<el-date-picker
v-model="ruleForm.ymdqsj"
v-model="domain.sj"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
@ -303,67 +313,48 @@
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8" style="margin-left: 10px;">
<el-col :span="8">
<el-form-item class="daoqitixingren" :label="'系统域名' + (index == 0 ? '' : index)">
<el-input v-model="domain.tyshxydm" placeholder="请输入系统域名"></el-input>
</el-form-item>
</el-col>
<el-col :span="7" style="margin-left: 17px;">
<el-col :span="7">
<el-form-item class="daoqitixingren" :label="'系统名称' + (index == 0 ? '' : index)">
<el-input v-model="domain.lxdh" placeholder="请输入系统名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="1" style="margin-left: 10px;text-align: center;">
<i @click="addGongyinglian('jcxxUnit')" v-if="index == 0" class="el-icon-circle-plus-outline" style="margin-top: 10px;font-size: 16px;cursor: pointer;"></i>
<i @click="removeDomain(domain,'jcxxUnit')" v-else class="el-icon-remove-outline" style="margin-top: 10px;font-size: 16px;cursor: pointer;"></i>
<el-col :span="1" style="text-align: center;">
<i @click="addGongyinglian('jcxxList')" v-if="index == 0" class="el-icon-circle-plus-outline" style="margin-top: 10px;font-size: 16px;cursor: pointer;"></i>
<i @click="removeDomain(domain,'jcxxList')" v-else class="el-icon-remove-outline" style="margin-top: 10px;font-size: 16px;cursor: pointer;"></i>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item :label="'等保级别' + (index == 0 ? '' : index)">
<el-select v-model="domain.dbjb" placeholder="请选择等保级别">
<el-option
v-for="dict in dict.type.dbxx_dbdj"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="'单位名称' + (index == 0 ? '' : index)">
<el-input v-model="domain.dwmc" placeholder="请输入单位名称"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item :label="'检查结果' + (index == 0 ? '' : index)">
<el-input type="textarea" resize="none" placeholder="请输入检查结果" :rows="5" v-model="domain.xgyw_ywms"></el-input>
</el-form-item>
</el-col>
</el-row>
</div>
<el-row>
<el-col :span="8">
<el-form-item label="等保级别">
<el-select v-model="ruleForm.xtzyx" placeholder="请选择等保级别">
<el-option
v-for="dict in dict.type.zc_xtzyx"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单位名称">
<el-input v-model="ruleForm.xtmc" placeholder="请输入单位名称"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="统一社会信用代码">
<el-input v-model="ruleForm.xtmc" placeholder="请输入统一社会信用代码"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否关基单位">
<el-select v-model="ruleForm.xtzyx" placeholder="请选择系统重要性">
<el-option
v-for="dict in dict.type.zc_xtzyx"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="检查结果">
<el-input type="textarea" resize="none" placeholder="请输入检查结果" :rows="5" v-model="ruleForm.xgyw_ywms"></el-input>
</el-form-item>
</el-col>
</el-row>
<!-- 更多信息 -->
<el-row style="margin: 10px 0;">
<span class="top-title-box">更多信息</span>
@ -371,37 +362,37 @@
<el-row>
<el-col :span="8">
<el-form-item label="官网">
<el-input v-model="ruleForm.xtmc" placeholder="请输入官网"></el-input>
<el-input v-model="ruleForm.gw" placeholder="请输入官网"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="地图经度">
<el-input v-model="ruleForm.xtmc" placeholder="请输入地图经度"></el-input>
<el-input v-model="ruleForm.dtjd" placeholder="请输入地图经度"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="地图纬度">
<el-input v-model="ruleForm.xtmc" placeholder="请输入地图纬度"></el-input>
<el-input v-model="ruleForm.dtwd" placeholder="请输入地图纬度"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="上级单位">
<el-input v-model="ruleForm.xtmc" placeholder="请输入上级单位"></el-input>
<el-form-item label="上级单位" required>
<el-input v-model="ruleForm.sjdw" placeholder="请输入上级单位"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注">
<el-input type="textarea" resize="none" placeholder="请输入备注" :rows="5" v-model="ruleForm.xgyw_ywms"></el-input>
<el-input type="textarea" resize="none" placeholder="请输入备注" :rows="5" v-model="ruleForm.remark"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="margin: 10px 0 ;padding-bottom: 50px; text-align: center;">
<el-button type="danger">取消</el-button>
<el-button type="primary">确定</el-button>
<el-button type="primary" @click="newUnit"></el-button>
</el-row>
</el-form>
</div>
@ -409,15 +400,32 @@
</div>
</template>
<script>
import pcas from "@/utils/pca-code.json"
import { lookUnit, postUnit } from "@/api/auditPagesApi/index";
export default {
dicts:['zc_xtzyx'],
dicts:['zc_xtzyx', 'is_no', 'sshy', 'dwlx', 'dwjs', 'dwzsxz', 'dbxx_dbdj'],
data() {
return {
options: pcas ,
props:{
value:'value',
label:"value",
checkStrictly:true,
},
ruleForm:{
//
restContacts:[],
otherConcat:[
{
qtlxrxm: '',
qtlxrlxfs: '',
qtlxryx: '',
qtlxrzwzc: '',
}
],
//
ssqy:[],
//
jcxxUnit:[
jcxxList:[
{
name:"",
tyshxydm:"",
@ -425,24 +433,69 @@ export default {
}
],
},
rules:{}
rules:{
email: [
{
type: "email",
message: "请输入正确的邮箱地址",
trigger: ["blur", "change"]
}
],
phonenumber: [
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码",
trigger: "blur"
}
]
},
disabled:false,
loading:false,
}
},
mounted(){
if(this.$route.query.pageType == 'look') {
this.getInfo(this.$route.query.id)
this.disabled = true;
} else if(this.$route.query.pageType == 'change') {
this.getInfo(this.$route.query.id)
this.disabled = false;
}
},
methods:{
getInfo(id){
this.loading = true;
lookUnit(id).then(res=>{
this.ruleForm = res.data;
if(res.data.ssqyprovince && res.data.ssqycity && res.data.ssqycounty) {
this.$set(this.ruleForm, 'ssqy', [res.data.ssqyprovince,res.data.ssqycity,res.data.ssqycounty])
} else if(res.data.ssqyprovince && res.data.ssqycity) {
this.$set(this.ruleForm, 'ssqy', [res.data.ssqyprovince,res.data.ssqycity])
} else if(res.data.ssqyprovince) {
this.$set(this.ruleForm, 'ssqy', [res.data.ssqyprovince])
}
this.loading = false;
})
},
// form
addForm(type){
this.ruleForm[type].push({
value: '',
qtlxrxm: '',
qtlxrlxfs: '',
qtlxryx: '',
qtlxrzwzc: '',
key: Date.now()
});
},
// Form
addGongyinglian(type){
this.ruleForm[type].push({
name:"",
tyshxydm:"",
lxr:"",
lxdh:"",
sj:"",
xtym:"",
xthc:"",
dbjb:"",
dwmc:"",
jcjg:"",
key: Date.now()
});
},
@ -453,6 +506,29 @@ export default {
this.ruleForm[type].splice(index, 1)
}
},
newUnit(){
if(this.ruleForm.ssqy.length > 0) {
this.ruleForm.ssqyprovince = this.ruleForm.ssqy[0]
this.ruleForm.ssqycity = this.ruleForm.ssqy[1]
this.ruleForm.ssqycounty = this.ruleForm.ssqy[2]
}
this.loading = true;
postUnit('post',this.ruleForm).then(res=>{
console.log(res);
this.loading = false;
})
},
},
beforeRouteEnter(to,from,next){
if(to.query.pageType == 'add') {
to.meta.title = '新增单位'
} else if(to.query.pageType == 'change') {
to.meta.title = '修改单位'
} else if(to.query.pageType == 'look') {
to.meta.title = '单位详情'
}
next();
},
}
</script>

@ -140,12 +140,12 @@
<div class="L-main" id="L-size-main">
<div class="content-search" id="L-header">
<div class="search-title">查询条件</div>
<el-form :inline="true" :model="queryParams" size="small" class="demo-form-inline">
<el-form :inline="true" :model="queryParams" ref="queryForm" size="small" class="demo-form-inline">
<el-row>
<el-col :span="6">
<el-form-item label="单位名称:">
<el-form-item label="单位名称:" prop="nickName">
<el-input
v-model="queryParams.userName"
v-model="queryParams.nickName"
placeholder="请输入单位名称"
clearable
@keyup.enter.native="handleQuery"
@ -153,9 +153,9 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="单位类型:">
<el-form-item label="单位类型:" prop="dwlx">
<el-select
v-model="queryParams.status"
v-model="queryParams.dwlx"
placeholder="用户状态"
clearable
>
@ -169,9 +169,9 @@
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="统一社会信用代码:" class="tyshxydm-class">
<el-form-item label="统一社会信用代码:" class="tyshxydm-class" prop="userName">
<el-input
v-model="queryParams.phonenumber"
v-model="queryParams.userName"
placeholder="请输入统一社会信用代码"
clearable
@keyup.enter.native="handleQuery"
@ -227,7 +227,7 @@
<el-table v-loading="loading" :data="userList" :height="tabHeader" :max-height="tabHeader" :row-class-name="tableRowClassName">
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column label="单位名称" align="center" key="nickName" prop="nickName">
<template slot-scope="scope">{{ scope.row.unitInfo.nickName }}</template>
<template slot-scope="scope">{{ scope.row.nickName }}</template>
</el-table-column>
<el-table-column label="单位类型" align="center" key="dwlx" prop="dwlx">
<template slot-scope="scope">
@ -235,26 +235,26 @@
</template>
</el-table-column>
<el-table-column label="统一社会信用代码" align="center" key="userName" prop="userName">
<template slot-scope="scope">{{ scope.row.unitInfo.userName }}</template>
<template slot-scope="scope">{{ scope.row.userName }}</template>
</el-table-column>
<el-table-column label="所属区域" align="center" key="ssqycounty" prop="ssqycounty">
<template slot-scope="scope">{{ scope.row.unitInfo.ssqycounty }}</template>
<template slot-scope="scope">{{ scope.row.ssqycity }}</template>
</el-table-column>
<el-table-column label="所属行业" align="center" key="sshy" prop="sshy">
<template slot-scope="scope">
<!-- <dict-tag :options="dict.type.sshy" :value="scope.row.sshy"/> -->
{{ scope.row.sshy }}
<dict-tag :options="dict.type.sshy" :value="scope.row.sshy"/>
<!-- {{ scope.row.sshy }} -->
</template>
</el-table-column>
<el-table-column label="单位地址" align="center" key="dwxxdz" prop="dwxxdz">
<template slot-scope="scope">{{ scope.row.unitInfo.dwxxdz }}</template>
<template slot-scope="scope">{{ scope.row.dwxxdz }}</template>
</el-table-column>
<el-table-column label="操作" prop="userId" class-name="table-operation" align="center">
<template slot-scope="scope">
<div style="display: flex;align-items: center;justify-content: center;">
<div style="display: flex;align-items: center;">
<img src="@/assets/images/icon-ck@2x.png" alt="" style="width: 20px;margin-right: 5px;">
<span class="look-info" @click="handleUpdate(scope.row)" style="color: #1485EF;margin-right: 15px;cursor: pointer;">查看</span>
<span class="look-info" @click="handleLookdate(scope.row)" style="color: #1485EF;margin-right: 15px;cursor: pointer;">查看</span>
</div>
<div style="display: flex;align-items: center;">
<img src="@/assets/images/edit.png" alt="" style="width: 15px;margin-right: 5px;">
@ -272,10 +272,10 @@
<my-pagination
id="L-pagination"
:total="total"
:page="queryParams.pageNum"
:limit="queryParams.pageSize"
:page="queryParams.current"
:limit="queryParams.size"
@pagination="getPagination"
:current-page.sync="queryParams.pageNum"
:current-page.sync="queryParams.current"
></my-pagination>
</main>
<!-- 用户导入对话框 -->
@ -311,7 +311,8 @@
</template>
<script>
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user";
// import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user";
import { listUnit, delUnit } from "@/api/auditPagesApi/index";
import { getToken } from "@/utils/auth";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@ -347,8 +348,6 @@ export default {
deptName: undefined,
//
initPassword: undefined,
//
dateRange: [],
//
postOptions: [],
//
@ -372,16 +371,15 @@ export default {
//
headers: { Authorization: "Bearer " + getToken() },
//
url: process.env.VUE_APP_BASE_API + "/system/user/importData"
url: process.env.VUE_APP_BASE_API + "/tc/unit/importData"
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
current: 1,
size: 10,
userName: undefined,
phonenumber: undefined,
status: undefined,
deptId: undefined
nickName: undefined,
dwlx: undefined,
},
//
rules: {
@ -412,15 +410,6 @@ export default {
}
]
},
formInline:{
name:"",
type:"",
status:"",
},
pagination:{
current:1,
size:10,
},
tabHeader: undefined,
};
},
@ -447,74 +436,32 @@ export default {
/** 查询用户列表 */
getList() {
this.loading = true;
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.userList = response.rows;
this.total = response.total;
listUnit(this.queryParams).then(response => {
this.userList = response.data.records;
this.total = response.data.total;
this.loading = false;
}
);
},
//
getPagination(pages){
this.queryParams.pageNum = pages.page;
this.queryParams.pageSize = pages.limit;
this.queryParams.current = pages.page;
this.queryParams.size = pages.limit;
this.getList();
},
//
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.handleQuery();
},
//
handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用";
this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function() {
return changeUserStatus(row.userId, row.status);
}).then(() => {
this.$modal.msgSuccess(text + "成功");
}).catch(function() {
row.status = row.status === "0" ? "1" : "0";
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
userId: undefined,
deptId: undefined,
userName: undefined,
nickName: undefined,
password: undefined,
phonenumber: undefined,
email: undefined,
sex: undefined,
status: "0",
remark: undefined,
postIds: [],
roleIds: []
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.queryParams.current = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.queryParams.deptId = undefined;
this.$refs.tree.setCurrentKey(null);
this.handleQuery();
},
/** 新增按钮操作 */
@ -533,24 +480,23 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const userId = row.userId || this.ids;
getUser(userId).then(response => {
this.form = response.data;
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.$set(this.form, "postIds", response.postIds);
this.$set(this.form, "roleIds", response.roleIds);
this.open = true;
this.title = "修改用户";
this.form.password = "";
});
this.$router.push({name: 'UnitAuth',query: {
pageType: "change",
id: row.id
}})
},
/** 查看按钮操作 */
handleLookdate(row){
this.$router.push({name: 'UnitAuth',query: {
pageType: "look",
id: row.id
}})
},
/** 删除按钮操作 */
handleDelete(row) {
const userIds = row.userId || this.ids;
this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
return delUser(userIds);
return delUnit(userIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
@ -558,9 +504,9 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
this.download('system/user/export', {
this.download('/tc/unit/export', {
...this.queryParams
}, `user_${new Date().getTime()}.xlsx`)
}, `unit_${new Date().getTime()}.xlsx`)
},
/** 导入按钮操作 */
handleImport() {
@ -569,8 +515,8 @@ export default {
},
/** 下载模板操作 */
importTemplate() {
this.download('system/user/importTemplate', {
}, `user_template_${new Date().getTime()}.xlsx`)
this.download('/tc/unit/importTemplate', {
}, `unit_template_${new Date().getTime()}.xlsx`)
},
//
handleFileUploadProgress(event, file, fileList) {

Loading…
Cancel
Save