Browse Source

调拨出库 原因可选可填

master_hella_20240701
陈薪名 9 months ago
parent
commit
9aed93949c
  1. 13
      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

13
src/components/BasicForm/src/BasicForm.vue

@ -15,6 +15,7 @@
:is-col="true"
@opensearchTable="opensearchTable"
@onChange="onChange"
@onBlur="onBlur"
>
<template #crontab="formSchema" v-if="fromeWhere == 'countPlan'">
<crontab v-model="formSchema.crontab" />
@ -480,6 +481,7 @@ const emit = defineEmits([
'buttonOperationClick',
'inputStringBlur',
'onChange',
'onBlur',
'inputNumberChange'
])
//
@ -539,10 +541,19 @@ const inpuFocus = (headerItem, row, index) => {
* @param field 当前操作字段
* @param cur 改变后值
*/
const onChange = (field, cur) => {
const onChange = (field, cur) => {
emit('onChange', field, cur)
}
/**
* 监听失焦事件
* @param field 当前操作字段
* @param e
*/
const onBlur = (field, e) => {
emit('onBlur', field, e)
}
//
const 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),
labelPosition: propTypes.string.def('left'),
},
emits: ['register','opensearchTable', 'onChange'],
emits: ['register','opensearchTable', 'onChange', 'onBlur'],
setup(props, { slots, expose, emit }) {
// element form
const elFormRef = ref<ComponentRef<typeof ElForm>>()
@ -188,6 +188,14 @@ export default defineComponent({
const onChange = (field, cur) => {
emit('onChange', field, cur)
}
/**
* 监听失去焦点
* @param field 当前操作字段
* @param e 改变后值
*/
const onBlur = (field, e) => {
emit('onBlur', field, e)
}
// formItem
const renderFormItem = (item: FormSchema) => {
// options
@ -291,6 +299,7 @@ export default defineComponent({
{...setComponentProps(item)}
style={item.componentProps?.style}
onChange={(e)=>{onChange(item.field, e)}}
onBlur={(e)=>{onBlur(item.field, e)}}
{...(notRenderOptions.includes(item?.component as string) &&
item?.componentProps?.options
? { options: item?.componentProps?.options || [] }

1
src/utils/dict.ts

@ -274,4 +274,5 @@ export enum DICT_TYPE {
CONTAINER_STATUS = 'container_status', // 容器状态
PREDICT_TIME_TYPE = 'predict_time_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"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
@on-blur="onBlur"
/>
<!-- 详情 -->
@ -317,6 +318,12 @@ const handleHandle = async (id: number) => {
} 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 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
},
},
{
label: '原因',
field: 'reason',
sort: 'custom',
dictType: DICT_TYPE.TRANSFER_REASON,
dictClass: 'string',
table: {
width: 150
},
form: {
componentProps: {
filterable: true,
}
}
},
{
label: '申请时间',
field: 'requestTime',

Loading…
Cancel
Save