|
|
@ -104,10 +104,10 @@ |
|
|
<span v-if="sItem.subType === 'text'" class="sub-text">{{ $t(sItem.subText) }}</span> |
|
|
<span v-if="sItem.subType === 'text'" class="sub-text">{{ $t(sItem.subText) }}</span> |
|
|
<HandleFormItem class="ml-10" v-else-if="sItem.subType === 'button'" type="button" |
|
|
<HandleFormItem class="ml-10" v-else-if="sItem.subType === 'button'" type="button" |
|
|
:item="getButtonItem(sItem)" :value="formFields[sItem.subKey]" |
|
|
:item="getButtonItem(sItem)" :value="formFields[sItem.subKey]" |
|
|
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data,sItem.subKey)" /> |
|
|
|
|
|
|
|
|
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data, sItem.subKey)" /> |
|
|
<HandleFormItem class="ml-10" v-else-if="sItem.thirdType === 'button'" type="button" |
|
|
<HandleFormItem class="ml-10" v-else-if="sItem.thirdType === 'button'" type="button" |
|
|
:item="getThirdButtonItem(sItem)" :value="formFields[sItem.thirdKey]" |
|
|
:item="getThirdButtonItem(sItem)" :value="formFields[sItem.thirdKey]" |
|
|
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data,sItem.thirdKey)" /> |
|
|
|
|
|
|
|
|
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data, sItem.thirdKey)" /> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div v-else-if="sItem.type === 'clickable'" class="flex1"> |
|
|
<div v-else-if="sItem.type === 'clickable'" class="flex1"> |
|
|
@ -212,49 +212,52 @@ |
|
|
<div v-else-if="sItem.type === 'input' || sItem.type === 'inputNumber'" class="flex flex1"> |
|
|
<div v-else-if="sItem.type === 'input' || sItem.type === 'inputNumber'" class="flex flex1"> |
|
|
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key" |
|
|
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key" |
|
|
:type="sItem.type" @blur="onBlur(key, $event)" class="flex1" :item="sItem" |
|
|
:type="sItem.type" @blur="onBlur(key, $event)" class="flex1" :item="sItem" |
|
|
v-model="formFields[key]" @copy="onCopy(sItem, key)" :error="errors[key]" |
|
|
|
|
|
|
|
|
v-model="formFields[key]" @copy="onCopy(sItem, key)" :error="errors[key]" :ref="key" |
|
|
@update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" /> |
|
|
@update:error="errors[key] = false" :orange-bg="orangeBgFields[key]" /> |
|
|
<HandleFormItem :field-item-label="fieldItemLabel" |
|
|
|
|
|
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10" |
|
|
|
|
|
v-if="sItem.subType === 'select'" type="select" :item="getSubItem(sItem)" |
|
|
|
|
|
v-model="formFields[sItem.subKey]" @copy="onCopy(sItem, key)" |
|
|
|
|
|
@change="(e, type) => onSelectChange(sItem.subKey, e, type)" |
|
|
|
|
|
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false" |
|
|
|
|
|
:orange-bg="orangeBgFields[sItem.subKey]" /> |
|
|
|
|
|
<HandleFormItem :field-item-label="fieldItemLabel" |
|
|
|
|
|
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10" |
|
|
|
|
|
v-if="sItem.subType === 'input'" type="input" :item="getSubItem(sItem)" |
|
|
|
|
|
v-model="formFields[sItem.subKey]" @copy="onCopy(sItem, key)" |
|
|
|
|
|
:error="errors[sItem.subKey]" @blur="onBlur(sItem.subKey, $event)" |
|
|
|
|
|
@update:error="errors[sItem.subKey] = false" |
|
|
|
|
|
:orange-bg="orangeBgFields[sItem.subKey]" /> |
|
|
|
|
|
<div class="ml-10 item-span" v-else-if="sItem.subType === 'span'">{{ |
|
|
|
|
|
formFields[sItem.subKey] }}</div> |
|
|
|
|
|
<span v-else-if="sItem.subType === 'text'" class="sub-text">{{ $t(sItem.subText) }}</span> |
|
|
|
|
|
<div v-else-if="sItem.subType === 'button'"> |
|
|
|
|
|
<HandleFormItem class="ml-10" type="button" |
|
|
|
|
|
:item="getButtonItem(sItem)" :value="formFields[sItem.subKey]" |
|
|
|
|
|
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data,sItem.subKey)" /> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<HandleFormItem :field-item-label="fieldItemLabel" |
|
|
|
|
|
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10" |
|
|
|
|
|
v-else-if="sItem.subType === 'clickable'" type="clickable" |
|
|
|
|
|
@clickable="handleClickable(sItem, sItem.subKey)" :item="getClickableItem(sItem)" |
|
|
|
|
|
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false" |
|
|
|
|
|
@resetRecord="resetRecord(sItem.subKey)" :value="formFields[sItem.subKey]" /> |
|
|
|
|
|
<HandleFormItem :field-item-label="fieldItemLabel" |
|
|
|
|
|
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10" |
|
|
|
|
|
v-else-if="isRegent(sItem, 'subType')" :type="sItem.subType" |
|
|
|
|
|
:item="getRegentItem(sItem, 'subType')" sourceFrom="baseInfoFormPackage" |
|
|
|
|
|
@beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, sItem.subKey)" |
|
|
|
|
|
@onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, sItem.subKey, sItem)" |
|
|
|
|
|
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false" |
|
|
|
|
|
:value="formFields[sItem.subKey]" /> |
|
|
|
|
|
<div> |
|
|
|
|
|
|
|
|
<template v-if="isShowSub(sItem)"> |
|
|
|
|
|
<HandleFormItem :field-item-label="fieldItemLabel" |
|
|
|
|
|
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10" |
|
|
|
|
|
v-if="sItem.subType === 'select'" type="select" :item="getSubItem(sItem)" |
|
|
|
|
|
v-model="formFields[sItem.subKey]" @copy="onCopy(sItem, key)" |
|
|
|
|
|
@change="(e, type) => onSelectChange(sItem.subKey, e, type)" |
|
|
|
|
|
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false" |
|
|
|
|
|
:orange-bg="orangeBgFields[sItem.subKey]" /> |
|
|
|
|
|
<HandleFormItem :field-item-label="fieldItemLabel" |
|
|
|
|
|
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10" |
|
|
|
|
|
v-if="sItem.subType === 'input'" type="input" :item="getSubItem(sItem)" |
|
|
|
|
|
v-model="formFields[sItem.subKey]" @copy="onCopy(sItem, key)" |
|
|
|
|
|
:error="errors[sItem.subKey]" @blur="onBlur(sItem.subKey, $event)" |
|
|
|
|
|
:ref="sItem.subKey" @update:error="errors[sItem.subKey] = false" |
|
|
|
|
|
:orange-bg="orangeBgFields[sItem.subKey]" /> |
|
|
|
|
|
<div class="ml-10 item-span" v-else-if="sItem.subType === 'span'">{{ |
|
|
|
|
|
formFields[sItem.subKey] }}</div> |
|
|
|
|
|
<span v-else-if="sItem.subType === 'text'" class="sub-text">{{ $t(sItem.subText) |
|
|
|
|
|
}}</span> |
|
|
|
|
|
<div v-else-if="sItem.subType === 'button'"> |
|
|
|
|
|
<HandleFormItem class="ml-10" type="button" :item="getButtonItem(sItem)" |
|
|
|
|
|
:value="formFields[sItem.subKey]" |
|
|
|
|
|
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data, sItem.subKey)" /> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<HandleFormItem :field-item-label="fieldItemLabel" |
|
|
|
|
|
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10" |
|
|
|
|
|
v-else-if="sItem.subType === 'clickable'" type="clickable" |
|
|
|
|
|
@clickable="handleClickable(sItem, sItem.subKey)" :item="getClickableItem(sItem)" |
|
|
|
|
|
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false" |
|
|
|
|
|
@resetRecord="resetRecord(sItem.subKey)" :value="formFields[sItem.subKey]" /> |
|
|
|
|
|
<HandleFormItem :field-item-label="fieldItemLabel" |
|
|
|
|
|
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10" |
|
|
|
|
|
v-else-if="isRegent(sItem, 'subType')" :type="sItem.subType" |
|
|
|
|
|
:item="getRegentItem(sItem, 'subType')" sourceFrom="baseInfoFormPackage" |
|
|
|
|
|
@beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, sItem.subKey)" |
|
|
|
|
|
@onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, sItem.subKey, sItem)" |
|
|
|
|
|
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false" |
|
|
|
|
|
:value="formFields[sItem.subKey]" /> |
|
|
|
|
|
</template> |
|
|
|
|
|
<div v-if="isShowSub(sItem,'thirdType')"> |
|
|
<HandleFormItem class="ml-10" v-if="sItem.thirdType === 'button'" type="button" |
|
|
<HandleFormItem class="ml-10" v-if="sItem.thirdType === 'button'" type="button" |
|
|
:item="getThirdButtonItem(sItem)" :value="formFields[sItem.thirdKey]" |
|
|
|
|
|
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data,sItem.thirdKey)" /> |
|
|
|
|
|
|
|
|
:item="getThirdButtonItem(sItem)" :value="formFields[sItem.thirdKey]" |
|
|
|
|
|
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data, sItem.thirdKey)" /> |
|
|
</div> |
|
|
</div> |
|
|
<div v-show="isShowOther(formFields[sItem.subKey])" class="flex flex1 ml-10"> |
|
|
<div v-show="isShowOther(formFields[sItem.subKey])" class="flex flex1 ml-10"> |
|
|
<div class="other-title" v-if="isShowOtherLabel(sItem)">{{ sItem.otherLabel ? |
|
|
<div class="other-title" v-if="isShowOtherLabel(sItem)">{{ sItem.otherLabel ? |
|
|
@ -269,44 +272,9 @@ |
|
|
:orange-bg="orangeBgFields[sItem.otherCode]" /> |
|
|
:orange-bg="orangeBgFields[sItem.otherCode]" /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<!-- <div class="clickable" :class="getFillType(sItem.subFillType)" v-else-if = "sItem.subType ==='clickable'" @click="handleClickable(sItem,$event)"> |
|
|
|
|
|
<span v-if="formFields[sItem.subKey]">{{ formFields[sItem.subKey] }}</span> |
|
|
|
|
|
<span v-else class="default-placeholder-text">请选择</span> |
|
|
|
|
|
</div> --> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<!-- <div v-else-if="sItem.type === 'inputNumber'" class="flex flex1"> |
|
|
|
|
|
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key" |
|
|
|
|
|
type="inputNumber" @blur="onBlur(key, $event)" class="flex1" :item="sItem" |
|
|
|
|
|
@input="onInputNumberChange(key, $event)" :value="formFields[key]" |
|
|
|
|
|
@copy="onCopy(sItem, key)" :error="errors[key]" @update:error="errors[key] = false" |
|
|
|
|
|
:orange-bg="orangeBgFields[key]" /> |
|
|
|
|
|
<HandleFormItem :field-item-label="fieldItemLabel" |
|
|
|
|
|
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10" |
|
|
|
|
|
v-if="sItem.subType === 'select'" type="select" :item="getSubItem(sItem)" |
|
|
|
|
|
v-model="formFields[sItem.subKey]" @copy="onCopy(sItem, key)" |
|
|
|
|
|
@change="(e, type) => onSelectChange(sItem.subKey, e, type)" |
|
|
|
|
|
:error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false" |
|
|
|
|
|
:orange-bg="orangeBgFields[sItem.subKey]" /> |
|
|
|
|
|
<div class="ml-10 item-span" v-else-if="sItem.subType === 'span'">{{ |
|
|
|
|
|
formFields[sItem.subKey] }}</div> |
|
|
|
|
|
<HandleFormItem class="ml-10" v-else-if="sItem.subType === 'button'" type="button" |
|
|
|
|
|
:item="getButtonItem(sItem)" :value="formFields[sItem.subKey]" |
|
|
|
|
|
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data)" /> |
|
|
|
|
|
<HandleFormItem :field-item-label="fieldItemLabel" |
|
|
|
|
|
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10" |
|
|
|
|
|
v-else-if="sItem.subType === 'clickable'" |
|
|
|
|
|
@clickable="handleClickable(sItem, sItem.subKey)" :error="errors[sItem.subKey]" |
|
|
|
|
|
type="clickable" @update:error="errors[sItem.subKey] = false" |
|
|
|
|
|
@resetRecord="resetRecord(sItem.subKey)" :item="getClickableItem(sItem)" |
|
|
|
|
|
:value="formFields[sItem.subKey]" /> |
|
|
|
|
|
<HandleFormItem :field-item-label="fieldItemLabel" |
|
|
|
|
|
:field-key="prefixKey + '_' + sItem.subKey" class="ml-10" |
|
|
|
|
|
v-else-if="isRegent(sItem, 'subType')" sourceFrom="baseInfoFormPackage" |
|
|
|
|
|
:error="errors[sItem.subKey]" :type="sItem.subType" |
|
|
|
|
|
@beforeReagentSubmit="(data, callback) => onBeforeReagentSubmit(data, callback, sItem.subKey)" |
|
|
|
|
|
@onRegentSubmit="(data, inputValue) => onRegentSubmit(data, inputValue, sItem.subKey, sItem)" |
|
|
|
|
|
:item="getRegentItem(sItem, 'subType')" :value="formFields[sItem.subKey]" /> |
|
|
|
|
|
</div> --> |
|
|
|
|
|
|
|
|
|
|
|
<div v-else-if="sItem.type === 'clickable'" class="flex flex1"> |
|
|
<div v-else-if="sItem.type === 'clickable'" class="flex flex1"> |
|
|
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key" |
|
|
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key" |
|
|
type="clickable" @clickable="handleClickable(sItem, key)" :error="errors[key]" |
|
|
type="clickable" @clickable="handleClickable(sItem, key)" :error="errors[key]" |
|
|
@ -337,7 +305,7 @@ |
|
|
:orange-bg="orangeBgFields[sItem.thirdKey]" /> |
|
|
:orange-bg="orangeBgFields[sItem.thirdKey]" /> |
|
|
<HandleFormItem class="ml-10" v-if="sItem.fourthType === 'button'" type="button" |
|
|
<HandleFormItem class="ml-10" v-if="sItem.fourthType === 'button'" type="button" |
|
|
:item="getFourthButtonItem(sItem)" :value="formFields[sItem.fourthKey]" |
|
|
:item="getFourthButtonItem(sItem)" :value="formFields[sItem.fourthKey]" |
|
|
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data,sItem.fourthKey)" /> |
|
|
|
|
|
|
|
|
@clickButton="(e, val, data) => handleClickButton(e, sItem, val, data, sItem.fourthKey)" /> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
@ -427,6 +395,20 @@ export default { |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
isShowSub(item,type){ |
|
|
|
|
|
if(type === 'thirdType'){ |
|
|
|
|
|
if (item.hasOwnProperty("showThird")) { |
|
|
|
|
|
return item.showThird |
|
|
|
|
|
} |
|
|
|
|
|
return item.thirdType && item.thirdKey; |
|
|
|
|
|
} |
|
|
|
|
|
if (item.hasOwnProperty("showSub")) { |
|
|
|
|
|
return item.showSub |
|
|
|
|
|
} else if (item.subType === 'text') {//如果是span没有值的话就隐藏 |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
return item.subType && item.subKey; |
|
|
|
|
|
}, |
|
|
remoteMethod(query, sItem, key) { |
|
|
remoteMethod(query, sItem, key) { |
|
|
this.$emit('remoteMethod', { query, sItem, key, formFields: this.formFields }) |
|
|
this.$emit('remoteMethod', { query, sItem, key, formFields: this.formFields }) |
|
|
}, |
|
|
}, |
|
|
@ -439,11 +421,11 @@ export default { |
|
|
this.$emit('beforeReagentSubmit', { selectData: data, callback, key, formFields: this.formFields }) |
|
|
this.$emit('beforeReagentSubmit', { selectData: data, callback, key, formFields: this.formFields }) |
|
|
}, |
|
|
}, |
|
|
// 点击按钮 |
|
|
// 点击按钮 |
|
|
handleClickButton(e, item, val, data,key) { |
|
|
|
|
|
|
|
|
handleClickButton(e, item, val, data, key) { |
|
|
if (!item.isClearForm) { |
|
|
if (!item.isClearForm) { |
|
|
this.formFields[item.subKey] = val; |
|
|
|
|
|
|
|
|
this.formFields[key] = val; |
|
|
} |
|
|
} |
|
|
this.$emit("clickButton", item, data,key,this.formFields) |
|
|
|
|
|
|
|
|
this.$emit("clickButton", item, data, key, this.formFields) |
|
|
}, |
|
|
}, |
|
|
// 获取按钮项 |
|
|
// 获取按钮项 |
|
|
getButtonItem(sItem) { |
|
|
getButtonItem(sItem) { |
|
|
|