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