diff --git a/src/api/dayPlan/LngDemand/index.ts b/src/api/dayPlan/LngDemand/index.ts index 814f519..983e123 100644 --- a/src/api/dayPlan/LngDemand/index.ts +++ b/src/api/dayPlan/LngDemand/index.ts @@ -11,10 +11,117 @@ enum Api { ContractList ='/magic-api/dayPlan/queryContractList', StationList ='/magic-api/dayPlan/queryStationList', 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', } +export async function cancelLngDemand(id: String, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.cancel, + params: { id }, + }, + { + errorMessageMode: mode, + }, + ); +} +export async function submitLngDemand(ids: string[], mode: ErrorMessageMode = 'modal') { + return defHttp.post( + { + url: Api.submit, + data: ids, + }, + { + errorMessageMode: mode, + }, + ); +} +export async function withdrawLngDemand(ids: string[], mode: ErrorMessageMode = 'modal') { + return defHttp.post( + { + url: Api.withdraw, + data: ids, + }, + { + errorMessageMode: mode, + }, + ); +} +export async function getLngDemandCompare(orgId: String, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.compare, + params: { orgId }, + }, + { + errorMessageMode: mode, + }, + ); +} +export async function getLngDemanddUpdate(id: String, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.toChange, + params: { id }, + }, + { + errorMessageMode: mode, + }, + ); +} +export async function submitSaveLngDemand(lngLngDemand: Recordable, mode: ErrorMessageMode = 'modal') { + return defHttp.post( + { + url: Api.saveAndSubmit, + params: lngLngDemand, + }, + { + errorMessageMode: mode, + }, + ); +} +export async function getCategory(params, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.queryCategory, + params: params, + }, + { + errorMessageMode: mode, + }, + ); +} +export async function getAllPlaceLngUnload(params, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.AllPlaceLngUnload, + params: params, + }, + { + errorMessageMode: mode, + }, + ); +} +export async function carCheck(params, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.check, + params: params, + }, + { + errorMessageMode: mode, + }, + ); +} export async function getLngLngDemandStationList(params, mode: ErrorMessageMode = 'modal') { return defHttp.get( { diff --git a/src/components/common/placeLngUnloadModal.vue b/src/components/common/placeLngUnloadModal.vue new file mode 100644 index 0000000..671815f --- /dev/null +++ b/src/components/common/placeLngUnloadModal.vue @@ -0,0 +1,100 @@ + + + diff --git a/src/views/dayPlan/LngDemand/components/basicForm.vue b/src/views/dayPlan/LngDemand/components/basicForm.vue index abfa7b9..69ea28d 100644 --- a/src/views/dayPlan/LngDemand/components/basicForm.vue +++ b/src/views/dayPlan/LngDemand/components/basicForm.vue @@ -23,12 +23,12 @@ - + - + @@ -38,37 +38,37 @@ - + - + - + - + - + - + - + @@ -112,7 +112,13 @@ {{ formState.verNo }} - {{ formState.approName }} + + + + {{ item.name }} + + + @@ -129,7 +135,8 @@ - + + @@ -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; - } - } diff --git a/src/views/dayPlan/LngDemand/index.vue b/src/views/dayPlan/LngDemand/index.vue index 1bd8065..0888701 100644 --- a/src/views/dayPlan/LngDemand/index.vue +++ b/src/views/dayPlan/LngDemand/index.vue @@ -31,14 +31,12 @@ const logId = ref('') const logPath = ref('/dayPlan/lngDemand/datalog'); import { DataLog } from '/@/components/pcitc'; - import { ref, computed, onMounted, onUnmounted, createVNode, - -} from 'vue'; + import { ref, computed, onMounted, onUnmounted, createVNode, } from 'vue'; import { Modal } from 'ant-design-vue'; import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; 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 { useMessage } from '/@/hooks/web/useMessage'; 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":"flowRecord","icon":"ant-design:form-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":"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}]); //展示在列表内的按钮 - const actionButtons = ref(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord','compare','update','back','cancel']); + const actionButtons = ref(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord','compare','toChange','withdraw','cancel', 'submit']); const buttonConfigs = computed(()=>{ return filterButtonAuth(buttons.value); }) @@ -103,7 +101,7 @@ 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":"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":"export","icon":"ant-design:export-outlined","isDefault":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)); }); - 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 router = useRouter(); @@ -140,7 +138,7 @@ const [registerImportModal, { openModal: openImportModal }] = useModal(); const formName=currentRoute.value.meta?.title; - const [registerTable, { reload, }] = useTable({ + const [registerTable, { reload, clearSelectedRowKeys }] = useTable({ title: '' || (formName + '列表'), api: getLngLngDemandPage, rowKey: 'id', @@ -165,7 +163,7 @@ striped: false, actionColumn: { - width: 160, + width: 190, title: '操作', dataIndex: 'action', slots: { customRender: 'action' }, @@ -184,44 +182,21 @@ selectedKeys.value = rowKeys; } 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/LngDemand/' + record.id + '/viewForm', - query: { + router.push({ + path: '/dayPlan/LngDemand/createForm', + query: { formPath: 'dayPlan/LngDemand', - formName: formName, - formId:currentRoute.value.meta.formId - } - }); - } + formName: '查看'+formName, + formId:currentRoute.value.meta.formId, + id: record.id, + type: 'view' + } + }); } function buttonClick(code) { - btnEvent[code](); + btnEvent[code]('batch'); } function handleDatalog (record: Recordable) { modalVisible.value = true @@ -248,27 +223,79 @@ function handleEdit(record: Recordable) { router.push({ - path: '/form/LngDemand/' + record.id + '/updateForm', + path: '/dayPlan/LngDemand/createForm', query: { formPath: 'dayPlan/LngDemand', - formName: formName, - formId:currentRoute.value.meta.formId + formName: '编辑'+formName, + 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) { - await cancelLngPng(record.id) + await cancelLngDemand(record.id) handleSuccess(); notification.success({ message: '提示', 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) { deleteList([record.id]); @@ -296,7 +323,7 @@ reload(); } function handleSuccess() { - + clearSelectedRowKeys() reload(); } @@ -347,39 +374,80 @@ function getActions(record: Recordable):ActionItem[] { let actionsList: ActionItem[] = []; - let editAndDelBtn: ActionItem[] = []; - let hasFlowRecord = false; + let editBtn: ActionItem[] = []; + let delBtn: ActionItem[] = []; + let updateBtn: ActionItem[] = []; + let backBtn: ActionItem[] = []; + let hasFlowRecord = false; + let viewBtn: ActionItem[]=[] actionButtonConfig.value?.map((button) => { - if (['view', 'copyData'].includes(button.code)) { - actionsList.push({ + if (['view', 'copyData','compare', 'datalog'].includes(button.code)) { + viewBtn.push({ icon: button?.icon, tooltip: button?.name, onClick: btnEvent[button.code].bind(null, record), }); } - if (['edit', 'delete'].includes(button.code)) { - editAndDelBtn.push({ + if (['edit'].includes(button.code)) { + editBtn.push({ icon: button?.icon, tooltip: button?.name, color: button.code === 'delete' ? 'error' : undefined, 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 (record.workflowData?.enabled) { - //与工作流有关联的表单 - if (record.workflowData.status) { - actionsList.unshift(setIndexFlowStatus(record.workflowData)) - } else { - actionsList = actionsList.concat(editAndDelBtn); + if (record.approCode == 'YSP' && record.alterSign!='D') { + actionsList = actionsList.concat(updateBtn); } - } else { - if (!record.workflowData?.processId) { - //与工作流没有关联的表单并且在当前页面新增的数据 如选择编辑、删除按钮则加上 - actionsList = actionsList.concat(editAndDelBtn); + // || record.approCode == 'YBH' + if ((record.approCode == 'WTJ'|| record.approCode == 'YBH') && record.alterSign!='D' ) { + actionsList = actionsList.concat(editBtn); } - } + 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; } function handleStartwork(record: Recordable) { diff --git a/src/views/dayPlan/LngMeasureSales/index.vue b/src/views/dayPlan/LngMeasureSales/index.vue index e0fc33b..b1d2765 100644 --- a/src/views/dayPlan/LngMeasureSales/index.vue +++ b/src/views/dayPlan/LngMeasureSales/index.vue @@ -259,13 +259,7 @@ } else { selectedRowsData.value= [{...val}] } - await cancelLngLngMeasure(selectedRowsData.value) - handleSuccess(); - notification.success({ - message: '提示', - description: t('取消成功!'), - }); - clearSelectedRowKeys() + fieldCheck('cancel') } async function handleSubmit(val) { if (val=='batch') { @@ -279,14 +273,7 @@ } else { selectedRowsData.value= [{...val}] } - - await updateLngLngMeasure(selectedRowsData.value) - handleSuccess(); - notification.success({ - message: '提示', - description: t('确认成功!'), - }); - clearSelectedRowKeys() + fieldCheck('submit') } async function handleSave(val) { if (val=='batch') { @@ -300,18 +287,43 @@ } else { selectedRowsData.value= [{...val}] } - selectedRowsData.value.forEach(v=> { - 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 - }) - await addLngLngMeasure(selectedRowsData.value) + fieldCheck('save') + + } + const fieldCheck = async (type) => { + for(let i = 0; i