Commit 6a8a1691 by 董晓奇

(3)报废车入库的时候需要挂载明细,该单据入库后和预处理页面根据明细进行校验,已入库的可以进行作业。

处理思路,采购入库的时候增加独立菜单,报废车采购入库,需要上传采购入库明细,明细见仓库模板---待定

1.添加明细行中查看关联报废车按钮
2.将报废车入库与采购入库通过单据类型字段分开
3.添加清理数据表sql文件
4.添加报废车关联校验接口
5.去除不能修改用户和重置密码的限制
parent d618696e
......@@ -44,7 +44,7 @@ VITE_GLOB_API_URL_PREFIX =
VITE_USE_PWA = false
# 是否启用官网代码
VITE_GLOB_PRODUCTION = true
VITE_GLOB_PRODUCTION = false
# 帆软服务地址
VITE_GLOB_FINE_REPORT_URL = http://127.0.0.1:8075
......@@ -44,7 +44,7 @@ VITE_GLOB_API_URL_PREFIX =
VITE_USE_PWA = false
# 是否启用官网代码
VITE_GLOB_PRODUCTION = true
VITE_GLOB_PRODUCTION = false
# 帆软服务地址
VITE_GLOB_FINE_REPORT_URL = http://127.0.0.1:8075
import { MesWarehouseInPageModel, MesWarehouseInPageParams, MesWarehouseInPageResult } from './model/BfccgrkModel';
import {
MesWarehouseInPageModel,
MesWarehouseInPageParams,
MesWarehouseInPageResult,
} from './model/BfccgrkModel';
import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';
......@@ -8,16 +11,17 @@ enum Api {
List = '/ckgl/bfccgrk/list',
Info = '/ckgl/bfccgrk/info',
MesWarehouseIn = '/ckgl/bfccgrk',
Export = '/ckgl/bfccgrk/export',
ListByBfc = '/magic-api/getBfcListByids',
}
/**
* @description: 查询MesWarehouseIn分页列表
*/
export async function getMesWarehouseInPage(params: MesWarehouseInPageParams, mode: ErrorMessageMode = 'modal') {
export async function getMesWarehouseInPage(
params: MesWarehouseInPageParams,
mode: ErrorMessageMode = 'modal',
) {
return defHttp.get<MesWarehouseInPageResult>(
{
url: Api.Page,
......@@ -47,7 +51,10 @@ export async function getMesWarehouseIn(id: String, mode: ErrorMessageMode = 'mo
/**
* @description: 新增MesWarehouseIn
*/
export async function addMesWarehouseIn(mesWarehouseIn: Recordable, mode: ErrorMessageMode = 'modal') {
export async function addMesWarehouseIn(
mesWarehouseIn: Recordable,
mode: ErrorMessageMode = 'modal',
) {
return defHttp.post<boolean>(
{
url: Api.MesWarehouseIn,
......@@ -62,7 +69,10 @@ export async function addMesWarehouseIn(mesWarehouseIn: Recordable, mode: ErrorM
/**
* @description: 更新MesWarehouseIn
*/
export async function updateMesWarehouseIn(mesWarehouseIn: Recordable, mode: ErrorMessageMode = 'modal') {
export async function updateMesWarehouseIn(
mesWarehouseIn: Recordable,
mode: ErrorMessageMode = 'modal',
) {
return defHttp.put<boolean>(
{
url: Api.MesWarehouseIn,
......@@ -89,15 +99,10 @@ export async function deleteMesWarehouseIn(ids: string[], mode: ErrorMessageMode
);
}
/**
* @description: 导出MesWarehouseIn
*/
export async function exportMesWarehouseIn(
params?: object,
mode: ErrorMessageMode = 'modal'
) {
export async function exportMesWarehouseIn(params?: object, mode: ErrorMessageMode = 'modal') {
return defHttp.download(
{
url: Api.Export,
......@@ -110,5 +115,11 @@ export async function exportMesWarehouseIn(
},
);
}
export async function getBfcListByids(ids: string) {
return defHttp.get<any>({
url: Api.ListByBfc,
params: { ids },
isTransformResponse: false, // 关闭自动转换,直接获取原始响应数据
});
}
<template>
<BasicModal
:height="1080"
v-bind="$attrs" @register="registerModal" :title="getTitle"
@ok="handleSubmit" @cancel="handleClose" >
<ModalForm ref="formRef" v-model:value="state.formModel" :fromPage="FromPageType.MENU" />
<template #footer v-if=" !state.isView">
<BasicModal
:height="1080"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
@cancel="handleClose"
>
<ModalForm ref="formRef" v-model:value="state.formModel" :fromPage="FromPageType.MENU" />
<template #footer v-if="!state.isView">
<template v-for="(item, index) in sortBy(formButtons, 'index')" :key="item.key">
<template v-if="item.isShow">
<template v-if="item.isShow">
<CustomButtonModal v-if="item.type == CustomButtonModalType.Modal" :info="item" />
<a-button
:type="item.style"
......@@ -22,29 +23,46 @@
</template>
</template>
</template>
</BasicModal>
</BasicModal>
<ShowBfcModal @register="registerBfcModal" />
</template>
<script lang="ts" setup>
import { ref, computed, reactive, provide, Ref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { CustomButtonModalType } from '/@/enums/userEnum';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { ref, computed, reactive, provide, Ref, onMounted, onUnmounted } from 'vue';
import { BasicModal, useModal, useModalInner } from '/@/components/Modal';
import { CustomButtonModalType } from '/@/enums/userEnum';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { formProps ,formButtons } from './config';
import { formProps, formButtons } from './config';
import ModalForm from './Form.vue';
import { FromPageType } from '/@/enums/workflowEnum';
import { sortBy } from 'lodash-es';
import { executeCurFormEvent } from '/@/utils/event/data';
import { sortBy } from 'lodash-es';
import { executeCurFormEvent } from '/@/utils/event/data';
import ShowBfcModal from './ShowBfcModal.vue';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [registerBfcModal, { openModal: openBfcModal }] = useModal();
const showBfcModal = (rowData: any) => {
openBfcModal(true, {
bfcIds: rowData.bfcIds,
bfcCodes: rowData.bfcCodes,
});
};
// 挂载到 window 供按钮配置调用(组件卸载时移除)
onMounted(() => {
window.showBfcModal = showBfcModal;
});
onUnmounted(() => {
delete window.showBfcModal;
});
const emit = defineEmits(['success', 'register']);
const { notification } = useMessage();
const formRef = ref();
const isCopy = ref<boolean>(false)
const isCopy = ref<boolean>(false);
const state = reactive({
formModel: {},
isUpdate: true,
......@@ -55,40 +73,41 @@
const { t } = useI18n();
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
await handleInner(data);
await handleInner(data);
});
const getTitle = computed(() => (state.isView ? '查看' : state.isUpdate ? '编辑' : isCopy.value ? '复制数据' : '新增'));
const getTitle = computed(() =>
state.isView ? '查看' : state.isUpdate ? '编辑' : isCopy.value ? '复制数据' : '新增',
);
async function handleInner(data){
async function handleInner(data) {
state.isUpdate = !!data?.isUpdate;
state.isView = !!data?.isView;
isCopy.value = !!data?.isCopy;
setModalProps({
destroyOnClose: true,
maskClosable: false,
showCancelBtn: false,
showOkBtn: false,
canFullscreen: true,
width: 1980,
footer: state.isView ? null : undefined,defaultFullscreen:true,
width: 1980,
footer: state.isView ? null : undefined,
defaultFullscreen: true,
});
if (state.isUpdate || state.isView || isCopy.value) {
state.rowId = data.id;
if (state.isView) {
await formRef.value.setDisabledForm();
}
await formRef.value.setFormDataFromId(state.rowId);
} else {
formRef.value.resetFields();
}
}
async function saveModal() {
let saveSuccess = false;
try {
......@@ -117,9 +136,9 @@
async function handleSubmit() {
try {
const saveSuccess = await saveModal();
setModalProps({ confirmLoading: true });
if (saveSuccess) {
if (!state.isUpdate || isCopy.value) {
//false 新增
......@@ -133,34 +152,31 @@
description: t('修改成功!'),
}); //提示消息
}
closeModal();
formRef.value.resetFields();
emit('success');
}
} finally {
setModalProps({ confirmLoading: false });
}
}
function customClick(item) {
if (item.key == 'confirm') {
handleSubmit();
} else if (item.key == 'cancel' && props.formType !== 'normal') {
} else if (item.key == 'cancel') {
handleClose();
closeModal();
closeModal();
} else if (item.key == 'reset') {
formRef.value.resetFields();
} else {
executeCurFormEvent(item.event, state.formModel, true);
}
}
}
function handleClose() {
formRef.value.resetFields();
}
</script>
\ No newline at end of file
<template>
<BasicModal
v-bind="$attrs"
@register="registerModal"
title="关联报废车"
width="800px"
:footer="null"
:loading="loading"
zIndex="9999"
>
<div v-if="loading" class="empty-text">加载中...</div>
<div v-else-if="bfcList.length === 0" class="empty-text">暂无关联报废车</div>
<a-table
v-else
:data-source="bfcList"
:columns="columns"
:pagination="false"
row-key="plate_number"
bordered
/>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { getBfcListByids } from '/@/api/ckgl/bfccgrk';
import { useMessage } from '/@/hooks/web/useMessage';
const { notification } = useMessage();
const bfcList = ref<any[]>([]);
const loading = ref(false);
const columns = [
{ title: '车牌号', dataIndex: 'plate_number', key: 'plate_number' },
{ title: '批次号', dataIndex: 'batch_no', key: 'batch_no' },
{ title: '车辆类型', dataIndex: 'vehicle_type', key: 'vehicle_type' },
{ title: '品牌型号', dataIndex: 'brand_model', key: 'brand_model' },
{ title: '重量(kg)', dataIndex: 'weight_kg', key: 'weight_kg' },
{ title: '创建日期', dataIndex: 'create_date', key: 'create_date' },
];
const [registerModal] = useModalInner(async (data) => {
const { bfcIds } = data;
if (!bfcIds) {
bfcList.value = [];
return;
}
loading.value = true;
try {
const res = await getBfcListByids(bfcIds);
console.log(res);
// 直接使用 res,因为后端返回的就是数组
bfcList.value = Array.isArray(res) ? res : [];
} catch (error) {
notification.error({ message: '请求失败', description: (error as Error).message });
bfcList.value = [];
} finally {
loading.value = false;
}
});
</script>
<style scoped>
.empty-text {
text-align: center;
padding: 40px 0;
color: #999;
}
</style>
......@@ -1193,6 +1193,37 @@ export const formProps: FormProps = {
},
},
{
key: 'c2ebafaed93d4fd6862b02da913f0e30',
title: '报废车车牌',
dataIndex: 'bfcCodes',
componentType: 'Input',
defaultValue: '',
componentProps: {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入报废车车牌',
maxlength: null,
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: true,
allowClear: false,
showLabel: true,
required: false,
rules: [],
events: {},
listStyle: '',
isSave: false,
isShow: true,
scan: false,
bordered: true,
isShowAi: false,
tooltipConfig: { visible: false, title: '提示文本' },
},
},
{
key: '8ea1afc68d394f818b139e6b14622088',
title: '报废车id',
dataIndex: 'bfcIds',
......@@ -1202,12 +1233,12 @@ export const formProps: FormProps = {
width: '100%',
span: '',
defaultValue: '',
placeholder: '请输入报废车id报废车id报废车id',
placeholder: '请输入报废车id',
prefix: '',
suffix: '',
addonBefore: '',
addonAfter: '',
disabled: false,
disabled: true,
allowClear: false,
showLabel: true,
required: false,
......@@ -1215,7 +1246,7 @@ export const formProps: FormProps = {
events: {},
listStyle: '',
isSave: false,
isShow: true,
isShow: false,
scan: false,
bordered: true,
isShowAi: false,
......@@ -1255,6 +1286,12 @@ export const formProps: FormProps = {
mainComponent:
'{"key":"8ea1afc68d394f818b139e6b14622088","table":"mes_warehouse_in_info","field":"bfc_ids"}',
},
{
name: 'plateNumbers',
component: '{"table":"table_96346","field":"platenumbers9576"}',
mainComponent:
'{"key":"c2ebafaed93d4fd6862b02da913f0e30","table":"mes_warehouse_in_info","field":"bfc_codes"}',
},
],
modalWidth: 900,
modalWidthUnit: 'px',
......@@ -1274,6 +1311,20 @@ export const formProps: FormProps = {
],
type: 2,
},
{
key: 'button1774255831447',
label: '查看关联报废车',
icon: 'ant-design:align-left-outlined',
event: [
{
operateType: 2,
operateConfig: {
js: 'window.showBfcModal && window.showBfcModal(curRowData)',
},
},
],
type: 1,
},
],
topButtonList: [],
isExport: false,
......
......@@ -92,6 +92,10 @@ declare global {
[elem: string]: any;
}
}
interface Window {
showBfcModal?: (rowData: any) => void;
}
}
declare module 'vue' {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment