no message
parent
a4eb09b017
commit
4761f7036d
|
|
@ -1,5 +1,5 @@
|
||||||
import { defHttp } from '/@/utils/http/axios';
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
import { useMessage } from "/@/hooks/web/useMessage";
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
|
||||||
const { createConfirm } = useMessage();
|
const { createConfirm } = useMessage();
|
||||||
|
|
||||||
|
|
@ -15,7 +15,9 @@ enum Api {
|
||||||
asnDetailList = '/receive/asn/queryAsnDetailByMainId',
|
asnDetailList = '/receive/asn/queryAsnDetailByMainId',
|
||||||
receiveAsn = '/receive/asn/receiveAsn',
|
receiveAsn = '/receive/asn/receiveAsn',
|
||||||
receiveBack = '/receive/asn/receiveBack',
|
receiveBack = '/receive/asn/receiveBack',
|
||||||
|
closeAsn = '/receive/asn/closeAsn',
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出api
|
* 导出api
|
||||||
* @param params
|
* @param params
|
||||||
|
|
@ -31,14 +33,17 @@ export const getImportUrl = Api.importExcel;
|
||||||
* 查询子表数据
|
* 查询子表数据
|
||||||
* @param params
|
* @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
|
* @param params
|
||||||
*/
|
*/
|
||||||
export const list = (params) =>
|
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||||
defHttp.get({url: Api.list, params});
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除单个
|
* 删除单个
|
||||||
|
|
@ -47,7 +52,7 @@ export const deleteOne = (params,handleSuccess) => {
|
||||||
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
/**
|
/**
|
||||||
* 批量删除
|
* 批量删除
|
||||||
* @param params
|
* @param params
|
||||||
|
|
@ -60,12 +65,20 @@ export const batchDelete = (params, handleSuccess) => {
|
||||||
okText: '确认',
|
okText: '确认',
|
||||||
cancelText: '取消',
|
cancelText: '取消',
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
return defHttp
|
||||||
|
.delete(
|
||||||
|
{
|
||||||
|
url: Api.deleteBatch,
|
||||||
|
data: params,
|
||||||
|
},
|
||||||
|
{ joinParamsToUrl: true }
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
/**
|
/**
|
||||||
* 保存或者更新
|
* 保存或者更新
|
||||||
* @param params
|
* @param params
|
||||||
|
|
@ -73,7 +86,7 @@ export const batchDelete = (params, handleSuccess) => {
|
||||||
export const saveOrUpdate = (params, isUpdate) => {
|
export const saveOrUpdate = (params, isUpdate) => {
|
||||||
const url = isUpdate ? Api.edit : Api.save;
|
const url = isUpdate ? Api.edit : Api.save;
|
||||||
return defHttp.post({ url: url, params });
|
return defHttp.post({ url: url, params });
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询数据
|
* 根据id查询数据
|
||||||
|
|
@ -100,3 +113,13 @@ export const receiveBack = (id,handleSuccess) => {
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库单关闭
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const closeAsn = (ids, handleSuccess) => {
|
||||||
|
return defHttp.get({ url: Api.closeAsn, params: { ids } }, { joinParamsToUrl: true }).then(() => {
|
||||||
|
handleSuccess();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@
|
||||||
<JSelectMultiple v-model:value="queryParam.status_MultiString" dictCode="asn_status" />
|
<JSelectMultiple v-model:value="queryParam.status_MultiString" dictCode="asn_status" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row :gutter="24">
|
<a-row :gutter="24">
|
||||||
<a-col :lg="6">
|
<a-col :lg="6">
|
||||||
|
|
@ -74,6 +73,16 @@
|
||||||
>
|
>
|
||||||
入库回传
|
入库回传
|
||||||
</a-button>
|
</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>
|
<a-button type="primary" v-auth="'receive:data_asn:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出 </a-button>
|
||||||
<j-upload-button
|
<j-upload-button
|
||||||
|
|
@ -119,7 +128,7 @@
|
||||||
import { useModal } from '/@/components/Modal';
|
import { useModal } from '/@/components/Modal';
|
||||||
import AsnModal from './components/AsnModal.vue';
|
import AsnModal from './components/AsnModal.vue';
|
||||||
import { columns } from './Asn.data';
|
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 { getDateByPicker } from '/@/utils';
|
||||||
import { JInputTypeEnum } from '@/enums/cpteEnum';
|
import { JInputTypeEnum } from '@/enums/cpteEnum';
|
||||||
import { JInput, JDictSelectTag } from '@/components/Form';
|
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: '请求报文',
|
title: '请求报文',
|
||||||
key: 'reqMessage',
|
key: 'reqMessage',
|
||||||
type: JVxeTypes.normal,
|
type: JVxeTypes.normal,
|
||||||
|
formatter: ({ cellValue }) => {
|
||||||
|
return render.renderTip(cellValue);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '返回报文',
|
title: '返回报文',
|
||||||
key: 'resMessage',
|
key: 'resMessage',
|
||||||
type: JVxeTypes.normal,
|
type: JVxeTypes.normal,
|
||||||
|
formatter: ({ cellValue }) => {
|
||||||
|
return render.renderTip(cellValue);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue