Merge branch 'dev' of http://47.94.165.164:13000/geg-gas/geg-gas-web into dev
This commit is contained in:
@ -3,7 +3,8 @@ import { defHttp } from '/@/utils/http/axios';
|
|||||||
import { ErrorMessageMode } from '/#/axios';
|
import { ErrorMessageMode } from '/#/axios';
|
||||||
|
|
||||||
enum Api {
|
enum Api {
|
||||||
Page = '/inventory/lngInventoryOut/page',
|
// Page = '/inventory/lngInventoryOut/page',
|
||||||
|
Page = '/magic-api/inventory/inventoryOutPageList',
|
||||||
List = '/inventory/lngInventoryOut/list',
|
List = '/inventory/lngInventoryOut/list',
|
||||||
Info = '/inventory/lngInventoryOut/info',
|
Info = '/inventory/lngInventoryOut/info',
|
||||||
LngInventoryOut = '/inventory/lngInventoryOut',
|
LngInventoryOut = '/inventory/lngInventoryOut',
|
||||||
|
|||||||
142
src/components/common/contractPurLngListModal.vue
Normal file
142
src/components/common/contractPurLngListModal.vue
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<BasicModal v-bind="$attrs" @register="registerModal" width="60%" :title="getTitle" @ok="handleSubmit"
|
||||||
|
@visible-change="handleVisibleChange" >
|
||||||
|
<BasicTable @register="registerTable" class="contractPurLngListModal" 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 { getLngContractPage} from '/@/api/contract/ContractPurLng';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
const { t } = useI18n();
|
||||||
|
const codeFormSchema: FormSchema[] = [
|
||||||
|
{
|
||||||
|
field: 'dateFrom',
|
||||||
|
label: '有效期',
|
||||||
|
component: 'RangePicker',
|
||||||
|
componentProps: {
|
||||||
|
format: 'YYYY-MM-DD',
|
||||||
|
style: { width: '100%' },
|
||||||
|
getPopupContainer: () => document.body,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'kName',
|
||||||
|
label: '合同号/名称',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const columns: BasicColumn[] = [
|
||||||
|
{ title: t('合同号'), dataIndex: 'kNo', },
|
||||||
|
{ title: t('合同名称'), dataIndex: 'kName', },
|
||||||
|
{ title: t('供应商'), dataIndex: 'cpName', },
|
||||||
|
{ title: t('有效期开始'), dataIndex: 'dateFrom'},
|
||||||
|
{ title: t('有效期结束'), dataIndex: 'dateTo'},
|
||||||
|
{ title: t('合同主体'), dataIndex: 'comName'},
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
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('国内lng采购合同'),
|
||||||
|
api: getLngContractPage,
|
||||||
|
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,approCode: 'YSP'};
|
||||||
|
},
|
||||||
|
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 = ('国内LNG采购合同')
|
||||||
|
|
||||||
|
async function handleSubmit() {
|
||||||
|
if (!selectedValues.value.length) {
|
||||||
|
notification.warning({
|
||||||
|
message: t('提示'),
|
||||||
|
description: t('请选择合同')
|
||||||
|
});
|
||||||
|
return
|
||||||
|
}
|
||||||
|
closeModal();
|
||||||
|
emit('success', selectedValues.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style >
|
||||||
|
.contractPurLngListModal .basicCol{
|
||||||
|
position: inherit !important;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
:deep( .ant-col-8:nth-child(1)) {
|
||||||
|
width: 360px !important;
|
||||||
|
max-width: 360px !important;;
|
||||||
|
}
|
||||||
|
:deep(.ant-col-8:nth-child(1) .ant-form-item-label) {
|
||||||
|
width: 80px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
142
src/components/common/contractSalesLngListModal.vue
Normal file
142
src/components/common/contractSalesLngListModal.vue
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<BasicModal v-bind="$attrs" @register="registerModal" width="60%" :title="getTitle" @ok="handleSubmit"
|
||||||
|
@visible-change="handleVisibleChange" >
|
||||||
|
<BasicTable @register="registerTable" class="contractPurLngListModal" 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 { getLngContractPage} from '/@/api/contract/ContractSalesLng';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
const { t } = useI18n();
|
||||||
|
const codeFormSchema: FormSchema[] = [
|
||||||
|
{
|
||||||
|
field: 'dateFrom',
|
||||||
|
label: '有效期',
|
||||||
|
component: 'RangePicker',
|
||||||
|
componentProps: {
|
||||||
|
format: 'YYYY-MM-DD',
|
||||||
|
style: { width: '100%' },
|
||||||
|
getPopupContainer: () => document.body,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'kName',
|
||||||
|
label: '合同号/名称',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const columns: BasicColumn[] = [
|
||||||
|
{ title: t('合同号'), dataIndex: 'kNo', },
|
||||||
|
{ title: t('合同名称'), dataIndex: 'kName', },
|
||||||
|
{ title: t('客户'), dataIndex: 'cpName', },
|
||||||
|
{ title: t('有效期开始'), dataIndex: 'dateFrom'},
|
||||||
|
{ title: t('有效期结束'), dataIndex: 'dateTo'},
|
||||||
|
{ title: t('合同主体'), dataIndex: 'comName'},
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
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('国内LNG销售合同'),
|
||||||
|
api: getLngContractPage,
|
||||||
|
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,approCode: 'YSP'};
|
||||||
|
},
|
||||||
|
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 = ('国内LNG销售合同')
|
||||||
|
|
||||||
|
async function handleSubmit() {
|
||||||
|
if (!selectedValues.value.length) {
|
||||||
|
notification.warning({
|
||||||
|
message: t('提示'),
|
||||||
|
description: t('请选择合同')
|
||||||
|
});
|
||||||
|
return
|
||||||
|
}
|
||||||
|
closeModal();
|
||||||
|
emit('success', selectedValues.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style >
|
||||||
|
.contractPurLngListModal .basicCol{
|
||||||
|
position: inherit !important;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
:deep( .ant-col-8:nth-child(1)) {
|
||||||
|
width: 360px !important;
|
||||||
|
max-width: 360px !important;;
|
||||||
|
}
|
||||||
|
:deep(.ant-col-8:nth-child(1) .ant-form-item-label) {
|
||||||
|
width: 80px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -374,6 +374,14 @@ export const PAGE_CUSTOM_ROUTE: AppRouteRecordRaw[] = [{
|
|||||||
title: (route) => (route.query.formName)
|
title: (route) => (route.query.formName)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/inventory/LngInventoryOut/createForm',
|
||||||
|
name: 'LngInventoryOut',
|
||||||
|
component: () => import('/@/views/inventory/LngInventoryOut/components/createForm.vue'),
|
||||||
|
meta: {
|
||||||
|
title: (route) => (route.query.formName)
|
||||||
|
}
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '入库类型',
|
title: '入库类型',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -57,7 +57,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '船期编号',
|
title: '船期编号',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -65,7 +65,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '接收站',
|
title: '接收站',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '入库日期',
|
title: '入库日期',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '入库热值(MMBtu)',
|
title: '入库热值(MMBtu)',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 130,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '入库重量(吨)',
|
title: '入库重量(吨)',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '入库体积(标方)',
|
title: '入库体积(标方)',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 130,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '入库体积(方)',
|
title: '入库体积(方)',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '入库热值(吉焦)',
|
title: '入库热值(吉焦)',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 130,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -127,7 +127,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '合同',
|
title: '合同',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 180,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -135,7 +135,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '供应商',
|
title: '供应商',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 180,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -143,7 +143,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '公司',
|
title: '公司',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@ -16,8 +16,8 @@
|
|||||||
<Card title="基础信息" :bordered="false" >
|
<Card title="基础信息" :bordered="false" >
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="交易主体" name="comId">
|
<a-form-item label="公司" name="comId">
|
||||||
<a-select v-model:value="formState.comId" :disabled="isDisable" placeholder="请选择" style="width: 100%" allow-clear>
|
<a-select v-model:value="formState.comId" :disabled="isDisable || pageType" placeholder="请选择" style="width: 100%" allow-clear>
|
||||||
<a-select-option v-for="item in optionSelect.comIdList" :key="item.value" :value="item.value">
|
<a-select-option v-for="item in optionSelect.comIdList" :key="item.value" :value="item.value">
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
@ -26,12 +26,12 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="接收站" name="staName">
|
<a-form-item label="接收站" name="staName">
|
||||||
<a-input-search v-model:value="formState.staName" :disabled="isDisable" placeholder="请选择接收站" readonly @search="onSearchStation"/>
|
<a-input-search v-model:value="formState.staName" :disabled="isDisable || pageType" placeholder="请选择接收站" readonly @search="onSearchStation"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="入库存类型" name="typeCode">
|
<a-form-item label="入库类型" name="typeCode">
|
||||||
<a-select v-model:value="formState.typeCode" :disabled="isDisable" placeholder="请选择" @change="typeCodeChange" style="width: 100%" allow-clear>
|
<a-select v-model:value="formState.typeCode" :disabled="isDisable||pageType" placeholder="请选择" @change="typeCodeChange" style="width: 100%" allow-clear>
|
||||||
<a-select-option v-for="item in optionSelect.typeCodeList" :key="item.code" :value="item.code">
|
<a-select-option v-for="item in optionSelect.typeCodeList" :key="item.code" :value="item.code">
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
@ -40,12 +40,12 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="船期编号" name="ssNo">
|
<a-form-item label="船期编号" name="ssNo">
|
||||||
<a-input-search v-model:value="formState.ssNo" :disabled="Boolean(isDisable || pageType ) " placeholder="请选择" readonly @search="onSearchShip"/>
|
<a-input-search v-model:value="formState.ssNo" :disabled="Boolean(isDisable||pageType||formState.typeCode!=='CQ' ) " placeholder="请选择" readonly @search="onSearchShip"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="采购合同" name="kName">
|
<a-form-item label="采购合同" name="kName">
|
||||||
<a-input-search v-model:value="formState.kName" :disabled="isDisable" placeholder="请选择合同" readonly @search="onContract"/>
|
<a-input-search v-model:value="formState.kName" :disabled="isDisable||formState.typeCode=='CQ'||formState.dataSource" placeholder="请选择合同" readonly @search="onContract"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
@ -54,8 +54,8 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="入库" name="dateIn">
|
<a-form-item label="入库日期" name="dateIn">
|
||||||
<a-date-picker :inputReadOnly="true" v-model:value="formState.dateIn" style="width: 100%" :disabled="isDisable" placeholder="请选择日期" />
|
<a-date-picker :inputReadOnly="true" v-model:value="formState.dateIn" style="width: 100%" :disabled="isDisable||formState.dataSource" placeholder="请选择日期" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@ -64,27 +64,27 @@
|
|||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="卸港热值(MMBtu)" name="qtyUnloadMmbtu">
|
<a-form-item label="卸港热值(MMBtu)" name="qtyUnloadMmbtu">
|
||||||
<input-number v-model:value="formState.qtyUnloadMmbtu" :disabled="isDisable" :digits="3" :min="0" @change="numCount('qtyUnloadMmbtu')" style="width: 100%" />
|
<input-number v-model:value="formState.qtyUnloadMmbtu" :disabled="isDisable||formState.dataSource" :digits="3" :min="0" @change="numCount('qtyUnloadMmbtu')" style="width: 100%" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="卸港热值(吉焦)" name="qtyUnloadGj">
|
<a-form-item label="卸港热值(吉焦)" name="qtyUnloadGj">
|
||||||
<input-number v-model:value="formState.qtyUnloadGj" :disabled="isDisable" :digits="3" :min="0" @change="numCount('qtyUnloadGj')" style="width: 100%" />
|
<input-number v-model:value="formState.qtyUnloadGj" :disabled="isDisable||formState.dataSource" :digits="3" :min="0" @change="numCount('qtyUnloadGj')" style="width: 100%" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="卸港重量(吨)" name="qtyUnloadTon">
|
<a-form-item label="卸港重量(吨)" name="qtyUnloadTon">
|
||||||
<input-number v-model:value="formState.qtyUnloadTon" :disabled="isDisable" :digits="3" :min="0" @change="numCount('qtyUnloadTon')" style="width: 100%" />
|
<input-number v-model:value="formState.qtyUnloadTon" :disabled="isDisable||formState.dataSource" :digits="3" :min="0" @change="numCount('qtyUnloadTon')" style="width: 100%" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="卸港体积(标方)" name="qtyUnloadM3L">
|
<a-form-item label="卸港体积(标方)" name="qtyUnloadM3L">
|
||||||
<input-number v-model:value="formState.qtyUnloadM3L" :disabled="isDisable" :digits="3" :min="0" @change="numCount('qtyUnloadM3L')" style="width: 100%" />
|
<input-number v-model:value="formState.qtyUnloadM3L" :disabled="isDisable||formState.dataSource" :digits="3" :min="0" @change="numCount('qtyUnloadM3L')" style="width: 100%" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="卸港体积(方)" name="qtyUnloadM3">
|
<a-form-item label="卸港体积(方)" name="qtyUnloadM3">
|
||||||
<input-number v-model:value="formState.qtyUnloadM3" :disabled="isDisable" :digits="3" :min="0" @change="numCount('qtyUnloadM3')" style="width: 100%" />
|
<input-number v-model:value="formState.qtyUnloadM3" :disabled="isDisable||formState.dataSource" :digits="3" :min="0" @change="numCount('qtyUnloadM3')" style="width: 100%" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@ -150,8 +150,8 @@
|
|||||||
<Card title="" :bordered="false" >
|
<Card title="" :bordered="false" >
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="结算币种" name="curCode">
|
<a-form-item label="结算币种" name="currCode">
|
||||||
<a-select v-model:value="formState.curCode" :disabled="isDisable" placeholder="请选择币种" style="width: 100%" allow-clear>
|
<a-select v-model:value="formState.currCode" :disabled="Boolean(isDisable||formState.opsId)" placeholder="请选择币种" style="width: 100%" allow-clear>
|
||||||
<a-select-option v-for="item in optionSelect.curCodeList" :key="item.code" :value="item.code">
|
<a-select-option v-for="item in optionSelect.curCodeList" :key="item.code" :value="item.code">
|
||||||
{{ item.fullName }}
|
{{ item.fullName }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
@ -159,7 +159,7 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="结算币种单价(/MMBtu)" name="priceMmbtu">
|
<a-form-item label="结算币种单价(/MMBtu)" class="formItemWarp" name="priceMmbtu">
|
||||||
<input-number v-model:value="formState.priceMmbtu" :disabled="isDisable" :digits="3" :min="0" @change="numCount('priceMmbtu')" style="width: 100%" />
|
<input-number v-model:value="formState.priceMmbtu" :disabled="isDisable" :digits="3" :min="0" @change="numCount('priceMmbtu')" style="width: 100%" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
@ -202,7 +202,7 @@
|
|||||||
</Card>
|
</Card>
|
||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
<contractPurIntListModal @register="registerContractPurInt" @success="handleSuccessContractPurInt" selectType="radio" pageType="pur"/>
|
<contractPurLngListModal @register="registerContractPurLng" @success="handleSuccessContractPurLng"/>
|
||||||
<lngStationModal @register="registerStation" @success="handleSuccessStation"/>
|
<lngStationModal @register="registerStation" @success="handleSuccessStation"/>
|
||||||
<OpsPurIntListModal @register="registerShip" @success="handleSuccessShip" :defaultDateType="true"/>
|
<OpsPurIntListModal @register="registerShip" @success="handleSuccessShip" :defaultDateType="true"/>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
@ -227,7 +227,7 @@
|
|||||||
import { getAppEnvConfig } from '/@/utils/env';
|
import { getAppEnvConfig } from '/@/utils/env';
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
import UploadList from '/@/components/Form/src/components/UploadList.vue';
|
import UploadList from '/@/components/Form/src/components/UploadList.vue';
|
||||||
import contractPurIntListModal from '../../../../components/common/contractPurIntListModal.vue';
|
import contractPurLngListModal from '/@/components/common/contractPurLngListModal.vue';
|
||||||
import lngStationModal from '/@/components/common/lngStationModal.vue';
|
import lngStationModal from '/@/components/common/lngStationModal.vue';
|
||||||
import { getAllCom} from '/@/api/contract/ContractPurInt';
|
import { getAllCom} from '/@/api/contract/ContractPurInt';
|
||||||
import OpsPurIntListModal from '/@/components/common/OpsPurIntListModal.vue';
|
import OpsPurIntListModal from '/@/components/common/OpsPurIntListModal.vue';
|
||||||
@ -267,17 +267,15 @@
|
|||||||
catCode: 'LNG'
|
catCode: 'LNG'
|
||||||
});
|
});
|
||||||
const [register, { openModal:openModal}] = useModal();
|
const [register, { openModal:openModal}] = useModal();
|
||||||
const [registerContractPurInt, { openModal:openModalContractPurInt}] = useModal();
|
const [registerContractPurLng, { openModal:openModalContractPurLng}] = useModal();
|
||||||
const [registerStation, { openModal:openModalStation}] = useModal();
|
const [registerStation, { openModal:openModalStation}] = useModal();
|
||||||
const [registerPort, { openModal:openModalPort}] = useModal();
|
|
||||||
const [registerShip, { openModal:openModalShip}] = useModal();
|
const [registerShip, { openModal:openModalShip}] = useModal();
|
||||||
|
|
||||||
const rules= reactive({
|
const rules= reactive({
|
||||||
comId: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
comId: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
ssTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
ssTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
suName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
|
||||||
typeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
typeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
kName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
kName: [{ required: false, message: "该项为必填项", trigger: 'change' }],
|
||||||
staName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
staName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
dateIn: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
dateIn: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
qtyUnloadMmbtu: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
qtyUnloadMmbtu: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
@ -287,9 +285,6 @@
|
|||||||
qtyLostMmbtu: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
qtyLostMmbtu: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
qtyLostGj: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
qtyLostGj: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
qtyLostTon: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
qtyLostTon: [{ 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 = {
|
const layout = {
|
||||||
labelCol: { span: 8 },
|
labelCol: { span: 8 },
|
||||||
@ -340,7 +335,7 @@
|
|||||||
spinning.value = false
|
spinning.value = false
|
||||||
Object.assign(formState, {...data})
|
Object.assign(formState, {...data})
|
||||||
Object.assign(dataFile.value, formState.lngFileUploadList || [])
|
Object.assign(dataFile.value, formState.lngFileUploadList || [])
|
||||||
formState.dateNor = formState.dateNor ? dayjs(formState.dateNor) : null
|
formState.dateIn = formState.dateIn ? dayjs(formState.dateIn) : null
|
||||||
getOptionParams()
|
getOptionParams()
|
||||||
|
|
||||||
|
|
||||||
@ -349,7 +344,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function getOption() {
|
async function getOption() {
|
||||||
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
|
|
||||||
optionSelect.typeCodeList = await getDictionary('LNG_INV_I')
|
optionSelect.typeCodeList = await getDictionary('LNG_INV_I')
|
||||||
let res = await getAllCom() || []
|
let res = await getAllCom() || []
|
||||||
optionSelect.comIdList = res.map(v=> {
|
optionSelect.comIdList = res.map(v=> {
|
||||||
@ -361,48 +355,53 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
async function getOptionParams() {
|
async function getOptionParams() {
|
||||||
optionSelect.curCodeList = await getAllCurrency({eid: formState.curCode})
|
optionSelect.curCodeList = await getAllCurrency({eid: formState.currCode})
|
||||||
}
|
}
|
||||||
const typeCodeChange = (val) => {
|
const typeCodeChange = (val) => {
|
||||||
if (val == 'ZN') {
|
if (val == 'ZN') {
|
||||||
formState.opsId = ''
|
formState.opsId = ''
|
||||||
formState.ssId = ''
|
formState.ssId = ''
|
||||||
|
formState.ssNo = ''
|
||||||
formState.kId = ''
|
formState.kId = ''
|
||||||
|
formState.kName = ''
|
||||||
formState.suCode = ''
|
formState.suCode = ''
|
||||||
|
formState.suName = ''
|
||||||
|
rules.kName = [{ required: true, message: "该项为必填项", trigger: 'change' }]
|
||||||
|
} else {
|
||||||
|
rules.kName = [{ required: false, message: "该项为必填项", trigger: 'change' }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const numCount = (k) => {
|
const numCount = (k) => {
|
||||||
formState.qtyLostMmbtu = Number(formState.qtyUnloadMmbtu || 0)*Number(formState.rateLost || 0)/100
|
formState.qtyLostMmbtu = (Number(formState.qtyUnloadMmbtu || 0)*Number(formState.rateLost || 0)/100).toFixed(3)
|
||||||
formState.qtyLostGj = Number(formState.qtyUnloadGj || 0)*Number(formState.rateLost || 0)/100
|
formState.qtyLostGj = (Number(formState.qtyUnloadGj || 0)*Number(formState.rateLost || 0)/100).toFixed(3)
|
||||||
formState.qtyLostTon = Number(formState.qtyUnloadTon || 0)*Number(formState.rateLost || 0)/100
|
formState.qtyLostTon = (Number(formState.qtyUnloadTon || 0)*Number(formState.rateLost || 0)/100).toFixed(3)
|
||||||
formState.qtyLostM3L = Number(formState.qtyUnloadM3L || 0)*Number(formState.rateLost || 0)/100
|
formState.qtyLostM3L = (Number(formState.qtyUnloadM3L || 0)*Number(formState.rateLost || 0)/100).toFixed(3)
|
||||||
formState.qtyLostM3 = Number(formState.qtyUnloadM3 || 0)*Number(formState.rateLost || 0)/100
|
formState.qtyLostM3 = (Number(formState.qtyUnloadM3 || 0)*Number(formState.rateLost || 0)/100).toFixed(3)
|
||||||
|
|
||||||
formState.qtyMmbtu = Number(formState.qtyUnloadMmbtu || 0) - Number(formState.qtyLostMmbtu || 0)
|
formState.qtyMmbtu = (Number(formState.qtyUnloadMmbtu || 0) - Number(formState.qtyLostMmbtu || 0)).toFixed(3)
|
||||||
formState.qtyGj = Number(formState.qtyUnloadGj || 0) - Number(formState.qtyLostGj || 0)
|
formState.qtyGj = (Number(formState.qtyUnloadGj || 0) - Number(formState.qtyLostGj || 0)).toFixed(3)
|
||||||
formState.qtyTon = Number(formState.qtyUnloadTon || 0) - Number(formState.qtyLostTon || 0)
|
formState.qtyTon = (Number(formState.qtyUnloadTon || 0) - Number(formState.qtyLostTon || 0)).toFixed(3)
|
||||||
formState.qtyM3L = Number(formState.qtyUnloadM3L || 0) - Number(formState.qtyLostM3L || 0)
|
formState.qtyM3L = (Number(formState.qtyUnloadM3L || 0) - Number(formState.qtyLostM3L || 0)).toFixed(3)
|
||||||
formState.qtyM3 = Number(formState.qtyUnloadM3 || 0) - Number(formState.qtyLostM3 || 0)
|
formState.qtyM3 = (Number(formState.qtyUnloadM3 || 0) - Number(formState.qtyLostM3 || 0)).toFixed(3)
|
||||||
|
|
||||||
|
formState.amountCurr = (Number(formState.qtyMmbtu || 0)*Number(formState.priceMmbtu || 0)).toFixed(2)
|
||||||
|
formState.amount = (Number(formState.amountCurr || 0) * Number(formState.rateExPur || 0)).toFixed(2)
|
||||||
|
formState.priceTon = (Number(formState.qtyTon) ? Number(formState.amount || 0)/Number(formState.qtyTon) : 0).toFixed(4)
|
||||||
|
formState.priceGj = (Number(formState.qtyGj) ? Number(formState.amount || 0)/Number(formState.qtyGj) : 0).toFixed(4)
|
||||||
|
|
||||||
formState.amountCurr = Number(formState.qtyMmbtu || 0)*Number(formState.priceMmbtu || 0)
|
|
||||||
formState.amount = Number(formState.amountCurr || 0) * Number(formState.rateExPur || 0)
|
|
||||||
formState.priceTon = Number(formState.qtyTon) ? Number(formState.amount || 0)/Number(formState.qtyTon) : 0
|
|
||||||
formState.priceGj = Number(formState.qtyGj) ? Number(formState.amount || 0)/Number(formState.qtyGj) : 0
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onSearchShip = () => {
|
const onSearchShip = () => {
|
||||||
if (formState.typeCode == 'CQ') {
|
|
||||||
openModalShip(true,{isUpdate: false})
|
openModalShip(true,{isUpdate: false})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
const onSearchStation = (val)=> {
|
const onSearchStation = (val)=> {
|
||||||
openModalStation(true,{isUpdate: false})
|
openModalStation(true,{isUpdate: false})
|
||||||
}
|
}
|
||||||
|
|
||||||
const onContract = (val)=> {
|
const onContract = (val)=> {
|
||||||
openModalContractPurInt(true,{isUpdate: false})
|
openModalContractPurLng(true,{isUpdate: false})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSuccessStation = (val) => {
|
const handleSuccessStation = (val) => {
|
||||||
@ -419,7 +418,7 @@
|
|||||||
try {
|
try {
|
||||||
spinning.value = true
|
spinning.value = true
|
||||||
let data = await getLngOpsPurInt(id)
|
let data = await getLngOpsPurInt(id)
|
||||||
let res = await getLngInventoryInShip(id)
|
let res = await getLngInventoryInShip(id) || []
|
||||||
spinning.value = false
|
spinning.value = false
|
||||||
formState.ssNo = data.ssNo
|
formState.ssNo = data.ssNo
|
||||||
formState.opsId = data.id
|
formState.opsId = data.id
|
||||||
@ -433,30 +432,28 @@
|
|||||||
formState.suName = data.suName
|
formState.suName = data.suName
|
||||||
|
|
||||||
formState.dateIn = data.dateEta ? dayjs(data.dateEta) : null
|
formState.dateIn = data.dateEta ? dayjs(data.dateEta) : null
|
||||||
formState.curCode = data.curCode
|
formState.currCode = data.curCode
|
||||||
formState.priceMmbtu = data.priceCurr
|
formState.priceMmbtu = data.priceCurr
|
||||||
formState.amountCurr = data.amountCurr
|
formState.amountCurr = data.amountCurr
|
||||||
formState.rateExPur = data.rateEx
|
formState.rateExPur = data.rateEx
|
||||||
|
|
||||||
|
formState.qtyUnloadMmbtu = res[0]?.qtyMmbtu
|
||||||
|
formState.qtyUnloadTon = res[0]?.qtyTon
|
||||||
|
formState.qtyUnloadM3L = res[0]?.qtyM3L
|
||||||
|
formState.qtyUnloadM3 = res[0]?.qtyM3
|
||||||
|
formState.qtyUnloadGj = res[0]?.qtyGj
|
||||||
|
|
||||||
numCount()
|
numCount('')
|
||||||
|
|
||||||
if (pageSource.value) {
|
|
||||||
getOptionParams()
|
|
||||||
}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
spinning.value = false
|
spinning.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const handleSuccessContractPurInt = (val) => {
|
const handleSuccessContractPurLng = (val) => {
|
||||||
formState.kId = val[0].id
|
formState.kId = val[0].id
|
||||||
formState.kName = val[0].kName
|
formState.kName = val[0].kName
|
||||||
formState.comId = val[0].comId
|
formState.comId = val[0].comId
|
||||||
formState.suCode = val[0].suCode
|
formState.suCode = val[0].cpCode
|
||||||
formState.suName = val[0].suSname
|
formState.suName = val[0].cpName
|
||||||
formState.longSpotCode = val[0].longSpotCode
|
|
||||||
formState.prcTermCode = val[0].prcTermCode
|
|
||||||
formState.sourceName = val[0].sourceName
|
|
||||||
}
|
}
|
||||||
function close() {
|
function close() {
|
||||||
tabStore.closeTab(currentRoute.value, router);
|
tabStore.closeTab(currentRoute.value, router);
|
||||||
|
|||||||
@ -192,12 +192,12 @@
|
|||||||
function handleEdit(record: Recordable) {
|
function handleEdit(record: Recordable) {
|
||||||
|
|
||||||
router.push({
|
router.push({
|
||||||
path: '/form/LngInventoryIn/' + record.id + '/updateForm',
|
path: '/inventory/LngInventoryIn/createForm',
|
||||||
query: {
|
query: {
|
||||||
formPath: 'inventory/LngInventoryIn',
|
formPath: 'inventory/LngInventoryIn',
|
||||||
formName: formName,
|
formName: '编辑'+formName,
|
||||||
formId:currentRoute.value.meta.formId,
|
formId:currentRoute.value.meta.formId,
|
||||||
type: 'view',
|
type: 'edit',
|
||||||
id: record.id
|
id: record.id
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -216,7 +216,7 @@
|
|||||||
deleteLngInventoryIn(ids).then((_) => {
|
deleteLngInventoryIn(ids).then((_) => {
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
notification.success({
|
notification.success({
|
||||||
message: 'Tip',
|
message: '提示',
|
||||||
description: t('删除成功!'),
|
description: t('删除成功!'),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -268,27 +268,28 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
function getActions(record: Recordable):ActionItem[] {
|
function getActions(record: Recordable):ActionItem[] {
|
||||||
|
let actionsList: ActionItem[] = []
|
||||||
const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => {
|
let editAndDelBtn: ActionItem[] = []
|
||||||
if (!record.workflowData?.processId) {
|
actionButtonConfig.value?.map((button) => {
|
||||||
return {
|
if (['view', 'copyData', 'datalog'].includes(button.code)) {
|
||||||
|
actionsList.push({
|
||||||
|
icon: button?.icon,
|
||||||
|
tooltip: button?.name,
|
||||||
|
onClick: btnEvent[button.code].bind(null, record),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (['edit', 'delete'].includes(button.code)) {
|
||||||
|
editAndDelBtn.push({
|
||||||
icon: button?.icon,
|
icon: button?.icon,
|
||||||
tooltip: button?.name,
|
tooltip: button?.name,
|
||||||
color: button.code === 'delete' ? 'error' : undefined,
|
color: button.code === 'delete' ? 'error' : undefined,
|
||||||
onClick: btnEvent[button.code].bind(null, record),
|
onClick: btnEvent[button.code].bind(null, record),
|
||||||
};
|
});
|
||||||
} else {
|
|
||||||
if (button.code === 'view') {
|
|
||||||
return {
|
|
||||||
icon: button?.icon,
|
|
||||||
tooltip: button?.name,
|
|
||||||
onClick: btnEvent[button.code].bind(null, record),
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (!record.dataSource) {
|
||||||
|
actionsList = actionsList.concat(editAndDelBtn);
|
||||||
|
}
|
||||||
return actionsList;
|
return actionsList;
|
||||||
}
|
}
|
||||||
async function mergeCustomListRenderConfig(){
|
async function mergeCustomListRenderConfig(){
|
||||||
|
|||||||
@ -48,7 +48,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '出库类型',
|
title: '出库类型',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '接收站',
|
title: '接收站',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 150,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '出库日期',
|
title: '出库日期',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '出库量(吉焦)',
|
title: '出库量(吉焦)',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -84,16 +84,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '出库量(吨)',
|
title: '出库量(吨)',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
dataIndex: 'qtyM3',
|
|
||||||
title: '出库量(方)',
|
|
||||||
componentType: 'input',
|
|
||||||
align: 'left',
|
|
||||||
|
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -102,7 +93,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '出库金额',
|
title: '出库金额',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -110,7 +101,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '销售合同',
|
title: '销售合同',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 180,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -118,7 +109,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '客户名称',
|
title: '客户名称',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 150,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -126,7 +117,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '公司名称',
|
title: '公司名称',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
399
src/views/inventory/LngInventoryOut/components/createForm.vue
Normal file
399
src/views/inventory/LngInventoryOut/components/createForm.vue
Normal file
@ -0,0 +1,399 @@
|
|||||||
|
<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="comId">
|
||||||
|
<a-select v-model:value="formState.comId" :disabled="isDisable || pageType" 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="staName">
|
||||||
|
<a-input-search v-model:value="formState.staName" :disabled="isDisable || pageType" placeholder="请选择接收站" readonly @search="onSearchStation"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="出库类型" name="typeCode">
|
||||||
|
<a-select v-model:value="formState.typeCode" :disabled="isDisable||pageType" placeholder="请选择" @change="typeCodeChange" 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="dateOut">
|
||||||
|
<a-date-picker :inputReadOnly="true" v-model:value="formState.dateOut" style="width: 100%" :disabled="isDisable" placeholder="请选择日期" />
|
||||||
|
</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||formState.typeCode!='ZN'||pageType" placeholder="请选择合同" readonly @search="onContract"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="客户" name="cuName">
|
||||||
|
<a-input-search v-model:value="formState.cuName" disabled/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="主计量单位" name="uomCode">
|
||||||
|
<a-select v-model:value="formState.uomCode" :disabled="isDisable" placeholder="请选择" @change="uomCodeChage" style="width: 100%" allow-clear>
|
||||||
|
<a-select-option v-for="item in optionSelect.uomCodeList" :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="rateTonGj">
|
||||||
|
<input-number v-model:value="formState.rateTonGj" :disabled="isDisable" :min="0" @blur="numCount" style="width: 100%" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="比值(方/吉焦)" name="rateM3Gj">
|
||||||
|
<input-number v-model:value="formState.rateM3Gj" :disabled="isDisable" :min="0" @blur="numCount" style="width: 100%" />
|
||||||
|
</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" @blur="numCount" style="width: 100%" />
|
||||||
|
</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" @blur="numCount" style="width: 100%" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="出库价格(元/吉焦)" name="priceGj">
|
||||||
|
<input-number v-model:value="formState.priceGj" :disabled="isDisable" :min="0" @blur="numCount" style="width: 100%" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="出库价格(元/吨)" name="priceTon">
|
||||||
|
<input-number v-model:value="formState.priceTon" :disabled="isDisable" :min="0" @blur="numCount" style="width: 100%" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="出库金额(元)" name="amount">
|
||||||
|
<input-number v-model:value="formState.amount" :disabled="isDisable" :digits="2" :min="0" @blur="amountCount" style="width: 100%" />
|
||||||
|
</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" :maxLength="200" placeholder="请输入内容,最多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>
|
||||||
|
<contractSalesLngListModal @register="registerContractSalesLng" @success="handleSuccessContractSalesLng"/>
|
||||||
|
<lngStationModal @register="registerStation" @success="handleSuccessStation"/>
|
||||||
|
</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 { addLngInventoryOut,updateLngInventoryOut, getLngInventoryOut,} from '/@/api/inventory/lngInventoryOut';
|
||||||
|
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 contractSalesLngListModal from '/@/components/common/contractSalesLngListModal.vue';
|
||||||
|
import lngStationModal from '/@/components/common/lngStationModal.vue';
|
||||||
|
import { getAllCom} from '/@/api/contract/ContractPurInt';
|
||||||
|
import { getParameter } from '/@/api/contract/ContractProc';
|
||||||
|
|
||||||
|
const tableName = 'LngInventoryOut';
|
||||||
|
const columnName = 'LngInventoryOut'
|
||||||
|
|
||||||
|
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 pageSource = ref(currentRoute.value.query?.pageSource)
|
||||||
|
const spinning = ref(false);
|
||||||
|
const { notification } = useMessage();
|
||||||
|
const { t } = useI18n()
|
||||||
|
|
||||||
|
const formState = reactive({
|
||||||
|
approCode: 'WTJ',
|
||||||
|
typeCode: 'ZN',
|
||||||
|
catCode: 'LNG'
|
||||||
|
});
|
||||||
|
const [register, { openModal:openModal}] = useModal();
|
||||||
|
const [registerContractSalesLng, { openModal:openModalContractSalesLng}] = useModal();
|
||||||
|
const [registerStation, { openModal:openModalStation}] = useModal();
|
||||||
|
|
||||||
|
const rules= reactive({
|
||||||
|
comId: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
ssTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
typeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
kName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
staName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
dateOut: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
uomCode: [{ required: true, message: "该项为必填项", trigger: 'change' }]
|
||||||
|
});
|
||||||
|
const layout = {
|
||||||
|
labelCol: { span: 8 },
|
||||||
|
wrapperCol: { span: 16 },
|
||||||
|
}
|
||||||
|
const dataFile = ref([]);
|
||||||
|
let optionSelect= reactive({
|
||||||
|
comIdList: [],
|
||||||
|
typeCodeList: [],
|
||||||
|
uomCodeList: [],
|
||||||
|
});
|
||||||
|
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 {
|
||||||
|
getSysRate()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
async function getSysRate () {
|
||||||
|
let a = await getParameter({code: 'RATE_TON_GJ'})||[]
|
||||||
|
let b = await getParameter({code: 'RATE_M3_GJ'})||[]
|
||||||
|
formState.rateTonGj = a[0]?.valueNum1
|
||||||
|
formState.rateM3Gj = b[0]?.valueNum1
|
||||||
|
}
|
||||||
|
const uploadListChange = (val) => {
|
||||||
|
dataFile.value = val
|
||||||
|
}
|
||||||
|
async function getInfo(id) {
|
||||||
|
spinning.value = true
|
||||||
|
try {
|
||||||
|
let data = await getLngInventoryOut(id)
|
||||||
|
spinning.value = false
|
||||||
|
Object.assign(formState, {...data})
|
||||||
|
Object.assign(dataFile.value, formState.lngFileUploadList || [])
|
||||||
|
formState.dateOut = formState.dateOut ? dayjs(formState.dateOut) : null
|
||||||
|
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
spinning.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function getOption() {
|
||||||
|
optionSelect.uomCodeList = await getDictionary('LNG_UOM')
|
||||||
|
optionSelect.typeCodeList = await getDictionary('LNG_INV_O')
|
||||||
|
let res = await getAllCom() || []
|
||||||
|
optionSelect.comIdList = res.map(v=> {
|
||||||
|
return {
|
||||||
|
label: v.shortName,
|
||||||
|
value: v.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
const typeCodeChange = (val) => {
|
||||||
|
if (val !== 'ZN') {
|
||||||
|
formState.kId = ''
|
||||||
|
formState.kName = ''
|
||||||
|
formState.cuCode = ''
|
||||||
|
formState.cuName = ''
|
||||||
|
rules.kName = [{ required: false, message: "该项为必填项", trigger: 'change' }]
|
||||||
|
} else {
|
||||||
|
rules.kName = [{ required: true, message: "该项为必填项", trigger: 'change' }]
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
const uomCodeChage = () => {
|
||||||
|
numCount()
|
||||||
|
}
|
||||||
|
const numCount = () => {
|
||||||
|
|
||||||
|
if (formState.uomCode == 'GJ') {
|
||||||
|
if (!formState.qtyTon) {
|
||||||
|
formState.qtyTon = Number(formState.rateTonGj) ? Number(formState.qtyGj || 0)/Number(formState.rateTonGj) : 0
|
||||||
|
amountCount()
|
||||||
|
}
|
||||||
|
if (!formState.amount) {
|
||||||
|
formState.amount = Number(formState.qtyGj || 0)*Number(formState.priceGj || 0)
|
||||||
|
amountCount()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (formState.uomCode == 'TON') {
|
||||||
|
if (!formState.qtyGj) {
|
||||||
|
formState.qtyGj = Number(formState.qtyTon || 0)*Number(formState.rateTonGj || 0)
|
||||||
|
amountCount()
|
||||||
|
}
|
||||||
|
if (!formState.amount) {
|
||||||
|
formState.amount = Number(formState.qtyTon || 0)*Number(formState.priceTon || 0)
|
||||||
|
amountCount()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const amountCount = () => {
|
||||||
|
if (!formState.priceTon) {
|
||||||
|
formState.priceTon = Number(formState.qtyTon) ? Number(formState.amount || 0)/Number(formState.qtyTon) : 0
|
||||||
|
}
|
||||||
|
if (!formState.priceGj) {
|
||||||
|
formState.priceGj = Number(formState.qtyGj) ? Number(formState.amount || 0)/Number(formState.qtyGj) : 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const onSearchStation = (val)=> {
|
||||||
|
openModalStation(true,{isUpdate: false})
|
||||||
|
}
|
||||||
|
|
||||||
|
const onContract = (val)=> {
|
||||||
|
openModalContractSalesLng(true,{isUpdate: false})
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleSuccessStation = (val) => {
|
||||||
|
formState.staCode = val[0].code
|
||||||
|
formState.staName = val[0].fullName
|
||||||
|
}
|
||||||
|
const handleSuccessContractSalesLng = (val) => {
|
||||||
|
formState.kId = val[0].id
|
||||||
|
formState.kName = val[0].kName
|
||||||
|
formState.comId = val[0].comId
|
||||||
|
formState.cuCode = val[0].cpCode
|
||||||
|
formState.cuName = val[0].cpName
|
||||||
|
}
|
||||||
|
function close() {
|
||||||
|
tabStore.closeTab(currentRoute.value, router);
|
||||||
|
}
|
||||||
|
async function getFormValue() {
|
||||||
|
return formState
|
||||||
|
}
|
||||||
|
async function handleSubmit(type) {
|
||||||
|
try {
|
||||||
|
await formRef.value.validateFields();
|
||||||
|
let obj = {
|
||||||
|
...formState,
|
||||||
|
qtyTon: formState.qtyTon ? formState.qtyTon.toFixed(3) : formState.qtyTon,
|
||||||
|
amount: formState.amount ? formState.amount.toFixed(2) : formState.amount,
|
||||||
|
qtyGj: formState.qtyGj ? formState.qtyGj.toFixed(3) : formState.qtyGj,
|
||||||
|
priceTon: formState.priceTon ? formState.priceTon.toFixed(4) : formState.priceTon,
|
||||||
|
priceGj: formState.priceGj ? formState.priceGj.toFixed(4) : formState.priceGj,
|
||||||
|
lngFileUploadList: dataFile.value,
|
||||||
|
}
|
||||||
|
spinning.value = true;
|
||||||
|
let request = !formState.id ? addLngInventoryOut :updateLngInventoryOut
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -29,9 +29,7 @@
|
|||||||
const logId = ref('')
|
const logId = ref('')
|
||||||
const logPath = ref('/inventory/lngInventoryOut/datalog');
|
const logPath = ref('/inventory/lngInventoryOut/datalog');
|
||||||
import { DataLog } from '/@/components/pcitc';
|
import { DataLog } from '/@/components/pcitc';
|
||||||
import { ref, computed, onMounted, onUnmounted, createVNode,
|
import { ref, computed, onMounted, onUnmounted, createVNode, watch} from 'vue';
|
||||||
|
|
||||||
} from 'vue';
|
|
||||||
|
|
||||||
import { Modal } from 'ant-design-vue';
|
import { Modal } from 'ant-design-vue';
|
||||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
@ -52,6 +50,7 @@
|
|||||||
import useEventBus from '/@/hooks/event/useEventBus';
|
import useEventBus from '/@/hooks/event/useEventBus';
|
||||||
import { cloneDeep } from 'lodash-es';
|
import { cloneDeep } from 'lodash-es';
|
||||||
import { getAllCom} from '/@/api/contract/ContractPurInt';
|
import { getAllCom} from '/@/api/contract/ContractPurInt';
|
||||||
|
import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat';
|
||||||
|
|
||||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||||
|
|
||||||
@ -83,7 +82,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,datalog : handleDatalog,delete : handleDelete,}
|
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,datalog : handleDatalog,delete : handleDelete,}
|
||||||
|
const tableData = ref([])
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const formIdComputedRef = ref();
|
const formIdComputedRef = ref();
|
||||||
@ -92,7 +91,7 @@
|
|||||||
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
|
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
|
||||||
const [registerModal, { openModal }] = useModal();
|
const [registerModal, { openModal }] = useModal();
|
||||||
const formName=currentRoute.value.meta?.title;
|
const formName=currentRoute.value.meta?.title;
|
||||||
const [registerTable, { reload, }] = useTable({
|
const [registerTable, { reload, setTableData }] = useTable({
|
||||||
title: '' || (formName + '列表'),
|
title: '' || (formName + '列表'),
|
||||||
api: getLngInventoryOutPage,
|
api: getLngInventoryOutPage,
|
||||||
rowKey: 'id',
|
rowKey: 'id',
|
||||||
@ -109,6 +108,7 @@
|
|||||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page:params.limit };
|
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page:params.limit };
|
||||||
},
|
},
|
||||||
afterFetch: (res) => {
|
afterFetch: (res) => {
|
||||||
|
tableData.value = res || []
|
||||||
tableRef.value.setToolBarWidth();
|
tableRef.value.setToolBarWidth();
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -128,42 +128,38 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
watch(
|
||||||
|
() => tableData.value,
|
||||||
|
(val) => {
|
||||||
|
if (val) {
|
||||||
|
let arr = DataFormat.format(val, [
|
||||||
|
FormatOption.createQty('qtyGj'),
|
||||||
|
FormatOption.createQty('qtyTon'),
|
||||||
|
FormatOption.createQty('qtyM3'),
|
||||||
|
FormatOption.createAmt('amount'),
|
||||||
|
]);
|
||||||
|
if (arr.length) {
|
||||||
|
setTableData(arr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true,
|
||||||
|
deep: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
function dbClickRow(record) {
|
function dbClickRow(record) {
|
||||||
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const { processId, taskIds, schemaId } = record.workflowData || {};
|
|
||||||
if (taskIds && taskIds.length) {
|
|
||||||
router.push({
|
router.push({
|
||||||
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
path: '/inventory/LngInventoryOut/createForm',
|
||||||
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/LngInventoryOut/' + record.id + '/viewForm',
|
|
||||||
query: {
|
query: {
|
||||||
formPath: 'inventory/LngInventoryOut',
|
formPath: 'inventory/LngInventoryOut',
|
||||||
formName: formName,
|
formName: '查看'+formName,
|
||||||
formId:currentRoute.value.meta.formId
|
formId:currentRoute.value.meta.formId,
|
||||||
|
type: 'view',
|
||||||
|
id: record.id
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function buttonClick(code) {
|
function buttonClick(code) {
|
||||||
|
|
||||||
@ -181,10 +177,10 @@
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
router.push({
|
router.push({
|
||||||
path: '/form/LngInventoryOut/0/createForm',
|
path: '/inventory/LngInventoryOut/createForm',
|
||||||
query: {
|
query: {
|
||||||
formPath: 'inventory/LngInventoryOut',
|
formPath: 'inventory/LngInventoryOut',
|
||||||
formName: formName,
|
formName: '新建'+formName,
|
||||||
formId:currentRoute.value.meta.formId
|
formId:currentRoute.value.meta.formId
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -194,11 +190,13 @@
|
|||||||
function handleEdit(record: Recordable) {
|
function handleEdit(record: Recordable) {
|
||||||
|
|
||||||
router.push({
|
router.push({
|
||||||
path: '/form/LngInventoryOut/' + record.id + '/updateForm',
|
path: '/inventory/LngInventoryOut/createForm',
|
||||||
query: {
|
query: {
|
||||||
formPath: 'inventory/LngInventoryOut',
|
formPath: 'inventory/LngInventoryOut',
|
||||||
formName: formName,
|
formName: '编辑'+formName,
|
||||||
formId:currentRoute.value.meta.formId
|
formId:currentRoute.value.meta.formId,
|
||||||
|
type: 'edit',
|
||||||
|
id: record.id
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -216,7 +214,7 @@
|
|||||||
deleteLngInventoryOut(ids).then((_) => {
|
deleteLngInventoryOut(ids).then((_) => {
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
notification.success({
|
notification.success({
|
||||||
message: 'Tip',
|
message: '提示',
|
||||||
description: t('删除成功!'),
|
description: t('删除成功!'),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -345,9 +345,5 @@
|
|||||||
.pdcss {
|
.pdcss {
|
||||||
padding:0px 12px 6px 12px !important;
|
padding:0px 12px 6px 12px !important;
|
||||||
}
|
}
|
||||||
:deep(.formItemWarp .ant-form-item-label > label) {
|
|
||||||
white-space: normal !important;
|
|
||||||
word-break: break-word !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -780,9 +780,5 @@
|
|||||||
.pdcss {
|
.pdcss {
|
||||||
padding:0px 12px 6px 12px !important;
|
padding:0px 12px 6px 12px !important;
|
||||||
}
|
}
|
||||||
:deep(.formItemWarp .ant-form-item-label > label) {
|
|
||||||
white-space: normal !important;
|
|
||||||
word-break: break-word !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -744,9 +744,5 @@
|
|||||||
.pdcss {
|
.pdcss {
|
||||||
padding:0px 12px 6px 12px !important;
|
padding:0px 12px 6px 12px !important;
|
||||||
}
|
}
|
||||||
:deep(.formItemWarp .ant-form-item-label > label) {
|
|
||||||
white-space: normal !important;
|
|
||||||
word-break: break-word !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user