Commit 6a8a1691 by 董晓奇

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

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

1.添加明细行中查看关联报废车按钮
2.将报废车入库与采购入库通过单据类型字段分开
3.添加清理数据表sql文件
4.添加报废车关联校验接口
5.去除不能修改用户和重置密码的限制
parent d618696e
...@@ -44,7 +44,7 @@ VITE_GLOB_API_URL_PREFIX = ...@@ -44,7 +44,7 @@ VITE_GLOB_API_URL_PREFIX =
VITE_USE_PWA = false VITE_USE_PWA = false
# 是否启用官网代码 # 是否启用官网代码
VITE_GLOB_PRODUCTION = true VITE_GLOB_PRODUCTION = false
# 帆软服务地址 # 帆软服务地址
VITE_GLOB_FINE_REPORT_URL = http://127.0.0.1:8075 VITE_GLOB_FINE_REPORT_URL = http://127.0.0.1:8075
...@@ -44,7 +44,7 @@ VITE_GLOB_API_URL_PREFIX = ...@@ -44,7 +44,7 @@ VITE_GLOB_API_URL_PREFIX =
VITE_USE_PWA = false VITE_USE_PWA = false
# 是否启用官网代码 # 是否启用官网代码
VITE_GLOB_PRODUCTION = true VITE_GLOB_PRODUCTION = false
# 帆软服务地址 # 帆软服务地址
VITE_GLOB_FINE_REPORT_URL = http://127.0.0.1:8075 VITE_GLOB_FINE_REPORT_URL = http://127.0.0.1:8075
import {
import { MesWarehouseInPageModel, MesWarehouseInPageParams, MesWarehouseInPageResult } from './model/BfccgrkModel'; MesWarehouseInPageModel,
MesWarehouseInPageParams,
MesWarehouseInPageResult,
} from './model/BfccgrkModel';
import { defHttp } from '/@/utils/http/axios'; import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios'; import { ErrorMessageMode } from '/#/axios';
...@@ -8,16 +11,17 @@ enum Api { ...@@ -8,16 +11,17 @@ enum Api {
List = '/ckgl/bfccgrk/list', List = '/ckgl/bfccgrk/list',
Info = '/ckgl/bfccgrk/info', Info = '/ckgl/bfccgrk/info',
MesWarehouseIn = '/ckgl/bfccgrk', MesWarehouseIn = '/ckgl/bfccgrk',
Export = '/ckgl/bfccgrk/export', Export = '/ckgl/bfccgrk/export',
ListByBfc = '/magic-api/getBfcListByids',
} }
/** /**
* @description: 查询MesWarehouseIn分页列表 * @description: 查询MesWarehouseIn分页列表
*/ */
export async function getMesWarehouseInPage(params: MesWarehouseInPageParams, mode: ErrorMessageMode = 'modal') { export async function getMesWarehouseInPage(
params: MesWarehouseInPageParams,
mode: ErrorMessageMode = 'modal',
) {
return defHttp.get<MesWarehouseInPageResult>( return defHttp.get<MesWarehouseInPageResult>(
{ {
url: Api.Page, url: Api.Page,
...@@ -47,7 +51,10 @@ export async function getMesWarehouseIn(id: String, mode: ErrorMessageMode = 'mo ...@@ -47,7 +51,10 @@ export async function getMesWarehouseIn(id: String, mode: ErrorMessageMode = 'mo
/** /**
* @description: 新增MesWarehouseIn * @description: 新增MesWarehouseIn
*/ */
export async function addMesWarehouseIn(mesWarehouseIn: Recordable, mode: ErrorMessageMode = 'modal') { export async function addMesWarehouseIn(
mesWarehouseIn: Recordable,
mode: ErrorMessageMode = 'modal',
) {
return defHttp.post<boolean>( return defHttp.post<boolean>(
{ {
url: Api.MesWarehouseIn, url: Api.MesWarehouseIn,
...@@ -62,7 +69,10 @@ export async function addMesWarehouseIn(mesWarehouseIn: Recordable, mode: ErrorM ...@@ -62,7 +69,10 @@ export async function addMesWarehouseIn(mesWarehouseIn: Recordable, mode: ErrorM
/** /**
* @description: 更新MesWarehouseIn * @description: 更新MesWarehouseIn
*/ */
export async function updateMesWarehouseIn(mesWarehouseIn: Recordable, mode: ErrorMessageMode = 'modal') { export async function updateMesWarehouseIn(
mesWarehouseIn: Recordable,
mode: ErrorMessageMode = 'modal',
) {
return defHttp.put<boolean>( return defHttp.put<boolean>(
{ {
url: Api.MesWarehouseIn, url: Api.MesWarehouseIn,
...@@ -89,15 +99,10 @@ export async function deleteMesWarehouseIn(ids: string[], mode: ErrorMessageMode ...@@ -89,15 +99,10 @@ export async function deleteMesWarehouseIn(ids: string[], mode: ErrorMessageMode
); );
} }
/** /**
* @description: 导出MesWarehouseIn * @description: 导出MesWarehouseIn
*/ */
export async function exportMesWarehouseIn( export async function exportMesWarehouseIn(params?: object, mode: ErrorMessageMode = 'modal') {
params?: object,
mode: ErrorMessageMode = 'modal'
) {
return defHttp.download( return defHttp.download(
{ {
url: Api.Export, url: Api.Export,
...@@ -111,4 +116,10 @@ export async function exportMesWarehouseIn( ...@@ -111,4 +116,10 @@ export async function exportMesWarehouseIn(
); );
} }
export async function getBfcListByids(ids: string) {
return defHttp.get<any>({
url: Api.ListByBfc,
params: { ids },
isTransformResponse: false, // 关闭自动转换,直接获取原始响应数据
});
}
<template> <template>
<BasicModal <BasicModal
:height="1080" :height="1080"
v-bind="$attrs" @register="registerModal" :title="getTitle" v-bind="$attrs"
@ok="handleSubmit" @cancel="handleClose" > @register="registerModal"
:title="getTitle"
@ok="handleSubmit"
@cancel="handleClose"
>
<ModalForm ref="formRef" v-model:value="state.formModel" :fromPage="FromPageType.MENU" /> <ModalForm ref="formRef" v-model:value="state.formModel" :fromPage="FromPageType.MENU" />
<template #footer v-if=" !state.isView"> <template #footer v-if="!state.isView">
<template v-for="(item, index) in sortBy(formButtons, 'index')" :key="item.key"> <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" /> <CustomButtonModal v-if="item.type == CustomButtonModalType.Modal" :info="item" />
...@@ -23,28 +24,45 @@ ...@@ -23,28 +24,45 @@
</template> </template>
</template> </template>
</BasicModal> </BasicModal>
<ShowBfcModal @register="registerBfcModal" />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed, reactive, provide, Ref } from 'vue'; import { ref, computed, reactive, provide, Ref, onMounted, onUnmounted } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal'; import { BasicModal, useModal, useModalInner } from '/@/components/Modal';
import { CustomButtonModalType } from '/@/enums/userEnum'; import { CustomButtonModalType } from '/@/enums/userEnum';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue'; import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n'; import { useI18n } from '/@/hooks/web/useI18n';
import { formProps ,formButtons } from './config'; import { formProps, formButtons } from './config';
import ModalForm from './Form.vue'; import ModalForm from './Form.vue';
import { FromPageType } from '/@/enums/workflowEnum'; import { FromPageType } from '/@/enums/workflowEnum';
import { sortBy } from 'lodash-es'; import { sortBy } from 'lodash-es';
import { executeCurFormEvent } from '/@/utils/event/data'; 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 emit = defineEmits(['success', 'register']);
const { notification } = useMessage(); const { notification } = useMessage();
const formRef = ref(); const formRef = ref();
const isCopy = ref<boolean>(false) const isCopy = ref<boolean>(false);
const state = reactive({ const state = reactive({
formModel: {}, formModel: {},
isUpdate: true, isUpdate: true,
...@@ -58,10 +76,11 @@ ...@@ -58,10 +76,11 @@
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.isUpdate = !!data?.isUpdate;
state.isView = !!data?.isView; state.isView = !!data?.isView;
isCopy.value = !!data?.isCopy; isCopy.value = !!data?.isCopy;
...@@ -73,7 +92,8 @@ ...@@ -73,7 +92,8 @@
showOkBtn: false, showOkBtn: false,
canFullscreen: true, canFullscreen: true,
width: 1980, width: 1980,
footer: state.isView ? null : undefined,defaultFullscreen:true, footer: state.isView ? null : undefined,
defaultFullscreen: true,
}); });
if (state.isUpdate || state.isView || isCopy.value) { if (state.isUpdate || state.isView || isCopy.value) {
...@@ -85,10 +105,9 @@ ...@@ -85,10 +105,9 @@
await formRef.value.setFormDataFromId(state.rowId); await formRef.value.setFormDataFromId(state.rowId);
} else { } else {
formRef.value.resetFields(); formRef.value.resetFields();
} }
} }
async function saveModal() { async function saveModal() {
let saveSuccess = false; let saveSuccess = false;
try { try {
...@@ -140,15 +159,14 @@ ...@@ -140,15 +159,14 @@
emit('success'); emit('success');
} }
} finally { } finally {
setModalProps({ confirmLoading: false }); setModalProps({ confirmLoading: false });
} }
} }
function customClick(item) { function customClick(item) {
if (item.key == 'confirm') { if (item.key == 'confirm') {
handleSubmit(); handleSubmit();
} else if (item.key == 'cancel' && props.formType !== 'normal') { } else if (item.key == 'cancel') {
handleClose(); handleClose();
closeModal(); closeModal();
} else if (item.key == 'reset') { } else if (item.key == 'reset') {
...@@ -157,10 +175,8 @@ ...@@ -157,10 +175,8 @@
executeCurFormEvent(item.event, state.formModel, true); executeCurFormEvent(item.event, state.formModel, true);
} }
} }
function handleClose() { function handleClose() {
formRef.value.resetFields(); formRef.value.resetFields();
} }
</script> </script>
\ No newline at end of file
<template> <template>
<div class="pt-4"> <div class="pt-4">
<SimpleForm <SimpleForm
ref="systemFormRef" ref="systemFormRef"
:formProps="data.formDataProps" :formProps="data.formDataProps"
:formModel="state.formModel" :formModel="state.formModel"
:isWorkFlow="props.fromPage!=FromPageType.MENU" :isWorkFlow="props.fromPage != FromPageType.MENU"
:isCamelCase="true" :isCamelCase="true"
@model-change="handleChange" @model-change="handleChange"
/> />
...@@ -21,7 +20,12 @@ ...@@ -21,7 +20,12 @@
import { usePermission } from '/@/hooks/web/usePermission'; import { usePermission } from '/@/hooks/web/usePermission';
import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue'; import CustomButtonModal from '/@/components/Form/src/components/CustomButtonModal.vue';
import { FromPageType } from '/@/enums/workflowEnum'; import { FromPageType } from '/@/enums/workflowEnum';
import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent,} from '/@/hooks/web/useFormEvent'; import {
createFormEvent,
getFormDataEvent,
loadFormEvent,
submitFormEvent,
} from '/@/hooks/web/useFormEvent';
import { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm'; import { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm';
import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig'; import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
...@@ -29,7 +33,7 @@ ...@@ -29,7 +33,7 @@
const { filterFormSchemaAuth } = usePermission(); const { filterFormSchemaAuth } = usePermission();
const RowKey = 'id'; const RowKey = 'id';
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'update:value']); const emits = defineEmits(['changeUploadComponentIds', 'loadingCompleted', 'update:value']);
const props = defineProps({ const props = defineProps({
fromPage: { fromPage: {
type: Number, type: Number,
...@@ -42,7 +46,7 @@ ...@@ -42,7 +46,7 @@
}); });
const state = reactive({ const state = reactive({
formModel: {}, formModel: {},
formInfo:{formId:'',formName:''} formInfo: { formId: '', formName: '' },
}); });
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
watch( watch(
...@@ -59,17 +63,35 @@ ...@@ -59,17 +63,35 @@
try { try {
if (props.fromPage == FromPageType.MENU) { if (props.fromPage == FromPageType.MENU) {
setMenuPermission(); setMenuPermission();
if(currentRoute.value.meta){ if (currentRoute.value.meta) {
state.formInfo.formName = currentRoute.value.meta.title&&isString(currentRoute.value.meta.title)?currentRoute.value.meta.title:''; state.formInfo.formName =
state.formInfo.formId = currentRoute.value.meta.formId&&isString(currentRoute.value.meta.formId)?currentRoute.value.meta.formId:''; currentRoute.value.meta.title && isString(currentRoute.value.meta.title)
? currentRoute.value.meta.title
: '';
state.formInfo.formId =
currentRoute.value.meta.formId && isString(currentRoute.value.meta.formId)
? currentRoute.value.meta.formId
: '';
} }
await createFormEvent(formEventConfigs, state.formModel, await createFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单 formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:初始化表单
await nextTick(); await nextTick();
await loadFormEvent(formEventConfigs, state.formModel, await loadFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单 formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:加载表单
} else if (props.fromPage == FromPageType.FLOW) { } else if (props.fromPage == FromPageType.FLOW) {
emits('loadingCompleted'); //告诉系统表单已经加载完毕 emits('loadingCompleted'); //告诉系统表单已经加载完毕
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法 // loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
...@@ -78,15 +100,28 @@ ...@@ -78,15 +100,28 @@
} else if (props.fromPage == FromPageType.DESKTOP) { } else if (props.fromPage == FromPageType.DESKTOP) {
// 桌面设计 表单事件需要执行 // 桌面设计 表单事件需要执行
emits('loadingCompleted'); //告诉系统表单已经加载完毕 emits('loadingCompleted'); //告诉系统表单已经加载完毕
await createFormEvent(formEventConfigs, state.formModel, await createFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单 formProps.schemas,
await loadFormEvent(formEventConfigs, state.formModel, true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:初始化表单
await loadFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单 formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:加载表单
} }
} catch (error) {} } catch (error) {}
}); });
// 根据菜单页面权限,设置表单属性(必填,禁用,显示) // 根据菜单页面权限,设置表单属性(必填,禁用,显示)
function setMenuPermission() { function setMenuPermission() {
data.formDataProps.schemas = filterFormSchemaAuth(data.formDataProps.schemas!); data.formDataProps.schemas = filterFormSchemaAuth(data.formDataProps.schemas!);
...@@ -107,19 +142,25 @@ ...@@ -107,19 +142,25 @@
} }
return values; return values;
} }
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】 // 根据行唯一ID查询行数据,并设置表单数据 【编辑】
async function setFormDataFromId(rowId) { async function setFormDataFromId(rowId) {
try { try {
const record = await getMesWarehouseIn(rowId); const record = await getMesWarehouseIn(rowId);
setFieldsValue(record); setFieldsValue(record);
state.formModel = record; state.formModel = record;
await getFormDataEvent(formEventConfigs, state.formModel, await getFormDataEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:获取表单数据 formProps.schemas,
} catch (error) { true,
state.formInfo.formName,
} state.formInfo.formId,
); //表单事件:获取表单数据
} catch (error) {}
} }
// 辅助返回表单数据 // 辅助返回表单数据
async function getFieldsValue() { async function getFieldsValue() {
let values = []; let values = [];
...@@ -135,45 +176,64 @@ ...@@ -135,45 +176,64 @@
} }
return values; return values;
} }
// 辅助设置表单数据 // 辅助设置表单数据
function setFieldsValue(record) { function setFieldsValue(record) {
systemFormRef.value.setFieldsValue(record); systemFormRef.value.setFieldsValue(record);
} }
// 重置表单数据 // 重置表单数据
async function resetFields() { async function resetFields() {
await systemFormRef.value.resetFields(); await systemFormRef.value.resetFields();
} }
// 设置表单数据全部为Disabled 【查看】 // 设置表单数据全部为Disabled 【查看】
async function setDisabledForm( ) { async function setDisabledForm() {
data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas)); data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas));
} }
// 获取行键值 // 获取行键值
function getRowKey() { function getRowKey() {
return RowKey; return RowKey;
} }
// 更新api表单数据 // 更新api表单数据
async function update({ values, rowId }) { async function update({ values, rowId }) {
try { try {
values[RowKey] = rowId; values[RowKey] = rowId;
state.formModel = values; state.formModel = values;
let saveVal = await updateMesWarehouseIn(values); let saveVal = await updateMesWarehouseIn(values);
await submitFormEvent(formEventConfigs, state.formModel, await submitFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单 formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:提交表单
return saveVal; return saveVal;
} catch (error) {} } catch (error) {}
} }
// 新增api表单数据 // 新增api表单数据
async function add(values) { async function add(values) {
try { try {
state.formModel = values; state.formModel = values;
let saveVal = await addMesWarehouseIn(values); let saveVal = await addMesWarehouseIn(values);
await submitFormEvent(formEventConfigs, state.formModel, await submitFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:提交表单 formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:提交表单
return saveVal; return saveVal;
} catch (error) {} } catch (error) {}
} }
// 根据工作流页面权限,设置表单属性(必填,禁用,显示) // 根据工作流页面权限,设置表单属性(必填,禁用,显示)
async function setWorkFlowForm(obj: WorkFlowFormParams) { async function setWorkFlowForm(obj: WorkFlowFormParams) {
try { try {
...@@ -189,16 +249,30 @@ ...@@ -189,16 +249,30 @@
state.formModel = formModels; state.formModel = formModels;
setFieldsValue(formModels); setFieldsValue(formModels);
} catch (error) {} } catch (error) {}
await createFormEvent(formEventConfigs, state.formModel, await createFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:初始化表单 formProps.schemas,
await loadFormEvent(formEventConfigs, state.formModel, true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:初始化表单
await loadFormEvent(
formEventConfigs,
state.formModel,
systemFormRef.value, systemFormRef.value,
formProps.schemas, true, state.formInfo.formName,state.formInfo.formId); //表单事件:加载表单 formProps.schemas,
true,
state.formInfo.formName,
state.formInfo.formId,
); //表单事件:加载表单
} }
function handleChange(val) { function handleChange(val) {
emits('update:value', val); emits('update:value', val);
} }
async function sendMessageForAllIframe() { async function sendMessageForAllIframe() {
try { try {
if (systemFormRef.value && systemFormRef.value.sendMessageForAllIframe) { if (systemFormRef.value && systemFormRef.value.sendMessageForAllIframe) {
...@@ -206,6 +280,7 @@ ...@@ -206,6 +280,7 @@
} }
} catch (error) {} } catch (error) {}
} }
defineExpose({ defineExpose({
setFieldsValue, setFieldsValue,
resetFields, resetFields,
...@@ -218,8 +293,6 @@ ...@@ -218,8 +293,6 @@
setWorkFlowForm, setWorkFlowForm,
getRowKey, getRowKey,
getFieldsValue, getFieldsValue,
sendMessageForAllIframe sendMessageForAllIframe,
}); });
</script> </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 = { ...@@ -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', key: '8ea1afc68d394f818b139e6b14622088',
title: '报废车id', title: '报废车id',
dataIndex: 'bfcIds', dataIndex: 'bfcIds',
...@@ -1202,12 +1233,12 @@ export const formProps: FormProps = { ...@@ -1202,12 +1233,12 @@ export const formProps: FormProps = {
width: '100%', width: '100%',
span: '', span: '',
defaultValue: '', defaultValue: '',
placeholder: '请输入报废车id报废车id报废车id', placeholder: '请输入报废车id',
prefix: '', prefix: '',
suffix: '', suffix: '',
addonBefore: '', addonBefore: '',
addonAfter: '', addonAfter: '',
disabled: false, disabled: true,
allowClear: false, allowClear: false,
showLabel: true, showLabel: true,
required: false, required: false,
...@@ -1215,7 +1246,7 @@ export const formProps: FormProps = { ...@@ -1215,7 +1246,7 @@ export const formProps: FormProps = {
events: {}, events: {},
listStyle: '', listStyle: '',
isSave: false, isSave: false,
isShow: true, isShow: false,
scan: false, scan: false,
bordered: true, bordered: true,
isShowAi: false, isShowAi: false,
...@@ -1255,6 +1286,12 @@ export const formProps: FormProps = { ...@@ -1255,6 +1286,12 @@ export const formProps: FormProps = {
mainComponent: mainComponent:
'{"key":"8ea1afc68d394f818b139e6b14622088","table":"mes_warehouse_in_info","field":"bfc_ids"}', '{"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, modalWidth: 900,
modalWidthUnit: 'px', modalWidthUnit: 'px',
...@@ -1274,6 +1311,20 @@ export const formProps: FormProps = { ...@@ -1274,6 +1311,20 @@ export const formProps: FormProps = {
], ],
type: 2, type: 2,
}, },
{
key: 'button1774255831447',
label: '查看关联报废车',
icon: 'ant-design:align-left-outlined',
event: [
{
operateType: 2,
operateConfig: {
js: 'window.showBfcModal && window.showBfcModal(curRowData)',
},
},
],
type: 1,
},
], ],
topButtonList: [], topButtonList: [],
isExport: false, isExport: false,
......
...@@ -92,6 +92,10 @@ declare global { ...@@ -92,6 +92,10 @@ declare global {
[elem: string]: any; [elem: string]: any;
} }
} }
interface Window {
showBfcModal?: (rowData: any) => void;
}
} }
declare module 'vue' { 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