入库
This commit is contained in:
@ -3,17 +3,28 @@ import { defHttp } from '/@/utils/http/axios';
|
||||
import { ErrorMessageMode } from '/#/axios';
|
||||
|
||||
enum Api {
|
||||
Page = '/inventory/lngInventoryIn/page',
|
||||
// Page = '/inventory/lngInventoryIn/page',
|
||||
Page = '/magic-api/inventory/inventoryInPageList',
|
||||
List = '/inventory/lngInventoryIn/list',
|
||||
Info = '/inventory/lngInventoryIn/info',
|
||||
LngInventoryIn = '/inventory/lngInventoryIn',
|
||||
|
||||
lngInventorySelectMpi='/magic-api/inventory/lngInventorySelectMpi',
|
||||
|
||||
|
||||
|
||||
DataLog = '/inventory/lngInventoryIn/datalog',
|
||||
}
|
||||
|
||||
export async function getLngInventoryInShip(id: String, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<LngInventoryInPageModel>(
|
||||
{
|
||||
url: Api.lngInventorySelectMpi,
|
||||
params: { id },
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @description: 查询LngInventoryIn分页列表
|
||||
*/
|
||||
|
||||
@ -14,20 +14,10 @@
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { getLngOpsPurIntPage} from '/@/api/ship/OpsPurInt';
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
const { t } = useI18n();
|
||||
const codeFormSchema: FormSchema[] = [
|
||||
{ field: 'ssNo', label: '船期编号', component: 'Input'},
|
||||
{
|
||||
field: 'dateFrom',
|
||||
label: '卸港ETA',
|
||||
component: 'RangePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD',
|
||||
style: { width: '100%' },
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
const columns: BasicColumn[] = [
|
||||
@ -50,8 +40,11 @@
|
||||
const selectedValues = ref([]);
|
||||
const props = defineProps({
|
||||
selectType: { type: String, default: 'radio' },
|
||||
defaultDateType: { type: Boolean, default: false }
|
||||
|
||||
});
|
||||
const defaultDate = ref([dayjs().subtract(7, 'day').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')]);
|
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
showTable.value = true
|
||||
setModalProps({ confirmLoading: false });
|
||||
@ -69,7 +62,20 @@
|
||||
canResize: false,
|
||||
formConfig: {
|
||||
labelCol:{span: 9, offSet:10},
|
||||
schemas: codeFormSchema,
|
||||
schemas: [
|
||||
{ field: 'ssNo', label: '船期编号', component: 'Input'},
|
||||
{
|
||||
field: 'dateFrom',
|
||||
label: '卸港ETA',
|
||||
component: 'RangePicker',
|
||||
defaultValue: props.defaultDateType ? defaultDate.value : [],
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD',
|
||||
style: { width: '100%' },
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
],
|
||||
fieldMapToTime: [['dateFrom', ['startDate', 'endDate'], 'YYYY-MM-DD']],
|
||||
showResetButton: true,
|
||||
},
|
||||
@ -89,7 +95,11 @@
|
||||
await nextTick();
|
||||
await nextTick();
|
||||
nextTick(() => {
|
||||
reload();
|
||||
if (props.defaultDateType) {
|
||||
reload({ searchInfo: { startDate: defaultDate.value[0], endDate: defaultDate.value[1] }});
|
||||
} else {
|
||||
reload()
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
@ -97,7 +107,7 @@
|
||||
selectedKeys.value = rowKeys;
|
||||
selectedValues.value = e
|
||||
}
|
||||
const getTitle = computed(() => (!unref(isUpdate) ? t('采购执行列表') : t('')));
|
||||
const getTitle = ('采购执行列表')
|
||||
|
||||
async function handleSubmit() {
|
||||
if (!selectedValues.value.length) {
|
||||
|
||||
@ -143,16 +143,16 @@
|
||||
const emit = defineEmits(['change']);
|
||||
const numCount = (record, idx, k)=> {
|
||||
let uomCode = dataListPrice.value[idx].uomCode
|
||||
if (uomCode == 'GJ' && k == 'rateQtyGj' && record[k]) {
|
||||
if (uomCode == 'GJ' && k == 'rateQtyGj') {
|
||||
record.rateQtyM3 = record.rateM3Gj ? (Number(record.rateQtyGj || 0)/ Number(record.rateM3Gj)).toFixed(4) : ''
|
||||
}
|
||||
if (uomCode == 'GJ' && k == 'priceGj' && record[k]) {
|
||||
if (uomCode == 'GJ' && k == 'priceGj') {
|
||||
record.priceM3 = record.rateM3Gj ? (Number(record.priceGj || 0) / Number(record.rateM3Gj)).toFixed(4) : ''
|
||||
}
|
||||
if (uomCode == 'M3' && k == 'rateQtyM3' && record[k]) {
|
||||
if (uomCode == 'M3' && k == 'rateQtyM3' ) {
|
||||
record.rateQtyGj = (Number(record.rateQtyM3 || 0)*Number(record.rateM3Gj || 0)).toFixed(3)
|
||||
}
|
||||
if (uomCode == 'M3' && k == 'priceM3' && record[k]) {
|
||||
if (uomCode == 'M3' && k == 'priceM3') {
|
||||
record.priceGj = (Number(record.priceM3 || 0)*Number(record.rateM3Gj || 0)).toFixed(3)
|
||||
}
|
||||
updatePriceDesc(idx)
|
||||
|
||||
@ -25,19 +25,19 @@
|
||||
<a-table :columns="columns" :data-source="dataList" :scroll="{x: 1800}" :rowKey="rowKey" :pagination="false" :row-selection="{ selectedRowKeys: selectedKeys, onChange: onSelectChange }">
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === 'qtySettleGj'">
|
||||
<input-number v-model:value="record.qtySettleGj" :disabled="disabled" :digits="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="record.qtySettleGj" :disabled="disabled" :digits="3" :min="0" @change="numCount" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'qtySettleTon'">
|
||||
<input-number v-model:value="record.qtySettleTon" :disabled="disabled" :digits="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="record.qtySettleTon" :disabled="disabled" :digits="3" :min="0" @change="numCount" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'priceGj'">
|
||||
<input-number v-model:value="record.priceGj" :disabled="disabled" :digits="4" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="record.priceGj" :disabled="disabled" :digits="4" :min="0" @change="numCount" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'priceTon'">
|
||||
<input-number v-model:value="record.priceTon" :disabled="disabled" :digits="4" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="record.priceTon" :disabled="disabled" :digits="4" :min="0" @change="numCount" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'amount'">
|
||||
<input-number v-model:value="record.amount" :disabled="disabled" :digits="2" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="record.amount" :disabled="disabled" :digits="2" :min="0" @change="numCount" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'operation'">
|
||||
<a v-if="!disabled" @click="btnCheck(record, index, 'delete')">删除</a>
|
||||
@ -74,13 +74,13 @@
|
||||
{ title: t('挂车号'), dataIndex: 'noTrailer', width:120},
|
||||
{ title: t('进厂皮重时间'), dataIndex: 'timeIn', width:160},
|
||||
{ title: t('出厂毛重时间'), dataIndex: 'timeOut', width:160},
|
||||
{ title: t('装车量(吉焦)'), dataIndex: 'qtyMeaGj', width:140},
|
||||
{ title: t('装车量(吨)'), dataIndex: 'qtyMeaTon', width:140},
|
||||
{ title: t('结算量(吉焦)'), dataIndex: 'qtySettleGj', width: 150},
|
||||
{ title: t('结算量(吨)'), dataIndex: 'qtySettleTon', width: 140},
|
||||
{ title: t('装车量(吉焦)'), dataIndex: 'qtyMeaGj', width:170},
|
||||
{ title: t('装车量(吨)'), dataIndex: 'qtyMeaTon', width:170},
|
||||
{ title: t('结算量(吉焦)'), dataIndex: 'qtySettleGj', width: 170},
|
||||
{ title: t('结算量(吨)'), dataIndex: 'qtySettleTon', width: 170},
|
||||
{ title: t('结算价格(元/吉焦)'), dataIndex: 'priceGj', width: 180},
|
||||
{ title: t('结算价格(元/吨)'), dataIndex: 'priceTon', width: 170},
|
||||
{ title: t('结算金额(元)'), dataIndex: 'amount', width: 140},
|
||||
{ title: t('结算价格(元/吨)'), dataIndex: 'priceTon', width: 180},
|
||||
{ title: t('结算金额(元)'), dataIndex: 'amount', width: 170},
|
||||
{ title: t('合同名称'), dataIndex: 'kName', width: 180},
|
||||
{ title: t('结算次数'), dataIndex: 'settleTimes', width: 100},
|
||||
{ title: t('操作'), dataIndex: 'operation', width: 80},
|
||||
@ -95,6 +95,10 @@
|
||||
});
|
||||
const rowKey = 'salesId'
|
||||
const emit = defineEmits(['change']);
|
||||
|
||||
const numCount = () => {
|
||||
emit('change', dataList.value)
|
||||
}
|
||||
const onSelectChange = (rowKeys) => {
|
||||
selectedKeys.value = rowKeys;
|
||||
}
|
||||
@ -111,6 +115,7 @@
|
||||
selectedKeys.value.forEach(i => {
|
||||
if (v.salesId == i) {
|
||||
v[k] = formData[k]
|
||||
emit('change', dataList.value)
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -123,7 +128,6 @@
|
||||
}
|
||||
let obj = {
|
||||
cpCode: props.formState.cpCode,
|
||||
// comId: props.formState.comId
|
||||
}
|
||||
openModalHdr(true,{isUpdate: false, searchParams: obj})
|
||||
} else {
|
||||
@ -144,6 +148,7 @@
|
||||
const handleSuccessHdr = (val) => {
|
||||
val.forEach(v =>{
|
||||
v.cpCode = v.cuCode
|
||||
v.kId = v.ksId
|
||||
})
|
||||
if (!dataList.value.length) {
|
||||
dataList.value = val
|
||||
@ -167,7 +172,7 @@
|
||||
path: '/contract/ContractSales/viewForm',
|
||||
query: {
|
||||
formPath: 'dayPlan/PngSettleHdr',
|
||||
id: record.ksId,
|
||||
id: record.kId,
|
||||
disabled: true
|
||||
}
|
||||
});
|
||||
|
||||
@ -226,15 +226,6 @@
|
||||
}
|
||||
}
|
||||
const numFormat = () => {
|
||||
dataList.value = DataFormat.format(dataList.value, [
|
||||
FormatOption.createQty('qtySettleGj'),
|
||||
FormatOption.createQty('qtySettleTon'),
|
||||
FormatOption.createQty('qtyMeaGj'),
|
||||
FormatOption.createQty('qtyMeaM3'),
|
||||
FormatOption.createAmt('amount'),
|
||||
FormatOption.createQty('priceGj',4),
|
||||
FormatOption.createQty('priceM3',4),
|
||||
]);
|
||||
let obj = {
|
||||
qtySettleGj: formState.qtySettleGj,
|
||||
qtySettleTon: formState.qtySettleTon,
|
||||
|
||||
@ -16,8 +16,8 @@
|
||||
<Card title="基础信息" :bordered="false" >
|
||||
<a-row>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="交易主体" name="comName">
|
||||
<a-select v-model:value="formState.comId" disabled placeholder="请选择" style="width: 100%" allow-clear>
|
||||
<a-form-item label="交易主体" name="comId">
|
||||
<a-select v-model:value="formState.comId" :disabled="isDisable" 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>
|
||||
@ -31,7 +31,7 @@
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="入库存类型" name="typeCode">
|
||||
<a-select v-model:value="formState.typeCode" disabled placeholder="" style="width: 100%" allow-clear>
|
||||
<a-select v-model:value="formState.typeCode" :disabled="isDisable" 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>
|
||||
@ -40,7 +40,7 @@
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="船期编号" name="ssNo">
|
||||
<a-input-search v-model:value="formState.ssNo" :disabled="Boolean(isDisable || pageType ) " placeholder="请选择船期" readonly @search="onSearchShip"/>
|
||||
<a-input-search v-model:value="formState.ssNo" :disabled="Boolean(isDisable || pageType ) " placeholder="请选择" readonly @search="onSearchShip"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
@ -64,84 +64,84 @@
|
||||
<a-row>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="卸港热值(MMBtu)" name="qtyUnloadMmbtu">
|
||||
<input-number v-model:value="formState.qtyUnloadMmbtu" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="formState.qtyUnloadMmbtu" :disabled="isDisable" :digits="3" :min="0" @change="numCount('qtyUnloadMmbtu')" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="卸港热值(吉焦)" name="qtyUnloadGj">
|
||||
<input-number v-model:value="formState.qtyUnloadGj" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="formState.qtyUnloadGj" :disabled="isDisable" :digits="3" :min="0" @change="numCount('qtyUnloadGj')" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="卸港重量(吨)" name="qtyUnloadTon">
|
||||
<input-number v-model:value="formState.qtyUnloadTon" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="formState.qtyUnloadTon" :disabled="isDisable" :digits="3" :min="0" @change="numCount('qtyUnloadTon')" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="卸港体积(标方)" name="qtyUnloadM3L">
|
||||
<input-number v-model:value="formState.qtyUnloadM3L" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="formState.qtyUnloadM3L" :disabled="isDisable" :digits="3" :min="0" @change="numCount('qtyUnloadM3L')" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="卸港体积(方)" name="qtyUnloadM3">
|
||||
<input-number v-model:value="formState.qtyUnloadM3" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="formState.qtyUnloadM3" :disabled="isDisable" :digits="3" :min="0" @change="numCount('qtyUnloadM3')" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="损耗比例%" name="rateLost">
|
||||
<input-number v-model:value="formState.rateLost" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="formState.rateLost" :disabled="isDisable" :digits="3" :min="0" @change="numCount('rateLost')" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="损耗热值(MMBtu)" name="qtyLostMmbtu">
|
||||
<input-number v-model:value="formState.qtyLostMmbtu" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="formState.qtyLostMmbtu" :disabled="isDisable" :digits="3" :min="0" @change="numCount('qtyLostMmbtu')" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="损耗热值(吉焦)" name="qtyLostGj">
|
||||
<input-number v-model:value="formState.qtyLostGj" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="formState.qtyLostGj" :disabled="isDisable" :digits="3" :min="0" @change="numCount('qtyLostGj')" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="损耗重量(吨)" name="qtyLostTon">
|
||||
<input-number v-model:value="formState.qtyLostTon" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="formState.qtyLostTon" :disabled="isDisable" :digits="3" :min="0" @change="numCount('qtyLostTon')" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="损耗体积(标方)" name="qtyLostM3L">
|
||||
<input-number v-model:value="formState.qtyLostM3L" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="formState.qtyLostM3L" :disabled="isDisable" :digits="3" :min="0" @change="numCount('qtyLostM3L')" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="损耗体积(方)" name="qtyLostM3">
|
||||
<input-number v-model:value="formState.qtyLostM3" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="formState.qtyLostM3" :disabled="isDisable" :digits="3" :min="0" @change="numCount('qtyLostM3')" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="入库热值(MMBtu)" name="qtyMmbtu">
|
||||
<input-number v-model:value="formState.qtyMmbtu" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="formState.qtyMmbtu" disabled :digits="3" :min="0" 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" style="width: 100%" />
|
||||
<input-number v-model:value="formState.qtyGj" disabled :digits="3" :min="0" 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" style="width: 100%" />
|
||||
<input-number v-model:value="formState.qtyTon" disabled :digits="3" :min="0" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="入库体积(标方)" name="qtyM3L">
|
||||
<input-number v-model:value="formState.qtyM3L" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="formState.qtyM3L" disabled :digits="3" :min="0" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="入库体积(方)" name="qtyM3">
|
||||
<input-number v-model:value="formState.qtyM3" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="formState.qtyM3" disabled :digits="3" :min="0" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -160,34 +160,34 @@
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="结算币种单价(/MMBtu)" name="priceMmbtu">
|
||||
<input-number v-model:value="formState.priceMmbtu" :disabled="isDisable" :digits="3" :min="0" 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-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="结算币种金额" name="amountCurr">
|
||||
<input-number v-model:value="formState.amountCurr" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="formState.amountCurr" :disabled="isDisable" :digits="2" :min="0" @change="numCount('amountCurr')" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="购汇汇率" name="rateExPur">
|
||||
<input-number v-model:value="formState.rateExPur" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="formState.rateExPur" :disabled="isDisable" :digits="3" :min="0" @change="numCount('rateExPur')" 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="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="formState.amount" :disabled="isDisable" :digits="2" :min="0" @change="numCount('amount')" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="入库价格(元/吨)" name="priceTon">
|
||||
<input-number v-model:value="formState.priceTon" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="formState.priceTon" :disabled="isDisable" :digits="4" :min="0" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="入库价格(元/吉焦)" name="priceGj">
|
||||
<input-number v-model:value="formState.priceGj" :disabled="isDisable" :digits="3" :min="0" style="width: 100%" />
|
||||
<input-number v-model:value="formState.priceGj" :disabled="isDisable" :digits="4" :min="0" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
@ -204,7 +204,7 @@
|
||||
</div>
|
||||
<contractPurIntListModal @register="registerContractPurInt" @success="handleSuccessContractPurInt" selectType="radio" pageType="pur"/>
|
||||
<lngStationModal @register="registerStation" @success="handleSuccessStation"/>
|
||||
<shipScheduleListModal @register="registerShip" @success="handleSuccessShip" />
|
||||
<OpsPurIntListModal @register="registerShip" @success="handleSuccessShip" :defaultDateType="true"/>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
@ -221,8 +221,7 @@
|
||||
import type { Rule } from 'ant-design-vue/es/form';
|
||||
import { getDictionary } from '/@/api/sales/Customer';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { getAllPriceTerm} from '/@/api/contract/ContractPurInt';
|
||||
import { addLngOpsPurInt,updateLngOpsPurInt, getLngOpsPurInt} from '/@/api/ship/OpsPurInt';
|
||||
import { addLngInventoryIn,updateLngInventoryIn, getLngInventoryIn,getLngInventoryInShip} from '/@/api/inventory/LngInventoryIn';
|
||||
import { getAllCurrency } from '/@/api/contract/ContractFact';
|
||||
import dayjs from 'dayjs';
|
||||
import { getAppEnvConfig } from '/@/utils/env';
|
||||
@ -230,18 +229,12 @@
|
||||
import UploadList from '/@/components/Form/src/components/UploadList.vue';
|
||||
import contractPurIntListModal from '../../../../components/common/contractPurIntListModal.vue';
|
||||
import lngStationModal from '/@/components/common/lngStationModal.vue';
|
||||
import shipScheduleListModal from '/@/components/common/shipScheduleListModal.vue';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { getAllCom} from '/@/api/contract/ContractPurInt';
|
||||
import type { CascaderProps } from 'ant-design-vue';
|
||||
import { getAreaList, getAreaInfo} from '/@/api/mdm/CountryRegion';
|
||||
import {getCompDept } from '/@/api/approve/Appro';
|
||||
import { getLngShipSchedule} from '/@/api/ship/ShipSchedule';
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
import OpsPurIntListModal from '/@/components/common/OpsPurIntListModal.vue';
|
||||
import { getLngOpsPurInt} from '/@/api/ship/OpsPurInt';
|
||||
|
||||
const tableName = 'OpsPurInt';
|
||||
const columnName = 'OpsPurInt'
|
||||
const tableName = 'LngInventoryIn';
|
||||
const columnName = 'LngInventoryIn'
|
||||
|
||||
const formType = ref('2'); // 0 新建 1 修改 2 查看
|
||||
const formRef = ref();
|
||||
@ -270,7 +263,8 @@
|
||||
|
||||
const formState = reactive({
|
||||
approCode: 'WTJ',
|
||||
frtSign: 'N'
|
||||
typeCode: 'CQ',
|
||||
catCode: 'LNG'
|
||||
});
|
||||
const [register, { openModal:openModal}] = useModal();
|
||||
const [registerContractPurInt, { openModal:openModalContractPurInt}] = useModal();
|
||||
@ -279,16 +273,23 @@
|
||||
const [registerShip, { openModal:openModalShip}] = useModal();
|
||||
|
||||
const rules= reactive({
|
||||
ssNo: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
comId: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
ssTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
curCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
dateEta: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
suName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
typeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
kName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
staName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
dateOps: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
frtSign: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
insurSign: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
dateIn: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
qtyUnloadMmbtu: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
qtyUnloadGj: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
qtyUnloadTon: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
rateLost: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
qtyLostMmbtu: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
qtyLostGj: [{ 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 = {
|
||||
labelCol: { span: 8 },
|
||||
@ -296,12 +297,9 @@
|
||||
}
|
||||
const dataFile = ref([]);
|
||||
let optionSelect= reactive({
|
||||
signList: [],
|
||||
comIdList: [],
|
||||
ssTypeCodeList: [],
|
||||
typeCodeList: [],
|
||||
curCodeList: [],
|
||||
prcTermCodeList: [],
|
||||
});
|
||||
watch(
|
||||
() => props.id,
|
||||
@ -327,7 +325,7 @@
|
||||
isDisable.value = pageType.value == 'view'
|
||||
getOption()
|
||||
if (pageId.value) {
|
||||
pageSource.value ? getLngShipInfo(pageId.value) :getInfo(pageId.value)
|
||||
getInfo(pageId.value)
|
||||
} else {
|
||||
getOptionParams()
|
||||
}
|
||||
@ -338,7 +336,7 @@
|
||||
async function getInfo(id) {
|
||||
spinning.value = true
|
||||
try {
|
||||
let data = await getLngOpsPurInt(id)
|
||||
let data = await getLngInventoryIn(id)
|
||||
spinning.value = false
|
||||
Object.assign(formState, {...data})
|
||||
Object.assign(dataFile.value, formState.lngFileUploadList || [])
|
||||
@ -351,13 +349,8 @@
|
||||
}
|
||||
}
|
||||
async function getOption() {
|
||||
optionSelect.signList = await getDictionary('LNG_YN')
|
||||
optionSelect.ssTypeCodeList = await getDictionary('LNG_SHP_S')
|
||||
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
|
||||
optionSelect.typeCodeList = await getDictionary('LNG_INV_I')
|
||||
if (!pageId.value) {
|
||||
getCompDeptInfo(userInfo.id)
|
||||
}
|
||||
let res = await getAllCom() || []
|
||||
optionSelect.comIdList = res.map(v=> {
|
||||
return {
|
||||
@ -370,17 +363,39 @@
|
||||
async function getOptionParams() {
|
||||
optionSelect.curCodeList = await getAllCurrency({eid: formState.curCode})
|
||||
}
|
||||
const numCount = () => {
|
||||
formState.amountCurrEst = (Number(formState.qtyMmbtu) || 0) * (Number(formState.priceCurrEst) || 0)
|
||||
formState.amountCurrEst = formState.amountCurrEst ? formState.amountCurrEst.toFixed(2) : ''
|
||||
const typeCodeChange = (val) => {
|
||||
if (val == 'ZN') {
|
||||
formState.opsId = ''
|
||||
formState.ssId = ''
|
||||
formState.kId = ''
|
||||
formState.suCode = ''
|
||||
}
|
||||
}
|
||||
const numChange = () => {
|
||||
formState.amountCurr = (Number(formState.qtySettleMmbtu) || 0) * (Number(formState.priceCurr) || 0)
|
||||
formState.amountCurr = formState.amountCurr ? formState.amountCurr.toFixed(2) : ''
|
||||
const numCount = (k) => {
|
||||
formState.qtyLostMmbtu = Number(formState.qtyUnloadMmbtu || 0)*Number(formState.rateLost || 0)/100
|
||||
formState.qtyLostGj = Number(formState.qtyUnloadGj || 0)*Number(formState.rateLost || 0)/100
|
||||
formState.qtyLostTon = Number(formState.qtyUnloadTon || 0)*Number(formState.rateLost || 0)/100
|
||||
formState.qtyLostM3L = Number(formState.qtyUnloadM3L || 0)*Number(formState.rateLost || 0)/100
|
||||
formState.qtyLostM3 = Number(formState.qtyUnloadM3 || 0)*Number(formState.rateLost || 0)/100
|
||||
|
||||
formState.qtyMmbtu = Number(formState.qtyUnloadMmbtu || 0) - Number(formState.qtyLostMmbtu || 0)
|
||||
formState.qtyGj = Number(formState.qtyUnloadGj || 0) - Number(formState.qtyLostGj || 0)
|
||||
formState.qtyTon = Number(formState.qtyUnloadTon || 0) - Number(formState.qtyLostTon || 0)
|
||||
formState.qtyM3L = Number(formState.qtyUnloadM3L || 0) - Number(formState.qtyLostM3L || 0)
|
||||
formState.qtyM3 = Number(formState.qtyUnloadM3 || 0) - Number(formState.qtyLostM3 || 0)
|
||||
|
||||
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 = () => {
|
||||
openModalShip(true,{isUpdate: false})
|
||||
if (formState.typeCode == 'CQ') {
|
||||
openModalShip(true,{isUpdate: false})
|
||||
}
|
||||
}
|
||||
const onSearchStation = (val)=> {
|
||||
openModalStation(true,{isUpdate: false})
|
||||
@ -397,46 +412,34 @@
|
||||
const handleSuccessShip = (val) => {
|
||||
|
||||
formState.ssNo = val[0].ssNo
|
||||
formState.ssId = val[0].id
|
||||
getLngShipInfo(val[0].id)
|
||||
formState.opsId = val[0].id
|
||||
getLngOpsPurIntInfo(val[0].id)
|
||||
}
|
||||
const getLngShipInfo = async (id) => {
|
||||
const getLngOpsPurIntInfo = async (id) => {
|
||||
try {
|
||||
spinning.value = true
|
||||
let data = await getLngShipSchedule(id)
|
||||
let data = await getLngOpsPurInt(id)
|
||||
let res = await getLngInventoryInShip(id)
|
||||
spinning.value = false
|
||||
formState.ssNo = data.ssNo
|
||||
formState.opsId = data.id
|
||||
formState.ssId = data.id
|
||||
formState.comId = data.comId
|
||||
formState.kId = data.kId
|
||||
formState.kName = data.kName
|
||||
formState.longSpotCode = data.longSpotCode
|
||||
formState.suCode = data.suCode
|
||||
formState.suName = data.suName
|
||||
formState.staCode = data.staCode
|
||||
formState.staName = data.staName
|
||||
formState.sourceName = data.sourceName
|
||||
formState.empId = data.empId
|
||||
formState.empName = data.empName
|
||||
formState.empTel = data.empTel
|
||||
formState.prcTermCode = data.prcTermCode
|
||||
formState.shipCode = data.shipCode
|
||||
formState.shipName = data.shipName
|
||||
formState.dateNor = data.dateNor ? dayjs(data.dateNor) : null
|
||||
formState.portUnloading1Code = data.portUnloading1Code
|
||||
formState.portUnloading1Name = data.portUnloading1Name
|
||||
formState.dateEta = data.dateEta ? dayjs(data.dateEta) : null
|
||||
formState.dateEtb = data.dateEtb ? dayjs(data.dateEtb) : null
|
||||
formState.dateEtc = data.dateEtc ? dayjs(data.dateEtc) : null
|
||||
formState.dateEtd = data.dateEtd ? dayjs(data.dateEtd) : null
|
||||
formState.qtyMmbtu = data.qtyMmbtu
|
||||
formState.qtyGj = data.qtyGj
|
||||
formState.qtyTon = data.qtyTon
|
||||
formState.qtyM3 = data.qtyM3
|
||||
formState.kId = data.kId
|
||||
formState.kName = data.kName
|
||||
formState.suCode = data.suCode
|
||||
formState.suName = data.suName
|
||||
|
||||
formState.dateIn = data.dateEta ? dayjs(data.dateEta) : null
|
||||
formState.curCode = data.curCode
|
||||
formState.rateEx = data.rateEx
|
||||
formState.priceCurrEst = data.priceCurrEst
|
||||
formState.amountCurrEst = data.amountCurrEst
|
||||
formState.priceMmbtu = data.priceCurr
|
||||
formState.amountCurr = data.amountCurr
|
||||
formState.rateExPur = data.rateEx
|
||||
|
||||
|
||||
numCount()
|
||||
|
||||
if (pageSource.value) {
|
||||
getOptionParams()
|
||||
@ -466,11 +469,10 @@
|
||||
await formRef.value.validateFields();
|
||||
let obj = {
|
||||
...formState,
|
||||
salesAreaCode: formState.salesAreaCode ? formState.salesAreaCode[formState.salesAreaCode.length -1] : '',
|
||||
lngFileUploadList: dataFile.value,
|
||||
}
|
||||
spinning.value = true;
|
||||
let request = !formState.id ? addLngOpsPurInt :updateLngOpsPurInt
|
||||
let request = !formState.id ? addLngInventoryIn :updateLngInventoryIn
|
||||
|
||||
try {
|
||||
const data = await request(obj);
|
||||
|
||||
@ -29,9 +29,7 @@
|
||||
const logId = ref('')
|
||||
const logPath = ref('/inventory/lngInventoryIn/datalog');
|
||||
import { DataLog } from '/@/components/pcitc';
|
||||
import { ref, computed, onMounted, onUnmounted, createVNode,
|
||||
|
||||
} from 'vue';
|
||||
import { ref, computed, onMounted, onUnmounted, createVNode, watch} from 'vue';
|
||||
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
@ -52,6 +50,7 @@
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
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();
|
||||
|
||||
@ -87,12 +86,13 @@
|
||||
const { currentRoute } = useRouter();
|
||||
const router = useRouter();
|
||||
const formIdComputedRef = ref();
|
||||
const tableData = ref([])
|
||||
formIdComputedRef.value = currentRoute.value.meta.formId
|
||||
const schemaIdComputedRef = ref();
|
||||
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const formName=currentRoute.value.meta?.title;
|
||||
const [registerTable, { reload, }] = useTable({
|
||||
const [registerTable, { reload, setTableData }] = useTable({
|
||||
title: '' || (formName + '列表'),
|
||||
api: getLngInventoryInPage,
|
||||
rowKey: 'id',
|
||||
@ -109,6 +109,7 @@
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page:params.limit };
|
||||
},
|
||||
afterFetch: (res) => {
|
||||
tableData.value = res || []
|
||||
tableRef.value.setToolBarWidth();
|
||||
|
||||
},
|
||||
@ -128,41 +129,38 @@
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
watch(
|
||||
() => tableData.value,
|
||||
(val) => {
|
||||
if (val) {
|
||||
let arr = DataFormat.format(val, [
|
||||
FormatOption.createQty('qtyMmbtu'),
|
||||
FormatOption.createQty('qtyTon'),
|
||||
FormatOption.createQty('qtyM3L'),
|
||||
FormatOption.createQty('qtyM3'),
|
||||
FormatOption.createQty('qtyGj'),
|
||||
]);
|
||||
if (arr.length) {
|
||||
setTableData(arr)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
deep: true,
|
||||
}
|
||||
);
|
||||
function dbClickRow(record) {
|
||||
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
|
||||
return;
|
||||
}
|
||||
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||
if (taskIds && taskIds.length) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
||||
query: {
|
||||
taskId: taskIds[0],
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
} else if (schemaId && !taskIds && processId) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + processId + '/approveFlow',
|
||||
query: {
|
||||
readonly: 1,
|
||||
taskId: '',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/LngInventoryIn/' + record.id + '/viewForm',
|
||||
query: {
|
||||
formPath: 'inventory/LngInventoryIn',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
router.push({
|
||||
path: '/inventory/LngInventoryIn/createForm',
|
||||
query: {
|
||||
formPath: 'inventory/LngInventoryIn',
|
||||
formName: '查看'+formName,
|
||||
formId:currentRoute.value.meta.formId,
|
||||
type:'view',
|
||||
id: record.id
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function buttonClick(code) {
|
||||
@ -184,7 +182,7 @@
|
||||
path: '/inventory/LngInventoryIn/createForm',
|
||||
query: {
|
||||
formPath: 'inventory/LngInventoryIn',
|
||||
formName: formName,
|
||||
formName: '新建'+formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
@ -198,7 +196,9 @@
|
||||
query: {
|
||||
formPath: 'inventory/LngInventoryIn',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId:currentRoute.value.meta.formId,
|
||||
type: 'view',
|
||||
id: record.id
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user