diff --git a/src/components/File/index.vue b/src/components/File/index.vue index 1a6f43a3..f7ad43ed 100644 --- a/src/components/File/index.vue +++ b/src/components/File/index.vue @@ -123,6 +123,11 @@ show: false, }, }, + // 未传递 ID 时,是否先触发保存 + TriggerSave: { + type: Boolean, + default: false, + }, }) // 弹窗开关 const visible = ref(false) @@ -180,15 +185,19 @@ // 打开附件弹窗 const openFileModel = () => { - if (!props.id) { - return createMessage.warning('未检索到业务id,请先保存数据!') + if (props.TriggerSave && !props.id) { + emits('FnTriggerSave') + } else { + if (!props.id) { + return createMessage.warning('未检索到业务id,请先保存数据!') + } + init() } - init() } const fileForm = ref(null) // 附件列表组件 const dsFileList = ref(null) - const emits = defineEmits(['handleSuccess']) + const emits = defineEmits(['handleSuccess', 'FnTriggerSave']) // 提交上传 const handleOk = async () => { const res = await fileForm.value.validateFields() @@ -237,6 +246,7 @@ defineExpose({ init, dsFileList, + openFileModel, }) diff --git a/src/views/ContainerManagement/CurrentState/columns.tsx b/src/views/ContainerManagement/CurrentState/columns.tsx index db253911..3d8e0c64 100644 --- a/src/views/ContainerManagement/CurrentState/columns.tsx +++ b/src/views/ContainerManagement/CurrentState/columns.tsx @@ -183,7 +183,7 @@ export const searchFormSchema: FormSchema[] = [ field: 'cntrno', label: '箱号', component: 'Input', - colProps: { span: 4 }, + colProps: { span: 8 }, }, { field: 'ctnOwner', diff --git a/src/views/ContainerManagement/CurrentState/index.vue b/src/views/ContainerManagement/CurrentState/index.vue index 573e38c3..499e9d15 100644 --- a/src/views/ContainerManagement/CurrentState/index.vue +++ b/src/views/ContainerManagement/CurrentState/index.vue @@ -50,7 +50,18 @@ }) }, beforeFetch: (p) => { - return formatParams(p, ['ctnOwner', 'ctnSourceId', 'isOnlineId', 'portid']) + let Rdata = formatParams(p, ['ctnOwner', 'ctnSourceId', 'isOnlineId', 'portid']) + if (!!p.cntrno) { + let data = JSON.parse(Rdata.queryCondition) + data.forEach((item, index) => { + if (item.FieldName == 'cntrno') { + console.log(item) + item.ConditionalType = 15 + } + }) + Rdata.queryCondition = JSON.stringify(data) + } + return Rdata }, columns, formConfig: { diff --git a/src/views/ContainerManagement/RentIn/TenantAuditStepModal.vue b/src/views/ContainerManagement/RentIn/TenantAuditStepModal.vue index baebd96d..186b28fe 100644 --- a/src/views/ContainerManagement/RentIn/TenantAuditStepModal.vue +++ b/src/views/ContainerManagement/RentIn/TenantAuditStepModal.vue @@ -86,11 +86,14 @@ - + + { - activeKey.value = '1' - refresh() - notification.success({ message: res.message, duration: 3 }) - }) - } else { - notification.warning({ message: '请先在电子文档中勾选一个文件。', duration: 3 }) + dsFile.value.openFileModel() + } + } + async function DealExcel() { + if (!rowId.value) { + await handleSave(false) + } + if (dsFile.value.dsFileList.SelectId) { + let ApiData: any = { + id: unref(rowId), + formName: 'CM_RentIn', + tableName: '', + fileId: dsFile.value.dsFileList.SelectId, } + ApiDealExcel(ApiData).then((res) => { + activeKey.value = '1' + refresh() + notification.success({ message: res.message, duration: 3 }) + }) } else { - notification.warning({ message: '请先保存', duration: 3 }) + notification.warning({ message: '请先在电子文档中勾选一个文件。', duration: 3 }) } } async function handleSave(exit) {