|
@ -7,9 +7,7 @@ |
|
|
:vLoading="formLoading" |
|
|
:vLoading="formLoading" |
|
|
@updateFullscreen="updateFullscreen" |
|
|
@updateFullscreen="updateFullscreen" |
|
|
> |
|
|
> |
|
|
|
|
|
<div style="overflow-y: auto" :style="{ 'max-height': formHeight }"> |
|
|
<div |
|
|
|
|
|
style="overflow-y: auto;" :style="{'max-height':formHeight}"> |
|
|
|
|
|
<Form |
|
|
<Form |
|
|
ref="formRef" |
|
|
ref="formRef" |
|
|
:rules="rules" |
|
|
:rules="rules" |
|
@ -24,8 +22,12 @@ |
|
|
@onEnter="onEnter" |
|
|
@onEnter="onEnter" |
|
|
> |
|
|
> |
|
|
<template #crontab="formSchema1" v-if="fromeWhere == 'countPlan'"> |
|
|
<template #crontab="formSchema1" v-if="fromeWhere == 'countPlan'"> |
|
|
|
|
|
<crontab |
|
|
<crontab v-model="formSchema1.crontab" :disabled="formSchema?.find(item=>item.field == 'crontab')?.componentProps?.disabled "/> |
|
|
v-model="formSchema1.crontab" |
|
|
|
|
|
:disabled=" |
|
|
|
|
|
formSchema?.find((item) => item.field == 'crontab')?.componentProps?.disabled |
|
|
|
|
|
" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
<template #type="formSchema" v-if="fromeWhere == 'countPlan'"> |
|
|
<template #type="formSchema" v-if="fromeWhere == 'countPlan'"> |
|
|
<el-select |
|
|
<el-select |
|
@ -99,10 +101,10 @@ |
|
|
@inputNumberChange="inputNumberChange" |
|
|
@inputNumberChange="inputNumberChange" |
|
|
@tableFormSelectOnBlur="tableFormSelectOnBlur" |
|
|
@tableFormSelectOnBlur="tableFormSelectOnBlur" |
|
|
@formFormDateChange="formFormDateChange" |
|
|
@formFormDateChange="formFormDateChange" |
|
|
@clearInput='clearInput' |
|
|
@clearInput="clearInput" |
|
|
@batchAdd="batchAdd" |
|
|
@batchAdd="batchAdd" |
|
|
:routeName="routeName" |
|
|
:routeName="routeName" |
|
|
@visibleChange='visibleChange' |
|
|
@visibleChange="visibleChange" |
|
|
> |
|
|
> |
|
|
<template v-slot="{ row }"> |
|
|
<template v-slot="{ row }"> |
|
|
<slot :row="row"></slot> |
|
|
<slot :row="row"></slot> |
|
@ -126,9 +128,12 @@ |
|
|
<slot name="foorter"></slot> |
|
|
<slot name="foorter"></slot> |
|
|
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick" /> |
|
|
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick" /> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
</Dialog> |
|
|
</Dialog> |
|
|
<SearchTable ref="searchTableRef" :showSearchTableQueryFields="showSearchTableQueryFields" @searchTableSuccess="searchTableSuccess" > |
|
|
<SearchTable |
|
|
|
|
|
ref="searchTableRef" |
|
|
|
|
|
:showSearchTableQueryFields="showSearchTableQueryFields" |
|
|
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
|
|
> |
|
|
<template v-for="name in Object.keys($slots)" :key="name" #[name]> |
|
|
<template v-for="name in Object.keys($slots)" :key="name" #[name]> |
|
|
<slot :name="name"></slot> |
|
|
<slot :name="name"></slot> |
|
|
</template> |
|
|
</template> |
|
@ -143,6 +148,7 @@ import TableFormCountPlan from '@/components/TableFormCountPlan/src/TableFormCou |
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|
|
import { tableFormBlurVer, FormBlur, getListByBottonInput } from '@/api/wms/business/business' |
|
|
import { tableFormBlurVer, FormBlur, getListByBottonInput } from '@/api/wms/business/business' |
|
|
import { isString } from 'min-dash' |
|
|
import { isString } from 'min-dash' |
|
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
const props = defineProps({ |
|
|
// 显示窗口宽度设置 |
|
|
// 显示窗口宽度设置 |
|
|
basicFormWidth: { |
|
|
basicFormWidth: { |
|
@ -157,7 +163,7 @@ const props = defineProps({ |
|
|
// 是否显示删除按钮--多选 |
|
|
// 是否显示删除按钮--多选 |
|
|
isShowReduceButtonSelection: { |
|
|
isShowReduceButtonSelection: { |
|
|
type: Boolean, |
|
|
type: Boolean, |
|
|
default: false, |
|
|
default: false |
|
|
}, |
|
|
}, |
|
|
// 是否显示tableForm 删除按钮 |
|
|
// 是否显示tableForm 删除按钮 |
|
|
isShowReduceButton: { |
|
|
isShowReduceButton: { |
|
@ -326,16 +332,12 @@ const props = defineProps({ |
|
|
required: false, |
|
|
required: false, |
|
|
default: [] |
|
|
default: [] |
|
|
}, |
|
|
}, |
|
|
byCodespageApi: { |
|
|
// 失去焦点之后是否进行校验, |
|
|
type: Function, |
|
|
isJiaoyan: { |
|
|
required: true, |
|
|
type: Boolean, |
|
|
default: null |
|
|
required: false, |
|
|
}, //输入框校验是否正确的方法 |
|
|
default: false |
|
|
byCodesParams: { |
|
|
} |
|
|
type: Object, |
|
|
|
|
|
required: true, |
|
|
|
|
|
default: null |
|
|
|
|
|
} //输入框校验是否正确的参数 |
|
|
|
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
const { t } = useI18n() // 国际化 |
|
|
const { t } = useI18n() // 国际化 |
|
@ -417,17 +419,24 @@ const opensearchTable = ( |
|
|
: '' |
|
|
: '' |
|
|
// 是否含有空参数情况 |
|
|
// 是否含有空参数情况 |
|
|
let isNull = false |
|
|
let isNull = false |
|
|
if (_searchCondition[searchCondition[i].key] == '' || _searchCondition[searchCondition[i].key] == undefined) { |
|
|
if ( |
|
|
|
|
|
_searchCondition[searchCondition[i].key] == '' || |
|
|
|
|
|
_searchCondition[searchCondition[i].key] == undefined |
|
|
|
|
|
) { |
|
|
isNull = true |
|
|
isNull = true |
|
|
} |
|
|
} |
|
|
if (isNull) { |
|
|
if (isNull) { |
|
|
message.warning(searchCondition[i].message?searchCondition[i].message:'前置条件未选择!') |
|
|
message.warning( |
|
|
|
|
|
searchCondition[i].message ? searchCondition[i].message : '前置条件未选择!' |
|
|
|
|
|
) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} else if (searchCondition[i].isTableRowValue) { |
|
|
} else if (searchCondition[i].isTableRowValue) { |
|
|
if (searchCondition[i].required) { |
|
|
if (searchCondition[i].required) { |
|
|
if (row[searchCondition[i].value] == '' || row[searchCondition[i].value] == undefined) { |
|
|
if (row[searchCondition[i].value] == '' || row[searchCondition[i].value] == undefined) { |
|
|
message.warning(searchCondition[i].message?searchCondition[i].message:'前置条件未选择!') |
|
|
message.warning( |
|
|
|
|
|
searchCondition[i].message ? searchCondition[i].message : '前置条件未选择!' |
|
|
|
|
|
) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -440,8 +449,13 @@ const opensearchTable = ( |
|
|
if (searchCondition[i].isFormModel) { |
|
|
if (searchCondition[i].isFormModel) { |
|
|
//用formModel中的值 |
|
|
//用formModel中的值 |
|
|
if (searchCondition[i].required) { |
|
|
if (searchCondition[i].required) { |
|
|
if (formRef.value.formModel[searchCondition[i].value] == '' ||formRef.value.formModel[searchCondition[i].value] == undefined) { |
|
|
if ( |
|
|
message.warning(searchCondition[i].message?searchCondition[i].message:'前置条件未选择!') |
|
|
formRef.value.formModel[searchCondition[i].value] == '' || |
|
|
|
|
|
formRef.value.formModel[searchCondition[i].value] == undefined |
|
|
|
|
|
) { |
|
|
|
|
|
message.warning( |
|
|
|
|
|
searchCondition[i].message ? searchCondition[i].message : '前置条件未选择!' |
|
|
|
|
|
) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -457,7 +471,6 @@ const opensearchTable = ( |
|
|
value: searchCondition[i].value |
|
|
value: searchCondition[i].value |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
_searchCondition[searchCondition[i].key] = searchCondition[i].value |
|
|
_searchCondition[searchCondition[i].key] = searchCondition[i].value |
|
|
} |
|
|
} |
|
@ -500,38 +513,64 @@ const clearSearchInput = (field)=>{ |
|
|
const sumFormDataByTable = () => { |
|
|
const sumFormDataByTable = () => { |
|
|
if (props.sumFormDataField) { |
|
|
if (props.sumFormDataField) { |
|
|
const sumObject = {} |
|
|
const sumObject = {} |
|
|
props.sumFormDataField.forEach(sumItem=>{ |
|
|
props.sumFormDataField.forEach((sumItem) => { |
|
|
sumObject[sumItem?.formField]= props.tableData.reduce((prev, item) => prev + item[sumItem?.tableField],0) |
|
|
sumObject[sumItem?.formField] = props.tableData.reduce( |
|
|
|
|
|
(prev, item) => prev + item[sumItem?.tableField], |
|
|
|
|
|
0 |
|
|
|
|
|
) |
|
|
}) |
|
|
}) |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
formRef.value.setValues(sumObject) |
|
|
formRef.value.setValues(sumObject) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
watch(()=>props.tableData,() => { |
|
|
watch( |
|
|
|
|
|
() => props.tableData, |
|
|
|
|
|
() => { |
|
|
sumFormDataByTable() |
|
|
sumFormDataByTable() |
|
|
if (props?.sumFormDataByTableCustom && unref(formRef)?.formModel && props.tableData) { |
|
|
if (props?.sumFormDataByTableCustom && unref(formRef)?.formModel && props.tableData) { |
|
|
props?.sumFormDataByTableCustom(formRef, unref(formRef)?.formModel, props.tableData) |
|
|
props?.sumFormDataByTableCustom(formRef, unref(formRef)?.formModel, props.tableData) |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
},{ |
|
|
{ |
|
|
deep: true |
|
|
deep: true |
|
|
}) |
|
|
} |
|
|
|
|
|
) |
|
|
let originFormModel = {} |
|
|
let originFormModel = {} |
|
|
const updateOriginFormModel = (data) => { |
|
|
const updateOriginFormModel = (data) => { |
|
|
originFormModel = JSON.parse(JSON.stringify(data)) |
|
|
originFormModel = JSON.parse(JSON.stringify(data)) |
|
|
} |
|
|
} |
|
|
const sumFormDataHandle1 = () => { |
|
|
const sumFormDataHandle1 = () => { |
|
|
emit('sumFormDataHandle',formRef,unref(formRef)?.formModel,props.tableData,formType.value,originFormModel,updateOriginFormModel) |
|
|
emit( |
|
|
|
|
|
'sumFormDataHandle', |
|
|
|
|
|
formRef, |
|
|
|
|
|
unref(formRef)?.formModel, |
|
|
|
|
|
props.tableData, |
|
|
|
|
|
formType.value, |
|
|
|
|
|
originFormModel, |
|
|
|
|
|
updateOriginFormModel |
|
|
|
|
|
) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
watch(()=>unref(formRef)?.formModel,async () => { |
|
|
watch( |
|
|
|
|
|
() => unref(formRef)?.formModel, |
|
|
|
|
|
async () => { |
|
|
if (props?.sumFormDataByForm && unref(formRef)?.formModel) { |
|
|
if (props?.sumFormDataByForm && unref(formRef)?.formModel) { |
|
|
props?.sumFormDataByForm(formRef,unref(formRef)?.formModel,props.tableData,formType.value,originFormModel,updateOriginFormModel,sumFormDataHandle1) |
|
|
props?.sumFormDataByForm( |
|
|
|
|
|
formRef, |
|
|
|
|
|
unref(formRef)?.formModel, |
|
|
|
|
|
props.tableData, |
|
|
|
|
|
formType.value, |
|
|
|
|
|
originFormModel, |
|
|
|
|
|
updateOriginFormModel, |
|
|
|
|
|
sumFormDataHandle1 |
|
|
|
|
|
) |
|
|
} |
|
|
} |
|
|
},{ |
|
|
}, |
|
|
|
|
|
{ |
|
|
deep: true |
|
|
deep: true |
|
|
}) |
|
|
} |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
// 弹层确定返回所选数据 |
|
|
// 弹层确定返回所选数据 |
|
|
// val : 弹层列表row 数据 |
|
|
// val : 弹层列表row 数据 |
|
@ -540,7 +579,13 @@ const searchTableSuccess = (formField, searchField, val, type, row) => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 打开弹窗 */ |
|
|
/** 打开弹窗 */ |
|
|
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any, alltitleName?: any) => { |
|
|
const open = async ( |
|
|
|
|
|
type: string, |
|
|
|
|
|
row?: any, |
|
|
|
|
|
masterParmas?: any, |
|
|
|
|
|
titleName?: any, |
|
|
|
|
|
alltitleName?: any |
|
|
|
|
|
) => { |
|
|
dialogVisible.value = true |
|
|
dialogVisible.value = true |
|
|
if (alltitleName) { |
|
|
if (alltitleName) { |
|
|
dialogTitle.value = alltitleName |
|
|
dialogTitle.value = alltitleName |
|
@ -576,16 +621,19 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any |
|
|
const handleAddTable = () => { |
|
|
const handleAddTable = () => { |
|
|
if (props.isOpenSearchTable) { |
|
|
if (props.isOpenSearchTable) { |
|
|
const tableFormKeys = {} |
|
|
const tableFormKeys = {} |
|
|
tableAllSchemas.value.tableFormColumns.forEach(item => { |
|
|
tableAllSchemas.value.tableFormColumns.forEach((item) => { |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
}) |
|
|
}) |
|
|
if (props.fieldTableColumn != '') { |
|
|
if (props.fieldTableColumn != '') { |
|
|
inpuFocus(tableAllSchemas.value.tableFormColumns.find(item=>item.field==props.fieldTableColumn),tableFormKeys,0) |
|
|
inpuFocus( |
|
|
|
|
|
tableAllSchemas.value.tableFormColumns.find((item) => item.field == props.fieldTableColumn), |
|
|
|
|
|
tableFormKeys, |
|
|
|
|
|
0 |
|
|
|
|
|
) |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
emit('handleAddTable') |
|
|
emit('handleAddTable') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 弹窗按钮 */ |
|
|
/** 弹窗按钮 */ |
|
@ -756,11 +804,8 @@ const handleDeleteTable = (row, index) => { |
|
|
emit('handleDeleteTable', row, index, formRef.value) |
|
|
emit('handleDeleteTable', row, index, formRef.value) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 输入框聚焦 |
|
|
// 输入框聚焦 |
|
|
const inpuFocus = (headerItem, row, index) => { |
|
|
const inpuFocus = (headerItem, row, index) => { |
|
|
|
|
|
|
|
|
emit('inpuFocus', headerItem, row, index) |
|
|
emit('inpuFocus', headerItem, row, index) |
|
|
|
|
|
|
|
|
opensearchTable( |
|
|
opensearchTable( |
|
@ -796,48 +841,31 @@ const onChange = (field, cur) => { |
|
|
*/ |
|
|
*/ |
|
|
const onBlur = async (field, e) => { |
|
|
const onBlur = async (field, e) => { |
|
|
isExecute.value = false |
|
|
isExecute.value = false |
|
|
if ( |
|
|
|
|
|
field == 'supplierCode' || |
|
|
let formSchemaObj = formSchema.value.find((item) => item.field == field)?.componentProps |
|
|
field == 'itemCode' || |
|
|
if (formSchemaObj?.enterSearch) { |
|
|
field == 'productItemCode' || |
|
|
if (formSchemaObj.verificationPage) { |
|
|
field == 'componentItemCode' || |
|
|
|
|
|
field == 'packUnit' || |
|
|
|
|
|
field == 'inPackUnit' || |
|
|
|
|
|
field == 'fromPackingNumber' |
|
|
|
|
|
) { |
|
|
|
|
|
await FormBlur( |
|
|
|
|
|
field, |
|
|
|
|
|
e, |
|
|
|
|
|
routeName.value, |
|
|
|
|
|
formRef.value, |
|
|
|
|
|
props.detailData, |
|
|
|
|
|
formSchema.value, |
|
|
|
|
|
(searchField, list) => { |
|
|
|
|
|
emit('searchTableSuccess', field, searchField, list, formRef.value, 'form') |
|
|
|
|
|
} |
|
|
|
|
|
) |
|
|
|
|
|
} else { |
|
|
|
|
|
let formSchemaObj = formSchema.value.find((item) => item.field == field) |
|
|
|
|
|
let searchCondition1 = formSchema.value.find((item) => item.field == field).componentProps |
|
|
let searchCondition1 = formSchema.value.find((item) => item.field == field).componentProps |
|
|
.searchCondition //获取data.ts参数信息 |
|
|
.searchCondition //获取data.ts参数信息 |
|
|
if (formSchemaObj?.componentProps?.enterSearch) { |
|
|
let verificationParams = formSchema.value.find((item) => item.field == field).componentProps |
|
|
|
|
|
.verificationParams //获取失去焦点参数信息 |
|
|
|
|
|
console.log('走新方法啦') |
|
|
if (e && isString(e)) { |
|
|
if (e && isString(e)) { |
|
|
let setV = {} |
|
|
let setV = {} |
|
|
setV[field] = '' |
|
|
setV[field] = '' |
|
|
let obj = {} |
|
|
let params = {} |
|
|
console.log(233,searchCondition1) |
|
|
|
|
|
// 循环参数设置参数为key:value格式 |
|
|
// 循环参数设置参数为key:value格式 |
|
|
if (searchCondition1 && searchCondition1.length > 0) { |
|
|
if (searchCondition1 && searchCondition1.length > 0) { |
|
|
for (let i = 0; i < searchCondition1.length; i++) { |
|
|
for (let i = 0; i < searchCondition1.length; i++) { |
|
|
if (searchCondition1[i].isMainValue) { |
|
|
if (searchCondition1[i].isMainValue) { |
|
|
obj[searchCondition1[i].key] = formRef.value.formModel[searchCondition1[i].value] |
|
|
params[searchCondition1[i].key] = formRef.value.formModel[searchCondition1[i].value] |
|
|
? formRef.value.formModel[searchCondition1[i].value] |
|
|
? formRef.value.formModel[searchCondition1[i].value] |
|
|
: props.detailData |
|
|
: props.detailData |
|
|
? props.detailData[searchCondition1[i].value] |
|
|
? props.detailData[searchCondition1[i].value] |
|
|
: '' |
|
|
: '' |
|
|
// 是否含有空参数情况 |
|
|
// 是否含有空参数情况 |
|
|
let isNull = false |
|
|
let isNull = false |
|
|
if (obj[searchCondition1[i].key] == '' || obj[searchCondition1[i].key] == undefined) { |
|
|
if (params[searchCondition1[i].key] == '' || params[searchCondition1[i].key] == undefined) { |
|
|
isNull = true |
|
|
isNull = true |
|
|
} |
|
|
} |
|
|
if (isNull) { |
|
|
if (isNull) { |
|
@ -865,29 +893,30 @@ console.log(233,searchCondition1) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
obj[searchCondition1[i].key] = searchCondition1[i].value |
|
|
params[searchCondition1[i].key] = searchCondition1[i].value |
|
|
} else { |
|
|
} else { |
|
|
obj[searchCondition1[i].key] = searchCondition1[i].value |
|
|
params[searchCondition1[i].key] = searchCondition1[i].value |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (!formSchemaObj?.componentProps.multiple && e.indexOf(',') > -1) { |
|
|
// 循环参数设置参数为key:value格式 |
|
|
|
|
|
if (verificationParams && verificationParams.length > 0) { |
|
|
|
|
|
for (let i = 0; i < verificationParams.length; i++) { |
|
|
|
|
|
params[verificationParams[i].key] = e?.trim() |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
console.log(333,params) |
|
|
|
|
|
if (!formSchemaObj?.multiple && e.indexOf(',') > -1) { |
|
|
message.alert('该输入框只能输入一条数据') |
|
|
message.alert('该输入框只能输入一条数据') |
|
|
formRef.value.setValues(setV) |
|
|
formRef.value.setValues(setV) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
if (props.byCodespageApi) { |
|
|
await formSchemaObj.verificationPage(params).then((res) => { |
|
|
let params = {} |
|
|
|
|
|
if (props.byCodesParams) { |
|
|
|
|
|
params = { ...props.byCodesParams, ...obj, codes: e } |
|
|
|
|
|
} else { |
|
|
|
|
|
params = { ...obj, codes: e } |
|
|
|
|
|
} |
|
|
|
|
|
await props.byCodespageApi(params).then((res) => { |
|
|
|
|
|
let arr1 = e.split(',') |
|
|
let arr1 = e.split(',') |
|
|
let list = ref([]) |
|
|
let list = ref([]) |
|
|
list.value = res |
|
|
list.value = res |
|
|
|
|
|
console.log(222, list.value) |
|
|
if (list.value?.length == 0) { |
|
|
if (list.value?.length == 0) { |
|
|
message.alert('暂无数据') |
|
|
message.alert('暂无数据') |
|
|
formRef.value.setValues(setV) |
|
|
formRef.value.setValues(setV) |
|
@ -903,51 +932,111 @@ console.log(233,searchCondition1) |
|
|
formRef.value.setValues(setV) |
|
|
formRef.value.setValues(setV) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
emit( |
|
|
// emit('searchTableSuccess', formField, searchField, list.value, formRef.value, 'form') |
|
|
'searchTableSuccess', |
|
|
// callback(list.value) |
|
|
|
|
|
}) |
|
|
|
|
|
// emit( |
|
|
|
|
|
// 'onBlur', |
|
|
|
|
|
// field, |
|
|
|
|
|
// e, |
|
|
|
|
|
// formSchemaObj.componentProps.searchField, |
|
|
|
|
|
// formSchemaObj, |
|
|
|
|
|
// formRef.value, |
|
|
|
|
|
// 'form', |
|
|
|
|
|
// obj |
|
|
|
|
|
// ) |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
if ( |
|
|
|
|
|
field == 'supplierCode' || |
|
|
|
|
|
field == 'itemCode' || |
|
|
|
|
|
field == 'productItemCode' || |
|
|
|
|
|
field == 'componentItemCode' || |
|
|
|
|
|
field == 'packUnit' || |
|
|
|
|
|
field == 'inPackUnit' || |
|
|
|
|
|
field == 'fromPackingNumber' |
|
|
|
|
|
) { |
|
|
|
|
|
await FormBlur( |
|
|
field, |
|
|
field, |
|
|
searchCondition1.searchField, |
|
|
e, |
|
|
list, |
|
|
routeName.value, |
|
|
formRef.value, |
|
|
formRef.value, |
|
|
'form' |
|
|
props.detailData, |
|
|
|
|
|
formSchema.value, |
|
|
|
|
|
(searchField, list) => { |
|
|
|
|
|
emit('searchTableSuccess', field, searchField, list, formRef.value, 'form') |
|
|
|
|
|
} |
|
|
) |
|
|
) |
|
|
}) |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
emit('onBlur', field, e) |
|
|
emit('onBlur', field, e) |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
isExecute.value = true |
|
|
isExecute.value = true |
|
|
emit('onBlur', field, e) |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 批量增加 |
|
|
// 批量增加 |
|
|
const batchAdd = async (val) => { |
|
|
const batchAdd = async (val) => { |
|
|
const row = {} |
|
|
const row = {} |
|
|
tableAllSchemas.value.tableFormColumns.forEach((item) => { |
|
|
tableAllSchemas.value.tableFormColumns.forEach((item) => { |
|
|
row[item.field] = item.default ? item.default : '' |
|
|
row[item.field] = item.default ? item.default : '' |
|
|
}) |
|
|
}) |
|
|
const headerItem = tableAllSchemas.value.tableColumns.find((item) => item.field == props.fieldTableColumn) |
|
|
const headerItem = tableAllSchemas.value.tableColumns.find( |
|
|
|
|
|
(item) => item.field == props.fieldTableColumn |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
await getListByBottonInput(headerItem, val,row,routeName.value,formRef.value,props.detailData,props.tableData,(list)=>{ |
|
|
await getListByBottonInput( |
|
|
emit('searchTableSuccess',headerItem.field,'itemCode',list, formRef.value,'tableForm',row) |
|
|
headerItem, |
|
|
}) |
|
|
val, |
|
|
|
|
|
row, |
|
|
|
|
|
routeName.value, |
|
|
|
|
|
formRef.value, |
|
|
|
|
|
props.detailData, |
|
|
|
|
|
props.tableData, |
|
|
|
|
|
(list) => { |
|
|
|
|
|
emit( |
|
|
|
|
|
'searchTableSuccess', |
|
|
|
|
|
headerItem.field, |
|
|
|
|
|
'itemCode', |
|
|
|
|
|
list, |
|
|
|
|
|
formRef.value, |
|
|
|
|
|
'tableForm', |
|
|
|
|
|
row |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const inputStringBlur = async (headerItem, val, row, index) => { |
|
|
const inputStringBlur = async (headerItem, val, row, index) => { |
|
|
// isExecute.value = false |
|
|
// isExecute.value = false |
|
|
await tableFormBlurVer(headerItem,val,row,index,routeName.value,formRef.value,props.detailData,props.tableData,(searchField, list)=>{ |
|
|
await tableFormBlurVer( |
|
|
emit('searchTableSuccess',headerItem.field,searchField,list, formRef.value,'tableForm',row,'blur',index) |
|
|
headerItem, |
|
|
}) |
|
|
val, |
|
|
|
|
|
row, |
|
|
|
|
|
index, |
|
|
|
|
|
routeName.value, |
|
|
|
|
|
formRef.value, |
|
|
|
|
|
props.detailData, |
|
|
|
|
|
props.tableData, |
|
|
|
|
|
(searchField, list) => { |
|
|
|
|
|
emit( |
|
|
|
|
|
'searchTableSuccess', |
|
|
|
|
|
headerItem.field, |
|
|
|
|
|
searchField, |
|
|
|
|
|
list, |
|
|
|
|
|
formRef.value, |
|
|
|
|
|
'tableForm', |
|
|
|
|
|
row, |
|
|
|
|
|
'blur', |
|
|
|
|
|
index |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
// isExecute.value = true |
|
|
// isExecute.value = true |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 回车事件 |
|
|
* 回车事件 |
|
|
* @param field 当前操作字段 |
|
|
* @param field 当前操作字段 |
|
@ -967,18 +1056,25 @@ const selectChangeDetail = (field, val,formSchema) => { |
|
|
emit('selectChangeDetail', field, val) |
|
|
emit('selectChangeDetail', field, val) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const tableFormChange = (field, val, row) => { |
|
|
const tableFormChange = (field, val, row) => { |
|
|
emit('tableFormChange', field, val, row) |
|
|
emit('tableFormChange', field, val, row) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const buttonOperationClick = (row, label, index) => { |
|
|
const buttonOperationClick = (row, label, index) => { |
|
|
emit("buttonOperationClick", row, label, index); |
|
|
emit('buttonOperationClick', row, label, index) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
defineExpose({ |
|
|
defineExpose({ open, formRef, opensearchTable, dialogVisible, formLoading ,handleAddTable,changeDialogWidth,searchTableRef,tableFormRef}) // 提供 open 方法,用于打开弹窗 |
|
|
open, |
|
|
|
|
|
formRef, |
|
|
|
|
|
opensearchTable, |
|
|
|
|
|
dialogVisible, |
|
|
|
|
|
formLoading, |
|
|
|
|
|
handleAddTable, |
|
|
|
|
|
changeDialogWidth, |
|
|
|
|
|
searchTableRef, |
|
|
|
|
|
tableFormRef |
|
|
|
|
|
}) // 提供 open 方法,用于打开弹窗 |
|
|
</script> |
|
|
</script> |
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
|
.table { |
|
|
.table { |
|
@ -1007,8 +1103,8 @@ defineExpose({ open, formRef, opensearchTable, dialogVisible, formLoading ,handl |
|
|
|
|
|
|
|
|
::v-deep(.el-icon) { |
|
|
::v-deep(.el-icon) { |
|
|
display: block; |
|
|
display: block; |
|
|
}button |
|
|
} |
|
|
.button { |
|
|
button .button { |
|
|
> div { |
|
|
> div { |
|
|
display: flex; |
|
|
display: flex; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|