修改二级页面接口对接
This commit is contained in:
parent
3967e0e333
commit
5fb0b44b28
|
|
@ -29,7 +29,7 @@ export function delSupervisionUnit(addressId) {
|
|||
// 获取总监列表数据
|
||||
export function getDirectorListApi(query) {
|
||||
return request({
|
||||
url: '/project/SupervisionUnit/xxx',
|
||||
url: '/project/SupervisionUnit/listSupervisionUnitUser',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
|
|
@ -37,7 +37,7 @@ export function getDirectorListApi(query) {
|
|||
// 新增总监
|
||||
export function addDirectorInfoApi(data) {
|
||||
return request({
|
||||
url: '/project/SupervisionUnit/xxx',
|
||||
url: '/project/pro/addSupervisoryUnit',
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
|
|
@ -45,16 +45,16 @@ export function addDirectorInfoApi(data) {
|
|||
// 修改总监
|
||||
export function editDirectorInfoApi(data) {
|
||||
return request({
|
||||
url: '/project/SupervisionUnit/xxx',
|
||||
url: '/project/SupervisionUnit/updateSupervisionUnitUser',
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
}
|
||||
// 删除总监
|
||||
export function deleteDirectorInfoApi(query) {
|
||||
export function deleteDirectorInfoApi(addressId) {
|
||||
return request({
|
||||
url: '/project/SupervisionUnit/xxx',
|
||||
method: 'get',
|
||||
params: query,
|
||||
url: '/project/SupervisionUnit/delSupervisionUnitUser/'+addressId,
|
||||
method: 'DELETE',
|
||||
// params: {"id":addressId}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange" >
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column
|
||||
type="index"
|
||||
|
|
@ -66,15 +66,14 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="社会统一征信代码" show-overflow-tooltip align="center" prop="socialUnifiedCreditCode" />
|
||||
<el-table-column label="总监" show-overflow-tooltip align="center" prop="userNum" />
|
||||
<!-- <el-table-column label="总监" align="center" prop="directorsName"/>-->
|
||||
<!-- <el-table-column label="总监联系方式" width="120" align="center">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <!– 检查是否存在身份证号 –>-->
|
||||
<!-- <span v-if="scope.row.directorsPhone">{{ hideSensitiveInfo(scope.row.directorsPhone) }}</span>-->
|
||||
<!-- <span v-else>-</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="总监" show-overflow-tooltip align="center" prop="userNum" >
|
||||
<template v-slot="scope">
|
||||
<el-tooltip class="item" effect="dark" prop="userNum" placement="top">
|
||||
<div @click="onHandleDirector(scope.row)">{{ scope.row.userNum }}</div>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
|
@ -216,11 +215,11 @@
|
|||
>
|
||||
<!-- 查询 -->
|
||||
<el-form :model="directorQueryParams" ref="queryForm" size="small" inline>
|
||||
<el-form-item prop="unitName">
|
||||
<el-form-item prop="directorsName">
|
||||
<el-input
|
||||
clearable
|
||||
placeholder="请输入姓名"
|
||||
v-model="directorQueryParams.director_name"
|
||||
v-model="directorQueryParams.directorsName"
|
||||
@keyup.enter.native="onHandleQueryDirectorList"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
|
@ -241,12 +240,13 @@
|
|||
align="center"
|
||||
:index="indexContinuous(directorQueryParams.pageNum, directorQueryParams.pageSize)"
|
||||
/>
|
||||
<el-table-column label="姓名" prop="name" show-overflow-tooltip align="center" />
|
||||
<el-table-column label="联系电话" prop="phone" show-overflow-tooltip align="center" />
|
||||
<el-table-column label="姓名" prop="directorsName" show-overflow-tooltip align="center" />
|
||||
<el-table-column label="联系电话" prop="directorsPhone" show-overflow-tooltip align="center" />
|
||||
<el-table-column label="身份证号码" prop="commUserCode" show-overflow-tooltip align="center" />
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<el-button size="mini" type="primary" plain @click="onHandleEdit(row)">编辑</el-button>
|
||||
<el-button size="mini" type="danger" plain @click="onHandleDelete(row)">删除</el-button>
|
||||
<el-button size="mini" type="danger" plain @click="onHandleDelete(row)" >删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -267,12 +267,16 @@
|
|||
ref="directorAddFormRef"
|
||||
:rules="directorAddFormRules"
|
||||
>
|
||||
<el-form-item prop="name" label="总监">
|
||||
<el-input placeholder="请输入" v-model="directorAddForm.name" clearable />
|
||||
<el-form-item prop="directorsName" label="总监">
|
||||
<el-input placeholder="请输入" v-model="directorAddForm.directorsName" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item prop="phone" label="总监联系方式">
|
||||
<el-input placeholder="请输入" v-model="directorAddForm.phone" clearable />
|
||||
<el-form-item prop="directorsIdCard" label="总监身份证">
|
||||
<el-input placeholder="请输入" v-model="directorAddForm.directorsIdCard" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item prop="directorsPhone" label="总监联系方式">
|
||||
<el-input placeholder="请输入" v-model="directorAddForm.directorsPhone" clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
<el-row style="text-align: right">
|
||||
|
|
@ -410,42 +414,34 @@ export default {
|
|||
directorInnerTitle: '新增',
|
||||
// 查询参数
|
||||
directorQueryParams: {
|
||||
director_name: '', // 姓名
|
||||
unitId:'',
|
||||
directorsName: '', // 姓名
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
},
|
||||
// 列表数据源
|
||||
directorList: [
|
||||
{
|
||||
name: '张三',
|
||||
phone: '13656235623',
|
||||
},
|
||||
{
|
||||
name: '张三',
|
||||
phone: '13656235623',
|
||||
},
|
||||
{
|
||||
name: '张三',
|
||||
phone: '13656235623',
|
||||
},
|
||||
],
|
||||
directorList: [],
|
||||
// 列表条数
|
||||
directorTotal: 0,
|
||||
// 新增总监参数
|
||||
directorAddForm: {
|
||||
name: '',
|
||||
phone: '',
|
||||
directorsName: '',
|
||||
directorsPhone: '',
|
||||
directorsIdCard:'',
|
||||
commUserId:'',
|
||||
supId:'',
|
||||
jlId:'',
|
||||
},
|
||||
// 新增总监 rules
|
||||
directorAddFormRules: {
|
||||
name: [
|
||||
directorsName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入总监姓名',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
phone: [
|
||||
directorsPhone: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入总监联系方式',
|
||||
|
|
@ -458,6 +454,20 @@ export default {
|
|||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
directorsIdCard: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入身份证号码',
|
||||
trigger: 'blur',
|
||||
},
|
||||
// 手机号码正则
|
||||
{
|
||||
// 身份证号码的正则表达式
|
||||
pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
|
||||
message: "请输入正确的身份证号码",
|
||||
trigger: "blur"
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
|
@ -471,7 +481,7 @@ export default {
|
|||
getList() {
|
||||
this.loading = true
|
||||
listSupervisionUnit(this.queryParams).then(response => {
|
||||
// this.postList = response.rows
|
||||
this.postList = response.rows
|
||||
console.log('postList:', this.postList)
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
|
|
@ -482,6 +492,9 @@ export default {
|
|||
this.supervisorFormOpen = false
|
||||
this.unitResetForm()
|
||||
},
|
||||
openUserInfo(){
|
||||
this.directorOuterVisible = true
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
|
|
@ -645,27 +658,34 @@ export default {
|
|||
// 点击列表总监数量时打开弹框
|
||||
onHandleDirector(row) {
|
||||
console.log('row当前行信息', row)
|
||||
this.directorQueryParams.unitId=row.supId;
|
||||
this.onHandleQueryDirectorList()
|
||||
this.directorOuterVisible = true
|
||||
},
|
||||
// 查询弹框内总监列表
|
||||
async onHandleQueryDirectorList() {
|
||||
const res = await getDirectorListApi(this.directorQueryParams)
|
||||
this.directorList=res.rows;
|
||||
this.directorTotal=res.total;
|
||||
console.log('总监数据列表', res)
|
||||
},
|
||||
// 新增总监按钮
|
||||
onHandleAddDirector() {
|
||||
this.directorInnerTitle = '新增'
|
||||
this.directorAddForm.name = ''
|
||||
this.directorAddForm.phone = ''
|
||||
this.directorAddForm.directorsName = ''
|
||||
this.directorAddForm.directorsPhone = ''
|
||||
this.directorAddForm.directorsIdCard = ''
|
||||
this.directorInnerVisible = true
|
||||
},
|
||||
// 列表编辑按钮
|
||||
onHandleEdit(row) {
|
||||
const { name, phone } = row
|
||||
|
||||
this.directorInnerTitle = '编辑'
|
||||
this.directorAddForm.name = name
|
||||
this.directorAddForm.phone = phone
|
||||
this.directorAddForm.directorsName = row.directorsName;
|
||||
this.directorAddForm.directorsPhone = row.directorsPhone;
|
||||
this.directorAddForm.directorsIdCard = row.commUserCode;
|
||||
this.directorAddForm.commUserId = row.commUserId;
|
||||
this.directorAddForm.supId = row.supId;
|
||||
this.directorInnerVisible = true
|
||||
console.log('row当前行信息', row)
|
||||
},
|
||||
|
|
@ -676,7 +696,7 @@ export default {
|
|||
.confirm('是否确认删除当前数据?')
|
||||
.then(async () => {
|
||||
console.log('确认删除--')
|
||||
const res = await deleteDirectorInfoApi({})
|
||||
const res = await deleteDirectorInfoApi(row.supId)
|
||||
if (res.code === 200) {
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
this.onHandleQueryDirectorList()
|
||||
|
|
@ -696,10 +716,9 @@ export default {
|
|||
if (valid) {
|
||||
// 校验通过
|
||||
console.log('this.directorAddForm新增总监提交参数', this.directorAddForm)
|
||||
|
||||
this.directorAddForm.jlId= this.directorQueryParams.unitId;
|
||||
// 根据弹框标题判断当前是新增还是修改
|
||||
const SEND_API = this.directorInnerTitle === '新增' ? addDirectorInfoApi : editDirectorInfoApi
|
||||
|
||||
const res = await SEND_API(this.directorAddForm)
|
||||
if (res.code === 200) {
|
||||
this.$modal.msgSuccess(`${this.directorInnerTitle}成功`)
|
||||
|
|
|
|||
Loading…
Reference in New Issue