|
|
@@ -18,32 +18,21 @@
|
|
|
<td class="doc-input">
|
|
|
<el-input v-model="formData.xmmc" placeholder="请输入项目名称" />
|
|
|
</td>
|
|
|
- <td class="doc-label">项目申请单位</td>
|
|
|
+ <td class="doc-label">项目编号</td>
|
|
|
<td class="doc-input">
|
|
|
<el-input
|
|
|
- v-model="formData.xmsqdw"
|
|
|
- placeholder="请选择项目申请单位"
|
|
|
+ v-model="formData.xmbh"
|
|
|
+ placeholder="请输入项目编号"
|
|
|
/>
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
- <td class="doc-label">项目负责人</td>
|
|
|
- <td class="doc-input">
|
|
|
- <avue-select
|
|
|
- v-model="formData.xmfzr"
|
|
|
- placeholder="请选择"
|
|
|
- :dic="fzrList"
|
|
|
- style="width: 100%"
|
|
|
- ></avue-select>
|
|
|
- </td>
|
|
|
- <td class="doc-label">研究类型</td>
|
|
|
- <td class="doc-input">
|
|
|
- <avue-select
|
|
|
- v-model="formData.yjlx"
|
|
|
- placeholder="请选择"
|
|
|
- :dic="studyTypeList"
|
|
|
- style="width: 100%"
|
|
|
- ></avue-select>
|
|
|
+ <td class="doc-label">项目申请单位</td>
|
|
|
+ <td colspan="3">
|
|
|
+ <el-input
|
|
|
+ v-model="formData.xmsqdw"
|
|
|
+ placeholder="请选择项目申请单位"
|
|
|
+ />
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
@@ -69,6 +58,26 @@
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
+ <td class="doc-label">项目负责人</td>
|
|
|
+ <td class="doc-input">
|
|
|
+ <avue-select
|
|
|
+ v-model="formData.xmfzr"
|
|
|
+ placeholder="请选择"
|
|
|
+ :dic="fzrList"
|
|
|
+ style="width: 100%"
|
|
|
+ ></avue-select>
|
|
|
+ </td>
|
|
|
+ <td class="doc-label">研究类型</td>
|
|
|
+ <td class="doc-input">
|
|
|
+ <avue-select
|
|
|
+ v-model="formData.yjlx"
|
|
|
+ placeholder="请选择"
|
|
|
+ :dic="studyTypeList"
|
|
|
+ style="width: 100%"
|
|
|
+ ></avue-select>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
<td class="doc-label">项目来源</td>
|
|
|
<td class="doc-input">
|
|
|
<avue-select
|
|
|
@@ -113,7 +122,7 @@
|
|
|
<tr>
|
|
|
<td class="doc-label">项目预算总额(万元)</td>
|
|
|
<td class="doc-input">
|
|
|
- {{ budgetAmount }}
|
|
|
+ <el-input-number v-model="formData.xmze" type="number" :min="0" controls-position="right" />
|
|
|
</td>
|
|
|
<td class="doc-label">其中</td>
|
|
|
<td class="doc-input">
|
|
|
@@ -121,7 +130,7 @@
|
|
|
<div class="year-list-item" v-for="year of yearList" :key="year" :style="{ height: yearList.length == 1 ? '51px' : '32px', lineHeight: yearList.length == 1 ? '51px' : '32px' }">
|
|
|
<div class="year" >{{ year }}</div>
|
|
|
<div class="year-input">
|
|
|
- <input v-model="formData[year]" type="number" />
|
|
|
+ <input v-model="formData[year]" type="number" :class="{ 'red': budgetIsExceed }" @input="handleYearInput" style="padding: 0 6px;" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -130,7 +139,20 @@
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
- <avue-form v-model="formData" :option="option" style="margin-top: 30px; padding: 0;"></avue-form>
|
|
|
+ <avue-form v-model="formData" :option="option" style="margin-top: 30px; padding: 0;">
|
|
|
+ <template slot="lxpwLabel">
|
|
|
+ <label>立项批文</label>
|
|
|
+ <el-link type="primary" style="position: absolute; left: 220px;">下载模板</el-link>
|
|
|
+ </template>
|
|
|
+ <template slot="lxbgLabel">
|
|
|
+ <label>立项报告</label>
|
|
|
+ <el-link type="primary" style="position: absolute; left: 220px;">下载模板</el-link>
|
|
|
+ </template>
|
|
|
+ <template slot="qtzlLabel">
|
|
|
+ <label>其他资料</label>
|
|
|
+ <el-link type="primary" style="position: absolute; left: 220px;">下载模板</el-link>
|
|
|
+ </template>
|
|
|
+ </avue-form>
|
|
|
<p class="tip">注:可一次上传多个相关文件(文档、表格、图片等)。 支持格式:DOC, PDF, Excel, PNG, JPG, PPT 等。 请确保文件内容清晰有效。</p>
|
|
|
|
|
|
<div class="btn-wrap" style="text-align: center;">
|
|
|
@@ -151,10 +173,9 @@ export default {
|
|
|
return {
|
|
|
formData: {},
|
|
|
|
|
|
- // 项目预算总额
|
|
|
- budgetAmount: 0,
|
|
|
-
|
|
|
yearList: [],
|
|
|
+ // 预算是否超出
|
|
|
+ budgetIsExceed: false,
|
|
|
|
|
|
// 项目负责人列表
|
|
|
fzrList: [],
|
|
|
@@ -241,6 +262,9 @@ export default {
|
|
|
},
|
|
|
'formData.xmjssj'(newVal) {
|
|
|
this.yearList = this.getDateRangeYear(this.formData.xmkssj, newVal);
|
|
|
+ },
|
|
|
+ 'formData.xmze'(newVal) {
|
|
|
+ this.calcBudgetIsExceed(newVal);
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -295,6 +319,28 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ handleYearInput(e) {
|
|
|
+ this.calcBudgetIsExceed(this.formData.xmze);
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 计算是否超出预算
|
|
|
+ * @param total 预算总额
|
|
|
+ */
|
|
|
+ calcBudgetIsExceed(total) {
|
|
|
+ let yearTotal = 0;
|
|
|
+ let projectBudget = Number(total || 0);
|
|
|
+
|
|
|
+ this.yearList.forEach(year => {
|
|
|
+ let num = Number(this.formData[year] || 0);
|
|
|
+ yearTotal += num;
|
|
|
+ });
|
|
|
+
|
|
|
+ if (yearTotal > projectBudget) {
|
|
|
+ this.budgetIsExceed = true;
|
|
|
+ } else {
|
|
|
+ this.budgetIsExceed = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
/**
|
|
|
* 获取人员花名册
|
|
|
*/
|
|
|
@@ -308,18 +354,23 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
validForm() {
|
|
|
- console.log(!this.formData.lxpw)
|
|
|
let errorText = '';
|
|
|
if (!this.formData.xmmc) {
|
|
|
errorText = '请输入项目名称';
|
|
|
} else if (/技改|技术改造|推广|打样|翻新|产业化|生产线|改造|年产|示范/g.test(this.formData.xmmc)) {
|
|
|
errorText = '研发项目名称,不符合统计部门的命名要求';
|
|
|
+ } else if (!this.formData.xmbh) {
|
|
|
+ errorText = '请输入项目编号'
|
|
|
+ } else if (!this.formData.yjlx) {
|
|
|
+ errorText = '请选择研究类型'
|
|
|
} else if (!this.formData.xmfzr) {
|
|
|
errorText = '请选择项目负责人';
|
|
|
} else if (!this.formData.xmkssj) {
|
|
|
errorText = '请选择项目开始时间';
|
|
|
} else if (!this.formData.xmjssj) {
|
|
|
errorText = '请选择项目结束时间';
|
|
|
+ } else if (!this.formData.xmze) {
|
|
|
+ errorText = '请输入项目预算总额';
|
|
|
} else if (!this.formData.lxpw.length) {
|
|
|
errorText = '请上传立项批文!';
|
|
|
} else if (!this.formData.lxbg.length) {
|
|
|
@@ -432,6 +483,10 @@ tr td {
|
|
|
|
|
|
}
|
|
|
|
|
|
+.red {
|
|
|
+ color: red;
|
|
|
+}
|
|
|
+
|
|
|
.tip {
|
|
|
position: relative;
|
|
|
top: 0;
|