Merge branch 'master' of http://222.71.245.114:9086/r/HIA24016N_PipeLineDemo
| | |
| | | {} |
| | | { |
| | | "i18n-ally.localesPaths": [ |
| | | "public/language", |
| | | "src/libs/Language/i18n" |
| | | ] |
| | | } |
| | |
| | | Dialog: typeof import('./src/components/Dialog/index.vue')['default'] |
| | | ElButton: typeof import('element-plus/es')['ElButton'] |
| | | ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] |
| | | ElCollapse: typeof import('element-plus/es')['ElCollapse'] |
| | | ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem'] |
| | | ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] |
| | | ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] |
| | | ElDialog: typeof import('element-plus/es')['ElDialog'] |
| | |
| | | ElPopover: typeof import('element-plus/es')['ElPopover'] |
| | | ElRadio: typeof import('element-plus/es')['ElRadio'] |
| | | ElSelect: typeof import('element-plus/es')['ElSelect'] |
| | | ElSwitch: typeof import('element-plus/es')['ElSwitch'] |
| | | ElTabPane: typeof import('element-plus/es')['ElTabPane'] |
| | | ElTabs: typeof import('element-plus/es')['ElTabs'] |
| | | ElTag: typeof import('element-plus/es')['ElTag'] |
| | |
| | | /// </summary> |
| | | public class QueryTaskTypeInput |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å |
| | | /// </summary> |
| | | public TaskTypeEnum TaskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
¥åºå£æè´§ |
| | | /// </summary> |
| | | public bool InStockHasGood { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºå£æè´§ |
| | | /// </summary> |
| | | public bool OutStockHasGood { get; set; } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¸å宿çä»»å¡å
¥å. |
| | | /// </summary> |
| | | public class ExcecuteTaskInput |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | public string TaskNo { get; set;} |
| | | } |
| | | } |
| | |
| | | { |
| | | get |
| | | { |
| | | if (TaskType == 0) return ""; |
| | | return GetEnumDescriptionUtil.GetEnumDescription(TaskType); |
| | | } |
| | | } |
| | |
| | | { |
| | | get |
| | | { |
| | | if (TaskStatus == 0) return ""; |
| | | return GetEnumDescriptionUtil.GetEnumDescription(TaskStatus); |
| | | } |
| | | } |
| | |
| | | { |
| | | get |
| | | { |
| | | if (Dodevicetype == 0) return ""; |
| | | return GetEnumDescriptionUtil.GetEnumDescription(Dodevicetype); |
| | | } |
| | | } |
| | |
| | | { |
| | | get |
| | | { |
| | | if (TaskDodeviceStatus == 0) return ""; |
| | | return GetEnumDescriptionUtil.GetEnumDescription(TaskDodeviceStatus); |
| | | } |
| | | } |
| | |
| | | { |
| | | get |
| | | { |
| | | if (SonTaskType == 0 || !SonTaskType.HasValue) return ""; |
| | | return GetEnumDescriptionUtil.GetEnumDescription(SonTaskType); |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | Task FinishTaskAsync(WmsTaskStatusDto input); |
| | | Task<WmsTaskDto> FinishTaskAsync(WmsTaskStatusDto input); |
| | | |
| | | /// <summary> |
| | | /// åæ¶ä»»å¡ |
| | |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | Task<WmsTaskDto> GetToExecuteTaskAsync(QueryTaskTypeInput input); |
| | | |
| | | /// <summary> |
| | | /// æ´æ°ä»»å¡ä¸ºæ§è¡ä¸ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | Task<WmsTaskDto> StartExecuteTaskAsync(ExcecuteTaskInput input); |
| | | } |
| | |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public async Task FinishTaskAsync(WmsTaskStatusDto input) |
| | | public async Task<WmsTaskDto> FinishTaskAsync(WmsTaskStatusDto input) |
| | | { |
| | | if (string.IsNullOrEmpty(input.TaskNo)) |
| | | { |
| | | throw new UserFriendlyException("ä»»å¡å·ä¸è½ä¸ºç©º"); |
| | | } |
| | | using var scope = _serviceProvider.CreateScope(); |
| | | var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); |
| | | using var uow = unitOfWorkManager.Begin(requiresNew: true); |
| | |
| | | |
| | | await uow.SaveChangesAsync(); |
| | | await uow.CompleteAsync(); |
| | | |
| | | return ObjectMapper.Map<WmsTask, WmsTaskDto>(task); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public async Task CancelTaskAysnc(WmsTaskStatusDto input) |
| | | { |
| | | |
| | | if (string.IsNullOrEmpty(input.TaskNo)) |
| | | { |
| | | throw new UserFriendlyException("ä»»å¡å·ä¸è½ä¸ºç©º"); |
| | | } |
| | | using var scope = _serviceProvider.CreateScope(); |
| | | var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); |
| | | using var uow = unitOfWorkManager.Begin(requiresNew: true); |
| | |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public async Task ChangeTaskToPlaceAsync(ChangeTaskToPlaceInput input) |
| | | { |
| | | |
| | | if (string.IsNullOrEmpty(input.TaskNo)) |
| | | { |
| | | throw new UserFriendlyException("ä»»å¡å·ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | var task = await wmsTaskRepository.FindByNameAsync(input.TaskNo); |
| | | if (task == null) |
| | | { |
| | |
| | | var whereConditions = DynamicGetQueryParams(queryInput); |
| | | |
| | | var NoStartTaskList = await wmsTaskRepository.GetTaskListAsync(whereConditions); |
| | | |
| | | |
| | | if(NoStartTaskList.Count<=0) return null; |
| | | |
| | | var executeTask = NoStartTaskList.FirstOrDefault(x=>x.TaskType == input.TaskType); |
| | | var executeTaskList = NoStartTaskList.WhereIf(input.TaskType > 0, x => x.TaskType == input.TaskType).OrderBy(x => x.TaskType).ThenBy(x => x.TaskLevel).ToList(); |
| | | |
| | | var executeTask = executeTaskList.FirstOrDefault(); |
| | | if (input.OutStockHasGood) |
| | | { |
| | | executeTask = NoStartTaskList.OrderByDescending(x => x.TaskType == TaskTypeEnum.RUKU).ThenBy(x => x.TaskLevel).FirstOrDefault(); |
| | | } |
| | | |
| | | if(executeTask == null) |
| | | { |
| | | return ObjectMapper.Map<WmsTask, WmsTaskDto>(NoStartTaskList.FirstOrDefault()); |
| | | } |
| | | |
| | | if (executeTask.TaskType == TaskTypeEnum.CHUKU && input.OutStockHasGood) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | if(executeTask.TaskType == TaskTypeEnum.RUKU && !input.InStockHasGood) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | return ObjectMapper.Map<WmsTask, WmsTaskDto>(executeTask); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ´æ°ä»»å¡ä¸ºæ§è¡ä¸ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<WmsTaskDto> StartExecuteTaskAsync(ExcecuteTaskInput input) |
| | | { |
| | | if (string.IsNullOrEmpty(input.TaskNo)) |
| | | { |
| | | throw new UserFriendlyException("ä»»å¡å·ä¸è½ä¸ºç©º"); |
| | | } |
| | | var task = await wmsTaskRepository.FindByNameAsync(input.TaskNo); |
| | | if(task == null) |
| | | { |
| | | return null; |
| | | } |
| | | task.TaskStatus = WmsTaskStatus.ZHIXINGZHONG; |
| | | task.TaskDodeviceStatus = TaskDodeviceStatus.SrmProgress; |
| | | await wmsTaskRepository.UpdateAsync(task); |
| | | return ObjectMapper.Map<WmsTask, WmsTaskDto>(task); |
| | | } |
| | | } |
| | |
| | | </PropertyGroup> |
| | | |
| | | <PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))"> |
| | | <CMSRootPath>D:\syc\CMS Editor</CMSRootPath> |
| | | <CMSRootPath>E:\syc_cms\CMS Editor</CMSRootPath> |
| | | <OutputPath>$(CMSRootPath)\plugins\cms.plugin.hiawms</OutputPath> |
| | | </PropertyGroup> |
| | | |
| | |
| | | using CMS.Extensions.Abp.AspNetCore.Mvc.Filters; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.CommonDto; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterialStocks; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using CmsQueryExtensions.Entitys; |
| | | using Microsoft.AspNetCore.Mvc; |
| | |
| | | public class LMesOperateController : ControllerBase |
| | | { |
| | | private readonly ILMesOperateAppService _mesOperateAppService; |
| | | private readonly IWmsMaterialStockAppService _wmsmaterialstockAppService; |
| | | |
| | | public LMesOperateController(ILMesOperateAppService mesOperateAppService) |
| | | public LMesOperateController(ILMesOperateAppService mesOperateAppService, IWmsMaterialStockAppService wmsmaterialstockAppService) |
| | | { |
| | | _mesOperateAppService = mesOperateAppService; |
| | | _wmsmaterialstockAppService = wmsmaterialstockAppService; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// LMesç»ç |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("LMesââPalletizingââ")] |
| | | public async Task<CmsApiResponse<WmsMaterialStockDto>> LMesââPalletizingââAsync(WmsMaterialStockCreateDto input) |
| | | { |
| | | try |
| | | { |
| | | var list = await _wmsmaterialstockAppService.CreateAsync(input); |
| | | return new CmsApiResponse<WmsMaterialStockDto>() |
| | | { |
| | | Data = list, |
| | | Code = 200, |
| | | Message = "LMesç»çæå" |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | //throw; //ä¸è¦æåºå¼å¸¸ï¼å¦å对æ¹ä¼æ¥æ¶å¤±è´¥å¢ |
| | | return new CmsApiResponse<WmsMaterialStockDto>() |
| | | { |
| | | Data = null, |
| | | Code = 500, |
| | | Message = ex.Message |
| | | }; |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("FinishTask")] |
| | | public async Task FinishTaskAsync(WmsTaskStatusDto input) |
| | | public async Task<WmsTaskDto> FinishTaskAsync(WmsTaskStatusDto input) |
| | | { |
| | | await _wmsTaskAppService.FinishTaskAsync(input); |
| | | return await _wmsTaskAppService.FinishTaskAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("ToExecuteTask")] |
| | | [Route("GetExecuteTask")] |
| | | public async Task<WmsTaskDto> GetToExecuteTaskAsync(QueryTaskTypeInput input) |
| | | { |
| | | return await _wmsTaskAppService.GetToExecuteTaskAsync(input); |
| | | } |
| | | /// <summary> |
| | | /// æ´æ°ä»»å¡ä¸ºæ§è¡ä¸ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("ToExecuteTask")] |
| | | public async Task<WmsTaskDto> StartExecuteTaskAsync(ExcecuteTaskInput input) |
| | | { |
| | | return await _wmsTaskAppService.StartExecuteTaskAsync(input); |
| | | } |
| | | } |
| | | } |
| | |
| | | "notPage": false |
| | | }, |
| | | { |
| | | "name": "管éä»¶çæ¥", |
| | | "path": "/information-base/PipeAccessoryWeld", |
| | | "patchName": "PipeAccessoryWeld", |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | | { |
| | | "name": "忣", |
| | | "path": "/information-base/PipeAccessoryPick", |
| | | "patchName": "PipeAccessoryPick", |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | | { |
| | | "name": "管éä»¶è£
é
", |
| | | "path": "/information-base/PipeAccessoryAssembly", |
| | | "patchName": "PipeAccessoryAssembly", |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | | { |
| | | "name": "å·¥å管ç(æ°)", |
| | | "path": "/information-base/OrderManagement-main", |
| | | "patchName": "OrderManagement-main", |
| | |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | | "PipeAccessoryWeld": { |
| | | "name": "管éä»¶çæ¥", |
| | | "path": "/information-base/PipeAccessoryWeld", |
| | | "patchName": "PipeAccessoryWeld", |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | | "PipeAccessoryPick": { |
| | | "name": "忣", |
| | | "path": "/information-base/PipeAccessoryPick", |
| | | "patchName": "PipeAccessoryPick", |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | | "PipeAccessoryAssembly": { |
| | | "name": "管éä»¶è£
é
", |
| | | "path": "/information-base/PipeAccessoryAssembly", |
| | | "patchName": "PipeAccessoryAssembly", |
| | | "icon": "p", |
| | | "notPage": false |
| | | }, |
| | | "OrderManagement-main": { |
| | | "name": "å·¥å管ç(æ°)", |
| | | "path": "/information-base/OrderManagement-main", |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { importFileToService, exportFileToClient } from '@/api/file' |
| | | import { ElMessage } from 'element-plus' |
| | | import { downloadFile } from '@/utils' |
| | | import dayjs from 'dayjs' |
| | | |
| | | export const useFile = () => { |
| | | /** |
| | | * 导å
¥æä»¶ |
| | | * @param url |
| | | */ |
| | | const importFile = async (url: string, file: File) => { |
| | | const formData = new FormData() |
| | | formData.append('file', file) |
| | | await importFileToService(url, formData) |
| | | ElMessage('导å
¥æå') |
| | | } |
| | | /** |
| | | * å¯¼åºæä»¶ |
| | | * @param url |
| | | */ |
| | | const exportFile = async (url: string, params: any, name: string) => { |
| | | const res = await exportFileToClient(url, params) |
| | | downloadFile(res, `${name}_${dayjs().format('YYYYMMDDHHMMss')}.xlsx`) |
| | | ElMessage.success('å¯¼åºæå') |
| | | } |
| | | |
| | | return { |
| | | importFile, |
| | | exportFile, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { WmsMaterialContainer } from '../Models/PipeAccessoryAssembly' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { useFile } from './File' |
| | | |
| | | interface CurrentType { |
| | | row: any |
| | | index: number |
| | | } |
| | | export const useWmsMaterialContainer = (props: any, ctx?: any) => { |
| | | const wmsMaterialContainer = injectModel<WmsMaterialContainer>('wmsMaterialContainer') |
| | | const { exportFile } = useFile() |
| | | /** |
| | | * 头é¨é
ç½® |
| | | */ |
| | | const headers = ref({}) |
| | | /** |
| | | * 卿åé
ç½® |
| | | */ |
| | | const wmsMaterialContainerColumns = ref<Record<string, any>>([]) |
| | | /** |
| | | * æç´¢å¼ |
| | | */ |
| | | const search = ref('') |
| | | |
| | | /** |
| | | * æåº |
| | | */ |
| | | const sort = ref(0) |
| | | /** |
| | | * 鿩项 |
| | | */ |
| | | const selection = ref([]) |
| | | /** |
| | | * å½åéä¸çè¡ |
| | | */ |
| | | const current = ref<any>(null) |
| | | /** |
| | | * æ°æ®æº |
| | | */ |
| | | const dataSource: Ref<any[]> = ref([]) |
| | | |
| | | /** |
| | | * è¡¨æ ¼ |
| | | */ |
| | | const tableRef = ref() |
| | | const dialogConfig = reactive({ |
| | | visible: false, |
| | | title: '', |
| | | isAdd: false, |
| | | }) |
| | | const dialogConfigForQuery = reactive({ |
| | | visible: false, |
| | | title: '', |
| | | isAdd: false, |
| | | }) |
| | | |
| | | |
| | | const dialogSettingConfig = reactive({ |
| | | visible: false, |
| | | title: '', |
| | | }) |
| | | |
| | | /** |
| | | * åé¡µæ°æ® |
| | | */ |
| | | const paginationParams = ref({}) |
| | | |
| | | /** |
| | | * æå¼è¯¦æ
|
| | | * @param row |
| | | */ |
| | | const openDetail = (row: any) => { |
| | | current.value = row |
| | | dialogConfig.visible = true |
| | | dialogConfig.title = row.name |
| | | dialogConfig.isAdd = false |
| | | sort.value = row.sort |
| | | } |
| | | |
| | | const contextMenu = [ |
| | | { |
| | | label: 'å±å¼è¯¦æ
', |
| | | fn: (c: CurrentType) => { |
| | | current.value = null |
| | | sort.value = c.row.sort |
| | | nextTick(() => openDetail(c.row)) |
| | | }, |
| | | divided: true, |
| | | icon: 'o', |
| | | }, |
| | | // { |
| | | // label: 'å䏿·»å ', |
| | | // fn: (c: CurrentType, pageNum: number) => { |
| | | // current.value = null |
| | | // sort.value = c.index + 1 + (pageNum - 1) * 50 |
| | | // dialogConfig.visible = true |
| | | // dialogConfig.title = 'æ·»å ' |
| | | // dialogConfig.isAdd = false |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'up', |
| | | // }, |
| | | // { |
| | | // label: 'å䏿·»å ', |
| | | // fn: (c: CurrentType, pageNum: number) => { |
| | | // current.value = null |
| | | // sort.value = c.index + 2 + (pageNum - 1) * 50 |
| | | // dialogConfig.visible = true |
| | | // dialogConfig.title = 'æ·»å ' |
| | | // dialogConfig.isAdd = false |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'down', |
| | | // }, |
| | | // { |
| | | // label: 'åå»ºå¯æ¬', |
| | | // fn: async ({ row }: CurrentType) => { |
| | | // await wmsMaterialContainer.cloneData([row.id]) |
| | | // ElMessage.success('åå»ºå¯æ¬æå') |
| | | // tableRef.value?.getList() |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'copy', |
| | | // }, |
| | | { |
| | | label: 'å é¤', |
| | | fn: async (c: CurrentType) => { |
| | | const names = selection.value.map((item: { materialId: string }) => item.materialId) |
| | | ConfirmBox( |
| | | `æ¯å¦å é¤${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]) |
| | | ElMessage.success('å 餿å') |
| | | tableRef.value.getList() |
| | | }) |
| | | }, |
| | | icon: 'close', |
| | | }, |
| | | ] |
| | | |
| | | const onCheck = (records: any) => { |
| | | selection.value = records |
| | | } |
| | | |
| | | const onAddWmsMaterialContainer = () => { |
| | | const params = tableRef.value?.getPaginationParams() |
| | | current.value = null |
| | | dialogConfig.visible = true |
| | | dialogConfig.isAdd = true |
| | | dialogConfig.title = 'æ·»å ' |
| | | sort.value = params.totalCount + 1 |
| | | } |
| | | |
| | | //ç¹å»æé®ãé«çº§æ¥è¯¢ã |
| | | const onAdvancedQuery = () => { |
| | | const params = tableRef.value?.getPaginationParams() |
| | | current.value = null |
| | | dialogConfigForQuery.visible = true |
| | | dialogConfigForQuery.isAdd = true |
| | | dialogConfigForQuery.title = 'é«çº§æ¥è¯¢' |
| | | } |
| | | |
| | | const onConfirmWmsMaterialContainer = async () => { |
| | | dialogConfig.visible = false |
| | | if (dialogConfig.isAdd) { |
| | | tableRef.value?.scrollToRow({ |
| | | skip: true, |
| | | }) |
| | | } else { |
| | | await tableRef.value?.getList() |
| | | } |
| | | } |
| | | /** |
| | | * è¡ç¹å»æ¶æ´æ°current |
| | | */ |
| | | const onRowClick = ({ row }: any) => { |
| | | if (dialogConfig.visible && current.value) { |
| | | current.value = row |
| | | } |
| | | } |
| | | /** |
| | | * å¯¼åº |
| | | */ |
| | | const onExport = (data={}) => { |
| | | //const params = tableRef.value?.getParams() |
| | | exportFile('/api/v1/HIAWms/wmsMaterialContainer/export', data, 'wmsMaterialContainer') |
| | | } |
| | | |
| | | /** |
| | | * å
³é®åæç´¢ |
| | | */ |
| | | const onSearch = () => { |
| | | tableRef.value?.getList({ |
| | | Filter: search.value, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * éç½®è¡¨æ ¼æ°æ® |
| | | */ |
| | | const reloadList = () => { |
| | | tableRef.value?.getList() |
| | | } |
| | | /** |
| | | * ä¸ä¼ æå |
| | | */ |
| | | const onSuccess = () => { |
| | | tableRef.value?.getList() |
| | | ElMessage.success('导å
¥æå') |
| | | } |
| | | /** |
| | | * 失败 |
| | | * @param err |
| | | */ |
| | | const onError = (err: any) => { |
| | | try { |
| | | const message = JSON.parse(err.message) |
| | | ElMessage.error(message.msg) |
| | | } catch (error) { |
| | | ElMessage.error('导å
¥å¤±è´¥') |
| | | } |
| | | } |
| | | /** |
| | | * ä¸ä¼ é©å |
| | | */ |
| | | const onBeforeUpload = (file: File) => { |
| | | const format = ['xlsx', 'xls', 'csv'] |
| | | if (!format.includes(file.name.split('.')[1])) { |
| | | ElMessage.error('导å
¥æä»¶æ ¼å¼ä¸æ£ç¡®ï¼è¯·å¯¼å
¥.xlsx/.xlsä¸.csvæ ¼å¼çæä»¶') |
| | | return false |
| | | } |
| | | return true |
| | | } |
| | | |
| | | onMounted(() => { |
| | | headers.value = { |
| | | Authorization: `Bearer ${sessionStorage.getItem('Token')}`, |
| | | 'X-Project': sessionStorage.getItem('X-Project'), |
| | | } |
| | | }) |
| | | |
| | | ctx.expose({ |
| | | reloadList, |
| | | }) |
| | | |
| | | return { |
| | | dataSource, |
| | | contextMenu, |
| | | dialogConfig, |
| | | dialogConfigForQuery, |
| | | dialogSettingConfig, |
| | | tableRef, |
| | | current, |
| | | search, |
| | | sort, |
| | | wmsMaterialContainerColumns, |
| | | paginationParams, |
| | | headers, |
| | | onBeforeUpload, |
| | | onError, |
| | | onSuccess, |
| | | openDetail, |
| | | onSearch, |
| | | onExport, |
| | | onRowClick, |
| | | onConfirmWmsMaterialContainer, |
| | | onCheck, |
| | | onAddWmsMaterialContainer, |
| | | onAdvancedQuery |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { |
| | | ref, |
| | | onMounted, |
| | | reactive, |
| | | computed, |
| | | Ref, |
| | | watch, |
| | | SetupContext, |
| | | h, |
| | | } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { WmsMaterialContainerDrawer } from '../Models/PipeAccessoryAssemblyDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useWmsMaterialContainerDrawer = (props: any, ctx?: any) => { |
| | | const wmsMaterialContainerDrawer = injectModel<WmsMaterialContainerDrawer>( |
| | | 'wmsMaterialContainerDrawer' |
| | | ) |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | | const initiateData: Ref<Record<string, any>> = ref({}) |
| | | const formData = ref<Record<string, any>>({}) |
| | | // ref |
| | | const formRef = ref() |
| | | |
| | | const disabled = ref(false) |
| | | |
| | | const current = computed(() => { |
| | | return props.row || null |
| | | }) |
| | | |
| | | const datePicker = (attrs) => { |
| | | return ( |
| | | <el-date-picker |
| | | type="date" |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | formatValue="YYYY-MM-DD HH:mm:ss" |
| | | {...attrs} |
| | | ></el-date-picker> |
| | | ) |
| | | } |
| | | |
| | | const dateTimePicker = (attrs) => { |
| | | return ( |
| | | <el-date-picker |
| | | type="datetime" |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | {...attrs} |
| | | ></el-date-picker> |
| | | ) |
| | | } |
| | | |
| | | const visible = computed({ |
| | | get() { |
| | | return props.modelValue |
| | | }, |
| | | set(val) { |
| | | ctx.emit('update:modelValue', val) |
| | | }, |
| | | }) |
| | | /** |
| | | * æ·»å çformåæ®µ |
| | | */ |
| | | const formItems = reactive([ |
| | | { |
| | | label: 'æçç¼å·', |
| | | prop: 'containerNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æçç¼å·', |
| | | rules: [{ required: true, message: 'æçç¼å·ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'ç©æID', |
| | | prop: 'materialId', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç©æID', |
| | | rules: [{ required: true, message: 'ç©æIDä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | ]) |
| | | /** |
| | | * æ ¡éªæ¯å¦ææ°æ®åå |
| | | */ |
| | | const checkIsEqualObject = () => { |
| | | const data = { |
| | | formData: formData.value, |
| | | } |
| | | const check = isEqual(initiateData.value, data) |
| | | return check |
| | | } |
| | | |
| | | const onClose = (done: () => void) => { |
| | | if (visible.value) { |
| | | if (checkIsEqualObject()) { |
| | | visible.value = false |
| | | done && done() |
| | | } else { |
| | | ConfirmBox('æ¯å¦ä¿å设置ï¼') |
| | | .then(() => { |
| | | onConfirm() |
| | | }) |
| | | .catch(() => { |
| | | visible.value = false |
| | | done && done() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * ä¿å |
| | | */ |
| | | const onConfirm = async () => { |
| | | await formRef.value?.validate() |
| | | const data = { |
| | | containerNo: formData.value.containerNo, |
| | | materialId: formData.value.materialId, |
| | | } |
| | | if (!current.value) { |
| | | await wmsMaterialContainerDrawer.addWmsMaterialContainer(data) |
| | | } else { |
| | | const id = current.value.id |
| | | await wmsMaterialContainerDrawer.updateWmsMaterialContainer(id, data) |
| | | } |
| | | ElMessage.success('ä¿åæå') |
| | | ctx.emit('confirm') |
| | | } |
| | | |
| | | const updateCheckData = () => { |
| | | initiateData.value = { |
| | | formData: { |
| | | ...formData.value, |
| | | }, |
| | | } |
| | | } |
| | | const updateFormItemOptions = (propName: string, enumData: any[]) => { |
| | | const item = formItems.find((item) => item.prop === propName) |
| | | if (item && enumData) { |
| | | item.options = enumData.map((item) => ({ |
| | | label: item.description, |
| | | value: item.value, |
| | | })) |
| | | } |
| | | } |
| | | /** |
| | | * éç¨æ¥è¯¢æä¸¾ |
| | | */ |
| | | const commonQueryEnumForFrom = async () => {} |
| | | commonQueryEnumForFrom() |
| | | /** |
| | | * å¼¹çªæå¼è·å详æ
|
| | | */ |
| | | const onOpen = async () => { |
| | | if (current.value) { |
| | | const res = |
| | | await wmsMaterialContainerDrawer.getWmsMaterialContainerDetail( |
| | | current.value |
| | | ) |
| | | |
| | | formData.value = { |
| | | containerNo: res.containerNo, |
| | | materialId: res.materialId, |
| | | id: res.id, |
| | | } |
| | | disabled.value = true |
| | | updateCheckData() |
| | | } else { |
| | | formData.value = {} |
| | | |
| | | disabled.value = false |
| | | updateCheckData() |
| | | } |
| | | } |
| | | |
| | | watch(() => current.value, onOpen) |
| | | |
| | | return { |
| | | formItems, |
| | | formData, |
| | | visible, |
| | | formRef, |
| | | onOpen, |
| | | onClose, |
| | | onConfirm, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { |
| | | ref, |
| | | onMounted, |
| | | reactive, |
| | | computed, |
| | | Ref, |
| | | watch, |
| | | SetupContext, |
| | | h, |
| | | } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { WmsMaterialContainerDrawer } from '../Models/PipeAccessoryAssemblyDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useWmsMaterialContainerQueryDrawer = (props: any, ctx?: any) => { |
| | | const wmsMaterialContainerDrawer = injectModel<WmsMaterialContainerDrawer>( |
| | | 'WmsMaterialContainerDrawer' |
| | | ) |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | | const initiateData: Ref<Record<string, any>> = ref({}) |
| | | const formData = ref<Record<string, any>>({}) |
| | | // ref |
| | | const formRef = ref() |
| | | |
| | | const disabled = ref(false) |
| | | |
| | | const current = computed(() => { |
| | | return props.row || null |
| | | }) |
| | | |
| | | const inputNumber = (attrs) => { |
| | | return ( |
| | | <el-input-number |
| | | min="1" |
| | | step="1" |
| | | precision="0" |
| | | {...attrs} |
| | | ></el-input-number> |
| | | ) |
| | | } |
| | | |
| | | const datePickerRange = (attrs) => { |
| | | return ( |
| | | <el-date-picker |
| | | type="daterange" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | {...attrs} |
| | | ></el-date-picker> |
| | | ) |
| | | } |
| | | |
| | | const dateTimePickerRange = (attrs) => { |
| | | return ( |
| | | <el-date-picker |
| | | type="datetimerange" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | {...attrs} |
| | | ></el-date-picker> |
| | | ) |
| | | } |
| | | |
| | | const visible = computed({ |
| | | get() { |
| | | return props.modelValue |
| | | }, |
| | | set(val) { |
| | | ctx.emit('update:modelValue', val) |
| | | }, |
| | | }) |
| | | /** |
| | | * æ·»å çformåæ®µ |
| | | */ |
| | | const formItems = reactive([ |
| | | { |
| | | label: 'æçç¼å·', |
| | | prop: 'containerNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æçç¼å·', |
| | | }, |
| | | { |
| | | label: 'ç©æID', |
| | | prop: 'materialId', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç©æID', |
| | | }, |
| | | ]) |
| | | /** |
| | | * æ ¡éªæ¯å¦ææ°æ®åå |
| | | */ |
| | | const checkIsEqualObject = () => { |
| | | const data = { |
| | | formData: formData.value, |
| | | } |
| | | const check = isEqual(initiateData.value, data) |
| | | return check |
| | | } |
| | | const commonGetFormData = () => { |
| | | const data = { |
| | | containerNo: formData.value.containerNo || '', |
| | | materialId: formData.value.materialId || '', |
| | | } |
| | | return data |
| | | } |
| | | const onClose = (done: () => void) => { |
| | | if (visible.value) { |
| | | visible.value = false |
| | | const data = commonGetFormData() |
| | | ctx.emit('close', data) |
| | | } |
| | | } |
| | | /** |
| | | * 确认æ¥è¯¢ |
| | | */ |
| | | const onConfirmQuery = async () => { |
| | | const data = commonGetFormData() |
| | | ctx.emit('confirmQuery', data) |
| | | } |
| | | /** |
| | | * éç½®æ¥è¯¢ |
| | | */ |
| | | const onReset = async () => { |
| | | formData.value = {} |
| | | formData.value.ContainerNo = '' |
| | | formData.value.MaterialId = '' |
| | | //åç¶ç»ä»¶åéèªå®ä¹äºä»¶ |
| | | ctx.emit('restQuery') |
| | | } |
| | | |
| | | const updateCheckData = () => { |
| | | initiateData.value = { |
| | | formData: { |
| | | ...formData.value, |
| | | }, |
| | | } |
| | | } |
| | | const updateFormItemOptions = (propName: string, enumData: any[]) => { |
| | | const item = formItems.find((item) => item.prop === propName) |
| | | if (item && enumData) { |
| | | item.options = enumData.map((item) => ({ |
| | | label: item.description, |
| | | value: item.value, |
| | | })) |
| | | } |
| | | } |
| | | /** |
| | | * éç¨æ¥è¯¢æä¸¾ |
| | | */ |
| | | const commonQueryEnumForFrom = async () => {} |
| | | commonQueryEnumForFrom() |
| | | /** |
| | | * å¼¹çªæå¼è·å详æ
|
| | | */ |
| | | const onOpen = async () => { |
| | | disabled.value = false |
| | | updateCheckData() |
| | | } |
| | | |
| | | watch(() => current.value, onOpen) |
| | | |
| | | return { |
| | | formItems, |
| | | formData, |
| | | visible, |
| | | formRef, |
| | | onOpen, |
| | | onClose, |
| | | onConfirmQuery, |
| | | onReset, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | deleteWmsMaterialContainers, |
| | | addWmsMaterialContainer, |
| | | cloneData, |
| | | } from './Service/PipeAccessoryAssembly' |
| | | |
| | | export class WmsMaterialContainer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | }) |
| | | } |
| | | onMounted() {} |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @returns |
| | | */ |
| | | async deleteWmsMaterialContainers(ids: string[]) { |
| | | return deleteWmsMaterialContainers(ids) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param data |
| | | * @returns |
| | | */ |
| | | addWmsMaterialContainer(data: Record<string, any>) { |
| | | return addWmsMaterialContainer(data) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @param ids |
| | | * @returns |
| | | */ |
| | | cloneData(ids: string[]) { |
| | | return cloneData(ids) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsMaterialContainer, |
| | | getWmsMaterialContainer, |
| | | updateWmsMaterialContainer, |
| | | getWmsEnumData, |
| | | } from './Service/PipeAccessoryAssemblyDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsMaterialContainerDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsMaterialContainer: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsMaterialContainer(data: Record<string, any>) { |
| | | return addWmsMaterialContainer(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsMaterialContainer(id: string, data: Record<string, any>) { |
| | | return updateWmsMaterialContainer(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsMaterialContainerDetail(current: any, id?: string) { |
| | | return getWmsMaterialContainer(id || current?.id) |
| | | } |
| | | |
| | | // è·åæä¸¾å¼ |
| | | async getWmsEnumData(data: Record<string, any>) { |
| | | return getWmsEnumData(data) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsMaterialContainer, |
| | | getWmsMaterialContainer, |
| | | updateWmsMaterialContainer, |
| | | getWmsEnumData, |
| | | } from './Service/PipeAccessoryAssemblyQueryDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsMaterialContainerQueryDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsMaterialContainer: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsMaterialContainer(data: Record<string, any>) { |
| | | return addWmsMaterialContainer(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsMaterialContainer(id: string, data: Record<string, any>) { |
| | | return updateWmsMaterialContainer(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsMaterialContainerDetail(current: any, id?: string) { |
| | | return getWmsMaterialContainer(id || current?.id) |
| | | } |
| | | |
| | | // è·åæä¸¾å¼ |
| | | async getWmsEnumData(data: Record<string, any>) { |
| | | return getWmsEnumData(data) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsMaterialContainer = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsMaterialContainer', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @returns |
| | | */ |
| | | export const deleteWmsMaterialContainers = (ids: string[]) => { |
| | | return request({ |
| | | data: ids, |
| | | url: '/api/v1/HIAWms/wmsMaterialContainer', |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @returns |
| | | */ |
| | | export const cloneData = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsMaterialContainer/clone', data) |
| | | } |
| | | |
| | | /** |
| | | * ç©æåå·å表 |
| | | * @returns |
| | | */ |
| | | export const getMaterialModelList = () => { |
| | | return request.get(`/api/v1/hiawms/wmsenum/ModelList`) |
| | | } |
| | | |
| | | /** |
| | | * åºä½å·å表 |
| | | * @returns |
| | | */ |
| | | export const getPlaceNoForStockList = (data: any) => { |
| | | return request.get(`/api/v1/hiawms/wmsenum/placelist?placeType=${data}`) |
| | | } |
| | | |
| | | /** |
| | | * å
¥åº |
| | | * @returns |
| | | */ |
| | | export const instock = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsinsstock/bindinstock', data) |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ® ç®¡æ®µç¼ç ãå·¥åº æ¥è¯¢ ä½ä¸è®¡å |
| | | * @returns |
| | | */ |
| | | export const findSingleWorkPlanByFilter = (data: any) => { |
| | | return request.post('/api/v1/PipeLineLems/WorkPlan/FindSingleByFilter', data) |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ® ä»»å¡ç¼å·è¿è¡å¼å·¥ |
| | | * @returns |
| | | */ |
| | | export const startProduction = (data: any) => { |
| | | return request.post('/api/v1/PipeLineLems/WorkPlanPublic/startProduction', data) |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ® ä»»å¡ç¼å·è¿è¡å®å·¥ |
| | | * @returns |
| | | */ |
| | | export const finishProduction = (data: any) => { |
| | | return request.post('/api/v1/PipeLineLems/WorkPlanPublic/finishProduction', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsMaterialContainer = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsMaterialContainer', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsMaterialContainer = (id: string) => { |
| | | return request.get(`/api/v1/HIAWms/wmsMaterialContainer/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsMaterialContainer = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/HIAWms/wmsMaterialContainer/${id}`, data) |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸¾ |
| | | * @returns |
| | | */ |
| | | export const getWmsEnumData = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/WmsEnum', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsMaterialContainer = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsMaterialContainer', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsMaterialContainer = (id: string) => { |
| | | return request.get(`/api/v1/HIAWms/wmsMaterialContainer/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsMaterialContainer = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/HIAWms/wmsMaterialContainer/${id}`, data) |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸¾ |
| | | * @returns |
| | | */ |
| | | export const getWmsEnumData = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/WmsEnum', data) |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .drawer { |
| | | width: 800px; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' |
| | | import styles from './WmsMaterialContainerDrawer.module.scss' |
| | | import { useWmsMaterialContainerDrawer } from '../../../../Controllers/PipeAccessoryAssemblyDrawer.tsx' |
| | | import DyForm from '@/components/DyForm/DyForm' |
| | | |
| | | // @ts-ignore |
| | | export default defineComponent<{ |
| | | [key: string]: any |
| | | }>({ |
| | | name: 'å¼¹çª', |
| | | props: { |
| | | modelValue: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | title: { |
| | | type: String, |
| | | default: '', |
| | | }, |
| | | row: { |
| | | type: Object, |
| | | }, |
| | | sort: { |
| | | type: Number, |
| | | default: 0, |
| | | }, |
| | | }, |
| | | emits: ['update:modelValue', 'close', 'submit', 'confirm'], |
| | | setup(props: Record<string, any>, ctx: SetupContext) { |
| | | const { |
| | | onClose, |
| | | onConfirm, |
| | | onOpen, |
| | | formRef, |
| | | visible, |
| | | formItems, |
| | | formData, |
| | | } = useWmsMaterialContainerDrawer(props, ctx) |
| | | return () => ( |
| | | <BaseDrawer |
| | | class={styles.drawer} |
| | | size="800px" |
| | | title={props.title || 'æ·»å '} |
| | | v-model={visible.value} |
| | | close-on-click-modal={true} |
| | | onConfirm={onConfirm} |
| | | onOpen={onOpen} |
| | | before-close={onClose} |
| | | onClose={onClose} |
| | | > |
| | | <DyForm |
| | | ref={formRef} |
| | | formData={formData.value} |
| | | labelWidth="106px" |
| | | formItemProps={formItems} |
| | | ></DyForm> |
| | | </BaseDrawer> |
| | | ) |
| | | }, |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .drawer { |
| | | width: 800px; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * ç©æåºç¡ä¿¡æ¯æ¥è¯¢å¼¹åºæ¡ |
| | | */ |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseQueryDrawer from '@/components/BaseQueryDrawer/BaseQueryDrawer' |
| | | import styles from './WmsMaterialContainerQueryDrawer.module.scss' |
| | | import { useWmsMaterialContainerQueryDrawer } from '../../../../Controllers/PipeAccessoryAssemblyQueryDrawer.tsx' |
| | | import DyForm from '@/components/DyForm/DyForm' |
| | | |
| | | // @ts-ignore |
| | | export default defineComponent<{ |
| | | [key: string]: any |
| | | }>({ |
| | | name: 'å¼¹çª', |
| | | props: { |
| | | //æä¸¾ç±»ååå
¸ |
| | | enumListDict:{ |
| | | type: Array as () => Array<{ key: string; value: object }>, // å®ä¹æ°ç»å
ç´ ç±»å |
| | | default: () => [] // é»è®¤å¼ |
| | | }, |
| | | modelValue: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | title: { |
| | | type: String, |
| | | default: '', |
| | | }, |
| | | row: { |
| | | type: Object, |
| | | }, |
| | | sort: { |
| | | type: Number, |
| | | default: 0, |
| | | }, |
| | | }, |
| | | emits: ['update:modelValue', 'close', 'submit', 'confirmquery1'], |
| | | setup(props: Record<string, any>, ctx: SetupContext) { |
| | | const { |
| | | onClose, |
| | | onConfirmQuery, |
| | | onOpen, |
| | | onReset, |
| | | formRef, |
| | | visible, |
| | | formItems, |
| | | formData, |
| | | } = useWmsMaterialContainerQueryDrawer(props, ctx) |
| | | return () => ( |
| | | <BaseQueryDrawer |
| | | class={styles.drawer} |
| | | size="800px" |
| | | title={props.title || 'é«çº§æ¥è¯¢'} |
| | | v-model={visible.value} |
| | | close-on-click-modal={true} |
| | | onReset={onReset} |
| | | onConfirmQueryForBase={onConfirmQuery} |
| | | onOpen={onOpen} |
| | | before-close={onClose} |
| | | onClose={onClose} |
| | | > |
| | | <DyForm |
| | | ref={formRef} |
| | | formData={formData.value} |
| | | labelWidth="106px" |
| | | formItemProps={formItems} |
| | | ></DyForm> |
| | | </BaseQueryDrawer> |
| | | ) |
| | | }, |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export const columns = [ |
| | | { |
| | | type: 'seq', |
| | | width: 60, |
| | | title: 'åºå·', |
| | | }, |
| | | { |
| | | field: 'containerNo', |
| | | title: 'æçç¼å·', |
| | | }, |
| | | { |
| | | field: 'materialId', |
| | | title: 'ç©æID', |
| | | }, |
| | | { |
| | | field: 'sort', |
| | | title: '', |
| | | }, |
| | | { |
| | | field: 'creationTime', |
| | | title: 'æ¯å¦ç¦ç¨', |
| | | }, |
| | | { |
| | | field: 'deletionTime', |
| | | title: '', |
| | | }, |
| | | ] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .pipeAccessoryAssemblyContent { |
| | | width: 100%; |
| | | height: 100%; |
| | | // height: 100% !important; |
| | | // overflow-y: auto !important; /* å
容è¶
åºæ¶æ¾ç¤ºæ»å¨æ¡ */ |
| | | // padding-bottom: 20px; /* é¿å
å
容被åºé¨é®æ¡ */ |
| | | |
| | | .pipeAccessoryAssemblyList { |
| | | width: 100%; |
| | | height: calc(100% - 70px); |
| | | } |
| | | .headerContent { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | height: 43px; |
| | | } |
| | | .header { |
| | | margin-bottom: 12px; |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | align-items: center; |
| | | } |
| | | |
| | | .h5Form { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 20px; // 表å项ä¹é´çé´è· |
| | | |
| | | .el-form-item { |
| | | margin-bottom: 0; // ç§»é¤é»è®¤çåºé¨è¾¹è· |
| | | width: 100% !important; // å æ»¡ç¶å®¹å¨å®½åº¦ |
| | | } |
| | | |
| | | .el-form-item__label { |
| | | display: block; |
| | | text-align: left; |
| | | margin-bottom: 8px; |
| | | font-weight: 500; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .tagBox { |
| | | width: auto; |
| | | min-width: 80px; |
| | | height: 24px; |
| | | background: #ffffff; |
| | | border-radius: 19px 19px 19px 19px; |
| | | opacity: 1; |
| | | border: 1px dashed #bcc4cc; |
| | | width: 50px; |
| | | height: 20px; |
| | | font-size: 14px; |
| | | font-family: PingFang SC, PingFang SC; |
| | | font-weight: 400; |
| | | color: #5a84ff; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | // cursor: pointer; |
| | | } |
| | | |
| | | .group { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | |
| | | .groupTable { |
| | | width: 100%; |
| | | } |
| | | |
| | | .overBox { |
| | | width: 100%; |
| | | height: calc(100% - 20px); |
| | | overflow: auto; |
| | | :global(.cs-collapse-item__header) { |
| | | background-color: #f1f1f1; |
| | | padding: 0 20px; |
| | | height: 35px; |
| | | font-size: 16px; |
| | | font-family: PingFang SC, PingFang SC; |
| | | font-weight: 500; |
| | | } |
| | | :global(.cs-collapse-item__content) { |
| | | padding-bottom: 0px; |
| | | } |
| | | } |
| | | .groupHeader { |
| | | width: 100%; |
| | | height: 30px; |
| | | background: #ccc; |
| | | } |
| | | |
| | | .hideBlock { |
| | | display: none; |
| | | } |
| | | .queryForm { |
| | | padding: 10px; |
| | | background: #f5f7fa; |
| | | margin-bottom: 0px; |
| | | border-radius: 4px; |
| | | |
| | | .el-form-item { |
| | | margin-right: 20px; |
| | | margin-bottom: 0; |
| | | |
| | | // ç»ä¸è¾å
¥æ¡åéæ©æ¡ç宽度 |
| | | .el-input, .el-select { |
| | | width: 200px; // 设置ç»ä¸ç宽度 |
| | | } |
| | | |
| | | // éæ©æ¡å
é¨è¾å
¥æ¡æ ·å¼ |
| | | .el-select .el-input__wrapper { |
| | | height: 32px; // ä¸è¾å
¥æ¡é«åº¦ä¸è´ |
| | | padding: 1px 11px; // ä¸è¾å
¥æ¡å
è¾¹è·ä¸è´ |
| | | } |
| | | |
| | | // æ¥æéæ©å¨å®½åº¦ |
| | | .el-date-editor { |
| | | width: 220px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 妿éè¦æ´ç²¾ç¡®çæ§å¶ï¼å¯ä»¥åç¬è®¾ç½® |
| | | .formItem { |
| | | width: 200px; |
| | | |
| | | &.el-input, &.el-select { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | .newPageContent { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 20px; |
| | | padding: 20px; |
| | | background-color: white; |
| | | |
| | | .info-block { |
| | | background-color: #f9f9f9; |
| | | border: 1px solid #eaeaea; |
| | | border-radius: 5px; |
| | | padding: 20px; |
| | | width: calc(33.33% - 20px); |
| | | |
| | | .block-title { |
| | | font-size: 20px; |
| | | font-weight: bold; |
| | | margin-bottom: 15px; |
| | | } |
| | | |
| | | .info-tags { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 10px; |
| | | |
| | | .info-tag { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 5px; |
| | | |
| | | .tag-label { |
| | | font-weight: bold; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .action-buttons { |
| | | display: flex; |
| | | gap: 10px; |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .equipment-image { |
| | | width: 100%; |
| | | height: auto; |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .status-normal { |
| | | color: green; |
| | | } |
| | | } |
| | | |
| | | .process-table { |
| | | width: 100%; |
| | | margin-top: 20px; |
| | | |
| | | .el-table { |
| | | border: 1px solid #eaeaea; |
| | | border-radius: 5px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | .modelRrow { |
| | | display: flex; /* å¼¹æ§å¸å± */ |
| | | gap: 20px; /* æ§ä»¶é´è· */ |
| | | align-items: center; /* åç´å±
ä¸ */ |
| | | margin-bottom: 12px; /* åºé¨é´è· */ |
| | | width: 100%; |
| | | |
| | | .el-form-item { |
| | | flex: 1 !important; /* ååç©ºé´ */ |
| | | margin-bottom: 0; |
| | | max-width: none; // ç§»é¤æå¤§å®½åº¦éå¶ |
| | | } |
| | | |
| | | .el-select { |
| | | width: 100%; // ç¡®ä¿Selectå æ»¡ç¶å®¹å¨å®½åº¦ |
| | | |
| | | // ç§»é¤å¯è½å½±å宽度çå
鍿 ·å¼ |
| | | .el-input__wrapper { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | // ååºå¼è®¾è®¡ |
| | | @media (max-width: 1200px) { |
| | | .model-row { |
| | | flex-wrap: wrap; |
| | | |
| | | .el-form-item { |
| | | flex: 1 0 calc(50% - 10px); // å¨ä¸çå±å¹ä¸æ¯è¡æ¾ç¤º2个 |
| | | margin-bottom: 10px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | @media (max-width: 768px) { |
| | | .model-row { |
| | | flex-direction: column; |
| | | |
| | | .el-form-item { |
| | | width: 100%; // å¨å°å±å¹ä¸æ¯è¡æ¾ç¤º1个 |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .action-buttons { |
| | | display: flex; |
| | | gap: 10px; |
| | | margin-top: 20px; |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { defineComponent, onMounted, ref } from 'vue' |
| | | import type { Ref } from 'vue' |
| | | import styles from './PipeAccessoryAssembly.module.scss' |
| | | import pipeImage from '@/images/pipe-assembly-drawing-example.png' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { |
| | | ElInput, |
| | | ElForm, |
| | | ElFormItem, |
| | | ElButton, |
| | | ElSelect, |
| | | ElOption, |
| | | ElMessage, |
| | | ElCol, |
| | | } from 'element-plus' |
| | | import { |
| | | getPlaceNoForStockList, |
| | | getMaterialModelList, |
| | | instock, |
| | | findSingleWorkPlanByFilter, |
| | | startProduction, |
| | | finishProduction |
| | | } from '@/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssembly' |
| | | import { Message } from '@element-plus/icons-vue/dist/types' |
| | | |
| | | export default defineComponent({ |
| | | name: 'PipeAccessoryAssembly', |
| | | setup() { |
| | | // æ¥è¯¢è¡¨åæ°æ® |
| | | const queryForm = ref({ |
| | | pipeSpecCode: '', |
| | | processRouteNumber: '', |
| | | taskCode: '', |
| | | length: '', |
| | | projectNumber: '', |
| | | shipNumber: '', |
| | | material: '', |
| | | outerDiameter: '', |
| | | thickness: '', |
| | | plannedStartTime: '', |
| | | plannedEndTime: '', |
| | | workstationCode: '', |
| | | processName: '', |
| | | equipmentCode: '' |
| | | }) |
| | | |
| | | // æ°æ®æº |
| | | const modelOptions = ref<Array<{ value: string; label: string }>>([]) |
| | | const placeNoOptions = ref<Array<{ value: string; label: string }>>([]) |
| | | |
| | | onMounted(() => { |
| | | // ç»ä»¶æè½½åè·ååå·å表ååºä½å·å表 |
| | | getModelList() |
| | | getPlaceNoList() |
| | | }) |
| | | |
| | | // ç»çæä½ |
| | | const handlePalletize = () => { |
| | | console.log('ç»çæä½', queryForm.value) |
| | | // è¿éæ·»å ç»çé»è¾ |
| | | } |
| | | |
| | | // ç»çå
¥åºæä½ |
| | | const handlePalletizeStorage = () => { |
| | | console.log('ç»çå
¥åºæä½', queryForm.value) |
| | | instock(queryForm.value), resetQueryForm() |
| | | ElMessage.success({ |
| | | message: 'ç»çå
¥åºæå', |
| | | type: 'success', |
| | | }) |
| | | // è¿éæ·»å ç»çå
¥åºé»è¾ |
| | | } |
| | | |
| | | const resetQueryForm = () => { |
| | | queryForm.value.materialModel = '' |
| | | queryForm.value.placeNo = '' |
| | | queryForm.value.materialBatch = '' |
| | | queryForm.value.stockNumber = '' |
| | | } |
| | | |
| | | const getModelList = async () => { |
| | | const models = await getMaterialModelList() |
| | | modelOptions.value = models.map((item: string) => ({ |
| | | value: item.materialModel, |
| | | label: item.materialModelDesc, |
| | | })) |
| | | } |
| | | |
| | | const getPlaceNoList = async () => { |
| | | const placeNos = await getPlaceNoForStockList(2) |
| | | console.log('åºä½å·å表:', placeNos) |
| | | placeNoOptions.value = placeNos.map((item: string) => ({ |
| | | value: item.placeNo, |
| | | label: item.placeNoDesc, |
| | | })) |
| | | } |
| | | const handleChange =async (value) => { |
| | | console.log('è¾å
¥å
容确认:', value); // 失å»ç¦ç¹æå车æ¶è§¦å |
| | | // 卿¤å¤æ·»å ä¸å¡é»è¾ï¼å¦æ ¡éªãæäº¤çï¼ |
| | | const param={ |
| | | pipeSpecCode:value, |
| | | pipeSpecCode_FilterMode:2,//ç²¾åæ¥è¯¢ |
| | | processName:'è£
é
å·¥åº', |
| | | processName_FilterMode:2,//ç²¾åæ¥è¯¢ |
| | | } |
| | | const workPlan = await findSingleWorkPlanByFilter(param); |
| | | console.log('è¿å:'+workPlan); |
| | | if(workPlan==''){ |
| | | ElMessage.error('æ²¡ææ¾å°æ°æ®'); |
| | | queryForm.value ={ pipeSpecCode: '', |
| | | processRouteNumber: '', |
| | | taskCode: '', |
| | | length: '', |
| | | projectNumber: '', |
| | | shipNumber: '', |
| | | material: '', |
| | | outerDiameter: '', |
| | | thickness: '', |
| | | plannedStartTime: '', |
| | | plannedEndTime: '', |
| | | workstationCode: '', |
| | | processName: '', |
| | | equipmentCode: ''} |
| | | }else{ |
| | | queryForm.value=workPlan; |
| | | } |
| | | }; |
| | | |
| | | // å¼å·¥äºä»¶å¤ç |
| | | const startWork = () => { |
| | | console.log('æ§è¡å¼å·¥æä½'); |
| | | if(queryForm.value.pipeSpecCode==''){ |
| | | ElMessage.error('请è¾å
¥ç®¡æ®µç¼ç '); |
| | | return |
| | | } |
| | | ConfirmBox( |
| | | `ç¡®å®è¦å°ç®¡æ®µç¼ç ${queryForm.value.pipeSpecCode}å¼å·¥å` |
| | | ).then(async () => { |
| | | //æ¨çä¸å¡é»è¾ |
| | | const param={ |
| | | taskCode:queryForm.value.taskCode, |
| | | }; |
| | | const ret = await startProduction(param); |
| | | console.log('è¿å:'+ret); |
| | | if(ret.code="200"){ |
| | | ElMessage.success('å¼å·¥æå'); |
| | | }else{ |
| | | ElMessage.error('å¼å·¥å¤±è´¥:'+ret.message); |
| | | } |
| | | }) |
| | | } |
| | | // å®å·¥äºä»¶å¤ç |
| | | const finishWork = () => { |
| | | console.log('æ§è¡å¼å·¥æä½'); |
| | | if(queryForm.value.pipeSpecCode==''){ |
| | | ElMessage.error('请è¾å
¥ç®¡æ®µç¼ç '); |
| | | return |
| | | } |
| | | ConfirmBox( |
| | | `ç¡®å®è¦å°ç®¡æ®µç¼ç ${queryForm.value.pipeSpecCode}å®å·¥å` |
| | | ).then(async () => { |
| | | //æ¨çä¸å¡é»è¾ |
| | | const param={ |
| | | pipeSpecCode:queryForm.value.pipeSpecCode, |
| | | processName:queryForm.value.processName, |
| | | }; |
| | | const ret = await finishProduction(param); |
| | | console.log('è¿å:'+ret); |
| | | if(ret.code="200"){ |
| | | ElMessage.success('å®å·¥æå'); |
| | | }else{ |
| | | ElMessage.error('å®å·¥å¤±è´¥:'+ret.message); |
| | | } |
| | | }) |
| | | } |
| | | const tableData = ref([ |
| | | { sequence: 1, flangeA: 'RF-200-1.6MPa', flangeB: 'WN-200-1.6MPa' }, |
| | | { sequence: 2, flangeA: 'WN-250-2.5MPa', flangeB: 'SO-250-2.5MPa' }, |
| | | { sequence: 3, flangeA: 'PL-300-1.0MPa', flangeB: 'RF-300-1.0MPa' }, |
| | | { sequence: 4, flangeA: 'SO-150-2.0MPa', flangeB: 'WN-150-2.0MPa' }, |
| | | { sequence: 5, flangeA: 'RF-400-1.6MPa', flangeB: 'PL-400-1.6MPa' }, |
| | | { sequence: 6, flangeA: 'WN-200-4.0MPa', flangeB: 'SO-200-4.0MPa' }, |
| | | { sequence: 7, flangeA: 'SO-300-1.6MPa', flangeB: 'RF-300-1.6MPa' }, |
| | | { sequence: 8, flangeA: 'PL-250-1.0MPa', flangeB: 'WN-250-1.0MPa' }, |
| | | { sequence: 9, flangeA: 'RF-150-2.5MPa', flangeB: 'SO-150-2.5MPa' }, |
| | | { sequence: 10, flangeA: 'WN-400-2.0MPa', flangeB: 'PL-400-2.0MPa' } |
| | | ]); |
| | | |
| | | |
| | | return () => { |
| | | return ( |
| | | <div |
| | | class={styles.PipeAccessoryAssemblyContent} |
| | | style="overflow-y: auto !important; height: 100%;" |
| | | > |
| | | <ElFormItem label="管段ç¼ç "> |
| | | <ElInput |
| | | v-model={queryForm.value.pipeSpecCode} |
| | | clearable |
| | | class={styles.formInput} |
| | | onInput={handleChange} |
| | | /> |
| | | </ElFormItem> |
| | | <div class={styles.actionButtons}> |
| | | <ElButton type="warning" onClick={startWork}>å¼å·¥</ElButton> |
| | | <ElButton type="warning" onClick={finishWork}>å®å·¥</ElButton> |
| | | {/* <ElButton type="warning">æå</ElButton> |
| | | <ElButton type="warning">èªå¨</ElButton> |
| | | <ElButton type="warning">è´¨æ£</ElButton> */} |
| | | </div> |
| | | |
| | | <h2 class={styles.blockTitle}>å½åä»»å¡</h2> |
| | | <ElForm label-position="left" > |
| | | |
| | | <ElFormItem label="ç©ææµå "> |
| | | <ElInput |
| | | v-model={queryForm.value.processRouteNumber} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="ä»»å¡ç¼å· "> |
| | | <ElInput |
| | | v-model={queryForm.value.taskCode} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="管段é¿åº¦ "> |
| | | <ElInput |
| | | v-model={queryForm.value.length} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="é¡¹ç® å·"> |
| | | <ElInput |
| | | v-model={queryForm.value.projectNumber} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="è¹ å·"> |
| | | <ElInput |
| | | v-model={queryForm.value.shipNumber} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="æ è´¨"> |
| | | <ElInput |
| | | v-model={queryForm.value.material} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="å¤ å¾"> |
| | | <ElInput |
| | | v-model={queryForm.value.outerDiameter} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="å£ å"> |
| | | <ElInput |
| | | v-model={queryForm.value.thickness} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="计åå¼å§æ¶é´"> |
| | | <ElInput |
| | | v-model={queryForm.value.plannedStartTime} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="计å宿æ¶é´"> |
| | | <ElInput |
| | | v-model={queryForm.value.plannedEndTime} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | </ElForm> |
| | | |
| | | <h2 class={styles.blockTitle}>å½åå·¥ä½/设å¤ä¿¡æ¯</h2> |
| | | <ElForm label-position="left" > |
| | | <ElFormItem label="å·¥ä½ä»£ç "> |
| | | <ElInput |
| | | v-model={queryForm.value.workstationCode} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="å·¥åºåç§° "> |
| | | <ElInput |
| | | v-model={queryForm.value.processName} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="设å¤ä»£ç "> |
| | | <ElInput |
| | | v-model={queryForm.value.equipmentCode} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | {/* <ElFormItem label="设å¤ç¶æ"> |
| | | <ElInput |
| | | v-model={queryForm.value.materialBatch} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> */} |
| | | {/* <ElFormItem label="æä½äºº"> |
| | | <ElInput |
| | | v-model={queryForm.value.materialBatch} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> */} |
| | | </ElForm> |
| | | |
| | | {/* <div class="info-block"> |
| | | <h2 class="block-title">å·¥èºä¿¡æ¯</h2> |
| | | <el-table stripe v-model:dataSource={tableData}> |
| | | <el-table-column prop="sequence" label="åº"></el-table-column> |
| | | <el-table-column prop="flangeA" label="æ³å
°A"></el-table-column> |
| | | <el-table-column prop="flangeB" label="æ³å
°B"></el-table-column> |
| | | </el-table> |
| | | </div> */} |
| | | <h2 class="block-title">å¾çº¸</h2> |
| | | <img |
| | | src={pipeImage} |
| | | alt="设å¤å¾ç" |
| | | style="height:1250px;" |
| | | class="equipment-image" |
| | | ></img> |
| | | </div> |
| | | ) |
| | | } |
| | | }, |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .PipeAccessoryAssembly { |
| | | background-color: #fff; |
| | | border-radius: 5px 5px 0 0; |
| | | width: 100%; |
| | | height: 100%; |
| | | border: 1px solid #dbdbdb; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { |
| | | Component, |
| | | DefineComponent, |
| | | defineComponent, |
| | | markRaw, |
| | | ref, |
| | | SetupContext, |
| | | onMounted, |
| | | } from 'vue' |
| | | import styles from './PipeAccessoryAssembly.module.scss' |
| | | import Tab from '@/components/Tab/Tab' |
| | | import { useProvideModels } from '@/libs/Provider/app' |
| | | import { usePermission } from '@/libs/Permission/Permission' |
| | | import { permissionCodes } from '../enum' |
| | | import { ModuleType, TabItem } from '../type/Type' |
| | | import { getEntityNames } from '@/hooks/hook' |
| | | import TabPane from '@/components/Tab/TabPane' |
| | | |
| | | const Models: ModuleType = import.meta.glob('./config/*.json', { |
| | | eager: true, |
| | | }) |
| | | |
| | | const entityNames = getEntityNames(Models) |
| | | |
| | | const nameToLabelMap = [{ name: 'PipeAccessoryAssembly', label: '管éä»¶è£
é
' }] |
| | | |
| | | export default defineComponent({ |
| | | name: 'PipeAccessoryAssembly', |
| | | |
| | | setup(props, ctx: SetupContext) { |
| | | useProvideModels() |
| | | usePermission(props, permissionCodes) |
| | | |
| | | const rf = ref<{ |
| | | [key: string]: any |
| | | }>({}) |
| | | |
| | | const tabData = ref<TabItem[]>([]) |
| | | |
| | | const onTabChange = (v: string) => { |
| | | rf.value?.[v]?.reloadList() |
| | | } |
| | | |
| | | const initTableData = async () => { |
| | | for (const i in entityNames) { |
| | | const name = entityNames[i] |
| | | const module = await import(`./Pages/${name}/${name}.tsx`) |
| | | const PipeAccessoryAssembly = markRaw(module.default) |
| | | const foundLabel = |
| | | nameToLabelMap.find((item) => item.name === name)?.label || name |
| | | tabData.value.push({ |
| | | label: foundLabel, |
| | | name, |
| | | component: PipeAccessoryAssembly, |
| | | }) |
| | | } |
| | | } |
| | | |
| | | initTableData() |
| | | |
| | | return () => { |
| | | return ( |
| | | <div class={styles.PipeAccessoryAssembly}> |
| | | <Tab data={tabData.value} type="list" onTab={onTabChange}> |
| | | {tabData.value.map((widgetInfo) => { |
| | | const Widget: any = widgetInfo.component |
| | | return ( |
| | | <TabPane label={widgetInfo.label} name={widgetInfo.name}> |
| | | <Widget |
| | | ref={(r: any) => (rf.value['PipeAccessoryAssembly'] = r)} |
| | | ></Widget> |
| | | </TabPane> |
| | | ) |
| | | })} |
| | | </Tab> |
| | | </div> |
| | | ) |
| | | } |
| | | }, |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "PipeAccessoryAssembly" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface TabType { |
| | | label: string |
| | | name: string |
| | | columns?: any[] |
| | | data?: any[] |
| | | isFooter: boolean |
| | | [key: string]: any |
| | | } |
| | | |
| | | export const permissionCodes = { |
| | | 'PipeAccessoryAssembly-list': 'å表-å表', |
| | | 'PipeAccessoryAssembly-add': 'å表-æ·»å ', |
| | | 'PipeAccessoryAssembly-import': 'å表-导å
¥', |
| | | 'PipeAccessoryAssembly-output': 'å表-è¾åº', |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import PipeAccessoryAssembly from './Views/PipeAccessoryAssembly' |
| | | import Setting from '@/components/Setting/Setting' |
| | | import { provider } from '@/provider/index' |
| | | import p from '../../assets/svg/p.svg' |
| | | |
| | | export default { |
| | | is: 'PipeAccessoryAssembly', |
| | | name: '管éä»¶è£
é
', |
| | | category: 'run', |
| | | icon: p, |
| | | authorizationRequired: false, |
| | | canvasView: provider(PipeAccessoryAssembly), |
| | | settingsView: Setting, |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Component } from 'vue' |
| | | |
| | | export interface DataItemType { |
| | | id?: string |
| | | name?: string |
| | | code?: string |
| | | description?: string |
| | | label?: string |
| | | value?: string | number |
| | | } |
| | | |
| | | export interface WmsMaterialContainerBaseType { |
| | | id?: string |
| | | name?: string |
| | | code?: string |
| | | value?: number |
| | | description?: string |
| | | options?: Array<DataItemType> |
| | | abilityValue?: number | string |
| | | data?: DataItemType |
| | | defaultValue?: string | number |
| | | flow: string |
| | | } |
| | | |
| | | export interface FlowDefinitionType { |
| | | id?: string |
| | | name?: string |
| | | code?: string |
| | | description?: string |
| | | } |
| | | |
| | | export type ModuleType = Record< |
| | | string, |
| | | { |
| | | default: Record<string, string> |
| | | name: string |
| | | } |
| | | > |
| | | |
| | | export interface TabItem { |
| | | name: string |
| | | label: string |
| | | component: Component |
| | | hidden?: boolean |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { importFileToService, exportFileToClient } from '@/api/file' |
| | | import { ElMessage } from 'element-plus' |
| | | import { downloadFile } from '@/utils' |
| | | import dayjs from 'dayjs' |
| | | |
| | | export const useFile = () => { |
| | | /** |
| | | * 导å
¥æä»¶ |
| | | * @param url |
| | | */ |
| | | const importFile = async (url: string, file: File) => { |
| | | const formData = new FormData() |
| | | formData.append('file', file) |
| | | await importFileToService(url, formData) |
| | | ElMessage('导å
¥æå') |
| | | } |
| | | /** |
| | | * å¯¼åºæä»¶ |
| | | * @param url |
| | | */ |
| | | const exportFile = async (url: string, params: any, name: string) => { |
| | | const res = await exportFileToClient(url, params) |
| | | downloadFile(res, `${name}_${dayjs().format('YYYYMMDDHHMMss')}.xlsx`) |
| | | ElMessage.success('å¯¼åºæå') |
| | | } |
| | | |
| | | return { |
| | | importFile, |
| | | exportFile, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { WmsMaterialContainer } from '../Models/PipeAccessoryPick' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { useFile } from './File' |
| | | |
| | | interface CurrentType { |
| | | row: any |
| | | index: number |
| | | } |
| | | export const useWmsMaterialContainer = (props: any, ctx?: any) => { |
| | | const wmsMaterialContainer = injectModel<WmsMaterialContainer>('wmsMaterialContainer') |
| | | const { exportFile } = useFile() |
| | | /** |
| | | * 头é¨é
ç½® |
| | | */ |
| | | const headers = ref({}) |
| | | /** |
| | | * 卿åé
ç½® |
| | | */ |
| | | const wmsMaterialContainerColumns = ref<Record<string, any>>([]) |
| | | /** |
| | | * æç´¢å¼ |
| | | */ |
| | | const search = ref('') |
| | | |
| | | /** |
| | | * æåº |
| | | */ |
| | | const sort = ref(0) |
| | | /** |
| | | * 鿩项 |
| | | */ |
| | | const selection = ref([]) |
| | | /** |
| | | * å½åéä¸çè¡ |
| | | */ |
| | | const current = ref<any>(null) |
| | | /** |
| | | * æ°æ®æº |
| | | */ |
| | | const dataSource: Ref<any[]> = ref([]) |
| | | |
| | | /** |
| | | * è¡¨æ ¼ |
| | | */ |
| | | const tableRef = ref() |
| | | const dialogConfig = reactive({ |
| | | visible: false, |
| | | title: '', |
| | | isAdd: false, |
| | | }) |
| | | const dialogConfigForQuery = reactive({ |
| | | visible: false, |
| | | title: '', |
| | | isAdd: false, |
| | | }) |
| | | |
| | | |
| | | const dialogSettingConfig = reactive({ |
| | | visible: false, |
| | | title: '', |
| | | }) |
| | | |
| | | /** |
| | | * åé¡µæ°æ® |
| | | */ |
| | | const paginationParams = ref({}) |
| | | |
| | | /** |
| | | * æå¼è¯¦æ
|
| | | * @param row |
| | | */ |
| | | const openDetail = (row: any) => { |
| | | current.value = row |
| | | dialogConfig.visible = true |
| | | dialogConfig.title = row.name |
| | | dialogConfig.isAdd = false |
| | | sort.value = row.sort |
| | | } |
| | | |
| | | const contextMenu = [ |
| | | { |
| | | label: 'å±å¼è¯¦æ
', |
| | | fn: (c: CurrentType) => { |
| | | current.value = null |
| | | sort.value = c.row.sort |
| | | nextTick(() => openDetail(c.row)) |
| | | }, |
| | | divided: true, |
| | | icon: 'o', |
| | | }, |
| | | // { |
| | | // label: 'å䏿·»å ', |
| | | // fn: (c: CurrentType, pageNum: number) => { |
| | | // current.value = null |
| | | // sort.value = c.index + 1 + (pageNum - 1) * 50 |
| | | // dialogConfig.visible = true |
| | | // dialogConfig.title = 'æ·»å ' |
| | | // dialogConfig.isAdd = false |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'up', |
| | | // }, |
| | | // { |
| | | // label: 'å䏿·»å ', |
| | | // fn: (c: CurrentType, pageNum: number) => { |
| | | // current.value = null |
| | | // sort.value = c.index + 2 + (pageNum - 1) * 50 |
| | | // dialogConfig.visible = true |
| | | // dialogConfig.title = 'æ·»å ' |
| | | // dialogConfig.isAdd = false |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'down', |
| | | // }, |
| | | // { |
| | | // label: 'åå»ºå¯æ¬', |
| | | // fn: async ({ row }: CurrentType) => { |
| | | // await wmsMaterialContainer.cloneData([row.id]) |
| | | // ElMessage.success('åå»ºå¯æ¬æå') |
| | | // tableRef.value?.getList() |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'copy', |
| | | // }, |
| | | { |
| | | label: 'å é¤', |
| | | fn: async (c: CurrentType) => { |
| | | const names = selection.value.map((item: { materialId: string }) => item.materialId) |
| | | ConfirmBox( |
| | | `æ¯å¦å é¤${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]) |
| | | ElMessage.success('å 餿å') |
| | | tableRef.value.getList() |
| | | }) |
| | | }, |
| | | icon: 'close', |
| | | }, |
| | | ] |
| | | |
| | | const onCheck = (records: any) => { |
| | | selection.value = records |
| | | } |
| | | |
| | | const onAddWmsMaterialContainer = () => { |
| | | const params = tableRef.value?.getPaginationParams() |
| | | current.value = null |
| | | dialogConfig.visible = true |
| | | dialogConfig.isAdd = true |
| | | dialogConfig.title = 'æ·»å ' |
| | | sort.value = params.totalCount + 1 |
| | | } |
| | | |
| | | //ç¹å»æé®ãé«çº§æ¥è¯¢ã |
| | | const onAdvancedQuery = () => { |
| | | const params = tableRef.value?.getPaginationParams() |
| | | current.value = null |
| | | dialogConfigForQuery.visible = true |
| | | dialogConfigForQuery.isAdd = true |
| | | dialogConfigForQuery.title = 'é«çº§æ¥è¯¢' |
| | | } |
| | | |
| | | const onConfirmWmsMaterialContainer = async () => { |
| | | dialogConfig.visible = false |
| | | if (dialogConfig.isAdd) { |
| | | tableRef.value?.scrollToRow({ |
| | | skip: true, |
| | | }) |
| | | } else { |
| | | await tableRef.value?.getList() |
| | | } |
| | | } |
| | | /** |
| | | * è¡ç¹å»æ¶æ´æ°current |
| | | */ |
| | | const onRowClick = ({ row }: any) => { |
| | | if (dialogConfig.visible && current.value) { |
| | | current.value = row |
| | | } |
| | | } |
| | | /** |
| | | * å¯¼åº |
| | | */ |
| | | const onExport = (data={}) => { |
| | | //const params = tableRef.value?.getParams() |
| | | exportFile('/api/v1/HIAWms/wmsMaterialContainer/export', data, 'wmsMaterialContainer') |
| | | } |
| | | |
| | | /** |
| | | * å
³é®åæç´¢ |
| | | */ |
| | | const onSearch = () => { |
| | | tableRef.value?.getList({ |
| | | Filter: search.value, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * éç½®è¡¨æ ¼æ°æ® |
| | | */ |
| | | const reloadList = () => { |
| | | tableRef.value?.getList() |
| | | } |
| | | /** |
| | | * ä¸ä¼ æå |
| | | */ |
| | | const onSuccess = () => { |
| | | tableRef.value?.getList() |
| | | ElMessage.success('导å
¥æå') |
| | | } |
| | | /** |
| | | * 失败 |
| | | * @param err |
| | | */ |
| | | const onError = (err: any) => { |
| | | try { |
| | | const message = JSON.parse(err.message) |
| | | ElMessage.error(message.msg) |
| | | } catch (error) { |
| | | ElMessage.error('导å
¥å¤±è´¥') |
| | | } |
| | | } |
| | | /** |
| | | * ä¸ä¼ é©å |
| | | */ |
| | | const onBeforeUpload = (file: File) => { |
| | | const format = ['xlsx', 'xls', 'csv'] |
| | | if (!format.includes(file.name.split('.')[1])) { |
| | | ElMessage.error('导å
¥æä»¶æ ¼å¼ä¸æ£ç¡®ï¼è¯·å¯¼å
¥.xlsx/.xlsä¸.csvæ ¼å¼çæä»¶') |
| | | return false |
| | | } |
| | | return true |
| | | } |
| | | |
| | | onMounted(() => { |
| | | headers.value = { |
| | | Authorization: `Bearer ${sessionStorage.getItem('Token')}`, |
| | | 'X-Project': sessionStorage.getItem('X-Project'), |
| | | } |
| | | }) |
| | | |
| | | ctx.expose({ |
| | | reloadList, |
| | | }) |
| | | |
| | | return { |
| | | dataSource, |
| | | contextMenu, |
| | | dialogConfig, |
| | | dialogConfigForQuery, |
| | | dialogSettingConfig, |
| | | tableRef, |
| | | current, |
| | | search, |
| | | sort, |
| | | wmsMaterialContainerColumns, |
| | | paginationParams, |
| | | headers, |
| | | onBeforeUpload, |
| | | onError, |
| | | onSuccess, |
| | | openDetail, |
| | | onSearch, |
| | | onExport, |
| | | onRowClick, |
| | | onConfirmWmsMaterialContainer, |
| | | onCheck, |
| | | onAddWmsMaterialContainer, |
| | | onAdvancedQuery |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { |
| | | ref, |
| | | onMounted, |
| | | reactive, |
| | | computed, |
| | | Ref, |
| | | watch, |
| | | SetupContext, |
| | | h, |
| | | } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { WmsMaterialContainerDrawer } from '../Models/PipeAccessoryPickDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useWmsMaterialContainerDrawer = (props: any, ctx?: any) => { |
| | | const wmsMaterialContainerDrawer = injectModel<WmsMaterialContainerDrawer>( |
| | | 'wmsMaterialContainerDrawer' |
| | | ) |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | | const initiateData: Ref<Record<string, any>> = ref({}) |
| | | const formData = ref<Record<string, any>>({}) |
| | | // ref |
| | | const formRef = ref() |
| | | |
| | | const disabled = ref(false) |
| | | |
| | | const current = computed(() => { |
| | | return props.row || null |
| | | }) |
| | | |
| | | const datePicker = (attrs) => { |
| | | return ( |
| | | <el-date-picker |
| | | type="date" |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | formatValue="YYYY-MM-DD HH:mm:ss" |
| | | {...attrs} |
| | | ></el-date-picker> |
| | | ) |
| | | } |
| | | |
| | | const dateTimePicker = (attrs) => { |
| | | return ( |
| | | <el-date-picker |
| | | type="datetime" |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | {...attrs} |
| | | ></el-date-picker> |
| | | ) |
| | | } |
| | | |
| | | const visible = computed({ |
| | | get() { |
| | | return props.modelValue |
| | | }, |
| | | set(val) { |
| | | ctx.emit('update:modelValue', val) |
| | | }, |
| | | }) |
| | | /** |
| | | * æ·»å çformåæ®µ |
| | | */ |
| | | const formItems = reactive([ |
| | | { |
| | | label: 'æçç¼å·', |
| | | prop: 'containerNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æçç¼å·', |
| | | rules: [{ required: true, message: 'æçç¼å·ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'ç©æID', |
| | | prop: 'materialId', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç©æID', |
| | | rules: [{ required: true, message: 'ç©æIDä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | ]) |
| | | /** |
| | | * æ ¡éªæ¯å¦ææ°æ®åå |
| | | */ |
| | | const checkIsEqualObject = () => { |
| | | const data = { |
| | | formData: formData.value, |
| | | } |
| | | const check = isEqual(initiateData.value, data) |
| | | return check |
| | | } |
| | | |
| | | const onClose = (done: () => void) => { |
| | | if (visible.value) { |
| | | if (checkIsEqualObject()) { |
| | | visible.value = false |
| | | done && done() |
| | | } else { |
| | | ConfirmBox('æ¯å¦ä¿å设置ï¼') |
| | | .then(() => { |
| | | onConfirm() |
| | | }) |
| | | .catch(() => { |
| | | visible.value = false |
| | | done && done() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * ä¿å |
| | | */ |
| | | const onConfirm = async () => { |
| | | await formRef.value?.validate() |
| | | const data = { |
| | | containerNo: formData.value.containerNo, |
| | | materialId: formData.value.materialId, |
| | | } |
| | | if (!current.value) { |
| | | await wmsMaterialContainerDrawer.addWmsMaterialContainer(data) |
| | | } else { |
| | | const id = current.value.id |
| | | await wmsMaterialContainerDrawer.updateWmsMaterialContainer(id, data) |
| | | } |
| | | ElMessage.success('ä¿åæå') |
| | | ctx.emit('confirm') |
| | | } |
| | | |
| | | const updateCheckData = () => { |
| | | initiateData.value = { |
| | | formData: { |
| | | ...formData.value, |
| | | }, |
| | | } |
| | | } |
| | | const updateFormItemOptions = (propName: string, enumData: any[]) => { |
| | | const item = formItems.find((item) => item.prop === propName) |
| | | if (item && enumData) { |
| | | item.options = enumData.map((item) => ({ |
| | | label: item.description, |
| | | value: item.value, |
| | | })) |
| | | } |
| | | } |
| | | /** |
| | | * éç¨æ¥è¯¢æä¸¾ |
| | | */ |
| | | const commonQueryEnumForFrom = async () => {} |
| | | commonQueryEnumForFrom() |
| | | /** |
| | | * å¼¹çªæå¼è·å详æ
|
| | | */ |
| | | const onOpen = async () => { |
| | | if (current.value) { |
| | | const res = |
| | | await wmsMaterialContainerDrawer.getWmsMaterialContainerDetail( |
| | | current.value |
| | | ) |
| | | |
| | | formData.value = { |
| | | containerNo: res.containerNo, |
| | | materialId: res.materialId, |
| | | id: res.id, |
| | | } |
| | | disabled.value = true |
| | | updateCheckData() |
| | | } else { |
| | | formData.value = {} |
| | | |
| | | disabled.value = false |
| | | updateCheckData() |
| | | } |
| | | } |
| | | |
| | | watch(() => current.value, onOpen) |
| | | |
| | | return { |
| | | formItems, |
| | | formData, |
| | | visible, |
| | | formRef, |
| | | onOpen, |
| | | onClose, |
| | | onConfirm, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { |
| | | ref, |
| | | onMounted, |
| | | reactive, |
| | | computed, |
| | | Ref, |
| | | watch, |
| | | SetupContext, |
| | | h, |
| | | } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { WmsMaterialContainerDrawer } from '../Models/PipeAccessoryPickDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useWmsMaterialContainerQueryDrawer = (props: any, ctx?: any) => { |
| | | const wmsMaterialContainerDrawer = injectModel<WmsMaterialContainerDrawer>( |
| | | 'WmsMaterialContainerDrawer' |
| | | ) |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | | const initiateData: Ref<Record<string, any>> = ref({}) |
| | | const formData = ref<Record<string, any>>({}) |
| | | // ref |
| | | const formRef = ref() |
| | | |
| | | const disabled = ref(false) |
| | | |
| | | const current = computed(() => { |
| | | return props.row || null |
| | | }) |
| | | |
| | | const inputNumber = (attrs) => { |
| | | return ( |
| | | <el-input-number |
| | | min="1" |
| | | step="1" |
| | | precision="0" |
| | | {...attrs} |
| | | ></el-input-number> |
| | | ) |
| | | } |
| | | |
| | | const datePickerRange = (attrs) => { |
| | | return ( |
| | | <el-date-picker |
| | | type="daterange" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | {...attrs} |
| | | ></el-date-picker> |
| | | ) |
| | | } |
| | | |
| | | const dateTimePickerRange = (attrs) => { |
| | | return ( |
| | | <el-date-picker |
| | | type="datetimerange" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | {...attrs} |
| | | ></el-date-picker> |
| | | ) |
| | | } |
| | | |
| | | const visible = computed({ |
| | | get() { |
| | | return props.modelValue |
| | | }, |
| | | set(val) { |
| | | ctx.emit('update:modelValue', val) |
| | | }, |
| | | }) |
| | | /** |
| | | * æ·»å çformåæ®µ |
| | | */ |
| | | const formItems = reactive([ |
| | | { |
| | | label: 'æçç¼å·', |
| | | prop: 'containerNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æçç¼å·', |
| | | }, |
| | | { |
| | | label: 'ç©æID', |
| | | prop: 'materialId', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç©æID', |
| | | }, |
| | | ]) |
| | | /** |
| | | * æ ¡éªæ¯å¦ææ°æ®åå |
| | | */ |
| | | const checkIsEqualObject = () => { |
| | | const data = { |
| | | formData: formData.value, |
| | | } |
| | | const check = isEqual(initiateData.value, data) |
| | | return check |
| | | } |
| | | const commonGetFormData = () => { |
| | | const data = { |
| | | containerNo: formData.value.containerNo || '', |
| | | materialId: formData.value.materialId || '', |
| | | } |
| | | return data |
| | | } |
| | | const onClose = (done: () => void) => { |
| | | if (visible.value) { |
| | | visible.value = false |
| | | const data = commonGetFormData() |
| | | ctx.emit('close', data) |
| | | } |
| | | } |
| | | /** |
| | | * 确认æ¥è¯¢ |
| | | */ |
| | | const onConfirmQuery = async () => { |
| | | const data = commonGetFormData() |
| | | ctx.emit('confirmQuery', data) |
| | | } |
| | | /** |
| | | * éç½®æ¥è¯¢ |
| | | */ |
| | | const onReset = async () => { |
| | | formData.value = {} |
| | | formData.value.ContainerNo = '' |
| | | formData.value.MaterialId = '' |
| | | //åç¶ç»ä»¶åéèªå®ä¹äºä»¶ |
| | | ctx.emit('restQuery') |
| | | } |
| | | |
| | | const updateCheckData = () => { |
| | | initiateData.value = { |
| | | formData: { |
| | | ...formData.value, |
| | | }, |
| | | } |
| | | } |
| | | const updateFormItemOptions = (propName: string, enumData: any[]) => { |
| | | const item = formItems.find((item) => item.prop === propName) |
| | | if (item && enumData) { |
| | | item.options = enumData.map((item) => ({ |
| | | label: item.description, |
| | | value: item.value, |
| | | })) |
| | | } |
| | | } |
| | | /** |
| | | * éç¨æ¥è¯¢æä¸¾ |
| | | */ |
| | | const commonQueryEnumForFrom = async () => {} |
| | | commonQueryEnumForFrom() |
| | | /** |
| | | * å¼¹çªæå¼è·å详æ
|
| | | */ |
| | | const onOpen = async () => { |
| | | disabled.value = false |
| | | updateCheckData() |
| | | } |
| | | |
| | | watch(() => current.value, onOpen) |
| | | |
| | | return { |
| | | formItems, |
| | | formData, |
| | | visible, |
| | | formRef, |
| | | onOpen, |
| | | onClose, |
| | | onConfirmQuery, |
| | | onReset, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | deleteWmsMaterialContainers, |
| | | addWmsMaterialContainer, |
| | | cloneData, |
| | | } from './Service/PipeAccessoryPick' |
| | | |
| | | export class WmsMaterialContainer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | }) |
| | | } |
| | | onMounted() {} |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @returns |
| | | */ |
| | | async deleteWmsMaterialContainers(ids: string[]) { |
| | | return deleteWmsMaterialContainers(ids) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param data |
| | | * @returns |
| | | */ |
| | | addWmsMaterialContainer(data: Record<string, any>) { |
| | | return addWmsMaterialContainer(data) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @param ids |
| | | * @returns |
| | | */ |
| | | cloneData(ids: string[]) { |
| | | return cloneData(ids) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsMaterialContainer, |
| | | getWmsMaterialContainer, |
| | | updateWmsMaterialContainer, |
| | | getWmsEnumData, |
| | | } from './Service/PipeAccessoryPickDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsMaterialContainerDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsMaterialContainer: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsMaterialContainer(data: Record<string, any>) { |
| | | return addWmsMaterialContainer(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsMaterialContainer(id: string, data: Record<string, any>) { |
| | | return updateWmsMaterialContainer(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsMaterialContainerDetail(current: any, id?: string) { |
| | | return getWmsMaterialContainer(id || current?.id) |
| | | } |
| | | |
| | | // è·åæä¸¾å¼ |
| | | async getWmsEnumData(data: Record<string, any>) { |
| | | return getWmsEnumData(data) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsMaterialContainer, |
| | | getWmsMaterialContainer, |
| | | updateWmsMaterialContainer, |
| | | getWmsEnumData, |
| | | } from './Service/PipeAccessoryPickQueryDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsMaterialContainerQueryDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsMaterialContainer: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsMaterialContainer(data: Record<string, any>) { |
| | | return addWmsMaterialContainer(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsMaterialContainer(id: string, data: Record<string, any>) { |
| | | return updateWmsMaterialContainer(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsMaterialContainerDetail(current: any, id?: string) { |
| | | return getWmsMaterialContainer(id || current?.id) |
| | | } |
| | | |
| | | // è·åæä¸¾å¼ |
| | | async getWmsEnumData(data: Record<string, any>) { |
| | | return getWmsEnumData(data) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsMaterialContainer = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsMaterialContainer', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @returns |
| | | */ |
| | | export const deleteWmsMaterialContainers = (ids: string[]) => { |
| | | return request({ |
| | | data: ids, |
| | | url: '/api/v1/HIAWms/wmsMaterialContainer', |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @returns |
| | | */ |
| | | export const cloneData = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsMaterialContainer/clone', data) |
| | | } |
| | | |
| | | /** |
| | | * ç©æåå·å表 |
| | | * @returns |
| | | */ |
| | | export const getMaterialModelList = () => { |
| | | return request.get(`/api/v1/hiawms/wmsenum/ModelList`) |
| | | } |
| | | |
| | | /** |
| | | * åºä½å·å表 |
| | | * @returns |
| | | */ |
| | | export const getPlaceNoForStockList = (data: any) => { |
| | | return request.get(`/api/v1/hiawms/wmsenum/placelist?placeType=${data}`) |
| | | } |
| | | |
| | | /** |
| | | * å
¥åº |
| | | * @returns |
| | | */ |
| | | export const instock = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsinsstock/bindinstock', data) |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ® ç®¡æ®µç¼ç ãå·¥åº æ¥è¯¢ ä½ä¸è®¡å |
| | | * @returns |
| | | */ |
| | | export const findSingleWorkPlanByFilter = (data: any) => { |
| | | return request.post('/api/v1/PipeLineLems/WorkPlan/FindSingleByFilter', data) |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ® ä»»å¡ç¼å·è¿è¡å¼å·¥ |
| | | * @returns |
| | | */ |
| | | export const startProduction = (data: any) => { |
| | | return request.post('/api/v1/PipeLineLems/WorkPlanPublic/startProduction', data) |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ® ä»»å¡ç¼å·è¿è¡å®å·¥ |
| | | * @returns |
| | | */ |
| | | export const finishProduction = (data: any) => { |
| | | return request.post('/api/v1/PipeLineLems/WorkPlanPublic/finishProduction', data) |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ® ä»»å¡ç¼å·è¿è¡å®å·¥ |
| | | * @returns |
| | | */ |
| | | export const pick = (data: any) => { |
| | | return request.post('/api/v1/PipeLineLems/WorkPlanPublic/pick', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsMaterialContainer = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsMaterialContainer', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsMaterialContainer = (id: string) => { |
| | | return request.get(`/api/v1/HIAWms/wmsMaterialContainer/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsMaterialContainer = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/HIAWms/wmsMaterialContainer/${id}`, data) |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸¾ |
| | | * @returns |
| | | */ |
| | | export const getWmsEnumData = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/WmsEnum', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsMaterialContainer = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsMaterialContainer', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsMaterialContainer = (id: string) => { |
| | | return request.get(`/api/v1/HIAWms/wmsMaterialContainer/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsMaterialContainer = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/HIAWms/wmsMaterialContainer/${id}`, data) |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸¾ |
| | | * @returns |
| | | */ |
| | | export const getWmsEnumData = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/WmsEnum', data) |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .drawer { |
| | | width: 800px; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' |
| | | import styles from './WmsMaterialContainerDrawer.module.scss' |
| | | import { useWmsMaterialContainerDrawer } from '../../../../Controllers/PipeAccessoryPickDrawer.tsx' |
| | | import DyForm from '@/components/DyForm/DyForm' |
| | | |
| | | // @ts-ignore |
| | | export default defineComponent<{ |
| | | [key: string]: any |
| | | }>({ |
| | | name: 'å¼¹çª', |
| | | props: { |
| | | modelValue: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | title: { |
| | | type: String, |
| | | default: '', |
| | | }, |
| | | row: { |
| | | type: Object, |
| | | }, |
| | | sort: { |
| | | type: Number, |
| | | default: 0, |
| | | }, |
| | | }, |
| | | emits: ['update:modelValue', 'close', 'submit', 'confirm'], |
| | | setup(props: Record<string, any>, ctx: SetupContext) { |
| | | const { |
| | | onClose, |
| | | onConfirm, |
| | | onOpen, |
| | | formRef, |
| | | visible, |
| | | formItems, |
| | | formData, |
| | | } = useWmsMaterialContainerDrawer(props, ctx) |
| | | return () => ( |
| | | <BaseDrawer |
| | | class={styles.drawer} |
| | | size="800px" |
| | | title={props.title || 'æ·»å '} |
| | | v-model={visible.value} |
| | | close-on-click-modal={true} |
| | | onConfirm={onConfirm} |
| | | onOpen={onOpen} |
| | | before-close={onClose} |
| | | onClose={onClose} |
| | | > |
| | | <DyForm |
| | | ref={formRef} |
| | | formData={formData.value} |
| | | labelWidth="106px" |
| | | formItemProps={formItems} |
| | | ></DyForm> |
| | | </BaseDrawer> |
| | | ) |
| | | }, |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .drawer { |
| | | width: 800px; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * ç©æåºç¡ä¿¡æ¯æ¥è¯¢å¼¹åºæ¡ |
| | | */ |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseQueryDrawer from '@/components/BaseQueryDrawer/BaseQueryDrawer' |
| | | import styles from './WmsMaterialContainerQueryDrawer.module.scss' |
| | | import { useWmsMaterialContainerQueryDrawer } from '../../../../Controllers/PipeAccessoryPickQueryDrawer.tsx' |
| | | import DyForm from '@/components/DyForm/DyForm' |
| | | |
| | | // @ts-ignore |
| | | export default defineComponent<{ |
| | | [key: string]: any |
| | | }>({ |
| | | name: 'å¼¹çª', |
| | | props: { |
| | | //æä¸¾ç±»ååå
¸ |
| | | enumListDict:{ |
| | | type: Array as () => Array<{ key: string; value: object }>, // å®ä¹æ°ç»å
ç´ ç±»å |
| | | default: () => [] // é»è®¤å¼ |
| | | }, |
| | | modelValue: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | title: { |
| | | type: String, |
| | | default: '', |
| | | }, |
| | | row: { |
| | | type: Object, |
| | | }, |
| | | sort: { |
| | | type: Number, |
| | | default: 0, |
| | | }, |
| | | }, |
| | | emits: ['update:modelValue', 'close', 'submit', 'confirmquery1'], |
| | | setup(props: Record<string, any>, ctx: SetupContext) { |
| | | const { |
| | | onClose, |
| | | onConfirmQuery, |
| | | onOpen, |
| | | onReset, |
| | | formRef, |
| | | visible, |
| | | formItems, |
| | | formData, |
| | | } = useWmsMaterialContainerQueryDrawer(props, ctx) |
| | | return () => ( |
| | | <BaseQueryDrawer |
| | | class={styles.drawer} |
| | | size="800px" |
| | | title={props.title || 'é«çº§æ¥è¯¢'} |
| | | v-model={visible.value} |
| | | close-on-click-modal={true} |
| | | onReset={onReset} |
| | | onConfirmQueryForBase={onConfirmQuery} |
| | | onOpen={onOpen} |
| | | before-close={onClose} |
| | | onClose={onClose} |
| | | > |
| | | <DyForm |
| | | ref={formRef} |
| | | formData={formData.value} |
| | | labelWidth="106px" |
| | | formItemProps={formItems} |
| | | ></DyForm> |
| | | </BaseQueryDrawer> |
| | | ) |
| | | }, |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export const columns = [ |
| | | { |
| | | type: 'seq', |
| | | width: 60, |
| | | title: 'åºå·', |
| | | }, |
| | | { |
| | | field: 'containerNo', |
| | | title: 'æçç¼å·', |
| | | }, |
| | | { |
| | | field: 'materialId', |
| | | title: 'ç©æID', |
| | | }, |
| | | { |
| | | field: 'sort', |
| | | title: '', |
| | | }, |
| | | { |
| | | field: 'creationTime', |
| | | title: 'æ¯å¦ç¦ç¨', |
| | | }, |
| | | { |
| | | field: 'deletionTime', |
| | | title: '', |
| | | }, |
| | | ] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .pipeAccessoryPickContent { |
| | | width: 100%; |
| | | height: 100%; |
| | | // height: 100% !important; |
| | | // overflow-y: auto !important; /* å
容è¶
åºæ¶æ¾ç¤ºæ»å¨æ¡ */ |
| | | // padding-bottom: 20px; /* é¿å
å
容被åºé¨é®æ¡ */ |
| | | |
| | | .pipeAccessoryPickList { |
| | | width: 100%; |
| | | height: calc(100% - 70px); |
| | | } |
| | | .headerContent { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | height: 43px; |
| | | } |
| | | .header { |
| | | margin-bottom: 12px; |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | align-items: center; |
| | | } |
| | | |
| | | .h5Form { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 20px; // 表å项ä¹é´çé´è· |
| | | |
| | | .el-form-item { |
| | | margin-bottom: 0; // ç§»é¤é»è®¤çåºé¨è¾¹è· |
| | | width: 100% !important; // å æ»¡ç¶å®¹å¨å®½åº¦ |
| | | } |
| | | |
| | | .el-form-item__label { |
| | | display: block; |
| | | text-align: left; |
| | | margin-bottom: 8px; |
| | | font-weight: 500; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .tagBox { |
| | | width: auto; |
| | | min-width: 80px; |
| | | height: 24px; |
| | | background: #ffffff; |
| | | border-radius: 19px 19px 19px 19px; |
| | | opacity: 1; |
| | | border: 1px dashed #bcc4cc; |
| | | width: 50px; |
| | | height: 20px; |
| | | font-size: 14px; |
| | | font-family: PingFang SC, PingFang SC; |
| | | font-weight: 400; |
| | | color: #5a84ff; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | // cursor: pointer; |
| | | } |
| | | |
| | | .group { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | |
| | | .groupTable { |
| | | width: 100%; |
| | | } |
| | | |
| | | .overBox { |
| | | width: 100%; |
| | | height: calc(100% - 20px); |
| | | overflow: auto; |
| | | :global(.cs-collapse-item__header) { |
| | | background-color: #f1f1f1; |
| | | padding: 0 20px; |
| | | height: 35px; |
| | | font-size: 16px; |
| | | font-family: PingFang SC, PingFang SC; |
| | | font-weight: 500; |
| | | } |
| | | :global(.cs-collapse-item__content) { |
| | | padding-bottom: 0px; |
| | | } |
| | | } |
| | | .groupHeader { |
| | | width: 100%; |
| | | height: 30px; |
| | | background: #ccc; |
| | | } |
| | | |
| | | .hideBlock { |
| | | display: none; |
| | | } |
| | | .queryForm { |
| | | padding: 10px; |
| | | background: #f5f7fa; |
| | | margin-bottom: 0px; |
| | | border-radius: 4px; |
| | | |
| | | .el-form-item { |
| | | margin-right: 20px; |
| | | margin-bottom: 0; |
| | | |
| | | // ç»ä¸è¾å
¥æ¡åéæ©æ¡ç宽度 |
| | | .el-input, .el-select { |
| | | width: 200px; // 设置ç»ä¸ç宽度 |
| | | } |
| | | |
| | | // éæ©æ¡å
é¨è¾å
¥æ¡æ ·å¼ |
| | | .el-select .el-input__wrapper { |
| | | height: 32px; // ä¸è¾å
¥æ¡é«åº¦ä¸è´ |
| | | padding: 1px 11px; // ä¸è¾å
¥æ¡å
è¾¹è·ä¸è´ |
| | | } |
| | | |
| | | // æ¥æéæ©å¨å®½åº¦ |
| | | .el-date-editor { |
| | | width: 220px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 妿éè¦æ´ç²¾ç¡®çæ§å¶ï¼å¯ä»¥åç¬è®¾ç½® |
| | | .formItem { |
| | | width: 200px; |
| | | |
| | | &.el-input, &.el-select { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | .newPageContent { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 20px; |
| | | padding: 20px; |
| | | background-color: white; |
| | | |
| | | .info-block { |
| | | background-color: #f9f9f9; |
| | | border: 1px solid #eaeaea; |
| | | border-radius: 5px; |
| | | padding: 20px; |
| | | width: calc(33.33% - 20px); |
| | | |
| | | .block-title { |
| | | font-size: 20px; |
| | | font-weight: bold; |
| | | margin-bottom: 15px; |
| | | } |
| | | |
| | | .info-tags { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 10px; |
| | | |
| | | .info-tag { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 5px; |
| | | |
| | | .tag-label { |
| | | font-weight: bold; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .action-buttons { |
| | | display: flex; |
| | | gap: 10px; |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .equipment-image { |
| | | width: 100%; |
| | | height: auto; |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .status-normal { |
| | | color: green; |
| | | } |
| | | } |
| | | |
| | | .process-table { |
| | | width: 100%; |
| | | margin-top: 20px; |
| | | |
| | | .el-table { |
| | | border: 1px solid #eaeaea; |
| | | border-radius: 5px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | .modelRrow { |
| | | display: flex; /* å¼¹æ§å¸å± */ |
| | | gap: 20px; /* æ§ä»¶é´è· */ |
| | | align-items: center; /* åç´å±
ä¸ */ |
| | | margin-bottom: 12px; /* åºé¨é´è· */ |
| | | width: 100%; |
| | | |
| | | .el-form-item { |
| | | flex: 1 !important; /* ååç©ºé´ */ |
| | | margin-bottom: 0; |
| | | max-width: none; // ç§»é¤æå¤§å®½åº¦éå¶ |
| | | } |
| | | |
| | | .el-select { |
| | | width: 100%; // ç¡®ä¿Selectå æ»¡ç¶å®¹å¨å®½åº¦ |
| | | |
| | | // ç§»é¤å¯è½å½±å宽度çå
鍿 ·å¼ |
| | | .el-input__wrapper { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | // ååºå¼è®¾è®¡ |
| | | @media (max-width: 1200px) { |
| | | .model-row { |
| | | flex-wrap: wrap; |
| | | |
| | | .el-form-item { |
| | | flex: 1 0 calc(50% - 10px); // å¨ä¸çå±å¹ä¸æ¯è¡æ¾ç¤º2个 |
| | | margin-bottom: 10px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | @media (max-width: 768px) { |
| | | .model-row { |
| | | flex-direction: column; |
| | | |
| | | .el-form-item { |
| | | width: 100%; // å¨å°å±å¹ä¸æ¯è¡æ¾ç¤º1个 |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .action-buttons { |
| | | display: flex; |
| | | gap: 10px; |
| | | margin-top: 20px; |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { defineComponent, onMounted, ref } from 'vue' |
| | | import type { Ref } from 'vue' |
| | | import styles from './PipeAccessoryPick.module.scss' |
| | | |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { |
| | | ElInput, |
| | | ElForm, |
| | | ElFormItem, |
| | | ElButton, |
| | | ElSelect, |
| | | ElOption, |
| | | ElMessage, |
| | | ElCol, |
| | | } from 'element-plus' |
| | | import { |
| | | getPlaceNoForStockList, |
| | | getMaterialModelList, |
| | | instock, |
| | | findSingleWorkPlanByFilter, |
| | | pick, |
| | | finishProduction |
| | | } from '@/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPick' |
| | | import { Message } from '@element-plus/icons-vue/dist/types' |
| | | |
| | | export default defineComponent({ |
| | | name: 'PipeAccessoryPick', |
| | | setup() { |
| | | // æ¥è¯¢è¡¨åæ°æ® |
| | | const queryForm = ref({ |
| | | pipeSpecCode: '', |
| | | continerNo:'', |
| | | processRouteNumber: '', |
| | | taskCode: '', |
| | | length: '', |
| | | projectNumber: '', |
| | | shipNumber: '', |
| | | material: '', |
| | | outerDiameter: '', |
| | | thickness: '', |
| | | plannedStartTime: '', |
| | | plannedEndTime: '', |
| | | workstationCode: '', |
| | | processName: '', |
| | | equipmentCode: '' |
| | | }) |
| | | |
| | | // æ°æ®æº |
| | | const modelOptions = ref<Array<{ value: string; label: string }>>([]) |
| | | const placeNoOptions = ref<Array<{ value: string; label: string }>>([]) |
| | | |
| | | onMounted(() => { |
| | | // ç»ä»¶æè½½åè·ååå·å表ååºä½å·å表 |
| | | getModelList() |
| | | getPlaceNoList() |
| | | }) |
| | | |
| | | // ç»çæä½ |
| | | const handlePalletize = () => { |
| | | console.log('ç»çæä½', queryForm.value) |
| | | // è¿éæ·»å ç»çé»è¾ |
| | | } |
| | | |
| | | // ç»çå
¥åºæä½ |
| | | const handlePalletizeStorage = () => { |
| | | console.log('ç»çå
¥åºæä½', queryForm.value) |
| | | instock(queryForm.value), resetQueryForm() |
| | | ElMessage.success({ |
| | | message: 'ç»çå
¥åºæå', |
| | | type: 'success', |
| | | }) |
| | | // è¿éæ·»å ç»çå
¥åºé»è¾ |
| | | } |
| | | |
| | | const resetQueryForm = () => { |
| | | queryForm.value.materialModel = '' |
| | | queryForm.value.placeNo = '' |
| | | queryForm.value.materialBatch = '' |
| | | queryForm.value.stockNumber = '' |
| | | } |
| | | |
| | | const getModelList = async () => { |
| | | const models = await getMaterialModelList() |
| | | modelOptions.value = models.map((item: string) => ({ |
| | | value: item.materialModel, |
| | | label: item.materialModelDesc, |
| | | })) |
| | | } |
| | | |
| | | const getPlaceNoList = async () => { |
| | | const placeNos = await getPlaceNoForStockList(2) |
| | | console.log('åºä½å·å表:', placeNos) |
| | | placeNoOptions.value = placeNos.map((item: string) => ({ |
| | | value: item.placeNo, |
| | | label: item.placeNoDesc, |
| | | })) |
| | | } |
| | | const handleChange =async (value) => { |
| | | console.log('è¾å
¥å
容确认:', value); // 失å»ç¦ç¹æå车æ¶è§¦å |
| | | // 卿¤å¤æ·»å ä¸å¡é»è¾ï¼å¦æ ¡éªãæäº¤çï¼ |
| | | const param={ |
| | | pipeSpecCode:value, |
| | | pipeSpecCode_FilterMode:2,//ç²¾åæ¥è¯¢ |
| | | processName:'è£
é
å·¥åº', |
| | | processName_FilterMode:2,//ç²¾åæ¥è¯¢ |
| | | } |
| | | const workPlan = await findSingleWorkPlanByFilter(param); |
| | | console.log('è¿å:'+workPlan); |
| | | if(workPlan==''){ |
| | | ElMessage.error('æ²¡ææ¾å°æ°æ®'); |
| | | queryForm.value ={ pipeSpecCode: '', |
| | | continerNo:'', |
| | | processRouteNumber: '', |
| | | taskCode: '', |
| | | length: '', |
| | | projectNumber: '', |
| | | shipNumber: '', |
| | | material: '', |
| | | outerDiameter: '', |
| | | thickness: '', |
| | | plannedStartTime: '', |
| | | plannedEndTime: '', |
| | | workstationCode: '', |
| | | processName: '', |
| | | equipmentCode: ''} |
| | | }else{ |
| | | queryForm.value=workPlan; |
| | | } |
| | | }; |
| | | |
| | | // 忣äºä»¶å¤ç |
| | | const startWork = () => { |
| | | console.log('æ§è¡å¼å·¥æä½'); |
| | | if(queryForm.value.pipeSpecCode==''){ |
| | | ElMessage.error('请è¾å
¥ç®¡æ®µç¼ç '); |
| | | return |
| | | } |
| | | if(queryForm.value.continerNo==''){ |
| | | ElMessage.error('请è¾å
¥æçå·'); |
| | | return |
| | | } |
| | | ConfirmBox( |
| | | `ç¡®å®è¦å°ç®¡æ®µç¼ç ${queryForm.value.pipeSpecCode}忣å` |
| | | ).then(async () => { |
| | | //æ¨çä¸å¡é»è¾ |
| | | const param={ |
| | | pipeSpecCode:queryForm.value.pipeSpecCode, |
| | | continerNo:queryForm.value.continerNo, |
| | | }; |
| | | const ret = await pick(param); |
| | | console.log('è¿å:'+ret); |
| | | if(ret.code="200"){ |
| | | ElMessage.success('忣æå'); |
| | | }else{ |
| | | ElMessage.error('åæ£å¤±è´¥:'+ret.message); |
| | | } |
| | | }) |
| | | } |
| | | // å®å·¥äºä»¶å¤ç |
| | | const finishWork = () => { |
| | | console.log('æ§è¡å¼å·¥æä½'); |
| | | if(queryForm.value.pipeSpecCode==''){ |
| | | ElMessage.error('请è¾å
¥ç®¡æ®µç¼ç '); |
| | | return |
| | | } |
| | | ConfirmBox( |
| | | `ç¡®å®è¦å°ç®¡æ®µç¼ç ${queryForm.value.pipeSpecCode}å®å·¥å` |
| | | ).then(async () => { |
| | | //æ¨çä¸å¡é»è¾ |
| | | const param={ |
| | | pipeSpecCode:queryForm.value.pipeSpecCode, |
| | | processName:queryForm.value.processName, |
| | | }; |
| | | const ret = await finishProduction(param); |
| | | console.log('è¿å:'+ret); |
| | | if(ret.code="200"){ |
| | | ElMessage.success('å®å·¥æå'); |
| | | }else{ |
| | | ElMessage.error('å®å·¥å¤±è´¥:'+ret.message); |
| | | } |
| | | }) |
| | | } |
| | | const tableData = ref([ |
| | | { sequence: 1, flangeA: 'RF-200-1.6MPa', flangeB: 'WN-200-1.6MPa' }, |
| | | { sequence: 2, flangeA: 'WN-250-2.5MPa', flangeB: 'SO-250-2.5MPa' }, |
| | | { sequence: 3, flangeA: 'PL-300-1.0MPa', flangeB: 'RF-300-1.0MPa' }, |
| | | { sequence: 4, flangeA: 'SO-150-2.0MPa', flangeB: 'WN-150-2.0MPa' }, |
| | | { sequence: 5, flangeA: 'RF-400-1.6MPa', flangeB: 'PL-400-1.6MPa' }, |
| | | { sequence: 6, flangeA: 'WN-200-4.0MPa', flangeB: 'SO-200-4.0MPa' }, |
| | | { sequence: 7, flangeA: 'SO-300-1.6MPa', flangeB: 'RF-300-1.6MPa' }, |
| | | { sequence: 8, flangeA: 'PL-250-1.0MPa', flangeB: 'WN-250-1.0MPa' }, |
| | | { sequence: 9, flangeA: 'RF-150-2.5MPa', flangeB: 'SO-150-2.5MPa' }, |
| | | { sequence: 10, flangeA: 'WN-400-2.0MPa', flangeB: 'PL-400-2.0MPa' } |
| | | ]); |
| | | |
| | | |
| | | return () => { |
| | | return ( |
| | | <div |
| | | class={styles.PipeAccessoryPickContent} |
| | | style="overflow-y: auto !important; height: 100%;" |
| | | > |
| | | <ElFormItem label="管段ç¼ç "> |
| | | <ElInput |
| | | v-model={queryForm.value.pipeSpecCode} |
| | | clearable |
| | | class={styles.formInput} |
| | | onInput={handleChange} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="æçå· "> |
| | | <ElInput |
| | | v-model={queryForm.value.continerNo} |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <div class={styles.actionButtons}> |
| | | <ElButton type="warning" onClick={startWork}>忣</ElButton> |
| | | {/* <ElButton type="warning" onClick={finishWork}>å®å·¥</ElButton> */} |
| | | {/* <ElButton type="warning">æå</ElButton> |
| | | <ElButton type="warning">èªå¨</ElButton> |
| | | <ElButton type="warning">è´¨æ£</ElButton> */} |
| | | </div> |
| | | |
| | | <h2 class={styles.blockTitle}>å½åä»»å¡</h2> |
| | | <ElForm label-position="left" > |
| | | |
| | | <ElFormItem label="ç©ææµå "> |
| | | <ElInput |
| | | v-model={queryForm.value.processRouteNumber} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="ä»»å¡ç¼å· "> |
| | | <ElInput |
| | | v-model={queryForm.value.taskCode} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="管段é¿åº¦ "> |
| | | <ElInput |
| | | v-model={queryForm.value.length} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="é¡¹ç® å·"> |
| | | <ElInput |
| | | v-model={queryForm.value.projectNumber} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="è¹ å·"> |
| | | <ElInput |
| | | v-model={queryForm.value.shipNumber} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="æ è´¨"> |
| | | <ElInput |
| | | v-model={queryForm.value.material} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="å¤ å¾"> |
| | | <ElInput |
| | | v-model={queryForm.value.outerDiameter} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="å£ å"> |
| | | <ElInput |
| | | v-model={queryForm.value.thickness} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="计åå¼å§æ¶é´"> |
| | | <ElInput |
| | | v-model={queryForm.value.plannedStartTime} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="计å宿æ¶é´"> |
| | | <ElInput |
| | | v-model={queryForm.value.plannedEndTime} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | </ElForm> |
| | | |
| | | <h2 class={styles.blockTitle}>å½åå·¥ä½/设å¤ä¿¡æ¯</h2> |
| | | <ElForm label-position="left" > |
| | | <ElFormItem label="å·¥ä½ä»£ç "> |
| | | <ElInput |
| | | v-model={queryForm.value.workstationCode} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="å·¥åºåç§° "> |
| | | <ElInput |
| | | v-model={queryForm.value.processName} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="设å¤ä»£ç "> |
| | | <ElInput |
| | | v-model={queryForm.value.equipmentCode} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | {/* <ElFormItem label="设å¤ç¶æ"> |
| | | <ElInput |
| | | v-model={queryForm.value.materialBatch} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> */} |
| | | {/* <ElFormItem label="æä½äºº"> |
| | | <ElInput |
| | | v-model={queryForm.value.materialBatch} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> */} |
| | | </ElForm> |
| | | |
| | | {/* <div class="info-block"> |
| | | <h2 class="block-title">å·¥èºä¿¡æ¯</h2> |
| | | <el-table stripe v-model:dataSource={tableData}> |
| | | <el-table-column prop="sequence" label="åº"></el-table-column> |
| | | <el-table-column prop="flangeA" label="æ³å
°A"></el-table-column> |
| | | <el-table-column prop="flangeB" label="æ³å
°B"></el-table-column> |
| | | </el-table> |
| | | </div> */} |
| | | </div> |
| | | ) |
| | | } |
| | | }, |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .PipeAccessoryPick { |
| | | background-color: #fff; |
| | | border-radius: 5px 5px 0 0; |
| | | width: 100%; |
| | | height: 100%; |
| | | border: 1px solid #dbdbdb; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { |
| | | Component, |
| | | DefineComponent, |
| | | defineComponent, |
| | | markRaw, |
| | | ref, |
| | | SetupContext, |
| | | onMounted, |
| | | } from 'vue' |
| | | import styles from './PipeAccessoryPick.module.scss' |
| | | import Tab from '@/components/Tab/Tab' |
| | | import { useProvideModels } from '@/libs/Provider/app' |
| | | import { usePermission } from '@/libs/Permission/Permission' |
| | | import { permissionCodes } from '../enum' |
| | | import { ModuleType, TabItem } from '../type/Type' |
| | | import { getEntityNames } from '@/hooks/hook' |
| | | import TabPane from '@/components/Tab/TabPane' |
| | | |
| | | const Models: ModuleType = import.meta.glob('./config/*.json', { |
| | | eager: true, |
| | | }) |
| | | |
| | | const entityNames = getEntityNames(Models) |
| | | |
| | | const nameToLabelMap = [{ name: 'PipeAccessoryPick', label: '忣' }] |
| | | |
| | | export default defineComponent({ |
| | | name: 'PipeAccessoryPick', |
| | | |
| | | setup(props, ctx: SetupContext) { |
| | | useProvideModels() |
| | | usePermission(props, permissionCodes) |
| | | |
| | | const rf = ref<{ |
| | | [key: string]: any |
| | | }>({}) |
| | | |
| | | const tabData = ref<TabItem[]>([]) |
| | | |
| | | const onTabChange = (v: string) => { |
| | | rf.value?.[v]?.reloadList() |
| | | } |
| | | |
| | | const initTableData = async () => { |
| | | for (const i in entityNames) { |
| | | const name = entityNames[i] |
| | | const module = await import(`./Pages/${name}/${name}.tsx`) |
| | | const PipeAccessoryPick = markRaw(module.default) |
| | | const foundLabel = |
| | | nameToLabelMap.find((item) => item.name === name)?.label || name |
| | | tabData.value.push({ |
| | | label: foundLabel, |
| | | name, |
| | | component: PipeAccessoryPick, |
| | | }) |
| | | } |
| | | } |
| | | |
| | | initTableData() |
| | | |
| | | return () => { |
| | | return ( |
| | | <div class={styles.PipeAccessoryPick}> |
| | | <Tab data={tabData.value} type="list" onTab={onTabChange}> |
| | | {tabData.value.map((widgetInfo) => { |
| | | const Widget: any = widgetInfo.component |
| | | return ( |
| | | <TabPane label={widgetInfo.label} name={widgetInfo.name}> |
| | | <Widget |
| | | ref={(r: any) => (rf.value['PipeAccessoryPick'] = r)} |
| | | ></Widget> |
| | | </TabPane> |
| | | ) |
| | | })} |
| | | </Tab> |
| | | </div> |
| | | ) |
| | | } |
| | | }, |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "PipeAccessoryPick" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface TabType { |
| | | label: string |
| | | name: string |
| | | columns?: any[] |
| | | data?: any[] |
| | | isFooter: boolean |
| | | [key: string]: any |
| | | } |
| | | |
| | | export const permissionCodes = { |
| | | 'PipeAccessoryPick-list': 'å表-å表', |
| | | 'PipeAccessoryPick-add': 'å表-æ·»å ', |
| | | 'PipeAccessoryPick-import': 'å表-导å
¥', |
| | | 'PipeAccessoryPick-output': 'å表-è¾åº', |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import PipeAccessoryPick from './Views/PipeAccessoryPick' |
| | | import Setting from '@/components/Setting/Setting' |
| | | import { provider } from '@/provider/index' |
| | | import p from '../../assets/svg/p.svg' |
| | | |
| | | export default { |
| | | is: 'PipeAccessoryPick', |
| | | name: '忣', |
| | | category: 'run', |
| | | icon: p, |
| | | authorizationRequired: false, |
| | | canvasView: provider(PipeAccessoryPick), |
| | | settingsView: Setting, |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Component } from 'vue' |
| | | |
| | | export interface DataItemType { |
| | | id?: string |
| | | name?: string |
| | | code?: string |
| | | description?: string |
| | | label?: string |
| | | value?: string | number |
| | | } |
| | | |
| | | export interface WmsMaterialContainerBaseType { |
| | | id?: string |
| | | name?: string |
| | | code?: string |
| | | value?: number |
| | | description?: string |
| | | options?: Array<DataItemType> |
| | | abilityValue?: number | string |
| | | data?: DataItemType |
| | | defaultValue?: string | number |
| | | flow: string |
| | | } |
| | | |
| | | export interface FlowDefinitionType { |
| | | id?: string |
| | | name?: string |
| | | code?: string |
| | | description?: string |
| | | } |
| | | |
| | | export type ModuleType = Record< |
| | | string, |
| | | { |
| | | default: Record<string, string> |
| | | name: string |
| | | } |
| | | > |
| | | |
| | | export interface TabItem { |
| | | name: string |
| | | label: string |
| | | component: Component |
| | | hidden?: boolean |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { importFileToService, exportFileToClient } from '@/api/file' |
| | | import { ElMessage } from 'element-plus' |
| | | import { downloadFile } from '@/utils' |
| | | import dayjs from 'dayjs' |
| | | |
| | | export const useFile = () => { |
| | | /** |
| | | * 导å
¥æä»¶ |
| | | * @param url |
| | | */ |
| | | const importFile = async (url: string, file: File) => { |
| | | const formData = new FormData() |
| | | formData.append('file', file) |
| | | await importFileToService(url, formData) |
| | | ElMessage('导å
¥æå') |
| | | } |
| | | /** |
| | | * å¯¼åºæä»¶ |
| | | * @param url |
| | | */ |
| | | const exportFile = async (url: string, params: any, name: string) => { |
| | | const res = await exportFileToClient(url, params) |
| | | downloadFile(res, `${name}_${dayjs().format('YYYYMMDDHHMMss')}.xlsx`) |
| | | ElMessage.success('å¯¼åºæå') |
| | | } |
| | | |
| | | return { |
| | | importFile, |
| | | exportFile, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { WmsMaterialContainer } from '../Models/PipeAccessoryWeld' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { useFile } from './File' |
| | | |
| | | interface CurrentType { |
| | | row: any |
| | | index: number |
| | | } |
| | | export const useWmsMaterialContainer = (props: any, ctx?: any) => { |
| | | const wmsMaterialContainer = injectModel<WmsMaterialContainer>('wmsMaterialContainer') |
| | | const { exportFile } = useFile() |
| | | /** |
| | | * 头é¨é
ç½® |
| | | */ |
| | | const headers = ref({}) |
| | | /** |
| | | * 卿åé
ç½® |
| | | */ |
| | | const wmsMaterialContainerColumns = ref<Record<string, any>>([]) |
| | | /** |
| | | * æç´¢å¼ |
| | | */ |
| | | const search = ref('') |
| | | |
| | | /** |
| | | * æåº |
| | | */ |
| | | const sort = ref(0) |
| | | /** |
| | | * 鿩项 |
| | | */ |
| | | const selection = ref([]) |
| | | /** |
| | | * å½åéä¸çè¡ |
| | | */ |
| | | const current = ref<any>(null) |
| | | /** |
| | | * æ°æ®æº |
| | | */ |
| | | const dataSource: Ref<any[]> = ref([]) |
| | | |
| | | /** |
| | | * è¡¨æ ¼ |
| | | */ |
| | | const tableRef = ref() |
| | | const dialogConfig = reactive({ |
| | | visible: false, |
| | | title: '', |
| | | isAdd: false, |
| | | }) |
| | | const dialogConfigForQuery = reactive({ |
| | | visible: false, |
| | | title: '', |
| | | isAdd: false, |
| | | }) |
| | | |
| | | |
| | | const dialogSettingConfig = reactive({ |
| | | visible: false, |
| | | title: '', |
| | | }) |
| | | |
| | | /** |
| | | * åé¡µæ°æ® |
| | | */ |
| | | const paginationParams = ref({}) |
| | | |
| | | /** |
| | | * æå¼è¯¦æ
|
| | | * @param row |
| | | */ |
| | | const openDetail = (row: any) => { |
| | | current.value = row |
| | | dialogConfig.visible = true |
| | | dialogConfig.title = row.name |
| | | dialogConfig.isAdd = false |
| | | sort.value = row.sort |
| | | } |
| | | |
| | | const contextMenu = [ |
| | | { |
| | | label: 'å±å¼è¯¦æ
', |
| | | fn: (c: CurrentType) => { |
| | | current.value = null |
| | | sort.value = c.row.sort |
| | | nextTick(() => openDetail(c.row)) |
| | | }, |
| | | divided: true, |
| | | icon: 'o', |
| | | }, |
| | | // { |
| | | // label: 'å䏿·»å ', |
| | | // fn: (c: CurrentType, pageNum: number) => { |
| | | // current.value = null |
| | | // sort.value = c.index + 1 + (pageNum - 1) * 50 |
| | | // dialogConfig.visible = true |
| | | // dialogConfig.title = 'æ·»å ' |
| | | // dialogConfig.isAdd = false |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'up', |
| | | // }, |
| | | // { |
| | | // label: 'å䏿·»å ', |
| | | // fn: (c: CurrentType, pageNum: number) => { |
| | | // current.value = null |
| | | // sort.value = c.index + 2 + (pageNum - 1) * 50 |
| | | // dialogConfig.visible = true |
| | | // dialogConfig.title = 'æ·»å ' |
| | | // dialogConfig.isAdd = false |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'down', |
| | | // }, |
| | | // { |
| | | // label: 'åå»ºå¯æ¬', |
| | | // fn: async ({ row }: CurrentType) => { |
| | | // await wmsMaterialContainer.cloneData([row.id]) |
| | | // ElMessage.success('åå»ºå¯æ¬æå') |
| | | // tableRef.value?.getList() |
| | | // }, |
| | | // divided: true, |
| | | // icon: 'copy', |
| | | // }, |
| | | { |
| | | label: 'å é¤', |
| | | fn: async (c: CurrentType) => { |
| | | const names = selection.value.map((item: { materialId: string }) => item.materialId) |
| | | ConfirmBox( |
| | | `æ¯å¦å é¤${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]) |
| | | ElMessage.success('å 餿å') |
| | | tableRef.value.getList() |
| | | }) |
| | | }, |
| | | icon: 'close', |
| | | }, |
| | | ] |
| | | |
| | | const onCheck = (records: any) => { |
| | | selection.value = records |
| | | } |
| | | |
| | | const onAddWmsMaterialContainer = () => { |
| | | const params = tableRef.value?.getPaginationParams() |
| | | current.value = null |
| | | dialogConfig.visible = true |
| | | dialogConfig.isAdd = true |
| | | dialogConfig.title = 'æ·»å ' |
| | | sort.value = params.totalCount + 1 |
| | | } |
| | | |
| | | //ç¹å»æé®ãé«çº§æ¥è¯¢ã |
| | | const onAdvancedQuery = () => { |
| | | const params = tableRef.value?.getPaginationParams() |
| | | current.value = null |
| | | dialogConfigForQuery.visible = true |
| | | dialogConfigForQuery.isAdd = true |
| | | dialogConfigForQuery.title = 'é«çº§æ¥è¯¢' |
| | | } |
| | | |
| | | const onConfirmWmsMaterialContainer = async () => { |
| | | dialogConfig.visible = false |
| | | if (dialogConfig.isAdd) { |
| | | tableRef.value?.scrollToRow({ |
| | | skip: true, |
| | | }) |
| | | } else { |
| | | await tableRef.value?.getList() |
| | | } |
| | | } |
| | | /** |
| | | * è¡ç¹å»æ¶æ´æ°current |
| | | */ |
| | | const onRowClick = ({ row }: any) => { |
| | | if (dialogConfig.visible && current.value) { |
| | | current.value = row |
| | | } |
| | | } |
| | | /** |
| | | * å¯¼åº |
| | | */ |
| | | const onExport = (data={}) => { |
| | | //const params = tableRef.value?.getParams() |
| | | exportFile('/api/v1/HIAWms/wmsMaterialContainer/export', data, 'wmsMaterialContainer') |
| | | } |
| | | |
| | | /** |
| | | * å
³é®åæç´¢ |
| | | */ |
| | | const onSearch = () => { |
| | | tableRef.value?.getList({ |
| | | Filter: search.value, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * éç½®è¡¨æ ¼æ°æ® |
| | | */ |
| | | const reloadList = () => { |
| | | tableRef.value?.getList() |
| | | } |
| | | /** |
| | | * ä¸ä¼ æå |
| | | */ |
| | | const onSuccess = () => { |
| | | tableRef.value?.getList() |
| | | ElMessage.success('导å
¥æå') |
| | | } |
| | | /** |
| | | * 失败 |
| | | * @param err |
| | | */ |
| | | const onError = (err: any) => { |
| | | try { |
| | | const message = JSON.parse(err.message) |
| | | ElMessage.error(message.msg) |
| | | } catch (error) { |
| | | ElMessage.error('导å
¥å¤±è´¥') |
| | | } |
| | | } |
| | | /** |
| | | * ä¸ä¼ é©å |
| | | */ |
| | | const onBeforeUpload = (file: File) => { |
| | | const format = ['xlsx', 'xls', 'csv'] |
| | | if (!format.includes(file.name.split('.')[1])) { |
| | | ElMessage.error('导å
¥æä»¶æ ¼å¼ä¸æ£ç¡®ï¼è¯·å¯¼å
¥.xlsx/.xlsä¸.csvæ ¼å¼çæä»¶') |
| | | return false |
| | | } |
| | | return true |
| | | } |
| | | |
| | | onMounted(() => { |
| | | headers.value = { |
| | | Authorization: `Bearer ${sessionStorage.getItem('Token')}`, |
| | | 'X-Project': sessionStorage.getItem('X-Project'), |
| | | } |
| | | }) |
| | | |
| | | ctx.expose({ |
| | | reloadList, |
| | | }) |
| | | |
| | | return { |
| | | dataSource, |
| | | contextMenu, |
| | | dialogConfig, |
| | | dialogConfigForQuery, |
| | | dialogSettingConfig, |
| | | tableRef, |
| | | current, |
| | | search, |
| | | sort, |
| | | wmsMaterialContainerColumns, |
| | | paginationParams, |
| | | headers, |
| | | onBeforeUpload, |
| | | onError, |
| | | onSuccess, |
| | | openDetail, |
| | | onSearch, |
| | | onExport, |
| | | onRowClick, |
| | | onConfirmWmsMaterialContainer, |
| | | onCheck, |
| | | onAddWmsMaterialContainer, |
| | | onAdvancedQuery |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { |
| | | ref, |
| | | onMounted, |
| | | reactive, |
| | | computed, |
| | | Ref, |
| | | watch, |
| | | SetupContext, |
| | | h, |
| | | } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { WmsMaterialContainerDrawer } from '../Models/PipeAccessoryWeldDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useWmsMaterialContainerDrawer = (props: any, ctx?: any) => { |
| | | const wmsMaterialContainerDrawer = injectModel<WmsMaterialContainerDrawer>( |
| | | 'wmsMaterialContainerDrawer' |
| | | ) |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | | const initiateData: Ref<Record<string, any>> = ref({}) |
| | | const formData = ref<Record<string, any>>({}) |
| | | // ref |
| | | const formRef = ref() |
| | | |
| | | const disabled = ref(false) |
| | | |
| | | const current = computed(() => { |
| | | return props.row || null |
| | | }) |
| | | |
| | | const datePicker = (attrs) => { |
| | | return ( |
| | | <el-date-picker |
| | | type="date" |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | formatValue="YYYY-MM-DD HH:mm:ss" |
| | | {...attrs} |
| | | ></el-date-picker> |
| | | ) |
| | | } |
| | | |
| | | const dateTimePicker = (attrs) => { |
| | | return ( |
| | | <el-date-picker |
| | | type="datetime" |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | {...attrs} |
| | | ></el-date-picker> |
| | | ) |
| | | } |
| | | |
| | | const visible = computed({ |
| | | get() { |
| | | return props.modelValue |
| | | }, |
| | | set(val) { |
| | | ctx.emit('update:modelValue', val) |
| | | }, |
| | | }) |
| | | /** |
| | | * æ·»å çformåæ®µ |
| | | */ |
| | | const formItems = reactive([ |
| | | { |
| | | label: 'æçç¼å·', |
| | | prop: 'containerNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æçç¼å·', |
| | | rules: [{ required: true, message: 'æçç¼å·ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: 'ç©æID', |
| | | prop: 'materialId', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç©æID', |
| | | rules: [{ required: true, message: 'ç©æIDä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | }, |
| | | ]) |
| | | /** |
| | | * æ ¡éªæ¯å¦ææ°æ®åå |
| | | */ |
| | | const checkIsEqualObject = () => { |
| | | const data = { |
| | | formData: formData.value, |
| | | } |
| | | const check = isEqual(initiateData.value, data) |
| | | return check |
| | | } |
| | | |
| | | const onClose = (done: () => void) => { |
| | | if (visible.value) { |
| | | if (checkIsEqualObject()) { |
| | | visible.value = false |
| | | done && done() |
| | | } else { |
| | | ConfirmBox('æ¯å¦ä¿å设置ï¼') |
| | | .then(() => { |
| | | onConfirm() |
| | | }) |
| | | .catch(() => { |
| | | visible.value = false |
| | | done && done() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * ä¿å |
| | | */ |
| | | const onConfirm = async () => { |
| | | await formRef.value?.validate() |
| | | const data = { |
| | | containerNo: formData.value.containerNo, |
| | | materialId: formData.value.materialId, |
| | | } |
| | | if (!current.value) { |
| | | await wmsMaterialContainerDrawer.addWmsMaterialContainer(data) |
| | | } else { |
| | | const id = current.value.id |
| | | await wmsMaterialContainerDrawer.updateWmsMaterialContainer(id, data) |
| | | } |
| | | ElMessage.success('ä¿åæå') |
| | | ctx.emit('confirm') |
| | | } |
| | | |
| | | const updateCheckData = () => { |
| | | initiateData.value = { |
| | | formData: { |
| | | ...formData.value, |
| | | }, |
| | | } |
| | | } |
| | | const updateFormItemOptions = (propName: string, enumData: any[]) => { |
| | | const item = formItems.find((item) => item.prop === propName) |
| | | if (item && enumData) { |
| | | item.options = enumData.map((item) => ({ |
| | | label: item.description, |
| | | value: item.value, |
| | | })) |
| | | } |
| | | } |
| | | /** |
| | | * éç¨æ¥è¯¢æä¸¾ |
| | | */ |
| | | const commonQueryEnumForFrom = async () => {} |
| | | commonQueryEnumForFrom() |
| | | /** |
| | | * å¼¹çªæå¼è·å详æ
|
| | | */ |
| | | const onOpen = async () => { |
| | | if (current.value) { |
| | | const res = |
| | | await wmsMaterialContainerDrawer.getWmsMaterialContainerDetail( |
| | | current.value |
| | | ) |
| | | |
| | | formData.value = { |
| | | containerNo: res.containerNo, |
| | | materialId: res.materialId, |
| | | id: res.id, |
| | | } |
| | | disabled.value = true |
| | | updateCheckData() |
| | | } else { |
| | | formData.value = {} |
| | | |
| | | disabled.value = false |
| | | updateCheckData() |
| | | } |
| | | } |
| | | |
| | | watch(() => current.value, onOpen) |
| | | |
| | | return { |
| | | formItems, |
| | | formData, |
| | | visible, |
| | | formRef, |
| | | onOpen, |
| | | onClose, |
| | | onConfirm, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { |
| | | ref, |
| | | onMounted, |
| | | reactive, |
| | | computed, |
| | | Ref, |
| | | watch, |
| | | SetupContext, |
| | | h, |
| | | } from 'vue' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | import { WmsMaterialContainerDrawer } from '../Models/PipeAccessoryWeldDrawer' |
| | | import { ElMessage } from 'element-plus' |
| | | import isEqual from 'lodash/isEqual' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { cloneDeep } from 'lodash' |
| | | |
| | | export const useWmsMaterialContainerQueryDrawer = (props: any, ctx?: any) => { |
| | | const wmsMaterialContainerDrawer = injectModel<WmsMaterialContainerDrawer>( |
| | | 'WmsMaterialContainerDrawer' |
| | | ) |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | | const initiateData: Ref<Record<string, any>> = ref({}) |
| | | const formData = ref<Record<string, any>>({}) |
| | | // ref |
| | | const formRef = ref() |
| | | |
| | | const disabled = ref(false) |
| | | |
| | | const current = computed(() => { |
| | | return props.row || null |
| | | }) |
| | | |
| | | const inputNumber = (attrs) => { |
| | | return ( |
| | | <el-input-number |
| | | min="1" |
| | | step="1" |
| | | precision="0" |
| | | {...attrs} |
| | | ></el-input-number> |
| | | ) |
| | | } |
| | | |
| | | const datePickerRange = (attrs) => { |
| | | return ( |
| | | <el-date-picker |
| | | type="daterange" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | {...attrs} |
| | | ></el-date-picker> |
| | | ) |
| | | } |
| | | |
| | | const dateTimePickerRange = (attrs) => { |
| | | return ( |
| | | <el-date-picker |
| | | type="datetimerange" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | {...attrs} |
| | | ></el-date-picker> |
| | | ) |
| | | } |
| | | |
| | | const visible = computed({ |
| | | get() { |
| | | return props.modelValue |
| | | }, |
| | | set(val) { |
| | | ctx.emit('update:modelValue', val) |
| | | }, |
| | | }) |
| | | /** |
| | | * æ·»å çformåæ®µ |
| | | */ |
| | | const formItems = reactive([ |
| | | { |
| | | label: 'æçç¼å·', |
| | | prop: 'containerNo', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥æçç¼å·', |
| | | }, |
| | | { |
| | | label: 'ç©æID', |
| | | prop: 'materialId', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ç©æID', |
| | | }, |
| | | ]) |
| | | /** |
| | | * æ ¡éªæ¯å¦ææ°æ®åå |
| | | */ |
| | | const checkIsEqualObject = () => { |
| | | const data = { |
| | | formData: formData.value, |
| | | } |
| | | const check = isEqual(initiateData.value, data) |
| | | return check |
| | | } |
| | | const commonGetFormData = () => { |
| | | const data = { |
| | | containerNo: formData.value.containerNo || '', |
| | | materialId: formData.value.materialId || '', |
| | | } |
| | | return data |
| | | } |
| | | const onClose = (done: () => void) => { |
| | | if (visible.value) { |
| | | visible.value = false |
| | | const data = commonGetFormData() |
| | | ctx.emit('close', data) |
| | | } |
| | | } |
| | | /** |
| | | * 确认æ¥è¯¢ |
| | | */ |
| | | const onConfirmQuery = async () => { |
| | | const data = commonGetFormData() |
| | | ctx.emit('confirmQuery', data) |
| | | } |
| | | /** |
| | | * éç½®æ¥è¯¢ |
| | | */ |
| | | const onReset = async () => { |
| | | formData.value = {} |
| | | formData.value.ContainerNo = '' |
| | | formData.value.MaterialId = '' |
| | | //åç¶ç»ä»¶åéèªå®ä¹äºä»¶ |
| | | ctx.emit('restQuery') |
| | | } |
| | | |
| | | const updateCheckData = () => { |
| | | initiateData.value = { |
| | | formData: { |
| | | ...formData.value, |
| | | }, |
| | | } |
| | | } |
| | | const updateFormItemOptions = (propName: string, enumData: any[]) => { |
| | | const item = formItems.find((item) => item.prop === propName) |
| | | if (item && enumData) { |
| | | item.options = enumData.map((item) => ({ |
| | | label: item.description, |
| | | value: item.value, |
| | | })) |
| | | } |
| | | } |
| | | /** |
| | | * éç¨æ¥è¯¢æä¸¾ |
| | | */ |
| | | const commonQueryEnumForFrom = async () => {} |
| | | commonQueryEnumForFrom() |
| | | /** |
| | | * å¼¹çªæå¼è·å详æ
|
| | | */ |
| | | const onOpen = async () => { |
| | | disabled.value = false |
| | | updateCheckData() |
| | | } |
| | | |
| | | watch(() => current.value, onOpen) |
| | | |
| | | return { |
| | | formItems, |
| | | formData, |
| | | visible, |
| | | formRef, |
| | | onOpen, |
| | | onClose, |
| | | onConfirmQuery, |
| | | onReset, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | deleteWmsMaterialContainers, |
| | | addWmsMaterialContainer, |
| | | cloneData, |
| | | } from './Service/PipeAccessoryWeld' |
| | | |
| | | export class WmsMaterialContainer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | }) |
| | | } |
| | | onMounted() {} |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @returns |
| | | */ |
| | | async deleteWmsMaterialContainers(ids: string[]) { |
| | | return deleteWmsMaterialContainers(ids) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * @param data |
| | | * @returns |
| | | */ |
| | | addWmsMaterialContainer(data: Record<string, any>) { |
| | | return addWmsMaterialContainer(data) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @param ids |
| | | * @returns |
| | | */ |
| | | cloneData(ids: string[]) { |
| | | return cloneData(ids) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsMaterialContainer, |
| | | getWmsMaterialContainer, |
| | | updateWmsMaterialContainer, |
| | | getWmsEnumData, |
| | | } from './Service/PipeAccessoryWeldDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsMaterialContainerDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsMaterialContainer: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsMaterialContainer(data: Record<string, any>) { |
| | | return addWmsMaterialContainer(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsMaterialContainer(id: string, data: Record<string, any>) { |
| | | return updateWmsMaterialContainer(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsMaterialContainerDetail(current: any, id?: string) { |
| | | return getWmsMaterialContainer(id || current?.id) |
| | | } |
| | | |
| | | // è·åæä¸¾å¼ |
| | | async getWmsEnumData(data: Record<string, any>) { |
| | | return getWmsEnumData(data) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | import { |
| | | addWmsMaterialContainer, |
| | | getWmsMaterialContainer, |
| | | updateWmsMaterialContainer, |
| | | getWmsEnumData, |
| | | } from './Service/PipeAccessoryWeldQueryDrawer' |
| | | import { useGlobalState } from '@/libs/Store/Store' |
| | | |
| | | export class WmsMaterialContainerQueryDrawer extends Base<{ [key: string]: any }> { |
| | | constructor() { |
| | | super({ |
| | | data: [], |
| | | wmsMaterialContainer: {}, |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param data |
| | | */ |
| | | async addWmsMaterialContainer(data: Record<string, any>) { |
| | | return addWmsMaterialContainer(data) |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @param data |
| | | */ |
| | | async updateWmsMaterialContainer(id: string, data: Record<string, any>) { |
| | | return updateWmsMaterialContainer(id, data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | async getWmsMaterialContainerDetail(current: any, id?: string) { |
| | | return getWmsMaterialContainer(id || current?.id) |
| | | } |
| | | |
| | | // è·åæä¸¾å¼ |
| | | async getWmsEnumData(data: Record<string, any>) { |
| | | return getWmsEnumData(data) |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsMaterialContainer = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsMaterialContainer', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @returns |
| | | */ |
| | | export const deleteWmsMaterialContainers = (ids: string[]) => { |
| | | return request({ |
| | | data: ids, |
| | | url: '/api/v1/HIAWms/wmsMaterialContainer', |
| | | method: 'delete', |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * å
é |
| | | * @returns |
| | | */ |
| | | export const cloneData = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsMaterialContainer/clone', data) |
| | | } |
| | | |
| | | /** |
| | | * ç©æåå·å表 |
| | | * @returns |
| | | */ |
| | | export const getMaterialModelList = () => { |
| | | return request.get(`/api/v1/hiawms/wmsenum/ModelList`) |
| | | } |
| | | |
| | | /** |
| | | * åºä½å·å表 |
| | | * @returns |
| | | */ |
| | | export const getPlaceNoForStockList = (data: any) => { |
| | | return request.get(`/api/v1/hiawms/wmsenum/placelist?placeType=${data}`) |
| | | } |
| | | |
| | | /** |
| | | * å
¥åº |
| | | * @returns |
| | | */ |
| | | export const instock = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsinsstock/bindinstock', data) |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ® ç®¡æ®µç¼ç ãå·¥åº æ¥è¯¢ ä½ä¸è®¡å |
| | | * @returns |
| | | */ |
| | | export const findSingleWorkPlanByFilter = (data: any) => { |
| | | return request.post('/api/v1/PipeLineLems/WorkPlan/FindSingleByFilter', data) |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ® ä»»å¡ç¼å·è¿è¡å¼å·¥ |
| | | * @returns |
| | | */ |
| | | export const startProduction = (data: any) => { |
| | | return request.post('/api/v1/PipeLineLems/WorkPlanPublic/startProduction', data) |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ® ä»»å¡ç¼å·è¿è¡å®å·¥ |
| | | * @returns |
| | | */ |
| | | export const finishProduction = (data: any) => { |
| | | return request.post('/api/v1/PipeLineLems/WorkPlanPublic/finishProduction', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsMaterialContainer = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsMaterialContainer', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsMaterialContainer = (id: string) => { |
| | | return request.get(`/api/v1/HIAWms/wmsMaterialContainer/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsMaterialContainer = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/HIAWms/wmsMaterialContainer/${id}`, data) |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸¾ |
| | | * @returns |
| | | */ |
| | | export const getWmsEnumData = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/WmsEnum', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base } from '@/libs/Base/Base' |
| | | const request = Base.request |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @returns |
| | | */ |
| | | export const addWmsMaterialContainer = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/wmsMaterialContainer', data) |
| | | } |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | * @returns |
| | | */ |
| | | export const getWmsMaterialContainer = (id: string) => { |
| | | return request.get(`/api/v1/HIAWms/wmsMaterialContainer/${id}`) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * @returns |
| | | */ |
| | | export const updateWmsMaterialContainer = (id: string, data: Record<string, any>) => { |
| | | return request.put(`/api/v1/HIAWms/wmsMaterialContainer/${id}`, data) |
| | | } |
| | | |
| | | /** |
| | | * è·åæä¸¾ |
| | | * @returns |
| | | */ |
| | | export const getWmsEnumData = (data: any) => { |
| | | return request.post('/api/v1/HIAWms/WmsEnum', data) |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .drawer { |
| | | width: 800px; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseDrawer from '@/components/BaseDrawer/BaseDrawer' |
| | | import styles from './WmsMaterialContainerDrawer.module.scss' |
| | | import { useWmsMaterialContainerDrawer } from '../../../../Controllers/PipeAccessoryWeldDrawer.tsx' |
| | | import DyForm from '@/components/DyForm/DyForm' |
| | | |
| | | // @ts-ignore |
| | | export default defineComponent<{ |
| | | [key: string]: any |
| | | }>({ |
| | | name: 'å¼¹çª', |
| | | props: { |
| | | modelValue: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | title: { |
| | | type: String, |
| | | default: '', |
| | | }, |
| | | row: { |
| | | type: Object, |
| | | }, |
| | | sort: { |
| | | type: Number, |
| | | default: 0, |
| | | }, |
| | | }, |
| | | emits: ['update:modelValue', 'close', 'submit', 'confirm'], |
| | | setup(props: Record<string, any>, ctx: SetupContext) { |
| | | const { |
| | | onClose, |
| | | onConfirm, |
| | | onOpen, |
| | | formRef, |
| | | visible, |
| | | formItems, |
| | | formData, |
| | | } = useWmsMaterialContainerDrawer(props, ctx) |
| | | return () => ( |
| | | <BaseDrawer |
| | | class={styles.drawer} |
| | | size="800px" |
| | | title={props.title || 'æ·»å '} |
| | | v-model={visible.value} |
| | | close-on-click-modal={true} |
| | | onConfirm={onConfirm} |
| | | onOpen={onOpen} |
| | | before-close={onClose} |
| | | onClose={onClose} |
| | | > |
| | | <DyForm |
| | | ref={formRef} |
| | | formData={formData.value} |
| | | labelWidth="106px" |
| | | formItemProps={formItems} |
| | | ></DyForm> |
| | | </BaseDrawer> |
| | | ) |
| | | }, |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .drawer { |
| | | width: 800px; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * ç©æåºç¡ä¿¡æ¯æ¥è¯¢å¼¹åºæ¡ |
| | | */ |
| | | import { SetupContext, defineComponent } from 'vue' |
| | | import BaseQueryDrawer from '@/components/BaseQueryDrawer/BaseQueryDrawer' |
| | | import styles from './WmsMaterialContainerQueryDrawer.module.scss' |
| | | import { useWmsMaterialContainerQueryDrawer } from '../../../../Controllers/PipeAccessoryWeldQueryDrawer.tsx' |
| | | import DyForm from '@/components/DyForm/DyForm' |
| | | |
| | | // @ts-ignore |
| | | export default defineComponent<{ |
| | | [key: string]: any |
| | | }>({ |
| | | name: 'å¼¹çª', |
| | | props: { |
| | | //æä¸¾ç±»ååå
¸ |
| | | enumListDict:{ |
| | | type: Array as () => Array<{ key: string; value: object }>, // å®ä¹æ°ç»å
ç´ ç±»å |
| | | default: () => [] // é»è®¤å¼ |
| | | }, |
| | | modelValue: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | title: { |
| | | type: String, |
| | | default: '', |
| | | }, |
| | | row: { |
| | | type: Object, |
| | | }, |
| | | sort: { |
| | | type: Number, |
| | | default: 0, |
| | | }, |
| | | }, |
| | | emits: ['update:modelValue', 'close', 'submit', 'confirmquery1'], |
| | | setup(props: Record<string, any>, ctx: SetupContext) { |
| | | const { |
| | | onClose, |
| | | onConfirmQuery, |
| | | onOpen, |
| | | onReset, |
| | | formRef, |
| | | visible, |
| | | formItems, |
| | | formData, |
| | | } = useWmsMaterialContainerQueryDrawer(props, ctx) |
| | | return () => ( |
| | | <BaseQueryDrawer |
| | | class={styles.drawer} |
| | | size="800px" |
| | | title={props.title || 'é«çº§æ¥è¯¢'} |
| | | v-model={visible.value} |
| | | close-on-click-modal={true} |
| | | onReset={onReset} |
| | | onConfirmQueryForBase={onConfirmQuery} |
| | | onOpen={onOpen} |
| | | before-close={onClose} |
| | | onClose={onClose} |
| | | > |
| | | <DyForm |
| | | ref={formRef} |
| | | formData={formData.value} |
| | | labelWidth="106px" |
| | | formItemProps={formItems} |
| | | ></DyForm> |
| | | </BaseQueryDrawer> |
| | | ) |
| | | }, |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export const columns = [ |
| | | { |
| | | type: 'seq', |
| | | width: 60, |
| | | title: 'åºå·', |
| | | }, |
| | | { |
| | | field: 'containerNo', |
| | | title: 'æçç¼å·', |
| | | }, |
| | | { |
| | | field: 'materialId', |
| | | title: 'ç©æID', |
| | | }, |
| | | { |
| | | field: 'sort', |
| | | title: '', |
| | | }, |
| | | { |
| | | field: 'creationTime', |
| | | title: 'æ¯å¦ç¦ç¨', |
| | | }, |
| | | { |
| | | field: 'deletionTime', |
| | | title: '', |
| | | }, |
| | | ] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .pipeAccessoryWeldContent { |
| | | width: 100%; |
| | | height: 100%; |
| | | // height: 100% !important; |
| | | // overflow-y: auto !important; /* å
容è¶
åºæ¶æ¾ç¤ºæ»å¨æ¡ */ |
| | | // padding-bottom: 20px; /* é¿å
å
容被åºé¨é®æ¡ */ |
| | | |
| | | .pipeAccessoryWeldList { |
| | | width: 100%; |
| | | height: calc(100% - 70px); |
| | | } |
| | | .headerContent { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | height: 43px; |
| | | } |
| | | .header { |
| | | margin-bottom: 12px; |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | align-items: center; |
| | | } |
| | | |
| | | .h5Form { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 20px; // 表å项ä¹é´çé´è· |
| | | |
| | | .el-form-item { |
| | | margin-bottom: 0; // ç§»é¤é»è®¤çåºé¨è¾¹è· |
| | | width: 100% !important; // å æ»¡ç¶å®¹å¨å®½åº¦ |
| | | } |
| | | |
| | | .el-form-item__label { |
| | | display: block; |
| | | text-align: left; |
| | | margin-bottom: 8px; |
| | | font-weight: 500; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .tagBox { |
| | | width: auto; |
| | | min-width: 80px; |
| | | height: 24px; |
| | | background: #ffffff; |
| | | border-radius: 19px 19px 19px 19px; |
| | | opacity: 1; |
| | | border: 1px dashed #bcc4cc; |
| | | width: 50px; |
| | | height: 20px; |
| | | font-size: 14px; |
| | | font-family: PingFang SC, PingFang SC; |
| | | font-weight: 400; |
| | | color: #5a84ff; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | // cursor: pointer; |
| | | } |
| | | |
| | | .group { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | |
| | | .groupTable { |
| | | width: 100%; |
| | | } |
| | | |
| | | .overBox { |
| | | width: 100%; |
| | | height: calc(100% - 20px); |
| | | overflow: auto; |
| | | :global(.cs-collapse-item__header) { |
| | | background-color: #f1f1f1; |
| | | padding: 0 20px; |
| | | height: 35px; |
| | | font-size: 16px; |
| | | font-family: PingFang SC, PingFang SC; |
| | | font-weight: 500; |
| | | } |
| | | :global(.cs-collapse-item__content) { |
| | | padding-bottom: 0px; |
| | | } |
| | | } |
| | | .groupHeader { |
| | | width: 100%; |
| | | height: 30px; |
| | | background: #ccc; |
| | | } |
| | | |
| | | .hideBlock { |
| | | display: none; |
| | | } |
| | | .queryForm { |
| | | padding: 10px; |
| | | background: #f5f7fa; |
| | | margin-bottom: 0px; |
| | | border-radius: 4px; |
| | | |
| | | .el-form-item { |
| | | margin-right: 20px; |
| | | margin-bottom: 0; |
| | | |
| | | // ç»ä¸è¾å
¥æ¡åéæ©æ¡ç宽度 |
| | | .el-input, .el-select { |
| | | width: 200px; // 设置ç»ä¸ç宽度 |
| | | } |
| | | |
| | | // éæ©æ¡å
é¨è¾å
¥æ¡æ ·å¼ |
| | | .el-select .el-input__wrapper { |
| | | height: 32px; // ä¸è¾å
¥æ¡é«åº¦ä¸è´ |
| | | padding: 1px 11px; // ä¸è¾å
¥æ¡å
è¾¹è·ä¸è´ |
| | | } |
| | | |
| | | // æ¥æéæ©å¨å®½åº¦ |
| | | .el-date-editor { |
| | | width: 220px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 妿éè¦æ´ç²¾ç¡®çæ§å¶ï¼å¯ä»¥åç¬è®¾ç½® |
| | | .formItem { |
| | | width: 200px; |
| | | |
| | | &.el-input, &.el-select { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | .newPageContent { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 20px; |
| | | padding: 20px; |
| | | background-color: white; |
| | | |
| | | .info-block { |
| | | background-color: #f9f9f9; |
| | | border: 1px solid #eaeaea; |
| | | border-radius: 5px; |
| | | padding: 20px; |
| | | width: calc(33.33% - 20px); |
| | | |
| | | .block-title { |
| | | font-size: 20px; |
| | | font-weight: bold; |
| | | margin-bottom: 15px; |
| | | } |
| | | |
| | | .info-tags { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 10px; |
| | | |
| | | .info-tag { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 5px; |
| | | |
| | | .tag-label { |
| | | font-weight: bold; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .action-buttons { |
| | | display: flex; |
| | | gap: 10px; |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .equipment-image { |
| | | width: 100%; |
| | | height: auto; |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .status-normal { |
| | | color: green; |
| | | } |
| | | } |
| | | |
| | | .process-table { |
| | | width: 100%; |
| | | margin-top: 20px; |
| | | |
| | | .el-table { |
| | | border: 1px solid #eaeaea; |
| | | border-radius: 5px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | .modelRrow { |
| | | display: flex; /* å¼¹æ§å¸å± */ |
| | | gap: 20px; /* æ§ä»¶é´è· */ |
| | | align-items: center; /* åç´å±
ä¸ */ |
| | | margin-bottom: 12px; /* åºé¨é´è· */ |
| | | width: 100%; |
| | | |
| | | .el-form-item { |
| | | flex: 1 !important; /* ååç©ºé´ */ |
| | | margin-bottom: 0; |
| | | max-width: none; // ç§»é¤æå¤§å®½åº¦éå¶ |
| | | } |
| | | |
| | | .el-select { |
| | | width: 100%; // ç¡®ä¿Selectå æ»¡ç¶å®¹å¨å®½åº¦ |
| | | |
| | | // ç§»é¤å¯è½å½±å宽度çå
鍿 ·å¼ |
| | | .el-input__wrapper { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | // ååºå¼è®¾è®¡ |
| | | @media (max-width: 1200px) { |
| | | .model-row { |
| | | flex-wrap: wrap; |
| | | |
| | | .el-form-item { |
| | | flex: 1 0 calc(50% - 10px); // å¨ä¸çå±å¹ä¸æ¯è¡æ¾ç¤º2个 |
| | | margin-bottom: 10px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | @media (max-width: 768px) { |
| | | .model-row { |
| | | flex-direction: column; |
| | | |
| | | .el-form-item { |
| | | width: 100%; // å¨å°å±å¹ä¸æ¯è¡æ¾ç¤º1个 |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .action-buttons { |
| | | display: flex; |
| | | gap: 10px; |
| | | margin-top: 20px; |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { defineComponent, onMounted, ref } from 'vue' |
| | | import type { Ref } from 'vue' |
| | | import styles from './PipeAccessoryWeld.module.scss' |
| | | import pipeImage from '@/images/pipe-Weld-drawing-example.png' |
| | | import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' |
| | | import { |
| | | ElInput, |
| | | ElForm, |
| | | ElFormItem, |
| | | ElButton, |
| | | ElSelect, |
| | | ElOption, |
| | | ElMessage, |
| | | ElCol, |
| | | } from 'element-plus' |
| | | import { |
| | | getPlaceNoForStockList, |
| | | getMaterialModelList, |
| | | instock, |
| | | findSingleWorkPlanByFilter, |
| | | startProduction, |
| | | finishProduction |
| | | } from '@/widgets/PipeAccessoryWeld/Models/Service/PipeAccessoryWeld' |
| | | import { Message } from '@element-plus/icons-vue/dist/types' |
| | | |
| | | export default defineComponent({ |
| | | name: 'PipeAccessoryWeld', |
| | | setup() { |
| | | // æ¥è¯¢è¡¨åæ°æ® |
| | | const queryForm = ref({ |
| | | pipeSpecCode: '', |
| | | processRouteNumber: '', |
| | | taskCode: '', |
| | | length: '', |
| | | projectNumber: '', |
| | | shipNumber: '', |
| | | material: '', |
| | | outerDiameter: '', |
| | | thickness: '', |
| | | plannedStartTime: '', |
| | | plannedEndTime: '', |
| | | workstationCode: '', |
| | | processName: '', |
| | | equipmentCode: '' |
| | | }) |
| | | |
| | | // æ°æ®æº |
| | | const modelOptions = ref<Array<{ value: string; label: string }>>([]) |
| | | const placeNoOptions = ref<Array<{ value: string; label: string }>>([]) |
| | | |
| | | onMounted(() => { |
| | | // ç»ä»¶æè½½åè·ååå·å表ååºä½å·å表 |
| | | getModelList() |
| | | getPlaceNoList() |
| | | }) |
| | | |
| | | // ç»çæä½ |
| | | const handlePalletize = () => { |
| | | console.log('ç»çæä½', queryForm.value) |
| | | // è¿éæ·»å ç»çé»è¾ |
| | | } |
| | | |
| | | // ç»çå
¥åºæä½ |
| | | const handlePalletizeStorage = () => { |
| | | console.log('ç»çå
¥åºæä½', queryForm.value) |
| | | instock(queryForm.value), resetQueryForm() |
| | | ElMessage.success({ |
| | | message: 'ç»çå
¥åºæå', |
| | | type: 'success', |
| | | }) |
| | | // è¿éæ·»å ç»çå
¥åºé»è¾ |
| | | } |
| | | |
| | | const resetQueryForm = () => { |
| | | queryForm.value.materialModel = '' |
| | | queryForm.value.placeNo = '' |
| | | queryForm.value.materialBatch = '' |
| | | queryForm.value.stockNumber = '' |
| | | } |
| | | |
| | | const getModelList = async () => { |
| | | const models = await getMaterialModelList() |
| | | modelOptions.value = models.map((item: string) => ({ |
| | | value: item.materialModel, |
| | | label: item.materialModelDesc, |
| | | })) |
| | | } |
| | | |
| | | const getPlaceNoList = async () => { |
| | | const placeNos = await getPlaceNoForStockList(2) |
| | | console.log('åºä½å·å表:', placeNos) |
| | | placeNoOptions.value = placeNos.map((item: string) => ({ |
| | | value: item.placeNo, |
| | | label: item.placeNoDesc, |
| | | })) |
| | | } |
| | | const handleChange =async (value) => { |
| | | console.log('è¾å
¥å
容确认:', value); // 失å»ç¦ç¹æå车æ¶è§¦å |
| | | // 卿¤å¤æ·»å ä¸å¡é»è¾ï¼å¦æ ¡éªãæäº¤çï¼ |
| | | const param={ |
| | | pipeSpecCode:value, |
| | | pipeSpecCode_FilterMode:2,//ç²¾åæ¥è¯¢ |
| | | processName:'çæ¥å·¥åº', |
| | | processName_FilterMode:2,//ç²¾åæ¥è¯¢ |
| | | } |
| | | const workPlan = await findSingleWorkPlanByFilter(param); |
| | | console.log('è¿å:'+workPlan); |
| | | if(workPlan==''){ |
| | | ElMessage.error('æ²¡ææ¾å°æ°æ®'); |
| | | queryForm.value ={ pipeSpecCode: '', |
| | | processRouteNumber: '', |
| | | taskCode: '', |
| | | length: '', |
| | | projectNumber: '', |
| | | shipNumber: '', |
| | | material: '', |
| | | outerDiameter: '', |
| | | thickness: '', |
| | | plannedStartTime: '', |
| | | plannedEndTime: '', |
| | | workstationCode: '', |
| | | processName: '', |
| | | equipmentCode: ''} |
| | | }else{ |
| | | queryForm.value=workPlan; |
| | | } |
| | | }; |
| | | |
| | | // å¼å·¥äºä»¶å¤ç |
| | | const startWork = () => { |
| | | console.log('æ§è¡å¼å·¥æä½'); |
| | | if(queryForm.value.pipeSpecCode==''){ |
| | | ElMessage.error('请è¾å
¥ç®¡æ®µç¼ç '); |
| | | return |
| | | } |
| | | ConfirmBox( |
| | | `ç¡®å®è¦å°ç®¡æ®µç¼ç ${queryForm.value.pipeSpecCode}å¼å·¥å` |
| | | ).then(async () => { |
| | | //æ¨çä¸å¡é»è¾ |
| | | const param={ |
| | | taskCode:queryForm.value.taskCode, |
| | | }; |
| | | const ret = await startProduction(param); |
| | | console.log('è¿å:'+ret); |
| | | if(ret.code="200"){ |
| | | ElMessage.success('å¼å·¥æå'); |
| | | }else{ |
| | | ElMessage.error('å¼å·¥å¤±è´¥:'+ret.message); |
| | | } |
| | | }) |
| | | } |
| | | // å®å·¥äºä»¶å¤ç |
| | | const finishWork = () => { |
| | | console.log('æ§è¡å¼å·¥æä½'); |
| | | if(queryForm.value.pipeSpecCode==''){ |
| | | ElMessage.error('请è¾å
¥ç®¡æ®µç¼ç '); |
| | | return |
| | | } |
| | | ConfirmBox( |
| | | `ç¡®å®è¦å°ç®¡æ®µç¼ç ${queryForm.value.pipeSpecCode}å®å·¥å` |
| | | ).then(async () => { |
| | | //æ¨çä¸å¡é»è¾ |
| | | const param={ |
| | | pipeSpecCode:queryForm.value.pipeSpecCode, |
| | | processName:queryForm.value.processName, |
| | | }; |
| | | const ret = await finishProduction(param); |
| | | console.log('è¿å:'+ret); |
| | | if(ret.code="200"){ |
| | | ElMessage.success('å®å·¥æå'); |
| | | }else{ |
| | | ElMessage.error('å®å·¥å¤±è´¥:'+ret.message); |
| | | } |
| | | }) |
| | | } |
| | | const tableData = ref([ |
| | | { sequence: 1, flangeA: 'RF-200-1.6MPa', flangeB: 'WN-200-1.6MPa' }, |
| | | { sequence: 2, flangeA: 'WN-250-2.5MPa', flangeB: 'SO-250-2.5MPa' }, |
| | | { sequence: 3, flangeA: 'PL-300-1.0MPa', flangeB: 'RF-300-1.0MPa' }, |
| | | { sequence: 4, flangeA: 'SO-150-2.0MPa', flangeB: 'WN-150-2.0MPa' }, |
| | | { sequence: 5, flangeA: 'RF-400-1.6MPa', flangeB: 'PL-400-1.6MPa' }, |
| | | { sequence: 6, flangeA: 'WN-200-4.0MPa', flangeB: 'SO-200-4.0MPa' }, |
| | | { sequence: 7, flangeA: 'SO-300-1.6MPa', flangeB: 'RF-300-1.6MPa' }, |
| | | { sequence: 8, flangeA: 'PL-250-1.0MPa', flangeB: 'WN-250-1.0MPa' }, |
| | | { sequence: 9, flangeA: 'RF-150-2.5MPa', flangeB: 'SO-150-2.5MPa' }, |
| | | { sequence: 10, flangeA: 'WN-400-2.0MPa', flangeB: 'PL-400-2.0MPa' } |
| | | ]); |
| | | |
| | | |
| | | return () => { |
| | | return ( |
| | | <div |
| | | class={styles.PipeAccessoryWeldContent} |
| | | style="overflow-y: auto !important; height: 100%;" |
| | | > |
| | | <ElFormItem label="管段ç¼ç "> |
| | | <ElInput |
| | | v-model={queryForm.value.pipeSpecCode} |
| | | clearable |
| | | class={styles.formInput} |
| | | onInput={handleChange} |
| | | /> |
| | | </ElFormItem> |
| | | <div class={styles.actionButtons}> |
| | | <ElButton type="warning" onClick={startWork}>å¼å·¥</ElButton> |
| | | <ElButton type="warning" onClick={finishWork}>å®å·¥</ElButton> |
| | | {/* <ElButton type="warning">æå</ElButton> |
| | | <ElButton type="warning">èªå¨</ElButton> |
| | | <ElButton type="warning">è´¨æ£</ElButton> */} |
| | | </div> |
| | | |
| | | <h2 class={styles.blockTitle}>å½åä»»å¡</h2> |
| | | <ElForm label-position="left" > |
| | | |
| | | <ElFormItem label="ç©ææµå "> |
| | | <ElInput |
| | | v-model={queryForm.value.processRouteNumber} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="ä»»å¡ç¼å· "> |
| | | <ElInput |
| | | v-model={queryForm.value.taskCode} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="管段é¿åº¦ "> |
| | | <ElInput |
| | | v-model={queryForm.value.length} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="é¡¹ç® å·"> |
| | | <ElInput |
| | | v-model={queryForm.value.projectNumber} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="è¹ å·"> |
| | | <ElInput |
| | | v-model={queryForm.value.shipNumber} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="æ è´¨"> |
| | | <ElInput |
| | | v-model={queryForm.value.material} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="å¤ å¾"> |
| | | <ElInput |
| | | v-model={queryForm.value.outerDiameter} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="å£ å"> |
| | | <ElInput |
| | | v-model={queryForm.value.thickness} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="计åå¼å§æ¶é´"> |
| | | <ElInput |
| | | v-model={queryForm.value.plannedStartTime} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="计å宿æ¶é´"> |
| | | <ElInput |
| | | v-model={queryForm.value.plannedEndTime} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | </ElForm> |
| | | |
| | | <h2 class={styles.blockTitle}>å½åå·¥ä½/设å¤ä¿¡æ¯</h2> |
| | | <ElForm label-position="left" > |
| | | <ElFormItem label="å·¥ä½ä»£ç "> |
| | | <ElInput |
| | | v-model={queryForm.value.workstationCode} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="å·¥åºåç§° "> |
| | | <ElInput |
| | | v-model={queryForm.value.processName} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | <ElFormItem label="设å¤ä»£ç "> |
| | | <ElInput |
| | | v-model={queryForm.value.equipmentCode} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> |
| | | {/* <ElFormItem label="设å¤ç¶æ"> |
| | | <ElInput |
| | | v-model={queryForm.value.materialBatch} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> */} |
| | | {/* <ElFormItem label="æä½äºº"> |
| | | <ElInput |
| | | v-model={queryForm.value.materialBatch} |
| | | disabled |
| | | clearable |
| | | class={styles.formInput} |
| | | /> |
| | | </ElFormItem> */} |
| | | </ElForm> |
| | | |
| | | {/* <div class="info-block"> |
| | | <h2 class="block-title">å·¥èºä¿¡æ¯</h2> |
| | | <el-table stripe v-model:dataSource={tableData}> |
| | | <el-table-column prop="sequence" label="åº"></el-table-column> |
| | | <el-table-column prop="flangeA" label="æ³å
°A"></el-table-column> |
| | | <el-table-column prop="flangeB" label="æ³å
°B"></el-table-column> |
| | | </el-table> |
| | | </div> */} |
| | | <h2 class="block-title">å¾çº¸</h2> |
| | | <img |
| | | src={pipeImage} |
| | | alt="设å¤å¾ç" |
| | | style="height:1250px;" |
| | | class="equipment-image" |
| | | ></img> |
| | | </div> |
| | | ) |
| | | } |
| | | }, |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .PipeAccessoryWeld { |
| | | background-color: #fff; |
| | | border-radius: 5px 5px 0 0; |
| | | width: 100%; |
| | | height: 100%; |
| | | border: 1px solid #dbdbdb; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { |
| | | Component, |
| | | DefineComponent, |
| | | defineComponent, |
| | | markRaw, |
| | | ref, |
| | | SetupContext, |
| | | onMounted, |
| | | } from 'vue' |
| | | import styles from './PipeAccessoryWeld.module.scss' |
| | | import Tab from '@/components/Tab/Tab' |
| | | import { useProvideModels } from '@/libs/Provider/app' |
| | | import { usePermission } from '@/libs/Permission/Permission' |
| | | import { permissionCodes } from '../enum' |
| | | import { ModuleType, TabItem } from '../type/Type' |
| | | import { getEntityNames } from '@/hooks/hook' |
| | | import TabPane from '@/components/Tab/TabPane' |
| | | |
| | | const Models: ModuleType = import.meta.glob('./config/*.json', { |
| | | eager: true, |
| | | }) |
| | | |
| | | const entityNames = getEntityNames(Models) |
| | | |
| | | const nameToLabelMap = [{ name: 'PipeAccessoryWeld', label: '管éä»¶çæ¥' }] |
| | | |
| | | export default defineComponent({ |
| | | name: 'PipeAccessoryWeld', |
| | | |
| | | setup(props, ctx: SetupContext) { |
| | | useProvideModels() |
| | | usePermission(props, permissionCodes) |
| | | |
| | | const rf = ref<{ |
| | | [key: string]: any |
| | | }>({}) |
| | | |
| | | const tabData = ref<TabItem[]>([]) |
| | | |
| | | const onTabChange = (v: string) => { |
| | | rf.value?.[v]?.reloadList() |
| | | } |
| | | |
| | | const initTableData = async () => { |
| | | for (const i in entityNames) { |
| | | const name = entityNames[i] |
| | | const module = await import(`./Pages/${name}/${name}.tsx`) |
| | | const PipeAccessoryWeld = markRaw(module.default) |
| | | const foundLabel = |
| | | nameToLabelMap.find((item) => item.name === name)?.label || name |
| | | tabData.value.push({ |
| | | label: foundLabel, |
| | | name, |
| | | component: PipeAccessoryWeld, |
| | | }) |
| | | } |
| | | } |
| | | |
| | | initTableData() |
| | | |
| | | return () => { |
| | | return ( |
| | | <div class={styles.PipeAccessoryWeld}> |
| | | <Tab data={tabData.value} type="list" onTab={onTabChange}> |
| | | {tabData.value.map((widgetInfo) => { |
| | | const Widget: any = widgetInfo.component |
| | | return ( |
| | | <TabPane label={widgetInfo.label} name={widgetInfo.name}> |
| | | <Widget |
| | | ref={(r: any) => (rf.value['PipeAccessoryWeld'] = r)} |
| | | ></Widget> |
| | | </TabPane> |
| | | ) |
| | | })} |
| | | </Tab> |
| | | </div> |
| | | ) |
| | | } |
| | | }, |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "PipeAccessoryWeld" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface TabType { |
| | | label: string |
| | | name: string |
| | | columns?: any[] |
| | | data?: any[] |
| | | isFooter: boolean |
| | | [key: string]: any |
| | | } |
| | | |
| | | export const permissionCodes = { |
| | | 'PipeAccessoryWeld-list': 'å表-å表', |
| | | 'PipeAccessoryWeld-add': 'å表-æ·»å ', |
| | | 'PipeAccessoryWeld-import': 'å表-导å
¥', |
| | | 'PipeAccessoryWeld-output': 'å表-è¾åº', |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import PipeAccessoryWeld from './Views/PipeAccessoryWeld' |
| | | import Setting from '@/components/Setting/Setting' |
| | | import { provider } from '@/provider/index' |
| | | import p from '../../assets/svg/p.svg' |
| | | |
| | | export default { |
| | | is: 'PipeAccessoryWeld', |
| | | name: '管éä»¶çæ¥', |
| | | category: 'run', |
| | | icon: p, |
| | | authorizationRequired: false, |
| | | canvasView: provider(PipeAccessoryWeld), |
| | | settingsView: Setting, |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Component } from 'vue' |
| | | |
| | | export interface DataItemType { |
| | | id?: string |
| | | name?: string |
| | | code?: string |
| | | description?: string |
| | | label?: string |
| | | value?: string | number |
| | | } |
| | | |
| | | export interface WmsMaterialContainerBaseType { |
| | | id?: string |
| | | name?: string |
| | | code?: string |
| | | value?: number |
| | | description?: string |
| | | options?: Array<DataItemType> |
| | | abilityValue?: number | string |
| | | data?: DataItemType |
| | | defaultValue?: string | number |
| | | flow: string |
| | | } |
| | | |
| | | export interface FlowDefinitionType { |
| | | id?: string |
| | | name?: string |
| | | code?: string |
| | | description?: string |
| | | } |
| | | |
| | | export type ModuleType = Record< |
| | | string, |
| | | { |
| | | default: Record<string, string> |
| | | name: string |
| | | } |
| | | > |
| | | |
| | | export interface TabItem { |
| | | name: string |
| | | label: string |
| | | component: Component |
| | | hidden?: boolean |
| | | } |
| | |
| | | width:160, |
| | | }, |
| | | { |
| | | field: 'pipeSpecCode', |
| | | title: '管段ç¼ç ', |
| | | width:160, |
| | | }, |
| | | { |
| | | field: 'pipeSectionName', |
| | | title: '管段åç§°', |
| | | width:160, |
| | | }, |
| | | { |
| | | field: 'processName', |
| | | title: 'å·¥åºåç§°', |
| | | width:160, |
| | | }, |
| | | { |
| | | field: 'workPlanStatusDesc', |
| | | title: '计åç¶æ', |
| | | width:160, |
| | |
| | | title: '项ç®å·', |
| | | width:160, |
| | | }, |
| | | { |
| | | field: 'processName', |
| | | title: 'å·¥åºåç§°', |
| | | width:160, |
| | | }, |
| | | |
| | | { |
| | | field: 'pipeFittingCode', |
| | | title: '管件ç¼ç ', |
| | |
| | | title: '顺åºå·', |
| | | width:160, |
| | | }, |
| | | { |
| | | field: 'pipeSpecCode', |
| | | title: '管段ç¼ç ', |
| | | width:160, |
| | | }, |
| | | { |
| | | field: 'pipeSectionName', |
| | | title: '管段åç§°', |
| | | width:160, |
| | | }, |
| | | |
| | | { |
| | | field: 'outerDiameter', |
| | | title: 'å¤å¾(mm)', |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan |
| | | { |
| | | /// <summary> |
| | | /// è£
é
å·¥åºå®å·¥ è¾å
¥åæ°æ¨¡å |
| | | /// </summary> |
| | | [Serializable] |
| | | public class CompleteAssemblyProcessInput |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 管段ç¼ç |
| | | /// </summary> |
| | | public string PipeSpecCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥åºåç§° |
| | | /// </summary> |
| | | public string ProcessName { get; set; } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan |
| | | { |
| | | /// <summary> |
| | | /// å¼å·¥è¾å
¥åæ°æ¨¡å |
| | | /// </summary> |
| | | [Serializable] |
| | | public class StartProductionInput |
| | | { |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç¼ç |
| | | /// </summary> |
| | | public string TaskCode { get; set; } |
| | | |
| | | ///// <summary> |
| | | ///// å·¥åºåç§° |
| | | ///// </summary> |
| | | //public string ProcessName { get; set; } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | using Ao.Stock.Mirror; |
| | | using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan; |
| | | using CMS.Plugin.PipeLineLems.Domain.WorkPlan; |
| | | using CmsQueryExtensions.Entitys; |
| | |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | Task<WorkPlan> GetSingleByFilterAsync(Expression<Func<WorkPlan, bool>> whereConditions, bool isâMultipleThrowException = false, CancellationToken cancellationToken = default); |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶è·åä½ä¸è®¡å表å表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | Task<List<WorkPlanDto>> FindListByFilterAsync(GetWorkPlanInput input, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶è·åå个ä½ä¸è®¡å表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | Task<WorkPlanDto> FindSingleByFilterAsync(GetWorkPlanInput input, CancellationToken cancellationToken = default); |
| | | |
| | | } |
| | |
| | | /// <returns></returns> |
| | | public async Task<MesOrderResponse> CommonPick(IServiceProvider _serviceProvider, PickInput input, MyCurrentUser myCurrentUser) |
| | | { |
| | | if (string.IsNullOrEmpty(input.PipeSpecCode)) |
| | | { |
| | | throw new UserFriendlyException("请è¾å
¥ç®¡æ®µç¼ç "); |
| | | }; |
| | | if (string.IsNullOrEmpty(input.ContinerNo)) |
| | | { |
| | | throw new UserFriendlyException("请è¾å
¥æçå·"); |
| | | }; |
| | | //1ãè®°å½åæ£è®°å½è¡¨ |
| | | //2ãæ´æ°ä½ä¸è®¡å表çç¶æ =已忣 |
| | | //3ãåå
¥ 忣åé |
| | |
| | | var traceProvider = _serviceProvider.GetRequiredService<ITraceProvider>(); |
| | | var materialProvider = _serviceProvider.GetRequiredService<IMaterialProvider>(); |
| | | var workPlanAppService = _serviceProvider.GetRequiredService<IWorkPlanAppService>(); |
| | | var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>(); |
| | | |
| | | //Dictionary<string, object?> keyValuePairs = new Dictionary<string, object?> |
| | | // { |
| | |
| | | var firstWorkPlans = await workPlanAppService.GetListByFilterAsync(x => x.PipeSpecCode == input.PipeSpecCode); |
| | | |
| | | var firstWorkPlan = await workPlanAppService.GetSingleByFilterAsync(x => x.PipeSpecCode == input.PipeSpecCode); |
| | | |
| | | var callMaterialOrder = await callMaterialOrderAppService.GetSingleByFilterAsync(x => x.DataIdentifier == firstWorkPlan.DataIdentifier); |
| | | |
| | | var rawPipe_DataIdentifier = await materialProvider.FindByNameAsync("åæç®¡æ è¯"); |
| | | var rawPipe_MaterialMode = await materialProvider.FindByNameAsync("åæç®¡åå·"); |
| | | var rawPipe_Batch = await materialProvider.FindByNameAsync("åæç®¡æ¹æ¬¡"); |
| | |
| | | Quantity = 1, |
| | | MaterialId = rawPipe_Batch.MaterialId, |
| | | MaterialDetailId = rawPipe_Batch.MaterialDetails.First().Id, |
| | | Value = "111",//æ¹æ¬¡ææ¶åæ» |
| | | Value = callMaterialOrder.MaterialBatch,//æ¹æ¬¡ææ¶åæ» |
| | | |
| | | }); |
| | | } |
| | |
| | | string _value = ""; |
| | | if (item.Name == "忣æ¹å") |
| | | { |
| | | _value = "ç管è£
é
"; |
| | | _value = "çç®¡åæ£"; |
| | | } |
| | | if (item.Name == "忣æçå·") |
| | | { |
| | | _value = input.ContinerNo; |
| | | } |
| | | if (item.Name == "åæ£äºº") |
| | | { |
| | | _value = myCurrentUser.UserAccount; |
| | | } |
| | | //item.Key |
| | | TraceParamModel traceParamModel = new TraceParamModel() |
| | | { |
| | | Key = item.Key, |
| | | Value = _value |
| | | }; |
| | | traceModel.Params.Add(traceParamModel); |
| | | }; |
| | | foreach (var item in workSection.FormulaParameters) |
| | | { |
| | | string _value = ""; |
| | | if (item.Name == "忣æ¹å") |
| | | { |
| | | _value = "çç®¡åæ£"; |
| | | } |
| | | if (item.Name == "忣æçå·") |
| | | { |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | ///è£
é
/çæ¥å¼å·¥ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <param name="_serviceProvider"></param> |
| | | /// <param name="myCurrentUser"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public async Task<MesOrderResponse> StartProduction(StartProductionInput input, IServiceProvider _serviceProvider, MyCurrentUser myCurrentUser) |
| | | { |
| | | if (string.IsNullOrEmpty(input.TaskCode.ToString())) |
| | | { |
| | | throw new UserFriendlyException("ä»»å¡ç¼ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | string processName = ""; |
| | | |
| | | VariableService _variableService = _serviceProvider.GetRequiredService<VariableService>(); |
| | | var callMaterialOrderRepository = _serviceProvider.GetRequiredService<ICallMaterialOrderRepository>(); |
| | | var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>(); |
| | | var callMaterialOrderRecordRepository = _serviceProvider.GetRequiredService<ICallMaterialOrderRecordRepository>(); |
| | | var orderManager = _serviceProvider.GetRequiredService<IOrderManager>(); |
| | | var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>(); |
| | | |
| | | // æ¥æ¾æ°æ® |
| | | |
| | | var workPlan = await workPlanRepository.GetSingleByFilterAsync(x => x.TaskCode == input.TaskCode); |
| | | if (workPlan == null) |
| | | { |
| | | throw new UserFriendlyException($"æ¾ä¸å°ä½ä¸è®¡å"); |
| | | } |
| | | if (workPlan.ProcessName == "è£
é
å·¥åº") |
| | | { |
| | | processName = "è£
é
"; |
| | | } |
| | | else if (workPlan.ProcessName == "çæ¥å·¥åº") |
| | | { |
| | | processName = "çæ¥"; |
| | | } |
| | | |
| | | // éªè¯ç¶æ |
| | | if (workPlan.WorkPlanStatus != Domain.Shared.Enums.WorkPlanStatusEnum.æåä¸ && workPlan.WorkPlanStatus != Domain.Shared.Enums.WorkPlanStatusEnum.æªç产) |
| | | { |
| | | //ææ¶æ³¨é |
| | | //throw new UserFriendlyException($"ä»»å¡ç¼ç '{input.TaskCode}' çå½ç¶æä¸º '{workPlan.WorkPlanStatus}'ï¼ä¸å
许å¼å·¥"); |
| | | } |
| | | |
| | | var callMaterialOrder = await callMaterialOrderAppService.GetSingleByFilterAsync(x => x.DataIdentifier == workPlan.DataIdentifier); |
| | | #region äºå¡ |
| | | |
| | | using var scope = _serviceProvider.CreateScope(); |
| | | var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); |
| | | using var uow = unitOfWorkManager.Begin(requiresNew: true); |
| | | |
| | | try |
| | | { |
| | | #region æ°æ®å¤ç |
| | | |
| | | //1ãæ´æ°ä½ä¸è®¡å表为 çäº§ä¸ |
| | | //2ãç»PLCåå·¥èºåæ°æä»¤,å¹¶åå
¥ plcä¸ äº§åid |
| | | //if (workPlan.ProcessName == "è£
é
å·¥åº") |
| | | //{ |
| | | // workPlan.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.ç产ä¸; |
| | | //} |
| | | //else if (workPlan.ProcessName == "çæ¥å·¥åº") |
| | | //{ |
| | | // workPlan.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.已宿; |
| | | //} |
| | | workPlan.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.ç产ä¸; |
| | | |
| | | await workPlanRepository.UpdateAsync(workPlan); |
| | | |
| | | Dictionary<string, object?> keyValuePairs = new Dictionary<string, object?> |
| | | { |
| | | { $"{processName}_ProductID", workPlan.PipeSpecCode }, |
| | | { $"{processName}管段ç¼ç ", workPlan.PipeSpecCode }, |
| | | { $"{processName}管段åç§°", workPlan.PipeSectionName }, |
| | | { $"{processName}åæç®¡æ¹æ¬¡", callMaterialOrder.MaterialBatch }, |
| | | { $"{processName}åæç®¡åå·", callMaterialOrder.MaterialMode }, |
| | | { $"{processName}åæç®¡æ è¯", callMaterialOrder.DataIdentifier }, |
| | | { $"{processName}项ç®å·", workPlan.ProjectNumber }, |
| | | { $"{processName}è¹å·", workPlan.ShipNumber }, |
| | | |
| | | //ééæ°æ®æ¨¡æåå
¥ |
| | | { $"{processName}åå", "10.0 MPa" }, |
| | | { $"{processName}é度", "18mm/s"}, |
| | | |
| | | { $"{processName}人", myCurrentUser.UserAccount}, |
| | | { $"{processName}é´é","15mm"}, |
| | | { $"{processName}ä½ç½®", "10,23,24"}, |
| | | }; |
| | | _variableService.WriteValueAsync(keyValuePairs); |
| | | |
| | | |
| | | #endregion |
| | | |
| | | await uow.CompleteAsync(); |
| | | |
| | | // è¿åç»æ |
| | | var response = new MesOrderResponse |
| | | { |
| | | Code = "200", |
| | | Message = "å¤çæå", |
| | | Time = DateTime.UtcNow |
| | | }; |
| | | return response; |
| | | } |
| | | catch (Exception) |
| | | { |
| | | await uow.RollbackAsync(); |
| | | throw; |
| | | } |
| | | finally |
| | | { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | #endregion |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// è£
é
å·¥åºå®å·¥ |
| | | /// </summary> |
| | | /// <param name="_serviceProvider"></param> |
| | | /// <param name="input"></param> |
| | | /// <param name="myCurrentUser"></param> |
| | | /// <returns></returns> |
| | | public async Task<MesOrderResponse> CompleteAssemblyProcess(IServiceProvider _serviceProvider, CompleteAssemblyProcessInput input, MyCurrentUser myCurrentUser) |
| | | { |
| | | //1ãè®°å½åæ£è®°å½è¡¨ |
| | | //2ãæ´æ°ä½ä¸è®¡å表çç¶æ =已忣 |
| | | //3ãåå
¥ 忣åé |
| | | //4ãåå
¥è¿½æº¯æ¥è¡¨ |
| | | //5ãç©æç»ç |
| | | |
| | | if (string.IsNullOrEmpty(input.PipeSpecCode)) |
| | | { |
| | | throw new UserFriendlyException($"管段ç¼ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | |
| | | VariableService _variableService = _serviceProvider.GetRequiredService<VariableService>(); |
| | | var _workSectionManager = _serviceProvider.GetRequiredService<IWorkSectionManager>(); |
| | | var _workStationManager = _serviceProvider.GetRequiredService<IWorkStationManager>(); |
| | | var traceProvider = _serviceProvider.GetRequiredService<ITraceProvider>(); |
| | | var materialProvider = _serviceProvider.GetRequiredService<IMaterialProvider>(); |
| | | var workPlanAppService = _serviceProvider.GetRequiredService<IWorkPlanAppService>(); |
| | | var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>(); |
| | | var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>(); |
| | | |
| | | string processName = ""; |
| | | //ç©æåæ°å表 |
| | | var firstWorkPlan = await workPlanAppService.GetSingleByFilterAsync(x => x.PipeSpecCode == input.PipeSpecCode && x.ProcessName == input.ProcessName); |
| | | if (firstWorkPlan == null) |
| | | { |
| | | throw new UserFriendlyException($"æ¾ä¸å°ä½ä¸è®¡å"); |
| | | } |
| | | if (firstWorkPlan.ProcessName == "è£
é
å·¥åº") |
| | | { |
| | | processName = "è£
é
"; |
| | | } |
| | | else if (firstWorkPlan.ProcessName == "çæ¥å·¥åº") |
| | | { |
| | | processName = "çæ¥"; |
| | | } |
| | | |
| | | await CompleteHandleOutStoreFinish(_serviceProvider, processName, true); |
| | | |
| | | //æ ¹æ®å·¥åºåè·åå·¥åºå¯¹è±¡ |
| | | var workSection = await _workSectionManager.GetByNameAsync($"{processName}å·¥åº"); |
| | | var workStation = await _workStationManager.GetByNameAsync($"{processName}å·¥ä½"); |
| | | //åå
¥è¿½æº¯æ¥è¡¨ |
| | | var finishTime = DateTime.Now; |
| | | TraceModel traceModel = new TraceModel() |
| | | { |
| | | SerialNumber = input.PipeSpecCode, |
| | | WorkSectionId = workSection.Id, |
| | | WorkSectionName = workSection.Name, |
| | | WorkStationName = workStation.Name, |
| | | |
| | | FinishTime = finishTime, |
| | | IsQualified = true, |
| | | UnqualifiedReason = "", |
| | | ProductModel = "", |
| | | ProductName = "", |
| | | |
| | | }; |
| | | traceModel.Params = new List<TraceParamModel>(); |
| | | foreach (var item in workSection.ProcessParameters) |
| | | { |
| | | var value = "ssss"; |
| | | traceModel.Params.Add(new TraceParamModel() |
| | | { |
| | | Key = item.Key, |
| | | Value = value.SafeString() |
| | | }); |
| | | } |
| | | |
| | | #region äºå¡ |
| | | |
| | | using var scope = _serviceProvider.CreateScope(); |
| | | var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); |
| | | using var uow = unitOfWorkManager.Begin(requiresNew: true); |
| | | |
| | | try |
| | | { |
| | | #region æ°æ®å¤ç |
| | | |
| | | |
| | | |
| | | firstWorkPlan.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.已宿; |
| | | await workPlanRepository.UpdateAsync(firstWorkPlan); |
| | | |
| | | var callMaterialOrder = await callMaterialOrderAppService.GetSingleByFilterAsync(x => x.DataIdentifier == firstWorkPlan.DataIdentifier); |
| | | |
| | | var rawPipe_DataIdentifier = await materialProvider.FindByNameAsync("åæç®¡æ è¯"); |
| | | var rawPipe_MaterialMode = await materialProvider.FindByNameAsync("åæç®¡åå·"); |
| | | var rawPipe_Batch = await materialProvider.FindByNameAsync("åæç®¡æ¹æ¬¡"); |
| | | var rawPipe_ProjectNumber = await materialProvider.FindByNameAsync("项ç®å·"); |
| | | var rawPipe_ShipNumber = await materialProvider.FindByNameAsync("è¹å·"); |
| | | List<TraceMaterialModel> _MaterialParams = new List<TraceMaterialModel>(); |
| | | foreach (var item in workSection.MaterialParameters) |
| | | { |
| | | if (item.Name == "åæç®¡åå·") |
| | | { |
| | | _MaterialParams.Add(new TraceMaterialModel() |
| | | { |
| | | Key = item.Key, |
| | | Quantity = 1, |
| | | MaterialId = rawPipe_MaterialMode.MaterialId, |
| | | MaterialDetailId = rawPipe_MaterialMode.MaterialDetails.First().Id, |
| | | Value = firstWorkPlan.MaterialMode |
| | | |
| | | }); |
| | | } |
| | | if (item.Name == "åæç®¡æ è¯") |
| | | { |
| | | _MaterialParams.Add(new TraceMaterialModel() |
| | | { |
| | | Key = item.Key, |
| | | Quantity = 1, |
| | | MaterialId = rawPipe_DataIdentifier.MaterialId, |
| | | MaterialDetailId = rawPipe_DataIdentifier.MaterialDetails.First().Id, |
| | | Value = firstWorkPlan.DataIdentifier, |
| | | |
| | | }); |
| | | } |
| | | if (item.Name == "åæç®¡æ¹æ¬¡") |
| | | { |
| | | _MaterialParams.Add(new TraceMaterialModel() |
| | | { |
| | | Key = item.Key, |
| | | Quantity = 1, |
| | | MaterialId = rawPipe_Batch.MaterialId, |
| | | MaterialDetailId = rawPipe_Batch.MaterialDetails.First().Id, |
| | | Value = callMaterialOrder.MaterialBatch,//æ¹æ¬¡ææ¶åæ» |
| | | |
| | | }); |
| | | } |
| | | if (item.Name == "项ç®å·") |
| | | { |
| | | _MaterialParams.Add(new TraceMaterialModel() |
| | | { |
| | | Key = item.Key, |
| | | Quantity = 1, |
| | | MaterialId = rawPipe_ProjectNumber.MaterialId, |
| | | MaterialDetailId = rawPipe_ProjectNumber.MaterialDetails.First().Id, |
| | | Value = firstWorkPlan.ProjectNumber, |
| | | |
| | | }); |
| | | } |
| | | if (item.Name == "è¹å·") |
| | | { |
| | | _MaterialParams.Add(new TraceMaterialModel() |
| | | { |
| | | Key = item.Key, |
| | | Quantity = 1, |
| | | MaterialId = rawPipe_ShipNumber.MaterialId, |
| | | MaterialDetailId = rawPipe_ShipNumber.MaterialDetails.First().Id, |
| | | Value = firstWorkPlan.ShipNumber, |
| | | |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | //é
ç½®è¿ç¨åæ°(ééåæ°ãé
æ¹åæ°) |
| | | traceModel.Params = new List<TraceParamModel>(); |
| | | foreach (var item in workSection.ProcessParameters) |
| | | { |
| | | string _value = ""; |
| | | |
| | | //ééåæ° |
| | | if (item.Name == $"{processName}åå") |
| | | { |
| | | var _getValue = await _variableService.ReadValueAsync($"{processName}åå"); |
| | | _value = _getValue.Content.Value.SafeString().ToString(); |
| | | } |
| | | if (item.Name == $"{processName}ä½ç½®") |
| | | { |
| | | var _getValue = await _variableService.ReadValueAsync($"{processName}ä½ç½®"); |
| | | _value = _getValue.Content.Value.SafeString().ToString(); |
| | | } |
| | | if (item.Name == $"{processName}é度") |
| | | { |
| | | var _getValue = await _variableService.ReadValueAsync($"{processName}é度"); |
| | | _value = _getValue.Content.Value.SafeString().ToString(); |
| | | } |
| | | |
| | | if (item.Name == $"{processName}é´é") |
| | | { |
| | | _value = "15mm"; |
| | | } |
| | | if (item.Name == $"{processName}人") |
| | | { |
| | | _value = myCurrentUser.UserAccount; |
| | | } |
| | | //item.Key |
| | | TraceParamModel traceParamModel = new TraceParamModel() |
| | | { |
| | | Key = item.Key, |
| | | Value = _value |
| | | }; |
| | | traceModel.Params.Add(traceParamModel); |
| | | }; |
| | | foreach (var item in workSection.FormulaParameters) |
| | | { |
| | | string _value = ""; |
| | | |
| | | //ééåæ° |
| | | if (item.Name == $"{processName}åå") |
| | | { |
| | | var _getValue = await _variableService.ReadValueAsync($"{processName}åå"); |
| | | _value = _getValue.Content.Value.SafeString().ToString(); |
| | | } |
| | | if (item.Name == $"{processName}ä½ç½®") |
| | | { |
| | | var _getValue = await _variableService.ReadValueAsync($"{processName}ä½ç½®"); |
| | | _value = _getValue.Content.Value.SafeString().ToString(); |
| | | } |
| | | if (item.Name == $"{processName}é度") |
| | | { |
| | | var _getValue = await _variableService.ReadValueAsync($"{processName}é度"); |
| | | _value = _getValue.Content.Value.SafeString().ToString(); |
| | | } |
| | | |
| | | if (item.Name == $"{processName}é´é") |
| | | { |
| | | _value = "15mm"; |
| | | } |
| | | if (item.Name == $"{processName}人") |
| | | { |
| | | _value = myCurrentUser.UserAccount; |
| | | } |
| | | //item.Key |
| | | TraceParamModel traceParamModel = new TraceParamModel() |
| | | { |
| | | Key = item.Key, |
| | | Value = _value |
| | | }; |
| | | traceModel.Params.Add(traceParamModel); |
| | | }; |
| | | |
| | | traceModel.MaterialParams = _MaterialParams; |
| | | |
| | | await traceProvider.CreateTraceAsync(traceModel); |
| | | |
| | | var response = new MesOrderResponse |
| | | { |
| | | Code = "200", |
| | | Data = "", |
| | | Message = "å¤çæå", |
| | | Time = DateTime.UtcNow |
| | | }; |
| | | return response; |
| | | |
| | | #endregion |
| | | |
| | | await uow.CompleteAsync(); |
| | | } |
| | | catch (Exception) |
| | | { |
| | | await uow.RollbackAsync(); |
| | | throw; |
| | | } |
| | | finally |
| | | { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// å
Œ
±å¤ç ååºåºç«å®æä¿¡å· |
| | | /// </summary> |
| | | /// <param name="_serviceProvider"></param> |
| | | /// <param name="input"></param> |
| | | /// <param name="myCurrentUser"></param> |
| | | /// <returns></returns> |
| | | public async Task CompleteHandleOutStoreFinish(IServiceProvider _serviceProvider, string processName, bool isOutResult) |
| | | { |
| | | |
| | | VariableService _variableService = _serviceProvider.GetRequiredService<VariableService>(); |
| | | |
| | | Dictionary<string, object?> keyValuePairs = new Dictionary<string, object?> |
| | | { |
| | | { $"{processName}åºç«å®æ",isOutResult}, |
| | | { $"{processName}åºç«ç»æ",isOutResult? "æå":""}, |
| | | }; |
| | | await _variableService.WriteValueAsync(keyValuePairs); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çæéæºçWmsTaskNo |
| | | /// </summary> |
| | | /// <returns>éæºçæçä»»å¡ç¼å·</returns> |
| | |
| | | using Volo.Abp.ObjectMapping; |
| | | using Volo.Abp.Users; |
| | | using CmsQueryExtensions.Entitys; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace CMS.Plugin.PipeLineLems.Application.Implements; |
| | | |
| | |
| | | { |
| | | return await _workPlanRepository.GetSingleByFilterAsync(whereConditions, isâMultipleThrowException); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶è·åä½ä¸è®¡å表å表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<List<WorkPlanDto>> FindListByFilterAsync(GetWorkPlanInput input, CancellationToken cancellationToken = default) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WorkPlan.Sort); |
| | | } |
| | | |
| | | #region 卿æé æ¥è¯¢æ¡ä»¶ |
| | | |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | var list = await _workPlanRepository.GetListByFilterAsync(whereConditions?.data); |
| | | |
| | | return new List<WorkPlanDto>(ObjectMapper.Map<List<WorkPlan>, List<WorkPlanDto>>(list)); |
| | | } |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶è·åå个ä½ä¸è®¡å表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<WorkPlanDto> FindSingleByFilterAsync(GetWorkPlanInput input, CancellationToken cancellationToken = default) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof(WorkPlan.Sort); |
| | | } |
| | | |
| | | #region 卿æé æ¥è¯¢æ¡ä»¶ |
| | | |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | var dataObj = await _workPlanRepository.GetSingleByFilterAsync(whereConditions?.data); |
| | | |
| | | return (ObjectMapper.Map<WorkPlan, WorkPlanDto>(dataObj)); |
| | | } |
| | | } |
| | |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | using CmsQueryExtensions.Entitys; |
| | | using CMS.Plugin.PipeLineLems.Domain.WorkPlan; |
| | | using System.Linq.Expressions; |
| | | |
| | | namespace CMS.Plugin.PipeLineLems.Controller |
| | | { |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶è·åä½ä¸è®¡å表å表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("FindListByFilter")] |
| | | public virtual async Task<List<WorkPlanDto>> FindListByFilterAsync(GetWorkPlanInput input) |
| | | { |
| | | return await _workPlanAppService.FindListByFilterAsync(input); |
| | | } |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶è·åå个ä½ä¸è®¡å表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("FindSingleByFilter")] |
| | | public virtual async Task<WorkPlanDto> FindSingleByFilterAsync(GetWorkPlanInput input) |
| | | { |
| | | |
| | | return await _workPlanAppService.FindSingleByFilterAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å建ä½ä¸è®¡å表 |
| | | /// </summary> |
| | | /// <param name="input">åå»ºåæ°</param> |
| | |
| | | [Route("Pick")] |
| | | public virtual async Task<MesOrderResponse> Pick([FromBody] PickInput input) |
| | | { |
| | | try |
| | | { |
| | | MyCurrentUser myCurrentUser = new MyCurrentUser() |
| | | { |
| | | UserAccount = _currentUser.UserAccount, |
| | | UserId = _currentUser.UserId |
| | | }; |
| | | return await sharedService.CommonPick(_serviceProvider, input, myCurrentUser); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return new MesOrderResponse() |
| | | { |
| | | Code = "400", |
| | | Message = ex.Message |
| | | }; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | [Route("CallMaterial")] |
| | | public virtual async Task<MesOrderResponse> CallMaterial([FromBody] CallMaterialByDataIdentifierInput input) |
| | | { |
| | | try |
| | | { |
| | | MyCurrentUser myCurrentUser = new MyCurrentUser() |
| | | { |
| | | UserAccount = _currentUser.UserAccount, |
| | |
| | | }; |
| | | return await sharedService.CallMaterial(input, _serviceProvider, myCurrentUser); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return new MesOrderResponse() |
| | | { |
| | | Code = "400", |
| | | Message = ex.Message |
| | | }; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¼å·¥ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [Authorize] |
| | | [HttpPost] |
| | | [Route("StartProduction")] |
| | | public virtual async Task<MesOrderResponse> StartProduction([FromBody] StartProductionInput input) |
| | | { |
| | | try |
| | | { |
| | | MyCurrentUser myCurrentUser = new MyCurrentUser() |
| | | { |
| | | UserAccount = _currentUser.UserAccount, |
| | | UserId = _currentUser.UserId |
| | | }; |
| | | return await sharedService.StartProduction(input, _serviceProvider, myCurrentUser); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return new MesOrderResponse() |
| | | { |
| | | Code = "400", |
| | | Message = ex.Message |
| | | }; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å®å·¥ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [Authorize] |
| | | [HttpPost] |
| | | [Route("FinishProduction")] |
| | | public virtual async Task<MesOrderResponse> FinishProduction([FromBody] CompleteAssemblyProcessInput input) |
| | | { |
| | | try |
| | | { |
| | | MyCurrentUser myCurrentUser = new MyCurrentUser() |
| | | { |
| | | UserAccount = _currentUser.UserAccount, |
| | | UserId = _currentUser.UserId |
| | | }; |
| | | return await sharedService.CompleteAssemblyProcess(_serviceProvider, input, myCurrentUser); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return new MesOrderResponse() |
| | | { |
| | | Code = "400", |
| | | Message = ex.Message |
| | | }; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using System.Collections.Generic; |
| | | using CMS.Framework.AspNetCore.Users; |
| | | using NPOI.SS.Formula.Functions; |
| | | using CMS.Plugin.PipeLineLems.Application.Implements; |
| | | using CmsQueryExtensions.Entitys; |
| | | |
| | | namespace CMS.Plugin.PipeLineLems.ProjectService |
| | | { |
| | |
| | | { "请æ±çææç 产åç ä¿¡å·", "请æ±çææç 产åç ä¿¡å·(æè¿°)" }, |
| | | { "请æ±çæåå²äº§åç ä¿¡å·", "请æ±çæåå²äº§åç ä¿¡å·(æè¿°)" }, |
| | | { "åå²è¿ç«ä¿¡å·", "åå²è¿ç«ä¿¡å·(æè¿°)" }, |
| | | |
| | | { "è£
é
å®å·¥ä¿¡å·", "è£
é
å®å·¥ä¿¡å·(æè¿°)" }, |
| | | { "çæ¥å®å·¥ä¿¡å·", "çæ¥å®å·¥ä¿¡å·(æè¿°)" }, |
| | | }; |
| | | |
| | | // å建ééçå¬ |
| | |
| | | _ = Task.Run(async () => |
| | | { |
| | | await HanlderForCutByCreateProductWhenFlaseAsync(); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (changed.Name == "è£
é
å®å·¥ä¿¡å·") |
| | | { |
| | | if (changed.New?.Value.SafeString().ToBool() == true) |
| | | { |
| | | _ = Task.Run(async () => |
| | | { |
| | | await HanlderForè£
é
å®å·¥ä¿¡å·Async(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | _ = Task.Run(async () => |
| | | { |
| | | await HanlderForå®å·¥ä¿¡å·WhenFalseAsync("è£
é
"); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | if (changed.Name == "çæ¥å®å·¥ä¿¡å·") |
| | | { |
| | | if (changed.New?.Value.SafeString().ToBool() == true) |
| | | { |
| | | _ = Task.Run(async () => |
| | | { |
| | | await HanlderForçæ¥å®å·¥ä¿¡å·Async(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | _ = Task.Run(async () => |
| | | { |
| | | await HanlderForå®å·¥ä¿¡å·WhenFalseAsync("çæ¥"); |
| | | }); |
| | | } |
| | | } |
| | |
| | | }; |
| | | var ret = _variableService.WriteValueAsync(keyValuePairs_productID); |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// è£
é
å®å·¥ä¿¡å·=trueæ¶ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | private async Task HanlderForè£
é
å®å·¥ä¿¡å·Async() |
| | | { |
| | | |
| | | var workPlanAppService = _serviceProvider.GetRequiredService<IWorkPlanAppService>(); |
| | | var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>(); |
| | | var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>(); |
| | | |
| | | var pipeSpecCode = await _variableService.ReadValueAsync("è£
é
管段ç¼ç "); |
| | | |
| | | if (string.IsNullOrEmpty(pipeSpecCode?.Content?.Value.SafeString().ToString())) |
| | | { |
| | | |
| | | } |
| | | else |
| | | { |
| | | |
| | | |
| | | |
| | | var myPipeSpecCode = pipeSpecCode.Content.Value.SafeString().ToString(); |
| | | CallMaterialOrder callMaterialOrder = null; |
| | | try |
| | | { |
| | | var sharedService = _serviceProvider.GetRequiredService<SharedService>(); |
| | | var userName = await _variableService.ReadValueAsync("è£
é
人"); |
| | | MyCurrentUser myCurrentUser = new MyCurrentUser() |
| | | { |
| | | UserAccount = userName.Content.Value.SafeString().ToString() |
| | | }; |
| | | sharedService.CompleteAssemblyProcess(_serviceProvider, new Application.Contracts.Dtos.WorkPlan.CompleteAssemblyProcessInput() { PipeSpecCode = myPipeSpecCode, ProcessName="è£
é
å·¥åº" }, myCurrentUser); |
| | | |
| | | } |
| | | catch (Exception) |
| | | { |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çæ¥å®å·¥ä¿¡å·=trueæ¶ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | private async Task HanlderForçæ¥å®å·¥ä¿¡å·Async() |
| | | { |
| | | |
| | | var workPlanAppService = _serviceProvider.GetRequiredService<IWorkPlanAppService>(); |
| | | var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>(); |
| | | var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>(); |
| | | |
| | | var pipeSpecCode = await _variableService.ReadValueAsync("çæ¥ç®¡æ®µç¼ç "); |
| | | |
| | | if (string.IsNullOrEmpty(pipeSpecCode?.Content?.Value.SafeString().ToString())) |
| | | { |
| | | |
| | | } |
| | | else |
| | | { |
| | | |
| | | |
| | | |
| | | var myPipeSpecCode = pipeSpecCode.Content.Value.SafeString().ToString(); |
| | | CallMaterialOrder callMaterialOrder = null; |
| | | try |
| | | { |
| | | var sharedService = _serviceProvider.GetRequiredService<SharedService>(); |
| | | var userName = await _variableService.ReadValueAsync("çæ¥äºº"); |
| | | MyCurrentUser myCurrentUser = new MyCurrentUser() |
| | | { |
| | | UserAccount = userName.Content.Value.SafeString().ToString() |
| | | }; |
| | | sharedService.CompleteAssemblyProcess(_serviceProvider, new Application.Contracts.Dtos.WorkPlan.CompleteAssemblyProcessInput() { PipeSpecCode = myPipeSpecCode, ProcessName = "çæ¥å·¥åº" }, myCurrentUser); |
| | | |
| | | } |
| | | catch (Exception) |
| | | { |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å®å·¥ä¿¡å·=falseæ¶ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | private async Task HanlderForå®å·¥ä¿¡å·WhenFalseAsync(string processName) |
| | | { |
| | | try |
| | | { |
| | | var sharedService = _serviceProvider.GetRequiredService<SharedService>(); |
| | | await sharedService.CompleteHandleOutStoreFinish(_serviceProvider, processName, false); |
| | | } |
| | | catch (Exception) |
| | | { |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | return await _$EntityInstanceName$Repository.GetSingleByFilterAsync(whereConditions, isâMultipleThrowException); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶è·å$ChinaComment$å表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<List<$EntityName$Dto>> FindListByFilterAsync(Get$EntityName$Input input, CancellationToken cancellationToken = default) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof($EntityName$.Sort); |
| | | } |
| | | |
| | | #region 卿æé æ¥è¯¢æ¡ä»¶ |
| | | |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | var list = await _$EntityInstanceName$Repository.GetListByFilterAsync(whereConditions?.data); |
| | | |
| | | return new List<$EntityName$Dto>(ObjectMapper.Map<List<$EntityName$>, List<$EntityName$Dto>>(list)); |
| | | } |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶è·åå个$ChinaComment$ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public virtual async Task<$EntityName$Dto> FindSingleByFilterAsync(Get$EntityName$Input input, CancellationToken cancellationToken = default) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | | if (input.Sorting.IsNullOrWhiteSpace()) |
| | | { |
| | | input.Sorting = nameof($EntityName$.Sort); |
| | | } |
| | | |
| | | #region 卿æé æ¥è¯¢æ¡ä»¶ |
| | | |
| | | //卿æé æ¥è¯¢æ¡ä»¶ |
| | | var whereConditions = DynamicGetQueryParams(input); |
| | | |
| | | #endregion |
| | | |
| | | var dataObj = await _$EntityInstanceName$Repository.GetSingleByFilterAsync(whereConditions?.data); |
| | | |
| | | return (ObjectMapper.Map<$EntityName$, $EntityName$Dto>(dataObj)); |
| | | } |
| | | } |
| | |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | Task<$EntityName$> GetSingleByFilterAsync(Expression<Func<$EntityName$, bool>> whereConditions, bool isâMultipleThrowException = false, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶è·å$ChinaComment$å表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | Task<List<$EntityName$Dto>> FindListByFilterAsync(Get$EntityName$Input input, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶è·åå个$ChinaComment$ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | Task<$EntityName$Dto> FindSingleByFilterAsync(Get$EntityName$Input input, CancellationToken cancellationToken = default); |
| | | } |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶è·å$ChinaComment$ |
| | | /// </summary> |
| | | /// <param name="input">æ¥è¯¢åæ°</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("FindListByFilter")] |
| | | public virtual async Task<List<$EntityName$Dto>> FindListByFilterAsync([FromBody]Get$EntityName$Input input) |
| | | { |
| | | return await _$EntityInstanceName$AppService.FindListByFilterAsync(input); |
| | | } |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ä»¶è·åå个$ChinaComment$ |
| | | /// </summary> |
| | | /// <param name="input">æ¥è¯¢åæ°</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("FindSingleByFilter")] |
| | | public virtual async Task<$EntityName$Dto> FindSingleByFilterAsync([FromBody]Get$EntityName$Input input) |
| | | { |
| | | |
| | | return await _$EntityInstanceName$AppService.FindSingleByFilterAsync(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å建$ChinaComment$ |
| | | /// </summary> |
| | | /// <param name="input">åå»ºåæ°</param> |