import { baseServer, dict} from '@/api/index'
import fetch from '@/utils/require'

//分页列表
export function getPageList(pageForm, data) {
	return fetch({
		url: `${baseServer}/shouGouQyBa/selectPageByEntity?pageNum=${pageForm.pageNum}&pageSize=${pageForm.pageSize}`,
		method: 'post',
		data: data
	})
}

// 编辑
export function editData(data) {
	return fetch({
		url: `${baseServer}/shouGouQyBa/save`,
		method: 'post',
		data: data
	})
}
//查询详情
export function getDetail(id) {
	return fetch({
		url: `${baseServer}/shouGouQyBa/getById?id=${id}`,
		method: 'get'
	})
}

// 删除
export function removeData(id) {
    return fetch({
        url: `${baseServer}/shouGouQyBa/remove?id=${id}`,
        method: 'post'
    })
}

// 字典(所在行政区)
export function findByPDictCode(pdictCode) {
    return fetch({
        url: `${dict}/dataDictionary/findByPDictCode/${pdictCode}`,
        method: 'get'
    })
}

// 列表导出
export function exportByObject(data) {
	return fetch({
		url: `${baseServer}/shouGouQyBa/exportByEntity?qymc=${data.qymc}&barq=${data.barq}&szxzqy=${data.szxzqy}&cjdw=${data.cjdw}&sjzt=${data.sjzt}`,
		method: 'post',
        responseType: 'blob' // 申明为文件流
	})
}

