From d7bdcc480ccbfc1ed4f5aa5142526fa2ea9f6892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98huanghaiixia=E2=80=99?= <980486410@.com> Date: Tue, 17 Mar 2026 16:38:09 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=AE=A1=E9=87=8F=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dayPlan/LngMeasureSales/components/config.ts | 4 ++-- .../LngMeasureSales/components/createFormModal.vue | 2 +- src/views/dayPlan/LngMeasureSales/index.vue | 14 ++++++++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/views/dayPlan/LngMeasureSales/components/config.ts b/src/views/dayPlan/LngMeasureSales/components/config.ts index 8d5b763..01ef5f0 100644 --- a/src/views/dayPlan/LngMeasureSales/components/config.ts +++ b/src/views/dayPlan/LngMeasureSales/components/config.ts @@ -102,7 +102,7 @@ export const columns: BasicColumn[] = [ title: '进厂皮重时间', componentType: 'input', align: 'left', - + width: 200, sorter: true, }, @@ -111,7 +111,7 @@ export const columns: BasicColumn[] = [ title: '出厂毛重时间', componentType: 'input', align: 'left', - + width: 200, sorter: true, }, diff --git a/src/views/dayPlan/LngMeasureSales/components/createFormModal.vue b/src/views/dayPlan/LngMeasureSales/components/createFormModal.vue index 8364dcd..2dda3c5 100644 --- a/src/views/dayPlan/LngMeasureSales/components/createFormModal.vue +++ b/src/views/dayPlan/LngMeasureSales/components/createFormModal.vue @@ -146,7 +146,7 @@ width: 120, }, { - dataIndex: 'suName', + dataIndex: 'suSname', title: '供应商', componentType: 'input', align: 'left', diff --git a/src/views/dayPlan/LngMeasureSales/index.vue b/src/views/dayPlan/LngMeasureSales/index.vue index 5c637e9..00ceebc 100644 --- a/src/views/dayPlan/LngMeasureSales/index.vue +++ b/src/views/dayPlan/LngMeasureSales/index.vue @@ -14,7 +14,7 @@ - @@ -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