工程添加总监人员

This commit is contained in:
haozq 2025-02-10 15:46:49 +08:00
parent 20c048c2dd
commit 20a349e47b
3 changed files with 164 additions and 10 deletions

View File

@ -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

View File

@ -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

View File

@ -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 === '') {