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

@ -13,7 +13,7 @@
<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>
@ -40,7 +40,8 @@
</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>
@ -48,7 +49,7 @@
</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 ----------->
@ -118,6 +119,7 @@
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";
// ---------------------------- ---------------------------- // ---------------------------- ----------------------------
@ -221,7 +223,8 @@
requestDelete(data); requestDelete(data);
}, },
cancelText: '取消', cancelText: '取消',
onCancel() {}, onCancel() {
},
}); });
} }
@ -234,7 +237,7 @@
}; };
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 {
@ -262,7 +265,8 @@
requestBatchDelete(); requestBatchDelete();
}, },
cancelText: '取消', cancelText: '取消',
onCancel() {}, onCancel() {
},
}); });
} }
@ -272,7 +276,7 @@
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 {

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>