diff --git a/README.md b/README.md index 314704f75..52d41693e 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,23 @@ form: { message: '请选择生产线信息!', // 当前置条件为空时 弹出信息提示 isMainValue: true // 表示查询条件是主表的字段的值 }, + { + key: 'customerCode', // 查询列表中字段 + value: 'customerCode', // 指查询具体值 + action: '==', // 查询拼接条件 + isSearch: true, // 使用自定义拼接条件 + isMainValue: false // 拼接条件必须要 false 同时不能与 isMainValue: true 同用 + isFormModel:true, // filters中添加筛选的数据--取于formModel + required:true, // 前置添加必有,和isFormModel结合使用 + message: '请选择客户代码!', // 前置添加没填的提示语 + }, + { + key: 'itemCode', + value: 'itemCode', + message: '请选择订单行', + isTableRowValue: true, //查询当前searchTable表中行数据的值 + isMainValue:false + }, { key:'available', // 查询列表中字段 value:'TRUE', // 指查询具体值 diff --git a/src/api/eam/equipmentMaintenanceDetail/index.ts b/src/api/eam/equipmentMaintenanceDetail/index.ts index 81a8696e1..0869a000d 100644 --- a/src/api/eam/equipmentMaintenanceDetail/index.ts +++ b/src/api/eam/equipmentMaintenanceDetail/index.ts @@ -43,6 +43,11 @@ export const createEquipmentMaintenanceDetail = async (data: EquipmentMaintenanc return await request.post({ url: `/eam/equipment-maintenance-detail/create`, data }) } +// 新增设备保养工单 通过主表添加 +export const createItemEquipmentMaintenanceDetail = async (data: EquipmentMaintenanceDetailVO) => { + return await request.post({ url: `/eam/equipment-maintenance-detail/createItem`, data }) +} + // 修改设备保养工单子 export const updateEquipmentMaintenanceDetail = async (data: EquipmentMaintenanceDetailVO) => { return await request.put({ url: `/eam/equipment-maintenance-detail/update`, data }) @@ -61,4 +66,4 @@ export const exportEquipmentMaintenanceDetail = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/eam/equipment-maintenance-detail/get-import-template' }) -} \ No newline at end of file +} diff --git a/src/api/eam/equipmentMaintenanceMain/index.ts b/src/api/eam/equipmentMaintenanceMain/index.ts index a3ba8d8db..5bc59771d 100644 --- a/src/api/eam/equipmentMaintenanceMain/index.ts +++ b/src/api/eam/equipmentMaintenanceMain/index.ts @@ -79,7 +79,12 @@ export const updateEnableCode = async (data: EquipmentMainPartVO) => { return await request.post({ url: `/eam/equipment-maintenance-main/ables` , data }) } -// 执行保养工单 +// 修改保养工单状态 +export const updateMaintenanceOrder = async (data: EquipmentMainPartVO) => { + return await request.post({ url: `/eam/equipment-maintenance-main/updateOrder`, data }) +} + +//执行保养工单 export const executeMaintenanceOrder = async (data: EquipmentMainPartVO) => { return await request.post({ url: `/eam/equipment-maintenance-main/execute`, data }) } diff --git a/src/api/wms/productreceiptRecordMain/index.ts b/src/api/wms/productreceiptRecordMain/index.ts index 79b5699c9..102bef055 100644 --- a/src/api/wms/productreceiptRecordMain/index.ts +++ b/src/api/wms/productreceiptRecordMain/index.ts @@ -110,4 +110,13 @@ export const exportProductreceiptRecordAssembleMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/productreceipt-record-main/get-import-template' }) +} +// 创建上架申请 +export const createPutawayRequest = async (number:string) => { + return await request.post({ url: `/wms/productreceipt-record-main/createPutawayRequest?number=`+number }) +} + +// 创建检验申请 +export const createInspectRequest = async (number:string) => { + return await request.post({ url: `/wms/productreceipt-record-main/createInspectRequest?number=`+number }) } \ No newline at end of file diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index 4157195f5..257250012 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -96,6 +96,7 @@ @inputNumberChange="inputNumberChange" @tableFormSelectOnBlur="tableFormSelectOnBlur" @formFormDateChange="formFormDateChange" + @clearInput='clearInput' > @@ -154,12 +199,15 @@ import Tabs from '@/components/Tabs/src/Tabs.vue' import * as RemarkApi from '@/api/wms/remark' import * as FileApi from '@/api/wms/file' import * as defaultButtons from '@/utils/disposition/defaultButtons' -import BasicFormQmsNumber from '@/components/BasicForm/src/BasicFormQmsNumber.vue' +import BasicForm from '@/components/BasicForm/src/BasicForm.vue' import TableHead from '@/components/TableHead/src/TableHead.vue' import DetailTable from '@/components/DetailTable/src/DetailTable.vue' import { SearchTable } from '@/components/SearchTable' +import { + EquipmentMaintenanceDetail, EquipmentMaintenanceDetailRules, +} from "@/views/eam/equipmentMaintenanceMain/equipmentMaintenanceMain.data"; -defineOptions({ name: 'DetailQmsNumber' }) +defineOptions({ name: 'Detail' }) const message = useMessage() // 消息弹窗 const { t } = useI18n() // 国际化 @@ -177,6 +225,24 @@ const props = defineProps({ required: true, default: null }, + //展示附件组件的tab标签 + annexTable: { + type: Array, + required: false, + default: ()=>[] + }, + //展示附件组件的tab标签 + annexAlias: { + type: Object, + required: false, + default: ()=>({ + label: '附件', + showDownload:false, + showPreview:false, + hiddenDelete:false + }) + }, + // 是否是基础数据 展现详情顶部表单 isBasic: { type: Boolean, @@ -311,16 +377,15 @@ const props = defineProps({ required: false, default: false }, - //个性化功能标志 - myFuncTypeSign:{ - type: String, + //扩展其他按钮 + otherHeadButttonData:{ + type:Array, required: false, - default: null - }, + default: () => [] + } }) const isShowDrawer = ref(false) const detailLoading = ref(false) -const myFuncTypeSign = props.myFuncTypeSign const tabsList = ref(JSON.parse(JSON.stringify(props.tabs ? props.tabs : ''))) if (props.isBasic == true) { @@ -342,23 +407,38 @@ if (props.isBasic == true) { } } -const otherList = [] - +const otherList = [...props.annexTable,{ + label:props.annexAlias.label, + prop:'Annex' +},{ + label:'备注', + prop:'Remarks' +},{ + label:'变更记录', + prop:'ChangeRecord' +}] tabsList.value = [...tabsList?.value,...otherList] if (!tabsList.value || tabsList.value && tabsList.value.length == otherList.length) { tabsList.value.unshift({ - label: '明细', - prop: 'Detail' + label: '明细', + prop: 'Detail' + }) +} +if(!props.isBasic){ + tabsList.value.unshift({ + label: '主数据', + prop: 'Descriptions' }) } -// Tabs + +// Tabs const tabRef = ref() //滚动条 -const scrollbar = ref() +const scrollbar = ref() //附件 备注 变更记录 高度计算 -const remarkHeight = computed(() => { +const remarkHeight = computed(() => { const tab = unref(tabRef) const tabTop = tab?.$el.getBoundingClientRect().top const tabHeight = tab?.$el.getBoundingClientRect().height @@ -372,6 +452,8 @@ const remarkHeight = computed(() => { const annexData = reactive({ annexList: [] }) +// // 其他附件默认数据数组 +const annexTableData = ref>([]) // 备注数据 const remarksData = reactive({ @@ -393,6 +475,48 @@ const getFileList = async () => { detailLoading.value = false } } +// 获取其他附件列表篇 +const getAnnexFileList = async (row) => { + props.annexTable?.forEach(async (item) => { + let requstData = {...remarksData.data,tableName: item?.tableName} + if(item?.queryParams){ + item?.queryParams?.forEach(queryItem => { + requstData[queryItem.queryField] = row[queryItem.rowField] + }); + } + const annexList = await FileApi.getFileList(requstData) + const annexData = annexTableData.value.find(annex=>annex.label === item.label) + if(annexData){ + annexData.annexList = annexList + }else{ + annexTableData.value.push({ + align:item.align, + label: item.label, + tableName: item?.tableName || '', + annexList, + hasSubDetail:item.hasSubDetail||false, + subDetailTableData:item.subDetailTableData, + fileType:item.fileType||['apk','doc', 'xls', 'ppt', 'txt', 'pdf','png', 'jpg', 'jpeg'], + showPreview:item.showPreview||false, // 是否展示预览按钮 + showDownload:item.showDownload||false, // 是否展示下载按钮 + hiddenDelete:item.hiddenDelete || false, // 是否展示删除按钮 + }) + if(item?.subDetailTableData){ + const { tableObject:subTableObject, tableMethods:subTableMethods } = useTable({ + getListApi: item.subDetailTableData.getSubList // 分页接口 + }) + const {getList:getSubList} = subTableMethods + subTableObject.params= {} + item.subDetailTableData.queryParams.forEach(queryItem => { + subTableObject.params[queryItem.queryField] = row[queryItem.rowField] + }); + await getSubList() + item.subDetailTableData.tableList = subTableObject.tableList + console.log('subTableObject',annexTableData.value) + } + } + }) +} /** 添加附件 */ const handleAnnexSuccess = () => { getFileList() @@ -403,6 +527,11 @@ const deleteAnnexSuccess = async () => { getFileList() getChangeRecordList() } +/** 追加的附件 */ +const updateAnnexTableHandle = () => { + getAnnexFileList(detailData.value) + getChangeRecordList() +} // Tabs当前选择 const current = ref(0) @@ -413,14 +542,14 @@ const change = (item, index) => { // 附件/备注/变更记录 -- 点击回到顶部 scrollbar.value.scrollTo({ top: 0}); } - + } //主表所需的参数 const masterParmas = ref({ masterId: '', //主表id number: '', //主表单据号 - status: '', //主表状态 用于控制子表新增编辑按钮显示情况 + status: '' //主表状态 用于控制子表新增编辑按钮显示情况 }) // 列表头部按钮 @@ -455,17 +584,23 @@ const searchTableFormType = ref('') // 表单的类型:create - 新增;updat const formRef = ref() const titleNameRef = ref() const titleValueRef = ref() +const count =ref(0) const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => { titleNameRef.value = titleName titleValueRef.value = titleValue + remarksData.data = { + tableId: row.masterId||row.id, + tableName: tableName + } + count.value++ // 加载明细列表 if (!props.isBasic) { // 设置主表id - masterParmas.value.masterId = row.id + masterParmas.value.masterId = row.masterId||row.id masterParmas.value.number = row.number masterParmas.value.status = row.status tableObjectRef.value.params = { - masterId: row.id + masterId: row.masterId||row.id } await getList() } @@ -474,9 +609,10 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: detailLoading.value = true try { detailData.value = row - // getRemarkList() - // getFileList() - // getChangeRecordList() + getRemarkList() + getFileList() + getAnnexFileList(row) + getChangeRecordList() // 判断详情按钮是否显示 let detailButtonFilter: any = [] let detailButtonAdd: any = [] @@ -502,7 +638,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: defaultButtons.defaultFilterBtn(null) // 筛选 ] } - + HeadButttondata.value = [...HeadButttondata.value,...props.otherHeadButttonData] let detailButtonEdit: any = [] let detailButtonDelete: any = [] if (props.detailButtonIsShowEdit) { @@ -564,11 +700,6 @@ detailAllSchemasRef.value = props.detailAllSchemas // 根据状态返回该按钮是否显示 const isShowMainButton = (row, val) => { - // if (val.indexOf(row.status) > -1) { - // return false - // } else { - // return true - // } return false } @@ -588,13 +719,13 @@ const buttonBaseClick = (val, item) => { }) const item = props.detailAllSchemas.formSchema[0] opensearchTable( - item.field, item?.componentProps?.searchField, - item?.componentProps?.searchTitle, - item?.componentProps?.searchAllSchemas, - item?.componentProps?.searchPage, - item?.componentProps?.searchCondition, - item?.componentProps?.multiple, - undefined,undefined + item.field, item?.componentProps?.searchField, + item?.componentProps?.searchTitle, + item?.componentProps?.searchAllSchemas, + item?.componentProps?.searchPage, + item?.componentProps?.searchCondition, + item?.componentProps?.multiple, + undefined,undefined ) }else{ openForm('create') @@ -613,6 +744,7 @@ const buttonBaseClick = (val, item) => { } else { // 其他按钮 console.log('其他按钮', item) + emit('buttonBaseClick',val, item) } } @@ -643,8 +775,6 @@ const opensearchTable = ( } } } - console.log(searchCondition) - console.log(_searchCondition) searchTableRef.value.open( searchTitle, searchAllSchemas, @@ -674,13 +804,13 @@ const buttonTableClick = async (val, row) => { } const item = props.detailAllSchemas.formSchema[0] opensearchTable( - item.field, item?.componentProps?.searchField, - item?.componentProps?.searchTitle, - item?.componentProps?.searchAllSchemas, - item?.componentProps?.searchPage, - item?.componentProps?.searchCondition, - item?.componentProps?.multiple, - undefined,undefined + item.field, item?.componentProps?.searchField, + item?.componentProps?.searchTitle, + item?.componentProps?.searchAllSchemas, + item?.componentProps?.searchPage, + item?.componentProps?.searchCondition, + item?.componentProps?.multiple, + undefined,undefined ) }else{ openForm('update', row) @@ -694,8 +824,71 @@ const buttonTableClick = async (val, row) => { } /** 添加/修改操作 */ const openForm = async (type: string, row?: number) => { + formRef.value.open(type, row, masterParmas.value) - emit('detailOpenForm', type, row, masterParmas.value) + emit('detailOpenForm', type, row) + + if(type == "create"){ + EquipmentMaintenanceDetail.allSchemas.formSchema.forEach((item) => { + if(item.field == 'peoples'){ + item.componentProps.disabled = true + EquipmentMaintenanceDetailRules.peoples[0].required = false + } + if(item.field == 'estimatedMinutes'){ + EquipmentMaintenanceDetailRules.estimatedMinutes[0].required = true + } + if(item.field == 'actualMinutes'){ + item.componentProps.disabled = true + EquipmentMaintenanceDetailRules.actualMinutes[0].required = false + } + if(item.field == 'completionTime'){ + item.componentProps.disabled = true + } + if(item.field == 'result'){ + item.componentProps.disabled = true + EquipmentMaintenanceDetailRules.result[0].required = false + } + if(item.field == 'uncompletedCause'){ + item.componentProps.disabled = true + EquipmentMaintenanceDetailRules.uncompletedCause[0].required = false + } + if(item.field == 'name'){ + EquipmentMaintenanceDetailRules.name[0].required = true + } + }) + }else{ + row.peoples = row.peoples.toString() + row.estimatedMinutes = row.estimatedMinutes.toString() + row.actualMinutes = row.actualMinutes.toString() + EquipmentMaintenanceDetail.allSchemas.formSchema.forEach((item) => { + if(item.field == 'peoples'){ + console.log(item); + item.componentProps.disabled = false + EquipmentMaintenanceDetailRules.peoples[0].required = true + } + if(item.field == 'estimatedMinutes'){ + EquipmentMaintenanceDetailRules.estimatedMinutes[0].required = false + } + if(item.field == 'actualMinutes'){ + item.componentProps.disabled = false + EquipmentMaintenanceDetailRules.actualMinutes[0].required = true + } + if(item.field == 'completionTime'){ + item.componentProps.disabled = false + } + if(item.field == 'result'){ + item.componentProps.disabled = false + EquipmentMaintenanceDetailRules.result[0].required = true + } + if(item.field == 'uncompletedCause'){ + item.componentProps.disabled = false + EquipmentMaintenanceDetailRules.uncompletedCause[0].required = false + } + if(item.field == 'name'){ + EquipmentMaintenanceDetailRules.name[0].required = true + } + }) + } } // form 提交 const submitForm = async (formType, data) => { @@ -710,6 +903,7 @@ const submitForm = async (formType, data) => { await props.apiUpdate(data) message.success(t('common.updateSuccess')) } + emit('handleMainFefresh') formRef.value.dialogVisible = false // 刷新当前列表 await getList() @@ -740,7 +934,8 @@ const emit = defineEmits([ 'openImage', 'onBlur', 'detailBasicFormOnChange', - 'formFormDateChange' + 'formFormDateChange', + 'buttonBaseClick' ]) /** 删除按钮操作 */ const handleDelete = async (id: number) => { @@ -752,6 +947,7 @@ const handleDelete = async (id: number) => { await props.apiDelete(id) tableObject.loading = false message.success(t('common.delSuccess')) + emit('handleMainFefresh') // 刷新列表 await getList() updateKey.value += 1 @@ -796,16 +992,16 @@ const openImage=(item)=>{ * @param field 当前操作字段 * @param cur 改变后值 */ - const detailBasicFormOnChange = (field, cur) => { +const detailBasicFormOnChange = (field, cur) => { emit('detailBasicFormOnChange', field, cur) } /** * 监听失焦事件 * @param field 当前操作字段 - * @param e + * @param e */ - const onBlur = (field, e) => { +const onBlur = (field, e) => { emit('onBlur', field, e) } diff --git a/src/views/eam/equipmentMaintenanceMain/equipmentMaintenanceMain.data.ts b/src/views/eam/equipmentMaintenanceMain/equipmentMaintenanceMain.data.ts index 08f0a4438..baa6e75c2 100644 --- a/src/views/eam/equipmentMaintenanceMain/equipmentMaintenanceMain.data.ts +++ b/src/views/eam/equipmentMaintenanceMain/equipmentMaintenanceMain.data.ts @@ -4,6 +4,9 @@ import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts import * as EquipmentItemApi from "@/api/eam/equipmentAccounts"; import {Workshop} from "@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data"; import * as WorkshopApi from "@/api/wms/workshop"; +import {MaintenanceItem} from "@/views/eam/maintenanceItem/maintenanceItem.data"; +import * as ItemApi from "@/api/eam/maintenanceItem"; +import {validateroundNumber} from "@/utils/validator"; // 表单校验 export const EquipmentMaintenanceMainRules = reactive({ @@ -240,12 +243,6 @@ export const EquipmentMaintenanceMain = useCrudSchemas(reactive([ } }, }, - { - label: '工段编号', - field: 'workshopSectionCode', - sort: 'custom', - isSearch: true, - }, { label: '创建时间', field: 'createTime', @@ -355,7 +352,56 @@ export const EquipmentMaintenanceMain = useCrudSchemas(reactive([ export const EquipmentMaintenanceDetailRules = reactive({ number: [required], - contents: [required], + masterId: [required], + peoples: [ + { + required:false , + message:'该项为必填项', + tagger:['blur'] + }, + { + validator:validateroundNumber, + message: '请输入正确的正整数', + trigger: 'blur'}], + estimatedMinutes: [ + { + required:false , + message:'该项为必填项', + tagger:['blur'] + }, + { + validator:validateroundNumber, + message: '请输入正确的正整数', + trigger: 'blur'}], + actualMinutes: [ + { + required:false , + message:'该项为必填项', + tagger:['blur'] + }, + { + validator:validateroundNumber, + message: '请输入正确的正整数', + trigger: 'blur'}], + completionTime: [required], + // [ + // { + // required:false , + // message:'该项为必填项', + // tagger:['blur'] + // }], + result: [ + { + required:false , + message:'该项为必填项', + tagger:['blur'] + }], + name: [required], + uncompletedCause:[{ + required:false , + message:'该项为必填项', + tagger:['blur','change'] + }] }) export const EquipmentMaintenanceDetail = useCrudSchemas(reactive([ @@ -373,38 +419,41 @@ export const EquipmentMaintenanceDetail = useCrudSchemas(reactive( field: 'number', sort: 'custom', isSearch: true, + form:{ + componentProps: { + disabled: true + } + } }, { label: '主表id', field: 'masterId', sort: 'custom', isSearch: true, + form:{ + componentProps: { + disabled: true + } + } }, { label: '人数', field: 'peoples', sort: 'custom', isSearch: true, + isForm: true, }, { label: '预计分钟', field: 'estimatedMinutes', sort: 'custom', isSearch: true, - form: { - component: 'InputNumber', - value: 0 - }, }, { label: '实际分钟', field: 'actualMinutes', sort: 'custom', isSearch: true, - form: { - component: 'InputNumber', - value: 0 - }, }, { label: '责任人多选', @@ -445,25 +494,43 @@ export const EquipmentMaintenanceDetail = useCrudSchemas(reactive( field: 'result', sort: 'custom', isSearch: true, + dictType: DICT_TYPE.IS_COMPLETED, + dictClass: 'string', }, { - label: '保养名称', + label: '保养项名称', field: 'name', sort: 'custom', isSearch: true, + isForm: true, + form: { + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择 类别编码', + searchTitle: '保养项信息', // 查询弹窗标题 + searchAllSchemas: MaintenanceItem.allSchemas, // 查询弹窗所需类 + searchField: 'name', // 查询弹窗赋值字段 + searchPage: ItemApi.getMaintenanceItemPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + action: '==' + }] + } + } }, - { - label: '保养内容', - field: 'content', - sort: 'custom', - isSearch: true, - }, - { - label: '保养部位', - field: 'equipmentParts', - sort: 'custom', - isSearch: true, - }, + // { + // label: '保养内容', + // field: 'content', + // sort: 'custom', + // isSearch: true, + // }, + // { + // label: '保养部位', + // field: 'equipmentParts', + // sort: 'custom', + // isSearch: true, + // }, { label: '创建时间', field: 'createTime', @@ -508,7 +575,10 @@ export const EquipmentMaintenanceDetail = useCrudSchemas(reactive( label: '是否可用', field: 'available', sort: 'custom', - isSearch: true, + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 }, diff --git a/src/views/eam/equipmentMaintenanceMain/index.vue b/src/views/eam/equipmentMaintenanceMain/index.vue index 7317de2b2..f0606d3fb 100644 --- a/src/views/eam/equipmentMaintenanceMain/index.vue +++ b/src/views/eam/equipmentMaintenanceMain/index.vue @@ -55,10 +55,19 @@ @@ -67,30 +76,28 @@ -@/api/wms/itempackage \ No newline at end of file +@/api/wms/itempackage diff --git a/src/views/wms/basicDataManage/itemManage/itempackage/itempackage.data.ts b/src/views/wms/basicDataManage/itemManage/itempackage/itempackage.data.ts index f1ca43fe7..fc23cf2ec 100644 --- a/src/views/wms/basicDataManage/itemManage/itempackage/itempackage.data.ts +++ b/src/views/wms/basicDataManage/itemManage/itempackage/itempackage.data.ts @@ -47,6 +47,11 @@ export const Itempackaging = useCrudSchemas(reactive([ isTable: true, table: { width: 120 + },form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + disabled: true + } } }, { @@ -236,4 +241,4 @@ export const ItempackagingRules = reactive({ packUnit: [{ required: true, message: '包装单位不能为空', trigger: 'change' }], packQty: [{ required: true, message: '包装数量不能为空', trigger: 'change' }], available: [{ required: true, message: '是否可用不能为空', trigger: 'change' }] -}) \ No newline at end of file +}) diff --git a/src/views/wms/basicDataManage/itemManage/packageunit/packageunit.data.ts b/src/views/wms/basicDataManage/itemManage/packageunit/packageunit.data.ts index d8aa930bf..9dba024a8 100644 --- a/src/views/wms/basicDataManage/itemManage/packageunit/packageunit.data.ts +++ b/src/views/wms/basicDataManage/itemManage/packageunit/packageunit.data.ts @@ -14,14 +14,14 @@ export const Packageunit = useCrudSchemas(reactive([ width: 150 }, }, - { - label: '父包装代码', - field: 'parentCode', - sort: 'custom', - table: { - width: 150 - }, - }, + // { + // label: '父包装代码', + // field: 'parentCode', + // sort: 'custom', + // table: { + // width: 150 + // }, + // }, { label: '包装名称', field: 'name', @@ -566,4 +566,4 @@ export const PackageunitCopy = useCrudSchemas(reactive([ fixed: 'right' } } -])) \ No newline at end of file +])) diff --git a/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/customerreturnRequestMain.data.ts b/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/customerreturnRequestMain.data.ts index e58df3e48..cfa5c326c 100644 --- a/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/customerreturnRequestMain.data.ts +++ b/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/customerreturnRequestMain.data.ts @@ -78,6 +78,32 @@ export const CustomerreturnRequestMain = useCrudSchemas(reactive([ }, isSearch: true, }, + { + label: '客户代码', + field: 'customerCode', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + enterSearch: true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择客户代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '客户信息', // 查询弹窗标题 + searchAllSchemas: Customer.allSchemas, // 查询弹窗所需类 + searchPage: CustomerApi.getCustomerPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } + }, { label: '发货记录单号', field: 'deliverRecordNumber', @@ -107,35 +133,22 @@ export const CustomerreturnRequestMain = useCrudSchemas(reactive([ action: 'betweeen', // 查询拼接条件 isSearch: true, // 使用自定义拼接条件 isMainValue: false // 拼接条件必须要 false 同时不能与 isMainValue: true 同用 - }] - } - } - }, - { - label: '客户代码', - field: 'customerCode', - sort: 'custom', - table: { - width: 150 - }, - isSearch: true, - form: { - // labelMessage: '信息提示说明!!!', - componentProps: { - isSearchList: true, // 开启查询弹窗 - searchListPlaceholder: '请选择客户代码', // 输入框占位文本 - searchField: 'code', // 查询弹窗赋值字段 - searchTitle: '客户信息', // 查询弹窗标题 - searchAllSchemas: Customer.allSchemas, // 查询弹窗所需类 - searchPage: CustomerApi.getCustomerPage, // 查询弹窗所需分页方法 - searchCondition: [{ - key: 'available', - value: 'TRUE', - isMainValue: false - }] + }, + { + key: 'customerCode', // 查询列表中字段 + value: 'customerCode', // 指查询具体值 + action: '==', // 查询拼接条件 + isSearch: true, // 使用自定义拼接条件 + isFormModel:true, // filters中添加筛选的数据--取于formModel + required:true, // 前置添加必有 + message: '请选择客户代码!', // 前置添加没填的提示语 + isMainValue: false // 拼接条件必须要 false 同时不能与 isMainValue: true 同用 + } + ] } } }, + { label: '发货计划单号', field: 'deliverPlanNumber', diff --git a/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue b/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue index 9dde767ca..639e766d7 100644 --- a/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue +++ b/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue @@ -57,8 +57,11 @@ @tableSelectionDelete="tableSelectionDelete" @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" - :isShowButton = isShowButton + @onEnter="onEnter" + /> + + @@ -104,6 +108,7 @@ import { CustomerreturnRequestMain,CustomerreturnRequestMainRules,Customerreturn import * as CustomerreturnRequestMainApi from '@/api/wms/customerreturnRequestMain' import * as CustomerreturnRequestDetailApi from '@/api/wms/customerreturnRequestDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' +import { DeliverRecordMain,DeliverRecordDetail } from '../../deliver/deliverRecordMain/deliverRecordMain.data' import * as DeliverRecordDetailApi from '@/api/wms/deliverRecordDetail' import { SupplierdeliverRequestPackage @@ -123,13 +128,39 @@ const genLabelId = ref(); //主表ID routeName.value = route.name const tableColumns = ref([...CustomerreturnRequestMain.allSchemas.tableColumns,...CustomerreturnRequestDetail.allSchemas.tableMainColumns]) -const isShowButton = ref(true) // 字段设置 更新主列表字段 const updataTableColumns = (val) => { tableColumns.value = val } - +const onEnter = async (field,value)=>{ + console.log('onEnter',field,value) + const dateTime = new Date().getTime() + if(field=='customerCode'){ + //客户代码---》发货记录单号 + formRef.value.opensearchTable('deliverRecordNumber', 'number', '发货记录信息', DeliverRecordMain.allSchemas, DeliverRecordDetailApi.getDeliverRecordDetailPage,[{ + key: 'available', + value: 'TRUE', + isMainValue: false + }, + { + key: 'createTime', // 查询列表中字段 + value: dateTime - 30 * 24 * 60 * 60 * 1000 + "," + dateTime, // 指查询具体值 + action: 'betweeen', // 查询拼接条件 + isSearch: true, // 使用自定义拼接条件 + isMainValue: false // 拼接条件必须要 false 同时不能与 isMainValue: true 同用 + }, + { + key: 'customerCode', // 查询列表中字段 + value: 'customerCode', // 指查询具体值 + action: '==', // 查询拼接条件 + isSearch: true, // 使用自定义拼接条件 + isFormModel:true, + isMainValue: false // 拼接条件必须要 false 同时不能与 isMainValue: true 同用 + } + ],undefined,undefined,null,true,DeliverRecordDetail.allSchemas) + } +} // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { nextTick(() => { @@ -168,13 +199,11 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => if(formField == 'deliverRecordNumber') { setV['deliverRecordNumber'] = val[0]['number'] setV['deliverPlanNumber'] = val[0]['deliverPlanNumber'] - setV['customerCode'] = val[0]['customerCode'] + // setV['customerCode'] = val[0]['customerCode'] setV['customerDockCode'] = val[0]['customerDockCode'] - if(setV['deliverRecordNumber'] != null){ - isShowButton.value = false - } + // 获取子表数据 - DeliverRecordDetailApi.getDeliverRecordDetailPage({masterId:val[0]['id']}) + DeliverRecordDetailApi.getDeliverRecordDetailPage({masterId:val[0]['masterId']}) .then(res => { res.list.forEach(obj => { @@ -190,7 +219,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => } }) }) - if (res) tableData.value = res.list + if (res) { + tableData.value = [...res.list] + originTableData.value = [...res.list] + } }).catch(err => { console.log(err) message.error('错误') @@ -449,6 +481,7 @@ const labelPrint = async (row) => { /** 添加/修改操作 */ const formRef = ref() const openForm =async (type: string, row?: number) => { + originTableData.value = [] if(type == "update"){ CustomerreturnRequestMain.allSchemas.formSchema.forEach((item) => { if(item.field == 'deliverRecordNumber'){ @@ -558,10 +591,52 @@ CustomerreturnRequestDetail.allSchemas.tableFormColumns.forEach(item => { tableFormKeys[item.field] = item.default ? item.default : '' }) const tableData = ref([]) +const originTableData = ref([]) +const searchTableRef = ref() // 添加明细 +// const handleAddTable = () => { +// tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) +// } const handleAddTable = () => { - tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) + console.log('originTableData.value',originTableData.value) + console.log('tableData.value',tableData.value) + const subTableDFata = originTableData.value.filter(item=> !tableData.value.find(item1=>item1.id == item.id)) + if(subTableDFata.length==0){ + message.warning('暂无可选择数据!') + return + } + + const tableObject = { + // 当前页 + currentPage: 1, + // 导出加载中 + exportLoading: false, + // 加载中 + loading: false, + // 页数 + pageSize: subTableDFata.length, + params:null, + // 排序 + sort: { + order: '', // 排序规则 + prop: '' // 排序字段 + }, + // 总条数 + total: subTableDFata.length, + // 表格数据 + tableList: subTableDFata, + currentRow:null + } + const tableColumns = CustomerreturnRequestDetail.allSchemas.tableFormColumns + tableColumns.forEach((item) => { + item.width = item.table?.width || 150 + }) + searchTableRef.value.openData("收货明细",tableObject,{tableColumns},true) +} +const searchTableSuccess1 = (formField, searchField, val, formRef, type, row) => { + console.log(val) + tableData.value = [...tableData.value,...val] } // 删除明细 const handleDeleteTable = (item, index) => { diff --git a/src/views/wms/inventoryManage/balance/index.vue b/src/views/wms/inventoryManage/balance/index.vue index d7fd2b8da..bc9a950bc 100644 --- a/src/views/wms/inventoryManage/balance/index.vue +++ b/src/views/wms/inventoryManage/balance/index.vue @@ -193,17 +193,17 @@ const handleSelectionPoint = async ()=>{ } // 列表-操作按钮 const butttondata = [ - { - label: '标签信息', - name: 'bqxx', - hide: false, - type: 'primary', - icon: '', - color: '', - link: true, - float:'right', - hasPermi: '' - }, + // { + // label: '标签信息', + // name: 'bqxx', + // hide: false, + // type: 'primary', + // icon: '', + // color: '', + // link: true, + // float:'right', + // hasPermi: '' + // }, defaultButtons.mainListPointBtn(null), // 标签打印 // defaultButtons.mainListEditBtn({hasPermi:'wms:balance:update'}), // 编辑 // defaultButtons.mainListDeleteBtn({hasPermi:'wms:balance:delete'}), // 删除 diff --git a/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue b/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue index 326564896..6d1591bfa 100644 --- a/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue +++ b/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue @@ -285,9 +285,9 @@ const handleHandle = async (id: number) => { tableObject.loading = true await InventoryinitRequestMainApi.handleInventoryinitRequestMain(id) message.success(t('common.handleSuccess')) - tableObject.loading = false await getList() } catch {} + tableObject.loading = false } diff --git a/src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionRecordMain/index.vue b/src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionRecordMain/index.vue index e2b52a2f2..f3fa14b88 100644 --- a/src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionRecordMain/index.vue +++ b/src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionRecordMain/index.vue @@ -57,7 +57,7 @@ :allSchemas="UnplannedissueRecordMain.allSchemas" :detailAllSchemas="UnplannedissueRecordDetail.allSchemas" :detailAllSchemasRules="UnplannedissueRecordDetailRules" - :apiPage="UnplannedissueRecordDetailApi.getUnplannedissueRecordDetailPage" + :apiPage="UnplannedissueRecordDetailApi.getUnplannedissueRecordDetailPageSpare" /> diff --git a/src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionRequestMain/index.vue b/src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionRequestMain/index.vue index 31482c978..8cc95d37f 100644 --- a/src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionRequestMain/index.vue +++ b/src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionRequestMain/index.vue @@ -69,7 +69,7 @@ :detailAllSchemasRules="UnplannedissueRequestDetailRules" :apiCreate="UnplannedissueRequestDetailApi.createUnplannedissueRequestDetail" :apiUpdate="UnplannedissueRequestDetailApi.updateUnplannedissueRequestDetail" - :apiPage="UnplannedissueRequestDetailApi.getUnplannedissueRequestDetailPage" + :apiPage="UnplannedissueRequestDetailApi.getUnplannedissueRequestDetailPageSpare" :apiDelete="UnplannedissueRequestDetailApi.deleteUnplannedissueRequestDetail" :Echo="Echo" @searchTableSuccessDetail="searchTableSuccessDetail" diff --git a/src/views/wms/issueManage/issue/issueJobMain/issueJobMain.data.ts b/src/views/wms/issueManage/issue/issueJobMain/issueJobMain.data.ts index d38f1c7a2..51ccae003 100644 --- a/src/views/wms/issueManage/issue/issueJobMain/issueJobMain.data.ts +++ b/src/views/wms/issueManage/issue/issueJobMain/issueJobMain.data.ts @@ -748,6 +748,7 @@ export const IssueJobDetail = useCrudSchemas(reactive([ table: { width: 150 }, + hiddenInMain:true, sortTableDefault:2, }, { @@ -757,6 +758,7 @@ export const IssueJobDetail = useCrudSchemas(reactive([ table: { width: 150 }, + hiddenInMain:true, sortTableDefault:2, }, { diff --git a/src/views/wms/issueManage/issue/issueRecordMain/issueRecordMain.data.ts b/src/views/wms/issueManage/issue/issueRecordMain/issueRecordMain.data.ts index 96ae7d5bd..8918e8d2a 100644 --- a/src/views/wms/issueManage/issue/issueRecordMain/issueRecordMain.data.ts +++ b/src/views/wms/issueManage/issue/issueRecordMain/issueRecordMain.data.ts @@ -21,7 +21,7 @@ export const IssueRecordMain = useCrudSchemas(reactive([ field: 'status', dictType: DICT_TYPE.JOB_STATUS, dictClass: 'string', - isTable: true, + isTable: false, sort: 'custom', table: { width: 150 @@ -507,6 +507,7 @@ export const IssueRecordDetail = useCrudSchemas(reactive([ table: { width: 150 }, + hiddenInMain:true, sortTableDefault:2, }, { @@ -516,6 +517,7 @@ export const IssueRecordDetail = useCrudSchemas(reactive([ table: { width: 150 }, + hiddenInMain:true, sortTableDefault:3, }, { diff --git a/src/views/wms/issueManage/issue/issueRequestMain/issueRequestMain.data.ts b/src/views/wms/issueManage/issue/issueRequestMain/issueRequestMain.data.ts index 285d977f4..8dfbaf3ca 100644 --- a/src/views/wms/issueManage/issue/issueRequestMain/issueRequestMain.data.ts +++ b/src/views/wms/issueManage/issue/issueRequestMain/issueRequestMain.data.ts @@ -455,24 +455,6 @@ export const IssueRequestMain = useCrudSchemas(reactive([ fixed: 'right' }, }, - { - label: '包装规格', - field: 'packUnit', - sort: 'custom', - table: { - width: 150 - }, - sortTableDefault:7, - }, - { - label: '包装数量', - field: 'packQty', - sort: 'custom', - table: { - width: 150 - }, - sortTableDefault:8, - }, ])) export const IssueRequestMainRules = reactive({ @@ -745,6 +727,7 @@ export const IssueRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + hiddenInMain:true, sortTableDefault:1, }, { @@ -754,6 +737,7 @@ export const IssueRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + hiddenInMain:true, sortTableDefault:2, }, { diff --git a/src/views/wms/issueManage/productionreceipt/productionreceiptJobMain/productionreceiptJobMain.data.ts b/src/views/wms/issueManage/productionreceipt/productionreceiptJobMain/productionreceiptJobMain.data.ts index 590a3eeec..c2f3e38f5 100644 --- a/src/views/wms/issueManage/productionreceipt/productionreceiptJobMain/productionreceiptJobMain.data.ts +++ b/src/views/wms/issueManage/productionreceipt/productionreceiptJobMain/productionreceiptJobMain.data.ts @@ -683,6 +683,7 @@ export const ProductionreceiptJobDetail = useCrudSchemas(reactive( table: { width: 150 }, + hiddenInMain:true, sortTableDefault:2, }, { @@ -692,6 +693,7 @@ export const ProductionreceiptJobDetail = useCrudSchemas(reactive( table: { width: 150 }, + hiddenInMain:true, sortTableDefault:2, }, { diff --git a/src/views/wms/issueManage/productionreceipt/productionreceiptRecordMain/productionreceiptRecordMain.data.ts b/src/views/wms/issueManage/productionreceipt/productionreceiptRecordMain/productionreceiptRecordMain.data.ts index 5cdc61cf4..80498d31c 100644 --- a/src/views/wms/issueManage/productionreceipt/productionreceiptRecordMain/productionreceiptRecordMain.data.ts +++ b/src/views/wms/issueManage/productionreceipt/productionreceiptRecordMain/productionreceiptRecordMain.data.ts @@ -21,7 +21,7 @@ export const ProductionreceiptRecordMain = useCrudSchemas(reactive field: 'status', dictType: DICT_TYPE.JOB_STATUS, dictClass: 'string', - isTable: true, + isTable: false, sort: 'custom', table: { width: 150 @@ -491,6 +491,7 @@ export const ProductionreceiptRecordDetail = useCrudSchemas(reactive([ table: { width: 150 }, - isSearch: true, sortTableDefault:5, }, { @@ -724,6 +723,7 @@ export const RepleinshJobDetail = useCrudSchemas(reactive([ table: { width: 150 }, + hiddenInMain:true, sortTableDefault:2, }, { @@ -733,6 +733,7 @@ export const RepleinshJobDetail = useCrudSchemas(reactive([ table: { width: 150 }, + hiddenInMain:true, sortTableDefault:2, }, { diff --git a/src/views/wms/issueManage/repleinsh/repleinshRecordMain/repleinshRecordMain.data.ts b/src/views/wms/issueManage/repleinsh/repleinshRecordMain/repleinshRecordMain.data.ts index 95b6c3299..fb29cee65 100644 --- a/src/views/wms/issueManage/repleinsh/repleinshRecordMain/repleinshRecordMain.data.ts +++ b/src/views/wms/issueManage/repleinsh/repleinshRecordMain/repleinshRecordMain.data.ts @@ -21,7 +21,7 @@ export const RepleinshRecordMain = useCrudSchemas(reactive([ field: 'status', dictType: DICT_TYPE.JOB_STATUS, dictClass: 'string', - isTable: true, + isTable: false, sort: 'custom', table: { width: 150 @@ -478,6 +478,7 @@ export const RepleinshRecordDetail = useCrudSchemas(reactive([ table: { width: 150 }, + hiddenInMain:true, sortTableDefault:2, }, { @@ -487,6 +488,7 @@ export const RepleinshRecordDetail = useCrudSchemas(reactive([ table: { width: 150 }, + hiddenInMain:true, sortTableDefault:3, }, { diff --git a/src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts b/src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts index 351536e30..0fa431456 100644 --- a/src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts +++ b/src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts @@ -17,7 +17,8 @@ const { t } = useI18n() // 国际化 const queryParams = { pageSize:10, pageNo:1, - code:'RepleinmentRequest' + code:'RepleinmentRequest', + businessTypeCode: 'Repleinment' } const data = await getRequestsettingApi.getRequestsettingPage(queryParams) const requestsettingData =data?.list[0]||{} @@ -31,7 +32,7 @@ import {getLocationPageRepleinsh} from "@/api/wms/location"; // id 转str 否则form回显匹配不到 userDept.id = userDept.id.toString() const userDeptArray:any = [userDept] - + /** * @returns {Array} 补料申请主表 */ @@ -518,7 +519,6 @@ export const RepleinshRequestDetail = useCrudSchemas(reactive([ }, isTableForm: false, isForm: false, - isSearch: true, sortTableDefault:6, sortSearchDefault:4, }, @@ -530,7 +530,6 @@ export const RepleinshRequestDetail = useCrudSchemas(reactive([ width: 150 }, isTableForm: false, - isSearch: true, sortTableDefault:5, sortSearchDefault:3, }, @@ -544,7 +543,12 @@ export const RepleinshRequestDetail = useCrudSchemas(reactive([ form: { value: 'OK', componentProps: { - disabled: true + disabled: true, + searchCondition:[{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] } }, table: { @@ -564,7 +568,6 @@ export const RepleinshRequestDetail = useCrudSchemas(reactive([ width: 150 }, isTableForm: false, - isSearch: true, }, { label: '单据号', @@ -618,6 +621,9 @@ export const RepleinshRequestDetail = useCrudSchemas(reactive([ key: 'available', value: 'TRUE', isMainValue: false + },{ + key : 'businessTypeCode', + value: queryParams.businessTypeCode }] }, }, @@ -758,6 +764,7 @@ export const RepleinshRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + hiddenInMain:true, isTableForm: false, sortTableDefault:1, }, @@ -768,6 +775,7 @@ export const RepleinshRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + hiddenInMain:true, isTableForm: false, sortTableDefault:2, }, diff --git a/src/views/wms/moveManage/inventorychange/inventorychangeRequestMain/index.vue b/src/views/wms/moveManage/inventorychange/inventorychangeRequestMain/index.vue index 3d4aae62f..f18878d4b 100644 --- a/src/views/wms/moveManage/inventorychange/inventorychangeRequestMain/index.vue +++ b/src/views/wms/moveManage/inventorychange/inventorychangeRequestMain/index.vue @@ -1,23 +1,31 @@