采购执行

This commit is contained in:
‘huanghaiixia’
2026-03-04 18:01:11 +08:00
parent a5fa001ba6
commit 6dc2861232
6 changed files with 728 additions and 55 deletions

View File

@ -3,7 +3,8 @@ import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';
enum Api {
Page = '/ship/opsPurInt/page',
// Page = '/ship/opsPurInt/page',
Page = '/magic-api/ship/opsPurIntPageList',
List = '/ship/opsPurInt/list',
Info = '/ship/opsPurInt/info',
LngOpsPurInt = '/ship/opsPurInt',

View File

@ -310,7 +310,7 @@ export const PAGE_CUSTOM_ROUTE: AppRouteRecordRaw[] = [{
title: (route) => ('管道气采购合同详情')
}
},
{
{
path: '/ship/ShipSchedule/createForm',
name: 'ShipSchedule',
component: () => import('/@/views/ship/ShipSchedule/components/createForm.vue'),
@ -318,6 +318,14 @@ export const PAGE_CUSTOM_ROUTE: AppRouteRecordRaw[] = [{
title: (route) => route.query.formName
}
},
{
path: '/ship/OpsPurInt/createForm',
name: 'OpsPurInt',
component: () => import('/@/views/ship/OpsPurInt/components/createForm.vue'),
meta: {
title: (route) => route.query.formName
}
},
]

View File

@ -6,96 +6,68 @@ export const formConfig = {
};
export const searchFormSchema: FormSchema[] = [
{
field: 'id',
label: 'id',
component: 'Input',
},
{
field: 'ssNo',
label: '船期编号',
component: 'Input',
},
{
field: 'kId',
field: 'kN',
label: '合同',
component: 'Input',
},
{
field: 'longSpotCode',
label: '长协/现货',
component: 'Input',
},
{
field: 'comId',
label: '交易主体',
component: 'Input',
},
{
field: 'dateEta',
label: '卸港ETA',
component: 'Input',
},
{
field: 'staCode',
label: '接收站',
component: 'Input',
},
{
field: 'suName',
label: '供应商',
component: 'Input',
},
{
field: 'ssTypeCode',
label: '业务类型',
field: 'staName',
label: '接收站',
component: 'Input',
},
];
export const columns: BasicColumn[] = [
{
dataIndex: 'id',
title: 'id',
componentType: 'input',
align: 'left',
sorter: true,
},
{
dataIndex: 'ssNo',
title: '船期编号',
componentType: 'input',
align: 'left',
width: 120,
sorter: true,
},
{
dataIndex: 'kId',
dataIndex: 'kName',
title: '合同',
componentType: 'input',
align: 'left',
width: 150,
sorter: true,
},
{
dataIndex: 'longSpotCode',
dataIndex: 'longSpotName',
title: '长协/现货',
componentType: 'input',
align: 'left',
width: 100,
sorter: true,
},
{
dataIndex: 'comId',
dataIndex: 'comName',
title: '交易主体',
componentType: 'input',
align: 'left',
width: 120,
sorter: true,
},
@ -104,16 +76,16 @@ export const columns: BasicColumn[] = [
title: '卸港ETA',
componentType: 'input',
align: 'left',
width: 120,
sorter: true,
},
{
dataIndex: 'staCode',
dataIndex: 'staName',
title: '接收站',
componentType: 'input',
align: 'left',
width: 120,
sorter: true,
},
@ -122,16 +94,16 @@ export const columns: BasicColumn[] = [
title: '供应商',
componentType: 'input',
align: 'left',
width: 150,
sorter: true,
},
{
dataIndex: 'ssTypeCode',
dataIndex: 'ssTypeName',
title: '业务类型',
componentType: 'input',
align: 'left',
width: 120,
sorter: true,
},
];

View File

@ -0,0 +1,648 @@
<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="isDisable" placeholder="请选择船期" readonly @search="onContract"/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="交易主体" name="comName">
<!-- <a-input v-model:value="formState.comName" disabled/> -->
<a-select v-model:value="formState.comId" disabled placeholder="请选择" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.comIdList" :key="item.value" :value="item.value">
{{ item.label }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="业务类型" name="ssTypeCode">
<a-select v-model:value="formState.ssTypeCode" :disabled="isDisable" placeholder="请选择" style="width: 100%" allow-clear @change="periodTypeCodeChange">
<a-select-option v-for="item in optionSelect.ssTypeCodeList" :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="kName">
<a-input-search v-model:value="formState.kName" :disabled="isDisable" placeholder="请选择合同" readonly @search="onContract"/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="供应商" name="suName">
<a-input-search v-model:value="formState.suName" disabled/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="长协/现货" name="longSpotCode">
<a-select v-model:value="formState.longSpotCode" disabled placeholder="" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.longSpotCodeList" :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="staName">
<a-input-search v-model:value="formState.staName" :disabled="isDisable" placeholder="请选择接收站" readonly @search="onSearchStation"/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="国际气源地" name="sourceName">
<a-input v-model:value="formState.sourceName" :disabled="isDisable" placeholder="请输入"/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="销售区域" name="ownSign">
<a-select v-model:value="formState.ownSign" :disabled="isDisable" placeholder="请选择是否自采" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.ownSignList" :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="empName">
<a-input-search v-model:value="formState.empName" :disabled="isDisable" placeholder="请选择业务联系人" readonly @search="onSearchUser"/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="联系人电话" name="empTel">
<a-input-search v-model:value="formState.empTel" :disabled="isDisable" placeholder="请输入"/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="所在部门" name="empDeptName">
<a-input v-model:value="formState.empDeptName" disabled placeholder="请输入"/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="信用证号" name="ownSign">
<a-select v-model:value="formState.ownSign" :disabled="isDisable" placeholder="请选择是否自采" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.ownSignList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
</Card>
<Card title="货物信息" :bordered="false" >
<a-row>
<a-col :span="8">
<a-form-item label="执行日" name="dateNor">
<a-date-picker v-model:value="formState.dateNor" style="width: 100%" :disabled="isDisable" placeholder="请选择日期" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="货权转移日" name="dateNor">
<a-date-picker v-model:value="formState.dateNor" style="width: 100%" :disabled="isDisable" placeholder="请选择日期" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="价格条款" name="prcTermCode">
<a-select v-model:value="formState.prcTermCode" :disabled="isDisable" placeholder="请选择" style="width: 100%" allow-clear @change="periodTypeCodeChange">
<a-select-option v-for="item in optionSelect.prcTermCodeList" :key="item.code" :value="item.code">
{{ item.fullName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="是否自租船" name="ownSign">
<a-select v-model:value="formState.ownSign" :disabled="isDisable" placeholder="请选择" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.ownSignList" :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="shipName">
<a-input v-model:value="formState.shipName" :disabled="isDisable" placeholder="请输入" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="船只IMO" name="shipCode">
<a-input v-model:value="formState.shipCode" :disabled="isDisable" placeholder="请输入"/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="是否保险" name="ownSign">
<a-select v-model:value="formState.ownSign" :disabled="isDisable" placeholder="请选择" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.ownSignList" :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="currCode">
<a-select v-model:value="formState.currCode" :disabled="isDisable" placeholder="请选择币种" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.curCodeList" :key="item.code" :value="item.code">
{{ item.fullName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="汇率" name="rateEx">
<input-number v-model:value="formState.rateEx" :disabled="isDisable" :digits="6" :min="0" style="width: 100%" placeholder="请输入"/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="预估币种价格" name="priceMmbtuPur">
<input-number v-model:value="formState.priceMmbtuPur" :disabled="isDisable" :digits="4" :min="0" style="width: 100%" placeholder="请输入" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="预估币种金额" name="amountPur">
<input-number v-model:value="formState.amountPur" :disabled="isDisable" :digits="2" :min="0" style="width: 100%" 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="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="结算量(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="结算币种价格" 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="NOR日" name="dateNor">
<a-date-picker v-model:value="formState.dateNor" style="width: 100%" :disabled="isDisable" placeholder="请选择日期" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="最迟交货日" name="dateNor">
<a-date-picker v-model:value="formState.dateNor" style="width: 100%" :disabled="isDisable" placeholder="请选择日期" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="发出付款通知日" name="dateNor">
<a-date-picker v-model:value="formState.dateNor" style="width: 100%" :disabled="isDisable" placeholder="请选择日期" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="收到发票日" name="dateNor">
<a-date-picker v-model:value="formState.dateNor" style="width: 100%" :disabled="isDisable" placeholder="请选择日期" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="付款日" name="dateNor">
<a-date-picker v-model:value="formState.dateNor" style="width: 100%" :disabled="isDisable" placeholder="请选择日期" />
</a-form-item>
</a-col>
</a-row>
</Card>
<Card title="装港信息" :bordered="false" >
<a-row>
<a-col :span="8">
<a-form-item label="装港" name="portUnloading1Name">
<a-input-search v-model:value="formState.portUnloading1Name" :disabled="isDisable" placeholder="请选择卸港港口" readonly @search="onSearchPort"/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="替代装港" name="cuName">
<a-input v-model:value="formState.cuName" :disabled="isDisable" placeholder="请输入" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="装港ETA" name="dateNor">
<a-date-picker v-model:value="formState.dateNor" style="width: 100%" :disabled="isDisable" placeholder="请选择日期" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="装港ETB" name="dateNor">
<a-date-picker v-model:value="formState.dateNor" style="width: 100%" :disabled="isDisable" placeholder="请选择日期" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="装港ETC" name="dateNor">
<a-date-picker v-model:value="formState.dateNor" style="width: 100%" :disabled="isDisable" placeholder="请选择日期" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="装港ETD" name="dateNor">
<a-date-picker v-model:value="formState.dateNor" style="width: 100%" :disabled="isDisable" placeholder="请选择日期" />
</a-form-item>
</a-col>
</a-row>
</Card>
<Card title="卸港信息" :bordered="false" >
<a-row>
<a-col :span="8">
<a-form-item label="卸港" name="portUnloading1Name">
<a-input-search v-model:value="formState.portUnloading1Name" :disabled="isDisable" placeholder="请选择卸港港口" readonly @search="onSearchPort"/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="替代卸港" name="cuName">
<a-input v-model:value="formState.cuName" :disabled="isDisable" placeholder="请输入" />
</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="isDisable" placeholder="请选择日期" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="卸港ETB" name="dateEtb">
<a-date-picker v-model:value="formState.dateEtb" style="width: 100%" :disabled="isDisable" placeholder="请选择日期" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="卸港ETC" name="dateEtc">
<a-date-picker v-model:value="formState.dateEtc" style="width: 100%" :disabled="isDisable" placeholder="请选择日期" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="卸港ETD" name="dateEtd">
<a-date-picker v-model:value="formState.dateEtd" style="width: 100%" :disabled="isDisable" placeholder="请选择日期" />
</a-form-item>
</a-col>
<a-col :span="24">
<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" >
<a-row>
<a-col :span="8">
<a-form-item label="提单号" name="unloadSign">
<a-input v-model:value="formState.dateNor" style="width: 100%" :disabled="isDisable" placeholder="请输入" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="提单日" name="dateNor">
<a-date-picker v-model:value="formState.dateNor" style="width: 100%" :disabled="isDisable" placeholder="请选择日期" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="商检公司" name="unloadSign">
<a-input v-model:value="formState.dateNor" style="width: 100%" :disabled="isDisable" placeholder="请输入" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="最迟交货日" name="dateEnd">
<a-date-picker v-model:value="formState.dateEnd" style="width: 100%" :disabled="isDisable" placeholder="请选择日期" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-item label="对在港烧气有特别要求" class="formItemWarp" name="request" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
<a-textarea v-model:value="formState.request" :disabled="isDisable" :maxLength="100" placeholder="请输入内容最多100字" :auto-size="{ minRows: 2, maxRows: 5 }"/>
</a-form-item>
</a-col>
<a-col :span="24">
<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>
<deptUserModal @register="register" @success="handleSuccess"/>
<ContractPurIntListModal @register="registerContractPurInt" @success="handleSuccessContractPurInt" selectType="radio" />
<supplierListModal @register="registerSupplier" @success="handleSuccessSupplier" selectType="radio" />
<customerListModal @register="registerCustomer" @success="handleSuccessCustomer" selectType="radio" />
<lngStationModal @register="registerStation" @success="handleSuccessStation"/>
<portListModal @register="registerPort" @success="handleSuccessPort"/>
</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 { getAllPriceTerm} from '/@/api/contract/ContractPurInt';
import { addLngShipSchedule,updateLngShipSchedule, getLngShipSchedule} from '/@/api/ship/ShipSchedule';
import { getAllCurrency } from '/@/api/contract/ContractFact';
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 deptUserModal from '/@/components/common/deptUserModal.vue';
import ContractPurIntListModal from '/@/components/common/ContractPurIntListModal.vue';
import supplierListModal from '/@/components/common/supplierListModal.vue';
import lngStationModal from '/@/components/common/lngStationModal.vue';
import customerListModal from '/@/components/common/customerListModal.vue';
import portListModal from '/@/components/common/portListModal.vue';
import { useUserStore } from '/@/store/modules/user';
import { getAllCom} from '/@/api/contract/ContractPurInt';
const userStore = useUserStore();
const userInfo = userStore.getUserInfo;
const tableName = 'ShipSchedule';
const columnName = 'ShipSchedule'
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({
});
const [register, { openModal:openModal}] = useModal();
const [registerContractPurInt, { openModal:openModalContractPurInt}] = useModal();
const [registerSupplier, { openModal:openModalSupplier}] = useModal();
const [registerStation, { openModal:openModalStation}] = useModal();
const [registerCustomer, { openModal:openModalCustomer}] = useModal();
const [registerPort, { openModal:openModalPort}] = useModal();
const rules= reactive({
ownSign: [{ required: true, message: "该项为必填项", trigger: 'change' }],
comId: [{ required: true, message: "该项为必填项", trigger: 'change' }],
ssTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
currCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
dateEta: [{ required: true, message: "该项为必填项", trigger: 'change' }],
});
const layout = {
labelCol: { span: 8 },
wrapperCol: { span: 16 },
}
const dataFile = ref([]);
let optionSelect= reactive({
ownSignList: [],
comIdList: [],
ssTypeCodeList: [],
longSpotCodeList: [],
curCodeList: [],
prcTermCodeList: [],
});
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)
} else {
formState.empName = userInfo.name
formState.empId = userInfo.id
formState.empTel = userInfo.mobile
getOptionParams()
}
});
const uploadListChange = (val) => {
dataFile.value = val
}
async function getInfo(id) {
spinning.value = true
try {
let data = await getLngShipSchedule(id)
spinning.value = false
Object.assign(formState, {...data})
Object.assign(dataFile.value, formState.lngFileUploadList || [])
formState.dateNor = formState.dateNor ? dayjs(formState.dateNor) : null
formState.dateEnd = formState.dateEnd ? dayjs(formState.dateEnd) : null
formState.dateEta = formState.dateEta ? dayjs(formState.dateEta) : null
formState.dateEtb = formState.dateEtb ? dayjs(formState.dateEtb) : null
formState.dateEtc = formState.dateEtc ? dayjs(formState.dateEtc) : null
formState.dateEtd = formState.dateEtd ? dayjs(formState.dateEtd) : null
getOptionParams()
} catch (error) {
spinning.value = false
}
}
async function getOption() {
optionSelect.ownSignList = await getDictionary('LNG_YN')
optionSelect.ssTypeCodeList = await getDictionary('LNG_SHP_S')
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
optionSelect.longSpotCodeList = await getDictionary('LNG_LONG')
let res = await getAllCom() || []
optionSelect.comIdList = res.map(v=> {
return {
label: v.shortName,
value: v.id
}
})
}
async function getOptionParams() {
optionSelect.curCodeList = await getAllCurrency({eid: formState.curCode})
optionSelect.prcTermCodeList = await getAllPriceTerm({eid: formState.prcTermCode})
}
const onSearchPort= () => {
openModalPort(true,{isUpdate: false})
}
const onSearchCustomer = () => {
openModalCustomer(true,{isUpdate: false})
}
const onSearchStation = (val)=> {
openModalStation(true,{isUpdate: false})
}
const onSearchSupplier = () => {
openModalSupplier(true,{isUpdate: false})
}
const onSearchUser = (val)=> {
openModal(true,{isUpdate: false})
}
const onContract = (val)=> {
openModalContractPurInt(true,{isUpdate: false})
}
const handleSuccess = (val, deptId) => {
formState.empName = val[0].name
formState.empId = val[0].id
formState.empTel = val[0].mobile
}
const handleSuccessPort = (val) => {
formState.portUnloading1Code = val[0].code
formState.portUnloading1Name = val[0].fullName
}
const handleSuccessStation = (val) => {
formState.staCode = val[0].code
formState.staName = val[0].fullName
}
const handleSuccessCustomer = (val) => {
formState.cuCode = val[0].cuCode
formState.cuName = val[0].cuName
}
const handleSuccessSupplier = (val) => {
formState.suCode = val[0].suCode
formState.suName = val[0].suName
}
const handleSuccessContractPurInt = (val) => {
formState.kId = val[0].id
formState.kName = val[0].kName
formState.comId = val[0].comId
formState.suCode = val[0].suCode
formState.suName = val[0].suName
formState.longSpotCode = val[0].longSpotCode
formState.prcTermCode = val[0].prcTermCode
formState.sourceName = val[0].sourceName
}
function close() {
tabStore.closeTab(currentRoute.value, router);
}
async function getFormValue() {
return formState
}
async function handleSubmit(type) {
try {
await formRef.value.validateFields();
let obj = {
...formState,
lngFileUploadList: dataFile.value,
}
spinning.value = true;
let request = !formState.id ? addLngShipSchedule :updateLngShipSchedule
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>

View File

@ -51,6 +51,7 @@
import Icon from '/@/components/Icon/index';
import useEventBus from '/@/hooks/event/useEventBus';
import { cloneDeep } from 'lodash-es';
import dayjs from 'dayjs';
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
@ -89,8 +90,9 @@
formIdComputedRef.value = currentRoute.value.meta.formId
const schemaIdComputedRef = ref();
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
const defaultDate = ref([dayjs().startOf('year').format('YYYY-MM-DD'), dayjs().add(1, 'year').endOf('year').format('YYYY-MM-DD')]);
const [registerModal, { openModal }] = useModal();
const formName='采购执行';
const formName=currentRoute.value.meta?.title;
const [registerTable, { reload, }] = useTable({
title: '' || (formName + '列表'),
api: getLngOpsPurIntPage,
@ -100,10 +102,38 @@
rowProps: {
gutter: 16,
},
schemas: customSearchFormSchema,
fieldMapToTime: [],
showResetButton: false,
schemas: [
{
field: 'dateEta',
label: '卸港ETA',
component: 'RangePicker',
defaultValue: defaultDate.value,
componentProps: {
format: 'YYYY-MM-DD',
style: { width: '100%' },
getPopupContainer: () => document.body,
},
},
{
field: 'ssNo',
label: '船期编号',
component: 'Input',
},
{
field: 'suName',
label: '供应商',
component: 'Input',
},
{
field: 'staName',
label: '接收站',
component: 'Input',
},
],
fieldMapToTime: [['dateEta', ['startDate', 'endDate'], 'YYYY-MM-DD']],
showResetButton: true,
},
immediate: false,
beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
},
@ -180,10 +210,10 @@
});
} else {
router.push({
path: '/form/OpsPurInt/0/createForm',
path: '/ship/OpsPurInt/createForm',
query: {
formPath: 'ship/OpsPurInt',
formName: formName,
formName: '新建'+formName,
formId:currentRoute.value.meta.formId
}
});
@ -237,7 +267,7 @@
}
onMounted(() => {
reload({ searchInfo: { startDate: defaultDate.value[0], endDate: defaultDate.value[1] }});
if (schemaIdComputedRef.value) {
bus.on(FLOW_PROCESSED, handleRefresh);
bus.on(CREATE_FLOW, handleRefresh);
@ -305,4 +335,18 @@
.hide{
display: none !important;
}
:deep( .ant-col-8:nth-child(1)) {
width: 320px !important;
max-width: 320px !important;;
}
:deep(.ant-col-8:nth-child(1) .ant-form-item-label) {
width: 80px !important;
}
:deep( .ant-col-8:nth-child(4)) {
width: 320px !important;
max-width: 320px !important;;
}
:deep(.ant-col-8:nth-child(4) .ant-form-item-label) {
width: 80px !important;
}
</style>

View File

@ -197,7 +197,7 @@
</a-col>
<a-col :span="8">
<a-form-item label="联系人电话" name="empTel">
<a-input-search v-model:value="formState.empTel" :disabled="isDisable" placeholder="请输入" readonly @search="onSearchUser"/>
<a-input v-model:value="formState.empTel" :disabled="isDisable" placeholder="请输入" />
</a-form-item>
</a-col>
<a-col :span="24">