Commit 5d76244e authored by wangxl's avatar wangxl

2222

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