lng客户需求

This commit is contained in:
‘huanghaiixia’
2026-03-18 18:25:41 +08:00
parent d2627b856f
commit ad4452a09c
7 changed files with 534 additions and 196 deletions

View File

@ -11,10 +11,117 @@ enum Api {
ContractList ='/magic-api/dayPlan/queryContractList', ContractList ='/magic-api/dayPlan/queryContractList',
StationList ='/magic-api/dayPlan/queryStationList', StationList ='/magic-api/dayPlan/queryStationList',
Export = '/dayPlan/lngDemand/export', Export = '/dayPlan/lngDemand/export',
check ='/magic-api/dayPlan/check',
AllPlaceLngUnload = '/magic-api/mdm/queryAllPlaceLngUnload',
queryCategory = '/magic-api/mdm/queryCategory',
saveAndSubmit = '/dayPlan/lngDemand/saveAndSubmit',
toChange = '/dayPlan/lngDemand/toChange',
compare = '/dayPlan/lngDemand/compare',
withdraw = '/dayPlan/lngDemand/withdraw',
submit = '/dayPlan/lngDemand/submit',
cancel = '/dayPlan/lngDemand/cancel',
DataLog = '/dayPlan/lngDemand/datalog', DataLog = '/dayPlan/lngDemand/datalog',
} }
export async function cancelLngDemand(id: String, mode: ErrorMessageMode = 'modal') {
return defHttp.get<LngLngDemandPageModel>(
{
url: Api.cancel,
params: { id },
},
{
errorMessageMode: mode,
},
);
}
export async function submitLngDemand(ids: string[], mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.submit,
data: ids,
},
{
errorMessageMode: mode,
},
);
}
export async function withdrawLngDemand(ids: string[], mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.withdraw,
data: ids,
},
{
errorMessageMode: mode,
},
);
}
export async function getLngDemandCompare(orgId: String, mode: ErrorMessageMode = 'modal') {
return defHttp.get<LngLngDemandPageModel>(
{
url: Api.compare,
params: { orgId },
},
{
errorMessageMode: mode,
},
);
}
export async function getLngDemanddUpdate(id: String, mode: ErrorMessageMode = 'modal') {
return defHttp.get<LngLngDemandPageModel>(
{
url: Api.toChange,
params: { id },
},
{
errorMessageMode: mode,
},
);
}
export async function submitSaveLngDemand(lngLngDemand: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.saveAndSubmit,
params: lngLngDemand,
},
{
errorMessageMode: mode,
},
);
}
export async function getCategory(params, mode: ErrorMessageMode = 'modal') {
return defHttp.get<LngLngDemandPageResult>(
{
url: Api.queryCategory,
params: params,
},
{
errorMessageMode: mode,
},
);
}
export async function getAllPlaceLngUnload(params, mode: ErrorMessageMode = 'modal') {
return defHttp.get<LngLngDemandPageResult>(
{
url: Api.AllPlaceLngUnload,
params: params,
},
{
errorMessageMode: mode,
},
);
}
export async function carCheck(params, mode: ErrorMessageMode = 'modal') {
return defHttp.get<LngLngDemandPageResult>(
{
url: Api.check,
params: params,
},
{
errorMessageMode: mode,
},
);
}
export async function getLngLngDemandStationList(params, mode: ErrorMessageMode = 'modal') { export async function getLngLngDemandStationList(params, mode: ErrorMessageMode = 'modal') {
return defHttp.get<LngLngDemandPageResult>( return defHttp.get<LngLngDemandPageResult>(
{ {

View File

@ -0,0 +1,100 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" width="60%" :title="getTitle" @ok="handleSubmit" @cancel="handleCancel"
@visible-change="handleVisibleChange" >
<BasicTable @register="registerTable" class="placeLngUnloadModal"></BasicTable>
</BasicModal>
</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 { addCodeRule, getCodeRuleInfo, editCodeRule } from '/@/api/system/code';
import { useMessage } from '/@/hooks/web/useMessage';
import { Form, message } from 'ant-design-vue';
import { useI18n } from '/@/hooks/web/useI18n';
import { getAllPlaceLngUnload} from '/@/api/dayPlan/LngDemand';
const { t } = useI18n();
const codeFormSchema: FormSchema[] = [
{ field: 'fullName', label: '名称', component: 'Input'},
];
const columns: BasicColumn[] = [
{ dataIndex: 'code', title: '编码', componentType: 'input', width: 120,align: 'left', },
{ dataIndex: 'fullName', title: '名称', componentType: 'input', align: 'left', },
];
const emit = defineEmits(['success', 'register', 'cancel']);
const showTable = ref(false)
const { notification } = useMessage();
const isUpdate = ref(true);
const rowId = ref('');
const selectedKeys = ref<string[]>([]);
const selectedValues = ref([]);
const props = defineProps({
selectType: { type: String, default: 'radio' },
});
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
});
const [registerTable, { getDataSource, setTableData, updateTableDataRecord, reload,setPagination }] = useTable({
title: t('列表'),
api: getAllPlaceLngUnload,
columns,
bordered: true,
pagination: false,
canResize: false,
formConfig: {
labelCol:{span: 9},
schemas: codeFormSchema,
showResetButton: true,
},
immediate: false, // 设置为不立即调用
beforeFetch: (params) => {
return { ...params, eid: ''};
},
rowSelection: {
type: props.selectType,
onChange: onSelectChange
},
});
const handleVisibleChange = async (visible: boolean) => {
if (visible) {
nextTick(() => {
reload();
});
}
};
function onSelectChange(rowKeys: string[], e) {
selectedKeys.value = rowKeys;
selectedValues.value = e
}
const getTitle = computed(() => (!unref(isUpdate) ? t('卸货地列表') : t('')));
function handleCancel () {
emit('cancel',);
}
async function handleSubmit() {
if (!selectedValues.value.length) {
notification.warning({
message: t('提示'),
description: t('请选择数据')
});
return
}
closeModal();
emit('success', selectedValues.value);
}
</script>
<style >
.placeLngUnloadModal .basicCol{
position: inherit !important;
top: 0;
}
</style>

View File

@ -23,12 +23,12 @@
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="车头号" name="noTractor" :class="diffResultList.includes('noTractor')?'changeStyle':''"> <a-form-item label="车头号" name="noTractor" :class="diffResultList.includes('noTractor')?'changeStyle':''">
<a-input v-model:value="formState.noTractor" :disabled="disable" placeholder="请输入车头号" /> <a-input v-model:value="formState.noTractor" :disabled="disable" placeholder="请输入车头号" @change="handleCheck('noTractor')"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="挂车号" name="noTrailer" :class="diffResultList.includes('noTrailer')?'changeStyle':''"> <a-form-item label="挂车号" name="noTrailer" :class="diffResultList.includes('noTrailer')?'changeStyle':''">
<a-input v-model:value="formState.noTrailer" :disabled="disable" placeholder="请输入挂车号" /> <a-input v-model:value="formState.noTrailer" :disabled="disable" placeholder="请输入挂车号" @change="handleCheck('noTrailer')" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
@ -38,37 +38,37 @@
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="驾驶员身份证号" name="idNoDriver" :class="diffResultList.includes('idNoDriver')?'changeStyle':''"> <a-form-item label="驾驶员身份证号" name="idNoDriver" :class="diffResultList.includes('idNoDriver')?'changeStyle':''">
<a-input v-model:value="formState.idNoDriver" :disabled="disable" placeholder="请输入驾驶员身份证号" /> <a-input v-model:value="formState.idNoDriver" :disabled="disable" placeholder="请输入驾驶员身份证号" @change="handleCheck('idNoDriver')"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="驾驶员姓名" name="nameDriver" :class="diffResultList.includes('nameDriver')?'changeStyle':''"> <a-form-item label="驾驶员姓名" name="nameDriver" :class="diffResultList.includes('nameDriver')?'changeStyle':''">
<a-input v-model:value="formState.nameDriver" :disabled="disable" placeholder="请输入驾驶员姓名" /> <a-input v-model:value="formState.nameDriver" :disabled="disable||formState.onlineSign == 'Y'" placeholder="请输入驾驶员姓名" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="驾驶员手机号" name="phoneDriver" :class="diffResultList.includes('phoneDriver')?'changeStyle':''"> <a-form-item label="驾驶员手机号" name="phoneDriver" :class="diffResultList.includes('phoneDriver')?'changeStyle':''">
<a-input v-model:value="formState.phoneDriver" :disabled="disable" placeholder="驾驶员手机号" /> <a-input v-model:value="formState.phoneDriver" :disabled="disable||formState.onlineSign == 'Y'" placeholder="驾驶员手机号" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="押运员身份证号" name="idNoEscort" :class="diffResultList.includes('idNoEscort')?'changeStyle':''"> <a-form-item label="押运员身份证号" name="idNoEscort" :class="diffResultList.includes('idNoEscort')?'changeStyle':''">
<a-input v-model:value="formState.idNoEscort" :disabled="disable" placeholder="请输入押运员身份证号" /> <a-input v-model:value="formState.idNoEscort" :disabled="disable" placeholder="请输入押运员身份证号" @change="handleCheck('idNoEscort')"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="押运员姓名" name="nameEscort" :class="diffResultList.includes('nameEscort')?'changeStyle':''"> <a-form-item label="押运员姓名" name="nameEscort" :class="diffResultList.includes('nameEscort')?'changeStyle':''">
<a-input v-model:value="formState.nameEscort" :disabled="disable" placeholder="请输入押运员姓名" /> <a-input v-model:value="formState.nameEscort" :disabled="disable||formState.onlineSign == 'Y'" placeholder="请输入押运员姓名" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="押运员手机号" name="phoneEscort" :class="diffResultList.includes('phoneEscort')?'changeStyle':''"> <a-form-item label="押运员手机号" name="phoneEscort" :class="diffResultList.includes('phoneEscort')?'changeStyle':''">
<a-input v-model:value="formState.phoneEscort" :disabled="disable" placeholder="请输入押运员手机号" /> <a-input v-model:value="formState.phoneEscort" :disabled="disable||formState.onlineSign == 'Y'" placeholder="请输入押运员手机号" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="卸货站点" name="unloadingName" :class="diffResultList.includes('unloadingName')?'changeStyle':''"> <a-form-item label="卸货站点" name="unloadingName" :class="diffResultList.includes('unloadingName')?'changeStyle':''">
<a-input-search v-model:value="formState.unloadingName" :disabled="disable" placeholder="请选择卸货站点" /> <a-input-search v-model:value="formState.unloadingName" :disabled="disable" placeholder="请选择卸货站点" readonly @search="onSearchPlace"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
@ -112,7 +112,13 @@
<a-form-item label="版本号" name="verNo" :class="diffResultList.includes('verNo')?'changeStyle':''">{{ formState.verNo }}</a-form-item> <a-form-item label="版本号" name="verNo" :class="diffResultList.includes('verNo')?'changeStyle':''">{{ formState.verNo }}</a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="审批状态" name="approName" :class="diffResultList.includes('approName')?'changeStyle':''">{{ formState.approName }}</a-form-item> <a-form-item label="审批状态" name="approName" :class="diffResultList.includes('approName')?'changeStyle':''">
<a-select v-model:value="formState.approCode" disabled style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.approCodeList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="备注" name="note" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }"> <a-form-item label="备注" name="note" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
@ -129,7 +135,8 @@
</a-row> </a-row>
</a-form> </a-form>
<contractDemandListModal @register="registerContract" @success="handleSuccessContract" /> <contractDemandListModal @register="registerContract" @success="handleSuccessContract" />
<pointDelyDemandListModal @register="registerUpLoad" @success="handleSuccessUpLoad" /> <pointDelyDemandListModal @register="registerStation" @success="handleSuccessStation" />
<placeLngUnloadModal @register="registerPlace" @success="handleSuccessPlace"/>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -138,14 +145,14 @@
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue'; import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
import contractDemandListModal from '/@/components/common/contractDemandListModal.vue'; import contractDemandListModal from '/@/components/common/contractDemandListModal.vue';
import pointDelyDemandListModal from '/@/components/common/pointDelyDemandListModal.vue'; import pointDelyDemandListModal from '/@/components/common/pointDelyDemandListModal.vue';
import placeLngUnloadModal from '/@/components/common/placeLngUnloadModal.vue';
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { getCompDept } from '/@/api/approve/Appro'; import { getCompDept } from '/@/api/approve/Appro';
import { useUserStore } from '/@/store/modules/user'; import { useUserStore } from '/@/store/modules/user';
import { getDictionary } from '/@/api/sales/Customer'; import { getDictionary } from '/@/api/sales/Customer';
import { getLngLngDemandContractList, getLngLngDemandStationList } from '/@/api/dayPlan/LngDemand'; import { getLngLngDemandContractList, getLngLngDemandStationList,carCheck,getCategory } from '/@/api/dayPlan/LngDemand';
const userStore = useUserStore(); const userStore = useUserStore();
const userInfo = userStore.getUserInfo; const userInfo = userStore.getUserInfo;
const router = useRouter(); const router = useRouter();
@ -154,9 +161,20 @@
const pageType = ref(currentRoute.value.query?.type) const pageType = ref(currentRoute.value.query?.type)
const formRef = ref() const formRef = ref()
const rules= reactive({ const rules= reactive({
pointDelyName: [{ required: true, message: "该项为必填项", trigger: 'change' }], staName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
datePlan: [{ required: true, message: "该项为必填项", trigger: 'change' }], datePlan: [{ required: true, message: "该项为必填项", trigger: 'change' }],
kName: [{ required: true, message: "该项为必填项", trigger: 'change' }], kName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
noTractor: [{ required: true, message: "该项为必填项", trigger: 'change' }],
noTrailer: [{ required: true, message: "该项为必填项", trigger: 'change' }],
carrName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
idNoDriver: [{ required: true, message: "该项为必填项", trigger: 'change' }],
nameDriver: [{ required: true, message: "该项为必填项", trigger: 'change' }],
phoneDriver: [{ required: true, message: "该项为必填项", trigger: 'change' }],
idNoEscort: [{ required: true, message: "该项为必填项", trigger: 'change' }],
nameEscort: [{ required: true, message: "该项为必填项", trigger: 'change' }],
phoneEscort: [{ required: true, message: "该项为必填项", trigger: 'change' }],
unloadingName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
timePeriod: [{ required: true, message: "该项为必填项", trigger: 'change' }],
}); });
const layout = { const layout = {
labelCol: { span: 9 }, labelCol: { span: 9 },
@ -164,7 +182,8 @@
} }
const { t } = useI18n(); const { t } = useI18n();
const [registerContract, { openModal:openModalContractSales}] = useModal(); const [registerContract, { openModal:openModalContractSales}] = useModal();
const [registerUpLoad, { openModal:openModalUpLoad}] = useModal(); const [registerStation, { openModal:openModalUpLoad}] = useModal();
const [registerPlace, { openModal:openModalPlace}] = useModal();
const props = defineProps({ const props = defineProps({
formObj: {}, formObj: {},
disable: false, disable: false,
@ -177,19 +196,20 @@
const diffResultList = ref([]) const diffResultList = ref([])
const formState = ref({}) const formState = ref({})
const contractList = ref([]) const contractList = ref([])
const pointDelyList = ref([]) const stationList = ref([])
onMounted(async () =>{ onMounted(async () =>{
getOption() getOption()
if (!pageType.value) { if (!pageType.value) {
formState.value.lastVerSign = 'Y' formState.value.lastVerSign = 'Y'
formState.value.validSign = 'N' formState.value.carrCode = '123'
// formState.value.validSign = 'N'
formState.value.alterSign = 'I' formState.value.alterSign = 'I'
formState.value.approCode = 'WTJ' formState.value.approCode = 'WTJ'
const res = await getCompDept(userInfo.id) const res = await getCompDept(userInfo.id)
formState.value.cuCode = res?.comp?.cuCode formState.value.cuCode = res?.comp?.cuCode
formState.value.comId = res?.comp?.id formState.value.comId = res?.comp?.id
const res1 = await getLngPngDemandRate({}) || [] let a = await getCategory({code: 'LNG'})||[]
formState.value.rateM3Gj = res1[0]?.rateM3Gj formState.value.qtyTon = a[0]?.coefficient
} }
@ -197,8 +217,14 @@
async function getOption() { async function getOption() {
optionSelect.timePeriodList = await getDictionary('LNG_TIME_P') optionSelect.timePeriodList = await getDictionary('LNG_TIME_P')
optionSelect.supplyCodeList = await getDictionary('LNG_SUPPLY') optionSelect.supplyCodeList = await getDictionary('LNG_SUPPLY')
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
} }
const datePlanChange = async (val) => { const datePlanChange = async (val) => {
if (!val) {
contractList.value = []
return
}
let obj = { let obj = {
cuCode:formState.value.cuCode, cuCode:formState.value.cuCode,
datePlan: dayjs(formState.value.datePlan).format('YYYY-MM-DD') datePlan: dayjs(formState.value.datePlan).format('YYYY-MM-DD')
@ -208,8 +234,9 @@
if (contractList.value.length == 1) { if (contractList.value.length == 1) {
formState.value.kName = contractList.value[0].kName formState.value.kName = contractList.value[0].kName
formState.value.ksId = contractList.value[0].id formState.value.ksId = contractList.value[0].id
getPointDely() formState.value.comId = contractList.value[0].comId
getContractQty() formState.value.comName = contractList.value[0].comName
getStation()
} }
} }
const onSearch = ()=> { const onSearch = ()=> {
@ -222,8 +249,9 @@
const handleSuccessContract = (val) => { const handleSuccessContract = (val) => {
formState.value.kName = val[0].kName formState.value.kName = val[0].kName
formState.value.ksId = val[0].id formState.value.ksId = val[0].id
getPointDely() formState.value.comId = contractList.value[0].comId
getContractQty() formState.value.comName = contractList.value[0].comName
getStation()
} }
const onSearchUpLoad = (val)=> { const onSearchUpLoad = (val)=> {
@ -231,34 +259,55 @@
message.warn('请选择合同') message.warn('请选择合同')
return return
} }
openModalUpLoad(true,{isUpdate: false, list: pointDelyList.value}) openModalUpLoad(true,{isUpdate: false, list: stationList.value})
} }
const handleSuccessUpLoad = (val) => { const handleSuccessStation = (val) => {
formState.value.pointDelyName = val[0].pointDelyName formState.value.staName = val[0].pointDelyName
formState.value.pointDelyCode = val[0].pointDelyCode formState.value.staCode = val[0].pointDelyCode
formState.value.ksppId = val[0].id formState.value.onlineSign = val[0].onlineSign
getPurList() changeRules()
} }
const getPointDely = async () => { const changeRules = () => {
let res = await getLngLngDemandStationList({kId: formState.value.ksId}) if (formState.value.onlineSign == 'Y') {
pointDelyList.value = res || [] rules.nameDriver = [{ required: false, message: "该项为必填项", trigger: 'change' }]
if (pointDelyList.value.length == 1) { rules.phoneDriver = [{ required: false, message: "该项为必填项", trigger: 'change' }]
formState.value.pointDelyName = pointDelyList.value[0].pointDelyName rules.nameEscort = [{ required: false, message: "该项为必填项", trigger: 'change' }]
formState.value.pointDelyCode = pointDelyList.value[0].pointDelyCode rules.phoneEscort = [{ required: false, message: "该项为必填项", trigger: 'change' }]
formState.value.ksppId = pointDelyList.value[0].id } else {
rules.nameDriver = [{ required: true, message: "该项为必填项", trigger: 'change' }]
rules.phoneDriver = [{ required: true, message: "该项为必填项", trigger: 'change' }]
rules.nameEscort = [{ required: true, message: "该项为必填项", trigger: 'change' }]
rules.phoneEscort = [{ required: true, message: "该项为必填项", trigger: 'change' }]
} }
} }
const getContractQty = async () => { const onSearchPlace = ()=> {
let obj = { openModalPlace(true,{isUpdate: false})
kId: formState.value.ksId, }
datePlan: dayjs(formState.value.datePlan).format('YYYY-MM-DD') const handleSuccessPlace= (val) => {
formState.value.unloadingName = val[0].fullName
formState.value.unloadingCode = val[0].code
}
const getStation = async () => {
let res = await getLngLngDemandStationList({ksId: formState.value.ksId})
stationList.value = res || []
stationList.value.forEach(v => {
v.pointDelyName = v.fullName
v.pointDelyCode = v.code
})
if (stationList.value.length == 1) {
formState.value.staName = stationList.value[0].fullName
formState.value.staCode = stationList.value[0].code
formState.value.onlineSign = stationList.value[0].onlineSign
changeRules()
} }
let res = await getLngPngDemandContractQty(obj) || [] }
formState.value.qtyContractGj = res[0]?.qtyContractGj const handleCheck = async (type) => {
formState.value.qtyContractM3 = res[0]?.qtyContractM3 if (formState.value.onlineSign == 'Y' && ((type == 'noTractor'&& !formState.value.noTrailer) || (type == 'noTrailer'&& !formState.value.noTractor)) ) {
formState.value.qtyContractM3 =NP.divide(Number(formState.value.qtyContractM3), 10000) // formState.value.carrCode = ''
// formState.value.carrName = ''
}
} }
const disabledDateStart = (current) => { const disabledDateStart = (current) => {
const today = new Date(); const today = new Date();
@ -307,22 +356,6 @@
<style lang="less" scoped> <style lang="less" scoped>
.dot {
margin-right: 10px;
display: flex;
align-items: center;
.ant-input-number{
margin:0 5px;
font-style: normal;
}
span{
width: 10px !important;
height: 10px !important;
border-radius: 50%;
background: red;
display: block;
}
}
.changeStyle { .changeStyle {
color: red !important; color: red !important;
} }

View File

@ -163,7 +163,7 @@ export const columns: BasicColumn[] = [
}, },
{ {
dataIndex: 'ksName', dataIndex: 'kName',
title: '合同', title: '合同',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',

View File

@ -39,13 +39,13 @@
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 { addLngPngDemand, submitLngPngDemand,getLngPngDemand,getLngPngDemandUpdate,getLngPngDemandCompare,updateLngPngDemand } from '/@/api/dayPlan/Demand'; import { Modal } from 'ant-design-vue';
import { addLngLngDemand, submitSaveLngDemand,getLngLngDemand,getLngDemanddUpdate,getLngDemandCompare,updateLngLngDemand,carCheck } from '/@/api/dayPlan/LngDemand';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { getAppEnvConfig } from '/@/utils/env'; import { getAppEnvConfig } from '/@/utils/env';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { useUserStore } from '/@/store/modules/user'; import { useUserStore } from '/@/store/modules/user';
import basicForm from './basicForm.vue' import basicForm from './basicForm.vue'
import NP from 'number-precision';
const userStore = useUserStore(); const userStore = useUserStore();
const userInfo = userStore.getUserInfo; const userInfo = userStore.getUserInfo;
@ -86,7 +86,7 @@
async function getCompareInfo(id) { async function getCompareInfo(id) {
spinning.value = true spinning.value = true
try { try {
let data = await getLngPngDemandCompare(id) || {} let data = await getLngDemandCompare(id) || {}
spinning.value = false spinning.value = false
diffResultList.value = data.diffResultList || [] diffResultList.value = data.diffResultList || []
let obj = changeData(data.oldBean || {}) let obj = changeData(data.oldBean || {})
@ -108,9 +108,9 @@
try { try {
let data = {} let data = {}
if (pageType.value == 'update') { if (pageType.value == 'update') {
data = await getLngPngDemandUpdate(id) data = await getLngDemanddUpdate(id)
} else { } else {
data = await getLngPngDemand(id) data = await getLngLngDemand(id)
} }
spinning.value = false spinning.value = false
let obj = changeData(data) let obj = changeData(data)
@ -125,7 +125,8 @@
if (Object.keys(obj).length === 0) return { if (Object.keys(obj).length === 0) return {
params: {} params: {}
} }
obj.datePlan = obj.datePlan ? dayjs(obj.datePlan) : null obj.datePlan = obj.datePlan ? dayjs(obj.datePlan): null
obj.timeUnloading = obj.timeUnloading ? dayjs(obj.timeUnloading) : null
return { return {
params: obj params: obj
} }
@ -140,33 +141,66 @@
...data.formInfo, ...data.formInfo,
datePlan: dayjs(data.formInfo.datePlan).format('YYYY-MM-DD HH:mm:ss'), datePlan: dayjs(data.formInfo.datePlan).format('YYYY-MM-DD HH:mm:ss'),
} }
spinning.value = true; if (type == 'submit') {
let request = submitLngPngDemand let params = {
if (type == 'save') { orgId: obj.orgId,
request = !pageId.value ? addLngPngDemand : updateLngPngDemand datePlan: dayjs(obj.datePlan).format('YYYY-MM-DD'),
noTractor: obj.noTractor,
noTrailer: obj.noTrailer,
idNoDriver: obj.idNoDriver,
idNoEscort: obj.idNoEscort,
}
let res = await carCheck(params)
if (res) {
Modal.confirm({
title: '提示信息',
content: res,
okText: '确认',
cancelText: '取消',
onOk() {
saveSubmit(type, obj)
},
onCancel() {}
});
} else {
saveSubmit(type, obj)
}
} else {
saveSubmit(type, obj)
} }
await request(obj)
spinning.value = false;
notification.success({
message: 'Tip',
description: type == 'save' ? '保存成功':'已提交'
}); //提示消息
setTimeout(() => {
bus.emit(FORM_LIST_MODIFIED, {});
close();
}, 500);
} catch (errorInfo) { } catch (errorInfo) {
spinning.value = false; spinning.value = false;
errorInfo?.errorFields?.length && notification.warning({ errorInfo?.errorFields?.length && notification.warning({
message: 'Tip', message: '提示',
description: '请完善信息' description: '请完善信息'
}); });
} }
} }
const saveSubmit = async (type, obj) => {
try {
spinning.value = true;
let request = submitSaveLngDemand
if (type == 'save') {
request = !pageId.value ? addLngLngDemand : updateLngLngDemand
}
await request(obj)
spinning.value = false;
notification.success({
message: '提示',
description: type == 'save' ? '保存成功':'已提交'
}); //提示消息
setTimeout(() => {
bus.emit(FORM_LIST_MODIFIED, {});
close();
}, 500);
}catch (errorInfo) {
spinning.value = false;
}
}
</script> </script>
@ -183,21 +217,5 @@
.pdcss { .pdcss {
padding:0px 12px 6px 12px !important; padding:0px 12px 6px 12px !important;
} }
.dot {
margin-right: 10px;
display: flex;
align-items: center;
i{
padding: 5px;
font-style: normal;
}
span{
width: 10px !important;
height: 10px !important;
border-radius: 50%;
background: red;
display: block;
}
}
</style> </style>

View File

@ -31,14 +31,12 @@
const logId = ref('') const logId = ref('')
const logPath = ref('/dayPlan/lngDemand/datalog'); const logPath = ref('/dayPlan/lngDemand/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';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table'; import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getLngLngDemandPage, deleteLngLngDemand, exportLngLngDemand} from '/@/api/dayPlan/LngDemand'; import { getLngLngDemandPage, deleteLngLngDemand, exportLngLngDemand,cancelLngDemand,withdrawLngDemand,submitLngDemand} from '/@/api/dayPlan/LngDemand';
import { PageWrapper } from '/@/components/Page'; import { PageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n'; import { useI18n } from '/@/hooks/web/useI18n';
@ -88,13 +86,13 @@
{"isUse":true,"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true}, {"isUse":true,"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true},
{"isUse":true,"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true}, {"isUse":true,"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true},
{"isUse":true,"name":"提交","code":"submit","icon":"ant-design:send-outlined","isDefault":true}, {"isUse":true,"name":"提交","code":"submit","icon":"ant-design:send-outlined","isDefault":true},
{"isUse":true,"name":"变更","code":"update","icon":"ant-design:edit-filled","isDefault":true}, {"isUse":true,"name":"变更","code":"toChange","icon":"ant-design:edit-filled","isDefault":true},
{"isUse":true,"name":"取消","code":"cancel","icon":"ant-design:close-outlined","isDefault":true}, {"isUse":true,"name":"取消","code":"cancel","icon":"ant-design:close-outlined","isDefault":true},
{"isUse":true,"name":"对比","code":"compare","icon":"ant-design:file-done-outlined","isDefault":false}, {"isUse":true,"name":"对比","code":"compare","icon":"ant-design:file-done-outlined","isDefault":false},
{"isUse":true,"name":"撤回","code":"back","icon":"ant-design:rollback-outlined","isDefault":false}, {"isUse":true,"name":"撤回","code":"withdraw","icon":"ant-design:rollback-outlined","isDefault":false},
{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true}]); {"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true}]);
//展示在列表内的按钮 //展示在列表内的按钮
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord','compare','update','back','cancel']); const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord','compare','toChange','withdraw','cancel', 'submit']);
const buttonConfigs = computed(()=>{ const buttonConfigs = computed(()=>{
return filterButtonAuth(buttons.value); return filterButtonAuth(buttons.value);
}) })
@ -103,7 +101,7 @@
let arr =[{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"}, let arr =[{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},
{"isUse":true,"name":"提交","code":"submit","icon":"ant-design:send-outlined","isDefault":true}, {"isUse":true,"name":"提交","code":"submit","icon":"ant-design:send-outlined","isDefault":true},
{"isUse":true,"name":"撤回","code":"back","icon":"ant-design:rollback-outlined","isDefault":false}, {"isUse":true,"name":"撤回","code":"withdraw","icon":"ant-design:rollback-outlined","isDefault":false},
{"isUse":true,"name":"导入","code":"import","icon":"ant-design:import-outlined","isDefault":true}, {"isUse":true,"name":"导入","code":"import","icon":"ant-design:import-outlined","isDefault":true},
{"isUse":true,"name":"导出模板","code":"export","icon":"ant-design:export-outlined","isDefault":true}, {"isUse":true,"name":"导出模板","code":"export","icon":"ant-design:export-outlined","isDefault":true},
{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},] {"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},]
@ -115,7 +113,7 @@
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code)); return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
}); });
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,datalog : handleDatalog,import : handleImport,export : handleExport,startwork : handleStartwork,flowRecord : handleFlowRecord,submit : handleSubmit,update : handleUpdate,delete : handleDelete,} const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,datalog : handleDatalog,import : handleImport,compare:handleCompare,export : handleExport,startwork : handleStartwork,flowRecord : handleFlowRecord,submit : handleSubmit,toChange : handleUpdate,delete : handleDelete,cancel:handleCancel,withdraw:handleBack}
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
const router = useRouter(); const router = useRouter();
@ -140,7 +138,7 @@
const [registerImportModal, { openModal: openImportModal }] = useModal(); const [registerImportModal, { openModal: openImportModal }] = useModal();
const formName=currentRoute.value.meta?.title; const formName=currentRoute.value.meta?.title;
const [registerTable, { reload, }] = useTable({ const [registerTable, { reload, clearSelectedRowKeys }] = useTable({
title: '' || (formName + '列表'), title: '' || (formName + '列表'),
api: getLngLngDemandPage, api: getLngLngDemandPage,
rowKey: 'id', rowKey: 'id',
@ -165,7 +163,7 @@
striped: false, striped: false,
actionColumn: { actionColumn: {
width: 160, width: 190,
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
slots: { customRender: 'action' }, slots: { customRender: 'action' },
@ -184,44 +182,21 @@
selectedKeys.value = rowKeys; selectedKeys.value = rowKeys;
} }
function dbClickRow(record) { function dbClickRow(record) {
if (!actionButtonConfig?.value.some(element => element.code == 'view')) { router.push({
return; path: '/dayPlan/LngDemand/createForm',
} query: {
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/LngDemand/' + record.id + '/viewForm',
query: {
formPath: 'dayPlan/LngDemand', formPath: 'dayPlan/LngDemand',
formName: formName, formName: '查看'+formName,
formId:currentRoute.value.meta.formId formId:currentRoute.value.meta.formId,
} id: record.id,
}); type: 'view'
} }
});
} }
function buttonClick(code) { function buttonClick(code) {
btnEvent[code](); btnEvent[code]('batch');
} }
function handleDatalog (record: Recordable) { function handleDatalog (record: Recordable) {
modalVisible.value = true modalVisible.value = true
@ -248,27 +223,79 @@
function handleEdit(record: Recordable) { function handleEdit(record: Recordable) {
router.push({ router.push({
path: '/form/LngDemand/' + record.id + '/updateForm', path: '/dayPlan/LngDemand/createForm',
query: { query: {
formPath: 'dayPlan/LngDemand', formPath: 'dayPlan/LngDemand',
formName: formName, formName: '编辑'+formName,
formId:currentRoute.value.meta.formId formId:currentRoute.value.meta.formId,
id: record.id,
type: 'edit'
}
});
}
function handleCompare(record: Recordable) {
router.push({
path: '/dayPlan/LngDemand/createForm',
query: {
formPath: 'dayPlan/LngDemand',
formName: "对比"+formName,
formId:currentRoute.value.meta.formId,
id: record.orgId,
type: 'compare'
} }
}); });
} }
async function handleCancel(record: Recordable) { async function handleCancel(record: Recordable) {
await cancelLngPng(record.id) await cancelLngDemand(record.id)
handleSuccess(); handleSuccess();
notification.success({ notification.success({
message: '提示', message: '提示',
description: t('已取消!'), description: t('已取消!'),
}); });
} }
function handleSubmit () { async function handleBack(record: Recordable) {
if (record == 'batch'&&!selectedKeys.value.length) {
notification.warning({
message: '提示',
description: t('请选择需要撤回的数据'),
});
return;
}
let arr = record == 'batch' ? selectedKeys.value : [record.id]
await withdrawLngDemand(arr)
handleSuccess();
notification.success({
message: '提示',
description: t('已撤回!'),
});
} }
function handleUpdate () { async function handleSubmit (record: Recordable) {
if (record == 'batch'&&!selectedKeys.value.length) {
notification.warning({
message: '提示',
description: t('请选择需要提交的数据'),
});
return;
}
let arr = record == 'batch' ? selectedKeys.value : [record.id]
await submitLngDemand(arr)
handleSuccess();
notification.success({
message: '提示',
description: t('已提交!'),
});
}
function handleUpdate (record: Recordable) {
router.push({
path: '/dayPlan/LngDemand/createForm',
query: {
formPath: 'dayPlan/LngDemand',
formName: formName,
formId:currentRoute.value.meta.formId,
id: record.id,
type: 'update'
}
});
} }
function handleDelete(record: Recordable) { function handleDelete(record: Recordable) {
deleteList([record.id]); deleteList([record.id]);
@ -296,7 +323,7 @@
reload(); reload();
} }
function handleSuccess() { function handleSuccess() {
clearSelectedRowKeys()
reload(); reload();
} }
@ -347,39 +374,80 @@
function getActions(record: Recordable):ActionItem[] { function getActions(record: Recordable):ActionItem[] {
let actionsList: ActionItem[] = []; let actionsList: ActionItem[] = [];
let editAndDelBtn: ActionItem[] = []; let editBtn: ActionItem[] = [];
let hasFlowRecord = false; let delBtn: ActionItem[] = [];
let updateBtn: ActionItem[] = [];
let backBtn: ActionItem[] = [];
let hasFlowRecord = false;
let viewBtn: ActionItem[]=[]
actionButtonConfig.value?.map((button) => { actionButtonConfig.value?.map((button) => {
if (['view', 'copyData'].includes(button.code)) { if (['view', 'copyData','compare', 'datalog'].includes(button.code)) {
actionsList.push({ viewBtn.push({
icon: button?.icon, icon: button?.icon,
tooltip: button?.name, tooltip: button?.name,
onClick: btnEvent[button.code].bind(null, record), onClick: btnEvent[button.code].bind(null, record),
}); });
} }
if (['edit', 'delete'].includes(button.code)) { if (['edit'].includes(button.code)) {
editAndDelBtn.push({ editBtn.push({
icon: button?.icon, icon: button?.icon,
tooltip: button?.name, tooltip: button?.name,
color: button.code === 'delete' ? 'error' : undefined, color: button.code === 'delete' ? 'error' : undefined,
onClick: btnEvent[button.code].bind(null, record), onClick: btnEvent[button.code].bind(null, record),
}); });
} }
if (['delete','submit'].includes(button.code)) {
delBtn.push({
icon: button?.icon,
tooltip: button?.name,
color: button.code === 'delete' ? 'error' : undefined,
onClick: btnEvent[button.code].bind(null, record),
});
}
if (['toChange', 'cancel'].includes(button.code)) {
updateBtn.push({
icon: button?.icon,
tooltip: button?.name,
onClick: btnEvent[button.code].bind(null, record),
});
}
if (['withdraw'].includes(button.code)) {
backBtn.push({
icon: button?.icon,
tooltip: button?.name,
onClick: btnEvent[button.code].bind(null, record),
});
}
if (button.code === 'flowRecord') hasFlowRecord = true; if (button.code === 'flowRecord') hasFlowRecord = true;
}); });
if (record.workflowData?.enabled) { if (record.approCode == 'YSP' && record.alterSign!='D') {
//与工作流有关联的表单 actionsList = actionsList.concat(updateBtn);
if (record.workflowData.status) {
actionsList.unshift(setIndexFlowStatus(record.workflowData))
} else {
actionsList = actionsList.concat(editAndDelBtn);
} }
} else { // || record.approCode == 'YBH'
if (!record.workflowData?.processId) { if ((record.approCode == 'WTJ'|| record.approCode == 'YBH') && record.alterSign!='D' ) {
//与工作流没有关联的表单并且在当前页面新增的数据 如选择编辑、删除按钮则加上 actionsList = actionsList.concat(editBtn);
actionsList = actionsList.concat(editAndDelBtn);
} }
} if (record.approCode == 'WTJ'|| record.approCode == 'YBH') {
actionsList = actionsList.concat(delBtn);
}
if (record.approCode == 'SPZ') {
actionsList = actionsList.concat(backBtn);
}
actionsList = actionsList.concat(viewBtn)
// if (record.workflowData?.enabled) {
// //与工作流有关联的表单
// if (record.workflowData.status) {
// actionsList.unshift(setIndexFlowStatus(record.workflowData))
// } else {
// actionsList = actionsList.concat(editAndDelBtn);
// }
// } else {
// if (!record.workflowData?.processId) {
// //与工作流没有关联的表单并且在当前页面新增的数据 如选择编辑、删除按钮则加上
// actionsList = actionsList.concat(editAndDelBtn);
// }
// }
return actionsList; return actionsList;
} }
function handleStartwork(record: Recordable) { function handleStartwork(record: Recordable) {

View File

@ -259,13 +259,7 @@
} else { } else {
selectedRowsData.value= [{...val}] selectedRowsData.value= [{...val}]
} }
await cancelLngLngMeasure(selectedRowsData.value) fieldCheck('cancel')
handleSuccess();
notification.success({
message: '提示',
description: t('取消成功!'),
});
clearSelectedRowKeys()
} }
async function handleSubmit(val) { async function handleSubmit(val) {
if (val=='batch') { if (val=='batch') {
@ -279,14 +273,7 @@
} else { } else {
selectedRowsData.value= [{...val}] selectedRowsData.value= [{...val}]
} }
fieldCheck('submit')
await updateLngLngMeasure(selectedRowsData.value)
handleSuccess();
notification.success({
message: '提示',
description: t('确认成功!'),
});
clearSelectedRowKeys()
} }
async function handleSave(val) { async function handleSave(val) {
if (val=='batch') { if (val=='batch') {
@ -300,18 +287,43 @@
} else { } else {
selectedRowsData.value= [{...val}] selectedRowsData.value= [{...val}]
} }
selectedRowsData.value.forEach(v=> { fieldCheck('save')
v.timeOut = v.timeOut ? dayjs(v.timeOut).format('YYYY-MM-DD HH:mm:ss') : null
v.timeIn = v.timeIn ? dayjs(v.timeIn).format('YYYY-MM-DD HH:mm:ss') : null }
}) const fieldCheck = async (type) => {
await addLngLngMeasure(selectedRowsData.value) for(let i = 0; i<selectedRowsData.value.length;i++) {
if (!selectedRowsData.value[i].timeOut || !selectedRowsData.value[i].timeIn) {
notification.warning({
message: '提示',
description: t('时间不能为空'),
});
return
}
if (selectedRowsData.value[i].statusCode=='JLZ' && (!selectedRowsData.value[i].qtyMeaTonSales || !selectedRowsData.value[i].qtyMeaGjSales || !selectedRowsData.value[i].qtyMeaM3Sales)) {
notification.warning({
message: '提示',
description: t('装车量不能为空'),
})
return
}
selectedRowsData.value[i].timeOut = selectedRowsData.value[i].timeOut ? dayjs(selectedRowsData.value[i].timeOut).format('YYYY-MM-DD HH:mm:ss') : null
selectedRowsData.value[i].timeIn = selectedRowsData.value[i].timeIn ? dayjs(selectedRowsData.value[i].timeIn).format('YYYY-MM-DD HH:mm:ss') : null
}
let request = type == 'save' ? addLngLngMeasure : updateLngLngMeasure
if (type =='cancel') {
request = cancelLngLngMeasure
}
await request(selectedRowsData.value)
let tip = type == 'save' ? '保存成功' : '确认成功'
if (type =='cancel') {
tip = '取消成功'
}
handleSuccess(); handleSuccess();
notification.success({ notification.warn({
message: '提示', message: '提示',
description: t('保存成功!'), description: tip,
}); });
clearSelectedRowKeys() clearSelectedRowKeys()
} }
function handleDelete(record: Recordable) { function handleDelete(record: Recordable) {
deleteList([record.id]); deleteList([record.id]);