import { dict, User, baseServer } from '@/api'
import request from '@/utils/require'

// 获取分页列表
export function getPageList(pageData, params) {
	return request({
		url: `${baseServer}/companyPage/${pageData.page}/${pageData.size}`,
		method: 'post',
		data: params
	})
}
export function companyRecordsPage(pageData, params) {
	return request({
		// url: `${baseServer}/companyRecordsPage/${pageData.page}/${pageData.size}`,
		url: `${baseServer}/companyRecordsPage/${pageData.page}/${pageData.size}`,
		method: 'post',
		data: params
	})
}

// 获取企业信息
export function getCompanyInfo(code) {
	return request({
		url: `${baseServer}/company/${code}`,
		method: 'get'
	})
}

// 企业信息更新
export function editCompanyInfo(param) {
	return request({
		url: `${baseServer}/company`,
		method: 'put',
		data: param
	})
}
export function qylxOpts() {
	return request({
		url: `${dict}/dataDictionary/findByGroupId/QYLX`,
		method: 'get'
	})
}

export function dwzyywOpts() {
	return request({
		url: `${dict}/dataDictionary/findByGroupId/43439`,
		method: 'get'
	})
}

export function tree(data) {
	return request({
		url: `${User}/org/tree`,
		method: 'post',
		data: data
	})
}

//地区
export function cityDetain(){
	return request({
		url:`${dict}/dataDictionary/getDataGroup?groupId=AREA_CODE&pdictCode=120000`,
		method:'get'
	})
}
//获取所有省级编号
export function findProvince(data) {
	return request({
		url: `${User}/area/findProvince`,
		method: 'get',
		data: data
	})
}

//根据省编号获取市级编号
export function findCity(data) {
	return request({
		url: `${User}/area/findCity?code=${data}`,
		method: 'get',
		data: data
	})
}

// 根据直辖市级编号获取区编号
export function findCountyQ(data) {
	return request({
		url: `${User}/area/findCountyQ?code=${data}`,
		method: 'get',
		data: data
	})
}
