This commit is contained in:
‘huanghaiixia’
2026-03-04 16:31:44 +08:00
parent 90fd1c6f98
commit 03dc292d57
20 changed files with 971 additions and 97 deletions

View File

@ -0,0 +1,134 @@
<template>
<div>
<BasicModal v-bind="$attrs" @register="registerModal" width="60%" :title="getTitle" @ok="handleSubmit"
@visible-change="handleVisibleChange" >
<BasicTable @register="registerTable" class="ContractPurIntListModal"></BasicTable>
</BasicModal>
</div>
</template>
<script lang="ts" setup>
import { ref, computed, unref, nextTick } from 'vue';
import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { getContractPageList} from '/@/api/ship/ShipSchedule';
const { t } = useI18n();
const codeFormSchema: FormSchema[] = [
{ field: 'kName', label: '合同号/名称', component: 'Input'},
{
field: 'dateFrom',
label: '有效期',
component: 'RangePicker',
componentProps: {
format: 'YYYY-MM-DD',
style: { width: '100%' },
getPopupContainer: () => document.body,
},
},
];
const columns: BasicColumn[] = [
{ title: t('合同号'), dataIndex: 'kNo', },
{ title: t('合同名称'), dataIndex: 'kName', },
{ title: t('供应商'), dataIndex: 'suName' ,},
{ title: '有效期开始',dataIndex: 'dateFrom', width: 120,},
{ title: '有效期结束',dataIndex: 'dateTo', width: 120},
{ title: t('合同主体'), dataIndex: 'comName', },
{ title: t('长协/现货'), dataIndex: 'longSpotName'},
{ title: t('气源地'), dataIndex: 'sourceName'},
{ title: t('价格条款'), dataIndex: 'prcTermName'},
];
const emit = defineEmits(['success', 'register']);
const { notification } = useMessage();
const isUpdate = ref(true);
const rowId = ref('');
const selectedKeys = ref<string[]>([]);
const selectedValues = ref([]);
const props = defineProps({
selectType: { type: String, default: 'checkbox' },
});
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
});
const [registerTable, { getDataSource, setTableData, updateTableDataRecord, reload }] = useTable({
title: t('国际采购合同列表'),
api: getContractPageList,
columns,
bordered: true,
pagination: true,
canResize: false,
formConfig: {
labelCol:{span: 9, offSet:10},
schemas: codeFormSchema,
fieldMapToTime: [['dateFrom', ['startDate', 'endDate'], 'YYYY-MM-DD']],
showResetButton: true,
},
immediate: false, // 设置为不立即调用
beforeFetch: (params) => {
return { ...params,page:params.limit};
},
rowSelection: {
type: props.selectType,
onChange: onSelectChange
},
});
const handleVisibleChange = (visible: boolean) => {
if (visible) {
nextTick(() => {
reload();
});
}
};
function onSelectChange(rowKeys: string[], e) {
selectedKeys.value = rowKeys;
selectedValues.value = e
}
const getTitle = computed(() => (!unref(isUpdate) ? t('国际采购合同列表') : t('')));
async function handleSubmit() {
if (!selectedValues.value.length) {
notification.warning({
message: t('提示'),
description: t('请选择合同')
});
return
}
closeModal();
emit('success', selectedValues.value);
}
</script>
<style >
.ContractPurIntListModal .basicCol{
position: inherit !important;
top: 0;
}
</style>
<style lang="less" scoped>
:deep( .ant-col-8:nth-child(2)) {
width: 360px !important;
max-width: 360px !important;;
}
:deep(.ant-col-8:nth-child(2) .ant-form-item-label) {
width: 80px !important;
}
</style>

View File

@ -81,7 +81,7 @@
selectedKeys.value = rowKeys;
selectedValues.value = e
}
const getTitle = computed(() => (!unref(isUpdate) ? t('列表') : t('')));
const getTitle = computed(() => (!unref(isUpdate) ? t('接收站列表') : t('')));
function handleCancel () {
emit('cancel',);
}

View File

@ -0,0 +1,118 @@
<template>
<div>
<BasicModal v-bind="$attrs" @register="registerModal" width="60%" :title="getTitle" @ok="handleSubmit"
@visible-change="handleVisibleChange" >
<BasicTable @register="registerTable" class="portListModal"></BasicTable>
</BasicModal>
</div>
</template>
<script lang="ts" setup>
import { ref, computed, unref, nextTick } from 'vue';
import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { getLngBPortPage } from '/@/api/mdm/Port';
const { t } = useI18n();
const codeFormSchema: FormSchema[] = [
{ field: 'fullName', label: '名称', component: 'Input'},
];
const columns: BasicColumn[] = [
{ title: t('编码'), dataIndex: 'code', },
{ title: t('名称'), dataIndex: 'fullName', },
{ title: t('简称'), dataIndex: 'shortName' ,},
{ title: '所属国家和地区',dataIndex: 'regionCode'},
];
const emit = defineEmits(['success', 'register']);
const { notification } = useMessage();
const isUpdate = ref(true);
const rowId = ref('');
const selectedKeys = ref<string[]>([]);
const selectedValues = ref([]);
const props = defineProps({
selectType: { type: String, default: 'radio' },
});
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
});
const [registerTable, { getDataSource, setTableData, updateTableDataRecord, reload }] = useTable({
title: t('港口列表'),
api: getLngBPortPage,
columns,
bordered: true,
pagination: true,
canResize: false,
formConfig: {
labelCol:{span: 9, offSet:10},
schemas: codeFormSchema,
showResetButton: true,
},
immediate: false, // 设置为不立即调用
beforeFetch: (params) => {
return { ...params,page:params.limit, valid:'Y'};
},
rowSelection: {
type: props.selectType,
onChange: onSelectChange
},
});
const handleVisibleChange = (visible: boolean) => {
if (visible) {
nextTick(() => {
reload();
});
}
};
function onSelectChange(rowKeys: string[], e) {
selectedKeys.value = rowKeys;
selectedValues.value = e
}
const getTitle = computed(() => (!unref(isUpdate) ? t('港口列表') : t('')));
async function handleSubmit() {
if (!selectedValues.value.length) {
notification.warning({
message: t('提示'),
description: t('请选择港口')
});
return
}
closeModal();
emit('success', selectedValues.value);
}
</script>
<style >
.portListModal .basicCol{
position: inherit !important;
top: 0;
}
</style>
<style lang="less" scoped>
:deep( .ant-col-8:nth-child(2)) {
width: 360px !important;
max-width: 360px !important;;
}
:deep(.ant-col-8:nth-child(2) .ant-form-item-label) {
width: 80px !important;
}
</style>

View File

@ -7,7 +7,7 @@
@ok="handleOk"
@cancel="handleCancel"
>
<a-table :style="{ padding: '0 5px'}" :columns="columns" :data-source="data" :scroll="{y: 400}" :pagination="false" :row-key="record => record.id"/>
<a-table :style="{ padding: '0 5px'}" :loading="loading" :columns="columns" :data-source="data" :scroll="{y: 400}" :pagination="false" :row-key="record => record.id"/>
</a-modal>
</div>
@ -16,6 +16,7 @@
import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';
import { watch, defineProps, ref, computed, onMounted, onUnmounted, createVNode, reactive, } from 'vue';
const loading = ref()
const columns = [
{
title: '表名',
@ -132,8 +133,6 @@ const handleCancel = () => {
emit('cancel');
visible.value = false;
};
console.log(props.logId, 444, props.logPath)
interface DataItem {
children?: DataItem[];
}
@ -163,8 +162,14 @@ console.log(props.logId, 444, props.logPath)
}
async function getLog() {
data.value = await getDataLogData(props.logId,props.logPath,{})
console.log(data.value, 88)
loading.value = true
try {
data.value = await getDataLogData(props.logId,props.logPath,{})
loading.value = false
} catch (error) {
loading.value = false
}
}
onMounted( async() => {