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

export function list(data) {
	return request({
		url: `${baseServer}/companyPage/${data.pageNum}/${data.pageSize}`,
		method: 'post',
		data: data
	})
}

export function company(tyshxydm) {
	return request({
		url: `${baseServer}/company/${tyshxydm}`,
		method: 'get'
	})
}

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


// 获取分页列表
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}`,
		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: `${loginUrl}/org/tree`,
// 		method: 'post',
// 		data: data
// 	})
// }

export function getZcd(data) {
	return request({
		url: `${User}/area/findCity?code=${data.code}`,
		method: 'get',
	})
}
