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