Commit 91cf8f7c authored by wangxl's avatar wangxl

9999

parent d379340e
......@@ -450,9 +450,6 @@ export default {
projectImport (params) {
return fetch('/v1/science-admin/com-project/projectImport', params, 'post', 'json')
},
getProjectBasicInfoById (params) {
return fetch(`/v1/science-admin/com-project/getProjectBasicInfoById/`, params)
},
},
conclusion: {
getConclusionByProjId (params) {
......@@ -497,12 +494,12 @@ export default {
return fetch(`/v1/science-admin/com-conclusion-thesis/getListByPage`, params)
},
},
taskReport: {
task: {
getListByPage (params) {
return fetch(`/v1/science-admin/com-project-task/getListByPage`, params)
},
getTestInfoByProjId (params) {
return fetch('/v1/science-admin/com-project-task/getTestInfoByProjId', params)
getTaskByProjId (params) {
return fetch('/v1/science-admin/com-project-task/getTaskByProjId', params)
},
save (params) {
return fetch('/v1/science-admin/com-project-task/save', params, 'post', 'json')
......@@ -513,12 +510,6 @@ export default {
getCount (params) {
return fetch(`/v1/science-admin/com-project-task/getCount`, params)
},
asyncUploadTaskFile (params) {
return fetch(`/v1/science-admin/com-project-task/asyncUploadTaskFile`, params, 'post', 'file')
},
deleteTaskFile (params) {
return fetch(`/v1/science-admin/com-project-task/deleteTaskFile/${params.id}`, params, 'delete', 'json')
},
},
checkReport: {
getListByPage (params) {
......
......@@ -116,7 +116,7 @@ export default {
methods: {
getTestInfoByProjId () {
let pars = { projId: this.projId }
this.$api.taskReport.getTestInfoByProjId(pars).then(({ data = {} }) => {
this.$api.task.getTestInfoByProjId(pars).then(({ data = {} }) => {
if (data) {
this.testInfo = data
}
......
......@@ -81,7 +81,7 @@ export default {
this.loading = true
let pars = isEmptyParams(this.searchForm)
let par = { ...pars, pageIndex: this.pagination.pageIndex, pageSize: this.pagination.pageSize }
this.$api.taskReport.getListByPage(par).then(({ data = {} }) => {
this.$api.task.getListByPage(par).then(({ data = {} }) => {
if (data) {
const { dataList = [], total = 0 } = data
this.tableData = dataList
......
......@@ -109,7 +109,7 @@ export default {
this.loading = true
let pars = isEmptyParams(this.searchForm)
let par = { ...pars, pageIndex: this.pagination.pageIndex, pageSize: this.pagination.pageSize }
this.$api.taskReport.getListByPage(par).then(({ data = {} }) => {
this.$api.task.getListByPage(par).then(({ data = {} }) => {
if (data) {
const { dataList = [], total = 0 } = data
this.tableData = dataList
......@@ -122,7 +122,7 @@ export default {
},
getCount () {
let pars = isEmptyParams({ reportYear: this.searchForm.reportYear });
this.$api.taskReport.getCount(pars).then(({ data = {} }) => {
this.$api.task.getCount(pars).then(({ data = {} }) => {
if (data) {
this.itemCount = [data.count1, data.count2, data.count3, data.count4, data.count5]
}
......@@ -161,7 +161,7 @@ export default {
this.visibleEdit = true
} else {
let par = { auditObjectId: record.id, auditType: 2 }
this.$api.taskReport.report(par).then(({ data = {} }) => {
this.$api.task.report(par).then(({ data = {} }) => {
if (data) {
this.$message.success('上报成功!')
this.getListByPage()
......
......@@ -2,47 +2,27 @@
<template>
<div class="app-content" style="height: 76vh;overflow: auto;">
<a-spin :spinning="loading" style="width: 100%;height: 100%;">
<div class="page-steps">
<a-steps size="small" :current="current" @change="onChange">
<a-step :status="item.status" v-for="(item,index) in stepsArray" :key="index+'stepsArray'" :title="item.title" />
</a-steps>
</div>
<div class="page-content">
<task-edit v-model="value" @close="closeWindow" @load="onLoad" @onStepChange="onStepChange" :completeStatus.sync=completeStatus :stepsArray.sync="stepsArray" ref="projCreate" />
<task-edit v-model="value" @close="closeWindow" @load="onLoad" ref="taskCreate" />
</div>
<div class="page-footer">
<a-button v-if="currSteps > 0" style="margin-left: 40px" type="primary" @click="prev">上一步</a-button>
<a-button style="margin-left: 40px" type="primary" @click="save">保 存</a-button>
<a-button v-if="currSteps < stepsArray.length - 1" style="margin-left: 40px" type="primary" @click="next">下一步</a-button>
<a-button v-if="currSteps == stepsArray.length - 1" style="margin-left: 40px" type="primary" @click="submit">完成填写</a-button>
<a-button type="primary" @click="save">保 存</a-button>
<a-button type="primary" style="margin-left: 40px" @click="submit">完成填写</a-button>
</div>
</a-spin>
</div>
</template>
<script>
import { getType } from '@/views/utils/auth'
import taskEdit from "@/views/report/task/components/taskEdit"
export default {
name: "projectCreate",
name: "taskCreate",
components: {
taskEdit,
},
data () {
return {
loading: false,
projType: getType() == "1",
current: 10,
currSteps: 0,
stepsArray: [
{ status: "process", title: '基本信息', showStatus: true },
{ status: "wait", title: '项目组成员及单位', showStatus: false },
{ status: "wait", title: '经费预算及设备明细', showStatus: false },
{ status: "wait", title: '阶段目标及课题设置', showStatus: false },
{ status: "wait", title: '绩效指标', showStatus: false },
{ status: "wait", title: '附件', showStatus: false }
],
completeStatus: "0,0,0,0,0,0"
}
},
props: {
......@@ -56,62 +36,11 @@ export default {
created () {
},
methods: {
stepsChange (e) {
debugger
this.currSteps = e
this.changeSteps(this.currSteps)
},
next () {
this.$refs.projCreate.submit(this.currSteps, true)
},
prev () {
this.currSteps--;
this.changeSteps(this.currSteps)
},
onChange (e) {
if (e != this.currSteps) {
var arr = this.completeStatus.split(',')
if (arr[e] == "1") {
this.loading = true
this.changeSteps(e)
this.loading = false
} else {
this.$message.error('所选步骤没填写完成,请填写当前步骤后点【下一步】跳转!')
}
}
},
onStepChange (e) {
this.completeStatus = e.state
this.changeSteps(e.step)
},
changeSteps (e) {
this.currSteps = e
var clone = [].concat(this.stepsArray)
clone.forEach(e => {
e.showStatus = false
})
clone[e].showStatus = true;
this.stepsArray = clone
this.getCompleteStatus(e, this.completeStatus)
},
getCompleteStatus (step, completeStatus) {
var arr = completeStatus.split(',')
if (!!arr && arr.length > 0) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] == "1") {
this.stepsArray[i].status = "finish"
} else {
this.stepsArray[i].status = "wait"
}
}
this.stepsArray[step].status = "process"
}
},
save () {
this.$refs.projCreate.save(this.currSteps)
this.$refs.taskCreate.save()
},
submit () {
this.$refs.projCreate.submit(this.currSteps, false)
this.$refs.taskCreate.submit()
},
closeWindow (value) {
this.$emit('close', value)
......@@ -131,16 +60,9 @@ export default {
width: 8px;
height: 6px;
}
.page-steps {
width: 100%;
height: 40px;
padding: 8px 20px 5px 20px;
background: rgb(248, 248, 248);
border: 1px 1px 0px 1px solid #e8e8e8;
}
.page-content {
width: 100%;
height: calc(100% - 80px);
height: calc(100% - 40px);
overflow: auto;
}
.page-footer {
......
<template>
<div>
<a-form-model ref="form" :model="formData" :rules="rules" style="border-top: 0px" class="from-table font-line-space">
<div v-if="stepsArray[0].showStatus">
<a-row>
<a-col :span="24" style="border-top: 0px">
<div class="tb-title">
......@@ -10,12 +9,12 @@
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="4" class="bg-gray">
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div>单位名称</div>
</div>
</a-col>
<a-col :span="20">
<a-col :span="21">
<div class="special-middle">
<div>
<a-form-model-item>
......@@ -26,12 +25,12 @@
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="4" class="bg-gray">
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div>注册单位类型</div>
</div>
</a-col>
<a-col :span="8">
<a-col :span="9">
<div class="special-middle">
<div>
<a-form-model-item prop="unitType">
......@@ -40,12 +39,12 @@
</div>
</div>
</a-col>
<a-col :span="4" class="bg-gray">
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div class="required">组织机构代码/统一社会信用代码</div>
</div>
</a-col>
<a-col :span="8">
<a-col :span="9">
<div class="special-middle">
<div>
<a-form-model-item prop="organizationCode">
......@@ -56,12 +55,12 @@
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="4" class="bg-gray">
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div class="required">通讯地址</div>
</div>
</a-col>
<a-col :span="20">
<a-col :span="21">
<div class="special-middle">
<div>
<a-form-model-item prop="address">
......@@ -160,12 +159,12 @@
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="4" class="bg-gray">
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div class="required">开户银行</div>
</div>
</a-col>
<a-col :span="8">
<a-col :span="9">
<div class="special-middle">
<div>
<a-form-model-item prop="depositBank">
......@@ -174,12 +173,12 @@
</div>
</div>
</a-col>
<a-col :span="4" class="bg-gray">
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div class="required">银行账号</div>
</div>
</a-col>
<a-col :span="8">
<a-col :span="9">
<div class="special-middle">
<div>
<a-form-model-item prop="bankAccount">
......@@ -190,12 +189,12 @@
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="4" class="bg-gray">
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div class="required">开户银行地址</div>
</div>
</a-col>
<a-col :span="8">
<a-col :span="9">
<div class="special-middle">
<div>
<a-form-model-item prop="depositBankAddress">
......@@ -204,12 +203,12 @@
</div>
</div>
</a-col>
<a-col :span="4" class="bg-gray">
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div class="required">银行联行号</div>
</div>
</a-col>
<a-col :span="8">
<a-col :span="9">
<div class="special-middle">
<div>
<a-form-model-item prop="interbankNumber">
......@@ -219,10 +218,205 @@
</div>
</a-col>
</a-row>
<!-- 项目合作单位 -->
<cooperative-units-edit :cooperativeUnits.sync="formData.cooperativeUnits" />
<a-row>
<a-col :span="24" style="border-top: 0px">
<div class="tb-title">
<span>项目负责人</span>
</div>
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div>姓名</div>
</div>
</a-col>
<a-col :span="5">
<div class="special-middle">
<div>
{{ formData.appPersonName }}
</div>
</div>
</a-col>
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div>性别</div>
</div>
</a-col>
<a-col :span="5">
<div class="special-middle">
<div>
{{ formData.sex }}
</div>
</div>
</a-col>
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div>出生日期</div>
</div>
</a-col>
<a-col :span="5">
<div class="special-middle">
<div>
{{ moment(formData.birthday).format('YYYY-MM-DD') }}
</div>
</div>
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div>证件类型</div>
</div>
</a-col>
<a-col :span="5">
<div class="special-middle">
<div>
身份证
</div>
</div>
</a-col>
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div>证件号码</div>
</div>
</a-col>
<a-col :span="5">
<div class="special-middle">
<div>
{{ formData.certId }}
</div>
</div>
</a-col>
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div>民族</div>
</div>
</a-col>
<a-col :span="5">
<div class="special-middle">
<div>
{{ formData.nationName }}
</div>
</div>
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div>职称</div>
</div>
</a-col>
<a-col :span="5">
<div class="special-middle">
<div>
{{ formData.titleName }}
</div>
</div>
</a-col>
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div>从事专业</div>
</div>
</a-col>
<a-col :span="5">
<div class="special-middle">
<div>
{{ formData.specName }}
</div>
</div>
</a-col>
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div class="required">项目分工</div>
</div>
</a-col>
<a-col :span="5">
<a-form-model-item prop="projWork">
<a-input v-model="formData.projWork" :maxLength="20" placeholder="项目分工" style="width: 60%" />
</a-form-model-item>
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div>学位</div>
</div>
</a-col>
<a-col :span="5">
<div class="special-middle">
<div>
{{ formData.degreeName }}
</div>
</div>
</a-col>
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div>职务</div>
</div>
</a-col>
<a-col :span="5">
<div class="special-middle">
<div>
{{ formData.dutyName }}
</div>
</div>
</a-col>
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div>传真</div>
</div>
</a-col>
<a-col :span="5">
<div class="special-middle">
<div>
<a-form-model-item prop="fax">
<a-input v-model="formData.fax" :maxLength="20" placeholder="传真" style="width: 60%" />
</a-form-model-item>
</div>
</div>
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div>手机</div>
</div>
</a-col>
<a-col :span="5">
<div class="special-middle">
<div>
{{ formData.mobile }}
</div>
</div>
</a-col>
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div>联系电话</div>
</div>
</a-col>
<a-col :span="5">
<div class="special-middle">
<div>
<a-form-model-item prop="telephone">
<a-input v-model="formData.telephone" :maxLength="20" placeholder="联系电话" style="width: 60%" />
</a-form-model-item>
</div>
</div>
</a-col>
<a-col :span="3" class="bg-gray">
<div class="special-middle">
<div>电子邮箱</div>
</div>
</a-col>
<a-col :span="5">
<div class="special-middle">
<div>
{{ formData.email }}
</div>
</div>
</a-col>
</a-row>
<a-row>
<a-col :span="24" style="border-top: 0px">
<div class="tb-title">
......@@ -274,7 +468,7 @@
</a-col>
<a-col :span="8">
<a-form-model-item prop="startDate" style="width:200px;display: inline-block;">
<a-date-picker format="YYYY-MM-DD" valueFormat="YYYY-MM-DD HH:mm:ss" v-model="formData.startDate" @change="startDateChange" style="width: 180px" />
<a-date-picker format="YYYY-MM-DD" valueFormat="YYYY-MM-DD HH:mm:ss" v-model="formData.startDate" style="width: 180px" />
</a-form-model-item>
</a-col>
<a-col :span="4" class="bg-gray">
......@@ -284,11 +478,11 @@
</a-col>
<a-col :span="8">
<a-form-model-item prop="endDate" style="width:200px;display: inline-block;">
<a-date-picker format="YYYY-MM-DD" valueFormat="YYYY-MM-DD HH:mm:ss" v-model="formData.endDate" @change="endDateChange" style="width: 180px" />
<a-date-picker format="YYYY-MM-DD" valueFormat="YYYY-MM-DD HH:mm:ss" v-model="formData.endDate" style="width: 180px" />
</a-form-model-item>
</a-col>
</a-row>
<a-row type="flex">
<!-- <a-row type="flex">
<a-col :span="4" class="bg-gray">
<div class="special-middle">
<div class="required">项目负责人</div>
......@@ -313,7 +507,7 @@
</div>
</div>
</a-col>
</a-row>
</a-row> -->
<a-row type="flex">
<a-col :span="4" class="bg-gray">
<div class="special-middle">
......@@ -426,256 +620,28 @@
<a-col :span="20">
<div class="special-middle">
<div>
</div>
</div>
</a-col>
</a-row>
<a-row>
<a-col :span="24" style="border-top: 0px">
<div class="main-title">
<span>项目主要实施内容和目标</span>
</div>
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="4" class="bg-gray">
<div class="special-middle">
<div class="required">项目实施目标</div>
</div>
</a-col>
<a-col :span="20">
<a-form-model-item prop="researchContent">
<a-textarea placeholder="项目实施目标(限5000字)" v-model="formData.researchContent" :maxLength="5000" style="width: 80%; height: 160px; margin-top: 12px" />
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24" style="border-top: 0px">
<div class="tb-title">
<span>项目考核指标</span>
</div>
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="4" class="bg-gray">
<div class="special-middle">
<div class="required">主要技术指标</div>
</div>
</a-col>
<a-col :span="20">
<a-form-model-item prop="technologyTarget">
<a-textarea placeholder="主要技术指标(限5000字)" v-model="formData.technologyTarget" :maxLength="5000" style="width: 80%; height: 160px; margin-top: 12px" />
</a-form-model-item>
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="4" class="bg-gray">
<div class="special-middle">
<div class="required">主要经济指标</div>
<span style="margin:0 6px 0 6px;">立项报告</span><a-input-number v-model="formData.projectReport" :min="0" :step="1" style="width: 60px" />
<span style="margin:0 6px 0 24px;">进展报告</span><a-input-number v-model="formData.progressReport" :min="0" :step="1" style="width: 60px;" />
<span style="margin:0 6px 0 24px;">专题报告</span><a-input-number v-model="formData.specialReport" :min="0" :step="1" style="width: 60px" />
<span style="margin:0 6px 0 24px;">最终报告</span><a-input-number v-model="formData.finalReport" :min="0" :step="1" style="width: 60px" />
</div>
</a-col>
<a-col :span="20">
<a-form-model-item prop="economyTarget">
<a-textarea placeholder="主要经济指标(限5000字)" v-model="formData.economyTarget" :maxLength="5000" style="width: 80%; height: 160px; margin-top: 12px" />
</a-form-model-item>
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="4" class="bg-gray">
<div class="special-middle">
<div class="required">项目实施中形成的示范基地、中试线、生产线及其规模等</div>
</div>
</a-col>
<a-col :span="20">
<a-form-model-item prop="achievementTarget">
<a-textarea placeholder="项目实施中形成的示范基地、中试线、生产线及其规模等(限5000字)" v-model="formData.achievementTarget" :maxLength="5000" style="width: 80%; height: 160px; margin-top: 12px" />
</a-form-model-item>
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="4" class="bg-gray">
<div class="special-middle">
<div class="required">科技报告考核指标</div>
</div>
</a-col>
<a-col :span="20">
<a-form-model-item prop="technologyReportsTarget">
<a-textarea placeholder="科技报告考核指标(限5000字)" v-model="formData.technologyReportsTarget" :maxLength="5000" style="width: 80%; height: 160px; margin-top: 12px" />
</a-form-model-item>
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="4" class="bg-gray">
<div class="special-middle">
<div class="required">其他应考核的指标</div>
</div>
</a-col>
<a-col :span="20">
<a-form-model-item prop="otherTarget">
<a-textarea placeholder="其他应考核的指标(限5000字)" v-model="formData.otherTarget" :maxLength="5000" style="width: 80%; height: 160px; margin-top: 12px" />
</a-form-model-item>
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="24" style="text-align: center;">
<div class="special-middle">
&nbsp;
</div>
</a-col>
</a-row>
</div>
<div v-if="stepsArray[1].showStatus">
<a-row>
<a-col :span="24" style="border-top: 0px">
<div class="main-title">
<span>项目人员情况</span>
</div>
</a-col>
</a-row>
<!-- 项目组成员 -->
<project-member-edit :dataList.sync="formData.members" />
<a-row type="flex">
<a-col :span="24" style="text-align: center;">
<div class="special-middle">
&nbsp;
</div>
</a-col>
</a-row>
<!-- 项目主要参与单位及分工 -->
<participate-units-edit :participateUnits.sync="formData.participateUnits" />
</div>
<div v-if="stepsArray[2].showStatus">
<!-- 经费预算 -->
<budget-edit :budget.sync="formData.budget" @save="budgetSave" />
<a-row type="flex">
<a-col :span="24" style="text-align: center;">
<div class="special-middle">
&nbsp;
</div>
</a-col>
</a-row>
<!-- 分年度用款计划 -->
<fund-plan-edit :fundPlan.sync="formData.fundPlan" @save="planSave" />
<a-row type="flex">
<a-col :span="24" style="text-align: center;">
<div class="special-middle">
&nbsp;
</div>
</a-col>
</a-row>
<!-- 设备费-购置设备预算明细表 -->
<device-edit :deviceList.sync="formData.deviceList" />
<a-row type="flex">
<a-col :span="24" style="text-align: center;">
<div class="special-middle">
&nbsp;
</div>
</a-col>
</a-row>
<!-- 设备费-试制设备预算明细表 -->
<manufacture-edit :manufactureList.sync:="formData.manufactureList" />
<a-row type="flex">
<a-col :span="24" style="text-align: center;">
<div class="special-middle">
&nbsp;
</div>
</a-col>
</a-row>
<!-- 项目承担单位研究资金支出预算明细表 -->
<unit-payment-edit :unitPayment.sync="formData.unitPayment" />
</div>
<div v-if="stepsArray[3].showStatus">
<!-- 项目安排及阶段目标 -->
<proj-stage-goals-edit :stageGoals.sync="formData.stageGoals" />
<!-- 项目课题设置 -->
<project-sub-edit :projectSubList.sync="formData.projectSubList" />
</div>
<div v-if="stepsArray[4].showStatus">
<!-- 项目绩效指标 -->
<project-kpi-edit :projectKPI.sync="formData.projectKPI" />
</div>
<div v-if="stepsArray[5].showStatus">
<!-- 附件 -->
<file-edit :fileList.sync="formData.fileList" />
</div>
</a-form-model>
</div>
</template>
<script>
import fundEdit from '@/views/report/project/components/fundEdit'
import { getType } from '@/views/utils/auth'
import projectMemberEdit from '@/views/report/project/components/projectMemberEdit'
import cooperativeUnitsEdit from '@/views/report/project/components/cooperativeUnitsEdit'
import participateUnitsEdit from '@/views/report/project/components/participateUnitsEdit'
import deviceEdit from '@/views/report/project/components/deviceEdit'
import projStageGoalsEdit from '@/views/report/project/components/projStageGoalsEdit'
import budgetEdit from '@/views/report/project/components/fundEdit'
import fundPlanEdit from '@/views/report/project/components/fundPlanEdit'
import projectKpiEdit from '@/views/report/project/components/projectKpiEdit'
import manufactureEdit from '@/views/report/project/components/manufactureEdit'
import unitPaymentEdit from '@/views/report/project/components/unitPaymentEdit'
import projectSubEdit from '@/views/report/project/components/projectSubEdit'
import fileEdit from '@/views/report/project/components/fileEdit'
import documentView from '@/views/components/common/documentView'
import previewFile from '@/views/components/common/previewFile'
import { isEmptyParams } from "@/views/utils/common"
import moment from 'moment'
const ParticipateUnit = { id: null, unitName: null, unitCountry: null, unitAddress: null, organizationCode: null, projectWork: null }
const ProjResearch = { projNo: null, projName: null, approveUnit: null, leader: null, startDate: null, endDate: null, funds: null }
const ManagementRule = { policyName: null, releaseDate: null, documentNumber: null, validityPeriod: null, mainContent: null, fileId: null, downloadId: null, fileName: null, downloadUrl: null }
const StageGoals = { startTime: null, endTime: null, target: null }
const ProjectSub = { projName: null, undertakingUnit: null, address: null, director: null, totalBudget: null, govBudget: null, selfBudget: null, cooperativeUnits: null, fileId: null, downloadId: null, fileName: null, downloadUrl: null }
const Cooperative = { id: null, unitName: null }
const File = { fileName: '', downloadUrl: '', fileExplain: '', downloadId: '' }
const Equipment = { id: "", objectId: "", name: "", functionTarget: "", specificationType: "", quantity: 1, totalBudget: 0.0, useFrom: "", buyUnit: "", storageLocation: "", equipmentType: "", manufacturer: "", sharedScope: "", unitPrice: 0.0, };
const projectKPI = {
reportYear: "",
projName: "",
appUnitName: "",
managerDept: "",
projAttribute: "",
projDeadline: "",
startDate: "",
endData: "",
yearTarget: "",
year1Goal: "",
year2Goal: "",
year3Goal: "",
totalBudget: 0.00,
applyFunds: 0.00,
selfFunds: 0.00,
yearTotal: 0.00,
yearApply: 0.00,
yearSelf: 0.00,
totalRowSpan: 0, //总合并行数
outTarget: 0, //一级指标(产出指标)
benefitTarget: 0, //一级指标(效益指标)
satisfactionDegree: 0, //一级指标(满意度指标)
quantityTarget: 0, //二级指标(数量指标)
qualityTarget: 0, //二级指标(质量指标)
validityTarget: 0, //二级指标(时效指标)
costTarget: 0, //二级指标(成本指标)
economicTarget: 0, //二级指标(经济效益指标)
socialTarget: 0, //二级指标(社会效益指标)
ecologicalTarget: 0, //二级指标(生态效益指标)
sustainableTarget: 0, //二级指标(可持续影响指标)
serviceTarget: 0, //二级指标(服务对象满意度指标)
threeLevel: [],
kpiList: [],
};
import cascaderSelect from '@/views/components/common/cascaderSelect'
export default {
name: 'projectEdit',
components: {
fundEdit, projectMemberEdit, cooperativeUnitsEdit, budgetEdit, fundPlanEdit, projectKpiEdit, fileEdit, previewFile, documentView, cascaderSelect, deviceEdit, projStageGoalsEdit, manufactureEdit, unitPaymentEdit, projectSubEdit, participateUnitsEdit
},
props: {
value: {
......@@ -684,25 +650,9 @@ export default {
return null
}
},
stepsArray: {
type: Array,
default () {
return []
}
},
completeStatus: {
type: String,
default () {
return "0,0,0,0,0,0"
}
},
},
created () {
this.getProject()
},
data () {
return {
overseasShow: false,
formData: {
id: null,
appPersonName: null,
......@@ -743,7 +693,6 @@ export default {
year1Goal: null,
year2Goal: null,
year3Goal: null,
projectKPI: projectKPI,
cooperativeUnits: [],
participateUnits: [],
members: [],
......@@ -787,17 +736,16 @@ export default {
},
}
},
created () {
this.getProjectTask()
},
computed: {
},
mounted () {
},
methods: {
moment,
save (step) {
if (this.checkInfo(step)) {
var obj = this.getObj(step)
obj.step = step
save () {
this.$emit('load', true)
let pars = isEmptyParams(obj)
let par = { ...pars }
......@@ -811,34 +759,22 @@ export default {
}).catch(() => {
this.$emit('load', false)
})
}
},
submit (step, next) {
if (this.checkInfo(step)) {
submit () {
this.$refs.form.validate(valid => {
if (valid) {
this.$emit('load', true)
var arr = this.completeStatus.split(',');
arr[step] = "1";
this.formData.completeStatus = arr.toString()
var obj = this.getObj(step)
obj.step = step
let state = obj.projState
if (state != 30 && step == 5)
let state = this.formData.projState
if (state != 30)
obj.projState = 10
let pars = isEmptyParams(obj)
let par = { ...pars }
this.$api.project.saveByStep(par).then(({ data = {} }) => {
if (data) {
this.formData.id = data
if (next) {
this.$emit('close', 'save')
this.$emit('onStepChange', { step: step + 1, state: arr.toString() })
} else {
this.$message.success('成功!')
this.$emit('close', 'submit')
}
}
this.$emit('load', false)
}).catch(() => {
this.$emit('load', false)
......@@ -848,29 +784,14 @@ export default {
return false
}
})
}
},
getProject () {
getProjectTask () {
this.$emit('load', true)
if (!!this.value) {
this.$api.project.getProjectInfoById({ id: this.value }).then(({ data = {} }) => {
if (data) {
this.formData = data
this.$emit('onStepChange', { step: 0, state: data.completeStatus })
this.loadList()
} else
this.$emit('close', 'error')
this.$emit('load', false)
}).catch(() => {
this.$emit('close', 'error')
this.$emit('load', false)
})
} else {
this.$api.project.getNewProject({ projType: getType() }).then(({ data = {} }) => {
this.$api.task.getTaskByProjId({ id: this.value }).then(({ data = {} }) => {
if (data) {
this.formData = data
this.$emit('onStepChange', { step: 0, state: data.completeStatus })
this.loadList()
} else
this.$emit('close', 'error')
this.$emit('load', false)
......@@ -880,185 +801,6 @@ export default {
})
}
},
getCompleteStatus (step, completeStatus) {
var arr = completeStatus.split(',')
if (!!arr && arr.length > 0) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] == "1") {
this.stepsArray[i].status = "finish"
}
}
this.stepsArray[step].status = "process"
}
},
loadList () {
if (!!!this.formData.cooperativeUnits || this.formData.cooperativeUnits.length == 0)
this.formData.cooperativeUnits = []
if (!!!this.formData.participateUnits || this.formData.participateUnits.length == 0)
this.formData.participateUnits = [] //{ ...Cooperative }, { ...Cooperative }
if (!!!this.formData.members || this.formData.members.length == 0)
this.formData.members = []
if (!!!this.formData.deviceList || this.formData.deviceList.length == 0)
this.formData.deviceList = []
if (!!!this.formData.manufactureList || this.formData.manufactureList.length == 0)
this.formData.manufactureList = []
if (!!!this.formData.unitPayment || this.formData.unitPayment.length == 0)
this.formData.unitPayment = []
if (!!!this.formData.stageGoals || this.formData.stageGoals.length == 0)
this.formData.stageGoals = [{ ...StageGoals }, { ...StageGoals }, { ...StageGoals }]
if (!!!this.formData.projectSubList || this.formData.projectSubList.length == 0)
this.formData.projectSubList = []
if (!!!this.formData.fileList || !this.formData.fileList.length || this.formData.fileList.length == 0) {
this.formData.fileList = []
}
},
processKpiFunds () {
if (!!this.formData.budget && this.formData.budget.length > 0) {
this.formData.projectKPI.yearTotal = this.formData.budget[0].totalBudget
this.formData.projectKPI.yearApply = this.formData.budget[0].applyFunds
this.formData.projectKPI.yearSelf = this.formData.budget[0].selfFunds
}
},
processProjectYearTarget () {
this.formData.yearTarget = this.formData.projectKPI.yearTarget
this.formData.year1Goal = this.formData.projectKPI.year1Goal
this.formData.year2Goal = this.formData.projectKPI.year2Goal
this.formData.year3Goal = this.formData.projectKPI.year3Goal
this.formData.projectKPI.kpiList = this.formData.projectKPI.threeLevel
this.formData.managerDept = this.formData.projectKPI.managerDept
this.formData.projAttribute = this.formData.projectKPI.projAttribute
},
getObj (step) {
var obj = null
switch (step) {
case 0: {
obj = {
id: null, reportYear: null, batch: null, projState: null, appPersonId: null, appUnitId: null, projType: null,
jobTime: null, address: null, mainResearchAreas: null,
unitLinkName: null, unitLinkMobile: null, unitLinkEmail: null, unitLinkFax: null,
projName: null, knowledgeId: null, startDate: null, endDate: null,
remark: null, projClass: null, subjectScope: null, projAbstract: null, projKeywords: null,
totalFunding: null, govFunding: null, unitFunding: null, selfFunding: null,
researchContent: null, technologyTarget: null, economyTarget: null, achievementTarget: null, technologyReportsTarget: null, otherTarget: null,
fileId: null, downloadId: null, completeStatus: null, step: null
}
this.formData.projectKPI.appUnitName = this.formData.appUnitName
break;
}
case 1:
obj = { id: null, members: [], participateUnits: [], completeStatus: null, step: null }
break;
case 2:
this.processKpiFunds()
obj = { id: null, totalFunding: null, govFunding: null, unitFunding: null, selfFunding: null, budget: [], fundPlan: [], deviceList: [], manufactureList: [], unitPayment: [], completeStatus: null, step: null }
break;
case 3:
obj = { id: null, stageGoals: [], projectSubList: [], completeStatus: null, step: null }
break;
case 4:
this.processProjectYearTarget()
obj = { id: null, projectKPI: null, yearTarget: null, year1Goal: null, year2Goal: null, year3Goal: null, managerDept: null, projAttribute: null, completeStatus: null, step: null }
break;
case 5:
obj = { id: null, fileList: [], projState: null, completeStatus: null, step: null }
break;
}
Object.keys(obj).forEach(key => {
obj[key] = this.formData[key];
})
return obj
},
checkInfo (step) {
if (step == 0) {
if (this.formData.projName == "" || this.formData.projName == null) {
alert('项目名称不能为空')
return false
} else return true
} else if (step == 1) {
if (!!!this.formData.members || this.formData.members.length == 0) {
this.$message.error('至少添加一位项目组成员!')
return false
} else return true
} else if (step == 2) {
return true
} else if (step == 3) {
return true
} else if (step == 4) {
const flag = this.determineProjKPIDetail()
if (flag) {
return true
} else {
this.$message.error('项目绩效目标表需要至少填写其中的一项指标明细!')
return false
}
} else if (step == 5) {
return true
}
},
determineProjKPIDetail () {
let flag = false
for (let e of this.formData.projectKPI.threeLevel) {
if (e.performanceStandard && e.performanceStandard > 0) {
flag = true
break
}
if (e.targetValue && e.targetValue > 0) {
flag = true
break
}
if (e.yearValue1 && e.yearValue1 > 0) {
flag = true
break
}
if (e.yearValue2 && e.yearValue2 > 0) {
flag = true
break
}
if (e.yearValue3 && e.yearValue3 > 0) {
flag = true
break
}
}
return flag
},
projNameChange (value) {
this.formData.projectKPI.projName = this.formData.projName
},
startDateChange (value, dateString) {
this.formData.projectKPI.startDate = this.formData.startDate
},
endDateChange (value, dateString) {
this.formData.projectKPI.endDate = this.formData.endDate
if (this.formData.projectKPI.startDate && this.formData.projectKPI.endDate) {
let projDeadline = moment(this.formData.startDate).format('YYYY-MM-DD') + "至" + moment(this.formData.endDate).format('YYYY-MM-DD')
this.formData.projectKPI.projDeadline = projDeadline
}
},
planSave (e) {
if (!!e && e.length == 3) {
this.formData.projectKPI.yearTotal = e[0]
this.formData.projectKPI.yearApply = e[1]
this.formData.projectKPI.yearSelf = e[2]
}
},
budgetSave (e) {
if (!!e && e.length == 3) {
this.formData.totalFunding = e[0]
this.formData.govFunding = e[1]
this.formData.projectKPI.totalBudget = this.formData.totalFunding
this.formData.projectKPI.applyFunds = this.formData.govFunding
this.formData.projectKPI.selfFunds = e[2]
}
},
}
}
</script>
......
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