|
@ -14,6 +14,7 @@ |
|
|
:schema="formSchema" |
|
|
:schema="formSchema" |
|
|
:is-col="true" |
|
|
:is-col="true" |
|
|
@opensearchTable="opensearchTable" |
|
|
@opensearchTable="opensearchTable" |
|
|
|
|
|
@onChange="onChange" |
|
|
> |
|
|
> |
|
|
<template #crontab="formSchema" v-if="fromeWhere == 'countPlan'"> |
|
|
<template #crontab="formSchema" v-if="fromeWhere == 'countPlan'"> |
|
|
<crontab v-model="formSchema.crontab" /> |
|
|
<crontab v-model="formSchema.crontab" /> |
|
@ -82,6 +83,8 @@ |
|
|
@handleTableSelect="handleTableSelect" |
|
|
@handleTableSelect="handleTableSelect" |
|
|
@inpuFocus="inpuFocus" |
|
|
@inpuFocus="inpuFocus" |
|
|
@buttonOperationClick="buttonOperationClick" |
|
|
@buttonOperationClick="buttonOperationClick" |
|
|
|
|
|
@inputStringBlur="inputStringBlur" |
|
|
|
|
|
@inputNumberChange="inputNumberChange" |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
<div v-if="isBusiness && formType == 'create' && fromeWhere == 'countPlan'"> |
|
|
<div v-if="isBusiness && formType == 'create' && fromeWhere == 'countPlan'"> |
|
@ -281,30 +284,39 @@ const opensearchTable = ( |
|
|
if (searchCondition && searchCondition.length > 0) { |
|
|
if (searchCondition && searchCondition.length > 0) { |
|
|
// 转换筛选条件所需 |
|
|
// 转换筛选条件所需 |
|
|
let filters: any[] = [] |
|
|
let filters: any[] = [] |
|
|
searchCondition.forEach((item) => { |
|
|
for (var i=0; i< searchCondition.length; i++ ) { |
|
|
|
|
|
// searchCondition.forEach((item) => { |
|
|
// 查询条件为主表某字段,需要赋值主表数据,数据来源是详情的,赋值需要从row中获取 |
|
|
// 查询条件为主表某字段,需要赋值主表数据,数据来源是详情的,赋值需要从row中获取 |
|
|
// 20231127 row[item.value]?row[item.value] 修改为 row?row[item.value] 返回'null' 为了查询不到任何数据 |
|
|
if (searchCondition[i].isMainValue) { |
|
|
if (item.isMainValue) { |
|
|
_searchCondition[searchCondition[i].key] = formRef.value.formModel[searchCondition[i].value] |
|
|
_searchCondition[item.key] = formRef.value.formModel[item.value] |
|
|
? formRef.value.formModel[searchCondition[i].value] |
|
|
? formRef.value.formModel[item.value] |
|
|
|
|
|
: props.detailData |
|
|
: props.detailData |
|
|
? props.detailData[item.value] |
|
|
? props.detailData[searchCondition[i].value] |
|
|
: row |
|
|
: row |
|
|
? row[item.value] |
|
|
? row[searchCondition[i].value] |
|
|
: 'null' |
|
|
: '' |
|
|
|
|
|
// 是否含有空参数情况 |
|
|
|
|
|
let isNull = false |
|
|
|
|
|
if (_searchCondition[searchCondition[i].key] == '' || _searchCondition[searchCondition[i].key] == undefined) { |
|
|
|
|
|
isNull = true |
|
|
|
|
|
} |
|
|
|
|
|
if (isNull) { |
|
|
|
|
|
message.warning(searchCondition[i].message?searchCondition[i].message:'前置条件未选择!') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
// 扩展 转换为筛选条件进行查询 |
|
|
// 扩展 转换为筛选条件进行查询 |
|
|
if (item.isSearch) { |
|
|
if (searchCondition[i].isSearch) { |
|
|
filters.push({ |
|
|
filters.push({ |
|
|
action: item.action, |
|
|
action: searchCondition[i].action, |
|
|
column: item.key, |
|
|
column: searchCondition[i].key, |
|
|
value: item.value |
|
|
value: searchCondition[i].value |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
_searchCondition[item.key] = item.value |
|
|
_searchCondition[searchCondition[i].key] = searchCondition[i].value |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
|
|
|
if (filters.length > 0) { |
|
|
if (filters.length > 0) { |
|
|
_searchCondition.isSearch = true |
|
|
_searchCondition.isSearch = true |
|
|
_searchCondition.filters = filters |
|
|
_searchCondition.filters = filters |
|
@ -333,17 +345,12 @@ const searchTableSuccess = (formField, searchField, val, type, row) => { |
|
|
|
|
|
|
|
|
/** 打开弹窗 */ |
|
|
/** 打开弹窗 */ |
|
|
const open = async (type: string, row?: any, masterParmas?: any) => { |
|
|
const open = async (type: string, row?: any, masterParmas?: any) => { |
|
|
console.log(2222) |
|
|
|
|
|
dialogVisible.value = true |
|
|
dialogVisible.value = true |
|
|
console.log(333) |
|
|
|
|
|
dialogTitle.value = t('action.' + type) |
|
|
dialogTitle.value = t('action.' + type) |
|
|
console.log(444) |
|
|
|
|
|
formType.value = type |
|
|
formType.value = type |
|
|
console.log(66) |
|
|
|
|
|
resetForm() |
|
|
resetForm() |
|
|
// 修改时,设置数据 |
|
|
// 修改时,设置数据 |
|
|
// 如果是从主表的详情页面进图添加子表,需要添加masterId,number参数 |
|
|
// 如果是从主表的详情页面进图添加子表,需要添加masterId,number参数 |
|
|
console.log(77) |
|
|
|
|
|
if (masterParmas) { |
|
|
if (masterParmas) { |
|
|
if (!row) { |
|
|
if (!row) { |
|
|
row = { |
|
|
row = { |
|
@ -352,10 +359,8 @@ const open = async (type: string, row?: any, masterParmas?: any) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
console.log(8) |
|
|
|
|
|
if (row?.id || row?.masterId) { |
|
|
if (row?.id || row?.masterId) { |
|
|
formLoading.value = true |
|
|
formLoading.value = true |
|
|
console.log(99) |
|
|
|
|
|
try { |
|
|
try { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
formRef.value.setValues(row) |
|
|
formRef.value.setValues(row) |
|
@ -460,7 +465,10 @@ const emit = defineEmits([ |
|
|
'selectChange', |
|
|
'selectChange', |
|
|
'selectChangeDetail', |
|
|
'selectChangeDetail', |
|
|
'tableFormChange', |
|
|
'tableFormChange', |
|
|
'buttonOperationClick' |
|
|
'buttonOperationClick', |
|
|
|
|
|
'inputStringBlur', |
|
|
|
|
|
'onChange', |
|
|
|
|
|
'inputNumberChange' |
|
|
]) |
|
|
]) |
|
|
//普通下拉改变事件 |
|
|
//普通下拉改变事件 |
|
|
const formSelectChange = (field, val, row) => { |
|
|
const formSelectChange = (field, val, row) => { |
|
@ -477,6 +485,11 @@ const tableSelectionChange = (val) => { |
|
|
const tableSortChange = (column, prop, order) => { |
|
|
const tableSortChange = (column, prop, order) => { |
|
|
emit('tableSortChange', column, prop, order) |
|
|
emit('tableSortChange', column, prop, order) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 数字输入-改变事件 |
|
|
|
|
|
const inputNumberChange = (field, index, row, val) => { |
|
|
|
|
|
emit('inputNumberChange', field, index, row, val) |
|
|
|
|
|
} |
|
|
//下拉框回显方法 |
|
|
//下拉框回显方法 |
|
|
// const showSelect = (val, statusID) => { |
|
|
// const showSelect = (val, statusID) => { |
|
|
// return getDictForStatusID(val, statusID) |
|
|
// return getDictForStatusID(val, statusID) |
|
@ -509,6 +522,14 @@ const inpuFocus = (headerItem, row, index) => { |
|
|
row |
|
|
row |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
|
|
|
/** |
|
|
|
|
|
* 监听改变事件 |
|
|
|
|
|
* @param field 当前操作字段 |
|
|
|
|
|
* @param cur 改变后值 |
|
|
|
|
|
*/ |
|
|
|
|
|
const onChange = (field, cur) => { |
|
|
|
|
|
emit('onChange', field, cur) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 修改盘点类型 |
|
|
// 修改盘点类型 |
|
|
const selectChange = (field, val) => { |
|
|
const selectChange = (field, val) => { |
|
@ -529,6 +550,10 @@ const buttonOperationClick = (row, label, index)=> { |
|
|
emit("buttonOperationClick", row, label, index); |
|
|
emit("buttonOperationClick", row, label, index); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const inputStringBlur = (headerItem, row, index)=> { |
|
|
|
|
|
emit("inputStringBlur", headerItem, row, index); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
|
.table { |
|
|
.table { |
|
|