Browse Source

feat:[模板管理][update]

ouqian
luojie 1 month ago
parent
commit
8854fdee85
3 changed files with 25 additions and 7 deletions
  1. +16
    -5
      src/components/Template/HandleFormItem.vue
  2. +6
    -0
      src/utils/formPackageCommon.js
  3. +3
    -2
      src/views/business/comps/template/formConfig/sp/SP0019.js

+ 16
- 5
src/components/Template/HandleFormItem.vue View File

@ -51,7 +51,7 @@
</div> </div>
<div v-else-if="type === 'checkboxTree'" class="flex1 checkbox-list-container" <div v-else-if="type === 'checkboxTree'" class="flex1 checkbox-list-container"
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')"> :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')">
<div v-for="group in item.options" :key="group.value" class="checkbox-tree-group">
<div v-for="group in item.options" :key="group.value" class="checkbox-tree-group" :class="{'item-center': isShowOtherByCheckboxTree(group.value)}">
<el-checkbox :label="group.value" :disabled="getDisabled()" <el-checkbox :label="group.value" :disabled="getDisabled()"
:value="getCheckboxTreeChecked(group.value)" :value="getCheckboxTreeChecked(group.value)"
:indeterminate="getCheckboxTreeIndeterminate(group.value)" :indeterminate="getCheckboxTreeIndeterminate(group.value)"
@ -65,13 +65,18 @@
@change="onCheckboxTreeChildChange(group, child.value, $event)"> @change="onCheckboxTreeChildChange(group, child.value, $event)">
{{ child.label }} {{ child.label }}
</el-checkbox> </el-checkbox>
<div v-if="(child.value === '样品信息' || child.value === '其他') && isCheckboxTreeChecked(child.value)"
<div v-if="isShowOtherByCheckboxTree(child.value) && isCheckboxTreeChecked(child.value)"
class="checkbox-tree-input-container"> class="checkbox-tree-input-container">
<el-input maxlength = "100" v-model="inputValue.otherValues[child.value]" <el-input maxlength = "100" v-model="inputValue.otherValues[child.value]"
placeholder="请输入" @blur="onCheckboxTreeOtherBlur(child.value, $event)" /> placeholder="请输入" @blur="onCheckboxTreeOtherBlur(child.value, $event)" />
</div> </div>
</div> </div>
</div> </div>
<div v-if="isShowOtherByCheckboxTree(group.value) && isCheckboxTreeChecked(group.value)"
class="checkbox-tree-input-container">
<el-input maxlength = "100" v-model="inputValue.otherValues[group.value]"
placeholder="请输入" @blur="onCheckboxTreeOtherBlur(group.value, $event)" />
</div>
</div> </div>
</div> </div>
<el-date-picker v-else-if="type === 'dateTime'" type="datetime" class="flex1" <el-date-picker v-else-if="type === 'dateTime'" type="datetime" class="flex1"
@ -225,7 +230,8 @@ import DecimalInput from "./DecimalInput.vue";
import { EventBus } from "@/utils/eventBus"; import { EventBus } from "@/utils/eventBus";
import moment from "moment"; import moment from "moment";
import { getuuid,isEqual ,deepClone,getDefaultValueByOptions,isValueEmpty} from "@/utils/index.js"; import { getuuid,isEqual ,deepClone,getDefaultValueByOptions,isValueEmpty} from "@/utils/index.js";
import { getToken } from "@/utils/auth"
import { getToken } from "@/utils/auth";
import { isShowOtherByCheckboxTree } from "@/utils/formPackageCommon";
export default { export default {
inject: ['templateData', 'templateFillType', "getZdxgjl", "getFhyjjl", "updateZdxgjl", "replaceFhyjjl", "updateFhyjjl", "getFieldCheckObj", "updateFieldCheckObj"], inject: ['templateData', 'templateFillType', "getZdxgjl", "getFhyjjl", "updateZdxgjl", "replaceFhyjjl", "updateFhyjjl", "getFieldCheckObj", "updateFieldCheckObj"],
@ -337,6 +343,7 @@ export default {
currentHandleType: '',// currentHandleType: '',//
currentOtherCode: '',//otherCode currentOtherCode: '',//otherCode
currentCheckboxTreeValue: '',//checkboxTree currentCheckboxTreeValue: '',//checkboxTree
isShowOtherByCheckboxTree
} }
}, },
@ -1276,8 +1283,8 @@ export default {
recordValue = `${newValue.label || ''}:${newValue.checked ? '勾选' : '未勾选'}`; recordValue = `${newValue.label || ''}:${newValue.checked ? '勾选' : '未勾选'}`;
isModify = newValue.checked !== undefined; isModify = newValue.checked !== undefined;
} else { } else {
recordOldVlaue = `${current.des + current.oldValue}`;
recordValue = `${current.des + current.newValue}`;
recordOldVlaue = `${current.des +( current.oldValue || '')}`;
recordValue = `${current.des + (current.newValue || '')}`;
isModify = !!current.oldValue; isModify = !!current.oldValue;
} }
} }
@ -2035,4 +2042,8 @@ export default {
margin-left: 10px; margin-left: 10px;
width: 500px; width: 500px;
} }
.item-center{
display: flex;
align-items: center;
}
</style> </style>

+ 6
- 0
src/utils/formPackageCommon.js View File

@ -17,3 +17,9 @@ export const isShowOtherByRadioAndOther = (v = '', col) => {
const otherArr = ['其他', '异常', '不一致'] const otherArr = ['其他', '异常', '不一致']
return otherArr.includes(v) return otherArr.includes(v)
} }
//checkboxTree判断是否显示其他输入框
export const isShowOtherByCheckboxTree = (v = "")=>{
const otherArr = ['其他', '样品信息', '样品']
return otherArr.includes(v)
}

+ 3
- 2
src/views/business/comps/template/formConfig/sp/SP0019.js View File

@ -135,12 +135,13 @@ export const getYqphFormConfig = () => {
config: { config: {
yqph: { yqph: {
label: '仪器平衡', label: '仪器平衡',
type: 'checkboxList',
type: 'checkboxTree',
fillType: 'actFill', fillType: 'actFill',
span:1,
options: [ options: [
{ label: '流动相平衡', value: '流动相平衡' }, { label: '流动相平衡', value: '流动相平衡' },
{ label: '样品平衡', value: '样品平衡' }, { label: '样品平衡', value: '样品平衡' },
{ label: '样品', value: '样品' ,otherCode:'ypOther'},
{ label: '样品', value: '样品'},
{ label: '未平衡', value: '未平衡' } { label: '未平衡', value: '未平衡' }
] ]
}, },

Loading…
Cancel
Save