|
@@ -272,6 +272,11 @@ export class TextbookComponent implements OnInit {
|
|
|
async submit(data?: Parse.Object) {
|
|
|
let parentMap = await this.tbookSer.formatNode(this.tbookSer?.profile?.user?.department?.objectId);
|
|
|
console.log(parentMap);
|
|
|
+ let processId = await this.getEduProcess(parentMap[1]?.key)
|
|
|
+ if(!processId){
|
|
|
+ this.message.warning('你的申报单位暂无进行的流程')
|
|
|
+ return
|
|
|
+ }
|
|
|
this.modal.confirm({
|
|
|
nzTitle: '提交教材',
|
|
|
nzContent: `提交后在已提交评审教材中查看`,
|
|
@@ -286,6 +291,11 @@ export class TextbookComponent implements OnInit {
|
|
|
data.set('render', true);
|
|
|
data.set('status', '200');
|
|
|
data.set('code', t);
|
|
|
+ data.set('eduProcess',{
|
|
|
+ __type: 'Pointer',
|
|
|
+ className: 'EduProcess',
|
|
|
+ objectId:processId
|
|
|
+ });
|
|
|
if(parentMap[1]?.key){
|
|
|
data.set('department', {
|
|
|
__type: 'Pointer',
|
|
@@ -306,6 +316,11 @@ export class TextbookComponent implements OnInit {
|
|
|
item.set('render', true);
|
|
|
item.set('status', '200');
|
|
|
item.set('code', t);
|
|
|
+ item.set('eduProcess',{
|
|
|
+ __type: 'Pointer',
|
|
|
+ className: 'EduProcess',
|
|
|
+ objectId:processId
|
|
|
+ });
|
|
|
if(parentMap[1]?.key){
|
|
|
item.set('department', {
|
|
|
__type: 'Pointer',
|
|
@@ -326,6 +341,18 @@ export class TextbookComponent implements OnInit {
|
|
|
nzOnCancel: () => console.log('Cancel'),
|
|
|
});
|
|
|
}
|
|
|
+ async getEduProcess(id:string):Promise<string|undefined>{
|
|
|
+ if(!id) return
|
|
|
+ let query = new Parse.Query('EduProcess')
|
|
|
+ query.equalTo('department',id)
|
|
|
+ query.lessThanOrEqualTo('startDate',new Date())
|
|
|
+ query.greaterThan('deadline',new Date())
|
|
|
+ query.notEqualTo('isDeleted',true)
|
|
|
+ query.notEqualTo('status','100')
|
|
|
+ query.select('objectId')
|
|
|
+ let res = await query.first()
|
|
|
+ return res?.id
|
|
|
+ }
|
|
|
toUrl(url: string, param?: Object) {
|
|
|
console.log(url);
|
|
|
if (param) {
|