|
|
|
@ -1,7 +1,7 @@ |
|
|
|
<template> |
|
|
|
<div class="flex w-100"> |
|
|
|
<div class="flex1 flex"> |
|
|
|
<el-input v-if="type === 'input'" :maxlength="item.maxlength || 30" :disabled="item.disabled" |
|
|
|
<el-input v-if="type === 'input'" :maxlength="item.maxlength || 30" :disabled="getDisabled()" |
|
|
|
:class="item.fillType | getFillType" |
|
|
|
:placeholder="item.placeholder ? item.placeholder : ('请输入' + item.label)" |
|
|
|
v-model="inputValue" /> |
|
|
|
@ -9,6 +9,7 @@ |
|
|
|
:multiple = "item.multiple" |
|
|
|
:class="item.fillType | getFillType" |
|
|
|
v-model="inputValue" |
|
|
|
:disabled="getDisabled()" |
|
|
|
:placeholder="item.placeholder ? item.placeholder : ('请选择' + item.label)" |
|
|
|
@change = "onSelectChange" |
|
|
|
> |
|
|
|
@ -20,11 +21,13 @@ |
|
|
|
v-else-if="type === 'dateTime'" class="flex1" |
|
|
|
:class="item.fillType | getFillType" |
|
|
|
v-model="inputValue" |
|
|
|
:disabled="getDisabled()" |
|
|
|
format="yyyy/MM/DD HH:mm:ss" value-format="yyyy/MM/DD HH:mm:ss" |
|
|
|
:placeholder="item.placeholder ? item.placeholder : ('请选择' + item.label)"> |
|
|
|
</el-date-picker> |
|
|
|
</div> |
|
|
|
<div class="handle-row"> |
|
|
|
<!-- qc才能操作 --> |
|
|
|
<div class="handle-row" v-if="isShowHandle()"> |
|
|
|
<i class="el-icon-question"></i> |
|
|
|
<el-checkbox></el-checkbox> |
|
|
|
<span @click="onCopy">复制</span> |
|
|
|
@ -40,10 +43,6 @@ export default { |
|
|
|
type:String, |
|
|
|
default:"input" |
|
|
|
}, |
|
|
|
fillType: { |
|
|
|
type: String, |
|
|
|
default: "" |
|
|
|
}, |
|
|
|
item: { |
|
|
|
type: Object, |
|
|
|
default: () => { |
|
|
|
@ -91,6 +90,30 @@ export default { |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
//判断是否显示操作按钮 |
|
|
|
isShowHandle(){ |
|
|
|
const {fillType} = this.item; |
|
|
|
const {templateStatus} = this.$store.state.template; |
|
|
|
//只有当模板状态是qc和实际填报时,才显示操作按钮 |
|
|
|
return (templateStatus === "qc" || templateStatus === "actFill")&&fillType === "actFill"; |
|
|
|
}, |
|
|
|
//判断是否禁用 |
|
|
|
getDisabled(){ |
|
|
|
const {item} = this; |
|
|
|
const {fillType} = item; |
|
|
|
if(item.hasOwnProperty("disabled")){ |
|
|
|
return item.disabled |
|
|
|
}else{ |
|
|
|
const {templateStatus} = this.$store.state.template; |
|
|
|
if(fillType === "actFill"){//当模板状态是实际填写时,只有当fillType是actFill时才能填写 |
|
|
|
return templateStatus !== "actFill" |
|
|
|
}else if(fillType === "preFill"){//当模板状态是预填写时,只有当fillType是preFill才能填写 |
|
|
|
return templateStatus !== "preFill" |
|
|
|
}else{ |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
onCopy() { |
|
|
|
this.$emit("copy") |
|
|
|
}, |
|
|
|
@ -132,6 +155,9 @@ export default { |
|
|
|
&:hover { |
|
|
|
border-color: #f9c588; |
|
|
|
} |
|
|
|
&:disabled { |
|
|
|
border-color: #f9c588 !important; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
@ -147,6 +173,9 @@ export default { |
|
|
|
&:hover { |
|
|
|
border-color: green; |
|
|
|
} |
|
|
|
&:disabled { |
|
|
|
border-color: green !important; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
@ -162,6 +191,9 @@ export default { |
|
|
|
&:hover { |
|
|
|
border-color: #4ea2ff; |
|
|
|
} |
|
|
|
&:disabled { |
|
|
|
border-color: #4ea2ff !important; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |