Browse Source

调拨出库 原因可选可填

master_hella_20240701
陈薪名 9 months ago
parent
commit
9aed93949c
  1. 11
      src/components/BasicForm/src/BasicForm.vue
  2. 11
      src/components/Form/src/Form.vue
  3. 1
      src/utils/dict.ts
  4. 7
      src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/index.vue
  5. 15
      src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/transferissueRequestMain.data.ts

11
src/components/BasicForm/src/BasicForm.vue

@ -15,6 +15,7 @@
:is-col="true" :is-col="true"
@opensearchTable="opensearchTable" @opensearchTable="opensearchTable"
@onChange="onChange" @onChange="onChange"
@onBlur="onBlur"
> >
<template #crontab="formSchema" v-if="fromeWhere == 'countPlan'"> <template #crontab="formSchema" v-if="fromeWhere == 'countPlan'">
<crontab v-model="formSchema.crontab" /> <crontab v-model="formSchema.crontab" />
@ -480,6 +481,7 @@ const emit = defineEmits([
'buttonOperationClick', 'buttonOperationClick',
'inputStringBlur', 'inputStringBlur',
'onChange', 'onChange',
'onBlur',
'inputNumberChange' 'inputNumberChange'
]) ])
// //
@ -543,6 +545,15 @@ const inpuFocus = (headerItem, row, index) => {
emit('onChange', field, cur) emit('onChange', field, cur)
} }
/**
* 监听失焦事件
* @param field 当前操作字段
* @param e
*/
const onBlur = (field, e) => {
emit('onBlur', field, e)
}
// //
const selectChange = (field, val) => { const selectChange = (field, val) => {
emit('selectChange', field, val) emit('selectChange', field, val)

11
src/components/Form/src/Form.vue

@ -54,7 +54,7 @@ export default defineComponent({
vLoading: propTypes.bool.def(false), vLoading: propTypes.bool.def(false),
labelPosition: propTypes.string.def('left'), labelPosition: propTypes.string.def('left'),
}, },
emits: ['register','opensearchTable', 'onChange'], emits: ['register','opensearchTable', 'onChange', 'onBlur'],
setup(props, { slots, expose, emit }) { setup(props, { slots, expose, emit }) {
// element form // element form
const elFormRef = ref<ComponentRef<typeof ElForm>>() const elFormRef = ref<ComponentRef<typeof ElForm>>()
@ -188,6 +188,14 @@ export default defineComponent({
const onChange = (field, cur) => { const onChange = (field, cur) => {
emit('onChange', field, cur) emit('onChange', field, cur)
} }
/**
* 监听失去焦点
* @param field 当前操作字段
* @param e 改变后值
*/
const onBlur = (field, e) => {
emit('onBlur', field, e)
}
// formItem // formItem
const renderFormItem = (item: FormSchema) => { const renderFormItem = (item: FormSchema) => {
// options // options
@ -291,6 +299,7 @@ export default defineComponent({
{...setComponentProps(item)} {...setComponentProps(item)}
style={item.componentProps?.style} style={item.componentProps?.style}
onChange={(e)=>{onChange(item.field, e)}} onChange={(e)=>{onChange(item.field, e)}}
onBlur={(e)=>{onBlur(item.field, e)}}
{...(notRenderOptions.includes(item?.component as string) && {...(notRenderOptions.includes(item?.component as string) &&
item?.componentProps?.options item?.componentProps?.options
? { options: item?.componentProps?.options || [] } ? { options: item?.componentProps?.options || [] }

1
src/utils/dict.ts

@ -274,4 +274,5 @@ export enum DICT_TYPE {
CONTAINER_STATUS = 'container_status', // 容器状态 CONTAINER_STATUS = 'container_status', // 容器状态
PREDICT_TIME_TYPE = 'predict_time_type', // 预测时间类型 PREDICT_TIME_TYPE = 'predict_time_type', // 预测时间类型
PACK_UNIT_TYPE = 'pack_unit_type', // 包装规格类型 PACK_UNIT_TYPE = 'pack_unit_type', // 包装规格类型
TRANSFER_REASON = 'transfer_reason', // 调拨出入库原因
} }

7
src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/index.vue

@ -54,6 +54,7 @@
@handleDeleteTable="handleDeleteTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" @submitForm="submitForm"
@on-blur="onBlur"
/> />
<!-- 详情 --> <!-- 详情 -->
@ -317,6 +318,12 @@ const handleHandle = async (id: number) => {
} catch {} } catch {}
} }
const onBlur = (field, e) => {
// console.log('', field)
// console.log('', e.target.value)
formRef.value.formRef.formModel[field] = e.target.value
}
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm =async (type: string, row?: number) => { const openForm =async (type: string, row?: number) => {

15
src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/transferissueRequestMain.data.ts

@ -113,6 +113,21 @@ export const TransferissueRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 150 width: 150
}, },
}, },
{
label: '原因',
field: 'reason',
sort: 'custom',
dictType: DICT_TYPE.TRANSFER_REASON,
dictClass: 'string',
table: {
width: 150
},
form: {
componentProps: {
filterable: true,
}
}
},
{ {
label: '申请时间', label: '申请时间',
field: 'requestTime', field: 'requestTime',

Loading…
Cancel
Save