采购计量
This commit is contained in:
@ -3,7 +3,8 @@ import { defHttp } from '/@/utils/http/axios';
|
||||
import { ErrorMessageMode } from '/#/axios';
|
||||
|
||||
enum Api {
|
||||
Page = '/ship/meaPurInt/page',
|
||||
// Page = '/ship/meaPurInt/page',
|
||||
Page = '/magic-api/ship/meaPurIntPageList',
|
||||
List = '/ship/meaPurInt/list',
|
||||
Info = '/ship/meaPurInt/info',
|
||||
LngMeaPurInt = '/ship/meaPurInt',
|
||||
|
||||
136
src/components/common/OpsPurIntListModal.vue
Normal file
136
src/components/common/OpsPurIntListModal.vue
Normal file
@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" width="60%" :title="getTitle" @ok="handleSubmit"
|
||||
@visible-change="handleVisibleChange" >
|
||||
<BasicTable @register="registerTable" class="OpsPurIntListModal" v-if="showTable"></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 { getLngOpsPurIntPage} from '/@/api/ship/OpsPurInt';
|
||||
|
||||
const { t } = useI18n();
|
||||
const codeFormSchema: FormSchema[] = [
|
||||
{ field: 'ssNo', label: '船期编号', component: 'Input'},
|
||||
{
|
||||
field: 'dateFrom',
|
||||
label: '卸港ETA',
|
||||
component: 'RangePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD',
|
||||
style: { width: '100%' },
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const columns: BasicColumn[] = [
|
||||
{ title: t('船期编号'), dataIndex: 'ssNo', },
|
||||
{ title: t('合同'), dataIndex: 'kName', },
|
||||
{ title: t('交易主体'), dataIndex: 'comName', },
|
||||
{ title: t('卸港ETA'), dataIndex: 'dateEta'},
|
||||
{ title: t('接收站'), dataIndex: 'staName'},
|
||||
{ title: t('供应商'), dataIndex: 'suName'},
|
||||
|
||||
];
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
|
||||
const { notification } = useMessage();
|
||||
const isUpdate = ref(true);
|
||||
const showTable = ref(false)
|
||||
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) => {
|
||||
showTable.value = true
|
||||
setModalProps({ confirmLoading: false });
|
||||
setPagination({'limit': 1,'size': 10,'page': 1});
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
});
|
||||
|
||||
const [registerTable, { getDataSource, setTableData, updateTableDataRecord, reload,setPagination }] = useTable({
|
||||
title: t('采购执行列表'),
|
||||
api: getLngOpsPurIntPage,
|
||||
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 = async (visible: boolean) => {
|
||||
if (visible) {
|
||||
showTable.value = false
|
||||
await nextTick();
|
||||
await nextTick();
|
||||
await nextTick();
|
||||
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 >
|
||||
.OpsPurIntListModal .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>
|
||||
@ -49,7 +49,7 @@
|
||||
const selectedKeys = ref<string[]>([]);
|
||||
const selectedValues = ref([]);
|
||||
const props = defineProps({
|
||||
selectType: { type: String, default: 'checkbox' },
|
||||
selectType: { type: String, default: 'radio' },
|
||||
|
||||
});
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
@ -93,7 +93,7 @@
|
||||
selectedKeys.value = rowKeys;
|
||||
selectedValues.value = e
|
||||
}
|
||||
const getTitle = computed(() => (!unref(isUpdate) ? t('船期计划列表列表') : t('')));
|
||||
const getTitle = computed(() => (!unref(isUpdate) ? t('船期计划列表') : t('')));
|
||||
|
||||
async function handleSubmit() {
|
||||
if (!selectedValues.value.length) {
|
||||
|
||||
@ -334,6 +334,14 @@ export const PAGE_CUSTOM_ROUTE: AppRouteRecordRaw[] = [{
|
||||
title: (route) => route.query.formName
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/ship/MeaPurInt/createForm',
|
||||
name: 'MeaPurInt',
|
||||
component: () => import('/@/views/ship/MeaPurInt/components/createForm.vue'),
|
||||
meta: {
|
||||
title: (route) => route.query.formName
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
|
||||
@ -10,108 +10,65 @@ export const searchFormSchema: FormSchema[] = [
|
||||
field: 'dateMea',
|
||||
label: '计量时间',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'typeCode',
|
||||
label: '计量类型',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'inspName',
|
||||
label: '商检公司',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
label: 'id',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'qtyMmbtu',
|
||||
label: '热值(MMBtu)',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'qtyGj',
|
||||
label: '热值(GJ)',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'qtyTon',
|
||||
label: '重量(吨)',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'qtyM3L',
|
||||
label: '液态体积(方)',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'qtyM3',
|
||||
label: '气态体积(方)',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'rateTonM3L',
|
||||
label: '密度(吨/液态方)',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'rateTonGj',
|
||||
label: '热值比(吨/GJ)',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'rateM3Gj',
|
||||
label: '热值比(气态方/GJ)',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'rateTonM3',
|
||||
label: '气化率(吨/气态方)',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'note',
|
||||
label: '备注',
|
||||
component: 'Input',
|
||||
},
|
||||
}
|
||||
];
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
dataIndex: 'id',
|
||||
title: 'id',
|
||||
dataIndex: 'ssNo',
|
||||
title: '船期计划编号',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 120,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'kName',
|
||||
title: '合同',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
width: 150,
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'suName',
|
||||
title: '供应商',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
width: 150,
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'staName',
|
||||
title: '接收站',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
width: 120,
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'typeName',
|
||||
title: '计量类型',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
width: 100,
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'dateMea',
|
||||
title: '计量时间',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 120,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'typeCode',
|
||||
title: '计量类型',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'qtyMmbtu',
|
||||
title: '热值(MMBtu)',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 120,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
@ -120,7 +77,7 @@ export const columns: BasicColumn[] = [
|
||||
title: '热值(GJ)',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 120,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
@ -129,34 +86,7 @@ export const columns: BasicColumn[] = [
|
||||
title: '重量(吨)',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'qtyM3L',
|
||||
title: '液态体积(方)',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'qtyM3',
|
||||
title: '气态体积(方)',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'rateTonM3L',
|
||||
title: '密度(吨/液态方)',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 120,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
@ -165,45 +95,20 @@ export const columns: BasicColumn[] = [
|
||||
title: '热值比(吨/GJ)',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 120,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'rateM3Gj',
|
||||
title: '热值比(气态方/GJ)',
|
||||
title: '热值比(方/GJ)',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
width: 120,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'rateTonM3',
|
||||
title: '气化率(吨/气态方)',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'inspName',
|
||||
title: '商检公司',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'note',
|
||||
title: '备注',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
];
|
||||
//表单事件
|
||||
export const formEventConfigs = {
|
||||
|
||||
353
src/views/ship/MeaPurInt/components/createForm.vue
Normal file
353
src/views/ship/MeaPurInt/components/createForm.vue
Normal file
@ -0,0 +1,353 @@
|
||||
<template>
|
||||
<a-spin :spinning="spinning" tip="加载中...">
|
||||
|
||||
<div class="page-bg-wrap formViewStyle pdcss">
|
||||
<div class="top-toolbar" >
|
||||
<a-button style="margin-right: 10px" @click="close">
|
||||
<slot name="icon"><close-outlined /></slot>关闭
|
||||
</a-button>
|
||||
<template v-if="pageType!=='view'">
|
||||
<a-button style="margin-right: 10px" type="primary" @click="handleSubmit">
|
||||
<slot name="icon"><save-outlined /></slot>保存
|
||||
</a-button>
|
||||
</template>
|
||||
</div>
|
||||
<a-form ref="formRef" :model="formState" :rules="rules" v-bind="layout">
|
||||
<Card title="基础信息" :bordered="false" >
|
||||
<a-row>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="船期编号" name="ssNo">
|
||||
<a-input-search v-model:value="formState.ssNo" :disabled="Boolean(isDisable || pageType )" placeholder="请选择船期" readonly @search="onSearchShip"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="交易主体" name="comName">
|
||||
<a-input v-model:value="formState.comName" disabled/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="8">
|
||||
<a-form-item label="合同" name="kName">
|
||||
<a-input v-model:value="formState.kName" disabled />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="供应商" name="suName">
|
||||
<a-input v-model:value="formState.suName" disabled/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="接收站" name="staName">
|
||||
<a-input-search v-model:value="formState.staName" disabled/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="卸港ETA" name="dateEta">
|
||||
<a-date-picker v-model:value="formState.dateEta" style="width: 100%" disabled />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="计量类型" name="typeCode">
|
||||
<a-select v-model:value="formState.typeCode" :disabled="isDisable" placeholder="请选择" style="width: 100%" allow-clear>
|
||||
<a-select-option v-for="item in optionSelect.typeCodeList" :key="item.code" :value="item.code">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="计量时间" name="dateMea">
|
||||
<a-date-picker v-model:value="formState.dateMea" style="width: 100%" placeholder="请选择" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="商检公司" name="inspName">
|
||||
<a-input v-model:value="formState.inspName" style="width: 100%" :disabled="isDisable" placeholder="请输入" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="热值(MMBtu)" name="qtyMmbtu">
|
||||
<input-number v-model:value="formState.qtyMmbtu" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" placeholder="请输入"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="热值(GJ)" name="qtyGj">
|
||||
<input-number v-model:value="formState.qtyGj" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" placeholder="请输入"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="重量(吨)" name="qtyTon">
|
||||
<input-number v-model:value="formState.qtyTon" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" placeholder="请输入"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="液态体积(方)" name="qtyM3L">
|
||||
<input-number v-model:value="formState.qtyM3L" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" placeholder="请输入"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="气态体积(方)" name="qtyM3">
|
||||
<input-number v-model:value="formState.qtyM3" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" placeholder="请输入"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="密度(吨/方)" name="rateTonM3L">
|
||||
<input-number v-model:value="formState.rateTonM3L" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" placeholder="请输入"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="热值比(吨/GJ)" name="rateTonGj">
|
||||
<input-number v-model:value="formState.rateTonGj" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" placeholder="请输入"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="热值比(方/GJ)" name="rateM3Gj">
|
||||
<input-number v-model:value="formState.rateM3Gj" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" placeholder="请输入"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="气化率(吨/方)" name="rateTonM3">
|
||||
<input-number v-model:value="formState.rateTonM3" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" placeholder="请输入"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="22">
|
||||
<a-form-item label="备注" name="note" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||
<a-textarea v-model:value="formState.note" :disabled="isDisable" placeholder="请输入备注,最多200字" :maxlength="200" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</Card>
|
||||
<Card title="附件信息" :bordered="false" >
|
||||
<UploadList :disabled="isDisable" :list="dataFile" :value="formState.filePath" :tableName="tableName" :columnName="columnName" @change="uploadListChange"/>
|
||||
</Card>
|
||||
</a-form>
|
||||
</div>
|
||||
<OpsPurIntListModal @register="registerShip" @success="handleSuccessShip" />
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { Card } from 'ant-design-vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { FromPageType, RecordType } from '/@/enums/workflowEnum';
|
||||
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
|
||||
import { SendOutlined, SaveOutlined, CloseOutlined, } from '@ant-design/icons-vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import type { Rule } from 'ant-design-vue/es/form';
|
||||
import { getDictionary } from '/@/api/sales/Customer';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { addLngMeaPurInt,updateLngMeaPurInt, getLngMeaPurInt} from '/@/api/ship/MeaPurInt';
|
||||
import dayjs from 'dayjs';
|
||||
import { getAppEnvConfig } from '/@/utils/env';
|
||||
import { message } from 'ant-design-vue';
|
||||
import UploadList from '/@/components/Form/src/components/UploadList.vue';
|
||||
import OpsPurIntListModal from '/@/components/common/OpsPurIntListModal.vue';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { getLngOpsPurInt} from '/@/api/ship/OpsPurInt';
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
|
||||
const tableName = 'MeaPurInt';
|
||||
const columnName = 'MeaPurInt'
|
||||
|
||||
const formType = ref('2'); // 0 新建 1 修改 2 查看
|
||||
const formRef = ref();
|
||||
const props = defineProps({
|
||||
disabled: false,
|
||||
id: ''
|
||||
|
||||
});
|
||||
const { bus, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
const router = useRouter();
|
||||
const { currentRoute } = router;
|
||||
const isDisable = ref(false);
|
||||
const { formPath } = currentRoute.value.query;
|
||||
const pathArr = [];
|
||||
|
||||
const tabStore = useMultipleTabStore();
|
||||
const formProps = ref(null);
|
||||
const formId = ref(currentRoute.value?.params?.id);
|
||||
const pageType = ref(currentRoute.value.query?.type);
|
||||
const pageId = ref(currentRoute.value.query?.id)
|
||||
|
||||
const spinning = ref(false);
|
||||
const { notification } = useMessage();
|
||||
const { t } = useI18n()
|
||||
|
||||
const formState = reactive({
|
||||
approCode: 'WTJ'
|
||||
});
|
||||
const [registerShip, { openModal:openModalShip}] = useModal();
|
||||
|
||||
const rules= reactive({
|
||||
ssNo: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
typeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
dateMea: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
qtyMmbtu: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
qtyGj: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
qtyTon: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
});
|
||||
const layout = {
|
||||
labelCol: { span: 8 },
|
||||
wrapperCol: { span: 16 },
|
||||
}
|
||||
const dataFile = ref([]);
|
||||
let optionSelect= reactive({
|
||||
typeCodeList: [],
|
||||
comIdList: [],
|
||||
});
|
||||
watch(
|
||||
() => props.id,
|
||||
(val) => {
|
||||
if (val) {
|
||||
getInfo(val)
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => props.disabled,
|
||||
(val) => {
|
||||
isDisable.value = val
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
onMounted(() => {
|
||||
isDisable.value = pageType.value == 'view'
|
||||
getOption()
|
||||
if (pageId.value) {
|
||||
getInfo(pageId.value)
|
||||
}
|
||||
});
|
||||
const uploadListChange = (val) => {
|
||||
dataFile.value = val
|
||||
}
|
||||
async function getInfo(id) {
|
||||
spinning.value = true
|
||||
try {
|
||||
let data = await getLngMeaPurInt(id)
|
||||
spinning.value = false
|
||||
Object.assign(formState, {...data})
|
||||
Object.assign(dataFile.value, formState.lngFileUploadList || [])
|
||||
formState.dateEta = formState.dateEta ? dayjs(formState.dateEta) : null
|
||||
formState.dateMea = formState.dateMea ? dayjs(formState.dateMea) : null
|
||||
|
||||
} catch (error) {
|
||||
spinning.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function getOption() {
|
||||
optionSelect.typeCodeList = await getDictionary('LNG_MEA_I')
|
||||
|
||||
}
|
||||
const onSearchShip = () => {
|
||||
openModalShip(true,{isUpdate: false})
|
||||
}
|
||||
const handleSuccessShip = (val) => {
|
||||
|
||||
formState.ssNo = val[0].ssNo
|
||||
formState.opsId = val[0].id
|
||||
getLngShipInfo(val[0].id)
|
||||
}
|
||||
const getLngShipInfo = async (id) => {
|
||||
try {
|
||||
spinning.value = true
|
||||
let data = await getLngOpsPurInt(id)
|
||||
spinning.value = false
|
||||
formState.comId = data.comId
|
||||
formState.comName = data.comName
|
||||
formState.kId = data.kId
|
||||
formState.kName = data.kName
|
||||
formState.suCode = data.suCode
|
||||
formState.suName = data.suName
|
||||
formState.staCode = data.staCode
|
||||
formState.staName = data.staName
|
||||
formState.dateMea = data.dateEta ? dayjs(data.dateEta) : null
|
||||
formState.dateEta = data.dateEta ? dayjs(data.dateEta) : null
|
||||
formState.inspName = data.inspName
|
||||
|
||||
} catch (error) {
|
||||
spinning.value = false
|
||||
}
|
||||
}
|
||||
function close() {
|
||||
tabStore.closeTab(currentRoute.value, router);
|
||||
}
|
||||
async function getFormValue() {
|
||||
return formState
|
||||
}
|
||||
async function handleSubmit(type) {
|
||||
try {
|
||||
await formRef.value.validateFields();
|
||||
let obj = {
|
||||
...formState,
|
||||
salesAreaCode: formState.salesAreaCode ? formState.salesAreaCode[formState.salesAreaCode.length -1] : '',
|
||||
lngFileUploadList: dataFile.value,
|
||||
}
|
||||
spinning.value = true;
|
||||
let request = !formState.id ? addLngMeaPurInt :updateLngMeaPurInt
|
||||
|
||||
try {
|
||||
const data = await request(obj);
|
||||
notification.success({
|
||||
message: '提示',
|
||||
description: data?.id ? t('新增成功!') : t('修改成功!')
|
||||
}); //提示消息
|
||||
|
||||
setTimeout(() => {
|
||||
bus.emit(FORM_LIST_MODIFIED, {});
|
||||
close();
|
||||
}, 500);
|
||||
|
||||
} finally {
|
||||
spinning.value = false;
|
||||
}
|
||||
|
||||
} catch (errorInfo) {
|
||||
spinning.value = false;
|
||||
errorInfo?.errorFields?.length && notification.warning({
|
||||
message: '提示',
|
||||
description: '请完善信息'
|
||||
});
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
handleSubmit,
|
||||
getFormValue
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-form-item .ant-form-item-label) {
|
||||
width: 135px !important;
|
||||
max-width: 135px !important;
|
||||
}
|
||||
.page-bg-wrap {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.top-toolbar {
|
||||
min-height: 44px;
|
||||
margin-bottom: 12px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.pdcss {
|
||||
padding:0px 12px 6px 12px !important;
|
||||
}
|
||||
:deep(.formItemWarp .ant-form-item-label > label) {
|
||||
white-space: normal !important;
|
||||
word-break: break-word !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
@ -29,7 +29,7 @@
|
||||
const logId = ref('')
|
||||
const logPath = ref('/ship/meaPurInt/datalog');
|
||||
import { DataLog } from '/@/components/pcitc';
|
||||
import { ref, computed, onMounted, onUnmounted, createVNode, } from 'vue';
|
||||
import { ref, computed, onMounted, onUnmounted, createVNode, watch} from 'vue';
|
||||
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
@ -50,7 +50,7 @@
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat';
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
const { notification } = useMessage();
|
||||
@ -65,7 +65,7 @@
|
||||
|
||||
const tableRef = ref();
|
||||
//所有按钮
|
||||
const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true,"type":"primary"},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},{"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]);
|
||||
const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true,"type":"primary"},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},{"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true},{"isUse":true,"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true}]);
|
||||
//展示在列表内的按钮
|
||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
|
||||
const buttonConfigs = computed(()=>{
|
||||
@ -80,8 +80,8 @@
|
||||
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
|
||||
});
|
||||
|
||||
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,delete : handleDelete,}
|
||||
|
||||
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,delete : handleDelete,datalog : handleDatalog}
|
||||
const tableData = ref([])
|
||||
const { currentRoute } = useRouter();
|
||||
const router = useRouter();
|
||||
const formIdComputedRef = ref();
|
||||
@ -90,8 +90,8 @@
|
||||
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
|
||||
const defaultDate = ref([dayjs().startOf('year').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')]);
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const formName='国际采购计量';
|
||||
const [registerTable, { reload, }] = useTable({
|
||||
const formName=currentRoute.value.meta?.title
|
||||
const [registerTable, { reload, setTableData }] = useTable({
|
||||
title: '' || (formName + '列表'),
|
||||
api: getLngMeaPurIntPage,
|
||||
rowKey: 'id',
|
||||
@ -102,7 +102,7 @@
|
||||
},
|
||||
schemas: [
|
||||
{
|
||||
field: 'dateEta',
|
||||
field: 'dateMea',
|
||||
label: '计量日期',
|
||||
component: 'RangePicker',
|
||||
defaultValue: defaultDate.value,
|
||||
@ -124,14 +124,15 @@
|
||||
},
|
||||
|
||||
],
|
||||
fieldMapToTime: [['dateEta', ['startDate', 'endDate'], 'YYYY-MM-DD']],
|
||||
fieldMapToTime: [['dateMea', ['startDate', 'endDate'], 'YYYY-MM-DD']],
|
||||
showResetButton: true,
|
||||
},
|
||||
immediate: false,
|
||||
beforeFetch: (params) => {
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page:params.limit };
|
||||
},
|
||||
afterFetch: (res) => {
|
||||
tableData.value = res || []
|
||||
tableRef.value.setToolBarWidth();
|
||||
|
||||
},
|
||||
@ -140,7 +141,7 @@
|
||||
|
||||
striped: false,
|
||||
actionColumn: {
|
||||
width: 160,
|
||||
width: 140,
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
slots: { customRender: 'action' },
|
||||
@ -151,41 +152,39 @@
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
function dbClickRow(record) {
|
||||
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
|
||||
return;
|
||||
watch(
|
||||
() => tableData.value,
|
||||
(val) => {
|
||||
if (val) {
|
||||
let arr = DataFormat.format(val, [
|
||||
FormatOption.createQty('qtyMmbtu'),
|
||||
FormatOption.createQty('qtyGj'),
|
||||
FormatOption.createQty('qtyTon'),
|
||||
FormatOption.createQty('rateTonGj'),
|
||||
FormatOption.createQty('rateM3Gj'),
|
||||
|
||||
]);
|
||||
if (arr.length) {
|
||||
setTableData(arr)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
deep: true,
|
||||
}
|
||||
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||
if (taskIds && taskIds.length) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
||||
query: {
|
||||
taskId: taskIds[0],
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
} else if (schemaId && !taskIds && processId) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + processId + '/approveFlow',
|
||||
query: {
|
||||
readonly: 1,
|
||||
taskId: '',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/MeaPurInt/' + record.id + '/viewForm',
|
||||
query: {
|
||||
);
|
||||
function dbClickRow(record) {
|
||||
router.push({
|
||||
path: '/ship/MeaPurInt/createForm',
|
||||
query: {
|
||||
formPath: 'ship/MeaPurInt',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
formId:currentRoute.value.meta.formId,
|
||||
id: record.id,
|
||||
type: 'view'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function buttonClick(code) {
|
||||
@ -204,7 +203,7 @@
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/MeaPurInt/0/createForm',
|
||||
path: '/ship/MeaPurInt/createForm',
|
||||
query: {
|
||||
formPath: 'ship/MeaPurInt',
|
||||
formName: formName,
|
||||
@ -217,11 +216,13 @@
|
||||
function handleEdit(record: Recordable) {
|
||||
|
||||
router.push({
|
||||
path: '/form/MeaPurInt/' + record.id + '/updateForm',
|
||||
path: '/ship/MeaPurInt/createForm',
|
||||
query: {
|
||||
formPath: 'ship/MeaPurInt',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId:currentRoute.value.meta.formId,
|
||||
id: record.id,
|
||||
type: 'edit'
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -239,7 +240,7 @@
|
||||
deleteLngMeaPurInt(ids).then((_) => {
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
message: '提示',
|
||||
description: t('删除成功!'),
|
||||
});
|
||||
});
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<a-row>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="船期编号" name="ssNo">
|
||||
<a-input-search v-model:value="formState.ssNo" :disabled="isDisable || pageType" placeholder="请选择船期" readonly @search="onSearchShip"/>
|
||||
<a-input-search v-model:value="formState.ssNo" :disabled="Boolean(isDisable || pageType ) " placeholder="请选择船期" readonly @search="onSearchShip"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<a-row>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="船期编号" name="ssNo">
|
||||
<a-input-search v-model:value="formState.ssNo" :disabled="isDisable || pageType" placeholder="请选择船期" readonly @search="onSearchShip"/>
|
||||
<a-input-search v-model:value="formState.ssNo" :disabled="Boolean(isDisable || pageType ) " placeholder="请选择船期" readonly @search="onSearchShip"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
|
||||
Reference in New Issue
Block a user