Commit cb8e2abf authored by wangxl's avatar wangxl

33333

parent 218a2be2
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="app-content" style="height: 50vh;overflow: auto;"> <div class="app-content" style="height: 50vh;overflow: auto;">
<a-spin :spinning="loading" style="width: 100%;height: 100%;"> <a-spin :spinning="loading" style="width: 100%;height: 100%;">
<div class="page-content"> <div class="page-content">
<a-form-model ref="form" :model="formData" :rules="rules" style="border-top: 0px" class="from-table font-line-space"> <a-form-model ref="form" :model="memObject" :rules="rules" style="border-top: 0px" class="from-table font-line-space">
<a-row type="flex"> <a-row type="flex">
<a-col :span="4" class="bg-gray"> <a-col :span="4" class="bg-gray">
<div class="special-middle"> <div class="special-middle">
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</a-col> </a-col>
<a-col :span="20"> <a-col :span="20">
<a-form-model-item prop="name"> <a-form-model-item prop="name">
<a-input v-model="formData.name" :maxLength="20" placeholder="姓名" style="width: 40%" /> <a-input v-model="memObject.name" :maxLength="20" placeholder="姓名" style="width: 40%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-model-item prop="certificateType"> <a-form-model-item prop="certificateType">
<para-select v-model="formData.certificateType" :typeId="49" :width="120" @changeTitle="(e)=>{ formData.certificateTypeName = e}" /> <para-select v-model="memObject.certificateType" :typeId="49" :width="120" @changeTitle="(e)=>{ memObject.certificateTypeName = e}" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="4" class="bg-gray"> <a-col :span="4" class="bg-gray">
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-model-item prop="certId"> <a-form-model-item prop="certId">
<a-input v-model="formData.certId" :maxLength="20" placeholder="证件号" style="width: 60%" /> <a-input v-model="memObject.certId" :maxLength="20" placeholder="证件号" style="width: 60%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-model-item prop="sex"> <a-form-model-item prop="sex">
<base-select v-model="formData.sex" :type="16" :isAll="true" :width="120" /> <base-select v-model="memObject.sex" :type="16" :isAll="true" :width="120" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="4" class="bg-gray"> <a-col :span="4" class="bg-gray">
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-model-item prop="birthday"> <a-form-model-item prop="birthday">
<a-date-picker format="YYYY-MM-DD" valueFormat="YYYY-MM-DD HH:mm:ss" v-model="formData.birthday" style="width: 60%" /> <a-date-picker format="YYYY-MM-DD" valueFormat="YYYY-MM-DD HH:mm:ss" v-model="memObject.birthday" style="width: 60%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-model-item prop="nation"> <a-form-model-item prop="nation">
<para-select v-model="formData.nation" :typeId="11" :width="120" @changeTitle="(e)=>{ formData.nationName = e}" /> <para-select v-model="memObject.nation" :typeId="11" :width="120" @changeTitle="(e)=>{ memObject.nationName = e}" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="4" class="bg-gray"> <a-col :span="4" class="bg-gray">
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-model-item prop="country"> <a-form-model-item prop="country">
<a-input v-model="formData.country" :maxLength="50" placeholder="国别或地区" style="width: 60%" /> <a-input v-model="memObject.country" :maxLength="50" placeholder="国别或地区" style="width: 60%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-model-item prop="workUnit"> <a-form-model-item prop="workUnit">
<a-input v-model="formData.workUnit" :maxLength="50" placeholder="工作单位" style="width: 60%" /> <a-input v-model="memObject.workUnit" :maxLength="50" placeholder="工作单位" style="width: 60%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="4" class="bg-gray"> <a-col :span="4" class="bg-gray">
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-model-item prop="degree"> <a-form-model-item prop="degree">
<para-select v-model="formData.degree" :typeId="9" :width="120" @changeTitle="(e)=>{ formData.degreeName = e}" /> <para-select v-model="memObject.degree" :typeId="9" :width="120" @changeTitle="(e)=>{ memObject.degreeName = e}" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
</a-col> </a-col>
<a-col :span="20"> <a-col :span="20">
<a-form-model-item prop="spec"> <a-form-model-item prop="spec">
<para-multi-select v-model="formData.spec" :typeId="42" :width="120" @changeTitle="(e)=>{ formData.specName = e}" /> <para-multi-select v-model="memObject.spec" :typeId="42" :width="120" @changeTitle="(e)=>{ memObject.specName = e}" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
</a-col> </a-col>
<a-col :span="20"> <a-col :span="20">
<a-form-model-item prop="title"> <a-form-model-item prop="title">
<para-multi-select v-model="formData.title" :typeId="7" :width="120" @changeTitle="(e)=>{ formData.titleName = e}" /> <para-multi-select v-model="memObject.title" :typeId="7" :width="120" @changeTitle="(e)=>{ memObject.titleName = e}" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-model-item prop="email"> <a-form-model-item prop="email">
<a-input v-model="formData.email" :maxLength="50" placeholder="电子邮箱" style="width: 60%" /> <a-input v-model="memObject.email" :maxLength="50" placeholder="电子邮箱" style="width: 60%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="4" class="bg-gray"> <a-col :span="4" class="bg-gray">
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-model-item prop="mobile"> <a-form-model-item prop="mobile">
<a-input v-model="formData.mobile" :maxLength="20" placeholder="手机" style="width: 60%" /> <a-input v-model="memObject.mobile" :maxLength="20" placeholder="手机" style="width: 60%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
</a-col> </a-col>
<a-col :span="20"> <a-col :span="20">
<a-form-model-item prop="telephone"> <a-form-model-item prop="telephone">
<a-input v-model="formData.telephone" :maxLength="20" placeholder="电话号码" style="width: 60%" /> <a-input v-model="memObject.telephone" :maxLength="20" placeholder="电话号码" style="width: 60%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
</a-col> </a-col>
<a-col :span="20"> <a-col :span="20">
<a-form-model-item prop="fax"> <a-form-model-item prop="fax">
<a-input v-model="formData.fax" :maxLength="20" placeholder="传真" style="width: 60%" /> <a-input v-model="memObject.fax" :maxLength="20" placeholder="传真" style="width: 60%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> --> </a-row> -->
...@@ -183,7 +183,7 @@ ...@@ -183,7 +183,7 @@
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-model-item prop="projWork"> <a-form-model-item prop="projWork">
<a-input v-model="formData.projWork" :maxLength="20" placeholder="项目分工" style="width: 60%" /> <a-input v-model="memObject.projWork" :maxLength="20" placeholder="项目分工" style="width: 60%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="4" class="bg-gray"> <a-col :span="4" class="bg-gray">
...@@ -193,7 +193,7 @@ ...@@ -193,7 +193,7 @@
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-model-item prop="forMonths"> <a-form-model-item prop="forMonths">
<a-input-number v-model="formData.forMonths" :min="0" :step="0.1" style="width: 60%" /> <a-input-number v-model="memObject.forMonths" :min="0" :step="0.1" style="width: 60%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -249,7 +249,7 @@ export default { ...@@ -249,7 +249,7 @@ export default {
return [] return []
} }
}, },
formData: { memObject: {
type: Object, type: Object,
default: () => { default: () => {
return {} return {}
...@@ -261,18 +261,15 @@ export default { ...@@ -261,18 +261,15 @@ export default {
}, },
methods: { methods: {
submit () { submit () {
this.formData._key = Math.random().toString(16).substring(2, 8) this.memObject._key = Math.random().toString(16).substring(2, 8)
this.$emit('close', this.formData) this.$refs.form.validate(valid => {
// this.$refs.form.validate(valid => { if (valid) {
// if (valid) { this.$emit('close', this.memObject)
// this.members.push(this.formData) } else {
// this.$emit('close', 'value') this.$message.error('项目信息未填写完全!')
// console.log(this.members) return false
// } else { }
// this.$message.error('项目信息未填写完全!') })
// return false
// }
// })
}, },
}, },
} }
......
...@@ -240,6 +240,7 @@ ...@@ -240,6 +240,7 @@
<a-popconfirm title="确定要删除吗?" ok-text="确定" cancel-text="取消" @confirm="removeMembers(item)"> <a-popconfirm title="确定要删除吗?" ok-text="确定" cancel-text="取消" @confirm="removeMembers(item)">
<a-button type="link" size="small">删除</a-button> <a-button type="link" size="small">删除</a-button>
</a-popconfirm> </a-popconfirm>
<a-button type="link" size="small" @click="editMember(item,index)">修改</a-button>
</div> </div>
</div> </div>
</a-col> </a-col>
...@@ -247,7 +248,7 @@ ...@@ -247,7 +248,7 @@
</div> </div>
<a-modal v-model="visibleEdit" v-if="visibleEdit" title="项目组成员(添加/修改)" width="60%" :footer="null" :dialog-style="{ top: '20%' }" destroyOnClose :maskClosable="false"> <a-modal v-model="visibleEdit" v-if="visibleEdit" title="项目组成员(添加/修改)" width="60%" :footer="null" :dialog-style="{ top: '20%' }" destroyOnClose :maskClosable="false">
<member-edit :formData.sync="memObject" @close="closeWindow" /> <member-edit :memObject.sync="memObject" @close="closeWindow" />
</a-modal> </a-modal>
</div> </div>
</template> </template>
...@@ -287,6 +288,8 @@ export default { ...@@ -287,6 +288,8 @@ export default {
data () { data () {
return { return {
memObject: {}, memObject: {},
isEdit: false,
memIndex: 0,
visibleEdit: false, visibleEdit: false,
} }
}, },
...@@ -305,10 +308,23 @@ export default { ...@@ -305,10 +308,23 @@ export default {
}, },
methods: { methods: {
closeWindow (value) { closeWindow (value) {
this.memObject = {} if (!this.isEdit) {
this.visibleEdit = false this.memObject = {}
this.dataList.push(value) this.dataList.push(value)
console.log(this.dataList) this.visibleEdit = false
} else {
this.dataList.splice(this.memIndex, 1, value);
this.memObject = {}
this.memIndex = 0
this.isEdit = false
this.visibleEdit = false
}
},
editMember (obj, index) {
this.memObject = obj
this.isEdit = true
this.memIndex = index
this.visibleEdit = true
}, },
addMember () {//添加成员 addMember () {//添加成员
this.memObject = { ...Member } this.memObject = { ...Member }
...@@ -339,5 +355,4 @@ export default { ...@@ -339,5 +355,4 @@ export default {
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment