/*
 *    Copyright (c) 2018-2025, hnqz All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: hnqz
 */

import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/admin/wmtask/page',
    method: 'get',
    params: query
  })
}

export function fetchAuditList(query) {
  return request({
    url: '/admin/wmtask/pageAudit',
    method: 'get',
    params: query
  })
}


export function taskExportYq(query) {
  return request({
    url: '/admin/wmtask/exportTask',
    responseType: 'arraybuffer',
    method: 'get',
    params: query
  })
}

export function taskExportNbqybg(query) {
  return request({
    url: '/admin/export/exportNb',
    method: 'get',
    params: query
  })
}


export function taskExportZbbg(query) {
  return request({
    url: '/admin/export/exportZb',
    method: 'get',
    params: query
  })
}


export function taskExportNbqybgInfo(query) {
  return request({
    url: '/admin/export/exportNbInfo',
    method: 'get',
    params: query
  })
}

export function taskExportZbqybgInfo(query) {
  return request({
    url: '/admin/export/exportZbInfo',
    method: 'get',
    params: query
  })
}


export function infoExportNbqybgInfo(query) {
  return request({
    url: '/admin/export/infoExportNbqybgInfo',
    method: 'get',
    params: query
  })
}

export function infoExportJsInfo(query) {
  return request({
    url: '/admin/export/infoExportJsInfo',
    method: 'get',
    params: query
  })
}

export function fetchSubList(query) {
  return request({
    url: '/admin/wmtask/pageSum',
    method: 'get',
    params: query
  })
}


export function fetchListYq(query) {
  return request({
    url: '/admin/wmtask/pageYq',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/admin/wmtask',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/admin/wmtask/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/admin/wmtask/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/admin/wmtask',
    method: 'put',
    data: obj
  })
}


export function wmTaskList(obj) {
  return request({
    url: '/admin/wmtask/wmTaskList',
    method: 'get',
    params: obj
  })
}


export function getTotalScore(obj) {
  return request({
    url: '/admin/wmtask/getTotalScore',
    method: 'get',
    params: obj
  })
}


export function submitTask(obj) {
  return request({
    url: '/admin/wmtask/submitTask',
    method: 'post',
    params: obj
  })
}

export function auditList(obj) {
  return request({
    url: '/admin/wmtask/auditList',
    method: 'post',
    params: obj
  })
}


export function getHTaskInfo(obj) {
  return request({
    url: '/admin/wmtask/getHTaskInfo',
    method: 'get',
    params: obj
  })
}


export function pageExtList(query) {
  return request({
    url: '/admin/wmtask/pageExtList',
    method: 'get',
    params: query
  })
}

// 审核详情-药店信息
export function approvalHospital(query) {
  return request({
    url: '/admin/wmdahospital/approvalHospital',
    method: 'get',
    params: query
  })
}

// 审核详情-公司商业信息
export function approvalDistribution(query) {
  return request({
    url: '/admin/wmdadistribution/approvalDistribution',
    method: 'get',
    params: query
  })
}

// 审核详情-药店信息
export function approvalPharmacy(query) {
  return request({
    url: '/admin/wmdapharmacy/approvalPharmacy',
    method: 'get',
    params: query
  })
}


// 审核提交-医院审核-第一次提交
export function updateByapproval(obj) {
  return request({
    url: '/admin/wmdahospital/updateByapproval',
    method: 'post',
    data: obj
  })
}


// 审核提交-商业公司-第一次提交
export function businessApproval(obj) {
  return request({
    url: '/admin/wmdadistribution/updateByApproval',
    method: 'post',
    data: obj
  })
}



// 审核提交-药店信息
export function pharmacyApprova(obj) {
  return request({
    url: '/admin/wmdapharmacy/updateByApproval',
    method: 'post',
    data: obj
  })
}

// 审核提交-药店调查信息查询
export function entYddc(query) {
  return request({
    url: '/admin/dict/type/ent_yddc',
    method: 'get',
    params: query
  })
}



// 报告导出-列表查询
export function getExportPackageZbTotalList(query) {
  return request({
    url: '/admin/reportExport/getExportPackageZbTotalList',
    method: 'get',
    params: query
  })
}

// 报告导出-查看列表
export function getExportPackageZbTaskList(query) {
  return request({
    url: '/admin/reportExport/getExportPackageZbTaskList',
    method: 'get',
    params: query
  })
}

// 报告导出-导出汇总报告/导出报告详情
export function exportZbReport(query) {
  return request({
    url: '/admin/reportExport/exportZbReport',
    method: 'get',
    params: query
  })
}
export function exportExcelZbReport(query) {
  return request({
    url: '/admin/report/excel/export/exportZbReport',
    method: 'get',
    params: query
  })
}

// 报告导出-批量导出-上次导出状态

export function exportZbStatus(query) {
  return request({
    url: '/admin/reportExport/exportZbReport/status',
    method: 'get',
    params: query
  })
}

export function exportExcelZbStatus(query) {
  return request({
    url: '/admin/report/excel/export/exportZbReport/status',
    method: 'get',
    params: query
  })
}

export function allExportStatus(query) {
  return request({
    url: '/admin/reportExport/all-personal-report-status',
    method: 'get',
    params: query
  })
}




