123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- import {defHttp} from '/@/utils/http/axios';
- import { useMessage } from "/@/hooks/web/useMessage";
- const { createConfirm } = useMessage();
- enum Api {
- list = '/saleCode/saleQuotation/list',
- save='/saleCode/saleQuotation/add',
- edit='/saleCode/saleQuotation/edit',
- deleteOne = '/saleCode/saleQuotation/delete',
- deleteBatch = '/saleCode/saleQuotation/deleteBatch',
- importExcel = '/saleCode/saleQuotation/importExcel',
- exportXls = '/saleCode/saleQuotation/exportXls',
- queryDataById = '/saleCode/saleQuotation/queryById',
- saleQuotationFormShipList = '/saleCode/saleQuotation/querySaleQuotationShipByMainId',
- saleQuotationFormProductList = '/saleCode/saleQuotation/querySaleQuotationProductByMainId',
- submitBatch='/saleCode/saleQuotation/submitBatch',
- cancelSubmitBatch='/saleCode/saleQuotation/returnSubmitBatch',
- supplierList='/cuspCode/cuspSupplierProfile/list?pageSize=-1'
- }
- /**
- * 导出api
- * @param params
- */
- export const getExportUrl = Api.exportXls;
- /**
- * 导入api
- */
- export const getImportUrl = Api.importExcel;
- /**
- * 查询子表数据
- * @param params
- */
- export const querysaleQuotationFormShipListByMainId = (id) => defHttp.get({url: Api.saleQuotationFormShipList, params:{ id }});
- /**
- * 查询子表数据
- * @param params
- */
- export const querySaleQuotationFormProductListByMainId = (id) => defHttp.get({url: Api.saleQuotationFormProductList, params:{ id }});
- /**
- * 列表接口
- * @param params
- */
- export const list = (params) =>
- defHttp.get({url: Api.list, params});
- /**
- * 删除单个
- */
- export const deleteOne = (params,handleSuccess) => {
- return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
- handleSuccess();
- });
- }
- /**
- * 批量删除
- * @param params
- */
- export const batchDelete = (params, handleSuccess) => {
- createConfirm({
- iconType: 'warning',
- title: '确认删除',
- content: '是否删除选中数据',
- okText: '确认',
- cancelText: '取消',
- onOk: () => {
- return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
- handleSuccess();
- });
- }
- });
- }
- /**
- * 保存或者更新
- * @param params
- */
- export const saveOrUpdate = (params, isUpdate) => {
- let url = isUpdate ? Api.edit : Api.save;
- return defHttp.post({url: url, params});
- }
- //
- /**
- * 根据id查询数据
- * @param params
- */
- export const queryDataById = (id) => defHttp.get({url: Api.queryDataById, params:{ id }});
- // 提交
- export const batchSubmit = (params, handleSuccess) => {
- createConfirm({
- iconType: 'warning',
- title: '确认提交',
- content: '是否提交选中数据',
- okText: '确认',
- cancelText: '取消',
- onOk: () => {
- return defHttp.get({url: Api.submitBatch, params}, {joinParamsToUrl: true}).then(() => {
- handleSuccess();
- });
- }
- });
- }
- // 取消提交
- export const cancelBatchSubmit = (params, handleSuccess) => {
- createConfirm({
- iconType: 'warning',
- title: '确认取消提交',
- content: '是否取消提交选中数据',
- okText: '确认',
- cancelText: '取消',
- onOk: () => {
- return defHttp.get({url: Api.cancelSubmitBatch, params}, {joinParamsToUrl: true}).then(() => {
- handleSuccess();
- });
- }
- });
- }
- //获取供应商列表
- export const supplierOption = (params) => defHttp.get({url: Api.supplierList, params});
|