no message

main
HUOJIN\92525 2025-04-07 18:10:04 +08:00
parent bf817f5b46
commit 13a87ca391
7 changed files with 655 additions and 256 deletions

View File

@ -0,0 +1,48 @@
/**
* Task api
*
* @Author:
* @Date: 2024-12-03 17:08:30
* @Copyright
*/
import {postRequest,getRequest} from '/@/lib/axios';
export const taskApi = {
/**
* @author
*/
queryPage: (param: object) => {
return postRequest('/task/queryPage', param);
},
/**
* @author
*/
add: (param: object) => {
return postRequest('/task/add', param);
},
/**
* @author
*/
update: (param: object) => {
return postRequest('/task/update', param);
},
/**
* @author
*/
delete: (id: number) => {
return getRequest('/task/delete', id);
},
/**
* @author
*/
batchDelete: (idList: number[]) => {
return postRequest('/task/batchDelete', idList);
},
};

View File

@ -0,0 +1,11 @@
/**
* Task
*
* @Author:
* @Date: 2024-12-03 17:08:30
* @Copyright
*/
export default {
};

View File

@ -27,7 +27,7 @@ export const appDefaultConfig: AppConfig = {
// 菜单主题 // 菜单主题
sideMenuTheme: 'dark', sideMenuTheme: 'dark',
// 主题颜色索引 // 主题颜色索引
colorIndex: 0, colorIndex: 1,
// 顶部菜单页面宽度 // 顶部菜单页面宽度
pageWidth: '99%', pageWidth: '99%',
// 圆角 // 圆角
@ -41,11 +41,11 @@ export const appDefaultConfig: AppConfig = {
// 页脚 // 页脚
footerFlag: true, footerFlag: true,
// 帮助文档 // 帮助文档
helpDocFlag: true, helpDocFlag: false,
// 帮助文档默认展开 // 帮助文档默认展开
helpDocExpandFlag: true, helpDocExpandFlag: true,
// 水印 // 水印
watermarkFlag: true, watermarkFlag: false,
// 网站名称 // 网站名称
websiteName: 'SmartAdmin 3.X', websiteName: 'SmartAdmin 3.X',
// 主题颜色 // 主题颜色

View File

@ -47,6 +47,7 @@ export const TABLE_ID_CONST = {
RECEIVE:{ RECEIVE:{
ASN:businessRECEIVEInitTableId+1,//入库单 ASN:businessRECEIVEInitTableId+1,//入库单
ASN_DETAIL:businessRECEIVEInitTableId+2,//入库明细 ASN_DETAIL:businessRECEIVEInitTableId+2,//入库明细
ASN_TASK:businessRECEIVEInitTableId+3,//入库详情
} }
}, },

View File

@ -87,6 +87,7 @@
<ReceiveDetailList :asnId="form.asnId"/> <ReceiveDetailList :asnId="form.asnId"/>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="asnTask" tab="收货详情"> <a-tab-pane key="asnTask" tab="收货详情">
<AsnTaskList :asnId="form.asnId"/>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="dataTracer" tab="操作记录"> <a-tab-pane key="dataTracer" tab="操作记录">
<DataTracer :dataId="form.asnId" :type="DATA_TRACER_TYPE_ENUM.OA_ENTERPRISE.value"/> <DataTracer :dataId="form.asnId" :type="DATA_TRACER_TYPE_ENUM.OA_ENTERPRISE.value"/>
@ -110,6 +111,7 @@ import {SmartLoading} from "/@/components/framework/smart-loading";
import {asnApi} from "/@/api/business/receive/asn/asn-api"; import {asnApi} from "/@/api/business/receive/asn/asn-api";
import {smartSentry} from "/@/lib/smart-sentry"; import {smartSentry} from "/@/lib/smart-sentry";
import ReceiveDetailList from "/@/views/business/receive/asn/receive-detail-list.vue"; import ReceiveDetailList from "/@/views/business/receive/asn/receive-detail-list.vue";
import AsnTaskList from "/@/views/business/receive/asnTask/asn-task-list.vue";
// //
const formRef = ref(); const formRef = ref();

View File

@ -10,18 +10,18 @@
<a-form class="smart-query-form"> <a-form class="smart-query-form">
<a-row class="smart-query-form-row"> <a-row class="smart-query-form-row">
<a-form-item label="物料" class="smart-query-form-item"> <a-form-item label="物料" class="smart-query-form-item">
<a-input style="width: 200px" v-model:value="queryForm.itemId" placeholder="物料" /> <a-input style="width: 200px" v-model:value="queryForm.itemId" placeholder="物料"/>
</a-form-item> </a-form-item>
<a-form-item class="smart-query-form-item"> <a-form-item class="smart-query-form-item">
<a-button type="primary" @click="onSearch"> <a-button type="primary" @click="onSearch" class="smart-margin-left10">
<template #icon> <template #icon>
<SearchOutlined /> <SearchOutlined/>
</template> </template>
查询 查询
</a-button> </a-button>
<a-button @click="resetQuery" class="smart-margin-left10"> <a-button @click="resetQuery" class="smart-margin-left10">
<template #icon> <template #icon>
<ReloadOutlined /> <ReloadOutlined/>
</template> </template>
重置 重置
</a-button> </a-button>
@ -36,19 +36,20 @@
<div class="smart-table-operate-block"> <div class="smart-table-operate-block">
<a-button @click="showForm" type="primary" size="small"> <a-button @click="showForm" type="primary" size="small">
<template #icon> <template #icon>
<PlusOutlined /> <PlusOutlined/>
</template> </template>
新建 新建
</a-button> </a-button>
<a-button @click="confirmBatchDelete" type="primary" danger size="small" :disabled="selectedRowKeyList.length == 0"> <a-button @click="confirmBatchDelete" type="primary" danger size="small"
:disabled="selectedRowKeyList.length == 0">
<template #icon> <template #icon>
<DeleteOutlined /> <DeleteOutlined/>
</template> </template>
批量删除 批量删除
</a-button> </a-button>
</div> </div>
<div class="smart-table-setting-block"> <div class="smart-table-setting-block">
<TableOperator v-model="columns" :tableId="null" :refresh="queryData" /> <TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.RECEIVE.ASN_DETAIL" :refresh="queryData"/>
</div> </div>
</a-row> </a-row>
<!---------- 表格操作行 end -----------> <!---------- 表格操作行 end ----------->
@ -110,18 +111,19 @@
</a-card> </a-card>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref, onMounted } from 'vue'; import {reactive, ref, onMounted} from 'vue';
import { message, Modal } from 'ant-design-vue'; import {message, Modal} from 'ant-design-vue';
import { SmartLoading } from '/@/components/framework/smart-loading'; import {SmartLoading} from '/@/components/framework/smart-loading';
import { asnDetailApi } from '/@/api/business/receive/asnDetail/asn-detail-api'; import {asnDetailApi} from '/@/api/business/receive/asnDetail/asn-detail-api';
import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const'; import {PAGE_SIZE_OPTIONS} from '/@/constants/common-const';
import { smartSentry } from '/@/lib/smart-sentry'; import {smartSentry} from '/@/lib/smart-sentry';
import TableOperator from '/@/components/support/table-operator/index.vue'; import TableOperator from '/@/components/support/table-operator/index.vue';
import AsnDetailForm from '/@/views/business/receive/asnDetail/asn-detail-form.vue'; import AsnDetailForm from '/@/views/business/receive/asnDetail/asn-detail-form.vue';
import {TABLE_ID_CONST} from "/@/constants/support/table-id-const";
// ---------------------------- ---------------------------- // ---------------------------- ----------------------------
const columns = ref([ const columns = ref([
{ {
title: '入库明细id', title: '入库明细id',
dataIndex: 'asnDetailId', dataIndex: 'asnDetailId',
@ -153,40 +155,40 @@
fixed: 'right', fixed: 'right',
width: 90, width: 90,
}, },
]); ]);
// ---------------------------- ---------------------------- // ---------------------------- ----------------------------
const queryFormState = { const queryFormState = {
itemId: undefined, // itemId: undefined, //
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
}; };
// form // form
const queryForm = reactive({ ...queryFormState }); const queryForm = reactive({...queryFormState});
// loading // loading
const tableLoading = ref(false); const tableLoading = ref(false);
// //
const tableData = ref([]); const tableData = ref([]);
// //
const total = ref(0); const total = ref(0);
// //
function resetQuery() { function resetQuery() {
let pageSize = queryForm.pageSize; let pageSize = queryForm.pageSize;
Object.assign(queryForm, queryFormState); Object.assign(queryForm, queryFormState);
queryForm.pageSize = pageSize; queryForm.pageSize = pageSize;
queryData(); queryData();
} }
// //
function onSearch(){ function onSearch() {
queryForm.pageNum = 1; queryForm.pageNum = 1;
queryData(); queryData();
} }
// //
async function queryData() { async function queryData() {
tableLoading.value = true; tableLoading.value = true;
try { try {
let queryResult = await asnDetailApi.queryPage(queryForm); let queryResult = await asnDetailApi.queryPage(queryForm);
@ -197,21 +199,21 @@
} finally { } finally {
tableLoading.value = false; tableLoading.value = false;
} }
} }
onMounted(queryData); onMounted(queryData);
// ---------------------------- / ---------------------------- // ---------------------------- / ----------------------------
const formRef = ref(); const formRef = ref();
function showForm(data) { function showForm(data) {
formRef.value.show(data); formRef.value.show(data);
} }
// ---------------------------- ---------------------------- // ---------------------------- ----------------------------
// //
function onDelete(data){ function onDelete(data) {
Modal.confirm({ Modal.confirm({
title: '提示', title: '提示',
content: '确定要删除选吗?', content: '确定要删除选吗?',
@ -221,12 +223,13 @@
requestDelete(data); requestDelete(data);
}, },
cancelText: '取消', cancelText: '取消',
onCancel() {}, onCancel() {
},
}); });
} }
// //
async function requestDelete(data){ async function requestDelete(data) {
SmartLoading.show(); SmartLoading.show();
try { try {
let deleteForm = { let deleteForm = {
@ -234,25 +237,25 @@
}; };
await asnDetailApi.delete(data.asnDetailId); await asnDetailApi.delete(data.asnDetailId);
message.success('删除成功'); message.success('删除成功');
queryData(); await queryData();
} catch (e) { } catch (e) {
smartSentry.captureError(e); smartSentry.captureError(e);
} finally { } finally {
SmartLoading.hide(); SmartLoading.hide();
} }
} }
// ---------------------------- ---------------------------- // ---------------------------- ----------------------------
// //
const selectedRowKeyList = ref([]); const selectedRowKeyList = ref([]);
function onSelectChange(selectedRowKeys) { function onSelectChange(selectedRowKeys) {
selectedRowKeyList.value = selectedRowKeys; selectedRowKeyList.value = selectedRowKeys;
} }
// //
function confirmBatchDelete() { function confirmBatchDelete() {
Modal.confirm({ Modal.confirm({
title: '提示', title: '提示',
content: '确定要批量删除这些数据吗?', content: '确定要批量删除这些数据吗?',
@ -262,21 +265,22 @@
requestBatchDelete(); requestBatchDelete();
}, },
cancelText: '取消', cancelText: '取消',
onCancel() {}, onCancel() {
},
}); });
} }
// //
async function requestBatchDelete() { async function requestBatchDelete() {
try { try {
SmartLoading.show(); SmartLoading.show();
await asnDetailApi.batchDelete(selectedRowKeyList.value); await asnDetailApi.batchDelete(selectedRowKeyList.value);
message.success('删除成功'); message.success('删除成功');
queryData(); await queryData();
} catch (e) { } catch (e) {
smartSentry.captureError(e); smartSentry.captureError(e);
} finally { } finally {
SmartLoading.hide(); SmartLoading.hide();
} }
} }
</script> </script>

View File

@ -0,0 +1,333 @@
<!--
* 入库明细
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-08-15 20:15:49
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net Since 2012
-->
<template>
<div>
<div class="header">
<div>
关键字
<a-input style="width: 250px" v-model:value="queryForm.keyword" placeholder="姓名/手机号/登录账号"/>
<a-button class="button-style" type="primary" @click="onSearch"></a-button>
<a-button class="button-style" type="default" @click="resetQuery"></a-button>
</div>
<div class="smart-table-setting-block">
<a-button class="button-style" type="primary" v-privilege="'receive:batchReturn'" @click="confirmBatchReceive"
:disabled="props.asnId==0 || selectedRowKeyList.length == 0">
<template #icon>
<EditOutlined/>
</template>
批量退货
</a-button>
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.RECEIVE.ASN_TASK" :refresh="queryData"/>
</div>
</div>
<a-table
:loading="tableLoading"
:dataSource="tableData"
:columns="columns"
:pagination="false"
rowKey="asnDetailId"
:row-selection="{ selectedRowKeys: selectedRowKeyList, onChange: onSelectChange }"
size="small"
bordered
>
<template #bodyCell="{ text, record, index, column }">
<template v-if="column.dataIndex === 'action'">
<div class="smart-table-operate">
<a-button @click="showForm(record)" type="link" :disabled="record.orderQuantity-record.receivedQuantity==0"
v-privilege="'asnDetail:update'">
<template #icon>
<EditOutlined/>
</template>
编辑
</a-button>
<a-button @click="onDelete(record)" danger type="link"
:disabled="record.orderQuantity-record.receivedQuantity==0" v-privilege="'asnDetail:delete'">
<template #icon>
<DeleteOutlined/>
</template>
删除
</a-button>
</div>
</template>
</template>
</a-table>
<div class="smart-query-table-page">
<a-pagination
showSizeChanger
showQuickJumper
show-less-items
:pageSizeOptions="PAGE_SIZE_OPTIONS"
:defaultPageSize="queryForm.pageSize"
v-model:current="queryForm.pageNum"
v-model:pageSize="queryForm.pageSize"
:total="total"
@change="queryData"
@showSizeChange="queryData"
:show-total="(total:number) => `共${total}条`"
/>
</div>
<!--新建/编辑-->
<AsnDetailForm ref="formRef" @reloadList="queryData"/>
</div>
</template>
<script setup lang="ts">
import _ from 'lodash';
import {reactive, ref, watch} from 'vue';
import {PAGE_SIZE, PAGE_SIZE_OPTIONS} from '/@/constants/common-const';
import {smartSentry} from '/@/lib/smart-sentry';
import {TABLE_ID_CONST} from "/@/constants/support/table-id-const";
import TableOperator from "/@/components/support/table-operator/index.vue";
import {asnDetailApi} from "/@/api/business/receive/asnDetail/asn-detail-api";
import {taskApi} from "/@/api/business/task/task-api";
import {receiveApi} from "/@/api/business/receive/receive-api";
import AsnDetailForm from "/@/views/business/receive/asnDetail/asn-detail-form.vue";
import {message, Modal} from "ant-design-vue";
import {SmartLoading} from '/@/components/framework/smart-loading';
const props = defineProps({
asnId: {
type: Number,
default: 0,
},
});
const columns = reactive([
{
title: '任务ID',
dataIndex: 'taskId',
ellipsis: true,
},
{
title: '物料编码',
dataIndex: 'itemCode',
ellipsis: true,
},
{
title: '物料名称',
dataIndex: 'itemName',
ellipsis: true,
},
{
title: '原库位',
dataIndex: 'srcLocationCode',
ellipsis: true,
},
{
title: '目标库位',
dataIndex: 'dstLocationCode',
ellipsis: true,
},
{
title: '收货数量',
dataIndex: 'moveQty',
ellipsis: true,
},
{
title: '操作',
dataIndex: 'action',
width: 140,
},
]);
// --------------------------- ---------------------------
const defaultQueryForm = {
pageNum: 1,
pageSize: PAGE_SIZE,
asnId: 0,
keyword: undefined,
}
//
const queryForm = reactive({...defaultQueryForm});
// loading
const tableLoading = ref(false);
//
const tableData = ref([]);
//
const total = ref(0);
//
function resetQuery() {
let pageSize = queryForm.pageSize;
Object.assign(queryForm, defaultQueryForm);
queryForm.pageSize = pageSize;
queryData();
}
//
function onSearch() {
queryForm.pageNum = 1;
queryData();
}
//
async function queryData() {
tableLoading.value = true;
try {
queryForm.asnId = props.asnId;
let queryResult = await taskApi.queryPage(queryForm);
tableData.value = queryResult.data.list;
total.value = queryResult.data.total;
} catch (e) {
smartSentry.captureError(e);
} finally {
tableLoading.value = false;
}
}
//
const selectedRowKeyList = ref([]);
function onSelectChange(selectedRowKeys: any) {
selectedRowKeyList.value = selectedRowKeys;
}
///
const formRef = ref();
function showForm(data: object) {
formRef.value.show(data, props.asnId);
}
//
function onDelete(data: object) {
Modal.confirm({
title: '提示',
content: '确定要删除选吗?',
okText: '删除',
okType: 'danger',
onOk() {
requestDelete(data);
},
cancelText: '取消',
onCancel() {
},
});
}
//
async function requestDelete(data: any) {
SmartLoading.show();
try {
const response = await asnDetailApi.delete(data.asnDetailId);
const {error, success} = JSON.parse(response.msg);
if (error) {
message.error(error);
}
if (success) {
message.success(success);
}
await queryData();
} catch (e) {
smartSentry.captureError(e);
} finally {
SmartLoading.hide();
}
}
//
function confirmBatchDelete() {
Modal.confirm({
title: '提示',
content: '确定要批量删除这些数据吗?',
okText: '删除',
okType: 'danger',
onOk() {
requestBatchDelete();
},
cancelText: '取消',
onCancel() {
},
});
}
//
async function requestBatchDelete() {
try {
SmartLoading.show();
const response = await asnDetailApi.batchDelete(selectedRowKeyList.value);
const {error, success} = JSON.parse(response.msg);
if (error) {
message.error(error);
}
if (success) {
message.success(success);
}
await queryData();
} catch (e) {
smartSentry.captureError(e);
} finally {
SmartLoading.hide();
}
}
// confirmBatchReceive
function confirmBatchReceive() {
Modal.confirm({
title: '提示',
content: '确定是否批量收货?',
okText: '确认',
okType: 'danger',
onOk() {
requestBatchReceive();
},
cancelText: '取消',
onCancel() {
},
});
}
//
async function requestBatchReceive() {
try {
SmartLoading.show();
const response = await receiveApi.batchReceive(selectedRowKeyList.value);
const {error, success} = JSON.parse(response.msg);
if (error) {
message.error(error);
}
if (success) {
message.success(success);
}
await queryData();
} catch (e) {
smartSentry.captureError(e);
} finally {
SmartLoading.hide();
}
}
watch(
() => props.asnId,
(e) => {
if (e) {
queryData();
}
},
{immediate: true}
);
</script>
<style scoped lang="less">
.header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px
}
.button-style {
margin-left: 10px;
}
</style>