|
@@ -83,6 +83,8 @@ export class BasicInComponent implements OnInit {
|
|
|
ISBN: FormControl<string>; //国际标准书号
|
|
|
author: FormControl<string>; //第一主编(作者)
|
|
|
unit: FormControl<string>; //第一主编(作者)单位
|
|
|
+ unitType:FormControl<string>//第一主编(作者)单位类型
|
|
|
+
|
|
|
type: FormControl<string>; //申报类型
|
|
|
typeNumber: FormControl<number|any>; //全册次数
|
|
|
|
|
@@ -118,8 +120,8 @@ export class BasicInComponent implements OnInit {
|
|
|
typeNumber: [2],
|
|
|
majorPoniter: ['', [Validators.required]],
|
|
|
lang: ['', [Validators.required]],
|
|
|
- authors: ['', [Validators.required]],
|
|
|
- editor: ['', [Validators.required]],
|
|
|
+ authors: [''],
|
|
|
+ editor: [''],
|
|
|
approval: ['', [Validators.required]],
|
|
|
editionUnit: ['', [Validators.required]],
|
|
|
editionFirst: [new Date(), [Validators.required]],
|
|
@@ -135,6 +137,7 @@ export class BasicInComponent implements OnInit {
|
|
|
// copyrightImgUrl: [''],
|
|
|
// CIPImgUrl: [''],
|
|
|
// remember: [true],
|
|
|
+ unitType:['',[Validators.required]],
|
|
|
});
|
|
|
/** 所属学科专业类显示数量*/
|
|
|
nzOptionOverflowSize=5
|
|
@@ -142,6 +145,25 @@ export class BasicInComponent implements OnInit {
|
|
|
selectList=major.majors.options
|
|
|
//语言选择
|
|
|
selectLang: Array<any> = languages.options;
|
|
|
+ //可选单位类型
|
|
|
+ unitSelects: Array<any> = [
|
|
|
+ {
|
|
|
+ name: '部属高校',
|
|
|
+ code: '部属高校',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '部省合建高校',
|
|
|
+ code: '部省合建高校',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '省部共建高校',
|
|
|
+ code: '省部共建高校',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '其他',
|
|
|
+ code: '其他',
|
|
|
+ },
|
|
|
+ ];
|
|
|
//载体形式
|
|
|
carrierOptions: Array<any> = [
|
|
|
{
|
|
@@ -193,33 +215,30 @@ export class BasicInComponent implements OnInit {
|
|
|
this.importantProject = checkedList.map(item=>item.value)
|
|
|
console.log(this.importantProject)
|
|
|
}
|
|
|
- // importantProjectList: Array<any> = [
|
|
|
- // {
|
|
|
- // title: '首届全国教材建设奖全国优秀教材(高等教育类)',
|
|
|
- // value: '首届全国教材建设奖全国优秀教材(高等教育类)',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // title: '“十二五”普通高等教育本科国家级规划教材',
|
|
|
- // value: '“十二五”普通高等教育本科国家级规划教材',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // title: '“十二五”以来省级优秀教材',
|
|
|
- // value: '“十二五”以来省级优秀教材',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // title: '“十二五”以来省级规划教材',
|
|
|
- // value: '“十二五”以来省级规划教材',
|
|
|
- // },
|
|
|
-
|
|
|
-
|
|
|
- // {
|
|
|
- // title: '其他省部级及以上项目',
|
|
|
- // value: '其他省部级及以上项目',
|
|
|
- // },
|
|
|
- // ];
|
|
|
- // get importantProjectState(){
|
|
|
- // return this.importantProjectList.some((item:any)=> item.value == this.validateForm.value.importantProject)
|
|
|
- // }
|
|
|
+ /* 是否重点立项教材可选列表 */
|
|
|
+ options: Array<any> = [
|
|
|
+ {
|
|
|
+ name: '经中央有关部门审定的教材',
|
|
|
+ code: '经中央有关部门审定的教材',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '首届全国教材建设奖优秀教材(高等教育类)教材',
|
|
|
+ code: '首届全国教材建设奖优秀教材(高等教育类)教材',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '“101计划”核心教材',
|
|
|
+ code: '“101计划”核心教材',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '“四新”重点建设教材(含战略性新兴领域教材)',
|
|
|
+ code: '“四新”重点建设教材(含战略性新兴领域教材)',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '否',
|
|
|
+ code: '否',
|
|
|
+ }
|
|
|
+ ];
|
|
|
+
|
|
|
constructor(
|
|
|
public tbookSer: textbookServer,
|
|
|
private fb: NonNullableFormBuilder,
|
|
@@ -243,7 +262,7 @@ export class BasicInComponent implements OnInit {
|
|
|
}
|
|
|
|
|
|
this.approvedImgList[0].url = this.eduTextbook.get('approvedImgUrl')
|
|
|
- console.log(this.approvedImgList)
|
|
|
+ // console.log(this.approvedImgList)
|
|
|
console.log(this.eduTextbook);
|
|
|
this.validateForm = this.fb.group({
|
|
|
title: [this.eduTextbook?.get('title') || '', [Validators.required]],
|
|
@@ -251,11 +270,11 @@ export class BasicInComponent implements OnInit {
|
|
|
author: [this.eduTextbook?.get('author') || '', [Validators.required]],
|
|
|
unit: [this.eduTextbook?.get('unit') || '', [Validators.required]],
|
|
|
type: [this.eduTextbook?.get('type') || '', [Validators.required]],
|
|
|
- typeNumber: [this.eduTextbook?.get('typeNumber') || 2, [Validators.required]],
|
|
|
+ typeNumber: [this.eduTextbook?.get('typeNumber') || 2],
|
|
|
|
|
|
majorPoniter: [this.eduTextbook?.get('majorPoniter') || '', [Validators.required]],
|
|
|
lang: [this.eduTextbook?.get('lang') || '', [Validators.required]],
|
|
|
- authors: [this.eduTextbook?.get('authors') || '', ],
|
|
|
+ authors: [this.eduTextbook?.get('authors') || ''],
|
|
|
editor: [this.eduTextbook?.get('editor') || '',],
|
|
|
approval: [this.eduTextbook?.get('approval') || '', [Validators.required]],
|
|
|
editionUnit: [this.eduTextbook?.get('editionUnit') || '', [Validators.required]],
|
|
@@ -268,15 +287,17 @@ export class BasicInComponent implements OnInit {
|
|
|
printSum: [this.eduTextbook?.get('printSum') || 0, [Validators.required]],
|
|
|
// importantProject: [this.eduTextbook?.get('importantProject') || '', [Validators.required]],
|
|
|
importantProjectOther: [this.eduTextbook?.get('importantProjectOther') || ''],
|
|
|
- approvedImgUrl: [this.eduTextbook?.get('approvedImgUrl') || '', [Validators.required]],
|
|
|
+ approvedImgUrl: [this.eduTextbook?.get('approvedImgUrl') || ''],
|
|
|
+ unitType: [this.eduTextbook?.get('unitType') || '',[Validators.required]],
|
|
|
+
|
|
|
// copyrightImgUrl: [this.eduTextbook?.get('copyrightImgUrl') || '', [Validators.required]],
|
|
|
// CIPImgUrl: [this.eduTextbook?.get('CIPImgUrl') || '', [Validators.required]],
|
|
|
});
|
|
|
- this.onChangeRadio()
|
|
|
}
|
|
|
- //校验其他省部级及以上项目是否需填
|
|
|
- onChangeRadio(){
|
|
|
+ //校验各项是否需填
|
|
|
+ required(){
|
|
|
// if (this.validateForm.value.importantProject != '其他省部级及以上项目') {
|
|
|
+ //校验其他省部级及以上项目是否需填
|
|
|
if (!this.importantProjectList[4].checked) {
|
|
|
this.validateForm.controls.importantProjectOther.clearValidators();
|
|
|
this.validateForm.controls.importantProjectOther.markAsPristine();
|
|
@@ -285,10 +306,9 @@ export class BasicInComponent implements OnInit {
|
|
|
this.validateForm.controls.importantProjectOther.markAsDirty();
|
|
|
}
|
|
|
this.validateForm.controls.importantProjectOther.updateValueAndValidity();
|
|
|
- }
|
|
|
- //校验全册册数是否需填
|
|
|
- requiredTypeNumber(e:boolean){
|
|
|
- if (e) {
|
|
|
+
|
|
|
+ //校验全册册数是否需填
|
|
|
+ if (this.validateForm.value.type == '单册') {
|
|
|
this.validateForm.controls.typeNumber.clearValidators();
|
|
|
this.validateForm.controls.typeNumber.markAsPristine();
|
|
|
} else {
|
|
@@ -296,7 +316,18 @@ export class BasicInComponent implements OnInit {
|
|
|
this.validateForm.controls.typeNumber.markAsDirty();
|
|
|
}
|
|
|
this.validateForm.controls.typeNumber.updateValueAndValidity();
|
|
|
+
|
|
|
+ //校验教材获批截图是否需填
|
|
|
+ if (!this.validateForm.value.approval || this.validateForm.value.approval == '否') {
|
|
|
+ this.validateForm.controls.approvedImgUrl.clearValidators();
|
|
|
+ this.validateForm.controls.approvedImgUrl.markAsPristine();
|
|
|
+ } else {
|
|
|
+ this.validateForm.controls.approvedImgUrl.setValidators(Validators.required);
|
|
|
+ this.validateForm.controls.approvedImgUrl.markAsDirty();
|
|
|
+ }
|
|
|
+ this.validateForm.controls.approvedImgUrl.updateValueAndValidity();
|
|
|
}
|
|
|
+
|
|
|
upload(e: any, type:string) {
|
|
|
console.log(e);
|
|
|
let file = e[0];
|
|
@@ -306,7 +337,9 @@ export class BasicInComponent implements OnInit {
|
|
|
}
|
|
|
}
|
|
|
async submitForm(event?: string): Promise<void> {
|
|
|
+ this.required()
|
|
|
console.log(this.validateForm.value);
|
|
|
+ console.log(this.validateForm.valid);
|
|
|
if (this.validateForm.valid) {
|
|
|
let params = this.validateForm.value
|
|
|
if(event == 'next'){
|
|
@@ -395,13 +428,8 @@ export class BasicInComponent implements OnInit {
|
|
|
// this.eduTextbook?.set('copyrightImgUrl', params.copyrightImgUrl);
|
|
|
// this.eduTextbook?.set('CIPImgUrl', params.CIPImgUrl);
|
|
|
this.eduTextbook?.set('approvedImgUrl',params.approvedImgUrl)
|
|
|
- // if(this.tbookSer.profile?.user?.department?.objectId){
|
|
|
- // this.eduTextbook?.set('department', {
|
|
|
- // __type: 'Pointer',
|
|
|
- // className: 'Department',
|
|
|
- // objectId: this.tbookSer?.profile?.user?.department?.objectId,
|
|
|
- // });
|
|
|
- // }
|
|
|
+ this.eduTextbook?.set('unitType',params.unitType)
|
|
|
+
|
|
|
await this.eduTextbook?.save();
|
|
|
return
|
|
|
}
|