From fa365d77dfa1d6619774a790e424e98dac849457 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周三, 21 5月 2025 16:36:51 +0800 Subject: [PATCH] 修复bug --- PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssembly.ts | 94 ++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 81 insertions(+), 13 deletions(-) diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssembly.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssembly.ts index 1c9df89..0b661fd 100644 --- a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssembly.ts +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssembly.ts @@ -1,6 +1,6 @@ import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' import { injectModel } from '@/libs/Provider/Provider' -import { WmsMaterialContainer } from '../Models/PipeAccessoryAssembly' +import { PipeAccessoryAssembly } from '../Models/PipeAccessoryAssembly' import { ElMessage } from 'element-plus' import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' import { useFile } from './File' @@ -9,8 +9,8 @@ row: any index: number } -export const useWmsMaterialContainer = (props: any, ctx?: any) => { - const wmsMaterialContainer = injectModel<WmsMaterialContainer>('wmsMaterialContainer') +export const usePipeAccessoryAssembly = (props: any, ctx?: any) => { + const PipeAccessoryAssembly = injectModel<PipeAccessoryAssembly>('PipeAccessoryAssembly') const { exportFile } = useFile() /** * 澶撮儴閰嶇疆 @@ -19,7 +19,7 @@ /** * 鍔ㄦ�佸垪閰嶇疆 */ - const wmsMaterialContainerColumns = ref<Record<string, any>>([]) + const PipeAccessoryAssemblyColumns = ref<Record<string, any>>([]) /** * 鎼滅储鍊� */ @@ -118,7 +118,7 @@ // { // label: '鍒涘缓鍓湰', // fn: async ({ row }: CurrentType) => { - // await wmsMaterialContainer.cloneData([row.id]) + // await PipeAccessoryAssembly.cloneData([row.id]) // ElMessage.success('鍒涘缓鍓湰鎴愬姛') // tableRef.value?.getList() // }, @@ -133,7 +133,7 @@ `鏄惁鍒犻櫎${names.length ? names.join(',') : c.row.materialId}` ).then(async () => { const ids = selection.value.map((item: { id: string }) => item.id) - await wmsMaterialContainer.deleteWmsMaterialContainers(ids.length ? ids : [c.row.id]) + await PipeAccessoryAssembly.deletePipeAccessoryAssemblys(ids.length ? ids : [c.row.id]) ElMessage.success('鍒犻櫎鎴愬姛') tableRef.value.getList() }) @@ -142,11 +142,77 @@ }, ] + + //涓嬪彂娉曞叞鍐茬爜 + const onSendFlangeCode = () => { + const names = selection.value.map((item: { dataIdentifier: string }) => item.dataIdentifier) + if(names.length==0){ + ElMessage.warning('璇烽�夋嫨涓�鏉¤褰�'); + return; + } + if(names.length>1){ + ElMessage.warning('璇峰彧鑳介�夋嫨涓�鏉¤褰�'); + return; + } + ConfirmBox( + `鏄惁瑕佷笅鍙戞硶鍏板啿鐮�${names.length ? names.join(',') : ''}` + ).then(async () => { + // 鑾峰彇閫変腑鐨勭涓�鏉¤褰� + const selectedItem = selection.value[0]; + + // 鏋勫缓鍙傛暟瀵硅薄 + const param = { + Son_TaskCode: selectedItem.son_TaskCode || '', // 瀛愪换鍔$紪鍙� + TaskCode: selectedItem.taskCode || '', // 浠诲姟缂栧彿 + PipeSpecCode: selectedItem.pipeSpecCode || '',// 绠℃缂栫爜 + }; + + var ret= await PipeAccessoryAssembly.sendFlangeCode(param) + if(ret.code=="200"){ + ElMessage.success('涓嬪彂鎴愬姛') + tableRef.value.getList() + }else{ + ElMessage.error('涓嬪彂澶辫触:'+ret.message) + } + }) + } + //娉曞叞鍐茬爜瀹屽伐 + const onFinishSendFlangeCode = () => { + const names = selection.value.map((item: { dataIdentifier: string }) => item.dataIdentifier) + if(names.length==0){ + ElMessage.warning('璇烽�夋嫨涓�鏉¤褰�'); + return; + } + if(names.length>1){ + ElMessage.warning('璇峰彧鑳介�夋嫨涓�鏉¤褰�'); + return; + } + ConfirmBox( + `鏄惁瑕佸畬宸ユ硶鍏板啿鐮�${names.length ? names.join(',') : ''}` + ).then(async () => { + // 鑾峰彇閫変腑鐨勭涓�鏉¤褰� + const selectedItem = selection.value[0]; + + // 鏋勫缓鍙傛暟瀵硅薄 + const param = { + processName: selectedItem.processName || '', // 浠诲姟缂栧彿 + PipeSpecCode: selectedItem.pipeSpecCode || '',// 绠℃缂栫爜 + }; + + var ret= await PipeAccessoryAssembly.finishSendFlangeCode(param) + if(ret.code=="200"){ + ElMessage.success('瀹屽伐娉曞叞鍐茬爜鎴愬姛') + tableRef.value.getList() + }else{ + ElMessage.error('瀹屽伐娉曞叞鍐茬爜澶辫触:'+ret.message) + } + }) + } const onCheck = (records: any) => { selection.value = records } - const onAddWmsMaterialContainer = () => { + const onAddPipeAccessoryAssembly = () => { const params = tableRef.value?.getPaginationParams() current.value = null dialogConfig.visible = true @@ -164,7 +230,7 @@ dialogConfigForQuery.title = '楂樼骇鏌ヨ' } - const onConfirmWmsMaterialContainer = async () => { + const onConfirmPipeAccessoryAssembly = async () => { dialogConfig.visible = false if (dialogConfig.isAdd) { tableRef.value?.scrollToRow({ @@ -187,7 +253,7 @@ */ const onExport = (data={}) => { //const params = tableRef.value?.getParams() - exportFile('/api/v1/HIAWms/wmsMaterialContainer/export', data, 'wmsMaterialContainer') + exportFile('/api/v1/HIAWms/PipeAccessoryAssembly/export', data, 'PipeAccessoryAssembly') } /** @@ -257,7 +323,7 @@ current, search, sort, - wmsMaterialContainerColumns, + PipeAccessoryAssemblyColumns, paginationParams, headers, onBeforeUpload, @@ -267,9 +333,11 @@ onSearch, onExport, onRowClick, - onConfirmWmsMaterialContainer, + onConfirmPipeAccessoryAssembly, onCheck, - onAddWmsMaterialContainer, - onAdvancedQuery + onAddPipeAccessoryAssembly, + onAdvancedQuery, + onSendFlangeCode, + onFinishSendFlangeCode } } -- Gitblit v1.9.3