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/api/dayPlan/LngMeasurePur/index.ts b/src/api/dayPlan/LngMeasurePur/index.ts index 3e64e23..f9abccf 100644 --- a/src/api/dayPlan/LngMeasurePur/index.ts +++ b/src/api/dayPlan/LngMeasurePur/index.ts @@ -3,17 +3,52 @@ import { defHttp } from '/@/utils/http/axios'; import { ErrorMessageMode } from '/#/axios'; enum Api { - Page = '/dayPlan/lngMeasurePur/page', + // Page = '/dayPlan/lngMeasurePur/page', + Page = '/magic-api/dayPlan/lngMeasurePurPageList', List = '/dayPlan/lngMeasurePur/list', Info = '/dayPlan/lngMeasurePur/info', LngLngMeasure = '/dayPlan/lngMeasurePur', - + submit = '/dayPlan/lngMeasurePur/submit', + Cancel = '/dayPlan/lngMeasurePur/cancel', + Reject = '/dayPlan/lngMeasurePur/reject', DataLog = '/dayPlan/lngMeasurePur/datalog', } - +export async function rejectlLngLngMeasurePur(lngLngMeasure: Recordable, mode: ErrorMessageMode = 'modal') { + return defHttp.post( + { + url: Api.Reject, + params: lngLngMeasure, + }, + { + errorMessageMode: mode, + }, + ); +} +export async function submitLngLngMeasurePur(lngLngMeasure: Recordable, mode: ErrorMessageMode = 'modal') { + return defHttp.post( + { + url: Api.submit, + params: lngLngMeasure, + }, + { + errorMessageMode: mode, + }, + ); +} +export async function cancelLngLngMeasurePur(lngLngMeasure: Recordable, mode: ErrorMessageMode = 'modal') { + return defHttp.post( + { + url: Api.Cancel, + params: lngLngMeasure, + }, + { + errorMessageMode: mode, + }, + ); +} /** * @description: 查询LngLngMeasure分页列表 */ 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/components/common/rejectReplyModal.vue b/src/components/common/rejectReplyModal.vue index cb25c2f..b5b9451 100644 --- a/src/components/common/rejectReplyModal.vue +++ b/src/components/common/rejectReplyModal.vue @@ -47,6 +47,7 @@ const props = defineProps({ () => props.visible, (val) => { isOpen.value = val + formRef.value && formRef.value.resetFields(); }, { immediate: true, @@ -56,12 +57,13 @@ const props = defineProps({ const handleCancel = () => { formRef.value.resetFields(); isOpen.value = false + emit('cancel'); } const handleSubmit = async () => { try { await formRef.value.validate(); emit('success', formState); - formRef.value.resetFields(); + // formRef.value.resetFields(); } catch (error) { console.log('验证失败:', error); } 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/LngMeasurePur/components/config.ts b/src/views/dayPlan/LngMeasurePur/components/config.ts index f80098e..1e4c8a4 100644 --- a/src/views/dayPlan/LngMeasurePur/components/config.ts +++ b/src/views/dayPlan/LngMeasurePur/components/config.ts @@ -63,7 +63,7 @@ export const columns: BasicColumn[] = [ title: '计划日期', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -72,7 +72,7 @@ export const columns: BasicColumn[] = [ title: '客户简称', componentType: 'input', align: 'left', - + width: 150, sorter: true, }, @@ -81,7 +81,7 @@ export const columns: BasicColumn[] = [ title: '气源地', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -90,7 +90,7 @@ export const columns: BasicColumn[] = [ title: '车头号', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -99,7 +99,7 @@ export const columns: BasicColumn[] = [ title: '挂车号', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -108,7 +108,7 @@ export const columns: BasicColumn[] = [ title: '装车量(吨)', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -117,7 +117,7 @@ export const columns: BasicColumn[] = [ title: '装车量(吉焦)', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -126,7 +126,7 @@ export const columns: BasicColumn[] = [ title: '装车量(方)', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -135,7 +135,7 @@ export const columns: BasicColumn[] = [ title: '进厂皮重时间', componentType: 'input', align: 'left', - + width: 180, sorter: true, }, @@ -144,7 +144,7 @@ export const columns: BasicColumn[] = [ title: '出厂毛重时间', componentType: 'input', align: 'left', - + width: 180, sorter: true, }, @@ -153,7 +153,7 @@ export const columns: BasicColumn[] = [ title: '客户确认人', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -162,7 +162,7 @@ export const columns: BasicColumn[] = [ title: '客户确认时间', componentType: 'input', align: 'left', - + width: 180, sorter: true, }, @@ -171,7 +171,7 @@ export const columns: BasicColumn[] = [ title: '内部确认人', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -180,7 +180,7 @@ export const columns: BasicColumn[] = [ title: '内部确认时间', componentType: 'input', align: 'left', - + width: 180, sorter: true, }, @@ -189,7 +189,7 @@ export const columns: BasicColumn[] = [ title: '销售合同', componentType: 'input', align: 'left', - + width: 180, sorter: true, }, @@ -198,7 +198,7 @@ export const columns: BasicColumn[] = [ title: '供应商', componentType: 'input', align: 'left', - + width: 180, sorter: true, }, @@ -207,7 +207,7 @@ export const columns: BasicColumn[] = [ title: '附件', componentType: 'input', align: 'left', - + width: 200, sorter: true, }, @@ -216,7 +216,7 @@ export const columns: BasicColumn[] = [ title: '状态', componentType: 'input', align: 'left', - + width: 100, sorter: true, }, @@ -225,7 +225,7 @@ export const columns: BasicColumn[] = [ title: '驳回意见', componentType: 'input', align: 'left', - + width: 130, sorter: true, }, ]; diff --git a/src/views/dayPlan/LngMeasurePur/index.vue b/src/views/dayPlan/LngMeasurePur/index.vue index 3824015..04c476d 100644 --- a/src/views/dayPlan/LngMeasurePur/index.vue +++ b/src/views/dayPlan/LngMeasurePur/index.vue @@ -27,7 +27,7 @@ - + - \ No newline at end of file diff --git a/src/views/dayPlan/PngApproGd/index.vue b/src/views/dayPlan/PngApproGd/index.vue index e396964..6fe8395 100644 --- a/src/views/dayPlan/PngApproGd/index.vue +++ b/src/views/dayPlan/PngApproGd/index.vue @@ -34,7 +34,7 @@ - +