diff --git a/src/views/wms/basicDataManage/strategySetting/spareitemLocation/index.vue b/src/views/wms/basicDataManage/strategySetting/spareitemLocation/index.vue index f5fb9f787..e7ac96dcd 100644 --- a/src/views/wms/basicDataManage/strategySetting/spareitemLocation/index.vue +++ b/src/views/wms/basicDataManage/strategySetting/spareitemLocation/index.vue @@ -47,6 +47,7 @@ :apiUpdate="SpareitemLocationApi.updateSpareitemLocation" :apiCreate="SpareitemLocationApi.createSpareitemLocation" @searchTableSuccess="searchTableSuccess" + @clearSearchInput="clearSearchInput" :isBusiness="false" /> @@ -75,12 +76,36 @@ const route = useRoute() // 路由信息 const routeName = ref() routeName.value = route.name const tableColumns = ref(SpareitemLocation.allSchemas.tableColumns) - +const clearSearchInput = (field)=>{ + console.log('field',field) + if('itemCode' == field){ + //物料代码 + basicFormRef.value.formRef.setValues({ + name: '', + desc1: '', + desc2: '' + }) + }else if('locationCode' == field){ + // 库位代码 + basicFormRef.value.formRef.setValues({ + locationName: '', + }) + } +} // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef) => { nextTick(() => { const setV = {} setV[formField] = val[0][searchField] + if(formField=='itemCode'){ + //物料代码 + setV['name'] = val[0]['code'] + setV['desc1'] = val[0]['desc1'] + setV['desc2'] = val[0]['desc2'] + }else if(formField=='locationCode'){ + // 库位代码 + setV['locationName'] = val[0]['name'] + } formRef.setValues(setV) }) } diff --git a/src/views/wms/basicDataManage/strategySetting/spareitemLocation/spareitemLocation.data.ts b/src/views/wms/basicDataManage/strategySetting/spareitemLocation/spareitemLocation.data.ts index 7f9355c21..2959825a8 100644 --- a/src/views/wms/basicDataManage/strategySetting/spareitemLocation/spareitemLocation.data.ts +++ b/src/views/wms/basicDataManage/strategySetting/spareitemLocation/spareitemLocation.data.ts @@ -1,5 +1,11 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' +import { Itembasic } from "@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data"; +import * as ItembasicApi from "@/api/wms/itembasic"; +import * as ItemAccountsApi from '@/api/eam/itemAccounts' +import { ItemAccounts } from '@/views/eam/itemAccounts/itemAccounts.data' +import * as LocationApi from '@/api/wms/location' +import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data' // 表单校验 export const SpareitemLocationRules = reactive({ @@ -13,42 +19,147 @@ export const SpareitemLocation = useCrudSchemas(reactive([ field: 'itemCode', sort: 'custom', isSearch: true, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + enterSearch: true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择物料代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '物料信息', // 查询弹窗标题 + searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类 + searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法 + searchCondition: [ + // { + // key:'supplierCode', + // value:'supplierCode', + // isMainValue: true + // }, + ], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: 'true', + isFormModel: true + }], // 失去焦点校验参数 + } + }, + table: { + width: 180 + } }, { label: '名称', field: 'name', sort: 'custom', + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 180 + } }, { label: '描述1', field: 'desc1', sort: 'custom', + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 180 + } }, { label: '描述2', field: 'desc2', sort: 'custom', + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 180 + } }, { label: '库位代码', field: 'locationCode', sort: 'custom', isSearch: true, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + enterSearch: true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择库位代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '库位信息', // 查询弹窗标题 + searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 + searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true + }], // 失去焦点校验参数 + } + }, + table: { + width: 180 + } }, { label: '库位名称', field: 'locationName', sort: 'custom', + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 180 + } }, { label: '是否可用', field: 'available', sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + table: { + width: 110 + } }, { label: '备注', field: 'remark', sort: 'custom', + table: { + width: 220 + } }, { label: '创建时间', @@ -65,6 +176,9 @@ export const SpareitemLocation = useCrudSchemas(reactive([ } }, isForm: false, + table: { + width: 220 + } }, { label: '操作',