|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="doc-page">
|
|
|
+ <div class="doc-page" v-loading="loading">
|
|
|
<h3 class="page-title" style="margin: 24px 0 16px;">科德集团</h3>
|
|
|
<h3 class="page-title" style="margin: 24px 0 16px;">研发项目验收资料</h3>
|
|
|
|
|
|
@@ -10,7 +10,7 @@
|
|
|
<div class="info-row">{{ `项目执行期:${ getXmDateRange || '' }` }}</div>
|
|
|
<div class="info-row">
|
|
|
<span>填报时间:</span>
|
|
|
- <span><el-date-picker v-model="formData.tbsj" type="month" value-format="yyyy-MM" /></span>
|
|
|
+ <span><el-date-picker v-model="formData.tbsj" value-format="yyyy-MM-dd" /></span>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -19,32 +19,17 @@
|
|
|
<tr>
|
|
|
<td class="doc-label">研发项目名称</td>
|
|
|
<td class="doc-input">
|
|
|
- <el-select
|
|
|
- v-model="formData.xmId"
|
|
|
- filterable
|
|
|
- remote
|
|
|
- reserve-keyword
|
|
|
- placeholder="请输入关键词"
|
|
|
- :remote-method="remoteMethod"
|
|
|
- :loading="loading"
|
|
|
- style="width: 100%;"
|
|
|
- :disabled="!formData.tbsj"
|
|
|
+ <project-select
|
|
|
+ v-model="currProjectId"
|
|
|
@change="handleProjectChange"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in projectList"
|
|
|
- :key="item.id"
|
|
|
- :label="item.xmmc"
|
|
|
- :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ ></project-select>
|
|
|
</td>
|
|
|
<td class="doc-label">项目申请单位</td>
|
|
|
<td class="doc-input">{{ selProject.xmsqdw }}</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td class="doc-label">项目负责人</td>
|
|
|
- <td class="doc-input">{{ selProject.xmfzr }} </td>
|
|
|
+ <td class="doc-input">{{ selProject.xmfzrxm }} </td>
|
|
|
<td class="doc-label">研究类型</td>
|
|
|
<td class="doc-input">{{ selProject.yjlx }}</td>
|
|
|
</tr>
|
|
|
@@ -104,27 +89,30 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getDictionary } from "@/api/system/dictbiz";
|
|
|
-import { getList as getProjectList } from "@/api/projectManage/projectList";
|
|
|
-import { add } from "@/api/projectManage/change";
|
|
|
+import projectSelect from "@/components/project-select";
|
|
|
+import { save, getDetail } from "@/api/projectManage/accept";
|
|
|
import moment from "moment";
|
|
|
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ projectSelect
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ projectId: [String, Number]
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
formData: {},
|
|
|
|
|
|
- changeTypeList: [],
|
|
|
-
|
|
|
loading: false,
|
|
|
projectList: [],
|
|
|
selProject: {},
|
|
|
|
|
|
+ currProjectId: '',
|
|
|
+
|
|
|
+ loading: false
|
|
|
};
|
|
|
},
|
|
|
- mounted() {
|
|
|
- this.getDictList("xm_biangeng_field", "changeTypeList");
|
|
|
- },
|
|
|
computed: {
|
|
|
getXmDateRange() {
|
|
|
if (this.selProject.xmkssj && this.selProject.xmjssj) {
|
|
|
@@ -152,7 +140,7 @@ export default {
|
|
|
res: "data",
|
|
|
},
|
|
|
action: '/api/kd-resource/oss/endpoint/put-file',
|
|
|
- disabled: !this.formData.xmId
|
|
|
+ disabled: !this.currProjectId
|
|
|
},
|
|
|
{
|
|
|
label: "技术报告",
|
|
|
@@ -167,7 +155,7 @@ export default {
|
|
|
res: "data",
|
|
|
},
|
|
|
action: '/api/kd-resource/oss/endpoint/put-file',
|
|
|
- disabled: !this.formData.xmId
|
|
|
+ disabled: !this.currProjectId
|
|
|
},
|
|
|
{
|
|
|
label: "成果报告",
|
|
|
@@ -182,7 +170,7 @@ export default {
|
|
|
res: "data",
|
|
|
},
|
|
|
action: '/api/kd-resource/oss/endpoint/put-file',
|
|
|
- disabled: !this.formData.xmId
|
|
|
+ disabled: !this.currProjectId
|
|
|
},
|
|
|
{
|
|
|
label: "效益报告",
|
|
|
@@ -197,7 +185,7 @@ export default {
|
|
|
res: "data",
|
|
|
},
|
|
|
action: '/api/kd-resource/oss/endpoint/put-file',
|
|
|
- disabled: !this.formData.xmId
|
|
|
+ disabled: !this.currProjectId
|
|
|
},
|
|
|
{
|
|
|
label: "验收批文",
|
|
|
@@ -212,42 +200,58 @@ export default {
|
|
|
name: "originalName",
|
|
|
res: "data",
|
|
|
},
|
|
|
- disabled: !this.formData.xmId
|
|
|
+ disabled: !this.currProjectId
|
|
|
},
|
|
|
],
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ currProjectId() {
|
|
|
+ this.getImplementDetail();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.currProjectId = this.projectId || '';
|
|
|
+ },
|
|
|
methods: {
|
|
|
- getDictList(code, toListKey) {
|
|
|
- getDictionary({ code }).then((res) => {
|
|
|
- this[toListKey] = res.data.data.map((item) => {
|
|
|
- return { label: item.dictValue, value: item.dictKey };
|
|
|
- });
|
|
|
+ getImplementDetail() {
|
|
|
+ this.loading = true;
|
|
|
+ getDetail({ xmId: this.currProjectId, yearAndMonth: this.yearAndMonth }).then(({ data }) => {
|
|
|
+ this.loading = false;
|
|
|
+ if (data.code == 200 && data.data && Object.keys(data.data).length) {
|
|
|
+ this.formData = {
|
|
|
+ id: data.data.id,
|
|
|
+ xmId: data.data.xmId,
|
|
|
+ tbsj: data.data.tbsj,
|
|
|
+ ysbg: JSON.parse(data.data.ysbg),
|
|
|
+ jsbg: JSON.parse(data.data.jsbg),
|
|
|
+ cgbg: JSON.parse(data.data.cgbg),
|
|
|
+ xybg: JSON.parse(data.data.xybg),
|
|
|
+ yspw: JSON.parse(data.data.yspw),
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ this.formData = {
|
|
|
+ tbsj: '',
|
|
|
+ ysbg: [],
|
|
|
+ jsbg: [],
|
|
|
+ cgbg: [],
|
|
|
+ xybg: [],
|
|
|
+ yspw: [],
|
|
|
+ };
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
- remoteMethod(query) {
|
|
|
- if (query !== '') {
|
|
|
- this.loading = true;
|
|
|
- setTimeout(() => {
|
|
|
- this.loading = false;
|
|
|
- getProjectList(1, 99999, { xmmc: query }).then(({ data }) => {
|
|
|
- if (data.success) {
|
|
|
- this.projectList = data.data.records;
|
|
|
- }
|
|
|
- })
|
|
|
- }, 200);
|
|
|
- } else {
|
|
|
- this.projectList = [];
|
|
|
- }
|
|
|
- },
|
|
|
- handleProjectChange(val) {
|
|
|
- let currPro = this.projectList.find(item => item.id === val);
|
|
|
- this.selProject = currPro;
|
|
|
+ handleProjectChange(data) {
|
|
|
+ this.selProject = data;
|
|
|
},
|
|
|
validForm() {
|
|
|
let errorText = '';
|
|
|
- if (!this.formData.xmId) {
|
|
|
+ if (!this.formData.tbsj) {
|
|
|
+ errorText = '请选择填报时间';
|
|
|
+ } else if (!this.currProjectId) {
|
|
|
errorText = '请选择填报的项目';
|
|
|
}
|
|
|
|
|
|
@@ -260,10 +264,21 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- this.saveData(this.formData);
|
|
|
+ const params = { ...this.formData, xmId: this.currProjectId };
|
|
|
+ params.ysbg = JSON.stringify(params.ysbg);
|
|
|
+ params.jsbg = JSON.stringify(params.jsbg);
|
|
|
+ params.cgbg = JSON.stringify(params.cgbg);
|
|
|
+ params.xybg = JSON.stringify(params.xybg);
|
|
|
+ params.yspw = JSON.stringify(params.yspw);
|
|
|
+
|
|
|
+ this.saveData(params);
|
|
|
},
|
|
|
saveData(params) {
|
|
|
- console.log(params)
|
|
|
+ save(params).then(({ data }) => {
|
|
|
+ if (data.code == 200) {
|
|
|
+ this.$message.success('保存成功!');
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
};
|