lng客户需求
This commit is contained in:
@ -23,12 +23,12 @@
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<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-col>
|
||||
<a-col :span="8">
|
||||
<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-col>
|
||||
<a-col :span="8">
|
||||
@ -38,37 +38,37 @@
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<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-col>
|
||||
<a-col :span="8">
|
||||
<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-col>
|
||||
<a-col :span="8">
|
||||
<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-col>
|
||||
<a-col :span="8">
|
||||
<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-col>
|
||||
<a-col :span="8">
|
||||
<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-col>
|
||||
<a-col :span="8">
|
||||
<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-col>
|
||||
<a-col :span="8">
|
||||
<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-col>
|
||||
<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-col>
|
||||
<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 :span="24">
|
||||
<a-form-item label="备注" name="note" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||
@ -129,7 +135,8 @@
|
||||
</a-row>
|
||||
</a-form>
|
||||
<contractDemandListModal @register="registerContract" @success="handleSuccessContract" />
|
||||
<pointDelyDemandListModal @register="registerUpLoad" @success="handleSuccessUpLoad" />
|
||||
<pointDelyDemandListModal @register="registerStation" @success="handleSuccessStation" />
|
||||
<placeLngUnloadModal @register="registerPlace" @success="handleSuccessPlace"/>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
@ -138,14 +145,14 @@
|
||||
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
|
||||
import contractDemandListModal from '/@/components/common/contractDemandListModal.vue';
|
||||
import pointDelyDemandListModal from '/@/components/common/pointDelyDemandListModal.vue';
|
||||
import placeLngUnloadModal from '/@/components/common/placeLngUnloadModal.vue';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { message } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
import { getCompDept } from '/@/api/approve/Appro';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
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 userInfo = userStore.getUserInfo;
|
||||
const router = useRouter();
|
||||
@ -154,9 +161,20 @@
|
||||
const pageType = ref(currentRoute.value.query?.type)
|
||||
const formRef = ref()
|
||||
const rules= reactive({
|
||||
pointDelyName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
staName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
datePlan: [{ 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 = {
|
||||
labelCol: { span: 9 },
|
||||
@ -164,7 +182,8 @@
|
||||
}
|
||||
const { t } = useI18n();
|
||||
const [registerContract, { openModal:openModalContractSales}] = useModal();
|
||||
const [registerUpLoad, { openModal:openModalUpLoad}] = useModal();
|
||||
const [registerStation, { openModal:openModalUpLoad}] = useModal();
|
||||
const [registerPlace, { openModal:openModalPlace}] = useModal();
|
||||
const props = defineProps({
|
||||
formObj: {},
|
||||
disable: false,
|
||||
@ -177,19 +196,20 @@
|
||||
const diffResultList = ref([])
|
||||
const formState = ref({})
|
||||
const contractList = ref([])
|
||||
const pointDelyList = ref([])
|
||||
const stationList = ref([])
|
||||
onMounted(async () =>{
|
||||
getOption()
|
||||
if (!pageType.value) {
|
||||
formState.value.lastVerSign = 'Y'
|
||||
formState.value.validSign = 'N'
|
||||
formState.value.carrCode = '123'
|
||||
// formState.value.validSign = 'N'
|
||||
formState.value.alterSign = 'I'
|
||||
formState.value.approCode = 'WTJ'
|
||||
const res = await getCompDept(userInfo.id)
|
||||
formState.value.cuCode = res?.comp?.cuCode
|
||||
formState.value.comId = res?.comp?.id
|
||||
const res1 = await getLngPngDemandRate({}) || []
|
||||
formState.value.rateM3Gj = res1[0]?.rateM3Gj
|
||||
let a = await getCategory({code: 'LNG'})||[]
|
||||
formState.value.qtyTon = a[0]?.coefficient
|
||||
}
|
||||
|
||||
|
||||
@ -197,8 +217,14 @@
|
||||
async function getOption() {
|
||||
optionSelect.timePeriodList = await getDictionary('LNG_TIME_P')
|
||||
optionSelect.supplyCodeList = await getDictionary('LNG_SUPPLY')
|
||||
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
|
||||
|
||||
}
|
||||
const datePlanChange = async (val) => {
|
||||
if (!val) {
|
||||
contractList.value = []
|
||||
return
|
||||
}
|
||||
let obj = {
|
||||
cuCode:formState.value.cuCode,
|
||||
datePlan: dayjs(formState.value.datePlan).format('YYYY-MM-DD')
|
||||
@ -208,8 +234,9 @@
|
||||
if (contractList.value.length == 1) {
|
||||
formState.value.kName = contractList.value[0].kName
|
||||
formState.value.ksId = contractList.value[0].id
|
||||
getPointDely()
|
||||
getContractQty()
|
||||
formState.value.comId = contractList.value[0].comId
|
||||
formState.value.comName = contractList.value[0].comName
|
||||
getStation()
|
||||
}
|
||||
}
|
||||
const onSearch = ()=> {
|
||||
@ -222,8 +249,9 @@
|
||||
const handleSuccessContract = (val) => {
|
||||
formState.value.kName = val[0].kName
|
||||
formState.value.ksId = val[0].id
|
||||
getPointDely()
|
||||
getContractQty()
|
||||
formState.value.comId = contractList.value[0].comId
|
||||
formState.value.comName = contractList.value[0].comName
|
||||
getStation()
|
||||
|
||||
}
|
||||
const onSearchUpLoad = (val)=> {
|
||||
@ -231,34 +259,55 @@
|
||||
message.warn('请选择合同')
|
||||
return
|
||||
}
|
||||
openModalUpLoad(true,{isUpdate: false, list: pointDelyList.value})
|
||||
openModalUpLoad(true,{isUpdate: false, list: stationList.value})
|
||||
}
|
||||
const handleSuccessUpLoad = (val) => {
|
||||
formState.value.pointDelyName = val[0].pointDelyName
|
||||
formState.value.pointDelyCode = val[0].pointDelyCode
|
||||
formState.value.ksppId = val[0].id
|
||||
getPurList()
|
||||
const handleSuccessStation = (val) => {
|
||||
formState.value.staName = val[0].pointDelyName
|
||||
formState.value.staCode = val[0].pointDelyCode
|
||||
formState.value.onlineSign = val[0].onlineSign
|
||||
changeRules()
|
||||
|
||||
}
|
||||
const getPointDely = async () => {
|
||||
let res = await getLngLngDemandStationList({kId: formState.value.ksId})
|
||||
pointDelyList.value = res || []
|
||||
if (pointDelyList.value.length == 1) {
|
||||
formState.value.pointDelyName = pointDelyList.value[0].pointDelyName
|
||||
formState.value.pointDelyCode = pointDelyList.value[0].pointDelyCode
|
||||
formState.value.ksppId = pointDelyList.value[0].id
|
||||
|
||||
const changeRules = () => {
|
||||
if (formState.value.onlineSign == 'Y') {
|
||||
rules.nameDriver = [{ required: false, message: "该项为必填项", trigger: 'change' }]
|
||||
rules.phoneDriver = [{ required: false, message: "该项为必填项", trigger: 'change' }]
|
||||
rules.nameEscort = [{ required: false, message: "该项为必填项", trigger: 'change' }]
|
||||
rules.phoneEscort = [{ required: false, message: "该项为必填项", trigger: 'change' }]
|
||||
} 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 () => {
|
||||
let obj = {
|
||||
kId: formState.value.ksId,
|
||||
datePlan: dayjs(formState.value.datePlan).format('YYYY-MM-DD')
|
||||
const onSearchPlace = ()=> {
|
||||
openModalPlace(true,{isUpdate: false})
|
||||
}
|
||||
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
|
||||
formState.value.qtyContractM3 = res[0]?.qtyContractM3
|
||||
formState.value.qtyContractM3 =NP.divide(Number(formState.value.qtyContractM3), 10000)
|
||||
|
||||
}
|
||||
const handleCheck = async (type) => {
|
||||
if (formState.value.onlineSign == 'Y' && ((type == 'noTractor'&& !formState.value.noTrailer) || (type == 'noTrailer'&& !formState.value.noTractor)) ) {
|
||||
// formState.value.carrCode = ''
|
||||
// formState.value.carrName = ''
|
||||
}
|
||||
|
||||
}
|
||||
const disabledDateStart = (current) => {
|
||||
const today = new Date();
|
||||
@ -307,22 +356,6 @@
|
||||
|
||||
<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 {
|
||||
color: red !important;
|
||||
}
|
||||
|
||||
@ -163,7 +163,7 @@ export const columns: BasicColumn[] = [
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'ksName',
|
||||
dataIndex: 'kName',
|
||||
title: '合同',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
@ -39,13 +39,13 @@
|
||||
import type { Rule } from 'ant-design-vue/es/form';
|
||||
import { getDictionary } from '/@/api/sales/Customer';
|
||||
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 { getAppEnvConfig } from '/@/utils/env';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import basicForm from './basicForm.vue'
|
||||
import NP from 'number-precision';
|
||||
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
@ -86,7 +86,7 @@
|
||||
async function getCompareInfo(id) {
|
||||
spinning.value = true
|
||||
try {
|
||||
let data = await getLngPngDemandCompare(id) || {}
|
||||
let data = await getLngDemandCompare(id) || {}
|
||||
spinning.value = false
|
||||
diffResultList.value = data.diffResultList || []
|
||||
let obj = changeData(data.oldBean || {})
|
||||
@ -108,9 +108,9 @@
|
||||
try {
|
||||
let data = {}
|
||||
if (pageType.value == 'update') {
|
||||
data = await getLngPngDemandUpdate(id)
|
||||
data = await getLngDemanddUpdate(id)
|
||||
} else {
|
||||
data = await getLngPngDemand(id)
|
||||
data = await getLngLngDemand(id)
|
||||
}
|
||||
spinning.value = false
|
||||
let obj = changeData(data)
|
||||
@ -125,7 +125,8 @@
|
||||
if (Object.keys(obj).length === 0) return {
|
||||
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 {
|
||||
params: obj
|
||||
}
|
||||
@ -140,33 +141,66 @@
|
||||
...data.formInfo,
|
||||
datePlan: dayjs(data.formInfo.datePlan).format('YYYY-MM-DD HH:mm:ss'),
|
||||
}
|
||||
spinning.value = true;
|
||||
let request = submitLngPngDemand
|
||||
if (type == 'save') {
|
||||
request = !pageId.value ? addLngPngDemand : updateLngPngDemand
|
||||
if (type == 'submit') {
|
||||
let params = {
|
||||
orgId: obj.orgId,
|
||||
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) {
|
||||
spinning.value = false;
|
||||
errorInfo?.errorFields?.length && notification.warning({
|
||||
message: 'Tip',
|
||||
message: '提示',
|
||||
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>
|
||||
|
||||
@ -183,21 +217,5 @@
|
||||
.pdcss {
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user