Browse Source

维修备件默认库位

hella_online_20241212_pandian
王宇飞 3 months ago
parent
commit
4494d1bc2d
  1. 27
      src/views/wms/basicDataManage/strategySetting/spareitemLocation/index.vue
  2. 114
      src/views/wms/basicDataManage/strategySetting/spareitemLocation/spareitemLocation.data.ts

27
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)
})
}

114
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<CrudSchema[]>([
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<CrudSchema[]>([
}
},
isForm: false,
table: {
width: 220
}
},
{
label: '操作',

Loading…
Cancel
Save