diff --git a/src/components/common/contractPurLngListModal.vue b/src/components/common/contractPurLngListModal.vue new file mode 100644 index 0000000..f672cb7 --- /dev/null +++ b/src/components/common/contractPurLngListModal.vue @@ -0,0 +1,142 @@ + + + + diff --git a/src/views/inventory/LngInventoryIn/components/createForm.vue b/src/views/inventory/LngInventoryIn/components/createForm.vue index c760957..5a502ec 100644 --- a/src/views/inventory/LngInventoryIn/components/createForm.vue +++ b/src/views/inventory/LngInventoryIn/components/createForm.vue @@ -17,7 +17,7 @@ - + {{ item.label }} @@ -26,12 +26,12 @@ - + - + {{ item.name }} @@ -40,12 +40,12 @@ - + - + @@ -55,7 +55,7 @@ - + @@ -64,27 +64,27 @@ - + - + - + - + - + @@ -150,8 +150,8 @@ - - + + {{ item.fullName }} @@ -202,7 +202,7 @@ - + @@ -227,7 +227,7 @@ import { getAppEnvConfig } from '/@/utils/env'; import { message } from 'ant-design-vue'; import UploadList from '/@/components/Form/src/components/UploadList.vue'; - import contractPurIntListModal from '../../../../components/common/contractPurIntListModal.vue'; + import contractPurLngListModal from '/@/components/common/contractPurLngListModal.vue'; import lngStationModal from '/@/components/common/lngStationModal.vue'; import { getAllCom} from '/@/api/contract/ContractPurInt'; import OpsPurIntListModal from '/@/components/common/OpsPurIntListModal.vue'; @@ -267,15 +267,13 @@ catCode: 'LNG' }); const [register, { openModal:openModal}] = useModal(); - const [registerContractPurInt, { openModal:openModalContractPurInt}] = useModal(); + const [registerContractPurLng, { openModal:openModalContractPurLng}] = useModal(); const [registerStation, { openModal:openModalStation}] = useModal(); - const [registerPort, { openModal:openModalPort}] = useModal(); const [registerShip, { openModal:openModalShip}] = useModal(); const rules= reactive({ comId: [{ required: true, message: "该项为必填项", trigger: 'change' }], ssTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }], - suName: [{ required: true, message: "该项为必填项", trigger: 'change' }], typeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }], kName: [{ required: true, message: "该项为必填项", trigger: 'change' }], staName: [{ required: true, message: "该项为必填项", trigger: 'change' }], @@ -287,9 +285,6 @@ qtyLostMmbtu: [{ required: true, message: "该项为必填项", trigger: 'change' }], qtyLostGj: [{ required: true, message: "该项为必填项", trigger: 'change' }], qtyLostTon: [{ required: true, message: "该项为必填项", trigger: 'change' }], - // qtyMmbtu: [{ required: true, message: "该项为必填项", trigger: 'change' }], - // qtyGj: [{ required: true, message: "该项为必填项", trigger: 'change' }], - // qtyTon: [{ required: true, message: "该项为必填项", trigger: 'change' }], }); const layout = { labelCol: { span: 8 }, @@ -340,7 +335,7 @@ spinning.value = false Object.assign(formState, {...data}) Object.assign(dataFile.value, formState.lngFileUploadList || []) - formState.dateNor = formState.dateNor ? dayjs(formState.dateNor) : null + formState.dateIn = formState.dateIn ? dayjs(formState.dateIn) : null getOptionParams() @@ -361,14 +356,20 @@ } async function getOptionParams() { - optionSelect.curCodeList = await getAllCurrency({eid: formState.curCode}) + optionSelect.curCodeList = await getAllCurrency({eid: formState.currCode}) } const typeCodeChange = (val) => { if (val == 'ZN') { formState.opsId = '' formState.ssId = '' + formState.ssNo = '' formState.kId = '' + formState.kName = '' formState.suCode = '' + formState.suName = '' + rules.kName = [{ required: true, message: "该项为必填项", trigger: 'change' }] + } else { + rules.kName = [{ required: false, message: "该项为必填项", trigger: 'change' }] } } const numCount = (k) => { @@ -393,16 +394,14 @@ } const onSearchShip = () => { - if (formState.typeCode == 'CQ') { - openModalShip(true,{isUpdate: false}) - } + openModalShip(true,{isUpdate: false}) } const onSearchStation = (val)=> { openModalStation(true,{isUpdate: false}) } const onContract = (val)=> { - openModalContractPurInt(true,{isUpdate: false}) + openModalContractPurLng(true,{isUpdate: false}) } const handleSuccessStation = (val) => { @@ -419,7 +418,7 @@ try { spinning.value = true let data = await getLngOpsPurInt(id) - let res = await getLngInventoryInShip(id) + let res = await getLngInventoryInShip(id) || [] spinning.value = false formState.ssNo = data.ssNo formState.opsId = data.id @@ -433,11 +432,16 @@ formState.suName = data.suName formState.dateIn = data.dateEta ? dayjs(data.dateEta) : null - formState.curCode = data.curCode + formState.currCode = data.curCode formState.priceMmbtu = data.priceCurr formState.amountCurr = data.amountCurr formState.rateExPur = data.rateEx + formState.qtyUnloadMmbtu = res[0]?.qtyMmbtu + formState.qtyUnloadTon = res[0]?.qtyTon + formState.qtyUnloadM3L = res[0]?.qtyM3L + formState.qtyUnloadM3 = res[0]?.qtyM3 + formState.qtyUnloadGj = res[0]?.qtyGj numCount() @@ -448,15 +452,12 @@ spinning.value = false } } - const handleSuccessContractPurInt = (val) => { + const handleSuccessContractPurLng = (val) => { formState.kId = val[0].id formState.kName = val[0].kName formState.comId = val[0].comId formState.suCode = val[0].suCode formState.suName = val[0].suSname - formState.longSpotCode = val[0].longSpotCode - formState.prcTermCode = val[0].prcTermCode - formState.sourceName = val[0].sourceName } function close() { tabStore.closeTab(currentRoute.value, router); diff --git a/src/views/inventory/LngInventoryIn/index.vue b/src/views/inventory/LngInventoryIn/index.vue index d28062d..ecaf78c 100644 --- a/src/views/inventory/LngInventoryIn/index.vue +++ b/src/views/inventory/LngInventoryIn/index.vue @@ -192,12 +192,12 @@ function handleEdit(record: Recordable) { router.push({ - path: '/form/LngInventoryIn/' + record.id + '/updateForm', + path: '/inventory/LngInventoryIn/createForm', query: { formPath: 'inventory/LngInventoryIn', - formName: formName, + formName: '编辑'+formName, formId:currentRoute.value.meta.formId, - type: 'view', + type: 'edit', id: record.id } }); @@ -216,7 +216,7 @@ deleteLngInventoryIn(ids).then((_) => { handleSuccess(); notification.success({ - message: 'Tip', + message: '提示', description: t('删除成功!'), }); }); @@ -268,27 +268,28 @@ } }); function getActions(record: Recordable):ActionItem[] { - - const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => { - if (!record.workflowData?.processId) { - return { + let actionsList: ActionItem[] = [] + let editAndDelBtn: ActionItem[] = [] + actionButtonConfig.value?.map((button) => { + if (['view', 'copyData', 'datalog'].includes(button.code)) { + actionsList.push({ + icon: button?.icon, + tooltip: button?.name, + onClick: btnEvent[button.code].bind(null, record), + }); + } + if (['edit', 'delete'].includes(button.code)) { + editAndDelBtn.push({ icon: button?.icon, tooltip: button?.name, color: button.code === 'delete' ? 'error' : undefined, onClick: btnEvent[button.code].bind(null, record), - }; - } else { - if (button.code === 'view') { - return { - icon: button?.icon, - tooltip: button?.name, - onClick: btnEvent[button.code].bind(null, record), - }; - } else { - return {}; - } + }); } }); + if (!record.dataSource) { + actionsList = actionsList.concat(editAndDelBtn); + } return actionsList; } async function mergeCustomListRenderConfig(){