价格销售
This commit is contained in:
@ -4,17 +4,27 @@ import { ErrorMessageMode } from '/#/axios';
|
|||||||
|
|
||||||
enum Api {
|
enum Api {
|
||||||
// Page = '/price/priceSalesPngApp/page',
|
// Page = '/price/priceSalesPngApp/page',
|
||||||
Page = '/magic-api/price/priceSalesPngApp/page',
|
Page = '/magic-api/price/priceSalesPngApp/page',
|
||||||
List = '/price/priceSalesPngApp/list',
|
List = '/price/priceSalesPngApp/list',
|
||||||
Info = '/price/priceSalesPngApp/info',
|
Info = '/price/priceSalesPngApp/info',
|
||||||
LngPriceSalesPngApp = '/price/priceSalesPngApp',
|
LngPriceSalesPngApp = '/price/priceSalesPngApp',
|
||||||
|
dpagePage = '/magic-api/price/priceSalesPngApp/dpage',
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DataLog = '/price/priceSalesPngApp/datalog',
|
DataLog = '/price/priceSalesPngApp/datalog',
|
||||||
}
|
}
|
||||||
|
export async function getLngPriceContractSalesPng(params: LngPriceSalesPngAppPageParams, mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.get<LngPriceSalesPngAppPageParams>(
|
||||||
|
{
|
||||||
|
url: Api.dpagePage,
|
||||||
|
params,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @description: 查询LngPriceSalesPngApp分页列表
|
* @description: 查询LngPriceSalesPngApp分页列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -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"></BasicTable>
|
<BasicTable @register="registerTable" class="ContractPurIntListModal" v-if="showTable"></BasicTable>
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -14,7 +14,7 @@
|
|||||||
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 { getLngPriceContractPurPng} from '/@/api/price/PricePurPngApp';
|
import { getLngPriceContractPurPng} from '/@/api/price/PricePurPngApp';
|
||||||
|
import {getLngPriceContractSalesPng} from '/@/api/price/PriceSalesPngApp';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const comId = ref('')
|
const comId = ref('')
|
||||||
const codeFormSchema: FormSchema[] = [
|
const codeFormSchema: FormSchema[] = [
|
||||||
@ -30,39 +30,49 @@
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const columns: BasicColumn[] = [
|
|
||||||
{ title: t('合同号'), dataIndex: 'kNo', },
|
|
||||||
{ title: t('合同名称'), dataIndex: 'kName', },
|
|
||||||
{ title: t('供应商'), dataIndex: 'suName' ,},
|
|
||||||
{ title: '有效期开始',dataIndex: 'dateFrom', width: 120,},
|
|
||||||
{ title: '有效期结束',dataIndex: 'dateTo', width: 120},
|
|
||||||
{ title: t('合同主体'), dataIndex: 'comName', },
|
|
||||||
{ title: t('上载点'), dataIndex: 'pointUpName'},
|
|
||||||
|
|
||||||
];
|
|
||||||
|
|
||||||
const emit = defineEmits(['success', 'register']);
|
const emit = defineEmits(['success', 'register']);
|
||||||
|
|
||||||
const { notification } = useMessage();
|
const { notification } = useMessage();
|
||||||
const isUpdate = ref(true);
|
const isUpdate = ref(true);
|
||||||
const rowId = ref('');
|
const rowId = ref('');
|
||||||
|
const showTable = ref(false)
|
||||||
const selectedKeys = ref<string[]>([]);
|
const selectedKeys = ref<string[]>([]);
|
||||||
const selectedValues = ref([]);
|
const selectedValues = ref([]);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
selectType: { type: String, default: 'checkbox' },
|
selectType: { type: String, default: 'checkbox' },
|
||||||
|
pageType: String
|
||||||
|
|
||||||
});
|
});
|
||||||
|
let columns: BasicColumn[] = [
|
||||||
|
{ title: t('合同号'), dataIndex: 'kNo', },
|
||||||
|
{ title: t('合同名称'), dataIndex: 'kName', },
|
||||||
|
{ title: props.pageType == 'pur' ?'供应商' : '客户', dataIndex: props.pageType == 'pur'?'suName': 'cuName' ,},
|
||||||
|
{ title: '有效期开始',dataIndex: 'dateFrom', width: 120,},
|
||||||
|
{ title: '有效期结束',dataIndex: 'dateTo', width: 120},
|
||||||
|
{ title: t('合同主体'), dataIndex: 'comName', },
|
||||||
|
{ title: t('交割点'), dataIndex: 'pointDelyName'},
|
||||||
|
{ title: t('上载点'), dataIndex: 'pointUpName'},
|
||||||
|
{ title: t('计量单位'), dataIndex: 'uomName'},
|
||||||
|
|
||||||
|
];
|
||||||
|
if (props.pageType == 'sales') {
|
||||||
|
columns.splice(7, 1)
|
||||||
|
}
|
||||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||||
|
|
||||||
|
showTable.value = true
|
||||||
|
comId.value = data.comId
|
||||||
setModalProps({ confirmLoading: false });
|
setModalProps({ confirmLoading: false });
|
||||||
|
setPagination({'limit': 1,'size': 10,'page': 1});
|
||||||
isUpdate.value = !!data?.isUpdate;
|
isUpdate.value = !!data?.isUpdate;
|
||||||
comId.value = data.comId
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const [registerTable, { getDataSource, setTableData, updateTableDataRecord, reload }] = useTable({
|
const [registerTable, { getDataSource, setTableData, updateTableDataRecord, reload,setPagination }] = useTable({
|
||||||
title: t('管道气采购合同列表'),
|
title: t('管道气采购合同列表'),
|
||||||
api: getLngPriceContractPurPng,
|
api: props.pageType == 'pur' ? getLngPriceContractPurPng : getLngPriceContractSalesPng,
|
||||||
|
rowKey: 'id',
|
||||||
columns,
|
columns,
|
||||||
|
|
||||||
bordered: true,
|
bordered: true,
|
||||||
@ -83,10 +93,15 @@
|
|||||||
onChange: onSelectChange
|
onChange: onSelectChange
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const handleVisibleChange = (visible: boolean) => {
|
const handleVisibleChange = async (visible: boolean) => {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
|
showTable.value = false
|
||||||
|
await nextTick();
|
||||||
|
await nextTick();
|
||||||
|
await nextTick();
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
reload();
|
|
||||||
|
reload({searchInfo:{'limit':1,'size':10,'page':1}});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -94,7 +109,7 @@
|
|||||||
selectedKeys.value = rowKeys;
|
selectedKeys.value = rowKeys;
|
||||||
selectedValues.value = e
|
selectedValues.value = e
|
||||||
}
|
}
|
||||||
const getTitle = computed(() => (!unref(isUpdate) ? t('管道气采购合同列表') : t('')));
|
const getTitle = computed(() => (!unref(isUpdate) ? t(props.pageType == 'pur'?'管道气采购合同列表': '管道气销售合同列表') : t('')));
|
||||||
|
|
||||||
async function handleSubmit() {
|
async function handleSubmit() {
|
||||||
if (!selectedValues.value.length) {
|
if (!selectedValues.value.length) {
|
||||||
|
|||||||
@ -2,14 +2,14 @@
|
|||||||
<Card :bordered="false" >
|
<Card :bordered="false" >
|
||||||
<template #title>
|
<template #title>
|
||||||
<div style="display: flex; align-items: center;">
|
<div style="display: flex; align-items: center;">
|
||||||
<span style="margin-left: 8px;">供应价格信息</span>
|
<span style="margin-left: 8px;">{{pageType == 'pur' ? '供应价格信息' : '客户价格信息'}}</span>
|
||||||
<a-button type="primary" style="margin: 0 10px" @click="handleAdd" v-if="!isDisable">新增价格</a-button>
|
<a-button type="primary" style="margin: 0 10px" @click="handleAdd" v-if="!isDisable">新增价格</a-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div v-for="(item, idx) in dataListPrice" class="tbStyle">
|
<div v-for="(item, idx) in dataListPrice" class="tbStyle">
|
||||||
<a-button type="primary" style="margin-bottom: 10px;" @click="handleDelete(idx)" v-if="!isDisable">删除</a-button>
|
<a-button type="primary" style="margin-bottom: 10px;" @click="handleDelete(idx)" v-if="!isDisable">删除</a-button>
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="8">
|
<a-col :span="pageType=='pur'?8:16">
|
||||||
<a-form-item name="kName">
|
<a-form-item name="kName">
|
||||||
<template #label>
|
<template #label>
|
||||||
<span><span style="color:red">*</span>合同</span>
|
<span><span style="color:red">*</span>合同</span>
|
||||||
@ -22,19 +22,24 @@
|
|||||||
<template #label>
|
<template #label>
|
||||||
<span><span style="color:red">*</span>价格生效年月</span>
|
<span><span style="color:red">*</span>价格生效年月</span>
|
||||||
</template>
|
</template>
|
||||||
<a-date-picker v-model:value="item.dateFrom" style="width: 100%" :disabled="isDisable" placeholder="请选择日期" />
|
<a-date-picker v-model:value="item.dateFrom" format="YYYY-MM-DD" :value-format="'YYYY-MM-DD'" style="width: 100%" :disabled="isDisable" placeholder="请选择日期" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8" v-if="pageType=='pur'">
|
||||||
<a-form-item label="供应商" name="suName">
|
<a-form-item label="供应商" name="suName">
|
||||||
<a-input v-model:value="item.suName" style="width: 100%" disabled/>
|
<a-input v-model:value="item.suName" style="width: 100%" disabled/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8" v-if="pageType=='pur'">
|
||||||
<a-form-item label="上载点" name="pointUpName">
|
<a-form-item label="上载点" name="pointUpName">
|
||||||
<a-input v-model:value="item.pointUpName" style="width: 100%" disabled />
|
<a-input v-model:value="item.pointUpName" style="width: 100%" disabled />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
<a-col :span="8" v-if="pageType=='sales'">
|
||||||
|
<a-form-item label="客户" name="cuName">
|
||||||
|
<a-input v-model:value="item.cuName" style="width: 100%" disabled/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="交割点" name="pointDelyName">
|
<a-form-item label="交割点" name="pointDelyName">
|
||||||
<a-input v-model:value="item.pointDelyName" style="width: 100%" disabled />
|
<a-input v-model:value="item.pointDelyName" style="width: 100%" disabled />
|
||||||
@ -66,7 +71,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #bodyCell="{ column, record, index }">
|
<template #bodyCell="{ column, record, index }">
|
||||||
<template v-if="column.dataIndex === 'priceCode'">
|
<template v-if="column.dataIndex === 'priceCode'">
|
||||||
<a-select v-model:value="record.priceCode" :disabled="isDisable" style="width: 100%" allow-clear @change="numCount(record, idx, 'rateQtyGj')">
|
<a-select v-model:value="record.priceCode" :disabled="isDisable" style="width: 100%" allow-clear @change="numCount(record, idx, 'priceCode')">
|
||||||
<a-select-option v-for="item in optionSelect.baseIncList" :key="item.code" :value="item.code">
|
<a-select-option v-for="item in optionSelect.baseIncList" :key="item.code" :value="item.code">
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
@ -97,7 +102,7 @@
|
|||||||
</a-table>
|
</a-table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<contractPurPngtListModal @register="registerPur" @success="handleSuccessPur" selectType="radio"/>
|
<contractPurPngtListModal @register="registerPur" @success="handleSuccessPur" selectType="radio" :pageType="pageType"/>
|
||||||
</Card>
|
</Card>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@ -109,7 +114,14 @@
|
|||||||
import { useModal } from '/@/components/Modal';
|
import { useModal } from '/@/components/Modal';
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
import contractPurPngtListModal from '/@/components/common/contractPurPngtListModal.vue';
|
import contractPurPngtListModal from '/@/components/common/contractPurPngtListModal.vue';
|
||||||
|
const props = defineProps({
|
||||||
|
isDisable: Boolean,
|
||||||
|
list: Array,
|
||||||
|
formState: Object,
|
||||||
|
pageType: String,
|
||||||
|
rateCode: Number || String,
|
||||||
|
optionSelect: Object
|
||||||
|
});
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const dataListPrice = ref([])
|
const dataListPrice = ref([])
|
||||||
@ -120,33 +132,26 @@
|
|||||||
{ title: t('优先级'), dataIndex: 'sort', width: 150},
|
{ title: t('优先级'), dataIndex: 'sort', width: 150},
|
||||||
{ title: t('数量(吉焦)'), dataIndex: 'rateQtyGj', width: 150},
|
{ title: t('数量(吉焦)'), dataIndex: 'rateQtyGj', width: 150},
|
||||||
{ title: t('数量(方)'), dataIndex: 'rateQtyM3', width: 150},
|
{ title: t('数量(方)'), dataIndex: 'rateQtyM3', width: 150},
|
||||||
{ title: t('采购价格(元/方)'), dataIndex: 'priceGj', width: 150},
|
{ title: props.pageType == 'pur' ? t('采购价格(元/吉焦)') : t('销售价格(元/吉焦)'), dataIndex: 'priceGj', width: 150},
|
||||||
{ title: t('采购价格(元/吉焦)'), dataIndex: 'priceM3', width: 150},
|
{ title: props.pageType == 'pur' ? t('采购价格(元/方)') : t('销售价格(元/方)'), dataIndex: 'priceM3', width: 150},
|
||||||
{ title: t('备注'), dataIndex: 'note'},
|
{ title: t('备注'), dataIndex: 'note'},
|
||||||
{ title: t('操作'), dataIndex: 'operation', width: 80, fixed: 'right',align: 'center'},
|
{ title: t('操作'), dataIndex: 'operation', width: 80, fixed: 'right',align: 'center'},
|
||||||
]);
|
]);
|
||||||
const [registerPur, { openModal:openModalPur}] = useModal();
|
const [registerPur, { openModal:openModalPur}] = useModal();
|
||||||
const props = defineProps({
|
|
||||||
isDisable: Boolean,
|
|
||||||
list: Array,
|
|
||||||
formState: Object,
|
|
||||||
pageType: String,
|
|
||||||
rateCode: Number || String,
|
|
||||||
optionSelect: Object
|
|
||||||
});
|
|
||||||
const emit = defineEmits(['change']);
|
const emit = defineEmits(['change']);
|
||||||
const numCount = (record, idx, k)=> {
|
const numCount = (record, idx, k)=> {
|
||||||
let uomCode = dataListPrice.value[idx].uomCode
|
let uomCode = dataListPrice.value[idx].uomCode
|
||||||
if (uomCode == 'GJ' && k == 'rateQtyGj') {
|
if (uomCode == 'GJ' && k == 'rateQtyGj' && record[k]) {
|
||||||
record.rateQtyM3 = record.rateM3Gj ? (Number(record.rateQtyGj || 0)/ Number(record.rateM3Gj)).toFixed(4) : ''
|
record.rateQtyM3 = record.rateM3Gj ? (Number(record.rateQtyGj || 0)/ Number(record.rateM3Gj)).toFixed(4) : ''
|
||||||
}
|
}
|
||||||
if (uomCode == 'GJ' && k == 'priceGj') {
|
if (uomCode == 'GJ' && k == 'priceGj' && record[k]) {
|
||||||
record.priceM3 = record.rateM3Gj ? (Number(record.priceGj || 0) / Number(record.rateM3Gj)).toFixed(4) : ''
|
record.priceM3 = record.rateM3Gj ? (Number(record.priceGj || 0) / Number(record.rateM3Gj)).toFixed(4) : ''
|
||||||
}
|
}
|
||||||
if (uomCode == 'M3' && k == 'rateQtyM3') {
|
if (uomCode == 'M3' && k == 'rateQtyM3' && record[k]) {
|
||||||
record.rateQtyGj = (Number(record.rateQtyM3 || 0)*Number(record.rateM3Gj || 0)).toFixed(3)
|
record.rateQtyGj = (Number(record.rateQtyM3 || 0)*Number(record.rateM3Gj || 0)).toFixed(3)
|
||||||
}
|
}
|
||||||
if (uomCode == 'M3' && k == 'priceM3') {
|
if (uomCode == 'M3' && k == 'priceM3' && record[k]) {
|
||||||
record.priceGj = (Number(record.priceM3 || 0)*Number(record.rateM3Gj || 0)).toFixed(3)
|
record.priceGj = (Number(record.priceM3 || 0)*Number(record.rateM3Gj || 0)).toFixed(3)
|
||||||
}
|
}
|
||||||
updatePriceDesc(idx)
|
updatePriceDesc(idx)
|
||||||
@ -202,8 +207,15 @@
|
|||||||
const handleSuccessPur = (val) => {
|
const handleSuccessPur = (val) => {
|
||||||
dataListPrice.value[curIdx.value].kId = val[0].kId
|
dataListPrice.value[curIdx.value].kId = val[0].kId
|
||||||
dataListPrice.value[curIdx.value].kName = val[0].kName
|
dataListPrice.value[curIdx.value].kName = val[0].kName
|
||||||
dataListPrice.value[curIdx.value].suCode = val[0].suCode
|
if (props.pageType == 'pur') {
|
||||||
dataListPrice.value[curIdx.value].suName = val[0].suName
|
dataListPrice.value[curIdx.value].suCode = val[0].suCode
|
||||||
|
dataListPrice.value[curIdx.value].suName = val[0].suName
|
||||||
|
dataListPrice.value[curIdx.value].kpppsId = val[0].id
|
||||||
|
} else {
|
||||||
|
dataListPrice.value[curIdx.value].cuCode = val[0].cuCode
|
||||||
|
dataListPrice.value[curIdx.value].cuName = val[0].cuName
|
||||||
|
dataListPrice.value[curIdx.value].ksppId = val[0].id
|
||||||
|
}
|
||||||
|
|
||||||
dataListPrice.value[curIdx.value].kpppId = val[0].kpppId
|
dataListPrice.value[curIdx.value].kpppId = val[0].kpppId
|
||||||
dataListPrice.value[curIdx.value].pointUpCode = val[0].pointUpCode
|
dataListPrice.value[curIdx.value].pointUpCode = val[0].pointUpCode
|
||||||
@ -212,7 +224,7 @@
|
|||||||
dataListPrice.value[curIdx.value].pointDelyName = val[0].pointDelyName
|
dataListPrice.value[curIdx.value].pointDelyName = val[0].pointDelyName
|
||||||
dataListPrice.value[curIdx.value].uomCode = val[0].uomCode
|
dataListPrice.value[curIdx.value].uomCode = val[0].uomCode
|
||||||
dataListPrice.value[curIdx.value].uomName = val[0].uomName
|
dataListPrice.value[curIdx.value].uomName = val[0].uomName
|
||||||
dataListPrice.value[curIdx.value].kpppsId = val[0].id
|
|
||||||
dataListPrice.value[curIdx.value].transSign = val[0].transSign
|
dataListPrice.value[curIdx.value].transSign = val[0].transSign
|
||||||
dataListPrice.value[curIdx.value].lngPricePurPngAppSuDtlList = []
|
dataListPrice.value[curIdx.value].lngPricePurPngAppSuDtlList = []
|
||||||
dataListPrice.value[curIdx.value].priceDesc = ''
|
dataListPrice.value[curIdx.value].priceDesc = ''
|
||||||
@ -234,7 +246,7 @@
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
watch(
|
watch(
|
||||||
() => props.disabled,
|
() => props.isDisable,
|
||||||
(val) => {
|
(val) => {
|
||||||
if (val) {
|
if (val) {
|
||||||
let idx2 = columnsPrice.value.findIndex(v =>v.dataIndex == 'operation')
|
let idx2 = columnsPrice.value.findIndex(v =>v.dataIndex == 'operation')
|
||||||
|
|||||||
@ -43,7 +43,7 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</Card>
|
</Card>
|
||||||
<priceInfoList :list="dataListPrice" :formState="formState" :optionSelect="optionSelect" ref="priceRef" pageType="pur" :isDisable="isDisable" :rateCode="rateCode" @change="priceChange"/>
|
<priceInfoList :list="dataListPrice" :formState="formState" :optionSelect="optionSelect" ref="priceRef" pageType="sales" :isDisable="isDisable" :rateCode="rateCode" @change="priceChange"/>
|
||||||
<Card title="附件信息" :bordered="false" >
|
<Card title="附件信息" :bordered="false" >
|
||||||
<UploadList :disabled="isDisable" :list="dataFile" :value="formState.filePath" :tableName="tableName" :columnName="columnName" @change="uploadListChange"/>
|
<UploadList :disabled="isDisable" :list="dataFile" :value="formState.filePath" :tableName="tableName" :columnName="columnName" @change="uploadListChange"/>
|
||||||
</Card>
|
</Card>
|
||||||
@ -65,7 +65,7 @@
|
|||||||
import type { Rule } from 'ant-design-vue/es/form';
|
import type { Rule } from 'ant-design-vue/es/form';
|
||||||
import { getDictionary } from '/@/api/sales/Customer';
|
import { getDictionary } from '/@/api/sales/Customer';
|
||||||
import { useModal } from '/@/components/Modal';
|
import { useModal } from '/@/components/Modal';
|
||||||
import { addLngPricePurPngApp,updateLngPricePurPngApp, getLngPricePurPngApp } from '/@/api/price/PricePurPngApp';
|
import { addLngPriceSalesPngApp,updateLngPriceSalesPngApp, getLngPriceSalesPngApp } from '/@/api/price/PriceSalesPngApp';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { h } from 'vue';
|
import { h } from 'vue';
|
||||||
import { SearchOutlined } from '@ant-design/icons-vue';
|
import { SearchOutlined } from '@ant-design/icons-vue';
|
||||||
@ -82,8 +82,8 @@
|
|||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const userInfo = userStore.getUserInfo;
|
const userInfo = userStore.getUserInfo;
|
||||||
|
|
||||||
const tableName = 'PricePurPngApp';
|
const tableName = 'PriceSalesPngApp';
|
||||||
const columnName = 'PricePurPngApp'
|
const columnName = 'PriceSalesPngApp'
|
||||||
|
|
||||||
const formType = ref('2'); // 0 新建 1 修改 2 查看
|
const formType = ref('2'); // 0 新建 1 修改 2 查看
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
@ -177,11 +177,16 @@
|
|||||||
async function getInfo(id) {
|
async function getInfo(id) {
|
||||||
spinning.value = true
|
spinning.value = true
|
||||||
try {
|
try {
|
||||||
let data = await getLngPricePurPngApp(id)
|
let data = await getLngPriceSalesPngApp(id)
|
||||||
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 || [])
|
||||||
Object.assign(dataListPrice.value, formState.lngPricePurPngAppSuList || [])
|
Object.assign(dataListPrice.value, formState.lngPriceSalesPngAppCuList || [])
|
||||||
|
dataListPrice.value.forEach(v=> {
|
||||||
|
v.dateFrom = v.dateFrom ? dayjs(v.dateFrom) : null
|
||||||
|
v.lngPricePurPngAppSuDtlList = v.lngPriceSalesPngAppCuDtlList || []
|
||||||
|
|
||||||
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
spinning.value = false
|
spinning.value = false
|
||||||
}
|
}
|
||||||
@ -200,17 +205,20 @@
|
|||||||
async function handleSubmit(type) {
|
async function handleSubmit(type) {
|
||||||
try {
|
try {
|
||||||
await formRef.value.validateFields();
|
await formRef.value.validateFields();
|
||||||
let priceList = priceRef.value.getList()
|
let priceList = JSON.parse(JSON.stringify(priceRef.value.getList()))
|
||||||
for(let i=0; i<priceList.length; i++) {
|
for(let i=0; i<priceList.length; i++) {
|
||||||
let isFlag = !priceList[i].kName || !priceList[i].dateFrom
|
let isFlag = !priceList[i].kName || !priceList[i].dateFrom
|
||||||
if (isFlag) {
|
if (isFlag) {
|
||||||
message.warn('请完善供应商价格信息必选项')
|
message.warn('请完善客户价格信息必选项')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let arr = priceList[i].lngPricePurPngAppSuDtlList || []
|
priceList[i].dateFrom = priceList[i].dateFrom ? dayjs(priceList[i].dateFrom).format('YYYY-MM-DD HH:mm:ss') : null
|
||||||
|
priceList[i].lngPriceSalesPngAppCuDtlList = priceList[i].lngPricePurPngAppSuDtlList || []
|
||||||
|
delete priceList[i].lngPricePurPngAppSuDtlList
|
||||||
|
let arr = priceList[i].lngPriceSalesPngAppCuDtlList || []
|
||||||
for(let i=0; i<arr.length; i++) {
|
for(let i=0; i<arr.length; i++) {
|
||||||
if (!arr[i].priceCode) {
|
if (!arr[i].priceCode) {
|
||||||
message.warn('请完善供应商价格信息必选项')
|
message.warn('请完善客户价格信息必选项')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -218,13 +226,13 @@
|
|||||||
|
|
||||||
let obj = {
|
let obj = {
|
||||||
...formState,
|
...formState,
|
||||||
lngPricePurPngAppSuList: priceList,
|
lngPriceSalesPngAppCuList: priceList,
|
||||||
lngFileUploadList: dataFile.value,
|
lngFileUploadList: dataFile.value,
|
||||||
approCode: pageType.value=='update' ? 'WTJ' : formState.approCode
|
approCode: pageType.value=='update' ? 'WTJ' : formState.approCode
|
||||||
|
|
||||||
}
|
}
|
||||||
spinning.value = true;
|
spinning.value = true;
|
||||||
let request = !formState.id ? addLngPricePurPngApp :updateLngPricePurPngApp
|
let request = !formState.id ? addLngPriceSalesPngApp :updateLngPriceSalesPngApp
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const data = await request(obj);
|
const data = await request(obj);
|
||||||
|
|||||||
@ -29,9 +29,7 @@
|
|||||||
const logId = ref('')
|
const logId = ref('')
|
||||||
const logPath = ref('/ship/meaPurInt/datalog');
|
const logPath = ref('/ship/meaPurInt/datalog');
|
||||||
import { DataLog } from '/@/components/pcitc';
|
import { DataLog } from '/@/components/pcitc';
|
||||||
import { ref, computed, onMounted, onUnmounted, createVNode,
|
import { ref, computed, onMounted, onUnmounted, createVNode, } 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';
|
||||||
@ -51,6 +49,7 @@
|
|||||||
import Icon from '/@/components/Icon/index';
|
import Icon from '/@/components/Icon/index';
|
||||||
import useEventBus from '/@/hooks/event/useEventBus';
|
import useEventBus from '/@/hooks/event/useEventBus';
|
||||||
import { cloneDeep } from 'lodash-es';
|
import { cloneDeep } from 'lodash-es';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||||
|
|
||||||
@ -66,7 +65,7 @@
|
|||||||
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
//所有按钮
|
//所有按钮
|
||||||
const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},{"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]);
|
const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true,"type":"primary"},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},{"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]);
|
||||||
//展示在列表内的按钮
|
//展示在列表内的按钮
|
||||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
|
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
|
||||||
const buttonConfigs = computed(()=>{
|
const buttonConfigs = computed(()=>{
|
||||||
@ -89,6 +88,7 @@
|
|||||||
formIdComputedRef.value = currentRoute.value.meta.formId
|
formIdComputedRef.value = currentRoute.value.meta.formId
|
||||||
const schemaIdComputedRef = ref();
|
const schemaIdComputedRef = ref();
|
||||||
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
|
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
|
||||||
|
const defaultDate = ref([dayjs().startOf('year').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')]);
|
||||||
const [registerModal, { openModal }] = useModal();
|
const [registerModal, { openModal }] = useModal();
|
||||||
const formName='国际采购计量';
|
const formName='国际采购计量';
|
||||||
const [registerTable, { reload, }] = useTable({
|
const [registerTable, { reload, }] = useTable({
|
||||||
@ -100,10 +100,34 @@
|
|||||||
rowProps: {
|
rowProps: {
|
||||||
gutter: 16,
|
gutter: 16,
|
||||||
},
|
},
|
||||||
schemas: customSearchFormSchema,
|
schemas: [
|
||||||
|
{
|
||||||
|
field: 'dateEta',
|
||||||
|
label: '计量日期',
|
||||||
|
component: 'RangePicker',
|
||||||
|
defaultValue: defaultDate.value,
|
||||||
|
componentProps: {
|
||||||
|
format: 'YYYY-MM-DD',
|
||||||
|
style: { width: '100%' },
|
||||||
|
getPopupContainer: () => document.body,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'staName',
|
||||||
|
label: '接收站',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'ssNo',
|
||||||
|
label: '船期编号',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
|
||||||
|
],
|
||||||
fieldMapToTime: [],
|
fieldMapToTime: [],
|
||||||
showResetButton: false,
|
showResetButton: true,
|
||||||
},
|
},
|
||||||
|
immediate: false,
|
||||||
beforeFetch: (params) => {
|
beforeFetch: (params) => {
|
||||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
|
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
|
||||||
},
|
},
|
||||||
@ -237,7 +261,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
reload({ searchInfo: { startDate: defaultDate.value[0], endDate: defaultDate.value[1] }});
|
||||||
if (schemaIdComputedRef.value) {
|
if (schemaIdComputedRef.value) {
|
||||||
bus.on(FLOW_PROCESSED, handleRefresh);
|
bus.on(FLOW_PROCESSED, handleRefresh);
|
||||||
bus.on(CREATE_FLOW, handleRefresh);
|
bus.on(CREATE_FLOW, handleRefresh);
|
||||||
@ -305,4 +329,12 @@
|
|||||||
.hide{
|
.hide{
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:deep( .ant-col-8:nth-child(1)) {
|
||||||
|
width: 320px !important;
|
||||||
|
max-width: 320px !important;;
|
||||||
|
}
|
||||||
|
:deep(.ant-col-8:nth-child(1) .ant-form-item-label) {
|
||||||
|
width: 80px !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user