|
|
@@ -29,10 +29,11 @@
|
|
|
<tr>
|
|
|
<td class="doc-label">项目申请单位</td>
|
|
|
<td colspan="3">
|
|
|
- <el-input
|
|
|
+ <!-- <el-input
|
|
|
v-model="formData.xmsqdw"
|
|
|
placeholder="请选择项目申请单位"
|
|
|
- />
|
|
|
+ /> -->
|
|
|
+ <second-unit-cascader v-model="formData.xmsqdwid" :yearAndMonth="yearAndMonth" style="width: 100%;"></second-unit-cascader>
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
@@ -162,6 +163,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import secondUnitCascader from "@/components/second-unit-cascader";
|
|
|
import { getDictionary } from "@/api/system/dictbiz";
|
|
|
import { getList as getTechnicanRosterList } from "@/api/basicResource/technicianRoster";
|
|
|
import { add, update, getDetail } from "@/api/projectManage/projectList";
|
|
|
@@ -169,6 +171,9 @@ import moment from "moment";
|
|
|
import { deepClone } from "@/util/util";
|
|
|
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ secondUnitCascader
|
|
|
+ },
|
|
|
props: {
|
|
|
projectId: [String, Number]
|
|
|
},
|
|
|
@@ -218,10 +223,10 @@ export default {
|
|
|
window.open(file.url, "_blank");
|
|
|
return;
|
|
|
},
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请上传立项批文"
|
|
|
- }]
|
|
|
+ // rules: [{
|
|
|
+ // required: true,
|
|
|
+ // message: "请上传立项批文"
|
|
|
+ // }]
|
|
|
},
|
|
|
{
|
|
|
label: "立项报告",
|
|
|
@@ -240,10 +245,10 @@ export default {
|
|
|
window.open(file.url, "_blank");
|
|
|
return;
|
|
|
},
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请上传立项报告"
|
|
|
- }]
|
|
|
+ // rules: [{
|
|
|
+ // required: true,
|
|
|
+ // message: "请上传立项报告"
|
|
|
+ // }]
|
|
|
},
|
|
|
{
|
|
|
label: "其他资料",
|
|
|
@@ -270,6 +275,9 @@ export default {
|
|
|
watch: {
|
|
|
'formData.xmkssj'(newVal) {
|
|
|
this.yearList = this.getDateRangeYear(newVal, this.formData.xmjssj);
|
|
|
+ if (!newVal) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
let cMonth = moment(newVal).format('yyyyMM');
|
|
|
if (cMonth != this.xmStartDateYearAndMonth) {
|
|
|
this.xmStartDateYearAndMonth = cMonth;
|
|
|
@@ -306,6 +314,10 @@ export default {
|
|
|
}
|
|
|
return `年 月 日至 年 月 日`;
|
|
|
},
|
|
|
+ yearAndMonth() {
|
|
|
+ console.log(!!this.formData.xmkssj)
|
|
|
+ return !!this.formData.xmkssj ? moment(this.formData.xmkssj).format('yyyy') : '';
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getDictList("study_type", "studyTypeList");
|
|
|
@@ -322,7 +334,6 @@ export default {
|
|
|
this.loading = true;
|
|
|
getDetail({ id: xmId }).then(({ data }) => {
|
|
|
this.loading = false;
|
|
|
- console.log(data)
|
|
|
if (data.code == 200) {
|
|
|
let beanData = { ...data.data };
|
|
|
console.log(beanData)
|
|
|
@@ -389,6 +400,10 @@ export default {
|
|
|
* 获取人员花名册
|
|
|
*/
|
|
|
getTechnicanRosterListFunc(yearAndMonth) {
|
|
|
+ if (!yearAndMonth) {
|
|
|
+ this.fzrList = [];
|
|
|
+ return;
|
|
|
+ }
|
|
|
getTechnicanRosterList(1, 99999, { yearAndMonth }).then(res => {
|
|
|
if (res.data.success) {
|
|
|
this.fzrList = res.data.data.records.map(item => {
|
|
|
@@ -404,7 +419,9 @@ export default {
|
|
|
} else if (/技改|技术改造|推广|打样|翻新|产业化|生产线|改造|年产|示范/g.test(this.formData.xmmc)) {
|
|
|
errorText = '研发项目名称,不符合统计部门的命名要求';
|
|
|
} else if (!this.formData.xmbh) {
|
|
|
- errorText = '请输入项目编号'
|
|
|
+ errorText = '请输入项目编号';
|
|
|
+ } else if (!this.formData.xmsqdwid || !this.formData.xmsqdwid.length) {
|
|
|
+ errorText = '请选择项目申请单位';
|
|
|
} else if (!this.formData.yjlx) {
|
|
|
errorText = '请选择研究类型'
|
|
|
} else if (!this.formData.xmfzr) {
|
|
|
@@ -415,11 +432,13 @@ export default {
|
|
|
errorText = '请选择项目结束时间';
|
|
|
} else if (!this.formData.xmysze) {
|
|
|
errorText = '请输入项目预算总额';
|
|
|
- } else if (!this.formData.lxpw.length) {
|
|
|
- errorText = '请上传立项批文!';
|
|
|
- } else if (!this.formData.lxbg.length) {
|
|
|
- errorText = '请上传立项报告!';
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ // else if (!this.formData.lxpw.length) {
|
|
|
+ // errorText = '请上传立项批文!';
|
|
|
+ // } else if (!this.formData.lxbg.length) {
|
|
|
+ // errorText = '请上传立项报告!';
|
|
|
+ // }
|
|
|
+ else {
|
|
|
let yearAmount = 0;
|
|
|
this.yearList.forEach(year => {
|
|
|
let account = this.formData[year] || 0;
|
|
|
@@ -442,6 +461,7 @@ export default {
|
|
|
let params = deepClone(this.formData);
|
|
|
params.yqcgxs = params.yqcgxs ? params.yqcgxs.join(',') : '';
|
|
|
params.xmjsjjmb = params.xmjsjjmb ? params.xmjsjjmb.join(',') : '';
|
|
|
+ params.xmsqdwid = params.xmsqdwid ? params.xmsqdwid[params.xmsqdwid.length - 1] : '';
|
|
|
params.lxbg = JSON.stringify(params.lxbg);
|
|
|
params.lxpw = JSON.stringify(params.lxpw);
|
|
|
params.qtzl = JSON.stringify(params.qtzl);
|