From 4984baf395a8db55a448e8dfbe52ac03ef4c59a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=96=AA=E5=90=8D?= <942005050@qq.com> Date: Thu, 9 Nov 2023 10:15:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E6=96=99=E7=94=B3=E8=AF=B7=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../issue/issueRequestMain/index.vue | 39 +-- .../issueRequestMain/issueRequestMain.data.ts | 272 +++++++++++++----- 2 files changed, 214 insertions(+), 97 deletions(-) diff --git a/src/views/wms/issueManage/issue/issueRequestMain/index.vue b/src/views/wms/issueManage/issue/issueRequestMain/index.vue index 9fa2e5b51..44e3cad82 100644 --- a/src/views/wms/issueManage/issue/issueRequestMain/index.vue +++ b/src/views/wms/issueManage/issue/issueRequestMain/index.vue @@ -44,7 +44,6 @@ @success="getList" :rules="IssueRequestMainRules" :formAllSchemas="IssueRequestMain.allSchemas" - :searchTableParams="searchTableParams" :tableAllSchemas="IssueRequestDetail.allSchemas" :tableFormRules="IssueRequestDetailRules" :tableData="tableData" @@ -64,12 +63,11 @@ :allSchemas="IssueRequestMain.allSchemas" :detailAllSchemas="IssueRequestDetail.allSchemas" :detailAllSchemasRules="IssueRequestDetailRules" - :searchTableParams="searchTableParams" :apiCreate="IssueRequestDetailApi.createIssueRequestDetail" :apiUpdate="IssueRequestDetailApi.updateIssueRequestDetail" :apiPage="IssueRequestDetailApi.getIssueRequestDetailPage" :apiDelete="IssueRequestDetailApi.deleteIssueRequestDetail" - :Echo="Echo" + @searchTableSuccessDetail="searchTableSuccessDetail" /> @@ -99,44 +97,27 @@ const updataTableColumns = (val) => { tableColumns.value = val } -// 查询列表页面参数设置 -const searchTableParams = ref([ -//{ -// formField: 'productItemCode', -// searchTableTitle: '物料信息', -// searchTableAllSchemas: Itembasic.allSchemas, -// searchTablePage: ItembasicApi.getItembasicPage -//} -]) - // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { nextTick(() => { if (type == 'tableForm') { // 明细查询页赋值 - //row[formField] = val[0][searchField] - //row['poLine'] = val[0]['poLine'] - //row['batch'] = val[0]['toBatch'] - //row['altBatch'] = val[0]['altBatch'] - //row['itemCode'] = val[0]['itemCode'] - //row['itemName'] = val[0]['itemName'] - //row['itemDesc1'] = val[0]['itemDesc1'] - //row['itemDesc2'] = val[0]['itemDesc2'] - //row['projectCode'] = val[0]['projectCode'] - //row['qty'] = val[0]['qty'] - //row['uom'] = val[0]['uom'] + row[formField] = val[0][searchField] } else { const setV = {} setV[formField] = val[0][searchField] - //setV['ppNumber'] = val[0]['ppNumber'] - //setV['supplierCode'] = val[0]['supplierCode'] formRef.setValues(setV) } }) } -// 子表新增的时候选择表格之后需要会显得字段 -// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom'] -const Echo = [] +// 查询页面返回——详情 +const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { + nextTick(() => { + const setV = {} + setV[formField] = val[0][searchField] + formRef.setValues(setV) + }) +} const { tableObject, tableMethods } = useTable({ getListApi: IssueRequestMainApi.getIssueRequestMainPage // 分页接口 diff --git a/src/views/wms/issueManage/issue/issueRequestMain/issueRequestMain.data.ts b/src/views/wms/issueManage/issue/issueRequestMain/issueRequestMain.data.ts index 32f902a22..f27507c24 100644 --- a/src/views/wms/issueManage/issue/issueRequestMain/issueRequestMain.data.ts +++ b/src/views/wms/issueManage/issue/issueRequestMain/issueRequestMain.data.ts @@ -1,8 +1,21 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' -const { t } = useI18n() // 国际化 import * as getRequestsettingApi from '@/api/wms/requestsetting/index' +import * as ProductionlineApi from '@/api/wms/productionline' +import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data' + +import * as WorkstationApi from '@/api/wms/workstation' +import { Workstation } from '@/views/wms/basicDataManage/factoryModeling/workstation/workstation.data' + +import * as WorkshopApi from '@/api/wms/workshop' +import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data' + +import * as ItembasicApi from '@/api/wms/itembasic' +import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data' + +const { t } = useI18n() // 国际化 + // 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 const queryParams = { pageSize:10, @@ -28,6 +41,17 @@ export const IssueRequestMain = useCrudSchemas(reactive([ table: { width: 150 }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择车间代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '车间信息', // 查询弹窗标题 + searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类 + searchPage: WorkshopApi.getWorkshopPage // 查询弹窗所需分页方法 + } + } }, { label: '从仓库代码', @@ -36,6 +60,7 @@ export const IssueRequestMain = useCrudSchemas(reactive([ table: { width: 150 }, + isForm: false }, { label: '从库位类型范围', @@ -48,6 +73,7 @@ export const IssueRequestMain = useCrudSchemas(reactive([ table: { width: 150 }, + isForm: false }, { label: '从库区代码范围', @@ -56,6 +82,7 @@ export const IssueRequestMain = useCrudSchemas(reactive([ table: { width: 150 }, + isForm: false }, { label: '到仓库代码', @@ -64,6 +91,7 @@ export const IssueRequestMain = useCrudSchemas(reactive([ table: { width: 150 }, + isForm: false }, { label: '到库位类型范围', @@ -75,6 +103,7 @@ export const IssueRequestMain = useCrudSchemas(reactive([ table: { width: 150 }, + isForm: false }, { label: '到库区代码范围', @@ -83,6 +112,7 @@ export const IssueRequestMain = useCrudSchemas(reactive([ table: { width: 150 }, + isForm: false }, { label: '单据号', @@ -107,7 +137,8 @@ export const IssueRequestMain = useCrudSchemas(reactive([ componentProps: { disabled: true } - } + }, + isForm: false }, { label: '备注', @@ -167,6 +198,7 @@ export const IssueRequestMain = useCrudSchemas(reactive([ valueFormat: 'x', } }, + isForm: false, }, { label: '截止时间', @@ -182,6 +214,7 @@ export const IssueRequestMain = useCrudSchemas(reactive([ form: { component: 'DatePicker', componentProps: { + style:{width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -251,10 +284,11 @@ export const IssueRequestMain = useCrudSchemas(reactive([ isForm: false, }, { - label: '自动提交', - field: 'autoCommit', + label: '使用在途库', + field: 'useOnTheWayLocation', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', + isSearch: true, isTable: true, sort: 'custom', table: { @@ -262,17 +296,16 @@ export const IssueRequestMain = useCrudSchemas(reactive([ }, form: { component: 'Switch', - value: requestsettingData.autoCommit, + value: 'TRUE', componentProps: { inactiveValue: 'FALSE', - activeValue: 'TRUE', - disabled: true + activeValue: 'TRUE' } } }, { - label: '自动通过', - field: 'autoAgree', + label: '自动提交', + field: 'autoCommit', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', isTable: true, @@ -282,7 +315,7 @@ export const IssueRequestMain = useCrudSchemas(reactive([ }, form: { component: 'Switch', - value: requestsettingData.autoAgree, + value: requestsettingData.autoCommit, componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE', @@ -291,8 +324,8 @@ export const IssueRequestMain = useCrudSchemas(reactive([ } }, { - label: '自动执行', - field: 'autoExecute', + label: '自动通过', + field: 'autoAgree', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', isTable: true, @@ -302,7 +335,7 @@ export const IssueRequestMain = useCrudSchemas(reactive([ }, form: { component: 'Switch', - value: requestsettingData.autoExecute, + value: requestsettingData.autoAgree, componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE', @@ -311,8 +344,8 @@ export const IssueRequestMain = useCrudSchemas(reactive([ } }, { - label: '直接生成记录', - field: 'directCreateRecord', + label: '自动执行', + field: 'autoExecute', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', isTable: true, @@ -322,7 +355,7 @@ export const IssueRequestMain = useCrudSchemas(reactive([ }, form: { component: 'Switch', - value: requestsettingData.directCreateRecord, + value: requestsettingData.autoExecute, componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE', @@ -331,11 +364,10 @@ export const IssueRequestMain = useCrudSchemas(reactive([ } }, { - label: '使用在途库', - field: 'useOnTheWayLocation', + label: '直接生成记录', + field: 'directCreateRecord', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', - isSearch: true, isTable: true, sort: 'custom', table: { @@ -343,10 +375,11 @@ export const IssueRequestMain = useCrudSchemas(reactive([ }, form: { component: 'Switch', - value: 'TRUE', + value: requestsettingData.directCreateRecord, componentProps: { inactiveValue: 'FALSE', - activeValue: 'TRUE' + activeValue: 'TRUE', + disabled: true } } }, @@ -363,6 +396,9 @@ export const IssueRequestMain = useCrudSchemas(reactive([ ])) export const IssueRequestMainRules = reactive({ + workshopCode: [ + { required: true, message: '请选择车间代码', trigger: 'change' } + ], fromWarehouseCode: [ { required: true, message: '请输入从仓库代码', trigger: 'blur' } ], @@ -406,6 +442,25 @@ export const IssueRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + tableForm:{ + isInpuFocusShow: true, + searchListPlaceholder: '请选择生产线代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '生产线信息', // 查询弹窗标题 + searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类 + searchPage: ProductionlineApi.getProductionlinePage // 查询弹窗所需分页方法 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择生产线代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '生产线信息', // 查询弹窗标题 + searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类 + searchPage: ProductionlineApi.getProductionlinePage // 查询弹窗所需分页方法 + } + } }, { label: '工位代码', @@ -414,6 +469,25 @@ export const IssueRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + tableForm:{ + isInpuFocusShow: true, + searchListPlaceholder: '请选择工位代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '工位信息', // 查询弹窗标题 + searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类 + searchPage: WorkstationApi.getWorkstationPage // 查询弹窗所需分页方法 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择工位代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '工位信息', // 查询弹窗标题 + searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类 + searchPage: WorkstationApi.getWorkstationPage // 查询弹窗所需分页方法 + } + } }, { label: '包装号', @@ -422,6 +496,8 @@ export const IssueRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + isTableForm: false, + isForm: false }, { label: '器具号', @@ -430,6 +506,8 @@ export const IssueRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + isTableForm: false, + isForm: false }, { label: '批次', @@ -438,6 +516,8 @@ export const IssueRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + isTableForm: false, + isForm: false }, { label: '库存状态', @@ -449,6 +529,8 @@ export const IssueRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + isTableForm: false, + isForm: false }, { label: '到库位代码', @@ -457,62 +539,70 @@ export const IssueRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + isTableForm: false, + isForm: false }, { - label: '单据号', - field: 'number', + label: '物品代码', + field: 'itemCode', sort: 'custom', table: { width: 150 }, - isTableForm: false, + tableForm:{ + isInpuFocusShow: true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择物品代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '物品基础信息', // 查询弹窗标题 + searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类 + searchPage: ItembasicApi.getItembasicPage // 查询弹窗所需分页方法 + }, form: { + // labelMessage: '信息提示说明!!!', componentProps: { - disabled: true + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择物品代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '物品基础信息', // 查询弹窗标题 + searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类 + searchPage: ItembasicApi.getItembasicPage // 查询弹窗所需分页方法 } } }, { - label: '物品代码', - field: 'itemCode', + label: '物品名称', + field: 'itemName', sort: 'custom', table: { width: 150 }, + isTableForm: false, + isForm: false }, { - label: '备注', - field: 'remark', + label: '物品描述1', + field: 'itemDesc1', sort: 'custom', table: { width: 150 }, + isTableForm: false, + isForm: false }, { - label: '创建时间', - field: 'createTime', - formatter: dateFormatter, - detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' - }, + label: '物品描述2', + field: 'itemDesc2', sort: 'custom', table: { - width: 180 - }, - form: { - component: 'DatePicker', - componentProps: { - type: 'datetime', - dateFormat: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'x', - } + width: 150 }, isTableForm: false, isForm: false }, { - label: '创建者', - field: 'creator', + label: '项目代码', + field: 'projectCode', sort: 'custom', table: { width: 150 @@ -521,71 +611,105 @@ export const IssueRequestDetail = useCrudSchemas(reactive([ isForm: false }, { - label: '物品名称', - field: 'itemName', + label: '数量', + field: 'qty', sort: 'custom', table: { width: 150 }, + tableForm:{ + type: 'InputNumber', + min: 1, + precision: 6 + } }, { - label: '物品描述1', - field: 'itemDesc1', + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isTable: true, sort: 'custom', table: { width: 150 }, + tableForm:{ + type: 'Select', + } }, { - label: '物品描述2', - field: 'itemDesc2', + label: '从货主代码', + field: 'fromOwnerCode', sort: 'custom', table: { width: 150 }, + isTableForm: false, + isForm: false }, { - label: '项目代码', - field: 'projectCode', + label: '到货主代码', + field: 'toOwnerCode', sort: 'custom', table: { width: 150 }, + isTableForm: false, + isForm: false }, { - label: '数量', - field: 'qty', + label: '单据号', + field: 'number', sort: 'custom', table: { width: 150 }, + isTableForm: false, + form: { + componentProps: { + disabled: true + } + } }, { - label: '计量单位', - field: 'uom', - dictType: DICT_TYPE.UOM, - dictClass: 'string', - isTable: true, + label: '备注', + field: 'remark', sort: 'custom', table: { width: 150 }, }, { - label: '从货主代码', - field: 'fromOwnerCode', + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, sort: 'custom', table: { - width: 150 + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } }, + isTableForm: false, + isForm: false }, { - label: '到货主代码', - field: 'toOwnerCode', + label: '创建者', + field: 'creator', sort: 'custom', table: { width: 150 }, + isTableForm: false, + isForm: false }, { label: '最后更新时间', @@ -634,6 +758,15 @@ export const IssueRequestDetail = useCrudSchemas(reactive([ //表单校验 export const IssueRequestDetailRules = reactive({ + productionLineCode: [ + { required: true, message: '请选择生产线代码', trigger: 'change' } + ], + workStationCode: [ + { required: true, message: '请选择工位代码', trigger: 'change' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], packingNumber: [ { required: true, message: '请输入包装号', trigger: 'blur' } ], @@ -646,7 +779,10 @@ export const IssueRequestDetailRules = reactive({ toLocationCode: [ { required: true, message: '请输入到库位代码', trigger: 'blur' } ], - itemCode: [ - { required: true, message: '请输入物品代码', trigger: 'blur' } + qty: [ + { required: true, message: '请输入数量', trigger: 'blur' } + ], + uom: [ + { required: true, message: '请选择单位', trigger: 'change' } ], }) \ No newline at end of file