diff --git a/src/components/common/portListModal.vue b/src/components/common/portListModal.vue index cf199ea..e3b7b18 100644 --- a/src/components/common/portListModal.vue +++ b/src/components/common/portListModal.vue @@ -39,11 +39,13 @@ selectType: { type: String, default: 'radio' }, }); + const dataType = ref('') const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { setModalProps({ confirmLoading: false }); isUpdate.value = !!data?.isUpdate; + dataType.value = data.type }); const [registerTable, { getDataSource, setTableData, updateTableDataRecord, reload }] = useTable({ @@ -90,7 +92,7 @@ return } closeModal(); - emit('success', selectedValues.value); + emit('success', selectedValues.value, dataType.value); } diff --git a/src/components/common/shipScheduleListModal.vue b/src/components/common/shipScheduleListModal.vue new file mode 100644 index 0000000..86f50ae --- /dev/null +++ b/src/components/common/shipScheduleListModal.vue @@ -0,0 +1,132 @@ + + + + diff --git a/src/views/contract/ContractFact/components/createForm.vue b/src/views/contract/ContractFact/components/createForm.vue index 134c4ee..769d6d3 100644 --- a/src/views/contract/ContractFact/components/createForm.vue +++ b/src/views/contract/ContractFact/components/createForm.vue @@ -405,6 +405,9 @@ formState.dateDraft = formState.dateDraft ? dayjs(formState.dateDraft) : null formState.dateFrom = formState.dateFrom ? dayjs(formState.dateFrom) : null formState.dateTo = formState.dateTo ? dayjs(formState.dateTo) : null + dataListAppro.value.forEach(v => { + v.approId = v.id + }) periodTypeCodeChange(formState.periodTypeCode) amountTypeCodeChange(formState.amountTypeCode) getOptionParams() @@ -593,7 +596,9 @@ async function handleSubmit(type) { try { await formRef.value.validateFields(); - + dataListAppro.value.forEach((v,idx)=>{ + v.tableName = 'lng_contract_fact' + }) if (Number(formState.cpCount)<1 || Number(formState.cpCount)>20) { message.warn('相对方信息个数必须在1-20间') return diff --git a/src/views/ship/OpsPurInt/components/createForm.vue b/src/views/ship/OpsPurInt/components/createForm.vue index adca31b..85f7a32 100644 --- a/src/views/ship/OpsPurInt/components/createForm.vue +++ b/src/views/ship/OpsPurInt/components/createForm.vue @@ -17,12 +17,11 @@ - + - {{ item.label }} @@ -32,7 +31,7 @@ - + {{ item.name }} @@ -69,12 +68,9 @@ - - - - {{ item.name }} - - + + @@ -93,9 +89,9 @@ - - - + + + {{ item.name }} @@ -106,13 +102,13 @@ - - + + - - + + @@ -125,9 +121,9 @@ - - - + + + {{ item.name }} @@ -144,17 +140,17 @@ - - - + + + {{ item.name }} - - + + {{ item.fullName }} @@ -167,18 +163,18 @@ - - + + - - + + - + @@ -197,18 +193,18 @@ - - + + - - + + - - + + @@ -217,23 +213,23 @@ - - + + - - + + - - + + - - + + @@ -241,33 +237,33 @@ - - + + - - + + - - + + - - + + - - + + - - + + @@ -276,12 +272,12 @@ - + - - + + @@ -305,8 +301,8 @@ - - + + @@ -314,41 +310,45 @@ - - + + - - + + - - + + - - + + - - - - - - - - - + + + - - - + + + + + + + + + + + + + @@ -357,11 +357,10 @@ - - - + + @@ -379,20 +378,25 @@ import { getDictionary } from '/@/api/sales/Customer'; import { useModal } from '/@/components/Modal'; import { getAllPriceTerm} from '/@/api/contract/ContractPurInt'; - import { addLngShipSchedule,updateLngShipSchedule, getLngShipSchedule} from '/@/api/ship/ShipSchedule'; + import { addLngOpsPurInt,updateLngOpsPurInt, getLngOpsPurInt} from '/@/api/ship/OpsPurInt'; import { getAllCurrency } from '/@/api/contract/ContractFact'; import dayjs from 'dayjs'; import { getAppEnvConfig } from '/@/utils/env'; import { message } from 'ant-design-vue'; import UploadList from '/@/components/Form/src/components/UploadList.vue'; import deptUserModal from '/@/components/common/deptUserModal.vue'; - import ContractPurIntListModal from '/@/components/common/ContractPurIntListModal.vue'; + import contractPurIntListModal from '../../../../components/common/contractPurIntListModal.vue'; import supplierListModal from '/@/components/common/supplierListModal.vue'; import lngStationModal from '/@/components/common/lngStationModal.vue'; import customerListModal from '/@/components/common/customerListModal.vue'; import portListModal from '/@/components/common/portListModal.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; @@ -425,20 +429,25 @@ const { t } = useI18n() const formState = reactive({ - + approCode: 'WTJ' }); const [register, { openModal:openModal}] = useModal(); const [registerContractPurInt, { openModal:openModalContractPurInt}] = useModal(); - const [registerSupplier, { openModal:openModalSupplier}] = useModal(); const [registerStation, { openModal:openModalStation}] = useModal(); - const [registerCustomer, { openModal:openModalCustomer}] = useModal(); const [registerPort, { openModal:openModalPort}] = useModal(); + const [registerShip, { openModal:openModalShip}] = useModal(); + const rules= reactive({ - ownSign: [{ required: true, message: "该项为必填项", trigger: 'change' }], + ssNo: [{ required: true, message: "该项为必填项", trigger: 'change' }], comId: [{ required: true, message: "该项为必填项", trigger: 'change' }], ssTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }], - currCode: [{ required: true, message: "该项为必填项", trigger: 'change' }], + curCode: [{ required: true, message: "该项为必填项", trigger: 'change' }], dateEta: [{ 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' }], }); const layout = { labelCol: { span: 8 }, @@ -446,7 +455,7 @@ } const dataFile = ref([]); let optionSelect= reactive({ - ownSignList: [], + signList: [], comIdList: [], ssTypeCodeList: [], longSpotCodeList: [], @@ -484,16 +493,57 @@ formState.empTel = userInfo.mobile getOptionParams() } - + initialFetch() }); + const options = ref([]); + const loadData: CascaderProps['loadData'] = async (selectedOptions) => { + const targetOption = selectedOptions[selectedOptions.length - 1]; + targetOption.loading = true; + try { + const res = await getAreaList({pid: targetOption.id, excludeType:'CONTINENT'}); + + if (Array.isArray(res)) { + const children = (res || []).map(item => { + return { + ...item, + isLeaf: !item.hasChild, + } + }); + targetOption.children = children; + return; + } + } catch (e) { + console.error(e); + } finally { + targetOption.loading = false; + } + }; + async function initialFetch() { + try { + const res = await getAreaList({pid: '', excludeType:'CONTINENT'}); + options.value = (res || []).map(item => { + return { + ...item, + isLeaf: !item.hasChild, + } + }) + } catch (error) {} + } + const onChange = (value, selectedOptions) => { + } + const getArea = async (val) => { + const resData = await getAreaInfo({code: val,excludeType:'CONTINENT' }); + options.value = resData.areaList + formState.salesAreaCode = resData.regionCode + } const uploadListChange = (val) => { dataFile.value = val } async function getInfo(id) { spinning.value = true try { - let data = await getLngShipSchedule(id) + let data = await getLngOpsPurInt(id) spinning.value = false Object.assign(formState, {...data}) Object.assign(dataFile.value, formState.lngFileUploadList || []) @@ -503,17 +553,49 @@ formState.dateEtb = formState.dateEtb ? dayjs(formState.dateEtb) : null formState.dateEtc = formState.dateEtc ? dayjs(formState.dateEtc) : null formState.dateEtd = formState.dateEtd ? dayjs(formState.dateEtd) : null + formState.dateOps = formState.dateOps ? dayjs(formState.dateOps) : null + formState.dateTrans = formState.dateTrans ? dayjs(formState.dateTrans) : null + formState.dateEnd = formState.dateEnd ? dayjs(formState.dateEnd) : null + formState.datePayNtc = formState.datePayNtc ? dayjs(formState.datePayNtc) : null + + formState.dateInv = formState.dateInv ? dayjs(formState.dateInv) : null + formState.dateRp = formState.dateRp ? dayjs(formState.dateRp) : null + formState.dateEtaL = formState.dateEtaL ? dayjs(formState.dateEtaL) : null + formState.dateEtbL = formState.dateEtbL ? dayjs(formState.dateEtbL) : null + + formState.dateEtcL = formState.dateEtcL ? dayjs(formState.dateEtcL) : null + formState.dateEtdL = formState.dateEtdL ? dayjs(formState.dateEtdL) : null + formState.dateBl = formState.dateBl ? dayjs(formState.dateBl) : null + formState.datePost = formState.datePost ? dayjs(formState.datePost) : null + formState.dateLic = formState.dateLic ? dayjs(formState.dateLic) : null getOptionParams() + if (formState.salesAreaCode) { + getArea(formState.salesAreaCode) + } } catch (error) { + console.log(error,'533') spinning.value = false } } + const getCompDeptInfo = async (id, deptId)=> { + const res = await getCompDept(id, deptId) + formState.empDeptName = res?.dept?.name + formState.empDeptId = res?.dept?.id + + if (!pageId.value) { + formState.comName = res?.comp?.name + formState.comId = res?.comp?.id + } + } async function getOption() { - optionSelect.ownSignList = await getDictionary('LNG_YN') + optionSelect.signList = await getDictionary('LNG_YN') optionSelect.ssTypeCodeList = await getDictionary('LNG_SHP_S') optionSelect.approCodeList = await getDictionary('LNG_APPRO') optionSelect.longSpotCodeList = await getDictionary('LNG_LONG') + if (!pageId.value) { + getCompDeptInfo(userInfo.id) + } let res = await getAllCom() || [] optionSelect.comIdList = res.map(v=> { return { @@ -521,23 +603,30 @@ value: v.id } }) + } async function getOptionParams() { optionSelect.curCodeList = await getAllCurrency({eid: formState.curCode}) optionSelect.prcTermCodeList = await getAllPriceTerm({eid: formState.prcTermCode}) } - const onSearchPort= () => { - openModalPort(true,{isUpdate: false}) + const numCount = () => { + formState.amountCurrEst = (Number(formState.qtyMmbtu) || 0) * (Number(formState.priceCurrEst) || 0) + formState.amountCurrEst = formState.amountCurrEst ? formState.amountCurrEst.toFixed(2) : '' } - const onSearchCustomer = () => { - openModalCustomer(true,{isUpdate: false}) + const numChange = () => { + formState.amountCurr = (Number(formState.qtySettleMmbtu) || 0) * (Number(formState.priceCurr) || 0) + formState.amountCurr = formState.amountCurr ? formState.amountCurr.toFixed(2) : '' + } + const onSearchPort= (type) => { + openModalPort(true,{isUpdate: false, type}) + } + + const onSearchShip = () => { + openModalShip(true,{isUpdate: false}) } const onSearchStation = (val)=> { openModalStation(true,{isUpdate: false}) } - const onSearchSupplier = () => { - openModalSupplier(true,{isUpdate: false}) - } const onSearchUser = (val)=> { openModal(true,{isUpdate: false}) } @@ -548,22 +637,60 @@ formState.empName = val[0].name formState.empId = val[0].id formState.empTel = val[0].mobile + getCompDeptInfo(formState.empId, deptId) } - const handleSuccessPort = (val) => { - formState.portUnloading1Code = val[0].code - formState.portUnloading1Name = val[0].fullName + + const handleSuccessPort = (val, type) => { + if (type == 'portUnload') { + formState.portUnloading1Code = val[0].code + formState.portUnloading1Name = val[0].fullName + } else { + formState.portLoading1Code = val[0].code + formState.portLoading1Name = val[0].fullName + } } const handleSuccessStation = (val) => { formState.staCode = val[0].code formState.staName = val[0].fullName } - const handleSuccessCustomer = (val) => { - formState.cuCode = val[0].cuCode - formState.cuName = val[0].cuName + const handleSuccessShip = (val) => { + formState.ssNo = val[0].ssNo + formState.ssId = val[0].id + getLngShipInfo(val[0].id) } - const handleSuccessSupplier = (val) => { - formState.suCode = val[0].suCode - formState.suName = val[0].suName + const getLngShipInfo = async (id) => { + let data = await getLngShipSchedule(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.curCode = data.curCode + formState.rateEx = data.rateEx + formState.priceCurrEst = data.priceCurrEst + formState.amountCurrEst = data.amountCurrEst + } const handleSuccessContractPurInt = (val) => { formState.kId = val[0].id @@ -586,10 +713,11 @@ 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 ? addLngShipSchedule :updateLngShipSchedule + let request = !formState.id ? addLngOpsPurInt :updateLngOpsPurInt try { const data = await request(obj); diff --git a/src/views/ship/OpsPurInt/index.vue b/src/views/ship/OpsPurInt/index.vue index a02a5dc..b9cec4e 100644 --- a/src/views/ship/OpsPurInt/index.vue +++ b/src/views/ship/OpsPurInt/index.vue @@ -159,39 +159,16 @@ }); 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/OpsPurInt/' + record.id + '/viewForm', + router.push({ + path: '/ship/OpsPurInt/createForm', query: { formPath: 'ship/OpsPurInt', - formName: formName, - formId:currentRoute.value.meta.formId + formName: '查看'+ formName, + formId:currentRoute.value.meta.formId, + id: record.id, + type: 'view' } }); - } } function buttonClick(code) { @@ -223,11 +200,13 @@ function handleEdit(record: Recordable) { router.push({ - path: '/form/OpsPurInt/' + record.id + '/updateForm', + path: '/ship/OpsPurInt/createForm', query: { formPath: 'ship/OpsPurInt', - formName: formName, - formId:currentRoute.value.meta.formId + formName: '编辑'+ formName, + formId:currentRoute.value.meta.formId, + id: record.id, + type: 'edit' } }); } @@ -245,7 +224,7 @@ deleteLngOpsPurInt(ids).then((_) => { handleSuccess(); notification.success({ - message: 'Tip', + message: '提示', description: t('删除成功!'), }); }); diff --git a/src/views/ship/ShipSchedule/components/createForm.vue b/src/views/ship/ShipSchedule/components/createForm.vue index 86c23ff..c96c2db 100644 --- a/src/views/ship/ShipSchedule/components/createForm.vue +++ b/src/views/ship/ShipSchedule/components/createForm.vue @@ -59,7 +59,7 @@ - + {{ item.fullName }} @@ -68,7 +68,7 @@ - + {{ item.name }} @@ -165,8 +165,8 @@ - - + + {{ item.fullName }} @@ -218,7 +218,7 @@ - + @@ -247,7 +247,7 @@ import { message } from 'ant-design-vue'; import UploadList from '/@/components/Form/src/components/UploadList.vue'; import deptUserModal from '/@/components/common/deptUserModal.vue'; - import ContractPurIntListModal from '/@/components/common/ContractPurIntListModal.vue'; + import contractPurIntListModal from '/@/components/common/contractPurIntListModal.vue'; import supplierListModal from '/@/components/common/supplierListModal.vue'; import lngStationModal from '/@/components/common/lngStationModal.vue'; import customerListModal from '/@/components/common/customerListModal.vue'; @@ -298,7 +298,7 @@ ownSign: [{ required: true, message: "该项为必填项", trigger: 'change' }], comId: [{ required: true, message: "该项为必填项", trigger: 'change' }], ssTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }], - currCode: [{ required: true, message: "该项为必填项", trigger: 'change' }], + curCode: [{ required: true, message: "该项为必填项", trigger: 'change' }], dateEta: [{ required: true, message: "该项为必填项", trigger: 'change' }], }); const layout = { diff --git a/src/views/ship/ShipSchedule/index.vue b/src/views/ship/ShipSchedule/index.vue index 6dc6a43..b18e22f 100644 --- a/src/views/ship/ShipSchedule/index.vue +++ b/src/views/ship/ShipSchedule/index.vue @@ -347,6 +347,10 @@ } } }); + let idx = actionsList.findIndex(v=>v.tooltip=='删除') + if ((record.opsPurid || record.opsSalesId) && idx>-1) { + actionsList.splice(idx, 1) + } return actionsList; } async function mergeCustomListRenderConfig(){