工程添加总监人员
This commit is contained in:
parent
20c048c2dd
commit
20a349e47b
|
|
@ -81,6 +81,19 @@ export function addSupervisoryUnit(data) {
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增监理单位
|
||||||
|
* @param data
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
export function addSupervisoryUnitUser(data) {
|
||||||
|
return request({
|
||||||
|
url: '/project/pro/addSupervisoryUnitUser',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 新增承包商单位
|
* 新增承包商单位
|
||||||
* @param data
|
* @param data
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,19 @@ export function selectSupervisionUnit(query) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询监理单位人员
|
||||||
|
* @param query
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
export function selectSupervisionUnitUser(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/select/selectSupervisionUnitUser',
|
||||||
|
method: 'post',
|
||||||
|
data: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询文件信息
|
* 查询文件信息
|
||||||
* @param query
|
* @param query
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,21 @@
|
||||||
<el-select v-model="formData.supervisorUnitId" placeholder="请选择监理单位" clearable
|
<el-select v-model="formData.supervisorUnitId" placeholder="请选择监理单位" clearable
|
||||||
@change="changeSupervisorUnit"
|
@change="changeSupervisorUnit"
|
||||||
:style="{width: '87%'}"
|
:style="{width: '87%'}"
|
||||||
|
>
|
||||||
|
<el-option v-for="(item,index) in supervisorUnitUserOptions" :key="index" :label="item.label"
|
||||||
|
:value="item.value" :disabled="item.disabled"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="2">
|
||||||
|
<el-button type="primary" @click="createUnit">创建监理单位</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="7">
|
||||||
|
<el-form-item label-width="120px" label="选择总监" prop="supervisorUnitUserId">
|
||||||
|
<el-select v-model="formData.supervisorUnitUserId" placeholder="请选择总监" clearable
|
||||||
|
@change="changeSupervisorUnitUser"
|
||||||
|
:style="{width: '87%'}"
|
||||||
>
|
>
|
||||||
<el-option v-for="(item,index) in supervisorUnitOptions" :key="index" :label="item.label"
|
<el-option v-for="(item,index) in supervisorUnitOptions" :key="index" :label="item.label"
|
||||||
:value="item.value" :disabled="item.disabled"
|
:value="item.value" :disabled="item.disabled"
|
||||||
|
|
@ -72,8 +87,8 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<el-col :span="2">
|
||||||
<el-button type="primary" @click="createUnit">创建监理单位</el-button>
|
<el-button type="primary" @click="createUnitUser">添加总监</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<h2 style="color: #409EFF;background: #e8e8e8;padding: 15px;border-radius: 10px">工程地址配置</h2>
|
<h2 style="color: #409EFF;background: #e8e8e8;padding: 15px;border-radius: 10px">工程地址配置</h2>
|
||||||
|
|
@ -197,6 +212,34 @@
|
||||||
:style="{width: '100%'}"
|
:style="{width: '100%'}"
|
||||||
></el-input>
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="总监" prop="directorsName" label-width="140px">-->
|
||||||
|
<!-- <el-input v-model="unitForm.directorsName" placeholder="请输入总监姓名" show-word-limit :maxlength="20"-->
|
||||||
|
<!-- clearable v-no-whitespace-->
|
||||||
|
<!-- :style="{width: '100%'}"-->
|
||||||
|
<!-- ></el-input>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<!-- <el-form-item label="总监联系方式" prop="directorsPhone" label-width="140px">-->
|
||||||
|
<!-- <el-input v-model="unitForm.directorsPhone" placeholder="请输入总监联系方式" show-word-limit :maxlength="11"-->
|
||||||
|
<!-- clearable v-no-whitespace-->
|
||||||
|
<!-- :style="{width: '100%'}"-->
|
||||||
|
<!-- ></el-input>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<!-- <el-form-item label="总监身份证" prop="directorsIdCard" label-width="140px">-->
|
||||||
|
<!-- <el-input v-model="unitForm.directorsIdCard" placeholder="请输入总监身份证" show-word-limit :maxlength="18"-->
|
||||||
|
<!-- clearable v-no-whitespace-->
|
||||||
|
<!-- :style="{width: '100%'}"-->
|
||||||
|
<!-- ></el-input>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitUnitUserForm" v-preventReClick="5000">提 交</el-button>
|
||||||
|
<el-button @click="unitCancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<!-- 添加总监-->
|
||||||
|
<el-dialog :title="'添加总监'" :visible.sync="supervisorUserFormOpen" width="30%" :close-on-click-modal="false">
|
||||||
|
<el-form ref="unitForm" :model="unitForm" :rules="unitRules" size="medium" label-width="100px">
|
||||||
|
|
||||||
<el-form-item label="总监" prop="directorsName" label-width="140px">
|
<el-form-item label="总监" prop="directorsName" label-width="140px">
|
||||||
<el-input v-model="unitForm.directorsName" placeholder="请输入总监姓名" show-word-limit :maxlength="20"
|
<el-input v-model="unitForm.directorsName" placeholder="请输入总监姓名" show-word-limit :maxlength="20"
|
||||||
clearable v-no-whitespace
|
clearable v-no-whitespace
|
||||||
|
|
@ -218,7 +261,7 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitUnitForm" v-preventReClick="5000">提 交</el-button>
|
<el-button type="primary" @click="submitUnitForm" v-preventReClick="5000">提 交</el-button>
|
||||||
<el-button @click="unitCancel">取 消</el-button>
|
<el-button @click="unitUserCancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 创建承包商单位 -->
|
<!-- 创建承包商单位 -->
|
||||||
|
|
@ -294,7 +337,7 @@ import {
|
||||||
selectProAddress,
|
selectProAddress,
|
||||||
selectCons,
|
selectCons,
|
||||||
selectMaterial,
|
selectMaterial,
|
||||||
selectSupervisionUnit, getProLeaderOption
|
selectSupervisionUnit, getProLeaderOption, selectSupervisionUnitUser,
|
||||||
} from '@/api/tool/select'
|
} from '@/api/tool/select'
|
||||||
import {
|
import {
|
||||||
addSupervisoryUnit,
|
addSupervisoryUnit,
|
||||||
|
|
@ -304,7 +347,7 @@ import {
|
||||||
selectProInfoDetails,
|
selectProInfoDetails,
|
||||||
checkIsExistUnitName,
|
checkIsExistUnitName,
|
||||||
checkIsExistConsName,
|
checkIsExistConsName,
|
||||||
checkIsExistProName
|
checkIsExistProName, addSupervisoryUnitUser,
|
||||||
} from '@/api/pro/proList'
|
} from '@/api/pro/proList'
|
||||||
import numberUtils from '@/utils/validate'
|
import numberUtils from '@/utils/validate'
|
||||||
|
|
||||||
|
|
@ -317,6 +360,8 @@ export default {
|
||||||
loading: false,
|
loading: false,
|
||||||
// 是否显示创建监理单位弹出层
|
// 是否显示创建监理单位弹出层
|
||||||
supervisorFormOpen: false,
|
supervisorFormOpen: false,
|
||||||
|
|
||||||
|
supervisorUserFormOpen: false,
|
||||||
// 是否显示创建承包商单位弹出层
|
// 是否显示创建承包商单位弹出层
|
||||||
consFormOpen: false,
|
consFormOpen: false,
|
||||||
// 是否显示创建工程地址弹出层
|
// 是否显示创建工程地址弹出层
|
||||||
|
|
@ -438,6 +483,8 @@ export default {
|
||||||
],
|
],
|
||||||
formData: {
|
formData: {
|
||||||
proId: undefined,
|
proId: undefined,
|
||||||
|
|
||||||
|
jlId:undefined,
|
||||||
//工程名称
|
//工程名称
|
||||||
proName: undefined,
|
proName: undefined,
|
||||||
//工程负责人
|
//工程负责人
|
||||||
|
|
@ -453,8 +500,12 @@ export default {
|
||||||
endDate: null,
|
endDate: null,
|
||||||
//监理单位
|
//监理单位
|
||||||
supervisorUnit: undefined,
|
supervisorUnit: undefined,
|
||||||
|
|
||||||
|
supervisorUnitUser: undefined,
|
||||||
//监理单位id
|
//监理单位id
|
||||||
supervisorUnitId: undefined,
|
supervisorUnitId: undefined,
|
||||||
|
//人员id
|
||||||
|
supervisorUnitUserId: undefined,
|
||||||
//工程地址
|
//工程地址
|
||||||
proAddress: [
|
proAddress: [
|
||||||
{
|
{
|
||||||
|
|
@ -520,6 +571,7 @@ export default {
|
||||||
proTypeOptions: [],
|
proTypeOptions: [],
|
||||||
//监理单位下拉选
|
//监理单位下拉选
|
||||||
supervisorUnitOptions: [],
|
supervisorUnitOptions: [],
|
||||||
|
supervisorUnitUserOptions: [],
|
||||||
//承包商下拉选
|
//承包商下拉选
|
||||||
consOptions: [],
|
consOptions: [],
|
||||||
//材料选项
|
//材料选项
|
||||||
|
|
@ -543,6 +595,16 @@ export default {
|
||||||
// 重置监理单位字段的值,确保不触发错误提示
|
// 重置监理单位字段的值,确保不触发错误提示
|
||||||
this.formData.supervisorUnit = ''
|
this.formData.supervisorUnit = ''
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
'formData.supervisorUnitId'(newVal) {
|
||||||
|
this.formData.jlId=newVal;
|
||||||
|
this.formData.supervisorUnitUserId='';
|
||||||
|
this.formData.supervisorUnitUser='';
|
||||||
|
this.supervisorUnitOptions=[];
|
||||||
|
|
||||||
|
this.getSupervisionUnit(newVal)
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
open: {
|
open: {
|
||||||
handler(newVal, oldVal) {
|
handler(newVal, oldVal) {
|
||||||
|
|
@ -563,7 +625,8 @@ export default {
|
||||||
this.getCons()
|
this.getCons()
|
||||||
this.getMaterial()
|
this.getMaterial()
|
||||||
this.getProLeaderOption()
|
this.getProLeaderOption()
|
||||||
this.getSupervisionUnit()
|
|
||||||
|
this.selectSupervisionUnitUser()
|
||||||
if (proId !== '0') {
|
if (proId !== '0') {
|
||||||
this.getData(proId)
|
this.getData(proId)
|
||||||
}
|
}
|
||||||
|
|
@ -683,14 +746,24 @@ export default {
|
||||||
this.materialOptions = response.data
|
this.materialOptions = response.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//获取监理单位选项
|
//获取监理单位人员
|
||||||
getSupervisionUnit() {
|
getSupervisionUnit(key) {
|
||||||
const params = {}
|
const params = {
|
||||||
|
'key':key
|
||||||
|
}
|
||||||
selectSupervisionUnit(params).then(response => {
|
selectSupervisionUnit(params).then(response => {
|
||||||
console.log(response)
|
console.log(response)
|
||||||
this.supervisorUnitOptions = response.data
|
this.supervisorUnitOptions = response.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
//获取监理单位
|
||||||
|
selectSupervisionUnitUser() {
|
||||||
|
const params = {}
|
||||||
|
selectSupervisionUnitUser(params).then(response => {
|
||||||
|
console.log(response)
|
||||||
|
this.supervisorUnitUserOptions = response.data
|
||||||
|
})
|
||||||
|
},
|
||||||
//提交工程表单
|
//提交工程表单
|
||||||
async submitForm() {
|
async submitForm() {
|
||||||
this.$refs['elForm'].validate(async valid => {
|
this.$refs['elForm'].validate(async valid => {
|
||||||
|
|
@ -810,6 +883,8 @@ export default {
|
||||||
// 如果单位名称已存在,可以做出相应的提示或处理
|
// 如果单位名称已存在,可以做出相应的提示或处理
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
console.log(this.formData)
|
||||||
|
this.unitForm.jlId=this.formData.jlId;
|
||||||
// TODO 提交表单
|
// TODO 提交表单
|
||||||
addSupervisoryUnit(this.unitForm).then(response => {
|
addSupervisoryUnit(this.unitForm).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
|
|
@ -831,6 +906,40 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//提交监理表单
|
||||||
|
async submitUnitUserForm() {
|
||||||
|
this.$refs['unitForm'].validate(async valid => {
|
||||||
|
if (!valid) {
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
// 前端验证通过,再进行唯一性检查
|
||||||
|
const isExist = await this.checkIsExistUnitName()
|
||||||
|
if (isExist === false) {
|
||||||
|
// 如果单位名称已存在,可以做出相应的提示或处理
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// TODO 提交表单
|
||||||
|
addSupervisoryUnitUser(this.unitForm).then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.$message({
|
||||||
|
message: '新建成功',
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
this.selectSupervisionUnitUser()
|
||||||
|
this.formData.supervisorUnit = this.unitForm.unitName
|
||||||
|
this.unitResetForm()
|
||||||
|
this.supervisorFormOpen = false
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
message: response.msg,
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
//提交承包商表单
|
//提交承包商表单
|
||||||
async submitConsForm() {
|
async submitConsForm() {
|
||||||
this.$refs['consForm'].validate(async valid => {
|
this.$refs['consForm'].validate(async valid => {
|
||||||
|
|
@ -881,6 +990,7 @@ export default {
|
||||||
unitResetForm() {
|
unitResetForm() {
|
||||||
this.unitForm = {
|
this.unitForm = {
|
||||||
unitName: undefined,
|
unitName: undefined,
|
||||||
|
jlId:undefined,
|
||||||
unitAddress: undefined,
|
unitAddress: undefined,
|
||||||
corporateName: undefined,
|
corporateName: undefined,
|
||||||
corporatePhone: undefined,
|
corporatePhone: undefined,
|
||||||
|
|
@ -906,6 +1016,10 @@ export default {
|
||||||
this.unitResetForm()
|
this.unitResetForm()
|
||||||
this.supervisorFormOpen = false
|
this.supervisorFormOpen = false
|
||||||
},
|
},
|
||||||
|
unitUserCancel() {
|
||||||
|
this.unitResetForm()
|
||||||
|
this.supervisorUserFormOpen = false
|
||||||
|
},
|
||||||
//承包商单位表单重置
|
//承包商单位表单重置
|
||||||
consCancel() {
|
consCancel() {
|
||||||
this.consResetForm()
|
this.consResetForm()
|
||||||
|
|
@ -916,6 +1030,11 @@ export default {
|
||||||
this.unitResetForm()
|
this.unitResetForm()
|
||||||
this.supervisorFormOpen = true
|
this.supervisorFormOpen = true
|
||||||
},
|
},
|
||||||
|
createUnitUser() {
|
||||||
|
//创建监理单位
|
||||||
|
this.unitResetForm()
|
||||||
|
this.supervisorUserFormOpen = true
|
||||||
|
},
|
||||||
addCons() {
|
addCons() {
|
||||||
//创建监理单位
|
//创建监理单位
|
||||||
this.consResetForm()
|
this.consResetForm()
|
||||||
|
|
@ -991,12 +1110,21 @@ export default {
|
||||||
},
|
},
|
||||||
//更改监理单位名称值
|
//更改监理单位名称值
|
||||||
changeSupervisorUnit() {
|
changeSupervisorUnit() {
|
||||||
this.supervisorUnitOptions.forEach(item => {
|
this.supervisorUnitUserOptions.forEach(item => {
|
||||||
if (item.value === this.formData.supervisorUnitId) {
|
if (item.value === this.formData.supervisorUnitId) {
|
||||||
this.formData.supervisorUnit = item.label
|
this.formData.supervisorUnit = item.label
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
//更改监理单位名称值
|
||||||
|
changeSupervisorUnitUser() {
|
||||||
|
this.supervisorUnitOptions.forEach(item => {
|
||||||
|
if (item.value === this.formData.supervisorUnitUserId) {
|
||||||
|
this.formData.supervisorUnitUser = item.label
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
//更改承包商名称值
|
//更改承包商名称值
|
||||||
changeCons(e, index) {
|
changeCons(e, index) {
|
||||||
if (e === undefined || e === '') {
|
if (e === undefined || e === '') {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue