/*
 * @Description  :
 * @Version      : 1.0
 * @Author       : Shiming
 * @Date         : 2022-01-04 21:05:49
 * @LastEditors  : Shiming
 * @LastEditTime : 2022-02-24 10:00:59
 * @FilePath     : \\tms-obc-web\\src\\app\\routes\\contract-management\\services\\contract-management.service.ts
 * Copyright (C) 2022 huzhenhong. All rights reserved.
 */
import { Injectable, Injector } from '@angular/core';
import { BaseService } from 'src/app/shared/services';

@Injectable({
  providedIn: 'root'
})
export class ContractManagementService extends BaseService {
  $api_get_getPremiumInformationPage = `/api/sdc/billOperate/listPremiumInformationPage`;
  // 查询投诉列表
  $api_get_operate_listPage = `/api/sdc/complaint/operate/listPage`;
  // 新增/更新信息
  $api_save_contractTemplate = `/api/sdc/contractTemplate/save`;
  // 查询合同模板表
  $api_get_contractTemplate_page = `/api/sdc/contractTemplate/list/page`;
  // 查询合同模板表详情
  $api_get_contractTemplate = `/api/sdc/contractTemplate/get`;
  // 删除合同模板
  $api_deletebatch_contractTemplate = `/api/sdc/contractTemplate/deletebatch`;

  // 查询明细合同
  $api_listDetailed_page = `/api/sdc/contract/listDetailed/page`;
  // 查询框架合同
  $api_listFrame_page = `/api/sdc/contract/listFrame/page`;
  // 查询合伙人合同
  $api_listPartner_page = `/api/sdc/contract/listPartner/page`;
  // 获取订单合同表
  $api_contract_get = `/api/sdc/contract/get`;

  // 发起E签宝跟据合同ID
  $api_startTheProcessToESignById = `/api/sdc/contract/startTheProcessToESignById`;
  constructor(public injector: Injector) {
    super(injector);
  }

  StartTheProcessToESignById(id: string, callback: () => void) {
    this.request(this.$api_startTheProcessToESignById, { id }).subscribe(res => {
      if (res) {
        callback();
      }
    });
  }
}
