no message
parent
fcd12d7be5
commit
5374bb5e0a
|
|
@ -0,0 +1,76 @@
|
|||
import { BasicColumn } from '/@/components/Table';
|
||||
import { render } from '@/utils/common/renderUtils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '任务ID',
|
||||
align: 'center',
|
||||
width: '170px',
|
||||
dataIndex: 'id',
|
||||
},
|
||||
{
|
||||
title: '容器',
|
||||
align: 'center',
|
||||
width: '120px',
|
||||
dataIndex: 'carrierCode',
|
||||
},
|
||||
{
|
||||
title: '业务类型',
|
||||
align: 'center',
|
||||
width: '120px',
|
||||
dataIndex: 'type_dictText',
|
||||
},
|
||||
{
|
||||
title: '任务状态',
|
||||
align: 'center',
|
||||
width: '120px',
|
||||
dataIndex: 'status_dictText',
|
||||
customRender: ({ text }) => {
|
||||
//入库状态:已创建、已审核、收货中、收货完成、已关闭、已取消。
|
||||
const statusColorMap = {
|
||||
已创建: 'orange',
|
||||
执行中: 'cyan',
|
||||
已到达: 'blue',
|
||||
已完成: 'green',
|
||||
已取消: 'red',
|
||||
};
|
||||
const color = statusColorMap[text] || 'red';
|
||||
return render.renderTag(text, color);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '起点',
|
||||
align: 'center',
|
||||
width: '120px',
|
||||
dataIndex: 'startCode',
|
||||
},
|
||||
{
|
||||
title: '终点',
|
||||
align: 'center',
|
||||
width: '120px',
|
||||
dataIndex: 'endCode',
|
||||
},
|
||||
{
|
||||
title: '优先级',
|
||||
align: 'center',
|
||||
width: '60px',
|
||||
dataIndex: 'priority',
|
||||
},
|
||||
{
|
||||
title: '供应商',
|
||||
align: 'center',
|
||||
width: '80px',
|
||||
dataIndex: 'agvVendor_dictText',
|
||||
},
|
||||
{
|
||||
title: '返回报文',
|
||||
align: 'center',
|
||||
dataIndex: 'resMessage',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
align: 'center',
|
||||
dataIndex: 'createTime',
|
||||
sorter: true,
|
||||
},
|
||||
];
|
||||
|
|
@ -3,17 +3,25 @@
|
|||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
</a-row>
|
||||
<a-row :gutter="24"></a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'agvTask:data_agv_task:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" v-auth="'agvTask:data_agv_task:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||
<j-upload-button type="primary" v-auth="'agvTask:data_agv_task:importExcel'" v-show="false" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||
<a-button type="primary" v-auth="'agvTask:data_agv_task:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增 </a-button>
|
||||
<a-button type="primary" v-auth="'agvTask:data_agv_task:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls">
|
||||
导出
|
||||
</a-button>
|
||||
<j-upload-button
|
||||
type="primary"
|
||||
v-auth="'agvTask:data_agv_task:importExcel'"
|
||||
v-show="false"
|
||||
preIcon="ant-design:import-outlined"
|
||||
@click="onImportXls"
|
||||
>导入
|
||||
</j-upload-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
|
|
@ -23,41 +31,40 @@
|
|||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button v-auth="'agvTask:data_agv_task:deleteBatch'">批量操作
|
||||
<a-button v-auth="'agvTask:data_agv_task:deleteBatch'"
|
||||
>批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }"></template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<AgvTaskModal ref="registerModal" @success="handleSuccess"></AgvTaskModal>
|
||||
<HikAgvModal ref="registerModal" @success="handleSuccess"></HikAgvModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="agvTask-agvTask" setup>
|
||||
<script lang="ts" name="agvTask" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './AgvTask.data';
|
||||
import { columns } from './HikAgv.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './AgvTask.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import AgvTaskModal from './components/AgvTaskModal.vue'
|
||||
import HikAgvModal from './components/HikAgvModal.vue';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import {useModal} from '/@/components/Modal';
|
||||
import { getDateByPicker } from '/@/utils';
|
||||
|
||||
const fieldPickers = reactive({
|
||||
});
|
||||
const fieldPickers = reactive({});
|
||||
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const queryParam = reactive<any>({
|
||||
agvVendor: 'HIK',
|
||||
});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const userStore = useUserStore();
|
||||
|
|
@ -68,7 +75,7 @@
|
|||
title: 'AGV任务表',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:true,
|
||||
canResize: true,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
|
|
@ -84,21 +91,22 @@
|
|||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "AGV任务表",
|
||||
name: 'AGV任务表',
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess,
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] =
|
||||
tableContext;
|
||||
const labelCol = reactive({
|
||||
xs:24,
|
||||
sm:4,
|
||||
xl:6,
|
||||
xxl:4
|
||||
xs: 24,
|
||||
sm: 4,
|
||||
xl: 6,
|
||||
xxl: 4,
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
|
|
@ -158,7 +166,7 @@
|
|||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'agvTask:data_agv_task:edit'
|
||||
auth: 'agvTask:data_agv_task:edit',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
|
@ -171,16 +179,17 @@
|
|||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'agvTask:data_agv_task:delete'
|
||||
}
|
||||
]
|
||||
auth: 'agvTask:data_agv_task:delete',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -199,35 +208,35 @@
|
|||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
padding: 0;
|
||||
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 24px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.query-group-cust{
|
||||
|
||||
.query-group-cust {
|
||||
min-width: 100px !important;
|
||||
}
|
||||
.query-group-split-cust{
|
||||
|
||||
.query-group-split-cust {
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
text-align: center
|
||||
text-align: center;
|
||||
}
|
||||
.ant-form-item:not(.ant-form-item-with-help){
|
||||
|
||||
.ant-form-item:not(.ant-form-item-with-help) {
|
||||
margin-bottom: 16px;
|
||||
height: 32px;
|
||||
}
|
||||
:deep(.ant-picker),:deep(.ant-input-number){
|
||||
|
||||
:deep(.ant-picker),
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
|
@ -39,13 +39,7 @@ export const columns: BasicColumn[] = [
|
|||
}
|
||||
},
|
||||
{
|
||||
title: '起点',
|
||||
align: "center",
|
||||
width: '120px',
|
||||
dataIndex: 'startCode'
|
||||
},
|
||||
{
|
||||
title: '终点',
|
||||
title: '目标库位',
|
||||
align: "center",
|
||||
width: '120px',
|
||||
dataIndex: 'endCode'
|
||||
|
|
@ -56,6 +50,12 @@ export const columns: BasicColumn[] = [
|
|||
width: '60px',
|
||||
dataIndex: 'priority'
|
||||
},
|
||||
{
|
||||
title: '供应商',
|
||||
align: 'center',
|
||||
width: '90px',
|
||||
dataIndex: 'agvVendor_dictText',
|
||||
},
|
||||
{
|
||||
title: '返回报文',
|
||||
align: "center",
|
||||
|
|
@ -0,0 +1,243 @@
|
|||
<template>
|
||||
<div class="p-2">
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24"></a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'agvTask:data_agv_task:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增 </a-button>
|
||||
<a-button type="primary" v-auth="'agvTask:data_agv_task:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls">
|
||||
导出
|
||||
</a-button>
|
||||
<j-upload-button
|
||||
type="primary"
|
||||
v-auth="'agvTask:data_agv_task:importExcel'"
|
||||
v-show="false"
|
||||
preIcon="ant-design:import-outlined"
|
||||
@click="onImportXls"
|
||||
>导入
|
||||
</j-upload-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button v-auth="'agvTask:data_agv_task:deleteBatch'"
|
||||
>批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }"></template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<TesAgvModal ref="registerModal" @success="handleSuccess"></TesAgvModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="agvTask" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns } from './TesAgv.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './AgvTask.api';
|
||||
import TesAgvModal from './components/TesAgvModal.vue';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDateByPicker } from '/@/utils';
|
||||
|
||||
const fieldPickers = reactive({});
|
||||
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({
|
||||
agvVendor: 'TES',
|
||||
});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const userStore = useUserStore();
|
||||
const { createMessage } = useMessage();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: 'TES任务表',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: true,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
for (let key in fieldPickers) {
|
||||
if (queryParam[key] && fieldPickers[key]) {
|
||||
queryParam[key] = getDateByPicker(queryParam[key], fieldPickers[key]);
|
||||
}
|
||||
}
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: 'AGV任务表',
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess,
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] =
|
||||
tableContext;
|
||||
const labelCol = reactive({
|
||||
xs: 24,
|
||||
sm: 4,
|
||||
xl: 6,
|
||||
xxl: 4,
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
});
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'agvTask:data_agv_task:edit',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'agvTask:data_agv_task:delete',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
padding: 0;
|
||||
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 24px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.query-group-cust {
|
||||
min-width: 100px !important;
|
||||
}
|
||||
|
||||
.query-group-split-cust {
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ant-form-item:not(.ant-form-item-with-help) {
|
||||
margin-bottom: 16px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
:deep(.ant-picker),
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -89,7 +89,7 @@
|
|||
id: '',
|
||||
carrierCode: '',
|
||||
carrierType: 'TRAY',
|
||||
taskType: 'PF-LMR-COMMON',
|
||||
taskType: '',
|
||||
type: '',
|
||||
status: 'CREATED',
|
||||
priority: 99,
|
||||
|
|
@ -105,7 +105,6 @@
|
|||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
carrierCode: [{ required: true, message: '请选择容器!'},],
|
||||
taskType: [{ required: true, message: '请输入任务类型!'},],
|
||||
type: [{ required: true, message: '请选择业务类型!'},],
|
||||
priority: [{ required: true, message: '请输入优先级!'},],
|
||||
startCode: [{ required: true, message: '请选择起点!'},],
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
<template>
|
||||
<j-modal
|
||||
:title="title"
|
||||
:maxHeight="400"
|
||||
:width="600"
|
||||
:visible="visible"
|
||||
@ok="handleOk"
|
||||
:okButtonProps="{ class: { 'jee-hidden': disableSubmit } }"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
>
|
||||
<HikAgvForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></HikAgvForm>
|
||||
<template #footer>
|
||||
<a-button @click="handleCancel">取消</a-button>
|
||||
<a-button :class="{ 'jee-hidden': disableSubmit }" type="primary" @click="handleOk">确认 </a-button>
|
||||
</template>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import HikAgvForm from './HikAgvForm.vue';
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const title = ref<string>('');
|
||||
const width = ref<number>(800);
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
title.value = '新增AGV';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.add();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
*/
|
||||
function edit(record) {
|
||||
title.value = disableSubmit.value ? 'AGV详情' : '编辑AGV';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.edit(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
function handleOk() {
|
||||
registerForm.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
function submitCallback() {
|
||||
handleCancel();
|
||||
emit('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消按钮回调事件
|
||||
*/
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
disableSubmit,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped></style>
|
||||
|
|
@ -0,0 +1,212 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="AgvTaskForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="任务ID" v-bind="validateInfos.id" v-if="formData.id" id="AgvTaskForm-id" name="id">
|
||||
<a-input v-model:value="formData.id" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="容器" v-bind="validateInfos.carrierCode" id="AgvTaskForm-carrierCode" name="carrierCode">
|
||||
<JDictSelectTag v-model:value="formData.carrierCode" placeholder="请选择容器" dictCode="base_stock where iz_active=1 and del_flag=0,stock_code,stock_code" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="任务类型" v-bind="validateInfos.taskType" id="AgvTaskForm-taskType" name="taskType">
|
||||
<a-input v-model:value="formData.taskType" placeholder="请输入任务类型" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="业务类型" v-bind="validateInfos.type" id="AgvTaskForm-type" name="type">
|
||||
<JDictSelectTag
|
||||
type="select"
|
||||
v-model:value="formData.type"
|
||||
dictCode="business_type"
|
||||
placeholder="请选择业务类型"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="任务状态" v-bind="validateInfos.status" id="AgvTaskForm-status" name="status">
|
||||
<JDictSelectTag
|
||||
type="select"
|
||||
v-model:value="formData.status"
|
||||
dictCode="agv_task_status"
|
||||
placeholder="请选择任务状态"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="优先级" v-bind="validateInfos.priority" id="AgvTaskForm-priority" name="priority">
|
||||
<a-input-number v-model:value="formData.priority" placeholder="请输入优先级" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="目标库位" v-bind="validateInfos.endCode" id="AgvTaskForm-endCode" name="endCode">
|
||||
<JDictSelectTag v-model:value="formData.endCode" placeholder="请选择目标库位" dictCode="base_point where iz_active=1 and del_flag=0 ,point_code,point_code" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="返回报文" v-bind="validateInfos.resMessage" v-if="formData.id" id="AgvTaskForm-resMessage" name="resMessage">
|
||||
<a-textarea v-model:value="formData.resMessage" :rows="4" placeholder="请输入返回报文" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
</JFormContainer>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed } from 'vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDateByPicker, getValueType } from '/@/utils';
|
||||
import { getTenantId } from '@/utils/auth';
|
||||
import { saveOrUpdate } from '../AgvTask.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
import { JDictSelectTag } from '@/components/Form';
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: () => ({})},
|
||||
formBpm: { type: Boolean, default: true }
|
||||
});
|
||||
const formRef = ref();
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
//仓库 ID
|
||||
let tenantId = getTenantId();
|
||||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
carrierCode: '',
|
||||
carrierType: 'TRAY',
|
||||
taskType: '',
|
||||
type: '',
|
||||
status: 'CREATED',
|
||||
priority: 3,
|
||||
startCode: '',
|
||||
endCode: '',
|
||||
resMessage: '',
|
||||
tenantId: tenantId,
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
carrierCode: [{ required: true, message: '请选择容器!'},],
|
||||
type: [{ required: true, message: '请选择业务类型!'},],
|
||||
priority: [{ required: true, message: '请输入优先级!'},],
|
||||
endCode: [{ required: true, message: '请选择目标库位!'},],
|
||||
status: [{ required: true, message: '请选择任务状态!'},]
|
||||
});
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
//日期个性化选择
|
||||
const fieldPickers = reactive({
|
||||
});
|
||||
|
||||
// 表单禁用
|
||||
const disabled = computed(()=>{
|
||||
if(props.formBpm === true){
|
||||
if(props.formData.disabled === false){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return props.formDisabled;
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if(record.hasOwnProperty(key)){
|
||||
tmpData[key] = record[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
Object.assign(formData, tmpData);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
async function submitForm() {
|
||||
try {
|
||||
// 触发表单验证
|
||||
await validate();
|
||||
} catch ({ errorFields }) {
|
||||
if (errorFields) {
|
||||
const firstField = errorFields[0];
|
||||
if (firstField) {
|
||||
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(errorFields);
|
||||
}
|
||||
confirmLoading.value = true;
|
||||
const isUpdate = ref<boolean>(false);
|
||||
//时间格式化
|
||||
let model = formData;
|
||||
if (model.id) {
|
||||
isUpdate.value = true;
|
||||
}
|
||||
//循环数据
|
||||
for (let data in model) {
|
||||
// 更新个性化日期选择器的值
|
||||
model[data] = getDateByPicker(model[data], fieldPickers[data]);
|
||||
//如果该数据是数组并且是字符串类型
|
||||
if (model[data] instanceof Array) {
|
||||
let valueType = getValueType(formRef.value.getProps, data);
|
||||
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||
if (valueType === 'string') {
|
||||
model[data] = model[data].join(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
await saveOrUpdate(model, isUpdate.value)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
createMessage.success(res.message);
|
||||
emit('ok');
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
padding: 14px 20px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
<template>
|
||||
<j-modal
|
||||
:title="title"
|
||||
:maxHeight="400"
|
||||
:width="600"
|
||||
:visible="visible"
|
||||
@ok="handleOk"
|
||||
:okButtonProps="{ class: { 'jee-hidden': disableSubmit } }"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭"
|
||||
>
|
||||
<TesAgvForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></TesAgvForm>
|
||||
<template #footer>
|
||||
<a-button @click="handleCancel">取消</a-button>
|
||||
<a-button :class="{ 'jee-hidden': disableSubmit }" type="primary" @click="handleOk">确认 </a-button>
|
||||
</template>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import TesAgvForm from './TesAgvForm.vue';
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const title = ref<string>('');
|
||||
const width = ref<number>(800);
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
title.value = '新增TES';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.add();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
*/
|
||||
function edit(record) {
|
||||
title.value = disableSubmit.value ? 'TES详情' : '编辑TES';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.edit(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
function handleOk() {
|
||||
registerForm.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
function submitCallback() {
|
||||
handleCancel();
|
||||
emit('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消按钮回调事件
|
||||
*/
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
disableSubmit,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped></style>
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
<a-col :lg="6">
|
||||
<a-form-item name="areaId">
|
||||
<template #label><span title="库区">库区</span></template>
|
||||
<JDictSelectTag v-model:value="queryParam.areaId" placeholder="请选择库区" dictCode="base_area where iz_active=1 and del_flag=0 ,area_name,id" allowClear />
|
||||
<JSearchSelect v-model:value="queryParam.areaId" placeholder="请选择库区" dict="base_area where iz_active=1 and del_flag=0 ,area_name,id" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
|
|
@ -93,8 +93,7 @@
|
|||
import { JInputTypeEnum } from '@/enums/cpteEnum';
|
||||
import JInput from '../../../components/Form/src/jeecg/components/JInput.vue';
|
||||
import SwitchStatus from '/@/views/base/SwitchStatus.vue';
|
||||
import JSearchSelect from '../../../components/Form/src/jeecg/components/JSearchSelect.vue';
|
||||
import { JDictSelectTag } from '@/components/Form';
|
||||
import { JDictSelectTag,JSearchSelect } from '@/components/Form';
|
||||
|
||||
const fieldPickers = reactive({});
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,12 @@
|
|||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="库区" v-bind="validateInfos.areaId" id="PointForm-areaId" name="areaId">
|
||||
<JDictSelectTag v-model:value="formData.areaId" placeholder="请选择库区" dictCode="base_area where iz_active=1 and del_flag=0,area_name,id" allowClear />
|
||||
<JSearchSelect
|
||||
v-model:value="formData.areaId"
|
||||
placeholder="请选择库区"
|
||||
dict="base_area where iz_active=1 and del_flag=0,area_name,id"
|
||||
allowClear
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
|
|
@ -66,7 +71,7 @@
|
|||
import { saveOrUpdate } from '../Point.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
import { JDictSelectTag } from '@/components/Form';
|
||||
import { JDictSelectTag, JSearchSelect } from '@/components/Form';
|
||||
import JSwitch from '@/components/Form/src/jeecg/components/JSwitch.vue';
|
||||
import { getTenantId } from '@/utils/auth';
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,12 @@
|
|||
<a-col :lg="6">
|
||||
<a-form-item name="pointId">
|
||||
<template #label><span title="库位">库位</span></template>
|
||||
<JDictSelectTag v-model:value="queryParam.pointId" placeholder="请选择库区" dictCode="base_point where iz_active=1 and del_flag=0 ,point_code,id" allowClear />
|
||||
<JSearchSelect
|
||||
v-model:value="queryParam.pointId"
|
||||
placeholder="请选择库位"
|
||||
dict="base_point where iz_active=1 and del_flag=0 ,point_code,id"
|
||||
allowClear
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
|
|
@ -91,8 +96,7 @@
|
|||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDateByPicker } from '/@/utils';
|
||||
import JSearchSelect from '../../../components/Form/src/jeecg/components/JSearchSelect.vue';
|
||||
import { JDictSelectTag } from '@/components/Form';
|
||||
import { JDictSelectTag, JSearchSelect } from '@/components/Form';
|
||||
|
||||
const fieldPickers = reactive({});
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,12 @@
|
|||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="库位" v-bind="validateInfos.pointId" id="StockForm-pointId" name="pointId">
|
||||
<JDictSelectTag v-model:value="formData.pointId" placeholder="请选择库位" dictCode="base_point where iz_active=1 and del_flag=0 ,point_code,id" allowClear />
|
||||
<JSearchSelect
|
||||
v-model:value="formData.pointId"
|
||||
placeholder="请选择库位"
|
||||
dict="base_point where iz_active=1 and del_flag=0 ,point_code,id"
|
||||
allowClear
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
|
|
@ -55,7 +60,7 @@
|
|||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
import JSwitch from '@/components/Form/src/jeecg/components/JSwitch.vue';
|
||||
import JDictSelectTag from '../../../../components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { JDictSelectTag, JSearchSelect } from '@/components/Form';
|
||||
import { getTenantId } from '@/utils/auth';
|
||||
|
||||
const props = defineProps({
|
||||
|
|
|
|||
|
|
@ -0,0 +1,72 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/inventory/list',
|
||||
save='/inventory/add',
|
||||
edit='/inventory/edit',
|
||||
deleteOne = '/inventory/delete',
|
||||
deleteBatch = '/inventory/deleteBatch',
|
||||
importExcel = '/inventory/importExcel',
|
||||
exportXls = '/inventory/exportXls',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
|
||||
/**
|
||||
* 导入api
|
||||
*/
|
||||
export const getImportUrl = Api.importExcel;
|
||||
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const deleteOne = (params,handleSuccess) => {
|
||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
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
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
let url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
import {BasicColumn} from '/@/components/Table';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '容器',
|
||||
align: "center",
|
||||
dataIndex: 'stockId_dictText'
|
||||
},
|
||||
{
|
||||
title: '物料',
|
||||
align: "center",
|
||||
dataIndex: 'itemId_dictText'
|
||||
},
|
||||
{
|
||||
title: '库位',
|
||||
align: "center",
|
||||
dataIndex: 'pointId_dictText'
|
||||
},
|
||||
{
|
||||
title: '数量',
|
||||
align: "center",
|
||||
dataIndex: 'quantity'
|
||||
},
|
||||
{
|
||||
title: '占用数',
|
||||
align: "center",
|
||||
dataIndex: 'queuedQty'
|
||||
},
|
||||
{
|
||||
title: '库存状态',
|
||||
align: "center",
|
||||
dataIndex: 'status_dictText'
|
||||
},
|
||||
{
|
||||
title: '批次号',
|
||||
align: "center",
|
||||
dataIndex: 'propC1'
|
||||
},
|
||||
{
|
||||
title: '外部仓库',
|
||||
align: "center",
|
||||
dataIndex: 'whCode'
|
||||
},
|
||||
{
|
||||
title: '外部库存状态',
|
||||
align: "center",
|
||||
dataIndex: 'propC3'
|
||||
},
|
||||
{
|
||||
title: '生产日期',
|
||||
align: "center",
|
||||
dataIndex: 'propD1',
|
||||
customRender:({text}) =>{
|
||||
text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
|
||||
return text;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
align: "center",
|
||||
dataIndex: 'description'
|
||||
}
|
||||
];
|
||||
|
||||
|
|
@ -0,0 +1,288 @@
|
|||
<template>
|
||||
<div class="p-2">
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="stockId">
|
||||
<template #label><span title="容器">容器</span></template>
|
||||
<JSearchSelect
|
||||
v-model:value="queryParam.stockId"
|
||||
placeholder="请选择库位"
|
||||
dict="base_stock where iz_active=1 and del_flag=0 ,stock_code,id"
|
||||
allowClear
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="itemId">
|
||||
<template #label><span title="物料">物料</span></template>
|
||||
<JSearchSelect
|
||||
v-model:value="queryParam.itemId"
|
||||
placeholder="请选择库位"
|
||||
dict="base_item where iz_active=1 and del_flag=0 ,item_code,id"
|
||||
allowClear
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="pointId">
|
||||
<template #label><span title="库位">库位</span></template>
|
||||
<JSearchSelect
|
||||
v-model:value="queryParam.pointId"
|
||||
placeholder="请选择库位"
|
||||
dict="base_point where iz_active=1 and del_flag=0 ,point_code,id"
|
||||
allowClear
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||
<a-col :lg="6">
|
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
||||
<a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
|
||||
{{ toggleSearchStatus ? '收起' : '展开' }}
|
||||
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
|
||||
</a>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="status">
|
||||
<template #label><span title="库存状态">库存状态</span></template>
|
||||
<JDictSelectTag v-model:value="queryParam.status" placeholder="请选择" dictCode="inventory_status" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'inventory:data_inventory:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" v-auth="'inventory:data_inventory:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||
<j-upload-button type="primary" v-auth="'inventory:data_inventory:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button v-auth="'inventory:data_inventory:deleteBatch'">批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<InventoryModal ref="registerModal" @success="handleSuccess"></InventoryModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="inventory-inventory" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './Inventory.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './Inventory.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import InventoryModal from './components/InventoryModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import {useModal} from '/@/components/Modal';
|
||||
import { getDateByPicker } from '/@/utils';
|
||||
import {JDictSelectTag, JSearchSelect} from "@/components/Form";
|
||||
|
||||
const fieldPickers = reactive({
|
||||
});
|
||||
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const userStore = useUserStore();
|
||||
const { createMessage } = useMessage();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '库存表',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:true,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
for (let key in fieldPickers) {
|
||||
if (queryParam[key] && fieldPickers[key]) {
|
||||
queryParam[key] = getDateByPicker(queryParam[key], fieldPickers[key]);
|
||||
}
|
||||
}
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "库存表",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
xs:24,
|
||||
sm:4,
|
||||
xl:6,
|
||||
xxl:4
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
});
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'inventory:data_inventory:edit'
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'inventory:data_inventory:delete'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
padding: 0;
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 24px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.query-group-cust{
|
||||
min-width: 100px !important;
|
||||
}
|
||||
.query-group-split-cust{
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
text-align: center
|
||||
}
|
||||
.ant-form-item:not(.ant-form-item-with-help){
|
||||
margin-bottom: 16px;
|
||||
height: 32px;
|
||||
}
|
||||
:deep(.ant-picker),:deep(.ant-input-number){
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
-- 注意:该页面对应的前台目录为views/inventory文件夹下
|
||||
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
|
||||
|
||||
|
||||
-- 主菜单
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
|
||||
VALUES ('176261038081301', NULL, '库存表', '/inventory/inventoryList', 'inventory/InventoryList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-11-08 21:59:40', NULL, NULL, 0);
|
||||
|
||||
-- 新增
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('176261038081302', '176261038081301', '添加库存表', NULL, NULL, 0, NULL, NULL, 2, 'inventory:data_inventory:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-11-08 21:59:40', NULL, NULL, 0, 0, '1', 0);
|
||||
|
||||
-- 编辑
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('176261038081303', '176261038081301', '编辑库存表', NULL, NULL, 0, NULL, NULL, 2, 'inventory:data_inventory:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-11-08 21:59:40', NULL, NULL, 0, 0, '1', 0);
|
||||
|
||||
-- 删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('176261038081304', '176261038081301', '删除库存表', NULL, NULL, 0, NULL, NULL, 2, 'inventory:data_inventory:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-11-08 21:59:40', NULL, NULL, 0, 0, '1', 0);
|
||||
|
||||
-- 批量删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('176261038081305', '176261038081301', '批量删除库存表', NULL, NULL, 0, NULL, NULL, 2, 'inventory:data_inventory:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-11-08 21:59:40', NULL, NULL, 0, 0, '1', 0);
|
||||
|
||||
-- 导出excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('176261038081306', '176261038081301', '导出excel_库存表', NULL, NULL, 0, NULL, NULL, 2, 'inventory:data_inventory:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-11-08 21:59:40', NULL, NULL, 0, 0, '1', 0);
|
||||
|
||||
-- 导入excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('176261038081307', '176261038081301', '导入excel_库存表', NULL, NULL, 0, NULL, NULL, 2, 'inventory:data_inventory:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-11-08 21:59:40', NULL, NULL, 0, 0, '1', 0);
|
||||
|
||||
-- 角色授权(以 admin 角色为例,role_id 可替换)
|
||||
INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('176261038081308', 'f6817f48af4fb3af11b9e8bf182f618b', '176261038081301', NULL, '2025-11-08 21:59:40', '127.0.0.1');
|
||||
INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('176261038081309', 'f6817f48af4fb3af11b9e8bf182f618b', '176261038081302', NULL, '2025-11-08 21:59:40', '127.0.0.1');
|
||||
INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('176261038081310', 'f6817f48af4fb3af11b9e8bf182f618b', '176261038081303', NULL, '2025-11-08 21:59:40', '127.0.0.1');
|
||||
INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('176261038081311', 'f6817f48af4fb3af11b9e8bf182f618b', '176261038081304', NULL, '2025-11-08 21:59:40', '127.0.0.1');
|
||||
INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('176261038081312', 'f6817f48af4fb3af11b9e8bf182f618b', '176261038081305', NULL, '2025-11-08 21:59:40', '127.0.0.1');
|
||||
INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('176261038081313', 'f6817f48af4fb3af11b9e8bf182f618b', '176261038081306', NULL, '2025-11-08 21:59:40', '127.0.0.1');
|
||||
INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('176261038081314', 'f6817f48af4fb3af11b9e8bf182f618b', '176261038081307', NULL, '2025-11-08 21:59:40', '127.0.0.1');
|
||||
|
|
@ -0,0 +1,216 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="InventoryForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="库位ID" v-bind="validateInfos.pointId" id="InventoryForm-pointId" name="pointId">
|
||||
<a-input-number v-model:value="formData.pointId" placeholder="请输入库位ID" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="容器ID" v-bind="validateInfos.stockId" id="InventoryForm-stockId" name="stockId">
|
||||
<a-input-number v-model:value="formData.stockId" placeholder="请输入容器ID" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="数量" v-bind="validateInfos.quantity" id="InventoryForm-quantity" name="quantity">
|
||||
<a-input-number v-model:value="formData.quantity" placeholder="请输入数量" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="分配数" v-bind="validateInfos.queuedQty" id="InventoryForm-queuedQty" name="queuedQty">
|
||||
<a-input-number v-model:value="formData.queuedQty" placeholder="请输入分配数" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="外部仓库" v-bind="validateInfos.whCode" id="InventoryForm-whCode" name="whCode">
|
||||
<a-input v-model:value="formData.whCode" placeholder="请输入外部仓库" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="批次号" v-bind="validateInfos.propC1" id="InventoryForm-propC1" name="propC1">
|
||||
<a-input v-model:value="formData.propC1" placeholder="请输入批次号" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="序列号" v-bind="validateInfos.propC2" id="InventoryForm-propC2" name="propC2">
|
||||
<a-input v-model:value="formData.propC2" placeholder="请输入序列号" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="外部库存状态" v-bind="validateInfos.propC3" id="InventoryForm-propC3" name="propC3">
|
||||
<a-input v-model:value="formData.propC3" placeholder="请输入外部库存状态" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="库存状态" v-bind="validateInfos.status" id="InventoryForm-status" name="status">
|
||||
<a-input v-model:value="formData.status" placeholder="请输入库存状态" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="生产日期" v-bind="validateInfos.propD1" id="InventoryForm-propD1" name="propD1">
|
||||
<a-date-picker placeholder="请选择生产日期" v-model:value="formData.propD1" value-format="YYYY-MM-DD" style="width: 100%" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="描述" v-bind="validateInfos.description" id="InventoryForm-description" name="description">
|
||||
<a-input v-model:value="formData.description" placeholder="请输入描述" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="租户ID" v-bind="validateInfos.tenantId" id="InventoryForm-tenantId" name="tenantId">
|
||||
<a-input-number v-model:value="formData.tenantId" placeholder="请输入租户ID" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
</JFormContainer>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDateByPicker, getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../Inventory.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: () => ({})},
|
||||
formBpm: { type: Boolean, default: true }
|
||||
});
|
||||
const formRef = ref();
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
pointId: undefined,
|
||||
stockId: undefined,
|
||||
quantity: undefined,
|
||||
queuedQty: undefined,
|
||||
whCode: '',
|
||||
propC1: '',
|
||||
propC2: '',
|
||||
propC3: '',
|
||||
status: '',
|
||||
propD1: '',
|
||||
description: '',
|
||||
tenantId: undefined,
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
});
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
//日期个性化选择
|
||||
const fieldPickers = reactive({
|
||||
});
|
||||
|
||||
// 表单禁用
|
||||
const disabled = computed(()=>{
|
||||
if(props.formBpm === true){
|
||||
if(props.formData.disabled === false){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return props.formDisabled;
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if(record.hasOwnProperty(key)){
|
||||
tmpData[key] = record[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
Object.assign(formData, tmpData);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
async function submitForm() {
|
||||
try {
|
||||
// 触发表单验证
|
||||
await validate();
|
||||
} catch ({ errorFields }) {
|
||||
if (errorFields) {
|
||||
const firstField = errorFields[0];
|
||||
if (firstField) {
|
||||
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(errorFields);
|
||||
}
|
||||
confirmLoading.value = true;
|
||||
const isUpdate = ref<boolean>(false);
|
||||
//时间格式化
|
||||
let model = formData;
|
||||
if (model.id) {
|
||||
isUpdate.value = true;
|
||||
}
|
||||
//循环数据
|
||||
for (let data in model) {
|
||||
// 更新个性化日期选择器的值
|
||||
model[data] = getDateByPicker(model[data], fieldPickers[data]);
|
||||
//如果该数据是数组并且是字符串类型
|
||||
if (model[data] instanceof Array) {
|
||||
let valueType = getValueType(formRef.value.getProps, data);
|
||||
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||
if (valueType === 'string') {
|
||||
model[data] = model[data].join(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
await saveOrUpdate(model, isUpdate.value)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
createMessage.success(res.message);
|
||||
emit('ok');
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
padding: 14px 20px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<j-modal :title="title" :maxHeight="400" :width="600" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<AgvTaskForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></AgvTaskForm>
|
||||
<j-modal :title="title" maxHeight="500px" :width="800" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<InventoryForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></InventoryForm>
|
||||
<template #footer>
|
||||
<a-button @click="handleCancel">取消</a-button>
|
||||
<a-button :class="{ 'jee-hidden': disableSubmit }" type="primary" @click="handleOk">确认</a-button>
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import AgvTaskForm from './AgvTaskForm.vue'
|
||||
import InventoryForm from './InventoryForm.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
const { createMessage } = useMessage();
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
registerForm.value.add();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
registerForm.value.edit(record);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
|
|
@ -23,14 +23,12 @@ export const columns: BasicColumn[] = [
|
|||
align: 'center',
|
||||
dataIndex: 'status_dictText',
|
||||
customRender: ({ text }) => {
|
||||
//入库状态:已创建、已审核、收货中、收货完成、已关闭、已取消。
|
||||
//入库状态:1.已创建;2.部分收货;3.收货完成;4.已取消。
|
||||
const statusColorMap = {
|
||||
'已创建': 'orange',
|
||||
'已审核': 'pink',
|
||||
'收货中': 'cyan',
|
||||
'收货完成': 'blue',
|
||||
'已关闭': 'green',
|
||||
'已取消': 'red'
|
||||
'部分收货': 'blue',
|
||||
'收货完成': 'green',
|
||||
'已取消': 'red',
|
||||
};
|
||||
const color = statusColorMap[text] || 'red';
|
||||
return render.renderTag(text, color);
|
||||
|
|
@ -79,15 +77,16 @@ export const asnDetailColumns: JVxeColumn[] = [
|
|||
{
|
||||
title: '物料',
|
||||
key: 'itemId',
|
||||
type: JVxeTypes.selectDictSearch,
|
||||
type: JVxeTypes.selectSearch,
|
||||
width: 150,
|
||||
async: true, // 异步搜索,默认为 true
|
||||
//查询状态启用、未删除的物料
|
||||
dict: 'base_item where iz_active=1 and del_flag=0,item_code,id',
|
||||
dictCode: 'base_item where iz_active=1 and del_flag=0,item_code,id',
|
||||
tipsContent: '请搜索物料',
|
||||
validateRules: [
|
||||
{
|
||||
required: true, // 必填
|
||||
message: '请选择${title}', // 显示的文本
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -103,30 +102,32 @@ export const asnDetailColumns: JVxeColumn[] = [
|
|||
{
|
||||
title: '容器',
|
||||
key: 'stockId',
|
||||
type: JVxeTypes.selectDictSearch,
|
||||
type: JVxeTypes.selectSearch,
|
||||
width: 150,
|
||||
async: true, // 异步搜索,默认为 true
|
||||
//查询状态为可用、启用、未删除的容器
|
||||
dict: 'base_stock where status=0 and iz_active=1 and del_flag=0,stock_code,id',
|
||||
dictCode: 'base_stock where status=0 and iz_active=1 and del_flag=0,stock_code,id',
|
||||
tipsContent: '请搜索容器',
|
||||
validateRules: [
|
||||
{
|
||||
required: true, // 必填
|
||||
message: '请选择${title}', // 显示的文本
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: '库位',
|
||||
key: 'pointId',
|
||||
type: JVxeTypes.selectDictSearch,
|
||||
type: JVxeTypes.selectSearch,
|
||||
width: 150,
|
||||
async: true, // 异步搜索,默认为 true
|
||||
//查询状态为可用、启用、未删除的库位
|
||||
dict: 'base_point where status=0 and iz_active=1 and del_flag=0,point_code,id',
|
||||
dictCode: 'base_point where status=0 and iz_active=1 and del_flag=0,point_code,id',
|
||||
tipsContent: '请搜索库位',
|
||||
validateRules: [
|
||||
{
|
||||
required: true, // 必填
|
||||
message: '请选择${title}', // 显示的文本
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -150,6 +151,32 @@ export const asnDetailColumns: JVxeColumn[] = [
|
|||
defaultValue: '0',
|
||||
disabled: true,
|
||||
},
|
||||
{
|
||||
title: '明细状态',
|
||||
key: 'status',
|
||||
type: JVxeTypes.normal,
|
||||
width: '120px',
|
||||
defaultValue: '1',
|
||||
formatter: ({ cellValue }) => {
|
||||
//入库状态:1.已创建;2.部分收货;3.收货完成;4.已取消。
|
||||
const statusMap = {
|
||||
1: '已创建',
|
||||
2: '部分收货',
|
||||
3: '收货完成',
|
||||
4: '已取消',
|
||||
};
|
||||
// 状态颜色映射
|
||||
const statusColorMap = {
|
||||
'已创建': 'orange',
|
||||
'部分收货': 'blue',
|
||||
'收货完成': 'green',
|
||||
'已取消': 'red',
|
||||
};
|
||||
const text = statusMap[cellValue] || '未知状态';
|
||||
const color = statusColorMap[text] || 'red';
|
||||
return render.renderTag(text, color);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '项目号',
|
||||
key: 'project',
|
||||
|
|
|
|||
|
|
@ -3,7 +3,52 @@
|
|||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form ref="formRef" @keyup.enter.native="reload" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24"> </a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="orderNo">
|
||||
<template #label><span title="系统单号">系统单号</span></template>
|
||||
<JInput v-model:value="queryParam.orderNo" :placeholder="'请输入系统单号'" :type="JInputTypeEnum.JINPUT_RIGHT_LIKE" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="no">
|
||||
<template #label><span title="任务号">任务号</span></template>
|
||||
<JInput v-model:value="queryParam.no" :placeholder="'请输入任务号'" :type="JInputTypeEnum.JINPUT_RIGHT_LIKE" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="orderType">
|
||||
<template #label><span title="单据类型">单据类型</span></template>
|
||||
<JDictSelectTag v-model:value="queryParam.orderType" placeholder="请选择" dictCode="asn_order_type" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||
<a-col :lg="6">
|
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
||||
<a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
|
||||
{{ toggleSearchStatus ? '收起' : '展开' }}
|
||||
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
|
||||
</a>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="status">
|
||||
<template #label><span title="状态">状态</span></template>
|
||||
<JDictSelectTag v-model:value="queryParam.status" placeholder="请选择" dictCode="asn_status" allowClear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="orderDate">
|
||||
<template #label><span title="订单日期">订单日期</span></template>
|
||||
<JRangeDate v-model:value="queryParam.orderDate" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
|
|
@ -12,7 +57,12 @@
|
|||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'receive:data_asn:add'" @click="handleAdd" preIcon="ant-design:plus-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 type="primary" v-auth="'receive:data_asn:importExcel'" v-show="false" preIcon="ant-design:import-outlined" @click="onImportXls"
|
||||
<j-upload-button
|
||||
type="primary"
|
||||
v-auth="'receive:data_asn:importExcel'"
|
||||
v-show="false"
|
||||
preIcon="ant-design:import-outlined"
|
||||
@click="onImportXls"
|
||||
>导入
|
||||
</j-upload-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
|
|
@ -35,7 +85,7 @@
|
|||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template v-slot:bodyCell="{ column, record, index, text }"> </template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }"></template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<AsnModal @register="registerModal" @success="handleSuccess"></AsnModal>
|
||||
|
|
@ -53,6 +103,10 @@
|
|||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getDateByPicker } from '/@/utils';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { JInputTypeEnum } from '@/enums/cpteEnum';
|
||||
import JInput from '../../../components/Form/src/jeecg/components/JInput.vue';
|
||||
import { JDictSelectTag } from '@/components/Form';
|
||||
import JRangeDate from '@/components/Form/src/jeecg/components/JRangeDate.vue';
|
||||
|
||||
const fieldPickers = reactive({});
|
||||
const formRef = ref();
|
||||
|
|
@ -75,12 +129,26 @@
|
|||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
for (let key in fieldPickers) {
|
||||
if (queryParam[key] && fieldPickers[key]) {
|
||||
queryParam[key] = getDateByPicker(queryParam[key], fieldPickers[key]);
|
||||
// 创建新的查询参数对象,避免修改原始对象
|
||||
const newQueryParam = { ...queryParam };
|
||||
|
||||
// 处理日期范围
|
||||
if (newQueryParam.orderDate) {
|
||||
try {
|
||||
const [begin, end] = newQueryParam.orderDate.split(',');
|
||||
if (begin !== undefined) newQueryParam.orderDate_begin = begin;
|
||||
if (end !== undefined) newQueryParam.orderDate_end = end;
|
||||
delete newQueryParam.orderDate;
|
||||
} catch (error) {
|
||||
console.error('日期范围处理错误:', error);
|
||||
}
|
||||
}
|
||||
return Object.assign(params, queryParam);
|
||||
for (let key in fieldPickers) {
|
||||
if (newQueryParam[key] && fieldPickers[key]) {
|
||||
newQueryParam[key] = getDateByPicker(newQueryParam[key], fieldPickers[key]);
|
||||
}
|
||||
}
|
||||
return Object.assign(params, newQueryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
|
|
@ -110,10 +178,14 @@
|
|||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
let showFooter = true;
|
||||
if (record.status > 1) {
|
||||
showFooter = false;
|
||||
}
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: true,
|
||||
showFooter: showFooter,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -196,6 +268,13 @@
|
|||
sm: 20,
|
||||
});
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<a-form v-bind="formItemLayout" name="AsnForm" ref="formRef" class="jeecg-native-form">
|
||||
<a-row class="form-row" :gutter="24">
|
||||
<a-col :span="8">
|
||||
<a-form-item label="外部单号" v-bind="validateInfos.thirdPartyOrderNo" id="AsnForm-thirdPartyOrderNo" name="thirdPartyOrderNo">
|
||||
<a-form-item label="外部单号" v-bind="validateInfos.thirdPartyOrderNo" id="AsnForm-thirdPartyOrderNo" name="thirdPartyOrderNo">
|
||||
<a-input v-model:value="formData.thirdPartyOrderNo" placeholder="请输入外部单号" allow-clear></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
|
|
|||
Loading…
Reference in New Issue