no message
parent
a4eb09b017
commit
4761f7036d
|
|
@ -1,12 +1,12 @@
|
|||
import {defHttp} from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/receive/asn/list',
|
||||
save='/receive/asn/add',
|
||||
edit='/receive/asn/edit',
|
||||
save = '/receive/asn/add',
|
||||
edit = '/receive/asn/edit',
|
||||
deleteOne = '/receive/asn/delete',
|
||||
deleteBatch = '/receive/asn/deleteBatch',
|
||||
importExcel = '/receive/asn/importExcel',
|
||||
|
|
@ -15,7 +15,9 @@ enum Api {
|
|||
asnDetailList = '/receive/asn/queryAsnDetailByMainId',
|
||||
receiveAsn = '/receive/asn/receiveAsn',
|
||||
receiveBack = '/receive/asn/receiveBack',
|
||||
closeAsn = '/receive/asn/closeAsn',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
|
|
@ -31,23 +33,26 @@ export const getImportUrl = Api.importExcel;
|
|||
* 查询子表数据
|
||||
* @param params
|
||||
*/
|
||||
export const queryAsnDetailListByMainId = (id) => defHttp.get({url: Api.asnDetailList, params:{ id }});
|
||||
export const queryAsnDetailListByMainId = (id) =>
|
||||
defHttp.get({
|
||||
url: Api.asnDetailList,
|
||||
params: { id },
|
||||
});
|
||||
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) =>
|
||||
defHttp.get({url: Api.list, 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(() => {
|
||||
export const deleteOne = (params, handleSuccess) => {
|
||||
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
|
|
@ -60,33 +65,41 @@ export const batchDelete = (params, handleSuccess) => {
|
|||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
return defHttp
|
||||
.delete(
|
||||
{
|
||||
url: Api.deleteBatch,
|
||||
data: params,
|
||||
},
|
||||
{ joinParamsToUrl: true }
|
||||
)
|
||||
.then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
const url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({url: url, params});
|
||||
}
|
||||
return defHttp.post({ url: url, params });
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据id查询数据
|
||||
* @param params
|
||||
*/
|
||||
export const queryDataById = (id) => defHttp.get({url: Api.queryDataById, params:{ id }});
|
||||
* 根据id查询数据
|
||||
* @param params
|
||||
*/
|
||||
export const queryDataById = (id) => defHttp.get({ url: Api.queryDataById, params: { id } });
|
||||
|
||||
/**
|
||||
* 整单入库
|
||||
* @param params
|
||||
*/
|
||||
export const receiveAsn = (id,handleSuccess) => {
|
||||
return defHttp.get({ url: Api.receiveAsn, params: { id } }, { joinParamsToUrl: true }).then(() => {
|
||||
export const receiveAsn = (id, handleSuccess) => {
|
||||
return defHttp.get({ url: Api.receiveAsn, params: { id } }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
|
|
@ -95,8 +108,18 @@ export const receiveAsn = (id,handleSuccess) => {
|
|||
* 回传
|
||||
* @param params
|
||||
*/
|
||||
export const receiveBack = (id,handleSuccess) => {
|
||||
return defHttp.get({ url: Api.receiveBack, params: { id } }, { joinParamsToUrl: true }).then(() => {
|
||||
export const receiveBack = (id, handleSuccess) => {
|
||||
return defHttp.get({ url: Api.receiveBack, params: { id } }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 出库单关闭
|
||||
* @param params
|
||||
*/
|
||||
export const closeAsn = (ids, handleSuccess) => {
|
||||
return defHttp.get({ url: Api.closeAsn, params: { ids } }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -17,12 +17,11 @@
|
|||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12">
|
||||
<a-form-item name="status_MultiString" :labelCol="{ span: 2 }" :wrapperCol="{ span: 20 }" >
|
||||
<a-form-item name="status_MultiString" :labelCol="{ span: 2 }" :wrapperCol="{ span: 20 }">
|
||||
<template #label><span title="状态">状态</span></template>
|
||||
<JSelectMultiple v-model:value="queryParam.status_MultiString" dictCode="asn_status" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
|
|
@ -74,6 +73,16 @@
|
|||
>
|
||||
入库回传
|
||||
</a-button>
|
||||
<a-button
|
||||
type="warning"
|
||||
:loading="closeAsn_loading"
|
||||
:disabled="selectedRowKeys.length === 0"
|
||||
v-auth="'receive:data_asn:closeAsn'"
|
||||
@click="handleCloseAsn"
|
||||
preIcon="ant-design:edit-outlined"
|
||||
>
|
||||
手工关单
|
||||
</a-button>
|
||||
|
||||
<a-button type="primary" v-auth="'receive:data_asn:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出 </a-button>
|
||||
<j-upload-button
|
||||
|
|
@ -119,7 +128,7 @@
|
|||
import { useModal } from '/@/components/Modal';
|
||||
import AsnModal from './components/AsnModal.vue';
|
||||
import { columns } from './Asn.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, receiveAsn, receiveBack } from './Asn.api';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, receiveAsn, receiveBack, closeAsn } from './Asn.api';
|
||||
import { getDateByPicker } from '/@/utils';
|
||||
import { JInputTypeEnum } from '@/enums/cpteEnum';
|
||||
import { JInput, JDictSelectTag } from '@/components/Form';
|
||||
|
|
@ -301,6 +310,34 @@
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 关单事件
|
||||
*/
|
||||
const closeAsn_loading = ref(false);
|
||||
|
||||
async function handleCloseAsn() {
|
||||
// 选中的数据中状态有1、2、3 返回true,否则返回false
|
||||
const validStatuses = [1, 2, 3];
|
||||
const allValidStatus = selectedRows.value.every((row: any) => validStatuses.includes(row.status));
|
||||
if (!allValidStatus) {
|
||||
return createMessage.error('【已创建、部分收货、收货完成】状态的入库单才允许关单');
|
||||
}
|
||||
if (closeAsn_loading.value) {
|
||||
return;
|
||||
}
|
||||
// 设置加载状态,防止重复提交
|
||||
closeAsn_loading.value = true;
|
||||
try {
|
||||
await closeAsn(selectedRowKeys.value, handleSuccess);
|
||||
} catch (e) {
|
||||
console.error('关单失败:', e);
|
||||
handleSuccess();
|
||||
} finally {
|
||||
// 重置加载状态
|
||||
closeAsn_loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -290,10 +290,16 @@ export const taskColumns: JVxeColumn[] = [
|
|||
title: '请求报文',
|
||||
key: 'reqMessage',
|
||||
type: JVxeTypes.normal,
|
||||
formatter: ({ cellValue }) => {
|
||||
return render.renderTip(cellValue);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '返回报文',
|
||||
key: 'resMessage',
|
||||
type: JVxeTypes.normal,
|
||||
formatter: ({ cellValue }) => {
|
||||
return render.renderTip(cellValue);
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in New Issue