From b0e70aee592c5b8c974a4c1d5505b0389e125120 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周日, 18 5月 2025 15:22:06 +0800 Subject: [PATCH] 22 --- PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs | 8 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPickDrawer.ts | 44 + PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/PipeAccessoryPick.module.scss | 253 +++++++ PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.tsx | 71 ++ PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/index.ts | 14 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/enum.ts | 15 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPickQueryDrawer.ts | 35 + PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/File.ts | 31 PipeLineLems/pipelinelems_web/src/config/menu.ts | 14 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.module.scss | 3 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPickDrawer.tsx | 190 +++++ PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPick.ts | 41 + PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.module.scss | 3 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/config/PipeAccessoryPick.json | 3 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/PipeAccessoryPick.tsx | 80 ++ PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPick.ts | 275 ++++++++ PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/type/type.d.ts | 45 + PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPick.ts | 87 ++ PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPickQueryDrawer.tsx | 181 +++++ PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPickQueryDrawer.ts | 44 + PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPickDrawer.ts | 34 + PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.tsx | 61 + PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/PipeAccessoryPick.tsx | 367 +++++++++++ PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/PipeAccessoryPick.module.scss | 7 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/Config.ts | 27 25 files changed, 1,933 insertions(+), 0 deletions(-) diff --git a/PipeLineLems/pipelinelems_web/src/config/menu.ts b/PipeLineLems/pipelinelems_web/src/config/menu.ts index 6082c6c..f52b44f 100644 --- a/PipeLineLems/pipelinelems_web/src/config/menu.ts +++ b/PipeLineLems/pipelinelems_web/src/config/menu.ts @@ -14,6 +14,13 @@ "notPage": false }, { + "name": "鍒嗘嫞", + "path": "/information-base/PipeAccessoryPick", + "patchName": "PipeAccessoryPick", + "icon": "p", + "notPage": false + }, + { "name": "绠¢檮浠惰閰�", "path": "/information-base/PipeAccessoryAssembly", "patchName": "PipeAccessoryAssembly", @@ -71,6 +78,13 @@ "icon": "p", "notPage": false }, + "PipeAccessoryPick": { + "name": "鍒嗘嫞", + "path": "/information-base/PipeAccessoryPick", + "patchName": "PipeAccessoryPick", + "icon": "p", + "notPage": false + }, "PipeAccessoryAssembly": { "name": "绠¢檮浠惰閰�", "path": "/information-base/PipeAccessoryAssembly", diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/File.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/File.ts new file mode 100644 index 0000000..9162fef --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/File.ts @@ -0,0 +1,31 @@ +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, + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPick.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPick.ts new file mode 100644 index 0000000..62b7f91 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPick.ts @@ -0,0 +1,275 @@ +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 + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPickDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPickDrawer.tsx new file mode 100644 index 0000000..d807a74 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPickDrawer.tsx @@ -0,0 +1,190 @@ +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) + }, + }) + /** + * 娣诲姞鐨刦orm瀛楁 + */ + 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: '璇疯緭鍏ョ墿鏂橧D', + 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, + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPickQueryDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPickQueryDrawer.tsx new file mode 100644 index 0000000..b7179ed --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Controllers/PipeAccessoryPickQueryDrawer.tsx @@ -0,0 +1,181 @@ +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) + }, + }) + /** + * 娣诲姞鐨刦orm瀛楁 + */ + const formItems = reactive([ + { + label: '鎵樼洏缂栧彿', + prop: 'containerNo', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ユ墭鐩樼紪鍙�', + }, + { + label: '鐗╂枡ID', + prop: 'materialId', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ョ墿鏂橧D', + }, + ]) + /** + * 鏍¢獙鏄惁鏈夋暟鎹彉鍖� + */ + 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, + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPick.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPick.ts new file mode 100644 index 0000000..33fee96 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPick.ts @@ -0,0 +1,41 @@ +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) + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPickDrawer.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPickDrawer.ts new file mode 100644 index 0000000..456f2b2 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPickDrawer.ts @@ -0,0 +1,44 @@ +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) + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPickQueryDrawer.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPickQueryDrawer.ts new file mode 100644 index 0000000..3374aa6 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/PipeAccessoryPickQueryDrawer.ts @@ -0,0 +1,44 @@ +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) + } +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPick.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPick.ts new file mode 100644 index 0000000..23b4619 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPick.ts @@ -0,0 +1,87 @@ +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) +} \ No newline at end of file diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPickDrawer.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPickDrawer.ts new file mode 100644 index 0000000..fae0103 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPickDrawer.ts @@ -0,0 +1,34 @@ +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) +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPickQueryDrawer.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPickQueryDrawer.ts new file mode 100644 index 0000000..8f2a1a3 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Models/Service/PipeAccessoryPickQueryDrawer.ts @@ -0,0 +1,35 @@ +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) +} + diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.module.scss b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.module.scss new file mode 100644 index 0000000..177adca --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.module.scss @@ -0,0 +1,3 @@ +.drawer { + width: 800px; +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.tsx new file mode 100644 index 0000000..b450041 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerDrawer/WmsMaterialContainerDrawer.tsx @@ -0,0 +1,61 @@ +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> + ) + }, +}) diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.module.scss b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.module.scss new file mode 100644 index 0000000..177adca --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.module.scss @@ -0,0 +1,3 @@ +.drawer { + width: 800px; +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.tsx new file mode 100644 index 0000000..ced4098 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/Dialog/WmsMaterialContainerQueryDrawer/WmsMaterialContainerQueryDrawer.tsx @@ -0,0 +1,71 @@ +/* + * 鐗╂枡鍩虹淇℃伅鏌ヨ寮瑰嚭妗� +*/ +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> + ) + }, +}) diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/Config.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/Config.ts new file mode 100644 index 0000000..5e6ddfc --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/Config.ts @@ -0,0 +1,27 @@ +export const columns = [ + { + type: 'seq', + width: 60, + title: '搴忓彿', + }, + { + field: 'containerNo', + title: '鎵樼洏缂栧彿', +}, +{ + field: 'materialId', + title: '鐗╂枡ID', +}, +{ + field: 'sort', + title: '', +}, +{ + field: 'creationTime', + title: '鏄惁绂佺敤', +}, +{ + field: 'deletionTime', + title: '', +}, +] diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/PipeAccessoryPick.module.scss b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/PipeAccessoryPick.module.scss new file mode 100644 index 0000000..597d57e --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/PipeAccessoryPick.module.scss @@ -0,0 +1,253 @@ +.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; +} + diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/PipeAccessoryPick.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/PipeAccessoryPick.tsx new file mode 100644 index 0000000..7261c72 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/Pages/PipeAccessoryPick/PipeAccessoryPick.tsx @@ -0,0 +1,367 @@ +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="宸ヤ綅浠g爜 "> + <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="璁惧浠g爜 "> + <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> + ) + } + }, +}) diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/PipeAccessoryPick.module.scss b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/PipeAccessoryPick.module.scss new file mode 100644 index 0000000..7c8d5b3 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/PipeAccessoryPick.module.scss @@ -0,0 +1,7 @@ +.PipeAccessoryPick { + background-color: #fff; + border-radius: 5px 5px 0 0; + width: 100%; + height: 100%; + border: 1px solid #dbdbdb; +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/PipeAccessoryPick.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/PipeAccessoryPick.tsx new file mode 100644 index 0000000..83ef666 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/PipeAccessoryPick.tsx @@ -0,0 +1,80 @@ +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> + ) + } + }, +}) diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/config/PipeAccessoryPick.json b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/config/PipeAccessoryPick.json new file mode 100644 index 0000000..153a75e --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/Views/config/PipeAccessoryPick.json @@ -0,0 +1,3 @@ +{ + "name": "PipeAccessoryPick" +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/enum.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/enum.ts new file mode 100644 index 0000000..52c35ae --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/enum.ts @@ -0,0 +1,15 @@ +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': '鍒楄〃-杈撳嚭', +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/index.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/index.ts new file mode 100644 index 0000000..0554855 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/index.ts @@ -0,0 +1,14 @@ +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, +} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/type/type.d.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/type/type.d.ts new file mode 100644 index 0000000..aa8d450 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryPick/type/type.d.ts @@ -0,0 +1,45 @@ +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 +} diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs index 297b6c4..884a9c5 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs @@ -49,6 +49,14 @@ /// <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銆佽褰曞垎鎷h褰曡〃 //2銆佹洿鏂颁綔涓氳鍒掕〃鐨勭姸鎬� =宸插垎鎷� //3銆佸啓鍏� 鍒嗘嫞鍙橀噺 -- Gitblit v1.9.3