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

export function insert(data) {
    return request({
        url: `${transaction}/turnoverdata/insertTurnoverData`,
        method: 'post',
        data: data
    })
}
export function update(data) {
    return request({
        url: `${transaction}/turnoverdata/updateTurnoverData`,
        method: 'post',
        data: data
    })
}
export function del(data) {
    return request({
        url: `${transaction}/turnoverdata/deleteTurnoverData`,
        method: 'post',
        data: data
    })
}
export function detail(data) {
    return request({
        url: `${transaction}/turnoverdata/selectTurnoverDataDetail`,
        method: 'post',
        data: data
    })
}
export function updatestate(data) {
    return request({
        url: `${transaction}/turnoverdata/updateTurnoverDataState`,
        method: 'post',
        data: data
    })
}
export function list(data) {
    let { pageNum, pageSize } = data
    delete data.pageNum
    delete data.pageSize
    return request({
        url: `${transaction}/turnoverdata/selectTurnoverDataPageList?pageNum=${pageNum}&pageSize=${pageSize}`,
        method: 'post',
        data: data
    })
}
// 获取计算公式和基础值
export function getconfig(code) {
    return request({
        url: `${User}/config/fingParaConfigList/${code}`,
        method: 'get'
    })
}
// 获取标的列表
export function getTransactions() {
    return request({
        url: `${transaction}/trademark/selectDetail`,
        method: 'post',
        data: {}
    })
}
// 获取省份列表
export function province() {
    return request({
        url: `${User}/area/findProvince`,
        method: 'get'
    })
}

// 库点列表
export function sinkpointList() {
    return request({
        url: `${baseServer}/sinkpointList`,
        method: 'post',
        data: {}
    })
}



// // 获取全部仓号列表
export function warehouseList() {
    return request({
        url: `${baseServer}/warehouseList`,
        method: 'post',
        data: {}
    })
}
// /warehouseListByKddm/{kddm}
// 仓房信息-根据库点代码获取仓房列表
export function warehouseListByKddm(kddm) {
    return request({
        url: `${baseServer}/warehouseListByKddm/${kddm}`,
        method: 'post',
    })
}

// 合同列表
export function contractInformationList(data) {
    return request({
        url: `${baseServer}/contractList`,
        method: 'post',
        data: {}
    })
}

// 品种
export function varietys(pdictCode) {
    return request({
        // url: `${dict}/dataDictionary/findByPDictCode/${pdictCode}`,
        url: `${dict}/dataDictionary/findByPDictCode/11`,
        method: 'get'
    })
}
//等级下拉框
export function lsdj(groupId) {
    return request({
        url: `${dict}/dataDictionary/findByGroupId/LSDJ`,
        //   url: `${dict}/dataDictionary/findByGroupId/${groupId}`,
        method: 'get'
    })
}
// 粮食性质
export function lsxz(groupId) {
    return request({
        url: `${dict}/dataDictionary/findByGroupId/LSXZ`,
        //   url: `${dict}/dataDictionary/findByGroupId/${groupId}`,
        method: 'get'
    })
}