|
@@ -45,6 +45,41 @@ export class BasicComponent implements OnInit {
|
|
|
/** 所属教材id*/
|
|
|
@Input('eduTextbookId') eduTextbookId: string | any
|
|
|
|
|
|
+ validateForm: FormGroup<{
|
|
|
+ ISBN: FormControl<number>; //国际标准书号
|
|
|
+ author: FormControl<string>; //第一主编(作者)
|
|
|
+ unit: FormControl<string>; //第一主编(作者)单位
|
|
|
+ unitType: FormControl<string>//第一主编(作者)单位类型
|
|
|
+ lang: FormControl<string>; //教材主要语种类型
|
|
|
+ authors: FormControl<string>; //其他主编姓名
|
|
|
+ editor: FormControl<string>; //其他编者姓名
|
|
|
+ editionUnit: FormControl<string>; //出版单位
|
|
|
+ editionFirst: FormControl<Date>; //初版时间
|
|
|
+ carrierShape: FormControl<string>; //载体形式
|
|
|
+ editionDate: FormControl<Date>; //出版时间
|
|
|
+ editionNumber: FormControl<number>; //出版版次
|
|
|
+ printDate: FormControl<Date>; //最新印次时间
|
|
|
+ printNumber: FormControl<number>; //最新印次
|
|
|
+ printSum: FormControl<number>; //初版以来合计印数
|
|
|
+ importantProjectOther: FormControl<string>; //其他省部级及以上项目
|
|
|
+ }> = this.fb.group({
|
|
|
+ ISBN: [0, [Validators.required]],
|
|
|
+ author: ['', [Validators.required]],
|
|
|
+ unit: ['', [Validators.required]],
|
|
|
+ lang: ['', [Validators.required]],
|
|
|
+ authors: [''],
|
|
|
+ editor: [''],
|
|
|
+ editionUnit: ['', [Validators.required]],
|
|
|
+ editionFirst: [new Date(), [Validators.required]],
|
|
|
+ carrierShape: ['', [Validators.required]],
|
|
|
+ editionDate: [new Date(), [Validators.required]],
|
|
|
+ editionNumber: [1, [Validators.required]],
|
|
|
+ printDate: [new Date(), [Validators.required]],
|
|
|
+ printNumber: [1, [Validators.required]],
|
|
|
+ printSum: [1, [Validators.required]],
|
|
|
+ importantProjectOther: [''],
|
|
|
+ unitType: ['', [Validators.required]],
|
|
|
+ });
|
|
|
|
|
|
|
|
|
|
|
@@ -59,11 +94,11 @@ export class BasicComponent implements OnInit {
|
|
|
ngOnInit() { }
|
|
|
/**获取扩展分册记录 */
|
|
|
async getEduTextbookVolume() {
|
|
|
- console.log('传递的分册id'+this.eduTextbookVolumeId)
|
|
|
+ console.log('传递的分册id: '+this.eduTextbookVolumeId)
|
|
|
if (this.eduTextbookVolumeId) {
|
|
|
let query = new Parse.Query('EduTextbookVolume')
|
|
|
this.eduTextbookVolume = await query.get(this.eduTextbookVolumeId)
|
|
|
- console.log(this.eduTextbookVolume);
|
|
|
+ // console.log(this.eduTextbookVolume);
|
|
|
} else {
|
|
|
console.log("分册id未传递")
|
|
|
}
|
|
@@ -81,35 +116,51 @@ export class BasicComponent implements OnInit {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- this.validateForm = this.fb.group({
|
|
|
- ISBN: [parseInt(this.eduTextbookVolume?.get('ISBN') || '') || null, [Validators.required]],
|
|
|
- author: [this.eduTextbookVolume?.get('author') || '', [Validators.required]],
|
|
|
- unit: [this.eduTextbookVolume?.get('unit') || '', [Validators.required]],
|
|
|
- lang: [this.eduTextbookVolume?.get('lang') || '', [Validators.required]],
|
|
|
- authors: [this.eduTextbookVolume?.get('authors') || ''],
|
|
|
- editor: [this.eduTextbookVolume?.get('editor') || '',],
|
|
|
- editionUnit: [this.eduTextbookVolume?.get('editionUnit') || '', [Validators.required]],
|
|
|
- editionFirst: [this.eduTextbookVolume?.get('editionFirst') || new Date(), [Validators.required]],
|
|
|
- carrierShape: [this.eduTextbookVolume?.get('carrierShape') || '', [Validators.required]],
|
|
|
- editionDate: [this.eduTextbookVolume?.get('editionDate') || new Date(), [Validators.required]],
|
|
|
- editionNumber: [this.eduTextbookVolume?.get('editionNumber') || 1, [Validators.required]],
|
|
|
- printDate: [this.eduTextbookVolume?.get('printDate') || new Date(), [Validators.required]],
|
|
|
- printNumber: [this.eduTextbookVolume?.get('printNumber') || 1, [Validators.required]],
|
|
|
- printSum: [this.eduTextbookVolume?.get('printSum') || 1, [Validators.required]],
|
|
|
- importantProjectOther: [this.eduTextbookVolume?.get('importantProjectOther') || ''],
|
|
|
- unitType: [this.eduTextbookVolume?.get('unitType') || '', [Validators.required]],
|
|
|
- });
|
|
|
+ // this.validateForm = this.fb.group({
|
|
|
+ // ISBN: [parseInt(this.eduTextbookVolume?.get('ISBN')) || null, [Validators.required]],
|
|
|
+ // author: [this.eduTextbookVolume?.get('author') || '', [Validators.required]],
|
|
|
+ // unit: [this.eduTextbookVolume?.get('unit') || '', [Validators.required]],
|
|
|
+ // lang: [this.eduTextbookVolume?.get('lang') || '', [Validators.required]],
|
|
|
+ // authors: [this.eduTextbookVolume?.get('authors') || ''],
|
|
|
+ // editor: [this.eduTextbookVolume?.get('editor') || '',],
|
|
|
+ // editionUnit: [this.eduTextbookVolume?.get('editionUnit') || '', [Validators.required]],
|
|
|
+ // editionFirst: [this.eduTextbookVolume?.get('editionFirst') || new Date(), [Validators.required]],
|
|
|
+ // carrierShape: [this.eduTextbookVolume?.get('carrierShape') || '', [Validators.required]],
|
|
|
+ // editionDate: [this.eduTextbookVolume?.get('editionDate') || new Date(), [Validators.required]],
|
|
|
+ // editionNumber: [this.eduTextbookVolume?.get('editionNumber') || 1, [Validators.required]],
|
|
|
+ // printDate: [this.eduTextbookVolume?.get('printDate') || new Date(), [Validators.required]],
|
|
|
+ // printNumber: [this.eduTextbookVolume?.get('printNumber') || 1, [Validators.required]],
|
|
|
+ // printSum: [this.eduTextbookVolume?.get('printSum') || 1, [Validators.required]],
|
|
|
+ // importantProjectOther: [this.eduTextbookVolume?.get('importantProjectOther') || ''],
|
|
|
+ // unitType: [this.eduTextbookVolume?.get('unitType') || '', [Validators.required]],
|
|
|
+ // });
|
|
|
+ this.validateForm.get("ISBN")?.setValue(Number(this.eduTextbookVolume?.get('ISBN')))
|
|
|
+ this.validateForm.get("author")?.setValue(this.eduTextbookVolume?.get('author'))
|
|
|
+ this.validateForm.get("unit")?.setValue(this.eduTextbookVolume?.get('unit'))
|
|
|
+ this.validateForm.get("lang")?.setValue(this.eduTextbookVolume?.get('lang'))
|
|
|
+ this.validateForm.get("authors")?.setValue(this.eduTextbookVolume?.get('authors'))
|
|
|
+ this.validateForm.get("editor")?.setValue(this.eduTextbookVolume?.get('editor'))
|
|
|
+ this.validateForm.get("editionUnit")?.setValue(this.eduTextbookVolume?.get('editionUnit'))
|
|
|
+ this.validateForm.get("editionFirst")?.setValue(this.eduTextbookVolume?.get('editionFirst'))
|
|
|
+ this.validateForm.get("carrierShape")?.setValue(this.eduTextbookVolume?.get('carrierShape'))
|
|
|
+ this.validateForm.get("editionDate")?.setValue(this.eduTextbookVolume?.get('editionDate'))
|
|
|
+ this.validateForm.get("editionNumber")?.setValue(this.eduTextbookVolume?.get('editionNumber'))
|
|
|
+ this.validateForm.get("printDate")?.setValue(this.eduTextbookVolume?.get('printDate'))
|
|
|
+ this.validateForm.get("printNumber")?.setValue(this.eduTextbookVolume?.get('printNumber'))
|
|
|
+ this.validateForm.get("printSum")?.setValue(this.eduTextbookVolume?.get('printSum'))
|
|
|
+ this.validateForm.get("importantProjectOther")?.setValue(this.eduTextbookVolume?.get('importantProjectOther'))
|
|
|
+ this.validateForm.get("unitType")?.setValue(this.eduTextbookVolume?.get('unitType'))
|
|
|
}
|
|
|
public isComlpete:boolean = false //填写是否完整
|
|
|
- async submitForm(eduTextbookId?:any) {
|
|
|
- console.log('执行了分册组件的save方法',eduTextbookId)
|
|
|
+ async submitForm(eduTextbookId?:any):Promise<string|undefined> {
|
|
|
+ // console.log('执行了分册组件的save方法',eduTextbookId)
|
|
|
if((!this.eduTextbookId)&&(!eduTextbookId)){
|
|
|
this.msg.create('error','出错了,教材id未获取')
|
|
|
return
|
|
|
}
|
|
|
let params = this.validateForm.value
|
|
|
this.changeImportantProject()
|
|
|
- console.log(params);
|
|
|
+ console.log('ISBN:',params.ISBN );
|
|
|
if (!this.eduTextbookVolume) {
|
|
|
let obj = Parse.Object.extend('EduTextbookVolume');
|
|
|
this.eduTextbookVolume = new obj();
|
|
@@ -178,42 +229,6 @@ export class BasicComponent implements OnInit {
|
|
|
return current < new Date(2022, 11, 1)
|
|
|
}
|
|
|
|
|
|
- validateForm: FormGroup<{
|
|
|
- ISBN: FormControl<any>; //国际标准书号
|
|
|
- author: FormControl<string>; //第一主编(作者)
|
|
|
- unit: FormControl<string>; //第一主编(作者)单位
|
|
|
- unitType: FormControl<string>//第一主编(作者)单位类型
|
|
|
- lang: FormControl<string>; //教材主要语种类型
|
|
|
- authors: FormControl<string>; //其他主编姓名
|
|
|
- editor: FormControl<string>; //其他编者姓名
|
|
|
- editionUnit: FormControl<string>; //出版单位
|
|
|
- editionFirst: FormControl<Date>; //初版时间
|
|
|
- carrierShape: FormControl<string>; //载体形式
|
|
|
- editionDate: FormControl<Date>; //出版时间
|
|
|
- editionNumber: FormControl<number>; //出版版次
|
|
|
- printDate: FormControl<Date>; //最新印次时间
|
|
|
- printNumber: FormControl<number>; //最新印次
|
|
|
- printSum: FormControl<number>; //初版以来合计印数
|
|
|
- importantProjectOther: FormControl<string>; //其他省部级及以上项目
|
|
|
- }> = this.fb.group({
|
|
|
- ISBN: [null, [Validators.required]],
|
|
|
- author: ['', [Validators.required]],
|
|
|
- unit: ['', [Validators.required]],
|
|
|
- lang: ['', [Validators.required]],
|
|
|
- authors: [''],
|
|
|
- editor: [''],
|
|
|
- editionUnit: ['', [Validators.required]],
|
|
|
- editionFirst: [new Date(), [Validators.required]],
|
|
|
- carrierShape: ['', [Validators.required]],
|
|
|
- editionDate: [new Date(), [Validators.required]],
|
|
|
- editionNumber: [1, [Validators.required]],
|
|
|
- printDate: [new Date(), [Validators.required]],
|
|
|
- printNumber: [1, [Validators.required]],
|
|
|
- printSum: [1, [Validators.required]],
|
|
|
- importantProjectOther: [''],
|
|
|
- unitType: ['', [Validators.required]],
|
|
|
- });
|
|
|
-
|
|
|
//语言选择
|
|
|
selectLang: Array<any> = languages.options;
|
|
|
//可选单位类型
|
|
@@ -284,7 +299,7 @@ export class BasicComponent implements OnInit {
|
|
|
changeImportantProject() {
|
|
|
let checkedList = this.importantProjectList.filter(item => item.checked) || []
|
|
|
this.importantProject = checkedList.map(item => item.value)
|
|
|
- console.log(this.importantProject)
|
|
|
+ // console.log(this.importantProject)
|
|
|
}
|
|
|
|
|
|
|