Commit 5d76244e authored by wangxl's avatar wangxl

2222

parent b56e34b2
......@@ -210,6 +210,11 @@ export default {
},
selectChange (value) {
this.$emit("input", value);
var newArr = this.selectArray.filter(x => x.key == value);
if (value && !!newArr && newArr.length > 0) {
var text = !!value ? newArr[0].title : ''
this.$emit('changeTitle', text)
}
this.$emit("change");
},
loadValue () {
......
......@@ -117,6 +117,11 @@ export default {
},
childChange (value) {
this.$emit("input", value);
var newArr = this.childArray.filter(x => x.key == value);
if (!!newArr && newArr.length > 0) {
var text = !!value ? newArr[0].title : ''
this.$emit('changeTitle', text)
}
this.$emit("change");
}
},
......
......@@ -53,7 +53,7 @@ export default {
},
methods: {
loadSelected () {
let pars = { typeId: this.typeId}
let pars = { typeId: this.typeId }
this.$api.parameter.getParameterList(pars).then(({ data = { data } }) => {
if (data) {
this.selectArray = data.data
......@@ -69,6 +69,11 @@ export default {
},
paraChange (value) {
this.$emit("input", value);
var newArr = this.selectArray.filter(x => x.key == value);
if (!!newArr && newArr.length > 0) {
var text = !!value ? newArr[0].title : ''
this.$emit('changeTitle', text)
}
this.$emit("change");
}
},
......
......@@ -87,6 +87,7 @@
</div>
<div style="display: inline-block;;width:50%;text-align: right;">
<a-button type="primary" @click="projectKPI" icon="download">绩效指标表</a-button>
<!-- <a-button type="primary" @click="createMember">新建项目组成员</a-button> -->
<a-button type="primary" style="margin-right:8px;" v-if="(display && isButten)" @click="createProject">新建项目</a-button>
<a-button type="primary" @click="exportData" icon="download">Excel</a-button>
</div>
......@@ -321,7 +322,7 @@ export default {
});
},
createProject () {
this.visibleEdit = true
this.id = null
this.visibleEdit = true
//this.$store.commit('app/addCard', { title: '项目创建', key: '1299', code: 'projectCreate', keepAlive: 1, router: '/project/create', closable: true })
},
......
......@@ -24,7 +24,7 @@
</a-col>
<a-col :span="8">
<a-form-model-item prop="certificateType">
<para-select v-model="formData.certificateType" :typeId="49" :width="120" />
<para-select v-model="formData.certificateType" :typeId="49" :width="120" @changeTitle="(e)=>{ formData.certificateTypeName = e}" />
</a-form-model-item>
</a-col>
<a-col :span="4" class="bg-gray">
......@@ -69,7 +69,7 @@
</a-col>
<a-col :span="8">
<a-form-model-item prop="nation">
<para-select v-model="formData.nation" :typeId="11" :width="120" />
<para-select v-model="formData.nation" :typeId="11" :width="120" @changeTitle="(e)=>{ formData.nationName = e}" />
</a-form-model-item>
</a-col>
<a-col :span="4" class="bg-gray">
......@@ -101,7 +101,7 @@
</a-col>
<a-col :span="8">
<a-form-model-item prop="degree">
<para-select v-model="formData.degree" :typeId="9" :width="120" />
<para-select v-model="formData.degree" :typeId="9" :width="120" @changeTitle="(e)=>{ formData.degreeName = e}" />
</a-form-model-item>
</a-col>
</a-row>
......@@ -111,9 +111,9 @@
<div class="required">从事专业</div>
</div>
</a-col>
<a-col :span="8">
<a-col :span="20">
<a-form-model-item prop="spec">
<para-multi-select v-model="formData.spec" :typeId="42" :width="120" />
<para-multi-select v-model="formData.spec" :typeId="42" :width="120" @changeTitle="(e)=>{ formData.specName = e}" />
</a-form-model-item>
</a-col>
</a-row>
......@@ -123,9 +123,9 @@
<div class="required">职称</div>
</div>
</a-col>
<a-col :span="8">
<a-col :span="20">
<a-form-model-item prop="title">
<para-multi-select v-model="formData.title" :typeId="7" :width="120" />
<para-multi-select v-model="formData.title" :typeId="7" :width="120" @changeTitle="(e)=>{ formData.titleName = e}" />
</a-form-model-item>
</a-col>
</a-row>
......@@ -220,25 +220,6 @@ export default {
},
data () {
return {
formData1: {
name: null,
sex: null,
birthday: null,
certificateType: null,
certId: null,
nation: null,
country: null,
workUnit: null,
title: null,
degree: null,
email: null,
mobile: null,
telephone: null,
fax: null,
projWork: null,
forMonths: null,
spec: null
},
rules: {
name: [{ required: true, message: '*', trigger: 'blur' },],
sex: [{ required: true, message: '*', trigger: 'change' },],
......@@ -280,14 +261,18 @@ export default {
},
methods: {
submit () {
this.$refs.form.validate(valid => {
if (valid) {
this.$emit('close', 'value')
} else {
this.$message.error('项目信息未填写完全!')
return false
}
})
this.formData._key = Math.random().toString(16).substring(2, 8)
this.$emit('close', this.formData)
// this.$refs.form.validate(valid => {
// if (valid) {
// this.members.push(this.formData)
// this.$emit('close', 'value')
// console.log(this.members)
// } else {
// this.$message.error('项目信息未填写完全!')
// return false
// }
// })
},
},
}
......
......@@ -476,7 +476,7 @@
<cooperative-units :cooperativeUnits.sync="formData.cooperativeUnits" />
<!-- 项目组成员 -->
<project-member-edit :members.sync="formData.members" />
<project-member-edit :dataList.sync="formData.members" />
<a-row>
<a-col :span="24" style="border-top: 0px">
......@@ -800,6 +800,7 @@ export default {
}
},
save () {
console.log(this.formData)
if (this.checkProjName()) {
this.$emit('load', true)
let pars = isEmptyParams(this.formData)
......
......@@ -104,7 +104,8 @@
</div>
</a-col>
</a-row>
<a-row v-for="(member, index) in members" :key="index" type="flex" class="row_center">
<div>
<a-row v-for="(item, index) in dataList" :key="'memberEdit'+index" type="flex" class="row_center">
<a-col :span="1">
<div class="special-middle">
<div>
......@@ -115,119 +116,119 @@
<a-col :span="1">
<div class="special-middle">
<div>
{{ member.name }}
{{ item.name }}
</div>
</div>
</a-col>
<a-col :span="1">
<div class="special-middle">
<div>
{{ member.sex }}
{{ item.sex }}
</div>
</div>
</a-col>
<a-col :span="1">
<div class="special-middle">
<div>
{{ member.birthday }}
{{ item.birthday }}
</div>
</div>
</a-col>
<a-col :span="1">
<div class="special-middle">
<div>
{{ member.certificateTypeName }}
{{ item.certificateTypeName }}
</div>
</div>
</a-col>
<a-col :span="2">
<div class="special-middle">
<div>
{{ member.certId }}
{{ item.certId }}
</div>
</div>
</a-col>
<a-col :span="1">
<div class="special-middle">
<div>
{{ member.nation }}
{{ item.nationName }}
</div>
</div>
</a-col>
<a-col :span="2">
<div class="special-middle">
<div>
{{ member.country }}
{{ item.country }}
</div>
</div>
</a-col>
<a-col :span="2">
<div class="special-middle">
<div>
{{ member.workUnit }}
{{ item.workUnit }}
</div>
</div>
</a-col>
<a-col :span="1">
<div class="special-middle">
<div>
{{ member.titleName }}
{{ item.titleName }}
</div>
</div>
</a-col>
<a-col :span="1">
<div class="special-middle">
<div>
{{ member.degreeName }}
{{ item.degreeName }}
</div>
</div>
</a-col>
<a-col :span="1">
<div class="special-middle">
<div>
{{ member.email }}
{{ item.email }}
</div>
</div>
</a-col>
<a-col :span="1">
<div class="special-middle">
<div>
{{ member.mobile }}
{{ item.mobile }}
</div>
</div>
</a-col>
<!-- <a-col :span="1">
<div class="special-middle">
<div>
{{ member.telephone }}
{{ item.telephone }}
</div>
</div>
</a-col>
<a-col :span="1">
<div class="special-middle">
<div>
{{ member.fax }}
{{ item.fax }}
</div>
</div>
</a-col> -->
<a-col :span="2">
<div class="special-middle">
<div>
{{ member.projWork }}
{{ item.projWork }}
</div>
</div>
</a-col>
<a-col :span="2">
<div class="special-middle">
<div>
{{ member.forMonths }}
{{ item.forMonths }}
</div>
</div>
</a-col>
<a-col :span="2">
<div class="special-middle">
<div>
{{ member.specName }}
{{ item.specName }}
</div>
</div>
</a-col>
......@@ -235,16 +236,18 @@
<div class="special-middle">
<div>
<a-button icon="arrow-up" type="primary" shape="circle" size="small" :disabled="index == 0" @click="memberUp(index)"></a-button>
<a-button icon="arrow-down" type="primary" shape="circle" size="small" style="margin-left:5px;" :disabled="members.length == index + 1" @click="menberDown(index)"></a-button>
<a-popconfirm title="确定要删除吗?" ok-text="确定" cancel-text="取消" @confirm="removeMembers(member)">
<a-button icon="arrow-down" type="primary" shape="circle" size="small" style="margin-left:5px;" :disabled="dataList.length == index + 1" @click="menberDown(index)"></a-button>
<a-popconfirm title="确定要删除吗?" ok-text="确定" cancel-text="取消" @confirm="removeMembers(item)">
<a-button type="link" size="small">删除</a-button>
</a-popconfirm>
</div>
</div>
</a-col>
</a-row>
</div>
<a-modal v-model="visibleEdit" v-if="visibleEdit" title="项目组成员(添加/修改)" width="60%" :footer="null" :dialog-style="{ top: '20%' }" destroyOnClose :maskClosable="false">
<member-edit :members.sync="members" :formData.sync="memObject" @close="closeWindow" />
<member-edit :formData.sync="memObject" @close="closeWindow" />
</a-modal>
</div>
</template>
......@@ -254,21 +257,44 @@
import memberEdit from '@/views/report/project/components/memberEdit'
const Member = { name: null, sex: null, birthday: null, certificateType: null, certId: null, nation: null, country: null, workUnit: null, title: null, degree: null, email: null, mobile: null, telephone: null, fax: null, projWork: null, forMonths: null, spec: null }
const Member = {
name: null,
sex: null,
birthday: null,
certificateType: null,
certificateTypeName: null,
certId: null,
nation: null,
nationName: null,
country: null,
workUnit: null,
title: null,
titleName: null,
degree: null,
degreeName: null,
email: null,
mobile: null,
telephone: null,
fax: null,
projWork: null,
forMonths: null,
spec: null,
specName: null
}
export default {
name: 'projectMemberEdit',
data () {
return {
memObject: {},
visibleEdit: false
visibleEdit: false,
}
},
props: {
members: {
dataList: {
type: Array,
default: () => {
return [{ ...Member }]
return []
}
},
},
......@@ -276,43 +302,48 @@ export default {
memberEdit
},
created () {
console.log(this.dataList)
},
methods: {
closeWindow (value) {
this.memObject = {}
this.visibleEdit = false
this.dataList.push(value)
// this.addArrey(value)
console.log(this.dataList)
},
addMember () {//添加成员
this.memObject = { ...Member }
this.visibleEdit = true
},
addArrey (value) {//添加成员
this.dataList.push(value)
},
removeMembers (item) {//移除成员
let index = this.members.indexOf(item)
let index = this.dataList.indexOf(item)
if (index !== -1) {
this.members.splice(index, 1)
this.dataList.splice(index, 1)
}
},
memberToTop (item) {//成员置顶
let index = this.members.indexOf(item)
let index = this.dataList.indexOf(item)
if (index !== -1) {
this.members.splice(index, 1)
this.members.unshift({ ...item })
this.dataList.splice(index, 1)
this.dataList.unshift({ ...item })
}
},
memberUp (index) {
let arr = this.members
let arr = this.dataList
arr.splice(index - 1, 1, ...arr.splice(index, 1, arr[index - 1]))
},
menberDown (index) {
let arr = this.members
let arr = this.dataList
arr.splice(index, 1, ...arr.splice(index + 1, 1, arr[index]))
}
}
}
</script>
<style scoped lang="less">
::v-deep .table_list {
.ant-col {
padding: 0px 0px;
......
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