<template>
|
<div id="accessMsg">
|
<el-dialog
|
style="font-weight:bold"
|
title="项目准入信息"
|
:visible.sync="show"
|
:close-on-click-modal="false"
|
center
|
width="460px"
|
>
|
<el-form
|
id="msgForm"
|
:model="form"
|
ref="form"
|
size="mini"
|
:rules="rules"
|
label-position="right"
|
>
|
<!-- <el-form-item label="项目类型" prop="projectType">
|
<el-select
|
popper-class="projectType"
|
v-model="form.projectType"
|
filterable
|
placeholder="请选择"
|
>
|
<el-option
|
v-for="item in options"
|
:key="item.value"
|
:label="item.valueDesc"
|
:value="item.value"
|
></el-option>
|
</el-select>
|
</el-form-item> -->
|
<el-form-item label="项目类型" prop="projectFrom">
|
<el-select
|
popper-class="projectFrom"
|
v-model="form.projectFrom"
|
filterable
|
placeholder="请选择"
|
>
|
<el-option
|
v-for="item in options"
|
:key="item.value"
|
:label="item.valueDesc"
|
:value="item.value"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
|
<el-form-item label="项目名称" v-if="showProjectname" prop="projectname">
|
<el-input v-model="form.projectname"></el-input>
|
</el-form-item>
|
</el-form>
|
<div slot="footer" class="dialog-footer">
|
<el-button class="blueBtn" type="primary" size="mini" @click="handleSubmit">确定</el-button>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import { saveProjectAdmit, projectQrycondition } from '@/api/area'
|
export default {
|
props: ['showDialog'],
|
data: function() {
|
return {
|
form: {
|
objectType: '',
|
projectFlag: '',
|
projectId: '',
|
projectcode: '',
|
projectname: '',
|
projecttype: ''
|
},
|
options: [],
|
rules: {
|
projectType: [
|
{ required: true, message: '请选择项目类型', trigger: 'blur' }
|
],
|
projectname: [
|
{ required: true, message: '请输入项目名称', trigger: 'blur' }
|
]
|
},
|
showProjectname: false
|
}
|
},
|
computed: {
|
show: {
|
get() {
|
return this.showDialog
|
},
|
set() {
|
this.$refs['form'].resetFields()
|
this.$emit('update:showDialog', false)
|
}
|
}
|
},
|
watch: {
|
'form.projectType': function(newVal) {
|
this.showProjectname = Boolean(newVal === '2' || newVal === '3')
|
}
|
},
|
created() {
|
this.initSelect()
|
},
|
methods: {
|
async initSelect() {
|
this.$set(this.form, "projectType", '2')
|
const { result } = await projectQrycondition({ conditionName: 'ProjectFrom' })
|
this.options = [...result]
|
this.$set( this.form, "projectFrom",'1')
|
},
|
handleSubmit() {
|
this.$refs['form'].validate(valid => {
|
const { form } = this
|
const { projectType, projectname, projectFrom } = form
|
if (valid) {
|
if (projectType === '2' || projectType === '3') {
|
let params = {
|
projectFlag: '0',
|
projecttype: projectType,
|
projectFrom,
|
projectname
|
}
|
saveProjectAdmit(params).then(res => {
|
if (res.code === '00') {
|
let detailsParams = {
|
dataType: res.result.dataType,
|
objectNo: res.result.serialno,
|
objectType: res.result.objectType,
|
projectFlag: res.result.projectFlag,
|
projectType: res.result.projectType,
|
opertion: '01'
|
}
|
this.$store.commit('SET_detailsParams', detailsParams)
|
if (projectType === '2') {
|
this.$router.push({
|
path: '/area/projectManagement/add/projectBasicInformation'
|
})
|
} else {
|
this.$router.push({
|
path:
|
'/area/projectManagement/add/developerProjectInformation'
|
})
|
}
|
}
|
})
|
} else {
|
this.projectFlag = 0
|
this.$emit('showSelfDialog', this.projectFlag)
|
}
|
} else {
|
return false
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<style lang="stylus" scoped>
|
#accessMsg {
|
>>>.el-dialog {
|
.el-dialog__header {
|
padding-top: 40px;
|
|
>>>.el-dialog__title {
|
font-size: 18px;
|
// font-family PingFangSC-Medium,PingFangSC
|
font-weight: bold;
|
}
|
}
|
}
|
}
|
|
color #222222 {
|
line-height: 25px;
|
}
|
|
.el-dialog__body {
|
padding: 20px 25px 10px;
|
|
#msgForm {
|
>>> .el-form-item {
|
margin-bottom: 10px;
|
|
.el-form-item__label {
|
width: 150px;
|
color: #888888;
|
font-size: 14px;
|
// font-family PingFangSC-Regular,PingFangSC
|
font-weight: 200;
|
padding-right: 10px;
|
}
|
}
|
}
|
}
|
|
.el-dialog__footer {
|
padding-bottom: 30px;
|
padding-top: 30px;
|
}
|
|
.dialog-footer {
|
.blueBtn {
|
background-color: rgba(0, 129, 240, 1);
|
border-radius: 4px;
|
color: rgba(255, 255, 255, 1);
|
padding: 0;
|
width: 120px;
|
height: 30px;
|
|
span {
|
font-size: 14px;
|
height: 20px;
|
font-weight: 400;
|
line-height: 20px;
|
}
|
}
|
}
|
</style>
|