You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
117 lines
5.0 KiB
117 lines
5.0 KiB
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { |
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } |
|
return new (P || (P = Promise))(function (resolve, reject) { |
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } |
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } |
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } |
|
step((generator = generator.apply(thisArg, _arguments || [])).next()); |
|
}); |
|
}; |
|
import { requestGet, requestOptions, requestPost, requestTableList, } from '@component/utils'; |
|
import { reduce, isEmpty, concat } from 'lodash'; |
|
//服务申请管理列表 |
|
export const getList = (params) => { |
|
return requestTableList(process.env.REACT_APP_SERVICE_URL, '/serviceApply/getPageList', params); |
|
}; |
|
//获取aq标准服务活动、服务方式 |
|
export function getAqServiceStandard(params) { |
|
return requestOptions(process.env.REACT_APP_SERVICE_URL, '/serviceType/getAqServiceStandard', params, ['id', 'aqServiceName']); |
|
} |
|
//获取服务活动列表 |
|
export function getServiceType(params) { |
|
return requestOptions(process.env.REACT_APP_SERVICE_URL, '/serviceScheme/getServiceType', params, ['serviceTypeId', 'serviceTypeName']); |
|
} |
|
//服务申请与报告补录获取价格接口 |
|
export function getPriceListByOrgan(params) { |
|
return requestOptions(process.env.REACT_APP_SERVICE_URL, '/serviceScheme/getListByOrgan', params, ['id', 'name']); |
|
} |
|
//服务申请管理新增 |
|
export function onCreate(params) { |
|
return requestPost(process.env.REACT_APP_SERVICE_URL, '/serviceApply/createServiceApply', params); |
|
} |
|
//服务申请管理重新提交 |
|
export function editServiceApply(params) { |
|
return requestPost(process.env.REACT_APP_SERVICE_URL, '/serviceApply/editServiceApply', params); |
|
} |
|
//服务申请管理暂存 |
|
export function saveServiceApply(params) { |
|
return requestPost(process.env.REACT_APP_SERVICE_URL, '/serviceApply/tsServiceApply', params); |
|
} |
|
//获取一级管理分类列表 |
|
export function getIndustryList(params = {}) { |
|
return requestGet(process.env.REACT_APP_API_URL, '/industry/list', params).then((data) => { |
|
return data === null || data === void 0 ? void 0 : data.map((item) => { |
|
return { |
|
id: item.industryId, |
|
pId: 0, |
|
value: item.industryId, |
|
title: item.industryName, |
|
label: item.industryName, |
|
isLeaf: false, |
|
checkable: false, |
|
}; |
|
}); |
|
}); |
|
} |
|
//创建服务选择保单接口详细描述 |
|
export function getPolicyList(params) { |
|
const _params = Object.assign({}, params); |
|
if (_params === null || _params === void 0 ? void 0 : _params.current) { |
|
_params.pageNum = _params.current; |
|
Reflect.deleteProperty(_params, 'current'); |
|
} |
|
function getMapData(params, path) { |
|
return __awaiter(this, void 0, void 0, function* () { |
|
const COUNT = 2000; |
|
try { |
|
function getData(params) { |
|
return requestGet(process.env.REACT_APP_BUSINESS_URL, path, Object.assign(Object.assign({}, params), { pageSize: COUNT })); |
|
} |
|
const result = yield getData(params); |
|
const list = result || []; |
|
// const pages = result?.pages; |
|
if (isEmpty(list)) { |
|
return []; |
|
} |
|
const requestArray = []; |
|
return Promise.allSettled(requestArray).then((values) => { |
|
return reduce(values, (result, item) => { |
|
return concat(result, item.value); |
|
}, list); |
|
}); |
|
} |
|
catch (e) { |
|
return []; |
|
} |
|
}); |
|
} |
|
return getMapData(_params, '/policy/choicePolicyLimit').then((data) => { |
|
if (isEmpty(data)) { |
|
return { |
|
success: true, |
|
total: 0, |
|
data: [], |
|
}; |
|
} |
|
return { |
|
success: true, |
|
total: (data === null || data === void 0 ? void 0 : data.length) || 0, |
|
data: data, |
|
}; |
|
}); |
|
} |
|
//选择保单 |
|
export const getPolicyDetail = (params) => { |
|
return requestGet(process.env.REACT_APP_BUSINESS_URL, 'policy/show', params); |
|
}; |
|
export const getServiceApply = (params) => { |
|
return requestTableList(process.env.REACT_APP_SERVICE_URL, `/serviceApply/getServiceObjList`, params); |
|
}; |
|
//获取保单地址 |
|
export function getPolicyAddress(params) { |
|
return requestOptions(process.env.REACT_APP_BUSINESS_URL, `/policyAddressDtl/list`, params, ['dtl_id', 'address']); |
|
} |
|
//服务申请管理详情 |
|
export const getDetail = (params) => { |
|
return requestGet(process.env.REACT_APP_SERVICE_URL, `/serviceApply/getServiceApply/${params.id}`, ''); |
|
};
|
|
|