采运销接口
This commit is contained in:
@ -10,6 +10,7 @@ enum Api {
|
|||||||
LngContractSalesPngPoint = '/contract/contractSalesPngPur',
|
LngContractSalesPngPoint = '/contract/contractSalesPngPur',
|
||||||
selectPcPageList = '/magic-api/contract/contractSalesPngPoint/selectPcPageList',
|
selectPcPageList = '/magic-api/contract/contractSalesPngPoint/selectPcPageList',
|
||||||
selectScPageList = '/magic-api/contract/contractSalesPngPoint/selectScPageList',
|
selectScPageList = '/magic-api/contract/contractSalesPngPoint/selectScPageList',
|
||||||
|
selectTcPageList = '/magic-api/contract/contractSalesPngPoint/selectTcPageList',
|
||||||
|
|
||||||
|
|
||||||
DataLog = '/contract/contractSalesPngPur/datalog',
|
DataLog = '/contract/contractSalesPngPur/datalog',
|
||||||
@ -26,6 +27,19 @@ export async function getContractScPageList(ksppId: String, mode: ErrorMessageMo
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
// 管输合同
|
||||||
|
export async function getContractSalesPngPointTc(params: LngContractSalesPngPointPageParams, mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.get<LngContractSalesPngPointPageResult>(
|
||||||
|
{
|
||||||
|
url: Api.selectTcPageList,
|
||||||
|
params,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// 采购合同
|
||||||
export async function getContractSalesPngPoint(params: LngContractSalesPngPointPageParams, mode: ErrorMessageMode = 'modal') {
|
export async function getContractSalesPngPoint(params: LngContractSalesPngPointPageParams, mode: ErrorMessageMode = 'modal') {
|
||||||
return defHttp.get<LngContractSalesPngPointPageResult>(
|
return defHttp.get<LngContractSalesPngPointPageResult>(
|
||||||
{
|
{
|
||||||
@ -55,11 +69,11 @@ export async function getLngContractSalesPngPointPage(params: LngContractSalesPn
|
|||||||
/**
|
/**
|
||||||
* @description: 获取LngContractSalesPngPoint信息
|
* @description: 获取LngContractSalesPngPoint信息
|
||||||
*/
|
*/
|
||||||
export async function getLngContractSalesPngPoint(ksppId: String, mode: ErrorMessageMode = 'modal') {
|
export async function getLngContractSalesPngPoint(id: String, mode: ErrorMessageMode = 'modal') {
|
||||||
return defHttp.get<LngContractSalesPngPointPageModel>(
|
return defHttp.get<LngContractSalesPngPointPageModel>(
|
||||||
{
|
{
|
||||||
url: Api.Info,
|
url: Api.Info,
|
||||||
params: { ksppId },
|
params: { id },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
errorMessageMode: mode,
|
errorMessageMode: mode,
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<BasicModal v-bind="$attrs" @register="registerModal" width="60%" :title="getTitle" @ok="handleSubmit"
|
<BasicModal v-bind="$attrs" @register="registerModal" width="60%" :title="getTitle" @ok="handleSubmit"
|
||||||
@visible-change="handleVisibleChange" >
|
@visible-change="handleVisibleChange" >
|
||||||
<BasicTable @register="registerTable" class="ContractPurIntListModal" v-if="showTable"></BasicTable>
|
<BasicTable @register="registerTable" class="contractSalesPngPurPointModal" v-if="showTable"></BasicTable>
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -14,19 +14,12 @@
|
|||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
import { getContractSalesPngPoint } from '/@/api/contract/contractSalesPngPur';
|
import { getContractSalesPngPoint } from '/@/api/contract/contractSalesPngPur';
|
||||||
|
import { getContractSalesPngPointTc } from '/@/api/contract/contractSalesPngPur';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const comId = ref('')
|
const comId = ref('')
|
||||||
|
const dateArr = ref([])
|
||||||
const codeFormSchema: FormSchema[] = [
|
const codeFormSchema: FormSchema[] = [
|
||||||
{
|
|
||||||
field: 'dateFrom',
|
|
||||||
label: '有效期',
|
|
||||||
component: 'RangePicker',
|
|
||||||
componentProps: {
|
|
||||||
format: 'YYYY-MM-DD',
|
|
||||||
style: { width: '100%' },
|
|
||||||
getPopupContainer: () => document.body,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@ -41,9 +34,10 @@
|
|||||||
const selectedValues = ref([]);
|
const selectedValues = ref([]);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
selectType: { type: String, default: 'checkbox' },
|
selectType: { type: String, default: 'checkbox' },
|
||||||
pageType: String
|
pageType: String,
|
||||||
|
defaultDate: { type: Array, default: [] },
|
||||||
});
|
});
|
||||||
|
dateArr.value = props.defaultDate || []
|
||||||
let columns: BasicColumn[] = [
|
let columns: BasicColumn[] = [
|
||||||
{ title: t('合同号'), dataIndex: 'kpNo', },
|
{ title: t('合同号'), dataIndex: 'kpNo', },
|
||||||
{ title: t('合同名称'), dataIndex: 'kpName', },
|
{ title: t('合同名称'), dataIndex: 'kpName', },
|
||||||
@ -55,7 +49,7 @@
|
|||||||
|
|
||||||
];
|
];
|
||||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||||
|
dateArr.value = props.defaultDate || []
|
||||||
showTable.value = true
|
showTable.value = true
|
||||||
comId.value = data.comId
|
comId.value = data.comId
|
||||||
setModalProps({ confirmLoading: false });
|
setModalProps({ confirmLoading: false });
|
||||||
@ -72,8 +66,20 @@
|
|||||||
pagination: true,
|
pagination: true,
|
||||||
canResize: false,
|
canResize: false,
|
||||||
formConfig: {
|
formConfig: {
|
||||||
labelCol:{span: 9, offSet:10},
|
labelCol:{span: 9},
|
||||||
schemas: codeFormSchema,
|
schemas: [
|
||||||
|
{
|
||||||
|
field: 'dateFrom',
|
||||||
|
label: '有效期',
|
||||||
|
component: 'RangePicker',
|
||||||
|
defaultValue: props.defaultDate || [],
|
||||||
|
componentProps: {
|
||||||
|
format: 'YYYY-MM-DD',
|
||||||
|
style: { width: '100%' },
|
||||||
|
getPopupContainer: () => document.body,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
],
|
||||||
fieldMapToTime: [['dateFrom', ['startDate', 'endDate'], 'YYYY-MM-DD']],
|
fieldMapToTime: [['dateFrom', ['startDate', 'endDate'], 'YYYY-MM-DD']],
|
||||||
showResetButton: true,
|
showResetButton: true,
|
||||||
},
|
},
|
||||||
@ -94,7 +100,7 @@
|
|||||||
await nextTick();
|
await nextTick();
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
|
|
||||||
reload({searchInfo:{'limit':1,'size':10,'page':1}});
|
reload({searchInfo:{'limit':1,'size':10,'page':1, startDate: props.defaultDate[0], endDate: props.defaultDate[1] }});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -124,7 +130,7 @@
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style >
|
<style >
|
||||||
.ContractPurIntListModal .basicCol{
|
.contractSalesPngPurPointModal .basicCol{
|
||||||
position: inherit !important;
|
position: inherit !important;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
147
src/components/common/contractSalesPngPurPointTcModal.vue
Normal file
147
src/components/common/contractSalesPngPurPointTcModal.vue
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<BasicModal v-bind="$attrs" @register="registerModal" width="60%" :title="getTitle" @ok="handleSubmit"
|
||||||
|
@visible-change="handleVisibleChange" >
|
||||||
|
<BasicTable @register="registerTable" class="contractSalesPngPurPointModal" 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 { getContractSalesPngPoint } from '/@/api/contract/contractSalesPngPur';
|
||||||
|
import { getContractSalesPngPointTc } from '/@/api/contract/contractSalesPngPur';
|
||||||
|
const { t } = useI18n();
|
||||||
|
const comId = ref('')
|
||||||
|
const dateArr = ref([])
|
||||||
|
const codeFormSchema: FormSchema[] = [
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const emit = defineEmits(['success', 'register']);
|
||||||
|
|
||||||
|
const { notification } = useMessage();
|
||||||
|
const isUpdate = ref(true);
|
||||||
|
const rowId = ref('');
|
||||||
|
const showTable = ref(false)
|
||||||
|
const selectedKeys = ref<string[]>([]);
|
||||||
|
const selectedValues = ref([]);
|
||||||
|
const props = defineProps({
|
||||||
|
selectType: { type: String, default: 'checkbox' },
|
||||||
|
pageType: String,
|
||||||
|
defaultDate: { type: Array, default: [] },
|
||||||
|
});
|
||||||
|
dateArr.value = props.defaultDate || []
|
||||||
|
let columns: BasicColumn[] = [
|
||||||
|
{ title: t('合同号'), dataIndex: 'kpNo', },
|
||||||
|
{ title: t('合同名称'), dataIndex: 'kpName', },
|
||||||
|
{ title: '供应商', dataIndex: 'suName',},
|
||||||
|
{ title: '有效期开始',dataIndex: 'dateFrom', width: 120,},
|
||||||
|
{ title: '有效期结束',dataIndex: 'dateTo', width: 120},
|
||||||
|
{ title: t('合同主体'), dataIndex: 'comName', },
|
||||||
|
{ title: t('上载点'), dataIndex: 'pointUpName'},
|
||||||
|
{ title: t('下载点'), dataIndex: 'pointDelyName'},
|
||||||
|
];
|
||||||
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||||
|
dateArr.value = props.defaultDate || []
|
||||||
|
showTable.value = true
|
||||||
|
comId.value = data.comId
|
||||||
|
setModalProps({ confirmLoading: false });
|
||||||
|
setPagination({'limit': 1,'size': 10,'page': 1});
|
||||||
|
isUpdate.value = !!data?.isUpdate;
|
||||||
|
});
|
||||||
|
|
||||||
|
const [registerTable, { getDataSource, setTableData, updateTableDataRecord, reload,setPagination }] = useTable({
|
||||||
|
title: t('管道气管输合同列表'),
|
||||||
|
api: getContractSalesPngPointTc,
|
||||||
|
columns,
|
||||||
|
|
||||||
|
bordered: true,
|
||||||
|
pagination: true,
|
||||||
|
canResize: false,
|
||||||
|
formConfig: {
|
||||||
|
labelCol:{span: 9},
|
||||||
|
schemas: [
|
||||||
|
{
|
||||||
|
field: 'dateFrom',
|
||||||
|
label: '有效期',
|
||||||
|
component: 'RangePicker',
|
||||||
|
defaultValue: props.defaultDate,
|
||||||
|
componentProps: {
|
||||||
|
format: 'YYYY-MM-DD',
|
||||||
|
style: { width: '100%' },
|
||||||
|
getPopupContainer: () => document.body,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
],
|
||||||
|
fieldMapToTime: [['dateFrom', ['startDate', 'endDate'], 'YYYY-MM-DD']],
|
||||||
|
showResetButton: true,
|
||||||
|
},
|
||||||
|
immediate: false, // 设置为不立即调用
|
||||||
|
beforeFetch: (params) => {
|
||||||
|
return { ...params,page:params.limit, comId: comId.value};
|
||||||
|
},
|
||||||
|
rowSelection: {
|
||||||
|
type: props.selectType,
|
||||||
|
onChange: onSelectChange
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const handleVisibleChange = async (visible: boolean) => {
|
||||||
|
if (visible) {
|
||||||
|
showTable.value = false
|
||||||
|
await nextTick();
|
||||||
|
await nextTick();
|
||||||
|
await nextTick();
|
||||||
|
nextTick(() => {
|
||||||
|
|
||||||
|
reload({searchInfo:{'limit':1,'size':10,'page':1, startDate: props.defaultDate[0], endDate: props.defaultDate[1] }});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
function onSelectChange(rowKeys: string[], e) {
|
||||||
|
selectedKeys.value = rowKeys;
|
||||||
|
selectedValues.value = e
|
||||||
|
}
|
||||||
|
const getTitle = computed(() => (t('管道气管输合同列表')));
|
||||||
|
|
||||||
|
async function handleSubmit() {
|
||||||
|
if (!selectedValues.value.length) {
|
||||||
|
notification.warning({
|
||||||
|
message: t('提示'),
|
||||||
|
description: t('请选择合同')
|
||||||
|
});
|
||||||
|
return
|
||||||
|
}
|
||||||
|
closeModal();
|
||||||
|
emit('success', selectedValues.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style >
|
||||||
|
.contractSalesPngPurPointModal .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>
|
||||||
@ -37,7 +37,7 @@
|
|||||||
const selectedValues = ref([]);
|
const selectedValues = ref([]);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
selectType: { type: String, default: 'checkbox' },
|
selectType: { type: String, default: 'checkbox' },
|
||||||
|
paramsObj: { type: Object, default: {} },
|
||||||
});
|
});
|
||||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||||
|
|
||||||
@ -61,7 +61,7 @@
|
|||||||
},
|
},
|
||||||
immediate: false, // 设置为不立即调用
|
immediate: false, // 设置为不立即调用
|
||||||
beforeFetch: (params) => {
|
beforeFetch: (params) => {
|
||||||
return { ...params, valid: 'Y',approCode: 'YSP',page:params.limit};
|
return { ...params, valid: 'Y',approCode: 'YSP',page:params.limit, ...props.paramsObj};
|
||||||
},
|
},
|
||||||
rowSelection: {
|
rowSelection: {
|
||||||
type: props.selectType,
|
type: props.selectType,
|
||||||
|
|||||||
@ -17,7 +17,7 @@ export const searchFormSchema: FormSchema[] = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'ksName',
|
field: 'kpName',
|
||||||
label: '销售合同号/名称',
|
label: '销售合同号/名称',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
@ -119,7 +119,7 @@ export const columns: BasicColumn[] = [
|
|||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
dataIndex: 'ktpName',
|
dataIndex: 'ktName',
|
||||||
title: '运输合同',
|
title: '运输合同',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
@ -131,7 +131,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '合同主体',
|
title: '合同主体',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -60,7 +60,7 @@
|
|||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="采购合同" name="kpName">
|
<a-form-item label="采购合同" name="kpName">
|
||||||
<a-input-search v-model:value="item.kpName" :disabled="isDisable" placeholder="请选择合同" readonly @search="onContract(idx)"/>
|
<a-input-search v-model:value="item.kpName" :disabled="isDisable||item.id" placeholder="请选择合同" readonly @search="onContract(idx)"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
@ -68,7 +68,7 @@
|
|||||||
<template #label>
|
<template #label>
|
||||||
<span><span style="color:red">*</span>供应商</span>
|
<span><span style="color:red">*</span>供应商</span>
|
||||||
</template>
|
</template>
|
||||||
<a-input-search v-model:value="item.suName" :disabled="isDisable" placeholder="请选择供应商" readonly @search="onSearchSupplier(idx)"/>
|
<a-input-search v-model:value="item.suName" :disabled="isDisable||item.kpId" placeholder="请选择供应商" readonly @search="onSearchSupplier(idx)"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
@ -76,7 +76,7 @@
|
|||||||
<template #label>
|
<template #label>
|
||||||
<span><span style="color:red">*</span>上载点</span>
|
<span><span style="color:red">*</span>上载点</span>
|
||||||
</template>
|
</template>
|
||||||
<a-input-search v-model:value="item.pointUpName" :disabled="isDisable" placeholder="请选择上载点" readonly @search="onSearchDownLoad(idx)"/>
|
<a-input-search v-model:value="item.pointUpName" :disabled="isDisable||item.kpId" placeholder="请选择上载点" readonly @search="onSearchDownLoad(idx)"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
@ -112,7 +112,8 @@
|
|||||||
<template #label>
|
<template #label>
|
||||||
<span><span style="color:red">*</span>顺序</span>
|
<span><span style="color:red">*</span>顺序</span>
|
||||||
</template>
|
</template>
|
||||||
<input-number v-model:value="item.sort" :disabled="isDisable" :digits="0" :min="1" style="width: 100%" />
|
|
||||||
|
<a-input-number v-model:value="item.sort" :disabled="isDisable" :precision="0" :min="1" style="width: 100%" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
@ -128,19 +129,19 @@
|
|||||||
<template v-if="column.dataIndex == 'dateTo'">
|
<template v-if="column.dataIndex == 'dateTo'">
|
||||||
<span><span style="color: red">*</span>结束日期</span>
|
<span><span style="color: red">*</span>结束日期</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex == 'ktpName'">
|
<template v-if="column.dataIndex == 'ktName'">
|
||||||
<span><span style="color: red">*</span>管输合同</span>
|
<span><span style="color: red">*</span>管输合同</span>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<template #bodyCell="{ column, record, index }">
|
<template #bodyCell="{ column, record, index }">
|
||||||
<template v-if="column.dataIndex === 'dateFrom'">
|
<template v-if="column.dataIndex === 'dateFrom'">
|
||||||
<a-date-picker :inputReadOnly="true" v-model:value="record.dateFrom" format="YYYY-MM-DD" :value-format="'YYYY-MM-DD'" @focus="dateFocusTb(idx, index)" :disabled-date="disabledDateStartTb" :disabled="disabled" style="width: 100%" />
|
<a-date-picker :inputReadOnly="true" :disabled="isDisable" v-model:value="record.dateFrom" format="YYYY-MM-DD" :value-format="'YYYY-MM-DD'" @focus="dateFocusTb(idx, index)" :disabled-date="disabledDateStartTb" style="width: 100%" />
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'dateTo'">
|
<template v-if="column.dataIndex === 'dateTo'">
|
||||||
<a-date-picker :inputReadOnly="true" v-model:value="record.dateTo" format="YYYY-MM-DD" :value-format="'YYYY-MM-DD'" @focus="dateFocusTb(idx, index)" :disabled-date="disabledDateEndTb" :disabled="disabled" style="width: 100%" />
|
<a-date-picker :inputReadOnly="true" :disabled="isDisable" v-model:value="record.dateTo" format="YYYY-MM-DD" :value-format="'YYYY-MM-DD'" @focus="dateFocusTb(idx, index)" :disabled-date="disabledDateEndTb" style="width: 100%" />
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'ktpName'">
|
<template v-if="column.dataIndex === 'ktName'">
|
||||||
|
<a-input-search v-model:value="record.ktName" :disabled="isDisable || record.id" placeholder="请选择管输合同" readonly @search="onContractTc(idx, index)"/>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'operation'">
|
<template v-if="column.dataIndex === 'operation'">
|
||||||
<a v-if="!isDisable" @click="deleteRow(idx,index)">删除</a>
|
<a v-if="!isDisable" @click="deleteRow(idx,index)">删除</a>
|
||||||
@ -152,9 +153,10 @@
|
|||||||
</Card>
|
</Card>
|
||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
<supplierListModal @register="registerSupplier" @success="handleSuccessSupplier" selectType="radio" />
|
<supplierListModal @register="registerSupplier" @success="handleSuccessSupplier" selectType="radio" :paramsObj="{suCode: formState.suCode}" />
|
||||||
<downloadPointModal @register="registerDownLoad" @success="handleSuccessDownLoad"/>
|
<downloadPointModal @register="registerDownLoad" @success="handleSuccessDownLoad"/>
|
||||||
<contractSalesPngPurPointModal @register="registerPur" @success="handleSuccessPur" selectType="radio" />
|
<contractSalesPngPurPointModal @register="registerPur" @success="handleSuccessPur" selectType="radio" :defaultDate="[formState.dateFrom, formState.dateTo]"/>
|
||||||
|
<contractSalesPngPurPointTcModal @register="registerTc" @success="handleSuccessTc" selectType="radio" :defaultDate="[formState.dateFrom, formState.dateTo]"/>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -178,8 +180,9 @@
|
|||||||
import supplierListModal from '/@/components/common/supplierListModal.vue';
|
import supplierListModal from '/@/components/common/supplierListModal.vue';
|
||||||
import downloadPointModal from '/@/components/common/downloadPointModal.vue';
|
import downloadPointModal from '/@/components/common/downloadPointModal.vue';
|
||||||
import contractSalesPngPurPointModal from '/@/components/common/contractSalesPngPurPointModal.vue';
|
import contractSalesPngPurPointModal from '/@/components/common/contractSalesPngPurPointModal.vue';
|
||||||
|
import contractSalesPngPurPointTcModal from '/@/components/common/contractSalesPngPurPointTcModal.vue';
|
||||||
import { useUserStore } from '/@/store/modules/user';
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
import { getLngOpsPurInt} from '/@/api/ship/OpsPurInt';
|
import { cloneDeep } from 'lodash-es';
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const userInfo = userStore.getUserInfo;
|
const userInfo = userStore.getUserInfo;
|
||||||
|
|
||||||
@ -206,35 +209,34 @@
|
|||||||
const dataList = ref([])
|
const dataList = ref([])
|
||||||
const curIdx = ref(null)
|
const curIdx = ref(null)
|
||||||
const curIndex = ref(null)
|
const curIndex = ref(null)
|
||||||
|
|
||||||
const spinning = ref(false);
|
const spinning = ref(false);
|
||||||
const { notification } = useMessage();
|
const { notification } = useMessage();
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
const formState = reactive({
|
const formState = reactive({
|
||||||
approCode: 'WTJ'
|
|
||||||
});
|
});
|
||||||
|
const formStateContract = reactive({})
|
||||||
const [registerSupplier, { openModal:openModalSupplier}] = useModal();
|
const [registerSupplier, { openModal:openModalSupplier}] = useModal();
|
||||||
const [registerDownLoad, { openModal:openModalDownLoad}] = useModal();
|
const [registerDownLoad, { openModal:openModalDownLoad}] = useModal();
|
||||||
const [registerPur, { openModal:openModalPur}] = useModal();
|
const [registerPur, { openModal:openModalPur}] = useModal();
|
||||||
|
const [registerTc, { openModal:openModalTc}] = useModal();
|
||||||
const rules= reactive({
|
const rules= reactive({
|
||||||
|
|
||||||
});
|
});
|
||||||
const columns= ref([
|
const columns= ref([
|
||||||
{ title: t('序号'), dataIndex: 'index', key: 'index', customRender: (column) => `${column.index + 1}` ,width: 50},
|
{ title: t('序号'), dataIndex: 'index', key: 'index', customRender: (column) => `${column.index + 1}` ,width: 50},
|
||||||
{ title: t('托运商'), dataIndex: 'suName', width: 150},
|
{ title: t('托运商'), dataIndex: 'suYsName', width: 130},
|
||||||
{ title: t('管输上载点'), dataIndex: 'pointUpTransName', width: 150},
|
{ title: t('管输上载点'), dataIndex: 'pointUpTransName', width: 130},
|
||||||
{ title: t('管输下载点'), dataIndex: 'pointDelyTransName', width: 150},
|
{ title: t('管输下载点'), dataIndex: 'pointDelyTransName', width: 130},
|
||||||
{ title: t('开始日期'), dataIndex: 'dateFrom', width: 150},
|
{ title: t('开始日期'), dataIndex: 'dateFrom', width: 140},
|
||||||
{ title: t('结束日期'), dataIndex: 'dateTo', width: 150},
|
{ title: t('结束日期'), dataIndex: 'dateTo', width: 140},
|
||||||
{ title: t('管输合同'), dataIndex: 'ktpName', width: 150},
|
{ title: t('管输合同'), dataIndex: 'ktName'},
|
||||||
{ title: t('操作'), dataIndex: 'operation', width: 80, fixed: 'right',align: 'center'},
|
{ title: t('操作'), dataIndex: 'operation', width: 60, fixed: 'right',align: 'center'},
|
||||||
]);
|
]);
|
||||||
const layout = {
|
const layout = {
|
||||||
labelCol: { span: 8 },
|
labelCol: { span: 8 },
|
||||||
wrapperCol: { span: 16 },
|
wrapperCol: { span: 16 },
|
||||||
}
|
}
|
||||||
const dataFile = ref([]);
|
|
||||||
let optionSelect= reactive({
|
let optionSelect= reactive({
|
||||||
transSignList: [],
|
transSignList: [],
|
||||||
});
|
});
|
||||||
@ -253,6 +255,10 @@
|
|||||||
() => props.disabled,
|
() => props.disabled,
|
||||||
(val) => {
|
(val) => {
|
||||||
isDisable.value = val
|
isDisable.value = val
|
||||||
|
if ( isDisable.value ) {
|
||||||
|
let idx = columns.value.findIndex(v=>v.dataIndex=='operation')
|
||||||
|
idx>-1&&columns.value.splice(idx, 1)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
immediate: true
|
immediate: true
|
||||||
@ -269,8 +275,20 @@
|
|||||||
spinning.value = true
|
spinning.value = true
|
||||||
try {
|
try {
|
||||||
let data = await getContractScPageList(id)
|
let data = await getContractScPageList(id)
|
||||||
|
|
||||||
|
Object.assign(formState, {...data?.list[0]})
|
||||||
|
let res = await getLngContractSalesPngPoint(id)
|
||||||
spinning.value = false
|
spinning.value = false
|
||||||
// Object.assign(formState, {...data?.list[0]})
|
dataList.value = res?.lngContractSalesPngPointPurList || []
|
||||||
|
dataList.value.forEach(v=> {
|
||||||
|
v.dateFrom = v.dateFrom ? dayjs(v.dateFrom) : null
|
||||||
|
v.dateTo = v.dateTo ? dayjs(v.dateTo) : null
|
||||||
|
(v.lngContractSalesPngPointTransList||[]).forEach(i=> {
|
||||||
|
i.dateFrom = i.dateFrom ? dayjs(i.dateFrom) : null
|
||||||
|
i.dateTo = i.dateTo ? dayjs(i.dateTo) : null
|
||||||
|
})
|
||||||
|
})
|
||||||
|
Object.assign(formStateContract, {...res})
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
spinning.value = false
|
spinning.value = false
|
||||||
@ -316,8 +334,12 @@
|
|||||||
lngContractSalesPngPointTransList: []
|
lngContractSalesPngPointTransList: []
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const handleDelete= (index) => {
|
const handleDelete= (idx) => {
|
||||||
dataList.value.splice(index, 1)
|
if ((dataList.value[idx].lngContractSalesPngPointTransList || []).length) {
|
||||||
|
message.warn('请先删除运输合同')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dataList.value.splice(idx, 1)
|
||||||
}
|
}
|
||||||
const addRow = (idx) => {
|
const addRow = (idx) => {
|
||||||
dataList.value[idx].lngContractSalesPngPointTransList.push({dateFrom: null, dateTo: null})
|
dataList.value[idx].lngContractSalesPngPointTransList.push({dateFrom: null, dateTo: null})
|
||||||
@ -329,9 +351,14 @@
|
|||||||
optionSelect.transSignList = await getDictionary('LNG_YN')
|
optionSelect.transSignList = await getDictionary('LNG_YN')
|
||||||
|
|
||||||
}
|
}
|
||||||
|
const onContractTc = (idx, index) => {
|
||||||
|
curIdx.value = idx
|
||||||
|
curIndex.value = index
|
||||||
|
openModalTc(true,{isUpdate: false, comId: formState.comId})
|
||||||
|
}
|
||||||
const onContract = (idx) => {
|
const onContract = (idx) => {
|
||||||
curIdx.value = idx
|
curIdx.value = idx
|
||||||
openModalPur(true,{isUpdate: false})
|
openModalPur(true,{isUpdate: false, comId: formState.comId})
|
||||||
}
|
}
|
||||||
const onSearchDownLoad = (idx)=> {
|
const onSearchDownLoad = (idx)=> {
|
||||||
curIdx.value = idx
|
curIdx.value = idx
|
||||||
@ -342,8 +369,8 @@
|
|||||||
openModalSupplier(true,{isUpdate: false})
|
openModalSupplier(true,{isUpdate: false})
|
||||||
}
|
}
|
||||||
const handleSuccessDownLoad = (val) => {
|
const handleSuccessDownLoad = (val) => {
|
||||||
dataList.value[curIdx.value].pointUpCode = val[0].code
|
dataList.value[curIdx.value].pointUpCode = val[0].code
|
||||||
dataList.value[curIdx.value].pointUpName = val[0].fullName
|
dataList.value[curIdx.value].pointUpName = val[0].fullName
|
||||||
|
|
||||||
}
|
}
|
||||||
const handleSuccessSupplier = (val) => {
|
const handleSuccessSupplier = (val) => {
|
||||||
@ -362,6 +389,20 @@
|
|||||||
dataList.value[curIdx.value].transSign = val[0].transSign
|
dataList.value[curIdx.value].transSign = val[0].transSign
|
||||||
|
|
||||||
}
|
}
|
||||||
|
const handleSuccessTc = (val) => {
|
||||||
|
dataList.value[curIdx.value].lngContractSalesPngPointTransList[curIndex.value].ktId = val[0].ktId
|
||||||
|
dataList.value[curIdx.value].lngContractSalesPngPointTransList[curIndex.value].ktpId = val[0].ktpId
|
||||||
|
dataList.value[curIdx.value].lngContractSalesPngPointTransList[curIndex.value].ktName = val[0].kpName
|
||||||
|
dataList.value[curIdx.value].lngContractSalesPngPointTransList[curIndex.value].suYsCode = val[0].suCode
|
||||||
|
dataList.value[curIdx.value].lngContractSalesPngPointTransList[curIndex.value].suCode = val[0].suCode
|
||||||
|
dataList.value[curIdx.value].lngContractSalesPngPointTransList[curIndex.value].suYsName = val[0].suName
|
||||||
|
dataList.value[curIdx.value].lngContractSalesPngPointTransList[curIndex.value].pointUpTransCode = val[0].pointUpCode
|
||||||
|
dataList.value[curIdx.value].lngContractSalesPngPointTransList[curIndex.value].pointUpTransName = val[0].pointUpName
|
||||||
|
dataList.value[curIdx.value].lngContractSalesPngPointTransList[curIndex.value].pointDelyTransCode = val[0].pointDelyCode
|
||||||
|
dataList.value[curIdx.value].lngContractSalesPngPointTransList[curIndex.value].pointDelyTransName = val[0].pointDelyName
|
||||||
|
dataList.value[curIdx.value].lngContractSalesPngPointTransList[curIndex.value].dateFrom = val[0].dateFrom ? dayjs(val[0].dateFrom) : null
|
||||||
|
dataList.value[curIdx.value].lngContractSalesPngPointTransList[curIndex.value].dateTo = val[0].dateTo ? dayjs(val[0].dateTo) : null
|
||||||
|
}
|
||||||
function close() {
|
function close() {
|
||||||
tabStore.closeTab(currentRoute.value, router);
|
tabStore.closeTab(currentRoute.value, router);
|
||||||
}
|
}
|
||||||
@ -371,17 +412,61 @@
|
|||||||
async function handleSubmit(type) {
|
async function handleSubmit(type) {
|
||||||
try {
|
try {
|
||||||
await formRef.value.validateFields();
|
await formRef.value.validateFields();
|
||||||
|
let tipNum = 0
|
||||||
|
let list = cloneDeep(dataList.value)
|
||||||
|
for(let i=0;i<list.length;i++) {
|
||||||
|
list[i].lngContractSalesPngPointTransList = list[i].lngContractSalesPngPointTransList || []
|
||||||
|
list[i].dateFrom = list[i].dateFrom ? dayjs(list[i].dateFrom).format('YYYY-MM-DD HH:mm:ss') : null
|
||||||
|
list[i].dateTo = list[i].dateTo ? dayjs(list[i].dateTo).format('YYYY-MM-DD HH:mm:ss') : null
|
||||||
|
let isFalg = (!list[i].kpId) && (!list[i].suCode || !list[i].pointUpCode)
|
||||||
|
if (isFalg || !list[i].transSign || !list[i].dateFrom || !list[i].dateTo || !list[i].sort) {
|
||||||
|
message.warn('请完善关联采购信息必选项')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 激发提示条件,采购合同非空,自主托运为否,提示请确认是否需要关联运输合同
|
||||||
|
// 采购合同为空,自主托运为是,管输合同若未填写则提示请确认是否需要关联运输合同
|
||||||
|
let isTip = list[i].kpId && list[i].transSign=='N' && list[i].lngContractSalesPngPointTransList.length
|
||||||
|
let isTipNew = !list[i].kpId && list[i].transSign=='Y' && !list[i].lngContractSalesPngPointTransList.length
|
||||||
|
if (isTip || isTipNew) {
|
||||||
|
tipNum++
|
||||||
|
}
|
||||||
|
if (!list[i].id) {
|
||||||
|
list[i].ksppId = formState.ksppId
|
||||||
|
list[i].pointDelyCode = formState.pointDelyCode
|
||||||
|
list[i].ksId = formStateContract.kId
|
||||||
|
}
|
||||||
|
for(let j = 0; j<list[i].lngContractSalesPngPointTransList.length;j++) {
|
||||||
|
list[i].lngContractSalesPngPointTransList[j].dateFrom = list[i].lngContractSalesPngPointTransList[j].dateFrom ? dayjs(list[i].lngContractSalesPngPointTransList[j].dateFrom).format('YYYY-MM-DD HH:mm:ss') : null
|
||||||
|
list[i].lngContractSalesPngPointTransList[j].dateTo = list[i].lngContractSalesPngPointTransList[j].dateTo ? dayjs(list[i].lngContractSalesPngPointTransList[j].dateTo).format('YYYY-MM-DD HH:mm:ss') : null
|
||||||
|
if (!list[i].lngContractSalesPngPointTransList[j].ktId || !list[i].lngContractSalesPngPointTransList[j].dateFrom || !list[i].lngContractSalesPngPointTransList[j].dateTo) {
|
||||||
|
message.warn('请完善运输合同表格必选项')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!list[i].lngContractSalesPngPointTransList[j].id) {
|
||||||
|
list[i].lngContractSalesPngPointTransList[j].kspppId = list[i].id
|
||||||
|
list[i].lngContractSalesPngPointTransList[j].ksId = list[i].ksId
|
||||||
|
list[i].lngContractSalesPngPointTransList[j].ksppId = list[i].ksppId
|
||||||
|
list[i].lngContractSalesPngPointTransList[j].pointDelyCode = list[i].pointDelyCode
|
||||||
|
list[i].lngContractSalesPngPointTransList[j].pointUpCode = list[i].pointUpCode
|
||||||
|
list[i].lngContractSalesPngPointTransList[j].transSign = list[i].transSign
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
let obj = {
|
let obj = {
|
||||||
...formState,
|
...formStateContract,
|
||||||
|
lngContractSalesPngPointPurList: list
|
||||||
|
}
|
||||||
|
if (tipNum) {
|
||||||
|
message.warn('请确认是否需要关联运输合同?')
|
||||||
}
|
}
|
||||||
spinning.value = true;
|
spinning.value = true;
|
||||||
let request = !formState.id ? addLngContractSalesPngPoint :updateLngContractSalesPngPoint
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const data = await request(obj);
|
const data = await updateLngContractSalesPngPoint(obj);
|
||||||
notification.success({
|
notification.success({
|
||||||
message: '提示',
|
message: '提示',
|
||||||
description: data?.id ? t('新增成功!') : t('修改成功!')
|
description: t('修改成功!')
|
||||||
}); //提示消息
|
}); //提示消息
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
@ -105,7 +105,7 @@
|
|||||||
field: 'dateFrom',
|
field: 'dateFrom',
|
||||||
label: '销售合同有效期',
|
label: '销售合同有效期',
|
||||||
component: 'RangePicker',
|
component: 'RangePicker',
|
||||||
// defaultValue: defaultDate.value,
|
defaultValue: defaultDate.value,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
format: 'YYYY-MM-DD',
|
format: 'YYYY-MM-DD',
|
||||||
style: { width: '100%' },
|
style: { width: '100%' },
|
||||||
@ -113,7 +113,7 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'ksName',
|
field: 'kpName',
|
||||||
label: '销售合同号/名称',
|
label: '销售合同号/名称',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
@ -139,7 +139,7 @@
|
|||||||
|
|
||||||
striped: false,
|
striped: false,
|
||||||
actionColumn: {
|
actionColumn: {
|
||||||
width: 160,
|
width: 100,
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
slots: { customRender: 'action' },
|
slots: { customRender: 'action' },
|
||||||
|
|||||||
Reference in New Issue
Block a user